@forklaunch/core 0.14.16 → 0.15.1-debug-hmac

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, TypeSafeFunction, StringWithoutSlash, Prettify, SanitizePathSlashes, MakePropertyOptionalIfChildrenOptional, PrettyCamelCase, EmptyObject } from '@forklaunch/common';
3
+ import { UnionToIntersection, TypeSafeFunction, StringWithoutSlash, Prettify, MakePropertyOptionalIfChildrenOptional, SanitizePathSlashes, PrettyCamelCase, EmptyObject } from '@forklaunch/common';
4
4
  import { AnySchemaValidator, UnboxedObjectSchema, IdiomaticSchema, Schema } from '@forklaunch/validator';
5
5
  import { ServerOptions, IncomingMessage, ServerResponse } from 'node:http';
6
6
  import { Counter, Gauge, Histogram, UpDownCounter, ObservableCounter, ObservableGauge, ObservableUpDownCounter, Span } from '@opentelemetry/api';
@@ -1111,6 +1111,13 @@ interface ForklaunchRouter<SV extends AnySchemaValidator> {
1111
1111
  sdkPaths: Record<string, string>;
1112
1112
  /** Options for the router */
1113
1113
  routerOptions?: ExpressLikeRouterOptions<SV, SessionObject<SV>>;
1114
+ /** Insert the SDK path into the router */
1115
+ insertIntoRouterSdkPaths?: (params: {
1116
+ sdkPath: string;
1117
+ path: string;
1118
+ method: string;
1119
+ name: string;
1120
+ }) => void;
1114
1121
  }
1115
1122
  /**
1116
1123
  * Interface representing a Forklaunch route.
@@ -1356,33 +1363,28 @@ type RouterMap<SV extends AnySchemaValidator> = {
1356
1363
  [K: string]: SdkRouter | RouterMap<SV>;
1357
1364
  };
1358
1365
  /**
1359
- * Tail-recursive type that extracts SDK interfaces from a RouterMap structure.
1360
- * This version uses an accumulator pattern to avoid deep recursion and improve performance.
1361
- * Traverses the nested router map and collects all SDK interfaces into a flat structure.
1366
+ * Recursive type representing a hierarchical map of SDK handlers.
1367
+ * Each key can either be a leaf node containing a SdkHandler, or a nested SdkHandlerObject for deeper structures.
1362
1368
  *
1363
- * @template SV - The schema validator type
1364
- * @template T - The RouterMap to extract SDKs from
1365
- * @template Acc - The accumulator type for collecting SDK interfaces (defaults to empty object)
1366
- * @param SV - Must extend AnySchemaValidator
1367
- * @param T - Must extend RouterMap<SV>
1368
- * @param Acc - The accumulated SDK interfaces so far
1369
- *
1370
- * @returns A mapped type where each key corresponds to the original router structure,
1371
- * but values are the extracted SDK interfaces instead of the full router configuration
1369
+ * @template SV - The schema validator type that constrains the handler structure.
1372
1370
  *
1373
1371
  * @example
1374
1372
  * ```typescript
1375
- * // Given a RouterMap with nested structure
1376
- * type ExtractedSdk = MapToSdk<ZodValidator, typeof routerMap>;
1377
- * // Results in: { api: { users: { getUser: () => Promise<{}> }, posts: { getPosts: () => Promise<[]> } } }
1373
+ * const handlers: SdkHandlerObject<ZodValidator> = {
1374
+ * users: {
1375
+ * getUser: someSdkHandler,
1376
+ * posts: {
1377
+ * getPosts: anotherSdkHandler
1378
+ * }
1379
+ * }
1380
+ * };
1378
1381
  * ```
1379
1382
  */
