backend input validation
This commit is contained in:
+10
-10
@@ -46,7 +46,7 @@ const appRouter = router({
|
||||
}),
|
||||
getExpirationsForUnderlying: publicProcedure
|
||||
.input(RpcType(ObjectT({
|
||||
underlying:StringT(),
|
||||
underlying:StringT({maxLength:5}),
|
||||
asOfDate:StringT()
|
||||
})))
|
||||
.query(async (opts)=>{
|
||||
@@ -62,7 +62,7 @@ const appRouter = router({
|
||||
}),
|
||||
getStrikesForUnderlying: publicProcedure
|
||||
.input(RpcType(ObjectT({
|
||||
underlying:StringT(),
|
||||
underlying:StringT({maxLength:5}),
|
||||
asOfDate:StringT(),
|
||||
expirationDate:StringT(),
|
||||
})))
|
||||
@@ -80,7 +80,7 @@ const appRouter = router({
|
||||
}),
|
||||
getOpensForUnderlying: publicProcedure
|
||||
.input(RpcType(ObjectT({
|
||||
underlying:StringT()
|
||||
underlying:StringT({maxLength:5})
|
||||
})))
|
||||
.query(async (opts)=>{
|
||||
const {underlying} = opts.input;
|
||||
@@ -96,7 +96,7 @@ const appRouter = router({
|
||||
}),
|
||||
getOpensForOptionContract: publicProcedure
|
||||
.input(RpcType(ObjectT({
|
||||
underlying:StringT(),
|
||||
underlying:StringT({maxLength:5}),
|
||||
expirationDate:StringT(),
|
||||
strike:NumberT()
|
||||
})))
|
||||
@@ -117,7 +117,7 @@ const appRouter = router({
|
||||
}),
|
||||
getHistoricalCalendarPrices: publicProcedure
|
||||
.input(RpcType(ObjectT({
|
||||
underlying:StringT(),
|
||||
underlying:StringT({maxLength:5}),
|
||||
daysToFrontExpiration:NumberT(),
|
||||
daysBetweenFrontAndBackExpiration:NumberT(),
|
||||
strikePercentageFromUnderlyingPriceRangeMin:NumberT(),
|
||||
@@ -140,7 +140,7 @@ const appRouter = router({
|
||||
}),
|
||||
getHistoricalStockQuoteChartData: publicProcedure
|
||||
.input(RpcType(ObjectT({
|
||||
underlying:StringT(),
|
||||
underlying:StringT({maxLength:5}),
|
||||
lookbackPeriodStart:StringT(),
|
||||
lookbackPeriodEnd:StringT(),
|
||||
})))
|
||||
@@ -159,7 +159,7 @@ const appRouter = router({
|
||||
}),
|
||||
getHistoricalCalendarQuoteChartData: publicProcedure
|
||||
.input(RpcType(ObjectT({
|
||||
underlying:StringT(),
|
||||
underlying:StringT({maxLength:5}),
|
||||
daysToFrontExpiration:NumberT(),
|
||||
daysBetweenFrontAndBackExpiration:NumberT(),
|
||||
strikePercentageFromUnderlyingPriceRangeMin:NumberT(),
|
||||
@@ -185,11 +185,11 @@ const appRouter = router({
|
||||
}),
|
||||
getHistoricalCalendarExitQuoteChartData: publicProcedure
|
||||
.input(RpcType(ObjectT({
|
||||
underlying:StringT(),
|
||||
underlying:StringT({maxLength:5}),
|
||||
daysToFrontExpiration:NumberT(),
|
||||
daysBetweenFrontAndBackExpiration:NumberT(),
|
||||
lookbackPeriodStart:StringT(),
|
||||
lookbackPeriodEnd:StringT(),
|
||||
lookbackPeriodStart:StringT({pattern:'[0-9]{4}\-[0-9]{2}\-[0-9]{2}'}),
|
||||
lookbackPeriodEnd:StringT({pattern:'[0-9]{4}\-[0-9]{2}\-[0-9]{2}'}),
|
||||
})))
|
||||
.query(async (opts)=>{
|
||||
const {underlying, daysToFrontExpiration, daysBetweenFrontAndBackExpiration, lookbackPeriodStart, lookbackPeriodEnd, } = opts.input;
|
||||
|
||||
Reference in New Issue
Block a user