@forklaunch/core 1.0.12 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,62 +1,15 @@
1
1
  import { UnionToIntersection, TypeSafeFunction, StringWithoutSlash, Prettify, SanitizePathSlashes, MakePropertyOptionalIfChildrenOptional } from '@forklaunch/common';
2
2
  import { AnySchemaValidator, UnboxedObjectSchema, IdiomaticSchema, Schema } from '@forklaunch/validator';
3
- import { Counter, Gauge, Histogram, UpDownCounter, ObservableCounter, ObservableGauge, ObservableUpDownCounter, Span } from '@opentelemetry/api';
3
+ 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 { LevelWithSilentOrString, LevelWithSilent } from 'pino';
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';
11
11
  import { ApiReferenceConfiguration } from '@scalar/express-api-reference';
12
12
 
13
- type MetricType<T extends string> = T extends 'counter' ? Counter : T extends 'gauge' ? Gauge : T extends 'histogram' ? Histogram : T extends 'upDownCounter' ? UpDownCounter : T extends 'observableCounter' ? ObservableCounter : T extends 'observableGauge' ? ObservableGauge : T extends 'observableUpDownCounter' ? ObservableUpDownCounter : undefined;
14
- type MetricsDefinition = Record<string, 'counter' | 'gauge' | 'histogram' | 'upDownCounter' | 'observableCounter' | 'observableGauge' | 'observableUpDownCounter'>;
15
- type LoggerMeta = Record<string, unknown> & {
16
- _meta: true;
17
- };
18
- interface LogFn {
19
- <T extends object>(obj: T | LoggerMeta, msg?: string | LoggerMeta, ...args: unknown[]): void;
20
- (obj: unknown | LoggerMeta, msg?: string | LoggerMeta, ...args: unknown[]): void;
21
- (msg: string | LoggerMeta, ...args: unknown[]): void;
22
- }
23
- interface TelemetryOptions {
24
- enabled: boolean | {
25
- metrics?: boolean;
26
- tracing?: boolean;
27
- logging?: boolean;
28
- };
29
- level: LevelWithSilentOrString;
30
- }
31
-
32
- declare class OpenTelemetryCollector<AppliedMetricsDefinition extends MetricsDefinition> {
33
- #private;
34
- constructor(serviceName: string, level?: LevelWithSilentOrString, metricDefinitions?: AppliedMetricsDefinition);
35
- log(level: LevelWithSilent, ...args: (string | unknown | LoggerMeta)[]): void;
36
- info: LogFn;
37
- error: LogFn;
38
- warn: LogFn;
39
- debug: LogFn;
40
- trace: LogFn;
41
- getMetric<T extends keyof AppliedMetricsDefinition>(metricId: T): MetricType<AppliedMetricsDefinition[T]>;
42
- }
43
- declare const httpRequestsTotalCounter: Counter<{
44
- "service.name": string;
45
- application_id?: string;
46
- "api.name": string;
47
- "http.request.method": string;
48
- "http.route": string;
49
- "http.response.status_code": number;
50
- }>;
51
- declare const httpServerDurationHistogram: Histogram<{
52
- "service.name": string;
53
- application_id?: string;
54
- "api.name": string;
55
- "http.request.method": string;
56
- "http.route": string;
57
- "http.response.status_code": number;
58
- }>;
59
-
60
13
  /**
61
14
  * Dictionary type for URL parameters.
62
15
  */