1380
- type MapToSdk<SV extends AnySchemaValidator, T extends RouterMap<SV>, Acc extends Record<string, unknown> = Record<string, never>> = Prettify<{
1381
- [K in keyof T]: T[K] extends {
1382
- sdk: unknown;
1383
- } ? T[K]['sdk'] : T[K] extends RouterMap<SV> ? MapToSdk<SV, T[K], Acc> : never;
1384
- }>;
1383
+ type SdkHandlerObject<SV extends AnySchemaValidator> = {
1384
+ [K: string]: SdkHandler | SdkHandlerObject<SV>;
1385
+ };
1385
1386
  /**
1387
+ * @deprecated
1386
1388
  * Tail-recursive type that extracts and flattens fetch map interfaces from a RouterMap structure.
1387
1389
  * This version uses an accumulator pattern to avoid deep recursion and improve performance.
1388
1390
  * Similar to MapToSdk but focuses on _fetchMap properties and merges all fetch maps into a single intersection type.
@@ -1409,7 +1411,6 @@ type MapToFetch<SV extends AnySchemaValidator, T extends RouterMap<SV>> = UnionT
1409
1411
  _fetchMap: unknown;
1410
1412
  } ? T[K]['_fetchMap'] extends Record<string, unknown> ? T[K]['_fetchMap'] : never : never;
1411
1413
  }[keyof T]>>;
1412
- type CollectionOptimized<T> = T extends infer U ? U : never;
1413
1414
  /**
1414
1415
  * Base interface for controller entries that defines the structure
1415
1416
  * of each controller method with its path, HTTP method, and contract details.
@@ -1458,10 +1459,25 @@ type SdkHandler = {
1458
1459
  versions?: unknown;
1459
1460
  };
1460
1461
  };
1461
- type MapControllerToSdk<SV extends AnySchemaValidator, T extends Record<string, SdkHandler>> = CollectionOptimized<{
1462
- [K in keyof T]: LiveSdkFunction<SV, T[K]['contractDetails']['params'] extends infer Params | undefined ? Params extends ParamsObject<SV> ? Params : ParamsObject<SV> : ParamsObject<SV>, T[K]['contractDetails']['responses'] extends infer Responses | undefined ? Responses extends ResponsesObject<SV> ? Responses : ResponsesObject<SV> : ResponsesObject<SV>, T[K]['contractDetails']['body'] extends infer B | undefined ? B extends Body<SV> ? B : Body<SV> : Body<SV>, T[K]['contractDetails']['query'] extends infer Q | undefined ? Q extends QueryObject<SV> ? Q : QueryObject<SV> : QueryObject<SV>, T[K]['contractDetails']['requestHeaders'] extends infer RequestHeaders | undefined ? RequestHeaders extends HeadersObject<SV> ? RequestHeaders : HeadersObject<SV> : HeadersObject<SV>, T[K]['contractDetails']['responseHeaders'] extends infer ResponseHeaders | undefined ? ResponseHeaders extends HeadersObject<SV> ? ResponseHeaders : HeadersObject<SV> : HeadersObject<SV>, T[K]['contractDetails']['versions'] extends infer Versions | undefined ? Versions extends VersionSchema<SV, Method> ? Versions : VersionSchema<SV, Method> : VersionSchema<SV, Method>, T[K]['contractDetails']['auth'] extends infer Auth | undefined ? Auth extends AuthMethodsBase ? Auth : AuthMethodsBase : AuthMethodsBase>;
1463
- }>;
1464
1462
  /**
1463
+ * Recursively maps a client controller definition to its corresponding live SDK function types.
1464
+ *
1465
+ * This utility type traverses the structure of a client controller object, replacing each
1466
+ * {@link SdkHandler} with its corresponding {@link MapHandlerToLiveSdk} type, while recursively
1467
+ * processing nested objects. This enables type-safe SDK generation for complex controller hierarchies.
1468
+ *
1469
+ * @template SV - The schema validator type (e.g., zod, typebox).
1470
+ * @template Client - The client controller object to map.
1471
+ *
1472
+ * @example
1473
+ * type MySdk = MapToSdk<typeof z, typeof myController>;
1474
+ */
1475
+ type MapToSdk<SV extends AnySchemaValidator, Client> = {
1476
+ [K in keyof Client]: Client[K] extends SdkHandler ? MapHandlerToLiveSdk<SV, Client[K]> : MapToSdk<SV, Client[K]>;
1477
+ };
1478
+ type MapHandlerToLiveSdk<SV extends AnySchemaValidator, T extends SdkHandler> = LiveSdkFunction<SV, T['contractDetails']['params'] extends infer Params | undefined ? Params extends ParamsObject<SV> ? Params : ParamsObject<SV> : ParamsObject<SV>, T['contractDetails']['responses'] extends infer Responses | undefined ? Responses extends ResponsesObject<SV> ? Responses : ResponsesObject<SV> : ResponsesObject<SV>, T['contractDetails']['body'] extends infer B | undefined ? B extends Body<SV> ? B : Body<SV> : Body<SV>, T['contractDetails']['query'] extends infer Q | undefined ? Q extends QueryObject<SV> ? Q : QueryObject<SV> : QueryObject<SV>, T['contractDetails']['requestHeaders'] extends infer RequestHeaders | undefined ? RequestHeaders extends HeadersObject<SV> ? RequestHeaders : HeadersObject<SV> : HeadersObject<SV>, T['contractDetails']['responseHeaders'] extends infer ResponseHeaders | undefined ? ResponseHeaders extends HeadersObject<SV> ? ResponseHeaders : HeadersObject<SV> : HeadersObject<SV>, T['contractDetails']['versions'] extends infer Versions | undefined ? Versions extends VersionSchema<SV, Method> ? Versions : VersionSchema<SV, Method> : VersionSchema<SV, Method>, T['contractDetails']['auth'] extends infer Auth | undefined ? Auth extends AuthMethodsBase ? Auth : AuthMethodsBase : AuthMethodsBase>;
1479
+ /**
1480
+ * @deprecated
1465
1481
  * Extracts and constructs a LiveTypeFunction from an SdkHandler object.
1466
1482
  * This optimized version reduces redundant type inference while maintaining type safety.
1467
1483
  *
@@ -1480,6 +1496,7 @@ type MapControllerToSdk<SV extends AnySchemaValidator, T extends Record<string,
1480
1496
  */
