@forklaunch/core 1.3.9 → 1.3.11
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.
- package/lib/{apiDefinition.types-fBjxhhaM.d.ts → apiDefinition.types-BNRPj2PT.d.ts} +1 -1
- package/lib/{apiDefinition.types-CtTiIWvC.d.mts → apiDefinition.types-CPWnG8GH.d.mts} +1 -1
- package/lib/http/index.d.mts +22 -7
- package/lib/http/index.d.ts +22 -7
- package/lib/http/index.js +28 -28
- package/lib/http/index.js.map +1 -1
- package/lib/http/index.mjs +28 -28
- package/lib/http/index.mjs.map +1 -1
- package/lib/{openTelemetryCollector-DorlR4pn.d.mts → openTelemetryCollector-DXGXRvQP.d.mts} +3 -22
- package/lib/{openTelemetryCollector-DorlR4pn.d.ts → openTelemetryCollector-DXGXRvQP.d.ts} +3 -22
- package/lib/persistence/index.d.mts +13 -12
- package/lib/persistence/index.d.ts +13 -12
- package/lib/persistence/index.js +95 -38
- package/lib/persistence/index.js.map +1 -1
- package/lib/persistence/index.mjs +95 -38
- package/lib/persistence/index.mjs.map +1 -1
- package/lib/services/index.d.mts +1 -2
- package/lib/services/index.d.ts +1 -2
- package/lib/ws/index.d.mts +2 -3
- package/lib/ws/index.d.ts +2 -3
- package/package.json +3 -3
|
@@ -4,7 +4,7 @@ import { Span } from '@opentelemetry/api';
|
|
|
4
4
|
import { JWTPayload, JWK } from 'jose';
|
|
5
5
|
import { ParsedQs } from 'qs';
|
|
6
6
|
import { Readable } from 'stream';
|
|
7
|
-
import { O as OpenTelemetryCollector, M as MetricsDefinition } from './openTelemetryCollector-
|
|
7
|
+
import { O as OpenTelemetryCollector, M as MetricsDefinition } from './openTelemetryCollector-DXGXRvQP.js';
|
|
8
8
|
import { CorsOptions } from 'cors';
|
|
9
9
|
import { FastMCP } from 'fastmcp';
|
|
10
10
|
import http from 'http';
|
|
@@ -4,7 +4,7 @@ import { Span } from '@opentelemetry/api';
|
|
|
4
4
|
import { JWTPayload, JWK } from 'jose';
|
|
5
5
|
import { ParsedQs } from 'qs';
|
|
6
6
|
import { Readable } from 'stream';
|
|
7
|
-
import { O as OpenTelemetryCollector, M as MetricsDefinition } from './openTelemetryCollector-
|
|
7
|
+
import { O as OpenTelemetryCollector, M as MetricsDefinition } from './openTelemetryCollector-DXGXRvQP.mjs';
|
|
8
8
|
import { CorsOptions } from 'cors';
|
|
9
9
|
import { FastMCP } from 'fastmcp';
|
|
10
10
|
import http from 'http';
|
package/lib/http/index.d.mts
CHANGED
|
@@ -3,21 +3,21 @@ export { ParsedQs } from 'qs';
|
|
|
3
3
|
import { Prettify, SanitizePathSlashes, PrettyCamelCase, TypeSafeFunction, UnionToIntersection, EmptyObject } from '@forklaunch/common';
|
|
4
4
|
import { AnySchemaValidator } from '@forklaunch/validator';
|
|
5
5
|
import { ServerOptions, IncomingMessage, ServerResponse } from 'node:http';
|
|
6
|
-
import { O as OpenTelemetryCollector, M as MetricsDefinition, T as TelemetryOptions } from '../openTelemetryCollector-
|
|
7
|
-
export {
|
|
8
|
-
import { M as Method, P as PathParamHttpContractDetails, H as HttpContractDetails, E as ExpressLikeRouterOptions, a as SessionObject, b as ParamsObject, R as ResponsesObject, B as Body, Q as QueryObject, c as HeadersObject, V as VersionSchema, d as SchemaAuthMethods, e as ExpressLikeSchemaHandler, f as ResolvedSessionObject, C as ContractDetails, g as PathMatch, L as LiveTypeFunction, h as LiveSdkFunction, A as AuthMethodsBase, i as ExpressLikeApplicationOptions, j as ParamsDictionary, k as VersionedRequests, l as AuthMethods, D as DecodeResource, m as BasicAuthMethods, F as ForklaunchRequest, n as MiddlewareContractDetails, o as ExpressLikeSchemaAuthMapper, p as ForklaunchNextFunction, q as ForklaunchResponse, r as ForklaunchResHeaders, s as ForklaunchStatusResponse, t as ForklaunchSendableData } from '../apiDefinition.types-
|
|
9
|
-
export { u as AccessLevel, v as BodyObject, w as DefaultSubscriptionData, x as DocsConfiguration, y as ErrorContainer, z as ExpressLikeAuthMapper, G as ExpressLikeGlobalAuthOptions, I as ExpressLikeHandler, J as ExpressLikeSchemaGlobalAuthOptions, K as ExtractBody, N as ExtractContentType, O as ExtractResponseBody, T as ExtractedParamsObject, U as FileBody, W as ForklaunchBaseRequest, X as ForklaunchResErrors, Y as HmacMethods, Z as HttpMethod, _ as JsonBody, $ as JwtAuthMethods, a0 as LiveTypeFunctionRequestInit, a1 as MapParamsSchema, a2 as MapReqBodySchema, a3 as MapReqHeadersSchema, a4 as MapReqQuerySchema, a5 as MapResBodyMapSchema, a6 as MapResHeadersSchema, a7 as MapSchema, a8 as MapSessionSchema, a9 as MapVersionedReqsSchema, aa as MapVersionedRespsSchema, ab as MultipartForm, ac as NumberOnlyObject, ad as PathParamMethod, ae as PermissionSet, af as RawTypedResponseBody, ag as RequestContext, ah as ResolvedForklaunchAuthRequest, ai as ResolvedForklaunchRequest, aj as ResolvedForklaunchResponse, ak as ResponseBody, al as ResponseCompiledSchema, am as ResponseShape, an as RoleSet, ao as ServerSentEventBody, S as StringOnlyObject, ap as TextBody, aq as TypedBody, ar as TypedRequestBody, as as TypedResponseBody, at as UnknownBody, au as UnknownResponseBody, av as UrlEncodedForm, aw as VersionedResponses } from '../apiDefinition.types-
|
|
6
|
+
import { O as OpenTelemetryCollector, M as MetricsDefinition, T as TelemetryOptions, L as LoggerMeta, a as LogFn } from '../openTelemetryCollector-DXGXRvQP.mjs';
|
|
7
|
+
export { b as MetricType, h as httpRequestsTotalCounter, c as httpServerDurationHistogram } from '../openTelemetryCollector-DXGXRvQP.mjs';
|
|
8
|
+
import { M as Method, P as PathParamHttpContractDetails, H as HttpContractDetails, E as ExpressLikeRouterOptions, a as SessionObject, b as ParamsObject, R as ResponsesObject, B as Body, Q as QueryObject, c as HeadersObject, V as VersionSchema, d as SchemaAuthMethods, e as ExpressLikeSchemaHandler, f as ResolvedSessionObject, C as ContractDetails, g as PathMatch, L as LiveTypeFunction, h as LiveSdkFunction, A as AuthMethodsBase, i as ExpressLikeApplicationOptions, j as ParamsDictionary, k as VersionedRequests, l as AuthMethods, D as DecodeResource, m as BasicAuthMethods, F as ForklaunchRequest, n as MiddlewareContractDetails, o as ExpressLikeSchemaAuthMapper, p as ForklaunchNextFunction, q as ForklaunchResponse, r as ForklaunchResHeaders, s as ForklaunchStatusResponse, t as ForklaunchSendableData } from '../apiDefinition.types-CPWnG8GH.mjs';
|
|
9
|
+
export { u as AccessLevel, v as BodyObject, w as DefaultSubscriptionData, x as DocsConfiguration, y as ErrorContainer, z as ExpressLikeAuthMapper, G as ExpressLikeGlobalAuthOptions, I as ExpressLikeHandler, J as ExpressLikeSchemaGlobalAuthOptions, K as ExtractBody, N as ExtractContentType, O as ExtractResponseBody, T as ExtractedParamsObject, U as FileBody, W as ForklaunchBaseRequest, X as ForklaunchResErrors, Y as HmacMethods, Z as HttpMethod, _ as JsonBody, $ as JwtAuthMethods, a0 as LiveTypeFunctionRequestInit, a1 as MapParamsSchema, a2 as MapReqBodySchema, a3 as MapReqHeadersSchema, a4 as MapReqQuerySchema, a5 as MapResBodyMapSchema, a6 as MapResHeadersSchema, a7 as MapSchema, a8 as MapSessionSchema, a9 as MapVersionedReqsSchema, aa as MapVersionedRespsSchema, ab as MultipartForm, ac as NumberOnlyObject, ad as PathParamMethod, ae as PermissionSet, af as RawTypedResponseBody, ag as RequestContext, ah as ResolvedForklaunchAuthRequest, ai as ResolvedForklaunchRequest, aj as ResolvedForklaunchResponse, ak as ResponseBody, al as ResponseCompiledSchema, am as ResponseShape, an as RoleSet, ao as ServerSentEventBody, S as StringOnlyObject, ap as TextBody, aq as TypedBody, ar as TypedRequestBody, as as TypedResponseBody, at as UnknownBody, au as UnknownResponseBody, av as UrlEncodedForm, aw as VersionedResponses } from '../apiDefinition.types-CPWnG8GH.mjs';
|
|
10
10
|
import { JWTPayload, JWK } from 'jose';
|
|
11
11
|
import { ZodSchemaValidator } from '@forklaunch/validator/zod';
|
|
12
12
|
import { FastMCP } from 'fastmcp';
|
|
13
13
|
import http from 'http';
|
|
14
14
|
import { OpenAPIObject } from 'openapi3-ts/oas31';
|
|
15
|
-
import { LevelWithSilentOrString } from 'pino';
|
|
15
|
+
import pino, { LevelWithSilentOrString, LevelWithSilent } from 'pino';
|
|
16
16
|
export { LevelWithSilent, LevelWithSilentOrString, Logger } from 'pino';
|
|
17
|
+
import { AnyValueMap } from '@opentelemetry/api-logs';
|
|
17
18
|
import { T as TtlCache } from '../ttlCache.interface-DClm-lSa.mjs';
|
|
18
19
|
export { ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_HTTP_ROUTE, ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
|
|
19
20
|
import '@opentelemetry/api';
|
|
20
|
-
import '@opentelemetry/api-logs';
|
|
21
21
|
import 'stream';
|
|
22
22
|
import 'cors';
|
|
23
23
|
import '@scalar/express-api-reference';
|
|
@@ -1173,6 +1173,21 @@ declare function evaluateTelemetryOptions(telemetryOptions: TelemetryOptions): {
|
|
|
1173
1173
|
|
|
1174
1174
|
declare function metricsDefinitions<T extends MetricsDefinition>(metrics: T): T;
|
|
1175
1175
|
|
|
1176
|
+
declare function meta(meta: Record<string, unknown>): LoggerMeta;
|
|
1177
|
+
declare class PinoLogger {
|
|
1178
|
+
#private;
|
|
1179
|
+
constructor(level: LevelWithSilentOrString, meta?: AnyValueMap);
|
|
1180
|
+
log(level: LevelWithSilent, ...args: (string | unknown | LoggerMeta)[]): void;
|
|
1181
|
+
error: LogFn;
|
|
1182
|
+
info: LogFn;
|
|
1183
|
+
debug: LogFn;
|
|
1184
|
+
warn: LogFn;
|
|
1185
|
+
trace: LogFn;
|
|
1186
|
+
child(meta?: AnyValueMap): PinoLogger;
|
|
1187
|
+
getBaseLogger(): pino.Logger;
|
|
1188
|
+
}
|
|
1189
|
+
declare function logger(level: LevelWithSilentOrString, meta?: AnyValueMap): PinoLogger;
|
|
1190
|
+
|
|
1176
1191
|
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;
|
|
1177
1192
|
|
|
1178
1193
|
/**
|
|
@@ -1240,4 +1255,4 @@ declare class RateLimiter {
|
|
|
1240
1255
|
static operationType(method: string): 'read' | 'write';
|
|
1241
1256
|
}
|
|
1242
1257
|
|
|
1243
|
-
export { ATTR_API_NAME, ATTR_APPLICATION_ID, ATTR_CORRELATION_ID, type AuditEntry, AuditLogger, AuthMethods, AuthMethodsBase, BasicAuthMethods, Body, type ClusterConfig, type ConstrainedForklaunchRouter, ContractDetails, type ContractDetailsExpressLikeSchemaHandler, type ContractDetailsOrMiddlewareOrTypedHandler, DecodeResource, ExpressLikeApplicationOptions, type ExpressLikeRouter, ExpressLikeRouterOptions, ExpressLikeSchemaAuthMapper, ExpressLikeSchemaHandler, type ExpressLikeTypedHandler, type ExtractLiveTypeFn, type FetchFunction, ForklaunchExpressLikeApplication, ForklaunchExpressLikeRouter, ForklaunchNextFunction, ForklaunchRequest, ForklaunchResHeaders, ForklaunchResponse, type ForklaunchRoute, type ForklaunchRouter, ForklaunchSendableData, ForklaunchStatusResponse, HTTPStatuses, HeadersObject, HttpContractDetails, LiveSdkFunction, LiveTypeFunction, type LiveTypeRouteDefinition, type MapHandlerToLiveSdk, type MapToFetch, type MapToSdk, Method, MetricsDefinition, MiddlewareContractDetails, type MiddlewareOrMiddlewareWithTypedHandler, type NestableRouterBasedHandler, OPENAPI_DEFAULT_VERSION, OpenTelemetryCollector, ParamsDictionary, ParamsObject, type PathBasedHandler, PathMatch, type PathOrMiddlewareBasedHandler, PathParamHttpContractDetails, QueryObject, type RateLimitConfig, type RateLimitResult, RateLimiter, ResolvedSessionObject, ResponsesObject, type RouterMap, type RoutingStrategy, SchemaAuthMethods, type SdkHandler, type SdkHandlerObject, type SdkRouter, SessionObject, type StatusCode, TelemetryOptions, type ToFetchMap, type TypedHandler, type TypedMiddlewareDefinition, type TypedNestableMiddlewareDefinition, VersionSchema, VersionedRequests, createContext, createHmacToken, delete_, discriminateAuthMethod, discriminateBody, discriminateResponseBodies, enrichExpressLikeSend, evaluateTelemetryOptions, extractRouteHandlers, generateHmacAuthHeaders, generateMcpServer, generateOpenApiSpecs, get, getCachedJwks, getCodeForStatus, head, isClientError, isForklaunchRequest, isForklaunchRouter, isInformational, isPortBound, isRedirection, isServerError, isSuccessful, isValidStatusCode, metricsDefinitions, middleware, options, patch, post, put, recordMetric, trace, typedAuthHandler, typedHandler };
|
|
1258
|
+
export { ATTR_API_NAME, ATTR_APPLICATION_ID, ATTR_CORRELATION_ID, type AuditEntry, AuditLogger, AuthMethods, AuthMethodsBase, BasicAuthMethods, Body, type ClusterConfig, type ConstrainedForklaunchRouter, ContractDetails, type ContractDetailsExpressLikeSchemaHandler, type ContractDetailsOrMiddlewareOrTypedHandler, DecodeResource, ExpressLikeApplicationOptions, type ExpressLikeRouter, ExpressLikeRouterOptions, ExpressLikeSchemaAuthMapper, ExpressLikeSchemaHandler, type ExpressLikeTypedHandler, type ExtractLiveTypeFn, type FetchFunction, ForklaunchExpressLikeApplication, ForklaunchExpressLikeRouter, ForklaunchNextFunction, ForklaunchRequest, ForklaunchResHeaders, ForklaunchResponse, type ForklaunchRoute, type ForklaunchRouter, ForklaunchSendableData, ForklaunchStatusResponse, HTTPStatuses, HeadersObject, HttpContractDetails, LiveSdkFunction, LiveTypeFunction, type LiveTypeRouteDefinition, LogFn, LoggerMeta, type MapHandlerToLiveSdk, type MapToFetch, type MapToSdk, Method, MetricsDefinition, MiddlewareContractDetails, type MiddlewareOrMiddlewareWithTypedHandler, type NestableRouterBasedHandler, OPENAPI_DEFAULT_VERSION, OpenTelemetryCollector, ParamsDictionary, ParamsObject, type PathBasedHandler, PathMatch, type PathOrMiddlewareBasedHandler, PathParamHttpContractDetails, PinoLogger, QueryObject, type RateLimitConfig, type RateLimitResult, RateLimiter, ResolvedSessionObject, ResponsesObject, type RouterMap, type RoutingStrategy, SchemaAuthMethods, type SdkHandler, type SdkHandlerObject, type SdkRouter, SessionObject, type StatusCode, TelemetryOptions, type ToFetchMap, type TypedHandler, type TypedMiddlewareDefinition, type TypedNestableMiddlewareDefinition, VersionSchema, VersionedRequests, createContext, createHmacToken, delete_, discriminateAuthMethod, discriminateBody, discriminateResponseBodies, enrichExpressLikeSend, evaluateTelemetryOptions, extractRouteHandlers, generateHmacAuthHeaders, generateMcpServer, generateOpenApiSpecs, get, getCachedJwks, getCodeForStatus, head, isClientError, isForklaunchRequest, isForklaunchRouter, isInformational, isPortBound, isRedirection, isServerError, isSuccessful, isValidStatusCode, logger, meta, metricsDefinitions, middleware, options, patch, post, put, recordMetric, trace, typedAuthHandler, typedHandler };
|
package/lib/http/index.d.ts
CHANGED
|
@@ -3,21 +3,21 @@ export { ParsedQs } from 'qs';
|
|
|
3
3
|
import { Prettify, SanitizePathSlashes, PrettyCamelCase, TypeSafeFunction, UnionToIntersection, EmptyObject } from '@forklaunch/common';
|
|
4
4
|
import { AnySchemaValidator } from '@forklaunch/validator';
|
|
5
5
|
import { ServerOptions, IncomingMessage, ServerResponse } from 'node:http';
|
|
6
|
-
import { O as OpenTelemetryCollector, M as MetricsDefinition, T as TelemetryOptions } from '../openTelemetryCollector-
|
|
7
|
-
export {
|
|
8
|
-
import { M as Method, P as PathParamHttpContractDetails, H as HttpContractDetails, E as ExpressLikeRouterOptions, a as SessionObject, b as ParamsObject, R as ResponsesObject, B as Body, Q as QueryObject, c as HeadersObject, V as VersionSchema, d as SchemaAuthMethods, e as ExpressLikeSchemaHandler, f as ResolvedSessionObject, C as ContractDetails, g as PathMatch, L as LiveTypeFunction, h as LiveSdkFunction, A as AuthMethodsBase, i as ExpressLikeApplicationOptions, j as ParamsDictionary, k as VersionedRequests, l as AuthMethods, D as DecodeResource, m as BasicAuthMethods, F as ForklaunchRequest, n as MiddlewareContractDetails, o as ExpressLikeSchemaAuthMapper, p as ForklaunchNextFunction, q as ForklaunchResponse, r as ForklaunchResHeaders, s as ForklaunchStatusResponse, t as ForklaunchSendableData } from '../apiDefinition.types-
|
|
9
|
-
export { u as AccessLevel, v as BodyObject, w as DefaultSubscriptionData, x as DocsConfiguration, y as ErrorContainer, z as ExpressLikeAuthMapper, G as ExpressLikeGlobalAuthOptions, I as ExpressLikeHandler, J as ExpressLikeSchemaGlobalAuthOptions, K as ExtractBody, N as ExtractContentType, O as ExtractResponseBody, T as ExtractedParamsObject, U as FileBody, W as ForklaunchBaseRequest, X as ForklaunchResErrors, Y as HmacMethods, Z as HttpMethod, _ as JsonBody, $ as JwtAuthMethods, a0 as LiveTypeFunctionRequestInit, a1 as MapParamsSchema, a2 as MapReqBodySchema, a3 as MapReqHeadersSchema, a4 as MapReqQuerySchema, a5 as MapResBodyMapSchema, a6 as MapResHeadersSchema, a7 as MapSchema, a8 as MapSessionSchema, a9 as MapVersionedReqsSchema, aa as MapVersionedRespsSchema, ab as MultipartForm, ac as NumberOnlyObject, ad as PathParamMethod, ae as PermissionSet, af as RawTypedResponseBody, ag as RequestContext, ah as ResolvedForklaunchAuthRequest, ai as ResolvedForklaunchRequest, aj as ResolvedForklaunchResponse, ak as ResponseBody, al as ResponseCompiledSchema, am as ResponseShape, an as RoleSet, ao as ServerSentEventBody, S as StringOnlyObject, ap as TextBody, aq as TypedBody, ar as TypedRequestBody, as as TypedResponseBody, at as UnknownBody, au as UnknownResponseBody, av as UrlEncodedForm, aw as VersionedResponses } from '../apiDefinition.types-
|
|
6
|
+
import { O as OpenTelemetryCollector, M as MetricsDefinition, T as TelemetryOptions, L as LoggerMeta, a as LogFn } from '../openTelemetryCollector-DXGXRvQP.js';
|
|
7
|
+
export { b as MetricType, h as httpRequestsTotalCounter, c as httpServerDurationHistogram } from '../openTelemetryCollector-DXGXRvQP.js';
|
|
8
|
+
import { M as Method, P as PathParamHttpContractDetails, H as HttpContractDetails, E as ExpressLikeRouterOptions, a as SessionObject, b as ParamsObject, R as ResponsesObject, B as Body, Q as QueryObject, c as HeadersObject, V as VersionSchema, d as SchemaAuthMethods, e as ExpressLikeSchemaHandler, f as ResolvedSessionObject, C as ContractDetails, g as PathMatch, L as LiveTypeFunction, h as LiveSdkFunction, A as AuthMethodsBase, i as ExpressLikeApplicationOptions, j as ParamsDictionary, k as VersionedRequests, l as AuthMethods, D as DecodeResource, m as BasicAuthMethods, F as ForklaunchRequest, n as MiddlewareContractDetails, o as ExpressLikeSchemaAuthMapper, p as ForklaunchNextFunction, q as ForklaunchResponse, r as ForklaunchResHeaders, s as ForklaunchStatusResponse, t as ForklaunchSendableData } from '../apiDefinition.types-BNRPj2PT.js';
|
|
9
|
+
export { u as AccessLevel, v as BodyObject, w as DefaultSubscriptionData, x as DocsConfiguration, y as ErrorContainer, z as ExpressLikeAuthMapper, G as ExpressLikeGlobalAuthOptions, I as ExpressLikeHandler, J as ExpressLikeSchemaGlobalAuthOptions, K as ExtractBody, N as ExtractContentType, O as ExtractResponseBody, T as ExtractedParamsObject, U as FileBody, W as ForklaunchBaseRequest, X as ForklaunchResErrors, Y as HmacMethods, Z as HttpMethod, _ as JsonBody, $ as JwtAuthMethods, a0 as LiveTypeFunctionRequestInit, a1 as MapParamsSchema, a2 as MapReqBodySchema, a3 as MapReqHeadersSchema, a4 as MapReqQuerySchema, a5 as MapResBodyMapSchema, a6 as MapResHeadersSchema, a7 as MapSchema, a8 as MapSessionSchema, a9 as MapVersionedReqsSchema, aa as MapVersionedRespsSchema, ab as MultipartForm, ac as NumberOnlyObject, ad as PathParamMethod, ae as PermissionSet, af as RawTypedResponseBody, ag as RequestContext, ah as ResolvedForklaunchAuthRequest, ai as ResolvedForklaunchRequest, aj as ResolvedForklaunchResponse, ak as ResponseBody, al as ResponseCompiledSchema, am as ResponseShape, an as RoleSet, ao as ServerSentEventBody, S as StringOnlyObject, ap as TextBody, aq as TypedBody, ar as TypedRequestBody, as as TypedResponseBody, at as UnknownBody, au as UnknownResponseBody, av as UrlEncodedForm, aw as VersionedResponses } from '../apiDefinition.types-BNRPj2PT.js';
|
|
10
10
|
import { JWTPayload, JWK } from 'jose';
|
|
11
11
|
import { ZodSchemaValidator } from '@forklaunch/validator/zod';
|
|
12
12
|
import { FastMCP } from 'fastmcp';
|
|
13
13
|
import http from 'http';
|
|
14
14
|
import { OpenAPIObject } from 'openapi3-ts/oas31';
|
|
15
|
-
import { LevelWithSilentOrString } from 'pino';
|
|
15
|
+
import pino, { LevelWithSilentOrString, LevelWithSilent } from 'pino';
|
|
16
16
|
export { LevelWithSilent, LevelWithSilentOrString, Logger } from 'pino';
|
|
17
|
+
import { AnyValueMap } from '@opentelemetry/api-logs';
|
|
17
18
|
import { T as TtlCache } from '../ttlCache.interface-DClm-lSa.js';
|
|
18
19
|
export { ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_HTTP_ROUTE, ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
|
|
19
20
|
import '@opentelemetry/api';
|
|
20
|
-
import '@opentelemetry/api-logs';
|
|
21
21
|
import 'stream';
|
|
22
22
|
import 'cors';
|
|
23
23
|
import '@scalar/express-api-reference';
|
|
@@ -1173,6 +1173,21 @@ declare function evaluateTelemetryOptions(telemetryOptions: TelemetryOptions): {
|
|
|
1173
1173
|
|
|
1174
1174
|
declare function metricsDefinitions<T extends MetricsDefinition>(metrics: T): T;
|
|
1175
1175
|
|
|
1176
|
+
declare function meta(meta: Record<string, unknown>): LoggerMeta;
|
|
1177
|
+
declare class PinoLogger {
|
|
1178
|
+
#private;
|
|
1179
|
+
constructor(level: LevelWithSilentOrString, meta?: AnyValueMap);
|
|
1180
|
+
log(level: LevelWithSilent, ...args: (string | unknown | LoggerMeta)[]): void;
|
|
1181
|
+
error: LogFn;
|
|
1182
|
+
info: LogFn;
|
|
1183
|
+
debug: LogFn;
|
|
1184
|
+
warn: LogFn;
|
|
1185
|
+
trace: LogFn;
|
|
1186
|
+
child(meta?: AnyValueMap): PinoLogger;
|
|
1187
|
+
getBaseLogger(): pino.Logger;
|
|
1188
|
+
}
|
|
1189
|
+
declare function logger(level: LevelWithSilentOrString, meta?: AnyValueMap): PinoLogger;
|
|
1190
|
+
|
|
1176
1191
|
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;
|
|
1177
1192
|
|
|
1178
1193
|
/**
|
|
@@ -1240,4 +1255,4 @@ declare class RateLimiter {
|
|
|
1240
1255
|
static operationType(method: string): 'read' | 'write';
|
|
1241
1256
|
}
|
|
1242
1257
|
|
|
1243
|
-
export { ATTR_API_NAME, ATTR_APPLICATION_ID, ATTR_CORRELATION_ID, type AuditEntry, AuditLogger, AuthMethods, AuthMethodsBase, BasicAuthMethods, Body, type ClusterConfig, type ConstrainedForklaunchRouter, ContractDetails, type ContractDetailsExpressLikeSchemaHandler, type ContractDetailsOrMiddlewareOrTypedHandler, DecodeResource, ExpressLikeApplicationOptions, type ExpressLikeRouter, ExpressLikeRouterOptions, ExpressLikeSchemaAuthMapper, ExpressLikeSchemaHandler, type ExpressLikeTypedHandler, type ExtractLiveTypeFn, type FetchFunction, ForklaunchExpressLikeApplication, ForklaunchExpressLikeRouter, ForklaunchNextFunction, ForklaunchRequest, ForklaunchResHeaders, ForklaunchResponse, type ForklaunchRoute, type ForklaunchRouter, ForklaunchSendableData, ForklaunchStatusResponse, HTTPStatuses, HeadersObject, HttpContractDetails, LiveSdkFunction, LiveTypeFunction, type LiveTypeRouteDefinition, type MapHandlerToLiveSdk, type MapToFetch, type MapToSdk, Method, MetricsDefinition, MiddlewareContractDetails, type MiddlewareOrMiddlewareWithTypedHandler, type NestableRouterBasedHandler, OPENAPI_DEFAULT_VERSION, OpenTelemetryCollector, ParamsDictionary, ParamsObject, type PathBasedHandler, PathMatch, type PathOrMiddlewareBasedHandler, PathParamHttpContractDetails, QueryObject, type RateLimitConfig, type RateLimitResult, RateLimiter, ResolvedSessionObject, ResponsesObject, type RouterMap, type RoutingStrategy, SchemaAuthMethods, type SdkHandler, type SdkHandlerObject, type SdkRouter, SessionObject, type StatusCode, TelemetryOptions, type ToFetchMap, type TypedHandler, type TypedMiddlewareDefinition, type TypedNestableMiddlewareDefinition, VersionSchema, VersionedRequests, createContext, createHmacToken, delete_, discriminateAuthMethod, discriminateBody, discriminateResponseBodies, enrichExpressLikeSend, evaluateTelemetryOptions, extractRouteHandlers, generateHmacAuthHeaders, generateMcpServer, generateOpenApiSpecs, get, getCachedJwks, getCodeForStatus, head, isClientError, isForklaunchRequest, isForklaunchRouter, isInformational, isPortBound, isRedirection, isServerError, isSuccessful, isValidStatusCode, metricsDefinitions, middleware, options, patch, post, put, recordMetric, trace, typedAuthHandler, typedHandler };
|
|
1258
|
+
export { ATTR_API_NAME, ATTR_APPLICATION_ID, ATTR_CORRELATION_ID, type AuditEntry, AuditLogger, AuthMethods, AuthMethodsBase, BasicAuthMethods, Body, type ClusterConfig, type ConstrainedForklaunchRouter, ContractDetails, type ContractDetailsExpressLikeSchemaHandler, type ContractDetailsOrMiddlewareOrTypedHandler, DecodeResource, ExpressLikeApplicationOptions, type ExpressLikeRouter, ExpressLikeRouterOptions, ExpressLikeSchemaAuthMapper, ExpressLikeSchemaHandler, type ExpressLikeTypedHandler, type ExtractLiveTypeFn, type FetchFunction, ForklaunchExpressLikeApplication, ForklaunchExpressLikeRouter, ForklaunchNextFunction, ForklaunchRequest, ForklaunchResHeaders, ForklaunchResponse, type ForklaunchRoute, type ForklaunchRouter, ForklaunchSendableData, ForklaunchStatusResponse, HTTPStatuses, HeadersObject, HttpContractDetails, LiveSdkFunction, LiveTypeFunction, type LiveTypeRouteDefinition, LogFn, LoggerMeta, type MapHandlerToLiveSdk, type MapToFetch, type MapToSdk, Method, MetricsDefinition, MiddlewareContractDetails, type MiddlewareOrMiddlewareWithTypedHandler, type NestableRouterBasedHandler, OPENAPI_DEFAULT_VERSION, OpenTelemetryCollector, ParamsDictionary, ParamsObject, type PathBasedHandler, PathMatch, type PathOrMiddlewareBasedHandler, PathParamHttpContractDetails, PinoLogger, QueryObject, type RateLimitConfig, type RateLimitResult, RateLimiter, ResolvedSessionObject, ResponsesObject, type RouterMap, type RoutingStrategy, SchemaAuthMethods, type SdkHandler, type SdkHandlerObject, type SdkRouter, SessionObject, type StatusCode, TelemetryOptions, type ToFetchMap, type TypedHandler, type TypedMiddlewareDefinition, type TypedNestableMiddlewareDefinition, VersionSchema, VersionedRequests, createContext, createHmacToken, delete_, discriminateAuthMethod, discriminateBody, discriminateResponseBodies, enrichExpressLikeSend, evaluateTelemetryOptions, extractRouteHandlers, generateHmacAuthHeaders, generateMcpServer, generateOpenApiSpecs, get, getCachedJwks, getCodeForStatus, head, isClientError, isForklaunchRequest, isForklaunchRouter, isInformational, isPortBound, isRedirection, isServerError, isSuccessful, isValidStatusCode, logger, meta, metricsDefinitions, middleware, options, patch, post, put, recordMetric, trace, typedAuthHandler, typedHandler };
|
package/lib/http/index.js
CHANGED
|
@@ -620,10 +620,10 @@ ${JSON.stringify(metadata, null, 2)}` : ""}`;
|
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
622
|
var PinoLogger = class _PinoLogger {
|
|
623
|
-
pinoLogger;
|
|
624
|
-
meta;
|
|
623
|
+
#pinoLogger;
|
|
624
|
+
#meta;
|
|
625
625
|
constructor(level, meta2 = {}) {
|
|
626
|
-
this
|
|
626
|
+
this.#pinoLogger = (0, import_pino.default)({
|
|
627
627
|
level: level || "info",
|
|
628
628
|
formatters: {
|
|
629
629
|
level(label) {
|
|
@@ -641,7 +641,7 @@ var PinoLogger = class _PinoLogger {
|
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
643
|
});
|
|
644
|
-
this
|
|
644
|
+
this.#meta = meta2;
|
|
645
645
|
}
|
|
646
646
|
log(level, ...args) {
|
|
647
647
|
let meta2 = {};
|
|
@@ -671,14 +671,14 @@ var PinoLogger = class _PinoLogger {
|
|
|
671
671
|
"correlation.id": "none",
|
|
672
672
|
...meta2
|
|
673
673
|
};
|
|
674
|
-
this
|
|
674
|
+
this.#pinoLogger[level](...normalizeLogArgs(filteredArgs));
|
|
675
675
|
const formattedBody = safePrettyFormat(level, filteredArgs);
|
|
676
676
|
try {
|
|
677
677
|
import_api_logs.logs.getLogger(process.env.OTEL_SERVICE_NAME ?? "unknown").emit({
|
|
678
678
|
severityText: level,
|
|
679
679
|
severityNumber: mapSeverity(level),
|
|
680
680
|
body: formattedBody,
|
|
681
|
-
attributes: { ...this
|
|
681
|
+
attributes: { ...this.#meta, ...meta2 }
|
|
682
682
|
});
|
|
683
683
|
} catch (error) {
|
|
684
684
|
console.error("Failed to emit OpenTelemetry log:", error);
|
|
@@ -694,10 +694,10 @@ var PinoLogger = class _PinoLogger {
|
|
|
694
694
|
warn = (msg, ...args) => this.log("warn", msg, ...args);
|
|
695
695
|
trace = (msg, ...args) => this.log("trace", msg, ...args);
|
|
696
696
|
child(meta2 = {}) {
|
|
697
|
-
return new _PinoLogger(this
|
|
697
|
+
return new _PinoLogger(this.#pinoLogger.level, { ...this.#meta, ...meta2 });
|
|
698
698
|
}
|
|
699
699
|
getBaseLogger() {
|
|
700
|
-
return this
|
|
700
|
+
return this.#pinoLogger;
|
|
701
701
|
}
|
|
702
702
|
};
|
|
703
703
|
function logger(level, meta2 = {}) {
|
|
@@ -1018,38 +1018,38 @@ function isForklaunchRequest(request) {
|
|
|
1018
1018
|
|
|
1019
1019
|
// src/http/telemetry/openTelemetryCollector.ts
|
|
1020
1020
|
var OpenTelemetryCollector = class {
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1021
|
+
#logger;
|
|
1022
|
+
#serviceName;
|
|
1023
|
+
#metrics;
|
|
1024
1024
|
// scoped creation and create this in middleware when api execute. Also add correlation id
|
|
1025
1025
|
constructor(serviceName, level, metricDefinitions) {
|
|
1026
|
-
this
|
|
1027
|
-
this
|
|
1028
|
-
this
|
|
1026
|
+
this.#serviceName = serviceName;
|
|
1027
|
+
this.#logger = logger(level || "info");
|
|
1028
|
+
this.#metrics = {};
|
|
1029
1029
|
for (const [metricId, metricType] of Object.entries(
|
|
1030
1030
|
metricDefinitions ?? {}
|
|
1031
1031
|
)) {
|
|
1032
1032
|
switch (metricType) {
|
|
1033
1033
|
case "counter":
|
|
1034
|
-
this
|
|
1034
|
+
this.#metrics[metricId] = import_api3.metrics.getMeter(this.#serviceName).createCounter(metricId);
|
|
1035
1035
|
break;
|
|
1036
1036
|
case "gauge":
|
|
1037
|
-
this
|
|
1037
|
+
this.#metrics[metricId] = import_api3.metrics.getMeter(this.#serviceName).createGauge(metricId);
|
|
1038
1038
|
break;
|
|
1039
1039
|
case "histogram":
|
|
1040
|
-
this
|
|
1040
|
+
this.#metrics[metricId] = import_api3.metrics.getMeter(this.#serviceName).createHistogram(metricId);
|
|
1041
1041
|
break;
|
|
1042
1042
|
case "upDownCounter":
|
|
1043
|
-
this
|
|
1043
|
+
this.#metrics[metricId] = import_api3.metrics.getMeter(this.#serviceName).createUpDownCounter(metricId);
|
|
1044
1044
|
break;
|
|
1045
1045
|
case "observableCounter":
|
|
1046
|
-
this
|
|
1046
|
+
this.#metrics[metricId] = import_api3.metrics.getMeter(this.#serviceName).createObservableCounter(metricId);
|
|
1047
1047
|
break;
|
|
1048
1048
|
case "observableGauge":
|
|
1049
|
-
this
|
|
1049
|
+
this.#metrics[metricId] = import_api3.metrics.getMeter(this.#serviceName).createObservableGauge(metricId);
|
|
1050
1050
|
break;
|
|
1051
1051
|
case "observableUpDownCounter":
|
|
1052
|
-
this
|
|
1052
|
+
this.#metrics[metricId] = import_api3.metrics.getMeter(this.#serviceName).createObservableUpDownCounter(metricId);
|
|
1053
1053
|
break;
|
|
1054
1054
|
}
|
|
1055
1055
|
}
|
|
@@ -1059,25 +1059,25 @@ var OpenTelemetryCollector = class {
|
|
|
1059
1059
|
);
|
|
1060
1060
|
}
|
|
1061
1061
|
log(level, ...args) {
|
|
1062
|
-
this.
|
|
1062
|
+
this.#logger.log(level, ...args);
|
|
1063
1063
|
}
|
|
1064
1064
|
info = (msg, ...args) => {
|
|
1065
|
-
this.
|
|
1065
|
+
this.#logger.log("info", msg, ...args);
|
|
1066
1066
|
};
|
|
1067
1067
|
error = (msg, ...args) => {
|
|
1068
|
-
this.
|
|
1068
|
+
this.#logger.log("error", msg, ...args);
|
|
1069
1069
|
};
|
|
1070
1070
|
warn = (msg, ...args) => {
|
|
1071
|
-
this.
|
|
1071
|
+
this.#logger.log("warn", msg, ...args);
|
|
1072
1072
|
};
|
|
1073
1073
|
debug = (msg, ...args) => {
|
|
1074
|
-
this.
|
|
1074
|
+
this.#logger.log("debug", msg, ...args);
|
|
1075
1075
|
};
|
|
1076
1076
|
trace = (msg, ...args) => {
|
|
1077
|
-
this.
|
|
1077
|
+
this.#logger.log("trace", msg, ...args);
|
|
1078
1078
|
};
|
|
1079
1079
|
getMetric(metricId) {
|
|
1080
|
-
return this
|
|
1080
|
+
return this.#metrics[metricId];
|
|
1081
1081
|
}
|
|
1082
1082
|
};
|
|
1083
1083
|
import_dotenv.default.config({ path: (0, import_common7.getEnvVar)("DOTENV_FILE_PATH") });
|