fix(platform): fix 2 type errors found in typecheck sweep

- api-key-auth.ts: Record<string, unknown> → FilterMap (import from @bytelyst/datastore)
- reviews/notifications.ts: raw subject/html/text → templateId + variables (match dispatchEmail signature)
This commit is contained in:
saravanakumardb1 2026-03-19 19:02:57 -07:00
parent 6a79742605
commit 1ad8660dd8
2 changed files with 8 additions and 9 deletions

View File

@ -1,6 +1,7 @@
import crypto from 'node:crypto';
import bcrypt from 'bcryptjs';
import type { FastifyInstance, FastifyRequest } from 'fastify';
import type { FilterMap } from '@bytelyst/datastore';
import { ForbiddenError, TooManyRequestsError, UnauthorizedError } from './errors.js';
import { getCollection } from './datastore.js';
import * as rateLimitStore from '../modules/ratelimit/store.js';
@ -339,7 +340,7 @@ export async function registerOptionalApiKeyContext(app: FastifyInstance): Promi
if (!rawKey) return;
const prefix = rawKey.slice(0, 12);
const filter: Record<string, unknown> = {
const filter: FilterMap = {
prefix,
status: 'active',
expiresAt: { $gte: new Date().toISOString() },

View File

@ -21,14 +21,12 @@ export async function notifyReviewAssigned(
await dispatchEmail(
{
to,
subject: `Review assigned: ${review.title}`,
html: [
`<p>A review item has been assigned to you.</p>`,
`<p><strong>${review.title}</strong></p>`,
`<p>${review.description}</p>`,
review.runId ? `<p>Run ID: ${review.runId}</p>` : '',
].join(''),
text: `Review assigned: ${review.title}\n\n${review.description}${review.runId ? `\n\nRun ID: ${review.runId}` : ''}`,
templateId: 'review-assigned',
variables: {
title: review.title,
description: review.description ?? '',
runId: review.runId ?? '',
},
productId: review.productId,
userId: review.assignedTo,
},