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