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{j as ee,l as M}from"./chunk-HIDW7FNV.mjs";import{d as G}from"./chunk-JAEDM4SI.mjs";import{b as V,c as X,g as z}from"./chunk-LC3NDW4N.mjs";import{Dc as ne,Ec as N,Oc as re,Zb as te,i as Y,j as T,jc as se,k as K,m as J,q as Q,s as Z}from"./chunk-KB4ZHM4Q.mjs";import{c as U,d as B}from"./chunk-Q7TLC3I2.mjs";import{B as H}from"./chunk-YA6ATMTB.mjs";import{b as $}from"./chunk-CA5NAXSU.mjs";import{Md as P,Qd as C,Vd as S,Yd as F,Zd as q}from"./chunk-PMWAFDUB.mjs";var Pe=5e3,x=2e3,me=1e3,pe={masking:{during:"during the masking",records:"records it masked"},restore:{during:"during the restore",records:"records it put back"},erasure:{during:"during the erasure",records:"records it overwrote"}};function oe(e,t){let n=new Set(t.map(s=>s.toLowerCase()));return(e?.objects??[]).filter(s=>n.has(s.objectApiName.toLowerCase())).filter(s=>(s.duplicateRules??[]).length>0).map(s=>({objectApiName:s.objectApiName,rules:(s.duplicateRules??[]).map(a=>a.name)}))}function ae(e){return typeof e=="string"?e.slice(0,15):""}async function ge(e,t){let{rules:n}=t,s=0,a=r=>(s++,e.query(r));try{let r=H(new Date(Date.parse(t.since)-me).toISOString()),i=new Set([...t.masked].map(ae)),c=await a(`SELECT Id, DuplicateRecordSetId, RecordId FROM DuplicateRecordItem WHERE CreatedDate >= ${r} LIMIT ${x+1}`),u=c.done===!1||c.records.length>x,d=c.records.slice(0,x),p=new Set(d.filter(o=>i.has(ae(o.RecordId))).map(o=>String(o.DuplicateRecordSetId??"")).filter(o=>o!=="")),l=d.filter(o=>p.has(String(o.DuplicateRecordSetId??""))).length,m=0;for(let o of G([...p])){let f=await a(`SELECT Id FROM DuplicateRecordSet WHERE CreatedDate >= ${r} AND Id IN (${o})`);m+=f.records.length}return{rules:n,sets:m,items:l,...u?{atLeast:!0}:{},requests:s}}catch(r){return{rules:n,sets:0,items:0,unread:$(r),requests:s}}}function Ce(e,t,n){let s=n.now??Date.now,a=n.sleep??(l=>new Promise(m=>setTimeout(m,l))),r=new Set(t.map(l=>l.objectApiName.toLowerCase())),i=l=>r.has(l.toLowerCase()),c,u=0,d=new Set,p=0;return{covers:i,beforeWrite:l=>{i(l)&&c===void 0&&(u=s())},wrote:(l,m)=>{if(!i(l))return;let o=!1;for(let h of m)typeof h!="string"||h===""||(d.add(h),o=!0);if(!o)return;p=s();let f=u;c??=e.serverTime().then(h=>{let b=Date.parse(h);return Number.isNaN(b)?{unread:`it answered "${h}"`}:{at:new Date(b-Math.max(0,s()-f)).toISOString()}},h=>({unread:$(h)}))},held:()=>d.size,read:async()=>{if(d.size===0)return;let l=c?await c:void 0;if(!l||"unread"in l)return{rules:t,sets:0,items:0,unread:l?`the org's clock: ${l.unread}`:"the org's clock was not read",requests:l?1:0};let m=Math.max(0,p+n.settleMs-s());m>0&&await a(m);let o=await ge(e,{rules:t,since:l.at,masked:d});return{...o,requests:(o.requests??0)+1,waitedMs:m}}}}function Fe(e,t){if(!e)return t;if(!t)return e;let n=[e.unread,t.unread].filter(s=>s!==void 0);return{rules:t.rules.length>=e.rules.length?t.rules:e.rules,sets:e.sets+t.sets,items:e.items+t.items,...e.atLeast||t.atLeast?{atLeast:!0}:{},...n.length>0?{unread:n.join("; ")}:{},requests:(e.requests??0)+(t.requests??0),waitedMs:(e.waitedMs??0)+(t.waitedMs??0)}}function qe(e){return e!==void 0&&(e.sets>0||e.items>0||e.unread!==void 0)}function fe(e){return e.map(t=>`"${t}"`).join(", ")}function he(e){return e<=0?"without waiting":e<1e3?"after waiting less than 1 s":`after waiting ${Math.round(e/1e3)} s`}function Ue(e,t,n="masking"){if(!e||e.rules.length===0)return"";let s=pe[n],a=e.rules.map(c=>`${c.objectApiName} (${fe(c.rules)})`).join(", ");if(e.unread!==void 0)return`What the duplicate rules of ${t} on ${a} wrote ${s.during} could not be read (${e.unread}): a duplicate record set they wrote stays.`;let r=e.requests!==void 0?` Read in ${e.requests} request(s), ${he(e.waitedMs??0)}.`:"";if(e.sets===0&&e.items===0)return`The duplicate rules of ${t} on ${a} wrote nothing for the ${s.records}.`+r;let i=e.atLeast===!0?"at least ":"";return`The duplicate rules of ${t} on ${a} wrote ${i}${e.sets} duplicate record set(s) and ${i}${e.items} item(s) ${s.during}, for ${s.records}: kept, as they name records that stay.${r}`}var we="AUTOMATION_NOT_ACCEPTED",Oe="EMAILS_EXCEEDED",Ae="ORG_TEMPORARILY_UNREACHABLE";function be(e,t){return e==="cleanup"||e==="empty"?{delete:[...t]}:e==="restore"?{bringBack:[...t],giveBack:[...t]}:e==="emptyUndo"?{bringBack:[...t]}:{giveBack:[...t]}}function $e(e,t){let n=e==="cleanup"||e==="empty"?"delete":"update";return t.filter(s=>s.records>0).map(s=>({objectApiName:s.objectApiName,write:n,records:s.records}))}var E={masking:{heading:"masking automation: what {org} runs as the masking writes over the records",the:"the masking",this:"this masking",writes:"writes over",verb:"mask",nothing:"Nothing was written.",flag:"to mask all the same"},restore:{heading:"restore automation: what {org} runs as the restore puts the backup's values back",the:"the restore",this:"this restore",writes:"puts back",verb:"restore",nothing:"Nothing was written.",flag:"to restore all the same"},cleanup:{heading:"cleanup automation: what {org} runs as the cleanup deletes the records",the:"the cleanup",this:"this cleanup",writes:"deletes",verb:"delete",nothing:"Nothing was deleted.",flag:"to delete all the same"},empty:{heading:"emptying automation: what {org} runs as the emptying deletes the records",the:"the emptying",this:"this emptying",writes:"deletes",verb:"empty",nothing:"Nothing was deleted.",flag:"to empty all the same"},emptyUndo:{heading:"undo automation: what {org} runs as the undo brings the records back",the:"the undo",this:"this undo",writes:"brings back",verb:"undo",nothing:"Nothing was written.",flag:"to undo all the same"}},ye={masking:"masking",restore:"restore",cleanup:"cleanup",empty:"empty",emptyUndo:"undo"};function Qe(e){return e.erasure===!0?"erasure":e.fromPage===!0?"page":void 0}var De={"accept-automation":"acceptAutomation","accept-emails":"acceptEmails","mute-automation":"muteAutomation"},Re={"accept-emails":"the confirmation's box that lets the org send these emails","mute-automation":"the confirmation's box that mutes the target's automation"},ke={mask:"masking",restore:"restore",delete:"cleanup",erase:"erasure",empty:"emptying",undo:"undo"};function ie(e){let t=n=>Re[n]??`--${n}`;return e.replace(/\bAdd --accept-automation to (mask|restore|delete|erase|empty|undo) all the same\b/g,(n,s)=>`Confirm the ${ke[s]??s} from its confirmation, which lists what fires, to ${s} all the same`).replace(/\bWith --mute-automation,/g,`With ${t("mute-automation")} ticked,`).replace(/\bAdd --(accept-emails|mute-automation)\b/g,(n,s)=>`Tick ${t(s)}`).replace(/(^|[.:;] )--(accept-emails|mute-automation)\b/g,(n,s,a)=>`${s}${W(t(a))}`).replace(/--(accept-emails|mute-automation)\b/g,(n,s)=>t(s))}function L(e,t="flags"){return t==="step"?e.replace(/--(accept-automation|accept-emails|mute-automation)\b/g,(n,s)=>`${De[s]??s} in the step`).replace(/\bAdd (acceptAutomation|acceptEmails|muteAutomation) in the step\b/g,"Turn on $1 in the step"):t==="erasure"?ie(e.replace(/\b(this|the|This|The) (masking|cleanup)\b/g,"$1 erasure").replace(/\bto (mask|delete) all the same\b/g,"to erase all the same").replace(/\b(mask|delete) fewer records\b/g,"erase fewer records")):t==="page"?ie(e):e}var Ee={before:"before save",after:"after save",beforeAndAfter:"before and after save"},ve={before:"before delete",after:"after delete",beforeAndAfter:"before and after delete"},de={flows:"the flows",triggers:"the Apex triggers",processes:"the Process Builder processes",workflowRules:"the workflow rules",automation:"the automation"};function ce({kind:e,name:t}){return e==="flow"?`flow "${t}"`:e==="process"?`process "${t}"`:e==="workflowRule"?`workflow rule "${t}"`:`Apex trigger ${t}`}function le(e,t){return t.step==="delete"?ve[t.when]:t.step==="bringBack"?"as it comes back from the recycle bin":`${e==="restore"?"as its values are put back":"as it is masked"}, ${Ee[t.when]}`}function W(e){return`${e[0]?.toUpperCase()??""}${e.slice(1)}`}function Se(e,t,n,s){let a=E[n],r=[a.heading.replace("{org}",t)];if(typeof e.unread=="string")return r.push(` what ${t} runs could not be read: ${e.unread}`),r;let i=e;for(let d of S(i,s))r.push(` ${d.objectApiName}: ${le(n,d)}: ${ce(d)}`);let c=N(i);if(r.length===1&&c.length===0){let d=new Set(Object.values(s).flat()).size;r.push(` nothing fires on the ${d} object(s) it ${a.writes} records of`)}for(let d of oe(i,s.giveBack??[]))r.push(` ${d.objectApiName}: duplicate rules ${d.rules.map(p=>`"${p}"`).join(", ")}: ${a.the} saves a record a rule only alerts on, a rule that blocks still refuses it, and what a rule that reports writes (a duplicate record set and its items) stays`);let u=P(i);u.length>0&&r.push(` bypass held: the user ${a.the} writes as holds ${u.join(", ")}, and what names it stays quiet`);for(let{part:d,reason:p}of c)r.push(` ${de[d]??d} could not be read: ${p}`);return r}function Te(e,t,n){let s=E[n.act],a=`${s.nothing} Add --accept-automation ${s.flag}, or turn that automation off in ${t} first.`;if(typeof e.unread=="string")return`What ${t} runs as ${s.this} ${s.writes} its records could not be read (${e.unread}), so what fires is not known. ${a}`;let r=e,i=S(r,n.steps),c=N(r);if(i.length===0&&c.length===0)return;let u=[];if(i.length>0){let l=i.map(m=>`${m.objectApiName}: ${ce(m)} (${le(n.act,m)})`);u.push(`${t} runs automation as ${s.this} ${s.writes} its records: ${l.join("; ")}.`)}for(let{part:l,reason:m}of c)u.push(`${W(de[l]??l)} of ${t} could not be read (${m}), so what fires as ${s.the} ${s.writes} its records is not known.`);let d=n.assign??[];u.push(...re(d,t,s.the));let p=[...new Set(d.flatMap(l=>l.permissionSet??[]))];return n.mayMute===!0&&p.length>0&&u.push(r.cannotAssign===!0?`--mute-automation would be refused: ${K}.`:`With --mute-automation, ${s.the} assigns ${p.join(", ")} to the user it writes as for ${s.the} alone, under a lease, and what ${p.length===1?"it keeps":"they keep"} quiet does not fire.`),u.push(a),u.join(" ")}function k(e){let t=e.objects.map(n=>`${n.perRecord} per ${n.objectApiName}`).join(", ");return`about ${se(e.emails,e.limit)} (${t}`+(e.alertsCounted?"; its email alerts among them, as a Developer Edition counts them":"")+")"}function Me(e,t,n){let s=e.map(a=>{if(a.verdict==="unread")return` emails: ${k(a)}; what ${t} has left today could not be read (${a.unread??"not said"})`;let r=`${a.remaining??0} of ${a.max??0} left today`;return a.verdict==="exceeds"?` emails: ${k(a)}, past the ${r}`:` emails: ${k(a)}, ${r}`});return n!==void 0&&s.push(` emails not counted: what sends them was not read (${n})`),s}function Ne(e,t,n,s){let a=t.filter(u=>u.verdict==="exceeds");if(a.length===0)return;let r=E[e],i=a.map(u=>`${k(u)}, ${u.remaining??0} of ${u.max??0} left today`).join("; "),c=s?.kind==="enough"?`Turn off what sends them, give the user it writes as the bypass that keeps them quiet (--mute-automation assigns ${s.sets.join(", ")} for ${r.the} alone, and what still sends then fits what is left today), or ${r.verb} fewer records.`:`Turn off what sends them, or ${r.verb} fewer records.`+(s?.kind==="muting"?" What sends them still runs under the mute.":s?.kind==="notEnough"?" --mute-automation would not keep enough of them quiet.":"");return`${W(r.this)} would make ${n} send ${i}: past them, each record whose flow fails in the save is refused (CANNOT_EXECUTE_FLOW_TRIGGER), and the org's own emails stop for the rest of the day. ${c} ${r.nothing}`}function Ze(e,t,n){return{readAutomation:t,readLimits:()=>te(e),readDeliverability:()=>n?Promise.resolve(V):X(e),muteOrg:async()=>Y(e),...n?{production:n}:{}}}async function et(e,t,n,s){let a=e?.mute?.prepared;if(!e||!a)return{};let r;try{r=await a.acquire(t)}catch(c){if(!T(c))throw c;return{refused:{code:c.code,message:L(c.message,s)}}}let i=e.emails.afterLease(r.outcome,n);return i?(await r.release(),{refused:{code:i.code,message:L(i.message,s)}}):{held:r}}var xe={objectsRead:[],objects:[],unread:[],conditionsNotRead:0,conditionsBound:0,requests:0};async function tt(e){let{act:t,target:n,accord:s}=e,a=e.objects.filter(g=>g.records>0),r=a.map(g=>g.objectApiName),i=e.writes?.steps??be(t,r),c=F(i),u=r.length===0?xe:await e.org.readAutomation(r).catch(g=>{let A=U(g);return{unread:A===void 0?$(g):`the org could not be reached (${A})`}}),d=typeof u.unread=="string"?void 0:u,p=B(u),l=E[t],m=[],o;if(s.muteAutomation===!0&&p===void 0)try{o=await Q(e.org.muteOrg,u,{...e.muteLeases,writes:c})}catch(g){if(!T(g))throw g;m.push({code:g.code,message:g.message})}let f=o?.automation??d,h=e.mayMute&&s.muteAutomation!==!0&&e.org.production!==!0,b=[...Se(d??u,n,t,i),...o?Z(o.muted,n).map(g=>` ${g}`):[]],_=Te(f??u,n,{act:t,steps:i,...f?{assign:ne(f,q(f,i),e.assignTo)}:{},mayMute:h});_!==void 0&&s.acceptAutomation!==!0&&m.push({code:we,message:_});let D=e.writes?e.writes.written.filter(g=>g.records>0):$e(t,a),y=[],R,j;if(f&&p===void 0){if(D.some(A=>C(f,A.write).some(w=>w.objectApiName===A.objectApiName))){let A=await e.org.readLimits().catch(w=>({unread:$(w)}));if(y=M(D,f,A),y.some(w=>w.verdict==="exceeds")){let w=!o&&h&&d?J(d,c):void 0;j=o?{kind:"muting"}:w&&w.plan.assign.length>0&&w.plan.cannotAssign!==!0?M(D,w.automation,A).some(v=>v.verdict==="exceeds")?{kind:"notEnough"}:{kind:"enough",sets:w.plan.assign.map(v=>v.permissionSet)}:void 0}}R=ee(D,f)}b.push(...Me(y,n,R));let I=Ne(t,y,n,j);I!==void 0&&m.push({code:Oe,message:I});let O=await z({read:u,...o?.plan?{plan:o.plan}:{},writes:c,readDeliverability:p===void 0?e.org.readDeliverability:async()=>({reading:{unread:`${n} could not be reached`},requests:0}),accepted:s.acceptEmails===!0,target:n,run:ye[t],keepsAddresses:!0,mayMute:h});return O.gate.line!==void 0&&b.push(` ${O.gate.line}`),O.gate.stop&&m.push({...O.gate.stop}),p!==void 0&&m.splice(0,m.length,{code:Ae,message:`${n} could not be reached as what it runs was read (${p}), so ${l.the} was not started. ${l.nothing} Check the network, then try again.`}),{answer:{act:t,objects:a,steps:i,...d?{automation:d}:{automationUnread:String(u.unread)},lines:b,emails:y,...R!==void 0?{emailsUncounted:R}:{},...O.gate.deliverability?{deliverability:O.gate.deliverability}:{},emailsAsk:O.gate.verdict==="asks",refusals:m.map(g=>({...g,message:L(g.message,e.voice)})),...o?{mutedAutomation:o.muted}:{},...o?.plan?{mutePlan:o.plan}:{}},...o?{mute:o}:{},emails:O}}var Le=/\bnothing (?:was )?(?:written|deleted)\b/i,ue=/\s*\bNothing was (?:written|deleted)\./g;function st(e){let[t,...n]=e.refusals;if(!t)return;let s=!1,a=e.refusals.map(r=>s?r.message.replace(ue,"").trim():(s=Le.test(r.message),r.message)).join(" ");return{code:t.code,message:a,alsoRefused:n.map(r=>({code:r.code,message:r.message.replace(ue,"").trim()}))}}function nt(e){return e.alsoRefused.length>0?{extraPayload:{alsoRefused:[...e.alsoRefused]}}:{}}export{Pe as a,oe as b,Ce as c,Fe as d,qe as e,Ue as f,Qe as g,Ze as h,et as i,tt as j,st as k,nt as l};
|
|
7
|
+
import{j as ee,l as M}from"./chunk-CL75DEMQ.mjs";import{d as H}from"./chunk-GP5J3DGS.mjs";import{b as V,c as X,g as z}from"./chunk-ZVU7MD2S.mjs";import{Jc as ne,Kc as N,Uc as re,dc as te,j as Y,k as T,l as K,o as J,pc as se,s as Q,x as Z}from"./chunk-OLCS7JCT.mjs";import{c as U,d as B}from"./chunk-Q7TLC3I2.mjs";import{B as G}from"./chunk-4XROG5CT.mjs";import{b as $}from"./chunk-CA5NAXSU.mjs";import{$d as P,de as C,ie as S,le as F,me as q}from"./chunk-J347SPU6.mjs";var Pe=5e3,x=2e3,me=1e3,pe={masking:{during:"during the masking",records:"records it masked"},restore:{during:"during the restore",records:"records it put back"},erasure:{during:"during the erasure",records:"records it overwrote"}};function oe(e,t){let n=new Set(t.map(s=>s.toLowerCase()));return(e?.objects??[]).filter(s=>n.has(s.objectApiName.toLowerCase())).filter(s=>(s.duplicateRules??[]).length>0).map(s=>({objectApiName:s.objectApiName,rules:(s.duplicateRules??[]).map(a=>a.name)}))}function ae(e){return typeof e=="string"?e.slice(0,15):""}async function ge(e,t){let{rules:n}=t,s=0,a=r=>(s++,e.query(r));try{let r=G(new Date(Date.parse(t.since)-me).toISOString()),i=new Set([...t.masked].map(ae)),c=await a(`SELECT Id, DuplicateRecordSetId, RecordId FROM DuplicateRecordItem WHERE CreatedDate >= ${r} LIMIT ${x+1}`),u=c.done===!1||c.records.length>x,d=c.records.slice(0,x),p=new Set(d.filter(o=>i.has(ae(o.RecordId))).map(o=>String(o.DuplicateRecordSetId??"")).filter(o=>o!=="")),l=d.filter(o=>p.has(String(o.DuplicateRecordSetId??""))).length,m=0;for(let o of H([...p])){let f=await a(`SELECT Id FROM DuplicateRecordSet WHERE CreatedDate >= ${r} AND Id IN (${o})`);m+=f.records.length}return{rules:n,sets:m,items:l,...u?{atLeast:!0}:{},requests:s}}catch(r){return{rules:n,sets:0,items:0,unread:$(r),requests:s}}}function Ce(e,t,n){let s=n.now??Date.now,a=n.sleep??(l=>new Promise(m=>setTimeout(m,l))),r=new Set(t.map(l=>l.objectApiName.toLowerCase())),i=l=>r.has(l.toLowerCase()),c,u=0,d=new Set,p=0;return{covers:i,beforeWrite:l=>{i(l)&&c===void 0&&(u=s())},wrote:(l,m)=>{if(!i(l))return;let o=!1;for(let h of m)typeof h!="string"||h===""||(d.add(h),o=!0);if(!o)return;p=s();let f=u;c??=e.serverTime().then(h=>{let b=Date.parse(h);return Number.isNaN(b)?{unread:`it answered "${h}"`}:{at:new Date(b-Math.max(0,s()-f)).toISOString()}},h=>({unread:$(h)}))},held:()=>d.size,read:async()=>{if(d.size===0)return;let l=c?await c:void 0;if(!l||"unread"in l)return{rules:t,sets:0,items:0,unread:l?`the org's clock: ${l.unread}`:"the org's clock was not read",requests:l?1:0};let m=Math.max(0,p+n.settleMs-s());m>0&&await a(m);let o=await ge(e,{rules:t,since:l.at,masked:d});return{...o,requests:(o.requests??0)+1,waitedMs:m}}}}function Fe(e,t){if(!e)return t;if(!t)return e;let n=[e.unread,t.unread].filter(s=>s!==void 0);return{rules:t.rules.length>=e.rules.length?t.rules:e.rules,sets:e.sets+t.sets,items:e.items+t.items,...e.atLeast||t.atLeast?{atLeast:!0}:{},...n.length>0?{unread:n.join("; ")}:{},requests:(e.requests??0)+(t.requests??0),waitedMs:(e.waitedMs??0)+(t.waitedMs??0)}}function qe(e){return e!==void 0&&(e.sets>0||e.items>0||e.unread!==void 0)}function fe(e){return e.map(t=>`"${t}"`).join(", ")}function he(e){return e<=0?"without waiting":e<1e3?"after waiting less than 1 s":`after waiting ${Math.round(e/1e3)} s`}function Ue(e,t,n="masking"){if(!e||e.rules.length===0)return"";let s=pe[n],a=e.rules.map(c=>`${c.objectApiName} (${fe(c.rules)})`).join(", ");if(e.unread!==void 0)return`What the duplicate rules of ${t} on ${a} wrote ${s.during} could not be read (${e.unread}): a duplicate record set they wrote stays.`;let r=e.requests!==void 0?` Read in ${e.requests} request(s), ${he(e.waitedMs??0)}.`:"";if(e.sets===0&&e.items===0)return`The duplicate rules of ${t} on ${a} wrote nothing for the ${s.records}.`+r;let i=e.atLeast===!0?"at least ":"";return`The duplicate rules of ${t} on ${a} wrote ${i}${e.sets} duplicate record set(s) and ${i}${e.items} item(s) ${s.during}, for ${s.records}: kept, as they name records that stay.${r}`}var we="AUTOMATION_NOT_ACCEPTED",Oe="EMAILS_EXCEEDED",Ae="ORG_TEMPORARILY_UNREACHABLE";function be(e,t){return e==="cleanup"||e==="empty"?{delete:[...t]}:e==="restore"?{bringBack:[...t],giveBack:[...t]}:e==="emptyUndo"?{bringBack:[...t]}:{giveBack:[...t]}}function $e(e,t){let n=e==="cleanup"||e==="empty"?"delete":"update";return t.filter(s=>s.records>0).map(s=>({objectApiName:s.objectApiName,write:n,records:s.records}))}var E={masking:{heading:"masking automation: what {org} runs as the masking writes over the records",the:"the masking",this:"this masking",writes:"writes over",verb:"mask",nothing:"Nothing was written.",flag:"to mask all the same"},restore:{heading:"restore automation: what {org} runs as the restore puts the backup's values back",the:"the restore",this:"this restore",writes:"puts back",verb:"restore",nothing:"Nothing was written.",flag:"to restore all the same"},cleanup:{heading:"cleanup automation: what {org} runs as the cleanup deletes the records",the:"the cleanup",this:"this cleanup",writes:"deletes",verb:"delete",nothing:"Nothing was deleted.",flag:"to delete all the same"},empty:{heading:"emptying automation: what {org} runs as the emptying deletes the records",the:"the emptying",this:"this emptying",writes:"deletes",verb:"empty",nothing:"Nothing was deleted.",flag:"to empty all the same"},emptyUndo:{heading:"undo automation: what {org} runs as the undo brings the records back",the:"the undo",this:"this undo",writes:"brings back",verb:"undo",nothing:"Nothing was written.",flag:"to undo all the same"}},ye={masking:"masking",restore:"restore",cleanup:"cleanup",empty:"empty",emptyUndo:"undo"};function Qe(e){return e.erasure===!0?"erasure":e.fromPage===!0?"page":void 0}var De={"accept-automation":"acceptAutomation","accept-emails":"acceptEmails","mute-automation":"muteAutomation"},Re={"accept-emails":"the confirmation's box that lets the org send these emails","mute-automation":"the confirmation's box that mutes the target's automation"},ke={mask:"masking",restore:"restore",delete:"cleanup",erase:"erasure",empty:"emptying",undo:"undo"};function ie(e){let t=n=>Re[n]??`--${n}`;return e.replace(/\bAdd --accept-automation to (mask|restore|delete|erase|empty|undo) all the same\b/g,(n,s)=>`Confirm the ${ke[s]??s} from its confirmation, which lists what fires, to ${s} all the same`).replace(/\bWith --mute-automation,/g,`With ${t("mute-automation")} ticked,`).replace(/\bAdd --(accept-emails|mute-automation)\b/g,(n,s)=>`Tick ${t(s)}`).replace(/(^|[.:;] )--(accept-emails|mute-automation)\b/g,(n,s,a)=>`${s}${W(t(a))}`).replace(/--(accept-emails|mute-automation)\b/g,(n,s)=>t(s))}function L(e,t="flags"){return t==="step"?e.replace(/--(accept-automation|accept-emails|mute-automation)\b/g,(n,s)=>`${De[s]??s} in the step`).replace(/\bAdd (acceptAutomation|acceptEmails|muteAutomation) in the step\b/g,"Turn on $1 in the step"):t==="erasure"?ie(e.replace(/\b(this|the|This|The) (masking|cleanup)\b/g,"$1 erasure").replace(/\bto (mask|delete) all the same\b/g,"to erase all the same").replace(/\b(mask|delete) fewer records\b/g,"erase fewer records")):t==="page"?ie(e):e}var Ee={before:"before save",after:"after save",beforeAndAfter:"before and after save"},ve={before:"before delete",after:"after delete",beforeAndAfter:"before and after delete"},de={flows:"the flows",triggers:"the Apex triggers",processes:"the Process Builder processes",workflowRules:"the workflow rules",automation:"the automation"};function ce({kind:e,name:t}){return e==="flow"?`flow "${t}"`:e==="process"?`process "${t}"`:e==="workflowRule"?`workflow rule "${t}"`:`Apex trigger ${t}`}function le(e,t){return t.step==="delete"?ve[t.when]:t.step==="bringBack"?"as it comes back from the recycle bin":`${e==="restore"?"as its values are put back":"as it is masked"}, ${Ee[t.when]}`}function W(e){return`${e[0]?.toUpperCase()??""}${e.slice(1)}`}function Se(e,t,n,s){let a=E[n],r=[a.heading.replace("{org}",t)];if(typeof e.unread=="string")return r.push(` what ${t} runs could not be read: ${e.unread}`),r;let i=e;for(let d of S(i,s))r.push(` ${d.objectApiName}: ${le(n,d)}: ${ce(d)}`);let c=N(i);if(r.length===1&&c.length===0){let d=new Set(Object.values(s).flat()).size;r.push(` nothing fires on the ${d} object(s) it ${a.writes} records of`)}for(let d of oe(i,s.giveBack??[]))r.push(` ${d.objectApiName}: duplicate rules ${d.rules.map(p=>`"${p}"`).join(", ")}: ${a.the} saves a record a rule only alerts on, a rule that blocks still refuses it, and what a rule that reports writes (a duplicate record set and its items) stays`);let u=P(i);u.length>0&&r.push(` bypass held: the user ${a.the} writes as holds ${u.join(", ")}, and what names it stays quiet`);for(let{part:d,reason:p}of c)r.push(` ${de[d]??d} could not be read: ${p}`);return r}function Te(e,t,n){let s=E[n.act],a=`${s.nothing} Add --accept-automation ${s.flag}, or turn that automation off in ${t} first.`;if(typeof e.unread=="string")return`What ${t} runs as ${s.this} ${s.writes} its records could not be read (${e.unread}), so what fires is not known. ${a}`;let r=e,i=S(r,n.steps),c=N(r);if(i.length===0&&c.length===0)return;let u=[];if(i.length>0){let l=i.map(m=>`${m.objectApiName}: ${ce(m)} (${le(n.act,m)})`);u.push(`${t} runs automation as ${s.this} ${s.writes} its records: ${l.join("; ")}.`)}for(let{part:l,reason:m}of c)u.push(`${W(de[l]??l)} of ${t} could not be read (${m}), so what fires as ${s.the} ${s.writes} its records is not known.`);let d=n.assign??[];u.push(...re(d,t,s.the));let p=[...new Set(d.flatMap(l=>l.permissionSet??[]))];return n.mayMute===!0&&p.length>0&&u.push(r.cannotAssign===!0?`--mute-automation would be refused: ${K}.`:`With --mute-automation, ${s.the} assigns ${p.join(", ")} to the user it writes as for ${s.the} alone, under a lease, and what ${p.length===1?"it keeps":"they keep"} quiet does not fire.`),u.push(a),u.join(" ")}function k(e){let t=e.objects.map(n=>`${n.perRecord} per ${n.objectApiName}`).join(", ");return`about ${se(e.emails,e.limit)} (${t}`+(e.alertsCounted?"; its email alerts among them, as a Developer Edition counts them":"")+")"}function Me(e,t,n){let s=e.map(a=>{if(a.verdict==="unread")return` emails: ${k(a)}; what ${t} has left today could not be read (${a.unread??"not said"})`;let r=`${a.remaining??0} of ${a.max??0} left today`;return a.verdict==="exceeds"?` emails: ${k(a)}, past the ${r}`:` emails: ${k(a)}, ${r}`});return n!==void 0&&s.push(` emails not counted: what sends them was not read (${n})`),s}function Ne(e,t,n,s){let a=t.filter(u=>u.verdict==="exceeds");if(a.length===0)return;let r=E[e],i=a.map(u=>`${k(u)}, ${u.remaining??0} of ${u.max??0} left today`).join("; "),c=s?.kind==="enough"?`Turn off what sends them, give the user it writes as the bypass that keeps them quiet (--mute-automation assigns ${s.sets.join(", ")} for ${r.the} alone, and what still sends then fits what is left today), or ${r.verb} fewer records.`:`Turn off what sends them, or ${r.verb} fewer records.`+(s?.kind==="muting"?" What sends them still runs under the mute.":s?.kind==="notEnough"?" --mute-automation would not keep enough of them quiet.":"");return`${W(r.this)} would make ${n} send ${i}: past them, each record whose flow fails in the save is refused (CANNOT_EXECUTE_FLOW_TRIGGER), and the org's own emails stop for the rest of the day. ${c} ${r.nothing}`}function Ze(e,t,n){return{readAutomation:t,readLimits:()=>te(e),readDeliverability:()=>n?Promise.resolve(V):X(e),muteOrg:async()=>Y(e),...n?{production:n}:{}}}async function et(e,t,n,s){let a=e?.mute?.prepared;if(!e||!a)return{};let r;try{r=await a.acquire(t)}catch(c){if(!T(c))throw c;return{refused:{code:c.code,message:L(c.message,s)}}}let i=e.emails.afterLease(r.outcome,n);return i?(await r.release(),{refused:{code:i.code,message:L(i.message,s)}}):{held:r}}var xe={objectsRead:[],objects:[],unread:[],conditionsNotRead:0,conditionsBound:0,requests:0};async function tt(e){let{act:t,target:n,accord:s}=e,a=e.objects.filter(g=>g.records>0),r=a.map(g=>g.objectApiName),i=e.writes?.steps??be(t,r),c=F(i),u=r.length===0?xe:await e.org.readAutomation(r).catch(g=>{let A=U(g);return{unread:A===void 0?$(g):`the org could not be reached (${A})`}}),d=typeof u.unread=="string"?void 0:u,p=B(u),l=E[t],m=[],o;if(s.muteAutomation===!0&&p===void 0)try{o=await Q(e.org.muteOrg,u,{...e.muteLeases,writes:c})}catch(g){if(!T(g))throw g;m.push({code:g.code,message:g.message})}let f=o?.automation??d,h=e.mayMute&&s.muteAutomation!==!0&&e.org.production!==!0,b=[...Se(d??u,n,t,i),...o?Z(o.muted,n).map(g=>` ${g}`):[]],_=Te(f??u,n,{act:t,steps:i,...f?{assign:ne(f,q(f,i),e.assignTo)}:{},mayMute:h});_!==void 0&&s.acceptAutomation!==!0&&m.push({code:we,message:_});let D=e.writes?e.writes.written.filter(g=>g.records>0):$e(t,a),y=[],R,j;if(f&&p===void 0){if(D.some(A=>C(f,A.write).some(w=>w.objectApiName===A.objectApiName))){let A=await e.org.readLimits().catch(w=>({unread:$(w)}));if(y=M(D,f,A),y.some(w=>w.verdict==="exceeds")){let w=!o&&h&&d?J(d,c):void 0;j=o?{kind:"muting"}:w&&w.plan.assign.length>0&&w.plan.cannotAssign!==!0?M(D,w.automation,A).some(v=>v.verdict==="exceeds")?{kind:"notEnough"}:{kind:"enough",sets:w.plan.assign.map(v=>v.permissionSet)}:void 0}}R=ee(D,f)}b.push(...Me(y,n,R));let I=Ne(t,y,n,j);I!==void 0&&m.push({code:Oe,message:I});let O=await z({read:u,...o?.plan?{plan:o.plan}:{},writes:c,readDeliverability:p===void 0?e.org.readDeliverability:async()=>({reading:{unread:`${n} could not be reached`},requests:0}),accepted:s.acceptEmails===!0,target:n,run:ye[t],keepsAddresses:!0,mayMute:h});return O.gate.line!==void 0&&b.push(` ${O.gate.line}`),O.gate.stop&&m.push({...O.gate.stop}),p!==void 0&&m.splice(0,m.length,{code:Ae,message:`${n} could not be reached as what it runs was read (${p}), so ${l.the} was not started. ${l.nothing} Check the network, then try again.`}),{answer:{act:t,objects:a,steps:i,...d?{automation:d}:{automationUnread:String(u.unread)},lines:b,emails:y,...R!==void 0?{emailsUncounted:R}:{},...O.gate.deliverability?{deliverability:O.gate.deliverability}:{},emailsAsk:O.gate.verdict==="asks",refusals:m.map(g=>({...g,message:L(g.message,e.voice)})),...o?{mutedAutomation:o.muted}:{},...o?.plan?{mutePlan:o.plan}:{}},...o?{mute:o}:{},emails:O}}var Le=/\bnothing (?:was )?(?:written|deleted)\b/i,ue=/\s*\bNothing was (?:written|deleted)\./g;function st(e){let[t,...n]=e.refusals;if(!t)return;let s=!1,a=e.refusals.map(r=>s?r.message.replace(ue,"").trim():(s=Le.test(r.message),r.message)).join(" ");return{code:t.code,message:a,alsoRefused:n.map(r=>({code:r.code,message:r.message.replace(ue,"").trim()}))}}function nt(e){return e.alsoRefused.length>0?{extraPayload:{alsoRefused:[...e.alsoRefused]}}:{}}export{Pe as a,oe as b,Ce as c,Fe as d,qe as e,Ue as f,Qe as g,Ze as h,et as i,tt as j,st as k,nt 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,i,j}from"./chunk-YZQN7BRB.mjs";import"./chunk-QACFTHJM.mjs";import"./chunk-H4OBZIX3.mjs";import"./chunk-JRLYWVF4.mjs";import"./chunk-HLROVOR6.mjs";import"./chunk-VT6P3X6R.mjs";import"./chunk-34SMB5PA.mjs";import"./chunk-KWUS7UAV.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-FQGHL7GR.mjs";import"./chunk-K5PUMHZU.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-J347SPU6.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{b as AGENT_TEST_RUN_WAIT_MINUTES,a as AGENT_TEST_SPECS_DIR,e as agentTestApiName,f as agentTestCommands,d as agentTestSpecFileName,c as agentTestSpecYaml,g as nodeAgentTestSpecFiles,h as writeAgentTestSpec,i as writeScenarioTestSpec,j as yamlOf};
|
|
@@ -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{I as H}from"./chunk-H4CGM6YO.mjs";import{b as R,c as de,d as _}from"./chunk-JAEDM4SI.mjs";import{i as ae}from"./chunk-INIT2UKJ.mjs";import{h as Y}from"./chunk-TZE3Y7IQ.mjs";import{b as F}from"./chunk-CA5NAXSU.mjs";var ke=5,Ie=100;function m(n){return n.slice(0,15)}function N(n){return n==null||n===""}var ce=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/;function Re(n,e){if(N(n)||N(e))return N(n)&&N(e);if(typeof n=="number"||typeof e=="number")return Number(n)===Number(e);if(typeof n=="string"&&typeof e=="string"){if(n===e)return!0;if(ce.test(n)&&ce.test(e)){let s=Date.parse(n);return Number.isFinite(s)&&s===Date.parse(e)}return!1}return JSON.stringify(n)===JSON.stringify(e)}function Ae(n){let e;return()=>(e??=(async()=>{try{let s=await n.userId?.();return typeof s=="string"&&s!==""?m(s):void 0}catch{return}})(),e)}async function fe(n){let e=Date.now();try{let s=Date.parse(await n.serverTime());return Number.isFinite(s)?s-(e+Date.now())/2:0}catch{return 0}}async function Oe(n,e){let s=Date.parse(e??"");return Number.isFinite(s)?s+await fe(n)+H:Number.NEGATIVE_INFINITY}var ve=1e3;function Se(n){let e=Date.parse(n);return Number.isFinite(e)?e-ve:Number.NEGATIVE_INFINITY}function Pe(n,e){let s=Object.hasOwn(n,e)?n[e]:[];return new Map(s.filter(o=>o.toLowerCase()!=="id").map(o=>[o.toLowerCase(),o]))}var Ee={INACTIVE_OWNER_OR_USER:"OwnerId"};function je(n,e){let s=new Set;for(let r of n.errors??[]){if(typeof r=="string")continue;if(Array.isArray(r.fields))for(let g of r.fields)typeof g=="string"&&s.add(g);let c=r.statusCode!==void 0?Ee[r.statusCode]:void 0;c!==void 0&&(!Array.isArray(r.fields)||r.fields.length===0)&&s.add(c)}let o=new Map(Object.keys(e).map(r=>[r.toLowerCase(),r]));return[...s].flatMap(r=>{let c=o.get(r.toLowerCase());return c!==void 0&&c!=="Id"?[c]:[]})}function Fe(n,e){let s=Array.isArray(n)?n:[n];return Array.from({length:e},(o,r)=>s[r]??{success:!1})}function Q(n){let e=n.errors?.[0];if(e===void 0)return{words:"The org gave no reason."};if(typeof e=="string")return{words:e};let s=e.statusCode,o=e.message??"";return{...s?{code:s}:{},words:s&&o?`${s}: ${o}`:s||o}}function C(n,{fields:e,why:s}){return`${e.map(o=>`${n}.${o}`).join(", ")}: the value from before is no longer taken (${s}) \u2014 left as the run wrote it`}async function Le(n,e,s){let o=new Set;try{for(let r of _(s)){let c=await n.query(`SELECT Id FROM ${e} WHERE Id IN (${r})`);for(let g of c.records)typeof g.Id=="string"&&o.add(m(g.Id))}}catch(r){return{unread:F(r)}}return{live:o}}var Z=class{result;said=new Set;constructor(e,s){this.result={objectApiName:e,planned:s,restored:0,keptChanged:0,alreadyGone:0,refused:0,notKept:0,reasons:[]}}without(){this.result.restoredWithout=(this.result.restoredWithout??0)+1}reason(e){this.said.has(e)||this.said.size>=ke||(this.said.add(e),this.result.reasons.push(e))}};async function Qe(n){let{org:e,plan:s}=n,o=[],r=[],c={},g=!1,u=!1;if(s.length===0)return{objects:o,left:r,wrote:g,cancelled:u,stamps:c};let A=n.changedAfter!==void 0?Se(n.changedAfter):await Oe(e,n.lastWriteAt),w=new Map(Object.entries(n.stamps??{}).map(([b,x])=>[m(b),Date.parse(x)])),L=n.ownWriters&&n.ownWriters.length>0?new Set(n.ownWriters.map(m)):void 0,T=n.stampsFor,he=Ae(e);for(let{objectApiName:b,backup:x,ids:D}of s){let l=new Z(b,D.length);o.push(l.result);let W=n.unkept?.find(t=>t.objectApiName===b);if(W&&W.fields.length>0&&l.reason(`${W.fields.map(t=>`${b}.${t}`).join(", ")}: not kept, encrypted \u2014 the run's user cannot view encrypted data, and read their values from before masked; left as the run wrote them`),u||n.signal?.aborted){u=!0,l.result.notReached=D.length,r.push(...D);continue}let G=Y(b),k=new Map(D.map(t=>[m(t),t])),U=n.fields?Pe(n.fields,b):void 0,v=new Map,q=new Set;try{let t=await n.backups.batches(x,b,R);for await(let i of t??[])for(let a of i){if(typeof a.Id!="string"||!k.has(m(a.Id)))continue;let d=v.get(m(a.Id))??{};for(let[h,f]of Object.entries(a)){if(h==="Id")continue;let p=U?U.get(h.toLowerCase()):h;p!==void 0&&!(p in d)&&(d[p]=f)}if(U&&Object.keys(d).length===0){q.add(m(a.Id));continue}v.set(m(a.Id),d)}}catch(t){l.reason(`The values from before the run could not be read: ${F(t)}`),v.clear(),q.clear()}let ee=[...q].filter(t=>!v.has(t)).length;ee>0&&l.reason(`${ee} ${b} record(s) hold no value of a field that may be written back now: left as they are`);for(let t of[...k.keys()])v.has(t)||(l.result.notKept++,k.delete(t));if(k.size===0)continue;let te=new Set;for(let t of v.values())for(let i of Object.keys(t))te.add(Y(i));let ne=["Id","LastModifiedDate",...L?["LastModifiedById"]:[],...te],pe=ne.length>Ie?R/4:R,J=new Map,ye=async t=>{if(n.signal?.aborted)throw new B;return(await e.query(t)).records};try{for(let t of _([...k.values()],pe)){let i=await ae(`SELECT ${ne.join(", ")} FROM ${G} WHERE Id IN (${t})`,ye,{stamp:"LastModifiedDate"});for(let a of i)typeof a.Id=="string"&&J.set(m(a.Id),a)}}catch(t){if(t instanceof B){u=!0,l.result.notReached=k.size,r.push(...k.values());continue}l.result.refused+=k.size,l.reason(F(t)),r.push(...k.values());continue}let $=[],re=new Set,me=T?Date.now()+await fe(e)-H:0;for(let[t,i]of k){let a=J.get(t);if(!a){l.result.alreadyGone++,n.counted?.(i,"alreadyGone");continue}let d=Date.parse(String(a.LastModifiedDate??"")),h=a.LastModifiedById,f=d<=A||d<=(w.get(t)??Number.NaN)||L!==void 0&&typeof h=="string"&&L.has(m(h));if(!f&&!n.includeChanged){l.result.keptChanged++,r.push(i);continue}let p=v.get(t)??{},y={Id:a.Id};for(let[I,O]of Object.entries(p))Re(O,a[I])||(y[I]=N(O)?null:O);if(Object.keys(y).length===1){l.result.restored++,n.counted?.(i,"restored"),f&&T?.(i)&&typeof a.LastModifiedDate=="string"&&(c[a.Id]=a.LastModifiedDate);continue}$.push(y),f&&T?.(i)&&re.add(i)}let P=[],S=[],E=(t,i)=>{l.result.refused++,l.reason(i),r.push(k.get(m(t.Id))??t.Id)},K=t=>{l.result.restored++,n.counted?.(k.get(m(t.Id))??t.Id,"restored")},we=t=>{l.result.alreadyGone++,n.counted?.(k.get(m(t.Id))??t.Id,"alreadyGone")},se=t=>{u=!0,l.result.notReached=(l.result.notReached??0)+t.length,r.push(...t.map(i=>k.get(m(i.Id))??i.Id))},oe=(t,i,a,d)=>{let h=Object.keys(t).filter(y=>y!=="Id"&&!i.includes(y));if(h.length>0){let y={Id:t.Id};for(let I of h)y[I]=t[I];P.push({record:y,leftOut:a});return}if(a.length===0){K(t);return}let[f,...p]=a;d?(l.without(),l.reason(C(b,f))):E(t,C(b,f));for(let y of p)l.reason(C(b,y))},z=async t=>{try{return g=!0,Fe(await e.update(b,[...t]),t.length)}catch(i){let a=F(i);return t.map(()=>({success:!1,errors:[a]}))}},be=async t=>{let i=n.keep;if(!i)return!0;let a=t.map(d=>{let h=J.get(m(d.Id))??{},f={Id:d.Id};for(let p of Object.keys(d))p!=="Id"&&(f[p]=h[p]??null);return f});try{return await i(b,a),!0}catch(d){let h=`What these ${t.length} ${b} record(s) hold now could not be kept before they were written (${F(d)}), so none of them was written: nothing is written over that cannot be put back.`;for(let f of t)E(f,h);return!1}};for(let t=0;t<$.length;t+=R){let i=$.slice(t,t+R);if(n.signal?.aborted){u=!0;let d=$.slice(t);l.result.notReached=(l.result.notReached??0)+d.length,r.push(...d.map(h=>k.get(m(h.Id))??h.Id));break}if(!await be(i))continue;(await z(i)).forEach((d,h)=>{let f=i[h];if(d.success===!0){K(f);return}let p=Q(d),y=je(d,f);if(p.code==="ENTITY_IS_DELETED"&&y.length===0){S.push({record:f,why:p.words});return}let I=Object.keys(f).filter(O=>O!=="Id"&&!y.includes(O));if(y.length>0&&I.length>0){let O={Id:f.Id};for(let ie of I)O[ie]=f[ie];P.push({record:O,leftOut:[{fields:y,why:p.words}]});return}E(f,p.words)})}let j=[];if(S.length>0&&n.signal?.aborted)se(S.map(({record:t})=>t));else if(S.length>0){let t=await Le(e,G,S.map(({record:i})=>i.Id));t.unread!==void 0&&l.reason(`Whether ${S.length} ${b} record(s) refused as deleted are still in the org could not be read (${t.unread}): left to be given back again`);for(let{record:i,why:a}of S){if(t.unread!==void 0){E(i,a);continue}if(!t.live.has(m(i.Id))){we(i);continue}let d=Object.keys(i).filter(h=>h!=="Id"&&de(i[h]));d.length===0?E(i,a):d.length===1?oe(i,d,[{fields:d,why:a}],!1):j.push({record:i,lookups:d,given:[],refusedAlone:[]})}}let V=j.length>0;for(let t=0;V&&j.some(({lookups:i})=>i.length>t);t++){let i=j.filter(({lookups:a})=>a.length>t);for(let a=0;a<i.length;a+=R){if(n.signal?.aborted){se(j.map(({record:f})=>f)),V=!1;break}let d=i.slice(a,a+R);(await z(d.map(({record:f,lookups:p})=>({Id:f.Id,[p[t]]:f[p[t]]})))).forEach((f,p)=>{let y=d[p],I=y.lookups[t];f.success===!0?y.given.push(I):y.refusedAlone.push({field:I,why:Q(f).words})})}}for(let t of V?j:[]){let i=new Map;for(let{field:a,why:d}of t.refusedAlone)i.set(d,[...i.get(d)??[],a]);oe(t.record,t.lookups,[...i].map(([a,d])=>({fields:d,why:a})),t.given.length>0)}for(let t=0;t<P.length;t+=R){let i=P.slice(t,t+R);if(n.signal?.aborted){u=!0,l.result.notReached=(l.result.notReached??0)+P.length-t,r.push(...P.slice(t).map(({record:d})=>k.get(m(d.Id))??d.Id));break}(await z(i.map(({record:d})=>d))).forEach((d,h)=>{let{record:f,leftOut:p}=i[h];if(d.success===!0){if(p.length===0){K(f);return}l.without();for(let y of p)l.reason(C(b,y));return}E(f,Q(d).words)})}Object.assign(c,await Ne(e,G,[...re],me,he))}return{objects:o,left:r,wrote:g,cancelled:u,stamps:c}}async function Ne(n,e,s,o,r){let c={};if(s.length===0)return c;let g=await r();if(g===void 0)return c;for(let u of _(s)){let A;try{A=(await n.query(`SELECT Id, LastModifiedDate, LastModifiedById FROM ${e} WHERE Id IN (${u})`)).records}catch{continue}for(let w of A)typeof w.Id=="string"&&typeof w.LastModifiedDate=="string"&&typeof w.LastModifiedById=="string"&&m(w.LastModifiedById)===g&&Date.parse(w.LastModifiedDate)>=o&&(c[w.Id]=w.LastModifiedDate)}return c}var B=class extends Error{};function Ze(n,e,s=[]){let o=n.map(r=>({...r}));for(let r of s){if(r.undeleted+r.refused===0)continue;let c=o.find(g=>g.objectApiName===r.objectApiName);c?(c.created+=r.undeleted,c.failed+=r.refused):o.push({objectApiName:r.objectApiName,created:r.undeleted,updated:0,deleted:0,failed:r.refused})}for(let r of e){let c=r.restored+(r.restoredWithout??0);if(c+r.refused===0)continue;let g=o.find(u=>u.objectApiName===r.objectApiName);g?(g.updated+=c,g.failed+=r.refused):o.push({objectApiName:r.objectApiName,created:0,updated:c,deleted:0,failed:r.refused})}return o}import{createReadStream as Me}from"node:fs";import{access as De,appendFile as $e,mkdir as _e,readFile as Ce,readdir as Be,rm as Te,stat as xe,writeFile as We}from"node:fs/promises";import*as M from"node:path";import{createInterface as Ge}from"node:readline";var ue=384,Ue=448;function rt(n){return{storagePath:n,readFile:e=>Ce(e,"utf8"),writeFile:(e,s)=>We(e,s,{encoding:"utf8",mode:ue}),appendFile:(e,s)=>$e(e,s,{encoding:"utf8",mode:ue}),exists:e=>De(e).then(()=>!0,()=>!1),readLines:e=>Je(e),mkdir:async e=>{await _e(e,{recursive:!0,mode:Ue})},rm:e=>Te(e,{force:!0}),listFiles:e=>qe(e)}}async function qe(n){let e;try{e=await Be(n,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")return[];throw o}let s=[];for(let o of e){if(!o.isFile())continue;let r=await xe(M.join(n,o.name)).catch(()=>{});r&&s.push({name:o.name,modifiedMs:r.mtimeMs})}return s}async function*Je(n){let e=Me(n,{encoding:"utf8"}),s=Ge({input:e,crlfDelay:1/0});try{for await(let o of s)yield o}finally{s.close(),e.destroy()}}function X(n){return n.replace(/[^A-Za-z0-9_-]/g,"_")}function le(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}var ge=class{constructor(e){this.deps=e;this.dir=M.join(e.storagePath,"backups")}deps;dir;get directory(){return this.dir}filePath(e,s,o="lines"){let r=`${X(e)}__${X(s)}`;return M.join(this.dir,`${r}.${o==="lines"?"ndjson":"json"}`)}async begin(e,s){await this.deps.mkdir(this.dir).catch(()=>{}),await this.deps.writeFile(this.filePath(e,s),"")}async append(e,s,o){if(o.length===0)return;let r=o.map(c=>JSON.stringify(c)).join(`
|
|
7
|
+
import{I as H}from"./chunk-3LRFPGYZ.mjs";import{b as R,c as de,d as _}from"./chunk-GP5J3DGS.mjs";import{i as ae}from"./chunk-INIT2UKJ.mjs";import{h as Y}from"./chunk-TZE3Y7IQ.mjs";import{b as F}from"./chunk-CA5NAXSU.mjs";var ke=5,Ie=100;function m(n){return n.slice(0,15)}function N(n){return n==null||n===""}var ce=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/;function Re(n,e){if(N(n)||N(e))return N(n)&&N(e);if(typeof n=="number"||typeof e=="number")return Number(n)===Number(e);if(typeof n=="string"&&typeof e=="string"){if(n===e)return!0;if(ce.test(n)&&ce.test(e)){let s=Date.parse(n);return Number.isFinite(s)&&s===Date.parse(e)}return!1}return JSON.stringify(n)===JSON.stringify(e)}function Ae(n){let e;return()=>(e??=(async()=>{try{let s=await n.userId?.();return typeof s=="string"&&s!==""?m(s):void 0}catch{return}})(),e)}async function fe(n){let e=Date.now();try{let s=Date.parse(await n.serverTime());return Number.isFinite(s)?s-(e+Date.now())/2:0}catch{return 0}}async function Oe(n,e){let s=Date.parse(e??"");return Number.isFinite(s)?s+await fe(n)+H:Number.NEGATIVE_INFINITY}var ve=1e3;function Se(n){let e=Date.parse(n);return Number.isFinite(e)?e-ve:Number.NEGATIVE_INFINITY}function Pe(n,e){let s=Object.hasOwn(n,e)?n[e]:[];return new Map(s.filter(o=>o.toLowerCase()!=="id").map(o=>[o.toLowerCase(),o]))}var Ee={INACTIVE_OWNER_OR_USER:"OwnerId"};function je(n,e){let s=new Set;for(let r of n.errors??[]){if(typeof r=="string")continue;if(Array.isArray(r.fields))for(let g of r.fields)typeof g=="string"&&s.add(g);let c=r.statusCode!==void 0?Ee[r.statusCode]:void 0;c!==void 0&&(!Array.isArray(r.fields)||r.fields.length===0)&&s.add(c)}let o=new Map(Object.keys(e).map(r=>[r.toLowerCase(),r]));return[...s].flatMap(r=>{let c=o.get(r.toLowerCase());return c!==void 0&&c!=="Id"?[c]:[]})}function Fe(n,e){let s=Array.isArray(n)?n:[n];return Array.from({length:e},(o,r)=>s[r]??{success:!1})}function Q(n){let e=n.errors?.[0];if(e===void 0)return{words:"The org gave no reason."};if(typeof e=="string")return{words:e};let s=e.statusCode,o=e.message??"";return{...s?{code:s}:{},words:s&&o?`${s}: ${o}`:s||o}}function C(n,{fields:e,why:s}){return`${e.map(o=>`${n}.${o}`).join(", ")}: the value from before is no longer taken (${s}) \u2014 left as the run wrote it`}async function Le(n,e,s){let o=new Set;try{for(let r of _(s)){let c=await n.query(`SELECT Id FROM ${e} WHERE Id IN (${r})`);for(let g of c.records)typeof g.Id=="string"&&o.add(m(g.Id))}}catch(r){return{unread:F(r)}}return{live:o}}var Z=class{result;said=new Set;constructor(e,s){this.result={objectApiName:e,planned:s,restored:0,keptChanged:0,alreadyGone:0,refused:0,notKept:0,reasons:[]}}without(){this.result.restoredWithout=(this.result.restoredWithout??0)+1}reason(e){this.said.has(e)||this.said.size>=ke||(this.said.add(e),this.result.reasons.push(e))}};async function Qe(n){let{org:e,plan:s}=n,o=[],r=[],c={},g=!1,u=!1;if(s.length===0)return{objects:o,left:r,wrote:g,cancelled:u,stamps:c};let A=n.changedAfter!==void 0?Se(n.changedAfter):await Oe(e,n.lastWriteAt),w=new Map(Object.entries(n.stamps??{}).map(([b,x])=>[m(b),Date.parse(x)])),L=n.ownWriters&&n.ownWriters.length>0?new Set(n.ownWriters.map(m)):void 0,T=n.stampsFor,he=Ae(e);for(let{objectApiName:b,backup:x,ids:D}of s){let l=new Z(b,D.length);o.push(l.result);let W=n.unkept?.find(t=>t.objectApiName===b);if(W&&W.fields.length>0&&l.reason(`${W.fields.map(t=>`${b}.${t}`).join(", ")}: not kept, encrypted \u2014 the run's user cannot view encrypted data, and read their values from before masked; left as the run wrote them`),u||n.signal?.aborted){u=!0,l.result.notReached=D.length,r.push(...D);continue}let G=Y(b),k=new Map(D.map(t=>[m(t),t])),U=n.fields?Pe(n.fields,b):void 0,v=new Map,q=new Set;try{let t=await n.backups.batches(x,b,R);for await(let i of t??[])for(let a of i){if(typeof a.Id!="string"||!k.has(m(a.Id)))continue;let d=v.get(m(a.Id))??{};for(let[h,f]of Object.entries(a)){if(h==="Id")continue;let p=U?U.get(h.toLowerCase()):h;p!==void 0&&!(p in d)&&(d[p]=f)}if(U&&Object.keys(d).length===0){q.add(m(a.Id));continue}v.set(m(a.Id),d)}}catch(t){l.reason(`The values from before the run could not be read: ${F(t)}`),v.clear(),q.clear()}let ee=[...q].filter(t=>!v.has(t)).length;ee>0&&l.reason(`${ee} ${b} record(s) hold no value of a field that may be written back now: left as they are`);for(let t of[...k.keys()])v.has(t)||(l.result.notKept++,k.delete(t));if(k.size===0)continue;let te=new Set;for(let t of v.values())for(let i of Object.keys(t))te.add(Y(i));let ne=["Id","LastModifiedDate",...L?["LastModifiedById"]:[],...te],pe=ne.length>Ie?R/4:R,J=new Map,ye=async t=>{if(n.signal?.aborted)throw new B;return(await e.query(t)).records};try{for(let t of _([...k.values()],pe)){let i=await ae(`SELECT ${ne.join(", ")} FROM ${G} WHERE Id IN (${t})`,ye,{stamp:"LastModifiedDate"});for(let a of i)typeof a.Id=="string"&&J.set(m(a.Id),a)}}catch(t){if(t instanceof B){u=!0,l.result.notReached=k.size,r.push(...k.values());continue}l.result.refused+=k.size,l.reason(F(t)),r.push(...k.values());continue}let $=[],re=new Set,me=T?Date.now()+await fe(e)-H:0;for(let[t,i]of k){let a=J.get(t);if(!a){l.result.alreadyGone++,n.counted?.(i,"alreadyGone");continue}let d=Date.parse(String(a.LastModifiedDate??"")),h=a.LastModifiedById,f=d<=A||d<=(w.get(t)??Number.NaN)||L!==void 0&&typeof h=="string"&&L.has(m(h));if(!f&&!n.includeChanged){l.result.keptChanged++,r.push(i);continue}let p=v.get(t)??{},y={Id:a.Id};for(let[I,O]of Object.entries(p))Re(O,a[I])||(y[I]=N(O)?null:O);if(Object.keys(y).length===1){l.result.restored++,n.counted?.(i,"restored"),f&&T?.(i)&&typeof a.LastModifiedDate=="string"&&(c[a.Id]=a.LastModifiedDate);continue}$.push(y),f&&T?.(i)&&re.add(i)}let P=[],S=[],E=(t,i)=>{l.result.refused++,l.reason(i),r.push(k.get(m(t.Id))??t.Id)},K=t=>{l.result.restored++,n.counted?.(k.get(m(t.Id))??t.Id,"restored")},we=t=>{l.result.alreadyGone++,n.counted?.(k.get(m(t.Id))??t.Id,"alreadyGone")},se=t=>{u=!0,l.result.notReached=(l.result.notReached??0)+t.length,r.push(...t.map(i=>k.get(m(i.Id))??i.Id))},oe=(t,i,a,d)=>{let h=Object.keys(t).filter(y=>y!=="Id"&&!i.includes(y));if(h.length>0){let y={Id:t.Id};for(let I of h)y[I]=t[I];P.push({record:y,leftOut:a});return}if(a.length===0){K(t);return}let[f,...p]=a;d?(l.without(),l.reason(C(b,f))):E(t,C(b,f));for(let y of p)l.reason(C(b,y))},z=async t=>{try{return g=!0,Fe(await e.update(b,[...t]),t.length)}catch(i){let a=F(i);return t.map(()=>({success:!1,errors:[a]}))}},be=async t=>{let i=n.keep;if(!i)return!0;let a=t.map(d=>{let h=J.get(m(d.Id))??{},f={Id:d.Id};for(let p of Object.keys(d))p!=="Id"&&(f[p]=h[p]??null);return f});try{return await i(b,a),!0}catch(d){let h=`What these ${t.length} ${b} record(s) hold now could not be kept before they were written (${F(d)}), so none of them was written: nothing is written over that cannot be put back.`;for(let f of t)E(f,h);return!1}};for(let t=0;t<$.length;t+=R){let i=$.slice(t,t+R);if(n.signal?.aborted){u=!0;let d=$.slice(t);l.result.notReached=(l.result.notReached??0)+d.length,r.push(...d.map(h=>k.get(m(h.Id))??h.Id));break}if(!await be(i))continue;(await z(i)).forEach((d,h)=>{let f=i[h];if(d.success===!0){K(f);return}let p=Q(d),y=je(d,f);if(p.code==="ENTITY_IS_DELETED"&&y.length===0){S.push({record:f,why:p.words});return}let I=Object.keys(f).filter(O=>O!=="Id"&&!y.includes(O));if(y.length>0&&I.length>0){let O={Id:f.Id};for(let ie of I)O[ie]=f[ie];P.push({record:O,leftOut:[{fields:y,why:p.words}]});return}E(f,p.words)})}let j=[];if(S.length>0&&n.signal?.aborted)se(S.map(({record:t})=>t));else if(S.length>0){let t=await Le(e,G,S.map(({record:i})=>i.Id));t.unread!==void 0&&l.reason(`Whether ${S.length} ${b} record(s) refused as deleted are still in the org could not be read (${t.unread}): left to be given back again`);for(let{record:i,why:a}of S){if(t.unread!==void 0){E(i,a);continue}if(!t.live.has(m(i.Id))){we(i);continue}let d=Object.keys(i).filter(h=>h!=="Id"&&de(i[h]));d.length===0?E(i,a):d.length===1?oe(i,d,[{fields:d,why:a}],!1):j.push({record:i,lookups:d,given:[],refusedAlone:[]})}}let V=j.length>0;for(let t=0;V&&j.some(({lookups:i})=>i.length>t);t++){let i=j.filter(({lookups:a})=>a.length>t);for(let a=0;a<i.length;a+=R){if(n.signal?.aborted){se(j.map(({record:f})=>f)),V=!1;break}let d=i.slice(a,a+R);(await z(d.map(({record:f,lookups:p})=>({Id:f.Id,[p[t]]:f[p[t]]})))).forEach((f,p)=>{let y=d[p],I=y.lookups[t];f.success===!0?y.given.push(I):y.refusedAlone.push({field:I,why:Q(f).words})})}}for(let t of V?j:[]){let i=new Map;for(let{field:a,why:d}of t.refusedAlone)i.set(d,[...i.get(d)??[],a]);oe(t.record,t.lookups,[...i].map(([a,d])=>({fields:d,why:a})),t.given.length>0)}for(let t=0;t<P.length;t+=R){let i=P.slice(t,t+R);if(n.signal?.aborted){u=!0,l.result.notReached=(l.result.notReached??0)+P.length-t,r.push(...P.slice(t).map(({record:d})=>k.get(m(d.Id))??d.Id));break}(await z(i.map(({record:d})=>d))).forEach((d,h)=>{let{record:f,leftOut:p}=i[h];if(d.success===!0){if(p.length===0){K(f);return}l.without();for(let y of p)l.reason(C(b,y));return}E(f,Q(d).words)})}Object.assign(c,await Ne(e,G,[...re],me,he))}return{objects:o,left:r,wrote:g,cancelled:u,stamps:c}}async function Ne(n,e,s,o,r){let c={};if(s.length===0)return c;let g=await r();if(g===void 0)return c;for(let u of _(s)){let A;try{A=(await n.query(`SELECT Id, LastModifiedDate, LastModifiedById FROM ${e} WHERE Id IN (${u})`)).records}catch{continue}for(let w of A)typeof w.Id=="string"&&typeof w.LastModifiedDate=="string"&&typeof w.LastModifiedById=="string"&&m(w.LastModifiedById)===g&&Date.parse(w.LastModifiedDate)>=o&&(c[w.Id]=w.LastModifiedDate)}return c}var B=class extends Error{};function Ze(n,e,s=[]){let o=n.map(r=>({...r}));for(let r of s){if(r.undeleted+r.refused===0)continue;let c=o.find(g=>g.objectApiName===r.objectApiName);c?(c.created+=r.undeleted,c.failed+=r.refused):o.push({objectApiName:r.objectApiName,created:r.undeleted,updated:0,deleted:0,failed:r.refused})}for(let r of e){let c=r.restored+(r.restoredWithout??0);if(c+r.refused===0)continue;let g=o.find(u=>u.objectApiName===r.objectApiName);g?(g.updated+=c,g.failed+=r.refused):o.push({objectApiName:r.objectApiName,created:0,updated:c,deleted:0,failed:r.refused})}return o}import{createReadStream as Me}from"node:fs";import{access as De,appendFile as $e,mkdir as _e,readFile as Ce,readdir as Be,rm as Te,stat as xe,writeFile as We}from"node:fs/promises";import*as M from"node:path";import{createInterface as Ge}from"node:readline";var ue=384,Ue=448;function rt(n){return{storagePath:n,readFile:e=>Ce(e,"utf8"),writeFile:(e,s)=>We(e,s,{encoding:"utf8",mode:ue}),appendFile:(e,s)=>$e(e,s,{encoding:"utf8",mode:ue}),exists:e=>De(e).then(()=>!0,()=>!1),readLines:e=>Je(e),mkdir:async e=>{await _e(e,{recursive:!0,mode:Ue})},rm:e=>Te(e,{force:!0}),listFiles:e=>qe(e)}}async function qe(n){let e;try{e=await Be(n,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")return[];throw o}let s=[];for(let o of e){if(!o.isFile())continue;let r=await xe(M.join(n,o.name)).catch(()=>{});r&&s.push({name:o.name,modifiedMs:r.mtimeMs})}return s}async function*Je(n){let e=Me(n,{encoding:"utf8"}),s=Ge({input:e,crlfDelay:1/0});try{for await(let o of s)yield o}finally{s.close(),e.destroy()}}function X(n){return n.replace(/[^A-Za-z0-9_-]/g,"_")}function le(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}var ge=class{constructor(e){this.deps=e;this.dir=M.join(e.storagePath,"backups")}deps;dir;get directory(){return this.dir}filePath(e,s,o="lines"){let r=`${X(e)}__${X(s)}`;return M.join(this.dir,`${r}.${o==="lines"?"ndjson":"json"}`)}async begin(e,s){await this.deps.mkdir(this.dir).catch(()=>{}),await this.deps.writeFile(this.filePath(e,s),"")}async append(e,s,o){if(o.length===0)return;let r=o.map(c=>JSON.stringify(c)).join(`
|
|
8
8
|
`);await this.deps.appendFile(this.filePath(e,s),`${r}
|
|
9
9
|
`)}async batches(e,s,o){let r=this.filePath(e,s);if(await this.deps.exists(r))return{[Symbol.asyncIterator]:()=>this.readLineBatches(r,s,o)};let c=this.filePath(e,s,"array");return await this.deps.exists(c)?{[Symbol.asyncIterator]:()=>this.readArrayBatches(c,s,o)}:null}async*readLineBatches(e,s,o){let r=[],c=0;for await(let g of this.deps.readLines(e)){if(c+=1,g.trim()==="")continue;let u;try{u=JSON.parse(g)}catch{u=void 0}if(!le(u))throw new Error(`The backup of ${s} is damaged at line ${c} of its file: it holds no record there.`);r.push(u),r.length===o&&(yield r,r=[])}r.length>0&&(yield r)}async*readArrayBatches(e,s,o){let r=JSON.parse(await this.deps.readFile(e));if(!Array.isArray(r)||!r.every(le))throw new Error(`The backup of ${s} is damaged: its file holds no records.`);for(let c=0;c<r.length;c+=o)yield r.slice(c,c+o)}async delete(e,s){await this.deps.rm(this.filePath(e,s)).catch(()=>{}),await this.deps.rm(this.filePath(e,s,"array")).catch(()=>{})}async sweep(e,s,o){let r=[...e].map(u=>`${X(u)}__`),c=new Map;for(let u of await this.deps.listFiles(this.dir)){if(!/\.(?:ndjson|json)$/.test(u.name))continue;let A=u.name.indexOf("__");if(A<=0||r.some(L=>u.name.startsWith(L)))continue;let w=u.name.slice(0,A);c.set(w,[...c.get(w)??[],u])}let g=[];for(let u of c.values()){let A=Math.max(...u.map(w=>w.modifiedMs));if(!(o-A<s))for(let w of u)await this.deps.rm(M.join(this.dir,w.name)).then(()=>g.push(w.name),()=>{})}return g}};export{Re as a,Ae as b,fe as c,Oe as d,Qe as e,Ne as f,Ze as g,rt as h,ge as i};
|
|
@@ -4,4 +4,4 @@ import { dirname as __sandforgeDirname } from 'node:path';
|
|
|
4
4
|
const require = __sandforgeRequire(import.meta.url);
|
|
5
5
|
const __filename = __sandforgePath(import.meta.url);
|
|
6
6
|
const __dirname = __sandforgeDirname(__filename);
|
|
7
|
-
import{a,b,c,d}from"./chunk-
|
|
7
|
+
import{a,b,c,d}from"./chunk-VUTQY76O.mjs";import"./chunk-UV74P4H2.mjs";import"./chunk-4CSBZZAL.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{d as UsersRunStore,a as defaultUsersStoreRoot,b as usersHeldUserSchema,c as usersRunRecordSchema};
|
|
@@ -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{c as z,d as v,f as A,j as k,k as c,l as R}from"./chunk-FQGHL7GR.mjs";import{ec as f}from"./chunk-PMWAFDUB.mjs";var L={en_US:[{city:"New York",state:"New York",country:"United States",zipCode:"10001"},{city:"Los Angeles",state:"California",country:"United States",zipCode:"90001"},{city:"Chicago",state:"Illinois",country:"United States",zipCode:"60601"},{city:"Houston",state:"Texas",country:"United States",zipCode:"77001"},{city:"Phoenix",state:"Arizona",country:"United States",zipCode:"85001"},{city:"Philadelphia",state:"Pennsylvania",country:"United States",zipCode:"19101"},{city:"San Antonio",state:"Texas",country:"United States",zipCode:"78201"},{city:"San Diego",state:"California",country:"United States",zipCode:"92101"},{city:"Dallas",state:"Texas",country:"United States",zipCode:"75201"},{city:"Austin",state:"Texas",country:"United States",zipCode:"78701"}],fr_FR:[{city:"Paris",state:"Ile-de-France",country:"France",zipCode:"75001"},{city:"Lyon",state:"Auvergne-Rhone-Alpes",country:"France",zipCode:"69001"},{city:"Marseille",state:"Provence-Alpes-Cote d'Azur",country:"France",zipCode:"13001"},{city:"Toulouse",state:"Occitanie",country:"France",zipCode:"31000"},{city:"Nice",state:"Provence-Alpes-Cote d'Azur",country:"France",zipCode:"06000"},{city:"Bordeaux",state:"Nouvelle-Aquitaine",country:"France",zipCode:"33000"},{city:"Strasbourg",state:"Grand Est",country:"France",zipCode:"67000"},{city:"Nantes",state:"Pays de la Loire",country:"France",zipCode:"44000"},{city:"Lille",state:"Hauts-de-France",country:"France",zipCode:"59000"},{city:"Rennes",state:"Bretagne",country:"France",zipCode:"35000"}],de_DE:[{city:"Berlin",state:"Berlin",country:"Germany",zipCode:"10115"},{city:"Munich",state:"Bavaria",country:"Germany",zipCode:"80331"},{city:"Hamburg",state:"Hamburg",country:"Germany",zipCode:"20095"},{city:"Frankfurt",state:"Hesse",country:"Germany",zipCode:"60311"},{city:"Cologne",state:"North Rhine-Westphalia",country:"Germany",zipCode:"50667"},{city:"Stuttgart",state:"Baden-Wurttemberg",country:"Germany",zipCode:"70173"},{city:"Dusseldorf",state:"North Rhine-Westphalia",country:"Germany",zipCode:"40213"},{city:"Leipzig",state:"Saxony",country:"Germany",zipCode:"04109"},{city:"Dresden",state:"Saxony",country:"Germany",zipCode:"01067"},{city:"Hannover",state:"Lower Saxony",country:"Germany",zipCode:"30159"}],es_ES:[{city:"Madrid",state:"Comunidad de Madrid",country:"Spain",zipCode:"28001"},{city:"Barcelona",state:"Catalonia",country:"Spain",zipCode:"08001"},{city:"Valencia",state:"Comunitat Valenciana",country:"Spain",zipCode:"46001"},{city:"Seville",state:"Andalusia",country:"Spain",zipCode:"41001"},{city:"Zaragoza",state:"Aragon",country:"Spain",zipCode:"50001"},{city:"Malaga",state:"Andalusia",country:"Spain",zipCode:"29001"},{city:"Bilbao",state:"Basque Country",country:"Spain",zipCode:"48001"},{city:"Murcia",state:"Region de Murcia",country:"Spain",zipCode:"30001"},{city:"Palma",state:"Balearic Islands",country:"Spain",zipCode:"07001"},{city:"Granada",state:"Andalusia",country:"Spain",zipCode:"18001"}],ja_JP:[{city:"Tokyo",state:"Tokyo",country:"Japan",zipCode:"100-0001"},{city:"Osaka",state:"Osaka",country:"Japan",zipCode:"530-0001"},{city:"Yokohama",state:"Kanagawa",country:"Japan",zipCode:"220-0011"},{city:"Nagoya",state:"Aichi",country:"Japan",zipCode:"450-0001"},{city:"Sapporo",state:"Hokkaido",country:"Japan",zipCode:"060-0001"},{city:"Fukuoka",state:"Fukuoka",country:"Japan",zipCode:"810-0001"},{city:"Kobe",state:"Hyogo",country:"Japan",zipCode:"650-0001"},{city:"Kyoto",state:"Kyoto",country:"Japan",zipCode:"600-8001"},{city:"Sendai",state:"Miyagi",country:"Japan",zipCode:"980-0001"},{city:"Hiroshima",state:"Hiroshima",country:"Japan",zipCode:"730-0001"}],pt_BR:[{city:"Sao Paulo",state:"Sao Paulo",country:"Brazil",zipCode:"01000-000"},{city:"Rio de Janeiro",state:"Rio de Janeiro",country:"Brazil",zipCode:"20000-000"},{city:"Brasilia",state:"Distrito Federal",country:"Brazil",zipCode:"70000-000"},{city:"Salvador",state:"Bahia",country:"Brazil",zipCode:"40000-000"},{city:"Fortaleza",state:"Ceara",country:"Brazil",zipCode:"60000-000"},{city:"Belo Horizonte",state:"Minas Gerais",country:"Brazil",zipCode:"30000-000"},{city:"Manaus",state:"Amazonas",country:"Brazil",zipCode:"69000-000"},{city:"Curitiba",state:"Parana",country:"Brazil",zipCode:"80000-000"},{city:"Recife",state:"Pernambuco",country:"Brazil",zipCode:"50000-000"},{city:"Porto Alegre",state:"Rio Grande do Sul",country:"Brazil",zipCode:"90000-000"}]},B={en:"en_US",fr:"fr_FR",de:"de_DE",es:"es_ES",ja:"ja_JP",pt:"pt_BR"};function l(i){if(i in L)return i;let e=i.split("_")[0].toLowerCase();return B[e]??"en_US"}var u=class{tuples;resolvedLocale;constructor(e){this.resolvedLocale=l(e??"en_US"),this.tuples=L[this.resolvedLocale]}getAddress(e){return this.tuples[e%this.tuples.length]}getCity(e){return this.getAddress(e).city}getState(e){return this.getAddress(e).state}getCountry(e){return this.getAddress(e).country}getZipCode(e){return this.getAddress(e).zipCode}getLocaleData(){return c(this.resolvedLocale)}};var F={en_US:"US",fr_FR:"FR",de_DE:"DE",es_ES:"ES",ja_JP:"JP",pt_BR:"BR"},$={fr_FR:{country:"FR",bbanLength:23},de_DE:{country:"DE",bbanLength:18},es_ES:{country:"ES",bbanLength:20},en_US:{country:"DE",bbanLength:18},ja_JP:{country:"DE",bbanLength:18},pt_BR:{country:"DE",bbanLength:18}},w="ABCDEFGHIJKLMNPQRSTUVWXYZ",T=["Ergonomic","Handcrafted","Refined","Sleek","Rustic","Compact","Modular","Insulated"],E=["Steel","Wooden","Cotton","Granite","Rubber","Leather","Ceramic"],_=["Chair","Table","Lamp","Keyboard","Backpack","Bottle","Headphones","Gloves","Bench"],M=["Senior","Lead","Junior","Principal","Associate","Chief"],P=["Marketing","Operations","Finance","Sales","Product","Customer Success"],U=["Manager","Analyst","Coordinator","Specialist","Director","Consultant"],G=["Adaptive","Integrated","Customer-focused","Scalable","Secure"],O=["cloud-based","real-time","data-driven","modular","global"],I=["platform","solution","workflow","service","framework","network"],J=["daily use at home or in the office","long days on the move","teams that need something that lasts","small spaces","outdoor work in any weather"],H=["Unable to log in","Invoice discrepancy","Password reset email not received","Order arrived damaged","Request for a refund","Cannot update billing address","Shipment delayed","Error when exporting a report","Product not working as described","Question about my contract","Charged twice for one order","Need help with installation","Account locked after failed logins","Wrong item delivered","Request: edit several records at once","App crashes on startup","Items missing from my order","Cannot download my invoice","Change of delivery address","Warranty claim","Slow since the last update","Question about my subscription renewal","Data not syncing between devices","Cancel my order","Upgrade to a higher plan"],x=["Asked the customer for a screenshot of the error.","Reproduced the issue on our side.","Escalated to the second-level team.","Sent the customer a workaround.","Customer confirmed the fix works.","Waiting for the customer's reply.","Refund approved and processed.","Replacement shipped today.","Called the customer, no answer; left a voicemail.","Linked to a known issue, a fix is planned.","Updated the customer's address on file.","Shared the knowledge article on this topic.","Closed after the customer confirmed.","Reset the account; login works again.","Checked the logs, nothing unusual found."],j=1440*60*1e3,V=365,Y=120,W=30,N=20,K=65,b=class{locale;localeData;geoGenerator;usernameToken=crypto.randomUUID().replace(/-/g,"").slice(0,8);random;today;companyDecks=new Map;companiesDealt=new Map;constructor(e,t={}){this.locale=e??"en_US",this.localeData=c(this.locale),this.geoGenerator=new u(this.locale),this.random=t.random??Math.random,this.today=t.today??(()=>new Date)}setLocale(e){this.locale=e,this.localeData=c(e),this.geoGenerator=new u(e)}generate(e,t,r=0){if(t<=0||e.length===0)return[];let a=[],o=e.filter(n=>f(n.config.fakerMethod??"lorem")==="phone");for(let n=r;n<r+t;n++){let d={},m=new Map,C=(s,p)=>{let y=m.get(s);if(y!==void 0)return y%p;let D=this.below(p);return m.set(s,D),D};for(let s of e){let p=o.indexOf(s),y=p>=0?n*o.length+p:n;d[s.fieldApiName]=this.generateFieldValue(s,y,C)}a.push(d)}return a}dateOf(e){return e==="pastDate"?this.pastDate():this.futureDate()}below(e){return Math.min(e-1,Math.floor(this.random()*e))}pick(e){return e[this.below(e.length)]}generateFieldValue(e,t,r){let a=e.config.fakerMethod??"lorem",o={min:e.config.minValue??0,max:e.config.maxValue??1e3},n=e.config.fakerLocale;if(n&&n!==this.locale){let d=this.locale,m=this.localeData,C=this.geoGenerator;this.locale=n,this.localeData=c(n),this.geoGenerator=new u(n);let s=this.generateByMethodInstance(a,t,o,r);return this.locale=d,this.localeData=m,this.geoGenerator=C,s}return this.generateByMethodInstance(a,t,o,r)}generateByMethodInstance(e,t,r,a){let o=f(e);if(!o)return Z(e);let n=()=>a("geo",1e4);switch(o){case"name":return`${this.firstName(a)} ${this.lastName(a)}`;case"firstName":return this.firstName(a);case"lastName":return this.lastName(a);case"jobTitle":return`${this.pick(M)} ${this.pick(P)} ${this.pick(U)}`;case"email":return this.generateEmail(t,a);case"username":return this.generateUsername(t,a);case"nickname":return this.generateNickname(t,a);case"phone":return this.generatePhone(t);case"address":return`${this.streetAddress()}, ${this.geoGenerator.getCity(n())}`;case"streetAddress":return this.streetAddress();case"city":return this.geoGenerator.getCity(n());case"country":return this.geoGenerator.getCountry(n());case"state":return this.geoGenerator.getState(n());case"company":return this.generateCompany();case"catchPhrase":return`${this.pick(G)} ${this.pick(O)} `+this.pick(I);case"date":case"pastDate":return this.pastDate();case"futureDate":return this.futureDate();case"futureDateTime":return this.futureDateTime();case"birthdate":return this.birthdate();case"number":case"integer":return Math.floor(r.min+this.random()*(r.max-r.min+1));case"float":return Math.round((r.min+this.random()*(r.max-r.min))*100)/100;case"boolean":return t%2===0;case"lorem":case"sentence":return g(t);case"paragraph":return q(t);case"caseSubject":return this.pick(H);case"caseComment":return this.pick(x);case"uuid":return this.uuid();case"url":return`https://example.com/resource/${t}`;case"zipCode":return this.geoGenerator.getZipCode(n());case"productName":return this.productName(a);case"productDescription":return`${this.productName(a)}, made for ${this.pick(J)}.`;case"iban":return this.generateIban(t);case"bic":return this.generateBic(t)}}firstName(e){let t=this.localeData.firstNames;return t[e("first",t.length)]}lastName(e){let t=this.localeData.lastNames;return t[e("last",t.length)]}generateEmail(e,t){let r=this.localeData.emailDomains[e%this.localeData.emailDomains.length];return`${h(this.firstName(t))}.${h(this.lastName(t))}${e}@${r}`}generateUsername(e,t){let r=h(this.firstName(t)),a=h(this.lastName(t)),o=this.localeData.emailDomains[e%this.localeData.emailDomains.length];return`${r}.${a}.${this.usernameToken}${e}@${o}`}generateNickname(e,t){return`${h(this.firstName(t)).slice(0,20)}.${this.usernameToken}${e}`}generatePhone(e){return k(this.locale,e)}streetAddress(){let{names:e,format:t}=z[l(this.locale)];return t.replace("{street}",this.pick(e)).replace("{n}",String(1+this.below(199))).replace("{m}",String(1+this.below(9)))}generateCompany(){let e=l(this.locale),t=A[e].companies.length,r=this.companyDecks.get(e);if(!r||r.length!==t){r=Array.from({length:t},(o,n)=>n);for(let o=r.length-1;o>0;o--){let n=this.below(o+1);[r[o],r[n]]=[r[n],r[o]]}this.companyDecks.set(e,r)}let a=this.companiesDealt.get(e)??0;return this.companiesDealt.set(e,a+1),v(e,r[a%r.length],Math.floor(a/r.length))}productName(e){let t=T[e("productAdjective",T.length)],r=E[e("productMaterial",E.length)],a=_[e("product",_.length)];return`${t} ${r} ${a}`}pastDate(){return S(this.daysFromToday(-(1+this.below(V))))}futureDate(){return S(this.daysFromToday(1+this.below(Y)))}futureDateTime(){let e=this.daysFromToday(1+this.below(W));return e.setUTCHours(8+this.below(9),this.below(2)*30,0,0),e.toISOString()}birthdate(){let e=(K-N)*365;return S(this.daysFromToday(-(N*365+this.below(e))))}daysFromToday(e){return new Date(this.today().getTime()+e*j)}uuid(){let e=Array.from({length:32},()=>this.below(16).toString(16));e[12]="4",e[16]=(this.below(16)&3|8).toString(16);let t=e.join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}generateIban(e){let t=$[l(this.locale)],r=R("#".repeat(t.bbanLength),e);return`${t.country}${X(t.country,r)}${r}`}generateBic(e){let t=Array.from({length:4},(a,o)=>String.fromCharCode(65+(e*5+o*7+3)%26)).join(""),r=Array.from({length:2},(a,o)=>w[(e*3+o*11+2)%w.length]).join("");return`${t}${F[l(this.locale)]}${r}XXX`}};function oe(i,e,t,r,a){let o=new b(r,a),n={fieldApiName:"temp",ruleType:"faker",config:{fakerMethod:i,minValue:t.min,maxValue:t.max}};return o.generate([n],e+1)[e]?.temp}function S(i){return i.toISOString().split("T")[0]}function h(i){return i.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z]/g,"")}function X(i,e){let t=`${e}${i}00`.replace(/[A-Z]/g,a=>String(a.charCodeAt(0)-55)),r=0;for(let a of t)r=(r*10+Number(a))%97;return String(98-r).padStart(2,"0")}function Z(i){throw new Error(`Faker method "${i}" is not implemented: choose a method SandForge generates, or remove it from the field rule.`)}function g(i){let e=["lorem","ipsum","dolor","sit","amet","consectetur","adipiscing","elit"],t=i%e.length,r=[];for(let a=0;a<6;a++)r.push(e[(t+a)%e.length]);return r.join(" ")+"."}function q(i){return[g(i),g(i+1),g(i+2)].join(" ")}export{b as a,oe as b};
|
|
7
|
+
import{c as z,d as v,f as A,j as k,k as c,l as R}from"./chunk-FQGHL7GR.mjs";import{lc as f}from"./chunk-J347SPU6.mjs";var L={en_US:[{city:"New York",state:"New York",country:"United States",zipCode:"10001"},{city:"Los Angeles",state:"California",country:"United States",zipCode:"90001"},{city:"Chicago",state:"Illinois",country:"United States",zipCode:"60601"},{city:"Houston",state:"Texas",country:"United States",zipCode:"77001"},{city:"Phoenix",state:"Arizona",country:"United States",zipCode:"85001"},{city:"Philadelphia",state:"Pennsylvania",country:"United States",zipCode:"19101"},{city:"San Antonio",state:"Texas",country:"United States",zipCode:"78201"},{city:"San Diego",state:"California",country:"United States",zipCode:"92101"},{city:"Dallas",state:"Texas",country:"United States",zipCode:"75201"},{city:"Austin",state:"Texas",country:"United States",zipCode:"78701"}],fr_FR:[{city:"Paris",state:"Ile-de-France",country:"France",zipCode:"75001"},{city:"Lyon",state:"Auvergne-Rhone-Alpes",country:"France",zipCode:"69001"},{city:"Marseille",state:"Provence-Alpes-Cote d'Azur",country:"France",zipCode:"13001"},{city:"Toulouse",state:"Occitanie",country:"France",zipCode:"31000"},{city:"Nice",state:"Provence-Alpes-Cote d'Azur",country:"France",zipCode:"06000"},{city:"Bordeaux",state:"Nouvelle-Aquitaine",country:"France",zipCode:"33000"},{city:"Strasbourg",state:"Grand Est",country:"France",zipCode:"67000"},{city:"Nantes",state:"Pays de la Loire",country:"France",zipCode:"44000"},{city:"Lille",state:"Hauts-de-France",country:"France",zipCode:"59000"},{city:"Rennes",state:"Bretagne",country:"France",zipCode:"35000"}],de_DE:[{city:"Berlin",state:"Berlin",country:"Germany",zipCode:"10115"},{city:"Munich",state:"Bavaria",country:"Germany",zipCode:"80331"},{city:"Hamburg",state:"Hamburg",country:"Germany",zipCode:"20095"},{city:"Frankfurt",state:"Hesse",country:"Germany",zipCode:"60311"},{city:"Cologne",state:"North Rhine-Westphalia",country:"Germany",zipCode:"50667"},{city:"Stuttgart",state:"Baden-Wurttemberg",country:"Germany",zipCode:"70173"},{city:"Dusseldorf",state:"North Rhine-Westphalia",country:"Germany",zipCode:"40213"},{city:"Leipzig",state:"Saxony",country:"Germany",zipCode:"04109"},{city:"Dresden",state:"Saxony",country:"Germany",zipCode:"01067"},{city:"Hannover",state:"Lower Saxony",country:"Germany",zipCode:"30159"}],es_ES:[{city:"Madrid",state:"Comunidad de Madrid",country:"Spain",zipCode:"28001"},{city:"Barcelona",state:"Catalonia",country:"Spain",zipCode:"08001"},{city:"Valencia",state:"Comunitat Valenciana",country:"Spain",zipCode:"46001"},{city:"Seville",state:"Andalusia",country:"Spain",zipCode:"41001"},{city:"Zaragoza",state:"Aragon",country:"Spain",zipCode:"50001"},{city:"Malaga",state:"Andalusia",country:"Spain",zipCode:"29001"},{city:"Bilbao",state:"Basque Country",country:"Spain",zipCode:"48001"},{city:"Murcia",state:"Region de Murcia",country:"Spain",zipCode:"30001"},{city:"Palma",state:"Balearic Islands",country:"Spain",zipCode:"07001"},{city:"Granada",state:"Andalusia",country:"Spain",zipCode:"18001"}],ja_JP:[{city:"Tokyo",state:"Tokyo",country:"Japan",zipCode:"100-0001"},{city:"Osaka",state:"Osaka",country:"Japan",zipCode:"530-0001"},{city:"Yokohama",state:"Kanagawa",country:"Japan",zipCode:"220-0011"},{city:"Nagoya",state:"Aichi",country:"Japan",zipCode:"450-0001"},{city:"Sapporo",state:"Hokkaido",country:"Japan",zipCode:"060-0001"},{city:"Fukuoka",state:"Fukuoka",country:"Japan",zipCode:"810-0001"},{city:"Kobe",state:"Hyogo",country:"Japan",zipCode:"650-0001"},{city:"Kyoto",state:"Kyoto",country:"Japan",zipCode:"600-8001"},{city:"Sendai",state:"Miyagi",country:"Japan",zipCode:"980-0001"},{city:"Hiroshima",state:"Hiroshima",country:"Japan",zipCode:"730-0001"}],pt_BR:[{city:"Sao Paulo",state:"Sao Paulo",country:"Brazil",zipCode:"01000-000"},{city:"Rio de Janeiro",state:"Rio de Janeiro",country:"Brazil",zipCode:"20000-000"},{city:"Brasilia",state:"Distrito Federal",country:"Brazil",zipCode:"70000-000"},{city:"Salvador",state:"Bahia",country:"Brazil",zipCode:"40000-000"},{city:"Fortaleza",state:"Ceara",country:"Brazil",zipCode:"60000-000"},{city:"Belo Horizonte",state:"Minas Gerais",country:"Brazil",zipCode:"30000-000"},{city:"Manaus",state:"Amazonas",country:"Brazil",zipCode:"69000-000"},{city:"Curitiba",state:"Parana",country:"Brazil",zipCode:"80000-000"},{city:"Recife",state:"Pernambuco",country:"Brazil",zipCode:"50000-000"},{city:"Porto Alegre",state:"Rio Grande do Sul",country:"Brazil",zipCode:"90000-000"}]},B={en:"en_US",fr:"fr_FR",de:"de_DE",es:"es_ES",ja:"ja_JP",pt:"pt_BR"};function l(i){if(i in L)return i;let e=i.split("_")[0].toLowerCase();return B[e]??"en_US"}var u=class{tuples;resolvedLocale;constructor(e){this.resolvedLocale=l(e??"en_US"),this.tuples=L[this.resolvedLocale]}getAddress(e){return this.tuples[e%this.tuples.length]}getCity(e){return this.getAddress(e).city}getState(e){return this.getAddress(e).state}getCountry(e){return this.getAddress(e).country}getZipCode(e){return this.getAddress(e).zipCode}getLocaleData(){return c(this.resolvedLocale)}};var F={en_US:"US",fr_FR:"FR",de_DE:"DE",es_ES:"ES",ja_JP:"JP",pt_BR:"BR"},$={fr_FR:{country:"FR",bbanLength:23},de_DE:{country:"DE",bbanLength:18},es_ES:{country:"ES",bbanLength:20},en_US:{country:"DE",bbanLength:18},ja_JP:{country:"DE",bbanLength:18},pt_BR:{country:"DE",bbanLength:18}},w="ABCDEFGHIJKLMNPQRSTUVWXYZ",T=["Ergonomic","Handcrafted","Refined","Sleek","Rustic","Compact","Modular","Insulated"],E=["Steel","Wooden","Cotton","Granite","Rubber","Leather","Ceramic"],_=["Chair","Table","Lamp","Keyboard","Backpack","Bottle","Headphones","Gloves","Bench"],M=["Senior","Lead","Junior","Principal","Associate","Chief"],P=["Marketing","Operations","Finance","Sales","Product","Customer Success"],U=["Manager","Analyst","Coordinator","Specialist","Director","Consultant"],G=["Adaptive","Integrated","Customer-focused","Scalable","Secure"],O=["cloud-based","real-time","data-driven","modular","global"],I=["platform","solution","workflow","service","framework","network"],J=["daily use at home or in the office","long days on the move","teams that need something that lasts","small spaces","outdoor work in any weather"],H=["Unable to log in","Invoice discrepancy","Password reset email not received","Order arrived damaged","Request for a refund","Cannot update billing address","Shipment delayed","Error when exporting a report","Product not working as described","Question about my contract","Charged twice for one order","Need help with installation","Account locked after failed logins","Wrong item delivered","Request: edit several records at once","App crashes on startup","Items missing from my order","Cannot download my invoice","Change of delivery address","Warranty claim","Slow since the last update","Question about my subscription renewal","Data not syncing between devices","Cancel my order","Upgrade to a higher plan"],x=["Asked the customer for a screenshot of the error.","Reproduced the issue on our side.","Escalated to the second-level team.","Sent the customer a workaround.","Customer confirmed the fix works.","Waiting for the customer's reply.","Refund approved and processed.","Replacement shipped today.","Called the customer, no answer; left a voicemail.","Linked to a known issue, a fix is planned.","Updated the customer's address on file.","Shared the knowledge article on this topic.","Closed after the customer confirmed.","Reset the account; login works again.","Checked the logs, nothing unusual found."],j=1440*60*1e3,V=365,Y=120,W=30,N=20,K=65,b=class{locale;localeData;geoGenerator;usernameToken=crypto.randomUUID().replace(/-/g,"").slice(0,8);random;today;companyDecks=new Map;companiesDealt=new Map;constructor(e,t={}){this.locale=e??"en_US",this.localeData=c(this.locale),this.geoGenerator=new u(this.locale),this.random=t.random??Math.random,this.today=t.today??(()=>new Date)}setLocale(e){this.locale=e,this.localeData=c(e),this.geoGenerator=new u(e)}generate(e,t,r=0){if(t<=0||e.length===0)return[];let a=[],o=e.filter(n=>f(n.config.fakerMethod??"lorem")==="phone");for(let n=r;n<r+t;n++){let d={},m=new Map,C=(s,p)=>{let y=m.get(s);if(y!==void 0)return y%p;let D=this.below(p);return m.set(s,D),D};for(let s of e){let p=o.indexOf(s),y=p>=0?n*o.length+p:n;d[s.fieldApiName]=this.generateFieldValue(s,y,C)}a.push(d)}return a}dateOf(e){return e==="pastDate"?this.pastDate():this.futureDate()}below(e){return Math.min(e-1,Math.floor(this.random()*e))}pick(e){return e[this.below(e.length)]}generateFieldValue(e,t,r){let a=e.config.fakerMethod??"lorem",o={min:e.config.minValue??0,max:e.config.maxValue??1e3},n=e.config.fakerLocale;if(n&&n!==this.locale){let d=this.locale,m=this.localeData,C=this.geoGenerator;this.locale=n,this.localeData=c(n),this.geoGenerator=new u(n);let s=this.generateByMethodInstance(a,t,o,r);return this.locale=d,this.localeData=m,this.geoGenerator=C,s}return this.generateByMethodInstance(a,t,o,r)}generateByMethodInstance(e,t,r,a){let o=f(e);if(!o)return Z(e);let n=()=>a("geo",1e4);switch(o){case"name":return`${this.firstName(a)} ${this.lastName(a)}`;case"firstName":return this.firstName(a);case"lastName":return this.lastName(a);case"jobTitle":return`${this.pick(M)} ${this.pick(P)} ${this.pick(U)}`;case"email":return this.generateEmail(t,a);case"username":return this.generateUsername(t,a);case"nickname":return this.generateNickname(t,a);case"phone":return this.generatePhone(t);case"address":return`${this.streetAddress()}, ${this.geoGenerator.getCity(n())}`;case"streetAddress":return this.streetAddress();case"city":return this.geoGenerator.getCity(n());case"country":return this.geoGenerator.getCountry(n());case"state":return this.geoGenerator.getState(n());case"company":return this.generateCompany();case"catchPhrase":return`${this.pick(G)} ${this.pick(O)} `+this.pick(I);case"date":case"pastDate":return this.pastDate();case"futureDate":return this.futureDate();case"futureDateTime":return this.futureDateTime();case"birthdate":return this.birthdate();case"number":case"integer":return Math.floor(r.min+this.random()*(r.max-r.min+1));case"float":return Math.round((r.min+this.random()*(r.max-r.min))*100)/100;case"boolean":return t%2===0;case"lorem":case"sentence":return g(t);case"paragraph":return q(t);case"caseSubject":return this.pick(H);case"caseComment":return this.pick(x);case"uuid":return this.uuid();case"url":return`https://example.com/resource/${t}`;case"zipCode":return this.geoGenerator.getZipCode(n());case"productName":return this.productName(a);case"productDescription":return`${this.productName(a)}, made for ${this.pick(J)}.`;case"iban":return this.generateIban(t);case"bic":return this.generateBic(t)}}firstName(e){let t=this.localeData.firstNames;return t[e("first",t.length)]}lastName(e){let t=this.localeData.lastNames;return t[e("last",t.length)]}generateEmail(e,t){let r=this.localeData.emailDomains[e%this.localeData.emailDomains.length];return`${h(this.firstName(t))}.${h(this.lastName(t))}${e}@${r}`}generateUsername(e,t){let r=h(this.firstName(t)),a=h(this.lastName(t)),o=this.localeData.emailDomains[e%this.localeData.emailDomains.length];return`${r}.${a}.${this.usernameToken}${e}@${o}`}generateNickname(e,t){return`${h(this.firstName(t)).slice(0,20)}.${this.usernameToken}${e}`}generatePhone(e){return k(this.locale,e)}streetAddress(){let{names:e,format:t}=z[l(this.locale)];return t.replace("{street}",this.pick(e)).replace("{n}",String(1+this.below(199))).replace("{m}",String(1+this.below(9)))}generateCompany(){let e=l(this.locale),t=A[e].companies.length,r=this.companyDecks.get(e);if(!r||r.length!==t){r=Array.from({length:t},(o,n)=>n);for(let o=r.length-1;o>0;o--){let n=this.below(o+1);[r[o],r[n]]=[r[n],r[o]]}this.companyDecks.set(e,r)}let a=this.companiesDealt.get(e)??0;return this.companiesDealt.set(e,a+1),v(e,r[a%r.length],Math.floor(a/r.length))}productName(e){let t=T[e("productAdjective",T.length)],r=E[e("productMaterial",E.length)],a=_[e("product",_.length)];return`${t} ${r} ${a}`}pastDate(){return S(this.daysFromToday(-(1+this.below(V))))}futureDate(){return S(this.daysFromToday(1+this.below(Y)))}futureDateTime(){let e=this.daysFromToday(1+this.below(W));return e.setUTCHours(8+this.below(9),this.below(2)*30,0,0),e.toISOString()}birthdate(){let e=(K-N)*365;return S(this.daysFromToday(-(N*365+this.below(e))))}daysFromToday(e){return new Date(this.today().getTime()+e*j)}uuid(){let e=Array.from({length:32},()=>this.below(16).toString(16));e[12]="4",e[16]=(this.below(16)&3|8).toString(16);let t=e.join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}generateIban(e){let t=$[l(this.locale)],r=R("#".repeat(t.bbanLength),e);return`${t.country}${X(t.country,r)}${r}`}generateBic(e){let t=Array.from({length:4},(a,o)=>String.fromCharCode(65+(e*5+o*7+3)%26)).join(""),r=Array.from({length:2},(a,o)=>w[(e*3+o*11+2)%w.length]).join("");return`${t}${F[l(this.locale)]}${r}XXX`}};function oe(i,e,t,r,a){let o=new b(r,a),n={fieldApiName:"temp",ruleType:"faker",config:{fakerMethod:i,minValue:t.min,maxValue:t.max}};return o.generate([n],e+1)[e]?.temp}function S(i){return i.toISOString().split("T")[0]}function h(i){return i.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z]/g,"")}function X(i,e){let t=`${e}${i}00`.replace(/[A-Z]/g,a=>String(a.charCodeAt(0)-55)),r=0;for(let a of t)r=(r*10+Number(a))%97;return String(98-r).padStart(2,"0")}function Z(i){throw new Error(`Faker method "${i}" is not implemented: choose a method SandForge generates, or remove it from the field rule.`)}function g(i){let e=["lorem","ipsum","dolor","sit","amet","consectetur","adipiscing","elit"],t=i%e.length,r=[];for(let a=0;a<6;a++)r.push(e[(t+a)%e.length]);return r.join(" ")+"."}function q(i){return[g(i),g(i+1),g(i+2)].join(" ")}export{b as a,oe as b};
|
|
@@ -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 h}from"./chunk-
|
|
7
|
+
import{a as h}from"./chunk-34SMB5PA.mjs";import{h as R,i as u,j as S,v as m}from"./chunk-KWUS7UAV.mjs";var y=20,w="seed-runs",l="sandforge-seed",A=/^[A-Za-z0-9]{15}(?:[A-Za-z0-9]{3})?$/;function U(d,e){let n=d.finishedAt??new Date().toISOString();return{runId:d.runId,configId:l,configName:l,sourceOrgId:d.targetOrgId,targetOrgId:d.targetOrgId,startedAt:d.startedAt??n,end:{at:n,status:d.status},lastWrittenAt:n,created:d.objectResults.filter(i=>i.createdIds.length>0).map(i=>({objectApiName:i.objectApiName,ids:[...i.createdIds]})),...d.runUserId!==void 0&&A.test(d.runUserId)?{runUserId:d.runUserId}:{},...e?{removal:e}:{}}}function E(d,e){let n=h(d);return new p(R(d,w,i=>{n.note(i),e?.(i)}),y,n)}var p=class{constructor(e,n=y,i){this.runs=e;this.max=n;this.droppedRuns=i}runs;max;droppedRuns;recorder(e){let n=this.runs.recorder({runId:e.runId,configId:l,configName:l,sourceOrgId:e.sourceOrgId??e.targetOrgId,targetOrgId:e.targetOrgId,...e.startedAt!==void 0?{startedAt:e.startedAt}:{},...e.origin!==void 0?{origin:e.origin}:{},...e.pipeline!==void 0?{pipeline:{name:e.pipeline.name.slice(0,S)}}:{},...e.targetOrganizationId!==void 0?{targetOrganizationId:e.targetOrganizationId}:{},...e.targetAlias!==void 0?{targetAlias:e.targetAlias}:{},...e.runUserId!==void 0&&A.test(e.runUserId)?{runUserId:e.runUserId}:{}}),i=new Set,g=t=>{let s=t.filter(r=>!i.has(r.slice(0,15)));for(let r of s)i.add(r.slice(0,15));return s},o=(t,s)=>{for(let r=0;r<t.length;r+=u)s(t.slice(r,r+u))},f=(t,s,r)=>o(g(s),a=>n.note(t,a,r)),c=new Map,I=!1;return{runId:e.runId,note:(t,s)=>f(t,s),sending:(t,s,r)=>{r?.job!==void 0?c.set(t,r.job):c.delete(t),n.sending?.(t,s,r)},answered:(t,s)=>{c.delete(t);let r=g(s);n.answered?.(t,r.slice(0,u)),o(r.slice(u),a=>n.note(t,a))},wroteAgain:(t,s)=>o(s.filter(r=>i.has(r.slice(0,15))),r=>n.note(t,r)),checkpoint:t=>n.checkpoint?.(t),runUser:t=>{I||n.runUser?.(t)},end:async t=>{let s=t.finishedAt??new Date().toISOString();for(let{objectApiName:a,createdIds:v}of t.objectResults)f(a,v,s);if(i.size===0&&c.size===0){I=!0,await n.flush(),await this.runs.forget(e.runId);return}await n.end({status:t.status,...t.cancelled?{cancelled:!0}:{},at:s});let r=await n.flush();if(r!==void 0)throw new Error(r);await this.keepTheLatest()}}}record(e){let n=e.startedAt??e.finishedAt;return this.recorder({runId:e.runId,targetOrgId:e.targetOrgId,...n!==void 0?{startedAt:n}:{},...e.runUserId!==void 0?{runUserId:e.runUserId}:{}}).end(e)}async keepTheLatest(){let e=(await this.runs.list()).filter(m),n=e.length-this.max;for(let i of[...e].reverse()){if(n<=0)return;await this.runs.forget(i.runId),n--}}pathOf(e){return this.runs.pathOf(e)}get storagePath(){return this.runs.storagePath}get(e){return this.runs.get(e)}async dropped(e){return this.droppedRuns?.find(e)}list(){return this.runs.list()}answerInFlight(e,n,i,g,o){return this.runs.answerInFlight(e,n,i,g,o)}async updateRemoval(e,n){await this.runs.get(e)&&await this.runs.updateRemoval(e,n)}};export{y as a,w as b,U as c,E as d,p as e};
|
|
@@ -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{d as v}from"./chunk-UV74P4H2.mjs";import{d as f,k as h,z as b}from"./chunk-
|
|
7
|
+
import{d as v}from"./chunk-UV74P4H2.mjs";import{d as f,k as h,z as b}from"./chunk-4CSBZZAL.mjs";import{Xa as E,lb as x,mb as U,nb as A,ob as P,vb as _}from"./chunk-J347SPU6.mjs";import{b as o,e as l,f as m,k as i,m as a,u as c,v as w,z as O}from"./chunk-WZQEK4WT.mjs";import{randomBytes as k}from"node:crypto";import{open as I,readFile as j,readdir as F,rename as M,rm as J}from"node:fs/promises";import{homedir as Z}from"node:os";import{join as p,resolve as G}from"node:path";var T="users";function se(n=process.env){let e=n.SANDFORGE_JOURNAL_DIR,r=e!==void 0&&e.trim()!==""?G(e):p(Z(),".sandforge");return p(r,T)}var g=O.datetime({offset:!0}),R=l().int().nonnegative(),y=l().int().positive().max(999999),D=a({isActive:m(),isFrozen:m(),profileId:o().regex(/^00e[A-Za-z0-9]{12}(?:[A-Za-z0-9]{3})?$/)}),H=a({id:o().regex(/^(?:0Pa|011)[A-Za-z0-9]{12}(?:[A-Za-z0-9]{3})?$/),what:c(["permissionSet","permissionSetGroup","group"]),name:o().regex(/^[A-Za-z][A-Za-z0-9_]*$/).max(80),type:c(["Regular","Queue"]).optional()}),X=a({applied:_,after:D,accesses:i(H).max(U+A+P),inFile:m()}),L=a({at:g,status:c(["success","partial","failure","cancelled"]),undone:R,kept:R,codes:i(o().regex(/^[A-Z][A-Z_]{1,63}$/)).max(50)}),S=a({version:w(1),organizationId:E,run:y,replaces:y.optional(),status:c(["running","success","partial","failure","cancelled"]),startedAt:g,endedAt:g.optional(),emailsToPeople:R,users:i(X).max(2*x),removals:i(L).max(1e3).optional()});function C(n){return`refused with ${n}; the org\u2019s words are not kept, as they may name the person`}function N(n){return{...n,users:n.users.map(e=>e.applied.refused===void 0?e:{...e,applied:{...e.applied,refused:e.applied.refused.map(r=>({...r,message:C(r.code)}))}})}}var K=/^run-([1-9]\d{0,5})\.json$/,$=class{root;guard;constructor(e){this.guard=e.guard??new v,this.root=this.guard.assertOutsideRepo(e.root)}folderOf(e){return this.guard.assertOutsideRepo(p(this.root,h(e)))}fileOf(e,r){return p(this.folderOf(e),`run-${y.parse(r)}.json`)}async begin(e,r){let s=this.folderOf(e);await b(s);for(let t=await this.highest(e)+1;;t+=1){let u=S.parse(N({...r,version:1,organizationId:h(e),run:t})),d;try{d=await I(this.fileOf(e,t),"wx",f)}catch(z){if(z.code==="EEXIST")continue;throw z}try{await d.writeFile(`${JSON.stringify(u,null,2)}
|
|
8
8
|
`,"utf8"),await d.sync()}finally{await d.close()}return u}}async write(e){let r=S.parse(N(e));await W(this.fileOf(r.organizationId,r.run),`${JSON.stringify(r,null,2)}
|
|
9
9
|
`)}async read(e,r){let s;try{s=await j(this.fileOf(e,r),"utf8")}catch(t){if(t.code==="ENOENT")return;throw t}try{let t=S.safeParse(JSON.parse(s));return t.success&&t.data.run===r?t.data:void 0}catch{return}}async list(e){let r=[];for(let s of(await this.numbers(e)).sort((t,u)=>u-t)){let t=await this.read(e,s);t&&r.push(t)}return r}async numbers(e){let r;try{r=await F(this.folderOf(e))}catch(s){if(s.code==="ENOENT")return[];throw s}return r.flatMap(s=>{let t=K.exec(s);return t?[Number(t[1])]:[]})}async highest(e){return Math.max(0,...await this.numbers(e))}};async function W(n,e){let r=`${n}.${process.pid}-${k(4).toString("hex")}.tmp`,s=await I(r,"wx",f);try{try{await s.writeFile(e,"utf8"),await s.sync()}finally{await s.close()}await M(r,n)}catch(t){throw await J(r,{force:!0}),t}}export{se as a,X as b,S as c,$ as d};
|