sandforge 1.82.0 → 1.84.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/README.md +1 -1
  2. package/lib/chunk-23SEDORH.mjs +11 -0
  3. package/lib/{chunk-7WSLT5VX.mjs → chunk-24RFOFYT.mjs} +1 -1
  4. package/lib/chunk-26POJDIT.mjs +7 -0
  5. package/lib/{chunk-SFGZFB4F.mjs → chunk-2AZQHBEF.mjs} +1 -1
  6. package/lib/{chunk-6VSZNZHH.mjs → chunk-2HVOZUM4.mjs} +1 -1
  7. package/lib/{chunk-XFU3HRUV.mjs → chunk-2JDAOWUW.mjs} +1 -1
  8. package/lib/{chunk-BNKT3R3F.mjs → chunk-2METQHGG.mjs} +1 -1
  9. package/lib/chunk-2WFIVO4F.mjs +13 -0
  10. package/lib/chunk-2YHZBUZE.mjs +7 -0
  11. package/lib/{chunk-SZGGFST2.mjs → chunk-326AJTIU.mjs} +14 -14
  12. package/lib/{chunk-Q6SXNKV2.mjs → chunk-36JOHEJL.mjs} +1 -1
  13. package/lib/chunk-3PVRGTVK.mjs +7 -0
  14. package/lib/{chunk-VZVICK7Q.mjs → chunk-3Q353S2R.mjs} +1 -1
  15. package/lib/chunk-3TZSBHEY.mjs +7 -0
  16. package/lib/{chunk-UHFLKP26.mjs → chunk-43TOMFV4.mjs} +1 -1
  17. package/lib/{chunk-XK5W7BVE.mjs → chunk-4CVUUVGJ.mjs} +1 -1
  18. package/lib/{chunk-VYOYXTCU.mjs → chunk-4EOHEDFP.mjs} +1 -1
  19. package/lib/{chunk-EOFO3PHS.mjs → chunk-4JE4BYXK.mjs} +1 -1
  20. package/lib/{chunk-7EYQYZJP.mjs → chunk-54WZUS7J.mjs} +1 -1
  21. package/lib/chunk-5CRLRHOJ.mjs +7 -0
  22. package/lib/{chunk-FA4ZKDCU.mjs → chunk-5IZTFMJM.mjs} +1 -1
  23. package/lib/chunk-5M5FQ7RP.mjs +7 -0
  24. package/lib/{chunk-3HROD5RE.mjs → chunk-5SMWFNE7.mjs} +1 -1
  25. package/lib/{chunk-YAIIRFKJ.mjs → chunk-5XTUSN72.mjs} +1 -1
  26. package/lib/chunk-6I6TWNV5.mjs +7 -0
  27. package/lib/{chunk-PYRZFUVU.mjs → chunk-6JWWSDM6.mjs} +1 -1
  28. package/lib/chunk-6O222PW6.mjs +7 -0
  29. package/lib/{chunk-2UU42PTD.mjs → chunk-6PD6K7LP.mjs} +1 -1
  30. package/lib/{chunk-GGUOIDWP.mjs → chunk-6QE6R6RL.mjs} +1 -1
  31. package/lib/{chunk-DJCGURW7.mjs → chunk-6WX5ZU7Q.mjs} +1 -1
  32. package/lib/{chunk-DT3T7FRD.mjs → chunk-6YL7BNYD.mjs} +1 -1
  33. package/lib/chunk-6ZLKIT3H.mjs +7 -0
  34. package/lib/{chunk-CBL42DUU.mjs → chunk-7QYHEHMA.mjs} +1 -1
  35. package/lib/chunk-7SQSWVAU.mjs +9 -0
  36. package/lib/{chunk-ZUBBEP75.mjs → chunk-7UVKIWKV.mjs} +1 -1
  37. package/lib/{chunk-TWV4A5RK.mjs → chunk-7WATA4SB.mjs} +1 -1
  38. package/lib/chunk-7YNM6KFZ.mjs +7 -0
  39. package/lib/chunk-A3MYSOOC.mjs +7 -0
  40. package/lib/chunk-AL4C3GFT.mjs +7 -0
  41. package/lib/chunk-B3FBHVNN.mjs +21 -0
  42. package/lib/{chunk-27Z76O2O.mjs → chunk-B63POIPQ.mjs} +1 -1
  43. package/lib/{chunk-RTWYLOCA.mjs → chunk-BAWCOKRW.mjs} +1 -1
  44. package/lib/{chunk-NWOI25WY.mjs → chunk-BBRWFKS5.mjs} +1 -1
  45. package/lib/chunk-BEA27DLS.mjs +7 -0
  46. package/lib/chunk-BRY3PLIZ.mjs +7 -0
  47. package/lib/chunk-CBH3TOWK.mjs +341 -0
  48. package/lib/chunk-CPQIZGG5.mjs +7 -0
  49. package/lib/chunk-CVHNXJH3.mjs +7 -0
  50. package/lib/{chunk-HFUDCNU5.mjs → chunk-D4GF4FAB.mjs} +1 -1
  51. package/lib/chunk-DGDRQRCW.mjs +7 -0
  52. package/lib/{chunk-YAJQS3OL.mjs → chunk-DPMRIMUC.mjs} +1 -1
  53. package/lib/chunk-DUN2EPRC.mjs +7 -0
  54. package/lib/chunk-E3A3LOCY.mjs +7 -0
  55. package/lib/{chunk-TMA34QMA.mjs → chunk-EAC5QCE3.mjs} +1 -1
  56. package/lib/{chunk-VQJMP3DC.mjs → chunk-EC72TIEG.mjs} +1 -1
  57. package/lib/chunk-EPFCERGL.mjs +7 -0
  58. package/lib/{chunk-3MGMNK3Q.mjs → chunk-ETDCBLGU.mjs} +1 -1
  59. package/lib/{chunk-LXDSRP2W.mjs → chunk-F3AQW6IU.mjs} +1 -1
  60. package/lib/{chunk-A65ADTCR.mjs → chunk-FITPY3L4.mjs} +1 -1
  61. package/lib/chunk-FNJ4SGWO.mjs +7 -0
  62. package/lib/{chunk-SAMWHL22.mjs → chunk-FP7CYB2F.mjs} +1 -1
  63. package/lib/{chunk-JLZRZL5E.mjs → chunk-GKY2JMHY.mjs} +1 -1
  64. package/lib/chunk-GMIGWR6U.mjs +7 -0
  65. package/lib/{chunk-AUS6NFLZ.mjs → chunk-GNRSF65U.mjs} +1 -1
  66. package/lib/chunk-GOOVPVWX.mjs +7 -0
  67. package/lib/{chunk-PPHVWUFY.mjs → chunk-GWZRR3MM.mjs} +1 -1
  68. package/lib/{chunk-JH27IKCO.mjs → chunk-H2BHESDA.mjs} +2 -2
  69. package/lib/chunk-H33DVU3D.mjs +7 -0
  70. package/lib/chunk-H4CGM6YO.mjs +7 -0
  71. package/lib/{chunk-WOOUISSO.mjs → chunk-HCGXK7G7.mjs} +1 -1
  72. package/lib/{chunk-VZT4E2OJ.mjs → chunk-HIDW7FNV.mjs} +1 -1
  73. package/lib/chunk-HSBXRQTI.mjs +7 -0
  74. package/lib/chunk-HUZPBE47.mjs +7 -0
  75. package/lib/chunk-HV7VPEXP.mjs +7 -0
  76. package/lib/chunk-I6E6T6YY.mjs +7 -0
  77. package/lib/chunk-IUM4NFKI.mjs +10 -0
  78. package/lib/chunk-IVFVNNGB.mjs +37 -0
  79. package/lib/{chunk-5K2I2DMP.mjs → chunk-IZGCEOYO.mjs} +1 -1
  80. package/lib/{chunk-ZHIZY3ZC.mjs → chunk-J3DND3BC.mjs} +1 -1
  81. package/lib/{chunk-VPDEJGPS.mjs → chunk-JAEDM4SI.mjs} +1 -1
  82. package/lib/chunk-JCFBFF4Y.mjs +7 -0
  83. package/lib/{chunk-GBGHJTPC.mjs → chunk-JE6SCT6R.mjs} +1 -1
  84. package/lib/chunk-JGZPD4IM.mjs +7 -0
  85. package/lib/{chunk-C3LNYAVJ.mjs → chunk-JKJ74BX5.mjs} +1 -1
  86. package/lib/{chunk-EEFUE2ES.mjs → chunk-JLSIWO4Z.mjs} +1 -1
  87. package/lib/{chunk-3CX7GPCR.mjs → chunk-JSAJS3MY.mjs} +1 -1
  88. package/lib/chunk-JTJK2D36.mjs +7 -0
  89. package/lib/{chunk-V3R45ZWT.mjs → chunk-KAZS5Z6W.mjs} +1 -1
  90. package/lib/chunk-KB4ZHM4Q.mjs +10 -0
  91. package/lib/{chunk-J24TIGSI.mjs → chunk-KGU4SVIT.mjs} +1 -1
  92. package/lib/chunk-KJWFYBMU.mjs +15 -0
  93. package/lib/{chunk-H4JUYUSL.mjs → chunk-KZTZDC7H.mjs} +1 -1
  94. package/lib/chunk-L2E5WBGD.mjs +8 -0
  95. package/lib/{chunk-XU25YA46.mjs → chunk-L53JWJ3S.mjs} +1 -1
  96. package/lib/{chunk-Y4TDVDP2.mjs → chunk-LA4KIATH.mjs} +6 -6
  97. package/lib/chunk-LC3NDW4N.mjs +7 -0
  98. package/lib/{chunk-GCGHHN4K.mjs → chunk-LKTNQEBS.mjs} +1 -1
  99. package/lib/chunk-M2ABR4JM.mjs +7 -0
  100. package/lib/{chunk-3C2ZZIFN.mjs → chunk-M4BLK6HJ.mjs} +1 -1
  101. package/lib/{chunk-L4INJ5TZ.mjs → chunk-M6K34KGF.mjs} +1 -1
  102. package/lib/chunk-MDMPJEV3.mjs +7 -0
  103. package/lib/{chunk-32EUNQT6.mjs → chunk-MJZU3U5O.mjs} +68 -63
  104. package/lib/{chunk-PBE44M2Y.mjs → chunk-MSIEU5MR.mjs} +1 -1
  105. package/lib/{chunk-NLB3RGIY.mjs → chunk-N4WPCWJO.mjs} +1 -1
  106. package/lib/{chunk-SNEOKYV7.mjs → chunk-NCZKWSC7.mjs} +1 -1
  107. package/lib/{chunk-6KP6WETK.mjs → chunk-NED4MBIM.mjs} +1 -1
  108. package/lib/chunk-NOBQTEQD.mjs +7 -0
  109. package/lib/{chunk-RCYEBY42.mjs → chunk-NSQWI7ZY.mjs} +1 -1
  110. package/lib/{chunk-DBBPDSFN.mjs → chunk-O677VOGO.mjs} +1 -1
  111. package/lib/chunk-OFTT7J2M.mjs +7 -0
  112. package/lib/{chunk-C2N2TNEU.mjs → chunk-OLCVHL7I.mjs} +1 -1
  113. package/lib/chunk-OM5NORJG.mjs +7 -0
  114. package/lib/chunk-OMNMLKDT.mjs +7 -0
  115. package/lib/{chunk-CELEBWEZ.mjs → chunk-OPMO6I45.mjs} +1 -1
  116. package/lib/{chunk-LHU6CPGE.mjs → chunk-OUZQPYT3.mjs} +1 -1
  117. package/lib/chunk-OVNMB6Q2.mjs +7 -0
  118. package/lib/{chunk-6GQUZ4IP.mjs → chunk-PAXNWTYK.mjs} +1 -1
  119. package/lib/{chunk-XSKPYGMT.mjs → chunk-PBY2O6OF.mjs} +1 -1
  120. package/lib/chunk-PEDQPM2P.mjs +926 -0
  121. package/lib/chunk-PH7SP4YK.mjs +21 -0
  122. package/lib/{chunk-3SKLBRPL.mjs → chunk-PMN4PAC3.mjs} +1 -1
  123. package/lib/chunk-PMWAFDUB.mjs +48 -0
  124. package/lib/chunk-PPLVFX6N.mjs +7 -0
  125. package/lib/{chunk-STRMWSIQ.mjs → chunk-PR3XCSPO.mjs} +1 -1
  126. package/lib/{chunk-GJ6SZVHT.mjs → chunk-PR42EZSR.mjs} +1 -1
  127. package/lib/{chunk-YMDFF657.mjs → chunk-PWRJRL5U.mjs} +1 -1
  128. package/lib/{chunk-Q3DY7TO2.mjs → chunk-Q7GIJBCD.mjs} +1 -1
  129. package/lib/chunk-Q7TLC3I2.mjs +7 -0
  130. package/lib/{chunk-ZXFL2MSN.mjs → chunk-QAFPQ3YB.mjs} +1 -1
  131. package/lib/{chunk-T7WREYA5.mjs → chunk-QKEKG2LD.mjs} +1 -1
  132. package/lib/chunk-QO53K5W2.mjs +9 -0
  133. package/lib/{chunk-MUEQRIK7.mjs → chunk-QTG6LUZT.mjs} +1 -1
  134. package/lib/{chunk-KP5G6FUC.mjs → chunk-RE7RYF3B.mjs} +1 -1
  135. package/lib/{chunk-FOIWWK7G.mjs → chunk-RGBGUCJA.mjs} +1 -1
  136. package/lib/{chunk-DWMRIWV5.mjs → chunk-RGUQOSBU.mjs} +1 -1
  137. package/lib/{chunk-7PY3VQP3.mjs → chunk-RHNTHGNU.mjs} +1 -1
  138. package/lib/chunk-RKTFFCNS.mjs +7 -0
  139. package/lib/chunk-RMFU4BAL.mjs +28 -0
  140. package/lib/{chunk-KKOA62S4.mjs → chunk-ROV3QXEF.mjs} +14 -13
  141. package/lib/chunk-RT47RKLY.mjs +7 -0
  142. package/lib/{chunk-ZUTUYBNW.mjs → chunk-S42RBRH2.mjs} +1 -1
  143. package/lib/{chunk-Z42PHCVZ.mjs → chunk-SI267LYR.mjs} +1 -1
  144. package/lib/chunk-T3G6VZNS.mjs +7 -0
  145. package/lib/chunk-TNT27RBG.mjs +7 -0
  146. package/lib/chunk-UBIKR5VO.mjs +7 -0
  147. package/lib/chunk-UI3JQVRU.mjs +8 -0
  148. package/lib/{chunk-YT22LMF7.mjs → chunk-UIOMAX56.mjs} +1 -1
  149. package/lib/chunk-UX3BVH2Y.mjs +7 -0
  150. package/lib/chunk-VCUXCK36.mjs +7 -0
  151. package/lib/chunk-VINGECAJ.mjs +10 -0
  152. package/lib/chunk-VOXJHJIE.mjs +7 -0
  153. package/lib/chunk-W6PN6TJG.mjs +7 -0
  154. package/lib/{chunk-FKK5YBGZ.mjs → chunk-WAPSSYMT.mjs} +1 -1
  155. package/lib/{chunk-PR74GYVI.mjs → chunk-WUUKFE2U.mjs} +1 -1
  156. package/lib/chunk-WWTCWWZI.mjs +7 -0
  157. package/lib/chunk-WXDLQT2O.mjs +10 -0
  158. package/lib/chunk-WY5V5PR3.mjs +7 -0
  159. package/lib/chunk-X4BXESMQ.mjs +7 -0
  160. package/lib/chunk-XBQGZGWR.mjs +7 -0
  161. package/lib/chunk-XGGOUNPP.mjs +7 -0
  162. package/lib/chunk-XKWW3GKF.mjs +7 -0
  163. package/lib/{chunk-JJITOWZK.mjs → chunk-Y2DRK37K.mjs} +1 -1
  164. package/lib/{chunk-XZISAZA6.mjs → chunk-YA6ATMTB.mjs} +1 -1
  165. package/lib/{chunk-54HYHHVL.mjs → chunk-YDXMTWAT.mjs} +1 -1
  166. package/lib/chunk-YHR4WQPR.mjs +7 -0
  167. package/lib/{chunk-KJYEQHYP.mjs → chunk-YTLUYSMF.mjs} +1 -1
  168. package/lib/chunk-YWEQQL3C.mjs +8 -0
  169. package/lib/{chunk-PWVDNN2C.mjs → chunk-Z4LKKOFY.mjs} +1 -1
  170. package/lib/chunk-ZBAWJUG2.mjs +7 -0
  171. package/lib/{chunk-XO5FBOQF.mjs → chunk-ZJW6YOMV.mjs} +1 -1
  172. package/lib/chunk-ZQQXSCVI.mjs +7 -0
  173. package/lib/{chunk-47UHTN3Q.mjs → chunk-ZQWIVYVM.mjs} +1 -1
  174. package/lib/chunk-ZV7ZFQQC.mjs +9 -0
  175. package/lib/sandforge-autopilot.mjs +25 -25
  176. package/lib/sandforge-backup.mjs +1 -1
  177. package/lib/sandforge-checkpoint.mjs +1 -1
  178. package/lib/sandforge-cleanup.mjs +1 -1
  179. package/lib/sandforge-clone.mjs +1 -1
  180. package/lib/sandforge-compare.mjs +52 -21
  181. package/lib/sandforge-dataops.mjs +1 -1
  182. package/lib/sandforge-empty.mjs +4 -4
  183. package/lib/sandforge-env.mjs +106 -107
  184. package/lib/sandforge-frozen.mjs +1 -1
  185. package/lib/sandforge-mcp.mjs +12 -12
  186. package/lib/sandforge-monitor.mjs +1 -1
  187. package/lib/sandforge-pipeline.mjs +1 -1
  188. package/lib/sandforge-seed.mjs +1 -1
  189. package/lib/sandforge-sync.mjs +1 -1
  190. package/lib/sandforge-users.mjs +21 -23
  191. package/lib/sandforge.mjs +1 -1
  192. package/lib/sf/sandforge/compare.mjs +2 -2
  193. package/lib/sfPlugin.mjs +1 -1
  194. package/oclif.manifest.json +1 -1
  195. package/package.json +1 -1
  196. package/lib/chunk-2JZGCCPG.mjs +0 -9
  197. package/lib/chunk-3HEMJTAP.mjs +0 -925
  198. package/lib/chunk-3XG25GTF.mjs +0 -7
  199. package/lib/chunk-42BFLWHR.mjs +0 -7
  200. package/lib/chunk-466F37VD.mjs +0 -7
  201. package/lib/chunk-4JKR4PTZ.mjs +0 -8
  202. package/lib/chunk-52EXDVPN.mjs +0 -7
  203. package/lib/chunk-7CVDVBEE.mjs +0 -7
  204. package/lib/chunk-7LKI7OAS.mjs +0 -7
  205. package/lib/chunk-7SDZR6SR.mjs +0 -7
  206. package/lib/chunk-A32ISQ6M.mjs +0 -28
  207. package/lib/chunk-A7JJWOLT.mjs +0 -7
  208. package/lib/chunk-BMTNTBBM.mjs +0 -7
  209. package/lib/chunk-BN33LVPQ.mjs +0 -7
  210. package/lib/chunk-BZ24IAP5.mjs +0 -7
  211. package/lib/chunk-CCEH7L53.mjs +0 -7
  212. package/lib/chunk-CV47FDQW.mjs +0 -7
  213. package/lib/chunk-CZLJZQCS.mjs +0 -7
  214. package/lib/chunk-DIL62SUN.mjs +0 -7
  215. package/lib/chunk-DIS254AN.mjs +0 -7
  216. package/lib/chunk-FZF23M6R.mjs +0 -7
  217. package/lib/chunk-G2JR3F63.mjs +0 -7
  218. package/lib/chunk-GGNUACTY.mjs +0 -7
  219. package/lib/chunk-GHPR5UVV.mjs +0 -7
  220. package/lib/chunk-HIHCYMSL.mjs +0 -7
  221. package/lib/chunk-HKUWHVI7.mjs +0 -9
  222. package/lib/chunk-HQQVANWQ.mjs +0 -20
  223. package/lib/chunk-IRZJU2PG.mjs +0 -22
  224. package/lib/chunk-ISSP2FZ5.mjs +0 -7
  225. package/lib/chunk-IVZJSDJD.mjs +0 -7
  226. package/lib/chunk-JESRFE2Z.mjs +0 -11
  227. package/lib/chunk-JFNLKHY6.mjs +0 -8
  228. package/lib/chunk-JKT5YAQ2.mjs +0 -7
  229. package/lib/chunk-JQZTMFO7.mjs +0 -7
  230. package/lib/chunk-KIMQQ6JQ.mjs +0 -7
  231. package/lib/chunk-LAUOSXMN.mjs +0 -341
  232. package/lib/chunk-MKTXJCXN.mjs +0 -10
  233. package/lib/chunk-O2PUGRNW.mjs +0 -10
  234. package/lib/chunk-O4BROUGM.mjs +0 -7
  235. package/lib/chunk-P55MKIZX.mjs +0 -37
  236. package/lib/chunk-P63WJMXQ.mjs +0 -7
  237. package/lib/chunk-PE435FVH.mjs +0 -15
  238. package/lib/chunk-PPGDAUEQ.mjs +0 -7
  239. package/lib/chunk-QAPVKPEC.mjs +0 -7
  240. package/lib/chunk-RLWB7F26.mjs +0 -7
  241. package/lib/chunk-RYRMUPMY.mjs +0 -7
  242. package/lib/chunk-SCKUIE3R.mjs +0 -7
  243. package/lib/chunk-SU65Z2BA.mjs +0 -7
  244. package/lib/chunk-TCBAE65A.mjs +0 -7
  245. package/lib/chunk-WEMLDUQA.mjs +0 -7
  246. package/lib/chunk-WSUKC2U3.mjs +0 -7
  247. package/lib/chunk-WT3SCUHS.mjs +0 -7
  248. package/lib/chunk-YGJF55VJ.mjs +0 -7
  249. package/lib/chunk-YH4DYI6D.mjs +0 -7
  250. package/lib/chunk-ZQO5PDX5.mjs +0 -48
  251. package/lib/chunk-ZUOPC4W2.mjs +0 -7
