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