"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const notification_1=require("@b/services/notification");exports.metadata={summary:"Get Device Tokens",description:"Get all registered device tokens for the authenticated user",operationId:"getDeviceTokens",tags:["User","Notifications","Device Token"],requiresAuth:!0,responses:{200:{description:"Device tokens retrieved successfully",content:{"application/json":{schema:{type:"object",properties:{tokens:{type:"array",items:{type:"object",properties:{deviceId:{type:"string"},platform:{type:"string"},createdAt:{type:"string",format:"date-time"},lastUsed:{type:"string",format:"date-time"},tokenPreview:{type:"string"}}}},count:{type:"number"}}}}}},401:{description:"Unauthorized"}}};exports.default=async e=>{const{user:t}=e;if(!(null==t?void 0:t.id))throw new Error("Unauthorized");const i=await(0,notification_1.getDeviceTokens)(t.id);return{tokens:i.map(e=>({deviceId:e.deviceId,platform:e.platform,createdAt:e.createdAt,lastUsed:e.lastUsed,tokenPreview:e.token.substring(0,20)+"..."})),count:i.length}};