sandforge 1.80.0 → 1.82.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 +48 -0
- package/bin/sandforge-pipeline.mjs +12 -0
- package/bin/sandforge-users.mjs +12 -0
- package/lib/{chunk-J525F5KI.mjs → chunk-27Z76O2O.mjs} +1 -1
- package/lib/chunk-2JZGCCPG.mjs +9 -0
- package/lib/{chunk-ELFXJHU7.mjs → chunk-2UU42PTD.mjs} +1 -1
- package/lib/{chunk-N652NMZ4.mjs → chunk-32EUNQT6.mjs} +52 -52
- package/lib/chunk-3C2ZZIFN.mjs +7 -0
- package/lib/chunk-3CX7GPCR.mjs +7 -0
- package/lib/chunk-3HEMJTAP.mjs +925 -0
- package/lib/{chunk-BY2HJFFG.mjs → chunk-3HROD5RE.mjs} +1 -1
- package/lib/{chunk-OHWNPXWW.mjs → chunk-3MGMNK3Q.mjs} +1 -1
- package/lib/{chunk-PZPJKATS.mjs → chunk-3SKLBRPL.mjs} +8 -8
- package/lib/chunk-3XG25GTF.mjs +7 -0
- package/lib/chunk-42BFLWHR.mjs +7 -0
- package/lib/chunk-466F37VD.mjs +7 -0
- package/lib/chunk-47UHTN3Q.mjs +7 -0
- package/lib/chunk-4JKR4PTZ.mjs +8 -0
- package/lib/{chunk-COFG7Q6R.mjs → chunk-52EXDVPN.mjs} +1 -1
- package/lib/{chunk-SAR5622P.mjs → chunk-54HYHHVL.mjs} +1 -1
- package/lib/{chunk-RSWDYIHY.mjs → chunk-5GBO4KD5.mjs} +1 -1
- package/lib/chunk-5K2I2DMP.mjs +11 -0
- package/lib/{chunk-AV5SWEHP.mjs → chunk-6FARZYMJ.mjs} +1 -1
- package/lib/{chunk-BV6VTP3J.mjs → chunk-6GQUZ4IP.mjs} +1 -1
- package/lib/chunk-6KP6WETK.mjs +9 -0
- package/lib/{chunk-MJVTDA5Q.mjs → chunk-6VSZNZHH.mjs} +1 -1
- package/lib/{chunk-XUWL6ZPC.mjs → chunk-7CVDVBEE.mjs} +1 -1
- package/lib/{chunk-UCD54V2M.mjs → chunk-7EYQYZJP.mjs} +1 -1
- package/lib/{chunk-5K5VLULK.mjs → chunk-7LKI7OAS.mjs} +1 -1
- package/lib/chunk-7PY3VQP3.mjs +7 -0
- package/lib/chunk-7SDZR6SR.mjs +7 -0
- package/lib/chunk-7WSLT5VX.mjs +8 -0
- package/lib/chunk-A32ISQ6M.mjs +28 -0
- package/lib/{chunk-M3ROUWDX.mjs → chunk-A65ADTCR.mjs} +1 -1
- package/lib/chunk-A7JJWOLT.mjs +7 -0
- package/lib/chunk-AUS6NFLZ.mjs +8 -0
- package/lib/chunk-BMTNTBBM.mjs +7 -0
- package/lib/{chunk-SOU4FRYN.mjs → chunk-BN33LVPQ.mjs} +1 -1
- package/lib/chunk-BNKT3R3F.mjs +7 -0
- package/lib/{chunk-K2FBZIXY.mjs → chunk-BWWQXU2B.mjs} +1 -1
- package/lib/{chunk-IC2C2GOF.mjs → chunk-BXZ73A5M.mjs} +1 -1
- package/lib/{chunk-WA7EYLAQ.mjs → chunk-C2N2TNEU.mjs} +1 -1
- package/lib/{chunk-BKDV4ENO.mjs → chunk-C3LNYAVJ.mjs} +1 -1
- package/lib/{chunk-XLXIPIEW.mjs → chunk-CBL42DUU.mjs} +1 -1
- package/lib/chunk-CCEH7L53.mjs +7 -0
- package/lib/chunk-CELEBWEZ.mjs +7 -0
- package/lib/chunk-CV47FDQW.mjs +7 -0
- package/lib/{chunk-2UZPIMUC.mjs → chunk-CZLJZQCS.mjs} +1 -1
- package/lib/chunk-DBBPDSFN.mjs +7 -0
- package/lib/chunk-DIL62SUN.mjs +7 -0
- package/lib/chunk-DIS254AN.mjs +7 -0
- package/lib/{chunk-BTWDMNN3.mjs → chunk-DJCGURW7.mjs} +1 -1
- package/lib/{chunk-F6GUDTOB.mjs → chunk-DT3T7FRD.mjs} +1 -1
- package/lib/{chunk-IGYH7GMA.mjs → chunk-DWMRIWV5.mjs} +1 -1
- package/lib/{chunk-YRQGKDHM.mjs → chunk-EEFUE2ES.mjs} +1 -1
- package/lib/{chunk-FGRG7ANU.mjs → chunk-EOFO3PHS.mjs} +1 -1
- package/lib/{chunk-KBJ5VERV.mjs → chunk-FA4ZKDCU.mjs} +1 -1
- package/lib/{chunk-WU3GLFZO.mjs → chunk-FKK5YBGZ.mjs} +1 -1
- package/lib/chunk-FOIWWK7G.mjs +156 -0
- package/lib/chunk-FZF23M6R.mjs +7 -0
- package/lib/chunk-G2JR3F63.mjs +7 -0
- package/lib/{chunk-JEERQRLW.mjs → chunk-GBGHJTPC.mjs} +1 -1
- package/lib/{chunk-3RZQZHEB.mjs → chunk-GCGHHN4K.mjs} +1 -1
- package/lib/{chunk-RPI7LRTW.mjs → chunk-GGNUACTY.mjs} +1 -1
- package/lib/{chunk-EMNC6YI4.mjs → chunk-GGUOIDWP.mjs} +1 -1
- package/lib/chunk-GHPR5UVV.mjs +7 -0
- package/lib/{chunk-X5JYBPXP.mjs → chunk-GJ6SZVHT.mjs} +1 -1
- package/lib/{chunk-W622GUAW.mjs → chunk-H4JUYUSL.mjs} +1 -1
- package/lib/{chunk-XAMBCQPU.mjs → chunk-H4OBZIX3.mjs} +1 -1
- package/lib/{chunk-WIO4XO4F.mjs → chunk-HFSBDM7B.mjs} +1 -1
- package/lib/{chunk-L77FJZEP.mjs → chunk-HFUDCNU5.mjs} +1 -1
- package/lib/chunk-HIHCYMSL.mjs +7 -0
- package/lib/chunk-HKUWHVI7.mjs +9 -0
- package/lib/chunk-HQQVANWQ.mjs +20 -0
- package/lib/chunk-ICIYL45C.mjs +7 -0
- package/lib/chunk-IRZJU2PG.mjs +22 -0
- package/lib/chunk-ISSP2FZ5.mjs +7 -0
- package/lib/chunk-IVZJSDJD.mjs +7 -0
- package/lib/chunk-J24TIGSI.mjs +10 -0
- package/lib/{chunk-UNJA4J37.mjs → chunk-JESRFE2Z.mjs} +4 -4
- package/lib/chunk-JFNLKHY6.mjs +8 -0
- package/lib/chunk-JH27IKCO.mjs +9 -0
- package/lib/chunk-JJITOWZK.mjs +7 -0
- package/lib/{chunk-E5AHXLS6.mjs → chunk-JKT5YAQ2.mjs} +1 -1
- package/lib/{chunk-IWDREM66.mjs → chunk-JLZRZL5E.mjs} +1 -1
- package/lib/{chunk-FPKYYFM7.mjs → chunk-JPEVIXNH.mjs} +1 -1
- package/lib/chunk-JQZTMFO7.mjs +7 -0
- package/lib/chunk-KIMQQ6JQ.mjs +7 -0
- package/lib/{chunk-MILU7WFN.mjs → chunk-KJYEQHYP.mjs} +1 -1
- package/lib/chunk-KKOA62S4.mjs +474 -0
- package/lib/chunk-KP5G6FUC.mjs +7 -0
- package/lib/{chunk-JWTSEDIQ.mjs → chunk-L4INJ5TZ.mjs} +1 -1
- package/lib/{chunk-OLSGVAIL.mjs → chunk-LAUOSXMN.mjs} +53 -53
- package/lib/{chunk-MTMH6H2A.mjs → chunk-LCDPCUXS.mjs} +1 -1
- package/lib/{chunk-KDGMAGQR.mjs → chunk-LHU6CPGE.mjs} +1 -1
- package/lib/{chunk-YAZO75G2.mjs → chunk-LNXBCE7E.mjs} +1 -1
- package/lib/chunk-LXDSRP2W.mjs +7 -0
- package/lib/{chunk-2YIV2OB2.mjs → chunk-MIDBQ7SD.mjs} +1 -1
- package/lib/{chunk-TTKXMDBN.mjs → chunk-MKTXJCXN.mjs} +4 -4
- package/lib/chunk-MUEQRIK7.mjs +9 -0
- package/lib/{chunk-IOIWJ3DJ.mjs → chunk-NLB3RGIY.mjs} +1 -1
- package/lib/{chunk-O2HDYYUV.mjs → chunk-NWOI25WY.mjs} +1 -1
- package/lib/chunk-O2PUGRNW.mjs +10 -0
- package/lib/chunk-O4BROUGM.mjs +7 -0
- package/lib/chunk-OETEC3P7.mjs +7 -0
- package/lib/{chunk-GCOB7K5N.mjs → chunk-OHEOJISY.mjs} +1 -1
- package/lib/chunk-P55MKIZX.mjs +37 -0
- package/lib/chunk-P63WJMXQ.mjs +7 -0
- package/lib/chunk-PBE44M2Y.mjs +7 -0
- package/lib/{chunk-TYYOBZMU.mjs → chunk-PC247GKX.mjs} +1 -1
- package/lib/chunk-PE435FVH.mjs +15 -0
- package/lib/chunk-PPGDAUEQ.mjs +7 -0
- package/lib/{chunk-SE4QEZUG.mjs → chunk-PPHVWUFY.mjs} +1 -1
- package/lib/{chunk-CU2INBND.mjs → chunk-PR74GYVI.mjs} +1 -1
- package/lib/chunk-PWVDNN2C.mjs +7 -0
- package/lib/{chunk-6XYKJSGX.mjs → chunk-PYRZFUVU.mjs} +1 -1
- package/lib/{chunk-TLH7AD35.mjs → chunk-PZBZ7MNC.mjs} +1 -1
- package/lib/{chunk-DYFALGRT.mjs → chunk-Q3DY7TO2.mjs} +1 -1
- package/lib/{chunk-BGUEWRK2.mjs → chunk-Q6SXNKV2.mjs} +1 -1
- package/lib/chunk-QAPVKPEC.mjs +7 -0
- package/lib/{chunk-DBFJB2B6.mjs → chunk-QIRO4HTE.mjs} +1 -1
- package/lib/{chunk-TSLJUSLW.mjs → chunk-RCYEBY42.mjs} +1 -1
- package/lib/chunk-RLWB7F26.mjs +7 -0
- package/lib/{chunk-FXXLX4O6.mjs → chunk-RTWYLOCA.mjs} +1 -1
- package/lib/chunk-RYRMUPMY.mjs +7 -0
- package/lib/chunk-SAMWHL22.mjs +13 -0
- package/lib/{chunk-IZQZ6ZUF.mjs → chunk-SFGZFB4F.mjs} +1 -1
- package/lib/{chunk-FKG7Q3WH.mjs → chunk-SNEOKYV7.mjs} +1 -1
- package/lib/{chunk-3TJON4F3.mjs → chunk-STRMWSIQ.mjs} +1 -1
- package/lib/chunk-SZGGFST2.mjs +272 -0
- package/lib/{chunk-SOGQW4IG.mjs → chunk-T7WREYA5.mjs} +1 -1
- package/lib/{chunk-NTFIRZP6.mjs → chunk-TCBAE65A.mjs} +1 -1
- package/lib/{chunk-KYEDBS54.mjs → chunk-TEIBWMJM.mjs} +1 -1
- package/lib/{chunk-YKKRIEH4.mjs → chunk-TMA34QMA.mjs} +1 -1
- package/lib/chunk-TQ2TQHTT.mjs +9 -0
- package/lib/{chunk-HEKAZJRH.mjs → chunk-TWV4A5RK.mjs} +1 -1
- package/lib/{chunk-CEX3NEZL.mjs → chunk-UHFLKP26.mjs} +1 -1
- package/lib/chunk-UV74P4H2.mjs +7 -0
- package/lib/{chunk-WR4Q363I.mjs → chunk-V3R45ZWT.mjs} +1 -1
- package/lib/{chunk-GSKCGQIP.mjs → chunk-VPDEJGPS.mjs} +1 -1
- package/lib/{chunk-HLWMJF6Y.mjs → chunk-VQJMP3DC.mjs} +1 -1
- package/lib/chunk-VV3B6IC3.mjs +7 -0
- package/lib/{chunk-PJ5I73CK.mjs → chunk-VYOYXTCU.mjs} +1 -1
- package/lib/{chunk-NZC67CGR.mjs → chunk-VZT4E2OJ.mjs} +1 -1
- package/lib/{chunk-AEKONPF4.mjs → chunk-VZVICK7Q.mjs} +1 -1
- package/lib/{chunk-WR2GIKWE.mjs → chunk-WB2RIVO3.mjs} +1 -1
- package/lib/chunk-WEMLDUQA.mjs +7 -0
- package/lib/{chunk-MYW5QNGI.mjs → chunk-WOOUISSO.mjs} +1 -1
- package/lib/{chunk-G35N4P7D.mjs → chunk-WSUKC2U3.mjs} +1 -1
- package/lib/{chunk-ZVAED4QV.mjs → chunk-WT3SCUHS.mjs} +1 -1
- package/lib/{chunk-7EANH5PY.mjs → chunk-WZQEK4WT.mjs} +1 -1
- package/lib/{chunk-DBB3EMIN.mjs → chunk-XFU3HRUV.mjs} +1 -1
- package/lib/chunk-XK5W7BVE.mjs +7 -0
- package/lib/{chunk-2GTBABKU.mjs → chunk-XO5FBOQF.mjs} +1 -1
- package/lib/{chunk-CHYDMRSV.mjs → chunk-XSKPYGMT.mjs} +1 -1
- package/lib/chunk-XU25YA46.mjs +9 -0
- package/lib/chunk-XZISAZA6.mjs +7 -0
- package/lib/chunk-Y4TDVDP2.mjs +13 -0
- package/lib/chunk-YAIIRFKJ.mjs +8 -0
- package/lib/{chunk-LKQ5RKIV.mjs → chunk-YAJQS3OL.mjs} +1 -1
- package/lib/{chunk-74Q6DORA.mjs → chunk-YGJF55VJ.mjs} +1 -1
- package/lib/chunk-YH4DYI6D.mjs +7 -0
- package/lib/chunk-YMDFF657.mjs +10 -0
- package/lib/{chunk-2BA2XKAY.mjs → chunk-YT22LMF7.mjs} +1 -1
- package/lib/{chunk-IG2MTQRP.mjs → chunk-Z42PHCVZ.mjs} +1 -1
- package/lib/{chunk-2NBYT7GR.mjs → chunk-ZHIZY3ZC.mjs} +1 -1
- package/lib/chunk-ZQO5PDX5.mjs +48 -0
- package/lib/chunk-ZRUDYB7O.mjs +7 -0
- package/lib/{chunk-BXU6WFMH.mjs → chunk-ZUBBEP75.mjs} +1 -1
- package/lib/chunk-ZUOPC4W2.mjs +7 -0
- package/lib/{chunk-GGD7ON3M.mjs → chunk-ZUTUYBNW.mjs} +1 -1
- package/lib/{chunk-MHMH6MTP.mjs → chunk-ZXFL2MSN.mjs} +1 -1
- package/lib/sandforge-autopilot.mjs +11 -11
- package/lib/sandforge-backup.mjs +63 -32
- package/lib/sandforge-checkpoint.mjs +1 -348
- package/lib/sandforge-cleanup.mjs +1 -1
- package/lib/sandforge-clone.mjs +1 -1
- package/lib/sandforge-compare.mjs +1 -1
- package/lib/sandforge-dataops.mjs +1 -1
- package/lib/sandforge-empty.mjs +11 -11
- package/lib/sandforge-env.mjs +186 -140
- package/lib/sandforge-frozen.mjs +1 -266
- package/lib/sandforge-mcp.mjs +33 -14
- package/lib/sandforge-monitor.mjs +1 -1
- package/lib/sandforge-pipeline.mjs +88 -0
- package/lib/sandforge-seed.mjs +1 -1
- package/lib/sandforge-sync.mjs +1 -1
- package/lib/sandforge-users.mjs +157 -0
- package/lib/sandforge.mjs +1 -22
- package/lib/sf/sandforge/autopilot.mjs +20 -0
- package/lib/sf/sandforge/backup.mjs +20 -0
- package/lib/sf/sandforge/checkpoint.mjs +20 -0
- package/lib/sf/sandforge/cleanup.mjs +20 -0
- package/lib/sf/sandforge/clone.mjs +20 -0
- package/lib/sf/sandforge/compare.mjs +20 -0
- package/lib/sf/sandforge/dataops.mjs +20 -0
- package/lib/sf/sandforge/empty.mjs +20 -0
- package/lib/sf/sandforge/env.mjs +20 -0
- package/lib/sf/sandforge/frozen.mjs +20 -0
- package/lib/sf/sandforge/hardis-commands.mjs +20 -0
- package/lib/sf/sandforge/index.mjs +20 -0
- package/lib/sf/sandforge/mcp.mjs +20 -0
- package/lib/sf/sandforge/monitor.mjs +20 -0
- package/lib/sf/sandforge/pipeline.mjs +20 -0
- package/lib/sf/sandforge/seed.mjs +20 -0
- package/lib/sf/sandforge/sync.mjs +20 -0
- package/lib/sf/sandforge/users.mjs +20 -0
- package/lib/sfHelpHook.mjs +7 -0
- package/lib/sfPlugin.mjs +11 -0
- package/oclif.manifest.json +1 -0
- package/package.json +18 -3
- package/lib/chunk-2CNCDM56.mjs +0 -7
- package/lib/chunk-3F6Q5E7I.mjs +0 -14
- package/lib/chunk-4VS2V6WU.mjs +0 -25
- package/lib/chunk-5P4PHJRL.mjs +0 -9
- package/lib/chunk-5TC3QB4U.mjs +0 -10
- package/lib/chunk-7ABODJ4G.mjs +0 -7
- package/lib/chunk-7EGQP6S4.mjs +0 -7
- package/lib/chunk-7FFGJWHN.mjs +0 -7
- package/lib/chunk-7YDNUBO5.mjs +0 -7
- package/lib/chunk-A527W53V.mjs +0 -7
- package/lib/chunk-ADOAS63R.mjs +0 -7
- package/lib/chunk-B5QQJ4SI.mjs +0 -7
- package/lib/chunk-CION3VMZ.mjs +0 -7
- package/lib/chunk-CSBS5U5I.mjs +0 -7
- package/lib/chunk-DB7RBE5D.mjs +0 -7
- package/lib/chunk-E5ZB3LU5.mjs +0 -7
- package/lib/chunk-EFR2Y7E4.mjs +0 -7
- package/lib/chunk-EHQ3FX6X.mjs +0 -7
- package/lib/chunk-EQNW3UC2.mjs +0 -7
- package/lib/chunk-F43REJDZ.mjs +0 -10
- package/lib/chunk-GSG7WZHM.mjs +0 -7
- package/lib/chunk-HOJYWTP7.mjs +0 -20
- package/lib/chunk-HS4YRX4J.mjs +0 -7
- package/lib/chunk-I7O6C2B5.mjs +0 -8
- package/lib/chunk-IFETCRWE.mjs +0 -10
- package/lib/chunk-IQXHJEYB.mjs +0 -7
- package/lib/chunk-JPUR2CFX.mjs +0 -10
- package/lib/chunk-K327QKMD.mjs +0 -7
- package/lib/chunk-KRCA6IPH.mjs +0 -8
- package/lib/chunk-LPBMBW3O.mjs +0 -13
- package/lib/chunk-LWW4U276.mjs +0 -7
- package/lib/chunk-MFG4MUIO.mjs +0 -9
- package/lib/chunk-MJU2PGZQ.mjs +0 -15
- package/lib/chunk-OAZRPP4I.mjs +0 -7
- package/lib/chunk-OO6CLPEH.mjs +0 -7
- package/lib/chunk-OPXCV2KL.mjs +0 -7
- package/lib/chunk-P33PSCXK.mjs +0 -7
- package/lib/chunk-Q3DM32KF.mjs +0 -11
- package/lib/chunk-QR3WELJQ.mjs +0 -7
- package/lib/chunk-QWT2C74M.mjs +0 -7
- package/lib/chunk-R3X3LV64.mjs +0 -14
- package/lib/chunk-RMBPOTD7.mjs +0 -7
- package/lib/chunk-SIHORWVK.mjs +0 -7
- package/lib/chunk-T62WNR54.mjs +0 -7
- package/lib/chunk-TTFDUKUS.mjs +0 -47
- package/lib/chunk-VE6XKGGD.mjs +0 -7
- package/lib/chunk-VGW4MXXZ.mjs +0 -7
- package/lib/chunk-VS7ZXUII.mjs +0 -824
- package/lib/chunk-VXQLDM4R.mjs +0 -7
- package/lib/chunk-VYXMVJL5.mjs +0 -7
- package/lib/chunk-W7U5E5ZL.mjs +0 -9
- package/lib/chunk-WXAQ7FK3.mjs +0 -115
- package/lib/chunk-YS4G22C2.mjs +0 -7
- package/lib/chunk-ZM6OJGIG.mjs +0 -7
- package/lib/chunk-ZUTYVST5.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{createHmac as c,randomBytes as C}from"node:crypto";import{deflateRawSync as P,inflateRawSync as A}from"node:zlib";var k="@example.invalid",M="+3363998",
|
|
7
|
+
import{createHmac as c,randomBytes as C}from"node:crypto";import{deflateRawSync as P,inflateRawSync as A}from"node:zlib";var k="@example.invalid",M="+3363998",R=new Set(["picklist","multipicklist"]),N={FirstName:"firstName",LastName:"lastName",Email:"email",Phone:"phone",MobilePhone:"phone",HomePhone:"phone",MailingStreet:"address",OtherStreet:"address",BillingStreet:"address",ShippingStreet:"address",MailingCity:"city",OtherCity:"city",BillingCity:"city",ShippingCity:"city",MailingPostalCode:"postalCode",OtherPostalCode:"postalCode",BillingPostalCode:"postalCode",ShippingPostalCode:"postalCode",Company:"company",CompanyName:"company",Name:"company",PersonEmail:"email",PersonMobilePhone:"phone",PersonHomePhone:"phone",PersonOtherPhone:"phone",PersonMailingStreet:"address",PersonOtherStreet:"address",PersonMailingCity:"city",PersonOtherCity:"city",PersonMailingPostalCode:"postalCode",PersonOtherPostalCode:"postalCode"};function E(s,e){let t=s.split("");if(t.length<2)return s;let n=w(e,s,4*(t.length-1));for(let r=t.length-1,i=0;r>0;r--,i+=4){let a=n.readUInt32BE(i)%(r+1);[t[r],t[a]]=[t[a],t[r]]}return t.join("")}function w(s,e,t){let n=[];for(;n.length*32<t;)n.push(c("sha256",s).update(`${n.length}:${e}`).digest());return Buffer.concat(n).subarray(0,t)}function g(s,e){return c("sha256",s).update(e).digest().readUInt32BE(0)&2147483647}var d="Alex Jordan Morgan Casey Riley Quinn Avery Parker Reese Dakota Skyler Sage River Hayden Emery Finley Blake Charlie Drew Rowan Jamie Robin Kendall Logan Peyton Cameron Jesse Kai Arden Bailey Blair Brook Carson Corey Devon Eden Ellis Emerson Frankie Gray Harper Jules Jody Kerry Lane Leslie Linden Marley Micah Nico Noel Oakley Perry Quincy Reagan Remy Rory Sam Sasha Shawn Spencer Sutton Tatum Terry Toby Tracy Val Wren Wynn Adair Alden Ainsley Billie Briar Cass Dale Darcy Ellery Emory Fallon Glenn Hollis Ira Jaden Kit Lennon Lou Mackenzie Monroe Nova Palmer Presley Ridley Sawyer Scout Shay Sloane Tanner Teagan Winter".split(" "),h=["Ash","Birch","Brook","Clay","Fern","Hazel","Lark","Marsh","Oak","Thorn"].flatMap(s=>["bury","combe","dale","field","ford","gate","ridge","stone","ton","wood"].map(e=>`${s}${e}`)),$=32,p=d.length*h.length;function B(s){return{firstName:d[s%d.length],lastName:h[(s>>8)%h.length]}}function u(s){return s%d.length*h.length+(s>>8)%h.length}var m=class{personas=new Map;timesGiven=new Uint32Array(p);key;constructor(e){this.key=e??C(32).toString("hex")}cities=["Springfield","Riverside","Fairview","Greenville","Franklin","Clinton","Madison","Georgetown","Arlington","Salem"];streets=["Main St","Oak Ave","Elm St","Park Dr","Cedar Ln","Pine Rd","Maple Way","Lake Blvd"];companies=["Acme Corp","Global Tech","Sunrise Inc","Horizon Ltd","Evergreen Co","Summit Group","Atlas Partners","Apex Solutions","Nova Industries","Pinnacle LLC"];getPersona(e){let t=this.personas.get(e);if(t)return t;let n=g(this.key,`persona:${e}`);for(let y=1;y<=$&&this.timesGiven[u(n)]>0;y++)n=g(this.key,`persona:${e}:${y}`);let{firstName:r,lastName:i}=B(n),a=u(n),o=this.timesGiven[a];this.timesGiven[a]=o+1;let l=this.cities[(n>>16)%this.cities.length],f={sourceRecordId:e,firstName:r,lastName:i,email:this.emailFor(r,i,o,e),phone:`+1-555-${String(n%900+100).padStart(3,"0")}-${String((n>>4)%9e3+1e3).padStart(4,"0")}`,address:`${n%999+1} ${this.streets[(n>>12)%this.streets.length]}`,city:l,postalCode:String(n%9e4+1e4),company:this.companies[(n>>20)%this.companies.length]};return this.personas.set(e,f),f}emailFor(e,t,n,r){let i=n>0?String(n+1):"",a=`${e.toLowerCase()}.${t.toLowerCase()}${i}`,o=(g(this.key,`email:${r}`)&65535).toString(16).padStart(4,"0");return`${a}.${o}@example.com`}namesGiven(){let e=Buffer.alloc(p*4);return this.timesGiven.forEach((t,n)=>e.writeUInt32LE(t,n*4)),P(e).toString("base64")}continueFrom(e){let t;try{t=A(Buffer.from(e,"base64"),{maxOutputLength:p*4})}catch{return!1}if(t.length!==p*4)return!1;for(let n=0;n<p;n++)this.timesGiven[n]+=t.readUInt32LE(n*4);return!0}get size(){return this.personas.size}clear(){this.personas.clear(),this.timesGiven.fill(0)}forgetRecords(){this.personas.clear()}},S=class{personaRegistry;hashSalt;constructor(e,t){this.hashSalt=t??C(32).toString("hex"),this.personaRegistry=e??new m(this.hashSalt)}getPersonaRegistry(){return this.personaRegistry}anonymize(e,t,n){let r=t.filter(i=>i.objectApiName===n);if(r.length===0)return e;for(let i of e){let a=String(i.Id??i.id??"");for(let o of r){let l=i[o.fieldApiName];l!=null&&(i[o.fieldApiName]=R.has(o.fieldType?.toLowerCase()??"")?null:this.applyMethod(o.method,String(l),o.fieldApiName,a,o.fieldType))}}return e}applyMethod(e,t,n,r,i){switch(e){case"fake":return this.applyFake(t,n,r,i);case"mask":return this.applyMask(t);case"hash":return this.applyHash(t);case"nullify":return null;case"redact":return"[REDACTED]";case"shuffle":return this.applyShuffle(t);case"truncate":return this.applyTruncate();case"preserve_format":return this.applyPreserveFormat(t);case"age_band":return this.applyAgeBand(t);case"generalize":return this.applyGeneralize(t,n);case"constant":return""}}applyFake(e,t,n,r){let i=this.personaRegistry.getPersona(n),a=N[t];if(a)return i[a];let o=c("sha256",this.hashSalt).update(`fake:${t}:${n}`).digest("hex");switch(r?.toLowerCase()){case"email":return`fake_${o.slice(0,8)}${k}`;case"phone":return`${M}${String(parseInt(o.slice(0,8),16)%1e4).padStart(4,"0")}`;default:return`fake_${o.slice(0,8)}`}}applyMask(e){return e.length<=4?"*".repeat(e.length):"*".repeat(e.length-4)+e.slice(-4)}applyHash(e){return c("sha256",this.hashSalt).update(e).digest("hex").slice(0,32)}applyShuffle(e){return E(e,this.hashSalt)}applyTruncate(){return""}applyPreserveFormat(e){let t=g(this.hashSalt,`preserve_format:${e}`);return e.split("").map(n=>(t=t*1664525+1013904223&2147483647,/[0-9]/.test(n)?String(t%10):/[A-Z]/.test(n)?String.fromCharCode(65+t%26):/[a-z]/.test(n)?String.fromCharCode(97+t%26):n)).join("")}applyAgeBand(e){let t=new Date(e);if(isNaN(t.getTime()))return"Unknown";let n=t.getFullYear(),r=Math.floor(n/10)*10;return`${r}-${r+9}`}applyGeneralize(e,t){if(e.includes("@")){let a=e.split("@");return`***@${a[a.length-1]}`}let n=(e.match(/\d/g)??[]).length;if(e.startsWith("+")||n>e.length/2)return e.slice(0,Math.min(3,e.length))+"-***";let r=t.toLowerCase();if(r.includes("street")||r.includes("address")||r.includes("city")||r.includes("state"))return e.split(/\s+/)[0]??e;let i=e.split(/\s+/);return i.length>1?`${i[0]} ...`:e.slice(0,Math.max(1,Math.ceil(e.length/2)))}};export{N as a,E as b,m as c,S as d};
|
|
@@ -4,7 +4,7 @@ import { dirname as __sandforgeDirname } from 'node:path';
|
|
|
4
4
|
const require = __sandforgeRequire(import.meta.url);
|
|
5
5
|
const __filename = __sandforgePath(import.meta.url);
|
|
6
6
|
const __dirname = __sandforgeDirname(__filename);
|
|
7
|
-
import{
|
|
7
|
+
import{H as p,d as u,k as d,z as h}from"./chunk-J24TIGSI.mjs";import{b as c}from"./chunk-CA5NAXSU.mjs";import{db as a}from"./chunk-ZQO5PDX5.mjs";import{randomBytes as E}from"node:crypto";import{open as k,readFile as b,rename as I,rm as T}from"node:fs/promises";import{dirname as l,join as m}from"node:path";var f="rewinds.ndjson",C=400,O=200;function P(e,n){return m(e,d(n),f)}function R(e){return m(l(e.dir),f)}async function y(e,n,t,i={maxLines:C,keptLines:O}){if(d(t.organizationId)!==n.organizationId)throw new p("invalid","A rewind is kept in its org\u2019s ledger, under its lock.");let r=a.safeParse(t);if(!r.success)throw new p("invalid","A line of the rewind ledger does not parse.");await h(l(e));let o=await w(e),x=o!==""&&!o.endsWith(`
|
|
8
8
|
`)?`
|
|
9
9
|
`:"",s=await k(e,"a",u);try{await s.writeFile(`${x}${JSON.stringify(r.data)}
|
|
10
10
|
`,"utf8"),await s.sync()}finally{await s.close()}L(o).length+1>i.maxLines&&await A(e,i.keptLines)}async function A(e,n){let t=L(await w(e)).slice(-n),i=`${e}.${process.pid}-${E(4).toString("hex")}.tmp`,r=await k(i,"wx",u);try{try{await r.writeFile(t.map(o=>`${o}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __sandforgeRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __sandforgePath } from 'node:url';
|
|
3
|
+
import { dirname as __sandforgeDirname } from 'node:path';
|
|
4
|
+
const require = __sandforgeRequire(import.meta.url);
|
|
5
|
+
const __filename = __sandforgePath(import.meta.url);
|
|
6
|
+
const __dirname = __sandforgeDirname(__filename);
|
|
7
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"./chunk-CBL42DUU.mjs";import"./chunk-MKTXJCXN.mjs";import"./chunk-GBGHJTPC.mjs";import"./chunk-YMDFF657.mjs";import"./chunk-YT22LMF7.mjs";import"./chunk-66NMFCWX.mjs";import"./chunk-XU25YA46.mjs";import"./chunk-VZT4E2OJ.mjs";import"./chunk-BOGNK4LV.mjs";import"./chunk-7SDZR6SR.mjs";import"./chunk-54HYHHVL.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-SAMWHL22.mjs";import"./chunk-6KP6WETK.mjs";import"./chunk-4JKR4PTZ.mjs";import"./chunk-J24TIGSI.mjs";import"./chunk-VPDEJGPS.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-JQZTMFO7.mjs";import"./chunk-JFNLKHY6.mjs";import"./chunk-VZVICK7Q.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-7PY3VQP3.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-HFUDCNU5.mjs";import"./chunk-XZISAZA6.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-L4INJ5TZ.mjs";import"./chunk-KIMQQ6JQ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-ZUTUYBNW.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-PR74GYVI.mjs";import"./chunk-TMA34QMA.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{h as REWIND_MUTING_STEP_WORDS,g as REWIND_STEP_WORDS,i as acceptanceRefusal,j as boundsRefusal,k as boundsRefusals,e as firedCount,m as notConfirmedRefusal,a as objectsWrittenBy,b as previewTotals,f as remakeUnasked,d as rewindStepsOf,c as selectionDiff,l as undeletableUnattendedRefusal};
|
|
@@ -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 c}from"./chunk-
|
|
7
|
+
import{a as c}from"./chunk-6VSZNZHH.mjs";import{Zd as a,_d as b}from"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{c as ConditionalRouter,a as conditionDefect,b as evaluateCondition};
|
|
@@ -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}from"./chunk-C2N2TNEU.mjs";import"./chunk-YAJQS3OL.mjs";import"./chunk-Z42PHCVZ.mjs";import"./chunk-H4OBZIX3.mjs";import"./chunk-V3R45ZWT.mjs";import"./chunk-NWOI25WY.mjs";import"./chunk-FQGHL7GR.mjs";import"./chunk-JKT5YAQ2.mjs";import"./chunk-3SKLBRPL.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as DX_PROJECT_FILE,b as scenarioProjectOf,c as writeRunTestFile};
|
|
@@ -0,0 +1,13 @@
|
|
|
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{o as ne}from"./chunk-4JKR4PTZ.mjs";import{H as v,d as z,l as oe,m as se,n as ie}from"./chunk-J24TIGSI.mjs";import{E as J,x as Be}from"./chunk-XZISAZA6.mjs";import{c as Pe}from"./chunk-EADHKH3A.mjs";import{h as Oe}from"./chunk-TZE3Y7IQ.mjs";import{b as L}from"./chunk-CA5NAXSU.mjs";import{a as re}from"./chunk-ZUTUYBNW.mjs";import{Hc as I}from"./chunk-ZQO5PDX5.mjs";import{b as N,e as ee,f as ke,i as te,k as Q,l as D,s as xe}from"./chunk-WZQEK4WT.mjs";var rt="encryptedstring";async function nt(o){try{let[e]=await o("SELECT PermissionsViewEncryptedData FROM UserPermissionAccess");return e?.PermissionsViewEncryptedData===!0}catch{return!1}}function lr(o){let e;return()=>(e??=nt(o),e)}function ur(o,e){let r=new Map;return t=>{let n=r.get(t);return n||(n=(async()=>{let s;try{s=(await e(t)).fields.filter(i=>i.type===rt).map(i=>i.name)}catch{return[]}return s.length>0&&!await o()?s:[]})(),r.set(t,n)),n}}var _=5,ce=25,de=3;function mr(o){return{get version(){return o.version},request:async e=>await o.request(e),query:async(e,r)=>await o.query(e,{scanAll:r?.scanAll===!0}),queryMore:async e=>await o.queryMore(e)}}var j=class extends Error{constructor(){super("The read was stopped."),this.name="OrgReadStopped"}},st="PROCESSING_HALTED",Ce="If-Modified-Since",it=/^\d{1,3}\.\d$/,at=/^\/services\/data\/v\d{1,3}\.\d\/query(?:All)?\/[A-Za-z0-9-]+$/,ct=D({records:Q(xe(N(),te())),done:ke(),totalSize:ee().optional(),nextRecordsUrl:N().optional()}).loose(),dt=D({compositeResponse:Q(D({body:te(),httpStatusCode:ee(),referenceId:N()}).loose())}),lt=Q(D({errorCode:N().optional(),message:N().optional()}).loose());function ut(o,e,r){if(!it.test(o))throw new Error(`Not an API version: ${o}`);if(e.length>_)throw new Error(`A composite runs ${_} queries, not ${e.length}`);if(e.length+r.length>ce)throw new Error(`A composite holds ${ce} subrequests, not ${e.length+r.length}`);let t=`/services/data/v${o}`;return{allOrNone:!1,compositeRequest:[...e.map((n,s)=>({method:"GET",url:n.kind==="first"?`${t}/${n.scanAll?"queryAll":"query"}?q=${encodeURIComponent(n.soql)}`:n.path,referenceId:`q${s}`})),...r.map(({path:n,headers:s},a)=>({method:"GET",url:`${t}/${n}`,referenceId:`d${a}`,...s?{httpHeaders:s}:{}}))]}}function ft(o){let e=dt.safeParse(o);if(!e.success)return;let r=new Map;for(let t of e.data.compositeResponse){if(t.httpStatusCode<400){r.set(t.referenceId,{ok:!0,status:t.httpStatusCode,body:t.body});continue}let n=lt.safeParse(t.body),s=n.success?n.data[0]:void 0;r.set(t.referenceId,{ok:!1,refused:s?[s.errorCode,s.message].filter(Boolean).join(": "):`status ${t.httpStatusCode}`,halted:s?.errorCode===st})}return r}function ae(o){let e=ct.safeParse(o);return e.success?e.data:void 0}function ht(o){return typeof o=="object"&&o!==null&&typeof o.errorCode=="string"}function pt(o){let e=/^https:\/\//i.test(o)?new URL(o).pathname:o;if(!at.test(e))throw new Error(`Not the next page of a query: ${o}`);return e}function wr(o,e){let r=new Set,t=[],n=_,s="composite",a=0,i=!1,c=!1,d=0,p=0,f=!1,m=()=>{for(let u of r)u.state==="pending"&&(u.state="idle",u.settle?.reject(new j));for(let u of t.splice(0))u.settle.reject(new j)},A=()=>{c||(c=!0,queueMicrotask(()=>{c=!1,B()}))},h=(u,w)=>{u.state="idle";let y=u.settle;u.ask=void 0,u.settle=void 0,w instanceof Error?y?.reject(w):y?.resolve(w)},l=async(u,w)=>{let y=ut(o.version,u.map(E=>E.ask),w),g;p++;try{g=await o.request({method:"POST",url:"/composite",body:JSON.stringify(y),headers:{"Content-Type":"application/json"}})}catch(E){if(ht(E)){s="single";for(let R of u)R.state="pending";t.unshift(...w);return}let x=new Error(L(E));for(let R of u)h(R,x);for(let R of w)R.settle.reject(x);return}let k=ft(g);if(!k){s="single";for(let E of u)E.state="pending";t.unshift(...w);return}let P=0;if(u.forEach((E,x)=>{let R=k.get(`q${x}`);if(R&&!R.ok&&R.halted){P++,E.state="pending";return}if(!R){h(E,new Error("The org gave no answer to this query of the composite"));return}if(!R.ok){h(E,new Error(R.refused));return}let tt=ae(R.body);h(E,tt??new Error(`The org answered a query with status ${R.status} and no page`))}),P>0){let E=u.length-P;E===0?s="single":n=Math.min(n,E)}w.forEach((E,x)=>{let R=k.get(`d${x}`);R?R.ok?E.settle.resolve(R.status===304?{notModified:!0}:{body:R.body}):E.settle.reject(new Error(R.refused)):E.settle.reject(new Error("The org gave no answer to this describe of the composite"))})},b=async(u,w)=>{for(let y of u){let g=y.ask;p++;try{let k=g.kind==="first"?await o.query(g.soql,{scanAll:g.scanAll}):await o.queryMore(g.path);h(y,ae(k)??new Error("The org answered a query with no page"))}catch(k){h(y,new Error(L(k)))}}for(let y of w){p++;try{let g=await o.request({method:"GET",url:`/services/data/v${o.version}/${y.path}`,...y.headers?{headers:y.headers}:{}}),k=y.headers?.[Ce]!==void 0&&(g==null||g==="");y.settle.resolve(k?{notModified:!0}:{body:g})}catch(g){y.settle.reject(new Error(L(g)))}}},S=async(u,w,y)=>{try{s==="composite"?await l(u,w):await b(u,w)}catch(g){let k=new Error(L(g));for(let P of u)P.state==="sent"&&h(P,k);for(let P of w)P.settle.reject(k)}finally{a--,y||(i=!1),A(),Se()}},B=()=>{if(e?.aborted){m();return}for(;;){if(i)return;let u=[...r],w=u.filter(x=>x.state==="pending").sort((x,R)=>x.order-R.order);if(!(w.length>0&&!u.some(x=>x.state==="idle"))&&t.length===0)return;let g=w.slice(0,n),k=ce-g.length,P=s==="composite"&&t.length===0&&g.length>0&&g.every(x=>x.oneRow&&x.ask?.kind==="first");if(a>=(P?de:1))return;let E=t.splice(0,k);if(g.length===0&&E.length===0)return;for(let x of g)x.state="sent";a++,P||(i=!0),S(g,E,P)}},O=()=>{f=!1,A()},Y=()=>{f||e===void 0||e.aborted||(e.addEventListener("abort",O,{once:!0}),f=!0)},Se=()=>{!f||a>0||r.size>0||t.length>0||(e?.removeEventListener("abort",O),f=!1)},Re=(u,w)=>r.has(u)?u.state!=="idle"?Promise.reject(new Error("A read asks one page at a time.")):e?.aborted?Promise.reject(new j):new Promise((y,g)=>{u.ask=w,u.settle={resolve:y,reject:g},u.state="pending",u.order=++d,A()}):Promise.reject(new Error("This read is closed."));return{lane(u){let w={state:"idle",order:0,oneRow:u?.oneRow===!0};return r.add(w),Y(),{query:(y,g)=>Re(w,{kind:"first",soql:y,scanAll:g?.scanAll===!0}),queryMore:y=>{let g;try{g=pt(y)}catch(k){return Promise.reject(k instanceof Error?k:new Error(String(k)))}return Re(w,{kind:"next",path:g})},close(){r.delete(w)&&(w.state==="pending"&&h(w,new Error("This read is closed.")),A(),Se())}}},describe(u,w){return e?.aborted?Promise.reject(new j):new Promise((y,g)=>{let k=I(u),P;if(w!==void 0){let E=Date.parse(w);if(!Number.isFinite(E))throw new Error(`Not a date: ${w}`);P={[Ce]:new Date(E).toUTCString()}}Y(),t.push({path:`sobjects/${k}/describe`,...P?{headers:P}:{},settle:{resolve:y,reject:g}}),A()})},async tooling(u){if(e?.aborted)throw new j;p++;let w;try{w=await o.request({method:"GET",url:`/services/data/v${o.version}/tooling/query?q=${encodeURIComponent(u)}`})}catch(g){throw new Error(L(g))}let y=ae(w);if(!y)throw new Error("The org answered a Tooling API query with no page");return y},calls:()=>p}}import{createReadStream as mt}from"node:fs";import{appendFile as wt,stat as gt,writeFile as yt}from"node:fs/promises";import{StringDecoder as bt}from"node:string_decoder";import{promisify as je}from"node:util";import{createGunzip as At,gunzip as Et,gzip as St}from"node:zlib";var Rt=je(St),kt=je(Et),xt=64*1024,Ot=".gz",Pt=6,M=10,Ie=4,ve=Buffer.from("SF","latin1"),ue=8,H=6+ue,fe=M+H,he=fe+2+8;function $(o){return`${o}${Ot}`}async function Bt(o){let e=await Rt(o,{level:Pt});if(e[3]!==0)throw new Error("zlib wrote a gzip header with flags set");let r=Buffer.from(e.subarray(0,M));r[3]=Ie;let t=Buffer.alloc(H);return t.writeUInt16LE(H-2,0),ve.copy(t,2),t.writeUInt16LE(ue,4),t.writeUInt32LE(e.length+H,6),t.writeUInt32LE(o.length,10),Buffer.concat([r,t,e.subarray(M)])}function Me(o){if(o.length<fe||o[0]!==31||o[1]!==139||o[2]!==8||o[3]!==Ie||o.readUInt16LE(M)!==H-2||!o.subarray(M+2,M+4).equals(ve)||o.readUInt16LE(M+4)!==ue)return;let e=o.readUInt32LE(M+6),r=o.readUInt32LE(M+10);return e>=he&&r>0?{total:e,raw:r}:void 0}function Ct(o,e=xt){let r=[],t=0,n=0;for(;n<o.length;){let s=o.indexOf(10,n),a=s<0?o.length:s+1;a-t>e&&n>t&&(r.push(o.subarray(t,n)),t=n),n=a,n-t>=e&&(r.push(o.subarray(t,n)),t=n)}return n>t&&r.push(o.subarray(t,n)),r}async function Ne(o){let e=Ct(Buffer.from(o,"utf8"));return Buffer.concat(await Promise.all(e.map(r=>Bt(r))))}function U(o){return o.endsWith(".ndjson")}function kr(o){let e=new Map,r=(t,n)=>{let s=n(e.get(t)??Promise.resolve());return e.set(t,s),s.then(()=>{e.get(t)===s&&e.delete(t)},()=>{}),s};return{...o,writeFile:(t,n)=>{if(!U(t))return o.writeFile(t,n);let s=$(t);return r(s,a=>a.catch(()=>{}).then(async()=>{let i=n===""?Buffer.alloc(0):await Ne(n);await yt(s,i,{mode:z})}))},appendFile:(t,n)=>{if(!U(t))return o.appendFile(t,n);let s=$(t);return r(s,a=>a.then(async()=>{n!==""&&await wt(s,await Ne(n),{mode:z})}))},exists:t=>o.exists(U(t)?$(t):t),rm:t=>o.rm(U(t)?$(t):t),readLines:t=>U(t)?Nt($(t)):o.readLines(t)}}async function*Nt(o){if((await gt(o)).size===0)return;let e=mt(o),r=At(),t=a=>{r.destroy(a)};e.on("error",t),e.pipe(r);let n=new bt("utf8"),s="";try{for await(let a of r){let i=(s+n.write(a)).split(`
|
|
8
|
+
`);s=i.pop()??"",yield*i}s+=n.end(),s!==""&&(yield s)}finally{e.off("error",t),e.destroy(),r.destroy()}}async function le(o,e,r){let t=Buffer.alloc(r),n=0;for(;n<r;){let{bytesRead:s}=await o.read(t,n,r-n,e+n);if(s===0)break;n+=s}return n===r?t:t.subarray(0,n)}async function De(o,e,r,t){let n;try{n=await kt(o,{maxOutputLength:e.raw})}catch{throw t(`holds a block that does not inflate at byte ${r}`)}if(n.length!==e.raw)throw t(`holds a block at byte ${r} that inflates to other than its header says`);return n}async function Le(o,e,r,t){let n=await le(o,e,r);if(n.length<r)throw t(`is cut short at byte ${e+n.length}`);let s=Me(n);if(s===void 0)throw t(`holds no block where its index says, at byte ${e}`);if(s.total!==r)throw t(`holds another block than its index says at byte ${e}`);return De(n,s,e,t)}async function*$e(o,e,r){for(let t=0;t<e;){let n=Me(await le(o,t,Math.min(fe,e-t)));if(n===void 0)throw r(`holds no block at byte ${t}`);if(n.total>e-t)throw r(`is cut short: its block at byte ${t} ends past the file's end`);let s=await le(o,t,n.total);yield{at:t,total:n.total,lines:await De(s,n,t,r)},t+=n.total}}function*Te(o){let e=0;for(;e<o.length;){let r=o.indexOf(10,e),t=r<0?o.length:r;yield{at:e,length:t-e},e=t+1}}import{randomBytes as jt}from"node:crypto";import{open as W,readFile as we,rename as It,rm as vt,stat as Mt}from"node:fs/promises";import{dirname as Ge,join as Dt}from"node:path";var Fe=2e3,C=15,pe=C,T=pe+8,ge={format:1,head:Buffer.from("SFCKIDX1","latin1"),lengthAt:T+8,rowBytes:T+8+4},We={format:2,head:Buffer.from("SFCKIDX2","latin1"),memberBytesAt:T+8,lineAt:T+12,lengthAt:T+16,rowBytes:T+20},Ye={1:ge,2:We},G=ge.head.length,ze=1<<20,Lt=500,F=/^[A-Za-z0-9]{15}(?:[A-Za-z0-9]{3})?$/,$t=/^[A-Za-z0-9]{15}$/,ye=/^[A-Za-z][A-Za-z0-9_]*$/;function Mr(o,e){return G+o*Ye[e].rowBytes}function _e(o){return o.replace(/[^A-Za-z0-9_-]/g,"_")}function Qe(o,e,r){if(!ye.test(r)||r.length>80)throw new v("invalid","Not a Salesforce API name");return Dt(o.dir,"backups",`${_e(e)}__${_e(r)}.ndjson`)}var Z=class{constructor(e,r){this.layout=e;this.rowBytes=e.rowBytes,this.bytes=r??Buffer.alloc(this.rowBytes*1024),this.size=r?r.length/this.rowBytes:0}layout;bytes;rowBytes;size;push(e,r,t){let n=this.size*this.rowBytes;if(n+this.rowBytes>this.bytes.length){let c=Buffer.alloc(Math.max(this.bytes.length*2,this.rowBytes*1024));this.bytes.copy(c,0,0,n),this.bytes=c}let{memberBytesAt:s,lineAt:a,lengthAt:i}=this.layout;return this.bytes.write(e,n,C,"latin1"),this.bytes.writeDoubleLE(r,n+pe),this.bytes.writeDoubleLE(t.offset,n+T),s!==void 0&&this.bytes.writeUInt32LE(t.memberBytes??0,n+s),a!==void 0&&this.bytes.writeUInt32LE(t.line??0,n+a),this.bytes.writeUInt32LE(t.length,n+i),this.size++}keyAt(e){let r=e*this.rowBytes;return this.bytes.toString("latin1",r,r+C)}holds(e,r){let t=e*this.rowBytes;for(let n=0;n<C;n++)if(this.bytes[t+n]!==r.charCodeAt(n))return!1;return!0}stampAt(e){return this.bytes.readDoubleLE(e*this.rowBytes+pe)}offsetAt(e){return this.bytes.readDoubleLE(e*this.rowBytes+T)}memberBytesAt(e){let r=this.layout.memberBytesAt;return r===void 0?0:this.bytes.readUInt32LE(e*this.rowBytes+r)}lineAt(e){let r=this.layout.lineAt;return r===void 0?0:this.bytes.readUInt32LE(e*this.rowBytes+r)}lengthAt(e){return this.bytes.readUInt32LE(e*this.rowBytes+this.layout.lengthAt)}before(e,r){return this.offsetAt(e)-this.offsetAt(r)||this.lineAt(e)-this.lineAt(r)}wellFormed(e){let r=this.stampAt(e),t=this.offsetAt(e);return $t.test(this.keyAt(e))&&Number.isFinite(r)&&Number.isSafeInteger(t)&&t>=0&&this.lengthAt(e)>0&&(this.layout.format===1||this.memberBytesAt(e)>=he)}written(){return this.bytes.subarray(0,this.size*this.rowBytes)}},X=class{constructor(e,r){this.rows=e;let t=1024;for(;t<r*2;)t*=2;this.slots=new Uint32Array(t)}rows;slots;used=0;find(e){let r=this.slots.length-1;for(let t=ne(e)&r;;t=t+1&r){let n=this.slots[t];if(n===0)return-1;if(this.rows.holds(n-1,e))return n-1}}add(e){let r=this.rows.keyAt(e),t=this.find(r);return t>=0?t:((this.used+1)*2>this.slots.length&&this.grow(),this.place(e,r),this.used++,-1)}place(e,r){let t=this.slots.length-1,n=ne(r)&t;for(;this.slots[n]!==0;)n=n+1&t;this.slots[n]=e+1}grow(){let e=this.slots;this.slots=new Uint32Array(e.length*2);for(let r of e)r!==0&&this.place(r-1,this.rows.keyAt(r-1))}};async function V(o,e){try{return await W(o,"r")}catch(r){throw r.code!=="ENOENT"?r:new v("damaged",`The checkpoint\u2019s snapshot of ${e} is not on this machine.`)}}async function*Je(o,e){let r=await V(o,e);try{let t=Buffer.alloc(ze),n=Buffer.alloc(0),s=0,a=0,i=0;for(;;){let{bytesRead:c}=await r.read(t,0,ze,a);if(c===0)break;a+=c;let d=n.length>0?Buffer.concat([n,t.subarray(0,c)]):t.subarray(0,c),p=0;for(let f=d.indexOf(10);f>=0;f=d.indexOf(10,p))i++,f>p&&(yield{number:i,offset:s+p,length:f-p,text:d.toString("utf8",p,f)}),p=f+1;n=Buffer.from(d.subarray(p)),s+=p}n.length>0&&(yield{number:i+1,offset:s,length:n.length,text:n.toString("utf8")})}finally{await r.close()}}async function*Tt(o,e,r){let t=await V(o,e);try{let n=0;for await(let s of $e(t,(await t.stat()).size,r))for(let a of Te(s.lines))n++,a.length!==0&&(yield{number:n,offset:s.at,memberBytes:s.total,line:a.at,length:a.length,text:s.lines.toString("utf8",a.at,a.at+a.length)})}finally{await t.close()}}async function Ft(o){try{return await Mt(o),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}function Ke(o){let e=J(o);return e===null?Number.NaN:Date.parse(e)}function K(o){let e;try{e=JSON.parse(o)}catch{return}return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0}async function zt(o,e){let r=`${o}.${process.pid}-${jt(4).toString("hex")}.tmp`,t=await W(r,"wx",z);try{try{await t.writeFile(e),await t.sync()}finally{await t.close()}await It(r,o)}catch(n){throw await vt(r,{force:!0}),n}}async function Dr(o,e,r){let t=Qe(o,e,r),n=$(t),s=await Ft(n)?2:1,a=oe(o,r),i=new Z(Ye[s]),c=new X(i,0),d=(m,A)=>new v("damaged",`The snapshot of ${r} holds ${A} at line ${m} of its file: it cannot be indexed.`),p=s===2?Tt(n,r,m=>new v("damaged",`The snapshot of ${r} ${m}: it cannot be indexed.`)):Je(t,r);for await(let m of p){let A=K(m.text);if(!A)throw d(m.number,"no record");let h=A.Id;if(typeof h!="string"||!F.test(h))throw d(m.number,"a record without its Id");let l=Ke(A.SystemModstamp);if(!Number.isFinite(l))throw d(m.number,`record ${h} without its SystemModstamp`);let b=i.push(h.slice(0,C),l,m);if(c.add(b)>=0)throw d(m.number,`record ${h} a second time`)}let f=Buffer.concat([i.layout.head,i.written()]);return await zt(a,f),{rows:i.size,bytes:f.length}}var _t=D({objectApiName:N().regex(ye).max(80),from:N().regex(F),to:N().regex(F)});async function Ze(o){let e;try{e=await W(o,"r"),await e.sync()}catch{}finally{await e?.close().catch(()=>{})}}var me=class o{constructor(e,r){this.current=e;this.original=r}current;original;static none=new o(new Map,new Map);static of(e){let r=new Map;for(let{from:n,to:s}of e)r.set(n.slice(0,C),s);let t=new Map;for(let[n,s]of r)t.set(s.slice(0,C),n);return new o(r,t)}static async read(e){let r;try{r=await we(se(e),"utf8")}catch(s){if(s.code==="ENOENT")return o.none;throw s}let t=r.split(`
|
|
9
|
+
`).slice(0,-1),n=[];for(let[s,a]of t.entries()){if(a==="")continue;let i;try{i=JSON.parse(a)}catch{i=void 0}let c=_t.safeParse(i);if(!c.success)throw new v("damaged",`The checkpoint\u2019s list of the records a rewind made again is damaged at line ${s+1}.`);n.push(c.data)}return o.of(n)}static async add(e,r){if(r.length===0)return;let t=se(e),n=r.map(({objectApiName:i,from:c,to:d})=>`${JSON.stringify({objectApiName:i,from:c,to:d})}
|
|
10
|
+
`).join(""),s=await W(t,"a",z),a=!1;try{a=(await s.stat()).size===0,await s.appendFile(n,"utf8"),await s.sync()}finally{await s.close()}a&&await Ze(Ge(t))}get empty(){return this.current.size===0}currentOf(e){return this.current.get(e)}originalOf(e){return this.original.get(e)}retired(e){return typeof e=="string"&&F.test(e)&&this.current.has(e.slice(0,C))}remapped(e){return typeof e!="string"||!F.test(e)?e:this.current.get(e.slice(0,C))??e}rowAsNow(e){if(this.empty)return e;let r={...e};for(let[t,n]of Object.entries(e)){if(t==="attributes")continue;let s=this.remapped(n);s!==n&&(r[t]=s)}return r}},qt=D({objectApiName:N().regex(ye).max(80),id:N().regex(F)}),qe=class o{constructor(e){this.held=e}held;static none=new o(new Set);static async read(e){let r;try{r=await we(ie(e),"utf8")}catch(n){if(n.code==="ENOENT")return o.none;throw n}let t=new Set;for(let n of r.split(`
|
|
11
|
+
`)){if(n==="")continue;let s;try{s=JSON.parse(n)}catch{continue}let a=qt.safeParse(s);a.success&&t.add(a.data.id.slice(0,C))}return new o(t)}static async add(e,r,t){if(t.length===0)return;let n=ie(e),s=t.map(c=>`${JSON.stringify({objectApiName:r,id:c})}
|
|
12
|
+
`).join(""),a=await W(n,"a",z),i=!1;try{i=(await a.stat()).size===0,await a.appendFile(s,"utf8"),await a.sync()}finally{await a.close()}i&&await Ze(Ge(n))}has(e){return this.held.has(e.slice(0,C))}keys(){return this.held.values()}},Ue=class o{constructor(e,r,t,n,s,a,i){this.objectApiName=e;this.snapshotId=r;this.snapshotFile=t;this.rows=n;this.byKey=s;this.recreated=a;this.extent=i}objectApiName;snapshotId;snapshotFile;rows;byKey;recreated;extent;static async read(e,r,t,n){let s=oe(e,t),a=h=>new v("damaged",`The checkpoint\u2019s index of ${t} ${h}.`),i;try{i=await we(s)}catch(h){throw h.code==="ENOENT"?a("is not on this machine"):h}let c=[ge,We].find(({head:h})=>i.length>=G&&i.subarray(0,G).equals(h));if(c===void 0||(i.length-G)%c.rowBytes!==0)throw a("is not an index of its snapshot");let d=Qe(e,r,t),p=c.format===2?$(d):d,f=new Z(c,i.subarray(G)),m=new X(f,f.size),A=0;for(let h=0;h<f.size;h++){if(!f.wellFormed(h))throw a(`is damaged at row ${h+1}`);if(m.add(h)>=0)throw a(`holds record ${f.keyAt(h)} twice`);c.format===2&&(A=Math.max(A,f.offsetAt(h)+f.memberBytesAt(h)))}return new o(t,r,p,f,m,n??await me.read(e),A)}get format(){return this.rows.layout.format}get size(){return this.rows.size}rowOf(e){if(typeof e!="string"||!F.test(e))return-1;let r=e.slice(0,C),t=this.recreated.originalOf(r);return t!==void 0?this.byKey.find(t):this.recreated.retired(e)?-1:this.byKey.find(r)}retired(e){return this.recreated.retired(e)&&this.byKey.find(String(e).slice(0,C))>=0}snapshotIdOf(e){let r=this.rowOf(e);if(r<0)return e;let t=this.rows.keyAt(r);return re(t)??t}has(e){return this.rowOf(e)>=0}stampOf(e){let r=this.rowOf(e);return r<0?void 0:this.rows.stampAt(r)}idAt(e){let r=this.rows.keyAt(e);return this.recreated.currentOf(r)??re(r)??r}chunk(e){if(e.length>Fe)throw new RangeError(`A chunk of the snapshot reads ${Fe} records at most; ${e.length} were asked.`);let r=new Set;for(let n of e){let s=this.rowOf(n);s>=0&&r.add(s)}let t=[...r].sort((n,s)=>this.rows.before(n,s));return{batches:async(n,s,a)=>{if(n!==this.snapshotId||s!==this.objectApiName)return null;let i=a>=1?Math.floor(a):1;return{[Symbol.asyncIterator]:()=>this.rowsAt(t,i)}}}}async*records(){if(this.size===0)return;if(this.format===2){let r=function*(t){for(let n=0;n<t;n++)yield n};for await(let t of this.compressedRowsAt(r(this.size),Lt))yield*t;return}let e=0;for await(let r of Je(this.snapshotFile,this.objectApiName)){let t=K(r.text);if(e>=this.size)throw this.moreThanIndexed();if(!t||!this.isRowOf(e,t))throw this.notWhereIndexed(e);yield this.recreated.rowAsNow(t),e++}if(e<this.size)throw this.notWhereIndexed(e)}notWhereIndexed(e){return new v("damaged",`The checkpoint\u2019s snapshot of ${this.objectApiName} does not hold record ${this.idAt(e)} where its index says: the file changed since the checkpoint was taken.`)}moreThanIndexed(){return new v("damaged",`The checkpoint\u2019s snapshot of ${this.objectApiName} holds more records than its index: the file changed since the checkpoint was taken.`)}async*rowsAt(e,r){if(e.length===0)return;if(this.format===2){yield*this.compressedRowsAt(e,r);return}let t=await V(this.snapshotFile,this.objectApiName);try{let n=Buffer.alloc(0),s=[];for(let a of e){let i=this.rows.lengthAt(a),c=this.rows.offsetAt(a);n.length<i&&(n=Buffer.alloc(Math.max(i,n.length*2)));let d=0;for(;d<i;){let{bytesRead:f}=await t.read(n,d,i-d,c+d);if(f===0)break;d+=f}let p=d===i?K(n.toString("utf8",0,i)):void 0;if(!p||!this.isRowOf(a,p))throw this.notWhereIndexed(a);s.push(this.recreated.rowAsNow(p)),s.length===r&&(yield s,s=[])}s.length>0&&(yield s)}finally{await t.close()}}async*compressedRowsAt(e,r){let t=s=>new v("damaged",`The checkpoint\u2019s snapshot of ${this.objectApiName} ${s}: the file changed since the checkpoint was taken.`),n=await V(this.snapshotFile,this.objectApiName);try{let s=(await n.stat()).size;if(s!==this.extent)throw t(`takes ${s} bytes where its index says ${this.extent}`);let a=-1,i=0,c=Buffer.alloc(0),d=[];for(let p of e){let f=this.rows.offsetAt(p);(f!==a||this.rows.memberBytesAt(p)!==i)&&(i=this.rows.memberBytesAt(p),c=await Le(n,f,i,t),a=f);let m=this.rows.lineAt(p),A=m+this.rows.lengthAt(p),l=A<=c.length&&(m===0||c[m-1]===10)&&(A===c.length||c[A]===10)?K(c.toString("utf8",m,A)):void 0;if(!l||!this.isRowOf(p,l))throw this.notWhereIndexed(p);d.push(this.recreated.rowAsNow(l)),d.length===r&&(yield d,d=[])}d.length>0&&(yield d)}finally{await n.close()}}isRowOf(e,r){let t=r.Id;return typeof t=="string"&&F.test(t)&&this.rows.holds(e,t.slice(0,C))&&Ke(r.SystemModstamp)===this.rows.stampAt(e)}},He=class{constructor(e){this.index=e;this.marked=new Uint8Array(Math.ceil(e.size/8))}index;marked;found=0;mark(e){let r=this.index.rowOf(e);if(r<0)return!1;let t=1<<(r&7),n=r>>>3;return(this.marked[n]&t)===0&&(this.marked[n]|=t,this.found++),!0}get count(){return this.index.size-this.found}*ids(){for(let e=0;e<this.index.size;e++)(this.marked[e>>>3]&1<<(e&7))===0&&(yield this.index.idAt(e))}};import{createReadStream as Ut}from"node:fs";import{appendFile as Ht,mkdir as Gt,rm as Wt,writeFile as Yt}from"node:fs/promises";import*as q from"node:path";import{createInterface as Qt}from"node:readline";var Jt="The org stopped answering before it said the read was done: some of its records were not read.",Xe=384,Kt=448;function Ve(o){let e=typeof o=="number"?o:Date.parse(o);if(!Number.isFinite(e))throw new Error(`Not a date: ${String(o)}`);let r=e-(e%1e3+1e3)%1e3;return new Date(r).toISOString().replace(/\.\d{3}Z$/,"Z")}function be(o){let e=Date.parse(o);if(!Number.isFinite(e))throw new Error(`Not a date: ${o}`);return Ve(e-Be)}function et(o,e){return[...new Set([...o,...e.map(Oe)])].join(", ")}function Ae(o,e,r,t){let n=I(o),s=[t,e==="scanAllLive"?"IsDeleted = false":void 0].filter(a=>a!==void 0);return{objectApiName:n,soql:`SELECT ${r} FROM ${n}${s.length>0?` WHERE ${s.join(" AND ")}`:""}`,scanAll:e==="scanAllLive"}}function Zt(o){let e=I(o);return{objectApiName:e,soql:`SELECT SystemModstamp FROM ${e} ORDER BY SystemModstamp DESC LIMIT 1`,scanAll:!0}}var Xt=["Id","SystemModstamp","CreatedDate","LastModifiedDate","LastModifiedById"],Vt=["Id","SystemModstamp","CreatedDate"];function er(o,e,r,t=[]){return Ae(o,e,et(Xt,t),`SystemModstamp >= ${be(r)}`)}function tr(o,e,r=[]){let t=I(o);return{objectApiName:t,soql:`SELECT ${et(Vt,r)} FROM ${t} WHERE IsDeleted = true AND SystemModstamp >= ${be(e)}`,scanAll:!0}}function rr(o,e){return Ae(o,e,"COUNT()")}function Wr(o,e){let r=I(o);return{objectApiName:r,soql:`SELECT Id FROM ${r} WHERE IsDeleted = true AND SystemModstamp < ${Ve(e)}`,scanAll:!0}}function Yr(o,e){return Ae(o,e,"Id")}async function nr(o,e,r){let t,n,s={query:async i=>{let c=await o.query(i,{scanAll:e.scanAll});return t=c,n=c.totalSize,c},queryMore:async i=>(t=await o.queryMore(i),t)},a=0;try{for await(let i of Pe(s,e.soql))await r(i),a+=i.length}catch(i){if(i instanceof j)throw i;return{objectApiName:e.objectApiName,read:!1,rows:a,reason:L(i)}}return t?.done!==!0?{objectApiName:e.objectApiName,read:!1,rows:a,reason:Jt}:{objectApiName:e.objectApiName,read:!0,rows:a,...n!==void 0?{totalSize:n}:{}}}async function Ee(o,e,r,t,n={}){let s=n.oneRow===!0,a=new Array(e.length),i=async m=>{let A=e.slice(m,m+_),h=A.map(()=>o.lane({oneRow:s})),l=await Promise.allSettled(A.map(async(b,S)=>{let B=h[S];try{return await nr(B,b,O=>r(m+S,O))}finally{B.close()}}));for(let[b,S]of l.entries()){if(S.status==="rejected")throw S.reason instanceof Error?S.reason:new Error(String(S.reason));a[m+b]=S.value}},c=0,d=async()=>{for(;c<e.length;){if(t?.aborted)throw new j;let m=c;c+=_,await i(m)}},p=Math.ceil(e.length/_),f=await Promise.allSettled(Array.from({length:Math.min(s?de:1,p)},d));for(let m of f)if(m.status==="rejected")throw m.reason instanceof Error?m.reason:new Error(String(m.reason));if(t?.aborted)throw new j;return a}function or(o){return`${JSON.stringify(Object.fromEntries(Object.entries(o).filter(([e])=>e!=="attributes")))}
|
|
13
|
+
`}async function sr(o,e,r){for(let n of e)await Gt(q.dirname(n.file),{recursive:!0,mode:Kt}),await Yt(n.file,"",{encoding:"utf8",mode:Xe});let t=await Ee(o,e,async(n,s)=>{s.length!==0&&await Ht(e[n].file,s.map(or).join(""),{encoding:"utf8",mode:Xe})},r);return await Promise.all(t.map((n,s)=>n.read?void 0:Wt(e[s].file,{force:!0}))),t}async function*Qr(o){let e=Ut(o,{encoding:"utf8"}),r=Qt({input:e,crlfDelay:1/0});try{for await(let t of r){if(t==="")continue;let n=JSON.parse(t);if(typeof n!="object"||n===null||Array.isArray(n))throw new Error(`${q.basename(o)} holds a line that is no record.`);yield n}}finally{r.close(),e.destroy()}}async function ir(o,e,r,t){let n=Date.parse(be(r)),s=[];return(await Ee(o,e.map(Zt),(i,c)=>{c.length>0&&(s[i]=c[0].SystemModstamp)},t,{oneRow:!0})).map((i,c)=>{if(!i.read)return{objectApiName:i.objectApiName,unread:i.reason};if(s[c]===void 0)return{objectApiName:i.objectApiName,latest:null,moved:!1};let d=J(s[c]);return d===null?{objectApiName:i.objectApiName,unread:`${i.objectApiName} answered a SystemModstamp that is not a date.`}:{objectApiName:i.objectApiName,latest:d,moved:Date.parse(d)>=n}})}async function ar(o,e,r){return(await Ee(o,e.map(({objectApiName:n,readMode:s})=>rr(n,s)),()=>{},r,{oneRow:!0})).map(n=>n.read?n.totalSize===void 0?{objectApiName:n.objectApiName,unread:"The org gave no count of its records."}:{objectApiName:n.objectApiName,count:n.totalSize}:{objectApiName:n.objectApiName,unread:n.reason})}function cr(o,e){return q.join(o,`${I(e)}.live.ndjson`)}function dr(o,e){return q.join(o,`${I(e)}.deleted.ndjson`)}async function Jr(o,e,r,t,n,s){if(s!==void 0&&s.length!==e.length)throw new Error(`${s.length} pre-checks for ${e.length} objects`);let a=s??await ir(o,e.map(({objectApiName:l})=>l),r,n),i=new Map,c=[];a.forEach((l,b)=>{"unread"in l?i.set(b,l.unread):l.moved&&c.push(b)});let d=c.flatMap(l=>{let{objectApiName:b,readMode:S,fields:B=[]}=e[l],O=I(b);return[{...er(O,S,r,B),file:cr(t,O)},{...tr(O,r,B),file:dr(t,O)}]}),p=await sr(o,d,n),f=new Map;c.forEach((l,b)=>{let S=p[b*2],B=p[b*2+1],O=[S,B].find(Y=>!Y.read);if(O&&!O.read){i.set(l,O.reason);return}f.set(l,{live:{file:d[b*2].file,rows:S.rows},deleted:{file:d[b*2+1].file,rows:B.rows}})});let m=e.map((l,b)=>({object:l,index:b})).filter(({object:l,index:b})=>!i.has(b)&&(f.has(b)||l.held)).map(({index:l})=>l),A=await ar(o,m.map(l=>e[l]),n),h=new Map;return m.forEach((l,b)=>{let S=A[b];"unread"in S?i.set(l,S.unread):h.set(l,S.count)}),a.map((l,b)=>{if("unread"in l)return l;let S=i.get(b);if(S!==void 0)return{objectApiName:l.objectApiName,unread:S};let B=f.get(b),O=h.get(b);return{objectApiName:l.objectApiName,latest:l.latest,moved:l.moved,...B?.live?{live:B.live}:{},...B?.deleted?{deleted:B.deleted}:{},...O!==void 0?{count:O}:{}}})}export{rt as a,nt as b,lr as c,ur as d,_ as e,ce as f,de as g,mr as h,j as i,wr as j,kr as k,Fe as l,Mr as m,Qe as n,Dr as o,me as p,qe as q,Ue as r,He as s,Ve as t,be as u,rr as v,Wr as w,Yr as x,nr as y,Ee as z,sr as A,Qr as B,ir as C,ar as D,cr as E,dr as F,Jr as G};
|
|
@@ -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 v}from"./chunk-SRPWW4A2.mjs";import"./chunk-4TLYUZD5.mjs";import{
|
|
7
|
+
import{a as v}from"./chunk-SRPWW4A2.mjs";import"./chunk-4TLYUZD5.mjs";import{Xb as D}from"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";function x(e){return{async retrieve(n){return{id:(await e.metadata.retrieve(n)).id}},checkRetrieveStatus:n=>e.metadata.checkRetrieveStatus(n),async deploy(n,t){return{id:(await e.metadata.deploy(n,t)).id}},checkDeployStatus:(n,t)=>e.metadata.checkDeployStatus(n,t)}}var N={pollMs:3e3,retrieveTimeoutMs:D.retrieve*6e4,deployTimeoutMs:D.deploy*6e4,sleep:e=>new Promise(n=>setTimeout(n,e)),now:Date.now},b=class extends Error{constructor(t,o,s,a){super(t==="deployment"?`Deployment ${o} was still ${s} after ${a} min; it goes on in the target org, and Setup \u203A Deployment Status follows it.`:`Retrieval ${o} was still ${s} after ${a} min; nothing was deployed.`);this.kind=t;this.asyncId=o;this.status=s;this.name="DeploymentStillRunning"}kind;asyncId;status};function d(e,n){return`${e}\0${k(n)}`}function k(e){try{return decodeURIComponent(e)}catch{return e}}function g(e){return e==null?[]:Array.isArray(e)?e:[e]}function R(e){return e===!0||e==="true"}function h(e){if(e==null||e==="")return;let n=Number(e);return Number.isFinite(n)?n:void 0}var P=/^Entity of type '(.+?)' named '(.+)' cannot be found$/;async function M(e,n,t,o){let s=new Map;for(let{componentType:i,fullName:m}of t)s.set(i,[...s.get(i)??[],m]);let a={apiVersion:Number(n),singlePackage:!0,unpackaged:{objectPermissions:[],types:[...s].map(([i,m])=>({members:m,name:i})),version:n}},{id:p}=await e.retrieve(a),u=o.now();for(;;){let i=await e.checkRetrieveStatus(p);if(i.done){if(i.success===!1||i.status==="Failed")throw new Error(`Retrieval ${p} from the source failed: ${i.errorMessage??i.status??"no reason given"}`);return i}if(o.now()-u>=o.retrieveTimeoutMs)throw new b("retrieval",p,i.status??"running",Math.round(o.retrieveTimeoutMs/6e4));await o.sleep(o.pollMs)}}async function I(e,n,t,o={}){let s=o.waiting??N;o.onProgress?.({step:"retrieve",done:0,total:t.length});let a=await M(e,n,t,s),p=new Map(t.map(l=>[d(l.componentType,l.fullName),l])),u=new Map,i=[];for(let l of g(a.messages)){let f=l.problem??"",T=P.exec(f),y=T?p.get(d(T[1],T[2])):void 0;y?u.set(d(y.componentType,y.fullName),{...y,problem:f}):f&&i.push(l.fileName?`${l.fileName}: ${f}`:f)}let m=t.filter(l=>!u.has(d(l.componentType,l.fullName))),r=a;m.length===0?r={...a,zipFile:""}:u.size>0&&(r=await M(e,n,m,s)),o.onProgress?.({step:"retrieve",done:m.length,total:t.length});let c=g(r.fileProperties).filter(l=>v(l)).map(l=>p.get(d(l.type??"",l.fullName??""))).filter(l=>l!==void 0);return{zipFile:r.zipFile??"",retrieved:m,missing:[...u.values()],managed:c,problems:i}}function A(e,n,t){return{allowMissingFiles:!1,autoUpdatePackage:!1,checkOnly:e,ignoreWarnings:!1,performRetrieve:!1,purgeOnDelete:!1,rollbackOnError:!0,...n==="RunSpecifiedTests"?{runTests:[...t]}:{},singlePackage:!0,testLevel:n}}async function E(e,n,t,o={}){let s=o.waiting??N,{id:a}=await e.deploy(n,t),p=s.now();for(;;){let u=await e.checkDeployStatus(a,!1);if(u.done)return e.checkDeployStatus(a,!0);if(o.onProgress?.(w(u)),s.now()-p>=s.deployTimeoutMs)throw new b("deployment",a,u.status??"running",Math.round(s.deployTimeoutMs/6e4));await s.sleep(s.pollMs)}}function w(e){let n=e.numberTestsTotal??0,t=e.numberComponentsTotal??0,o=(e.numberComponentsDeployed??0)+(e.numberComponentErrors??0);return n>0&&o>=t?{step:"tests",done:(e.numberTestsCompleted??0)+(e.numberTestErrors??0),total:n}:{step:"components",done:o,total:t}}function C(e){let n=/line (\d+), column \d+/.exec(e??"");return n?Number(n[1]):void 0}function O(e){let n=h(e.lineNumber),t=h(e.columnNumber),o=e.problemType==="Warning"||e.problemType==="Error"?e.problemType:void 0,s={componentType:e.componentType??"",fullName:e.fullName??"",...e.fileName?{fileName:e.fileName}:{}};if(!R(e.success))return{...s,outcome:"failed",...e.problem?{problem:e.problem}:{},...o?{problemType:o}:{},...n!==void 0?{line:n}:{},...t!==void 0?{column:t}:{}};let a=R(e.created)?"created":R(e.changed)?"changed":"unchanged";return{...s,outcome:a}}function $(e,n,t){let o=e?.details??void 0,s=new Map,a=[...g(o?.componentFailures),...g(o?.componentSuccesses)];for(let r of a){if(!r.componentType&&r.fullName==="package.xml")continue;let c=O(r),l=d(c.componentType,c.fullName);s.has(l)||s.set(l,c)}let p=n.missing.map(r=>({componentType:r.componentType,fullName:r.fullName,outcome:"not_retrieved",...r.problem?{problem:r.problem}:{}})),u=o?.runTestResult??void 0,i=g(u?.failures).map(r=>{let c=C(r.stackTrace);return{className:r.name??"",...r.methodName?{methodName:r.methodName}:{},message:r.message??"",...r.stackTrace?{stackTrace:r.stackTrace}:{},...c!==void 0?{line:c}:{}}}),m=g(u?.codeCoverageWarnings).map(r=>r.name?`${r.name}: ${r.message??""}`:r.message??"").filter(r=>r!=="");return{...e?.id?{deployId:e.id}:{},checkOnly:t.checkOnly,status:e?.status??"NotStarted",success:e?.success===!0&&n.missing.length===0,...e?.errorMessage?{errorMessage:e.errorMessage}:{},sourceOrgId:t.sourceOrgId,targetOrgId:t.targetOrgId,testLevel:t.testLevel,runTests:[...t.runTests],components:[...s.values(),...p],counts:{componentsTotal:e?.numberComponentsTotal??0,componentsDeployed:e?.numberComponentsDeployed??0,componentErrors:e?.numberComponentErrors??0,testsTotal:e?.numberTestsTotal??0,testsCompleted:e?.numberTestsCompleted??0,testErrors:e?.numberTestErrors??0},testFailures:i,coverageWarnings:m,...n.problems.length>0?{retrieveProblems:[...n.problems]}:{},...e?.startDate?{startedAt:e.startDate}:{},...e?.completedDate?{completedAt:e.completedDate}:{}}}export{N as DEFAULT_WAITING,b as DeploymentStillRunning,A as deployOptions,E as deployPackage,$ as deploymentReport,x as metadataApiOf,I as retrieveComponents};
|
|
@@ -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}from"./chunk-
|
|
7
|
+
import{a,b}from"./chunk-7EYQYZJP.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as seedObjectAccess,b as templateTheOrgTakes};
|
|
@@ -4,4 +4,4 @@ import { dirname as __sandforgeDirname } from 'node:path';
|
|
|
4
4
|
const require = __sandforgeRequire(import.meta.url);
|
|
5
5
|
const __filename = __sandforgePath(import.meta.url);
|
|
6
6
|
const __dirname = __sandforgeDirname(__filename);
|
|
7
|
-
import{a,b,c,d,e}from"./chunk-
|
|
7
|
+
import{a,b,c,d,e}from"./chunk-PR74GYVI.mjs";import"./chunk-TMA34QMA.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as FieldMappingService,b as MOVES_ITS_SOURCE,e as mapFields,c as mappedTargets,d as notSentAsRead};
|