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