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