@forklaunch/core 1.0.13 → 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.
- package/lib/{apiDefinition.types-Br0fDuBQ.d.mts → apiDefinition.types-DUkE1FHm.d.mts} +3 -50
- package/lib/{apiDefinition.types-Br0fDuBQ.d.ts → apiDefinition.types-DdQ3d8il.d.ts} +3 -50
- package/lib/http/index.d.mts +4 -2
- package/lib/http/index.d.ts +4 -2
- package/lib/http/index.js +6 -1
- package/lib/http/index.js.map +1 -1
- package/lib/http/index.mjs +6 -1
- package/lib/http/index.mjs.map +1 -1
- package/lib/openTelemetryCollector-DXGXRvQP.d.mts +51 -0
- package/lib/openTelemetryCollector-DXGXRvQP.d.ts +51 -0
- package/lib/persistence/index.d.mts +23 -6
- package/lib/persistence/index.d.ts +23 -6
- package/lib/persistence/index.js +64 -1
- package/lib/persistence/index.js.map +1 -1
- package/lib/persistence/index.mjs +59 -1
- package/lib/persistence/index.mjs.map +1 -1
- package/lib/services/index.d.mts +34 -2
- package/lib/services/index.d.ts +34 -2
- package/lib/services/index.js +173 -0
- package/lib/services/index.js.map +1 -1
- package/lib/services/index.mjs +172 -0
- package/lib/services/index.mjs.map +1 -1
- package/lib/ws/index.d.mts +2 -1
- package/lib/ws/index.d.ts +2 -1
- package/package.json +4 -4
|
@@ -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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 };
|
package/lib/http/index.d.mts
CHANGED
|
@@ -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 {
|
|
7
|
-
export {
|
|
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';
|
package/lib/http/index.d.ts
CHANGED
|
@@ -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 {
|
|
7
|
-
export {
|
|
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
|
-
|
|
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
|