import{S as Ue,i as je,s as xe,N as Qe,e as s,w as k,b as p,c as J,f as b,g as d,h as o,m as K,x as ce,O as He,P as Je,k as Ke,Q as Ie,n as We,t as N,a as V,o as u,d as I,C as Ee,p as Ge,r as W,u as Xe}from"./index-d577ac2a.js";import{S as Ye}from"./SdkTabs-7ce69c38.js";import{F as Ze}from"./FieldsQueryParam-23e11274.js";function Le(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l){let a,n=l[5].code+"",m,_,i,f;function v(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),W(a,"active",l[1]===l[5].code),this.first=a},m($,w){d($,a,w),o(a,m),o(a,_),i||(f=Xe(a,"click",v),i=!0)},p($,w){l=$,w&4&&n!==(n=l[5].code+"")&&ce(m,n),w&6&&W(a,"active",l[1]===l[5].code)},d($){$&&u(a),i=!1,f()}}}function ze(r,l){let a,n,m,_;return n=new Qe({props:{content:l[5].body}}),{key:r,first:null,c(){a=s("div"),J(n.$$.fragment),m=p(),b(a,"class","tab-item"),W(a,"active",l[1]===l[5].code),this.first=a},m(i,f){d(i,a,f),K(n,a,null),o(a,m),_=!0},p(i,f){l=i;const v={};f&4&&(v.content=l[5].body),n.$set(v),(!_||f&6)&&W(a,"active",l[1]===l[5].code)},i(i){_||(N(n.$$.fragment,i),_=!0)},o(i){V(n.$$.fragment,i),_=!1},d(i){i&&u(a),I(n)}}}function et(r){var qe,De;let l,a,n=r[0].name+"",m,_,i,f,v,$,w,M,G,S,z,de,Q,q,ue,X,U=r[0].name+"",Y,pe,fe,j,Z,D,ee,T,te,he,F,C,oe,be,le,me,h,_e,R,ke,ve,$e,ae,ge,se,ye,Se,we,ne,Te,Ce,A,re,O,ie,P,H,y=[],Pe=new Map,Re,E,g=[],Ae=new Map,B;$=new Ye({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${r[3]}'); ... const authData = await pb.collection('${(qe=r[0])==null?void 0:qe.name}').authRefresh(); // after the above you can also access the refreshed auth data from the authStore console.log(pb.authStore.isValid); console.log(pb.authStore.token); console.log(pb.authStore.model.id); `,dart:` import 'package:pocketbase/pocketbase.dart'; final pb = PocketBase('${r[3]}'); ... final authData = await pb.collection('${(De=r[0])==null?void 0:De.name}').authRefresh(); // after the above you can also access the refreshed auth data from the authStore print(pb.authStore.isValid); print(pb.authStore.token); print(pb.authStore.model.id); `}}),R=new Qe({props:{content:"?expand=relField1,relField2.subRelField"}}),A=new Ze({});let x=r[2];const Be=e=>e[5].code;for(let e=0;ee[5].code;for(let e=0;eReturns a new auth response (token and record data) for an already authenticated record.

This method is usually called by users on page/screen reload to ensure that the previously stored data in pb.authStore is still valid and up-to-date.

`,v=p(),J($.$$.fragment),w=p(),M=s("h6"),M.textContent="API details",G=p(),S=s("div"),z=s("strong"),z.textContent="POST",de=p(),Q=s("div"),q=s("p"),ue=k("/api/collections/"),X=s("strong"),Y=k(U),pe=k("/auth-refresh"),fe=p(),j=s("p"),j.innerHTML="Requires record Authorization:TOKEN header",Z=p(),D=s("div"),D.textContent="Query parameters",ee=p(),T=s("table"),te=s("thead"),te.innerHTML=`Param Type Description`,he=p(),F=s("tbody"),C=s("tr"),oe=s("td"),oe.textContent="expand",be=p(),le=s("td"),le.innerHTML='String',me=p(),h=s("td"),_e=k(`Auto expand record relations. Ex.: `),J(R.$$.fragment),ke=k(` Supports up to 6-levels depth nested relations expansion. `),ve=s("br"),$e=k(` The expanded relations will be appended to the record under the `),ae=s("code"),ae.textContent="expand",ge=k(" property (eg. "),se=s("code"),se.textContent='"expand": {"relField1": {...}, ...}',ye=k(`). `),Se=s("br"),we=k(` Only the relations to which the request user has permissions to `),ne=s("strong"),ne.textContent="view",Te=k(" will be expanded."),Ce=p(),J(A.$$.fragment),re=p(),O=s("div"),O.textContent="Responses",ie=p(),P=s("div"),H=s("div");for(let e=0;ea(1,_=v.code);return r.$$set=v=>{"collection"in v&&a(0,m=v.collection)},r.$$.update=()=>{r.$$.dirty&1&&a(2,i=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:Ee.dummyCollectionRecord(m)},null,2)},{code:401,body:` { "code": 401, "message": "The request requires valid record authorization token to be set.", "data": {} } `},{code:403,body:` { "code": 403, "message": "The authorized record model is not allowed to perform this action.", "data": {} } `},{code:404,body:` { "code": 404, "message": "Missing auth record context.", "data": {} } `}])},a(3,n=Ee.getApiExampleUrl(Ge.baseUrl)),[m,_,i,n,f]}class st extends Ue{constructor(l){super(),je(this,l,tt,et,xe,{collection:0})}}export{st as default};