palbase 0.27.0 → 0.28.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/README.md +12 -1
- 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/{UJATFHC4.js → 2XAUD7E5.js} +2 -2
- package/dist/chunks/{O5LG6IFL.js → 36Q4EJBD.js} +1 -1
- package/dist/chunks/{ZN4ELT45.js → 3G43SAQ7.js} +1 -1
- package/dist/chunks/{QL42CXIT.js → 53VJSMGY.js} +1 -1
- package/dist/chunks/5SSYP4TM.js +2 -0
- package/dist/chunks/{JCS5FSY6.js → 7M5HEXJC.js} +2 -2
- package/dist/chunks/{HHQ5RAYH.js → CQ2AKEKI.js} +2 -2
- package/dist/chunks/{5ETIB37E.js → D5YY344U.js} +2 -2
- package/dist/chunks/{LXS4IDDQ.js → DJE7B7X4.js} +2 -2
- package/dist/chunks/{AVQ7DQA4.js → DJIO7ZRV.js} +1 -1
- package/dist/chunks/{7CVC2UYK.js → EL7LGFXD.js} +2 -2
- package/dist/chunks/EXT5BO4H.js +22 -0
- package/dist/chunks/{CTKJ7E5R.js → FJWAFNAZ.js} +2 -2
- package/dist/chunks/{5PLOENVJ.js → FXV6V457.js} +1 -1
- package/dist/chunks/{2VZXMKE4.js → GP56VUVJ.js} +2 -2
- package/dist/chunks/{HKLIKCYR.js → LIB2AHJU.js} +2 -2
- package/dist/chunks/{NGAXCQJ4.js → LTS573ZP.js} +2 -2
- package/dist/chunks/{UWZP4YV6.js → MVXEPZPI.js} +2 -2
- package/dist/chunks/{R2KG2E4H.js → QUBQS6S5.js} +2 -2
- package/dist/chunks/{YS5GF7JB.js → RUQZFFRU.js} +2 -2
- package/dist/chunks/UYPJY7TK.js +2 -0
- package/dist/chunks/{XUZ532UW.js → YZCJVWWC.js} +1 -1
- package/dist/chunks/{Y2RBMBJB.js → ZVQZVVBH.js} +1 -1
- package/dist/cli.js +134 -134
- 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/calls-ui.js +46 -0
- 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 +2 -2
- package/dist/web/ssr.js +2 -2
- package/dist/web/vite.js +2 -2
- package/package.json +7 -2
- package/types/cloud/src/generated/project.d.ts +1 -0
- package/types/internal/src/modules/calls.d.ts +810 -0
- package/types/internal/src/modules/events.d.ts +4 -3
- package/types/internal/src/modules/index.d.ts +1 -0
- package/types/internal/src/modules/messaging.d.ts +53 -3
- package/types/internal/src/modules/realtime.d.ts +1 -1
- package/types/server/src/server.d.ts +7 -0
- package/types/web/src/calls-ui/index.d.ts +71 -0
- package/types/web/src/calls.d.ts +274 -0
- package/types/web/src/client.d.ts +5 -0
- package/types/web/src/index.d.ts +1 -0
- package/dist/chunks/BRK5A42K.js +0 -22
- package/dist/chunks/BXJGHBB5.js +0 -2
- package/dist/chunks/ZBY3Q6Q2.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.
|
|
1
|
+
/*! palbase 0.28.0 — Palbase SDK License (see LICENSE) */
|
|
2
2
|
var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0})};export{e as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.
|
|
1
|
+
/*! palbase 0.28.0 — Palbase SDK License (see LICENSE) */
|
|
2
2
|
var s=class extends Error{code;constructor(t,e){super(e),this.name="FieldError",this.code=t}},f="pbe1.",g="pbl1.",k=6e4,p="[A-Za-z_][A-Za-z0-9_$]{0,62}",w=new RegExp(`^${p}\\.${p}(\\.${p})?$`);function v(o){return w.test(o)}var h=class{crypto;keys=new Map;lookupKey;timer;opts;now;constructor(t){this.opts=t,this.now=t.now??Date.now}get loaded(){return this.lookupKey!==void 0}async load(t){this.crypto??=await import("node:crypto"),this.take(await this.opts.fetch(t)),this.timer===void 0&&(this.timer=setInterval(()=>{this.opts.fetch().then(e=>this.take(e),()=>{})},k),this.timer.unref?.())}close(){clearInterval(this.timer),this.timer=void 0}take(t){let e=new Map;for(let r of t.keys)e.set(r.id,{id:r.id,key:Buffer.from(r.key,"base64url"),activatesAt:Date.parse(r.activates_at)});this.keys=e,this.lookupKey=Buffer.from(t.lookup,"base64url")}ready(){if(this.crypto===void 0||this.lookupKey===void 0)throw new s("not_loaded","the project's field keys are not loaded: await palbase.fields.load() at startup");return this.crypto}currentKey(){this.ready();let t;for(let e of this.keys.values())e.activatesAt<=this.now()&&(t===void 0||e.activatesAt>=t.activatesAt)&&(t=e);if(t===void 0)throw new s("unknown_key","the project has no field key in force");return t.id}encrypt(t,e){let r=this.ready();l(t);let n=this.currentKey(),i=r.randomBytes(12);return b(r,this.keys.get(n).key,i,n,t,e)}decrypt(t,e){let r=this.ready();if(l(t),!e.startsWith(f))throw new s("not_encrypted",`${t} holds a value that is not encrypted`);let n=e.slice(f.length),i=n.indexOf("."),a=i<0?n:n.slice(0,i),u=this.keys.get(a);if(u===void 0)throw new s("unknown_key",`${t} was sealed with field key ${a}, which this project does not hold`);let c=Buffer.from(n.slice(i+1),"base64url");if(i<0||c.length<28||c.toString("base64url")!==n.slice(i+1))throw new s("unopenable",`${t} holds a value that does not open here`);try{let d=r.createDecipheriv("aes-256-gcm",u.key,c.subarray(0,12));return d.setAAD(y(t)),d.setAuthTag(c.subarray(c.length-16)),Buffer.concat([d.update(c.subarray(12,c.length-16)),d.final()]).toString("utf8")}catch{throw new s("unopenable",`${t} holds a value that does not open here: tampered, or another column's`)}}isEncrypted(t){return t.startsWith(f)}lookup(t,e){let r=this.ready();return l(t),m(r,this.lookupKey,t,e)}};function l(o){if(!v(o))throw new TypeError(`a field's address is table.column, or schema.table.column, not ${JSON.stringify(o)}`)}function y(o){return Buffer.from(`pbe1\0${o}`,"utf8")}function b(o,t,e,r,n,i){let a=o.createCipheriv("aes-256-gcm",t,e);a.setAAD(y(n));let u=Buffer.concat([e,a.update(i,"utf8"),a.final(),a.getAuthTag()]);return`${f}${r}.${u.toString("base64url")}`}function m(o,t,e,r){let n=o.createHmac("sha256",t);return n.update(`pbl1\0${e}\0`,"utf8"),n.update(r,"utf8"),`${g}${n.digest("base64url")}`}export{s as a,h as b};
|