omegga 1.17.2 → 1.18.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 (42) hide show
  1. package/README.md +7 -6
  2. package/dist/db/migrations/0001_shocking_the_captain.sql +4 -0
  3. package/dist/db/migrations/meta/0001_snapshot.json +753 -0
  4. package/dist/db/migrations/meta/_journal.json +7 -0
  5. package/dist/db/schema.js +10 -1
  6. package/dist/db/schema.js.map +1 -1
  7. package/dist/omegga/server.js +6 -4
  8. package/dist/omegga/server.js.map +1 -1
  9. package/dist/plugin.js.map +1 -1
  10. package/dist/webserver/backend/chatQuery.js +98 -0
  11. package/dist/webserver/backend/chatQuery.js.map +1 -0
  12. package/dist/webserver/backend/database.js +270 -5
  13. package/dist/webserver/backend/database.js.map +1 -1
  14. package/dist/webserver/backend/router/chat.js +21 -0
  15. package/dist/webserver/backend/router/chat.js.map +1 -1
  16. package/dist/webserver/backend/router/player.js +1 -0
  17. package/dist/webserver/backend/router/player.js.map +1 -1
  18. package/package.json +4 -3
  19. package/public/app.html +291 -48
  20. package/public/assets/IconShieldCheck-e9eEH-KF.js +2 -0
  21. package/public/assets/{IconWorld-DgiOjCuo.js → IconWorld-CMSFtQg-.js} +2 -2
  22. package/public/assets/IconWorldPlus-B3tINWGI.js +2 -0
  23. package/public/assets/IconX-Dnl42MJL.js +2 -0
  24. package/public/assets/app-Dfcj6I4Z.js +7 -0
  25. package/public/assets/auth-CNs90huc.js +2 -0
  26. package/public/assets/{index-B0LowBt1.js → index-B6mWKnn3.js} +2 -2
  27. package/public/assets/index-C6nSzQey.js +12 -0
  28. package/public/assets/{index-2cgXLhrt.js → index-NK6TBVas.js} +2 -2
  29. package/public/assets/shared/@components-DxLSzrzW.js +2 -0
  30. package/public/assets/shared/{@hooks-DlZ8TOOZ.js → @hooks-Df79JLiI.js} +2 -2
  31. package/public/assets/shared/@tabler_icons-react-CM_Q7eQ6.js +3 -0
  32. package/public/assets/shared/wouter-CPV7_rSk.js +2 -0
  33. package/public/auth.html +80 -5
  34. package/public/assets/IconShieldCheck-Bjlm8mX2.js +0 -2
  35. package/public/assets/IconWorldPlus-DJJNrT87.js +0 -2
  36. package/public/assets/IconX-CvmO0bbE.js +0 -2
  37. package/public/assets/app-Mh--ChqF.js +0 -7
  38. package/public/assets/auth-DQtYicf-.js +0 -2
  39. package/public/assets/index-BTSbuqTr.js +0 -12
  40. package/public/assets/shared/@components-DBMXoJMT.js +0 -2
  41. package/public/assets/shared/@tabler_icons-react-i-Q2c_A_.js +0 -3
  42. package/public/assets/shared/wouter-CUC1caxu.js +0 -2
