sandforge 1.81.0 → 1.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -0
- package/bin/sandforge-users.mjs +12 -0
- package/lib/{chunk-J6G23RUI.mjs → chunk-262TP6UU.mjs} +1 -1
- package/lib/{chunk-NWVVCZUK.mjs → chunk-27BBEGUD.mjs} +1 -1
- package/lib/{chunk-Y5ZCPY36.mjs → chunk-2ADSD5WK.mjs} +1 -1
- package/lib/{chunk-55LQD3Y3.mjs → chunk-2GSMHGIV.mjs} +1 -1
- package/lib/chunk-2K5BYZQM.mjs +8 -0
- package/lib/{chunk-GK7VEYFM.mjs → chunk-2KTGDYUH.mjs} +1 -1
- package/lib/{chunk-T3PLRQ2T.mjs → chunk-2N73W63D.mjs} +1 -1
- package/lib/{chunk-7PK5QDQI.mjs → chunk-2R6GFNKF.mjs} +1 -1
- package/lib/{chunk-2OIRJEYE.mjs → chunk-2WMKJVD2.mjs} +1 -1
- package/lib/{chunk-D62KWDDT.mjs → chunk-36Y225OM.mjs} +1 -1
- package/lib/{chunk-HYOOJVR6.mjs → chunk-3CM7LAPE.mjs} +1 -1
- package/lib/{chunk-OIIL4NVI.mjs → chunk-3OVTKRS4.mjs} +1 -1
- package/lib/{chunk-UT27HXE7.mjs → chunk-3V4YH5KO.mjs} +1 -1
- package/lib/{chunk-OZNLOV4U.mjs → chunk-446GBKAC.mjs} +1 -1
- package/lib/{chunk-SQGP46QS.mjs → chunk-4GCYGQXD.mjs} +1 -1
- package/lib/{chunk-2NAIUKVL.mjs → chunk-4V3QO7HF.mjs} +1 -1
- package/lib/{chunk-GWRKS3AL.mjs → chunk-4X5D3MSV.mjs} +1 -1
- package/lib/{chunk-KGYXLSQ5.mjs → chunk-5OGNK3JP.mjs} +1 -1
- package/lib/{chunk-D7P7DTWL.mjs → chunk-6KOUYHEY.mjs} +1 -1
- package/lib/chunk-6QSHWIZI.mjs +48 -0
- package/lib/chunk-6VOQFISN.mjs +7 -0
- package/lib/{chunk-742SSN7I.mjs → chunk-6YC2ELCU.mjs} +1 -1
- package/lib/chunk-77IVKH7R.mjs +7 -0
- package/lib/{chunk-KNIRA333.mjs → chunk-77MZRBWX.mjs} +1 -1
- package/lib/{chunk-ZUA5BNAO.mjs → chunk-7BQMBXKX.mjs} +1 -1
- package/lib/{chunk-OQQHNYR7.mjs → chunk-7DPHZWA4.mjs} +2 -2
- package/lib/chunk-7V2UYZ6S.mjs +7 -0
- package/lib/chunk-7WSQ65WG.mjs +9 -0
- package/lib/{chunk-HVC5CYIB.mjs → chunk-7ZBDACVG.mjs} +1 -1
- package/lib/chunk-A32ISQ6M.mjs +28 -0
- package/lib/{chunk-XC2QKQT5.mjs → chunk-AG24QMSY.mjs} +1 -1
- package/lib/{chunk-K77NR3UK.mjs → chunk-AHUGG3WU.mjs} +1 -1
- package/lib/{chunk-K55LH4ZQ.mjs → chunk-ALBY5SOH.mjs} +1 -1
- package/lib/chunk-AXFD2OH6.mjs +7 -0
- package/lib/{chunk-YCSFP6ER.mjs → chunk-BH76USTQ.mjs} +1 -1
- package/lib/chunk-BNKT3R3F.mjs +7 -0
- package/lib/{chunk-YIGFYZQY.mjs → chunk-BPHTA6KP.mjs} +1 -1
- package/lib/{chunk-MNITSYI2.mjs → chunk-BT43WSOS.mjs} +1 -1
- package/lib/{chunk-ZWZXQTAK.mjs → chunk-BVZ5H3N4.mjs} +14 -14
- package/lib/{chunk-43K2C6H2.mjs → chunk-C6RKM4BB.mjs} +1 -1
- package/lib/{chunk-C4YGSK6W.mjs → chunk-CDWZGQAJ.mjs} +1 -1
- package/lib/chunk-CGZGL6VT.mjs +7 -0
- package/lib/{chunk-KE2PGD6C.mjs → chunk-CN5HGFG4.mjs} +1 -1
- package/lib/chunk-CQAFVEKP.mjs +13 -0
- package/lib/{chunk-XIZ5LMQM.mjs → chunk-CTPLYUXA.mjs} +1 -1
- package/lib/chunk-CXKZ6TYV.mjs +9 -0
- package/lib/{chunk-DHIW4IO5.mjs → chunk-D6JT4PAB.mjs} +1 -1
- package/lib/{chunk-AELFEK3G.mjs → chunk-D7XUNWWU.mjs} +1 -1
- package/lib/{chunk-GR3NGDVM.mjs → chunk-DB5RVDC5.mjs} +1 -1
- package/lib/{chunk-MO3N5XVV.mjs → chunk-DIGUC7S4.mjs} +2 -2
- package/lib/{chunk-2OZG6GRW.mjs → chunk-DKDKCGXV.mjs} +1 -1
- package/lib/chunk-DMT5SCO3.mjs +7 -0
- package/lib/chunk-DNQKVCUV.mjs +475 -0
- package/lib/{chunk-MAHZMPMZ.mjs → chunk-DSR2MSBH.mjs} +1 -1
- package/lib/{chunk-O6ADMP36.mjs → chunk-E3RQ575Y.mjs} +1 -1
- package/lib/{chunk-ETT5GP4P.mjs → chunk-EOQON3E5.mjs} +1 -1
- package/lib/{chunk-TKQQVB2D.mjs → chunk-ETNQHIDI.mjs} +1 -1
- package/lib/chunk-F5SBGJWW.mjs +7 -0
- package/lib/chunk-FBXH4VRQ.mjs +7 -0
- package/lib/chunk-FKCIGJOI.mjs +15 -0
- package/lib/{chunk-OVOLG3AL.mjs → chunk-FVLFO2S6.mjs} +1 -1
- package/lib/{chunk-YOGMP72T.mjs → chunk-FYWNSMOZ.mjs} +1 -1
- package/lib/{chunk-DHGPDSXS.mjs → chunk-GEEWPTV5.mjs} +1 -1
- package/lib/{chunk-FSDO4DJA.mjs → chunk-GLN4PI5P.mjs} +1 -1
- package/lib/{chunk-PYUEHBA6.mjs → chunk-GT5ZKU6V.mjs} +1 -1
- package/lib/chunk-GTRU5AV5.mjs +7 -0
- package/lib/chunk-H33DVU3D.mjs +7 -0
- package/lib/{chunk-5WGA5CZB.mjs → chunk-H4OBZIX3.mjs} +1 -1
- package/lib/{chunk-4L7FBOJS.mjs → chunk-HQZUQXDC.mjs} +1 -1
- package/lib/{chunk-VSU74RQ3.mjs → chunk-HVX2AFYW.mjs} +1 -1
- package/lib/chunk-I3ZO76LL.mjs +21 -0
- package/lib/{chunk-V4RKM4QZ.mjs → chunk-I5C4O3VA.mjs} +1 -1
- package/lib/{chunk-FSZTXLNW.mjs → chunk-IHGYJZZ2.mjs} +1 -1
- package/lib/chunk-ISA2NYJV.mjs +7 -0
- package/lib/{chunk-2IB7I3IQ.mjs → chunk-ISAUCWYK.mjs} +1 -1
- package/lib/{chunk-3B5H24ZG.mjs → chunk-ISOSTAJR.mjs} +1 -1
- package/lib/chunk-IXIY6Q4M.mjs +7 -0
- package/lib/{chunk-TPHXRHOA.mjs → chunk-J3TIHLWG.mjs} +1 -1
- package/lib/{chunk-TQM2XJ27.mjs → chunk-JAV6F6OA.mjs} +1 -1
- package/lib/chunk-JBWJ6UEZ.mjs +7 -0
- package/lib/{chunk-WM5JI4JI.mjs → chunk-JH4ZTVQN.mjs} +1 -1
- package/lib/{chunk-BZFIOZS3.mjs → chunk-JIPT5FUD.mjs} +1 -1
- package/lib/{chunk-6FMLW7PH.mjs → chunk-JPEVIXNH.mjs} +1 -1
- package/lib/{chunk-67CC7RAE.mjs → chunk-JREKJO3D.mjs} +1 -1
- package/lib/{chunk-3AOKLIVE.mjs → chunk-JUOQUG7U.mjs} +1 -1
- package/lib/chunk-JYUMD357.mjs +7 -0
- package/lib/{chunk-56MPPWLA.mjs → chunk-K7G3W7XH.mjs} +1 -1
- package/lib/{chunk-OU5W7SCB.mjs → chunk-KKS2KFBT.mjs} +1 -1
- package/lib/{chunk-RKALOKAU.mjs → chunk-KWAVSZ2B.mjs} +1 -1
- package/lib/{chunk-WI4HYWV6.mjs → chunk-KXUOHACP.mjs} +1 -1
- package/lib/{chunk-GTIXJCGS.mjs → chunk-L3I6DAHX.mjs} +1 -1
- package/lib/{chunk-FLNLG43R.mjs → chunk-L47JCNP3.mjs} +1 -1
- package/lib/{chunk-5344TZBT.mjs → chunk-L4MSL4U7.mjs} +1 -1
- package/lib/chunk-L4RJX7DG.mjs +7 -0
- package/lib/chunk-L6CLN664.mjs +7 -0
- package/lib/chunk-LI2XNV7F.mjs +7 -0
- package/lib/chunk-LP2D3JJP.mjs +7 -0
- package/lib/{chunk-EH5YUA5W.mjs → chunk-LWES2KZE.mjs} +1 -1
- package/lib/{chunk-YJEXE6HZ.mjs → chunk-LYOGCIYD.mjs} +2 -2
- package/lib/{chunk-BNO5GIJ6.mjs → chunk-MJD6CPZZ.mjs} +1 -1
- package/lib/{chunk-33ZX3A56.mjs → chunk-MTM4KG3T.mjs} +1 -1
- package/lib/{chunk-E2YJVSX6.mjs → chunk-N2HYG3BL.mjs} +1 -1
- package/lib/chunk-N5UIE4IR.mjs +7 -0
- package/lib/{chunk-R6TF26V4.mjs → chunk-NDFFIJL5.mjs} +1 -1
- package/lib/{chunk-FDGFUEK3.mjs → chunk-NFEBX75O.mjs} +1 -1
- package/lib/{chunk-QXLZINZB.mjs → chunk-NNV7IGM7.mjs} +1 -1
- package/lib/{chunk-OXKZ4Y3B.mjs → chunk-NS6ONPWL.mjs} +1 -1
- package/lib/{chunk-OEHVAJAB.mjs → chunk-O7GCCRPW.mjs} +1 -1
- package/lib/chunk-OO24ZYYJ.mjs +7 -0
- package/lib/chunk-OOIDCHBQ.mjs +9 -0
- package/lib/{chunk-MWLFFVQV.mjs → chunk-OS5GE52G.mjs} +1 -1
- package/lib/chunk-OS6HFJ7L.mjs +7 -0
- package/lib/{chunk-HYBH5PFM.mjs → chunk-OTJH6AEA.mjs} +1 -1
- package/lib/chunk-OUU47Y7A.mjs +7 -0
- package/lib/{chunk-FTA5LOVX.mjs → chunk-P6WRYJN3.mjs} +1 -1
- package/lib/{chunk-DXOXLUZA.mjs → chunk-PDRXM5WN.mjs} +1 -1
- package/lib/chunk-PGRY365W.mjs +7 -0
- package/lib/chunk-Q4PPI3KG.mjs +7 -0
- package/lib/chunk-QFTF2PGS.mjs +21 -0
- package/lib/chunk-QKJXIY6L.mjs +7 -0
- package/lib/{chunk-DMBR24CK.mjs → chunk-QLRWU3MB.mjs} +1 -1
- package/lib/chunk-QO4MPHZD.mjs +7 -0
- package/lib/chunk-QP3JLFIO.mjs +7 -0
- package/lib/{chunk-UCHAZ4ZU.mjs → chunk-QQDZQCO2.mjs} +1 -1
- package/lib/chunk-QROPNEGY.mjs +14 -0
- package/lib/{chunk-6NADW3OI.mjs → chunk-QXB6U3ZP.mjs} +1 -1
- package/lib/chunk-R3OM3X4L.mjs +8 -0
- package/lib/chunk-R7GKMAT4.mjs +7 -0
- package/lib/{chunk-JU2XEKEO.mjs → chunk-RVCPQVKM.mjs} +1 -1
- package/lib/{chunk-WEZLXE34.mjs → chunk-RZKJQOOC.mjs} +1 -1
- package/lib/chunk-S4PRKKGC.mjs +8 -0
- package/lib/{chunk-NJ3EOEHS.mjs → chunk-SX6QWYCQ.mjs} +1 -1
- package/lib/{chunk-ONMBSACW.mjs → chunk-T36DZJPH.mjs} +1 -1
- package/lib/{chunk-AJPSGVMD.mjs → chunk-T7DDS4UQ.mjs} +1 -1
- package/lib/chunk-TCEXCHXR.mjs +7 -0
- package/lib/chunk-TMIESDE5.mjs +7 -0
- package/lib/chunk-TQJ5NPRC.mjs +7 -0
- package/lib/chunk-TUPZY2QJ.mjs +7 -0
- package/lib/{chunk-2Z54GB6X.mjs → chunk-U2CTKIPE.mjs} +1 -1
- package/lib/{chunk-DQR5NDMI.mjs → chunk-U4YFYSF3.mjs} +1 -1
- package/lib/{chunk-EOSEMFPU.mjs → chunk-UIR77ZJD.mjs} +1 -1
- package/lib/{chunk-UUSLTW5V.mjs → chunk-UOHZW2L4.mjs} +1 -1
- package/lib/chunk-UV74P4H2.mjs +7 -0
- package/lib/{chunk-CULAOP3U.mjs → chunk-VXZ5PTOM.mjs} +1 -1
- package/lib/{chunk-IBURU7T7.mjs → chunk-VZLJZEV2.mjs} +1 -1
- package/lib/chunk-W3BQGMTR.mjs +7 -0
- package/lib/{chunk-WWTXRWNZ.mjs → chunk-WABXKL4N.mjs} +1 -1
- package/lib/{chunk-E2OBAWSH.mjs → chunk-WAYQLQAD.mjs} +1 -1
- package/lib/{chunk-6CDIIFNX.mjs → chunk-WBELLGNE.mjs} +1 -1
- package/lib/{chunk-LO527YLT.mjs → chunk-WJAZ5LHL.mjs} +1 -1
- package/lib/{chunk-6IGEASOF.mjs → chunk-WXU6ZJIV.mjs} +1 -1
- package/lib/{chunk-YHIOS2PU.mjs → chunk-WZN36ACK.mjs} +1 -1
- package/lib/{chunk-AITNZWLB.mjs → chunk-X2XZQ434.mjs} +1 -1
- package/lib/chunk-X4HZD5U2.mjs +7 -0
- package/lib/chunk-X6XNTOGO.mjs +7 -0
- package/lib/{chunk-5VQNKDFU.mjs → chunk-XAMMIPZ4.mjs} +1 -1
- package/lib/{chunk-MHW6DV6T.mjs → chunk-XAUQXYPW.mjs} +1 -1
- package/lib/{chunk-5UT2ZBGF.mjs → chunk-XCJUNX63.mjs} +1 -1
- package/lib/chunk-XJICAOAQ.mjs +7 -0
- package/lib/{chunk-GYKNCYES.mjs → chunk-XKFHTBAB.mjs} +1 -1
- package/lib/{chunk-6SEDOIO3.mjs → chunk-XMQ5R6TC.mjs} +1 -1
- package/lib/chunk-XPXEQKLR.mjs +7 -0
- package/lib/{chunk-SW2NUKQL.mjs → chunk-Y7YUNRKK.mjs} +1 -1
- package/lib/{chunk-UIUPPEFB.mjs → chunk-YBZIDW6W.mjs} +1 -1
- package/lib/{chunk-X2ZVSQ54.mjs → chunk-YEVB7LVK.mjs} +1 -1
- package/lib/{chunk-EAFLDSQ2.mjs → chunk-Z3MGN42K.mjs} +1 -1
- package/lib/{chunk-MKNAZPOT.mjs → chunk-ZB5E7NHU.mjs} +1 -1
- package/lib/chunk-ZCOSME6P.mjs +7 -0
- package/lib/{chunk-KRNFVAGC.mjs → chunk-ZOSESZ22.mjs} +1 -1
- package/lib/chunk-ZTHC42X6.mjs +7 -0
- package/lib/{chunk-XEB6HZ34.mjs → chunk-ZXOUWHYE.mjs} +1 -1
- package/lib/sandforge-autopilot.mjs +1 -1
- package/lib/sandforge-backup.mjs +1 -1
- package/lib/sandforge-checkpoint.mjs +1 -1
- package/lib/sandforge-cleanup.mjs +1 -1
- package/lib/sandforge-clone.mjs +1 -1
- package/lib/sandforge-compare.mjs +1 -1
- package/lib/sandforge-dataops.mjs +1 -1
- package/lib/sandforge-empty.mjs +4 -4
- package/lib/sandforge-env.mjs +184 -139
- package/lib/sandforge-frozen.mjs +1 -1
- package/lib/sandforge-mcp.mjs +14 -14
- package/lib/sandforge-monitor.mjs +1 -1
- package/lib/sandforge-pipeline.mjs +1 -1
- package/lib/sandforge-seed.mjs +1 -1
- package/lib/sandforge-sync.mjs +1 -1
- package/lib/sandforge-users.mjs +155 -0
- package/lib/sandforge.mjs +1 -22
- package/lib/sf/sandforge/autopilot.mjs +20 -0
- package/lib/sf/sandforge/backup.mjs +20 -0
- package/lib/sf/sandforge/checkpoint.mjs +20 -0
- package/lib/sf/sandforge/cleanup.mjs +20 -0
- package/lib/sf/sandforge/clone.mjs +20 -0
- package/lib/sf/sandforge/compare.mjs +20 -0
- package/lib/sf/sandforge/dataops.mjs +20 -0
- package/lib/sf/sandforge/empty.mjs +20 -0
- package/lib/sf/sandforge/env.mjs +20 -0
- package/lib/sf/sandforge/frozen.mjs +20 -0
- package/lib/sf/sandforge/hardis-commands.mjs +20 -0
- package/lib/sf/sandforge/index.mjs +20 -0
- package/lib/sf/sandforge/mcp.mjs +20 -0
- package/lib/sf/sandforge/monitor.mjs +20 -0
- package/lib/sf/sandforge/pipeline.mjs +20 -0
- package/lib/sf/sandforge/seed.mjs +20 -0
- package/lib/sf/sandforge/sync.mjs +20 -0
- package/lib/sf/sandforge/users.mjs +20 -0
- package/lib/sfHelpHook.mjs +7 -0
- package/lib/sfPlugin.mjs +11 -0
- package/oclif.manifest.json +1 -0
- package/package.json +17 -3
- package/lib/chunk-2ZMGVBLW.mjs +0 -7
- package/lib/chunk-5C5XEVZN.mjs +0 -11
- package/lib/chunk-5CKWGZX4.mjs +0 -9
- package/lib/chunk-5ZKCLBTN.mjs +0 -474
- package/lib/chunk-7DALDJMO.mjs +0 -7
- package/lib/chunk-CAFUNR6D.mjs +0 -7
- package/lib/chunk-DPYTG6DM.mjs +0 -48
- package/lib/chunk-G4VXPS3A.mjs +0 -7
- package/lib/chunk-GF247DA7.mjs +0 -7
- package/lib/chunk-IKGHRYCN.mjs +0 -7
- package/lib/chunk-IM2XA6JI.mjs +0 -7
- package/lib/chunk-K5HV4YRO.mjs +0 -7
- package/lib/chunk-KOQV4WXC.mjs +0 -8
- package/lib/chunk-N6HHNR6J.mjs +0 -7
- package/lib/chunk-N7J6NJQ6.mjs +0 -7
- package/lib/chunk-NWPQF5XR.mjs +0 -7
- package/lib/chunk-O7DAFE6M.mjs +0 -14
- package/lib/chunk-OMZJ37JI.mjs +0 -15
- package/lib/chunk-R2BJWO5N.mjs +0 -20
- package/lib/chunk-T26C576X.mjs +0 -9
- package/lib/chunk-T5VAULLQ.mjs +0 -7
- package/lib/chunk-V2QO6KOE.mjs +0 -19
- package/lib/chunk-V473C7LY.mjs +0 -7
- package/lib/chunk-W2AAGIZF.mjs +0 -7
- package/lib/chunk-WD47PGUS.mjs +0 -10
- package/lib/chunk-XC54KKKC.mjs +0 -7
- package/lib/chunk-XGKSSCW7.mjs +0 -7
- package/lib/chunk-ZWCRWF7E.mjs +0 -7
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default class SandforgeCommand {
|
|
2
|
+
static summary = "the menus of SandForge in the sfdx-hardis VS Code extension";
|
|
3
|
+
static description = "The entries SandForge adds to the menus of the sfdx-hardis VS Code extension, each reaching no org. With --json, the document the extension reads, alone on stdout.";
|
|
4
|
+
static hidden = true;
|
|
5
|
+
static strict = false;
|
|
6
|
+
static flags = {};
|
|
7
|
+
static args = {"argv":{"name":"argv","description":"nothing, or --json for the document the extension reads"}};
|
|
8
|
+
static async run(argv) {
|
|
9
|
+
const [major, minor] = process.versions.node.split('.').map(Number);
|
|
10
|
+
if (major < 20 || (major === 20 && minor < 19)) {
|
|
11
|
+
process.stderr.write(
|
|
12
|
+
'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
|
|
13
|
+
);
|
|
14
|
+
process.exitCode = 1;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const { hardisCommands } = await import('../../sfPlugin.mjs');
|
|
18
|
+
process.exitCode = hardisCommands(argv);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default class SandforgeCommand {
|
|
2
|
+
static summary = "SandForge's command lines: seed, clone, sync, checkpoints, masking, Frozen Datasets, sandforge.yaml, pipelines, MCP";
|
|
3
|
+
static description = "sandforge — SandForge's command lines, without the editor: Seed, Forge's clone, Sync, Checkpoints, DataOps, Frozen Dataset, the emptying of a sandbox, the users of a sandbox, sandforge.yaml environments, Automation pipelines, and the MCP server.\n\nIts commands: sf sandforge --help. The whole help of one, its options and its exit codes: sf sandforge <command> --help.";
|
|
4
|
+
static hidden = false;
|
|
5
|
+
static strict = false;
|
|
6
|
+
static flags = {};
|
|
7
|
+
static args = {"argv":{"name":"argv","description":"the words npx sandforge takes"}};
|
|
8
|
+
static async run(argv) {
|
|
9
|
+
const [major, minor] = process.versions.node.split('.').map(Number);
|
|
10
|
+
if (major < 20 || (major === 20 && minor < 19)) {
|
|
11
|
+
process.stderr.write(
|
|
12
|
+
'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
|
|
13
|
+
);
|
|
14
|
+
process.exitCode = 1;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const { runTool } = await import('../../sfPlugin.mjs');
|
|
18
|
+
await runTool('', argv);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default class SandforgeCommand {
|
|
2
|
+
static summary = "the MCP server: these scripts as tools for an AI agent, on stdio";
|
|
3
|
+
static description = "sandforge mcp — Seed, Forge's clone of a record, of the records a query chooses or of the whole org, the removal of a run, the emptying of objects or of a whole org, Checkpoints and their replay into another org, the environments of a sandforge.yaml and the plan of an Automation pipeline, as tools for an AI agent, over the Model Context Protocol on stdio.\n\nThe whole help, its options and its exit codes: sf sandforge mcp --help.";
|
|
4
|
+
static hidden = false;
|
|
5
|
+
static strict = false;
|
|
6
|
+
static flags = {};
|
|
7
|
+
static args = {"argv":{"name":"argv","description":"the words npx sandforge mcp takes"}};
|
|
8
|
+
static async run(argv) {
|
|
9
|
+
const [major, minor] = process.versions.node.split('.').map(Number);
|
|
10
|
+
if (major < 20 || (major === 20 && minor < 19)) {
|
|
11
|
+
process.stderr.write(
|
|
12
|
+
'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
|
|
13
|
+
);
|
|
14
|
+
process.exitCode = 1;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const { runTool } = await import('../../sfPlugin.mjs');
|
|
18
|
+
await runTool("mcp", argv);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default class SandforgeCommand {
|
|
2
|
+
static summary = "read an org the way the Monitor page does";
|
|
3
|
+
static description = "sandforge monitor — read an org the way the Monitor page does, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge monitor --help.";
|
|
4
|
+
static hidden = false;
|
|
5
|
+
static strict = false;
|
|
6
|
+
static flags = {};
|
|
7
|
+
static args = {"argv":{"name":"argv","description":"the words npx sandforge monitor takes"}};
|
|
8
|
+
static async run(argv) {
|
|
9
|
+
const [major, minor] = process.versions.node.split('.').map(Number);
|
|
10
|
+
if (major < 20 || (major === 20 && minor < 19)) {
|
|
11
|
+
process.stderr.write(
|
|
12
|
+
'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
|
|
13
|
+
);
|
|
14
|
+
process.exitCode = 1;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const { runTool } = await import('../../sfPlugin.mjs');
|
|
18
|
+
await runTool("monitor", argv);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default class SandforgeCommand {
|
|
2
|
+
static summary = "plan and run an Automation pipeline exported from VS Code";
|
|
3
|
+
static description = "sandforge pipeline — run an Automation pipeline exported from VS Code, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge pipeline --help.";
|
|
4
|
+
static hidden = false;
|
|
5
|
+
static strict = false;
|
|
6
|
+
static flags = {};
|
|
7
|
+
static args = {"argv":{"name":"argv","description":"the words npx sandforge pipeline takes"}};
|
|
8
|
+
static async run(argv) {
|
|
9
|
+
const [major, minor] = process.versions.node.split('.').map(Number);
|
|
10
|
+
if (major < 20 || (major === 20 && minor < 19)) {
|
|
11
|
+
process.stderr.write(
|
|
12
|
+
'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
|
|
13
|
+
);
|
|
14
|
+
process.exitCode = 1;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const { runTool } = await import('../../sfPlugin.mjs');
|
|
18
|
+
await runTool("pipeline", argv);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default class SandforgeCommand {
|
|
2
|
+
static summary = "fill an org from a seed template";
|
|
3
|
+
static description = "sandforge seed — fill an org from a seed template, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge seed --help.";
|
|
4
|
+
static hidden = false;
|
|
5
|
+
static strict = false;
|
|
6
|
+
static flags = {};
|
|
7
|
+
static args = {"argv":{"name":"argv","description":"the words npx sandforge seed takes"}};
|
|
8
|
+
static async run(argv) {
|
|
9
|
+
const [major, minor] = process.versions.node.split('.').map(Number);
|
|
10
|
+
if (major < 20 || (major === 20 && minor < 19)) {
|
|
11
|
+
process.stderr.write(
|
|
12
|
+
'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
|
|
13
|
+
);
|
|
14
|
+
process.exitCode = 1;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const { runTool } = await import('../../sfPlugin.mjs');
|
|
18
|
+
await runTool("seed", argv);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default class SandforgeCommand {
|
|
2
|
+
static summary = "run a Sync between two orgs";
|
|
3
|
+
static description = "sandforge sync — run a Sync between two orgs, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge sync --help.";
|
|
4
|
+
static hidden = false;
|
|
5
|
+
static strict = false;
|
|
6
|
+
static flags = {};
|
|
7
|
+
static args = {"argv":{"name":"argv","description":"the words npx sandforge sync takes"}};
|
|
8
|
+
static async run(argv) {
|
|
9
|
+
const [major, minor] = process.versions.node.split('.').map(Number);
|
|
10
|
+
if (major < 20 || (major === 20 && minor < 19)) {
|
|
11
|
+
process.stderr.write(
|
|
12
|
+
'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
|
|
13
|
+
);
|
|
14
|
+
process.exitCode = 1;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const { runTool } = await import('../../sfPlugin.mjs');
|
|
18
|
+
await runTool("sync", argv);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default class SandforgeCommand {
|
|
2
|
+
static summary = "set up the users of a sandbox after its refresh, and take them back";
|
|
3
|
+
static description = "sandforge users — set up the users of a sandbox handed back to its testers, a scratch org or a Developer Edition org: an address the copy put under .invalid asked back, a user activated, frozen or unfrozen, a profile, permission sets, permission set groups, groups and queues given; and take a run back.\n\nThe whole help, its options and its exit codes: sf sandforge users --help.";
|
|
4
|
+
static hidden = false;
|
|
5
|
+
static strict = false;
|
|
6
|
+
static flags = {};
|
|
7
|
+
static args = {"argv":{"name":"argv","description":"the words npx sandforge users takes"}};
|
|
8
|
+
static async run(argv) {
|
|
9
|
+
const [major, minor] = process.versions.node.split('.').map(Number);
|
|
10
|
+
if (major < 20 || (major === 20 && minor < 19)) {
|
|
11
|
+
process.stderr.write(
|
|
12
|
+
'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
|
|
13
|
+
);
|
|
14
|
+
process.exitCode = 1;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const { runTool } = await import('../../sfPlugin.mjs');
|
|
18
|
+
await runTool("users", argv);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -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"./chunk-NTOVCTRS.mjs";import{spawnSync as s}from"node:child_process";import{join as f}from"node:path";var t="sandforge",u=new Set(["--help","-h"]);function a(n,o,i){if(o===void 0)return;let e=n.findCommand(o);if(e===void 0||e.pluginName!==t||e.hidden===!0)return;let r=i.indexOf("--");return(r===-1?i:i.slice(0,r)).some(d=>u.has(d))?[...e.id===t?[]:[e.id.slice(t.length+1)],...i]:void 0}function c(n=__dirname){return f(n,"..","bin","sandforge.mjs")}function p(n){return async function(i){let e=a(this.config,i.id,i.argv??[]);e!==void 0&&n.exit(n.spawn(n.bin,e)??1)}}var h=p({spawn:(n,o)=>s(process.execPath,[n,...o],{stdio:"inherit"}).status,exit:n=>process.exit(n),bin:c()});export{c as binFile,h as default,p as helpHook,a as helpLineOf};
|
package/lib/sfPlugin.mjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __sandforgeRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __sandforgePath } from 'node:url';
|
|
3
|
+
import { dirname as __sandforgeDirname } from 'node:path';
|
|
4
|
+
const require = __sandforgeRequire(import.meta.url);
|
|
5
|
+
const __filename = __sandforgePath(import.meta.url);
|
|
6
|
+
const __dirname = __sandforgeDirname(__filename);
|
|
7
|
+
import{f as i}from"./chunk-A32ISQ6M.mjs";import"./chunk-SCKUIE3R.mjs";import"./chunk-NTOVCTRS.mjs";import{extname as l,join as m}from"node:path";function c(e=__dirname,s=__filename){return m(e,`sandforge${l(s)}`)}async function p(e,s,o=i,t=__dirname,a=__filename){await o([process.execPath,c(t,a),...e===""?[]:[e],...s])}var r="https://github.com/StephaneBerthoz/sandforge/blob/master",d=[{id:"sandforge",label:"SandForge",description:"Test data between Salesforce orgs: what SandForge holds on this machine, read without reaching an org; every other command runs in a terminal, sf sandforge <command>.",vscodeIcon:"database",sldsIcon:"utility:database",commands:[{id:"sandforge-help",label:"Commands and their help",command:"sf sandforge --help",tooltip:"SandForge's commands; sf sandforge <command> --help gives a command's options and exit codes",helpUrl:`${r}/packages/cli/README.md`,vscodeIcon:"question",sldsIcon:"utility:help"},{id:"sandforge-templates",label:"Seed templates",command:"sf sandforge seed --list-templates",tooltip:"Name the built-in templates Seed fills an org from; reaches no org",helpUrl:`${r}/docs/modules/seed.md`,vscodeIcon:"list-unordered",sldsIcon:"utility:list"},{id:"sandforge-yaml-validate",label:"Validate sandforge.yaml",command:"sf sandforge env validate",tooltip:"Check this folder's sandforge.yaml offline: its schema, each resource, their order, the variables it names; reaches no org",helpUrl:`${r}/docs/environments.md`,vscodeIcon:"check",sldsIcon:"utility:check"},{id:"sandforge-yaml-state",label:"Environments on this machine",command:"sf sandforge env state",tooltip:"List the sandforge.yaml environments this machine keeps; reaches no org",helpUrl:`${r}/docs/environments.md`,vscodeIcon:"list-tree",sldsIcon:"utility:database"}]}],g={out:e=>{process.stdout.write(e)},err:e=>{process.stderr.write(e)}};function u(e,s=g){let o=e.find(n=>n!=="--json");if(o!==void 0)return s.err(`"${o}" is not a flag sandforge:hardis-commands reads: --json, or nothing. Nothing was run.
|
|
8
|
+
`),2;if(e.includes("--json"))return s.out(`${JSON.stringify({status:0,result:{customCommands:d}})}
|
|
9
|
+
`),0;let t=d.flatMap(n=>n.commands),a=Math.max(...t.map(n=>n.label.length));return s.out(`The entries SandForge adds to the menus of the sfdx-hardis VS Code extension, each reaching no org:
|
|
10
|
+
`+t.map(n=>` ${n.label.padEnd(a)} ${n.command}
|
|
11
|
+
`).join("")),0}export{d as HARDIS_MENUS,c as dispatcherFile,u as hardisCommands,p as runTool};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"commands":{"sandforge":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge takes","name":"argv"}},"description":"sandforge — SandForge's command lines, without the editor: Seed, Forge's clone, Sync, Checkpoints, DataOps, Frozen Dataset, the emptying of a sandbox, the users of a sandbox, sandforge.yaml environments, Automation pipelines, and the MCP server.\n\nIts commands: sf sandforge --help. The whole help of one, its options and its exit codes: sf sandforge <command> --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"SandForge's command lines: seed, clone, sync, checkpoints, masking, Frozen Datasets, sandforge.yaml, pipelines, MCP","isESM":true,"relativePath":["lib","sf","sandforge","index.mjs"]},"sandforge:autopilot":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge autopilot takes","name":"argv"}},"description":"sandforge autopilot — run an Autopilot copy between two orgs, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge autopilot --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:autopilot","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"run an Autopilot copy between two orgs","isESM":true,"relativePath":["lib","sf","sandforge","autopilot.mjs"]},"sandforge:backup":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge backup takes","name":"argv"}},"description":"sandforge backup — take and restore DataOps snapshots, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge backup --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:backup","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"take and restore DataOps snapshots","isESM":true,"relativePath":["lib","sf","sandforge","backup.mjs"]},"sandforge:checkpoint":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge checkpoint takes","name":"argv"}},"description":"sandforge checkpoint — take a checkpoint of an org's data, and rewind the org to it, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge checkpoint --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:checkpoint","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"take a checkpoint of an org's data, and rewind the org to it","isESM":true,"relativePath":["lib","sf","sandforge","checkpoint.mjs"]},"sandforge:cleanup":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge cleanup takes","name":"argv"}},"description":"sandforge cleanup — Bulk delete records you created on a sandbox in the --since window, whether or not a clone wrote them. Preview with --dry-run and narrow with --objects before deleting.\n\nThe whole help, its options and its exit codes: sf sandforge cleanup --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:cleanup","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"Bulk delete records you created on a sandbox in a time window","isESM":true,"relativePath":["lib","sf","sandforge","cleanup.mjs"]},"sandforge:clone":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge clone takes","name":"argv"}},"description":"sandforge clone — Forge a clone of one record, or of whole tables, from a source org to a target sandbox, or remove what a run of it created.\n\nThe whole help, its options and its exit codes: sf sandforge clone --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:clone","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"clone a record, or whole tables, from one org to a sandbox, or remove a run","isESM":true,"relativePath":["lib","sf","sandforge","clone.mjs"]},"sandforge:compare":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge compare takes","name":"argv"}},"description":"sandforge compare — compare two orgs the way the Compare page does, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge compare --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:compare","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"compare two orgs the way the Compare page does","isESM":true,"relativePath":["lib","sf","sandforge","compare.mjs"]},"sandforge:dataops":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge dataops takes","name":"argv"}},"description":"sandforge dataops — mask an org's records, and put them back, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge dataops --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:dataops","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"mask an org's records, and put them back","isESM":true,"relativePath":["lib","sf","sandforge","dataops.mjs"]},"sandforge:empty":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge empty takes","name":"argv"}},"description":"sandforge empty — empty objects of a sandbox, or the whole of it, without the editor: a dry run first, then the deletes, to the recycle bin with an undo, or for good.\n\nThe whole help, its options and its exit codes: sf sandforge empty --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:empty","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"empty objects of a sandbox, or the whole of it","isESM":true,"relativePath":["lib","sf","sandforge","empty.mjs"]},"sandforge:env":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge env takes","name":"argv"}},"description":"sandforge env — apply a sandforge.yaml to an org: the data an environment needs, declared in your repository, created, kept and taken back, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge env --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:env","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"apply a sandforge.yaml to an org, and take it back","isESM":true,"relativePath":["lib","sf","sandforge","env.mjs"]},"sandforge:frozen":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge frozen takes","name":"argv"}},"description":"sandforge frozen — build and replay a Frozen Dataset, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge frozen --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:frozen","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"build and replay a Frozen Dataset","isESM":true,"relativePath":["lib","sf","sandforge","frozen.mjs"]},"sandforge:mcp":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge mcp takes","name":"argv"}},"description":"sandforge mcp — Seed, Forge's clone of a record, of the records a query chooses or of the whole org, the removal of a run, the emptying of objects or of a whole org, Checkpoints and their replay into another org, the environments of a sandforge.yaml and the plan of an Automation pipeline, as tools for an AI agent, over the Model Context Protocol on stdio.\n\nThe whole help, its options and its exit codes: sf sandforge mcp --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:mcp","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"the MCP server: these scripts as tools for an AI agent, on stdio","isESM":true,"relativePath":["lib","sf","sandforge","mcp.mjs"]},"sandforge:monitor":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge monitor takes","name":"argv"}},"description":"sandforge monitor — read an org the way the Monitor page does, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge monitor --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:monitor","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"read an org the way the Monitor page does","isESM":true,"relativePath":["lib","sf","sandforge","monitor.mjs"]},"sandforge:pipeline":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge pipeline takes","name":"argv"}},"description":"sandforge pipeline — run an Automation pipeline exported from VS Code, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge pipeline --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:pipeline","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"plan and run an Automation pipeline exported from VS Code","isESM":true,"relativePath":["lib","sf","sandforge","pipeline.mjs"]},"sandforge:seed":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge seed takes","name":"argv"}},"description":"sandforge seed — fill an org from a seed template, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge seed --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:seed","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"fill an org from a seed template","isESM":true,"relativePath":["lib","sf","sandforge","seed.mjs"]},"sandforge:sync":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge sync takes","name":"argv"}},"description":"sandforge sync — run a Sync between two orgs, without the editor.\n\nThe whole help, its options and its exit codes: sf sandforge sync --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:sync","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"run a Sync between two orgs","isESM":true,"relativePath":["lib","sf","sandforge","sync.mjs"]},"sandforge:users":{"aliases":[],"args":{"argv":{"description":"the words npx sandforge users takes","name":"argv"}},"description":"sandforge users — set up the users of a sandbox handed back to its testers, a scratch org or a Developer Edition org: an address the copy put under .invalid asked back, a user activated, frozen or unfrozen, a profile, permission sets, permission set groups, groups and queues given; and take a run back.\n\nThe whole help, its options and its exit codes: sf sandforge users --help.","flags":{},"hasDynamicHelp":false,"hidden":false,"hiddenAliases":[],"id":"sandforge:users","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"set up the users of a sandbox after its refresh, and take them back","isESM":true,"relativePath":["lib","sf","sandforge","users.mjs"]},"sandforge:hardis-commands":{"aliases":[],"args":{"argv":{"description":"nothing, or --json for the document the extension reads","name":"argv"}},"description":"The entries SandForge adds to the menus of the sfdx-hardis VS Code extension, each reaching no org. With --json, the document the extension reads, alone on stdout.","flags":{},"hasDynamicHelp":false,"hidden":true,"hiddenAliases":[],"id":"sandforge:hardis-commands","pluginAlias":"sandforge","pluginName":"sandforge","pluginType":"core","strict":false,"summary":"the menus of SandForge in the sfdx-hardis VS Code extension","isESM":true,"relativePath":["lib","sf","sandforge","hardis-commands.mjs"]}},"version":"1.83.0"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sandforge",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.83.0",
|
|
4
4
|
"description": "SandForge's command lines, without the editor: seed, clone and sync Salesforce orgs, checkpoints and rewinds, masking, Frozen Datasets, sandforge.yaml environments, and an MCP server for AI agents.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"salesforce",
|
|
@@ -42,14 +42,28 @@
|
|
|
42
42
|
"sandforge-monitor": "bin/sandforge-monitor.mjs",
|
|
43
43
|
"sandforge-pipeline": "bin/sandforge-pipeline.mjs",
|
|
44
44
|
"sandforge-seed": "bin/sandforge-seed.mjs",
|
|
45
|
-
"sandforge-sync": "bin/sandforge-sync.mjs"
|
|
45
|
+
"sandforge-sync": "bin/sandforge-sync.mjs",
|
|
46
|
+
"sandforge-users": "bin/sandforge-users.mjs"
|
|
46
47
|
},
|
|
47
48
|
"files": [
|
|
48
49
|
"bin/",
|
|
49
50
|
"lib/",
|
|
50
|
-
"THIRD-PARTY-NOTICES.md"
|
|
51
|
+
"THIRD-PARTY-NOTICES.md",
|
|
52
|
+
"oclif.manifest.json"
|
|
51
53
|
],
|
|
52
54
|
"engines": {
|
|
53
55
|
"node": ">=20.19.0"
|
|
56
|
+
},
|
|
57
|
+
"oclif": {
|
|
58
|
+
"commands": "./lib/sf",
|
|
59
|
+
"topicSeparator": " ",
|
|
60
|
+
"topics": {
|
|
61
|
+
"sandforge": {
|
|
62
|
+
"description": "SandForge's command lines: seed, clone, sync, checkpoints, masking, Frozen Datasets, sandforge.yaml, pipelines, MCP"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"hooks": {
|
|
66
|
+
"init": "./lib/sfHelpHook.mjs"
|
|
67
|
+
}
|
|
54
68
|
}
|
|
55
69
|
}
|
package/lib/chunk-2ZMGVBLW.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
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{e as a,f as b,g as c,h as d,i as e,j as f,k as g,l as h,m as i,n as j,o as k,p as l,q as m,r as n}from"./chunk-YCSFP6ER.mjs";import"./chunk-GYKNCYES.mjs";import"./chunk-YOGMP72T.mjs";import"./chunk-6CDIIFNX.mjs";import"./chunk-MWLFFVQV.mjs";import"./chunk-YIGFYZQY.mjs";import"./chunk-2Z54GB6X.mjs";import"./chunk-R6TF26V4.mjs";import"./chunk-V4RKM4QZ.mjs";import"./chunk-JU2XEKEO.mjs";import"./chunk-K55LH4ZQ.mjs";import"./chunk-OMZJ37JI.mjs";import"./chunk-43K2C6H2.mjs";import"./chunk-FSZTXLNW.mjs";import"./chunk-XCA5AONB.mjs";import"./chunk-66NMFCWX.mjs";import"./chunk-WB2RIVO3.mjs";import"./chunk-CAFUNR6D.mjs";import"./chunk-AITNZWLB.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-OEHVAJAB.mjs";import"./chunk-GWRKS3AL.mjs";import"./chunk-BOGNK4LV.mjs";import"./chunk-6SEDOIO3.mjs";import"./chunk-ZWCRWF7E.mjs";import"./chunk-T63U4OZJ.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-54HYHHVL.mjs";import"./chunk-QIRO4HTE.mjs";import"./chunk-MNITSYI2.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-ETT5GP4P.mjs";import"./chunk-SW2NUKQL.mjs";import"./chunk-4JKR4PTZ.mjs";import"./chunk-E2YJVSX6.mjs";import"./chunk-T26C576X.mjs";import"./chunk-BNO5GIJ6.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-SQGP46QS.mjs";import"./chunk-PPGDAUEQ.mjs";import"./chunk-6IGEASOF.mjs";import"./chunk-KOQV4WXC.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-CULAOP3U.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-KRNFVAGC.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-2OIRJEYE.mjs";import"./chunk-XEB6HZ34.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-ZUA5BNAO.mjs";import"./chunk-RKALOKAU.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-55LQD3Y3.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-3B5H24ZG.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-EAFLDSQ2.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-DPYTG6DM.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{d as NOT_REMADE_WORDS,b as OTHERS_DELETION_WORDS,c as OUT_OF_REACH_WORDS,j as REWIND_AUTOMATION_LIFTED_BY,a as REWIND_RESIDUAL_IDS,i as RewindStopped,k as automationUnread,m as counted,h as heldWhile,l as inRewindWords,g as muteOfSteps,e as notAskedWords,n as rewindOrg,f as rewindOrgOf};
|
package/lib/chunk-5C5XEVZN.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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 l,e as u,i as U,k as w,l as f,r as W,s as F,u as Z,v as L}from"./chunk-WZQEK4WT.mjs";import*as B from"node:fs";import*as v from"node:path";function ee(n){let e=v.resolve(n);for(;;){if(B.existsSync(v.join(e,".git"))||B.existsSync(v.join(e,"pnpm-workspace.yaml")))return e;let t=v.dirname(e);if(t===e)throw new Error(`No repository root found above ${n}`);e=t}}function G(n){let e=v.resolve(n);return process.platform==="win32"?e.toLowerCase():e}function k(n){if(!/^[A-Za-z0-9_-]{1,128}$/.test(n))throw new Error(`Not an org id a file of the sas can be named after: "${n}"`);return n}var J=class extends Error{constructor(t,r){super(`Refusing output path inside the repository: ${t} (repo root: ${r}). Frozen-dataset exports, retained-ID lists and working manifests must live in a sas directory OUTSIDE the repo \u2014 versioning them would create a real\u2194anonymized correspondence table.`);this.resolvedPath=t;this.repoRoot=r;this.name="InsideRepoPathError"}resolvedPath;repoRoot},M=class{repoRoot;constructor(e){this.repoRoot=e?v.resolve(e):ee(process.cwd())}isInsideRepo(e){let t=G(this.repoRoot),r=G(e);if(r===t)return!0;let s=v.relative(t,r);return s!==""&&!s.startsWith("..")&&!v.isAbsolute(s)}assertOutsideRepo(e){if(this.isInsideRepo(e))throw new J(v.resolve(e),this.repoRoot);return v.resolve(e)}};import*as m from"node:fs/promises";import*as R from"node:path";var be=4*1024*1024,Re=64*1024*1024;var q=1e4,A=l().regex(/^[A-Za-z0-9]{15}(?:[A-Za-z0-9]{3})?$/),S=l().min(1).max(40),Se=f({forgeId:l().min(1).max(200),targetOrgId:l().min(1).max(128),timestamp:S,duration:u().nonnegative(),status:Z(["success","partial","failure"]),cancelled:L(!0).optional(),writtenBetween:f({first:S,last:S}).optional(),retryOf:l().min(1).max(200).optional(),objects:w(f({objectApiName:l().regex(/^[A-Za-z][A-Za-z0-9_]*$/),ids:w(A)})),linked:u().int().nonnegative(),mayHaveBeenWritten:u().int().nonnegative().optional(),undo:f({removedAt:S,deleted:u().int().nonnegative(),alreadyGone:u().int().nonnegative(),kept:u().int().nonnegative(),refused:u().int().nonnegative(),notReached:u().int().nonnegative().optional(),notVisible:u().int().nonnegative().optional()}).optional(),removalStamps:F(A,S).optional(),removalSpans:w(f({first:S,last:S,userId:A})).optional(),removalLeft:w(A).optional(),sweep:f({sweptAt:S,deleted:u().int().nonnegative(),keptChanged:u().int().nonnegative(),refused:u().int().nonnegative()}).optional(),inJournal:f({journalId:l().min(1).max(200),part:u().int().nonnegative(),left:w(f({objectApiName:l().regex(/^[A-Za-z][A-Za-z0-9_]*$/),count:u().int().nonnegative()}))}).optional()}),je=f({version:L(1),plans:w(U())}),Oe=f({version:L(1),runs:w(f({forgeId:l().min(1).max(300),ids:w(A),late:w(A).optional()}))});var _="referenceid-mapping.json",ne=/^referenceid-mapping\.([A-Za-z0-9_-]{1,128})\.json$/,ae=/^referenceid-mapping\.([A-Za-z0-9_-]{1,128})\.load-\d{1,16}\.ndjson$/,x=/^[A-Za-z0-9]{15}(?:[A-Za-z0-9]{3})?$/,D=new Set;function ie(n){try{return process.kill(n,0),!0}catch(e){return e.code==="EPERM"}}var se=f({at:l().min(1).max(40),object:l().regex(/^[A-Za-z][A-Za-z0-9_]{0,79}$/),created:w(W([l().min(1).max(400),l().regex(x)])).max(1e4)}),oe=f({journal:f({startedAt:l().min(1).max(40),pid:u().int().positive(),runUserId:l().regex(x).optional()})});function de(n){let e,t={},r=new Map,s;for(let a of n.split(`
|
|
8
|
-
`)){if(a.trim()==="")continue;let o;try{o=JSON.parse(a)}catch{continue}if(!e){let c=oe.safeParse(o);c.success&&(e=c.data.journal);continue}let i=se.safeParse(o);if(!i.success)continue;let d=r.get(i.data.object)??[];for(let[c,h]of i.data.created)Object.prototype.hasOwnProperty.call(t,c)||d.push(c),t[c]=h;r.set(i.data.object,d),s=i.data.at}if(!(!e||s===void 0||Object.keys(t).length===0))return{startedAt:e.startedAt,pid:e.pid,load:{updatedAt:s,mapping:t,created:[...r].filter(([,a])=>a.length>0).map(([a,o])=>({objectApiName:a,referenceIds:o})),load:{startedAt:e.startedAt,endedAt:s},...e.runUserId?{runUserId:e.runUserId}:{}}}}function ce(n){return`referenceid-mapping.${k(n)}.json`}async function N(n){let e;try{e=await m.readFile(n,"utf8")}catch(t){if(t.code==="ENOENT")return;throw t}return JSON.parse(e)}async function Fe(n,e){let t=e.assertOutsideRepo(n),r;try{r=await m.readdir(t)}catch(a){if(a.code==="ENOENT")return[];throw a}let s=new Set(r.flatMap(a=>ne.exec(a)?.[1]??ae.exec(a)?.[1]??[]));if(r.includes(_)){let o=(await N(e.assertOutsideRepo(R.join(t,_))))?.orgId;typeof o=="string"&&le(o)&&s.add(o)}return[...s].sort()}function le(n){try{return k(n),!0}catch{return!1}}var ge=w(f({objectApiName:l(),referenceIds:w(l())})),pe=f({startedAt:l(),endedAt:l()}),ue=f({first:l(),last:l()}),fe=f({removedAt:l(),deleted:u(),alreadyGone:u(),kept:u(),refused:u(),notReached:u().optional()}),me=F(l(),l()),he=w(f({first:l(),last:l(),userId:l()})),K=F(l(),l()),$=l().regex(x);function z(n,e){let t=n.safeParse(e);return t.success?t.data:void 0}function b(n){if(typeof n!="object"||n===null)return;let e=n,t=typeof e.mapping=="object"&&e.mapping!==null?Object.fromEntries(Object.entries(e.mapping).filter(y=>typeof y[1]=="string")):{},r=z(ge,e.created),s=z(pe,e.load),a=z(ue,e.writtenBetween),o=z(fe,e.removal),i=z(me,e.removalStamps),d=z(he,e.removalSpans),c=z(K,e.personContacts),h=z(K,e.withTheirRecord),g=z($,e.runUserId),p=z(w($),e.madeEarlier),P=z(w($),e.lateEarlier);return{updatedAt:typeof e.updatedAt=="string"?e.updatedAt:"",mapping:t,...r?{created:r}:{},...s?{load:s}:{},...a?{writtenBetween:a}:{},...o?{removal:o}:{},...i?{removalStamps:i}:{},...d?{removalSpans:d}:{},...c?{personContacts:c}:{},...h?{withTheirRecord:h}:{},...g?{runUserId:g}:{},...p?{madeEarlier:p}:{},...P?{lateEarlier:P}:{}}}function j(n){return Array.isArray(n.earlier)?n.earlier.flatMap(e=>b(e)??[]):[]}function O(n){return n.load?.endedAt??n.updatedAt}function ye(n,e){return n.slice(0,15)===e.slice(0,15)}function I(n){return n.slice(0,15)}function V(n,e){let t={};for(let[r,s]of Object.entries(n??{}))Object.prototype.hasOwnProperty.call(e,s)?Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=s):delete e[r];return t}function H(n,e){if(e.size===0)return n;let t=Object.fromEntries(Object.entries(n.mapping).filter(([,d])=>!e.has(I(d)))),r=V(n.personContacts,t),s=V(n.withTheirRecord,t),a=n.created?.map(({objectApiName:d,referenceIds:c})=>({objectApiName:d,referenceIds:c.filter(h=>Object.prototype.hasOwnProperty.call(t,h))})).filter(d=>d.referenceIds.length>0),o=Object.fromEntries(Object.entries(n.removalStamps??{}).filter(([d])=>!e.has(I(d)))),i={...n,mapping:t};return delete i.removalStamps,delete i.personContacts,delete i.withTheirRecord,{...i,...a?{created:a}:{},...Object.keys(o).length>0?{removalStamps:o}:{},...Object.keys(r).length>0?{personContacts:r}:{},...Object.keys(s).length>0?{withTheirRecord:s}:{}}}function Y(n){return n.created?n.created.some(e=>e.referenceIds.length>0):Object.keys(n.mapping).length>0}var X=class{constructor(e,t){this.sasDir=e;this.guard=t?.guard??new M,this.orgId=t?.orgId??"";let r=t?.organizationId;this.askOrganizationId=typeof r=="function"?r:async()=>r,this.now=t?.now??(()=>new Date)}sasDir;guard;orgId;askOrganizationId;organizationId;now;get filePath(){return this.guard.assertOutsideRepo(R.join(this.sasDir,this.orgId===""?_:ce(this.orgId)))}get singleFilePath(){return this.orgId===""?void 0:this.guard.assertOutsideRepo(R.join(this.sasDir,_))}get journalStem(){return this.orgId===""?"referenceid-mapping":`referenceid-mapping.${k(this.orgId)}`}journalPath(e){let t=typeof e=="string"?Date.parse(e):e.getTime();return this.guard.assertOutsideRepo(R.join(this.sasDir,`${this.journalStem}.load-${Math.max(0,Math.trunc(t))}.ndjson`))}retiring=new Map;journal(e){let t=this.journalPath(e),r=!1,s=!1,a=!1,o,i=Promise.resolve(),d;D.add(t);let c=g=>{i=i.then(async()=>{if(!(d!==void 0||s))try{if(!r){r=!0,await m.mkdir(R.dirname(t),{recursive:!0});let p={journal:{startedAt:e.toISOString(),pid:process.pid,...o?{runUserId:o}:{}}};await m.appendFile(t,`${JSON.stringify(p)}
|
|
9
|
-
`,"utf8")}await m.appendFile(t,`${JSON.stringify(g)}
|
|
10
|
-
`,"utf8")}catch(p){d=p instanceof Error?p.message:String(p)}})},h=async()=>{await i,s=!0,await m.rm(t,{force:!0})};return this.retiring.set(t,h),{writtenAs:g=>{x.test(g)&&(o=g)},created:(g,p)=>{let P=p.filter(([y,E])=>y!==""&&x.test(E));if(P.length!==0){a=!0;for(let y=0;y<P.length;y+=1e4)c({at:this.now().toISOString(),object:g,created:P.slice(y,y+1e4)})}},flush:async()=>(await i,d),close:async()=>{await i,this.retiring.delete(t),(s||!a)&&await m.rm(t,{force:!0}),s=!0,D.delete(t)}}}async stoppedLoads(e){let t;try{t=await m.readdir(this.guard.assertOutsideRepo(this.sasDir))}catch(o){if(o.code==="ENOENT")return[];throw o}let r=`${this.journalStem}.load-`,s=new Set(e.flatMap(o=>o.load?[o.load.startedAt]:[])),a=[];for(let o of t){if(!o.startsWith(r)||!/^\d{1,16}\.ndjson$/.test(o.slice(r.length)))continue;let i=this.guard.assertOutsideRepo(R.join(this.sasDir,o));if(D.has(i))continue;let d;try{d=await m.readFile(i,"utf8")}catch{continue}let c=de(d);!c||s.has(c.startedAt)||c.pid!==process.pid&&ie(c.pid)||a.push({file:i,load:c.load})}return a}async load(){let e=await this.read();return e===void 0||await this.writtenToAnotherOrg(e)?new Map:new Map(Object.entries(e.mapping??{}))}async previousLoads(){let e=await this.read();if(e===void 0||await this.writtenToAnotherOrg(e))return[];let t=b(e);return[...t?[t]:[],...j(e)].map(r=>({mapping:new Map(Object.entries(r.mapping)),...r.created?{created:r.created}:{},...r.writtenBetween?{writtenBetween:r.writtenBetween}:{},endedAt:O(r),...r.removalStamps?{removalStamps:r.removalStamps}:{}}))}async recorded(){return(await this.recordedLoads())[0]}async recordedLoads(){let e=await this.read();if(e===void 0)return[];let t=typeof e.orgId=="string"?e.orgId:"",r=b(e);return[...r?[this.recordedOf(r,t)]:[],...j(e).map(s=>({...this.recordedOf(s,t),earlier:!0}))]}recordedOf(e,t){return{orgId:t,mapping:new Map(Object.entries(e.mapping)),...e.created?{created:e.created}:{},...e.load?{startedAt:e.load.startedAt}:{},endedAt:O(e),...e.writtenBetween?{writtenBetween:e.writtenBetween}:{},...e.removal?{removal:e.removal}:{},removalStamps:e.removalStamps??{},removalSpans:e.removalSpans??[],...e.personContacts?{personContacts:e.personContacts}:{},...e.withTheirRecord?{withTheirRecord:e.withTheirRecord}:{},...e.runUserId?{runUserId:e.runUserId}:{},...e.madeEarlier?{madeEarlier:e.madeEarlier}:{},...e.lateEarlier?{lateEarlier:e.lateEarlier}:{}}}async isStale(){let e=await this.read();return e!==void 0&&await this.writtenToAnotherOrg(e)}async writtenToAnotherOrg(e){let t=e.organizationId;if(t===void 0)return!1;let r=await this.currentOrganizationId();return r!==void 0&&!ye(t,r)}currentOrganizationId(){return this.organizationId??=this.askOrganizationId(),this.organizationId}async read(){return(await this.readWithJournals()).payload}async readFile(){let e=await N(this.filePath);if(e!==void 0)return e;let t=this.singleFilePath;if(t===void 0)return;let r=await N(t);return r?.orgId===this.orgId?r:void 0}async readWithJournals(){let e=await this.readFile(),t=e?[b(e),...j(e)]:[],r=await this.stoppedLoads(t.filter(i=>i!==void 0));if(r.length===0)return{payload:e,journals:[]};let s=[...t.filter(i=>i!==void 0),...r.map(({load:i})=>i)].sort((i,d)=>Date.parse(O(d))-Date.parse(O(i))),[a,...o]=s;return{payload:{version:1,orgId:typeof e?.orgId=="string"?e.orgId:this.orgId,...e?.organizationId!==void 0?{organizationId:e.organizationId}:{},...a,...o.length>0?{earlier:o}:{}},journals:r.map(({file:i})=>i)}}async dropJournals(e){for(let t of e)await m.rm(t,{force:!0}).catch(()=>{})}async write(e){let t=this.filePath;await m.mkdir(R.dirname(t),{recursive:!0}),await m.writeFile(t,`${JSON.stringify(e,null,2)}
|
|
11
|
-
`,"utf8");let r=this.singleFilePath;if(r!==void 0)try{(await N(r))?.orgId===this.orgId&&await m.rm(r)}catch{}}async keptLoads(e,t,r=[]){if(e===void 0||e.orgId!==this.orgId)return[];if(await this.writtenToAnotherOrg(e))return[];let s=new Set(t.map(I)),a=new Set(r),o=b(e);return[...o?[o]:[],...j(e)].map(i=>H(i,s)).filter(i=>Y(i)||a.has(O(i)))}async persist(e,t){let{payload:r,journals:s}=await this.readWithJournals(),a=t?.earlier?await this.keptLoads(r,t.earlier.settled,t.earlier.stillToSweep):[],o=await this.currentOrganizationId(),i=this.now().toISOString(),d=g=>Object.fromEntries(Object.entries(g??{}).filter(([p,P])=>e.has(p)&&e.has(P))),c=d(t?.personContacts),h=d(t?.withTheirRecord);if(await this.write({version:1,orgId:this.orgId,...o!==void 0?{organizationId:o}:{},updatedAt:i,mapping:Object.fromEntries([...e.entries()].sort(([g],[p])=>g.localeCompare(p))),...t?{created:t.created.map(({objectApiName:g,referenceIds:p})=>({objectApiName:g,referenceIds:p.filter(P=>e.has(P))})).filter(g=>g.referenceIds.length>0),load:{startedAt:t.startedAt.toISOString(),endedAt:i},...t.writtenBetween?{writtenBetween:{...t.writtenBetween}}:{},...Object.keys(c).length>0?{personContacts:c}:{},...Object.keys(h).length>0?{withTheirRecord:h}:{},...t.runUserId?{runUserId:t.runUserId}:{}}:{},...a.length>0?{earlier:a}:{}}),t?.earlier&&await this.dropJournals(s),t){let g=this.journalPath(t.startedAt),p=this.retiring.get(g);p?await p():await m.rm(g,{force:!0}).catch(()=>{})}}async recordRemoval(e,t){let{payload:r,journals:s}=await this.readWithJournals(),a=b(r);if(r===void 0||a===void 0)return!1;let o=[a,...j(r)],i=o.findIndex(g=>O(g)===e);if(i<0)return!1;let d=new Set(t.gone.map(I)),[c,...h]=o.map((g,p)=>H(p===i?ve(g,t):g,d));return await this.write({version:1,orgId:typeof r.orgId=="string"?r.orgId:"",...r.organizationId!==void 0?{organizationId:r.organizationId}:{},...c,updatedAt:this.now().toISOString(),...h.length>0?{earlier:h}:{}}),await this.dropJournals(s),!0}async recordMade(e,t,r=[],s=[]){let{payload:a,journals:o}=await this.readWithJournals(),i=b(a);if(a===void 0||i===void 0)return!1;let d=[i,...j(a)],c=d.findIndex(y=>O(y)===e);if(c<0)return!1;let h=[...s],g=y=>{let E=Q(y.madeEarlier,t,h),C=Q(y.lateEarlier,r,h),T={...y};return delete T.madeEarlier,delete T.lateEarlier,{...T,...E.length>0?{madeEarlier:E}:{},...C.length>0?{lateEarlier:C}:{}}},[p,...P]=d.map((y,E)=>E===c?g(y):y);return await this.write({version:1,orgId:typeof a.orgId=="string"?a.orgId:"",...a.organizationId!==void 0?{organizationId:a.organizationId}:{},...p,...P.length>0?{earlier:P}:{}}),await this.dropJournals(o),!0}async letSweptGo(e){if(e.length===0)return!1;let{payload:t,journals:r}=await this.readWithJournals(),s=b(t);if(t===void 0||s===void 0)return!1;let a=new Set(e),o=j(t),i=o.filter(d=>Y(d)||!a.has(O(d)));return i.length===o.length?!1:(await this.write({version:1,orgId:typeof t.orgId=="string"?t.orgId:"",...t.organizationId!==void 0?{organizationId:t.organizationId}:{},...s,...i.length>0?{earlier:i}:{}}),await this.dropJournals(r),!0)}async recordStamps(e){let{payload:t,journals:r}=await this.readWithJournals(),s=b(t);if(t===void 0||s===void 0)return!1;let a=[s,...j(t)],o=a.map(c=>we(c,e));if(o.every((c,h)=>c===a[h]))return!1;let[i,...d]=o;return await this.write({version:1,orgId:typeof t.orgId=="string"?t.orgId:"",...t.organizationId!==void 0?{organizationId:t.organizationId}:{},...i,...d.length>0?{earlier:d}:{}}),await this.dropJournals(r),!0}};function Q(n,e,t=[]){let r=new Map,s=new Set(t.map(I)),a=[];for(let o of[...n??[],...e]){let i=I(o),d=i.slice(0,3),c=r.get(d)??0;!x.test(o)||s.has(i)||c>=q||(s.add(i),r.set(d,c+1),a.push(o))}return a}function we(n,e){let t=new Set(Object.values(n.mapping).map(I)),r=Object.entries(e).filter(([a])=>t.has(I(a)));if(r.length===0)return n;let s=new Set(r.map(([a])=>I(a)));return{...n,removalStamps:{...Object.fromEntries(Object.entries(n.removalStamps??{}).filter(([a])=>!s.has(I(a)))),...Object.fromEntries(r)}}}function ve(n,e){let t={...n.removalStamps,...e.stamps},r=[...n.removalSpans??[],...e.span?[e.span]:[]],s=e.mark??n.removal;return{...n,...s?{removal:s}:{},...Object.keys(t).length>0?{removalStamps:t}:{},...r.length>0?{removalSpans:r}:{}}}export{ee as a,k as b,J as c,M as d,ce as e,Fe as f,X as g};
|
package/lib/chunk-5CKWGZX4.mjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
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 D,d as L,f as G,g as _}from"./chunk-5C5XEVZN.mjs";import{d as T}from"./chunk-DXOXLUZA.mjs";import{H as $,d as F,k as u,z as j}from"./chunk-E2YJVSX6.mjs";import{Ra as k,Ua as P,cb as A}from"./chunk-DPYTG6DM.mjs";import{b as w,k as E,l as O,u as v,v as N,z as b}from"./chunk-WZQEK4WT.mjs";import{randomBytes as q}from"node:crypto";import{open as H,readFile as V,readdir as Q,rename as X,rm as tt,stat as et}from"node:fs/promises";import{homedir as rt}from"node:os";import{join as l,resolve as nt}from"node:path";import*as y from"node:fs";import*as S from"node:path";function Z(n){return`counting-contract.${D(n)}.json`}function C(n,t,e){return n.assertOutsideRepo(S.join(t,Z(e)))}function pt(n,t,e){let r=C(n,t,e.orgId);return y.mkdirSync(S.dirname(r),{recursive:!0}),y.writeFileSync(r,`${JSON.stringify(e,null,2)}
|
|
8
|
-
`,"utf8"),r}function gt(n,t){let e=n.assertOutsideRepo(t),r=JSON.parse(y.readFileSync(e,"utf8"));if(r.version!==1||typeof r.objects!="object"||r.objects===null)throw new Error(`Invalid counting contract at ${e}: version 1 with objects expected`);return r}function ut(n,t){if(n.loadStartedAt!==void 0)return n.loadStartedAt===t.startedAt;let e=Date.parse(n.writtenAt),r=Date.parse(t.endedAt);return Number.isFinite(e)&&Number.isFinite(r)&&e>=r}var it="replays",J="replay.json";function Pt(n=process.env){let t=n.SANDFORGE_JOURNAL_DIR,e=t!==void 0&&t.trim()!==""?nt(t):l(rt(),".sandforge");return l(e,it)}var x=b.datetime({offset:!0}),ot=O({organizationId:P,name:w().min(1).max(255),choices:A,firstAt:x,lastAt:x}),Y=O({version:N(1),checkpoint:O({checkpointId:k,name:w().min(1).max(255),organizationId:P,alias:w().min(1).max(255).optional(),tier:v(["sandbox","scratch","developer"]),takenAt:x}),targets:E(ot).max(1e4)}),M=/^00D[A-Za-z0-9]{15}$/,K=class{root;guard;now;writes=new Map;constructor(t){this.guard=t.guard??new L,this.root=this.guard.assertOutsideRepo(t.root),this.now=t.now??(()=>new Date)}folderOf(t,e){let r=u(t),i=k.safeParse(e);if(!i.success)throw new $("invalid","Not a checkpoint\u2019s id");return{dir:this.guard.assertOutsideRepo(l(this.root,r,i.data)),sourceOrganizationId:r,checkpointId:i.data}}async record(t,e,r){let i=this.folderOf(t.org.organizationId,t.checkpointId),o=u(e.organizationId),c=A.parse(r);await j(i.dir);let d=l(i.dir,J),a=async()=>{let h=this.now().toISOString(),I=await B(d),R=I?.targets.find(s=>s.organizationId===o),m={version:1,checkpoint:{checkpointId:i.checkpointId,name:t.name,organizationId:i.sourceOrganizationId,...t.org.alias!==void 0?{alias:t.org.alias}:{},tier:t.org.tier,takenAt:t.takenAt},targets:[...I?.targets.filter(s=>s.organizationId!==o)??[],{organizationId:o,name:e.name,choices:c,firstAt:R?.firstAt??h,lastAt:h}]};await st(d,`${JSON.stringify(Y.parse(m),null,2)}
|
|
9
|
-
`)},g=(this.writes.get(d)??Promise.resolve()).then(a,a),f=g.catch(()=>{});return this.writes.set(d,f),f.then(()=>{this.writes.get(d)===f&&this.writes.delete(d)}),await g,i}mappingStoreOf(t,e,r={}){return new _(t.dir,{guard:this.guard,orgId:u(e),...r})}contractPathOf(t,e){return C(this.guard,t.dir,u(e))}async read(t){return B(l(t.dir,J))}async list(t={}){let e=t.sourceOrganizationId!==void 0?u(t.sourceOrganizationId):void 0,r=t.targetOrganizationId!==void 0?u(t.targetOrganizationId):void 0,i=[];for(let o of await W(this.root))if(!(!M.test(o)||e!==void 0&&o!==e))for(let c of await W(l(this.root,o))){if(!k.safeParse(c).success||t.checkpointId!==void 0&&c!==t.checkpointId)continue;let d=this.folderOf(o,c);i.push(...await this.entriesOf(d,r))}return i.sort((o,c)=>z(c.replayedAt??"",o.replayedAt??"")||z(o.checkpointId,c.checkpointId)||z(o.target.organizationId,c.target.organizationId))}async replaysOf(t,e){return this.list({sourceOrganizationId:t,checkpointId:e})}async entriesOf(t,e){let r=await this.read(t),i=new Map(r?.targets.map(a=>[a.organizationId,a])),o=(await G(t.dir,this.guard)).filter(a=>M.test(a)),c=[...new Set([...i.keys(),...o])].filter(a=>e===void 0||a===e),d=[];for(let a of c){let g=i.get(a),f=await this.mappingStoreOf(t,a).recordedLoads(),h=new Map;for(let s of f)for(let{objectApiName:p,ids:U}of T(s))h.set(p,(h.get(p)??0)+U.length);let I=[...h].map(([s,p])=>({objectApiName:s,records:p})).sort((s,p)=>z(s.objectApiName,p.objectApiName)),R=I.reduce((s,p)=>s+p.records,0),m=f.find(s=>s.earlier!==!0);d.push({sourceOrganizationId:t.sourceOrganizationId,checkpointId:t.checkpointId,...r?{checkpointName:r.checkpoint.name}:{},...r?{takenAt:r.checkpoint.takenAt}:{},target:{organizationId:a,...g?{name:g.name}:{}},...g?{choices:g.choices}:{},...m?{replayedAt:m.endedAt}:{},inPlace:R,inPlaceByObject:I,...m!==void 0&&R===0&&m.removal!==void 0?{removed:!0}:{}})}return d}};function at(n){return n.filter(t=>t.inPlace>0)}function At(n){let t=at(n);if(t.length===0)return;let e=t.map(r=>`${r.inPlace.toLocaleString("en-US")} record${r.inPlace===1?"":"s"} in ${r.target.name??r.target.organizationId}`).join(", ");return`${t.length===1?"A replay":`${t.length} replays`} of it ${t.length===1?"is":"are"} still in place: ${e}. Deleting the checkpoint leaves them there, and each replay is still removed without it.`}async function B(n){let t;try{t=await V(n,"utf8")}catch(e){if(e.code==="ENOENT")return;throw e}try{let e=Y.safeParse(JSON.parse(t));return e.success?e.data:void 0}catch{return}}async function st(n,t){let e=`${n}.${process.pid}-${q(4).toString("hex")}.tmp`,r=await H(e,"wx",F);try{try{await r.writeFile(t,"utf8"),await r.sync()}finally{await r.close()}await X(e,n)}catch(i){throw await tt(e,{force:!0}),i}}async function W(n){let t;try{t=await Q(n)}catch(r){if(r.code==="ENOENT")return[];throw r}let e=[];for(let r of t)(await et(l(n,r)).catch(()=>{}))?.isDirectory()&&e.push(r);return e.sort()}function z(n,t){return n<t?-1:n>t?1:0}export{C as a,pt as b,gt as c,ut as d,J as e,Pt as f,K as g,at as h,At as i};
|