palbase 0.55.0 → 0.56.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.
- 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/{6X3XM2HT.js → 4NV7IO2S.js} +1 -1
- package/dist/chunks/{FGTR7LLE.js → 4YXXQ7Q5.js} +2 -2
- package/dist/chunks/{RJ5MLGLE.js → 543OFP2U.js} +2 -2
- package/dist/chunks/{DJ2NHWNF.js → 5KZ7BNHT.js} +2 -2
- package/dist/chunks/{G7BY26CD.js → 65V7GNEM.js} +2 -2
- package/dist/chunks/{ZYCXGDBY.js → 75BTO7OI.js} +2 -2
- package/dist/chunks/{M6RY7CMN.js → 7MK32RA6.js} +2 -2
- package/dist/chunks/{7IIRNEQN.js → 7ZYH34FN.js} +2 -2
- package/dist/chunks/{YVESB5LJ.js → BNFICIES.js} +2 -2
- package/dist/chunks/{GVWWIGZU.js → C2OTNTXA.js} +1 -1
- package/dist/chunks/{6RKVM7ES.js → CSNHLLE6.js} +2 -2
- package/dist/chunks/{JYPU73Y2.js → GWMZNN5L.js} +2 -2
- package/dist/chunks/{KXKU2KEC.js → HTVMQDSA.js} +2 -2
- package/dist/chunks/{ZMCQX2HG.js → J6FRNJGZ.js} +1 -1
- package/dist/chunks/{L57UHYJI.js → JU7SZLXD.js} +2 -2
- package/dist/chunks/{4FDO6U4S.js → NQPWRIQ4.js} +2 -2
- package/dist/chunks/{MUACFIMV.js → NZAUMQZ4.js} +2 -2
- package/dist/chunks/{3IWQNYAZ.js → RG6GEELN.js} +1 -1
- package/dist/chunks/{GOAHEPVR.js → SGZVLJOC.js} +1 -1
- package/dist/chunks/{S2EM5STR.js → SRU5AQSE.js} +1 -1
- package/dist/chunks/{6RFOF7QX.js → VBOBWBGR.js} +2 -2
- package/dist/chunks/{ZKJTGRMJ.js → W2JFZOBT.js} +2 -2
- package/dist/chunks/{6WXMLOSG.js → XMDMOVU2.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/stores.d.ts +38 -0
package/dist/web/ssr.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.
|
|
2
|
-
import{B as g}from"../chunks/
|
|
1
|
+
/*! palbase 0.56.0 — Palbase SDK License (see LICENSE) */
|
|
2
|
+
import{B as g}from"../chunks/GWMZNN5L.js";import"../chunks/JU7SZLXD.js";import"../chunks/NQPWRIQ4.js";import"../chunks/W2JFZOBT.js";import"../chunks/BNFICIES.js";import"../chunks/SRU5AQSE.js";import"../chunks/J6FRNJGZ.js";import"../chunks/HTVMQDSA.js";import"../chunks/7ZYH34FN.js";import"../chunks/NZAUMQZ4.js";import"../chunks/SGZVLJOC.js";import"../chunks/C2OTNTXA.js";var A=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},h=3180,$=5*6e4;function b(e,t={}){let s=/^pb_([a-z0-9]+)_c/.exec(e)?.[1];if(s===void 0)throw new TypeError("publishableKey is the project publishable key (pb_<ref>_c\u2026)");let o={...x,...t};return`${o.secure===!0&&!o.domain&&(o.path??"/")==="/"?"__Host-":""}pb-${s}-session`}var v=e=>{let t=new TextEncoder().encode(JSON.stringify(e)),s="";for(let o of t)s+=String.fromCharCode(o);return btoa(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},_=e=>{try{let t=atob(e.replace(/-/g,"+").replace(/_/g,"/")),s=JSON.parse(new TextDecoder().decode(Uint8Array.from(t,o=>o.charCodeAt(0))));return typeof s.accessToken!="string"||typeof s.refreshToken!="string"||typeof s.expiresAt!="number"||typeof s.userId!="string"?null:s}catch{return null}},f="__Host-",C=!1;function w(e,t,s={},o=!1){let r={...x,...s},d=async()=>new Map((await t.getAll()).map(n=>[n.name,n.value])),m=n=>a=>a===n||a.startsWith(`${n}.`)&&/^\d+$/.test(a.slice(n.length+1)),S=m(e),k=e.startsWith(f)?e.slice(f.length):f+e,O=m(k),y=async n=>{if(!t.setAll)return;let a=n===null?[]:n.length<=h?[[e,n]]:Array.from({length:Math.ceil(n.length/h)},(i,u)=>[`${e}.${u}`,n.slice(u*h,(u+1)*h)]),l=new Set(a.map(([i])=>i)),c=a.map(([i,u])=>({name:i,value:u,options:r})),p=await d();for(let i of p.keys())S(i)&&!l.has(i)&&c.push({name:i,value:"",options:{...r,maxAge:0}});if(e.startsWith(f))for(let i of p.keys())O(i)&&c.push({name:i,value:"",options:{...r,maxAge:0}});c.length>0&&await t.setAll(c,{...A})};return{async load(){let n=await d(),a=[...n.keys()];!C&&!a.some(S)&&a.some(O)&&(C=!0,console.warn(`palbase: the request holds a session cookie named ${k}, and this client reads ${e}: no one is signed in here. The browser's client and the server's name it from the same cookieOptions \u2014 on http (localhost) the server's needs cookieOptions: { secure: false }.`));let l=n.get(e);if(l===void 0){let c="";for(let p=0;n.has(`${e}.${p}`);p++)c+=n.get(`${e}.${p}`);l=c}return l?_(l):null},save:n=>y(v(n)),clear:()=>y(null),shared:o}}function P(e){let{cookies:t,cookieOptions:s,...o}=e,r=e.refresh??(t.setAll?"before":"never");return g({...o,refresh:r,storage:w(b(e.publishableKey,s),t,s)})}function T(){let e=()=>{let t=globalThis.document;if(!t)throw new Error("documentCookies: there is no document here \u2014 a server gives its request's cookies to createServerClient");return t};return{getAll:()=>e().cookie.split(";").map(t=>t.trim()).filter(t=>t.includes("=")).map(t=>{let s=t.indexOf("=");return{name:t.slice(0,s),value:t.slice(s+1)}}),setAll(t){for(let s of t){let o=s.options,r=[`Path=${o.path??"/"}`,o.domain?`Domain=${o.domain}`:"",o.maxAge!==void 0?`Max-Age=${o.maxAge}`:"",o.expires?`Expires=${o.expires.toUTCString()}`:"",o.sameSite?`SameSite=${o.sameSite.charAt(0).toUpperCase()}${o.sameSite.slice(1)}`:"",o.secure?"Secure":""].filter(Boolean);e().cookie=[`${s.name}=${s.value}`,...r].join("; ")}}}}function M(e){let{cookieOptions:t,...s}=e,r={secure:globalThis.location?.protocol==="https:",...t};return g({...s,storage:w(b(e.publishableKey,r),T(),r,!0)})}async function N(e){let t=await e.auth.currentSession();if(!t||(t.expiresAt-Date.now()<=$&&await e.auth.refreshSession().catch(()=>{}),!await e.auth.currentSession()))return null;try{return(await e.auth.api.verifyTokenUser()).data}catch(s){if(s.status===401)return null;throw s}}export{A as NO_STORE_HEADERS,x as SESSION_COOKIE_OPTIONS,w as cookieSessionStore,M as createBrowserClient,P as createServerClient,T as documentCookies,N as keepSession,b as sessionCookieName};
|
package/dist/web/vite.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! palbase 0.
|
|
2
|
-
import"../chunks/
|
|
1
|
+
/*! palbase 0.56.0 — Palbase SDK License (see LICENSE) */
|
|
2
|
+
import"../chunks/C2OTNTXA.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.
|
|
3
|
+
"version": "0.56.0",
|
|
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.
|
|
153
|
+
"palgres": "0.56.0",
|
|
154
154
|
"reflect-metadata": "^0.2.2",
|
|
155
155
|
"typescript": "~6.0.3",
|
|
156
156
|
"zod": "^4.6.5"
|
|
@@ -3082,6 +3082,35 @@ export type InstallManifest = string;
|
|
|
3082
3082
|
* A signed build: an .ipa, or an Android .apk.
|
|
3083
3083
|
*/
|
|
3084
3084
|
export type BuildFile = Blob;
|
|
3085
|
+
/**
|
|
3086
|
+
* The latest install on the person's link, as the module saw it (iOS): iOS installs on the phone and tells no page whether it did. Absent before Install was tapped.
|
|
3087
|
+
*/
|
|
3088
|
+
export type InstallDownload = {
|
|
3089
|
+
/**
|
|
3090
|
+
* Seconds since the install's latest step: a page reads a step after its own tap alone.
|
|
3091
|
+
*/
|
|
3092
|
+
ago: number;
|
|
3093
|
+
/**
|
|
3094
|
+
* The model the phone asking said it is, by its name (iPhone 17 Pro).
|
|
3095
|
+
*/
|
|
3096
|
+
model?: string;
|
|
3097
|
+
/**
|
|
3098
|
+
* The person's phones of the model asking are registered, but not in the build yet: Apple is processing them, or the signing is under way.
|
|
3099
|
+
*/
|
|
3100
|
+
pending?: boolean;
|
|
3101
|
+
/**
|
|
3102
|
+
* How much of the build is sent, 0 to 100.
|
|
3103
|
+
*/
|
|
3104
|
+
percent: number;
|
|
3105
|
+
/**
|
|
3106
|
+
* asked (the phone asked for the manifest; iOS then asks the person, naming the app), downloading, downloaded (iOS installs it from there), or cut (the download ended short).
|
|
3107
|
+
*/
|
|
3108
|
+
stage: "asked" | "downloading" | "downloaded" | "cut";
|
|
3109
|
+
/**
|
|
3110
|
+
* No phone of the person's is the model asking: this iPhone is not one they registered, and iOS would drop the install without a word.
|
|
3111
|
+
*/
|
|
3112
|
+
unsigned?: boolean;
|
|
3113
|
+
};
|
|
3085
3114
|
/**
|
|
3086
3115
|
* One of the person's phones, on their install page.
|
|
3087
3116
|
*/
|
|
@@ -3098,11 +3127,20 @@ export type InstallPhone = {
|
|
|
3098
3127
|
* ready (the build installs on it), preparing, processing (Apple is processing it: up to 72 hours), refused (Apple does not take it).
|
|
3099
3128
|
*/
|
|
3100
3129
|
state: "ready" | "preparing" | "processing" | "refused";
|
|
3130
|
+
/**
|
|
3131
|
+
* The phone the page is open on: it registered from this page.
|
|
3132
|
+
*/
|
|
3133
|
+
this?: boolean;
|
|
3101
3134
|
};
|
|
3102
3135
|
/**
|
|
3103
3136
|
* A person's install page as it is now: the step they are at, what to do, their phones, and the links that take them on.
|
|
3104
3137
|
*/
|
|
3105
3138
|
export type InstallStatus = {
|
|
3139
|
+
/**
|
|
3140
|
+
* A ready page on an iPhone it does not know (one that has not registered from this page): installing and registering this iPhone are offered alike, as the page cannot tell whether this iPhone is one of those listed.
|
|
3141
|
+
*/
|
|
3142
|
+
choose?: boolean;
|
|
3143
|
+
download?: InstallDownload;
|
|
3106
3144
|
/**
|
|
3107
3145
|
* The registration profile's address (an iPhone's).
|
|
3108
3146
|
*/
|