@@ -4,7 +4,7 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import{b as j,q as O}from"./chunk-HQQVANWQ.mjs";import"./chunk-BXZ73A5M.mjs";import"./chunk-DBBPDSFN.mjs";import"./chunk-GBGHJTPC.mjs";import"./chunk-ZRUDYB7O.mjs";import"./chunk-IRZJU2PG.mjs";import"./chunk-Y4TDVDP2.mjs";import"./chunk-JJITOWZK.mjs";import"./chunk-YMDFF657.mjs";import"./chunk-UV74P4H2.mjs";import"./chunk-5K2I2DMP.mjs";import"./chunk-7WSLT5VX.mjs";import"./chunk-YT22LMF7.mjs";import"./chunk-G2JR3F63.mjs";import"./chunk-3CX7GPCR.mjs";import"./chunk-A65ADTCR.mjs";import"./chunk-NWOI25WY.mjs";import"./chunk-FQGHL7GR.mjs";import"./chunk-A7JJWOLT.mjs";import"./chunk-ZXFL2MSN.mjs";import"./chunk-VYOYXTCU.mjs";import"./chunk-C3LNYAVJ.mjs";import"./chunk-GJ6SZVHT.mjs";import"./chunk-52EXDVPN.mjs";import"./chunk-GMY5427L.mjs";import"./chunk-EEFUE2ES.mjs";import"./chunk-PE435FVH.mjs";import"./chunk-PWVDNN2C.mjs";import"./chunk-6VSZNZHH.mjs";import"./chunk-XCA5AONB.mjs";import"./chunk-66NMFCWX.mjs";import"./chunk-WB2RIVO3.mjs";import{b as S,c as x}from"./chunk-MUEQRIK7.mjs";import"./chunk-ISSP2FZ5.mjs";import"./chunk-XU25YA46.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-IVZJSDJD.mjs";import"./chunk-VZT4E2OJ.mjs";import"./chunk-BOGNK4LV.mjs";import"./chunk-P55MKIZX.mjs";import"./chunk-PYRZFUVU.mjs";import"./chunk-O2PUGRNW.mjs";import"./chunk-7SDZR6SR.mjs";import"./chunk-TEIBWMJM.mjs";import"./chunk-BWWQXU2B.mjs";import"./chunk-T63U4OZJ.mjs";import"./chunk-YAIIRFKJ.mjs";import"./chunk-Q3DY7TO2.mjs";import"./chunk-3XG25GTF.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-54HYHHVL.mjs";import"./chunk-M6P5ZZLE.mjs";import"./chunk-WSUKC2U3.mjs";import"./chunk-QIRO4HTE.mjs";import"./chunk-3SKLBRPL.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-JH27IKCO.mjs";import"./chunk-SAMWHL22.mjs";import"./chunk-6KP6WETK.mjs";import"./chunk-4JKR4PTZ.mjs";import"./chunk-J24TIGSI.mjs";import"./chunk-HKUWHVI7.mjs";import"./chunk-VPDEJGPS.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-LHU6CPGE.mjs";import"./chunk-PBE44M2Y.mjs";import"./chunk-ZUOPC4W2.mjs";import"./chunk-JQZTMFO7.mjs";import"./chunk-JFNLKHY6.mjs";import"./chunk-VZVICK7Q.mjs";import"./chunk-PPGDAUEQ.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-7PY3VQP3.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-HFUDCNU5.mjs";import"./chunk-MS4FJDFD.mjs";import"./chunk-XZISAZA6.mjs";import{b as w,f as b,h as y}from"./chunk-LCDPCUXS.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-L4INJ5TZ.mjs";import"./chunk-KIMQQ6JQ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-ZUTUYBNW.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-PR74GYVI.mjs";import"./chunk-TMA34QMA.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";var v=`sandforge monitor \u2014 read an org the way the Monitor page does, without the editor.
7
+ import{b as j,q as O}from"./chunk-PH7SP4YK.mjs";import"./chunk-BXZ73A5M.mjs";import"./chunk-CPQIZGG5.mjs";import"./chunk-O677VOGO.mjs";import"./chunk-JE6SCT6R.mjs";import"./chunk-ZRUDYB7O.mjs";import"./chunk-B3FBHVNN.mjs";import"./chunk-YWEQQL3C.mjs";import"./chunk-LA4KIATH.mjs";import"./chunk-Y2DRK37K.mjs";import"./chunk-GMIGWR6U.mjs";import"./chunk-PWRJRL5U.mjs";import"./chunk-UV74P4H2.mjs";import"./chunk-IZGCEOYO.mjs";import"./chunk-24RFOFYT.mjs";import"./chunk-UIOMAX56.mjs";import"./chunk-3PVRGTVK.mjs";import"./chunk-JSAJS3MY.mjs";import"./chunk-FITPY3L4.mjs";import"./chunk-BBRWFKS5.mjs";import"./chunk-FQGHL7GR.mjs";import"./chunk-6I6TWNV5.mjs";import"./chunk-QAFPQ3YB.mjs";import"./chunk-4EOHEDFP.mjs";import"./chunk-JKJ74BX5.mjs";import"./chunk-PR42EZSR.mjs";import"./chunk-UX3BVH2Y.mjs";import"./chunk-GMY5427L.mjs";import"./chunk-JLSIWO4Z.mjs";import"./chunk-KJWFYBMU.mjs";import"./chunk-Z4LKKOFY.mjs";import"./chunk-2HVOZUM4.mjs";import"./chunk-XCA5AONB.mjs";import"./chunk-66NMFCWX.mjs";import"./chunk-WB2RIVO3.mjs";import{b as S,c as x}from"./chunk-QTG6LUZT.mjs";import"./chunk-XGGOUNPP.mjs";import"./chunk-L53JWJ3S.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-OFTT7J2M.mjs";import"./chunk-HIDW7FNV.mjs";import"./chunk-BOGNK4LV.mjs";import"./chunk-IVFVNNGB.mjs";import"./chunk-6JWWSDM6.mjs";import"./chunk-VINGECAJ.mjs";import"./chunk-H4CGM6YO.mjs";import"./chunk-IUM4NFKI.mjs";import"./chunk-TEIBWMJM.mjs";import"./chunk-BWWQXU2B.mjs";import"./chunk-T63U4OZJ.mjs";import"./chunk-5XTUSN72.mjs";import"./chunk-Q7GIJBCD.mjs";import"./chunk-YHR4WQPR.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-YDXMTWAT.mjs";import"./chunk-M6P5ZZLE.mjs";import"./chunk-26POJDIT.mjs";import"./chunk-QIRO4HTE.mjs";import"./chunk-PMN4PAC3.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-H2BHESDA.mjs";import"./chunk-FP7CYB2F.mjs";import"./chunk-NED4MBIM.mjs";import"./chunk-UI3JQVRU.mjs";import"./chunk-KGU4SVIT.mjs";import"./chunk-JAEDM4SI.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-OUZQPYT3.mjs";import"./chunk-MSIEU5MR.mjs";import"./chunk-LC3NDW4N.mjs";import"./chunk-KB4ZHM4Q.mjs";import"./chunk-23SEDORH.mjs";import"./chunk-W6PN6TJG.mjs";import"./chunk-3Q353S2R.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-RHNTHGNU.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-Q7TLC3I2.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-D4GF4FAB.mjs";import"./chunk-CVHNXJH3.mjs";import"./chunk-MS4FJDFD.mjs";import"./chunk-YA6ATMTB.mjs";import{b as w,f as b,h as y}from"./chunk-LCDPCUXS.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-M6K34KGF.mjs";import"./chunk-TNT27RBG.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-S42RBRH2.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-WUUKFE2U.mjs";import"./chunk-EAC5QCE3.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-PMWAFDUB.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";var v=`sandforge monitor \u2014 read an org the way the Monitor page does, without the editor.
8
8
 
9
9
  Usage:
10
10
  npx sandforge monitor --org <alias> [options]
@@ -4,7 +4,7 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import{p as De}from"./chunk-KKOA62S4.mjs";import"./chunk-YGJF55VJ.mjs";import"./chunk-HIHCYMSL.mjs";import"./chunk-JESRFE2Z.mjs";import"./chunk-CBL42DUU.mjs";import"./chunk-MKTXJCXN.mjs";import"./chunk-RCYEBY42.mjs";import"./chunk-AUS6NFLZ.mjs";import"./chunk-YH4DYI6D.mjs";import"./chunk-SZGGFST2.mjs";import"./chunk-LAUOSXMN.mjs";import"./chunk-INIQ23K6.mjs";import"./chunk-2UU42PTD.mjs";import"./chunk-GCGHHN4K.mjs";import"./chunk-2JZGCCPG.mjs";import{a as W,c as Oe,g as Ie,h as Y,i as Te,j as be,k as q,l as Ee,m as Ne,n as xe,o as Ae,p as _e,q as Ce}from"./chunk-HQQVANWQ.mjs";import"./chunk-BXZ73A5M.mjs";import"./chunk-DBBPDSFN.mjs";import"./chunk-GBGHJTPC.mjs";import"./chunk-ZRUDYB7O.mjs";import"./chunk-IRZJU2PG.mjs";import"./chunk-Y4TDVDP2.mjs";import"./chunk-JJITOWZK.mjs";import"./chunk-YMDFF657.mjs";import"./chunk-UV74P4H2.mjs";import"./chunk-5K2I2DMP.mjs";import"./chunk-7WSLT5VX.mjs";import"./chunk-YT22LMF7.mjs";import"./chunk-G2JR3F63.mjs";import"./chunk-3CX7GPCR.mjs";import"./chunk-A65ADTCR.mjs";import"./chunk-NWOI25WY.mjs";import"./chunk-FQGHL7GR.mjs";import{h as Pe}from"./chunk-A7JJWOLT.mjs";import"./chunk-ZXFL2MSN.mjs";import"./chunk-VYOYXTCU.mjs";import"./chunk-C3LNYAVJ.mjs";import"./chunk-GJ6SZVHT.mjs";import"./chunk-52EXDVPN.mjs";import"./chunk-GMY5427L.mjs";import{a as Fe}from"./chunk-TW3N6W5Z.mjs";import"./chunk-3HEMJTAP.mjs";import"./chunk-BN33LVPQ.mjs";import{d as ve}from"./chunk-JKT5YAQ2.mjs";import"./chunk-QAPVKPEC.mjs";import{a as he}from"./chunk-BNKT3R3F.mjs";import{a as we,b as ke}from"./chunk-QROPNEGY.mjs";import{b as K,e as de}from"./chunk-BZ24IAP5.mjs";import{a as N}from"./chunk-SCKUIE3R.mjs";import"./chunk-6FARZYMJ.mjs";import"./chunk-EEFUE2ES.mjs";import{e as ce}from"./chunk-PE435FVH.mjs";import"./chunk-PWVDNN2C.mjs";import"./chunk-6VSZNZHH.mjs";import"./chunk-XCA5AONB.mjs";import"./chunk-66NMFCWX.mjs";import"./chunk-WB2RIVO3.mjs";import{a as Re,c as Se}from"./chunk-MUEQRIK7.mjs";import"./chunk-ISSP2FZ5.mjs";import{h as ge,i as me}from"./chunk-XU25YA46.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-IVZJSDJD.mjs";import"./chunk-VZT4E2OJ.mjs";import"./chunk-BOGNK4LV.mjs";import{m as ye}from"./chunk-P55MKIZX.mjs";import"./chunk-PYRZFUVU.mjs";import{l as fe}from"./chunk-O2PUGRNW.mjs";import"./chunk-7SDZR6SR.mjs";import"./chunk-TEIBWMJM.mjs";import"./chunk-BWWQXU2B.mjs";import{d as le}from"./chunk-T63U4OZJ.mjs";import"./chunk-YAIIRFKJ.mjs";import"./chunk-Q3DY7TO2.mjs";import"./chunk-3XG25GTF.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-54HYHHVL.mjs";import"./chunk-M6P5ZZLE.mjs";import"./chunk-WSUKC2U3.mjs";import"./chunk-QIRO4HTE.mjs";import{h as pe,m as ue}from"./chunk-3SKLBRPL.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-JH27IKCO.mjs";import"./chunk-SAMWHL22.mjs";import"./chunk-6KP6WETK.mjs";import"./chunk-4JKR4PTZ.mjs";import"./chunk-J24TIGSI.mjs";import"./chunk-HKUWHVI7.mjs";import"./chunk-VPDEJGPS.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-LHU6CPGE.mjs";import"./chunk-PBE44M2Y.mjs";import"./chunk-ZUOPC4W2.mjs";import"./chunk-JQZTMFO7.mjs";import"./chunk-JFNLKHY6.mjs";import"./chunk-VZVICK7Q.mjs";import"./chunk-PPGDAUEQ.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-7PY3VQP3.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-HFUDCNU5.mjs";import"./chunk-MS4FJDFD.mjs";import"./chunk-XZISAZA6.mjs";import{a as oe,c as ae,f as T,h as $e}from"./chunk-LCDPCUXS.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-L4INJ5TZ.mjs";import"./chunk-KIMQQ6JQ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-ZUTUYBNW.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-PR74GYVI.mjs";import"./chunk-TMA34QMA.mjs";import"./chunk-TUACWKIH.mjs";import{Kc as te,te as ie,ve as re,xe as se}from"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";import{copyFileSync as fn,existsSync as Je,mkdtempSync as gn,readFileSync as Xe,rmSync as mn,rmdirSync as hn}from"node:fs";import{tmpdir as yn}from"node:os";import{join as j,resolve as wn}from"node:path";import{randomUUID as kn}from"node:crypto";import{mkdirSync as sn}from"node:fs";import{join as on}from"node:path";var an=/^\[(WARN|ERR)\]|^\[INFO\] (?:The run lock|the confirmation)/;function je(e,t){return t==="production"?`${e??"the org"} is taken for a production org, and a pipeline from the command line writes to none`:void 0}function J(e){let t=e.journalDir??he(),n=e.backupDir??Re(),s=Se(n);if(s!==void 0)throw new Error(s);sn(e.storeDir,{recursive:!0,mode:448});let i=new Fe,r,o=Ce({storeDir:e.storeDir,log:a=>{an.test(a.trim())&&e.log(a.trim())},waitMs:0,typeScratchOrgs:!0,...e.onPost?{onPost:e.onPost}:{},services:{getSandforgeSetting:e.setting,showNotification:e.notify,...e.askApproval?{askApproval:e.askApproval}:{}},compose:a=>{let d=u=>a.orgManager.getOrg(u)?.alias,c=new fe({orgNameOf:d,requestConfirmation:(u,y)=>{let w=je(void 0,y);return w===void 0?Promise.resolve(!0):(e.log(`refused: ${w} (${u})`),Promise.resolve(!1))},declinesWithoutAsking:u=>je(void 0,u)});a.handlers.setInfraServices({productionGuard:c,backgroundRegistry:i,piiDetector:new le,checkpointFiles:{sandforgeVersion:e.sandforgeVersion,pickExportFile:()=>Promise.reject(new Error("sandforge checkpoint export saves a checkpoint to a file.")),pickImportFile:()=>Promise.reject(new Error("sandforge checkpoint import reads a checkpoint file."))}}),a.handlers.setBackgroundRegistry(i),a.handlers.setBackupRecordStore(new me(ge(n))),a.handlers.setSyncRunCreations(pe(t)),a.handlers.setSeedRunCreations(ve(t)),r={configStore:a.configStore,orgRegistry:a.orgRegistry}}});if(r===void 0)throw new Error("The host composed no handlers.");return{host:o,configStore:r.configStore,orgRegistry:r.orgRegistry,backupDir:n,dispose:()=>i.dispose()}}function X(e){switch(te(e.orgType,e.metadata?.edition)){case"Sandbox":return"sandbox";case"Scratch":return"scratch";case"Developer":return"developer";default:return"production"}}function Me(e,t){return e.length>=15&&t.length>=15&&e.slice(0,15)===t.slice(0,15)}var Le=new Set(["scratch","developer"]),ze={sandbox:"a sandbox",scratch:"a scratch org",developer:"a Developer Edition org",production:"a production org"};function dn(e,t){return e!==t?`another org, of another kind: ${ze[t]} here, ${ze[e]} in the file`:e==="sandbox"?"a sandbox refreshed since is another org, holding production\u2019s data again":"another org than the one the pipeline was exported for"}function Ge(e,t,n,s,i,r=e){return Me(n.organizationId,s.organizationId)?{ok:!0}:i!==void 0&&Me(i,s.organizationId)?{ok:!0,note:`${t} answers as org ${s.organizationId}, not the ${n.organizationId} the file names: taken, as --accept-org ${r}=${i} says.`}:Le.has(n.kind)&&Le.has(s.kind)?{ok:!0,note:`${t} answers as org ${s.organizationId}, not the ${n.organizationId} the file names: a ${s.kind==="scratch"?"scratch org":"Developer Edition org"} is made again under its alias, and is not pinned to its Id.`}:{ok:!1,code:"ORG_MOVED",message:`${t} answers as org ${s.organizationId}, and the file names ${n.organizationId}: ${dn(n.kind,s.kind)}. Nothing was run.`,wayOut:`check that ${t} is the org the pipeline is for, then run again with --accept-org ${t}=${s.organizationId}; or export the pipeline again from the Automation page.`}}function Be(e,t,n,s){if(!n.staging)return{org:t};let i=X(t);if(i!=="sandbox")return{org:t,note:`${s} is marked Staging in the file, and is a ${i} org here: the mark is read of a sandbox alone, and not set.`};let r={...t,staging:!0};return e.updateOrgMetadata(r),{org:r}}function L(e){return JSON.parse(JSON.stringify(e))}function He(e,t){let n=L(e.pipeline),s=L(e.syncConfigs);for(let i of se(e)){let r=t(i.key);if(r!==void 0){if(i.stepId!==void 0){let o=n.steps.find(a=>a.id===i.stepId);o&&(o.config[i.field]=r)}else if(i.syncConfigId!==void 0){let o=s[i.syncConfigId];o&&(o[i.field]=r)}}}return{pipeline:{...n,variables:n.variables.map(i=>i.required&&i.defaultValue===void 0?{...i,required:!1}:i),version:1,triggers:[],createdAt:e.exportedAt,updatedAt:e.exportedAt},syncConfigs:Object.values(s)}}var pn="prebuilt-",un="tpl-";function Ve(e,t,n){let s=new Pe(e);for(let o of n.syncConfigs)s.save(o);let i=new Oe(e);for(let o of Object.values(t.seedTemplates))o.id.startsWith(pn)||i.save(L(o));let r=new ce(e);for(let o of Object.values(t.maskingTemplates))o.id.startsWith(un)||r.save(L(o))}var Ue="backup:";function Ke(e,t,n,s=()=>{}){let i=e.getKeysByPrefix(Ue).filter(o=>!n.has(o));if(i.length===0)return 0;let r=ye(on(t,"snapshots.json"));for(let o of i)r.set(o,cn(e.get(o),s),"backups");return i.length}function cn(e,t){if(typeof e!="object"||e===null||Array.isArray(e))return e;let n=e;if(typeof n.orgId!="string")return e;let s=t(n.orgId);return s===void 0?e:{...n,orgId:s,organizationId:typeof n.organizationId=="string"?n.organizationId:n.orgId}}function We(e){return new Set(e.getKeysByPrefix(Ue))}var vn=`sandforge pipeline \u2014 run an Automation pipeline exported from VS Code, without the editor.
7
+ import{p as De}from"./chunk-ROV3QXEF.mjs";import"./chunk-HUZPBE47.mjs";import"./chunk-2YHZBUZE.mjs";import"./chunk-2WFIVO4F.mjs";import"./chunk-7QYHEHMA.mjs";import"./chunk-WXDLQT2O.mjs";import"./chunk-NSQWI7ZY.mjs";import"./chunk-GNRSF65U.mjs";import"./chunk-3TZSBHEY.mjs";import"./chunk-326AJTIU.mjs";import"./chunk-CBH3TOWK.mjs";import"./chunk-INIQ23K6.mjs";import"./chunk-6PD6K7LP.mjs";import{a as W,c as Oe,g as Ie,h as Y,i as Te,j as be,k as q,l as Ee,m as Ne,n as xe,o as Ae,p as _e,q as Ce}from"./chunk-PH7SP4YK.mjs";import"./chunk-BXZ73A5M.mjs";import"./chunk-CPQIZGG5.mjs";import"./chunk-O677VOGO.mjs";import"./chunk-JE6SCT6R.mjs";import"./chunk-ZRUDYB7O.mjs";import"./chunk-B3FBHVNN.mjs";import"./chunk-YWEQQL3C.mjs";import"./chunk-LA4KIATH.mjs";import"./chunk-Y2DRK37K.mjs";import"./chunk-GMIGWR6U.mjs";import"./chunk-PWRJRL5U.mjs";import"./chunk-UV74P4H2.mjs";import"./chunk-IZGCEOYO.mjs";import"./chunk-24RFOFYT.mjs";import"./chunk-UIOMAX56.mjs";import"./chunk-3PVRGTVK.mjs";import"./chunk-JSAJS3MY.mjs";import"./chunk-FITPY3L4.mjs";import"./chunk-BBRWFKS5.mjs";import"./chunk-FQGHL7GR.mjs";import{h as Pe}from"./chunk-6I6TWNV5.mjs";import"./chunk-QAFPQ3YB.mjs";import"./chunk-4EOHEDFP.mjs";import"./chunk-JKJ74BX5.mjs";import"./chunk-PR42EZSR.mjs";import"./chunk-UX3BVH2Y.mjs";import"./chunk-GMY5427L.mjs";import"./chunk-LKTNQEBS.mjs";import"./chunk-7SQSWVAU.mjs";import{a as Fe}from"./chunk-TW3N6W5Z.mjs";import"./chunk-PEDQPM2P.mjs";import"./chunk-X4BXESMQ.mjs";import{d as ve}from"./chunk-EPFCERGL.mjs";import"./chunk-OM5NORJG.mjs";import{a as he}from"./chunk-2METQHGG.mjs";import{b as K,e as de}from"./chunk-RKTFFCNS.mjs";import"./chunk-6FARZYMJ.mjs";import"./chunk-JLSIWO4Z.mjs";import{e as ce}from"./chunk-KJWFYBMU.mjs";import"./chunk-Z4LKKOFY.mjs";import"./chunk-2HVOZUM4.mjs";import"./chunk-XCA5AONB.mjs";import"./chunk-66NMFCWX.mjs";import"./chunk-WB2RIVO3.mjs";import{a as Re,c as Se}from"./chunk-QTG6LUZT.mjs";import"./chunk-XGGOUNPP.mjs";import{h as ge,i as me}from"./chunk-L53JWJ3S.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-OFTT7J2M.mjs";import"./chunk-HIDW7FNV.mjs";import"./chunk-BOGNK4LV.mjs";import{a as we,b as ke}from"./chunk-QROPNEGY.mjs";import{n as ye}from"./chunk-IVFVNNGB.mjs";import"./chunk-6JWWSDM6.mjs";import{m as fe}from"./chunk-VINGECAJ.mjs";import"./chunk-H4CGM6YO.mjs";import"./chunk-IUM4NFKI.mjs";import"./chunk-TEIBWMJM.mjs";import"./chunk-BWWQXU2B.mjs";import{d as le}from"./chunk-T63U4OZJ.mjs";import"./chunk-5XTUSN72.mjs";import"./chunk-Q7GIJBCD.mjs";import"./chunk-YHR4WQPR.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-YDXMTWAT.mjs";import"./chunk-M6P5ZZLE.mjs";import"./chunk-26POJDIT.mjs";import"./chunk-QIRO4HTE.mjs";import{h as pe,m as ue}from"./chunk-PMN4PAC3.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-H2BHESDA.mjs";import"./chunk-FP7CYB2F.mjs";import"./chunk-NED4MBIM.mjs";import"./chunk-UI3JQVRU.mjs";import"./chunk-KGU4SVIT.mjs";import{a as N}from"./chunk-AL4C3GFT.mjs";import"./chunk-JAEDM4SI.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-OUZQPYT3.mjs";import"./chunk-MSIEU5MR.mjs";import"./chunk-LC3NDW4N.mjs";import"./chunk-KB4ZHM4Q.mjs";import"./chunk-23SEDORH.mjs";import"./chunk-W6PN6TJG.mjs";import"./chunk-3Q353S2R.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-RHNTHGNU.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-Q7TLC3I2.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-D4GF4FAB.mjs";import"./chunk-CVHNXJH3.mjs";import"./chunk-MS4FJDFD.mjs";import"./chunk-YA6ATMTB.mjs";import{a as oe,c as ae,f as T,h as $e}from"./chunk-LCDPCUXS.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-M6K34KGF.mjs";import"./chunk-TNT27RBG.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-S42RBRH2.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-WUUKFE2U.mjs";import"./chunk-EAC5QCE3.mjs";import"./chunk-TUACWKIH.mjs";import{Ge as ie,Ie as re,Ke as se,Xc as te}from"./chunk-PMWAFDUB.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";import{copyFileSync as fn,existsSync as Je,mkdtempSync as gn,readFileSync as Xe,rmSync as mn,rmdirSync as hn}from"node:fs";import{tmpdir as yn}from"node:os";import{join as j,resolve as wn}from"node:path";import{randomUUID as kn}from"node:crypto";import{mkdirSync as sn}from"node:fs";import{join as on}from"node:path";var an=/^\[(WARN|ERR)\]|^\[INFO\] (?:The run lock|the confirmation)/;function je(e,t){return t==="production"?`${e??"the org"} is taken for a production org, and a pipeline from the command line writes to none`:void 0}function J(e){let t=e.journalDir??he(),n=e.backupDir??Re(),s=Se(n);if(s!==void 0)throw new Error(s);sn(e.storeDir,{recursive:!0,mode:448});let i=new Fe,r,o=Ce({storeDir:e.storeDir,log:a=>{an.test(a.trim())&&e.log(a.trim())},waitMs:0,typeScratchOrgs:!0,...e.onPost?{onPost:e.onPost}:{},services:{getSandforgeSetting:e.setting,showNotification:e.notify,...e.askApproval?{askApproval:e.askApproval}:{}},compose:a=>{let d=u=>a.orgManager.getOrg(u)?.alias,c=new fe({orgNameOf:d,requestConfirmation:(u,y)=>{let w=je(void 0,y);return w===void 0?Promise.resolve(!0):(e.log(`refused: ${w} (${u})`),Promise.resolve(!1))},declinesWithoutAsking:u=>je(void 0,u)});a.handlers.setInfraServices({productionGuard:c,backgroundRegistry:i,piiDetector:new le,checkpointFiles:{sandforgeVersion:e.sandforgeVersion,pickExportFile:()=>Promise.reject(new Error("sandforge checkpoint export saves a checkpoint to a file.")),pickImportFile:()=>Promise.reject(new Error("sandforge checkpoint import reads a checkpoint file."))}}),a.handlers.setBackgroundRegistry(i),a.handlers.setBackupRecordStore(new me(ge(n))),a.handlers.setSyncRunCreations(pe(t)),a.handlers.setSeedRunCreations(ve(t)),r={configStore:a.configStore,orgRegistry:a.orgRegistry}}});if(r===void 0)throw new Error("The host composed no handlers.");return{host:o,configStore:r.configStore,orgRegistry:r.orgRegistry,backupDir:n,dispose:()=>i.dispose()}}function X(e){switch(te(e.orgType,e.metadata?.edition)){case"Sandbox":return"sandbox";case"Scratch":return"scratch";case"Developer":return"developer";default:return"production"}}function Me(e,t){return e.length>=15&&t.length>=15&&e.slice(0,15)===t.slice(0,15)}var Le=new Set(["scratch","developer"]),ze={sandbox:"a sandbox",scratch:"a scratch org",developer:"a Developer Edition org",production:"a production org"};function dn(e,t){return e!==t?`another org, of another kind: ${ze[t]} here, ${ze[e]} in the file`:e==="sandbox"?"a sandbox refreshed since is another org, holding production\u2019s data again":"another org than the one the pipeline was exported for"}function Ge(e,t,n,s,i,r=e){return Me(n.organizationId,s.organizationId)?{ok:!0}:i!==void 0&&Me(i,s.organizationId)?{ok:!0,note:`${t} answers as org ${s.organizationId}, not the ${n.organizationId} the file names: taken, as --accept-org ${r}=${i} says.`}:Le.has(n.kind)&&Le.has(s.kind)?{ok:!0,note:`${t} answers as org ${s.organizationId}, not the ${n.organizationId} the file names: a ${s.kind==="scratch"?"scratch org":"Developer Edition org"} is made again under its alias, and is not pinned to its Id.`}:{ok:!1,code:"ORG_MOVED",message:`${t} answers as org ${s.organizationId}, and the file names ${n.organizationId}: ${dn(n.kind,s.kind)}. Nothing was run.`,wayOut:`check that ${t} is the org the pipeline is for, then run again with --accept-org ${t}=${s.organizationId}; or export the pipeline again from the Automation page.`}}function Be(e,t,n,s){if(!n.staging)return{org:t};let i=X(t);if(i!=="sandbox")return{org:t,note:`${s} is marked Staging in the file, and is a ${i} org here: the mark is read of a sandbox alone, and not set.`};let r={...t,staging:!0};return e.updateOrgMetadata(r),{org:r}}function L(e){return JSON.parse(JSON.stringify(e))}function He(e,t){let n=L(e.pipeline),s=L(e.syncConfigs);for(let i of se(e)){let r=t(i.key);if(r!==void 0){if(i.stepId!==void 0){let o=n.steps.find(a=>a.id===i.stepId);o&&(o.config[i.field]=r)}else if(i.syncConfigId!==void 0){let o=s[i.syncConfigId];o&&(o[i.field]=r)}}}return{pipeline:{...n,variables:n.variables.map(i=>i.required&&i.defaultValue===void 0?{...i,required:!1}:i),version:1,triggers:[],createdAt:e.exportedAt,updatedAt:e.exportedAt},syncConfigs:Object.values(s)}}var pn="prebuilt-",un="tpl-";function Ve(e,t,n){let s=new Pe(e);for(let o of n.syncConfigs)s.save(o);let i=new Oe(e);for(let o of Object.values(t.seedTemplates))o.id.startsWith(pn)||i.save(L(o));let r=new ce(e);for(let o of Object.values(t.maskingTemplates))o.id.startsWith(un)||r.save(L(o))}var Ue="backup:";function Ke(e,t,n,s=()=>{}){let i=e.getKeysByPrefix(Ue).filter(o=>!n.has(o));if(i.length===0)return 0;let r=ye(on(t,"snapshots.json"));for(let o of i)r.set(o,cn(e.get(o),s),"backups");return i.length}function cn(e,t){if(typeof e!="object"||e===null||Array.isArray(e))return e;let n=e;if(typeof n.orgId!="string")return e;let s=t(n.orgId);return s===void 0?e:{...n,orgId:s,organizationId:typeof n.organizationId=="string"?n.organizationId:n.orgId}}function We(e){return new Set(e.getKeysByPrefix(Ue))}var vn=`sandforge pipeline \u2014 run an Automation pipeline exported from VS Code, without the editor.
8
8
 
