From 884772a232999e2890bd0a6cd8cfa7d98f1c6543 Mon Sep 17 00:00:00 2001 From: dholms Date: Thu, 30 Nov 2023 17:21:36 -0600 Subject: [PATCH] fix lex codegen --- packages/bsky/src/lexicon/index.ts | 2 ++ packages/lex-cli/src/codegen/server.ts | 6 ++++++ packages/pds/src/lexicon/index.ts | 2 ++ 3 files changed, 10 insertions(+) diff --git a/packages/bsky/src/lexicon/index.ts b/packages/bsky/src/lexicon/index.ts index c9a645e2769..c51998a66e6 100644 --- a/packages/bsky/src/lexicon/index.ts +++ b/packages/bsky/src/lexicon/index.ts @@ -1597,11 +1597,13 @@ type RouteRateLimitOpts = { calcKey?: (ctx: T) => string calcPoints?: (ctx: T) => number } +type HandlerOpts = { blobLimit?: number } type HandlerRateLimitOpts = SharedRateLimitOpts | RouteRateLimitOpts type ConfigOf = | Handler | { auth?: Auth + opts?: HandlerOpts rateLimit?: HandlerRateLimitOpts | HandlerRateLimitOpts[] handler: Handler } diff --git a/packages/lex-cli/src/codegen/server.ts b/packages/lex-cli/src/codegen/server.ts index 8363f1630c6..a86867d293b 100644 --- a/packages/lex-cli/src/codegen/server.ts +++ b/packages/lex-cli/src/codegen/server.ts @@ -203,6 +203,11 @@ const indexTs = ( }`, }) + file.addTypeAlias({ + name: 'HandlerOpts', + type: `{ blobLimit?: number }`, + }) + file.addTypeAlias({ name: 'HandlerRateLimitOpts', typeParameters: [{ name: 'T' }], @@ -220,6 +225,7 @@ const indexTs = ( | Handler | { auth?: Auth + opts?: HandlerOpts rateLimit?: HandlerRateLimitOpts | HandlerRateLimitOpts[] handler: Handler }`, diff --git a/packages/pds/src/lexicon/index.ts b/packages/pds/src/lexicon/index.ts index c9a645e2769..c51998a66e6 100644 --- a/packages/pds/src/lexicon/index.ts +++ b/packages/pds/src/lexicon/index.ts @@ -1597,11 +1597,13 @@ type RouteRateLimitOpts = { calcKey?: (ctx: T) => string calcPoints?: (ctx: T) => number } +type HandlerOpts = { blobLimit?: number } type HandlerRateLimitOpts = SharedRateLimitOpts | RouteRateLimitOpts type ConfigOf = | Handler | { auth?: Auth + opts?: HandlerOpts rateLimit?: HandlerRateLimitOpts | HandlerRateLimitOpts[] handler: Handler }