palbase 0.37.1 → 0.37.2
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/{IZ6RIKPB.js → 4Y47I6LA.js} +2 -2
- package/dist/chunks/{XYRYBY7I.js → 5HYKOPCW.js} +2 -2
- package/dist/chunks/{RAPT7CYO.js → 72CHRRHY.js} +1 -1
- package/dist/chunks/{LEBJY4WH.js → A6LIFQOQ.js} +3 -3
- package/dist/chunks/{QA6474UP.js → AF3XUGHY.js} +2 -2
- package/dist/chunks/{YOR7K46P.js → C4ENQSIX.js} +1 -1
- package/dist/chunks/{AYPQOPOF.js → CHXCVOON.js} +1 -1
- package/dist/chunks/{GHUIGLRJ.js → GEZH3OTX.js} +2 -2
- package/dist/chunks/{H6LQPKWU.js → HMDMAILZ.js} +1 -1
- package/dist/chunks/{TPQAYDWC.js → IOVYIATC.js} +1 -1
- package/dist/chunks/{DQYLTIE5.js → JCHW52YV.js} +2 -2
- package/dist/chunks/{I6H2425X.js → L3S7O5FQ.js} +2 -2
- package/dist/chunks/{PMT4A5UW.js → LANEQ73A.js} +2 -2
- package/dist/chunks/{YO6MPQJ4.js → NFFQO2UC.js} +2 -2
- package/dist/chunks/{NPJJBKWB.js → P5EW3DTQ.js} +2 -2
- package/dist/chunks/{YT7ZMYMN.js → QK2S67K3.js} +2 -2
- package/dist/chunks/{VU2SS32B.js → RVRPBQ4W.js} +2 -2
- package/dist/chunks/{UA3CCXS4.js → SEECU52P.js} +2 -2
- package/dist/chunks/{MW7YMYNO.js → UBQK5O7J.js} +1 -1
- package/dist/chunks/{JEA6LCOK.js → VAPNSTWC.js} +2 -2
- package/dist/chunks/{GCVJJS4Y.js → YLLZC52Q.js} +1 -1
- package/dist/chunks/{SRDV2B4P.js → YQQHL67Y.js} +2 -2
- package/dist/chunks/{6FVAAS5I.js → ZDENVL2U.js} +2 -2
- package/dist/cli.js +2 -2
- 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/messaging/store.d.ts +2 -0
package/dist/web/message.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.37.
|
|
2
|
-
import{a as i}from"../chunks/
|
|
1
|
+
/*! palbase 0.37.2 — Palbase SDK License (see LICENSE) */
|
|
2
|
+
import{a as i}from"../chunks/5HYKOPCW.js";import{a as e,b as s,c as t,d as p,e as o,f as a,h as r,j as n,k as y,p as M,q as l,t as g}from"../chunks/IOVYIATC.js";import"../chunks/72CHRRHY.js";export{n as MESSAGE_COMPONENTS,a as MESSAGE_ICONS,r as MESSAGE_SCHEMA,s as assetId,y as countdownValues,e as fontFamily,o as htmlDocument,t as prepareAssets,i as presentMessage,g as renderMessage,M as resolveMessage,l as resolveMessageWithPaths,p as unzip};
|
package/dist/web/palbe.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.37.
|
|
2
|
-
import{c as e,d as r,i as t}from"../chunks/
|
|
1
|
+
/*! palbase 0.37.2 — Palbase SDK License (see LICENSE) */
|
|
2
|
+
import{c as e,d as r,i as t}from"../chunks/SEECU52P.js";import"../chunks/QK2S67K3.js";import"../chunks/YLLZC52Q.js";import"../chunks/LANEQ73A.js";import"../chunks/4Y47I6LA.js";import"../chunks/CHXCVOON.js";import"../chunks/72CHRRHY.js";export{e as RESERVED_CLIENT_NAMES,t as __registerBackend,r as isClientName};
|
package/dist/web/paywall.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.37.
|
|
2
|
-
import{a as f,b as d,c as m,d as u,e as A,f as c,g as R}from"../chunks/
|
|
1
|
+
/*! palbase 0.37.2 — Palbase SDK License (see LICENSE) */
|
|
2
|
+
import{a as f,b as d,c as m,d as u,e as A,f as c,g as R}from"../chunks/GEZH3OTX.js";import{a as e,b as a,c as t,d as l,e as r,f as o,g as p,i as y,k as s,l as P,n,o as i,s as w}from"../chunks/IOVYIATC.js";import"../chunks/4Y47I6LA.js";import"../chunks/CHXCVOON.js";import"../chunks/72CHRRHY.js";export{y as PAYWALL_COMPONENTS,o as PAYWALL_ICONS,p as PAYWALL_SCHEMA,c as Paywall,a as assetId,f as attributesHeader,s as countdownValues,R as defaultPaywall,e as fontFamily,u as formatPeriod,m as formatPrice,r as htmlDocument,A as packageValues,P as packagesOf,d as parseDuration,t as prepareAssets,w as renderPaywall,n as resolvePaywall,i as resolvePaywallWithPaths,l as unzip};
|
package/dist/web/push-sw.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.37.
|
|
1
|
+
/*! palbase 0.37.2 — Palbase SDK License (see LICENSE) */
|
|
2
2
|
"use strict";(()=>{function g(t,l){if(t)try{let o=new URL(t,l);if(o.protocol==="https:"||o.protocol==="http:"&&(o.hostname==="localhost"||o.hostname==="127.0.0.1"))return o.href}catch{}}function w(t){let l=new URL(t.location.href).searchParams,o=l.get("url")??"",p=l.get("key")??"",c=(e,n)=>!e||!o?Promise.resolve():t.fetch(`${o.replace(/\/$/,"")}/notify/receipts`,{method:"POST",headers:{"content-type":"application/json",apikey:p},body:JSON.stringify({receipts:[{receipt:e,status:n}]}),keepalive:!0}).catch(()=>{}),f=async(e,n)=>{for(let s of await t.clients.matchAll({type:"window",includeUncontrolled:!0}))s.postMessage({type:"palbase.push",event:e,url:n.url,data:n.data})};t.addEventListener("push",(e=>{let n={};try{n=e.data?.json()??{}}catch{}let s={url:n.url,receipt:n.receipt,data:n.data},a=n.data?.type==="messaging.message"||n.data?.pb_call==="incoming",u=async()=>a&&(await t.clients.matchAll({type:"window",includeUncontrolled:!0})).some(i=>i.focused===!0),r=async()=>{let i=n.data?.pb_call==="missed"?n.data.call_id:void 0;if(i)for(let d of await t.registration.getNotifications?.({tag:i})??[])d.close()};e.waitUntil(Promise.all([u(),r().catch(()=>{})]).then(([i])=>i?void 0:t.registration.showNotification(n.title??"",{body:n.body,image:n.image,tag:n.tag,data:s})).then(()=>Promise.all([c(n.receipt,"delivered"),f("received",s)])))})),t.addEventListener("notificationclick",(e=>{e.notification.close();let n=e.notification.data??{},s=n.data?.pb_call!==void 0,a=g(n.url,t.location.origin)??(s?g(t.registration.scope??"/",t.location.origin):void 0),u=async()=>{if(!a)return;let r=await t.clients.matchAll({type:"window",includeUncontrolled:!0}),i=r.find(d=>d.url===a)??(s&&!n.url?r.find(d=>d.focused)??r[0]:void 0);i?await i.focus():await t.clients.openWindow(a)};e.waitUntil(Promise.all([c(n.receipt,"opened"),u(),f("opened",n)]))})),t.addEventListener("notificationclose",(e=>{e.waitUntil(c(e.notification.data?.receipt,"dismissed"))}))}typeof self<"u"&&typeof self.registration=="object"&&!("document"in self)&&w(self);})();
|
package/dist/web/ssr.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.37.
|
|
2
|
-
import{B as f}from"../chunks/
|
|
1
|
+
/*! palbase 0.37.2 — Palbase SDK License (see LICENSE) */
|
|
2
|
+
import{B as f}from"../chunks/A6LIFQOQ.js";import"../chunks/SEECU52P.js";import"../chunks/QK2S67K3.js";import"../chunks/GEZH3OTX.js";import"../chunks/5HYKOPCW.js";import"../chunks/IOVYIATC.js";import"../chunks/YLLZC52Q.js";import"../chunks/L3S7O5FQ.js";import"../chunks/LANEQ73A.js";import"../chunks/4Y47I6LA.js";import"../chunks/CHXCVOON.js";import"../chunks/72CHRRHY.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.37.
|
|
2
|
-
import"../chunks/
|
|
1
|
+
/*! palbase 0.37.2 — Palbase SDK License (see LICENSE) */
|
|
2
|
+
import"../chunks/72CHRRHY.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.37.
|
|
3
|
+
"version": "0.37.2",
|
|
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.37.
|
|
153
|
+
"palgres": "0.37.2",
|
|
154
154
|
"reflect-metadata": "^0.2.2",
|
|
155
155
|
"typescript": "~6.0.3",
|
|
156
156
|
"zod": "^4.6.5"
|
|
@@ -95,6 +95,8 @@ export declare class Store {
|
|
|
95
95
|
* server said and the newest of its timeline the store holds — as the store holds it (edited, removed).
|
|
96
96
|
*/
|
|
97
97
|
list(): Conversation[];
|
|
98
|
+
/** Whether the store holds every message of a conversation the reader may see in it, from its first to its last (its threads' answers too: they take the conversation's numbers). */
|
|
99
|
+
holdsAll(conversationId: string): boolean;
|
|
98
100
|
private withLast;
|
|
99
101
|
/** A conversation's own timeline (its messages and the answers sent to it too), the oldest first. */
|
|
100
102
|
timeline(conversationId: string): Message[];
|