9
9
  Usage:
10
10
  npx sandforge pipeline plan --file <file> [options]
@@ -4,4 +4,4 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import{A,B,C,D,E,F,G,H,I,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-32EUNQT6.mjs";import"./chunk-T7WREYA5.mjs";import"./chunk-H4JUYUSL.mjs";import"./chunk-C2N2TNEU.mjs";import"./chunk-YAJQS3OL.mjs";import"./chunk-Z42PHCVZ.mjs";import"./chunk-DT3T7FRD.mjs";import"./chunk-ZUBBEP75.mjs";import"./chunk-XO5FBOQF.mjs";import"./chunk-KP5G6FUC.mjs";import"./chunk-7EYQYZJP.mjs";import"./chunk-H4OBZIX3.mjs";import"./chunk-V3R45ZWT.mjs";import"./chunk-XSKPYGMT.mjs";import"./chunk-6GQUZ4IP.mjs";import"./chunk-LAUOSXMN.mjs";import"./chunk-INIQ23K6.mjs";import"./chunk-2UU42PTD.mjs";import"./chunk-2JZGCCPG.mjs";import"./chunk-3CX7GPCR.mjs";import"./chunk-A65ADTCR.mjs";import"./chunk-NWOI25WY.mjs";import"./chunk-FQGHL7GR.mjs";import"./chunk-A7JJWOLT.mjs";import"./chunk-ZXFL2MSN.mjs";import"./chunk-VYOYXTCU.mjs";import"./chunk-C3LNYAVJ.mjs";import"./chunk-GJ6SZVHT.mjs";import"./chunk-52EXDVPN.mjs";import"./chunk-GMY5427L.mjs";import"./chunk-3HEMJTAP.mjs";import"./chunk-BN33LVPQ.mjs";import"./chunk-JKT5YAQ2.mjs";import"./chunk-QAPVKPEC.mjs";import"./chunk-BNKT3R3F.mjs";import"./chunk-QROPNEGY.mjs";import"./chunk-BZ24IAP5.mjs";import"./chunk-SCKUIE3R.mjs";import"./chunk-6FARZYMJ.mjs";import"./chunk-MUEQRIK7.mjs";import"./chunk-ISSP2FZ5.mjs";import"./chunk-XU25YA46.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-BOGNK4LV.mjs";import"./chunk-P55MKIZX.mjs";import"./chunk-PYRZFUVU.mjs";import"./chunk-O2PUGRNW.mjs";import"./chunk-7SDZR6SR.mjs";import"./chunk-TEIBWMJM.mjs";import"./chunk-BWWQXU2B.mjs";import"./chunk-T63U4OZJ.mjs";import"./chunk-YAIIRFKJ.mjs";import"./chunk-Q3DY7TO2.mjs";import"./chunk-3XG25GTF.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-54HYHHVL.mjs";import"./chunk-M6P5ZZLE.mjs";import"./chunk-WSUKC2U3.mjs";import"./chunk-QIRO4HTE.mjs";import"./chunk-3SKLBRPL.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-JH27IKCO.mjs";import"./chunk-SAMWHL22.mjs";import"./chunk-6KP6WETK.mjs";import"./chunk-4JKR4PTZ.mjs";import"./chunk-J24TIGSI.mjs";import"./chunk-HKUWHVI7.mjs";import"./chunk-VPDEJGPS.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-LHU6CPGE.mjs";import"./chunk-PBE44M2Y.mjs";import"./chunk-ZUOPC4W2.mjs";import"./chunk-JQZTMFO7.mjs";import"./chunk-JFNLKHY6.mjs";import"./chunk-VZVICK7Q.mjs";import"./chunk-PPGDAUEQ.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-7PY3VQP3.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-HFUDCNU5.mjs";import"./chunk-MS4FJDFD.mjs";import"./chunk-XZISAZA6.mjs";import"./chunk-LCDPCUXS.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-L4INJ5TZ.mjs";import"./chunk-KIMQQ6JQ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-ZUTUYBNW.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-PR74GYVI.mjs";import"./chunk-TMA34QMA.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as ENV_RUN_ID_RE,G as PREVIEW_UNREAD,l as accountKindOfRecordTypes,v as apiRequestsJson,p as describeDistribution,u as dryRunGatesJson,x as fitJson,c as fitOfArgs,y as main,d as parseArgs,C as parseRemoveArgs,m as personAccountLine,k as personRecordTypeNames,i as prebuiltTemplate,D as readRunSummary,f as readTemplateFile,o as recordTypeChoiceLine,n as recordTypeRule,A as refusalLines,H as removalPreviewJson,I as removalPreviewLines,F as removeMain,j as rulesFromDescribe,g as runIdRefusal,E as runOfSummary,z as scenarioKeptLines,t as seedAutomationCheck,w as seedFitLines,B as seedInterruptedLine,q as seedOrchestrator,r as seedWritePathOf,b as seededRandom,s as storageLine,e as templateDisplayName,h as templateRecordTypesRefusal};
7
+ import{A,B,C,D,E,F,G,H,I,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-MJZU3U5O.mjs";import"./chunk-QKEKG2LD.mjs";import"./chunk-KZTZDC7H.mjs";import"./chunk-OLCVHL7I.mjs";import"./chunk-DPMRIMUC.mjs";import"./chunk-SI267LYR.mjs";import"./chunk-6YL7BNYD.mjs";import"./chunk-7UVKIWKV.mjs";import"./chunk-ZJW6YOMV.mjs";import"./chunk-RE7RYF3B.mjs";import"./chunk-54WZUS7J.mjs";import"./chunk-H4OBZIX3.mjs";import"./chunk-KAZS5Z6W.mjs";import"./chunk-PBY2O6OF.mjs";import"./chunk-PAXNWTYK.mjs";import"./chunk-CBH3TOWK.mjs";import"./chunk-INIQ23K6.mjs";import"./chunk-6PD6K7LP.mjs";import"./chunk-JSAJS3MY.mjs";import"./chunk-FITPY3L4.mjs";import"./chunk-BBRWFKS5.mjs";import"./chunk-FQGHL7GR.mjs";import"./chunk-6I6TWNV5.mjs";import"./chunk-QAFPQ3YB.mjs";import"./chunk-4EOHEDFP.mjs";import"./chunk-JKJ74BX5.mjs";import"./chunk-PR42EZSR.mjs";import"./chunk-UX3BVH2Y.mjs";import"./chunk-GMY5427L.mjs";import"./chunk-7SQSWVAU.mjs";import"./chunk-PEDQPM2P.mjs";import"./chunk-X4BXESMQ.mjs";import"./chunk-EPFCERGL.mjs";import"./chunk-OM5NORJG.mjs";import"./chunk-2METQHGG.mjs";import"./chunk-RKTFFCNS.mjs";import"./chunk-6FARZYMJ.mjs";import"./chunk-QTG6LUZT.mjs";import"./chunk-XGGOUNPP.mjs";import"./chunk-L53JWJ3S.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-BOGNK4LV.mjs";import"./chunk-QROPNEGY.mjs";import"./chunk-IVFVNNGB.mjs";import"./chunk-6JWWSDM6.mjs";import"./chunk-VINGECAJ.mjs";import"./chunk-H4CGM6YO.mjs";import"./chunk-IUM4NFKI.mjs";import"./chunk-TEIBWMJM.mjs";import"./chunk-BWWQXU2B.mjs";import"./chunk-T63U4OZJ.mjs";import"./chunk-5XTUSN72.mjs";import"./chunk-Q7GIJBCD.mjs";import"./chunk-YHR4WQPR.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-YDXMTWAT.mjs";import"./chunk-M6P5ZZLE.mjs";import"./chunk-26POJDIT.mjs";import"./chunk-QIRO4HTE.mjs";import"./chunk-PMN4PAC3.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-H2BHESDA.mjs";import"./chunk-FP7CYB2F.mjs";import"./chunk-NED4MBIM.mjs";import"./chunk-UI3JQVRU.mjs";import"./chunk-KGU4SVIT.mjs";import"./chunk-AL4C3GFT.mjs";import"./chunk-JAEDM4SI.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-OUZQPYT3.mjs";import"./chunk-MSIEU5MR.mjs";import"./chunk-LC3NDW4N.mjs";import"./chunk-KB4ZHM4Q.mjs";import"./chunk-23SEDORH.mjs";import"./chunk-W6PN6TJG.mjs";import"./chunk-3Q353S2R.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-RHNTHGNU.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-Q7TLC3I2.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-D4GF4FAB.mjs";import"./chunk-CVHNXJH3.mjs";import"./chunk-MS4FJDFD.mjs";import"./chunk-YA6ATMTB.mjs";import"./chunk-LCDPCUXS.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-M6K34KGF.mjs";import"./chunk-TNT27RBG.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-S42RBRH2.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-WUUKFE2U.mjs";import"./chunk-EAC5QCE3.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-PMWAFDUB.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as ENV_RUN_ID_RE,G as PREVIEW_UNREAD,l as accountKindOfRecordTypes,v as apiRequestsJson,p as describeDistribution,u as dryRunGatesJson,x as fitJson,c as fitOfArgs,y as main,d as parseArgs,C as parseRemoveArgs,m as personAccountLine,k as personRecordTypeNames,i as prebuiltTemplate,D as readRunSummary,f as readTemplateFile,o as recordTypeChoiceLine,n as recordTypeRule,A as refusalLines,H as removalPreviewJson,I as removalPreviewLines,F as removeMain,j as rulesFromDescribe,g as runIdRefusal,E as runOfSummary,z as scenarioKeptLines,t as seedAutomationCheck,w as seedFitLines,B as seedInterruptedLine,q as seedOrchestrator,r as seedWritePathOf,b as seededRandom,s as storageLine,e as templateDisplayName,h as templateRecordTypesRefusal};
@@ -4,4 +4,4 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-LAUOSXMN.mjs";import"./chunk-INIQ23K6.mjs";import"./chunk-2UU42PTD.mjs";import"./chunk-2JZGCCPG.mjs";import"./chunk-A7JJWOLT.mjs";import"./chunk-ZXFL2MSN.mjs";import"./chunk-VYOYXTCU.mjs";import"./chunk-C3LNYAVJ.mjs";import"./chunk-GJ6SZVHT.mjs";import"./chunk-52EXDVPN.mjs";import"./chunk-GMY5427L.mjs";import"./chunk-3HEMJTAP.mjs";import"./chunk-BN33LVPQ.mjs";import"./chunk-JKT5YAQ2.mjs";import"./chunk-QAPVKPEC.mjs";import"./chunk-BNKT3R3F.mjs";import"./chunk-QROPNEGY.mjs";import"./chunk-BZ24IAP5.mjs";import"./chunk-SCKUIE3R.mjs";import"./chunk-6FARZYMJ.mjs";import"./chunk-MUEQRIK7.mjs";import"./chunk-ISSP2FZ5.mjs";import"./chunk-XU25YA46.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-BOGNK4LV.mjs";import"./chunk-P55MKIZX.mjs";import"./chunk-PYRZFUVU.mjs";import"./chunk-O2PUGRNW.mjs";import"./chunk-7SDZR6SR.mjs";import"./chunk-TEIBWMJM.mjs";import"./chunk-BWWQXU2B.mjs";import"./chunk-T63U4OZJ.mjs";import"./chunk-YAIIRFKJ.mjs";import"./chunk-Q3DY7TO2.mjs";import"./chunk-3XG25GTF.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-54HYHHVL.mjs";import"./chunk-M6P5ZZLE.mjs";import"./chunk-WSUKC2U3.mjs";import"./chunk-QIRO4HTE.mjs";import"./chunk-3SKLBRPL.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-JH27IKCO.mjs";import"./chunk-SAMWHL22.mjs";import"./chunk-6KP6WETK.mjs";import"./chunk-4JKR4PTZ.mjs";import"./chunk-J24TIGSI.mjs";import"./chunk-HKUWHVI7.mjs";import"./chunk-VPDEJGPS.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-LHU6CPGE.mjs";import"./chunk-PBE44M2Y.mjs";import"./chunk-ZUOPC4W2.mjs";import"./chunk-JQZTMFO7.mjs";import"./chunk-JFNLKHY6.mjs";import"./chunk-VZVICK7Q.mjs";import"./chunk-PPGDAUEQ.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-7PY3VQP3.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-HFUDCNU5.mjs";import"./chunk-MS4FJDFD.mjs";import"./chunk-XZISAZA6.mjs";import"./chunk-LCDPCUXS.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-L4INJ5TZ.mjs";import"./chunk-KIMQQ6JQ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-ZUTUYBNW.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-PR74GYVI.mjs";import"./chunk-TMA34QMA.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";var export_jsforce=a.default;export{D as LINE_RUN,r as alreadyLinkedWords,C as bothRecorders,c as buildConfig,h as buildQueryFn,g as cliAllowsDeletes,k as cliCountFn,f as cliFileDeps,l as cliPersonAccountsFn,m as cliSourceIdsFn,N as configurationToldLines,x as contactPointLines,A as deltaLine,w as encryptedLeftOutLine,n as inTheCommandsWords,P as jobLines,export_jsforce as jsforce,E as main,B as memoryCreations,u as objectCountsLine,y as objectCurrencyLines,t as objectErrorLines,z as objectPriceLines,v as objectWrittenLines,b as parseArgs,F as parseRemoveArgs,i as readCutLines,G as readRunSummary,d as readSavedConfig,q as recordTypeGivenOfObjectsLines,J as removalRefusal,K as removalSummaryLines,H as removalsPathOf,Q as removeMain,L as restoredLines,O as runFileOf,I as runOfSummary,e as savedConfigStore,s as simulationLines,j as statusWithReadCuts,o as syncApiRequestsJson,M as undeletedLines,p as writeCheckLines};
7
+ import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-CBH3TOWK.mjs";import"./chunk-INIQ23K6.mjs";import"./chunk-6PD6K7LP.mjs";import"./chunk-6I6TWNV5.mjs";import"./chunk-QAFPQ3YB.mjs";import"./chunk-4EOHEDFP.mjs";import"./chunk-JKJ74BX5.mjs";import"./chunk-PR42EZSR.mjs";import"./chunk-UX3BVH2Y.mjs";import"./chunk-GMY5427L.mjs";import"./chunk-7SQSWVAU.mjs";import"./chunk-PEDQPM2P.mjs";import"./chunk-X4BXESMQ.mjs";import"./chunk-EPFCERGL.mjs";import"./chunk-OM5NORJG.mjs";import"./chunk-2METQHGG.mjs";import"./chunk-RKTFFCNS.mjs";import"./chunk-6FARZYMJ.mjs";import"./chunk-QTG6LUZT.mjs";import"./chunk-XGGOUNPP.mjs";import"./chunk-L53JWJ3S.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-BOGNK4LV.mjs";import"./chunk-QROPNEGY.mjs";import"./chunk-IVFVNNGB.mjs";import"./chunk-6JWWSDM6.mjs";import"./chunk-VINGECAJ.mjs";import"./chunk-H4CGM6YO.mjs";import"./chunk-IUM4NFKI.mjs";import"./chunk-TEIBWMJM.mjs";import"./chunk-BWWQXU2B.mjs";import"./chunk-T63U4OZJ.mjs";import"./chunk-5XTUSN72.mjs";import"./chunk-Q7GIJBCD.mjs";import"./chunk-YHR4WQPR.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-YDXMTWAT.mjs";import"./chunk-M6P5ZZLE.mjs";import"./chunk-26POJDIT.mjs";import"./chunk-QIRO4HTE.mjs";import"./chunk-PMN4PAC3.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-H2BHESDA.mjs";import"./chunk-FP7CYB2F.mjs";import"./chunk-NED4MBIM.mjs";import"./chunk-UI3JQVRU.mjs";import"./chunk-KGU4SVIT.mjs";import"./chunk-AL4C3GFT.mjs";import"./chunk-JAEDM4SI.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-OUZQPYT3.mjs";import"./chunk-MSIEU5MR.mjs";import"./chunk-LC3NDW4N.mjs";import"./chunk-KB4ZHM4Q.mjs";import"./chunk-23SEDORH.mjs";import"./chunk-W6PN6TJG.mjs";import"./chunk-3Q353S2R.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-RHNTHGNU.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-Q7TLC3I2.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-D4GF4FAB.mjs";import"./chunk-CVHNXJH3.mjs";import"./chunk-MS4FJDFD.mjs";import"./chunk-YA6ATMTB.mjs";import"./chunk-LCDPCUXS.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-M6K34KGF.mjs";import"./chunk-TNT27RBG.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-S42RBRH2.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-WUUKFE2U.mjs";import"./chunk-EAC5QCE3.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-PMWAFDUB.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";var export_jsforce=a.default;export{D as LINE_RUN,r as alreadyLinkedWords,C as bothRecorders,c as buildConfig,h as buildQueryFn,g as cliAllowsDeletes,k as cliCountFn,f as cliFileDeps,l as cliPersonAccountsFn,m as cliSourceIdsFn,N as configurationToldLines,x as contactPointLines,A as deltaLine,w as encryptedLeftOutLine,n as inTheCommandsWords,Q as jobLines,export_jsforce as jsforce,E as main,B as memoryCreations,u as objectCountsLine,y as objectCurrencyLines,t as objectErrorLines,z as objectPriceLines,v as objectWrittenLines,b as parseArgs,F as parseRemoveArgs,i as readCutLines,G as readRunSummary,d as readSavedConfig,q as recordTypeGivenOfObjectsLines,J as removalRefusal,K as removalSummaryLines,H as removalsPathOf,R as removeMain,L as restoredLines,O as runFileOf,I as runOfSummary,P as runUserOfRunFile,e as savedConfigStore,s as simulationLines,j as statusWithReadCuts,o as syncApiRequestsJson,M as undeletedLines,p as writeCheckLines};
@@ -4,9 +4,7 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import{a as fs}from"./chunk-2JZGCCPG.mjs";import{d as Is}from"./chunk-UV74P4H2.mjs";import{a as Ne}from"./chunk-QROPNEGY.mjs";import{b as ps,e as ms}from"./chunk-BZ24IAP5.mjs";import{a as Ze,b as ce}from"./chunk-SCKUIE3R.mjs";import{c as se,d as gs}from"./chunk-6FARZYMJ.mjs";import{d as $e,k as Pe,z as ws}from"./chunk-J24TIGSI.mjs";import{b as cs,c as ls}from"./chunk-LHU6CPGE.mjs";import"./chunk-PBE44M2Y.mjs";import{a as os,b as as}from"./chunk-ZUOPC4W2.mjs";import{c as hs}from"./chunk-JQZTMFO7.mjs";import{Ga as Ss,oa as Us,uc as ke}from"./chunk-JFNLKHY6.mjs";import"./chunk-VZVICK7Q.mjs";import"./chunk-PPGDAUEQ.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-7PY3VQP3.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-HFUDCNU5.mjs";import"./chunk-MS4FJDFD.mjs";import{a as ds,c as us,f as V,h as ys}from"./chunk-LCDPCUXS.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-L4INJ5TZ.mjs";import"./chunk-KIMQQ6JQ.mjs";import{a as Oe}from"./chunk-TZE3Y7IQ.mjs";import{b as X}from"./chunk-CA5NAXSU.mjs";import"./chunk-ZUTUYBNW.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-TUACWKIH.mjs";import{Bd as is,Ua as ss,ib as fe,ic as Ee,jb as pe,kb as me,lb as ge,mb as j,nb as ns,ob as rs,qb as ts}from"./chunk-ZQO5PDX5.mjs";import{b as re,e as be,f as le,k as te,m as ee,u as ie,v as Ye,z as es}from"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";import{readFileSync as Ln}from"node:fs";var _e=200;function q(e,s){let n=[];for(let r=0;r<e.length;r+=s)n.push(e.slice(r,r+s));return n}function xe(e){return`'${Oe(e)}'`}function M(e){return`(${e.map(xe).join(", ")})`}function Rs(e){return`'${Oe(e).replace(/[%_]/g,n=>`\\${n}`)}.%'`}function he(e,s){let n=new Set(s.map(r=>r.toLowerCase()));return e.replace(/[^\s@<>()[\]"',;:]+@[^\s@<>()[\]"',;:]+/g,r=>n.has(r.toLowerCase())?r:"<address>")}function nn(e){let s=e;return typeof s?.errorCode=="string"&&s.errorCode!==""?s.errorCode:typeof s?.name=="string"&&/^[A-Z][A-Z_]+$/.test(s.name)?s.name:"REQUEST_FAILED"}function rn(e,s){let n={code:nn(e),message:X(e),fields:[]};return Array.from({length:s},()=>({success:!1,errors:[n]}))}function tn(e){let s=e;if(s==null)return{success:!1,errors:[{code:"NO_ANSWER",message:"the org answered nothing for it",fields:[]}]};let n=(s.errors??[]).map(t=>({code:typeof t.statusCode=="string"?t.statusCode:typeof t.errorCode=="string"?t.errorCode:"UNKNOWN_ERROR",message:typeof t.message=="string"?t.message:"the org gave no words",fields:Array.isArray(t.fields)?t.fields.filter(o=>typeof o=="string"):[]})),r=s.success===!0;return{...typeof s.id=="string"?{id:s.id}:{},success:r,errors:r||n.length>0?n:[{code:"UNKNOWN_ERROR",message:"the org refused it",fields:[]}]}}function on(e,s){let n=Array.isArray(e)?e:[e];return Array.from({length:s},(r,t)=>tn(n[t]))}function As(e){let s=0,n=async(r,t)=>{let o=[];for(let i of q(r,_e)){s+=1;try{o.push(...on(await t(i),i.length))}catch(g){o.push(...rn(g,i.length))}}return o};return{identity:async()=>{s+=1;let r=await e.identity();return{userId:r.user_id,organizationId:r.organization_id,username:r.username}},query:async r=>{s+=1;let t=await e.query(r),o=[...t.records];for(;!t.done&&t.nextRecordsUrl;)s+=1,t=await e.queryMore(t.nextRecordsUrl),o.push(...t.records);return o},update:(r,t)=>n(t,o=>e.sobject(r).update(o,{allOrNone:!1,headers:Ee()})),create:(r,t)=>n(t,o=>e.sobject(r).create(o,{allOrNone:!1,headers:Ee()})),destroy:(r,t)=>n(t,o=>e.sobject(r).destroy(o,{allOrNone:!1})),requests:()=>s}}var we=72,an=50,dn=20,un=200,cn=100,vs=".invalid";function ne(e){let s=e.length-vs.length;if(!(s<=0||e.slice(s).toLowerCase()!==vs))return e.slice(0,s)}function U(e){return e.slice(0,15)}function G(e){return typeof e=="string"&&e!==""?e:void 0}var Ce="Id, Username, Email, IsActive, ProfileId, Profile.Name, Profile.UserLicenseId";function Le(e){let s=e.Profile??void 0,n=G(s?.UserLicenseId);return{id:String(e.Id),username:String(e.Username),isActive:e.IsActive===!0,profileId:String(e.ProfileId),profileName:G(s?.Name)??String(e.ProfileId),...n?{licenseId:n}:{},email:G(e.Email)??""}}function bs(e){let s=e.indexOf("__");return s>0&&!e.slice(s+2).includes("__")?{namespace:e.slice(0,s),own:e.slice(s+2)}:{own:e}}function Z(e,s){return s?`${s}__${e}`:e}async function ln(e,s){let n=new Map,r=[...new Map(s.map(i=>[j(i),i])).values()];for(let i of q(r,an)){let g=await e.query(`SELECT ${Ce} FROM User WHERE Username IN ${M(i)}`);for(let c of g){let d=Le(c);n.set(j(d.username),d)}}let t=r.filter(i=>!n.has(j(i))),o=new Map;for(let i of q(t,dn)){let g=i.map(d=>`Username LIKE ${Rs(d)}`).join(" OR "),c=(await e.query(`SELECT ${Ce} FROM User WHERE ${g}`)).map(Le);for(let d of i){let w=`${j(d)}.`,h=[...new Map(c.filter(S=>j(S.username).startsWith(w)).map(S=>[S.id,S])).values()];o.set(j(d),h)}}return s.map(i=>{let g=n.get(j(i));if(g)return{given:i,kind:"found",user:g};let c=o.get(j(i))??[];return c.length===1?{given:i,kind:"found",user:c[0]}:c.length===0?{given:i,kind:"none"}:{given:i,kind:"two",usernames:c.map(d=>d.username).sort((d,w)=>d<w?-1:d>w?1:0)}})}async function oe(e,s,n,r,t,o=""){let i=[];for(let g of q([...new Set(t)],un))i.push(...await e.query(`SELECT ${s} FROM ${n} WHERE ${r} IN ${M(g)}${o}`));return i}async function ze(e,s,n,r,t,o=""){let i=[];for(let g of q([...new Set(t)],cn))i.push(...await e.query(`SELECT ${s} FROM ${n} WHERE ${r} IN ${M(g)}${o}`));return i}async function Fe(e){try{let[s]=await e.query("SELECT PermissionsManageUsers FROM UserPermissionAccess"),n=s?.PermissionsManageUsers;return typeof n=="boolean"?n:void 0}catch{return}}function Te(e,s){let n=new Set(s.map(r=>r.toLowerCase()));return e.filter(r=>!n.has(r.toLowerCase()))}async function fn(e,s,n){if(s.length===0)return[];let r=new Date(n.getTime()-we*36e5).toISOString().replace(/\.\d{3}Z$/,"Z"),t;try{t=await e.query(`SELECT Display, CreatedDate FROM SetupAuditTrail WHERE Action = ${xe("useremailchangesent")} AND CreatedDate >= ${r}`)}catch{return[]}let o=t.map(i=>(G(i.Display)??"").trim().toLowerCase());return s.filter(i=>{let g=ne(i.email)?.toLowerCase();if(g===void 0)return!1;let c=`[${U(i.id).toLowerCase()}]`;return o.some(d=>d.includes(c)&&d.endsWith(` ${g}`))}).map(i=>U(i.id))}async function Ue(e,s,n){let r=e.requests(),t=await e.identity(),o=await Fe(e),i=await ln(e,s.map(p=>p.username)),g=i.flatMap(p=>p.kind==="found"?[p.user]:[]),c=new Set(g.map(p=>U(p.id))),d=n.previous?.users??[],w=d.map(p=>p.applied.userId).filter(p=>!c.has(U(p))),h=(await oe(e,Ce,"User","Id",w)).map(Le),S=[...g,...h].map(p=>p.id),O=p=>[...new Map(s.flatMap(u=>p(u)??[]).map(u=>[u.toLowerCase(),u])).values()],k=O(p=>p.permissionSets),L=O(p=>p.permissionSetGroups),F=O(p=>p.groups),x=d.length>0,W=s.some(p=>p.frozen!==void 0)||x?(await oe(e,"Id, UserId, IsFrozen","UserLogin","UserId",S)).map(p=>({id:String(p.Id),userId:String(p.UserId),isFrozen:p.IsFrozen===!0})):[],l=s.some(p=>p.profile!==void 0)||x?(await e.query("SELECT Id, Name, UserLicenseId FROM Profile")).map(p=>{let u=G(p.UserLicenseId);return{id:String(p.Id),name:String(p.Name),...u?{licenseId:u}:{}}}):void 0,A={},E=[];if(k.length>0){let p=await ze(e,"Id, Name, NamespacePrefix, LicenseId","PermissionSet","Name",k.map(a=>bs(a).own)," AND IsOwnedByProfile = false");for(let a of p){let I=G(a.NamespacePrefix),R=G(a.LicenseId);E.push({id:String(a.Id),name:String(a.Name),...I?{namespace:I}:{},...R?{licenseId:R}:{}})}let u=E.map(a=>Z(a.name,a.namespace));Te(k,u).length>0&&(A.permissionSets=(await e.query("SELECT Name, NamespacePrefix FROM PermissionSet WHERE IsOwnedByProfile = false")).map(a=>Z(String(a.Name),G(a.NamespacePrefix))))}let v=[];if(L.length>0){let p=await ze(e,"Id, DeveloperName, NamespacePrefix","PermissionSetGroup","DeveloperName",L.map(a=>bs(a).own));for(let a of p){let I=G(a.NamespacePrefix);v.push({id:String(a.Id),name:String(a.DeveloperName),...I?{namespace:I}:{}})}let u=v.map(a=>Z(a.name,a.namespace));Te(L,u).length>0&&(A.permissionSetGroups=(await e.query("SELECT DeveloperName, NamespacePrefix FROM PermissionSetGroup")).map(a=>Z(String(a.DeveloperName),G(a.NamespacePrefix))))}let N=[];if(F.length>0){let p=await ze(e,"Id, DeveloperName, Type","Group","DeveloperName",F,` AND Type IN ${M(["Regular","Queue"])}`);for(let u of p){let a=u.Type;a!=="Regular"&&a!=="Queue"||N.push({id:String(u.Id),name:String(u.DeveloperName),type:a})}Te(F,N.map(u=>u.name)).length>0&&(A.groups=(await e.query(`SELECT DeveloperName FROM Group WHERE Type IN ${M(["Regular","Queue"])}`)).map(u=>String(u.DeveloperName)))}let f=s.some(p=>p.active===!0||p.profile!==void 0)||x||E.some(p=>p.licenseId?.startsWith("100"))?(await e.query("SELECT Id, Name, TotalLicenses, UsedLicenses FROM UserLicense")).map(p=>({id:String(p.Id),name:String(p.Name),total:Number(p.TotalLicenses??0),used:Number(p.UsedLicenses??0)})):[],m=k.length>0||L.length>0||x?(await oe(e,"Id, AssigneeId, PermissionSetId, PermissionSetGroupId","PermissionSetAssignment","AssigneeId",S)).map(p=>{let u=G(p.PermissionSetId),a=G(p.PermissionSetGroupId);return{id:String(p.Id),assigneeId:String(p.AssigneeId),...u?{permissionSetId:u}:{},...a?{permissionSetGroupId:a}:{}}}):[],y=F.length>0||x?(await oe(e,"Id, GroupId, UserOrGroupId","GroupMember","UserOrGroupId",S)).map(p=>({id:String(p.Id),groupId:String(p.GroupId),userId:String(p.UserOrGroupId)})):[],P=E.some(p=>p.licenseId?.startsWith("0PL"))?(await oe(e,"AssigneeId, PermissionSetLicenseId","PermissionSetLicenseAssign","AssigneeId",S)).map(p=>({assigneeId:String(p.AssigneeId),permissionSetLicenseId:String(p.PermissionSetLicenseId)})):[],$=i.flatMap((p,u)=>p.kind==="found"&&s[u]?.email==="restore"&&ne(p.user.email)!==void 0?[p.user]:[]),b=await fn(e,$,n.now);return{connected:t,manageUsers:o,resolutions:i,held:h,logins:W,...l?{profiles:l}:{},licenses:f,permissionSets:E,permissionSetGroups:v,groups:N,knownNames:A,assignments:m,memberships:y,licenseAssignments:P,addressesAsked:b,requests:e.requests()-r}}function Es(e){return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function $s(e){return[...new Set(e)].sort((s,n)=>s<n?-1:s>n?1:0)}function pn(e,s,n){if(Math.abs(e.length-s.length)>n)return n+1;let r=Array.from({length:s.length+1},(t,o)=>o);for(let t=1;t<=e.length;t+=1){let o=[t];for(let i=1;i<=s.length;i+=1)o[i]=Math.min(r[i]+1,o[i-1]+1,r[i-1]+(e[t-1]===s[i-1]?0:1));r=o}return r[s.length]}function Os(e){return e.toLowerCase().split(/[^\p{L}\p{N}]+/u).filter(s=>s.length>=3)}function Me(e,s){let n=e.toLowerCase(),r=new Set(Os(e));return $s(s.filter(t=>{let o=t.toLowerCase();return o.includes(n)||n.includes(o)||Os(t).some(i=>r.has(i))||pn(o,n,2)<=2}))}function qe(e){let s=e.slice(0,20).join(", ");return e.length>20?`${s}, and ${e.length-20} more`:s}var De={profile:"change its profile",active:"deactivate it",frozen:"freeze it"};function je(e,s){return{code:"USERS_NO_RIGHT",message:(s===!1?`${e} cannot manage users here (Manage Users)`:`the org would not say whether ${e} may manage users (Manage Users)`)+": give it Manage Users, or connect as a user who has it"}}function C(e,s){return e!==void 0&&s!==void 0&&U(e)===U(s)}function We(e){return e.what==="group"?{what:"group",name:e.name,type:e.type??"Regular",to:"removed"}:{what:e.what,name:e.name,to:"removed"}}function Se(){return{assign:[],unassign:[],join:[],leave:[]}}function ae(e,s,n={}){let r=[],t=e.connected;e.manageUsers!==!0&&r.push(je(t.username,e.manageUsers));let o=n.previous?.users??[],i=l=>o.find(A=>C(A.applied.userId,l)),g=l=>e.profiles?.find(A=>C(A.id,l)),c=l=>e.logins.find(A=>C(A.userId,l)),d=l=>e.assignments.some(A=>C(A.id,l)),w=l=>e.memberships.some(A=>C(A.id,l)),h=(l,A,E,v)=>{let N={isActive:l.isActive,isFrozen:c(l.id)?.isFrozen??!1,profileId:l.profileId},f=A?.applied.before??N;v.current=N,v.before=f,l.licenseId!==void 0&&(v.licenseId=l.licenseId);let m=b=>{if(E[b]!==void 0)return E[b];if(A&&A.after[b]!==A.applied.before[b]&&N[b]===A.after[b])return f[b]},y=m("profileId");y!==void 0&&(v.target.profileId=y,C(y,N.profileId)||(v.writes.profileId=y,v.changes.push({what:"profile",from:l.profileName,to:g(y)?.name??y})));let P=m("isActive");P!==void 0&&(v.target.isActive=P,P!==N.isActive&&(v.writes.isActive=P,v.changes.push({what:"active",from:N.isActive,to:P})));let $=m("isFrozen");if($!==void 0&&(v.target.isFrozen=$,$!==N.isFrozen)){let b=c(l.id);v.writes.isFrozen=$,b&&(v.writes.loginId=b.id),v.changes.push({what:"frozen",from:N.isFrozen,to:$})}},S=(l,A)=>{for(let E of l)E.what==="group"?w(E.id)&&A.writes.leave.push(E):d(E.id)&&A.writes.unassign.push(E)},O=[],k=new Map;s.forEach((l,A)=>{let E=e.resolutions[A];if(E===void 0||E.kind!=="found"){O.push({given:l.username,username:l.username,inFile:!0,changes:[],emailsToPeople:0,target:{},writes:Se(),found:{permissionSetAssignments:[],groupMembers:[]},carried:[]}),E?.kind==="two"?r.push({code:"USERS_TWO_USERS",username:l.username,message:`${l.username} names ${E.usernames.length} users: write the sandbox\u2019s username in full: ${E.usernames.join(" or ")}`}):r.push({code:"USERS_NO_USER",username:l.username,message:`${l.username}: no user has this username, nor this username followed by .<sandbox>: check the username, as Setup > Users gives it, or take it out of the file`});return}let v=E.user,N=k.get(U(v.id));if(N!==void 0){O.push({given:l.username,username:v.username,inFile:!0,changes:[],emailsToPeople:0,target:{},writes:Se(),found:{permissionSetAssignments:[],groupMembers:[]},carried:[]}),r.push({code:"USERS_SAME_USER",username:l.username,message:`${l.username} and ${N} name one user, ${v.username}: one entry per user`});return}k.set(U(v.id),l.username);let f=i(v.id),m={given:l.username,username:v.username,userId:v.id,inFile:!0,changes:[],emailsToPeople:0,target:{},writes:Se(),found:{permissionSetAssignments:[],groupMembers:[]},carried:[]},y;if(l.profile!==void 0){let a=(e.profiles??[]).filter(I=>I.name===l.profile);if(a.length===1)y=a[0].id;else{let I=(e.profiles??[]).map(z=>z.name),R=Me(l.profile,I);r.push({code:"USERS_PROFILE_UNKNOWN",username:l.username,message:`profile ${l.profile}: `+(a.length===0?"no profile has this name":`${a.length} profiles have this name`)+": profiles are named as Setup > Profiles names them, in the org\u2019s language: "+qe(R.length>0?R:$s(I))})}}h(v,f,{...y!==void 0?{profileId:y}:{},...l.active!==void 0?{isActive:l.active}:{},...l.frozen!==void 0?{isFrozen:l.frozen}:{}},m);let P=(m.target.profileId!==void 0?g(m.target.profileId)?.licenseId:void 0)??v.licenseId,$=f?.accesses??[],b=(a,I)=>$.find(R=>R.what===a&&R.name.toLowerCase()===I.toLowerCase()),p=(a,I)=>{for(let R of I??[]){let _=(a==="permissionSet"?e.permissionSets.map(T=>({...T,apiName:Z(T.name,T.namespace)})):e.permissionSetGroups.map(T=>({...T,licenseId:void 0,apiName:Z(T.name,T.namespace)}))).find(T=>T.apiName.toLowerCase()===R.toLowerCase());if(!_){let T=(a==="permissionSet"?e.knownNames.permissionSets:e.knownNames.permissionSetGroups)??[],ue=Me(R,T);r.push({code:"USERS_PERMISSION_SET_UNKNOWN",username:l.username,message:(a==="permissionSet"?`permission set ${R}: no permission set has this API name: names are API names (Setup > Permission Sets > API Name)`:`permission set group ${R}: no permission set group has this API name: names are API names (Setup > Permission Set Groups > API Name)`)+(ue.length>0?`; close: ${qe(ue)}`:"")});continue}let Q=e.assignments.find(T=>C(T.assigneeId,v.id)&&C(a==="permissionSet"?T.permissionSetId:T.permissionSetGroupId,_.id)),B=b(a,R);if(Q){B&&C(B.id,Q.id)?m.carried.push(B):m.found.permissionSetAssignments.push(Q.id);continue}let J=_.licenseId;if(J?.startsWith("100")&&!C(J,P)){let T=e.licenses.find(ue=>C(ue.id,J))?.name??J;r.push({code:"USERS_PERMISSION_SET_LICENSE",username:l.username,message:`${v.username}: permission set ${R} needs the license ${T}, which this user will not have: assign the permission set license first, in Setup, or take the set out`});continue}if(J?.startsWith("0PL")&&!e.licenseAssignments.some(T=>C(T.assigneeId,v.id)&&C(T.permissionSetLicenseId,J))){r.push({code:"USERS_PERMISSION_SET_LICENSE",username:l.username,message:`${v.username}: permission set ${R} needs a permission set license this user does not hold: assign the permission set license first, in Setup, or take the set out`});continue}m.writes.assign.push({what:a,name:R,setId:_.id})}};p("permissionSet",l.permissionSets),p("permissionSetGroup",l.permissionSetGroups);for(let a of l.groups??[]){let I=e.groups.find(_=>_.name.toLowerCase()===a.toLowerCase());if(!I){let _=Me(a,e.knownNames.groups??[]);r.push({code:"USERS_GROUP_UNKNOWN",username:l.username,message:`group ${a}: no public group or queue has this API name (DeveloperName)`+(_.length>0?`; close: ${qe(_)}`:"")});continue}let R=e.memberships.find(_=>C(_.userId,v.id)&&C(_.groupId,I.id)),z=b("group",a);if(R){z&&C(z.id,R.id)?m.carried.push(z):m.found.groupMembers.push(R.id);continue}m.writes.join.push({name:a,type:I.type,groupId:I.id})}let u=a=>((a.what==="permissionSet"?l.permissionSets:a.what==="permissionSetGroup"?l.permissionSetGroups:l.groups)??[]).some(R=>R.toLowerCase()===a.name.toLowerCase());S($.filter(a=>!u(a)),m);for(let a of m.writes.assign)m.changes.push({what:a.what,name:a.name,to:"added"});for(let a of m.writes.unassign)m.changes.push(We(a));for(let a of m.writes.join)m.changes.push({what:"group",name:a.name,type:a.type,to:"added"});for(let a of m.writes.leave)m.changes.push(We(a));if(l.email==="keep"&&(m.address="kept"),l.email==="restore"){let a=ne(v.email);a===void 0?m.address="restored":e.addressesAsked.includes(U(v.id))?m.address="awaiting":(m.address="invalid",m.writes.email=a,m.emailsToPeople=1,m.changes.push({what:"email",to:"awaiting"}))}O.push(m)});let L=new Set(O.flatMap(l=>l.userId?[U(l.userId)]:[]));for(let l of o){if(L.has(U(l.applied.userId)))continue;let A=e.held.find(v=>C(v.id,l.applied.userId));if(!A)continue;let E={username:A.username,userId:A.id,inFile:!1,changes:[],emailsToPeople:0,target:{},writes:Se(),found:{permissionSetAssignments:[],groupMembers:[]},carried:[]};h(A,l,{},E),S(l.accesses,E);for(let v of[...E.writes.unassign,...E.writes.leave])E.changes.push(We(v));O.push(E)}for(let l of O)l.writes.isFrozen===void 0||l.writes.loginId!==void 0||r.push({code:"USERS_NO_LOGIN",...l.given!==void 0?{username:l.given}:{},message:`${l.username}: the org keeps no login of this user (UserLogin), which a freeze writes`+(l.inFile?`: take frozen off ${l.username}`:"")});for(let l of O){if(!C(l.userId,t.userId))continue;let A=[...l.writes.profileId!==void 0?[De.profile]:[],...l.writes.isActive===!1?[De.active]:[],...l.writes.isFrozen===!0?[De.frozen]:[]];A.length!==0&&r.push({code:"USERS_SELF",...l.given!==void 0?{username:l.given}:{},message:l.inFile?`${l.username} is the user connected, and the file would ${Es(A)}: SandForge would lock itself out: take ${l.username} out of the file, or connect as another`:`${l.username} is the user connected, and putting it back as it was would ${Es(A)}: SandForge would lock itself out: connect as another`})}let F=mn(e,O,r),x=O.reduce((l,A)=>l+A.emailsToPeople,0);x>0&&n.acceptUserEmails!==!0&&r.push({code:"USERS_EMAILS_NOT_ACCEPTED",message:`Salesforce would email ${x} ${x===1?"person":"people"}: the confirmation of each address asked back, a system email, which only the line accepts: --accept-user-emails, once those people may receive them`});let W=n.deliverability==="open"||n.deliverability==="unread";return x>0&&W&&n.acceptEmails!==!0&&r.push({code:"USERS_EMAILS_OPEN",message:(n.deliverability==="unread"?"the org's deliverability could not be read, so it may deliver all email, and ":"the org delivers all email, and ")+`${x} ${x===1?"address":"addresses"} would be asked back before the masking is done: set Setup > Deliverability to System email only until the masking is done, or accept with --accept-emails that what runs there emails these people`}),{users:O,licenses:F,emailsToPeople:x,refusals:r}}function mn(e,s,n){let r=new Map,t=c=>{let d=U(c),w=r.get(d);return w||(w={takesFirst:0,freesFirst:0,takesThen:0,freesThen:0,takers:new Map},r.set(d,w)),w},o=c=>e.profiles?.find(d=>U(d.id)===U(c))?.licenseId,i=(c,d,w)=>{let h=t(c).takers;h.set(d,[...h.get(d)??[],w])};for(let c of s){let d=c.current;if(!d)continue;let w=o(d.profileId)??c.licenseId,h=c.writes.profileId??d.profileId,S=o(h)??w;if(c.writes.profileId!==void 0&&d.isActive&&S!==void 0&&(w===void 0||U(w)!==U(S))){t(S).takesFirst+=1;let O=c.changes.find(k=>k.what==="profile");i(S,`profile: ${O?.what==="profile"?O.to:h}`,c.username),w!==void 0&&(t(w).freesFirst+=1)}S!==void 0&&(c.writes.isActive===!0&&(t(S).takesThen+=1,i(S,"active: true",c.username)),c.writes.isActive===!1&&(t(S).freesThen+=1))}let g=[];for(let c of e.licenses){let d=r.get(U(c.id)),w=d?d.takesFirst+d.takesThen:0;if(!d||w===0)continue;let h=Math.max(0,w-d.freesFirst-d.freesThen),S=c.total-c.used,O=d.takesFirst>S||d.takesThen>S-d.takesFirst+d.freesFirst+d.freesThen;if(g.push({name:c.name,total:c.total,used:c.used,toUse:h}),O){let k=[...d.takers].map(([L,F])=>`${L} off ${F.join(" or ")}`);n.push({code:"USERS_LICENSE",message:`${c.name}: ${c.used} of ${c.total} used, and the file takes ${h} more: deactivate a user who no longer needs it, or take ${k.join(", or ")}`})}}return g}function H(e){return Math.ceil(e/_e)}function gn(e){let s=i=>e.users.filter(i).length,n=i=>e.users.reduce((g,c)=>g+i(c),0),r=s(i=>i.writes.join.length>0),t=s(i=>i.writes.isFrozen!==void 0),o=s(i=>i.writes.profileId!==void 0||i.writes.isActive!==void 0||i.writes.isFrozen!==void 0||i.writes.email!==void 0);return H(s(i=>i.writes.profileId!==void 0))+H(s(i=>i.writes.isActive===!1))+H(s(i=>i.writes.isActive===!0))+H(t)+H(n(i=>i.writes.assign.length))+H(n(i=>i.writes.unassign.length))+H(r)+H(n(i=>i.writes.join.length))+H(n(i=>i.writes.leave.length))+H(s(i=>i.writes.email!==void 0))+H(o)+H(t)}function ye(e,s,n){return{org:s,users:e.users.map(r=>({username:r.username,...r.given!==void 0&&j(r.given)!==j(r.username)?{given:r.given}:{},...r.userId!==void 0?{userId:r.userId}:{},...r.address!==void 0?{address:r.address}:{},changes:r.changes,...r.emailsToPeople>0?{emailsToPeople:r.emailsToPeople}:{}})),...e.licenses.length>0?{licenses:e.licenses}:{},emailsToPeople:e.emailsToPeople,apiRequests:n+gn(e),...e.refusals.length>0?{refusals:e.refusals}:{}}}async function hn(e){let s=e.now??(()=>new Date),n=await Ue(e.org,e.users,{now:s(),...e.previous?{previous:e.previous}:{}}),r=ae(n,e.users,{...e.previous?{previous:e.previous}:{},...e.acceptUserEmails!==void 0?{acceptUserEmails:e.acceptUserEmails}:{},...e.deliverability!==void 0?{deliverability:e.deliverability}:{},...e.acceptEmails!==void 0?{acceptEmails:e.acceptEmails}:{}});return{state:n,plan:r,answer:ye(r,e.organization,n.requests)}}function Ie(e,s){let n=e.changes.find(s);if(!n)throw new Error(`No change of ${e.username} for this write`);return n}function Re(e,s){let n=e?.errors[0];return{code:n?.code??"NO_ANSWER",message:he(n?.message??"the org answered nothing for it",s)}}var wn=new Set(["ENTITY_IS_DELETED","NOT_FOUND","INVALID_CROSS_REFERENCE_KEY"]);function ks(e){let{target:s}=e.planned;return{isActive:s.isActive!==void 0?e.standing.isActive:e.before.isActive,isFrozen:s.isFrozen!==void 0?e.standing.isFrozen:e.before.isFrozen,profileId:s.profileId!==void 0?e.standing.profileId:e.before.profileId}}function Un(e){let s=ks(e);return e.accesses.length>0||s.isActive!==e.before.isActive||s.isFrozen!==e.before.isFrozen||U(s.profileId)!==U(e.before.profileId)}function Ps(e){let s=e.found.permissionSetAssignments.length>0||e.found.groupMembers.length>0?{found:e.found}:{};return{username:e.planned.username,userId:e.userId,before:e.before,done:e.done,created:{permissionSetAssignments:e.accesses.filter(n=>n.what!=="group").map(n=>n.id),groupMembers:e.accesses.filter(n=>n.what==="group").map(n=>n.id)},...s,...e.address!==void 0?{address:e.address}:{},...e.refused.length>0?{refused:e.refused}:{}}}async function Ns(e){let{org:s,store:n,signal:r}=e,t=e.now??(()=>new Date),o=s.requests(),{state:i,plan:g,answer:c}=await hn(e);if(g.refusals.length>0)return{kind:"refused",plan:c};if(U(i.connected.organizationId)!==U(e.organization.organizationId))throw new Error(`The connection is to ${i.connected.organizationId}, not to ${e.organization.organizationId}: nothing was written`);let d=g.users.flatMap(f=>f.userId!==void 0&&f.current!==void 0&&f.before!==void 0?[{planned:f,userId:f.userId,before:f.before,standing:{...f.current},done:[],refused:[],accesses:[...f.carried,...f.writes.unassign,...f.writes.leave],found:{permissionSetAssignments:[...f.found.permissionSetAssignments],groupMembers:[...f.found.groupMembers]},...f.address!==void 0?{address:f.address}:{}}]:[]),w=d.map(f=>f.planned.username),h=0,S=t().toISOString(),O=(f,m)=>({...e.previous?{replaces:e.previous.run}:{},status:f,startedAt:S,...m?{endedAt:t().toISOString()}:{},emailsToPeople:h,users:d.filter(y=>y.planned.inFile||Un(y)).map(y=>({applied:Ps(y),after:ks(y),accesses:y.accesses,inFile:y.planned.inFile}))}),k=(f,m,y)=>({version:1,organizationId:i.connected.organizationId,run:f,...O(m,y)}),F=(await n.begin(i.connected.organizationId,O("running",!1))).run,x=new Set,W=async(f,m,y,P,$)=>{if(f.length===0)return;let b=await s.update(P,f.map(m));f.forEach((p,u)=>{let a=Ie(p.planned,y);b[u]?.success===!0?($(p),p.done.push(a)):p.refused.push({change:a,...Re(b[u],w)})})},l=[()=>W(d.filter(f=>f.planned.writes.profileId!==void 0),f=>({Id:f.userId,ProfileId:f.planned.writes.profileId}),f=>f.what==="profile","User",f=>{f.standing.profileId=f.planned.writes.profileId??f.standing.profileId}),async()=>{for(let f of[!1,!0])await W(d.filter(m=>m.planned.writes.isActive===f),m=>({Id:m.userId,IsActive:f}),m=>m.what==="active","User",m=>{m.standing.isActive=f})},()=>W(d.filter(f=>f.planned.writes.isFrozen!==void 0),f=>({Id:f.planned.writes.loginId??"",IsFrozen:f.planned.writes.isFrozen}),f=>f.what==="frozen","UserLogin",f=>{f.standing.isFrozen=f.planned.writes.isFrozen??f.standing.isFrozen}),async()=>{let f=d.flatMap(m=>m.planned.writes.assign.map(y=>({one:m,assign:y})));if(f.length>0){let m=await s.create("PermissionSetAssignment",f.map(({one:y,assign:P})=>P.what==="permissionSet"?{AssigneeId:y.userId,PermissionSetId:P.setId}:{AssigneeId:y.userId,PermissionSetGroupId:P.setId}));f.forEach(({one:y,assign:P},$)=>{let b=m[$],p=Ie(y.planned,u=>u.what===P.what&&u.name===P.name&&u.to==="added");b?.success===!0&&b.id!==void 0?(y.accesses.push({id:b.id,what:P.what,name:P.name}),y.done.push(p)):b?.errors[0]?.code==="DUPLICATE_VALUE"?x.add(y):y.refused.push({change:p,...Re(b,w)})})}await A("PermissionSetAssignment",m=>m.planned.writes.unassign)},async()=>{let f=d.filter(m=>m.planned.writes.join.length>0);if(f.length>0){let m=new Map;for(let P of q(f.map($=>$.userId),200)){let $=await s.query(`SELECT Id, GroupId, UserOrGroupId FROM GroupMember WHERE UserOrGroupId IN ${M(P)}`);for(let b of $)m.set(`${U(String(b.UserOrGroupId))}:${U(String(b.GroupId))}`,String(b.Id))}let y=f.flatMap(P=>P.planned.writes.join.flatMap($=>{let b=m.get(`${U(P.userId)}:${U($.groupId)}`);return b!==void 0?(P.found.groupMembers.push(b),[]):[{one:P,join:$}]}));if(y.length>0){let P=new Set([...m.values()].map(U)),$=await s.create("GroupMember",y.map(({one:b,join:p})=>({GroupId:p.groupId,UserOrGroupId:b.userId})));y.forEach(({one:b,join:p},u)=>{let a=$[u],I=Ie(b.planned,R=>R.what==="group"&&R.name===p.name&&R.to==="added");if(a?.success===!0&&a.id!==void 0){if(P.has(U(a.id))){b.found.groupMembers.push(a.id);return}b.accesses.push({id:a.id,what:"group",name:p.name,type:p.type}),b.done.push(I)}else b.refused.push({change:I,...Re(a,w)})})}}await A("GroupMember",m=>m.planned.writes.leave)},()=>W(d.filter(f=>f.planned.writes.email!==void 0),f=>({Id:f.userId,Email:f.planned.writes.email}),f=>f.what==="email","User",f=>{h+=1,f.address="awaiting"})];async function A(f,m){let y=d.flatMap($=>m($).map(b=>({one:$,access:b})));if(y.length===0)return;let P=await s.destroy(f,y.map(({access:$})=>$.id));y.forEach(({one:$,access:b},p)=>{let u=P[p],a=Ie($.planned,R=>R.what===b.what&&"name"in R&&R.name===b.name&&R.to==="removed"),I=u?.errors.some(R=>wn.has(R.code))===!0;u?.success===!0||I?($.accesses=$.accesses.filter(R=>R.id!==b.id),u?.success===!0&&$.done.push(a)):$.refused.push({change:a,...Re(u,w)})})}let E="success";for(let f of l){if(r?.aborted){E="cancelled";break}await f(),await n.write(k(F,"running",!1))}E!=="cancelled"&&await Sn(s,d,x),E!=="cancelled"&&d.some(f=>f.refused.length>0)&&(E="partial");let v=k(F,E,!0);return await n.write(v),{kind:"applied",answer:{org:e.organization,run:F,status:E,users:d.map(Ps),emailsToPeople:h,apiRequests:s.requests()-o},record:v}}async function Sn(e,s,n){let r=s.filter(c=>c.planned.writes.profileId!==void 0||c.planned.writes.isActive!==void 0||c.planned.writes.isFrozen!==void 0||c.planned.writes.email!==void 0),t=new Map(s.map(c=>[U(c.userId),c])),o=(c,d)=>{let w=c.done.findIndex(S=>S.what===d);if(w<0)return;let[h]=c.done.splice(w,1);c.refused.push({change:h,code:"NOT_HELD",message:"the org answered success, and its read after the run holds the user otherwise"})};for(let c of q(r.map(d=>d.userId),200)){let d=await e.query(`SELECT Id, Email, IsActive, ProfileId FROM User WHERE Id IN ${M(c)}`);for(let w of d){let h=t.get(U(String(w.Id)));if(!h)continue;let S=w.IsActive===!0,O=String(w.ProfileId);h.planned.writes.isActive!==void 0&&S!==h.standing.isActive&&o(h,"active"),h.planned.writes.profileId!==void 0&&U(O)!==U(h.standing.profileId)&&o(h,"profile"),h.standing.isActive=S,h.standing.profileId=O,h.address==="awaiting"&&typeof w.Email=="string"&&ne(w.Email)===void 0&&(h.address="restored")}}let i=r.filter(c=>c.planned.writes.isFrozen!==void 0);for(let c of q(i.map(d=>d.userId),200)){let d=await e.query(`SELECT Id, UserId, IsFrozen FROM UserLogin WHERE UserId IN ${M(c)}`);for(let w of d){let h=t.get(U(String(w.UserId)));if(!h)continue;let S=w.IsFrozen===!0;S!==h.standing.isFrozen&&o(h,"frozen"),h.standing.isFrozen=S}}if(n.size===0)return;let g=await e.query(`SELECT Id, AssigneeId, PermissionSetId, PermissionSetGroupId FROM PermissionSetAssignment WHERE AssigneeId IN ${M([...n].map(c=>c.userId))}`);for(let c of n)for(let d of c.planned.writes.assign){let w=g.find(S=>U(String(S.AssigneeId))===U(c.userId)&&U(String((d.what==="permissionSet"?S.PermissionSetId:S.PermissionSetGroupId)??""))===U(d.setId)),h=w?String(w.Id):void 0;h!==void 0&&!c.accesses.some(S=>U(S.id)===U(h))&&!c.found.permissionSetAssignments.includes(h)&&c.found.permissionSetAssignments.push(h)}}function yn(e,s,n){let{before:r}=e.applied,{after:t}=e,o=s.standing,i=U(e.applied.userId)===U(n.connected.userId),g=`${n.connected.username} is the user connected: SandForge would lock itself out; connect as another to put it back`,c={leave:e.accesses.filter(d=>d.what==="group"&&s.present.has(U(d.id))),unassign:e.accesses.filter(d=>d.what!=="group"&&s.present.has(U(d.id))),kept:[]};if(t.isFrozen!==r.isFrozen&&o.isFrozen===t.isFrozen){let d={what:"frozen",from:t.isFrozen,to:r.isFrozen};i&&r.isFrozen?c.kept.push({change:d,why:g}):s.loginId===void 0?c.kept.push({change:d,why:"the org keeps no login of this user (UserLogin) to write"}):c.isFrozen={to:r.isFrozen,loginId:s.loginId,change:d}}if(t.isActive!==r.isActive&&o.isActive===t.isActive){let d={what:"active",from:t.isActive,to:r.isActive};i&&!r.isActive?c.kept.push({change:d,why:g}):c.isActive={to:r.isActive,change:d}}if(U(t.profileId)!==U(r.profileId)&&U(o.profileId)!==U(r.profileId)){let d=S=>s.profileNames.get(U(S))??S,w={what:"profile",from:d(o.profileId),to:d(r.profileId)},h=U(o.profileId)!==U(t.profileId);i?c.kept.push({change:w,why:g}):h&&!n.includeChanged?c.kept.push({change:w,why:`its profile was changed since the run, to ${d(o.profileId)}: --include-changed puts ${d(r.profileId)} back`}):c.profileId={to:r.profileId,change:w}}return c}function _s(e){return e.what==="group"?{what:"group",name:e.name,type:e.type??"Regular",to:"removed"}:{what:e.what,name:e.name,to:"removed"}}function Ge(e,s,n,r){return{org:e.organization,run:e.run,status:"failure",users:[],apiRequests:r,refusals:[{code:s,message:n}]}}async function xs(e){let{org:s,store:n,run:r}=e,t=e.now??(()=>new Date),o=s.requests(),i=()=>s.requests()-o,g=await s.identity(),c=await n.read(g.organizationId,r);if(!c)return Ge(e,"USERS_RUN_NOT_FOUND",`run ${r}: this machine keeps no run of that number for this org, whose Organization Id is ${g.organizationId}: a sandbox refreshed since answers another, and its runs went with the copy they set up`,i());let d=(await n.list(g.organizationId)).find(u=>u.replaces===r);if(d)return Ge(e,"USERS_RUN_REPLACED",`run ${r} was replaced by run ${d.run}, which holds what it set up: remove run ${d.run}`,i());let w=await Fe(s);if(w!==!0){let u=je(g.username,w);return Ge(e,u.code,u.message,i())}let h=c.users,S=h.map(u=>u.applied.userId),O=new Map;for(let u of q(S,200))for(let a of await s.query(`SELECT Id, IsActive, ProfileId FROM User WHERE Id IN ${M(u)}`))O.set(U(String(a.Id)),{isActive:a.IsActive===!0,isFrozen:!1,profileId:String(a.ProfileId)});let k=new Map,L=h.filter(u=>u.after.isFrozen!==u.applied.before.isFrozen);for(let u of q(L.map(a=>a.applied.userId),200))for(let a of await s.query(`SELECT Id, UserId, IsFrozen FROM UserLogin WHERE UserId IN ${M(u)}`)){let I=U(String(a.UserId));k.set(I,String(a.Id));let R=O.get(I);R&&(R.isFrozen=a.IsFrozen===!0)}let F=new Set,x=u=>h.flatMap(a=>a.accesses.filter(I=>u==="memberships"==(I.what==="group")).map(I=>I.id));for(let[u,a]of[["PermissionSetAssignment",x("assignments")],["GroupMember",x("memberships")]])for(let I of q(a,200))for(let R of await s.query(`SELECT Id FROM ${u} WHERE Id IN ${M(I)}`))F.add(U(String(R.Id)));let W=h.flatMap(u=>U(u.after.profileId)!==U(u.applied.before.profileId)?[u.applied.before.profileId,u.after.profileId,O.get(U(u.applied.userId))?.profileId??""]:[]).filter(u=>u!==""),l=new Map;for(let u of q([...new Set(W)],200))for(let a of await s.query(`SELECT Id, Name FROM Profile WHERE Id IN ${M(u)}`))l.set(U(String(a.Id)),String(a.Name));let A=h.map(u=>u.applied.username),E=h.flatMap(u=>{let a=O.get(U(u.applied.userId));if(!a)return[];let I=k.get(U(u.applied.userId));return[{user:u,undo:yn(u,{standing:a,...I?{loginId:I}:{},profileNames:l,present:F},{includeChanged:e.includeChanged===!0,connected:g}),undone:[],refused:[]}]}),v=(u,a,I)=>{let R=I?.code??"NO_ANSWER";u.refused.push({change:a,code:R,why:`the org refused it: ${R} ${he(I?.message??"the org answered nothing for it",A)}`})},N=async(u,a)=>{let I=E.flatMap(z=>a(z).map(_=>({one:z,access:_})));if(I.length===0)return;let R=await s.destroy(u,I.map(({access:z})=>z.id));I.forEach(({one:z,access:_},Q)=>{let B=R[Q];B?.success===!0?z.undone.push(_s(_)):B?.errors.some(J=>J.code==="ENTITY_IS_DELETED")||v(z,_s(_),B?.errors[0])})},f=async(u,a)=>{let I=E.flatMap(z=>{let _=a(z);return _?[{one:z,..._}]:[]});if(I.length===0)return;let R=await s.update(u,I.map(({row:z})=>z));I.forEach(({one:z,change:_},Q)=>{let B=R[Q];B?.success===!0?z.undone.push(_):v(z,_,B?.errors[0])})},m=[()=>N("GroupMember",u=>u.undo.leave),()=>N("PermissionSetAssignment",u=>u.undo.unassign),()=>f("UserLogin",u=>u.undo.isFrozen?{row:{Id:u.undo.isFrozen.loginId,IsFrozen:u.undo.isFrozen.to},change:u.undo.isFrozen.change}:void 0),async()=>{for(let u of[!1,!0])await f("User",a=>a.undo.isActive?.to===u?{row:{Id:a.user.applied.userId,IsActive:u},change:a.undo.isActive.change}:void 0)},()=>f("User",u=>u.undo.profileId?{row:{Id:u.user.applied.userId,ProfileId:u.undo.profileId.to},change:u.undo.profileId.change}:void 0)],y=!1;for(let u of m)if(await u(),e.signal?.aborted){y=!0;break}let P=E.map(u=>{let a=[...u.undo.kept,...u.refused.map(({change:I,why:R})=>({change:I,why:R}))];return{username:u.user.applied.username,userId:u.user.applied.userId,undone:u.undone,...a.length>0?{kept:a}:{}}}),$=P.reduce((u,a)=>u+(a.kept?.length??0),0),b=y?"cancelled":$>0?"partial":"success",p={...c,removals:[...c.removals??[],{at:t().toISOString(),status:b,undone:P.reduce((u,a)=>u+a.undone.length,0),kept:$,codes:[...new Set(E.flatMap(u=>u.refused.map(a=>a.code)))].slice(0,50)}]};return await n.write(p),{org:e.organization,run:r,status:b,users:P,apiRequests:i()}}import{randomBytes as In}from"node:crypto";import{open as Ts,readFile as Rn,readdir as An,rename as vn,rm as bn}from"node:fs/promises";import{homedir as En}from"node:os";import{join as Ae,resolve as On}from"node:path";var $n="users";function Cs(e=process.env){let s=e.SANDFORGE_JOURNAL_DIR,n=s!==void 0&&s.trim()!==""?On(s):Ae(En(),".sandforge");return Ae(n,$n)}var Ke=es.datetime({offset:!0}),Be=be().int().nonnegative(),Je=be().int().positive().max(999999),Pn=ee({isActive:le(),isFrozen:le(),profileId:re().regex(/^00e[A-Za-z0-9]{12}(?:[A-Za-z0-9]{3})?$/)}),kn=ee({id:re().regex(/^(?:0Pa|011)[A-Za-z0-9]{12}(?:[A-Za-z0-9]{3})?$/),what:ie(["permissionSet","permissionSetGroup","group"]),name:re().regex(/^[A-Za-z][A-Za-z0-9_]*$/).max(80),type:ie(["Regular","Queue"]).optional()}),Nn=ee({applied:ts,after:Pn,accesses:te(kn).max(pe+me+ge),inFile:le()}),_n=ee({at:Ke,status:ie(["success","partial","failure","cancelled"]),undone:Be,kept:Be,codes:te(re().regex(/^[A-Z][A-Z_]{1,63}$/)).max(50)}),He=ee({version:Ye(1),organizationId:ss,run:Je,replaces:Je.optional(),status:ie(["running","success","partial","failure","cancelled"]),startedAt:Ke,endedAt:Ke.optional(),emailsToPeople:Be,users:te(Nn).max(2*fe),removals:te(_n).max(1e3).optional()});function xn(e){return`refused with ${e}; the org\u2019s words are not kept, as they may name the person`}function zs(e){return{...e,users:e.users.map(s=>s.applied.refused===void 0?s:{...s,applied:{...s.applied,refused:s.applied.refused.map(n=>({...n,message:xn(n.code)}))}})}}var zn=/^run-([1-9]\d{0,5})\.json$/,ve=class{root;guard;constructor(s){this.guard=s.guard??new Is,this.root=this.guard.assertOutsideRepo(s.root)}folderOf(s){return this.guard.assertOutsideRepo(Ae(this.root,Pe(s)))}fileOf(s,n){return Ae(this.folderOf(s),`run-${Je.parse(n)}.json`)}async begin(s,n){let r=this.folderOf(s);await ws(r);for(let t=await this.highest(s)+1;;t+=1){let o=He.parse(zs({...n,version:1,organizationId:Pe(s),run:t})),i;try{i=await Ts(this.fileOf(s,t),"wx",$e)}catch(g){if(g.code==="EEXIST")continue;throw g}try{await i.writeFile(`${JSON.stringify(o,null,2)}
8
- `,"utf8"),await i.sync()}finally{await i.close()}return o}}async write(s){let n=He.parse(zs(s));await Tn(this.fileOf(n.organizationId,n.run),`${JSON.stringify(n,null,2)}
9
- `)}async read(s,n){let r;try{r=await Rn(this.fileOf(s,n),"utf8")}catch(t){if(t.code==="ENOENT")return;throw t}try{let t=He.safeParse(JSON.parse(r));return t.success&&t.data.run===n?t.data:void 0}catch{return}}async list(s){let n=[];for(let r of(await this.numbers(s)).sort((t,o)=>o-t)){let t=await this.read(s,r);t&&n.push(t)}return n}async numbers(s){let n;try{n=await An(this.folderOf(s))}catch(r){if(r.code==="ENOENT")return[];throw r}return n.flatMap(r=>{let t=zn.exec(r);return t?[Number(t[1])]:[]})}async highest(s){return Math.max(0,...await this.numbers(s))}};async function Tn(e,s){let n=`${e}.${process.pid}-${In(4).toString("hex")}.tmp`,r=await Ts(n,"wx",$e);try{try{await r.writeFile(s,"utf8"),await r.sync()}finally{await r.close()}await vn(n,e)}catch(t){throw await bn(n,{force:!0}),t}}var Ve="sandforge-users",Ls="AUTOMATION_NOT_ACCEPTED",Fn="USERS_RUN_NOT_FOUND",Mn="USERS_RUN_REPLACED",qn=`sandforge users \u2014 set up the users of a sandbox handed back to its testers, a scratch org
7
+ import{a as we,d as ye}from"./chunk-ZV7ZFQQC.mjs";import{b as Re,d as be,e as $e,f as Ie,g as Ae,i as Ee,j as H,l as ke,n as Oe,o as Ne}from"./chunk-A3MYSOOC.mjs";import{b as _e}from"./chunk-VCUXCK36.mjs";import{a as x,b as q,c as Se,e as G,g as m,h as Ue,j as ve}from"./chunk-WY5V5PR3.mjs";import"./chunk-UV74P4H2.mjs";import{b as le}from"./chunk-7SQSWVAU.mjs";import{b as pe,e as fe}from"./chunk-RKTFFCNS.mjs";import{c as P,d as he}from"./chunk-6FARZYMJ.mjs";import{a as W}from"./chunk-QROPNEGY.mjs";import"./chunk-KGU4SVIT.mjs";import{a as ee,b as L}from"./chunk-AL4C3GFT.mjs";import{b as ue,c as ce}from"./chunk-OUZQPYT3.mjs";import"./chunk-MSIEU5MR.mjs";import"./chunk-LC3NDW4N.mjs";import{Ec as ge}from"./chunk-KB4ZHM4Q.mjs";import"./chunk-23SEDORH.mjs";import"./chunk-W6PN6TJG.mjs";import"./chunk-3Q353S2R.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-RHNTHGNU.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-Q7TLC3I2.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-D4GF4FAB.mjs";import"./chunk-CVHNXJH3.mjs";import"./chunk-MS4FJDFD.mjs";import{a as ie,c as de,f as E,h as me}from"./chunk-LCDPCUXS.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-M6K34KGF.mjs";import"./chunk-TNT27RBG.mjs";import"./chunk-TZE3Y7IQ.mjs";import{b as z}from"./chunk-CA5NAXSU.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-S42RBRH2.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-TUACWKIH.mjs";import{ib as se,jb as re,kb as ne,lb as te,nb as oe,ob as ae}from"./chunk-PMWAFDUB.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";import{readFileSync as Ke}from"node:fs";function Be(e,s,r){let{before:n}=e.applied,{after:a}=e,o=s.standing,u=m(e.applied.userId)===m(r.connected.userId),l=`${r.connected.username} is the user connected: SandForge would lock itself out; connect as another to put it back`,c={leave:e.accesses.filter(d=>d.what==="group"&&s.present.has(m(d.id))),unassign:e.accesses.filter(d=>d.what!=="group"&&s.present.has(m(d.id))),kept:[]};if(a.isFrozen!==n.isFrozen&&o.isFrozen===a.isFrozen){let d={what:"frozen",from:a.isFrozen,to:n.isFrozen};u&&n.isFrozen?c.kept.push({change:d,why:l}):s.loginId===void 0?c.kept.push({change:d,why:"the org keeps no login of this user (UserLogin) to write"}):c.isFrozen={to:n.isFrozen,loginId:s.loginId,change:d}}if(a.isActive!==n.isActive&&o.isActive===a.isActive){let d={what:"active",from:a.isActive,to:n.isActive};u&&!n.isActive?c.kept.push({change:d,why:l}):c.isActive={to:n.isActive,change:d}}if(m(a.profileId)!==m(n.profileId)&&m(o.profileId)!==m(n.profileId)){let d=$=>s.profileNames.get(m($))??$,f={what:"profile",from:d(o.profileId),to:d(n.profileId)},h=m(o.profileId)!==m(a.profileId);u?c.kept.push({change:f,why:l}):h&&!r.includeChanged?c.kept.push({change:f,why:`its profile was changed since the run, to ${d(o.profileId)}: --include-changed puts ${d(n.profileId)} back`}):c.profileId={to:n.profileId,change:f}}return c}function Ce(e){return e.what==="group"?{what:"group",name:e.name,type:e.type??"Regular",to:"removed"}:{what:e.what,name:e.name,to:"removed"}}function V(e,s,r,n){return{org:e.organization,run:e.run,status:"failure",users:[],apiRequests:n,refusals:[{code:s,message:r}]}}async function Pe(e){let{org:s,store:r,run:n}=e,a=e.now??(()=>new Date),o=s.requests(),u=()=>s.requests()-o,l=await s.identity(),c=await r.read(l.organizationId,n);if(!c)return V(e,"USERS_RUN_NOT_FOUND",`run ${n}: this machine keeps no run of that number for this org, whose Organization Id is ${l.organizationId}: a sandbox refreshed since answers another, and its runs went with the copy they set up`,u());let d=(await r.list(l.organizationId)).find(t=>t.replaces===n);if(d)return V(e,"USERS_RUN_REPLACED",`run ${n} was replaced by run ${d.run}, which holds what it set up: remove run ${d.run}`,u());let f=await Ue(s);if(f!==!0){let t=ve(l.username,f);return V(e,t.code,t.message,u())}let h=c.users,$=h.map(t=>t.applied.userId),R=new Map;for(let t of x($,200))for(let i of await s.query(`SELECT Id, IsActive, ProfileId FROM User WHERE Id IN ${q(t)}`))R.set(m(String(i.Id)),{isActive:i.IsActive===!0,isFrozen:!1,profileId:String(i.ProfileId)});let w=new Map,I=h.filter(t=>t.after.isFrozen!==t.applied.before.isFrozen);for(let t of x(I.map(i=>i.applied.userId),200))for(let i of await s.query(`SELECT Id, UserId, IsFrozen FROM UserLogin WHERE UserId IN ${q(t)}`)){let p=m(String(i.UserId));w.set(p,String(i.Id));let U=R.get(p);U&&(U.isFrozen=i.IsFrozen===!0)}let T=new Set,O=t=>h.flatMap(i=>i.accesses.filter(p=>t==="memberships"==(p.what==="group")).map(p=>p.id));for(let[t,i]of[["PermissionSetAssignment",O("assignments")],["GroupMember",O("memberships")]])for(let p of x(i,200))for(let U of await s.query(`SELECT Id FROM ${t} WHERE Id IN ${q(p)}`))T.add(m(String(U.Id)));let N=h.flatMap(t=>m(t.after.profileId)!==m(t.applied.before.profileId)?[t.applied.before.profileId,t.after.profileId,R.get(m(t.applied.userId))?.profileId??""]:[]).filter(t=>t!==""),_=new Map;for(let t of x([...new Set(N)],200))for(let i of await s.query(`SELECT Id, Name FROM Profile WHERE Id IN ${q(t)}`))_.set(m(String(i.Id)),String(i.Name));let g=h.map(t=>t.applied.username),A=h.flatMap(t=>{let i=R.get(m(t.applied.userId));if(!i)return[];let p=w.get(m(t.applied.userId));return[{user:t,undo:Be(t,{standing:i,...p?{loginId:p}:{},profileNames:_,present:T},{includeChanged:e.includeChanged===!0,connected:l}),undone:[],refused:[]}]}),J=(t,i,p)=>{let U=p?.code??"NO_ANSWER";t.refused.push({change:i,code:U,why:`the org refused it: ${U} ${Se(p?.message??"the org answered nothing for it",g)}`})},K=async(t,i)=>{let p=A.flatMap(y=>i(y).map(b=>({one:y,access:b})));if(p.length===0)return;let U=await s.destroy(t,p.map(({access:y})=>y.id));p.forEach(({one:y,access:b},M)=>{let C=U[M];C?.success===!0?y.undone.push(Ce(b)):C?.errors.some(Xe=>Xe.code==="ENTITY_IS_DELETED")||J(y,Ce(b),C?.errors[0])})},j=async(t,i)=>{let p=A.flatMap(y=>{let b=i(y);return b?[{one:y,...b}]:[]});if(p.length===0)return;let U=await s.update(t,p.map(({row:y})=>y));p.forEach(({one:y,change:b},M)=>{let C=U[M];C?.success===!0?y.undone.push(b):J(y,b,C?.errors[0])})},He=[()=>K("GroupMember",t=>t.undo.leave),()=>K("PermissionSetAssignment",t=>t.undo.unassign),()=>j("UserLogin",t=>t.undo.isFrozen?{row:{Id:t.undo.isFrozen.loginId,IsFrozen:t.undo.isFrozen.to},change:t.undo.isFrozen.change}:void 0),async()=>{for(let t of[!1,!0])await j("User",i=>i.undo.isActive?.to===t?{row:{Id:i.user.applied.userId,IsActive:t},change:i.undo.isActive.change}:void 0)},()=>j("User",t=>t.undo.profileId?{row:{Id:t.user.applied.userId,ProfileId:t.undo.profileId.to},change:t.undo.profileId.change}:void 0)],Q=!1;for(let t of He)if(await t(),e.signal?.aborted){Q=!0;break}let D=A.map(t=>{let i=[...t.undo.kept,...t.refused.map(({change:p,why:U})=>({change:p,why:U}))];return{username:t.user.applied.username,userId:t.user.applied.userId,undone:t.undone,...i.length>0?{kept:i}:{}}}),Y=D.reduce((t,i)=>t+(i.kept?.length??0),0),Z=Q?"cancelled":Y>0?"partial":"success",Ve={...c,removals:[...c.removals??[],{at:a().toISOString(),status:Z,undone:D.reduce((t,i)=>t+i.undone.length,0),kept:Y,codes:[...new Set(A.flatMap(t=>t.refused.map(i=>i.code)))].slice(0,50)}]};return await r.write(Ve),{org:e.organization,run:n,status:Z,users:D,apiRequests:u()}}var X="sandforge-users",Qe="USERS_RUN_NOT_FOUND",Ye="USERS_RUN_REPLACED",Ze=`sandforge users \u2014 set up the users of a sandbox handed back to its testers, a scratch org
10
8
  or a Developer Edition org: an address the copy put under .invalid asked back, a user activated,
11
9
  frozen or unfrozen, a profile, permission sets, permission set groups, groups and queues given;
12
10
  and take a run back.
@@ -84,7 +82,7 @@ The config, JSON:
84
82
  "users": [{"username": "jane.qa@acme.com", "permissionSets": ["QA_Tools"], "groups": ["QA_Team"]},
85
83
  {"username": "paul.qa@acme.com", "active": true, "profile": "QA Tester"}]}
86
84
 
87
- users 1 to ${fe}, each username once, whatever its case
85
+ users 1 to ${se}, each username once, whatever its case
88
86
  username production's (jane.qa@acme.com) or the sandbox's whole
89
87
  (jane.qa@acme.com.uat): read as given, then as given
90
88
  followed by .<sandbox>, which must name exactly one user
@@ -93,9 +91,9 @@ The config, JSON:
93
91
  active, frozen true or false; absent, left as they are
94
92
  profile Profile.Name, exact, in the org's language for a
95
93
  standard profile
96
- permissionSets API names, ${pe} at most
97
- permissionSetGroups API names, ${me} at most
98
- groups DeveloperName of a public group or a queue, ${ge} at most
94
+ permissionSets API names, ${re} at most
95
+ permissionSetGroups API names, ${ne} at most
96
+ groups DeveloperName of a public group or a queue, ${te} at most
99
97
  defaults the same keys but username; a key a user gives
100
98
  replaces the default's whole, a list included
101
99
 
@@ -105,7 +103,7 @@ password \u2014 once an address is restored, its owner asks for one with
105
103
  "Forgot your password?" on the sandbox's login page; or put an address back
106
104
  under .invalid. An address asked back is not restored at once: Salesforce
107
105
  mails a link to it and keeps the old one until the link is clicked
108
- (${we} h). The run says it awaits its owner; a later plan reads it restored.
106
+ (${G} h). The run says it awaits its owner; a later plan reads it restored.
109
107
 
110
108
  Refused before its first write, exit 1, nothing written: a production org, or
111
109
  one that will not say what it is; USERS_NO_USER, a username no user has;
@@ -137,21 +135,21 @@ Exit codes:
137
135
  code and words, the others set up; or a removal kept something, said why
138
136
  130 Ctrl-C (143 SIGTERM, 129 SIGHUP): the run ends after the step under
139
137
  way, its file saying what it holds, for remove to take back
140
- `,Dn=["plan","apply","remove"],Fs={words:1,switches:["--dry-run","--yes","--json","--accept-user-emails","--accept-emails","--accept-automation","--include-changed"],values:["--org","--config","--run","--replaces"]},Ms=["--org","--config","--replaces","--accept-user-emails","--accept-emails","--accept-automation","--json"],qs={plan:Ms,apply:[...Ms,"--dry-run","--yes"],remove:["--org","--run","--include-changed","--accept-automation","--yes","--json"]};function D(e){process.stderr.write(`${e} Nothing was run. Run with --help.
141
- `),process.exit(2)}function Ds(e,s){return/^[1-9]\d{0,5}$/.test(s)||D(`${e} takes a run's number, as apply named it: "${s}" is not one.`),Number(s)}function Wn(e){let[s]=e;s===void 0&&D("Name the verb: plan, apply or remove."),Dn.includes(s)||D(s.startsWith("-")?`"${s}" comes before the verb: name plan, apply or remove first.`:`"${s}" is not a verb of ${ce(Ve)}: plan, apply or remove.`);let n=s,r=ds(e,Fs);r!==void 0&&D(r.replace(/ Nothing was run\.$/,""));let t=new Map,o=new Set;for(let w=1;w<e.length;w++){let h=e[w];Fs.values.includes(h)?(t.has(h)&&D(`${h} is given twice.`),t.set(h,e[w+1]),w++):o.add(h)}for(let w of[...t.keys(),...o])qs[n].includes(w)||D(`${w} is not read by ${n}: it reads ${qs[n].join(", ")}.`);let i=t.get("--org");i===void 0&&D(`${n} needs --org <alias>.`),us.test(i)||D(`--org takes an sf alias or a username: "${i}" is neither (letters, digits, _ . @ + and -, not first . @ + or -).`);let g=t.get("--config");n!=="remove"&&g===void 0&&D(`${n} needs --config <file.json>.`);let c=t.get("--run");n==="remove"&&c===void 0&&D("remove needs --run <n>.");let d=t.get("--replaces");return n==="apply"&&o.has("--dry-run")&&o.has("--yes")&&D("--dry-run writes nothing and --yes writes: give one of them."),{verb:n,org:i,...g!==void 0?{config:g}:{},...c!==void 0?{run:Ds("--run",c)}:{},...d!==void 0?{replaces:Ds("--replaces",d)}:{},dryRun:o.has("--dry-run"),yes:o.has("--yes"),json:o.has("--json"),acceptUserEmails:o.has("--accept-user-emails"),acceptEmails:o.has("--accept-emails"),acceptAutomation:o.has("--accept-automation"),includeChanged:o.has("--include-changed")}}function jn(e){let s;try{s=Ln(e,"utf8")}catch(t){D(`--config ${e} could not be read (${X(t)}).`)}let n;try{n=JSON.parse(s)}catch(t){D(`--config ${e} is not JSON (${X(t)}).`)}let r=ns.safeParse(n);if(!r.success){let t=r.error.issues.map(o=>{let i=o.path.map((g,c)=>typeof g=="number"?`[${g}]`:`${c===0?"":"."}${String(g)}`).join("");return i===""?o.message:`${i}: ${o.message}`});D(`--config ${e}: ${t.join("; ")}.`)}return rs(r.data)}var Gn={scratch:"scratch org",developer:"Developer Edition org",sandbox:"sandbox"};function de(e){let s=n=>n==="added"?"added":"taken back";switch(e.what){case"email":return"address asked back";case"active":return e.to?"activated":"deactivated";case"frozen":return e.to?"frozen":"unfrozen";case"profile":return`profile ${e.to} in place of ${e.from}`;case"permissionSet":return`permission set ${e.name} ${s(e.to)}`;case"permissionSetGroup":return`permission set group ${e.name} ${s(e.to)}`;case"group":return`${e.type==="Queue"?"queue":"group"} ${e.name} ${s(e.to)}`}}var Hn=`address awaiting its owner's confirmation \u2014 Salesforce sent the link to it; until it is clicked (${we} h), the address stays .invalid`;function Qe(e){return`${e.alias??e.organizationId} (${Gn[e.kind]}, ${e.organizationId})`}function Kn(e){return e.map(s=>gs(s,"a run now"))}function Bn(e,s){let n=s.edition?`IsSandbox false, edition ${s.edition}`:"IsSandbox false, and no edition";return`${e} is a production org (its Organization record says ${n}): ${ce(Ve)} sets up the users of a sandbox, a scratch org or a Developer Edition org, and reads nothing of a production org. Nothing was read or written.`}async function Gs(e){let s;try{s=await cs(e)}catch(g){process.stderr.write(`${X(g)}
142
- `),process.exit(1)}let n=ls(s),r=0,t;try{t=await os({query:(g=>(r+=1,n.query(g)))})}catch(g){process.stderr.write(`${fs(e,g,{tool:ce(Ve),action:"write",readOnly:"plan"})}
143
- `),process.exit(1)}as(t)&&(process.stderr.write(`${Bn(e,t)}
144
- `),process.exit(1));let o=As(n),i=await o.identity();return U(i.organizationId)!==U(t.id)&&(process.stderr.write(`The session sf gave for ${e} is of ${i.organizationId}, and its Organization record says ${t.id}: nothing was read or written. Sign in to ${e} again with sf.
145
- `),process.exit(1)),{conn:n,org:o,organization:{organizationId:t.id,kind:s.scratch===!0?"scratch":t.sandbox?"sandbox":"developer",alias:e,username:i.username},typingRequests:r}}function Hs(){try{return new ve({root:Cs()})}catch(e){process.stderr.write(`${X(e)} Nothing was read or written.
146
- `),process.exit(1)}}var Ks={before:"before save",after:"after save",beforeAndAfter:"before and after save"},Bs={flows:"the flows",triggers:"the Apex triggers",processes:"the Process Builder processes",workflowRules:"the workflow rules"};function Js(e,s){return e==="flow"?`flow "${s}"`:e==="process"?`process "${s}"`:e==="workflowRule"?`workflow rule "${s}"`:`Apex trigger ${s}`}async function Xs(e,s,n){if(n.length===0)return{kind:"none"};try{return{kind:"read",automation:await new Ss(Us(async()=>e)).read(s,n)}}catch(r){return{kind:"unread",reason:X(r)}}}function Vs(e){return e.kind==="read"?is(e.automation,"update"):[]}function Qs(e,s,n){if(e.kind==="none")return["automation: none read: this run writes no user and no login"];if(e.kind==="unread")return[`automation: what ${s} runs as ${n} could not be read (${e.reason})`];let r=Vs(e),t=ke(e.automation);return r.length===0&&t.length===0?[`automation: ${s} runs nothing as ${n}`]:[...r.length>0?[`automation: ${s} runs as ${n}:`]:[],...r.map(o=>` ${o.objectApiName}: ${Js(o.kind,o.name)} (${Ks[o.when]})`),...t.map(({part:o,reason:i})=>` ${Bs[o]??o} of ${s} could not be read: ${i}`)]}function Zs(e,s,n,r){if(r||e.kind==="none")return;let t=`Nothing was written. Add --accept-automation to write all the same (accept: { automation: true } on the users resource of sandforge.yaml), or turn that automation off in ${s} first.`;if(e.kind==="unread")return{code:Ls,message:`What ${s} runs as ${n} could not be read (${e.reason}), so what fires is not known. ${t}`};let o=Vs(e),i=ke(e.automation);if(o.length===0&&i.length===0)return;let g=[];if(o.length>0){let c=o.map(d=>`${d.objectApiName}: ${Js(d.kind,d.name)} (${Ks[d.when]})`);g.push(`${s} runs automation as ${n}: ${c.join("; ")}.`)}for(let{part:c,reason:d}of i)g.push(`${Bs[c]??c} of ${s} could not be read (${d}), so what fires as ${n} is not known.`);return g.push(t),{code:Ls,message:g.join(" ")}}function Xe(e){return e.kind==="read"?e.automation.requests:0}function Jn(e){let s=e.users.some(r=>r.writes.profileId!==void 0||r.writes.isActive!==void 0||r.writes.email!==void 0),n=e.users.some(r=>r.writes.isFrozen!==void 0);return[...s?["User"]:[],...n?["UserLogin"]:[]]}function Xn(e){let s=e.users.some(r=>r.after.isActive!==r.applied.before.isActive||U(r.after.profileId)!==U(r.applied.before.profileId)),n=e.users.some(r=>r.after.isFrozen!==r.applied.before.isFrozen);return[...s?["User"]:[],...n?["UserLogin"]:[]]}function Ws(e){let{reading:s}=e;return"unread"in s?"unread":s.level==="all"?"open":"closed"}function Vn(e,s){let{reading:n}=e;return"unread"in n?`deliverability: not read (${n.unread})`:n.level==="all"?`deliverability: All email \u2014 what runs in ${s} emails the addresses its records hold`:"deliverability: closed \u2014 System email only or No access: what runs there emails nobody. Which of the two, no API says."}function Ys(e){return s=>(e?process.stderr:process.stdout).write(`${s}
147
- `)}function Y(e){process.stdout.write(`${JSON.stringify(e,null,2)}
148
- `)}function Qn(e,s,n){return{org:e,users:[],emailsToPeople:0,apiRequests:n,refusals:[s]}}async function Zn(e,s,n){let r=await e.read(s,n);if(!r)return{refusal:{code:Fn,message:`--replaces ${n}: this machine keeps no run of that number for this org, whose Organization Id is ${s}: a sandbox refreshed since answers another, and its runs went with the copy they set up. Plan without --replaces to set the users up anew`}};let t=(await e.list(s)).find(o=>o.replaces===n);return t?{refusal:{code:Mn,message:`run ${n} was replaced by run ${t.run}, which holds what it set up: --replaces ${t.run}`}}:{record:r}}function Yn(e,s,n){let r=n.org,t=[`plan of the users of ${Qe(e.org)}`];for(let o of e.users){let i=o.given!==void 0?`${o.username} (${o.given} in the config)`:o.username,g;o.userId===void 0?g="no single user has this username (below)":o.changes.length>0?g=o.changes.map(de).join(", "):o.address==="awaiting"?g="its address asked back by an earlier run, awaiting its owner's click":g="as the config says already: nothing to do",t.push(` ${i}: ${g}`)}return e.licenses!==void 0&&t.push(`licenses: ${e.licenses.map(o=>`${o.name} ${o.used} of ${o.total} used, ${o.toUse} more`).join("; ")}`),e.emailsToPeople>0&&t.push(`emails to people: ${e.emailsToPeople}, the confirmation of each address asked back, a system email, which leaves under System email only too`+(n.acceptUserEmails?"; accepted (--accept-user-emails)":"")),s.deliverability!==void 0&&t.push(Vn(s.deliverability,r)),t.push(...Qs(s.automation,r,"users are written")),t.push(`API requests: ${s.sent} sent by this plan; an apply sends about ${e.apiRequests}`),t.push(...Kn(e.refusals??[])),t}function er(e,s){let n=[`run ${e.run} of the users of ${Qe(e.org)}: ${e.status}`];for(let r of e.users){let t=r.done.filter(o=>o.what!=="email");t.length>0&&n.push(` ${r.username}: ${t.map(de).join(", ")}`),r.address==="awaiting"&&r.done.some(o=>o.what==="email")&&n.push(` ${r.username}: ${Hn}`),r.address==="restored"&&r.done.some(o=>o.what==="email")&&n.push(` ${r.username}: address restored`);for(let o of r.refused??[])n.push(` ${r.username}: refused ${de(o.change)}: ${o.code} ${o.message}`);r.done.length===0&&(r.refused??[]).length===0&&n.push(` ${r.username}: nothing to do`)}return n.push(`taken back by: ${Ze("users")} remove --org ${s} --run ${e.run} --yes`),n.push(`API requests: ${e.apiRequests}`),n}function sr(e,s){let n=[`removal of run ${e.run} of the users of ${s}: ${e.status}`];for(let r of e.users){n.push(` ${r.username}: ${r.undone.length>0?r.undone.map(de).join(", "):"nothing put back"}`);for(let t of r.kept??[])n.push(` ${r.username}: kept ${de(t.change)}: ${t.why}`)}for(let r of e.refusals??[])n.push(se(r));return n.push(`API requests: ${e.apiRequests}`),n}function en(e,s){return e==="cancelled"?ps(s??"SIGINT"):e==="partial"?3:e==="failure"?1:0}function sn(){let e=new AbortController,s,n=ms(r=>{s=r,process.stderr.write(`
138
+ `,es=["plan","apply","remove"],Te={words:1,switches:["--dry-run","--yes","--json","--accept-user-emails","--accept-emails","--accept-automation","--include-changed"],values:["--org","--config","--run","--replaces"]},ze=["--org","--config","--replaces","--accept-user-emails","--accept-emails","--accept-automation","--json"],xe={plan:ze,apply:[...ze,"--dry-run","--yes"],remove:["--org","--run","--include-changed","--accept-automation","--yes","--json"]};function S(e){process.stderr.write(`${e} Nothing was run. Run with --help.
139
+ `),process.exit(2)}function qe(e,s){return/^[1-9]\d{0,5}$/.test(s)||S(`${e} takes a run's number, as apply named it: "${s}" is not one.`),Number(s)}function ss(e){let[s]=e;s===void 0&&S("Name the verb: plan, apply or remove."),es.includes(s)||S(s.startsWith("-")?`"${s}" comes before the verb: name plan, apply or remove first.`:`"${s}" is not a verb of ${L(X)}: plan, apply or remove.`);let r=s,n=ie(e,Te);n!==void 0&&S(n.replace(/ Nothing was run\.$/,""));let a=new Map,o=new Set;for(let f=1;f<e.length;f++){let h=e[f];Te.values.includes(h)?(a.has(h)&&S(`${h} is given twice.`),a.set(h,e[f+1]),f++):o.add(h)}for(let f of[...a.keys(),...o])xe[r].includes(f)||S(`${f} is not read by ${r}: it reads ${xe[r].join(", ")}.`);let u=a.get("--org");u===void 0&&S(`${r} needs --org <alias>.`),de.test(u)||S(`--org takes an sf alias or a username: "${u}" is neither (letters, digits, _ . @ + and -, not first . @ + or -).`);let l=a.get("--config");r!=="remove"&&l===void 0&&S(`${r} needs --config <file.json>.`);let c=a.get("--run");r==="remove"&&c===void 0&&S("remove needs --run <n>.");let d=a.get("--replaces");return r==="apply"&&o.has("--dry-run")&&o.has("--yes")&&S("--dry-run writes nothing and --yes writes: give one of them."),{verb:r,org:u,...l!==void 0?{config:l}:{},...c!==void 0?{run:qe("--run",c)}:{},...d!==void 0?{replaces:qe("--replaces",d)}:{},dryRun:o.has("--dry-run"),yes:o.has("--yes"),json:o.has("--json"),acceptUserEmails:o.has("--accept-user-emails"),acceptEmails:o.has("--accept-emails"),acceptAutomation:o.has("--accept-automation"),includeChanged:o.has("--include-changed")}}function rs(e){let s;try{s=Ke(e,"utf8")}catch(a){S(`--config ${e} could not be read (${z(a)}).`)}let r;try{r=JSON.parse(s)}catch(a){S(`--config ${e} is not JSON (${z(a)}).`)}let n=oe.safeParse(r);if(!n.success){let a=n.error.issues.map(o=>{let u=o.path.map((l,c)=>typeof l=="number"?`[${l}]`:`${c===0?"":"."}${String(l)}`).join("");return u===""?o.message:`${u}: ${o.message}`});S(`--config ${e}: ${a.join("; ")}.`)}return ae(n.data)}var ns={scratch:"scratch org",developer:"Developer Edition org",sandbox:"sandbox"};function F(e){let s=r=>r==="added"?"added":"taken back";switch(e.what){case"email":return"address asked back";case"active":return e.to?"activated":"deactivated";case"frozen":return e.to?"frozen":"unfrozen";case"profile":return`profile ${e.to} in place of ${e.from}`;case"permissionSet":return`permission set ${e.name} ${s(e.to)}`;case"permissionSetGroup":return`permission set group ${e.name} ${s(e.to)}`;case"group":return`${e.type==="Queue"?"queue":"group"} ${e.name} ${s(e.to)}`}}var ts=`address awaiting its owner's confirmation \u2014 Salesforce sent the link to it; until it is clicked (${G} h), the address stays .invalid`;function B(e){return`${e.alias??e.organizationId} (${ns[e.kind]}, ${e.organizationId})`}function os(e){return e.map(s=>he(s,"a run now"))}function as(e,s){let r=s.edition?`IsSandbox false, edition ${s.edition}`:"IsSandbox false, and no edition";return`${e} is a production org (its Organization record says ${r}): ${L(X)} sets up the users of a sandbox, a scratch org or a Developer Edition org, and reads nothing of a production org. Nothing was read or written.`}async function Le(e){let s;try{s=await ue(e)}catch(a){process.stderr.write(`${z(a)}
140
+ `),process.exit(1)}let r=ce(s),n=await Re(r,{alias:e,scratch:s.scratch===!0});return n.kind==="untyped"&&(process.stderr.write(`${le(e,n.err,{tool:L(X),action:"write",readOnly:"plan"})}
141
+ `),process.exit(1)),n.kind==="production"&&(process.stderr.write(`${as(e,n.typed)}
142
+ `),process.exit(1)),n.kind==="otherSession"&&(process.stderr.write(`The session sf gave for ${e} is of ${n.sessionOrganizationId}, and its Organization record says ${n.typed.id}: nothing was read or written. Sign in to ${e} again with sf.
143
+ `),process.exit(1)),{conn:r,org:n.org,organization:n.organization,typingRequests:n.typingRequests}}function je(){try{return new ye({root:we()})}catch(e){process.stderr.write(`${z(e)} Nothing was read or written.
144
+ `),process.exit(1)}}function De(e,s,r){if(e.kind==="none")return["automation: none read: this run writes no user and no login"];if(e.kind==="unread")return[`automation: what ${s} runs as ${r} could not be read (${e.reason})`];let n=Ae(e),a=ge(e.automation);return n.length===0&&a.length===0?[`automation: ${s} runs nothing as ${r}`]:[...n.length>0?[`automation: ${s} runs as ${r}:`]:[],...n.map(o=>` ${be(o)}`),...a.map(({part:o,reason:u})=>` ${$e(o)} of ${s} could not be read: ${u}`)]}function is(e,s){let{reading:r}=e;return"unread"in r?`deliverability: not read (${r.unread})`:r.level==="all"?`deliverability: All email \u2014 what runs in ${s} emails the addresses its records hold`:"deliverability: closed \u2014 System email only or No access: what runs there emails nobody. Which of the two, no API says."}function Me(e){return s=>(e?process.stderr:process.stdout).write(`${s}
145
+ `)}function k(e){process.stdout.write(`${JSON.stringify(e,null,2)}
146
+ `)}function ds(e,s,r){return{org:e,users:[],emailsToPeople:0,apiRequests:r,refusals:[s]}}async function us(e,s,r){let n=await e.read(s,r);if(!n)return{refusal:{code:Qe,message:`--replaces ${r}: this machine keeps no run of that number for this org, whose Organization Id is ${s}: a sandbox refreshed since answers another, and its runs went with the copy they set up. Plan without --replaces to set the users up anew`}};let a=(await e.list(s)).find(o=>o.replaces===r);return a?{refusal:{code:Ye,message:`run ${r} was replaced by run ${a.run}, which holds what it set up: --replaces ${a.run}`}}:{record:n}}function cs(e,s,r){let n=r.org,a=[`plan of the users of ${B(e.org)}`];for(let o of e.users){let u=o.given!==void 0?`${o.username} (${o.given} in the config)`:o.username,l;o.userId===void 0?l="no single user has this username (below)":o.changes.length>0?l=o.changes.map(F).join(", "):o.address==="awaiting"?l="its address asked back by an earlier run, awaiting its owner's click":l="as the config says already: nothing to do",a.push(` ${u}: ${l}`)}return e.licenses!==void 0&&a.push(`licenses: ${e.licenses.map(o=>`${o.name} ${o.used} of ${o.total} used, ${o.toUse} more`).join("; ")}`),e.emailsToPeople>0&&a.push(`emails to people: ${e.emailsToPeople}, the confirmation of each address asked back, a system email, which leaves under System email only too`+(r.acceptUserEmails?"; accepted (--accept-user-emails)":"")),s.deliverability!==void 0&&a.push(is(s.deliverability,n)),a.push(...De(s.automation,n,"users are written")),a.push(`API requests: ${s.sent} sent by this plan; an apply sends about ${e.apiRequests}`),a.push(...os(e.refusals??[])),a}function ls(e,s){let r=[`run ${e.run} of the users of ${B(e.org)}: ${e.status}`];for(let n of e.users){let a=n.done.filter(o=>o.what!=="email");a.length>0&&r.push(` ${n.username}: ${a.map(F).join(", ")}`),n.address==="awaiting"&&n.done.some(o=>o.what==="email")&&r.push(` ${n.username}: ${ts}`),n.address==="restored"&&n.done.some(o=>o.what==="email")&&r.push(` ${n.username}: address restored`);for(let o of n.refused??[])r.push(` ${n.username}: refused ${F(o.change)}: ${o.code} ${o.message}`);n.done.length===0&&(n.refused??[]).length===0&&r.push(` ${n.username}: nothing to do`)}return r.push(`taken back by: ${ee("users")} remove --org ${s} --run ${e.run} --yes`),r.push(`API requests: ${e.apiRequests}`),r}function ps(e,s){let r=[`removal of run ${e.run} of the users of ${s}: ${e.status}`];for(let n of e.users){r.push(` ${n.username}: ${n.undone.length>0?n.undone.map(F).join(", "):"nothing put back"}`);for(let a of n.kept??[])r.push(` ${n.username}: kept ${F(a.change)}: ${a.why}`)}for(let n of e.refusals??[])r.push(P(n));return r.push(`API requests: ${e.apiRequests}`),r}function We(e,s){return e==="cancelled"?pe(s??"SIGINT"):e==="partial"?3:e==="failure"?1:0}function Ge(){let e=new AbortController,s,r=fe(n=>{s=n,process.stderr.write(`
149
147
  interrupted: the run ends after the step under way, its file saying what it holds (Ctrl-C again ends it at once)
150
- `),e.abort()});return{signal:e.signal,stopped:()=>s,release:n}}async function nr(e,s){let n=Ys(e.json),r=await Gs(e.org),{conn:t,org:o,organization:i}=r,g=Hs(),c=m=>r.typingRequests+o.requests()+m,d;if(e.replaces!==void 0){let m=await Zn(g,i.organizationId,e.replaces);if("refusal"in m){let y=Qn(i,m.refusal,c(0));n(`plan of the users of ${Qe(i)}`),process.stderr.write(`${se(m.refusal)}
151
- `),e.json&&Y(y),V(1);return}d=m.record}let w=await Ue(o,s,{now:new Date,...d?{previous:d}:{}}),h={...d?{previous:d}:{},acceptUserEmails:e.acceptUserEmails,acceptEmails:e.acceptEmails},S=ae(w,s,h),O;S.emailsToPeople>0&&(O=await hs(t),S=ae(w,s,{...h,deliverability:Ws(O)}));let k=await Xs(t,e.org,Jn(S)),L=Zs(k,e.org,"users are written",e.acceptAutomation),F=()=>(O?.requests??0)+Xe(k),x=c(F()),W=ye(S,i,x+w.requests),l=[...W.refusals??[],...L?[L]:[]],A={...W,...l.length>0?{refusals:l}:{}};for(let m of Yn(A,{...O?{deliverability:O}:{},automation:k,sent:x},e))n(m);if(e.verb==="plan"||e.dryRun){e.dryRun&&n("a dry run: nothing was written"),e.json&&Y(A),V(l.length>0?1:0);return}if(l.length>0){for(let m of l)process.stderr.write(`${se(m)}
148
+ `),e.abort()});return{signal:e.signal,stopped:()=>s,release:r}}async function fs(e,s){let r=Me(e.json),n=await Le(e.org),{conn:a,org:o,organization:u}=n,l=je(),c=g=>n.typingRequests+o.requests()+g,d;if(e.replaces!==void 0){let g=await us(l,u.organizationId,e.replaces);if("refusal"in g){let A=ds(u,g.refusal,c(0));r(`plan of the users of ${B(u)}`),process.stderr.write(`${P(g.refusal)}
149
+ `),e.json&&k(A),E(1);return}d=g.record}let f=await Oe({conn:a,org:o,orgName:e.org,users:s,...d?{previous:d}:{},acceptUserEmails:e.acceptUserEmails,acceptEmails:e.acceptEmails,acceptAutomation:e.acceptAutomation}),{deliverability:h,automation:$}=f,R=c(f.outsideRequests),w=Ne(f,u,R),I=w.refusals??[];for(let g of cs(w,{...h?{deliverability:h}:{},automation:$,sent:R},e))r(g);if(e.verb==="plan"||e.dryRun){e.dryRun&&r("a dry run: nothing was written"),e.json&&k(w),E(I.length>0?1:0);return}if(I.length>0){for(let g of I)process.stderr.write(`${P(g)}
152
150
  `);process.stderr.write(`Nothing was written.
153
- `),e.json&&Y(A),V(1);return}let E=A.users.filter(m=>m.changes.length>0).length;if(!e.yes){let m=`Set up ${E} user${E===1?"":"s"} of ${e.org} as above`+(A.emailsToPeople>0?`, Salesforce emailing ${A.emailsToPeople} ${A.emailsToPeople===1?"person":"people"}?`:"?");if(!await Ne(m)){n("Nothing was written.");return}}let v=sn(),N;try{N=await Ns({org:o,organization:i,users:s,store:g,signal:v.signal,...h,...O?{deliverability:Ws(O)}:{}})}finally{v.release()}if(N.kind==="refused"){let m=N.plan;for(let y of m.refusals??[])process.stderr.write(`${se(y)}
151
+ `),e.json&&k(w),E(1);return}let T=w.users.filter(g=>g.changes.length>0).length;if(!e.yes){let g=`Set up ${T} user${T===1?"":"s"} of ${e.org} as above`+(w.emailsToPeople>0?`, Salesforce emailing ${w.emailsToPeople} ${w.emailsToPeople===1?"person":"people"}?`:"?");if(!await W(g)){r("Nothing was written.");return}}let O=Ge(),N;try{N=await _e({org:o,organization:u,users:s,store:l,signal:O.signal,...f.options})}finally{O.release()}if(N.kind==="refused"){let g=N.plan;for(let A of g.refusals??[])process.stderr.write(`${P(A)}
154
152
  `);process.stderr.write(`The org changed since the plan read it. Nothing was written.
155
- `),e.json&&Y(m),V(1);return}let f={...N.answer,apiRequests:c(F())};for(let m of er(f,e.org))n(m);e.json&&Y(f),V(en(f.status,v.stopped()))}async function rr(e){let s=Ys(e.json),n=e.run??0,r=await Gs(e.org),{conn:t,org:o,organization:i}=r,g=Hs(),c={kind:"none"},d=await g.read(i.organizationId,n),w=d!==void 0&&(await g.list(i.organizationId)).some(k=>k.replaces===n);if(d!==void 0&&!w){c=await Xs(t,e.org,Xn(d));let k=Zs(c,e.org,"users are put back",e.acceptAutomation);if(c.kind!=="none")for(let L of Qs(c,e.org,"users are put back"))s(L);if(k!==void 0){let L={org:i,run:n,status:"failure",users:[],apiRequests:r.typingRequests+o.requests()+Xe(c),refusals:[k]};process.stderr.write(`${se(k)}
156
- `),e.json&&Y(L),V(1);return}if(!e.yes&&!await Ne(`Take back run ${n} of the users of ${e.org}?`)){s("Nothing was written.");return}}let h=sn(),S;try{S=await xs({org:o,organization:i,store:g,run:n,includeChanged:e.includeChanged,signal:h.signal})}finally{h.release()}let O={...S,apiRequests:r.typingRequests+o.requests()+Xe(c)};for(let k of sr(O,e.org))s(k);e.json&&Y(O),V(en(O.status,h.stopped()))}async function tr(e=process.argv){let s=e.slice(2);if(s.includes("--help")||s.includes("-h")){process.stdout.write(qn);return}let n=Wn(s);if(n.verb==="remove"){await rr(n);return}await nr(n,jn(n.config??""))}/sandforge-users\.[cm]?[jt]s$/.test(process.argv[1]??"")&&(ys(),tr().then(()=>process.exit(process.exitCode??0)).catch(e=>{process.stderr.write(`${e instanceof Error?e.stack??e.message:String(e)}
157
- `),process.exit(1)}));export{Ls as AUTOMATION_NOT_ACCEPTED,qn as HELP,Fs as USERS_FLAGS,Fn as USERS_RUN_NOT_FOUND,Mn as USERS_RUN_REPLACED,de as changeWords,tr as main,Wn as parseArgs,jn as readConfig,Bn as usersProductionRefusal};
153
+ `),e.json&&k(g),E(1);return}let _={...N.answer,apiRequests:c(f.outsideRequests)};for(let g of ls(_,e.org))r(g);e.json&&k(_),E(We(_.status,O.stopped()))}async function hs(e){let s=Me(e.json),r=e.run??0,n=await Le(e.org),{conn:a,org:o,organization:u}=n,l=je(),c={kind:"none"},d=await l.read(u.organizationId,r),f=d!==void 0&&(await l.list(u.organizationId)).some(w=>w.replaces===r);if(d!==void 0&&!f){c=await Ie(a,e.org,ke(d));let w=Ee(c,e.org,"users are put back",e.acceptAutomation);if(c.kind!=="none")for(let I of De(c,e.org,"users are put back"))s(I);if(w!==void 0){let I={org:u,run:r,status:"failure",users:[],apiRequests:n.typingRequests+o.requests()+H(c),refusals:[w]};process.stderr.write(`${P(w)}
154
+ `),e.json&&k(I),E(1);return}if(!e.yes&&!await W(`Take back run ${r} of the users of ${e.org}?`)){s("Nothing was written.");return}}let h=Ge(),$;try{$=await Pe({org:o,organization:u,store:l,run:r,includeChanged:e.includeChanged,signal:h.signal})}finally{h.release()}let R={...$,apiRequests:n.typingRequests+o.requests()+H(c)};for(let w of ps(R,e.org))s(w);e.json&&k(R),E(We(R.status,h.stopped()))}async function gs(e=process.argv){let s=e.slice(2);if(s.includes("--help")||s.includes("-h")){process.stdout.write(Ze);return}let r=ss(s);if(r.verb==="remove"){await hs(r);return}await fs(r,rs(r.config??""))}/sandforge-users\.[cm]?[jt]s$/.test(process.argv[1]??"")&&(me(),gs().then(()=>process.exit(process.exitCode??0)).catch(e=>{process.stderr.write(`${e instanceof Error?e.stack??e.message:String(e)}
155
+ `),process.exit(1)}));export{Ze as HELP,Te as USERS_FLAGS,Qe as USERS_RUN_NOT_FOUND,Ye as USERS_RUN_REPLACED,F as changeWords,gs as main,ss as parseArgs,rs as readConfig,as as usersProductionRefusal};
package/lib/sandforge.mjs CHANGED
@@ -4,4 +4,4 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import{a,b,c,d,e,f}from"./chunk-A32ISQ6M.mjs";import"./chunk-SCKUIE3R.mjs";import"./chunk-NTOVCTRS.mjs";export{a as TOOLS,b as dispatchOf,c as helpText,f as main,d as toolFile,e as versionOf};
7
+ import{a,b,c,d,e,f}from"./chunk-RMFU4BAL.mjs";import"./chunk-AL4C3GFT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as TOOLS,b as dispatchOf,c as helpText,f as main,d as toolFile,e as versionOf};
@@ -1,6 +1,6 @@
1
1
  export default class SandforgeCommand {
2
- static summary = "compare two orgs the way the Compare page does";
3
- static description = "sandforge compare — compare two orgs the way the Compare page does, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge compare --help.";
2
+ static summary = "compare two orgs the way the Compare page does, and deploy what differs";
3
+ static description = "sandforge compare — compare two orgs the way the Compare page does, without the editor, and deploy what differs as its Deploy tab does.\n\nThe whole help, its options and its exit codes: sf sandforge compare --help.";
4
4
  static hidden = false;
5
5
  static strict = false;
6
6
  static flags = {};
package/lib/sfPlugin.mjs CHANGED
@@ -4,7 +4,7 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import{f as i}from"./chunk-A32ISQ6M.mjs";import"./chunk-SCKUIE3R.mjs";import"./chunk-NTOVCTRS.mjs";import{extname as l,join as m}from"node:path";function c(e=__dirname,s=__filename){return m(e,`sandforge${l(s)}`)}async function p(e,s,o=i,t=__dirname,a=__filename){await o([process.execPath,c(t,a),...e===""?[]:[e],...s])}var r="https://github.com/StephaneBerthoz/sandforge/blob/master",d=[{id:"sandforge",label:"SandForge",description:"Test data between Salesforce orgs: what SandForge holds on this machine, read without reaching an org; every other command runs in a terminal, sf sandforge <command>.",vscodeIcon:"database",sldsIcon:"utility:database",commands:[{id:"sandforge-help",label:"Commands and their help",command:"sf sandforge --help",tooltip:"SandForge's commands; sf sandforge <command> --help gives a command's options and exit codes",helpUrl:`${r}/packages/cli/README.md`,vscodeIcon:"question",sldsIcon:"utility:help"},{id:"sandforge-templates",label:"Seed templates",command:"sf sandforge seed --list-templates",tooltip:"Name the built-in templates Seed fills an org from; reaches no org",helpUrl:`${r}/docs/modules/seed.md`,vscodeIcon:"list-unordered",sldsIcon:"utility:list"},{id:"sandforge-yaml-validate",label:"Validate sandforge.yaml",command:"sf sandforge env validate",tooltip:"Check this folder's sandforge.yaml offline: its schema, each resource, their order, the variables it names; reaches no org",helpUrl:`${r}/docs/environments.md`,vscodeIcon:"check",sldsIcon:"utility:check"},{id:"sandforge-yaml-state",label:"Environments on this machine",command:"sf sandforge env state",tooltip:"List the sandforge.yaml environments this machine keeps; reaches no org",helpUrl:`${r}/docs/environments.md`,vscodeIcon:"list-tree",sldsIcon:"utility:database"}]}],g={out:e=>{process.stdout.write(e)},err:e=>{process.stderr.write(e)}};function u(e,s=g){let o=e.find(n=>n!=="--json");if(o!==void 0)return s.err(`"${o}" is not a flag sandforge:hardis-commands reads: --json, or nothing. Nothing was run.
7
+ import{f as i}from"./chunk-RMFU4BAL.mjs";import"./chunk-AL4C3GFT.mjs";import"./chunk-NTOVCTRS.mjs";import{extname as l,join as m}from"node:path";function c(e=__dirname,s=__filename){return m(e,`sandforge${l(s)}`)}async function p(e,s,o=i,t=__dirname,a=__filename){await o([process.execPath,c(t,a),...e===""?[]:[e],...s])}var r="https://github.com/StephaneBerthoz/sandforge/blob/master",d=[{id:"sandforge",label:"SandForge",description:"Test data between Salesforce orgs: what SandForge holds on this machine, read without reaching an org; every other command runs in a terminal, sf sandforge <command>.",vscodeIcon:"database",sldsIcon:"utility:database",commands:[{id:"sandforge-help",label:"Commands and their help",command:"sf sandforge --help",tooltip:"SandForge's commands; sf sandforge <command> --help gives a command's options and exit codes",helpUrl:`${r}/packages/cli/README.md`,vscodeIcon:"question",sldsIcon:"utility:help"},{id:"sandforge-templates",label:"Seed templates",command:"sf sandforge seed --list-templates",tooltip:"Name the built-in templates Seed fills an org from; reaches no org",helpUrl:`${r}/docs/modules/seed.md`,vscodeIcon:"list-unordered",sldsIcon:"utility:list"},{id:"sandforge-yaml-validate",label:"Validate sandforge.yaml",command:"sf sandforge env validate",tooltip:"Check this folder's sandforge.yaml offline: its schema, each resource, their order, the variables it names; reaches no org",helpUrl:`${r}/docs/environments.md`,vscodeIcon:"check",sldsIcon:"utility:check"},{id:"sandforge-yaml-state",label:"Environments on this machine",command:"sf sandforge env state",tooltip:"List the sandforge.yaml environments this machine keeps; reaches no org",helpUrl:`${r}/docs/environments.md`,vscodeIcon:"list-tree",sldsIcon:"utility:database"}]}],g={out:e=>{process.stdout.write(e)},err:e=>{process.stderr.write(e)}};function u(e,s=g){let o=e.find(n=>n!=="--json");if(o!==void 0)return s.err(`"${o}" is not a flag sandforge:hardis-commands reads: --json, or nothing. Nothing was run.
8
8
  `),2;if(e.includes("--json"))return s.out(`${JSON.stringify({status:0,result:{customCommands:d}})}
9
9
  `),0;let t=d.flatMap(n=>n.commands),a=Math.max(...t.map(n=>n.label.length));return s.out(`The entries SandForge adds to the menus of the sfdx-hardis VS Code extension, each reaching no org:
10
10
  `+t.map(n=>` ${n.label.padEnd(a)} ${n.command}
@@ -1 +1 @@
1
- {"commands":{"sandforge":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge takes","name":"argv"}},"description":"sandforge — SandForge's command lines, without the editor: Seed, Forge's clone, Sync, Checkpoints, DataOps, Frozen Dataset, the emptying of a sandbox, the users of a sandbox, sandforge.yaml environments, Automation pipelines, and the MCP server.\n\nIts commands: sf sandforge --help. The whole help of one, its options and its exit codes: sf sandforge <command> --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"SandForge's command lines: seed, clone, sync, checkpoints, masking, Frozen Datasets, sandforge.yaml, pipelines, MCP","isESM":true,"relativePath":["lib","sf","sandforge","index.mjs"]},"sandforge:autopilot":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge autopilot takes","name":"argv"}},"description":"sandforge autopilot — run an Autopilot copy between two orgs, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge autopilot --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:autopilot","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"run an Autopilot copy between two orgs","isESM":true,"relativePath":["lib","sf","sandforge","autopilot.mjs"]},"sandforge:backup":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge backup takes","name":"argv"}},"description":"sandforge backup — take and restore DataOps snapshots, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge backup --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:backup","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"take and restore DataOps snapshots","isESM":true,"relativePath":["lib","sf","sandforge","backup.mjs"]},"sandforge:checkpoint":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge checkpoint takes","name":"argv"}},"description":"sandforge checkpoint — take a checkpoint of an org's data, and rewind the org to it, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge checkpoint --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:checkpoint","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"take a checkpoint of an org's data, and rewind the org to it","isESM":true,"relativePath":["lib","sf","sandforge","checkpoint.mjs"]},"sandforge:cleanup":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge cleanup takes","name":"argv"}},"description":"sandforge cleanup — Bulk delete records you created on a sandbox in the --since window, whether or not a clone wrote them. Preview with --dry-run and narrow with --objects before deleting.\n\nThe whole help, its options and its exit codes: sf sandforge cleanup --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:cleanup","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"Bulk delete records you created on a sandbox in a time window","isESM":true,"relativePath":["lib","sf","sandforge","cleanup.mjs"]},"sandforge:clone":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge clone takes","name":"argv"}},"description":"sandforge clone — Forge a clone of one record, or of whole tables, from a source org to a target sandbox, or remove what a run of it created.\n\nThe whole help, its options and its exit codes: sf sandforge clone --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:clone","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"clone a record, or whole tables, from one org to a sandbox, or remove a run","isESM":true,"relativePath":["lib","sf","sandforge","clone.mjs"]},"sandforge:compare":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge compare takes","name":"argv"}},"description":"sandforge compare — compare two orgs the way the Compare page does, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge compare --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:compare","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"compare two orgs the way the Compare page does","isESM":true,"relativePath":["lib","sf","sandforge","compare.mjs"]},"sandforge:dataops":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge dataops takes","name":"argv"}},"description":"sandforge dataops — mask an org's records, and put them back, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge dataops --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:dataops","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"mask an org's records, and put them back","isESM":true,"relativePath":["lib","sf","sandforge","dataops.mjs"]},"sandforge:empty":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge empty takes","name":"argv"}},"description":"sandforge empty — empty objects of a sandbox, or the whole of it, without the editor: a dry run first, then the deletes, to the recycle bin with an undo, or for good.\n\nThe whole help, its options and its exit codes: sf sandforge empty --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:empty","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"empty objects of a sandbox, or the whole of it","isESM":true,"relativePath":["lib","sf","sandforge","empty.mjs"]},"sandforge:env":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge env takes","name":"argv"}},"description":"sandforge env — apply a sandforge.yaml to an org: the data an environment needs, declared in your repository, created, kept and taken back, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge env --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:env","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"apply a sandforge.yaml to an org, and take it back","isESM":true,"relativePath":["lib","sf","sandforge","env.mjs"]},"sandforge:frozen":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge frozen takes","name":"argv"}},"description":"sandforge frozen — build and replay a Frozen Dataset, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge frozen --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:frozen","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"build and replay a Frozen Dataset","isESM":true,"relativePath":["lib","sf","sandforge","frozen.mjs"]},"sandforge:mcp":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge mcp takes","name":"argv"}},"description":"sandforge mcp — Seed, Forge's clone of a record, of the records a query chooses or of the whole org, the removal of a run, the emptying of objects or of a whole org, Checkpoints and their replay into another org, the environments of a sandforge.yaml and the plan of an Automation pipeline, as tools for an AI agent, over the Model Context Protocol on stdio.\n\nThe whole help, its options and its exit codes: sf sandforge mcp --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:mcp","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"the MCP server: these scripts as tools for an AI agent, on stdio","isESM":true,"relativePath":["lib","sf","sandforge","mcp.mjs"]},"sandforge:monitor":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge monitor takes","name":"argv"}},"description":"sandforge monitor — read an org the way the Monitor page does, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge monitor --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:monitor","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"read an org the way the Monitor page does","isESM":true,"relativePath":["lib","sf","sandforge","monitor.mjs"]},"sandforge:pipeline":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge pipeline takes","name":"argv"}},"description":"sandforge pipeline — run an Automation pipeline exported from VS Code, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge pipeline --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:pipeline","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"plan and run an Automation pipeline exported from VS Code","isESM":true,"relativePath":["lib","sf","sandforge","pipeline.mjs"]},"sandforge:seed":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge seed takes","name":"argv"}},"description":"sandforge seed — fill an org from a seed template, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge seed --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:seed","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"fill an org from a seed template","isESM":true,"relativePath":["lib","sf","sandforge","seed.mjs"]},"sandforge:sync":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge sync takes","name":"argv"}},"description":"sandforge sync — run a Sync between two orgs, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge sync --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:sync","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"run a Sync between two orgs","isESM":true,"relativePath":["lib","sf","sandforge","sync.mjs"]},"sandforge:users":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge users takes","name":"argv"}},"description":"sandforge users — set up the users of a sandbox handed back to its testers, a scratch org or a Developer Edition org: an address the copy put under .invalid asked back, a user activated, frozen or unfrozen, a profile, permission sets, permission set groups, groups and queues given; and take a run back.\n\nThe whole help, its options and its exit codes: sf sandforge users --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:users","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"set up the users of a sandbox after its refresh, and take them back","isESM":true,"relativePath":["lib","sf","sandforge","users.mjs"]},"sandforge:hardis-commands":{"aliases":[],"args":{"argv":{"description":"nothing, or --json for the document the extension reads","name":"argv"}},"description":"The entries SandForge adds to the menus of the sfdx-hardis VS Code extension, each reaching no org. With --json, the document the extension reads, alone on stdout.","flags":{},"hasDynamicHelp":false,"hidden":true,"hiddenAliases":[],"id":"sandforge:hardis-commands","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"the menus of SandForge in the sfdx-hardis VS Code extension","isESM":true,"relativePath":["lib","sf","sandforge","hardis-commands.mjs"]}},"version":"1.82.0"}
1
+ {"commands":{"sandforge":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge takes","name":"argv"}},"description":"sandforge — SandForge's command lines, without the editor: Seed, Forge's clone, Sync, Checkpoints, DataOps, Frozen Dataset, the emptying of a sandbox, the users of a sandbox, sandforge.yaml environments, Automation pipelines, and the MCP server.\n\nIts commands: sf sandforge --help. The whole help of one, its options and its exit codes: sf sandforge <command> --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"SandForge's command lines: seed, clone, sync, checkpoints, masking, Frozen Datasets, sandforge.yaml, pipelines, MCP","isESM":true,"relativePath":["lib","sf","sandforge","index.mjs"]},"sandforge:autopilot":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge autopilot takes","name":"argv"}},"description":"sandforge autopilot — run an Autopilot copy between two orgs, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge autopilot --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:autopilot","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"run an Autopilot copy between two orgs","isESM":true,"relativePath":["lib","sf","sandforge","autopilot.mjs"]},"sandforge:backup":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge backup takes","name":"argv"}},"description":"sandforge backup — take and restore DataOps snapshots, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge backup --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:backup","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"take and restore DataOps snapshots","isESM":true,"relativePath":["lib","sf","sandforge","backup.mjs"]},"sandforge:checkpoint":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge checkpoint takes","name":"argv"}},"description":"sandforge checkpoint — take a checkpoint of an org's data, and rewind the org to it, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge checkpoint --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:checkpoint","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"take a checkpoint of an org's data, and rewind the org to it","isESM":true,"relativePath":["lib","sf","sandforge","checkpoint.mjs"]},"sandforge:cleanup":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge cleanup takes","name":"argv"}},"description":"sandforge cleanup — Bulk delete records you created on a sandbox in the --since window, whether or not a clone wrote them. Preview with --dry-run and narrow with --objects before deleting.\n\nThe whole help, its options and its exit codes: sf sandforge cleanup --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:cleanup","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"Bulk delete records you created on a sandbox in a time window","isESM":true,"relativePath":["lib","sf","sandforge","cleanup.mjs"]},"sandforge:clone":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge clone takes","name":"argv"}},"description":"sandforge clone — Forge a clone of one record, or of whole tables, from a source org to a target sandbox, or remove what a run of it created.\n\nThe whole help, its options and its exit codes: sf sandforge clone --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:clone","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"clone a record, or whole tables, from one org to a sandbox, or remove a run","isESM":true,"relativePath":["lib","sf","sandforge","clone.mjs"]},"sandforge:compare":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge compare takes","name":"argv"}},"description":"sandforge compare — compare two orgs the way the Compare page does, without the editor, and deploy what differs as its Deploy tab does.\n\nThe whole help, its options and its exit codes: sf sandforge compare --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:compare","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"compare two orgs the way the Compare page does, and deploy what differs","isESM":true,"relativePath":["lib","sf","sandforge","compare.mjs"]},"sandforge:dataops":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge dataops takes","name":"argv"}},"description":"sandforge dataops — mask an org's records, and put them back, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge dataops --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:dataops","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"mask an org's records, and put them back","isESM":true,"relativePath":["lib","sf","sandforge","dataops.mjs"]},"sandforge:empty":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge empty takes","name":"argv"}},"description":"sandforge empty — empty objects of a sandbox, or the whole of it, without the editor: a dry run first, then the deletes, to the recycle bin with an undo, or for good.\n\nThe whole help, its options and its exit codes: sf sandforge empty --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:empty","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"empty objects of a sandbox, or the whole of it","isESM":true,"relativePath":["lib","sf","sandforge","empty.mjs"]},"sandforge:env":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge env takes","name":"argv"}},"description":"sandforge env — apply a sandforge.yaml to an org: the data an environment needs, declared in your repository, created, kept and taken back, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge env --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:env","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"apply a sandforge.yaml to an org, and take it back","isESM":true,"relativePath":["lib","sf","sandforge","env.mjs"]},"sandforge:frozen":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge frozen takes","name":"argv"}},"description":"sandforge frozen — build and replay a Frozen Dataset, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge frozen --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:frozen","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"build and replay a Frozen Dataset","isESM":true,"relativePath":["lib","sf","sandforge","frozen.mjs"]},"sandforge:mcp":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge mcp takes","name":"argv"}},"description":"sandforge mcp — Seed, Forge's clone of a record, of the records a query chooses or of the whole org, the removal of a run, the emptying of objects or of a whole org, Checkpoints and their replay into another org, the environments of a sandforge.yaml and the plan of an Automation pipeline, as tools for an AI agent, over the Model Context Protocol on stdio.\n\nThe whole help, its options and its exit codes: sf sandforge mcp --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:mcp","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"the MCP server: these scripts as tools for an AI agent, on stdio","isESM":true,"relativePath":["lib","sf","sandforge","mcp.mjs"]},"sandforge:monitor":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge monitor takes","name":"argv"}},"description":"sandforge monitor — read an org the way the Monitor page does, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge monitor --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:monitor","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"read an org the way the Monitor page does","isESM":true,"relativePath":["lib","sf","sandforge","monitor.mjs"]},"sandforge:pipeline":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge pipeline takes","name":"argv"}},"description":"sandforge pipeline — run an Automation pipeline exported from VS Code, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge pipeline --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:pipeline","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"plan and run an Automation pipeline exported from VS Code","isESM":true,"relativePath":["lib","sf","sandforge","pipeline.mjs"]},"sandforge:seed":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge seed takes","name":"argv"}},"description":"sandforge seed — fill an org from a seed template, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge seed --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:seed","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"fill an org from a seed template","isESM":true,"relativePath":["lib","sf","sandforge","seed.mjs"]},"sandforge:sync":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge sync takes","name":"argv"}},"description":"sandforge sync — run a Sync between two orgs, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge sync --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:sync","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"run a Sync between two orgs","isESM":true,"relativePath":["lib","sf","sandforge","sync.mjs"]},"sandforge:users":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge users takes","name":"argv"}},"description":"sandforge users — set up the users of a sandbox handed back to its testers, a scratch org or a Developer Edition org: an address the copy put under .invalid asked back, a user activated, frozen or unfrozen, a profile, permission sets, permission set groups, groups and queues given; and take a run back.\n\nThe whole help, its options and its exit codes: sf sandforge users --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:users","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"set up the users of a sandbox after its refresh, and take them back","isESM":true,"relativePath":["lib","sf","sandforge","users.mjs"]},"sandforge:hardis-commands":{"aliases":[],"args":{"argv":{"description":"nothing, or --json for the document the extension reads","name":"argv"}},"description":"The entries SandForge adds to the menus of the sfdx-hardis VS Code extension, each reaching no org. With --json, the document the extension reads, alone on stdout.","flags":{},"hasDynamicHelp":false,"hidden":true,"hiddenAliases":[],"id":"sandforge:hardis-commands","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"the menus of SandForge in the sfdx-hardis VS Code extension","isESM":true,"relativePath":["lib","sf","sandforge","hardis-commands.mjs"]}},"version":"1.84.0"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sandforge",
3
- "version": "1.82.0",
3
+ "version": "1.84.0",
4
4
  "description": "SandForge's command lines, without the editor: seed, clone and sync Salesforce orgs, checkpoints and rewinds, masking, Frozen Datasets, sandforge.yaml environments, and an MCP server for AI agents.",
5
5
  "keywords": [
6
6
  "salesforce",