palbase 0.44.0 → 0.44.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/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/{NVOPULRM.js → 2FPKHWVW.js} +2 -2
- package/dist/chunks/{NBS26HGY.js → 3EUGTM7R.js} +1 -1
- package/dist/chunks/{B2UB6NXM.js → 4WWSBV72.js} +1 -1
- package/dist/chunks/{CSQQWUK3.js → 5CC3IGUQ.js} +1 -1
- package/dist/chunks/{URWXDZAD.js → ANV23OPS.js} +2 -2
- package/dist/chunks/{R2ED6W3Q.js → BTO2F3RA.js} +2 -2
- package/dist/chunks/{MMATRRQU.js → BVLE3M57.js} +2 -2
- package/dist/chunks/{D3YUJVZV.js → CGP6K74O.js} +1 -1
- package/dist/chunks/{H46O3FTO.js → DFT3KHRH.js} +2 -2
- package/dist/chunks/{34R3K5US.js → FKDHMJRY.js} +1 -1
- package/dist/chunks/{OS7P6J4N.js → GIQ62AMP.js} +2 -2
- package/dist/chunks/{Q6UBSQPN.js → GJEJ43IS.js} +2 -2
- package/dist/chunks/{QKZQMN7B.js → ISRUSUM5.js} +2 -2
- package/dist/chunks/{5CCR2TT2.js → K3G3QG6H.js} +2 -2
- package/dist/chunks/{K4C4USMS.js → MFWSGSEL.js} +2 -2
- package/dist/chunks/{WWHXFMDI.js → RJYYBHRE.js} +2 -2
- package/dist/chunks/{OIZX76IE.js → RRCMPGSQ.js} +2 -2
- package/dist/chunks/{P6TUNAHK.js → SLIPXW3L.js} +2 -2
- package/dist/chunks/{4UCIQG2Y.js → VFXD5N7B.js} +1 -1
- package/dist/chunks/{YIJIXCUR.js → WESL6FVS.js} +2 -2
- package/dist/chunks/{C23X4BLJ.js → X6LXRZ3W.js} +2 -2
- package/dist/chunks/{NZSNVZQT.js → XMIGNCRO.js} +2 -2
- package/dist/chunks/{J4STW4ES.js → YBHGKJML.js} +1 -1
- package/dist/cli.js +3 -3
- package/dist/cloud/index.js +2 -2
- package/dist/refuse/ai.js +1 -1
- package/dist/refuse/backend.js +1 -1
- package/dist/refuse/cloud.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/message.js +2 -2
- package/dist/web/palbe.js +2 -2
- package/dist/web/paywall.js +2 -2
- package/dist/web/push-sw.js +1 -1
- package/dist/web/ssr.js +2 -2
- package/dist/web/vite.js +2 -2
- package/package.json +2 -2
- package/types/internal/src/modules/machines.d.ts +4 -4
package/dist/web/ssr.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.44.
|
|
2
|
-
import{B as f}from"../chunks/
|
|
1
|
+
/*! palbase 0.44.1 — Palbase SDK License (see LICENSE) */
|
|
2
|
+
import{B as f}from"../chunks/K3G3QG6H.js";import"../chunks/ISRUSUM5.js";import"../chunks/2FPKHWVW.js";import"../chunks/XMIGNCRO.js";import"../chunks/GIQ62AMP.js";import"../chunks/3EUGTM7R.js";import"../chunks/5CC3IGUQ.js";import"../chunks/MFWSGSEL.js";import"../chunks/GJEJ43IS.js";import"../chunks/ANV23OPS.js";import"../chunks/YBHGKJML.js";import"../chunks/FKDHMJRY.js";var C=Object.freeze({"Cache-Control":"private, no-cache, no-store, must-revalidate, max-age=0",Expires:"0",Pragma:"no-cache"}),x={path:"/",sameSite:"lax",secure:!0,httpOnly:!1,maxAge:400*24*60*60},u=3180,k=5*6e4;function d(t){let e=/^pb_([a-z0-9]+)_c/.exec(t)?.[1];if(e===void 0)throw new TypeError("publishableKey is the project publishable key (pb_<ref>_c\u2026)");return`pb-${e}-session`}var y=t=>{let e=new TextEncoder().encode(JSON.stringify(t)),o="";for(let s of e)o+=String.fromCharCode(s);return btoa(o).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},b=t=>{try{let e=atob(t.replace(/-/g,"+").replace(/_/g,"/")),o=JSON.parse(new TextDecoder().decode(Uint8Array.from(e,s=>s.charCodeAt(0))));return typeof o.accessToken!="string"||typeof o.refreshToken!="string"||typeof o.expiresAt!="number"||typeof o.userId!="string"?null:o}catch{return null}};function m(t,e,o={},s=!1){let c={...x,...o},g=async()=>new Map((await e.getAll()).map(n=>[n.name,n.value])),S=n=>n===t||n.startsWith(`${t}.`)&&/^\d+$/.test(n.slice(t.length+1)),h=async n=>{if(!e.setAll)return;let i=n===null?[]:n.length<=u?[[t,n]]:Array.from({length:Math.ceil(n.length/u)},(r,l)=>[`${t}.${l}`,n.slice(l*u,(l+1)*u)]),p=new Set(i.map(([r])=>r)),a=i.map(([r,l])=>({name:r,value:l,options:c}));for(let r of(await g()).keys())S(r)&&!p.has(r)&&a.push({name:r,value:"",options:{...c,maxAge:0}});a.length>0&&await e.setAll(a,{...C})};return{async load(){let n=await g(),i=n.get(t);if(i===void 0){let p="";for(let a=0;n.has(`${t}.${a}`);a++)p+=n.get(`${t}.${a}`);i=p}return i?b(i):null},save:n=>h(y(n)),clear:()=>h(null),shared:s}}function A(t){let{cookies:e,cookieOptions:o,...s}=t,c=t.refresh??(e.setAll?"before":"never");return f({...s,refresh:c,storage:m(d(t.publishableKey),e,o)})}function O(){let t=()=>{let e=globalThis.document;if(!e)throw new Error("documentCookies: there is no document here \u2014 a server gives its request's cookies to createServerClient");return e};return{getAll:()=>t().cookie.split(";").map(e=>e.trim()).filter(e=>e.includes("=")).map(e=>{let o=e.indexOf("=");return{name:e.slice(0,o),value:e.slice(o+1)}}),setAll(e){for(let o of e){let s=o.options,c=[`Path=${s.path??"/"}`,s.domain?`Domain=${s.domain}`:"",s.maxAge!==void 0?`Max-Age=${s.maxAge}`:"",s.expires?`Expires=${s.expires.toUTCString()}`:"",s.sameSite?`SameSite=${s.sameSite.charAt(0).toUpperCase()}${s.sameSite.slice(1)}`:"",s.secure?"Secure":""].filter(Boolean);t().cookie=[`${o.name}=${o.value}`,...c].join("; ")}}}}function $(t){let{cookieOptions:e,...o}=t,s=globalThis.location?.protocol==="https:";return f({...o,storage:m(d(t.publishableKey),O(),{secure:s,...e},!0)})}async function v(t){let e=await t.auth.currentSession();if(!e||(e.expiresAt-Date.now()<=k&&await t.auth.refreshSession().catch(()=>{}),!await t.auth.currentSession()))return null;try{return(await t.auth.api.verifyTokenUser()).data}catch(o){if(o.status===401)return null;throw o}}export{C as NO_STORE_HEADERS,x as SESSION_COOKIE_OPTIONS,m as cookieSessionStore,$ as createBrowserClient,A as createServerClient,O as documentCookies,v as keepSession,d as sessionCookieName};
|
package/dist/web/vite.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! palbase 0.44.
|
|
2
|
-
import"../chunks/
|
|
1
|
+
/*! palbase 0.44.1 — Palbase SDK License (see LICENSE) */
|
|
2
|
+
import"../chunks/FKDHMJRY.js";import{execFile as $}from"node:child_process";import{existsSync as y,mkdtempSync as k,readFileSync as S,rmSync as x,writeFileSync as P}from"node:fs";import{createRequire as O}from"node:module";import{tmpdir as W}from"node:os";import{dirname as g,join as o,relative as u,resolve as v,sep as d}from"node:path";var E=/\.(?:ts|js|mts|mjs)$/;function F(n){if(!/^[a-z][a-z0-9-]*$/.test(n.app))throw new TypeError(`palbase({ app }): ${JSON.stringify(n.app)} is an app's slug (palbase apps:list)`);let c=process.cwd(),p="",i="",f=()=>v(c,n.dir??"palbase"),m=()=>{let e=n.environments[p];if(!e)throw new Error(`palbase: the mode "${p}" is not built against any environment \u2014 say which in vite.config: palbase({ environments: { ${JSON.stringify(p)}: '<environment slug>' } })`);return e};return{name:"palbase",enforce:"pre",config(e,s){p=s.mode,i=s.command??"";let r=e.build?.rollupOptions?.onwarn;return{build:{rollupOptions:{onwarn(t,a){let l=String(t.exporter??t.id??"");if(t.code==="MISSING_EXPORT"&&l.includes(`${d}environments${d}`))throw new Error(`palbase: ${t.message} \u2014 ${m()}'s backend has no such route (palbase apps:sync brings what it has)`);r?r(t,a):a(t)}}}}},configResolved(e){c=e.root,p=e.mode,i=e.command??i},async buildStart(){i!=="build"||n.typecheck===!1||await j(c,m(),n.tsconfig)},resolveId(e,s){if(!s)return null;let r=f();if(e==="palbase"||e.startsWith("palbase/")){let w=u(r,s);return w.startsWith("..")||w===""?null:this.resolve(e,o(c,"index.html"),{skipSelf:!0})}if(!(e.startsWith(".")||e.startsWith("/")))return null;let t=v(g(s),e);if(E.test(t)||(t+=".ts"),g(t)!==r&&g(t)!==o(r,"palbe"))return null;let a=u(r,t),l=`${n.app}.ts`;if(a!==l&&!a.startsWith(`palbe${d}`))return null;let h=m(),b=o(r,"environments",h,a===l?l:o("palbe",a.slice(`palbe${d}`.length)));if(!y(b))throw new Error(`palbase: ${u(c,b)} is not there \u2014 palbase apps:sync writes it (is ${n.app} set in ${h}, and has ${h} that machine?)`);return b}}}async function j(n,c,p){let i=p?v(n,p):["tsconfig.app.json","tsconfig.json"].map(e=>o(n,e)).find(y);if(!i)return;if(!y(i))throw new Error(`palbase({ tsconfig }): ${u(n,i)} is not there`);let f;try{let e=O(o(n,"package.json")).resolve("typescript/package.json"),s=JSON.parse(S(e,"utf8")).bin?.tsc;if(!s)throw new Error("no tsc");f=o(g(e),s)}catch{throw new Error("palbase: the build type-checks the app against its environment with the app's TypeScript, and the app has none (npm i -D typescript) \u2014 or say palbase({ typecheck: false })")}let m=k(o(W(),"palbase-typecheck-"));try{let e=o(m,"tsconfig.json");P(e,JSON.stringify({extends:i,compilerOptions:{noEmit:!0,composite:!1,incremental:!1,moduleSuffixes:[`.${c}`,""]}}));let s=await new Promise(r=>$(process.execPath,[f,"-p",e,"--pretty","false"],{cwd:n,maxBuffer:16<<20},(t,a,l)=>r({code:t?typeof t.code=="number"?t.code:1:0,text:`${a}${l}`.trim()})));if(s.code!==0)throw new Error(`palbase: the app does not type-check against ${c}, the environment this build is made for \u2014 a route its backend does not have, or a call that does not fit it:
|
|
3
3
|
${s.text}`)}finally{x(m,{recursive:!0,force:!0})}}export{F as palbase};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "palbase",
|
|
3
|
-
"version": "0.44.
|
|
3
|
+
"version": "0.44.1",
|
|
4
4
|
"description": "Palbase for JavaScript: the web client (palbase/web), the server SDK (palbase/server), an organization's management SDK (palbase/cloud), the backend framework (palbase/backend), AI (palbase/ai) and the CLI (npx palbase).",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"homepage": "https://palbase.studio",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"@types/node": "26.6.4",
|
|
151
151
|
"bun-types": "1.4.2",
|
|
152
152
|
"livekit-client": "^2.23.0",
|
|
153
|
-
"palgres": "0.44.
|
|
153
|
+
"palgres": "0.44.1",
|
|
154
154
|
"reflect-metadata": "^0.2.2",
|
|
155
155
|
"typescript": "~6.0.3",
|
|
156
156
|
"zod": "^4.6.5"
|
|
@@ -206,7 +206,7 @@ export type Machine = {
|
|
|
206
206
|
*/
|
|
207
207
|
health_path?: string;
|
|
208
208
|
/**
|
|
209
|
-
* How many copies of the machine run while it is awake, up to 100 (one on Free), over two nodes at least and
|
|
209
|
+
* How many copies of the machine run while it is awake, up to 100 (one on Free), over two nodes at least and a few to a node (each of up to three on a node of its own, at most 29 of a hundred on one): a request is sent to one of them, a copy or a node that goes leaves the others serving, the cluster takes one of them away at a time at most (a tenth of ten or more), and a new version comes up a quarter of them at a time beside the copies that serve. Every copy is of the machine's size and counts as such against the project's limits and its machine time (a minute in which the number changed is counted at the most it was). What a copy keeps in its own memory or on its own disk the others do not see — a session, a counter, a cache, a timer: a machine with more than one keeps those where every copy reaches them. The machine finds the number in PALBASE_REPLICAS. A long-lived connection (a WebSocket) stays with the copy that took it.
|
|
210
210
|
*/
|
|
211
211
|
replicas: number;
|
|
212
212
|
/**
|
|
@@ -306,7 +306,7 @@ export type MachineCreate = {
|
|
|
306
306
|
*/
|
|
307
307
|
health_path?: string;
|
|
308
308
|
/**
|
|
309
|
-
* How many copies of the machine run while it is awake, up to 100 (one on Free), over two nodes at least and
|
|
309
|
+
* How many copies of the machine run while it is awake, up to 100 (one on Free), over two nodes at least and a few to a node (each of up to three on a node of its own, at most 29 of a hundred on one): a request is sent to one of them, a copy or a node that goes leaves the others serving, the cluster takes one of them away at a time at most (a tenth of ten or more), and a new version comes up a quarter of them at a time beside the copies that serve. Every copy is of the machine's size and counts as such against the project's limits and its machine time (a minute in which the number changed is counted at the most it was). What a copy keeps in its own memory or on its own disk the others do not see — a session, a counter, a cache, a timer: a machine with more than one keeps those where every copy reaches them. The machine finds the number in PALBASE_REPLICAS. A long-lived connection (a WebSocket) stays with the copy that took it. One when left out.
|
|
310
310
|
*/
|
|
311
311
|
replicas?: number;
|
|
312
312
|
/**
|
|
@@ -663,11 +663,11 @@ export type DatabaseUpdate = {
|
|
|
663
663
|
*/
|
|
664
664
|
size?: "dedicated-1x" | "dedicated-2x" | "free" | "hobby" | "standard-16x" | "standard-1x" | "standard-2x" | "standard-32x" | "standard-4x" | "standard-8x" | "starter";
|
|
665
665
|
/**
|
|
666
|
-
* What it holds, grown, in GB: more than it holds, 1 or a multiple of 5, up to 4,000 — never less (409 `storage_shrinks`), and six hours at least after it last grew (409 `storage_grew_recently`, Retry-After). It grows where it is, serving on; it holds the same through a change of size.
|
|
666
|
+
* What it holds, grown, in GB: more than it holds, 1 or a multiple of 5, up to 4,000 — never less (409 `storage_shrinks`), and six hours at least after it last grew (409 `storage_grew_recently`, Retry-After) — at once, though, when its organization's owners were told it is 90% full or full at what it holds (`database.storage_warning`, `database.storage_full`). It grows where it is, serving on; it holds the same through a change of size.
|
|
667
667
|
*/
|
|
668
668
|
storage_gb?: number;
|
|
669
669
|
/**
|
|
670
|
-
* Whether it grows by itself: 90% full, by half, to the next multiple of 5 GB, six hours at least after it last grew;
|
|
670
|
+
* Whether it grows by itself: 90% full, by half, to the next multiple of 5 GB, six hours at least after it last grew; as it was when left out. Of a size on a disk of its own.
|
|
671
671
|
*/
|
|
672
672
|
storage_autoscaling?: boolean;
|
|
673
673
|
};
|