@easy-cms/core 0.60.0 → 0.62.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.
@@ -32,8 +32,9 @@ import {
32
32
  storageKey,
33
33
  typeFromName,
34
34
  uniqueWithinOf,
35
+ warnDeprecated,
35
36
  withPrivacy
36
- } from "./chunk-CGVNZUW4.js";
37
+ } from "./chunk-FPFWLQB5.js";
37
38
 
38
39
  // src/access.ts
39
40
  var isSystemAdmin = (user) => user?.role === "admin" && !user.apiKey && user.scoped !== true;
@@ -1722,7 +1723,14 @@ var Auth = class {
1722
1723
  ...args.name ? { name: args.name } : {}
1723
1724
  });
1724
1725
  const raw = await this.db.findById({ collection: USERS, id: user.id });
1725
- return this.startSession(raw);
1726
+ const session = await this.startSession(raw);
1727
+ await this.cms.audit.record({
1728
+ action: "setup",
1729
+ target: "auth",
1730
+ user: session.user,
1731
+ detail: { setupCode: !!code }
1732
+ });
1733
+ return session;
1726
1734
  }
1727
1735
  // --- Members signing up (`auth.members.signUp`) ---------------------------------------------
1728
1736
  /** What a sign-up form needs: a token proving when it was loaded, and Turnstile's site key. */
@@ -4611,6 +4619,7 @@ function validateConfig(config) {
4611
4619
  return issues;
4612
4620
  }
4613
4621
  validateSecret(config.secret, add);
4622
+ validateCronSecret(config.cronSecret, (issue) => issues.push(issue));
4614
4623
  checkConfigKeys(config, (issue) => issues.push(issue));
4615
4624
  validateAdapterVersions(config, add);
4616
4625
  if (!config.db || typeof config.db.name !== "string" || typeof config.db.init !== "function") {
@@ -4686,6 +4695,27 @@ function validateSecret(secret, add) {
4686
4695
  add("secret", "looks like an example or a repeated pattern, not a random string", hint);
4687
4696
  }
4688
4697
  }
4698
+ function validateCronSecret(value, push) {
4699
+ const hint = `use a random string of at least ${MIN_SECRET_LENGTH} characters, e.g. \`openssl rand -hex 32\``;
4700
+ if (value !== void 0) {
4701
+ if (typeof value !== "string") push({ path: "cronSecret", message: "must be a string" });
4702
+ else if (value.length < MIN_SECRET_LENGTH)
4703
+ push({
4704
+ path: "cronSecret",
4705
+ message: `must be at least ${MIN_SECRET_LENGTH} characters (got ${value.length})`,
4706
+ hint
4707
+ });
4708
+ return;
4709
+ }
4710
+ const env = process.env.CRON_SECRET;
4711
+ if (env && env.length < MIN_SECRET_LENGTH)
4712
+ push({
4713
+ path: "cronSecret",
4714
+ message: `CRON_SECRET is ${env.length} characters; anyone who guesses it can run jobs`,
4715
+ hint,
4716
+ severity: "warning"
4717
+ });
4718
+ }
4689
4719
  function guessable(secret) {
4690
4720
  return /change[-_ ]?me|example|placeholder|secret-?key/i.test(secret) || new Set(secret).size < 8;
4691
4721
  }
