Edit: /tmp/tsx-0/17887-17e23e0ca154b8ce5d30ae52f598495d0dd4e21e (5193B)
{"code":"__filename=\"/opt/canhelp/node_modules/better-auth/node_modules/@better-auth/core/dist/social-providers/atlassian.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 atlassian_exports={};__export(atlassian_exports,{atlassian:()=>atlassian});module.exports=__toCommonJS(atlassian_exports);var import_logger=require(\"../env/logger.mjs\");var import_env=require(\"../env/index.mjs\");var import_error=require(\"../error/index.mjs\");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 atlassian=__name(options=>{const tokenEndpoint=\"https://auth.atlassian.com/oauth/token\";return{id:\"atlassian\",name:\"Atlassian\",async createAuthorizationURL({state,scopes,codeVerifier,redirectURI}){if(!options.clientId||!options.clientSecret){import_logger.logger.error(\"Client Id and Secret are required for Atlassian\");throw new import_error.BetterAuthError(\"CLIENT_ID_AND_SECRET_REQUIRED\")}if(!codeVerifier)throw new import_error.BetterAuthError(\"codeVerifier is required for Atlassian\");const _scopes=options.disableDefaultScope?[]:[\"read:jira-user\",\"offline_access\"];if(options.scope)_scopes.push(...options.scope);if(scopes)_scopes.push(...scopes);return(0,import_create_authorization_url.createAuthorizationURL)({id:\"atlassian\",options,authorizationEndpoint:\"https://auth.atlassian.com/authorize\",scopes:_scopes,state,codeVerifier,redirectURI,additionalParams:{audience:\"api.atlassian.com\"},prompt:options.prompt})},validateAuthorizationCode:__name(async({code,codeVerifier,redirectURI})=>{return(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,clientSecret:options.clientSecret},tokenEndpoint})},async getUserInfo(token){if(options.getUserInfo)return options.getUserInfo(token);if(!token.accessToken)return null;try{const{data:profile}=await(0,import_fetch.betterFetch)(\"https://api.atlassian.com/me\",{headers:{Authorization:`Bearer ${token.accessToken}`}});if(!profile)return null;const userMap=await options.mapProfileToUser?.(profile);return{user:{id:profile.account_id,name:profile.name,email:profile.email,image:profile.picture,emailVerified:false,...userMap},data:profile}}catch(error){import_logger.logger.error(\"Failed to fetch user info from Figma:\",error);return null}},options}},\"atlassian\");0&&(module.exports={atlassian});\n})()\n","warnings":[],"map":{"version":3,"mappings":";suBAAA,gJAAuB,6BACvB,eAAO,4BACP,iBAAgC,8BAChC,oCAAuC,kDACvC,gCAAmC,8CACnC,uCAA0C,qDAC1C,kBAAO,+BACP,iBAA4B,+BAG5B,MAAM,UAAY,OAAC,SAAY,CAC9B,MAAM,cAAgB,yCACtB,MAAO,CACN,GAAI,YACJ,KAAM,YACN,MAAM,uBAAuB,CAAE,MAAO,OAAQ,aAAc,WAAY,EAAG,CAC1E,GAAI,CAAC,QAAQ,UAAY,CAAC,QAAQ,aAAc,CAC/C,qBAAO,MAAM,iDAAiD,EAC9D,MAAM,IAAI,6BAAgB,+BAA+B,CAC1D,CACA,GAAI,CAAC,aAAc,MAAM,IAAI,6BAAgB,wCAAwC,EACrF,MAAM,QAAU,QAAQ,oBAAsB,CAAC,EAAI,CAAC,iBAAkB,gBAAgB,EACtF,GAAI,QAAQ,MAAO,QAAQ,KAAK,GAAG,QAAQ,KAAK,EAChD,GAAI,OAAQ,QAAQ,KAAK,GAAG,MAAM,EAClC,SAAO,wDAAuB,CAC7B,GAAI,YACJ,QACA,sBAAuB,uCACvB,OAAQ,QACR,MACA,aACA,YACA,iBAAkB,CAAE,SAAU,mBAAoB,EAClD,OAAQ,QAAQ,MACjB,CAAC,CACF,EACA,0BAA2B,aAAO,CAAE,KAAM,aAAc,WAAY,IAAM,CACzE,SAAO,8DAA0B,CAChC,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,aAAc,QAAQ,YACvB,EACA,aACD,CAAC,CACF,EACA,MAAM,YAAY,MAAO,CACxB,GAAI,QAAQ,YAAa,OAAO,QAAQ,YAAY,KAAK,EACzD,GAAI,CAAC,MAAM,YAAa,OAAO,KAC/B,GAAI,CACH,KAAM,CAAE,KAAM,OAAQ,EAAI,QAAM,0BAAY,+BAAgC,CAAE,QAAS,CAAE,cAAe,UAAU,MAAM,WAAW,EAAG,CAAE,CAAC,EACzI,GAAI,CAAC,QAAS,OAAO,KACrB,MAAM,QAAU,MAAM,QAAQ,mBAAmB,OAAO,EACxD,MAAO,CACN,KAAM,CACL,GAAI,QAAQ,WACZ,KAAM,QAAQ,KACd,MAAO,QAAQ,MACf,MAAO,QAAQ,QACf,cAAe,MACf,GAAG,OACJ,EACA,KAAM,OACP,CACD,OAAS,MAAO,CACf,qBAAO,MAAM,wCAAyC,KAAK,EAC3D,OAAO,IACR,CACD,EACA,OACD,CACD,EAtEkB","names":[],"ignoreList":[],"sources":["/opt/canhelp/node_modules/better-auth/node_modules/@better-auth/core/dist/social-providers/atlassian.mjs"],"sourcesContent":[null]}}