sandforge 1.84.1 → 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.
- package/README.md +1 -1
- package/lib/{chunk-S42RBRH2.mjs → chunk-22L43JMK.mjs} +1 -1
- package/lib/{chunk-Y2DRK37K.mjs → chunk-2LSGWTWX.mjs} +1 -1
- package/lib/{chunk-24RFOFYT.mjs → chunk-2YJJTQNC.mjs} +1 -1
- package/lib/chunk-34SMB5PA.mjs +10 -0
- package/lib/chunk-35B73566.mjs +7 -0
- package/lib/{chunk-3TZSBHEY.mjs → chunk-35IJ4WEU.mjs} +1 -1
- package/lib/chunk-3EHPAFKV.mjs +7 -0
- package/lib/{chunk-6YL7BNYD.mjs → chunk-3HAVVEXF.mjs} +1 -1
- package/lib/{chunk-6JWWSDM6.mjs → chunk-3I6FXFCN.mjs} +1 -1
- package/lib/{chunk-WUUKFE2U.mjs → chunk-3KJCSYXY.mjs} +1 -1
- package/lib/{chunk-2HVOZUM4.mjs → chunk-3L6DVNCR.mjs} +1 -1
- package/lib/chunk-3LRFPGYZ.mjs +7 -0
- package/lib/{chunk-GWZRR3MM.mjs → chunk-3MVWGL5A.mjs} +1 -1
- package/lib/{chunk-KGU4SVIT.mjs → chunk-4CSBZZAL.mjs} +1 -1
- package/lib/{chunk-JE6SCT6R.mjs → chunk-4NSXPONF.mjs} +1 -1
- package/lib/{chunk-UIOMAX56.mjs → chunk-4VLP6RHC.mjs} +1 -1
- package/lib/{chunk-YA6ATMTB.mjs → chunk-4XROG5CT.mjs} +1 -1
- package/lib/chunk-54V4FVEY.mjs +7 -0
- package/lib/chunk-55OJJT2Q.mjs +7 -0
- package/lib/{chunk-6QE6R6RL.mjs → chunk-5EHHQ5UX.mjs} +1 -1
- package/lib/{chunk-FITPY3L4.mjs → chunk-5JMQXHJ2.mjs} +1 -1
- package/lib/{chunk-W6PN6TJG.mjs → chunk-65AMXOQU.mjs} +1 -1
- package/lib/{chunk-3Q353S2R.mjs → chunk-6HHSAPIM.mjs} +1 -1
- package/lib/chunk-6KVBCFVS.mjs +7 -0
- package/lib/chunk-6NG7C2U3.mjs +476 -0
- package/lib/chunk-6ROL3KBM.mjs +7 -0
- package/lib/{chunk-2JDAOWUW.mjs → chunk-72AWCN7U.mjs} +1 -1
- package/lib/{chunk-JLSIWO4Z.mjs → chunk-7KHA5UIQ.mjs} +1 -1
- package/lib/chunk-7O6EFNQS.mjs +10 -0
- package/lib/{chunk-WWTCWWZI.mjs → chunk-A2CH2QGX.mjs} +1 -1
- package/lib/chunk-A2TXLAC3.mjs +276 -0
- package/lib/chunk-ALWVNR34.mjs +7 -0
- package/lib/{chunk-D4GF4FAB.mjs → chunk-ATBQIE2V.mjs} +1 -1
- package/lib/{chunk-NED4MBIM.mjs → chunk-ATQML7ZK.mjs} +1 -1
- package/lib/chunk-AVY742BJ.mjs +7 -0
- package/lib/{chunk-YWEQQL3C.mjs → chunk-AXTB2HJS.mjs} +1 -1
- package/lib/chunk-BBZUGKBZ.mjs +10 -0
- package/lib/chunk-BIDXK7KA.mjs +7 -0
- package/lib/{chunk-O677VOGO.mjs → chunk-BLMJ4WVI.mjs} +1 -1
- package/lib/{chunk-RE7RYF3B.mjs → chunk-BNHJCJJM.mjs} +1 -1
- package/lib/{chunk-5M5FQ7RP.mjs → chunk-BNPQEQXC.mjs} +1 -1
- package/lib/chunk-C5AUNG6T.mjs +37 -0
- package/lib/{chunk-ETDCBLGU.mjs → chunk-C5EQ7GFC.mjs} +1 -1
- package/lib/{chunk-MJZU3U5O.mjs → chunk-C7CKDZMC.mjs} +61 -61
- package/lib/{chunk-HCGXK7G7.mjs → chunk-CB4U22NR.mjs} +1 -1
- package/lib/chunk-CJAWKLAL.mjs +7 -0
- package/lib/chunk-CL75DEMQ.mjs +9 -0
- package/lib/{chunk-VCUXCK36.mjs → chunk-CLUNF4FK.mjs} +1 -1
- package/lib/chunk-CSMGP53U.mjs +7 -0
- package/lib/{chunk-7YNM6KFZ.mjs → chunk-CT324C7I.mjs} +1 -1
- package/lib/{chunk-7UVKIWKV.mjs → chunk-CZXDJXQP.mjs} +1 -1
- package/lib/{chunk-43TOMFV4.mjs → chunk-D2X6U3MS.mjs} +1 -1
- package/lib/{chunk-M6K34KGF.mjs → chunk-DAUX63UB.mjs} +1 -1
- package/lib/chunk-DB7JNALQ.mjs +10 -0
- package/lib/chunk-DDNCJVZ2.mjs +17 -0
- package/lib/{chunk-FP7CYB2F.mjs → chunk-DLSU66MY.mjs} +1 -1
- package/lib/{chunk-JKJ74BX5.mjs → chunk-DO6PSHQZ.mjs} +1 -1
- package/lib/{chunk-MDMPJEV3.mjs → chunk-DUBECLZV.mjs} +1 -1
- package/lib/{chunk-KZTZDC7H.mjs → chunk-DYHF6DNT.mjs} +1 -1
- package/lib/chunk-E5FSPXYH.mjs +930 -0
- package/lib/{chunk-Q7GIJBCD.mjs → chunk-EGL3I3IX.mjs} +1 -1
- package/lib/chunk-EIYMQPMG.mjs +7 -0
- package/lib/{chunk-RHNTHGNU.mjs → chunk-EUIALBMX.mjs} +1 -1
- package/lib/{chunk-NCZKWSC7.mjs → chunk-FI3R5ZOQ.mjs} +1 -1
- package/lib/{chunk-PAXNWTYK.mjs → chunk-FM4QCTO7.mjs} +1 -1
- package/lib/{chunk-HV7VPEXP.mjs → chunk-FRSIEASH.mjs} +1 -1
- package/lib/{chunk-QAFPQ3YB.mjs → chunk-FV6MOSHD.mjs} +1 -1
- package/lib/chunk-FYG47CNA.mjs +7 -0
- package/lib/chunk-GB6W4Q56.mjs +7 -0
- package/lib/chunk-GEV2DCMK.mjs +7 -0
- package/lib/{chunk-NSQWI7ZY.mjs → chunk-GFB2DNCB.mjs} +1 -1
- package/lib/chunk-GFGMGFSH.mjs +7 -0
- package/lib/{chunk-RGUQOSBU.mjs → chunk-GIFQXB2Q.mjs} +1 -1
- package/lib/{chunk-JAEDM4SI.mjs → chunk-GP5J3DGS.mjs} +1 -1
- package/lib/chunk-GQZEX7LH.mjs +231 -0
- package/lib/{chunk-JSAJS3MY.mjs → chunk-GYDTM62J.mjs} +1 -1
- package/lib/{chunk-OPMO6I45.mjs → chunk-GYFIXUJG.mjs} +1 -1
- package/lib/chunk-GZW2GNFK.mjs +7 -0
- package/lib/chunk-H6BHWAX7.mjs +8 -0
- package/lib/{chunk-EAC5QCE3.mjs → chunk-HDDJ3CVN.mjs} +1 -1
- package/lib/{chunk-5SMWFNE7.mjs → chunk-HDWB4ZOG.mjs} +1 -1
- package/lib/chunk-HGVPBJR6.mjs +7 -0
- package/lib/{chunk-BBRWFKS5.mjs → chunk-HLROVOR6.mjs} +1 -1
- package/lib/{chunk-LKTNQEBS.mjs → chunk-HUOR4M2L.mjs} +1 -1
- package/lib/chunk-HZCS6EED.mjs +8 -0
- package/lib/{chunk-36JOHEJL.mjs → chunk-HZUI56KZ.mjs} +1 -1
- package/lib/chunk-IAB5H7WN.mjs +7 -0
- package/lib/{chunk-X4BXESMQ.mjs → chunk-IQ5UKRHU.mjs} +1 -1
- package/lib/{chunk-54WZUS7J.mjs → chunk-IRQ4WANV.mjs} +1 -1
- package/lib/{chunk-5IZTFMJM.mjs → chunk-IT3DGX37.mjs} +1 -1
- package/lib/chunk-J347SPU6.mjs +49 -0
- package/lib/{chunk-QO53K5W2.mjs → chunk-JANBNTR5.mjs} +1 -1
- package/lib/chunk-JFXQZPRY.mjs +9 -0
- package/lib/{chunk-KAZS5Z6W.mjs → chunk-JRLYWVF4.mjs} +1 -1
- package/lib/{chunk-GKY2JMHY.mjs → chunk-JSNMUTY6.mjs} +1 -1
- package/lib/chunk-JTNJKSAA.mjs +7 -0
- package/lib/{chunk-7WATA4SB.mjs → chunk-JV2LAKWQ.mjs} +1 -1
- package/lib/{chunk-WAPSSYMT.mjs → chunk-JV7K2ZHK.mjs} +1 -1
- package/lib/{chunk-ZBAWJUG2.mjs → chunk-K4TQ7YHX.mjs} +1 -1
- package/lib/chunk-K5PUMHZU.mjs +7 -0
- package/lib/chunk-KH4KLCYG.mjs +7 -0
- package/lib/{chunk-OLCVHL7I.mjs → chunk-KQVLZVOP.mjs} +1 -1
- package/lib/chunk-KWUS7UAV.mjs +19 -0
- package/lib/{chunk-JGZPD4IM.mjs → chunk-L6G73FXM.mjs} +1 -1
- package/lib/{chunk-BAWCOKRW.mjs → chunk-LG466Q5H.mjs} +1 -1
- package/lib/{chunk-GMIGWR6U.mjs → chunk-LHNAR6FC.mjs} +1 -1
- package/lib/chunk-LT4GHEI2.mjs +7 -0
- package/lib/{chunk-EC72TIEG.mjs → chunk-MR262Y3B.mjs} +1 -1
- package/lib/{chunk-LA4KIATH.mjs → chunk-NCCHOV2N.mjs} +1 -1
- package/lib/chunk-NICRSGLS.mjs +7 -0
- package/lib/chunk-NV5QA2HY.mjs +7 -0
- package/lib/{chunk-PR3XCSPO.mjs → chunk-O3GIN5TU.mjs} +1 -1
- package/lib/chunk-O6FHK6NQ.mjs +13 -0
- package/lib/{chunk-M4BLK6HJ.mjs → chunk-O7YIEFG7.mjs} +1 -1
- package/lib/chunk-OCUVAA5E.mjs +7 -0
- package/lib/chunk-OLCS7JCT.mjs +14 -0
- package/lib/chunk-ON7Y63FK.mjs +9 -0
- package/lib/{chunk-N4WPCWJO.mjs → chunk-OO2WY3UB.mjs} +1 -1
- package/lib/{chunk-MSIEU5MR.mjs → chunk-OT2NHL2V.mjs} +1 -1
- package/lib/{chunk-6WX5ZU7Q.mjs → chunk-P2M5ZXWU.mjs} +1 -1
- package/lib/{chunk-GNRSF65U.mjs → chunk-P4YOHLZ4.mjs} +1 -1
- package/lib/chunk-PBHDPTT6.mjs +343 -0
- package/lib/chunk-PE7CHD2W.mjs +7 -0
- package/lib/{chunk-PBY2O6OF.mjs → chunk-PIQ2I67B.mjs} +1 -1
- package/lib/chunk-PKYDNZJK.mjs +7 -0
- package/lib/chunk-PVZ72OOQ.mjs +7 -0
- package/lib/chunk-QACFTHJM.mjs +8 -0
- package/lib/{chunk-J3DND3BC.mjs → chunk-QGVL5EW3.mjs} +1 -1
- package/lib/chunk-QHE2RUWX.mjs +7 -0
- package/lib/{chunk-QKEKG2LD.mjs → chunk-RCW5BZNW.mjs} +1 -1
- package/lib/{chunk-4JE4BYXK.mjs → chunk-RJ6HHG7J.mjs} +1 -1
- package/lib/{chunk-ZQWIVYVM.mjs → chunk-RPTEEI4R.mjs} +1 -1
- package/lib/chunk-RQW5S67A.mjs +7 -0
- package/lib/chunk-RTCMYMED.mjs +7 -0
- package/lib/chunk-RWVX7XSD.mjs +7 -0
- package/lib/{chunk-WY5V5PR3.mjs → chunk-RZOINFNL.mjs} +1 -1
- package/lib/chunk-SOOTWGMQ.mjs +7 -0
- package/lib/chunk-STQ2JMIZ.mjs +7 -0
- package/lib/{chunk-6PD6K7LP.mjs → chunk-SUIPDW5O.mjs} +1 -1
- package/lib/{chunk-TNT27RBG.mjs → chunk-SZOJ7BEJ.mjs} +1 -1
- package/lib/{chunk-4EOHEDFP.mjs → chunk-T542Z54E.mjs} +1 -1
- package/lib/chunk-TAN2CIRI.mjs +21 -0
- package/lib/{chunk-A3MYSOOC.mjs → chunk-TCNBINOG.mjs} +1 -1
- package/lib/chunk-TFDF3DBN.mjs +7 -0
- package/lib/chunk-TICZXC53.mjs +9 -0
- package/lib/chunk-TLX45X5U.mjs +7 -0
- package/lib/{chunk-QTG6LUZT.mjs → chunk-TMIV3IWH.mjs} +1 -1
- package/lib/chunk-TQ6HEJ73.mjs +11 -0
- package/lib/chunk-TTU5EQZ6.mjs +7 -0
- package/lib/chunk-TYUYPFDJ.mjs +7 -0
- package/lib/chunk-TZXYVMZC.mjs +7 -0
- package/lib/chunk-UCUFLFNK.mjs +7 -0
- package/lib/chunk-UK3QLBHW.mjs +7 -0
- package/lib/{chunk-IZGCEOYO.mjs → chunk-UM2B4GR7.mjs} +1 -1
- package/lib/chunk-UZFTTNOP.mjs +7 -0
- package/lib/chunk-V3AXSKSU.mjs +7 -0
- package/lib/chunk-VA6EEI6X.mjs +21 -0
- package/lib/{chunk-OFTT7J2M.mjs → chunk-VFKG2G37.mjs} +1 -1
- package/lib/chunk-VJNEW5MQ.mjs +7 -0
- package/lib/{chunk-L53JWJ3S.mjs → chunk-VKREON6Q.mjs} +1 -1
- package/lib/{chunk-NOBQTEQD.mjs → chunk-VNNDYPBL.mjs} +1 -1
- package/lib/{chunk-ZJW6YOMV.mjs → chunk-VRBETPHY.mjs} +1 -1
- package/lib/{chunk-EPFCERGL.mjs → chunk-VT6P3X6R.mjs} +1 -1
- package/lib/{chunk-ZV7ZFQQC.mjs → chunk-VUTQY76O.mjs} +1 -1
- package/lib/chunk-WF5S4FW5.mjs +7 -0
- package/lib/{chunk-Z4LKKOFY.mjs → chunk-WJGK6VGU.mjs} +1 -1
- package/lib/{chunk-5CRLRHOJ.mjs → chunk-WJHMB3SL.mjs} +1 -1
- package/lib/{chunk-OUZQPYT3.mjs → chunk-WQCXOZEJ.mjs} +1 -1
- package/lib/{chunk-L2E5WBGD.mjs → chunk-WVVFR4E3.mjs} +1 -1
- package/lib/{chunk-PWRJRL5U.mjs → chunk-XBYXT74L.mjs} +1 -1
- package/lib/chunk-XJE3LJHP.mjs +7 -0
- package/lib/{chunk-CPQIZGG5.mjs → chunk-XV4CVZYD.mjs} +1 -1
- package/lib/chunk-Y37ED7AS.mjs +7 -0
- package/lib/{chunk-YTLUYSMF.mjs → chunk-YGBNZYT4.mjs} +1 -1
- package/lib/{chunk-4CVUUVGJ.mjs → chunk-YGTOX7IL.mjs} +1 -1
- package/lib/{chunk-OMNMLKDT.mjs → chunk-YJ27WHKR.mjs} +1 -1
- package/lib/chunk-YRULC27A.mjs +7 -0
- package/lib/{chunk-RMFU4BAL.mjs → chunk-YSVAHT4Q.mjs} +4 -4
- package/lib/chunk-YTOTMJTY.mjs +15 -0
- package/lib/{chunk-B63POIPQ.mjs → chunk-YZKZC62O.mjs} +1 -1
- package/lib/{chunk-DPMRIMUC.mjs → chunk-YZQN7BRB.mjs} +1 -1
- package/lib/{chunk-7SQSWVAU.mjs → chunk-Z5IUK2QO.mjs} +1 -1
- package/lib/{chunk-M2ABR4JM.mjs → chunk-ZEGSMW5A.mjs} +1 -1
- package/lib/{chunk-PR42EZSR.mjs → chunk-ZIKLQZBG.mjs} +1 -1
- package/lib/chunk-ZVU7MD2S.mjs +7 -0
- package/lib/sandforge-autopilot.mjs +33 -27
- package/lib/sandforge-backup.mjs +19 -19
- package/lib/sandforge-checkpoint.mjs +1 -1
- package/lib/sandforge-cleanup.mjs +1 -1
- package/lib/sandforge-clone.mjs +1 -1
- package/lib/sandforge-compare.mjs +32 -14
- package/lib/sandforge-dataops.mjs +1 -1
- package/lib/sandforge-empty.mjs +11 -13
- package/lib/sandforge-env.mjs +105 -105
- package/lib/sandforge-frozen.mjs +1 -1
- package/lib/sandforge-mcp.mjs +2 -2
- package/lib/sandforge-monitor.mjs +1 -1
- package/lib/sandforge-pipeline.mjs +13 -13
- package/lib/sandforge-seed.mjs +1 -1
- package/lib/sandforge-sync.mjs +1 -1
- package/lib/sandforge-users.mjs +13 -15
- package/lib/sandforge.mjs +1 -1
- package/lib/sf/sandforge/dataops.mjs +2 -2
- package/lib/sfPlugin.mjs +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
- package/lib/chunk-23SEDORH.mjs +0 -11
- package/lib/chunk-26POJDIT.mjs +0 -7
- package/lib/chunk-2AZQHBEF.mjs +0 -7
- package/lib/chunk-2METQHGG.mjs +0 -7
- package/lib/chunk-2WFIVO4F.mjs +0 -13
- package/lib/chunk-2YHZBUZE.mjs +0 -7
- package/lib/chunk-326AJTIU.mjs +0 -272
- package/lib/chunk-3PVRGTVK.mjs +0 -7
- package/lib/chunk-5XTUSN72.mjs +0 -8
- package/lib/chunk-6I6TWNV5.mjs +0 -7
- package/lib/chunk-6O222PW6.mjs +0 -7
- package/lib/chunk-6ZLKIT3H.mjs +0 -7
- package/lib/chunk-7QYHEHMA.mjs +0 -9
- package/lib/chunk-B3FBHVNN.mjs +0 -21
- package/lib/chunk-BEA27DLS.mjs +0 -7
- package/lib/chunk-BRY3PLIZ.mjs +0 -7
- package/lib/chunk-CBH3TOWK.mjs +0 -341
- package/lib/chunk-CVHNXJH3.mjs +0 -7
- package/lib/chunk-DGDRQRCW.mjs +0 -7
- package/lib/chunk-DUN2EPRC.mjs +0 -7
- package/lib/chunk-E3A3LOCY.mjs +0 -7
- package/lib/chunk-F2424IKX.mjs +0 -7
- package/lib/chunk-F3AQW6IU.mjs +0 -7
- package/lib/chunk-FNJ4SGWO.mjs +0 -7
- package/lib/chunk-GOOVPVWX.mjs +0 -7
- package/lib/chunk-H2BHESDA.mjs +0 -9
- package/lib/chunk-H4CGM6YO.mjs +0 -7
- package/lib/chunk-HIDW7FNV.mjs +0 -9
- package/lib/chunk-HSBXRQTI.mjs +0 -7
- package/lib/chunk-HUZPBE47.mjs +0 -7
- package/lib/chunk-I6E6T6YY.mjs +0 -7
- package/lib/chunk-IUM4NFKI.mjs +0 -10
- package/lib/chunk-IVFVNNGB.mjs +0 -37
- package/lib/chunk-JCFBFF4Y.mjs +0 -7
- package/lib/chunk-JTJK2D36.mjs +0 -7
- package/lib/chunk-KB4ZHM4Q.mjs +0 -10
- package/lib/chunk-KJWFYBMU.mjs +0 -15
- package/lib/chunk-LC3NDW4N.mjs +0 -7
- package/lib/chunk-OM5NORJG.mjs +0 -7
- package/lib/chunk-OVNMB6Q2.mjs +0 -7
- package/lib/chunk-PEDQPM2P.mjs +0 -926
- package/lib/chunk-PH7SP4YK.mjs +0 -21
- package/lib/chunk-PMN4PAC3.mjs +0 -19
- package/lib/chunk-PMWAFDUB.mjs +0 -48
- package/lib/chunk-PPLVFX6N.mjs +0 -7
- package/lib/chunk-PZBZ7MNC.mjs +0 -7
- package/lib/chunk-QROPNEGY.mjs +0 -14
- package/lib/chunk-RGBGUCJA.mjs +0 -156
- package/lib/chunk-RKTFFCNS.mjs +0 -7
- package/lib/chunk-ROV3QXEF.mjs +0 -475
- package/lib/chunk-RT47RKLY.mjs +0 -7
- package/lib/chunk-SI267LYR.mjs +0 -8
- package/lib/chunk-SRPWW4A2.mjs +0 -10
- package/lib/chunk-T3G6VZNS.mjs +0 -7
- package/lib/chunk-T63U4OZJ.mjs +0 -7
- package/lib/chunk-TEIBWMJM.mjs +0 -7
- package/lib/chunk-TW3N6W5Z.mjs +0 -7
- package/lib/chunk-UBIKR5VO.mjs +0 -7
- package/lib/chunk-UI3JQVRU.mjs +0 -8
- package/lib/chunk-UX3BVH2Y.mjs +0 -7
- package/lib/chunk-VINGECAJ.mjs +0 -10
- package/lib/chunk-VOXJHJIE.mjs +0 -7
- package/lib/chunk-WB2RIVO3.mjs +0 -7
- package/lib/chunk-WXDLQT2O.mjs +0 -10
- package/lib/chunk-XBQGZGWR.mjs +0 -7
- package/lib/chunk-XGGOUNPP.mjs +0 -7
- package/lib/chunk-XKWW3GKF.mjs +0 -7
- package/lib/chunk-YHR4WQPR.mjs +0 -7
- package/lib/chunk-ZQQXSCVI.mjs +0 -7
- package/lib/chunk-ZRUDYB7O.mjs +0 -7
|
@@ -4,4 +4,4 @@ import { dirname as __sandforgeDirname } from 'node:path';
|
|
|
4
4
|
const require = __sandforgeRequire(import.meta.url);
|
|
5
5
|
const __filename = __sandforgePath(import.meta.url);
|
|
6
6
|
const __dirname = __sandforgeDirname(__filename);
|
|
7
|
-
import{a as k,b as N,d as q,f as C,g as u,i as D,k as R,l as z}from"./chunk-
|
|
7
|
+
import{a as k,b as N,d as q,f as C,g as u,i as D,k as R,l as z}from"./chunk-RZOINFNL.mjs";import{c as P}from"./chunk-ZVU7MD2S.mjs";import{Kc as y,Qa as x,ya as $}from"./chunk-OLCS7JCT.mjs";import{a as b,b as S,d as I,e as v}from"./chunk-65AMXOQU.mjs";import{b as U}from"./chunk-CA5NAXSU.mjs";import{be as E,fd as T,lb as w,sb as h,tb as A}from"./chunk-J347SPU6.mjs";var F="AUTOMATION_NOT_ACCEPTED";async function M(e,s){let t=0,r;try{r=await b({query:(i=>(t+=1,e.query(i)))})}catch(i){return{kind:"untyped",err:i,typingRequests:t}}if(S(r))return{kind:"production",typed:r,typingRequests:t};let n=q(e),o=await n.identity();return u(o.organizationId)!==u(r.id)?{kind:"otherSession",sessionOrganizationId:o.organizationId,typed:r,typingRequests:t}:{kind:"reached",org:n,organization:{organizationId:r.id,kind:s.scratch?"scratch":r.sandbox?"sandbox":"developer",...s.alias!==void 0?{alias:s.alias}:{},username:o.username},typed:r,typingRequests:t}}var O="No user was read or written.";function p(e,s){return{allowed:!1,refusal:{code:"PRODUCTION",message:`${e} is a production org, or cannot be told from one: ${s}. SandForge sets up the users of a sandbox, a scratch org or a Developer Edition org, and reads nothing of a production org's: nothing lifts this. ${O}`}}}async function pe(e,s){let{orgName:t,registered:r}=s;if(r===void 0)return p(t,"SandForge has no record of what kind of org it is");if(!T(r))return p(t,"SandForge has it registered as a production org");let n=await M(e,{alias:t,scratch:r.orgType==="Scratch"});switch(n.kind){case"untyped":{let o=I(n.err);return o===void 0?p(t,`it did not say what org it is (${U(n.err)})`):{allowed:!1,refusal:{code:"ORG_UNTYPED",cause:o,message:`${v(t,n.err,o)} SandForge sets up the users of no org it cannot tell from a production one. ${O}`}}}case"production":return p(t,n.typed.edition?`its Organization record says IsSandbox false, edition ${n.typed.edition}`:"its Organization record says IsSandbox false, and no edition");case"otherSession":return{allowed:!1,refusal:{code:"OTHER_SESSION",message:`The session SandForge holds for ${t} is of ${n.sessionOrganizationId}, and its Organization record says ${n.typed.id}: reconnect it on the Organizations page. ${O}`}};case"reached":return{allowed:!0,org:n.org,organization:n.organization,typingRequests:n.typingRequests}}}var H={before:"before save",after:"after save",beforeAndAfter:"before and after save"},j={flows:"the flows",triggers:"the Apex triggers",processes:"the Process Builder processes",workflowRules:"the workflow rules"};function V(e,s){return e==="flow"?`flow "${s}"`:e==="process"?`process "${s}"`:e==="workflowRule"?`workflow rule "${s}"`:`Apex trigger ${s}`}function B(e){return`${e.objectApiName}: ${V(e.kind,e.name)} (${H[e.when]})`}function K(e){return j[e]??e}async function X(e,s,t){if(t.length===0)return{kind:"none"};try{return{kind:"read",automation:await new x($(async()=>e)).read(s,t)}}catch(r){return{kind:"unread",reason:U(r)}}}function L(e){return e.kind==="read"?E(e.automation,"update"):[]}function Y(e){return h.includes(e)}function Q(e){if(e.kind==="none")return;if(e.kind==="unread")return{fired:[],notDeduced:!0};let s=L(e).filter(r=>r.name!=="").slice(0,A).map(({kind:r,name:n,objectApiName:o,when:i})=>({kind:r,name:n.slice(0,255),objectApiName:o,when:i})),t=[...new Set(y(e.automation).map(({part:r})=>r).filter(Y))];return{fired:s,...t.length>0?{unread:t}:{}}}function J(e,s,t,r,n="flags"){if(r||e.kind==="none")return;let o=n==="page"?`Nothing was written. Accept it on the page to write all the same, or turn that automation off in ${s} first.`:`Nothing was written. Add --accept-automation to write all the same (accept: { automation: true } on the users resource of sandforge.yaml), or turn that automation off in ${s} first.`,i=Q(e);if(e.kind==="unread")return{code:F,message:`What ${s} runs as ${t} could not be read (${e.reason}), so what fires is not known. ${o}`,...i!==void 0?{automation:i}:{}};let f=L(e),c=y(e.automation);if(f.length===0&&c.length===0)return;let a=[];f.length>0&&a.push(`${s} runs automation as ${t}: ${f.map(B).join("; ")}.`);for(let{part:d,reason:g}of c)a.push(`${K(d)} of ${s} could not be read (${g}), so what fires as ${t} is not known.`);return a.push(o),{code:F,message:a.join(" "),...i!==void 0?{automation:i}:{}}}function Z(e){return e.kind==="read"?e.automation.requests:0}function ee(e){let s=e.users.some(r=>r.writes.profileId!==void 0||r.writes.isActive!==void 0||r.writes.email!==void 0),t=e.users.some(r=>r.writes.isFrozen!==void 0);return[...s?["User"]:[],...t?["UserLogin"]:[]]}function ge(e){let s=e.users.some(r=>r.after.isActive!==r.applied.before.isActive||u(r.after.profileId)!==u(r.applied.before.profileId)),t=e.users.some(r=>r.after.isFrozen!==r.applied.before.isFrozen);return[...s?["User"]:[],...t?["UserLogin"]:[]]}function re(e){let{reading:s}=e;return"unread"in s?"unread":s.level==="all"?"open":"closed"}async function me(e){let s=await D(e.org,e.users,{now:e.now??new Date,...e.previous?{previous:e.previous}:{}}),t={...e.previous?{previous:e.previous}:{},acceptUserEmails:e.acceptUserEmails,acceptEmails:e.acceptEmails},r=R(s,e.users,t),n;r.emailsToPeople>0&&(n=await P(e.conn),t={...t,deliverability:re(n)},r=R(s,e.users,t));let o=await X(e.conn,e.orgName,ee(r)),i=J(o,e.orgName,"users are written",e.acceptAutomation,e.voice);return{state:s,plan:r,options:t,...n?{deliverability:n}:{},automation:o,...i?{automationRefusal:i}:{},outsideRequests:(n?.requests??0)+Z(o)}}function Ue(e,s,t){let r=z(e.plan,s,t+e.state.requests),n=[...r.refusals??[],...e.automationRefusal?[e.automationRefusal]:[]];return{...r,...n.length>0?{refusals:n}:{}}}var _="Id, Username, Email, IsActive, Profile.Name",W="UserType = 'Standard'",te=200;function l(e){return typeof e=="string"&&e!==""?e:void 0}function G(e,s){let t=l(e.Id),r=l(e.Username);if(t===void 0||r===void 0)return;let n=l(e.Profile?.Name),o=l(e.Email);return{userId:t,username:r,...n!==void 0?{profile:n}:{},address:o!==void 0&&C(o)!==void 0?"invalid":"valid",active:e.IsActive===!0,frozen:s.has(u(t))}}function se(e,s){if(e.active!==s.active)return e.active?-1:1;let t=e.username.toLowerCase(),r=s.username.toLowerCase();return t<r?-1:t>r?1:0}async function ye(e,s={}){let t=e.requests(),r=u(s.connectedUserId??(await e.identity()).userId),n=await e.query(`SELECT ${_} FROM User WHERE ${W} AND (IsActive = false OR Email LIKE '%.invalid')`),o=new Set((await e.query("SELECT UserId FROM UserLogin WHERE IsFrozen = true")).flatMap(a=>{let d=l(a.UserId);return d!==void 0?[u(d)]:[]})),i=new Map;for(let a of n){let d=G(a,o);d!==void 0&&i.set(u(d.userId),d)}let f=[...o].filter(a=>!i.has(a)&&a!==r);for(let a of k(f,te)){let d=await e.query(`SELECT ${_} FROM User WHERE ${W} AND Id IN ${N(a)}`);for(let g of d){let m=G(g,o);m!==void 0&&i.set(u(m.userId),m)}}i.delete(r);let c=[...i.values()].sort(se);return{users:c.slice(0,w),total:c.length,requests:e.requests()-t}}export{F as a,M as b,pe as c,B as d,K as e,X as f,L as g,Q as h,J as i,Z as j,ee as k,ge as l,re as m,me as n,Ue as o,ye as p};
|
|
@@ -0,0 +1,7 @@
|
|
|
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}from"./chunk-TCNBINOG.mjs";import"./chunk-RZOINFNL.mjs";import"./chunk-ZVU7MD2S.mjs";import"./chunk-OLCS7JCT.mjs";import"./chunk-TQ6HEJ73.mjs";import"./chunk-65AMXOQU.mjs";import"./chunk-6HHSAPIM.mjs";import"./chunk-K5PUMHZU.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-EUIALBMX.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-Q7TLC3I2.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-ATBQIE2V.mjs";import"./chunk-UCUFLFNK.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-DAUX63UB.mjs";import"./chunk-SZOJ7BEJ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-22L43JMK.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-J347SPU6.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as AUTOMATION_NOT_ACCEPTED,h as automationNamedOf,j as automationRequestsOf,m as deliverabilityOf,d as firedEntryWords,g as firedOf,o as gatedPlanAnswerOf,c as guardUsersOrg,n as planUsersGated,b as reachUsersOrg,f as readUsersAutomation,e as unreadPartWords,i as usersAutomationRefusal,p as usersToRestoreOf,k as writtenByPlan,l as writtenByRemoval};
|
|
@@ -0,0 +1,9 @@
|
|
|
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{c as B,e as W,f as Z}from"./chunk-ATQML7ZK.mjs";import{d as O,z as j}from"./chunk-4CSBZZAL.mjs";import{b as x}from"./chunk-TQ2TQHTT.mjs";import{pa as C,wa as F}from"./chunk-J347SPU6.mjs";import{b as m,e as d,f as k,h as E,k as l,l as i,o as N,s as $,u as z,v as S,z as _}from"./chunk-WZQEK4WT.mjs";import{createHash as G,randomBytes as H}from"node:crypto";import{createReadStream as re}from"node:fs";import{chmod as oe,copyFile as ae,open as se,readFile as U,readdir as X,rename as A,rm as y,stat as Q}from"node:fs/promises";import{join as w}from"node:path";var V=1440*6e4,ie="forge-samples",Y="forge-runs",T="sample.json",L="the run of this sample",ce=/^[A-Za-z0-9]{15}(?:[A-Za-z0-9]{3})?$/,ee=/^[A-Za-z0-9_-]{1,128}$/,f=class extends Error{constructor(e,n){super(n);this.refusal=e;this.name="SamplePlanError"}refusal},v=class extends Error{constructor(e,n,o){let a=n.length>3?`${n.slice(0,3).join(", ")} and ${n.length-3} more`:n.join(", ");super(`${a}: ${o instanceof Error?o.message:String(o)}`);this.removed=e;this.left=n;this.name="SamplePlanSweepError"}removed;left};function M(r){return w(r,ie)}function le(r,t){if(!ee.test(t))throw new f("otherSetup","Not the fingerprint of a setup of a run.");return w(M(r),t)}function R(r,t){return w(r,Y,`${t.replace(/[^A-Za-z0-9_-]/g,"_")}.sample`)}var p=m().regex(/^[A-Za-z][A-Za-z0-9_]*$/),s=d().int().nonnegative(),pe=i({window:i({field:z(["CreatedDate","LastModifiedDate"]),from:m().optional(),to:m().optional(),lastDays:d().int().positive().optional()}).optional(),notWindowed:l(p).optional(),where:l(i({objectApiName:p,where:m()})).optional(),strata:l(i({objectApiName:p,field:m(),values:l(i({value:N([m(),k(),E()]),label:m().optional(),roots:s,kept:s})),more:s.optional()})).optional()}),ue=i({seed:d().int().min(0),draw:C,floor:s,parents:F,children:N([S("all"),d().int().min(1)]),share:d().min(0).max(1),budget:i({bytes:d().nonnegative(),remainingMB:d().optional(),maxMB:d().optional(),share:d().optional(),roundingMB:d().optional(),automationMB:d().optional(),withinMB:d().optional(),maxTotal:d().optional(),limitedBy:z(["storage","within","maxTotal","targetRequests","bulkBatches","sourceRequests","heavyRoots","whole","draw"])}),rows:s,storageBytes:d().nonnegative(),objects:l(i({objectApiName:p,sourceRows:s,kept:s,roots:s,below:s,asParents:s,whole:S(!0).optional(),childrenCut:l(i({field:m(),rows:s})).optional(),rootsInTheSource:s.optional(),rootsInTheDraw:s.optional()})),whole:l(i({objectApiName:p,why:z(["referenceData","catalog","smallParent","asked"])})),heavyRoots:l(i({objectApiName:p,id:m().regex(ce),rows:s,relation:i({objectApiName:p,field:m()})})),dropped:l(i({objectApiName:p,rows:s,reason:z(["noParentInSource","outsideFilter","excludedObject","withoutParent","heldBack","recordTypeNotInTarget"])})),leftEmpty:l(i({objectApiName:p,field:m(),rows:s})),noRecordDrawn:l(i({objectApiName:p,sourceRows:s,noRootInTheDraw:S(!0).optional()})),roots:pe.optional(),partialMasters:l(i({objectApiName:p,details:p,field:m(),kept:s.optional(),sourceRows:s.optional(),asParents:s.optional()})).optional(),planRequests:i({source:s}),newestByIds:l(p).optional(),oldestByIds:l(p).optional()}),me=i({personAccounts:$(p,s),byThePlatform:l(i({objectApiName:p,inPlan:s,beyond:s}))}),D=i({version:S(1),sourceOrgId:m().min(1),fingerprint:m().regex(ee),drawnAt:_.datetime(),drawnBy:z(["run","dryRun"]),sha256:m().regex(/^[0-9a-f]{64}$/),objects:l(i({objectApiName:p,count:d().int().positive(),sha256:m().regex(/^[0-9a-f]{64}$/)})),sample:ue,newestByIds:l(p).optional(),oldestByIds:l(p).optional(),counts:me.optional()});async function J(r){let t=G("sha256");for await(let e of re(r))t.update(e);return t.digest("hex")}function K(r){let t=G("sha256"),e=[...r].sort((n,o)=>n.objectApiName<o.objectApiName?-1:n.objectApiName>o.objectApiName?1:0);for(let{objectApiName:n,count:o,sha256:a}of e)t.update(`${n} ${o} ${a}
|
|
8
|
+
`);return t.digest("hex")}async function de(r,t){let e=await se(r,"wx",O);try{await e.writeFile(t,"utf8"),await e.sync()}finally{await e.close()}}function P(r){let t=r?.code;return t==="ENOENT"||t==="ENOTDIR"}var b=class r{constructor(t,e,n){this.dir=t;this.manifest=e;this.spool=n}dir;manifest;spool;get sha256(){return this.manifest.sha256}get count(){return this.spool.count}countOf(t){return this.manifest.objects.find(e=>e.objectApiName===t)?.count??0}ageMs(t){return t.getTime()-Date.parse(this.manifest.drawnAt)}get place(){return{path:this.dir,sha256:this.manifest.sha256,drawnAt:this.manifest.drawnAt,drawnBy:this.manifest.drawnBy}}async*ids(t,e={}){let n=Math.max(1,Math.floor(e.size??2e3)),o=e.after,a=[];for await(let c of this.spool.pages(t,n))for(let u of c)o!==void 0&&x(u,o)<=0||(a.push(u),a.length>=n&&(yield a,a=[]));a.length>0&&(yield a)}static async open(t,e={}){let n;try{n=JSON.parse(await U(w(t,T),"utf8"))}catch(u){throw P(u)?new f("gone","The plan of this sample is no longer on this machine."):new f("changed","The plan of this sample does not read as one.")}let o=D.safeParse(n);if(!o.success)throw new f("changed","The plan of this sample does not read as one.");let a=o.data,c;try{c=await Z.open(t,L)}catch{throw new f("changed","The ids of this sample are not as they were written.")}if(await r.holdToManifest(t,a,c),e.sourceOrgId!==void 0&&e.sourceOrgId!==a.sourceOrgId)throw new f("otherOrg","This plan was drawn of another org.");if(e.fingerprint!==void 0&&e.fingerprint!==a.fingerprint)throw new f("otherSetup","This plan was drawn for another setup of the run.");if(e.sha256!==void 0&&e.sha256!==a.sha256)throw new f("otherSha","This is not the plan the run was drawn with.");return new r(t,a,c)}static async holdToManifest(t,e,n){let o=()=>new f("changed","The ids of this sample are not as they were written."),a=n.objects.filter(c=>c.count>0);if(a.length!==e.objects.length)throw o();for(let c of e.objects){let u=a.find(h=>h.objectApiName===c.objectApiName);if(!u||u.count!==c.count)throw o();let g;try{g=await J(B(t,c.objectApiName))}catch{throw o()}if(g!==c.sha256)throw o()}if(K(e.objects)!==e.sha256)throw o()}static async keep(t,e){let n=`${t}.${process.pid}-${H(4).toString("hex")}.tmp`;try{await j(n);let o=new W(n,L);for(let{objectApiName:g,ids:h}of e.ids){let I=[...h].sort(x);for(let ne of I)await o.add(g,ne)}let a=await o.finish(),c=[];for(let{objectApiName:g,count:h}of a.objects)h!==0&&c.push({objectApiName:g,count:h,sha256:await J(B(n,g))});let u={version:1,sourceOrgId:e.sourceOrgId,fingerprint:e.fingerprint,drawnAt:e.drawnAt.toISOString(),drawnBy:e.drawnBy,sha256:K(c),objects:c,sample:e.sample,...e.newestByIds!==void 0&&e.newestByIds.length>0?{newestByIds:[...e.newestByIds]}:{},...e.oldestByIds!==void 0&&e.oldestByIds.length>0?{oldestByIds:[...e.oldestByIds]}:{},...e.counts?{counts:e.counts}:{}};D.parse(u),await de(w(n,T),`${JSON.stringify(u)}
|
|
9
|
+
`),await y(t,{recursive:!0,force:!0}),await A(n,t)}catch(o){throw await y(n,{recursive:!0,force:!0}),o}return r.open(t)}};function Pe(r,t){return b.keep(r,t)}async function Ae(r,t,e){let n;try{n=await b.open(le(r,t),{fingerprint:t})}catch(o){if(o instanceof f)return;throw o}return n.ageMs(e)>=V?"tooOld":n}async function Ie(r,t,e){let n=R(t,e);return await j(w(t,Y)),await y(n,{recursive:!0,force:!0}),await A(r.dir,n),b.open(n,{sha256:r.sha256})}async function Ne(r,t,e){let n=R(r,t);return!await q(n)||await q(e)?!1:(await j(M(r)),await A(n,e),!0)}async function Oe(r,t,e){let n=R(t,e);return await te(r.dir,n),b.open(n,{sha256:r.sha256})}async function Be(r,t,e){let n=await b.open(r,{sha256:e});await te(n.dir,t);try{return await b.open(t,{sha256:e})}catch(o){throw await y(t,{recursive:!0,force:!0}),o}}async function te(r,t){let e=`${t}.${process.pid}-${H(4).toString("hex")}.tmp`;try{await j(e);for(let n of await X(r))await ae(w(r,n),w(e,n)),await oe(w(e,n),O);await y(t,{recursive:!0,force:!0}),await A(e,t)}catch(n){throw await y(e,{recursive:!0,force:!0}),n}}async function q(r){try{return await Q(r),!0}catch(t){if(P(t))return!1;throw t}}async function xe(r){await y(r,{recursive:!0,force:!0})}async function Te(r,t){let e=M(r),n;try{n=await X(e)}catch(u){if(P(u))return[];throw u}let o=[],a=[],c;for(let u of n){let g=w(e,u);try{let h;try{let I=D.parse(JSON.parse(await U(w(g,T),"utf8")));h=Date.parse(I.drawnAt)}catch{h=(await Q(g)).mtimeMs}if(t.getTime()-h<V)continue;await y(g,{recursive:!0,force:!0}),o.push(u)}catch(h){if(P(h))continue;a.push(u),c??=h}}if(a.length>0)throw new v(o,a,c);return o}export{V as a,f as b,v as c,le as d,R as e,b as f,Pe as g,Ae as h,Ie as i,Ne as j,Oe as k,Be as l,xe as m,Te as n};
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
var o=class{operations=new Map;listeners=new Set;settledListeners=new Set;maxCompleted=50;pendingStarts=new Map;register(t,e,r,i,a){let s={operationId:t,module:e,description:r,status:"running",progressPercent:0,startedAt:Date.now(),abortController:a,notifiedNatively:!1};return this.pendingStarts.delete(t),this.operations.set(t,s),this.emit(t,"started",s),i.then(n=>{if(typeof n=="object"&&n!==null&&n.status==="failure"){this.markFailed(t,new Error("Operation finished with a failure status."));return}this.markCompleted(t)}).catch(n=>{this.markFailed(t,n)}).finally(()=>{for(let n of this.settledListeners)n(t)}),s}updateProgress(t,e,r){let i=this.operations.get(t);i&&(i.progressPercent=e,r!==void 0&&(i.resultSummary=r),this.emit(t,"progress",i))}abort(t){let e=this.operations.get(t);!e||e.status!=="running"||(e.abortController.abort(),e.status="aborted",e.completedAt=Date.now(),this.emit(t,"aborted",e))}holdUntilStart(t){let e=new AbortController;return this.pendingStarts.set(t,e),{signal:e.signal,release:()=>{this.pendingStarts.get(t)===e&&this.pendingStarts.delete(t)}}}cancelBeforeStart(t){let e=this.pendingStarts.get(t);return e?(e.abort(),!0):!1}markNotifiedNatively(t){let e=this.operations.get(t);e&&(e.notifiedNatively=!0)}getActiveOperations(){return[...this.operations.values()].sort((t,e)=>e.startedAt-t.startedAt).map(t=>({operationId:t.operationId,module:t.module,description:t.description,status:t.status,progressPercent:t.progressPercent,startedAt:t.startedAt,completedAt:t.completedAt,resultSummary:t.resultSummary}))}getRunning(){return[...this.operations.values()].filter(t=>t.status==="running")}has(t){return this.operations.has(t)}get(t){return this.operations.get(t)}onEvent(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onSettled(t){return this.settledListeners.add(t),()=>{this.settledListeners.delete(t)}}dispose(){for(let t of this.operations.values())t.status==="running"&&t.abortController.abort();for(let t of this.pendingStarts.values())t.abort();this.pendingStarts.clear(),this.operations.clear(),this.listeners.clear()}markCompleted(t,e){let r=this.operations.get(t);!r||r.status!=="running"||(r.status="completed",r.completedAt=Date.now(),r.progressPercent=100,e!==void 0&&(r.resultSummary=e),this.emit(t,"completed",r),this.evictOldCompleted())}markFailed(t,e){let r=this.operations.get(t);!r||r.status!=="running"||(r.status="failed",r.completedAt=Date.now(),r.resultSummary=e instanceof Error?e.message:String(e),this.emit(t,"failed",r))}emit(t,e,r){for(let i of this.listeners)i(t,e,r)}evictOldCompleted(){let t=[...this.operations.values()].filter(e=>e.status!=="running").sort((e,r)=>(e.completedAt??0)-(r.completedAt??0));for(;t.length>this.maxCompleted;){let e=t.shift();e&&this.operations.delete(e.operationId)}}};export{o as a};
|
|
@@ -4,6 +4,6 @@ import { dirname as __sandforgeDirname } from 'node:path';
|
|
|
4
4
|
const require = __sandforgeRequire(import.meta.url);
|
|
5
5
|
const __filename = __sandforgePath(import.meta.url);
|
|
6
6
|
const __dirname = __sandforgeDirname(__filename);
|
|
7
|
-
import{
|
|
7
|
+
import{Cc as m,Hc as l,Kc as p}from"./chunk-CJAWKLAL.mjs";import{mkdirSync as $,statSync as A}from"node:fs";import{homedir as k}from"node:os";import{join as g,resolve as x}from"node:path";var y=448;function D(e=process.env){return S("backups",e)}function S(e,r=process.env){let t=r.SANDFORGE_JOURNAL_DIR,n=t!==void 0&&t.trim()!==""?x(t):g(k(),".sandforge");return g(n,e)}var w={mkdir:(e,r)=>{$(e,r)},stat:e=>A(e),...typeof process.getuid=="function"?{uid:()=>process.getuid?.()??-1}:{}};function I(e,r=w){try{r.mkdir(e,{recursive:!0,mode:y});let t=r.stat(e);if(!t.isDirectory())return`The store ${e} is not a folder.`;let n=r.uid?.();return n!==void 0&&t.uid!==n?`The store ${e} belongs to another user, who can read its snapshots and change them: name a folder of your own with --store.`:void 0}catch(t){return`The store ${e} could not be made: ${t instanceof Error?t.message:String(t)}`}}function B(e){if(e!==void 0)return/^\d{1,5}$/.test(e)||(process.stderr.write(`Not a number of days: "${e}"
|
|
8
8
|
`),process.exit(2)),Number(e)}function E(e,r){return e.flatMap((t,n)=>t===r&&n+1<e.length?[e[n+1]??""]:[])}function F(e){let r=[];for(let t of e){/^[1-9]\d{0,5}(,[1-9]\d{0,5})*$/.test(t)||(process.stderr.write(`Not a slice's number: "${t}". Give --slice 2, or --slice 1,3.
|
|
9
9
|
`),process.exit(2));for(let n of t.split(",").map(Number))r.includes(n)||r.push(n)}return r.sort((t,n)=>t-n)}function C(e){return(r,t)=>r==="backup.maxRecordsPerObject"&&e.maxRecords!==void 0?e.maxRecords:r==="backup.maxAgeDays"&&e.maxAgeDays!==void 0?e.maxAgeDays:t}function M(e){let r=`removed snapshot ${e.operationId}${e.takenAt!==void 0?`, taken ${e.takenAt}`:""}: past the retention of ${e.days} day(s) (--max-age-days, 0 keeps them all)`;return e.syncRunId!==void 0?`${r}. It held what the Sync run ${e.syncRunId||"(unknown)"} wrote over: removing that run with sandforge sync --remove no longer puts those values back`:r}var j=1440*6e4;function _(e,r,t={}){let n=e.get(`backup:${r}`);if(n){let o=(n.objects??[]).map(s=>({objectApiName:s.objectApiName,records:s.recordCount??0}));return{words:n.origin==="slice"&&n.setId!==void 0?`slice ${n.slice?.index??"?"} of set ${n.setId}`:`snapshot ${r}`,objects:o,totalRecords:n.totalRecords??o.reduce((s,f)=>s+f.records,0)}}let a=new p(e).get(r);if(!a)return;let c=a.objects.flatMap(o=>o.slices.filter(s=>s.state!=="pending").map(s=>({objectApiName:o.objectApiName,slice:s}))),i=t.slices,d=i?c.filter(o=>i.includes(o.slice.index)):t.rewriteAll===!0?c:c.filter(o=>o.slice.restoredAt===void 0),u=[];for(let{objectApiName:o,slice:s}of d){let f=u.find(h=>h.objectApiName===o);f?f.records+=s.rows:u.push({objectApiName:o,records:s.rows})}let b=i?`slice(s) ${i.join(", ")}`:t.rewriteAll===!0?"every slice":`the ${d.length} slice(s) not put back yet`;return{words:`set ${r} (${b}, of ${c.length})`,objects:u,totalRecords:u.reduce((o,s)=>o+s.records,0)}}function L(e){let r=e.slices;return Array.isArray(r)?r.map(t=>t.skipped===!0?` slice ${t.index} ${t.objectApiName} put back before, not read again (--slice or --rewrite-all puts it back again)`:` slice ${t.index} ${t.objectApiName} put back ${t.restored} refused ${t.failed} unchanged ${t.unchanged}`):[]}function P(e){return new p(e).list()}function N(e,r){let t=Date.parse(e.lastActivityAt);if(!(r<=0||!Number.isFinite(t)))return new Date(t+r*j).toISOString().slice(0,10)}function J(e,r){let t=m(e),n=t.reduce((i,d)=>i+d.rows,0),a=e.objects.map(i=>`${i.objectApiName}${i.where!==void 0?` (where ${i.where})`:""}`).join(", "),c=N(e,r);return`${e.setId} ${e.startedAt} ${e.orgId} ${a} ${t.length} slice(s) of up to ${e.size} ${n} record(s) ${e.kind}, ${l(e)} `+(c!==void 0?`expires ${c}`:"kept (--max-age-days 0)")}export{D as a,S as b,I as c,B as d,E as e,F as f,C as g,M as h,_ as i,L as j,P as k,N as l,J as m};
|
|
@@ -0,0 +1,11 @@
|
|
|
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{d as K}from"./chunk-K5PUMHZU.mjs";import{b as J}from"./chunk-CA5NAXSU.mjs";import{kd as L,s as $}from"./chunk-J347SPU6.mjs";import{b as l,e as m,l as S,o as U,s as x}from"./chunk-WZQEK4WT.mjs";import{appendFileSync as ce,readFileSync as ue,renameSync as ge,writeFileSync as fe}from"node:fs";import{homedir as le,hostname as Z}from"node:os";import{join as N,resolve as me}from"node:path";var pe=10,H=1440*6e4,j=200,Y=384,V=6e4;function be(t,e){if(e!==Z())return!0;try{return process.kill(t,0),!0}catch(n){return n.code==="EPERM"}}function Q(t=process.env){let e=t.SANDFORGE_JOURNAL_DIR,n=e!==void 0&&e.trim()!==""?me(e):N(le(),".sandforge");return N(n,"storage-written")}var ye=/^[A-Za-z0-9]{15}(?:[A-Za-z0-9]{3})?$/;function _(t,e){if(ye.test(t))return N(e.dir??Q(),`${t.slice(0,15)}.ndjson`)}var R=l().min(1).max(200),Ae=U([S({at:l(),saidMB:m()}),S({at:l(),wrote:x(l(),m()),run:R.optional(),mb:m().positive().optional()}),S({at:l(),begunMB:m().positive(),run:R,pid:m().int().positive(),host:l(),rowBytes:x(l(),m().nonnegative()).optional()})]);function D(t){let e;try{e=ue(t,"utf8")}catch{return[]}let n=[];for(let r of e.split(`
|
|
8
|
+
`)){if(r.trim()==="")continue;let s;try{s=Ae.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}:{},...i.mb!==void 0?{mb:i.mb}:{}}:{at:o,begunMB:i.begunMB,run:i.run,pid:i.pid,host:i.host,...i.rowBytes!==void 0?{rowBytes:i.rowBytes}:{}})}return n.sort((r,s)=>r.at-s.at)}function v(t,e,n){let r=_(t,n);if(!r)return;let s=(n.now??new Date).getTime();try{K(n.dir??Q()),ce(r,`${JSON.stringify(e)}
|
|
9
|
+
`,{encoding:"utf8",mode:Y});let o=D(r);if(o.length<=j)return;let i=o.filter(u=>s-u.at<=H),d=new Set(i.flatMap(u=>"wrote"in u&&u.run!==void 0?[u.run]:[])),c=[...i.slice(0,-j/2).filter(u=>"begunMB"in u&&!d.has(u.run)),...i.slice(-j/2)].map(u=>JSON.stringify({...u,at:new Date(u.at).toISOString()})),f=`${r}.${process.pid}.tmp`;fe(f,c.length>0?`${c.join(`
|
|
10
|
+
`)}
|
|
11
|
+
`:"",{encoding:"utf8",mode:Y}),ge(f,r)}catch{}}function Pe(t,e,n={}){let r=(n.now??new Date).toISOString();v(t,{at:r,saidMB:e},n)}function X(t,e,n,r={}){if(!Number.isFinite(n)||n<=0||!R.safeParse(e).success)return;let s=(r.now??new Date).toISOString(),o=Object.fromEntries(Object.entries(r.rowBytes??{}).filter(([,i])=>Number.isFinite(i)&&i>=0));v(t,{at:s,begunMB:n,run:e,pid:process.pid,host:Z(),...Object.keys(o).length>0?{rowBytes:o}:{}},r)}function q(t,e,n={}){let r=Object.fromEntries(Object.entries(e).filter(([,d])=>Number.isFinite(d)&&d!==0)),{run:s}=n,o=s!==void 0&&R.safeParse(s).success?s:void 0;if(Object.keys(r).length===0&&!he(t,o,n))return;let i=(n.now??new Date).toISOString();v(t,{at:i,wrote:r,...o!==void 0?{run:o}:{}},n)}function Ie(t){let e=new Set(t.flatMap(n=>"wrote"in n&&n.run!==void 0&&n.mb===void 0?[n.run]:[]));return t.filter(n=>!("wrote"in n&&n.mb!==void 0&&n.run!==void 0&&e.has(n.run)))}function he(t,e,n){if(e===void 0)return!1;let r=_(t,n);if(!r)return!1;let s=D(r);return s.some(o=>"begunMB"in o&&o.run===e)&&!s.some(o=>"wrote"in o&&o.run===e)}function ee(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 Ce(t,e,n,r={}){let s=_(t,r);if(!s)return;let o=(r.now??new Date).getTime(),i=Ie(D(s)),d=pe*V,g=Se(i,o,r.alive??be),c=Math.min(o-d,g[0]?.at??1/0),f=a=>"wrote"in a&&a.at<=o&&a.at>=c,u=new Map(i.flatMap(a=>"begunMB"in a&&a.rowBytes!==void 0?[[a.run,a.rowBytes]]:[])),p=a=>{let I=a.run!==void 0?u.get(a.run):void 0;return Object.entries(a.wrote).reduce((h,[G,M])=>{let F=I?.[G];return h+(F!==void 0?M*F:Math.sign(M)*n(G,Math.abs(M)))},(a.mb??0)*1048576)},b=i.filter(f).map(a=>({at:a.at,bytes:p(a)}));if(b.length===0&&g.length===0)return;let ae=i.findIndex(a=>f(a)||g.includes(a)),A=i.slice(0,ae).filter(a=>"saidMB"in a).at(-1),T=b.filter(a=>o-a.at>d).length,k=A?(A.saidMB-e)*1048576:0,z=A?Oe(b,k,T):T,E=b.slice(z),P=A?k-O(b.slice(0,z)):0,y=g.map(a=>{let I=a.begunMB*1048576,h=Math.min(I,Math.max(0,P),we(i,a,e,o,p));return P-=h,{at:a.at,bytes:I-h}}).filter(a=>a.bytes>0),C=O(E)+O(y);if(C<=0)return;let de=Math.min(E[0]?.at??o,y[0]?.at??o);return{mb:C/1048576,runs:E.filter(a=>a.bytes>0).length+y.length,minutes:Math.max(1,Math.ceil((o-de)/V)),...y.length>0?{writing:y.length}:{}}}function Se(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>H||r.has(o.run)||s.has(o.run)?!1:(s.add(o.run),n(o.pid,o.host)))}function we(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 d=t[i];if(d===void 0||!("saidMB"in d))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,(d.saidMB-n)*1048576-g)}function O(t){return t.reduce((e,n)=>e+n.bytes,0)}function Oe(t,e,n=0){let r=O(t.slice(0,n)),s=n,o=r,i=Math.abs(e-r);for(let d=n;d<t.length;d++){r+=t[d]?.bytes??0;let g=Math.abs(e-r);(g<i||Math.abs(r-o)<1)&&(i=Math.min(g,i),s=d+1,o=r)}return s}import{createHash as Me}from"node:crypto";var te="lineage:runs",Re="lineage";function ne(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 d=`object:${i.objectApiName}`;s.push({id:d,type:"object",label:i.objectApiName,objectApiName:i.objectApiName,recordCount:i.records}),o.push({sourceId:n,targetId:d}),o.push({sourceId:d,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 B=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(te,n.slice(-this.limit),Re)}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}:{},...Be(e)}))}read(){let e=this.configStore.get(te);return Array.isArray(e)?e.filter(Ee):[]}};function Be(t){let e=t.nodes.find(n=>n.type==="destination");return e?{targetLabel:e.label}:{}}function Ee(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 xe=100,re="audit:trail",Le="audit",W=class{constructor(e,n=$){this.configStore=e;this.limit=n}configStore;limit;append(e){let n=this.read();n.push(e),this.configStore.set(re,n.slice(-this.limit),Le)}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??xe;return{entries:r.slice(s,s+o),total:r.length,offset:s,facets:je(n)}}read(){let e=this.configStore.get(re);return Array.isArray(e)?e.filter(Ne):[]}};function je(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 Ne(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 Ze="ABORTED_BEFORE_START";function _e(t){let e=t?.trim().toLowerCase();if(e)return`sha256:${Me("sha256").update(e).digest("hex").slice(0,12)}`}var ie=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 oe(t,e=new Date){ie.has(t.action)&&(q(t.orgId,ee(t.objects??[]),{now:e,...t.operationId!==void 0?{run:t.operationId}:{}}),t.operationId!==void 0&&se.delete(t.operationId))}var se=new Map;function He(t,e,n=new Date){if(!ie.has(t.action))return;let{mb:r,rowBytes:s}=typeof e=="number"?{mb:e}:e;X(t.orgId,t.operationId,r,{now:n,...s!==void 0?{rowBytes:s}:{}}),se.set(t.operationId,t.orgId)}function Qe(t,e,n=new Date){try{let r=t.services?.getSandforgeSetting?.("safety.auditLogging",!0)!==!1;if(!r&&e.outcome==="stopped"&&e.code===void 0){oe(e,n);return}let s=n.toISOString(),o=t.orgManager.getOrg(e.orgId),i=o?L(o):void 0,d=_e(o?.username),g=e.source?.origin==="org"?e.source.orgId:void 0,c=g!==void 0?t.orgManager.getOrg(g):void 0,f=c?L(c):void 0,u=e.objects??[];if(oe(e,n),new W(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}:{},...d?{userId:d}:{},...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 p=ne({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:De(u,e.carried),generatedAt:s});p&&new B(t.configStore).save(p)}catch(r){t.log(`[WARN] audit trail: run ${e.operationId} was not recorded \u2014 ${J(r)}`)}}function De(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 Xe(t){return{objectApiName:t,created:0,updated:0,deleted:0,failed:0}}export{B as a,pe as b,Pe as c,q as d,Ce as e,W as f,Ze as g,_e as h,oe as i,He as j,Qe as k,Xe as l};
|
|
@@ -0,0 +1,7 @@
|
|
|
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}from"./chunk-P4YOHLZ4.mjs";import"./chunk-BLMJ4WVI.mjs";import"./chunk-4NSXPONF.mjs";import"./chunk-XBYXT74L.mjs";import"./chunk-2YJJTQNC.mjs";import"./chunk-4VLP6RHC.mjs";import"./chunk-YTOTMJTY.mjs";import"./chunk-WJGK6VGU.mjs";import"./chunk-3L6DVNCR.mjs";import"./chunk-54V4FVEY.mjs";import"./chunk-XCA5AONB.mjs";import"./chunk-66NMFCWX.mjs";import"./chunk-TZXYVMZC.mjs";import"./chunk-CJAWKLAL.mjs";import"./chunk-PE7CHD2W.mjs";import"./chunk-VKREON6Q.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-VFKG2G37.mjs";import"./chunk-CL75DEMQ.mjs";import"./chunk-BOGNK4LV.mjs";import"./chunk-7O6EFNQS.mjs";import"./chunk-3LRFPGYZ.mjs";import"./chunk-KWUS7UAV.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-NV5QA2HY.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-YDXMTWAT.mjs";import"./chunk-PVZ72OOQ.mjs";import"./chunk-QIRO4HTE.mjs";import"./chunk-TYUYPFDJ.mjs";import"./chunk-DLSU66MY.mjs";import"./chunk-ATQML7ZK.mjs";import"./chunk-H6BHWAX7.mjs";import"./chunk-4CSBZZAL.mjs";import"./chunk-GP5J3DGS.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-OT2NHL2V.mjs";import"./chunk-ZVU7MD2S.mjs";import"./chunk-OLCS7JCT.mjs";import"./chunk-TQ6HEJ73.mjs";import"./chunk-65AMXOQU.mjs";import"./chunk-6HHSAPIM.mjs";import"./chunk-K5PUMHZU.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-EUIALBMX.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-Q7TLC3I2.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-ATBQIE2V.mjs";import"./chunk-UCUFLFNK.mjs";import"./chunk-4XROG5CT.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-DAUX63UB.mjs";import"./chunk-SZOJ7BEJ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-22L43JMK.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-3KJCSYXY.mjs";import"./chunk-HDDJ3CVN.mjs";import"./chunk-J347SPU6.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{d as CheckpointTakeStopped,a as DEFAULT_MAX_TOTAL,b as OBJECT_ROWS_MAX,f as holdingLimit,e as pastTheLimit,g as scopeCheckpoint,h as takeCheckpoint,c as takeOrgOf};
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
var l={AD:24,AE:23,AL:28,AT:20,AZ:28,BA:20,BE:16,BG:22,BH:22,BI:27,BR:29,BY:28,CH:21,CR:22,CY:28,CZ:24,DE:22,DJ:27,DK:18,DO:28,EE:20,EG:29,ES:24,FI:18,FK:18,FO:18,FR:27,GB:22,GE:22,GI:23,GL:18,GR:27,GT:28,HN:28,HR:21,HU:28,IE:22,IL:23,IQ:23,IS:26,IT:27,JO:30,KW:30,KZ:20,LB:28,LC:32,LI:21,LT:20,LU:20,LV:21,LY:25,MC:27,MD:24,ME:22,MK:19,MN:20,MR:27,MT:31,MU:30,NI:28,NL:18,NO:15,OM:23,PK:24,PL:28,PS:29,PT:25,QA:29,RO:24,RS:22,RU:33,SA:24,SC:31,SD:18,SE:24,SI:19,SK:24,SM:27,SO:23,ST:25,SV:28,TL:23,TN:24,TR:26,UA:29,VA:22,VG:24,XK:20,YE:30},d=`(?:${Object.keys(l).join("|")})\\d{2}(?: ?[A-Z0-9]{4}){2,7}(?: ?[A-Z0-9]{1,4})?`;function h(t){let n=t.slice(4)+t.slice(0,4),i=0;for(let e of n){let a=e>="A"&&e<="Z"?e.charCodeAt(0)-55:Number(e);i=(i*(a>9?100:10)+a)%97}return i}function f(t){let n=t.slice(0,2);if(!Object.hasOwn(l,n))return;let i=l[n],e="",a=0;for(;a<t.length&&e.length<i;){let c=t[a];if(a+=1,c!==" "){if(!/[A-Z0-9]/.test(c))return;e+=c}}if(!(e.length<i||!/^[A-Z]{2}\d{2}/.test(e)))return h(e)===1?a:void 0}function b(t){let n=0;for(let i=0;i<t.length;i++){let e=Number(t[t.length-1-i]);i%2===1&&(e*=2,e>9&&(e-=9)),n+=e}return n%10===0}function r(...t){return new RegExp(`(?<![a-z\xE0-\xFF])(?:${t.join("|")})(?![a-z\xE0-\xFF])`)}var P=[{regex:r("sexual orientation","sexual preference","orientation sexuelle"),classification:"Confidential",confidence:.85,label:"sexual_orientation",words:!0},{regex:r("gender identity","gender","sexe?","pronouns?","pronoms?","identit[e\xE9] de genre"),classification:"PII",confidence:.85,label:"gender",words:!0},{regex:r("salutations?","civility","honorifics?","civilit[e\xE9]s?"),classification:"PII",confidence:.8,label:"salutation",words:!0},{regex:r("marital status","marital","situation familiale","situation matrimoniale"),classification:"PII",confidence:.85,label:"marital_status",words:!0},{regex:r("nationality","nationalities","citizenship","nationalit[e\xE9]s?","citoyennet[e\xE9]"),classification:"PII",confidence:.85,label:"nationality",words:!0},{regex:r("ethnicity","ethnic","race","racial","ethnie","ethnique"),classification:"Confidential",confidence:.85,label:"ethnic_origin",words:!0},{regex:r("religion","religions","religious","religieux","religieuse"),classification:"Confidential",confidence:.85,label:"religion",words:!0},{regex:r("political (?:opinion|affiliation|party|view)s?","opinions? politiques?","parti politique"),classification:"Confidential",confidence:.85,label:"political_opinion",words:!0},{regex:r("trade union","labou?r union","union member(?:ship)?","syndicat","syndicale?"),classification:"Confidential",confidence:.85,label:"union_membership",words:!0},{regex:r("disability","disabilities","handicaps?"),classification:"PHI",confidence:.85,label:"disability",words:!0}],g=/(?<![a-z])(?:(?:first|last|middle|maiden)[\s_]?name(?:local)?|surname|suppliedname)(?![a-z])/,x=new Set(["string","textarea","encryptedstring"]);function M(t){return g.test(t.toLowerCase().replace(/__c$/i,""))}var _=new Set(["string","textarea","encryptedstring"]),y=new Set(["email","emails","mail","mails","courriel","courriels"]),C=new Set(["ToAddress","CcAddress","BccAddress"]),R=new Set(["phone","phones","telephone","tel","mobile","cell","fax","sms","gsm","whatsapp","portable"]);function p(t){return t.replace(/__[a-z]+$/i,"").replace(/^[a-z0-9]+__/i,"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/([A-Za-z])(\d)/g,"$1 $2").replace(/(\d)([A-Za-z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).filter(n=>n!=="").map(n=>n.toLowerCase())}function A(t,n){let i=n.toLowerCase();if(i==="email")return"email";if(i==="phone")return"phone";if(!_.has(i))return;if(C.has(t))return"email";let e;for(let a of p(t))y.has(a)||a.endsWith("email")?e="email":(R.has(a)||a.endsWith("phone"))&&(e="phone");return e}function F(t,n){let i=new Set(t.detectPII("unknown",n.map(e=>({apiName:e.name,label:e.name,type:e.type}))).piiFields.map(e=>e.fieldApiName));return n.filter(e=>i.has(e.name)||A(e.name,e.type)!==void 0).map(e=>e.name)}function I(t,n){let{holds:i}=t;if(!i)return t.regex.test(n);let e=new RegExp(t.regex.source,`${t.regex.flags.replace("g","")}g`);for(let a=e.exec(n);a!==null;a=e.exec(n)){if(i(a[0]))return!0;e.lastIndex=a.index+1}return!1}var u=class{namePatterns;contentPatterns;constructor(){this.namePatterns=w(),this.contentPatterns=N()}detectPII(n,i,e){let a=new Map;for(let s of i)this.detectByName(s,a),this.detectByType(s,a);if(e&&e.length>0)for(let s of i)this.detectByContent(s,e,a);let c=Array.from(a.values());return{objectName:n,totalFields:i.length,piiFields:c,riskLevel:S(c.length)}}getPatterns(){let n={};for(let i of this.contentPatterns)n[i.label]=i.regex;return n}contentMatches(n,i){let e=this.contentPatterns.find(a=>a.label===n);return e!==void 0&&I(e,i)}detectByName(n,i){let e=n.apiName.toLowerCase().replace(/__c$/i,""),a=p(n.apiName).join(" "),c=n.label.toLowerCase(),s=n.type.toLowerCase();for(let o of this.namePatterns){if(o.types&&!o.types.has(s))continue;let m=o.words?a:e;if(o.regex.test(m)||o.regex.test(c)){this.addDetection(i,n,{classification:o.classification,detectionMethod:"name_pattern",confidence:o.confidence,pattern:o.label});return}}}detectByType(n,i){if(i.has(n.apiName))return;let e=n.type.toLowerCase();e==="email"?this.addDetection(i,n,{classification:"PII",detectionMethod:"type_analysis",confidence:.95,pattern:"email_type"}):e==="phone"&&this.addDetection(i,n,{classification:"PII",detectionMethod:"type_analysis",confidence:.9,pattern:"phone_type"})}detectByContent(n,i,e){if(!e.has(n.apiName))for(let a of this.contentPatterns){let c=E(n.apiName,i,a);if(c>0){let s=c/i.length,o=a.confidence*Math.min(s*2,1);this.addDetection(e,n,{classification:a.classification,detectionMethod:"content_pattern",confidence:o,pattern:a.label});return}}}addDetection(n,i,e){let a=n.get(i.apiName);a&&a.confidence>=e.confidence||n.set(i.apiName,{fieldApiName:i.apiName,fieldLabel:i.label,classification:e.classification,detectionMethod:e.detectionMethod,confidence:e.confidence,pattern:e.pattern})}};function w(){return[{regex:/\bemail\b/i,classification:"PII",confidence:.95,label:"email"},{regex:/\bphone\b/i,classification:"PII",confidence:.9,label:"phone"},{regex:/\bmobilephone\b/i,classification:"PII",confidence:.9,label:"mobile_phone"},{regex:/\bpersonemail\b/i,classification:"PII",confidence:.95,label:"person_email"},{regex:/\bmailingstreet\b/i,classification:"PII",confidence:.85,label:"mailing_street"},{regex:/\bbillingstreet\b/i,classification:"PII",confidence:.85,label:"billing_street"},{regex:/\bssn\b/i,classification:"PII",confidence:.99,label:"ssn"},{regex:/\bsocialsecuritynumber\b/i,classification:"PII",confidence:.99,label:"social_security_number"},{regex:/\bsocial_security\b/i,classification:"PII",confidence:.99,label:"social_security"},{regex:/\bbirthdate\b/i,classification:"PII",confidence:.9,label:"birthdate"},{regex:/\bdateofbirth\b/i,classification:"PII",confidence:.9,label:"date_of_birth"},{regex:/\bdate_of_birth\b/i,classification:"PII",confidence:.9,label:"date_of_birth_underscore"},{regex:/\bnationalid\b/i,classification:"PII",confidence:.95,label:"national_id"},{regex:/\bnational_id\b/i,classification:"PII",confidence:.95,label:"national_id_underscore"},{regex:/\bcreditcardnumber\b/i,classification:"PCI",confidence:.99,label:"credit_card_number"},{regex:/\bcreditcard\b/i,classification:"PCI",confidence:.95,label:"credit_card"},{regex:/\bcredit_card\b/i,classification:"PCI",confidence:.95,label:"credit_card_underscore"},{regex:/\biban\b/i,classification:"PCI",confidence:.95,label:"iban"},{regex:/\bbankaccount\b/i,classification:"PCI",confidence:.95,label:"bank_account"},{regex:/\bbank_account\b/i,classification:"PCI",confidence:.95,label:"bank_account_underscore"},{regex:/\bmedical\b/i,classification:"PHI",confidence:.85,label:"medical"},{regex:/\bdiagnos/i,classification:"PHI",confidence:.9,label:"diagnosis"},{regex:/\bhealth\b/i,classification:"PHI",confidence:.8,label:"health"},{regex:/\bpatient\b/i,classification:"PHI",confidence:.8,label:"patient"},{regex:/\bpassport\b/i,classification:"PII",confidence:.95,label:"passport"},{regex:/\bdriver.?licen/i,classification:"PII",confidence:.95,label:"driver_license"},{regex:/\baddress\b/i,classification:"PII",confidence:.8,label:"address"},{regex:g,classification:"PII",confidence:.85,label:"person_name",types:x},...P]}function N(){return[{regex:/[\w.-]+@[\w.-]+\.\w{2,}/,classification:"PII",confidence:.9,label:"email_content"},{regex:/\d{3}-\d{2}-\d{4}/,classification:"PII",confidence:.95,label:"ssn_content"},{regex:/(?<![A-Za-z0-9])\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}(?!\d)/,classification:"PCI",confidence:.95,label:"credit_card_content",holds:t=>b(t.replace(/\D/g,""))},{regex:new RegExp(d),classification:"PCI",confidence:.85,label:"iban_content",holds:t=>f(t)!==void 0},{regex:/\+?\d[\d\s-]{7,}/,classification:"PII",confidence:.7,label:"phone_content"}]}function E(t,n,i){let e=0;for(let a of n){let c=a[t];typeof c=="string"&&I(i,c)&&e++}return e}function S(t){return t===0?"none":t<=2?"low":t<=5?"medium":t<=10?"high":"critical"}export{d as a,f as b,b as c,M as d,A as e,F as f,u as g};
|
|
@@ -0,0 +1,7 @@
|
|
|
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 c}from"./chunk-QIRO4HTE.mjs";import{d as u}from"./chunk-TYUYPFDJ.mjs";var f=2,m=39,g=13,_=new Set(["string","textarea","email","phone","url","encryptedstring"]),h=new Set(["date","datetime","time"]),T=new Set(["picklist","multipicklist","combobox"]),S=new Set(["int","long","double","currency","percent"]),y=/^(?:ssn|social_security|national_id|passport|driver_license|credit_card|iban|bank_account)/,d=new Set(["gender","salutation","marital_status","nationality","ethnic_origin","religion","political_opinion","union_membership","sexual_orientation","disability"]),p=new Set(["medical","diagnosis","health","patient"]),b=new Set(["address","mailing_street","billing_street"]),E=new Set(["email","emails","mail","courriel"]),k=new Set(["phone","telephone","mobile","fax","sms","whatsapp","portable"]);function P(n){return n.replace(/__[a-z]+$/i,"").replace(/^[a-z0-9]+__/i,"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).filter(e=>e!=="").map(e=>e.toLowerCase())}function w(n){let e=n.join(" ");return/\b(?:postal ?code|post ?code|zip|code postal)\b/.test(e)}function A(n){let e=n.at(-1),t=e==="code"?n.at(-2):e;return t==="state"||t==="province"||t==="country"}function D(n){let e=n.length;return typeof e=="number"&&e>0?e:void 0}function i(n){return n!==void 0&&n<g?{ruleType:"mask"}:{ruleType:"fake"}}function M(n){let{field:e,pattern:t}=n;if(e.updateable!==!0||e.calculated===!0||e.autoNumber===!0)return;let a=e.type.toLowerCase(),s=e.nillable===!0?{ruleType:"nullify"}:void 0,o=P(e.name);if(h.has(a)||T.has(a)||S.has(a))return s;if(!_.has(a))return;let r=D(e);return w(o)?{ruleType:"truncate",config:{truncateLength:f,truncateKeep:"first"}}:A(o)?s??i(r):c[e.name]!==void 0?{ruleType:"fake"}:b.has(t)?i(r):a==="textarea"?d.has(t)||p.has(t)?s??i(r):{ruleType:"redact"}:a==="email"||/^(?:email|person_email)/.test(t)||o.some(l=>E.has(l))?{ruleType:"fake"}:a==="phone"||/^(?:phone|mobile_phone)/.test(t)||o.some(l=>k.has(l))?{ruleType:"preserve_format"}:t==="person_name"||u(e.name)?i(r):y.test(t)?r!==void 0&&r<m?{ruleType:"mask"}:{ruleType:"hash"}:d.has(t)||p.has(t)?s??i(r):i(r)}export{M as a};
|
|
@@ -0,0 +1,7 @@
|
|
|
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{Zb as g}from"./chunk-J347SPU6.mjs";var u=class{config;constructor(e){this.config={maxRetries:e?.maxRetries??3,initialDelay:e?.initialDelay??1e3,maxDelay:e?.maxDelay??3e4,backoffMultiplier:e?.backoffMultiplier??2,jitter:e?.jitter??!0}}calculateDelay(e){let o=this.config.initialDelay*Math.pow(this.config.backoffMultiplier,e),r=Math.min(o,this.config.maxDelay);if(!this.config.jitter)return r;let n=r/2;return Math.floor(n+Math.random()*n)}async execute(e){let o,r=0;for(let n=0;n<=this.config.maxRetries;n++)try{return{success:!0,result:await e(),attempts:n+1,totalDelay:r}}catch(a){if(o=a instanceof Error?a:new Error(String(a)),n<this.config.maxRetries){let l=this.calculateDelay(n);r+=l,await new Promise(i=>setTimeout(i,l))}}return{success:!1,error:o,attempts:this.config.maxRetries+1,totalDelay:r}}shouldRetry(e){return e<this.config.maxRetries}getConfig(){return{...this.config}}};var p="UNABLE_TO_LOCK_ROW",c=3,y=2e3,b=200,x=`Rows the target refuses for a record lock go again on their own, up to ${c} times each: up to ${c} more requests for every ${b} of them, which no estimate made before the write can count.`,A=`rows the target refuses for a record lock go again, up to ${c} times each: up to ${c} more requests for every ${b} of them, not counted above`,R="CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY",E=/^([A-Z][A-Z0-9_]*):\s*([\s\S]*)$/;function h(t,e){return t===p||t===R&&g.test(e)}function S(t,e){return e&&e.length>0?e.every(o=>h(o.statusCode,o.message)):t.length>0&&t.every(o=>{let r=E.exec(o.trim());return r!==null&&h(r[1],r[2])})}var _=new u({initialDelay:y});function O(t){return _.calculateDelay(t)}function T(t,e){return new Promise(o=>{if(e?.aborted){o();return}let r=()=>{clearTimeout(n),e?.removeEventListener("abort",r),o()},n=setTimeout(r,t);e?.addEventListener("abort",r,{once:!0})})}function w(t){return`sent again ${t===1?"once":`${t} times`}, waiting longer each time: the target still could not lock a record the write needed`}function C(t,e){return`${t} \u2014 ${w(e)}`}async function $(t){let e=[...t.outcomes],o=new Map,r=e.flatMap((i,s)=>t.locked(i)?[s]:[]),n=r.length;for(let i=0;r.length>0&&i<c&&(await t.wait(O(i)),!t.stopped());i++){let s=r,f=await t.send(s);if(f.slice(0,s.length).forEach((m,d)=>{e[s[d]]=m,o.set(s[d],(o.get(s[d])??0)+1)}),f.length<s.length)break;r=s.filter(m=>t.locked(e[m]))}let a=0,l=0;for(let[i,s]of o)t.written(e[i])?a++:t.locked(e[i])&&(l++,e[i]=t.note(e[i],s));return{outcomes:e,refused:n,sentAgain:o.size,written:a,stillLocked:l,notSentAgain:n-o.size}}function N(t,e,o="written"){if(e.refused===0)return;let r=e.sentAgain-e.written-e.stillLocked,n=[`${e.written} ${o}`,...e.stillLocked>0?[`${e.stillLocked} still refused for the lock`]:[],...r>0?[`${r} refused for another reason`]:[],...e.notSentAgain>0?[`${e.notSentAgain} not sent again: the run was stopped`]:[]];return`${e.refused} ${t} refused because the target could not lock a record their write needed (${p}), sent again up to ${c} times, waiting longer each time: ${n.join(", ")}`}export{u as a,x as b,A as c,S as d,T as e,C as f,$ as g,N as h};
|
|
@@ -0,0 +1,7 @@
|
|
|
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{Aa as x,Ba as y,Ca as z,Da as A,Ea as B,Fa as C,Ga as D,Ha as E,Ia as F,Ja as G,Ka as H,La as I,Ma as J,Na as K,Oa as L,Pa as M,Qa as N,Ra as O,Sa as P,Ta as Q,Ua as R,da as a,ea as b,fa as c,ga as d,ha as e,ia as f,ja as g,ka as h,la as i,ma as j,na as k,oa as l,pa as m,qa as n,ra as o,sa as p,ta as q,ua as r,va as s,wa as t,xa as u,ya as v,za as w}from"./chunk-OLCS7JCT.mjs";import"./chunk-TQ6HEJ73.mjs";import"./chunk-65AMXOQU.mjs";import"./chunk-6HHSAPIM.mjs";import"./chunk-K5PUMHZU.mjs";import"./chunk-EUIALBMX.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-Q7TLC3I2.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-ATBQIE2V.mjs";import"./chunk-UCUFLFNK.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-DAUX63UB.mjs";import"./chunk-SZOJ7BEJ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-22L43JMK.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-J347SPU6.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};
|
|
@@ -4,7 +4,7 @@ import { dirname as __sandforgeDirname } from 'node:path';
|
|
|
4
4
|
const require = __sandforgeRequire(import.meta.url);
|
|
5
5
|
const __filename = __sandforgePath(import.meta.url);
|
|
6
6
|
const __dirname = __sandforgeDirname(__filename);
|
|
7
|
-
import{g as ae,i as V}from"./chunk-
|
|
7
|
+
import{g as ae,i as V}from"./chunk-2YJJTQNC.mjs";import{m as oe,o as ie}from"./chunk-DLSU66MY.mjs";import{B as q,H as ee,I as te,J as ne,L as re,d as M,k as B,s as W,t as E,u as Z,v as z,w as Q,z as j}from"./chunk-4CSBZZAL.mjs";import{cb as J,db as U,eb as D}from"./chunk-J347SPU6.mjs";import{b as N,e as K,m as F,v as L}from"./chunk-WZQEK4WT.mjs";import{createCipheriv as Se,createDecipheriv as Ce,createHash as m,hkdfSync as Te,randomBytes as C,timingSafeEqual as Pe}from"node:crypto";import{createReadStream as He}from"node:fs";import{lstat as se,open as _,rename as _e,rm as $e,statfs as Ne}from"node:fs/promises";import{basename as de,dirname as le,join as ue}from"node:path";import{Readable as pe}from"node:stream";import{pipeline as ye}from"node:stream/promises";import{createGunzip as Ke,createGzip as Fe}from"node:zlib";var bt=".sfcheckpoint",De=1024*1024,Me=new Set([1]),ze=new Set([1,2]),$=32,O=16,je=4096,Ve=1024,Xe=64*1024*1024,me=2**32,ge="sandforge-checkpoint/1 block key",we="sandforge-checkpoint/1 key check",X="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",Ye=Math.ceil($*8/5),g="Nothing was imported.";function Bt(){return C($)}function At(n){if(n.length!==$)throw new RangeError("Not a key of a checkpoint file");let e="",t=0,r=0;for(let o of n)for(t=(t<<8|o)&65535,r+=8;r>=5;)e+=X[t>>>r-5&31],r-=5;return r>0&&(e+=X[t<<5-r&31]),(e.match(/.{1,4}/g)??[]).join("-")}function Et(n){let e=n.replace(/[\s-]/g,"").toUpperCase();if(e.length!==Ye||!/^[A-Z2-7]+$/.test(e))return;let t=Buffer.alloc($),r=0,o=0,i=0;for(let a of e)r=(r<<5|X.indexOf(a))&65535,o+=5,o>=8&&(t[i++]=r>>>o-8&255,o-=8);if((r&(1<<o)-1)===0)return t}function T(n,e,t,r){return Buffer.from(Te("sha256",n,e,t,r))}function ke(n,e){let t=Buffer.alloc(12);return n.copy(t,0),t.writeUInt32BE(e,8),t}function be(n,e,t){let r=Buffer.alloc(37);return n.copy(r,0),r.writeUInt32BE(e,32),r[36]=t?1:0,r}function Ge(n,e,t,r){let o=Se("aes-256-gcm",n.blockKey,ke(n.prefix,e),{authTagLength:O});return o.setAAD(be(n.headerHash,e,t)),Buffer.concat([o.update(r),o.final(),o.getAuthTag()])}function Le(n,e,t,r){let o=Ce("aes-256-gcm",n.blockKey,ke(n.prefix,e),{authTagLength:O});o.setAAD(be(n.headerHash,e,t)),o.setAuthTag(r.subarray(r.length-O));try{let i=o.update(r.subarray(0,r.length-O));return Buffer.concat([i,o.final()])}catch{return}}var P=class extends Error{constructor(t){super(t.message);this.refusal=t;this.name="ImportRefused"}refusal};function f(n){return new P({code:"IMPORT_DAMAGED",message:`This checkpoint file ${n}: it was changed or damaged after it was exported. ${g}`})}var I=class extends Error{constructor(t,r){super(r);this.code=t;this.name="CheckpointExportError"}code};function Je(n){return{...H(n,Be),org:H(n.org,Ae)}}var Be=["lastRewind","takenOn","expiresAt","bytes","importedFrom"],Ae=["alias"];function H(n,e){return Object.fromEntries(Object.entries(n).filter(([t])=>!e.includes(t)))}async function*Ee(n,e){if(e===0)return;let t=0;for await(let r of He(n,{start:0,end:e-1})){let o=r;t+=o.length,yield o}if(t!==e)throw new I("EXPORT_CHANGED",`${de(n)} of the checkpoint shrank while it was exported: export it again.`)}async function xe(n,e){let t=m("sha256");for await(let r of Ee(n,e))t.update(r);return t.digest("hex")}async function xt(n){let{folder:e,checkpoint:t,out:r,key:o}=n,i=n.chunkBytes??De;if(await se(r).catch(()=>{}))throw new I("EXPORT_EXISTS",`${r} is there already: name another file, or move that one away first.`);let a=Buffer.from(`${JSON.stringify(Je(t))}
|
|
8
8
|
`,"utf8"),s=[{path:E,bytes:a.length,sha256:m("sha256").update(a).digest("hex"),content:a}];for(let u of await z(e))u.path!==E&&s.push({...u,sha256:await xe(u.file,u.bytes)});let h=s.some(u=>u.path===W);h&&await V(e);let c=C(32),d=C(8),{dataStorageMaxMB:l,staging:p}=t.org,v={format:"sandforge-checkpoint",formatVersion:h?2:1,checkpointFormat:1,sandforgeVersion:n.sandforgeVersion,organizationId:B(t.org.organizationId),orgTier:t.org.tier,...l!==void 0?{dataStorageMaxMB:l}:{},...p===!0?{staging:p}:{},checkpointId:t.checkpointId,takenAt:t.takenAt,records:Ie(t),objects:t.objects.length,files:s.length,bytes:s.reduce((u,b)=>u+b.bytes,0),cipher:"aes-256-gcm",kdf:"hkdf-sha256",salt:c.toString("hex"),noncePrefix:d.toString("hex"),keyCheck:T(o,c,we,16).toString("hex"),chunkBytes:i},R=Buffer.from(`${JSON.stringify(D.parse(v))}
|
|
9
9
|
`),w={blockKey:T(o,c,ge,32),prefix:d,headerHash:m("sha256").update(R).digest()},S=ue(le(r),`.${de(r)}.${process.pid}-${C(4).toString("hex")}.tmp`),y=m("sha256"),k=0,A=await _(S,"wx",M);try{try{let u=async b=>{y.update(b),k+=b.length,await Oe(A,b)};await u(R),await ye(pe.from(Ue(s)),Fe({level:6}),async b=>{await We(b,i,w,u)}),await A.sync()}finally{await A.close()}if(await se(r).catch(()=>{}))throw new I("EXPORT_EXISTS",`${r} appeared while the checkpoint was exported: name another file.`);await _e(S,r)}catch(u){throw await $e(S,{force:!0}),u}return{header:v,bytes:k,sha256:y.digest("hex")}}async function Oe(n,e){for(let t=0;t<e.length;){let{bytesWritten:r}=await n.write(e,t,e.length-t);t+=r}}function Ie(n){return n.objects.reduce((e,t)=>e+t.records,0)}async function*Ue(n){for(let e of n){let{path:t,bytes:r,sha256:o}=e;if(yield Buffer.from(`${JSON.stringify({path:t,bytes:r,sha256:o})}
|
|
10
10
|
`,"utf8"),e.content!==void 0){yield e.content;continue}let i=m("sha256");for await(let a of Ee(e.file??"",r))i.update(a),yield a;if(i.digest("hex")!==o)throw new I("EXPORT_CHANGED",`${t} of the checkpoint changed while it was exported: export it again.`)}yield Buffer.from(`${JSON.stringify({end:!0,files:n.length})}
|
|
@@ -0,0 +1,7 @@
|
|
|
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{f as a,g as b,h as c,i as d,j as e,k as f,l as g}from"./chunk-BBZUGKBZ.mjs";import"./chunk-4NSXPONF.mjs";import"./chunk-XBYXT74L.mjs";import"./chunk-4VLP6RHC.mjs";import"./chunk-66NMFCWX.mjs";import"./chunk-VKREON6Q.mjs";import"./chunk-3LRFPGYZ.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-YDXMTWAT.mjs";import"./chunk-DLSU66MY.mjs";import"./chunk-ATQML7ZK.mjs";import"./chunk-H6BHWAX7.mjs";import"./chunk-4CSBZZAL.mjs";import"./chunk-GP5J3DGS.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-ATBQIE2V.mjs";import"./chunk-UCUFLFNK.mjs";import"./chunk-4XROG5CT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-DAUX63UB.mjs";import"./chunk-SZOJ7BEJ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-22L43JMK.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-3KJCSYXY.mjs";import"./chunk-HDDJ3CVN.mjs";import"./chunk-J347SPU6.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{d as diffOfPicked,b as heldInPlaceReason,g as planSelection,c as rewindPlan,a as rewindWriters,f as selectionPlanOf,e as snapshotRowsOf};
|
|
@@ -0,0 +1,7 @@
|
|
|
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{j as a,k as b,l as c,m as d,n as e,o as f,p as g,q as h,r as i,s as j,t as k,u as l,v as m,w as n,x as o,y as p}from"./chunk-O6FHK6NQ.mjs";import"./chunk-GFB2DNCB.mjs";import"./chunk-JFXQZPRY.mjs";import"./chunk-BBZUGKBZ.mjs";import"./chunk-P4YOHLZ4.mjs";import"./chunk-BLMJ4WVI.mjs";import"./chunk-4NSXPONF.mjs";import"./chunk-XBYXT74L.mjs";import"./chunk-2YJJTQNC.mjs";import"./chunk-4VLP6RHC.mjs";import"./chunk-FV6MOSHD.mjs";import"./chunk-YTOTMJTY.mjs";import"./chunk-WJGK6VGU.mjs";import"./chunk-3L6DVNCR.mjs";import"./chunk-54V4FVEY.mjs";import"./chunk-XCA5AONB.mjs";import"./chunk-66NMFCWX.mjs";import"./chunk-TZXYVMZC.mjs";import"./chunk-CJAWKLAL.mjs";import"./chunk-PE7CHD2W.mjs";import"./chunk-VKREON6Q.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-VFKG2G37.mjs";import"./chunk-CL75DEMQ.mjs";import"./chunk-BOGNK4LV.mjs";import"./chunk-7O6EFNQS.mjs";import"./chunk-3LRFPGYZ.mjs";import"./chunk-KWUS7UAV.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-NV5QA2HY.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-YDXMTWAT.mjs";import"./chunk-PVZ72OOQ.mjs";import"./chunk-QIRO4HTE.mjs";import"./chunk-TYUYPFDJ.mjs";import"./chunk-DLSU66MY.mjs";import"./chunk-ATQML7ZK.mjs";import"./chunk-H6BHWAX7.mjs";import"./chunk-4CSBZZAL.mjs";import"./chunk-GP5J3DGS.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-OT2NHL2V.mjs";import"./chunk-ZVU7MD2S.mjs";import"./chunk-OLCS7JCT.mjs";import"./chunk-TQ6HEJ73.mjs";import"./chunk-65AMXOQU.mjs";import"./chunk-6HHSAPIM.mjs";import"./chunk-K5PUMHZU.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-EUIALBMX.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-Q7TLC3I2.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-ATBQIE2V.mjs";import"./chunk-UCUFLFNK.mjs";import"./chunk-4XROG5CT.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-DAUX63UB.mjs";import"./chunk-SZOJ7BEJ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-22L43JMK.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-3KJCSYXY.mjs";import"./chunk-HDDJ3CVN.mjs";import"./chunk-J347SPU6.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{d as NOT_REMADE_WORDS,b as OTHERS_DELETION_WORDS,c as OUT_OF_REACH_WORDS,j as REWIND_AUTOMATION_LIFTED_BY,a as REWIND_RESIDUAL_IDS,i as RewindStopped,m as addedStorageMB,k as automationUnread,o as counted,h as heldWhile,l as inRewindWords,g as muteOfSteps,e as notAskedWords,p as rewindOrg,f as rewindOrgOf,n as undoCannotOfJournal};
|