import { query } from './_generated/server';
import { getRequiredUserId } from './model';

export const getStatus = query({
  args: {},
  handler: async (ctx) => {
    await getRequiredUserId(ctx);
    return {
      encryptionConfigured: Boolean(
        process.env.SPOON_ENCRYPTION_KEY?.trim() ??
        process.env.INSTANCE_SECRET?.trim(),
      ),
    };
  },
});
