sandforge 0.0.0-stage → 1.80.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.
Files changed (221) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +54 -2
  3. package/THIRD-PARTY-NOTICES.md +1624 -0
  4. package/bin/sandforge-autopilot.mjs +12 -0
  5. package/bin/sandforge-backup.mjs +12 -0
  6. package/bin/sandforge-checkpoint.mjs +12 -0
  7. package/bin/sandforge-cleanup.mjs +12 -0
  8. package/bin/sandforge-clone.mjs +12 -0
  9. package/bin/sandforge-compare.mjs +12 -0
  10. package/bin/sandforge-dataops.mjs +12 -0
  11. package/bin/sandforge-empty.mjs +12 -0
  12. package/bin/sandforge-env.mjs +12 -0
  13. package/bin/sandforge-frozen.mjs +12 -0
  14. package/bin/sandforge-mcp.mjs +12 -0
  15. package/bin/sandforge-monitor.mjs +12 -0
  16. package/bin/sandforge-seed.mjs +12 -0
  17. package/bin/sandforge-sync.mjs +12 -0
  18. package/bin/sandforge.mjs +12 -0
  19. package/lib/catalogue.en.json +1 -0
  20. package/lib/chunk-2BA2XKAY.mjs +7 -0
  21. package/lib/chunk-2CNCDM56.mjs +7 -0
  22. package/lib/chunk-2GTBABKU.mjs +7 -0
  23. package/lib/chunk-2NBYT7GR.mjs +7 -0
  24. package/lib/chunk-2UZPIMUC.mjs +7 -0
  25. package/lib/chunk-2YIV2OB2.mjs +7 -0
  26. package/lib/chunk-3F6Q5E7I.mjs +14 -0
  27. package/lib/chunk-3RZQZHEB.mjs +7 -0
  28. package/lib/chunk-3TJON4F3.mjs +7 -0
  29. package/lib/chunk-4HW535YJ.mjs +7 -0
  30. package/lib/chunk-4TLYUZD5.mjs +7 -0
  31. package/lib/chunk-4VS2V6WU.mjs +25 -0
  32. package/lib/chunk-5K5VLULK.mjs +7 -0
  33. package/lib/chunk-5LFSFYFJ.mjs +7 -0
  34. package/lib/chunk-5P4PHJRL.mjs +9 -0
  35. package/lib/chunk-5TC3QB4U.mjs +10 -0
  36. package/lib/chunk-66NMFCWX.mjs +7 -0
  37. package/lib/chunk-6XYKJSGX.mjs +7 -0
  38. package/lib/chunk-74Q6DORA.mjs +7 -0
  39. package/lib/chunk-7ABODJ4G.mjs +7 -0
  40. package/lib/chunk-7EANH5PY.mjs +68 -0
  41. package/lib/chunk-7EGQP6S4.mjs +7 -0
  42. package/lib/chunk-7F54PZUS.mjs +7 -0
  43. package/lib/chunk-7FFGJWHN.mjs +7 -0
  44. package/lib/chunk-7YDNUBO5.mjs +7 -0
  45. package/lib/chunk-A527W53V.mjs +7 -0
  46. package/lib/chunk-ADOAS63R.mjs +7 -0
  47. package/lib/chunk-AEKONPF4.mjs +7 -0
  48. package/lib/chunk-AV5SWEHP.mjs +9 -0
  49. package/lib/chunk-B5QQJ4SI.mjs +7 -0
  50. package/lib/chunk-BGUEWRK2.mjs +7 -0
  51. package/lib/chunk-BKDV4ENO.mjs +7 -0
  52. package/lib/chunk-BOGNK4LV.mjs +7 -0
  53. package/lib/chunk-BTWDMNN3.mjs +7 -0
  54. package/lib/chunk-BV6VTP3J.mjs +7 -0
  55. package/lib/chunk-BXU6WFMH.mjs +7 -0
  56. package/lib/chunk-BY2HJFFG.mjs +7 -0
  57. package/lib/chunk-BZ24IAP5.mjs +7 -0
  58. package/lib/chunk-CA5NAXSU.mjs +7 -0
  59. package/lib/chunk-CE6ZDGBB.mjs +7 -0
  60. package/lib/chunk-CEX3NEZL.mjs +7 -0
  61. package/lib/chunk-CHCHAE4B.mjs +7 -0
  62. package/lib/chunk-CHYDMRSV.mjs +7 -0
  63. package/lib/chunk-CION3VMZ.mjs +7 -0
  64. package/lib/chunk-COFG7Q6R.mjs +7 -0
  65. package/lib/chunk-CSBS5U5I.mjs +7 -0
  66. package/lib/chunk-CU2INBND.mjs +7 -0
  67. package/lib/chunk-DB7RBE5D.mjs +7 -0
  68. package/lib/chunk-DBB3EMIN.mjs +7 -0
  69. package/lib/chunk-DBFJB2B6.mjs +7 -0
  70. package/lib/chunk-DYFALGRT.mjs +7 -0
  71. package/lib/chunk-E5AHXLS6.mjs +7 -0
  72. package/lib/chunk-E5ZB3LU5.mjs +7 -0
  73. package/lib/chunk-EADHKH3A.mjs +7 -0
  74. package/lib/chunk-EFR2Y7E4.mjs +7 -0
  75. package/lib/chunk-EHQ3FX6X.mjs +7 -0
  76. package/lib/chunk-ELFXJHU7.mjs +7 -0
  77. package/lib/chunk-EMNC6YI4.mjs +7 -0
  78. package/lib/chunk-EQNW3UC2.mjs +7 -0
  79. package/lib/chunk-F2424IKX.mjs +7 -0
  80. package/lib/chunk-F43REJDZ.mjs +10 -0
  81. package/lib/chunk-F6GUDTOB.mjs +7 -0
  82. package/lib/chunk-FGRG7ANU.mjs +7 -0
  83. package/lib/chunk-FKG7Q3WH.mjs +7 -0
  84. package/lib/chunk-FPKYYFM7.mjs +7 -0
  85. package/lib/chunk-FQGHL7GR.mjs +259 -0
  86. package/lib/chunk-FXXLX4O6.mjs +7 -0
  87. package/lib/chunk-G35N4P7D.mjs +7 -0
  88. package/lib/chunk-GCOB7K5N.mjs +7 -0
  89. package/lib/chunk-GGD7ON3M.mjs +7 -0
  90. package/lib/chunk-GMY5427L.mjs +7 -0
  91. package/lib/chunk-GSG7WZHM.mjs +7 -0
  92. package/lib/chunk-GSKCGQIP.mjs +7 -0
  93. package/lib/chunk-HEKAZJRH.mjs +7 -0
  94. package/lib/chunk-HF6LAK3G.mjs +7 -0
  95. package/lib/chunk-HLWMJF6Y.mjs +7 -0
  96. package/lib/chunk-HOJYWTP7.mjs +20 -0
  97. package/lib/chunk-HS4YRX4J.mjs +7 -0
  98. package/lib/chunk-HXS7ORUF.mjs +11 -0
  99. package/lib/chunk-I7O6C2B5.mjs +8 -0
  100. package/lib/chunk-IC2C2GOF.mjs +8 -0
  101. package/lib/chunk-IFETCRWE.mjs +10 -0
  102. package/lib/chunk-IG2MTQRP.mjs +8 -0
  103. package/lib/chunk-IGYH7GMA.mjs +7 -0
  104. package/lib/chunk-INIQ23K6.mjs +7 -0
  105. package/lib/chunk-INIT2UKJ.mjs +7 -0
  106. package/lib/chunk-IOIWJ3DJ.mjs +7 -0
  107. package/lib/chunk-IQXHJEYB.mjs +7 -0
  108. package/lib/chunk-IWDREM66.mjs +7 -0
  109. package/lib/chunk-IZQZ6ZUF.mjs +7 -0
  110. package/lib/chunk-J525F5KI.mjs +7 -0
  111. package/lib/chunk-JEERQRLW.mjs +7 -0
  112. package/lib/chunk-JPUR2CFX.mjs +10 -0
  113. package/lib/chunk-JWTSEDIQ.mjs +7 -0
  114. package/lib/chunk-K2FBZIXY.mjs +7 -0
  115. package/lib/chunk-K327QKMD.mjs +7 -0
  116. package/lib/chunk-KBJ5VERV.mjs +7 -0
  117. package/lib/chunk-KDGMAGQR.mjs +7 -0
  118. package/lib/chunk-KRCA6IPH.mjs +8 -0
  119. package/lib/chunk-KYEDBS54.mjs +7 -0
  120. package/lib/chunk-L5FGY6YA.mjs +7 -0
  121. package/lib/chunk-L77FJZEP.mjs +10 -0
  122. package/lib/chunk-LKQ5RKIV.mjs +9 -0
  123. package/lib/chunk-LPBMBW3O.mjs +13 -0
  124. package/lib/chunk-LWW4U276.mjs +7 -0
  125. package/lib/chunk-M3ROUWDX.mjs +7 -0
  126. package/lib/chunk-M6P5ZZLE.mjs +7 -0
  127. package/lib/chunk-MFG4MUIO.mjs +9 -0
  128. package/lib/chunk-MHMH6MTP.mjs +7 -0
  129. package/lib/chunk-MILU7WFN.mjs +7 -0
  130. package/lib/chunk-MJU2PGZQ.mjs +15 -0
  131. package/lib/chunk-MJVTDA5Q.mjs +7 -0
  132. package/lib/chunk-MS4FJDFD.mjs +101 -0
  133. package/lib/chunk-MTMH6H2A.mjs +8 -0
  134. package/lib/chunk-MYW5QNGI.mjs +7 -0
  135. package/lib/chunk-N652NMZ4.mjs +441 -0
  136. package/lib/chunk-NTFIRZP6.mjs +7 -0
  137. package/lib/chunk-NTOVCTRS.mjs +7 -0
  138. package/lib/chunk-NZC67CGR.mjs +9 -0
  139. package/lib/chunk-O2HDYYUV.mjs +8 -0
  140. package/lib/chunk-OAZRPP4I.mjs +7 -0
  141. package/lib/chunk-OHWNPXWW.mjs +7 -0
  142. package/lib/chunk-OLSGVAIL.mjs +341 -0
  143. package/lib/chunk-OO6CLPEH.mjs +7 -0
  144. package/lib/chunk-OPXCV2KL.mjs +7 -0
  145. package/lib/chunk-P33PSCXK.mjs +7 -0
  146. package/lib/chunk-PJ5I73CK.mjs +7 -0
  147. package/lib/chunk-PTTHSSQO.mjs +7 -0
  148. package/lib/chunk-PZPJKATS.mjs +19 -0
  149. package/lib/chunk-Q3DM32KF.mjs +11 -0
  150. package/lib/chunk-QR3WELJQ.mjs +7 -0
  151. package/lib/chunk-QROPNEGY.mjs +14 -0
  152. package/lib/chunk-QSRAEUGZ.mjs +7 -0
  153. package/lib/chunk-QWT2C74M.mjs +7 -0
  154. package/lib/chunk-R3X3LV64.mjs +14 -0
  155. package/lib/chunk-RMBPOTD7.mjs +7 -0
  156. package/lib/chunk-RPI7LRTW.mjs +7 -0
  157. package/lib/chunk-RSWDYIHY.mjs +37 -0
  158. package/lib/chunk-SAR5622P.mjs +7 -0
  159. package/lib/chunk-SCKUIE3R.mjs +7 -0
  160. package/lib/chunk-SE4QEZUG.mjs +7 -0
  161. package/lib/chunk-SIHORWVK.mjs +7 -0
  162. package/lib/chunk-SOGQW4IG.mjs +7 -0
  163. package/lib/chunk-SOU4FRYN.mjs +7 -0
  164. package/lib/chunk-SRPWW4A2.mjs +10 -0
  165. package/lib/chunk-SU65Z2BA.mjs +7 -0
  166. package/lib/chunk-T62WNR54.mjs +7 -0
  167. package/lib/chunk-T63U4OZJ.mjs +7 -0
  168. package/lib/chunk-TLH7AD35.mjs +7 -0
  169. package/lib/chunk-TSLJUSLW.mjs +13 -0
  170. package/lib/chunk-TTFDUKUS.mjs +47 -0
  171. package/lib/chunk-TTKXMDBN.mjs +10 -0
  172. package/lib/chunk-TUACWKIH.mjs +7 -0
  173. package/lib/chunk-TW3N6W5Z.mjs +7 -0
  174. package/lib/chunk-TYYOBZMU.mjs +10 -0
  175. package/lib/chunk-TZE3Y7IQ.mjs +7 -0
  176. package/lib/chunk-UCD54V2M.mjs +7 -0
  177. package/lib/chunk-UNDIBZWG.mjs +7 -0
  178. package/lib/chunk-UNJA4J37.mjs +11 -0
  179. package/lib/chunk-VE6XKGGD.mjs +7 -0
  180. package/lib/chunk-VGW4MXXZ.mjs +7 -0
  181. package/lib/chunk-VS7ZXUII.mjs +824 -0
  182. package/lib/chunk-VXQLDM4R.mjs +7 -0
  183. package/lib/chunk-VYXMVJL5.mjs +7 -0
  184. package/lib/chunk-W622GUAW.mjs +8 -0
  185. package/lib/chunk-W7U5E5ZL.mjs +9 -0
  186. package/lib/chunk-WA7EYLAQ.mjs +7 -0
  187. package/lib/chunk-WIO4XO4F.mjs +7 -0
  188. package/lib/chunk-WR2GIKWE.mjs +7 -0
  189. package/lib/chunk-WR4Q363I.mjs +11 -0
  190. package/lib/chunk-WU3GLFZO.mjs +7 -0
  191. package/lib/chunk-WXAQ7FK3.mjs +115 -0
  192. package/lib/chunk-X5JYBPXP.mjs +7 -0
  193. package/lib/chunk-XAMBCQPU.mjs +7 -0
  194. package/lib/chunk-XCA5AONB.mjs +7 -0
  195. package/lib/chunk-XLXIPIEW.mjs +9 -0
  196. package/lib/chunk-XUWL6ZPC.mjs +7 -0
  197. package/lib/chunk-YAZO75G2.mjs +8 -0
  198. package/lib/chunk-YKKRIEH4.mjs +7 -0
  199. package/lib/chunk-YRQGKDHM.mjs +7 -0
  200. package/lib/chunk-YS4G22C2.mjs +7 -0
  201. package/lib/chunk-YYZL7UGV.mjs +7 -0
  202. package/lib/chunk-ZHJP7L3K.mjs +7 -0
  203. package/lib/chunk-ZM6OJGIG.mjs +7 -0
  204. package/lib/chunk-ZUTYVST5.mjs +7 -0
  205. package/lib/chunk-ZVAED4QV.mjs +7 -0
  206. package/lib/sandforge-autopilot.mjs +162 -0
  207. package/lib/sandforge-backup.mjs +103 -0
  208. package/lib/sandforge-checkpoint.mjs +354 -0
  209. package/lib/sandforge-cleanup.mjs +60 -0
  210. package/lib/sandforge-clone.mjs +7 -0
  211. package/lib/sandforge-compare.mjs +55 -0
  212. package/lib/sandforge-dataops.mjs +7 -0
  213. package/lib/sandforge-empty.mjs +140 -0
  214. package/lib/sandforge-env.mjs +355 -0
  215. package/lib/sandforge-frozen.mjs +272 -0
  216. package/lib/sandforge-mcp.mjs +40 -0
  217. package/lib/sandforge-monitor.mjs +43 -0
  218. package/lib/sandforge-seed.mjs +7 -0
  219. package/lib/sandforge-sync.mjs +7 -0
  220. package/lib/sandforge.mjs +28 -0
  221. package/package.json +52 -4
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ const [major, minor] = process.versions.node.split('.').map(Number);
3
+ if (major < 20 || (major === 20 && minor < 19)) {
4
+ process.stderr.write(
5
+ 'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
6
+ );
7
+ process.exit(1);
8
+ }
9
+ const { fileURLToPath } = await import('node:url');
10
+ const entry = new URL('../lib/sandforge-autopilot.mjs', import.meta.url);
11
+ process.argv[1] = fileURLToPath(entry);
12
+ await import(entry.href);
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ const [major, minor] = process.versions.node.split('.').map(Number);
3
+ if (major < 20 || (major === 20 && minor < 19)) {
4
+ process.stderr.write(
5
+ 'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
6
+ );
7
+ process.exit(1);
8
+ }
9
+ const { fileURLToPath } = await import('node:url');
10
+ const entry = new URL('../lib/sandforge-backup.mjs', import.meta.url);
11
+ process.argv[1] = fileURLToPath(entry);
12
+ await import(entry.href);
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ const [major, minor] = process.versions.node.split('.').map(Number);
3
+ if (major < 20 || (major === 20 && minor < 19)) {
4
+ process.stderr.write(
5
+ 'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
6
+ );
7
+ process.exit(1);
8
+ }
9
+ const { fileURLToPath } = await import('node:url');
10
+ const entry = new URL('../lib/sandforge-checkpoint.mjs', import.meta.url);
11
+ process.argv[1] = fileURLToPath(entry);
12
+ await import(entry.href);
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ const [major, minor] = process.versions.node.split('.').map(Number);
3
+ if (major < 20 || (major === 20 && minor < 19)) {
4
+ process.stderr.write(
5
+ 'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
6
+ );
7
+ process.exit(1);
8
+ }
9
+ const { fileURLToPath } = await import('node:url');
10
+ const entry = new URL('../lib/sandforge-cleanup.mjs', import.meta.url);
11
+ process.argv[1] = fileURLToPath(entry);
12
+ await import(entry.href);
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ const [major, minor] = process.versions.node.split('.').map(Number);
3
+ if (major < 20 || (major === 20 && minor < 19)) {
4
+ process.stderr.write(
5
+ 'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
6
+ );
7
+ process.exit(1);
8
+ }
9
+ const { fileURLToPath } = await import('node:url');
10
+ const entry = new URL('../lib/sandforge-clone.mjs', import.meta.url);
11
+ process.argv[1] = fileURLToPath(entry);
12
+ await import(entry.href);
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ const [major, minor] = process.versions.node.split('.').map(Number);
3
+ if (major < 20 || (major === 20 && minor < 19)) {
4
+ process.stderr.write(
5
+ 'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
6
+ );
7
+ process.exit(1);
8
+ }
9
+ const { fileURLToPath } = await import('node:url');
10
+ const entry = new URL('../lib/sandforge-compare.mjs', import.meta.url);
11
+ process.argv[1] = fileURLToPath(entry);
12
+ await import(entry.href);
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ const [major, minor] = process.versions.node.split('.').map(Number);
3
+ if (major < 20 || (major === 20 && minor < 19)) {
4
+ process.stderr.write(
5
+ 'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
6
+ );
7
+ process.exit(1);
8
+ }
9
+ const { fileURLToPath } = await import('node:url');
10
+ const entry = new URL('../lib/sandforge-dataops.mjs', import.meta.url);
11
+ process.argv[1] = fileURLToPath(entry);
12
+ await import(entry.href);
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ const [major, minor] = process.versions.node.split('.').map(Number);
3
+ if (major < 20 || (major === 20 && minor < 19)) {
4
+ process.stderr.write(
5
+ 'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
6
+ );
7
+ process.exit(1);
8
+ }
9
+ const { fileURLToPath } = await import('node:url');
10
+ const entry = new URL('../lib/sandforge-empty.mjs', import.meta.url);
11
+ process.argv[1] = fileURLToPath(entry);
12
+ await import(entry.href);
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ const [major, minor] = process.versions.node.split('.').map(Number);
3
+ if (major < 20 || (major === 20 && minor < 19)) {
4
+ process.stderr.write(
5
+ 'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
6
+ );
7
+ process.exit(1);
8
+ }
9
+ const { fileURLToPath } = await import('node:url');
10
+ const entry = new URL('../lib/sandforge-env.mjs', import.meta.url);
11
+ process.argv[1] = fileURLToPath(entry);
12
+ await import(entry.href);
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ const [major, minor] = process.versions.node.split('.').map(Number);
3
+ if (major < 20 || (major === 20 && minor < 19)) {
4
+ process.stderr.write(
5
+ 'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
6
+ );
7
+ process.exit(1);
8
+ }
9
+ const { fileURLToPath } = await import('node:url');
10
+ const entry = new URL('../lib/sandforge-frozen.mjs', import.meta.url);
11
+ process.argv[1] = fileURLToPath(entry);
12
+ await import(entry.href);
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ const [major, minor] = process.versions.node.split('.').map(Number);
3
+ if (major < 20 || (major === 20 && minor < 19)) {
4
+ process.stderr.write(
5
+ 'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
6
+ );
7
+ process.exit(1);
8
+ }
9
+ const { fileURLToPath } = await import('node:url');
10
+ const entry = new URL('../lib/sandforge-mcp.mjs', import.meta.url);
11
+ process.argv[1] = fileURLToPath(entry);
12
+ await import(entry.href);
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ const [major, minor] = process.versions.node.split('.').map(Number);
3
+ if (major < 20 || (major === 20 && minor < 19)) {
4
+ process.stderr.write(
5
+ 'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
6
+ );
7
+ process.exit(1);
8
+ }
9
+ const { fileURLToPath } = await import('node:url');
10
+ const entry = new URL('../lib/sandforge-monitor.mjs', import.meta.url);
11
+ process.argv[1] = fileURLToPath(entry);
12
+ await import(entry.href);
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ const [major, minor] = process.versions.node.split('.').map(Number);
3
+ if (major < 20 || (major === 20 && minor < 19)) {
4
+ process.stderr.write(
5
+ 'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
6
+ );
7
+ process.exit(1);
8
+ }
9
+ const { fileURLToPath } = await import('node:url');
10
+ const entry = new URL('../lib/sandforge-seed.mjs', import.meta.url);
11
+ process.argv[1] = fileURLToPath(entry);
12
+ await import(entry.href);
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ const [major, minor] = process.versions.node.split('.').map(Number);
3
+ if (major < 20 || (major === 20 && minor < 19)) {
4
+ process.stderr.write(
5
+ 'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
6
+ );
7
+ process.exit(1);
8
+ }
9
+ const { fileURLToPath } = await import('node:url');
10
+ const entry = new URL('../lib/sandforge-sync.mjs', import.meta.url);
11
+ process.argv[1] = fileURLToPath(entry);
12
+ await import(entry.href);
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ const [major, minor] = process.versions.node.split('.').map(Number);
3
+ if (major < 20 || (major === 20 && minor < 19)) {
4
+ process.stderr.write(
5
+ 'sandforge needs Node.js 20.19 or later, and this is ' + process.versions.node + '. Nothing was run.\n',
6
+ );
7
+ process.exit(1);
8
+ }
9
+ const { fileURLToPath } = await import('node:url');
10
+ const entry = new URL('../lib/sandforge.mjs', import.meta.url);
11
+ process.argv[1] = fileURLToPath(entry);
12
+ await import(entry.href);
@@ -0,0 +1 @@
1
+ {"seed":{"templates":{"salesCloudStarter":{"name":"Sales Cloud Starter","description":"Accounts, contacts, opportunities, and products priced in the standard price book, with every opportunity's line items: 7,600 records, about 15 MB, more than the 5 MB of a Developer Edition."},"serviceCloudStarter":{"name":"Service Cloud Starter","description":"Accounts, contacts, cases, case comments and Knowledge articles: 3,800 records, about 7.6 MB, more than the 5 MB of a Developer Edition. The articles are skipped in an org without Knowledge."},"minimalDemo":{"name":"Minimal Demo","description":"50 accounts, each with 2 contacts and 4 opportunities: 350 records, under 1 MB."},"crmStarter":{"name":"CRM Starter","description":"Accounts with their contacts, opportunities priced from the standard price book with their line items, and cases: about 300 records, under 1 MB, sized for the 5 MB of a new Developer Edition."},"leadsActivitiesStarter":{"name":"Leads & Activities Starter","description":"Leads, the campaigns they answered, and the calls and meetings booked with them: about 110 records. A user without the Marketing User box gets the leads and their activities, and a word on the campaigns."}}}}
@@ -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{c as A}from"./chunk-66NMFCWX.mjs";import{S as D}from"./chunk-JPUR2CFX.mjs";import{g as R}from"./chunk-JWTSEDIQ.mjs";import{c as x,p as g,q as h,s as P,t as k}from"./chunk-A527W53V.mjs";import{ic as O}from"./chunk-TTFDUKUS.mjs";import{b as d,f as l,k as m,l as b}from"./chunk-7EANH5PY.mjs";var j=[{child:"Entitlement",field:"AccountId",parent:"Account",refused:"always"},{child:"Order",field:"AccountId",parent:"Account",refused:"pastDraft"},{child:"Opportunity",field:"AccountId",parent:"Account",refused:"closedWon",rows:{field:"IsWon",value:!0}}];function C(e,n,t){let[s,r,a]=[e,n,t??""].map(i=>i.toLowerCase());return j.some(i=>i.refused==="always"&&i.child.toLowerCase()===s&&i.field.toLowerCase()===r&&(t===void 0||i.parent.toLowerCase()===a))}var W=b({name:d(),type:d(),createable:l().optional(),updateable:l().optional(),nillable:l().optional(),calculated:l().optional(),autoNumber:l().optional(),permissionable:l().optional(),encrypted:l().optional(),referenceTo:m(d()).nullish()}).loose(),oe=b({name:d(),undeletable:l().optional(),fields:m(W),childRelationships:m(b({childSObject:d(),field:d(),cascadeDelete:l().optional(),restrictedDelete:l().optional()}).loose()).nullish()}).loose(),F=["Id","SystemModstamp","CreatedDate","CreatedById","LastModifiedDate","LastModifiedById"],S="IsPersonAccount",M="Event",I=["LatestPublishedVersionId","ContentSize"],_=["ParentId","ContentAssetId","IsArchived"],v="VersionData";function N(e){return e.toLowerCase()===R.toLowerCase()}function B(e){return new Set(N(e)?I.map(n=>n.toLowerCase()):[])}function U(e){return e===x||e===M?"scanAllLive":"query"}function V(e){let n={name:e.name,label:e.name,labelPlural:e.name,keyPrefix:null,custom:!1,createable:!0,updateable:!0,deletable:!0,queryable:!0,fields:e.fields.map(t=>({name:t.name,label:t.name,type:t.type,length:0,nillable:t.nillable===!0,createable:t.createable===!0,updateable:t.updateable===!0,externalId:!1,referenceTo:t.referenceTo??[],relationshipName:null,picklistValues:[],defaultValue:null,calculated:t.calculated===!0,autoNumber:t.autoNumber===!0,unique:!1,...t.permissionable===void 0?{}:{permissionable:t.permissionable}})),recordTypeInfos:[],childRelationships:[]};return new A(async()=>n)}function G(e){return e.type==="address"||e.type==="location"}function y(e){return new Map(e.fields.map(n=>[n.name.toLowerCase(),n]))}async function K(e,n){let t=y(e),s=F.filter(o=>t.has(o.toLowerCase())),r=t.get(S.toLowerCase());r&&(e.name===g||e.name===h)&&s.push(r.name);let a=N(e.name);if(a)for(let o of I){let c=t.get(o.toLowerCase());c&&s.push(c.name)}let i=new Set(a?_.map(o=>o.toLowerCase()):[]),p=new Set(s.map(o=>o.toLowerCase())),f=e.fields.map(o=>o.name).filter(o=>!p.has(o.toLowerCase())&&!i.has(o.toLowerCase())),{writable:L,skipped:z,denied:T}=await V(e).partitionWritableFields(e.name,"upsert",f),w=[],u=new Map;for(let o of T)u.set(o,"fls");for(let o of z){let c=t.get(o.toLowerCase());c&&G(c)&&u.set(o,"compound")}let E=new Set(L);for(let o of L){let c=t.get(o.toLowerCase())?.type;c==="base64"?u.set(o,"base64"):c===D&&!n.viewsEncryptedData&&u.set(o,"encrypted")}for(let o of f){let c=u.get(o);c!==void 0?w.push({field:o,reason:c}):E.has(o)&&s.push(o)}return a&&w.push({field:v,reason:"base64"}),{fields:s,leftOutFields:w}}function q(e,n){let t=y(e),s=e.name.toLowerCase(),r=new Set;for(let a of n)for(let i of a.childRelationships??[]){if(i.cascadeDelete!==!0||i.childSObject.toLowerCase()!==s||C(e.name,i.field,a.name))continue;let p=t.get(i.field.toLowerCase());p&&r.add(p.name)}return[...r].sort()}function Y(e,n){let t=y(e),s=e.name.toLowerCase(),r=new Set;for(let a of n)for(let i of a.childRelationships??[]){if(!(i.restrictedDelete===!0&&i.cascadeDelete!==!0||C(e.name,i.field,a.name))||i.childSObject.toLowerCase()!==s)continue;let f=t.get(i.field.toLowerCase());f&&r.add(f.name)}return[...r].sort()}function re(e){let n=e.cascadeParents.filter(t=>C(e.objectApiName,t));return n.length===0?e:{...e,cascadeParents:e.cascadeParents.filter(t=>!n.includes(t)),restrictParents:[...new Set([...e.restrictParents??[],...n])].sort()}}async function se(e,n,t){return{objectApiName:e.name,readMode:U(e.name),undeletable:e.undeletable===!0,cascadeParents:q(e,n),restrictParents:Y(e,n),...await K(e,t)}}function H(e,n){let t=e.toLowerCase(),s=new Set;for(let r of n){let a=r.indexOf(".");a<=0||a===r.length-1||r.slice(0,a).toLowerCase()===t&&s.add(r.slice(a+1).toLowerCase())}return s}function J(e,n){let t=n.toLowerCase();return t!==S.toLowerCase()&&!F.some(s=>s.toLowerCase()===t)&&!B(e).has(t)}function ae(e,n,t){let s=H(e,t);return n.filter(r=>J(e,r)&&!s.has(r.toLowerCase()))}function ie(e,n){return e===h&&P(n)}function ce(e,n,t){let s=e===g?k(n,!1):void 0,r={};typeof n.Id=="string"&&(r.Id=n.Id);for(let a of t)a in n&&(s!==void 0&&O(g,a,s)||(r[a]=n[a]));return r}export{j as a,C as b,W as c,oe as d,S as e,I as f,U as g,re as h,se as i,H as j,ae as k,ie as l,ce as m};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __sandforgeRequire } from 'node:module';
2
+ import { fileURLToPath as __sandforgePath } from 'node:url';
3
+ import { dirname as __sandforgeDirname } from 'node:path';
4
+ const require = __sandforgeRequire(import.meta.url);
5
+ const __filename = __sandforgePath(import.meta.url);
6
+ const __dirname = __sandforgeDirname(__filename);
7
+ import{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};
@@ -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{c as z,d as v,f as A,j as k,k as c,l as R}from"./chunk-FQGHL7GR.mjs";import{hb as f}from"./chunk-TTFDUKUS.mjs";var L={en_US:[{city:"New York",state:"New York",country:"United States",zipCode:"10001"},{city:"Los Angeles",state:"California",country:"United States",zipCode:"90001"},{city:"Chicago",state:"Illinois",country:"United States",zipCode:"60601"},{city:"Houston",state:"Texas",country:"United States",zipCode:"77001"},{city:"Phoenix",state:"Arizona",country:"United States",zipCode:"85001"},{city:"Philadelphia",state:"Pennsylvania",country:"United States",zipCode:"19101"},{city:"San Antonio",state:"Texas",country:"United States",zipCode:"78201"},{city:"San Diego",state:"California",country:"United States",zipCode:"92101"},{city:"Dallas",state:"Texas",country:"United States",zipCode:"75201"},{city:"Austin",state:"Texas",country:"United States",zipCode:"78701"}],fr_FR:[{city:"Paris",state:"Ile-de-France",country:"France",zipCode:"75001"},{city:"Lyon",state:"Auvergne-Rhone-Alpes",country:"France",zipCode:"69001"},{city:"Marseille",state:"Provence-Alpes-Cote d'Azur",country:"France",zipCode:"13001"},{city:"Toulouse",state:"Occitanie",country:"France",zipCode:"31000"},{city:"Nice",state:"Provence-Alpes-Cote d'Azur",country:"France",zipCode:"06000"},{city:"Bordeaux",state:"Nouvelle-Aquitaine",country:"France",zipCode:"33000"},{city:"Strasbourg",state:"Grand Est",country:"France",zipCode:"67000"},{city:"Nantes",state:"Pays de la Loire",country:"France",zipCode:"44000"},{city:"Lille",state:"Hauts-de-France",country:"France",zipCode:"59000"},{city:"Rennes",state:"Bretagne",country:"France",zipCode:"35000"}],de_DE:[{city:"Berlin",state:"Berlin",country:"Germany",zipCode:"10115"},{city:"Munich",state:"Bavaria",country:"Germany",zipCode:"80331"},{city:"Hamburg",state:"Hamburg",country:"Germany",zipCode:"20095"},{city:"Frankfurt",state:"Hesse",country:"Germany",zipCode:"60311"},{city:"Cologne",state:"North Rhine-Westphalia",country:"Germany",zipCode:"50667"},{city:"Stuttgart",state:"Baden-Wurttemberg",country:"Germany",zipCode:"70173"},{city:"Dusseldorf",state:"North Rhine-Westphalia",country:"Germany",zipCode:"40213"},{city:"Leipzig",state:"Saxony",country:"Germany",zipCode:"04109"},{city:"Dresden",state:"Saxony",country:"Germany",zipCode:"01067"},{city:"Hannover",state:"Lower Saxony",country:"Germany",zipCode:"30159"}],es_ES:[{city:"Madrid",state:"Comunidad de Madrid",country:"Spain",zipCode:"28001"},{city:"Barcelona",state:"Catalonia",country:"Spain",zipCode:"08001"},{city:"Valencia",state:"Comunitat Valenciana",country:"Spain",zipCode:"46001"},{city:"Seville",state:"Andalusia",country:"Spain",zipCode:"41001"},{city:"Zaragoza",state:"Aragon",country:"Spain",zipCode:"50001"},{city:"Malaga",state:"Andalusia",country:"Spain",zipCode:"29001"},{city:"Bilbao",state:"Basque Country",country:"Spain",zipCode:"48001"},{city:"Murcia",state:"Region de Murcia",country:"Spain",zipCode:"30001"},{city:"Palma",state:"Balearic Islands",country:"Spain",zipCode:"07001"},{city:"Granada",state:"Andalusia",country:"Spain",zipCode:"18001"}],ja_JP:[{city:"Tokyo",state:"Tokyo",country:"Japan",zipCode:"100-0001"},{city:"Osaka",state:"Osaka",country:"Japan",zipCode:"530-0001"},{city:"Yokohama",state:"Kanagawa",country:"Japan",zipCode:"220-0011"},{city:"Nagoya",state:"Aichi",country:"Japan",zipCode:"450-0001"},{city:"Sapporo",state:"Hokkaido",country:"Japan",zipCode:"060-0001"},{city:"Fukuoka",state:"Fukuoka",country:"Japan",zipCode:"810-0001"},{city:"Kobe",state:"Hyogo",country:"Japan",zipCode:"650-0001"},{city:"Kyoto",state:"Kyoto",country:"Japan",zipCode:"600-8001"},{city:"Sendai",state:"Miyagi",country:"Japan",zipCode:"980-0001"},{city:"Hiroshima",state:"Hiroshima",country:"Japan",zipCode:"730-0001"}],pt_BR:[{city:"Sao Paulo",state:"Sao Paulo",country:"Brazil",zipCode:"01000-000"},{city:"Rio de Janeiro",state:"Rio de Janeiro",country:"Brazil",zipCode:"20000-000"},{city:"Brasilia",state:"Distrito Federal",country:"Brazil",zipCode:"70000-000"},{city:"Salvador",state:"Bahia",country:"Brazil",zipCode:"40000-000"},{city:"Fortaleza",state:"Ceara",country:"Brazil",zipCode:"60000-000"},{city:"Belo Horizonte",state:"Minas Gerais",country:"Brazil",zipCode:"30000-000"},{city:"Manaus",state:"Amazonas",country:"Brazil",zipCode:"69000-000"},{city:"Curitiba",state:"Parana",country:"Brazil",zipCode:"80000-000"},{city:"Recife",state:"Pernambuco",country:"Brazil",zipCode:"50000-000"},{city:"Porto Alegre",state:"Rio Grande do Sul",country:"Brazil",zipCode:"90000-000"}]},B={en:"en_US",fr:"fr_FR",de:"de_DE",es:"es_ES",ja:"ja_JP",pt:"pt_BR"};function l(i){if(i in L)return i;let e=i.split("_")[0].toLowerCase();return B[e]??"en_US"}var u=class{tuples;resolvedLocale;constructor(e){this.resolvedLocale=l(e??"en_US"),this.tuples=L[this.resolvedLocale]}getAddress(e){return this.tuples[e%this.tuples.length]}getCity(e){return this.getAddress(e).city}getState(e){return this.getAddress(e).state}getCountry(e){return this.getAddress(e).country}getZipCode(e){return this.getAddress(e).zipCode}getLocaleData(){return c(this.resolvedLocale)}};var F={en_US:"US",fr_FR:"FR",de_DE:"DE",es_ES:"ES",ja_JP:"JP",pt_BR:"BR"},$={fr_FR:{country:"FR",bbanLength:23},de_DE:{country:"DE",bbanLength:18},es_ES:{country:"ES",bbanLength:20},en_US:{country:"DE",bbanLength:18},ja_JP:{country:"DE",bbanLength:18},pt_BR:{country:"DE",bbanLength:18}},w="ABCDEFGHIJKLMNPQRSTUVWXYZ",T=["Ergonomic","Handcrafted","Refined","Sleek","Rustic","Compact","Modular","Insulated"],E=["Steel","Wooden","Cotton","Granite","Rubber","Leather","Ceramic"],_=["Chair","Table","Lamp","Keyboard","Backpack","Bottle","Headphones","Gloves","Bench"],M=["Senior","Lead","Junior","Principal","Associate","Chief"],P=["Marketing","Operations","Finance","Sales","Product","Customer Success"],U=["Manager","Analyst","Coordinator","Specialist","Director","Consultant"],G=["Adaptive","Integrated","Customer-focused","Scalable","Secure"],O=["cloud-based","real-time","data-driven","modular","global"],I=["platform","solution","workflow","service","framework","network"],J=["daily use at home or in the office","long days on the move","teams that need something that lasts","small spaces","outdoor work in any weather"],H=["Unable to log in","Invoice discrepancy","Password reset email not received","Order arrived damaged","Request for a refund","Cannot update billing address","Shipment delayed","Error when exporting a report","Product not working as described","Question about my contract","Charged twice for one order","Need help with installation","Account locked after failed logins","Wrong item delivered","Request: edit several records at once","App crashes on startup","Items missing from my order","Cannot download my invoice","Change of delivery address","Warranty claim","Slow since the last update","Question about my subscription renewal","Data not syncing between devices","Cancel my order","Upgrade to a higher plan"],x=["Asked the customer for a screenshot of the error.","Reproduced the issue on our side.","Escalated to the second-level team.","Sent the customer a workaround.","Customer confirmed the fix works.","Waiting for the customer's reply.","Refund approved and processed.","Replacement shipped today.","Called the customer, no answer; left a voicemail.","Linked to a known issue, a fix is planned.","Updated the customer's address on file.","Shared the knowledge article on this topic.","Closed after the customer confirmed.","Reset the account; login works again.","Checked the logs, nothing unusual found."],j=1440*60*1e3,V=365,Y=120,W=30,N=20,K=65,b=class{locale;localeData;geoGenerator;usernameToken=crypto.randomUUID().replace(/-/g,"").slice(0,8);random;today;companyDecks=new Map;companiesDealt=new Map;constructor(e,t={}){this.locale=e??"en_US",this.localeData=c(this.locale),this.geoGenerator=new u(this.locale),this.random=t.random??Math.random,this.today=t.today??(()=>new Date)}setLocale(e){this.locale=e,this.localeData=c(e),this.geoGenerator=new u(e)}generate(e,t,r=0){if(t<=0||e.length===0)return[];let a=[],o=e.filter(n=>f(n.config.fakerMethod??"lorem")==="phone");for(let n=r;n<r+t;n++){let d={},m=new Map,C=(s,p)=>{let y=m.get(s);if(y!==void 0)return y%p;let D=this.below(p);return m.set(s,D),D};for(let s of e){let p=o.indexOf(s),y=p>=0?n*o.length+p:n;d[s.fieldApiName]=this.generateFieldValue(s,y,C)}a.push(d)}return a}dateOf(e){return e==="pastDate"?this.pastDate():this.futureDate()}below(e){return Math.min(e-1,Math.floor(this.random()*e))}pick(e){return e[this.below(e.length)]}generateFieldValue(e,t,r){let a=e.config.fakerMethod??"lorem",o={min:e.config.minValue??0,max:e.config.maxValue??1e3},n=e.config.fakerLocale;if(n&&n!==this.locale){let d=this.locale,m=this.localeData,C=this.geoGenerator;this.locale=n,this.localeData=c(n),this.geoGenerator=new u(n);let s=this.generateByMethodInstance(a,t,o,r);return this.locale=d,this.localeData=m,this.geoGenerator=C,s}return this.generateByMethodInstance(a,t,o,r)}generateByMethodInstance(e,t,r,a){let o=f(e);if(!o)return Z(e);let n=()=>a("geo",1e4);switch(o){case"name":return`${this.firstName(a)} ${this.lastName(a)}`;case"firstName":return this.firstName(a);case"lastName":return this.lastName(a);case"jobTitle":return`${this.pick(M)} ${this.pick(P)} ${this.pick(U)}`;case"email":return this.generateEmail(t,a);case"username":return this.generateUsername(t,a);case"nickname":return this.generateNickname(t,a);case"phone":return this.generatePhone(t);case"address":return`${this.streetAddress()}, ${this.geoGenerator.getCity(n())}`;case"streetAddress":return this.streetAddress();case"city":return this.geoGenerator.getCity(n());case"country":return this.geoGenerator.getCountry(n());case"state":return this.geoGenerator.getState(n());case"company":return this.generateCompany();case"catchPhrase":return`${this.pick(G)} ${this.pick(O)} `+this.pick(I);case"date":case"pastDate":return this.pastDate();case"futureDate":return this.futureDate();case"futureDateTime":return this.futureDateTime();case"birthdate":return this.birthdate();case"number":case"integer":return Math.floor(r.min+this.random()*(r.max-r.min+1));case"float":return Math.round((r.min+this.random()*(r.max-r.min))*100)/100;case"boolean":return t%2===0;case"lorem":case"sentence":return g(t);case"paragraph":return q(t);case"caseSubject":return this.pick(H);case"caseComment":return this.pick(x);case"uuid":return this.uuid();case"url":return`https://example.com/resource/${t}`;case"zipCode":return this.geoGenerator.getZipCode(n());case"productName":return this.productName(a);case"productDescription":return`${this.productName(a)}, made for ${this.pick(J)}.`;case"iban":return this.generateIban(t);case"bic":return this.generateBic(t)}}firstName(e){let t=this.localeData.firstNames;return t[e("first",t.length)]}lastName(e){let t=this.localeData.lastNames;return t[e("last",t.length)]}generateEmail(e,t){let r=this.localeData.emailDomains[e%this.localeData.emailDomains.length];return`${h(this.firstName(t))}.${h(this.lastName(t))}${e}@${r}`}generateUsername(e,t){let r=h(this.firstName(t)),a=h(this.lastName(t)),o=this.localeData.emailDomains[e%this.localeData.emailDomains.length];return`${r}.${a}.${this.usernameToken}${e}@${o}`}generateNickname(e,t){return`${h(this.firstName(t)).slice(0,20)}.${this.usernameToken}${e}`}generatePhone(e){return k(this.locale,e)}streetAddress(){let{names:e,format:t}=z[l(this.locale)];return t.replace("{street}",this.pick(e)).replace("{n}",String(1+this.below(199))).replace("{m}",String(1+this.below(9)))}generateCompany(){let e=l(this.locale),t=A[e].companies.length,r=this.companyDecks.get(e);if(!r||r.length!==t){r=Array.from({length:t},(o,n)=>n);for(let o=r.length-1;o>0;o--){let n=this.below(o+1);[r[o],r[n]]=[r[n],r[o]]}this.companyDecks.set(e,r)}let a=this.companiesDealt.get(e)??0;return this.companiesDealt.set(e,a+1),v(e,r[a%r.length],Math.floor(a/r.length))}productName(e){let t=T[e("productAdjective",T.length)],r=E[e("productMaterial",E.length)],a=_[e("product",_.length)];return`${t} ${r} ${a}`}pastDate(){return S(this.daysFromToday(-(1+this.below(V))))}futureDate(){return S(this.daysFromToday(1+this.below(Y)))}futureDateTime(){let e=this.daysFromToday(1+this.below(W));return e.setUTCHours(8+this.below(9),this.below(2)*30,0,0),e.toISOString()}birthdate(){let e=(K-N)*365;return S(this.daysFromToday(-(N*365+this.below(e))))}daysFromToday(e){return new Date(this.today().getTime()+e*j)}uuid(){let e=Array.from({length:32},()=>this.below(16).toString(16));e[12]="4",e[16]=(this.below(16)&3|8).toString(16);let t=e.join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}generateIban(e){let t=$[l(this.locale)],r=R("#".repeat(t.bbanLength),e);return`${t.country}${X(t.country,r)}${r}`}generateBic(e){let t=Array.from({length:4},(a,o)=>String.fromCharCode(65+(e*5+o*7+3)%26)).join(""),r=Array.from({length:2},(a,o)=>w[(e*3+o*11+2)%w.length]).join("");return`${t}${F[l(this.locale)]}${r}XXX`}};function oe(i,e,t,r,a){let o=new b(r,a),n={fieldApiName:"temp",ruleType:"faker",config:{fakerMethod:i,minValue:t.min,maxValue:t.max}};return o.generate([n],e+1)[e]?.temp}function S(i){return i.toISOString().split("T")[0]}function h(i){return i.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z]/g,"")}function X(i,e){let t=`${e}${i}00`.replace(/[A-Z]/g,a=>String(a.charCodeAt(0)-55)),r=0;for(let a of t)r=(r*10+Number(a))%97;return String(98-r).padStart(2,"0")}function Z(i){throw new Error(`Faker method "${i}" is not implemented: choose a method SandForge generates, or remove it from the field rule.`)}function g(i){let e=["lorem","ipsum","dolor","sit","amet","consectetur","adipiscing","elit"],t=i%e.length,r=[];for(let a=0;a<6;a++)r.push(e[(t+a)%e.length]);return r.join(" ")+"."}function q(i){return[g(i),g(i+1),g(i+2)].join(" ")}export{b as a,oe as b};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __sandforgeRequire } from 'node:module';
2
+ import { fileURLToPath as __sandforgePath } from 'node:url';
3
+ import { dirname as __sandforgeDirname } from 'node:path';
4
+ const require = __sandforgeRequire(import.meta.url);
5
+ const __filename = __sandforgePath(import.meta.url);
6
+ const __dirname = __sandforgeDirname(__filename);
7
+ import{a,b}from"./chunk-F6GUDTOB.mjs";import"./chunk-O2HDYYUV.mjs";import"./chunk-FQGHL7GR.mjs";import"./chunk-TTFDUKUS.mjs";import"./chunk-7EANH5PY.mjs";import"./chunk-NTOVCTRS.mjs";export{a as FieldMapper,b as generateValue};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __sandforgeRequire } from 'node:module';
2
+ import { fileURLToPath as __sandforgePath } from 'node:url';
3
+ import { dirname as __sandforgeDirname } from 'node:path';
4
+ const require = __sandforgeRequire(import.meta.url);
5
+ const __filename = __sandforgePath(import.meta.url);
6
+ const __dirname = __sandforgeDirname(__filename);
7
+ import{a,b,c,d,e}from"./chunk-E5AHXLS6.mjs";import"./chunk-PZPJKATS.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-TTFDUKUS.mjs";import"./chunk-7EANH5PY.mjs";import"./chunk-NTOVCTRS.mjs";export{b as SEED_RUNS_DIR,a as SEED_RUNS_KEPT,e as SeedRunCreations,d as nodeSeedRunCreations,c as seedRunKept};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __sandforgeRequire } from 'node:module';
2
+ import { fileURLToPath as __sandforgePath } from 'node:url';
3
+ import { dirname as __sandforgeDirname } from 'node:path';
4
+ const require = __sandforgeRequire(import.meta.url);
5
+ const __filename = __sandforgePath(import.meta.url);
6
+ const __dirname = __sandforgeDirname(__filename);
7
+ import{c as a,d as b}from"./chunk-IC2C2GOF.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-7EANH5PY.mjs";import"./chunk-NTOVCTRS.mjs";export{b as TriggerEngine,a as savedTriggerSchema};