Im getting this error:

'await' expressions are only allowed within async functions and at the top levels of modules.ts(1308)
converter.ts(100, 19): Did you mean to mark this function as 'async'?

the code is as follows:
import { z } from "zod";
import { type BTBModelType } from '~/models/BTBModel';
import { type LodgifyModelType } from '~/models/LodgifyModel';
import { convertLodgifyModelToBTBModel } from "~/utils/lodgifyToBTB";
import { parse } from "papaparse";

import {
 createTRPCRouter,
 publicProcedure,
 protectedProcedure,
} from "~/server/api/trpc";

const conversionSchema = z.object({
 inputText: z.string(),
 controlId: z.string().max(15),
 currency: z.string(),
 conversionType: z.string(),
});

async function getExchangeRate(
 baseCurrency: string,
 targetCurrency?: string
): Promise {
 targetCurrency = targetCurrency ?? "BZD";
 const apiKey = process.env.EXCHANGE\_RATES\_API\_KEY as string;
 const url = `https://api.exchangeratesapi.io/latest?access\_key=${apiKey}&base=${baseCurrency}&symbols=${targetCurrency ?? "BZD"}`;

 try {
 const response = await fetch(url);
 // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
 const data = await response.json();

 // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
 if (data.error) {
 // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
 throw new Error(data.error.info);
 }

 // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access
 return data.rates[targetCurrency ?? "BZD"];
 } catch (error) {
 console.error("Error fetching exchange rate:", error);
 return 1; // Return a default rate of 1 if there is an error
 }
}
// In-memory cache for exchange rates
const exchangeRateCache = new Map();

async function getExchangeRateAsync(baseCurrency: string, targetCurrency?: string): Promise {
 // targetCurrency is optional, default to BZD
 targetCurrency = targetCurrency ?? 'BZD';
 const cacheKey = `${baseCurrency}\_${targetCurrency}`;
 const now = Date.now();
 const oneDay = 24 \* 60 \* 60 \* 1000; // In milliseconds

 // Check if the rate is in the cache and is not older than one day
 if (exchangeRateCache.has(cacheKey) && now - exchangeRateCache.get(cacheKey)!.timestamp < oneDay) {
 return exchangeRateCache.get(cacheKey)!.rate;
 }

 // If the rate is not in the cache or is older than one day, fetch it from the API
 const apiKey = process.env.EXCHANGE\_RATES\_API\_KEY as string;
 const url = `https://api.exchangeratesapi.io/latest?access\_key=${apiKey}&base=${baseCurrency}&symbols=${targetCurrency}`;

 try {
 const response = await fetch(url);
 // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
 const data = await response.json();

 // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
 if (data.error) {
 // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
 throw new Error(data.error.info);
 }

 // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
 const rate = data.rates[targetCurrency];

 // Store the fetched rate in the cache with the current timestamp
 // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
 exchangeRateCache.set(cacheKey, { rate, timestamp: now });

 return rate as number;
 } catch (error) {
 console.error('Error fetching exchange rate:', error);
 return 1; // Return a default rate of 1 if there is an error
 }
}

