gemi 0.54.3 → 0.54.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/index.js +2 -2
- package/dist/app/index.js.map +1 -1
- package/dist/bun/plugin.js +2 -2
- package/dist/bun/plugin.js.map +1 -1
- package/dist/bun/preload.js +2 -2
- package/dist/bun/preload.js.map +2 -2
- package/dist/chunk-1312a1t4.js +4 -0
- package/dist/{chunk-r9z5rrk0.js.map → chunk-1312a1t4.js.map} +2 -2
- package/dist/{chunk-9taz1h3t.js → chunk-1psx59jt.js} +2 -2
- package/dist/{chunk-9taz1h3t.js.map → chunk-1psx59jt.js.map} +1 -1
- package/dist/chunk-2s75crt8.js +4 -0
- package/dist/{chunk-07t0dmdg.js.map → chunk-2s75crt8.js.map} +2 -2
- package/dist/chunk-2zyharpa.js +4 -0
- package/dist/{chunk-hk067634.js.map → chunk-2zyharpa.js.map} +2 -2
- package/dist/chunk-35j03vge.js +4 -0
- package/dist/{chunk-br8ten26.js.map → chunk-35j03vge.js.map} +2 -2
- package/dist/chunk-3njyfdj5.js +19 -0
- package/dist/chunk-3njyfdj5.js.map +60 -0
- package/dist/chunk-4n0xx0y6.js +66 -0
- package/dist/{chunk-tpyhhdq5.js.map → chunk-4n0xx0y6.js.map} +4 -54
- package/dist/{chunk-gn9zjgep.js → chunk-5ad8era8.js} +2 -2
- package/dist/{chunk-gn9zjgep.js.map → chunk-5ad8era8.js.map} +1 -1
- package/dist/{chunk-50vm7x98.js → chunk-6c5xkj0z.js} +2 -2
- package/dist/{chunk-50vm7x98.js.map → chunk-6c5xkj0z.js.map} +1 -1
- package/dist/chunk-6yy92txx.js +9 -0
- package/dist/{chunk-k8endm5j.js.map → chunk-6yy92txx.js.map} +6 -6
- package/dist/chunk-796pyrm9.js +4 -0
- package/dist/{chunk-1snh7yc4.js.map → chunk-796pyrm9.js.map} +2 -2
- package/dist/chunk-876p591d.js +5 -0
- package/dist/chunk-876p591d.js.map +13 -0
- package/dist/chunk-95t14jaw.js +13 -0
- package/dist/chunk-95t14jaw.js.map +222 -0
- package/dist/{chunk-kz39hphm.js → chunk-97rcmaps.js} +3 -3
- package/dist/{chunk-kz39hphm.js.map → chunk-97rcmaps.js.map} +1 -1
- package/dist/{chunk-c22vcxty.js → chunk-9agd5hjw.js} +2 -2
- package/dist/{chunk-c22vcxty.js.map → chunk-9agd5hjw.js.map} +2 -2
- package/dist/chunk-9wrbnr38.js +4 -0
- package/dist/{chunk-c0wcsmpj.js.map → chunk-9wrbnr38.js.map} +2 -2
- package/dist/{chunk-sqp7kn7h.js → chunk-a1h4paj1.js} +3 -3
- package/dist/{chunk-sqp7kn7h.js.map → chunk-a1h4paj1.js.map} +1 -1
- package/dist/{chunk-r06rxn19.js → chunk-b5mc1st9.js} +2 -2
- package/dist/{chunk-r06rxn19.js.map → chunk-b5mc1st9.js.map} +1 -1
- package/dist/chunk-c6qxw3v9.js +5 -0
- package/dist/{chunk-f13f68c0.js.map → chunk-c6qxw3v9.js.map} +2 -2
- package/dist/{chunk-113khwbw.js → chunk-cbqrkfjm.js} +2 -2
- package/dist/{chunk-113khwbw.js.map → chunk-cbqrkfjm.js.map} +1 -1
- package/dist/{chunk-jp4pf3yt.js → chunk-dngwctnt.js} +4 -4
- package/dist/{chunk-jp4pf3yt.js.map → chunk-dngwctnt.js.map} +2 -2
- package/dist/{chunk-f418jh9k.js → chunk-ejrcyzx8.js} +2 -2
- package/dist/{chunk-f418jh9k.js.map → chunk-ejrcyzx8.js.map} +1 -1
- package/dist/chunk-h3b0v3bz.js +4 -0
- package/dist/{chunk-4qkzdyj7.js.map → chunk-h3b0v3bz.js.map} +1 -1
- package/dist/{chunk-jb022m7n.js → chunk-hg9y6ctt.js} +2 -2
- package/dist/{chunk-jb022m7n.js.map → chunk-hg9y6ctt.js.map} +1 -1
- package/dist/chunk-j15ewww3.js +5 -0
- package/dist/{chunk-2pt6kyn9.js.map → chunk-j15ewww3.js.map} +2 -2
- package/dist/{chunk-zckj6bs6.js → chunk-j3tzdcz7.js} +3 -3
- package/dist/{chunk-zckj6bs6.js.map → chunk-j3tzdcz7.js.map} +1 -1
- package/dist/chunk-jq46m17j.js +5 -0
- package/dist/{chunk-efsk1wy0.js.map → chunk-jq46m17j.js.map} +2 -2
- package/dist/{chunk-pgjk5ft3.js → chunk-k5jvafmh.js} +1 -1
- package/dist/chunk-kckva77b.js +5 -0
- package/dist/{chunk-dxw8k6f1.js.map → chunk-kckva77b.js.map} +2 -2
- package/dist/{chunk-cz3szqhq.js → chunk-ke6tsnx1.js} +2 -2
- package/dist/{chunk-cz3szqhq.js.map → chunk-ke6tsnx1.js.map} +1 -1
- package/dist/{chunk-jjvnmyw4.js → chunk-kz5zcw6s.js} +2 -2
- package/dist/{chunk-jjvnmyw4.js.map → chunk-kz5zcw6s.js.map} +2 -2
- package/dist/{chunk-h7mcwfg5.js → chunk-nakfv7pa.js} +4 -4
- package/dist/{chunk-h7mcwfg5.js.map → chunk-nakfv7pa.js.map} +2 -2
- package/dist/chunk-nph4mm6k.js +4 -0
- package/dist/{chunk-jb2nst6v.js.map → chunk-nph4mm6k.js.map} +2 -2
- package/dist/{chunk-dwx2y7br.js → chunk-r07s2p1z.js} +4 -4
- package/dist/{chunk-dwx2y7br.js.map → chunk-r07s2p1z.js.map} +2 -2
- package/dist/chunk-teyphwr0.js +5 -0
- package/dist/{chunk-6rhebm18.js.map → chunk-teyphwr0.js.map} +2 -2
- package/dist/{chunk-agabw2w1.js → chunk-tkdxv6cq.js} +2 -2
- package/dist/{chunk-agabw2w1.js.map → chunk-tkdxv6cq.js.map} +1 -1
- package/dist/chunk-v094r7tz.js +6 -0
- package/dist/{chunk-p8fm3tjy.js.map → chunk-v094r7tz.js.map} +2 -2
- package/dist/{chunk-4zmcbmf9.js → chunk-v0t5dejz.js} +2 -2
- package/dist/{chunk-4zmcbmf9.js.map → chunk-v0t5dejz.js.map} +1 -1
- package/dist/{chunk-f4e7fh95.js → chunk-v7y8zm61.js} +3 -3
- package/dist/{chunk-f4e7fh95.js.map → chunk-v7y8zm61.js.map} +2 -2
- package/dist/{chunk-kv2ep453.js → chunk-vj1vt6qs.js} +18 -19
- package/dist/{chunk-kv2ep453.js.map → chunk-vj1vt6qs.js.map} +4 -8
- package/dist/{chunk-71m47kad.js → chunk-wxepr09t.js} +2 -2
- package/dist/{chunk-71m47kad.js.map → chunk-wxepr09t.js.map} +2 -2
- package/dist/{chunk-9nskvzpv.js → chunk-x1g40y59.js} +1 -1
- package/dist/chunk-x5w7es67.js +4 -0
- package/dist/{chunk-s6e7cvek.js.map → chunk-x5w7es67.js.map} +2 -2
- package/dist/chunk-x67dm5ef.js +5 -0
- package/dist/{chunk-jdgvdddd.js.map → chunk-x67dm5ef.js.map} +2 -2
- package/dist/{chunk-fcqc3e3r.js → chunk-xnytbrda.js} +2 -2
- package/dist/{chunk-fcqc3e3r.js.map → chunk-xnytbrda.js.map} +1 -1
- package/dist/chunk-xska2hx3.js +4 -0
- package/dist/{chunk-hrrmxreg.js.map → chunk-xska2hx3.js.map} +2 -2
- package/dist/{chunk-ms8qd7da.js → chunk-yd6aqeyc.js} +2 -2
- package/dist/{chunk-ms8qd7da.js.map → chunk-yd6aqeyc.js.map} +1 -1
- package/dist/{chunk-bb3zvxsf.js → chunk-zacf5ph0.js} +2 -2
- package/dist/{chunk-bb3zvxsf.js.map → chunk-zacf5ph0.js.map} +1 -1
- package/dist/console/run.js +2 -2
- package/dist/console/run.js.map +1 -1
- package/dist/database/DatabaseManager.d.ts.map +1 -1
- package/dist/database/index.js +2 -2
- package/dist/database/index.js.map +1 -1
- package/dist/email/index.js +1 -1
- package/dist/facades/Storage.d.ts +1 -1
- package/dist/facades/Storage.d.ts.map +1 -1
- package/dist/facades/index.js +1 -1
- package/dist/i18n/dictionaryRuntime.js +2 -2
- package/dist/i18n/dictionaryRuntime.js.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +2 -2
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +2 -2
- package/dist/orm/corpus.d.ts.map +1 -1
- package/dist/orm/dialect/index.d.ts +32 -1
- package/dist/orm/dialect/index.d.ts.map +1 -1
- package/dist/orm/dialect/postgres.d.ts +14 -0
- package/dist/orm/dialect/postgres.d.ts.map +1 -1
- package/dist/orm/dialect/sqlite.d.ts +31 -0
- package/dist/orm/dialect/sqlite.d.ts.map +1 -1
- package/dist/orm/index.js +3 -3
- package/dist/orm/index.js.map +3 -3
- package/dist/orm/types.d.ts +82 -38
- package/dist/orm/types.d.ts.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +2 -2
- package/dist/services/email/drivers/ResendDriver.d.ts.map +1 -1
- package/dist/services/file-storage/drivers/S3Driver.d.ts +24 -1
- package/dist/services/file-storage/drivers/S3Driver.d.ts.map +1 -1
- package/dist/services/image-optimization/drivers/SharpDriver.d.ts.map +1 -1
- package/dist/services/index.js +9 -18
- package/dist/services/index.js.map +5 -99
- package/dist/services/rate-limiter/drivers/RedisRateLimiterDriver.d.ts.map +1 -1
- package/dist/services/redis/RedisManager.d.ts +19 -2
- package/dist/services/redis/RedisManager.d.ts.map +1 -1
- package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
- package/dist/support/sharp.d.ts +21 -0
- package/dist/support/sharp.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-07t0dmdg.js +0 -4
- package/dist/chunk-1snh7yc4.js +0 -4
- package/dist/chunk-2pt6kyn9.js +0 -5
- package/dist/chunk-4qkzdyj7.js +0 -4
- package/dist/chunk-6rhebm18.js +0 -5
- package/dist/chunk-br8ten26.js +0 -4
- package/dist/chunk-c0wcsmpj.js +0 -4
- package/dist/chunk-dxw8k6f1.js +0 -5
- package/dist/chunk-efsk1wy0.js +0 -5
- package/dist/chunk-f13f68c0.js +0 -5
- package/dist/chunk-hk067634.js +0 -4
- package/dist/chunk-hrrmxreg.js +0 -4
- package/dist/chunk-jb2nst6v.js +0 -4
- package/dist/chunk-jdgvdddd.js +0 -5
- package/dist/chunk-k8endm5j.js +0 -9
- package/dist/chunk-p8fm3tjy.js +0 -6
- package/dist/chunk-r9z5rrk0.js +0 -4
- package/dist/chunk-s6e7cvek.js +0 -4
- package/dist/chunk-tpyhhdq5.js +0 -81
- /package/dist/{chunk-pgjk5ft3.js.map → chunk-k5jvafmh.js.map} +0 -0
- /package/dist/{chunk-9nskvzpv.js.map → chunk-x1g40y59.js.map} +0 -0
package/dist/email/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Xe as o}from"../chunk-
|
|
2
|
+
import{Xe as o}from"../chunk-876p591d.js";import{Ye as p}from"../chunk-nncwsdzz.js";import{af as f}from"../chunk-w6gb9gc5.js";import"../chunk-6j1z2cqt.js";import"../chunk-7f5ad759.js";import{render as i}from"jsx-email";import I from"process";import{Buffer as a}from"buffer";import d from"path";import{fileURLToPath as kT}from"url";import{promisify as FT}from"util";import r from"child_process";import WT,{constants as IT}from"fs/promises";import u from"process";import c,{constants as JT}from"fs/promises";import b from"process";import GT from"os";import _ from"fs";import RT from"fs";import y from"fs";var j;function ET(){try{return y.statSync("/.dockerenv"),!0}catch{return!1}}function $T(){try{return y.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function L(){if(j===void 0)j=ET()||$T();return j}var O,qT=()=>{try{return RT.statSync("/run/.containerenv"),!0}catch{return!1}};function Y(){if(O===void 0)O=qT()||L();return O}var B=()=>{if(b.platform!=="linux")return!1;if(GT.release().toLowerCase().includes("microsoft")){if(Y())return!1;return!0}try{if(_.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft"))return!Y()}catch{}if(_.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")||_.existsSync("/run/WSL"))return!Y();return!1},Q=b.env.__IS_WSL_TEST__?B:B();var KT=(()=>{let S;return async function(){if(S)return S;let v="/etc/wsl.conf",$=!1;try{await c.access(v,JT.F_OK),$=!0}catch{}if(!$)return"/mnt/";let E=await c.readFile(v,{encoding:"utf8"}),q=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(E);if(!q)return"/mnt/";return S=q.groups.mountPoint.trim(),S=S.endsWith("/")?S:`${S}/`,S}})(),QT=async()=>{return`${await KT()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`},x=async()=>{if(Q)return QT();return`${u.env.SYSTEMROOT||u.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`};function V(T,S,v){let $=(E)=>Object.defineProperty(T,S,{value:E,enumerable:!0,writable:!0});return Object.defineProperty(T,S,{configurable:!0,enumerable:!0,get(){let E=v();return $(E),E},set(E){$(E)}}),T}import{promisify as _T}from"util";import F from"process";import{execFile as xT}from"child_process";import{promisify as VT}from"util";import YT from"process";import{execFile as ZT}from"child_process";var HT=VT(ZT);async function D(){if(YT.platform!=="darwin")throw Error("macOS only");let{stdout:T}=await HT("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),v=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(T)?.groups.id??"com.apple.Safari";if(v==="com.apple.safari")return"com.apple.Safari";return v}import MT from"process";import{promisify as NT}from"util";import{execFile as UT,execFileSync as ES}from"child_process";var XT=NT(UT);async function A(T,{humanReadableOutput:S=!0,signal:v}={}){if(MT.platform!=="darwin")throw Error("macOS only");let $=S?[]:["-ss"],E={};if(v)E.signal=v;let{stdout:q}=await XT("osascript",["-e",T,$],E);return q.trim()}async function z(T){return A(`tell application "Finder" to set app_path to application file id "${T}" as string
|
|
3
3
|
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}import{promisify as jT}from"util";import{execFile as LT}from"child_process";var OT=jT(LT),N={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},KS=new Map(Object.entries(N));class P extends Error{}async function k(T=OT){let{stdout:S}=await T("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),v=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(S);if(!v)throw new P(`Cannot find Windows browser in stdout: ${JSON.stringify(S)}`);let{id:$}=v.groups,E=$.lastIndexOf("."),q=$.lastIndexOf("-"),J=E===-1?void 0:$.slice(0,E),R=q===-1?void 0:$.slice(0,q);return N[$]??N[J]??N[R]??{name:$,id:$}}var DT=_T(xT),zT=(T)=>T.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,(S)=>S.toUpperCase());async function W(){if(F.platform==="darwin"){let T=await D();return{name:await z(T),id:T}}if(F.platform==="linux"){let{stdout:T}=await DT("xdg-mime",["query","default","x-scheme-handler/http"]),S=T.trim();return{name:zT(S.replace(/.desktop$/,"").replace("-"," ")),id:S}}if(F.platform==="win32")return k();throw Error("Only macOS, Linux, and Windows are supported")}var CT=FT(r.execFile),C=d.dirname(kT(import.meta.url)),w=d.join(C,"xdg-open"),{platform:H,arch:m}=I;async function fT(){let T=await x(),S=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,v=a.from(S,"utf16le").toString("base64"),{stdout:$}=await CT(T,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",v],{encoding:"utf8"}),E=$.trim(),q={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return q[E]?{id:q[E]}:{}}var h=async(T,S)=>{let v;for(let $ of T)try{return await S($)}catch(E){v=E}throw v},U=async(T)=>{if(T={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...T},Array.isArray(T.app))return h(T.app,(R)=>U({...T,app:R}));let{name:S,arguments:v=[]}=T.app??{};if(v=[...v],Array.isArray(S))return h(S,(R)=>U({...T,app:{name:R,arguments:v}}));if(S==="browser"||S==="browserPrivate"){let R={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},G={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},K=Q?await fT():await W();if(K.id in R){let M=R[K.id];if(S==="browserPrivate")v.push(G[M]);return U({...T,app:{name:Z[M],arguments:v}})}throw Error(`${K.name} is not supported as a default browser`)}let $,E=[],q={};if(H==="darwin"){if($="open",T.wait)E.push("--wait-apps");if(T.background)E.push("--background");if(T.newInstance)E.push("--new");if(S)E.push("-a",S)}else if(H==="win32"||Q&&!Y()&&!S){if($=await x(),E.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),!Q)q.windowsVerbatimArguments=!0;let R=["Start"];if(T.wait)R.push("-Wait");if(S){if(R.push(`"\`"${S}\`""`),T.target)v.push(T.target)}else if(T.target)R.push(`"${T.target}"`);if(v.length>0)v=v.map((G)=>`"\`"${G}\`""`),R.push("-ArgumentList",v.join(","));T.target=a.from(R.join(" "),"utf16le").toString("base64")}else{if(S)$=S;else{let R=!C||C==="/",G=!1;try{await WT.access(w,IT.X_OK),G=!0}catch{}$=I.versions.electron??(H==="android"||R||!G)?"xdg-open":w}if(v.length>0)E.push(...v);if(!T.wait)q.stdio="ignore",q.detached=!0}if(H==="darwin"&&v.length>0)E.push("--args",...v);if(T.target)E.push(T.target);let J=r.spawn($,E,q);if(T.wait)return new Promise((R,G)=>{J.once("error",G),J.once("close",(K)=>{if(!T.allowNonzeroExitCode&&K>0){G(Error(`Exited with code ${K}`));return}R(J)})});return J.unref(),J},lT=(T,S)=>{if(typeof T!=="string")throw TypeError("Expected a `target`");return U({...S,target:T})};function g(T){if(typeof T==="string"||Array.isArray(T))return T;let{[m]:S}=T;if(!S)throw Error(`${m} is not supported`);return S}function X({[H]:T},{wsl:S}){if(S&&Q)return g(S);if(!T)throw Error(`${H} is not supported`);return g(T)}var Z={};V(Z,"chrome",()=>X({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));V(Z,"brave",()=>X({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));V(Z,"firefox",()=>X({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));V(Z,"edge",()=>X({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));V(Z,"browser",()=>"browser");V(Z,"browserPrivate",()=>"browserPrivate");var e=lT;import{jsx as n}from"react/jsx-runtime";class s{from="";to=[];subject="No Subject";cc=[];bcc=[];attachments=[];template;headers={};static async send(T){let S=new this,v=f(p).defaultLocale,$=f(o),{to:E=S.to,from:q=S.from,subject:J=typeof S.subject==="string"?S.subject:S.subject[T.locale||v],cc:R=S.cc,bcc:G=S.bcc,attachments:K=S.attachments,data:M,headers:TT={}}=T,ST={...$.headers??{},...S.headers??{},...TT??{}};if(!(await $.filterRecipients(E)).length)return;let[l,vT]=await Promise.all([S.render({...M,locale:T.locale}),S.renderText({...M,locale:T.locale})]);if(process.env.EMAIL_DEBUG==="true"){let t=`${process.env.ROOT_DIR}/.debug/emails/${new Date().toISOString()}${J}.html`;if(await Bun.write(t,l),process.env.CI!=="true")await e(t);return}await $.send({bcc:G,cc:R,from:q,subject:J,to:E,attachments:K,html:l,headers:ST,text:vT,scheduledAt:T.scheduledAt})}static async preview(T){return await new this().render({...T.data,locale:T.locale})}async render(T){let S=this.template;return await i(n(S,{...T}))}async renderText(T){let S=this.template;return await i(n(S,{...T}),{plainText:!0})}}export{s as Email};
|
|
4
4
|
|
|
5
5
|
//# debugId=D2ED8A45FD1B18ED64756E2164756E21
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Storage.d.ts","sourceRoot":"","sources":["../../facades/Storage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Storage.d.ts","sourceRoot":"","sources":["../../facades/Storage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,UAAU,EACX,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,KAAK,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAEzC,qBAAa,OAAQ,SAAQ,MAAM;IACjC,MAAM,CAAC,iBAAiB;WAIX,GAAG,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;WAIhC,QAAQ,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;WAatD,KAAK,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM;IAIlD;;;;;;;;OAQG;WACU,IAAI,CACf,MAAM,EAAE,cAAc,GAAG,MAAM,EAC/B,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;KAAO,GACzC,OAAO,CAAC,UAAU,CAAC;IAgBtB,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM;IAG1B,MAAM,CAAC,MAAM;CACd"}
|
package/dist/facades/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Mb as b,Ob as c,Pb as d,Qb as e,Wb as f,gc as g,lc as h,mc as i,nc as j,oc as k,qc as l,rc as m,sc as n,tc as o}from"../chunk-
|
|
2
|
+
import{Mb as b,Ob as c,Pb as d,Qb as e,Wb as f,gc as g,lc as h,mc as i,nc as j,oc as k,qc as l,rc as m,sc as n,tc as o}from"../chunk-3njyfdj5.js";import"../chunk-k5jvafmh.js";import"../chunk-6yy92txx.js";import"../chunk-e3mggavt.js";import{Wd as a}from"../chunk-85av4ncy.js";import"../chunk-k14dmqwh.js";import"../chunk-0weeq0ke.js";import"../chunk-g5tj10p8.js";import"../chunk-nncwsdzz.js";import"../chunk-w6gb9gc5.js";import"../chunk-6j1z2cqt.js";import"../chunk-7f5ad759.js";export{i as Url,f as Storage,l as Redis,a as Redirect,m as RateLimiter,h as Query,j as Meta,g as Log,e as Lang,b as Facade,o as DB,k as Cookie,n as ConnectionQueries,c as Broadcast,d as Auth};
|
|
3
3
|
|
|
4
4
|
//# debugId=98D6634FFCD4FE7C64756E2164756E21
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{aa as y,ba as p}from"../chunk-teyphwr0.js";import{ka as c,la as d,na as l}from"../chunk-5ad8era8.js";import{rd as e,sd as i,ud as t,vd as r,wd as o,xd as n,yd as a,zd as s}from"../chunk-e3mggavt.js";import"../chunk-7f5ad759.js";export{o as setActiveLocale,r as seedDictionaries,t as preloadDictionaries,d as localeStrings,i as loadDictionary,n as getActiveLocale,e as dictionaryRegistrationMark,c as dictionaryLocales,l as dictionaryId,y as defineDictionary,s as createDictionarySink,a as __resetDictionaryRegistry,p as __gemi_dict__};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=852DD9AE2DB3776264756E2164756E21
|
package/dist/i18n/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{aa as R}from"../chunk-teyphwr0.js";import"../chunk-5ad8era8.js";import{Pa as L}from"../chunk-cbqrkfjm.js";import{Jb as E,Kb as V}from"../chunk-004bcmsa.js";import"../chunk-n1tkn8gv.js";import{Qb as j}from"../chunk-3njyfdj5.js";import"../chunk-k5jvafmh.js";import"../chunk-6yy92txx.js";import"../chunk-e3mggavt.js";import"../chunk-85av4ncy.js";import"../chunk-k14dmqwh.js";import"../chunk-0weeq0ke.js";import"../chunk-g5tj10p8.js";import{Ye as X}from"../chunk-nncwsdzz.js";import"../chunk-w6gb9gc5.js";import"../chunk-6j1z2cqt.js";import"../chunk-7f5ad759.js";import{createElement as J,Fragment as M,isValidElement as U}from"react";function $(q,B){let G=Object.values(B).some((z)=>typeof z==="function"&&U(z(""))),Q=/{{([^{}]+?)(?::([^{}\[\]]+?))?(?:\[(.*?)\])?}}/g;if(!G)return q.replace(Q,(W,O,_,Z)=>{let C=O.includes(":")?O.split(":")[0]:O,H=B[C];if(H===void 0)return W;if(typeof H==="function"){let K=H(Z!==void 0?Z:"");if(U(K))throw Error("JSX returned in string context");return String(K)}if(_)switch(_.toLowerCase()){case"number":return Number(H).toString();case"string":return String(H);case"boolean":return Boolean(H).toString();default:return String(H)}return String(H)});else{let z=[],W=0,O=null;while((O=Q.exec(q))!==null){let[_,Z,C,H]=O,F=O.index,K=Z.includes(":")?Z.split(":")[0]:Z;if(F>W)z.push(q.substring(W,F));let Y=B[K];if(Y===void 0)z.push(_);else if(typeof Y==="function"){let A=Y(H!==void 0?H:"");z.push(A)}else if(C)switch(C.toLowerCase()){case"number":z.push(Number(Y).toString());break;case"string":z.push(String(Y));break;case"boolean":z.push(Boolean(Y).toString());break;default:z.push(String(Y))}else z.push(String(Y));W=F+_.length}if(W<q.length)z.push(q.substring(W));return J(M,{},...z)}}class P{name;dictionary;constructor(q,B){this.name=q;this.dictionary=B}reference(q){if(typeof window<"u")throw Error("Cannot use reference in the browser");if(!this.dictionary?.[q])throw Error(`Translation not found for ${String(q)}`);return this.dictionary[q]}render(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B[0]};if(typeof window<"u")throw Error("Cannot use render in the browser");if(!this.dictionary?.[q]?.[G])throw Error(`Translation not found for ${String(q)} in ${String(G)}`);return $(this.dictionary[q][G],Q??{})}static create(q,B){return new P(q,B)}static text(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B?.[0]};if(!q?.[G])throw Error(`Translation not found for ${String(G)}`);return $(q[G],Q??{})}}async function N(q,B,...G){let{locale:Q=j.locale(),params:z}={params:{},...G[0]},O=(await q.load(String(Q)))[B];if(typeof O!=="string")throw Error(`Translation not found for "${B}" in "${String(Q)}" (dictionary ${q.id})`);return $(O,z??{})}export{V as translationConfigDefaults,N as translate,E as defineTranslationConfig,R as defineDictionary,X as Translator,L as TranslationServiceProvider,P as Dictionary};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=6A3D723132901A8D64756E2164756E21
|
package/dist/i18n/index.js.map
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"// The module, not the `../facades` barrel. A dictionary is the one server-side\n// artifact a *component* test has to import — `<Page dictionaries={[…]}>` takes\n// the app's real `app/i18n/index.ts` — and the barrel drags the whole facade\n// set in behind it, including `Redis` and its `import { RedisClient } from\n// \"bun\"`. Under a browser-targeted runner (vitest/jsdom) that specifier does\n// not resolve, so importing the app's dictionaries failed to collect before it\n// rendered anything. `Lang` itself only needs the translator and the request\n// context.\nimport { Lang } from \"../facades/Lang\";\nimport { parseTranslation } from \"../utils/parseTranslation\";\nimport type {\n ParseTranslationParams,\n ParseTranslationParamsServer,\n Prettify,\n} from \"../utils/type\";\n\ntype Translations = Record<string, Record<string, string>>;\n\nexport class Dictionary<T extends Translations> {\n constructor(\n public name: string,\n public dictionary: T,\n ) {}\n\n reference(key: keyof T) {\n if (typeof window !== \"undefined\") {\n throw new Error(\"Cannot use reference in the browser\");\n }\n if (!this.dictionary?.[key]) {\n throw new Error(`Translation not found for ${String(key)}`);\n }\n return this.dictionary[key];\n }\n\n render<\n K extends keyof T,\n U extends keyof T[K],\n R = Prettify<ParseTranslationParams<T[K][U]>>,\n >(\n key: K,\n ...args: R extends Record<string, never>\n ? [args?: { locale?: U | (string & {}) }]\n : [args: { locale?: U | (string & {}); params: R }]\n ) {\n const { locale = Lang.locale(), params } = {\n params: {},\n ...args[0],\n };\n\n if (typeof window !== \"undefined\") {\n throw new Error(\"Cannot use render in the browser\");\n }\n\n if (!this.dictionary?.[key]?.[locale]) {\n throw new Error(\n `Translation not found for ${String(key)} in ${String(locale)}`,\n );\n }\n return parseTranslation(this.dictionary[key][locale], params ?? {});\n }\n\n /**\n * @deprecated Use `defineDictionary` from `gemi/client`, declared next to the\n * component that reads it. A dictionary made here has to be re-exported from\n * `app/i18n/index.ts` and listed against a route in the `prefetch` config,\n * and every locale of it stays resident whether a page uses it or not. Still\n * supported; see `docs/i18n.md`.\n */\n static create<const T extends Translations>(name: string, translations: T) {\n return new Dictionary<T>(name, translations);\n }\n\n static text<const T extends Record<string, string>, U extends keyof T>(\n content: T,\n ...args: Prettify<ParseTranslationParamsServer<T[U]>> extends Record<\n string,\n never\n >\n ? [args?: { locale?: U | (string & {}) }]\n : [\n args: {\n locale?: U | (string & {});\n params: Prettify<ParseTranslationParamsServer<T[U]>>;\n },\n ]\n ): string {\n const { locale = Lang.locale(), params } = { params: {}, ...args?.[0] };\n\n if (!content?.[locale]) {\n throw new Error(`Translation not found for ${String(locale)}`);\n }\n\n return parseTranslation(content[locale], params ?? {});\n }\n}\n",
|
|
7
7
|
"import { Lang } from \"../facades\";\nimport { parseTranslation } from \"../utils/parseTranslation\";\nimport type { ParseTranslationParamsServer, Prettify } from \"../utils/type\";\nimport type { DictionaryHandle } from \"./defineDictionary\";\nimport type { DictionaryTranslations } from \"./dictionaryShape\";\n\n/**\n * Read one string from a `defineDictionary` dictionary outside React — a\n * controller, a job, an email template.\n *\n * Async because a bundled dictionary loads its locale on demand. Server code\n * does not go through the bundler, so in practice this resolves without ever\n * yielding; the `await` is what makes the same call work either way.\n *\n * Kept out of `defineDictionary.ts` on purpose: that module is imported by\n * components and has to stay free of the server facades this one needs.\n */\nexport async function translate<\n T extends DictionaryTranslations,\n K extends keyof T & string,\n U extends keyof T[K],\n R = Prettify<ParseTranslationParamsServer<T[K][U] & string>>,\n>(\n dictionary: DictionaryHandle<T>,\n key: K,\n ...args: R extends Record<string, never>\n ? [args?: { locale?: U | (string & {}) }]\n : [args: { locale?: U | (string & {}); params: R }]\n): Promise<string> {\n const { locale = Lang.locale(), params } = { params: {}, ...args[0] };\n const strings = await dictionary.load(String(locale));\n const template = strings[key];\n\n if (typeof template !== \"string\") {\n throw new Error(\n `Translation not found for \"${key}\" in \"${String(locale)}\" (dictionary ${dictionary.id})`,\n );\n }\n\n return parseTranslation(template, (params ?? {}) as any) as string;\n}\n"
|
|
8
8
|
],
|
|
9
|
-
"mappings": ";
|
|
10
|
-
"debugId": "
|
|
9
|
+
"mappings": ";soBAAA,mBAAS,SAAe,eAAU,SAO3B,IAAS,JAAgB,JAAC,HAAkB,HAAwB,JAEzE,DAAM,HAAS,EAAO,EAAO,JAAM,HAAE,KACnC,CAAC,IACC,OAAO,IAAU,YACjB,EAAgB,EAAkC,EAAE,CAAC,CACzD,EAMM,EAAQ,kDAEd,GAAI,CAAC,EAqCH,OAnCe,EAAS,QAAQ,EAAO,CAAC,EAAO,EAAM,EAAM,IAAY,CAErE,IAAM,EAAY,EAAK,SAAS,GAAG,EAAI,EAAK,MAAM,GAAG,EAAE,GAAK,EAEtD,EAAQ,EAAO,GACrB,GAAI,IAAU,OACZ,OAAO,EAGT,GAAI,OAAO,IAAU,WAAY,CAG/B,IAAM,EAAiB,EADD,IAAY,OAAY,EAAU,EACd,EAE1C,GAAI,EAAe,CAAc,EAC/B,MAAU,MAAM,gCAAgC,EAElD,OAAO,OAAO,CAAc,EAI9B,GAAI,EACF,OAAQ,EAAK,YAAY,OAClB,SACH,OAAO,OAAO,CAAK,EAAE,SAAS,MAC3B,SACH,OAAO,OAAO,CAAK,MAChB,UACH,OAAO,QAAQ,CAAK,EAAE,SAAS,UAE/B,OAAO,OAAO,CAAK,EAGzB,OAAO,OAAO,CAAK,EACpB,EAEI,KAEL,IAAM,EAAqC,CAAC,EACxC,EAAY,EACZ,EAAgC,KAEpC,OAAQ,EAAQ,EAAM,KAAK,CAAQ,KAAO,KAAM,CAC9C,IAAO,EAAW,EAAM,EAAM,GAAW,EACnC,EAAa,EAAM,MAGnB,EAAY,EAAK,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AAW,GAAK,GAAS,GAAU,CAAC,CAAC,QAU7D,OAAoC,CAAC,EAAc,EAAiB,CACzE,OAAO,IAAI,EAAc,EAAM,CAAY,QAGtC,KAA+D,CACpE,KACG,EAWK,CACR,IAAQ,SAAS,EAAK,OAAO,EAAG,UAAW,CAAE,OAAQ,CAAC,KAAM,IAAO,EAAG,EAEtE,GAAI,CAAC,IAAU,GACb,MAAU,MAAM,6BAA6B,OAAO,CAAM,GAAG,EAG/D,OAAO,EAAiB,EAAQ,GAAS,GAAU,CAAC,CAAC,EAEzD,CC7EA,eAAsB,CAKrB,CACC,EACA,KACG,EAGc,CACjB,IAAQ,SAAS,EAAK,OAAO,EAAG,UAAW,CAAE,OAAQ,CAAC,KAAM,EAAK,EAAG,EAE9D,GADU,MAAM,EAAW,KAAK,OAAO,CAAM,CAAC,GAC3B,GAEzB,GAAI,OAAO,IAAa,SACtB,MAAU,MACR,8BAA8B,UAAY,OAAO,CAAM,kBAAkB,EAAW,KACtF,EAGF,OAAO,EAAiB,EAAW,GAAU,CAAC,CAAS",
|
|
10
|
+
"debugId": "6A3D723132901A8D64756E2164756E21",
|
|
11
11
|
"names": []
|
|
12
12
|
}
|
package/dist/kernel/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{sa as X}from"../chunk-a1h4paj1.js";import{Oa as m}from"../chunk-j3tzdcz7.js";import{Pa as Y}from"../chunk-cbqrkfjm.js";import{$a as V,Sa as H,Ta as W,Ua as Z,Va as _,Wa as $,Xa as F,Ya as T,ab as y,db as K,eb as L,lb as Q,ob as U,pb as B}from"../chunk-x1g40y59.js";import{sb as k}from"../chunk-1sh6kqjn.js";import"../chunk-xxw0gz4q.js";import"../chunk-004bcmsa.js";import"../chunk-n1tkn8gv.js";import{Nb as I,jc as b,kc as f}from"../chunk-3njyfdj5.js";import"../chunk-k5jvafmh.js";import"../chunk-6yy92txx.js";import"../chunk-e3mggavt.js";import{ee as w}from"../chunk-85av4ncy.js";import{ue as D}from"../chunk-k14dmqwh.js";import"../chunk-0weeq0ke.js";import"../chunk-g5tj10p8.js";import"../chunk-876p591d.js";import"../chunk-nncwsdzz.js";import{$e as x,Ze as G}from"../chunk-w6gb9gc5.js";import"../chunk-6j1z2cqt.js";import"../chunk-7f5ad759.js";var E=[T,y,X,B,W,_,V,$,L,U,K,F,Y,Q,Z];class M{config={};providers=[];services=[];serviceInstances=[];serviceTokens=new Set;servicesBooted=!1;models=[];app=new x;boot(){if(this.models.length>0)m(...this.models);else R();this.app.config.merge(this.config),x.setInstance(this.app),this.app.registerMany([...E,...this.providers]),this.registerServices()}registerServices(){let q=this.serviceTokens;this.serviceInstances=[],this.serviceTokens=new Set,this.servicesBooted=!1;let J=new Map;for(let z of this.services){let C=typeof z==="function"?new z:z,j=C.constructor;if(!j.token)throw Error(`Service [${j.name}] is listed in \`services\` but does not declare a \`static token\`.`);let N=J.get(j.token);if(N)throw Error(`Services [${N}] and [${j.name}] both declare the token "${j.token}". Tokens are the container's keys, so they must be unique.`);J.set(j.token,j.name);let O=j;if(!q.has(j.token)&&this.app.bound(O))throw Error(`Service [${j.name}] declares the token "${j.token}", which is already bound in the container by the framework or a provider. Binding it would replace that service everywhere, so pick a token nothing else owns.`);this.app.instance(O,C),this.serviceInstances.push(C),this.serviceTokens.add(j.token)}}async waitForBoot(){await this.app.boot(),await this.bootServices()}async bootServices(){if(this.servicesBooted)return;for(let q of this.serviceInstances)await q.boot();this.servicesBooted=!0}run(q){return G.run(this.app,q)}resolve(q){return this.app.make(q)}apiRoutes(){return this.app.make(f)}viewRoutes(){return this.app.make(b)}broadcast(){return this.app.make(I)}queue(){return this.app.make(k)}destroy(){if(this.app.resolved(H))this.app.make(H).stop();if(this.app.flush(),x.getInstance()===this.app)x.setInstance(void 0);G.disable()}}function R(){if(Bun.env.NODE_ENV==="production")return;let q=D();if(q.length===0)return;console.warn(`[gemi] ${q.length} model${q.length===1?" is":"s are"} registered, but Kernel.models is empty.
|
|
3
3
|
Nested relation reads resolve a model by name, so a policy on a subclass that does not own its
|
|
4
4
|
`+" name is skipped inside every include \u2014 scoped at the root, "+`unscoped in an include, with nothing
|
|
5
5
|
to notice it. Declaring the modules registers each class under its own name and audits the set:
|
|
@@ -13,4 +13,4 @@ import{v as X}from"../chunk-sqp7kn7h.js";import{R as m}from"../chunk-zckj6bs6.js
|
|
|
13
13
|
|
|
14
14
|
See docs/orm.md#your-model-class. Development only; this never prints in production.`)}export{E as frameworkProviders,w as UserProvider,M as Kernel};
|
|
15
15
|
|
|
16
|
-
//# debugId=
|
|
16
|
+
//# debugId=6B1CA6B431B2ADC664756E2164756E21
|
package/dist/kernel/index.js.map
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"import type { ServiceProviderConstructor } from \"../foundation/Application\";\nimport { AuthServiceProvider } from \"../auth/AuthServiceProvider\";\nimport { DatabaseServiceProvider } from \"../database/DatabaseServiceProvider\";\nimport { TranslationServiceProvider } from \"../i18n/TranslationServiceProvider\";\nimport { ScheduleServiceProvider } from \"../services/cron/ScheduleServiceProvider\";\nimport { MailServiceProvider } from \"../services/email/MailServiceProvider\";\nimport { FilesystemServiceProvider } from \"../services/file-storage/FilesystemServiceProvider\";\nimport { ImageServiceProvider } from \"../services/image-optimization/ImageServiceProvider\";\nimport { KernelIdServiceProvider } from \"../services/kernel-id/KernelIdServiceProvider\";\nimport { LogServiceProvider } from \"../services/logging/LogServiceProvider\";\nimport { MiddlewareServiceProvider } from \"../services/middleware/MiddlewareServiceProvider\";\nimport { BroadcastServiceProvider } from \"../services/pubsub/BroadcastServiceProvider\";\nimport { QueueServiceProvider } from \"../services/queue/QueueServiceProvider\";\nimport { RateLimiterServiceProvider } from \"../services/rate-limiter/RateLimiterServiceProvider\";\nimport { RedisServiceProvider } from \"../services/redis/RedisServiceProvider\";\nimport { RouteServiceProvider } from \"../services/router/RouteServiceProvider\";\n\n/**\n * The providers every gemi app boots with, in registration order. Fifteen\n * providers for sixteen services — `RouteServiceProvider` owns both the api and\n * the view dispatcher, the way Laravel's does.\n *\n * Order only matters for `boot()`; `register()` binds factories and resolves\n * nothing, so no provider here depends on an earlier one having run.\n */\nexport const frameworkProviders: ServiceProviderConstructor[] = [\n KernelIdServiceProvider,\n MiddlewareServiceProvider,\n DatabaseServiceProvider,\n RouteServiceProvider,\n AuthServiceProvider,\n MailServiceProvider,\n LogServiceProvider,\n FilesystemServiceProvider,\n QueueServiceProvider,\n RedisServiceProvider,\n BroadcastServiceProvider,\n ImageServiceProvider,\n TranslationServiceProvider,\n RateLimiterServiceProvider,\n ScheduleServiceProvider,\n];\n",
|
|
6
6
|
"import { Application } from \"../foundation/Application\";\nimport type { ServiceProviderConstructor } from \"../foundation/Application\";\nimport type { ServiceToken } from \"../container/Container\";\nimport type { ConfigItems } from \"../support/Repository\";\nimport type { Service, ServiceConstructor } from \"../support/Service\";\nimport { registerModels } from \"../orm/registration\";\nimport { registeredNames } from \"../orm/registry\";\nimport { Scheduler } from \"../services/cron/Scheduler\";\nimport { BroadcastManager } from \"../services/pubsub/BroadcastManager\";\nimport { QueueManager } from \"../services/queue/QueueManager\";\nimport { ApiRouteDispatcher } from \"../services/router/ApiRouteDispatcher\";\nimport { ViewRouteDispatcher } from \"../services/router/ViewRouteDispatcher\";\nimport { kernelContext } from \"./context\";\nimport { frameworkProviders } from \"./providers\";\n\n/**\n * The app's entry point into the framework. A Kernel subclass declares what the\n * app adds — its `config` slices and any extra `providers` — and everything\n * else lives in the Application container it owns.\n */\nexport class Kernel {\n /**\n * App-level config, merged over the framework defaults. Each key is a config\n * slice: `{ mail: { ... }, route: { ... } }`, normally the modules under\n * `app/config`.\n */\n protected config: ConfigItems = {};\n\n /**\n * App-level providers, registered after the framework's own so they can\n * rebind anything the framework bound.\n */\n protected providers: ServiceProviderConstructor[] = [];\n\n /**\n * The app's own singleton services. Each is constructed during the\n * synchronous boot phase and its `boot()` awaited during the asynchronous\n * one, in the order listed — so a service whose `boot()` depends on another\n * goes after it.\n *\n * An entry is either the class itself or a configured instance from\n * `Service.with({ ... })`. Listing is explicit rather than discovered because\n * the order is load-bearing here, and because a service is always imported by\n * whatever injects it — there is no file the import graph would miss.\n */\n protected services: Array<ServiceConstructor | Service> = [];\n\n private serviceInstances: Service[] = [];\n private serviceTokens = new Set<string>();\n private servicesBooted = false;\n\n /**\n * The modules holding the app's model classes — normally\n * `[generated, models]`, the generated namespace and the barrel of subclasses\n * written over it. Every model class they export is registered under the name\n * its schema carries, later modules winning, and the whole set is audited\n * before anything else boots.\n *\n * ### Why this is a Kernel field and not a line in a file somewhere\n *\n * Registration used to be `register(\"User\", User)` next to each subclass, and\n * the failure mode of forgetting it is an authorization hole that nothing\n * reports: a relation read resolves its target by name, so an unregistered\n * policied subclass leaves the generated base owning the name and every\n * nested `include` of that model comes back unscoped. No error at the root\n * either, because `$exec`'s divergence guard begins `registered !== this` and\n * the base it is running on *is* the registered one. A model only ever read\n * through an include — a membership, a pivot, the kind that carries a tenant\n * scope — never trips anything.\n *\n * Listing the modules here says it once, in the same place the app already\n * declares its config slices and providers, and turns the mistake into a\n * failure to boot rather than a quiet cross-tenant read.\n *\n * It sees the modules it is given, so a model class in a file that no barrel\n * re-exports is still invisible. That is the residual, and it is a smaller\n * one: a barrel is a place to notice an omission, and thirteen `register`\n * lines scattered across thirteen files is not.\n */\n protected models: Array<Record<string, unknown>> = [];\n\n readonly app = new Application();\n\n /**\n * Phase one, synchronous: every provider is constructed and its `register()`\n * runs. Only bindings are recorded here — no service is instantiated, so this\n * is safe to call from a synchronous constructor (`new App({ kernel })`).\n * Phase two is `waitForBoot()`.\n */\n boot() {\n // Before the container, deliberately. This throws on a model whose policies\n // would be skipped, and the useful moment for that is the one where nothing\n // has been constructed and no request can be in flight.\n if (this.models.length > 0) registerModels(...this.models);\n else warnIfModelsAreRegisteredButUndeclared();\n\n this.app.config.merge(this.config);\n Application.setInstance(this.app);\n this.app.registerMany([...frameworkProviders, ...this.providers]);\n this.registerServices();\n }\n\n /**\n * Constructs every listed service and binds it into the container. Runs after\n * the providers have registered, so a provider's `boot()` can `inject()` one;\n * a `Service` constructor does no I/O, so doing this synchronously costs\n * nothing beyond the field initializers.\n */\n private registerServices() {\n // What a previous pass bound, so re-running this on the same kernel is not\n // mistaken for a collision with something else.\n const ours = this.serviceTokens;\n\n this.serviceInstances = [];\n this.serviceTokens = new Set();\n this.servicesBooted = false;\n\n const owners = new Map<string, string>();\n\n for (const declaration of this.services) {\n const instance =\n typeof declaration === \"function\" ? new declaration() : declaration;\n const ctor = instance.constructor as ServiceConstructor;\n\n if (!ctor.token) {\n throw new Error(\n `Service [${ctor.name}] is listed in \\`services\\` but does not declare a \\`static token\\`.`,\n );\n }\n\n // Two services under one token is the failure this refuses to have\n // silently: the second would replace the first in the container, and\n // every `inject()` written against either would hand back whichever was\n // listed last.\n const owner = owners.get(ctor.token);\n if (owner) {\n throw new Error(\n `Services [${owner}] and [${ctor.name}] both declare the token \"${ctor.token}\". Tokens are the container's keys, so they must be unique.`,\n );\n }\n owners.set(ctor.token, ctor.name);\n\n // The same failure one level out. `Container.instance()` writes into\n // `instances`, which `make()` consults before `bindings`, so a token that\n // is already spoken for is not shared with its owner — it replaces it, for\n // every `app()` and `inject()` in the process. An app service that named\n // itself \"mail\" would leave `Mail.send()` resolving to an object with no\n // `send`, and the boot that caused it would report nothing. Providers have\n // all registered by now, so anything bound here belongs to somebody else.\n const token = ctor as unknown as ServiceToken<Service>;\n if (!ours.has(ctor.token) && this.app.bound(token)) {\n throw new Error(\n `Service [${ctor.name}] declares the token \"${ctor.token}\", which is already bound in the container by the framework or a provider. Binding it would replace that service everywhere, so pick a token nothing else owns.`,\n );\n }\n\n this.app.instance(token, instance);\n this.serviceInstances.push(instance);\n this.serviceTokens.add(ctor.token);\n }\n }\n\n /**\n * Phase two, asynchronous: every provider's `boot()` runs, in registration\n * order, after all of them have registered. Idempotent.\n */\n async waitForBoot() {\n await this.app.boot();\n await this.bootServices();\n }\n\n /**\n * Phase two for services, after every provider's `boot()` — so a service may\n * use the facades and anything else a provider owns. Idempotent, like the\n * provider phase it follows.\n */\n private async bootServices() {\n if (this.servicesBooted) {\n return;\n }\n for (const service of this.serviceInstances) {\n await service.boot();\n }\n this.servicesBooted = true;\n }\n\n run<T>(cb: () => T) {\n return kernelContext.run(this.app, cb);\n }\n\n /**\n * Resolve a service by token. Callers outside this module should prefer the\n * named accessors below or `app()`; this exists for tooling that holds a\n * Kernel but no ambient context.\n */\n resolve<T>(token: ServiceToken<T>): T {\n return this.app.make(token);\n }\n\n // Named accessors. `app/App.ts` goes through these rather than importing the\n // service classes itself — see the note in that file about the two copies of\n // gemi that coexist at build time.\n apiRoutes(): ApiRouteDispatcher {\n return this.app.make(ApiRouteDispatcher);\n }\n\n viewRoutes(): ViewRouteDispatcher {\n return this.app.make(ViewRouteDispatcher);\n }\n\n broadcast(): BroadcastManager {\n return this.app.make(BroadcastManager);\n }\n\n queue(): QueueManager {\n return this.app.make(QueueManager);\n }\n\n destroy() {\n // Only touch services that were actually resolved — resolving one here\n // would construct it purely to tear it down.\n if (this.app.resolved(Scheduler)) {\n this.app.make(Scheduler).stop();\n }\n\n this.app.flush();\n\n if (Application.getInstance() === this.app) {\n Application.setInstance(undefined);\n }\n\n kernelContext.disable();\n }\n}\n\n/**\n * Says something to an application that has models and has not declared them.\n *\n * Without this the fix for #316 defaults to off. `models` is `[]`, `boot()`\n * no-ops, and an app upgrading from 0.48 is in exactly the state the issue\n * describes until somebody edits their Kernel by hand — while the only place\n * that says to is the **Setup** section of `docs/orm.md`, which an existing app\n * read once and will not read again. #316 was filed by an app mid-migration\n * with a 79-model schema, which is precisely the reader who never sees it.\n *\n * The condition is what makes this worth printing. A populated registry with an\n * empty `models` means the generated `index.ts` was imported and its bases are\n * what every nested read resolves to — so if any policy lives on a subclass, it\n * is being skipped inside includes right now. A Kernel with no ORM at all has\n * an empty registry and hears nothing.\n *\n * Development only, and a warning rather than a throw: an app in this state is\n * running today, and turning a working deploy into a failure to start over an\n * arrangement that *might* be fine is not a patch-level thing to do. The\n * failure it points at is silent, so the fix for it has to be noisy somewhere,\n * and the terminal an author is already looking at is the cheapest somewhere\n * there is.\n */\nfunction warnIfModelsAreRegisteredButUndeclared(): void {\n if (process.env.NODE_ENV === \"production\") return;\n\n const registered = registeredNames();\n if (registered.length === 0) return;\n\n console.warn(\n `[gemi] ${registered.length} model${registered.length === 1 ? \" is\" : \"s are\"} ` +\n `registered, but Kernel.models is empty.\\n` +\n ` Nested relation reads resolve a model by name, so a policy on a ` +\n `subclass that does not own its\\n` +\n ` name is skipped inside every include — scoped at the root, ` +\n `unscoped in an include, with nothing\\n` +\n ` to notice it. Declaring the modules registers each class under ` +\n `its own name and audits the set:\\n\\n` +\n ` import * as generated from \"../models/generated\"\\n` +\n ` import * as models from \"../models\"\\n\\n` +\n ` export default class extends Kernel {\\n` +\n ` models = [generated, models]\\n` +\n ` }\\n\\n` +\n ` See docs/orm.md#your-model-class. Development only; this never ` +\n `prints in production.`,\n );\n}\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": ";
|
|
9
|
-
"debugId": "
|
|
8
|
+
"mappings": ";07BAyBO,DAAM,HAAmD,JAC9D,HACA,HACA,HACA,HACA,HACA,HACA,HACA,HACA,HACA,HACA,HACA,HACA,HACA,HACA,JACF,HCrBO,CAAM,CAAO,CAMR,OAAsB,CAAC,EAMvB,UAA0C,CAAC,EAa3C,SAAgD,CAAC,EAEnD,iBAA8B,CAAC,EAC/B,cAAgB,IAAI,IACpB,eAAiB,GA8Bf,OAAyC,CAAC,EAE3C,IAAM,IAAI,EAQnB,IAAI,EAAG,CAIL,GAAI,KAAK,OAAO,OAAS,EAAG,EAAe,GAAG,KAAK,MAAM,EACpD,OAAuC,EAE5C,KAAK,IAAI,OAAO,MAAM,KAAK,MAAM,EACjC,EAAY,YAAY,KAAK,GAAG,EAChC,KAAK,IAAI,aAAa,CAAC,GAAG,EAAoB,GAAG,KAAK,SAAS,CAAC,EAChE,KAA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B,OAAO,KAAK,IAAI,KAAK,CAAY,EAGnC,OAAO,EAAG,CAGR,GAAI,KAAK,IAAI,SAAS,CAAS,EAC7B,KAAK,IAAI,KAAK,CAAS,EAAE,KAAK,EAKhC,GAFA,KAAK,IAAI,MAAM,EAEX,EAAY,YAAY,IAAM,KAAK,IACrC,EAAY,YAAY,MAAS,EAGnC,EAAc,QAAQ,EAE1B,CAyBA,SAAS,CAAsC,EAAS,CACtD,GAAI,mBAAyB,aAAc,OAE3C,IAAM,EAAa,EAAgB,EACnC,GAAI,EAAW,SAAW,EAAG,OAE7B,QAAQ,KACN,UAAU,EAAW,eAAe,EAAW,SAAW,EAAI,MAAQ;AAAA;AAAA,EAIpE,2EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6FAUJ",
|
|
9
|
+
"debugId": "6B1CA6B431B2ADC664756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
package/dist/orm/corpus.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corpus.d.ts","sourceRoot":"","sources":["../../orm/corpus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"corpus.d.ts","sourceRoot":"","sources":["../../orm/corpus.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,KAAK,EAAE,OAAO,EA8M1B,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EA8DrC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,OAAO,EAS/B,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,OAAO,EAqB3B,CAAC;AAuBF,gFAAgF;AAChF,wBAAgB,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,UAAQ,GAAG,OAAO,CA0C1D"}
|
|
@@ -302,11 +302,42 @@ export interface SqlDialect {
|
|
|
302
302
|
* operator whose right-hand side is a document.
|
|
303
303
|
*
|
|
304
304
|
* SQLite ignores the flag: `json_extract` already yields a SQL value rather
|
|
305
|
-
* than a JSON document for a scalar at the path.
|
|
305
|
+
* than a JSON document for a scalar at the path. That is why the null
|
|
306
|
+
* sentinels need {@link jsonValueAt} instead of this — see there.
|
|
306
307
|
*/
|
|
307
308
|
jsonExtract(column: string, path: Binder, asText: boolean): Fragment;
|
|
308
309
|
/** `<extracted> @> <value>` — Postgres only; see `jsonFilters`. */
|
|
309
310
|
jsonArrayContains(column: string, path: Binder, value: Binder): Fragment;
|
|
311
|
+
/**
|
|
312
|
+
* The value at `path` **as JSON**, in the form two JSON values compare in.
|
|
313
|
+
*
|
|
314
|
+
* The difference from {@link jsonExtract} is the whole of #407, and it is the
|
|
315
|
+
* distinction the null sentinels are made of. Both dialects have an
|
|
316
|
+
* extraction that collapses "the key is absent" into "the key holds the JSON
|
|
317
|
+
* value `null`", and both have one that does not:
|
|
318
|
+
*
|
|
319
|
+
* | | collapses | keeps the distinction |
|
|
320
|
+
* | --- | --- | --- |
|
|
321
|
+
* | postgres | `#>>` (text) | `#>` (jsonb) |
|
|
322
|
+
* | sqlite | `json_extract` | `->` (JSON text) |
|
|
323
|
+
*
|
|
324
|
+
* `jsonExtract` is the left column at `asText: true`, which is what every
|
|
325
|
+
* scalar comparison wants — a value to compare, not a document. This is the
|
|
326
|
+
* right column, and it is what lets `equals: DbNull` compile to
|
|
327
|
+
* `<value at path> is null` while `equals: JsonNull` compiles to
|
|
328
|
+
* `<value at path> = <the JSON null>`. Refusing them because `#>>` cannot
|
|
329
|
+
* tell the two apart was true of `#>>` and not of the dialect.
|
|
330
|
+
*
|
|
331
|
+
* **Postgres casts and SQLite does not**, and the cast is not decoration:
|
|
332
|
+
* `#>` on a `json` column (a `@db.Json` field) yields `json`, which has no
|
|
333
|
+
* equality operator at all — *"operator does not exist: json = jsonb"*, a
|
|
334
|
+
* raised error rather than a wrong answer, but still one Prisma does not
|
|
335
|
+
* raise. Prisma emits `(…#>…)::jsonb` for exactly this reason and so does
|
|
336
|
+
* this. SQLite's `->` already yields the JSON text form.
|
|
337
|
+
*
|
|
338
|
+
* Bound, never interpolated, for the same reason `jsonExtract` is.
|
|
339
|
+
*/
|
|
340
|
+
jsonValueAt(column: string, path: Binder): Fragment;
|
|
310
341
|
/**
|
|
311
342
|
* `limit`/`offset`. Both are values and therefore parameters — this is the
|
|
312
343
|
* single most tempting place in the compiler to inline a number.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../orm/dialect/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAE1C;;;;;;;;;OASG;IACH,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAE1C;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IAEpC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IAEpC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,QAAQ,CAAC,4BAA4B,EAAE,OAAO,CAAC;IAE/C,iFAAiF;IACjF,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAEjC;;;OAGG;IACH,WAAW,CAAC,K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E,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;IAE7D;;;;;;;;;;;;;;;OAeG;IACH,eAAe,IAAI,QAAQ,GAAG,IAAI,CAAC;IAEnC;;;;;;;;;;;OAWG;IACH,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB,GAAG,IAAI,CAAC;CACjE;AAED,mFAAmF;AACnF,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,IAAI,EAAE,QAAQ,CAAC;IACf,oEAAoE;IACpE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,OAAO,EAAE,OAAO;CAc7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAErD;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,IAAI,OAAO,EAAE,CAExC;AAkCD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU,CAIvD;AAED,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -131,6 +131,20 @@ export declare class PostgresDialect implements SqlDialect {
|
|
|
131
131
|
* one, for the same driver reason.
|
|
132
132
|
*/
|
|
133
133
|
jsonExtract(column: string, path: Binder, asText: boolean): Fragment;
|
|
134
|
+
/**
|
|
135
|
+
* `("col" #> $1)::jsonb` — the JSON value at the path, comparable.
|
|
136
|
+
*
|
|
137
|
+
* The cast is load-bearing on a `@db.Json` column and a no-op on the `jsonb`
|
|
138
|
+
* one Prisma maps `Json` to by default. Measured against Postgres 16, on a
|
|
139
|
+
* `json` column:
|
|
140
|
+
*
|
|
141
|
+
* (payload #> '{operation}') = 'null'::jsonb operator does not exist: json = jsonb
|
|
142
|
+
* ((payload #> '{operation}')::jsonb) = 'null'::jsonb the row whose key holds a JSON null
|
|
143
|
+
*
|
|
144
|
+
* Prisma emits the same cast — `("Doc"."payload"#>ARRAY[$1]::text[])::jsonb`
|
|
145
|
+
* — which is where this one comes from rather than from the manual.
|
|
146
|
+
*/
|
|
147
|
+
jsonValueAt(column: string, path: Binder): Fragment;
|
|
134
148
|
/**
|
|
135
149
|
* `("col" #> $1) @> $2` — containment, which is what Prisma's
|
|
136
150
|
* `array_contains` compiles to and why it accepts both a scalar and a list:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../../../orm/dialect/postgres.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EACL,KAAK,MAAM,EACX,KAAK,QAAQ,EAId,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAO/D,qBAAa,eAAgB,YAAW,UAAU;IAChD,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAc;IAMpC,QAAQ,CAAC,uBAAuB,QAAQ;IAGxC,QAAQ,CAAC,uBAAuB,QAAQ;IAExC,QAAQ,CAAC,iBAAiB,QAAQ;IAKlC,QAAQ,CAAC,kBAAkB,SAAS;IAKpC,QAAQ,CAAC,4BAA4B,QAAQ;IAE7C,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAahC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAgBlC,MAAM,CACJ,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GACb,QAAQ;IASX;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC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
79
|
*/
|
|
80
80
|
jsonExtract(column: string, path: Binder, _asText: boolean): Fragment;
|
|
81
|
+
/**
|
|
82
|
+
* `("col" -> ?)` — the JSON value at the path, as JSON text.
|
|
83
|
+
*
|
|
84
|
+
* **`->` rather than `json_extract`, and the difference is the whole point.**
|
|
85
|
+
* `json_extract` returns a *native* SQL value, so a JSON `null` comes back as
|
|
86
|
+
* SQL NULL and is then indistinguishable from an absent key — the collapse
|
|
87
|
+
* that had the sentinels refused here. `->` returns the JSON *text* of the
|
|
88
|
+
* subcomponent, which keeps them apart. Measured on SQLite 3.51 against
|
|
89
|
+
* `'$.operation'`:
|
|
90
|
+
*
|
|
91
|
+
* {"operation":null} ->: 'null' json_extract: NULL
|
|
92
|
+
* {"other":1} ->: NULL json_extract: NULL
|
|
93
|
+
* {"operation":"sync"} ->: '"sync"' json_extract: 'sync'
|
|
94
|
+
* {"operation":"null"} ->: '"null"' json_extract: 'null'
|
|
95
|
+
*
|
|
96
|
+
* The last row is why this is a real distinction rather than a spelling one:
|
|
97
|
+
* a JSON string `"null"` and a JSON null differ under `->` (the quotes are
|
|
98
|
+
* part of the text) and are the same under `json_extract`. So
|
|
99
|
+
* `equals: JsonNull` does not accidentally match a document holding the
|
|
100
|
+
* string.
|
|
101
|
+
*
|
|
102
|
+
* `json_type` would answer the same question and is the form #407 proposed;
|
|
103
|
+
* `->` is what Prisma emits here — `` `Doc`.`payload`->? IS NULL `` — and
|
|
104
|
+
* matching the oracle's operator costs nothing over inventing a second one.
|
|
105
|
+
* It needs SQLite 3.38 (2022); Bun ships 3.51.
|
|
106
|
+
*
|
|
107
|
+
* No cast, unlike Postgres: `->` already yields the text form both sides of
|
|
108
|
+
* the comparison are in, and `encode` spells a JSON null `'null'` for the
|
|
109
|
+
* bound side.
|
|
110
|
+
*/
|
|
111
|
+
jsonValueAt(column: string, path: Binder): Fragment;
|
|
81
112
|
jsonArrayContains(): Fragment;
|
|
82
113
|
like(lhs: string, _insensitive: boolean, pattern: Binder):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