sandforge 1.80.0 → 1.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -0
- package/bin/sandforge-pipeline.mjs +12 -0
- package/bin/sandforge-users.mjs +12 -0
- package/lib/{chunk-J525F5KI.mjs → chunk-27Z76O2O.mjs} +1 -1
- package/lib/chunk-2JZGCCPG.mjs +9 -0
- package/lib/{chunk-ELFXJHU7.mjs → chunk-2UU42PTD.mjs} +1 -1
- package/lib/{chunk-N652NMZ4.mjs → chunk-32EUNQT6.mjs} +52 -52
- package/lib/chunk-3C2ZZIFN.mjs +7 -0
- package/lib/chunk-3CX7GPCR.mjs +7 -0
- package/lib/chunk-3HEMJTAP.mjs +925 -0
- package/lib/{chunk-BY2HJFFG.mjs → chunk-3HROD5RE.mjs} +1 -1
- package/lib/{chunk-OHWNPXWW.mjs → chunk-3MGMNK3Q.mjs} +1 -1
- package/lib/{chunk-PZPJKATS.mjs → chunk-3SKLBRPL.mjs} +8 -8
- package/lib/chunk-3XG25GTF.mjs +7 -0
- package/lib/chunk-42BFLWHR.mjs +7 -0
- package/lib/chunk-466F37VD.mjs +7 -0
- package/lib/chunk-47UHTN3Q.mjs +7 -0
- package/lib/chunk-4JKR4PTZ.mjs +8 -0
- package/lib/{chunk-COFG7Q6R.mjs → chunk-52EXDVPN.mjs} +1 -1
- package/lib/{chunk-SAR5622P.mjs → chunk-54HYHHVL.mjs} +1 -1
- package/lib/{chunk-RSWDYIHY.mjs → chunk-5GBO4KD5.mjs} +1 -1
- package/lib/chunk-5K2I2DMP.mjs +11 -0
- package/lib/{chunk-AV5SWEHP.mjs → chunk-6FARZYMJ.mjs} +1 -1
- package/lib/{chunk-BV6VTP3J.mjs → chunk-6GQUZ4IP.mjs} +1 -1
- package/lib/chunk-6KP6WETK.mjs +9 -0
- package/lib/{chunk-MJVTDA5Q.mjs → chunk-6VSZNZHH.mjs} +1 -1
- package/lib/{chunk-XUWL6ZPC.mjs → chunk-7CVDVBEE.mjs} +1 -1
- package/lib/{chunk-UCD54V2M.mjs → chunk-7EYQYZJP.mjs} +1 -1
- package/lib/{chunk-5K5VLULK.mjs → chunk-7LKI7OAS.mjs} +1 -1
- package/lib/chunk-7PY3VQP3.mjs +7 -0
- package/lib/chunk-7SDZR6SR.mjs +7 -0
- package/lib/chunk-7WSLT5VX.mjs +8 -0
- package/lib/chunk-A32ISQ6M.mjs +28 -0
- package/lib/{chunk-M3ROUWDX.mjs → chunk-A65ADTCR.mjs} +1 -1
- package/lib/chunk-A7JJWOLT.mjs +7 -0
- package/lib/chunk-AUS6NFLZ.mjs +8 -0
- package/lib/chunk-BMTNTBBM.mjs +7 -0
- package/lib/{chunk-SOU4FRYN.mjs → chunk-BN33LVPQ.mjs} +1 -1
- package/lib/chunk-BNKT3R3F.mjs +7 -0
- package/lib/{chunk-K2FBZIXY.mjs → chunk-BWWQXU2B.mjs} +1 -1
- package/lib/{chunk-IC2C2GOF.mjs → chunk-BXZ73A5M.mjs} +1 -1
- package/lib/{chunk-WA7EYLAQ.mjs → chunk-C2N2TNEU.mjs} +1 -1
- package/lib/{chunk-BKDV4ENO.mjs → chunk-C3LNYAVJ.mjs} +1 -1
- package/lib/{chunk-XLXIPIEW.mjs → chunk-CBL42DUU.mjs} +1 -1
- package/lib/chunk-CCEH7L53.mjs +7 -0
- package/lib/chunk-CELEBWEZ.mjs +7 -0
- package/lib/chunk-CV47FDQW.mjs +7 -0
- package/lib/{chunk-2UZPIMUC.mjs → chunk-CZLJZQCS.mjs} +1 -1
- package/lib/chunk-DBBPDSFN.mjs +7 -0
- package/lib/chunk-DIL62SUN.mjs +7 -0
- package/lib/chunk-DIS254AN.mjs +7 -0
- package/lib/{chunk-BTWDMNN3.mjs → chunk-DJCGURW7.mjs} +1 -1
- package/lib/{chunk-F6GUDTOB.mjs → chunk-DT3T7FRD.mjs} +1 -1
- package/lib/{chunk-IGYH7GMA.mjs → chunk-DWMRIWV5.mjs} +1 -1
- package/lib/{chunk-YRQGKDHM.mjs → chunk-EEFUE2ES.mjs} +1 -1
- package/lib/{chunk-FGRG7ANU.mjs → chunk-EOFO3PHS.mjs} +1 -1
- package/lib/{chunk-KBJ5VERV.mjs → chunk-FA4ZKDCU.mjs} +1 -1
- package/lib/{chunk-WU3GLFZO.mjs → chunk-FKK5YBGZ.mjs} +1 -1
- package/lib/chunk-FOIWWK7G.mjs +156 -0
- package/lib/chunk-FZF23M6R.mjs +7 -0
- package/lib/chunk-G2JR3F63.mjs +7 -0
- package/lib/{chunk-JEERQRLW.mjs → chunk-GBGHJTPC.mjs} +1 -1
- package/lib/{chunk-3RZQZHEB.mjs → chunk-GCGHHN4K.mjs} +1 -1
- package/lib/{chunk-RPI7LRTW.mjs → chunk-GGNUACTY.mjs} +1 -1
- package/lib/{chunk-EMNC6YI4.mjs → chunk-GGUOIDWP.mjs} +1 -1
- package/lib/chunk-GHPR5UVV.mjs +7 -0
- package/lib/{chunk-X5JYBPXP.mjs → chunk-GJ6SZVHT.mjs} +1 -1
- package/lib/{chunk-W622GUAW.mjs → chunk-H4JUYUSL.mjs} +1 -1
- package/lib/{chunk-XAMBCQPU.mjs → chunk-H4OBZIX3.mjs} +1 -1
- package/lib/{chunk-WIO4XO4F.mjs → chunk-HFSBDM7B.mjs} +1 -1
- package/lib/{chunk-L77FJZEP.mjs → chunk-HFUDCNU5.mjs} +1 -1
- package/lib/chunk-HIHCYMSL.mjs +7 -0
- package/lib/chunk-HKUWHVI7.mjs +9 -0
- package/lib/chunk-HQQVANWQ.mjs +20 -0
- package/lib/chunk-ICIYL45C.mjs +7 -0
- package/lib/chunk-IRZJU2PG.mjs +22 -0
- package/lib/chunk-ISSP2FZ5.mjs +7 -0
- package/lib/chunk-IVZJSDJD.mjs +7 -0
- package/lib/chunk-J24TIGSI.mjs +10 -0
- package/lib/{chunk-UNJA4J37.mjs → chunk-JESRFE2Z.mjs} +4 -4
- package/lib/chunk-JFNLKHY6.mjs +8 -0
- package/lib/chunk-JH27IKCO.mjs +9 -0
- package/lib/chunk-JJITOWZK.mjs +7 -0
- package/lib/{chunk-E5AHXLS6.mjs → chunk-JKT5YAQ2.mjs} +1 -1
- package/lib/{chunk-IWDREM66.mjs → chunk-JLZRZL5E.mjs} +1 -1
- package/lib/{chunk-FPKYYFM7.mjs → chunk-JPEVIXNH.mjs} +1 -1
- package/lib/chunk-JQZTMFO7.mjs +7 -0
- package/lib/chunk-KIMQQ6JQ.mjs +7 -0
- package/lib/{chunk-MILU7WFN.mjs → chunk-KJYEQHYP.mjs} +1 -1
- package/lib/chunk-KKOA62S4.mjs +474 -0
- package/lib/chunk-KP5G6FUC.mjs +7 -0
- package/lib/{chunk-JWTSEDIQ.mjs → chunk-L4INJ5TZ.mjs} +1 -1
- package/lib/{chunk-OLSGVAIL.mjs → chunk-LAUOSXMN.mjs} +53 -53
- package/lib/{chunk-MTMH6H2A.mjs → chunk-LCDPCUXS.mjs} +1 -1
- package/lib/{chunk-KDGMAGQR.mjs → chunk-LHU6CPGE.mjs} +1 -1
- package/lib/{chunk-YAZO75G2.mjs → chunk-LNXBCE7E.mjs} +1 -1
- package/lib/chunk-LXDSRP2W.mjs +7 -0
- package/lib/{chunk-2YIV2OB2.mjs → chunk-MIDBQ7SD.mjs} +1 -1
- package/lib/{chunk-TTKXMDBN.mjs → chunk-MKTXJCXN.mjs} +4 -4
- package/lib/chunk-MUEQRIK7.mjs +9 -0
- package/lib/{chunk-IOIWJ3DJ.mjs → chunk-NLB3RGIY.mjs} +1 -1
- package/lib/{chunk-O2HDYYUV.mjs → chunk-NWOI25WY.mjs} +1 -1
- package/lib/chunk-O2PUGRNW.mjs +10 -0
- package/lib/chunk-O4BROUGM.mjs +7 -0
- package/lib/chunk-OETEC3P7.mjs +7 -0
- package/lib/{chunk-GCOB7K5N.mjs → chunk-OHEOJISY.mjs} +1 -1
- package/lib/chunk-P55MKIZX.mjs +37 -0
- package/lib/chunk-P63WJMXQ.mjs +7 -0
- package/lib/chunk-PBE44M2Y.mjs +7 -0
- package/lib/{chunk-TYYOBZMU.mjs → chunk-PC247GKX.mjs} +1 -1
- package/lib/chunk-PE435FVH.mjs +15 -0
- package/lib/chunk-PPGDAUEQ.mjs +7 -0
- package/lib/{chunk-SE4QEZUG.mjs → chunk-PPHVWUFY.mjs} +1 -1
- package/lib/{chunk-CU2INBND.mjs → chunk-PR74GYVI.mjs} +1 -1
- package/lib/chunk-PWVDNN2C.mjs +7 -0
- package/lib/{chunk-6XYKJSGX.mjs → chunk-PYRZFUVU.mjs} +1 -1
- package/lib/{chunk-TLH7AD35.mjs → chunk-PZBZ7MNC.mjs} +1 -1
- package/lib/{chunk-DYFALGRT.mjs → chunk-Q3DY7TO2.mjs} +1 -1
- package/lib/{chunk-BGUEWRK2.mjs → chunk-Q6SXNKV2.mjs} +1 -1
- package/lib/chunk-QAPVKPEC.mjs +7 -0
- package/lib/{chunk-DBFJB2B6.mjs → chunk-QIRO4HTE.mjs} +1 -1
- package/lib/{chunk-TSLJUSLW.mjs → chunk-RCYEBY42.mjs} +1 -1
- package/lib/chunk-RLWB7F26.mjs +7 -0
- package/lib/{chunk-FXXLX4O6.mjs → chunk-RTWYLOCA.mjs} +1 -1
- package/lib/chunk-RYRMUPMY.mjs +7 -0
- package/lib/chunk-SAMWHL22.mjs +13 -0
- package/lib/{chunk-IZQZ6ZUF.mjs → chunk-SFGZFB4F.mjs} +1 -1
- package/lib/{chunk-FKG7Q3WH.mjs → chunk-SNEOKYV7.mjs} +1 -1
- package/lib/{chunk-3TJON4F3.mjs → chunk-STRMWSIQ.mjs} +1 -1
- package/lib/chunk-SZGGFST2.mjs +272 -0
- package/lib/{chunk-SOGQW4IG.mjs → chunk-T7WREYA5.mjs} +1 -1
- package/lib/{chunk-NTFIRZP6.mjs → chunk-TCBAE65A.mjs} +1 -1
- package/lib/{chunk-KYEDBS54.mjs → chunk-TEIBWMJM.mjs} +1 -1
- package/lib/{chunk-YKKRIEH4.mjs → chunk-TMA34QMA.mjs} +1 -1
- package/lib/chunk-TQ2TQHTT.mjs +9 -0
- package/lib/{chunk-HEKAZJRH.mjs → chunk-TWV4A5RK.mjs} +1 -1
- package/lib/{chunk-CEX3NEZL.mjs → chunk-UHFLKP26.mjs} +1 -1
- package/lib/chunk-UV74P4H2.mjs +7 -0
- package/lib/{chunk-WR4Q363I.mjs → chunk-V3R45ZWT.mjs} +1 -1
- package/lib/{chunk-GSKCGQIP.mjs → chunk-VPDEJGPS.mjs} +1 -1
- package/lib/{chunk-HLWMJF6Y.mjs → chunk-VQJMP3DC.mjs} +1 -1
- package/lib/chunk-VV3B6IC3.mjs +7 -0
- package/lib/{chunk-PJ5I73CK.mjs → chunk-VYOYXTCU.mjs} +1 -1
- package/lib/{chunk-NZC67CGR.mjs → chunk-VZT4E2OJ.mjs} +1 -1
- package/lib/{chunk-AEKONPF4.mjs → chunk-VZVICK7Q.mjs} +1 -1
- package/lib/{chunk-WR2GIKWE.mjs → chunk-WB2RIVO3.mjs} +1 -1
- package/lib/chunk-WEMLDUQA.mjs +7 -0
- package/lib/{chunk-MYW5QNGI.mjs → chunk-WOOUISSO.mjs} +1 -1
- package/lib/{chunk-G35N4P7D.mjs → chunk-WSUKC2U3.mjs} +1 -1
- package/lib/{chunk-ZVAED4QV.mjs → chunk-WT3SCUHS.mjs} +1 -1
- package/lib/{chunk-7EANH5PY.mjs → chunk-WZQEK4WT.mjs} +1 -1
- package/lib/{chunk-DBB3EMIN.mjs → chunk-XFU3HRUV.mjs} +1 -1
- package/lib/chunk-XK5W7BVE.mjs +7 -0
- package/lib/{chunk-2GTBABKU.mjs → chunk-XO5FBOQF.mjs} +1 -1
- package/lib/{chunk-CHYDMRSV.mjs → chunk-XSKPYGMT.mjs} +1 -1
- package/lib/chunk-XU25YA46.mjs +9 -0
- package/lib/chunk-XZISAZA6.mjs +7 -0
- package/lib/chunk-Y4TDVDP2.mjs +13 -0
- package/lib/chunk-YAIIRFKJ.mjs +8 -0
- package/lib/{chunk-LKQ5RKIV.mjs → chunk-YAJQS3OL.mjs} +1 -1
- package/lib/{chunk-74Q6DORA.mjs → chunk-YGJF55VJ.mjs} +1 -1
- package/lib/chunk-YH4DYI6D.mjs +7 -0
- package/lib/chunk-YMDFF657.mjs +10 -0
- package/lib/{chunk-2BA2XKAY.mjs → chunk-YT22LMF7.mjs} +1 -1
- package/lib/{chunk-IG2MTQRP.mjs → chunk-Z42PHCVZ.mjs} +1 -1
- package/lib/{chunk-2NBYT7GR.mjs → chunk-ZHIZY3ZC.mjs} +1 -1
- package/lib/chunk-ZQO5PDX5.mjs +48 -0
- package/lib/chunk-ZRUDYB7O.mjs +7 -0
- package/lib/{chunk-BXU6WFMH.mjs → chunk-ZUBBEP75.mjs} +1 -1
- package/lib/chunk-ZUOPC4W2.mjs +7 -0
- package/lib/{chunk-GGD7ON3M.mjs → chunk-ZUTUYBNW.mjs} +1 -1
- package/lib/{chunk-MHMH6MTP.mjs → chunk-ZXFL2MSN.mjs} +1 -1
- package/lib/sandforge-autopilot.mjs +11 -11
- package/lib/sandforge-backup.mjs +63 -32
- package/lib/sandforge-checkpoint.mjs +1 -348
- package/lib/sandforge-cleanup.mjs +1 -1
- package/lib/sandforge-clone.mjs +1 -1
- package/lib/sandforge-compare.mjs +1 -1
- package/lib/sandforge-dataops.mjs +1 -1
- package/lib/sandforge-empty.mjs +11 -11
- package/lib/sandforge-env.mjs +186 -140
- package/lib/sandforge-frozen.mjs +1 -266
- package/lib/sandforge-mcp.mjs +33 -14
- package/lib/sandforge-monitor.mjs +1 -1
- package/lib/sandforge-pipeline.mjs +88 -0
- package/lib/sandforge-seed.mjs +1 -1
- package/lib/sandforge-sync.mjs +1 -1
- package/lib/sandforge-users.mjs +157 -0
- package/lib/sandforge.mjs +1 -22
- package/lib/sf/sandforge/autopilot.mjs +20 -0
- package/lib/sf/sandforge/backup.mjs +20 -0
- package/lib/sf/sandforge/checkpoint.mjs +20 -0
- package/lib/sf/sandforge/cleanup.mjs +20 -0
- package/lib/sf/sandforge/clone.mjs +20 -0
- package/lib/sf/sandforge/compare.mjs +20 -0
- package/lib/sf/sandforge/dataops.mjs +20 -0
- package/lib/sf/sandforge/empty.mjs +20 -0
- package/lib/sf/sandforge/env.mjs +20 -0
- package/lib/sf/sandforge/frozen.mjs +20 -0
- package/lib/sf/sandforge/hardis-commands.mjs +20 -0
- package/lib/sf/sandforge/index.mjs +20 -0
- package/lib/sf/sandforge/mcp.mjs +20 -0
- package/lib/sf/sandforge/monitor.mjs +20 -0
- package/lib/sf/sandforge/pipeline.mjs +20 -0
- package/lib/sf/sandforge/seed.mjs +20 -0
- package/lib/sf/sandforge/sync.mjs +20 -0
- package/lib/sf/sandforge/users.mjs +20 -0
- package/lib/sfHelpHook.mjs +7 -0
- package/lib/sfPlugin.mjs +11 -0
- package/oclif.manifest.json +1 -0
- package/package.json +18 -3
- package/lib/chunk-2CNCDM56.mjs +0 -7
- package/lib/chunk-3F6Q5E7I.mjs +0 -14
- package/lib/chunk-4VS2V6WU.mjs +0 -25
- package/lib/chunk-5P4PHJRL.mjs +0 -9
- package/lib/chunk-5TC3QB4U.mjs +0 -10
- package/lib/chunk-7ABODJ4G.mjs +0 -7
- package/lib/chunk-7EGQP6S4.mjs +0 -7
- package/lib/chunk-7FFGJWHN.mjs +0 -7
- package/lib/chunk-7YDNUBO5.mjs +0 -7
- package/lib/chunk-A527W53V.mjs +0 -7
- package/lib/chunk-ADOAS63R.mjs +0 -7
- package/lib/chunk-B5QQJ4SI.mjs +0 -7
- package/lib/chunk-CION3VMZ.mjs +0 -7
- package/lib/chunk-CSBS5U5I.mjs +0 -7
- package/lib/chunk-DB7RBE5D.mjs +0 -7
- package/lib/chunk-E5ZB3LU5.mjs +0 -7
- package/lib/chunk-EFR2Y7E4.mjs +0 -7
- package/lib/chunk-EHQ3FX6X.mjs +0 -7
- package/lib/chunk-EQNW3UC2.mjs +0 -7
- package/lib/chunk-F43REJDZ.mjs +0 -10
- package/lib/chunk-GSG7WZHM.mjs +0 -7
- package/lib/chunk-HOJYWTP7.mjs +0 -20
- package/lib/chunk-HS4YRX4J.mjs +0 -7
- package/lib/chunk-I7O6C2B5.mjs +0 -8
- package/lib/chunk-IFETCRWE.mjs +0 -10
- package/lib/chunk-IQXHJEYB.mjs +0 -7
- package/lib/chunk-JPUR2CFX.mjs +0 -10
- package/lib/chunk-K327QKMD.mjs +0 -7
- package/lib/chunk-KRCA6IPH.mjs +0 -8
- package/lib/chunk-LPBMBW3O.mjs +0 -13
- package/lib/chunk-LWW4U276.mjs +0 -7
- package/lib/chunk-MFG4MUIO.mjs +0 -9
- package/lib/chunk-MJU2PGZQ.mjs +0 -15
- package/lib/chunk-OAZRPP4I.mjs +0 -7
- package/lib/chunk-OO6CLPEH.mjs +0 -7
- package/lib/chunk-OPXCV2KL.mjs +0 -7
- package/lib/chunk-P33PSCXK.mjs +0 -7
- package/lib/chunk-Q3DM32KF.mjs +0 -11
- package/lib/chunk-QR3WELJQ.mjs +0 -7
- package/lib/chunk-QWT2C74M.mjs +0 -7
- package/lib/chunk-R3X3LV64.mjs +0 -14
- package/lib/chunk-RMBPOTD7.mjs +0 -7
- package/lib/chunk-SIHORWVK.mjs +0 -7
- package/lib/chunk-T62WNR54.mjs +0 -7
- package/lib/chunk-TTFDUKUS.mjs +0 -47
- package/lib/chunk-VE6XKGGD.mjs +0 -7
- package/lib/chunk-VGW4MXXZ.mjs +0 -7
- package/lib/chunk-VS7ZXUII.mjs +0 -824
- package/lib/chunk-VXQLDM4R.mjs +0 -7
- package/lib/chunk-VYXMVJL5.mjs +0 -7
- package/lib/chunk-W7U5E5ZL.mjs +0 -9
- package/lib/chunk-WXAQ7FK3.mjs +0 -115
- package/lib/chunk-YS4G22C2.mjs +0 -7
- package/lib/chunk-ZM6OJGIG.mjs +0 -7
- package/lib/chunk-ZUTYVST5.mjs +0 -7
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default class SandforgeCommand {
|
|
2
|
+
static summary = "take a checkpoint of an org's data, and rewind the org to it";
|
|
3
|
+
static 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.";
|
|
4
|
+
static hidden = false;
|
|
5
|
+
static strict = false;
|
|
6
|
+
static flags = {};
|
|
7
|
+
static args = {"argv":{"name":"argv","description":"the words npx sandforge checkpoint 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("checkpoint", argv);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default class SandforgeCommand {
|
|
2
|
+
static summary = "Bulk delete records you created on a sandbox in a time window";
|
|
3
|
+
static 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.";
|
|
4
|
+
static hidden = false;
|
|
5
|
+
static strict = false;
|
|
6
|
+
static flags = {};
|
|
7
|
+
static args = {"argv":{"name":"argv","description":"the words npx sandforge cleanup 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("cleanup", argv);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default class SandforgeCommand {
|
|
2
|
+
static summary = "clone a record, or whole tables, from one org to a sandbox, or remove a run";
|
|
3
|
+
static 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.";
|
|
4
|
+
static hidden = false;
|
|
5
|
+
static strict = false;
|
|
6
|
+
static flags = {};
|
|
7
|
+
static args = {"argv":{"name":"argv","description":"the words npx sandforge clone 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("clone", argv);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default class SandforgeCommand {
|
|
2
|
+
static summary = "compare two orgs the way the Compare page does";
|
|
3
|
+
static 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.";
|
|
4
|
+
static hidden = false;
|
|
5
|
+
static strict = false;
|
|
6
|
+
static flags = {};
|
|
7
|
+
static args = {"argv":{"name":"argv","description":"the words npx sandforge compare 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("compare", argv);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default class SandforgeCommand {
|
|
2
|
+
static summary = "mask an org's records, and put them back";
|
|
3
|
+
static 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.";
|
|
4
|
+
static hidden = false;
|
|
5
|
+
static strict = false;
|
|
6
|
+
static flags = {};
|
|
7
|
+
static args = {"argv":{"name":"argv","description":"the words npx sandforge dataops 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("dataops", argv);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default class SandforgeCommand {
|
|
2
|
+
static summary = "empty objects of a sandbox, or the whole of it";
|
|
3
|
+
static 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.";
|
|
4
|
+
static hidden = false;
|
|
5
|
+
static strict = false;
|
|
6
|
+
static flags = {};
|
|
7
|
+
static args = {"argv":{"name":"argv","description":"the words npx sandforge empty 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("empty", argv);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default class SandforgeCommand {
|
|
2
|
+
static summary = "apply a sandforge.yaml to an org, and take it back";
|
|
3
|
+
static 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.";
|
|
4
|
+
static hidden = false;
|
|
5
|
+
static strict = false;
|
|
6
|
+
static flags = {};
|
|
7
|
+
static args = {"argv":{"name":"argv","description":"the words npx sandforge env 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("env", argv);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default class SandforgeCommand {
|
|
2
|
+
static summary = "build and replay a Frozen Dataset";
|
|
3
|
+
static 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.";
|
|
4
|
+
static hidden = false;
|
|
5
|
+
static strict = false;
|
|
6
|
+
static flags = {};
|
|
7
|
+
static args = {"argv":{"name":"argv","description":"the words npx sandforge frozen 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("frozen", argv);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -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.82.0"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sandforge",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.82.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",
|
|
@@ -40,15 +40,30 @@
|
|
|
40
40
|
"sandforge-frozen": "bin/sandforge-frozen.mjs",
|
|
41
41
|
"sandforge-mcp": "bin/sandforge-mcp.mjs",
|
|
42
42
|
"sandforge-monitor": "bin/sandforge-monitor.mjs",
|
|
43
|
+
"sandforge-pipeline": "bin/sandforge-pipeline.mjs",
|
|
43
44
|
"sandforge-seed": "bin/sandforge-seed.mjs",
|
|
44
|
-
"sandforge-sync": "bin/sandforge-sync.mjs"
|
|
45
|
+
"sandforge-sync": "bin/sandforge-sync.mjs",
|
|
46
|
+
"sandforge-users": "bin/sandforge-users.mjs"
|
|
45
47
|
},
|
|
46
48
|
"files": [
|
|
47
49
|
"bin/",
|
|
48
50
|
"lib/",
|
|
49
|
-
"THIRD-PARTY-NOTICES.md"
|
|
51
|
+
"THIRD-PARTY-NOTICES.md",
|
|
52
|
+
"oclif.manifest.json"
|
|
50
53
|
],
|
|
51
54
|
"engines": {
|
|
52
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
|
+
}
|
|
53
68
|
}
|
|
54
69
|
}
|
package/lib/chunk-2CNCDM56.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{b as ne,c as ae,d as Bo,e as $o,f as me}from"./chunk-SIHORWVK.mjs";import{a as Mo,e as Uo}from"./chunk-F43REJDZ.mjs";import{J as te,P as _e,a as Do}from"./chunk-JPUR2CFX.mjs";import{f as Ne,o as pe,r as De,t as Lo,v as Fe}from"./chunk-PZPJKATS.mjs";import{c as To}from"./chunk-MFG4MUIO.mjs";import{E as Fo}from"./chunk-EQNW3UC2.mjs";import{b as le,d as de}from"./chunk-GSKCGQIP.mjs";import{c as No}from"./chunk-JWTSEDIQ.mjs";import{c as _o,e as Ce,g as Te,h as ce}from"./chunk-TZE3Y7IQ.mjs";import{a as Co,b as X}from"./chunk-CA5NAXSU.mjs";import{A as oo,B as to,C as no,G as ao,H as ro,Ha as go,I as io,Ia as bo,J as so,Ja as yo,K as co,Va as fo,ec as ko,ga as lo,ha as po,kb as ho,m as Xe,ma as oe,mb as zo,na as Oe,nb as So,nc as Oo,oc as Ro,pc as wo,qb as xo,r as Pe,ra as F,rb as Io,rc as vo,s as Ve,sa as mo,sb as jo,sc as Ee,t as Je,ta as M,u as Qe,ua as Re,ud as Ao,v as ee,va as uo,vd as Eo,x as ke,xa as we,ya as ve,z as eo,za as Ae,zb as Po}from"./chunk-TTFDUKUS.mjs";import{b as n,c as Ie,e as b,f as r,g as Ke,i as D,k as c,l as o,o as se,p as je,s as I,u as A,v as w,w as Ye,x as Ze,y as G}from"./chunk-7EANH5PY.mjs";function _n(e,t,a){return async l=>{let d=l.map(y=>`${y.objectApiName} (${y.records})`).join(", ");e.log(`[WARN] ${a}: the user may not delete ${d} in the target: those records stay`);let p=e.infraServices?.confirmRemovalLeavingUndeletable;if(!p)return!0;let m=e.orgManager.getOrg(t);return p({org:ko(m,t),objects:l})}}var Go={code:"NOT_INITIALIZED",message:"Production Guard is not initialized \u2014 infrastructure services missing"};function Nn(){return Object.assign(new Error(Go.message),{code:Go.code})}var Me={blocked:"GUARD_BLOCKED",declined:"GUARD_DECLINED"};function Dn(e){return Object.assign(new Error(`Operation blocked by Production Guard: ${e}`),{code:Me.blocked})}function Fn(e){return e instanceof Error&&e.code===Me.blocked?Me.blocked:void 0}function Pt(e){return e.robustness??lo}function Mn(e){return e.bulkManager??new Do(Pt(e).bulk.maxConcurrentJobs)}var kt={"sync:schedule":"sync:schedule:","sync:pipeline":"sync:pipeline:","seed:pipeline":"seed:pipeline:","offline-replay":"offline-replay-"};function Un(e,t,a){return{id:`${kt[e]}${t}`,type:a,timestamp:Date.now()}}function Ln(e,t,a,l){return{id:e.nextId(),type:a,timestamp:Date.now(),correlationId:t.id,payload:l}}function Bn(e,t,a,l,d={}){let p=t==="error"?null:d.autoDismissMs===void 0?5e3:d.autoDismissMs,m={id:e.nextId(),type:"notification",timestamp:Date.now(),payload:{level:t,title:a,message:l,...p===null?{}:{autoDismissMs:p},...d.actions?{actions:d.actions}:{},...d.code?{code:d.code}:{}}};e.broker.postToWebview(m),e.log(`[TX] notification: ${a}`)}function $n(e,t,a,l){let d={id:e.nextId(),type:"operation:started",timestamp:Date.now(),payload:{operationId:t,module:a,description:l}};e.broker.postToWebview(d)}function Gn(e,t,a,l,d,p){let m={id:e.nextId(),type:"operation:progress",timestamp:Date.now(),payload:{operationId:t,percentage:a,processedRecords:l,totalRecords:d,currentStep:p}};e.broker.postToWebview(m)}function Wn(e,t,a){let l={id:e.nextId(),type:"operation:completed",timestamp:Date.now(),payload:{operationId:t,result:a}};e.broker.postToWebview(l)}var Ot=Symbol("sandforge.uncorrelated");function Wo(e,t,a,l,d,p={}){let m=X(d),y=d instanceof To?d:void 0,j=Ot in l,E=p.code??y?.code??"UNKNOWN";j||vt(e.broker,m,E),e.log(`[ERR] ${t}: ${m}${j?` (uncorrelated: ${String(l.reason)})`:""}`);let O={id:e.nextId(),type:a,timestamp:Date.now(),...j?{}:{correlationId:l.id},payload:{message:m,code:E,retryable:p.retryable??!1,...y?{orgId:y.orgId}:{},...p.extraPayload}};e.broker.postToWebview(O),e.log(`[TX] ${a}: ${m}`)}function qn(e,t){let a={id:e.nextId(),type:t.type,timestamp:Date.now(),payload:t.payload};e.broker.postToWebview(a)}function Hn(e){let t=e?.getSandforgeSetting;if(!(!t||!t("grappe.enabled",!1)))return{enabled:!0,autoActivateThreshold:t("grappe.autoActivateThreshold",1e4),maxWorkers:Xe.maxWorkers,grappeSize:t("grappe.grappeSize",5e3),strategy:"round_robin",backPressure:{enabled:!1,maxQueueDepth:3,highWaterMark:80,lowWaterMark:60,strategy:"pause",monitoringInterval:5e3},checkpointing:!0,isolationLevel:"per_grappe"}}function Kn(e){let t=new Set(e.map(l=>l.batchSize)),[a]=t;return{...e.length>0?{objectName:e.map(l=>l.objectApiName).join(", ")}:{},...t.size===1&&a!==void 0?{batchSize:a}:{}}}function Yn(e,t,a,l,d={}){let p={id:e.nextId(),type:"operation:failed",timestamp:Date.now(),payload:{operationId:t,error:a,retryable:l,...d.extraPayload}};e.broker.postToWebview(p),d.authored!==!0&&Et(e,a,d.context)}var Rt=[/^Operation cancelled by user\b/,/^Operation blocked by Production Guard: /,/^Production Guard is not initialized\b/,/^Duplicate operation: /,/^A backup or rollback operation is already running for org /,/^Object describe not available for '/,/^CRUD_FLS_DENIED: /,/^CRUD\/FLS check failed for /,/^No backup found for operation /,/^Backup \S+ was taken from org /,/^Restore not run: /,/^Pipeline failed$/,/^Pipeline did not start: /,/^Pipeline ran out of time: /,/^Org not found: /,/^No credentials for org /,/^Invalid username format: /];function wt(e){return Rt.some(t=>t.test(e))}var qo=1e4,Ue=new WeakMap;function vt(e,t,a){let l=Ee(t,{code:a});if(!l?.actionKey)return;let d=Ue.get(e)??new Map,p=Date.now();for(let[m,y]of d)p-y>qo&&d.delete(m);d.set(l.code,p),Ue.set(e,d)}function At(e,t){let a=Ue.get(e)?.get(t);return a!==void 0&&Date.now()-a<=qo}function Et(e,t,a={}){if(!(e.broker.panelCount>0)||wt(t))return;let d=Co(t,vo)??"UNKNOWN",p=Ee(t,{code:d});if(p?.actionKey){if(At(e.broker,p.code))return;e.broker.showFixSuggestion({source:"catalogue",code:p.code,actionKey:p.actionKey});return}let m=e.errorResolver;m&&m.resolveError({errorCode:d,message:t},a).then(y=>{e.broker.showFixSuggestion({source:"model",text:Ct(y)})}).catch(y=>{e.log?.(`[ERR] operation:failed resolution: ${X(y)}`)})}function Ct(e){return e.suggestions[0]?.description||e.explanation}import{isAbsolute as Ft}from"node:path";var i=n().min(1).max(128),s=n().regex(/^[A-Za-z][A-Za-z0-9_]*$/,"Invalid Salesforce API name").max(80),Vo=c(s).max(300),u=n().min(1).max(200),re=n().max(2e3).refine(Ce,{message:Te}),Mt=n().refine(_o,{message:"ORDER BY clause must list only field names with optional ASC/DESC and NULLS FIRST/LAST (no LIMIT, OFFSET, FOR UPDATE or subquery)."}),f=100,Jo=1e4,B=o({keepDays:b().int().min(ke.min).max(ke.max).optional(),excluded:c(s).max(f).refine(e=>new Set(e).size===e.length,"An object is left out twice").optional()}).strict(),be={sweepLate:r().optional(),sweepUntied:r().optional()};function Ut(e){return No(e)}function Lt(e,t='turn on "Copy the files of these records"'){return Po(e)?`Sync copies files with the records they hang on, not as an object of their own: "${e}" keeps its content in a file body. Remove it from this configuration and ${t} instead; the sync was not started.`:`Sync does not copy "${e}": no copy writes it \u2014 users and their access, metadata, a record's history, feed or sharing rows, and the records the platform keeps for itself are not data a copy carries. Remove it from this configuration; the sync was not started.`}var Bt=A(ao,{error:e=>e.input==="manual"?"Manual conflict review is not available for a sync run: no run shows its conflicts to anyone before it writes. Pick source wins, target wins, newest wins or merge \u2014 target wins keeps every value the target holds where the two orgs differ. The sync was not started.":`Conflict strategy "${String(e.input)}" is not one a sync run acts on: pick source wins, target wins, newest wins or merge. The sync was not started.`}),$t=ro.extend({objectApiName:s.refine(e=>!Ut(e),{error:e=>Lt(String(e.input))}),externalIdField:Ze(e=>typeof e=="string"&&e.trim()===""?void 0:e,s.optional()),where:re.optional(),orderBy:Mt.optional(),batchSize:b().int().positive().max(Jo).optional()}).strip().refine(e=>e.operation!=="upsert"||(e.externalIdField??"Id").toLowerCase()!=="id",{path:["externalIdField"],error:e=>`An upsert of "${String(e.input.objectApiName)}" needs an External ID field: matching on Id cannot work, because the id belongs to the source org and the target has never issued it. Name an External ID field both orgs share, or set the operation to insert. The sync was not started.`}).superRefine((e,t)=>{let a=Ro([e]);a.length!==0&&t.addIssue({code:G.custom,message:`${wo(a)} The sync was not started.`,params:{unreadablePatterns:a}})});function Ho(e){return Ke({error:()=>`Sync does not run Apex: remove "${e}" from this configuration. The sync was not started so the script cannot be skipped without you knowing.`}).optional()}var Be=io.extend({id:u.optional(),sourceOrgId:i,targetOrgId:i,objects:c($t).min(1).max(f),conflictStrategy:Bt,createdAt:n().max(40).optional(),updatedAt:n().max(40).optional(),preScript:Ho("preScript"),postScript:Ho("postScript"),dryRun:w(!1,{error:()=>'A sync configuration cannot ask for a dry run: remove "dryRun" from it. A run of it writes to the target org; to see what it would write, simulate it from the Sync page. The run was not started, so it cannot write while you believed it was only reporting.'}).optional()}).strip().superRefine((e,t)=>{e.direction==="target_to_source"&&t.addIssue({code:G.custom,path:["direction"],message:'Sync writes source to target only: direction "target_to_source" is not supported. Swap the source and target orgs to copy the other way. The sync was not started, so it cannot write into the org you meant to read from.'}),e.mode!=="full"&&e.mode!=="delta"&&t.addIssue({code:G.custom,path:["mode"],message:`Sync runs a full or a delta sync only: mode "${e.mode}" is not implemented. Set mode to "full" or "delta". The sync was not started, so it cannot replay the whole object set while you believed it was reading changes only.`}),e.mode==="delta"&&e.objects.forEach((a,l)=>{a.operation==="upsert"||a.operation==="update"||t.addIssue({code:G.custom,path:["objects",l,"operation"],message:`A delta sync writes ${a.objectApiName} again for every record it reads twice, and ${a.operation} would ${a.operation==="insert"?"create a second copy":"delete a record already gone"}. Write it by upsert on an External ID, or by update, or run the configuration in full. The sync was not started.`})}),e.propagateDeletes===!0&&(e.mode!=="delta"?t.addIssue({code:G.custom,path:["propagateDeletes"],message:'Deletions are carried by a delta sync only, which knows since when to look for them: set mode to "delta", or turn deletions off. The sync was not started.'}):e.objects.forEach((a,l)=>{if(a.operation!=="upsert"&&a.operation!=="update")return;let d=Fo(a);"refused"in d&&t.addIssue({code:G.custom,path:["objects",l],message:`${d.refused} Turn deletions off, or carry a source field onto the key. The sync was not started.`})}))}),ra=o({suggestedName:n().min(1).max(255).refine(e=>!e.includes("/")&&!e.includes("\\"),"suggestedName must not contain a path"),content:n().max(32*1024*1024),extensions:c(n().regex(/^[A-Za-z0-9]+$/)).max(8).optional()}),ia=o({config:Be,muteAutomation:r().optional(),checkpointFirst:B.optional()}),sa=o({config:Be,checkpointFirst:B.optional()}),ca=o({operationId:u}),la=o({config:Be}),da=o({id:u}),pa=o({orgId:i,targetOrgId:i.optional()}),ma=o({sourceOrgId:i,targetOrgId:i,objectApiName:s}),Qo=A(["source_wins","target_wins","newest_wins","manual","merge"]),Gt=je("kind",[o({kind:w("id")}),o({kind:w("externalId"),field:s}),o({kind:w("syncConfig"),configId:u})]),ua=o({sourceOrgId:i,targetOrgId:i,watchedObjects:c(s).min(1).max(f),apply:c(o({objectApiName:s,match:Gt,applyDeletes:r()})).max(f),conflictStrategy:Qo,flushIntervalMs:b().int().min(50).max(6e4),maxBatchSize:b().int().min(1).max(200),keepContactPoints:r().optional()}).refine(e=>e.apply.every(t=>e.watchedObjects.includes(t.objectApiName)),{message:"Every applied object must be watched.",path:["apply"]}),ga=o({sessionId:n().max(200)}),ba=o({sourceOrgId:i,targetOrgId:i}),ya=o({conflictId:n().min(1).max(500),eventReplayId:b().optional(),resolution:Qo,fieldResolutions:I(n(),o({value:D(),source:A(["source","target","manual"])})).optional()}),fa=o({entryId:u}),ha=o({runId:u}),za=o({realtime:w(!0).optional()}).optional(),Sa=o({sourceOrgId:i,targetOrgId:i,objects:c(s).max(f),configId:u.optional()}),xa=o({runId:u,includeChanged:r().optional(),sweep:r().optional(),again:r().optional(),muteAutomation:r().optional(),...be}),Ia=o({runId:u}),ja=o({runId:u,again:r().optional(),sweptObjects:Vo.optional()}),Pa=o({runId:u}),ka=o({runId:u,includeChanged:r().optional(),sweep:r().optional(),again:r().optional(),muteAutomation:r().optional(),...be}),Oa=o({runId:u}),Ra=o({format:A(["csv","json"]),entryIds:c(u).max(500).optional()}),Wt=o({id:u,name:n().min(1).max(200),configId:u,cron:n().min(1).max(100),timezone:n().min(1).max(100),enabled:r(),maxRetries:b().int().min(0).max(10),notifyOnComplete:r(),notifyOnFailure:r(),createdAt:n().max(40),updatedAt:n().max(40),version:b().int().positive()}).strip(),wa=o({schedule:Wt}),va=o({scheduleId:u,enabled:r()}),Aa=o({scheduleId:u}),qt=eo.extend({objectApiName:s,recordCount:b().int().positive().max(ee),batchSize:b().int().positive().max(Jo).optional()}).loose(),Ht=oo.extend({childObject:s,lookupField:s,parentObject:s}).superRefine((e,t)=>{e.parents.kind==="existing"&&e.parents.where!==void 0&&!Ce(e.parents.where)&&t.addIssue({code:G.custom,path:["parents","where"],message:Te})}),Kt=to.extend({objects:c(qt).min(1).max(f),relations:c(Ht).max(f).optional()}).loose().superRefine(no),Ea=o({orgId:i,template:Kt,muteAutomation:r().optional(),checkpointFirst:B.optional(),fit:o({share:b().gt(0).max(1),withinMB:b().positive().max(1e6).optional(),before:b().int().positive().max(ee*f)}).strict().optional(),locale:n().regex(/^[a-z]{2,3}(?:_[A-Za-z0-9]{2,4}){0,2}$/).optional(),dryRun:r().optional()}),Ca=o({orgId:i}),Ta=o({orgId:i,objects:c(s).min(1).max(f),publishes:r().optional()}).strict(),_a=o({orgId:i,objectApiName:s}),Na=o({id:u}),Da=o({template:I(n(),D())}),Fa=o({description:n().max(1e4)}),Ma=o({}).strict(),Ua=o({orgId:i,pack:oe,seed:Oe.shape.seed,articleBodyField:s.optional()}).strict(),La=o({orgId:i,pack:oe,options:Oe,locale:n().regex(/^[a-z]{2,3}(?:_[A-Za-z0-9]{2,4}){0,2}$/).optional(),muteAutomation:r().optional(),checkpointFirst:B.optional()}).strict(),Ba=o({orgId:i}).strict(),$a=o({pack:oe,overwrite:r().optional()}).strict(),Ga=o({runId:u,choice:fo,overwrite:r().optional()}).strict(),Yt=131072,Zt=o({objectApiName:s,whereClause:re.optional()}).loose(),Wa=o({sourceOrgId:i}),qa=o({sourceOrgId:i,targetOrgId:i,objects:c(Zt).min(1).max(f),upsert:r().optional(),externalIdField:s.optional(),previewId:u.optional(),keepContactPoints:r().optional(),checkpointFirst:B.optional()}).refine(e=>!e.upsert||e.externalIdField!==void 0,{message:"externalIdField is required when upsert is true",path:["externalIdField"]}),Xt=o({csvHeader:n().min(1).max(500),sfFieldApiName:n().max(80),sfFieldType:n().max(40),sfFieldLength:b().int().positive().nullable()}).loose(),Ha=o({orgId:i,objectApiName:s,records:c(I(n(),n().max(Yt))).min(1).max(Je),columnMappings:c(Xt).min(1).max(Qe),externalIdField:s.optional(),checkpointFirst:B.optional()}),Ka=o({orgId:i,objects:c(s).min(1).max(f)}),Ya=o({orgId:i}),Za=o({orgId:i,templateId:n().min(1).max(200).optional()}),Xa=o({orgId:i,operationId:n().min(1).max(200)}),Va=o({orgId:i,operationIds:c(n().min(1).max(200)).min(1).max(1e3).optional()}),W={acceptAutomation:r().optional(),acceptEmails:r().optional(),muteAutomation:r().optional()},Y={fromPage:w(!0).optional()},Ja=o({orgId:i,operationId:u,rewriteAll:r().optional(),includeChanged:r().optional(),...W,...Y}),Qa=o({orgId:i,act:A(["masking","restore","cleanup"]),objects:c(o({objectApiName:s,records:b().int().min(0)})).max(f),erasure:r().optional(),...W,...Y}),$e={objects:c(s).min(1).max(f).optional(),where:re.optional()},Ge=e=>e.where===void 0||e.where.trim()===""||e.objects?.length===1,We={message:"A WHERE clause filters the rows of one object: name exactly one in objects",path:["where"]},er=o({orgId:i,templateId:u,...$e,resumeFrom:u.optional(),snapshot:r().optional(),...W,...Y}).refine(Ge,We).refine(e=>!(e.snapshot===!0&&e.resumeFrom!==void 0),{message:"A resume takes no snapshot: the run it resumes has written over some of its rows",path:["snapshot"]}),or=o({orgId:i,templateId:u,...$e}).refine(Ge,We),tr=o({orgId:i,templateId:u,...$e}).refine(Ge,We),nr=o({name:n().trim().min(1).max(go),rules:c(yo).min(1).max(bo).refine(e=>new Set(e.map(t=>t.fieldPattern.toLowerCase())).size===e.length,"A field has two rules")}),ar=o({templateId:u}),rr=o({orgId:i,objectNames:c(s).min(1).max(f)}),ir=o({orgId:i,objects:c(o({objectApiName:s,duplicateKey:s.optional()})).min(1).max(10).refine(e=>new Set(e.map(t=>t.objectApiName.toLowerCase())).size===e.length,{message:"Each object may be named once per scan"}),staleDays:b().int().min(1).max(3650)}),et=c(s).min(1).max(10).refine(e=>new Set(e.map(t=>t.toLowerCase())).size===e.length,{message:"Each object may be named once per request"}),sr=o({orgId:i,objects:et}),cr=o({orgId:i,objects:et,requestId:Ie().optional(),email:n().trim().refine(Io,"Not an email address").optional(),name:n().refine(jo,"Not a name").optional(),phone:n().refine(xo,"Not a phone number").optional()}).refine(e=>e.email!==void 0||e.name!==void 0||e.phone!==void 0,{message:"A search needs an email address, a name or a phone number"}),Vt=o({orgId:i,requestId:Ie()}),ye=n().regex(/^[A-Za-z0-9]{15}(?:[A-Za-z0-9]{3})?$/,"Not a record Id"),lr=o({runId:u,recordId:ye}).strict(),dr=Vt.extend({mode:A(["anonymize","delete"]),records:c(o({objectApiName:s,ids:c(ye).min(1).max(200)})).min(1).max(10).refine(e=>new Set(e.map(t=>t.objectApiName.toLowerCase())).size===e.length,{message:"Each object may be named once per request"}),dryRun:r(),...W}),Jt=je("kind",[o({kind:w("stale"),days:b().int().min(1).max(3650)}),o({kind:w("orphans"),fieldApiName:s}),o({kind:w("duplicates"),keyField:s})]),ot=o({orgId:i,objectApiName:s,recommendation:Jt}),pr=ot.extend({after:o({skip:b().int().nonnegative().max(1e8),id:ye.optional(),modified:n().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?(?:Z|[+-]\d{2}:?\d{2})$/).optional()}).strict().optional()}),mr=ot.extend({dryRun:r(),...W,...Y}),Le=2e3,tt={mode:A(["objects","org"]),objects:c(s).min(1).max(Le).optional(),excluded:c(s).max(Le).optional(),customSettings:r().optional(),files:r().optional(),managedPackages:r().optional(),unrestorable:r().optional()},Qt=o(tt).strict().refine(e=>e.mode==="objects"==(e.objects!==void 0),{message:"The objects picked are named in objects mode, and only there"}),ur=o({orgId:i,...tt,objects:c(s).max(Le).optional()}).strict().refine(e=>e.mode==="objects"==(e.objects!==void 0),{message:"The objects picked are named in objects mode, and only there"}),gr=o({orgId:i,request:Qt,deleteMode:A(["recycle","hard"]),checkpointFirst:r().optional(),acceptNoUndo:r().optional(),acceptPeopleActive:r().optional(),...W,...Y}),br=o({orgId:i,previewId:u.optional(),resumeRunId:n().regex(/^em-\d{8}-\d{6}-[a-z0-9]{4}$/).optional(),acceptNoUndo:r().optional(),acceptPeopleActive:r().optional(),checkpointFirst:r().optional(),...W,...Y}).refine(e=>e.previewId===void 0!=(e.resumeRunId===void 0),{message:"An emptying acts on a preview, or takes up a run: one of them"}),yr=o({operationId:u}),fr=o({orgId:i,runId:n().regex(/^em-\d{8}-\d{6}-[a-z0-9]{4}$/),...W,...Y}),hr=o({orgId:i}),zr=o({orgId:i}).strict(),Sr=o({alertId:u}),nt=o({sourceOrgId:i,targetOrgId:i}),xr=nt.extend({types:c(n().min(1).max(80)).min(1).max(50),includeManaged:r().optional()}),en=o({componentType:A(So),fullName:n().min(1).max(400).regex(/^[^\u0000-\u001f\u007f]+$/,"A component name holds no control character")}),Ir=nt.extend({components:c(en).min(1).max(500).refine(e=>new Set(e.map(t=>`${t.componentType}:${t.fullName}`)).size===e.length,{message:"Each component may be named once per deployment"}),testLevel:A(ho),runTests:c(n().max(255).regex(zo,"Not an Apex class name")).max(100).optional()}).refine(e=>e.sourceOrgId!==e.targetOrgId,{message:"The source and the target are the same org",path:["targetOrgId"]}).refine(e=>e.testLevel!=="RunSpecifiedTests"||(e.runTests?.length??0)>0,{message:"RunSpecifiedTests names at least one test class",path:["runTests"]}),jr=o({validationId:n().regex(/^0Af[A-Za-z0-9]{12}(?:[A-Za-z0-9]{3})?$/,"Not a deployment id"),targetOrgId:i}).strict(),on=n().regex(/^\d+\.\d+\.\d+$/,"Invalid semver"),ge=n().regex(/^[A-Za-z][A-Za-z0-9_]*\.[A-Za-z][A-Za-z0-9_]*$/,"Expected an Object.field key").max(170),tn=o({name:n().min(1).max(80),label:n().min(1).max(200),filterField:s,valuesSoql:n().min(1).max(4e3)}),nn=o({name:n().min(1).max(80),label:n().min(1).max(200),whereFragment:re}),Ko=se([o({action:w("clear")}),o({action:w("replace"),value:n().max(255)})]),an=o({rootObject:s,axes:c(tn).max(20),edgeCases:c(nn).max(50),budgetMaxRecords:b().int().positive().max(1e5).optional(),candidatesPerCombination:b().int().positive().max(20).optional(),expectedObjects:c(s).max(100).optional(),maxNodes:b().int().min(10).max(500).optional(),excludedObjects:c(s).max(200).optional(),excludedFields:I(s,c(s).max(500)).optional(),sasDir:n().min(1).max(500).optional(),datasetDir:n().min(1).max(500).optional(),rulesFilePath:n().min(1).max(500).optional(),datasetVersion:on.optional(),protectedOrgIds:c(i).max(50).optional(),identityKeys:I(s,c(s).min(1).max(10)).optional(),undeletableObjects:I(s,s).optional(),requiredLookupPlaceholders:I(ge,o({name:n().min(1).max(200),recordTypeDeveloperName:n().min(1).max(97).optional(),targetObjectApiName:s.optional()})).optional(),requiredFieldDefaults:I(ge,D()).optional(),picklistRules:I(ge,Ko).optional(),defaultPicklistRule:Ko.optional(),duplicateErrorPatterns:c(n().min(1).max(200)).max(50).optional(),mockDetection:o({metadataTypeApiName:s,isMockedFieldApiName:s}).optional(),mandatoryLookups:I(s,c(s).min(1).max(50)).optional(),presenceKeys:I(s,s).optional()}),Pr=o({config:an}),kr=o({sourceOrgId:i}),Or=o({fields:c(ge).min(1).max(2e3)}),Rr=o({sourceOrgId:i,author:n().min(1).max(120).optional()}),wr=o({targetOrgId:i,pilot:r().optional(),reload:r().optional(),writeEncrypted:r().optional(),maxRecords:b().int().positive().max(1e6).optional(),muteAutomation:r().optional(),checkpointFirst:B.optional(),sweep:r().optional(),...be,includeChanged:r().optional(),acceptEmails:r().optional(),acceptAutomation:r().optional(),goneFirst:c(ye).max(1e6).optional()}),vr=o({targetOrgId:i}),Ar=o({targetOrgId:i,loadedAt:n().min(1).max(64),includeChanged:r().optional(),sweep:r().optional(),...be,muteAutomation:r().optional()}),Er=o({targetOrgId:i,loadedAt:n().min(1).max(64),reload:r().optional()}),Cr=o({targetOrgId:i,loadedAt:n().min(1).max(64),sweptObjects:Vo.optional(),reload:r().optional()}),Tr=o({targetOrgId:i,loadedAt:n().min(1).max(64),includeChanged:r().optional()}),at=1e3,rt=3650,rn=200,K=c(s).min(1).max(at).refine(e=>new Set(e).size===e.length,"An object is named twice");function it(e){return e.mode==="picked"?e.objects!==void 0:e.objects===void 0}var st=se([w("all"),c(s.refine(e=>e.toLowerCase().endsWith("__c"),"A custom setting's API name ends in __c")).min(1).max(at).refine(e=>new Set(e.map(t=>t.toLowerCase())).size===e.length,"A custom setting is named twice")]),ct={path:["objects"],message:'Name the objects with "picked", and none with "everything"'},_r=o({orgId:i.optional()}).optional(),sn=1e6,lt=b().int().min(1).max(sn),Nr=o({orgId:i,mode:Ae,objects:K.optional(),excluded:K.optional(),customSettings:st.optional(),maxTotal:lt.optional()}).refine(it,ct),Dr=o({orgId:i,name:ve,mode:Ae,objects:K.optional(),excluded:K.optional(),customSettings:st.optional(),maxTotal:lt.optional(),keepDays:b().int().min(0).max(rt),ignoredFields:we.optional()}).refine(it,ct),Fr=o({checkpointId:M,objects:K.optional(),muteAutomation:r().optional(),acceptOutside:r().optional()}),Mr=o({checkpointId:M,previewId:Re,objects:K.optional(),acceptAutomation:r(),muteAutomation:r().optional(),acceptEmails:r().optional(),acceptNoUndo:r(),acceptRecreate:r(),acceptOutside:r(),acceptUnseen:r(),fromPage:w(!0).optional()}),Ur=o({checkpointId:M,previewId:Re,objects:K,acceptOutside:r()}),Lr=o({checkpointId:M}),cn=200,Br=o({token:u,orgId:i,key:n().min(1).max(cn),keepDays:b().int().min(0).max(rt)}),$r=o({checkpointId:M,rewindId:uo,acceptAutomation:r(),muteAutomation:r().optional(),acceptEmails:r().optional(),fromPage:w(!0).optional()}),Gr=o({checkpointIds:c(M).min(1).max(rn).refine(e=>new Set(e).size===e.length,"A checkpoint is named twice")}),Wr=o({checkpointId:M,keep:r()}),qr=o({checkpointId:M,name:ve}),Hr=o({checkpointId:M,fields:we}),ln=500,Kr=o({orgIds:c(i).min(1).max(ln).refine(e=>new Set(e).size===e.length,"An org is named twice").optional()}).strict().optional(),Yr=o({sourceOrgId:i,targetOrgId:i,includeStandardObjects:r()}),Zr=o({sourceOrgId:i,objectApiNames:c(s).min(1).max(Ve)}),Xr=o({sourceOrgId:i,targetOrgId:i,selectedObjects:c(s).max(f),includeStandardObjects:r(),maxDepth:b().int().min(1).max(10).optional(),maxObjects:b().int().min(1).max(500).optional()}),Vr=o({complianceFramework:co,objectFilters:I(n(),re).optional(),overrides:c(o({objectApiName:s,fieldApiName:s,method:se([so,w("skip")])})).max(500).optional()}),Jr=o({grappeThreshold:b().int().nonnegative(),keepContactPoints:r().optional(),muteAutomation:r().optional(),checkpointFirst:B.optional()}),Qr=o({mode:o({share:w(!0).optional(),caps:I(s,b().int().min(1).max(ee)).refine(e=>Object.keys(e).length<=f,"Too many caps").optional(),all:b().int().min(1).max(ee).optional(),withinMB:b().positive().max(1e6).optional()}).strict().refine(e=>e.share===!0||e.caps!==void 0||e.all!==void 0,"Fit by share, by caps, or both"),muteAutomation:r().optional(),checkpointFirst:B.optional()}),ei=o({objectApiName:s}),oi=o({orgId:i.optional(),sourceOrgId:i.optional(),alreadySelected:c(s).max(f).optional()}).loose(),ti=o({orgId:i.optional(),sourceOrgId:i.optional(),objectApiName:s.optional(),alreadySelected:c(s).max(f).optional(),selectedObjects:c(s).max(f).optional(),availableObjects:c(s).max(500).optional()}).loose(),ni=o({sourceOrgId:i,targetOrgId:i.optional(),selectedObjects:c(s).min(1).max(f),parentObjects:c(s).max(f).optional()}).loose(),dn=po.extend({sourceOrgId:i,targetOrgId:i,selectedObjects:c(s).min(1).max(f),parentObjects:c(s).max(f).default([])}).loose(),ai=o({config:dn.optional(),sourceOrgId:i.optional(),targetOrgId:i.optional(),selectedObjects:c(s).min(1).max(f).optional(),parentObjects:c(s).max(f).optional()}).loose(),pn=n().min(1).max(5e4),ri=o({conversationId:u,message:n().max(5e4)}),ii=o({title:n().min(1).max(300)}),si=o({conversationId:u}),ci=o({apiKey:n().min(1).max(500),errorResolution:r().optional()}),li=o({enabled:r().optional(),errorResolution:r().optional()}),di=o({orgId:i,objectName:s,sampleSize:b().int().positive().max(1e4).optional()}),pi=o({orgId:i,prompt:n().trim().min(1).max(2e3).optional(),soql:n().trim().min(1).max(2e4).optional()}).refine(e=>e.prompt===void 0!=(e.soql===void 0),{message:"Send a prompt to draft from or a query to check, not both and not neither"}),mi=o({description:pn,orgIds:c(i).max(50).optional()}),ui=o({requestId:u}),ue=c(n().min(1).max(F.picklistValue)).max(F.picklistValues),Yo={label:n().max(F.agentLabel).optional(),description:n().max(F.agentDescription).optional()},gi=o({text:n().trim().min(1).max(F.text),language:oe.shape.language,casePicklists:o({Status:ue.optional(),Origin:ue.optional(),Priority:ue.optional(),Type:ue.optional()}).optional(),agent:o({topics:c(o({name:n().min(1).max(F.agentName),...Yo,actions:c(o({name:n().min(1).max(F.agentName),...Yo})).max(F.agentActions)})).max(F.agentTopics)}).optional(),draft:mo.optional(),maskOnly:r().optional()}),bi=o({filePath:n().min(1).max(2e3)}),yi=o({name:n().max(200),config:I(n(),D())}),fi=o({operationId:u.optional(),executionId:u.optional(),objectName:n().min(1).max(200).optional()}).loose(),hi=o({policyId:u}),zi=o({policy:I(n(),D())}),Si=o({policyId:u,orgId:i}),xi=o({module:n().min(1).max(50).optional(),orgId:i.optional(),offset:b().int().min(0).max(Pe).optional(),limit:b().int().min(1).max(Pe).optional()}).optional(),Ii=o({operationId:u.optional()}).optional(),mn=A(["syncMappings","forgePlans","pipelines","anonymizationTemplates"]),ji=o({categories:c(mn).min(1).max(50)}),Pi=o({json:n().min(1).max(5e6),overwrite:r()}),ki=o({json:n().min(1).max(5e6)}),Oi=o({orgId:n().max(128),authMethod:n().min(1).max(50),alias:n().max(100).optional(),loginUrl:n().max(500).optional(),username:n().max(300).optional(),password:n().max(500).optional(),securityToken:n().max(100).optional(),clientId:n().max(256).optional(),jwtKeyFile:n().max(4096).optional()}).loose(),dt=n().trim().max(100).regex(/^[\w.-]*$/,"an alias is letters, digits, dots, dashes and underscores").optional(),un=n().trim().min(1,"the username is required").max(80).regex(/^[\w.@+-]+$/,"a username is written like an email address"),pt=n().trim().min(1,"the consumer key is required").max(256).regex(/^[A-Za-z0-9._-]+={0,2}$/,"a consumer key is letters, digits, dots, dashes and underscores"),gn=n().trim().min(1,"the private key file is required").max(4096).regex(/^[^\u0000-\u001f\u007f]+$/,"the private key file path holds a control character").refine(e=>Ft(e),"give the private key file as an absolute path"),Ri=o({alias:dt,loginUrl:n().max(500).optional(),username:un,clientId:pt,jwtKeyFile:gn}).loose(),wi=o({alias:dt,loginUrl:n().max(500).optional(),clientId:pt}).loose(),vi=o({requestId:u}),Ai=o({orgId:i}),Ei=o({orgId:i}),Ci=o({orgId:i}).strict(),Ti=o({orgId:i,alias:n().trim().min(1).max(100),color:n().regex(/^#[0-9A-Fa-f]{6}$/),tags:c(n().trim().min(1).max(50)).max(20),staging:r().optional()}),_i=o({key:n().min(1).max(200),value:D()}),Ni=o({enabled:r()}),Di=o({lng:A(["en","fr","de","es","ja","pt-BR"])}),Fi=o({targetOrgId:i,sourceOrgId:i.optional()}),Mi=o({moduleId:n().min(1).max(64),route:n().min(1).max(64),overlay:r()}),Ui=o({moduleId:n().min(1).max(64)}),bn=80,yn=Ye(e=>Ao(e)||Eo(e)||typeof e=="string"&&e.trim()!==""&&e.length<=bn,{message:"Not a pipeline step type"}),fn=o({pipeline:o({name:n().min(1).max(200),steps:c(o({type:yn,config:I(n(),D()).default({})}).loose()).max(200),variables:c(I(n(),D())).max(200).default([]),triggers:c(I(n(),D())).max(50).default([])}).loose(),variables:I(n(),n().max(2e3)).optional()}),Li=fn.shape.pipeline.extend({id:n().min(1).max(200)}),Bi=o({id:n().max(200),config:I(n(),D())}),$i=o({id:u}),Gi=o({operationId:u,stepId:u,decision:A(["approved","rejected"])}),hn=255,mt={pipelineId:u,stepId:u},Wi=o({pipelineId:u}),qi=o({...mt,typed:n().min(1).max(hn)}),Hi=o(mt),Ki=o({category:n().max(100).optional(),query:n().max(500).optional()}).loose().optional(),Yi=o({templateId:u});function zn(e){return e.issues.slice(0,3).map(t=>`${t.path.join(".")||"(root)"}: ${t.message}`).join("; ")}function Sn(e){let t=e.issues.map(a=>a.code==="custom"?a.params?.unreadablePatterns:void 0);return t.every(a=>a!==void 0)?t.flat():void 0}function Zi(e,t,a,l){let d=e.safeParse(t.payload);if(!d.success){let p=zn(d.error),m=Sn(d.error);return Wo(l,t.type,a,t,new Error(`Invalid payload \u2014 ${p}`),m?{code:Oo,extraPayload:{rules:m}}:{code:"INVALID_PAYLOAD"}),null}return d.data}var xn=5;function fe(e){return e.slice(0,15)}function In(e){let t=e.errors?.[0];if(t===void 0)return"The org gave no reason.";if(typeof t=="string")return t;let a=t.statusCode??"",l=t.message??"";return a&&l?`${a}: ${l}`:a||l||"The org gave no reason."}function ut(e){let t=new Set;for(let a of e){let l=a.Id;typeof l=="string"&&t.add(fe(l))}return t}async function gt(e){let t=[],a=[],l={},d=!1,p=!1,m=e.stampsFor,y=ne(e.org),j=e.org.serverTime?.bind(e.org),E=m&&j?Date.now()+await ae({serverTime:j})-te:Number.NaN;for(let{objectApiName:O,ids:v}of e.plan){let x={objectApiName:O,planned:v.length,undeleted:0,alreadyBack:0,goneForGood:0,refused:0,reasons:[]};t.push(x);let h=_=>{x.reasons.length<xn&&!x.reasons.includes(_)&&x.reasons.push(_)},R=ce(O);for(let _=0;_<v.length;_+=le){let C=v.slice(_,_+le);if(p||e.signal?.aborted){p=!0,x.notReached=(x.notReached??0)+C.length,a.push(...C);continue}let[V]=de(C,le),q,J;try{q=ut((await e.org.queryDeleted(`SELECT Id FROM ${R} WHERE Id IN (${V}) AND IsDeleted = true`)).records),J=ut((await e.org.query(`SELECT Id FROM ${R} WHERE Id IN (${V})`)).records)}catch(P){x.refused+=C.length,h(`The recycle bin could not be read: ${X(P)}`),a.push(...C);continue}let z=C.filter(P=>q.has(fe(P)));for(let P of C)q.has(fe(P))||(J.has(fe(P))?x.alreadyBack++:x.goneForGood++);if(z.length===0)continue;let U;try{d=!0;let P=await e.undelete(z),T=Array.isArray(P)?P:[P];U=z.map((H,Q)=>T[Q]??{success:!1})}catch(P){let T=X(P);U=z.map(()=>({success:!1,errors:[T]}))}let Z=[];U.forEach((P,T)=>{if(P.success===!0){x.undeleted++,m?.(z[T])&&Z.push(z[T]);return}x.refused++,h(In(P)),a.push(z[T])}),Z.length>0&&Number.isFinite(E)&&Object.assign(l,await me(e.org,R,Z,E,y))}}return{objects:t,left:a,wrote:d,cancelled:p,stamps:l}}function bt(e){return e.refused+e.goneForGood+(e.notReached??0)}async function jn(e,t,a,l){let d=new Map(Object.entries(l).map(([m,y])=>[m.slice(0,15),Date.parse(y)])),p=new Set;for(let{objectApiName:m,ids:y}of t){let j=ce(m);for(let E of de(y)){let O;try{O=(await e.query(`SELECT Id, LastModifiedDate FROM ${j} WHERE Id IN (${E})`)).records}catch{continue}for(let v of O){if(typeof v.Id!="string")continue;let x=v.Id.slice(0,15),h=Date.parse(String(v.LastModifiedDate??""));(h<=a||h<=(d.get(x)??Number.NaN))&&p.add(x)}}}return p}function yt(e){let t=Date.parse(e.startedAt),a=Date.parse(e.lastWrittenAt??e.end?.at??"");return Number.isFinite(a)?{runRecordedAt:new Date(a),...Number.isFinite(t)?{runDurationMs:Math.max(0,a-t)}:{}}:{}}function Pn(e){return e.filter(t=>t.deleted+t.alreadyGone>0).map(t=>t.objectApiName)}async function ds(e){let{run:t,includeChanged:a}=e,l=e.again===!0,d=pe(t,l),p=d.reduce((g,S)=>g+S.ids.length,0),m=De(t),y=m.reduce((g,S)=>g+S.ids.length,0),j=Lo(t),E=j.reduce((g,S)=>g+S.ids.length,0),O=[],v=e.backups,x=e.undelete;j.length>0&&!x&&O.push(`The ${E} record(s) the run deleted could not be brought back from the recycle bin here: the next removal offers them again.`),m.length>0&&!v&&O.push(`The values from before the run of ${y} record(s) it wrote over could not be read here: they were not put back, and the next removal offers them again.`);let h,R,_={},C=(e.earlierRuns??[]).map(g=>({runId:g.runId,keys:new Set([...pe(g),...De(g)].flatMap(({ids:S})=>S.map(L=>L.slice(0,15))))})),V=g=>C.some(({keys:S})=>S.has(g.slice(0,15))),q=e.sweep,J=m.length>0&&v||j.length>0&&x||q?async g=>{if(j.length>0&&x){let N=m.length>0&&v?await jn(e.org,m,await Bo(e.org,he(t)),t.removal?.removalStamps??{}):void 0,$=N?Date.now()+await ae(e.org)-te:0;if(R=await gt({org:e.org,plan:j,undelete:x,...C.length>0?{stampsFor:V}:{},...e.signal?{signal:e.signal}:{}}),N&&R.wrote){let k=ne(e.org);for(let{objectApiName:xe,ids:xt}of m){let It=xt.filter(jt=>N.has(jt.slice(0,15)));Object.assign(_,await me(e.org,xe,It,$,k))}}if(R.cancelled||e.signal?.aborted)return R.wrote}if(m.length>0&&v){let N={...t.removal?.removalStamps,..._};h=await $o({org:e.org,plan:m,backups:v,...he(t)!==void 0?{lastWriteAt:he(t)}:{},includeChanged:a,...Object.keys(N).length>0?{stamps:N}:{},...t.unkept?{unkept:t.unkept}:{},...C.length>0?{stampsFor:V}:{},...e.signal?{signal:e.signal}:{}})}let S=(R?.wrote??!1)||(h?.wrote??!1);if(h?.cancelled||e.signal?.aborted)return S;let L=q?await q(g):!1;return S||L}:void 0,z=await _e(e.org,d,{...yt(t),...t.removal?.removalStamps?{removalStamps:t.removal.removalStamps}:{},...t.removal?.removalSpans?{removalSpans:t.removal.removalSpans}:{},includeChanged:a,...J?{sweep:J}:{},...e.afterRemoval?{afterRemoval:e.afterRemoval}:{},...e.automationMade?{automationMade:e.automationMade}:{},...e.runUserId?{runUserId:e.runUserId}:{},...e.onUndeletable?{onUndeletable:e.onUndeletable}:{},...e.beforeFirstWrite?{beforeFirstWrite:e.beforeFirstWrite}:{},signal:e.signal,onProgress:e.onProgress}),U=new Date().toISOString();if(z.stoppedForUndeletable)return{result:{runId:t.runId,status:"cancelled",includeChanged:a,objects:[],finishedAt:U},planned:p,plannedBack:y,plannedUndelete:E,notes:[],stoppedForUndeletable:!0};let Z=l?void 0:t.removal?.undo?.removedAt,P={runId:t.runId,status:Rn(wn(Mo(z.objects,z.cancelled),z.objects,h),z.objects,h,R),includeChanged:a,objects:z.objects,finishedAt:U,...Z?{leftBy:Z}:{},...h&&h.objects.length>0?{restored:h.objects}:{},...R&&R.objects.length>0?{undeleted:R.objects}:{}},T=Uo(P,p,t.removal?.undo,l),H=new Set(z.gone),Q=H.size>0||l&&T?d.flatMap(({ids:g})=>g.filter(S=>!H.has(S))):void 0,qe={..._,...z.stamps},He=Object.keys(qe).length>0,ht=h?.objects.some(g=>g.restored+(g.restoredWithout??0)>0)===!0,zt=R!==void 0&&!R.cancelled;if(T||He||z.span||Q||h||R)try{await e.store.updateRemoval(t.runId,g=>({...g,...T?{undo:T}:{},...He?{removalStamps:{...g.removalStamps,...qe}}:{},...z.span?{removalSpans:[...g.removalSpans??[],z.span]}:{},...Q?{removalLeft:Q}:{},...h?{restoreLeft:h.left}:{},...ht?{restoredAt:U}:{},...R?{undeleteLeft:R.left}:{},...zt?{undeletedAt:U}:{}}))}catch(g){O.push(`What this removal did could not be kept (${g instanceof Error?g.message:String(g)}): the next removal of the run may set out to take records already gone.`)}let St=Object.keys(h?.stamps??{}).length>0?await kn(e.org,t,e.earlierRuns??[]):new Map,ze=[];for(let{runId:g,keys:S}of C){let L=St.get(g),N=Object.fromEntries(Object.entries({...R?.stamps,...h?.stamps}).filter(([k])=>S.has(k.slice(0,15))&&!L?.has(k.slice(0,15)))),$=Object.keys(N).length;if($!==0)try{await e.store.updateRemoval(g,k=>({...k,removalStamps:{...k.removalStamps,...N},...z.span?{removalSpans:[...k.removalSpans??[],z.span]}:{}})),ze.push({runId:g,records:$})}catch(k){O.push(`What this removal gave back of ${$} record(s) the run ${g} wrote too could not be kept on it (${k instanceof Error?k.message:String(k)}): its removal reads them as changed since it.`)}}let ie=e.configs;if(ie&&H.size>0&&ie.isSaved(t.configId)){let g={sourceOrgId:t.sourceOrgId,targetOrgId:Fe(t)};try{let S=d.filter(k=>Ne.includes(k.objectApiName)).flatMap(({ids:k})=>k.filter(xe=>H.has(xe))),L=ie.forgetFiles(t.configId,g,S),N=Pn(z.objects).filter(k=>!Ne.includes(k)),$=ie.markRemoved(t.configId,g,[...new Set([...N,...L.map(k=>k.objectApiName)])],U);P={...P,...$.length>0?{readWhole:$}:{},...L.length>0?{filesForgotten:L.length}:{}}}catch(S){O.push(`The configuration could not be told what this removal took (${S instanceof Error?S.message:String(S)}): run it full next time.`)}}let Se;if(e.links&&H.size>0)try{Se=await e.links.forget(t.configId,{sourceOrgId:t.sourceOrgId,targetOrgId:Fe(t)},[...H])}catch(g){O.push(`Which records of the target this removal took could not be forgotten (${g instanceof Error?g.message:String(g)}): a later run of the configuration may point a lookup at one of them.`)}return{result:P,planned:p,plannedBack:y,plannedUndelete:E,notes:O,...Se?{linksForgotten:Se}:{},...ze.length>0?{earlierStamped:ze}:{}}}async function ps(e){let{run:t}=e,a=pe(t);return{outcome:await _e(e.org,a,{...yt(t),...t.removal?.removalStamps?{removalStamps:t.removal.removalStamps}:{},...t.removal?.removalSpans?{removalSpans:t.removal.removalSpans}:{},includeChanged:e.includeChanged,...e.runUserId?{runUserId:e.runUserId}:{},previewOnly:!0,...e.signal?{signal:e.signal}:{}}),planned:a.reduce((d,p)=>d+p.ids.length,0)}}async function kn(e,t,a){let l=new Map,d=Object.entries(t.heldBefore??{});if(d.length===0||a.length===0)return l;let p=await ne(e)(),m=await ae(e);for(let y of a){let j=Date.parse(he(y)??""),E=Number.isFinite(j)?j+m+te:Number.NEGATIVE_INFINITY,O=new Set;for(let[v,{at:x,by:h}]of d)Date.parse(x)>E&&(p!==void 0&&h!==void 0&&h.slice(0,15)===p||O.add(v));O.size>0&&l.set(y.runId,O)}return l}function he(e){return e.lastWriteAt??e.lastWrittenAt??e.end?.at}function On(e){return e.keptChanged+e.refused+e.notKept+(e.notReached??0)+(e.restoredWithout??0)}function Rn(e,t,a,l){if(!l||e==="cancelled")return e;if(l.cancelled)return"cancelled";let d=l.objects.some(m=>bt(m)>0);if(e==="success"&&!d)return"success";let p=t.some(m=>m.deleted>0)||(a?.objects??[]).some(m=>m.restored>0)||l.objects.some(m=>m.undeleted>0);return e==="partial"||p?"partial":"failure"}function wn(e,t,a){if(!a||e==="cancelled")return e;if(a.cancelled)return"cancelled";let l=a.objects.some(p=>On(p)>0);return e==="success"&&!l?"success":t.some(p=>p.deleted>0)||a.objects.some(p=>p.restored+(p.restoredWithout??0)>0)?"partial":"failure"}function us(e){let t=e?.getSandforgeSetting?.("backup.maxAgeDays",30);return typeof t=="number"&&Number.isFinite(t)&&t>0?t:0}function gs(e,t,a){let l=[],d=0,p=Number.POSITIVE_INFINITY;for(let m of e){let y=t(m.backup);if(!y){d+=m.ids.length;continue}l.push(m);let j=Date.parse(y.timestamp??"");a>0&&Number.isFinite(j)&&(p=Math.min(p,j+a*864e5))}return{kept:l,notKept:d,...Number.isFinite(p)?{keptUntil:new Date(p).toISOString()}:{}}}async function ys(e,t){let a=e.check(t);if(!a.allowed)return{check:a,decision:"refused"};if(!await e.confirmIfNeeded(a,t.orgTier))return{check:a,decision:"declined"};let d=a.requiresConfirmation&&e.canAskForConfirmation===!0;return{check:a,decision:d?"confirmed":"allowed"}}var ft={allowed:0,confirmed:1,declined:2,refused:3};function fs(e,t){return e===void 0||ft[t]>ft[e]?t:e}export{_n as a,Go as b,Nn as c,Me as d,Dn as e,Fn as f,Pt as g,Mn as h,Un as i,Ln as j,Bn as k,$n as l,Gn as m,Wn as n,Wo as o,qn as p,Hn as q,Kn as r,Yn as s,i as t,s as u,Vo as v,B as w,Ut as x,Lt as y,Be as z,ra as A,ia as B,sa as C,ca as D,la as E,da as F,pa as G,ma as H,ua as I,ga as J,ba as K,ya as L,fa as M,ha as N,za as O,Sa as P,xa as Q,Ia as R,ja as S,Pa as T,ka as U,Oa as V,Ra as W,wa as X,va as Y,Aa as Z,Kt as _,Ea as $,Ca as aa,Ta as ba,_a as ca,Na as da,Da as ea,Fa as fa,Ma as ga,Ua as ha,La as ia,Ba as ja,$a as ka,Ga as la,Wa as ma,qa as na,Ha as oa,Ka as pa,Ya as qa,Za as ra,Xa as sa,Va as ta,Ja as ua,Qa as va,er as wa,or as xa,tr as ya,nr as za,ar as Aa,rr as Ba,ir as Ca,sr as Da,cr as Ea,Vt as Fa,lr as Ga,dr as Ha,pr as Ia,mr as Ja,ur as Ka,gr as La,br as Ma,yr as Na,fr as Oa,hr as Pa,zr as Qa,Sr as Ra,nt as Sa,xr as Ta,Ir as Ua,jr as Va,an as Wa,Pr as Xa,kr as Ya,Or as Za,Rr as _a,wr as $a,vr as ab,Ar as bb,Er as cb,Cr as db,Tr as eb,_r as fb,Nr as gb,Dr as hb,Fr as ib,Mr as jb,Ur as kb,Lr as lb,Br as mb,$r as nb,Gr as ob,Wr as pb,qr as qb,Hr as rb,Kr as sb,Yr as tb,Zr as ub,Xr as vb,Vr as wb,Jr as xb,Qr as yb,ei as zb,oi as Ab,ti as Bb,ni as Cb,ai as Db,ri as Eb,ii as Fb,si as Gb,ci as Hb,li as Ib,di as Jb,pi as Kb,mi as Lb,ui as Mb,gi as Nb,bi as Ob,yi as Pb,fi as Qb,hi as Rb,zi as Sb,Si as Tb,xi as Ub,Ii as Vb,ji as Wb,Pi as Xb,ki as Yb,Oi as Zb,Ri as _b,wi as $b,vi as ac,Ai as bc,Ei as cc,Ci as dc,Ti as ec,_i as fc,Ni as gc,Di as hc,Fi as ic,fn as jc,Li as kc,Bi as lc,$i as mc,Gi as nc,Wi as oc,qi as pc,Hi as qc,Ki as rc,Yi as sc,zn as tc,Zi as uc,gt as vc,ds as wc,ps as xc,he as yc,Rn as zc,wn as Ac,ys as Bc,fs as Cc,us as Dc,gs as Ec};
|