@forklaunch/core 1.3.12 → 1.3.14
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-CPWnG8GH.d.mts → apiDefinition.types-CCeDOt57.d.mts} +1 -1
- package/lib/{apiDefinition.types-BNRPj2PT.d.ts → apiDefinition.types-CKd_mi4-.d.ts} +1 -1
- package/lib/http/index.d.mts +7 -22
- package/lib/http/index.d.ts +7 -22
- package/lib/http/index.js +38 -29
- package/lib/http/index.js.map +1 -1
- package/lib/http/index.mjs +38 -29
- package/lib/http/index.mjs.map +1 -1
- package/lib/{openTelemetryCollector-DXGXRvQP.d.mts → openTelemetryCollector-BS-ej09T.d.mts} +22 -3
- package/lib/{openTelemetryCollector-DXGXRvQP.d.ts → openTelemetryCollector-BS-ej09T.d.ts} +22 -3
- package/lib/persistence/index.d.mts +2 -2
- package/lib/persistence/index.d.ts +2 -2
- package/lib/persistence/index.js +45 -1
- package/lib/persistence/index.js.map +1 -1
- package/lib/persistence/index.mjs +46 -2
- package/lib/persistence/index.mjs.map +1 -1
- package/lib/services/index.d.mts +3 -2
- package/lib/services/index.d.ts +3 -2
- package/lib/services/index.js.map +1 -1
- package/lib/services/index.mjs.map +1 -1
- package/lib/ws/index.d.mts +3 -2
- package/lib/ws/index.d.ts +3 -2
- package/package.json +1 -1
|
@@ -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-BS-ej09T.mjs';
|
|
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-BS-ej09T.js';
|
|
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
|
|
7
|
-
export { b as MetricType, h as httpRequestsTotalCounter, c as httpServerDurationHistogram } from '../openTelemetryCollector-
|
|
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 } from '../openTelemetryCollector-BS-ej09T.mjs';
|
|
7
|
+
export { L as LogFn, a as LoggerMeta, b as MetricType, P as PinoLogger, h as httpRequestsTotalCounter, c as httpServerDurationHistogram, l as logger, m as meta } from '../openTelemetryCollector-BS-ej09T.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-CCeDOt57.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-CCeDOt57.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
|
|
15
|
+
import { LevelWithSilentOrString } from 'pino';
|
|
16
16
|
export { LevelWithSilent, LevelWithSilentOrString, Logger } from 'pino';
|
|
17
|
-
import { AnyValueMap } from '@opentelemetry/api-logs';
|
|
18
17
|
import { T as TtlCache } from '../ttlCache.interface-DClm-lSa.mjs';
|
|
19
18
|
export { ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_HTTP_ROUTE, ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
|
|
20
19
|
import '@opentelemetry/api';
|
|
20
|
+
import '@opentelemetry/api-logs';
|
|
21
21
|
import 'stream';
|
|
22
22
|
import 'cors';
|
|
23
23
|
import '@scalar/express-api-reference';
|
|
@@ -1173,21 +1173,6 @@ 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
|
-
|
|
1191
1176
|
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;
|
|
1192
1177
|
|
|
1193
1178
|
/**
|
|
@@ -1255,4 +1240,4 @@ declare class RateLimiter {
|
|
|
1255
1240
|
static operationType(method: string): 'read' | 'write';
|
|
1256
1241
|
}
|
|
1257
1242
|
|
|
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,
|
|
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 };
|
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
|
|
7
|
-
export { b as MetricType, h as httpRequestsTotalCounter, c as httpServerDurationHistogram } from '../openTelemetryCollector-
|
|
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 } from '../openTelemetryCollector-BS-ej09T.js';
|
|
7
|
+
export { L as LogFn, a as LoggerMeta, b as MetricType, P as PinoLogger, h as httpRequestsTotalCounter, c as httpServerDurationHistogram, l as logger, m as meta } from '../openTelemetryCollector-BS-ej09T.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-CKd_mi4-.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-CKd_mi4-.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
|
|
15
|
+
import { LevelWithSilentOrString } from 'pino';
|
|
16
16
|
export { LevelWithSilent, LevelWithSilentOrString, Logger } from 'pino';
|
|
17
|
-
import { AnyValueMap } from '@opentelemetry/api-logs';
|
|
18
17
|
import { T as TtlCache } from '../ttlCache.interface-DClm-lSa.js';
|
|
19
18
|
export { ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_HTTP_ROUTE, ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
|
|
20
19
|
import '@opentelemetry/api';
|
|
20
|
+
import '@opentelemetry/api-logs';
|
|
21
21
|
import 'stream';
|
|
22
22
|
import 'cors';
|
|
23
23
|
import '@scalar/express-api-reference';
|
|
@@ -1173,21 +1173,6 @@ 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
|
-
|
|
1191
1176
|
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;
|
|
1192
1177
|
|
|
1193
1178
|
/**
|
|
@@ -1255,4 +1240,4 @@ declare class RateLimiter {
|
|
|
1255
1240
|
static operationType(method: string): 'read' | 'write';
|
|
1256
1241
|
}
|
|
1257
1242
|
|
|
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,
|
|
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 };
|
package/lib/http/index.js
CHANGED
|
@@ -422,7 +422,16 @@ async function getCachedJwks(jwksPublicKeyUrl) {
|
|
|
422
422
|
return cachedJwks.value;
|
|
423
423
|
} else {
|
|
424
424
|
const jwksResponse = await fetch(jwksPublicKeyUrl);
|
|
425
|
-
const
|
|
425
|
+
const text = await jwksResponse.text();
|
|
426
|
+
if (!text) {
|
|
427
|
+
if (cachedJwks.value) {
|
|
428
|
+
return cachedJwks.value;
|
|
429
|
+
}
|
|
430
|
+
throw new Error(
|
|
431
|
+
`JWKS endpoint returned empty response (status ${jwksResponse.status})`
|
|
432
|
+
);
|
|
433
|
+
}
|
|
434
|
+
const jwks = JSON.parse(text).keys;
|
|
426
435
|
cachedJwks.value = jwks;
|
|
427
436
|
cachedJwks.lastUpdated = /* @__PURE__ */ new Date();
|
|
428
437
|
cachedJwks.ttl = parseInt(
|
|
@@ -620,10 +629,10 @@ ${JSON.stringify(metadata, null, 2)}` : ""}`;
|
|
|
620
629
|
}
|
|
621
630
|
}
|
|
622
631
|
var PinoLogger = class _PinoLogger {
|
|
623
|
-
|
|
624
|
-
|
|
632
|
+
_pinoLogger;
|
|
633
|
+
_meta;
|
|
625
634
|
constructor(level, meta2 = {}) {
|
|
626
|
-
this
|
|
635
|
+
this._pinoLogger = (0, import_pino.default)({
|
|
627
636
|
level: level || "info",
|
|
628
637
|
formatters: {
|
|
629
638
|
level(label) {
|
|
@@ -641,7 +650,7 @@ var PinoLogger = class _PinoLogger {
|
|
|
641
650
|
}
|
|
642
651
|
}
|
|
643
652
|
});
|
|
644
|
-
this
|
|
653
|
+
this._meta = meta2;
|
|
645
654
|
}
|
|
646
655
|
log(level, ...args) {
|
|
647
656
|
let meta2 = {};
|
|
@@ -671,14 +680,14 @@ var PinoLogger = class _PinoLogger {
|
|
|
671
680
|
"correlation.id": "none",
|
|
672
681
|
...meta2
|
|
673
682
|
};
|
|
674
|
-
this
|
|
683
|
+
this._pinoLogger[level](...normalizeLogArgs(filteredArgs));
|
|
675
684
|
const formattedBody = safePrettyFormat(level, filteredArgs);
|
|
676
685
|
try {
|
|
677
686
|
import_api_logs.logs.getLogger(process.env.OTEL_SERVICE_NAME ?? "unknown").emit({
|
|
678
687
|
severityText: level,
|
|
679
688
|
severityNumber: mapSeverity(level),
|
|
680
689
|
body: formattedBody,
|
|
681
|
-
attributes: { ...this
|
|
690
|
+
attributes: { ...this._meta, ...meta2 }
|
|
682
691
|
});
|
|
683
692
|
} catch (error) {
|
|
684
693
|
console.error("Failed to emit OpenTelemetry log:", error);
|
|
@@ -694,10 +703,10 @@ var PinoLogger = class _PinoLogger {
|
|
|
694
703
|
warn = (msg, ...args) => this.log("warn", msg, ...args);
|
|
695
704
|
trace = (msg, ...args) => this.log("trace", msg, ...args);
|
|
696
705
|
child(meta2 = {}) {
|
|
697
|
-
return new _PinoLogger(this
|
|
706
|
+
return new _PinoLogger(this._pinoLogger.level, { ...this._meta, ...meta2 });
|
|
698
707
|
}
|
|
699
708
|
getBaseLogger() {
|
|
700
|
-
return this
|
|
709
|
+
return this._pinoLogger;
|
|
701
710
|
}
|
|
702
711
|
};
|
|
703
712
|
function logger(level, meta2 = {}) {
|
|
@@ -1018,38 +1027,38 @@ function isForklaunchRequest(request) {
|
|
|
1018
1027
|
|
|
1019
1028
|
// src/http/telemetry/openTelemetryCollector.ts
|
|
1020
1029
|
var OpenTelemetryCollector = class {
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1030
|
+
_logger;
|
|
1031
|
+
_serviceName;
|
|
1032
|
+
_metrics;
|
|
1024
1033
|
// scoped creation and create this in middleware when api execute. Also add correlation id
|
|
1025
1034
|
constructor(serviceName, level, metricDefinitions) {
|
|
1026
|
-
this
|
|
1027
|
-
this
|
|
1028
|
-
this
|
|
1035
|
+
this._serviceName = serviceName;
|
|
1036
|
+
this._logger = logger(level || "info");
|
|
1037
|
+
this._metrics = {};
|
|
1029
1038
|
for (const [metricId, metricType] of Object.entries(
|
|
1030
1039
|
metricDefinitions ?? {}
|
|
1031
1040
|
)) {
|
|
1032
1041
|
switch (metricType) {
|
|
1033
1042
|
case "counter":
|
|
1034
|
-
this
|
|
1043
|
+
this._metrics[metricId] = import_api3.metrics.getMeter(this._serviceName).createCounter(metricId);
|
|
1035
1044
|
break;
|
|
1036
1045
|
case "gauge":
|
|
1037
|
-
this
|
|
1046
|
+
this._metrics[metricId] = import_api3.metrics.getMeter(this._serviceName).createGauge(metricId);
|
|
1038
1047
|
break;
|
|
1039
1048
|
case "histogram":
|
|
1040
|
-
this
|
|
1049
|
+
this._metrics[metricId] = import_api3.metrics.getMeter(this._serviceName).createHistogram(metricId);
|
|
1041
1050
|
break;
|
|
1042
1051
|
case "upDownCounter":
|
|
1043
|
-
this
|
|
1052
|
+
this._metrics[metricId] = import_api3.metrics.getMeter(this._serviceName).createUpDownCounter(metricId);
|
|
1044
1053
|
break;
|
|
1045
1054
|
case "observableCounter":
|
|
1046
|
-
this
|
|
1055
|
+
this._metrics[metricId] = import_api3.metrics.getMeter(this._serviceName).createObservableCounter(metricId);
|
|
1047
1056
|
break;
|
|
1048
1057
|
case "observableGauge":
|
|
1049
|
-
this
|
|
1058
|
+
this._metrics[metricId] = import_api3.metrics.getMeter(this._serviceName).createObservableGauge(metricId);
|
|
1050
1059
|
break;
|
|
1051
1060
|
case "observableUpDownCounter":
|
|
1052
|
-
this
|
|
1061
|
+
this._metrics[metricId] = import_api3.metrics.getMeter(this._serviceName).createObservableUpDownCounter(metricId);
|
|
1053
1062
|
break;
|
|
1054
1063
|
}
|
|
1055
1064
|
}
|
|
@@ -1059,25 +1068,25 @@ var OpenTelemetryCollector = class {
|
|
|
1059
1068
|
);
|
|
1060
1069
|
}
|
|
1061
1070
|
log(level, ...args) {
|
|
1062
|
-
this
|
|
1071
|
+
this._logger.log(level, ...args);
|
|
1063
1072
|
}
|
|
1064
1073
|
info = (msg, ...args) => {
|
|
1065
|
-
this
|
|
1074
|
+
this._logger.log("info", msg, ...args);
|
|
1066
1075
|
};
|
|
1067
1076
|
error = (msg, ...args) => {
|
|
1068
|
-
this
|
|
1077
|
+
this._logger.log("error", msg, ...args);
|
|
1069
1078
|
};
|
|
1070
1079
|
warn = (msg, ...args) => {
|
|
1071
|
-
this
|
|
1080
|
+
this._logger.log("warn", msg, ...args);
|
|
1072
1081
|
};
|
|
1073
1082
|
debug = (msg, ...args) => {
|
|
1074
|
-
this
|
|
1083
|
+
this._logger.log("debug", msg, ...args);
|
|
1075
1084
|
};
|
|
1076
1085
|
trace = (msg, ...args) => {
|
|
1077
|
-
this
|
|
1086
|
+
this._logger.log("trace", msg, ...args);
|
|
1078
1087
|
};
|
|
1079
1088
|
getMetric(metricId) {
|
|
1080
|
-
return this
|
|
1089
|
+
return this._metrics[metricId];
|
|
1081
1090
|
}
|
|
1082
1091
|
};
|
|
1083
1092
|
import_dotenv.default.config({ path: (0, import_common7.getEnvVar)("DOTENV_FILE_PATH") });
|