1481
1497
  type ExtractLiveTypeFn<Entry extends SdkHandler, SV extends AnySchemaValidator, BasePath extends `/${string}`> = LiveTypeFunction<SV, Entry['_path'] extends infer Path | undefined ? Path extends `/${string}` ? `${BasePath}${Path}` : never : never, Entry['contractDetails']['params'] extends infer Params | undefined ? Params extends ParamsObject<SV> ? Params : ParamsObject<SV> : ParamsObject<SV>, Entry['contractDetails']['responses'] extends infer Responses | undefined ? Responses extends ResponsesObject<SV> ? Responses : ResponsesObject<SV> : ResponsesObject<SV>, Entry['contractDetails']['body'] extends infer B | undefined ? B extends Body<SV> ? B : Body<SV> : Body<SV>, Entry['contractDetails']['query'] extends infer Q | undefined ? Q extends QueryObject<SV> ? Q : QueryObject<SV> : QueryObject<SV>, Entry['contractDetails']['requestHeaders'] extends infer RequestHeaders | undefined ? RequestHeaders extends HeadersObject<SV> ? RequestHeaders : HeadersObject<SV> : HeadersObject<SV>, Entry['contractDetails']['responseHeaders'] extends infer ResponseHeaders | undefined ? ResponseHeaders extends HeadersObject<SV> ? ResponseHeaders : HeadersObject<SV> : HeadersObject<SV>, Entry['_method'] extends Method ? Entry['_method'] : never, Entry['contractDetails']['versions'] extends infer Versions | undefined ? Versions extends VersionSchema<SV, Method> ? Versions : VersionSchema<SV, Method> : VersionSchema<SV, Method>, Entry['contractDetails']['auth'] extends infer Auth | undefined ? Auth extends AuthMethodsBase ? Auth : AuthMethodsBase : AuthMethodsBase>;
1482
1498
  /**
1499
+ * @deprecated
1483
1500
  * Transforms a controller object into a fetch map structure that provides
1484
1501
  * type-safe access to HTTP endpoints. This optimized version reduces complexity
1485
1502
  * while maintaining full type safety and discriminated union behavior.
@@ -1657,6 +1674,14 @@ declare class ForklaunchExpressLikeRouter<SV extends AnySchemaValidator, BasePat
1657
1674
  * @returns {ExpressRouter} - The Express router.
1658
1675
  */
1659
1676
  trace: LiveTypeRouteDefinition<SV, BasePath, 'trace', RouterHandler, Internal, RouterSession, BaseRequest, BaseResponse, NextFunction, this>;
