2022-11-06 21:48:27 +08:00
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 R , P as ye , Q as Le , k as Me , R as Ve , n as ze , t as le , a as oe , o as d , d as Ue , L as He , C as Ie , p as Re , r as j , u as je , O as Ke } from "./index.b110ca95.js" ; import { S as Ne } from "./SdkTabs.b01956c7.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 Pe ( n , l ) { let o , a = l [ 5 ] . code + "" , _ , b , c , u ; function p ( ) { return l [ 4 ] ( l [ 5 ] ) } return { key : n , first : null , c ( ) { o = i ( "button" ) , _ = v ( a ) , b = h ( ) , f ( o , "class" , "tab-item" ) , j ( o , "active" , l [ 1 ] === l [ 5 ] . code ) , this . first = o } , m ( $ , E ) { r ( $ , o , E ) , s ( o , _ ) , s ( o , b ) , c || ( u = je ( o , "click" , p ) , c = ! 0 ) } , p ( $ , E ) { l = $ , E & 4 && a !== ( a = l [ 5 ] . code + "" ) && R ( _ , a ) , E & 6 && j ( o , "active" , l [ 1 ] === l [ 5 ] . code ) } , d ( $ ) { $ && d ( o ) , c = ! 1 , u ( ) } } } function Te ( n , l ) { let o , a , _ , b ; return a = new Ke ( { props : { content : l [ 5 ] . body } } ) , { key : n , first : null , c ( ) { o = i ( "div" ) , Se ( a . $$ . fragment ) , _ = h ( ) , f ( o , "class" , "tab-item" ) , j ( 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 p = { } ; u & 4 && ( p . content = l [ 5 ] . body ) , a . $set ( p ) , ( ! b || u & 6 ) && j ( 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 , p , $ , E , L = n [ 0 ] . name + "" , K , se , ae , N , Q , A , F , T , G , g , M , ne , V , y , ie , J , z = n [ 0 ] . name + "" , W , ce , X , re , Y , de , H , Z , S , x , B , ee , U , te , C , q , w = [ ] , ue = new Map , me , O , k = [ ] , pe = new Map , P ; A = new Ne ( { props : { js : `
2022-10-30 16:28:14 +08:00
import PocketBase from 'pocketbase' ;
const pb = new PocketBase ( '${n[3]}' ) ;
...
await pb . collection ( '${(he=n[0])==null?void 0:he.name}' ) . authViaEmail ( 'test@example.com' , '123456' ) ;
await pb . collection ( '${(_e=n[0])==null?void 0:_e.name}' ) . unlinkExternalAuth (
pb . authStore . model . id ,
'google'
) ;
` ,dart: `
import 'package:pocketbase/pocketbase.dart' ;
final pb = PocketBase ( '${n[3]}' ) ;
...
await pb . collection ( '${(ke=n[0])==null?void 0:ke.name}' ) . authViaEmail ( 'test@example.com' , '123456' ) ;
await pb . collection ( '${(ve=n[0])==null?void 0:ve.name}' ) . unlinkExternalAuth (
pb . authStore . model . id ,
'google' ,
) ;
` }});let I=n[2];const fe=e=>e[5].code;for(let e=0;e<I.length;e+=1){let t=Ce(n,I,e),m=fe(t);ue.set(m,w[e]=Pe(m,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),m=be(t);pe.set(m,k[e]=Te(m,t))}return{c(){l=i("h3"),o=v("Unlink OAuth2 account ("),_=v(a),b=v(")"),c=h(),u=i("div"),p=i("p"), $ =v("Unlink a single external OAuth2 provider from "),E=i("strong"),K=v(L),se=v(" record."),ae=h(),N=i("p"),N.textContent="Only admins and the account owner can access this action.",Q=h(),Se(A. $ $ .fragment),F=h(),T=i("h6"),T.textContent="API details",G=h(),g=i("div"),M=i("strong"),M.textContent="DELETE",ne=h(),V=i("div"),y=i("p"),ie=v("/api/collections/"),J=i("strong"),W=v(z),ce=v("/records/"),X=i("strong"),X.textContent=":id",re=v("/external-auths/"),Y=i("strong"),Y.textContent=":provider",de=h(),H=i("p"),H.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 < / t h >
< th > Type < / t h >
< th width = "60%" > Description < / t h > < / t r > < / t h e a d >
< tbody > < tr > < td > id < / t d >
< td > < span class = "label" > String < / s p a n > < / t d >
< td > ID of the auth record . < / t d > < / t r >
< tr > < td > provider < / t d >
< td > < span class = "label" > String < / s p a n > < / t d >
< td > The name of the auth provider to unlink , eg . < code > google < / c o d e > , < c o d e > t w i t t e r < / c o d e > ,
< code > github < / c o d e > , e t c . < / t d > < / t r > < / t b o d y > ` , e e = h ( ) , U = i ( " d i v " ) , U . t e x t C o n t e n t = " R e s p o n s e s " , t e = h ( ) , C = i ( " d i v " ) , q = i ( " d i v " ) ; f o r ( l e t e = 0 ; e < w . l e n g t h ; e + = 1 ) w [ e ] . c ( ) ; m e = h ( ) , O = i ( " d i v " ) ; f o r ( l e t e = 0 ; e < k . l e n g t h ; e + = 1 ) k [ e ] . c ( ) ; f ( l , " c l a s s " , " m - b - s m " ) , f ( u , " c l a s s " , " c o n t e n t t x t - l g m - b - s m " ) , f ( T , " c l a s s " , " m - b - x s " ) , f ( M , " c l a s s " , " l a b e l l a b e l - p r i m a r y " ) , f ( V , " c l a s s " , " c o n t e n t " ) , f ( H , " 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 " ) , f ( g , " c l a s s " , " a l e r t a l e r t - d a n g e r " ) , f ( S , " c l a s s " , " s e c t i o n - t i t l e " ) , f ( B , " c l a s s " , " t a b l e - c o m p a c t t a b l e - b o r d e r m - b - b a s e " ) , f ( U , " c l a s s " , " s e c t i o n - t i t l e " ) , f ( q , " c l a s s " , " t a b s - h e a d e r c o m p a c t l e f t " ) , f ( O , " c l a s s " , " t a b s - c o n t e n t " ) , f ( C , " c l a s s " , " t a b s " ) } , 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 , p ) , s ( p , $ ) , s ( p , E ) , s ( E , K ) , s ( p , s e ) , s ( u , a e ) , s ( u , N ) , r ( e , Q , t ) , B e ( A , e , t ) , r ( e , F , t ) , r ( e , T , t ) , r ( e , G , t ) , r ( e , g , t ) , s ( g , M ) , s ( g , n e ) , s ( g , V ) , s ( V , y ) , s ( y , i e ) , s ( y , J ) , s ( J , W ) , s ( y , c e ) , s ( y , X ) , s ( y , r e ) , s ( y , Y ) , s ( g , d e ) , s ( g , H ) , r ( e , Z , t ) , r ( e , S , t ) , r ( e , x , t ) , r ( e , B , t ) , r ( e , e e , t ) , r ( e , U , t ) , r ( e , t e , t ) , r ( e , C , t ) , s ( C , q ) ; f o r ( l e t m = 0 ; m < w . l e n g t h ; m + = 1 ) w [ m ] . m ( q , n u l l ) ; s ( C , m e ) , s ( C , O ) ; f o r ( l e t m = 0 ; m < k . l e n g t h ; m + = 1 ) k [ m ] . m ( O , n u l l ) ; P = ! 0 } , p ( e , [ t ] ) { v a r g e , w e , $ e , E e ; ( ! P | | t & 1 ) & & a ! = = ( a = e [ 0 ] . n a m e + " " ) & & R ( _ , a ) , ( ! P | | t & 1 ) & & L ! = = ( L = e [ 0 ] . n a m e + " " ) & & R ( K , L ) ; c o n s t m = { } ; t & 9 & & ( m . j s = `
import PocketBase from 'pocketbase' ;
const pb = new PocketBase ( '${e[3]}' ) ;
...
await pb . collection ( '${(ge=e[0])==null?void 0:ge.name}' ) . authViaEmail ( 'test@example.com' , '123456' ) ;
await pb . collection ( '${(we=e[0])==null?void 0:we.name}' ) . unlinkExternalAuth (
pb . authStore . model . id ,
'google'
) ;
` ),t&9&&(m.dart= `
import 'package:pocketbase/pocketbase.dart' ;
final pb = PocketBase ( '${e[3]}' ) ;
...
await pb . collection ( '${($e=e[0])==null?void 0:$e.name}' ) . authViaEmail ( 'test@example.com' , '123456' ) ;
await pb . collection ( '${(Ee=e[0])==null?void 0:Ee.name}' ) . unlinkExternalAuth (
pb . authStore . model . id ,
'google' ,
) ;
` ),A. $ set(m),(!P||t&1)&&z!==(z=e[0].name+"")&&R(W,z),t&6&&(I=e[2],w=ye(w,t,fe,1,e,I,ue,q,Le,Pe,null,Ce)),t&6&&(D=e[2],Me(),k=ye(k,t,be,1,e,D,pe,O,Ve,Te,null,Ae),ze())},i(e){if(!P){le(A. $ $ .fragment,e);for(let t=0;t<D.length;t+=1)le(k[t]);P=!0}},o(e){oe(A. $ $ .fragment,e);for(let t=0;t<k.length;t+=1)oe(k[t]);P=!1},d(e){e&&d(l),e&&d(c),e&&d(u),e&&d(Q),Ue(A,e),e&&d(F),e&&d(T),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 He}=l,b=204,c=[];const u=p=>o(1,b=p.code);return n. $ $ set=p=>{"collection"in p&&o(0,_=p.collection)},o(3,a=Ie.getApiExampleUrl(Re.baseUrl)),o(2,c=[{code:204,body:"null"},{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" : "The requested resource wasn't found." ,
"data" : { }
}
` }]),[_,b,c,a,u]}class We extends qe{constructor(l){super(),Oe(this,l,Fe,Qe,De,{collection:0})}}export{We as default};