@forklaunch/core 0.11.1 → 0.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { ParsedQs } from 'qs';
2
2
  export { ParsedQs } from 'qs';
3
- import { UnionToIntersection, StringWithoutSlash, ExclusiveRecord, Prettify, SanitizePathSlashes, MakePropertyOptionalIfChildrenOptional, PrettyCamelCase, TypeSafeFunction, MergeArrayOfMaps, UnionToIntersectionChildren, EmptyObject } from '@forklaunch/common';
3
+ import { UnionToIntersection, StringWithoutSlash, ExclusiveRecord, Prettify, SanitizePathSlashes, MakePropertyOptionalIfChildrenOptional, PrettyCamelCase, TypeSafeFunction, EmptyObject } from '@forklaunch/common';
4
4
  import { AnySchemaValidator, UnboxedObjectSchema, IdiomaticSchema, Schema } from '@forklaunch/validator';
5
5
  import { CorsOptions } from 'cors';
6
6
  import { Counter, Gauge, Histogram, UpDownCounter, ObservableCounter, ObservableGauge, ObservableUpDownCounter, Span } from '@opentelemetry/api';
@@ -382,6 +382,24 @@ interface RequestContext {
382
382
  /** Active OpenTelemetry Span */
383
383
  span?: Span;
384
384
  }
