import { b as private_env } from './shared-server-DaWdgxVh.js';
import { L as LibraryAPNsService } from './library-apns-D8RPINlv.js';
import { v as validateAuth } from './auth-DuunT7Cg.js';
import { j as json } from './index-CoD1IJuy.js';
import 'child_process';
import 'jsonwebtoken';
import 'util';
import './error-DDXB3duW.js';
import 'crypto';

const GET = ({ request }) => {
  const authError = validateAuth(request);
  if (authError) {
    return authError;
  }
  const apnsClient = new LibraryAPNsService();
  const deviceToken = private_env.DEVICE_TOKEN?.trim();
  return json({
    apns: {
      configured: apnsClient.isConfigured(),
      environment: private_env.APNS_PRODUCTION === "true" ? "production" : "sandbox",
      hasBundleId: !!private_env.APNS_BUNDLE_ID,
      hasKey: !!private_env.APNS_KEY,
      hasKeyId: !!private_env.APNS_KEY_ID,
      hasTeamId: !!private_env.APNS_TEAM_ID
    },
    deviceToken: {
      exists: !!deviceToken,
      length: deviceToken ? deviceToken.length : 0,
      valid: deviceToken ? /^[a-f0-9]{64}$/i.test(deviceToken) : false
    },
    environment: private_env.NODE_ENV || "development",
    hasApiKey: !!private_env.API_KEY,
    timestamp: (/* @__PURE__ */ new Date()).toISOString()
  });
};

export { GET };
//# sourceMappingURL=_server.ts-BTmknWpO.js.map
