palbase 0.3.0 → 0.3.1
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/LICENSE +3 -0
- package/dist/ai/index.js +2 -2
- package/dist/backend/engine.js +2 -2
- package/dist/backend/env.js +1 -1
- package/dist/backend/index.js +3 -3
- package/dist/backend/stack.js +1 -1
- package/dist/backend/test.js +2 -2
- package/dist/chunks/{7D5J3M3D.js → 2YUVLZLK.js} +3 -3
- package/dist/chunks/{MJ35SVVY.js → 4K4MKD2J.js} +2 -2
- package/dist/chunks/{IQIXNAI4.js → 4MOCDBZP.js} +1 -1
- package/dist/chunks/{YQYMP55L.js → 4UPL27ED.js} +1 -1
- package/dist/chunks/{AR6WQDU5.js → 6FQGUDBD.js} +2 -2
- package/dist/chunks/{A4VJFSSX.js → FVIHTHHV.js} +2 -2
- package/dist/chunks/{4LGRTNOK.js → INXQWVHU.js} +2 -2
- package/dist/chunks/{LLBV62FM.js → JF7KZUPL.js} +2 -2
- package/dist/chunks/{NDJAXNM6.js → L6GKX3XI.js} +2 -2
- package/dist/chunks/{RK6M2LNY.js → MJPUCGXY.js} +2 -2
- package/dist/chunks/{4A6S7JKW.js → NTMO2LFH.js} +2 -2
- package/dist/chunks/{6BUQ7N4I.js → TV7W53F2.js} +2 -2
- package/dist/chunks/{BPWQDLXP.js → VTNEPJRV.js} +1 -1
- package/dist/chunks/{UNOLIHKD.js → XNRYSI7A.js} +1 -1
- package/dist/chunks/{W2GV6UU3.js → XOGEEZNP.js} +2 -2
- package/dist/cli.js +77 -74
- package/dist/refuse/ai.js +1 -1
- package/dist/refuse/backend.js +1 -1
- package/dist/refuse/server.js +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/testing.js +2 -2
- package/dist/web/index.js +2 -2
- package/dist/web/palbe.js +2 -2
- package/dist/web/paywall.js +2 -2
- package/dist/web/vite.js +2 -2
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! palbase 0.3.
|
|
1
|
+
/*! palbase 0.3.1 — Palbase SDK License (see LICENSE) */
|
|
2
2
|
import{AsyncLocalStorage as g}from"node:async_hooks";function b(e,r){return new Proxy(r,{get(t,n,s){if(d.getStore()?.services===void 0)return Reflect.get(t,n,s);let o=f(e,n,t),a=o[n];return typeof a=="function"?a.bind(o):a}})}function f(e,r,t){let n=d.getStore()?.services;if(n===void 0)return t;let s=n[e];if(s!==void 0)return s;if(e==="Log"||typeof r=="symbol"||r==="then")return t;throw new Error(`${e}.${String(r)} was read, but this test did not provide ${e}. Pass it: withServices({ ${e}: \u2026 }, () => \u2026)`)}var p=Symbol.for("palbase.backend.requestScope"),d=globalThis[p]??=new g,u;function S(e){u=e}var m=new Proxy({},{get(e,r){if(!u)throw new Error(`Palbase.${String(r)} is reached before the app is served (serve() binds it)`);return u[r]}}),v=new Proxy({},{get(e,r){let t=d.getStore(),n=t?.database;if(!n)throw new Error(t?.services?`Database.${String(r)} was read, and this test gave no Database: withServices({ Database: fake.raw }, \u2026)`:t?`Database.${String(r)}: this app declares no database \u2014 PalbaseFactory.create(\u2026, { db: { schemas } })`:`Database.${String(r)} is reached outside a request: it is the request's transaction, reached from a handler, a service it calls or an @On`);let s=n[r];return typeof s=="function"?s.bind(n):s}});function c(e,r,t){let n={time:new Date().toISOString(),level:e,msg:r},s=d.getStore();if(s&&(n.request_id=s.requestId),t)for(let[a,i]of Object.entries(t))n[a]=i instanceof Error?{name:i.name,message:i.message,stack:i.stack}:i;let o=w(n);e==="error"||e==="warn"?process.stderr.write(`${o}
|
|
3
3
|
`):process.stdout.write(`${o}
|
|
4
4
|
`)}function w(e){try{return JSON.stringify(e)}catch{let r=new WeakSet;try{return JSON.stringify(e,(t,n)=>{if(typeof n=="bigint")return n.toString();if(typeof n=="object"&&n!==null){if(r.has(n))return"[circular]";r.add(n)}return n})}catch{return JSON.stringify({time:e.time,level:e.level,msg:e.msg,request_id:e.request_id,unwritable:"a field of this line could not be written"})}}}var y=b("Log",{debug:(e,r)=>c("debug",e,r),info:(e,r)=>c("info",e,r),warn:(e,r)=>c("warn",e,r),error:(e,r)=>c("error",e,r)});export{b as a,f as b,d as c,S as d,m as e,v as f,y as g};
|