@@ -6020,6 +6050,221 @@ function resolveAudit(audit) {
6020
6050
  // src/local-api.ts
6021
6051
  import { createHmac as createHmac6, randomBytes as randomBytes5, timingSafeEqual as timingSafeEqual5 } from "crypto";
6022
6052
 
6053
+ // src/auth/common-passwords.ts
6054
+ var LIST = `
6055
+ 0.0.0.000 01234567 063dyjuy 085tzzqi 09876543 10101010 11001001 11111111 11112222 11223344
6056
+ 11235813 12121212 12312312 123123123 12341234 12344321 12345678 123456789 1234567890 12345679
6057
+ 1234abcd 1234qwer 12locked 12qwaszx 13131313 13576479 14141414 14725836 14789632 151nxjmt
6058
+ 154ugeiu 17011701 17171717 18436572 19691969 19741974 19781978 19841984 1a2b3c4d 1letmein
6059
+ 1michael 1million 1passwor 1q2w3e4r 1q2w3e4r5t 1qaz2wsx 1qazxsw2 1x2zkg8w 20002000 20012001
6060
+ 201jedlz 20202020 20spanks 21122112 21212121 22222222 23232323 23skidoo 24242424 24682468
6061
+ 25252525 25802580 31415926 33333333 368ejhih 380zliki 383pdjvl 44444444 474jdvff 50spanks
6062
+ 51505150 551scasi 554uzpad 55555555 55bgates 5wr2i7h8 66666666 66668888 69696969 69camaro
6063
+ 766rglqy 77777777 78945612 863abgsg 87654321 88888888 8j4ye3uz 911turbo 98765432 987654321
6064
+ 99999999 a1234567 a1b2c3d4 aaaaaaa1 aaaaaaaa aardvark abc12345 abcd1234 abcdefg1 abcdefgh
6065
+ aberdeen abnormal absolute absolutely acapulco access14 access99 achilles acidburn adelaide
6066
+ adrienne aerosmit airborne aircraft airforce airplane albatros alejandr alessand alexalex
6067
+ alexande alexander alexandr alexandra alfarome alleycat alliance allison1 allnight allstate
6068
+ almighty alpha123 alphabet amateurs amatuers ambrosia america1 american amethyst amsterda
6069
+ amsterdam anaconda anastasi andersen anderson andromed andyandy andyod22 angelica angelika
6070
+ angelina animated annabell annmarie antelope anthony1 anthony7 anything aolsucks apollo13
6071
+ apple123 applepie aquarius archange architec argentin arizona1 arkansas armstron arsenal1
6072
+ asdf1234 asdfasdf asdfghjk asdfghjkl ashleigh assassin asshole1 assholes atlantic atlantis
6073
+ atreides attitude attorney auckland augustus austin31 australi australia avalanch aviation
6074
+ azertyui b929ezzh baberuth babybaby babyblue babycake babydoll babyface babygirl babylon5
6075
+ babylove backbone backdoor badabing balloons baltimor bangbang barbados barcelon barcelona
6076
+ barefeet barefoot baritone basebal1 baseball baseball1 basement basketba basketball bastards
6077
+ bbbbbbbb bcfields bearbear bearcats beatles1 beatrice beautifu beautiful beefcake beerbeer
6078
+ beethove bellagio bendover benjamin bergkamp berkeley bettyboo bigballs bigblack bigblock
6079
+ bigboobs bigbooty bigbucks bigdaddy bigdick1 bigdicks bigmoney bigpenis bigpoppa bigtruck
6080
+ billabon billbill billybob billyboy binladen birthday birthday1 birthday4 bitchass blackbir
6081
+ blackcat blackcoc blackdog blackhaw blackice blackjac blackjack blacklab blackman blackout
6082
+ blessing blink182 blizzard blowfish blue1234 blueball bluebell blueberr bluebird blueblue
6083
+ blueeyes bluefish bluejays bluemoon bluesman bobafett bobdylan bollocks bonehead bookworm
6084
+ borabora bordeaux borussia bradford brandon1 brewster brighton brigitte brisbane brittany
6085
+ brittney broadway broncos1 brooklyn brothers browning brucelee bubba123 bubbles1 buckaroo
6086
+ buckeyes buckshot budapest buddy123 buddyboy budlight budweise buffalo1 building bukowski
6087
+ bulldawg bulldog1 bulldogs bulletin bullfrog bullseye bullshit bullwink bunghole business
6088
+ businessbabe buttercu butterfl butterfly buttfuck butthead butthole cabernet cadillac caldwell
6089
+ calendar caliente californ california caligula calimero callaway callisto camaross cambridg
6090
+ cameltoe cameron1 campbell canadian candyass candyman cannabis capetown capitals capricor
6091
+ capslock captain1 cardinal cardinals care1839 carebear carlitos carnival carolina caroline
6092
+ carpedie carpente cartman1 cartoons casanova cashflow cashmone cassandr castillo catalina
6093
+ catfight catherin catherine catwoman cavalier cbr900rr cccccccc celebrity cerberus cezer121
6094
+ chadwick chainsaw challeng chambers champion chandler changeme chargers charisma charlene
6095
+ charles1 charlie1 charlie123 charlie2 charlott charlotte charlton checkers checkmat cheerleaers
6096
+ chelsea1 chemical cherokee cherries cheshire chester1 chestnut chevelle chevrole chevrolet
6097
+ chewbacc cheyenne chicago1 chicken1 chickens children chipmunk chiquita chocolat chocolate
6098
+ choochoo chris123 chrisbln christia christian christie christin christina christine christma
6099
+ christmas christop christopher chrysler chuckles churchil cinnamon citation civilwar clarence
6100
+ clarinet clarissa classics claudia1 claymore clemente cleopatr clevelan cleveland clifford
6101
+ climbing clippers clitoris close-up clueless cocacola cocksuck cocksucker cocktail coldbeer
6102
+ coldplay colombia colonial colorado coltrane columbia columbus comanche commande commando
6103
+ complete computer concorde concrete confused conquest constant consumer contains contortionist
6104
+ contract coolcool cooldude coolhand coolness copenhag corleone cornhole cornwall corvet07
6105
+ corvette costello cosworth courtney coventry cowboys1 crawford crazybab crazyman creampie
6106
+ creation creative creature creepers crescent cricket1 criminal cristian cristina cromwell
6107
+ crusader crystal1 csfbr5yy culinary customer cutiepie cybersex cyclones cygnusx1 dad2ownu
6108
+ daedalus daisydog danielle dannyboy dapzu455 daredevi darkange darklord darkness darkside
6109
+ darkstar darthvad daughter davecole davedave davidson daylight dddddddd deadhead deadpool
6110
+ deadspin death666 december deepthroat deerhunt deeznuts deeznutz defender deftones delaware
6111
+ delldell delpiero designer destiny1 detectiv devil666 devildog devilman diamond1 diamonds
6112
+ dickdick dickhead dietcoke digital1 dilbert1 dilligaf dingdong dinosaur dipstick director
6113
+ dirtbike dirtydog disaster discover division doberman dodgeram dodgers1 doghouse dogpound
6114
+ dolemite dolphin1 dolphins dominick dominion dominiqu dontknow doomsday doughboy doughnut
6115
+ downhill downtown dragon12 dragon69 dragonba dragonball dragonfl dragster dreamcas dreamer1
6116
+ dreaming dripping drowssap drpepper drummer1 dudedude dukeduke dutchess dynamite earnhard
6117
+ earthlin earthlink eastside eastwood eatmenow eatpussy eclipse1 edgewise edmonton eeeeeeee
6118
+ eggplant eighteen einstein ejaculation elcamino eldiablo eldorado electric electron elephant
6119
+ elisabet elizabet elizabeth embalmer emmanuel enforcer engineer england1 enternow enterpri
6120
+ enterprise entrance envelope erection ericsson escalade espresso estrella eternity evangeli
6121
+ everlast evolutio excalibu excalibur exchange experience experienced explorer express1 f00tball
6122
+ fairlane faithful fandango fantasia fantasies farscape fastball fatluvr69 favorite favorite2
6123
+ favorite6 fearless feathers february federico feelgood fellatio ferguson fernando ferrari1
6124
+ festival ffffffff ffvdj474 fidelity fighting films+pic+galeries fingerig fireball fireblad
6125
+ firefigh firefire firehawk firewall fishbone fishcake fisherma fishfish fishhead fishing1
6126
+ fishtank flamingo flanders flashman flathead fletcher flexible flipflop flipmode florence
6127
+ florida1 flounder flyers88 football football1 fordf150 foreplay foreskin forgetit formula1
6128
+ forsaken fortress fortune12 fountain foxylady francesc francine francois frankie1 franklin
6129
+ freckles frederic fredfred fredrick freedom1 freefall freefree freepass freeporn freeuser
6130
+ freewill frenchie friendly frogfrog front242 frontier fuck_inside fuckface fuckfuck fuckhead
6131
+ fuckinside fuckoff1 fuckthis fuckyou1 fuckyou2 fullback fullmoon funstuff funtimes fussball
6132
+ fuzzball gabriel1 gabriela gabriell galeries gallaries gamecock gamecube gameover gandalf1
6133
+ gangbang gangbanged gangster garfield gargoyle garrison gateway1 gateway2 gatorade general1
6134
+ generals genesis1 geneviev geoffrey gerhardt geronimo gertrude gesperrt getmoney getsdown
6135
+ gfxqx686 gggggggg gilligan ginscoot giovanna giovanni girfriend giuseppe giveitup gizmodo1
6136
+ gladiato gladiator glendale glennwei gnasher23 godfathe godfather godsmack godspeed godzilla
6137
+ gogators goldberg goldeney goldfing goldfish goldstar goldwing golfball golfgolf gonzales
6138
+ gonzalez goodfell goodgirl goodluck goodtime goodyear goofball gooseman gordon24 gorgeous
6139
+ gotohell gotyoass graduate graphics grateful graywolf greatest greatone green123 greenbay
6140
+ greenday greenman gregory1 gretchen greywolf griffith gsxr1000 guardian guinness gymnastic
6141
+ hahahaha hairball halflife hallowee hamilton handball handsome handyman hannibal happines
6142
+ happy123 happyday happydog happyman hardball hardcock hardcore harddick hardrock hardware
6143
+ hardwood harrison hartford hastings hattrick hawaii50 hawaiian hawkeyes hawkwind hawthorn
6144
+ hayabusa heather1 hedgehog heineken heinrich hellfire hello123 hellohel hellyeah hercules
6145
+ herewego heritage hetfield hhhhhhhh highbury highheel highland highlander highlife hihje863
6146
+ hillbill hillside holidays hollywoo hollywood holyshit homemade homepage homepage- honeybee
6147
+ honeydew hongkong honolulu hooligan hoosiers hooters1 hopeless hornyman horseman horsemen
6148
+ hotgirls hotmail0 hotmail1 hotpussy hotstuff hounddog housewife housewifes houston1 hugetits
6149
+ hugohugo humphrey hurrican hurricane huskers1 hyperion hzze929b ibilltes icecream icehouse
6150
+ idontkno idontknow ihateyou iiiiiiii illinois illmatic illusion ilovegod ilovesex iloveyou
6151
+ iloveyou! iloveyou1 iloveyou2 immortal imperial implants infantry infinite infiniti infinity
6152
+ innocent insanity insertion insertions insomnia inspiron instinct interacial intercourse
6153
+ interest internal internet intrepid intruder iqzzt580 irishman isabella isabelle isacs155
6154
+ islander istanbul istheman italiano iverson3 jackass1 jackjack jackson1 jackson5 jakejake
6155
+ james007 jamesbon jamesbond japanees japanese jasmine1 jayhawks jeanette jediknig jeepjeep
6156
+ jeepster jefferso jeffjeff jellybea jennifer jennings jeremiah jermaine jessica1 jiggaman
6157
+ jjjjjjjj jo9k2jw2 johannes johndeer johngalt johnjohn johnmish johnson1 johnston jojojojo
6158
+ jonathan jonathon jordan23 josephin joystick juliette junkmail jupiter1 jupiter2 jurassic
6159
+ just4fun justdoit juventus kamikaze kangaroo katarina katherin katherine kathleen kawasaki
6160
+ kayleigh kcchiefs kcj9wx5n kentucky kenworth keyboard keystone kikimora killbill killkill
6161
+ kimberly kingfish kingkong kingrich kingston kirkland kisskiss kittycat kittykat kkkkkkkk
6162
+ klondike knickerless knickers knockers knuckles kordell1 kristian kristin1 kristina kristine
6163
+ labrador lacrosse laetitia lakeside lakewood lalakers lalalala lancelot landmark laserjet
6164
+ lasvegas laughing laurence lavalamp lawrence lebowski leedsutd lemonade leonardo lesbians
6165
+ letmein1 letmein2 letmein22 letmeinn letmesee letsdoit lexingky lifehack lifetime lighthou
6166
+ lighting lightnin lightning limewire lincoln1 lionhear lionking lipstick lisalisa littlema
6167
+ liverpoo liverpool lkjhgfds llllllll lockdown lockerroom logitech lollipop lollypop lonesome
6168
+ lonestar lonewolf longdong longhair longhorn longjohn longshot lorraine losangel lovelife
6169
+ lovelove loverboy loverman lowrider luckydog luckyone lunchbox luv2epus macaroni macdaddy
6170
+ macgyver macintos madeline madison1 magazine magellan magician magicman magnolia mainland
6171
+ majestic makaveli mallorca mallrats mamacita manchest manchester mandarin mandingo mandrake
6172
+ manhatta maradona marathon marauder marcello marcius2 margaret marianne marijuan mariners
6173
+ marines1 marino13 mariposa marjorie marlboro marriage marshall martinez maryjane maryland
6174
+ masamune maserati mash4077 master12 masterbaiting masterbate masterbating masturbation matchbox
6175
+ material matthew1 matthews matthias maverick maxwell1 mazda626 mazdarx7 mccarthy mcdonald
6176
+ mckenzie meatball meathead meatloaf mechanic medicine megadeth megapass megatron melanie1
6177
+ melissa1 meowmeow mephisto mercedes merchant mercury1 meredith meridian metallic metallica
6178
+ michael1 michael2 michaela michaels michelle michigan microsof microsoft midnight mikemike
6179
+ milamber military millions millwall minemine minimoni ministry minnesot mischief misfit99
6180
+ mississi missouri mistress mitchell mmmmmmmm mobydick modelsne mohammad mohammed mollydog
6181
+ monalisa money123 moneyman mongoose monkey12 monkeybo monopoly monster1 monsters montana1
6182
+ montecar monterey montreal montrose moonbeam moonligh moonlight moonshin morpheus morrison
6183
+ mortgage morticia mortimer motherfucker motocros motorola mounta1n mountain mudvayne muffdive
6184
+ mulligan munchkin mushroom musician musicman mustang1 mustang2 mustang5 mustang6 mustangs
6185
+ mwq6qlzo myspace1 myxworld nancy123 napoleon nascar24 natalie1 natasha1 natedogg nathalie
6186
+ nathanie national navyseal ncc1701a ncc1701d ncc1701e ncc74656 nebraska necklace negative
6187
+ nemrac58 netscape nevermin newcastl newcastle newpass6 newyork1 nicetits nicholas nightmar
6188
+ nightowl nightwin nineball nineinch nineteen nintendo nirvana1 nnnnnnnn nocturne nonenone
6189
+ normandy northern nostromo notebook notredam nounours november novifarm nwo4life nygiants
6190
+ nyyankee oblivion obsidian offshore oklahoma oooooooo opendoor operator optimist original
6191
+ outoutout outsider overkill overlord ozlq6qwm pa55w0rd pa55word packers1 paintbal paintball
6192
+ painting pakistan paladin1 pallmall palmtree panasoni panasonic pantera1 panther1 panthers
6193
+ papabear papillon paradigm paradise paramedi paranoid pasadena pass1234 passmast passpass
6194
+ passport passthie passw0rd passwor1 password password1 password2 password9 passwords passwort
6195
+ patches1 pathetic pathfind patience patricia patrick1 patriots paulpaul pavement pavilion
6196
+ peaches1 pearljam peekaboo penelope penetrating penetration penguin1 penguins pennywis pentagon
6197
+ penthous perfect1 personal pertinant pescator peterbil peternorth peterpan peterson phaedrus
6198
+ phantom1 pharmacy phialpha philippe phillies phillips phoenix1 pianoman pictuers piercing
6199
+ pimpdadd pimpdaddy pineappl pinetree pingpong pinkfloy pinkfloyd pinnacle pipeline pitchers
6200
+ pizzaman plastics platinum platypus playball playboy1 playboy2 playmate playoffs playstat
6201
+ playstation playtime pleasant pleasure plymouth polopolo poohbear pool6123 poontang poophead
6202
+ pooppoop porkchop porn4life pornking pornographic pornporn porsche1 porsche9 portland portugal
6203
+ poseidon positive postov1000 pounding pppppppp preacher precious predator pregnant prelude1
6204
+ presario presiden president pressure primetime21 princess princeto pringles printing private1
6205
+ producer progress property prophecy prospect ptfe3xxp pumpkin1 pumpkins punisher punkrock
6206
+ puppydog pussy123 pussy4me pussycat pussyeat pussyman pxx3eftp q1w2e3r4 qazwsxed qazwsxedc
6207
+ qcmfd454 qqqqqqqq quant4307s question qwer1234 qwerasdf qwerqwer qwert123 qwerty12 qwerty123
6208
+ qwertyui qwertyuiop qwertzui r2d2c3po rachelle radiohea ragnarok raiders1 railroad rainbow1
6209
+ rainbow6 rainbows rainyday raistlin randolph rangers1 rapunzel rasputin rasta220 rebecca1
6210
+ reckless recovery redalert redbaron reddevil reddwarf redheads redlight redshift redskins
6211
+ redstorm redwings reginald register reindeer remember remingto renegade republic research
6212
+ resident revoluti revolver reynolds rhiannon richard1 richards richmond riffraff rightnow
6213
+ riverrat riversid roadkill roadking roadrunn roadster robinson robotech robotics rochelle
6214
+ rockford rockhard rocknrol rockrock rockstar rockwell rolltide rootbeer rootedit rosemary
6215
+ rrrrrrrr rsalinas rt6ytere rush2112 rushmore russell1 rustydog sabrina1 sailboat salasana
6216
+ salesman salvador samadams samantha samsung1 sandberg sandiego sandrine sandwich sanity72
6217
+ santiago sapphire saratoga satan666 saturday sausages savannah save13tx saxophon scandinavian
6218
+ scarface scarlett scheisse scirocco scissors scoobydo scoobydoo scooter1 scorpio1 scorpion
6219
+ scotland scrabble scrapper screamer screwyou seahawks sealteam sebastia sebastian security
6220
+ seductive seinfeld seminole semperfi senators sentinel sentnece septembe september serenity
6221
+ sergeant services sexsexsex sexybabe sexygirl sexylady sexysexy shadow12 shamrock shanghai
6222
+ shannon1 sheepdog shepherd sheridan sherlock sherwood shitface shithead shitshit shopping
6223
+ showtime sickness sidekick sigmachi silverad simpsons sinclair singapor sinister sithlord
6224
+ sixtynin skeeter1 skinhead skipper1 skittles skydiver skywalke skywalker slamdunk slapnuts
6225
+ slapshot sleeping slimed123 slimshad slipknot slippery slowhand smackdow smartass smashing
6226
+ smeghead smirnoff smithers smoothie snapshot sneakers snickers sniffing snoopdog snowball
6227
+ snowbird snowboar snowboard snowflak snuggles soccer10 soccer11 soccer12 socrates softball
6228
+ softtail software solitude solution somerset somethin something sometime sonyfuck sonysony
6229
+ sooners1 sopranos soulmate southern southpar southpark southpaw spaceman spanking sparhawk
6230
+ sparkles spartan1 spartans speakers special1 specialk spectrum speedway spencer1 spiderma
6231
+ spiderman spitfire splinter spongebo sporting springer sprinter sprocket squerting squirrel
6232
+ srinivas ssptx452 ssssssss stafford stallion standard stanford stanley1 starbuck starcraf
6233
+ starcraft stardust starfire starfish stargate starligh starlite starship starstar startrek
6234
+ starwars steelers stefanie stephane stephani stephanie stephen1 stephens sterling stewart1
6235
+ stickman stiletto stingray stirling stocking stockton stonecol stonecold stonewal stoppedby
6236
+ straight stranger strawber streaming strength stripper suburban success1 suckcock suckdick
6237
+ sullivan summer69 summer99 sundance sundevil sunflowe sunlight sunnyday sunshine superfly
6238
+ superior superman supernov supersta superstar surprise surveyor survival survivor svetlana
6239
+ sweetnes sweetness sweetpea swimming swingers swinging swordfis swordfish sylveste syracuse
6240
+ tacobell tailgate takehana talisman tampabay tangerin tarheels tazmania technics techniques
6241
+ teddybea telephon temppass temptress tennesse terminal terminat terrapin test1234 testerer
6242
+ testibil testing1 testpass testtest thailand thanatos thankyou thedoors theforce thegreat
6243
+ thematri theodore therock1 thething thetruth thinking thirteen thisisit thompson thrasher
6244
+ threesom thriller thuglife thumbnils thumper1 thunder1 thunderb thursday tiberius tickling
6245
+ ticklish tiffany1 tiger123 tigercat tinkerbe titanium titleist tmjxn151 together tomahawk
6246
+ tommyboy tomorrow toonarmy toriamos tottenha tottenham touching trailers training transexual
6247
+ transfer traveler treasure treefrog triangle trinidad trinitro trinity1 trombone trooper1
6248
+ tropical trouble1 troubles trousers trucking trueblue truelove trumpet1 trustno1 tttttttt
6249
+ tunafish turkey50 twilight ultimate umbrella unbelievable uncencored underdog undertak
6250
+ undertaker undertow underwear universa universe university ursitesux username usmarine uuuuuuuu
6251
+ vacation vagabond valdepen valencia valentin valhalla valkyrie valleywa vampire1 vampires
6252
+ vancouve vanessa1 vanguard vanhalen vauxhall velocity verbatim veronica veronika verygood
6253
+ victoria viewsoni vikings1 vincent1 violator vipergts virginia virginie vivitron vladimir
6254
+ volkswag volleyba voyager1 vvvvvvvv wanderer wapapapa warcraft wareagle warhamme warrior1
6255
+ warriors washburn washingt washington watching waterboy waterfal waterloo waterman waterski
6256
+ webmaste webmaster wednesda wednesday welcome1 wellingt werewolf westside westwood wetpussy
6257
+ wg8e3wjf whatever whatwhat whiplash whiskers whistler whiteboy whiteout whitesox whocares
6258
+ wildbill wildcard wildcats wildfire wildstar wildwood william1 williams windmill windows1
6259
+ windsurf winfield wingchun winston1 winter99 wireless wishbone wolfgang wolfpack wolverin
6260
+ wolverine wonderboy wonderfu woodland woodstoc woodwork woofwoof wordpass wp2003wp wrangler
6261
+ wrestler wrestlin wrestling wrinkle1 wrinkle5 wwwwwwww xxxxxxx1 xxxxxxxx yamahar1 yankees1
6262
+ yankees2 yeahbaby yeahyeah year2005 yesterda yogibear yosemite yqlgr667 yvtte545 yy5rbfsc
6263
+ yyyyyyyy zachary1 zanzibar zaq12wsx zaq1xsw2 zeppelin zerocool zildjian zoomzoom zxcvbnm1
6264
+ zzzzzzzz
6265
+ `;
6266
+ var COMMON_PASSWORDS = new Set(LIST.split(/\s+/).filter(Boolean));
6267
+
6023
6268
  // src/localization.ts
6024
6269
  var ALL_LOCALES = "all";
6025
6270
  var isPlainObject2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
@@ -6373,6 +6618,10 @@ async function createEasyCMS(config, options = {}) {
6373
6618
  const cms = new EasyCMS(resolved3, db, logger, storage, cwd);
6374
6619
  const scheduling = [...resolved3.collections, ...resolved3.globals].some((c) => c.schedule) || (resolved3.webhooks?.length ?? 0) > 0 || resolved3.email !== void 0 || resolved3.jobs.length > 0;
6375
6620
  if (scheduling && options.scheduler !== false) cms.startScheduler();
6621
+ if (process.env.NODE_ENV === "production" && !resolved3.auth.setupCode && await cms.auth.hasUsers().catch(() => true) === false)
6622
+ logger.warn(
6623
+ "No admin exists yet and no setup code is set: whoever opens the admin first becomes the admin. Set EASY_CMS_SETUP_CODE, or create the admin with `easy-cms admin:create`."
6624
+ );
6376
6625
  return cms;
6377
6626
  }
6378
6627
  var toJob = (row) => ({
@@ -8712,6 +8961,11 @@ function splitPassword(config, raw) {
8712
8961
  { field: "password", message: `must be at least ${MIN_PASSWORD_LENGTH} characters` }
8713
8962
  ]);
8714
8963
  }
8964
+ if (COMMON_PASSWORDS.has(password.normalize("NFKC").toLowerCase())) {
8965
+ throw new ValidationError(USERS, [
8966
+ { field: "password", message: "is one of the most common passwords; choose another" }
8967
+ ]);
8968
+ }
8715
8969
  return { input, password };
8716
8970
  }
