Edit: /tmp/tsx-0/17887-c1719f3e61e490a4b506b8f86afcb989a0a4eb2a (2963B)
{"code":"__filename=\"/opt/canhelp/apps/api/src/routes/health.ts\";(()=>{\n\"use strict\";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;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 health_exports={};__export(health_exports,{default:()=>health_default});module.exports=__toCommonJS(health_exports);var import_hono=require(\"hono\");var import_db=require(\"../db.js\");var import_redis=require(\"../redis.js\");var import_drizzle_orm=require(\"drizzle-orm\");var import_apple_client_secret=require(\"../lib/apple-client-secret.js\");const app=new import_hono.Hono;const healthDebugToken=process.env.HEALTH_DEBUG_TOKEN?.trim();app.get(\"/\",async c=>{let dbOk=false;let redisOk=false;try{await import_db.db.execute(import_drizzle_orm.sql`SELECT 1`);dbOk=true}catch{}try{await import_redis.redis.ping();redisOk=true}catch{}const status=dbOk&&redisOk?200:503;return c.json({status:status===200?\"ok\":\"degraded\",db:dbOk,redis:redisOk},status)});app.get(\"/debug\",async c=>{if(!healthDebugToken){return c.json({error:\"Not found\"},404)}const token=c.req.header(\"X-Debug-Token\")?.trim();if(!token||token!==healthDebugToken){return c.json({error:\"Unauthorized\"},401)}const appleJwt=(0,import_apple_client_secret.getAppleClientSecretExpDebugInfo)();console.log(\"[Health Debug] Apple JWT exp:\",appleJwt.expIso??\"n/a\",\"configured:\",appleJwt.configured);return c.json({appleJwt})});var health_default=app;\n})()\n","warnings":[],"map":{"version":3,"mappings":";qqBAAA,wIAAqB,gBACrB,cAAmB,oBACnB,iBAAsB,uBACtB,uBAAoB,uBACpB,+BAAiD,yCAEjD,MAAM,IAAM,IAAI,iBAChB,MAAM,iBAAmB,QAAQ,IAAI,oBAAoB,KAAK,EAE9D,IAAI,IAAI,IAAK,MAAO,GAAM,CACxB,IAAI,KAAO,MACX,IAAI,QAAU,MAEd,GAAI,CACF,MAAM,aAAG,QAAQ,gCAAa,EAC9B,KAAO,IACT,MAAQ,CAAC,CAET,GAAI,CACF,MAAM,mBAAM,KAAK,EACjB,QAAU,IACZ,MAAQ,CAAC,CAET,MAAM,OAAS,MAAQ,QAAU,IAAM,IACvC,OAAO,EAAE,KAAK,CAAE,OAAQ,SAAW,IAAM,KAAO,WAAY,GAAI,KAAM,MAAO,OAAQ,EAAG,MAAM,CAChG,CAAC,EAED,IAAI,IAAI,SAAU,MAAO,GAAM,CAE7B,GAAI,CAAC,iBAAkB,CACrB,OAAO,EAAE,KAAK,CAAE,MAAO,WAAY,EAAG,GAAG,CAC3C,CAEA,MAAM,MAAQ,EAAE,IAAI,OAAO,eAAe,GAAG,KAAK,EAClD,GAAI,CAAC,OAAS,QAAU,iBAAkB,CACxC,OAAO,EAAE,KAAK,CAAE,MAAO,cAAe,EAAG,GAAG,CAC9C,CAEA,MAAM,YAAW,6DAAiC,EAClD,QAAQ,IAAI,gCAAiC,SAAS,QAAU,MAAO,cAAe,SAAS,UAAU,EACzG,OAAO,EAAE,KAAK,CAAE,QAAS,CAAC,CAC5B,CAAC,EAED,IAAO,eAAQ","names":[],"ignoreList":[],"sources":["/opt/canhelp/apps/api/src/routes/health.ts"],"sourcesContent":[null]}}