index.get2.mjs
949 Bytes
import { e as eventHandler, j as getQuery, G as getMockSnItems } from '../../nitro/nitro.mjs';
import { z } from 'zod';
import { a as SN_EXCEPTION_STATUS_VALUES, b as SN_STATUS_VALUES } from '../../_/sn.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({
sn: z.string().optional(),
workOrderNo: z.string().optional(),
status: z.enum(SN_STATUS_VALUES).optional(),
currentStep: z.string().optional(),
exceptionStatus: z.enum(SN_EXCEPTION_STATUS_VALUES).optional()
});
const index_get = eventHandler((event) => {
const raw = getQuery(event);
const parsed = querySchema.safeParse(raw);
if (!parsed.success) {
return [];
}
return getMockSnItems(parsed.data);
});
export { index_get as default };
//# sourceMappingURL=index.get2.mjs.map