8717
8971
  function asObject(data, name) {
@@ -8788,7 +9042,7 @@ async function readAdminModule(cms, index) {
8788
9042
  }
8789
9043
 
8790
9044
  // src/version.ts
8791
- var VERSION = true ? "0.60.0" : "0.0.0-dev";
9045
+ var VERSION = true ? "0.62.0" : "0.0.0-dev";
8792
9046
 
8793
9047
  // src/rest/admin-deliveries.ts
8794
9048
  var PER_PAGE = 50;
@@ -9895,6 +10149,11 @@ async function route(cms, ctx, method, path, options) {
9895
10149
  if (first === "admin" && ctx.user?.member === true) throw new ForbiddenError();
9896
10150
  const authAction = third === void 0 && second !== void 0 ? first === "auth" && AUTH_ACTIONS.has(second) || first === USERS && !/^\d+$/.test(second) : false;
9897
10151
  if (first === "auth" && !authAction) return ssoRoute(cms, ctx, method, segments);
10152
+ if (authAction && first === USERS && second !== void 0 && AUTH_ACTIONS.has(second))
10153
+ warnDeprecated(
10154
+ "EASY_CMS_DEP001",
10155
+ `${method} <api>/users/${second} is now <api>/auth/${second}; the old path works through 1.x.`
10156
+ );
9898
10157
  if (authAction && second !== void 0) {
9899
10158
  switch (`${method} ${second}`) {
9900
10159
  case "POST login": {
@@ -10027,6 +10286,7 @@ async function route(cms, ctx, method, path, options) {
10027
10286
  if (!byCron && !isSystemAdmin(ctx.user)) {
10028
10287
  throw ctx.user ? new HttpError("Forbidden", 403) : new UnauthorizedError();
10029
10288
  }
10289
+ if (!byCron && ctx.via === "cookie" && method !== "POST") throw methodNotAllowed(ctx, "POST");
10030
10290
  return { body: await cms.runJobs() };
10031
10291
  }
10032
10292
  if (first === "admin" && second === "backups") {
@@ -10303,6 +10563,8 @@ async function route(cms, ctx, method, path, options) {
10303
10563
  return { body: await cms.findGlobal(second, { ...access, ...parseDepth(ctx.url), draft }) };
10304
10564
  }
10305
10565
  if (method === "PATCH" || method === "POST") {
10566
+ if (method === "POST")
10567
+ warnDeprecated("EASY_CMS_DEP002", "Globals are updated with PATCH; POST works through 1.x.");
10306
10568
  const body = await readJson(ctx.request);
10307
10569
  return { body: await cms.updateGlobal(second, body, { ...access, ...parseDepth(ctx.url) }) };
10308
10570
  }
@@ -10550,7 +10812,13 @@ function scheduleJob(body) {
10550
10812
  }
10551
10813
  function parseLocale(url) {
10552
10814
  const locale = url.searchParams.get("locale");
10553
- const fallback = url.searchParams.get("fallbackLocale") ?? url.searchParams.get("fallback-locale");
10815
+ const old = url.searchParams.get("fallback-locale");
10816
+ if (old !== null)
10817
+ warnDeprecated(
10818
+ "EASY_CMS_DEP003",
10819
+ "?fallback-locale= is now ?fallbackLocale=; the old name works through 1.x."
10820
+ );
10821
+ const fallback = url.searchParams.get("fallbackLocale") ?? old;
10554
10822
  return {
10555
10823
  ...locale ? { locale } : {},
10556
10824
  ...fallback === "false" || fallback === "true" ? { fallbackLocale: fallback === "true" } : {}
@@ -369,6 +369,23 @@ function defineConfig(config) {
369
369
  return config;
370
370
  }
371
371
 
372
+ // src/deprecation.ts
373
+ var KEY = /* @__PURE__ */ Symbol.for("easy-cms.deprecations");
374
+ function warned() {
375
+ const store = globalThis;
376
+ store[KEY] ??= /* @__PURE__ */ new Set();
377
+ return store[KEY];
378
+ }
379
+ function warnDeprecated(code, message) {
380
+ const seen = warned();
381
+ if (seen.has(code)) return;
382
+ seen.add(code);
383
+ const node = globalThis.process;
384
+ if (typeof node?.emitWarning === "function")
385
+ node.emitWarning(message, { type: "DeprecationWarning", code });
386
+ else console.warn(`[${code}] DeprecationWarning: ${message}`);
387
+ }
388
+
372
389
  // src/field-types.ts
373
390
  var FIELD_TYPE_BASES = [
374
391
  "text",
@@ -527,6 +544,7 @@ export {
527
544
  PLUGIN_API_VERSION,
528
545
  definePlugin,
529
546
  defineConfig,
547
+ warnDeprecated,
530
548
  FIELD_TYPE_BASES,
531
549
  defineFieldType,
532
550
  fieldTypeModules,
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { P as PaginatedDocs, I as ID, E as EmailSetting } from './config-jzFGsNL6.js';
2
2
  export { A as ADAPTER_API_VERSION, a as ADMIN_ICONS, b as Access, c as AccessArgs, d as AccessOptions, e as AdminBrand, f as AdminCommand, g as AdminComponent, h as AdminConfig, i as AdminFieldArgs, j as AdminIcon, k as AdminLocale, l as AdminPage, m as AdminRole, n as AdminRoleChange, o as AdminRoleField, p as AdminRoleTarget, q as AdminRoleView, r as AdminRoles, s as AdminSso, t as AdminSwitcher, u as AdminViewAccess, v as AfterChangeHook, w as AfterDeleteHook, x as AfterReadHook, y as ApiKeyContext, z as ApiKeyGlobalOperation, B as ApiKeyOperation, C as ApiKeyPermissions, D as ArrayField, F as AuditChange, G as AuditConfig, H as AuditEntry, J as AuditLog, K as AuditPage, L as AuditVerification, M as Auth, N as AuthConfig, O as AuthProvider, Q as AuthProviderProfile, R as AuthProviderRequest, S as AuthUser, T as BackupsConfig, U as BeforeChangeHook, V as BeforeDeleteHook, W as BeforeValidateHook, X as Block, Y as BlocksField, Z as BooleanField, _ as BuiltinApiKeysCollection, $ as BuiltinMediaCollection, a0 as BuiltinMediaFoldersCollection, a1 as BuiltinUsersCollection, a2 as BundleHints, a3 as CliCommand, a4 as CollectionAccess, a5 as CollectionAdmin, a6 as CollectionConfig, a7 as CollectionDocument, a8 as CollectionHooks, a9 as CollectionListAdmin, aa as CollectionSlug, ab as Config, ac as ConfigError, ad as ConfigIssue, ae as ContainerAdmin, af as CreateEasyCMSOptions, ag as CreateInput, ah as CreateMigrationResult, ai as CustomField, aj as CustomFieldTypes, ak as DashboardWidget, al as Database, am as DatabaseAdapter, an as DatabaseInitArgs, ao as DatabaseTransfer, ap as DateField, aq as DepthOptions, ar as DirectUpload, as as DiskStorageOptions, at as DocumentOf, au as EasyCMS, av as EasyCMSError, aw as EmailAdapter, ax as EmailField, ay as EmailMessage, az as Endpoint, aA as EndpointRequest, aB as ErrorCode, aC as FIELD_TYPES, aD as Field, aE as FieldAccess, aF as FieldAccessFn, aG as FieldAdmin, aH as FieldError, aI as FieldRule, aJ as FieldType, aK as FieldTypeBase, aL as FieldTypeDefinition, aM as FieldTypeValidateContext, aN as FieldValidate, aO as FieldValidateContext, aP as FieldValue, aQ as FieldsInput, aR as FieldsValue, aS as FilterOptions, aT as FilterOptionsArgs, aU as FindArgs, aV as FindOptions, aW as FolderLevel, aX as FolderPermissions, aY as ForbiddenError, aZ as GlobalAccess, a_ as GlobalConfig, a$ as GlobalDocument, b0 as GlobalHooks, b1 as GlobalInput, b2 as GlobalSlug, b3 as GroupField, b4 as ImageSize, b5 as IncrementOptions, b6 as InferCollection, b7 as InferGlobal, b8 as JobConfig, b9 as JsonField, ba as Label, bb as LayoutNode, bc as LivePreview, bd as LocalizationConfig, be as Logger, bf as LoginArgs, bg as MediaDocument, bh as MediaSize, bi as MembersConfig, bj as MembersSignup, bk as MigrationInfo, bl as NavGroup, bm as NotFoundError, bn as NumberField, bo as OnRequest, bp as OnRequestArgs, bq as Operation, br as PLUGIN_API_VERSION, bs as PasswordEmail, bt as PasswordEmailArgs, bu as PasswordEmailFn, bv as PasswordLinkOptions, bw as PayloadTooLargeError, bx as Plugin, by as PluginInfo, bz as PluginTypes, bA as PreviewTarget, bB as PreviewURL, bC as QueryError, bD as ROLE_OPERATIONS, bE as RawDocument, bF as ReadOptions, bG as RelationshipField, bH as RequestContext, bI as ResolvedConfig, bJ as RichTextDocument, bK as RichTextField, bL as Role, bM as RoleOperation, bN as RolePermissions, bO as Roles, bP as RoutesConfig, bQ as ScheduledPublish, bR as SchemaError, bS as SchemaMode, bT as SelectField, bU as SelectOption, bV as Session, bW as SidebarPanel, bX as SignupArgs, bY as SignupResult, bZ as SingleSignOn, b_ as SlugField, b$ as SlugOf, c0 as SsoOutcome, c1 as SsoProviderRef, c2 as StorageAdapter, c3 as StoredFile, c4 as TextField, c5 as TextareaField, c6 as TooManyRequestsError, c7 as TypedPlugin, c8 as UnauthorizedError, c9 as UpdateInput, ca as UpdateOptions, cb as UploadConfig, cc as UploadField, cd as UploadFromURLConfig, ce as UserIdentity, cf as ValidationError, cg as Version, ch as VersionSummary, ci as VersionsConfig, cj as WEBHOOK_EVENTS, ck as WebhookConfig, cl as WebhookEvent, cm as WebhookPayload, cn as Where, co as WhereOperators, cp as anyone, cq as consoleEmail, cr as consoleLogger, cs as createEasyCMS, ct as defineConfig, cu as defineFieldType, cv as definePlugin, cw as diskStorage, cx as hasRows, cy as isAdmin, cz as isHasMany, cA as isSignedIn, cB as isStaff, cC as isSystemAdmin, cD as mimeAllowedBy, cE as rowFields, cF as silentLogger, cG as uniqueWithinOf } from './config-jzFGsNL6.js';
3
- export { A as ADMIN_API_VERSION, a as AdminCollection, b as AdminComponentRef, c as AdminElementProps, d as AdminField, e as AdminGlobal, f as AdminLayoutNode, g as AdminNavGroup, h as AdminNavItem, i as AdminNavNode, j as AdminPageRef, k as AdminPageRoute, l as AdminSchema, m as AdminWidgetRef, S as SetFieldDetail } from './plugin-EX9OHwR3.js';
3
+ export { A as ADMIN_API_VERSION, a as AdminCollection, b as AdminComponentRef, c as AdminElementProps, d as AdminField, e as AdminGlobal, f as AdminLayoutNode, g as AdminNavGroup, h as AdminNavItem, i as AdminNavNode, j as AdminPageRef, k as AdminPageRoute, l as AdminSchema, m as AdminWidgetRef, S as SetFieldDetail, w as warnDeprecated } from './plugin-C19Bt8ux.js';
4
4
  export { A as AdminBackup, a as AdminBackups, b as ApiHandlerOptions, B as BackupState, L as LoadConfigOptions, R as RestHandler, c as RestHandlerOptions, d as createApiHandler, e as createRestHandler, l as loadConfig, r as resolveConfig, s as sharedEasyCMS, f as slugify } from './handler-CMA1LIq7.js';
5
5
  export { FieldCondition, matchesCondition } from './conditions.js';
6
6
 
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  sharedEasyCMS,
24
24
  silentLogger,
25
25
  slugify
26
- } from "./chunk-S2AJVHR4.js";
26
+ } from "./chunk-CX7R6QBJ.js";
27
27
  import {
28
28
  matchesCondition
29
29
  } from "./chunk-U266LV4M.js";
@@ -46,8 +46,9 @@ import {
46
46
  ValidationError,
47
47
  defineConfig,
48
48
  defineFieldType,
49
- definePlugin
50
- } from "./chunk-CGVNZUW4.js";
49
+ definePlugin,
50
+ warnDeprecated
51
+ } from "./chunk-FPFWLQB5.js";
51
52
  export {
52
53
  ADAPTER_API_VERSION,
53
54
  ADMIN_API_VERSION,
@@ -90,5 +91,6 @@ export {
90
91
  resolveConfig,
91
92
  sharedEasyCMS,
92
93
  silentLogger,
93
- slugify
94
+ slugify,
95
+ warnDeprecated
94
96
  };
package/dist/internal.js CHANGED
@@ -52,7 +52,7 @@ import {
52
52
  verifyPassword,
53
53
  verifyTurnstile,
54
54
  writeBackupFile
55
- } from "./chunk-S2AJVHR4.js";
55
+ } from "./chunk-CX7R6QBJ.js";
56
56
  import {
57
57
  conditionIssues
58
58
  } from "./chunk-U266LV4M.js";
@@ -70,7 +70,7 @@ import {
70
70
  rowFields,
71
71
  sniffMimeType,
72
72
  uniqueWithinOf
73
- } from "./chunk-CGVNZUW4.js";
73
+ } from "./chunk-FPFWLQB5.js";
74
74
 
75
75
  // src/typegen.ts
76
76
  var pascal = (name) => name.split(/[^A-Za-z0-9]+/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
@@ -323,4 +323,18 @@ interface SetFieldDetail {
323
323
  readonly value: unknown;
324
324
  }
325
325
 
326
- export { ADMIN_API_VERSION as A, type SetFieldDetail as S, type AdminCollection as a, type AdminComponentRef as b, type AdminElementProps as c, type AdminField as d, type AdminGlobal as e, type AdminLayoutNode as f, type AdminNavGroup as g, type AdminNavItem as h, type AdminNavNode as i, type AdminPageRef as j, type AdminPageRoute as k, type AdminSchema as l, type AdminWidgetRef as m };
326
+ /**
327
+ * Logs that something deprecated was used, once per `code` and process. On Node.js it is a
328
+ * `DeprecationWarning` (`process.emitWarning`), so `--no-deprecation` hides it,
329
+ * `--throw-deprecation` turns it into an error and `--trace-deprecation` shows where it came
330
+ * from; elsewhere `console.warn`.
331
+ *
332
+ * Plugins use codes of their own, e.g. `ACME_SEO_DEP001`.
333
+ *
334
+ * ```ts
335
+ * warnDeprecated('ACME_DEP001', '`acmePlugin({ key })` is now `apiKey`; `key` goes in 2.0.')
336
+ * ```
337
+ */
338
+ declare function warnDeprecated(code: string, message: string): void;
339
+
340
+ export { ADMIN_API_VERSION as A, type SetFieldDetail as S, type AdminCollection as a, type AdminComponentRef as b, type AdminElementProps as c, type AdminField as d, type AdminGlobal as e, type AdminLayoutNode as f, type AdminNavGroup as g, type AdminNavItem as h, type AdminNavNode as i, type AdminPageRef as j, type AdminPageRoute as k, type AdminSchema as l, type AdminWidgetRef as m, warnDeprecated as w };
package/dist/plugin.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { a as ADMIN_ICONS, g as AdminComponent, j as AdminIcon, S as AuthUser, a3 as CliCommand, a4 as CollectionAccess, a6 as CollectionConfig, ab as Config, ac as ConfigError, ak as DashboardWidget, av as EasyCMSError, az as Endpoint, aA as EndpointRequest, aB as ErrorCode, aD as Field, aE as FieldAccess, aH as FieldError, aK as FieldTypeBase, aL as FieldTypeDefinition, aM as FieldTypeValidateContext, aY as ForbiddenError, a_ as GlobalConfig, I as ID, b8 as JobConfig, ba as Label, bl as NavGroup, bm as NotFoundError, bo as OnRequest, bp as OnRequestArgs, br as PLUGIN_API_VERSION, bw as PayloadTooLargeError, bx as Plugin, by as PluginInfo, bz as PluginTypes, bC as QueryError, bH as RequestContext, c6 as TooManyRequestsError, c7 as TypedPlugin, c8 as UnauthorizedError, cf as ValidationError, cn as Where, cu as defineFieldType, cv as definePlugin } from './config-jzFGsNL6.js';
2
- export { A as ADMIN_API_VERSION, c as AdminElementProps, k as AdminPageRoute, S as SetFieldDetail } from './plugin-EX9OHwR3.js';
2
+ export { A as ADMIN_API_VERSION, c as AdminElementProps, k as AdminPageRoute, S as SetFieldDetail, w as warnDeprecated } from './plugin-C19Bt8ux.js';
3
3
  import './conditions.js';
package/dist/plugin.js CHANGED
@@ -14,8 +14,9 @@ import {
14
14
  UnauthorizedError,
15
15
  ValidationError,
16
16
  defineFieldType,
17
- definePlugin
18
- } from "./chunk-CGVNZUW4.js";
17
+ definePlugin,
18
+ warnDeprecated
19
+ } from "./chunk-FPFWLQB5.js";
19
20
  export {
20
21
  ADMIN_API_VERSION,
21
22
  ADMIN_ICONS,
@@ -30,5 +31,6 @@ export {
30
31
  UnauthorizedError,
31
32
  ValidationError,
32
33
  defineFieldType,
33
- definePlugin
34
+ definePlugin,
35
+ warnDeprecated
34
36
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-cms/core",
3
- "version": "0.60.0",
3
+ "version": "0.62.0",
4
4
  "description": "Embedded, code-first headless CMS for Nuxt and Next.js",
5
5
  "license": "MIT",
6
6
  "type": "module",