@forklaunch/core 1.3.0 → 1.3.2
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-DUkE1FHm.d.mts → apiDefinition.types-D3fcC39w.d.ts} +1 -1
- package/lib/{apiDefinition.types-DdQ3d8il.d.ts → apiDefinition.types-pmtOHamW.d.mts} +1 -1
- package/lib/http/index.d.mts +8 -24
- package/lib/http/index.d.ts +8 -24
- package/lib/http/index.js +23 -23
- package/lib/http/index.js.map +1 -1
- package/lib/http/index.mjs +23 -23
- package/lib/http/index.mjs.map +1 -1
- package/lib/{openTelemetryCollector-DXGXRvQP.d.mts → openTelemetryCollector-DorlR4pn.d.mts} +22 -3
- package/lib/{openTelemetryCollector-DXGXRvQP.d.ts → openTelemetryCollector-DorlR4pn.d.ts} +22 -3
- package/lib/services/index.d.mts +2 -1
- package/lib/services/index.d.ts +2 -1
- package/lib/ws/index.d.mts +3 -2
- package/lib/ws/index.d.ts +3 -2
- 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-DorlR4pn.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-DorlR4pn.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
|
|
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-DorlR4pn.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-DorlR4pn.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-pmtOHamW.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-pmtOHamW.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';
|
|
@@ -1141,7 +1141,7 @@ type AuditEntry = {
|
|
|
1141
1141
|
eventType: 'http' | 'ws' | 'auth_failure' | 'rate_limit' | 'rbac_deny' | 'super_admin_bypass';
|
|
1142
1142
|
};
|
|
1143
1143
|
declare class AuditLogger {
|
|
1144
|
-
|
|
1144
|
+
_otel: OpenTelemetryCollector<MetricsDefinition>;
|
|
1145
1145
|
constructor(otel: OpenTelemetryCollector<MetricsDefinition>);
|
|
1146
1146
|
append(entry: AuditEntry): void;
|
|
1147
1147
|
static hashBody(body: string | Buffer | undefined | null): string;
|
|
@@ -1162,22 +1162,6 @@ declare function evaluateTelemetryOptions(telemetryOptions: TelemetryOptions): {
|
|
|
1162
1162
|
|
|
1163
1163
|
declare function metricsDefinitions<T extends MetricsDefinition>(metrics: T): T;
|
|
1164
1164
|
|
|
1165
|
-
declare function meta(meta: Record<string, unknown>): LoggerMeta;
|
|
1166
|
-
declare class PinoLogger {
|
|
1167
|
-
private pinoLogger;
|
|
1168
|
-
private meta;
|
|
1169
|
-
constructor(level: LevelWithSilentOrString, meta?: AnyValueMap);
|
|
1170
|
-
log(level: LevelWithSilent, ...args: (string | unknown | LoggerMeta)[]): void;
|
|
1171
|
-
error: LogFn;
|
|
1172
|
-
info: LogFn;
|
|
1173
|
-
debug: LogFn;
|
|
1174
|
-
warn: LogFn;
|
|
1175
|
-
trace: LogFn;
|
|
1176
|
-
child(meta?: AnyValueMap): PinoLogger;
|
|
1177
|
-
getBaseLogger(): pino.Logger;
|
|
1178
|
-
}
|
|
1179
|
-
declare function logger(level: LevelWithSilentOrString, meta?: AnyValueMap): PinoLogger;
|
|
1180
|
-
|
|
1181
1165
|
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;
|
|
1182
1166
|
|
|
1183
1167
|
/**
|
|
@@ -1245,4 +1229,4 @@ declare class RateLimiter {
|
|
|
1245
1229
|
static operationType(method: string): 'read' | 'write';
|
|
1246
1230
|
}
|
|
1247
1231
|
|
|
1248
|
-
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,
|
|
1232
|
+
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-DorlR4pn.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-DorlR4pn.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-D3fcC39w.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-D3fcC39w.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';
|
|
@@ -1141,7 +1141,7 @@ type AuditEntry = {
|
|
|
1141
1141
|
eventType: 'http' | 'ws' | 'auth_failure' | 'rate_limit' | 'rbac_deny' | 'super_admin_bypass';
|
|
1142
1142
|
};
|
|
1143
1143
|
declare class AuditLogger {
|
|
1144
|
-
|
|
1144
|
+
_otel: OpenTelemetryCollector<MetricsDefinition>;
|
|
1145
1145
|
constructor(otel: OpenTelemetryCollector<MetricsDefinition>);
|
|
1146
1146
|
append(entry: AuditEntry): void;
|
|
1147
1147
|
static hashBody(body: string | Buffer | undefined | null): string;
|
|
@@ -1162,22 +1162,6 @@ declare function evaluateTelemetryOptions(telemetryOptions: TelemetryOptions): {
|
|
|
1162
1162
|
|
|
1163
1163
|
declare function metricsDefinitions<T extends MetricsDefinition>(metrics: T): T;
|
|
1164
1164
|
|
|
1165
|
-
declare function meta(meta: Record<string, unknown>): LoggerMeta;
|
|
1166
|
-
declare class PinoLogger {
|
|
1167
|
-
private pinoLogger;
|
|
1168
|
-
private meta;
|
|
1169
|
-
constructor(level: LevelWithSilentOrString, meta?: AnyValueMap);
|
|
1170
|
-
log(level: LevelWithSilent, ...args: (string | unknown | LoggerMeta)[]): void;
|
|
1171
|
-
error: LogFn;
|
|
1172
|
-
info: LogFn;
|
|
1173
|
-
debug: LogFn;
|
|
1174
|
-
warn: LogFn;
|
|
1175
|
-
trace: LogFn;
|
|
1176
|
-
child(meta?: AnyValueMap): PinoLogger;
|
|
1177
|
-
getBaseLogger(): pino.Logger;
|
|
1178
|
-
}
|
|
1179
|
-
declare function logger(level: LevelWithSilentOrString, meta?: AnyValueMap): PinoLogger;
|
|
1180
|
-
|
|
1181
1165
|
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;
|
|
1182
1166
|
|
|
1183
1167
|
/**
|
|
@@ -1245,4 +1229,4 @@ declare class RateLimiter {
|
|
|
1245
1229
|
static operationType(method: string): 'read' | 'write';
|
|
1246
1230
|
}
|
|
1247
1231
|
|
|
1248
|
-
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,
|
|
1232
|
+
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
|
@@ -1012,38 +1012,38 @@ function isForklaunchRequest(request) {
|
|
|
1012
1012
|
|
|
1013
1013
|
// src/http/telemetry/openTelemetryCollector.ts
|
|
1014
1014
|
var OpenTelemetryCollector = class {
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1015
|
+
_logger;
|
|
1016
|
+
_serviceName;
|
|
1017
|
+
_metrics;
|
|
1018
1018
|
// scoped creation and create this in middleware when api execute. Also add correlation id
|
|
1019
1019
|
constructor(serviceName, level, metricDefinitions) {
|
|
1020
|
-
this
|
|
1021
|
-
this
|
|
1022
|
-
this
|
|
1020
|
+
this._serviceName = serviceName;
|
|
1021
|
+
this._logger = logger(level || "info");
|
|
1022
|
+
this._metrics = {};
|
|
1023
1023
|
for (const [metricId, metricType] of Object.entries(
|
|
1024
1024
|
metricDefinitions ?? {}
|
|
1025
1025
|
)) {
|
|
1026
1026
|
switch (metricType) {
|
|
1027
1027
|
case "counter":
|
|
1028
|
-
this
|
|
1028
|
+
this._metrics[metricId] = import_api3.metrics.getMeter(this._serviceName).createCounter(metricId);
|
|
1029
1029
|
break;
|
|
1030
1030
|
case "gauge":
|
|
1031
|
-
this
|
|
1031
|
+
this._metrics[metricId] = import_api3.metrics.getMeter(this._serviceName).createGauge(metricId);
|
|
1032
1032
|
break;
|
|
1033
1033
|
case "histogram":
|
|
1034
|
-
this
|
|
1034
|
+
this._metrics[metricId] = import_api3.metrics.getMeter(this._serviceName).createHistogram(metricId);
|
|
1035
1035
|
break;
|
|
1036
1036
|
case "upDownCounter":
|
|
1037
|
-
this
|
|
1037
|
+
this._metrics[metricId] = import_api3.metrics.getMeter(this._serviceName).createUpDownCounter(metricId);
|
|
1038
1038
|
break;
|
|
1039
1039
|
case "observableCounter":
|
|
1040
|
-
this
|
|
1040
|
+
this._metrics[metricId] = import_api3.metrics.getMeter(this._serviceName).createObservableCounter(metricId);
|
|
1041
1041
|
break;
|
|
1042
1042
|
case "observableGauge":
|
|
1043
|
-
this
|
|
1043
|
+
this._metrics[metricId] = import_api3.metrics.getMeter(this._serviceName).createObservableGauge(metricId);
|
|
1044
1044
|
break;
|
|
1045
1045
|
case "observableUpDownCounter":
|
|
1046
|
-
this
|
|
1046
|
+
this._metrics[metricId] = import_api3.metrics.getMeter(this._serviceName).createObservableUpDownCounter(metricId);
|
|
1047
1047
|
break;
|
|
1048
1048
|
}
|
|
1049
1049
|
}
|
|
@@ -1053,25 +1053,25 @@ var OpenTelemetryCollector = class {
|
|
|
1053
1053
|
);
|
|
1054
1054
|
}
|
|
1055
1055
|
log(level, ...args) {
|
|
1056
|
-
this
|
|
1056
|
+
this._logger.log(level, ...args);
|
|
1057
1057
|
}
|
|
1058
1058
|
info = (msg, ...args) => {
|
|
1059
|
-
this
|
|
1059
|
+
this._logger.log("info", msg, ...args);
|
|
1060
1060
|
};
|
|
1061
1061
|
error = (msg, ...args) => {
|
|
1062
|
-
this
|
|
1062
|
+
this._logger.log("error", msg, ...args);
|
|
1063
1063
|
};
|
|
1064
1064
|
warn = (msg, ...args) => {
|
|
1065
|
-
this
|
|
1065
|
+
this._logger.log("warn", msg, ...args);
|
|
1066
1066
|
};
|
|
1067
1067
|
debug = (msg, ...args) => {
|
|
1068
|
-
this
|
|
1068
|
+
this._logger.log("debug", msg, ...args);
|
|
1069
1069
|
};
|
|
1070
1070
|
trace = (msg, ...args) => {
|
|
1071
|
-
this
|
|
1071
|
+
this._logger.log("trace", msg, ...args);
|
|
1072
1072
|
};
|
|
1073
1073
|
getMetric(metricId) {
|
|
1074
|
-
return this
|
|
1074
|
+
return this._metrics[metricId];
|
|
1075
1075
|
}
|
|
1076
1076
|
};
|
|
1077
1077
|
import_dotenv.default.config({ path: (0, import_common7.getEnvVar)("DOTENV_FILE_PATH") });
|
|
@@ -4266,13 +4266,13 @@ function generateOpenApiSpecs(schemaValidator, serverUrls, serverDescriptions, a
|
|
|
4266
4266
|
// src/http/telemetry/auditLogger.ts
|
|
4267
4267
|
var import_crypto3 = require("crypto");
|
|
4268
4268
|
var AuditLogger = class {
|
|
4269
|
-
|
|
4269
|
+
_otel;
|
|
4270
4270
|
constructor(otel) {
|
|
4271
|
-
this
|
|
4271
|
+
this._otel = otel;
|
|
4272
4272
|
}
|
|
4273
4273
|
append(entry) {
|
|
4274
4274
|
try {
|
|
4275
|
-
this
|
|
4275
|
+
this._otel.info(
|
|
4276
4276
|
{
|
|
4277
4277
|
"log.type": "audit",
|
|
4278
4278
|
"audit.timestamp": entry.timestamp,
|