1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-01-06 00:18:50 +02:00

added fields query param to the api docs preview

This commit is contained in:
Gani Georgiev 2023-05-20 05:58:52 +03:00
parent 3820f3d7d7
commit f49e90bd0b
48 changed files with 896 additions and 818 deletions

View File

@ -0,0 +1,66 @@
import{S as $e,i as Se,s as ye,e as c,w,b as k,c as oe,f as h,g as d,h as a,m as se,x as G,N as we,P as Te,k as je,Q as Ae,n as Be,t as U,a as W,o as u,d as ae,T as Fe,C as Oe,p as Qe,r as V,u as Ne,M as He}from"./index-055843b5.js";import{S as Ke}from"./SdkTabs-1c685373.js";import{F as qe}from"./FieldsQueryParam-815b0ee8.js";function ve(n,l,o){const s=n.slice();return s[5]=l[o],s}function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Pe(n,l){let o,s=l[5].code+"",_,p,i,f;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=c("button"),_=w(s),p=k(),h(o,"class","tab-item"),V(o,"active",l[1]===l[5].code),this.first=o},m(v,C){d(v,o,C),a(o,_),a(o,p),i||(f=Ne(o,"click",m),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&G(_,s),C&6&&V(o,"active",l[1]===l[5].code)},d(v){v&&u(o),i=!1,f()}}}function Me(n,l){let o,s,_,p;return s=new He({props:{content:l[5].body}}),{key:n,first:null,c(){o=c("div"),oe(s.$$.fragment),_=k(),h(o,"class","tab-item"),V(o,"active",l[1]===l[5].code),this.first=o},m(i,f){d(i,o,f),se(s,o,null),a(o,_),p=!0},p(i,f){l=i;const m={};f&4&&(m.content=l[5].body),s.$set(m),(!p||f&6)&&V(o,"active",l[1]===l[5].code)},i(i){p||(U(s.$$.fragment,i),p=!0)},o(i){W(s.$$.fragment,i),p=!1},d(i){i&&u(o),ae(s)}}}function ze(n){var _e,be;let l,o,s=n[0].name+"",_,p,i,f,m,v,C,H=n[0].name+"",L,ne,E,P,I,j,J,M,K,ie,q,A,ce,Y,z=n[0].name+"",X,re,R,B,Z,$,x,de,ee,T,te,F,le,S,O,g=[],ue=new Map,fe,Q,b=[],me=new Map,y;P=new Ke({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${n[3]}');
...
const result = await pb.collection('${(_e=n[0])==null?void 0:_e.name}').listAuthMethods();
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${n[3]}');
...
final result = await pb.collection('${(be=n[0])==null?void 0:be.name}').listAuthMethods();
`}}),T=new qe({});let D=n[2];const pe=e=>e[5].code;for(let e=0;e<D.length;e+=1){let t=Ce(n,D,e),r=pe(t);ue.set(r,g[e]=Pe(r,t))}let N=n[2];const he=e=>e[5].code;for(let e=0;e<N.length;e+=1){let t=ve(n,N,e),r=he(t);me.set(r,b[e]=Me(r,t))}return{c(){l=c("h3"),o=w("List auth methods ("),_=w(s),p=w(")"),i=k(),f=c("div"),m=c("p"),v=w("Returns a public list with all allowed "),C=c("strong"),L=w(H),ne=w(" authentication methods."),E=k(),oe(P.$$.fragment),I=k(),j=c("h6"),j.textContent="API details",J=k(),M=c("div"),K=c("strong"),K.textContent="GET",ie=k(),q=c("div"),A=c("p"),ce=w("/api/collections/"),Y=c("strong"),X=w(z),re=w("/auth-methods"),R=k(),B=c("div"),B.textContent="Query parameters",Z=k(),$=c("table"),x=c("thead"),x.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,de=k(),ee=c("tbody"),oe(T.$$.fragment),te=k(),F=c("div"),F.textContent="Responses",le=k(),S=c("div"),O=c("div");for(let e=0;e<g.length;e+=1)g[e].c();fe=k(),Q=c("div");for(let e=0;e<b.length;e+=1)b[e].c();h(l,"class","m-b-sm"),h(f,"class","content txt-lg m-b-sm"),h(j,"class","m-b-xs"),h(K,"class","label label-primary"),h(q,"class","content"),h(M,"class","alert alert-info"),h(B,"class","section-title"),h($,"class","table-compact table-border m-b-base"),h(F,"class","section-title"),h(O,"class","tabs-header compact left"),h(Q,"class","tabs-content"),h(S,"class","tabs")},m(e,t){d(e,l,t),a(l,o),a(l,_),a(l,p),d(e,i,t),d(e,f,t),a(f,m),a(m,v),a(m,C),a(C,L),a(m,ne),d(e,E,t),se(P,e,t),d(e,I,t),d(e,j,t),d(e,J,t),d(e,M,t),a(M,K),a(M,ie),a(M,q),a(q,A),a(A,ce),a(A,Y),a(Y,X),a(A,re),d(e,R,t),d(e,B,t),d(e,Z,t),d(e,$,t),a($,x),a($,de),a($,ee),se(T,ee,null),d(e,te,t),d(e,F,t),d(e,le,t),d(e,S,t),a(S,O);for(let r=0;r<g.length;r+=1)g[r]&&g[r].m(O,null);a(S,fe),a(S,Q);for(let r=0;r<b.length;r+=1)b[r]&&b[r].m(Q,null);y=!0},p(e,[t]){var ke,ge;(!y||t&1)&&s!==(s=e[0].name+"")&&G(_,s),(!y||t&1)&&H!==(H=e[0].name+"")&&G(L,H);const r={};t&9&&(r.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
...
const result = await pb.collection('${(ke=e[0])==null?void 0:ke.name}').listAuthMethods();
`),t&9&&(r.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
...
final result = await pb.collection('${(ge=e[0])==null?void 0:ge.name}').listAuthMethods();
`),P.$set(r),(!y||t&1)&&z!==(z=e[0].name+"")&&G(X,z),t&6&&(D=e[2],g=we(g,t,pe,1,e,D,ue,O,Te,Pe,null,Ce)),t&6&&(N=e[2],je(),b=we(b,t,he,1,e,N,me,Q,Ae,Me,null,ve),Be())},i(e){if(!y){U(P.$$.fragment,e),U(T.$$.fragment,e);for(let t=0;t<N.length;t+=1)U(b[t]);y=!0}},o(e){W(P.$$.fragment,e),W(T.$$.fragment,e);for(let t=0;t<b.length;t+=1)W(b[t]);y=!1},d(e){e&&u(l),e&&u(i),e&&u(f),e&&u(E),ae(P,e),e&&u(I),e&&u(j),e&&u(J),e&&u(M),e&&u(R),e&&u(B),e&&u(Z),e&&u($),ae(T),e&&u(te),e&&u(F),e&&u(le),e&&u(S);for(let t=0;t<g.length;t+=1)g[t].d();for(let t=0;t<b.length;t+=1)b[t].d()}}}function De(n,l,o){let s,{collection:_=new Fe}=l,p=200,i=[];const f=m=>o(1,p=m.code);return n.$$set=m=>{"collection"in m&&o(0,_=m.collection)},o(3,s=Oe.getApiExampleUrl(Qe.baseUrl)),o(2,i=[{code:200,body:`
{
"usernamePassword": true,
"emailPassword": true,
"authProviders": [
{
"name": "github",
"state": "3Yd8jNkK_6PJG6hPWwBjLqKwse6Ejd",
"codeVerifier": "KxFDWz1B3fxscCDJ_9gHQhLuh__ie7",
"codeChallenge": "NM1oVexB6Q6QH8uPtOUfK7tq4pmu4Jz6lNDIwoxHZNE=",
"codeChallengeMethod": "S256",
"authUrl": "https://github.com/login/oauth/authorize?client_id=demo&code_challenge=NM1oVexB6Q6QH8uPtOUfK7tq4pmu4Jz6lNDIwoxHZNE%3D&code_challenge_method=S256&response_type=code&scope=user&state=3Yd8jNkK_6PJG6hPWwBjLqKwse6Ejd&redirect_uri="
},
{
"name": "gitlab",
"state": "NeQSbtO5cShr_mk5__3CUukiMnymeb",
"codeVerifier": "ahTFHOgua8mkvPAlIBGwCUJbWKR_xi",
"codeChallenge": "O-GATkTj4eXDCnfonsqGLCd6njvTixlpCMvy5kjgOOg=",
"codeChallengeMethod": "S256",
"authUrl": "https://gitlab.com/oauth/authorize?client_id=demo&code_challenge=O-GATkTj4eXDCnfonsqGLCd6njvTixlpCMvy5kjgOOg%3D&code_challenge_method=S256&response_type=code&scope=read_user&state=NeQSbtO5cShr_mk5__3CUukiMnymeb&redirect_uri="
},
{
"name": "google",
"state": "zB3ZPifV1TW2GMuvuFkamSXfSNkHPQ",
"codeVerifier": "t3CmO5VObGzdXqieakvR_fpjiW0zdO",
"codeChallenge": "KChwoQPKYlz2anAdqtgsSTdIo8hdwtc1fh2wHMwW2Yk=",
"codeChallengeMethod": "S256",
"authUrl": "https://accounts.google.com/o/oauth2/auth?client_id=demo&code_challenge=KChwoQPKYlz2anAdqtgsSTdIo8hdwtc1fh2wHMwW2Yk%3D&code_challenge_method=S256&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&state=zB3ZPifV1TW2GMuvuFkamSXfSNkHPQ&redirect_uri="
}
]
}
`}]),[_,p,i,s,f]}class Ve extends $e{constructor(l){super(),Se(this,l,De,ze,ye,{collection:0})}}export{Ve as default};

View File

@ -1,64 +0,0 @@
import{S as ke,i as be,s as ge,e as r,w as g,b as w,c as _e,f as k,g as h,h as n,m as me,x as G,N as re,P as we,k as ve,Q as Ce,n as Pe,t as L,a as Y,o as _,d as pe,T as Me,C as Se,p as $e,r as H,u as je,M as Ae}from"./index-69e255fe.js";import{S as Be}from"./SdkTabs-5df68e34.js";function ue(a,l,o){const s=a.slice();return s[5]=l[o],s}function de(a,l,o){const s=a.slice();return s[5]=l[o],s}function fe(a,l){let o,s=l[5].code+"",m,f,i,u;function d(){return l[4](l[5])}return{key:a,first:null,c(){o=r("button"),m=g(s),f=w(),k(o,"class","tab-item"),H(o,"active",l[1]===l[5].code),this.first=o},m(v,C){h(v,o,C),n(o,m),n(o,f),i||(u=je(o,"click",d),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&G(m,s),C&6&&H(o,"active",l[1]===l[5].code)},d(v){v&&_(o),i=!1,u()}}}function he(a,l){let o,s,m,f;return s=new Ae({props:{content:l[5].body}}),{key:a,first:null,c(){o=r("div"),_e(s.$$.fragment),m=w(),k(o,"class","tab-item"),H(o,"active",l[1]===l[5].code),this.first=o},m(i,u){h(i,o,u),me(s,o,null),n(o,m),f=!0},p(i,u){l=i;const d={};u&4&&(d.content=l[5].body),s.$set(d),(!f||u&6)&&H(o,"active",l[1]===l[5].code)},i(i){f||(L(s.$$.fragment,i),f=!0)},o(i){Y(s.$$.fragment,i),f=!1},d(i){i&&_(o),pe(s)}}}function Te(a){var ae,ne;let l,o,s=a[0].name+"",m,f,i,u,d,v,C,F=a[0].name+"",U,X,q,P,D,j,W,M,K,R,Q,A,Z,V,y=a[0].name+"",E,x,I,B,J,S,T,b=[],ee=new Map,te,O,p=[],le=new Map,$;P=new Be({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${a[3]}');
...
const result = await pb.collection('${(ae=a[0])==null?void 0:ae.name}').listAuthMethods();
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${a[3]}');
...
final result = await pb.collection('${(ne=a[0])==null?void 0:ne.name}').listAuthMethods();
`}});let z=a[2];const oe=e=>e[5].code;for(let e=0;e<z.length;e+=1){let t=de(a,z,e),c=oe(t);ee.set(c,b[e]=fe(c,t))}let N=a[2];const se=e=>e[5].code;for(let e=0;e<N.length;e+=1){let t=ue(a,N,e),c=se(t);le.set(c,p[e]=he(c,t))}return{c(){l=r("h3"),o=g("List auth methods ("),m=g(s),f=g(")"),i=w(),u=r("div"),d=r("p"),v=g("Returns a public list with all allowed "),C=r("strong"),U=g(F),X=g(" authentication methods."),q=w(),_e(P.$$.fragment),D=w(),j=r("h6"),j.textContent="API details",W=w(),M=r("div"),K=r("strong"),K.textContent="GET",R=w(),Q=r("div"),A=r("p"),Z=g("/api/collections/"),V=r("strong"),E=g(y),x=g("/auth-methods"),I=w(),B=r("div"),B.textContent="Responses",J=w(),S=r("div"),T=r("div");for(let e=0;e<b.length;e+=1)b[e].c();te=w(),O=r("div");for(let e=0;e<p.length;e+=1)p[e].c();k(l,"class","m-b-sm"),k(u,"class","content txt-lg m-b-sm"),k(j,"class","m-b-xs"),k(K,"class","label label-primary"),k(Q,"class","content"),k(M,"class","alert alert-info"),k(B,"class","section-title"),k(T,"class","tabs-header compact left"),k(O,"class","tabs-content"),k(S,"class","tabs")},m(e,t){h(e,l,t),n(l,o),n(l,m),n(l,f),h(e,i,t),h(e,u,t),n(u,d),n(d,v),n(d,C),n(C,U),n(d,X),h(e,q,t),me(P,e,t),h(e,D,t),h(e,j,t),h(e,W,t),h(e,M,t),n(M,K),n(M,R),n(M,Q),n(Q,A),n(A,Z),n(A,V),n(V,E),n(A,x),h(e,I,t),h(e,B,t),h(e,J,t),h(e,S,t),n(S,T);for(let c=0;c<b.length;c+=1)b[c]&&b[c].m(T,null);n(S,te),n(S,O);for(let c=0;c<p.length;c+=1)p[c]&&p[c].m(O,null);$=!0},p(e,[t]){var ie,ce;(!$||t&1)&&s!==(s=e[0].name+"")&&G(m,s),(!$||t&1)&&F!==(F=e[0].name+"")&&G(U,F);const c={};t&9&&(c.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
...
const result = await pb.collection('${(ie=e[0])==null?void 0:ie.name}').listAuthMethods();
`),t&9&&(c.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
...
final result = await pb.collection('${(ce=e[0])==null?void 0:ce.name}').listAuthMethods();
`),P.$set(c),(!$||t&1)&&y!==(y=e[0].name+"")&&G(E,y),t&6&&(z=e[2],b=re(b,t,oe,1,e,z,ee,T,we,fe,null,de)),t&6&&(N=e[2],ve(),p=re(p,t,se,1,e,N,le,O,Ce,he,null,ue),Pe())},i(e){if(!$){L(P.$$.fragment,e);for(let t=0;t<N.length;t+=1)L(p[t]);$=!0}},o(e){Y(P.$$.fragment,e);for(let t=0;t<p.length;t+=1)Y(p[t]);$=!1},d(e){e&&_(l),e&&_(i),e&&_(u),e&&_(q),pe(P,e),e&&_(D),e&&_(j),e&&_(W),e&&_(M),e&&_(I),e&&_(B),e&&_(J),e&&_(S);for(let t=0;t<b.length;t+=1)b[t].d();for(let t=0;t<p.length;t+=1)p[t].d()}}}function Oe(a,l,o){let s,{collection:m=new Me}=l,f=200,i=[];const u=d=>o(1,f=d.code);return a.$$set=d=>{"collection"in d&&o(0,m=d.collection)},o(3,s=Se.getApiExampleUrl($e.baseUrl)),o(2,i=[{code:200,body:`
{
"usernamePassword": true,
"emailPassword": true,
"authProviders": [
{
"name": "github",
"state": "3Yd8jNkK_6PJG6hPWwBjLqKwse6Ejd",
"codeVerifier": "KxFDWz1B3fxscCDJ_9gHQhLuh__ie7",
"codeChallenge": "NM1oVexB6Q6QH8uPtOUfK7tq4pmu4Jz6lNDIwoxHZNE=",
"codeChallengeMethod": "S256",
"authUrl": "https://github.com/login/oauth/authorize?client_id=demo&code_challenge=NM1oVexB6Q6QH8uPtOUfK7tq4pmu4Jz6lNDIwoxHZNE%3D&code_challenge_method=S256&response_type=code&scope=user&state=3Yd8jNkK_6PJG6hPWwBjLqKwse6Ejd&redirect_uri="
},
{
"name": "gitlab",
"state": "NeQSbtO5cShr_mk5__3CUukiMnymeb",
"codeVerifier": "ahTFHOgua8mkvPAlIBGwCUJbWKR_xi",
"codeChallenge": "O-GATkTj4eXDCnfonsqGLCd6njvTixlpCMvy5kjgOOg=",
"codeChallengeMethod": "S256",
"authUrl": "https://gitlab.com/oauth/authorize?client_id=demo&code_challenge=O-GATkTj4eXDCnfonsqGLCd6njvTixlpCMvy5kjgOOg%3D&code_challenge_method=S256&response_type=code&scope=read_user&state=NeQSbtO5cShr_mk5__3CUukiMnymeb&redirect_uri="
},
{
"name": "google",
"state": "zB3ZPifV1TW2GMuvuFkamSXfSNkHPQ",
"codeVerifier": "t3CmO5VObGzdXqieakvR_fpjiW0zdO",
"codeChallenge": "KChwoQPKYlz2anAdqtgsSTdIo8hdwtc1fh2wHMwW2Yk=",
"codeChallengeMethod": "S256",
"authUrl": "https://accounts.google.com/o/oauth2/auth?client_id=demo&code_challenge=KChwoQPKYlz2anAdqtgsSTdIo8hdwtc1fh2wHMwW2Yk%3D&code_challenge_method=S256&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&state=zB3ZPifV1TW2GMuvuFkamSXfSNkHPQ&redirect_uri="
}
]
}
`}]),[m,f,i,s,u]}class Ke extends ke{constructor(l){super(),be(this,l,Oe,Te,ge,{collection:0})}}export{Ke as default};

View File

@ -1,82 +0,0 @@
import{S as ze,i as Ue,s as je,M as Ve,e as a,w as k,b as p,c as ae,f as b,g as d,h as o,m as ne,x as re,N as He,P as xe,k as Je,Q as Ke,n as Qe,t as U,a as j,o as u,d as ie,T as Ie,C as Oe,p as We,r as x,u as Ge}from"./index-69e255fe.js";import{S as Xe}from"./SdkTabs-5df68e34.js";function Ee(r,l,s){const n=r.slice();return n[5]=l[s],n}function Fe(r,l,s){const n=r.slice();return n[5]=l[s],n}function Le(r,l){let s,n=l[5].code+"",m,_,i,f;function v(){return l[4](l[5])}return{key:r,first:null,c(){s=a("button"),m=k(n),_=p(),b(s,"class","tab-item"),x(s,"active",l[1]===l[5].code),this.first=s},m(g,w){d(g,s,w),o(s,m),o(s,_),i||(f=Ge(s,"click",v),i=!0)},p(g,w){l=g,w&4&&n!==(n=l[5].code+"")&&re(m,n),w&6&&x(s,"active",l[1]===l[5].code)},d(g){g&&u(s),i=!1,f()}}}function Ne(r,l){let s,n,m,_;return n=new Ve({props:{content:l[5].body}}),{key:r,first:null,c(){s=a("div"),ae(n.$$.fragment),m=p(),b(s,"class","tab-item"),x(s,"active",l[1]===l[5].code),this.first=s},m(i,f){d(i,s,f),ne(n,s,null),o(s,m),_=!0},p(i,f){l=i;const v={};f&4&&(v.content=l[5].body),n.$set(v),(!_||f&6)&&x(s,"active",l[1]===l[5].code)},i(i){_||(U(n.$$.fragment,i),_=!0)},o(i){j(n.$$.fragment,i),_=!1},d(i){i&&u(s),ie(n)}}}function Ye(r){var Ae,Be;let l,s,n=r[0].name+"",m,_,i,f,v,g,w,A,J,$,F,ce,L,B,de,K,N=r[0].name+"",Q,ue,pe,V,I,D,W,T,G,fe,X,C,Y,he,Z,be,h,me,R,_e,ke,ve,ee,ge,te,ye,Se,$e,oe,we,le,q,se,P,H,S=[],Te=new Map,Ce,O,y=[],Pe=new Map,M;g=new Xe({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${r[3]}');
...
const authData = await pb.collection('${(Ae=r[0])==null?void 0:Ae.name}').authRefresh();
// after the above you can also access the refreshed auth data from the authStore
console.log(pb.authStore.isValid);
console.log(pb.authStore.token);
console.log(pb.authStore.model.id);
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${r[3]}');
...
final authData = await pb.collection('${(Be=r[0])==null?void 0:Be.name}').authRefresh();
// after the above you can also access the refreshed auth data from the authStore
print(pb.authStore.isValid);
print(pb.authStore.token);
print(pb.authStore.model.id);
`}}),R=new Ve({props:{content:"?expand=relField1,relField2.subRelField"}});let z=r[2];const Re=e=>e[5].code;for(let e=0;e<z.length;e+=1){let t=Fe(r,z,e),c=Re(t);Te.set(c,S[e]=Le(c,t))}let E=r[2];const Me=e=>e[5].code;for(let e=0;e<E.length;e+=1){let t=Ee(r,E,e),c=Me(t);Pe.set(c,y[e]=Ne(c,t))}return{c(){l=a("h3"),s=k("Auth refresh ("),m=k(n),_=k(")"),i=p(),f=a("div"),f.innerHTML=`<p>Returns a new auth response (token and record data) for an
<strong>already authenticated record</strong>.</p>
<p><em>This method is usually called by users on page/screen reload to ensure that the previously stored
data in <code>pb.authStore</code> is still valid and up-to-date.</em></p>`,v=p(),ae(g.$$.fragment),w=p(),A=a("h6"),A.textContent="API details",J=p(),$=a("div"),F=a("strong"),F.textContent="POST",ce=p(),L=a("div"),B=a("p"),de=k("/api/collections/"),K=a("strong"),Q=k(N),ue=k("/auth-refresh"),pe=p(),V=a("p"),V.innerHTML="Requires record <code>Authorization:TOKEN</code> header",I=p(),D=a("div"),D.textContent="Query parameters",W=p(),T=a("table"),G=a("thead"),G.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,fe=p(),X=a("tbody"),C=a("tr"),Y=a("td"),Y.textContent="expand",he=p(),Z=a("td"),Z.innerHTML='<span class="label">String</span>',be=p(),h=a("td"),me=k(`Auto expand record relations. Ex.:
`),ae(R.$$.fragment),_e=k(`
Supports up to 6-levels depth nested relations expansion. `),ke=a("br"),ve=k(`
The expanded relations will be appended to the record under the
`),ee=a("code"),ee.textContent="expand",ge=k(" property (eg. "),te=a("code"),te.textContent='"expand": {"relField1": {...}, ...}',ye=k(`).
`),Se=a("br"),$e=k(`
Only the relations to which the request user has permissions to `),oe=a("strong"),oe.textContent="view",we=k(" will be expanded."),le=p(),q=a("div"),q.textContent="Responses",se=p(),P=a("div"),H=a("div");for(let e=0;e<S.length;e+=1)S[e].c();Ce=p(),O=a("div");for(let e=0;e<y.length;e+=1)y[e].c();b(l,"class","m-b-sm"),b(f,"class","content txt-lg m-b-sm"),b(A,"class","m-b-xs"),b(F,"class","label label-primary"),b(L,"class","content"),b(V,"class","txt-hint txt-sm txt-right"),b($,"class","alert alert-success"),b(D,"class","section-title"),b(T,"class","table-compact table-border m-b-base"),b(q,"class","section-title"),b(H,"class","tabs-header compact left"),b(O,"class","tabs-content"),b(P,"class","tabs")},m(e,t){d(e,l,t),o(l,s),o(l,m),o(l,_),d(e,i,t),d(e,f,t),d(e,v,t),ne(g,e,t),d(e,w,t),d(e,A,t),d(e,J,t),d(e,$,t),o($,F),o($,ce),o($,L),o(L,B),o(B,de),o(B,K),o(K,Q),o(B,ue),o($,pe),o($,V),d(e,I,t),d(e,D,t),d(e,W,t),d(e,T,t),o(T,G),o(T,fe),o(T,X),o(X,C),o(C,Y),o(C,he),o(C,Z),o(C,be),o(C,h),o(h,me),ne(R,h,null),o(h,_e),o(h,ke),o(h,ve),o(h,ee),o(h,ge),o(h,te),o(h,ye),o(h,Se),o(h,$e),o(h,oe),o(h,we),d(e,le,t),d(e,q,t),d(e,se,t),d(e,P,t),o(P,H);for(let c=0;c<S.length;c+=1)S[c]&&S[c].m(H,null);o(P,Ce),o(P,O);for(let c=0;c<y.length;c+=1)y[c]&&y[c].m(O,null);M=!0},p(e,[t]){var De,qe;(!M||t&1)&&n!==(n=e[0].name+"")&&re(m,n);const c={};t&9&&(c.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
...
const authData = await pb.collection('${(De=e[0])==null?void 0:De.name}').authRefresh();
// after the above you can also access the refreshed auth data from the authStore
console.log(pb.authStore.isValid);
console.log(pb.authStore.token);
console.log(pb.authStore.model.id);
`),t&9&&(c.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
...
final authData = await pb.collection('${(qe=e[0])==null?void 0:qe.name}').authRefresh();
// after the above you can also access the refreshed auth data from the authStore
print(pb.authStore.isValid);
print(pb.authStore.token);
print(pb.authStore.model.id);
`),g.$set(c),(!M||t&1)&&N!==(N=e[0].name+"")&&re(Q,N),t&6&&(z=e[2],S=He(S,t,Re,1,e,z,Te,H,xe,Le,null,Fe)),t&6&&(E=e[2],Je(),y=He(y,t,Me,1,e,E,Pe,O,Ke,Ne,null,Ee),Qe())},i(e){if(!M){U(g.$$.fragment,e),U(R.$$.fragment,e);for(let t=0;t<E.length;t+=1)U(y[t]);M=!0}},o(e){j(g.$$.fragment,e),j(R.$$.fragment,e);for(let t=0;t<y.length;t+=1)j(y[t]);M=!1},d(e){e&&u(l),e&&u(i),e&&u(f),e&&u(v),ie(g,e),e&&u(w),e&&u(A),e&&u(J),e&&u($),e&&u(I),e&&u(D),e&&u(W),e&&u(T),ie(R),e&&u(le),e&&u(q),e&&u(se),e&&u(P);for(let t=0;t<S.length;t+=1)S[t].d();for(let t=0;t<y.length;t+=1)y[t].d()}}}function Ze(r,l,s){let n,{collection:m=new Ie}=l,_=200,i=[];const f=v=>s(1,_=v.code);return r.$$set=v=>{"collection"in v&&s(0,m=v.collection)},r.$$.update=()=>{r.$$.dirty&1&&s(2,i=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:Oe.dummyCollectionRecord(m)},null,2)},{code:401,body:`
{
"code": 401,
"message": "The request requires valid record authorization token to be set.",
"data": {}
}
`},{code:403,body:`
{
"code": 403,
"message": "The authorized record model is not allowed to perform this action.",
"data": {}
}
`},{code:404,body:`
{
"code": 404,
"message": "Missing auth record context.",
"data": {}
}
`}])},s(3,n=Oe.getApiExampleUrl(We.baseUrl)),[m,_,i,n,f]}class ot extends ze{constructor(l){super(),Ue(this,l,Ze,Ye,je,{collection:0})}}export{ot as default};

View File

@ -0,0 +1,82 @@
import{S as Ue,i as je,s as xe,M as Qe,e as s,w as k,b as p,c as J,f as b,g as d,h as o,m as K,x as ce,N as Oe,P as Je,k as Ke,Q as Ie,n as We,t as N,a as V,o as u,d as I,T as Ge,C as Ee,p as Xe,r as W,u as Ye}from"./index-055843b5.js";import{S as Ze}from"./SdkTabs-1c685373.js";import{F as et}from"./FieldsQueryParam-815b0ee8.js";function Le(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l){let a,n=l[5].code+"",m,_,i,f;function v(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),W(a,"active",l[1]===l[5].code),this.first=a},m($,w){d($,a,w),o(a,m),o(a,_),i||(f=Ye(a,"click",v),i=!0)},p($,w){l=$,w&4&&n!==(n=l[5].code+"")&&ce(m,n),w&6&&W(a,"active",l[1]===l[5].code)},d($){$&&u(a),i=!1,f()}}}function ze(r,l){let a,n,m,_;return n=new Qe({props:{content:l[5].body}}),{key:r,first:null,c(){a=s("div"),J(n.$$.fragment),m=p(),b(a,"class","tab-item"),W(a,"active",l[1]===l[5].code),this.first=a},m(i,f){d(i,a,f),K(n,a,null),o(a,m),_=!0},p(i,f){l=i;const v={};f&4&&(v.content=l[5].body),n.$set(v),(!_||f&6)&&W(a,"active",l[1]===l[5].code)},i(i){_||(N(n.$$.fragment,i),_=!0)},o(i){V(n.$$.fragment,i),_=!1},d(i){i&&u(a),I(n)}}}function tt(r){var qe,De;let l,a,n=r[0].name+"",m,_,i,f,v,$,w,B,G,S,z,de,Q,q,ue,X,U=r[0].name+"",Y,pe,fe,j,Z,D,ee,T,te,he,F,C,oe,be,le,me,h,_e,R,ke,ve,$e,ae,ge,se,ye,Se,we,ne,Te,Ce,M,re,H,ie,P,O,y=[],Pe=new Map,Re,E,g=[],Me=new Map,A;$=new Ze({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${r[3]}');
...
const authData = await pb.collection('${(qe=r[0])==null?void 0:qe.name}').authRefresh();
// after the above you can also access the refreshed auth data from the authStore
console.log(pb.authStore.isValid);
console.log(pb.authStore.token);
console.log(pb.authStore.model.id);
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${r[3]}');
...
final authData = await pb.collection('${(De=r[0])==null?void 0:De.name}').authRefresh();
// after the above you can also access the refreshed auth data from the authStore
print(pb.authStore.isValid);
print(pb.authStore.token);
print(pb.authStore.model.id);
`}}),R=new Qe({props:{content:"?expand=relField1,relField2.subRelField"}}),M=new et({});let x=r[2];const Ae=e=>e[5].code;for(let e=0;e<x.length;e+=1){let t=Ne(r,x,e),c=Ae(t);Pe.set(c,y[e]=Ve(c,t))}let L=r[2];const Be=e=>e[5].code;for(let e=0;e<L.length;e+=1){let t=Le(r,L,e),c=Be(t);Me.set(c,g[e]=ze(c,t))}return{c(){l=s("h3"),a=k("Auth refresh ("),m=k(n),_=k(")"),i=p(),f=s("div"),f.innerHTML=`<p>Returns a new auth response (token and record data) for an
<strong>already authenticated record</strong>.</p>
<p><em>This method is usually called by users on page/screen reload to ensure that the previously stored
data in <code>pb.authStore</code> is still valid and up-to-date.</em></p>`,v=p(),J($.$$.fragment),w=p(),B=s("h6"),B.textContent="API details",G=p(),S=s("div"),z=s("strong"),z.textContent="POST",de=p(),Q=s("div"),q=s("p"),ue=k("/api/collections/"),X=s("strong"),Y=k(U),pe=k("/auth-refresh"),fe=p(),j=s("p"),j.innerHTML="Requires record <code>Authorization:TOKEN</code> header",Z=p(),D=s("div"),D.textContent="Query parameters",ee=p(),T=s("table"),te=s("thead"),te.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,he=p(),F=s("tbody"),C=s("tr"),oe=s("td"),oe.textContent="expand",be=p(),le=s("td"),le.innerHTML='<span class="label">String</span>',me=p(),h=s("td"),_e=k(`Auto expand record relations. Ex.:
`),J(R.$$.fragment),ke=k(`
Supports up to 6-levels depth nested relations expansion. `),ve=s("br"),$e=k(`
The expanded relations will be appended to the record under the
`),ae=s("code"),ae.textContent="expand",ge=k(" property (eg. "),se=s("code"),se.textContent='"expand": {"relField1": {...}, ...}',ye=k(`).
`),Se=s("br"),we=k(`
Only the relations to which the request user has permissions to `),ne=s("strong"),ne.textContent="view",Te=k(" will be expanded."),Ce=p(),J(M.$$.fragment),re=p(),H=s("div"),H.textContent="Responses",ie=p(),P=s("div"),O=s("div");for(let e=0;e<y.length;e+=1)y[e].c();Re=p(),E=s("div");for(let e=0;e<g.length;e+=1)g[e].c();b(l,"class","m-b-sm"),b(f,"class","content txt-lg m-b-sm"),b(B,"class","m-b-xs"),b(z,"class","label label-primary"),b(Q,"class","content"),b(j,"class","txt-hint txt-sm txt-right"),b(S,"class","alert alert-success"),b(D,"class","section-title"),b(T,"class","table-compact table-border m-b-base"),b(H,"class","section-title"),b(O,"class","tabs-header compact left"),b(E,"class","tabs-content"),b(P,"class","tabs")},m(e,t){d(e,l,t),o(l,a),o(l,m),o(l,_),d(e,i,t),d(e,f,t),d(e,v,t),K($,e,t),d(e,w,t),d(e,B,t),d(e,G,t),d(e,S,t),o(S,z),o(S,de),o(S,Q),o(Q,q),o(q,ue),o(q,X),o(X,Y),o(q,pe),o(S,fe),o(S,j),d(e,Z,t),d(e,D,t),d(e,ee,t),d(e,T,t),o(T,te),o(T,he),o(T,F),o(F,C),o(C,oe),o(C,be),o(C,le),o(C,me),o(C,h),o(h,_e),K(R,h,null),o(h,ke),o(h,ve),o(h,$e),o(h,ae),o(h,ge),o(h,se),o(h,ye),o(h,Se),o(h,we),o(h,ne),o(h,Te),o(F,Ce),K(M,F,null),d(e,re,t),d(e,H,t),d(e,ie,t),d(e,P,t),o(P,O);for(let c=0;c<y.length;c+=1)y[c]&&y[c].m(O,null);o(P,Re),o(P,E);for(let c=0;c<g.length;c+=1)g[c]&&g[c].m(E,null);A=!0},p(e,[t]){var Fe,He;(!A||t&1)&&n!==(n=e[0].name+"")&&ce(m,n);const c={};t&9&&(c.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
...
const authData = await pb.collection('${(Fe=e[0])==null?void 0:Fe.name}').authRefresh();
// after the above you can also access the refreshed auth data from the authStore
console.log(pb.authStore.isValid);
console.log(pb.authStore.token);
console.log(pb.authStore.model.id);
`),t&9&&(c.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
...
final authData = await pb.collection('${(He=e[0])==null?void 0:He.name}').authRefresh();
// after the above you can also access the refreshed auth data from the authStore
print(pb.authStore.isValid);
print(pb.authStore.token);
print(pb.authStore.model.id);
`),$.$set(c),(!A||t&1)&&U!==(U=e[0].name+"")&&ce(Y,U),t&6&&(x=e[2],y=Oe(y,t,Ae,1,e,x,Pe,O,Je,Ve,null,Ne)),t&6&&(L=e[2],Ke(),g=Oe(g,t,Be,1,e,L,Me,E,Ie,ze,null,Le),We())},i(e){if(!A){N($.$$.fragment,e),N(R.$$.fragment,e),N(M.$$.fragment,e);for(let t=0;t<L.length;t+=1)N(g[t]);A=!0}},o(e){V($.$$.fragment,e),V(R.$$.fragment,e),V(M.$$.fragment,e);for(let t=0;t<g.length;t+=1)V(g[t]);A=!1},d(e){e&&u(l),e&&u(i),e&&u(f),e&&u(v),I($,e),e&&u(w),e&&u(B),e&&u(G),e&&u(S),e&&u(Z),e&&u(D),e&&u(ee),e&&u(T),I(R),I(M),e&&u(re),e&&u(H),e&&u(ie),e&&u(P);for(let t=0;t<y.length;t+=1)y[t].d();for(let t=0;t<g.length;t+=1)g[t].d()}}}function ot(r,l,a){let n,{collection:m=new Ge}=l,_=200,i=[];const f=v=>a(1,_=v.code);return r.$$set=v=>{"collection"in v&&a(0,m=v.collection)},r.$$.update=()=>{r.$$.dirty&1&&a(2,i=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:Ee.dummyCollectionRecord(m)},null,2)},{code:401,body:`
{
"code": 401,
"message": "The request requires valid record authorization token to be set.",
"data": {}
}
`},{code:403,body:`
{
"code": 403,
"message": "The authorized record model is not allowed to perform this action.",
"data": {}
}
`},{code:404,body:`
{
"code": 404,
"message": "Missing auth record context.",
"data": {}
}
`}])},a(3,n=Ee.getApiExampleUrl(Xe.baseUrl)),[m,_,i,n,f]}class nt extends Ue{constructor(l){super(),je(this,l,ot,tt,xe,{collection:0})}}export{nt as default};

View File

@ -1,4 +1,4 @@
import{S as je,i as Fe,s as Ve,M as He,e as s,w as g,b as h,c as re,f as p,g as r,h as a,m as ce,x as ue,N as Pe,P as Le,k as Ee,Q as Je,n as Ne,t as E,a as J,o as c,d as de,T as Qe,C as Re,p as ze,r as N,u as Ie}from"./index-69e255fe.js";import{S as Ke}from"./SdkTabs-5df68e34.js";function xe(i,l,o){const n=i.slice();return n[5]=l[o],n}function We(i,l,o){const n=i.slice();return n[5]=l[o],n}function Ue(i,l){let o,n=l[5].code+"",m,k,u,b;function _(){return l[4](l[5])}return{key:i,first:null,c(){o=s("button"),m=g(n),k=h(),p(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(v,A){r(v,o,A),a(o,m),a(o,k),u||(b=Ie(o,"click",_),u=!0)},p(v,A){l=v,A&4&&n!==(n=l[5].code+"")&&ue(m,n),A&6&&N(o,"active",l[1]===l[5].code)},d(v){v&&c(o),u=!1,b()}}}function Be(i,l){let o,n,m,k;return n=new He({props:{content:l[5].body}}),{key:i,first:null,c(){o=s("div"),re(n.$$.fragment),m=h(),p(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(u,b){r(u,o,b),ce(n,o,null),a(o,m),k=!0},p(u,b){l=u;const _={};b&4&&(_.content=l[5].body),n.$set(_),(!k||b&6)&&N(o,"active",l[1]===l[5].code)},i(u){k||(E(n.$$.fragment,u),k=!0)},o(u){J(n.$$.fragment,u),k=!1},d(u){u&&c(o),de(n)}}}function Ge(i){let l,o,n=i[0].name+"",m,k,u,b,_,v,A,D,Q,S,j,he,F,M,pe,z,V=i[0].name+"",I,be,K,P,G,R,X,x,Y,y,Z,fe,ee,$,te,me,ae,ke,f,ge,C,_e,ve,we,le,Oe,oe,Ae,Se,ye,se,$e,ne,W,ie,T,U,O=[],Te=new Map,Ce,B,w=[],qe=new Map,q;v=new Ke({props:{js:`
import{S as Ve,i as Le,s as Ee,M as je,e as s,w as k,b as h,c as z,f as p,g as r,h as a,m as I,x as he,N as xe,P as Je,k as Ne,Q as Qe,n as ze,t as V,a as L,o as c,d as K,T as Ie,C as We,p as Ke,r as G,u as Ge}from"./index-055843b5.js";import{S as Xe}from"./SdkTabs-1c685373.js";import{F as Ye}from"./FieldsQueryParam-815b0ee8.js";function Ue(i,l,o){const n=i.slice();return n[5]=l[o],n}function Be(i,l,o){const n=i.slice();return n[5]=l[o],n}function Fe(i,l){let o,n=l[5].code+"",m,g,u,b;function _(){return l[4](l[5])}return{key:i,first:null,c(){o=s("button"),m=k(n),g=h(),p(o,"class","tab-item"),G(o,"active",l[1]===l[5].code),this.first=o},m(v,A){r(v,o,A),a(o,m),a(o,g),u||(b=Ge(o,"click",_),u=!0)},p(v,A){l=v,A&4&&n!==(n=l[5].code+"")&&he(m,n),A&6&&G(o,"active",l[1]===l[5].code)},d(v){v&&c(o),u=!1,b()}}}function He(i,l){let o,n,m,g;return n=new je({props:{content:l[5].body}}),{key:i,first:null,c(){o=s("div"),z(n.$$.fragment),m=h(),p(o,"class","tab-item"),G(o,"active",l[1]===l[5].code),this.first=o},m(u,b){r(u,o,b),I(n,o,null),a(o,m),g=!0},p(u,b){l=u;const _={};b&4&&(_.content=l[5].body),n.$set(_),(!g||b&6)&&G(o,"active",l[1]===l[5].code)},i(u){g||(V(n.$$.fragment,u),g=!0)},o(u){L(n.$$.fragment,u),g=!1},d(u){u&&c(o),K(n)}}}function Ze(i){let l,o,n=i[0].name+"",m,g,u,b,_,v,A,P,X,S,E,pe,J,M,be,Y,N=i[0].name+"",Z,fe,ee,R,te,x,ae,W,le,y,oe,me,U,$,se,ge,ne,ke,f,_e,C,ve,we,Oe,ie,Ae,re,Se,ye,$e,ce,Te,Ce,q,ue,B,de,T,F,O=[],qe=new Map,De,H,w=[],Pe=new Map,D;v=new Xe({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${i[3]}');
@ -45,10 +45,10 @@ import{S as je,i as Fe,s as Ve,M as He,e as s,w as g,b as h,c as re,f as p,g as
// "logout" the last authenticated model
pb.authStore.clear();
`}}),C=new He({props:{content:"?expand=relField1,relField2.subRelField"}});let L=i[2];const De=e=>e[5].code;for(let e=0;e<L.length;e+=1){let t=We(i,L,e),d=De(t);Te.set(d,O[e]=Ue(d,t))}let H=i[2];const Me=e=>e[5].code;for(let e=0;e<H.length;e+=1){let t=xe(i,H,e),d=Me(t);qe.set(d,w[e]=Be(d,t))}return{c(){l=s("h3"),o=g("Auth with OAuth2 ("),m=g(n),k=g(")"),u=h(),b=s("div"),b.innerHTML=`<p>Authenticate with an OAuth2 provider and returns a new auth token and record data.</p>
`}}),C=new je({props:{content:"?expand=relField1,relField2.subRelField"}}),q=new Ye({});let Q=i[2];const Me=e=>e[5].code;for(let e=0;e<Q.length;e+=1){let t=Be(i,Q,e),d=Me(t);qe.set(d,O[e]=Fe(d,t))}let j=i[2];const Re=e=>e[5].code;for(let e=0;e<j.length;e+=1){let t=Ue(i,j,e),d=Re(t);Pe.set(d,w[e]=He(d,t))}return{c(){l=s("h3"),o=k("Auth with OAuth2 ("),m=k(n),g=k(")"),u=h(),b=s("div"),b.innerHTML=`<p>Authenticate with an OAuth2 provider and returns a new auth token and record data.</p>
<p>For more details please check the
<a href="https://pocketbase.io/docs/authentication/#oauth2-integration" target="_blank" rel="noopener noreferrer">OAuth2 integration documentation
</a>.</p>`,_=h(),re(v.$$.fragment),A=h(),D=s("h6"),D.textContent="API details",Q=h(),S=s("div"),j=s("strong"),j.textContent="POST",he=h(),F=s("div"),M=s("p"),pe=g("/api/collections/"),z=s("strong"),I=g(V),be=g("/auth-with-oauth2"),K=h(),P=s("div"),P.textContent="Body Parameters",G=h(),R=s("table"),R.innerHTML=`<thead><tr><th>Param</th>
</a>.</p>`,_=h(),z(v.$$.fragment),A=h(),P=s("h6"),P.textContent="API details",X=h(),S=s("div"),E=s("strong"),E.textContent="POST",pe=h(),J=s("div"),M=s("p"),be=k("/api/collections/"),Y=s("strong"),Z=k(N),fe=k("/auth-with-oauth2"),ee=h(),R=s("div"),R.textContent="Body Parameters",te=h(),x=s("table"),x.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr></thead>
<tbody><tr><td><div class="inline-flex"><span class="label label-success">Required</span>
@ -75,15 +75,15 @@ import{S as je,i as Fe,s as Ve,M as He,e as s,w as g,b as h,c as re,f as p,g as
regular <strong>create</strong> action.
<br/>
<em>The data can only be in <code>json</code>, aka. <code>multipart/form-data</code> and files
upload currently are not supported during OAuth2 sign-ups.</em></p></td></tr></tbody>`,X=h(),x=s("div"),x.textContent="Query parameters",Y=h(),y=s("table"),Z=s("thead"),Z.innerHTML=`<tr><th>Param</th>
upload currently are not supported during OAuth2 sign-ups.</em></p></td></tr></tbody>`,ae=h(),W=s("div"),W.textContent="Query parameters",le=h(),y=s("table"),oe=s("thead"),oe.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,fe=h(),ee=s("tbody"),$=s("tr"),te=s("td"),te.textContent="expand",me=h(),ae=s("td"),ae.innerHTML='<span class="label">String</span>',ke=h(),f=s("td"),ge=g(`Auto expand record relations. Ex.:
`),re(C.$$.fragment),_e=g(`
Supports up to 6-levels depth nested relations expansion. `),ve=s("br"),we=g(`
<th width="60%">Description</th></tr>`,me=h(),U=s("tbody"),$=s("tr"),se=s("td"),se.textContent="expand",ge=h(),ne=s("td"),ne.innerHTML='<span class="label">String</span>',ke=h(),f=s("td"),_e=k(`Auto expand record relations. Ex.:
`),z(C.$$.fragment),ve=k(`
Supports up to 6-levels depth nested relations expansion. `),we=s("br"),Oe=k(`
The expanded relations will be appended to the record under the
`),le=s("code"),le.textContent="expand",Oe=g(" property (eg. "),oe=s("code"),oe.textContent='"expand": {"relField1": {...}, ...}',Ae=g(`).
`),Se=s("br"),ye=g(`
Only the relations to which the request user has permissions to `),se=s("strong"),se.textContent="view",$e=g(" will be expanded."),ne=h(),W=s("div"),W.textContent="Responses",ie=h(),T=s("div"),U=s("div");for(let e=0;e<O.length;e+=1)O[e].c();Ce=h(),B=s("div");for(let e=0;e<w.length;e+=1)w[e].c();p(l,"class","m-b-sm"),p(b,"class","content txt-lg m-b-sm"),p(D,"class","m-b-xs"),p(j,"class","label label-primary"),p(F,"class","content"),p(S,"class","alert alert-success"),p(P,"class","section-title"),p(R,"class","table-compact table-border m-b-base"),p(x,"class","section-title"),p(y,"class","table-compact table-border m-b-base"),p(W,"class","section-title"),p(U,"class","tabs-header compact left"),p(B,"class","tabs-content"),p(T,"class","tabs")},m(e,t){r(e,l,t),a(l,o),a(l,m),a(l,k),r(e,u,t),r(e,b,t),r(e,_,t),ce(v,e,t),r(e,A,t),r(e,D,t),r(e,Q,t),r(e,S,t),a(S,j),a(S,he),a(S,F),a(F,M),a(M,pe),a(M,z),a(z,I),a(M,be),r(e,K,t),r(e,P,t),r(e,G,t),r(e,R,t),r(e,X,t),r(e,x,t),r(e,Y,t),r(e,y,t),a(y,Z),a(y,fe),a(y,ee),a(ee,$),a($,te),a($,me),a($,ae),a($,ke),a($,f),a(f,ge),ce(C,f,null),a(f,_e),a(f,ve),a(f,we),a(f,le),a(f,Oe),a(f,oe),a(f,Ae),a(f,Se),a(f,ye),a(f,se),a(f,$e),r(e,ne,t),r(e,W,t),r(e,ie,t),r(e,T,t),a(T,U);for(let d=0;d<O.length;d+=1)O[d]&&O[d].m(U,null);a(T,Ce),a(T,B);for(let d=0;d<w.length;d+=1)w[d]&&w[d].m(B,null);q=!0},p(e,[t]){(!q||t&1)&&n!==(n=e[0].name+"")&&ue(m,n);const d={};t&8&&(d.js=`
`),ie=s("code"),ie.textContent="expand",Ae=k(" property (eg. "),re=s("code"),re.textContent='"expand": {"relField1": {...}, ...}',Se=k(`).
`),ye=s("br"),$e=k(`
Only the relations to which the request user has permissions to `),ce=s("strong"),ce.textContent="view",Te=k(" will be expanded."),Ce=h(),z(q.$$.fragment),ue=h(),B=s("div"),B.textContent="Responses",de=h(),T=s("div"),F=s("div");for(let e=0;e<O.length;e+=1)O[e].c();De=h(),H=s("div");for(let e=0;e<w.length;e+=1)w[e].c();p(l,"class","m-b-sm"),p(b,"class","content txt-lg m-b-sm"),p(P,"class","m-b-xs"),p(E,"class","label label-primary"),p(J,"class","content"),p(S,"class","alert alert-success"),p(R,"class","section-title"),p(x,"class","table-compact table-border m-b-base"),p(W,"class","section-title"),p(y,"class","table-compact table-border m-b-base"),p(B,"class","section-title"),p(F,"class","tabs-header compact left"),p(H,"class","tabs-content"),p(T,"class","tabs")},m(e,t){r(e,l,t),a(l,o),a(l,m),a(l,g),r(e,u,t),r(e,b,t),r(e,_,t),I(v,e,t),r(e,A,t),r(e,P,t),r(e,X,t),r(e,S,t),a(S,E),a(S,pe),a(S,J),a(J,M),a(M,be),a(M,Y),a(Y,Z),a(M,fe),r(e,ee,t),r(e,R,t),r(e,te,t),r(e,x,t),r(e,ae,t),r(e,W,t),r(e,le,t),r(e,y,t),a(y,oe),a(y,me),a(y,U),a(U,$),a($,se),a($,ge),a($,ne),a($,ke),a($,f),a(f,_e),I(C,f,null),a(f,ve),a(f,we),a(f,Oe),a(f,ie),a(f,Ae),a(f,re),a(f,Se),a(f,ye),a(f,$e),a(f,ce),a(f,Te),a(U,Ce),I(q,U,null),r(e,ue,t),r(e,B,t),r(e,de,t),r(e,T,t),a(T,F);for(let d=0;d<O.length;d+=1)O[d]&&O[d].m(F,null);a(T,De),a(T,H);for(let d=0;d<w.length;d+=1)w[d]&&w[d].m(H,null);D=!0},p(e,[t]){(!D||t&1)&&n!==(n=e[0].name+"")&&he(m,n);const d={};t&8&&(d.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
@ -130,7 +130,7 @@ import{S as je,i as Fe,s as Ve,M as He,e as s,w as g,b as h,c as re,f as p,g as
// "logout" the last authenticated model
pb.authStore.clear();
`),v.$set(d),(!q||t&1)&&V!==(V=e[0].name+"")&&ue(I,V),t&6&&(L=e[2],O=Pe(O,t,De,1,e,L,Te,U,Le,Ue,null,We)),t&6&&(H=e[2],Ee(),w=Pe(w,t,Me,1,e,H,qe,B,Je,Be,null,xe),Ne())},i(e){if(!q){E(v.$$.fragment,e),E(C.$$.fragment,e);for(let t=0;t<H.length;t+=1)E(w[t]);q=!0}},o(e){J(v.$$.fragment,e),J(C.$$.fragment,e);for(let t=0;t<w.length;t+=1)J(w[t]);q=!1},d(e){e&&c(l),e&&c(u),e&&c(b),e&&c(_),de(v,e),e&&c(A),e&&c(D),e&&c(Q),e&&c(S),e&&c(K),e&&c(P),e&&c(G),e&&c(R),e&&c(X),e&&c(x),e&&c(Y),e&&c(y),de(C),e&&c(ne),e&&c(W),e&&c(ie),e&&c(T);for(let t=0;t<O.length;t+=1)O[t].d();for(let t=0;t<w.length;t+=1)w[t].d()}}}function Xe(i,l,o){let n,{collection:m=new Qe}=l,k=200,u=[];const b=_=>o(1,k=_.code);return i.$$set=_=>{"collection"in _&&o(0,m=_.collection)},i.$$.update=()=>{i.$$.dirty&1&&o(2,u=[{code:200,body:JSON.stringify({token:"JWT_AUTH_TOKEN",record:Re.dummyCollectionRecord(m),meta:{id:"abc123",name:"John Doe",username:"john.doe",email:"test@example.com",avatarUrl:"https://example.com/avatar.png",accessToken:"...",refreshToken:"...",rawUser:{}}},null,2)},{code:400,body:`
`),v.$set(d),(!D||t&1)&&N!==(N=e[0].name+"")&&he(Z,N),t&6&&(Q=e[2],O=xe(O,t,Me,1,e,Q,qe,F,Je,Fe,null,Be)),t&6&&(j=e[2],Ne(),w=xe(w,t,Re,1,e,j,Pe,H,Qe,He,null,Ue),ze())},i(e){if(!D){V(v.$$.fragment,e),V(C.$$.fragment,e),V(q.$$.fragment,e);for(let t=0;t<j.length;t+=1)V(w[t]);D=!0}},o(e){L(v.$$.fragment,e),L(C.$$.fragment,e),L(q.$$.fragment,e);for(let t=0;t<w.length;t+=1)L(w[t]);D=!1},d(e){e&&c(l),e&&c(u),e&&c(b),e&&c(_),K(v,e),e&&c(A),e&&c(P),e&&c(X),e&&c(S),e&&c(ee),e&&c(R),e&&c(te),e&&c(x),e&&c(ae),e&&c(W),e&&c(le),e&&c(y),K(C),K(q),e&&c(ue),e&&c(B),e&&c(de),e&&c(T);for(let t=0;t<O.length;t+=1)O[t].d();for(let t=0;t<w.length;t+=1)w[t].d()}}}function et(i,l,o){let n,{collection:m=new Ie}=l,g=200,u=[];const b=_=>o(1,g=_.code);return i.$$set=_=>{"collection"in _&&o(0,m=_.collection)},i.$$.update=()=>{i.$$.dirty&1&&o(2,u=[{code:200,body:JSON.stringify({token:"JWT_AUTH_TOKEN",record:We.dummyCollectionRecord(m),meta:{id:"abc123",name:"John Doe",username:"john.doe",email:"test@example.com",avatarUrl:"https://example.com/avatar.png",accessToken:"...",refreshToken:"...",rawUser:{}}},null,2)},{code:400,body:`
{
"code": 400,
"message": "An error occurred while submitting the form.",
@ -141,4 +141,4 @@ import{S as je,i as Fe,s as Ve,M as He,e as s,w as g,b as h,c as re,f as p,g as
}
}
}
`}])},o(3,n=Re.getApiExampleUrl(ze.baseUrl)),[m,k,u,n,b]}class et extends je{constructor(l){super(),Fe(this,l,Xe,Ge,Ve,{collection:0})}}export{et as default};
`}])},o(3,n=We.getApiExampleUrl(Ke.baseUrl)),[m,g,u,n,b]}class ot extends Ve{constructor(l){super(),Le(this,l,et,Ze,Ee,{collection:0})}}export{ot as default};

View File

@ -1,106 +0,0 @@
import{S as Se,i as ve,s as we,M as ke,e as s,w as f,b as u,c as Tt,f as h,g as r,h as o,m as At,x as Ot,N as ce,P as ye,k as ge,Q as Pe,n as $e,t as tt,a as et,o as c,d as Mt,T as Re,C as de,p as Ce,r as lt,u as Te}from"./index-69e255fe.js";import{S as Ae}from"./SdkTabs-5df68e34.js";function ue(n,e,l){const i=n.slice();return i[8]=e[l],i}function fe(n,e,l){const i=n.slice();return i[8]=e[l],i}function Oe(n){let e;return{c(){e=f("email")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function Me(n){let e;return{c(){e=f("username")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function Ue(n){let e;return{c(){e=f("username/email")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function pe(n){let e;return{c(){e=s("strong"),e.textContent="username"},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function be(n){let e;return{c(){e=f("or")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function me(n){let e;return{c(){e=s("strong"),e.textContent="email"},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function he(n,e){let l,i=e[8].code+"",S,m,p,d;function _(){return e[7](e[8])}return{key:n,first:null,c(){l=s("button"),S=f(i),m=u(),h(l,"class","tab-item"),lt(l,"active",e[3]===e[8].code),this.first=l},m(R,C){r(R,l,C),o(l,S),o(l,m),p||(d=Te(l,"click",_),p=!0)},p(R,C){e=R,C&16&&i!==(i=e[8].code+"")&&Ot(S,i),C&24&&lt(l,"active",e[3]===e[8].code)},d(R){R&&c(l),p=!1,d()}}}function _e(n,e){let l,i,S,m;return i=new ke({props:{content:e[8].body}}),{key:n,first:null,c(){l=s("div"),Tt(i.$$.fragment),S=u(),h(l,"class","tab-item"),lt(l,"active",e[3]===e[8].code),this.first=l},m(p,d){r(p,l,d),At(i,l,null),o(l,S),m=!0},p(p,d){e=p;const _={};d&16&&(_.content=e[8].body),i.$set(_),(!m||d&24)&&lt(l,"active",e[3]===e[8].code)},i(p){m||(tt(i.$$.fragment,p),m=!0)},o(p){et(i.$$.fragment,p),m=!1},d(p){p&&c(l),Mt(i)}}}function De(n){var se,ne;let e,l,i=n[0].name+"",S,m,p,d,_,R,C,T,B,Ut,ot,O,at,F,st,M,G,Dt,X,N,Et,nt,Z=n[0].name+"",it,Wt,rt,I,ct,U,dt,Lt,V,D,ut,Bt,ft,Ht,P,Yt,pt,bt,mt,qt,ht,_t,j,kt,E,St,Ft,vt,W,wt,Nt,yt,It,k,Vt,H,jt,Jt,Qt,gt,Kt,Pt,zt,Gt,Xt,$t,Zt,Rt,J,Ct,L,Q,A=[],xt=new Map,te,K,v=[],ee=new Map,Y;function le(t,a){if(t[1]&&t[2])return Ue;if(t[1])return Me;if(t[2])return Oe}let q=le(n),$=q&&q(n);O=new Ae({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${n[6]}');
...
const authData = await pb.collection('${(se=n[0])==null?void 0:se.name}').authWithPassword(
'${n[5]}',
'YOUR_PASSWORD',
);
// after the above you can also access the auth data from the authStore
console.log(pb.authStore.isValid);
console.log(pb.authStore.token);
console.log(pb.authStore.model.id);
// "logout" the last authenticated account
pb.authStore.clear();
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${n[6]}');
...
final authData = await pb.collection('${(ne=n[0])==null?void 0:ne.name}').authWithPassword(
'${n[5]}',
'YOUR_PASSWORD',
);
// after the above you can also access the auth data from the authStore
print(pb.authStore.isValid);
print(pb.authStore.token);
print(pb.authStore.model.id);
// "logout" the last authenticated account
pb.authStore.clear();
`}});let w=n[1]&&pe(),y=n[1]&&n[2]&&be(),g=n[2]&&me();H=new ke({props:{content:"?expand=relField1,relField2.subRelField"}});let x=n[4];const oe=t=>t[8].code;for(let t=0;t<x.length;t+=1){let a=fe(n,x,t),b=oe(a);xt.set(b,A[t]=he(b,a))}let z=n[4];const ae=t=>t[8].code;for(let t=0;t<z.length;t+=1){let a=ue(n,z,t),b=ae(a);ee.set(b,v[t]=_e(b,a))}return{c(){e=s("h3"),l=f("Auth with password ("),S=f(i),m=f(")"),p=u(),d=s("div"),_=s("p"),R=f(`Returns new auth token and account data by a combination of
`),C=s("strong"),$&&$.c(),T=f(`
and `),B=s("strong"),B.textContent="password",Ut=f("."),ot=u(),Tt(O.$$.fragment),at=u(),F=s("h6"),F.textContent="API details",st=u(),M=s("div"),G=s("strong"),G.textContent="POST",Dt=u(),X=s("div"),N=s("p"),Et=f("/api/collections/"),nt=s("strong"),it=f(Z),Wt=f("/auth-with-password"),rt=u(),I=s("div"),I.textContent="Body Parameters",ct=u(),U=s("table"),dt=s("thead"),dt.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,Lt=u(),V=s("tbody"),D=s("tr"),ut=s("td"),ut.innerHTML=`<div class="inline-flex"><span class="label label-success">Required</span>
<span>identity</span></div>`,Bt=u(),ft=s("td"),ft.innerHTML='<span class="label">String</span>',Ht=u(),P=s("td"),Yt=f(`The
`),w&&w.c(),pt=u(),y&&y.c(),bt=u(),g&&g.c(),mt=f(`
of the record to authenticate.`),qt=u(),ht=s("tr"),ht.innerHTML=`<td><div class="inline-flex"><span class="label label-success">Required</span>
<span>password</span></div></td>
<td><span class="label">String</span></td>
<td>The auth record password.</td>`,_t=u(),j=s("div"),j.textContent="Query parameters",kt=u(),E=s("table"),St=s("thead"),St.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,Ft=u(),vt=s("tbody"),W=s("tr"),wt=s("td"),wt.textContent="expand",Nt=u(),yt=s("td"),yt.innerHTML='<span class="label">String</span>',It=u(),k=s("td"),Vt=f(`Auto expand record relations. Ex.:
`),Tt(H.$$.fragment),jt=f(`
Supports up to 6-levels depth nested relations expansion. `),Jt=s("br"),Qt=f(`
The expanded relations will be appended to the record under the
`),gt=s("code"),gt.textContent="expand",Kt=f(" property (eg. "),Pt=s("code"),Pt.textContent='"expand": {"relField1": {...}, ...}',zt=f(`).
`),Gt=s("br"),Xt=f(`
Only the relations to which the request user has permissions to `),$t=s("strong"),$t.textContent="view",Zt=f(" will be expanded."),Rt=u(),J=s("div"),J.textContent="Responses",Ct=u(),L=s("div"),Q=s("div");for(let t=0;t<A.length;t+=1)A[t].c();te=u(),K=s("div");for(let t=0;t<v.length;t+=1)v[t].c();h(e,"class","m-b-sm"),h(d,"class","content txt-lg m-b-sm"),h(F,"class","m-b-xs"),h(G,"class","label label-primary"),h(X,"class","content"),h(M,"class","alert alert-success"),h(I,"class","section-title"),h(U,"class","table-compact table-border m-b-base"),h(j,"class","section-title"),h(E,"class","table-compact table-border m-b-base"),h(J,"class","section-title"),h(Q,"class","tabs-header compact left"),h(K,"class","tabs-content"),h(L,"class","tabs")},m(t,a){r(t,e,a),o(e,l),o(e,S),o(e,m),r(t,p,a),r(t,d,a),o(d,_),o(_,R),o(_,C),$&&$.m(C,null),o(_,T),o(_,B),o(_,Ut),r(t,ot,a),At(O,t,a),r(t,at,a),r(t,F,a),r(t,st,a),r(t,M,a),o(M,G),o(M,Dt),o(M,X),o(X,N),o(N,Et),o(N,nt),o(nt,it),o(N,Wt),r(t,rt,a),r(t,I,a),r(t,ct,a),r(t,U,a),o(U,dt),o(U,Lt),o(U,V),o(V,D),o(D,ut),o(D,Bt),o(D,ft),o(D,Ht),o(D,P),o(P,Yt),w&&w.m(P,null),o(P,pt),y&&y.m(P,null),o(P,bt),g&&g.m(P,null),o(P,mt),o(V,qt),o(V,ht),r(t,_t,a),r(t,j,a),r(t,kt,a),r(t,E,a),o(E,St),o(E,Ft),o(E,vt),o(vt,W),o(W,wt),o(W,Nt),o(W,yt),o(W,It),o(W,k),o(k,Vt),At(H,k,null),o(k,jt),o(k,Jt),o(k,Qt),o(k,gt),o(k,Kt),o(k,Pt),o(k,zt),o(k,Gt),o(k,Xt),o(k,$t),o(k,Zt),r(t,Rt,a),r(t,J,a),r(t,Ct,a),r(t,L,a),o(L,Q);for(let b=0;b<A.length;b+=1)A[b]&&A[b].m(Q,null);o(L,te),o(L,K);for(let b=0;b<v.length;b+=1)v[b]&&v[b].m(K,null);Y=!0},p(t,[a]){var ie,re;(!Y||a&1)&&i!==(i=t[0].name+"")&&Ot(S,i),q!==(q=le(t))&&($&&$.d(1),$=q&&q(t),$&&($.c(),$.m(C,null)));const b={};a&97&&(b.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${t[6]}');
...
const authData = await pb.collection('${(ie=t[0])==null?void 0:ie.name}').authWithPassword(
'${t[5]}',
'YOUR_PASSWORD',
);
// after the above you can also access the auth data from the authStore
console.log(pb.authStore.isValid);
console.log(pb.authStore.token);
console.log(pb.authStore.model.id);
// "logout" the last authenticated account
pb.authStore.clear();
`),a&97&&(b.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${t[6]}');
...
final authData = await pb.collection('${(re=t[0])==null?void 0:re.name}').authWithPassword(
'${t[5]}',
'YOUR_PASSWORD',
);
// after the above you can also access the auth data from the authStore
print(pb.authStore.isValid);
print(pb.authStore.token);
print(pb.authStore.model.id);
// "logout" the last authenticated account
pb.authStore.clear();
`),O.$set(b),(!Y||a&1)&&Z!==(Z=t[0].name+"")&&Ot(it,Z),t[1]?w||(w=pe(),w.c(),w.m(P,pt)):w&&(w.d(1),w=null),t[1]&&t[2]?y||(y=be(),y.c(),y.m(P,bt)):y&&(y.d(1),y=null),t[2]?g||(g=me(),g.c(),g.m(P,mt)):g&&(g.d(1),g=null),a&24&&(x=t[4],A=ce(A,a,oe,1,t,x,xt,Q,ye,he,null,fe)),a&24&&(z=t[4],ge(),v=ce(v,a,ae,1,t,z,ee,K,Pe,_e,null,ue),$e())},i(t){if(!Y){tt(O.$$.fragment,t),tt(H.$$.fragment,t);for(let a=0;a<z.length;a+=1)tt(v[a]);Y=!0}},o(t){et(O.$$.fragment,t),et(H.$$.fragment,t);for(let a=0;a<v.length;a+=1)et(v[a]);Y=!1},d(t){t&&c(e),t&&c(p),t&&c(d),$&&$.d(),t&&c(ot),Mt(O,t),t&&c(at),t&&c(F),t&&c(st),t&&c(M),t&&c(rt),t&&c(I),t&&c(ct),t&&c(U),w&&w.d(),y&&y.d(),g&&g.d(),t&&c(_t),t&&c(j),t&&c(kt),t&&c(E),Mt(H),t&&c(Rt),t&&c(J),t&&c(Ct),t&&c(L);for(let a=0;a<A.length;a+=1)A[a].d();for(let a=0;a<v.length;a+=1)v[a].d()}}}function Ee(n,e,l){let i,S,m,p,{collection:d=new Re}=e,_=200,R=[];const C=T=>l(3,_=T.code);return n.$$set=T=>{"collection"in T&&l(0,d=T.collection)},n.$$.update=()=>{var T,B;n.$$.dirty&1&&l(2,S=(T=d==null?void 0:d.options)==null?void 0:T.allowEmailAuth),n.$$.dirty&1&&l(1,m=(B=d==null?void 0:d.options)==null?void 0:B.allowUsernameAuth),n.$$.dirty&6&&l(5,p=m&&S?"YOUR_USERNAME_OR_EMAIL":m?"YOUR_USERNAME":"YOUR_EMAIL"),n.$$.dirty&1&&l(4,R=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:de.dummyCollectionRecord(d)},null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to authenticate.",
"data": {
"identity": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`}])},l(6,i=de.getApiExampleUrl(Ce.baseUrl)),[d,m,S,_,R,p,i,C]}class Be extends Se{constructor(e){super(),ve(this,e,Ee,De,we,{collection:0})}}export{Be as default};

View File

@ -0,0 +1,106 @@
import{S as ve,i as ye,s as ge,M as we,e as s,w as f,b as d,c as ot,f as h,g as r,h as e,m as st,x as Ut,N as ue,P as $e,k as Pe,Q as Re,n as Ce,t as Z,a as x,o as c,d as nt,T as Te,C as fe,p as Ae,r as it,u as Oe}from"./index-055843b5.js";import{S as Me}from"./SdkTabs-1c685373.js";import{F as Ue}from"./FieldsQueryParam-815b0ee8.js";function pe(n,l,a){const i=n.slice();return i[8]=l[a],i}function be(n,l,a){const i=n.slice();return i[8]=l[a],i}function De(n){let l;return{c(){l=f("email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Ee(n){let l;return{c(){l=f("username")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function We(n){let l;return{c(){l=f("username/email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function me(n){let l;return{c(){l=s("strong"),l.textContent="username"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function he(n){let l;return{c(){l=f("or")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function _e(n){let l;return{c(){l=s("strong"),l.textContent="email"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function ke(n,l){let a,i=l[8].code+"",S,m,p,u;function _(){return l[7](l[8])}return{key:n,first:null,c(){a=s("button"),S=f(i),m=d(),h(a,"class","tab-item"),it(a,"active",l[3]===l[8].code),this.first=a},m(R,C){r(R,a,C),e(a,S),e(a,m),p||(u=Oe(a,"click",_),p=!0)},p(R,C){l=R,C&16&&i!==(i=l[8].code+"")&&Ut(S,i),C&24&&it(a,"active",l[3]===l[8].code)},d(R){R&&c(a),p=!1,u()}}}function Se(n,l){let a,i,S,m;return i=new we({props:{content:l[8].body}}),{key:n,first:null,c(){a=s("div"),ot(i.$$.fragment),S=d(),h(a,"class","tab-item"),it(a,"active",l[3]===l[8].code),this.first=a},m(p,u){r(p,a,u),st(i,a,null),e(a,S),m=!0},p(p,u){l=p;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!m||u&24)&&it(a,"active",l[3]===l[8].code)},i(p){m||(Z(i.$$.fragment,p),m=!0)},o(p){x(i.$$.fragment,p),m=!1},d(p){p&&c(a),nt(i)}}}function Le(n){var ie,re;let l,a,i=n[0].name+"",S,m,p,u,_,R,C,T,B,Dt,rt,O,ct,N,dt,M,tt,Et,et,I,Wt,ut,lt=n[0].name+"",ft,Lt,pt,V,bt,U,mt,Bt,Q,D,ht,qt,_t,Ft,$,Ht,kt,St,wt,Yt,vt,yt,j,gt,E,$t,Nt,J,W,Pt,It,Rt,Vt,k,Qt,q,jt,Jt,Kt,Ct,zt,Tt,Gt,Xt,Zt,At,xt,te,F,Ot,K,Mt,L,z,A=[],ee=new Map,le,G,w=[],ae=new Map,H;function oe(t,o){if(t[1]&&t[2])return We;if(t[1])return Ee;if(t[2])return De}let Y=oe(n),P=Y&&Y(n);O=new Me({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${n[6]}');
...
const authData = await pb.collection('${(ie=n[0])==null?void 0:ie.name}').authWithPassword(
'${n[5]}',
'YOUR_PASSWORD',
);
// after the above you can also access the auth data from the authStore
console.log(pb.authStore.isValid);
console.log(pb.authStore.token);
console.log(pb.authStore.model.id);
// "logout" the last authenticated account
pb.authStore.clear();
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${n[6]}');
...
final authData = await pb.collection('${(re=n[0])==null?void 0:re.name}').authWithPassword(
'${n[5]}',
'YOUR_PASSWORD',
);
// after the above you can also access the auth data from the authStore
print(pb.authStore.isValid);
print(pb.authStore.token);
print(pb.authStore.model.id);
// "logout" the last authenticated account
pb.authStore.clear();
`}});let v=n[1]&&me(),y=n[1]&&n[2]&&he(),g=n[2]&&_e();q=new we({props:{content:"?expand=relField1,relField2.subRelField"}}),F=new Ue({});let at=n[4];const se=t=>t[8].code;for(let t=0;t<at.length;t+=1){let o=be(n,at,t),b=se(o);ee.set(b,A[t]=ke(b,o))}let X=n[4];const ne=t=>t[8].code;for(let t=0;t<X.length;t+=1){let o=pe(n,X,t),b=ne(o);ae.set(b,w[t]=Se(b,o))}return{c(){l=s("h3"),a=f("Auth with password ("),S=f(i),m=f(")"),p=d(),u=s("div"),_=s("p"),R=f(`Returns new auth token and account data by a combination of
`),C=s("strong"),P&&P.c(),T=f(`
and `),B=s("strong"),B.textContent="password",Dt=f("."),rt=d(),ot(O.$$.fragment),ct=d(),N=s("h6"),N.textContent="API details",dt=d(),M=s("div"),tt=s("strong"),tt.textContent="POST",Et=d(),et=s("div"),I=s("p"),Wt=f("/api/collections/"),ut=s("strong"),ft=f(lt),Lt=f("/auth-with-password"),pt=d(),V=s("div"),V.textContent="Body Parameters",bt=d(),U=s("table"),mt=s("thead"),mt.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,Bt=d(),Q=s("tbody"),D=s("tr"),ht=s("td"),ht.innerHTML=`<div class="inline-flex"><span class="label label-success">Required</span>
<span>identity</span></div>`,qt=d(),_t=s("td"),_t.innerHTML='<span class="label">String</span>',Ft=d(),$=s("td"),Ht=f(`The
`),v&&v.c(),kt=d(),y&&y.c(),St=d(),g&&g.c(),wt=f(`
of the record to authenticate.`),Yt=d(),vt=s("tr"),vt.innerHTML=`<td><div class="inline-flex"><span class="label label-success">Required</span>
<span>password</span></div></td>
<td><span class="label">String</span></td>
<td>The auth record password.</td>`,yt=d(),j=s("div"),j.textContent="Query parameters",gt=d(),E=s("table"),$t=s("thead"),$t.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,Nt=d(),J=s("tbody"),W=s("tr"),Pt=s("td"),Pt.textContent="expand",It=d(),Rt=s("td"),Rt.innerHTML='<span class="label">String</span>',Vt=d(),k=s("td"),Qt=f(`Auto expand record relations. Ex.:
`),ot(q.$$.fragment),jt=f(`
Supports up to 6-levels depth nested relations expansion. `),Jt=s("br"),Kt=f(`
The expanded relations will be appended to the record under the
`),Ct=s("code"),Ct.textContent="expand",zt=f(" property (eg. "),Tt=s("code"),Tt.textContent='"expand": {"relField1": {...}, ...}',Gt=f(`).
`),Xt=s("br"),Zt=f(`
Only the relations to which the request user has permissions to `),At=s("strong"),At.textContent="view",xt=f(" will be expanded."),te=d(),ot(F.$$.fragment),Ot=d(),K=s("div"),K.textContent="Responses",Mt=d(),L=s("div"),z=s("div");for(let t=0;t<A.length;t+=1)A[t].c();le=d(),G=s("div");for(let t=0;t<w.length;t+=1)w[t].c();h(l,"class","m-b-sm"),h(u,"class","content txt-lg m-b-sm"),h(N,"class","m-b-xs"),h(tt,"class","label label-primary"),h(et,"class","content"),h(M,"class","alert alert-success"),h(V,"class","section-title"),h(U,"class","table-compact table-border m-b-base"),h(j,"class","section-title"),h(E,"class","table-compact table-border m-b-base"),h(K,"class","section-title"),h(z,"class","tabs-header compact left"),h(G,"class","tabs-content"),h(L,"class","tabs")},m(t,o){r(t,l,o),e(l,a),e(l,S),e(l,m),r(t,p,o),r(t,u,o),e(u,_),e(_,R),e(_,C),P&&P.m(C,null),e(_,T),e(_,B),e(_,Dt),r(t,rt,o),st(O,t,o),r(t,ct,o),r(t,N,o),r(t,dt,o),r(t,M,o),e(M,tt),e(M,Et),e(M,et),e(et,I),e(I,Wt),e(I,ut),e(ut,ft),e(I,Lt),r(t,pt,o),r(t,V,o),r(t,bt,o),r(t,U,o),e(U,mt),e(U,Bt),e(U,Q),e(Q,D),e(D,ht),e(D,qt),e(D,_t),e(D,Ft),e(D,$),e($,Ht),v&&v.m($,null),e($,kt),y&&y.m($,null),e($,St),g&&g.m($,null),e($,wt),e(Q,Yt),e(Q,vt),r(t,yt,o),r(t,j,o),r(t,gt,o),r(t,E,o),e(E,$t),e(E,Nt),e(E,J),e(J,W),e(W,Pt),e(W,It),e(W,Rt),e(W,Vt),e(W,k),e(k,Qt),st(q,k,null),e(k,jt),e(k,Jt),e(k,Kt),e(k,Ct),e(k,zt),e(k,Tt),e(k,Gt),e(k,Xt),e(k,Zt),e(k,At),e(k,xt),e(J,te),st(F,J,null),r(t,Ot,o),r(t,K,o),r(t,Mt,o),r(t,L,o),e(L,z);for(let b=0;b<A.length;b+=1)A[b]&&A[b].m(z,null);e(L,le),e(L,G);for(let b=0;b<w.length;b+=1)w[b]&&w[b].m(G,null);H=!0},p(t,[o]){var ce,de;(!H||o&1)&&i!==(i=t[0].name+"")&&Ut(S,i),Y!==(Y=oe(t))&&(P&&P.d(1),P=Y&&Y(t),P&&(P.c(),P.m(C,null)));const b={};o&97&&(b.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${t[6]}');
...
const authData = await pb.collection('${(ce=t[0])==null?void 0:ce.name}').authWithPassword(
'${t[5]}',
'YOUR_PASSWORD',
);
// after the above you can also access the auth data from the authStore
console.log(pb.authStore.isValid);
console.log(pb.authStore.token);
console.log(pb.authStore.model.id);
// "logout" the last authenticated account
pb.authStore.clear();
`),o&97&&(b.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${t[6]}');
...
final authData = await pb.collection('${(de=t[0])==null?void 0:de.name}').authWithPassword(
'${t[5]}',
'YOUR_PASSWORD',
);
// after the above you can also access the auth data from the authStore
print(pb.authStore.isValid);
print(pb.authStore.token);
print(pb.authStore.model.id);
// "logout" the last authenticated account
pb.authStore.clear();
`),O.$set(b),(!H||o&1)&&lt!==(lt=t[0].name+"")&&Ut(ft,lt),t[1]?v||(v=me(),v.c(),v.m($,kt)):v&&(v.d(1),v=null),t[1]&&t[2]?y||(y=he(),y.c(),y.m($,St)):y&&(y.d(1),y=null),t[2]?g||(g=_e(),g.c(),g.m($,wt)):g&&(g.d(1),g=null),o&24&&(at=t[4],A=ue(A,o,se,1,t,at,ee,z,$e,ke,null,be)),o&24&&(X=t[4],Pe(),w=ue(w,o,ne,1,t,X,ae,G,Re,Se,null,pe),Ce())},i(t){if(!H){Z(O.$$.fragment,t),Z(q.$$.fragment,t),Z(F.$$.fragment,t);for(let o=0;o<X.length;o+=1)Z(w[o]);H=!0}},o(t){x(O.$$.fragment,t),x(q.$$.fragment,t),x(F.$$.fragment,t);for(let o=0;o<w.length;o+=1)x(w[o]);H=!1},d(t){t&&c(l),t&&c(p),t&&c(u),P&&P.d(),t&&c(rt),nt(O,t),t&&c(ct),t&&c(N),t&&c(dt),t&&c(M),t&&c(pt),t&&c(V),t&&c(bt),t&&c(U),v&&v.d(),y&&y.d(),g&&g.d(),t&&c(yt),t&&c(j),t&&c(gt),t&&c(E),nt(q),nt(F),t&&c(Ot),t&&c(K),t&&c(Mt),t&&c(L);for(let o=0;o<A.length;o+=1)A[o].d();for(let o=0;o<w.length;o+=1)w[o].d()}}}function Be(n,l,a){let i,S,m,p,{collection:u=new Te}=l,_=200,R=[];const C=T=>a(3,_=T.code);return n.$$set=T=>{"collection"in T&&a(0,u=T.collection)},n.$$.update=()=>{var T,B;n.$$.dirty&1&&a(2,S=(T=u==null?void 0:u.options)==null?void 0:T.allowEmailAuth),n.$$.dirty&1&&a(1,m=(B=u==null?void 0:u.options)==null?void 0:B.allowUsernameAuth),n.$$.dirty&6&&a(5,p=m&&S?"YOUR_USERNAME_OR_EMAIL":m?"YOUR_USERNAME":"YOUR_EMAIL"),n.$$.dirty&1&&a(4,R=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:fe.dummyCollectionRecord(u)},null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to authenticate.",
"data": {
"identity": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`}])},a(6,i=fe.getApiExampleUrl(Ae.baseUrl)),[u,m,S,_,R,p,i,C]}class Ye extends ve{constructor(l){super(),ye(this,l,Be,Le,ge,{collection:0})}}export{Ye as default};

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
import{S as Ce,i as $e,s as we,e as r,w as g,b as h,c as he,f as b,g as f,h as n,m as ve,x as Y,N as pe,P as Pe,k as Se,Q as Oe,n as Te,t as Z,a as x,o as m,d as ge,T as Re,C as Ee,p as ye,r as j,u as Be,M as qe}from"./index-69e255fe.js";import{S as Ae}from"./SdkTabs-5df68e34.js";function ue(o,l,s){const a=o.slice();return a[5]=l[s],a}function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l){let s,a=l[5].code+"",_,u,i,d;function p(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),u=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(C,$){f(C,s,$),n(s,_),n(s,u),i||(d=Be(s,"click",p),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&Y(_,a),$&6&&j(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,d()}}}function ke(o,l){let s,a,_,u;return a=new qe({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),he(a.$$.fragment),_=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,d){f(i,s,d),ve(a,s,null),n(s,_),u=!0},p(i,d){l=i;const p={};d&4&&(p.content=l[5].body),a.$set(p),(!u||d&6)&&j(s,"active",l[1]===l[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&m(s),ge(a)}}}function Ue(o){var re,fe;let l,s,a=o[0].name+"",_,u,i,d,p,C,$,D=o[0].name+"",H,ee,F,w,I,T,L,P,M,te,N,R,le,Q,K=o[0].name+"",z,se,G,E,J,y,V,B,X,S,q,v=[],ae=new Map,oe,A,k=[],ne=new Map,O;w=new Ae({props:{js:`
import{S as Ce,i as $e,s as we,e as r,w as g,b as h,c as he,f as b,g as f,h as n,m as ve,x as Y,N as pe,P as Pe,k as Se,Q as Oe,n as Te,t as Z,a as x,o as m,d as ge,T as Re,C as Ee,p as ye,r as j,u as Be,M as qe}from"./index-055843b5.js";import{S as Ae}from"./SdkTabs-1c685373.js";function ue(o,l,s){const a=o.slice();return a[5]=l[s],a}function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l){let s,a=l[5].code+"",_,u,i,d;function p(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),u=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(C,$){f(C,s,$),n(s,_),n(s,u),i||(d=Be(s,"click",p),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&Y(_,a),$&6&&j(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,d()}}}function ke(o,l){let s,a,_,u;return a=new qe({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),he(a.$$.fragment),_=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,d){f(i,s,d),ve(a,s,null),n(s,_),u=!0},p(i,d){l=i;const p={};d&4&&(p.content=l[5].body),a.$set(p),(!u||d&6)&&j(s,"active",l[1]===l[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&m(s),ge(a)}}}function Ue(o){var re,fe;let l,s,a=o[0].name+"",_,u,i,d,p,C,$,D=o[0].name+"",H,ee,F,w,I,T,L,P,M,te,N,R,le,Q,K=o[0].name+"",z,se,G,E,J,y,V,B,X,S,q,v=[],ae=new Map,oe,A,k=[],ne=new Map,O;w=new Ae({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[3]}');

View File

@ -1,4 +1,4 @@
import{S as Se,i as he,s as Re,e as r,w as P,b as v,c as ve,f as b,g as d,h as n,m as we,x as K,N as me,P as Ne,k as Oe,Q as Ce,n as We,t as Z,a as x,o as f,d as Pe,T as $e,C as Ee,p as Te,r as U,u as ge,M as Ae}from"./index-69e255fe.js";import{S as De}from"./SdkTabs-5df68e34.js";function ue(o,s,l){const a=o.slice();return a[5]=s[l],a}function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s){let l,a=s[5].code+"",_,u,i,p;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=P(a),u=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(S,h){d(S,l,h),n(l,_),n(l,u),i||(p=ge(l,"click",m),i=!0)},p(S,h){s=S,h&4&&a!==(a=s[5].code+"")&&K(_,a),h&6&&U(l,"active",s[1]===s[5].code)},d(S){S&&f(l),i=!1,p()}}}function ke(o,s){let l,a,_,u;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(i,p){d(i,l,p),we(a,l,null),n(l,_),u=!0},p(i,p){s=i;const m={};p&4&&(m.content=s[5].body),a.$set(m),(!u||p&6)&&U(l,"active",s[1]===s[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&f(l),Pe(a)}}}function ye(o){var re,de;let s,l,a=o[0].name+"",_,u,i,p,m,S,h,M=o[0].name+"",j,ee,H,R,L,W,Q,N,q,te,B,$,se,z,F=o[0].name+"",G,le,J,E,V,T,X,g,Y,O,A,w=[],ae=new Map,oe,D,k=[],ne=new Map,C;R=new De({props:{js:`
import{S as Se,i as he,s as Re,e as r,w as P,b as v,c as ve,f as b,g as d,h as n,m as we,x as K,N as me,P as Ne,k as Oe,Q as Ce,n as We,t as Z,a as x,o as f,d as Pe,T as $e,C as Ee,p as Te,r as U,u as ge,M as Ae}from"./index-055843b5.js";import{S as De}from"./SdkTabs-1c685373.js";function ue(o,s,l){const a=o.slice();return a[5]=s[l],a}function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s){let l,a=s[5].code+"",_,u,i,p;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=P(a),u=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(S,h){d(S,l,h),n(l,_),n(l,u),i||(p=ge(l,"click",m),i=!0)},p(S,h){s=S,h&4&&a!==(a=s[5].code+"")&&K(_,a),h&6&&U(l,"active",s[1]===s[5].code)},d(S){S&&f(l),i=!1,p()}}}function ke(o,s){let l,a,_,u;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(i,p){d(i,l,p),we(a,l,null),n(l,_),u=!0},p(i,p){s=i;const m={};p&4&&(m.content=s[5].body),a.$set(m),(!u||p&6)&&U(l,"active",s[1]===s[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&f(l),Pe(a)}}}function ye(o){var re,de;let s,l,a=o[0].name+"",_,u,i,p,m,S,h,M=o[0].name+"",j,ee,H,R,L,W,Q,N,q,te,B,$,se,z,F=o[0].name+"",G,le,J,E,V,T,X,g,Y,O,A,w=[],ae=new Map,oe,D,k=[],ne=new Map,C;R=new De({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[3]}');

View File

@ -1,4 +1,4 @@
import{S as we,i as Ce,s as Pe,e as r,w as $,b as v,c as ve,f as b,g as f,h as n,m as he,x as H,N as de,P as Te,k as ge,Q as ye,n as Be,t as Z,a as x,o as m,d as $e,T as qe,C as Se,p as Ee,r as R,u as Me,M as Ne}from"./index-69e255fe.js";import{S as Oe}from"./SdkTabs-5df68e34.js";function ue(i,l,s){const o=i.slice();return o[5]=l[s],o}function be(i,l,s){const o=i.slice();return o[5]=l[s],o}function _e(i,l){let s,o=l[5].code+"",_,u,a,p;function d(){return l[4](l[5])}return{key:i,first:null,c(){s=r("button"),_=$(o),u=v(),b(s,"class","tab-item"),R(s,"active",l[1]===l[5].code),this.first=s},m(w,C){f(w,s,C),n(s,_),n(s,u),a||(p=Me(s,"click",d),a=!0)},p(w,C){l=w,C&4&&o!==(o=l[5].code+"")&&H(_,o),C&6&&R(s,"active",l[1]===l[5].code)},d(w){w&&m(s),a=!1,p()}}}function ke(i,l){let s,o,_,u;return o=new Ne({props:{content:l[5].body}}),{key:i,first:null,c(){s=r("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),R(s,"active",l[1]===l[5].code),this.first=s},m(a,p){f(a,s,p),he(o,s,null),n(s,_),u=!0},p(a,p){l=a;const d={};p&4&&(d.content=l[5].body),o.$set(d),(!u||p&6)&&R(s,"active",l[1]===l[5].code)},i(a){u||(Z(o.$$.fragment,a),u=!0)},o(a){x(o.$$.fragment,a),u=!1},d(a){a&&m(s),$e(o)}}}function Ve(i){var re,fe;let l,s,o=i[0].name+"",_,u,a,p,d,w,C,K=i[0].name+"",F,ee,I,P,L,B,Q,T,A,te,U,q,le,z,j=i[0].name+"",G,se,J,S,W,E,X,M,Y,g,N,h=[],oe=new Map,ie,O,k=[],ne=new Map,y;P=new Oe({props:{js:`
import{S as we,i as Ce,s as Pe,e as r,w as $,b as v,c as ve,f as b,g as f,h as n,m as he,x as H,N as de,P as Te,k as ge,Q as ye,n as Be,t as Z,a as x,o as m,d as $e,T as qe,C as Se,p as Ee,r as R,u as Me,M as Ne}from"./index-055843b5.js";import{S as Oe}from"./SdkTabs-1c685373.js";function ue(i,l,s){const o=i.slice();return o[5]=l[s],o}function be(i,l,s){const o=i.slice();return o[5]=l[s],o}function _e(i,l){let s,o=l[5].code+"",_,u,a,p;function d(){return l[4](l[5])}return{key:i,first:null,c(){s=r("button"),_=$(o),u=v(),b(s,"class","tab-item"),R(s,"active",l[1]===l[5].code),this.first=s},m(w,C){f(w,s,C),n(s,_),n(s,u),a||(p=Me(s,"click",d),a=!0)},p(w,C){l=w,C&4&&o!==(o=l[5].code+"")&&H(_,o),C&6&&R(s,"active",l[1]===l[5].code)},d(w){w&&m(s),a=!1,p()}}}function ke(i,l){let s,o,_,u;return o=new Ne({props:{content:l[5].body}}),{key:i,first:null,c(){s=r("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),R(s,"active",l[1]===l[5].code),this.first=s},m(a,p){f(a,s,p),he(o,s,null),n(s,_),u=!0},p(a,p){l=a;const d={};p&4&&(d.content=l[5].body),o.$set(d),(!u||p&6)&&R(s,"active",l[1]===l[5].code)},i(a){u||(Z(o.$$.fragment,a),u=!0)},o(a){x(o.$$.fragment,a),u=!1},d(a){a&&m(s),$e(o)}}}function Ve(i){var re,fe;let l,s,o=i[0].name+"",_,u,a,p,d,w,C,K=i[0].name+"",F,ee,I,P,L,B,Q,T,A,te,U,q,le,z,j=i[0].name+"",G,se,J,S,W,E,X,M,Y,g,N,h=[],oe=new Map,ie,O,k=[],ne=new Map,y;P=new Oe({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${i[3]}');

View File

@ -1,114 +0,0 @@
import{S as Ht,i as Lt,s as Pt,C as Q,M as At,e as a,w as k,b as m,c as Pe,f as h,g as r,h as n,m as Be,x,N as Le,P as ht,k as Bt,Q as Ft,n as Rt,t as fe,a as pe,o as d,d as Fe,T as gt,p as jt,r as ue,u as Dt,y as le}from"./index-69e255fe.js";import{S as Nt}from"./SdkTabs-5df68e34.js";function wt(o,e,l){const s=o.slice();return s[7]=e[l],s}function Ct(o,e,l){const s=o.slice();return s[7]=e[l],s}function St(o,e,l){const s=o.slice();return s[12]=e[l],s}function $t(o){let e;return{c(){e=a("p"),e.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Tt(o){let e,l,s,b,p,c,f,v,T,w,M,g,D,E,L,I,j,R,S,N,q,C,_;function O(u,$){var ee,K;return(K=(ee=u[0])==null?void 0:ee.options)!=null&&K.requireEmail?Jt:Vt}let z=O(o),P=z(o);return{c(){e=a("tr"),e.innerHTML='<td colspan="3" class="txt-hint">Auth fields</td>',l=m(),s=a("tr"),s.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>username</span></div></td>
<td><span class="label">String</span></td>
<td>The username of the auth record.
<br/>
If not set, it will be auto generated.</td>`,b=m(),p=a("tr"),c=a("td"),f=a("div"),P.c(),v=m(),T=a("span"),T.textContent="email",w=m(),M=a("td"),M.innerHTML='<span class="label">String</span>',g=m(),D=a("td"),D.textContent="Auth record email address.",E=m(),L=a("tr"),L.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>emailVisibility</span></div></td>
<td><span class="label">Boolean</span></td>
<td>Whether to show/hide the auth record email when fetching the record data.</td>`,I=m(),j=a("tr"),j.innerHTML=`<td><div class="inline-flex"><span class="label label-success">Required</span>
<span>password</span></div></td>
<td><span class="label">String</span></td>
<td>Auth record password.</td>`,R=m(),S=a("tr"),S.innerHTML=`<td><div class="inline-flex"><span class="label label-success">Required</span>
<span>passwordConfirm</span></div></td>
<td><span class="label">String</span></td>
<td>Auth record password confirmation.</td>`,N=m(),q=a("tr"),q.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>verified</span></div></td>
<td><span class="label">Boolean</span></td>
<td>Indicates whether the auth record is verified or not.
<br/>
This field can be set only by admins or auth records with &quot;Manage&quot; access.</td>`,C=m(),_=a("tr"),_.innerHTML='<td colspan="3" class="txt-hint">Schema fields</td>',h(f,"class","inline-flex")},m(u,$){r(u,e,$),r(u,l,$),r(u,s,$),r(u,b,$),r(u,p,$),n(p,c),n(c,f),P.m(f,null),n(f,v),n(f,T),n(p,w),n(p,M),n(p,g),n(p,D),r(u,E,$),r(u,L,$),r(u,I,$),r(u,j,$),r(u,R,$),r(u,S,$),r(u,N,$),r(u,q,$),r(u,C,$),r(u,_,$)},p(u,$){z!==(z=O(u))&&(P.d(1),P=z(u),P&&(P.c(),P.m(f,v)))},d(u){u&&d(e),u&&d(l),u&&d(s),u&&d(b),u&&d(p),P.d(),u&&d(E),u&&d(L),u&&d(I),u&&d(j),u&&d(R),u&&d(S),u&&d(N),u&&d(q),u&&d(C),u&&d(_)}}}function Vt(o){let e;return{c(){e=a("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Jt(o){let e;return{c(){e=a("span"),e.textContent="Required",h(e,"class","label label-success")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Et(o){let e;return{c(){e=a("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function It(o){let e;return{c(){e=a("span"),e.textContent="Required",h(e,"class","label label-success")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Ut(o){var p;let e,l=((p=o[12].options)==null?void 0:p.maxSelect)===1?"id":"ids",s,b;return{c(){e=k("Relation record "),s=k(l),b=k(".")},m(c,f){r(c,e,f),r(c,s,f),r(c,b,f)},p(c,f){var v;f&1&&l!==(l=((v=c[12].options)==null?void 0:v.maxSelect)===1?"id":"ids")&&x(s,l)},d(c){c&&d(e),c&&d(s),c&&d(b)}}}function Qt(o){let e,l,s,b,p;return{c(){e=k("File object."),l=a("br"),s=k(`
Set to `),b=a("code"),b.textContent="null",p=k(" to delete already uploaded file(s).")},m(c,f){r(c,e,f),r(c,l,f),r(c,s,f),r(c,b,f),r(c,p,f)},p:le,d(c){c&&d(e),c&&d(l),c&&d(s),c&&d(b),c&&d(p)}}}function zt(o){let e;return{c(){e=k("URL address.")},m(l,s){r(l,e,s)},p:le,d(l){l&&d(e)}}}function Kt(o){let e;return{c(){e=k("Email address.")},m(l,s){r(l,e,s)},p:le,d(l){l&&d(e)}}}function Wt(o){let e;return{c(){e=k("JSON array or object.")},m(l,s){r(l,e,s)},p:le,d(l){l&&d(e)}}}function Yt(o){let e;return{c(){e=k("Number value.")},m(l,s){r(l,e,s)},p:le,d(l){l&&d(e)}}}function Gt(o){let e;return{c(){e=k("Plain text value.")},m(l,s){r(l,e,s)},p:le,d(l){l&&d(e)}}}function qt(o,e){let l,s,b,p,c,f=e[12].name+"",v,T,w,M,g=Q.getFieldValueType(e[12])+"",D,E,L,I;function j(_,O){return _[12].required?It:Et}let R=j(e),S=R(e);function N(_,O){if(_[12].type==="text")return Gt;if(_[12].type==="number")return Yt;if(_[12].type==="json")return Wt;if(_[12].type==="email")return Kt;if(_[12].type==="url")return zt;if(_[12].type==="file")return Qt;if(_[12].type==="relation")return Ut}let q=N(e),C=q&&q(e);return{key:o,first:null,c(){l=a("tr"),s=a("td"),b=a("div"),S.c(),p=m(),c=a("span"),v=k(f),T=m(),w=a("td"),M=a("span"),D=k(g),E=m(),L=a("td"),C&&C.c(),I=m(),h(b,"class","inline-flex"),h(M,"class","label"),this.first=l},m(_,O){r(_,l,O),n(l,s),n(s,b),S.m(b,null),n(b,p),n(b,c),n(c,v),n(l,T),n(l,w),n(w,M),n(M,D),n(l,E),n(l,L),C&&C.m(L,null),n(l,I)},p(_,O){e=_,R!==(R=j(e))&&(S.d(1),S=R(e),S&&(S.c(),S.m(b,p))),O&1&&f!==(f=e[12].name+"")&&x(v,f),O&1&&g!==(g=Q.getFieldValueType(e[12])+"")&&x(D,g),q===(q=N(e))&&C?C.p(e,O):(C&&C.d(1),C=q&&q(e),C&&(C.c(),C.m(L,null)))},d(_){_&&d(l),S.d(),C&&C.d()}}}function Mt(o,e){let l,s=e[7].code+"",b,p,c,f;function v(){return e[6](e[7])}return{key:o,first:null,c(){l=a("button"),b=k(s),p=m(),h(l,"class","tab-item"),ue(l,"active",e[1]===e[7].code),this.first=l},m(T,w){r(T,l,w),n(l,b),n(l,p),c||(f=Dt(l,"click",v),c=!0)},p(T,w){e=T,w&4&&s!==(s=e[7].code+"")&&x(b,s),w&6&&ue(l,"active",e[1]===e[7].code)},d(T){T&&d(l),c=!1,f()}}}function Ot(o,e){let l,s,b,p;return s=new At({props:{content:e[7].body}}),{key:o,first:null,c(){l=a("div"),Pe(s.$$.fragment),b=m(),h(l,"class","tab-item"),ue(l,"active",e[1]===e[7].code),this.first=l},m(c,f){r(c,l,f),Be(s,l,null),n(l,b),p=!0},p(c,f){e=c;const v={};f&4&&(v.content=e[7].body),s.$set(v),(!p||f&6)&&ue(l,"active",e[1]===e[7].code)},i(c){p||(fe(s.$$.fragment,c),p=!0)},o(c){pe(s.$$.fragment,c),p=!1},d(c){c&&d(l),Fe(s)}}}function Xt(o){var st,it,at,ot,rt,dt,ct,ft;let e,l,s=o[0].name+"",b,p,c,f,v,T,w,M=o[0].name+"",g,D,E,L,I,j,R,S,N,q,C,_,O,z,P,u,$,ee,K=o[0].name+"",me,Re,ge,be,ne,_e,W,ke,je,U,ye,De,ve,V=[],Ne=new Map,he,se,we,Y,Ce,Ve,Se,G,$e,Je,Te,Ee,A,Ie,te,Ue,Qe,ze,qe,Ke,Me,We,Ye,Ge,Oe,Xe,Ae,ie,He,X,ae,J=[],Ze=new Map,xe,oe,B=[],et=new Map,Z;S=new Nt({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[4]}');
...
// example create data
const data = ${JSON.stringify(Object.assign({},o[3],Q.dummyCollectionSchemaData(o[0])),null,4)};
const record = await pb.collection('${(st=o[0])==null?void 0:st.name}').create(data);
`+((it=o[0])!=null&&it.isAuth?`
// (optional) send an email verification request
await pb.collection('${(at=o[0])==null?void 0:at.name}').requestVerification('test@example.com');
`:""),dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${o[4]}');
...
// example create body
final body = <String, dynamic>${JSON.stringify(Object.assign({},o[3],Q.dummyCollectionSchemaData(o[0])),null,2)};
final record = await pb.collection('${(ot=o[0])==null?void 0:ot.name}').create(body: body);
`+((rt=o[0])!=null&&rt.isAuth?`
// (optional) send an email verification request
await pb.collection('${(dt=o[0])==null?void 0:dt.name}').requestVerification('test@example.com');
`:"")}});let F=o[5]&&$t(),H=((ct=o[0])==null?void 0:ct.isAuth)&&Tt(o),de=(ft=o[0])==null?void 0:ft.schema;const tt=t=>t[12].name;for(let t=0;t<de.length;t+=1){let i=St(o,de,t),y=tt(i);Ne.set(y,V[t]=qt(y,i))}te=new At({props:{content:"?expand=relField1,relField2.subRelField"}});let ce=o[2];const lt=t=>t[7].code;for(let t=0;t<ce.length;t+=1){let i=Ct(o,ce,t),y=lt(i);Ze.set(y,J[t]=Mt(y,i))}let re=o[2];const nt=t=>t[7].code;for(let t=0;t<re.length;t+=1){let i=wt(o,re,t),y=nt(i);et.set(y,B[t]=Ot(y,i))}return{c(){e=a("h3"),l=k("Create ("),b=k(s),p=k(")"),c=m(),f=a("div"),v=a("p"),T=k("Create a new "),w=a("strong"),g=k(M),D=k(" record."),E=m(),L=a("p"),L.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,I=m(),j=a("p"),j.innerHTML=`File upload is supported only via <code>multipart/form-data</code>.
<br/>
For more info and examples you could check the detailed
<a href="https://pocketbase.io/docs/files-handling/" target="_blank" rel="noopener noreferrer">Files upload and handling docs
</a>.`,R=m(),Pe(S.$$.fragment),N=m(),q=a("h6"),q.textContent="API details",C=m(),_=a("div"),O=a("strong"),O.textContent="POST",z=m(),P=a("div"),u=a("p"),$=k("/api/collections/"),ee=a("strong"),me=k(K),Re=k("/records"),ge=m(),F&&F.c(),be=m(),ne=a("div"),ne.textContent="Body Parameters",_e=m(),W=a("table"),ke=a("thead"),ke.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,je=m(),U=a("tbody"),ye=a("tr"),ye.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>id</span></div></td>
<td><span class="label">String</span></td>
<td><strong>15 characters string</strong> to store as record ID.
<br/>
If not set, it will be auto generated.</td>`,De=m(),H&&H.c(),ve=m();for(let t=0;t<V.length;t+=1)V[t].c();he=m(),se=a("div"),se.textContent="Query parameters",we=m(),Y=a("table"),Ce=a("thead"),Ce.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,Ve=m(),Se=a("tbody"),G=a("tr"),$e=a("td"),$e.textContent="expand",Je=m(),Te=a("td"),Te.innerHTML='<span class="label">String</span>',Ee=m(),A=a("td"),Ie=k(`Auto expand relations when returning the created record. Ex.:
`),Pe(te.$$.fragment),Ue=k(`
Supports up to 6-levels depth nested relations expansion. `),Qe=a("br"),ze=k(`
The expanded relations will be appended to the record under the
`),qe=a("code"),qe.textContent="expand",Ke=k(" property (eg. "),Me=a("code"),Me.textContent='"expand": {"relField1": {...}, ...}',We=k(`).
`),Ye=a("br"),Ge=k(`
Only the relations to which the request user has permissions to `),Oe=a("strong"),Oe.textContent="view",Xe=k(" will be expanded."),Ae=m(),ie=a("div"),ie.textContent="Responses",He=m(),X=a("div"),ae=a("div");for(let t=0;t<J.length;t+=1)J[t].c();xe=m(),oe=a("div");for(let t=0;t<B.length;t+=1)B[t].c();h(e,"class","m-b-sm"),h(f,"class","content txt-lg m-b-sm"),h(q,"class","m-b-xs"),h(O,"class","label label-primary"),h(P,"class","content"),h(_,"class","alert alert-success"),h(ne,"class","section-title"),h(W,"class","table-compact table-border m-b-base"),h(se,"class","section-title"),h(Y,"class","table-compact table-border m-b-base"),h(ie,"class","section-title"),h(ae,"class","tabs-header compact left"),h(oe,"class","tabs-content"),h(X,"class","tabs")},m(t,i){r(t,e,i),n(e,l),n(e,b),n(e,p),r(t,c,i),r(t,f,i),n(f,v),n(v,T),n(v,w),n(w,g),n(v,D),n(f,E),n(f,L),n(f,I),n(f,j),r(t,R,i),Be(S,t,i),r(t,N,i),r(t,q,i),r(t,C,i),r(t,_,i),n(_,O),n(_,z),n(_,P),n(P,u),n(u,$),n(u,ee),n(ee,me),n(u,Re),n(_,ge),F&&F.m(_,null),r(t,be,i),r(t,ne,i),r(t,_e,i),r(t,W,i),n(W,ke),n(W,je),n(W,U),n(U,ye),n(U,De),H&&H.m(U,null),n(U,ve);for(let y=0;y<V.length;y+=1)V[y]&&V[y].m(U,null);r(t,he,i),r(t,se,i),r(t,we,i),r(t,Y,i),n(Y,Ce),n(Y,Ve),n(Y,Se),n(Se,G),n(G,$e),n(G,Je),n(G,Te),n(G,Ee),n(G,A),n(A,Ie),Be(te,A,null),n(A,Ue),n(A,Qe),n(A,ze),n(A,qe),n(A,Ke),n(A,Me),n(A,We),n(A,Ye),n(A,Ge),n(A,Oe),n(A,Xe),r(t,Ae,i),r(t,ie,i),r(t,He,i),r(t,X,i),n(X,ae);for(let y=0;y<J.length;y+=1)J[y]&&J[y].m(ae,null);n(X,xe),n(X,oe);for(let y=0;y<B.length;y+=1)B[y]&&B[y].m(oe,null);Z=!0},p(t,[i]){var pt,ut,mt,bt,_t,kt,yt,vt;(!Z||i&1)&&s!==(s=t[0].name+"")&&x(b,s),(!Z||i&1)&&M!==(M=t[0].name+"")&&x(g,M);const y={};i&25&&(y.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${t[4]}');
...
// example create data
const data = ${JSON.stringify(Object.assign({},t[3],Q.dummyCollectionSchemaData(t[0])),null,4)};
const record = await pb.collection('${(pt=t[0])==null?void 0:pt.name}').create(data);
`+((ut=t[0])!=null&&ut.isAuth?`
// (optional) send an email verification request
await pb.collection('${(mt=t[0])==null?void 0:mt.name}').requestVerification('test@example.com');
`:"")),i&25&&(y.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${t[4]}');
...
// example create body
final body = <String, dynamic>${JSON.stringify(Object.assign({},t[3],Q.dummyCollectionSchemaData(t[0])),null,2)};
final record = await pb.collection('${(bt=t[0])==null?void 0:bt.name}').create(body: body);
`+((_t=t[0])!=null&&_t.isAuth?`
// (optional) send an email verification request
await pb.collection('${(kt=t[0])==null?void 0:kt.name}').requestVerification('test@example.com');
`:"")),S.$set(y),(!Z||i&1)&&K!==(K=t[0].name+"")&&x(me,K),t[5]?F||(F=$t(),F.c(),F.m(_,null)):F&&(F.d(1),F=null),(yt=t[0])!=null&&yt.isAuth?H?H.p(t,i):(H=Tt(t),H.c(),H.m(U,ve)):H&&(H.d(1),H=null),i&1&&(de=(vt=t[0])==null?void 0:vt.schema,V=Le(V,i,tt,1,t,de,Ne,U,ht,qt,null,St)),i&6&&(ce=t[2],J=Le(J,i,lt,1,t,ce,Ze,ae,ht,Mt,null,Ct)),i&6&&(re=t[2],Bt(),B=Le(B,i,nt,1,t,re,et,oe,Ft,Ot,null,wt),Rt())},i(t){if(!Z){fe(S.$$.fragment,t),fe(te.$$.fragment,t);for(let i=0;i<re.length;i+=1)fe(B[i]);Z=!0}},o(t){pe(S.$$.fragment,t),pe(te.$$.fragment,t);for(let i=0;i<B.length;i+=1)pe(B[i]);Z=!1},d(t){t&&d(e),t&&d(c),t&&d(f),t&&d(R),Fe(S,t),t&&d(N),t&&d(q),t&&d(C),t&&d(_),F&&F.d(),t&&d(be),t&&d(ne),t&&d(_e),t&&d(W),H&&H.d();for(let i=0;i<V.length;i+=1)V[i].d();t&&d(he),t&&d(se),t&&d(we),t&&d(Y),Fe(te),t&&d(Ae),t&&d(ie),t&&d(He),t&&d(X);for(let i=0;i<J.length;i+=1)J[i].d();for(let i=0;i<B.length;i+=1)B[i].d()}}}function Zt(o,e,l){let s,b,{collection:p=new gt}=e,c=200,f=[],v={};const T=w=>l(1,c=w.code);return o.$$set=w=>{"collection"in w&&l(0,p=w.collection)},o.$$.update=()=>{var w,M;o.$$.dirty&1&&l(5,s=(p==null?void 0:p.createRule)===null),o.$$.dirty&1&&l(2,f=[{code:200,body:JSON.stringify(Q.dummyCollectionRecord(p),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to create record.",
"data": {
"${(M=(w=p==null?void 0:p.schema)==null?void 0:w[0])==null?void 0:M.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`}]),o.$$.dirty&1&&(p.$isAuth?l(3,v={username:"test_username",email:"test@example.com",emailVisibility:!0,password:"12345678",passwordConfirm:"12345678"}):l(3,v={}))},l(4,b=Q.getApiExampleUrl(jt.baseUrl)),[p,c,f,v,b,s,T]}class tl extends Ht{constructor(e){super(),Lt(this,e,Zt,Xt,Pt,{collection:0})}}export{tl as default};

114
ui/dist/assets/CreateApiDocs-e288535b.js vendored Normal file
View File

@ -0,0 +1,114 @@
import{S as Pt,i as gt,s as Ft,C as Q,M as Lt,e as a,w as k,b as m,c as be,f as h,g as r,h as n,m as _e,x,N as Be,P as $t,k as Bt,Q as Rt,n as jt,t as fe,a as pe,o as d,d as ke,T as Dt,p as Nt,r as ye,u as Vt,y as ne}from"./index-055843b5.js";import{S as Jt}from"./SdkTabs-1c685373.js";import{F as Et}from"./FieldsQueryParam-815b0ee8.js";function Ct(o,e,l){const s=o.slice();return s[7]=e[l],s}function St(o,e,l){const s=o.slice();return s[7]=e[l],s}function Tt(o,e,l){const s=o.slice();return s[12]=e[l],s}function qt(o){let e;return{c(){e=a("p"),e.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Mt(o){let e,l,s,b,p,c,f,v,T,w,M,R,D,E,L,I,j,B,C,N,q,$,_;function O(u,S){var ee,K;return(K=(ee=u[0])==null?void 0:ee.options)!=null&&K.requireEmail?Ut:It}let z=O(o),P=z(o);return{c(){e=a("tr"),e.innerHTML='<td colspan="3" class="txt-hint">Auth fields</td>',l=m(),s=a("tr"),s.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>username</span></div></td>
<td><span class="label">String</span></td>
<td>The username of the auth record.
<br/>
If not set, it will be auto generated.</td>`,b=m(),p=a("tr"),c=a("td"),f=a("div"),P.c(),v=m(),T=a("span"),T.textContent="email",w=m(),M=a("td"),M.innerHTML='<span class="label">String</span>',R=m(),D=a("td"),D.textContent="Auth record email address.",E=m(),L=a("tr"),L.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>emailVisibility</span></div></td>
<td><span class="label">Boolean</span></td>
<td>Whether to show/hide the auth record email when fetching the record data.</td>`,I=m(),j=a("tr"),j.innerHTML=`<td><div class="inline-flex"><span class="label label-success">Required</span>
<span>password</span></div></td>
<td><span class="label">String</span></td>
<td>Auth record password.</td>`,B=m(),C=a("tr"),C.innerHTML=`<td><div class="inline-flex"><span class="label label-success">Required</span>
<span>passwordConfirm</span></div></td>
<td><span class="label">String</span></td>
<td>Auth record password confirmation.</td>`,N=m(),q=a("tr"),q.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>verified</span></div></td>
<td><span class="label">Boolean</span></td>
<td>Indicates whether the auth record is verified or not.
<br/>
This field can be set only by admins or auth records with &quot;Manage&quot; access.</td>`,$=m(),_=a("tr"),_.innerHTML='<td colspan="3" class="txt-hint">Schema fields</td>',h(f,"class","inline-flex")},m(u,S){r(u,e,S),r(u,l,S),r(u,s,S),r(u,b,S),r(u,p,S),n(p,c),n(c,f),P.m(f,null),n(f,v),n(f,T),n(p,w),n(p,M),n(p,R),n(p,D),r(u,E,S),r(u,L,S),r(u,I,S),r(u,j,S),r(u,B,S),r(u,C,S),r(u,N,S),r(u,q,S),r(u,$,S),r(u,_,S)},p(u,S){z!==(z=O(u))&&(P.d(1),P=z(u),P&&(P.c(),P.m(f,v)))},d(u){u&&d(e),u&&d(l),u&&d(s),u&&d(b),u&&d(p),P.d(),u&&d(E),u&&d(L),u&&d(I),u&&d(j),u&&d(B),u&&d(C),u&&d(N),u&&d(q),u&&d($),u&&d(_)}}}function It(o){let e;return{c(){e=a("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Ut(o){let e;return{c(){e=a("span"),e.textContent="Required",h(e,"class","label label-success")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Qt(o){let e;return{c(){e=a("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function zt(o){let e;return{c(){e=a("span"),e.textContent="Required",h(e,"class","label label-success")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Kt(o){var p;let e,l=((p=o[12].options)==null?void 0:p.maxSelect)===1?"id":"ids",s,b;return{c(){e=k("Relation record "),s=k(l),b=k(".")},m(c,f){r(c,e,f),r(c,s,f),r(c,b,f)},p(c,f){var v;f&1&&l!==(l=((v=c[12].options)==null?void 0:v.maxSelect)===1?"id":"ids")&&x(s,l)},d(c){c&&d(e),c&&d(s),c&&d(b)}}}function Wt(o){let e,l,s,b,p;return{c(){e=k("File object."),l=a("br"),s=k(`
Set to `),b=a("code"),b.textContent="null",p=k(" to delete already uploaded file(s).")},m(c,f){r(c,e,f),r(c,l,f),r(c,s,f),r(c,b,f),r(c,p,f)},p:ne,d(c){c&&d(e),c&&d(l),c&&d(s),c&&d(b),c&&d(p)}}}function Yt(o){let e;return{c(){e=k("URL address.")},m(l,s){r(l,e,s)},p:ne,d(l){l&&d(e)}}}function Gt(o){let e;return{c(){e=k("Email address.")},m(l,s){r(l,e,s)},p:ne,d(l){l&&d(e)}}}function Xt(o){let e;return{c(){e=k("JSON array or object.")},m(l,s){r(l,e,s)},p:ne,d(l){l&&d(e)}}}function Zt(o){let e;return{c(){e=k("Number value.")},m(l,s){r(l,e,s)},p:ne,d(l){l&&d(e)}}}function xt(o){let e;return{c(){e=k("Plain text value.")},m(l,s){r(l,e,s)},p:ne,d(l){l&&d(e)}}}function Ot(o,e){let l,s,b,p,c,f=e[12].name+"",v,T,w,M,R=Q.getFieldValueType(e[12])+"",D,E,L,I;function j(_,O){return _[12].required?zt:Qt}let B=j(e),C=B(e);function N(_,O){if(_[12].type==="text")return xt;if(_[12].type==="number")return Zt;if(_[12].type==="json")return Xt;if(_[12].type==="email")return Gt;if(_[12].type==="url")return Yt;if(_[12].type==="file")return Wt;if(_[12].type==="relation")return Kt}let q=N(e),$=q&&q(e);return{key:o,first:null,c(){l=a("tr"),s=a("td"),b=a("div"),C.c(),p=m(),c=a("span"),v=k(f),T=m(),w=a("td"),M=a("span"),D=k(R),E=m(),L=a("td"),$&&$.c(),I=m(),h(b,"class","inline-flex"),h(M,"class","label"),this.first=l},m(_,O){r(_,l,O),n(l,s),n(s,b),C.m(b,null),n(b,p),n(b,c),n(c,v),n(l,T),n(l,w),n(w,M),n(M,D),n(l,E),n(l,L),$&&$.m(L,null),n(l,I)},p(_,O){e=_,B!==(B=j(e))&&(C.d(1),C=B(e),C&&(C.c(),C.m(b,p))),O&1&&f!==(f=e[12].name+"")&&x(v,f),O&1&&R!==(R=Q.getFieldValueType(e[12])+"")&&x(D,R),q===(q=N(e))&&$?$.p(e,O):($&&$.d(1),$=q&&q(e),$&&($.c(),$.m(L,null)))},d(_){_&&d(l),C.d(),$&&$.d()}}}function At(o,e){let l,s=e[7].code+"",b,p,c,f;function v(){return e[6](e[7])}return{key:o,first:null,c(){l=a("button"),b=k(s),p=m(),h(l,"class","tab-item"),ye(l,"active",e[1]===e[7].code),this.first=l},m(T,w){r(T,l,w),n(l,b),n(l,p),c||(f=Vt(l,"click",v),c=!0)},p(T,w){e=T,w&4&&s!==(s=e[7].code+"")&&x(b,s),w&6&&ye(l,"active",e[1]===e[7].code)},d(T){T&&d(l),c=!1,f()}}}function Ht(o,e){let l,s,b,p;return s=new Lt({props:{content:e[7].body}}),{key:o,first:null,c(){l=a("div"),be(s.$$.fragment),b=m(),h(l,"class","tab-item"),ye(l,"active",e[1]===e[7].code),this.first=l},m(c,f){r(c,l,f),_e(s,l,null),n(l,b),p=!0},p(c,f){e=c;const v={};f&4&&(v.content=e[7].body),s.$set(v),(!p||f&6)&&ye(l,"active",e[1]===e[7].code)},i(c){p||(fe(s.$$.fragment,c),p=!0)},o(c){pe(s.$$.fragment,c),p=!1},d(c){c&&d(l),ke(s)}}}function el(o){var at,ot,rt,dt,ct,ft,pt,ut;let e,l,s=o[0].name+"",b,p,c,f,v,T,w,M=o[0].name+"",R,D,E,L,I,j,B,C,N,q,$,_,O,z,P,u,S,ee,K=o[0].name+"",ve,Re,je,he,se,we,W,$e,De,U,Ce,Ne,Se,V=[],Ve=new Map,Te,ie,qe,Y,Me,Je,ae,G,Oe,Ee,Ae,Ie,A,Ue,te,Qe,ze,Ke,He,We,Le,Ye,Ge,Xe,Pe,Ze,xe,le,ge,oe,Fe,X,re,J=[],et=new Map,tt,de,g=[],lt=new Map,Z;C=new Jt({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[4]}');
...
// example create data
const data = ${JSON.stringify(Object.assign({},o[3],Q.dummyCollectionSchemaData(o[0])),null,4)};
const record = await pb.collection('${(at=o[0])==null?void 0:at.name}').create(data);
`+((ot=o[0])!=null&&ot.isAuth?`
// (optional) send an email verification request
await pb.collection('${(rt=o[0])==null?void 0:rt.name}').requestVerification('test@example.com');
`:""),dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${o[4]}');
...
// example create body
final body = <String, dynamic>${JSON.stringify(Object.assign({},o[3],Q.dummyCollectionSchemaData(o[0])),null,2)};
final record = await pb.collection('${(dt=o[0])==null?void 0:dt.name}').create(body: body);
`+((ct=o[0])!=null&&ct.isAuth?`
// (optional) send an email verification request
await pb.collection('${(ft=o[0])==null?void 0:ft.name}').requestVerification('test@example.com');
`:"")}});let F=o[5]&&qt(),H=((pt=o[0])==null?void 0:pt.isAuth)&&Mt(o),ue=(ut=o[0])==null?void 0:ut.schema;const nt=t=>t[12].name;for(let t=0;t<ue.length;t+=1){let i=Tt(o,ue,t),y=nt(i);Ve.set(y,V[t]=Ot(y,i))}te=new Lt({props:{content:"?expand=relField1,relField2.subRelField"}}),le=new Et({});let me=o[2];const st=t=>t[7].code;for(let t=0;t<me.length;t+=1){let i=St(o,me,t),y=st(i);et.set(y,J[t]=At(y,i))}let ce=o[2];const it=t=>t[7].code;for(let t=0;t<ce.length;t+=1){let i=Ct(o,ce,t),y=it(i);lt.set(y,g[t]=Ht(y,i))}return{c(){e=a("h3"),l=k("Create ("),b=k(s),p=k(")"),c=m(),f=a("div"),v=a("p"),T=k("Create a new "),w=a("strong"),R=k(M),D=k(" record."),E=m(),L=a("p"),L.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,I=m(),j=a("p"),j.innerHTML=`File upload is supported only via <code>multipart/form-data</code>.
<br/>
For more info and examples you could check the detailed
<a href="https://pocketbase.io/docs/files-handling/" target="_blank" rel="noopener noreferrer">Files upload and handling docs
</a>.`,B=m(),be(C.$$.fragment),N=m(),q=a("h6"),q.textContent="API details",$=m(),_=a("div"),O=a("strong"),O.textContent="POST",z=m(),P=a("div"),u=a("p"),S=k("/api/collections/"),ee=a("strong"),ve=k(K),Re=k("/records"),je=m(),F&&F.c(),he=m(),se=a("div"),se.textContent="Body Parameters",we=m(),W=a("table"),$e=a("thead"),$e.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,De=m(),U=a("tbody"),Ce=a("tr"),Ce.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>id</span></div></td>
<td><span class="label">String</span></td>
<td><strong>15 characters string</strong> to store as record ID.
<br/>
If not set, it will be auto generated.</td>`,Ne=m(),H&&H.c(),Se=m();for(let t=0;t<V.length;t+=1)V[t].c();Te=m(),ie=a("div"),ie.textContent="Query parameters",qe=m(),Y=a("table"),Me=a("thead"),Me.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,Je=m(),ae=a("tbody"),G=a("tr"),Oe=a("td"),Oe.textContent="expand",Ee=m(),Ae=a("td"),Ae.innerHTML='<span class="label">String</span>',Ie=m(),A=a("td"),Ue=k(`Auto expand relations when returning the created record. Ex.:
`),be(te.$$.fragment),Qe=k(`
Supports up to 6-levels depth nested relations expansion. `),ze=a("br"),Ke=k(`
The expanded relations will be appended to the record under the
`),He=a("code"),He.textContent="expand",We=k(" property (eg. "),Le=a("code"),Le.textContent='"expand": {"relField1": {...}, ...}',Ye=k(`).
`),Ge=a("br"),Xe=k(`
Only the relations to which the request user has permissions to `),Pe=a("strong"),Pe.textContent="view",Ze=k(" will be expanded."),xe=m(),be(le.$$.fragment),ge=m(),oe=a("div"),oe.textContent="Responses",Fe=m(),X=a("div"),re=a("div");for(let t=0;t<J.length;t+=1)J[t].c();tt=m(),de=a("div");for(let t=0;t<g.length;t+=1)g[t].c();h(e,"class","m-b-sm"),h(f,"class","content txt-lg m-b-sm"),h(q,"class","m-b-xs"),h(O,"class","label label-primary"),h(P,"class","content"),h(_,"class","alert alert-success"),h(se,"class","section-title"),h(W,"class","table-compact table-border m-b-base"),h(ie,"class","section-title"),h(Y,"class","table-compact table-border m-b-base"),h(oe,"class","section-title"),h(re,"class","tabs-header compact left"),h(de,"class","tabs-content"),h(X,"class","tabs")},m(t,i){r(t,e,i),n(e,l),n(e,b),n(e,p),r(t,c,i),r(t,f,i),n(f,v),n(v,T),n(v,w),n(w,R),n(v,D),n(f,E),n(f,L),n(f,I),n(f,j),r(t,B,i),_e(C,t,i),r(t,N,i),r(t,q,i),r(t,$,i),r(t,_,i),n(_,O),n(_,z),n(_,P),n(P,u),n(u,S),n(u,ee),n(ee,ve),n(u,Re),n(_,je),F&&F.m(_,null),r(t,he,i),r(t,se,i),r(t,we,i),r(t,W,i),n(W,$e),n(W,De),n(W,U),n(U,Ce),n(U,Ne),H&&H.m(U,null),n(U,Se);for(let y=0;y<V.length;y+=1)V[y]&&V[y].m(U,null);r(t,Te,i),r(t,ie,i),r(t,qe,i),r(t,Y,i),n(Y,Me),n(Y,Je),n(Y,ae),n(ae,G),n(G,Oe),n(G,Ee),n(G,Ae),n(G,Ie),n(G,A),n(A,Ue),_e(te,A,null),n(A,Qe),n(A,ze),n(A,Ke),n(A,He),n(A,We),n(A,Le),n(A,Ye),n(A,Ge),n(A,Xe),n(A,Pe),n(A,Ze),n(ae,xe),_e(le,ae,null),r(t,ge,i),r(t,oe,i),r(t,Fe,i),r(t,X,i),n(X,re);for(let y=0;y<J.length;y+=1)J[y]&&J[y].m(re,null);n(X,tt),n(X,de);for(let y=0;y<g.length;y+=1)g[y]&&g[y].m(de,null);Z=!0},p(t,[i]){var mt,bt,_t,kt,yt,vt,ht,wt;(!Z||i&1)&&s!==(s=t[0].name+"")&&x(b,s),(!Z||i&1)&&M!==(M=t[0].name+"")&&x(R,M);const y={};i&25&&(y.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${t[4]}');
...
// example create data
const data = ${JSON.stringify(Object.assign({},t[3],Q.dummyCollectionSchemaData(t[0])),null,4)};
const record = await pb.collection('${(mt=t[0])==null?void 0:mt.name}').create(data);
`+((bt=t[0])!=null&&bt.isAuth?`
// (optional) send an email verification request
await pb.collection('${(_t=t[0])==null?void 0:_t.name}').requestVerification('test@example.com');
`:"")),i&25&&(y.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${t[4]}');
...
// example create body
final body = <String, dynamic>${JSON.stringify(Object.assign({},t[3],Q.dummyCollectionSchemaData(t[0])),null,2)};
final record = await pb.collection('${(kt=t[0])==null?void 0:kt.name}').create(body: body);
`+((yt=t[0])!=null&&yt.isAuth?`
// (optional) send an email verification request
await pb.collection('${(vt=t[0])==null?void 0:vt.name}').requestVerification('test@example.com');
`:"")),C.$set(y),(!Z||i&1)&&K!==(K=t[0].name+"")&&x(ve,K),t[5]?F||(F=qt(),F.c(),F.m(_,null)):F&&(F.d(1),F=null),(ht=t[0])!=null&&ht.isAuth?H?H.p(t,i):(H=Mt(t),H.c(),H.m(U,Se)):H&&(H.d(1),H=null),i&1&&(ue=(wt=t[0])==null?void 0:wt.schema,V=Be(V,i,nt,1,t,ue,Ve,U,$t,Ot,null,Tt)),i&6&&(me=t[2],J=Be(J,i,st,1,t,me,et,re,$t,At,null,St)),i&6&&(ce=t[2],Bt(),g=Be(g,i,it,1,t,ce,lt,de,Rt,Ht,null,Ct),jt())},i(t){if(!Z){fe(C.$$.fragment,t),fe(te.$$.fragment,t),fe(le.$$.fragment,t);for(let i=0;i<ce.length;i+=1)fe(g[i]);Z=!0}},o(t){pe(C.$$.fragment,t),pe(te.$$.fragment,t),pe(le.$$.fragment,t);for(let i=0;i<g.length;i+=1)pe(g[i]);Z=!1},d(t){t&&d(e),t&&d(c),t&&d(f),t&&d(B),ke(C,t),t&&d(N),t&&d(q),t&&d($),t&&d(_),F&&F.d(),t&&d(he),t&&d(se),t&&d(we),t&&d(W),H&&H.d();for(let i=0;i<V.length;i+=1)V[i].d();t&&d(Te),t&&d(ie),t&&d(qe),t&&d(Y),ke(te),ke(le),t&&d(ge),t&&d(oe),t&&d(Fe),t&&d(X);for(let i=0;i<J.length;i+=1)J[i].d();for(let i=0;i<g.length;i+=1)g[i].d()}}}function tl(o,e,l){let s,b,{collection:p=new Dt}=e,c=200,f=[],v={};const T=w=>l(1,c=w.code);return o.$$set=w=>{"collection"in w&&l(0,p=w.collection)},o.$$.update=()=>{var w,M;o.$$.dirty&1&&l(5,s=(p==null?void 0:p.createRule)===null),o.$$.dirty&1&&l(2,f=[{code:200,body:JSON.stringify(Q.dummyCollectionRecord(p),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to create record.",
"data": {
"${(M=(w=p==null?void 0:p.schema)==null?void 0:w[0])==null?void 0:M.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`}]),o.$$.dirty&1&&(p.$isAuth?l(3,v={username:"test_username",email:"test@example.com",emailVisibility:!0,password:"12345678",passwordConfirm:"12345678"}):l(3,v={}))},l(4,b=Q.getApiExampleUrl(Nt.baseUrl)),[p,c,f,v,b,s,T]}class il extends Pt{constructor(e){super(),gt(this,e,tl,el,Ft,{collection:0})}}export{il as default};

View File

@ -1,4 +1,4 @@
import{S as Ce,i as Re,s as Pe,e as c,w as $,b as h,c as $e,f as m,g as f,h as n,m as we,x,N as _e,P as Ee,k as Te,Q as Be,n as Oe,t as ee,a as te,o as u,d as ge,T as Ie,C as Me,p as Ae,r as N,u as Se,M as qe}from"./index-69e255fe.js";import{S as He}from"./SdkTabs-5df68e34.js";function ke(o,l,s){const a=o.slice();return a[6]=l[s],a}function he(o,l,s){const a=o.slice();return a[6]=l[s],a}function ve(o){let l;return{c(){l=c("p"),l.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",m(l,"class","txt-hint txt-sm txt-right")},m(s,a){f(s,l,a)},d(s){s&&u(l)}}}function ye(o,l){let s,a=l[6].code+"",v,i,r,p;function w(){return l[5](l[6])}return{key:o,first:null,c(){s=c("button"),v=$(a),i=h(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(b,g){f(b,s,g),n(s,v),n(s,i),r||(p=Se(s,"click",w),r=!0)},p(b,g){l=b,g&20&&N(s,"active",l[2]===l[6].code)},d(b){b&&u(s),r=!1,p()}}}function De(o,l){let s,a,v,i;return a=new qe({props:{content:l[6].body}}),{key:o,first:null,c(){s=c("div"),$e(a.$$.fragment),v=h(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(r,p){f(r,s,p),we(a,s,null),n(s,v),i=!0},p(r,p){l=r,(!i||p&20)&&N(s,"active",l[2]===l[6].code)},i(r){i||(ee(a.$$.fragment,r),i=!0)},o(r){te(a.$$.fragment,r),i=!1},d(r){r&&u(s),ge(a)}}}function Le(o){var ue,pe;let l,s,a=o[0].name+"",v,i,r,p,w,b,g,q=o[0].name+"",z,le,F,C,K,T,Q,y,H,se,L,E,oe,G,U=o[0].name+"",J,ae,V,ne,W,B,X,O,Y,I,Z,R,M,D=[],ie=new Map,re,A,_=[],ce=new Map,P;C=new He({props:{js:`
import{S as Ce,i as Re,s as Pe,e as c,w as $,b as h,c as $e,f as m,g as f,h as n,m as we,x,N as _e,P as Ee,k as Te,Q as Be,n as Oe,t as ee,a as te,o as u,d as ge,T as Ie,C as Me,p as Ae,r as N,u as Se,M as qe}from"./index-055843b5.js";import{S as He}from"./SdkTabs-1c685373.js";function ke(o,l,s){const a=o.slice();return a[6]=l[s],a}function he(o,l,s){const a=o.slice();return a[6]=l[s],a}function ve(o){let l;return{c(){l=c("p"),l.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",m(l,"class","txt-hint txt-sm txt-right")},m(s,a){f(s,l,a)},d(s){s&&u(l)}}}function ye(o,l){let s,a=l[6].code+"",v,i,r,p;function w(){return l[5](l[6])}return{key:o,first:null,c(){s=c("button"),v=$(a),i=h(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(b,g){f(b,s,g),n(s,v),n(s,i),r||(p=Se(s,"click",w),r=!0)},p(b,g){l=b,g&20&&N(s,"active",l[2]===l[6].code)},d(b){b&&u(s),r=!1,p()}}}function De(o,l){let s,a,v,i;return a=new qe({props:{content:l[6].body}}),{key:o,first:null,c(){s=c("div"),$e(a.$$.fragment),v=h(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(r,p){f(r,s,p),we(a,s,null),n(s,v),i=!0},p(r,p){l=r,(!i||p&20)&&N(s,"active",l[2]===l[6].code)},i(r){i||(ee(a.$$.fragment,r),i=!0)},o(r){te(a.$$.fragment,r),i=!1},d(r){r&&u(s),ge(a)}}}function Le(o){var ue,pe;let l,s,a=o[0].name+"",v,i,r,p,w,b,g,q=o[0].name+"",z,le,F,C,K,T,Q,y,H,se,L,E,oe,G,U=o[0].name+"",J,ae,V,ne,W,B,X,O,Y,I,Z,R,M,D=[],ie=new Map,re,A,_=[],ce=new Map,P;C=new He({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[3]}');

View File

@ -0,0 +1,6 @@
import{S as d,i as n,s as i,e as l,g as o,y as s,o as p}from"./index-055843b5.js";function c(a){let e;return{c(){e=l("tr"),e.innerHTML=`<td id="query-page">fields</td>
<td><span class="label">String</span></td>
<td>Comma separated string of the fields to return in the JSON response
<em>(by default returns all fields)</em>. For example:
<br/>
<code>?fields=id,expand.relField.id,expand.relField.created</code></td>`},m(t,r){o(t,e,r)},p:s,i:s,o:s,d(t){t&&p(e)}}}class f extends d{constructor(e){super(),n(this,e,null,c,i,{})}}export{f as F};

View File

@ -1,135 +0,0 @@
import{S as Ke,i as Ve,s as We,e,b as s,E as Ye,f as i,g as u,u as Xe,y as De,o as m,w,h as t,M as $e,c as Zt,m as te,x as Ce,N as He,P as Ze,k as tl,Q as el,n as ll,t as Gt,a as Ut,d as ee,R as sl,T as nl,C as ge,p as ol,r as ke}from"./index-69e255fe.js";import{S as il}from"./SdkTabs-5df68e34.js";function al(c){let n,o,a;return{c(){n=e("span"),n.textContent="Show details",o=s(),a=e("i"),i(n,"class","txt"),i(a,"class","ri-arrow-down-s-line")},m(p,b){u(p,n,b),u(p,o,b),u(p,a,b)},d(p){p&&m(n),p&&m(o),p&&m(a)}}}function rl(c){let n,o,a;return{c(){n=e("span"),n.textContent="Hide details",o=s(),a=e("i"),i(n,"class","txt"),i(a,"class","ri-arrow-up-s-line")},m(p,b){u(p,n,b),u(p,o,b),u(p,a,b)},d(p){p&&m(n),p&&m(o),p&&m(a)}}}function Ie(c){let n,o,a,p,b,d,h,C,x,_,f,et,kt,jt,S,Qt,D,ct,R,lt,le,U,j,se,dt,vt,st,yt,ne,ft,pt,nt,E,zt,Ft,T,ot,Lt,Jt,At,Q,it,Tt,Kt,Pt,L,ut,Rt,oe,mt,ie,H,Ot,at,St,O,bt,ae,z,Et,Vt,Nt,re,N,Wt,J,ht,ce,I,de,B,fe,P,qt,K,_t,pe,xt,ue,$,Mt,rt,Dt,me,Ht,Xt,V,wt,be,It,he,Ct,_e,G,W,Yt,q,gt,A,xe,X,Y,y,Bt,Z,v,tt,k;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format
<code><span class="txt-success">OPERAND</span>
<span class="txt-danger">OPERATOR</span>
<span class="txt-success">OPERAND</span></code>, where:`,o=s(),a=e("ul"),p=e("li"),p.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single
or double quoted), number, null, true, false`,b=s(),d=e("li"),h=e("code"),h.textContent="OPERATOR",C=w(` - is one of:
`),x=e("br"),_=s(),f=e("ul"),et=e("li"),kt=e("code"),kt.textContent="=",jt=s(),S=e("span"),S.textContent="Equal",Qt=s(),D=e("li"),ct=e("code"),ct.textContent="!=",R=s(),lt=e("span"),lt.textContent="NOT equal",le=s(),U=e("li"),j=e("code"),j.textContent=">",se=s(),dt=e("span"),dt.textContent="Greater than",vt=s(),st=e("li"),yt=e("code"),yt.textContent=">=",ne=s(),ft=e("span"),ft.textContent="Greater than or equal",pt=s(),nt=e("li"),E=e("code"),E.textContent="<",zt=s(),Ft=e("span"),Ft.textContent="Less than",T=s(),ot=e("li"),Lt=e("code"),Lt.textContent="<=",Jt=s(),At=e("span"),At.textContent="Less than or equal",Q=s(),it=e("li"),Tt=e("code"),Tt.textContent="~",Kt=s(),Pt=e("span"),Pt.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,L=s(),ut=e("li"),Rt=e("code"),Rt.textContent="!~",oe=s(),mt=e("span"),mt.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,ie=s(),H=e("li"),Ot=e("code"),Ot.textContent="?=",at=s(),St=e("em"),St.textContent="Any/At least one of",O=s(),bt=e("span"),bt.textContent="Equal",ae=s(),z=e("li"),Et=e("code"),Et.textContent="?!=",Vt=s(),Nt=e("em"),Nt.textContent="Any/At least one of",re=s(),N=e("span"),N.textContent="NOT equal",Wt=s(),J=e("li"),ht=e("code"),ht.textContent="?>",ce=s(),I=e("em"),I.textContent="Any/At least one of",de=s(),B=e("span"),B.textContent="Greater than",fe=s(),P=e("li"),qt=e("code"),qt.textContent="?>=",K=s(),_t=e("em"),_t.textContent="Any/At least one of",pe=s(),xt=e("span"),xt.textContent="Greater than or equal",ue=s(),$=e("li"),Mt=e("code"),Mt.textContent="?<",rt=s(),Dt=e("em"),Dt.textContent="Any/At least one of",me=s(),Ht=e("span"),Ht.textContent="Less than",Xt=s(),V=e("li"),wt=e("code"),wt.textContent="?<=",be=s(),It=e("em"),It.textContent="Any/At least one of",he=s(),Ct=e("span"),Ct.textContent="Less than or equal",_e=s(),G=e("li"),W=e("code"),W.textContent="?~",Yt=s(),q=e("em"),q.textContent="Any/At least one of",gt=s(),A=e("span"),A.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,xe=s(),X=e("li"),Y=e("code"),Y.textContent="?!~",y=s(),Bt=e("em"),Bt.textContent="Any/At least one of",Z=s(),v=e("span"),v.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,tt=s(),k=e("p"),k.innerHTML=`To group and combine several expressions you could use brackets
<code>(...)</code>, <code>&amp;&amp;</code> (AND) and <code>||</code> (OR) tokens.`,i(h,"class","txt-danger"),i(kt,"class","filter-op svelte-1w7s5nw"),i(S,"class","txt"),i(ct,"class","filter-op svelte-1w7s5nw"),i(lt,"class","txt"),i(j,"class","filter-op svelte-1w7s5nw"),i(dt,"class","txt"),i(yt,"class","filter-op svelte-1w7s5nw"),i(ft,"class","txt"),i(E,"class","filter-op svelte-1w7s5nw"),i(Ft,"class","txt"),i(Lt,"class","filter-op svelte-1w7s5nw"),i(At,"class","txt"),i(Tt,"class","filter-op svelte-1w7s5nw"),i(Pt,"class","txt"),i(Rt,"class","filter-op svelte-1w7s5nw"),i(mt,"class","txt"),i(Ot,"class","filter-op svelte-1w7s5nw"),i(St,"class","txt-hint"),i(bt,"class","txt"),i(Et,"class","filter-op svelte-1w7s5nw"),i(Nt,"class","txt-hint"),i(N,"class","txt"),i(ht,"class","filter-op svelte-1w7s5nw"),i(I,"class","txt-hint"),i(B,"class","txt"),i(qt,"class","filter-op svelte-1w7s5nw"),i(_t,"class","txt-hint"),i(xt,"class","txt"),i(Mt,"class","filter-op svelte-1w7s5nw"),i(Dt,"class","txt-hint"),i(Ht,"class","txt"),i(wt,"class","filter-op svelte-1w7s5nw"),i(It,"class","txt-hint"),i(Ct,"class","txt"),i(W,"class","filter-op svelte-1w7s5nw"),i(q,"class","txt-hint"),i(A,"class","txt"),i(Y,"class","filter-op svelte-1w7s5nw"),i(Bt,"class","txt-hint"),i(v,"class","txt")},m(F,$t){u(F,n,$t),u(F,o,$t),u(F,a,$t),t(a,p),t(a,b),t(a,d),t(d,h),t(d,C),t(d,x),t(d,_),t(d,f),t(f,et),t(et,kt),t(et,jt),t(et,S),t(f,Qt),t(f,D),t(D,ct),t(D,R),t(D,lt),t(f,le),t(f,U),t(U,j),t(U,se),t(U,dt),t(f,vt),t(f,st),t(st,yt),t(st,ne),t(st,ft),t(f,pt),t(f,nt),t(nt,E),t(nt,zt),t(nt,Ft),t(f,T),t(f,ot),t(ot,Lt),t(ot,Jt),t(ot,At),t(f,Q),t(f,it),t(it,Tt),t(it,Kt),t(it,Pt),t(f,L),t(f,ut),t(ut,Rt),t(ut,oe),t(ut,mt),t(f,ie),t(f,H),t(H,Ot),t(H,at),t(H,St),t(H,O),t(H,bt),t(f,ae),t(f,z),t(z,Et),t(z,Vt),t(z,Nt),t(z,re),t(z,N),t(f,Wt),t(f,J),t(J,ht),t(J,ce),t(J,I),t(J,de),t(J,B),t(f,fe),t(f,P),t(P,qt),t(P,K),t(P,_t),t(P,pe),t(P,xt),t(f,ue),t(f,$),t($,Mt),t($,rt),t($,Dt),t($,me),t($,Ht),t(f,Xt),t(f,V),t(V,wt),t(V,be),t(V,It),t(V,he),t(V,Ct),t(f,_e),t(f,G),t(G,W),t(G,Yt),t(G,q),t(G,gt),t(G,A),t(f,xe),t(f,X),t(X,Y),t(X,y),t(X,Bt),t(X,Z),t(X,v),u(F,tt,$t),u(F,k,$t)},d(F){F&&m(n),F&&m(o),F&&m(a),F&&m(tt),F&&m(k)}}}function cl(c){let n,o,a,p,b;function d(_,f){return _[0]?rl:al}let h=d(c),C=h(c),x=c[0]&&Ie();return{c(){n=e("button"),C.c(),o=s(),x&&x.c(),a=Ye(),i(n,"class","btn btn-sm btn-secondary m-t-10")},m(_,f){u(_,n,f),C.m(n,null),u(_,o,f),x&&x.m(_,f),u(_,a,f),p||(b=Xe(n,"click",c[1]),p=!0)},p(_,[f]){h!==(h=d(_))&&(C.d(1),C=h(_),C&&(C.c(),C.m(n,null))),_[0]?x||(x=Ie(),x.c(),x.m(a.parentNode,a)):x&&(x.d(1),x=null)},i:De,o:De,d(_){_&&m(n),C.d(),_&&m(o),x&&x.d(_),_&&m(a),p=!1,b()}}}function dl(c,n,o){let a=!1;function p(){o(0,a=!a)}return[a,p]}class fl extends Ke{constructor(n){super(),Ve(this,n,dl,cl,We,{})}}function Be(c,n,o){const a=c.slice();return a[7]=n[o],a}function Ge(c,n,o){const a=c.slice();return a[7]=n[o],a}function Ue(c,n,o){const a=c.slice();return a[12]=n[o],a[14]=o,a}function je(c){let n;return{c(){n=e("p"),n.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",i(n,"class","txt-hint txt-sm txt-right")},m(o,a){u(o,n,a)},d(o){o&&m(n)}}}function Qe(c){let n,o=c[12]+"",a,p=c[14]<c[4].length-1?", ":"",b;return{c(){n=e("code"),a=w(o),b=w(p)},m(d,h){u(d,n,h),t(n,a),u(d,b,h)},p(d,h){h&16&&o!==(o=d[12]+"")&&Ce(a,o),h&16&&p!==(p=d[14]<d[4].length-1?", ":"")&&Ce(b,p)},d(d){d&&m(n),d&&m(b)}}}function ze(c,n){let o,a=n[7].code+"",p,b,d,h;function C(){return n[6](n[7])}return{key:c,first:null,c(){o=e("div"),p=w(a),b=s(),i(o,"class","tab-item"),ke(o,"active",n[2]===n[7].code),this.first=o},m(x,_){u(x,o,_),t(o,p),t(o,b),d||(h=Xe(o,"click",C),d=!0)},p(x,_){n=x,_&36&&ke(o,"active",n[2]===n[7].code)},d(x){x&&m(o),d=!1,h()}}}function Je(c,n){let o,a,p,b;return a=new $e({props:{content:n[7].body}}),{key:c,first:null,c(){o=e("div"),Zt(a.$$.fragment),p=s(),i(o,"class","tab-item"),ke(o,"active",n[2]===n[7].code),this.first=o},m(d,h){u(d,o,h),te(a,o,null),t(o,p),b=!0},p(d,h){n=d,(!b||h&36)&&ke(o,"active",n[2]===n[7].code)},i(d){b||(Gt(a.$$.fragment,d),b=!0)},o(d){Ut(a.$$.fragment,d),b=!1},d(d){d&&m(o),ee(a)}}}function pl(c){var ye,Fe,Le,Ae,Te,Pe;let n,o,a=c[0].name+"",p,b,d,h,C,x,_,f=c[0].name+"",et,kt,jt,S,Qt,D,ct,R,lt,le,U,j,se,dt,vt=c[0].name+"",st,yt,ne,ft,pt,nt,E,zt,Ft,T,ot,Lt,Jt,At,Q,it,Tt,Kt,Pt,L,ut,Rt,oe,mt,ie,H,Ot,at,St,O,bt,ae,z,Et,Vt,Nt,re,N,Wt,J,ht,ce,I,de,B,fe,P,qt,K,_t,pe,xt,ue,$,Mt,rt,Dt,me,Ht,Xt,V,wt,be,It,he,Ct,_e,G,W,Yt,q,gt,A=[],xe=new Map,X,Y,y=[],Bt=new Map,Z;S=new il({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${c[3]}');
...
// fetch a paginated records list
const resultList = await pb.collection('${(ye=c[0])==null?void 0:ye.name}').getList(1, 50, {
filter: 'created >= "2022-01-01 00:00:00" && someField1 != someField2',
});
// you can also fetch all records at once via getFullList
const records = await pb.collection('${(Fe=c[0])==null?void 0:Fe.name}').getFullList({
sort: '-created',
});
// or fetch only the first record that matches the specified filter
const record = await pb.collection('${(Le=c[0])==null?void 0:Le.name}').getFirstListItem('someField="test"', {
expand: 'relField1,relField2.subRelField',
});
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${c[3]}');
...
// fetch a paginated records list
final resultList = await pb.collection('${(Ae=c[0])==null?void 0:Ae.name}').getList(
page: 1,
perPage: 50,
filter: 'created >= "2022-01-01 00:00:00" && someField1 != someField2',
);
// you can also fetch all records at once via getFullList
final records = await pb.collection('${(Te=c[0])==null?void 0:Te.name}').getFullList(
sort: '-created',
);
// or fetch only the first record that matches the specified filter
final record = await pb.collection('${(Pe=c[0])==null?void 0:Pe.name}').getFirstListItem(
'someField="test"',
expand: 'relField1,relField2.subRelField',
);
`}});let v=c[1]&&je();at=new $e({props:{content:`
// DESC by created and ASC by id
?sort=-created,id
`}});let tt=c[4],k=[];for(let l=0;l<tt.length;l+=1)k[l]=Qe(Ue(c,tt,l));B=new $e({props:{content:`
?filter=(id='abc' && created>'2022-01-01')
`}}),P=new fl({}),rt=new $e({props:{content:"?expand=relField1,relField2.subRelField"}});let F=c[5];const $t=l=>l[7].code;for(let l=0;l<F.length;l+=1){let r=Ge(c,F,l),g=$t(r);xe.set(g,A[l]=ze(g,r))}let we=c[5];const ve=l=>l[7].code;for(let l=0;l<we.length;l+=1){let r=Be(c,we,l),g=ve(r);Bt.set(g,y[l]=Je(g,r))}return{c(){n=e("h3"),o=w("List/Search ("),p=w(a),b=w(")"),d=s(),h=e("div"),C=e("p"),x=w("Fetch a paginated "),_=e("strong"),et=w(f),kt=w(" records list, supporting sorting and filtering."),jt=s(),Zt(S.$$.fragment),Qt=s(),D=e("h6"),D.textContent="API details",ct=s(),R=e("div"),lt=e("strong"),lt.textContent="GET",le=s(),U=e("div"),j=e("p"),se=w("/api/collections/"),dt=e("strong"),st=w(vt),yt=w("/records"),ne=s(),v&&v.c(),ft=s(),pt=e("div"),pt.textContent="Query parameters",nt=s(),E=e("table"),zt=e("thead"),zt.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,Ft=s(),T=e("tbody"),ot=e("tr"),ot.innerHTML=`<td>page</td>
<td><span class="label">Number</span></td>
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,Lt=s(),Jt=e("tr"),Jt.innerHTML=`<td>perPage</td>
<td><span class="label">Number</span></td>
<td>Specify the max returned records per page (default to 30).</td>`,At=s(),Q=e("tr"),it=e("td"),it.textContent="sort",Tt=s(),Kt=e("td"),Kt.innerHTML='<span class="label">String</span>',Pt=s(),L=e("td"),ut=w("Specify the records order attribute(s). "),Rt=e("br"),oe=w(`
Add `),mt=e("code"),mt.textContent="-",ie=w(" / "),H=e("code"),H.textContent="+",Ot=w(` (default) in front of the attribute for DESC / ASC order.
Ex.:
`),Zt(at.$$.fragment),St=s(),O=e("p"),bt=e("strong"),bt.textContent="Supported record sort fields:",ae=s(),z=e("br"),Et=s(),Vt=e("code"),Vt.textContent="@random",Nt=w(`,
`);for(let l=0;l<k.length;l+=1)k[l].c();re=s(),N=e("tr"),Wt=e("td"),Wt.textContent="filter",J=s(),ht=e("td"),ht.innerHTML='<span class="label">String</span>',ce=s(),I=e("td"),de=w(`Filter the returned records. Ex.:
`),Zt(B.$$.fragment),fe=s(),Zt(P.$$.fragment),qt=s(),K=e("tr"),_t=e("td"),_t.textContent="expand",pe=s(),xt=e("td"),xt.innerHTML='<span class="label">String</span>',ue=s(),$=e("td"),Mt=w(`Auto expand record relations. Ex.:
`),Zt(rt.$$.fragment),Dt=w(`
Supports up to 6-levels depth nested relations expansion. `),me=e("br"),Ht=w(`
The expanded relations will be appended to each individual record under the
`),Xt=e("code"),Xt.textContent="expand",V=w(" property (eg. "),wt=e("code"),wt.textContent='"expand": {"relField1": {...}, ...}',be=w(`).
`),It=e("br"),he=w(`
Only the relations to which the request user has permissions to `),Ct=e("strong"),Ct.textContent="view",_e=w(" will be expanded."),G=s(),W=e("div"),W.textContent="Responses",Yt=s(),q=e("div"),gt=e("div");for(let l=0;l<A.length;l+=1)A[l].c();X=s(),Y=e("div");for(let l=0;l<y.length;l+=1)y[l].c();i(n,"class","m-b-sm"),i(h,"class","content txt-lg m-b-sm"),i(D,"class","m-b-xs"),i(lt,"class","label label-primary"),i(U,"class","content"),i(R,"class","alert alert-info"),i(pt,"class","section-title"),i(E,"class","table-compact table-border m-b-base"),i(W,"class","section-title"),i(gt,"class","tabs-header compact left"),i(Y,"class","tabs-content"),i(q,"class","tabs")},m(l,r){u(l,n,r),t(n,o),t(n,p),t(n,b),u(l,d,r),u(l,h,r),t(h,C),t(C,x),t(C,_),t(_,et),t(C,kt),u(l,jt,r),te(S,l,r),u(l,Qt,r),u(l,D,r),u(l,ct,r),u(l,R,r),t(R,lt),t(R,le),t(R,U),t(U,j),t(j,se),t(j,dt),t(dt,st),t(j,yt),t(R,ne),v&&v.m(R,null),u(l,ft,r),u(l,pt,r),u(l,nt,r),u(l,E,r),t(E,zt),t(E,Ft),t(E,T),t(T,ot),t(T,Lt),t(T,Jt),t(T,At),t(T,Q),t(Q,it),t(Q,Tt),t(Q,Kt),t(Q,Pt),t(Q,L),t(L,ut),t(L,Rt),t(L,oe),t(L,mt),t(L,ie),t(L,H),t(L,Ot),te(at,L,null),t(L,St),t(L,O),t(O,bt),t(O,ae),t(O,z),t(O,Et),t(O,Vt),t(O,Nt);for(let g=0;g<k.length;g+=1)k[g]&&k[g].m(O,null);t(T,re),t(T,N),t(N,Wt),t(N,J),t(N,ht),t(N,ce),t(N,I),t(I,de),te(B,I,null),t(I,fe),te(P,I,null),t(T,qt),t(T,K),t(K,_t),t(K,pe),t(K,xt),t(K,ue),t(K,$),t($,Mt),te(rt,$,null),t($,Dt),t($,me),t($,Ht),t($,Xt),t($,V),t($,wt),t($,be),t($,It),t($,he),t($,Ct),t($,_e),u(l,G,r),u(l,W,r),u(l,Yt,r),u(l,q,r),t(q,gt);for(let g=0;g<A.length;g+=1)A[g]&&A[g].m(gt,null);t(q,X),t(q,Y);for(let g=0;g<y.length;g+=1)y[g]&&y[g].m(Y,null);Z=!0},p(l,[r]){var Re,Oe,Se,Ee,Ne,qe;(!Z||r&1)&&a!==(a=l[0].name+"")&&Ce(p,a),(!Z||r&1)&&f!==(f=l[0].name+"")&&Ce(et,f);const g={};if(r&9&&(g.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${l[3]}');
...
// fetch a paginated records list
const resultList = await pb.collection('${(Re=l[0])==null?void 0:Re.name}').getList(1, 50, {
filter: 'created >= "2022-01-01 00:00:00" && someField1 != someField2',
});
// you can also fetch all records at once via getFullList
const records = await pb.collection('${(Oe=l[0])==null?void 0:Oe.name}').getFullList({
sort: '-created',
});
// or fetch only the first record that matches the specified filter
const record = await pb.collection('${(Se=l[0])==null?void 0:Se.name}').getFirstListItem('someField="test"', {
expand: 'relField1,relField2.subRelField',
});
`),r&9&&(g.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${l[3]}');
...
// fetch a paginated records list
final resultList = await pb.collection('${(Ee=l[0])==null?void 0:Ee.name}').getList(
page: 1,
perPage: 50,
filter: 'created >= "2022-01-01 00:00:00" && someField1 != someField2',
);
// you can also fetch all records at once via getFullList
final records = await pb.collection('${(Ne=l[0])==null?void 0:Ne.name}').getFullList(
sort: '-created',
);
// or fetch only the first record that matches the specified filter
final record = await pb.collection('${(qe=l[0])==null?void 0:qe.name}').getFirstListItem(
'someField="test"',
expand: 'relField1,relField2.subRelField',
);
`),S.$set(g),(!Z||r&1)&&vt!==(vt=l[0].name+"")&&Ce(st,vt),l[1]?v||(v=je(),v.c(),v.m(R,null)):v&&(v.d(1),v=null),r&16){tt=l[4];let M;for(M=0;M<tt.length;M+=1){const Me=Ue(l,tt,M);k[M]?k[M].p(Me,r):(k[M]=Qe(Me),k[M].c(),k[M].m(O,null))}for(;M<k.length;M+=1)k[M].d(1);k.length=tt.length}r&36&&(F=l[5],A=He(A,r,$t,1,l,F,xe,gt,Ze,ze,null,Ge)),r&36&&(we=l[5],tl(),y=He(y,r,ve,1,l,we,Bt,Y,el,Je,null,Be),ll())},i(l){if(!Z){Gt(S.$$.fragment,l),Gt(at.$$.fragment,l),Gt(B.$$.fragment,l),Gt(P.$$.fragment,l),Gt(rt.$$.fragment,l);for(let r=0;r<we.length;r+=1)Gt(y[r]);Z=!0}},o(l){Ut(S.$$.fragment,l),Ut(at.$$.fragment,l),Ut(B.$$.fragment,l),Ut(P.$$.fragment,l),Ut(rt.$$.fragment,l);for(let r=0;r<y.length;r+=1)Ut(y[r]);Z=!1},d(l){l&&m(n),l&&m(d),l&&m(h),l&&m(jt),ee(S,l),l&&m(Qt),l&&m(D),l&&m(ct),l&&m(R),v&&v.d(),l&&m(ft),l&&m(pt),l&&m(nt),l&&m(E),ee(at),sl(k,l),ee(B),ee(P),ee(rt),l&&m(G),l&&m(W),l&&m(Yt),l&&m(q);for(let r=0;r<A.length;r+=1)A[r].d();for(let r=0;r<y.length;r+=1)y[r].d()}}}function ul(c,n,o){let a,p,b,{collection:d=new nl}=n,h=200,C=[];const x=_=>o(2,h=_.code);return c.$$set=_=>{"collection"in _&&o(0,d=_.collection)},c.$$.update=()=>{c.$$.dirty&1&&o(4,a=ge.getAllCollectionIdentifiers(d)),c.$$.dirty&1&&o(1,p=(d==null?void 0:d.listRule)===null),c.$$.dirty&3&&d!=null&&d.id&&(C.push({code:200,body:JSON.stringify({page:1,perPage:30,totalPages:1,totalItems:2,items:[ge.dummyCollectionRecord(d),ge.dummyCollectionRecord(d)]},null,2)}),C.push({code:400,body:`
{
"code": 400,
"message": "Something went wrong while processing your request. Invalid filter.",
"data": {}
}
`}),p&&C.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}))},o(3,b=ge.getApiExampleUrl(ol.baseUrl)),[d,p,h,b,a,C,x]}class hl extends Ke{constructor(n){super(),Ve(this,n,ul,pl,We,{collection:0})}}export{hl as default};

138
ui/dist/assets/ListApiDocs-69c941e3.js vendored Normal file
View File

@ -0,0 +1,138 @@
import{S as We,i as Xe,s as Ye,e,b as s,E as tl,f as i,g as u,u as Ze,y as Ie,o as m,w,h as t,M as ke,c as Zt,m as te,x as ge,N as Be,P as el,k as ll,Q as sl,n as nl,t as Bt,a as Gt,d as ee,R as ol,T as il,C as $e,p as al,r as ye}from"./index-055843b5.js";import{S as rl}from"./SdkTabs-1c685373.js";function cl(c){let n,o,a;return{c(){n=e("span"),n.textContent="Show details",o=s(),a=e("i"),i(n,"class","txt"),i(a,"class","ri-arrow-down-s-line")},m(p,b){u(p,n,b),u(p,o,b),u(p,a,b)},d(p){p&&m(n),p&&m(o),p&&m(a)}}}function dl(c){let n,o,a;return{c(){n=e("span"),n.textContent="Hide details",o=s(),a=e("i"),i(n,"class","txt"),i(a,"class","ri-arrow-up-s-line")},m(p,b){u(p,n,b),u(p,o,b),u(p,a,b)},d(p){p&&m(n),p&&m(o),p&&m(a)}}}function Ge(c){let n,o,a,p,b,d,h,g,x,_,f,Z,Ct,Ut,O,jt,H,at,R,tt,le,U,j,se,rt,$t,et,kt,ne,ct,dt,lt,E,Jt,yt,L,st,vt,Qt,Ft,J,nt,Lt,zt,At,T,ft,Tt,oe,pt,ie,D,Pt,ot,Rt,S,ut,ae,Q,St,Kt,Ot,re,N,Vt,z,mt,ce,I,de,B,fe,P,Et,K,bt,pe,ht,ue,$,Nt,it,qt,me,Mt,Wt,V,_t,be,Ht,he,xt,_e,W,wt,Xt,X,Yt,q,gt,y,Dt,xe,Y,A,It,G,v;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format
<code><span class="txt-success">OPERAND</span>
<span class="txt-danger">OPERATOR</span>
<span class="txt-success">OPERAND</span></code>, where:`,o=s(),a=e("ul"),p=e("li"),p.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single
or double quoted), number, null, true, false`,b=s(),d=e("li"),h=e("code"),h.textContent="OPERATOR",g=w(` - is one of:
`),x=e("br"),_=s(),f=e("ul"),Z=e("li"),Ct=e("code"),Ct.textContent="=",Ut=s(),O=e("span"),O.textContent="Equal",jt=s(),H=e("li"),at=e("code"),at.textContent="!=",R=s(),tt=e("span"),tt.textContent="NOT equal",le=s(),U=e("li"),j=e("code"),j.textContent=">",se=s(),rt=e("span"),rt.textContent="Greater than",$t=s(),et=e("li"),kt=e("code"),kt.textContent=">=",ne=s(),ct=e("span"),ct.textContent="Greater than or equal",dt=s(),lt=e("li"),E=e("code"),E.textContent="<",Jt=s(),yt=e("span"),yt.textContent="Less than",L=s(),st=e("li"),vt=e("code"),vt.textContent="<=",Qt=s(),Ft=e("span"),Ft.textContent="Less than or equal",J=s(),nt=e("li"),Lt=e("code"),Lt.textContent="~",zt=s(),At=e("span"),At.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,T=s(),ft=e("li"),Tt=e("code"),Tt.textContent="!~",oe=s(),pt=e("span"),pt.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,ie=s(),D=e("li"),Pt=e("code"),Pt.textContent="?=",ot=s(),Rt=e("em"),Rt.textContent="Any/At least one of",S=s(),ut=e("span"),ut.textContent="Equal",ae=s(),Q=e("li"),St=e("code"),St.textContent="?!=",Kt=s(),Ot=e("em"),Ot.textContent="Any/At least one of",re=s(),N=e("span"),N.textContent="NOT equal",Vt=s(),z=e("li"),mt=e("code"),mt.textContent="?>",ce=s(),I=e("em"),I.textContent="Any/At least one of",de=s(),B=e("span"),B.textContent="Greater than",fe=s(),P=e("li"),Et=e("code"),Et.textContent="?>=",K=s(),bt=e("em"),bt.textContent="Any/At least one of",pe=s(),ht=e("span"),ht.textContent="Greater than or equal",ue=s(),$=e("li"),Nt=e("code"),Nt.textContent="?<",it=s(),qt=e("em"),qt.textContent="Any/At least one of",me=s(),Mt=e("span"),Mt.textContent="Less than",Wt=s(),V=e("li"),_t=e("code"),_t.textContent="?<=",be=s(),Ht=e("em"),Ht.textContent="Any/At least one of",he=s(),xt=e("span"),xt.textContent="Less than or equal",_e=s(),W=e("li"),wt=e("code"),wt.textContent="?~",Xt=s(),X=e("em"),X.textContent="Any/At least one of",Yt=s(),q=e("span"),q.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,gt=s(),y=e("li"),Dt=e("code"),Dt.textContent="?!~",xe=s(),Y=e("em"),Y.textContent="Any/At least one of",A=s(),It=e("span"),It.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,G=s(),v=e("p"),v.innerHTML=`To group and combine several expressions you could use brackets
<code>(...)</code>, <code>&amp;&amp;</code> (AND) and <code>||</code> (OR) tokens.`,i(h,"class","txt-danger"),i(Ct,"class","filter-op svelte-1w7s5nw"),i(O,"class","txt"),i(at,"class","filter-op svelte-1w7s5nw"),i(tt,"class","txt"),i(j,"class","filter-op svelte-1w7s5nw"),i(rt,"class","txt"),i(kt,"class","filter-op svelte-1w7s5nw"),i(ct,"class","txt"),i(E,"class","filter-op svelte-1w7s5nw"),i(yt,"class","txt"),i(vt,"class","filter-op svelte-1w7s5nw"),i(Ft,"class","txt"),i(Lt,"class","filter-op svelte-1w7s5nw"),i(At,"class","txt"),i(Tt,"class","filter-op svelte-1w7s5nw"),i(pt,"class","txt"),i(Pt,"class","filter-op svelte-1w7s5nw"),i(Rt,"class","txt-hint"),i(ut,"class","txt"),i(St,"class","filter-op svelte-1w7s5nw"),i(Ot,"class","txt-hint"),i(N,"class","txt"),i(mt,"class","filter-op svelte-1w7s5nw"),i(I,"class","txt-hint"),i(B,"class","txt"),i(Et,"class","filter-op svelte-1w7s5nw"),i(bt,"class","txt-hint"),i(ht,"class","txt"),i(Nt,"class","filter-op svelte-1w7s5nw"),i(qt,"class","txt-hint"),i(Mt,"class","txt"),i(_t,"class","filter-op svelte-1w7s5nw"),i(Ht,"class","txt-hint"),i(xt,"class","txt"),i(wt,"class","filter-op svelte-1w7s5nw"),i(X,"class","txt-hint"),i(q,"class","txt"),i(Dt,"class","filter-op svelte-1w7s5nw"),i(Y,"class","txt-hint"),i(It,"class","txt")},m(F,k){u(F,n,k),u(F,o,k),u(F,a,k),t(a,p),t(a,b),t(a,d),t(d,h),t(d,g),t(d,x),t(d,_),t(d,f),t(f,Z),t(Z,Ct),t(Z,Ut),t(Z,O),t(f,jt),t(f,H),t(H,at),t(H,R),t(H,tt),t(f,le),t(f,U),t(U,j),t(U,se),t(U,rt),t(f,$t),t(f,et),t(et,kt),t(et,ne),t(et,ct),t(f,dt),t(f,lt),t(lt,E),t(lt,Jt),t(lt,yt),t(f,L),t(f,st),t(st,vt),t(st,Qt),t(st,Ft),t(f,J),t(f,nt),t(nt,Lt),t(nt,zt),t(nt,At),t(f,T),t(f,ft),t(ft,Tt),t(ft,oe),t(ft,pt),t(f,ie),t(f,D),t(D,Pt),t(D,ot),t(D,Rt),t(D,S),t(D,ut),t(f,ae),t(f,Q),t(Q,St),t(Q,Kt),t(Q,Ot),t(Q,re),t(Q,N),t(f,Vt),t(f,z),t(z,mt),t(z,ce),t(z,I),t(z,de),t(z,B),t(f,fe),t(f,P),t(P,Et),t(P,K),t(P,bt),t(P,pe),t(P,ht),t(f,ue),t(f,$),t($,Nt),t($,it),t($,qt),t($,me),t($,Mt),t(f,Wt),t(f,V),t(V,_t),t(V,be),t(V,Ht),t(V,he),t(V,xt),t(f,_e),t(f,W),t(W,wt),t(W,Xt),t(W,X),t(W,Yt),t(W,q),t(f,gt),t(f,y),t(y,Dt),t(y,xe),t(y,Y),t(y,A),t(y,It),u(F,G,k),u(F,v,k)},d(F){F&&m(n),F&&m(o),F&&m(a),F&&m(G),F&&m(v)}}}function fl(c){let n,o,a,p,b;function d(_,f){return _[0]?dl:cl}let h=d(c),g=h(c),x=c[0]&&Ge();return{c(){n=e("button"),g.c(),o=s(),x&&x.c(),a=tl(),i(n,"class","btn btn-sm btn-secondary m-t-10")},m(_,f){u(_,n,f),g.m(n,null),u(_,o,f),x&&x.m(_,f),u(_,a,f),p||(b=Ze(n,"click",c[1]),p=!0)},p(_,[f]){h!==(h=d(_))&&(g.d(1),g=h(_),g&&(g.c(),g.m(n,null))),_[0]?x||(x=Ge(),x.c(),x.m(a.parentNode,a)):x&&(x.d(1),x=null)},i:Ie,o:Ie,d(_){_&&m(n),g.d(),_&&m(o),x&&x.d(_),_&&m(a),p=!1,b()}}}function pl(c,n,o){let a=!1;function p(){o(0,a=!a)}return[a,p]}class ul extends We{constructor(n){super(),Xe(this,n,pl,fl,Ye,{})}}function Ue(c,n,o){const a=c.slice();return a[7]=n[o],a}function je(c,n,o){const a=c.slice();return a[7]=n[o],a}function Je(c,n,o){const a=c.slice();return a[12]=n[o],a[14]=o,a}function Qe(c){let n;return{c(){n=e("p"),n.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",i(n,"class","txt-hint txt-sm txt-right")},m(o,a){u(o,n,a)},d(o){o&&m(n)}}}function ze(c){let n,o=c[12]+"",a,p=c[14]<c[4].length-1?", ":"",b;return{c(){n=e("code"),a=w(o),b=w(p)},m(d,h){u(d,n,h),t(n,a),u(d,b,h)},p(d,h){h&16&&o!==(o=d[12]+"")&&ge(a,o),h&16&&p!==(p=d[14]<d[4].length-1?", ":"")&&ge(b,p)},d(d){d&&m(n),d&&m(b)}}}function Ke(c,n){let o,a=n[7].code+"",p,b,d,h;function g(){return n[6](n[7])}return{key:c,first:null,c(){o=e("button"),p=w(a),b=s(),i(o,"type","button"),i(o,"class","tab-item"),ye(o,"active",n[2]===n[7].code),this.first=o},m(x,_){u(x,o,_),t(o,p),t(o,b),d||(h=Ze(o,"click",g),d=!0)},p(x,_){n=x,_&36&&ye(o,"active",n[2]===n[7].code)},d(x){x&&m(o),d=!1,h()}}}function Ve(c,n){let o,a,p,b;return a=new ke({props:{content:n[7].body}}),{key:c,first:null,c(){o=e("div"),Zt(a.$$.fragment),p=s(),i(o,"class","tab-item"),ye(o,"active",n[2]===n[7].code),this.first=o},m(d,h){u(d,o,h),te(a,o,null),t(o,p),b=!0},p(d,h){n=d,(!b||h&36)&&ye(o,"active",n[2]===n[7].code)},i(d){b||(Bt(a.$$.fragment,d),b=!0)},o(d){Gt(a.$$.fragment,d),b=!1},d(d){d&&m(o),ee(a)}}}function ml(c){var Le,Ae,Te,Pe,Re,Se;let n,o,a=c[0].name+"",p,b,d,h,g,x,_,f=c[0].name+"",Z,Ct,Ut,O,jt,H,at,R,tt,le,U,j,se,rt,$t=c[0].name+"",et,kt,ne,ct,dt,lt,E,Jt,yt,L,st,vt,Qt,Ft,J,nt,Lt,zt,At,T,ft,Tt,oe,pt,ie,D,Pt,ot,Rt,S,ut,ae,Q,St,Kt,Ot,re,N,Vt,z,mt,ce,I,de,B,fe,P,Et,K,bt,pe,ht,ue,$,Nt,it,qt,me,Mt,Wt,V,_t,be,Ht,he,xt,_e,W,wt,Xt,X,Yt,q,gt,y=[],Dt=new Map,xe,Y,A=[],It=new Map,G;O=new rl({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${c[3]}');
...
// fetch a paginated records list
const resultList = await pb.collection('${(Le=c[0])==null?void 0:Le.name}').getList(1, 50, {
filter: 'created >= "2022-01-01 00:00:00" && someField1 != someField2',
});
// you can also fetch all records at once via getFullList
const records = await pb.collection('${(Ae=c[0])==null?void 0:Ae.name}').getFullList({
sort: '-created',
});
// or fetch only the first record that matches the specified filter
const record = await pb.collection('${(Te=c[0])==null?void 0:Te.name}').getFirstListItem('someField="test"', {
expand: 'relField1,relField2.subRelField',
});
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${c[3]}');
...
// fetch a paginated records list
final resultList = await pb.collection('${(Pe=c[0])==null?void 0:Pe.name}').getList(
page: 1,
perPage: 50,
filter: 'created >= "2022-01-01 00:00:00" && someField1 != someField2',
);
// you can also fetch all records at once via getFullList
final records = await pb.collection('${(Re=c[0])==null?void 0:Re.name}').getFullList(
sort: '-created',
);
// or fetch only the first record that matches the specified filter
final record = await pb.collection('${(Se=c[0])==null?void 0:Se.name}').getFirstListItem(
'someField="test"',
expand: 'relField1,relField2.subRelField',
);
`}});let v=c[1]&&Qe();ot=new ke({props:{content:`
// DESC by created and ASC by id
?sort=-created,id
`}});let F=c[4],k=[];for(let l=0;l<F.length;l+=1)k[l]=ze(Je(c,F,l));B=new ke({props:{content:`
?filter=(id='abc' && created>'2022-01-01')
`}}),P=new ul({}),it=new ke({props:{content:"?expand=relField1,relField2.subRelField"}});let Ce=c[5];const ve=l=>l[7].code;for(let l=0;l<Ce.length;l+=1){let r=je(c,Ce,l),C=ve(r);Dt.set(C,y[l]=Ke(C,r))}let we=c[5];const Fe=l=>l[7].code;for(let l=0;l<we.length;l+=1){let r=Ue(c,we,l),C=Fe(r);It.set(C,A[l]=Ve(C,r))}return{c(){n=e("h3"),o=w("List/Search ("),p=w(a),b=w(")"),d=s(),h=e("div"),g=e("p"),x=w("Fetch a paginated "),_=e("strong"),Z=w(f),Ct=w(" records list, supporting sorting and filtering."),Ut=s(),Zt(O.$$.fragment),jt=s(),H=e("h6"),H.textContent="API details",at=s(),R=e("div"),tt=e("strong"),tt.textContent="GET",le=s(),U=e("div"),j=e("p"),se=w("/api/collections/"),rt=e("strong"),et=w($t),kt=w("/records"),ne=s(),v&&v.c(),ct=s(),dt=e("div"),dt.textContent="Query parameters",lt=s(),E=e("table"),Jt=e("thead"),Jt.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,yt=s(),L=e("tbody"),st=e("tr"),st.innerHTML=`<td>page</td>
<td><span class="label">Number</span></td>
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,vt=s(),Qt=e("tr"),Qt.innerHTML=`<td>perPage</td>
<td><span class="label">Number</span></td>
<td>Specify the max returned records per page (default to 30).</td>`,Ft=s(),J=e("tr"),nt=e("td"),nt.textContent="sort",Lt=s(),zt=e("td"),zt.innerHTML='<span class="label">String</span>',At=s(),T=e("td"),ft=w("Specify the records order attribute(s). "),Tt=e("br"),oe=w(`
Add `),pt=e("code"),pt.textContent="-",ie=w(" / "),D=e("code"),D.textContent="+",Pt=w(` (default) in front of the attribute for DESC / ASC order.
Ex.:
`),Zt(ot.$$.fragment),Rt=s(),S=e("p"),ut=e("strong"),ut.textContent="Supported record sort fields:",ae=s(),Q=e("br"),St=s(),Kt=e("code"),Kt.textContent="@random",Ot=w(`,
`);for(let l=0;l<k.length;l+=1)k[l].c();re=s(),N=e("tr"),Vt=e("td"),Vt.textContent="filter",z=s(),mt=e("td"),mt.innerHTML='<span class="label">String</span>',ce=s(),I=e("td"),de=w(`Filter the returned records. Ex.:
`),Zt(B.$$.fragment),fe=s(),Zt(P.$$.fragment),Et=s(),K=e("tr"),bt=e("td"),bt.textContent="expand",pe=s(),ht=e("td"),ht.innerHTML='<span class="label">String</span>',ue=s(),$=e("td"),Nt=w(`Auto expand record relations. Ex.:
`),Zt(it.$$.fragment),qt=w(`
Supports up to 6-levels depth nested relations expansion. `),me=e("br"),Mt=w(`
The expanded relations will be appended to each individual record under the
`),Wt=e("code"),Wt.textContent="expand",V=w(" property (eg. "),_t=e("code"),_t.textContent='"expand": {"relField1": {...}, ...}',be=w(`).
`),Ht=e("br"),he=w(`
Only the relations to which the request user has permissions to `),xt=e("strong"),xt.textContent="view",_e=w(" will be expanded."),W=s(),wt=e("tr"),wt.innerHTML=`<td id="query-page">fields</td>
<td><span class="label">String</span></td>
<td>Comma separated string of the fields to return in the JSON response
<em>(by default returns all fields)</em>.</td>`,Xt=s(),X=e("div"),X.textContent="Responses",Yt=s(),q=e("div"),gt=e("div");for(let l=0;l<y.length;l+=1)y[l].c();xe=s(),Y=e("div");for(let l=0;l<A.length;l+=1)A[l].c();i(n,"class","m-b-sm"),i(h,"class","content txt-lg m-b-sm"),i(H,"class","m-b-xs"),i(tt,"class","label label-primary"),i(U,"class","content"),i(R,"class","alert alert-info"),i(dt,"class","section-title"),i(E,"class","table-compact table-border m-b-base"),i(X,"class","section-title"),i(gt,"class","tabs-header compact left"),i(Y,"class","tabs-content"),i(q,"class","tabs")},m(l,r){u(l,n,r),t(n,o),t(n,p),t(n,b),u(l,d,r),u(l,h,r),t(h,g),t(g,x),t(g,_),t(_,Z),t(g,Ct),u(l,Ut,r),te(O,l,r),u(l,jt,r),u(l,H,r),u(l,at,r),u(l,R,r),t(R,tt),t(R,le),t(R,U),t(U,j),t(j,se),t(j,rt),t(rt,et),t(j,kt),t(R,ne),v&&v.m(R,null),u(l,ct,r),u(l,dt,r),u(l,lt,r),u(l,E,r),t(E,Jt),t(E,yt),t(E,L),t(L,st),t(L,vt),t(L,Qt),t(L,Ft),t(L,J),t(J,nt),t(J,Lt),t(J,zt),t(J,At),t(J,T),t(T,ft),t(T,Tt),t(T,oe),t(T,pt),t(T,ie),t(T,D),t(T,Pt),te(ot,T,null),t(T,Rt),t(T,S),t(S,ut),t(S,ae),t(S,Q),t(S,St),t(S,Kt),t(S,Ot);for(let C=0;C<k.length;C+=1)k[C]&&k[C].m(S,null);t(L,re),t(L,N),t(N,Vt),t(N,z),t(N,mt),t(N,ce),t(N,I),t(I,de),te(B,I,null),t(I,fe),te(P,I,null),t(L,Et),t(L,K),t(K,bt),t(K,pe),t(K,ht),t(K,ue),t(K,$),t($,Nt),te(it,$,null),t($,qt),t($,me),t($,Mt),t($,Wt),t($,V),t($,_t),t($,be),t($,Ht),t($,he),t($,xt),t($,_e),t(L,W),t(L,wt),u(l,Xt,r),u(l,X,r),u(l,Yt,r),u(l,q,r),t(q,gt);for(let C=0;C<y.length;C+=1)y[C]&&y[C].m(gt,null);t(q,xe),t(q,Y);for(let C=0;C<A.length;C+=1)A[C]&&A[C].m(Y,null);G=!0},p(l,[r]){var Oe,Ee,Ne,qe,Me,He;(!G||r&1)&&a!==(a=l[0].name+"")&&ge(p,a),(!G||r&1)&&f!==(f=l[0].name+"")&&ge(Z,f);const C={};if(r&9&&(C.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${l[3]}');
...
// fetch a paginated records list
const resultList = await pb.collection('${(Oe=l[0])==null?void 0:Oe.name}').getList(1, 50, {
filter: 'created >= "2022-01-01 00:00:00" && someField1 != someField2',
});
// you can also fetch all records at once via getFullList
const records = await pb.collection('${(Ee=l[0])==null?void 0:Ee.name}').getFullList({
sort: '-created',
});
// or fetch only the first record that matches the specified filter
const record = await pb.collection('${(Ne=l[0])==null?void 0:Ne.name}').getFirstListItem('someField="test"', {
expand: 'relField1,relField2.subRelField',
});
`),r&9&&(C.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${l[3]}');
...
// fetch a paginated records list
final resultList = await pb.collection('${(qe=l[0])==null?void 0:qe.name}').getList(
page: 1,
perPage: 50,
filter: 'created >= "2022-01-01 00:00:00" && someField1 != someField2',
);
// you can also fetch all records at once via getFullList
final records = await pb.collection('${(Me=l[0])==null?void 0:Me.name}').getFullList(
sort: '-created',
);
// or fetch only the first record that matches the specified filter
final record = await pb.collection('${(He=l[0])==null?void 0:He.name}').getFirstListItem(
'someField="test"',
expand: 'relField1,relField2.subRelField',
);
`),O.$set(C),(!G||r&1)&&$t!==($t=l[0].name+"")&&ge(et,$t),l[1]?v||(v=Qe(),v.c(),v.m(R,null)):v&&(v.d(1),v=null),r&16){F=l[4];let M;for(M=0;M<F.length;M+=1){const De=Je(l,F,M);k[M]?k[M].p(De,r):(k[M]=ze(De),k[M].c(),k[M].m(S,null))}for(;M<k.length;M+=1)k[M].d(1);k.length=F.length}r&36&&(Ce=l[5],y=Be(y,r,ve,1,l,Ce,Dt,gt,el,Ke,null,je)),r&36&&(we=l[5],ll(),A=Be(A,r,Fe,1,l,we,It,Y,sl,Ve,null,Ue),nl())},i(l){if(!G){Bt(O.$$.fragment,l),Bt(ot.$$.fragment,l),Bt(B.$$.fragment,l),Bt(P.$$.fragment,l),Bt(it.$$.fragment,l);for(let r=0;r<we.length;r+=1)Bt(A[r]);G=!0}},o(l){Gt(O.$$.fragment,l),Gt(ot.$$.fragment,l),Gt(B.$$.fragment,l),Gt(P.$$.fragment,l),Gt(it.$$.fragment,l);for(let r=0;r<A.length;r+=1)Gt(A[r]);G=!1},d(l){l&&m(n),l&&m(d),l&&m(h),l&&m(Ut),ee(O,l),l&&m(jt),l&&m(H),l&&m(at),l&&m(R),v&&v.d(),l&&m(ct),l&&m(dt),l&&m(lt),l&&m(E),ee(ot),ol(k,l),ee(B),ee(P),ee(it),l&&m(Xt),l&&m(X),l&&m(Yt),l&&m(q);for(let r=0;r<y.length;r+=1)y[r].d();for(let r=0;r<A.length;r+=1)A[r].d()}}}function bl(c,n,o){let a,p,b,{collection:d=new il}=n,h=200,g=[];const x=_=>o(2,h=_.code);return c.$$set=_=>{"collection"in _&&o(0,d=_.collection)},c.$$.update=()=>{c.$$.dirty&1&&o(4,a=$e.getAllCollectionIdentifiers(d)),c.$$.dirty&1&&o(1,p=(d==null?void 0:d.listRule)===null),c.$$.dirty&3&&d!=null&&d.id&&(g.push({code:200,body:JSON.stringify({page:1,perPage:30,totalPages:1,totalItems:2,items:[$e.dummyCollectionRecord(d),$e.dummyCollectionRecord(d)]},null,2)}),g.push({code:400,body:`
{
"code": 400,
"message": "Something went wrong while processing your request. Invalid filter.",
"data": {}
}
`}),p&&g.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}))},o(3,b=$e.getApiExampleUrl(al.baseUrl)),[d,p,h,b,a,g,x]}class xl extends We{constructor(n){super(),Xe(this,n,bl,ml,Ye,{collection:0})}}export{xl as default};

View File

@ -0,0 +1,95 @@
import{S as ze,i as Qe,s as Re,e as n,w as v,b as f,c as de,f as m,g as r,h as o,m as pe,x as F,N as Le,P as Ue,k as je,Q as Fe,n as Ne,t as N,a as G,o as c,d as ue,T as Ge,C as Ke,p as Je,r as K,u as Ve,M as Xe}from"./index-055843b5.js";import{S as Ye}from"./SdkTabs-1c685373.js";import{F as Ze}from"./FieldsQueryParam-815b0ee8.js";function De(a,l,s){const i=a.slice();return i[5]=l[s],i}function He(a,l,s){const i=a.slice();return i[5]=l[s],i}function Oe(a,l){let s,i=l[5].code+"",b,_,d,u;function h(){return l[4](l[5])}return{key:a,first:null,c(){s=n("button"),b=v(i),_=f(),m(s,"class","tab-item"),K(s,"active",l[1]===l[5].code),this.first=s},m(y,P){r(y,s,P),o(s,b),o(s,_),d||(u=Ve(s,"click",h),d=!0)},p(y,P){l=y,P&4&&i!==(i=l[5].code+"")&&F(b,i),P&6&&K(s,"active",l[1]===l[5].code)},d(y){y&&c(s),d=!1,u()}}}function We(a,l){let s,i,b,_;return i=new Xe({props:{content:l[5].body}}),{key:a,first:null,c(){s=n("div"),de(i.$$.fragment),b=f(),m(s,"class","tab-item"),K(s,"active",l[1]===l[5].code),this.first=s},m(d,u){r(d,s,u),pe(i,s,null),o(s,b),_=!0},p(d,u){l=d;const h={};u&4&&(h.content=l[5].body),i.$set(h),(!_||u&6)&&K(s,"active",l[1]===l[5].code)},i(d){_||(N(i.$$.fragment,d),_=!0)},o(d){G(i.$$.fragment,d),_=!1},d(d){d&&c(s),ue(i)}}}function xe(a){var Ce,ge,Se,Ee;let l,s,i=a[0].name+"",b,_,d,u,h,y,P,W=a[0].name+"",J,fe,me,V,X,T,Y,I,Z,$,z,be,Q,A,he,x,R=a[0].name+"",ee,_e,te,ke,ve,U,le,B,se,q,oe,M,ae,C,ie,we,ne,E,re,L,ce,g,D,w=[],$e=new Map,ye,H,k=[],Pe=new Map,S;T=new Ye({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${a[3]}');
...
await pb.collection('${(Ce=a[0])==null?void 0:Ce.name}').authWithPassword('test@example.com', '123456');
const result = await pb.collection('${(ge=a[0])==null?void 0:ge.name}').listExternalAuths(
pb.authStore.model.id
);
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${a[3]}');
...
await pb.collection('${(Se=a[0])==null?void 0:Se.name}').authWithPassword('test@example.com', '123456');
final result = await pb.collection('${(Ee=a[0])==null?void 0:Ee.name}').listExternalAuths(
pb.authStore.model.id,
);
`}}),E=new Ze({});let j=a[2];const Te=e=>e[5].code;for(let e=0;e<j.length;e+=1){let t=He(a,j,e),p=Te(t);$e.set(p,w[e]=Oe(p,t))}let O=a[2];const Ae=e=>e[5].code;for(let e=0;e<O.length;e+=1){let t=De(a,O,e),p=Ae(t);Pe.set(p,k[e]=We(p,t))}return{c(){l=n("h3"),s=v("List OAuth2 accounts ("),b=v(i),_=v(")"),d=f(),u=n("div"),h=n("p"),y=v("Returns a list with all OAuth2 providers linked to a single "),P=n("strong"),J=v(W),fe=v("."),me=f(),V=n("p"),V.textContent="Only admins and the account owner can access this action.",X=f(),de(T.$$.fragment),Y=f(),I=n("h6"),I.textContent="API details",Z=f(),$=n("div"),z=n("strong"),z.textContent="GET",be=f(),Q=n("div"),A=n("p"),he=v("/api/collections/"),x=n("strong"),ee=v(R),_e=v("/records/"),te=n("strong"),te.textContent=":id",ke=v("/external-auths"),ve=f(),U=n("p"),U.innerHTML="Requires <code>Authorization:TOKEN</code> header",le=f(),B=n("div"),B.textContent="Path Parameters",se=f(),q=n("table"),q.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the auth record.</td></tr></tbody>`,oe=f(),M=n("div"),M.textContent="Query parameters",ae=f(),C=n("table"),ie=n("thead"),ie.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,we=f(),ne=n("tbody"),de(E.$$.fragment),re=f(),L=n("div"),L.textContent="Responses",ce=f(),g=n("div"),D=n("div");for(let e=0;e<w.length;e+=1)w[e].c();ye=f(),H=n("div");for(let e=0;e<k.length;e+=1)k[e].c();m(l,"class","m-b-sm"),m(u,"class","content txt-lg m-b-sm"),m(I,"class","m-b-xs"),m(z,"class","label label-primary"),m(Q,"class","content"),m(U,"class","txt-hint txt-sm txt-right"),m($,"class","alert alert-info"),m(B,"class","section-title"),m(q,"class","table-compact table-border m-b-base"),m(M,"class","section-title"),m(C,"class","table-compact table-border m-b-base"),m(L,"class","section-title"),m(D,"class","tabs-header compact left"),m(H,"class","tabs-content"),m(g,"class","tabs")},m(e,t){r(e,l,t),o(l,s),o(l,b),o(l,_),r(e,d,t),r(e,u,t),o(u,h),o(h,y),o(h,P),o(P,J),o(h,fe),o(u,me),o(u,V),r(e,X,t),pe(T,e,t),r(e,Y,t),r(e,I,t),r(e,Z,t),r(e,$,t),o($,z),o($,be),o($,Q),o(Q,A),o(A,he),o(A,x),o(x,ee),o(A,_e),o(A,te),o(A,ke),o($,ve),o($,U),r(e,le,t),r(e,B,t),r(e,se,t),r(e,q,t),r(e,oe,t),r(e,M,t),r(e,ae,t),r(e,C,t),o(C,ie),o(C,we),o(C,ne),pe(E,ne,null),r(e,re,t),r(e,L,t),r(e,ce,t),r(e,g,t),o(g,D);for(let p=0;p<w.length;p+=1)w[p]&&w[p].m(D,null);o(g,ye),o(g,H);for(let p=0;p<k.length;p+=1)k[p]&&k[p].m(H,null);S=!0},p(e,[t]){var Ie,Be,qe,Me;(!S||t&1)&&i!==(i=e[0].name+"")&&F(b,i),(!S||t&1)&&W!==(W=e[0].name+"")&&F(J,W);const p={};t&9&&(p.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
...
await pb.collection('${(Ie=e[0])==null?void 0:Ie.name}').authWithPassword('test@example.com', '123456');
const result = await pb.collection('${(Be=e[0])==null?void 0:Be.name}').listExternalAuths(
pb.authStore.model.id
);
`),t&9&&(p.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
...
await pb.collection('${(qe=e[0])==null?void 0:qe.name}').authWithPassword('test@example.com', '123456');
final result = await pb.collection('${(Me=e[0])==null?void 0:Me.name}').listExternalAuths(
pb.authStore.model.id,
);
`),T.$set(p),(!S||t&1)&&R!==(R=e[0].name+"")&&F(ee,R),t&6&&(j=e[2],w=Le(w,t,Te,1,e,j,$e,D,Ue,Oe,null,He)),t&6&&(O=e[2],je(),k=Le(k,t,Ae,1,e,O,Pe,H,Fe,We,null,De),Ne())},i(e){if(!S){N(T.$$.fragment,e),N(E.$$.fragment,e);for(let t=0;t<O.length;t+=1)N(k[t]);S=!0}},o(e){G(T.$$.fragment,e),G(E.$$.fragment,e);for(let t=0;t<k.length;t+=1)G(k[t]);S=!1},d(e){e&&c(l),e&&c(d),e&&c(u),e&&c(X),ue(T,e),e&&c(Y),e&&c(I),e&&c(Z),e&&c($),e&&c(le),e&&c(B),e&&c(se),e&&c(q),e&&c(oe),e&&c(M),e&&c(ae),e&&c(C),ue(E),e&&c(re),e&&c(L),e&&c(ce),e&&c(g);for(let t=0;t<w.length;t+=1)w[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function et(a,l,s){let i,{collection:b=new Ge}=l,_=200,d=[];const u=h=>s(1,_=h.code);return a.$$set=h=>{"collection"in h&&s(0,b=h.collection)},a.$$.update=()=>{a.$$.dirty&1&&s(2,d=[{code:200,body:`
[
{
"id": "8171022dc95a4e8",
"created": "2022-09-01 10:24:18.434",
"updated": "2022-09-01 10:24:18.889",
"recordId": "e22581b6f1d44ea",
"collectionId": "${b.id}",
"provider": "google",
"providerId": "2da15468800514p",
},
{
"id": "171022dc895a4e8",
"created": "2022-09-01 10:24:18.434",
"updated": "2022-09-01 10:24:18.889",
"recordId": "e22581b6f1d44ea",
"collectionId": "${b.id}",
"provider": "twitter",
"providerId": "720688005140514",
}
]
`},{code:401,body:`
{
"code": 401,
"message": "The request requires valid record authorization token to be set.",
"data": {}
}
`},{code:403,body:`
{
"code": 403,
"message": "The authorized record model is not allowed to perform this action.",
"data": {}
}
`},{code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}])},s(3,i=Ke.getApiExampleUrl(Je.baseUrl)),[b,_,d,i,u]}class ot extends ze{constructor(l){super(),Qe(this,l,et,xe,Re,{collection:0})}}export{ot as default};

View File

@ -1,93 +0,0 @@
import{S as Be,i as qe,s as Me,e as i,w as v,b as _,c as Se,f as b,g as d,h as s,m as Ee,x as U,N as Pe,P as Le,k as Oe,Q as We,n as ze,t as te,a as le,o as u,d as Ie,T as De,C as He,p as Re,r as j,u as Ue,M as je}from"./index-69e255fe.js";import{S as Ne}from"./SdkTabs-5df68e34.js";function ye(a,l,o){const n=a.slice();return n[5]=l[o],n}function Ae(a,l,o){const n=a.slice();return n[5]=l[o],n}function Te(a,l){let o,n=l[5].code+"",f,h,c,p;function m(){return l[4](l[5])}return{key:a,first:null,c(){o=i("button"),f=v(n),h=_(),b(o,"class","tab-item"),j(o,"active",l[1]===l[5].code),this.first=o},m(g,P){d(g,o,P),s(o,f),s(o,h),c||(p=Ue(o,"click",m),c=!0)},p(g,P){l=g,P&4&&n!==(n=l[5].code+"")&&U(f,n),P&6&&j(o,"active",l[1]===l[5].code)},d(g){g&&u(o),c=!1,p()}}}function Ce(a,l){let o,n,f,h;return n=new je({props:{content:l[5].body}}),{key:a,first:null,c(){o=i("div"),Se(n.$$.fragment),f=_(),b(o,"class","tab-item"),j(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),Ee(n,o,null),s(o,f),h=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),n.$set(m),(!h||p&6)&&j(o,"active",l[1]===l[5].code)},i(c){h||(te(n.$$.fragment,c),h=!0)},o(c){le(n.$$.fragment,c),h=!1},d(c){c&&u(o),Ie(n)}}}function Ge(a){var be,he,_e,ke;let l,o,n=a[0].name+"",f,h,c,p,m,g,P,O=a[0].name+"",N,oe,se,G,K,y,Q,S,F,$,W,ae,z,A,ne,J,D=a[0].name+"",V,ie,X,ce,re,H,Y,E,Z,I,x,B,ee,T,q,w=[],de=new Map,ue,M,k=[],pe=new Map,C;y=new Ne({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${a[3]}');
...
await pb.collection('${(be=a[0])==null?void 0:be.name}').authWithPassword('test@example.com', '123456');
const result = await pb.collection('${(he=a[0])==null?void 0:he.name}').listExternalAuths(
pb.authStore.model.id
);
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${a[3]}');
...
await pb.collection('${(_e=a[0])==null?void 0:_e.name}').authWithPassword('test@example.com', '123456');
final result = await pb.collection('${(ke=a[0])==null?void 0:ke.name}').listExternalAuths(
pb.authStore.model.id,
);
`}});let R=a[2];const fe=e=>e[5].code;for(let e=0;e<R.length;e+=1){let t=Ae(a,R,e),r=fe(t);de.set(r,w[e]=Te(r,t))}let L=a[2];const me=e=>e[5].code;for(let e=0;e<L.length;e+=1){let t=ye(a,L,e),r=me(t);pe.set(r,k[e]=Ce(r,t))}return{c(){l=i("h3"),o=v("List OAuth2 accounts ("),f=v(n),h=v(")"),c=_(),p=i("div"),m=i("p"),g=v("Returns a list with all OAuth2 providers linked to a single "),P=i("strong"),N=v(O),oe=v("."),se=_(),G=i("p"),G.textContent="Only admins and the account owner can access this action.",K=_(),Se(y.$$.fragment),Q=_(),S=i("h6"),S.textContent="API details",F=_(),$=i("div"),W=i("strong"),W.textContent="GET",ae=_(),z=i("div"),A=i("p"),ne=v("/api/collections/"),J=i("strong"),V=v(D),ie=v("/records/"),X=i("strong"),X.textContent=":id",ce=v("/external-auths"),re=_(),H=i("p"),H.innerHTML="Requires <code>Authorization:TOKEN</code> header",Y=_(),E=i("div"),E.textContent="Path Parameters",Z=_(),I=i("table"),I.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the auth record.</td></tr></tbody>`,x=_(),B=i("div"),B.textContent="Responses",ee=_(),T=i("div"),q=i("div");for(let e=0;e<w.length;e+=1)w[e].c();ue=_(),M=i("div");for(let e=0;e<k.length;e+=1)k[e].c();b(l,"class","m-b-sm"),b(p,"class","content txt-lg m-b-sm"),b(S,"class","m-b-xs"),b(W,"class","label label-primary"),b(z,"class","content"),b(H,"class","txt-hint txt-sm txt-right"),b($,"class","alert alert-info"),b(E,"class","section-title"),b(I,"class","table-compact table-border m-b-base"),b(B,"class","section-title"),b(q,"class","tabs-header compact left"),b(M,"class","tabs-content"),b(T,"class","tabs")},m(e,t){d(e,l,t),s(l,o),s(l,f),s(l,h),d(e,c,t),d(e,p,t),s(p,m),s(m,g),s(m,P),s(P,N),s(m,oe),s(p,se),s(p,G),d(e,K,t),Ee(y,e,t),d(e,Q,t),d(e,S,t),d(e,F,t),d(e,$,t),s($,W),s($,ae),s($,z),s(z,A),s(A,ne),s(A,J),s(J,V),s(A,ie),s(A,X),s(A,ce),s($,re),s($,H),d(e,Y,t),d(e,E,t),d(e,Z,t),d(e,I,t),d(e,x,t),d(e,B,t),d(e,ee,t),d(e,T,t),s(T,q);for(let r=0;r<w.length;r+=1)w[r]&&w[r].m(q,null);s(T,ue),s(T,M);for(let r=0;r<k.length;r+=1)k[r]&&k[r].m(M,null);C=!0},p(e,[t]){var ve,we,$e,ge;(!C||t&1)&&n!==(n=e[0].name+"")&&U(f,n),(!C||t&1)&&O!==(O=e[0].name+"")&&U(N,O);const r={};t&9&&(r.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
...
await pb.collection('${(ve=e[0])==null?void 0:ve.name}').authWithPassword('test@example.com', '123456');
const result = await pb.collection('${(we=e[0])==null?void 0:we.name}').listExternalAuths(
pb.authStore.model.id
);
`),t&9&&(r.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
...
await pb.collection('${($e=e[0])==null?void 0:$e.name}').authWithPassword('test@example.com', '123456');
final result = await pb.collection('${(ge=e[0])==null?void 0:ge.name}').listExternalAuths(
pb.authStore.model.id,
);
`),y.$set(r),(!C||t&1)&&D!==(D=e[0].name+"")&&U(V,D),t&6&&(R=e[2],w=Pe(w,t,fe,1,e,R,de,q,Le,Te,null,Ae)),t&6&&(L=e[2],Oe(),k=Pe(k,t,me,1,e,L,pe,M,We,Ce,null,ye),ze())},i(e){if(!C){te(y.$$.fragment,e);for(let t=0;t<L.length;t+=1)te(k[t]);C=!0}},o(e){le(y.$$.fragment,e);for(let t=0;t<k.length;t+=1)le(k[t]);C=!1},d(e){e&&u(l),e&&u(c),e&&u(p),e&&u(K),Ie(y,e),e&&u(Q),e&&u(S),e&&u(F),e&&u($),e&&u(Y),e&&u(E),e&&u(Z),e&&u(I),e&&u(x),e&&u(B),e&&u(ee),e&&u(T);for(let t=0;t<w.length;t+=1)w[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function Ke(a,l,o){let n,{collection:f=new De}=l,h=200,c=[];const p=m=>o(1,h=m.code);return a.$$set=m=>{"collection"in m&&o(0,f=m.collection)},a.$$.update=()=>{a.$$.dirty&1&&o(2,c=[{code:200,body:`
[
{
"id": "8171022dc95a4e8",
"created": "2022-09-01 10:24:18.434",
"updated": "2022-09-01 10:24:18.889",
"recordId": "e22581b6f1d44ea",
"collectionId": "${f.id}",
"provider": "google",
"providerId": "2da15468800514p",
},
{
"id": "171022dc895a4e8",
"created": "2022-09-01 10:24:18.434",
"updated": "2022-09-01 10:24:18.889",
"recordId": "e22581b6f1d44ea",
"collectionId": "${f.id}",
"provider": "twitter",
"providerId": "720688005140514",
}
]
`},{code:401,body:`
{
"code": 401,
"message": "The request requires valid record authorization token to be set.",
"data": {}
}
`},{code:403,body:`
{
"code": 403,
"message": "The authorized record model is not allowed to perform this action.",
"data": {}
}
`},{code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}])},o(3,n=He.getApiExampleUrl(Re.baseUrl)),[f,h,c,n,p]}class Je extends Be{constructor(l){super(),qe(this,l,Ke,Ge,Me,{collection:0})}}export{Je as default};

View File

@ -1,2 +1,2 @@
import{S as E,i as G,s as I,F as K,c as A,m as B,t as N,a as T,d as h,C as M,q as J,e as c,w as q,b as C,f as u,r as L,g as b,h as _,u as j,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as S}from"./index-69e255fe.js";function y(f){let e,o,s;return{c(){e=q("for "),o=c("strong"),s=q(f[3]),u(o,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,o,t),_(o,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&w(e),l&&w(o)}}}function x(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0,t.autofocus=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[0]),t.focus(),p||(d=j(t,"input",f[6]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&1&&t.value!==n[0]&&S(t,n[0])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function ee(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password confirm"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[1]),p||(d=j(t,"input",f[7]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&2&&t.value!==n[1]&&S(t,n[1])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function te(f){let e,o,s,l,t,r,p,d,n,i,g,F,P,v,k,R,z,m=f[3]&&y(f);return r=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),{c(){e=c("form"),o=c("div"),s=c("h4"),l=q(`Reset your admin password
import{S as E,i as G,s as I,F as K,c as A,m as B,t as N,a as T,d as h,C as M,q as J,e as c,w as q,b as C,f as u,r as L,g as b,h as _,u as j,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as S}from"./index-055843b5.js";function y(f){let e,o,s;return{c(){e=q("for "),o=c("strong"),s=q(f[3]),u(o,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,o,t),_(o,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&w(e),l&&w(o)}}}function x(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0,t.autofocus=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[0]),t.focus(),p||(d=j(t,"input",f[6]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&1&&t.value!==n[0]&&S(t,n[0])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function ee(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password confirm"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[1]),p||(d=j(t,"input",f[7]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&2&&t.value!==n[1]&&S(t,n[1])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function te(f){let e,o,s,l,t,r,p,d,n,i,g,F,P,v,k,R,z,m=f[3]&&y(f);return r=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),{c(){e=c("form"),o=c("div"),s=c("h4"),l=q(`Reset your admin password
`),m&&m.c(),t=C(),A(r.$$.fragment),p=C(),A(d.$$.fragment),n=C(),i=c("button"),g=c("span"),g.textContent="Set new password",F=C(),P=c("div"),v=c("a"),v.textContent="Back to login",u(s,"class","m-b-xs"),u(o,"class","content txt-center m-b-sm"),u(g,"class","txt"),u(i,"type","submit"),u(i,"class","btn btn-lg btn-block"),i.disabled=f[2],L(i,"btn-loading",f[2]),u(e,"class","m-b-base"),u(v,"href","/login"),u(v,"class","link-hint"),u(P,"class","content txt-center")},m(a,$){b(a,e,$),_(e,o),_(o,s),_(s,l),m&&m.m(s,null),_(e,t),B(r,e,null),_(e,p),B(d,e,null),_(e,n),_(e,i),_(i,g),b(a,F,$),b(a,P,$),_(P,v),k=!0,R||(z=[j(e,"submit",O(f[4])),Q(U.call(null,v))],R=!0)},p(a,$){a[3]?m?m.p(a,$):(m=y(a),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const D={};$&769&&(D.$$scope={dirty:$,ctx:a}),r.$set(D);const H={};$&770&&(H.$$scope={dirty:$,ctx:a}),d.$set(H),(!k||$&4)&&(i.disabled=a[2]),(!k||$&4)&&L(i,"btn-loading",a[2])},i(a){k||(N(r.$$.fragment,a),N(d.$$.fragment,a),k=!0)},o(a){T(r.$$.fragment,a),T(d.$$.fragment,a),k=!1},d(a){a&&w(e),m&&m.d(),h(r),h(d),a&&w(F),a&&w(P),R=!1,V(z)}}}function se(f){let e,o;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:f}}}),{c(){A(e.$$.fragment)},m(s,l){B(e,s,l),o=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){o||(N(e.$$.fragment,s),o=!0)},o(s){T(e.$$.fragment,s),o=!1},d(s){h(e,s)}}}function le(f,e,o){let s,{params:l}=e,t="",r="",p=!1;async function d(){if(!p){o(2,p=!0);try{await W.admins.confirmPasswordReset(l==null?void 0:l.token,t,r),X("Successfully set a new admin password."),Y("/")}catch(g){W.error(g)}o(2,p=!1)}}function n(){t=this.value,o(0,t)}function i(){r=this.value,o(1,r)}return f.$$set=g=>{"params"in g&&o(5,l=g.params)},f.$$.update=()=>{f.$$.dirty&32&&o(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,r,p,s,d,l,n,i]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default};

View File

@ -1,2 +1,2 @@
import{S as M,i as T,s as j,F as z,c as R,m as S,t as w,a as y,d as E,b as g,e as _,f as p,g as k,h as d,j as A,l as B,k as N,n as D,o as v,p as C,q as G,r as F,u as H,v as I,w as h,x as J,y as P,z as L}from"./index-69e255fe.js";function K(c){let e,s,n,l,t,i,f,m,o,a,b,u;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:r})=>({5:r}),({uniqueId:r})=>r?32:0]},$$scope:{ctx:c}}}),{c(){e=_("form"),s=_("div"),s.innerHTML=`<h4 class="m-b-xs">Forgotten admin password</h4>
import{S as M,i as T,s as j,F as z,c as R,m as S,t as w,a as y,d as E,b as g,e as _,f as p,g as k,h as d,j as A,l as B,k as N,n as D,o as v,p as C,q as G,r as F,u as H,v as I,w as h,x as J,y as P,z as L}from"./index-055843b5.js";function K(c){let e,s,n,l,t,i,f,m,o,a,b,u;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:r})=>({5:r}),({uniqueId:r})=>r?32:0]},$$scope:{ctx:c}}}),{c(){e=_("form"),s=_("div"),s.innerHTML=`<h4 class="m-b-xs">Forgotten admin password</h4>
<p>Enter the email associated with your account and well send you a recovery link:</p>`,n=g(),R(l.$$.fragment),t=g(),i=_("button"),f=_("i"),m=g(),o=_("span"),o.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(f,"class","ri-mail-send-line"),p(o,"class","txt"),p(i,"type","submit"),p(i,"class","btn btn-lg btn-block"),i.disabled=c[1],F(i,"btn-loading",c[1]),p(e,"class","m-b-base")},m(r,$){k(r,e,$),d(e,s),d(e,n),S(l,e,null),d(e,t),d(e,i),d(i,f),d(i,m),d(i,o),a=!0,b||(u=H(e,"submit",I(c[3])),b=!0)},p(r,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:r}),l.$set(q),(!a||$&2)&&(i.disabled=r[1]),(!a||$&2)&&F(i,"btn-loading",r[1])},i(r){a||(w(l.$$.fragment,r),a=!0)},o(r){y(l.$$.fragment,r),a=!1},d(r){r&&v(e),E(l),b=!1,u()}}}function O(c){let e,s,n,l,t,i,f,m,o;return{c(){e=_("div"),s=_("div"),s.innerHTML='<i class="ri-checkbox-circle-line"></i>',n=g(),l=_("div"),t=_("p"),i=h("Check "),f=_("strong"),m=h(c[0]),o=h(" for the recovery link."),p(s,"class","icon"),p(f,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){k(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,i),d(t,f),d(f,m),d(t,o)},p(a,b){b&1&&J(m,a[0])},i:P,o:P,d(a){a&&v(e)}}}function Q(c){let e,s,n,l,t,i,f,m;return{c(){e=_("label"),s=h("Email"),l=g(),t=_("input"),p(e,"for",n=c[5]),p(t,"type","email"),p(t,"id",i=c[5]),t.required=!0,t.autofocus=!0},m(o,a){k(o,e,a),d(e,s),k(o,l,a),k(o,t,a),L(t,c[0]),t.focus(),f||(m=H(t,"input",c[4]),f=!0)},p(o,a){a&32&&n!==(n=o[5])&&p(e,"for",n),a&32&&i!==(i=o[5])&&p(t,"id",i),a&1&&t.value!==o[0]&&L(t,o[0])},d(o){o&&v(e),o&&v(l),o&&v(t),f=!1,m()}}}function U(c){let e,s,n,l,t,i,f,m;const o=[O,K],a=[];function b(u,r){return u[2]?0:1}return e=b(c),s=a[e]=o[e](c),{c(){s.c(),n=g(),l=_("div"),t=_("a"),t.textContent="Back to login",p(t,"href","/login"),p(t,"class","link-hint"),p(l,"class","content txt-center")},m(u,r){a[e].m(u,r),k(u,n,r),k(u,l,r),d(l,t),i=!0,f||(m=A(B.call(null,t)),f=!0)},p(u,r){let $=e;e=b(u),e===$?a[e].p(u,r):(N(),y(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(u,r):(s=a[e]=o[e](u),s.c()),w(s,1),s.m(n.parentNode,n))},i(u){i||(w(s),i=!0)},o(u){y(s),i=!1},d(u){a[e].d(u),u&&v(n),u&&v(l),f=!1,m()}}}function V(c){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:c}}}),{c(){R(e.$$.fragment)},m(n,l){S(e,n,l),s=!0},p(n,[l]){const t={};l&71&&(t.$$scope={dirty:l,ctx:n}),e.$set(t)},i(n){s||(w(e.$$.fragment,n),s=!0)},o(n){y(e.$$.fragment,n),s=!1},d(n){E(e,n)}}}function W(c,e,s){let n="",l=!1,t=!1;async function i(){if(!l){s(1,l=!0);try{await C.admins.requestPasswordReset(n),s(2,t=!0)}catch(m){C.error(m)}s(1,l=!1)}}function f(){n=this.value,s(0,n)}return[n,l,t,i,f]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default};

View File

@ -1,2 +1,2 @@
import{S as o,i,s as c,e as r,f as l,g as u,y as s,o as d,H as h}from"./index-69e255fe.js";function f(n){let t;return{c(){t=r("div"),t.innerHTML=`<h3 class="m-b-sm">Auth completed.</h3>
import{S as o,i,s as c,e as r,f as l,g as u,y as s,o as d,H as h}from"./index-055843b5.js";function f(n){let t;return{c(){t=r("div"),t.innerHTML=`<h3 class="m-b-sm">Auth completed.</h3>
<h5>You can go back to the app if this window is not automatically closed.</h5>`,l(t,"class","content txt-hint txt-center p-base")},m(e,a){u(e,t,a)},p:s,i:s,o:s,d(e){e&&d(t)}}}function m(n){return h(()=>{window.close()}),[]}class x extends o{constructor(t){super(),i(this,t,m,f,c,{})}}export{x as default};

View File

@ -1,4 +1,4 @@
import{S as G,i as I,s as J,F as M,c as H,m as L,t as v,a as y,d as z,C as N,E as O,g as _,k as R,n as W,o as b,O as Y,G as j,p as A,q as B,e as m,w as C,b as h,f as d,r as T,h as k,u as P,v as D,y as E,x as K,z as F}from"./index-69e255fe.js";function Q(r){let e,t,l,s,n,o,c,i,a,u,g,$,p=r[3]&&S(r);return o=new B({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:r}}}),{c(){e=m("form"),t=m("div"),l=m("h5"),s=C(`Type your password to confirm changing your email address
import{S as G,i as I,s as J,F as M,c as H,m as L,t as v,a as y,d as z,C as N,E as O,g as _,k as R,n as W,o as b,O as Y,G as j,p as A,q as B,e as m,w as C,b as h,f as d,r as T,h as k,u as P,v as D,y as E,x as K,z as F}from"./index-055843b5.js";function Q(r){let e,t,l,s,n,o,c,i,a,u,g,$,p=r[3]&&S(r);return o=new B({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:r}}}),{c(){e=m("form"),t=m("div"),l=m("h5"),s=C(`Type your password to confirm changing your email address
`),p&&p.c(),n=h(),H(o.$$.fragment),c=h(),i=m("button"),a=m("span"),a.textContent="Confirm new email",d(t,"class","content txt-center m-b-base"),d(a,"class","txt"),d(i,"type","submit"),d(i,"class","btn btn-lg btn-block"),i.disabled=r[1],T(i,"btn-loading",r[1])},m(f,w){_(f,e,w),k(e,t),k(t,l),k(l,s),p&&p.m(l,null),k(e,n),L(o,e,null),k(e,c),k(e,i),k(i,a),u=!0,g||($=P(e,"submit",D(r[4])),g=!0)},p(f,w){f[3]?p?p.p(f,w):(p=S(f),p.c(),p.m(l,null)):p&&(p.d(1),p=null);const q={};w&769&&(q.$$scope={dirty:w,ctx:f}),o.$set(q),(!u||w&2)&&(i.disabled=f[1]),(!u||w&2)&&T(i,"btn-loading",f[1])},i(f){u||(v(o.$$.fragment,f),u=!0)},o(f){y(o.$$.fragment,f),u=!1},d(f){f&&b(e),p&&p.d(),z(o),g=!1,$()}}}function U(r){let e,t,l,s,n;return{c(){e=m("div"),e.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
<div class="content txt-bold"><p>Successfully changed the user email address.</p>
<p>You can now sign in with your new email address.</p></div>`,t=h(),l=m("button"),l.textContent="Close",d(e,"class","alert alert-success"),d(l,"type","button"),d(l,"class","btn btn-transparent btn-block")},m(o,c){_(o,e,c),_(o,t,c),_(o,l,c),s||(n=P(l,"click",r[6]),s=!0)},p:E,i:E,o:E,d(o){o&&b(e),o&&b(t),o&&b(l),s=!1,n()}}}function S(r){let e,t,l;return{c(){e=C("to "),t=m("strong"),l=C(r[3]),d(t,"class","txt-nowrap")},m(s,n){_(s,e,n),_(s,t,n),k(t,l)},p(s,n){n&8&&K(l,s[3])},d(s){s&&b(e),s&&b(t)}}}function V(r){let e,t,l,s,n,o,c,i;return{c(){e=m("label"),t=C("Password"),s=h(),n=m("input"),d(e,"for",l=r[8]),d(n,"type","password"),d(n,"id",o=r[8]),n.required=!0,n.autofocus=!0},m(a,u){_(a,e,u),k(e,t),_(a,s,u),_(a,n,u),F(n,r[0]),n.focus(),c||(i=P(n,"input",r[7]),c=!0)},p(a,u){u&256&&l!==(l=a[8])&&d(e,"for",l),u&256&&o!==(o=a[8])&&d(n,"id",o),u&1&&n.value!==a[0]&&F(n,a[0])},d(a){a&&b(e),a&&b(s),a&&b(n),c=!1,i()}}}function X(r){let e,t,l,s;const n=[U,Q],o=[];function c(i,a){return i[2]?0:1}return e=c(r),t=o[e]=n[e](r),{c(){t.c(),l=O()},m(i,a){o[e].m(i,a),_(i,l,a),s=!0},p(i,a){let u=e;e=c(i),e===u?o[e].p(i,a):(R(),y(o[u],1,1,()=>{o[u]=null}),W(),t=o[e],t?t.p(i,a):(t=o[e]=n[e](i),t.c()),v(t,1),t.m(l.parentNode,l))},i(i){s||(v(t),s=!0)},o(i){y(t),s=!1},d(i){o[e].d(i),i&&b(l)}}}function Z(r){let e,t;return e=new M({props:{nobranding:!0,$$slots:{default:[X]},$$scope:{ctx:r}}}),{c(){H(e.$$.fragment)},m(l,s){L(e,l,s),t=!0},p(l,[s]){const n={};s&527&&(n.$$scope={dirty:s,ctx:l}),e.$set(n)},i(l){t||(v(e.$$.fragment,l),t=!0)},o(l){y(e.$$.fragment,l),t=!1},d(l){z(e,l)}}}function x(r,e,t){let l,{params:s}=e,n="",o=!1,c=!1;async function i(){if(o)return;t(1,o=!0);const g=new Y("../");try{const $=j(s==null?void 0:s.token);await g.collection($.collectionId).confirmEmailChange(s==null?void 0:s.token,n),t(2,c=!0)}catch($){A.error($)}t(1,o=!1)}const a=()=>window.close();function u(){n=this.value,t(0,n)}return r.$$set=g=>{"params"in g&&t(5,s=g.params)},r.$$.update=()=>{r.$$.dirty&32&&t(3,l=N.getJWTPayload(s==null?void 0:s.token).newEmail||"")},[n,o,c,l,i,s,a,u]}class te extends G{constructor(e){super(),I(this,e,x,Z,J,{params:5})}}export{te as default};

View File

@ -1,4 +1,4 @@
import{S as J,i as M,s as O,F as W,c as N,m as T,t as y,a as q,d as H,C as Y,E as j,g as _,k as A,n as B,o as m,O as D,G as K,p as Q,q as E,e as b,w as h,b as P,f as p,r as G,h as w,u as S,v as U,y as F,x as V,z as R}from"./index-69e255fe.js";function X(r){let e,l,s,n,t,o,c,u,i,a,v,k,g,C,d=r[4]&&I(r);return o=new E({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:r}}}),u=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:r}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=h(`Reset your user password
import{S as J,i as M,s as O,F as W,c as N,m as T,t as y,a as q,d as H,C as Y,E as j,g as _,k as A,n as B,o as m,O as D,G as K,p as Q,q as E,e as b,w as h,b as P,f as p,r as G,h as w,u as S,v as U,y as F,x as V,z as R}from"./index-055843b5.js";function X(r){let e,l,s,n,t,o,c,u,i,a,v,k,g,C,d=r[4]&&I(r);return o=new E({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:r}}}),u=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:r}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=h(`Reset your user password
`),d&&d.c(),t=P(),N(o.$$.fragment),c=P(),N(u.$$.fragment),i=P(),a=b("button"),v=b("span"),v.textContent="Set new password",p(l,"class","content txt-center m-b-base"),p(v,"class","txt"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block"),a.disabled=r[2],G(a,"btn-loading",r[2])},m(f,$){_(f,e,$),w(e,l),w(l,s),w(s,n),d&&d.m(s,null),w(e,t),T(o,e,null),w(e,c),T(u,e,null),w(e,i),w(e,a),w(a,v),k=!0,g||(C=S(e,"submit",U(r[5])),g=!0)},p(f,$){f[4]?d?d.p(f,$):(d=I(f),d.c(),d.m(s,null)):d&&(d.d(1),d=null);const L={};$&3073&&(L.$$scope={dirty:$,ctx:f}),o.$set(L);const z={};$&3074&&(z.$$scope={dirty:$,ctx:f}),u.$set(z),(!k||$&4)&&(a.disabled=f[2]),(!k||$&4)&&G(a,"btn-loading",f[2])},i(f){k||(y(o.$$.fragment,f),y(u.$$.fragment,f),k=!0)},o(f){q(o.$$.fragment,f),q(u.$$.fragment,f),k=!1},d(f){f&&m(e),d&&d.d(),H(o),H(u),g=!1,C()}}}function Z(r){let e,l,s,n,t;return{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
<div class="content txt-bold"><p>Successfully changed the user password.</p>
<p>You can now sign in with your new password.</p></div>`,l=P(),s=b("button"),s.textContent="Close",p(e,"class","alert alert-success"),p(s,"type","button"),p(s,"class","btn btn-transparent btn-block")},m(o,c){_(o,e,c),_(o,l,c),_(o,s,c),n||(t=S(s,"click",r[7]),n=!0)},p:F,i:F,o:F,d(o){o&&m(e),o&&m(l),o&&m(s),n=!1,t()}}}function I(r){let e,l,s;return{c(){e=h("for "),l=b("strong"),s=h(r[4])},m(n,t){_(n,e,t),_(n,l,t),w(l,s)},p(n,t){t&16&&V(s,n[4])},d(n){n&&m(e),n&&m(l)}}}function x(r){let e,l,s,n,t,o,c,u;return{c(){e=b("label"),l=h("New password"),n=P(),t=b("input"),p(e,"for",s=r[10]),p(t,"type","password"),p(t,"id",o=r[10]),t.required=!0,t.autofocus=!0},m(i,a){_(i,e,a),w(e,l),_(i,n,a),_(i,t,a),R(t,r[0]),t.focus(),c||(u=S(t,"input",r[8]),c=!0)},p(i,a){a&1024&&s!==(s=i[10])&&p(e,"for",s),a&1024&&o!==(o=i[10])&&p(t,"id",o),a&1&&t.value!==i[0]&&R(t,i[0])},d(i){i&&m(e),i&&m(n),i&&m(t),c=!1,u()}}}function ee(r){let e,l,s,n,t,o,c,u;return{c(){e=b("label"),l=h("New password confirm"),n=P(),t=b("input"),p(e,"for",s=r[10]),p(t,"type","password"),p(t,"id",o=r[10]),t.required=!0},m(i,a){_(i,e,a),w(e,l),_(i,n,a),_(i,t,a),R(t,r[1]),c||(u=S(t,"input",r[9]),c=!0)},p(i,a){a&1024&&s!==(s=i[10])&&p(e,"for",s),a&1024&&o!==(o=i[10])&&p(t,"id",o),a&2&&t.value!==i[1]&&R(t,i[1])},d(i){i&&m(e),i&&m(n),i&&m(t),c=!1,u()}}}function te(r){let e,l,s,n;const t=[Z,X],o=[];function c(u,i){return u[3]?0:1}return e=c(r),l=o[e]=t[e](r),{c(){l.c(),s=j()},m(u,i){o[e].m(u,i),_(u,s,i),n=!0},p(u,i){let a=e;e=c(u),e===a?o[e].p(u,i):(A(),q(o[a],1,1,()=>{o[a]=null}),B(),l=o[e],l?l.p(u,i):(l=o[e]=t[e](u),l.c()),y(l,1),l.m(s.parentNode,s))},i(u){n||(y(l),n=!0)},o(u){q(l),n=!1},d(u){o[e].d(u),u&&m(s)}}}function se(r){let e,l;return e=new W({props:{nobranding:!0,$$slots:{default:[te]},$$scope:{ctx:r}}}),{c(){N(e.$$.fragment)},m(s,n){T(e,s,n),l=!0},p(s,[n]){const t={};n&2079&&(t.$$scope={dirty:n,ctx:s}),e.$set(t)},i(s){l||(y(e.$$.fragment,s),l=!0)},o(s){q(e.$$.fragment,s),l=!1},d(s){H(e,s)}}}function le(r,e,l){let s,{params:n}=e,t="",o="",c=!1,u=!1;async function i(){if(c)return;l(2,c=!0);const g=new D("../");try{const C=K(n==null?void 0:n.token);await g.collection(C.collectionId).confirmPasswordReset(n==null?void 0:n.token,t,o),l(3,u=!0)}catch(C){Q.error(C)}l(2,c=!1)}const a=()=>window.close();function v(){t=this.value,l(0,t)}function k(){o=this.value,l(1,o)}return r.$$set=g=>{"params"in g&&l(6,n=g.params)},r.$$.update=()=>{r.$$.dirty&64&&l(4,s=Y.getJWTPayload(n==null?void 0:n.token).email||"")},[t,o,c,u,s,i,n,a,v,k]}class oe extends J{constructor(e){super(),M(this,e,le,se,O,{params:6})}}export{oe as default};

View File

@ -1,3 +1,3 @@
import{S as v,i as y,s as w,F as g,c as x,m as C,t as $,a as L,d as P,O as T,G as H,E as M,g as r,o as a,e as u,b as _,f,u as b,y as p}from"./index-69e255fe.js";function S(o){let t,s,e,n,l;return{c(){t=u("div"),t.innerHTML=`<div class="icon"><i class="ri-error-warning-line"></i></div>
import{S as v,i as y,s as w,F as g,c as x,m as C,t as $,a as L,d as P,O as T,G as H,E as M,g as r,o as a,e as u,b as _,f,u as b,y as p}from"./index-055843b5.js";function S(o){let t,s,e,n,l;return{c(){t=u("div"),t.innerHTML=`<div class="icon"><i class="ri-error-warning-line"></i></div>
<div class="content txt-bold"><p>Invalid or expired verification token.</p></div>`,s=_(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-danger"),f(e,"type","button"),f(e,"class","btn btn-transparent btn-block")},m(i,c){r(i,t,c),r(i,s,c),r(i,e,c),n||(l=b(e,"click",o[4]),n=!0)},p,d(i){i&&a(t),i&&a(s),i&&a(e),n=!1,l()}}}function F(o){let t,s,e,n,l;return{c(){t=u("div"),t.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
<div class="content txt-bold"><p>Successfully verified email address.</p></div>`,s=_(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-success"),f(e,"type","button"),f(e,"class","btn btn-transparent btn-block")},m(i,c){r(i,t,c),r(i,s,c),r(i,e,c),n||(l=b(e,"click",o[3]),n=!0)},p,d(i){i&&a(t),i&&a(s),i&&a(e),n=!1,l()}}}function I(o){let t;return{c(){t=u("div"),t.innerHTML='<div class="loader loader-lg"><em>Please wait...</em></div>',f(t,"class","txt-center")},m(s,e){r(s,t,e)},p,d(s){s&&a(t)}}}function V(o){let t;function s(l,i){return l[1]?I:l[0]?F:S}let e=s(o),n=e(o);return{c(){n.c(),t=M()},m(l,i){n.m(l,i),r(l,t,i)},p(l,i){e===(e=s(l))&&n?n.p(l,i):(n.d(1),n=e(l),n&&(n.c(),n.m(t.parentNode,t)))},d(l){n.d(l),l&&a(t)}}}function q(o){let t,s;return t=new g({props:{nobranding:!0,$$slots:{default:[V]},$$scope:{ctx:o}}}),{c(){x(t.$$.fragment)},m(e,n){C(t,e,n),s=!0},p(e,[n]){const l={};n&67&&(l.$$scope={dirty:n,ctx:e}),t.$set(l)},i(e){s||($(t.$$.fragment,e),s=!0)},o(e){L(t.$$.fragment,e),s=!1},d(e){P(t,e)}}}function E(o,t,s){let{params:e}=t,n=!1,l=!1;i();async function i(){s(1,l=!0);const d=new T("../");try{const m=H(e==null?void 0:e.token);await d.collection(m.collectionId).confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch{s(0,n=!1)}s(1,l=!1)}const c=()=>window.close(),k=()=>window.close();return o.$$set=d=>{"params"in d&&s(2,e=d.params)},[n,l,e,c,k]}class N extends v{constructor(t){super(),y(this,t,E,q,w,{params:2})}}export{N as default};

View File

@ -1,4 +1,4 @@
import{S as re,i as ae,s as be,M as ue,C as P,e as u,w as y,b as a,c as te,f as p,g as t,h as I,m as ne,x as pe,t as ie,a as le,o as n,d as ce,T as me,p as de}from"./index-69e255fe.js";import{S as fe}from"./SdkTabs-5df68e34.js";function $e(o){var B,U,W,T,A,H,L,M,q,j,J,N;let i,m,l=o[0].name+"",b,d,h,f,_,$,k,c,S,v,w,R,C,g,E,r,D;return c=new fe({props:{js:`
import{S as re,i as ae,s as be,M as ue,C as P,e as u,w as y,b as a,c as te,f as p,g as t,h as I,m as ne,x as pe,t as ie,a as le,o as n,d as ce,T as me,p as de}from"./index-055843b5.js";import{S as fe}from"./SdkTabs-1c685373.js";function $e(o){var B,U,W,T,A,H,L,M,q,j,J,N;let i,m,l=o[0].name+"",b,d,h,f,_,$,k,c,S,v,w,R,C,g,E,r,D;return c=new fe({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[1]}');

View File

@ -1,4 +1,4 @@
import{S as Te,i as Ee,s as Be,e as r,w,b as k,c as Pe,f,g as m,h as n,m as Ce,x as N,N as ve,P as Se,k as Me,Q as Re,n as Ae,t as x,a as ee,o as d,d as ye,T as We,C as ze,p as He,r as O,u as Ue,M as je}from"./index-69e255fe.js";import{S as De}from"./SdkTabs-5df68e34.js";function we(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function $e(o,l){let s,a=l[5].code+"",_,b,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=w(a),b=k(),f(s,"class","tab-item"),O(s,"active",l[1]===l[5].code),this.first=s},m($,q){m($,s,q),n(s,_),n(s,b),i||(p=Ue(s,"click",u),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&N(_,a),q&6&&O(s,"active",l[1]===l[5].code)},d($){$&&d(s),i=!1,p()}}}function qe(o,l){let s,a,_,b;return a=new je({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),Pe(a.$$.fragment),_=k(),f(s,"class","tab-item"),O(s,"active",l[1]===l[5].code),this.first=s},m(i,p){m(i,s,p),Ce(a,s,null),n(s,_),b=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!b||p&6)&&O(s,"active",l[1]===l[5].code)},i(i){b||(x(a.$$.fragment,i),b=!0)},o(i){ee(a.$$.fragment,i),b=!1},d(i){i&&d(s),ye(a)}}}function Le(o){var de,pe,ue,fe;let l,s,a=o[0].name+"",_,b,i,p,u,$,q,z=o[0].name+"",F,te,I,P,K,T,Q,g,H,le,U,E,se,G,j=o[0].name+"",J,ae,oe,D,V,B,X,S,Y,M,Z,C,R,v=[],ne=new Map,ie,A,h=[],ce=new Map,y;P=new De({props:{js:`
import{S as Te,i as Ee,s as Be,e as r,w,b as k,c as Pe,f,g as m,h as n,m as Ce,x as N,N as ve,P as Se,k as Me,Q as Re,n as Ae,t as x,a as ee,o as d,d as ye,T as We,C as ze,p as He,r as O,u as Ue,M as je}from"./index-055843b5.js";import{S as De}from"./SdkTabs-1c685373.js";function we(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function $e(o,l){let s,a=l[5].code+"",_,b,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=w(a),b=k(),f(s,"class","tab-item"),O(s,"active",l[1]===l[5].code),this.first=s},m($,q){m($,s,q),n(s,_),n(s,b),i||(p=Ue(s,"click",u),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&N(_,a),q&6&&O(s,"active",l[1]===l[5].code)},d($){$&&d(s),i=!1,p()}}}function qe(o,l){let s,a,_,b;return a=new je({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),Pe(a.$$.fragment),_=k(),f(s,"class","tab-item"),O(s,"active",l[1]===l[5].code),this.first=s},m(i,p){m(i,s,p),Ce(a,s,null),n(s,_),b=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!b||p&6)&&O(s,"active",l[1]===l[5].code)},i(i){b||(x(a.$$.fragment,i),b=!0)},o(i){ee(a.$$.fragment,i),b=!1},d(i){i&&d(s),ye(a)}}}function Le(o){var de,pe,ue,fe;let l,s,a=o[0].name+"",_,b,i,p,u,$,q,z=o[0].name+"",F,te,I,P,K,T,Q,g,H,le,U,E,se,G,j=o[0].name+"",J,ae,oe,D,V,B,X,S,Y,M,Z,C,R,v=[],ne=new Map,ie,A,h=[],ce=new Map,y;P=new De({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[3]}');

View File

@ -1,4 +1,4 @@
import{S as Pe,i as $e,s as qe,e as r,w as h,b as v,c as ve,f as b,g as d,h as n,m as we,x as L,N as ue,P as ge,k as ye,Q as Re,n as Be,t as Z,a as x,o as f,d as he,T as Ce,C as Se,p as Te,r as N,u as Me,M as Ae}from"./index-69e255fe.js";import{S as Ue}from"./SdkTabs-5df68e34.js";function me(a,s,l){const o=a.slice();return o[5]=s[l],o}function be(a,s,l){const o=a.slice();return o[5]=s[l],o}function _e(a,s){let l,o=s[5].code+"",_,m,i,p;function u(){return s[4](s[5])}return{key:a,first:null,c(){l=r("button"),_=h(o),m=v(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(P,$){d(P,l,$),n(l,_),n(l,m),i||(p=Me(l,"click",u),i=!0)},p(P,$){s=P,$&4&&o!==(o=s[5].code+"")&&L(_,o),$&6&&N(l,"active",s[1]===s[5].code)},d(P){P&&f(l),i=!1,p()}}}function ke(a,s){let l,o,_,m;return o=new Ae({props:{content:s[5].body}}),{key:a,first:null,c(){l=r("div"),ve(o.$$.fragment),_=v(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(i,p){d(i,l,p),we(o,l,null),n(l,_),m=!0},p(i,p){s=i;const u={};p&4&&(u.content=s[5].body),o.$set(u),(!m||p&6)&&N(l,"active",s[1]===s[5].code)},i(i){m||(Z(o.$$.fragment,i),m=!0)},o(i){x(o.$$.fragment,i),m=!1},d(i){i&&f(l),he(o)}}}function je(a){var re,de;let s,l,o=a[0].name+"",_,m,i,p,u,P,$,D=a[0].name+"",O,ee,Q,q,z,B,G,g,H,te,E,C,se,J,F=a[0].name+"",K,le,V,S,W,T,X,M,Y,y,A,w=[],oe=new Map,ae,U,k=[],ne=new Map,R;q=new Ue({props:{js:`
import{S as Pe,i as $e,s as qe,e as r,w as h,b as v,c as ve,f as b,g as d,h as n,m as we,x as L,N as ue,P as ge,k as ye,Q as Re,n as Be,t as Z,a as x,o as f,d as he,T as Ce,C as Se,p as Te,r as N,u as Me,M as Ae}from"./index-055843b5.js";import{S as Ue}from"./SdkTabs-1c685373.js";function me(a,s,l){const o=a.slice();return o[5]=s[l],o}function be(a,s,l){const o=a.slice();return o[5]=s[l],o}function _e(a,s){let l,o=s[5].code+"",_,m,i,p;function u(){return s[4](s[5])}return{key:a,first:null,c(){l=r("button"),_=h(o),m=v(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(P,$){d(P,l,$),n(l,_),n(l,m),i||(p=Me(l,"click",u),i=!0)},p(P,$){s=P,$&4&&o!==(o=s[5].code+"")&&L(_,o),$&6&&N(l,"active",s[1]===s[5].code)},d(P){P&&f(l),i=!1,p()}}}function ke(a,s){let l,o,_,m;return o=new Ae({props:{content:s[5].body}}),{key:a,first:null,c(){l=r("div"),ve(o.$$.fragment),_=v(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(i,p){d(i,l,p),we(o,l,null),n(l,_),m=!0},p(i,p){s=i;const u={};p&4&&(u.content=s[5].body),o.$set(u),(!m||p&6)&&N(l,"active",s[1]===s[5].code)},i(i){m||(Z(o.$$.fragment,i),m=!0)},o(i){x(o.$$.fragment,i),m=!1},d(i){i&&f(l),he(o)}}}function je(a){var re,de;let s,l,o=a[0].name+"",_,m,i,p,u,P,$,D=a[0].name+"",O,ee,Q,q,z,B,G,g,H,te,E,C,se,J,F=a[0].name+"",K,le,V,S,W,T,X,M,Y,y,A,w=[],oe=new Map,ae,U,k=[],ne=new Map,R;q=new Ue({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${a[3]}');

View File

@ -1,4 +1,4 @@
import{S as qe,i as we,s as Pe,e as r,w as $,b as v,c as ve,f as b,g as f,h as i,m as he,x as I,N as me,P as ge,k as ye,Q as Be,n as Ce,t as Z,a as x,o as u,d as $e,T as Se,C as Te,p as Me,r as L,u as Ve,M as Re}from"./index-69e255fe.js";import{S as Ae}from"./SdkTabs-5df68e34.js";function pe(a,l,s){const o=a.slice();return o[5]=l[s],o}function be(a,l,s){const o=a.slice();return o[5]=l[s],o}function _e(a,l){let s,o=l[5].code+"",_,p,n,d;function m(){return l[4](l[5])}return{key:a,first:null,c(){s=r("button"),_=$(o),p=v(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(q,w){f(q,s,w),i(s,_),i(s,p),n||(d=Ve(s,"click",m),n=!0)},p(q,w){l=q,w&4&&o!==(o=l[5].code+"")&&I(_,o),w&6&&L(s,"active",l[1]===l[5].code)},d(q){q&&u(s),n=!1,d()}}}function ke(a,l){let s,o,_,p;return o=new Re({props:{content:l[5].body}}),{key:a,first:null,c(){s=r("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(n,d){f(n,s,d),he(o,s,null),i(s,_),p=!0},p(n,d){l=n;const m={};d&4&&(m.content=l[5].body),o.$set(m),(!p||d&6)&&L(s,"active",l[1]===l[5].code)},i(n){p||(Z(o.$$.fragment,n),p=!0)},o(n){x(o.$$.fragment,n),p=!1},d(n){n&&u(s),$e(o)}}}function Ue(a){var re,fe;let l,s,o=a[0].name+"",_,p,n,d,m,q,w,j=a[0].name+"",N,ee,O,P,Q,C,z,g,D,te,H,S,le,G,E=a[0].name+"",J,se,K,T,W,M,X,V,Y,y,R,h=[],oe=new Map,ae,A,k=[],ie=new Map,B;P=new Ae({props:{js:`
import{S as qe,i as we,s as Pe,e as r,w as $,b as v,c as ve,f as b,g as f,h as i,m as he,x as I,N as me,P as ge,k as ye,Q as Be,n as Ce,t as Z,a as x,o as u,d as $e,T as Se,C as Te,p as Me,r as L,u as Ve,M as Re}from"./index-055843b5.js";import{S as Ae}from"./SdkTabs-1c685373.js";function pe(a,l,s){const o=a.slice();return o[5]=l[s],o}function be(a,l,s){const o=a.slice();return o[5]=l[s],o}function _e(a,l){let s,o=l[5].code+"",_,p,n,d;function m(){return l[4](l[5])}return{key:a,first:null,c(){s=r("button"),_=$(o),p=v(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(q,w){f(q,s,w),i(s,_),i(s,p),n||(d=Ve(s,"click",m),n=!0)},p(q,w){l=q,w&4&&o!==(o=l[5].code+"")&&I(_,o),w&6&&L(s,"active",l[1]===l[5].code)},d(q){q&&u(s),n=!1,d()}}}function ke(a,l){let s,o,_,p;return o=new Re({props:{content:l[5].body}}),{key:a,first:null,c(){s=r("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(n,d){f(n,s,d),he(o,s,null),i(s,_),p=!0},p(n,d){l=n;const m={};d&4&&(m.content=l[5].body),o.$set(m),(!p||d&6)&&L(s,"active",l[1]===l[5].code)},i(n){p||(Z(o.$$.fragment,n),p=!0)},o(n){x(o.$$.fragment,n),p=!1},d(n){n&&u(s),$e(o)}}}function Ue(a){var re,fe;let l,s,o=a[0].name+"",_,p,n,d,m,q,w,j=a[0].name+"",N,ee,O,P,Q,C,z,g,D,te,H,S,le,G,E=a[0].name+"",J,se,K,T,W,M,X,V,Y,y,R,h=[],oe=new Map,ae,A,k=[],ie=new Map,B;P=new Ae({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${a[3]}');

View File

@ -1 +1 @@
import{S as q,i as B,s as F,e as v,b as j,f as h,g as y,h as m,N as C,P as J,k as Q,Q as Y,n as z,t as N,a as P,o as w,w as E,r as S,u as A,x as R,M as G,c as H,m as L,d as O}from"./index-69e255fe.js";function D(o,e,l){const s=o.slice();return s[6]=e[l],s}function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function M(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=E(g),i=j(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),S(l,"active",e[1]===e[6].language),this.first=l},m(_,f){y(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&R(r,g),f&6&&S(l,"active",e[1]===e[6].language)},d(_){_&&w(l),n=!1,k()}}}function T(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,_,f,p,d;return s=new G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=j(),r=v("div"),i=v("em"),n=v("a"),c=E(k),_=E(" SDK"),p=j(),h(n,"href",f=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),S(l,"active",e[1]===e[6].language),this.first=l},m(b,t){y(b,l,t),L(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,_),m(l,p),d=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!d||t&4)&&k!==(k=e[6].title+"")&&R(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&S(l,"active",e[1]===e[6].language)},i(b){d||(N(s.$$.fragment,b),d=!0)},o(b){P(s.$$.fragment,b),d=!1},d(b){b&&w(l),O(s)}}}function U(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=o[2];const p=t=>t[6].language;for(let t=0;t<f.length;t+=1){let a=K(o,f,t),u=p(a);g.set(u,s[t]=M(u,a))}let d=o[2];const b=t=>t[6].language;for(let t=0;t<d.length;t+=1){let a=D(o,d,t),u=b(a);k.set(u,n[t]=T(u,a))}return{c(){e=v("div"),l=v("div");for(let t=0;t<s.length;t+=1)s[t].c();r=j(),i=v("div");for(let t=0;t<n.length;t+=1)n[t].c();h(l,"class","tabs-header compact left"),h(i,"class","tabs-content"),h(e,"class",c="tabs sdk-tabs "+o[0]+" svelte-1maocj6")},m(t,a){y(t,e,a),m(e,l);for(let u=0;u<s.length;u+=1)s[u]&&s[u].m(l,null);m(e,r),m(e,i);for(let u=0;u<n.length;u+=1)n[u]&&n[u].m(i,null);_=!0},p(t,[a]){a&6&&(f=t[2],s=C(s,a,p,1,t,f,g,l,J,M,null,K)),a&6&&(d=t[2],Q(),n=C(n,a,b,1,t,d,k,i,Y,T,null,D),z()),(!_||a&1&&c!==(c="tabs sdk-tabs "+t[0]+" svelte-1maocj6"))&&h(e,"class",c)},i(t){if(!_){for(let a=0;a<d.length;a+=1)N(n[a]);_=!0}},o(t){for(let a=0;a<n.length;a+=1)P(n[a]);_=!1},d(t){t&&w(e);for(let a=0;a<s.length;a+=1)s[a].d();for(let a=0;a<n.length;a+=1)n[a].d()}}}const I="pb_sdk_preference";function V(o,e,l){let s,{class:g="m-b-base"}=e,{js:r=""}=e,{dart:i=""}=e,n=localStorage.getItem(I)||"javascript";const k=c=>l(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(I,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class X extends q{constructor(e){super(),B(this,e,V,U,F,{class:0,js:3,dart:4})}}export{X as S};
import{S as q,i as B,s as F,e as v,b as j,f as h,g as y,h as m,N as C,P as J,k as Q,Q as Y,n as z,t as N,a as P,o as w,w as E,r as S,u as A,x as R,M as G,c as H,m as L,d as O}from"./index-055843b5.js";function D(o,e,l){const s=o.slice();return s[6]=e[l],s}function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function M(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=E(g),i=j(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),S(l,"active",e[1]===e[6].language),this.first=l},m(_,f){y(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&R(r,g),f&6&&S(l,"active",e[1]===e[6].language)},d(_){_&&w(l),n=!1,k()}}}function T(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,_,f,p,d;return s=new G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=j(),r=v("div"),i=v("em"),n=v("a"),c=E(k),_=E(" SDK"),p=j(),h(n,"href",f=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),S(l,"active",e[1]===e[6].language),this.first=l},m(b,t){y(b,l,t),L(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,_),m(l,p),d=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!d||t&4)&&k!==(k=e[6].title+"")&&R(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&S(l,"active",e[1]===e[6].language)},i(b){d||(N(s.$$.fragment,b),d=!0)},o(b){P(s.$$.fragment,b),d=!1},d(b){b&&w(l),O(s)}}}function U(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=o[2];const p=t=>t[6].language;for(let t=0;t<f.length;t+=1){let a=K(o,f,t),u=p(a);g.set(u,s[t]=M(u,a))}let d=o[2];const b=t=>t[6].language;for(let t=0;t<d.length;t+=1){let a=D(o,d,t),u=b(a);k.set(u,n[t]=T(u,a))}return{c(){e=v("div"),l=v("div");for(let t=0;t<s.length;t+=1)s[t].c();r=j(),i=v("div");for(let t=0;t<n.length;t+=1)n[t].c();h(l,"class","tabs-header compact left"),h(i,"class","tabs-content"),h(e,"class",c="tabs sdk-tabs "+o[0]+" svelte-1maocj6")},m(t,a){y(t,e,a),m(e,l);for(let u=0;u<s.length;u+=1)s[u]&&s[u].m(l,null);m(e,r),m(e,i);for(let u=0;u<n.length;u+=1)n[u]&&n[u].m(i,null);_=!0},p(t,[a]){a&6&&(f=t[2],s=C(s,a,p,1,t,f,g,l,J,M,null,K)),a&6&&(d=t[2],Q(),n=C(n,a,b,1,t,d,k,i,Y,T,null,D),z()),(!_||a&1&&c!==(c="tabs sdk-tabs "+t[0]+" svelte-1maocj6"))&&h(e,"class",c)},i(t){if(!_){for(let a=0;a<d.length;a+=1)N(n[a]);_=!0}},o(t){for(let a=0;a<n.length;a+=1)P(n[a]);_=!1},d(t){t&&w(e);for(let a=0;a<s.length;a+=1)s[a].d();for(let a=0;a<n.length;a+=1)n[a].d()}}}const I="pb_sdk_preference";function V(o,e,l){let s,{class:g="m-b-base"}=e,{js:r=""}=e,{dart:i=""}=e,n=localStorage.getItem(I)||"javascript";const k=c=>l(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(I,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class X extends q{constructor(e){super(),B(this,e,V,U,F,{class:0,js:3,dart:4})}}export{X as S};

View File

@ -1,4 +1,4 @@
import{S as qe,i as Me,s as De,e as i,w as v,b as h,c as Se,f as m,g as d,h as s,m as Be,x as I,N as Te,P as Oe,k as We,Q as ze,n as He,t as le,a as oe,o as u,d as Ue,T as Le,C as je,p as Ie,r as N,u as Ne,M as Re}from"./index-69e255fe.js";import{S as Ke}from"./SdkTabs-5df68e34.js";function ye(n,l,o){const a=n.slice();return a[5]=l[o],a}function Ae(n,l,o){const a=n.slice();return a[5]=l[o],a}function Ce(n,l){let o,a=l[5].code+"",_,b,c,p;function f(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=v(a),b=h(),m(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),s(o,_),s(o,b),c||(p=Ne(o,"click",f),c=!0)},p($,P){l=$,P&4&&a!==(a=l[5].code+"")&&I(_,a),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Ee(n,l){let o,a,_,b;return a=new Re({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Se(a.$$.fragment),_=h(),m(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),Be(a,o,null),s(o,_),b=!0},p(c,p){l=c;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!b||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){b||(le(a.$$.fragment,c),b=!0)},o(c){oe(a.$$.fragment,c),b=!1},d(c){c&&u(o),Ue(a)}}}function Qe(n){var he,_e,ke,ve;let l,o,a=n[0].name+"",_,b,c,p,f,$,P,O=n[0].name+"",R,se,ae,K,Q,y,F,E,G,w,W,ne,z,T,ie,J,H=n[0].name+"",V,ce,X,re,Y,de,L,Z,S,x,B,ee,U,te,A,q,g=[],ue=new Map,pe,M,k=[],fe=new Map,C;y=new Ke({props:{js:`
import{S as qe,i as Me,s as De,e as i,w as v,b as h,c as Se,f as m,g as d,h as s,m as Be,x as I,N as Te,P as Oe,k as We,Q as ze,n as He,t as le,a as oe,o as u,d as Ue,T as Le,C as je,p as Ie,r as N,u as Ne,M as Re}from"./index-055843b5.js";import{S as Ke}from"./SdkTabs-1c685373.js";function ye(n,l,o){const a=n.slice();return a[5]=l[o],a}function Ae(n,l,o){const a=n.slice();return a[5]=l[o],a}function Ce(n,l){let o,a=l[5].code+"",_,b,c,p;function f(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=v(a),b=h(),m(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),s(o,_),s(o,b),c||(p=Ne(o,"click",f),c=!0)},p($,P){l=$,P&4&&a!==(a=l[5].code+"")&&I(_,a),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Ee(n,l){let o,a,_,b;return a=new Re({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Se(a.$$.fragment),_=h(),m(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),Be(a,o,null),s(o,_),b=!0},p(c,p){l=c;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!b||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){b||(le(a.$$.fragment,c),b=!0)},o(c){oe(a.$$.fragment,c),b=!1},d(c){c&&u(o),Ue(a)}}}function Qe(n){var he,_e,ke,ve;let l,o,a=n[0].name+"",_,b,c,p,f,$,P,O=n[0].name+"",R,se,ae,K,Q,y,F,E,G,w,W,ne,z,T,ie,J,H=n[0].name+"",V,ce,X,re,Y,de,L,Z,S,x,B,ee,U,te,A,q,g=[],ue=new Map,pe,M,k=[],fe=new Map,C;y=new Ke({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${n[3]}');

118
ui/dist/assets/UpdateApiDocs-9036caca.js vendored Normal file
View File

@ -0,0 +1,118 @@
import{S as $t,i as Ot,s as Mt,C as E,M as St,e as r,w as y,b as m,c as be,f as T,g as a,h as i,m as me,x as U,N as Ne,P as mt,k as qt,Q as Dt,n as Ht,t as de,a as re,o,d as _e,T as Pt,p as Rt,r as ye,u as Lt,y as X}from"./index-055843b5.js";import{S as Ft}from"./SdkTabs-1c685373.js";import{F as At}from"./FieldsQueryParam-815b0ee8.js";function _t(f,t,l){const s=f.slice();return s[7]=t[l],s}function yt(f,t,l){const s=f.slice();return s[7]=t[l],s}function kt(f,t,l){const s=f.slice();return s[12]=t[l],s}function ht(f){let t;return{c(){t=r("p"),t.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",T(t,"class","txt-hint txt-sm txt-right")},m(l,s){a(l,t,s)},d(l){l&&o(t)}}}function vt(f){let t,l,s,b,u,d,p,k,C,w,$,P,F,j,O,g,A;return{c(){t=r("tr"),t.innerHTML='<td colspan="3" class="txt-hint">Auth fields</td>',l=m(),s=r("tr"),s.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>username</span></div></td>
<td><span class="label">String</span></td>
<td>The username of the auth record.</td>`,b=m(),u=r("tr"),u.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>email</span></div></td>
<td><span class="label">String</span></td>
<td>The auth record email address.
<br/>
This field can be updated only by admins or auth records with &quot;Manage&quot; access.
<br/>
Regular accounts can update their email by calling &quot;Request email change&quot;.</td>`,d=m(),p=r("tr"),p.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>emailVisibility</span></div></td>
<td><span class="label">Boolean</span></td>
<td>Whether to show/hide the auth record email when fetching the record data.</td>`,k=m(),C=r("tr"),C.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>oldPassword</span></div></td>
<td><span class="label">String</span></td>
<td>Old auth record password.
<br/>
This field is required only when changing the record password. Admins and auth records with
&quot;Manage&quot; access can skip this field.</td>`,w=m(),$=r("tr"),$.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>password</span></div></td>
<td><span class="label">String</span></td>
<td>New auth record password.</td>`,P=m(),F=r("tr"),F.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>passwordConfirm</span></div></td>
<td><span class="label">String</span></td>
<td>New auth record password confirmation.</td>`,j=m(),O=r("tr"),O.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>verified</span></div></td>
<td><span class="label">Boolean</span></td>
<td>Indicates whether the auth record is verified or not.
<br/>
This field can be set only by admins or auth records with &quot;Manage&quot; access.</td>`,g=m(),A=r("tr"),A.innerHTML='<td colspan="3" class="txt-hint">Schema fields</td>'},m(c,_){a(c,t,_),a(c,l,_),a(c,s,_),a(c,b,_),a(c,u,_),a(c,d,_),a(c,p,_),a(c,k,_),a(c,C,_),a(c,w,_),a(c,$,_),a(c,P,_),a(c,F,_),a(c,j,_),a(c,O,_),a(c,g,_),a(c,A,_)},d(c){c&&o(t),c&&o(l),c&&o(s),c&&o(b),c&&o(u),c&&o(d),c&&o(p),c&&o(k),c&&o(C),c&&o(w),c&&o($),c&&o(P),c&&o(F),c&&o(j),c&&o(O),c&&o(g),c&&o(A)}}}function Bt(f){let t;return{c(){t=r("span"),t.textContent="Optional",T(t,"class","label label-warning")},m(l,s){a(l,t,s)},d(l){l&&o(t)}}}function Nt(f){let t;return{c(){t=r("span"),t.textContent="Required",T(t,"class","label label-success")},m(l,s){a(l,t,s)},d(l){l&&o(t)}}}function jt(f){var u;let t,l=((u=f[12].options)==null?void 0:u.maxSelect)>1?"ids":"id",s,b;return{c(){t=y("User "),s=y(l),b=y(".")},m(d,p){a(d,t,p),a(d,s,p),a(d,b,p)},p(d,p){var k;p&1&&l!==(l=((k=d[12].options)==null?void 0:k.maxSelect)>1?"ids":"id")&&U(s,l)},d(d){d&&o(t),d&&o(s),d&&o(b)}}}function gt(f){var u;let t,l=((u=f[12].options)==null?void 0:u.maxSelect)>1?"ids":"id",s,b;return{c(){t=y("Relation record "),s=y(l),b=y(".")},m(d,p){a(d,t,p),a(d,s,p),a(d,b,p)},p(d,p){var k;p&1&&l!==(l=((k=d[12].options)==null?void 0:k.maxSelect)>1?"ids":"id")&&U(s,l)},d(d){d&&o(t),d&&o(s),d&&o(b)}}}function Et(f){let t,l,s,b,u;return{c(){t=y("File object."),l=r("br"),s=y(`
Set to `),b=r("code"),b.textContent="null",u=y(" to delete already uploaded file(s).")},m(d,p){a(d,t,p),a(d,l,p),a(d,s,p),a(d,b,p),a(d,u,p)},p:X,d(d){d&&o(t),d&&o(l),d&&o(s),d&&o(b),d&&o(u)}}}function Ut(f){let t;return{c(){t=y("URL address.")},m(l,s){a(l,t,s)},p:X,d(l){l&&o(t)}}}function It(f){let t;return{c(){t=y("Email address.")},m(l,s){a(l,t,s)},p:X,d(l){l&&o(t)}}}function Jt(f){let t;return{c(){t=y("JSON array or object.")},m(l,s){a(l,t,s)},p:X,d(l){l&&o(t)}}}function Vt(f){let t;return{c(){t=y("Number value.")},m(l,s){a(l,t,s)},p:X,d(l){l&&o(t)}}}function xt(f){let t;return{c(){t=y("Plain text value.")},m(l,s){a(l,t,s)},p:X,d(l){l&&o(t)}}}function wt(f,t){let l,s,b,u,d,p=t[12].name+"",k,C,w,$,P=E.getFieldValueType(t[12])+"",F,j,O,g;function A(h,L){return h[12].required?Nt:Bt}let c=A(t),_=c(t);function K(h,L){if(h[12].type==="text")return xt;if(h[12].type==="number")return Vt;if(h[12].type==="json")return Jt;if(h[12].type==="email")return It;if(h[12].type==="url")return Ut;if(h[12].type==="file")return Et;if(h[12].type==="relation")return gt;if(h[12].type==="user")return jt}let R=K(t),S=R&&R(t);return{key:f,first:null,c(){l=r("tr"),s=r("td"),b=r("div"),_.c(),u=m(),d=r("span"),k=y(p),C=m(),w=r("td"),$=r("span"),F=y(P),j=m(),O=r("td"),S&&S.c(),g=m(),T(b,"class","inline-flex"),T($,"class","label"),this.first=l},m(h,L){a(h,l,L),i(l,s),i(s,b),_.m(b,null),i(b,u),i(b,d),i(d,k),i(l,C),i(l,w),i(w,$),i($,F),i(l,j),i(l,O),S&&S.m(O,null),i(l,g)},p(h,L){t=h,c!==(c=A(t))&&(_.d(1),_=c(t),_&&(_.c(),_.m(b,u))),L&1&&p!==(p=t[12].name+"")&&U(k,p),L&1&&P!==(P=E.getFieldValueType(t[12])+"")&&U(F,P),R===(R=K(t))&&S?S.p(t,L):(S&&S.d(1),S=R&&R(t),S&&(S.c(),S.m(O,null)))},d(h){h&&o(l),_.d(),S&&S.d()}}}function Tt(f,t){let l,s=t[7].code+"",b,u,d,p;function k(){return t[6](t[7])}return{key:f,first:null,c(){l=r("button"),b=y(s),u=m(),T(l,"class","tab-item"),ye(l,"active",t[1]===t[7].code),this.first=l},m(C,w){a(C,l,w),i(l,b),i(l,u),d||(p=Lt(l,"click",k),d=!0)},p(C,w){t=C,w&4&&s!==(s=t[7].code+"")&&U(b,s),w&6&&ye(l,"active",t[1]===t[7].code)},d(C){C&&o(l),d=!1,p()}}}function Ct(f,t){let l,s,b,u;return s=new St({props:{content:t[7].body}}),{key:f,first:null,c(){l=r("div"),be(s.$$.fragment),b=m(),T(l,"class","tab-item"),ye(l,"active",t[1]===t[7].code),this.first=l},m(d,p){a(d,l,p),me(s,l,null),i(l,b),u=!0},p(d,p){t=d;const k={};p&4&&(k.content=t[7].body),s.$set(k),(!u||p&6)&&ye(l,"active",t[1]===t[7].code)},i(d){u||(de(s.$$.fragment,d),u=!0)},o(d){re(s.$$.fragment,d),u=!1},d(d){d&&o(l),_e(s)}}}function Qt(f){var ot,dt,rt,ft;let t,l,s=f[0].name+"",b,u,d,p,k,C,w,$=f[0].name+"",P,F,j,O,g,A,c,_,K,R,S,h,L,je,fe,W,ge,ke,pe=f[0].name+"",he,Ee,ve,Ue,we,Z,Te,ee,Ce,te,Se,I,$e,Ie,J,Oe,B=[],Je=new Map,Me,le,qe,V,De,Ve,se,x,He,xe,Pe,Qe,M,ze,Y,Ke,We,Ye,Re,Ge,Le,Xe,Fe,Ze,et,G,Ae,ne,Be,Q,ie,N=[],tt=new Map,lt,ae,q=[],st=new Map,z;_=new Ft({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${f[4]}');
...
// example update data
const data = ${JSON.stringify(Object.assign({},f[3],E.dummyCollectionSchemaData(f[0])),null,4)};
const record = await pb.collection('${(ot=f[0])==null?void 0:ot.name}').update('RECORD_ID', data);
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${f[4]}');
...
// example update body
final body = <String, dynamic>${JSON.stringify(Object.assign({},f[3],E.dummyCollectionSchemaData(f[0])),null,2)};
final record = await pb.collection('${(dt=f[0])==null?void 0:dt.name}').update('RECORD_ID', body: body);
`}});let D=f[5]&&ht(),H=((rt=f[0])==null?void 0:rt.isAuth)&&vt(),ce=(ft=f[0])==null?void 0:ft.schema;const nt=e=>e[12].name;for(let e=0;e<ce.length;e+=1){let n=kt(f,ce,e),v=nt(n);Je.set(v,B[e]=wt(v,n))}Y=new St({props:{content:"?expand=relField1,relField2.subRelField21"}}),G=new At({});let ue=f[2];const it=e=>e[7].code;for(let e=0;e<ue.length;e+=1){let n=yt(f,ue,e),v=it(n);tt.set(v,N[e]=Tt(v,n))}let oe=f[2];const at=e=>e[7].code;for(let e=0;e<oe.length;e+=1){let n=_t(f,oe,e),v=at(n);st.set(v,q[e]=Ct(v,n))}return{c(){t=r("h3"),l=y("Update ("),b=y(s),u=y(")"),d=m(),p=r("div"),k=r("p"),C=y("Update a single "),w=r("strong"),P=y($),F=y(" record."),j=m(),O=r("p"),O.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,g=m(),A=r("p"),A.innerHTML=`File upload is supported only via <code>multipart/form-data</code>.
<br/>
For more info and examples you could check the detailed
<a href="https://pocketbase.io/docs/files-handling/" target="_blank" rel="noopener noreferrer">Files upload and handling docs
</a>.`,c=m(),be(_.$$.fragment),K=m(),R=r("h6"),R.textContent="API details",S=m(),h=r("div"),L=r("strong"),L.textContent="PATCH",je=m(),fe=r("div"),W=r("p"),ge=y("/api/collections/"),ke=r("strong"),he=y(pe),Ee=y("/records/"),ve=r("strong"),ve.textContent=":id",Ue=m(),D&&D.c(),we=m(),Z=r("div"),Z.textContent="Path parameters",Te=m(),ee=r("table"),ee.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to update.</td></tr></tbody>`,Ce=m(),te=r("div"),te.textContent="Body Parameters",Se=m(),I=r("table"),$e=r("thead"),$e.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,Ie=m(),J=r("tbody"),H&&H.c(),Oe=m();for(let e=0;e<B.length;e+=1)B[e].c();Me=m(),le=r("div"),le.textContent="Query parameters",qe=m(),V=r("table"),De=r("thead"),De.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,Ve=m(),se=r("tbody"),x=r("tr"),He=r("td"),He.textContent="expand",xe=m(),Pe=r("td"),Pe.innerHTML='<span class="label">String</span>',Qe=m(),M=r("td"),ze=y(`Auto expand relations when returning the updated record. Ex.:
`),be(Y.$$.fragment),Ke=y(`
Supports up to 6-levels depth nested relations expansion. `),We=r("br"),Ye=y(`
The expanded relations will be appended to the record under the
`),Re=r("code"),Re.textContent="expand",Ge=y(" property (eg. "),Le=r("code"),Le.textContent='"expand": {"relField1": {...}, ...}',Xe=y(`). Only
the relations that the user has permissions to `),Fe=r("strong"),Fe.textContent="view",Ze=y(" will be expanded."),et=m(),be(G.$$.fragment),Ae=m(),ne=r("div"),ne.textContent="Responses",Be=m(),Q=r("div"),ie=r("div");for(let e=0;e<N.length;e+=1)N[e].c();lt=m(),ae=r("div");for(let e=0;e<q.length;e+=1)q[e].c();T(t,"class","m-b-sm"),T(p,"class","content txt-lg m-b-sm"),T(R,"class","m-b-xs"),T(L,"class","label label-primary"),T(fe,"class","content"),T(h,"class","alert alert-warning"),T(Z,"class","section-title"),T(ee,"class","table-compact table-border m-b-base"),T(te,"class","section-title"),T(I,"class","table-compact table-border m-b-base"),T(le,"class","section-title"),T(V,"class","table-compact table-border m-b-lg"),T(ne,"class","section-title"),T(ie,"class","tabs-header compact left"),T(ae,"class","tabs-content"),T(Q,"class","tabs")},m(e,n){a(e,t,n),i(t,l),i(t,b),i(t,u),a(e,d,n),a(e,p,n),i(p,k),i(k,C),i(k,w),i(w,P),i(k,F),i(p,j),i(p,O),i(p,g),i(p,A),a(e,c,n),me(_,e,n),a(e,K,n),a(e,R,n),a(e,S,n),a(e,h,n),i(h,L),i(h,je),i(h,fe),i(fe,W),i(W,ge),i(W,ke),i(ke,he),i(W,Ee),i(W,ve),i(h,Ue),D&&D.m(h,null),a(e,we,n),a(e,Z,n),a(e,Te,n),a(e,ee,n),a(e,Ce,n),a(e,te,n),a(e,Se,n),a(e,I,n),i(I,$e),i(I,Ie),i(I,J),H&&H.m(J,null),i(J,Oe);for(let v=0;v<B.length;v+=1)B[v]&&B[v].m(J,null);a(e,Me,n),a(e,le,n),a(e,qe,n),a(e,V,n),i(V,De),i(V,Ve),i(V,se),i(se,x),i(x,He),i(x,xe),i(x,Pe),i(x,Qe),i(x,M),i(M,ze),me(Y,M,null),i(M,Ke),i(M,We),i(M,Ye),i(M,Re),i(M,Ge),i(M,Le),i(M,Xe),i(M,Fe),i(M,Ze),i(se,et),me(G,se,null),a(e,Ae,n),a(e,ne,n),a(e,Be,n),a(e,Q,n),i(Q,ie);for(let v=0;v<N.length;v+=1)N[v]&&N[v].m(ie,null);i(Q,lt),i(Q,ae);for(let v=0;v<q.length;v+=1)q[v]&&q[v].m(ae,null);z=!0},p(e,[n]){var pt,ct,ut,bt;(!z||n&1)&&s!==(s=e[0].name+"")&&U(b,s),(!z||n&1)&&$!==($=e[0].name+"")&&U(P,$);const v={};n&25&&(v.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[4]}');
...
// example update data
const data = ${JSON.stringify(Object.assign({},e[3],E.dummyCollectionSchemaData(e[0])),null,4)};
const record = await pb.collection('${(pt=e[0])==null?void 0:pt.name}').update('RECORD_ID', data);
`),n&25&&(v.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[4]}');
...
// example update body
final body = <String, dynamic>${JSON.stringify(Object.assign({},e[3],E.dummyCollectionSchemaData(e[0])),null,2)};
final record = await pb.collection('${(ct=e[0])==null?void 0:ct.name}').update('RECORD_ID', body: body);
`),_.$set(v),(!z||n&1)&&pe!==(pe=e[0].name+"")&&U(he,pe),e[5]?D||(D=ht(),D.c(),D.m(h,null)):D&&(D.d(1),D=null),(ut=e[0])!=null&&ut.isAuth?H||(H=vt(),H.c(),H.m(J,Oe)):H&&(H.d(1),H=null),n&1&&(ce=(bt=e[0])==null?void 0:bt.schema,B=Ne(B,n,nt,1,e,ce,Je,J,mt,wt,null,kt)),n&6&&(ue=e[2],N=Ne(N,n,it,1,e,ue,tt,ie,mt,Tt,null,yt)),n&6&&(oe=e[2],qt(),q=Ne(q,n,at,1,e,oe,st,ae,Dt,Ct,null,_t),Ht())},i(e){if(!z){de(_.$$.fragment,e),de(Y.$$.fragment,e),de(G.$$.fragment,e);for(let n=0;n<oe.length;n+=1)de(q[n]);z=!0}},o(e){re(_.$$.fragment,e),re(Y.$$.fragment,e),re(G.$$.fragment,e);for(let n=0;n<q.length;n+=1)re(q[n]);z=!1},d(e){e&&o(t),e&&o(d),e&&o(p),e&&o(c),_e(_,e),e&&o(K),e&&o(R),e&&o(S),e&&o(h),D&&D.d(),e&&o(we),e&&o(Z),e&&o(Te),e&&o(ee),e&&o(Ce),e&&o(te),e&&o(Se),e&&o(I),H&&H.d();for(let n=0;n<B.length;n+=1)B[n].d();e&&o(Me),e&&o(le),e&&o(qe),e&&o(V),_e(Y),_e(G),e&&o(Ae),e&&o(ne),e&&o(Be),e&&o(Q);for(let n=0;n<N.length;n+=1)N[n].d();for(let n=0;n<q.length;n+=1)q[n].d()}}}function zt(f,t,l){let s,b,{collection:u=new Pt}=t,d=200,p=[],k={};const C=w=>l(1,d=w.code);return f.$$set=w=>{"collection"in w&&l(0,u=w.collection)},f.$$.update=()=>{var w,$;f.$$.dirty&1&&l(5,s=(u==null?void 0:u.updateRule)===null),f.$$.dirty&1&&l(2,p=[{code:200,body:JSON.stringify(E.dummyCollectionRecord(u),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to update record.",
"data": {
"${($=(w=u==null?void 0:u.schema)==null?void 0:w[0])==null?void 0:$.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`},{code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}]),f.$$.dirty&1&&(u.$isAuth?l(3,k={username:"test_username_update",emailVisibility:!1,password:"87654321",passwordConfirm:"87654321",oldPassword:"12345678"}):l(3,k={}))},l(4,b=E.getApiExampleUrl(Rt.baseUrl)),[u,d,p,k,b,s,C]}class Gt extends $t{constructor(t){super(),Ot(this,t,zt,Qt,Mt,{collection:0})}}export{Gt as default};

View File

@ -1,118 +0,0 @@
import{S as Ct,i as St,s as Ot,C as U,M as Tt,e as r,w as y,b as m,c as Ae,f as T,g as a,h as i,m as Be,x as I,N as Pe,P as ut,k as Mt,Q as $t,n as qt,t as fe,a as pe,o,d as Fe,T as Dt,p as Ht,r as ce,u as Rt,y as G}from"./index-69e255fe.js";import{S as Lt}from"./SdkTabs-5df68e34.js";function bt(f,t,l){const s=f.slice();return s[7]=t[l],s}function mt(f,t,l){const s=f.slice();return s[7]=t[l],s}function _t(f,t,l){const s=f.slice();return s[12]=t[l],s}function yt(f){let t;return{c(){t=r("p"),t.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",T(t,"class","txt-hint txt-sm txt-right")},m(l,s){a(l,t,s)},d(l){l&&o(t)}}}function kt(f){let t,l,s,b,u,d,p,k,C,w,O,R,A,j,M,E,B;return{c(){t=r("tr"),t.innerHTML='<td colspan="3" class="txt-hint">Auth fields</td>',l=m(),s=r("tr"),s.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>username</span></div></td>
<td><span class="label">String</span></td>
<td>The username of the auth record.</td>`,b=m(),u=r("tr"),u.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>email</span></div></td>
<td><span class="label">String</span></td>
<td>The auth record email address.
<br/>
This field can be updated only by admins or auth records with &quot;Manage&quot; access.
<br/>
Regular accounts can update their email by calling &quot;Request email change&quot;.</td>`,d=m(),p=r("tr"),p.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>emailVisibility</span></div></td>
<td><span class="label">Boolean</span></td>
<td>Whether to show/hide the auth record email when fetching the record data.</td>`,k=m(),C=r("tr"),C.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>oldPassword</span></div></td>
<td><span class="label">String</span></td>
<td>Old auth record password.
<br/>
This field is required only when changing the record password. Admins and auth records with
&quot;Manage&quot; access can skip this field.</td>`,w=m(),O=r("tr"),O.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>password</span></div></td>
<td><span class="label">String</span></td>
<td>New auth record password.</td>`,R=m(),A=r("tr"),A.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>passwordConfirm</span></div></td>
<td><span class="label">String</span></td>
<td>New auth record password confirmation.</td>`,j=m(),M=r("tr"),M.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>verified</span></div></td>
<td><span class="label">Boolean</span></td>
<td>Indicates whether the auth record is verified or not.
<br/>
This field can be set only by admins or auth records with &quot;Manage&quot; access.</td>`,E=m(),B=r("tr"),B.innerHTML='<td colspan="3" class="txt-hint">Schema fields</td>'},m(c,_){a(c,t,_),a(c,l,_),a(c,s,_),a(c,b,_),a(c,u,_),a(c,d,_),a(c,p,_),a(c,k,_),a(c,C,_),a(c,w,_),a(c,O,_),a(c,R,_),a(c,A,_),a(c,j,_),a(c,M,_),a(c,E,_),a(c,B,_)},d(c){c&&o(t),c&&o(l),c&&o(s),c&&o(b),c&&o(u),c&&o(d),c&&o(p),c&&o(k),c&&o(C),c&&o(w),c&&o(O),c&&o(R),c&&o(A),c&&o(j),c&&o(M),c&&o(E),c&&o(B)}}}function Pt(f){let t;return{c(){t=r("span"),t.textContent="Optional",T(t,"class","label label-warning")},m(l,s){a(l,t,s)},d(l){l&&o(t)}}}function At(f){let t;return{c(){t=r("span"),t.textContent="Required",T(t,"class","label label-success")},m(l,s){a(l,t,s)},d(l){l&&o(t)}}}function Bt(f){var u;let t,l=((u=f[12].options)==null?void 0:u.maxSelect)>1?"ids":"id",s,b;return{c(){t=y("User "),s=y(l),b=y(".")},m(d,p){a(d,t,p),a(d,s,p),a(d,b,p)},p(d,p){var k;p&1&&l!==(l=((k=d[12].options)==null?void 0:k.maxSelect)>1?"ids":"id")&&I(s,l)},d(d){d&&o(t),d&&o(s),d&&o(b)}}}function Ft(f){var u;let t,l=((u=f[12].options)==null?void 0:u.maxSelect)>1?"ids":"id",s,b;return{c(){t=y("Relation record "),s=y(l),b=y(".")},m(d,p){a(d,t,p),a(d,s,p),a(d,b,p)},p(d,p){var k;p&1&&l!==(l=((k=d[12].options)==null?void 0:k.maxSelect)>1?"ids":"id")&&I(s,l)},d(d){d&&o(t),d&&o(s),d&&o(b)}}}function Nt(f){let t,l,s,b,u;return{c(){t=y("File object."),l=r("br"),s=y(`
Set to `),b=r("code"),b.textContent="null",u=y(" to delete already uploaded file(s).")},m(d,p){a(d,t,p),a(d,l,p),a(d,s,p),a(d,b,p),a(d,u,p)},p:G,d(d){d&&o(t),d&&o(l),d&&o(s),d&&o(b),d&&o(u)}}}function jt(f){let t;return{c(){t=y("URL address.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function Et(f){let t;return{c(){t=y("Email address.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function Ut(f){let t;return{c(){t=y("JSON array or object.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function It(f){let t;return{c(){t=y("Number value.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function Jt(f){let t;return{c(){t=y("Plain text value.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function ht(f,t){let l,s,b,u,d,p=t[12].name+"",k,C,w,O,R=U.getFieldValueType(t[12])+"",A,j,M,E;function B(h,P){return h[12].required?At:Pt}let c=B(t),_=c(t);function K(h,P){if(h[12].type==="text")return Jt;if(h[12].type==="number")return It;if(h[12].type==="json")return Ut;if(h[12].type==="email")return Et;if(h[12].type==="url")return jt;if(h[12].type==="file")return Nt;if(h[12].type==="relation")return Ft;if(h[12].type==="user")return Bt}let L=K(t),S=L&&L(t);return{key:f,first:null,c(){l=r("tr"),s=r("td"),b=r("div"),_.c(),u=m(),d=r("span"),k=y(p),C=m(),w=r("td"),O=r("span"),A=y(R),j=m(),M=r("td"),S&&S.c(),E=m(),T(b,"class","inline-flex"),T(O,"class","label"),this.first=l},m(h,P){a(h,l,P),i(l,s),i(s,b),_.m(b,null),i(b,u),i(b,d),i(d,k),i(l,C),i(l,w),i(w,O),i(O,A),i(l,j),i(l,M),S&&S.m(M,null),i(l,E)},p(h,P){t=h,c!==(c=B(t))&&(_.d(1),_=c(t),_&&(_.c(),_.m(b,u))),P&1&&p!==(p=t[12].name+"")&&I(k,p),P&1&&R!==(R=U.getFieldValueType(t[12])+"")&&I(A,R),L===(L=K(t))&&S?S.p(t,P):(S&&S.d(1),S=L&&L(t),S&&(S.c(),S.m(M,null)))},d(h){h&&o(l),_.d(),S&&S.d()}}}function vt(f,t){let l,s=t[7].code+"",b,u,d,p;function k(){return t[6](t[7])}return{key:f,first:null,c(){l=r("button"),b=y(s),u=m(),T(l,"class","tab-item"),ce(l,"active",t[1]===t[7].code),this.first=l},m(C,w){a(C,l,w),i(l,b),i(l,u),d||(p=Rt(l,"click",k),d=!0)},p(C,w){t=C,w&4&&s!==(s=t[7].code+"")&&I(b,s),w&6&&ce(l,"active",t[1]===t[7].code)},d(C){C&&o(l),d=!1,p()}}}function wt(f,t){let l,s,b,u;return s=new Tt({props:{content:t[7].body}}),{key:f,first:null,c(){l=r("div"),Ae(s.$$.fragment),b=m(),T(l,"class","tab-item"),ce(l,"active",t[1]===t[7].code),this.first=l},m(d,p){a(d,l,p),Be(s,l,null),i(l,b),u=!0},p(d,p){t=d;const k={};p&4&&(k.content=t[7].body),s.$set(k),(!u||p&6)&&ce(l,"active",t[1]===t[7].code)},i(d){u||(fe(s.$$.fragment,d),u=!0)},o(d){pe(s.$$.fragment,d),u=!1},d(d){d&&o(l),Fe(s)}}}function gt(f){var it,at,ot,dt;let t,l,s=f[0].name+"",b,u,d,p,k,C,w,O=f[0].name+"",R,A,j,M,E,B,c,_,K,L,S,h,P,Ne,ae,W,je,ue,oe=f[0].name+"",be,Ee,me,Ue,_e,X,ye,Z,ke,ee,he,J,ve,Ie,g,we,F=[],Je=new Map,Te,te,Ce,V,Se,ge,Oe,x,Me,Ve,$e,xe,$,Qe,Y,ze,Ke,We,qe,Ye,De,Ge,He,Xe,Re,le,Le,Q,se,N=[],Ze=new Map,et,ne,q=[],tt=new Map,z;_=new Lt({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${f[4]}');
...
// example update data
const data = ${JSON.stringify(Object.assign({},f[3],U.dummyCollectionSchemaData(f[0])),null,4)};
const record = await pb.collection('${(it=f[0])==null?void 0:it.name}').update('RECORD_ID', data);
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${f[4]}');
...
// example update body
final body = <String, dynamic>${JSON.stringify(Object.assign({},f[3],U.dummyCollectionSchemaData(f[0])),null,2)};
final record = await pb.collection('${(at=f[0])==null?void 0:at.name}').update('RECORD_ID', body: body);
`}});let D=f[5]&&yt(),H=((ot=f[0])==null?void 0:ot.isAuth)&&kt(),de=(dt=f[0])==null?void 0:dt.schema;const lt=e=>e[12].name;for(let e=0;e<de.length;e+=1){let n=_t(f,de,e),v=lt(n);Je.set(v,F[e]=ht(v,n))}Y=new Tt({props:{content:"?expand=relField1,relField2.subRelField21"}});let re=f[2];const st=e=>e[7].code;for(let e=0;e<re.length;e+=1){let n=mt(f,re,e),v=st(n);Ze.set(v,N[e]=vt(v,n))}let ie=f[2];const nt=e=>e[7].code;for(let e=0;e<ie.length;e+=1){let n=bt(f,ie,e),v=nt(n);tt.set(v,q[e]=wt(v,n))}return{c(){t=r("h3"),l=y("Update ("),b=y(s),u=y(")"),d=m(),p=r("div"),k=r("p"),C=y("Update a single "),w=r("strong"),R=y(O),A=y(" record."),j=m(),M=r("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,E=m(),B=r("p"),B.innerHTML=`File upload is supported only via <code>multipart/form-data</code>.
<br/>
For more info and examples you could check the detailed
<a href="https://pocketbase.io/docs/files-handling/" target="_blank" rel="noopener noreferrer">Files upload and handling docs
</a>.`,c=m(),Ae(_.$$.fragment),K=m(),L=r("h6"),L.textContent="API details",S=m(),h=r("div"),P=r("strong"),P.textContent="PATCH",Ne=m(),ae=r("div"),W=r("p"),je=y("/api/collections/"),ue=r("strong"),be=y(oe),Ee=y("/records/"),me=r("strong"),me.textContent=":id",Ue=m(),D&&D.c(),_e=m(),X=r("div"),X.textContent="Path parameters",ye=m(),Z=r("table"),Z.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to update.</td></tr></tbody>`,ke=m(),ee=r("div"),ee.textContent="Body Parameters",he=m(),J=r("table"),ve=r("thead"),ve.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,Ie=m(),g=r("tbody"),H&&H.c(),we=m();for(let e=0;e<F.length;e+=1)F[e].c();Te=m(),te=r("div"),te.textContent="Query parameters",Ce=m(),V=r("table"),Se=r("thead"),Se.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,ge=m(),Oe=r("tbody"),x=r("tr"),Me=r("td"),Me.textContent="expand",Ve=m(),$e=r("td"),$e.innerHTML='<span class="label">String</span>',xe=m(),$=r("td"),Qe=y(`Auto expand relations when returning the updated record. Ex.:
`),Ae(Y.$$.fragment),ze=y(`
Supports up to 6-levels depth nested relations expansion. `),Ke=r("br"),We=y(`
The expanded relations will be appended to the record under the
`),qe=r("code"),qe.textContent="expand",Ye=y(" property (eg. "),De=r("code"),De.textContent='"expand": {"relField1": {...}, ...}',Ge=y(`). Only
the relations that the user has permissions to `),He=r("strong"),He.textContent="view",Xe=y(" will be expanded."),Re=m(),le=r("div"),le.textContent="Responses",Le=m(),Q=r("div"),se=r("div");for(let e=0;e<N.length;e+=1)N[e].c();et=m(),ne=r("div");for(let e=0;e<q.length;e+=1)q[e].c();T(t,"class","m-b-sm"),T(p,"class","content txt-lg m-b-sm"),T(L,"class","m-b-xs"),T(P,"class","label label-primary"),T(ae,"class","content"),T(h,"class","alert alert-warning"),T(X,"class","section-title"),T(Z,"class","table-compact table-border m-b-base"),T(ee,"class","section-title"),T(J,"class","table-compact table-border m-b-base"),T(te,"class","section-title"),T(V,"class","table-compact table-border m-b-lg"),T(le,"class","section-title"),T(se,"class","tabs-header compact left"),T(ne,"class","tabs-content"),T(Q,"class","tabs")},m(e,n){a(e,t,n),i(t,l),i(t,b),i(t,u),a(e,d,n),a(e,p,n),i(p,k),i(k,C),i(k,w),i(w,R),i(k,A),i(p,j),i(p,M),i(p,E),i(p,B),a(e,c,n),Be(_,e,n),a(e,K,n),a(e,L,n),a(e,S,n),a(e,h,n),i(h,P),i(h,Ne),i(h,ae),i(ae,W),i(W,je),i(W,ue),i(ue,be),i(W,Ee),i(W,me),i(h,Ue),D&&D.m(h,null),a(e,_e,n),a(e,X,n),a(e,ye,n),a(e,Z,n),a(e,ke,n),a(e,ee,n),a(e,he,n),a(e,J,n),i(J,ve),i(J,Ie),i(J,g),H&&H.m(g,null),i(g,we);for(let v=0;v<F.length;v+=1)F[v]&&F[v].m(g,null);a(e,Te,n),a(e,te,n),a(e,Ce,n),a(e,V,n),i(V,Se),i(V,ge),i(V,Oe),i(Oe,x),i(x,Me),i(x,Ve),i(x,$e),i(x,xe),i(x,$),i($,Qe),Be(Y,$,null),i($,ze),i($,Ke),i($,We),i($,qe),i($,Ye),i($,De),i($,Ge),i($,He),i($,Xe),a(e,Re,n),a(e,le,n),a(e,Le,n),a(e,Q,n),i(Q,se);for(let v=0;v<N.length;v+=1)N[v]&&N[v].m(se,null);i(Q,et),i(Q,ne);for(let v=0;v<q.length;v+=1)q[v]&&q[v].m(ne,null);z=!0},p(e,[n]){var rt,ft,pt,ct;(!z||n&1)&&s!==(s=e[0].name+"")&&I(b,s),(!z||n&1)&&O!==(O=e[0].name+"")&&I(R,O);const v={};n&25&&(v.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[4]}');
...
// example update data
const data = ${JSON.stringify(Object.assign({},e[3],U.dummyCollectionSchemaData(e[0])),null,4)};
const record = await pb.collection('${(rt=e[0])==null?void 0:rt.name}').update('RECORD_ID', data);
`),n&25&&(v.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[4]}');
...
// example update body
final body = <String, dynamic>${JSON.stringify(Object.assign({},e[3],U.dummyCollectionSchemaData(e[0])),null,2)};
final record = await pb.collection('${(ft=e[0])==null?void 0:ft.name}').update('RECORD_ID', body: body);
`),_.$set(v),(!z||n&1)&&oe!==(oe=e[0].name+"")&&I(be,oe),e[5]?D||(D=yt(),D.c(),D.m(h,null)):D&&(D.d(1),D=null),(pt=e[0])!=null&&pt.isAuth?H||(H=kt(),H.c(),H.m(g,we)):H&&(H.d(1),H=null),n&1&&(de=(ct=e[0])==null?void 0:ct.schema,F=Pe(F,n,lt,1,e,de,Je,g,ut,ht,null,_t)),n&6&&(re=e[2],N=Pe(N,n,st,1,e,re,Ze,se,ut,vt,null,mt)),n&6&&(ie=e[2],Mt(),q=Pe(q,n,nt,1,e,ie,tt,ne,$t,wt,null,bt),qt())},i(e){if(!z){fe(_.$$.fragment,e),fe(Y.$$.fragment,e);for(let n=0;n<ie.length;n+=1)fe(q[n]);z=!0}},o(e){pe(_.$$.fragment,e),pe(Y.$$.fragment,e);for(let n=0;n<q.length;n+=1)pe(q[n]);z=!1},d(e){e&&o(t),e&&o(d),e&&o(p),e&&o(c),Fe(_,e),e&&o(K),e&&o(L),e&&o(S),e&&o(h),D&&D.d(),e&&o(_e),e&&o(X),e&&o(ye),e&&o(Z),e&&o(ke),e&&o(ee),e&&o(he),e&&o(J),H&&H.d();for(let n=0;n<F.length;n+=1)F[n].d();e&&o(Te),e&&o(te),e&&o(Ce),e&&o(V),Fe(Y),e&&o(Re),e&&o(le),e&&o(Le),e&&o(Q);for(let n=0;n<N.length;n+=1)N[n].d();for(let n=0;n<q.length;n+=1)q[n].d()}}}function Vt(f,t,l){let s,b,{collection:u=new Dt}=t,d=200,p=[],k={};const C=w=>l(1,d=w.code);return f.$$set=w=>{"collection"in w&&l(0,u=w.collection)},f.$$.update=()=>{var w,O;f.$$.dirty&1&&l(5,s=(u==null?void 0:u.updateRule)===null),f.$$.dirty&1&&l(2,p=[{code:200,body:JSON.stringify(U.dummyCollectionRecord(u),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to update record.",
"data": {
"${(O=(w=u==null?void 0:u.schema)==null?void 0:w[0])==null?void 0:O.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`},{code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}]),f.$$.dirty&1&&(u.$isAuth?l(3,k={username:"test_username_update",emailVisibility:!1,password:"87654321",passwordConfirm:"87654321",oldPassword:"12345678"}):l(3,k={}))},l(4,b=U.getApiExampleUrl(Ht.baseUrl)),[u,d,p,k,b,s,C]}class zt extends Ct{constructor(t){super(),St(this,t,Vt,gt,Ot,{collection:0})}}export{zt as default};

66
ui/dist/assets/ViewApiDocs-303351a6.js vendored Normal file
View File

@ -0,0 +1,66 @@
import{S as tt,i as lt,s as st,M as et,e as o,w as b,b as u,c as W,f as _,g as r,h as l,m as X,x as ve,N as Ge,P as nt,k as ot,Q as it,n as at,t as U,a as j,o as d,d as Y,T as rt,C as Je,p as dt,r as Z,u as ct}from"./index-055843b5.js";import{S as ft}from"./SdkTabs-1c685373.js";import{F as pt}from"./FieldsQueryParam-815b0ee8.js";function Ke(i,s,n){const a=i.slice();return a[6]=s[n],a}function We(i,s,n){const a=i.slice();return a[6]=s[n],a}function Xe(i){let s;return{c(){s=o("p"),s.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",_(s,"class","txt-hint txt-sm txt-right")},m(n,a){r(n,s,a)},d(n){n&&d(s)}}}function Ye(i,s){let n,a=s[6].code+"",w,c,f,m;function F(){return s[5](s[6])}return{key:i,first:null,c(){n=o("button"),w=b(a),c=u(),_(n,"class","tab-item"),Z(n,"active",s[2]===s[6].code),this.first=n},m(h,g){r(h,n,g),l(n,w),l(n,c),f||(m=ct(n,"click",F),f=!0)},p(h,g){s=h,g&20&&Z(n,"active",s[2]===s[6].code)},d(h){h&&d(n),f=!1,m()}}}function Ze(i,s){let n,a,w,c;return a=new et({props:{content:s[6].body}}),{key:i,first:null,c(){n=o("div"),W(a.$$.fragment),w=u(),_(n,"class","tab-item"),Z(n,"active",s[2]===s[6].code),this.first=n},m(f,m){r(f,n,m),X(a,n,null),l(n,w),c=!0},p(f,m){s=f,(!c||m&20)&&Z(n,"active",s[2]===s[6].code)},i(f){c||(U(a.$$.fragment,f),c=!0)},o(f){j(a.$$.fragment,f),c=!1},d(f){f&&d(n),Y(a)}}}function ut(i){var Ue,je;let s,n,a=i[0].name+"",w,c,f,m,F,h,g,V=i[0].name+"",ee,$e,te,R,le,M,se,y,z,we,G,E,ye,ne,J=i[0].name+"",oe,Ce,ie,Fe,ae,x,re,A,de,I,ce,O,fe,ge,q,P,pe,Re,ue,Oe,k,Pe,S,Te,De,Ee,me,Se,be,Be,Me,xe,_e,Ae,Ie,B,ke,H,he,T,L,C=[],qe=new Map,He,N,v=[],Le=new Map,D;R=new ft({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${i[3]}');
...
const record = await pb.collection('${(Ue=i[0])==null?void 0:Ue.name}').getOne('RECORD_ID', {
expand: 'relField1,relField2.subRelField',
});
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${i[3]}');
...
final record = await pb.collection('${(je=i[0])==null?void 0:je.name}').getOne('RECORD_ID',
expand: 'relField1,relField2.subRelField',
);
`}});let $=i[1]&&Xe();S=new et({props:{content:"?expand=relField1,relField2.subRelField"}}),B=new pt({});let K=i[4];const Ne=e=>e[6].code;for(let e=0;e<K.length;e+=1){let t=We(i,K,e),p=Ne(t);qe.set(p,C[e]=Ye(p,t))}let Q=i[4];const Qe=e=>e[6].code;for(let e=0;e<Q.length;e+=1){let t=Ke(i,Q,e),p=Qe(t);Le.set(p,v[e]=Ze(p,t))}return{c(){s=o("h3"),n=b("View ("),w=b(a),c=b(")"),f=u(),m=o("div"),F=o("p"),h=b("Fetch a single "),g=o("strong"),ee=b(V),$e=b(" record."),te=u(),W(R.$$.fragment),le=u(),M=o("h6"),M.textContent="API details",se=u(),y=o("div"),z=o("strong"),z.textContent="GET",we=u(),G=o("div"),E=o("p"),ye=b("/api/collections/"),ne=o("strong"),oe=b(J),Ce=b("/records/"),ie=o("strong"),ie.textContent=":id",Fe=u(),$&&$.c(),ae=u(),x=o("div"),x.textContent="Path Parameters",re=u(),A=o("table"),A.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to view.</td></tr></tbody>`,de=u(),I=o("div"),I.textContent="Query parameters",ce=u(),O=o("table"),fe=o("thead"),fe.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,ge=u(),q=o("tbody"),P=o("tr"),pe=o("td"),pe.textContent="expand",Re=u(),ue=o("td"),ue.innerHTML='<span class="label">String</span>',Oe=u(),k=o("td"),Pe=b(`Auto expand record relations. Ex.:
`),W(S.$$.fragment),Te=b(`
Supports up to 6-levels depth nested relations expansion. `),De=o("br"),Ee=b(`
The expanded relations will be appended to the record under the
`),me=o("code"),me.textContent="expand",Se=b(" property (eg. "),be=o("code"),be.textContent='"expand": {"relField1": {...}, ...}',Be=b(`).
`),Me=o("br"),xe=b(`
Only the relations to which the request user has permissions to `),_e=o("strong"),_e.textContent="view",Ae=b(" will be expanded."),Ie=u(),W(B.$$.fragment),ke=u(),H=o("div"),H.textContent="Responses",he=u(),T=o("div"),L=o("div");for(let e=0;e<C.length;e+=1)C[e].c();He=u(),N=o("div");for(let e=0;e<v.length;e+=1)v[e].c();_(s,"class","m-b-sm"),_(m,"class","content txt-lg m-b-sm"),_(M,"class","m-b-xs"),_(z,"class","label label-primary"),_(G,"class","content"),_(y,"class","alert alert-info"),_(x,"class","section-title"),_(A,"class","table-compact table-border m-b-base"),_(I,"class","section-title"),_(O,"class","table-compact table-border m-b-base"),_(H,"class","section-title"),_(L,"class","tabs-header compact left"),_(N,"class","tabs-content"),_(T,"class","tabs")},m(e,t){r(e,s,t),l(s,n),l(s,w),l(s,c),r(e,f,t),r(e,m,t),l(m,F),l(F,h),l(F,g),l(g,ee),l(F,$e),r(e,te,t),X(R,e,t),r(e,le,t),r(e,M,t),r(e,se,t),r(e,y,t),l(y,z),l(y,we),l(y,G),l(G,E),l(E,ye),l(E,ne),l(ne,oe),l(E,Ce),l(E,ie),l(y,Fe),$&&$.m(y,null),r(e,ae,t),r(e,x,t),r(e,re,t),r(e,A,t),r(e,de,t),r(e,I,t),r(e,ce,t),r(e,O,t),l(O,fe),l(O,ge),l(O,q),l(q,P),l(P,pe),l(P,Re),l(P,ue),l(P,Oe),l(P,k),l(k,Pe),X(S,k,null),l(k,Te),l(k,De),l(k,Ee),l(k,me),l(k,Se),l(k,be),l(k,Be),l(k,Me),l(k,xe),l(k,_e),l(k,Ae),l(q,Ie),X(B,q,null),r(e,ke,t),r(e,H,t),r(e,he,t),r(e,T,t),l(T,L);for(let p=0;p<C.length;p+=1)C[p]&&C[p].m(L,null);l(T,He),l(T,N);for(let p=0;p<v.length;p+=1)v[p]&&v[p].m(N,null);D=!0},p(e,[t]){var Ve,ze;(!D||t&1)&&a!==(a=e[0].name+"")&&ve(w,a),(!D||t&1)&&V!==(V=e[0].name+"")&&ve(ee,V);const p={};t&9&&(p.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
...
const record = await pb.collection('${(Ve=e[0])==null?void 0:Ve.name}').getOne('RECORD_ID', {
expand: 'relField1,relField2.subRelField',
});
`),t&9&&(p.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
...
final record = await pb.collection('${(ze=e[0])==null?void 0:ze.name}').getOne('RECORD_ID',
expand: 'relField1,relField2.subRelField',
);
`),R.$set(p),(!D||t&1)&&J!==(J=e[0].name+"")&&ve(oe,J),e[1]?$||($=Xe(),$.c(),$.m(y,null)):$&&($.d(1),$=null),t&20&&(K=e[4],C=Ge(C,t,Ne,1,e,K,qe,L,nt,Ye,null,We)),t&20&&(Q=e[4],ot(),v=Ge(v,t,Qe,1,e,Q,Le,N,it,Ze,null,Ke),at())},i(e){if(!D){U(R.$$.fragment,e),U(S.$$.fragment,e),U(B.$$.fragment,e);for(let t=0;t<Q.length;t+=1)U(v[t]);D=!0}},o(e){j(R.$$.fragment,e),j(S.$$.fragment,e),j(B.$$.fragment,e);for(let t=0;t<v.length;t+=1)j(v[t]);D=!1},d(e){e&&d(s),e&&d(f),e&&d(m),e&&d(te),Y(R,e),e&&d(le),e&&d(M),e&&d(se),e&&d(y),$&&$.d(),e&&d(ae),e&&d(x),e&&d(re),e&&d(A),e&&d(de),e&&d(I),e&&d(ce),e&&d(O),Y(S),Y(B),e&&d(ke),e&&d(H),e&&d(he),e&&d(T);for(let t=0;t<C.length;t+=1)C[t].d();for(let t=0;t<v.length;t+=1)v[t].d()}}}function mt(i,s,n){let a,w,{collection:c=new rt}=s,f=200,m=[];const F=h=>n(2,f=h.code);return i.$$set=h=>{"collection"in h&&n(0,c=h.collection)},i.$$.update=()=>{i.$$.dirty&1&&n(1,a=(c==null?void 0:c.viewRule)===null),i.$$.dirty&3&&c!=null&&c.id&&(m.push({code:200,body:JSON.stringify(Je.dummyCollectionRecord(c),null,2)}),a&&m.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),m.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},n(3,w=Je.getApiExampleUrl(dt.baseUrl)),[c,a,f,w,m,F]}class ht extends tt{constructor(s){super(),lt(this,s,mt,ut,st,{collection:0})}}export{ht as default};

View File

@ -1,66 +0,0 @@
import{S as Ze,i as et,s as tt,M as Ye,e as o,w as m,b as u,c as _e,f as _,g as r,h as l,m as ke,x as me,N as Ve,P as lt,k as st,Q as nt,n as ot,t as z,a as G,o as d,d as he,T as it,C as ze,p as at,r as J,u as rt}from"./index-69e255fe.js";import{S as dt}from"./SdkTabs-5df68e34.js";function Ge(i,s,n){const a=i.slice();return a[6]=s[n],a}function Je(i,s,n){const a=i.slice();return a[6]=s[n],a}function Ke(i){let s;return{c(){s=o("p"),s.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",_(s,"class","txt-hint txt-sm txt-right")},m(n,a){r(n,s,a)},d(n){n&&d(s)}}}function We(i,s){let n,a=s[6].code+"",y,c,f,b;function F(){return s[5](s[6])}return{key:i,first:null,c(){n=o("button"),y=m(a),c=u(),_(n,"class","tab-item"),J(n,"active",s[2]===s[6].code),this.first=n},m(h,R){r(h,n,R),l(n,y),l(n,c),f||(b=rt(n,"click",F),f=!0)},p(h,R){s=h,R&20&&J(n,"active",s[2]===s[6].code)},d(h){h&&d(n),f=!1,b()}}}function Xe(i,s){let n,a,y,c;return a=new Ye({props:{content:s[6].body}}),{key:i,first:null,c(){n=o("div"),_e(a.$$.fragment),y=u(),_(n,"class","tab-item"),J(n,"active",s[2]===s[6].code),this.first=n},m(f,b){r(f,n,b),ke(a,n,null),l(n,y),c=!0},p(f,b){s=f,(!c||b&20)&&J(n,"active",s[2]===s[6].code)},i(f){c||(z(a.$$.fragment,f),c=!0)},o(f){G(a.$$.fragment,f),c=!1},d(f){f&&d(n),he(a)}}}function ct(i){var Ne,Ue;let s,n,a=i[0].name+"",y,c,f,b,F,h,R,N=i[0].name+"",K,ve,W,g,X,B,Y,$,U,we,j,E,ye,Z,Q=i[0].name+"",ee,$e,te,Ce,le,M,se,x,ne,A,oe,O,ie,Fe,ae,T,re,Re,de,ge,k,Oe,S,Te,De,Pe,ce,Ee,fe,Se,Be,Me,pe,xe,ue,I,be,D,H,C=[],Ae=new Map,Ie,q,v=[],He=new Map,P;g=new dt({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${i[3]}');
...
const record = await pb.collection('${(Ne=i[0])==null?void 0:Ne.name}').getOne('RECORD_ID', {
expand: 'relField1,relField2.subRelField',
});
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${i[3]}');
...
final record = await pb.collection('${(Ue=i[0])==null?void 0:Ue.name}').getOne('RECORD_ID',
expand: 'relField1,relField2.subRelField',
);
`}});let w=i[1]&&Ke();S=new Ye({props:{content:"?expand=relField1,relField2.subRelField"}});let V=i[4];const qe=e=>e[6].code;for(let e=0;e<V.length;e+=1){let t=Je(i,V,e),p=qe(t);Ae.set(p,C[e]=We(p,t))}let L=i[4];const Le=e=>e[6].code;for(let e=0;e<L.length;e+=1){let t=Ge(i,L,e),p=Le(t);He.set(p,v[e]=Xe(p,t))}return{c(){s=o("h3"),n=m("View ("),y=m(a),c=m(")"),f=u(),b=o("div"),F=o("p"),h=m("Fetch a single "),R=o("strong"),K=m(N),ve=m(" record."),W=u(),_e(g.$$.fragment),X=u(),B=o("h6"),B.textContent="API details",Y=u(),$=o("div"),U=o("strong"),U.textContent="GET",we=u(),j=o("div"),E=o("p"),ye=m("/api/collections/"),Z=o("strong"),ee=m(Q),$e=m("/records/"),te=o("strong"),te.textContent=":id",Ce=u(),w&&w.c(),le=u(),M=o("div"),M.textContent="Path Parameters",se=u(),x=o("table"),x.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to view.</td></tr></tbody>`,ne=u(),A=o("div"),A.textContent="Query parameters",oe=u(),O=o("table"),ie=o("thead"),ie.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,Fe=u(),ae=o("tbody"),T=o("tr"),re=o("td"),re.textContent="expand",Re=u(),de=o("td"),de.innerHTML='<span class="label">String</span>',ge=u(),k=o("td"),Oe=m(`Auto expand record relations. Ex.:
`),_e(S.$$.fragment),Te=m(`
Supports up to 6-levels depth nested relations expansion. `),De=o("br"),Pe=m(`
The expanded relations will be appended to the record under the
`),ce=o("code"),ce.textContent="expand",Ee=m(" property (eg. "),fe=o("code"),fe.textContent='"expand": {"relField1": {...}, ...}',Se=m(`).
`),Be=o("br"),Me=m(`
Only the relations to which the request user has permissions to `),pe=o("strong"),pe.textContent="view",xe=m(" will be expanded."),ue=u(),I=o("div"),I.textContent="Responses",be=u(),D=o("div"),H=o("div");for(let e=0;e<C.length;e+=1)C[e].c();Ie=u(),q=o("div");for(let e=0;e<v.length;e+=1)v[e].c();_(s,"class","m-b-sm"),_(b,"class","content txt-lg m-b-sm"),_(B,"class","m-b-xs"),_(U,"class","label label-primary"),_(j,"class","content"),_($,"class","alert alert-info"),_(M,"class","section-title"),_(x,"class","table-compact table-border m-b-base"),_(A,"class","section-title"),_(O,"class","table-compact table-border m-b-base"),_(I,"class","section-title"),_(H,"class","tabs-header compact left"),_(q,"class","tabs-content"),_(D,"class","tabs")},m(e,t){r(e,s,t),l(s,n),l(s,y),l(s,c),r(e,f,t),r(e,b,t),l(b,F),l(F,h),l(F,R),l(R,K),l(F,ve),r(e,W,t),ke(g,e,t),r(e,X,t),r(e,B,t),r(e,Y,t),r(e,$,t),l($,U),l($,we),l($,j),l(j,E),l(E,ye),l(E,Z),l(Z,ee),l(E,$e),l(E,te),l($,Ce),w&&w.m($,null),r(e,le,t),r(e,M,t),r(e,se,t),r(e,x,t),r(e,ne,t),r(e,A,t),r(e,oe,t),r(e,O,t),l(O,ie),l(O,Fe),l(O,ae),l(ae,T),l(T,re),l(T,Re),l(T,de),l(T,ge),l(T,k),l(k,Oe),ke(S,k,null),l(k,Te),l(k,De),l(k,Pe),l(k,ce),l(k,Ee),l(k,fe),l(k,Se),l(k,Be),l(k,Me),l(k,pe),l(k,xe),r(e,ue,t),r(e,I,t),r(e,be,t),r(e,D,t),l(D,H);for(let p=0;p<C.length;p+=1)C[p]&&C[p].m(H,null);l(D,Ie),l(D,q);for(let p=0;p<v.length;p+=1)v[p]&&v[p].m(q,null);P=!0},p(e,[t]){var je,Qe;(!P||t&1)&&a!==(a=e[0].name+"")&&me(y,a),(!P||t&1)&&N!==(N=e[0].name+"")&&me(K,N);const p={};t&9&&(p.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
...
const record = await pb.collection('${(je=e[0])==null?void 0:je.name}').getOne('RECORD_ID', {
expand: 'relField1,relField2.subRelField',
});
`),t&9&&(p.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
...
final record = await pb.collection('${(Qe=e[0])==null?void 0:Qe.name}').getOne('RECORD_ID',
expand: 'relField1,relField2.subRelField',
);
`),g.$set(p),(!P||t&1)&&Q!==(Q=e[0].name+"")&&me(ee,Q),e[1]?w||(w=Ke(),w.c(),w.m($,null)):w&&(w.d(1),w=null),t&20&&(V=e[4],C=Ve(C,t,qe,1,e,V,Ae,H,lt,We,null,Je)),t&20&&(L=e[4],st(),v=Ve(v,t,Le,1,e,L,He,q,nt,Xe,null,Ge),ot())},i(e){if(!P){z(g.$$.fragment,e),z(S.$$.fragment,e);for(let t=0;t<L.length;t+=1)z(v[t]);P=!0}},o(e){G(g.$$.fragment,e),G(S.$$.fragment,e);for(let t=0;t<v.length;t+=1)G(v[t]);P=!1},d(e){e&&d(s),e&&d(f),e&&d(b),e&&d(W),he(g,e),e&&d(X),e&&d(B),e&&d(Y),e&&d($),w&&w.d(),e&&d(le),e&&d(M),e&&d(se),e&&d(x),e&&d(ne),e&&d(A),e&&d(oe),e&&d(O),he(S),e&&d(ue),e&&d(I),e&&d(be),e&&d(D);for(let t=0;t<C.length;t+=1)C[t].d();for(let t=0;t<v.length;t+=1)v[t].d()}}}function ft(i,s,n){let a,y,{collection:c=new it}=s,f=200,b=[];const F=h=>n(2,f=h.code);return i.$$set=h=>{"collection"in h&&n(0,c=h.collection)},i.$$.update=()=>{i.$$.dirty&1&&n(1,a=(c==null?void 0:c.viewRule)===null),i.$$.dirty&3&&c!=null&&c.id&&(b.push({code:200,body:JSON.stringify(ze.dummyCollectionRecord(c),null,2)}),a&&b.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),b.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},n(3,y=ze.getApiExampleUrl(at.baseUrl)),[c,a,f,y,b,F]}class bt extends Ze{constructor(s){super(),et(this,s,ft,ct,tt,{collection:0})}}export{bt as default};

File diff suppressed because one or more lines are too long

2
ui/dist/index.html vendored
View File

@ -45,7 +45,7 @@
window.Prism = window.Prism || {};
window.Prism.manual = true;
</script>
<script type="module" crossorigin src="./assets/index-69e255fe.js"></script>
<script type="module" crossorigin src="./assets/index-055843b5.js"></script>
<link rel="stylesheet" href="./assets/index-20683d26.css">
</head>
<body>

View File

@ -4,6 +4,7 @@
import CommonHelper from "@/utils/CommonHelper";
import CodeBlock from "@/components/base/CodeBlock.svelte";
import SdkTabs from "@/components/collections/docs/SdkTabs.svelte";
import FieldsQueryParam from "@/components/collections/docs/FieldsQueryParam.svelte";
export let collection = new Collection();
@ -87,6 +88,20 @@
</div>
</div>
<div class="section-title">Query parameters</div>
<table class="table-compact table-border m-b-base">
<thead>
<tr>
<th>Param</th>
<th>Type</th>
<th width="50%">Description</th>
</tr>
</thead>
<tbody>
<FieldsQueryParam />
</tbody>
</table>
<div class="section-title">Responses</div>
<div class="tabs">
<div class="tabs-header compact left">

View File

@ -4,6 +4,7 @@
import CommonHelper from "@/utils/CommonHelper";
import CodeBlock from "@/components/base/CodeBlock.svelte";
import SdkTabs from "@/components/collections/docs/SdkTabs.svelte";
import FieldsQueryParam from "@/components/collections/docs/FieldsQueryParam.svelte";
export let collection = new Collection();
@ -138,6 +139,7 @@
Only the relations to which the request user has permissions to <strong>view</strong> will be expanded.
</td>
</tr>
<FieldsQueryParam />
</tbody>
</table>

View File

@ -4,6 +4,7 @@
import CommonHelper from "@/utils/CommonHelper";
import CodeBlock from "@/components/base/CodeBlock.svelte";
import SdkTabs from "@/components/collections/docs/SdkTabs.svelte";
import FieldsQueryParam from "@/components/collections/docs/FieldsQueryParam.svelte";
export let collection = new Collection();
@ -234,6 +235,7 @@
Only the relations to which the request user has permissions to <strong>view</strong> will be expanded.
</td>
</tr>
<FieldsQueryParam />
</tbody>
</table>

View File

@ -4,6 +4,7 @@
import CommonHelper from "@/utils/CommonHelper";
import CodeBlock from "@/components/base/CodeBlock.svelte";
import SdkTabs from "@/components/collections/docs/SdkTabs.svelte";
import FieldsQueryParam from "@/components/collections/docs/FieldsQueryParam.svelte";
export let collection = new Collection();
@ -197,6 +198,7 @@
Only the relations to which the request user has permissions to <strong>view</strong> will be expanded.
</td>
</tr>
<FieldsQueryParam />
</tbody>
</table>

View File

@ -4,6 +4,7 @@
import CommonHelper from "@/utils/CommonHelper";
import CodeBlock from "@/components/base/CodeBlock.svelte";
import SdkTabs from "@/components/collections/docs/SdkTabs.svelte";
import FieldsQueryParam from "@/components/collections/docs/FieldsQueryParam.svelte";
export let collection = new Collection();
@ -311,6 +312,7 @@ await pb.collection('${collection?.name}').requestVerification('test@example.com
Only the relations to which the request user has permissions to <strong>view</strong> will be expanded.
</td>
</tr>
<FieldsQueryParam />
</tbody>
</table>

View File

@ -0,0 +1,12 @@
<tr>
<td id="query-page">fields</td>
<td>
<span class="label">String</span>
</td>
<td>
Comma separated string of the fields to return in the JSON response
<em>(by default returns all fields)</em>. For example:
<br>
<code>?fields=id,expand.relField.id,expand.relField.created</code>
</td>
</tr>

View File

@ -210,6 +210,16 @@
Only the relations to which the request user has permissions to <strong>view</strong> will be expanded.
</td>
</tr>
<tr>
<td id="query-page">fields</td>
<td>
<span class="label">String</span>
</td>
<td>
Comma separated string of the fields to return in the JSON response
<em>(by default returns all fields)</em>.
</td>
</tr>
</tbody>
</table>
@ -217,13 +227,14 @@
<div class="tabs">
<div class="tabs-header compact left">
{#each responses as response (response.code)}
<div
<button
type="button"
class="tab-item"
class:active={responseTab === response.code}
on:click={() => (responseTab = response.code)}
>
{response.code}
</div>
</button>
{/each}
</div>
<div class="tabs-content">

View File

@ -4,6 +4,7 @@
import CommonHelper from "@/utils/CommonHelper";
import CodeBlock from "@/components/base/CodeBlock.svelte";
import SdkTabs from "@/components/collections/docs/SdkTabs.svelte";
import FieldsQueryParam from "@/components/collections/docs/FieldsQueryParam.svelte";
export let collection = new Collection();
@ -139,6 +140,20 @@
</tbody>
</table>
<div class="section-title">Query parameters</div>
<table class="table-compact table-border m-b-base">
<thead>
<tr>
<th>Param</th>
<th>Type</th>
<th width="50%">Description</th>
</tr>
</thead>
<tbody>
<FieldsQueryParam />
</tbody>
</table>
<div class="section-title">Responses</div>
<div class="tabs">
<div class="tabs-header compact left">

View File

@ -4,6 +4,7 @@
import CommonHelper from "@/utils/CommonHelper";
import CodeBlock from "@/components/base/CodeBlock.svelte";
import SdkTabs from "@/components/collections/docs/SdkTabs.svelte";
import FieldsQueryParam from "@/components/collections/docs/FieldsQueryParam.svelte";
export let collection = new Collection();
@ -330,6 +331,7 @@ final record = await pb.collection('${collection?.name}').update('RECORD_ID', bo
the relations that the user has permissions to <strong>view</strong> will be expanded.
</td>
</tr>
<FieldsQueryParam />
</tbody>
</table>

View File

@ -4,6 +4,7 @@
import CommonHelper from "@/utils/CommonHelper";
import CodeBlock from "@/components/base/CodeBlock.svelte";
import SdkTabs from "@/components/collections/docs/SdkTabs.svelte";
import FieldsQueryParam from "@/components/collections/docs/FieldsQueryParam.svelte";
export let collection = new Collection();
@ -134,6 +135,7 @@
Only the relations to which the request user has permissions to <strong>view</strong> will be expanded.
</td>
</tr>
<FieldsQueryParam />
</tbody>
</table>