@@ -0,0 +1,2 @@
1
+ import{c as F}from"./client-BT1QYH0O.js";import{_ as U,I as J,a as M,b as W}from"./IconShieldCheck-e9eEH-KF.js";import{j as e}from"./jsx-runtime-BX5r4UiA.js";import{r as t}from"./index-CrN8I5Az.js";import{B as H,M as z,H as b,P as S,I as x,F as I,a as c,L as K}from"./index-B6mWKnn3.js";import{I as P}from"./IconX-Dnl42MJL.js";import V from"./IconLockOpen-Bs7Tsf6u.js";import"./index-D0OPOe3j.js";import"./index-CtCtK5BX.js";import"./IconCheck-DOe3u7iH.js";import"./jsx-runtime-DldvXD6N.js";import"./_commonjsHelpers-CE1G-McA.js";import"./shared/@nanostores_react-DJPF1Eqx.js";import"./index-CJ4e7_2M.js";import"./index-CSV4ZXsq.js";const $="/assets/turkey-BW4gu-4u.webp",q=typeof window<"u"&&!!window.PublicKeyCredential&&(location.protocol==="https:"||location.hostname==="localhost"),D=()=>{const[v,s]=t.useState(!0),[r,R]=t.useState(!0),[g,A]=t.useState("login"),[h,o]=t.useState(""),[i,E]=t.useState(""),[n,O]=t.useState(""),[p,T]=t.useState(""),[l,w]=t.useState(""),[m,L]=t.useState(!1);t.useEffect(()=>{fetch("/api/v1/first").then(a=>a.json()).then(a=>{R(a),s(!1)})},[]);const d=t.useCallback(async(a,u)=>{s(!0),o("");try{const y=await fetch("/api/v1/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a,password:u})}),j=await y.json();y.status===200?j.mfaRequired?(A("mfa-totp"),s(!1)):location.reload():(o(j.message||"Authentication failed"),s(!1))}catch{o("Connection failed"),s(!1)}},[]),C=t.useCallback(async()=>{s(!0),o("");try{const a=await fetch("/api/v1/auth/mfa/totp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:l})});if(a.status===200)location.reload();else{const u=await a.json();o(u.message||"Invalid code"),s(!1)}}catch{o("Connection failed"),s(!1)}},[l]),N=t.useCallback(async()=>{s(!0),o("");try{const u=await(await fetch("/api/v1/auth/webauthn/options")).json(),{startAuthentication:y}=await U(async()=>{const{startAuthentication:B}=await import("./index-BDkarAkX.js");return{startAuthentication:B}},[]),j=await y({optionsJSON:u});(await fetch("/api/v1/auth/webauthn/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({credential:j})})).status===200?location.reload():(o("Passkey verification failed"),s(!1))}catch(a){if(a?.name==="NotAllowedError"){s(!1);return}o("Passkey authentication failed"),s(!1)}},[]),k=i.length===0&&n.length===0,f=i.match(/^\w{0,32}$/)&&!k,_=t.useMemo(()=>({top:`${Math.random()*50+25}%`}),[]);return e.jsxs("div",{children:[e.jsx(H,{children:e.jsx("div",{className:"turkey",style:_,children:e.jsx("img",{src:$})})}),e.jsxs(z,{visible:!v,children:[g==="login"&&e.jsxs(e.Fragment,{children:[e.jsx(b,{attached:!0,children:"Brickadia Server Login"}),e.jsxs(S,{children:[e.jsx("p",{children:"Welcome to the Omegga Web UI."}),r&&e.jsx("p",{children:"Enter credentials for an Admin user. You can also skip this step if you don't want to use a password."}),h&&e.jsx("p",{style:{color:"#f66",textTransform:"capitalize"},children:h})]}),e.jsxs("div",{className:"popout-inputs",children:[e.jsx(x,{placeholder:"Username",type:"text",value:i,onChange:E}),e.jsx(x,{placeholder:"Password",type:"password",value:n,onChange:O,onSubmit:!r&&f?()=>d(i,n):void 0}),r&&e.jsx(x,{placeholder:"Confirm Password",type:"password",value:p,onChange:T,onSubmit:f&&p===n?()=>d(i,n):void 0})]}),e.jsxs(I,{attached:!0,children:[r&&e.jsxs(c,{main:!0,disabled:!f||p!==n,onClick:()=>d(i,n),children:[e.jsx(P,{})," Create"]}),!r&&e.jsxs(c,{main:!0,disabled:!f,onClick:()=>d(i,n),children:[e.jsx(P,{})," Login"]}),e.jsx("div",{style:{flex:1}}),!r&&q&&e.jsxs(c,{normal:!0,onClick:N,children:[e.jsx(J,{})," Passkey"]}),r&&e.jsxs(c,{warn:!0,disabled:!k||p!==n,onClick:()=>d("",""),children:[e.jsx(V,{})," Skip"]})]})]}),g==="mfa-totp"&&e.jsxs(e.Fragment,{children:[e.jsx(b,{attached:!0,children:"Two-Factor Authentication"}),e.jsxs(S,{children:[e.jsx("p",{children:m?"Enter a recovery code to sign in.":"Enter the 6-digit code from your authenticator app."}),h&&e.jsx("p",{style:{color:"#f66"},children:h})]}),e.jsx("div",{className:"popout-inputs",children:e.jsx(x,{placeholder:m?"Recovery code":"000000",type:"text",value:l,onChange:w,onSubmit:l?C:void 0})}),e.jsxs(I,{attached:!0,children:[e.jsxs(c,{main:!0,disabled:!l,onClick:C,children:[e.jsx(M,{})," Verify"]}),e.jsx("div",{style:{flex:1}}),e.jsxs(c,{normal:!0,onClick:()=>{L(!m),w(""),o("")},children:[e.jsx(W,{}),m?"Use app":"Use recovery code"]})]})]}),e.jsx(K,{active:v,blur:!0,size:"huge",children:e.jsx("b",{children:"AUTHORIZING"})})]})]})};F.createRoot(document.getElementById("root")).render(e.jsx(D,{}));
2
+ //# sourceMappingURL=auth-CNs90huc.js.map
@@ -1,2 +1,2 @@
1
- import{j as s}from"./jsx-runtime-BX5r4UiA.js";import{useStore as x}from"./shared/@nanostores_react-DJPF1Eqx.js";import{a as j}from"./index-CSV4ZXsq.js";import{I as p,a as g}from"./IconX-CvmO0bbE.js";import{r as h}from"./index-CrN8I5Az.js";import{I as b}from"./IconCheck-DOe3u7iH.js";const N=j(null),k=j(null),$="/assets/dark_bg-uu5tZDxN.webp",C="/assets/auth_bg-DJZN1T-H.webp",_=({children:e})=>{const a=x(N),r=x(k);return s.jsxs("div",{className:"background",children:[s.jsx("img",{className:"bg-img dark",src:$}),s.jsx("img",{className:"bg-img light",src:C}),a&&s.jsxs("div",{className:"version",children:["Omegga v",a,r!=null&&r>0&&s.jsxs(s.Fragment,{children:[" Brickadia CL",r]})]}),e]})},v=({children:e,warn:a,main:r,error:o,info:n,normal:t,disabled:c=!1,icon:i,boxy:d,onClick:m,className:u,...l})=>s.jsx("div",{className:["button",u??"",a&&"warn",r&&"main",o&&"error",n&&"info",t&&"normal",c&&"disabled",d&&"boxy",i&&"icon"].filter(Boolean).join(" "),onClick:m,...l,children:s.jsx("div",{className:"button-content",children:e})}),w=({children:e,className:a,attached:r,...o})=>s.jsx("div",{className:`footer ${r?"attached":""} ${a??""}`,...o,children:e}),y=({children:e,className:a,attached:r,...o})=>s.jsx("div",{className:`header ${r?"attached":""} ${a??""}`,...o,children:e});function z({placeholder:e,tooltip:a,disabled:r,type:o="text",value:n,roboto:t,onBlur:c,onFocus:i,onSubmit:d,onChange:m,...u}){return s.jsx("div",{className:`input ${r?"disabled":""} ${t?"roboto":""}`,"data-tooltip":a,children:s.jsx("input",{spellCheck:"false",type:o,placeholder:e,disabled:r,value:n,onChange:l=>{const f=o==="number"?Number(l.target.value):l.target.value;m&&m(f)},onKeyDown:d?l=>{l.key==="Enter"&&(l.preventDefault(),d())}:void 0,onBlur:c,onFocus:i,...u})})}function A({placeholder:e,disabled:a,value:r,rows:o=3,onChange:n,...t}){return s.jsx("div",{className:`input ${a?"disabled":""}`,children:s.jsx("textarea",{spellCheck:"false",placeholder:e,disabled:a,value:r,rows:o,onChange:c=>n?.(c.target.value),...t})})}const B={small:"24",normal:"30",huge:"60",massive:"120"},M=({children:e,onClick:a,blur:r,active:o=!0,inline:n=!1,size:t="normal"})=>s.jsx("div",{className:`loader ${o?"active":""} ${n?"inline":""}`,onClick:a,children:s.jsxs("div",{className:`loader-container ${r?"blur":""}`,children:[s.jsx(p,{className:"loader-icon",size:B[t]}),s.jsx("div",{children:e})]})}),I=({visible:e,children:a})=>s.jsx("div",{className:`dimmer ${e?"visible":""}`,children:s.jsx("div",{className:"dimmer-content",children:a})}),D=({children:e})=>s.jsx("div",{className:"popout-content",children:e}),L=({visible:e,children:a})=>s.jsx("div",{className:`modal ${e?"visible":""}`,children:s.jsx("div",{className:"modal-content",children:a})}),Z=({leftButton:e,rightButton:a,title:r,content:o}={})=>{const[n,t]=h.useState({show:!1,message:"",children:null,resolve:i=>{}});return{prompt:h.useCallback(i=>new Promise(d=>{t({message:typeof i=="string"?i:"",children:typeof i!="string"&&i?i:null,show:!0,resolve(m){d(m),t({show:!1,message:"",children:null,resolve:()=>{}})}})}),[]),children:s.jsx(I,{visible:n.show,children:s.jsxs(L,{visible:!0,children:[s.jsx(y,{attached:!0,children:r??"Confirmation"}),s.jsx(D,{children:o??n.children??s.jsxs("p",{children:["Are you sure you want to ",n.message,"?"]})}),s.jsxs(w,{attached:!0,children:[e?.(n.resolve)??s.jsxs(v,{main:!0,onClick:()=>n.resolve(!0),children:[s.jsx(b,{}),"Yes"]}),s.jsx("div",{style:{flex:1}}),a?.(n.resolve)??s.jsxs(v,{normal:!0,onClick:()=>n.resolve(!1),children:[s.jsx(g,{}),"No"]})]})]})})}};export{N as $,_ as B,I as D,w as F,y as H,z as I,M as L,L as M,D as P,A as T,v as a,k as b,Z as u};
2
- //# sourceMappingURL=index-B0LowBt1.js.map
1
+ import{j as s}from"./jsx-runtime-BX5r4UiA.js";import{useStore as x}from"./shared/@nanostores_react-DJPF1Eqx.js";import{a as j}from"./index-CSV4ZXsq.js";import{a as p,b as g}from"./IconX-Dnl42MJL.js";import{r as h}from"./index-CrN8I5Az.js";import{I as b}from"./IconCheck-DOe3u7iH.js";const N=j(null),k=j(null),$="/assets/dark_bg-uu5tZDxN.webp",C="/assets/auth_bg-DJZN1T-H.webp",_=({children:e})=>{const a=x(N),r=x(k);return s.jsxs("div",{className:"background",children:[s.jsx("img",{className:"bg-img dark",src:$}),s.jsx("img",{className:"bg-img light",src:C}),a&&s.jsxs("div",{className:"version",children:["Omegga v",a,r!=null&&r>0&&s.jsxs(s.Fragment,{children:[" Brickadia CL",r]})]}),e]})},v=({children:e,warn:a,main:r,error:o,info:n,normal:t,disabled:c=!1,icon:i,boxy:d,onClick:m,className:u,...l})=>s.jsx("div",{className:["button",u??"",a&&"warn",r&&"main",o&&"error",n&&"info",t&&"normal",c&&"disabled",d&&"boxy",i&&"icon"].filter(Boolean).join(" "),onClick:m,...l,children:s.jsx("div",{className:"button-content",children:e})}),w=({children:e,className:a,attached:r,...o})=>s.jsx("div",{className:`footer ${r?"attached":""} ${a??""}`,...o,children:e}),y=({children:e,className:a,attached:r,...o})=>s.jsx("div",{className:`header ${r?"attached":""} ${a??""}`,...o,children:e});function z({placeholder:e,tooltip:a,disabled:r,type:o="text",value:n,roboto:t,onBlur:c,onFocus:i,onSubmit:d,onChange:m,...u}){return s.jsx("div",{className:`input ${r?"disabled":""} ${t?"roboto":""}`,"data-tooltip":a,children:s.jsx("input",{spellCheck:"false",type:o,placeholder:e,disabled:r,value:n,onChange:l=>{const f=o==="number"?Number(l.target.value):l.target.value;m&&m(f)},onKeyDown:d?l=>{l.key==="Enter"&&(l.preventDefault(),d())}:void 0,onBlur:c,onFocus:i,...u})})}function A({placeholder:e,disabled:a,value:r,rows:o=3,onChange:n,...t}){return s.jsx("div",{className:`input ${a?"disabled":""}`,children:s.jsx("textarea",{spellCheck:"false",placeholder:e,disabled:a,value:r,rows:o,onChange:c=>n?.(c.target.value),...t})})}const B={small:"24",normal:"30",huge:"60",massive:"120"},M=({children:e,onClick:a,blur:r,active:o=!0,inline:n=!1,size:t="normal"})=>s.jsx("div",{className:`loader ${o?"active":""} ${n?"inline":""}`,onClick:a,children:s.jsxs("div",{className:`loader-container ${r?"blur":""}`,children:[s.jsx(p,{className:"loader-icon",size:B[t]}),s.jsx("div",{children:e})]})}),D=({visible:e,children:a})=>s.jsx("div",{className:`dimmer ${e?"visible":""}`,children:s.jsx("div",{className:"dimmer-content",children:a})}),I=({children:e})=>s.jsx("div",{className:"popout-content",children:e}),L=({visible:e,children:a})=>s.jsx("div",{className:`modal ${e?"visible":""}`,children:s.jsx("div",{className:"modal-content",children:a})}),Z=({leftButton:e,rightButton:a,title:r,content:o}={})=>{const[n,t]=h.useState({show:!1,message:"",children:null,resolve:i=>{}});return{prompt:h.useCallback(i=>new Promise(d=>{t({message:typeof i=="string"?i:"",children:typeof i!="string"&&i?i:null,show:!0,resolve(m){d(m),t({show:!1,message:"",children:null,resolve:()=>{}})}})}),[]),children:s.jsx(D,{visible:n.show,children:s.jsxs(L,{visible:!0,children:[s.jsx(y,{attached:!0,children:r??"Confirmation"}),s.jsx(I,{children:o??n.children??s.jsxs("p",{children:["Are you sure you want to ",n.message,"?"]})}),s.jsxs(w,{attached:!0,children:[e?.(n.resolve)??s.jsxs(v,{main:!0,onClick:()=>n.resolve(!0),children:[s.jsx(b,{}),"Yes"]}),s.jsx("div",{style:{flex:1}}),a?.(n.resolve)??s.jsxs(v,{normal:!0,onClick:()=>n.resolve(!1),children:[s.jsx(g,{}),"No"]})]})]})})}};export{N as $,_ as B,D,w as F,y as H,z as I,M as L,L as M,I as P,A as T,v as a,k as b,Z as u};
2
+ //# sourceMappingURL=index-B6mWKnn3.js.map