1677
+ insertIntoRouterSdkPaths({ sdkPath, path, method, name }: {
1678
+ sdkPath: string;
1679
+ name: string;
1680
+ path: string;
1681
+ method: string;
1682
+ }): void;
1683
+ private unpackSdks;
1684
+ registerSdks(sdks: SdkHandlerObject<SV>): void;
1660
1685
  protected cloneInternals(clone: this): void;
1661
1686
  clone(): this;
1662
1687
  }
@@ -2038,202 +2063,6 @@ declare function discriminateResponseBodies<SV extends AnySchemaValidator>(schem
2038
2063
  schema: SV["_ValidSchemaObject"];
2039
2064
  }>;
2040
2065
 
2041
- /**
2042
- * Creates a complete SDK client from a RouterMap configuration.
2043
- * This is the main entry point for creating type-safe SDK clients that combine
2044
- * both SDK interfaces and fetch functionality from router configurations.
2045
- *
2046
- * @template SV - The schema validator type that constrains the router structure
2047
- * @template T - The RouterMap type to create the SDK client from
2048
- * @param schemaValidator - The schema validator instance used for validation and type constraints
2049
- * @param routerMap - The router map containing the complete API configuration
2050
- *
2051
- * @returns An object containing both the SDK interface and fetch function:
2052
- * - `sdk`: The extracted SDK interfaces for direct method calls
2053
- * - `fetch`: The unified fetch function for making HTTP requests
2054
- *
2055
- * @example
2056
- * ```typescript
2057
- * const routerMap = {
2058
- * api: {
2059
- * users: {
2060
- * sdk: { getUser: (id: string) => Promise.resolve({ id, name: 'John' }) },
2061
- * _fetchMap: { getUser: { get: (id: string) => fetch(`/api/users/${id}`) } }
2062
- * },
2063
- * posts: {
2064
- * sdk: { getPosts: () => Promise.resolve([]) },
2065
- * _fetchMap: { getPosts: { get: () => fetch('/api/posts') } }
2066
- * }
2067
- * }
2068
- * };
2069
- *
2070
- * const client = sdkClient(zodValidator, routerMap);
2071
- *
2072
- * // Use SDK methods directly
2073
- * const user = await client.sdk.api.users.getUser('123');
2074
- *
2075
- * // Use fetch function for custom requests
2076
- * const response = await client.fetch('getUser', { params: { id: '123' } });
2077
- * ```
2078
- */
2079
- declare function sdkClient<SV extends AnySchemaValidator, T extends RouterMap<SV>>(schemaValidator: SV, routerMap: T): {
2080
- _finalizedSdk: true;
2081
- sdk: MapToSdk<SV, T>;
2082
- fetch: FetchFunction<MapToFetch<SV, T>>;
2083
- };
2084
-
2085
- /**
2086
- * Creates a type-safe SDK router by mapping controller definitions to router SDK functions.
2087
- * This function takes a controller object with contract details and maps each controller method
2088
- * to the corresponding SDK function from the router, ensuring type safety throughout the process.
2089
- * The function now uses `const` template parameters for better type inference and includes
2090
- * a comprehensive fetch map for enhanced type safety.
2091
- *
2092
- * @template SV - The schema validator type that constrains the router and controller structure
2093
- * @template T - The controller type containing contract details for each endpoint (const parameter)
2094
- * @template Router - The router type that provides SDK functions, fetch, and _fetchMap capabilities (const parameter)
2095
- * @param SV - Must extend AnySchemaValidator to ensure type safety
2096
- * @param T - Must be a const record where each key maps to a controller method with contract details
2097
- * @param Router - Must be a const object with optional sdk, fetch, and _fetchMap properties
2098
- *
2099
- * @param schemaValidator - The schema validator instance used for validation and type constraints
2100
- * @param controller - The controller object containing contract details for each endpoint
2101
- * @param router - The router instance that provides SDK functions, fetch, and _fetchMap capabilities
2102
- *
2103
- * @returns An object containing:
2104
- * - `sdk`: Type-safe SDK functions mapped from controller methods using LiveSdkFunction
2105
- * - `fetch`: The router's fetch function cast to FetchFunction with proper typing
2106
- * - `_fetchMap`: A comprehensive fetch map with LiveTypeFunction for each endpoint and method
2107
- *
2108
- * @example
2109
- * ```typescript
2110
- * const controller = {
2111
- * createAgent: {
2112
- * _path: '/agents',
2113
- * _method: 'POST',
2114
- * contractDetails: {
2115
- * name: 'createAgent',
2116
- * body: { name: 'string', organizationId: 'string' },
2117
- * responses: { 200: { id: 'string', name: 'string' } }
2118
- * }
2119
- * },
2120
- * getAgent: {
2121
- * _path: '/agents/:id',
2122
- * _method: 'GET',
2123
- * contractDetails: {
2124
- * name: 'getAgent',
2125
- * params: { id: 'string' },
2126
- * responses: { 200: { id: 'string', name: 'string' } }
2127
- * }
2128
- * }
2129
- * } as const;
2130
- *
2131
- * const router = {
2132
- * sdk: { createAgent: () => Promise.resolve({}), getAgent: () => Promise.resolve({}) },
2133
- * fetch: (path: string, options: any) => fetch(path, options),
2134
- * _fetchMap: { '/agents': { POST: () => fetch('/agents', { method: 'POST' }) } }
2135
- * } as const;
2136
- *
2137
- * const sdkRouter = sdkRouter(zodValidator, controller, router);
2138
- *
2139
- * // Use SDK functions with full type safety
2140
- * const agent = await sdkRouter.sdk.createAgent({
2141
- * body: { name: 'My Agent', organizationId: 'org123' }
2142
- * });
2143
- *
2144
- * const agentData = await sdkRouter.sdk.getAgent({
2145
- * params: { id: 'agent123' }
2146
- * });
2147
- *
2148
- * // Use fetch function with enhanced type safety
2149
- * const response = await sdkRouter.fetch('/agents', {
2150
- * method: 'POST',
2151
- * body: { name: 'Custom Agent', organizationId: 'org456' }
2152
- * });
2153
- *
2154
- * // Access the fetch map for advanced usage
2155
- * const _fetchMap = sdkRouter._fetchMap;
2156
- * ```
2157
- */
2158
- declare function sdkRouter<SV extends AnySchemaValidator, const T extends Record<string, SdkHandler>, const Router extends {
2159
- sdk?: unknown;
2160
- fetch?: unknown;
2161
- _fetchMap?: unknown;
2162
- basePath?: string;
2163
- sdkPaths: Record<string, string>;
2164
- }>(schemaValidator: SV, controller: T, router: Router): {
2165
- sdk: MapControllerToSdk<SV, T>;
2166
- fetch: FetchFunction<{ [K_1 in keyof T as T[K_1]["_path"] extends infer P | undefined ? P extends `/${string}` ? `${Router["basePath"] extends `/${string}` ? Router["basePath"] : "/"}${P}` : never : never]: { [M in T[K_1]["_method"] as M extends Method ? Uppercase<M> : never]: LiveTypeFunction<SV, Extract<T[K_1], {
2167
- _path: T[K_1]["_path"];
2168
- _method: M;
2169
- }>["_path"] extends infer Path | undefined ? Path extends `/${string}` ? `${Router["basePath"] extends `/${string}` ? Router["basePath"] : "/"}${Path}` : never : never, Extract<T[K_1], {
2170
- _path: T[K_1]["_path"];
2171
- _method: M;
2172
- }>["contractDetails"]["params"] extends infer Params | undefined ? Params extends ParamsObject<SV> ? Params : ParamsObject<SV> : ParamsObject<SV>, Extract<T[K_1], {
2173
- _path: T[K_1]["_path"];
2174
- _method: M;
2175
- }>["contractDetails"]["responses"] extends infer Responses | undefined ? Responses extends ResponsesObject<SV> ? Responses : ResponsesObject<SV> : ResponsesObject<SV>, Extract<T[K_1], {
2176
- _path: T[K_1]["_path"];
2177
- _method: M;
2178
- }>["contractDetails"]["body"] extends infer B | undefined ? B extends Body<SV> ? B : Body<SV> : Body<SV>, Extract<T[K_1], {
2179
- _path: T[K_1]["_path"];
2180
- _method: M;
2181
- }>["contractDetails"]["query"] extends infer Q | undefined ? Q extends QueryObject<SV> ? Q : QueryObject<SV> : QueryObject<SV>, Extract<T[K_1], {
2182
- _path: T[K_1]["_path"];
2183
- _method: M;
2184
- }>["contractDetails"]["requestHeaders"] extends infer RequestHeaders | undefined ? RequestHeaders extends HeadersObject<SV> ? RequestHeaders : HeadersObject<SV> : HeadersObject<SV>, Extract<T[K_1], {
2185
- _path: T[K_1]["_path"];
2186
- _method: M;
2187
- }>["contractDetails"]["responseHeaders"] extends infer ResponseHeaders | undefined ? ResponseHeaders extends HeadersObject<SV> ? ResponseHeaders : HeadersObject<SV> : HeadersObject<SV>, Extract<T[K_1], {
2188
- _path: T[K_1]["_path"];
2189
- _method: M;
2190
- }>["_method"] extends Method ? Extract<T[K_1], {
2191
- _path: T[K_1]["_path"];
2192
- _method: M;
2193
- }>["_method"] : never, Extract<T[K_1], {
2194
- _path: T[K_1]["_path"];
2195
- _method: M;
2196
- }>["contractDetails"]["versions"] extends infer Versions | undefined ? Versions extends VersionSchema<SV, Method> ? Versions : VersionSchema<SV, Method> : VersionSchema<SV, Method>, Extract<T[K_1], {
2197
- _path: T[K_1]["_path"];
2198
- _method: M;
2199
- }>["contractDetails"]["auth"] extends infer Auth | undefined ? Auth extends AuthMethodsBase ? Auth : AuthMethodsBase : AuthMethodsBase>; }; } extends infer T_1 ? { [K in keyof T_1]: T_1[K]; } : never>;
2200
- _fetchMap: { [K_1 in keyof T as T[K_1]["_path"] extends infer P | undefined ? P extends `/${string}` ? `${Router["basePath"] extends `/${string}` ? Router["basePath"] : "/"}${P}` : never : never]: { [M in T[K_1]["_method"] as M extends Method ? Uppercase<M> : never]: LiveTypeFunction<SV, Extract<T[K_1], {
2201
- _path: T[K_1]["_path"];
2202
- _method: M;
2203
- }>["_path"] extends infer Path | undefined ? Path extends `/${string}` ? `${Router["basePath"] extends `/${string}` ? Router["basePath"] : "/"}${Path}` : never : never, Extract<T[K_1], {
2204
- _path: T[K_1]["_path"];
2205
- _method: M;
2206
- }>["contractDetails"]["params"] extends infer Params | undefined ? Params extends ParamsObject<SV> ? Params : ParamsObject<SV> : ParamsObject<SV>, Extract<T[K_1], {
2207
- _path: T[K_1]["_path"];
2208
- _method: M;
2209
- }>["contractDetails"]["responses"] extends infer Responses | undefined ? Responses extends ResponsesObject<SV> ? Responses : ResponsesObject<SV> : ResponsesObject<SV>, Extract<T[K_1], {
2210
- _path: T[K_1]["_path"];
2211
- _method: M;
2212
- }>["contractDetails"]["body"] extends infer B | undefined ? B extends Body<SV> ? B : Body<SV> : Body<SV>, Extract<T[K_1], {
2213
- _path: T[K_1]["_path"];
2214
- _method: M;
2215
- }>["contractDetails"]["query"] extends infer Q | undefined ? Q extends QueryObject<SV> ? Q : QueryObject<SV> : QueryObject<SV>, Extract<T[K_1], {
2216
- _path: T[K_1]["_path"];
2217
- _method: M;
2218
- }>["contractDetails"]["requestHeaders"] extends infer RequestHeaders | undefined ? RequestHeaders extends HeadersObject<SV> ? RequestHeaders : HeadersObject<SV> : HeadersObject<SV>, Extract<T[K_1], {
2219
- _path: T[K_1]["_path"];
2220
- _method: M;
2221
- }>["contractDetails"]["responseHeaders"] extends infer ResponseHeaders | undefined ? ResponseHeaders extends HeadersObject<SV> ? ResponseHeaders : HeadersObject<SV> : HeadersObject<SV>, Extract<T[K_1], {
2222
- _path: T[K_1]["_path"];
2223
- _method: M;
2224
- }>["_method"] extends Method ? Extract<T[K_1], {
2225
- _path: T[K_1]["_path"];
2226
- _method: M;
2227
- }>["_method"] : never, Extract<T[K_1], {
2228
- _path: T[K_1]["_path"];
2229
- _method: M;
2230
- }>["contractDetails"]["versions"] extends infer Versions | undefined ? Versions extends VersionSchema<SV, Method> ? Versions : VersionSchema<SV, Method> : VersionSchema<SV, Method>, Extract<T[K_1], {
2231
- _path: T[K_1]["_path"];
2232
- _method: M;
2233
- }>["contractDetails"]["auth"] extends infer Auth | undefined ? Auth extends AuthMethodsBase ? Auth : AuthMethodsBase : AuthMethodsBase>; }; } extends infer T_2 ? { [K in keyof T_2]: T_2[K]; } : never;
2234
- sdkPaths: Router["sdkPaths"];
2235
- };
2236
-
2237
2066
  declare const ATTR_API_NAME = "api.name";
