[#976] added optional RelationOptions.DisplayFields and refactored the relation picker UI
This commit is contained in:
+4
-4
@@ -1,4 +1,4 @@
|
||||
import{S as ke,i as be,s as ge,e as r,w as b,b as g,c as _e,f as k,g as h,h as n,m as me,x as G,N as re,O as we,k as ve,P as Ce,n as Pe,t as L,a as Y,o as _,d as pe,Q as Me,C as Se,p as $e,r as H,u as je,M as Ae}from"./index-9ce6aa95.js";import{S as Be}from"./SdkTabs-ccd8881b.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=b(s),f=g(),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=g(),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 Oe(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+"",I,x,E,B,J,S,O,w=[],ee=new Map,te,T,p=[],le=new Map,$;P=new Be({props:{js:`
|
||||
import{S as ke,i as be,s as ge,e as r,w as b,b as g,c as me,f as k,g as h,h as n,m as _e,x as G,O as re,P as we,k as ve,Q as Ce,n as Pe,t as L,a as Y,o as m,d as pe,R as Me,C as Se,p as $e,r as H,u as je,N as Ae}from"./index-e4123b79.js";import{S as Be}from"./SdkTabs-a1061d88.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+"",_,f,i,u;function d(){return l[4](l[5])}return{key:a,first:null,c(){o=r("button"),_=b(s),f=g(),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,_),n(o,f),i||(u=je(o,"click",d),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&G(_,s),C&6&&H(o,"active",l[1]===l[5].code)},d(v){v&&m(o),i=!1,u()}}}function he(a,l){let o,s,_,f;return s=new Ae({props:{content:l[5].body}}),{key:a,first:null,c(){o=r("div"),me(s.$$.fragment),_=g(),k(o,"class","tab-item"),H(o,"active",l[1]===l[5].code),this.first=o},m(i,u){h(i,o,u),_e(s,o,null),n(o,_),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&&m(o),pe(s)}}}function Oe(a){var ae,ne;let l,o,s=a[0].name+"",_,f,i,u,d,v,C,F=a[0].name+"",U,R,q,P,D,j,W,M,K,X,Q,A,Z,V,y=a[0].name+"",E,x,I,B,J,S,O,w=[],ee=new Map,te,T,p=[],le=new Map,$;P=new Be({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${a[3]}');
|
||||
@@ -14,7 +14,7 @@ import{S as ke,i as be,s as ge,e as r,w as b,b as g,c as _e,f as k,g as h,h as n
|
||||
...
|
||||
|
||||
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,w[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=b("List auth methods ("),m=b(s),f=b(")"),i=g(),u=r("div"),d=r("p"),v=b("Returns a public list with all allowed "),C=r("strong"),U=b(F),X=b(" authentication methods."),q=g(),_e(P.$$.fragment),D=g(),j=r("h6"),j.textContent="API details",W=g(),M=r("div"),K=r("strong"),K.textContent="GET",R=g(),Q=r("div"),A=r("p"),Z=b("/api/collections/"),V=r("strong"),I=b(y),x=b("/auth-methods"),E=g(),B=r("div"),B.textContent="Responses",J=g(),S=r("div"),O=r("div");for(let e=0;e<w.length;e+=1)w[e].c();te=g(),T=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(O,"class","tabs-header compact left"),k(T,"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,I),n(A,x),h(e,E,t),h(e,B,t),h(e,J,t),h(e,S,t),n(S,O);for(let c=0;c<w.length;c+=1)w[c].m(O,null);n(S,te),n(S,T);for(let c=0;c<p.length;c+=1)p[c].m(T,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=`
|
||||
`}});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,w[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=b("List auth methods ("),_=b(s),f=b(")"),i=g(),u=r("div"),d=r("p"),v=b("Returns a public list with all allowed "),C=r("strong"),U=b(F),R=b(" authentication methods."),q=g(),me(P.$$.fragment),D=g(),j=r("h6"),j.textContent="API details",W=g(),M=r("div"),K=r("strong"),K.textContent="GET",X=g(),Q=r("div"),A=r("p"),Z=b("/api/collections/"),V=r("strong"),E=b(y),x=b("/auth-methods"),I=g(),B=r("div"),B.textContent="Responses",J=g(),S=r("div"),O=r("div");for(let e=0;e<w.length;e+=1)w[e].c();te=g(),T=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(O,"class","tabs-header compact left"),k(T,"class","tabs-content"),k(S,"class","tabs")},m(e,t){h(e,l,t),n(l,o),n(l,_),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,R),h(e,q,t),_e(P,e,t),h(e,D,t),h(e,j,t),h(e,W,t),h(e,M,t),n(M,K),n(M,X),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,O);for(let c=0;c<w.length;c+=1)w[c].m(O,null);n(S,te),n(S,T);for(let c=0;c<p.length;c+=1)p[c].m(T,null);$=!0},p(e,[t]){var ie,ce;(!$||t&1)&&s!==(s=e[0].name+"")&&G(_,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]}');
|
||||
@@ -30,7 +30,7 @@ import{S as ke,i as be,s as ge,e as r,w as b,b as g,c as _e,f as k,g as h,h as n
|
||||
...
|
||||
|
||||
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(I,y),t&6&&(z=e[2],w=re(w,t,oe,1,e,z,ee,O,we,fe,null,de)),t&6&&(N=e[2],ve(),p=re(p,t,se,1,e,N,le,T,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&&_(E),e&&_(B),e&&_(J),e&&_(S);for(let t=0;t<w.length;t+=1)w[t].d();for(let t=0;t<p.length;t+=1)p[t].d()}}}function Te(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:`
|
||||
`),P.$set(c),(!$||t&1)&&y!==(y=e[0].name+"")&&G(E,y),t&6&&(z=e[2],w=re(w,t,oe,1,e,z,ee,O,we,fe,null,de)),t&6&&(N=e[2],ve(),p=re(p,t,se,1,e,N,le,T,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&&m(l),e&&m(i),e&&m(u),e&&m(q),pe(P,e),e&&m(D),e&&m(j),e&&m(W),e&&m(M),e&&m(I),e&&m(B),e&&m(J),e&&m(S);for(let t=0;t<w.length;t+=1)w[t].d();for(let t=0;t<p.length;t+=1)p[t].d()}}}function Te(a,l,o){let s,{collection:_=new Me}=l,f=200,i=[];const u=d=>o(1,f=d.code);return a.$$set=d=>{"collection"in d&&o(0,_=d.collection)},o(3,s=Se.getApiExampleUrl($e.baseUrl)),o(2,i=[{code:200,body:`
|
||||
{
|
||||
"usernamePassword": true,
|
||||
"emailPassword": true,
|
||||
@@ -61,4 +61,4 @@ import{S as ke,i as be,s as ge,e as r,w as b,b as g,c as _e,f as k,g as h,h as n
|
||||
}
|
||||
]
|
||||
}
|
||||
`}]),[m,f,i,s,u]}class Ke extends ke{constructor(l){super(),be(this,l,Te,Oe,ge,{collection:0})}}export{Ke as default};
|
||||
`}]),[_,f,i,s,u]}class Ke extends ke{constructor(l){super(),be(this,l,Te,Oe,ge,{collection:0})}}export{Ke as default};
|
||||
+8
-8
@@ -1,11 +1,11 @@
|
||||
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 c,h as o,m as ne,x as re,N as qe,O as xe,k as Ie,P as Je,n as Ke,t as U,a as j,o as d,d as ie,Q as Qe,C as He,p as We,r as x,u as Ge}from"./index-9ce6aa95.js";import{S as Xe}from"./SdkTabs-ccd8881b.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){c(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&&d(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){c(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&&d(s),ie(n)}}}function Ye(r){var Ae,Be;let l,s,n=r[0].name+"",m,_,i,f,v,g,w,A,I,S,F,ce,L,B,de,J,N=r[0].name+"",K,ue,pe,V,Q,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,O,se,P,q,$=[],Te=new Map,Ce,H,y=[],Pe=new Map,M;g=new Xe({props:{js:`
|
||||
import{S as ze,i as Ue,s as je,N as Ve,e as a,w as k,b as p,c as ae,f as b,g as c,h as o,m as ne,x as re,O as qe,P as xe,k as Je,Q as Ke,n as Qe,t as U,a as j,o as d,d as ie,R as Ie,C as He,p as We,r as x,u as Ge}from"./index-e4123b79.js";import{S as Xe}from"./SdkTabs-a1061d88.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){c(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&&d(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){c(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&&d(s),ie(n)}}}function Ye(r){var Be,Me;let l,s,n=r[0].name+"",m,_,i,f,v,g,w,B,J,S,F,ce,L,M,de,K,N=r[0].name+"",Q,ue,pe,V,I,D,W,T,G,fe,X,C,Y,he,Z,be,h,me,P,_e,ke,ve,ee,ge,te,ye,Se,$e,oe,we,le,O,se,R,q,$=[],Te=new Map,Ce,H,y=[],Re=new Map,A;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();
|
||||
const 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
|
||||
console.log(pb.authStore.isValid);
|
||||
@@ -18,24 +18,24 @@ 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
|
||||
|
||||
...
|
||||
|
||||
final authData = await pb.collection('${(Be=r[0])==null?void 0:Be.name}').authRefresh();
|
||||
final authData = await pb.collection('${(Me=r[0])==null?void 0:Me.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),u=Re(t);Te.set(u,$[e]=Le(u,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),u=Me(t);Pe.set(u,y[e]=Ne(u,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
|
||||
`}}),P=new Ve({props:{content:"?expand=relField1,relField2.subRelField"}});let z=r[2];const Pe=e=>e[5].code;for(let e=0;e<z.length;e+=1){let t=Fe(r,z,e),u=Pe(t);Te.set(u,$[e]=Le(u,t))}let E=r[2];const Ae=e=>e[5].code;for(let e=0;e<E.length;e+=1){let t=Ee(r,E,e),u=Ae(t);Re.set(u,y[e]=Ne(u,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",I=p(),S=a("div"),F=a("strong"),F.textContent="POST",ce=p(),L=a("div"),B=a("p"),de=k("/api/collections/"),J=a("strong"),K=k(N),ue=k("/auth-refresh"),pe=p(),V=a("p"),V.innerHTML="Requires record <code>Authorization:TOKEN</code> header",Q=p(),D=a("div"),D.textContent="Query parameters",W=p(),T=a("table"),G=a("thead"),G.innerHTML=`<tr><th>Param</th>
|
||||
data in <code>pb.authStore</code> is still valid and up-to-date.</em></p>`,v=p(),ae(g.$$.fragment),w=p(),B=a("h6"),B.textContent="API details",J=p(),S=a("div"),F=a("strong"),F.textContent="POST",ce=p(),L=a("div"),M=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(`
|
||||
`),ae(P.$$.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(),O=a("div"),O.textContent="Responses",se=p(),P=a("div"),q=a("div");for(let e=0;e<$.length;e+=1)$[e].c();Ce=p(),H=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(S,"class","alert alert-success"),b(D,"class","section-title"),b(T,"class","table-compact table-border m-b-base"),b(O,"class","section-title"),b(q,"class","tabs-header compact left"),b(H,"class","tabs-content"),b(P,"class","tabs")},m(e,t){c(e,l,t),o(l,s),o(l,m),o(l,_),c(e,i,t),c(e,f,t),c(e,v,t),ne(g,e,t),c(e,w,t),c(e,A,t),c(e,I,t),c(e,S,t),o(S,F),o(S,ce),o(S,L),o(L,B),o(B,de),o(B,J),o(J,K),o(B,ue),o(S,pe),o(S,V),c(e,Q,t),c(e,D,t),c(e,W,t),c(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),c(e,le,t),c(e,O,t),c(e,se,t),c(e,P,t),o(P,q);for(let u=0;u<$.length;u+=1)$[u].m(q,null);o(P,Ce),o(P,H);for(let u=0;u<y.length;u+=1)y[u].m(H,null);M=!0},p(e,[t]){var De,Oe;(!M||t&1)&&n!==(n=e[0].name+"")&&re(m,n);const u={};t&9&&(u.js=`
|
||||
Only the relations to which the request user has permissions to `),oe=a("strong"),oe.textContent="view",we=k(" will be expanded."),le=p(),O=a("div"),O.textContent="Responses",se=p(),R=a("div"),q=a("div");for(let e=0;e<$.length;e+=1)$[e].c();Ce=p(),H=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(B,"class","m-b-xs"),b(F,"class","label label-primary"),b(L,"class","content"),b(V,"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(O,"class","section-title"),b(q,"class","tabs-header compact left"),b(H,"class","tabs-content"),b(R,"class","tabs")},m(e,t){c(e,l,t),o(l,s),o(l,m),o(l,_),c(e,i,t),c(e,f,t),c(e,v,t),ne(g,e,t),c(e,w,t),c(e,B,t),c(e,J,t),c(e,S,t),o(S,F),o(S,ce),o(S,L),o(L,M),o(M,de),o(M,K),o(K,Q),o(M,ue),o(S,pe),o(S,V),c(e,I,t),c(e,D,t),c(e,W,t),c(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(P,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),c(e,le,t),c(e,O,t),c(e,se,t),c(e,R,t),o(R,q);for(let u=0;u<$.length;u+=1)$[u].m(q,null);o(R,Ce),o(R,H);for(let u=0;u<y.length;u+=1)y[u].m(H,null);A=!0},p(e,[t]){var De,Oe;(!A||t&1)&&n!==(n=e[0].name+"")&&re(m,n);const u={};t&9&&(u.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${e[3]}');
|
||||
@@ -61,7 +61,7 @@ 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
|
||||
print(pb.authStore.isValid);
|
||||
print(pb.authStore.token);
|
||||
print(pb.authStore.model.id);
|
||||
`),g.$set(u),(!M||t&1)&&N!==(N=e[0].name+"")&&re(K,N),t&6&&(z=e[2],$=qe($,t,Re,1,e,z,Te,q,xe,Le,null,Fe)),t&6&&(E=e[2],Ie(),y=qe(y,t,Me,1,e,E,Pe,H,Je,Ne,null,Ee),Ke())},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&&d(l),e&&d(i),e&&d(f),e&&d(v),ie(g,e),e&&d(w),e&&d(A),e&&d(I),e&&d(S),e&&d(Q),e&&d(D),e&&d(W),e&&d(T),ie(R),e&&d(le),e&&d(O),e&&d(se),e&&d(P);for(let t=0;t<$.length;t+=1)$[t].d();for(let t=0;t<y.length;t+=1)y[t].d()}}}function Ze(r,l,s){let n,{collection:m=new Qe}=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:He.dummyCollectionRecord(m)},null,2)},{code:401,body:`
|
||||
`),g.$set(u),(!A||t&1)&&N!==(N=e[0].name+"")&&re(Q,N),t&6&&(z=e[2],$=qe($,t,Pe,1,e,z,Te,q,xe,Le,null,Fe)),t&6&&(E=e[2],Je(),y=qe(y,t,Ae,1,e,E,Re,H,Ke,Ne,null,Ee),Qe())},i(e){if(!A){U(g.$$.fragment,e),U(P.$$.fragment,e);for(let t=0;t<E.length;t+=1)U(y[t]);A=!0}},o(e){j(g.$$.fragment,e),j(P.$$.fragment,e);for(let t=0;t<y.length;t+=1)j(y[t]);A=!1},d(e){e&&d(l),e&&d(i),e&&d(f),e&&d(v),ie(g,e),e&&d(w),e&&d(B),e&&d(J),e&&d(S),e&&d(I),e&&d(D),e&&d(W),e&&d(T),ie(P),e&&d(le),e&&d(O),e&&d(se),e&&d(R);for(let t=0;t<$.length;t+=1)$[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:He.dummyCollectionRecord(m)},null,2)},{code:401,body:`
|
||||
{
|
||||
"code": 401,
|
||||
"message": "The request requires valid record authorization token to be set.",
|
||||
Vendored
+8
-8
@@ -1,4 +1,4 @@
|
||||
import{S as je,i as He,s as Je,M as We,e as s,w as v,b as p,c as re,f as h,g as r,h as a,m as ce,x as de,N as Ve,O as Ne,k as Qe,P as ze,n as Ke,t as j,a as H,o as c,d as ue,Q as Ye,C as Be,p as Ge,r as J,u as Xe}from"./index-9ce6aa95.js";import{S as Ze}from"./SdkTabs-ccd8881b.js";function Fe(i,l,o){const n=i.slice();return n[5]=l[o],n}function Le(i,l,o){const n=i.slice();return n[5]=l[o],n}function Me(i,l){let o,n=l[5].code+"",m,_,d,b;function g(){return l[4](l[5])}return{key:i,first:null,c(){o=s("button"),m=v(n),_=p(),h(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(k,y){r(k,o,y),a(o,m),a(o,_),d||(b=Xe(o,"click",g),d=!0)},p(k,y){l=k,y&4&&n!==(n=l[5].code+"")&&de(m,n),y&6&&J(o,"active",l[1]===l[5].code)},d(k){k&&c(o),d=!1,b()}}}function xe(i,l){let o,n,m,_;return n=new We({props:{content:l[5].body}}),{key:i,first:null,c(){o=s("div"),re(n.$$.fragment),m=p(),h(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(d,b){r(d,o,b),ce(n,o,null),a(o,m),_=!0},p(d,b){l=d;const g={};b&4&&(g.content=l[5].body),n.$set(g),(!_||b&6)&&J(o,"active",l[1]===l[5].code)},i(d){_||(j(n.$$.fragment,d),_=!0)},o(d){H(n.$$.fragment,d),_=!1},d(d){d&&c(o),ue(n)}}}function et(i){var qe,Ie;let l,o,n=i[0].name+"",m,_,d,b,g,k,y,C,N,O,L,pe,M,D,he,Q,x=i[0].name+"",z,be,K,q,Y,I,G,P,X,R,Z,fe,ee,$,te,me,ae,_e,f,ve,E,ge,ke,we,le,Se,oe,ye,Oe,Re,se,$e,ne,U,ie,A,V,S=[],Ae=new Map,Ee,B,w=[],Te=new Map,T;k=new Ze({props:{js:`
|
||||
import{S as je,i as He,s as Je,N as We,e as s,w as v,b as p,c as re,f as h,g as r,h as a,m as ce,x as de,O as Ve,P as Ne,k as Qe,Q as ze,n as Ke,t as j,a as H,o as c,d as ue,R as Ye,C as Be,p as Ge,r as J,u as Xe}from"./index-e4123b79.js";import{S as Ze}from"./SdkTabs-a1061d88.js";function Fe(i,l,o){const n=i.slice();return n[5]=l[o],n}function Le(i,l,o){const n=i.slice();return n[5]=l[o],n}function xe(i,l){let o,n=l[5].code+"",m,_,d,b;function g(){return l[4](l[5])}return{key:i,first:null,c(){o=s("button"),m=v(n),_=p(),h(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(k,R){r(k,o,R),a(o,m),a(o,_),d||(b=Xe(o,"click",g),d=!0)},p(k,R){l=k,R&4&&n!==(n=l[5].code+"")&&de(m,n),R&6&&J(o,"active",l[1]===l[5].code)},d(k){k&&c(o),d=!1,b()}}}function Me(i,l){let o,n,m,_;return n=new We({props:{content:l[5].body}}),{key:i,first:null,c(){o=s("div"),re(n.$$.fragment),m=p(),h(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(d,b){r(d,o,b),ce(n,o,null),a(o,m),_=!0},p(d,b){l=d;const g={};b&4&&(g.content=l[5].body),n.$set(g),(!_||b&6)&&J(o,"active",l[1]===l[5].code)},i(d){_||(j(n.$$.fragment,d),_=!0)},o(d){H(n.$$.fragment,d),_=!1},d(d){d&&c(o),ue(n)}}}function et(i){var qe,Ie;let l,o,n=i[0].name+"",m,_,d,b,g,k,R,C,N,y,L,pe,x,D,he,Q,M=i[0].name+"",z,be,K,q,Y,I,G,P,X,O,Z,fe,ee,$,te,me,ae,_e,f,ve,E,ge,ke,we,le,Se,oe,Re,ye,Oe,se,$e,ne,U,ie,A,V,S=[],Ae=new Map,Ee,B,w=[],Te=new Map,T;k=new Ze({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${i[3]}');
|
||||
@@ -48,11 +48,11 @@ import{S as je,i as He,s as Je,M as We,e as s,w as v,b as p,c as re,f as h,g as
|
||||
|
||||
// "logout" the last authenticated account
|
||||
pb.authStore.clear();
|
||||
`}}),E=new We({props:{content:"?expand=relField1,relField2.subRelField"}});let W=i[2];const Ce=e=>e[5].code;for(let e=0;e<W.length;e+=1){let t=Le(i,W,e),u=Ce(t);Ae.set(u,S[e]=Me(u,t))}let F=i[2];const De=e=>e[5].code;for(let e=0;e<F.length;e+=1){let t=Fe(i,F,e),u=De(t);Te.set(u,w[e]=xe(u,t))}return{c(){l=s("h3"),o=v("Auth with OAuth2 ("),m=v(n),_=v(")"),d=p(),b=s("div"),b.innerHTML=`<p>Authenticate with an OAuth2 provider and returns a new auth token and record data.</p>
|
||||
`}}),E=new We({props:{content:"?expand=relField1,relField2.subRelField"}});let W=i[2];const Ce=e=>e[5].code;for(let e=0;e<W.length;e+=1){let t=Le(i,W,e),u=Ce(t);Ae.set(u,S[e]=xe(u,t))}let F=i[2];const De=e=>e[5].code;for(let e=0;e<F.length;e+=1){let t=Fe(i,F,e),u=De(t);Te.set(u,w[e]=Me(u,t))}return{c(){l=s("h3"),o=v("Auth with OAuth2 ("),m=v(n),_=v(")"),d=p(),b=s("div"),b.innerHTML=`<p>Authenticate with an OAuth2 provider and returns a new auth token and record data.</p>
|
||||
<p>This action usually should be called right after the provider login page redirect.</p>
|
||||
<p>You could also check the
|
||||
<a href="https://pocketbase.io/docs/authentication/#web-oauth2-integration" target="_blank" rel="noopener noreferrer">OAuth2 web integration example
|
||||
</a>.</p>`,g=p(),re(k.$$.fragment),y=p(),C=s("h6"),C.textContent="API details",N=p(),O=s("div"),L=s("strong"),L.textContent="POST",pe=p(),M=s("div"),D=s("p"),he=v("/api/collections/"),Q=s("strong"),z=v(x),be=v("/auth-with-oauth2"),K=p(),q=s("div"),q.textContent="Body Parameters",Y=p(),I=s("table"),I.innerHTML=`<thead><tr><th>Param</th>
|
||||
</a>.</p>`,g=p(),re(k.$$.fragment),R=p(),C=s("h6"),C.textContent="API details",N=p(),y=s("div"),L=s("strong"),L.textContent="POST",pe=p(),x=s("div"),D=s("p"),he=v("/api/collections/"),Q=s("strong"),z=v(M),be=v("/auth-with-oauth2"),K=p(),q=s("div"),q.textContent="Body Parameters",Y=p(),I=s("table"),I.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>
|
||||
@@ -79,15 +79,15 @@ import{S as je,i as He,s as Je,M as We,e as s,w as v,b as p,c as re,f as h,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>`,G=p(),P=s("div"),P.textContent="Query parameters",X=p(),R=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>`,G=p(),P=s("div"),P.textContent="Query parameters",X=p(),O=s("table"),Z=s("thead"),Z.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr>`,fe=p(),ee=s("tbody"),$=s("tr"),te=s("td"),te.textContent="expand",me=p(),ae=s("td"),ae.innerHTML='<span class="label">String</span>',_e=p(),f=s("td"),ve=v(`Auto expand record relations. Ex.:
|
||||
`),re(E.$$.fragment),ge=v(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),ke=s("br"),we=v(`
|
||||
The expanded relations will be appended to the record under the
|
||||
`),le=s("code"),le.textContent="expand",Se=v(" property (eg. "),oe=s("code"),oe.textContent='"expand": {"relField1": {...}, ...}',ye=v(`).
|
||||
`),Oe=s("br"),Re=v(`
|
||||
Only the relations to which the request user has permissions to `),se=s("strong"),se.textContent="view",$e=v(" will be expanded."),ne=p(),U=s("div"),U.textContent="Responses",ie=p(),A=s("div"),V=s("div");for(let e=0;e<S.length;e+=1)S[e].c();Ee=p(),B=s("div");for(let e=0;e<w.length;e+=1)w[e].c();h(l,"class","m-b-sm"),h(b,"class","content txt-lg m-b-sm"),h(C,"class","m-b-xs"),h(L,"class","label label-primary"),h(M,"class","content"),h(O,"class","alert alert-success"),h(q,"class","section-title"),h(I,"class","table-compact table-border m-b-base"),h(P,"class","section-title"),h(R,"class","table-compact table-border m-b-base"),h(U,"class","section-title"),h(V,"class","tabs-header compact left"),h(B,"class","tabs-content"),h(A,"class","tabs")},m(e,t){r(e,l,t),a(l,o),a(l,m),a(l,_),r(e,d,t),r(e,b,t),r(e,g,t),ce(k,e,t),r(e,y,t),r(e,C,t),r(e,N,t),r(e,O,t),a(O,L),a(O,pe),a(O,M),a(M,D),a(D,he),a(D,Q),a(Q,z),a(D,be),r(e,K,t),r(e,q,t),r(e,Y,t),r(e,I,t),r(e,G,t),r(e,P,t),r(e,X,t),r(e,R,t),a(R,Z),a(R,fe),a(R,ee),a(ee,$),a($,te),a($,me),a($,ae),a($,_e),a($,f),a(f,ve),ce(E,f,null),a(f,ge),a(f,ke),a(f,we),a(f,le),a(f,Se),a(f,oe),a(f,ye),a(f,Oe),a(f,Re),a(f,se),a(f,$e),r(e,ne,t),r(e,U,t),r(e,ie,t),r(e,A,t),a(A,V);for(let u=0;u<S.length;u+=1)S[u].m(V,null);a(A,Ee),a(A,B);for(let u=0;u<w.length;u+=1)w[u].m(B,null);T=!0},p(e,[t]){var Pe,Ue;(!T||t&1)&&n!==(n=e[0].name+"")&&de(m,n);const u={};t&9&&(u.js=`
|
||||
`),le=s("code"),le.textContent="expand",Se=v(" property (eg. "),oe=s("code"),oe.textContent='"expand": {"relField1": {...}, ...}',Re=v(`).
|
||||
`),ye=s("br"),Oe=v(`
|
||||
Only the relations to which the request user has permissions to `),se=s("strong"),se.textContent="view",$e=v(" will be expanded."),ne=p(),U=s("div"),U.textContent="Responses",ie=p(),A=s("div"),V=s("div");for(let e=0;e<S.length;e+=1)S[e].c();Ee=p(),B=s("div");for(let e=0;e<w.length;e+=1)w[e].c();h(l,"class","m-b-sm"),h(b,"class","content txt-lg m-b-sm"),h(C,"class","m-b-xs"),h(L,"class","label label-primary"),h(x,"class","content"),h(y,"class","alert alert-success"),h(q,"class","section-title"),h(I,"class","table-compact table-border m-b-base"),h(P,"class","section-title"),h(O,"class","table-compact table-border m-b-base"),h(U,"class","section-title"),h(V,"class","tabs-header compact left"),h(B,"class","tabs-content"),h(A,"class","tabs")},m(e,t){r(e,l,t),a(l,o),a(l,m),a(l,_),r(e,d,t),r(e,b,t),r(e,g,t),ce(k,e,t),r(e,R,t),r(e,C,t),r(e,N,t),r(e,y,t),a(y,L),a(y,pe),a(y,x),a(x,D),a(D,he),a(D,Q),a(Q,z),a(D,be),r(e,K,t),r(e,q,t),r(e,Y,t),r(e,I,t),r(e,G,t),r(e,P,t),r(e,X,t),r(e,O,t),a(O,Z),a(O,fe),a(O,ee),a(ee,$),a($,te),a($,me),a($,ae),a($,_e),a($,f),a(f,ve),ce(E,f,null),a(f,ge),a(f,ke),a(f,we),a(f,le),a(f,Se),a(f,oe),a(f,Re),a(f,ye),a(f,Oe),a(f,se),a(f,$e),r(e,ne,t),r(e,U,t),r(e,ie,t),r(e,A,t),a(A,V);for(let u=0;u<S.length;u+=1)S[u].m(V,null);a(A,Ee),a(A,B);for(let u=0;u<w.length;u+=1)w[u].m(B,null);T=!0},p(e,[t]){var Pe,Ue;(!T||t&1)&&n!==(n=e[0].name+"")&&de(m,n);const u={};t&9&&(u.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${e[3]}');
|
||||
@@ -137,7 +137,7 @@ import{S as je,i as He,s as Je,M as We,e as s,w as v,b as p,c as re,f as h,g as
|
||||
|
||||
// "logout" the last authenticated account
|
||||
pb.authStore.clear();
|
||||
`),k.$set(u),(!T||t&1)&&x!==(x=e[0].name+"")&&de(z,x),t&6&&(W=e[2],S=Ve(S,t,Ce,1,e,W,Ae,V,Ne,Me,null,Le)),t&6&&(F=e[2],Qe(),w=Ve(w,t,De,1,e,F,Te,B,ze,xe,null,Fe),Ke())},i(e){if(!T){j(k.$$.fragment,e),j(E.$$.fragment,e);for(let t=0;t<F.length;t+=1)j(w[t]);T=!0}},o(e){H(k.$$.fragment,e),H(E.$$.fragment,e);for(let t=0;t<w.length;t+=1)H(w[t]);T=!1},d(e){e&&c(l),e&&c(d),e&&c(b),e&&c(g),ue(k,e),e&&c(y),e&&c(C),e&&c(N),e&&c(O),e&&c(K),e&&c(q),e&&c(Y),e&&c(I),e&&c(G),e&&c(P),e&&c(X),e&&c(R),ue(E),e&&c(ne),e&&c(U),e&&c(ie),e&&c(A);for(let t=0;t<S.length;t+=1)S[t].d();for(let t=0;t<w.length;t+=1)w[t].d()}}}function tt(i,l,o){let n,{collection:m=new Ye}=l,_=200,d=[];const b=g=>o(1,_=g.code);return i.$$set=g=>{"collection"in g&&o(0,m=g.collection)},i.$$.update=()=>{i.$$.dirty&1&&o(2,d=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:Be.dummyCollectionRecord(m),meta:{id:"abc123",name:"John Doe",username:"john.doe",email:"test@example.com",avatarUrl:"https://example.com/avatar.png"}},null,2)},{code:400,body:`
|
||||
`),k.$set(u),(!T||t&1)&&M!==(M=e[0].name+"")&&de(z,M),t&6&&(W=e[2],S=Ve(S,t,Ce,1,e,W,Ae,V,Ne,xe,null,Le)),t&6&&(F=e[2],Qe(),w=Ve(w,t,De,1,e,F,Te,B,ze,Me,null,Fe),Ke())},i(e){if(!T){j(k.$$.fragment,e),j(E.$$.fragment,e);for(let t=0;t<F.length;t+=1)j(w[t]);T=!0}},o(e){H(k.$$.fragment,e),H(E.$$.fragment,e);for(let t=0;t<w.length;t+=1)H(w[t]);T=!1},d(e){e&&c(l),e&&c(d),e&&c(b),e&&c(g),ue(k,e),e&&c(R),e&&c(C),e&&c(N),e&&c(y),e&&c(K),e&&c(q),e&&c(Y),e&&c(I),e&&c(G),e&&c(P),e&&c(X),e&&c(O),ue(E),e&&c(ne),e&&c(U),e&&c(ie),e&&c(A);for(let t=0;t<S.length;t+=1)S[t].d();for(let t=0;t<w.length;t+=1)w[t].d()}}}function tt(i,l,o){let n,{collection:m=new Ye}=l,_=200,d=[];const b=g=>o(1,_=g.code);return i.$$set=g=>{"collection"in g&&o(0,m=g.collection)},i.$$.update=()=>{i.$$.dirty&1&&o(2,d=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:Be.dummyCollectionRecord(m),meta:{id:"abc123",name:"John Doe",username:"john.doe",email:"test@example.com",avatarUrl:"https://example.com/avatar.png"}},null,2)},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "An error occurred while submitting the form.",
|
||||
Vendored
+8
-8
@@ -1,4 +1,4 @@
|
||||
import{S as Se,i as ve,s as we,M as ke,e as s,w as f,b as u,c as Ot,f as h,g as r,h as o,m as At,x as Tt,N as ce,O as ye,k as ge,P as Pe,n as $e,t as tt,a as et,o as c,d as Mt,Q as Re,C as de,p as Ce,r as lt,u as Oe}from"./index-9ce6aa95.js";import{S as Ae}from"./SdkTabs-ccd8881b.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 Te(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=Oe(l,"click",_),p=!0)},p(R,C){e=R,C&16&&i!==(i=e[8].code+"")&&Tt(S,i),C&24&<(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"),Ot(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)&<(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,O,B,Ut,ot,T,at,F,st,M,G,Dt,X,I,Et,nt,Z=n[0].name+"",it,Wt,rt,N,ct,U,dt,Lt,V,D,ut,Bt,ft,Ht,g,Yt,pt,bt,mt,qt,ht,_t,j,kt,E,St,Ft,vt,W,wt,It,yt,Nt,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,P=[],ee=new Map,Y;function le(t,a){if(t[1]&&t[2])return Ue;if(t[1])return Me;if(t[2])return Te}let q=le(n),$=q&&q(n);T=new Ae({props:{js:`
|
||||
import{S as Se,i as ve,s as we,N as ke,e as s,w as f,b as u,c as Ot,f as h,g as r,h as o,m as At,x as Tt,O as ce,P as ye,k as ge,Q as Pe,n as Re,t as tt,a as et,o as c,d as Ut,R as $e,C as de,p as Ce,r as lt,u as Oe}from"./index-e4123b79.js";import{S as Ae}from"./SdkTabs-a1061d88.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 Te(n){let e;return{c(){e=f("email")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function Ue(n){let e;return{c(){e=f("username")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function Me(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($,C){r($,l,C),o(l,S),o(l,m),p||(d=Oe(l,"click",_),p=!0)},p($,C){e=$,C&16&&i!==(i=e[8].code+"")&&Tt(S,i),C&24&<(l,"active",e[3]===e[8].code)},d($){$&&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"),Ot(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)&<(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),Ut(i)}}}function De(n){var se,ne;let e,l,i=n[0].name+"",S,m,p,d,_,$,C,O,B,Mt,ot,T,at,F,st,U,G,Dt,X,N,Et,nt,Z=n[0].name+"",it,Wt,rt,I,ct,M,dt,Lt,V,D,ut,Bt,ft,Ht,g,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,Rt,Zt,$t,J,Ct,L,Q,A=[],xt=new Map,te,K,P=[],ee=new Map,Y;function le(t,a){if(t[1]&&t[2])return Me;if(t[1])return Ue;if(t[2])return Te}let q=le(n),R=q&&q(n);T=new Ae({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${n[6]}');
|
||||
@@ -36,9 +36,9 @@ import{S as Se,i as ve,s as we,M as ke,e as s,w as f,b as u,c as Ot,f as h,g as
|
||||
|
||||
// "logout" the last authenticated account
|
||||
pb.authStore.clear();
|
||||
`}});let v=n[1]&&pe(),w=n[1]&&n[2]&&be(),y=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,P[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(),O=f(`
|
||||
and `),B=s("strong"),B.textContent="password",Ut=f("."),ot=u(),Ot(T.$$.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"),I=s("p"),Et=f("/api/collections/"),nt=s("strong"),it=f(Z),Wt=f("/auth-with-password"),rt=u(),N=s("div"),N.textContent="Body Parameters",ct=u(),U=s("table"),dt=s("thead"),dt.innerHTML=`<tr><th>Param</th>
|
||||
`}});let v=n[1]&&pe(),w=n[1]&&n[2]&&be(),y=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,P[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"),$=f(`Returns new auth token and account data by a combination of
|
||||
`),C=s("strong"),R&&R.c(),O=f(`
|
||||
and `),B=s("strong"),B.textContent="password",Mt=f("."),ot=u(),Ot(T.$$.fragment),at=u(),F=s("h6"),F.textContent="API details",st=u(),U=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(),M=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(),g=s("td"),Yt=f(`The
|
||||
@@ -48,13 +48,13 @@ import{S as Se,i as ve,s as we,M as ke,e as s,w as f,b as u,c as Ot,f as h,g as
|
||||
<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",It=u(),yt=s("td"),yt.innerHTML='<span class="label">String</span>',Nt=u(),k=s("td"),Vt=f(`Auto expand record relations. Ex.:
|
||||
<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.:
|
||||
`),Ot(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<P.length;t+=1)P[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(N,"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(_,O),o(_,B),o(_,Ut),r(t,ot,a),At(T,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,I),o(I,Et),o(I,nt),o(nt,it),o(I,Wt),r(t,rt,a),r(t,N,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,g),o(g,Yt),v&&v.m(g,null),o(g,pt),w&&w.m(g,null),o(g,bt),y&&y.m(g,null),o(g,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,It),o(W,yt),o(W,Nt),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].m(Q,null);o(L,te),o(L,K);for(let b=0;b<P.length;b+=1)P[b].m(K,null);Y=!0},p(t,[a]){var ie,re;(!Y||a&1)&&i!==(i=t[0].name+"")&&Tt(S,i),q!==(q=le(t))&&($&&$.d(1),$=q&&q(t),$&&($.c(),$.m(C,null)));const b={};a&97&&(b.js=`
|
||||
Only the relations to which the request user has permissions to `),Rt=s("strong"),Rt.textContent="view",Zt=f(" will be expanded."),$t=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<P.length;t+=1)P[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(U,"class","alert alert-success"),h(I,"class","section-title"),h(M,"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(_,$),o(_,C),R&&R.m(C,null),o(_,O),o(_,B),o(_,Mt),r(t,ot,a),At(T,t,a),r(t,at,a),r(t,F,a),r(t,st,a),r(t,U,a),o(U,G),o(U,Dt),o(U,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,M,a),o(M,dt),o(M,Lt),o(M,V),o(V,D),o(D,ut),o(D,Bt),o(D,ft),o(D,Ht),o(D,g),o(g,Yt),v&&v.m(g,null),o(g,pt),w&&w.m(g,null),o(g,bt),y&&y.m(g,null),o(g,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,Rt),o(k,Zt),r(t,$t,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].m(Q,null);o(L,te),o(L,K);for(let b=0;b<P.length;b+=1)P[b].m(K,null);Y=!0},p(t,[a]){var ie,re;(!Y||a&1)&&i!==(i=t[0].name+"")&&Tt(S,i),q!==(q=le(t))&&(R&&R.d(1),R=q&&q(t),R&&(R.c(),R.m(C,null)));const b={};a&97&&(b.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${t[6]}');
|
||||
@@ -92,7 +92,7 @@ import{S as Se,i as ve,s as we,M as ke,e as s,w as f,b as u,c as Ot,f as h,g as
|
||||
|
||||
// "logout" the last authenticated account
|
||||
pb.authStore.clear();
|
||||
`),T.$set(b),(!Y||a&1)&&Z!==(Z=t[0].name+"")&&Tt(it,Z),t[1]?v||(v=pe(),v.c(),v.m(g,pt)):v&&(v.d(1),v=null),t[1]&&t[2]?w||(w=be(),w.c(),w.m(g,bt)):w&&(w.d(1),w=null),t[2]?y||(y=me(),y.c(),y.m(g,mt)):y&&(y.d(1),y=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(),P=ce(P,a,ae,1,t,z,ee,K,Pe,_e,null,ue),$e())},i(t){if(!Y){tt(T.$$.fragment,t),tt(H.$$.fragment,t);for(let a=0;a<z.length;a+=1)tt(P[a]);Y=!0}},o(t){et(T.$$.fragment,t),et(H.$$.fragment,t);for(let a=0;a<P.length;a+=1)et(P[a]);Y=!1},d(t){t&&c(e),t&&c(p),t&&c(d),$&&$.d(),t&&c(ot),Mt(T,t),t&&c(at),t&&c(F),t&&c(st),t&&c(M),t&&c(rt),t&&c(N),t&&c(ct),t&&c(U),v&&v.d(),w&&w.d(),y&&y.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<P.length;a+=1)P[a].d()}}}function Ee(n,e,l){let i,S,m,p,{collection:d=new Re}=e,_=200,R=[];const C=O=>l(3,_=O.code);return n.$$set=O=>{"collection"in O&&l(0,d=O.collection)},n.$$.update=()=>{var O,B;n.$$.dirty&1&&l(2,S=(O=d==null?void 0:d.options)==null?void 0:O.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:`
|
||||
`),T.$set(b),(!Y||a&1)&&Z!==(Z=t[0].name+"")&&Tt(it,Z),t[1]?v||(v=pe(),v.c(),v.m(g,pt)):v&&(v.d(1),v=null),t[1]&&t[2]?w||(w=be(),w.c(),w.m(g,bt)):w&&(w.d(1),w=null),t[2]?y||(y=me(),y.c(),y.m(g,mt)):y&&(y.d(1),y=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(),P=ce(P,a,ae,1,t,z,ee,K,Pe,_e,null,ue),Re())},i(t){if(!Y){tt(T.$$.fragment,t),tt(H.$$.fragment,t);for(let a=0;a<z.length;a+=1)tt(P[a]);Y=!0}},o(t){et(T.$$.fragment,t),et(H.$$.fragment,t);for(let a=0;a<P.length;a+=1)et(P[a]);Y=!1},d(t){t&&c(e),t&&c(p),t&&c(d),R&&R.d(),t&&c(ot),Ut(T,t),t&&c(at),t&&c(F),t&&c(st),t&&c(U),t&&c(rt),t&&c(I),t&&c(ct),t&&c(M),v&&v.d(),w&&w.d(),y&&y.d(),t&&c(_t),t&&c(j),t&&c(kt),t&&c(E),Ut(H),t&&c($t),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<P.length;a+=1)P[a].d()}}}function Ee(n,e,l){let i,S,m,p,{collection:d=new $e}=e,_=200,$=[];const C=O=>l(3,_=O.code);return n.$$set=O=>{"collection"in O&&l(0,d=O.collection)},n.$$.update=()=>{var O,B;n.$$.dirty&1&&l(2,S=(O=d==null?void 0:d.options)==null?void 0:O.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,$=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:de.dummyCollectionRecord(d)},null,2)},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to authenticate.",
|
||||
@@ -103,4 +103,4 @@ import{S as Se,i as ve,s as we,M as ke,e as s,w as f,b as u,c as Ot,f as h,g as
|
||||
}
|
||||
}
|
||||
}
|
||||
`}])},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};
|
||||
`}])},l(6,i=de.getApiExampleUrl(Ce.baseUrl)),[d,m,S,_,$,p,i,C]}class Be extends Se{constructor(e){super(),ve(this,e,Ee,De,we,{collection:0})}}export{Be as default};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+5
-5
@@ -1,4 +1,4 @@
|
||||
import{S as Ce,i as $e,s as we,e as c,w as v,b as h,c as he,f as b,g as r,h as n,m as ve,x as Y,N as pe,O as Pe,k as Se,P as Oe,n as Re,t as Z,a as x,o as f,d as ge,Q as Te,C as Ee,p as ye,r as j,u as Be,M as qe}from"./index-9ce6aa95.js";import{S as Ae}from"./SdkTabs-ccd8881b.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=c("button"),_=v(a),u=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(C,$){r(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&&f(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=c("div"),he(a.$$.fragment),_=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,d){r(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&&f(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,I,w,F,R,L,P,M,te,N,T,le,Q,K=o[0].name+"",z,se,G,E,J,y,V,B,X,S,q,g=[],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 c,w as v,b as h,c as he,f as b,g as r,h as n,m as ve,x as Y,O as pe,P as Pe,k as Se,Q as Oe,n as Re,t as Z,a as x,o as f,d as ge,R as Te,C as Ee,p as ye,r as j,u as Be,N as qe}from"./index-e4123b79.js";import{S as Ae}from"./SdkTabs-a1061d88.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=c("button"),_=v(a),u=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(C,$){r(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&&f(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=c("div"),he(a.$$.fragment),_=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,d){r(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&&f(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,R,L,P,N,te,K,T,le,Q,M=o[0].name+"",z,se,G,E,J,y,V,B,X,S,q,g=[],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]}');
|
||||
@@ -20,7 +20,7 @@ import{S as Ce,i as $e,s as we,e as c,w as v,b as h,c as he,f as b,g as r,h as n
|
||||
'TOKEN',
|
||||
'YOUR_PASSWORD',
|
||||
);
|
||||
`}});let W=o[2];const ie=e=>e[5].code;for(let e=0;e<W.length;e+=1){let t=be(o,W,e),m=ie(t);ae.set(m,g[e]=_e(m,t))}let U=o[2];const ce=e=>e[5].code;for(let e=0;e<U.length;e+=1){let t=ue(o,U,e),m=ce(t);ne.set(m,k[e]=ke(m,t))}return{c(){l=c("h3"),s=v("Confirm email change ("),_=v(a),u=v(")"),i=h(),d=c("div"),p=c("p"),C=v("Confirms "),$=c("strong"),H=v(D),ee=v(" email change request."),I=h(),he(w.$$.fragment),F=h(),R=c("h6"),R.textContent="API details",L=h(),P=c("div"),M=c("strong"),M.textContent="POST",te=h(),N=c("div"),T=c("p"),le=v("/api/collections/"),Q=c("strong"),z=v(K),se=v("/confirm-email-change"),G=h(),E=c("div"),E.textContent="Body Parameters",J=h(),y=c("table"),y.innerHTML=`<thead><tr><th>Param</th>
|
||||
`}});let W=o[2];const ie=e=>e[5].code;for(let e=0;e<W.length;e+=1){let t=be(o,W,e),m=ie(t);ae.set(m,g[e]=_e(m,t))}let U=o[2];const ce=e=>e[5].code;for(let e=0;e<U.length;e+=1){let t=ue(o,U,e),m=ce(t);ne.set(m,k[e]=ke(m,t))}return{c(){l=c("h3"),s=v("Confirm email change ("),_=v(a),u=v(")"),i=h(),d=c("div"),p=c("p"),C=v("Confirms "),$=c("strong"),H=v(D),ee=v(" email change request."),F=h(),he(w.$$.fragment),I=h(),R=c("h6"),R.textContent="API details",L=h(),P=c("div"),N=c("strong"),N.textContent="POST",te=h(),K=c("div"),T=c("p"),le=v("/api/collections/"),Q=c("strong"),z=v(M),se=v("/confirm-email-change"),G=h(),E=c("div"),E.textContent="Body Parameters",J=h(),y=c("table"),y.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>
|
||||
@@ -30,7 +30,7 @@ import{S as Ce,i as $e,s as we,e as c,w as v,b as h,c as he,f as b,g as r,h as n
|
||||
<tr><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 account password to confirm the email change.</td></tr></tbody>`,V=h(),B=c("div"),B.textContent="Responses",X=h(),S=c("div"),q=c("div");for(let e=0;e<g.length;e+=1)g[e].c();oe=h(),A=c("div");for(let e=0;e<k.length;e+=1)k[e].c();b(l,"class","m-b-sm"),b(d,"class","content txt-lg m-b-sm"),b(R,"class","m-b-xs"),b(M,"class","label label-primary"),b(N,"class","content"),b(P,"class","alert alert-success"),b(E,"class","section-title"),b(y,"class","table-compact table-border m-b-base"),b(B,"class","section-title"),b(q,"class","tabs-header compact left"),b(A,"class","tabs-content"),b(S,"class","tabs")},m(e,t){r(e,l,t),n(l,s),n(l,_),n(l,u),r(e,i,t),r(e,d,t),n(d,p),n(p,C),n(p,$),n($,H),n(p,ee),r(e,I,t),ve(w,e,t),r(e,F,t),r(e,R,t),r(e,L,t),r(e,P,t),n(P,M),n(P,te),n(P,N),n(N,T),n(T,le),n(T,Q),n(Q,z),n(T,se),r(e,G,t),r(e,E,t),r(e,J,t),r(e,y,t),r(e,V,t),r(e,B,t),r(e,X,t),r(e,S,t),n(S,q);for(let m=0;m<g.length;m+=1)g[m].m(q,null);n(S,oe),n(S,A);for(let m=0;m<k.length;m+=1)k[m].m(A,null);O=!0},p(e,[t]){var me,de;(!O||t&1)&&a!==(a=e[0].name+"")&&Y(_,a),(!O||t&1)&&D!==(D=e[0].name+"")&&Y(H,D);const m={};t&9&&(m.js=`
|
||||
<td>The account password to confirm the email change.</td></tr></tbody>`,V=h(),B=c("div"),B.textContent="Responses",X=h(),S=c("div"),q=c("div");for(let e=0;e<g.length;e+=1)g[e].c();oe=h(),A=c("div");for(let e=0;e<k.length;e+=1)k[e].c();b(l,"class","m-b-sm"),b(d,"class","content txt-lg m-b-sm"),b(R,"class","m-b-xs"),b(N,"class","label label-primary"),b(K,"class","content"),b(P,"class","alert alert-success"),b(E,"class","section-title"),b(y,"class","table-compact table-border m-b-base"),b(B,"class","section-title"),b(q,"class","tabs-header compact left"),b(A,"class","tabs-content"),b(S,"class","tabs")},m(e,t){r(e,l,t),n(l,s),n(l,_),n(l,u),r(e,i,t),r(e,d,t),n(d,p),n(p,C),n(p,$),n($,H),n(p,ee),r(e,F,t),ve(w,e,t),r(e,I,t),r(e,R,t),r(e,L,t),r(e,P,t),n(P,N),n(P,te),n(P,K),n(K,T),n(T,le),n(T,Q),n(Q,z),n(T,se),r(e,G,t),r(e,E,t),r(e,J,t),r(e,y,t),r(e,V,t),r(e,B,t),r(e,X,t),r(e,S,t),n(S,q);for(let m=0;m<g.length;m+=1)g[m].m(q,null);n(S,oe),n(S,A);for(let m=0;m<k.length;m+=1)k[m].m(A,null);O=!0},p(e,[t]){var me,de;(!O||t&1)&&a!==(a=e[0].name+"")&&Y(_,a),(!O||t&1)&&D!==(D=e[0].name+"")&&Y(H,D);const m={};t&9&&(m.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${e[3]}');
|
||||
@@ -52,7 +52,7 @@ import{S as Ce,i as $e,s as we,e as c,w as v,b as h,c as he,f as b,g as r,h as n
|
||||
'TOKEN',
|
||||
'YOUR_PASSWORD',
|
||||
);
|
||||
`),w.$set(m),(!O||t&1)&&K!==(K=e[0].name+"")&&Y(z,K),t&6&&(W=e[2],g=pe(g,t,ie,1,e,W,ae,q,Pe,_e,null,be)),t&6&&(U=e[2],Se(),k=pe(k,t,ce,1,e,U,ne,A,Oe,ke,null,ue),Re())},i(e){if(!O){Z(w.$$.fragment,e);for(let t=0;t<U.length;t+=1)Z(k[t]);O=!0}},o(e){x(w.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);O=!1},d(e){e&&f(l),e&&f(i),e&&f(d),e&&f(I),ge(w,e),e&&f(F),e&&f(R),e&&f(L),e&&f(P),e&&f(G),e&&f(E),e&&f(J),e&&f(y),e&&f(V),e&&f(B),e&&f(X),e&&f(S);for(let t=0;t<g.length;t+=1)g[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function De(o,l,s){let a,{collection:_=new Te}=l,u=204,i=[];const d=p=>s(1,u=p.code);return o.$$set=p=>{"collection"in p&&s(0,_=p.collection)},s(3,a=Ee.getApiExampleUrl(ye.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:`
|
||||
`),w.$set(m),(!O||t&1)&&M!==(M=e[0].name+"")&&Y(z,M),t&6&&(W=e[2],g=pe(g,t,ie,1,e,W,ae,q,Pe,_e,null,be)),t&6&&(U=e[2],Se(),k=pe(k,t,ce,1,e,U,ne,A,Oe,ke,null,ue),Re())},i(e){if(!O){Z(w.$$.fragment,e);for(let t=0;t<U.length;t+=1)Z(k[t]);O=!0}},o(e){x(w.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);O=!1},d(e){e&&f(l),e&&f(i),e&&f(d),e&&f(F),ge(w,e),e&&f(I),e&&f(R),e&&f(L),e&&f(P),e&&f(G),e&&f(E),e&&f(J),e&&f(y),e&&f(V),e&&f(B),e&&f(X),e&&f(S);for(let t=0;t<g.length;t+=1)g[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function De(o,l,s){let a,{collection:_=new Te}=l,u=204,i=[];const d=p=>s(1,u=p.code);return o.$$set=p=>{"collection"in p&&s(0,_=p.collection)},s(3,a=Ee.getApiExampleUrl(ye.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to authenticate.",
|
||||
@@ -63,4 +63,4 @@ import{S as Ce,i as $e,s as we,e as c,w as v,b as h,c as he,f as b,g as r,h as n
|
||||
}
|
||||
}
|
||||
}
|
||||
`}]),[_,u,i,a,d]}class Ke extends Ce{constructor(l){super(),$e(this,l,De,Ue,we,{collection:0})}}export{Ke as default};
|
||||
`}]),[_,u,i,a,d]}class Me extends Ce{constructor(l){super(),$e(this,l,De,Ue,we,{collection:0})}}export{Me as default};
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
import{S as Se,i as he,s as Re,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as we,x as K,N as me,O as Oe,k as Ne,P as Ce,n as We,t as Z,a as x,o as d,d as Pe,Q as $e,C as Ee,p as Te,r as U,u as ge,M as Ae}from"./index-9ce6aa95.js";import{S as De}from"./SdkTabs-ccd8881b.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=c("button"),_=w(a),u=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(S,h){r(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&&d(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=c("div"),ve(a.$$.fragment),_=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(i,p){r(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&&d(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,O,q,te,B,$,se,z,I=o[0].name+"",G,le,J,E,V,T,X,g,Y,N,A,P=[],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 c,w,b as v,c as ve,f as b,g as r,h as n,m as we,x as K,O as me,P as Oe,k as Ne,Q as Ce,n as We,t as Z,a as x,o as d,d as Pe,R as $e,C as Ee,p as Te,r as U,u as ge,N as Ae}from"./index-e4123b79.js";import{S as De}from"./SdkTabs-a1061d88.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=c("button"),_=w(a),u=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(S,h){r(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&&d(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=c("div"),ve(a.$$.fragment),_=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(i,p){r(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&&d(l),Pe(a)}}}function ye(o){var re,de;let s,l,a=o[0].name+"",_,u,i,p,m,S,h,q=o[0].name+"",j,ee,H,R,L,W,Q,O,B,te,M,$,se,z,F=o[0].name+"",G,le,J,E,V,T,X,g,Y,N,A,P=[],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]}');
|
||||
@@ -22,7 +22,7 @@ import{S as Se,i as he,s as Re,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as
|
||||
'NEW_PASSWORD',
|
||||
'NEW_PASSWORD_CONFIRM',
|
||||
);
|
||||
`}});let F=o[2];const ie=e=>e[5].code;for(let e=0;e<F.length;e+=1){let t=be(o,F,e),f=ie(t);ae.set(f,P[e]=_e(f,t))}let y=o[2];const ce=e=>e[5].code;for(let e=0;e<y.length;e+=1){let t=ue(o,y,e),f=ce(t);ne.set(f,k[e]=ke(f,t))}return{c(){s=c("h3"),l=w("Confirm password reset ("),_=w(a),u=w(")"),i=v(),p=c("div"),m=c("p"),S=w("Confirms "),h=c("strong"),j=w(M),ee=w(" password reset request and sets a new password."),H=v(),ve(R.$$.fragment),L=v(),W=c("h6"),W.textContent="API details",Q=v(),O=c("div"),q=c("strong"),q.textContent="POST",te=v(),B=c("div"),$=c("p"),se=w("/api/collections/"),z=c("strong"),G=w(I),le=w("/confirm-password-reset"),J=v(),E=c("div"),E.textContent="Body Parameters",V=v(),T=c("table"),T.innerHTML=`<thead><tr><th>Param</th>
|
||||
`}});let I=o[2];const ie=e=>e[5].code;for(let e=0;e<I.length;e+=1){let t=be(o,I,e),f=ie(t);ae.set(f,P[e]=_e(f,t))}let y=o[2];const ce=e=>e[5].code;for(let e=0;e<y.length;e+=1){let t=ue(o,y,e),f=ce(t);ne.set(f,k[e]=ke(f,t))}return{c(){s=c("h3"),l=w("Confirm password reset ("),_=w(a),u=w(")"),i=v(),p=c("div"),m=c("p"),S=w("Confirms "),h=c("strong"),j=w(q),ee=w(" password reset request and sets a new password."),H=v(),ve(R.$$.fragment),L=v(),W=c("h6"),W.textContent="API details",Q=v(),O=c("div"),B=c("strong"),B.textContent="POST",te=v(),M=c("div"),$=c("p"),se=w("/api/collections/"),z=c("strong"),G=w(F),le=w("/confirm-password-reset"),J=v(),E=c("div"),E.textContent="Body Parameters",V=v(),T=c("table"),T.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>
|
||||
@@ -36,7 +36,7 @@ import{S as Se,i as he,s as Re,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as
|
||||
<tr><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>The new password confirmation.</td></tr></tbody>`,X=v(),g=c("div"),g.textContent="Responses",Y=v(),N=c("div"),A=c("div");for(let e=0;e<P.length;e+=1)P[e].c();oe=v(),D=c("div");for(let e=0;e<k.length;e+=1)k[e].c();b(s,"class","m-b-sm"),b(p,"class","content txt-lg m-b-sm"),b(W,"class","m-b-xs"),b(q,"class","label label-primary"),b(B,"class","content"),b(O,"class","alert alert-success"),b(E,"class","section-title"),b(T,"class","table-compact table-border m-b-base"),b(g,"class","section-title"),b(A,"class","tabs-header compact left"),b(D,"class","tabs-content"),b(N,"class","tabs")},m(e,t){r(e,s,t),n(s,l),n(s,_),n(s,u),r(e,i,t),r(e,p,t),n(p,m),n(m,S),n(m,h),n(h,j),n(m,ee),r(e,H,t),we(R,e,t),r(e,L,t),r(e,W,t),r(e,Q,t),r(e,O,t),n(O,q),n(O,te),n(O,B),n(B,$),n($,se),n($,z),n(z,G),n($,le),r(e,J,t),r(e,E,t),r(e,V,t),r(e,T,t),r(e,X,t),r(e,g,t),r(e,Y,t),r(e,N,t),n(N,A);for(let f=0;f<P.length;f+=1)P[f].m(A,null);n(N,oe),n(N,D);for(let f=0;f<k.length;f+=1)k[f].m(D,null);C=!0},p(e,[t]){var fe,pe;(!C||t&1)&&a!==(a=e[0].name+"")&&K(_,a),(!C||t&1)&&M!==(M=e[0].name+"")&&K(j,M);const f={};t&9&&(f.js=`
|
||||
<td>The new password confirmation.</td></tr></tbody>`,X=v(),g=c("div"),g.textContent="Responses",Y=v(),N=c("div"),A=c("div");for(let e=0;e<P.length;e+=1)P[e].c();oe=v(),D=c("div");for(let e=0;e<k.length;e+=1)k[e].c();b(s,"class","m-b-sm"),b(p,"class","content txt-lg m-b-sm"),b(W,"class","m-b-xs"),b(B,"class","label label-primary"),b(M,"class","content"),b(O,"class","alert alert-success"),b(E,"class","section-title"),b(T,"class","table-compact table-border m-b-base"),b(g,"class","section-title"),b(A,"class","tabs-header compact left"),b(D,"class","tabs-content"),b(N,"class","tabs")},m(e,t){r(e,s,t),n(s,l),n(s,_),n(s,u),r(e,i,t),r(e,p,t),n(p,m),n(m,S),n(m,h),n(h,j),n(m,ee),r(e,H,t),we(R,e,t),r(e,L,t),r(e,W,t),r(e,Q,t),r(e,O,t),n(O,B),n(O,te),n(O,M),n(M,$),n($,se),n($,z),n(z,G),n($,le),r(e,J,t),r(e,E,t),r(e,V,t),r(e,T,t),r(e,X,t),r(e,g,t),r(e,Y,t),r(e,N,t),n(N,A);for(let f=0;f<P.length;f+=1)P[f].m(A,null);n(N,oe),n(N,D);for(let f=0;f<k.length;f+=1)k[f].m(D,null);C=!0},p(e,[t]){var fe,pe;(!C||t&1)&&a!==(a=e[0].name+"")&&K(_,a),(!C||t&1)&&q!==(q=e[0].name+"")&&K(j,q);const f={};t&9&&(f.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${e[3]}');
|
||||
@@ -60,7 +60,7 @@ import{S as Se,i as he,s as Re,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as
|
||||
'NEW_PASSWORD',
|
||||
'NEW_PASSWORD_CONFIRM',
|
||||
);
|
||||
`),R.$set(f),(!C||t&1)&&I!==(I=e[0].name+"")&&K(G,I),t&6&&(F=e[2],P=me(P,t,ie,1,e,F,ae,A,Oe,_e,null,be)),t&6&&(y=e[2],Ne(),k=me(k,t,ce,1,e,y,ne,D,Ce,ke,null,ue),We())},i(e){if(!C){Z(R.$$.fragment,e);for(let t=0;t<y.length;t+=1)Z(k[t]);C=!0}},o(e){x(R.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);C=!1},d(e){e&&d(s),e&&d(i),e&&d(p),e&&d(H),Pe(R,e),e&&d(L),e&&d(W),e&&d(Q),e&&d(O),e&&d(J),e&&d(E),e&&d(V),e&&d(T),e&&d(X),e&&d(g),e&&d(Y),e&&d(N);for(let t=0;t<P.length;t+=1)P[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function Me(o,s,l){let a,{collection:_=new $e}=s,u=204,i=[];const p=m=>l(1,u=m.code);return o.$$set=m=>{"collection"in m&&l(0,_=m.collection)},l(3,a=Ee.getApiExampleUrl(Te.baseUrl)),l(2,i=[{code:204,body:"null"},{code:400,body:`
|
||||
`),R.$set(f),(!C||t&1)&&F!==(F=e[0].name+"")&&K(G,F),t&6&&(I=e[2],P=me(P,t,ie,1,e,I,ae,A,Oe,_e,null,be)),t&6&&(y=e[2],Ne(),k=me(k,t,ce,1,e,y,ne,D,Ce,ke,null,ue),We())},i(e){if(!C){Z(R.$$.fragment,e);for(let t=0;t<y.length;t+=1)Z(k[t]);C=!0}},o(e){x(R.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);C=!1},d(e){e&&d(s),e&&d(i),e&&d(p),e&&d(H),Pe(R,e),e&&d(L),e&&d(W),e&&d(Q),e&&d(O),e&&d(J),e&&d(E),e&&d(V),e&&d(T),e&&d(X),e&&d(g),e&&d(Y),e&&d(N);for(let t=0;t<P.length;t+=1)P[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function qe(o,s,l){let a,{collection:_=new $e}=s,u=204,i=[];const p=m=>l(1,u=m.code);return o.$$set=m=>{"collection"in m&&l(0,_=m.collection)},l(3,a=Ee.getApiExampleUrl(Te.baseUrl)),l(2,i=[{code:204,body:"null"},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to authenticate.",
|
||||
@@ -71,4 +71,4 @@ import{S as Se,i as he,s as Re,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as
|
||||
}
|
||||
}
|
||||
}
|
||||
`}]),[_,u,i,a,p]}class Ie extends Se{constructor(s){super(),he(this,s,Me,ye,Re,{collection:0})}}export{Ie as default};
|
||||
`}]),[_,u,i,a,p]}class Fe extends Se{constructor(s){super(),he(this,s,qe,ye,Re,{collection:0})}}export{Fe as default};
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
import{S as we,i as Ce,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as n,m as he,x as H,N as de,O as Te,k as ge,P as ye,n as Be,t as Z,a as x,o as f,d as $e,Q as qe,C as Oe,p as Se,r as I,u as Ee,M as Me}from"./index-9ce6aa95.js";import{S as Ne}from"./SdkTabs-ccd8881b.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=c("button"),_=h(o),u=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(w,C){r(w,s,C),n(s,_),n(s,u),a||(p=Ee(s,"click",d),a=!0)},p(w,C){l=w,C&4&&o!==(o=l[5].code+"")&&H(_,o),C&6&&I(s,"active",l[1]===l[5].code)},d(w){w&&f(s),a=!1,p()}}}function ke(i,l){let s,o,_,u;return o=new Me({props:{content:l[5].body}}),{key:i,first:null,c(){s=c("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(a,p){r(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)&&I(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&&f(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+"",R,ee,F,P,L,B,Q,T,A,te,U,q,le,z,j=i[0].name+"",G,se,J,O,W,S,X,E,Y,g,M,$=[],oe=new Map,ie,N,k=[],ne=new Map,y;P=new Ne({props:{js:`
|
||||
import{S as we,i as Ce,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as n,m as he,x as D,O as de,P as Te,k as ge,Q as ye,n as Be,t as Z,a as x,o as f,d as $e,R as qe,C as Oe,p as Se,r as H,u as Ee,N as Ne}from"./index-e4123b79.js";import{S as Ve}from"./SdkTabs-a1061d88.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=c("button"),_=h(o),u=v(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(w,C){r(w,s,C),n(s,_),n(s,u),a||(p=Ee(s,"click",d),a=!0)},p(w,C){l=w,C&4&&o!==(o=l[5].code+"")&&D(_,o),C&6&&H(s,"active",l[1]===l[5].code)},d(w){w&&f(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=c("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(a,p){r(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)&&H(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&&f(s),$e(o)}}}function Ke(i){var re,fe;let l,s,o=i[0].name+"",_,u,a,p,d,w,C,M=i[0].name+"",F,ee,I,P,L,B,Q,T,A,te,R,q,le,z,U=i[0].name+"",G,se,J,O,W,S,X,E,Y,g,N,$=[],oe=new Map,ie,V,k=[],ne=new Map,y;P=new Ve({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${i[3]}');
|
||||
@@ -14,13 +14,13 @@ import{S as we,i as Ce,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as n
|
||||
...
|
||||
|
||||
await pb.collection('${(fe=i[0])==null?void 0:fe.name}').confirmVerification('TOKEN');
|
||||
`}});let D=i[2];const ae=e=>e[5].code;for(let e=0;e<D.length;e+=1){let t=be(i,D,e),m=ae(t);oe.set(m,$[e]=_e(m,t))}let V=i[2];const ce=e=>e[5].code;for(let e=0;e<V.length;e+=1){let t=ue(i,V,e),m=ce(t);ne.set(m,k[e]=ke(m,t))}return{c(){l=c("h3"),s=h("Confirm verification ("),_=h(o),u=h(")"),a=v(),p=c("div"),d=c("p"),w=h("Confirms "),C=c("strong"),R=h(K),ee=h(" account verification request."),F=v(),ve(P.$$.fragment),L=v(),B=c("h6"),B.textContent="API details",Q=v(),T=c("div"),A=c("strong"),A.textContent="POST",te=v(),U=c("div"),q=c("p"),le=h("/api/collections/"),z=c("strong"),G=h(j),se=h("/confirm-verification"),J=v(),O=c("div"),O.textContent="Body Parameters",W=v(),S=c("table"),S.innerHTML=`<thead><tr><th>Param</th>
|
||||
`}});let j=i[2];const ae=e=>e[5].code;for(let e=0;e<j.length;e+=1){let t=be(i,j,e),m=ae(t);oe.set(m,$[e]=_e(m,t))}let K=i[2];const ce=e=>e[5].code;for(let e=0;e<K.length;e+=1){let t=ue(i,K,e),m=ce(t);ne.set(m,k[e]=ke(m,t))}return{c(){l=c("h3"),s=h("Confirm verification ("),_=h(o),u=h(")"),a=v(),p=c("div"),d=c("p"),w=h("Confirms "),C=c("strong"),F=h(M),ee=h(" account verification request."),I=v(),ve(P.$$.fragment),L=v(),B=c("h6"),B.textContent="API details",Q=v(),T=c("div"),A=c("strong"),A.textContent="POST",te=v(),R=c("div"),q=c("p"),le=h("/api/collections/"),z=c("strong"),G=h(U),se=h("/confirm-verification"),J=v(),O=c("div"),O.textContent="Body Parameters",W=v(),S=c("table"),S.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>
|
||||
<span>token</span></div></td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>The token from the verification request email.</td></tr></tbody>`,X=v(),E=c("div"),E.textContent="Responses",Y=v(),g=c("div"),M=c("div");for(let e=0;e<$.length;e+=1)$[e].c();ie=v(),N=c("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(B,"class","m-b-xs"),b(A,"class","label label-primary"),b(U,"class","content"),b(T,"class","alert alert-success"),b(O,"class","section-title"),b(S,"class","table-compact table-border m-b-base"),b(E,"class","section-title"),b(M,"class","tabs-header compact left"),b(N,"class","tabs-content"),b(g,"class","tabs")},m(e,t){r(e,l,t),n(l,s),n(l,_),n(l,u),r(e,a,t),r(e,p,t),n(p,d),n(d,w),n(d,C),n(C,R),n(d,ee),r(e,F,t),he(P,e,t),r(e,L,t),r(e,B,t),r(e,Q,t),r(e,T,t),n(T,A),n(T,te),n(T,U),n(U,q),n(q,le),n(q,z),n(z,G),n(q,se),r(e,J,t),r(e,O,t),r(e,W,t),r(e,S,t),r(e,X,t),r(e,E,t),r(e,Y,t),r(e,g,t),n(g,M);for(let m=0;m<$.length;m+=1)$[m].m(M,null);n(g,ie),n(g,N);for(let m=0;m<k.length;m+=1)k[m].m(N,null);y=!0},p(e,[t]){var me,pe;(!y||t&1)&&o!==(o=e[0].name+"")&&H(_,o),(!y||t&1)&&K!==(K=e[0].name+"")&&H(R,K);const m={};t&9&&(m.js=`
|
||||
<td>The token from the verification request email.</td></tr></tbody>`,X=v(),E=c("div"),E.textContent="Responses",Y=v(),g=c("div"),N=c("div");for(let e=0;e<$.length;e+=1)$[e].c();ie=v(),V=c("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(B,"class","m-b-xs"),b(A,"class","label label-primary"),b(R,"class","content"),b(T,"class","alert alert-success"),b(O,"class","section-title"),b(S,"class","table-compact table-border m-b-base"),b(E,"class","section-title"),b(N,"class","tabs-header compact left"),b(V,"class","tabs-content"),b(g,"class","tabs")},m(e,t){r(e,l,t),n(l,s),n(l,_),n(l,u),r(e,a,t),r(e,p,t),n(p,d),n(d,w),n(d,C),n(C,F),n(d,ee),r(e,I,t),he(P,e,t),r(e,L,t),r(e,B,t),r(e,Q,t),r(e,T,t),n(T,A),n(T,te),n(T,R),n(R,q),n(q,le),n(q,z),n(z,G),n(q,se),r(e,J,t),r(e,O,t),r(e,W,t),r(e,S,t),r(e,X,t),r(e,E,t),r(e,Y,t),r(e,g,t),n(g,N);for(let m=0;m<$.length;m+=1)$[m].m(N,null);n(g,ie),n(g,V);for(let m=0;m<k.length;m+=1)k[m].m(V,null);y=!0},p(e,[t]){var me,pe;(!y||t&1)&&o!==(o=e[0].name+"")&&D(_,o),(!y||t&1)&&M!==(M=e[0].name+"")&&D(F,M);const m={};t&9&&(m.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${e[3]}');
|
||||
@@ -36,7 +36,7 @@ import{S as we,i as Ce,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as n
|
||||
...
|
||||
|
||||
await pb.collection('${(pe=e[0])==null?void 0:pe.name}').confirmVerification('TOKEN');
|
||||
`),P.$set(m),(!y||t&1)&&j!==(j=e[0].name+"")&&H(G,j),t&6&&(D=e[2],$=de($,t,ae,1,e,D,oe,M,Te,_e,null,be)),t&6&&(V=e[2],ge(),k=de(k,t,ce,1,e,V,ne,N,ye,ke,null,ue),Be())},i(e){if(!y){Z(P.$$.fragment,e);for(let t=0;t<V.length;t+=1)Z(k[t]);y=!0}},o(e){x(P.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);y=!1},d(e){e&&f(l),e&&f(a),e&&f(p),e&&f(F),$e(P,e),e&&f(L),e&&f(B),e&&f(Q),e&&f(T),e&&f(J),e&&f(O),e&&f(W),e&&f(S),e&&f(X),e&&f(E),e&&f(Y),e&&f(g);for(let t=0;t<$.length;t+=1)$[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function Ke(i,l,s){let o,{collection:_=new qe}=l,u=204,a=[];const p=d=>s(1,u=d.code);return i.$$set=d=>{"collection"in d&&s(0,_=d.collection)},s(3,o=Oe.getApiExampleUrl(Se.baseUrl)),s(2,a=[{code:204,body:"null"},{code:400,body:`
|
||||
`),P.$set(m),(!y||t&1)&&U!==(U=e[0].name+"")&&D(G,U),t&6&&(j=e[2],$=de($,t,ae,1,e,j,oe,N,Te,_e,null,be)),t&6&&(K=e[2],ge(),k=de(k,t,ce,1,e,K,ne,V,ye,ke,null,ue),Be())},i(e){if(!y){Z(P.$$.fragment,e);for(let t=0;t<K.length;t+=1)Z(k[t]);y=!0}},o(e){x(P.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);y=!1},d(e){e&&f(l),e&&f(a),e&&f(p),e&&f(I),$e(P,e),e&&f(L),e&&f(B),e&&f(Q),e&&f(T),e&&f(J),e&&f(O),e&&f(W),e&&f(S),e&&f(X),e&&f(E),e&&f(Y),e&&f(g);for(let t=0;t<$.length;t+=1)$[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function Me(i,l,s){let o,{collection:_=new qe}=l,u=204,a=[];const p=d=>s(1,u=d.code);return i.$$set=d=>{"collection"in d&&s(0,_=d.collection)},s(3,o=Oe.getApiExampleUrl(Se.baseUrl)),s(2,a=[{code:204,body:"null"},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to authenticate.",
|
||||
@@ -47,4 +47,4 @@ import{S as we,i as Ce,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as n
|
||||
}
|
||||
}
|
||||
}
|
||||
`}]),[_,u,a,o,p]}class je extends we{constructor(l){super(),Ce(this,l,Ke,Ve,Pe,{collection:0})}}export{je as default};
|
||||
`}]),[_,u,a,o,p]}class Ue extends we{constructor(l){super(),Ce(this,l,Me,Ke,Pe,{collection:0})}}export{Ue as default};
|
||||
+16
-16
@@ -1,15 +1,15 @@
|
||||
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,O as ht,k as Bt,P as Ft,n as Rt,t as fe,a as pe,o as d,d as Fe,Q as gt,p as jt,r as ue,u as Dt,y as le}from"./index-9ce6aa95.js";import{S as Nt}from"./SdkTabs-ccd8881b.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,y,T,w,M,g,D,V,L,I,j,F,S,N,q,C,_;function O(u,$){var ee,K;return(K=(ee=u[0])==null?void 0:ee.options)!=null&&K.requireEmail?It: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>
|
||||
import{S as Ht,i as Lt,s as Pt,C as Q,N 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 Re,x,O as Le,P as ht,k as Rt,Q as Bt,n as Ft,t as fe,a as pe,o as d,d as Be,R as gt,p as jt,r as ue,u as Dt,y as le}from"./index-e4123b79.js";import{S as Nt}from"./SdkTabs-a1061d88.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,y,T,w,O,g,D,V,L,J,j,B,S,N,q,C,_;function M(u,$){var ee,K;return(K=(ee=u[0])==null?void 0:ee.options)!=null&&K.requireEmail?Jt:Vt}let z=M(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(),y=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.",V=m(),L=a("tr"),L.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
|
||||
If not set, it will be auto generated.</td>`,b=m(),p=a("tr"),c=a("td"),f=a("div"),P.c(),y=m(),T=a("span"),T.textContent="email",w=m(),O=a("td"),O.innerHTML='<span class="label">String</span>',g=m(),D=a("td"),D.textContent="Auth record email address.",V=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>
|
||||
<td>Whether to show/hide the auth record email when fetching the record data.</td>`,J=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>`,F=m(),S=a("tr"),S.innerHTML=`<td><div class="inline-flex"><span class="label label-success">Required</span>
|
||||
<td>Auth record password.</td>`,B=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>
|
||||
@@ -17,8 +17,8 @@ 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
|
||||
<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 "Manage" 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,y),n(f,T),n(p,w),n(p,M),n(p,g),n(p,D),r(u,V,$),r(u,L,$),r(u,I,$),r(u,j,$),r(u,F,$),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,y)))},d(u){u&&d(e),u&&d(l),u&&d(s),u&&d(b),u&&d(p),P.d(),u&&d(V),u&&d(L),u&&d(I),u&&d(j),u&&d(F),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 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 Jt(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 Et(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 y;f&1&&l!==(l=((y=c[12].options)==null?void 0:y.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+"",y,T,w,M,g=Q.getFieldValueType(e[12])+"",D,V,L,I;function j(_,O){return _[12].required?Et:Jt}let F=j(e),S=F(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"),y=k(f),T=m(),w=a("td"),M=a("span"),D=k(g),V=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,y),n(l,T),n(l,w),n(w,M),n(M,D),n(l,V),n(l,L),C&&C.m(L,null),n(l,I)},p(_,O){e=_,F!==(F=j(e))&&(S.d(1),S=F(e),S&&(S.c(),S.m(b,p))),O&1&&f!==(f=e[12].name+"")&&x(y,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 y(){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",y),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 y={};f&4&&(y.content=e[7].body),s.$set(y),(!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,y,T,w,M=o[0].name+"",g,D,V,L,I,j,F,S,N,q,C,_,O,z,P,u,$,ee,K=o[0].name+"",me,Re,ge,be,ne,_e,W,ke,je,J,ye,De,ve,E=[],Ne=new Map,he,se,we,Y,Ce,Ve,Se,G,$e,Ie,Te,Je,A,Ee,te,Ue,Qe,ze,qe,Ke,Me,We,Ye,Ge,Oe,Xe,Ae,ie,He,X,ae,U=[],Ze=new Map,xe,oe,R=[],et=new Map,Z;S=new Nt({props:{js:`
|
||||
This field can be set only by admins or auth records with "Manage" 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,y),n(f,T),n(p,w),n(p,O),n(p,g),n(p,D),r(u,V,$),r(u,L,$),r(u,J,$),r(u,j,$),r(u,B,$),r(u,S,$),r(u,N,$),r(u,q,$),r(u,C,$),r(u,_,$)},p(u,$){z!==(z=M(u))&&(P.d(1),P=z(u),P&&(P.c(),P.m(f,y)))},d(u){u&&d(e),u&&d(l),u&&d(s),u&&d(b),u&&d(p),P.d(),u&&d(V),u&&d(L),u&&d(J),u&&d(j),u&&d(B),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 y;f&1&&l!==(l=((y=c[12].options)==null?void 0:y.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+"",y,T,w,O,g=Q.getFieldValueType(e[12])+"",D,V,L,J;function j(_,M){return _[12].required?It:Et}let B=j(e),S=B(e);function N(_,M){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"),y=k(f),T=m(),w=a("td"),O=a("span"),D=k(g),V=m(),L=a("td"),C&&C.c(),J=m(),h(b,"class","inline-flex"),h(O,"class","label"),this.first=l},m(_,M){r(_,l,M),n(l,s),n(s,b),S.m(b,null),n(b,p),n(b,c),n(c,y),n(l,T),n(l,w),n(w,O),n(O,D),n(l,V),n(l,L),C&&C.m(L,null),n(l,J)},p(_,M){e=_,B!==(B=j(e))&&(S.d(1),S=B(e),S&&(S.c(),S.m(b,p))),M&1&&f!==(f=e[12].name+"")&&x(y,f),M&1&&g!==(g=Q.getFieldValueType(e[12])+"")&&x(D,g),q===(q=N(e))&&C?C.p(e,M):(C&&C.d(1),C=q&&q(e),C&&(C.c(),C.m(L,null)))},d(_){_&&d(l),S.d(),C&&C.d()}}}function Ot(o,e){let l,s=e[7].code+"",b,p,c,f;function y(){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",y),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 Mt(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),Re(s,l,null),n(l,b),p=!0},p(c,f){e=c;const y={};f&4&&(y.content=e[7].body),s.$set(y),(!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),Be(s)}}}function Xt(o){var st,it,at,ot,rt,dt,ct,ft;let e,l,s=o[0].name+"",b,p,c,f,y,T,w,O=o[0].name+"",g,D,V,L,J,j,B,S,N,q,C,_,M,z,P,u,$,ee,K=o[0].name+"",me,Fe,ge,be,ne,_e,W,ke,je,E,ye,De,ve,I=[],Ne=new Map,he,se,we,Y,Ce,Ve,Se,G,$e,Je,Te,Ee,A,Ie,te,Ue,Qe,ze,qe,Ke,Oe,We,Ye,Ge,Me,Xe,Ae,ie,He,X,ae,U=[],Ze=new Map,xe,oe,F=[],et=new Map,Z;S=new Nt({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${o[4]}');
|
||||
@@ -46,27 +46,27 @@ final record = await pb.collection('${(ot=o[0])==null?void 0:ot.name}').create(b
|
||||
`+((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 B=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),v=tt(i);Ne.set(v,E[t]=qt(v,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),v=lt(i);Ze.set(v,U[t]=Mt(v,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),v=nt(i);et.set(v,R[t]=Ot(v,i))}return{c(){e=a("h3"),l=k("Create ("),b=k(s),p=k(")"),c=m(),f=a("div"),y=a("p"),T=k("Create a new "),w=a("strong"),g=k(M),D=k(" record."),V=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>.
|
||||
`:"")}});let R=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),v=tt(i);Ne.set(v,I[t]=qt(v,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),v=lt(i);Ze.set(v,U[t]=Ot(v,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),v=nt(i);et.set(v,F[t]=Mt(v,i))}return{c(){e=a("h3"),l=k("Create ("),b=k(s),p=k(")"),c=m(),f=a("div"),y=a("p"),T=k("Create a new "),w=a("strong"),g=k(O),D=k(" record."),V=m(),L=a("p"),L.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||||
<code>multipart/form-data</code>.`,J=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>.`,F=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(),B&&B.c(),be=m(),ne=a("div"),ne.textContent="Body Parameters",_e=m(),W=a("table"),ke=a("thead"),ke.innerHTML=`<tr><th>Param</th>
|
||||
</a>.`,B=m(),Pe(S.$$.fragment),N=m(),q=a("h6"),q.textContent="API details",C=m(),_=a("div"),M=a("strong"),M.textContent="POST",z=m(),P=a("div"),u=a("p"),$=k("/api/collections/"),ee=a("strong"),me=k(K),Fe=k("/records"),ge=m(),R&&R.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(),J=a("tbody"),ye=a("tr"),ye.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
|
||||
<th width="50%">Description</th></tr>`,je=m(),E=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<E.length;t+=1)E[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>
|
||||
If not set, it will be auto generated.</td>`,De=m(),H&&H.c(),ve=m();for(let t=0;t<I.length;t+=1)I[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",Ie=m(),Te=a("td"),Te.innerHTML='<span class="label">String</span>',Je=m(),A=a("td"),Ee=k(`Auto expand relations when returning the created record. Ex.:
|
||||
<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(`).
|
||||
`),qe=a("code"),qe.textContent="expand",Ke=k(" property (eg. "),Oe=a("code"),Oe.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<U.length;t+=1)U[t].c();xe=m(),oe=a("div");for(let t=0;t<R.length;t+=1)R[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,y),n(y,T),n(y,w),n(w,g),n(y,D),n(f,V),n(f,L),n(f,I),n(f,j),r(t,F,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),B&&B.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,J),n(J,ye),n(J,De),H&&H.m(J,null),n(J,ve);for(let v=0;v<E.length;v+=1)E[v].m(J,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,Ie),n(G,Te),n(G,Je),n(G,A),n(A,Ee),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 v=0;v<U.length;v+=1)U[v].m(ae,null);n(X,xe),n(X,oe);for(let v=0;v<R.length;v+=1)R[v].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 v={};i&25&&(v.js=`
|
||||
Only the relations to which the request user has permissions to `),Me=a("strong"),Me.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<U.length;t+=1)U[t].c();xe=m(),oe=a("div");for(let t=0;t<F.length;t+=1)F[t].c();h(e,"class","m-b-sm"),h(f,"class","content txt-lg m-b-sm"),h(q,"class","m-b-xs"),h(M,"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,y),n(y,T),n(y,w),n(w,g),n(y,D),n(f,V),n(f,L),n(f,J),n(f,j),r(t,B,i),Re(S,t,i),r(t,N,i),r(t,q,i),r(t,C,i),r(t,_,i),n(_,M),n(_,z),n(_,P),n(P,u),n(u,$),n(u,ee),n(ee,me),n(u,Fe),n(_,ge),R&&R.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,E),n(E,ye),n(E,De),H&&H.m(E,null),n(E,ve);for(let v=0;v<I.length;v+=1)I[v].m(E,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),Re(te,A,null),n(A,Ue),n(A,Qe),n(A,ze),n(A,qe),n(A,Ke),n(A,Oe),n(A,We),n(A,Ye),n(A,Ge),n(A,Me),n(A,Xe),r(t,Ae,i),r(t,ie,i),r(t,He,i),r(t,X,i),n(X,ae);for(let v=0;v<U.length;v+=1)U[v].m(ae,null);n(X,xe),n(X,oe);for(let v=0;v<F.length;v+=1)F[v].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)&&O!==(O=t[0].name+"")&&x(g,O);const v={};i&25&&(v.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${t[4]}');
|
||||
@@ -94,12 +94,12 @@ final record = await pb.collection('${(bt=t[0])==null?void 0:bt.name}').create(b
|
||||
`+((_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(v),(!Z||i&1)&&K!==(K=t[0].name+"")&&x(me,K),t[5]?B||(B=$t(),B.c(),B.m(_,null)):B&&(B.d(1),B=null),(yt=t[0])!=null&&yt.isAuth?H?H.p(t,i):(H=Tt(t),H.c(),H.m(J,ve)):H&&(H.d(1),H=null),i&1&&(de=(vt=t[0])==null?void 0:vt.schema,E=Le(E,i,tt,1,t,de,Ne,J,ht,qt,null,St)),i&6&&(ce=t[2],U=Le(U,i,lt,1,t,ce,Ze,ae,ht,Mt,null,Ct)),i&6&&(re=t[2],Bt(),R=Le(R,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(R[i]);Z=!0}},o(t){pe(S.$$.fragment,t),pe(te.$$.fragment,t);for(let i=0;i<R.length;i+=1)pe(R[i]);Z=!1},d(t){t&&d(e),t&&d(c),t&&d(f),t&&d(F),Fe(S,t),t&&d(N),t&&d(q),t&&d(C),t&&d(_),B&&B.d(),t&&d(be),t&&d(ne),t&&d(_e),t&&d(W),H&&H.d();for(let i=0;i<E.length;i+=1)E[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<U.length;i+=1)U[i].d();for(let i=0;i<R.length;i+=1)R[i].d()}}}function Zt(o,e,l){let s,b,{collection:p=new gt}=e,c=200,f=[],y={};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:`
|
||||
`:"")),S.$set(v),(!Z||i&1)&&K!==(K=t[0].name+"")&&x(me,K),t[5]?R||(R=$t(),R.c(),R.m(_,null)):R&&(R.d(1),R=null),(yt=t[0])!=null&&yt.isAuth?H?H.p(t,i):(H=Tt(t),H.c(),H.m(E,ve)):H&&(H.d(1),H=null),i&1&&(de=(vt=t[0])==null?void 0:vt.schema,I=Le(I,i,tt,1,t,de,Ne,E,ht,qt,null,St)),i&6&&(ce=t[2],U=Le(U,i,lt,1,t,ce,Ze,ae,ht,Ot,null,Ct)),i&6&&(re=t[2],Rt(),F=Le(F,i,nt,1,t,re,et,oe,Bt,Mt,null,wt),Ft())},i(t){if(!Z){fe(S.$$.fragment,t),fe(te.$$.fragment,t);for(let i=0;i<re.length;i+=1)fe(F[i]);Z=!0}},o(t){pe(S.$$.fragment,t),pe(te.$$.fragment,t);for(let i=0;i<F.length;i+=1)pe(F[i]);Z=!1},d(t){t&&d(e),t&&d(c),t&&d(f),t&&d(B),Be(S,t),t&&d(N),t&&d(q),t&&d(C),t&&d(_),R&&R.d(),t&&d(be),t&&d(ne),t&&d(_e),t&&d(W),H&&H.d();for(let i=0;i<I.length;i+=1)I[i].d();t&&d(he),t&&d(se),t&&d(we),t&&d(Y),Be(te),t&&d(Ae),t&&d(ie),t&&d(He),t&&d(X);for(let i=0;i<U.length;i+=1)U[i].d();for(let i=0;i<F.length;i+=1)F[i].d()}}}function Zt(o,e,l){let s,b,{collection:p=new gt}=e,c=200,f=[],y={};const T=w=>l(1,c=w.code);return o.$$set=w=>{"collection"in w&&l(0,p=w.collection)},o.$$.update=()=>{var w,O;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}": {
|
||||
"${(O=(w=p==null?void 0:p.schema)==null?void 0:w[0])==null?void 0:O.name}": {
|
||||
"code": "validation_required",
|
||||
"message": "Missing required value."
|
||||
}
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
import{S as Ce,i as Re,s as Pe,e as c,w as D,b as k,c as $e,f as m,g as d,h as n,m as we,x,N as _e,O as Ee,k as Oe,P as Te,n as Be,t as ee,a as te,o as f,d as ge,Q as Ie,C as Me,p as Ae,r as N,u as Se,M as qe}from"./index-9ce6aa95.js";import{S as He}from"./SdkTabs-ccd8881b.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){d(s,l,a)},d(s){s&&f(l)}}}function ye(o,l){let s,a=l[6].code+"",h,i,r,u;function $(){return l[5](l[6])}return{key:o,first:null,c(){s=c("button"),h=D(a),i=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(b,g){d(b,s,g),n(s,h),n(s,i),r||(u=Se(s,"click",$),r=!0)},p(b,g){l=b,g&20&&N(s,"active",l[2]===l[6].code)},d(b){b&&f(s),r=!1,u()}}}function De(o,l){let s,a,h,i;return a=new qe({props:{content:l[6].body}}),{key:o,first:null,c(){s=c("div"),$e(a.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(r,u){d(r,s,u),we(a,s,null),n(s,h),i=!0},p(r,u){l=r,(!i||u&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&&f(s),ge(a)}}}function Le(o){var ue,pe;let l,s,a=o[0].name+"",h,i,r,u,$,b,g,q=o[0].name+"",z,le,F,C,K,O,Q,y,H,se,L,E,oe,G,U=o[0].name+"",J,ae,V,ne,W,T,X,B,Y,I,Z,R,M,w=[],ie=new Map,re,A,v=[],ce=new Map,P;C=new He({props:{js:`
|
||||
import{S as Ce,i as Re,s as Pe,e as c,w as D,b as k,c as $e,f as m,g as d,h as n,m as we,x,O as _e,P as Ee,k as Oe,Q as Te,n as Be,t as ee,a as te,o as f,d as ge,R as Ie,C as Ae,p as Me,r as N,u as Se,N as qe}from"./index-e4123b79.js";import{S as He}from"./SdkTabs-a1061d88.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){d(s,l,a)},d(s){s&&f(l)}}}function ye(o,l){let s,a=l[6].code+"",h,i,r,u;function $(){return l[5](l[6])}return{key:o,first:null,c(){s=c("button"),h=D(a),i=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(b,g){d(b,s,g),n(s,h),n(s,i),r||(u=Se(s,"click",$),r=!0)},p(b,g){l=b,g&20&&N(s,"active",l[2]===l[6].code)},d(b){b&&f(s),r=!1,u()}}}function De(o,l){let s,a,h,i;return a=new qe({props:{content:l[6].body}}),{key:o,first:null,c(){s=c("div"),$e(a.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(r,u){d(r,s,u),we(a,s,null),n(s,h),i=!0},p(r,u){l=r,(!i||u&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&&f(s),ge(a)}}}function Le(o){var ue,pe;let l,s,a=o[0].name+"",h,i,r,u,$,b,g,q=o[0].name+"",z,le,F,C,K,O,Q,y,H,se,L,E,oe,G,U=o[0].name+"",J,ae,V,ne,W,T,X,B,Y,I,Z,R,A,w=[],ie=new Map,re,M,v=[],ce=new Map,P;C=new He({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${o[3]}');
|
||||
@@ -19,7 +19,7 @@ import{S as Ce,i as Re,s as Pe,e as c,w as D,b as k,c as $e,f as m,g as d,h as n
|
||||
<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 delete.</td></tr></tbody>`,Y=k(),I=c("div"),I.textContent="Responses",Z=k(),R=c("div"),M=c("div");for(let e=0;e<w.length;e+=1)w[e].c();re=k(),A=c("div");for(let e=0;e<v.length;e+=1)v[e].c();m(l,"class","m-b-sm"),m(u,"class","content txt-lg m-b-sm"),m(O,"class","m-b-xs"),m(H,"class","label label-primary"),m(L,"class","content"),m(y,"class","alert alert-danger"),m(T,"class","section-title"),m(B,"class","table-compact table-border m-b-base"),m(I,"class","section-title"),m(M,"class","tabs-header compact left"),m(A,"class","tabs-content"),m(R,"class","tabs")},m(e,t){d(e,l,t),n(l,s),n(l,h),n(l,i),d(e,r,t),d(e,u,t),n(u,$),n($,b),n($,g),n(g,z),n($,le),d(e,F,t),we(C,e,t),d(e,K,t),d(e,O,t),d(e,Q,t),d(e,y,t),n(y,H),n(y,se),n(y,L),n(L,E),n(E,oe),n(E,G),n(G,J),n(E,ae),n(E,V),n(y,ne),_&&_.m(y,null),d(e,W,t),d(e,T,t),d(e,X,t),d(e,B,t),d(e,Y,t),d(e,I,t),d(e,Z,t),d(e,R,t),n(R,M);for(let p=0;p<w.length;p+=1)w[p].m(M,null);n(R,re),n(R,A);for(let p=0;p<v.length;p+=1)v[p].m(A,null);P=!0},p(e,[t]){var me,be;(!P||t&1)&&a!==(a=e[0].name+"")&&x(h,a),(!P||t&1)&&q!==(q=e[0].name+"")&&x(z,q);const p={};t&9&&(p.js=`
|
||||
<td>ID of the record to delete.</td></tr></tbody>`,Y=k(),I=c("div"),I.textContent="Responses",Z=k(),R=c("div"),A=c("div");for(let e=0;e<w.length;e+=1)w[e].c();re=k(),M=c("div");for(let e=0;e<v.length;e+=1)v[e].c();m(l,"class","m-b-sm"),m(u,"class","content txt-lg m-b-sm"),m(O,"class","m-b-xs"),m(H,"class","label label-primary"),m(L,"class","content"),m(y,"class","alert alert-danger"),m(T,"class","section-title"),m(B,"class","table-compact table-border m-b-base"),m(I,"class","section-title"),m(A,"class","tabs-header compact left"),m(M,"class","tabs-content"),m(R,"class","tabs")},m(e,t){d(e,l,t),n(l,s),n(l,h),n(l,i),d(e,r,t),d(e,u,t),n(u,$),n($,b),n($,g),n(g,z),n($,le),d(e,F,t),we(C,e,t),d(e,K,t),d(e,O,t),d(e,Q,t),d(e,y,t),n(y,H),n(y,se),n(y,L),n(L,E),n(E,oe),n(E,G),n(G,J),n(E,ae),n(E,V),n(y,ne),_&&_.m(y,null),d(e,W,t),d(e,T,t),d(e,X,t),d(e,B,t),d(e,Y,t),d(e,I,t),d(e,Z,t),d(e,R,t),n(R,A);for(let p=0;p<w.length;p+=1)w[p].m(A,null);n(R,re),n(R,M);for(let p=0;p<v.length;p+=1)v[p].m(M,null);P=!0},p(e,[t]){var me,be;(!P||t&1)&&a!==(a=e[0].name+"")&&x(h,a),(!P||t&1)&&q!==(q=e[0].name+"")&&x(z,q);const p={};t&9&&(p.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${e[3]}');
|
||||
@@ -35,7 +35,7 @@ import{S as Ce,i as Re,s as Pe,e as c,w as D,b as k,c as $e,f as m,g as d,h as n
|
||||
...
|
||||
|
||||
await pb.collection('${(be=e[0])==null?void 0:be.name}').delete('RECORD_ID');
|
||||
`),C.$set(p),(!P||t&1)&&U!==(U=e[0].name+"")&&x(J,U),e[1]?_||(_=ve(),_.c(),_.m(y,null)):_&&(_.d(1),_=null),t&20&&(j=e[4],w=_e(w,t,de,1,e,j,ie,M,Ee,ye,null,he)),t&20&&(S=e[4],Oe(),v=_e(v,t,fe,1,e,S,ce,A,Te,De,null,ke),Be())},i(e){if(!P){ee(C.$$.fragment,e);for(let t=0;t<S.length;t+=1)ee(v[t]);P=!0}},o(e){te(C.$$.fragment,e);for(let t=0;t<v.length;t+=1)te(v[t]);P=!1},d(e){e&&f(l),e&&f(r),e&&f(u),e&&f(F),ge(C,e),e&&f(K),e&&f(O),e&&f(Q),e&&f(y),_&&_.d(),e&&f(W),e&&f(T),e&&f(X),e&&f(B),e&&f(Y),e&&f(I),e&&f(Z),e&&f(R);for(let t=0;t<w.length;t+=1)w[t].d();for(let t=0;t<v.length;t+=1)v[t].d()}}}function Ue(o,l,s){let a,h,{collection:i=new Ie}=l,r=204,u=[];const $=b=>s(2,r=b.code);return o.$$set=b=>{"collection"in b&&s(0,i=b.collection)},o.$$.update=()=>{o.$$.dirty&1&&s(1,a=(i==null?void 0:i.deleteRule)===null),o.$$.dirty&3&&i!=null&&i.id&&(u.push({code:204,body:`
|
||||
`),C.$set(p),(!P||t&1)&&U!==(U=e[0].name+"")&&x(J,U),e[1]?_||(_=ve(),_.c(),_.m(y,null)):_&&(_.d(1),_=null),t&20&&(j=e[4],w=_e(w,t,de,1,e,j,ie,A,Ee,ye,null,he)),t&20&&(S=e[4],Oe(),v=_e(v,t,fe,1,e,S,ce,M,Te,De,null,ke),Be())},i(e){if(!P){ee(C.$$.fragment,e);for(let t=0;t<S.length;t+=1)ee(v[t]);P=!0}},o(e){te(C.$$.fragment,e);for(let t=0;t<v.length;t+=1)te(v[t]);P=!1},d(e){e&&f(l),e&&f(r),e&&f(u),e&&f(F),ge(C,e),e&&f(K),e&&f(O),e&&f(Q),e&&f(y),_&&_.d(),e&&f(W),e&&f(T),e&&f(X),e&&f(B),e&&f(Y),e&&f(I),e&&f(Z),e&&f(R);for(let t=0;t<w.length;t+=1)w[t].d();for(let t=0;t<v.length;t+=1)v[t].d()}}}function Ue(o,l,s){let a,h,{collection:i=new Ie}=l,r=204,u=[];const $=b=>s(2,r=b.code);return o.$$set=b=>{"collection"in b&&s(0,i=b.collection)},o.$$.update=()=>{o.$$.dirty&1&&s(1,a=(i==null?void 0:i.deleteRule)===null),o.$$.dirty&3&&i!=null&&i.id&&(u.push({code:204,body:`
|
||||
null
|
||||
`}),u.push({code:400,body:`
|
||||
{
|
||||
@@ -55,4 +55,4 @@ import{S as Ce,i as Re,s as Pe,e as c,w as D,b as k,c as $e,f as m,g as d,h as n
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`}))},s(3,h=Me.getApiExampleUrl(Ae.baseUrl)),[i,a,r,h,u,$]}class ze extends Ce{constructor(l){super(),Re(this,l,Ue,Le,Pe,{collection:0})}}export{ze as default};
|
||||
`}))},s(3,h=Ae.getApiExampleUrl(Me.baseUrl)),[i,a,r,h,u,$]}class ze extends Ce{constructor(l){super(),Re(this,l,Ue,Le,Pe,{collection:0})}}export{ze as default};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+21
-21
@@ -1,14 +1,14 @@
|
||||
import{S as Se,i as Ne,s as qe,e,b as s,E as De,f as o,g as u,u as Me,y as Fe,o as m,w as _,h as t,M as he,c as Yt,m as Zt,x as we,N as Le,O as He,k as Ie,P as Be,n as Ge,t as It,a as Bt,d as te,Q as ze,C as _e,p as Ue,r as xe}from"./index-9ce6aa95.js";import{S as je}from"./SdkTabs-ccd8881b.js";function Qe(d){let n,a,r;return{c(){n=e("span"),n.textContent="Show details",a=s(),r=e("i"),o(n,"class","txt"),o(r,"class","ri-arrow-down-s-line")},m(f,p){u(f,n,p),u(f,a,p),u(f,r,p)},d(f){f&&m(n),f&&m(a),f&&m(r)}}}function Je(d){let n,a,r;return{c(){n=e("span"),n.textContent="Hide details",a=s(),r=e("i"),o(n,"class","txt"),o(r,"class","ri-arrow-up-s-line")},m(f,p){u(f,n,p),u(f,a,p),u(f,r,p)},d(f){f&&m(n),f&&m(a),f&&m(r)}}}function Ae(d){let n,a,r,f,p,b,x,$,h,w,c,V,bt,Gt,O,zt,q,it,F,W,ee,B,G,le,at,ht,X,xt,se,rt,ct,Y,R,Ut,wt,v,Z,_t,jt,$t,z,tt,Ct,Qt,kt,L,dt,gt,ne,ft,oe,M,yt,et,vt,U,pt,ie,D,Ft,lt,Lt,st,At,nt,j,E,Jt,Tt,Kt,Pt,C,Q,H,ae,Ot,re,ut,ce,I,Rt,de,Et,Vt,St,Wt,A,mt,J,K,S,Nt,fe,T,k,pe,N,y,ot,ue,P,qt,me,Mt,be,Dt,Xt,Ht;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format
|
||||
import{S as Se,i as Ne,s as qe,e,b as s,E as He,f as o,g as u,u as De,y as Fe,o as m,w as _,h as t,N as he,c as Yt,m as Zt,x as we,O as Le,P as Me,k as Be,Q as Ie,n as Ge,t as Bt,a as It,d as te,R as ze,C as _e,p as Ue,r as xe}from"./index-e4123b79.js";import{S as je}from"./SdkTabs-a1061d88.js";function Qe(d){let n,a,r;return{c(){n=e("span"),n.textContent="Show details",a=s(),r=e("i"),o(n,"class","txt"),o(r,"class","ri-arrow-down-s-line")},m(f,p){u(f,n,p),u(f,a,p),u(f,r,p)},d(f){f&&m(n),f&&m(a),f&&m(r)}}}function Je(d){let n,a,r;return{c(){n=e("span"),n.textContent="Hide details",a=s(),r=e("i"),o(n,"class","txt"),o(r,"class","ri-arrow-up-s-line")},m(f,p){u(f,n,p),u(f,a,p),u(f,r,p)},d(f){f&&m(n),f&&m(a),f&&m(r)}}}function Ae(d){let n,a,r,f,p,b,x,$,h,w,c,V,bt,Gt,R,zt,q,it,F,W,ee,I,G,le,at,ht,X,xt,se,rt,ct,Y,O,Ut,wt,y,Z,_t,jt,$t,z,tt,Ct,Qt,kt,L,dt,gt,ne,ft,oe,D,vt,et,yt,U,pt,ie,H,Ft,lt,Lt,st,At,nt,j,E,Jt,Tt,Kt,Pt,C,Q,M,ae,Rt,re,ut,ce,B,Ot,de,Et,Vt,St,Wt,A,mt,J,K,S,Nt,fe,T,k,pe,N,v,ot,ue,P,qt,me,Dt,be,Ht,Xt,Mt;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:`,a=s(),r=e("ul"),f=e("li"),f.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single
|
||||
or double quoted), number, null, true, false`,p=s(),b=e("li"),x=e("code"),x.textContent="OPERATOR",$=_(` - is one of:
|
||||
`),h=e("br"),w=s(),c=e("ul"),V=e("li"),bt=e("code"),bt.textContent="=",Gt=s(),O=e("span"),O.textContent="Equal",zt=s(),q=e("li"),it=e("code"),it.textContent="!=",F=s(),W=e("span"),W.textContent="NOT equal",ee=s(),B=e("li"),G=e("code"),G.textContent=">",le=s(),at=e("span"),at.textContent="Greater than",ht=s(),X=e("li"),xt=e("code"),xt.textContent=">=",se=s(),rt=e("span"),rt.textContent="Greater than or equal",ct=s(),Y=e("li"),R=e("code"),R.textContent="<",Ut=s(),wt=e("span"),wt.textContent="Less than or equal",v=s(),Z=e("li"),_t=e("code"),_t.textContent="<=",jt=s(),$t=e("span"),$t.textContent="Less than or equal",z=s(),tt=e("li"),Ct=e("code"),Ct.textContent="~",Qt=s(),kt=e("span"),kt.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
|
||||
`),h=e("br"),w=s(),c=e("ul"),V=e("li"),bt=e("code"),bt.textContent="=",Gt=s(),R=e("span"),R.textContent="Equal",zt=s(),q=e("li"),it=e("code"),it.textContent="!=",F=s(),W=e("span"),W.textContent="NOT equal",ee=s(),I=e("li"),G=e("code"),G.textContent=">",le=s(),at=e("span"),at.textContent="Greater than",ht=s(),X=e("li"),xt=e("code"),xt.textContent=">=",se=s(),rt=e("span"),rt.textContent="Greater than or equal",ct=s(),Y=e("li"),O=e("code"),O.textContent="<",Ut=s(),wt=e("span"),wt.textContent="Less than or equal",y=s(),Z=e("li"),_t=e("code"),_t.textContent="<=",jt=s(),$t=e("span"),$t.textContent="Less than or equal",z=s(),tt=e("li"),Ct=e("code"),Ct.textContent="~",Qt=s(),kt=e("span"),kt.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
|
||||
wildcard match)`,L=s(),dt=e("li"),gt=e("code"),gt.textContent="!~",ne=s(),ft=e("span"),ft.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
|
||||
wildcard match)`,oe=s(),M=e("li"),yt=e("code"),yt.textContent="?=",et=s(),vt=e("em"),vt.textContent="Any/At least one of",U=s(),pt=e("span"),pt.textContent="Equal",ie=s(),D=e("li"),Ft=e("code"),Ft.textContent="?!=",lt=s(),Lt=e("em"),Lt.textContent="Any/At least one of",st=s(),At=e("span"),At.textContent="NOT equal",nt=s(),j=e("li"),E=e("code"),E.textContent="?>",Jt=s(),Tt=e("em"),Tt.textContent="Any/At least one of",Kt=s(),Pt=e("span"),Pt.textContent="Greater than",C=s(),Q=e("li"),H=e("code"),H.textContent="?>=",ae=s(),Ot=e("em"),Ot.textContent="Any/At least one of",re=s(),ut=e("span"),ut.textContent="Greater than or equal",ce=s(),I=e("li"),Rt=e("code"),Rt.textContent="?<",de=s(),Et=e("em"),Et.textContent="Any/At least one of",Vt=s(),St=e("span"),St.textContent="Less than or equal",Wt=s(),A=e("li"),mt=e("code"),mt.textContent="?<=",J=s(),K=e("em"),K.textContent="Any/At least one of",S=s(),Nt=e("span"),Nt.textContent="Less than or equal",fe=s(),T=e("li"),k=e("code"),k.textContent="?~",pe=s(),N=e("em"),N.textContent="Any/At least one of",y=s(),ot=e("span"),ot.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
|
||||
wildcard match)`,ue=s(),P=e("li"),qt=e("code"),qt.textContent="?!~",me=s(),Mt=e("em"),Mt.textContent="Any/At least one of",be=s(),Dt=e("span"),Dt.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
|
||||
wildcard match)`,Xt=s(),Ht=e("p"),Ht.innerHTML=`To group and combine several expressions you could use brackets
|
||||
<code>(...)</code>, <code>&&</code> (AND) and <code>||</code> (OR) tokens.`,o(x,"class","txt-danger"),o(bt,"class","filter-op svelte-1w7s5nw"),o(O,"class","txt"),o(it,"class","filter-op svelte-1w7s5nw"),o(W,"class","txt"),o(G,"class","filter-op svelte-1w7s5nw"),o(at,"class","txt"),o(xt,"class","filter-op svelte-1w7s5nw"),o(rt,"class","txt"),o(R,"class","filter-op svelte-1w7s5nw"),o(wt,"class","txt"),o(_t,"class","filter-op svelte-1w7s5nw"),o($t,"class","txt"),o(Ct,"class","filter-op svelte-1w7s5nw"),o(kt,"class","txt"),o(gt,"class","filter-op svelte-1w7s5nw"),o(ft,"class","txt"),o(yt,"class","filter-op svelte-1w7s5nw"),o(vt,"class","txt-hint"),o(pt,"class","txt"),o(Ft,"class","filter-op svelte-1w7s5nw"),o(Lt,"class","txt-hint"),o(At,"class","txt"),o(E,"class","filter-op svelte-1w7s5nw"),o(Tt,"class","txt-hint"),o(Pt,"class","txt"),o(H,"class","filter-op svelte-1w7s5nw"),o(Ot,"class","txt-hint"),o(ut,"class","txt"),o(Rt,"class","filter-op svelte-1w7s5nw"),o(Et,"class","txt-hint"),o(St,"class","txt"),o(mt,"class","filter-op svelte-1w7s5nw"),o(K,"class","txt-hint"),o(Nt,"class","txt"),o(k,"class","filter-op svelte-1w7s5nw"),o(N,"class","txt-hint"),o(ot,"class","txt"),o(qt,"class","filter-op svelte-1w7s5nw"),o(Mt,"class","txt-hint"),o(Dt,"class","txt")},m(l,i){u(l,n,i),u(l,a,i),u(l,r,i),t(r,f),t(r,p),t(r,b),t(b,x),t(b,$),t(b,h),t(b,w),t(b,c),t(c,V),t(V,bt),t(V,Gt),t(V,O),t(c,zt),t(c,q),t(q,it),t(q,F),t(q,W),t(c,ee),t(c,B),t(B,G),t(B,le),t(B,at),t(c,ht),t(c,X),t(X,xt),t(X,se),t(X,rt),t(c,ct),t(c,Y),t(Y,R),t(Y,Ut),t(Y,wt),t(c,v),t(c,Z),t(Z,_t),t(Z,jt),t(Z,$t),t(c,z),t(c,tt),t(tt,Ct),t(tt,Qt),t(tt,kt),t(c,L),t(c,dt),t(dt,gt),t(dt,ne),t(dt,ft),t(c,oe),t(c,M),t(M,yt),t(M,et),t(M,vt),t(M,U),t(M,pt),t(c,ie),t(c,D),t(D,Ft),t(D,lt),t(D,Lt),t(D,st),t(D,At),t(c,nt),t(c,j),t(j,E),t(j,Jt),t(j,Tt),t(j,Kt),t(j,Pt),t(c,C),t(c,Q),t(Q,H),t(Q,ae),t(Q,Ot),t(Q,re),t(Q,ut),t(c,ce),t(c,I),t(I,Rt),t(I,de),t(I,Et),t(I,Vt),t(I,St),t(c,Wt),t(c,A),t(A,mt),t(A,J),t(A,K),t(A,S),t(A,Nt),t(c,fe),t(c,T),t(T,k),t(T,pe),t(T,N),t(T,y),t(T,ot),t(c,ue),t(c,P),t(P,qt),t(P,me),t(P,Mt),t(P,be),t(P,Dt),u(l,Xt,i),u(l,Ht,i)},d(l){l&&m(n),l&&m(a),l&&m(r),l&&m(Xt),l&&m(Ht)}}}function Ke(d){let n,a,r,f,p;function b(w,c){return w[0]?Je:Qe}let x=b(d),$=x(d),h=d[0]&&Ae();return{c(){n=e("button"),$.c(),a=s(),h&&h.c(),r=De(),o(n,"class","btn btn-sm btn-secondary m-t-5")},m(w,c){u(w,n,c),$.m(n,null),u(w,a,c),h&&h.m(w,c),u(w,r,c),f||(p=Me(n,"click",d[1]),f=!0)},p(w,[c]){x!==(x=b(w))&&($.d(1),$=x(w),$&&($.c(),$.m(n,null))),w[0]?h||(h=Ae(),h.c(),h.m(r.parentNode,r)):h&&(h.d(1),h=null)},i:Fe,o:Fe,d(w){w&&m(n),$.d(),w&&m(a),h&&h.d(w),w&&m(r),f=!1,p()}}}function Ve(d,n,a){let r=!1;function f(){a(0,r=!r)}return[r,f]}class We extends Se{constructor(n){super(),Ne(this,n,Ve,Ke,qe,{})}}function Te(d,n,a){const r=d.slice();return r[6]=n[a],r}function Pe(d,n,a){const r=d.slice();return r[6]=n[a],r}function Oe(d){let n;return{c(){n=e("p"),n.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",o(n,"class","txt-hint txt-sm txt-right")},m(a,r){u(a,n,r)},d(a){a&&m(n)}}}function Re(d,n){let a,r=n[6].code+"",f,p,b,x;function $(){return n[5](n[6])}return{key:d,first:null,c(){a=e("div"),f=_(r),p=s(),o(a,"class","tab-item"),xe(a,"active",n[2]===n[6].code),this.first=a},m(h,w){u(h,a,w),t(a,f),t(a,p),b||(x=Me(a,"click",$),b=!0)},p(h,w){n=h,w&20&&xe(a,"active",n[2]===n[6].code)},d(h){h&&m(a),b=!1,x()}}}function Ee(d,n){let a,r,f,p;return r=new he({props:{content:n[6].body}}),{key:d,first:null,c(){a=e("div"),Yt(r.$$.fragment),f=s(),o(a,"class","tab-item"),xe(a,"active",n[2]===n[6].code),this.first=a},m(b,x){u(b,a,x),Zt(r,a,null),t(a,f),p=!0},p(b,x){n=b,(!p||x&20)&&xe(a,"active",n[2]===n[6].code)},i(b){p||(It(r.$$.fragment,b),p=!0)},o(b){Bt(r.$$.fragment,b),p=!1},d(b){b&&m(a),te(r)}}}function Xe(d){var me,Mt,be,Dt,Xt,Ht;let n,a,r=d[0].name+"",f,p,b,x,$,h,w,c=d[0].name+"",V,bt,Gt,O,zt,q,it,F,W,ee,B,G,le,at,ht=d[0].name+"",X,xt,se,rt,ct,Y,R,Ut,wt,v,Z,_t,jt,$t,z,tt,Ct,Qt,kt,L,dt,gt,ne,ft,oe,M,yt,et,vt,U,pt,ie,D,Ft,lt,Lt,st,At,nt,j,E,Jt,Tt,Kt,Pt,C,Q,H,ae,Ot,re,ut,ce,I,Rt,de,Et,Vt,St,Wt,A,mt,J,K,S=[],Nt=new Map,fe,T,k=[],pe=new Map,N;O=new je({props:{js:`
|
||||
wildcard match)`,oe=s(),D=e("li"),vt=e("code"),vt.textContent="?=",et=s(),yt=e("em"),yt.textContent="Any/At least one of",U=s(),pt=e("span"),pt.textContent="Equal",ie=s(),H=e("li"),Ft=e("code"),Ft.textContent="?!=",lt=s(),Lt=e("em"),Lt.textContent="Any/At least one of",st=s(),At=e("span"),At.textContent="NOT equal",nt=s(),j=e("li"),E=e("code"),E.textContent="?>",Jt=s(),Tt=e("em"),Tt.textContent="Any/At least one of",Kt=s(),Pt=e("span"),Pt.textContent="Greater than",C=s(),Q=e("li"),M=e("code"),M.textContent="?>=",ae=s(),Rt=e("em"),Rt.textContent="Any/At least one of",re=s(),ut=e("span"),ut.textContent="Greater than or equal",ce=s(),B=e("li"),Ot=e("code"),Ot.textContent="?<",de=s(),Et=e("em"),Et.textContent="Any/At least one of",Vt=s(),St=e("span"),St.textContent="Less than or equal",Wt=s(),A=e("li"),mt=e("code"),mt.textContent="?<=",J=s(),K=e("em"),K.textContent="Any/At least one of",S=s(),Nt=e("span"),Nt.textContent="Less than or equal",fe=s(),T=e("li"),k=e("code"),k.textContent="?~",pe=s(),N=e("em"),N.textContent="Any/At least one of",v=s(),ot=e("span"),ot.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
|
||||
wildcard match)`,ue=s(),P=e("li"),qt=e("code"),qt.textContent="?!~",me=s(),Dt=e("em"),Dt.textContent="Any/At least one of",be=s(),Ht=e("span"),Ht.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
|
||||
wildcard match)`,Xt=s(),Mt=e("p"),Mt.innerHTML=`To group and combine several expressions you could use brackets
|
||||
<code>(...)</code>, <code>&&</code> (AND) and <code>||</code> (OR) tokens.`,o(x,"class","txt-danger"),o(bt,"class","filter-op svelte-1w7s5nw"),o(R,"class","txt"),o(it,"class","filter-op svelte-1w7s5nw"),o(W,"class","txt"),o(G,"class","filter-op svelte-1w7s5nw"),o(at,"class","txt"),o(xt,"class","filter-op svelte-1w7s5nw"),o(rt,"class","txt"),o(O,"class","filter-op svelte-1w7s5nw"),o(wt,"class","txt"),o(_t,"class","filter-op svelte-1w7s5nw"),o($t,"class","txt"),o(Ct,"class","filter-op svelte-1w7s5nw"),o(kt,"class","txt"),o(gt,"class","filter-op svelte-1w7s5nw"),o(ft,"class","txt"),o(vt,"class","filter-op svelte-1w7s5nw"),o(yt,"class","txt-hint"),o(pt,"class","txt"),o(Ft,"class","filter-op svelte-1w7s5nw"),o(Lt,"class","txt-hint"),o(At,"class","txt"),o(E,"class","filter-op svelte-1w7s5nw"),o(Tt,"class","txt-hint"),o(Pt,"class","txt"),o(M,"class","filter-op svelte-1w7s5nw"),o(Rt,"class","txt-hint"),o(ut,"class","txt"),o(Ot,"class","filter-op svelte-1w7s5nw"),o(Et,"class","txt-hint"),o(St,"class","txt"),o(mt,"class","filter-op svelte-1w7s5nw"),o(K,"class","txt-hint"),o(Nt,"class","txt"),o(k,"class","filter-op svelte-1w7s5nw"),o(N,"class","txt-hint"),o(ot,"class","txt"),o(qt,"class","filter-op svelte-1w7s5nw"),o(Dt,"class","txt-hint"),o(Ht,"class","txt")},m(l,i){u(l,n,i),u(l,a,i),u(l,r,i),t(r,f),t(r,p),t(r,b),t(b,x),t(b,$),t(b,h),t(b,w),t(b,c),t(c,V),t(V,bt),t(V,Gt),t(V,R),t(c,zt),t(c,q),t(q,it),t(q,F),t(q,W),t(c,ee),t(c,I),t(I,G),t(I,le),t(I,at),t(c,ht),t(c,X),t(X,xt),t(X,se),t(X,rt),t(c,ct),t(c,Y),t(Y,O),t(Y,Ut),t(Y,wt),t(c,y),t(c,Z),t(Z,_t),t(Z,jt),t(Z,$t),t(c,z),t(c,tt),t(tt,Ct),t(tt,Qt),t(tt,kt),t(c,L),t(c,dt),t(dt,gt),t(dt,ne),t(dt,ft),t(c,oe),t(c,D),t(D,vt),t(D,et),t(D,yt),t(D,U),t(D,pt),t(c,ie),t(c,H),t(H,Ft),t(H,lt),t(H,Lt),t(H,st),t(H,At),t(c,nt),t(c,j),t(j,E),t(j,Jt),t(j,Tt),t(j,Kt),t(j,Pt),t(c,C),t(c,Q),t(Q,M),t(Q,ae),t(Q,Rt),t(Q,re),t(Q,ut),t(c,ce),t(c,B),t(B,Ot),t(B,de),t(B,Et),t(B,Vt),t(B,St),t(c,Wt),t(c,A),t(A,mt),t(A,J),t(A,K),t(A,S),t(A,Nt),t(c,fe),t(c,T),t(T,k),t(T,pe),t(T,N),t(T,v),t(T,ot),t(c,ue),t(c,P),t(P,qt),t(P,me),t(P,Dt),t(P,be),t(P,Ht),u(l,Xt,i),u(l,Mt,i)},d(l){l&&m(n),l&&m(a),l&&m(r),l&&m(Xt),l&&m(Mt)}}}function Ke(d){let n,a,r,f,p;function b(w,c){return w[0]?Je:Qe}let x=b(d),$=x(d),h=d[0]&&Ae();return{c(){n=e("button"),$.c(),a=s(),h&&h.c(),r=He(),o(n,"class","btn btn-sm btn-transparent m-t-5")},m(w,c){u(w,n,c),$.m(n,null),u(w,a,c),h&&h.m(w,c),u(w,r,c),f||(p=De(n,"click",d[1]),f=!0)},p(w,[c]){x!==(x=b(w))&&($.d(1),$=x(w),$&&($.c(),$.m(n,null))),w[0]?h||(h=Ae(),h.c(),h.m(r.parentNode,r)):h&&(h.d(1),h=null)},i:Fe,o:Fe,d(w){w&&m(n),$.d(),w&&m(a),h&&h.d(w),w&&m(r),f=!1,p()}}}function Ve(d,n,a){let r=!1;function f(){a(0,r=!r)}return[r,f]}class We extends Se{constructor(n){super(),Ne(this,n,Ve,Ke,qe,{})}}function Te(d,n,a){const r=d.slice();return r[6]=n[a],r}function Pe(d,n,a){const r=d.slice();return r[6]=n[a],r}function Re(d){let n;return{c(){n=e("p"),n.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",o(n,"class","txt-hint txt-sm txt-right")},m(a,r){u(a,n,r)},d(a){a&&m(n)}}}function Oe(d,n){let a,r=n[6].code+"",f,p,b,x;function $(){return n[5](n[6])}return{key:d,first:null,c(){a=e("div"),f=_(r),p=s(),o(a,"class","tab-item"),xe(a,"active",n[2]===n[6].code),this.first=a},m(h,w){u(h,a,w),t(a,f),t(a,p),b||(x=De(a,"click",$),b=!0)},p(h,w){n=h,w&20&&xe(a,"active",n[2]===n[6].code)},d(h){h&&m(a),b=!1,x()}}}function Ee(d,n){let a,r,f,p;return r=new he({props:{content:n[6].body}}),{key:d,first:null,c(){a=e("div"),Yt(r.$$.fragment),f=s(),o(a,"class","tab-item"),xe(a,"active",n[2]===n[6].code),this.first=a},m(b,x){u(b,a,x),Zt(r,a,null),t(a,f),p=!0},p(b,x){n=b,(!p||x&20)&&xe(a,"active",n[2]===n[6].code)},i(b){p||(Bt(r.$$.fragment,b),p=!0)},o(b){It(r.$$.fragment,b),p=!1},d(b){b&&m(a),te(r)}}}function Xe(d){var me,Dt,be,Ht,Xt,Mt;let n,a,r=d[0].name+"",f,p,b,x,$,h,w,c=d[0].name+"",V,bt,Gt,R,zt,q,it,F,W,ee,I,G,le,at,ht=d[0].name+"",X,xt,se,rt,ct,Y,O,Ut,wt,y,Z,_t,jt,$t,z,tt,Ct,Qt,kt,L,dt,gt,ne,ft,oe,D,vt,et,yt,U,pt,ie,H,Ft,lt,Lt,st,At,nt,j,E,Jt,Tt,Kt,Pt,C,Q,M,ae,Rt,re,ut,ce,B,Ot,de,Et,Vt,St,Wt,A,mt,J,K,S=[],Nt=new Map,fe,T,k=[],pe=new Map,N;R=new je({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${d[3]}');
|
||||
@@ -21,7 +21,7 @@ import{S as Se,i as Ne,s as qe,e,b as s,E as De,f as o,g as u,u as Me,y as Fe,o
|
||||
});
|
||||
|
||||
// you can also fetch all records at once via getFullList
|
||||
const records = await pb.collection('${(Mt=d[0])==null?void 0:Mt.name}').getFullList(200 /* batch size */, {
|
||||
const records = await pb.collection('${(Dt=d[0])==null?void 0:Dt.name}').getFullList(200 /* batch size */, {
|
||||
sort: '-created',
|
||||
});
|
||||
|
||||
@@ -37,7 +37,7 @@ import{S as Se,i as Ne,s as qe,e,b as s,E as De,f as o,g as u,u as Me,y as Fe,o
|
||||
...
|
||||
|
||||
// fetch a paginated records list
|
||||
final resultList = await pb.collection('${(Dt=d[0])==null?void 0:Dt.name}').getList(
|
||||
final resultList = await pb.collection('${(Ht=d[0])==null?void 0:Ht.name}').getList(
|
||||
page: 1,
|
||||
perPage: 50,
|
||||
filter: 'created >= "2022-01-01 00:00:00" && someField1 != someField2',
|
||||
@@ -50,32 +50,32 @@ import{S as Se,i as Ne,s as qe,e,b as s,E as De,f as o,g as u,u as Me,y as Fe,o
|
||||
);
|
||||
|
||||
// or fetch only the first record that matches the specified filter
|
||||
final record = await pb.collection('${(Ht=d[0])==null?void 0:Ht.name}').getFirstListItem(
|
||||
final record = await pb.collection('${(Mt=d[0])==null?void 0:Mt.name}').getFirstListItem(
|
||||
'someField="test"',
|
||||
expand: 'relField1,relField2.subRelField',
|
||||
);
|
||||
`}});let y=d[1]&&Oe();et=new he({props:{content:`
|
||||
`}});let v=d[1]&&Re();et=new he({props:{content:`
|
||||
// DESC by created and ASC by id
|
||||
?sort=-created,id
|
||||
`}}),st=new he({props:{content:`
|
||||
?filter=(id='abc' && created>'2022-01-01')
|
||||
`}}),nt=new We({}),H=new he({props:{content:"?expand=relField1,relField2.subRelField"}});let ot=d[4];const ue=l=>l[6].code;for(let l=0;l<ot.length;l+=1){let i=Pe(d,ot,l),g=ue(i);Nt.set(g,S[l]=Re(g,i))}let P=d[4];const qt=l=>l[6].code;for(let l=0;l<P.length;l+=1){let i=Te(d,P,l),g=qt(i);pe.set(g,k[l]=Ee(g,i))}return{c(){n=e("h3"),a=_("List/Search ("),f=_(r),p=_(")"),b=s(),x=e("div"),$=e("p"),h=_("Fetch a paginated "),w=e("strong"),V=_(c),bt=_(" records list, supporting sorting and filtering."),Gt=s(),Yt(O.$$.fragment),zt=s(),q=e("h6"),q.textContent="API details",it=s(),F=e("div"),W=e("strong"),W.textContent="GET",ee=s(),B=e("div"),G=e("p"),le=_("/api/collections/"),at=e("strong"),X=_(ht),xt=_("/records"),se=s(),y&&y.c(),rt=s(),ct=e("div"),ct.textContent="Query parameters",Y=s(),R=e("table"),Ut=e("thead"),Ut.innerHTML=`<tr><th>Param</th>
|
||||
`}}),nt=new We({}),M=new he({props:{content:"?expand=relField1,relField2.subRelField"}});let ot=d[4];const ue=l=>l[6].code;for(let l=0;l<ot.length;l+=1){let i=Pe(d,ot,l),g=ue(i);Nt.set(g,S[l]=Oe(g,i))}let P=d[4];const qt=l=>l[6].code;for(let l=0;l<P.length;l+=1){let i=Te(d,P,l),g=qt(i);pe.set(g,k[l]=Ee(g,i))}return{c(){n=e("h3"),a=_("List/Search ("),f=_(r),p=_(")"),b=s(),x=e("div"),$=e("p"),h=_("Fetch a paginated "),w=e("strong"),V=_(c),bt=_(" records list, supporting sorting and filtering."),Gt=s(),Yt(R.$$.fragment),zt=s(),q=e("h6"),q.textContent="API details",it=s(),F=e("div"),W=e("strong"),W.textContent="GET",ee=s(),I=e("div"),G=e("p"),le=_("/api/collections/"),at=e("strong"),X=_(ht),xt=_("/records"),se=s(),v&&v.c(),rt=s(),ct=e("div"),ct.textContent="Query parameters",Y=s(),O=e("table"),Ut=e("thead"),Ut.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr>`,wt=s(),v=e("tbody"),Z=e("tr"),Z.innerHTML=`<td>page</td>
|
||||
<th width="60%">Description</th></tr>`,wt=s(),y=e("tbody"),Z=e("tr"),Z.innerHTML=`<td>page</td>
|
||||
<td><span class="label">Number</span></td>
|
||||
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,_t=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>`,$t=s(),z=e("tr"),tt=e("td"),tt.textContent="sort",Ct=s(),Qt=e("td"),Qt.innerHTML='<span class="label">String</span>',kt=s(),L=e("td"),dt=_("Specify the records order attribute(s). "),gt=e("br"),ne=_(`
|
||||
Add `),ft=e("code"),ft.textContent="-",oe=_(" / "),M=e("code"),M.textContent="+",yt=_(` (default) in front of the attribute for DESC / ASC order.
|
||||
Add `),ft=e("code"),ft.textContent="-",oe=_(" / "),D=e("code"),D.textContent="+",vt=_(` (default) in front of the attribute for DESC / ASC order.
|
||||
Ex.:
|
||||
`),Yt(et.$$.fragment),vt=s(),U=e("tr"),pt=e("td"),pt.textContent="filter",ie=s(),D=e("td"),D.innerHTML='<span class="label">String</span>',Ft=s(),lt=e("td"),Lt=_(`Filter the returned records. Ex.:
|
||||
`),Yt(et.$$.fragment),yt=s(),U=e("tr"),pt=e("td"),pt.textContent="filter",ie=s(),H=e("td"),H.innerHTML='<span class="label">String</span>',Ft=s(),lt=e("td"),Lt=_(`Filter the returned records. Ex.:
|
||||
`),Yt(st.$$.fragment),At=s(),Yt(nt.$$.fragment),j=s(),E=e("tr"),Jt=e("td"),Jt.textContent="expand",Tt=s(),Kt=e("td"),Kt.innerHTML='<span class="label">String</span>',Pt=s(),C=e("td"),Q=_(`Auto expand record relations. Ex.:
|
||||
`),Yt(H.$$.fragment),ae=_(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),Ot=e("br"),re=_(`
|
||||
`),Yt(M.$$.fragment),ae=_(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),Rt=e("br"),re=_(`
|
||||
The expanded relations will be appended to each individual record under the
|
||||
`),ut=e("code"),ut.textContent="expand",ce=_(" property (eg. "),I=e("code"),I.textContent='"expand": {"relField1": {...}, ...}',Rt=_(`).
|
||||
`),ut=e("code"),ut.textContent="expand",ce=_(" property (eg. "),B=e("code"),B.textContent='"expand": {"relField1": {...}, ...}',Ot=_(`).
|
||||
`),de=e("br"),Et=_(`
|
||||
Only the relations to which the request user has permissions to `),Vt=e("strong"),Vt.textContent="view",St=_(" will be expanded."),Wt=s(),A=e("div"),A.textContent="Responses",mt=s(),J=e("div"),K=e("div");for(let l=0;l<S.length;l+=1)S[l].c();fe=s(),T=e("div");for(let l=0;l<k.length;l+=1)k[l].c();o(n,"class","m-b-sm"),o(x,"class","content txt-lg m-b-sm"),o(q,"class","m-b-xs"),o(W,"class","label label-primary"),o(B,"class","content"),o(F,"class","alert alert-info"),o(ct,"class","section-title"),o(R,"class","table-compact table-border m-b-base"),o(A,"class","section-title"),o(K,"class","tabs-header compact left"),o(T,"class","tabs-content"),o(J,"class","tabs")},m(l,i){u(l,n,i),t(n,a),t(n,f),t(n,p),u(l,b,i),u(l,x,i),t(x,$),t($,h),t($,w),t(w,V),t($,bt),u(l,Gt,i),Zt(O,l,i),u(l,zt,i),u(l,q,i),u(l,it,i),u(l,F,i),t(F,W),t(F,ee),t(F,B),t(B,G),t(G,le),t(G,at),t(at,X),t(G,xt),t(F,se),y&&y.m(F,null),u(l,rt,i),u(l,ct,i),u(l,Y,i),u(l,R,i),t(R,Ut),t(R,wt),t(R,v),t(v,Z),t(v,_t),t(v,jt),t(v,$t),t(v,z),t(z,tt),t(z,Ct),t(z,Qt),t(z,kt),t(z,L),t(L,dt),t(L,gt),t(L,ne),t(L,ft),t(L,oe),t(L,M),t(L,yt),Zt(et,L,null),t(v,vt),t(v,U),t(U,pt),t(U,ie),t(U,D),t(U,Ft),t(U,lt),t(lt,Lt),Zt(st,lt,null),t(lt,At),Zt(nt,lt,null),t(v,j),t(v,E),t(E,Jt),t(E,Tt),t(E,Kt),t(E,Pt),t(E,C),t(C,Q),Zt(H,C,null),t(C,ae),t(C,Ot),t(C,re),t(C,ut),t(C,ce),t(C,I),t(C,Rt),t(C,de),t(C,Et),t(C,Vt),t(C,St),u(l,Wt,i),u(l,A,i),u(l,mt,i),u(l,J,i),t(J,K);for(let g=0;g<S.length;g+=1)S[g].m(K,null);t(J,fe),t(J,T);for(let g=0;g<k.length;g+=1)k[g].m(T,null);N=!0},p(l,[i]){var $e,Ce,ke,ge,ye,ve;(!N||i&1)&&r!==(r=l[0].name+"")&&we(f,r),(!N||i&1)&&c!==(c=l[0].name+"")&&we(V,c);const g={};i&9&&(g.js=`
|
||||
Only the relations to which the request user has permissions to `),Vt=e("strong"),Vt.textContent="view",St=_(" will be expanded."),Wt=s(),A=e("div"),A.textContent="Responses",mt=s(),J=e("div"),K=e("div");for(let l=0;l<S.length;l+=1)S[l].c();fe=s(),T=e("div");for(let l=0;l<k.length;l+=1)k[l].c();o(n,"class","m-b-sm"),o(x,"class","content txt-lg m-b-sm"),o(q,"class","m-b-xs"),o(W,"class","label label-primary"),o(I,"class","content"),o(F,"class","alert alert-info"),o(ct,"class","section-title"),o(O,"class","table-compact table-border m-b-base"),o(A,"class","section-title"),o(K,"class","tabs-header compact left"),o(T,"class","tabs-content"),o(J,"class","tabs")},m(l,i){u(l,n,i),t(n,a),t(n,f),t(n,p),u(l,b,i),u(l,x,i),t(x,$),t($,h),t($,w),t(w,V),t($,bt),u(l,Gt,i),Zt(R,l,i),u(l,zt,i),u(l,q,i),u(l,it,i),u(l,F,i),t(F,W),t(F,ee),t(F,I),t(I,G),t(G,le),t(G,at),t(at,X),t(G,xt),t(F,se),v&&v.m(F,null),u(l,rt,i),u(l,ct,i),u(l,Y,i),u(l,O,i),t(O,Ut),t(O,wt),t(O,y),t(y,Z),t(y,_t),t(y,jt),t(y,$t),t(y,z),t(z,tt),t(z,Ct),t(z,Qt),t(z,kt),t(z,L),t(L,dt),t(L,gt),t(L,ne),t(L,ft),t(L,oe),t(L,D),t(L,vt),Zt(et,L,null),t(y,yt),t(y,U),t(U,pt),t(U,ie),t(U,H),t(U,Ft),t(U,lt),t(lt,Lt),Zt(st,lt,null),t(lt,At),Zt(nt,lt,null),t(y,j),t(y,E),t(E,Jt),t(E,Tt),t(E,Kt),t(E,Pt),t(E,C),t(C,Q),Zt(M,C,null),t(C,ae),t(C,Rt),t(C,re),t(C,ut),t(C,ce),t(C,B),t(C,Ot),t(C,de),t(C,Et),t(C,Vt),t(C,St),u(l,Wt,i),u(l,A,i),u(l,mt,i),u(l,J,i),t(J,K);for(let g=0;g<S.length;g+=1)S[g].m(K,null);t(J,fe),t(J,T);for(let g=0;g<k.length;g+=1)k[g].m(T,null);N=!0},p(l,[i]){var $e,Ce,ke,ge,ve,ye;(!N||i&1)&&r!==(r=l[0].name+"")&&we(f,r),(!N||i&1)&&c!==(c=l[0].name+"")&&we(V,c);const g={};i&9&&(g.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${l[3]}');
|
||||
@@ -111,17 +111,17 @@ import{S as Se,i as Ne,s as qe,e,b as s,E as De,f as o,g as u,u as Me,y as Fe,o
|
||||
);
|
||||
|
||||
// you can also fetch all records at once via getFullList
|
||||
final records = await pb.collection('${(ye=l[0])==null?void 0:ye.name}').getFullList(
|
||||
final records = await pb.collection('${(ve=l[0])==null?void 0:ve.name}').getFullList(
|
||||
batch: 200,
|
||||
sort: '-created',
|
||||
);
|
||||
|
||||
// or fetch only the first record that matches the specified filter
|
||||
final record = await pb.collection('${(ve=l[0])==null?void 0:ve.name}').getFirstListItem(
|
||||
final record = await pb.collection('${(ye=l[0])==null?void 0:ye.name}').getFirstListItem(
|
||||
'someField="test"',
|
||||
expand: 'relField1,relField2.subRelField',
|
||||
);
|
||||
`),O.$set(g),(!N||i&1)&&ht!==(ht=l[0].name+"")&&we(X,ht),l[1]?y||(y=Oe(),y.c(),y.m(F,null)):y&&(y.d(1),y=null),i&20&&(ot=l[4],S=Le(S,i,ue,1,l,ot,Nt,K,He,Re,null,Pe)),i&20&&(P=l[4],Ie(),k=Le(k,i,qt,1,l,P,pe,T,Be,Ee,null,Te),Ge())},i(l){if(!N){It(O.$$.fragment,l),It(et.$$.fragment,l),It(st.$$.fragment,l),It(nt.$$.fragment,l),It(H.$$.fragment,l);for(let i=0;i<P.length;i+=1)It(k[i]);N=!0}},o(l){Bt(O.$$.fragment,l),Bt(et.$$.fragment,l),Bt(st.$$.fragment,l),Bt(nt.$$.fragment,l),Bt(H.$$.fragment,l);for(let i=0;i<k.length;i+=1)Bt(k[i]);N=!1},d(l){l&&m(n),l&&m(b),l&&m(x),l&&m(Gt),te(O,l),l&&m(zt),l&&m(q),l&&m(it),l&&m(F),y&&y.d(),l&&m(rt),l&&m(ct),l&&m(Y),l&&m(R),te(et),te(st),te(nt),te(H),l&&m(Wt),l&&m(A),l&&m(mt),l&&m(J);for(let i=0;i<S.length;i+=1)S[i].d();for(let i=0;i<k.length;i+=1)k[i].d()}}}function Ye(d,n,a){let r,f,{collection:p=new ze}=n,b=200,x=[];const $=h=>a(2,b=h.code);return d.$$set=h=>{"collection"in h&&a(0,p=h.collection)},d.$$.update=()=>{d.$$.dirty&1&&a(1,r=(p==null?void 0:p.listRule)===null),d.$$.dirty&3&&p!=null&&p.id&&(x.push({code:200,body:JSON.stringify({page:1,perPage:30,totalPages:1,totalItems:2,items:[_e.dummyCollectionRecord(p),_e.dummyCollectionRecord(p)]},null,2)}),x.push({code:400,body:`
|
||||
`),R.$set(g),(!N||i&1)&&ht!==(ht=l[0].name+"")&&we(X,ht),l[1]?v||(v=Re(),v.c(),v.m(F,null)):v&&(v.d(1),v=null),i&20&&(ot=l[4],S=Le(S,i,ue,1,l,ot,Nt,K,Me,Oe,null,Pe)),i&20&&(P=l[4],Be(),k=Le(k,i,qt,1,l,P,pe,T,Ie,Ee,null,Te),Ge())},i(l){if(!N){Bt(R.$$.fragment,l),Bt(et.$$.fragment,l),Bt(st.$$.fragment,l),Bt(nt.$$.fragment,l),Bt(M.$$.fragment,l);for(let i=0;i<P.length;i+=1)Bt(k[i]);N=!0}},o(l){It(R.$$.fragment,l),It(et.$$.fragment,l),It(st.$$.fragment,l),It(nt.$$.fragment,l),It(M.$$.fragment,l);for(let i=0;i<k.length;i+=1)It(k[i]);N=!1},d(l){l&&m(n),l&&m(b),l&&m(x),l&&m(Gt),te(R,l),l&&m(zt),l&&m(q),l&&m(it),l&&m(F),v&&v.d(),l&&m(rt),l&&m(ct),l&&m(Y),l&&m(O),te(et),te(st),te(nt),te(M),l&&m(Wt),l&&m(A),l&&m(mt),l&&m(J);for(let i=0;i<S.length;i+=1)S[i].d();for(let i=0;i<k.length;i+=1)k[i].d()}}}function Ye(d,n,a){let r,f,{collection:p=new ze}=n,b=200,x=[];const $=h=>a(2,b=h.code);return d.$$set=h=>{"collection"in h&&a(0,p=h.collection)},d.$$.update=()=>{d.$$.dirty&1&&a(1,r=(p==null?void 0:p.listRule)===null),d.$$.dirty&3&&p!=null&&p.id&&(x.push({code:200,body:JSON.stringify({page:1,perPage:30,totalPages:1,totalItems:2,items:[_e.dummyCollectionRecord(p),_e.dummyCollectionRecord(p)]},null,2)}),x.push({code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Something went wrong while processing your request. Invalid filter.",
|
||||
Vendored
+5
-5
@@ -1,4 +1,4 @@
|
||||
import{S as Be,i as qe,s as Me,e as i,w as v,b as _,c as Ie,f as b,g as r,h as s,m as Se,x as U,N as Pe,O as Oe,k as Le,P as We,n as ze,t as te,a as le,o as d,d as Ee,Q as De,C as He,p as Re,r as j,u as Ue,M as je}from"./index-9ce6aa95.js";import{S as Ne}from"./SdkTabs-ccd8881b.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 Ce(a,l){let o,n=l[5].code+"",f,h,c,u;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){r(g,o,P),s(o,f),s(o,h),c||(u=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&&d(o),c=!1,u()}}}function Te(a,l){let o,n,f,h;return n=new je({props:{content:l[5].body}}),{key:a,first:null,c(){o=i("div"),Ie(n.$$.fragment),f=_(),b(o,"class","tab-item"),j(o,"active",l[1]===l[5].code),this.first=o},m(c,u){r(c,o,u),Se(n,o,null),s(o,f),h=!0},p(c,u){l=c;const m={};u&4&&(m.content=l[5].body),n.$set(m),(!h||u&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&&d(o),Ee(n)}}}function Ge(a){var be,he,_e,ke;let l,o,n=a[0].name+"",f,h,c,u,m,g,P,L=a[0].name+"",N,oe,se,G,K,y,Q,I,F,w,W,ae,z,A,ne,J,D=a[0].name+"",V,ie,X,ce,re,H,Y,S,Z,E,x,B,ee,C,q,$=[],de=new Map,ue,M,k=[],pe=new Map,T;y=new Ne({props:{js:`
|
||||
import{S as Be,i as qe,s as Oe,e as i,w as v,b as _,c as Se,f as b,g as r,h as s,m as Ee,x as U,O as Pe,P as Le,k as Me,Q as Re,n as We,t as te,a as le,o as d,d as Ie,R as ze,C as De,p as He,r as j,u as Ue,N as je}from"./index-e4123b79.js";import{S as Ne}from"./SdkTabs-a1061d88.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 Ce(a,l){let o,n=l[5].code+"",f,h,c,u;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){r(g,o,P),s(o,f),s(o,h),c||(u=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&&d(o),c=!1,u()}}}function Te(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,u){r(c,o,u),Ee(n,o,null),s(o,f),h=!0},p(c,u){l=c;const m={};u&4&&(m.content=l[5].body),n.$set(m),(!h||u&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&&d(o),Ie(n)}}}function Ge(a){var be,he,_e,ke;let l,o,n=a[0].name+"",f,h,c,u,m,g,P,M=a[0].name+"",N,oe,se,G,K,y,Q,S,F,w,R,ae,W,A,ne,J,z=a[0].name+"",V,ie,X,ce,re,D,Y,E,Z,I,x,B,ee,C,q,$=[],de=new Map,ue,O,k=[],pe=new Map,T;y=new Ne({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${a[3]}');
|
||||
@@ -22,12 +22,12 @@ import{S as Be,i as qe,s as Me,e as i,w as v,b as _,c as Ie,f as b,g as r,h as s
|
||||
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),p=fe(t);de.set(p,$[e]=Ce(p,t))}let O=a[2];const me=e=>e[5].code;for(let e=0;e<O.length;e+=1){let t=ye(a,O,e),p=me(t);pe.set(p,k[e]=Te(p,t))}return{c(){l=i("h3"),o=v("List OAuth2 accounts ("),f=v(n),h=v(")"),c=_(),u=i("div"),m=i("p"),g=v("Returns a list with all OAuth2 providers linked to a single "),P=i("strong"),N=v(L),oe=v("."),se=_(),G=i("p"),G.textContent="Only admins and the account owner can access this action.",K=_(),Ie(y.$$.fragment),Q=_(),I=i("h6"),I.textContent="API details",F=_(),w=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=_(),S=i("div"),S.textContent="Path Parameters",Z=_(),E=i("table"),E.innerHTML=`<thead><tr><th>Param</th>
|
||||
`}});let H=a[2];const fe=e=>e[5].code;for(let e=0;e<H.length;e+=1){let t=Ae(a,H,e),p=fe(t);de.set(p,$[e]=Ce(p,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),p=me(t);pe.set(p,k[e]=Te(p,t))}return{c(){l=i("h3"),o=v("List OAuth2 accounts ("),f=v(n),h=v(")"),c=_(),u=i("div"),m=i("p"),g=v("Returns a list with all OAuth2 providers linked to a single "),P=i("strong"),N=v(M),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=_(),w=i("div"),R=i("strong"),R.textContent="GET",ae=_(),W=i("div"),A=i("p"),ne=v("/api/collections/"),J=i("strong"),V=v(z),ie=v("/records/"),X=i("strong"),X.textContent=":id",ce=v("/external-auths"),re=_(),D=i("p"),D.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=_(),C=i("div"),q=i("div");for(let e=0;e<$.length;e+=1)$[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(u,"class","content txt-lg m-b-sm"),b(I,"class","m-b-xs"),b(W,"class","label label-primary"),b(z,"class","content"),b(H,"class","txt-hint txt-sm txt-right"),b(w,"class","alert alert-info"),b(S,"class","section-title"),b(E,"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(C,"class","tabs")},m(e,t){r(e,l,t),s(l,o),s(l,f),s(l,h),r(e,c,t),r(e,u,t),s(u,m),s(m,g),s(m,P),s(P,N),s(m,oe),s(u,se),s(u,G),r(e,K,t),Se(y,e,t),r(e,Q,t),r(e,I,t),r(e,F,t),r(e,w,t),s(w,W),s(w,ae),s(w,z),s(z,A),s(A,ne),s(A,J),s(J,V),s(A,ie),s(A,X),s(A,ce),s(w,re),s(w,H),r(e,Y,t),r(e,S,t),r(e,Z,t),r(e,E,t),r(e,x,t),r(e,B,t),r(e,ee,t),r(e,C,t),s(C,q);for(let p=0;p<$.length;p+=1)$[p].m(q,null);s(C,ue),s(C,M);for(let p=0;p<k.length;p+=1)k[p].m(M,null);T=!0},p(e,[t]){var ve,we,$e,ge;(!T||t&1)&&n!==(n=e[0].name+"")&&U(f,n),(!T||t&1)&&L!==(L=e[0].name+"")&&U(N,L);const p={};t&9&&(p.js=`
|
||||
<td>ID of the auth record.</td></tr></tbody>`,x=_(),B=i("div"),B.textContent="Responses",ee=_(),C=i("div"),q=i("div");for(let e=0;e<$.length;e+=1)$[e].c();ue=_(),O=i("div");for(let e=0;e<k.length;e+=1)k[e].c();b(l,"class","m-b-sm"),b(u,"class","content txt-lg m-b-sm"),b(S,"class","m-b-xs"),b(R,"class","label label-primary"),b(W,"class","content"),b(D,"class","txt-hint txt-sm txt-right"),b(w,"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(O,"class","tabs-content"),b(C,"class","tabs")},m(e,t){r(e,l,t),s(l,o),s(l,f),s(l,h),r(e,c,t),r(e,u,t),s(u,m),s(m,g),s(m,P),s(P,N),s(m,oe),s(u,se),s(u,G),r(e,K,t),Ee(y,e,t),r(e,Q,t),r(e,S,t),r(e,F,t),r(e,w,t),s(w,R),s(w,ae),s(w,W),s(W,A),s(A,ne),s(A,J),s(J,V),s(A,ie),s(A,X),s(A,ce),s(w,re),s(w,D),r(e,Y,t),r(e,E,t),r(e,Z,t),r(e,I,t),r(e,x,t),r(e,B,t),r(e,ee,t),r(e,C,t),s(C,q);for(let p=0;p<$.length;p+=1)$[p].m(q,null);s(C,ue),s(C,O);for(let p=0;p<k.length;p+=1)k[p].m(O,null);T=!0},p(e,[t]){var ve,we,$e,ge;(!T||t&1)&&n!==(n=e[0].name+"")&&U(f,n),(!T||t&1)&&M!==(M=e[0].name+"")&&U(N,M);const p={};t&9&&(p.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${e[3]}');
|
||||
@@ -51,7 +51,7 @@ import{S as Be,i as qe,s as Me,e as i,w as v,b as _,c as Ie,f as b,g as r,h as s
|
||||
final result = await pb.collection('${(ge=e[0])==null?void 0:ge.name}').listExternalAuths(
|
||||
pb.authStore.model.id,
|
||||
);
|
||||
`),y.$set(p),(!T||t&1)&&D!==(D=e[0].name+"")&&U(V,D),t&6&&(R=e[2],$=Pe($,t,fe,1,e,R,de,q,Oe,Ce,null,Ae)),t&6&&(O=e[2],Le(),k=Pe(k,t,me,1,e,O,pe,M,We,Te,null,ye),ze())},i(e){if(!T){te(y.$$.fragment,e);for(let t=0;t<O.length;t+=1)te(k[t]);T=!0}},o(e){le(y.$$.fragment,e);for(let t=0;t<k.length;t+=1)le(k[t]);T=!1},d(e){e&&d(l),e&&d(c),e&&d(u),e&&d(K),Ee(y,e),e&&d(Q),e&&d(I),e&&d(F),e&&d(w),e&&d(Y),e&&d(S),e&&d(Z),e&&d(E),e&&d(x),e&&d(B),e&&d(ee),e&&d(C);for(let t=0;t<$.length;t+=1)$[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 u=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:`
|
||||
`),y.$set(p),(!T||t&1)&&z!==(z=e[0].name+"")&&U(V,z),t&6&&(H=e[2],$=Pe($,t,fe,1,e,H,de,q,Le,Ce,null,Ae)),t&6&&(L=e[2],Me(),k=Pe(k,t,me,1,e,L,pe,O,Re,Te,null,ye),We())},i(e){if(!T){te(y.$$.fragment,e);for(let t=0;t<L.length;t+=1)te(k[t]);T=!0}},o(e){le(y.$$.fragment,e);for(let t=0;t<k.length;t+=1)le(k[t]);T=!1},d(e){e&&d(l),e&&d(c),e&&d(u),e&&d(K),Ie(y,e),e&&d(Q),e&&d(S),e&&d(F),e&&d(w),e&&d(Y),e&&d(E),e&&d(Z),e&&d(I),e&&d(x),e&&d(B),e&&d(ee),e&&d(C);for(let t=0;t<$.length;t+=1)$[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function Ke(a,l,o){let n,{collection:f=new ze}=l,h=200,c=[];const u=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",
|
||||
@@ -90,4 +90,4 @@ import{S as Be,i as qe,s as Me,e as i,w as v,b as _,c as Ie,f as b,g as r,h as s
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`}])},o(3,n=He.getApiExampleUrl(Re.baseUrl)),[f,h,c,n,u]}class Je extends Be{constructor(l){super(),qe(this,l,Ke,Ge,Me,{collection:0})}}export{Je as default};
|
||||
`}])},o(3,n=De.getApiExampleUrl(He.baseUrl)),[f,h,c,n,u]}class Je extends Be{constructor(l){super(),qe(this,l,Ke,Ge,Oe,{collection:0})}}export{Je as default};
|
||||
+1
-1
@@ -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 H,a as N,d as T,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 h,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-9ce6aa95.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=h(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=h(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,R,P,v,k,F,j,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 H,a as N,d as T,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 h,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-e4123b79.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=h(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=h(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,R,P,v,k,F,j,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",R=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,R,$),b(a,P,$),_(P,v),k=!0,F||(j=[h(e,"submit",O(f[4])),Q(U.call(null,v))],F=!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 z={};$&769&&(z.$$scope={dirty:$,ctx:a}),r.$set(z);const D={};$&770&&(D.$$scope={dirty:$,ctx:a}),d.$set(D),(!k||$&4)&&(i.disabled=a[2]),(!k||$&4)&&L(i,"btn-loading",a[2])},i(a){k||(H(r.$$.fragment,a),H(d.$$.fragment,a),k=!0)},o(a){N(r.$$.fragment,a),N(d.$$.fragment,a),k=!1},d(a){a&&w(e),m&&m.d(),T(r),T(d),a&&w(R),a&&w(P),F=!1,V(j)}}}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||(H(e.$$.fragment,s),o=!0)},o(s){N(e.$$.fragment,s),o=!1},d(s){T(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.errorResponseHandler(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};
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
import{S as M,i as T,s as j,F as z,c as H,m as L,t as w,a as y,d as S,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 E,v as I,w as h,x as J,y as P,z as R}from"./index-9ce6aa95.js";function K(c){let e,s,n,l,t,o,f,m,i,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 H,m as L,t as w,a as y,d as S,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 E,v as I,w as h,x as J,y as P,z as R}from"./index-e4123b79.js";function K(c){let e,s,n,l,t,o,f,m,i,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 we’ll send you a recovery link:</p>`,n=g(),H(l.$$.fragment),t=g(),o=_("button"),f=_("i"),m=g(),i=_("span"),i.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(f,"class","ri-mail-send-line"),p(i,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block"),o.disabled=c[1],F(o,"btn-loading",c[1]),p(e,"class","m-b-base")},m(r,$){k(r,e,$),d(e,s),d(e,n),L(l,e,null),d(e,t),d(e,o),d(o,f),d(o,m),d(o,i),a=!0,b||(u=E(e,"submit",I(c[3])),b=!0)},p(r,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:r}),l.$set(q),(!a||$&2)&&(o.disabled=r[1]),(!a||$&2)&&F(o,"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),S(l),b=!1,u()}}}function O(c){let e,s,n,l,t,o,f,m,i;return{c(){e=_("div"),s=_("div"),s.innerHTML='<i class="ri-checkbox-circle-line"></i>',n=g(),l=_("div"),t=_("p"),o=h("Check "),f=_("strong"),m=h(c[0]),i=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,o),d(t,f),d(f,m),d(t,i)},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,o,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",o=c[5]),t.required=!0,t.autofocus=!0},m(i,a){k(i,e,a),d(e,s),k(i,l,a),k(i,t,a),R(t,c[0]),t.focus(),f||(m=E(t,"input",c[4]),f=!0)},p(i,a){a&32&&n!==(n=i[5])&&p(e,"for",n),a&32&&o!==(o=i[5])&&p(t,"id",o),a&1&&t.value!==i[0]&&R(t,i[0])},d(i){i&&v(e),i&&v(l),i&&v(t),f=!1,m()}}}function U(c){let e,s,n,l,t,o,f,m;const i=[O,K],a=[];function b(u,r){return u[2]?0:1}return e=b(c),s=a[e]=i[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),o=!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]=i[e](u),s.c()),w(s,1),s.m(n.parentNode,n))},i(u){o||(w(s),o=!0)},o(u){y(s),o=!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(){H(e.$$.fragment)},m(n,l){L(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){S(e,n)}}}function W(c,e,s){let n="",l=!1,t=!1;async function o(){if(!l){s(1,l=!0);try{await C.admins.requestPasswordReset(n),s(2,t=!0)}catch(m){C.errorResponseHandler(m)}s(1,l=!1)}}function f(){n=this.value,s(0,n)}return[n,l,t,o,f]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default};
|
||||
@@ -0,0 +1,4 @@
|
||||
import{S as z,i as G,s as I,F as J,c as S,m as L,t as v,a as y,d as R,C as M,E as N,g as _,k as W,n as Y,o as b,G as j,H as A,p as B,q as D,e as m,w as C,b as h,f as d,r as H,h as k,u as P,v as K,y as E,x as O,z as T}from"./index-e4123b79.js";function Q(r){let e,t,l,s,n,o,c,a,i,u,g,$,p=r[3]&&F(r);return o=new D({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(),S(o.$$.fragment),c=h(),a=m("button"),i=m("span"),i.textContent="Confirm new email",d(t,"class","content txt-center m-b-base"),d(i,"class","txt"),d(a,"type","submit"),d(a,"class","btn btn-lg btn-block"),a.disabled=r[1],H(a,"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,a),k(a,i),u=!0,g||($=P(e,"submit",K(r[4])),g=!0)},p(f,w){f[3]?p?p.p(f,w):(p=F(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)&&(a.disabled=f[1]),(!u||w&2)&&H(a,"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(),R(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 F(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&&O(l,s[3])},d(s){s&&b(e),s&&b(t)}}}function V(r){let e,t,l,s,n,o,c,a;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(i,u){_(i,e,u),k(e,t),_(i,s,u),_(i,n,u),T(n,r[0]),n.focus(),c||(a=P(n,"input",r[7]),c=!0)},p(i,u){u&256&&l!==(l=i[8])&&d(e,"for",l),u&256&&o!==(o=i[8])&&d(n,"id",o),u&1&&n.value!==i[0]&&T(n,i[0])},d(i){i&&b(e),i&&b(s),i&&b(n),c=!1,a()}}}function X(r){let e,t,l,s;const n=[U,Q],o=[];function c(a,i){return a[2]?0:1}return e=c(r),t=o[e]=n[e](r),{c(){t.c(),l=N()},m(a,i){o[e].m(a,i),_(a,l,i),s=!0},p(a,i){let u=e;e=c(a),e===u?o[e].p(a,i):(W(),y(o[u],1,1,()=>{o[u]=null}),Y(),t=o[e],t?t.p(a,i):(t=o[e]=n[e](a),t.c()),v(t,1),t.m(l.parentNode,l))},i(a){s||(v(t),s=!0)},o(a){y(t),s=!1},d(a){o[e].d(a),a&&b(l)}}}function Z(r){let e,t;return e=new J({props:{nobranding:!0,$$slots:{default:[X]},$$scope:{ctx:r}}}),{c(){S(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){R(e,l)}}}function x(r,e,t){let l,{params:s}=e,n="",o=!1,c=!1;async function a(){if(o)return;t(1,o=!0);const g=new j("../");try{const $=A(s==null?void 0:s.token);await g.collection($.collectionId).confirmEmailChange(s==null?void 0:s.token,n),t(2,c=!0)}catch($){B.errorResponseHandler($)}t(1,o=!1)}const i=()=>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=M.getJWTPayload(s==null?void 0:s.token).newEmail||"")},[n,o,c,l,a,s,i,u]}class te extends z{constructor(e){super(),G(this,e,x,Z,I,{params:5})}}export{te as default};
|
||||
@@ -1,4 +0,0 @@
|
||||
import{S as z,i as G,s as I,F as J,c as S,m as T,t as v,a as y,d as L,C as M,E as N,g as _,k as W,n as Y,o as b,R as j,G as A,p as B,q as D,e as m,w as C,b as h,f as d,r as F,h as k,u as q,v as K,y as E,x as O,z as H}from"./index-9ce6aa95.js";function Q(r){let e,t,l,s,n,o,c,i,a,u,g,$,p=r[3]&&R(r);return o=new D({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(),S(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],F(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),T(o,e,null),k(e,c),k(e,i),k(i,a),u=!0,g||($=q(e,"submit",K(r[4])),g=!0)},p(f,w){f[3]?p?p.p(f,w):(p=R(f),p.c(),p.m(l,null)):p&&(p.d(1),p=null);const P={};w&769&&(P.$$scope={dirty:w,ctx:f}),o.$set(P),(!u||w&2)&&(i.disabled=f[1]),(!u||w&2)&&F(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(),L(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-secondary btn-block")},m(o,c){_(o,e,c),_(o,t,c),_(o,l,c),s||(n=q(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 R(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&&O(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),H(n,r[0]),n.focus(),c||(i=q(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]&&H(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=N()},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):(W(),y(o[u],1,1,()=>{o[u]=null}),Y(),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 J({props:{nobranding:!0,$$slots:{default:[X]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},m(l,s){T(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){L(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 j("../");try{const $=A(s==null?void 0:s.token);await g.collection($.collectionId).confirmEmailChange(s==null?void 0:s.token,n),t(2,c=!0)}catch($){B.errorResponseHandler($)}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=M.getJWTPayload(s==null?void 0:s.token).newEmail||"")},[n,o,c,l,i,s,a,u]}class te extends z{constructor(e){super(),G(this,e,x,Z,I,{params:5})}}export{te as default};
|
||||
@@ -0,0 +1,4 @@
|
||||
import{S as J,i as M,s as W,F as Y,c as F,m as N,t as y,a as q,d as T,C as j,E as A,g as _,k as B,n as D,o as m,G as K,H as O,p as Q,q as E,e as b,w as R,b as P,f as p,r as G,h as w,u as H,v as U,y as S,x as V,z as h}from"./index-e4123b79.js";function X(r){let e,l,s,n,t,o,c,a,i,u,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}}}),a=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=R(`Reset your user password
|
||||
`),d&&d.c(),t=P(),F(o.$$.fragment),c=P(),F(a.$$.fragment),i=P(),u=b("button"),v=b("span"),v.textContent="Set new password",p(l,"class","content txt-center m-b-base"),p(v,"class","txt"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block"),u.disabled=r[2],G(u,"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),N(o,e,null),w(e,c),N(a,e,null),w(e,i),w(e,u),w(u,v),k=!0,g||(C=H(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}),a.$set(z),(!k||$&4)&&(u.disabled=f[2]),(!k||$&4)&&G(u,"btn-loading",f[2])},i(f){k||(y(o.$$.fragment,f),y(a.$$.fragment,f),k=!0)},o(f){q(o.$$.fragment,f),q(a.$$.fragment,f),k=!1},d(f){f&&m(e),d&&d.d(),T(o),T(a),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=H(s,"click",r[7]),n=!0)},p:S,i:S,o:S,d(o){o&&m(e),o&&m(l),o&&m(s),n=!1,t()}}}function I(r){let e,l,s;return{c(){e=R("for "),l=b("strong"),s=R(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,a;return{c(){e=b("label"),l=R("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,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),h(t,r[0]),t.focus(),c||(a=H(t,"input",r[8]),c=!0)},p(i,u){u&1024&&s!==(s=i[10])&&p(e,"for",s),u&1024&&o!==(o=i[10])&&p(t,"id",o),u&1&&t.value!==i[0]&&h(t,i[0])},d(i){i&&m(e),i&&m(n),i&&m(t),c=!1,a()}}}function ee(r){let e,l,s,n,t,o,c,a;return{c(){e=b("label"),l=R("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,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),h(t,r[1]),c||(a=H(t,"input",r[9]),c=!0)},p(i,u){u&1024&&s!==(s=i[10])&&p(e,"for",s),u&1024&&o!==(o=i[10])&&p(t,"id",o),u&2&&t.value!==i[1]&&h(t,i[1])},d(i){i&&m(e),i&&m(n),i&&m(t),c=!1,a()}}}function te(r){let e,l,s,n;const t=[Z,X],o=[];function c(a,i){return a[3]?0:1}return e=c(r),l=o[e]=t[e](r),{c(){l.c(),s=A()},m(a,i){o[e].m(a,i),_(a,s,i),n=!0},p(a,i){let u=e;e=c(a),e===u?o[e].p(a,i):(B(),q(o[u],1,1,()=>{o[u]=null}),D(),l=o[e],l?l.p(a,i):(l=o[e]=t[e](a),l.c()),y(l,1),l.m(s.parentNode,s))},i(a){n||(y(l),n=!0)},o(a){q(l),n=!1},d(a){o[e].d(a),a&&m(s)}}}function se(r){let e,l;return e=new Y({props:{nobranding:!0,$$slots:{default:[te]},$$scope:{ctx:r}}}),{c(){F(e.$$.fragment)},m(s,n){N(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){T(e,s)}}}function le(r,e,l){let s,{params:n}=e,t="",o="",c=!1,a=!1;async function i(){if(c)return;l(2,c=!0);const g=new K("../");try{const C=O(n==null?void 0:n.token);await g.collection(C.collectionId).confirmPasswordReset(n==null?void 0:n.token,t,o),l(3,a=!0)}catch(C){Q.errorResponseHandler(C)}l(2,c=!1)}const u=()=>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=j.getJWTPayload(n==null?void 0:n.token).email||"")},[t,o,c,a,s,i,n,u,v,k]}class oe extends J{constructor(e){super(),M(this,e,le,se,W,{params:6})}}export{oe as default};
|
||||
@@ -1,4 +0,0 @@
|
||||
import{S as J,i as M,s as W,F as Y,c as H,m as N,t as P,a as q,d as L,C as j,E as A,g as _,k as B,n as D,o as m,R as K,G as O,p as Q,q as E,e as b,w as R,b as y,f as p,r as G,h as w,u as S,v as U,y as F,x as V,z as h}from"./index-9ce6aa95.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=R(`Reset your user password
|
||||
`),d&&d.c(),t=y(),H(o.$$.fragment),c=y(),H(u.$$.fragment),i=y(),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),N(o,e,null),w(e,c),N(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 T={};$&3073&&(T.$$scope={dirty:$,ctx:f}),o.$set(T);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||(P(o.$$.fragment,f),P(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(),L(o),L(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=y(),s=b("button"),s.textContent="Close",p(e,"class","alert alert-success"),p(s,"type","button"),p(s,"class","btn btn-secondary 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=R("for "),l=b("strong"),s=R(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=R("New password"),n=y(),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),h(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]&&h(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=R("New password confirm"),n=y(),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),h(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]&&h(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=A()},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):(B(),q(o[a],1,1,()=>{o[a]=null}),D(),l=o[e],l?l.p(u,i):(l=o[e]=t[e](u),l.c()),P(l,1),l.m(s.parentNode,s))},i(u){n||(P(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 Y({props:{nobranding:!0,$$slots:{default:[te]},$$scope:{ctx:r}}}),{c(){H(e.$$.fragment)},m(s,n){N(e,s,n),l=!0},p(s,[n]){const t={};n&2079&&(t.$$scope={dirty:n,ctx:s}),e.$set(t)},i(s){l||(P(e.$$.fragment,s),l=!0)},o(s){q(e.$$.fragment,s),l=!1},d(s){L(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 K("../");try{const C=O(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.errorResponseHandler(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=j.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,W,{params:6})}}export{oe as default};
|
||||
@@ -0,0 +1,3 @@
|
||||
import{S as v,i as y,s as w,F as C,c as g,m as x,t as $,a as H,d as L,G as P,H as T,E as M,g as r,o as a,e as u,b as _,f,u as b,y as p}from"./index-e4123b79.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 C({props:{nobranding:!0,$$slots:{default:[V]},$$scope:{ctx:o}}}),{c(){g(t.$$.fragment)},m(e,n){x(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){H(t.$$.fragment,e),s=!1},d(e){L(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 P("../");try{const m=T(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};
|
||||
@@ -1,3 +0,0 @@
|
||||
import{S as v,i as y,s as w,F as x,c as C,m as g,t as $,a as L,d as H,R as M,G as P,E as S,g as r,o as a,e as u,b as _,f,u as b,y as p}from"./index-9ce6aa95.js";function T(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-secondary 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-secondary 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 R(o){let t;function s(l,i){return l[1]?I:l[0]?F:T}let e=s(o),n=e(o);return{c(){n.c(),t=S()},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 V(o){let t,s;return t=new x({props:{nobranding:!0,$$slots:{default:[R]},$$scope:{ctx:o}}}),{c(){C(t.$$.fragment)},m(e,n){g(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){H(t,e)}}}function q(o,t,s){let{params:e}=t,n=!1,l=!1;i();async function i(){s(1,l=!0);const d=new M("../");try{const m=P(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 G extends v{constructor(t){super(),y(this,t,q,V,w,{params:2})}}export{G as default};
|
||||
+15
-15
@@ -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,Q as me,p as de}from"./index-9ce6aa95.js";import{S as fe}from"./SdkTabs-ccd8881b.js";function $e(o){var B,U,W,A,H,L,M,T,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,N 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,R as me,p as de}from"./index-e4123b79.js";import{S as fe}from"./SdkTabs-a1061d88.js";function $e(o){var B,U,W,A,H,L,T,q,M,N,j,J;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]}');
|
||||
@@ -32,20 +32,20 @@ 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
|
||||
// (Optionally) authenticate
|
||||
await pb.collection('users').authWithPassword('test@example.com', '123456');
|
||||
|
||||
// Subscribe to changes in any ${(M=o[0])==null?void 0:M.name} record
|
||||
pb.collection('${(T=o[0])==null?void 0:T.name}').subscribe('*', (e) {
|
||||
// Subscribe to changes in any ${(T=o[0])==null?void 0:T.name} record
|
||||
pb.collection('${(q=o[0])==null?void 0:q.name}').subscribe('*', (e) {
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Subscribe to changes only in the specified record
|
||||
pb.collection('${(q=o[0])==null?void 0:q.name}').subscribe('RECORD_ID', (e) {
|
||||
pb.collection('${(M=o[0])==null?void 0:M.name}').subscribe('RECORD_ID', (e) {
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Unsubscribe
|
||||
pb.collection('${(j=o[0])==null?void 0:j.name}').unsubscribe('RECORD_ID'); // remove all 'RECORD_ID' subscriptions
|
||||
pb.collection('${(J=o[0])==null?void 0:J.name}').unsubscribe('*'); // remove all '*' topic subscriptions
|
||||
pb.collection('${(N=o[0])==null?void 0:N.name}').unsubscribe(); // remove all subscriptions in the collection
|
||||
pb.collection('${(N=o[0])==null?void 0:N.name}').unsubscribe('RECORD_ID'); // remove all 'RECORD_ID' subscriptions
|
||||
pb.collection('${(j=o[0])==null?void 0:j.name}').unsubscribe('*'); // remove all '*' topic subscriptions
|
||||
pb.collection('${(J=o[0])==null?void 0:J.name}').unsubscribe(); // remove all subscriptions in the collection
|
||||
`}}),r=new ue({props:{content:JSON.stringify({action:"create",record:P.dummyCollectionRecord(o[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')}}),{c(){i=u("h3"),m=y("Realtime ("),b=y(l),d=y(")"),h=a(),f=u("div"),f.innerHTML=`<p>Subscribe to realtime changes via Server-Sent Events (SSE).</p>
|
||||
<p>Events are sent for <strong>create</strong>, <strong>update</strong>
|
||||
and <strong>delete</strong> record operations (see "Event data format" section below).</p>`,_=a(),$=u("div"),$.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
|
||||
@@ -56,7 +56,7 @@ 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>When you subscribe to an <strong>entire collection</strong>, the collection's
|
||||
<strong>ListRule</strong> will be used to determine whether the subscriber has access to receive the
|
||||
event message.</p></div>`,k=a(),te(c.$$.fragment),S=a(),v=u("h6"),v.textContent="API details",w=a(),R=u("div"),R.innerHTML=`<strong class="label label-primary">SSE</strong>
|
||||
<div class="content"><p>/api/realtime</p></div>`,C=a(),g=u("div"),g.textContent="Event data format",E=a(),te(r.$$.fragment),p(i,"class","m-b-sm"),p(f,"class","content txt-lg m-b-sm"),p($,"class","alert alert-info m-t-10 m-b-sm"),p(v,"class","m-b-xs"),p(R,"class","alert"),p(g,"class","section-title")},m(e,s){t(e,i,s),I(i,m),I(i,b),I(i,d),t(e,h,s),t(e,f,s),t(e,_,s),t(e,$,s),t(e,k,s),ne(c,e,s),t(e,S,s),t(e,v,s),t(e,w,s),t(e,R,s),t(e,C,s),t(e,g,s),t(e,E,s),ne(r,e,s),D=!0},p(e,[s]){var V,Y,z,F,G,K,X,Z,x,ee,se,oe;(!D||s&1)&&l!==(l=e[0].name+"")&&pe(b,l);const O={};s&3&&(O.js=`
|
||||
<div class="content"><p>/api/realtime</p></div>`,C=a(),g=u("div"),g.textContent="Event data format",E=a(),te(r.$$.fragment),p(i,"class","m-b-sm"),p(f,"class","content txt-lg m-b-sm"),p($,"class","alert alert-info m-t-10 m-b-sm"),p(v,"class","m-b-xs"),p(R,"class","alert"),p(g,"class","section-title")},m(e,s){t(e,i,s),I(i,m),I(i,b),I(i,d),t(e,h,s),t(e,f,s),t(e,_,s),t(e,$,s),t(e,k,s),ne(c,e,s),t(e,S,s),t(e,v,s),t(e,w,s),t(e,R,s),t(e,C,s),t(e,g,s),t(e,E,s),ne(r,e,s),D=!0},p(e,[s]){var Y,z,F,G,K,Q,X,Z,x,ee,se,oe;(!D||s&1)&&l!==(l=e[0].name+"")&&pe(b,l);const O={};s&3&&(O.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${e[1]}');
|
||||
@@ -66,20 +66,20 @@ 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
|
||||
// (Optionally) authenticate
|
||||
await pb.collection('users').authWithPassword('test@example.com', '123456');
|
||||
|
||||
// Subscribe to changes in any ${(V=e[0])==null?void 0:V.name} record
|
||||
pb.collection('${(Y=e[0])==null?void 0:Y.name}').subscribe('*', function (e) {
|
||||
// Subscribe to changes in any ${(Y=e[0])==null?void 0:Y.name} record
|
||||
pb.collection('${(z=e[0])==null?void 0:z.name}').subscribe('*', function (e) {
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Subscribe to changes only in the specified record
|
||||
pb.collection('${(z=e[0])==null?void 0:z.name}').subscribe('RECORD_ID', function (e) {
|
||||
pb.collection('${(F=e[0])==null?void 0:F.name}').subscribe('RECORD_ID', function (e) {
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Unsubscribe
|
||||
pb.collection('${(F=e[0])==null?void 0:F.name}').unsubscribe('RECORD_ID'); // remove all 'RECORD_ID' subscriptions
|
||||
pb.collection('${(G=e[0])==null?void 0:G.name}').unsubscribe('*'); // remove all '*' topic subscriptions
|
||||
pb.collection('${(K=e[0])==null?void 0:K.name}').unsubscribe(); // remove all subscriptions in the collection
|
||||
pb.collection('${(G=e[0])==null?void 0:G.name}').unsubscribe('RECORD_ID'); // remove all 'RECORD_ID' subscriptions
|
||||
pb.collection('${(K=e[0])==null?void 0:K.name}').unsubscribe('*'); // remove all '*' topic subscriptions
|
||||
pb.collection('${(Q=e[0])==null?void 0:Q.name}').unsubscribe(); // remove all subscriptions in the collection
|
||||
`),s&3&&(O.dart=`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
@@ -104,4 +104,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
|
||||
pb.collection('${(ee=e[0])==null?void 0:ee.name}').unsubscribe('RECORD_ID'); // remove all 'RECORD_ID' subscriptions
|
||||
pb.collection('${(se=e[0])==null?void 0:se.name}').unsubscribe('*'); // remove all '*' topic subscriptions
|
||||
pb.collection('${(oe=e[0])==null?void 0:oe.name}').unsubscribe(); // remove all subscriptions in the collection
|
||||
`),c.$set(O);const Q={};s&1&&(Q.content=JSON.stringify({action:"create",record:P.dummyCollectionRecord(e[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),r.$set(Q)},i(e){D||(ie(c.$$.fragment,e),ie(r.$$.fragment,e),D=!0)},o(e){le(c.$$.fragment,e),le(r.$$.fragment,e),D=!1},d(e){e&&n(i),e&&n(h),e&&n(f),e&&n(_),e&&n($),e&&n(k),ce(c,e),e&&n(S),e&&n(v),e&&n(w),e&&n(R),e&&n(C),e&&n(g),e&&n(E),ce(r,e)}}}function ve(o,i,m){let l,{collection:b=new me}=i;return o.$$set=d=>{"collection"in d&&m(0,b=d.collection)},m(1,l=P.getApiExampleUrl(de.baseUrl)),[b,l]}class De extends re{constructor(i){super(),ae(this,i,ve,$e,be,{collection:0})}}export{De as default};
|
||||
`),c.$set(O);const V={};s&1&&(V.content=JSON.stringify({action:"create",record:P.dummyCollectionRecord(e[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),r.$set(V)},i(e){D||(ie(c.$$.fragment,e),ie(r.$$.fragment,e),D=!0)},o(e){le(c.$$.fragment,e),le(r.$$.fragment,e),D=!1},d(e){e&&n(i),e&&n(h),e&&n(f),e&&n(_),e&&n($),e&&n(k),ce(c,e),e&&n(S),e&&n(v),e&&n(w),e&&n(R),e&&n(C),e&&n(g),e&&n(E),ce(r,e)}}}function ve(o,i,m){let l,{collection:b=new me}=i;return o.$$set=d=>{"collection"in d&&m(0,b=d.collection)},m(1,l=P.getApiExampleUrl(de.baseUrl)),[b,l]}class De extends re{constructor(i){super(),ae(this,i,ve,$e,be,{collection:0})}}export{De as default};
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
import{S as Te,i as Ee,s as Be,e as c,w as v,b as h,c as Pe,f,g as r,h as n,m as Ce,x as I,N as ve,O as Se,k as Me,P as Re,n as Ae,t as x,a as ee,o as m,d as ye,Q as We,C as ze,p as He,r as L,u as Oe,M as Ue}from"./index-9ce6aa95.js";import{S as je}from"./SdkTabs-ccd8881b.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=c("button"),_=v(a),b=h(),f(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m($,q){r($,s,q),n(s,_),n(s,b),i||(p=Oe(s,"click",u),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&I(_,a),q&6&&L(s,"active",l[1]===l[5].code)},d($){$&&m(s),i=!1,p()}}}function qe(o,l){let s,a,_,b;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),Pe(a.$$.fragment),_=h(),f(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(i,p){r(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)&&L(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&&m(s),ye(a)}}}function De(o){var de,pe,ue,fe;let l,s,a=o[0].name+"",_,b,i,p,u,$,q,z=o[0].name+"",N,te,F,P,K,T,Q,w,H,le,O,E,se,G,U=o[0].name+"",J,ae,oe,j,V,B,X,S,Y,M,Z,C,R,g=[],ne=new Map,ie,A,k=[],ce=new Map,y;P=new je({props:{js:`
|
||||
import{S as Te,i as Ee,s as Be,e as c,w as v,b as h,c as Pe,f,g as r,h as n,m as Ce,x as L,O as ve,P as Se,k as Re,Q as Me,n as Ae,t as x,a as ee,o as m,d as ye,R as We,C as ze,p as He,r as N,u as Oe,N as Ue}from"./index-e4123b79.js";import{S as je}from"./SdkTabs-a1061d88.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=c("button"),_=v(a),b=h(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m($,q){r($,s,q),n(s,_),n(s,b),i||(p=Oe(s,"click",u),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&L(_,a),q&6&&N(s,"active",l[1]===l[5].code)},d($){$&&m(s),i=!1,p()}}}function qe(o,l){let s,a,_,b;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),Pe(a.$$.fragment),_=h(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m(i,p){r(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)&&N(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&&m(s),ye(a)}}}function De(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,w,H,le,O,E,se,G,U=o[0].name+"",J,ae,oe,j,V,B,X,S,Y,R,Z,C,M,g=[],ne=new Map,ie,A,k=[],ce=new Map,y;P=new je({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${o[3]}');
|
||||
@@ -18,13 +18,13 @@ import{S as Te,i as Ee,s as Be,e as c,w as v,b as h,c as Pe,f,g as r,h as n,m as
|
||||
await pb.collection('${(ue=o[0])==null?void 0:ue.name}').authWithPassword('test@example.com', '1234567890');
|
||||
|
||||
await pb.collection('${(fe=o[0])==null?void 0:fe.name}').requestEmailChange('new@example.com');
|
||||
`}});let D=o[2];const re=e=>e[5].code;for(let e=0;e<D.length;e+=1){let t=ge(o,D,e),d=re(t);ne.set(d,g[e]=$e(d,t))}let W=o[2];const me=e=>e[5].code;for(let e=0;e<W.length;e+=1){let t=we(o,W,e),d=me(t);ce.set(d,k[e]=qe(d,t))}return{c(){l=c("h3"),s=v("Request email change ("),_=v(a),b=v(")"),i=h(),p=c("div"),u=c("p"),$=v("Sends "),q=c("strong"),N=v(z),te=v(" email change request."),F=h(),Pe(P.$$.fragment),K=h(),T=c("h6"),T.textContent="API details",Q=h(),w=c("div"),H=c("strong"),H.textContent="POST",le=h(),O=c("div"),E=c("p"),se=v("/api/collections/"),G=c("strong"),J=v(U),ae=v("/request-email-change"),oe=h(),j=c("p"),j.innerHTML="Requires record <code>Authorization:TOKEN</code> header",V=h(),B=c("div"),B.textContent="Body Parameters",X=h(),S=c("table"),S.innerHTML=`<thead><tr><th>Param</th>
|
||||
`}});let D=o[2];const re=e=>e[5].code;for(let e=0;e<D.length;e+=1){let t=ge(o,D,e),d=re(t);ne.set(d,g[e]=$e(d,t))}let W=o[2];const me=e=>e[5].code;for(let e=0;e<W.length;e+=1){let t=we(o,W,e),d=me(t);ce.set(d,k[e]=qe(d,t))}return{c(){l=c("h3"),s=v("Request email change ("),_=v(a),b=v(")"),i=h(),p=c("div"),u=c("p"),$=v("Sends "),q=c("strong"),F=v(z),te=v(" email change request."),I=h(),Pe(P.$$.fragment),K=h(),T=c("h6"),T.textContent="API details",Q=h(),w=c("div"),H=c("strong"),H.textContent="POST",le=h(),O=c("div"),E=c("p"),se=v("/api/collections/"),G=c("strong"),J=v(U),ae=v("/request-email-change"),oe=h(),j=c("p"),j.innerHTML="Requires record <code>Authorization:TOKEN</code> header",V=h(),B=c("div"),B.textContent="Body Parameters",X=h(),S=c("table"),S.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>
|
||||
<span>newEmail</span></div></td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>The new email address to send the change email request.</td></tr></tbody>`,Y=h(),M=c("div"),M.textContent="Responses",Z=h(),C=c("div"),R=c("div");for(let e=0;e<g.length;e+=1)g[e].c();ie=h(),A=c("div");for(let e=0;e<k.length;e+=1)k[e].c();f(l,"class","m-b-sm"),f(p,"class","content txt-lg m-b-sm"),f(T,"class","m-b-xs"),f(H,"class","label label-primary"),f(O,"class","content"),f(j,"class","txt-hint txt-sm txt-right"),f(w,"class","alert alert-success"),f(B,"class","section-title"),f(S,"class","table-compact table-border m-b-base"),f(M,"class","section-title"),f(R,"class","tabs-header compact left"),f(A,"class","tabs-content"),f(C,"class","tabs")},m(e,t){r(e,l,t),n(l,s),n(l,_),n(l,b),r(e,i,t),r(e,p,t),n(p,u),n(u,$),n(u,q),n(q,N),n(u,te),r(e,F,t),Ce(P,e,t),r(e,K,t),r(e,T,t),r(e,Q,t),r(e,w,t),n(w,H),n(w,le),n(w,O),n(O,E),n(E,se),n(E,G),n(G,J),n(E,ae),n(w,oe),n(w,j),r(e,V,t),r(e,B,t),r(e,X,t),r(e,S,t),r(e,Y,t),r(e,M,t),r(e,Z,t),r(e,C,t),n(C,R);for(let d=0;d<g.length;d+=1)g[d].m(R,null);n(C,ie),n(C,A);for(let d=0;d<k.length;d+=1)k[d].m(A,null);y=!0},p(e,[t]){var be,_e,he,ke;(!y||t&1)&&a!==(a=e[0].name+"")&&I(_,a),(!y||t&1)&&z!==(z=e[0].name+"")&&I(N,z);const d={};t&9&&(d.js=`
|
||||
<td>The new email address to send the change email request.</td></tr></tbody>`,Y=h(),R=c("div"),R.textContent="Responses",Z=h(),C=c("div"),M=c("div");for(let e=0;e<g.length;e+=1)g[e].c();ie=h(),A=c("div");for(let e=0;e<k.length;e+=1)k[e].c();f(l,"class","m-b-sm"),f(p,"class","content txt-lg m-b-sm"),f(T,"class","m-b-xs"),f(H,"class","label label-primary"),f(O,"class","content"),f(j,"class","txt-hint txt-sm txt-right"),f(w,"class","alert alert-success"),f(B,"class","section-title"),f(S,"class","table-compact table-border m-b-base"),f(R,"class","section-title"),f(M,"class","tabs-header compact left"),f(A,"class","tabs-content"),f(C,"class","tabs")},m(e,t){r(e,l,t),n(l,s),n(l,_),n(l,b),r(e,i,t),r(e,p,t),n(p,u),n(u,$),n(u,q),n(q,F),n(u,te),r(e,I,t),Ce(P,e,t),r(e,K,t),r(e,T,t),r(e,Q,t),r(e,w,t),n(w,H),n(w,le),n(w,O),n(O,E),n(E,se),n(E,G),n(G,J),n(E,ae),n(w,oe),n(w,j),r(e,V,t),r(e,B,t),r(e,X,t),r(e,S,t),r(e,Y,t),r(e,R,t),r(e,Z,t),r(e,C,t),n(C,M);for(let d=0;d<g.length;d+=1)g[d].m(M,null);n(C,ie),n(C,A);for(let d=0;d<k.length;d+=1)k[d].m(A,null);y=!0},p(e,[t]){var be,_e,he,ke;(!y||t&1)&&a!==(a=e[0].name+"")&&L(_,a),(!y||t&1)&&z!==(z=e[0].name+"")&&L(F,z);const d={};t&9&&(d.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${e[3]}');
|
||||
@@ -44,7 +44,7 @@ import{S as Te,i as Ee,s as Be,e as c,w as v,b as h,c as Pe,f,g as r,h as n,m as
|
||||
await pb.collection('${(he=e[0])==null?void 0:he.name}').authWithPassword('test@example.com', '1234567890');
|
||||
|
||||
await pb.collection('${(ke=e[0])==null?void 0:ke.name}').requestEmailChange('new@example.com');
|
||||
`),P.$set(d),(!y||t&1)&&U!==(U=e[0].name+"")&&I(J,U),t&6&&(D=e[2],g=ve(g,t,re,1,e,D,ne,R,Se,$e,null,ge)),t&6&&(W=e[2],Me(),k=ve(k,t,me,1,e,W,ce,A,Re,qe,null,we),Ae())},i(e){if(!y){x(P.$$.fragment,e);for(let t=0;t<W.length;t+=1)x(k[t]);y=!0}},o(e){ee(P.$$.fragment,e);for(let t=0;t<k.length;t+=1)ee(k[t]);y=!1},d(e){e&&m(l),e&&m(i),e&&m(p),e&&m(F),ye(P,e),e&&m(K),e&&m(T),e&&m(Q),e&&m(w),e&&m(V),e&&m(B),e&&m(X),e&&m(S),e&&m(Y),e&&m(M),e&&m(Z),e&&m(C);for(let t=0;t<g.length;t+=1)g[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function Ie(o,l,s){let a,{collection:_=new We}=l,b=204,i=[];const p=u=>s(1,b=u.code);return o.$$set=u=>{"collection"in u&&s(0,_=u.collection)},s(3,a=ze.getApiExampleUrl(He.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:`
|
||||
`),P.$set(d),(!y||t&1)&&U!==(U=e[0].name+"")&&L(J,U),t&6&&(D=e[2],g=ve(g,t,re,1,e,D,ne,M,Se,$e,null,ge)),t&6&&(W=e[2],Re(),k=ve(k,t,me,1,e,W,ce,A,Me,qe,null,we),Ae())},i(e){if(!y){x(P.$$.fragment,e);for(let t=0;t<W.length;t+=1)x(k[t]);y=!0}},o(e){ee(P.$$.fragment,e);for(let t=0;t<k.length;t+=1)ee(k[t]);y=!1},d(e){e&&m(l),e&&m(i),e&&m(p),e&&m(I),ye(P,e),e&&m(K),e&&m(T),e&&m(Q),e&&m(w),e&&m(V),e&&m(B),e&&m(X),e&&m(S),e&&m(Y),e&&m(R),e&&m(Z),e&&m(C);for(let t=0;t<g.length;t+=1)g[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function Le(o,l,s){let a,{collection:_=new We}=l,b=204,i=[];const p=u=>s(1,b=u.code);return o.$$set=u=>{"collection"in u&&s(0,_=u.collection)},s(3,a=ze.getApiExampleUrl(He.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to authenticate.",
|
||||
@@ -67,4 +67,4 @@ import{S as Te,i as Ee,s as Be,e as c,w as v,b as h,c as Pe,f,g as r,h as n,m as
|
||||
"message": "The authorized record model is not allowed to perform this action.",
|
||||
"data": {}
|
||||
}
|
||||
`}]),[_,b,i,a,p]}class Fe extends Te{constructor(l){super(),Ee(this,l,Ie,De,Be,{collection:0})}}export{Fe as default};
|
||||
`}]),[_,b,i,a,p]}class Ie extends Te{constructor(l){super(),Ee(this,l,Le,De,Be,{collection:0})}}export{Ie as default};
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
import{S as Pe,i as $e,s as qe,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as we,x as F,N as ue,O as ge,k as ye,P as Re,n as Be,t as Z,a as x,o as d,d as he,Q as Ce,C as Se,p as Te,r as L,u as Me,M as Ae}from"./index-9ce6aa95.js";import{S as Ue}from"./SdkTabs-ccd8881b.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=c("button"),_=w(o),m=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(P,$){r(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+"")&&F(_,o),$&6&&L(l,"active",s[1]===s[5].code)},d(P){P&&d(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=c("div"),ve(o.$$.fragment),_=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(i,p){r(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)&&L(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&&d(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+"",N,ee,Q,q,z,B,G,g,H,te,I,C,se,J,O=a[0].name+"",K,le,V,S,W,T,X,M,Y,y,A,h=[],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 c,w,b as v,c as ve,f as b,g as r,h as n,m as we,x as I,O as me,P as Re,k as ge,Q as ye,n as Be,t as Z,a as x,o as d,d as he,R as Ce,C as Se,p as Te,r as L,u as Me,N as Ae}from"./index-e4123b79.js";import{S as Ue}from"./SdkTabs-a1061d88.js";function ue(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+"",_,u,i,p;function m(){return s[4](s[5])}return{key:a,first:null,c(){l=c("button"),_=w(o),u=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(P,$){r(P,l,$),n(l,_),n(l,u),i||(p=Me(l,"click",m),i=!0)},p(P,$){s=P,$&4&&o!==(o=s[5].code+"")&&I(_,o),$&6&&L(l,"active",s[1]===s[5].code)},d(P){P&&d(l),i=!1,p()}}}function ke(a,s){let l,o,_,u;return o=new Ae({props:{content:s[5].body}}),{key:a,first:null,c(){l=c("div"),ve(o.$$.fragment),_=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(i,p){r(i,l,p),we(o,l,null),n(l,_),u=!0},p(i,p){s=i;const m={};p&4&&(m.content=s[5].body),o.$set(m),(!u||p&6)&&L(l,"active",s[1]===s[5].code)},i(i){u||(Z(o.$$.fragment,i),u=!0)},o(i){x(o.$$.fragment,i),u=!1},d(i){i&&d(l),he(o)}}}function je(a){var re,de;let s,l,o=a[0].name+"",_,u,i,p,m,P,$,D=a[0].name+"",N,ee,Q,q,z,B,G,R,H,te,O,C,se,J,E=a[0].name+"",K,le,V,S,W,T,X,M,Y,g,A,h=[],oe=new Map,ae,U,k=[],ne=new Map,y;q=new Ue({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${a[3]}');
|
||||
@@ -14,13 +14,13 @@ import{S as Pe,i as $e,s as qe,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as
|
||||
...
|
||||
|
||||
await pb.collection('${(de=a[0])==null?void 0:de.name}').requestPasswordReset('test@example.com');
|
||||
`}});let E=a[2];const ie=e=>e[5].code;for(let e=0;e<E.length;e+=1){let t=be(a,E,e),f=ie(t);oe.set(f,h[e]=_e(f,t))}let j=a[2];const ce=e=>e[5].code;for(let e=0;e<j.length;e+=1){let t=me(a,j,e),f=ce(t);ne.set(f,k[e]=ke(f,t))}return{c(){s=c("h3"),l=w("Request password reset ("),_=w(o),m=w(")"),i=v(),p=c("div"),u=c("p"),P=w("Sends "),$=c("strong"),N=w(D),ee=w(" password reset email request."),Q=v(),ve(q.$$.fragment),z=v(),B=c("h6"),B.textContent="API details",G=v(),g=c("div"),H=c("strong"),H.textContent="POST",te=v(),I=c("div"),C=c("p"),se=w("/api/collections/"),J=c("strong"),K=w(O),le=w("/request-password-reset"),V=v(),S=c("div"),S.textContent="Body Parameters",W=v(),T=c("table"),T.innerHTML=`<thead><tr><th>Param</th>
|
||||
`}});let F=a[2];const ie=e=>e[5].code;for(let e=0;e<F.length;e+=1){let t=be(a,F,e),f=ie(t);oe.set(f,h[e]=_e(f,t))}let j=a[2];const ce=e=>e[5].code;for(let e=0;e<j.length;e+=1){let t=ue(a,j,e),f=ce(t);ne.set(f,k[e]=ke(f,t))}return{c(){s=c("h3"),l=w("Request password reset ("),_=w(o),u=w(")"),i=v(),p=c("div"),m=c("p"),P=w("Sends "),$=c("strong"),N=w(D),ee=w(" password reset email request."),Q=v(),ve(q.$$.fragment),z=v(),B=c("h6"),B.textContent="API details",G=v(),R=c("div"),H=c("strong"),H.textContent="POST",te=v(),O=c("div"),C=c("p"),se=w("/api/collections/"),J=c("strong"),K=w(E),le=w("/request-password-reset"),V=v(),S=c("div"),S.textContent="Body Parameters",W=v(),T=c("table"),T.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>
|
||||
<span>email</span></div></td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>The auth record email address to send the password reset request (if exists).</td></tr></tbody>`,X=v(),M=c("div"),M.textContent="Responses",Y=v(),y=c("div"),A=c("div");for(let e=0;e<h.length;e+=1)h[e].c();ae=v(),U=c("div");for(let e=0;e<k.length;e+=1)k[e].c();b(s,"class","m-b-sm"),b(p,"class","content txt-lg m-b-sm"),b(B,"class","m-b-xs"),b(H,"class","label label-primary"),b(I,"class","content"),b(g,"class","alert alert-success"),b(S,"class","section-title"),b(T,"class","table-compact table-border m-b-base"),b(M,"class","section-title"),b(A,"class","tabs-header compact left"),b(U,"class","tabs-content"),b(y,"class","tabs")},m(e,t){r(e,s,t),n(s,l),n(s,_),n(s,m),r(e,i,t),r(e,p,t),n(p,u),n(u,P),n(u,$),n($,N),n(u,ee),r(e,Q,t),we(q,e,t),r(e,z,t),r(e,B,t),r(e,G,t),r(e,g,t),n(g,H),n(g,te),n(g,I),n(I,C),n(C,se),n(C,J),n(J,K),n(C,le),r(e,V,t),r(e,S,t),r(e,W,t),r(e,T,t),r(e,X,t),r(e,M,t),r(e,Y,t),r(e,y,t),n(y,A);for(let f=0;f<h.length;f+=1)h[f].m(A,null);n(y,ae),n(y,U);for(let f=0;f<k.length;f+=1)k[f].m(U,null);R=!0},p(e,[t]){var fe,pe;(!R||t&1)&&o!==(o=e[0].name+"")&&F(_,o),(!R||t&1)&&D!==(D=e[0].name+"")&&F(N,D);const f={};t&9&&(f.js=`
|
||||
<td>The auth record email address to send the password reset request (if exists).</td></tr></tbody>`,X=v(),M=c("div"),M.textContent="Responses",Y=v(),g=c("div"),A=c("div");for(let e=0;e<h.length;e+=1)h[e].c();ae=v(),U=c("div");for(let e=0;e<k.length;e+=1)k[e].c();b(s,"class","m-b-sm"),b(p,"class","content txt-lg m-b-sm"),b(B,"class","m-b-xs"),b(H,"class","label label-primary"),b(O,"class","content"),b(R,"class","alert alert-success"),b(S,"class","section-title"),b(T,"class","table-compact table-border m-b-base"),b(M,"class","section-title"),b(A,"class","tabs-header compact left"),b(U,"class","tabs-content"),b(g,"class","tabs")},m(e,t){r(e,s,t),n(s,l),n(s,_),n(s,u),r(e,i,t),r(e,p,t),n(p,m),n(m,P),n(m,$),n($,N),n(m,ee),r(e,Q,t),we(q,e,t),r(e,z,t),r(e,B,t),r(e,G,t),r(e,R,t),n(R,H),n(R,te),n(R,O),n(O,C),n(C,se),n(C,J),n(J,K),n(C,le),r(e,V,t),r(e,S,t),r(e,W,t),r(e,T,t),r(e,X,t),r(e,M,t),r(e,Y,t),r(e,g,t),n(g,A);for(let f=0;f<h.length;f+=1)h[f].m(A,null);n(g,ae),n(g,U);for(let f=0;f<k.length;f+=1)k[f].m(U,null);y=!0},p(e,[t]){var fe,pe;(!y||t&1)&&o!==(o=e[0].name+"")&&I(_,o),(!y||t&1)&&D!==(D=e[0].name+"")&&I(N,D);const f={};t&9&&(f.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${e[3]}');
|
||||
@@ -36,7 +36,7 @@ import{S as Pe,i as $e,s as qe,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as
|
||||
...
|
||||
|
||||
await pb.collection('${(pe=e[0])==null?void 0:pe.name}').requestPasswordReset('test@example.com');
|
||||
`),q.$set(f),(!R||t&1)&&O!==(O=e[0].name+"")&&F(K,O),t&6&&(E=e[2],h=ue(h,t,ie,1,e,E,oe,A,ge,_e,null,be)),t&6&&(j=e[2],ye(),k=ue(k,t,ce,1,e,j,ne,U,Re,ke,null,me),Be())},i(e){if(!R){Z(q.$$.fragment,e);for(let t=0;t<j.length;t+=1)Z(k[t]);R=!0}},o(e){x(q.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);R=!1},d(e){e&&d(s),e&&d(i),e&&d(p),e&&d(Q),he(q,e),e&&d(z),e&&d(B),e&&d(G),e&&d(g),e&&d(V),e&&d(S),e&&d(W),e&&d(T),e&&d(X),e&&d(M),e&&d(Y),e&&d(y);for(let t=0;t<h.length;t+=1)h[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function De(a,s,l){let o,{collection:_=new Ce}=s,m=204,i=[];const p=u=>l(1,m=u.code);return a.$$set=u=>{"collection"in u&&l(0,_=u.collection)},l(3,o=Se.getApiExampleUrl(Te.baseUrl)),l(2,i=[{code:204,body:"null"},{code:400,body:`
|
||||
`),q.$set(f),(!y||t&1)&&E!==(E=e[0].name+"")&&I(K,E),t&6&&(F=e[2],h=me(h,t,ie,1,e,F,oe,A,Re,_e,null,be)),t&6&&(j=e[2],ge(),k=me(k,t,ce,1,e,j,ne,U,ye,ke,null,ue),Be())},i(e){if(!y){Z(q.$$.fragment,e);for(let t=0;t<j.length;t+=1)Z(k[t]);y=!0}},o(e){x(q.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);y=!1},d(e){e&&d(s),e&&d(i),e&&d(p),e&&d(Q),he(q,e),e&&d(z),e&&d(B),e&&d(G),e&&d(R),e&&d(V),e&&d(S),e&&d(W),e&&d(T),e&&d(X),e&&d(M),e&&d(Y),e&&d(g);for(let t=0;t<h.length;t+=1)h[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function De(a,s,l){let o,{collection:_=new Ce}=s,u=204,i=[];const p=m=>l(1,u=m.code);return a.$$set=m=>{"collection"in m&&l(0,_=m.collection)},l(3,o=Se.getApiExampleUrl(Te.baseUrl)),l(2,i=[{code:204,body:"null"},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to authenticate.",
|
||||
@@ -47,4 +47,4 @@ import{S as Pe,i as $e,s as qe,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as
|
||||
}
|
||||
}
|
||||
}
|
||||
`}]),[_,m,i,o,p]}class Oe extends Pe{constructor(s){super(),$e(this,s,De,je,qe,{collection:0})}}export{Oe as default};
|
||||
`}]),[_,u,i,o,p]}class Ee extends Pe{constructor(s){super(),$e(this,s,De,je,qe,{collection:0})}}export{Ee as default};
|
||||
+8
-8
@@ -1,4 +1,4 @@
|
||||
import{S as qe,i as we,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as i,m as he,x as E,N as me,O as ge,k as ye,P as Be,n as Ce,t as Z,a as x,o as f,d as $e,Q as Se,C as Te,p as Me,r as F,u as Ve,M as Re}from"./index-9ce6aa95.js";import{S as Ae}from"./SdkTabs-ccd8881b.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=c("button"),_=h(o),p=v(),b(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(q,w){r(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+"")&&E(_,o),w&6&&F(s,"active",l[1]===l[5].code)},d(q){q&&f(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=c("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(n,d){r(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)&&F(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&&f(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+"",L,ee,N,P,Q,C,z,g,D,te,H,S,le,G,I=a[0].name+"",J,se,K,T,W,M,X,V,Y,y,R,$=[],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 c,w as h,b as v,c as ve,f as b,g as r,h as i,m as he,x as F,O as de,P as ge,k as ye,Q as Be,n as Ce,t as Z,a as x,o as f,d as $e,R as Se,C as Te,p as Re,r as I,u as Ve,N as Me}from"./index-e4123b79.js";import{S as Ae}from"./SdkTabs-a1061d88.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,u;function d(){return l[4](l[5])}return{key:a,first:null,c(){s=c("button"),_=h(o),p=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(q,w){r(q,s,w),i(s,_),i(s,p),n||(u=Ve(s,"click",d),n=!0)},p(q,w){l=q,w&4&&o!==(o=l[5].code+"")&&F(_,o),w&6&&I(s,"active",l[1]===l[5].code)},d(q){q&&f(s),n=!1,u()}}}function ke(a,l){let s,o,_,p;return o=new Me({props:{content:l[5].body}}),{key:a,first:null,c(){s=c("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(n,u){r(n,s,u),he(o,s,null),i(s,_),p=!0},p(n,u){l=n;const d={};u&4&&(d.content=l[5].body),o.$set(d),(!p||u&6)&&I(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&&f(s),$e(o)}}}function Ue(a){var re,fe;let l,s,o=a[0].name+"",_,p,n,u,d,q,w,j=a[0].name+"",L,ee,N,P,Q,C,z,g,D,te,H,S,le,G,O=a[0].name+"",J,se,K,T,W,R,X,V,Y,y,M,$=[],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]}');
|
||||
@@ -14,29 +14,29 @@ import{S as qe,i as we,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as i
|
||||
...
|
||||
|
||||
await pb.collection('${(fe=a[0])==null?void 0:fe.name}').requestVerification('test@example.com');
|
||||
`}});let O=a[2];const ne=e=>e[5].code;for(let e=0;e<O.length;e+=1){let t=be(a,O,e),u=ne(t);oe.set(u,$[e]=_e(u,t))}let U=a[2];const ce=e=>e[5].code;for(let e=0;e<U.length;e+=1){let t=pe(a,U,e),u=ce(t);ie.set(u,k[e]=ke(u,t))}return{c(){l=c("h3"),s=h("Request verification ("),_=h(o),p=h(")"),n=v(),d=c("div"),m=c("p"),q=h("Sends "),w=c("strong"),L=h(j),ee=h(" verification email request."),N=v(),ve(P.$$.fragment),Q=v(),C=c("h6"),C.textContent="API details",z=v(),g=c("div"),D=c("strong"),D.textContent="POST",te=v(),H=c("div"),S=c("p"),le=h("/api/collections/"),G=c("strong"),J=h(I),se=h("/request-verification"),K=v(),T=c("div"),T.textContent="Body Parameters",W=v(),M=c("table"),M.innerHTML=`<thead><tr><th>Param</th>
|
||||
`}});let E=a[2];const ne=e=>e[5].code;for(let e=0;e<E.length;e+=1){let t=be(a,E,e),m=ne(t);oe.set(m,$[e]=_e(m,t))}let U=a[2];const ce=e=>e[5].code;for(let e=0;e<U.length;e+=1){let t=pe(a,U,e),m=ce(t);ie.set(m,k[e]=ke(m,t))}return{c(){l=c("h3"),s=h("Request verification ("),_=h(o),p=h(")"),n=v(),u=c("div"),d=c("p"),q=h("Sends "),w=c("strong"),L=h(j),ee=h(" verification email request."),N=v(),ve(P.$$.fragment),Q=v(),C=c("h6"),C.textContent="API details",z=v(),g=c("div"),D=c("strong"),D.textContent="POST",te=v(),H=c("div"),S=c("p"),le=h("/api/collections/"),G=c("strong"),J=h(O),se=h("/request-verification"),K=v(),T=c("div"),T.textContent="Body Parameters",W=v(),R=c("table"),R.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>
|
||||
<span>email</span></div></td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>The auth record email address to send the verification request (if exists).</td></tr></tbody>`,X=v(),V=c("div"),V.textContent="Responses",Y=v(),y=c("div"),R=c("div");for(let e=0;e<$.length;e+=1)$[e].c();ae=v(),A=c("div");for(let e=0;e<k.length;e+=1)k[e].c();b(l,"class","m-b-sm"),b(d,"class","content txt-lg m-b-sm"),b(C,"class","m-b-xs"),b(D,"class","label label-primary"),b(H,"class","content"),b(g,"class","alert alert-success"),b(T,"class","section-title"),b(M,"class","table-compact table-border m-b-base"),b(V,"class","section-title"),b(R,"class","tabs-header compact left"),b(A,"class","tabs-content"),b(y,"class","tabs")},m(e,t){r(e,l,t),i(l,s),i(l,_),i(l,p),r(e,n,t),r(e,d,t),i(d,m),i(m,q),i(m,w),i(w,L),i(m,ee),r(e,N,t),he(P,e,t),r(e,Q,t),r(e,C,t),r(e,z,t),r(e,g,t),i(g,D),i(g,te),i(g,H),i(H,S),i(S,le),i(S,G),i(G,J),i(S,se),r(e,K,t),r(e,T,t),r(e,W,t),r(e,M,t),r(e,X,t),r(e,V,t),r(e,Y,t),r(e,y,t),i(y,R);for(let u=0;u<$.length;u+=1)$[u].m(R,null);i(y,ae),i(y,A);for(let u=0;u<k.length;u+=1)k[u].m(A,null);B=!0},p(e,[t]){var ue,de;(!B||t&1)&&o!==(o=e[0].name+"")&&E(_,o),(!B||t&1)&&j!==(j=e[0].name+"")&&E(L,j);const u={};t&9&&(u.js=`
|
||||
<td>The auth record email address to send the verification request (if exists).</td></tr></tbody>`,X=v(),V=c("div"),V.textContent="Responses",Y=v(),y=c("div"),M=c("div");for(let e=0;e<$.length;e+=1)$[e].c();ae=v(),A=c("div");for(let e=0;e<k.length;e+=1)k[e].c();b(l,"class","m-b-sm"),b(u,"class","content txt-lg m-b-sm"),b(C,"class","m-b-xs"),b(D,"class","label label-primary"),b(H,"class","content"),b(g,"class","alert alert-success"),b(T,"class","section-title"),b(R,"class","table-compact table-border m-b-base"),b(V,"class","section-title"),b(M,"class","tabs-header compact left"),b(A,"class","tabs-content"),b(y,"class","tabs")},m(e,t){r(e,l,t),i(l,s),i(l,_),i(l,p),r(e,n,t),r(e,u,t),i(u,d),i(d,q),i(d,w),i(w,L),i(d,ee),r(e,N,t),he(P,e,t),r(e,Q,t),r(e,C,t),r(e,z,t),r(e,g,t),i(g,D),i(g,te),i(g,H),i(H,S),i(S,le),i(S,G),i(G,J),i(S,se),r(e,K,t),r(e,T,t),r(e,W,t),r(e,R,t),r(e,X,t),r(e,V,t),r(e,Y,t),r(e,y,t),i(y,M);for(let m=0;m<$.length;m+=1)$[m].m(M,null);i(y,ae),i(y,A);for(let m=0;m<k.length;m+=1)k[m].m(A,null);B=!0},p(e,[t]){var me,ue;(!B||t&1)&&o!==(o=e[0].name+"")&&F(_,o),(!B||t&1)&&j!==(j=e[0].name+"")&&F(L,j);const m={};t&9&&(m.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${e[3]}');
|
||||
|
||||
...
|
||||
|
||||
await pb.collection('${(ue=e[0])==null?void 0:ue.name}').requestVerification('test@example.com');
|
||||
`),t&9&&(u.dart=`
|
||||
await pb.collection('${(me=e[0])==null?void 0:me.name}').requestVerification('test@example.com');
|
||||
`),t&9&&(m.dart=`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final pb = PocketBase('${e[3]}');
|
||||
|
||||
...
|
||||
|
||||
await pb.collection('${(de=e[0])==null?void 0:de.name}').requestVerification('test@example.com');
|
||||
`),P.$set(u),(!B||t&1)&&I!==(I=e[0].name+"")&&E(J,I),t&6&&(O=e[2],$=me($,t,ne,1,e,O,oe,R,ge,_e,null,be)),t&6&&(U=e[2],ye(),k=me(k,t,ce,1,e,U,ie,A,Be,ke,null,pe),Ce())},i(e){if(!B){Z(P.$$.fragment,e);for(let t=0;t<U.length;t+=1)Z(k[t]);B=!0}},o(e){x(P.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);B=!1},d(e){e&&f(l),e&&f(n),e&&f(d),e&&f(N),$e(P,e),e&&f(Q),e&&f(C),e&&f(z),e&&f(g),e&&f(K),e&&f(T),e&&f(W),e&&f(M),e&&f(X),e&&f(V),e&&f(Y),e&&f(y);for(let t=0;t<$.length;t+=1)$[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function je(a,l,s){let o,{collection:_=new Se}=l,p=204,n=[];const d=m=>s(1,p=m.code);return a.$$set=m=>{"collection"in m&&s(0,_=m.collection)},s(3,o=Te.getApiExampleUrl(Me.baseUrl)),s(2,n=[{code:204,body:"null"},{code:400,body:`
|
||||
await pb.collection('${(ue=e[0])==null?void 0:ue.name}').requestVerification('test@example.com');
|
||||
`),P.$set(m),(!B||t&1)&&O!==(O=e[0].name+"")&&F(J,O),t&6&&(E=e[2],$=de($,t,ne,1,e,E,oe,M,ge,_e,null,be)),t&6&&(U=e[2],ye(),k=de(k,t,ce,1,e,U,ie,A,Be,ke,null,pe),Ce())},i(e){if(!B){Z(P.$$.fragment,e);for(let t=0;t<U.length;t+=1)Z(k[t]);B=!0}},o(e){x(P.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);B=!1},d(e){e&&f(l),e&&f(n),e&&f(u),e&&f(N),$e(P,e),e&&f(Q),e&&f(C),e&&f(z),e&&f(g),e&&f(K),e&&f(T),e&&f(W),e&&f(R),e&&f(X),e&&f(V),e&&f(Y),e&&f(y);for(let t=0;t<$.length;t+=1)$[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function je(a,l,s){let o,{collection:_=new Se}=l,p=204,n=[];const u=d=>s(1,p=d.code);return a.$$set=d=>{"collection"in d&&s(0,_=d.collection)},s(3,o=Te.getApiExampleUrl(Re.baseUrl)),s(2,n=[{code:204,body:"null"},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to authenticate.",
|
||||
@@ -47,4 +47,4 @@ import{S as qe,i as we,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as i
|
||||
}
|
||||
}
|
||||
}
|
||||
`}]),[_,p,n,o,d]}class Ie extends qe{constructor(l){super(),we(this,l,je,Ue,Pe,{collection:0})}}export{Ie as default};
|
||||
`}]),[_,p,n,o,u]}class Oe extends qe{constructor(l){super(),we(this,l,je,Ue,Pe,{collection:0})}}export{Oe as default};
|
||||
Vendored
+1
@@ -0,0 +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,O as C,P as J,k as O,Q,n as Y,t as N,a as P,o as w,w as E,r as S,u as z,x as R,N as A,c as G,m as H,d as L}from"./index-e4123b79.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 T(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(u,_){y(u,l,_),m(l,s),m(s,r),m(l,i),n||(k=z(l,"click",c),n=!0)},p(u,_){e=u,_&4&&g!==(g=e[6].title+"")&&R(r,g),_&6&&S(l,"active",e[1]===e[6].language)},d(u){u&&w(l),n=!1,k()}}}function I(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,u,_,p,f;return s=new A({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),G(s.$$.fragment),g=j(),r=v("div"),i=v("em"),n=v("a"),c=E(k),u=E(" SDK"),p=j(),h(n,"href",_=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),H(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,u),m(l,p),f=!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),(!f||t&4)&&k!==(k=e[6].title+"")&&R(c,k),(!f||t&4&&_!==(_=e[6].url))&&h(n,"href",_),(!f||t&6)&&S(l,"active",e[1]===e[6].language)},i(b){f||(N(s.$$.fragment,b),f=!0)},o(b){P(s.$$.fragment,b),f=!1},d(b){b&&w(l),L(s)}}}function U(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,u,_=o[2];const p=t=>t[6].language;for(let t=0;t<_.length;t+=1){let a=K(o,_,t),d=p(a);g.set(d,s[t]=T(d,a))}let f=o[2];const b=t=>t[6].language;for(let t=0;t<f.length;t+=1){let a=D(o,f,t),d=b(a);k.set(d,n[t]=I(d,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 d=0;d<s.length;d+=1)s[d].m(l,null);m(e,r),m(e,i);for(let d=0;d<n.length;d+=1)n[d].m(i,null);u=!0},p(t,[a]){a&6&&(_=t[2],s=C(s,a,p,1,t,_,g,l,J,T,null,K)),a&6&&(f=t[2],O(),n=C(n,a,b,1,t,f,k,i,Q,I,null,D),Y()),(!u||a&1&&c!==(c="tabs sdk-tabs "+t[0]+" svelte-1maocj6"))&&h(e,"class",c)},i(t){if(!u){for(let a=0;a<f.length;a+=1)N(n[a]);u=!0}},o(t){for(let a=0;a<n.length;a+=1)P(n[a]);u=!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 M="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(M)||"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(M,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};
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
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,O as J,k as O,P 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 Q}from"./index-9ce6aa95.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(u,_){y(u,l,_),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(u,_){e=u,_&4&&g!==(g=e[6].title+"")&&R(r,g),_&6&&S(l,"active",e[1]===e[6].language)},d(u){u&&w(l),n=!1,k()}}}function T(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,u,_,p,f;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),u=E(" SDK"),p=j(),h(n,"href",_=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,u),m(l,p),f=!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),(!f||t&4)&&k!==(k=e[6].title+"")&&R(c,k),(!f||t&4&&_!==(_=e[6].url))&&h(n,"href",_),(!f||t&6)&&S(l,"active",e[1]===e[6].language)},i(b){f||(N(s.$$.fragment,b),f=!0)},o(b){P(s.$$.fragment,b),f=!1},d(b){b&&w(l),Q(s)}}}function U(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,u,_=o[2];const p=t=>t[6].language;for(let t=0;t<_.length;t+=1){let a=K(o,_,t),d=p(a);g.set(d,s[t]=M(d,a))}let f=o[2];const b=t=>t[6].language;for(let t=0;t<f.length;t+=1){let a=D(o,f,t),d=b(a);k.set(d,n[t]=T(d,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 d=0;d<s.length;d+=1)s[d].m(l,null);m(e,r),m(e,i);for(let d=0;d<n.length;d+=1)n[d].m(i,null);u=!0},p(t,[a]){a&6&&(_=t[2],s=C(s,a,p,1,t,_,g,l,J,M,null,K)),a&6&&(f=t[2],O(),n=C(n,a,b,1,t,f,k,i,Y,T,null,D),z()),(!u||a&1&&c!==(c="tabs sdk-tabs "+t[0]+" svelte-1maocj6"))&&h(e,"class",c)},i(t){if(!u){for(let a=0;a<f.length;a+=1)N(n[a]);u=!0}},o(t){for(let a=0;a<n.length;a+=1)P(n[a]);u=!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};
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
import{S as qe,i as Me,s as Oe,e as i,w as v,b as h,c as Se,f,g as r,h as s,m as Be,x as j,N as ye,O as De,k as We,P as ze,n as He,t as le,a as oe,o as d,d as Ue,Q as Ie,C as Le,p as je,r as N,u as Ne,M as Re}from"./index-9ce6aa95.js";import{S as Ke}from"./SdkTabs-ccd8881b.js";function Ae(n,l,o){const a=n.slice();return a[5]=l[o],a}function Ce(n,l,o){const a=n.slice();return a[5]=l[o],a}function Te(n,l){let o,a=l[5].code+"",_,b,c,u;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=v(a),b=h(),f(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){r($,o,P),s(o,_),s(o,b),c||(u=Ne(o,"click",m),c=!0)},p($,P){l=$,P&4&&a!==(a=l[5].code+"")&&j(_,a),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&d(o),c=!1,u()}}}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(),f(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,u){r(c,o,u),Be(a,o,null),s(o,_),b=!0},p(c,u){l=c;const m={};u&4&&(m.content=l[5].body),a.$set(m),(!b||u&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&&d(o),Ue(a)}}}function Qe(n){var he,_e,ke,ve;let l,o,a=n[0].name+"",_,b,c,u,m,$,P,D=n[0].name+"",R,se,ae,K,Q,A,F,E,G,g,W,ne,z,y,ie,J,H=n[0].name+"",V,ce,X,re,Y,de,I,Z,S,x,B,ee,U,te,C,q,w=[],ue=new Map,pe,M,k=[],me=new Map,T;A=new Ke({props:{js:`
|
||||
import{S as qe,i as Oe,s as De,e as i,w as v,b as h,c as Se,f,g as r,h as s,m as Be,x as j,O as ye,P as Me,k as We,Q as ze,n as He,t as le,a as oe,o as d,d as Ue,R as Le,C as Re,p as je,r as I,u as Ie,N as Ne}from"./index-e4123b79.js";import{S as Ke}from"./SdkTabs-a1061d88.js";function Ae(n,l,o){const a=n.slice();return a[5]=l[o],a}function Ce(n,l,o){const a=n.slice();return a[5]=l[o],a}function Te(n,l){let o,a=l[5].code+"",_,b,c,u;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=v(a),b=h(),f(o,"class","tab-item"),I(o,"active",l[1]===l[5].code),this.first=o},m($,P){r($,o,P),s(o,_),s(o,b),c||(u=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&a!==(a=l[5].code+"")&&j(_,a),P&6&&I(o,"active",l[1]===l[5].code)},d($){$&&d(o),c=!1,u()}}}function Ee(n,l){let o,a,_,b;return a=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Se(a.$$.fragment),_=h(),f(o,"class","tab-item"),I(o,"active",l[1]===l[5].code),this.first=o},m(c,u){r(c,o,u),Be(a,o,null),s(o,_),b=!0},p(c,u){l=c;const m={};u&4&&(m.content=l[5].body),a.$set(m),(!b||u&6)&&I(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&&d(o),Ue(a)}}}function Qe(n){var he,_e,ke,ve;let l,o,a=n[0].name+"",_,b,c,u,m,$,P,M=n[0].name+"",N,se,ae,K,Q,A,F,E,G,g,W,ne,z,y,ie,J,H=n[0].name+"",V,ce,X,re,Y,de,L,Z,S,x,B,ee,U,te,C,q,w=[],ue=new Map,pe,O,k=[],me=new Map,T;A=new Ke({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${n[3]}');
|
||||
@@ -24,7 +24,7 @@ import{S as qe,i as Me,s as Oe,e as i,w as v,b as h,c as Se,f,g as r,h as s,m as
|
||||
pb.authStore.model.id,
|
||||
'google',
|
||||
);
|
||||
`}});let L=n[2];const fe=e=>e[5].code;for(let e=0;e<L.length;e+=1){let t=Ce(n,L,e),p=fe(t);ue.set(p,w[e]=Te(p,t))}let O=n[2];const be=e=>e[5].code;for(let e=0;e<O.length;e+=1){let t=Ae(n,O,e),p=be(t);me.set(p,k[e]=Ee(p,t))}return{c(){l=i("h3"),o=v("Unlink OAuth2 account ("),_=v(a),b=v(")"),c=h(),u=i("div"),m=i("p"),$=v("Unlink a single external OAuth2 provider from "),P=i("strong"),R=v(D),se=v(" record."),ae=h(),K=i("p"),K.textContent="Only admins and the account owner can access this action.",Q=h(),Se(A.$$.fragment),F=h(),E=i("h6"),E.textContent="API details",G=h(),g=i("div"),W=i("strong"),W.textContent="DELETE",ne=h(),z=i("div"),y=i("p"),ie=v("/api/collections/"),J=i("strong"),V=v(H),ce=v("/records/"),X=i("strong"),X.textContent=":id",re=v("/external-auths/"),Y=i("strong"),Y.textContent=":provider",de=h(),I=i("p"),I.innerHTML="Requires <code>Authorization:TOKEN</code> header",Z=h(),S=i("div"),S.textContent="Path Parameters",x=h(),B=i("table"),B.innerHTML=`<thead><tr><th>Param</th>
|
||||
`}});let R=n[2];const fe=e=>e[5].code;for(let e=0;e<R.length;e+=1){let t=Ce(n,R,e),p=fe(t);ue.set(p,w[e]=Te(p,t))}let D=n[2];const be=e=>e[5].code;for(let e=0;e<D.length;e+=1){let t=Ae(n,D,e),p=be(t);me.set(p,k[e]=Ee(p,t))}return{c(){l=i("h3"),o=v("Unlink OAuth2 account ("),_=v(a),b=v(")"),c=h(),u=i("div"),m=i("p"),$=v("Unlink a single external OAuth2 provider from "),P=i("strong"),N=v(M),se=v(" record."),ae=h(),K=i("p"),K.textContent="Only admins and the account owner can access this action.",Q=h(),Se(A.$$.fragment),F=h(),E=i("h6"),E.textContent="API details",G=h(),g=i("div"),W=i("strong"),W.textContent="DELETE",ne=h(),z=i("div"),y=i("p"),ie=v("/api/collections/"),J=i("strong"),V=v(H),ce=v("/records/"),X=i("strong"),X.textContent=":id",re=v("/external-auths/"),Y=i("strong"),Y.textContent=":provider",de=h(),L=i("p"),L.innerHTML="Requires <code>Authorization:TOKEN</code> header",Z=h(),S=i("div"),S.textContent="Path Parameters",x=h(),B=i("table"),B.innerHTML=`<thead><tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr></thead>
|
||||
<tbody><tr><td>id</td>
|
||||
@@ -33,7 +33,7 @@ import{S as qe,i as Me,s as Oe,e as i,w as v,b as h,c as Se,f,g as r,h as s,m as
|
||||
<tr><td>provider</td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>The name of the auth provider to unlink, eg. <code>google</code>, <code>twitter</code>,
|
||||
<code>github</code>, etc.</td></tr></tbody>`,ee=h(),U=i("div"),U.textContent="Responses",te=h(),C=i("div"),q=i("div");for(let e=0;e<w.length;e+=1)w[e].c();pe=h(),M=i("div");for(let e=0;e<k.length;e+=1)k[e].c();f(l,"class","m-b-sm"),f(u,"class","content txt-lg m-b-sm"),f(E,"class","m-b-xs"),f(W,"class","label label-primary"),f(z,"class","content"),f(I,"class","txt-hint txt-sm txt-right"),f(g,"class","alert alert-danger"),f(S,"class","section-title"),f(B,"class","table-compact table-border m-b-base"),f(U,"class","section-title"),f(q,"class","tabs-header compact left"),f(M,"class","tabs-content"),f(C,"class","tabs")},m(e,t){r(e,l,t),s(l,o),s(l,_),s(l,b),r(e,c,t),r(e,u,t),s(u,m),s(m,$),s(m,P),s(P,R),s(m,se),s(u,ae),s(u,K),r(e,Q,t),Be(A,e,t),r(e,F,t),r(e,E,t),r(e,G,t),r(e,g,t),s(g,W),s(g,ne),s(g,z),s(z,y),s(y,ie),s(y,J),s(J,V),s(y,ce),s(y,X),s(y,re),s(y,Y),s(g,de),s(g,I),r(e,Z,t),r(e,S,t),r(e,x,t),r(e,B,t),r(e,ee,t),r(e,U,t),r(e,te,t),r(e,C,t),s(C,q);for(let p=0;p<w.length;p+=1)w[p].m(q,null);s(C,pe),s(C,M);for(let p=0;p<k.length;p+=1)k[p].m(M,null);T=!0},p(e,[t]){var ge,we,$e,Pe;(!T||t&1)&&a!==(a=e[0].name+"")&&j(_,a),(!T||t&1)&&D!==(D=e[0].name+"")&&j(R,D);const p={};t&9&&(p.js=`
|
||||
<code>github</code>, etc.</td></tr></tbody>`,ee=h(),U=i("div"),U.textContent="Responses",te=h(),C=i("div"),q=i("div");for(let e=0;e<w.length;e+=1)w[e].c();pe=h(),O=i("div");for(let e=0;e<k.length;e+=1)k[e].c();f(l,"class","m-b-sm"),f(u,"class","content txt-lg m-b-sm"),f(E,"class","m-b-xs"),f(W,"class","label label-primary"),f(z,"class","content"),f(L,"class","txt-hint txt-sm txt-right"),f(g,"class","alert alert-danger"),f(S,"class","section-title"),f(B,"class","table-compact table-border m-b-base"),f(U,"class","section-title"),f(q,"class","tabs-header compact left"),f(O,"class","tabs-content"),f(C,"class","tabs")},m(e,t){r(e,l,t),s(l,o),s(l,_),s(l,b),r(e,c,t),r(e,u,t),s(u,m),s(m,$),s(m,P),s(P,N),s(m,se),s(u,ae),s(u,K),r(e,Q,t),Be(A,e,t),r(e,F,t),r(e,E,t),r(e,G,t),r(e,g,t),s(g,W),s(g,ne),s(g,z),s(z,y),s(y,ie),s(y,J),s(J,V),s(y,ce),s(y,X),s(y,re),s(y,Y),s(g,de),s(g,L),r(e,Z,t),r(e,S,t),r(e,x,t),r(e,B,t),r(e,ee,t),r(e,U,t),r(e,te,t),r(e,C,t),s(C,q);for(let p=0;p<w.length;p+=1)w[p].m(q,null);s(C,pe),s(C,O);for(let p=0;p<k.length;p+=1)k[p].m(O,null);T=!0},p(e,[t]){var ge,we,$e,Pe;(!T||t&1)&&a!==(a=e[0].name+"")&&j(_,a),(!T||t&1)&&M!==(M=e[0].name+"")&&j(N,M);const p={};t&9&&(p.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${e[3]}');
|
||||
@@ -59,7 +59,7 @@ import{S as qe,i as Me,s as Oe,e as i,w as v,b as h,c as Se,f,g as r,h as s,m as
|
||||
pb.authStore.model.id,
|
||||
'google',
|
||||
);
|
||||
`),A.$set(p),(!T||t&1)&&H!==(H=e[0].name+"")&&j(V,H),t&6&&(L=e[2],w=ye(w,t,fe,1,e,L,ue,q,De,Te,null,Ce)),t&6&&(O=e[2],We(),k=ye(k,t,be,1,e,O,me,M,ze,Ee,null,Ae),He())},i(e){if(!T){le(A.$$.fragment,e);for(let t=0;t<O.length;t+=1)le(k[t]);T=!0}},o(e){oe(A.$$.fragment,e);for(let t=0;t<k.length;t+=1)oe(k[t]);T=!1},d(e){e&&d(l),e&&d(c),e&&d(u),e&&d(Q),Ue(A,e),e&&d(F),e&&d(E),e&&d(G),e&&d(g),e&&d(Z),e&&d(S),e&&d(x),e&&d(B),e&&d(ee),e&&d(U),e&&d(te),e&&d(C);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 Fe(n,l,o){let a,{collection:_=new Ie}=l,b=204,c=[];const u=m=>o(1,b=m.code);return n.$$set=m=>{"collection"in m&&o(0,_=m.collection)},o(3,a=Le.getApiExampleUrl(je.baseUrl)),o(2,c=[{code:204,body:"null"},{code:401,body:`
|
||||
`),A.$set(p),(!T||t&1)&&H!==(H=e[0].name+"")&&j(V,H),t&6&&(R=e[2],w=ye(w,t,fe,1,e,R,ue,q,Me,Te,null,Ce)),t&6&&(D=e[2],We(),k=ye(k,t,be,1,e,D,me,O,ze,Ee,null,Ae),He())},i(e){if(!T){le(A.$$.fragment,e);for(let t=0;t<D.length;t+=1)le(k[t]);T=!0}},o(e){oe(A.$$.fragment,e);for(let t=0;t<k.length;t+=1)oe(k[t]);T=!1},d(e){e&&d(l),e&&d(c),e&&d(u),e&&d(Q),Ue(A,e),e&&d(F),e&&d(E),e&&d(G),e&&d(g),e&&d(Z),e&&d(S),e&&d(x),e&&d(B),e&&d(ee),e&&d(U),e&&d(te),e&&d(C);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 Fe(n,l,o){let a,{collection:_=new Le}=l,b=204,c=[];const u=m=>o(1,b=m.code);return n.$$set=m=>{"collection"in m&&o(0,_=m.collection)},o(3,a=Re.getApiExampleUrl(je.baseUrl)),o(2,c=[{code:204,body:"null"},{code:401,body:`
|
||||
{
|
||||
"code": 401,
|
||||
"message": "The request requires valid record authorization token to be set.",
|
||||
@@ -77,4 +77,4 @@ import{S as qe,i as Me,s as Oe,e as i,w as v,b as h,c as Se,f,g as r,h as s,m as
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`}]),[_,b,c,a,u]}class Ve extends qe{constructor(l){super(),Me(this,l,Fe,Qe,Oe,{collection:0})}}export{Ve as default};
|
||||
`}]),[_,b,c,a,u]}class Ve extends qe{constructor(l){super(),Oe(this,l,Fe,Qe,De,{collection:0})}}export{Ve as default};
|
||||
+15
-15
@@ -1,4 +1,4 @@
|
||||
import{S as Ct,i as St,s as Ot,C as I,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 U,N as Pe,O as ut,k as Mt,P as $t,n as qt,t as pe,a as fe,o,d as Fe,Q as Dt,p as Ht,r as ce,u as Rt,y as G}from"./index-9ce6aa95.js";import{S as Lt}from"./SdkTabs-ccd8881b.js";function bt(p,t,l){const s=p.slice();return s[7]=t[l],s}function mt(p,t,l){const s=p.slice();return s[7]=t[l],s}function _t(p,t,l){const s=p.slice();return s[12]=t[l],s}function yt(p){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(p){let t,l,s,b,u,d,f,k,C,v,O,H,A,F,M,N,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>
|
||||
import{S as Ct,i as St,s as Ot,C as U,N 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,O as Pe,P as ut,k as Mt,Q as $t,n as Rt,t as pe,a as fe,o,d as Fe,R as qt,p as Dt,r as ce,u as Ht,y as G}from"./index-e4123b79.js";import{S as Lt}from"./SdkTabs-a1061d88.js";function bt(p,t,l){const s=p.slice();return s[7]=t[l],s}function mt(p,t,l){const s=p.slice();return s[7]=t[l],s}function _t(p,t,l){const s=p.slice();return s[12]=t[l],s}function yt(p){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(p){let t,l,s,b,u,d,f,k,C,v,O,D,A,F,M,N,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>
|
||||
@@ -20,7 +20,7 @@ import{S as Ct,i as St,s as Ot,C as I,M as Tt,e as r,w as y,b as m,c as Ae,f as
|
||||
"Manage" access can skip this field.</td>`,v=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>`,H=m(),A=r("tr"),A.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
|
||||
<td>New auth record password.</td>`,D=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>`,F=m(),M=r("tr"),M.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
|
||||
@@ -28,8 +28,8 @@ import{S as Ct,i as St,s as Ot,C as I,M as Tt,e as r,w as y,b as m,c as Ae,f as
|
||||
<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 "Manage" access.</td>`,N=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,f,_),a(c,k,_),a(c,C,_),a(c,v,_),a(c,O,_),a(c,H,_),a(c,A,_),a(c,F,_),a(c,M,_),a(c,N,_),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(f),c&&o(k),c&&o(C),c&&o(v),c&&o(O),c&&o(H),c&&o(A),c&&o(F),c&&o(M),c&&o(N),c&&o(B)}}}function Pt(p){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(p){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(p){var u;let t,l=((u=p[12].options)==null?void 0:u.maxSelect)>1?"ids":"id",s,b;return{c(){t=y("User "),s=y(l),b=y(".")},m(d,f){a(d,t,f),a(d,s,f),a(d,b,f)},p(d,f){var k;f&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 Ft(p){var u;let t,l=((u=p[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,f){a(d,t,f),a(d,s,f),a(d,b,f)},p(d,f){var k;f&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 Nt(p){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,f){a(d,t,f),a(d,l,f),a(d,s,f),a(d,b,f),a(d,u,f)},p:G,d(d){d&&o(t),d&&o(l),d&&o(s),d&&o(b),d&&o(u)}}}function jt(p){let t;return{c(){t=y("URL address.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function Et(p){let t;return{c(){t=y("Email address.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function It(p){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 Ut(p){let t;return{c(){t=y("Number value.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function Jt(p){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(p,t){let l,s,b,u,d,f=t[12].name+"",k,C,v,O,H=I.getFieldValueType(t[12])+"",A,F,M,N;function B(h,L){return h[12].required?At:Pt}let c=B(t),_=c(t);function K(h,L){if(h[12].type==="text")return Jt;if(h[12].type==="number")return Ut;if(h[12].type==="json")return It;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 R=K(t),S=R&&R(t);return{key:p,first:null,c(){l=r("tr"),s=r("td"),b=r("div"),_.c(),u=m(),d=r("span"),k=y(f),C=m(),v=r("td"),O=r("span"),A=y(H),F=m(),M=r("td"),S&&S.c(),N=m(),T(b,"class","inline-flex"),T(O,"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,v),i(v,O),i(O,A),i(l,F),i(l,M),S&&S.m(M,null),i(l,N)},p(h,L){t=h,c!==(c=B(t))&&(_.d(1),_=c(t),_&&(_.c(),_.m(b,u))),L&1&&f!==(f=t[12].name+"")&&U(k,f),L&1&&H!==(H=I.getFieldValueType(t[12])+"")&&U(A,H),R===(R=K(t))&&S?S.p(t,L):(S&&S.d(1),S=R&&R(t),S&&(S.c(),S.m(M,null)))},d(h){h&&o(l),_.d(),S&&S.d()}}}function vt(p,t){let l,s=t[7].code+"",b,u,d,f;function k(){return t[6](t[7])}return{key:p,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,v){a(C,l,v),i(l,b),i(l,u),d||(f=Rt(l,"click",k),d=!0)},p(C,v){t=C,v&4&&s!==(s=t[7].code+"")&&U(b,s),v&6&&ce(l,"active",t[1]===t[7].code)},d(C){C&&o(l),d=!1,f()}}}function wt(p,t){let l,s,b,u;return s=new Tt({props:{content:t[7].body}}),{key:p,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,f){a(d,l,f),Be(s,l,null),i(l,b),u=!0},p(d,f){t=d;const k={};f&4&&(k.content=t[7].body),s.$set(k),(!u||f&6)&&ce(l,"active",t[1]===t[7].code)},i(d){u||(pe(s.$$.fragment,d),u=!0)},o(d){fe(s.$$.fragment,d),u=!1},d(d){d&&o(l),Fe(s)}}}function gt(p){var it,at,ot,dt;let t,l,s=p[0].name+"",b,u,d,f,k,C,v,O=p[0].name+"",H,A,F,M,N,B,c,_,K,R,S,h,L,Ne,ae,W,je,ue,oe=p[0].name+"",be,Ee,me,Ie,_e,X,ye,Z,ke,ee,he,J,ve,Ue,g,we,j=[],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,E=[],Ze=new Map,et,ne,P=[],tt=new Map,z;_=new Lt({props:{js:`
|
||||
This field can be set only by admins or auth records with "Manage" access.</td>`,N=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,f,_),a(c,k,_),a(c,C,_),a(c,v,_),a(c,O,_),a(c,D,_),a(c,A,_),a(c,F,_),a(c,M,_),a(c,N,_),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(f),c&&o(k),c&&o(C),c&&o(v),c&&o(O),c&&o(D),c&&o(A),c&&o(F),c&&o(M),c&&o(N),c&&o(B)}}}function Pt(p){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(p){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(p){var u;let t,l=((u=p[12].options)==null?void 0:u.maxSelect)>1?"ids":"id",s,b;return{c(){t=y("User "),s=y(l),b=y(".")},m(d,f){a(d,t,f),a(d,s,f),a(d,b,f)},p(d,f){var k;f&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(p){var u;let t,l=((u=p[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,f){a(d,t,f),a(d,s,f),a(d,b,f)},p(d,f){var k;f&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(p){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,f){a(d,t,f),a(d,l,f),a(d,s,f),a(d,b,f),a(d,u,f)},p:G,d(d){d&&o(t),d&&o(l),d&&o(s),d&&o(b),d&&o(u)}}}function jt(p){let t;return{c(){t=y("URL address.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function Et(p){let t;return{c(){t=y("Email address.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function Ut(p){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(p){let t;return{c(){t=y("Number value.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function Jt(p){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(p,t){let l,s,b,u,d,f=t[12].name+"",k,C,v,O,D=U.getFieldValueType(t[12])+"",A,F,M,N;function B(h,L){return h[12].required?At:Pt}let c=B(t),_=c(t);function K(h,L){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 H=K(t),S=H&&H(t);return{key:p,first:null,c(){l=r("tr"),s=r("td"),b=r("div"),_.c(),u=m(),d=r("span"),k=y(f),C=m(),v=r("td"),O=r("span"),A=y(D),F=m(),M=r("td"),S&&S.c(),N=m(),T(b,"class","inline-flex"),T(O,"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,v),i(v,O),i(O,A),i(l,F),i(l,M),S&&S.m(M,null),i(l,N)},p(h,L){t=h,c!==(c=B(t))&&(_.d(1),_=c(t),_&&(_.c(),_.m(b,u))),L&1&&f!==(f=t[12].name+"")&&I(k,f),L&1&&D!==(D=U.getFieldValueType(t[12])+"")&&I(A,D),H===(H=K(t))&&S?S.p(t,L):(S&&S.d(1),S=H&&H(t),S&&(S.c(),S.m(M,null)))},d(h){h&&o(l),_.d(),S&&S.d()}}}function vt(p,t){let l,s=t[7].code+"",b,u,d,f;function k(){return t[6](t[7])}return{key:p,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,v){a(C,l,v),i(l,b),i(l,u),d||(f=Ht(l,"click",k),d=!0)},p(C,v){t=C,v&4&&s!==(s=t[7].code+"")&&I(b,s),v&6&&ce(l,"active",t[1]===t[7].code)},d(C){C&&o(l),d=!1,f()}}}function wt(p,t){let l,s,b,u;return s=new Tt({props:{content:t[7].body}}),{key:p,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,f){a(d,l,f),Be(s,l,null),i(l,b),u=!0},p(d,f){t=d;const k={};f&4&&(k.content=t[7].body),s.$set(k),(!u||f&6)&&ce(l,"active",t[1]===t[7].code)},i(d){u||(pe(s.$$.fragment,d),u=!0)},o(d){fe(s.$$.fragment,d),u=!1},d(d){d&&o(l),Fe(s)}}}function gt(p){var it,at,ot,dt;let t,l,s=p[0].name+"",b,u,d,f,k,C,v,O=p[0].name+"",D,A,F,M,N,B,c,_,K,H,S,h,L,Ne,ae,W,je,ue,oe=p[0].name+"",be,Ee,me,Ue,_e,X,ye,Z,ke,ee,he,J,ve,Ie,g,we,j=[],Je=new Map,Te,te,Ce,V,Se,ge,Oe,x,Me,Ve,$e,xe,$,Qe,Y,ze,Ke,We,Re,Ye,qe,Ge,De,Xe,He,le,Le,Q,se,E=[],Ze=new Map,et,ne,P=[],tt=new Map,z;_=new Lt({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${p[4]}');
|
||||
@@ -37,7 +37,7 @@ const pb = new PocketBase('${p[4]}');
|
||||
...
|
||||
|
||||
// example update data
|
||||
const data = ${JSON.stringify(Object.assign({},p[3],I.dummyCollectionSchemaData(p[0])),null,4)};
|
||||
const data = ${JSON.stringify(Object.assign({},p[3],U.dummyCollectionSchemaData(p[0])),null,4)};
|
||||
|
||||
const record = await pb.collection('${(it=p[0])==null?void 0:it.name}').update('RECORD_ID', data);
|
||||
`,dart:`
|
||||
@@ -48,29 +48,29 @@ final pb = PocketBase('${p[4]}');
|
||||
...
|
||||
|
||||
// example update body
|
||||
final body = <String, dynamic>${JSON.stringify(Object.assign({},p[3],I.dummyCollectionSchemaData(p[0])),null,2)};
|
||||
final body = <String, dynamic>${JSON.stringify(Object.assign({},p[3],U.dummyCollectionSchemaData(p[0])),null,2)};
|
||||
|
||||
final record = await pb.collection('${(at=p[0])==null?void 0:at.name}').update('RECORD_ID', body: body);
|
||||
`}});let q=p[5]&&yt(),D=((ot=p[0])==null?void 0:ot.isAuth)&&kt(),de=(dt=p[0])==null?void 0:dt.schema;const lt=e=>e[12].name;for(let e=0;e<de.length;e+=1){let n=_t(p,de,e),w=lt(n);Je.set(w,j[e]=ht(w,n))}Y=new Tt({props:{content:"?expand=relField1,relField2.subRelField21"}});let re=p[2];const st=e=>e[7].code;for(let e=0;e<re.length;e+=1){let n=mt(p,re,e),w=st(n);Ze.set(w,E[e]=vt(w,n))}let ie=p[2];const nt=e=>e[7].code;for(let e=0;e<ie.length;e+=1){let n=bt(p,ie,e),w=nt(n);tt.set(w,P[e]=wt(w,n))}return{c(){t=r("h3"),l=y("Update ("),b=y(s),u=y(")"),d=m(),f=r("div"),k=r("p"),C=y("Update a single "),v=r("strong"),H=y(O),A=y(" record."),F=m(),M=r("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||||
`}});let R=p[5]&&yt(),q=((ot=p[0])==null?void 0:ot.isAuth)&&kt(),de=(dt=p[0])==null?void 0:dt.schema;const lt=e=>e[12].name;for(let e=0;e<de.length;e+=1){let n=_t(p,de,e),w=lt(n);Je.set(w,j[e]=ht(w,n))}Y=new Tt({props:{content:"?expand=relField1,relField2.subRelField21"}});let re=p[2];const st=e=>e[7].code;for(let e=0;e<re.length;e+=1){let n=mt(p,re,e),w=st(n);Ze.set(w,E[e]=vt(w,n))}let ie=p[2];const nt=e=>e[7].code;for(let e=0;e<ie.length;e+=1){let n=bt(p,ie,e),w=nt(n);tt.set(w,P[e]=wt(w,n))}return{c(){t=r("h3"),l=y("Update ("),b=y(s),u=y(")"),d=m(),f=r("div"),k=r("p"),C=y("Update a single "),v=r("strong"),D=y(O),A=y(" record."),F=m(),M=r("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||||
<code>multipart/form-data</code>.`,N=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(),R=r("h6"),R.textContent="API details",S=m(),h=r("div"),L=r("strong"),L.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",Ie=m(),q&&q.c(),_e=m(),X=r("div"),X.textContent="Path parameters",ye=m(),Z=r("table"),Z.innerHTML=`<thead><tr><th>Param</th>
|
||||
</a>.`,c=m(),Ae(_.$$.fragment),K=m(),H=r("h6"),H.textContent="API details",S=m(),h=r("div"),L=r("strong"),L.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(),R&&R.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>`,Ue=m(),g=r("tbody"),D&&D.c(),we=m();for(let e=0;e<j.length;e+=1)j[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 width="50%">Description</th></tr>`,Ie=m(),g=r("tbody"),q&&q.c(),we=m();for(let e=0;e<j.length;e+=1)j[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<E.length;e+=1)E[e].c();et=m(),ne=r("div");for(let e=0;e<P.length;e+=1)P[e].c();T(t,"class","m-b-sm"),T(f,"class","content txt-lg m-b-sm"),T(R,"class","m-b-xs"),T(L,"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,f,n),i(f,k),i(k,C),i(k,v),i(v,H),i(k,A),i(f,F),i(f,M),i(f,N),i(f,B),a(e,c,n),Be(_,e,n),a(e,K,n),a(e,R,n),a(e,S,n),a(e,h,n),i(h,L),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,Ie),q&&q.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,Ue),i(J,g),D&&D.m(g,null),i(g,we);for(let w=0;w<j.length;w+=1)j[w].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 w=0;w<E.length;w+=1)E[w].m(se,null);i(Q,et),i(Q,ne);for(let w=0;w<P.length;w+=1)P[w].m(ne,null);z=!0},p(e,[n]){var rt,pt,ft,ct;(!z||n&1)&&s!==(s=e[0].name+"")&&U(b,s),(!z||n&1)&&O!==(O=e[0].name+"")&&U(H,O);const w={};n&25&&(w.js=`
|
||||
`),Re=r("code"),Re.textContent="expand",Ye=y(" property (eg. "),qe=r("code"),qe.textContent='"expand": {"relField1": {...}, ...}',Ge=y(`). Only
|
||||
the relations that the user has permissions to `),De=r("strong"),De.textContent="view",Xe=y(" will be expanded."),He=m(),le=r("div"),le.textContent="Responses",Le=m(),Q=r("div"),se=r("div");for(let e=0;e<E.length;e+=1)E[e].c();et=m(),ne=r("div");for(let e=0;e<P.length;e+=1)P[e].c();T(t,"class","m-b-sm"),T(f,"class","content txt-lg m-b-sm"),T(H,"class","m-b-xs"),T(L,"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,f,n),i(f,k),i(k,C),i(k,v),i(v,D),i(k,A),i(f,F),i(f,M),i(f,N),i(f,B),a(e,c,n),Be(_,e,n),a(e,K,n),a(e,H,n),a(e,S,n),a(e,h,n),i(h,L),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),R&&R.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),q&&q.m(g,null),i(g,we);for(let w=0;w<j.length;w+=1)j[w].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($,Re),i($,Ye),i($,qe),i($,Ge),i($,De),i($,Xe),a(e,He,n),a(e,le,n),a(e,Le,n),a(e,Q,n),i(Q,se);for(let w=0;w<E.length;w+=1)E[w].m(se,null);i(Q,et),i(Q,ne);for(let w=0;w<P.length;w+=1)P[w].m(ne,null);z=!0},p(e,[n]){var rt,pt,ft,ct;(!z||n&1)&&s!==(s=e[0].name+"")&&I(b,s),(!z||n&1)&&O!==(O=e[0].name+"")&&I(D,O);const w={};n&25&&(w.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${e[4]}');
|
||||
@@ -78,7 +78,7 @@ const pb = new PocketBase('${e[4]}');
|
||||
...
|
||||
|
||||
// example update data
|
||||
const data = ${JSON.stringify(Object.assign({},e[3],I.dummyCollectionSchemaData(e[0])),null,4)};
|
||||
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&&(w.dart=`
|
||||
@@ -89,10 +89,10 @@ final pb = PocketBase('${e[4]}');
|
||||
...
|
||||
|
||||
// example update body
|
||||
final body = <String, dynamic>${JSON.stringify(Object.assign({},e[3],I.dummyCollectionSchemaData(e[0])),null,2)};
|
||||
final body = <String, dynamic>${JSON.stringify(Object.assign({},e[3],U.dummyCollectionSchemaData(e[0])),null,2)};
|
||||
|
||||
final record = await pb.collection('${(pt=e[0])==null?void 0:pt.name}').update('RECORD_ID', body: body);
|
||||
`),_.$set(w),(!z||n&1)&&oe!==(oe=e[0].name+"")&&U(be,oe),e[5]?q||(q=yt(),q.c(),q.m(h,null)):q&&(q.d(1),q=null),(ft=e[0])!=null&&ft.isAuth?D||(D=kt(),D.c(),D.m(g,we)):D&&(D.d(1),D=null),n&1&&(de=(ct=e[0])==null?void 0:ct.schema,j=Pe(j,n,lt,1,e,de,Je,g,ut,ht,null,_t)),n&6&&(re=e[2],E=Pe(E,n,st,1,e,re,Ze,se,ut,vt,null,mt)),n&6&&(ie=e[2],Mt(),P=Pe(P,n,nt,1,e,ie,tt,ne,$t,wt,null,bt),qt())},i(e){if(!z){pe(_.$$.fragment,e),pe(Y.$$.fragment,e);for(let n=0;n<ie.length;n+=1)pe(P[n]);z=!0}},o(e){fe(_.$$.fragment,e),fe(Y.$$.fragment,e);for(let n=0;n<P.length;n+=1)fe(P[n]);z=!1},d(e){e&&o(t),e&&o(d),e&&o(f),e&&o(c),Fe(_,e),e&&o(K),e&&o(R),e&&o(S),e&&o(h),q&&q.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),D&&D.d();for(let n=0;n<j.length;n+=1)j[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<E.length;n+=1)E[n].d();for(let n=0;n<P.length;n+=1)P[n].d()}}}function Vt(p,t,l){let s,b,{collection:u=new Dt}=t,d=200,f=[],k={};const C=v=>l(1,d=v.code);return p.$$set=v=>{"collection"in v&&l(0,u=v.collection)},p.$$.update=()=>{var v,O;p.$$.dirty&1&&l(5,s=(u==null?void 0:u.updateRule)===null),p.$$.dirty&1&&l(2,f=[{code:200,body:JSON.stringify(I.dummyCollectionRecord(u),null,2)},{code:400,body:`
|
||||
`),_.$set(w),(!z||n&1)&&oe!==(oe=e[0].name+"")&&I(be,oe),e[5]?R||(R=yt(),R.c(),R.m(h,null)):R&&(R.d(1),R=null),(ft=e[0])!=null&&ft.isAuth?q||(q=kt(),q.c(),q.m(g,we)):q&&(q.d(1),q=null),n&1&&(de=(ct=e[0])==null?void 0:ct.schema,j=Pe(j,n,lt,1,e,de,Je,g,ut,ht,null,_t)),n&6&&(re=e[2],E=Pe(E,n,st,1,e,re,Ze,se,ut,vt,null,mt)),n&6&&(ie=e[2],Mt(),P=Pe(P,n,nt,1,e,ie,tt,ne,$t,wt,null,bt),Rt())},i(e){if(!z){pe(_.$$.fragment,e),pe(Y.$$.fragment,e);for(let n=0;n<ie.length;n+=1)pe(P[n]);z=!0}},o(e){fe(_.$$.fragment,e),fe(Y.$$.fragment,e);for(let n=0;n<P.length;n+=1)fe(P[n]);z=!1},d(e){e&&o(t),e&&o(d),e&&o(f),e&&o(c),Fe(_,e),e&&o(K),e&&o(H),e&&o(S),e&&o(h),R&&R.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),q&&q.d();for(let n=0;n<j.length;n+=1)j[n].d();e&&o(Te),e&&o(te),e&&o(Ce),e&&o(V),Fe(Y),e&&o(He),e&&o(le),e&&o(Le),e&&o(Q);for(let n=0;n<E.length;n+=1)E[n].d();for(let n=0;n<P.length;n+=1)P[n].d()}}}function Vt(p,t,l){let s,b,{collection:u=new qt}=t,d=200,f=[],k={};const C=v=>l(1,d=v.code);return p.$$set=v=>{"collection"in v&&l(0,u=v.collection)},p.$$.update=()=>{var v,O;p.$$.dirty&1&&l(5,s=(u==null?void 0:u.updateRule)===null),p.$$.dirty&1&&l(2,f=[{code:200,body:JSON.stringify(U.dummyCollectionRecord(u),null,2)},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to update record.",
|
||||
@@ -115,4 +115,4 @@ final record = await pb.collection('${(pt=e[0])==null?void 0:pt.name}').update('
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`}]),p.$$.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=I.getApiExampleUrl(Ht.baseUrl)),[u,d,f,k,b,s,C]}class zt extends Ct{constructor(t){super(),St(this,t,Vt,gt,Ot,{collection:0})}}export{zt as default};
|
||||
`}]),p.$$.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(Dt.baseUrl)),[u,d,f,k,b,s,C]}class zt extends Ct{constructor(t){super(),St(this,t,Vt,gt,Ot,{collection:0})}}export{zt as default};
|
||||
+7
-7
@@ -1,4 +1,4 @@
|
||||
import{S as Ze,i as et,s as tt,M as Ye,e as o,w as m,b as f,c as _e,f as _,g as r,h as l,m as ke,x as me,N as Ve,O as lt,k as st,P as nt,n as ot,t as z,a as G,o as d,d as he,Q as it,C as ze,p as at,r as J,u as rt}from"./index-9ce6aa95.js";import{S as dt}from"./SdkTabs-ccd8881b.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+"",w,c,p,u;function C(){return s[5](s[6])}return{key:i,first:null,c(){n=o("button"),w=m(a),c=f(),_(n,"class","tab-item"),J(n,"active",s[2]===s[6].code),this.first=n},m(h,R){r(h,n,R),l(n,w),l(n,c),p||(u=rt(n,"click",C),p=!0)},p(h,R){s=h,R&20&&J(n,"active",s[2]===s[6].code)},d(h){h&&d(n),p=!1,u()}}}function Xe(i,s){let n,a,w,c;return a=new Ye({props:{content:s[6].body}}),{key:i,first:null,c(){n=o("div"),_e(a.$$.fragment),w=f(),_(n,"class","tab-item"),J(n,"active",s[2]===s[6].code),this.first=n},m(p,u){r(p,n,u),ke(a,n,null),l(n,w),c=!0},p(p,u){s=p,(!c||u&20)&&J(n,"active",s[2]===s[6].code)},i(p){c||(z(a.$$.fragment,p),c=!0)},o(p){G(a.$$.fragment,p),c=!1},d(p){p&&d(n),he(a)}}}function ct(i){var Ne,Ue;let s,n,a=i[0].name+"",w,c,p,u,C,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,I,se,M,ne,x,oe,O,ie,Fe,ae,D,re,Re,de,ge,k,Oe,S,De,Pe,Te,ce,Ee,pe,Se,Be,Ie,fe,Me,ue,A,be,P,H,F=[],xe=new Map,Ae,q,y=[],He=new Map,T;g=new dt({props:{js:`
|
||||
import{S as Ze,i as et,s as tt,N as Ye,e as o,w as m,b as f,c as _e,f as _,g as r,h as l,m as ke,x as me,O 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,R as it,C as ze,p as at,r as J,u as rt}from"./index-e4123b79.js";import{S as dt}from"./SdkTabs-a1061d88.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+"",w,c,p,u;function C(){return s[5](s[6])}return{key:i,first:null,c(){n=o("button"),w=m(a),c=f(),_(n,"class","tab-item"),J(n,"active",s[2]===s[6].code),this.first=n},m(h,F){r(h,n,F),l(n,w),l(n,c),p||(u=rt(n,"click",C),p=!0)},p(h,F){s=h,F&20&&J(n,"active",s[2]===s[6].code)},d(h){h&&d(n),p=!1,u()}}}function Xe(i,s){let n,a,w,c;return a=new Ye({props:{content:s[6].body}}),{key:i,first:null,c(){n=o("div"),_e(a.$$.fragment),w=f(),_(n,"class","tab-item"),J(n,"active",s[2]===s[6].code),this.first=n},m(p,u){r(p,n,u),ke(a,n,null),l(n,w),c=!0},p(p,u){s=p,(!c||u&20)&&J(n,"active",s[2]===s[6].code)},i(p){c||(z(a.$$.fragment,p),c=!0)},o(p){G(a.$$.fragment,p),c=!1},d(p){p&&d(n),he(a)}}}function ct(i){var Ne,Ue;let s,n,a=i[0].name+"",w,c,p,u,C,h,F,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,x,se,A,ne,I,oe,O,ie,Re,ae,D,re,Fe,de,ge,k,Oe,S,De,Pe,Te,ce,Ee,pe,Se,Be,xe,fe,Ae,ue,M,be,P,H,R=[],Ie=new Map,Me,q,y=[],He=new Map,T;g=new dt({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${i[3]}');
|
||||
@@ -18,20 +18,20 @@ import{S as Ze,i as et,s as tt,M as Ye,e as o,w as m,b as f,c as _e,f as _,g as
|
||||
final record = await pb.collection('${(Ue=i[0])==null?void 0:Ue.name}').getOne('RECORD_ID',
|
||||
'expand': 'relField1,relField2.subRelField',
|
||||
);
|
||||
`}});let v=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),b=qe(t);xe.set(b,F[e]=We(b,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),b=Le(t);He.set(b,y[e]=Xe(b,t))}return{c(){s=o("h3"),n=m("View ("),w=m(a),c=m(")"),p=f(),u=o("div"),C=o("p"),h=m("Fetch a single "),R=o("strong"),K=m(N),ve=m(" record."),W=f(),_e(g.$$.fragment),X=f(),B=o("h6"),B.textContent="API details",Y=f(),$=o("div"),U=o("strong"),U.textContent="GET",we=f(),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=f(),v&&v.c(),le=f(),I=o("div"),I.textContent="Path Parameters",se=f(),M=o("table"),M.innerHTML=`<thead><tr><th>Param</th>
|
||||
`}});let v=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),b=qe(t);Ie.set(b,R[e]=We(b,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),b=Le(t);He.set(b,y[e]=Xe(b,t))}return{c(){s=o("h3"),n=m("View ("),w=m(a),c=m(")"),p=f(),u=o("div"),C=o("p"),h=m("Fetch a single "),F=o("strong"),K=m(N),ve=m(" record."),W=f(),_e(g.$$.fragment),X=f(),B=o("h6"),B.textContent="API details",Y=f(),$=o("div"),U=o("strong"),U.textContent="GET",we=f(),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=f(),v&&v.c(),le=f(),x=o("div"),x.textContent="Path Parameters",se=f(),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>`,ne=f(),x=o("div"),x.textContent="Query parameters",oe=f(),O=o("table"),ie=o("thead"),ie.innerHTML=`<tr><th>Param</th>
|
||||
<td>ID of the record to view.</td></tr></tbody>`,ne=f(),I=o("div"),I.textContent="Query parameters",oe=f(),O=o("table"),ie=o("thead"),ie.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr>`,Fe=f(),ae=o("tbody"),D=o("tr"),re=o("td"),re.textContent="expand",Re=f(),de=o("td"),de.innerHTML='<span class="label">String</span>',ge=f(),k=o("td"),Oe=m(`Auto expand record relations. Ex.:
|
||||
<th width="60%">Description</th></tr>`,Re=f(),ae=o("tbody"),D=o("tr"),re=o("td"),re.textContent="expand",Fe=f(),de=o("td"),de.innerHTML='<span class="label">String</span>',ge=f(),k=o("td"),Oe=m(`Auto expand record relations. Ex.:
|
||||
`),_e(S.$$.fragment),De=m(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),Pe=o("br"),Te=m(`
|
||||
The expanded relations will be appended to the record under the
|
||||
`),ce=o("code"),ce.textContent="expand",Ee=m(" property (eg. "),pe=o("code"),pe.textContent='"expand": {"relField1": {...}, ...}',Se=m(`).
|
||||
`),Be=o("br"),Ie=m(`
|
||||
Only the relations to which the request user has permissions to `),fe=o("strong"),fe.textContent="view",Me=m(" will be expanded."),ue=f(),A=o("div"),A.textContent="Responses",be=f(),P=o("div"),H=o("div");for(let e=0;e<F.length;e+=1)F[e].c();Ae=f(),q=o("div");for(let e=0;e<y.length;e+=1)y[e].c();_(s,"class","m-b-sm"),_(u,"class","content txt-lg m-b-sm"),_(B,"class","m-b-xs"),_(U,"class","label label-primary"),_(j,"class","content"),_($,"class","alert alert-info"),_(I,"class","section-title"),_(M,"class","table-compact table-border m-b-base"),_(x,"class","section-title"),_(O,"class","table-compact table-border m-b-base"),_(A,"class","section-title"),_(H,"class","tabs-header compact left"),_(q,"class","tabs-content"),_(P,"class","tabs")},m(e,t){r(e,s,t),l(s,n),l(s,w),l(s,c),r(e,p,t),r(e,u,t),l(u,C),l(C,h),l(C,R),l(R,K),l(C,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),v&&v.m($,null),r(e,le,t),r(e,I,t),r(e,se,t),r(e,M,t),r(e,ne,t),r(e,x,t),r(e,oe,t),r(e,O,t),l(O,ie),l(O,Fe),l(O,ae),l(ae,D),l(D,re),l(D,Re),l(D,de),l(D,ge),l(D,k),l(k,Oe),ke(S,k,null),l(k,De),l(k,Pe),l(k,Te),l(k,ce),l(k,Ee),l(k,pe),l(k,Se),l(k,Be),l(k,Ie),l(k,fe),l(k,Me),r(e,ue,t),r(e,A,t),r(e,be,t),r(e,P,t),l(P,H);for(let b=0;b<F.length;b+=1)F[b].m(H,null);l(P,Ae),l(P,q);for(let b=0;b<y.length;b+=1)y[b].m(q,null);T=!0},p(e,[t]){var je,Qe;(!T||t&1)&&a!==(a=e[0].name+"")&&me(w,a),(!T||t&1)&&N!==(N=e[0].name+"")&&me(K,N);const b={};t&9&&(b.js=`
|
||||
`),Be=o("br"),xe=m(`
|
||||
Only the relations to which the request user has permissions to `),fe=o("strong"),fe.textContent="view",Ae=m(" will be expanded."),ue=f(),M=o("div"),M.textContent="Responses",be=f(),P=o("div"),H=o("div");for(let e=0;e<R.length;e+=1)R[e].c();Me=f(),q=o("div");for(let e=0;e<y.length;e+=1)y[e].c();_(s,"class","m-b-sm"),_(u,"class","content txt-lg m-b-sm"),_(B,"class","m-b-xs"),_(U,"class","label label-primary"),_(j,"class","content"),_($,"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"),_(M,"class","section-title"),_(H,"class","tabs-header compact left"),_(q,"class","tabs-content"),_(P,"class","tabs")},m(e,t){r(e,s,t),l(s,n),l(s,w),l(s,c),r(e,p,t),r(e,u,t),l(u,C),l(C,h),l(C,F),l(F,K),l(C,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),v&&v.m($,null),r(e,le,t),r(e,x,t),r(e,se,t),r(e,A,t),r(e,ne,t),r(e,I,t),r(e,oe,t),r(e,O,t),l(O,ie),l(O,Re),l(O,ae),l(ae,D),l(D,re),l(D,Fe),l(D,de),l(D,ge),l(D,k),l(k,Oe),ke(S,k,null),l(k,De),l(k,Pe),l(k,Te),l(k,ce),l(k,Ee),l(k,pe),l(k,Se),l(k,Be),l(k,xe),l(k,fe),l(k,Ae),r(e,ue,t),r(e,M,t),r(e,be,t),r(e,P,t),l(P,H);for(let b=0;b<R.length;b+=1)R[b].m(H,null);l(P,Me),l(P,q);for(let b=0;b<y.length;b+=1)y[b].m(q,null);T=!0},p(e,[t]){var je,Qe;(!T||t&1)&&a!==(a=e[0].name+"")&&me(w,a),(!T||t&1)&&N!==(N=e[0].name+"")&&me(K,N);const b={};t&9&&(b.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const pb = new PocketBase('${e[3]}');
|
||||
@@ -51,7 +51,7 @@ import{S as Ze,i as et,s as tt,M as Ye,e as o,w as m,b as f,c as _e,f as _,g as
|
||||
final record = await pb.collection('${(Qe=e[0])==null?void 0:Qe.name}').getOne('RECORD_ID',
|
||||
'expand': 'relField1,relField2.subRelField',
|
||||
);
|
||||
`),g.$set(b),(!T||t&1)&&Q!==(Q=e[0].name+"")&&me(ee,Q),e[1]?v||(v=Ke(),v.c(),v.m($,null)):v&&(v.d(1),v=null),t&20&&(V=e[4],F=Ve(F,t,qe,1,e,V,xe,H,lt,We,null,Je)),t&20&&(L=e[4],st(),y=Ve(y,t,Le,1,e,L,He,q,nt,Xe,null,Ge),ot())},i(e){if(!T){z(g.$$.fragment,e),z(S.$$.fragment,e);for(let t=0;t<L.length;t+=1)z(y[t]);T=!0}},o(e){G(g.$$.fragment,e),G(S.$$.fragment,e);for(let t=0;t<y.length;t+=1)G(y[t]);T=!1},d(e){e&&d(s),e&&d(p),e&&d(u),e&&d(W),he(g,e),e&&d(X),e&&d(B),e&&d(Y),e&&d($),v&&v.d(),e&&d(le),e&&d(I),e&&d(se),e&&d(M),e&&d(ne),e&&d(x),e&&d(oe),e&&d(O),he(S),e&&d(ue),e&&d(A),e&&d(be),e&&d(P);for(let t=0;t<F.length;t+=1)F[t].d();for(let t=0;t<y.length;t+=1)y[t].d()}}}function pt(i,s,n){let a,w,{collection:c=new it}=s,p=200,u=[];const C=h=>n(2,p=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&&(u.push({code:200,body:JSON.stringify(ze.dummyCollectionRecord(c),null,2)}),a&&u.push({code:403,body:`
|
||||
`),g.$set(b),(!T||t&1)&&Q!==(Q=e[0].name+"")&&me(ee,Q),e[1]?v||(v=Ke(),v.c(),v.m($,null)):v&&(v.d(1),v=null),t&20&&(V=e[4],R=Ve(R,t,qe,1,e,V,Ie,H,lt,We,null,Je)),t&20&&(L=e[4],st(),y=Ve(y,t,Le,1,e,L,He,q,nt,Xe,null,Ge),ot())},i(e){if(!T){z(g.$$.fragment,e),z(S.$$.fragment,e);for(let t=0;t<L.length;t+=1)z(y[t]);T=!0}},o(e){G(g.$$.fragment,e),G(S.$$.fragment,e);for(let t=0;t<y.length;t+=1)G(y[t]);T=!1},d(e){e&&d(s),e&&d(p),e&&d(u),e&&d(W),he(g,e),e&&d(X),e&&d(B),e&&d(Y),e&&d($),v&&v.d(),e&&d(le),e&&d(x),e&&d(se),e&&d(A),e&&d(ne),e&&d(I),e&&d(oe),e&&d(O),he(S),e&&d(ue),e&&d(M),e&&d(be),e&&d(P);for(let t=0;t<R.length;t+=1)R[t].d();for(let t=0;t<y.length;t+=1)y[t].d()}}}function pt(i,s,n){let a,w,{collection:c=new it}=s,p=200,u=[];const C=h=>n(2,p=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&&(u.push({code:200,body:JSON.stringify(ze.dummyCollectionRecord(c),null,2)}),a&&u.push({code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "Only admins can access this action.",
|
||||
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
-179
File diff suppressed because one or more lines are too long
Vendored
+183
File diff suppressed because one or more lines are too long
Vendored
+2
-2
@@ -24,8 +24,8 @@
|
||||
window.Prism = window.Prism || {};
|
||||
window.Prism.manual = true;
|
||||
</script>
|
||||
<script type="module" crossorigin src="./assets/index-9ce6aa95.js"></script>
|
||||
<link rel="stylesheet" href="./assets/index-976ecbec.css">
|
||||
<script type="module" crossorigin src="./assets/index-e4123b79.js"></script>
|
||||
<link rel="stylesheet" href="./assets/index-19ded015.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
Generated
+25
-25
@@ -20,7 +20,7 @@
|
||||
"chart.js": "^3.7.1",
|
||||
"chartjs-adapter-luxon": "^1.2.0",
|
||||
"luxon": "^2.3.2",
|
||||
"pocketbase": "^0.9.0",
|
||||
"pocketbase": "^0.10.0",
|
||||
"prismjs": "^1.28.0",
|
||||
"sass": "^1.45.0",
|
||||
"svelte": "^3.44.0",
|
||||
@@ -48,9 +48,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@codemirror/commands": {
|
||||
"version": "6.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.1.3.tgz",
|
||||
"integrity": "sha512-wUw1+vb34Ultv0Q9m/OVB7yizGXgtoDbkI5f5ErM8bebwLyUYjicdhJTKhTvPTpgkv8dq/BK0lQ3K5pRf2DAJw==",
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.2.0.tgz",
|
||||
"integrity": "sha512-+00smmZBradoGFEkRjliN7BjqPh/Hx0KCHWOEibUmflUqZz2RwBTU0MrVovEEHozhx3AUSGcO/rl3/5f9e9Biw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@codemirror/language": "^6.0.0",
|
||||
@@ -958,9 +958,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/pocketbase": {
|
||||
"version": "0.9.1",
|
||||
"resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.9.1.tgz",
|
||||
"integrity": "sha512-a9S/WHak+mgr3WI8bD2tz3lFVFzoy6ZgKTBlUXwIH4VLTKVU3JKeAKxqIFBF7av4qblmB+52tX8sWLS08Ftm/w==",
|
||||
"version": "0.10.0",
|
||||
"resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.10.0.tgz",
|
||||
"integrity": "sha512-OWcPRcOPNiTqek5wkf56mCmkox4w5/h1x+ySBNqzQ0Ux7ztEv3aq3Gr91bwn3VcXN7o48XVbKny7A922hNIbQw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
@@ -1035,9 +1035,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/rollup": {
|
||||
"version": "3.10.0",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.10.0.tgz",
|
||||
"integrity": "sha512-JmRYz44NjC1MjVF2VKxc0M1a97vn+cDxeqWmnwyAF4FvpjK8YFdHpaqvQB+3IxCvX05vJxKZkoMDU8TShhmJVA==",
|
||||
"version": "3.10.1",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.10.1.tgz",
|
||||
"integrity": "sha512-3Er+yel3bZbZX1g2kjVM+FW+RUWDxbG87fcqFM5/9HbPCTpbVp6JOLn7jlxnNlbu7s/N/uDA4EV/91E2gWnxzw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"rollup": "dist/bin/rollup"
|
||||
@@ -1110,9 +1110,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/svelte-flatpickr": {
|
||||
"version": "3.2.6",
|
||||
"resolved": "https://registry.npmjs.org/svelte-flatpickr/-/svelte-flatpickr-3.2.6.tgz",
|
||||
"integrity": "sha512-0ePUyE9OjInYFqQwRKOxnFSu4dQX9+/rzFMynq2fKYXx406ZUThzSx72gebtjr0DoAQbsH2///BBZa5qk4qZXg==",
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/svelte-flatpickr/-/svelte-flatpickr-3.3.1.tgz",
|
||||
"integrity": "sha512-cKHET/oFoGA/qIoAX87+XvC5n3KuFrCSYBTzI1gl1TKZsTiVnbQkJOIsIa96S19tbnyyPKn+tdt028vzBA3qyA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"flatpickr": "^4.5.2"
|
||||
@@ -1241,9 +1241,9 @@
|
||||
}
|
||||
},
|
||||
"@codemirror/commands": {
|
||||
"version": "6.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.1.3.tgz",
|
||||
"integrity": "sha512-wUw1+vb34Ultv0Q9m/OVB7yizGXgtoDbkI5f5ErM8bebwLyUYjicdhJTKhTvPTpgkv8dq/BK0lQ3K5pRf2DAJw==",
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.2.0.tgz",
|
||||
"integrity": "sha512-+00smmZBradoGFEkRjliN7BjqPh/Hx0KCHWOEibUmflUqZz2RwBTU0MrVovEEHozhx3AUSGcO/rl3/5f9e9Biw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@codemirror/language": "^6.0.0",
|
||||
@@ -1850,9 +1850,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"pocketbase": {
|
||||
"version": "0.9.1",
|
||||
"resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.9.1.tgz",
|
||||
"integrity": "sha512-a9S/WHak+mgr3WI8bD2tz3lFVFzoy6ZgKTBlUXwIH4VLTKVU3JKeAKxqIFBF7av4qblmB+52tX8sWLS08Ftm/w==",
|
||||
"version": "0.10.0",
|
||||
"resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.10.0.tgz",
|
||||
"integrity": "sha512-OWcPRcOPNiTqek5wkf56mCmkox4w5/h1x+ySBNqzQ0Ux7ztEv3aq3Gr91bwn3VcXN7o48XVbKny7A922hNIbQw==",
|
||||
"dev": true
|
||||
},
|
||||
"postcss": {
|
||||
@@ -1899,9 +1899,9 @@
|
||||
}
|
||||
},
|
||||
"rollup": {
|
||||
"version": "3.10.0",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.10.0.tgz",
|
||||
"integrity": "sha512-JmRYz44NjC1MjVF2VKxc0M1a97vn+cDxeqWmnwyAF4FvpjK8YFdHpaqvQB+3IxCvX05vJxKZkoMDU8TShhmJVA==",
|
||||
"version": "3.10.1",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.10.1.tgz",
|
||||
"integrity": "sha512-3Er+yel3bZbZX1g2kjVM+FW+RUWDxbG87fcqFM5/9HbPCTpbVp6JOLn7jlxnNlbu7s/N/uDA4EV/91E2gWnxzw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fsevents": "~2.3.2"
|
||||
@@ -1949,9 +1949,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"svelte-flatpickr": {
|
||||
"version": "3.2.6",
|
||||
"resolved": "https://registry.npmjs.org/svelte-flatpickr/-/svelte-flatpickr-3.2.6.tgz",
|
||||
"integrity": "sha512-0ePUyE9OjInYFqQwRKOxnFSu4dQX9+/rzFMynq2fKYXx406ZUThzSx72gebtjr0DoAQbsH2///BBZa5qk4qZXg==",
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/svelte-flatpickr/-/svelte-flatpickr-3.3.1.tgz",
|
||||
"integrity": "sha512-cKHET/oFoGA/qIoAX87+XvC5n3KuFrCSYBTzI1gl1TKZsTiVnbQkJOIsIa96S19tbnyyPKn+tdt028vzBA3qyA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"flatpickr": "^4.5.2"
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
"chart.js": "^3.7.1",
|
||||
"chartjs-adapter-luxon": "^1.2.0",
|
||||
"luxon": "^2.3.2",
|
||||
"pocketbase": "^0.9.0",
|
||||
"pocketbase": "^0.10.0",
|
||||
"prismjs": "^1.28.0",
|
||||
"sass": "^1.45.0",
|
||||
"svelte": "^3.44.0",
|
||||
|
||||
+3
-1
@@ -54,7 +54,9 @@
|
||||
$appName = settings?.meta?.appName || "";
|
||||
$hideControls = !!settings?.meta?.hideControls;
|
||||
} catch (err) {
|
||||
console.warn("Failed to load app settings.", err);
|
||||
if (!err?.isAbort) {
|
||||
console.warn("Failed to load app settings.", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
// Simple Svelte scrollend detection action.
|
||||
// ===================================================================
|
||||
//
|
||||
// ### Example usage
|
||||
//
|
||||
// Simple form (with default 100px threshold):
|
||||
// ```html
|
||||
// <div class="list" use:scrollend={() => { console.log("end reached") }}>
|
||||
// ...
|
||||
// </div>
|
||||
// ```
|
||||
//
|
||||
// With custom threshold:
|
||||
// ```html
|
||||
// <div class="list" use:scrollend={{
|
||||
// threshold: 10,
|
||||
// callback: () => { console.log("end reached") }
|
||||
// }}>
|
||||
// ...
|
||||
// </div>
|
||||
// ```
|
||||
// ===================================================================
|
||||
|
||||
function normalize(rawData) {
|
||||
if (typeof rawData === "function") {
|
||||
return {
|
||||
threshold: 100,
|
||||
callback: rawData,
|
||||
}
|
||||
}
|
||||
|
||||
return rawData || {};
|
||||
}
|
||||
|
||||
export default function scrollend(node, options) {
|
||||
options = normalize(options);
|
||||
|
||||
options?.callback && options.callback();
|
||||
|
||||
function onScroll(e) {
|
||||
if (!options?.callback) {
|
||||
return;
|
||||
}
|
||||
|
||||
const offset = e.target.scrollHeight - e.target.clientHeight - e.target.scrollTop;
|
||||
|
||||
if (offset <= options.threshold) {
|
||||
options.callback();
|
||||
}
|
||||
}
|
||||
|
||||
node.addEventListener("scroll", onScroll);
|
||||
node.addEventListener("resize", onScroll);
|
||||
|
||||
return {
|
||||
update(newOptions) {
|
||||
options = normalize(newOptions);
|
||||
},
|
||||
destroy() {
|
||||
node.removeEventListener("scroll", onScroll);
|
||||
node.removeEventListener("resize", onScroll);
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -233,7 +233,7 @@
|
||||
|
||||
<svelte:fragment slot="footer">
|
||||
{#if !admin.isNew}
|
||||
<button type="button" class="btn btn-sm btn-circle btn-secondary">
|
||||
<button type="button" class="btn btn-sm btn-circle btn-transparent">
|
||||
<!-- empty span for alignment -->
|
||||
<span />
|
||||
<i class="ri-more-line" />
|
||||
@@ -247,7 +247,7 @@
|
||||
<div class="flex-fill" />
|
||||
{/if}
|
||||
|
||||
<button type="button" class="btn btn-secondary" disabled={isSaving} on:click={() => hide()}>
|
||||
<button type="button" class="btn btn-transparent" disabled={isSaving} on:click={() => hide()}>
|
||||
<span class="txt">Cancel</span>
|
||||
</button>
|
||||
<button
|
||||
|
||||
@@ -86,6 +86,7 @@
|
||||
extraAutocompleteKeys={["email"]}
|
||||
on:submit={(e) => (filter = e.detail)}
|
||||
/>
|
||||
<div class="clearfix m-b-base" />
|
||||
|
||||
<HorizontalScroller class="table-wrapper">
|
||||
<table class="table" class:table-loading={isLoading}>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<button
|
||||
autofocus
|
||||
type="button"
|
||||
class="btn btn-secondary btn-expanded-sm"
|
||||
class="btn btn-transparent btn-expanded-sm"
|
||||
disabled={isConfirmationBusy}
|
||||
on:click={() => {
|
||||
confirmed = false;
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
<script>
|
||||
import { createEventDispatcher } from "svelte";
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
export let index;
|
||||
export let list = [];
|
||||
export let disabled = false;
|
||||
|
||||
let dragging = false;
|
||||
let dragover = false;
|
||||
|
||||
function onDrag(event, i) {
|
||||
if (!event && !disabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
dragging = true;
|
||||
|
||||
event.dataTransfer.effectAllowed = "move";
|
||||
event.dataTransfer.dropEffect = "move";
|
||||
event.dataTransfer.setData("text/plain", i);
|
||||
}
|
||||
|
||||
function onDrop(event, target) {
|
||||
if (!event && !disabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
dragover = false;
|
||||
dragging = false;
|
||||
|
||||
event.dataTransfer.dropEffect = "move";
|
||||
|
||||
const start = parseInt(event.dataTransfer.getData("text/plain"));
|
||||
|
||||
if (start < target) {
|
||||
list.splice(target + 1, 0, list[start]);
|
||||
list.splice(start, 1);
|
||||
} else {
|
||||
list.splice(target, 0, list[start]);
|
||||
list.splice(start + 1, 1);
|
||||
}
|
||||
|
||||
list = list;
|
||||
|
||||
dispatch("sort", list);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div
|
||||
draggable={true}
|
||||
class="draggable"
|
||||
class:dragging
|
||||
class:dragover
|
||||
on:dragover|preventDefault={() => {
|
||||
dragover = true;
|
||||
}}
|
||||
on:dragleave|preventDefault={() => {
|
||||
dragover = false;
|
||||
}}
|
||||
on:dragend={() => {
|
||||
dragover = false;
|
||||
dragging = false;
|
||||
}}
|
||||
on:dragstart={(e) => onDrag(e, index)}
|
||||
on:drop={(e) => onDrop(e, index)}
|
||||
>
|
||||
<slot {dragging} {dragover} />
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.draggable {
|
||||
user-select: none;
|
||||
outline: 0;
|
||||
min-width: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -33,6 +33,7 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<div bind:this={container} class={classes} class:error={fieldErrors.length} on:click>
|
||||
<slot {uniqueId} />
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* <h5 slot="header">My title</h5>
|
||||
* <p>Lorem ipsum dolor sit amet...</p>
|
||||
* <svelte:fragment slot="footer">
|
||||
* <button class="btn btn-secondary">Cancel</button>
|
||||
* <button class="btn btn-transparent">Cancel</button>
|
||||
* <button class="btn btn-expanded">Save</button>
|
||||
* </svelte:fragment>
|
||||
* </OverlayPanel>
|
||||
@@ -52,8 +52,11 @@
|
||||
let transitionSpeed = 150;
|
||||
let contentScrollThrottle;
|
||||
let contentScrollClass = "";
|
||||
let oldActive = active;
|
||||
|
||||
$: onActiveChange(active);
|
||||
$: if (oldActive != active) {
|
||||
onActiveChange(active);
|
||||
}
|
||||
|
||||
$: handleContentScroll(contentPanel, true);
|
||||
|
||||
@@ -81,8 +84,10 @@
|
||||
return active;
|
||||
}
|
||||
|
||||
async function onActiveChange(state) {
|
||||
if (state) {
|
||||
async function onActiveChange(newState) {
|
||||
oldActive = newState;
|
||||
|
||||
if (newState) {
|
||||
oldFocusedElem = document.activeElement;
|
||||
wrapper?.focus();
|
||||
dispatch("show");
|
||||
@@ -91,7 +96,10 @@
|
||||
clearTimeout(contentScrollThrottle);
|
||||
oldFocusedElem?.focus();
|
||||
dispatch("hide");
|
||||
document.body.classList.remove("overlay-active");
|
||||
|
||||
if (getHolder().querySelectorAll(".overlay-panel-container.active").length <= 1) {
|
||||
document.body.classList.remove("overlay-active");
|
||||
}
|
||||
}
|
||||
|
||||
await tick();
|
||||
@@ -194,6 +202,7 @@
|
||||
<div bind:this={wrapper} class="overlay-panel-wrapper">
|
||||
{#if active}
|
||||
<div class="overlay-panel-container" class:padded={popup} class:active>
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<div
|
||||
class="overlay"
|
||||
on:click|preventDefault={() => (overlayClose ? hide() : true)}
|
||||
@@ -208,9 +217,9 @@
|
||||
>
|
||||
<div class="overlay-panel-section panel-header">
|
||||
{#if btnClose && !popup}
|
||||
<div class="overlay-close" on:click|preventDefault={hide}>
|
||||
<button type="button" class="overlay-close" on:click|preventDefault={hide}>
|
||||
<i class="ri-close-line" />
|
||||
</div>
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<slot name="header" />
|
||||
@@ -218,7 +227,7 @@
|
||||
{#if btnClose && popup}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm btn-circle btn-secondary btn-close m-l-auto"
|
||||
class="btn btn-sm btn-circle btn-transparent btn-close m-l-auto"
|
||||
on:click|preventDefault={hide}
|
||||
>
|
||||
<i class="ri-close-line txt-lg" />
|
||||
|
||||
@@ -51,6 +51,6 @@
|
||||
<i class="ri-external-link-line" />
|
||||
</a>
|
||||
<div class="flex-fill" />
|
||||
<button type="button" class="btn btn-secondary" on:click={hide}>Close</button>
|
||||
<button type="button" class="btn btn-transparent" on:click={hide}>Close</button>
|
||||
</svelte:fragment>
|
||||
</OverlayPanel>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<div class="form-field-addon">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary btn-circle"
|
||||
class="btn btn-transparent btn-circle"
|
||||
use:tooltip={{ position: "left", text: "Set new value" }}
|
||||
on:click={() => unlock()}
|
||||
>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary btn-circle"
|
||||
class="btn btn-transparent btn-circle"
|
||||
class:refreshing={refreshTimeoutId}
|
||||
use:tooltip={tooltipData}
|
||||
on:click={refresh}
|
||||
|
||||
@@ -53,58 +53,56 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="searchbar-wrapper">
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<form class="searchbar" on:click|stopPropagation on:submit|preventDefault={submit}>
|
||||
<label for={uniqueId} class="m-l-10 txt-xl">
|
||||
<i class="ri-search-line" />
|
||||
</label>
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<form class="searchbar" on:click|stopPropagation on:submit|preventDefault={submit}>
|
||||
<label for={uniqueId} class="m-l-10 txt-xl">
|
||||
<i class="ri-search-line" />
|
||||
</label>
|
||||
|
||||
{#if filterComponent && !isFilterComponentLoading}
|
||||
<svelte:component
|
||||
this={filterComponent}
|
||||
id={uniqueId}
|
||||
singleLine
|
||||
disableRequestKeys
|
||||
disableIndirectCollectionsKeys
|
||||
{extraAutocompleteKeys}
|
||||
baseCollection={autocompleteCollection}
|
||||
placeholder={value || placeholder}
|
||||
bind:value={tempValue}
|
||||
on:submit={submit}
|
||||
/>
|
||||
{:else}
|
||||
<input
|
||||
bind:this={searchInput}
|
||||
type="text"
|
||||
id={uniqueId}
|
||||
placeholder={value || placeholder}
|
||||
bind:value={tempValue}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
{#if value.length || tempValue.length}
|
||||
{#if tempValue !== value}
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-expanded btn-sm btn-warning"
|
||||
transition:fly|local={{ duration: 150, x: 5 }}
|
||||
>
|
||||
<span class="txt">Search</span>
|
||||
</button>
|
||||
{/if}
|
||||
{#if filterComponent && !isFilterComponentLoading}
|
||||
<svelte:component
|
||||
this={filterComponent}
|
||||
id={uniqueId}
|
||||
singleLine
|
||||
disableRequestKeys
|
||||
disableIndirectCollectionsKeys
|
||||
{extraAutocompleteKeys}
|
||||
baseCollection={autocompleteCollection}
|
||||
placeholder={value || placeholder}
|
||||
bind:value={tempValue}
|
||||
on:submit={submit}
|
||||
/>
|
||||
{:else}
|
||||
<input
|
||||
bind:this={searchInput}
|
||||
type="text"
|
||||
id={uniqueId}
|
||||
placeholder={value || placeholder}
|
||||
bind:value={tempValue}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
{#if value.length || tempValue.length}
|
||||
{#if tempValue !== value}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary btn-sm btn-hint p-l-xs p-r-xs m-l-10"
|
||||
type="submit"
|
||||
class="btn btn-expanded btn-sm btn-warning"
|
||||
transition:fly|local={{ duration: 150, x: 5 }}
|
||||
on:click={() => {
|
||||
clear(false);
|
||||
submit();
|
||||
}}
|
||||
>
|
||||
<span class="txt">Clear</span>
|
||||
<span class="txt">Search</span>
|
||||
</button>
|
||||
{/if}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10"
|
||||
transition:fly|local={{ duration: 150, x: 5 }}
|
||||
on:click={() => {
|
||||
clear(false);
|
||||
submit();
|
||||
}}
|
||||
>
|
||||
<span class="txt">Clear</span>
|
||||
</button>
|
||||
{/if}
|
||||
</form>
|
||||
|
||||
@@ -11,8 +11,9 @@
|
||||
export let items = [];
|
||||
export let multiple = false;
|
||||
export let disabled = false;
|
||||
export let closable = true;
|
||||
export let selected = multiple ? [] : undefined;
|
||||
export let toggle = false; // toggle option on click
|
||||
export let toggle = multiple; // toggle option on click
|
||||
export let labelComponent = undefined; // custom component to use for each selected option label
|
||||
export let labelComponentProps = {}; // props to pass to the custom option component
|
||||
export let optionComponent = undefined; // custom component to use for each dropdown option item
|
||||
@@ -195,8 +196,9 @@
|
||||
</script>
|
||||
|
||||
<div bind:this={container} class="select {classes}" class:multiple class:disabled>
|
||||
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
|
||||
<div bind:this={labelDiv} tabindex={disabled ? "-1" : "0"} class="selected-container" class:disabled>
|
||||
{#each CommonHelper.toArray(selected) as item}
|
||||
{#each CommonHelper.toArray(selected) as item, i}
|
||||
<div class="option">
|
||||
{#if labelComponent}
|
||||
<svelte:component this={labelComponent} {item} {...labelComponentProps} />
|
||||
@@ -205,6 +207,7 @@
|
||||
{/if}
|
||||
|
||||
{#if multiple || toggle}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<span
|
||||
class="clear"
|
||||
use:tooltip={"Clear"}
|
||||
@@ -247,7 +250,7 @@
|
||||
<div class="addon suffix p-r-5">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm btn-circle btn-secondary clear"
|
||||
class="btn btn-sm btn-circle btn-transparent clear"
|
||||
on:click|preventDefault|stopPropagation={resetSearch}
|
||||
>
|
||||
<i class="ri-close-line" />
|
||||
@@ -262,9 +265,11 @@
|
||||
|
||||
<div class="options-list">
|
||||
{#each filteredItems as item}
|
||||
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
|
||||
<div
|
||||
tabindex="0"
|
||||
class="dropdown-item option closable"
|
||||
class="dropdown-item option"
|
||||
class:closable
|
||||
class:selected={isSelected(item)}
|
||||
on:click={(e) => handleOptionSelect(e, item)}
|
||||
on:keydown={(e) => handleOptionKeypress(e, item)}
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
|
||||
<!-- visible only on small screens -->
|
||||
<svelte:fragment slot="footer">
|
||||
<button type="button" class="btn btn-secondary" on:click={() => hide()}>
|
||||
<button type="button" class="btn btn-transparent" on:click={() => hide()}>
|
||||
<span class="txt">Close</span>
|
||||
</button>
|
||||
</svelte:fragment>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<script>
|
||||
import { SchemaField } from "pocketbase";
|
||||
import { Collection, SchemaField } from "pocketbase";
|
||||
import FieldAccordion from "@/components/collections/FieldAccordion.svelte";
|
||||
|
||||
export let collection = {};
|
||||
export let collection = new Collection();
|
||||
|
||||
const baseReservedNames = [
|
||||
"id",
|
||||
@@ -36,8 +36,8 @@
|
||||
reservedNames = baseReservedNames.slice(0);
|
||||
}
|
||||
|
||||
$: if (typeof collection?.schema === "undefined") {
|
||||
collection = collection || {};
|
||||
$: if (typeof collection.schema === "undefined") {
|
||||
collection = collection || new Collection();
|
||||
collection.schema = [];
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-block {collection?.isAuth || collection.schema?.length ? 'btn-secondary' : 'btn-warning'}"
|
||||
class="btn btn-block {collection.schema.length ? 'btn-transparent' : 'btn-secondary'}"
|
||||
on:click={newField}
|
||||
>
|
||||
<i class="ri-add-line" />
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
|
||||
<svelte:fragment slot="footer">
|
||||
<!-- svelte-ignore a11y-autofocus -->
|
||||
<button autofocus type="button" class="btn btn-secondary" on:click={() => hide()}>
|
||||
<button autofocus type="button" class="btn btn-transparent" on:click={() => hide()}>
|
||||
<span class="txt">Cancel</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-expanded" on:click={() => confirm()}>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
import ApiClient from "@/utils/ApiClient";
|
||||
import { errors, setErrors, removeError } from "@/stores/errors";
|
||||
import { confirm } from "@/stores/confirmation";
|
||||
import { addSuccessToast } from "@/stores/toasts";
|
||||
import { addCollection, removeCollection } from "@/stores/collections";
|
||||
import { removeAllToasts, addSuccessToast } from "@/stores/toasts";
|
||||
import { loadCollections, removeCollection } from "@/stores/collections";
|
||||
import tooltip from "@/actions/tooltip";
|
||||
import Field from "@/components/base/Field.svelte";
|
||||
import Toggler from "@/components/base/Toggler.svelte";
|
||||
@@ -119,12 +119,16 @@
|
||||
|
||||
request
|
||||
.then((result) => {
|
||||
removeAllToasts();
|
||||
|
||||
loadCollections(result.id);
|
||||
|
||||
confirmClose = false;
|
||||
hide();
|
||||
|
||||
addSuccessToast(
|
||||
collection.isNew ? "Successfully created collection." : "Successfully updated collection."
|
||||
);
|
||||
addCollection(result);
|
||||
|
||||
dispatch("save", {
|
||||
isNew: collection.isNew,
|
||||
@@ -209,7 +213,7 @@
|
||||
|
||||
{#if !collection.isNew && !collection.system}
|
||||
<div class="flex-fill" />
|
||||
<button type="button" class="btn btn-sm btn-circle btn-secondary flex-gap-0">
|
||||
<button type="button" class="btn btn-sm btn-circle btn-transparent flex-gap-0">
|
||||
<i class="ri-more-line" />
|
||||
<Toggler class="dropdown dropdown-right m-t-5">
|
||||
<button
|
||||
@@ -256,7 +260,7 @@
|
||||
<div class="form-field-addon">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm p-r-10 p-l-10 {collection.isNew ? 'btn-hint' : 'btn-secondary'}"
|
||||
class="btn btn-sm p-r-10 p-l-10 {collection.isNew ? 'btn-hint' : 'btn-transparent'}"
|
||||
disabled={!collection.isNew}
|
||||
>
|
||||
<!-- empty span for alignment -->
|
||||
@@ -362,7 +366,7 @@
|
||||
</div>
|
||||
|
||||
<svelte:fragment slot="footer">
|
||||
<button type="button" class="btn btn-secondary" disabled={isSaving} on:click={() => hide()}>
|
||||
<button type="button" class="btn btn-transparent" disabled={isSaving} on:click={() => hide()}>
|
||||
<span class="txt">Cancel</span>
|
||||
</button>
|
||||
<button
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { link } from "svelte-spa-router";
|
||||
import CommonHelper from "@/utils/CommonHelper";
|
||||
import { hideControls } from "@/stores/app";
|
||||
import { collections, activeCollection } from "@/stores/collections";
|
||||
import { collections, activeCollection, isCollectionsLoading } from "@/stores/collections";
|
||||
import CollectionUpsertPanel from "@/components/collections/CollectionUpsertPanel.svelte";
|
||||
|
||||
let collectionPanel;
|
||||
@@ -43,7 +43,7 @@
|
||||
<div class="form-field-addon">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-xs btn-secondary btn-circle btn-clear"
|
||||
class="btn btn-xs btn-transparent btn-circle btn-clear"
|
||||
class:hidden={!hasSearch}
|
||||
on:click={() => (searchTerm = "")}
|
||||
>
|
||||
@@ -56,7 +56,11 @@
|
||||
|
||||
<hr class="m-t-5 m-b-xs" />
|
||||
|
||||
<div class="sidebar-content" class:sidebar-content-compact={filteredCollections.length > 20}>
|
||||
<div
|
||||
class="sidebar-content"
|
||||
class:fade={$isCollectionsLoading}
|
||||
class:sidebar-content-compact={filteredCollections.length > 20}
|
||||
>
|
||||
{#each filteredCollections as collection (collection.id)}
|
||||
<a
|
||||
href="/collections?collectionId={collection.id}"
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
{#if field.toDelete}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm btn-danger btn-secondary"
|
||||
class="btn btn-sm btn-danger btn-transparent"
|
||||
on:click|stopPropagation={() => {
|
||||
field.toDelete = false;
|
||||
}}
|
||||
@@ -311,7 +311,7 @@
|
||||
<div class="col-sm-4 txt-right">
|
||||
<div class="flex-fill" />
|
||||
<div class="inline-flex flex-gap-sm flex-nowrap">
|
||||
<button type="button" class="btn btn-circle btn-sm btn-secondary">
|
||||
<button type="button" class="btn btn-circle btn-sm btn-transparent">
|
||||
<i class="ri-more-line" />
|
||||
<Toggler
|
||||
class="dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width"
|
||||
|
||||
@@ -65,14 +65,18 @@
|
||||
{#if isAdminOnly}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm btn-secondary btn-success lock-toggle"
|
||||
class="btn btn-sm btn-transparent btn-success lock-toggle"
|
||||
on:click={unlock}
|
||||
>
|
||||
<i class="ri-lock-unlock-line" />
|
||||
<span class="txt">Set custom rule</span>
|
||||
</button>
|
||||
{:else}
|
||||
<button type="button" class="btn btn-sm btn-secondary btn-hint lock-toggle" on:click={lock}>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm btn-transparent btn-hint lock-toggle"
|
||||
on:click={lock}
|
||||
>
|
||||
<i class="ri-lock-line" />
|
||||
<span class="txt">Set Admins only</span>
|
||||
</button>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<button class="btn btn-sm btn-secondary m-t-5" on:click={toggle}>
|
||||
<button class="btn btn-sm btn-transparent m-t-5" on:click={toggle}>
|
||||
{#if expanded}
|
||||
<span class="txt">Hide details</span>
|
||||
<i class="ri-arrow-up-s-line" />
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<script>
|
||||
import ApiClient from "@/utils/ApiClient";
|
||||
import CommonHelper from "@/utils/CommonHelper";
|
||||
import tooltip from "@/actions/tooltip";
|
||||
import Field from "@/components/base/Field.svelte";
|
||||
import Select from "@/components/base/Select.svelte";
|
||||
import ObjectSelect from "@/components/base/ObjectSelect.svelte";
|
||||
import CollectionUpsertPanel from "@/components/collections/CollectionUpsertPanel.svelte";
|
||||
import { collections } from "@/stores/collections";
|
||||
|
||||
export let key = "";
|
||||
export let options = {};
|
||||
@@ -14,9 +15,13 @@
|
||||
{ label: "True", value: true },
|
||||
];
|
||||
|
||||
let isLoading = false;
|
||||
let collections = [];
|
||||
const baseFields = ["id", "created", "updated"];
|
||||
|
||||
const authFields = ["username", "email", "emailVisibility", "verified"];
|
||||
|
||||
let upsertPanel = null;
|
||||
let displayFieldsList = [];
|
||||
let oldCollectionId = null;
|
||||
|
||||
// load defaults
|
||||
$: if (CommonHelper.isEmpty(options)) {
|
||||
@@ -24,27 +29,39 @@
|
||||
maxSelect: 1,
|
||||
collectionId: null,
|
||||
cascadeDelete: false,
|
||||
displayFields: [],
|
||||
};
|
||||
}
|
||||
|
||||
$: selectedColection = collections.find((c) => c.id == options.collectionId) || null;
|
||||
$: selectedColection = $collections.find((c) => c.id == options.collectionId) || null;
|
||||
|
||||
loadCollections();
|
||||
$: if (oldCollectionId != options.collectionId) {
|
||||
oldCollectionId = options.collectionId;
|
||||
refreshDisplayFieldsList();
|
||||
}
|
||||
|
||||
async function loadCollections() {
|
||||
isLoading = true;
|
||||
|
||||
try {
|
||||
const result = await ApiClient.collections.getFullList(200, {
|
||||
sort: "created",
|
||||
});
|
||||
|
||||
collections = CommonHelper.sortCollections(result);
|
||||
} catch (err) {
|
||||
ApiClient.errorResponseHandler(err);
|
||||
function refreshDisplayFieldsList() {
|
||||
displayFieldsList = baseFields.slice(0);
|
||||
if (!selectedColection) {
|
||||
return;
|
||||
}
|
||||
|
||||
isLoading = false;
|
||||
if (selectedColection.isAuth) {
|
||||
displayFieldsList = displayFieldsList.concat(authFields);
|
||||
}
|
||||
|
||||
for (const field of selectedColection.schema) {
|
||||
displayFieldsList.push(field.name);
|
||||
}
|
||||
|
||||
// deselect any missing display field
|
||||
if (options?.displayFields?.length > 0) {
|
||||
for (let i = options.displayFields.length - 1; i >= 0; i--) {
|
||||
if (!displayFieldsList.includes(options.displayFields[i])) {
|
||||
options.displayFields.splice(i, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -53,19 +70,21 @@
|
||||
<Field class="form-field required" name="schema.{key}.options.collectionId" let:uniqueId>
|
||||
<label for={uniqueId}>Collection</label>
|
||||
<ObjectSelect
|
||||
searchable={collections.length > 5}
|
||||
selectPlaceholder={isLoading ? "Loading..." : "Select collection"}
|
||||
searchable={$collections.length > 5}
|
||||
selectPlaceholder={"Select collection"}
|
||||
noOptionsText="No collections found"
|
||||
selectionKey="id"
|
||||
items={collections}
|
||||
items={$collections}
|
||||
bind:keyOfSelected={options.collectionId}
|
||||
>
|
||||
<svelte:fragment slot="afterOptions">
|
||||
<hr />
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-warning btn-block btn-sm m-t-5"
|
||||
class="btn btn-transparent btn-block btn-sm"
|
||||
on:click={() => upsertPanel?.show()}
|
||||
>
|
||||
<i class="ri-add-line" />
|
||||
<span class="txt">New collection</span>
|
||||
</button>
|
||||
</svelte:fragment>
|
||||
@@ -87,11 +106,30 @@
|
||||
<input type="number" id={uniqueId} step="1" min="1" bind:value={options.maxSelect} />
|
||||
</Field>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<Field class="form-field" name="schema.{key}.options.cascadeDelete" let:uniqueId>
|
||||
<div class="col-sm-9">
|
||||
<Field class="form-field" name="schema.{key}.options.displayFields" let:uniqueId>
|
||||
<label for={uniqueId}>
|
||||
Delete record on {selectedColection ? selectedColection.name : "relation"} delete
|
||||
<span class="txt">Display fields</span>
|
||||
<i
|
||||
class="ri-information-line link-hint"
|
||||
use:tooltip={{
|
||||
text: "Optional select the field(s) that will be used in the listings UI. Leave empty for auto.",
|
||||
position: "top",
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
<Select
|
||||
multiple
|
||||
searchable
|
||||
id={uniqueId}
|
||||
items={displayFieldsList}
|
||||
bind:selected={options.displayFields}
|
||||
/>
|
||||
</Field>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<Field class="form-field" name="schema.{key}.options.cascadeDelete" let:uniqueId>
|
||||
<label for={uniqueId}>Cascade delete</label>
|
||||
<ObjectSelect id={uniqueId} items={defaultOptions} bind:keyOfSelected={options.cascadeDelete} />
|
||||
</Field>
|
||||
</div>
|
||||
@@ -103,6 +141,5 @@
|
||||
if (e?.detail?.collection?.id) {
|
||||
options.collectionId = e.detail.collection.id;
|
||||
}
|
||||
loadCollections();
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
</table>
|
||||
|
||||
<svelte:fragment slot="footer">
|
||||
<button type="button" class="btn btn-secondary" on:click={() => hide()}>
|
||||
<button type="button" class="btn btn-transparent" on:click={() => hide()}>
|
||||
<span class="txt">Close</span>
|
||||
</button>
|
||||
</svelte:fragment>
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
<div class="block txt-center m-t-xs">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-lg btn-secondary btn-expanded"
|
||||
class="btn btn-lg btn-transparent btn-expanded"
|
||||
class:btn-loading={isLoading}
|
||||
class:btn-disabled={isLoading}
|
||||
on:click={() => load(currentPage + 1)}
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
on:submit={(e) => (filter = e.detail)}
|
||||
/>
|
||||
|
||||
<div class="clearfix m-b-xs" />
|
||||
<div class="clearfix m-b-base" />
|
||||
|
||||
{#key refreshToken}
|
||||
<LogsChart bind:filter {presets} />
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
<div class="txt-hint">ID: {auth.providerId}</div>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary link-hint btn-circle btn-sm m-l-auto"
|
||||
class="btn btn-transparent link-hint btn-circle btn-sm m-l-auto"
|
||||
on:click={() => unlinkExternalAuth(auth.provider)}
|
||||
>
|
||||
<i class="ri-close-line" />
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-secondary btn-block" on:click={() => window.close()}>
|
||||
<button type="button" class="btn btn-transparent btn-block" on:click={() => window.close()}>
|
||||
Close
|
||||
</button>
|
||||
{:else}
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-secondary btn-block" on:click={() => window.close()}>
|
||||
<button type="button" class="btn btn-transparent btn-block" on:click={() => window.close()}>
|
||||
Close
|
||||
</button>
|
||||
{:else}
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-secondary btn-block" on:click={() => window.close()}>
|
||||
<button type="button" class="btn btn-transparent btn-block" on:click={() => window.close()}>
|
||||
Close
|
||||
</button>
|
||||
{:else}
|
||||
@@ -53,7 +53,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-secondary btn-block" on:click={() => window.close()}>
|
||||
<button type="button" class="btn btn-transparent btn-block" on:click={() => window.close()}>
|
||||
Close
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
@@ -28,13 +28,13 @@
|
||||
let recordsList;
|
||||
let filter = queryParams.get("filter") || "";
|
||||
let sort = queryParams.get("sort") || "-created";
|
||||
let selectedCollectionId = queryParams.get("collectionId") || "";
|
||||
let selectedCollectionId = queryParams.get("collectionId") || $activeCollection?.id;
|
||||
|
||||
$: reactiveParams = new URLSearchParams($querystring);
|
||||
|
||||
$: if (
|
||||
!$isCollectionsLoading &&
|
||||
reactiveParams.has("collectionId") &&
|
||||
reactiveParams.get("collectionId") &&
|
||||
reactiveParams.get("collectionId") != selectedCollectionId
|
||||
) {
|
||||
changeActiveCollectionById(reactiveParams.get("collectionId"));
|
||||
@@ -64,7 +64,7 @@
|
||||
loadCollections(selectedCollectionId);
|
||||
</script>
|
||||
|
||||
{#if $isCollectionsLoading}
|
||||
{#if $isCollectionsLoading && !$collections.length}
|
||||
<PageWrapper center>
|
||||
<div class="placeholder-section m-b-base">
|
||||
<span class="loader loader-lg" />
|
||||
@@ -106,7 +106,7 @@
|
||||
{#if !$hideControls}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary btn-circle"
|
||||
class="btn btn-transparent btn-circle"
|
||||
use:tooltip={{ text: "Edit collection", position: "right" }}
|
||||
on:click={() => collectionUpsertPanel?.show($activeCollection)}
|
||||
>
|
||||
@@ -139,6 +139,7 @@
|
||||
autocompleteCollection={$activeCollection}
|
||||
on:submit={(e) => (filter = e.detail)}
|
||||
/>
|
||||
<div class="clearfix m-b-base" />
|
||||
|
||||
<RecordsList
|
||||
bind:this={recordsList}
|
||||
@@ -146,6 +147,7 @@
|
||||
bind:filter
|
||||
bind:sort
|
||||
on:select={(e) => recordPanel?.show(e?.detail)}
|
||||
on:new={() => recordPanel?.show()}
|
||||
/>
|
||||
</PageWrapper>
|
||||
{/if}
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
<script>
|
||||
import CommonHelper from "@/utils/CommonHelper";
|
||||
import tooltip from "@/actions/tooltip";
|
||||
import IdLabel from "@/components/base/IdLabel.svelte";
|
||||
import FormattedDate from "@/components/base/FormattedDate.svelte";
|
||||
import IdLabel from "@/components/base/IdLabel.svelte";
|
||||
import RecordFileThumb from "@/components/records/RecordFileThumb.svelte";
|
||||
import RecordInfo from "@/components/records/RecordInfo.svelte";
|
||||
|
||||
export let record;
|
||||
export let field;
|
||||
|
||||
// rough text cut to avoid rendering large chunk of texts
|
||||
function cutText(text) {
|
||||
text = text || "";
|
||||
return text.length > 150 ? text.substring(0, 150) : text;
|
||||
}
|
||||
</script>
|
||||
|
||||
<td class="col-type-{field.type} col-field-{field.name}">
|
||||
@@ -31,17 +26,17 @@
|
||||
use:tooltip={"Open in new tab"}
|
||||
on:click|stopPropagation
|
||||
>
|
||||
{cutText(record[field.name])}
|
||||
{CommonHelper.truncate(record[field.name])}
|
||||
</a>
|
||||
{:else if field.type === "editor"}
|
||||
<span class="txt txt-ellipsis">
|
||||
{cutText(CommonHelper.plainText(record[field.name]))}
|
||||
<span class="txt">
|
||||
{CommonHelper.truncate(CommonHelper.plainText(record[field.name]), 300, true)}
|
||||
</span>
|
||||
{:else if field.type === "date"}
|
||||
<FormattedDate date={record[field.name]} />
|
||||
{:else if field.type === "json"}
|
||||
<span class="txt txt-ellipsis">
|
||||
{cutText(JSON.stringify(record[field.name]))}
|
||||
{CommonHelper.truncate(JSON.stringify(record[field.name]))}
|
||||
</span>
|
||||
{:else if field.type === "select"}
|
||||
<div class="inline-flex">
|
||||
@@ -50,11 +45,21 @@
|
||||
{/each}
|
||||
</div>
|
||||
{:else if field.type === "relation" || field.type === "user"}
|
||||
{@const relations = CommonHelper.toArray(record[field.name])}
|
||||
{@const expanded = CommonHelper.toArray(record.expand[field.name])}
|
||||
<div class="inline-flex">
|
||||
{#each CommonHelper.toArray(record[field.name]).slice(0, 20) as item, i (i + item)}
|
||||
<IdLabel id={item} />
|
||||
{/each}
|
||||
{#if CommonHelper.toArray(record[field.name]).length > 20}
|
||||
{#if expanded.length}
|
||||
{#each expanded.slice(0, 20) as item, i (i + item)}
|
||||
<span class="label">
|
||||
<RecordInfo record={item} displayFields={field.options?.displayFields} />
|
||||
</span>
|
||||
{/each}
|
||||
{:else}
|
||||
{#each relations.slice(0, 20) as item, i (i + item)}
|
||||
<IdLabel id={item} />
|
||||
{/each}
|
||||
{/if}
|
||||
{#if relations.length > 20}
|
||||
...
|
||||
{/if}
|
||||
</div>
|
||||
@@ -65,8 +70,8 @@
|
||||
{/each}
|
||||
</div>
|
||||
{:else}
|
||||
<span class="txt txt-ellipsis" title={cutText(record[field.name])}>
|
||||
{cutText(record[field.name])}
|
||||
<span class="txt txt-ellipsis" title={CommonHelper.truncate(record[field.name])}>
|
||||
{CommonHelper.truncate(record[field.name])}
|
||||
</span>
|
||||
{/if}
|
||||
</td>
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<script>
|
||||
import CommonHelper from "@/utils/CommonHelper";
|
||||
import tooltip from "@/actions/tooltip";
|
||||
|
||||
export let record;
|
||||
export let displayFields = [];
|
||||
|
||||
$: displayValue = CommonHelper.displayValue(record, displayFields);
|
||||
</script>
|
||||
|
||||
<div class="record-info">
|
||||
<i
|
||||
class="link-hint txt-sm ri-information-line"
|
||||
use:tooltip={{
|
||||
text: CommonHelper.truncate(
|
||||
JSON.stringify(CommonHelper.truncateObject(record), null, 2),
|
||||
800,
|
||||
true
|
||||
),
|
||||
class: "code",
|
||||
position: "left",
|
||||
}}
|
||||
/>
|
||||
<span class="txt txt-ellipsis">{CommonHelper.truncate(displayValue, 150)}</span>
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
.record-info {
|
||||
display: inline-flex;
|
||||
vertical-align: top;
|
||||
align-items: center;
|
||||
max-width: 100%;
|
||||
min-width: 0;
|
||||
gap: 5px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,192 +0,0 @@
|
||||
<script>
|
||||
import ApiClient from "@/utils/ApiClient";
|
||||
import CommonHelper from "@/utils/CommonHelper";
|
||||
import ObjectSelect from "@/components/base/ObjectSelect.svelte";
|
||||
import RecordSelectOption from "./RecordSelectOption.svelte";
|
||||
import RecordUpsertPanel from "@/components/records/RecordUpsertPanel.svelte";
|
||||
|
||||
const uniqueId = "select_" + CommonHelper.randomString(5);
|
||||
|
||||
// original select props
|
||||
export let multiple = false;
|
||||
export let selected = [];
|
||||
export let keyOfSelected = multiple ? [] : undefined;
|
||||
export let selectPlaceholder = "- Select -";
|
||||
export let optionComponent = RecordSelectOption; // custom component to use for each dropdown option item
|
||||
|
||||
// custom props
|
||||
export let collectionId;
|
||||
|
||||
let list = [];
|
||||
let currentPage = 1;
|
||||
let totalItems = 0;
|
||||
let isLoadingList = false;
|
||||
let isLoadingSelected = false;
|
||||
let isLoadingCollection = false;
|
||||
let collection = null;
|
||||
let upsertPanel;
|
||||
|
||||
$: if (collectionId) {
|
||||
loadCollection();
|
||||
loadSelected().then(() => {
|
||||
loadList(true);
|
||||
});
|
||||
}
|
||||
|
||||
$: isLoading = isLoadingList || isLoadingSelected;
|
||||
|
||||
$: canLoadMore = totalItems > list.length;
|
||||
|
||||
async function loadCollection() {
|
||||
if (!collectionId) {
|
||||
collection = null;
|
||||
isLoadingCollection = false;
|
||||
return;
|
||||
}
|
||||
|
||||
isLoadingCollection = true;
|
||||
|
||||
try {
|
||||
collection = await ApiClient.collections.getOne(collectionId, {
|
||||
$cancelKey: "collection_" + uniqueId,
|
||||
});
|
||||
} catch (err) {
|
||||
ApiClient.errorResponseHandler(err);
|
||||
}
|
||||
|
||||
isLoadingCollection = false;
|
||||
}
|
||||
|
||||
async function loadSelected() {
|
||||
const selectedIds = CommonHelper.toArray(keyOfSelected);
|
||||
|
||||
if (!collectionId || !selectedIds.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
isLoadingSelected = true;
|
||||
|
||||
let loadedItems = [];
|
||||
|
||||
// batch load all selected records to avoid parser stack overflow errors
|
||||
const filterIds = selectedIds.slice();
|
||||
const loadPromises = [];
|
||||
while (filterIds.length > 0) {
|
||||
const filters = [];
|
||||
for (const id of filterIds.splice(0, 50)) {
|
||||
filters.push(`id="${id}"`);
|
||||
}
|
||||
|
||||
loadPromises.push(
|
||||
ApiClient.collection(collectionId).getFullList(200, {
|
||||
filter: filters.join("||"),
|
||||
$autoCancel: false,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
await Promise.all(loadPromises).then((values) => {
|
||||
loadedItems = loadedItems.concat(...values);
|
||||
});
|
||||
|
||||
// preserve selected order
|
||||
selected = [];
|
||||
for (const id of selectedIds) {
|
||||
const item = CommonHelper.findByKey(loadedItems, "id", id);
|
||||
if (item) {
|
||||
selected.push(item);
|
||||
}
|
||||
}
|
||||
|
||||
// add the selected models to the list (if not already)
|
||||
list = CommonHelper.filterDuplicatesByKey(selected.concat(list));
|
||||
} catch (err) {
|
||||
ApiClient.errorResponseHandler(err);
|
||||
}
|
||||
|
||||
isLoadingSelected = false;
|
||||
}
|
||||
|
||||
async function loadList(reset = false) {
|
||||
if (!collectionId) {
|
||||
return;
|
||||
}
|
||||
|
||||
isLoadingList = true;
|
||||
|
||||
try {
|
||||
const page = reset ? 1 : currentPage + 1;
|
||||
|
||||
const result = await ApiClient.collection(collectionId).getList(page, 200, {
|
||||
sort: "-created",
|
||||
$cancelKey: uniqueId + "loadList",
|
||||
});
|
||||
|
||||
if (reset) {
|
||||
list = CommonHelper.toArray(selected).slice();
|
||||
}
|
||||
|
||||
list = CommonHelper.filterDuplicatesByKey(
|
||||
list.concat(result.items, CommonHelper.toArray(selected))
|
||||
);
|
||||
currentPage = result.page;
|
||||
totalItems = result.totalItems;
|
||||
} catch (err) {
|
||||
ApiClient.errorResponseHandler(err);
|
||||
}
|
||||
|
||||
isLoadingList = false;
|
||||
}
|
||||
</script>
|
||||
|
||||
<ObjectSelect
|
||||
selectPlaceholder={isLoading ? "Loading..." : selectPlaceholder}
|
||||
items={list}
|
||||
searchable={list.length > 5}
|
||||
selectionKey="id"
|
||||
labelComponent={optionComponent}
|
||||
disabled={isLoading}
|
||||
{optionComponent}
|
||||
{multiple}
|
||||
bind:keyOfSelected
|
||||
bind:selected
|
||||
on:show
|
||||
on:hide
|
||||
class="records-select block-options"
|
||||
{...$$restProps}
|
||||
>
|
||||
<svelte:fragment slot="afterOptions">
|
||||
{#if !isLoadingCollection && collection}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-warning btn-block btn-sm m-t-5"
|
||||
on:click={() => upsertPanel?.show()}
|
||||
>
|
||||
<span class="txt">New record</span>
|
||||
</button>
|
||||
{/if}
|
||||
{#if canLoadMore}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-block btn-sm m-t-5"
|
||||
class:btn-loading={isLoadingList}
|
||||
class:btn-disabled={isLoadingList}
|
||||
on:click|stopPropagation={() => loadList()}
|
||||
>
|
||||
<span class="txt">Load more</span>
|
||||
</button>
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
</ObjectSelect>
|
||||
|
||||
<RecordUpsertPanel
|
||||
bind:this={upsertPanel}
|
||||
{collection}
|
||||
on:save={(e) => {
|
||||
if (e?.detail?.id) {
|
||||
keyOfSelected = CommonHelper.toArray(keyOfSelected).concat(e.detail.id);
|
||||
}
|
||||
loadList(true);
|
||||
}}
|
||||
/>
|
||||
@@ -1,62 +0,0 @@
|
||||
<script>
|
||||
import CommonHelper from "@/utils/CommonHelper";
|
||||
import tooltip from "@/actions/tooltip";
|
||||
|
||||
const excludedMetaProps = ["id", "created", "updated", "collectionId", "collectionName"];
|
||||
|
||||
export let item = {}; // model
|
||||
|
||||
$: meta = extractMeta(item);
|
||||
|
||||
function extractMeta(model) {
|
||||
model = model || {};
|
||||
|
||||
const props = [
|
||||
// prioritized common displayable props
|
||||
"title",
|
||||
"name",
|
||||
"email",
|
||||
"username",
|
||||
"label",
|
||||
"key",
|
||||
"heading",
|
||||
"content",
|
||||
"description",
|
||||
// fallback to the available props
|
||||
...Object.keys(model),
|
||||
];
|
||||
|
||||
for (const prop of props) {
|
||||
if (
|
||||
typeof model[prop] === "string" &&
|
||||
!CommonHelper.isEmpty(model[prop]) &&
|
||||
!excludedMetaProps.includes(prop)
|
||||
) {
|
||||
return prop + ": " + model[prop];
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
</script>
|
||||
|
||||
<i
|
||||
class="ri-information-line link-hint"
|
||||
use:tooltip={{ text: JSON.stringify(item, null, 2), position: "left", class: "code" }}
|
||||
/>
|
||||
|
||||
<div class="content">
|
||||
<div class="block txt-ellipsis">{item.id}</div>
|
||||
{#if meta !== "" && meta !== item.id}
|
||||
<small class="block txt-hint txt-ellipsis">{meta}</small>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.content {
|
||||
flex-shrink: 1;
|
||||
flex-grow: 0;
|
||||
width: auto;
|
||||
min-width: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -246,7 +246,7 @@
|
||||
|
||||
{#if !record.isNew}
|
||||
<div class="flex-fill" />
|
||||
<button type="button" class="btn btn-sm btn-circle btn-secondary">
|
||||
<button type="button" class="btn btn-sm btn-circle btn-transparent">
|
||||
<div class="content">
|
||||
<i class="ri-more-line" />
|
||||
<Toggler class="dropdown dropdown-right dropdown-nowrap">
|
||||
@@ -381,7 +381,7 @@
|
||||
</div>
|
||||
|
||||
<svelte:fragment slot="footer">
|
||||
<button type="button" class="btn btn-secondary" disabled={isSaving} on:click={() => hide()}>
|
||||
<button type="button" class="btn btn-transparent" disabled={isSaving} on:click={() => hide()}>
|
||||
<span class="txt">Cancel</span>
|
||||
</button>
|
||||
<button
|
||||
|
||||
@@ -15,11 +15,13 @@
|
||||
import RecordFieldCell from "@/components/records/RecordFieldCell.svelte";
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
const sortRegex = /^([\+\-])?(\w+)$/;
|
||||
|
||||
export let collection;
|
||||
export let sort = "";
|
||||
export let filter = "";
|
||||
|
||||
let recordPanel;
|
||||
let records = [];
|
||||
let currentPage = 1;
|
||||
let totalRecords = 0;
|
||||
@@ -31,6 +33,12 @@
|
||||
let hiddenColumns = [];
|
||||
let collumnsToHide = [];
|
||||
|
||||
$: fields = collection?.schema || [];
|
||||
|
||||
$: relFields = fields.filter((field) => field.type === "relation");
|
||||
|
||||
$: visibleFields = fields.filter((field) => !hiddenColumns.includes(field.id));
|
||||
|
||||
$: if (collection?.id) {
|
||||
loadStoredHiddenColumns();
|
||||
clearList();
|
||||
@@ -42,10 +50,6 @@
|
||||
|
||||
$: canLoadMore = totalRecords > records.length;
|
||||
|
||||
$: fields = collection?.schema || [];
|
||||
|
||||
$: visibleFields = fields.filter((field) => !hiddenColumns.includes(field.id));
|
||||
|
||||
$: totalBulkSelected = Object.keys(bulkSelected).length;
|
||||
|
||||
$: areAllRecordsSelected = records.length && totalBulkSelected === records.length;
|
||||
@@ -108,10 +112,23 @@
|
||||
|
||||
isLoading = true;
|
||||
|
||||
// allow sorting by the relation display fields
|
||||
let listSort = sort;
|
||||
const sortMatch = listSort.match(sortRegex);
|
||||
const relField = sortMatch ? relFields.find((f) => f.name === sortMatch[2]) : null;
|
||||
if (sortMatch && relField?.options?.displayFields?.length > 0) {
|
||||
const parts = [];
|
||||
for (const displayField of relField.options.displayFields) {
|
||||
parts.push((sortMatch[1] || "") + sortMatch[2] + "." + displayField);
|
||||
}
|
||||
listSort = parts.join(",");
|
||||
}
|
||||
|
||||
return ApiClient.collection(collection.id)
|
||||
.getList(page, 30, {
|
||||
sort: sort,
|
||||
sort: listSort,
|
||||
filter: filter,
|
||||
expand: relFields.map((field) => field.name).join(","),
|
||||
})
|
||||
.then(async (result) => {
|
||||
if (page <= 1) {
|
||||
@@ -329,7 +346,7 @@
|
||||
{/if}
|
||||
|
||||
<th class="col-type-action min-width">
|
||||
<button bind:this={columnsTrigger} type="button" class="btn btn-sm btn-secondary p-0">
|
||||
<button bind:this={columnsTrigger} type="button" class="btn btn-sm btn-transparent p-0">
|
||||
<i class="ri-more-line" />
|
||||
</button>
|
||||
</th>
|
||||
@@ -447,6 +464,15 @@
|
||||
>
|
||||
<span class="txt">Clear filters</span>
|
||||
</button>
|
||||
{:else}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary btn-expanded m-t-sm"
|
||||
on:click={() => dispatch("new")}
|
||||
>
|
||||
<i class="ri-add-line" />
|
||||
<span class="txt">New record</span>
|
||||
</button>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -464,7 +490,7 @@
|
||||
<div class="block txt-center m-t-xs">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-lg btn-secondary btn-expanded"
|
||||
class="btn btn-lg btn-transparent btn-expanded"
|
||||
class:btn-loading={isLoading}
|
||||
class:btn-disabled={isLoading}
|
||||
on:click={() => load(currentPage + 1)}
|
||||
@@ -482,7 +508,7 @@
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"
|
||||
class="btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"
|
||||
class:btn-disabled={isDeleting}
|
||||
on:click={() => deselectAllRecords()}
|
||||
>
|
||||
@@ -491,7 +517,7 @@
|
||||
<div class="flex-fill" />
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm btn-secondary btn-danger"
|
||||
class="btn btn-sm btn-transparent btn-danger"
|
||||
class:btn-loading={isDeleting}
|
||||
class:btn-disabled={isDeleting}
|
||||
on:click={() => deleteSelectedConfirm()}
|
||||
|
||||
@@ -0,0 +1,344 @@
|
||||
<script>
|
||||
import { createEventDispatcher } from "svelte";
|
||||
import CommonHelper from "@/utils/CommonHelper";
|
||||
import ApiClient from "@/utils/ApiClient";
|
||||
import scrollend from "@/actions/scrollend";
|
||||
import tooltip from "@/actions/tooltip";
|
||||
import OverlayPanel from "@/components/base/OverlayPanel.svelte";
|
||||
import Searchbar from "@/components/base/Searchbar.svelte";
|
||||
import Draggable from "@/components/base/Draggable.svelte";
|
||||
import RecordInfo from "@/components/records/RecordInfo.svelte";
|
||||
import RecordUpsertPanel from "@/components/records/RecordUpsertPanel.svelte";
|
||||
import { collections } from "@/stores/collections";
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
const uniqueId = "picker_" + CommonHelper.randomString(5);
|
||||
const batchSize = 100;
|
||||
|
||||
export let value;
|
||||
export let field;
|
||||
|
||||
let pickerPanel;
|
||||
let upsertPanel;
|
||||
let filter = "";
|
||||
let list = [];
|
||||
let selected = [];
|
||||
let currentPage = 1;
|
||||
let totalItems = 0;
|
||||
let isLoadingList = false;
|
||||
let isLoadingSelected = false;
|
||||
|
||||
$: maxSelect = field?.options?.maxSelect || null;
|
||||
|
||||
$: collectionId = field?.options?.collectionId;
|
||||
|
||||
$: displayFields = field?.options?.displayFields;
|
||||
|
||||
$: collection = $collections.find((c) => c.id == collectionId) || null;
|
||||
|
||||
$: if (typeof filter !== "undefined" && !isLoadingSelected && pickerPanel?.isActive()) {
|
||||
loadList(true); // reset list on filter or list change
|
||||
}
|
||||
|
||||
$: isLoading = isLoadingList || isLoadingSelected;
|
||||
|
||||
$: canLoadMore = totalItems > list.length;
|
||||
|
||||
$: canSelectMore = maxSelect === null || maxSelect > selected.length;
|
||||
|
||||
export function show() {
|
||||
filter = "";
|
||||
list = [];
|
||||
selected = [];
|
||||
loadSelected();
|
||||
loadList(true);
|
||||
|
||||
return pickerPanel?.show();
|
||||
}
|
||||
|
||||
export function hide() {
|
||||
return pickerPanel?.hide();
|
||||
}
|
||||
|
||||
async function loadSelected() {
|
||||
const selectedIds = CommonHelper.toArray(value);
|
||||
|
||||
if (!collectionId || !selectedIds.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
isLoadingSelected = true;
|
||||
|
||||
let loadedItems = [];
|
||||
|
||||
// batch load all selected records to avoid parser stack overflow errors
|
||||
const filterIds = selectedIds.slice();
|
||||
const loadPromises = [];
|
||||
while (filterIds.length > 0) {
|
||||
const filters = [];
|
||||
for (const id of filterIds.splice(0, batchSize)) {
|
||||
filters.push(`id="${id}"`);
|
||||
}
|
||||
|
||||
loadPromises.push(
|
||||
ApiClient.collection(collectionId).getFullList(batchSize, {
|
||||
filter: filters.join("||"),
|
||||
$autoCancel: false,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
await Promise.all(loadPromises).then((values) => {
|
||||
loadedItems = loadedItems.concat(...values);
|
||||
});
|
||||
|
||||
// preserve selected order
|
||||
selected = [];
|
||||
for (const id of selectedIds) {
|
||||
const item = CommonHelper.findByKey(loadedItems, "id", id);
|
||||
if (item) {
|
||||
selected.push(item);
|
||||
}
|
||||
}
|
||||
|
||||
if (!filter.trim()) {
|
||||
// add the selected models to the list (if not already)
|
||||
list = CommonHelper.filterDuplicatesByKey(selected.concat(list));
|
||||
}
|
||||
} catch (err) {
|
||||
ApiClient.errorResponseHandler(err);
|
||||
}
|
||||
|
||||
isLoadingSelected = false;
|
||||
}
|
||||
|
||||
async function loadList(reset = false) {
|
||||
if (!collectionId) {
|
||||
return;
|
||||
}
|
||||
|
||||
isLoadingList = true;
|
||||
|
||||
if (reset) {
|
||||
if (!filter.trim()) {
|
||||
// prepend the loaded selected items
|
||||
list = CommonHelper.toArray(selected).slice();
|
||||
} else {
|
||||
list = [];
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const page = reset ? 1 : currentPage + 1;
|
||||
|
||||
const result = await ApiClient.collection(collectionId).getList(page, batchSize, {
|
||||
filter: filter,
|
||||
sort: "-created",
|
||||
$cancelKey: uniqueId + "loadList",
|
||||
});
|
||||
|
||||
list = CommonHelper.filterDuplicatesByKey(list.concat(result.items));
|
||||
currentPage = result.page;
|
||||
totalItems = result.totalItems;
|
||||
} catch (err) {
|
||||
ApiClient.errorResponseHandler(err);
|
||||
}
|
||||
|
||||
isLoadingList = false;
|
||||
}
|
||||
|
||||
$: isSelected = function (record) {
|
||||
return CommonHelper.findByKey(selected, "id", record.id);
|
||||
};
|
||||
|
||||
function select(record) {
|
||||
if (maxSelect == 1) {
|
||||
selected = [record];
|
||||
} else if (canSelectMore) {
|
||||
CommonHelper.pushUnique(selected, record);
|
||||
selected = selected;
|
||||
}
|
||||
}
|
||||
|
||||
function deselect(record) {
|
||||
CommonHelper.removeByKey(selected, "id", record.id);
|
||||
selected = selected;
|
||||
}
|
||||
|
||||
function toggle(record) {
|
||||
if (isSelected(record)) {
|
||||
deselect(record);
|
||||
} else {
|
||||
select(record);
|
||||
}
|
||||
}
|
||||
|
||||
function save() {
|
||||
if (maxSelect != 1) {
|
||||
value = selected.map((r) => r.id);
|
||||
} else {
|
||||
value = selected?.[0]?.id || "";
|
||||
}
|
||||
|
||||
dispatch("save", selected);
|
||||
hide();
|
||||
}
|
||||
</script>
|
||||
|
||||
<OverlayPanel bind:this={pickerPanel} popup class="overlay-panel-xl" on:hide on:show {...$$restProps}>
|
||||
<svelte:fragment slot="header">
|
||||
<h4>
|
||||
Select <strong>{collection?.name || ""}</strong> records
|
||||
</h4>
|
||||
</svelte:fragment>
|
||||
|
||||
<div class="flex m-b-base flex-gap-10">
|
||||
<Searchbar
|
||||
value={filter}
|
||||
autocompleteCollection={collection}
|
||||
on:submit={(e) => (filter = e.detail)}
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-transparent btn-hint p-l-sm p-r-sm"
|
||||
on:click={() => upsertPanel?.show()}
|
||||
>
|
||||
<div class="txt">New record</div>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="list picker-list m-b-base"
|
||||
use:scrollend={() => {
|
||||
if (canLoadMore && !isLoadingList) {
|
||||
loadList();
|
||||
}
|
||||
}}
|
||||
>
|
||||
{#each list as record (record.id)}
|
||||
{@const selected = isSelected(record)}
|
||||
|
||||
<div
|
||||
tabindex="0"
|
||||
class="list-item handle"
|
||||
class:selected
|
||||
class:disabled={!selected && maxSelect > 1 && !canSelectMore}
|
||||
on:click={() => toggle(record)}
|
||||
on:keydown={(e) => {
|
||||
if (e.code === "Enter" || e.code === "Space") {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
toggle(record);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{#if selected}
|
||||
<i class="ri-checkbox-circle-fill txt-success" />
|
||||
{:else}
|
||||
<i class="ri-checkbox-blank-circle-line txt-disabled" />
|
||||
{/if}
|
||||
<div class="content">
|
||||
<RecordInfo {record} {displayFields} />
|
||||
</div>
|
||||
<div class="actions nonintrusive">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"
|
||||
use:tooltip={"Edit"}
|
||||
on:keydown|stopPropagation
|
||||
on:click|stopPropagation={() => upsertPanel?.show(record)}
|
||||
>
|
||||
<i class="ri-pencil-line" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="list-item">
|
||||
{#if isLoading}
|
||||
<div class="block txt-center">
|
||||
<span class="loader loader-sm active" />
|
||||
</div>
|
||||
{:else}
|
||||
<span class="txt txt-hint">No records found.</span>
|
||||
{#if filter?.length}
|
||||
<button type="button" class="btn btn-hint btn-sm" on:click={() => (filter = "")}>
|
||||
<span class="txt">Clear filters</span>
|
||||
</button>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
<h5 class="section-title">
|
||||
Selected
|
||||
{#if maxSelect > 1}
|
||||
({selected.length} of MAX {maxSelect})
|
||||
{/if}
|
||||
</h5>
|
||||
{#if selected.length}
|
||||
<div class="selected-list">
|
||||
{#each selected as record, i}
|
||||
<Draggable bind:list={selected} index={i} let:dragging let:dragover>
|
||||
<span class="label" class:label-danger={dragging} class:label-warning={dragover}>
|
||||
<RecordInfo {record} {displayFields} />
|
||||
<button
|
||||
type="button"
|
||||
title="Remove"
|
||||
class="btn btn-circle btn-transparent btn-hint btn-xs"
|
||||
on:click={() => deselect(record)}
|
||||
>
|
||||
<i class="ri-close-line" />
|
||||
</button>
|
||||
</span>
|
||||
</Draggable>
|
||||
{/each}
|
||||
</div>
|
||||
{:else}
|
||||
<p class="txt-hint">No selected records.</p>
|
||||
{/if}
|
||||
|
||||
<svelte:fragment slot="footer">
|
||||
<button type="button" class="btn btn-transparent" on:click={() => hide()}>
|
||||
<span class="txt">Cancel</span>
|
||||
</button>
|
||||
<button type="button" class="btn" on:click={() => save()}>
|
||||
<span class="txt">Save selection</span>
|
||||
</button>
|
||||
</svelte:fragment>
|
||||
</OverlayPanel>
|
||||
|
||||
<RecordUpsertPanel
|
||||
bind:this={upsertPanel}
|
||||
{collection}
|
||||
on:save={(e) => {
|
||||
CommonHelper.removeByKey(list, "id", e.detail.id);
|
||||
list.unshift(e.detail);
|
||||
list = list;
|
||||
|
||||
CommonHelper.pushOrReplaceByKey(selected, e.detail);
|
||||
selected = selected;
|
||||
}}
|
||||
on:delete={(e) => {
|
||||
CommonHelper.removeByKey(list, "id", e.detail.id);
|
||||
list = list;
|
||||
|
||||
CommonHelper.removeByKey(selected, "id", e.detail.id);
|
||||
selected = selected;
|
||||
}}
|
||||
/>
|
||||
|
||||
<style lang="scss">
|
||||
.picker-list {
|
||||
max-height: 380px;
|
||||
}
|
||||
.selected-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
max-height: 220px;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -56,7 +56,7 @@
|
||||
<div class="form-field-addon email-visibility-addon">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm btn-secondary {record.emailVisibility ? 'btn-success' : 'btn-hint'}"
|
||||
class="btn btn-sm btn-transparent {record.emailVisibility ? 'btn-success' : 'btn-hint'}"
|
||||
use:tooltip={{
|
||||
text: "Make email public or private",
|
||||
position: "top-right",
|
||||
|
||||
@@ -70,47 +70,56 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<Field class="form-field form-field-file {field.required ? 'required' : ''}" name={field.name} let:uniqueId>
|
||||
<Field
|
||||
class="form-field form-field-list form-field-file {field.required ? 'required' : ''}"
|
||||
name={field.name}
|
||||
let:uniqueId
|
||||
>
|
||||
<label for={uniqueId}>
|
||||
<i class={CommonHelper.getFieldTypeIcon(field.type)} />
|
||||
<span class="txt">{field.name}</span>
|
||||
</label>
|
||||
|
||||
<div bind:this={filesListElem} class="files-list">
|
||||
<div bind:this={filesListElem} class="list">
|
||||
{#each valueAsArray as filename, i (filename)}
|
||||
{@const isDeleted = deletedFileIndexes.includes(i)}
|
||||
<div class="list-item">
|
||||
<div class:fade={deletedFileIndexes.includes(i)}>
|
||||
<RecordFileThumb {record} {filename} />
|
||||
</div>
|
||||
<a
|
||||
href={ApiClient.getFileUrl(record, filename)}
|
||||
class="filename link-hint"
|
||||
class:txt-strikethrough={deletedFileIndexes.includes(i)}
|
||||
title="Download"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
{filename}
|
||||
</a>
|
||||
|
||||
{#if deletedFileIndexes.includes(i)}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm btn-danger btn-secondary"
|
||||
on:click={() => restoreExistingFile(i)}
|
||||
<div class="content">
|
||||
<a
|
||||
href={ApiClient.getFileUrl(record, filename)}
|
||||
class="txt-ellipsis {isDeleted ? 'txt-strikethrough txt-hint' : 'link-primary'}"
|
||||
title="Download"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<span class="txt">Restore</span>
|
||||
</button>
|
||||
{:else}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary btn-sm btn-circle btn-remove txt-hint"
|
||||
use:tooltip={"Remove file"}
|
||||
on:click={() => removeExistingFile(i)}
|
||||
>
|
||||
<i class="ri-close-line" />
|
||||
</button>
|
||||
{/if}
|
||||
{filename}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
{#if deletedFileIndexes.includes(i)}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm btn-danger btn-transparent"
|
||||
on:click={() => restoreExistingFile(i)}
|
||||
>
|
||||
<span class="txt">Restore</span>
|
||||
</button>
|
||||
{:else}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-transparent btn-hint btn-sm btn-circle btn-remove"
|
||||
use:tooltip={"Remove file"}
|
||||
on:click={() => removeExistingFile(i)}
|
||||
>
|
||||
<i class="ri-close-line" />
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/each}
|
||||
|
||||
@@ -125,7 +134,7 @@
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary btn-sm btn-circle btn-remove"
|
||||
class="btn btn-transparent btn-sm btn-circle btn-remove"
|
||||
use:tooltip={"Remove file"}
|
||||
on:click={() => removeNewFile(i)}
|
||||
>
|
||||
@@ -135,7 +144,7 @@
|
||||
{/each}
|
||||
|
||||
{#if !maxReached}
|
||||
<div class="list-item btn-list-item">
|
||||
<div class="list-item list-item-btn">
|
||||
<input
|
||||
bind:this={fileInput}
|
||||
type="file"
|
||||
@@ -151,7 +160,7 @@
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary btn-sm btn-block"
|
||||
class="btn btn-transparent btn-sm btn-block"
|
||||
on:click={() => fileInput?.click()}
|
||||
>
|
||||
<i class="ri-upload-cloud-line" />
|
||||
|
||||
@@ -1,37 +1,145 @@
|
||||
<script>
|
||||
import { SchemaField } from "pocketbase";
|
||||
import CommonHelper from "@/utils/CommonHelper";
|
||||
import RecordSelect from "@/components/records/RecordSelect.svelte";
|
||||
import ApiClient from "@/utils/ApiClient";
|
||||
import tooltip from "@/actions/tooltip";
|
||||
import Field from "@/components/base/Field.svelte";
|
||||
import RecordsPicker from "@/components/records/RecordsPicker.svelte";
|
||||
import RecordInfo from "@/components/records/RecordInfo.svelte";
|
||||
|
||||
const batchSize = 100;
|
||||
|
||||
export let value;
|
||||
export let picker;
|
||||
export let field = new SchemaField();
|
||||
export let value = undefined;
|
||||
|
||||
let list = [];
|
||||
let isLoading = false;
|
||||
|
||||
$: isMultiple = field.options?.maxSelect != 1;
|
||||
|
||||
$: if (
|
||||
isMultiple &&
|
||||
Array.isArray(value) &&
|
||||
field.options?.maxSelect &&
|
||||
value.length > field.options.maxSelect
|
||||
) {
|
||||
value = value.slice(field.options.maxSelect - 1);
|
||||
load();
|
||||
|
||||
async function load() {
|
||||
const ids = CommonHelper.toArray(value);
|
||||
|
||||
if (!field?.options?.collectionId || !ids.length) {
|
||||
list = [];
|
||||
isLoading = false;
|
||||
return;
|
||||
}
|
||||
|
||||
isLoading = true;
|
||||
|
||||
// batch load all selected records to avoid parser stack overflow errors
|
||||
const filterIds = ids.slice();
|
||||
const loadPromises = [];
|
||||
while (filterIds.length > 0) {
|
||||
const filters = [];
|
||||
for (const id of filterIds.splice(0, batchSize)) {
|
||||
filters.push(`id="${id}"`);
|
||||
}
|
||||
|
||||
loadPromises.push(
|
||||
ApiClient.collection(field?.options?.collectionId).getFullList(batchSize, {
|
||||
filter: filters.join("||"),
|
||||
$autoCancel: false,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
let loadedItems = [];
|
||||
await Promise.all(loadPromises).then((values) => {
|
||||
loadedItems = loadedItems.concat(...values);
|
||||
});
|
||||
|
||||
// preserve selected order
|
||||
for (const id of ids) {
|
||||
const rel = CommonHelper.findByKey(loadedItems, "id", id);
|
||||
if (rel) {
|
||||
list.push(rel);
|
||||
}
|
||||
}
|
||||
|
||||
list = list;
|
||||
} catch (err) {
|
||||
ApiClient.errorResponseHandler(err);
|
||||
}
|
||||
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
function remove(rel) {
|
||||
CommonHelper.removeByKey(list, "id", rel.id);
|
||||
list = list;
|
||||
|
||||
if (isMultiple) {
|
||||
value = list.map((r) => r.id);
|
||||
} else {
|
||||
value = list[0]?.id || "";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<Field class="form-field {field.required ? 'required' : ''}" name={field.name} let:uniqueId>
|
||||
<Field class="form-field form-field-list {field.required ? 'required' : ''}" name={field.name} let:uniqueId>
|
||||
<label for={uniqueId}>
|
||||
<i class={CommonHelper.getFieldTypeIcon(field.type)} />
|
||||
<span class="txt">{field.name}</span>
|
||||
</label>
|
||||
<RecordSelect
|
||||
toggle
|
||||
id={uniqueId}
|
||||
multiple={isMultiple}
|
||||
collectionId={field.options?.collectionId}
|
||||
bind:keyOfSelected={value}
|
||||
/>
|
||||
{#if field.options?.maxSelect > 1}
|
||||
<div class="help-block">Select up to {field.options.maxSelect} items.</div>
|
||||
{/if}
|
||||
|
||||
<div class="list">
|
||||
<div class="relations-list">
|
||||
{#each list as record}
|
||||
<div class="list-item">
|
||||
<div class="content">
|
||||
<RecordInfo {record} displayFields={field.options?.displayFields} />
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-transparent btn-hint btn-sm btn-circle btn-remove"
|
||||
use:tooltip={"Remove"}
|
||||
on:click={() => remove(record)}
|
||||
>
|
||||
<i class="ri-close-line" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
{#if isLoading}
|
||||
{#each CommonHelper.toArray(value).slice(0, 10) as _}
|
||||
<div class="list-item">
|
||||
<div class="skeleton-loader" />
|
||||
</div>
|
||||
{/each}
|
||||
{/if}
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
<div class="list-item list-item-btn">
|
||||
<button type="button" class="btn btn-transparent btn-sm btn-block" on:click={() => picker?.show()}>
|
||||
<i class="ri-layout-line" />
|
||||
<span class="txt">Open picker</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</Field>
|
||||
|
||||
<RecordsPicker
|
||||
bind:this={picker}
|
||||
{value}
|
||||
{field}
|
||||
on:save={(e) => {
|
||||
list = e.detail || [];
|
||||
value = isMultiple ? list.map((r) => r.id) : list[0] || "";
|
||||
}}
|
||||
/>
|
||||
|
||||
<style lang="scss">
|
||||
.relations-list {
|
||||
max-height: 300px;
|
||||
overflow: auto; /* fallback */
|
||||
overflow: overlay;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
</form>
|
||||
|
||||
<svelte:fragment slot="footer">
|
||||
<button type="button" class="btn btn-secondary" on:click={hide} disabled={isSubmitting}>Close</button>
|
||||
<button type="button" class="btn btn-transparent" on:click={hide} disabled={isSubmitting}>Close</button>
|
||||
<button
|
||||
type="submit"
|
||||
form={formId}
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
{/each}
|
||||
|
||||
<svelte:fragment slot="footer">
|
||||
<button type="button" class="btn btn-secondary" on:click={hide} disabled={isImporting}>Close</button>
|
||||
<button type="button" class="btn btn-transparent" on:click={hide} disabled={isImporting}>Close</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-expanded"
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
{#if hasChanges}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary btn-hint"
|
||||
class="btn btn-transparent btn-hint"
|
||||
disabled={isSaving}
|
||||
on:click={() => reset()}
|
||||
>
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
{#if hasChanges}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary btn-hint"
|
||||
class="btn btn-transparent btn-hint"
|
||||
disabled={isSaving}
|
||||
on:click={() => reset()}
|
||||
>
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm btn-secondary fade copy-schema"
|
||||
class="btn btn-sm btn-transparent fade copy-schema"
|
||||
on:click={() => copy()}
|
||||
>
|
||||
<span class="txt">Copy</span>
|
||||
|
||||
@@ -382,7 +382,7 @@
|
||||
|
||||
<div class="flex m-t-base">
|
||||
{#if !!schemas}
|
||||
<button type="button" class="btn btn-secondary link-hint" on:click={() => clear()}>
|
||||
<button type="button" class="btn btn-transparent link-hint" on:click={() => clear()}>
|
||||
<span class="txt">Clear</span>
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
@@ -242,7 +242,7 @@
|
||||
{#if hasChanges}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary btn-hint"
|
||||
class="btn btn-transparent btn-hint"
|
||||
disabled={isSaving}
|
||||
on:click={() => reset()}
|
||||
>
|
||||
|
||||
@@ -291,7 +291,7 @@
|
||||
{#if hasChanges}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary btn-hint"
|
||||
class="btn btn-transparent btn-hint"
|
||||
disabled={isSaving}
|
||||
on:click={() => reset()}
|
||||
>
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
{#if hasChanges}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary btn-hint"
|
||||
class="btn btn-transparent btn-hint"
|
||||
disabled={isSaving}
|
||||
on:click={() => reset()}
|
||||
>
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
|
||||
<div class="sidebar-title">
|
||||
<span class="txt">Sync</span>
|
||||
<small class="label label-danger label-sm">Experimental</small>
|
||||
</div>
|
||||
<a
|
||||
href="/settings/export-collections"
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
display: block;
|
||||
text-align: center;
|
||||
pointer-events: none;
|
||||
transition: left var(--activeAnimationSpeed);
|
||||
.alert {
|
||||
text-align: left;
|
||||
pointer-events: auto;
|
||||
@@ -112,10 +113,12 @@
|
||||
margin: var(--baseSpacing) auto;
|
||||
@include shadowize();
|
||||
}
|
||||
.app-sidebar ~ .app-body & {
|
||||
}
|
||||
body:not(.overlay-active) {
|
||||
.app-sidebar ~ .app-body .toasts-wrapper {
|
||||
left: var(--appSidebarWidth);
|
||||
}
|
||||
.app-sidebar ~ .app-body .page-sidebar ~ & {
|
||||
.app-sidebar ~ .app-body .page-sidebar ~ .toasts-wrapper {
|
||||
left: calc(var(--appSidebarWidth) + var(--pageSidebarWidth));
|
||||
}
|
||||
}
|
||||
|
||||
+91
-9
@@ -192,7 +192,7 @@ a {
|
||||
.txt-ellipsis {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
flex-shrink: 0;
|
||||
flex-shrink: 1;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
@@ -329,6 +329,7 @@ a,
|
||||
|
||||
.content {
|
||||
@extend %block;
|
||||
min-width: 0;
|
||||
& > :first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
@@ -369,6 +370,7 @@ a,
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
gap: var(--smSpacing);
|
||||
}
|
||||
.flex-fill {
|
||||
@@ -447,22 +449,33 @@ a,
|
||||
}
|
||||
|
||||
.label {
|
||||
--labelVPadding: 3px;
|
||||
--labelHPadding: 8px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 5px;
|
||||
line-height: 1;
|
||||
padding: 3px 8px;
|
||||
padding: var(--labelVPadding) var(--labelHPadding);
|
||||
min-height: 23px;
|
||||
max-width: 100%;
|
||||
text-align: center;
|
||||
font-size: var(--smFontSize);
|
||||
line-height: var(--smLineHeight);
|
||||
border-radius: 30px;
|
||||
background: var(--baseAlt2Color);
|
||||
color: var(--txtPrimaryColor);
|
||||
white-space: nowrap;
|
||||
|
||||
.btn:last-child {
|
||||
margin-right: calc(-0.5 * var(--labelHPadding));
|
||||
}
|
||||
.btn:first-child {
|
||||
margin-left: calc(-0.5 * var(--labelHPadding));
|
||||
}
|
||||
|
||||
// styles
|
||||
&.label-sm {
|
||||
--labelHPadding: 5px;
|
||||
font-size: var(--xsFontSize);
|
||||
padding: 3px 5px;
|
||||
min-height: 18px;
|
||||
line-height: 1;
|
||||
}
|
||||
@@ -609,6 +622,7 @@ a.thumb:not(.thumb-active) {
|
||||
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
vertical-align: top;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -695,6 +709,8 @@ a.thumb:not(.thumb-active) {
|
||||
.list {
|
||||
@extend %block;
|
||||
position: relative;
|
||||
overflow: auto; /* fallback */
|
||||
overflow: overlay;
|
||||
border: 1px solid var(--baseAlt2Color);
|
||||
border-radius: var(--baseRadius);
|
||||
.list-item {
|
||||
@@ -703,11 +719,77 @@ a.thumb:not(.thumb-active) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
gap: 10px;
|
||||
padding: 10px;
|
||||
border-bottom: 1px solid var(--baseAlt2Color);
|
||||
gap: var(--xsSpacing);
|
||||
outline: 0;
|
||||
padding: 10px var(--xsSpacing);
|
||||
min-height: 50px;
|
||||
border-top: 1px solid var(--baseAlt2Color);
|
||||
transition: background var(--baseAnimationSpeed);
|
||||
&:first-child {
|
||||
border-top: 0;
|
||||
}
|
||||
&:last-child {
|
||||
border-bottom: 0;
|
||||
border-radius: inherit;
|
||||
}
|
||||
.content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
user-select: text;
|
||||
}
|
||||
.actions {
|
||||
margin-left: auto;
|
||||
gap: 10px;
|
||||
flex-shrink: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
margin: -1px -5px -1px 0;
|
||||
&.nonintrusive {
|
||||
@include hide();
|
||||
transform: translateX(5px);
|
||||
transition: transform var(--baseAnimationSpeed),
|
||||
opacity var(--baseAnimationSpeed),
|
||||
visibility var(--baseAnimationSpeed);
|
||||
}
|
||||
}
|
||||
&:hover,
|
||||
&:active {
|
||||
.actions.nonintrusive {
|
||||
@include show();
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
// styles
|
||||
&.selected {
|
||||
background: var(--bodyColor);
|
||||
}
|
||||
&.handle:not(.disabled) {
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
&:hover,
|
||||
&:focus-visible {
|
||||
background: var(--baseAlt1Color);
|
||||
}
|
||||
&:active {
|
||||
background: var(--baseAlt2Color);
|
||||
}
|
||||
}
|
||||
&.disabled:not(.selected) {
|
||||
cursor: default;
|
||||
opacity: 0.6;
|
||||
}
|
||||
}
|
||||
|
||||
.list-item-btn {
|
||||
padding: 5px;
|
||||
min-height: auto;
|
||||
}
|
||||
|
||||
&.list-compact {
|
||||
.list-item {
|
||||
min-height: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
}
|
||||
|
||||
// states
|
||||
&:focus,
|
||||
&:focus-visible,
|
||||
&:hover {
|
||||
background: var(--baseAlt1Color);
|
||||
}
|
||||
|
||||
+55
-49
@@ -112,31 +112,38 @@ button {
|
||||
border: 2px solid currentColor;
|
||||
background: #fff;
|
||||
}
|
||||
&.btn-secondary,
|
||||
&.btn-outline {
|
||||
box-shadow: none;
|
||||
color: var(--txtPrimaryColor);
|
||||
|
||||
@mixin btnOpacity($base: 1, $hover: 1, $active: 1) {
|
||||
&:before {
|
||||
opacity: 0;
|
||||
background: var(--baseAlt4Color);
|
||||
opacity: $base;
|
||||
}
|
||||
&:focus-visible,
|
||||
&:hover,
|
||||
&:active,
|
||||
&.active {
|
||||
&:hover {
|
||||
&:before {
|
||||
opacity: 0.11;
|
||||
opacity: $hover;
|
||||
}
|
||||
}
|
||||
&.active,
|
||||
&:active {
|
||||
&:before {
|
||||
opacity: 0.22;
|
||||
opacity: $active;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.btn-secondary,
|
||||
&.btn-transparent,
|
||||
&.btn-outline {
|
||||
box-shadow: none;
|
||||
color: var(--txtPrimaryColor);
|
||||
@include btnOpacity(0, 0.25, 0.35);
|
||||
&:before {
|
||||
background: var(--baseAlt3Color);
|
||||
}
|
||||
@each $name, $color in $variationsMap {
|
||||
&.btn-#{$name} {
|
||||
color: $color;
|
||||
@include btnOpacity(0, 0.15, 0.25);
|
||||
&:before {
|
||||
background: $color;
|
||||
}
|
||||
@@ -144,6 +151,20 @@ button {
|
||||
}
|
||||
&.btn-hint {
|
||||
color: var(--txtHintColor);
|
||||
&:focus-visible,
|
||||
&:hover,
|
||||
&:active,
|
||||
&.active {
|
||||
color: var(--txtPrimaryColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
&.btn-secondary {
|
||||
@include btnOpacity(0.3, 0.5, 0.7);
|
||||
@each $name, $color in $variationsMap {
|
||||
&.btn-#{$name} {
|
||||
@include btnOpacity(0.15, 0.25, 0.3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +178,7 @@ button {
|
||||
&:before {
|
||||
display: none;
|
||||
}
|
||||
&.btn-secondary {
|
||||
&.btn-transparent {
|
||||
background: none;
|
||||
}
|
||||
&.btn-outline {
|
||||
@@ -167,7 +188,7 @@ button {
|
||||
|
||||
// sizes
|
||||
&.btn-expanded {
|
||||
min-width: 140px;
|
||||
min-width: 150px;
|
||||
}
|
||||
&.btn-expanded-sm {
|
||||
min-width: 90px;
|
||||
@@ -231,7 +252,7 @@ button {
|
||||
padding: 0;
|
||||
gap: 0;
|
||||
i {
|
||||
$iconSize: 24px;
|
||||
$iconSize: 19px;
|
||||
font-size: 1.2857rem;
|
||||
text-align: center;
|
||||
width: $iconSize;
|
||||
@@ -242,10 +263,12 @@ button {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
&.btn-sm i,
|
||||
&.btn-xs i {
|
||||
&.btn-sm i {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
&.btn-xs i {
|
||||
font-size: 1.05rem;
|
||||
}
|
||||
}
|
||||
|
||||
// loading
|
||||
@@ -1025,51 +1048,34 @@ select {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.form-field-file {
|
||||
.form-field-list {
|
||||
label {
|
||||
border-bottom: 0;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.filename {
|
||||
align-items: center;
|
||||
max-width: 100%;
|
||||
min-width: 0;
|
||||
margin-right: auto;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
i {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
.files-list {
|
||||
@extend %block;
|
||||
padding-top: 5px;
|
||||
.list {
|
||||
background: var(--baseAlt1Color);
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
border-bottom-left-radius: var(--baseRadius);
|
||||
border-bottom-right-radius: var(--baseRadius);
|
||||
transition: background var(--baseAnimationSpeed);
|
||||
.list-item {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
row-gap: 10px;
|
||||
column-gap: var(--xsSpacing);
|
||||
padding: 10px 15px;
|
||||
min-height: 44px;
|
||||
border-top: 1px solid var(--baseAlt2Color);
|
||||
&:last-child {
|
||||
border-radius: inherit;
|
||||
border-bottom: 0;
|
||||
&.selected {
|
||||
background: var(--baseAlt2Color);
|
||||
}
|
||||
&.handle:not(.disabled) {
|
||||
&:hover,
|
||||
&:focus-visible {
|
||||
background: var(--baseAlt2Color);
|
||||
}
|
||||
&:active {
|
||||
background: var(--baseAlt3Color);
|
||||
}
|
||||
}
|
||||
}
|
||||
.btn-list-item {
|
||||
padding: 5px;
|
||||
}
|
||||
}
|
||||
&:focus-within {
|
||||
.files-list, label {
|
||||
.list, label {
|
||||
background: var(--baseAlt1Color);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
width: 100%;
|
||||
flex-grow: 1;
|
||||
padding: 5px 7px;
|
||||
margin: 0 0 var(--smSpacing);
|
||||
margin: 0;
|
||||
white-space: nowrap;
|
||||
color: var(--txtHintColor);
|
||||
background: var(--baseAlt1Color);
|
||||
@@ -58,17 +58,3 @@
|
||||
background: var(--baseAlt2Color);
|
||||
}
|
||||
}
|
||||
|
||||
.searchbar-wrapper {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;;
|
||||
min-width: var(--btnHeight);
|
||||
min-height: var(--btnHeight);
|
||||
.search-toggle {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@ table {
|
||||
line-height: 1;
|
||||
text-align: left;
|
||||
}
|
||||
.txt-ellipsis {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
td, th {
|
||||
outline: 0;
|
||||
vertical-align: middle;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
transform var(--baseAnimationSpeed);
|
||||
transform: scale(0.98);
|
||||
white-space: pre-line;
|
||||
word-break: break-all;
|
||||
@include hide();
|
||||
|
||||
// styles
|
||||
|
||||
@@ -14,19 +14,19 @@
|
||||
--baseColor: #ffffff;
|
||||
--baseAlt1Color: #ebeff2;
|
||||
--baseAlt2Color: #dee3e8;
|
||||
--baseAlt3Color: #a9b4bc;
|
||||
--baseAlt4Color: #7c868d;
|
||||
--baseAlt3Color: #d1d7db;
|
||||
--baseAlt4Color: #848d94;
|
||||
|
||||
--infoColor: #3da9fc;
|
||||
--infoAltColor: #d8eefe;
|
||||
--successColor: #2cb67d;
|
||||
--successAltColor: #d6f5e8;
|
||||
--dangerColor: #ef4565;
|
||||
--dangerColor: #e13756;
|
||||
--dangerAltColor: #fcdee4;
|
||||
--warningColor: #ff8e3c;
|
||||
--warningAltColor: #ffe7d6;
|
||||
|
||||
--overlayColor: rgba(65, 80, 105, 0.25);
|
||||
--overlayColor: rgba(60, 70, 105, 0.25);
|
||||
--tooltipColor: rgba(0, 0, 0, 0.85);
|
||||
--shadowColor: rgba(0, 0, 0, 0.06);
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
--inputHeight: 34px;
|
||||
|
||||
--btnHeight: 40px;
|
||||
--xsBtnHeight: 24px;
|
||||
--xsBtnHeight: 22px;
|
||||
--smBtnHeight: 30px;
|
||||
--lgBtnHeight: 54px;
|
||||
|
||||
|
||||
@@ -51,26 +51,24 @@ export function removeCollection(collection) {
|
||||
export async function loadCollections(activeId = null) {
|
||||
isCollectionsLoading.set(true);
|
||||
|
||||
activeCollection.set({});
|
||||
collections.set([]);
|
||||
|
||||
return ApiClient.collections.getFullList(200, {
|
||||
"sort": "+created",
|
||||
})
|
||||
.then((items) => {
|
||||
collections.set(CommonHelper.sortCollections(items));
|
||||
|
||||
const item = activeId && CommonHelper.findByKey(items, "id", activeId);
|
||||
if (item) {
|
||||
activeCollection.set(item);
|
||||
} else if (items.length) {
|
||||
activeCollection.set(items[0]);
|
||||
}
|
||||
try {
|
||||
let items = await ApiClient.collections.getFullList(200, {
|
||||
"sort": "+created",
|
||||
})
|
||||
.catch((err) => {
|
||||
ApiClient.errorResponseHandler(err);
|
||||
})
|
||||
.finally(() => {
|
||||
isCollectionsLoading.set(false);
|
||||
});
|
||||
|
||||
items = CommonHelper.sortCollections(items);
|
||||
|
||||
collections.set(items);
|
||||
|
||||
const item = activeId && CommonHelper.findByKey(items, "id", activeId);
|
||||
if (item) {
|
||||
activeCollection.set(item);
|
||||
} else if (items.length) {
|
||||
activeCollection.set(items[0]);
|
||||
}
|
||||
} catch (err) {
|
||||
ApiClient.errorResponseHandler(err);
|
||||
}
|
||||
|
||||
isCollectionsLoading.set(false);
|
||||
}
|
||||
|
||||
+105
-12
@@ -108,7 +108,7 @@ export default class CommonHelper {
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes and returns arr as a valid array instance (if not already).
|
||||
* Normalizes and returns arr as a new array instance.
|
||||
*
|
||||
* @param {Array} arr
|
||||
* @param {Boolean} [allowEmpty]
|
||||
@@ -116,7 +116,7 @@ export default class CommonHelper {
|
||||
*/
|
||||
static toArray(arr, allowEmpty = false) {
|
||||
if (Array.isArray(arr)) {
|
||||
return arr;
|
||||
return arr.slice();
|
||||
}
|
||||
|
||||
return (allowEmpty || !CommonHelper.isEmpty(arr)) && typeof arr !== "undefined" ? [arr] : [];
|
||||
@@ -230,10 +230,9 @@ export default class CommonHelper {
|
||||
/**
|
||||
* Adds or replace an object array element by comparing its key value.
|
||||
*
|
||||
* @param {Array} objectsArr
|
||||
* @param {Object} item
|
||||
* @param {Mixed} [key]
|
||||
* @return {Array}
|
||||
* @param {Array} objectsArr
|
||||
* @param {Object} item
|
||||
* @param {Mixed} [key]
|
||||
*/
|
||||
static pushOrReplaceByKey(objectsArr, item, key = "id") {
|
||||
for (let i = objectsArr.length - 1; i >= 0; i--) {
|
||||
@@ -473,6 +472,45 @@ export default class CommonHelper {
|
||||
return (doc.body.innerText || "").trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* Truncates the provided text to the specified max characters length.
|
||||
*
|
||||
* @param {String} str
|
||||
* @param {Number} length
|
||||
* @return {String}
|
||||
*/
|
||||
static truncate(str, length = 150, dots = false) {
|
||||
str = str || "";
|
||||
|
||||
if (str.length <= length) {
|
||||
return str;
|
||||
}
|
||||
|
||||
return str.substring(0, length) + (dots ? "..." : "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new object copy with truncated the large text fields.
|
||||
*
|
||||
* @param {Object} obj
|
||||
* @return {Object}
|
||||
*/
|
||||
static truncateObject(obj) {
|
||||
const truncated = {};
|
||||
|
||||
for (let key in obj) {
|
||||
let value = obj[key];
|
||||
|
||||
if (typeof value === 'string') {
|
||||
value = CommonHelper.truncate(value, 150, true);
|
||||
}
|
||||
|
||||
truncated[key] = value;
|
||||
}
|
||||
|
||||
return truncated;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes and converts the provided string to a slug.
|
||||
*
|
||||
@@ -1112,13 +1150,13 @@ export default class CommonHelper {
|
||||
const singleCollections = [];
|
||||
const baseCollections = [];
|
||||
|
||||
for (const colelction of collections) {
|
||||
if (colelction.type == 'auth') {
|
||||
authCollections.push(colelction);
|
||||
} else if (colelction.type == 'single') {
|
||||
singleCollections.push(colelction);
|
||||
for (const collection of collections) {
|
||||
if (collection.type === 'auth') {
|
||||
authCollections.push(collection);
|
||||
} else if (collection.type === 'single') {
|
||||
singleCollections.push(collection);
|
||||
} else {
|
||||
baseCollections.push(colelction);
|
||||
baseCollections.push(collection);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1222,4 +1260,59 @@ export default class CommonHelper {
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to output the first displayable field of the provided model.
|
||||
*
|
||||
* @param {Object} model
|
||||
* @return {String}
|
||||
*/
|
||||
static displayValue(model, displayFields) {
|
||||
model = model || {};
|
||||
displayFields = displayFields || [];
|
||||
|
||||
let result = [];
|
||||
|
||||
for (const field of displayFields) {
|
||||
let val = model[field];
|
||||
|
||||
if (typeof val === "undefined") {
|
||||
continue
|
||||
}
|
||||
|
||||
if (CommonHelper.isEmpty(val)) {
|
||||
result.push("N/A");
|
||||
} else if (typeof val === "boolean") {
|
||||
result.push(val ? "True" : "False");
|
||||
} else if (typeof val === "string") {
|
||||
val = val.indexOf("<") >= 0 ? CommonHelper.plainText(val) : val;
|
||||
result.push(CommonHelper.truncate(val));
|
||||
} else {
|
||||
result.push(val);
|
||||
}
|
||||
}
|
||||
|
||||
if (result.length > 0) {
|
||||
return result.join(", ");
|
||||
}
|
||||
|
||||
const fallbackProps = [
|
||||
"title",
|
||||
"name",
|
||||
"email",
|
||||
"username",
|
||||
"heading",
|
||||
"label",
|
||||
"key",
|
||||
"id",
|
||||
];
|
||||
|
||||
for (const prop of fallbackProps) {
|
||||
if (!CommonHelper.isEmpty(model[prop])) {
|
||||
return model[prop];
|
||||
}
|
||||
}
|
||||
|
||||
return "N/A";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user