385
+ interface ForklaunchBaseRequest<P extends ParamsDictionary, ReqBody extends Record<string, unknown>, ReqQuery extends ParsedQs, ReqHeaders extends Record<string, string>> {
386
+ /** Request parameters */
387
+ params: P;
388
+ /** Request headers */
389
+ headers: ReqHeaders;
390
+ /** Request body */
391
+ body: ReqBody;
392
+ /** Request query */
393
+ query: ReqQuery;
394
+ /** Method */
395
+ method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'CONNECT' | 'TRACE';
396
+ /** Request path */
397
+ path: string;
398
+ /** Original path */
399
+ originalPath: string;
400
+ /** OpenTelemetry Collector */
401
+ openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
402
+ }
385
403
  /**
386
404
  * Interface representing a Forklaunch request.
387
405
  *
@@ -561,6 +579,9 @@ type ForklaunchNextFunction = (err?: unknown) => void;
561
579
  type ResolvedForklaunchRequest<SV extends AnySchemaValidator, P extends ParamsDictionary, ReqBody extends Record<string, unknown>, ReqQuery extends ParsedQs, ReqHeaders extends Record<string, string>, BaseRequest> = unknown extends BaseRequest ? ForklaunchRequest<SV, P, ReqBody, ReqQuery, ReqHeaders> : {
562
580
  [key in keyof BaseRequest]: key extends keyof ForklaunchRequest<SV, P, ReqBody, ReqQuery, ReqHeaders> ? ForklaunchRequest<SV, P, ReqBody, ReqQuery, ReqHeaders>[key] : key extends keyof BaseRequest ? BaseRequest[key] : never;
563
581
  };
582
+ type ResolvedForklaunchAuthRequest<P extends ParamsDictionary, ReqBody extends Record<string, unknown>, ReqQuery extends ParsedQs, ReqHeaders extends Record<string, string>, BaseRequest> = unknown extends BaseRequest ? ForklaunchBaseRequest<P, ReqBody, ReqQuery, ReqHeaders> : {
583
+ [key in keyof BaseRequest]: key extends keyof ForklaunchBaseRequest<P, ReqBody, ReqQuery, ReqHeaders> ? ForklaunchBaseRequest<P, ReqBody, ReqQuery, ReqHeaders>[key] : key extends keyof BaseRequest ? BaseRequest[key] : never;
584
+ };
564
585
  /**
565
586
  * Represents a middleware handler with schema validation.
566
587
  *
@@ -900,13 +921,67 @@ type ContractDetailsOrMiddlewareOrTypedHandler<SV extends AnySchemaValidator, Na
900
921
  type MiddlewareOrMiddlewareWithTypedHandler<SV extends AnySchemaValidator, Name extends string, ContractMethod extends Method, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, BaseRequest, BaseResponse, NextFunction, Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, BaseRequest>> = ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, BaseRequest, BaseResponse, NextFunction> | TypedHandler<SV, Name, ContractMethod, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, BaseRequest, BaseResponse, NextFunction, Auth>;
901
922
 
902
923
  /**
903
- * Extracts all fetchMaps from an array of routers and merges them
904
- */
905
- type UnionedFetchMap<Routers extends readonly unknown[]> = MergeArrayOfMaps<{
906
- [K in keyof Routers]: Routers[K] extends {
907
- fetchMap: infer FM;
908
- } ? FM extends Record<string, unknown> ? FM : Record<string, never> : Record<string, never>;
909
- }>;
924
+ * Creates a type-safe fetch function based on a provided fetch map.
925
+ * This type generates a function that provides compile-time type safety for HTTP requests,
926
+ * ensuring that the correct path and request parameters are used for each endpoint.
927
+ *
928
+ * @template FetchMap - A record mapping paths to their corresponding TypeSafeFunction signatures
929
+ * @param FetchMap[Path] - Each path should map to a TypeSafeFunction that defines the request/response contract
930
+ *
931
+ * @returns A generic function that:
932
+ * - Takes a path parameter constrained to keys of FetchMap
933
+ * - Takes optional request initialization parameters based on the function signature
934
+ * - Returns a Promise of the expected response type
935
+ *
936
+ * @remarks
937
+ * The function parameters are conditionally typed:
938
+ * - If the mapped function expects body, query, params, or headers, reqInit is required
939
+ * - Otherwise, reqInit is optional
940
+ * - If the path doesn't map to a TypeSafeFunction, reqInit is never
941
+ *
942
+ * @example
943
+ * ```typescript
944
+ * // Define your API endpoints
945
+ * type UserAPI = {
946
+ * '/users': (baseUrl: string, options?: { query?: { limit?: number } }) => Promise<User[]>;
947
+ * '/users/:id': (baseUrl: string, options: { params: { id: string } }) => Promise<User>;
948
+ * '/users/create': (baseUrl: string, options: { body: CreateUserRequest }) => Promise<User>;
949
+ * };
950
+ *
951
+ * // Create a type-safe fetch function
952
+ * type UserFetch = FetchFunction<UserAPI>;
953
+ *
954
+ * // Usage examples
955
+ * const userFetch: UserFetch = async (path, reqInit) => {
956
+ * // Implementation details...
957
+ * };
958
+ *
959
+ * // Type-safe calls
960
+ * const users = await userFetch('/users'); // reqInit is optional
961
+ * const user = await userFetch('/users/:id', { params: { id: '123' } }); // reqInit required
962
+ * const newUser = await userFetch('/users/create', { body: { name: 'John' } }); // reqInit required
963
+ * ```
964
+ *
965
+ * @example
966
+ * ```typescript
967
+ * // Advanced usage with multiple parameter types
968
+ * type ComplexAPI = {
969
+ * '/search': (baseUrl: string, options: {
970
+ * query: { q: string; limit?: number };
971
+ * headers: { 'X-API-Key': string };
972
+ * }) => Promise<SearchResult[]>;
973
+ * };
974
+ *
975
+ * type ComplexFetch = FetchFunction<ComplexAPI>;
976
+ * const complexFetch: ComplexFetch = async (path, reqInit) => { ... };
977
+ *
978
+ * // Both query and headers are required
979
+ * const results = await complexFetch('/search', {
980
+ * query: { q: 'typescript' },
981
+ * headers: { 'X-API-Key': 'secret' }
982
+ * });
983
+ * ```
984
+ **/
910
985
  type FetchFunction<FetchMap> = <Path extends keyof FetchMap>(path: Path, ...reqInit: FetchMap[Path] extends TypeSafeFunction ? Parameters<FetchMap[Path]>[1] extends {
911
986
  body: unknown;
912
987
  } | {
@@ -917,52 +992,174 @@ type FetchFunction<FetchMap> = <Path extends keyof FetchMap>(path: Path, ...reqI
917
992
  headers: unknown;
918
993
  } ? [reqInit: Parameters<FetchMap[Path]>[1]] : [reqInit?: Parameters<FetchMap[Path]>[1]] : [reqInit?: never]) => Promise<FetchMap[Path] extends TypeSafeFunction ? ReturnType<FetchMap[Path]> : never>;
919
994
  /**
920
- * Creates a client SDK type from an array of routers.
995
+ * Creates a router SDK by combining the router's SDK with its fetch functionality.
996
+ * This type merges the router's SDK interface with its fetch methods to create
997
+ * a complete router client.
921
998
  *
922
- * This type maps over router configurations to create a unified SDK client interface.
923
- * Each router can be either:
924
- * - A direct object with `sdkName` and `sdk` properties
925
- * - A function that returns an object with `sdkName` and `sdk` properties
999
+ * @template TRoute - A route object that must contain both `sdk` and `fetch` properties
1000
+ * @param TRoute.sdk - The SDK interface/methods for the route
1001
+ * @param TRoute.fetch - The fetch functionality for the route
926
1002
  *
927
- * @template Routers - Array of router configurations or router factory functions
928
- * @template {string} Routers[K]['sdkName'] - The name of the SDK for each router
929
- * @template {Record<string, unknown>} Routers[K]['sdk'] - The SDK methods/endpoints for each router
1003
+ * @returns A prettified object combining the SDK and fetch properties
930
1004
  *
931
1005
  * @example
932
1006
  * ```typescript
933
- * const routers = [
934
- * { sdkName: 'user', sdk: { create: () => {}, get: () => {} } },
935
- * () => ({ sdkName: 'auth', sdk: { login: () => {}, logout: () => {} } })
936
- * ];
1007
+ * type UserRoute = {
1008
+ * sdk: { getUser: () => Promise<User>; createUser: (data: UserData) => Promise<User> };
1009
+ * fetch: { get: (path: string) => Promise<Response> };
1010
+ * };
937
1011
  *
938
- * type Client = SdkClient<typeof routers>;
939
- * // Result: { user: { create: () => {}, get: () => {} }, auth: { login: () => {}, logout: () => {} } }
1012
+ * type UserRouter = SdkRouter<UserRoute>;
1013
+ * // Result: {
1014
+ * // getUser: () => Promise<User>;
1015
+ * // createUser: (data: UserData) => Promise<User>;
1016
+ * // fetch: { get: (path: string) => Promise<Response> };
1017
+ * // }
940
1018
  * ```
941
1019
  */
942
- type SdkClient<Routers extends ({
1020
+ type SdkRouter<TRoute extends {
1021
+ sdk: unknown;
1022
+ fetch: unknown;
1023
+ }> = Prettify<TRoute['sdk'] & {
1024
+ fetch: TRoute['fetch'];
1025
+ }>;
1026
+ /**
1027
+ * Creates a complete SDK client from a record of route definitions.
1028
+ * Each route in the input is transformed into an SdkRouter, creating a comprehensive
1029
+ * client SDK with all routes and their associated fetch functionality.
1030
+ *
1031
+ * @template Input - A record where each key represents a route name and each value
1032
+ * contains the route's SDK, fetch methods, optional SDK name, and base path
1033
+ * @param Input[K].sdk - The SDK interface for route K
1034
+ * @param Input[K].fetch - The fetch functionality for route K
1035
+ * @param Input[K].sdkName - Optional custom name for the SDK (defaults to camelCase basePath)
1036
+ * @param Input[K].basePath - The base URL path for the route (used for SDK naming if sdkName not provided)
1037
+ *
1038
+ * @returns A prettified object where each route becomes an SdkRouter
1039
+ *
1040
+ * @example
1041
+ * ```typescript
1042
+ * type Routes = {
1043
+ * users: {
1044
+ * sdk: { getUser: () => Promise<User> };
1045
+ * fetch: { get: (path: string) => Promise<Response> };
1046
+ * basePath: '/api/users';
1047
+ * };
1048
+ * posts: {
1049
+ * sdk: { getPost: () => Promise<Post> };
1050
+ * fetch: { get: (path: string) => Promise<Response> };
1051
+ * basePath: '/api/posts';
1052
+ * sdkName: 'articles';
1053
+ * };
1054
+ * };
1055
+ *
1056
+ * type Client = SdkClient<Routes>;
1057
+ * // Result: {
1058
+ * // users: { getUser: () => Promise<User>; fetch: {...} };
1059
+ * // posts: { getPost: () => Promise<Post>; fetch: {...} };
1060
+ * // }
1061
+ * ```
1062
+ */
1063
+ type SdkClient<Input extends Record<string, {
1064
+ sdk: unknown;
1065
+ fetch: unknown;
1066
+ sdkName?: string;
943
1067
  basePath: string;
1068
+ }>> = Prettify<{
1069
+ [K in keyof Input]: Prettify<SdkRouter<Input[K]>>;
1070
+ }>;
1071
+ /**
1072
+ * Validates and unpacks SDK client input by ensuring that each key in the input record
1073
+ * corresponds to either the route's custom `sdkName` or the PrettyCamelCase version
1074
+ * of its `basePath`. This type provides compile-time validation for SDK client configuration.
1075
+ *
1076
+ * @template Input - A record of route definitions to validate
1077
+ * @param Input[K].sdk - The SDK interface for route K
1078
+ * @param Input[K].fetch - The fetch functionality for route K
1079
+ * @param Input[K].sdkName - Optional custom SDK name that should match the key K
1080
+ * @param Input[K].basePath - Base path that when converted to PrettyCamelCase should match key K
1081
+ *
1082
+ * @returns The original Input type if valid, or 'Invalid SDK Client Input' if validation fails
1083
+ *
1084
+ * @example
1085
+ * ```typescript
1086
+ * // Valid input - key matches basePath in camelCase
1087
+ * type ValidInput = {
1088
+ * apiUsers: {
1089
+ * sdk: UserSdk;
1090
+ * fetch: FetchMethods;
1091
+ * basePath: '/api/users'; // PrettyCamelCase becomes 'apiUsers'
1092
+ * };
1093
+ * };
1094
+ * type Result1 = UnpackSdkClientInput<ValidInput>; // Returns ValidInput
1095
+ *
1096
+ * // Valid input - key matches custom sdkName
1097
+ * type ValidInput2 = {
1098
+ * userService: {
1099
+ * sdk: UserSdk;
1100
+ * fetch: FetchMethods;
1101
+ * sdkName: 'userService';
1102
+ * basePath: '/api/users';
1103
+ * };
1104
+ * };
1105
+ * type Result2 = UnpackSdkClientInput<ValidInput2>; // Returns ValidInput2
1106
+ *
1107
+ * // Invalid input - key doesn't match either sdkName or camelCase basePath
1108
+ * type InvalidInput = {
1109
+ * wrongKey: {
1110
+ * sdk: UserSdk;
1111
+ * fetch: FetchMethods;
1112
+ * basePath: '/api/users'; // Should be 'apiUsers'
1113
+ * };
1114
+ * };
1115
+ * type Result3 = UnpackSdkClientInput<InvalidInput>; // Returns 'Invalid SDK Client Input'
1116
+ * ```
1117
+ */
1118
+ type UnpackSdkClientInput<Input extends Record<string, {
1119
+ sdk: unknown;
1120
+ fetch: unknown;
944
1121
  sdkName?: string;
945
- sdk: Record<string, unknown>;
946
- } | ((...args: never[]) => {
947
1122
  basePath: string;
1123
+ }>> = Prettify<{
1124
+ [K in keyof Input]: K extends Input[K]['sdkName'] ? Input[K] : K extends PrettyCamelCase<Input[K]['basePath']> ? Input[K] : unknown;
1125
+ } extends Input ? Prettify<Input> : 'Invalid SDK Client Input'>;
1126
+ /**
1127
+ * Type alias for valid SDK client input configuration.
1128
+ * This type serves as a constraint to ensure that input to SDK client functions
1129
+ * conforms to the expected structure with required sdk, fetch, and basePath properties,
1130
+ * plus an optional sdkName property.
1131
+ *
1132
+ * @template Input - A record of route definitions that must conform to the SDK client structure
1133
+ * @param Input[K].sdk - The SDK interface containing route-specific methods
1134
+ * @param Input[K].fetch - The fetch functionality for making HTTP requests
1135
+ * @param Input[K].sdkName - Optional custom name for the SDK (if not provided, uses camelCase basePath)
1136
+ * @param Input[K].basePath - Required base URL path for the route
1137
+ *
1138
+ * @returns The input type unchanged, serving as a validation constraint
1139
+ *
1140
+ * @example
1141
+ * ```typescript
1142
+ * // Use as a constraint in function parameters
1143
+ * function createSdkClient<T extends ValidSdkClientInput<T>>(input: T): SdkClient<T> {
1144
+ * // Function implementation
1145
+ * }
1146
+ *
1147
+ * // Valid usage
1148
+ * const validInput = {
1149
+ * users: {
1150
+ * sdk: { getUser: () => Promise.resolve({}) },
1151
+ * fetch: { get: (path: string) => fetch(path) },
1152
+ * basePath: '/api/users'
1153
+ * }
1154
+ * } satisfies ValidSdkClientInput<UnpackSdkClientInput<typeof validInput>>;
1155
+ * ```
1156
+ */
1157
+ type ValidSdkClientInput<Input extends Record<string, {
1158
+ sdk: unknown;
1159
+ fetch: unknown;
948
1160
  sdkName?: string;
949
- sdk: Record<string, unknown>;
950
- }))[]> = {
951
- fetch: UnionedFetchMap<Routers> extends infer MergedFetchMap ? FetchFunction<MergedFetchMap> : never;
952
- sdk: UnionToIntersectionChildren<{
953
- [K in Routers[number] as PrettyCamelCase<K extends (...args: never[]) => {
954
- sdkName?: infer SdkName;
955
- basePath: infer BasePath;
956
- } ? string extends SdkName ? BasePath : SdkName : K extends {
957
- sdkName?: infer SdkName;
958
- basePath: infer BasePath;
959
- } ? string extends SdkName ? BasePath : SdkName : never>]: K extends (...args: never[]) => {
960
- sdk: infer Sdk;
961
- } ? Prettify<Sdk> : K extends {
962
- sdk: infer Sdk;
963
- } ? Prettify<Sdk> : never;
964
- }>;
965
- };
1161
+ basePath: string;
1162
+ }>> = Input;
966
1163
 
967
1164
  /**
968
1165
  * A class that represents an Express-like router.
@@ -1426,4 +1623,4 @@ type DocsConfiguration = ({
1426
1623
  type: 'swagger';
1427
1624
  };
1428
1625
 
1429
- export { ATTR_API_NAME, ATTR_CORRELATION_ID, type AuthMethods, type AuthMethodsBase, type BasicAuthMethods, type Body, type BodyObject, type ConstrainedForklaunchRouter, type ContractDetails, type ContractDetailsExpressLikeSchemaHandler, type ContractDetailsOrMiddlewareOrTypedHandler, type DocsConfiguration, type ErrorContainer, type ExpressLikeAuthMapper, type ExpressLikeHandler, type ExpressLikeRouter, type ExpressLikeSchemaAuthMapper, type ExpressLikeSchemaHandler, type ExpressLikeTypedHandler, type ExtractBody, type ExtractContentType, type ExtractResponseBody, type ExtractedParamsObject, type FetchFunction, type FileBody, ForklaunchExpressLikeApplication, ForklaunchExpressLikeRouter, type ForklaunchNextFunction, type ForklaunchRequest, type ForklaunchResErrors, type ForklaunchResHeaders, type ForklaunchResponse, type ForklaunchRoute, type ForklaunchRouter, type ForklaunchSendableData, type ForklaunchStatusResponse, HTTPStatuses, type HeadersObject, type HttpContractDetails, type HttpMethod, type JsonBody, type JwtAuthMethods, type LiveSdkFunction, type LiveTypeFunction, type LiveTypeFunctionRequestInit, type LiveTypeRouteDefinition, type LogFn, type LoggerMeta, type MapParamsSchema, type MapReqBodySchema, type MapReqHeadersSchema, type MapReqQuerySchema, type MapResBodyMapSchema, type MapResHeadersSchema, type MapSchema, type Method, type MetricType, type MetricsDefinition, type MiddlewareContractDetails, type MiddlewareOrMiddlewareWithTypedHandler, type MultipartForm, type NestableRouterBasedHandler, type NumberOnlyObject, OpenTelemetryCollector, type ParamsDictionary, type ParamsObject, type PathBasedHandler, type PathMatch, type PathOrMiddlewareBasedHandler, type PathParamHttpContractDetails, type PathParamMethod, type QueryObject, type RawTypedResponseBody, type RequestContext, type ResolvedForklaunchRequest, type ResponseBody, type ResponseCompiledSchema, type ResponseShape, type ResponsesObject, type SchemaAuthMethods, type SdkClient, type ServerSentEventBody, type StatusCode, type StringOnlyObject, type TelemetryOptions, type TextBody, type TypedBody, type TypedHandler, type TypedMiddlewareDefinition, type TypedNestableMiddlewareDefinition, type TypedResponseBody, type UnionedFetchMap, type UnknownBody, type UnknownResponseBody, type UrlEncodedForm, delete_, discriminateBody, discriminateResponseBodies, enrichExpressLikeSend, evaluateTelemetryOptions, generateMcpServer, generateSwaggerDocument, get, getCodeForStatus, head, httpRequestsTotalCounter, httpServerDurationHistogram, isClientError, isForklaunchRequest, isForklaunchRouter, isInformational, isRedirection, isServerError, isSuccessful, isValidStatusCode, logger, meta, metricsDefinitions, middleware, options, patch, post, put, recordMetric, trace, typedAuthHandler, typedHandler };
1626
+ export { ATTR_API_NAME, ATTR_CORRELATION_ID, type AuthMethods, type AuthMethodsBase, type BasicAuthMethods, type Body, type BodyObject, type ConstrainedForklaunchRouter, type ContractDetails, type ContractDetailsExpressLikeSchemaHandler, type ContractDetailsOrMiddlewareOrTypedHandler, type DocsConfiguration, type ErrorContainer, type ExpressLikeAuthMapper, type ExpressLikeHandler, type ExpressLikeRouter, type ExpressLikeSchemaAuthMapper, type ExpressLikeSchemaHandler, type ExpressLikeTypedHandler, type ExtractBody, type ExtractContentType, type ExtractResponseBody, type ExtractedParamsObject, type FetchFunction, type FileBody, type ForklaunchBaseRequest, ForklaunchExpressLikeApplication, ForklaunchExpressLikeRouter, type ForklaunchNextFunction, type ForklaunchRequest, type ForklaunchResErrors, type ForklaunchResHeaders, type ForklaunchResponse, type ForklaunchRoute, type ForklaunchRouter, type ForklaunchSendableData, type ForklaunchStatusResponse, HTTPStatuses, type HeadersObject, type HttpContractDetails, type HttpMethod, type JsonBody, type JwtAuthMethods, type LiveSdkFunction, type LiveTypeFunction, type LiveTypeFunctionRequestInit, type LiveTypeRouteDefinition, type LogFn, type LoggerMeta, type MapParamsSchema, type MapReqBodySchema, type MapReqHeadersSchema, type MapReqQuerySchema, type MapResBodyMapSchema, type MapResHeadersSchema, type MapSchema, type Method, type MetricType, type MetricsDefinition, type MiddlewareContractDetails, type MiddlewareOrMiddlewareWithTypedHandler, type MultipartForm, type NestableRouterBasedHandler, type NumberOnlyObject, OpenTelemetryCollector, type ParamsDictionary, type ParamsObject, type PathBasedHandler, type PathMatch, type PathOrMiddlewareBasedHandler, type PathParamHttpContractDetails, type PathParamMethod, type QueryObject, type RawTypedResponseBody, type RequestContext, type ResolvedForklaunchAuthRequest, type ResolvedForklaunchRequest, type ResponseBody, type ResponseCompiledSchema, type ResponseShape, type ResponsesObject, type SchemaAuthMethods, type SdkClient, type SdkRouter, type ServerSentEventBody, type StatusCode, type StringOnlyObject, type TelemetryOptions, type TextBody, type TypedBody, type TypedHandler, type TypedMiddlewareDefinition, type TypedNestableMiddlewareDefinition, type TypedResponseBody, type UnknownBody, type UnknownResponseBody, type UnpackSdkClientInput, type UrlEncodedForm, type ValidSdkClientInput, delete_, discriminateBody, discriminateResponseBodies, enrichExpressLikeSend, evaluateTelemetryOptions, generateMcpServer, generateSwaggerDocument, get, getCodeForStatus, head, httpRequestsTotalCounter, httpServerDurationHistogram, isClientError, isForklaunchRequest, isForklaunchRouter, isInformational, isRedirection, isServerError, isSuccessful, isValidStatusCode, logger, meta, metricsDefinitions, middleware, options, patch, post, put, recordMetric, trace, typedAuthHandler, typedHandler };