2025-03-16 16:43:21 +08:00
import { S as Ot , i as St , s as $t , V as Mt , J as x , X as ie , W as Tt , h as o , d as ve , t as he , a as ye , I as te , Z as Je , _ as bt , C as qt , $ as Rt , D as Dt , l as r , n , m as we , u as i , A as h , v as f , c as Ce , w as k , p as Ht , k as Te , o as Lt , H as de } from "./index-CVqXRFk8.js" ; import { F as Pt } from "./FieldsQueryParam-B6maRWKB.js" ; function mt ( d , e , t ) { const a = d . slice ( ) ; return a [ 10 ] = e [ t ] , a } function _t ( d , e , t ) { const a = d . slice ( ) ; return a [ 10 ] = e [ t ] , a } function ht ( d , e , t ) { const a = d . slice ( ) ; return a [ 15 ] = e [ t ] , a } function yt ( d ) { let e ; return { c ( ) { e = i ( "p" ) , e . innerHTML = ` <em>Note that in case of a password change all previously issued tokens for the current record
2024-09-30 00:23:19 +08:00
will be automatically invalidated and if you want your user to remain signed in you need to
2025-02-08 14:47:01 +08:00
reauthenticate manually after the update call . < / e m > ` } , m ( t , a ) { r ( t , e , a ) } , d ( t ) { t & & o ( e ) } } } f u n c t i o n k t ( d ) { l e t e ; r e t u r n { c ( ) { e = i ( " p " ) , e . i n n e r H T M L = " R e q u i r e s s u p e r u s e r < c o d e > A u t h o r i z a t i o n : T O K E N < / c o d e > h e a d e r " , k ( e , " c l a s s " , " t x t - h i n t t x t - s m t x t - r i g h t " ) } , m ( t , a ) { r ( t , e , a ) } , d ( t ) { t & & o ( e ) } } } f u n c t i o n g t ( d ) { l e t e , t , a , m , p , c , u , b , O , T , $ , D , S , E , q , H , J , I , M , R , L , g , v , w ; f u n c t i o n Q ( _ , C ) { v a r l e , z , n e ; r e t u r n C & 1 & & ( b = n u l l ) , b = = n u l l & & ( b = ! ! ( ( n e = ( z = ( l e = _ [ 0 ] ) = = n u l l ? v o i d 0 : l e . f i e l d s ) = = n u l l ? v o i d 0 : z . f i n d ( W t ) ) ! = n u l l & & n e . r e q u i r e d ) ) , b ? B t : F t } l e t W = Q ( d , - 1 ) , F = W ( d ) ; r e t u r n { c ( ) { e = i ( " t r " ) , e . i n n e r H T M L = ' < t d c o l s p a n = " 3 " c l a s s = " t x t - h i n t t x t - b o l d " > A u t h s p e c i f i c f i e l d s < / t d > ' , t = f ( ) , a = i ( " t r " ) , a . i n n e r H T M L = ` < t d > < d i v c l a s s = " i n l i n e - f l e x " > < s p a n c l a s s = " l a b e l l a b e l - w a r n i n g " > O p t i o n a l < / s p a n > < s p a n > e m a i l < / s p a n > < / d i v > < / t d > < t d > < s p a n c l a s s = " l a b e l " > S t r i n g < / s p a n > < / t d > < t d > T h e a u t h r e c o r d e m a i l a d d r e s s .
2024-09-30 00:23:19 +08:00
< br / >
This field can be updated only by superusers or auth records with & quot ; Manage & quot ; access .
< br / >
2025-02-08 14:47:01 +08:00
Regular accounts can update their email by calling & quot ; Request email change & quot ; . < / t d > ` , m = f ( ) , p = i ( " t r " ) , c = i ( " t d " ) , u = i ( " d i v " ) , F . c ( ) , O = f ( ) , T = i ( " s p a n " ) , T . t e x t C o n t e n t = " e m a i l V i s i b i l i t y " , $ = f ( ) , D = i ( " t d " ) , D . i n n e r H T M L = ' < s p a n c l a s s = " l a b e l " > B o o l e a n < / s p a n > ' , S = f ( ) , E = i ( " t d " ) , E . t e x t C o n t e n t = " W h e t h e r t o s h o w / h i d e t h e a u t h r e c o r d e m a i l w h e n f e t c h i n g t h e r e c o r d d a t a . " , q = f ( ) , H = i ( " t r " ) , H . i n n e r H T M L = ` < t d > < d i v c l a s s = " i n l i n e - f l e x " > < s p a n c l a s s = " l a b e l l a b e l - w a r n i n g " > O p t i o n a l < / s p a n > < s p a n > o l d P a s s w o r d < / s p a n > < / d i v > < / t d > < t d > < s p a n c l a s s = " l a b e l " > S t r i n g < / s p a n > < / t d > < t d > O l d a u t h r e c o r d p a s s w o r d .
2024-09-30 00:23:19 +08:00
< br / >
This field is required only when changing the record password . Superusers and auth records
2025-02-08 14:47:01 +08:00
with & quot ; Manage & quot ; access can skip this field . < / t d > ` , J = f ( ) , I = i ( " t r " ) , I . i n n e r H T M L = ' < t d > < d i v c l a s s = " i n l i n e - f l e x " > < s p a n c l a s s = " l a b e l l a b e l - w a r n i n g " > O p t i o n a l < / s p a n > < s p a n > p a s s w o r d < / s p a n > < / d i v > < / t d > < t d > < s p a n c l a s s = " l a b e l " > S t r i n g < / s p a n > < / t d > < t d > N e w a u t h r e c o r d p a s s w o r d . < / t d > ' , M = f ( ) , R = i ( " t r " ) , R . i n n e r H T M L = ' < t d > < d i v c l a s s = " i n l i n e - f l e x " > < s p a n c l a s s = " l a b e l l a b e l - w a r n i n g " > O p t i o n a l < / s p a n > < s p a n > p a s s w o r d C o n f i r m < / s p a n > < / d i v > < / t d > < t d > < s p a n c l a s s = " l a b e l " > S t r i n g < / s p a n > < / t d > < t d > N e w a u t h r e c o r d p a s s w o r d c o n f i r m a t i o n . < / t d > ' , L = f ( ) , g = i ( " t r " ) , g . i n n e r H T M L = ` < t d > < d i v c l a s s = " i n l i n e - f l e x " > < s p a n c l a s s = " l a b e l l a b e l - w a r n i n g " > O p t i o n a l < / s p a n > < s p a n > v e r i f i e d < / s p a n > < / d i v > < / t d > < t d > < s p a n c l a s s = " l a b e l " > B o o l e a n < / s p a n > < / t d > < t d > I n d i c a t e s w h e t h e r t h e a u t h r e c o r d i s v e r i f i e d o r n o t .
2024-09-30 00:23:19 +08:00
< br / >
2025-02-08 14:47:01 +08:00
This field can be set only by superusers or auth records with & quot ; Manage & quot ; access . < / t d > ` , v = f ( ) , w = i ( " t r " ) , w . i n n e r H T M L = ' < t d c o l s p a n = " 3 " c l a s s = " t x t - h i n t t x t - b o l d " > O t h e r f i e l d s < / t d > ' , k ( u , " c l a s s " , " i n l i n e - f l e x " ) } , m ( _ , C ) { r ( _ , e , C ) , r ( _ , t , C ) , r ( _ , a , C ) , r ( _ , m , C ) , r ( _ , p , C ) , n ( p , c ) , n ( c , u ) , F . m ( u , n u l l ) , n ( u , O ) , n ( u , T ) , n ( p , $ ) , n ( p , D ) , n ( p , S ) , n ( p , E ) , r ( _ , q , C ) , r ( _ , H , C ) , r ( _ , J , C ) , r ( _ , I , C ) , r ( _ , M , C ) , r ( _ , R , C ) , r ( _ , L , C ) , r ( _ , g , C ) , r ( _ , v , C ) , r ( _ , w , C ) } , p ( _ , C ) { W ! = = ( W = Q ( _ , C ) ) & & ( F . d ( 1 ) , F = W ( _ ) , F & & ( F . c ( ) , F . m ( u , O ) ) ) } , d ( _ ) { _ & & ( o ( e ) , o ( t ) , o ( a ) , o ( m ) , o ( p ) , o ( q ) , o ( H ) , o ( J ) , o ( I ) , o ( M ) , o ( R ) , o ( L ) , o ( g ) , o ( v ) , o ( w ) ) , F . d ( ) } } } f u n c t i o n F t ( d ) { l e t e ; r e t u r n { c ( ) { e = i ( " s p a n " ) , e . t e x t C o n t e n t = " O p t i o n a l " , k ( e , " c l a s s " , " l a b e l l a b e l - w a r n i n g " ) } , m ( t , a ) { r ( t , e , a ) } , d ( t ) { t & & o ( e ) } } } f u n c t i o n B t ( d ) { l e t e ; r e t u r n { c ( ) { e = i ( " s p a n " ) , e . t e x t C o n t e n t = " R e q u i r e d " , k ( e , " c l a s s " , " l a b e l l a b e l - s u c c e s s " ) } , m ( t , a ) { r ( t , e , a ) } , d ( t ) { t & & o ( e ) } } } f u n c t i o n N t ( d ) { l e t e ; r e t u r n { c ( ) { e = i ( " s p a n " ) , e . t e x t C o n t e n t = " O p t i o n a l " , k ( e , " c l a s s " , " l a b e l l a b e l - w a r n i n g " ) } , m ( t , a ) { r ( t , e , a ) } , d ( t ) { t & & o ( e ) } } } f u n c t i o n j t ( d ) { l e t e ; r e t u r n { c ( ) { e = i ( " s p a n " ) , e . t e x t C o n t e n t = " R e q u i r e d " , k ( e , " c l a s s " , " l a b e l l a b e l - s u c c e s s " ) } , m ( t , a ) { r ( t , e , a ) } , d ( t ) { t & & o ( e ) } } } f u n c t i o n A t ( d ) { l e t e , t = d [ 1 5 ] . m a x S e l e c t = = 1 ? " i d " : " i d s " , a , m ; r e t u r n { c ( ) { e = h ( " R e l a t i o n r e c o r d " ) , a = h ( t ) , m = h ( " . " ) } , m ( p , c ) { r ( p , e , c ) , r ( p , a , c ) , r ( p , m , c ) } , p ( p , c ) { c & 6 4 & & t ! = = ( t = p [ 1 5 ] . m a x S e l e c t = = 1 ? " i d " : " i d s " ) & & t e ( a , t ) } , d ( p ) { p & & ( o ( e ) , o ( a ) , o ( m ) ) } } } f u n c t i o n E t ( d ) { l e t e , t , a , m , p ; r e t u r n { c ( ) { e = h ( " F i l e o b j e c t . " ) , t = i ( " b r " ) , a = h ( `
Set to ` ),m=i("code"),m.textContent="null",p=h(" to delete already uploaded file(s).")},m(c,u){r(c,e,u),r(c,t,u),r(c,a,u),r(c,m,u),r(c,p,u)},p:de,d(c){c&&(o(e),o(t),o(a),o(m),o(p))}}}function It(d){let e;return{c(){e=h("URL address.")},m(t,a){r(t,e,a)},p:de,d(t){t&&o(e)}}}function Jt(d){let e;return{c(){e=h("Email address.")},m(t,a){r(t,e,a)},p:de,d(t){t&&o(e)}}}function Ut(d){let e;return{c(){e=h("JSON array or object.")},m(t,a){r(t,e,a)},p:de,d(t){t&&o(e)}}}function Vt(d){let e;return{c(){e=h("Number value.")},m(t,a){r(t,e,a)},p:de,d(t){t&&o(e)}}}function xt(d){let e;return{c(){e=h("Plain text value.")},m(t,a){r(t,e,a)},p:de,d(t){t&&o(e)}}}function vt(d,e){let t,a,m,p,c,u=e[15].name+"",b,O,T, $ ,D=x.getFieldValueType(e[15])+"",S,E,q,H;function J(v,w){return v[15].required?jt:Nt}let I=J(e),M=I(e);function R(v,w){if(v[15].type==="text")return xt;if(v[15].type==="number")return Vt;if(v[15].type==="json")return Ut;if(v[15].type==="email")return Jt;if(v[15].type==="url")return It;if(v[15].type==="file")return Et;if(v[15].type==="relation")return At}let L=R(e),g=L&&L(e);return{key:d,first:null,c(){t=i("tr"),a=i("td"),m=i("div"),M.c(),p=f(),c=i("span"),b=h(u),O=f(),T=i("td"), $ =i("span"),S=h(D),E=f(),q=i("td"),g&&g.c(),H=f(),k(m,"class","inline-flex"),k( $ ,"class","label"),this.first=t},m(v,w){r(v,t,w),n(t,a),n(a,m),M.m(m,null),n(m,p),n(m,c),n(c,b),n(t,O),n(t,T),n(T, $ ),n( $ ,S),n(t,E),n(t,q),g&&g.m(q,null),n(t,H)},p(v,w){e=v,I!==(I=J(e))&&(M.d(1),M=I(e),M&&(M.c(),M.m(m,p))),w&64&&u!==(u=e[15].name+"")&&te(b,u),w&64&&D!==(D=x.getFieldValueType(e[15])+"")&&te(S,D),L===(L=R(e))&&g?g.p(e,w):(g&&g.d(1),g=L&&L(e),g&&(g.c(),g.m(q,null)))},d(v){v&&o(t),M.d(),g&&g.d()}}}function wt(d,e){let t,a=e[10].code+"",m,p,c,u;function b(){return e[9](e[10])}return{key:d,first:null,c(){t=i("button"),m=h(a),p=f(),k(t,"class","tab-item"),Te(t,"active",e[2]===e[10].code),this.first=t},m(O,T){r(O,t,T),n(t,m),n(t,p),c||(u=Lt(t,"click",b),c=!0)},p(O,T){e=O,T&8&&a!==(a=e[10].code+"")&&te(m,a),T&12&&Te(t,"active",e[2]===e[10].code)},d(O){O&&o(t),c=!1,u()}}}function Ct(d,e){let t,a,m,p;return a=new Tt({props:{content:e[10].body}}),{key:d,first:null,c(){t=i("div"),Ce(a. $ $ .fragment),m=f(),k(t,"class","tab-item"),Te(t,"active",e[2]===e[10].code),this.first=t},m(c,u){r(c,t,u),we(a,t,null),n(t,m),p=!0},p(c,u){e=c;const b={};u&8&&(b.content=e[10].body),a. $ set(b),(!p||u&12)&&Te(t,"active",e[2]===e[10].code)},i(c){p||(ye(a. $ $ .fragment,c),p=!0)},o(c){he(a. $ $ .fragment,c),p=!1},d(c){c&&o(t),ve(a)}}}function Qt(d){var ct,ut;let e,t,a=d[0].name+"",m,p,c,u,b,O,T, $ =d[0].name+"",D,S,E,q,H,J,I,M,R,L,g,v,w,Q,W,F,_,C,le,z=d[0].name+"",ne,Ue,Oe,Ve,Se,oe, $ e,re,Me,ce,qe,K,Re,xe,X,De,U=[],Qe=new Map,He,ue,Le,Y,Pe,We,pe,Z,Fe,ze,Be,Ke,B,Xe,ae,Ye,Ze,Ge,Ne,et,je,tt,Ae,lt,nt,se,Ee,fe,Ie,G,be,V=[],at=new Map,st,me,N=[],it=new Map,ee,j=d[1]&&yt();R=new Mt({props:{js: `
2024-09-30 00:23:19 +08:00
import PocketBase from 'pocketbase' ;
const pb = new PocketBase ( '${d[5]}' ) ;
...
// example update data
const data = $ { JSON . stringify ( Object . assign ( { } , d [ 4 ] , x . dummyCollectionSchemaData ( d [ 0 ] , ! 0 ) ) , null , 4 ) } ;
const record = await pb . collection ( '${(ct=d[0])==null?void 0:ct.name}' ) . update ( 'RECORD_ID' , data ) ;
` ,dart: `
import 'package:pocketbase/pocketbase.dart' ;
final pb = PocketBase ( '${d[5]}' ) ;
...
// example update body
final body = < String , dynamic > $ { JSON . stringify ( Object . assign ( { } , d [ 4 ] , x . dummyCollectionSchemaData ( d [ 0 ] , ! 0 ) ) , null , 2 ) } ;
final record = await pb . collection ( '${(ut=d[0])==null?void 0:ut.name}' ) . update ( 'RECORD_ID' , body : body ) ;
2025-02-08 14:47:01 +08:00
` }});let A=d[7]&&kt(),P=d[1]&>(d),ke=ie(d[6]);const dt=l=>l[15].name;for(let l=0;l<ke.length;l+=1){let s=ht(d,ke,l),y=dt(s);Qe.set(y,U[l]=vt(y,s))}ae=new Tt({props:{content:"?expand=relField1,relField2.subRelField21"}}),se=new Pt({});let ge=ie(d[3]);const ot=l=>l[10].code;for(let l=0;l<ge.length;l+=1){let s=_t(d,ge,l),y=ot(s);at.set(y,V[l]=wt(y,s))}let _e=ie(d[3]);const rt=l=>l[10].code;for(let l=0;l<_e.length;l+=1){let s=mt(d,_e,l),y=rt(s);it.set(y,N[l]=Ct(y,s))}return{c(){e=i("h3"),t=h("Update ("),m=h(a),p=h(")"),c=f(),u=i("div"),b=i("p"),O=h("Update a single "),T=i("strong"),D=h( $ ),S=h(" record."),E=f(),q=i("p"),q.innerHTML= ` Body parameters could be sent as < code > application / json < / c o d e > o r
< code > multipart / form - data < / c o d e > . ` , H = f ( ) , J = i ( " p " ) , J . i n n e r H T M L = ` F i l e u p l o a d i s s u p p o r t e d o n l y v i a < c o d e > m u l t i p a r t / f o r m - d a t a < / c o d e > .
2024-09-30 00:23:19 +08:00
< br / >
For more info and examples you could check the detailed
2024-12-28 16:32:14 +08:00
< a href = "https://pocketbase.io/docs/files-handling" target = "_blank" rel = "noopener noreferrer" > Files upload and handling docs
2025-02-08 14:47:01 +08:00
< / a > . ` , I = f ( ) , j & & j . c ( ) , M = f ( ) , C e ( R . $ $ . f r a g m e n t ) , L = f ( ) , g = i ( " h 6 " ) , g . t e x t C o n t e n t = " A P I d e t a i l s " , v = f ( ) , w = i ( " d i v " ) , Q = i ( " s t r o n g " ) , Q . t e x t C o n t e n t = " P A T C H " , W = f ( ) , F = i ( " d i v " ) , _ = i ( " p " ) , C = h ( " / a p i / c o l l e c t i o n s / " ) , l e = i ( " s t r o n g " ) , n e = h ( z ) , U e = h ( " / r e c o r d s / " ) , O e = i ( " s t r o n g " ) , O e . t e x t C o n t e n t = " : i d " , V e = f ( ) , A & & A . c ( ) , S e = f ( ) , o e = i ( " d i v " ) , o e . t e x t C o n t e n t = " P a t h p a r a m e t e r s " , $ e = f ( ) , r e = i ( " t a b l e " ) , r e . i n n e r H T M L = ' < t h e a d > < t r > < t h > P a r a m < / t h > < t h > T y p e < / t h > < t h w i d t h = " 6 0 % " > D e s c r i p t i o n < / t h > < / t r > < / t h e a d > < t b o d y > < t r > < t d > i d < / t d > < t d > < s p a n c l a s s = " l a b e l " > S t r i n g < / s p a n > < / t d > < t d > I D o f t h e r e c o r d t o u p d a t e . < / t d > < / t r > < / t b o d y > ' , M e = f ( ) , c e = i ( " d i v " ) , c e . t e x t C o n t e n t = " B o d y P a r a m e t e r s " , q e = f ( ) , K = i ( " t a b l e " ) , R e = i ( " t h e a d " ) , R e . i n n e r H T M L = ' < t r > < t h > P a r a m < / t h > < t h > T y p e < / t h > < t h w i d t h = " 5 0 % " > D e s c r i p t i o n < / t h > < / t r > ' , x e = f ( ) , X = i ( " t b o d y " ) , P & & P . c ( ) , D e = f ( ) ; f o r ( l e t l = 0 ; l < U . l e n g t h ; l + = 1 ) U [ l ] . c ( ) ; H e = f ( ) , u e = i ( " d i v " ) , u e . t e x t C o n t e n t = " Q u e r y p a r a m e t e r s " , L e = f ( ) , Y = i ( " t a b l e " ) , P e = i ( " t h e a d " ) , P e . i n n e r H T M L = ' < t r > < t h > P a r a m < / t h > < t h > T y p e < / t h > < t h w i d t h = " 6 0 % " > D e s c r i p t i o n < / t h > < / t r > ' , W e = f ( ) , p e = i ( " t b o d y " ) , Z = i ( " t r " ) , F e = i ( " t d " ) , F e . t e x t C o n t e n t = " e x p a n d " , z e = f ( ) , B e = i ( " t d " ) , B e . i n n e r H T M L = ' < s p a n c l a s s = " l a b e l " > S t r i n g < / s p a n > ' , K e = f ( ) , B = i ( " t d " ) , X e = h ( ` A u t o e x p a n d r e l a t i o n s w h e n r e t u r n i n g t h e u p d a t e d r e c o r d . E x . :
` ),Ce(ae. $ $ .fragment),Ye=h( `
Supports up to 6 - levels depth nested relations expansion . ` ),Ze=i("br"),Ge=h( `
2024-09-30 00:23:19 +08:00
The expanded relations will be appended to the record under the
2025-02-08 14:47:01 +08:00
` ),Ne=i("code"),Ne.textContent="expand",et=h(" property (eg. "),je=i("code"),je.textContent='"expand": {"relField1": {...}, ...}',tt=h( ` ) . Only
the relations that the user has permissions to ` ),Ae=i("strong"),Ae.textContent="view",lt=h(" will be expanded."),nt=f(),Ce(se. $ $ .fragment),Ee=f(),fe=i("div"),fe.textContent="Responses",Ie=f(),G=i("div"),be=i("div");for(let l=0;l<V.length;l+=1)V[l].c();st=f(),me=i("div");for(let l=0;l<N.length;l+=1)N[l].c();k(e,"class","m-b-sm"),k(u,"class","content txt-lg m-b-sm"),k(g,"class","m-b-xs"),k(Q,"class","label label-primary"),k(F,"class","content"),k(w,"class","alert alert-warning"),k(oe,"class","section-title"),k(re,"class","table-compact table-border m-b-base"),k(ce,"class","section-title"),k(K,"class","table-compact table-border m-b-base"),k(ue,"class","section-title"),k(Y,"class","table-compact table-border m-b-lg"),k(fe,"class","section-title"),k(be,"class","tabs-header compact combined left"),k(me,"class","tabs-content"),k(G,"class","tabs")},m(l,s){r(l,e,s),n(e,t),n(e,m),n(e,p),r(l,c,s),r(l,u,s),n(u,b),n(b,O),n(b,T),n(T,D),n(b,S),n(u,E),n(u,q),n(u,H),n(u,J),n(u,I),j&&j.m(u,null),r(l,M,s),we(R,l,s),r(l,L,s),r(l,g,s),r(l,v,s),r(l,w,s),n(w,Q),n(w,W),n(w,F),n(F,_),n(_,C),n(_,le),n(le,ne),n(_,Ue),n(_,Oe),n(w,Ve),A&&A.m(w,null),r(l,Se,s),r(l,oe,s),r(l, $ e,s),r(l,re,s),r(l,Me,s),r(l,ce,s),r(l,qe,s),r(l,K,s),n(K,Re),n(K,xe),n(K,X),P&&P.m(X,null),n(X,De);for(let y=0;y<U.length;y+=1)U[y]&&U[y].m(X,null);r(l,He,s),r(l,ue,s),r(l,Le,s),r(l,Y,s),n(Y,Pe),n(Y,We),n(Y,pe),n(pe,Z),n(Z,Fe),n(Z,ze),n(Z,Be),n(Z,Ke),n(Z,B),n(B,Xe),we(ae,B,null),n(B,Ye),n(B,Ze),n(B,Ge),n(B,Ne),n(B,et),n(B,je),n(B,tt),n(B,Ae),n(B,lt),n(pe,nt),we(se,pe,null),r(l,Ee,s),r(l,fe,s),r(l,Ie,s),r(l,G,s),n(G,be);for(let y=0;y<V.length;y+=1)V[y]&&V[y].m(be,null);n(G,st),n(G,me);for(let y=0;y<N.length;y+=1)N[y]&&N[y].m(me,null);ee=!0},p(l,[s]){var pt,ft;(!ee||s&1)&&a!==(a=l[0].name+"")&&te(m,a),(!ee||s&1)&& $ !==( $ =l[0].name+"")&&te(D, $ ),l[1]?j||(j=yt(),j.c(),j.m(u,null)):j&&(j.d(1),j=null);const y={};s&49&&(y.js= `
2024-09-30 00:23:19 +08:00
import PocketBase from 'pocketbase' ;
const pb = new PocketBase ( '${l[5]}' ) ;
...
// example update data
const data = $ { JSON . stringify ( Object . assign ( { } , l [ 4 ] , x . dummyCollectionSchemaData ( l [ 0 ] , ! 0 ) ) , null , 4 ) } ;
const record = await pb . collection ( '${(pt=l[0])==null?void 0:pt.name}' ) . update ( 'RECORD_ID' , data ) ;
` ),s&49&&(y.dart= `
import 'package:pocketbase/pocketbase.dart' ;
final pb = PocketBase ( '${l[5]}' ) ;
...
// example update body
final body = < String , dynamic > $ { JSON . stringify ( Object . assign ( { } , l [ 4 ] , x . dummyCollectionSchemaData ( l [ 0 ] , ! 0 ) ) , null , 2 ) } ;
final record = await pb . collection ( '${(ft=l[0])==null?void 0:ft.name}' ) . update ( 'RECORD_ID' , body : body ) ;
2025-02-08 14:47:01 +08:00
` ),R. $ set(y),(!ee||s&1)&&z!==(z=l[0].name+"")&&te(ne,z),l[7]?A||(A=kt(),A.c(),A.m(w,null)):A&&(A.d(1),A=null),l[1]?P?P.p(l,s):(P=gt(l),P.c(),P.m(X,De)):P&&(P.d(1),P=null),s&64&&(ke=ie(l[6]),U=Je(U,s,dt,1,l,ke,Qe,X,bt,vt,null,ht)),s&12&&(ge=ie(l[3]),V=Je(V,s,ot,1,l,ge,at,be,bt,wt,null,_t)),s&12&&(_e=ie(l[3]),qt(),N=Je(N,s,rt,1,l,_e,it,me,Rt,Ct,null,mt),Dt())},i(l){if(!ee){ye(R. $ $ .fragment,l),ye(ae. $ $ .fragment,l),ye(se. $ $ .fragment,l);for(let s=0;s<_e.length;s+=1)ye(N[s]);ee=!0}},o(l){he(R. $ $ .fragment,l),he(ae. $ $ .fragment,l),he(se. $ $ .fragment,l);for(let s=0;s<N.length;s+=1)he(N[s]);ee=!1},d(l){l&&(o(e),o(c),o(u),o(M),o(L),o(g),o(v),o(w),o(Se),o(oe),o( $ e),o(re),o(Me),o(ce),o(qe),o(K),o(He),o(ue),o(Le),o(Y),o(Ee),o(fe),o(Ie),o(G)),j&&j.d(),ve(R,l),A&&A.d(),P&&P.d();for(let s=0;s<U.length;s+=1)U[s].d();ve(ae),ve(se);for(let s=0;s<V.length;s+=1)V[s].d();for(let s=0;s<N.length;s+=1)N[s].d()}}}const Wt=d=>d.name=="emailVisibility";function zt(d,e,t){let a,m,p,c,u,{collection:b}=e,O=200,T=[], $ ={};const D=S=>t(2,O=S.code);return d. $ $ set=S=>{"collection"in S&&t(0,b=S.collection)},d. $ $ .update=()=>{var S,E,q;d. $ $ .dirty&1&&t(1,a=(b==null?void 0:b.type)==="auth"),d. $ $ .dirty&1&&t(7,m=(b==null?void 0:b.updateRule)===null),d. $ $ .dirty&2&&t(8,p=a?["id","password","verified","email","emailVisibility"]:["id"]),d. $ $ .dirty&257&&t(6,c=((S=b==null?void 0:b.fields)==null?void 0:S.filter(H=>!H.hidden&&H.type!="autodate"&&!p.includes(H.name)))||[]),d. $ $ .dirty&1&&t(3,T=[{code:200,body:JSON.stringify(x.dummyCollectionRecord(b),null,2)},{code:400,body: `
2024-09-30 00:23:19 +08:00
{
2025-01-27 03:27:49 +08:00
"status" : 400 ,
2024-09-30 00:23:19 +08:00
"message" : "Failed to update record." ,
"data" : {
"${(q=(E=b==null?void 0:b.fields)==null?void 0:E[0])==null?void 0:q.name}" : {
"code" : "validation_required" ,
"message" : "Missing required value."
}
}
}
` },{code:403,body: `
{
2025-01-27 03:27:49 +08:00
"status" : 403 ,
2024-09-30 00:23:19 +08:00
"message" : "You are not allowed to perform this request." ,
"data" : { }
}
` },{code:404,body: `
{
2025-01-27 03:27:49 +08:00
"status" : 404 ,
2024-09-30 00:23:19 +08:00
"message" : "The requested resource wasn't found." ,
"data" : { }
}
2025-02-08 14:47:01 +08:00
` }]),d. $ $ .dirty&2&&(a?t(4, $ ={password:"87654321",passwordConfirm:"87654321",oldPassword:"12345678"}):t(4, $ ={}))},t(5,u=x.getApiExampleUrl(Ht.baseURL)),[b,a,O,T, $ ,u,c,m,p,D]}class Yt extends Ot{constructor(e){super(),St(this,e,zt,Qt, $ t,{collection:0})}}export{Yt as default};