sandforge 1.85.0 → 1.86.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 (274) hide show
  1. package/README.md +1 -1
  2. package/lib/{chunk-THYQOG24.mjs → chunk-22L43JMK.mjs} +1 -1
  3. package/lib/{chunk-U4S27YRP.mjs → chunk-2LSGWTWX.mjs} +1 -1
  4. package/lib/{chunk-MRN72UEO.mjs → chunk-2YJJTQNC.mjs} +1 -1
  5. package/lib/chunk-34SMB5PA.mjs +10 -0
  6. package/lib/chunk-35B73566.mjs +7 -0
  7. package/lib/{chunk-YZKE6D3K.mjs → chunk-35IJ4WEU.mjs} +1 -1
  8. package/lib/chunk-3EHPAFKV.mjs +7 -0
  9. package/lib/{chunk-3OKDWZ32.mjs → chunk-3HAVVEXF.mjs} +1 -1
  10. package/lib/{chunk-32ZB5ICW.mjs → chunk-3I6FXFCN.mjs} +1 -1
  11. package/lib/{chunk-JFVY66BS.mjs → chunk-3KJCSYXY.mjs} +1 -1
  12. package/lib/{chunk-ULEYGOZU.mjs → chunk-3L6DVNCR.mjs} +1 -1
  13. package/lib/chunk-3LRFPGYZ.mjs +7 -0
  14. package/lib/{chunk-GHUA6OQQ.mjs → chunk-3MVWGL5A.mjs} +1 -1
  15. package/lib/{chunk-SF52ZSIV.mjs → chunk-4CSBZZAL.mjs} +1 -1
  16. package/lib/{chunk-FBYFCKPG.mjs → chunk-4NSXPONF.mjs} +1 -1
  17. package/lib/{chunk-A3QNSALB.mjs → chunk-4VLP6RHC.mjs} +1 -1
  18. package/lib/{chunk-TWYNQ2OO.mjs → chunk-4XROG5CT.mjs} +1 -1
  19. package/lib/chunk-54V4FVEY.mjs +7 -0
  20. package/lib/chunk-55OJJT2Q.mjs +7 -0
  21. package/lib/{chunk-JRI6A24G.mjs → chunk-5EHHQ5UX.mjs} +1 -1
  22. package/lib/{chunk-VPGX5Z5D.mjs → chunk-5JMQXHJ2.mjs} +1 -1
  23. package/lib/{chunk-CI2O7WBH.mjs → chunk-65AMXOQU.mjs} +1 -1
  24. package/lib/{chunk-5T3LFDJ5.mjs → chunk-6HHSAPIM.mjs} +1 -1
  25. package/lib/chunk-6KVBCFVS.mjs +7 -0
  26. package/lib/chunk-6NG7C2U3.mjs +476 -0
  27. package/lib/{chunk-F2424IKX.mjs → chunk-6ROL3KBM.mjs} +1 -1
  28. package/lib/{chunk-7ZYCRIHE.mjs → chunk-72AWCN7U.mjs} +1 -1
  29. package/lib/{chunk-MQLTEXB7.mjs → chunk-7KHA5UIQ.mjs} +1 -1
  30. package/lib/chunk-7O6EFNQS.mjs +10 -0
  31. package/lib/{chunk-73SLYGWD.mjs → chunk-A2CH2QGX.mjs} +1 -1
  32. package/lib/chunk-A2TXLAC3.mjs +276 -0
  33. package/lib/chunk-ALWVNR34.mjs +7 -0
  34. package/lib/{chunk-JBOGAUGH.mjs → chunk-ATBQIE2V.mjs} +1 -1
  35. package/lib/{chunk-C2MHMI7U.mjs → chunk-ATQML7ZK.mjs} +1 -1
  36. package/lib/chunk-AVY742BJ.mjs +7 -0
  37. package/lib/{chunk-VLAU5QQT.mjs → chunk-AXTB2HJS.mjs} +1 -1
  38. package/lib/chunk-BBZUGKBZ.mjs +10 -0
  39. package/lib/chunk-BIDXK7KA.mjs +7 -0
  40. package/lib/{chunk-KYLHS74X.mjs → chunk-BLMJ4WVI.mjs} +1 -1
  41. package/lib/{chunk-A7YP27GQ.mjs → chunk-BNHJCJJM.mjs} +1 -1
  42. package/lib/{chunk-ZDMSTL2L.mjs → chunk-BNPQEQXC.mjs} +1 -1
  43. package/lib/chunk-C5AUNG6T.mjs +37 -0
  44. package/lib/{chunk-LY6EPMIP.mjs → chunk-C5EQ7GFC.mjs} +1 -1
  45. package/lib/{chunk-LOO42EW5.mjs → chunk-C7CKDZMC.mjs} +62 -62
  46. package/lib/{chunk-ZP3WJGS3.mjs → chunk-CB4U22NR.mjs} +1 -1
  47. package/lib/chunk-CJAWKLAL.mjs +7 -0
  48. package/lib/chunk-CL75DEMQ.mjs +9 -0
  49. package/lib/{chunk-7L6FE5PP.mjs → chunk-CLUNF4FK.mjs} +1 -1
  50. package/lib/chunk-CSMGP53U.mjs +7 -0
  51. package/lib/{chunk-S6BMJSLD.mjs → chunk-CT324C7I.mjs} +1 -1
  52. package/lib/{chunk-YXOPKGDX.mjs → chunk-CZXDJXQP.mjs} +1 -1
  53. package/lib/{chunk-PGG4ULEW.mjs → chunk-D2X6U3MS.mjs} +1 -1
  54. package/lib/{chunk-FG4Y4ZVL.mjs → chunk-DAUX63UB.mjs} +1 -1
  55. package/lib/chunk-DB7JNALQ.mjs +10 -0
  56. package/lib/chunk-DDNCJVZ2.mjs +17 -0
  57. package/lib/{chunk-YGE4AUXG.mjs → chunk-DLSU66MY.mjs} +1 -1
  58. package/lib/{chunk-DCJBP3LE.mjs → chunk-DO6PSHQZ.mjs} +1 -1
  59. package/lib/{chunk-ROTDZKOE.mjs → chunk-DUBECLZV.mjs} +1 -1
  60. package/lib/{chunk-SES5HPBZ.mjs → chunk-DYHF6DNT.mjs} +1 -1
  61. package/lib/chunk-E5FSPXYH.mjs +930 -0
  62. package/lib/{chunk-QAXKUEJT.mjs → chunk-EGL3I3IX.mjs} +1 -1
  63. package/lib/chunk-EIYMQPMG.mjs +7 -0
  64. package/lib/{chunk-AX3YF7SC.mjs → chunk-EUIALBMX.mjs} +1 -1
  65. package/lib/{chunk-57QRXYAZ.mjs → chunk-FI3R5ZOQ.mjs} +1 -1
  66. package/lib/{chunk-FCZDWGQI.mjs → chunk-FM4QCTO7.mjs} +1 -1
  67. package/lib/{chunk-74HZ274R.mjs → chunk-FRSIEASH.mjs} +1 -1
  68. package/lib/{chunk-G6IYOZEH.mjs → chunk-FV6MOSHD.mjs} +1 -1
  69. package/lib/chunk-FYG47CNA.mjs +7 -0
  70. package/lib/chunk-GB6W4Q56.mjs +7 -0
  71. package/lib/chunk-GEV2DCMK.mjs +7 -0
  72. package/lib/{chunk-NZJXEULY.mjs → chunk-GFB2DNCB.mjs} +1 -1
  73. package/lib/chunk-GFGMGFSH.mjs +7 -0
  74. package/lib/{chunk-EFHDE7W4.mjs → chunk-GIFQXB2Q.mjs} +1 -1
  75. package/lib/{chunk-P6A22FMQ.mjs → chunk-GP5J3DGS.mjs} +1 -1
  76. package/lib/chunk-GQZEX7LH.mjs +231 -0
  77. package/lib/{chunk-BRN42U26.mjs → chunk-GYDTM62J.mjs} +1 -1
  78. package/lib/{chunk-GNCEHAJY.mjs → chunk-GYFIXUJG.mjs} +1 -1
  79. package/lib/chunk-GZW2GNFK.mjs +7 -0
  80. package/lib/chunk-H6BHWAX7.mjs +8 -0
  81. package/lib/{chunk-GUYEXPJ4.mjs → chunk-HDDJ3CVN.mjs} +1 -1
  82. package/lib/{chunk-3GATEVHC.mjs → chunk-HDWB4ZOG.mjs} +1 -1
  83. package/lib/chunk-HGVPBJR6.mjs +7 -0
  84. package/lib/{chunk-55VBV2WK.mjs → chunk-HLROVOR6.mjs} +1 -1
  85. package/lib/{chunk-HV3TDLFR.mjs → chunk-HUOR4M2L.mjs} +1 -1
  86. package/lib/chunk-HZCS6EED.mjs +8 -0
  87. package/lib/{chunk-WZX6VCIT.mjs → chunk-HZUI56KZ.mjs} +1 -1
  88. package/lib/chunk-IAB5H7WN.mjs +7 -0
  89. package/lib/{chunk-RY7WUJXH.mjs → chunk-IQ5UKRHU.mjs} +1 -1
  90. package/lib/{chunk-OUWR5M5G.mjs → chunk-IRQ4WANV.mjs} +1 -1
  91. package/lib/{chunk-F44EHXLI.mjs → chunk-IT3DGX37.mjs} +1 -1
  92. package/lib/chunk-J347SPU6.mjs +49 -0
  93. package/lib/{chunk-IZ2M2RGO.mjs → chunk-JANBNTR5.mjs} +1 -1
  94. package/lib/chunk-JFXQZPRY.mjs +9 -0
  95. package/lib/{chunk-VKA5OZBJ.mjs → chunk-JRLYWVF4.mjs} +1 -1
  96. package/lib/{chunk-FM5ESRH6.mjs → chunk-JSNMUTY6.mjs} +1 -1
  97. package/lib/chunk-JTNJKSAA.mjs +7 -0
  98. package/lib/{chunk-4D6OHSX3.mjs → chunk-JV2LAKWQ.mjs} +1 -1
  99. package/lib/{chunk-BY42YL4D.mjs → chunk-JV7K2ZHK.mjs} +1 -1
  100. package/lib/{chunk-A6IJUOLB.mjs → chunk-K4TQ7YHX.mjs} +1 -1
  101. package/lib/chunk-K5PUMHZU.mjs +7 -0
  102. package/lib/chunk-KH4KLCYG.mjs +7 -0
  103. package/lib/{chunk-FZF6FB65.mjs → chunk-KQVLZVOP.mjs} +1 -1
  104. package/lib/chunk-KWUS7UAV.mjs +19 -0
  105. package/lib/{chunk-2UUSF32M.mjs → chunk-L6G73FXM.mjs} +1 -1
  106. package/lib/{chunk-LUNGNCM3.mjs → chunk-LG466Q5H.mjs} +1 -1
  107. package/lib/{chunk-YTBM3TSW.mjs → chunk-LHNAR6FC.mjs} +1 -1
  108. package/lib/chunk-LT4GHEI2.mjs +7 -0
  109. package/lib/{chunk-P3OYE2FS.mjs → chunk-MR262Y3B.mjs} +1 -1
  110. package/lib/{chunk-TSTCHIBU.mjs → chunk-NCCHOV2N.mjs} +1 -1
  111. package/lib/chunk-NICRSGLS.mjs +7 -0
  112. package/lib/chunk-NV5QA2HY.mjs +7 -0
  113. package/lib/{chunk-6HAKOS6W.mjs → chunk-O3GIN5TU.mjs} +1 -1
  114. package/lib/chunk-O6FHK6NQ.mjs +13 -0
  115. package/lib/{chunk-OXIIKAUZ.mjs → chunk-O7YIEFG7.mjs} +1 -1
  116. package/lib/chunk-OCUVAA5E.mjs +7 -0
  117. package/lib/chunk-OLCS7JCT.mjs +14 -0
  118. package/lib/chunk-ON7Y63FK.mjs +9 -0
  119. package/lib/{chunk-K2WOT75I.mjs → chunk-OO2WY3UB.mjs} +1 -1
  120. package/lib/{chunk-3EOIAC2M.mjs → chunk-OT2NHL2V.mjs} +1 -1
  121. package/lib/{chunk-BK5SRDAD.mjs → chunk-P2M5ZXWU.mjs} +1 -1
  122. package/lib/{chunk-DCZYWMSA.mjs → chunk-P4YOHLZ4.mjs} +1 -1
  123. package/lib/chunk-PBHDPTT6.mjs +343 -0
  124. package/lib/chunk-PE7CHD2W.mjs +7 -0
  125. package/lib/{chunk-LU7M5URW.mjs → chunk-PIQ2I67B.mjs} +1 -1
  126. package/lib/chunk-PKYDNZJK.mjs +7 -0
  127. package/lib/chunk-PVZ72OOQ.mjs +7 -0
  128. package/lib/chunk-QACFTHJM.mjs +8 -0
  129. package/lib/{chunk-LNAZHI3J.mjs → chunk-QGVL5EW3.mjs} +1 -1
  130. package/lib/chunk-QHE2RUWX.mjs +7 -0
  131. package/lib/{chunk-4RNP65FV.mjs → chunk-RCW5BZNW.mjs} +1 -1
  132. package/lib/{chunk-OTKXTBTX.mjs → chunk-RJ6HHG7J.mjs} +1 -1
  133. package/lib/{chunk-IVDBVWKK.mjs → chunk-RPTEEI4R.mjs} +1 -1
  134. package/lib/chunk-RQW5S67A.mjs +7 -0
  135. package/lib/chunk-RTCMYMED.mjs +7 -0
  136. package/lib/chunk-RWVX7XSD.mjs +7 -0
  137. package/lib/{chunk-2UUS4IGB.mjs → chunk-RZOINFNL.mjs} +1 -1
  138. package/lib/chunk-SOOTWGMQ.mjs +7 -0
  139. package/lib/chunk-STQ2JMIZ.mjs +7 -0
  140. package/lib/{chunk-RC25QQVF.mjs → chunk-SUIPDW5O.mjs} +1 -1
  141. package/lib/{chunk-Z354SAEF.mjs → chunk-SZOJ7BEJ.mjs} +1 -1
  142. package/lib/{chunk-45375WT5.mjs → chunk-T542Z54E.mjs} +1 -1
  143. package/lib/chunk-TAN2CIRI.mjs +21 -0
  144. package/lib/{chunk-BGJBYDRW.mjs → chunk-TCNBINOG.mjs} +1 -1
  145. package/lib/chunk-TFDF3DBN.mjs +7 -0
  146. package/lib/{chunk-B5A4JHNN.mjs → chunk-TICZXC53.mjs} +1 -1
  147. package/lib/chunk-TLX45X5U.mjs +7 -0
  148. package/lib/{chunk-W6SLQZKQ.mjs → chunk-TMIV3IWH.mjs} +1 -1
  149. package/lib/chunk-TQ6HEJ73.mjs +11 -0
  150. package/lib/chunk-TTU5EQZ6.mjs +7 -0
  151. package/lib/chunk-TYUYPFDJ.mjs +7 -0
  152. package/lib/chunk-TZXYVMZC.mjs +7 -0
  153. package/lib/{chunk-4N425UJC.mjs → chunk-UCUFLFNK.mjs} +1 -1
  154. package/lib/chunk-UK3QLBHW.mjs +7 -0
  155. package/lib/{chunk-SKGAERV4.mjs → chunk-UM2B4GR7.mjs} +1 -1
  156. package/lib/chunk-UZFTTNOP.mjs +7 -0
  157. package/lib/chunk-V3AXSKSU.mjs +7 -0
  158. package/lib/chunk-VA6EEI6X.mjs +21 -0
  159. package/lib/{chunk-LSEM2BZH.mjs → chunk-VFKG2G37.mjs} +1 -1
  160. package/lib/chunk-VJNEW5MQ.mjs +7 -0
  161. package/lib/{chunk-EYFP3NA6.mjs → chunk-VKREON6Q.mjs} +1 -1
  162. package/lib/{chunk-TIVI2KGB.mjs → chunk-VNNDYPBL.mjs} +1 -1
  163. package/lib/{chunk-J3FJ3BWE.mjs → chunk-VRBETPHY.mjs} +1 -1
  164. package/lib/{chunk-UX4AOSMU.mjs → chunk-VT6P3X6R.mjs} +1 -1
  165. package/lib/{chunk-CUOWQMGW.mjs → chunk-VUTQY76O.mjs} +1 -1
  166. package/lib/chunk-WF5S4FW5.mjs +7 -0
  167. package/lib/{chunk-JHJDDQDE.mjs → chunk-WJGK6VGU.mjs} +1 -1
  168. package/lib/{chunk-IZREPWYQ.mjs → chunk-WJHMB3SL.mjs} +1 -1
  169. package/lib/{chunk-XZRON54U.mjs → chunk-WQCXOZEJ.mjs} +1 -1
  170. package/lib/{chunk-N2MXYD67.mjs → chunk-WVVFR4E3.mjs} +1 -1
  171. package/lib/{chunk-GG5I52UT.mjs → chunk-XBYXT74L.mjs} +1 -1
  172. package/lib/chunk-XJE3LJHP.mjs +7 -0
  173. package/lib/{chunk-3QCUSZIZ.mjs → chunk-XV4CVZYD.mjs} +1 -1
  174. package/lib/chunk-Y37ED7AS.mjs +7 -0
  175. package/lib/{chunk-MN3XBJPE.mjs → chunk-YGBNZYT4.mjs} +1 -1
  176. package/lib/{chunk-SBDF4AE5.mjs → chunk-YGTOX7IL.mjs} +1 -1
  177. package/lib/{chunk-SQM32AOQ.mjs → chunk-YJ27WHKR.mjs} +1 -1
  178. package/lib/chunk-YRULC27A.mjs +7 -0
  179. package/lib/{chunk-RMFU4BAL.mjs → chunk-YSVAHT4Q.mjs} +4 -4
  180. package/lib/chunk-YTOTMJTY.mjs +15 -0
  181. package/lib/{chunk-SU24AE3H.mjs → chunk-YZKZC62O.mjs} +1 -1
  182. package/lib/{chunk-LJNRN7MY.mjs → chunk-YZQN7BRB.mjs} +1 -1
  183. package/lib/{chunk-NMF55UBQ.mjs → chunk-Z5IUK2QO.mjs} +1 -1
  184. package/lib/{chunk-6ZWY36LK.mjs → chunk-ZEGSMW5A.mjs} +1 -1
  185. package/lib/{chunk-YV7JYHJP.mjs → chunk-ZIKLQZBG.mjs} +1 -1
  186. package/lib/chunk-ZVU7MD2S.mjs +7 -0
  187. package/lib/sandforge-autopilot.mjs +33 -27
  188. package/lib/sandforge-backup.mjs +19 -19
  189. package/lib/sandforge-checkpoint.mjs +1 -1
  190. package/lib/sandforge-cleanup.mjs +1 -1
  191. package/lib/sandforge-clone.mjs +1 -1
  192. package/lib/sandforge-compare.mjs +29 -16
  193. package/lib/sandforge-dataops.mjs +1 -1
  194. package/lib/sandforge-empty.mjs +11 -13
  195. package/lib/sandforge-env.mjs +105 -105
  196. package/lib/sandforge-frozen.mjs +1 -1
  197. package/lib/sandforge-mcp.mjs +2 -2
  198. package/lib/sandforge-monitor.mjs +1 -1
  199. package/lib/sandforge-pipeline.mjs +13 -13
  200. package/lib/sandforge-seed.mjs +1 -1
  201. package/lib/sandforge-sync.mjs +1 -1
  202. package/lib/sandforge-users.mjs +13 -15
  203. package/lib/sandforge.mjs +1 -1
  204. package/lib/sf/sandforge/dataops.mjs +2 -2
  205. package/lib/sfPlugin.mjs +1 -1
  206. package/oclif.manifest.json +1 -1
  207. package/package.json +1 -1
  208. package/lib/chunk-26EGXYZ4.mjs +0 -21
  209. package/lib/chunk-2JRVBXJL.mjs +0 -7
  210. package/lib/chunk-2METQHGG.mjs +0 -7
  211. package/lib/chunk-3XU7CEJQ.mjs +0 -7
  212. package/lib/chunk-4BQPAVMP.mjs +0 -14
  213. package/lib/chunk-4KMKOE77.mjs +0 -156
  214. package/lib/chunk-4RPA7Z52.mjs +0 -7
  215. package/lib/chunk-5C7LQXYS.mjs +0 -7
  216. package/lib/chunk-5EESNYE3.mjs +0 -8
  217. package/lib/chunk-6ZW6BLV5.mjs +0 -7
  218. package/lib/chunk-AAOMUI7S.mjs +0 -15
  219. package/lib/chunk-AIUAEBHR.mjs +0 -7
  220. package/lib/chunk-BD724WOH.mjs +0 -7
  221. package/lib/chunk-CRPLDXJU.mjs +0 -48
  222. package/lib/chunk-CSSOLHE3.mjs +0 -7
  223. package/lib/chunk-D63HEQ3B.mjs +0 -7
  224. package/lib/chunk-DN7YBILC.mjs +0 -21
  225. package/lib/chunk-DNE7JI3A.mjs +0 -11
  226. package/lib/chunk-EFHM2U4D.mjs +0 -7
  227. package/lib/chunk-EINEGS6E.mjs +0 -7
  228. package/lib/chunk-EM5EFMHA.mjs +0 -272
  229. package/lib/chunk-FH5UR35W.mjs +0 -7
  230. package/lib/chunk-FN7TOBJR.mjs +0 -7
  231. package/lib/chunk-HGJFATSI.mjs +0 -10
  232. package/lib/chunk-HOEE3PE5.mjs +0 -7
  233. package/lib/chunk-HV63UGL5.mjs +0 -7
  234. package/lib/chunk-JKFCGYJE.mjs +0 -7
  235. package/lib/chunk-KATBU46O.mjs +0 -7
  236. package/lib/chunk-LD34JNCC.mjs +0 -7
  237. package/lib/chunk-LPN4WYTP.mjs +0 -478
  238. package/lib/chunk-MAOUFJ47.mjs +0 -7
  239. package/lib/chunk-MB2DG66I.mjs +0 -13
  240. package/lib/chunk-NCASRA7L.mjs +0 -9
  241. package/lib/chunk-NEKNAILD.mjs +0 -7
  242. package/lib/chunk-NN2IO4WE.mjs +0 -7
  243. package/lib/chunk-O3ZQSWDN.mjs +0 -10
  244. package/lib/chunk-OFQOKSEW.mjs +0 -7
  245. package/lib/chunk-PP7PJXRJ.mjs +0 -341
  246. package/lib/chunk-PT2E2HFD.mjs +0 -7
  247. package/lib/chunk-PZBZ7MNC.mjs +0 -7
  248. package/lib/chunk-QBYK5XIT.mjs +0 -8
  249. package/lib/chunk-RFD6NPWJ.mjs +0 -8
  250. package/lib/chunk-RIIJJRGF.mjs +0 -7
  251. package/lib/chunk-RKTFFCNS.mjs +0 -7
  252. package/lib/chunk-RM5G4IP6.mjs +0 -19
  253. package/lib/chunk-RTPNK7OB.mjs +0 -7
  254. package/lib/chunk-RZXEO5IE.mjs +0 -7
  255. package/lib/chunk-SAHGDSZQ.mjs +0 -37
  256. package/lib/chunk-SRPWW4A2.mjs +0 -10
  257. package/lib/chunk-SVNSAHG3.mjs +0 -7
  258. package/lib/chunk-T63U4OZJ.mjs +0 -7
  259. package/lib/chunk-TE2W76II.mjs +0 -10
  260. package/lib/chunk-TEIBWMJM.mjs +0 -7
  261. package/lib/chunk-TFGJDZFE.mjs +0 -7
  262. package/lib/chunk-TG52WNGV.mjs +0 -10
  263. package/lib/chunk-TQONVFI3.mjs +0 -7
  264. package/lib/chunk-TW3N6W5Z.mjs +0 -7
  265. package/lib/chunk-UZMLPKW6.mjs +0 -7
  266. package/lib/chunk-WB2RIVO3.mjs +0 -7
  267. package/lib/chunk-WQO7RXEB.mjs +0 -926
  268. package/lib/chunk-X3MBY2RX.mjs +0 -7
  269. package/lib/chunk-XMJRXXUN.mjs +0 -7
  270. package/lib/chunk-YNMU5I7P.mjs +0 -7
  271. package/lib/chunk-YSQJKIO6.mjs +0 -7
  272. package/lib/chunk-YVVPJRZC.mjs +0 -7
  273. package/lib/chunk-ZLQHBI6V.mjs +0 -9
  274. package/lib/chunk-ZRUDYB7O.mjs +0 -7
