index.get.mjs 926 Bytes
import { e as eventHandler, j as getQuery, o as getMockOperationTasks } from '../../nitro/nitro.mjs';
import { z } from 'zod';
import { a as OPERATION_TASK_STATUS_VALUES } from '../../_/operation.mjs';
import 'node:http';
import 'node:https';
import 'node:events';
import 'node:buffer';
import 'node:fs';
import 'node:path';
import 'node:crypto';
import 'node:url';
import '@iconify/utils';
import 'consola';

const querySchema = z.object({
  workstation: z.string().optional(),
  stepName: z.string().optional(),
  operator: z.string().optional(),
  status: z.enum(OPERATION_TASK_STATUS_VALUES).optional(),
  sn: z.string().optional()
});
const index_get = eventHandler((event) => {
  const raw = getQuery(event);
  const parsed = querySchema.safeParse(raw);
  if (!parsed.success) {
    return [];
  }
  return getMockOperationTasks(parsed.data);
});

export { index_get as default };
//# sourceMappingURL=index.get.mjs.map