2238
2067
  declare const ATTR_CORRELATION_ID = "correlation.id";
2239
2068
 
@@ -2267,4 +2096,4 @@ declare function logger(level: LevelWithSilentOrString, meta?: AnyValueMap): Pin
2267
2096
 
2268
2097
  declare function recordMetric<SV extends AnySchemaValidator, P extends ParamsDictionary, ReqBody extends Record<string, unknown>, ReqQuery extends ParsedQs, ResBodyMap extends Record<string, unknown>, ReqHeaders extends Record<string, string>, ResHeaders extends Record<string, unknown>, LocalsObj extends Record<string, unknown>, VersionedReqs extends VersionedRequests, SessionSchema extends Record<string, unknown>>(req: ForklaunchRequest<SV, P, ReqBody, ReqQuery, ReqHeaders, Extract<keyof VersionedReqs, string>, SessionSchema>, res: ForklaunchResponse<unknown, ResBodyMap, ResHeaders, LocalsObj, Extract<keyof VersionedReqs, string>>): void;
2269
2098
 
2270
- export { ATTR_API_NAME, ATTR_CORRELATION_ID, type AuthMethods, type AuthMethodsBase, type BasicAuthMethods, type Body, type BodyObject, type ClusterConfig, type ConstrainedForklaunchRouter, type ContractDetails, type ContractDetailsExpressLikeSchemaHandler, type ContractDetailsOrMiddlewareOrTypedHandler, type DecodeResource, type DocsConfiguration, type ErrorContainer, type ExpressLikeApplicationOptions, type ExpressLikeAuthMapper, type ExpressLikeGlobalAuthOptions, type ExpressLikeHandler, type ExpressLikeRouter, type ExpressLikeRouterOptions, type ExpressLikeSchemaAuthMapper, type ExpressLikeSchemaGlobalAuthOptions, type ExpressLikeSchemaHandler, type ExpressLikeTypedHandler, type ExtractBody, type ExtractContentType, type ExtractLiveTypeFn, 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 HmacMethods, type HttpContractDetails, type HttpMethod, type JsonBody, type JwtAuthMethods, type LiveSdkFunction, type LiveTypeFunction, type LiveTypeFunctionRequestInit, type LiveTypeRouteDefinition, type LogFn, type LoggerMeta, type MapControllerToSdk, type MapParamsSchema, type MapReqBodySchema, type MapReqHeadersSchema, type MapReqQuerySchema, type MapResBodyMapSchema, type MapResHeadersSchema, type MapSchema, type MapSessionSchema, type MapToFetch, type MapToSdk, type MapVersionedReqsSchema, type MapVersionedRespsSchema, type Method, type MetricType, type MetricsDefinition, type MiddlewareContractDetails, type MiddlewareOrMiddlewareWithTypedHandler, type MultipartForm, type NestableRouterBasedHandler, type NumberOnlyObject, OPENAPI_DEFAULT_VERSION, 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 ResolvedForklaunchResponse, type ResolvedSessionObject, type ResponseBody, type ResponseCompiledSchema, type ResponseShape, type ResponsesObject, type RouterMap, type RoutingStrategy, type SchemaAuthMethods, type SdkHandler, type SdkRouter, type ServerSentEventBody, type SessionObject, type StatusCode, type StringOnlyObject, type TelemetryOptions, type TextBody, type ToFetchMap, type TypedBody, type TypedHandler, type TypedMiddlewareDefinition, type TypedNestableMiddlewareDefinition, type TypedRequestBody, type TypedResponseBody, type UnknownBody, type UnknownResponseBody, type UrlEncodedForm, type VersionSchema, type VersionedRequests, type VersionedResponses, createHmacToken, delete_, discriminateAuthMethod, discriminateBody, discriminateResponseBodies, enrichExpressLikeSend, evaluateTelemetryOptions, generateMcpServer, generateOpenApiSpecs, get, getCachedJwks, getCodeForStatus, head, httpRequestsTotalCounter, httpServerDurationHistogram, isClientError, isForklaunchRequest, isForklaunchRouter, isInformational, isPortBound, isRedirection, isServerError, isSuccessful, isValidStatusCode, logger, meta, metricsDefinitions, middleware, options, patch, post, put, recordMetric, sdkClient, sdkRouter, trace, typedAuthHandler, typedHandler };
2099
+ export { ATTR_API_NAME, ATTR_CORRELATION_ID, type AuthMethods, type AuthMethodsBase, type BasicAuthMethods, type Body, type BodyObject, type ClusterConfig, type ConstrainedForklaunchRouter, type ContractDetails, type ContractDetailsExpressLikeSchemaHandler, type ContractDetailsOrMiddlewareOrTypedHandler, type DecodeResource, type DocsConfiguration, type ErrorContainer, type ExpressLikeApplicationOptions, type ExpressLikeAuthMapper, type ExpressLikeGlobalAuthOptions, type ExpressLikeHandler, type ExpressLikeRouter, type ExpressLikeRouterOptions, type ExpressLikeSchemaAuthMapper, type ExpressLikeSchemaGlobalAuthOptions, type ExpressLikeSchemaHandler, type ExpressLikeTypedHandler, type ExtractBody, type ExtractContentType, type ExtractLiveTypeFn, 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 HmacMethods, type HttpContractDetails, type HttpMethod, type JsonBody, type JwtAuthMethods, type LiveSdkFunction, type LiveTypeFunction, type LiveTypeFunctionRequestInit, type LiveTypeRouteDefinition, type LogFn, type LoggerMeta, type MapHandlerToLiveSdk, type MapParamsSchema, type MapReqBodySchema, type MapReqHeadersSchema, type MapReqQuerySchema, type MapResBodyMapSchema, type MapResHeadersSchema, type MapSchema, type MapSessionSchema, type MapToFetch, type MapToSdk, type MapVersionedReqsSchema, type MapVersionedRespsSchema, type Method, type MetricType, type MetricsDefinition, type MiddlewareContractDetails, type MiddlewareOrMiddlewareWithTypedHandler, type MultipartForm, type NestableRouterBasedHandler, type NumberOnlyObject, OPENAPI_DEFAULT_VERSION, 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 ResolvedForklaunchResponse, type ResolvedSessionObject, type ResponseBody, type ResponseCompiledSchema, type ResponseShape, type ResponsesObject, type RouterMap, type RoutingStrategy, type SchemaAuthMethods, type SdkHandler, type SdkHandlerObject, type SdkRouter, type ServerSentEventBody, type SessionObject, type StatusCode, type StringOnlyObject, type TelemetryOptions, type TextBody, type ToFetchMap, type TypedBody, type TypedHandler, type TypedMiddlewareDefinition, type TypedNestableMiddlewareDefinition, type TypedRequestBody, type TypedResponseBody, type UnknownBody, type UnknownResponseBody, type UrlEncodedForm, type VersionSchema, type VersionedRequests, type VersionedResponses, createHmacToken, delete_, discriminateAuthMethod, discriminateBody, discriminateResponseBodies, enrichExpressLikeSend, evaluateTelemetryOptions, generateMcpServer, generateOpenApiSpecs, get, getCachedJwks, getCodeForStatus, head, httpRequestsTotalCounter, httpServerDurationHistogram, isClientError, isForklaunchRequest, isForklaunchRouter, isInformational, isPortBound, isRedirection, isServerError, isSuccessful, isValidStatusCode, logger, meta, metricsDefinitions, middleware, options, patch, post, put, recordMetric, trace, typedAuthHandler, typedHandler };