sandforge 1.79.0 → 1.81.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/bin/sandforge-pipeline.mjs +12 -0
- package/lib/{chunk-BN7A4GRQ.mjs → chunk-2IB7I3IQ.mjs} +1 -1
- package/lib/{chunk-PBI4BYWW.mjs → chunk-2NAIUKVL.mjs} +1 -1
- package/lib/chunk-2OIRJEYE.mjs +7 -0
- package/lib/{chunk-FOVVHGEP.mjs → chunk-2OZG6GRW.mjs} +1 -1
- package/lib/{chunk-5CD257T7.mjs → chunk-2Z54GB6X.mjs} +1 -1
- package/lib/chunk-2ZMGVBLW.mjs +7 -0
- package/lib/{chunk-4NAHW2D3.mjs → chunk-33ZX3A56.mjs} +1 -1
- package/lib/{chunk-4SNDMJP2.mjs → chunk-3AOKLIVE.mjs} +1 -1
- package/lib/{chunk-SIOZXPFG.mjs → chunk-3B5H24ZG.mjs} +1 -1
- package/lib/chunk-43K2C6H2.mjs +7 -0
- package/lib/chunk-4JKR4PTZ.mjs +8 -0
- package/lib/chunk-4L7FBOJS.mjs +8 -0
- package/lib/chunk-5344TZBT.mjs +11 -0
- package/lib/{chunk-SAR5622P.mjs → chunk-54HYHHVL.mjs} +1 -1
- package/lib/chunk-55LQD3Y3.mjs +7 -0
- package/lib/chunk-56MPPWLA.mjs +7 -0
- package/lib/chunk-5C5XEVZN.mjs +11 -0
- package/lib/chunk-5CKWGZX4.mjs +9 -0
- package/lib/{chunk-RSWDYIHY.mjs → chunk-5GBO4KD5.mjs} +1 -1
- package/lib/{chunk-GNC27UEU.mjs → chunk-5UT2ZBGF.mjs} +1 -1
- package/lib/chunk-5VQNKDFU.mjs +7 -0
- package/lib/chunk-5WGA5CZB.mjs +7 -0
- package/lib/chunk-5ZKCLBTN.mjs +474 -0
- package/lib/chunk-67CC7RAE.mjs +7 -0
- package/lib/{chunk-5O6JOMHS.mjs → chunk-6CDIIFNX.mjs} +1 -1
- package/lib/{chunk-AV5SWEHP.mjs → chunk-6FARZYMJ.mjs} +1 -1
- package/lib/{chunk-7UQD6V6F.mjs → chunk-6FMLW7PH.mjs} +1 -1
- package/lib/chunk-6IGEASOF.mjs +7 -0
- package/lib/{chunk-H2PJNIYJ.mjs → chunk-6NADW3OI.mjs} +1 -1
- package/lib/chunk-6SEDOIO3.mjs +10 -0
- package/lib/{chunk-AUTM6H6Z.mjs → chunk-742SSN7I.mjs} +1 -1
- package/lib/chunk-7DALDJMO.mjs +7 -0
- package/lib/chunk-7PK5QDQI.mjs +7 -0
- package/lib/chunk-AELFEK3G.mjs +7 -0
- package/lib/chunk-AITNZWLB.mjs +9 -0
- package/lib/{chunk-HV2MXMGI.mjs → chunk-AJPSGVMD.mjs} +1 -1
- package/lib/{chunk-OTWRDD6L.mjs → chunk-BNO5GIJ6.mjs} +1 -1
- package/lib/{chunk-K2FBZIXY.mjs → chunk-BWWQXU2B.mjs} +1 -1
- package/lib/{chunk-IC2C2GOF.mjs → chunk-BXZ73A5M.mjs} +1 -1
- package/lib/chunk-BZFIOZS3.mjs +156 -0
- package/lib/{chunk-XBG5SP6Q.mjs → chunk-C4YGSK6W.mjs} +1 -1
- package/lib/chunk-CAFUNR6D.mjs +7 -0
- package/lib/chunk-CULAOP3U.mjs +7 -0
- package/lib/chunk-D62KWDDT.mjs +7 -0
- package/lib/{chunk-BILZ3SSR.mjs → chunk-D7P7DTWL.mjs} +1 -1
- package/lib/chunk-DHGPDSXS.mjs +7 -0
- package/lib/{chunk-ZXH4MBWP.mjs → chunk-DHIW4IO5.mjs} +1 -1
- package/lib/{chunk-NM4MDLK4.mjs → chunk-DMBR24CK.mjs} +1 -1
- package/lib/chunk-DPYTG6DM.mjs +48 -0
- package/lib/chunk-DQR5NDMI.mjs +7 -0
- package/lib/chunk-DXOXLUZA.mjs +7 -0
- package/lib/chunk-E2OBAWSH.mjs +7 -0
- package/lib/chunk-E2YJVSX6.mjs +10 -0
- package/lib/chunk-EAFLDSQ2.mjs +7 -0
- package/lib/{chunk-HCIDVIOW.mjs → chunk-EH5YUA5W.mjs} +1 -1
- package/lib/{chunk-2BVTCNWA.mjs → chunk-EOSEMFPU.mjs} +1 -1
- package/lib/chunk-ETT5GP4P.mjs +13 -0
- package/lib/{chunk-3SRXFZSD.mjs → chunk-FDGFUEK3.mjs} +1 -1
- package/lib/{chunk-3DCUADVK.mjs → chunk-FLNLG43R.mjs} +1 -1
- package/lib/{chunk-HTJ5OGP5.mjs → chunk-FSDO4DJA.mjs} +1 -1
- package/lib/{chunk-HJKM3E56.mjs → chunk-FSZTXLNW.mjs} +1 -1
- package/lib/chunk-FTA5LOVX.mjs +7 -0
- package/lib/chunk-G4VXPS3A.mjs +7 -0
- package/lib/chunk-GF247DA7.mjs +7 -0
- package/lib/{chunk-QRV2OSIS.mjs → chunk-GK7VEYFM.mjs} +1 -1
- package/lib/{chunk-5MMXFWPD.mjs → chunk-GR3NGDVM.mjs} +1 -1
- package/lib/{chunk-P7GSGFJO.mjs → chunk-GTIXJCGS.mjs} +1 -1
- package/lib/{chunk-342FN7AO.mjs → chunk-GWRKS3AL.mjs} +1 -1
- package/lib/{chunk-LQ4DRFUH.mjs → chunk-GYKNCYES.mjs} +1 -1
- package/lib/{chunk-WIO4XO4F.mjs → chunk-HFSBDM7B.mjs} +1 -1
- package/lib/chunk-HVC5CYIB.mjs +7 -0
- package/lib/{chunk-EQF2IJS2.mjs → chunk-HYBH5PFM.mjs} +1 -1
- package/lib/chunk-HYOOJVR6.mjs +7 -0
- package/lib/{chunk-TQX3PURV.mjs → chunk-IBURU7T7.mjs} +1 -1
- package/lib/chunk-ICIYL45C.mjs +7 -0
- package/lib/{chunk-K22PA4XL.mjs → chunk-IKGHRYCN.mjs} +1 -1
- package/lib/chunk-IM2XA6JI.mjs +7 -0
- package/lib/{chunk-P2PJYWGQ.mjs → chunk-J6G23RUI.mjs} +1 -1
- package/lib/{chunk-JVL444U5.mjs → chunk-JU2XEKEO.mjs} +1 -1
- package/lib/{chunk-H45UXY6G.mjs → chunk-K55LH4ZQ.mjs} +1 -1
- package/lib/chunk-K5HV4YRO.mjs +7 -0
- package/lib/{chunk-IAZB4WIL.mjs → chunk-K77NR3UK.mjs} +1 -1
- package/lib/chunk-KE2PGD6C.mjs +7 -0
- package/lib/chunk-KGYXLSQ5.mjs +37 -0
- package/lib/{chunk-TEOLMRDO.mjs → chunk-KNIRA333.mjs} +1 -1
- package/lib/chunk-KOQV4WXC.mjs +8 -0
- package/lib/{chunk-PNCONNFJ.mjs → chunk-KRNFVAGC.mjs} +1 -1
- package/lib/chunk-L5FGY6YA.mjs +7 -0
- package/lib/{chunk-MTMH6H2A.mjs → chunk-LCDPCUXS.mjs} +1 -1
- package/lib/{chunk-YAZO75G2.mjs → chunk-LNXBCE7E.mjs} +1 -1
- package/lib/{chunk-ZOVSMN5C.mjs → chunk-LO527YLT.mjs} +1 -1
- package/lib/chunk-MAHZMPMZ.mjs +7 -0
- package/lib/{chunk-QQZZMKU3.mjs → chunk-MHW6DV6T.mjs} +1 -1
- package/lib/{chunk-2YIV2OB2.mjs → chunk-MIDBQ7SD.mjs} +1 -1
- package/lib/{chunk-6EBMEGZB.mjs → chunk-MKNAZPOT.mjs} +1 -1
- package/lib/{chunk-NTDN2JQZ.mjs → chunk-MNITSYI2.mjs} +8 -8
- package/lib/chunk-MO3N5XVV.mjs +341 -0
- package/lib/{chunk-SBIMVCXT.mjs → chunk-MS4FJDFD.mjs} +9 -9
- package/lib/chunk-MWLFFVQV.mjs +8 -0
- package/lib/chunk-N6HHNR6J.mjs +7 -0
- package/lib/chunk-N7J6NJQ6.mjs +7 -0
- package/lib/chunk-NJ3EOEHS.mjs +9 -0
- package/lib/chunk-NWPQF5XR.mjs +7 -0
- package/lib/{chunk-PUOX4NBJ.mjs → chunk-NWVVCZUK.mjs} +1 -1
- package/lib/{chunk-DLDX6RRC.mjs → chunk-O6ADMP36.mjs} +1 -1
- package/lib/chunk-O7DAFE6M.mjs +14 -0
- package/lib/chunk-OEHVAJAB.mjs +7 -0
- package/lib/chunk-OETEC3P7.mjs +7 -0
- package/lib/{chunk-GCOB7K5N.mjs → chunk-OHEOJISY.mjs} +1 -1
- package/lib/chunk-OIIL4NVI.mjs +7 -0
- package/lib/chunk-OMZJ37JI.mjs +15 -0
- package/lib/{chunk-NZ5ZZLKS.mjs → chunk-ONMBSACW.mjs} +1 -1
- package/lib/chunk-OQQHNYR7.mjs +272 -0
- package/lib/{chunk-AAVJ5XVX.mjs → chunk-OU5W7SCB.mjs} +1 -1
- package/lib/{chunk-RSYICMZG.mjs → chunk-OVOLG3AL.mjs} +1 -1
- package/lib/{chunk-F74IHMGL.mjs → chunk-OXKZ4Y3B.mjs} +1 -1
- package/lib/{chunk-W7KFAY55.mjs → chunk-OZNLOV4U.mjs} +1 -1
- package/lib/{chunk-TYYOBZMU.mjs → chunk-PC247GKX.mjs} +1 -1
- package/lib/chunk-PPGDAUEQ.mjs +7 -0
- package/lib/{chunk-RACDTRZA.mjs → chunk-PYUEHBA6.mjs} +1 -1
- package/lib/{chunk-TLH7AD35.mjs → chunk-PZBZ7MNC.mjs} +1 -1
- package/lib/{chunk-DBFJB2B6.mjs → chunk-QIRO4HTE.mjs} +1 -1
- package/lib/{chunk-PZTSVQSF.mjs → chunk-QXLZINZB.mjs} +1 -1
- package/lib/chunk-R2BJWO5N.mjs +20 -0
- package/lib/chunk-R6TF26V4.mjs +10 -0
- package/lib/{chunk-P42X3B4D.mjs → chunk-RKALOKAU.mjs} +1 -1
- package/lib/chunk-SQGP46QS.mjs +7 -0
- package/lib/chunk-SU65Z2BA.mjs +7 -0
- package/lib/chunk-SW2NUKQL.mjs +9 -0
- package/lib/chunk-T26C576X.mjs +9 -0
- package/lib/{chunk-3OHPD72J.mjs → chunk-T3PLRQ2T.mjs} +1 -1
- package/lib/chunk-T5VAULLQ.mjs +7 -0
- package/lib/chunk-TEIBWMJM.mjs +7 -0
- package/lib/chunk-TKQQVB2D.mjs +9 -0
- package/lib/{chunk-RAAANPPG.mjs → chunk-TPHXRHOA.mjs} +1 -1
- package/lib/chunk-TQ2TQHTT.mjs +9 -0
- package/lib/{chunk-IEYG5ATY.mjs → chunk-TQM2XJ27.mjs} +1 -1
- package/lib/{chunk-X65MT4W3.mjs → chunk-UCHAZ4ZU.mjs} +1 -1
- package/lib/chunk-UIUPPEFB.mjs +7 -0
- package/lib/{chunk-QPF6C5MX.mjs → chunk-UT27HXE7.mjs} +1 -1
- package/lib/{chunk-J7HVXMSW.mjs → chunk-UUSLTW5V.mjs} +1 -1
- package/lib/chunk-V2QO6KOE.mjs +19 -0
- package/lib/chunk-V473C7LY.mjs +7 -0
- package/lib/chunk-V4RKM4QZ.mjs +8 -0
- package/lib/chunk-VSU74RQ3.mjs +9 -0
- package/lib/chunk-VV3B6IC3.mjs +7 -0
- package/lib/chunk-W2AAGIZF.mjs +7 -0
- package/lib/{chunk-WR2GIKWE.mjs → chunk-WB2RIVO3.mjs} +1 -1
- package/lib/chunk-WD47PGUS.mjs +10 -0
- package/lib/{chunk-3CA767QB.mjs → chunk-WEZLXE34.mjs} +1 -1
- package/lib/{chunk-WFEB5X4U.mjs → chunk-WI4HYWV6.mjs} +1 -1
- package/lib/{chunk-AR7BE5O2.mjs → chunk-WM5JI4JI.mjs} +1 -1
- package/lib/chunk-WWTXRWNZ.mjs +7 -0
- package/lib/{chunk-7EANH5PY.mjs → chunk-WZQEK4WT.mjs} +1 -1
- package/lib/{chunk-ZJKCWBRJ.mjs → chunk-X2ZVSQ54.mjs} +1 -1
- package/lib/{chunk-SFURUNJM.mjs → chunk-XC2QKQT5.mjs} +1 -1
- package/lib/chunk-XC54KKKC.mjs +7 -0
- package/lib/chunk-XEB6HZ34.mjs +7 -0
- package/lib/chunk-XGKSSCW7.mjs +7 -0
- package/lib/chunk-XIZ5LMQM.mjs +7 -0
- package/lib/{chunk-RFEO2KAN.mjs → chunk-Y5ZCPY36.mjs} +1 -1
- package/lib/{chunk-TBZMC2VV.mjs → chunk-YCSFP6ER.mjs} +4 -4
- package/lib/{chunk-YBU4Z4QV.mjs → chunk-YHIOS2PU.mjs} +1 -1
- package/lib/chunk-YIGFYZQY.mjs +7 -0
- package/lib/chunk-YJEXE6HZ.mjs +925 -0
- package/lib/{chunk-57VHUYNG.mjs → chunk-YOGMP72T.mjs} +4 -4
- package/lib/chunk-ZRUDYB7O.mjs +7 -0
- package/lib/{chunk-55HEMHEG.mjs → chunk-ZUA5BNAO.mjs} +1 -1
- package/lib/chunk-ZWCRWF7E.mjs +7 -0
- package/lib/{chunk-VHI54FBK.mjs → chunk-ZWZXQTAK.mjs} +53 -53
- package/lib/sandforge-autopilot.mjs +29 -24
- package/lib/sandforge-backup.mjs +67 -32
- package/lib/sandforge-checkpoint.mjs +1 -347
- package/lib/sandforge-cleanup.mjs +14 -10
- package/lib/sandforge-clone.mjs +1 -1
- package/lib/sandforge-compare.mjs +9 -8
- package/lib/sandforge-dataops.mjs +1 -1
- package/lib/sandforge-empty.mjs +15 -15
- package/lib/sandforge-env.mjs +101 -101
- package/lib/sandforge-frozen.mjs +1 -257
- package/lib/sandforge-mcp.mjs +33 -14
- package/lib/sandforge-monitor.mjs +7 -7
- package/lib/sandforge-pipeline.mjs +88 -0
- package/lib/sandforge-seed.mjs +1 -1
- package/lib/sandforge-sync.mjs +1 -1
- package/lib/sandforge.mjs +6 -6
- package/package.json +2 -1
- package/lib/chunk-2S5OMIIA.mjs +0 -7
- package/lib/chunk-36U7IQ6Y.mjs +0 -25
- package/lib/chunk-3F5YMM2F.mjs +0 -7
- package/lib/chunk-3RYLICRX.mjs +0 -7
- package/lib/chunk-42RER7V4.mjs +0 -14
- package/lib/chunk-4GL773D5.mjs +0 -7
- package/lib/chunk-4HFRHFGQ.mjs +0 -7
- package/lib/chunk-4U6NXJNL.mjs +0 -7
- package/lib/chunk-4XZ5YT5O.mjs +0 -7
- package/lib/chunk-5AJRHRXA.mjs +0 -20
- package/lib/chunk-5HMAPZBV.mjs +0 -7
- package/lib/chunk-5P4PHJRL.mjs +0 -9
- package/lib/chunk-5QKTYCWE.mjs +0 -11
- package/lib/chunk-6LAXTAVN.mjs +0 -7
- package/lib/chunk-6MUEPV7M.mjs +0 -9
- package/lib/chunk-6QSM2WIH.mjs +0 -10
- package/lib/chunk-75ADZS6B.mjs +0 -7
- package/lib/chunk-ALJVEUUS.mjs +0 -7
- package/lib/chunk-ALUFROGA.mjs +0 -7
- package/lib/chunk-B45CNPUX.mjs +0 -47
- package/lib/chunk-BS5T3MOQ.mjs +0 -7
- package/lib/chunk-CGWXQX75.mjs +0 -7
- package/lib/chunk-D3QRXG63.mjs +0 -787
- package/lib/chunk-EEVVGGM6.mjs +0 -7
- package/lib/chunk-ENLBYECD.mjs +0 -7
- package/lib/chunk-EQOQASDQ.mjs +0 -7
- package/lib/chunk-FQBRBBY4.mjs +0 -7
- package/lib/chunk-GAM726CK.mjs +0 -7
- package/lib/chunk-HJC7AIBK.mjs +0 -7
- package/lib/chunk-HUMEKZT5.mjs +0 -8
- package/lib/chunk-I3JKJTLO.mjs +0 -110
- package/lib/chunk-I7O6C2B5.mjs +0 -8
- package/lib/chunk-KLX67VPL.mjs +0 -7
- package/lib/chunk-L776PUMV.mjs +0 -7
- package/lib/chunk-LRFAIUN7.mjs +0 -7
- package/lib/chunk-LV6G4XTK.mjs +0 -7
- package/lib/chunk-MYTIL2JD.mjs +0 -10
- package/lib/chunk-NEVXIGR6.mjs +0 -10
- package/lib/chunk-NGSMZZDA.mjs +0 -7
- package/lib/chunk-NHWE66K5.mjs +0 -7
- package/lib/chunk-OQOZAPCI.mjs +0 -7
- package/lib/chunk-PA3MKJVH.mjs +0 -7
- package/lib/chunk-QROPNEGY.mjs +0 -14
- package/lib/chunk-QWT2C74M.mjs +0 -7
- package/lib/chunk-RH3N2H7P.mjs +0 -7
- package/lib/chunk-SRQDABQ2.mjs +0 -15
- package/lib/chunk-SVS6UMDU.mjs +0 -323
- package/lib/chunk-TNXUU6W7.mjs +0 -14
- package/lib/chunk-VGW4MXXZ.mjs +0 -7
- package/lib/chunk-VXHDBYMI.mjs +0 -7
- package/lib/chunk-WJY54JO7.mjs +0 -13
- package/lib/chunk-WRU5FJFC.mjs +0 -7
- package/lib/chunk-X2PY6MWZ.mjs +0 -7
- package/lib/chunk-XEFDB2R4.mjs +0 -7
- package/lib/chunk-XETCPL7E.mjs +0 -7
- package/lib/chunk-Y5CGXLUB.mjs +0 -7
- package/lib/chunk-Y6J6QFI2.mjs +0 -7
- package/lib/chunk-YMJVMFPY.mjs +0 -7
- package/lib/chunk-YPSRZRIT.mjs +0 -7
- package/lib/chunk-YS4G22C2.mjs +0 -7
- package/lib/chunk-YW2SBL4Z.mjs +0 -7
- package/lib/chunk-Z7X534S4.mjs +0 -10
- package/lib/chunk-ZE6HKRR4.mjs +0 -9
- package/lib/chunk-ZLZRU6MO.mjs +0 -7
- package/lib/chunk-ZPYJPGDK.mjs +0 -7
- package/lib/chunk-ZQOZ4EFW.mjs +0 -7
- package/lib/chunk-ZUTYVST5.mjs +0 -7
- package/lib/chunk-ZYEE34WO.mjs +0 -7
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { createRequire as __sandforgeRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __sandforgePath } from 'node:url';
|
|
3
|
+
import { dirname as __sandforgeDirname } from 'node:path';
|
|
4
|
+
const require = __sandforgeRequire(import.meta.url);
|
|
5
|
+
const __filename = __sandforgePath(import.meta.url);
|
|
6
|
+
const __dirname = __sandforgeDirname(__filename);
|
|
7
|
+
import{q as Nt}from"./chunk-MO3N5XVV.mjs";import{a as It}from"./chunk-2NAIUKVL.mjs";import{i as pe,j as Bt,l as Ut,m as Pe,n as Wt,o as Gt,p as qt,q as Vt,r as he,s as me,w as Kt}from"./chunk-V2QO6KOE.mjs";import{g as _t}from"./chunk-WD47PGUS.mjs";import{e as xt,g as Mt}from"./chunk-5C5XEVZN.mjs";import{f as Dt,h as Pt}from"./chunk-DXOXLUZA.mjs";import{a as Ht}from"./chunk-TW3N6W5Z.mjs";import{Db as Lt,Wa as oe,c as je,d as Le,e as bt,f as At,h as $t,i as Ne,j as kt,k as Rt,l as St,lb as Ie,m as Ot,mb as Tt,pb as De,q as Ft,qb as fe,sb as zt,tb as ne,xb as Ct,yb as jt}from"./chunk-YJEXE6HZ.mjs";import{a as te,d as gt,j as Ce,l as yt,m as vt}from"./chunk-O7DAFE6M.mjs";import{b as de,e as at}from"./chunk-BZ24IAP5.mjs";import{a as ke}from"./chunk-SCKUIE3R.mjs";import{c as ee,d as ue}from"./chunk-6FARZYMJ.mjs";import{b as le}from"./chunk-CAFUNR6D.mjs";import{m as wt}from"./chunk-KGYXLSQ5.mjs";import{d as ut}from"./chunk-T63U4OZJ.mjs";import{b as st,c as Se}from"./chunk-HVC5CYIB.mjs";import{B as Z,s as Ee,u as Fe,v as Te}from"./chunk-T26C576X.mjs";import{Ic as ht,Jc as mt,eb as ze,hb as ce,kb as ct,lb as ft,mc as J,tc as pt}from"./chunk-KOQV4WXC.mjs";import{q as lt}from"./chunk-2OIRJEYE.mjs";import{b as rt,f as it,g as dt,h as Et}from"./chunk-LCDPCUXS.mjs";import{E as Oe}from"./chunk-55LQD3Y3.mjs";import{Ad as ot,Hd as nt,xc as et,xd as tt,yd as Re,zd as ie}from"./chunk-DPYTG6DM.mjs";import{existsSync as _e,mkdirSync as mo,readdirSync as go,readFileSync as ve}from"node:fs";import{dirname as wo,join as G}from"node:path";import{homedir as yo}from"node:os";var vo=`sandforge frozen \u2014 build and replay a Frozen Dataset, without the editor.
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
npx sandforge frozen <step> --config <file> [options]
|
|
11
|
+
|
|
12
|
+
Steps:
|
|
13
|
+
select pick one root per combination of the coverage matrix (needs --source)
|
|
14
|
+
extract read, pseudonymize, check and freeze those roots (needs --source)
|
|
15
|
+
load replay the frozen dataset into a sandbox or a Developer Edition
|
|
16
|
+
\u2014 WRITES (needs --target);
|
|
17
|
+
what the target runs as it inserts and updates is named first, and takes
|
|
18
|
+
--accept-automation or --mute-automation
|
|
19
|
+
verify check the last load against the dataset (needs --target)
|
|
20
|
+
remove delete the records a load created, the last first \u2014 DELETES (needs --target);
|
|
21
|
+
what the target runs as they go is named first, and takes --accept-automation
|
|
22
|
+
or --mute-automation; with --preview, say what it would delete, and delete
|
|
23
|
+
nothing
|
|
24
|
+
status what the store knows so far
|
|
25
|
+
|
|
26
|
+
Required:
|
|
27
|
+
--config <file> the project configuration, as the panel saves it (JSON)
|
|
28
|
+
|
|
29
|
+
Options:
|
|
30
|
+
--source <alias> sf CLI alias of the org the dataset is read from
|
|
31
|
+
--target <alias> sf CLI alias of the sandbox, or Developer Edition org, it is
|
|
32
|
+
loaded into
|
|
33
|
+
--author <name> who froze the dataset, for the manifest (default: sandforge)
|
|
34
|
+
--salt-file <file> the file holding the pseudonymization salt, when
|
|
35
|
+
SANDFORGE_FROZEN_SALT is not set
|
|
36
|
+
--store <file> where the run keeps its state (default: <sasDir>/cli-store.json)
|
|
37
|
+
--pilot load one root folder only
|
|
38
|
+
--reload replace the loads before: purge what earlier loads created,
|
|
39
|
+
then load again. Refused before anything is written when a
|
|
40
|
+
removal of those loads would leave records in the org \u2014
|
|
41
|
+
records changed since, kept for records that stay under them
|
|
42
|
+
(a contact made by hand since under one of their accounts,
|
|
43
|
+
which the org would delete along), of an object the user may
|
|
44
|
+
not delete, out of the user's sight or unread: take the load
|
|
45
|
+
back with remove first (--include-changed takes what changed
|
|
46
|
+
since, and what was added under them since). Refused as well
|
|
47
|
+
when one of them was recorded before loads kept what they
|
|
48
|
+
created, which no removal takes: refresh the sandbox, or find
|
|
49
|
+
what your user created that day with
|
|
50
|
+
${ke("cleanup")}, its dry run
|
|
51
|
+
first, then delete it. Refused
|
|
52
|
+
the same way when the purge would have the org delete along a
|
|
53
|
+
record the reload finds again by its keys \u2014 a quote under the
|
|
54
|
+
opportunity an earlier load wrote: give that parent identity
|
|
55
|
+
keys too, or take the load back first. What the target's
|
|
56
|
+
automation likely made for a load holds nothing with --sweep,
|
|
57
|
+
which takes it first. What the target runs as the purge
|
|
58
|
+
deletes is read and named first, and nothing is written
|
|
59
|
+
while something fires unless --accept-automation or
|
|
60
|
+
--mute-automation answers it. The purge takes what those
|
|
61
|
+
loads created, not what the target's automation made for
|
|
62
|
+
them: --sweep takes that too. With --pilot, a reload purges
|
|
63
|
+
nothing, and is not asked
|
|
64
|
+
--gone-first <file> with load --reload --dry-run: the records taken back before
|
|
65
|
+
the reload runs, a JSON array of their ids \u2014 hanging from the
|
|
66
|
+
loads' records, they hold nothing. sandforge env gives it what
|
|
67
|
+
its apply takes back first; a reload that runs reads what is
|
|
68
|
+
still there
|
|
69
|
+
--max-total <n> with load: the most records it may insert \u2014 the count its dry
|
|
70
|
+
run gave. A load, or a reload, that would insert more is
|
|
71
|
+
refused before anything is written, the purge included; a dry
|
|
72
|
+
run says it would be, exit 1
|
|
73
|
+
--dry-run with load: say what the load would do \u2014 per object, what it
|
|
74
|
+
would insert, link, drop, rewrite and purge \u2014 and write nothing
|
|
75
|
+
--write-encrypted with load: write the fields the target encrypts as the dataset
|
|
76
|
+
holds them, though its manifest does not say its extraction
|
|
77
|
+
left out what it read masked \u2014 they may hold masks such as
|
|
78
|
+
****1234 (left out otherwise, each named)
|
|
79
|
+
--mute-automation with load or remove: mute the target's automation for that
|
|
80
|
+
step through its own bypass \u2014 assign the user it writes as,
|
|
81
|
+
for the step alone, the permission sets holding the custom
|
|
82
|
+
permissions its flows, processes and workflow rules test to
|
|
83
|
+
stay quiet, those of what --sweep deletes included, and take
|
|
84
|
+
them back as it ends; what no bypass keeps quiet still runs,
|
|
85
|
+
and is named, and a load or a removal then needs
|
|
86
|
+
--accept-automation.
|
|
87
|
+
Refused on a production org and for a user who cannot assign
|
|
88
|
+
permission sets, exit 1; with --dry-run or --preview, says
|
|
89
|
+
what would be muted and assigns nothing
|
|
90
|
+
--accept-automation with load: write although the target runs flows, Apex
|
|
91
|
+
triggers, processes or workflow rules as the load inserts
|
|
92
|
+
its records and updates them \u2014 what --mute-automation
|
|
93
|
+
keeps quiet and a bypass the user holds aside \u2014 or could
|
|
94
|
+
not say what it runs; with remove, or load --reload:
|
|
95
|
+
delete although it runs them as the records go, those
|
|
96
|
+
--sweep deletes included \u2014 before or after a delete, or
|
|
97
|
+
as an activated order is set back to Draft for its
|
|
98
|
+
delete. Each is named before anything is written or
|
|
99
|
+
deleted; without the flag the load or the reload writes
|
|
100
|
+
nothing (AUTOMATION_NOT_ACCEPTED), the removal deletes
|
|
101
|
+
nothing, exit 1; --dry-run says so
|
|
102
|
+
--accept-emails with load: write although the target delivers every email
|
|
103
|
+
what still runs sends as the records go in, a reload's
|
|
104
|
+
purge and sweep included (Setup > Deliverability: All
|
|
105
|
+
email), or would not say whether it does: without it
|
|
106
|
+
such a load is refused, exit 1 (EMAILS_NOT_ACCEPTED),
|
|
107
|
+
nothing written. Read only when something that still
|
|
108
|
+
runs sends one, with one line of anonymous Apex that
|
|
109
|
+
sends nothing; on System email only or No access it is
|
|
110
|
+
not needed. The emails are counted too, on the records
|
|
111
|
+
of the dataset, at most, against what the target has
|
|
112
|
+
left today: past it, the load is refused whatever the
|
|
113
|
+
flag, exit 1 (FROZEN_EMAILS_EXCEEDED). --mute-automation
|
|
114
|
+
keeps quiet what tests the org's bypass; what an Apex
|
|
115
|
+
trigger sends is read nowhere. --dry-run says it all,
|
|
116
|
+
and what a load would be refused for
|
|
117
|
+
${bt({run:"the load",simulation:"--dry-run",step:"with load: ",note:["Taken by this command once the load may write, before","the load's lease; deleted when the load is refused before","it writes or reports it wrote nothing, and kept when it","stops or fails part way: what it wrote then is not told","here."]})}
|
|
118
|
+
--include-changed remove also the records changed since the load, and what
|
|
119
|
+
was added to them since (kept otherwise); with load
|
|
120
|
+
--reload --sweep, the sweep of each load replaced takes
|
|
121
|
+
too what it finds changed since that load, which it
|
|
122
|
+
keeps and names otherwise, the load kept recorded for
|
|
123
|
+
a later sweep, and the reload no partial for them
|
|
124
|
+
--sweep with remove: before the load's records go, delete too what
|
|
125
|
+
the target's automation made for the load, that the
|
|
126
|
+
load's mapping does not hold: what the load's user
|
|
127
|
+
created under the load's records, what they point at,
|
|
128
|
+
or what hangs from those, three links at most, at most
|
|
129
|
+
a minute after the record it is tied to \u2014 in the
|
|
130
|
+
objects the load wrote and their children, tasks,
|
|
131
|
+
events, feed, email messages, notes, case comments, and
|
|
132
|
+
the objects the target's flows create; the window is
|
|
133
|
+
the load's writes, from a second before the first to a
|
|
134
|
+
minute after the last. What a record of the load points
|
|
135
|
+
at by a lookup the org refuses the delete for goes once
|
|
136
|
+
that record is gone. Listed and kept: what is tied to
|
|
137
|
+
the load but came later, up to 15 minutes, or as the
|
|
138
|
+
org's Automated Process user; and what the load's user
|
|
139
|
+
created in the window tied to nothing of it. Such
|
|
140
|
+
records then keep none of the load's records as records
|
|
141
|
+
that stay. A sweep refused, or that did not take all it was
|
|
142
|
+
asked to, exits 3, and ends partial a removal that took
|
|
143
|
+
every record of the load; one that left records of its own
|
|
144
|
+
keeps its own status. Once the load's records went already,
|
|
145
|
+
the sweep runs alone, the way to take what such a sweep
|
|
146
|
+
left (off otherwise: a removal that took the load's
|
|
147
|
+
records then reads what a sweep would take now, read
|
|
148
|
+
only, and names what stays and the option that takes
|
|
149
|
+
it, "notSwept" with --json). It sweeps too, each in its
|
|
150
|
+
own window, every other load recorded whose records
|
|
151
|
+
went \u2014 a load a reload replaced, kept for what its
|
|
152
|
+
sweep left \u2014, and lets it go once that sweep took all
|
|
153
|
+
it found. With load --reload: the sweep of each load
|
|
154
|
+
the reload replaces, as its removal sweeps it, around
|
|
155
|
+
the purge; what the target runs as it deletes is named
|
|
156
|
+
once it has read what it takes, before the first
|
|
157
|
+
delete, and answered as the purge's; with --dry-run, it
|
|
158
|
+
lists what it would take. One refused, or that did not
|
|
159
|
+
take all it was asked to, exits 3
|
|
160
|
+
--sweep-late with --sweep: take too what it lists as made late; with
|
|
161
|
+
--sweep-list, say what it would take
|
|
162
|
+
--sweep-untied with --sweep: take too what it lists as tied to nothing of
|
|
163
|
+
the load; with --sweep-list, say what it would take;
|
|
164
|
+
refused when another run wrote to the target
|
|
165
|
+
in the window \u2014 a load swept with it is none, a load
|
|
166
|
+
this command ran from another sas into the org is one
|
|
167
|
+
\u2014, or when that user created records in the window on
|
|
168
|
+
objects neither the load nor the automation reaches
|
|
169
|
+
(hand work, likely)
|
|
170
|
+
--sweep-list with remove: list what --sweep would delete, per object
|
|
171
|
+
with a few names and how many it ties to the load, and
|
|
172
|
+
for each other load it sweeps with it, and delete nothing;
|
|
173
|
+
exit 3 when it says a sweep is refused, as --sweep would
|
|
174
|
+
--preview with remove: say what the removal would do, per object \u2014 the
|
|
175
|
+
records it would delete, those it would keep as changed since
|
|
176
|
+
the load and who changed them, those gone already, those it
|
|
177
|
+
cannot see, and those it would leave because the user may not
|
|
178
|
+
delete them \u2014 what the target runs as they go, and what it
|
|
179
|
+
would be refused for, that automation without
|
|
180
|
+
--accept-automation included. It deletes nothing, writes
|
|
181
|
+
nothing to the sas and asks nothing; it exits 0 once it has
|
|
182
|
+
said it. It cannot know what hangs from the records, which a
|
|
183
|
+
removal reads at each object's turn. With --sweep, it lists
|
|
184
|
+
what the sweep would take, and reads what fires on it with
|
|
185
|
+
the load's own. Not with --sweep-list
|
|
186
|
+
--yes do not ask before a load writes or a removal deletes: a
|
|
187
|
+
removal asks last, once what it deletes and what the
|
|
188
|
+
target runs as they go are said. Without it, a step
|
|
189
|
+
with no terminal to answer the question \u2014 a CI step \u2014
|
|
190
|
+
stops there, exit 2, and writes nothing
|
|
191
|
+
--json emit what the panel would receive, every other line on
|
|
192
|
+
stderr; a step that ends before its request, refused or
|
|
193
|
+
with nothing to do, says "ended": true. Beside it, "step";
|
|
194
|
+
"dataset" \u2014 its folder, its digest (sha256 of the files a load
|
|
195
|
+
reads, the manifest less the verdict a verification writes
|
|
196
|
+
into it) and its version \u2014 for extract, load and verify;
|
|
197
|
+
"mapping", the file in the sas naming the records the loads
|
|
198
|
+
into the target created, for load, verify and remove; per
|
|
199
|
+
object, what the step counted ("objects"); how a load or a
|
|
200
|
+
removal ended ("status"); verify's verdict, and a load's, per
|
|
201
|
+
object ("verdict"); what a dry run or a
|
|
202
|
+
removal's preview would be refused for ("refusals"), with the
|
|
203
|
+
code of each ("refusalCodes"), as its line names it: a load
|
|
204
|
+
would be refused (CODE): ..., a removal would be refused
|
|
205
|
+
(CODE): ...; and what refused a load before it wrote \u2014 what
|
|
206
|
+
runs as it writes, its purge, its checkpoint, its emails or
|
|
207
|
+
its mute \u2014 or a removal
|
|
208
|
+
before its first delete \u2014 what fires as it deletes, its mute
|
|
209
|
+
or Production Guard \u2014 ("refused": {"code", "message"}), as
|
|
210
|
+
its line names it: refused (CODE): ...
|
|
211
|
+
--help this text
|
|
212
|
+
|
|
213
|
+
The salt that makes pseudonyms repeatable is read from SANDFORGE_FROZEN_SALT,
|
|
214
|
+
or else from --salt-file, and never made up here: an extraction without one is
|
|
215
|
+
refused. The editor keeps its own in VS Code's secret storage; copy it from there
|
|
216
|
+
with "SandForge: Copy Frozen Dataset Salt" to extract the same pseudonyms.
|
|
217
|
+
|
|
218
|
+
The graph a selection or an extraction discovers is kept in the sas
|
|
219
|
+
(discovery.json) and reused by the next one while the source's schema has not
|
|
220
|
+
changed and a day has not gone by: each says "graph reused from <step>" or
|
|
221
|
+
"rediscovered: <why>".
|
|
222
|
+
|
|
223
|
+
Ctrl-C stops a step after the call under way, a load recorded in the sas with
|
|
224
|
+
what it wrote, which remove takes back; a SIGTERM \u2014 a CI job cancelled or timed
|
|
225
|
+
out \u2014 or a SIGHUP stops it the same way. Ctrl-C again ends it at once.
|
|
226
|
+
|
|
227
|
+
Exit codes: 0 the step finished \u2014 a removal with nothing to take included, and a
|
|
228
|
+
removal's preview once said, its refusals included \u2014, and verify's verdict is
|
|
229
|
+
PASSED; 1 it failed or could not start, verify's verdict is FAILED, a dry run says
|
|
230
|
+
the load would be refused, a load was refused before it wrote for what the target
|
|
231
|
+
runs as it writes (AUTOMATION_NOT_ACCEPTED without --accept-automation), for its
|
|
232
|
+
emails (EMAILS_NOT_ACCEPTED without --accept-emails, FROZEN_EMAILS_EXCEEDED) or for
|
|
233
|
+
the data storage its records take past what the target has left
|
|
234
|
+
(FROZEN_STORAGE_EXCEEDED: --pilot, or a smaller dataset), or a removal
|
|
235
|
+
stopped before its first delete at what the target runs, without
|
|
236
|
+
--accept-automation; 2 a bad command line, or a question with
|
|
237
|
+
no terminal to answer it (give --yes); 3 verify's verdict is PARTIAL, a load
|
|
238
|
+
completed with errors, the verification it runs after it was FAILED or PARTIAL, or
|
|
239
|
+
the sweep of a reload did not take all it was asked to, or a removal left records
|
|
240
|
+
of the load or its sweep did not take all it was asked to; 4 verify's verdict is
|
|
241
|
+
UNSTABLE: no two readings agreed; 130 Ctrl-C stopped the step, 143 a SIGTERM, 129 a
|
|
242
|
+
SIGHUP. A load is judged by its own report, which ends partial on a verification
|
|
243
|
+
FAILED or PARTIAL; one UNSTABLE is said, and the verify step gives it a code.
|
|
244
|
+
`,Xt=["select","extract","load","verify","remove","status"],bo={words:1,switches:["--pilot","--reload","--dry-run","--write-encrypted","--mute-automation","--accept-automation","--include-changed","--accept-emails","--sweep","--sweep-list",...Ct,"--preview","--yes","--json",...Le.switches],values:["--config","--source","--target","--author","--salt-file","--store","--max-total","--gone-first",...Le.values]},Zt=1e6;function Ao(e){let t;try{t=JSON.parse(ve(e,"utf8"))}catch(o){process.stderr.write(`--gone-first: ${e} does not read: ${String(o)}
|
|
245
|
+
`),process.exit(2)}return(!Array.isArray(t)||!t.every(o=>typeof o=="string"&&/^[A-Za-z0-9]{15}(?:[A-Za-z0-9]{3})?$/.test(o)))&&(process.stderr.write(`--gone-first: ${e} holds no JSON array of record ids.
|
|
246
|
+
`),process.exit(2)),t}function $o(e){let t=e.slice(2);(t.includes("--help")||t.includes("-h")||t.length===0)&&(process.stdout.write(vo),process.exit(0));let o=p=>{let g=t.indexOf(p);return g>=0&&g+1<t.length?t[g+1]:void 0},n=t[0];Xt.includes(n)||(process.stderr.write(`The first word is the step: ${Xt.join(", ")} \u2014 not "${t[0]}".
|
|
247
|
+
`),process.exit(2)),rt(t,bo);let s=o("--config");s||(process.stderr.write(`Missing --config. Run with --help.
|
|
248
|
+
`),process.exit(2));let i=o("--source"),m=o("--target");(n==="select"||n==="extract")&&!i&&(process.stderr.write(`${n} reads the source org: give --source.
|
|
249
|
+
`),process.exit(2)),(n==="load"||n==="verify"||n==="remove")&&!m&&(process.stderr.write(`${n} works on the target org: give --target.
|
|
250
|
+
`),process.exit(2)),t.includes("--sweep")&&t.includes("--sweep-list")&&(process.stderr.write(`--sweep deletes and --sweep-list only lists: give one of them. Run with --help.
|
|
251
|
+
`),process.exit(2)),t.includes("--sweep-list")&&n!=="remove"&&(process.stderr.write(`--sweep-list goes with remove${n==="load"?"; a reload lists what its sweep would take with --dry-run --sweep":""}. Run with --help.
|
|
252
|
+
`),process.exit(2)),t.includes("--sweep")&&n!=="remove"&&!(n==="load"&&t.includes("--reload")&&!t.includes("--pilot"))&&(process.stderr.write(`--sweep goes with remove or load --reload${n==="load"&&t.includes("--pilot")?", and a pilot purges nothing":""}. Run with --help.
|
|
253
|
+
`),process.exit(2)),t.includes("--include-changed")&&n!=="remove"&&!(n==="load"&&t.includes("--reload")&&t.includes("--sweep"))&&(process.stderr.write(`--include-changed goes with remove, or with load --reload --sweep, whose sweep then takes what changed since the loads it replaces. Run with --help.
|
|
254
|
+
`),process.exit(2)),t.includes("--gone-first")&&!(n==="load"&&t.includes("--reload")&&t.includes("--dry-run"))&&(process.stderr.write(`--gone-first goes with load --reload --dry-run. Run with --help.
|
|
255
|
+
`),process.exit(2));let r=o("--gone-first");t.includes("--gone-first")&&r===void 0&&(process.stderr.write(`--gone-first takes the file of the ids taken back first.
|
|
256
|
+
`),process.exit(2)),t.includes("--write-encrypted")&&n!=="load"&&(process.stderr.write(`--write-encrypted goes with load. Run with --help.
|
|
257
|
+
`),process.exit(2)),t.includes("--accept-emails")&&n!=="load"&&(process.stderr.write(`--accept-emails goes with load. Run with --help.
|
|
258
|
+
`),process.exit(2)),t.includes("--mute-automation")&&n!=="load"&&n!=="remove"&&(process.stderr.write(`--mute-automation goes with load or remove. Run with --help.
|
|
259
|
+
`),process.exit(2)),t.includes("--accept-automation")&&n!=="remove"&&n!=="load"&&(process.stderr.write(`--accept-automation goes with load or remove. Run with --help.
|
|
260
|
+
`),process.exit(2)),t.includes(je)&&n!=="load"&&(process.stderr.write(`${je} goes with load. Run with --help.
|
|
261
|
+
`),process.exit(2));let d=At(t);t.includes("--preview")&&n!=="remove"&&(process.stderr.write(`--preview goes with remove${n==="load"?"; a load says what it would do with --dry-run":""}. Run with --help.
|
|
262
|
+
`),process.exit(2)),t.includes("--preview")&&t.includes("--sweep-list")&&(process.stderr.write(`--preview deletes nothing, and --sweep-list lists what a sweep would take: give --preview without it, or with --sweep. Run with --help.
|
|
263
|
+
`),process.exit(2));let a=jt(t);"refusal"in a&&(process.stderr.write(`${a.refusal} Run with --help.
|
|
264
|
+
`),process.exit(2));let l;if(t.includes("--max-total")){let p=o("--max-total");l=Number(p),n!=="load"&&(process.stderr.write(`--max-total goes with load. Run with --help.
|
|
265
|
+
`),process.exit(2)),(p===void 0||!/^\d+$/.test(p)||l<1||l>Zt)&&(process.stderr.write(`--max-total takes a whole number from 1 to ${Zt}, not "${p??""}".
|
|
266
|
+
`),process.exit(2))}return{step:n,configPath:s,source:i,target:m,author:o("--author"),storePath:o("--store"),saltFile:o("--salt-file"),pilot:t.includes("--pilot"),reload:t.includes("--reload"),dryRun:t.includes("--dry-run"),writeEncrypted:t.includes("--write-encrypted"),muteAutomation:t.includes("--mute-automation"),acceptAutomation:t.includes("--accept-automation"),...d!==void 0?{checkpointFirst:d}:{},includeChanged:t.includes("--include-changed"),acceptEmails:t.includes("--accept-emails"),sweep:t.includes("--sweep"),sweepList:t.includes("--sweep-list"),...a,preview:t.includes("--preview"),...l!==void 0?{maxTotal:l}:{},...r!==void 0?{goneFirst:r}:{},yes:t.includes("--yes"),json:t.includes("--json")}}async function ko(e){let o=(await e.query("SELECT Id, IsSandbox FROM Organization LIMIT 1")).records[0];if(!o)throw new Error("The org gave no Organization record.");if(o.IsSandbox)return{id:o.Id,orgType:"Sandbox"};try{let s=(await e.query("SELECT OrganizationType FROM Organization LIMIT 1")).records[0]?.OrganizationType;return typeof s=="string"&&s!==""?{id:o.Id,orgType:et({isSandbox:!1,edition:s}),edition:s}:{id:o.Id,orgType:"Production"}}catch{return{id:o.Id,orgType:"Production"}}}async function Jt(e,t,o,n){let s=await st(e),i=Se(s),m;try{m=await ko(i)}catch(r){let d=r instanceof Error?r.message:String(r);throw new Error(`Could not read the Organization record of '${e}': ${d}`)}return t.set(m.id,{org:{id:m.id,alias:e,orgType:m.orgType,metadata:{apiVersion:"66.0",...m.edition?{edition:m.edition}:{}},username:s.username,instanceUrl:s.instanceUrl},credentials:{accessToken:s.accessToken,instanceUrl:s.instanceUrl}}),o?.set(m.id,i),n?.set(m.id,{session:s,typed:m}),m.id}var x={run:"load",done:"loaded",source:"the frozen dataset",recordedIn:"in this sas",remove:"`remove`",module:"frozen",again:"reload",againSubject:{purge:"reload",sweep:"reloadSweep"},maybeMasks:"the dataset's manifest does not say its extraction left out what it read masked, so they may hold masks such as ****1234; --write-encrypted writes them as the dataset holds them"};function We(e){return!e||e.length===0?[]:[`kept: the platform does not delete them \u2014 ${e.map(({objectApiName:o,count:n})=>`${o} (${n})`).join(", ")}`]}function Qt(e,t,o=x){let n=(e??[]).filter(i=>i.reason==="may-hold-masks");if(n.length===0)return[];let s=n.map(({objectApiName:i,field:m,affectedRecords:r})=>`${i}.${m} (${r})`).join(", ");return[`${t} out, encrypted in the target: ${s} \u2014 ${o.maybeMasks}`]}function Ro(e,t){let o=e==="token"?"each record its own, from the token the value carries":`each record its own, its rank appended: the field is ${e==="unique"?"unique in the target":"the record name"}`;return t===void 0?o:`${o} (first: "${t}")`}function Ge(e){return e.created.reduce((t,o)=>t+o.count,0)}function So(e){return{...e.includeChanged?{includeChanged:!0}:{},...e.sweep?{sweep:!0}:{},...e.sweepLate?{sweepLate:!0}:{},...e.sweepUntied?{sweepUntied:!0}:{},...e.muteAutomation?{muteAutomation:!0}:{}}}var Oo={removal:{heading:"removal",writer:"this removal",verb:"remove"},reload:{heading:"reload",writer:"this reload's purge",verb:"reload"},reloadSweep:{heading:"reload",writer:"this reload's sweep",verb:"reload"},replayAgain:{heading:"replay",writer:"this replay's purge",verb:"replay again"},replayAgainSweep:{heading:"replay",writer:"this replay's sweep",verb:"replay again"}};function xe({read:e,steps:t,mute:o},n,s="removal",i){let m=o?Z(o.muted,n).map(l=>` ${l}`):[];if(!("objects"in e)){let l=Oo[s],p=s==="reload"||s==="replayAgain",g=`${l.writer}${p&&i?" and its sweep":""}`;return{lines:[`${l.heading} automation: what ${n} runs could not be read: ${e.unread}`,...m],refusal:`What ${n} runs as ${g} writes could not be read (${e.unread}), so what fires as the records go is not known. Nothing was written or deleted. Add --accept-automation to ${l.verb} all the same, or turn that automation off in ${n} first.`}}let r=o?.automation??e,d=i?tt(t,i.delete??[]):t,a=mt(r,n,{steps:t,...i?{sweep:i}:{},assign:pt(r,ot(r,d)),mayMute:o===void 0&&Ce("--mute-automation"),subject:s});return{lines:[...ht(e,n,t,s,i),...m],...a!==void 0?{refusal:a}:{}}}function Eo(e,t,o=x){let n=Ge(e),s=e.earlier?`a ${o.run} before the last one, whose records the ${o.run}s after it left in place,`:`the last ${o.run}`,i=`a removal deletes the ${n} record(s) it created, children first:`;return e.removed&&n===0?i=`its records were removed on ${e.removed.removedAt}, and none is left to remove`:n===0&&(e.keptByThePlatform?.length??0)>0?i="it created no record a removal takes":e.removed&&(i=`the removal of ${e.removed.removedAt} left ${n} of the records it created, and a removal deletes those, children first:`),[`${s} wrote to ${t} at ${e.loadedAt}; ${i}`,...e.created.map(m=>` ${m.objectApiName}: ${m.count}`),`${e.linked} record(s) it linked to or reused stay`,...We(e.keptByThePlatform)]}function Fo(e,t){return e.recorded&&(Ge(e)>0||(t?.delete??[]).length>0)}function To(e){return[e.deleted>0?`${e.deleted} deleted`:"",e.alreadyGone>0?`${e.alreadyGone} already gone`:"",e.keptChanged>0?`${e.keptChanged} kept, changed since the load`:"",e.keptDependents>0?`${e.keptDependents} kept for records that stay`+(e.heldBy.length>0?` (${e.heldBy.join(", ")})`:""):"",e.refused>0?`${e.refused} refused`:"",(e.notReached??0)>0?`${e.notReached} not reached`:""].filter(Boolean).join(", ")}function zo(e,t=x){let o=e.count>e.names.length?", \u2026":"";return`${e.count} file(s) attached to them stay in the org, as the ${t.run} did not create them: ${e.names.join(", ")}${o}`}function Yt(e){return`graph: ${e.objects} object(s) at a cap of ${e.maxNodes}`+(e.objects>e.maxNodes?" (raised for the parents their records cannot be written without)":"")+(e.truncated?" \u2014 TRUNCATED: objects further out were not read":"")}function eo(e){return"reusedFrom"in e?`graph reused from ${e.reusedFrom} (discovered ${e.discoveredAt}): the source's schema has not changed since`:`rediscovered: ${e.rediscovered}`}function Co(e){switch(e.phase){case"discovery":return` discovery: ${e.objects??0} object(s) reached`;case"axis":return` listing the values of axis ${e.axis??"?"}\u2026`;case"combination":return` combination ${e.index??"?"}/${e.of??"?"}: ${e.combinationKey??"?"}`;case"candidate":return` candidate ${e.candidate??"?"}/${e.candidates??"?"} of ${e.combinationKey??"?"}: measuring its own records\u2026`;case"measure":return` measuring the ${e.roots??0} root(s) kept, together\u2026`}}function jo(e){let t=e.reason==="timeout"?"its time ran out":"it was cancelled",o=e.during==="axes"?"while it listed the axis values":e.during==="measure"?"while it measured the roots it kept":`while it probed ${e.combinationKey??"?"}`+(e.candidate!==void 0?`, candidate ${e.candidate} of ${e.candidates??"?"}`:"");return[`STOPPED: ${t} ${o}; the combinations decided before are kept`,...e.notProbed.length>0?[` never probed: ${e.notProbed.join(", ")}`]:[]]}var Lo=new Set(["NO_LOAD","ALREADY_REMOVED","NOTHING_TO_REMOVE"]),uo="REMOVAL_DECLINED",to=["MUTE_PRODUCTION","MUTE_NO_RIGHT","MUTE_FAILED"],No=new Map([["frozen:load:error",new Set(["EMAILS_NOT_ACCEPTED","FROZEN_EMAILS_EXCEEDED",ze,"FROZEN_STORAGE_EXCEEDED","AUTOMATION_NOT_ACCEPTED",le.code,...to])],["frozen:remove:error",new Set(["AUTOMATION_NOT_ACCEPTED","GUARD_BLOCKED","GUARD_DECLINED",le.code,...to])]]);function Be(e){let t=e.payload?.code,o=No.get(String(e.type??""));if(!(typeof t!="string"||o?.has(t)!==!0))return{code:t,message:String(e.payload?.message??"")}}function Ue(e){let t=String(e.type??"");if(!t.endsWith(":error")||t==="frozen:remove:automation:error")return!1;let o=String(e.payload?.code);return t==="frozen:remove:error"&&o===uo?!1:!((t==="frozen:remove:error"||t==="frozen:remove:preview:error")&&Lo.has(o))}var oo={passed:0,partial:3,unstable:4,failed:1};function Io(e,t,o){return async(n,s)=>{let i=Date.parse(s?.first??""),m=Math.max(i,Date.parse(s?.last??""));return!Number.isFinite(i)||!Number.isFinite(m)?[]:[...(await Lt({organizationId:n,alias:e,span:{from:i,to:m},own:{ids:[]},...t!==void 0?{journalDir:t}:{}})).map(({ids:d})=>({ids:d,from:i,to:m})),...Gt(Vt(t??te(),n),{sasMark:o,own:[]})]}}function Do(e,t){return dt(t.map(o=>{let n=o.payload??{};if(e==="verify"&&o.type==="frozen:verify:result"){let s=String(n.verdict?.status??"");return Object.prototype.hasOwnProperty.call(oo,s)?oo[s]:1}if(e==="load"&&o.type==="frozen:load:response"){let s=n.report;return s?.status==="completed"&&(s.sweeps??[]).every(i=>i.result.status==="success")?0:3}return e==="remove"&&o.type==="frozen:remove:response"?n.result?.status==="success"?0:3:0}))}function Po(e,t){return` data storage: about ${J(e.estimateMB)} MB`+(e.automationMB!==void 0&&e.automationMB>0?`, about ${J(e.automationMB)} MB of it for what the target's automation creates under them,`:"")+` of the ${J(e.remainingMB)} MB ${t} has left of ${J(e.maxMB)} MB`+(e.freedMB!==void 0?`, and the reload's purge frees about ${J(e.freedMB)} MB first`:"")}function no(e,t){return Ft(e.verdict==="unread"?{verdict:"unread",estimate:e.estimate,unread:e.unread??"not said"}:{verdict:e.verdict,estimate:e.estimate,remaining:e.remaining??0,max:e.max??0},t)}function xo(e){return(e.filter(o=>o.type==="frozen:remove:response").at(-1)?.payload?.result?.objects??[]).some(o=>o.deleted+o.alreadyGone>0)}function ge(e,t){if(gt()!==void 0)return De(e);let o=t.remove.replace(/`/g,"");return e==="--sweep"||e==="--sweep-list"?`${o} ${e}`:`${o} --sweep ${e}`}function Mo(e,t=x){if(!e||e.found.length===0)return[];let o=e.found.reduce((l,p)=>l+p.count,0),n=e.found.some(l=>l.overBound)?" or more":"",s=l=>e.found.reduce((p,g)=>p+(g.classes?l(g.classes):0),0),i=s(l=>l.made+l.madeOver),m=s(l=>l.late),r=s(l=>l.untied),d=e.found.filter(l=>l.overBound).map(l=>l.objectApiName),a=[...i>0?[`${ge("--sweep",t)} takes the ${i} tied to the ${t.run}`]:[],...m>0?[`${ge("--sweep-late",t)} takes the ${m} made late`]:[],...r>0?[e.untied?.refusal!==void 0?`the ${r} tied to nothing of the ${t.run} now stay: --sweep-untied is refused (${e.untied.refusal})`:`${ge("--sweep-untied",t)} takes the ${r} tied to nothing of the ${t.run} now`]:[],...d.length>0?[`no sweep takes those of ${d.join(", ")}, past its bound`]:[]];return[`not swept: ${o}${n} record(s) the ${t.run}'s user created in its window stay, what the target's automation made for the ${t.run} likely: `+e.found.map(l=>`${l.objectApiName}: ${l.count}`).join(", "),...a.map(l=>` ${l}`),` ${ge("--sweep-list",t)} names them first: a record made by hand as that user in the ${t.run}'s window reads as the automation's, so check the names before a sweep`]}function _o(e,t={},o=x){let n=String(e.type??""),s=e.payload??{},i=n.replace(/^frozen:/,`${o.module}:`),m=o===x?"load":"run";if((n==="frozen:remove:error"||n==="frozen:remove:preview:error")&&!Ue(e))return[`nothing to remove: ${String(s.message??"")}`];if(n==="frozen:remove:error"&&!Ue(e))return[String(s.message??"")];if(n==="frozen:remove:automation:error")return[];if(n.endsWith(":error")){let r=n==="frozen:load:error"?s.sweeps??[]:[],d=n==="frozen:load:error"?s.emails:void 0,a=n==="frozen:load:error"?s.automation:void 0,l=n==="frozen:load:error"?s.mutedAutomation:void 0,p=Be(e);return[...p?[]:[`! ${i}: ${String(s.message??"")}${s.code?` [${String(s.code)}]`:""}`],...a?me(a,"the target"):[],...d?he(d,"the target"):[],...l?Z(l,"the target"):[],...r.length>0?[`before the ${o.run} ended, its sweep had already done this:`]:[],...r.flatMap(({loadedAt:g,result:y})=>[`sweep of the ${o.run} of ${g}:`,...ne(y)]),...p?[ee(p)]:[]]}switch(n){case"frozen:select:progress":return[Co(s)];case"frozen:select:response":{let r=s.selection;return[`selected ${r.combinations.length} root(s): ${r.combinations.map(d=>d.combinationKey).join(", ")}`,...r.uncovered.map(d=>` uncovered ${d.combinationKey}: ${d.reason}`),...r.stopped?jo(r.stopped):[],...r.discovery?[eo(r.discovery)]:[],...r.graph?[Yt(r.graph)]:[],`volumetry ${r.volumetry.total} / ${r.volumetry.budgetMax} record(s)`+(r.volumetry.summed?" \u2014 each kept root's own records added up: they were not measured together":""),...Object.entries(r.volumetry.measured).filter(([,d])=>d>0).map(([d,a])=>` ${d}: ${a}`)]}case"frozen:control:result":{let r=s.report;return[`non-reidentification control: ${r.passed?"PASSED":"FAILED"}`,...r.checks.map(d=>` ${d.passed?"ok ":"FAIL"} ${d.name}`+(d.violations.length>0?` (${d.violations.length} violation(s))`:""))]}case"frozen:extract:response":{let r=s.manifest,d=s.discovery;return[`frozen ${String(s.recordCount)} record(s) as version ${r.version} in ${String(s.datasetDir)}`,...d?[eo(d)]:[],...r.coverage?[Yt(r.coverage)]:[],...r.coverage&&r.coverage.unboundedObjects.length>0?[`read without the time bound: ${r.coverage.unboundedObjects.join(", ")}`]:[],...(r.coverage?.leftToThePlatform??[]).map(a=>`${a.objectApiName}: ${a.note}`),...(r.coverage?.exclusionCosts??[]).map(a=>`${a.objectApiName}: ${a.note}`),...(r.coverage?.requiredLeftEmpty??[]).length>0?[`required in the source and left empty by the rules \u2014 a load will ask a value for each: ${(r.coverage?.requiredLeftEmpty??[]).join(", ")}`]:[],...(r.coverage?.keptWithoutARule??[]).length>0?["kept without a rule, the platform's own words: "+(r.coverage?.keptWithoutARule??[]).join(", ")]:[],...(r.coverage?.encryptedNotKept??[]).length>0?["not kept, encrypted and read masked: the user the source is read as lacks View Encrypted Data, and the masks are not copied: "+(r.coverage?.encryptedNotKept??[]).join(", ")]:[],...Object.entries(r.volumetry.measured).filter(([,a])=>a>0).map(([a,l])=>` ${a}: ${l}`)]}case"frozen:load:response":{let r=s.report,d=[`${o.run}: ${r.status} in ${r.durationMs}ms \u2014 ${r.alignment.excludedObjects.length} object(s) excluded, ${r.alignment.removals.length} field removal(s), ${r.alignment.recordTypeIssues.length} record type issue(s), ${r.placeholders.length} placeholder(s)`];for(let f of r.alignment.excludedObjects)d.push(` ${f.objectApiName}: not ${o.done} \u2014 ${f.reason}`);d.push(...Qt(r.alignment.removals,"left",o));for(let f of r.perObject){let S=f.writtenByThePlatform??0;d.push(` ${f.objectApiName}: ${f.inserted} inserted, ${f.reused} reused`+(S>0?` (${S} written by the platform with ${Oe(f.objectApiName)})`:"")+`, ${f.skippedDuplicates.length} duplicate(s), ${f.failed.length} failed of ${f.fromFiles}`);let P=f.failed[0];P&&d.push(` first refusal: ${P.errors?.[0]??P.error??"?"}`)}for(let f of[...r.leftToThePlatform??[],...r.untypedFeedItems??[],...r.heldForExcludedParents??[],...r.quotesLeftUnsynced??[],...r.keysLeftEmpty??[]])d.push(` ${f.objectApiName}: ${f.note}`);let a=r.perObject.filter(f=>(f.writtenWithoutFields?.fields.length??0)>0);if(a.length>0){d.push(`written again without a field a validation rule or a restricted picklist refused (${a.length} object(s)):`);for(let{objectApiName:f,writtenWithoutFields:S}of a)for(let{field:P,refusedBy:q,reason:V,rows:Ve,replacedWith:se}of S?.fields??[]){let Q=q==="restricted-picklist"?"a restricted picklist refused its value":"a validation rule refused it",j=se===void 0?"":` \u2014 written with "${se}", as its picklist rule declares`;d.push(` ${f}.${P} ${Ve} record(s) \u2014 ${Q}${j} \u2014 ${V}`)}}d.push(`pass 2: ${r.pass2.resolved} resolved, ${r.pass2.unresolved.length} unresolved`);for(let f of r.pass2.unresolved.slice(0,5))d.push(` ${f.objectApiName}.${f.field}: ${f.detail}`);let l=r.personContact,p=l?.sent??[];if(l&&l.restored+p.length+l.unresolved.length>0){d.push(`person contacts: ${l.restored} linked, ${p.length} sent as contacts of their own, ${l.unresolved.length} not linked`);for(let f of p.slice(0,5))d.push(` ${f.contactReferenceId} sent: ${f.detail}`);for(let f of l.unresolved.slice(0,5))d.push(` ${f.contactReferenceId}: ${f.detail}`)}if(r.statuses&&r.statuses.restored+r.statuses.refused.length>0){d.push(`statuses applied after insert: ${r.statuses.restored}, refused ${r.statuses.refused.length}`);for(let f of r.statuses.refused.slice(0,5))d.push(` ${f.objectApiName} \u2192 ${f.status}: ${f.detail}`)}let g=f=>Object.values(f).reduce((S,P)=>S+P,0),y=g(r.purge.deleted),z=g(r.purge.deactivated??{});if(y+z+r.purge.failures.length>0){d.push(`purge of earlier ${o.run}s: ${y} deleted, ${z} deactivated, ${r.purge.failures.length} failed`);for(let f of r.purge.failures.slice(0,5))d.push(` ${f.objectApiName}: ${f.errors[0]??"?"}`)}for(let[f,S]of Object.entries(r.purge.cameAlong??{}))d.push(` ${f}: took along ${S.count} record(s) the ${o.run}s did not write that came with their records, made as they wrote: ${S.objects.join(", ")}`);let M=Object.entries(r.purge.leftUnrecorded??{});if(M.length>0){d.push("left in place, of a load recorded before loads kept what they created \u2014 it may have linked them:");for(let[f,S]of M)d.push(` ${f}: ${S}`)}let C=Object.entries(r.purge.keptByThePlatform??{});if(C.length>0){d.push("kept by the purge, the platform does not delete them:");for(let[f,S]of C)d.push(` ${f}: ${S}`)}for(let f of s.report.sweeps??[]){d.push(`sweep of the ${o.run} of ${f.loadedAt}:`,...ne(f.result));let S=f.result.objects.reduce((P,q)=>P+q.keptChanged,0);S>0&&d.push(` ${S} record(s) kept, changed since that ${o.run}: `+(o===x?"load --reload --sweep --include-changed, or remove --sweep --include-changed, ":`${o.remove} --sweep --include-changed `)+"takes them")}let F=s.report.mutedAutomation;F&&d.push(...Z(F,"the target"));let D=s.report.automation;D&&d.push(...me(D,"the target"));let u=s.report.emails;u&&d.push(...he(u,"the target"));let $=s.report.apiRequests;return $&&d.push(no($,"the target")),d.push(...lo(s.report.recordTypesGiven,!1)),d}case"frozen:load:preview:response":{let r=s.plan,d=u=>r.perObject.reduce(($,f)=>$+u(f),0),a=[`dry run${r.mode.pilot?" (pilot)":""}${r.mode.reload?` (${o.again})`:""}: ${d(u=>u.toInsert)} record(s) to insert, ${d(u=>u.reusedByKeys+u.reusedFromCatalog+(u.writtenByThePlatform??0))} to link, ${d(u=>u.notSent)} not sent`+(r.mode.reload?`, ${d(u=>u.toPurge)} to purge and ${d(u=>u.toDeactivate)} to deactivate of ${r.earlierLoads} earlier ${o.run}(s)`:"")+" \u2014 nothing written"];for(let u of r.perObject){let $=[`${u.toInsert} to insert`,u.reusedByKeys>0?`${u.reusedByKeys} found by identity keys`:"",u.reusedFromCatalog>0?`${u.reusedFromCatalog} found in the catalog`:"",(u.writtenByThePlatform??0)>0?`${u.writtenByThePlatform} to link (written by the platform with ${Oe(u.objectApiName)})`:"",u.fieldsDropped>0?`${u.fieldsDropped} field(s) dropped`:"",u.picklistsRewritten>0?`${u.picklistsRewritten} picklist value(s) rewritten`:"",u.notSent>0?`${u.notSent} not sent`:"",u.toPurge>0?`${u.toPurge} to purge`:"",u.toDeactivate>0?`${u.toDeactivate} to deactivate`:""].filter(Boolean);a.push(` ${u.objectApiName}: ${$.join(", ")} of ${u.fromFiles}`)}for(let u of r.excludedObjects)a.push(` ${u.objectApiName}: not ${o.done} \u2014 ${u.reason}`);a.push(...Qt(r.removals,"would leave",o));for(let u of[...r.heldForExcludedParents??[],...r.quotesLeftUnsynced??[],...r.keysLeftEmpty??[]])a.push(` ${u.objectApiName}: ${u.note}`);for(let u of r.placeholders)a.push(`placeholder for ${u.objectApiName}.${u.field}: ${u.affectedRecords} record(s)`);for(let u of r.requiredDefaults)a.push(`default for ${u.objectApiName}.${u.field}: ${u.affectedRecords} record(s)`+(u.perRecord?`, ${Ro(u.perRecord,u.example)}`:""));r.personContacts>0&&a.push(`${r.personContacts} person account contact(s) go in with their account, not counted above`);let l=Object.entries(r.leftUnrecorded??{});if(l.length>0){a.push("left in place, of a load recorded before loads kept what they created \u2014 it may have linked them:");for(let[u,$]of l)a.push(` ${u}: ${$}`)}let p=Object.entries(r.keptByThePlatform??{});if(p.length>0){a.push("left in place by the purge, the platform does not delete them:");for(let[u,$]of p)a.push(` ${u}: ${$}`)}let g=u=>` ${u.name}${u.field?` (${u.field})`:""}${u.message?` \u2014 ${u.message}`:""}`,y=r.perObject.filter(u=>(u.validationRules?.length??0)>0);for(let u of y){a.push(`${u.objectApiName}: ${u.validationRules?.length??0} active validation rule(s) of the target, which a preview cannot evaluate \u2014 a record one of them refuses is counted to insert:`);for(let $ of u.validationRules??[])a.push(g($))}for(let u of r.perObject){let $=u.lookupFilters??[];$.length!==0&&a.push(`${u.objectApiName}: ${$.length} lookup filter(s) of the target, which a preview cannot check \u2014 a record whose lookup it refuses is refused, and what hangs from it: `+$.map(f=>`${f.field} (${f.referenceTo.join(" or ")}, ${f.records} record(s))`).join(", "))}for(let u of r.perObject){let $=u.validationRulesOnChange??[];$.length!==0&&a.push(`${u.objectApiName}: ${$.length} rule(s) left out \u2014 their formula holds only on a change of a record (ISCHANGED, PRIORVALUE, NOT(ISNEW())), which an insert never is: `+$.join(", "))}let z=new Map(r.placeholders.filter(u=>(u.validationRules?.length??0)>0).map(u=>[u.placeholderObjectApiName,u.validationRules??[]]));for(let[u,$]of z){a.push(`placeholder of ${u}: ${$.length} active validation rule(s) of the target, which a preview cannot evaluate \u2014 a placeholder one of them refuses stops the load:`);for(let f of $)a.push(g(f))}r.validationRulesUnread&&a.push(`the target's validation rules could not be listed (${r.validationRulesUnread}): any of them may refuse a record counted to insert`);let M=s.plan.automation;M&&a.push(...me(M,"the target"));let C=s.plan.emails;C&&a.push(...he(C,"the target"));let F=s.plan.apiRequests;F&&a.push(no(F,"the target"));let D=s.plan.storage;return D&&a.push(Po(D,"the target")),a}case"frozen:verify:result":{let r=s.verdict;return[`verification: ${r.status.toUpperCase()}`,...r.checks.map(d=>{let a=Vo(d,o);return` ${d.passed?"ok ":"FAIL"} ${a.name}: ${a.detail}`})]}case"frozen:remove:response":{let r=s.result,d=[...new Set(r.objects.flatMap(l=>l.unchecked))],a=r.sweep!==void 0&&r.objects.length===0;return[...r.sweep?ne(r.sweep):[],...(r.otherLoadSweeps??[]).flatMap(({loadedAt:l,result:p})=>[`sweep of the ${o.run} of ${l}:`,...ne(p)]),...a?[]:[`removal: ${r.status.toUpperCase()}`+(r.leftBy?` \u2014 of what the removal of ${r.leftBy} left`:"")],...r.objects.flatMap(l=>[` ${l.objectApiName}: ${To(l)||"nothing"} of ${l.planned}${Ie(l)}`,...Tt(l,m),...l.reasons.map(p=>` ${p}`),...l.filesLeft&&l.filesLeft.count>0?[` ${zo(l.filesLeft,o)}`]:[]]),...d.length>0?[`not checked, deleted with their parent: ${d.join(", ")}`]:[],...We(r.keptByThePlatform),...zt(r.objects,{sweep:r.sweep!==void 0}),...r.mutedAutomation?Z(r.mutedAutomation,"the target"):[]]}case"frozen:remove:sweep:response":{let r=s.loads;if(r)return r.flatMap(({loadedAt:a,listing:l})=>[`sweep of the ${o.run} of ${a}:`,...fe(l,"the target org",t,!0)]);let d=s.otherLoads??[];return d.length>0?[{loadedAt:String(s.loadedAt),listing:s.listing},...d].flatMap(({loadedAt:a,listing:l})=>[`sweep of the ${o.run} of ${a}:`,...fe(l,"the target org",t,!0)]):fe(s.listing,"the target org",t,!0)}case"frozen:remove:preview:response":return Uo(s.preview,o);case"frozen:status:response":return[JSON.stringify(s.status,null,2)];default:return[]}}var Bo="not read by a preview: what hangs from the records, which a removal reads at each object's turn \u2014 a record kept for records that stay is counted with those to delete \u2014 nor what the target's automation does as they go";function Uo(e,t=x){let o=i=>e.userNames[i]??i,n=["preview: what a removal would do; nothing was deleted"+(e.leftBy?` \u2014 of what the removal of ${e.leftBy} left`:"")];for(let i of e.objects){let m=[i.toDelete>0?`${i.toDelete} to delete`:"",e.includeChanged&&i.changedSince>0?`${i.changedSince} of them changed since the ${t.run}`:"",i.alreadyGone>0?`${i.alreadyGone} gone already`:"",i.notVisible>0?`${i.notVisible} not visible`:"",i.keptChanged>0?`${i.keptChanged} kept, changed since the ${t.run}`:"",i.undeletable>0?`${i.undeletable} left, the user may not delete them`:"",i.unread>0?`${i.unread} left, not read`:""].filter(Boolean);n.push(` ${i.objectApiName}: ${m.join(", ")||"nothing"} of ${i.planned}${Ie(i)}`);let r=Object.entries(i.changedBy).sort((d,a)=>a[1]-d[1]);r.length>0&&n.push(` last changed by: ${r.map(([d,a])=>`${o(d)} ${a}`).join(" \xB7 ")}`);for(let d of i.reasons)n.push(` ${d}`)}n.push(...We(e.keptByThePlatform));let s=e.refusalCodes;return e.refusals.forEach((i,m)=>{n.push(s?.length===e.refusals.length?ue({code:s[m],message:i},"a removal"):`a removal would be refused: ${i}`)}),n.push(Bo),n}async function Wo(e){let t=G(e,"manifest.json");if(_e(t))try{let o=await _t(e),{version:n}=JSON.parse(ve(t,"utf8"));return{dir:e,digest:o,...typeof n=="string"?{version:n}:{}}}catch{return}}function Go(e,t){let o=G(e,xt(t)),n=G(e,"referenceid-mapping.json");return!_e(o)&&_e(n)?n:o}function ro(e){return{status:e.status.toUpperCase(),objects:(e.objects??[]).map(({status:t,...o})=>({...o,verdict:t==="passed"?"PASSED":"FAILED"}))}}async function qo(e,t,o){let n=a=>t.filter(l=>l.type===a).at(-1)?.payload,s=o.targetOrgId?Go(o.sasDir,o.targetOrgId):void 0,i={tool:"sandforge-frozen",step:e,posted:t},m=[],r=[],d=async a=>{if(a===void 0)return;let l=await Wo(a);l&&(i.dataset=l)};switch(e){case"extract":{let a=n("frozen:extract:response");if(!a)break;await d(typeof a.datasetDir=="string"?a.datasetDir:o.datasetDir);let l=a.manifest?.volumetry?.measured??{};i.objects=Object.entries(l).filter(([,p])=>p>0).map(([p,g])=>({objectApiName:p,records:g}));break}case"load":{await d(o.datasetDir);let a=n("frozen:load:response")?.report,l=n("frozen:load:preview:response")?.plan,p=a?a.recordTypesGiven:l?.recordTypesGiven;p&&(i.recordTypesGiven=p),a?(i.mapping=a.mappingPath,i.objects=a.perObject.map(y=>({objectApiName:y.objectApiName,fromFiles:y.fromFiles,inserted:y.inserted,reused:y.reused,duplicates:y.skippedDuplicates.length,failed:y.failed.length}))):l&&(s&&(i.mapping=s),i.objects=l.perObject.map(y=>({objectApiName:y.objectApiName,fromFiles:y.fromFiles,toInsert:y.toInsert,toLink:y.reusedByKeys+y.reusedFromCatalog+(y.writtenByThePlatform??0),notSent:y.notSent,toPurge:y.toPurge,toDeactivate:y.toDeactivate}))),a&&(i.status=a.status),!a&&n("frozen:load:error")?.code==="LOAD_CANCELLED"&&(i.status="cancelled",s&&(i.mapping=s));let g=n("frozen:verify:result")?.verdict;g&&(i.verdict=ro(g));break}case"verify":{let a=n("frozen:verify:result")?.verdict;await d(a?.manifestPath?wo(a.manifestPath):o.datasetDir),s&&(i.mapping=s),a&&(i.verdict=ro(a));break}case"remove":{s&&(i.mapping=s);let a=n("frozen:remove:response")?.result,l=n("frozen:remove:preview:response")?.preview;a?(i.status=a.status,a.mutedAutomation&&(i.mutedAutomation=a.mutedAutomation),i.objects=a.objects.map(p=>({objectApiName:p.objectApiName,planned:p.planned,deleted:p.deleted,alreadyGone:p.alreadyGone,keptChanged:p.keptChanged,keptDependents:p.keptDependents,refused:p.refused,notReached:p.notReached??0,notVisible:p.notVisible??0,...p.tookAlong?{tookAlong:p.tookAlong}:{},...p.cameAlong?{cameAlong:p.cameAlong}:{}})),i.includeChanged=a.includeChanged):l&&(i.preview=!0,i.includeChanged=l.includeChanged,i.objects=l.objects.map(p=>({objectApiName:p.objectApiName,planned:p.planned,toDelete:p.toDelete,alreadyGone:p.alreadyGone,changedSince:p.changedSince,keptChanged:p.keptChanged,undeletable:p.undeletable,notVisible:p.notVisible,unread:p.unread})),m.push(...l.refusals),l.refusalCodes?.length===l.refusals.length&&r.push(...l.refusalCodes));break}}return m.push(...o.refusals??[]),o.refusalCodes?.length===(o.refusals??[]).length&&r.push(...o.refusalCodes??[]),m.length>0&&(i.refusals=m),m.length>0&&r.length===m.length&&(i.refusalCodes=r),o.mute&&Object.assign(i,o.mute),o.checkpoint&&(i.checkpoint=o.checkpoint),i}function Vo(e,t){return t===x?e:{name:e.name==="load"?t.run:e.name,detail:e.detail.replace(/\bThe load\b/g,`The ${t.run}`).replace(/\bthe load\b/g,`the ${t.run}`).replace(/\bnot loaded\b/g,`not ${t.done}`).replace(/\bnot loadable\b/g,`not ${t.run}able`)}}async function Ko(e=process.argv){await Ho($o(e))}async function Ho(e,t){let o=Date.now(),n=c=>{process[e.json?"stderr":"stdout"].write(`${c}
|
|
267
|
+
`)},s=t?.words??x,i=t?{}:JSON.parse(ve(e.configPath??"","utf8")),m=t?t.folder.dir:typeof i.sasDir=="string"?i.sasDir:G(yo(),".sandforge-sas");t||mo(m,{recursive:!0});let r=wt(t?t.auditStore:e.storePath??G(m,"cli-store.json")),d=new Map,a=new Map,l=new Map,p=e.source?await Jt(e.source,d):void 0,g=e.target?await Jt(e.target,d,a,l):void 0,y=[],z=!1,M=!1,C=new Kt({log:()=>{},broker:{postToWebview:c=>{if(c.type==="frozen:load:progress")return;if(t&&String(c.type).endsWith(":error")&&c.payload){let w=c.payload.code;c.payload.message=t.reword(typeof w=="string"?w:void 0,String(c.payload.message??""),c.payload)}y.push(c),Ue(c)&&(z=!0);let h=t?.refusalOf(c);if(h&&(E??=h,j.push(h)),M)return;let v=h?[ee(h)]:_o(c,e,s);for(let w of t?t.lines(c,v):v)n(w)}},orgManager:{getOrg:c=>d.get(c)?.org},orgRegistry:{getCredentials:async c=>d.get(c)?.credentials},configStore:r,infraServices:{productionGuard:It(n,e.target??e.source??"the org"),piiDetector:new ut},nextId:()=>`cli-${Date.now()}-${Math.random().toString(36).slice(2,8)}`});t&&C.setReplayStores(t.stores);let F=g?a.get(g):void 0,D=g?l.get(g):void 0,u=e.checkpointFirst&&D?$t({module:t?"replay":"frozen",operationId:`sandforge-frozen-load-${o}`,request:e.checkpointFirst,session:D.session,org:{id:D.typed.id,orgType:D.typed.orgType,...D.typed.edition!==void 0?{edition:D.typed.edition}:{}},connect:Se,journalDir:te(),say:n}):void 0;F&&C.setTargetAutomation(oe(F)),C.setMuteOffered(Ce("--mute-automation")),C.setSaltKeeper(Ut(process.env,e.saltFile)),e.target&&C.setOtherModuleRuns(Io(e.target,void 0,Pe(m)));let $=new Ht;C.setRegistry($);let f,S,P=!1,q=!1,V,se=at(c=>{if(V=c,process.stderr.write(`
|
|
268
|
+
interrupted: the ${e.step==="load"?s.run:e.step} stops after the call under way, and says what it wrote (Ctrl-C again ends it at once)
|
|
269
|
+
`),S){S.abort();return}for(let h of $.getRunning())$.abort(h.operationId);f&&$.cancelBeforeStart(f),(!f||q)&&process.exit(de(c))}),Q=t?void 0:typeof i.datasetDir=="string"?i.datasetDir:G(m,"dataset"),j=[],U=c=>{let h=t?{code:c.code,message:t.reword(c.code,c.message)}:c;j.push(h),n(ue(h,`a ${s.run}`))},B=c=>{if(!t)return{};let{organizationId:h,checkpointId:v,config:w}=t.request;return c==="load"?{replay:t.request}:c==="verify"?{replay:{organizationId:h,checkpointId:v,...w?{config:w}:{}}}:{replay:{organizationId:h,checkpointId:v}}},be=[],E,Ke=!1,K,H,X,Ae=async(c,h=Number(process.exitCode??0))=>{if(!e.json)return;let v=[...j,...be],w=await qo(e.step,y,{...Q!==void 0?{datasetDir:Q}:{},sasDir:m,...g?{targetOrgId:g}:{},...v.length>0?{refusals:v.map(({message:A})=>A),refusalCodes:v.map(({code:A})=>A)}:{},...K?{mute:K}:{},...H?{checkpoint:H}:{}}),b=t?{...t.answer(w,{exit:h,...c?{ended:c}:{},...E?{refused:E}:{},...g?{targetOrgId:g}:{}}),...X?{notSwept:X}:{}}:{...w,...X?{notSwept:X}:{},...E?{refused:E}:{},...c?{ended:c}:{}};process.stdout.write(`${JSON.stringify(b,null,2)}
|
|
270
|
+
`)},L=async(c,h)=>{let v=`cli-${c}-${Date.now()}`;f=v;try{return await C.handle({id:v,type:c,payload:h})}finally{f=void 0}},He;try{He=await po()}finally{se()}if(He==="ended"&&!V){z&&(process.exitCode=1),await Ae(!0);return}if(V){await Ae(void 0,de(V)),process.stderr.write(`${P?ct:Qo(e.preview?"preview":e.step,e.step!=="load"||e.dryRun||Me(y),s)}
|
|
271
|
+
`),process.exitCode=de(V);return}if(it(z||j.length>0?1:Ke?3:Do(e.step,y)),e.json){await Ae();return}n(`done in ${Date.now()-o}ms`);async function Xe(c){await L("frozen:remove:automation",{...c,...B("removal")});let h=T=>y.find(W=>W.type===T)?.payload,v=h("frozen:remove:automation:response"),w=Array.isArray(c.sweptObjects)?c.sweptObjects:[],b=v?.purge&&w.length>0?v.purge:void 0,A=v&&e.muteAutomation?F&&(e.preview||e.dryRun)?await Fe(Ee(F),v.automation,{writes:ie(v.steps)}):Te(v.automation,ie(v.steps)):void 0,N=A&&!("refused"in A)?A:void 0,{lines:k,refusal:O}=xe({read:v?.automation??{unread:String(h("frozen:remove:automation:error")?.message)},steps:b??v?.steps??{},...N?{mute:{automation:N.automation,muted:N.planned}}:{}},e.target??"",c.reload===!0?s.againSubject.purge:"removal",b?{delete:w}:void 0);for(let T of k)n(T);let _=A&&"refused"in A?A.refused:O!==void 0&&!e.acceptAutomation?{code:"AUTOMATION_NOT_ACCEPTED",message:O}:void 0;return{...v?{steps:v.steps}:{},...N?{planned:N}:{},..._?{refusal:_.message,code:_.code}:{}}}function Ze(c){E={code:ce,message:c},j.push(E),n(ee(E)),z=!0}async function $e(){if(t){if(g===void 0)return;let h=Dt(await t.stores.replays.mappingStoreOf(t.folder,g).recordedLoads());return h?{...Pt(h),orgId:g}:void 0}return M=!0,await L("frozen:status",{}),M=!1,y.filter(h=>h.type==="frozen:status:response").at(-1)?.payload?.status?.loadRecords?.find(h=>h.orgId===g)}async function Je(c=[]){if(!e.reload||e.pilot)return;let h=await $e();if(!(!h||h.created.length===0&&c.length===0))return Xe({targetOrgId:g,loadedAt:h.loadedAt,reload:!0,...c.length>0?{sweptObjects:c}:{}})}async function Qe(){let c=await $e();if(!c)return[];n(`reading what a sweep of ${e.target} would take for the loads a reload replaces\u2026`);let h=y.length;await L("frozen:remove:sweep",{targetOrgId:g,loadedAt:c.loadedAt,reload:!0,...B("removal")});let v=y.slice(h);if(v.some(b=>b.type==="frozen:remove:sweep:error"))return;let w=v.filter(b=>b.type==="frozen:remove:sweep:response").at(-1)?.payload?.loads;return[...new Set((w??[]).flatMap(({listing:b})=>Re(b,e)))]}async function co(c){n(`reading what a sweep of ${e.target} would take\u2026`);let h=y.length;await L("frozen:remove:sweep",{targetOrgId:g,loadedAt:c,...B("removal")});let v=y.slice(h);if(v.some(A=>A.type==="frozen:remove:sweep:error"))return;let w=v.filter(A=>A.type==="frozen:remove:sweep:response").at(-1)?.payload,b=[...w?.listing?[w.listing]:[],...(w?.otherLoads??[]).map(({listing:A})=>A)];return[...new Set(b.flatMap(A=>Re(A,e)))]}async function Ye(c){n(`reading what ${t?`a replay of ${s.source}`:"a load"} into ${e.target}${e.pilot?" (pilot)":""} would do\u2026`),await L("frozen:load:preview",{targetOrgId:g,...B("load"),...e.pilot?{pilot:!0}:{},...e.reload?{reload:!0}:{},...e.goneFirst!==void 0?{goneFirst:Ao(e.goneFirst)}:{},...e.writeEncrypted?{writeEncrypted:!0}:{},...e.muteAutomation?{muteAutomation:!0}:{},...e.acceptEmails?{acceptEmails:!0}:{},...e.acceptAutomation?{acceptAutomation:!0}:{}});let h=y.find(R=>R.type==="frozen:load:preview:response")?.payload?.plan,v=y.find(R=>R.type==="frozen:load:preview:error"&&R.payload?.code==="LOAD_CONFIG")?.payload;if(h===void 0&&v!==void 0){j.push({code:"LOAD_CONFIG",message:String(v.message??"")});let R=Array.isArray(v.refusedBeside)?v.refusedBeside:[];for(let{code:I,message:Y}of R)U({code:I,message:Y})}let w=h?Bt(pe(h),e.maxTotal):void 0;w&&U({code:"MAX_RECORDS",message:w});let b=h?.automation?.refused;b&&U(b);let A=h?.emails?.refused;A&&U(A);let k=y.find(R=>R.type==="frozen:load:preview:response")?.payload?.replay?.storage?.refusal??h?.storage?.refusal;k&&U(k);let O=h?.apiRequests?.refused;O&&U(O);let _=(h&&e.sweep?await Qe():[])??[],T=h?await Je(_):void 0;T?.refusal!==void 0&&U({code:T.code??"AUTOMATION_NOT_ACCEPTED",message:T.refusal});let W;if(e.muteAutomation&&h&&F){W=await oe(F).read(g,[...new Set([...h.perObject.map(I=>I.objectApiName),...T?.steps?.delete??[]])]);let R=await Fe(Ee(F),W,{writes:Xo(T?.steps)});if("refused"in R)j.some(({message:I})=>I===R.refused.message)||U(R.refused);else{for(let I of Z(R.planned,e.target??"the target"))n(I);K={mutedAutomation:R.planned,mutePlan:R.plan}}}for(let R of lo(h?.recordTypesGiven,!0,(K?.mutePlan.assign.length??0)>0))n(R);let ae=h?ao(h):[];if(c&&u&&h&&F&&ae.length>0){W??=await oe(F).read(g,h.perObject.map(Y=>Y.objectApiName)).catch(()=>{});let{estimate:R,refused:I}=await io(u,{written:ae,running:so(W,K?.mutePlan)});if(R){H=R;for(let Y of Ne(R))n(Y)}I!==void 0&&U({code:ce,message:I})}return h}async function fo(c){let h=y.length,v=z;M=!0;try{await L("frozen:remove:sweep",{targetOrgId:g,loadedAt:c,...B("removal")})}finally{M=!1}let w=y.splice(h);z=v;let b=w.find(A=>A.type==="frozen:remove:sweep:response")?.payload?.listing;return b&&b.refusal===void 0&&b.found.length>0?b:void 0}async function po(){if(t||await L("frozen:config:save",{config:i}),z)return"ended";switch(e.step){case"select":n(`selecting from ${e.source}\u2026`),await L("frozen:select",{sourceOrgId:p});break;case"extract":n(`extracting from ${e.source}\u2026`),await L("frozen:extract",{sourceOrgId:p,...e.author?{author:e.author}:{}});break;case"load":{if(e.dryRun){if(await Ye(!0),t&&!z)for(let k of t.dryRunEnd(j))n(k);break}let c;if(t){if(c=await Ye(!1),K=void 0,c===void 0||z||j.length>0)return E??=j[0],z=!0,n("Nothing written."),"ended";if(pe(c)===0)return n(`Nothing to create in ${e.target??"the target"}: nothing written.`),"ended"}let h=e.reload&&!e.pilot&&e.sweep?await Qe():[];if(h===void 0)return n("Nothing written."),"ended";let v=e.reload&&!e.pilot?await Je(h):void 0;if(v?.refusal!==void 0)return E={code:v.code??"AUTOMATION_NOT_ACCEPTED",message:v.refusal},j.push(E),n(ee(E)),z=!0,"ended";if(e.sweep&&(n(`around the purge, a sweep deletes what the target's automation made for each ${s.run} it replaces, as the ${s.run}'s user, tied to its records \u2014 run with --dry-run to see what`),C.setRemovalAsker(async k=>{let{lines:O,refusal:_}=xe(k,e.target??"",s.againSubject.sweep);for(let T of O)n(T);if(!(_===void 0||e.acceptAutomation))return E={code:"AUTOMATION_NOT_ACCEPTED",message:_},j.push(E),E})),!e.yes&&!await yt(t&&c?t.question(c):`Load the frozen dataset into ${e.target}${e.reload?`, purging first what earlier loads created${e.sweep?" and what the target's automation made for them":""}`:""}?`))return n("Nothing written."),"ended";let w;if(u&&F){let k=c?ao(c):Zo(Q??""),O=await oe(F).read(g,k).catch(()=>{}),_={written:k,running:so(O,e.muteAutomation&&O?Te(O,qe).plan:void 0)},{estimate:T,refused:W}=await io(u,_);if(T){H=T;for(let I of Ne(T))n(I)}if(W!==void 0||T===void 0)return Ze(`${W??""} Nothing was written.`.trim()),"ended";S=new AbortController;let ae=S.signal,R=await ft(()=>u.take(_,T,{signal:ae})).finally(()=>{S=void 0});if("stop"in R)return R.stop.code!==ce?(P=!0,"ended"):(Ze(Rt(R.stop)),"ended");w=R.checkpoint,H=w;for(let I of St(w,e.target??"the target",e.muteAutomation))n(I)}n(t?`replaying ${s.source} into ${e.target}\u2026`:`loading into ${e.target}${e.pilot?" (pilot)":""}\u2026`);let b=new Date().toISOString(),A=e.maxTotal??(c?pe(c):void 0);await L("frozen:load",{targetOrgId:g,...B("load"),...e.pilot?{pilot:!0}:{},...e.reload?{reload:!0}:{},...e.writeEncrypted?{writeEncrypted:!0}:{},...A!==void 0?{maxRecords:A}:{},...e.muteAutomation?{muteAutomation:!0}:{},...e.sweep?{sweep:!0}:{},...e.sweepLate?{sweepLate:!0}:{},...e.sweepUntied?{sweepUntied:!0}:{},...e.sweep&&e.includeChanged?{includeChanged:!0}:{},...e.acceptEmails?{acceptEmails:!0}:{},...e.acceptAutomation?{acceptAutomation:!0}:{}});let N=y.filter(k=>k.type==="frozen:load:error").map(Be).find(k=>k!==void 0);if(N&&!E&&(E=N,j.push(E)),g&&Me(y)){let k=Wt(await new Mt(m,{orgId:g}).recorded().catch(()=>{}),b);try{qt(te(),{organizationId:g,sas:Pe(m),startedAt:b,endedAt:new Date().toISOString(),...k?{lastWriteAt:k}:{}})}catch(O){n(`warning: this load could not be added to ${te()}: another sas's sweep of ${e.target??""} will not see it (${O instanceof Error?O.message:String(O)})`)}}if(u&&w){let k=w;H=await u.settle(k,Me(y)).catch(O=>(n(`warning: the checkpoint '${k.name}' taken before the load could not be deleted (${O instanceof Error?O.message:String(O)}): delete it with ${ke("checkpoint")} delete --org ${e.target??""} --checkpoint `+k.checkpointId),k));for(let O of Ot(H))n(O)}break}case"verify":n(t?`verifying the replay of ${s.source} into ${e.target}\u2026`:`verifying ${e.target}\u2026`),await L("frozen:verify",{targetOrgId:g,...B("verify")});break;case"remove":{let c=await $e();if(!c)return n(`No ${s.run} into ${e.target} is recorded ${s.recordedIn}: nothing to remove.`),"ended";if(e.preview){if(n(`reading what a removal from ${e.target} would do\u2026`),await L("frozen:remove:preview",{targetOrgId:g,loadedAt:c.loadedAt,...e.includeChanged?{includeChanged:!0}:{},...B("removal")}),y.some(w=>w.type==="frozen:remove:preview:response")){let w=e.sweep?await co(c.loadedAt):[];if(w===void 0)break;let{planned:b,refusal:A,code:N}=await Xe({targetOrgId:g,loadedAt:c.loadedAt,...w.length>0?{sweptObjects:w}:{}});if(b&&(K={mutedAutomation:b.planned,mutePlan:b.plan}),A!==void 0){let k={code:N??"AUTOMATION_NOT_ACCEPTED",message:A};be.push(k),n(ue(k,"a removal"))}}break}if(e.sweepList){n(`reading what a sweep of ${e.target} would take\u2026`),await L("frozen:remove:sweep",{targetOrgId:g,loadedAt:c.loadedAt,...B("removal")});let w=y.filter(b=>b.type==="frozen:remove:sweep:response").at(-1)?.payload;Ke=[w?.listing,...(w?.otherLoads??[]).map(({listing:b})=>b)].some(b=>b?.refusal!==void 0);break}for(let w of Eo(c,e.target??"",s))n(w);e.sweep&&n(`${Ge(c)>0?"before them, a sweep deletes":"a sweep alone deletes"} what the target's automation made for the ${s.run}, as the ${s.run}'s user, tied to its records \u2014 run ${De("--sweep-list")} to see what`);let h=!1;if(C.setRemovalAsker(async w=>{let{lines:b,refusal:A}=xe(w,e.target??"");for(let N of b)n(N);if(A!==void 0&&!e.acceptAutomation)return{message:A,code:"AUTOMATION_NOT_ACCEPTED"};if(!e.yes&&Fo(c,w.steps)){q=!0;let N=await vt(`Type ${e.target} to delete them:`);if(q=!1,N!==e.target)return h=!0,{message:"Nothing deleted.",code:uo}}n(`removing from ${e.target}\u2026`)}),await L("frozen:remove",{targetOrgId:g,loadedAt:c.loadedAt,...So(e),...B("removal")}),h)return"ended";let v=y.filter(w=>w.type==="frozen:remove:error").map(Be).find(w=>w!==void 0);if(v&&(E=v,be.push(v)),!e.sweep&&!E&&xo(y)){X=await fo(c.loadedAt);for(let w of Mo(X,s))n(w)}break}case"status":await L("frozen:status",{});break}return"through"}}var qe=(e,t)=>t==="insert"||t==="update";function Xo(e){let t=e?ie(e):void 0;return(o,n)=>qe(o,n)||t?.(o,n)===!0}function lo(e,t,o=!1){return Nt((e??[]).map(n=>({recordTypeGiven:n})),t,o)}function so(e,t){return{firing:e?nt(e,t,qe).firing:[]}}function ao(e){let t=[...e.perObject.filter(o=>o.toInsert>0||o.toPurge>0||o.toDeactivate>0).map(o=>o.objectApiName),...(e.placeholders??[]).map(o=>o.placeholderObjectApiName)];return[...new Set(t)]}function Zo(e){try{let t=JSON.parse(ve(G(e,"manifest.json"),"utf8")),o=Object.entries(t.volumetry?.measured??{}).filter(([,n])=>typeof n=="number"&&n>0).map(([n])=>n);if(o.length>0)return o}catch{}try{return go(G(e,"data")).filter(t=>t.endsWith(".json")).map(t=>t.slice(0,-5)).sort()}catch{return[]}}var Jo=new Set(["INVALID_PAYLOAD","CONFIG_MISSING",le.code,"REPLACE_LEAVES_RECORDS","MUTE_PRODUCTION","MUTE_NO_RIGHT","MUTE_FAILED","EMAILS_NOT_ACCEPTED","FROZEN_EMAILS_EXCEEDED","AUTOMATION_NOT_ACCEPTED",ze,"FROZEN_STORAGE_EXCEEDED"]);function Me(e){let t=i=>e.filter(m=>m.type===i).at(-1)?.payload,o=t("frozen:load:response")?.report;if(o){let i=m=>Object.values(m??{}).reduce((r,d)=>r+d,0);return o.perObject.some(m=>m.inserted>0)||(o.placeholders??[]).length>0||i(o.purge?.deleted)>0||i(o.purge?.deactivated)>0}let n=t("frozen:load:error"),s=n?.code;return typeof s=="string"&&Jo.has(s)?!1:n?.written!==0}async function io(e,t){try{let o=await e.scope(t);return{estimate:o,...o.refusal!==void 0?{refused:kt(o.refusal)}:{}}}catch(o){return{refused:lt(o).replace(/ Nothing was written\.$/,"")}}}function Qo(e,t=!0,o=x){let n=o===x?"the sas":"the folder of its replays";return e==="load"&&!t?`interrupted: the ${o.run} stopped before it created or purged a record: ${n} is as it was, and ${o.remove} has nothing of this ${o.run} to take back`:e==="load"?`interrupted: the ${o.run} stopped before it was through; what it wrote is recorded in ${n} and the audit trail, and ${o.remove} takes it back`:e==="remove"?`interrupted: the removal stopped before it was through; what it deleted is recorded, and ${o.remove} again takes what it left`:e==="preview"?"interrupted: the preview stopped before it was through, and deleted nothing":`interrupted: the ${e} stopped before it was through`}process.argv[1]?.includes("sandforge-frozen")&&(Et(),Ko().then(()=>process.exit(process.exitCode??0)).catch(e=>{process.stderr.write(`${e instanceof Error?e.message:String(e)}
|
|
272
|
+
`),process.exit(1)}));export{Ao as a,$o as b,ko as c,x as d,So as e,xe as f,Eo as g,Fo as h,eo as i,Co as j,Be as k,Ue as l,Io as m,Do as n,Po as o,no as p,xo as q,Mo as r,_o as s,Bo as t,Uo as u,qo as v,Vo as w,Ko as x,Ho as y,lo as z,ao as A,Zo as B,Me as C,Qo 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{a as y,b as g}from"./chunk-
|
|
7
|
+
import{a as y,b as g}from"./chunk-HYBH5PFM.mjs";import{a as S,b as f,c as p}from"./chunk-K77NR3UK.mjs";import{b as u}from"./chunk-CA5NAXSU.mjs";import{Ha as d}from"./chunk-DPYTG6DM.mjs";var h="SELECT ApiName, MasterLabel, IsClosed, IsDefault, SortOrder FROM CaseStatus ORDER BY SortOrder",w="SELECT MasterLabel, IsClosed, IsDefault, SortOrder FROM CaseStatus ORDER BY SortOrder",A="Closed";async function k(a){let e;try{e=await a(h)}catch{try{e=await a(w)}catch(t){return m(`the org would not read its case statuses: ${u(t)}`)}}let r=e.flatMap(t=>{let n=b(t.ApiName)??b(t.MasterLabel);return n===void 0?[]:[{value:n,closed:t.IsClosed===!0,isDefault:t.IsDefault===!0}]}),o=r.filter(t=>!t.closed),i=r.filter(t=>t.closed);return o.length===0||i.length===0?m(o.length===0?"the org has no case status that leaves a case open":"the org has no case status that closes a case"):{open:(o.find(t=>t.isDefault)??o[0]).value,closed:(i.find(t=>t.value===A)??i[0]).value,from:"org"}}function m(a){return{...d.caseStatus,from:"default",reason:a}}function b(a){return typeof a=="string"&&a.trim()!==""?a:void 0}var c=S;async function E(a,e){let r;try{r=await a(c)}catch{r={access:"createable"}}if(r.access==="absent")return{available:!1,reason:r.reason??`the org has no ${c}`};if(r.access==="readOnly")return{available:!1,reason:r.reason??`the user this seed runs as may read ${c} and not create it`};try{return{available:!0,bodyFields:f(await e(c))}}catch{return{available:!0,bodyFields:[]}}}var P=["Status","Origin","Priority","Type"];async function T(a){let e;try{e=(await a("Case")).fields}catch{return}let r={};for(let o of P){let t=(e.find(n=>n.name===o)?.picklistValues??[]).filter(n=>n.active!==!1).map(n=>n.value);t.length>0&&(r[o]=t)}return r}function v(a,e){let r=e.knowledge.available?e.knowledge.bodyFields:[],o=r.map(s=>s.name),i=e.articleBodyField===void 0?r[0]:r.find(s=>s.name===e.articleBodyField);if(e.articleBodyField!==void 0&&i===void 0)return{issues:[`options.articleBodyField: ${e.articleBodyField} is not a field of ${c} this org lets a body be written to`+(o.length>0?` (${o.join(", ")})`:"")]};let t=e.knowledge.available?{available:!0,bodyFields:o}:e.knowledge,n={seed:e.seed??d.seed,caseStatus:{open:e.caseStatus.open,closed:e.caseStatus.closed},...i!==void 0?p(i):{}},l;try{l=g(a,n)}catch(s){if(s instanceof y)return{issues:s.issues};throw s}return{preparation:{options:n,objects:[...l.template.objects].sort((s,C)=>s.insertOrder-C.insertOrder).map(s=>({objectApiName:s.objectApiName,recordCount:s.recordCount,...s.optional===!0?{optional:!0}:{}})),tests:l.tests.length,caseStatusFrom:e.caseStatus.from==="org"?{from:"org"}:{from:"default",reason:e.caseStatus.reason},knowledge:t}}}function D(a){return async e=>{let r=await a.query(e),o=[...r.records];for(;!r.done&&r.nextRecordsUrl;)r=await a.queryMore(r.nextRecordsUrl),o.push(...r.records);return o}}export{h as a,w as b,k as c,c as d,E as e,T as f,v as g,D as h};
|
|
@@ -4,5 +4,5 @@ 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{f as l,g as m,h as f,i as c,j as h}from"./chunk-FQGHL7GR.mjs";import{
|
|
7
|
+
import{f as l,g as m,h as f,i as c,j as h}from"./chunk-FQGHL7GR.mjs";import{Ma as d,Oa as g}from"./chunk-DPYTG6DM.mjs";var x=50,A="en_US",$=["Contact details must reach nobody:","- every email address uses example.com, example.net, example.org, or a domain ending in .example, .invalid or .test, such as jane.doe@acme.example;",`- every phone number takes one of these forms, X being any digit: ${Object.values(l).map(t=>t.phoneFormats[0]).join(", ")}.`],u=class{callAI;constructor(e){this.callAI=e}async generate(e,i,r){if(i<=0||e.length===0)return[];let o=[],n=i,s=new Set(e.filter(p=>p.fieldType?.toLowerCase()==="phone").map(p=>p.fieldApiName)),a=E();for(;n>0;){let p=Math.min(n,x),R=_(e,p,r),w=await this.callAI(R),y=O(w);o.push(...y.map(N=>I(N,s,a))),n-=p}return o.slice(0,i)}};function E(){let t=0;return e=>h(f(e)??A,t++)}function _(t,e,i){let r=t.map(n=>{let s=[`- ${n.fieldApiName} (${n.ruleType})`];return n.config.aiPrompt&&s.push(`: ${n.config.aiPrompt}`),(n.config.minValue!==void 0||n.config.maxValue!==void 0)&&s.push(` [range: ${n.config.minValue??""}..${n.config.maxValue??""}]`),(n.config.minLength!==void 0||n.config.maxLength!==void 0)&&s.push(` [length: ${n.config.minLength??""}..${n.config.maxLength??""}]`),s.join("")}),o=[];return i&&(o.push(`Persona: ${i}`),o.push("")),o.push(`Generate exactly ${e} JSON objects with these fields:`),o.push(...r),o.push(""),o.push(...$),o.push(""),o.push("Return ONLY a JSON array of objects. No markdown, no explanation."),o.join(`
|
|
8
8
|
`)}function O(t){return d(g,t)}var P=new RegExp("(?<![\\p{L}\\p{N}._%+-])([\\p{L}\\p{N}._%+-]+)@((?:[\\p{L}\\p{N}](?:[\\p{L}\\p{N}-]{0,61}[\\p{L}\\p{N}])?\\.)+\\p{L}{2,63})(?![\\p{L}\\p{N}-])","gu"),S=/phone|mobile|fax|telef|^tel$/i,b=/^\+?[\d ()./-]+$/,D=/(?<![\w+.@-])(?<!\d )(?:(?:\+\d+|\(\d{1,4}\)|0\d*)(?:[ ./-]?\(\d+\)|[ ./-]\d+|(?<=\))\d+)*|\d{3}[ .-]\d{3}[ .-]\d{4}|(?<![€$£¥] ?)(?:[6-9]\d{2}(?<sep>[ .-])\d{3}\k<sep>\d{3}|[6-9]\d{2} \d{2} \d{2} \d{2}|[1-9]{2} (?:9 ?)?\d{4}-\d{4})(?![ ./,-]?\d| ?[€$£¥%]))(?![\w@])/g,F=/^\d{1,4}[./-]\d{1,2}[./-]\d{1,4}$/,L={least:8,most:15};function I(t,e,i){let r={};for(let[o,n]of Object.entries(t))r[o]=k(o,n,e,i);return r}function k(t,e,i,r){let o=i.has(t)||S.test(t.replace(/__p?c$/i,"")),n=typeof e=="number"?String(e):typeof e=="string"?e:void 0;return o&&n!==void 0&&/\d/.test(n)&&b.test(n.trim())?c(n)?e:r(n):typeof e!="string"?e:e.replace(P,(s,a,p)=>m(p)?s:`${a}@${T(p)}`).replace(D,s=>C(s)&&!c(s)?r(s):s)}function C(t){let e=t.replace(/\D/g,"").length;return e>=L.least&&e<=L.most&&!F.test(t)}function T(t){return`${t.split(".").slice(0,-1).join(".")}.example`}export{u as a,E as b,_ as c,O as d,I as e};
|
|
@@ -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{e as $}from"./chunk-MAHZMPMZ.mjs";import{m as F,o as A}from"./chunk-CULAOP3U.mjs";import{c as M}from"./chunk-HF6LAK3G.mjs";var k=class{avgSecondsPerApiCall;batchStrategy;constructor(u){this.avgSecondsPerApiCall=u?.avgSecondsPerApiCall??.5,this.batchStrategy=new M}generate(u){let a=u.nodes.filter(o=>o.included);if(a.length===0)return{waves:[],totalRecords:0,totalApiCalls:0,estimatedDurationSeconds:0,cycleResolutions:[]};let{edges:c,components:t}=G(u),i=this.computeTopoLevels(c,t),l=new Map;for(let o of a){let e=i.get(o.objectApiName)??o.level,h=l.get(e);h?h.push(o.objectApiName):l.set(e,[o.objectApiName])}let n=[...l.keys()].sort((o,e)=>o-e),s=new Map(a.map(o=>[o.objectApiName,o])),g=n.map((o,e)=>{let h=l.get(o)??[],v=0,b=0,w=0;for(let N of h){let j=s.get(N);if(!j)continue;v+=j.recordCount;let x=this.batchStrategy.resolve(j.batchStrategy,j.recordCount),C=$(x,j.recordCount).batchCount;b+=C;let O=C*this.avgSecondsPerApiCall;O>w&&(w=O)}return{order:e,objectApiNames:h,totalRecords:v,estimatedDurationSeconds:w,estimatedApiCalls:b}}),r=this.detectCycles(u,c,t),p=g.reduce((o,e)=>o+e.totalRecords,0),f=g.reduce((o,e)=>o+e.estimatedApiCalls,0),m=g.reduce((o,e)=>o+e.estimatedDurationSeconds,0);return{waves:g,totalRecords:p,totalApiCalls:f,estimatedDurationSeconds:m,cycleResolutions:r}}computeTopoLevels(u,a){let c=new Map;a.forEach((n,s)=>{for(let g of n)c.set(g,s)});let t=new Map;for(let n of u){let s=c.get(n.sourceObject),g=c.get(n.targetObject);if(s===void 0||g===void 0||s===g)continue;let r=t.get(s);r?r.push(g):t.set(s,[g])}let i=a.map(()=>0);for(let n=a.length-1;n>=0;n--)for(let s of t.get(n)??[])i[s]=Math.max(i[s],i[n]+1);let l=new Map;for(let[n,s]of c)l.set(n,i[s]);return l}detectCycles(u,a,c){let t=c.filter(n=>n.length>1);if(t.length===0)return[];let i=new Map(A(u).map((n,s)=>[n.objectApiName,s])),l=n=>i.get(n)??0;return t.map(n=>{let s=new Set(n),g=[...n].sort((e,h)=>l(e)-l(h)),r=a.filter(e=>s.has(e.sourceObject)&&s.has(e.targetObject)&&l(e.targetObject)<l(e.sourceObject)),p=r.filter(e=>e.required===!0);if(p.length>0){let e=[...new Set(p.map(b=>b.targetObject))],h=[...new Set(p.map(b=>b.sourceObject))],v=e.length===1;return{objects:g,strategy:"unbreakable",description:`The run cannot break this cycle: ${y(p.map(S))} may not be left empty, and no order writes ${y(h)} first. ${y(e)} ${v?"is":"are"} refused, and what cannot be written without ${v?"it":"them"} is skipped.`}}let f=r.filter(e=>e.insertOnly!==!0),m=r.filter(e=>e.insertOnly===!0),o=[...f.length>0?[`${y(f.map(S))} left empty at insert and filled in by the second pass`]:[],...m.length>0?[`${y(m.map(S))} left empty for good: only an insert sets ${m.length===1?"it":"them"}, and no order writes ${y([...new Set(m.map(e=>e.sourceObject))])} first`]:[]];return{objects:g,strategy:"nullable_lookup",description:`Written in this order, with ${o.join(", and ")}.`}})}};function G(d){let u=d.nodes.filter(t=>t.included).map(t=>t.objectApiName),a=new Set(u),c=d.edges.filter(t=>t.sourceObject!==t.targetObject&&a.has(t.sourceObject)&&a.has(t.targetObject)&&F(t));return{edges:c,components:R(u,c)}}function R(d,u){let a=new Map;for(let r of d)a.set(r,[]);for(let r of u)a.get(r.sourceObject)?.push(r.targetObject);let c=0,t=new Map,i=new Map,l=new Set,n=[],s=[],g=r=>{let p=[];for(t.set(r,c),i.set(r,c),c++,n.push(r),l.add(r),p.push({v:r,neighbors:a.get(r)??[],i:0});p.length>0;){let f=p[p.length-1];if(f.i<f.neighbors.length){let e=f.neighbors[f.i++];t.has(e)?l.has(e)&&i.set(f.v,Math.min(i.get(f.v),t.get(e))):(t.set(e,c),i.set(e,c),c++,n.push(e),l.add(e),p.push({v:e,neighbors:a.get(e)??[],i:0}));continue}let m=f.v;p.pop();let o=p[p.length-1];if(o&&i.set(o.v,Math.min(i.get(o.v),i.get(m))),i.get(m)===t.get(m)){let e=[],h;do h=n.pop(),l.delete(h),e.push(h);while(h!==m);s.push(e)}}};for(let r of d)t.has(r)||g(r);return s}function S(d){return`${d.targetObject}'s lookup to ${d.sourceObject}`}function y(d){return d.length<=1?d.join(""):`${d.slice(0,-1).join(", ")} and ${d[d.length-1]}`}export{k as a,R 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{c as z,d as v,f as A,j as k,k as c,l as R}from"./chunk-FQGHL7GR.mjs";import{eb as f}from"./chunk-B45CNPUX.mjs";var L={en_US:[{city:"New York",state:"New York",country:"United States",zipCode:"10001"},{city:"Los Angeles",state:"California",country:"United States",zipCode:"90001"},{city:"Chicago",state:"Illinois",country:"United States",zipCode:"60601"},{city:"Houston",state:"Texas",country:"United States",zipCode:"77001"},{city:"Phoenix",state:"Arizona",country:"United States",zipCode:"85001"},{city:"Philadelphia",state:"Pennsylvania",country:"United States",zipCode:"19101"},{city:"San Antonio",state:"Texas",country:"United States",zipCode:"78201"},{city:"San Diego",state:"California",country:"United States",zipCode:"92101"},{city:"Dallas",state:"Texas",country:"United States",zipCode:"75201"},{city:"Austin",state:"Texas",country:"United States",zipCode:"78701"}],fr_FR:[{city:"Paris",state:"Ile-de-France",country:"France",zipCode:"75001"},{city:"Lyon",state:"Auvergne-Rhone-Alpes",country:"France",zipCode:"69001"},{city:"Marseille",state:"Provence-Alpes-Cote d'Azur",country:"France",zipCode:"13001"},{city:"Toulouse",state:"Occitanie",country:"France",zipCode:"31000"},{city:"Nice",state:"Provence-Alpes-Cote d'Azur",country:"France",zipCode:"06000"},{city:"Bordeaux",state:"Nouvelle-Aquitaine",country:"France",zipCode:"33000"},{city:"Strasbourg",state:"Grand Est",country:"France",zipCode:"67000"},{city:"Nantes",state:"Pays de la Loire",country:"France",zipCode:"44000"},{city:"Lille",state:"Hauts-de-France",country:"France",zipCode:"59000"},{city:"Rennes",state:"Bretagne",country:"France",zipCode:"35000"}],de_DE:[{city:"Berlin",state:"Berlin",country:"Germany",zipCode:"10115"},{city:"Munich",state:"Bavaria",country:"Germany",zipCode:"80331"},{city:"Hamburg",state:"Hamburg",country:"Germany",zipCode:"20095"},{city:"Frankfurt",state:"Hesse",country:"Germany",zipCode:"60311"},{city:"Cologne",state:"North Rhine-Westphalia",country:"Germany",zipCode:"50667"},{city:"Stuttgart",state:"Baden-Wurttemberg",country:"Germany",zipCode:"70173"},{city:"Dusseldorf",state:"North Rhine-Westphalia",country:"Germany",zipCode:"40213"},{city:"Leipzig",state:"Saxony",country:"Germany",zipCode:"04109"},{city:"Dresden",state:"Saxony",country:"Germany",zipCode:"01067"},{city:"Hannover",state:"Lower Saxony",country:"Germany",zipCode:"30159"}],es_ES:[{city:"Madrid",state:"Comunidad de Madrid",country:"Spain",zipCode:"28001"},{city:"Barcelona",state:"Catalonia",country:"Spain",zipCode:"08001"},{city:"Valencia",state:"Comunitat Valenciana",country:"Spain",zipCode:"46001"},{city:"Seville",state:"Andalusia",country:"Spain",zipCode:"41001"},{city:"Zaragoza",state:"Aragon",country:"Spain",zipCode:"50001"},{city:"Malaga",state:"Andalusia",country:"Spain",zipCode:"29001"},{city:"Bilbao",state:"Basque Country",country:"Spain",zipCode:"48001"},{city:"Murcia",state:"Region de Murcia",country:"Spain",zipCode:"30001"},{city:"Palma",state:"Balearic Islands",country:"Spain",zipCode:"07001"},{city:"Granada",state:"Andalusia",country:"Spain",zipCode:"18001"}],ja_JP:[{city:"Tokyo",state:"Tokyo",country:"Japan",zipCode:"100-0001"},{city:"Osaka",state:"Osaka",country:"Japan",zipCode:"530-0001"},{city:"Yokohama",state:"Kanagawa",country:"Japan",zipCode:"220-0011"},{city:"Nagoya",state:"Aichi",country:"Japan",zipCode:"450-0001"},{city:"Sapporo",state:"Hokkaido",country:"Japan",zipCode:"060-0001"},{city:"Fukuoka",state:"Fukuoka",country:"Japan",zipCode:"810-0001"},{city:"Kobe",state:"Hyogo",country:"Japan",zipCode:"650-0001"},{city:"Kyoto",state:"Kyoto",country:"Japan",zipCode:"600-8001"},{city:"Sendai",state:"Miyagi",country:"Japan",zipCode:"980-0001"},{city:"Hiroshima",state:"Hiroshima",country:"Japan",zipCode:"730-0001"}],pt_BR:[{city:"Sao Paulo",state:"Sao Paulo",country:"Brazil",zipCode:"01000-000"},{city:"Rio de Janeiro",state:"Rio de Janeiro",country:"Brazil",zipCode:"20000-000"},{city:"Brasilia",state:"Distrito Federal",country:"Brazil",zipCode:"70000-000"},{city:"Salvador",state:"Bahia",country:"Brazil",zipCode:"40000-000"},{city:"Fortaleza",state:"Ceara",country:"Brazil",zipCode:"60000-000"},{city:"Belo Horizonte",state:"Minas Gerais",country:"Brazil",zipCode:"30000-000"},{city:"Manaus",state:"Amazonas",country:"Brazil",zipCode:"69000-000"},{city:"Curitiba",state:"Parana",country:"Brazil",zipCode:"80000-000"},{city:"Recife",state:"Pernambuco",country:"Brazil",zipCode:"50000-000"},{city:"Porto Alegre",state:"Rio Grande do Sul",country:"Brazil",zipCode:"90000-000"}]},B={en:"en_US",fr:"fr_FR",de:"de_DE",es:"es_ES",ja:"ja_JP",pt:"pt_BR"};function l(i){if(i in L)return i;let e=i.split("_")[0].toLowerCase();return B[e]??"en_US"}var u=class{tuples;resolvedLocale;constructor(e){this.resolvedLocale=l(e??"en_US"),this.tuples=L[this.resolvedLocale]}getAddress(e){return this.tuples[e%this.tuples.length]}getCity(e){return this.getAddress(e).city}getState(e){return this.getAddress(e).state}getCountry(e){return this.getAddress(e).country}getZipCode(e){return this.getAddress(e).zipCode}getLocaleData(){return c(this.resolvedLocale)}};var F={en_US:"US",fr_FR:"FR",de_DE:"DE",es_ES:"ES",ja_JP:"JP",pt_BR:"BR"},$={fr_FR:{country:"FR",bbanLength:23},de_DE:{country:"DE",bbanLength:18},es_ES:{country:"ES",bbanLength:20},en_US:{country:"DE",bbanLength:18},ja_JP:{country:"DE",bbanLength:18},pt_BR:{country:"DE",bbanLength:18}},w="ABCDEFGHIJKLMNPQRSTUVWXYZ",T=["Ergonomic","Handcrafted","Refined","Sleek","Rustic","Compact","Modular","Insulated"],E=["Steel","Wooden","Cotton","Granite","Rubber","Leather","Ceramic"],_=["Chair","Table","Lamp","Keyboard","Backpack","Bottle","Headphones","Gloves","Bench"],M=["Senior","Lead","Junior","Principal","Associate","Chief"],P=["Marketing","Operations","Finance","Sales","Product","Customer Success"],U=["Manager","Analyst","Coordinator","Specialist","Director","Consultant"],G=["Adaptive","Integrated","Customer-focused","Scalable","Secure"],O=["cloud-based","real-time","data-driven","modular","global"],I=["platform","solution","workflow","service","framework","network"],J=["daily use at home or in the office","long days on the move","teams that need something that lasts","small spaces","outdoor work in any weather"],H=["Unable to log in","Invoice discrepancy","Password reset email not received","Order arrived damaged","Request for a refund","Cannot update billing address","Shipment delayed","Error when exporting a report","Product not working as described","Question about my contract","Charged twice for one order","Need help with installation","Account locked after failed logins","Wrong item delivered","Request: edit several records at once","App crashes on startup","Items missing from my order","Cannot download my invoice","Change of delivery address","Warranty claim","Slow since the last update","Question about my subscription renewal","Data not syncing between devices","Cancel my order","Upgrade to a higher plan"],x=["Asked the customer for a screenshot of the error.","Reproduced the issue on our side.","Escalated to the second-level team.","Sent the customer a workaround.","Customer confirmed the fix works.","Waiting for the customer's reply.","Refund approved and processed.","Replacement shipped today.","Called the customer, no answer; left a voicemail.","Linked to a known issue, a fix is planned.","Updated the customer's address on file.","Shared the knowledge article on this topic.","Closed after the customer confirmed.","Reset the account; login works again.","Checked the logs, nothing unusual found."],j=1440*60*1e3,V=365,Y=120,W=30,N=20,K=65,b=class{locale;localeData;geoGenerator;usernameToken=crypto.randomUUID().replace(/-/g,"").slice(0,8);random;today;companyDecks=new Map;companiesDealt=new Map;constructor(e,t={}){this.locale=e??"en_US",this.localeData=c(this.locale),this.geoGenerator=new u(this.locale),this.random=t.random??Math.random,this.today=t.today??(()=>new Date)}setLocale(e){this.locale=e,this.localeData=c(e),this.geoGenerator=new u(e)}generate(e,t,r=0){if(t<=0||e.length===0)return[];let a=[],o=e.filter(n=>f(n.config.fakerMethod??"lorem")==="phone");for(let n=r;n<r+t;n++){let d={},m=new Map,C=(s,p)=>{let y=m.get(s);if(y!==void 0)return y%p;let D=this.below(p);return m.set(s,D),D};for(let s of e){let p=o.indexOf(s),y=p>=0?n*o.length+p:n;d[s.fieldApiName]=this.generateFieldValue(s,y,C)}a.push(d)}return a}dateOf(e){return e==="pastDate"?this.pastDate():this.futureDate()}below(e){return Math.min(e-1,Math.floor(this.random()*e))}pick(e){return e[this.below(e.length)]}generateFieldValue(e,t,r){let a=e.config.fakerMethod??"lorem",o={min:e.config.minValue??0,max:e.config.maxValue??1e3},n=e.config.fakerLocale;if(n&&n!==this.locale){let d=this.locale,m=this.localeData,C=this.geoGenerator;this.locale=n,this.localeData=c(n),this.geoGenerator=new u(n);let s=this.generateByMethodInstance(a,t,o,r);return this.locale=d,this.localeData=m,this.geoGenerator=C,s}return this.generateByMethodInstance(a,t,o,r)}generateByMethodInstance(e,t,r,a){let o=f(e);if(!o)return Z(e);let n=()=>a("geo",1e4);switch(o){case"name":return`${this.firstName(a)} ${this.lastName(a)}`;case"firstName":return this.firstName(a);case"lastName":return this.lastName(a);case"jobTitle":return`${this.pick(M)} ${this.pick(P)} ${this.pick(U)}`;case"email":return this.generateEmail(t,a);case"username":return this.generateUsername(t,a);case"nickname":return this.generateNickname(t,a);case"phone":return this.generatePhone(t);case"address":return`${this.streetAddress()}, ${this.geoGenerator.getCity(n())}`;case"streetAddress":return this.streetAddress();case"city":return this.geoGenerator.getCity(n());case"country":return this.geoGenerator.getCountry(n());case"state":return this.geoGenerator.getState(n());case"company":return this.generateCompany();case"catchPhrase":return`${this.pick(G)} ${this.pick(O)} `+this.pick(I);case"date":case"pastDate":return this.pastDate();case"futureDate":return this.futureDate();case"futureDateTime":return this.futureDateTime();case"birthdate":return this.birthdate();case"number":case"integer":return Math.floor(r.min+this.random()*(r.max-r.min+1));case"float":return Math.round((r.min+this.random()*(r.max-r.min))*100)/100;case"boolean":return t%2===0;case"lorem":case"sentence":return g(t);case"paragraph":return q(t);case"caseSubject":return this.pick(H);case"caseComment":return this.pick(x);case"uuid":return this.uuid();case"url":return`https://example.com/resource/${t}`;case"zipCode":return this.geoGenerator.getZipCode(n());case"productName":return this.productName(a);case"productDescription":return`${this.productName(a)}, made for ${this.pick(J)}.`;case"iban":return this.generateIban(t);case"bic":return this.generateBic(t)}}firstName(e){let t=this.localeData.firstNames;return t[e("first",t.length)]}lastName(e){let t=this.localeData.lastNames;return t[e("last",t.length)]}generateEmail(e,t){let r=this.localeData.emailDomains[e%this.localeData.emailDomains.length];return`${h(this.firstName(t))}.${h(this.lastName(t))}${e}@${r}`}generateUsername(e,t){let r=h(this.firstName(t)),a=h(this.lastName(t)),o=this.localeData.emailDomains[e%this.localeData.emailDomains.length];return`${r}.${a}.${this.usernameToken}${e}@${o}`}generateNickname(e,t){return`${h(this.firstName(t)).slice(0,20)}.${this.usernameToken}${e}`}generatePhone(e){return k(this.locale,e)}streetAddress(){let{names:e,format:t}=z[l(this.locale)];return t.replace("{street}",this.pick(e)).replace("{n}",String(1+this.below(199))).replace("{m}",String(1+this.below(9)))}generateCompany(){let e=l(this.locale),t=A[e].companies.length,r=this.companyDecks.get(e);if(!r||r.length!==t){r=Array.from({length:t},(o,n)=>n);for(let o=r.length-1;o>0;o--){let n=this.below(o+1);[r[o],r[n]]=[r[n],r[o]]}this.companyDecks.set(e,r)}let a=this.companiesDealt.get(e)??0;return this.companiesDealt.set(e,a+1),v(e,r[a%r.length],Math.floor(a/r.length))}productName(e){let t=T[e("productAdjective",T.length)],r=E[e("productMaterial",E.length)],a=_[e("product",_.length)];return`${t} ${r} ${a}`}pastDate(){return S(this.daysFromToday(-(1+this.below(V))))}futureDate(){return S(this.daysFromToday(1+this.below(Y)))}futureDateTime(){let e=this.daysFromToday(1+this.below(W));return e.setUTCHours(8+this.below(9),this.below(2)*30,0,0),e.toISOString()}birthdate(){let e=(K-N)*365;return S(this.daysFromToday(-(N*365+this.below(e))))}daysFromToday(e){return new Date(this.today().getTime()+e*j)}uuid(){let e=Array.from({length:32},()=>this.below(16).toString(16));e[12]="4",e[16]=(this.below(16)&3|8).toString(16);let t=e.join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}generateIban(e){let t=$[l(this.locale)],r=R("#".repeat(t.bbanLength),e);return`${t.country}${X(t.country,r)}${r}`}generateBic(e){let t=Array.from({length:4},(a,o)=>String.fromCharCode(65+(e*5+o*7+3)%26)).join(""),r=Array.from({length:2},(a,o)=>w[(e*3+o*11+2)%w.length]).join("");return`${t}${F[l(this.locale)]}${r}XXX`}};function oe(i,e,t,r,a){let o=new b(r,a),n={fieldApiName:"temp",ruleType:"faker",config:{fakerMethod:i,minValue:t.min,maxValue:t.max}};return o.generate([n],e+1)[e]?.temp}function S(i){return i.toISOString().split("T")[0]}function h(i){return i.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z]/g,"")}function X(i,e){let t=`${e}${i}00`.replace(/[A-Z]/g,a=>String(a.charCodeAt(0)-55)),r=0;for(let a of t)r=(r*10+Number(a))%97;return String(98-r).padStart(2,"0")}function Z(i){throw new Error(`Faker method "${i}" is not implemented: choose a method SandForge generates, or remove it from the field rule.`)}function g(i){let e=["lorem","ipsum","dolor","sit","amet","consectetur","adipiscing","elit"],t=i%e.length,r=[];for(let a=0;a<6;a++)r.push(e[(t+a)%e.length]);return r.join(" ")+"."}function q(i){return[g(i),g(i+1),g(i+2)].join(" ")}export{b as a,oe as b};
|
|
7
|
+
import{c as z,d as v,f as A,j as k,k as c,l as R}from"./chunk-FQGHL7GR.mjs";import{Hb as f}from"./chunk-DPYTG6DM.mjs";var L={en_US:[{city:"New York",state:"New York",country:"United States",zipCode:"10001"},{city:"Los Angeles",state:"California",country:"United States",zipCode:"90001"},{city:"Chicago",state:"Illinois",country:"United States",zipCode:"60601"},{city:"Houston",state:"Texas",country:"United States",zipCode:"77001"},{city:"Phoenix",state:"Arizona",country:"United States",zipCode:"85001"},{city:"Philadelphia",state:"Pennsylvania",country:"United States",zipCode:"19101"},{city:"San Antonio",state:"Texas",country:"United States",zipCode:"78201"},{city:"San Diego",state:"California",country:"United States",zipCode:"92101"},{city:"Dallas",state:"Texas",country:"United States",zipCode:"75201"},{city:"Austin",state:"Texas",country:"United States",zipCode:"78701"}],fr_FR:[{city:"Paris",state:"Ile-de-France",country:"France",zipCode:"75001"},{city:"Lyon",state:"Auvergne-Rhone-Alpes",country:"France",zipCode:"69001"},{city:"Marseille",state:"Provence-Alpes-Cote d'Azur",country:"France",zipCode:"13001"},{city:"Toulouse",state:"Occitanie",country:"France",zipCode:"31000"},{city:"Nice",state:"Provence-Alpes-Cote d'Azur",country:"France",zipCode:"06000"},{city:"Bordeaux",state:"Nouvelle-Aquitaine",country:"France",zipCode:"33000"},{city:"Strasbourg",state:"Grand Est",country:"France",zipCode:"67000"},{city:"Nantes",state:"Pays de la Loire",country:"France",zipCode:"44000"},{city:"Lille",state:"Hauts-de-France",country:"France",zipCode:"59000"},{city:"Rennes",state:"Bretagne",country:"France",zipCode:"35000"}],de_DE:[{city:"Berlin",state:"Berlin",country:"Germany",zipCode:"10115"},{city:"Munich",state:"Bavaria",country:"Germany",zipCode:"80331"},{city:"Hamburg",state:"Hamburg",country:"Germany",zipCode:"20095"},{city:"Frankfurt",state:"Hesse",country:"Germany",zipCode:"60311"},{city:"Cologne",state:"North Rhine-Westphalia",country:"Germany",zipCode:"50667"},{city:"Stuttgart",state:"Baden-Wurttemberg",country:"Germany",zipCode:"70173"},{city:"Dusseldorf",state:"North Rhine-Westphalia",country:"Germany",zipCode:"40213"},{city:"Leipzig",state:"Saxony",country:"Germany",zipCode:"04109"},{city:"Dresden",state:"Saxony",country:"Germany",zipCode:"01067"},{city:"Hannover",state:"Lower Saxony",country:"Germany",zipCode:"30159"}],es_ES:[{city:"Madrid",state:"Comunidad de Madrid",country:"Spain",zipCode:"28001"},{city:"Barcelona",state:"Catalonia",country:"Spain",zipCode:"08001"},{city:"Valencia",state:"Comunitat Valenciana",country:"Spain",zipCode:"46001"},{city:"Seville",state:"Andalusia",country:"Spain",zipCode:"41001"},{city:"Zaragoza",state:"Aragon",country:"Spain",zipCode:"50001"},{city:"Malaga",state:"Andalusia",country:"Spain",zipCode:"29001"},{city:"Bilbao",state:"Basque Country",country:"Spain",zipCode:"48001"},{city:"Murcia",state:"Region de Murcia",country:"Spain",zipCode:"30001"},{city:"Palma",state:"Balearic Islands",country:"Spain",zipCode:"07001"},{city:"Granada",state:"Andalusia",country:"Spain",zipCode:"18001"}],ja_JP:[{city:"Tokyo",state:"Tokyo",country:"Japan",zipCode:"100-0001"},{city:"Osaka",state:"Osaka",country:"Japan",zipCode:"530-0001"},{city:"Yokohama",state:"Kanagawa",country:"Japan",zipCode:"220-0011"},{city:"Nagoya",state:"Aichi",country:"Japan",zipCode:"450-0001"},{city:"Sapporo",state:"Hokkaido",country:"Japan",zipCode:"060-0001"},{city:"Fukuoka",state:"Fukuoka",country:"Japan",zipCode:"810-0001"},{city:"Kobe",state:"Hyogo",country:"Japan",zipCode:"650-0001"},{city:"Kyoto",state:"Kyoto",country:"Japan",zipCode:"600-8001"},{city:"Sendai",state:"Miyagi",country:"Japan",zipCode:"980-0001"},{city:"Hiroshima",state:"Hiroshima",country:"Japan",zipCode:"730-0001"}],pt_BR:[{city:"Sao Paulo",state:"Sao Paulo",country:"Brazil",zipCode:"01000-000"},{city:"Rio de Janeiro",state:"Rio de Janeiro",country:"Brazil",zipCode:"20000-000"},{city:"Brasilia",state:"Distrito Federal",country:"Brazil",zipCode:"70000-000"},{city:"Salvador",state:"Bahia",country:"Brazil",zipCode:"40000-000"},{city:"Fortaleza",state:"Ceara",country:"Brazil",zipCode:"60000-000"},{city:"Belo Horizonte",state:"Minas Gerais",country:"Brazil",zipCode:"30000-000"},{city:"Manaus",state:"Amazonas",country:"Brazil",zipCode:"69000-000"},{city:"Curitiba",state:"Parana",country:"Brazil",zipCode:"80000-000"},{city:"Recife",state:"Pernambuco",country:"Brazil",zipCode:"50000-000"},{city:"Porto Alegre",state:"Rio Grande do Sul",country:"Brazil",zipCode:"90000-000"}]},B={en:"en_US",fr:"fr_FR",de:"de_DE",es:"es_ES",ja:"ja_JP",pt:"pt_BR"};function l(i){if(i in L)return i;let e=i.split("_")[0].toLowerCase();return B[e]??"en_US"}var u=class{tuples;resolvedLocale;constructor(e){this.resolvedLocale=l(e??"en_US"),this.tuples=L[this.resolvedLocale]}getAddress(e){return this.tuples[e%this.tuples.length]}getCity(e){return this.getAddress(e).city}getState(e){return this.getAddress(e).state}getCountry(e){return this.getAddress(e).country}getZipCode(e){return this.getAddress(e).zipCode}getLocaleData(){return c(this.resolvedLocale)}};var F={en_US:"US",fr_FR:"FR",de_DE:"DE",es_ES:"ES",ja_JP:"JP",pt_BR:"BR"},$={fr_FR:{country:"FR",bbanLength:23},de_DE:{country:"DE",bbanLength:18},es_ES:{country:"ES",bbanLength:20},en_US:{country:"DE",bbanLength:18},ja_JP:{country:"DE",bbanLength:18},pt_BR:{country:"DE",bbanLength:18}},w="ABCDEFGHIJKLMNPQRSTUVWXYZ",T=["Ergonomic","Handcrafted","Refined","Sleek","Rustic","Compact","Modular","Insulated"],E=["Steel","Wooden","Cotton","Granite","Rubber","Leather","Ceramic"],_=["Chair","Table","Lamp","Keyboard","Backpack","Bottle","Headphones","Gloves","Bench"],M=["Senior","Lead","Junior","Principal","Associate","Chief"],P=["Marketing","Operations","Finance","Sales","Product","Customer Success"],U=["Manager","Analyst","Coordinator","Specialist","Director","Consultant"],G=["Adaptive","Integrated","Customer-focused","Scalable","Secure"],O=["cloud-based","real-time","data-driven","modular","global"],I=["platform","solution","workflow","service","framework","network"],J=["daily use at home or in the office","long days on the move","teams that need something that lasts","small spaces","outdoor work in any weather"],H=["Unable to log in","Invoice discrepancy","Password reset email not received","Order arrived damaged","Request for a refund","Cannot update billing address","Shipment delayed","Error when exporting a report","Product not working as described","Question about my contract","Charged twice for one order","Need help with installation","Account locked after failed logins","Wrong item delivered","Request: edit several records at once","App crashes on startup","Items missing from my order","Cannot download my invoice","Change of delivery address","Warranty claim","Slow since the last update","Question about my subscription renewal","Data not syncing between devices","Cancel my order","Upgrade to a higher plan"],x=["Asked the customer for a screenshot of the error.","Reproduced the issue on our side.","Escalated to the second-level team.","Sent the customer a workaround.","Customer confirmed the fix works.","Waiting for the customer's reply.","Refund approved and processed.","Replacement shipped today.","Called the customer, no answer; left a voicemail.","Linked to a known issue, a fix is planned.","Updated the customer's address on file.","Shared the knowledge article on this topic.","Closed after the customer confirmed.","Reset the account; login works again.","Checked the logs, nothing unusual found."],j=1440*60*1e3,V=365,Y=120,W=30,N=20,K=65,b=class{locale;localeData;geoGenerator;usernameToken=crypto.randomUUID().replace(/-/g,"").slice(0,8);random;today;companyDecks=new Map;companiesDealt=new Map;constructor(e,t={}){this.locale=e??"en_US",this.localeData=c(this.locale),this.geoGenerator=new u(this.locale),this.random=t.random??Math.random,this.today=t.today??(()=>new Date)}setLocale(e){this.locale=e,this.localeData=c(e),this.geoGenerator=new u(e)}generate(e,t,r=0){if(t<=0||e.length===0)return[];let a=[],o=e.filter(n=>f(n.config.fakerMethod??"lorem")==="phone");for(let n=r;n<r+t;n++){let d={},m=new Map,C=(s,p)=>{let y=m.get(s);if(y!==void 0)return y%p;let D=this.below(p);return m.set(s,D),D};for(let s of e){let p=o.indexOf(s),y=p>=0?n*o.length+p:n;d[s.fieldApiName]=this.generateFieldValue(s,y,C)}a.push(d)}return a}dateOf(e){return e==="pastDate"?this.pastDate():this.futureDate()}below(e){return Math.min(e-1,Math.floor(this.random()*e))}pick(e){return e[this.below(e.length)]}generateFieldValue(e,t,r){let a=e.config.fakerMethod??"lorem",o={min:e.config.minValue??0,max:e.config.maxValue??1e3},n=e.config.fakerLocale;if(n&&n!==this.locale){let d=this.locale,m=this.localeData,C=this.geoGenerator;this.locale=n,this.localeData=c(n),this.geoGenerator=new u(n);let s=this.generateByMethodInstance(a,t,o,r);return this.locale=d,this.localeData=m,this.geoGenerator=C,s}return this.generateByMethodInstance(a,t,o,r)}generateByMethodInstance(e,t,r,a){let o=f(e);if(!o)return Z(e);let n=()=>a("geo",1e4);switch(o){case"name":return`${this.firstName(a)} ${this.lastName(a)}`;case"firstName":return this.firstName(a);case"lastName":return this.lastName(a);case"jobTitle":return`${this.pick(M)} ${this.pick(P)} ${this.pick(U)}`;case"email":return this.generateEmail(t,a);case"username":return this.generateUsername(t,a);case"nickname":return this.generateNickname(t,a);case"phone":return this.generatePhone(t);case"address":return`${this.streetAddress()}, ${this.geoGenerator.getCity(n())}`;case"streetAddress":return this.streetAddress();case"city":return this.geoGenerator.getCity(n());case"country":return this.geoGenerator.getCountry(n());case"state":return this.geoGenerator.getState(n());case"company":return this.generateCompany();case"catchPhrase":return`${this.pick(G)} ${this.pick(O)} `+this.pick(I);case"date":case"pastDate":return this.pastDate();case"futureDate":return this.futureDate();case"futureDateTime":return this.futureDateTime();case"birthdate":return this.birthdate();case"number":case"integer":return Math.floor(r.min+this.random()*(r.max-r.min+1));case"float":return Math.round((r.min+this.random()*(r.max-r.min))*100)/100;case"boolean":return t%2===0;case"lorem":case"sentence":return g(t);case"paragraph":return q(t);case"caseSubject":return this.pick(H);case"caseComment":return this.pick(x);case"uuid":return this.uuid();case"url":return`https://example.com/resource/${t}`;case"zipCode":return this.geoGenerator.getZipCode(n());case"productName":return this.productName(a);case"productDescription":return`${this.productName(a)}, made for ${this.pick(J)}.`;case"iban":return this.generateIban(t);case"bic":return this.generateBic(t)}}firstName(e){let t=this.localeData.firstNames;return t[e("first",t.length)]}lastName(e){let t=this.localeData.lastNames;return t[e("last",t.length)]}generateEmail(e,t){let r=this.localeData.emailDomains[e%this.localeData.emailDomains.length];return`${h(this.firstName(t))}.${h(this.lastName(t))}${e}@${r}`}generateUsername(e,t){let r=h(this.firstName(t)),a=h(this.lastName(t)),o=this.localeData.emailDomains[e%this.localeData.emailDomains.length];return`${r}.${a}.${this.usernameToken}${e}@${o}`}generateNickname(e,t){return`${h(this.firstName(t)).slice(0,20)}.${this.usernameToken}${e}`}generatePhone(e){return k(this.locale,e)}streetAddress(){let{names:e,format:t}=z[l(this.locale)];return t.replace("{street}",this.pick(e)).replace("{n}",String(1+this.below(199))).replace("{m}",String(1+this.below(9)))}generateCompany(){let e=l(this.locale),t=A[e].companies.length,r=this.companyDecks.get(e);if(!r||r.length!==t){r=Array.from({length:t},(o,n)=>n);for(let o=r.length-1;o>0;o--){let n=this.below(o+1);[r[o],r[n]]=[r[n],r[o]]}this.companyDecks.set(e,r)}let a=this.companiesDealt.get(e)??0;return this.companiesDealt.set(e,a+1),v(e,r[a%r.length],Math.floor(a/r.length))}productName(e){let t=T[e("productAdjective",T.length)],r=E[e("productMaterial",E.length)],a=_[e("product",_.length)];return`${t} ${r} ${a}`}pastDate(){return S(this.daysFromToday(-(1+this.below(V))))}futureDate(){return S(this.daysFromToday(1+this.below(Y)))}futureDateTime(){let e=this.daysFromToday(1+this.below(W));return e.setUTCHours(8+this.below(9),this.below(2)*30,0,0),e.toISOString()}birthdate(){let e=(K-N)*365;return S(this.daysFromToday(-(N*365+this.below(e))))}daysFromToday(e){return new Date(this.today().getTime()+e*j)}uuid(){let e=Array.from({length:32},()=>this.below(16).toString(16));e[12]="4",e[16]=(this.below(16)&3|8).toString(16);let t=e.join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}generateIban(e){let t=$[l(this.locale)],r=R("#".repeat(t.bbanLength),e);return`${t.country}${X(t.country,r)}${r}`}generateBic(e){let t=Array.from({length:4},(a,o)=>String.fromCharCode(65+(e*5+o*7+3)%26)).join(""),r=Array.from({length:2},(a,o)=>w[(e*3+o*11+2)%w.length]).join("");return`${t}${F[l(this.locale)]}${r}XXX`}};function oe(i,e,t,r,a){let o=new b(r,a),n={fieldApiName:"temp",ruleType:"faker",config:{fakerMethod:i,minValue:t.min,maxValue:t.max}};return o.generate([n],e+1)[e]?.temp}function S(i){return i.toISOString().split("T")[0]}function h(i){return i.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z]/g,"")}function X(i,e){let t=`${e}${i}00`.replace(/[A-Z]/g,a=>String(a.charCodeAt(0)-55)),r=0;for(let a of t)r=(r*10+Number(a))%97;return String(98-r).padStart(2,"0")}function Z(i){throw new Error(`Faker method "${i}" is not implemented: choose a method SandForge generates, or remove it from the field rule.`)}function g(i){let e=["lorem","ipsum","dolor","sit","amet","consectetur","adipiscing","elit"],t=i%e.length,r=[];for(let a=0;a<6;a++)r.push(e[(t+a)%e.length]);return r.join(" ")+"."}function q(i){return[g(i),g(i+1),g(i+2)].join(" ")}export{b as a,oe as b};
|
|
@@ -4,7 +4,7 @@ import { dirname as __sandforgeDirname } from 'node:path';
|
|
|
4
4
|
const require = __sandforgeRequire(import.meta.url);
|
|
5
5
|
const __filename = __sandforgePath(import.meta.url);
|
|
6
6
|
const __dirname = __sandforgeDirname(__filename);
|
|
7
|
-
import{a as g,b as O,d as E}from"./chunk-TUACWKIH.mjs";import{b as p,e as A,v as x,z as L}from"./chunk-
|
|
7
|
+
import{a as g,b as O,d as E}from"./chunk-TUACWKIH.mjs";import{b as p,e as A,v as x,z as L}from"./chunk-WZQEK4WT.mjs";import{randomBytes as I,randomUUID as q}from"node:crypto";import{linkSync as $,mkdirSync as D,readFileSync as F,renameSync as _,unlinkSync as z,writeFileSync as R}from"node:fs";import{hostname as T}from"node:os";import{dirname as C}from"node:path";var K=448,N=384,j={version:x(1),host:p().min(1).max(255),pid:A().int().nonnegative(),hostStartedAt:L.datetime({offset:!0}),acquiredAt:L.datetime({offset:!0}),token:p().min(1).max(64)},b={host:T(),pid:g.pid,startedAt:g.startedAt};function G(e){let n=new Map,r=t=>{try{return e(JSON.parse(t))}catch{return}},u=(t,s,i,o)=>t.host!==i.host?(o?.now?.()??Date.now())-Date.parse(t.acquiredAt)<O:t.pid===i.pid&&t.hostStartedAt===i.startedAt?n.get(m(i,s))?.token===t.token:E({writer:{pid:t.pid,hostStartedAt:t.hostStartedAt},startedAt:t.acquiredAt,lastWriteAt:t.acquiredAt},{pid:i.pid,startedAt:i.startedAt},o);return{acquire(t,s,i={}){let o=i.self??b,d=m(o,t),c=n.get(d);if(c!==void 0)return{busy:c};D(C(t),{recursive:!0,mode:K});let a=s({version:1,host:o.host,pid:o.pid,hostStartedAt:o.startedAt,acquiredAt:new Date(i.checks?.now?.()??Date.now()).toISOString(),token:q()}),H=JSON.stringify(a);for(let l=0;l<3;l+=1){if(W(t,H))return n.set(d,a),{lock:{release:()=>{if(n.get(d)?.token!==a.token)return;n.delete(d);let w=f(t);w!==void 0&&r(w)?.token===a.token&&S(t)}}};let k=f(t);if(k===void 0)continue;let h=r(k);if(h!==void 0&&u(h,t,o,i.checks))return{busy:h};M(t,k)}let y=f(t);return{busy:(y!==void 0?r(y):void 0)??a}},holder(t,s={}){let i=s.self??b,o=n.get(m(i,t));if(o!==void 0)return o;let d=f(t),c=d!==void 0?r(d):void 0;return c!==void 0&&u(c,t,i,s.checks)?c:void 0}}}function m(e,n){return`${e.host}
|
|
8
8
|
${e.pid}
|
|
9
9
|
${e.startedAt}
|
|
10
10
|
${n}`}function W(e,n){let r=`${e}.${process.pid}-${I(4).toString("hex")}.tmp`;R(r,n,{encoding:"utf8",mode:N,flag:"wx"});try{return $(r,e),!0}catch(u){if(v(u)==="EEXIST")return!1;throw u}finally{S(r)}}function M(e,n){let r=`${e}.${process.pid}-${I(4).toString("hex")}.gone`;try{_(e,r)}catch{return}if(f(r)!==n)try{$(r,e)}catch{}S(r)}function f(e){try{return F(e,"utf8")}catch(n){if(v(n)==="ENOENT")return;throw n}}function S(e){try{z(e)}catch{}}function v(e){return e?.code}export{j as a,G 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{b as r}from"./chunk-CA5NAXSU.mjs";var o=["INVALID_SESSION_ID","INVALID_AUTH_HEADER","SESSION_EXPIRED"];function i(e){if(typeof e=="object"&&e!==null){let{errorCode:n,statusCode:s}=e;if(typeof n=="string"&&o.includes(n)||s===401)return!0}let t=r(e);return o.some(n=>t.includes(n))||t.includes("Session expired")?!0:/\b401\b/.test(t)&&/unauthorized/i.test(t)}export{i 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,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-6CDIIFNX.mjs";import"./chunk-E2YJVSX6.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-3B5H24ZG.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-DPYTG6DM.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{a,b}from"./chunk-
|
|
7
|
+
import{a,b}from"./chunk-ZRUDYB7O.mjs";import"./chunk-QIRO4HTE.mjs";import"./chunk-NTOVCTRS.mjs";export{b as AnonymizationEngine,a as MissingHashSaltError};
|