"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateExcelIoRoute = generateExcelIoRoute;
function generateExcelIoRoute({ context: _context }) {
    return /* ts */ `
import {
  zImportExecuteRequestDecoder,
  zImportPreviewSessionRequestDecoder,
} from '@excel-io/excel-io.service'

import { authMiddleware } from '../middleware'
import { procedure, router } from '../trpc-shared'

export const excelIo = router({
  getPreview: procedure
    .use(authMiddleware)
    .input(zImportPreviewSessionRequestDecoder)
    .query(({ input, ctx }) => ctx.excelIo.getImportPreviewBySessionId(input)),

  execute: procedure
    .use(authMiddleware)
    .input(zImportExecuteRequestDecoder)
    .mutation(({ input, ctx }) =>
      ctx.excelIo.executeImportFromPreview({
        previewSessionId: input.previewSessionId,
        ignoreErrors: input.ignoreErrors,
        confirmDeletes: input.confirmDeletes,
        selectedDeltaIndicesByModel: input.selectedDeltaIndicesByModel,
        authorization: ctx.viewer,
      }),
    ),
})
`;
}
//# sourceMappingURL=excel-io-route.generator.js.map