export const converterRouter = createTRPCRouter({
 convertCsvToBTBModels: publicProcedure
 .input(conversionSchema)
 //.output(z.array(BTBModel))
 .mutation(({ input }) => {
 let btbModelArray: BTBModelType[] = [];
 input.inputText = input.inputText.replace(/^\s\*[\r]\*\n/gm, "");
 parse(input.inputText, {
 header: true,
 skipEmptyLines: true,
 complete: (results) => {
 const lodgifyModelArray = results.data as LodgifyModelType[];
 //get exchange rate from currency. 1 for belize dollar (BZD)
 const exchangeRate = await getExchangeRateAsync(input.currency);
 btbModelArray = lodgifyModelArray.map((x) =>
 convertLodgifyModelToBTBModel(x, input.controlId, exchangeRate)
 );
 //console.dir(btbModelArray);
 }
 });
 return { btbModelArray };
 }),

 getSecretMessage: protectedProcedure.query(() => {
 return "you can now see this secret message!";
 }),
});
이 오류가 발생합니다:'await' 표현식은 비동기 함수 내에서와 modules.ts(1308)의 최상위 레벨에서만 허용됩니다.converter.ts(100, 19): 이 함수를 '비동기'로 표시하려고 했나요?코드는 다음과 같습니다:import { z } from "zod";'~/models/BTBModel'에서 { type BTBModelType }을 임포트합니다;'~/models/LodgifyModel'에서 { type LodgifyModelType }을 가져옵니다;'~/utils/lodgifyToBTB'에서 { convertLodgifyModelToBTBModel } 임포트;"papaparse"에서 { parse }를 임포트합니다;import { createTRPCRouter, publicProcedure, protectedProcedure,}를 "~/server/api/trpc"에서 가져옵니다;const conversionSchema = z.object({ inputText: z.string(), controlId: z.string().max(15), currency: z.string(), conversionType: z.string(),});비동기 함수 getExchangeRate( baseCurrency: string, targetCurrency?: 문자열): Promise { targetCurrency = targetCurrency ?? "BZD"; const apiKey = process.env.EXCHANGE\_RATES\_API\_KEY를 문자열로 저장합니다; const url = `https://api.exchangeratesapi.io/latest?access\_key=${apiKey}&base=${baseCurrency}&symbols=${targetCurrency ?? "BZD"}`; try { const response = await fetch(url); // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const data = await response.json(); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access if (data.error) { // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access 새로운 오류(data.error.info)를 던집니다; } // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access return data.rates[targetCurrency ?? "BZD"]; } catch (error) { console.error("환율 가져오기 오류:", error); return 1; // 오류가 있는 경우 기본 환율 1을 반환합니다. }}// 환율을 위한 인메모리 캐시const exchangeRateCache = new Map();비동기 함수 getExchangeRateAsync(baseCurrency: 문자열, targetCurrency?: 문자열): Promise { // targetCurrency는 선택 사항이며, 기본값은 BZD입니다. targetCurrency = targetCurrency ?? 'BZD'; const cacheKey = `${기본통화}\_${목표통화}`; const now = Date.now(); const oneDay = 24 \* 60 \* 60 \* 1000; // 밀리초 단위 // 환율이 캐시에 있고 하루보다 오래되지 않았는지 확인합니다. if (exchangeRateCache.has(cacheKey) && now - exchangeRateCache.get(cacheKey)!.timestamp < oneDay) { return exchangeRateCache.get(cacheKey)!.rate; } // 환율이 캐시에 없거나 하루보다 오래된 경우, API에서 가져옵니다. const apiKey = process.env.EXCHANGE\_RATES\_API\_KEY를 문자열로 저장합니다; const url = `https://api.exchangeratesapi.io/latest?access\_key=${apiKey}&base=${baseCurrency}&symbols=${targetCurrency}`; try { const response = await fetch(url); // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const data = await response.json(); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access if (data.error) { // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access 새로운 오류(data.error.info)를 던집니다; } // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access const rate = data.rates[targetCurrency]; // 가져온 환율을 현재 타임스탬프와 함께 캐시에 저장합니다. // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment exchangeRateCache.set(cacheKey, { rate, timestamp: now }); 환율을 숫자로 반환합니다; } catch (error) { console.error('환율 불러오기 오류:', error); return 1; // 오류가 있는 경우 기본 환율 1을 반환합니다. }}export const converterRouter = createTRPCRouter({ convertCsvToBTBModels: publicProcedure .input(conversionSchema) //.output(z.array(BTBModel)) .mutation(({ input }) => { let btbModelArray: BTBModelType[] = []; input.inputText = input.inputText.replace(/^\s\*[\r]\*\n/gm, ""); parse(input.inputText, { header: true, skipEmptyLines: true, complete: (results) => { const lodgifyModelArray = results.data as LodgifyModelType[]; //통화에서 환율을 가져옵니다. 벨리즈 달러(BZD)의 경우 1 const exchangeRate = await getExchangeRateAsync(input.currency); btbModelArray = lodgifyModelArray.map((x) =>) convertLodgifyModelToBTBModel(x, input.controlId, exchangeRate) ); //console.dir(btbModelArray); } }); 반환 { btbModelArray }; }), getSecretMessage: protectedProcedure.query(() => { 반환 "이제 이 비밀 메시지를 볼 수 있습니다!"; }),});