@@ -1128,4 +1081,4 @@ type ResponseShape<Params, Headers, Query, Body> = {
1128
1081
  */
1129
1082
  type PathMatch<SuppliedPath extends `/${string}`, ActualPath extends `/${string}`> = ActualPath extends SuppliedPath ? SuppliedPath extends ActualPath ? SuppliedPath : never : never;
1130
1083
 
1131
- export { type ForklaunchBaseRequest as $, type AuthMethodsBase as A, type Body as B, type ContractDetails as C, type DecodeResource as D, type ExpressLikeRouterOptions as E, type ForklaunchRequest as F, type DocsConfiguration as G, type HttpContractDetails as H, type ErrorContainer as I, type ExpressLikeAuthMapper as J, type ExpressLikeGlobalAuthOptions as K, type LiveTypeFunction as L, type Method as M, type ExpressLikeHandler as N, OpenTelemetryCollector as O, type PathParamHttpContractDetails as P, type QueryObject as Q, type ResponsesObject as R, type StringOnlyObject as S, type TelemetryOptions as T, type ExpressLikeSchemaGlobalAuthOptions as U, type VersionSchema as V, type ExtractBody as W, type ExtractContentType as X, type ExtractResponseBody as Y, type ExtractedParamsObject as Z, type FileBody as _, type SessionObject as a, type ForklaunchResErrors as a0, type HmacMethods as a1, type HttpMethod as a2, type JsonBody as a3, type JwtAuthMethods as a4, type LiveTypeFunctionRequestInit as a5, type MapParamsSchema as a6, type MapReqBodySchema as a7, type MapReqHeadersSchema as a8, type MapReqQuerySchema as a9, type UnknownResponseBody as aA, type UrlEncodedForm as aB, type VersionedResponses as aC, httpRequestsTotalCounter as aD, httpServerDurationHistogram as aE, type MapResBodyMapSchema as aa, type MapResHeadersSchema as ab, type MapSchema as ac, type MapSessionSchema as ad, type MapVersionedReqsSchema as ae, type MapVersionedRespsSchema as af, type MetricType as ag, type MultipartForm as ah, type NumberOnlyObject as ai, type PathParamMethod as aj, type PermissionSet as ak, type RawTypedResponseBody as al, type RequestContext as am, type ResolvedForklaunchAuthRequest as an, type ResolvedForklaunchRequest as ao, type ResolvedForklaunchResponse as ap, type ResponseBody as aq, type ResponseCompiledSchema as ar, type ResponseShape as as, type RoleSet as at, type ServerSentEventBody as au, type TextBody as av, type TypedBody as aw, type TypedRequestBody as ax, type TypedResponseBody as ay, type UnknownBody as az, type ParamsObject as b, type HeadersObject as c, type SchemaAuthMethods as d, type ExpressLikeSchemaHandler as e, type ResolvedSessionObject as f, type PathMatch as g, type LiveSdkFunction as h, type MetricsDefinition as i, type ExpressLikeApplicationOptions as j, type ParamsDictionary as k, type VersionedRequests as l, type AuthMethods as m, type BasicAuthMethods as n, type MiddlewareContractDetails as o, type ExpressLikeSchemaAuthMapper as p, type ForklaunchNextFunction as q, type ForklaunchResponse as r, type ForklaunchResHeaders as s, type ForklaunchStatusResponse as t, type ForklaunchSendableData as u, type LoggerMeta as v, type LogFn as w, type AccessLevel as x, type BodyObject as y, type DefaultSubscriptionData as z };
1084
+ export type { JwtAuthMethods as $, AuthMethodsBase as A, Body as B, ContractDetails as C, DecodeResource as D, ExpressLikeRouterOptions as E, ForklaunchRequest as F, ExpressLikeGlobalAuthOptions as G, HttpContractDetails as H, ExpressLikeHandler as I, ExpressLikeSchemaGlobalAuthOptions as J, ExtractBody as K, LiveTypeFunction as L, Method as M, ExtractContentType as N, ExtractResponseBody as O, PathParamHttpContractDetails as P, QueryObject as Q, ResponsesObject as R, StringOnlyObject as S, ExtractedParamsObject as T, FileBody as U, VersionSchema as V, ForklaunchBaseRequest as W, ForklaunchResErrors as X, HmacMethods as Y, HttpMethod as Z, JsonBody as _, SessionObject as a, LiveTypeFunctionRequestInit as a0, MapParamsSchema as a1, MapReqBodySchema as a2, MapReqHeadersSchema as a3, MapReqQuerySchema as a4, MapResBodyMapSchema as a5, MapResHeadersSchema as a6, MapSchema as a7, MapSessionSchema as a8, MapVersionedReqsSchema as a9, MapVersionedRespsSchema as aa, MultipartForm as ab, NumberOnlyObject as ac, PathParamMethod as ad, PermissionSet as ae, RawTypedResponseBody as af, RequestContext as ag, ResolvedForklaunchAuthRequest as ah, ResolvedForklaunchRequest as ai, ResolvedForklaunchResponse as aj, ResponseBody as ak, ResponseCompiledSchema as al, ResponseShape as am, RoleSet as an, ServerSentEventBody as ao, TextBody as ap, TypedBody as aq, TypedRequestBody as ar, TypedResponseBody as as, UnknownBody as at, UnknownResponseBody as au, UrlEncodedForm as av, VersionedResponses as aw, ParamsObject as b, HeadersObject as c, SchemaAuthMethods as d, ExpressLikeSchemaHandler as e, ResolvedSessionObject as f, PathMatch as g, LiveSdkFunction as h, ExpressLikeApplicationOptions as i, ParamsDictionary as j, VersionedRequests as k, AuthMethods as l, BasicAuthMethods as m, MiddlewareContractDetails as n, ExpressLikeSchemaAuthMapper as o, ForklaunchNextFunction as p, ForklaunchResponse as q, ForklaunchResHeaders as r, ForklaunchStatusResponse as s, ForklaunchSendableData as t, AccessLevel as u, BodyObject as v, DefaultSubscriptionData as w, DocsConfiguration as x, ErrorContainer as y, ExpressLikeAuthMapper as z };
@@ -1,62 +1,15 @@
1
1
  import { UnionToIntersection, TypeSafeFunction, StringWithoutSlash, Prettify, SanitizePathSlashes, MakePropertyOptionalIfChildrenOptional } from '@forklaunch/common';
2
2
  import { AnySchemaValidator, UnboxedObjectSchema, IdiomaticSchema, Schema } from '@forklaunch/validator';
3
- import { Counter, Gauge, Histogram, UpDownCounter, ObservableCounter, ObservableGauge, ObservableUpDownCounter, Span } from '@opentelemetry/api';
3
+ 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 { LevelWithSilentOrString, LevelWithSilent } from 'pino';
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';
11
11
  import { ApiReferenceConfiguration } from '@scalar/express-api-reference';
12
12
 
13
- type MetricType<T extends string> = T extends 'counter' ? Counter : T extends 'gauge' ? Gauge : T extends 'histogram' ? Histogram : T extends 'upDownCounter' ? UpDownCounter : T extends 'observableCounter' ? ObservableCounter : T extends 'observableGauge' ? ObservableGauge : T extends 'observableUpDownCounter' ? ObservableUpDownCounter : undefined;
14
- type MetricsDefinition = Record<string, 'counter' | 'gauge' | 'histogram' | 'upDownCounter' | 'observableCounter' | 'observableGauge' | 'observableUpDownCounter'>;
15
- type LoggerMeta = Record<string, unknown> & {
16
- _meta: true;
17
- };
18
- interface LogFn {
19
- <T extends object>(obj: T | LoggerMeta, msg?: string | LoggerMeta, ...args: unknown[]): void;
20
- (obj: unknown | LoggerMeta, msg?: string | LoggerMeta, ...args: unknown[]): void;
21
- (msg: string | LoggerMeta, ...args: unknown[]): void;
22
- }
23
- interface TelemetryOptions {
24
- enabled: boolean | {
25
- metrics?: boolean;
26
- tracing?: boolean;
27
- logging?: boolean;
28
- };
29
- level: LevelWithSilentOrString;
30
- }
31
-
32
- declare class OpenTelemetryCollector<AppliedMetricsDefinition extends MetricsDefinition> {
33
- #private;
34
- constructor(serviceName: string, level?: LevelWithSilentOrString, metricDefinitions?: AppliedMetricsDefinition);
35
- log(level: LevelWithSilent, ...args: (string | unknown | LoggerMeta)[]): void;
36
- info: LogFn;
37
- error: LogFn;
38
- warn: LogFn;
39
- debug: LogFn;
40
- trace: LogFn;
41
- getMetric<T extends keyof AppliedMetricsDefinition>(metricId: T): MetricType<AppliedMetricsDefinition[T]>;
42
- }
43
- declare const httpRequestsTotalCounter: Counter<{
44
- "service.name": string;
45
- application_id?: string;
46
- "api.name": string;
47
- "http.request.method": string;
48
- "http.route": string;
49
- "http.response.status_code": number;
50
- }>;
51
- declare const httpServerDurationHistogram: Histogram<{
52
- "service.name": string;
53
- application_id?: string;
54
- "api.name": string;
55
- "http.request.method": string;
56
- "http.route": string;
57
- "http.response.status_code": number;
58
- }>;
59
-
60
13
  /**
61
14
  * Dictionary type for URL parameters.
62
15
  */
@@ -1128,4 +1081,4 @@ type ResponseShape<Params, Headers, Query, Body> = {
1128
1081
  */
1129
1082
  type PathMatch<SuppliedPath extends `/${string}`, ActualPath extends `/${string}`> = ActualPath extends SuppliedPath ? SuppliedPath extends ActualPath ? SuppliedPath : never : never;
1130
1083
 
1131
- export { type ForklaunchBaseRequest as $, type AuthMethodsBase as A, type Body as B, type ContractDetails as C, type DecodeResource as D, type ExpressLikeRouterOptions as E, type ForklaunchRequest as F, type DocsConfiguration as G, type HttpContractDetails as H, type ErrorContainer as I, type ExpressLikeAuthMapper as J, type ExpressLikeGlobalAuthOptions as K, type LiveTypeFunction as L, type Method as M, type ExpressLikeHandler as N, OpenTelemetryCollector as O, type PathParamHttpContractDetails as P, type QueryObject as Q, type ResponsesObject as R, type StringOnlyObject as S, type TelemetryOptions as T, type ExpressLikeSchemaGlobalAuthOptions as U, type VersionSchema as V, type ExtractBody as W, type ExtractContentType as X, type ExtractResponseBody as Y, type ExtractedParamsObject as Z, type FileBody as _, type SessionObject as a, type ForklaunchResErrors as a0, type HmacMethods as a1, type HttpMethod as a2, type JsonBody as a3, type JwtAuthMethods as a4, type LiveTypeFunctionRequestInit as a5, type MapParamsSchema as a6, type MapReqBodySchema as a7, type MapReqHeadersSchema as a8, type MapReqQuerySchema as a9, type UnknownResponseBody as aA, type UrlEncodedForm as aB, type VersionedResponses as aC, httpRequestsTotalCounter as aD, httpServerDurationHistogram as aE, type MapResBodyMapSchema as aa, type MapResHeadersSchema as ab, type MapSchema as ac, type MapSessionSchema as ad, type MapVersionedReqsSchema as ae, type MapVersionedRespsSchema as af, type MetricType as ag, type MultipartForm as ah, type NumberOnlyObject as ai, type PathParamMethod as aj, type PermissionSet as ak, type RawTypedResponseBody as al, type RequestContext as am, type ResolvedForklaunchAuthRequest as an, type ResolvedForklaunchRequest as ao, type ResolvedForklaunchResponse as ap, type ResponseBody as aq, type ResponseCompiledSchema as ar, type ResponseShape as as, type RoleSet as at, type ServerSentEventBody as au, type TextBody as av, type TypedBody as aw, type TypedRequestBody as ax, type TypedResponseBody as ay, type UnknownBody as az, type ParamsObject as b, type HeadersObject as c, type SchemaAuthMethods as d, type ExpressLikeSchemaHandler as e, type ResolvedSessionObject as f, type PathMatch as g, type LiveSdkFunction as h, type MetricsDefinition as i, type ExpressLikeApplicationOptions as j, type ParamsDictionary as k, type VersionedRequests as l, type AuthMethods as m, type BasicAuthMethods as n, type MiddlewareContractDetails as o, type ExpressLikeSchemaAuthMapper as p, type ForklaunchNextFunction as q, type ForklaunchResponse as r, type ForklaunchResHeaders as s, type ForklaunchStatusResponse as t, type ForklaunchSendableData as u, type LoggerMeta as v, type LogFn as w, type AccessLevel as x, type BodyObject as y, type DefaultSubscriptionData as z };
1084
+ export type { JwtAuthMethods as $, AuthMethodsBase as A, Body as B, ContractDetails as C, DecodeResource as D, ExpressLikeRouterOptions as E, ForklaunchRequest as F, ExpressLikeGlobalAuthOptions as G, HttpContractDetails as H, ExpressLikeHandler as I, ExpressLikeSchemaGlobalAuthOptions as J, ExtractBody as K, LiveTypeFunction as L, Method as M, ExtractContentType as N, ExtractResponseBody as O, PathParamHttpContractDetails as P, QueryObject as Q, ResponsesObject as R, StringOnlyObject as S, ExtractedParamsObject as T, FileBody as U, VersionSchema as V, ForklaunchBaseRequest as W, ForklaunchResErrors as X, HmacMethods as Y, HttpMethod as Z, JsonBody as _, SessionObject as a, LiveTypeFunctionRequestInit as a0, MapParamsSchema as a1, MapReqBodySchema as a2, MapReqHeadersSchema as a3, MapReqQuerySchema as a4, MapResBodyMapSchema as a5, MapResHeadersSchema as a6, MapSchema as a7, MapSessionSchema as a8, MapVersionedReqsSchema as a9, MapVersionedRespsSchema as aa, MultipartForm as ab, NumberOnlyObject as ac, PathParamMethod as ad, PermissionSet as ae, RawTypedResponseBody as af, RequestContext as ag, ResolvedForklaunchAuthRequest as ah, ResolvedForklaunchRequest as ai, ResolvedForklaunchResponse as aj, ResponseBody as ak, ResponseCompiledSchema as al, ResponseShape as am, RoleSet as an, ServerSentEventBody as ao, TextBody as ap, TypedBody as aq, TypedRequestBody as ar, TypedResponseBody as as, UnknownBody as at, UnknownResponseBody as au, UrlEncodedForm as av, VersionedResponses as aw, ParamsObject as b, HeadersObject as c, SchemaAuthMethods as d, ExpressLikeSchemaHandler as e, ResolvedSessionObject as f, PathMatch as g, LiveSdkFunction as h, ExpressLikeApplicationOptions as i, ParamsDictionary as j, VersionedRequests as k, AuthMethods as l, BasicAuthMethods as m, MiddlewareContractDetails as n, ExpressLikeSchemaAuthMapper as o, ForklaunchNextFunction as p, ForklaunchResponse as q, ForklaunchResHeaders as r, ForklaunchStatusResponse as s, ForklaunchSendableData as t, AccessLevel as u, BodyObject as v, DefaultSubscriptionData as w, DocsConfiguration as x, ErrorContainer as y, ExpressLikeAuthMapper as z };
@@ -3,8 +3,10 @@ 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 { 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, O as OpenTelemetryCollector, i as MetricsDefinition, j as ExpressLikeApplicationOptions, k as ParamsDictionary, l as VersionedRequests, m as AuthMethods, D as DecodeResource, n as BasicAuthMethods, F as ForklaunchRequest, o as MiddlewareContractDetails, p as ExpressLikeSchemaAuthMapper, q as ForklaunchNextFunction, r as ForklaunchResponse, s as ForklaunchResHeaders, t as ForklaunchStatusResponse, u as ForklaunchSendableData, T as TelemetryOptions, v as LoggerMeta, w as LogFn } from '../apiDefinition.types-Br0fDuBQ.mjs';
7
- export { x as AccessLevel, y as BodyObject, z as DefaultSubscriptionData, G as DocsConfiguration, I as ErrorContainer, J as ExpressLikeAuthMapper, K as ExpressLikeGlobalAuthOptions, N as ExpressLikeHandler, U as ExpressLikeSchemaGlobalAuthOptions, W as ExtractBody, X as ExtractContentType, Y as ExtractResponseBody, Z as ExtractedParamsObject, _ as FileBody, $ as ForklaunchBaseRequest, a0 as ForklaunchResErrors, a1 as HmacMethods, a2 as HttpMethod, a3 as JsonBody, a4 as JwtAuthMethods, a5 as LiveTypeFunctionRequestInit, a6 as MapParamsSchema, a7 as MapReqBodySchema, a8 as MapReqHeadersSchema, a9 as MapReqQuerySchema, aa as MapResBodyMapSchema, ab as MapResHeadersSchema, ac as MapSchema, ad as MapSessionSchema, ae as MapVersionedReqsSchema, af as MapVersionedRespsSchema, ag as MetricType, ah as MultipartForm, ai as NumberOnlyObject, aj as PathParamMethod, ak as PermissionSet, al as RawTypedResponseBody, am as RequestContext, an as ResolvedForklaunchAuthRequest, ao as ResolvedForklaunchRequest, ap as ResolvedForklaunchResponse, aq as ResponseBody, ar as ResponseCompiledSchema, as as ResponseShape, at as RoleSet, au as ServerSentEventBody, S as StringOnlyObject, av as TextBody, aw as TypedBody, ax as TypedRequestBody, ay as TypedResponseBody, az as UnknownBody, aA as UnknownResponseBody, aB as UrlEncodedForm, aC as VersionedResponses, aD as httpRequestsTotalCounter, aE as httpServerDurationHistogram } from '../apiDefinition.types-Br0fDuBQ.mjs';
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-DUkE1FHm.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-DUkE1FHm.mjs';
8
10
  import { JWTPayload, JWK } from 'jose';
9
11
  import { ZodSchemaValidator } from '@forklaunch/validator/zod';
10
12
  import { FastMCP } from 'fastmcp';
@@ -3,8 +3,10 @@ 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 { 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, O as OpenTelemetryCollector, i as MetricsDefinition, j as ExpressLikeApplicationOptions, k as ParamsDictionary, l as VersionedRequests, m as AuthMethods, D as DecodeResource, n as BasicAuthMethods, F as ForklaunchRequest, o as MiddlewareContractDetails, p as ExpressLikeSchemaAuthMapper, q as ForklaunchNextFunction, r as ForklaunchResponse, s as ForklaunchResHeaders, t as ForklaunchStatusResponse, u as ForklaunchSendableData, T as TelemetryOptions, v as LoggerMeta, w as LogFn } from '../apiDefinition.types-Br0fDuBQ.js';
7
- export { x as AccessLevel, y as BodyObject, z as DefaultSubscriptionData, G as DocsConfiguration, I as ErrorContainer, J as ExpressLikeAuthMapper, K as ExpressLikeGlobalAuthOptions, N as ExpressLikeHandler, U as ExpressLikeSchemaGlobalAuthOptions, W as ExtractBody, X as ExtractContentType, Y as ExtractResponseBody, Z as ExtractedParamsObject, _ as FileBody, $ as ForklaunchBaseRequest, a0 as ForklaunchResErrors, a1 as HmacMethods, a2 as HttpMethod, a3 as JsonBody, a4 as JwtAuthMethods, a5 as LiveTypeFunctionRequestInit, a6 as MapParamsSchema, a7 as MapReqBodySchema, a8 as MapReqHeadersSchema, a9 as MapReqQuerySchema, aa as MapResBodyMapSchema, ab as MapResHeadersSchema, ac as MapSchema, ad as MapSessionSchema, ae as MapVersionedReqsSchema, af as MapVersionedRespsSchema, ag as MetricType, ah as MultipartForm, ai as NumberOnlyObject, aj as PathParamMethod, ak as PermissionSet, al as RawTypedResponseBody, am as RequestContext, an as ResolvedForklaunchAuthRequest, ao as ResolvedForklaunchRequest, ap as ResolvedForklaunchResponse, aq as ResponseBody, ar as ResponseCompiledSchema, as as ResponseShape, at as RoleSet, au as ServerSentEventBody, S as StringOnlyObject, av as TextBody, aw as TypedBody, ax as TypedRequestBody, ay as TypedResponseBody, az as UnknownBody, aA as UnknownResponseBody, aB as UrlEncodedForm, aC as VersionedResponses, aD as httpRequestsTotalCounter, aE as httpServerDurationHistogram } from '../apiDefinition.types-Br0fDuBQ.js';
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-DdQ3d8il.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-DdQ3d8il.js';
8
10
  import { JWTPayload, JWK } from 'jose';
9
11
  import { ZodSchemaValidator } from '@forklaunch/validator/zod';
10
12
  import { FastMCP } from 'fastmcp';
package/lib/http/index.js CHANGED
@@ -322,7 +322,12 @@ var import_common10 = require("@forklaunch/common");
322
322
 
323
323
  // src/http/guards/hasPermissionChecks.ts
324
324
  function hasPermissionChecks(maybePermissionedAuth) {
325
- return typeof maybePermissionedAuth === "object" && maybePermissionedAuth !== null && ("allowedPermissions" in maybePermissionedAuth || "forbiddenPermissions" in maybePermissionedAuth);
325
+ if (typeof maybePermissionedAuth !== "object" || maybePermissionedAuth === null) {
326
+ return false;
327
+ }
328
+ const hasAllowedPermissions = "allowedPermissions" in maybePermissionedAuth && maybePermissionedAuth.allowedPermissions instanceof Set && maybePermissionedAuth.allowedPermissions.size > 0;
329
+ const hasForbiddenPermissions = "forbiddenPermissions" in maybePermissionedAuth && maybePermissionedAuth.forbiddenPermissions instanceof Set && maybePermissionedAuth.forbiddenPermissions.size > 0;
330
+ return hasAllowedPermissions || hasForbiddenPermissions;
326
331
  }
327
332
 
328
333
  // src/http/guards/hasRoleChecks.ts