Edit: /tmp/tsx-0/17887-9fd5b8ceb94ff0db4b9d06caf378b6cc6fcb0ab7 (4590B)
{"code":"__filename=\"/opt/canhelp/node_modules/better-auth/node_modules/@better-auth/core/dist/social-providers/dropbox.mjs\";(()=>{\nvar __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __name=(target,value)=>__defProp(target,\"name\",{value,configurable:true});var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from===\"object\"||typeof from===\"function\"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},\"__esModule\",{value:true}),mod);var dropbox_exports={};__export(dropbox_exports,{dropbox:()=>dropbox});module.exports=__toCommonJS(dropbox_exports);var import_create_authorization_url=require(\"../oauth2/create-authorization-url.mjs\");var import_refresh_access_token=require(\"../oauth2/refresh-access-token.mjs\");var import_validate_authorization_code=require(\"../oauth2/validate-authorization-code.mjs\");var import_oauth2=require(\"../oauth2/index.mjs\");var import_fetch=require(\"@better-fetch/fetch\");const dropbox=__name(options=>{const tokenEndpoint=\"https://api.dropboxapi.com/oauth2/token\";return{id:\"dropbox\",name:\"Dropbox\",createAuthorizationURL:__name(async({state,scopes,codeVerifier,redirectURI})=>{const _scopes=options.disableDefaultScope?[]:[\"account_info.read\"];if(options.scope)_scopes.push(...options.scope);if(scopes)_scopes.push(...scopes);const additionalParams={};if(options.accessType)additionalParams.token_access_type=options.accessType;return await(0,import_create_authorization_url.createAuthorizationURL)({id:\"dropbox\",options,authorizationEndpoint:\"https://www.dropbox.com/oauth2/authorize\",scopes:_scopes,state,redirectURI,codeVerifier,additionalParams})},\"createAuthorizationURL\"),validateAuthorizationCode:__name(async({code,codeVerifier,redirectURI})=>{return await(0,import_validate_authorization_code.validateAuthorizationCode)({code,codeVerifier,redirectURI,options,tokenEndpoint})},\"validateAuthorizationCode\"),refreshAccessToken:options.refreshAccessToken?options.refreshAccessToken:async refreshToken=>{return(0,import_refresh_access_token.refreshAccessToken)({refreshToken,options:{clientId:options.clientId,clientKey:options.clientKey,clientSecret:options.clientSecret},tokenEndpoint})},async getUserInfo(token){if(options.getUserInfo)return options.getUserInfo(token);const{data:profile,error}=await(0,import_fetch.betterFetch)(\"https://api.dropboxapi.com/2/users/get_current_account\",{method:\"POST\",headers:{Authorization:`Bearer ${token.accessToken}`}});if(error)return null;const userMap=await options.mapProfileToUser?.(profile);return{user:{id:profile.account_id,name:profile.name?.display_name,email:profile.email,emailVerified:profile.email_verified||false,image:profile.profile_photo_url,...userMap},data:profile}},options}},\"dropbox\");0&&(module.exports={dropbox});\n})()\n","warnings":[],"map":{"version":3,"mappings":";suBAAA,wJAAuC,kDACvC,gCAAmC,8CACnC,uCAA0C,qDAC1C,kBAAO,+BACP,iBAA4B,+BAG5B,MAAM,QAAU,OAAC,SAAY,CAC5B,MAAM,cAAgB,0CACtB,MAAO,CACN,GAAI,UACJ,KAAM,UACN,uBAAwB,aAAO,CAAE,MAAO,OAAQ,aAAc,WAAY,IAAM,CAC/E,MAAM,QAAU,QAAQ,oBAAsB,CAAC,EAAI,CAAC,mBAAmB,EACvE,GAAI,QAAQ,MAAO,QAAQ,KAAK,GAAG,QAAQ,KAAK,EAChD,GAAI,OAAQ,QAAQ,KAAK,GAAG,MAAM,EAClC,MAAM,iBAAmB,CAAC,EAC1B,GAAI,QAAQ,WAAY,iBAAiB,kBAAoB,QAAQ,WACrE,OAAO,QAAM,wDAAuB,CACnC,GAAI,UACJ,QACA,sBAAuB,2CACvB,OAAQ,QACR,MACA,YACA,aACA,gBACD,CAAC,CACF,EAhBwB,0BAiBxB,0BAA2B,aAAO,CAAE,KAAM,aAAc,WAAY,IAAM,CACzE,OAAO,QAAM,8DAA0B,CACtC,KACA,aACA,YACA,QACA,aACD,CAAC,CACF,EAR2B,6BAS3B,mBAAoB,QAAQ,mBAAqB,QAAQ,mBAAqB,MAAO,cAAiB,CACrG,SAAO,gDAAmB,CACzB,aACA,QAAS,CACR,SAAU,QAAQ,SAClB,UAAW,QAAQ,UACnB,aAAc,QAAQ,YACvB,EACA,aACD,CAAC,CACF,EACA,MAAM,YAAY,MAAO,CACxB,GAAI,QAAQ,YAAa,OAAO,QAAQ,YAAY,KAAK,EACzD,KAAM,CAAE,KAAM,QAAS,KAAM,EAAI,QAAM,0BAAY,yDAA0D,CAC5G,OAAQ,OACR,QAAS,CAAE,cAAe,UAAU,MAAM,WAAW,EAAG,CACzD,CAAC,EACD,GAAI,MAAO,OAAO,KAClB,MAAM,QAAU,MAAM,QAAQ,mBAAmB,OAAO,EACxD,MAAO,CACN,KAAM,CACL,GAAI,QAAQ,WACZ,KAAM,QAAQ,MAAM,aACpB,MAAO,QAAQ,MACf,cAAe,QAAQ,gBAAkB,MACzC,MAAO,QAAQ,kBACf,GAAG,OACJ,EACA,KAAM,OACP,CACD,EACA,OACD,CACD,EAhEgB","names":[],"ignoreList":[],"sources":["/opt/canhelp/node_modules/better-auth/node_modules/@better-auth/core/dist/social-providers/dropbox.mjs"],"sourcesContent":[null]}}