@@ -1,11 +0,0 @@
1
- import { createRequire as __sandforgeRequire } from 'node:module';
2
- import { fileURLToPath as __sandforgePath } from 'node:url';
3
- import { dirname as __sandforgeDirname } from 'node:path';
4
- const require = __sandforgeRequire(import.meta.url);
5
- const __filename = __sandforgePath(import.meta.url);
6
- const __dirname = __sandforgeDirname(__filename);
7
- import{b as F}from"./chunk-CA5NAXSU.mjs";import{dd as E,s as z}from"./chunk-CRPLDXJU.mjs";import{b as m,e as b,l as h,o as C,s as G}from"./chunk-WZQEK4WT.mjs";import{appendFileSync as re,mkdirSync as oe,readFileSync as ie,renameSync as se,writeFileSync as ae}from"node:fs";import{homedir as de,hostname as J}from"node:os";import{join as L,resolve as ce}from"node:path";var ue=10,K=1440*6e4,x=200,ge=448,U=384,$=6e4;function fe(t,e){if(e!==J())return!0;try{return process.kill(t,0),!0}catch(n){return n.code==="EPERM"}}function Y(t=process.env){let e=t.SANDFORGE_JOURNAL_DIR,n=e!==void 0&&e.trim()!==""?ce(e):L(de(),".sandforge");return L(n,"storage-written")}var le=/^[A-Za-z0-9]{15}(?:[A-Za-z0-9]{3})?$/;function _(t,e){if(le.test(t))return L(e.dir??Y(),`${t.slice(0,15)}.ndjson`)}var O=m().min(1).max(200),me=C([h({at:m(),saidMB:b()}),h({at:m(),wrote:G(m(),b()),run:O.optional()}),h({at:m(),begunMB:b().positive(),run:O,pid:b().int().positive(),host:m()})]);function j(t){let e;try{e=ie(t,"utf8")}catch{return[]}let n=[];for(let r of e.split(`
8
- `)){if(r.trim()==="")continue;let s;try{s=me.safeParse(JSON.parse(r))}catch{continue}if(!s.success)continue;let o=Date.parse(s.data.at);if(Number.isNaN(o))continue;let{data:i}=s;n.push("saidMB"in i?{at:o,saidMB:i.saidMB}:"wrote"in i?{at:o,wrote:i.wrote,...i.run!==void 0?{run:i.run}:{}}:{at:o,begunMB:i.begunMB,run:i.run,pid:i.pid,host:i.host})}return n.sort((r,s)=>r.at-s.at)}function N(t,e,n){let r=_(t,n);if(!r)return;let s=(n.now??new Date).getTime();try{oe(n.dir??Y(),{recursive:!0,mode:ge}),re(r,`${JSON.stringify(e)}
9
- `,{encoding:"utf8",mode:U});let o=j(r);if(o.length<=x)return;let i=o.filter(u=>s-u.at<=K),a=new Set(i.flatMap(u=>"wrote"in u&&u.run!==void 0?[u.run]:[])),c=[...i.slice(0,-x/2).filter(u=>"begunMB"in u&&!a.has(u.run)),...i.slice(-x/2)].map(u=>JSON.stringify({...u,at:new Date(u.at).toISOString()})),f=`${r}.${process.pid}.tmp`;ae(f,c.length>0?`${c.join(`
10
- `)}
11
- `:"",{encoding:"utf8",mode:U}),se(f,r)}catch{}}function ve(t,e,n={}){let r=(n.now??new Date).toISOString();N(t,{at:r,saidMB:e},n)}function V(t,e,n,r={}){if(!Number.isFinite(n)||n<=0||!O.safeParse(e).success)return;let s=(r.now??new Date).toISOString();N(t,{at:s,begunMB:n,run:e,pid:process.pid,host:J()},r)}function Z(t,e,n={}){let r=Object.fromEntries(Object.entries(e).filter(([,a])=>Number.isFinite(a)&&a!==0)),{run:s}=n,o=s!==void 0&&O.safeParse(s).success?s:void 0;if(Object.keys(r).length===0&&!pe(t,o,n))return;let i=(n.now??new Date).toISOString();N(t,{at:i,wrote:r,...o!==void 0?{run:o}:{}},n)}function pe(t,e,n){if(e===void 0)return!1;let r=_(t,n);if(!r)return!1;let s=j(r);return s.some(o=>"begunMB"in o&&o.run===e)&&!s.some(o=>"wrote"in o&&o.run===e)}function Q(t){let e={};for(let{objectApiName:n,created:r,deleted:s,upserted:o=0}of t)e[n]=(e[n]??0)+r+o-s;return e}function We(t,e,n,r={}){let s=_(t,r);if(!s)return;let o=(r.now??new Date).getTime(),i=j(s),a=ue*$,g=be(i,o,r.alive??fe),c=Math.min(o-a,g[0]?.at??1/0),f=d=>"wrote"in d&&d.at<=o&&d.at>=c,u=d=>Object.entries(d.wrote).reduce((A,[I,P])=>A+Math.sign(P)*n(I,Math.abs(P)),0),l=i.filter(f).map(d=>({at:d.at,bytes:u(d)}));if(l.length===0&&g.length===0)return;let te=i.findIndex(d=>f(d)||g.includes(d)),y=i.slice(0,te).filter(d=>"saidMB"in d).at(-1),D=l.filter(d=>o-d.at>a).length,v=y?(y.saidMB-e)*1048576:0,W=y?Ae(l,v,D):D,w=l.slice(W),T=y?v-S(l.slice(0,W)):0,p=g.map(d=>{let A=d.begunMB*1048576,I=Math.min(A,Math.max(0,T),ye(i,d,e,o,u));return T-=I,{at:d.at,bytes:A-I}}).filter(d=>d.bytes>0),k=S(w)+S(p);if(k<=0)return;let ne=Math.min(w[0]?.at??o,p[0]?.at??o);return{mb:k/1048576,runs:w.filter(d=>d.bytes>0).length+p.length,minutes:Math.max(1,Math.ceil((o-ne)/$)),...p.length>0?{writing:p.length}:{}}}function be(t,e,n){let r=new Set(t.flatMap(o=>"wrote"in o&&o.run!==void 0?[o.run]:[])),s=new Set;return t.filter(o=>!("begunMB"in o)||o.at>e||e-o.at>K||r.has(o.run)||s.has(o.run)?!1:(s.add(o.run),n(o.pid,o.host)))}function ye(t,e,n,r,s){let o=t.indexOf(e),i=-1;for(let c=o-1;c>=0;c--)if("saidMB"in t[c]){i=c;break}let a=t[i];if(a===void 0||!("saidMB"in a))return 0;let g=t.slice(i+1).filter(c=>"wrote"in c&&c.at<=r).reduce((c,f)=>c+Math.max(0,s(f)),0);return Math.max(0,(a.saidMB-n)*1048576-g)}function S(t){return t.reduce((e,n)=>e+n.bytes,0)}function Ae(t,e,n=0){let r=S(t.slice(0,n)),s=n,o=r,i=Math.abs(e-r);for(let a=n;a<t.length;a++){r+=t[a]?.bytes??0;let g=Math.abs(e-r);(g<i||Math.abs(r-o)<1)&&(i=Math.min(g,i),s=a+1,o=r)}return s}import{createHash as Oe}from"node:crypto";var H="lineage:runs",Ie="lineage";function X(t){let e=t.objects.filter(i=>i.records>0);if(e.length===0)return null;let n="source",r="target",s=[{id:n,type:"source",label:t.source.label,origin:t.source.origin,...t.source.orgId?{orgId:t.source.orgId}:{}}],o=[];for(let i of e){let a=`object:${i.objectApiName}`;s.push({id:a,type:"object",label:i.objectApiName,objectApiName:i.objectApiName,recordCount:i.records}),o.push({sourceId:n,targetId:a}),o.push({sourceId:a,targetId:r,recordCount:i.records})}return s.push({id:r,type:"destination",label:t.target.label,orgId:t.target.orgId,origin:"org"}),{nodes:s,edges:o,operationId:t.operationId,generatedAt:t.generatedAt,module:t.module,action:t.action}}var R=class{constructor(e,n=100){this.configStore=e;this.limit=n}configStore;limit;save(e){let n=this.read().filter(r=>r.operationId!==e.operationId);n.push(e),this.configStore.set(H,n.slice(-this.limit),Ie)}get(e){let n=this.read();return e===void 0?n[n.length-1]??null:n.find(r=>r.operationId===e)??null}runs(){return this.read().reverse().map(e=>({operationId:e.operationId,generatedAt:e.generatedAt,...e.module?{module:e.module}:{},...e.action?{action:e.action}:{},...he(e)}))}read(){let e=this.configStore.get(H);return Array.isArray(e)?e.filter(Se):[]}};function he(t){let e=t.nodes.find(n=>n.type==="destination");return e?{targetLabel:e.label}:{}}function Se(t){if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.operationId=="string"&&typeof e.generatedAt=="string"&&Array.isArray(e.nodes)&&Array.isArray(e.edges)}var Re=100,q="audit:trail",we="audit",B=class{constructor(e,n=z){this.configStore=e;this.limit=n}configStore;limit;append(e){let n=this.read();n.push(e),this.configStore.set(q,n.slice(-this.limit),we)}list(e={}){let n=this.read().reverse(),r=n.filter(i=>(e.module===void 0||i.module===e.module)&&(e.orgId===void 0||i.orgId===e.orgId)),s=e.offset??0,o=e.limit??Re;return{entries:r.slice(s,s+o),total:r.length,offset:s,facets:Ee(n)}}read(){let e=this.configStore.get(q);return Array.isArray(e)?e.filter(Me):[]}};function Ee(t){let e=new Set,n=new Map;for(let r of t)e.add(r.module),r.orgId!==void 0&&!n.has(r.orgId)&&n.set(r.orgId,r.orgAlias);return{modules:[...e].sort(),orgs:[...n].map(([r,s])=>s?{orgId:r,orgAlias:s}:{orgId:r})}}function Me(t){if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.id=="string"&&typeof e.action=="string"&&typeof e.module=="string"&&typeof e.timestamp=="string"}var Ue="ABORTED_BEFORE_START";function xe(t){let e=t?.trim().toLowerCase();if(e)return`sha256:${Oe("sha256").update(e).digest("hex").slice(0,12)}`}var ee=new Set(["seed_execute","sync_execute","backup_restore","delete_execute","forge_execute","seed_csv_import","seed_clone","autopilot_execute","frozen_load","realtime_sync","subject_erase","cleanup_delete","empty_undo","checkpoint_rewind","checkpoint_undo","checkpoint_replay"]);function Le(t,e=new Date){ee.has(t.action)&&Z(t.orgId,Q(t.objects??[]),{now:e,...t.operationId!==void 0?{run:t.operationId}:{}})}function $e(t,e,n=new Date){ee.has(t.action)&&V(t.orgId,t.operationId,e,{now:n})}function Je(t,e,n=new Date){try{let r=t.services?.getSandforgeSetting?.("safety.auditLogging",!0)!==!1;if(!r&&e.outcome==="stopped"&&e.code===void 0)return;let s=n.toISOString(),o=t.orgManager.getOrg(e.orgId),i=o?E(o):void 0,a=xe(o?.username),g=e.source?.origin==="org"?e.source.orgId:void 0,c=g!==void 0?t.orgManager.getOrg(g):void 0,f=c?E(c):void 0,u=e.objects??[];if(Le(e,n),new B(t.configStore).append({id:crypto.randomUUID(),action:e.action,module:e.module,orgId:e.orgId,...i?{orgAlias:i}:{},...g!==void 0?{sourceOrgId:g}:{},...f?{sourceOrgAlias:f}:{},operationId:e.operationId,outcome:e.outcome,...r&&e.guard?{guard:e.guard}:{},objects:[...u],...e.leftBy?{leftBy:e.leftBy}:{},...a?{userId:a}:{},...e.context?{context:e.context}:{},...e.verdict?{verdict:e.verdict}:{},...e.muted?{muted:e.muted}:{},...e.checkpointId?{checkpointId:e.checkpointId}:{},...e.beforeRun?{beforeRun:{...e.beforeRun}}:{},...e.fit?{fit:{...e.fit}}:{},details:{...e.details,...e.code?{code:e.code}:{}},timestamp:s}),!e.source)return;let l=X({operationId:e.operationId,module:e.module,action:e.action,source:e.source.origin==="org"?{origin:"org",orgId:e.source.orgId,label:f??e.source.orgId}:{origin:e.source.origin,label:e.source.label??""},target:{label:i??e.orgId,orgId:e.orgId},objects:_e(u,e.carried),generatedAt:s});l&&new R(t.configStore).save(l)}catch(r){t.log(`[WARN] audit trail: run ${e.operationId} was not recorded \u2014 ${F(r)}`)}}function _e(t,e){return e?Object.entries(e).map(([n,r])=>({objectApiName:n,records:r})):t.map(n=>({objectApiName:n.objectApiName,records:n.created+n.updated+(n.upserted??0)}))}function Ke(t){return{objectApiName:t,created:0,updated:0,deleted:0,failed:0}}export{R as a,ue as b,ve as c,We as d,B as e,Ue as f,xe as g,Le as h,$e as i,Je as j,Ke as k};
@@ -1,7 +0,0 @@
1
- import { createRequire as __sandforgeRequire } from 'node:module';
2
- import { fileURLToPath as __sandforgePath } from 'node:url';
3
- import { dirname as __sandforgeDirname } from 'node:path';
4
- const require = __sandforgeRequire(import.meta.url);
5
- const __filename = __sandforgePath(import.meta.url);
6
- const __dirname = __sandforgeDirname(__filename);
7
- import{a,b,c,d,e,f,g,h,i,j}from"./chunk-QBYK5XIT.mjs";import"./chunk-VKA5OZBJ.mjs";import"./chunk-55VBV2WK.mjs";import"./chunk-FQGHL7GR.mjs";import"./chunk-UX4AOSMU.mjs";import"./chunk-HGJFATSI.mjs";import"./chunk-RM5G4IP6.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-CRPLDXJU.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as SCENARIO_SIDECAR_SUFFIX,f as compiledForSidecar,g as nodeScenarioSidecarFiles,j as readScenarioRunSidecar,c as scenarioPackFingerprint,d as scenarioRunSidecar,b as scenarioRunSidecarSchema,h as scenarioSidecarPath,e as withAgentChoice,i as writeScenarioRunSidecar};
@@ -1,7 +0,0 @@
1
- import { createRequire as __sandforgeRequire } from 'node:module';
2
- import { fileURLToPath as __sandforgePath } from 'node:url';
3
- import { dirname as __sandforgeDirname } from 'node:path';
4
- const require = __sandforgeRequire(import.meta.url);
5
- const __filename = __sandforgePath(import.meta.url);
6
- const __dirname = __sandforgeDirname(__filename);
7
- import{e as a}from"./chunk-THYQOG24.mjs";var c="FIELD_CUSTOM_VALIDATION_EXCEPTION",g="INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST",R="FIELD_FILTER_VALIDATION_EXCEPTION",F="INACTIVE_OWNER_OR_USER",w=/\[(005[A-Za-z0-9]{12}(?:[A-Za-z0-9]{3})?)\]/,E="005",h=["CreatedById","LastModifiedById"];function L(e,n){if(e.statusCode!==F)return;let r=f(n,"OwnerId"),t=r===void 0?void 0:n[r],o=w.exec(e.message)?.[1];if(!(typeof t!="string"||o===void 0))return t.slice(0,15)===o.slice(0,15)?o.slice(0,15):void 0}function O(e,n,r){let t=f(n,"OwnerId");if(t===void 0||t.toLowerCase()===r?.toLowerCase())return;let o=n[t];if(!(typeof o!="string"||!o.startsWith(E)||e.fields.some(u=>u.toLowerCase()!=="ownerid")||!(w.test(e.message)?L(e,n)!==void 0:h.every(u=>f(n,u)===void 0))))return{field:t,refusedBy:"inactive-owner",reason:a(e)}}var I=new Map([[c,"validation-rule"],[g,"restricted-picklist"],[R,"lookup-filter"]]);function _(e){return e!=null&&e!==""}function f(e,n){let r=n.toLowerCase();return Object.keys(e).find(t=>t.toLowerCase()===r&&_(e[t]))}function m(e,n,r,t,o){if(!e||e.length===0)return;let d=new Map;for(let s of e){let u=I.get(s.statusCode);if(!u){let i=o?.inactiveOwner===!0&&s.statusCode===F?O(s,n,r):void 0;if(!i)return;d.has(i.field)||d.set(i.field,i);continue}let l=s.fields.map(i=>f(n,i)).filter(i=>i!==void 0&&i.toLowerCase()!==r?.toLowerCase());if(l.length===0||u==="lookup-filter"&&!l.every(i=>t?.(i)===!0))return;for(let i of l)d.has(i)||d.set(i,{field:i,refusedBy:u,reason:a(s)})}return[...d.values()]}function A(e){return(e??[]).some(n=>n.statusCode===c&&n.fields.length===0)}function C(e,n){let r=new Set(n.map(t=>t.field));return Object.fromEntries(Object.entries(e).filter(([t])=>!r.has(t)))}function S(e,n){let r=e??{rows:0,fields:[]};r.rows+=n.rows;for(let t of n.fields){let o=r.fields.find(d=>d.field===t.field&&d.reason===t.reason);o?o.rows+=t.rows:r.fields.push({...t})}return r}var p={"validation-rule":"a validation rule of the target refused it","restricted-picklist":"a restricted picklist of the target refused its value","lookup-filter":"a lookup filter of the target refused the record it names","inactive-owner":"the target holds the owner it names inactive"};function v(e){return(e?.fields??[]).map(({field:n,refusedBy:r="validation-rule",reason:t,rows:o,replacedWith:d})=>{let s=d===void 0?`written without ${n}`:`written with ${n} set to "${d}"`;return`, ${o} ${s}: ${p[r]}, ${t}`}).join("")}function W(e){let n=`${e.rows} record(s) written again without the fields the target refused them on${v(e)}`;return n.endsWith(".")?n:`${n}.`}export{g as a,R as b,F as c,L as d,f as e,m as f,A as g,C as h,S as i,v as j,W as k};
@@ -1,272 +0,0 @@
1
- import { createRequire as __sandforgeRequire } from 'node:module';
2
- import { fileURLToPath as __sandforgePath } from 'node:url';
3
- import { dirname as __sandforgeDirname } from 'node:path';
4
- const require = __sandforgeRequire(import.meta.url);
5
- const __filename = __sandforgePath(import.meta.url);
6
- const __dirname = __sandforgeDirname(__filename);
7
- import{q as It}from"./chunk-PP7PJXRJ.mjs";import{a as Bt,b as he,c as Ut,e as Wt,f as Me,g as Gt,h as qt,i as Vt,j as Kt,k as me,l as ge,m as Ht}from"./chunk-DN7YBILC.mjs";import{e as Mt,g as _t}from"./chunk-TSTCHIBU.mjs";import{f as Pt,h as xt}from"./chunk-U4S27YRP.mjs";import{a as Dt}from"./chunk-HV3TDLFR.mjs";import{a as Xt}from"./chunk-TW3N6W5Z.mjs";import{Eb as Nt,Xa as re,c as Ne,d as Ie,e as At,f as $t,h as kt,i as De,j as Rt,k as St,l as Ot,m as Ft,mb as Pe,nb as zt,q as Tt,qb as xe,rb as pe,tb as Lt,ub as se,yb as Ct,zb as jt}from"./chunk-WQO7RXEB.mjs";import{a as ne,d as wt,j as je}from"./chunk-2METQHGG.mjs";import{c as oe,d as le}from"./chunk-6FARZYMJ.mjs";import{b as ce}from"./chunk-RIIJJRGF.mjs";import{a as vt,b as bt}from"./chunk-4BQPAVMP.mjs";import{b as ue,e as it}from"./chunk-RKTFFCNS.mjs";import{n as yt}from"./chunk-SAHGDSZQ.mjs";import{d as lt}from"./chunk-T63U4OZJ.mjs";import{a as Re}from"./chunk-AL4C3GFT.mjs";import{b as at,c as Oe}from"./chunk-XZRON54U.mjs";import{Ec as ht,Tc as mt,Uc as gt,i as Te,m as ze,n as Le,nb as Ce,qb as fe,t as Y,tb as ft,ub as pt,xc as ee}from"./chunk-O3ZQSWDN.mjs";import{q as ct}from"./chunk-5T3LFDJ5.mjs";import{h as Ee}from"./chunk-4N425UJC.mjs";import{b as st,f as dt,g as ut,h as Et}from"./chunk-LCDPCUXS.mjs";import{E as Fe}from"./chunk-Z354SAEF.mjs";import{Wc as tt,Xd as ot,Yd as Se,Zd as de,_d as nt,fe as rt}from"./chunk-CRPLDXJU.mjs";import{existsSync as Ue,mkdirSync as go,readdirSync as wo,readFileSync as be}from"node:fs";import{dirname as yo,join as V}from"node:path";import{homedir as vo}from"node:os";var bo=`sandforge frozen \u2014 build and replay a Frozen Dataset, without the editor.
8
-
9
- Usage:
10
- npx sandforge frozen <step> --config <file> [options]
11
-
12
- Steps:
13
- select pick one root per combination of the coverage matrix (needs --source)
14
- extract read, pseudonymize, check and freeze those roots (needs --source)
15
- load replay the frozen dataset into a sandbox or a Developer Edition
16
- \u2014 WRITES (needs --target);
17
- what the target runs as it inserts and updates is named first, and takes
18
- --accept-automation or --mute-automation
19
- verify check the last load against the dataset (needs --target)
20
- remove delete the records a load created, the last first \u2014 DELETES (needs --target);
21
- what the target runs as they go is named first, and takes --accept-automation
22
- or --mute-automation; with --preview, say what it would delete, and delete
23
- nothing
24
- status what the store knows so far
25
-
26
- Required:
27
- --config <file> the project configuration, as the panel saves it (JSON)
28
-
29
- Options:
30
- --source <alias> sf CLI alias of the org the dataset is read from
31
- --target <alias> sf CLI alias of the sandbox, or Developer Edition org, it is
32
- loaded into
33
- --author <name> who froze the dataset, for the manifest (default: sandforge)
34
- --salt-file <file> the file holding the pseudonymization salt, when
35
- SANDFORGE_FROZEN_SALT is not set
36
- --store <file> where the run keeps its state (default: <sasDir>/cli-store.json)
37
- --pilot load one root folder only
38
- --reload replace the loads before: purge what earlier loads created,
39
- then load again. Refused before anything is written when a
40
- removal of those loads would leave records in the org \u2014
41
- records changed since, kept for records that stay under them
42
- (a contact made by hand since under one of their accounts,
43
- which the org would delete along), of an object the user may
44
- not delete, out of the user's sight or unread: take the load
45
- back with remove first (--include-changed takes what changed
46
- since, and what was added under them since). Refused as well
47
- when one of them was recorded before loads kept what they
48
- created, which no removal takes: refresh the sandbox, or find
49
- what your user created that day with
50
- ${Re("cleanup")}, its dry run
51
- first, then delete it. Refused
52
- the same way when the purge would have the org delete along a
53
- record the reload finds again by its keys \u2014 a quote under the
54
- opportunity an earlier load wrote: give that parent identity
55
- keys too, or take the load back first. What the target's
56
- automation likely made for a load holds nothing with --sweep,
57
- which takes it first. What the target runs as the purge
58
- deletes is read and named first, and nothing is written
59
- while something fires unless --accept-automation or
60
- --mute-automation answers it. The purge takes what those
61
- loads created, not what the target's automation made for
62
- them: --sweep takes that too. With --pilot, a reload purges
63
- nothing, and is not asked
64
- --gone-first <file> with load --reload --dry-run: the records taken back before
65
- the reload runs, a JSON array of their ids \u2014 hanging from the
66
- loads' records, they hold nothing. sandforge env gives it what
67
- its apply takes back first; a reload that runs reads what is
68
- still there
69
- --max-total <n> with load: the most records it may insert \u2014 the count its dry
70
- run gave. A load, or a reload, that would insert more is
71
- refused before anything is written, the purge included; a dry
72
- run says it would be, exit 1
73
- --dry-run with load: say what the load would do \u2014 per object, what it
74
- would insert, link, drop, rewrite and purge \u2014 and write nothing
75
- --write-encrypted with load: write the fields the target encrypts as the dataset
76
- holds them, though its manifest does not say its extraction
77
- left out what it read masked \u2014 they may hold masks such as
78
- ****1234 (left out otherwise, each named)
79
- --mute-automation with load or remove: mute the target's automation for that
80
- step through its own bypass \u2014 assign the user it writes as,
81
- for the step alone, the permission sets holding the custom
82
- permissions its flows, processes and workflow rules test to
83
- stay quiet, those of what --sweep deletes included, and take
84
- them back as it ends; what no bypass keeps quiet still runs,
85
- and is named, and a load or a removal then needs
86
- --accept-automation.
87
- Refused on a production org and for a user who cannot assign
88
- permission sets, exit 1; with --dry-run or --preview, says
89
- what would be muted and assigns nothing
90
- --accept-automation with load: write although the target runs flows, Apex
91
- triggers, processes or workflow rules as the load inserts
92
- its records and updates them \u2014 what --mute-automation
93
- keeps quiet and a bypass the user holds aside \u2014 or could
94
- not say what it runs; with remove, or load --reload:
95
- delete although it runs them as the records go, those
96
- --sweep deletes included \u2014 before or after a delete, or
97
- as an activated order is set back to Draft for its
98
- delete. Each is named before anything is written or
99
- deleted; without the flag the load or the reload writes
100
- nothing (AUTOMATION_NOT_ACCEPTED), the removal deletes
101
- nothing, exit 1; --dry-run says so
102
- --accept-emails with load: write although the target delivers every email
103
- what still runs sends as the records go in, a reload's
104
- purge and sweep included (Setup > Deliverability: All
105
- email), or would not say whether it does: without it
106
- such a load is refused, exit 1 (EMAILS_NOT_ACCEPTED),
107
- nothing written. Read only when something that still
108
- runs sends one, with one line of anonymous Apex that
109
- sends nothing; on System email only or No access it is
110
- not needed. The emails are counted too, on the records
111
- of the dataset, at most, against what the target has
112
- left today: past it, the load is refused whatever the
113
- flag, exit 1 (FROZEN_EMAILS_EXCEEDED). --mute-automation
114
- keeps quiet what tests the org's bypass; what an Apex
115
- trigger sends is read nowhere. --dry-run says it all,
116
- and what a load would be refused for
117
- ${At({run:"the load",simulation:"--dry-run",step:"with load: ",note:["Taken by this command once the load may write, before","the load's lease; deleted when the load is refused before","it writes or reports it wrote nothing, and kept when it","stops or fails part way: what it wrote then is not told","here."]})}
118
- --include-changed remove also the records changed since the load, and what
119
- was added to them since (kept otherwise); with load
120
- --reload --sweep, the sweep of each load replaced takes
121
- too what it finds changed since that load, which it
122
- keeps and names otherwise, the load kept recorded for
123
- a later sweep, and the reload no partial for them
124
- --sweep with remove: before the load's records go, delete too what
125
- the target's automation made for the load, that the
126
- load's mapping does not hold: what the load's user
127
- created under the load's records, what they point at,
128
- or what hangs from those, three links at most, at most
129
- a minute after the record it is tied to \u2014 in the
130
- objects the load wrote and their children, tasks,
131
- events, feed, email messages, notes, case comments, and
132
- the objects the target's flows create; the window is
133
- the load's writes, from a second before the first to a
134
- minute after the last. What a record of the load points
135
- at by a lookup the org refuses the delete for goes once
136
- that record is gone. Listed and kept: what is tied to
137
- the load but came later, up to 15 minutes, or as the
138
- org's Automated Process user; and what the load's user
139
- created in the window tied to nothing of it. Such
140
- records then keep none of the load's records as records
141
- that stay. A sweep refused, or that did not take all it was
142
- asked to, exits 3, and ends partial a removal that took
143
- every record of the load; one that left records of its own
144
- keeps its own status. Once the load's records went already,
145
- the sweep runs alone, the way to take what such a sweep
146
- left (off otherwise: a removal that took the load's
147
- records then reads what a sweep would take now, read
148
- only, and names what stays and the option that takes
149
- it, "notSwept" with --json). It sweeps too, each in its
150
- own window, every other load recorded whose records
151
- went \u2014 a load a reload replaced, kept for what its
152
- sweep left \u2014, and lets it go once that sweep took all
153
- it found. With load --reload: the sweep of each load
154
- the reload replaces, as its removal sweeps it, around
155
- the purge; what the target runs as it deletes is named
156
- once it has read what it takes, before the first
157
- delete, and answered as the purge's; with --dry-run, it
158
- lists what it would take. One refused, or that did not
159
- take all it was asked to, exits 3
160
- --sweep-late with --sweep: take too what it lists as made late; with
161
- --sweep-list, say what it would take
162
- --sweep-untied with --sweep: take too what it lists as tied to nothing of
163
- the load; with --sweep-list, say what it would take;
164
- refused when another run wrote to the target
165
- in the window \u2014 a load swept with it is none, a load
166
- this command ran from another sas into the org is one
167
- \u2014, or when that user created records in the window on
168
- objects neither the load nor the automation reaches
169
- (hand work, likely)
170
- --sweep-list with remove: list what --sweep would delete, per object
171
- with a few names and how many it ties to the load, and
172
- for each other load it sweeps with it, and delete nothing;
173
- exit 3 when it says a sweep is refused, as --sweep would
174
- --preview with remove: say what the removal would do, per object \u2014 the
175
- records it would delete, those it would keep as changed since
176
- the load and who changed them, those gone already, those it
177
- cannot see, and those it would leave because the user may not
178
- delete them \u2014 what the target runs as they go, and what it
179
- would be refused for, that automation without
180
- --accept-automation included. It deletes nothing, writes
181
- nothing to the sas and asks nothing; it exits 0 once it has
182
- said it. It cannot know what hangs from the records, which a
183
- removal reads at each object's turn. With --sweep, it lists
184
- what the sweep would take, and reads what fires on it with
185
- the load's own. Not with --sweep-list
186
- --yes do not ask before a load writes or a removal deletes: a
187
- removal asks last, once what it deletes and what the
188
- target runs as they go are said. Without it, a step
189
- with no terminal to answer the question \u2014 a CI step \u2014
190
- stops there, exit 2, and writes nothing
191
- --json emit what the panel would receive, every other line on
192
- stderr; a step that ends before its request, refused or
193
- with nothing to do, says "ended": true. Beside it, "step";
194
- "dataset" \u2014 its folder, its digest (sha256 of the files a load
195
- reads, the manifest less the verdict a verification writes
196
- into it) and its version \u2014 for extract, load and verify;
197
- "mapping", the file in the sas naming the records the loads
198
- into the target created, for load, verify and remove; per
199
- object, what the step counted ("objects"); how a load or a
200
- removal ended ("status"); verify's verdict, and a load's, per
201
- object ("verdict"); what a dry run or a
202
- removal's preview would be refused for ("refusals"), with the
203
- code of each ("refusalCodes"), as its line names it: a load
204
- would be refused (CODE): ..., a removal would be refused
205
- (CODE): ...; and what refused a load before it wrote \u2014 what
206
- runs as it writes, its purge, its checkpoint, its emails or
207
- its mute \u2014 or a removal
208
- before its first delete \u2014 what fires as it deletes, its mute
209
- or Production Guard \u2014 ("refused": {"code", "message"}), as
210
- its line names it: refused (CODE): ...
211
- --help this text
212
-
213
- The salt that makes pseudonyms repeatable is read from SANDFORGE_FROZEN_SALT,
214
- or else from --salt-file, and never made up here: an extraction without one is
215
- refused. The editor keeps its own in VS Code's secret storage; copy it from there
216
- with "SandForge: Copy Frozen Dataset Salt" to extract the same pseudonyms.
217
-
218
- The graph a selection or an extraction discovers is kept in the sas
219
- (discovery.json) and reused by the next one while the source's schema has not
220
- changed and a day has not gone by: each says "graph reused from <step>" or
221
- "rediscovered: <why>".
222
-
223
- Ctrl-C stops a step after the call under way, a load recorded in the sas with
224
- what it wrote, which remove takes back; a SIGTERM \u2014 a CI job cancelled or timed
225
- out \u2014 or a SIGHUP stops it the same way. Ctrl-C again ends it at once.
226
-
227
- Exit codes: 0 the step finished \u2014 a removal with nothing to take included, and a
228
- removal's preview once said, its refusals included \u2014, and verify's verdict is
229
- PASSED; 1 it failed or could not start, verify's verdict is FAILED, a dry run says
230
- the load would be refused, a load was refused before it wrote for what the target
231
- runs as it writes (AUTOMATION_NOT_ACCEPTED without --accept-automation), for its
232
- emails (EMAILS_NOT_ACCEPTED without --accept-emails, FROZEN_EMAILS_EXCEEDED) or for
233
- the data storage its records take past what the target has left
234
- (FROZEN_STORAGE_EXCEEDED: --pilot, or a smaller dataset), or a removal
235
- stopped before its first delete at what the target runs, without
236
- --accept-automation; 2 a bad command line, or a question with
237
- no terminal to answer it (give --yes); 3 verify's verdict is PARTIAL, a load
238
- completed with errors, the verification it runs after it was FAILED or PARTIAL, or
239
- the sweep of a reload did not take all it was asked to, or a removal left records
240
- of the load or its sweep did not take all it was asked to; 4 verify's verdict is
241
- UNSTABLE: no two readings agreed; 130 Ctrl-C stopped the step, 143 a SIGTERM, 129 a
242
- SIGHUP. A load is judged by its own report, which ends partial on a verification
243
- FAILED or PARTIAL; one UNSTABLE is said, and the verify step gives it a code.
244
- `,Zt=["select","extract","load","verify","remove","status"],Ao={words:1,switches:["--pilot","--reload","--dry-run","--write-encrypted","--mute-automation","--accept-automation","--include-changed","--accept-emails","--sweep","--sweep-list",...Ct,"--preview","--yes","--json",...Ie.switches],values:["--config","--source","--target","--author","--salt-file","--store","--max-total","--gone-first",...Ie.values]},Jt=1e6;function $o(e){let t;try{t=JSON.parse(be(e,"utf8"))}catch(o){process.stderr.write(`--gone-first: ${e} does not read: ${String(o)}
245
- `),process.exit(2)}return(!Array.isArray(t)||!t.every(o=>typeof o=="string"&&/^[A-Za-z0-9]{15}(?:[A-Za-z0-9]{3})?$/.test(o)))&&(process.stderr.write(`--gone-first: ${e} holds no JSON array of record ids.
246
- `),process.exit(2)),t}function ko(e){let t=e.slice(2);(t.includes("--help")||t.includes("-h")||t.length===0)&&(process.stdout.write(bo),process.exit(0));let o=f=>{let g=t.indexOf(f);return g>=0&&g+1<t.length?t[g+1]:void 0},n=t[0];Zt.includes(n)||(process.stderr.write(`The first word is the step: ${Zt.join(", ")} \u2014 not "${t[0]}".
247
- `),process.exit(2)),st(t,Ao);let s=o("--config");s||(process.stderr.write(`Missing --config. Run with --help.
248
- `),process.exit(2));let i=o("--source"),h=o("--target");(n==="select"||n==="extract")&&!i&&(process.stderr.write(`${n} reads the source org: give --source.
249
- `),process.exit(2)),(n==="load"||n==="verify"||n==="remove")&&!h&&(process.stderr.write(`${n} works on the target org: give --target.
250
- `),process.exit(2)),t.includes("--sweep")&&t.includes("--sweep-list")&&(process.stderr.write(`--sweep deletes and --sweep-list only lists: give one of them. Run with --help.
251
- `),process.exit(2)),t.includes("--sweep-list")&&n!=="remove"&&(process.stderr.write(`--sweep-list goes with remove${n==="load"?"; a reload lists what its sweep would take with --dry-run --sweep":""}. Run with --help.
252
- `),process.exit(2)),t.includes("--sweep")&&n!=="remove"&&!(n==="load"&&t.includes("--reload")&&!t.includes("--pilot"))&&(process.stderr.write(`--sweep goes with remove or load --reload${n==="load"&&t.includes("--pilot")?", and a pilot purges nothing":""}. Run with --help.
253
- `),process.exit(2)),t.includes("--include-changed")&&n!=="remove"&&!(n==="load"&&t.includes("--reload")&&t.includes("--sweep"))&&(process.stderr.write(`--include-changed goes with remove, or with load --reload --sweep, whose sweep then takes what changed since the loads it replaces. Run with --help.
254
- `),process.exit(2)),t.includes("--gone-first")&&!(n==="load"&&t.includes("--reload")&&t.includes("--dry-run"))&&(process.stderr.write(`--gone-first goes with load --reload --dry-run. Run with --help.
255
- `),process.exit(2));let r=o("--gone-first");t.includes("--gone-first")&&r===void 0&&(process.stderr.write(`--gone-first takes the file of the ids taken back first.
256
- `),process.exit(2)),t.includes("--write-encrypted")&&n!=="load"&&(process.stderr.write(`--write-encrypted goes with load. Run with --help.
257
- `),process.exit(2)),t.includes("--accept-emails")&&n!=="load"&&(process.stderr.write(`--accept-emails goes with load. Run with --help.
258
- `),process.exit(2)),t.includes("--mute-automation")&&n!=="load"&&n!=="remove"&&(process.stderr.write(`--mute-automation goes with load or remove. Run with --help.
259
- `),process.exit(2)),t.includes("--accept-automation")&&n!=="remove"&&n!=="load"&&(process.stderr.write(`--accept-automation goes with load or remove. Run with --help.
260
- `),process.exit(2)),t.includes(Ne)&&n!=="load"&&(process.stderr.write(`${Ne} goes with load. Run with --help.
261
- `),process.exit(2));let d=$t(t);t.includes("--preview")&&n!=="remove"&&(process.stderr.write(`--preview goes with remove${n==="load"?"; a load says what it would do with --dry-run":""}. Run with --help.
262
- `),process.exit(2)),t.includes("--preview")&&t.includes("--sweep-list")&&(process.stderr.write(`--preview deletes nothing, and --sweep-list lists what a sweep would take: give --preview without it, or with --sweep. Run with --help.
263
- `),process.exit(2));let a=jt(t);"refusal"in a&&(process.stderr.write(`${a.refusal} Run with --help.
264
- `),process.exit(2));let l;if(t.includes("--max-total")){let f=o("--max-total");l=Number(f),n!=="load"&&(process.stderr.write(`--max-total goes with load. Run with --help.
265
- `),process.exit(2)),(f===void 0||!/^\d+$/.test(f)||l<1||l>Jt)&&(process.stderr.write(`--max-total takes a whole number from 1 to ${Jt}, not "${f??""}".
266
- `),process.exit(2))}return{step:n,configPath:s,source:i,target:h,author:o("--author"),storePath:o("--store"),saltFile:o("--salt-file"),pilot:t.includes("--pilot"),reload:t.includes("--reload"),dryRun:t.includes("--dry-run"),writeEncrypted:t.includes("--write-encrypted"),muteAutomation:t.includes("--mute-automation"),acceptAutomation:t.includes("--accept-automation"),...d!==void 0?{checkpointFirst:d}:{},includeChanged:t.includes("--include-changed"),acceptEmails:t.includes("--accept-emails"),sweep:t.includes("--sweep"),sweepList:t.includes("--sweep-list"),...a,preview:t.includes("--preview"),...l!==void 0?{maxTotal:l}:{},...r!==void 0?{goneFirst:r}:{},yes:t.includes("--yes"),json:t.includes("--json")}}async function Ro(e){let o=(await e.query("SELECT Id, IsSandbox FROM Organization LIMIT 1")).records[0];if(!o)throw new Error("The org gave no Organization record.");if(o.IsSandbox)return{id:o.Id,orgType:"Sandbox"};try{let s=(await e.query("SELECT OrganizationType FROM Organization LIMIT 1")).records[0]?.OrganizationType;return typeof s=="string"&&s!==""?{id:o.Id,orgType:tt({isSandbox:!1,edition:s}),edition:s}:{id:o.Id,orgType:"Production"}}catch{return{id:o.Id,orgType:"Production"}}}async function Qt(e,t,o,n){let s=await at(e),i=Oe(s),h;try{h=await Ro(i)}catch(r){let d=r instanceof Error?r.message:String(r);throw new Error(`Could not read the Organization record of '${e}': ${d}`)}return t.set(h.id,{org:{id:h.id,alias:e,orgType:h.orgType,metadata:{apiVersion:"66.0",...h.edition?{edition:h.edition}:{}},username:s.username,instanceUrl:s.instanceUrl},credentials:{accessToken:s.accessToken,instanceUrl:s.instanceUrl}}),o?.set(h.id,i),n?.set(h.id,{session:s,typed:h}),h.id}var _={run:"load",done:"loaded",source:"the frozen dataset",recordedIn:"in this sas",remove:"`remove`",module:"frozen",again:"reload",againSubject:{purge:"reload",sweep:"reloadSweep"},maybeMasks:"the dataset's manifest does not say its extraction left out what it read masked, so they may hold masks such as ****1234; --write-encrypted writes them as the dataset holds them"};function qe(e){return!e||e.length===0?[]:[`kept: the platform does not delete them \u2014 ${e.map(({objectApiName:o,count:n})=>`${o} (${n})`).join(", ")}`]}function Yt(e,t,o=_){let n=(e??[]).filter(i=>i.reason==="may-hold-masks");if(n.length===0)return[];let s=n.map(({objectApiName:i,field:h,affectedRecords:r})=>`${i}.${h} (${r})`).join(", ");return[`${t} out, encrypted in the target: ${s} \u2014 ${o.maybeMasks}`]}function So(e,t){let o=e==="token"?"each record its own, from the token the value carries":`each record its own, its rank appended: the field is ${e==="unique"?"unique in the target":"the record name"}`;return t===void 0?o:`${o} (first: "${t}")`}function Ve(e){return e.created.reduce((t,o)=>t+o.count,0)}function Oo(e){return{...e.includeChanged?{includeChanged:!0}:{},...e.sweep?{sweep:!0}:{},...e.sweepLate?{sweepLate:!0}:{},...e.sweepUntied?{sweepUntied:!0}:{},...e.muteAutomation?{muteAutomation:!0}:{}}}var Fo={removal:{heading:"removal",writer:"this removal",verb:"remove"},reload:{heading:"reload",writer:"this reload's purge",verb:"reload"},reloadSweep:{heading:"reload",writer:"this reload's sweep",verb:"reload"},replayAgain:{heading:"replay",writer:"this replay's purge",verb:"replay again"},replayAgainSweep:{heading:"replay",writer:"this replay's sweep",verb:"replay again"}};function _e({read:e,steps:t,mute:o},n,s="removal",i){let h=o?Y(o.muted,n).map(l=>` ${l}`):[];if(!("objects"in e)){let l=Fo[s],f=s==="reload"||s==="replayAgain",g=`${l.writer}${f&&i?" and its sweep":""}`;return{lines:[`${l.heading} automation: what ${n} runs could not be read: ${e.unread}`,...h],refusal:`What ${n} runs as ${g} writes could not be read (${e.unread}), so what fires as the records go is not known. Nothing was written or deleted. Add --accept-automation to ${l.verb} all the same, or turn that automation off in ${n} first.`}}let r=o?.automation??e,d=i?ot(t,i.delete??[]):t,a=gt(r,n,{steps:t,...i?{sweep:i}:{},assign:ht(r,nt(r,d)),mayMute:o===void 0&&je("--mute-automation"),subject:s});return{lines:[...mt(e,n,t,s,i),...h],...a!==void 0?{refusal:a}:{}}}function Eo(e,t,o=_){let n=Ve(e),s=e.earlier?`a ${o.run} before the last one, whose records the ${o.run}s after it left in place,`:`the last ${o.run}`,i=`a removal deletes the ${n} record(s) it created, children first:`;return e.removed&&n===0?i=`its records were removed on ${e.removed.removedAt}, and none is left to remove`:n===0&&(e.keptByThePlatform?.length??0)>0?i="it created no record a removal takes":e.removed&&(i=`the removal of ${e.removed.removedAt} left ${n} of the records it created, and a removal deletes those, children first:`),[`${s} wrote to ${t} at ${e.loadedAt}; ${i}`,...e.created.map(h=>` ${h.objectApiName}: ${h.count}`),`${e.linked} record(s) it linked to or reused stay`,...qe(e.keptByThePlatform)]}function To(e,t){return e.recorded&&(Ve(e)>0||(t?.delete??[]).length>0)}function zo(e){return[e.deleted>0?`${e.deleted} deleted`:"",e.alreadyGone>0?`${e.alreadyGone} already gone`:"",e.keptChanged>0?`${e.keptChanged} kept, changed since the load`:"",e.keptDependents>0?`${e.keptDependents} kept for records that stay`+(e.heldBy.length>0?` (${e.heldBy.join(", ")})`:""):"",e.refused>0?`${e.refused} refused`:"",(e.notReached??0)>0?`${e.notReached} not reached`:""].filter(Boolean).join(", ")}function Lo(e,t=_){let o=e.count>e.names.length?", \u2026":"";return`${e.count} file(s) attached to them stay in the org, as the ${t.run} did not create them: ${e.names.join(", ")}${o}`}function eo(e){return`graph: ${e.objects} object(s) at a cap of ${e.maxNodes}`+(e.objects>e.maxNodes?" (raised for the parents their records cannot be written without)":"")+(e.truncated?" \u2014 TRUNCATED: objects further out were not read":"")}function to(e){return"reusedFrom"in e?`graph reused from ${e.reusedFrom} (discovered ${e.discoveredAt}): the source's schema has not changed since`:`rediscovered: ${e.rediscovered}`}function Co(e){switch(e.phase){case"discovery":return` discovery: ${e.objects??0} object(s) reached`;case"axis":return` listing the values of axis ${e.axis??"?"}\u2026`;case"combination":return` combination ${e.index??"?"}/${e.of??"?"}: ${e.combinationKey??"?"}`;case"candidate":return` candidate ${e.candidate??"?"}/${e.candidates??"?"} of ${e.combinationKey??"?"}: measuring its own records\u2026`;case"measure":return` measuring the ${e.roots??0} root(s) kept, together\u2026`}}function jo(e){let t=e.reason==="timeout"?"its time ran out":"it was cancelled",o=e.during==="axes"?"while it listed the axis values":e.during==="measure"?"while it measured the roots it kept":`while it probed ${e.combinationKey??"?"}`+(e.candidate!==void 0?`, candidate ${e.candidate} of ${e.candidates??"?"}`:"");return[`STOPPED: ${t} ${o}; the combinations decided before are kept`,...e.notProbed.length>0?[` never probed: ${e.notProbed.join(", ")}`]:[]]}var No=new Set(["NO_LOAD","ALREADY_REMOVED","NOTHING_TO_REMOVE"]),lo="REMOVAL_DECLINED",oo=["MUTE_PRODUCTION","MUTE_NO_RIGHT","MUTE_FAILED"],Io=new Map([["frozen:load:error",new Set(["EMAILS_NOT_ACCEPTED","FROZEN_EMAILS_EXCEEDED",Ce,"FROZEN_STORAGE_EXCEEDED","AUTOMATION_NOT_ACCEPTED",ce.code,...oo])],["frozen:remove:error",new Set(["AUTOMATION_NOT_ACCEPTED","GUARD_BLOCKED","GUARD_DECLINED",ce.code,...oo])]]);function We(e){let t=e.payload?.code,o=Io.get(String(e.type??""));if(!(typeof t!="string"||o?.has(t)!==!0))return{code:t,message:String(e.payload?.message??"")}}function Ge(e){let t=String(e.type??"");if(!t.endsWith(":error")||t==="frozen:remove:automation:error")return!1;let o=String(e.payload?.code);return t==="frozen:remove:error"&&o===lo?!1:!((t==="frozen:remove:error"||t==="frozen:remove:preview:error")&&No.has(o))}var no={passed:0,partial:3,unstable:4,failed:1};function Do(e,t,o){return async(n,s)=>{let i=Date.parse(s?.first??""),h=Math.max(i,Date.parse(s?.last??""));return!Number.isFinite(i)||!Number.isFinite(h)?[]:[...(await Nt({organizationId:n,alias:e,span:{from:i,to:h},own:{ids:[]},...t!==void 0?{journalDir:t}:{}})).map(({ids:d})=>({ids:d,from:i,to:h})),...qt(Kt(t??ne(),n),{sasMark:o,own:[]})]}}function Po(e,t){return ut(t.map(o=>{let n=o.payload??{};if(e==="verify"&&o.type==="frozen:verify:result"){let s=String(n.verdict?.status??"");return Object.prototype.hasOwnProperty.call(no,s)?no[s]:1}if(e==="load"&&o.type==="frozen:load:response"){let s=n.report,i=n.replay?.summary.records.refusedBeforeWrite;return s?.status==="completed"&&(s.sweeps??[]).every(h=>h.result.status==="success")&&(i??0)===0?0:3}return e==="remove"&&o.type==="frozen:remove:response"?n.result?.status==="success"?0:3:0}))}function xo(e,t){return` data storage: about ${ee(e.estimateMB)} MB`+(e.automationMB!==void 0&&e.automationMB>0?`, about ${ee(e.automationMB)} MB of it for what the target's automation creates under them,`:"")+` of the ${ee(e.remainingMB)} MB ${t} has left of ${ee(e.maxMB)} MB`+(e.freedMB!==void 0?`, and the reload's purge frees about ${ee(e.freedMB)} MB first`:"")}function ro(e,t){return Tt(e.verdict==="unread"?{verdict:"unread",estimate:e.estimate,unread:e.unread??"not said"}:{verdict:e.verdict,estimate:e.estimate,remaining:e.remaining??0,max:e.max??0},t)}function Mo(e){return(e.filter(o=>o.type==="frozen:remove:response").at(-1)?.payload?.result?.objects??[]).some(o=>o.deleted+o.alreadyGone>0)}function we(e,t){if(wt()!==void 0)return xe(e);let o=t.remove.replace(/`/g,"");return e==="--sweep"||e==="--sweep-list"?`${o} ${e}`:`${o} --sweep ${e}`}function _o(e,t=_){if(!e||e.found.length===0)return[];let o=e.found.reduce((l,f)=>l+f.count,0),n=e.found.some(l=>l.overBound)?" or more":"",s=l=>e.found.reduce((f,g)=>f+(g.classes?l(g.classes):0),0),i=s(l=>l.made+l.madeOver),h=s(l=>l.late),r=s(l=>l.untied),d=e.found.filter(l=>l.overBound).map(l=>l.objectApiName),a=[...i>0?[`${we("--sweep",t)} takes the ${i} tied to the ${t.run}`]:[],...h>0?[`${we("--sweep-late",t)} takes the ${h} made late`]:[],...r>0?[e.untied?.refusal!==void 0?`the ${r} tied to nothing of the ${t.run} now stay: --sweep-untied is refused (${e.untied.refusal})`:`${we("--sweep-untied",t)} takes the ${r} tied to nothing of the ${t.run} now`]:[],...d.length>0?[`no sweep takes those of ${d.join(", ")}, past its bound`]:[]];return[`not swept: ${o}${n} record(s) the ${t.run}'s user created in its window stay, what the target's automation made for the ${t.run} likely: `+e.found.map(l=>`${l.objectApiName}: ${l.count}`).join(", "),...a.map(l=>` ${l}`),` ${we("--sweep-list",t)} names them first: a record made by hand as that user in the ${t.run}'s window reads as the automation's, so check the names before a sweep`]}function Bo(e,t={},o=_){let n=String(e.type??""),s=e.payload??{},i=n.replace(/^frozen:/,`${o.module}:`),h=o===_?"load":"run";if((n==="frozen:remove:error"||n==="frozen:remove:preview:error")&&!Ge(e))return[`nothing to remove: ${String(s.message??"")}`];if(n==="frozen:remove:error"&&!Ge(e))return[String(s.message??"")];if(n==="frozen:remove:automation:error")return[];if(n.endsWith(":error")){let r=n==="frozen:load:error"?s.sweeps??[]:[],d=n==="frozen:load:error"?s.emails:void 0,a=n==="frozen:load:error"?s.automation:void 0,l=n==="frozen:load:error"?s.mutedAutomation:void 0,f=We(e);return[...f?[]:[`! ${i}: ${String(s.message??"")}${s.code?` [${String(s.code)}]`:""}`],...a?ge(a,"the target"):[],...d?me(d,"the target"):[],...l?Y(l,"the target"):[],...r.length>0?[`before the ${o.run} ended, its sweep had already done this:`]:[],...r.flatMap(({loadedAt:g,result:y})=>[`sweep of the ${o.run} of ${g}:`,...se(y)]),...f?[oe(f)]:[]]}switch(n){case"frozen:select:progress":return[Co(s)];case"frozen:select:response":{let r=s.selection;return[`selected ${r.combinations.length} root(s): ${r.combinations.map(d=>d.combinationKey).join(", ")}`,...r.uncovered.map(d=>` uncovered ${d.combinationKey}: ${d.reason}`),...r.stopped?jo(r.stopped):[],...r.discovery?[to(r.discovery)]:[],...r.graph?[eo(r.graph)]:[],`volumetry ${r.volumetry.total} / ${r.volumetry.budgetMax} record(s)`+(r.volumetry.summed?" \u2014 each kept root's own records added up: they were not measured together":""),...Object.entries(r.volumetry.measured).filter(([,d])=>d>0).map(([d,a])=>` ${d}: ${a}`)]}case"frozen:control:result":{let r=s.report;return[`non-reidentification control: ${r.passed?"PASSED":"FAILED"}`,...r.checks.map(d=>` ${d.passed?"ok ":"FAIL"} ${d.name}`+(d.violations.length>0?` (${d.violations.length} violation(s))`:""))]}case"frozen:extract:response":{let r=s.manifest,d=s.discovery;return[`frozen ${String(s.recordCount)} record(s) as version ${r.version} in ${String(s.datasetDir)}`,...d?[to(d)]:[],...r.coverage?[eo(r.coverage)]:[],...r.coverage&&r.coverage.unboundedObjects.length>0?[`read without the time bound: ${r.coverage.unboundedObjects.join(", ")}`]:[],...(r.coverage?.leftToThePlatform??[]).map(a=>`${a.objectApiName}: ${a.note}`),...(r.coverage?.exclusionCosts??[]).map(a=>`${a.objectApiName}: ${a.note}`),...(r.coverage?.requiredLeftEmpty??[]).length>0?[`required in the source and left empty by the rules \u2014 a load will ask a value for each: ${(r.coverage?.requiredLeftEmpty??[]).join(", ")}`]:[],...(r.coverage?.keptWithoutARule??[]).length>0?["kept without a rule, the platform's own words: "+(r.coverage?.keptWithoutARule??[]).join(", ")]:[],...(r.coverage?.encryptedNotKept??[]).length>0?["not kept, encrypted and read masked: the user the source is read as lacks View Encrypted Data, and the masks are not copied: "+(r.coverage?.encryptedNotKept??[]).join(", ")]:[],...Object.entries(r.volumetry.measured).filter(([,a])=>a>0).map(([a,l])=>` ${a}: ${l}`)]}case"frozen:load:response":{let r=s.report,d=[`${o.run}: ${r.status} in ${r.durationMs}ms \u2014 ${r.alignment.excludedObjects.length} object(s) excluded, ${r.alignment.removals.length} field removal(s), ${r.alignment.recordTypeIssues.length} record type issue(s), ${r.placeholders.length} placeholder(s)`];for(let m of r.alignment.excludedObjects)d.push(` ${m.objectApiName}: not ${o.done} \u2014 ${m.reason}`);d.push(...Yt(r.alignment.removals,"left",o));for(let m of r.perObject){let S=m.writtenByThePlatform??0;d.push(` ${m.objectApiName}: ${m.inserted} inserted, ${m.reused} reused`+(S>0?` (${S} written by the platform with ${Fe(m.objectApiName)})`:"")+`, ${m.skippedDuplicates.length} duplicate(s), ${m.failed.length} failed of ${m.fromFiles}`);let j=m.failed[0];j&&d.push(` first refusal: ${j.errors?.[0]??j.error??"?"}`);let T=m.sentAgainForALock,K=T&&Ee("record(s)",{refused:T.rows,sentAgain:T.rows,written:T.written,stillLocked:T.stillLocked,notSentAgain:0});K&&d.push(` ${K}`)}for(let m of[...r.leftToThePlatform??[],...r.untypedFeedItems??[],...r.heldForExcludedParents??[],...r.quotesLeftUnsynced??[],...r.keysLeftEmpty??[]])d.push(` ${m.objectApiName}: ${m.note}`);let a=r.perObject.filter(m=>(m.writtenWithoutFields?.fields.length??0)>0);if(a.length>0){d.push(`written again without a field a validation rule or a restricted picklist refused (${a.length} object(s)):`);for(let{objectApiName:m,writtenWithoutFields:S}of a)for(let{field:j,refusedBy:T,reason:K,rows:Z,replacedWith:J}of S?.fields??[]){let I=T==="restricted-picklist"?"a restricted picklist refused its value":"a validation rule refused it",U=J===void 0?"":` \u2014 written with "${J}", as its picklist rule declares`;d.push(` ${m}.${j} ${Z} record(s) \u2014 ${I}${U} \u2014 ${K}`)}}d.push(`pass 2: ${r.pass2.resolved} resolved, ${r.pass2.unresolved.length} unresolved`);for(let m of r.pass2.unresolved.slice(0,5))d.push(` ${m.objectApiName}.${m.field}: ${m.detail}`);let l=r.personContact,f=l?.sent??[];if(l&&l.restored+f.length+l.unresolved.length>0){d.push(`person contacts: ${l.restored} linked, ${f.length} sent as contacts of their own, ${l.unresolved.length} not linked`);for(let m of f.slice(0,5))d.push(` ${m.contactReferenceId} sent: ${m.detail}`);for(let m of l.unresolved.slice(0,5))d.push(` ${m.contactReferenceId}: ${m.detail}`)}if(r.statuses&&r.statuses.restored+r.statuses.refused.length>0){d.push(`statuses applied after insert: ${r.statuses.restored}, refused ${r.statuses.refused.length}`);for(let m of r.statuses.refused.slice(0,5))d.push(` ${m.objectApiName} \u2192 ${m.status}: ${m.detail}`)}let g=m=>Object.values(m).reduce((S,j)=>S+j,0),y=g(r.purge.deleted),L=g(r.purge.deactivated??{});if(y+L+r.purge.failures.length>0){d.push(`purge of earlier ${o.run}s: ${y} deleted, ${L} deactivated, ${r.purge.failures.length} failed`);for(let m of r.purge.failures.slice(0,5))d.push(` ${m.objectApiName}: ${m.errors[0]??"?"}`)}for(let[m,S]of Object.entries(r.purge.cameAlong??{}))d.push(` ${m}: took along ${S.count} record(s) the ${o.run}s did not write that came with their records, made as they wrote: ${S.objects.join(", ")}`);let B=Object.entries(r.purge.leftUnrecorded??{});if(B.length>0){d.push("left in place, of a load recorded before loads kept what they created \u2014 it may have linked them:");for(let[m,S]of B)d.push(` ${m}: ${S}`)}let N=Object.entries(r.purge.keptByThePlatform??{});if(N.length>0){d.push("kept by the purge, the platform does not delete them:");for(let[m,S]of N)d.push(` ${m}: ${S}`)}let E=(r.sentAgainForALock??[]).flatMap(({objectApiName:m,write:S,rows:j,written:T,stillLocked:K})=>{let Z=Ee(S==="delete"?"purge delete(s)":"update(s)",{refused:j,sentAgain:j,written:T,stillLocked:K,notSentAgain:0},S==="delete"?"deleted":"written");return Z?[` ${m}: ${Z}`]:[]});E.length>0&&(d.push("sent again for a record lock, of the updates and of the purge's deletes:"),d.push(...E));for(let m of s.report.sweeps??[]){d.push(`sweep of the ${o.run} of ${m.loadedAt}:`,...se(m.result));let S=m.result.objects.reduce((j,T)=>j+T.keptChanged,0);S>0&&d.push(` ${S} record(s) kept, changed since that ${o.run}: `+(o===_?"load --reload --sweep --include-changed, or remove --sweep --include-changed, ":`${o.remove} --sweep --include-changed `)+"takes them")}let M=s.report.mutedAutomation;M&&d.push(...Y(M,"the target"));let u=s.report.automation;u&&d.push(...ge(u,"the target"));let $=s.report.emails;$&&d.push(...me($,"the target"));let C=s.report.apiRequests;return C&&d.push(ro(C,"the target")),d.push(...co(s.report.recordTypesGiven,!1)),d}case"frozen:load:preview:response":{let r=s.plan,d=u=>r.perObject.reduce(($,C)=>$+u(C),0),a=[`dry run${r.mode.pilot?" (pilot)":""}${r.mode.reload?` (${o.again})`:""}: ${d(u=>u.toInsert)} record(s) to insert, ${d(u=>u.reusedByKeys+u.reusedFromCatalog+(u.writtenByThePlatform??0))} to link, ${d(u=>u.notSent)} not sent`+(r.mode.reload?`, ${d(u=>u.toPurge)} to purge and ${d(u=>u.toDeactivate)} to deactivate of ${r.earlierLoads} earlier ${o.run}(s)`:"")+" \u2014 nothing written"];for(let u of r.perObject){let $=[`${u.toInsert} to insert`,u.reusedByKeys>0?`${u.reusedByKeys} found by identity keys`:"",u.reusedFromCatalog>0?`${u.reusedFromCatalog} found in the catalog`:"",(u.writtenByThePlatform??0)>0?`${u.writtenByThePlatform} to link (written by the platform with ${Fe(u.objectApiName)})`:"",u.fieldsDropped>0?`${u.fieldsDropped} field(s) dropped`:"",u.picklistsRewritten>0?`${u.picklistsRewritten} picklist value(s) rewritten`:"",u.notSent>0?`${u.notSent} not sent`:"",u.toPurge>0?`${u.toPurge} to purge`:"",u.toDeactivate>0?`${u.toDeactivate} to deactivate`:""].filter(Boolean);a.push(` ${u.objectApiName}: ${$.join(", ")} of ${u.fromFiles}`)}for(let u of r.excludedObjects)a.push(` ${u.objectApiName}: not ${o.done} \u2014 ${u.reason}`);a.push(...Yt(r.removals,"would leave",o));for(let u of[...r.heldForExcludedParents??[],...r.quotesLeftUnsynced??[],...r.keysLeftEmpty??[]])a.push(` ${u.objectApiName}: ${u.note}`);for(let u of r.placeholders)a.push(`placeholder for ${u.objectApiName}.${u.field}: ${u.affectedRecords} record(s)`);for(let u of r.requiredDefaults)a.push(`default for ${u.objectApiName}.${u.field}: ${u.affectedRecords} record(s)`+(u.perRecord?`, ${So(u.perRecord,u.example)}`:""));r.personContacts>0&&a.push(`${r.personContacts} person account contact(s) go in with their account, not counted above`);let l=Object.entries(r.leftUnrecorded??{});if(l.length>0){a.push("left in place, of a load recorded before loads kept what they created \u2014 it may have linked them:");for(let[u,$]of l)a.push(` ${u}: ${$}`)}let f=Object.entries(r.keptByThePlatform??{});if(f.length>0){a.push("left in place by the purge, the platform does not delete them:");for(let[u,$]of f)a.push(` ${u}: ${$}`)}let g=u=>` ${u.name}${u.field?` (${u.field})`:""}${u.message?` \u2014 ${u.message}`:""}`,y=r.perObject.filter(u=>(u.validationRules?.length??0)>0);for(let u of y){a.push(`${u.objectApiName}: ${u.validationRules?.length??0} active validation rule(s) of the target, which a preview cannot evaluate \u2014 a record one of them refuses is counted to insert:`);for(let $ of u.validationRules??[])a.push(g($))}for(let u of r.perObject){let $=u.lookupFilters??[];$.length!==0&&a.push(`${u.objectApiName}: ${$.length} lookup filter(s) of the target, which a preview cannot check \u2014 a record whose lookup it refuses is refused, and what hangs from it: `+$.map(C=>`${C.field} (${C.referenceTo.join(" or ")}, ${C.records} record(s))`).join(", "))}for(let u of r.perObject){let $=u.validationRulesOnChange??[];$.length!==0&&a.push(`${u.objectApiName}: ${$.length} rule(s) left out \u2014 their formula holds only on a change of a record (ISCHANGED, PRIORVALUE, NOT(ISNEW())), which an insert never is: `+$.join(", "))}let L=new Map(r.placeholders.filter(u=>(u.validationRules?.length??0)>0).map(u=>[u.placeholderObjectApiName,u.validationRules??[]]));for(let[u,$]of L){a.push(`placeholder of ${u}: ${$.length} active validation rule(s) of the target, which a preview cannot evaluate \u2014 a placeholder one of them refuses stops the load:`);for(let C of $)a.push(g(C))}r.validationRulesUnread&&a.push(`the target's validation rules could not be listed (${r.validationRulesUnread}): any of them may refuse a record counted to insert`);let B=s.plan.automation;B&&a.push(...ge(B,"the target"));let N=s.plan.emails;N&&a.push(...me(N,"the target"));let E=s.plan.apiRequests;E&&a.push(ro(E,"the target"));let M=s.plan.storage;return M&&a.push(xo(M,"the target")),a}case"frozen:verify:result":{let r=s.verdict;return[`verification: ${r.status.toUpperCase()}`,...r.checks.map(d=>{let a=Ko(d,o);return` ${d.passed?"ok ":"FAIL"} ${a.name}: ${a.detail}`})]}case"frozen:remove:response":{let r=s.result,d=[...new Set(r.objects.flatMap(l=>l.unchecked))],a=r.sweep!==void 0&&r.objects.length===0;return[...r.sweep?se(r.sweep):[],...(r.otherLoadSweeps??[]).flatMap(({loadedAt:l,result:f})=>[`sweep of the ${o.run} of ${l}:`,...se(f)]),...a?[]:[`removal: ${r.status.toUpperCase()}`+(r.leftBy?` \u2014 of what the removal of ${r.leftBy} left`:"")],...r.objects.flatMap(l=>[` ${l.objectApiName}: ${zo(l)||"nothing"} of ${l.planned}${Pe(l)}`,...zt(l,h),...l.reasons.map(f=>` ${f}`),...l.filesLeft&&l.filesLeft.count>0?[` ${Lo(l.filesLeft,o)}`]:[]]),...d.length>0?[`not checked, deleted with their parent: ${d.join(", ")}`]:[],...qe(r.keptByThePlatform),...Lt(r.objects,{sweep:r.sweep!==void 0}),...r.mutedAutomation?Y(r.mutedAutomation,"the target"):[]]}case"frozen:remove:sweep:response":{let r=s.loads;if(r)return r.flatMap(({loadedAt:a,listing:l})=>[`sweep of the ${o.run} of ${a}:`,...pe(l,"the target org",t,!0)]);let d=s.otherLoads??[];return d.length>0?[{loadedAt:String(s.loadedAt),listing:s.listing},...d].flatMap(({loadedAt:a,listing:l})=>[`sweep of the ${o.run} of ${a}:`,...pe(l,"the target org",t,!0)]):pe(s.listing,"the target org",t,!0)}case"frozen:remove:preview:response":return Wo(s.preview,o);case"frozen:status:response":return[JSON.stringify(s.status,null,2)];default:return[]}}var Uo="not read by a preview: what hangs from the records, which a removal reads at each object's turn \u2014 a record kept for records that stay is counted with those to delete \u2014 nor what the target's automation does as they go";function Wo(e,t=_){let o=i=>e.userNames[i]??i,n=["preview: what a removal would do; nothing was deleted"+(e.leftBy?` \u2014 of what the removal of ${e.leftBy} left`:"")];for(let i of e.objects){let h=[i.toDelete>0?`${i.toDelete} to delete`:"",e.includeChanged&&i.changedSince>0?`${i.changedSince} of them changed since the ${t.run}`:"",i.alreadyGone>0?`${i.alreadyGone} gone already`:"",i.notVisible>0?`${i.notVisible} not visible`:"",i.keptChanged>0?`${i.keptChanged} kept, changed since the ${t.run}`:"",i.undeletable>0?`${i.undeletable} left, the user may not delete them`:"",i.unread>0?`${i.unread} left, not read`:""].filter(Boolean);n.push(` ${i.objectApiName}: ${h.join(", ")||"nothing"} of ${i.planned}${Pe(i)}`);let r=Object.entries(i.changedBy).sort((d,a)=>a[1]-d[1]);r.length>0&&n.push(` last changed by: ${r.map(([d,a])=>`${o(d)} ${a}`).join(" \xB7 ")}`);for(let d of i.reasons)n.push(` ${d}`)}n.push(...qe(e.keptByThePlatform));let s=e.refusalCodes;return e.refusals.forEach((i,h)=>{n.push(s?.length===e.refusals.length?le({code:s[h],message:i},"a removal"):`a removal would be refused: ${i}`)}),n.push(Uo),n}async function Go(e){let t=V(e,"manifest.json");if(Ue(t))try{let o=await Bt(e),{version:n}=JSON.parse(be(t,"utf8"));return{dir:e,digest:o,...typeof n=="string"?{version:n}:{}}}catch{return}}function qo(e,t){let o=V(e,Mt(t)),n=V(e,"referenceid-mapping.json");return!Ue(o)&&Ue(n)?n:o}function so(e){return{status:e.status.toUpperCase(),objects:(e.objects??[]).map(({status:t,...o})=>({...o,verdict:t==="passed"?"PASSED":"FAILED"}))}}async function Vo(e,t,o){let n=a=>t.filter(l=>l.type===a).at(-1)?.payload,s=o.targetOrgId?qo(o.sasDir,o.targetOrgId):void 0,i={tool:"sandforge-frozen",step:e,posted:t},h=[],r=[],d=async a=>{if(a===void 0)return;let l=await Go(a);l&&(i.dataset=l)};switch(e){case"extract":{let a=n("frozen:extract:response");if(!a)break;await d(typeof a.datasetDir=="string"?a.datasetDir:o.datasetDir);let l=a.manifest?.volumetry?.measured??{};i.objects=Object.entries(l).filter(([,f])=>f>0).map(([f,g])=>({objectApiName:f,records:g}));break}case"load":{await d(o.datasetDir);let a=n("frozen:load:response")?.report,l=n("frozen:load:preview:response")?.plan,f=a?a.recordTypesGiven:l?.recordTypesGiven;f&&(i.recordTypesGiven=f),a?(i.mapping=a.mappingPath,i.objects=a.perObject.map(y=>({objectApiName:y.objectApiName,fromFiles:y.fromFiles,inserted:y.inserted,reused:y.reused,duplicates:y.skippedDuplicates.length,failed:y.failed.length}))):l&&(s&&(i.mapping=s),i.objects=l.perObject.map(y=>({objectApiName:y.objectApiName,fromFiles:y.fromFiles,toInsert:y.toInsert,toLink:y.reusedByKeys+y.reusedFromCatalog+(y.writtenByThePlatform??0),notSent:y.notSent,toPurge:y.toPurge,toDeactivate:y.toDeactivate}))),a&&(i.status=a.status),!a&&n("frozen:load:error")?.code==="LOAD_CANCELLED"&&(i.status="cancelled",s&&(i.mapping=s));let g=n("frozen:verify:result")?.verdict;g&&(i.verdict=so(g));break}case"verify":{let a=n("frozen:verify:result")?.verdict;await d(a?.manifestPath?yo(a.manifestPath):o.datasetDir),s&&(i.mapping=s),a&&(i.verdict=so(a));break}case"remove":{s&&(i.mapping=s);let a=n("frozen:remove:response")?.result,l=n("frozen:remove:preview:response")?.preview;a?(i.status=a.status,a.mutedAutomation&&(i.mutedAutomation=a.mutedAutomation),i.objects=a.objects.map(f=>({objectApiName:f.objectApiName,planned:f.planned,deleted:f.deleted,alreadyGone:f.alreadyGone,keptChanged:f.keptChanged,keptDependents:f.keptDependents,refused:f.refused,notReached:f.notReached??0,notVisible:f.notVisible??0,...f.tookAlong?{tookAlong:f.tookAlong}:{},...f.cameAlong?{cameAlong:f.cameAlong}:{}})),i.includeChanged=a.includeChanged):l&&(i.preview=!0,i.includeChanged=l.includeChanged,i.objects=l.objects.map(f=>({objectApiName:f.objectApiName,planned:f.planned,toDelete:f.toDelete,alreadyGone:f.alreadyGone,changedSince:f.changedSince,keptChanged:f.keptChanged,undeletable:f.undeletable,notVisible:f.notVisible,unread:f.unread})),h.push(...l.refusals),l.refusalCodes?.length===l.refusals.length&&r.push(...l.refusalCodes));break}}return h.push(...o.refusals??[]),o.refusalCodes?.length===(o.refusals??[]).length&&r.push(...o.refusalCodes??[]),h.length>0&&(i.refusals=h),h.length>0&&r.length===h.length&&(i.refusalCodes=r),o.mute&&Object.assign(i,o.mute),o.checkpoint&&(i.checkpoint=o.checkpoint),i}function Ko(e,t){return t===_?e:{name:e.name==="load"?t.run:e.name,detail:e.detail.replace(/\bThe load\b/g,`The ${t.run}`).replace(/\bthe load\b/g,`the ${t.run}`).replace(/\bnot loaded\b/g,`not ${t.done}`).replace(/\bnot loadable\b/g,`not ${t.run}able`)}}async function Ho(e=process.argv){await Xo(ko(e))}async function Xo(e,t){let o=Date.now(),n=c=>{process[e.json?"stderr":"stdout"].write(`${c}
267
- `)},s=t?.words??_,i=t?{}:JSON.parse(be(e.configPath??"","utf8")),h=t?t.folder.dir:typeof i.sasDir=="string"?i.sasDir:V(vo(),".sandforge-sas");t||go(h,{recursive:!0});let r=yt(t?t.auditStore:e.storePath??V(h,"cli-store.json")),d=new Map,a=new Map,l=new Map,f=e.source?await Qt(e.source,d):void 0,g=e.target?await Qt(e.target,d,a,l):void 0,y=[],L=!1,B=!1,N=new Ht({log:()=>{},broker:{postToWebview:c=>{if(c.type==="frozen:load:progress")return;if(t&&String(c.type).endsWith(":error")&&c.payload){let w=c.payload.code;c.payload.message=t.reword(typeof w=="string"?w:void 0,String(c.payload.message??""),c.payload)}y.push(c),Ge(c)&&(L=!0);let p=t?.refusalOf(c);if(p&&(F??=p,I.push(p)),B)return;let v=p?[oe(p)]:Bo(c,e,s);for(let w of t?t.lines(c,v):v)n(w)}},orgManager:{getOrg:c=>d.get(c)?.org},orgRegistry:{getCredentials:async c=>d.get(c)?.credentials},configStore:r,infraServices:{productionGuard:Dt(n,e.target??e.source??"the org"),piiDetector:new lt},nextId:()=>`cli-${Date.now()}-${Math.random().toString(36).slice(2,8)}`});t&&N.setReplayStores(t.stores);let E=g?a.get(g):void 0,M=g?l.get(g):void 0,u=e.checkpointFirst&&M?kt({module:t?"replay":"frozen",operationId:`sandforge-frozen-load-${o}`,request:e.checkpointFirst,session:M.session,org:{id:M.typed.id,orgType:M.typed.orgType,...M.typed.edition!==void 0?{edition:M.typed.edition}:{}},connect:Oe,journalDir:ne(),say:n}):void 0;E&&N.setTargetAutomation(re(E)),N.setMuteOffered(je("--mute-automation")),N.setSaltKeeper(Wt(process.env,e.saltFile)),e.target&&N.setOtherModuleRuns(Do(e.target,void 0,Me(h)));let $=new Xt;N.setRegistry($);let C,m,S=!1,j=!1,T,Z=it(c=>{if(T=c,process.stderr.write(`
268
- interrupted: the ${e.step==="load"?s.run:e.step} stops after the call under way, and says what it wrote (Ctrl-C again ends it at once)
269
- `),m){m.abort();return}for(let p of $.getRunning())$.abort(p.operationId);C&&$.cancelBeforeStart(C),(!C||j)&&process.exit(ue(c))}),J=t?void 0:typeof i.datasetDir=="string"?i.datasetDir:V(h,"dataset"),I=[],U=c=>{let p=t?{code:c.code,message:t.reword(c.code,c.message)}:c;I.push(p),n(le(p,`a ${s.run}`))},G=c=>{if(!t)return{};let{organizationId:p,checkpointId:v,config:w}=t.request;return c==="load"?{replay:t.request}:c==="verify"?{replay:{organizationId:p,checkpointId:v,...w?{config:w}:{}}}:{replay:{organizationId:p,checkpointId:v}}},Ae=[],F,He=!1,H,X,Q,$e=async(c,p=Number(process.exitCode??0))=>{if(!e.json)return;let v=[...I,...Ae],w=await Vo(e.step,y,{...J!==void 0?{datasetDir:J}:{},sasDir:h,...g?{targetOrgId:g}:{},...v.length>0?{refusals:v.map(({message:A})=>A),refusalCodes:v.map(({code:A})=>A)}:{},...H?{mute:H}:{},...X?{checkpoint:X}:{}}),b=t?{...t.answer(w,{exit:p,...c?{ended:c}:{},...F?{refused:F}:{},...g?{targetOrgId:g}:{}}),...Q?{notSwept:Q}:{}}:{...w,...Q?{notSwept:Q}:{},...F?{refused:F}:{},...c?{ended:c}:{}};process.stdout.write(`${JSON.stringify(b,null,2)}
270
- `)},D=async(c,p)=>{let v=`cli-${c}-${Date.now()}`;C=v;try{return await N.handle({id:v,type:c,payload:p})}finally{C=void 0}},Xe;try{Xe=await ho()}finally{Z()}if(Xe==="ended"&&!T){L&&(process.exitCode=1),await $e(!0);return}if(T){await $e(void 0,ue(T)),process.stderr.write(`${S?ft:Yo(e.preview?"preview":e.step,e.step!=="load"||e.dryRun||Be(y),s)}
271
- `),process.exitCode=ue(T);return}if(dt(L||I.length>0?1:He?3:Po(e.step,y)),e.json){await $e();return}n(`done in ${Date.now()-o}ms`);async function Ze(c){await D("frozen:remove:automation",{...c,...G("removal")});let p=z=>y.find(q=>q.type===z)?.payload,v=p("frozen:remove:automation:response"),w=Array.isArray(c.sweptObjects)?c.sweptObjects:[],b=v?.purge&&w.length>0?v.purge:void 0,A=v&&e.muteAutomation?E&&(e.preview||e.dryRun)?await ze(Te(E),v.automation,{writes:de(v.steps)}):Le(v.automation,de(v.steps)):void 0,P=A&&!("refused"in A)?A:void 0,{lines:k,refusal:O}=_e({read:v?.automation??{unread:String(p("frozen:remove:automation:error")?.message)},steps:b??v?.steps??{},...P?{mute:{automation:P.automation,muted:P.planned}}:{}},e.target??"",c.reload===!0?s.againSubject.purge:"removal",b?{delete:w}:void 0);for(let z of k)n(z);let W=A&&"refused"in A?A.refused:O!==void 0&&!e.acceptAutomation?{code:"AUTOMATION_NOT_ACCEPTED",message:O}:void 0;return{...v?{steps:v.steps}:{},...P?{planned:P}:{},...W?{refusal:W.message,code:W.code}:{}}}function Je(c){F={code:fe,message:c},I.push(F),n(oe(F)),L=!0}async function ke(){if(t){if(g===void 0)return;let p=Pt(await t.stores.replays.mappingStoreOf(t.folder,g).recordedLoads());return p?{...xt(p),orgId:g}:void 0}return B=!0,await D("frozen:status",{}),B=!1,y.filter(p=>p.type==="frozen:status:response").at(-1)?.payload?.status?.loadRecords?.find(p=>p.orgId===g)}async function Qe(c=[]){if(!e.reload||e.pilot)return;let p=await ke();if(!(!p||p.created.length===0&&c.length===0))return Ze({targetOrgId:g,loadedAt:p.loadedAt,reload:!0,...c.length>0?{sweptObjects:c}:{}})}async function Ye(){let c=await ke();if(!c)return[];n(`reading what a sweep of ${e.target} would take for the loads a reload replaces\u2026`);let p=y.length;await D("frozen:remove:sweep",{targetOrgId:g,loadedAt:c.loadedAt,reload:!0,...G("removal")});let v=y.slice(p);if(v.some(b=>b.type==="frozen:remove:sweep:error"))return;let w=v.filter(b=>b.type==="frozen:remove:sweep:response").at(-1)?.payload?.loads;return[...new Set((w??[]).flatMap(({listing:b})=>Se(b,e)))]}async function fo(c){n(`reading what a sweep of ${e.target} would take\u2026`);let p=y.length;await D("frozen:remove:sweep",{targetOrgId:g,loadedAt:c,...G("removal")});let v=y.slice(p);if(v.some(A=>A.type==="frozen:remove:sweep:error"))return;let w=v.filter(A=>A.type==="frozen:remove:sweep:response").at(-1)?.payload,b=[...w?.listing?[w.listing]:[],...(w?.otherLoads??[]).map(({listing:A})=>A)];return[...new Set(b.flatMap(A=>Se(A,e)))]}async function et(c){n(`reading what ${t?`a replay of ${s.source}`:"a load"} into ${e.target}${e.pilot?" (pilot)":""} would do\u2026`),await D("frozen:load:preview",{targetOrgId:g,...G("load"),...e.pilot?{pilot:!0}:{},...e.reload?{reload:!0}:{},...e.goneFirst!==void 0?{goneFirst:$o(e.goneFirst)}:{},...e.writeEncrypted?{writeEncrypted:!0}:{},...e.muteAutomation?{muteAutomation:!0}:{},...e.acceptEmails?{acceptEmails:!0}:{},...e.acceptAutomation?{acceptAutomation:!0}:{}});let p=y.find(R=>R.type==="frozen:load:preview:response")?.payload?.plan,v=y.find(R=>R.type==="frozen:load:preview:error"&&R.payload?.code==="LOAD_CONFIG")?.payload;if(p===void 0&&v!==void 0){I.push({code:"LOAD_CONFIG",message:String(v.message??"")});let R=Array.isArray(v.refusedBeside)?v.refusedBeside:[];for(let{code:x,message:te}of R)U({code:x,message:te})}let w=p?Ut(he(p),e.maxTotal):void 0;w&&U({code:"MAX_RECORDS",message:w});let b=p?.automation?.refused;b&&U(b);let A=p?.emails?.refused;A&&U(A);let k=y.find(R=>R.type==="frozen:load:preview:response")?.payload?.replay?.storage?.refusal??p?.storage?.refusal;k&&U(k);let O=p?.apiRequests?.refused;O&&U(O);let W=(p&&e.sweep?await Ye():[])??[],z=p?await Qe(W):void 0;z?.refusal!==void 0&&U({code:z.code??"AUTOMATION_NOT_ACCEPTED",message:z.refusal});let q;if(e.muteAutomation&&p&&E){q=await re(E).read(g,[...new Set([...p.perObject.map(x=>x.objectApiName),...z?.steps?.delete??[]])]);let R=await ze(Te(E),q,{writes:Zo(z?.steps)});if("refused"in R)I.some(({message:x})=>x===R.refused.message)||U(R.refused);else{for(let x of Y(R.planned,e.target??"the target"))n(x);H={mutedAutomation:R.planned,mutePlan:R.plan}}}for(let R of co(p?.recordTypesGiven,!0,(H?.mutePlan.assign.length??0)>0))n(R);let ie=p?io(p):[];if(c&&u&&p&&E&&ie.length>0){q??=await re(E).read(g,p.perObject.map(te=>te.objectApiName)).catch(()=>{});let{estimate:R,refused:x}=await uo(u,{written:ie,running:ao(q,H?.mutePlan)});if(R){X=R;for(let te of De(R))n(te)}x!==void 0&&U({code:fe,message:x})}return p}async function po(c){let p=y.length,v=L;B=!0;try{await D("frozen:remove:sweep",{targetOrgId:g,loadedAt:c,...G("removal")})}finally{B=!1}let w=y.splice(p);L=v;let b=w.find(A=>A.type==="frozen:remove:sweep:response")?.payload?.listing;return b&&b.refusal===void 0&&b.found.length>0?b:void 0}async function ho(){if(t||await D("frozen:config:save",{config:i}),L)return"ended";switch(e.step){case"select":n(`selecting from ${e.source}\u2026`),await D("frozen:select",{sourceOrgId:f});break;case"extract":n(`extracting from ${e.source}\u2026`),await D("frozen:extract",{sourceOrgId:f,...e.author?{author:e.author}:{}});break;case"load":{if(e.dryRun){if(await et(!0),t&&!L)for(let k of t.dryRunEnd(I))n(k);break}let c;if(t){if(c=await et(!1),H=void 0,c===void 0||L||I.length>0)return F??=I[0],L=!0,n("Nothing written."),"ended";if(he(c)===0)return n(`Nothing to create in ${e.target??"the target"}: nothing written.`),"ended"}let p=e.reload&&!e.pilot&&e.sweep?await Ye():[];if(p===void 0)return n("Nothing written."),"ended";let v=e.reload&&!e.pilot?await Qe(p):void 0;if(v?.refusal!==void 0)return F={code:v.code??"AUTOMATION_NOT_ACCEPTED",message:v.refusal},I.push(F),n(oe(F)),L=!0,"ended";if(e.sweep&&(n(`around the purge, a sweep deletes what the target's automation made for each ${s.run} it replaces, as the ${s.run}'s user, tied to its records \u2014 run with --dry-run to see what`),N.setRemovalAsker(async k=>{let{lines:O,refusal:W}=_e(k,e.target??"",s.againSubject.sweep);for(let z of O)n(z);if(!(W===void 0||e.acceptAutomation))return F={code:"AUTOMATION_NOT_ACCEPTED",message:W},I.push(F),F})),!e.yes&&!await vt(t&&c?t.question(c):`Load the frozen dataset into ${e.target}${e.reload?`, purging first what earlier loads created${e.sweep?" and what the target's automation made for them":""}`:""}?`))return n("Nothing written."),"ended";let w;if(u&&E){let k=c?io(c):Jo(J??""),O=await re(E).read(g,k).catch(()=>{}),W={written:k,running:ao(O,e.muteAutomation&&O?Le(O,Ke).plan:void 0)},{estimate:z,refused:q}=await uo(u,W);if(z){X=z;for(let x of De(z))n(x)}if(q!==void 0||z===void 0)return Je(`${q??""} Nothing was written.`.trim()),"ended";m=new AbortController;let ie=m.signal,R=await pt(()=>u.take(W,z,{signal:ie})).finally(()=>{m=void 0});if("stop"in R)return R.stop.code!==fe?(S=!0,"ended"):(Je(St(R.stop)),"ended");w=R.checkpoint,X=w;for(let x of Ot(w,e.target??"the target",e.muteAutomation))n(x)}n(t?`replaying ${s.source} into ${e.target}\u2026`:`loading into ${e.target}${e.pilot?" (pilot)":""}\u2026`);let b=new Date().toISOString(),A=e.maxTotal??(c?he(c):void 0);await D("frozen:load",{targetOrgId:g,...G("load"),...e.pilot?{pilot:!0}:{},...e.reload?{reload:!0}:{},...e.writeEncrypted?{writeEncrypted:!0}:{},...A!==void 0?{maxRecords:A}:{},...e.muteAutomation?{muteAutomation:!0}:{},...e.sweep?{sweep:!0}:{},...e.sweepLate?{sweepLate:!0}:{},...e.sweepUntied?{sweepUntied:!0}:{},...e.sweep&&e.includeChanged?{includeChanged:!0}:{},...e.acceptEmails?{acceptEmails:!0}:{},...e.acceptAutomation?{acceptAutomation:!0}:{}});let P=y.filter(k=>k.type==="frozen:load:error").map(We).find(k=>k!==void 0);if(P&&!F&&(F=P,I.push(F)),g&&Be(y)){let k=Gt(await new _t(h,{orgId:g}).recorded().catch(()=>{}),b);try{Vt(ne(),{organizationId:g,sas:Me(h),startedAt:b,endedAt:new Date().toISOString(),...k?{lastWriteAt:k}:{}})}catch(O){n(`warning: this load could not be added to ${ne()}: another sas's sweep of ${e.target??""} will not see it (${O instanceof Error?O.message:String(O)})`)}}if(u&&w){let k=w;X=await u.settle(k,Be(y)).catch(O=>(n(`warning: the checkpoint '${k.name}' taken before the load could not be deleted (${O instanceof Error?O.message:String(O)}): delete it with ${Re("checkpoint")} delete --org ${e.target??""} --checkpoint `+k.checkpointId),k));for(let O of Ft(X))n(O)}break}case"verify":n(t?`verifying the replay of ${s.source} into ${e.target}\u2026`:`verifying ${e.target}\u2026`),await D("frozen:verify",{targetOrgId:g,...G("verify")});break;case"remove":{let c=await ke();if(!c)return n(`No ${s.run} into ${e.target} is recorded ${s.recordedIn}: nothing to remove.`),"ended";if(e.preview){if(n(`reading what a removal from ${e.target} would do\u2026`),await D("frozen:remove:preview",{targetOrgId:g,loadedAt:c.loadedAt,...e.includeChanged?{includeChanged:!0}:{},...G("removal")}),y.some(w=>w.type==="frozen:remove:preview:response")){let w=e.sweep?await fo(c.loadedAt):[];if(w===void 0)break;let{planned:b,refusal:A,code:P}=await Ze({targetOrgId:g,loadedAt:c.loadedAt,...w.length>0?{sweptObjects:w}:{}});if(b&&(H={mutedAutomation:b.planned,mutePlan:b.plan}),A!==void 0){let k={code:P??"AUTOMATION_NOT_ACCEPTED",message:A};Ae.push(k),n(le(k,"a removal"))}}break}if(e.sweepList){n(`reading what a sweep of ${e.target} would take\u2026`),await D("frozen:remove:sweep",{targetOrgId:g,loadedAt:c.loadedAt,...G("removal")});let w=y.filter(b=>b.type==="frozen:remove:sweep:response").at(-1)?.payload;He=[w?.listing,...(w?.otherLoads??[]).map(({listing:b})=>b)].some(b=>b?.refusal!==void 0);break}for(let w of Eo(c,e.target??"",s))n(w);e.sweep&&n(`${Ve(c)>0?"before them, a sweep deletes":"a sweep alone deletes"} what the target's automation made for the ${s.run}, as the ${s.run}'s user, tied to its records \u2014 run ${xe("--sweep-list")} to see what`);let p=!1;if(N.setRemovalAsker(async w=>{let{lines:b,refusal:A}=_e(w,e.target??"");for(let P of b)n(P);if(A!==void 0&&!e.acceptAutomation)return{message:A,code:"AUTOMATION_NOT_ACCEPTED"};if(!e.yes&&To(c,w.steps)){j=!0;let P=await bt(`Type ${e.target} to delete them:`);if(j=!1,P!==e.target)return p=!0,{message:"Nothing deleted.",code:lo}}n(`removing from ${e.target}\u2026`)}),await D("frozen:remove",{targetOrgId:g,loadedAt:c.loadedAt,...Oo(e),...G("removal")}),p)return"ended";let v=y.filter(w=>w.type==="frozen:remove:error").map(We).find(w=>w!==void 0);if(v&&(F=v,Ae.push(v)),!e.sweep&&!F&&Mo(y)){Q=await po(c.loadedAt);for(let w of _o(Q,s))n(w)}break}case"status":await D("frozen:status",{});break}return"through"}}var Ke=(e,t)=>t==="insert"||t==="update";function Zo(e){let t=e?de(e):void 0;return(o,n)=>Ke(o,n)||t?.(o,n)===!0}function co(e,t,o=!1){return It((e??[]).map(n=>({recordTypeGiven:n})),t,o)}function ao(e,t){return{firing:e?rt(e,t,Ke).firing:[]}}function io(e){let t=[...e.perObject.filter(o=>o.toInsert>0||o.toPurge>0||o.toDeactivate>0).map(o=>o.objectApiName),...(e.placeholders??[]).map(o=>o.placeholderObjectApiName)];return[...new Set(t)]}function Jo(e){try{let t=JSON.parse(be(V(e,"manifest.json"),"utf8")),o=Object.entries(t.volumetry?.measured??{}).filter(([,n])=>typeof n=="number"&&n>0).map(([n])=>n);if(o.length>0)return o}catch{}try{return wo(V(e,"data")).filter(t=>t.endsWith(".json")).map(t=>t.slice(0,-5)).sort()}catch{return[]}}var Qo=new Set(["INVALID_PAYLOAD","CONFIG_MISSING",ce.code,"REPLACE_LEAVES_RECORDS","MUTE_PRODUCTION","MUTE_NO_RIGHT","MUTE_FAILED","EMAILS_NOT_ACCEPTED","FROZEN_EMAILS_EXCEEDED","AUTOMATION_NOT_ACCEPTED",Ce,"FROZEN_STORAGE_EXCEEDED"]);function Be(e){let t=i=>e.filter(h=>h.type===i).at(-1)?.payload,o=t("frozen:load:response")?.report;if(o){let i=h=>Object.values(h??{}).reduce((r,d)=>r+d,0);return o.perObject.some(h=>h.inserted>0)||(o.placeholders??[]).length>0||i(o.purge?.deleted)>0||i(o.purge?.deactivated)>0}let n=t("frozen:load:error"),s=n?.code;return typeof s=="string"&&Qo.has(s)?!1:n?.written!==0}async function uo(e,t){try{let o=await e.scope(t);return{estimate:o,...o.refusal!==void 0?{refused:Rt(o.refusal)}:{}}}catch(o){return{refused:ct(o).replace(/ Nothing was written\.$/,"")}}}function Yo(e,t=!0,o=_){let n=o===_?"the sas":"the folder of its replays";return e==="load"&&!t?`interrupted: the ${o.run} stopped before it created or purged a record: ${n} is as it was, and ${o.remove} has nothing of this ${o.run} to take back`:e==="load"?`interrupted: the ${o.run} stopped before it was through; what it wrote is recorded in ${n} and the audit trail, and ${o.remove} takes it back`:e==="remove"?`interrupted: the removal stopped before it was through; what it deleted is recorded, and ${o.remove} again takes what it left`:e==="preview"?"interrupted: the preview stopped before it was through, and deleted nothing":`interrupted: the ${e} stopped before it was through`}process.argv[1]?.includes("sandforge-frozen")&&(Et(),Ho().then(()=>process.exit(process.exitCode??0)).catch(e=>{process.stderr.write(`${e instanceof Error?e.message:String(e)}
272
- `),process.exit(1)}));export{$o as a,ko as b,Ro as c,_ as d,Oo as e,_e as f,Eo as g,To as h,to as i,Co as j,We as k,Ge as l,Do as m,Po as n,xo as o,ro as p,Mo as q,_o as r,Bo as s,Uo as t,Wo as u,Vo as v,Ko as w,Ho as x,Xo as y,co as z,io as A,Jo as B,Be as C,Yo as D};
@@ -1,7 +0,0 @@
1
- import { createRequire as __sandforgeRequire } from 'node:module';
2
- import { fileURLToPath as __sandforgePath } from 'node:url';
3
- import { dirname as __sandforgeDirname } from 'node:path';
4
- const require = __sandforgeRequire(import.meta.url);
5
- const __filename = __sandforgePath(import.meta.url);
6
- const __dirname = __sandforgeDirname(__filename);
7
- import{$ as a,Aa as B,Ba as C,Ca as D,Da as E,Ea as F,Fa as G,Ga as H,Ha as I,Ia as J,Ja as K,Ka as L,La as M,Ma as N,Na as O,Oa as P,Pa as Q,Qa as R,aa as b,ba as c,ca as d,da as e,ea as f,fa as g,ga as h,ha as i,ia as j,ja as k,ka as l,la as m,ma as n,na as o,oa as p,pa as q,qa as r,ra as s,sa as t,ta as u,ua as v,va as w,wa as x,xa as y,ya as z,za as A}from"./chunk-O3ZQSWDN.mjs";import"./chunk-DNE7JI3A.mjs";import"./chunk-CI2O7WBH.mjs";import"./chunk-5T3LFDJ5.mjs";import"./chunk-AX3YF7SC.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-Q7TLC3I2.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-JBOGAUGH.mjs";import"./chunk-4N425UJC.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-FG4Y4ZVL.mjs";import"./chunk-Z354SAEF.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-THYQOG24.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-CRPLDXJU.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{m as ASSIGNMENT_RULES_SOQL,h as AUTOMATION_READ_MOST,b as CONDITIONS_BOUND,f as CONDITION_REQUESTS_BOUND,c as DEFINITIONS_BOUND,g as DEFINITION_REQUESTS_BOUND,n as DUPLICATE_RULES_SOQL,i as FLOWS_SOQL,k as PROCESSES_SOQL,d as TOOLING_QUERIES_PER_REQUEST,e as TOOLING_RETRIEVES_PER_REQUEST,j as TRIGGERS_SOQL,N as TargetAutomationReader,o as USER_PERMISSIONS_SOQL,l as WORKFLOW_RULES_SOQL,a as answerOf,R as automationLines,p as conditionSoql,z as customObjectIdsSoql,Q as customPermissionsByIdSoql,A as customPermissionsSoql,G as decisionChecks,F as fieldsRequiredFilled,L as inFlight,H as messagesOf,M as objectsTheRunWrites,I as pathsOf,J as permissionKey,C as permissionSetSizesSoql,B as permissionSetsHoldingSoql,D as permissionsNamed,y as processObjectsSoql,O as readBypassGrants,w as readInComposites,x as ruleDefinitionSoql,P as setCustomPermissionsSoql,E as switchesNamed,v as targetAutomationQueries,s as toolingAnswersOf,q as toolingCompositeBody,t as toolingRecordsOf,r as toolingRetrieveBody,u as toolingRetrievesOver,K as unreadPartOf};
@@ -1,7 +0,0 @@
1
- import { createRequire as __sandforgeRequire } from 'node:module';
2
- import { fileURLToPath as __sandforgePath } from 'node:url';
3
- import { dirname as __sandforgeDirname } from 'node:path';
4
- const require = __sandforgeRequire(import.meta.url);
5
- const __filename = __sandforgePath(import.meta.url);
6
- const __dirname = __sandforgeDirname(__filename);
7
- import{a as Se,b as W,g as De,h as Pe,i as Ee,p as Te}from"./chunk-MB2DG66I.mjs";import{a as Ae,c as L,d as je}from"./chunk-NCASRA7L.mjs";import{b as Oe,e as Ce,i as ve,j as M,l as _}from"./chunk-TE2W76II.mjs";import{b as Re}from"./chunk-KYLHS74X.mjs";import{g as F,j as le,l as G,m as ue,p as fe}from"./chunk-ZLQHBI6V.mjs";import{B as ke,C as ye,D as he,w as ge,x as we,z as be}from"./chunk-TG52WNGV.mjs";import{j as pe}from"./chunk-YGE4AUXG.mjs";import{A as me,x as C}from"./chunk-SF52ZSIV.mjs";import{e as N}from"./chunk-P6A22FMQ.mjs";import{c as ae}from"./chunk-AIUAEBHR.mjs";import{n as de,o as ce}from"./chunk-O3ZQSWDN.mjs";import{g as ne,h as oe,i as re,q as se}from"./chunk-FG4Y4ZVL.mjs";import{b as ie}from"./chunk-CA5NAXSU.mjs";import{Zd as te}from"./chunk-CRPLDXJU.mjs";var Le="No record would be read or written.";function We(i,e){return{code:"RUN_WRITING",message:`${e.operation==="take"?`A checkpoint of ${i} is being taken`:e.operation==="rewind"?`A rewind is writing to ${i}`:e.operation==="undo"?`An undo is writing to ${i}`:e.operation==="empty"?`An emptying of its objects is writing to ${i}`:`SandForge is deleting checkpoints of ${i}`} (process ${e.pid} on ${e.host}): rewind once it has ended. ${Le}`}}function $e(i){return{query:e=>i.query(e),queryMore:e=>i.queryMore(e)}}function xe(i){let e=i.objects.find(r=>r.objectApiName===ne);if(e===void 0)return 0;let o=e.toBringBack;return o.inBin+o.withParent+o.deletedWhileTaken}function Ue(i,e){return{objectsRead:[...i],objects:[],unread:["flows","triggers","processes","workflowRules"].map(o=>({part:o,reason:e})),conditionsNotRead:0,conditionsBound:0,requests:0}}function ze(i,e){let o=new Map,r;return{bodies:o,global:()=>r,describeGlobal:()=>r??=i.describeGlobal(),reader:{lane:()=>e.lane(),tooling:n=>e.tooling(n),calls:()=>e.calls(),describe:async(n,a)=>{let p=await e.describe(n,a);return"body"in p&&o.set(n,p.body),p}}}}async function ct(i,e){let{org:o,signal:r}=i,{checkpoint:n,orgName:a}=e,p,k=await Re($e(o),{act:"preview",orgName:a,registered:e.registered,username:e.username,organizationId:n.org.organizationId,customSettings:se(n)},{userId:async()=>p=await o.userId()});if(!k.allowed)return{previewed:!1,refusal:k.refusal};let y=await ke(o,a),l=ze(o,pe(o,r)),Ie=await Oe({grants:k.grants,...p!==void 0?{userId:p}:{},username:e.username,checkpoint:n,reader:l.reader}),j=await o.serverTime(),h=me("pv",(i.now??(()=>new Date))()),d=await Ce({checkpoint:n,folder:e.folder,reader:l.reader,describeGlobal:l.describeGlobal,previewId:h,readAt:j,queryAllFiles:k.queryAllFiles,access:Ie,...r?{signal:r}:{}}),S=y.fileStorage;d.files!==void 0&&S!==void 0&&(d.files.storage.remaining=S.remaining*1048576),await Se(o,d,C(e.folder,h),n.takenAt);let m=e.objects!==void 0?new Set(e.objects):void 0,c=ve(d,m),R=Ae(c),$=m===void 0&&n.scope.mode==="picked"&&d.objects.some(t=>t.outside.length>0),Be=$&&e.acceptOutside===!1,w;if(m!==void 0||Be){w=await _({checkpoint:n,previewDir:C(e.folder,h),readAt:j,...m!==void 0?{objects:m}:{},acceptOutside:e.acceptOutside===!0,heldRows:M(n,e.folder),...r?{signal:r}:{}});for(let{objectApiName:t}of w.acts)R.includes(t)||R.push(t)}let s;if(R.length>0&&i.readAutomation)try{s=await i.readAutomation(R)}catch(t){s=Ue(R,ie(t))}let D,O=0,x=w?L(d,w):c,P=je(x),u=s&&e.muteAutomation===!0?de(s,te(P)):void 0,g=s&&u&&u.plan.assign.length>0&&i.mute?await Te(i.mute,s,P):void 0,Ne=g&&"refusal"in g?g.refusal:void 0,v=ce(g===void 0?u?.plan:"refusal"in g?g.plan:g.mute?.plan??u?.plan);if(s){let t=await fe({act:"rewind",orgName:a,automation:s,steps:P,...u?{plan:u.plan}:{},accepted:!1,mayMute:u===void 0,read:()=>ae(o)});D=t.gate.deliverability,O=t.ofRun.read?.requests??0}let U=l.global(),E=U?new Set((await N({describeGlobal:()=>U})).keys()):void 0,z=new Set(n.objects.map(({objectApiName:t})=>t.toLowerCase()));if(n.files!==void 0)for(let t of[oe,re])z.add(t.toLowerCase());let A=new Map;for(let[t,f]of l.bodies)A.set(t,ge(f,{inCheckpoint:z,...E?{worked:E}:{}}));let T=w!==void 0&&m!==void 0?{...c,withParentDeleted:w.acts.flatMap(({objectApiName:t,withParent:f})=>(f??0)>0?[{objectApiName:t,count:f??0}]:[])}:c,Fe=new Map((T.withParentDeleted??[]).map(({objectApiName:t,count:f})=>[t,f])),H=new Map;for(let t of T.objects){let f=t.toDelete.createdSince+t.toDelete.broughtBackSince-(Fe.get(t.objectApiName)??0),X=l.bodies.get(t.objectApiName),Z=A.get(t.objectApiName);if(f<=De||X===void 0||Z===void 0)continue;let Me=E??new Set((await N({describeGlobal:l.describeGlobal})).keys()),ee=await Pe(l.reader,we(X,Me),r);H.set(t.objectApiName,ee),A.set(t.objectApiName,{...Z,pointing:ee})}await Ee(C(e.folder,h),H);let K=be({objects:n.objects,diff:T,...m!==void 0?{readDiff:d}:{},automationRequests:s?.requests??0,...O>0?{deliverabilityRequests:O}:{},...v>0?{muteRequests:v}:{},...W(c)>0?{duplicateSets:W(c)}:{},relationships:A,...e.reusesPreview===!0?{reusesPreview:!0}:{}}),Ge={...K,apiRequestsLeft:y.remaining},J=F(x.objects),b=u?.automation??s,I=b?G(J,b,y.emails):[],V=b?le(J,b):void 0,Y=$&&e.acceptOutside===void 0&&b?G(F(L(d,await _({checkpoint:n,previewDir:C(e.folder,h),readAt:j,acceptOutside:!1,heldRows:M(n,e.folder),...r?{signal:r}:{}})).objects),b,y.emails):void 0,B=i.store.heldBy(n.org.organizationId),q=B===void 0?await i.runWriting?.(k.org.id):void 0,Q=B!==void 0?We(a,B):q!==void 0?{code:"RUN_WRITING",message:q}:Ne??ye("rewind",{run:K.apiRequests-O-v,deliverability:O,mute:v},y,a)??ue("rewind",I,a)??(c.files!==void 0?he("rewind",{files:xe(c),bytes:c.files.storage.bringBack},S?.remaining,a):void 0);return{previewed:!0,diff:d,...s?{automation:s}:{},...I.length>0?{emails:I}:{},...Y?{emailsKeepingOutside:Y}:{},...V!==void 0?{emailsUncounted:V}:{},...D?{deliverability:D}:{},estimate:Ge,...Q?{refusal:Q}:{}}}export{ct as a};
@@ -1,10 +0,0 @@
1
- import { createRequire as __sandforgeRequire } from 'node:module';
2
- import { fileURLToPath as __sandforgePath } from 'node:url';
3
- import { dirname as __sandforgeDirname } from 'node:path';
4
- const require = __sandforgeRequire(import.meta.url);
5
- const __filename = __sandforgePath(import.meta.url);
6
- const __dirname = __sandforgeDirname(__filename);
7
- import{p as g}from"./chunk-RM5G4IP6.mjs";import{b as o,e as c,k as u,l as d,u as l}from"./chunk-WZQEK4WT.mjs";import{appendFile as h,mkdir as m,readFile as w,writeFile as S}from"node:fs/promises";import{dirname as f,join as y}from"node:path";var D="seed-runs-dropped.ndjson",R=50,v={readFile:e=>w(e,"utf8"),appendFile:async(e,t)=>{await m(f(e),{recursive:!0}),await h(e,t,"utf8")},writeFile:async(e,t)=>{await m(f(e),{recursive:!0}),await S(e,t,"utf8")}},F=d({runId:o().min(1),targetOrgId:o().min(1),origin:l(["csv","clone"]).optional(),startedAt:o().min(1),droppedAt:o().min(1),left:u(d({objectApiName:o().min(1),count:c().int().nonnegative()}))});function P(e,t){return{runId:e.runId,targetOrgId:e.targetOrgId,...e.origin?{origin:e.origin}:{},startedAt:e.startedAt,droppedAt:t,left:g(e).map(({objectApiName:i,ids:n})=>({objectApiName:i,count:n.length}))}}var p=class{constructor(t,i=v,n=R){this.file=t;this.files=i;this.kept=n}file;files;kept;writes=Promise.resolve();note(t,i=new Date().toISOString()){let n=P(t,i);return this.writes=this.writes.then(()=>this.append(n)).catch(()=>{}),this.writes}async find(t){return await this.writes,(await this.read()).reverse().find(i=>i.runId===t)}async read(){let t;try{t=await this.files.readFile(this.file)}catch{return[]}let i=[];for(let n of t.split(`
8
- `)){if(n.trim()==="")continue;let r;try{r=JSON.parse(n)}catch{continue}let s=F.safeParse(r);s.success&&i.push(s.data)}return i}async append(t){let i=await this.read();if(i.length<this.kept){await this.files.appendFile(this.file,`${JSON.stringify(t)}
9
- `);return}let n=[...i.slice(i.length-this.kept+1),t];await this.files.writeFile(this.file,n.map(r=>`${JSON.stringify(r)}
10
- `).join(""))}};function I(e){return new p(y(e,D))}function $(e,t){let i=e.left.reduce((r,{count:s})=>r+s,0),n=e.left.map(({objectApiName:r})=>r).join(", ");return`Nothing this run created is kept: it was dropped on ${e.droppedAt} to keep the runs kept on this machine within their bound, ${i} of its records still in its org${n?` (${n})`:""}. ${t} lists, deleting nothing, every record you created there since the day the run started, its records among them; the same line without --dry-run deletes what it counted.`}function E(e,t,i){let n=new Date(e.startedAt).toISOString().slice(0,10),r=e.left.map(({objectApiName:a})=>a),s=Math.max(1,...e.left.map(({count:a})=>a));return[t,`--target ${i}`,`--since ${n}`,...r.length>0?[`--objects ${r.join(",")}`,`--max ${s}`]:[],"--dry-run"].join(" ")}export{I as a,$ as b,E as c};
@@ -1,7 +0,0 @@
1
- import { createRequire as __sandforgeRequire } from 'node:module';
2
- import { fileURLToPath as __sandforgePath } from 'node:url';
3
- import { dirname as __sandforgeDirname } from 'node:path';
4
- const require = __sandforgeRequire(import.meta.url);
5
- const __filename = __sandforgePath(import.meta.url);
6
- const __dirname = __sandforgeDirname(__filename);
7
- import{a as v}from"./chunk-SRPWW4A2.mjs";import"./chunk-4TLYUZD5.mjs";import{ic as D}from"./chunk-CRPLDXJU.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";function I(e){return{async retrieve(n){return{id:(await e.metadata.retrieve(n)).id}},checkRetrieveStatus:n=>e.metadata.checkRetrieveStatus(n),async deploy(n,t){return{id:(await e.metadata.deploy(n,t)).id}},checkDeployStatus:(n,t)=>e.metadata.checkDeployStatus(n,t)}}var N={pollMs:3e3,retrieveTimeoutMs:D.retrieve*6e4,deployTimeoutMs:D.deploy*6e4,sleep:e=>new Promise(n=>setTimeout(n,e)),now:Date.now},b=class extends Error{constructor(t,o,s,i){super(t==="deployment"?`Deployment ${o} was still ${s} after ${i} min; it goes on in the target org, and Setup \u203A Deployment Status follows it.`:`Retrieval ${o} was still ${s} after ${i} min; nothing was deployed.`);this.kind=t;this.asyncId=o;this.status=s;this.name="DeploymentStillRunning"}kind;asyncId;status};function d(e,n){return`${e}\0${k(n)}`}function k(e){try{return decodeURIComponent(e)}catch{return e}}function g(e){return e==null?[]:Array.isArray(e)?e:[e]}function R(e){return e===!0||e==="true"}function h(e){if(e==null||e==="")return;let n=Number(e);return Number.isFinite(n)?n:void 0}var P=/^Entity of type '(.+?)' named '(.+)' cannot be found$/;async function M(e,n,t,o){let s=new Map;for(let{componentType:a,fullName:m}of t)s.set(a,[...s.get(a)??[],m]);let i={apiVersion:Number(n),singlePackage:!0,unpackaged:{objectPermissions:[],types:[...s].map(([a,m])=>({members:m,name:a})),version:n}},{id:p}=await e.retrieve(i),u=o.now();for(;;){let a=await e.checkRetrieveStatus(p);if(a.done){if(a.success===!1||a.status==="Failed")throw new Error(`Retrieval ${p} from the source failed: ${a.errorMessage??a.status??"no reason given"}`);return a}if(o.now()-u>=o.retrieveTimeoutMs)throw new b("retrieval",p,a.status??"running",Math.round(o.retrieveTimeoutMs/6e4));await o.sleep(o.pollMs)}}async function x(e,n,t,o={}){let s=o.waiting??N;o.onProgress?.({step:"retrieve",done:0,total:t.length});let i=await M(e,n,t,s),p=new Map(t.map(l=>[d(l.componentType,l.fullName),l])),u=new Map,a=[];for(let l of g(i.messages)){let f=l.problem??"",T=P.exec(f),y=T?p.get(d(T[1],T[2])):void 0;y?u.set(d(y.componentType,y.fullName),{...y,problem:f}):f&&a.push(l.fileName?`${l.fileName}: ${f}`:f)}let m=t.filter(l=>!u.has(d(l.componentType,l.fullName))),r=i;m.length===0?r={...i,zipFile:""}:u.size>0&&(r=await M(e,n,m,s)),o.onProgress?.({step:"retrieve",done:m.length,total:t.length});let c=g(r.fileProperties).filter(l=>v(l)).map(l=>p.get(d(l.type??"",l.fullName??""))).filter(l=>l!==void 0);return{zipFile:r.zipFile??"",retrieved:m,missing:[...u.values()],managed:c,problems:a}}function A(e,n,t){return{allowMissingFiles:!1,autoUpdatePackage:!1,checkOnly:e,ignoreWarnings:!1,performRetrieve:!1,purgeOnDelete:!1,rollbackOnError:!0,...n==="RunSpecifiedTests"?{runTests:[...t]}:{},singlePackage:!0,testLevel:n}}async function E(e,n,t,o={}){let s=o.waiting??N,{id:i}=await e.deploy(n,t),p=s.now();for(;;){let u=await e.checkDeployStatus(i,!1);if(u.done)return e.checkDeployStatus(i,!0);if(o.onProgress?.({...w(u),deployId:i}),s.now()-p>=s.deployTimeoutMs)throw new b("deployment",i,u.status??"running",Math.round(s.deployTimeoutMs/6e4));await s.sleep(s.pollMs)}}function w(e){let n=e.numberTestsTotal??0,t=e.numberComponentsTotal??0,o=(e.numberComponentsDeployed??0)+(e.numberComponentErrors??0);return n>0&&o>=t?{step:"tests",done:(e.numberTestsCompleted??0)+(e.numberTestErrors??0),total:n}:{step:"components",done:o,total:t}}function C(e){let n=/line (\d+), column \d+/.exec(e??"");return n?Number(n[1]):void 0}function O(e){let n=h(e.lineNumber),t=h(e.columnNumber),o=e.problemType==="Warning"||e.problemType==="Error"?e.problemType:void 0,s={componentType:e.componentType??"",fullName:e.fullName??"",...e.fileName?{fileName:e.fileName}:{}};if(!R(e.success))return{...s,outcome:"failed",...e.problem?{problem:e.problem}:{},...o?{problemType:o}:{},...n!==void 0?{line:n}:{},...t!==void 0?{column:t}:{}};let i=R(e.created)?"created":R(e.changed)?"changed":"unchanged";return{...s,outcome:i}}function $(e,n,t){let o=e?.details??void 0,s=new Map,i=[...g(o?.componentFailures),...g(o?.componentSuccesses)];for(let r of i){if(!r.componentType&&r.fullName==="package.xml")continue;let c=O(r),l=d(c.componentType,c.fullName);s.has(l)||s.set(l,c)}let p=n.missing.map(r=>({componentType:r.componentType,fullName:r.fullName,outcome:"not_retrieved",...r.problem?{problem:r.problem}:{}})),u=o?.runTestResult??void 0,a=g(u?.failures).map(r=>{let c=C(r.stackTrace);return{className:r.name??"",...r.methodName?{methodName:r.methodName}:{},message:r.message??"",...r.stackTrace?{stackTrace:r.stackTrace}:{},...c!==void 0?{line:c}:{}}}),m=g(u?.codeCoverageWarnings).map(r=>r.name?`${r.name}: ${r.message??""}`:r.message??"").filter(r=>r!=="");return{...e?.id?{deployId:e.id}:{},checkOnly:t.checkOnly,status:e?.status??"NotStarted",success:e?.success===!0&&n.missing.length===0,...e?.errorMessage?{errorMessage:e.errorMessage}:{},sourceOrgId:t.sourceOrgId,targetOrgId:t.targetOrgId,testLevel:t.testLevel,runTests:[...t.runTests],components:[...s.values(),...p],counts:{componentsTotal:e?.numberComponentsTotal??0,componentsDeployed:e?.numberComponentsDeployed??0,componentErrors:e?.numberComponentErrors??0,testsTotal:e?.numberTestsTotal??0,testsCompleted:e?.numberTestsCompleted??0,testErrors:e?.numberTestErrors??0},testFailures:a,coverageWarnings:m,...n.problems.length>0?{retrieveProblems:[...n.problems]}:{},...e?.startDate?{startedAt:e.startDate}:{},...e?.completedDate?{completedAt:e.completedDate}:{}}}export{N as DEFAULT_WAITING,b as DeploymentStillRunning,A as deployOptions,E as deployPackage,$ as deploymentReport,I as metadataApiOf,x as retrieveComponents};
@@ -1,7 +0,0 @@
1
- import { createRequire as __sandforgeRequire } from 'node:module';
2
- import { fileURLToPath as __sandforgePath } from 'node:url';
3
- import { dirname as __sandforgeDirname } from 'node:path';
4
- const require = __sandforgeRequire(import.meta.url);
5
- const __filename = __sandforgePath(import.meta.url);
6
- const __dirname = __sandforgeDirname(__filename);
7
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r}from"./chunk-UZMLPKW6.mjs";import"./chunk-QAXKUEJT.mjs";import"./chunk-JKFCGYJE.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-YDXMTWAT.mjs";import"./chunk-M6P5ZZLE.mjs";import"./chunk-EINEGS6E.mjs";import"./chunk-O3ZQSWDN.mjs";import"./chunk-DNE7JI3A.mjs";import"./chunk-CI2O7WBH.mjs";import"./chunk-5T3LFDJ5.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-AX3YF7SC.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-Q7TLC3I2.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-JBOGAUGH.mjs";import"./chunk-4N425UJC.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-FG4Y4ZVL.mjs";import"./chunk-Z354SAEF.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-THYQOG24.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-CRPLDXJU.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{h as ACTIVE_DUPLICATE_RULES_SOQL,a as FORMULAS_BOUND,c as FORMULAS_IN_COMPOSITES_BOUND,b as FORMULA_REQUESTS_BOUND,o as TargetGapReader,i as bypassesOf,j as callsEstimateOf,f as fieldLabelsSoql,p as gapAnsweredBy,d as gapFieldOf,r as gapLines,q as gapsWithAnswers,l as readActiveValidationRules,m as readValidationRuleBypasses,k as toolingQueriesOver,n as toolingValidationRules,g as validationFormulaSoql,e as validationRulesSoql};