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,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 E}from"./chunk-
|
|
7
|
+
import{i as E}from"./chunk-MKTXJCXN.mjs";import{b as j,c as S,e as U,m as O,n as P,o as C}from"./chunk-VZT4E2OJ.mjs";import{h as B}from"./chunk-L4INJ5TZ.mjs";import{da as N}from"./chunk-KIMQQ6JQ.mjs";import{Ad as A,Id as y}from"./chunk-ZQO5PDX5.mjs";var h="No record was written.",l=e=>e.toLocaleString("en-US"),D=e=>e.toDelete.createdSince+e.toDelete.broughtBackSince+e.toDelete.comesBackWithParent,$=e=>e.toBringBack.inBin+e.toBringBack.withParent+e.toBringBack.deletedWhileTaken,k=e=>e.toRecreate??0,v=e=>e.toBringBack.carriers??0;function L(e){let n=t=>D(t)+t.toGiveBack.records+$(t)+v(t)+k(t)>0,o=e.objects.filter(n).map(t=>t.objectApiName),a=e.files;return a!==void 0&&a.unlink+a.relink+a.updateLinks>0&&o.push(B),o}function M(e){return e.objects.reduce((n,o)=>({toDelete:n.toDelete+D(o),toGiveBack:n.toGiveBack+o.toGiveBack.records,toBringBack:n.toBringBack+$(o),toRecreate:n.toRecreate+k(o)}),{toDelete:0,toGiveBack:0,toBringBack:0,toRecreate:0})}function te(e,n){let o=new Set(n.objects),a=new Map(n.acts.map(i=>[i.objectApiName,i]));return{...E(e,o),objects:e.objects.filter(i=>o.has(i.objectApiName)||a.has(i.objectApiName)).map(i=>{let s=a.get(i.objectApiName),r=o.has(i.objectApiName);return{...i,toDelete:{createdSince:s?.toDelete??0,broughtBackSince:0,comesBackWithParent:0},toGiveBack:{...i.toGiveBack,records:s?.toGiveBack??0},toBringBack:{inBin:s?.toBringBack??0,withParent:0,deletedWhileTaken:0,...r&&i.toBringBack.carriers!==void 0?{carriers:i.toBringBack.carriers}:{}},toRecreate:s?.toRecreate??0,cannotUndo:r?i.cannotUndo:[],unexplained:r?i.unexplained:0}}),undoCannot:[...n.undoCannot]}}function W(e){let n=e.objects.filter(t=>D(t)+v(t)>0).map(t=>t.objectApiName),o=e.files,a=(t,i)=>i>0?[...t,B]:t;return{bringBack:e.objects.filter(t=>$(t)+v(t)>0).map(t=>t.objectApiName),recreate:a(e.objects.filter(t=>k(t)>0).map(t=>t.objectApiName),o?.relink??0),giveBack:a(e.objects.filter(t=>j(t)+U(t)>0).map(t=>t.objectApiName),o?.updateLinks??0),setToDraft:e.objects.filter(t=>S(t)>0).map(t=>t.objectApiName),delete:a(n,o?.unlink??0)}}function z(e){return new Set(e.map(n=>`${n.objectApiName}
|
|
8
8
|
${n.kind}
|
|
9
9
|
${n.name}`)).size}function ne(e,n,o,a=!1){let t=(c,f)=>(c??[]).includes(f),i=o.filter(c=>!t(n.recreate,c)),s=o.filter(c=>N[c]!==void 0&&!t(n.giveBack,c)),r=new Set(e.objectsRead),d=[...i,...s];return{fired:y(e,{recreate:i,giveBack:s}),blind:d.length>0&&(!a&&A(e.unread)||d.some(c=>!r.has(c)))}}var T={limit:e=>`this step's limit of ${l(e)}`,mutes:!1,lift:{acceptAutomation:"turn on muteAutomation in the step for what a bypass keeps quiet, or acceptAutomation to let it run, and confirm it again to rewind all the same",acceptEmails:"turn on acceptEmails in the step and confirm it again to rewind all the same",acceptNoUndo:"turn on acceptNoUndo in the step and confirm it again to rewind all the same",acceptRecreate:"turn on acceptRecreate in the step and confirm it again to rewind all the same",acceptUnseen:"turn on acceptUnseen in the step and confirm it again to rewind all the same",maxRecords:"preview the rewind, then raise the step's maxRecords to what it rewinds and confirm it again",refuseWhenActive:"run it once they are done, or turn off refuseWhenActive in the step and confirm it again"}},oe={...T,lift:{...T.lift,acceptAutomation:"turn on acceptAutomation in the step to let what no bypass keeps quiet run, and confirm it again to rewind all the same"}},H=[{reason:"onlyWithParent",words:"Salesforce undeletes them only with their parent, which stays"},{reason:"deletedBeforeParent",words:"deleted before a record they point at, which the rewind deletes next, Salesforce cannot bring them back after that"}],Y="Add --accept-emails to rewind all the same";function q(e,n,o,a,t){let{automation:i,deliverability:s}=n;if(!i||!s)return;let r=W(n.diff),{refusal:d}=C({act:"rewind",orgName:e,automation:i,steps:r,accepted:o.acceptEmails===!0,mayMute:t,...P({automation:i,steps:r}),reading:s.reading});if(!d)return;let c=a.acceptEmails;return{...d,message:d.message.replace(Y,`${c.charAt(0).toUpperCase()}${c.slice(1)}`)}}function ie(e,n,o,a,t="the user SandForge connects as",i=!1){return _(e,n,o,a,t,i)[0]}function _(e,n,o,a,t="the user SandForge connects as",i=!1){let s=[],{diff:r,automation:d}=n;if(r.undoCannot.length>0&&!o.acceptNoUndo){let u=H.flatMap(({reason:w,words:g})=>{let R=r.undoCannot.filter(b=>(b.reason??"onlyWithParent")===w);if(R.length===0)return[];let F=R.reduce((b,G)=>b+G.count,0),I=[...new Set(R.map(b=>b.objectApiName))].join(", ");return[`Undo couldn't bring back ${l(F)} ${I} record(s) this rewind deletes: ${g}.`]});s.push({code:"NO_UNDO",message:`${u.join(" ")} Rewind refused; ${a.acceptNoUndo}. ${h}`})}let c=r.objects.filter(u=>k(u)>0);if(c.length>0&&!o.acceptRecreate){let u=c.reduce((w,g)=>w+k(g),0);s.push({code:"RECREATE",message:`${l(u)} ${c.map(w=>w.objectApiName).join(", ")} record(s) deleted since are no longer in the recycle bin, or Salesforce keeps them there for good: this rewind makes them again from the checkpoint, with new Ids. Anything outside Salesforce that names their old Ids \u2014 an integration, a link, a report filter \u2014 no longer finds them. Rewind refused; ${a.acceptRecreate}. ${h}`})}let f=r.unseen??[];if(f.length>0&&o.acceptUnseen!==!0){let u=f.map(({objectApiName:w,children:g,records:R})=>`Deleting ${l(R)} ${w} record(s) created since also deletes what ${t} can't see under them in ${g.join(", ")}: Rewind can't count those.`);s.push({code:"UNSEEN",message:`${u.join(" ")} Rewind refused; ${a.acceptUnseen}. ${h}`})}if(!d)return s;let m=K(e,n,o,a),p=q(e,n,o,a,i);return[...s,...m?[m]:[],...p?[p]:[]]}function K(e,n,o,a){let{diff:t,automation:i,emailsUncounted:s}=n;if(!i||o.acceptAutomation)return;let r=W(t),d=y(i,r);if(d.length===0&&!A(i.unread)&&s===void 0)return;let c=[...new Set(d.map(u=>u.objectApiName))],f=(r.recreate??[]).some(u=>u!==B)?"makes them again, ":"",m=d.length>0?`${z(d)} flow(s), trigger(s) or rule(s) of ${c.join(", ")} run as the rewind brings records back, ${f}gives them their values back or deletes them`:"what runs as the rewind writes could not all be read, so automation may run",p=s!==void 0?`The emails it sends as the rewind writes were not counted against its daily limits, as what sends them was not read (${s}). `:"";return{code:"AUTOMATION",message:`${e}: ${m}. ${p}Rewind refused; ${a.acceptAutomation}. `+h}}var x=e=>e.slice(0,15);async function ae(e){return(await J(e))[0]}async function J(e){let{orgName:n,preview:o,bounds:a,words:t}=e,{diff:i}=o;if(L(i).length===0)return[];let s=[],r=M(i),d=r.toDelete+r.toGiveBack+r.toBringBack+r.toRecreate;if(a.maxRecords!==void 0&&d>a.maxRecords){let f=[`${l(r.toDelete)} to delete`,`${l(r.toGiveBack)} to give back`,`${l(r.toBringBack)} to bring back`,...r.toRecreate>0?[`${l(r.toRecreate)} to make again`]:[]];s.push({code:"TOO_MANY_TO_REWIND",message:`The rewind of ${n} would rewind ${l(d)} records (${f.join(", ")}), past ${t.limit(a.maxRecords)}. Rewind refused; ${t.lift.maxRecords}. `+h})}if(a.refuseWhenActive&&i.activeLastHour.length>0){let f=new Set((await e.writers()).map(x)),m=new Set(i.activeLastHour.map(x).filter(p=>!f.has(p)));if(m.size>0){let p=m.size===1?"1 person":`${l(m.size)} people`;s.push({code:"PEOPLE_ACTIVE",message:`${p} other than the user the rewind writes as changed records of the checkpoint's objects in ${n} in the hour before the rewind read it: it would take their work back. Rewind refused; ${t.lift.refuseWhenActive}. `+h})}}let c=O("rewind",o.emails??[],n);return[...s,..._(n,o,e.accepted,t.lift,e.user,t.mutes),...c?[c]:[]]}function re(e,n,o){let a=n.map(t=>`${t.objectApiName} (${l(t.records)})`).join(", ");return{code:"UNDELETABLE_UNATTENDED",message:`The user SandForge connects to ${e} as may not delete the ${a} record(s) this rewind deletes. With nobody to ask whether to delete the rest, the deletion was left untouched. Give the user Delete on those objects, or rewind from the Checkpoints page, which asks. `+(o?"What the rewind's first pass wrote stays: its result says what, and Undo takes it back.":h)}}function se(e,n){return{code:"NOT_CONFIRMED",message:`Rewind step "${e}" has `+(n?"not been confirmed since it was changed":"never been confirmed")+": open it and type the org's alias, or, for an org that has none, its name or Organization Id. "+h}}export{L as a,M as b,te as c,W as d,z as e,ne as f,T as g,oe as h,ie as i,ae as j,J as k,re as l,se as m};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __sandforgeRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __sandforgePath } from 'node:url';
|
|
3
|
+
import { dirname as __sandforgeDirname } from 'node:path';
|
|
4
|
+
const require = __sandforgeRequire(import.meta.url);
|
|
5
|
+
const __filename = __sandforgePath(import.meta.url);
|
|
6
|
+
const __dirname = __sandforgeDirname(__filename);
|
|
7
|
+
import{$a as q,$b as qa,Ab as R,Ac as Ra,Bb as S,Bc as Sa,Cb as T,Cc as Ta,Db as U,Dc as Ua,Eb as V,Ec as Va,Fb as W,Fc as Wa,Gb as X,Gc as Xa,Hb as Y,Hc as Ya,Ib as Z,Ic as Za,Jb as _,Jc as _a,Kb as $,La as a,Lb as aa,Ma as b,Mb as ba,Na as c,Nb as ca,Oa as d,Ob as da,Pa as e,Pb as ea,Qa as f,Qb as fa,Ra as g,Rb as ga,Sa as h,Sb as ha,Ta as i,Tb as ia,Ua as j,Ub as ja,Va as k,Vb as ka,Wa as l,Wb as la,Xa as m,Xb as ma,Ya as n,Yb as na,Za as o,Zb as oa,_a as p,_b as pa,ab as r,ac as ra,bb as s,bc as sa,cb as t,cc as ta,db as u,dc as ua,eb as v,ec as va,fb as w,fc as wa,gb as x,gc as xa,hb as y,hc as ya,ib as z,ic as za,jb as A,jc as Aa,kb as B,kc as Ba,lb as C,lc as Ca,mb as D,mc as Da,nb as E,nc as Ea,ob as F,oc as Fa,pb as G,pc as Ga,qb as H,qc as Ha,rb as I,rc as Ia,sb as J,sc as Ja,tb as K,tc as Ka,ub as L,uc as La,vb as M,vc as Ma,wb as N,wc as Na,xb as O,xc as Oa,yb as P,yc as Pa,zb as Q,zc as Qa}from"./chunk-JFNLKHY6.mjs";import"./chunk-VZVICK7Q.mjs";import"./chunk-7PY3VQP3.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-HFUDCNU5.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.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-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{v as API_BUDGET_EXCEEDED,r as API_BUDGET_NEAR_SHARE,o as API_REQUESTS_NOT_TOLD,I as BULK_BATCHES_NOT_TOLD,y as CHECKPOINT_REFUSED,B as CHECKPOINT_STOPPED_WORDS,a as DEFAULT_CONFIRM_ABOVE_RECORDS,b as DEFAULT_MAX_TOTAL,W as DELIVERABILITY_READ_MOST,fa as DEVELOPER_EDITION_SINGLE_EMAILS,ta as EMAILS_NOT_ACCEPTED,Oa as ForgeRunGateError,j as LastSimulations,Ma as OWNER_MAP_INACTIVE,Na as OWNER_MAP_UNKNOWN,c as READ_CEILING_PER_OBJECT,Z as SAMPLE_CANNOT_FIT,aa as SAMPLE_PLAN_GONE,$ as SAMPLE_PLAN_MISMATCH,Y as SAMPLE_STORAGE_UNREAD,_ as SAMPLE_TOO_LARGE,e as STORAGE_NEAR_SHARE,F as WHOLE_ORG_SOURCE_READS_PER_OBJECT,E as WHOLE_ORG_TARGET_READS_PER_OBJECT,ga as alertsCountAsSingle,u as apiBudgetCheckOf,w as apiBudgetRefusal,R as automationBytesOf,va as automationReadRequests,Wa as automationRefusal,La as automationUnreadOf,J as bulkBatchesRefusal,Va as bypassAssistantSentences,Ka as bypassesToAssign,z as checkpointPartOf,A as checkpointScopeStop,x as confirmationApiOf,l as confirmationSimulatedOf,Ca as confirmationStorageOf,ka as countedEmailChecksOf,g as countedStorageBytes,la as countedTargetEmails,Ba as deliverabilityAfterLeaseStop,ya as deliverabilityGate,xa as deliverabilityLineOf,wa as deliverabilityPartOf,sa as emailCheckLines,ja as emailChecksOf,ra as emailRefusal,ia as emailsCountedPerRecord,qa as emailsOfLimit,na as emailsUncountedOf,k as farPastTheSimulation,L as fileStorageRefusal,Qa as filesRefusalStop,Fa as firedOnInsertOf,Ga as firedOnUpdateOf,G as forgeRequestPartsOf,i as forgeVolumeCaseKey,P as forgeWriteBudgetOf,D as forgeWritesOf,Da as formatMB,Ea as formatMBPast,ma as insertsOf,Pa as isForgeRunGateError,Ta as leftOutLines,d as objectsAboveReadCeiling,Ha as objectsUpdatedAfterInsert,oa as overEmailOf,U as personalFieldsAsIsOf,m as pricesForLinesOf,q as readApiBudget,M as readBoundRefusal,N as readBoundStopOf,p as readDataStorage,ea as readEmailLimits,Ya as removalAutomationLines,Xa as removalAutomationRefusal,Ua as removalRiskLines,Za as removalStepsAutomationLines,_a as removalStepsAutomationRefusal,n as rolesMayBeOf,f as rowStorageBytes,Ja as runBypassesOf,s as runRequestsEstimate,t as runRequestsTotal,da as sampleGateErrorOf,ca as sampleGateStopOf,ba as sampleStorageUnreadStopOf,za as sendersOfNothingWritten,Aa as sendersOfNothingWrittenLine,ua as sendersUnreadOf,ha as singleCountAsWorkflow,K as sourceApiBudgetRefusal,Q as storageCheckOf,Ra as storageRefusal,S as storageTakesWords,C as takeCheckpointFirst,pa as unreadEmailOf,Ia as updateStepsOf,H as wholeOrgCostOf,X as wholeOrgDryRunOf,O as wholeOrgFilesOf,V as wholeOrgLeftOutOf,T as wholeOrgWritePlanOf,Sa as writePlanLines,h as writePlanOf};
|
|
@@ -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{h as a,i as b,j as c,k as d,l as e}from"./chunk-Y4TDVDP2.mjs";import"./chunk-JJITOWZK.mjs";import"./chunk-UV74P4H2.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-J24TIGSI.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-ZUTUYBNW.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as REPLAY_RECORD_FILE,c as ReplayStore,b as defaultReplayStoreRoot,d as replaysInPlace,e as replaysInPlaceWords};
|
|
@@ -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}from"./chunk-DBBPDSFN.mjs";import"./chunk-GBGHJTPC.mjs";import"./chunk-ZUOPC4W2.mjs";import"./chunk-PPGDAUEQ.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-L4INJ5TZ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as grantsByObject,b as guardCheckpoint};
|
|
@@ -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-JKT5YAQ2.mjs";import"./chunk-3SKLBRPL.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{b as SEED_RUNS_DIR,a as SEED_RUNS_KEPT,e as SeedRunCreations,d as nodeSeedRunCreations,c as seedRunKept};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __sandforgeRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __sandforgePath } from 'node:url';
|
|
3
|
+
import { dirname as __sandforgeDirname } from 'node:path';
|
|
4
|
+
const require = __sandforgeRequire(import.meta.url);
|
|
5
|
+
const __filename = __sandforgePath(import.meta.url);
|
|
6
|
+
const __dirname = __sandforgeDirname(__filename);
|
|
7
|
+
import{a as P,b as $}from"./chunk-GBGHJTPC.mjs";import{a as O,b,d as E,e as D}from"./chunk-ZUOPC4W2.mjs";import{b as S}from"./chunk-CA5NAXSU.mjs";import{A as m,Nc as R}from"./chunk-ZQO5PDX5.mjs";var y=[{field:"PermissionsViewAllData",label:"View All Data"},{field:"PermissionsModifyAllData",label:"Modify All Data"}],I="PermissionsQueryAllFiles",T="PermissionsCustomizeApplication",d="No record was read or written.";function c(e,t){return{allowed:!1,refusal:{code:e,message:t}}}function w(e,t){return c("PRODUCTION",`${e} is a production org, or cannot be told from one: ${t}. Checkpoints are for sandboxes, scratch orgs and Developer Edition orgs: SandForge never takes a checkpoint of, or rewinds, a production org. ${d}`)}function N(e){return e.edition?`its Organization record says IsSandbox false, edition ${e.edition}`:"its Organization record says IsSandbox false, and no edition"}function j(e,t){return e.slice(0,15)===t.slice(0,15)}function V(e,t){return e.orgType==="Scratch"?"scratch":t.sandbox?"sandbox":"developer"}var z={take:"A checkpoint needs a user with View All Data and Modify All Data: a rewind to it must",preview:"A preview needs a user with View All Data and Modify All Data: a record the user cannot see would read as deleted since, and the rewind it shows must",rewind:"Rewind needs a user with View All Data and Modify All Data: it must",undo:"Undo needs a user with View All Data and Modify All Data: it must",import:"An import needs a user with View All Data and Modify All Data: SandForge never keeps on this machine records its user could not see in the org, and a rewind to it must"},F={take:"Leave the custom settings out of the checkpoint, or give the user Customize Application.",preview:"This checkpoint holds custom settings: give the user Customize Application.",rewind:"This checkpoint holds custom settings: give the user Customize Application.",undo:"This checkpoint holds custom settings: give the user Customize Application.",import:"This checkpoint holds custom settings: give the user Customize Application."};function x(e){return c("PERMISSIONS",`${e.username} needs Customize Application to keep and rewind custom settings, and doesn't have it: View All Custom Settings lets a user read them, never write them. ${F[e.act]} ${d}`)}async function _(e,t){let r=[...y.map(n=>n.field),...t?[T]:[]],i=async n=>(await e.query(`SELECT ${n.join(", ")} FROM UserPermissionAccess`)).records[0],o;try{o=await i([...r,I])}catch{try{o=await i(r)}catch(n){return{unread:n instanceof Error?n.message:String(n)}}}return{missing:y.filter(n=>o?.[n.field]!==!0).map(n=>n.label),viewAllData:o?.PermissionsViewAllData===!0,modifyAllData:o?.PermissionsModifyAllData===!0,queryAllFiles:o?.[I]===!0,customizeApplication:o?.[T]===!0}}var q=/^005[A-Za-z0-9]{12}(?:[A-Za-z0-9]{3})?$/,L=/^0PG[A-Za-z0-9]{12}(?:[A-Za-z0-9]{3})?$/,M="SobjectType, PermissionsViewAllRecords, PermissionsModifyAllRecords";async function A(e,t){let r=await e.query(t),i=1,o=[...r.records];for(;!r.done;){let n=r.nextRecordsUrl;if(n===void 0||e.queryMore===void 0)throw new Error(`the org answered ${o.length} rows of ${r.totalSize}, and no next page`);r=await e.queryMore(n),i++,o.push(...r.records)}return{rows:o,requests:i}}async function U(e,t){let r=0;try{let i=await t();if(r++,!q.test(i))throw new Error(`the org named the user ${JSON.stringify(i)}`);let o=await A(e,`SELECT ${M} FROM ObjectPermissions WHERE ParentId IN (SELECT PermissionSetId FROM PermissionSetAssignment WHERE AssigneeId = '${i}' AND PermissionSetGroupId = null)`);r+=o.requests;let n=await A(e,`SELECT PermissionSetGroupId FROM PermissionSetAssignment WHERE AssigneeId = '${i}' AND PermissionSetGroupId != null`);r+=n.requests;let l=[...new Set(n.rows.map(a=>a.PermissionSetGroupId).filter(a=>typeof a=="string"&&L.test(a)))],s=[...o.rows];if(l.length>0){let a=await A(e,`SELECT ${M} FROM ObjectPermissions WHERE Parent.PermissionSetGroupId IN (${l.map(u=>`'${u}'`).join(", ")})`);r+=a.requests,s.push(...a.rows)}return{grants:P(s),requests:r}}catch(i){return{unread:S(i)}}}var v={take:"A checkpoint needs a user with View All Data and Modify All Data, or with View All and Modify All on each object it holds: a rewind to it must see and put back what everyone changed there.",preview:"A preview needs a user with View All Data and Modify All Data, or with View All and Modify All on each object it reads: a record the user cannot see would read as deleted since.",rewind:"Rewind needs a user with View All Data and Modify All Data, or with View All and Modify All on each object it puts back: it must see and put back what everyone changed there.",undo:"Undo needs a user with View All Data and Modify All Data, or with View All and Modify All on each object it takes back: it must see and put back what everyone changed there."};async function Y(e,t,r={}){let{orgName:i,registered:o}=t;if(o===void 0)return w(i,"SandForge has no record of what kind of org it is");if(!R(o))return w(i,"SandForge has it registered as a production org");let n;try{n=await O(e)}catch(p){let C=E(p);if(C!==void 0)return c("ORG_UNTYPED",`${D(i,p,C)} SandForge takes a checkpoint of no org it cannot tell from a production one. ${d}`);let G=p instanceof Error?p.message:String(p);return w(i,`it did not say what org it is (${G})`)}if(b(n))return w(i,N(n));if(t.act!=="take"&&!j(n.id,t.organizationId))return c("OTHER_ORG",t.act==="import"?`${i} is another org than the one this file holds a checkpoint of: it is imported for the org it was taken of alone, under any alias of it. ${m} Replay the file in ${i} instead. Nothing was imported.`:`${i} is another org than the one this checkpoint was taken of: its Organization Id has changed, as a sandbox's does when it is refreshed. This checkpoint is of the org before it, and no longer rewinds. ${m} `+d);let l=t.customSettings===!0,s=await _(e,l),a=`${z[t.act]} see and put back what everyone changed.`;if("unread"in s)return c("PERMISSIONS",`${a} SandForge could not read whether ${t.username} has them (${s.unread}), and takes an org that will not say for a user who has neither. `+d);let u=s.missing.length===y.length?"them":s.missing.join(" and "),g=t.act,f=g==="import"?void 0:r.userId;if(s.missing.length>0&&f===void 0)return c("PERMISSIONS",`${a} ${t.username} doesn't have ${u}. ${d}`);if(l&&!s.customizeApplication)return x(t);let k={allowed:!0,org:n,tier:V(o,n),queryAllFiles:s.queryAllFiles};if(s.missing.length===0||f===void 0||g==="import")return{...k,grants:{kind:"org"}};let h=await U(e,f);return"unread"in h?c("PERMISSIONS",`${v[g]} ${t.username} doesn't have ${u}, and SandForge could not read which objects they have View All and Modify All on (${h.unread}). View Setup and Configuration lets a user read their own permissions; with View All Data and Modify All Data, nothing needs reading. `+d):$(h.grants)?{...k,grants:{kind:"perObject",viewAllData:s.viewAllData,modifyAllData:s.modifyAllData,objects:h.grants,requests:h.requests}}:c("PERMISSIONS",`${v[g]} ${t.username} doesn't have ${u}, nor View All and Modify All on any object. Give the user View All and Modify All on the objects to hold, or View All Data and Modify All Data. ${d}`)}export{U as a,Y as b};
|
|
@@ -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{$ as g,Aa as H,Ba as I,Ca as J,Da as K,Ea as L,Fa as M,Ga as N,Ha as O,Ia as P,Ja as Q,Ka as R,V as a,W as b,X as c,Y as d,Z as e,_ as f,aa as h,ba as i,ca as j,da as k,ea as l,fa as m,ga as n,ha as o,ia as p,ja as q,ka as r,la as s,ma as t,na as u,oa as v,pa as w,qa as x,ra as y,sa as z,ta as A,ua as B,va as C,wa as D,xa as E,ya as F,za as G}from"./chunk-JFNLKHY6.mjs";import"./chunk-VZVICK7Q.mjs";import"./chunk-7PY3VQP3.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-HFUDCNU5.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.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-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{m as ASSIGNMENT_RULES_SOQL,h as AUTOMATION_READ_MOST,b as CONDITIONS_BOUND,f as CONDITION_REQUESTS_BOUND,c as DEFINITIONS_BOUND,g as DEFINITION_REQUESTS_BOUND,n as DUPLICATE_RULES_SOQL,i as FLOWS_SOQL,k as PROCESSES_SOQL,d as TOOLING_QUERIES_PER_REQUEST,e as TOOLING_RETRIEVES_PER_REQUEST,j as TRIGGERS_SOQL,N as TargetAutomationReader,o as USER_PERMISSIONS_SOQL,l as WORKFLOW_RULES_SOQL,a as answerOf,R as automationLines,p as conditionSoql,z as customObjectIdsSoql,Q as customPermissionsByIdSoql,A as customPermissionsSoql,G as decisionChecks,F as fieldsRequiredFilled,L as inFlight,H as messagesOf,M as objectsTheRunWrites,I as pathsOf,J as permissionKey,C as permissionSetSizesSoql,B as permissionSetsHoldingSoql,D as permissionsNamed,y as processObjectsSoql,O as readBypassGrants,w as readInComposites,x as ruleDefinitionSoql,P as setCustomPermissionsSoql,E as switchesNamed,v as targetAutomationQueries,s as toolingAnswersOf,q as toolingCompositeBody,t as toolingRecordsOf,r as toolingRetrieveBody,u as toolingRetrievesOver,K as unreadPartOf};
|
|
@@ -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{l as a,m as b,n as c,o as d,p as e,q as f}from"./chunk-YAIIRFKJ.mjs";import"./chunk-Q3DY7TO2.mjs";import"./chunk-3XG25GTF.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-54HYHHVL.mjs";import"./chunk-M6P5ZZLE.mjs";import"./chunk-WSUKC2U3.mjs";import"./chunk-6KP6WETK.mjs";import"./chunk-4JKR4PTZ.mjs";import"./chunk-J24TIGSI.mjs";import"./chunk-PPGDAUEQ.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-7PY3VQP3.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-HFUDCNU5.mjs";import"./chunk-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-TUACWKIH.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as WHOLE_ORG_MAX_NODES,b as WHOLE_ORG_MAX_PAIRS,f as discoverWholeOrg,d as eachInPool,e as recordCountsOf,c as refusedByTheOrg};
|
|
@@ -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}from"./chunk-
|
|
7
|
+
import{a}from"./chunk-2UU42PTD.mjs";import"./chunk-BWWQXU2B.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-KIMQQ6JQ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as readSyncRecordTypes};
|
|
@@ -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{b as N,e as k}from"./chunk-
|
|
7
|
+
import{b as N,e as k}from"./chunk-NWOI25WY.mjs";import{l as y}from"./chunk-FQGHL7GR.mjs";var S=class{deps;constructor(t){this.deps=t}async mapFields(t,n,r,i=0,a){let{recordCount:s,fieldRules:f,rows:d}=t;if(s<=0||f.length===0&&!d)return[];let u=f.filter(o=>o.ruleType==="ai_generate"),g=f.filter(o=>o.ruleType==="faker"),R=N(),O=f.filter(o=>o.ruleType!=="ai_generate"&&o.ruleType!=="faker").map(o=>G(o,R)),p=u.length>0?await this.deps.aiGenerator.generate(u,s):[],b=g.length>0?this.deps.fakerFallback.generate(g,s,i):[],m=I(u,p,s),V=m?this.deps.fakerFallback.generate(u.map(q),s,i):[];m&&r?.({fields:C(u,p,s),reason:p.length===0?"no-answer":"short-answer"});let D=[...u,...g],x=this.deps.random??Math.random,_=E(t),F=d?P(f,R,a):void 0,w=[];for(let o=0;o<s;o++){let l={};for(let c of O)l[c.fieldApiName]=L(c,i+o,n,x);p[o]&&Object.assign(l,p[o]);for(let c of m?u:[])(l[c.fieldApiName]===void 0||l[c.fieldApiName]===null)&&(l[c.fieldApiName]=V[o]?.[c.fieldApiName]??null);b[o]&&Object.assign(l,b[o]);for(let c of D)l[c.fieldApiName]=M(l[c.fieldApiName],c.config.maxLength);_&&typeof l[h]=="string"&&(l[T]=this.deps.fakerFallback.dateOf(j.test(l[h])?"pastDate":"futureDate"));let A=d?.[i+o];A&&F&&Object.assign(l,F(A)),w.push(l)}return w}};function P(e,t,n){let r=new Set(e.filter(a=>a.fieldType?.toLowerCase()==="phone").map(a=>a.fieldApiName)),i=new Map(e.flatMap(a=>a.config.maxLength!==void 0?[[a.fieldApiName,a.config.maxLength]]:[]));return a=>{let s=k(a.values,r,t);for(let[f,d]of Object.entries(s))s[f]=M(d,n?.get(f)??i.get(f));return s}}var h="StageName",T="CloseDate",j=/closed/i;function E(e){return e.objectApiName!=="Opportunity"?!1:e.fieldRules.find(n=>n.fieldApiName===T)?.ruleType==="faker"&&e.fieldRules.some(n=>n.fieldApiName===h)}function G(e,t){let n=e.config.picklistValues;if(e.ruleType!=="picklist_random"||!n)return e;let r=new Set(e.fieldType?.toLowerCase()==="phone"?[e.fieldApiName]:[]),i=n.map(a=>{let s=k({[e.fieldApiName]:a},r,t)[e.fieldApiName];return typeof s=="string"?s:a});return{...e,config:{...e.config,picklistValues:i}}}function M(e,t){if(typeof e!="string"||t===void 0||t<=0||e.length<=t)return e;let n=e.slice(0,t);if(/\s/.test(e.charAt(t)))return n.trimEnd();let r=n.search(/\s\S*$/);return r>0?n.slice(0,r).trimEnd():n}function C(e,t,n){return e.filter(r=>Array.from({length:n},(i,a)=>t[a]?.[r.fieldApiName]).some(i=>i==null)).map(r=>r.fieldApiName)}function I(e,t,n){return e.length===0?!1:t.length<n?!0:t.some(r=>e.some(i=>r[i.fieldApiName]===void 0||r[i.fieldApiName]===null))}function q(e){return{fieldApiName:e.fieldApiName,ruleType:"faker",config:{fakerMethod:"sentence"}}}function L(e,t,n,r=Math.random){switch(e.ruleType){case"static":return e.config.staticValue??null;case"random":return $(e,r);case"sequence":return U(e,t);case"picklist_random":return v(e,r);case"reference":return z(e,n,r);case"formula":return e.config.formula??null;case"regex":return Y(e,t);case"from_csv":return null;default:return null}}function $(e,t){let n=e.config.minValue??0,r=e.config.maxValue??1e3;return Math.floor(n+t()*(r-n+1))}function U(e,t){let n=e.config.sequenceStart??1,r=e.config.sequenceStep??1;return`${e.config.sequencePrefix??""}${n+t*r}`}function Y(e,t){let n=e.config.regexPattern;return n?y(n,t):null}function v(e,t){let n=e.config.picklistValues;if(!n||n.length===0)return null;let r=Math.floor(t()*n.length);return n[r]}function z(e,t,n){let r=e.config.referenceObject;if(!r)return null;let i=t.get(r);if(!i||i.length===0)return null;let a=Math.floor(n()*i.length);return i[a]}export{S as a,L 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,b,c,d,e,f,g,h,i,j,k,l,m}from"./chunk-
|
|
7
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"./chunk-RCYEBY42.mjs";import"./chunk-J24TIGSI.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-ZUTUYBNW.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{c as LEDGER_KEPT_LINES,b as LEDGER_MAX_LINES,i as OrgClockWatch,a as REWIND_LEDGER_FILE,f as appendToRewindLedger,l as noteRewindEnded,m as noteRewindUndone,g as readRewindLedger,h as readRewindLedgers,k as rewindEndedRecord,e as rewindLedgerBeside,d as rewindLedgerFileOf,j as rewindTotalsOf};
|
|
@@ -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{b as c,j as o,k as d}from"./chunk-
|
|
7
|
+
import{b as c,j as o,k as d}from"./chunk-PBE44M2Y.mjs";import{b as i}from"./chunk-CA5NAXSU.mjs";import{o as a}from"./chunk-ZQO5PDX5.mjs";var u=6e4,g=class{tokenCache=new Map;sfdxBridge;setSfdxBridge(e){this.sfdxBridge=e}async authenticate(e){switch(e.method){case"oauth_web":return this.authenticateOAuth(e);case"oauth_device":return{success:!1,error:"OAuth device flow handled via DeviceLogin and SfdxBridge.loginWithRefreshToken()"};case"jwt":return this.authenticateJwt(e);case"usernamePassword":return this.authenticateUsernamePassword(e);case"sfdx_import":return this.importFromSfdx(e.username);default:return{success:!1,error:`Unsupported auth method: ${e.method}`}}}buildConnectionConfig(e,r){return{loginUrl:e.loginUrl,clientId:e.clientId,clientSecret:e.clientSecret,accessToken:r.accessToken,refreshToken:r.refreshToken,instanceUrl:r.instanceUrl,username:e.username}}async validateConnection(e,r){let t=await o({accessToken:e,instanceUrl:r}),{identity:s,orgResult:h}=await c(t,async()=>({identity:await t.identity(),orgResult:await t.query(`SELECT Id, Name, OrganizationType, IsSandbox FROM Organization LIMIT ${a.singleRecord}`)})),n=h.records[0];return{userId:s.user_id,username:s.username,displayName:s.display_name,orgId:n.Id,orgName:n.Name,orgType:n.OrganizationType,isSandbox:n.IsSandbox}}isTokenValid(e){let r=this.tokenCache.get(e);return r?Date.now()<r.expiresAt:!1}cacheToken(e,r,t){this.tokenCache.set(e,{token:r,expiresAt:Date.now()+t})}getCachedToken(e){let r=this.tokenCache.get(e);if(!r||Date.now()>=r.expiresAt){this.tokenCache.delete(e);return}return r.token}clearTokenCache(e){this.tokenCache.delete(e)}clearAllTokens(){this.tokenCache.clear()}async authenticateOAuth(e){return{success:!1,error:"OAuth handled via SfdxBridge.loginWeb()"}}async authenticateJwt(e){return{success:!1,error:"JWT handled via SfdxBridge.loginJwt()"}}async authenticateUsernamePassword(e){if(!e.username||!e.password)return{success:!1,error:"Username and password are required"};try{let r=await o({loginUrl:e.loginUrl}),t=await d(r.login(e.username,e.password+(e.securityToken??"")),u,`${new URL(e.loginUrl).host} did not answer within ${u/1e3} s: check that this machine reaches it, through its proxy if it has one`);return{success:!0,accessToken:r.accessToken??void 0,instanceUrl:r.instanceUrl,userId:t.id,orgId:t.organizationId}}catch(r){return{success:!1,error:`Login failed: ${i(r)}`}}}async importFromSfdx(e){if(!this.sfdxBridge)return{success:!1,error:"SFDX bridge not configured"};if(!e)return{success:!1,error:"An SFDX import needs the username of the org to import"};try{let r=await this.sfdxBridge.findOrg(e);return r?{success:!0,accessToken:r.credentials.accessToken,instanceUrl:r.credentials.instanceUrl,orgId:r.org.orgId}:{success:!1,error:`No connected org for ${e} found in SF CLI`}}catch(r){return{success:!1,error:`SFDX import failed: ${i(r)}`}}}};export{g as a};
|
|
@@ -4,4 +4,4 @@ import { dirname as __sandforgeDirname } from 'node:path';
|
|
|
4
4
|
const require = __sandforgeRequire(import.meta.url);
|
|
5
5
|
const __filename = __sandforgePath(import.meta.url);
|
|
6
6
|
const __dirname = __sandforgeDirname(__filename);
|
|
7
|
-
import{a,b,c,d,e,f,g}from"./chunk-
|
|
7
|
+
import{a,b,c,d,e,f,g}from"./chunk-VYOYXTCU.mjs";import"./chunk-PYRZFUVU.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{f as STANDARD_PRICEBOOK_MATCHED_NOTE,b as namesAPricebook,d as pricesHeldWithTheirs,e as pricesHeldWithTheirsNote,a as readStandardPricebooks,c as settleSyncPrices,g as withPricesSettled};
|
|
@@ -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-XSKPYGMT.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as DataPlanBuilder,b as resolveInsertOrder};
|
|
@@ -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{
|
|
7
|
+
import{Q as f,j as k,k as s}from"./chunk-J24TIGSI.mjs";import{a as d,b as u}from"./chunk-PC247GKX.mjs";import{tb as i}from"./chunk-ZQO5PDX5.mjs";import{b as c,l as a,u as p}from"./chunk-WZQEK4WT.mjs";import{homedir as E}from"node:os";import{join as O}from"node:path";var $=a({...d,operation:p(["apply","destroy","reset","recover"]),env:i,alias:c().min(1).max(255).optional()}),l=u(n=>{let e=$.safeParse(n);return e.success?e.data:void 0});function j(n=E()){return k(n)}function v(n,e){return O(n,`${s(e)}.env.lock`)}function K(n,e,o,r={}){let m=v(n,e),y=i.parse(o.env),t=l.acquire(m,h=>({...h,operation:o.operation,env:y,...o.alias!==void 0?{alias:o.alias}:{}}),r);return"busy"in t?{busy:L(t.busy)}:{lock:{organizationId:s(e),release:t.lock.release}}}function N(n,e,o={}){let r=l.holder(v(n,e),o);return r!==void 0?L(r):void 0}function L({version:n,token:e,...o}){return o}function g(n){return`process ${n.pid} on ${n.host}, since ${n.acquiredAt}`}function R(n){return`${w(n)}. Nothing was written: run this again once it ends. Two jobs applying to one org from two machines are not kept apart: give them one concurrency group.`}function w(n){let e=n.alias!==void 0?` to ${n.alias}`:"";return`${n.operation==="apply"?"an apply":n.operation==="recover"?"a state recover":`a ${n.operation}`} of ${n.env}${e} is under way on this machine (${g(n)})`}function _(n,e,o={}){let r=f(n,e,o);if(r!==void 0)return`a checkpoint ${r.operation} of this org is under way on this machine (${g(r)}): its records would be read or written as the step writes. Run this again once it ends.`}export{j as a,v as b,K as c,N as d,R as e,w as f,_ as g};
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { createRequire as __sandforgeRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __sandforgePath } from 'node:url';
|
|
3
|
+
import { dirname as __sandforgeDirname } from 'node:path';
|
|
4
|
+
const require = __sandforgeRequire(import.meta.url);
|
|
5
|
+
const __filename = __sandforgePath(import.meta.url);
|
|
6
|
+
const __dirname = __sandforgeDirname(__filename);
|
|
7
|
+
import{a as _e}from"./chunk-TW3N6W5Z.mjs";import{a as Le,b as Ee,c as Te,d as De}from"./chunk-5GBO4KD5.mjs";import{a as ye,j as $e}from"./chunk-BNKT3R3F.mjs";import{a as M}from"./chunk-QROPNEGY.mjs";import{b as G,e as H}from"./chunk-BZ24IAP5.mjs";import{a as U}from"./chunk-SCKUIE3R.mjs";import{c as J}from"./chunk-6FARZYMJ.mjs";import{a as Me}from"./chunk-EEFUE2ES.mjs";import{f as pe,j as Q,k as T,m as ge,n as _,o as D,p as we}from"./chunk-PE435FVH.mjs";import{a as Se,c as je,d as xe,e as Re,f as Ce,g as Oe,h as Ie,i as Pe,j as Ne}from"./chunk-MUEQRIK7.mjs";import{Qc as fe,za as le}from"./chunk-ISSP2FZ5.mjs";import{h as be,i as ke}from"./chunk-XU25YA46.mjs";import{m as ve}from"./chunk-P55MKIZX.mjs";import{l as me}from"./chunk-O2PUGRNW.mjs";import{h as he}from"./chunk-3SKLBRPL.mjs";import{b as oe}from"./chunk-LHU6CPGE.mjs";import{b as ne,c as re,e as ae,f as ie,h as Ae}from"./chunk-LCDPCUXS.mjs";import{q as ue}from"./chunk-KIMQQ6JQ.mjs";import{e as de,g as ce}from"./chunk-TZE3Y7IQ.mjs";import{Jc as te,Vc as se,y as W}from"./chunk-ZQO5PDX5.mjs";import{readFileSync as Xe}from"node:fs";import{basename as Ke,join as Ve}from"node:path";var Ze=`sandforge dataops \u2014 mask an org's records, and put them back, without the editor.
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
npx sandforge dataops anonymize \\
|
|
11
|
+
--org <alias> [--object <ApiName>] (--template <id> | --rules <file>) [options]
|
|
12
|
+
npx sandforge dataops anonymize \\
|
|
13
|
+
--org <alias> --restore <snapshot or set> [--slice <k[,k]>] [--rewrite-all]
|
|
14
|
+
[--include-changed] [--store <dir>] [--yes]
|
|
15
|
+
npx sandforge dataops anonymize \\
|
|
16
|
+
--org <alias> (--template <id> | --rules <file>) --abandon [--store <dir>] [--yes]
|
|
17
|
+
A run and a restore take [--accept-automation] [--accept-emails] [--mute-automation].
|
|
18
|
+
|
|
19
|
+
Required:
|
|
20
|
+
anonymize the command
|
|
21
|
+
--org <alias> sf CLI alias of the org
|
|
22
|
+
--template <id> a template that ships (tpl-gdpr-standard, tpl-ccpa-california,
|
|
23
|
+
tpl-hipaa-health, tpl-sandbox-scrub) or one saved in the store
|
|
24
|
+
--rules <file> or a JSON file of rules, saved in the store as a template:
|
|
25
|
+
{"name": "...", "rules": [{"fieldPattern": "Contact.Email",
|
|
26
|
+
"ruleType": "hash"}]} \u2014 a rule as the panel's editor saves it
|
|
27
|
+
|
|
28
|
+
Options:
|
|
29
|
+
--object <ApiName> the object to mask, one per run; without it, every object
|
|
30
|
+
the template masks, as the panel's Apply masks them \u2014
|
|
31
|
+
Account's person accounts among them, in an org that has
|
|
32
|
+
person accounts, when the template masks contacts
|
|
33
|
+
--where <clause> with --object: mask only the records this SOQL condition
|
|
34
|
+
selects, written without WHERE
|
|
35
|
+
--dry-run say what a run would mask \u2014 the fields, the records, the
|
|
36
|
+
first records masked as a run masks them \u2014 and write
|
|
37
|
+
nothing
|
|
38
|
+
--slices mask in slices of --max-records records each, consecutive
|
|
39
|
+
by Id, each backed up just before it is masked and masked
|
|
40
|
+
from that backup: an object past what one snapshot holds
|
|
41
|
+
is masked with a way back. With --dry-run, their plan: the
|
|
42
|
+
slices, the requests against what the org has left today,
|
|
43
|
+
the disk and the time. A slice that cannot be backed up
|
|
44
|
+
whole stops the run there, and the slices before it stay
|
|
45
|
+
masked with their backups
|
|
46
|
+
--max-requests <n> with --slices: the most requests the run sends. It stops
|
|
47
|
+
between two slices before the next would send more, exit
|
|
48
|
+
3, and --resume masks the rest
|
|
49
|
+
--resume mask only what the last run of the same template, object
|
|
50
|
+
and filter left, from where it stopped; of a run in
|
|
51
|
+
slices, the rest of its set, with the key it was masked
|
|
52
|
+
with
|
|
53
|
+
--abandon give up the set of slices of the template left open on the
|
|
54
|
+
org: nothing more is masked, and no resume carries it on.
|
|
55
|
+
Its slices stay masked, each with its snapshot, which
|
|
56
|
+
--restore puts back until the retention removes them; the
|
|
57
|
+
records no slice reached keep their values. It writes
|
|
58
|
+
nothing to the org
|
|
59
|
+
--restore <id> put back the values a snapshot holds, by Id: the id a run
|
|
60
|
+
printed, a snapshot's or a set of slices'. Of a set, every
|
|
61
|
+
slice not put back yet, in their order: stopped part way,
|
|
62
|
+
the same line puts back the rest. It reads the org's
|
|
63
|
+
values first and writes only the rows where one of them
|
|
64
|
+
differs from the snapshot, and says how many it found
|
|
65
|
+
unchanged
|
|
66
|
+
--slice <k[,k]> with --restore of a set of slices: only these slices, by
|
|
67
|
+
their number, put back again if they were already
|
|
68
|
+
--rewrite-all with --restore: write every row of the snapshot back,
|
|
69
|
+
the ones the org already holds as the snapshot does
|
|
70
|
+
included; of a set, every slice, those put back already
|
|
71
|
+
too
|
|
72
|
+
--include-changed with --restore of the snapshot a Sync run kept of what
|
|
73
|
+
it wrote over: put back the records changed or deleted
|
|
74
|
+
since the run too, which a restore of it otherwise
|
|
75
|
+
leaves as they are and counts, as removing the run does
|
|
76
|
+
--max-age-days <n> the retention, as sandforge.backup.maxAgeDays sets it:
|
|
77
|
+
snapshots taken more than <n> days ago are removed as
|
|
78
|
+
the command starts, each named on stderr \u2014 the one a
|
|
79
|
+
Sync run kept of what it wrote over too, which removing
|
|
80
|
+
that run then no longer puts back; 0 keeps them all
|
|
81
|
+
(default: 30)
|
|
82
|
+
--store <dir> where snapshots, saved templates and checkpoints live, a
|
|
83
|
+
folder of your own, and the key of each run in slices
|
|
84
|
+
until its set ends, in keys/, read by its owner alone;
|
|
85
|
+
the one sandforge backup reads and lists (default:
|
|
86
|
+
~/.sandforge/backups, under the folder
|
|
87
|
+
SANDFORGE_JOURNAL_DIR names when it is set)
|
|
88
|
+
--max-records <n> most records of the object a snapshot holds, as
|
|
89
|
+
sandforge.backup.maxRecordsPerObject sets it; a run with
|
|
90
|
+
more writes nothing, and a dry run says so \u2014 past it,
|
|
91
|
+
--slices masks in slices of this size (default: 50000;
|
|
92
|
+
100 to 1000000, any other refused, exit 2)
|
|
93
|
+
${Te("written over","--dry-run")} --yes do not ask before writing. Without it, a command with no
|
|
94
|
+
terminal to answer the question \u2014 a CI step \u2014 stops
|
|
95
|
+
there, exit 2, and writes nothing. It answers no to a
|
|
96
|
+
restore into a sandbox refreshed since its snapshot,
|
|
97
|
+
which only a yes typed in a terminal writes
|
|
98
|
+
--json emit what the panel would receive, every other line on
|
|
99
|
+
stderr; a preview's original values are left out
|
|
100
|
+
--help this text
|
|
101
|
+
|
|
102
|
+
A run takes a snapshot of the records it masks, their masked fields as they are,
|
|
103
|
+
before its first write, and writes nothing unless the snapshot holds every one of
|
|
104
|
+
them. A production org is refused.
|
|
105
|
+
|
|
106
|
+
With --slices, each slice is backed up just before it is masked, and masked from
|
|
107
|
+
that backup, so a record created since is never masked without one: a run says
|
|
108
|
+
at its end the records created during it in a range a slice masked, which
|
|
109
|
+
--resume masks with a slice of their own. The key the run hashes and draws its
|
|
110
|
+
people with is kept in the store's keys/ until its set is done or given up, so a
|
|
111
|
+
resume, in another process too, masks the same values the same way. While the
|
|
112
|
+
set is open, a new run of the template is refused: --resume masks the rest, and
|
|
113
|
+
--abandon gives the set up. The run writes over REST, 200 records a call, and
|
|
114
|
+
sends no Bulk API batch.
|
|
115
|
+
|
|
116
|
+
Before it writes, a run and a --restore say what the org runs as the records are
|
|
117
|
+
written over \u2014 its record-triggered flows, Apex triggers, processes and workflow
|
|
118
|
+
rules on update, and on undelete for what a restore brings back from the recycle
|
|
119
|
+
bin \u2014, the emails that sends against what the org has left today, and whether
|
|
120
|
+
the org delivers them; a dry run says it too, and what a real run would be
|
|
121
|
+
refused for (with --json, the dataops:automation:response it carries).
|
|
122
|
+
|
|
123
|
+
Ctrl-C stops a run as the panel's Cancel does: before its next page, what it
|
|
124
|
+
masked recorded in the audit trail of the store, and --resume masks only what it
|
|
125
|
+
left \u2014 of a run in slices, from where the slice it was in stopped. It stops a
|
|
126
|
+
--restore before its next batch, what it put back recorded the same way, and the
|
|
127
|
+
same --restore puts back the rest. Ctrl-C again ends the process at once. A
|
|
128
|
+
SIGTERM \u2014 a CI job cancelled or timed out \u2014 or a SIGHUP stops it the same way.
|
|
129
|
+
|
|
130
|
+
Exit codes: 0 the run masked every record it counted, or the restore put back
|
|
131
|
+
every value; 1 it could not start, was refused or failed \u2014 what the org runs as
|
|
132
|
+
it writes, without --accept-automation (AUTOMATION_NOT_ACCEPTED), emails it
|
|
133
|
+
delivers, without --accept-emails (EMAILS_NOT_ACCEPTED), more emails than it
|
|
134
|
+
has left today (EMAILS_EXCEEDED), or a mute refused among the reasons \u2014, or a
|
|
135
|
+
--dry-run saw that a run would be refused; 2 a bad command line,
|
|
136
|
+
or a question with no terminal to answer it (give --yes); 3 the run left
|
|
137
|
+
records unmasked, their personal data still in the org (--resume masks what
|
|
138
|
+
it left) \u2014 of a run in slices, slices it did not reach, stopped by
|
|
139
|
+
--max-requests or the org's day, or records created during it in a range a
|
|
140
|
+
slice masked \u2014, or the restore left values as they are (rows the org refused, a
|
|
141
|
+
snapshot that holds part of the records, or records of a Sync run's snapshot
|
|
142
|
+
changed since the run, held back without --include-changed); 130 Ctrl-C
|
|
143
|
+
stopped the run, 143 a SIGTERM, 129 a SIGHUP.
|
|
144
|
+
`,qe=1e9,Ye=/^[A-Za-z][A-Za-z0-9_]{0,79}$/,et={words:1,switches:["--dry-run","--resume","--slices","--abandon","--rewrite-all","--include-changed","--yes","--json",...Le],values:["--org","--object","--template","--rules","--where","--restore","--slice","--store","--max-records","--max-requests","--max-age-days"]};function g(s){process.stderr.write(`${s}
|
|
145
|
+
`),process.exit(2)}function tt(s){let e;try{e=JSON.parse(Xe(s,"utf8"))}catch(r){g(`Cannot read the rules in ${s}: ${r instanceof Error?r.message:String(r)}`)}let n=Array.isArray(e)?{rules:e}:e,a=typeof n=="object"&&n!==null&&!("name"in n)?{...n,name:`Rules from ${Ke(s)}`}:n,o=le.safeParse(a);if(!o.success){let r=o.error.issues.map(d=>`${d.path.join(".")||"(file)"}: ${d.message}`).join("; ");g(`The rules in ${s} are not rules the panel saves: ${r}`)}return o.data}function st(s){let e=s.slice(2);(e.includes("--help")||e.includes("-h"))&&(process.stdout.write(Ze),process.exit(0)),e[0]!=="anonymize"&&g(`The command is anonymize: ${U("dataops")} anonymize --org \u2026 Run with --help.`),ne(e,et);let n=l=>{let b=e.indexOf(l),I=b>=0?e[b+1]:void 0;return b>=0&&(I===void 0||I.startsWith("--"))&&g(`${l} needs a value.`),I},a=l=>e.filter(b=>b===l).length,o=n("--org");o||g("Missing --org. Run with --help."),re.test(o)||g(`Not an sf alias: "${o}"`);let r=n("--restore"),d=e.includes("--dry-run"),C=e.includes("--resume"),w=e.includes("--slices"),x=e.includes("--abandon"),k=n("--max-records");k!==void 0&&!/^[1-9]\d*$/.test(k)&&g(`Not a number of records: "${k}"`),k!==void 0&&(Number(k)<_||Number(k)>D)&&g(`--max-records takes ${_} to ${D} records, not ${k}: a snapshot holds at least ${_} records of one object and at most ${D}; past that, --slices masks the object in slices of --max-records records, each backed up just before it is masked, or narrow the run with --where.`);let c=n("--max-requests");c!==void 0&&(!/^[1-9]\d{0,9}$/.test(c)||Number(c)>qe)&&g(`Not a number of requests, 1 to ${qe}: "${c}"`),c!==void 0&&!w&&r===void 0&&!x&&g("--max-requests bounds a run in slices: give it with --slices.");let p=Re(e,"--slice");p.length>0&&r===void 0&&g("--slice goes with --restore: it names the slices of a set to put back. A run in slices is --slices.");let h=e.includes("--rewrite-all");h&&r===void 0&&g("--rewrite-all goes with --restore.");let f=e.includes("--include-changed");f&&r===void 0&&g("--include-changed goes with --restore.");let R=xe(n("--max-age-days")),A={org:o,rewriteAll:h,includeChanged:f,...R!==void 0?{maxAgeDays:R}:{},storeDir:n("--store")??Se(),...k!==void 0?{maxRecords:Number(k)}:{},slices:w,...c!==void 0?{maxRequests:Number(c)}:{},yes:e.includes("--yes"),json:e.includes("--json"),accord:Ee(e)};if(r!==void 0){let l=["--object","--template","--rules","--where","--dry-run","--resume","--slices","--max-requests","--abandon"].filter(b=>e.includes(b));return l.length>0&&g(`--restore puts a snapshot back as it is: drop ${l.join(", ")}.`),{...A,mode:"restore",restoreId:r,...p.length>0?{restoreSlices:Ce(p)}:{}}}if(x){let l=["--dry-run","--resume","--max-requests"].filter(b=>e.includes(b));l.length>0&&g(`--abandon gives a set of slices up and masks nothing: drop ${l.join(", ")}.`)}a("--object")>1&&g("Give one --object at most: a run masks one object, or every object its template masks.");let $=n("--object");$!==void 0&&!Ye.test($)&&g(`Not an SObject API name: "${$}"`);let v=n("--template"),m=n("--rules");v===void 0==(m===void 0)&&g("Give one of --template or --rules: the rules a run masks with."),d&&C&&g("Give one of --dry-run or --resume.");let y=n("--where")?.trim();return y!==void 0&&(y===""||!de(y))&&g(`Not a filter --where can take: "${y}". ${ce}`),y!==void 0&&$===void 0&&g("--where filters the records of one object: give it with --object."),{...A,mode:x?"abandon":d?"dry-run":C?"resume":"run",...$!==void 0?{object:$}:{},...v!==void 0?{templateId:v}:{},...m!==void 0?{rules:tt(m)}:{},...y!==void 0?{where:y}:{}}}function Be(s,e){let n=`${e.toLowerCase()}.`;return s.rules.filter(a=>a.fieldPattern.toLowerCase().startsWith(n)||a.fieldPattern==="*")}function nt(s,e){return Be(s,e).length>0?!0:e.toLowerCase()===ue.toLowerCase()&&pe(s.rules).length>0}function rt(s,e){let n=a=>JSON.stringify(a.map(o=>[o.fieldPattern.toLowerCase(),o.ruleType,o.config??null]).sort((o,r)=>String(o[0]).localeCompare(String(r[0]))));return n(s)===n(e)}function ot(s){if(s==null||s==="")return"(empty)";let e=typeof s=="string"?s:JSON.stringify(s);return JSON.stringify(e.length>40?`${e.slice(0,39)}\u2026`:e)}function ze(s,e){let n=[];typeof s.message=="string"&&n.push(s.message);for(let d of s.objects??[])n.push(` ${d.objectApiName.padEnd(28)} counted ${d.total} masked ${d.processed} refused ${d.failed} still original ${d.notMasked}`);let a=s.errors??[];a[0]&&n.push(` e.g. ${a[0].objectApiName}: ${a[0].message}`);let o=s.snapshot;o&&n.push(`snapshot ${o.operationId}: ${o.totalRecords} record(s) as they were before the run. To put their values back:`,` ${e(o.operationId)}`);let r=s.slices;return r&&n.push(...at(r,e)),n}function at(s,e){let n=s.objects.flatMap(r=>r.slices).sort((r,d)=>r.index-d.index),a=n.filter(r=>r.state==="masked").length,o=[`set ${s.setId} (${s.state}): ${a} of ${n.length} slice(s) masked, up to ${s.size} records a slice, ${s.requestsSpent} request(s) sent by this run`,...n.map(r=>` slice ${r.index} ${r.objectApiName.padEnd(20)} ${r.state.padEnd(8)} ${r.rows} record(s) masked ${r.masked} refused ${r.refused} deleted since ${r.deletedSince}${r.late?" created during the run":""}${r.sizeUsed!==void 0?` read ${r.sizeUsed} at a time`:""} snapshot ${r.snapshotId}`)];return s.lateRecords>0&&o.push(` ${s.lateRecords} record(s) created during the run in a range a slice masked, or past its last: no snapshot holds them, and they keep their values`),n.some(r=>r.state!=="pending")&&o.push("To put back the values its slices hold, every slice in one line:",` ${e(s.setId)}`),o}function it(s,e){return`${s}.${e}: the org has no such field, or field-level security hides it from this user \u2014 a run is refused and masks nothing (give the user read and edit access to it, or take it out of the template)`}function Fe(s,e){return e===void 0?`${s}: this user may not edit its records \u2014 a run is refused (CRUD_FLS_DENIED) and masks nothing (give the user edit access to the object)`:`${s}.${e}: this user may read it and not edit it \u2014 a run is refused (CRUD_FLS_DENIED) and masks nothing (give the user edit access to it, or take it out of the template)`}function dt(s,e={},n=!1){let a=s.fieldsNotFound??[],o=s.objects??[],r=e.objects??[];return a.length>0||o.some(d=>d.notCovered===!0||d.error!==void 0||d.writeDenied!==void 0)||r.some(d=>d.count===null&&!(n&&d.slicePlan!==void 0))}function ct(s,e){let n=[],a=s.objects??[];for(let{objectApiName:d,count:C,slicePlan:w}of a)w!==void 0&&(!e&&C!==null&&C>w.size&&n.push(`${d} holds ${C} record(s), more than the ${w.size} a snapshot holds of one object: --slices masks it in ${w.slices} slices, each backed up just before it is masked (the same line with --slices shows their plan), or narrow the run with --where`),e&&w.slices>W&&n.push(`${d} would take ${w.slices} slices of ${w.size} records, more than the ${W} a set holds: give --max-records up to ${D}, or narrow the run with --where`));let o=s.plan;e&&o?.diskFree!==void 0&&Q(o.diskBytes)>o.diskFree&&n.push(`the slices' snapshots take about ${T(Q(o.diskBytes))}, and the store has ${T(o.diskFree)} free: give --store a folder on another disk, delete the backups no longer needed, or keep backups fewer days (--max-age-days)`);let r=s.sliceSet;return r?.state==="open"&&n.push(`set ${r.setId} of this template is still open on the org (${r.done} of ${r.total} slice(s) masked, last moved ${r.savedAt}), and a new run would mask its rows again: the same line with --resume masks the rest, and --abandon gives it up`),n}function ut(s,e){let n=s.apiBudget;if(n.verdict==="unread")return`the org's requests left today were not read (${n.unread??"no answer"}): the run stops between two slices if the org's day runs short, and --resume masks the rest`;let a=`of ${n.remaining??"?"} the org has left today`;if(n.verdict==="fits")return`${a}: fits`;if(n.verdict==="near")return`${a}: near it \u2014 the run stops between two slices before the org's integrations run short, and --resume masks the rest`;let o=s.requests/Math.max(1,e),r=Math.max(0,Math.floor((n.remaining??0)/Math.max(1,o)));return`${a}: more than that \u2014 about ${Math.min(r,e)} of the ${e} slices go today, the run stops between two of them, and --resume masks the rest`}function lt(s,e,n){let{snapshots:a,updates:o,reads:r}=s.parts;return[" a run in slices:",` requests: about ${s.requests} (snapshots ${a}, updates ${o}, reads ${r}) ${ut(s,e)}`," Bulk API batches: none (the run writes over REST, 200 records a call)",` disk: about ${T(s.diskBytes)} in ${n}`+(s.diskFree!==void 0?` (${T(s.diskFree)} free)`:""),` time: about ${se(s.seconds)}`]}function ht(s,e,n,a){let o=["dry run \u2014 nothing is written"],r=e.objects??[],d=n.objects??[],C=n.fieldsNotFound??[];for(let c of r){let p=c.count===null?"an unknown number of":String(c.count);o.push(` ${c.objectApiName}: ${p} record(s) to mask`);let h=a!==void 0?c.slicePlan:void 0;c.count===null&&o.push(h!==void 0?" not counted by the org: its own figure of the records plans the slices, approximate; the run reads the object a slice at a time by Id, whatever it holds":" not counted by the org: a run stops at its count and masks nothing"),h!==void 0&&o.push(` slices: ${h.approximate?"about ":""}${h.slices} of up to ${h.size} records, each backed up just before it is masked`);let f=d.find(m=>m.objectApiName===c.objectApiName);if(f?.error){o.push(` not read: ${f.error}`);continue}let R=new Map([...Be(s,c.objectApiName).map(m=>[m.fieldPattern.split(".").pop()?.toLowerCase()??"",m.ruleType]),...Object.entries(f?.methods??{}).map(([m,y])=>[m.toLowerCase(),y])]),A=f?.fields??[];o.push(` fields: ${A.map(m=>`${m} (${R.get(m.toLowerCase())??"?"})`).join(", ")||"(none)"}`);for(let m of C.filter(y=>y.objectApiName===c.objectApiName))o.push(` ${it(m.objectApiName,m.fieldApiName)}`);f?.notCovered&&o.push(" no field of it can be masked: a run is refused and masks nothing");let $=f?.writeDenied?.deniedFields;$?.length===0&&o.push(` ${Fe(c.objectApiName)}`);for(let m of $??[])o.push(` ${Fe(c.objectApiName,m)}`);let v=f?.rows??[];if(v.length>0){o.push(" the first records, masked as a run masks them (a run draws its own key, so its made-up names and digests differ from these):");for(let m of v)o.push(` ${m.id}: ${A.map(y=>`${y} ${ot(m.after[y])}`).join(", ")}`)}}let w=r.reduce((c,p)=>c+(p.count??0),0),x=e.plan;if(a!==void 0&&x!==void 0){let c=r.reduce((p,h)=>p+(h.slicePlan?.slices??0),0);o.push(...lt(x,c,a.store)),o.push(" a run backs each slice up just before it masks it, and masks it from that backup: a slice that cannot be backed up whole stops the run there, and the slices before it stay masked with their backups")}else w>0&&o.push(` a run takes a snapshot of these ${w} record(s) first, and writes nothing without it`);let k=e.checkpoint;return k&&o.push(` a run of this template, object and filter stopped short on ${k.savedAt}: --resume masks only what it left`),o}function pt(s){return`interrupted: the restore stopped before it was through; what it restored is in the audit trail, and the same line puts back the rest: ${s}`}function mt(s){return s!==void 0?`interrupted: the masking stopped before it was through; what it masked is in the audit trail, each slice it masked has its snapshot (--restore ${s} puts their values back), and the same line with --resume masks the rest, from where its slice stopped`:"interrupted: the masking stopped before it was through; what it masked is in the audit trail, the snapshot puts their values back (--restore), and the same line with --resume masks only what it left"}function ft(s){return s.map(e=>{if(e.type!=="dataops:anonymize:preview:response")return e;let n=e.payload?.objects??[];return{...e,payload:{...e.payload,objects:n.map(a=>({...a,rows:(a.rows??[]).map(({id:o,after:r})=>({id:o,after:r}))}))}}})}async function gt(s=process.argv){let e=st(s),n=t=>{process[e.json?"stderr":"stdout"].write(`${t}
|
|
146
|
+
`)},a=t=>{process.stderr.write(`${t}
|
|
147
|
+
`),process.exitCode=1},o=je(e.storeDir);if(o!==void 0){a(o);return}let r=await oe(e.org),d=await new Me().validateConnection(r.accessToken,r.instanceUrl),C={alias:e.org,orgType:te({isSandbox:d.isSandbox,edition:d.orgType}),metadata:{apiVersion:"66.0",edition:d.orgType}};n(`sandforge dataops ${e.org} (${d.isSandbox?"sandbox":d.orgType||"production"}) store: ${e.storeDir}`);let w=ve(Ve(e.storeDir,"snapshots.json")),x=[],k=new Map,c=new _e,p=new we({log:t=>{/^\[(WARN|INFO)\]/.test(t)&&n(` ${t}`)},broker:{postToWebview:t=>{if(x.push(t),t.type!=="operation:progress")return;let i=String(t.payload?.operationId??""),u=Number(t.payload?.percentage??0);(u-(k.get(i)??-10)>=10||u===100)&&(k.set(i,u),n(` ${u}% ${String(t.payload?.currentStep??"")}`))}},orgManager:{getOrg:()=>C},orgRegistry:{getCredentials:async()=>({accessToken:r.accessToken,instanceUrl:r.instanceUrl})},configStore:w,services:{getSandforgeSetting:Oe(e)},infraServices:{backgroundRegistry:c,productionGuard:new me({requestConfirmation:(t,i)=>(n(`refused: ${e.org} is taken for a ${i} org, and this command writes to none (${t})`),Promise.resolve(!1))}),confirmRestoreIntoReplacedOrg:({alias:t,backedUpFrom:i,now:u})=>e.yes?Promise.resolve(!1):M(`${t} answered as org ${i} when this snapshot was taken and answers as org ${u} now. Write its saved values into the org it is now?`)},nextId:()=>`cli-${Date.now()}-${Math.random().toString(36).slice(2,8)}`});p.setExpiryListener(t=>process.stderr.write(`${Ie(t)}
|
|
148
|
+
`)),p.setRunKeyStore(ge(e.storeDir)),p.setBackupRecordStore(new ke(be(e.storeDir))),await p.swept(),p.setSyncRuns(he(ye())),p.setMuteOffered($e("--mute-automation")),p.setOnCommandLine(!0);let h=async(t,i)=>{let u=`cli-${t.replaceAll(":","-")}-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return await p.handle({id:u,type:t,timestamp:Date.now(),payload:i}),x.find(j=>j.correlationId===u&&(j.type===`${t}:response`||j.type==="dataops:error"))??{type:"dataops:error",payload:{message:`${t} was not answered.`}}},f=t=>t.type==="dataops:error",R=t=>String(t.payload?.message??t.type),A=t=>`${U("dataops")} anonymize --org ${e.org} --restore ${t} --store ${e.storeDir}`,$=async(t,i)=>{let u=await h("dataops:automation",{orgId:e.org,act:t,objects:i,...e.accord});if(f(u)){a(R(u));return}let S=u.payload;for(let j of S.lines)n(j);return S},v=t=>{e.json&&process.stdout.write(`${JSON.stringify({tool:"sandforge-dataops",command:t,org:e.org,...e.slices?{slices:!0}:{},posted:ft(x)},null,2)}
|
|
149
|
+
`)};if(e.mode==="restore"){let t=e.restoreId,i=Pe(w,t,{...e.restoreSlices?{slices:e.restoreSlices}:{},rewriteAll:e.rewriteAll});if(!i){a(`No snapshot or set of slices "${t}" in ${e.storeDir}.`);return}let u=i.objects.map(N=>N.objectApiName).join(", "),S=await $("restore",i.objects);if(!S){v("restore");return}if(S.refusals.length>0){v("restore");for(let N of S.refusals)a(J(N));return}if(!e.yes&&!await M(`Put back into ${e.org} the values ${i.words} holds? ${i.totalRecords} record(s) of ${u} will have those fields written over.`)){n("Nothing written.");return}n(`restoring ${t} into ${e.org}${e.rewriteAll?", every row written back":""}\u2026`);let j,He=H(N=>{j=N,process.stderr.write(`
|
|
150
|
+
interrupted: the restore stops before its next batch, and says what it restored (Ctrl-C again ends it at once)
|
|
151
|
+
`);for(let Je of c.getRunning())c.abort(Je.operationId)}),P;try{P=await h("dataops:rollback",{orgId:e.org,operationId:t,...e.rewriteAll?{rewriteAll:!0}:{},...e.includeChanged?{includeChanged:!0}:{},...e.restoreSlices?{slices:e.restoreSlices}:{},...e.accord})}finally{He()}if(v("restore"),f(P)){a(R(P)),e.yes&&P.payload?.code==="ORG_REPLACED_SINCE_BACKUP"&&a("--yes does not answer this question: it is answered yes only when typed in a terminal. Run the same line without --yes in a terminal to answer it; nothing answers it from a CI step.");return}n(String(P.payload?.message??""));for(let N of Ne(P.payload??{}))n(N);if(j){process.stderr.write(`${pt(A(t))}
|
|
152
|
+
`),process.exitCode=G(j);return}ie(ae(P.payload??{}));return}let y=(await h("dataops:anonymization-templates",{})).payload?.templates??[],l;if(e.rules){let t=e.rules,i=y.find(u=>u.saved===!0&&u.name.trim().toLowerCase()===t.name.toLowerCase());if(i&&rt(i.rules,t.rules))l=i;else{i&&await h("dataops:anonymization-template:delete",{templateId:i.id});let u=await h("dataops:anonymization-template:save",{name:t.name,rules:t.rules});if(f(u)){a(R(u));return}l=u.payload?.template,n(`rules saved in the store as template "${l.name}" (${l.id})`)}}else if(l=y.find(t=>t.id===e.templateId),!l){a(`No template "${e.templateId??""}". Templates: `+y.map(t=>`${t.id}${t.saved?` (saved: ${t.name})`:""}`).join(", "));return}let b=e.object;if(b!==void 0&&!nt(l,b)){a(`Template "${l.name}" has no rule for ${b}: a run would mask nothing.`);return}let I={orgId:e.org,templateId:l.id,...b!==void 0?{objects:[b]}:{},...e.where!==void 0?{where:e.where}:{}};if(n(`template: ${l.name} (${l.id}) `+(b!==void 0?`object: ${b}`:"objects: every object the template masks")+(e.where!==void 0?` where: ${e.where}`:"")+(e.slices?" in slices":"")),e.mode==="abandon"){let t=new fe(w).openFor(e.org,l.id);if(t&&!e.yes){let u=t.objects.flatMap(j=>j.slices).filter(j=>j.state==="masked").length,S=t.objects.reduce((j,ee)=>j+ee.slices.length,0);if(!await M(`Give up set ${t.setId} of ${l.name} on ${e.org}, ${u} of ${S} slice(s) masked, last moved ${t.lastActivityAt}? Nothing more is masked and no resume carries it on; its slices stay masked, each with its snapshot, which --restore ${t.setId} puts back until the retention removes them.`)){n("Nothing given up.");return}}let i=await h("dataops:anonymize",{...I,abandon:!0});v("abandon");for(let u of ze(i.payload??{},A))n(u);f(i)&&(process.exitCode=1);return}let O=await h("dataops:anonymize:coverage",{...I,...e.slices?{slices:!0}:{}});if(f(O)){a(R(O));return}let L=O.payload?.objects??[],Ue=L.reduce((t,i)=>t+(i.count??0),0),We=e.slices?L.filter(t=>t.count===null&&t.slicePlan!==void 0):[],q=O.payload?.sliceSet,K=L.map(t=>({objectApiName:t.objectApiName,records:t.count??(e.slices&&t.slicePlan!==void 0?t.slicePlan.slices*t.slicePlan.size:0)}));if(e.mode==="dry-run"){let t=await h("dataops:anonymize:preview",I);if(f(t)){v("dry-run"),a(R(t));return}for(let S of ht(l,O.payload??{},t.payload??{},e.slices?{store:e.storeDir}:void 0))n(S);let i=await $("masking",K);if(v("dry-run"),!i)return;for(let S of De(i))n(S);let u=ct(O.payload??{},e.slices);for(let S of u)n(` a run would be refused: ${S}`);(u.length>0||i.refusals.length>0||dt(t.payload??{},O.payload??{},e.slices))&&(process.exitCode=1);return}let V=O.payload?.checkpoint;if(e.mode==="resume"&&!V){a(q!==void 0?`There is nothing to resume for this object and filter: set ${q.setId} of this template is open on ${e.org}, its run given another object or filter. Its own line with --resume masks the rest, and --abandon gives it up.`:`There is nothing to resume: no run of this template, object and filter stopped short in ${e.storeDir}.`);return}let Z=e.mode==="resume"&&q!==void 0;if(e.mode==="run"&&Ue===0&&We.length===0){let t=L.filter(i=>i.count===null).map(i=>i.objectApiName);if(t.length>0){a(`${t.join(", ")}: the org did not count the records a run would mask, so nothing was masked (its reason is in the warning above).`);return}n(b!==void 0?"Nothing to mask: no record of the object is under the filter.":"Nothing to mask: no object the template masks holds a record."),v("run");return}let z=await $("masking",K);if(!z){v(e.mode);return}if(z.refusals.length>0){v(e.mode);for(let t of z.refusals)a(J(t));return}if(!e.yes){let t=b??L.map(i=>i.objectApiName).join(", ");if(!await M(wt(e,l.name,t,O,Z))){n("Nothing written.");return}}n(e.mode==="resume"?"resuming\u2026":"masking\u2026");let F,Ge=H(t=>{F=t,process.stderr.write(`
|
|
153
|
+
interrupted: the masking stops before its next page, and says what it masked (Ctrl-C again ends it at once)
|
|
154
|
+
`);for(let i of c.getRunning())c.abort(i.operationId)}),Y=e.slices||Z,E;try{E=await h("dataops:anonymize",{...I,...e.mode==="resume"?{resumeFrom:V.id}:{snapshot:!0},...Y?{slices:!0}:{},...Y&&e.maxRequests!==void 0?{maxRequests:e.maxRequests}:{},...e.accord})}finally{Ge()}v(e.mode);for(let t of ze(E.payload??{},A))n(t);let B=E.payload?.slices;if(F){process.stderr.write(`${mt(B?.setId)}
|
|
155
|
+
`),process.exitCode=G(F);return}if(f(E)){process.exitCode=1;return}(Number(E.payload?.recordsNotMasked??0)>0||B?.state==="open")&&(B===void 0&&n("A resume masks only what this run left: the same line with --resume, in place of the snapshot it does not take again."),process.exitCode=3)}function wt(s,e,n,a,o){let r=a.payload?.objects??[],d=a.payload?.sliceSet,C=a.payload?.checkpoint;if(s.mode==="resume")return o&&d!==void 0?`Resume the masking of ${n} in ${s.org} in slices, set ${d.setId}: ${d.done} of ${d.total} slice(s) masked, last moved ${d.savedAt}? Each slice left is backed up just before it is masked, with the key the set was masked with.`:`Resume the masking of ${n} in ${s.org} that stopped on ${C?.savedAt??"?"}? What it left is written over; the snapshot the first run took holds their values.`;let w=r.reduce((A,$)=>A+($.count??0),0),x=r.some(A=>A.count===null),k=x?`the records of ${n}`:`${w} record(s) of ${n}`;if(!s.slices)return`Mask ${k} in ${s.org} with ${e}? A snapshot of their values is taken first.`;let c=r.reduce((A,$)=>A+($.slicePlan?.slices??0),0),p=a.payload?.plan,h=p?.apiBudget,f=p!==void 0?p.requests/Math.max(1,c):0,R=h?.remaining!==void 0&&f>0?Math.min(c,Math.floor(h.remaining/f)):void 0;return`Mask ${k} in ${s.org} with ${e}, in ${x?"about ":""}${c} slice(s)? Each slice is backed up just before it is masked; if one cannot be backed up whole, the run stops there and the slices before it stay masked with their backups.`+(h?.verdict==="exceeds"&&R!==void 0?` The org has ${h.remaining} requests left today, enough for about ${R} of them: the run stops between two slices, and the same line with --resume masks the rest.`:"")}/sandforge-dataops\.[cm]?[jt]s$/.test(process.argv[1]??"")&&(Ae(),gt().then(()=>process.exit()).catch(s=>{process.stderr.write(`${s instanceof Error?s.message:String(s)}
|
|
156
|
+
`),process.exit(1)}));export{st as a,nt as b,ze as c,at as d,it as e,Fe as f,dt as g,ct as h,lt as i,ht as j,pt as k,mt as l,gt as m,wt as n};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __sandforgeRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __sandforgePath } from 'node:url';
|
|
3
|
+
import { dirname as __sandforgeDirname } from 'node:path';
|
|
4
|
+
const require = __sandforgeRequire(import.meta.url);
|
|
5
|
+
const __filename = __sandforgePath(import.meta.url);
|
|
6
|
+
const __dirname = __sandforgeDirname(__filename);
|
|
7
|
+
import{a,b,c,d,e,f,g,h}from"./chunk-AUS6NFLZ.mjs";import"./chunk-DBBPDSFN.mjs";import"./chunk-GBGHJTPC.mjs";import"./chunk-YMDFF657.mjs";import"./chunk-7WSLT5VX.mjs";import"./chunk-YT22LMF7.mjs";import"./chunk-PE435FVH.mjs";import"./chunk-PWVDNN2C.mjs";import"./chunk-6VSZNZHH.mjs";import"./chunk-XCA5AONB.mjs";import"./chunk-66NMFCWX.mjs";import"./chunk-WB2RIVO3.mjs";import"./chunk-ISSP2FZ5.mjs";import"./chunk-XU25YA46.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-IVZJSDJD.mjs";import"./chunk-VZT4E2OJ.mjs";import"./chunk-BOGNK4LV.mjs";import"./chunk-O2PUGRNW.mjs";import"./chunk-7SDZR6SR.mjs";import"./chunk-T63U4OZJ.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-54HYHHVL.mjs";import"./chunk-QIRO4HTE.mjs";import"./chunk-3SKLBRPL.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-SAMWHL22.mjs";import"./chunk-6KP6WETK.mjs";import"./chunk-4JKR4PTZ.mjs";import"./chunk-J24TIGSI.mjs";import"./chunk-HKUWHVI7.mjs";import"./chunk-VPDEJGPS.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-PBE44M2Y.mjs";import"./chunk-ZUOPC4W2.mjs";import"./chunk-JQZTMFO7.mjs";import"./chunk-JFNLKHY6.mjs";import"./chunk-VZVICK7Q.mjs";import"./chunk-PPGDAUEQ.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-7PY3VQP3.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-HFUDCNU5.mjs";import"./chunk-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{d as CheckpointTakeStopped,a as DEFAULT_MAX_TOTAL,b as OBJECT_ROWS_MAX,f as holdingLimit,e as pastTheLimit,g as scopeCheckpoint,h as takeCheckpoint,c as takeOrgOf};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __sandforgeRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __sandforgePath } from 'node:url';
|
|
3
|
+
import { dirname as __sandforgeDirname } from 'node:path';
|
|
4
|
+
const require = __sandforgeRequire(import.meta.url);
|
|
5
|
+
const __filename = __sandforgePath(import.meta.url);
|
|
6
|
+
const __dirname = __sandforgeDirname(__filename);
|
|
7
|
+
import{b as N}from"./chunk-WB2RIVO3.mjs";import{a as k}from"./chunk-BOGNK4LV.mjs";import{i as S}from"./chunk-O2PUGRNW.mjs";import{a as _,b as E}from"./chunk-T63U4OZJ.mjs";import{Ac as X,Sa as L,Wb as M,Zb as W,bb as F,cc as z,db as w,fb as U,fc as V,gb as x,ib as G,jb as v,lb as B,lc as H,zb as j}from"./chunk-JFNLKHY6.mjs";import{b as C,f as P,k as b,l as D}from"./chunk-WZQEK4WT.mjs";var q={PII:"PII",PHI:"PHI",PCI:"PCI",Confidential:"SENSITIVE"},K={PII:"fake",PHI:"nullify",PCI:"mask",SENSITIVE:"hash",NONE:"fake"},$={name_pattern:"field_name",type_analysis:"field_name",content_pattern:"content_sampling"},J=.9;function ie(e,t){let n=[];for(let[i,a]of t){let c=a.fields.filter(o=>o.createable&&N({name:o.name,label:o.label,type:o.type})),l=new Map(c.map(o=>[o.name,o])),r=new Map,s=e.detectPII(i,c.map(o=>({apiName:o.name,label:o.label,type:o.type})));for(let o of s.piiFields){let u=l.get(o.fieldApiName);if(!u)continue;let d=q[o.classification];r.set(u.name,{objectApiName:i,fieldApiName:u.name,fieldLabel:u.label,fieldType:u.type,piiCategory:d,detectionMethod:$[o.detectionMethod],confidence:o.confidence,suggestedMethod:K[d]})}for(let o of c)r.has(o.name)||E(o.name,o.type)===void 0||r.set(o.name,{objectApiName:i,fieldApiName:o.name,fieldLabel:o.label,fieldType:o.type,piiCategory:"PII",detectionMethod:"field_name",confidence:J,suggestedMethod:"fake"});n.push(...r.values())}return n}function ae(e,t){let n=a=>`${a.objectApiName}.${a.fieldApiName}`,i=new Set(e.map(n));return[...e,...t.filter(a=>!i.has(n(a)))]}var Y=["Contact","Lead"];function re(e,t,n){if(e==="none")return[];let i=new Set(t),a=[];for(let c of Y){if(!i.has(c))continue;let l=n.filter(s=>s.objectApiName===c).map(s=>s.fieldApiName),r=[];l.some(_)||r.push("name"),l.some(s=>E(s,"string")==="email")||r.push("email"),l.some(s=>E(s,"string")==="phone")||r.push("phone"),r.length>0&&a.push({objectApiName:c,missing:r})}return a}function ce(e){return e.fatalError!==void 0?"failure":e.totalFailure>0||e.failedObjects.length>0?e.totalSuccess+(e.totalLinked??0)>0?"partial":"failure":[...Object.values(e.lookups??{}),...Object.values(e.statuses??{})].some(n=>n.refusals.length>0)||e.stopped===!0?"partial":"success"}var Q=D({name:C().min(1),referenceTo:b(C()).min(1),createable:P().optional(),updateable:P().optional()}).loose();function de(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let i=Q.safeParse(n);i.success&&t.push({name:i.data.name,referenceTo:i.data.referenceTo,createable:i.data.createable??!1,updateable:i.data.updateable??!1})}return t}var ge={STORAGE_EXCEEDED:"AUTOPILOT_STORAGE_EXCEEDED",API_BUDGET_EXCEEDED:"API_BUDGET_EXCEEDED",WRITE_DECLINED:"AUTOPILOT_WRITE_DECLINED",CONFIRMATION_UNAVAILABLE:"AUTOPILOT_CONFIRMATION_UNAVAILABLE",CHECKPOINT_REFUSED:"CHECKPOINT_REFUSED",RUN_CANCELLED:"RUN_CANCELLED",EMAILS_NOT_ACCEPTED:z},Ae={NO_PLAN:"AUTOPILOT_NO_PLAN",STORAGE_UNREAD:"AUTOPILOT_FIT_STORAGE_UNREAD",READ_REFUSED:"AUTOPILOT_FIT_READ_REFUSED",STALE:"AUTOPILOT_FIT_STALE"};function Ie(e,t,n=new Map){return L(e.waves.flatMap(i=>i.objects).map(i=>{let a=n.get(i);return{objectApiName:i,rows:[],counted:{rows:t.get(i)??0,...a!==void 0?{personAccounts:a}:{}}}}))}function he(e){return[...new Set(e.waves.flatMap(t=>t.objects.map(String)))]}async function Ce(e){return M(e)}function Z(e){return e.filter(t=>t.verdict==="exceeds").map(W)}function ee(e){return e.filter(t=>t.verdict==="unread").map(t=>({limit:t.limit,emails:t.emails,unread:t.unread??""}))}function Pe(e){return e.objects.filter(({rows:t})=>t>0).length}async function te(e,t,n,i,a={}){let c="unread"in t?await n().catch(o=>({unread:o instanceof Error?o.message:String(o)})):t.dailyApiRequests,{readBack:l=0,deliverability:r=0,mute:s=0}=a;return w({run:F(e.objects.map(({rows:o})=>({rows:o}))),...G(i),...s>0?{mute:s}:{},...l>0?{readBack:l}:{},...r>0?{deliverability:r}:{}},c)}async function ke(e){let{plan:t}=e,n=j(t,e.storage);if(t.totalRows===0)return{go:!0,check:n,asked:!1};let i=e.checkpointFirst?.estimate,a=v(i);if(a)return{go:!1,...a,check:n};let c=X(n,e.org);if(c)return{go:!1,code:"STORAGE_EXCEEDED",message:`${c} Nothing was written.`,check:n};let l=await te(t,e.storage,e.readApiBudget,i,{...e.readBack!==void 0?{readBack:e.readBack}:{},...e.mute!==void 0?{mute:e.mute}:{},...V(e.runEmails?.ofRun)}),r=U(l,e.org);if(r)return{go:!1,code:"API_BUDGET_EXCEEDED",message:r,check:n};let s=e.confirmAboveRecords,o=s>0&&t.totalRows>s?s:void 0,u=Z(e.emails??[]),d=ee(e.emails??[]),g=e.emailsUncounted,f=e.runEmails?.gate,y=f?.verdict==="asks",R=async m=>{let p=k(f,m&&y),I=e.checkpointFirst;if(I===void 0)return{go:!0,check:n,asked:m,...p};let h=await B(()=>I.take(I.estimate));return"stop"in h?{go:!1,...h.stop,check:n,...p}:{go:!0,check:n,asked:m,checkpoint:h.checkpoint,...p}};if(o===void 0&&n.verdict==="fits"&&u.length===0&&d.length===0&&g===void 0&&i===void 0&&!y)return R(!1);let A=S(e.orgTier),T=await e.confirm({stage:"write",module:"autopilot",org:e.org,orgTier:e.orgTier,objects:t.objects.map(({objectApiName:m,rows:p})=>({objectApiName:m,rows:p})),total:t.totalRows,...o!==void 0?{aboveRecords:o}:{},...A!==void 0&&t.totalRows>A?{largeVolume:A}:{},storage:H(n),counted:!0,...u.length>0?{emails:u}:{},...d.length>0?{emailsUnread:d}:{},...g!==void 0?{emailsUncounted:g}:{},...x(l),...i!==void 0?{checkpoint:i}:{},...f?.confirmation});if(T==="confirmed")return R(!0);let O=k(f,!1);return T==="declined"?{go:!1,code:"WRITE_DECLINED",message:"The Autopilot run was cancelled before it wrote anything. Nothing was written.",check:n,...O}:{go:!1,code:"CONFIRMATION_UNAVAILABLE",message:"The Autopilot run needed a confirmation before it wrote, and there was no one to ask. Nothing was written: run it again from the Autopilot page, where the question is asked.",check:n,...O}}export{ie as a,ae as b,re as c,ce as d,de as e,ge as f,Ae as g,Ie as h,he as i,Ce as j,Pe as k,te as l,ke as m};
|
|
@@ -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{g as v}from"./chunk-
|
|
7
|
+
import{g as v}from"./chunk-L4INJ5TZ.mjs";var x=!0;function D(t){let e=new Map;for(let n of t){let r=n.SobjectType;if(typeof r!="string"||r==="")continue;let o=r.toLowerCase(),c=e.get(o)??{viewAll:!1,modifyAll:!1};e.set(o,{viewAll:c.viewAll||n.PermissionsViewAllRecords===!0,modifyAll:c.modifyAll||n.PermissionsModifyAllRecords===!0})}return e}function E(t){return[...t.values()].some(e=>e.modifyAll)}var I=new Set(["task","event"]),M=new Set(["product2","pricebook2","pricebookentry"]),N=new Set(["user","group"]);function L(t){let e=[];for(let n of t.fields){if(n.type!=="reference")continue;let r=(n.referenceTo??[]).filter(o=>!N.has(o.toLowerCase()));r.length>0&&e.push({field:n.name,targets:r})}return e}function R(t,e){if(I.has(t))return"activities";if(M.has(t))return"catalog";if(t===v.toLowerCase())return"filesNotProven";if(e.has(t))return"settingNotProven"}function G(t,e){let n=j(e.describes),r=k(e.customSettings),o=new Map;for(let c of t){let f=c.toLowerCase();if(R(f,r)!==void 0||e.grants.has(f))continue;let u=n.get(f);if(u!==void 0)for(let{targets:p}of L(u)){if(p.length!==1)continue;let s=p[0],i=s.toLowerCase();!n.has(i)&&!o.has(i)&&o.set(i,s)}}return[...o.values()]}function j(t){return new Map([...t].map(e=>[e.name.toLowerCase(),e]))}function k(t){return new Set([...t??[]].map(e=>e.toLowerCase()))}function P(t,e,n){return(t.childRelationships??[]).some(r=>r.cascadeDelete===!0&&r.childSObject.toLowerCase()===e&&r.field.toLowerCase()===n.toLowerCase())}function $(t,e,n={}){let r=n.byParent??x,o=j(e.describes),c=k(e.customSettings),f=new Map,u=(s,i)=>{let d=s.toLowerCase(),C=f.get(d);if(C!==void 0)return C;let m=R(d,c);if(m!==void 0)return{reason:m};let h=e.grants.get(d);if(h!==void 0)return h.modifyAll?{access:"object"}:{reason:h.viewAll?"noModifyAll":"noViewAll"};if(!r)return{reason:"parentNotSeen",detail:"held through its parents is not proven"};let A=o.get(d);if(A===void 0)return{reason:"parentNotSeen",detail:"it could not be described"};let w=[];for(let{field:l,targets:a}of L(A)){let b=a.filter(y=>!o.has(y.toLowerCase())),g=a.filter(y=>{let S=o.get(y.toLowerCase());return S!==void 0&&P(S,d,l)});if(a.length>1){if(g.length>0||b.length>0)return{reason:"parentNotSeen",detail:`${l} may name a record of ${a.join(", ")}`};continue}if(b.length>0)return{reason:"parentNotSeen",detail:`${b[0]}, which ${l} names, could not be described`};g.length>0&&w.push({field:l,parent:g[0]})}if(w.length===0)return{reason:"parentNotSeen",detail:"it hangs from no record whose delete takes it along"};let O=new Set([...i,d]);for(let{field:l,parent:a}of w){let b=a.toLowerCase(),g=O.has(b)?void 0:u(a,O);if(g===void 0||!("access"in g))return{reason:"parentNotSeen",detail:`${a}, which ${l} names, is not held whole`}}return{access:"parent"}},p=new Map;for(let s of t){let i=u(s,new Set);f.set(s.toLowerCase(),i),p.set(s,i)}return p}export{D as a,E as b,G as c,$ as d};
|
|
@@ -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{l as i}from"./chunk-
|
|
7
|
+
import{l as i}from"./chunk-O2PUGRNW.mjs";function u(o,t){let n=e=>e==="production"?`${t} is taken for a production org, and this command writes to none`:void 0;return new i({requestConfirmation:(e,d)=>{let r=n(d);return r===void 0?Promise.resolve(!0):(o(`refused: ${r} (${e})`),Promise.resolve(!1))},declinesWithoutAsking:n})}export{u as a};
|
|
@@ -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{
|
|
7
|
+
import{ke as c}from"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";var y=[{type:"seed",label:"Seed Data",description:"Seed an org with a template saved on the Seed page or shipped with SandForge, never a production org; its records are taken back from Seed\u2019s Recent runs",category:"data",icon:"database",configSchema:{orgId:{type:"string"},templateId:{type:"string"}}},{type:"sync",label:"Sync Data",description:"Run a Sync configuration saved on the Sync page; a target Production Guard asks about, a production org or a sandbox marked Staging, needs an Approval step before it",category:"data",icon:"sync",configSchema:{configId:{type:"string"}}},{type:"backup",label:"Backup",description:"Take a DataOps snapshot of the listed objects into local storage",category:"data",icon:"archive",configSchema:{orgId:{type:"string"},objects:{type:"array"}}},{type:"restore",label:"Restore",description:"Restore data from a previous backup snapshot",category:"data",icon:"history",configSchema:{backupId:{type:"string"}}},{type:"anonymize",label:"Anonymize",description:"Mask an org with a DataOps template, after a snapshot of the values it writes over, never a production org",category:"data",icon:"shield",configSchema:{orgId:{type:"string"},templateId:{type:"string"},object:{type:"string",optional:!0},where:{type:"string",optional:!0},acceptAutomation:{type:"boolean",default:!1},acceptEmails:{type:"boolean",default:!1},muteAutomation:{type:"boolean",default:!1}}},{type:"delete",label:"Delete",description:"Delete records matching specified criteria",category:"data",icon:"trash",configSchema:{objectName:{type:"string"},where:{type:"string"}}},{type:"checkpoint",label:"Checkpoint",description:"Take a checkpoint of a sandbox, a scratch org or a Developer Edition org, kept on this machine",category:"data",icon:"bookmark",configSchema:{orgId:{type:"string"},mode:{type:"string",default:"everything"},objects:{type:"array",optional:!0},excluded:{type:"array",optional:!0},name:{type:"string",optional:!0},keepDays:{type:"number",default:c},maxTotal:{type:"number",optional:!0},ignoredFields:{type:"array",optional:!0}}},{type:"rewind",label:"Rewind",description:"Put an org back to a checkpoint kept on this machine, once confirmed by typing the org\u2019s alias, at most maxRecords records",category:"data",icon:"history",configSchema:{orgId:{type:"string"},checkpointId:{type:"string"},objects:{type:"array",optional:!0},acceptAutomation:{type:"boolean",default:!1},acceptEmails:{type:"boolean",default:!1},muteAutomation:{type:"boolean",default:!1},acceptNoUndo:{type:"boolean",default:!1},acceptRecreate:{type:"boolean",default:!1},acceptOutside:{type:"boolean",default:!1},acceptUnseen:{type:"boolean",default:!1},maxRecords:{type:"number",required:!0},refuseWhenActive:{type:"boolean",default:!0}}},{type:"compare",label:"Compare Orgs",description:"Compare the metadata of two orgs, as the Compare page does",category:"quality",icon:"git-compare",configSchema:{sourceOrgId:{type:"string"},targetOrgId:{type:"string"},types:{type:"array"}}},{type:"precheck",label:"Pre-check",description:"Read an org\u2019s API usage, storage, error logs or failed jobs as the Monitor does; the run stops on a critical reading",category:"quality",icon:"check-circle",configSchema:{orgId:{type:"string"},checks:{type:"array"}}},{type:"condition",label:"Condition",description:"Branch pipeline execution based on conditions",category:"control",icon:"git-branch",configSchema:{field:{type:"string"},operator:{type:"string"},value:{type:"string"}}},{type:"delay",label:"Delay",description:"Wait for a specified duration before continuing",category:"control",icon:"clock",configSchema:{durationMs:{type:"number"}}},{type:"approval",label:"Approval",description:"Pauses the run until someone approves it in VS Code; a rejection, or no answer in time, stops it",category:"control",icon:"user-check",configSchema:{message:{type:"string"},timeoutMinutes:{type:"number"}}},{type:"notification",label:"Notification",description:"Shows its message as a VS Code notification",category:"notification",icon:"bell",configSchema:{message:{type:"string"}}}],p=class{registry;constructor(){this.registry=new Map(y.map(e=>[e.type,e]))}getStepTypes(){return[...this.registry.values()]}getStepType(e){return this.registry.get(e)}getDefaultConfig(e){let r=this.registry.get(e);if(!r)return{};let o={};for(let[t,a]of Object.entries(r.configSchema)){let n=a;if(!(n.optional===!0||n.required===!0)){if("default"in n){o[t]=n.default;continue}switch(n.type){case"string":o[t]="";break;case"number":o[t]=0;break;case"array":o[t]=[];break;case"boolean":o[t]=!1;break;default:o[t]=null}}}return o}validateStepConfig(e,r){let o=this.registry.get(e);if(!o)return[`Unknown step type: ${e}`];let t=[];for(let[a,n]of Object.entries(o.configSchema)){let l=n,i=r[a],s=l.type;i!=null&&(s==="array"&&!Array.isArray(i)?t.push(`Field "${a}" must be an array`):s==="string"&&typeof i!="string"?t.push(`Field "${a}" must be a string`):s==="number"&&typeof i!="number"?t.push(`Field "${a}" must be a number`):s==="boolean"&&typeof i!="boolean"&&t.push(`Field "${a}" must be a boolean`))}return t}getStepCategories(){let e=new Set;for(let r of this.registry.values())e.add(r.category);return[...e]}};export{p as StepLibrary};
|
|
@@ -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}from"./chunk-
|
|
7
|
+
import{a}from"./chunk-6GQUZ4IP.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as SeedValidator};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __sandforgeRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __sandforgePath } from 'node:url';
|
|
3
|
+
import { dirname as __sandforgeDirname } from 'node:path';
|
|
4
|
+
const require = __sandforgeRequire(import.meta.url);
|
|
5
|
+
const __filename = __sandforgePath(import.meta.url);
|
|
6
|
+
const __dirname = __sandforgeDirname(__filename);
|
|
7
|
+
import{f as a,g as b,h as c,i as d,j as e,k as f,l as g}from"./chunk-MKTXJCXN.mjs";import"./chunk-GBGHJTPC.mjs";import"./chunk-YMDFF657.mjs";import"./chunk-YT22LMF7.mjs";import"./chunk-66NMFCWX.mjs";import"./chunk-XU25YA46.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-4TLYUZD5.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-HFUDCNU5.mjs";import"./chunk-XZISAZA6.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{d as diffOfPicked,b as heldInPlaceReason,g as planSelection,c as rewindPlan,a as rewindWriters,f as selectionPlanOf,e as snapshotRowsOf};
|