@pyric/cli 0.1.0-alpha.15 → 0.1.0-alpha.16

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.
Files changed (36) hide show
  1. package/dist/bridge/client/dispatch.js +1 -1
  2. package/dist/bridge/client/dispatch.js.map +1 -1
  3. package/dist/serve/entries/auth-helper-core.d.ts +9 -0
  4. package/dist/serve/entries/auth-helper-core.d.ts.map +1 -1
  5. package/dist/serve/entries/auth-helper-core.js +28 -1
  6. package/dist/serve/entries/auth-helper-core.js.map +1 -1
  7. package/dist/serve/entries/auth.d.ts.map +1 -1
  8. package/dist/serve/entries/auth.js +6 -4
  9. package/dist/serve/entries/auth.js.map +1 -1
  10. package/dist/serve/site-ui/_astro/app.4HeLP_FA.js +109 -0
  11. package/dist/serve/site-ui/_astro/app.BgSnCR5G.js +1 -0
  12. package/dist/serve/site-ui/_astro/{chess-showcase.DzPO6kz0.js → chess-showcase.CnoxIle5.js} +1 -1
  13. package/dist/serve/site-ui/_astro/{example-runtime.CM0H02rx.js → example-runtime.R1d96L6-.js} +1 -1
  14. package/dist/serve/site-ui/_astro/index.BJiOemMX.js +1 -0
  15. package/dist/serve/site-ui/_astro/{reads.D1exkX1-.js → reads.BrKNdKAa.js} +1 -1
  16. package/dist/serve/site-ui/_astro/{sandbox-controls.BqMePr5V.js → sandbox-controls.BTb3EbQp.js} +32 -32
  17. package/dist/serve/site-ui/_astro/{seed.BCn5DhHS.js → seed.EyI3VYEu.js} +1 -1
  18. package/dist/serve/site-ui/auth/index.html +1 -1
  19. package/dist/serve/site-ui/docs/examples/chess/index.html +1 -1
  20. package/dist/serve/site-ui/docs/pyric-auth-reference-api/index.html +1 -1
  21. package/dist/serve/site-ui/docs/pyric-auth-reference-api.md +1 -1
  22. package/dist/serve/site-ui/examples/chess/index.html +1 -1
  23. package/dist/serve/site-ui/examples/firestore-first-write/index.html +1 -1
  24. package/dist/serve/site-ui/firestore/index.html +1 -1
  25. package/dist/serve/site-ui/index.html +1 -1
  26. package/dist/serve/site-ui/rtdb/index.html +1 -1
  27. package/dist/serve/site-ui/settings/index.html +1 -1
  28. package/dist/serve/site-ui/storage/index.html +1 -1
  29. package/dist/serve/site-ui/traffic/index.html +1 -1
  30. package/package.json +4 -4
  31. package/src/bridge/client/dispatch.ts +1 -1
  32. package/src/serve/entries/auth-helper-core.ts +35 -1
  33. package/src/serve/entries/auth.ts +8 -4
  34. package/dist/serve/site-ui/_astro/app.BnMC0ywl.js +0 -109
  35. package/dist/serve/site-ui/_astro/app.DVXXR-WI.js +0 -1
  36. package/dist/serve/site-ui/_astro/index.B4Kh80he.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as o}from"./jsx-runtime.D_zvdyIk.js";import{g as p,d as f,b as l,e as g,s as h,a as _}from"./sandbox-controls.BqMePr5V.js";import{g as k}from"./reads.D1exkX1-.js";import{r as c}from"./index.DBy5LfQW.js";function S(n){if(n.presentation==="showcase")throw new Error(`Pyric showcase '${n.header}' cannot use the generic example runtime`)}const b={header:"Play chess against Security Rules",subLabel:"Firestore Security Rules · Isolated browser sandbox",summary:"Move a piece; Pyric commits the new board or denies the write.",docsPath:"/docs/examples/chess/",service:"firestore",presentation:"showcase",renderer:"chess"};async function w({sandbox:n}){const t=p(n.withAuth({uid:"ada"})),e=f(t,"notes","first");return await l(e,{title:"The sandbox is local",ownerId:"ada"}),(await k(e)).data()}const x={header:"Write to an isolated Firestore sandbox",subLabel:"Cloud Firestore · Browser sandbox",summary:"Run a Firestore write and read without starting a SharedWorker or touching another example.",docsPath:"/docs/build/cloud-firestore/",service:"firestore",firestore:{rules:`
1
+ import{j as o}from"./jsx-runtime.D_zvdyIk.js";import{g as p,d as f,b as l,e as g,s as h,a as _}from"./sandbox-controls.BTb3EbQp.js";import{g as k}from"./reads.BrKNdKAa.js";import{r as c}from"./index.DBy5LfQW.js";function S(n){if(n.presentation==="showcase")throw new Error(`Pyric showcase '${n.header}' cannot use the generic example runtime`)}const b={header:"Play chess against Security Rules",subLabel:"Firestore Security Rules · Isolated browser sandbox",summary:"Move a piece; Pyric commits the new board or denies the write.",docsPath:"/docs/examples/chess/",service:"firestore",presentation:"showcase",renderer:"chess"};async function w({sandbox:n}){const t=p(n.withAuth({uid:"ada"})),e=f(t,"notes","first");return await l(e,{title:"The sandbox is local",ownerId:"ada"}),(await k(e)).data()}const x={header:"Write to an isolated Firestore sandbox",subLabel:"Cloud Firestore · Browser sandbox",summary:"Run a Firestore write and read without starting a SharedWorker or touching another example.",docsPath:"/docs/build/cloud-firestore/",service:"firestore",firestore:{rules:`
2
2
  rules_version = '2';
3
3
  service cloud.firestore {
4
4
  match /databases/{database}/documents {
@@ -0,0 +1 @@
1
+ import{e as o}from"./sandbox-controls.BTb3EbQp.js";function t(i={}){return o()}export{t as i};
@@ -1 +1 @@
1
- import{q as h,ai as u,aj as g,j as y,ak as m,l as q,al as Q,v as k,o as M,u as b,am as W,t as v,an as C,ao as E}from"./sandbox-controls.BqMePr5V.js";const D=new WeakMap;function U(e){return D.get(e)?.raw??e}const z=new WeakMap,x=new WeakMap;function l(e,a,t,n,r){D.set(e,{target:t,path:a.ref.path,kind:r,converter:n,raw:a})}function F(e,a){const t=b(e),n=b(a);return t.isStructurallyEqual?.(n)??t===n}function I(e,a,t,n){const r=e,s=(x.get(r)??[]).filter(c=>c.query.deref()!==void 0),o=s.find(c=>{const i=c.query.deref();return i!==void 0&&F(i,a)});if(o!==void 0){const c=T(o.docs,t)&&o.metadata.fromCache===n.fromCache&&o.metadata.hasPendingWrites===n.hasPendingWrites;return o.docs=t,o.metadata=n,c?"settled":"initial"}return s.push({query:new WeakRef(a),docs:t,metadata:n}),x.set(r,s),"initial"}function T(e,a){return e.length===a.length&&e.every((t,n)=>{const r=a[n];return t.path===r.path&&W(t.data,r.data)})}function S(e,a,t,n,r){const s=a,o=d=>({path:d.ref?.path??"",data:M(d.data?.(),t)}),c=Object.freeze((s.docs??[]).map(o)),i=Object.freeze((s.docChanges?.()??[]).map(d=>({...o(d.doc??{}),type:d.type??"",oldIndex:d.oldIndex??-1,newIndex:d.newIndex??-1}))),f=Object.freeze({fromCache:s.metadata?.fromCache===!0,hasPendingWrites:s.metadata?.hasPendingWrites===!0});z.set(e,{target:t,query:n,converter:y(n)??null,source:r,...r==="read"?{readPhase:I(t,n,c,f)}:{},metadata:f,docs:c,changes:i})}function O(e,a){const t=e,n=t.data.bind(e);return Object.defineProperty(t,"data",{value:()=>g(n()),configurable:!0,writable:!0}),a&&t.ref?.path&&Object.defineProperty(t,"metadata",{value:h(a).snapshotMetadata(t.ref.path),configurable:!0}),e}function P(e,a,t,n){const r={id:e.id,ref:e.ref,exists:e.exists,metadata:h(t).snapshotMetadata(e.ref.path),data:()=>{if(!(typeof e.exists=="function"?e.exists():e.exists))return;const o=g(e.data()),c={id:e.id,ref:e.ref,exists:!0,metadata:h(t).snapshotMetadata(e.ref.path),data:()=>o};return a.fromFirestore(c)}};return u(r,t),u(e.ref,t),p(e.ref,t),l(r,e,t,a,n),r}function j(e,a){if(!e||typeof e!="object")return e;u(e,a);const t=e;if(t.ref&&(u(t.ref,a),p(t.ref,a)),w(t),Array.isArray(t.docs))for(const n of t.docs)n&&(u(n,a),l(n,n,a,null,"query-child")),n?.ref&&(u(n.ref,a),p(n.ref,a)),n&&w(n);else t.ref&&l(e,e,a,null,"document");return e}function p(e,a){if(typeof e.path!="string"||e.path.length===0)return;const t=e.path;try{const n=m.get(e),r=n??q(a).doc(t);n===void 0&&m.set(e,r),Q(e,t,a,r),a.kind==="sandbox-live"&&k.set(r,s=>s.doc(t))}catch{}}function w(e){const a=e.exists;if(typeof a=="function")return;const t=a===!0;try{Object.defineProperty(e,"exists",{value:()=>t,writable:!0,configurable:!0,enumerable:!0})}catch{}}async function B(e){const a=v(e),t=h(a);t.markStarted();const n=y(e),r=await C(a,e).get();return t.cachePath(e.path),n?P(r,n,a,"document"):(j(r,a),O(r,a))}async function K(e){const a=v(e),t=h(a);t.markStarted();const n=y(e),r=await E(a,e).get();if(t.cacheQuery(e),n){const o=n,c=r.docs.map(f=>P(f,o,a,"query-child")),i=u({size:c.length,empty:c.length===0,docs:c,metadata:t.querySnapshotMetadata()},a);for(const f of c)t.cachePath(f.ref.path);return S(i,r,a,e,"read"),i}j(r,a);const s=r.docs;for(const o of s)t.cachePath(o.ref.path),O(o,a);return Object.defineProperty(r,"metadata",{value:t.querySnapshotMetadata(),configurable:!0}),S(r,r,a,e,"read"),r}export{S as a,K as b,B as g,U as r,j as t,O as w};
1
+ import{q as h,ah as u,ai as g,j as y,aj as m,l as q,ak as Q,v as k,o as M,u as b,al as W,t as v,am as C,an as E}from"./sandbox-controls.BTb3EbQp.js";const D=new WeakMap;function U(e){return D.get(e)?.raw??e}const z=new WeakMap,x=new WeakMap;function l(e,a,t,n,r){D.set(e,{target:t,path:a.ref.path,kind:r,converter:n,raw:a})}function F(e,a){const t=b(e),n=b(a);return t.isStructurallyEqual?.(n)??t===n}function I(e,a,t,n){const r=e,s=(x.get(r)??[]).filter(c=>c.query.deref()!==void 0),o=s.find(c=>{const i=c.query.deref();return i!==void 0&&F(i,a)});if(o!==void 0){const c=T(o.docs,t)&&o.metadata.fromCache===n.fromCache&&o.metadata.hasPendingWrites===n.hasPendingWrites;return o.docs=t,o.metadata=n,c?"settled":"initial"}return s.push({query:new WeakRef(a),docs:t,metadata:n}),x.set(r,s),"initial"}function T(e,a){return e.length===a.length&&e.every((t,n)=>{const r=a[n];return t.path===r.path&&W(t.data,r.data)})}function S(e,a,t,n,r){const s=a,o=d=>({path:d.ref?.path??"",data:M(d.data?.(),t)}),c=Object.freeze((s.docs??[]).map(o)),i=Object.freeze((s.docChanges?.()??[]).map(d=>({...o(d.doc??{}),type:d.type??"",oldIndex:d.oldIndex??-1,newIndex:d.newIndex??-1}))),f=Object.freeze({fromCache:s.metadata?.fromCache===!0,hasPendingWrites:s.metadata?.hasPendingWrites===!0});z.set(e,{target:t,query:n,converter:y(n)??null,source:r,...r==="read"?{readPhase:I(t,n,c,f)}:{},metadata:f,docs:c,changes:i})}function O(e,a){const t=e,n=t.data.bind(e);return Object.defineProperty(t,"data",{value:()=>g(n()),configurable:!0,writable:!0}),a&&t.ref?.path&&Object.defineProperty(t,"metadata",{value:h(a).snapshotMetadata(t.ref.path),configurable:!0}),e}function P(e,a,t,n){const r={id:e.id,ref:e.ref,exists:e.exists,metadata:h(t).snapshotMetadata(e.ref.path),data:()=>{if(!(typeof e.exists=="function"?e.exists():e.exists))return;const o=g(e.data()),c={id:e.id,ref:e.ref,exists:!0,metadata:h(t).snapshotMetadata(e.ref.path),data:()=>o};return a.fromFirestore(c)}};return u(r,t),u(e.ref,t),p(e.ref,t),l(r,e,t,a,n),r}function j(e,a){if(!e||typeof e!="object")return e;u(e,a);const t=e;if(t.ref&&(u(t.ref,a),p(t.ref,a)),w(t),Array.isArray(t.docs))for(const n of t.docs)n&&(u(n,a),l(n,n,a,null,"query-child")),n?.ref&&(u(n.ref,a),p(n.ref,a)),n&&w(n);else t.ref&&l(e,e,a,null,"document");return e}function p(e,a){if(typeof e.path!="string"||e.path.length===0)return;const t=e.path;try{const n=m.get(e),r=n??q(a).doc(t);n===void 0&&m.set(e,r),Q(e,t,a,r),a.kind==="sandbox-live"&&k.set(r,s=>s.doc(t))}catch{}}function w(e){const a=e.exists;if(typeof a=="function")return;const t=a===!0;try{Object.defineProperty(e,"exists",{value:()=>t,writable:!0,configurable:!0,enumerable:!0})}catch{}}async function B(e){const a=v(e),t=h(a);t.markStarted();const n=y(e),r=await C(a,e).get();return t.cachePath(e.path),n?P(r,n,a,"document"):(j(r,a),O(r,a))}async function K(e){const a=v(e),t=h(a);t.markStarted();const n=y(e),r=await E(a,e).get();if(t.cacheQuery(e),n){const o=n,c=r.docs.map(f=>P(f,o,a,"query-child")),i=u({size:c.length,empty:c.length===0,docs:c,metadata:t.querySnapshotMetadata()},a);for(const f of c)t.cachePath(f.ref.path);return S(i,r,a,e,"read"),i}j(r,a);const s=r.docs;for(const o of s)t.cachePath(o.ref.path),O(o,a);return Object.defineProperty(r,"metadata",{value:t.querySnapshotMetadata(),configurable:!0}),S(r,r,a,e,"read"),r}export{S as a,K as b,B as g,U as r,j as t,O as w};