@classytic/arc 2.7.3 → 2.8.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/README.md +2 -2
- package/dist/{HookSystem-D7lfx--K.mjs → HookSystem-BjFu7zf1.mjs} +3 -2
- package/dist/adapters/index.d.mts +2 -2
- package/dist/audit/index.d.mts +1 -1
- package/dist/audit/index.mjs +1 -1
- package/dist/audit/mongodb.d.mts +1 -1
- package/dist/audit/mongodb.mjs +1 -1
- package/dist/auth/index.d.mts +4 -4
- package/dist/auth/index.mjs +2 -2
- package/dist/auth/redis-session.d.mts +1 -1
- package/dist/{betterAuthOpenApi-CCw3YX0g.mjs → betterAuthOpenApi-CHCIuA-p.mjs} +1 -1
- package/dist/cache/index.d.mts +2 -2
- package/dist/cache/index.mjs +1 -1
- package/dist/cli/commands/docs.mjs +2 -2
- package/dist/cli/commands/generate.mjs +1 -1
- package/dist/cli/commands/introspect.mjs +1 -1
- package/dist/core/index.d.mts +2 -2
- package/dist/core/index.mjs +3 -2
- package/dist/core-BfrfxNqO.mjs +34 -0
- package/dist/{core-BWekSEju.mjs → createActionRouter-CbkIAaGh.mjs} +6 -36
- package/dist/{createApp-D7e77m8C.mjs → createApp-Cy8eUNKQ.mjs} +10 -10
- package/dist/{defineResource-DZzyl4a4.mjs → defineResource-CovBXvTB.mjs} +75 -9
- package/dist/docs/index.d.mts +2 -2
- package/dist/docs/index.mjs +1 -1
- package/dist/dynamic/index.d.mts +2 -2
- package/dist/dynamic/index.mjs +1 -1
- package/dist/{elevation-By_p2lnn.mjs → elevation-BBGFjzIP.mjs} +1 -1
- package/dist/{errorHandler-pCpEtNd7.d.mts → errorHandler-BeN-ERN7.d.mts} +1 -1
- package/dist/{eventPlugin-CdvUoUna.d.mts → eventPlugin-CAOWMQS8.d.mts} +1 -1
- package/dist/events/index.d.mts +3 -3
- package/dist/events/index.mjs +1 -1
- package/dist/events/transports/redis-stream-entry.d.mts +1 -1
- package/dist/events/transports/redis.d.mts +1 -1
- package/dist/factory/index.d.mts +1 -1
- package/dist/factory/index.mjs +7 -6
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/idempotency/index.d.mts +3 -3
- package/dist/idempotency/mongodb.d.mts +1 -1
- package/dist/idempotency/mongodb.mjs +1 -3
- package/dist/idempotency/redis.d.mts +1 -1
- package/dist/{index-C9eYNjGR.d.mts → index-BpMhrFgn.d.mts} +1 -1
- package/dist/{index-B0extFr4.d.mts → index-CBru2y5Y.d.mts} +3 -3
- package/dist/{index-BjShrzoj.d.mts → index-qct60lnl.d.mts} +14 -14
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +4 -4
- package/dist/integrations/event-gateway.d.mts +1 -1
- package/dist/integrations/event-gateway.mjs +1 -1
- package/dist/integrations/index.d.mts +1 -1
- package/dist/integrations/mcp/index.d.mts +2 -2
- package/dist/integrations/mcp/index.mjs +1 -1
- package/dist/integrations/mcp/testing.d.mts +1 -1
- package/dist/integrations/mcp/testing.mjs +1 -1
- package/dist/integrations/streamline.d.mts +39 -7
- package/dist/integrations/streamline.mjs +106 -4
- package/dist/{interface-B91alUzq.d.mts → interface-IJqN3pXK.d.mts} +145 -4
- package/dist/{mongodb-Cgu9F1Nd.d.mts → mongodb-B1eVtFhw.d.mts} +1 -1
- package/dist/{mongodb-B7zupyck.d.mts → mongodb-NShVZDMr.d.mts} +1 -1
- package/dist/{openapi-BBSTVcMm.mjs → openapi-AYLVjqVe.mjs} +1 -1
- package/dist/org/index.d.mts +2 -2
- package/dist/permissions/index.d.mts +3 -3
- package/dist/plugins/index.d.mts +4 -4
- package/dist/plugins/index.mjs +8 -8
- package/dist/plugins/tracing-entry.d.mts +1 -1
- package/dist/plugins/tracing-entry.mjs +1 -1
- package/dist/policies/index.d.mts +1 -1
- package/dist/presets/index.d.mts +1 -1
- package/dist/presets/multiTenant.d.mts +1 -1
- package/dist/{queryCachePlugin-Ckl71mkc.d.mts → queryCachePlugin-BCFVXnxK.d.mts} +1 -1
- package/dist/{redis-3TQxm2VZ.d.mts → redis-Bunu3qWg.d.mts} +1 -1
- package/dist/{redis-stream-Dag5LFa9.d.mts → redis-stream-CF1lrKVk.d.mts} +1 -1
- package/dist/registry/index.d.mts +1 -1
- package/dist/registry/index.mjs +2 -2
- package/dist/{resourceToTools-BJkoQoUP.mjs → resourceToTools-C_1SMiCz.mjs} +1 -1
- package/dist/rpc/index.d.mts +1 -1
- package/dist/{schemaConverter-0TyONAwM.mjs → schemaConverter-Y5EejTnJ.mjs} +1 -4
- package/dist/scope/index.d.mts +2 -2
- package/dist/scope/index.mjs +1 -1
- package/dist/{sse-6W0hjVS_.mjs → sse-CD5Hghpu.mjs} +1 -1
- package/dist/testing/index.d.mts +2 -2
- package/dist/testing/index.mjs +1 -1
- package/dist/types/index.d.mts +5 -5
- package/dist/{types-B4BNthET.d.mts → types-BoaZHr-2.d.mts} +1 -1
- package/dist/{types-C5g2oRC7.d.mts → types-Ct0PUUSp.d.mts} +1 -1
- package/dist/{types-2FlNl0mL.d.mts → types-gUxAIZHp.d.mts} +13 -9
- package/dist/utils/index.d.mts +3 -3
- package/dist/utils/index.mjs +1 -1
- package/package.json +8 -7
- package/skills/arc/SKILL.md +23 -4
- package/skills/arc/references/integrations.md +1 -1
- package/skills/arc/references/mcp.md +2 -0
- /package/dist/{EventTransport-C4VheKeC.d.mts → EventTransport-n1KBxC_N.d.mts} +0 -0
- /package/dist/{ResourceRegistry-DsHiG9cL.mjs → ResourceRegistry-BOtJuRCs.mjs} +0 -0
- /package/dist/{caching-5DtLwIqb.mjs → caching-CHH-iHs3.mjs} +0 -0
- /package/dist/{circuitBreaker-BBPDt-J_.d.mts → circuitBreaker-BGVoB1hD.d.mts} +0 -0
- /package/dist/{elevation-D7WK0RXq.d.mts → elevation-UJO3-NvX.d.mts} +0 -0
- /package/dist/{errorHandler-CH8wk1eD.mjs → errorHandler-BW08lEiy.mjs} +0 -0
- /package/dist/{errors-BS6lZvWy.d.mts → errors-BI8kEKsO.d.mts} +0 -0
- /package/dist/{eventPlugin-B6U_nCFU.mjs → eventPlugin-x4jo3sG0.mjs} +0 -0
- /package/dist/{externalPaths-iba7jD3d.d.mts → externalPaths-BQ8QijNH.d.mts} +0 -0
- /package/dist/{fields-D4nMDqnK.d.mts → fields-DoeDgh2b.d.mts} +0 -0
- /package/dist/{interface-CSbZdv_3.d.mts → interface-CkkWm5uR.d.mts} +0 -0
- /package/dist/{interface-CG7oRZjX.d.mts → interface-bpoLKKqx.d.mts} +0 -0
- /package/dist/{logger-DLg8-Ueg.mjs → logger-CDjpjySd.mjs} +0 -0
- /package/dist/{metrics-Qnvwc-LQ.mjs → metrics-DuhiSEZI.mjs} +0 -0
- /package/dist/{mongodb-B7X7P1P8.mjs → mongodb-5Ff3w8jy.mjs} +0 -0
- /package/dist/{pluralize-Dckfq6US.mjs → pluralize-BneOJkpi.mjs} +0 -0
- /package/dist/{queryCachePlugin-CwTpR04-.mjs → queryCachePlugin-D0iIVhW_.mjs} +0 -0
- /package/dist/{registry-B3lRFBWo.mjs → registry-B0Wl7uVV.mjs} +0 -0
- /package/dist/{replyHelpers-uDUIYh7u.mjs → replyHelpers-CXtJDAZ0.mjs} +0 -0
- /package/dist/{sessionManager-CEo9jwPI.d.mts → sessionManager-BkzVU8h2.d.mts} +0 -0
- /package/dist/{tracing-DEqdGkr-.d.mts → tracing-xqXzWeaf.d.mts} +0 -0
- /package/dist/{types--D3vvfdt.d.mts → types-CN6JvmYz.d.mts} +0 -0
- /package/dist/{versioning-CdBbFefk.mjs → versioning-CPU_5Xfs.mjs} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as RequestScope } from "./types
|
|
2
|
-
import { n as FieldPermissionMap } from "./fields-
|
|
3
|
-
import { i as UserBase, t as PermissionCheck } from "./types-
|
|
1
|
+
import { r as RequestScope } from "./types-CN6JvmYz.mjs";
|
|
2
|
+
import { n as FieldPermissionMap } from "./fields-DoeDgh2b.mjs";
|
|
3
|
+
import { i as UserBase, t as PermissionCheck } from "./types-BoaZHr-2.mjs";
|
|
4
4
|
import { FastifyInstance, FastifyPluginAsync, FastifyReply, FastifyRequest, RouteHandlerMethod, RouteHandlerMethod as RouteHandlerMethod$1 } from "fastify";
|
|
5
5
|
|
|
6
6
|
//#region src/hooks/HookSystem.d.ts
|
|
@@ -468,6 +468,8 @@ declare class ResourceDefinition<TDoc = AnyRecord> {
|
|
|
468
468
|
readonly middlewares: MiddlewareConfig;
|
|
469
469
|
readonly disableDefaultRoutes: boolean;
|
|
470
470
|
readonly disabledRoutes: CrudRouteKey[];
|
|
471
|
+
readonly actions?: ActionsMap;
|
|
472
|
+
readonly actionPermissions?: PermissionCheck;
|
|
471
473
|
readonly events: Record<string, EventDefinition>;
|
|
472
474
|
readonly rateLimit?: RateLimitConfig | false;
|
|
473
475
|
readonly audit?: boolean | {
|
|
@@ -1652,7 +1654,44 @@ interface ResourceConfig<TDoc = AnyRecord> {
|
|
|
1652
1654
|
*/
|
|
1653
1655
|
fields?: FieldPermissionMap;
|
|
1654
1656
|
middlewares?: MiddlewareConfig;
|
|
1657
|
+
/** @deprecated Use `routes` instead. Will error in v3. */
|
|
1655
1658
|
additionalRoutes?: AdditionalRoute[];
|
|
1659
|
+
/**
|
|
1660
|
+
* Custom routes — the v2.8 way to add endpoints beyond CRUD.
|
|
1661
|
+
* Replaces `additionalRoutes` with cleaner naming and no `wrapHandler` boolean.
|
|
1662
|
+
*
|
|
1663
|
+
* @example
|
|
1664
|
+
* ```typescript
|
|
1665
|
+
* routes: [
|
|
1666
|
+
* { method: 'GET', path: '/stats', handler: 'getStats', permissions: auth() },
|
|
1667
|
+
* { method: 'POST', path: '/webhook', handler: webhookFn, raw: true, permissions: auth() },
|
|
1668
|
+
* ]
|
|
1669
|
+
* ```
|
|
1670
|
+
*/
|
|
1671
|
+
routes?: RouteDefinition[];
|
|
1672
|
+
/**
|
|
1673
|
+
* State-transition actions → unified POST /:id/action endpoint.
|
|
1674
|
+
* Each action can be a bare handler or full config with permissions + schema.
|
|
1675
|
+
*
|
|
1676
|
+
* @example
|
|
1677
|
+
* ```typescript
|
|
1678
|
+
* actions: {
|
|
1679
|
+
* approve: async (id, data, req) => service.approve(id, req.user._id),
|
|
1680
|
+
* cancel: {
|
|
1681
|
+
* handler: async (id, data, req) => service.cancel(id, data.reason, req.user._id),
|
|
1682
|
+
* permissions: roles('admin'),
|
|
1683
|
+
* schema: { reason: { type: 'string' } },
|
|
1684
|
+
* },
|
|
1685
|
+
* },
|
|
1686
|
+
* actionPermissions: auth(),
|
|
1687
|
+
* ```
|
|
1688
|
+
*/
|
|
1689
|
+
actions?: ActionsMap;
|
|
1690
|
+
/**
|
|
1691
|
+
* Fallback permission for actions without per-action permissions.
|
|
1692
|
+
* Only applies when `actions` is defined.
|
|
1693
|
+
*/
|
|
1694
|
+
actionPermissions?: PermissionCheck;
|
|
1656
1695
|
disableCrud?: boolean;
|
|
1657
1696
|
disableDefaultRoutes?: boolean;
|
|
1658
1697
|
disabledRoutes?: CrudRouteKey[];
|
|
@@ -1920,6 +1959,108 @@ interface AdditionalRoute {
|
|
|
1920
1959
|
isError?: boolean;
|
|
1921
1960
|
}>;
|
|
1922
1961
|
}
|
|
1962
|
+
/** HTTP methods for custom routes */
|
|
1963
|
+
type RouteMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
1964
|
+
/** MCP tool configuration for a route or action */
|
|
1965
|
+
interface RouteMcpConfig {
|
|
1966
|
+
/** Override auto-generated tool description */
|
|
1967
|
+
readonly description?: string;
|
|
1968
|
+
/** MCP tool annotations */
|
|
1969
|
+
readonly annotations?: {
|
|
1970
|
+
readonly readOnlyHint?: boolean;
|
|
1971
|
+
readonly destructiveHint?: boolean;
|
|
1972
|
+
readonly idempotentHint?: boolean;
|
|
1973
|
+
readonly openWorldHint?: boolean;
|
|
1974
|
+
};
|
|
1975
|
+
}
|
|
1976
|
+
/**
|
|
1977
|
+
* Route definition — replaces additionalRoutes.
|
|
1978
|
+
*
|
|
1979
|
+
* - `handler: 'string'` → controller method → full Arc pipeline + MCP tool
|
|
1980
|
+
* - `handler: function` → inline handler → full Arc pipeline + MCP tool
|
|
1981
|
+
* - `raw: true` → raw Fastify handler → no pipeline, no MCP by default
|
|
1982
|
+
*/
|
|
1983
|
+
interface RouteDefinition {
|
|
1984
|
+
readonly method: RouteMethod;
|
|
1985
|
+
/** Path relative to resource prefix */
|
|
1986
|
+
readonly path: string;
|
|
1987
|
+
/**
|
|
1988
|
+
* Route handler.
|
|
1989
|
+
* - String: controller method name (goes through Arc pipeline)
|
|
1990
|
+
* - Function without `raw: true`: receives IRequestContext, returns IControllerResponse (goes through Arc pipeline)
|
|
1991
|
+
* - Function with `raw: true`: raw Fastify handler (request, reply)
|
|
1992
|
+
*/
|
|
1993
|
+
readonly handler: string | ControllerHandler | RouteHandlerMethod | ((request: FastifyRequest<Record<string, unknown>>, reply: FastifyReply) => unknown);
|
|
1994
|
+
/** Permission check — REQUIRED */
|
|
1995
|
+
readonly permissions: PermissionCheck;
|
|
1996
|
+
/**
|
|
1997
|
+
* Raw mode — bypasses Arc pipeline. Handler receives raw Fastify request/reply.
|
|
1998
|
+
* Default: false (handler goes through Arc pipeline).
|
|
1999
|
+
*/
|
|
2000
|
+
readonly raw?: boolean;
|
|
2001
|
+
/** Logical operation name (for pipeline keys, MCP tool naming). Defaults to handler name or method+path slug. */
|
|
2002
|
+
readonly operation?: string;
|
|
2003
|
+
/** OpenAPI summary */
|
|
2004
|
+
readonly summary?: string;
|
|
2005
|
+
/** OpenAPI description */
|
|
2006
|
+
readonly description?: string;
|
|
2007
|
+
/** OpenAPI tags */
|
|
2008
|
+
readonly tags?: string[];
|
|
2009
|
+
/** Route-level middleware */
|
|
2010
|
+
readonly preHandler?: RouteHandlerMethod[] | ((fastify: FastifyInstance) => RouteHandlerMethod[]);
|
|
2011
|
+
/** Pre-auth handlers (run before authentication) */
|
|
2012
|
+
readonly preAuth?: RouteHandlerMethod[];
|
|
2013
|
+
/** SSE streaming mode */
|
|
2014
|
+
readonly streamResponse?: boolean;
|
|
2015
|
+
/** Fastify route schema */
|
|
2016
|
+
readonly schema?: Record<string, unknown>;
|
|
2017
|
+
/**
|
|
2018
|
+
* MCP tool generation:
|
|
2019
|
+
* - omitted/true: auto-generate (non-raw routes only)
|
|
2020
|
+
* - false: skip MCP
|
|
2021
|
+
* - object: explicit config
|
|
2022
|
+
*/
|
|
2023
|
+
readonly mcp?: boolean | RouteMcpConfig;
|
|
2024
|
+
/**
|
|
2025
|
+
* MCP handler for raw routes — parallel entry point for MCP without changing HTTP handler.
|
|
2026
|
+
*/
|
|
2027
|
+
readonly mcpHandler?: (input: Record<string, unknown>) => Promise<{
|
|
2028
|
+
content: Array<{
|
|
2029
|
+
type: string;
|
|
2030
|
+
text: string;
|
|
2031
|
+
}>;
|
|
2032
|
+
isError?: boolean;
|
|
2033
|
+
}>;
|
|
2034
|
+
}
|
|
2035
|
+
/**
|
|
2036
|
+
* Action handler function for state transitions.
|
|
2037
|
+
* Receives the resource ID, action-specific data, and the request context.
|
|
2038
|
+
*/
|
|
2039
|
+
type ActionHandlerFn = (id: string, data: Record<string, unknown>, req: RequestWithExtras) => Promise<unknown>;
|
|
2040
|
+
/**
|
|
2041
|
+
* Full action configuration with handler, permissions, and schema.
|
|
2042
|
+
*/
|
|
2043
|
+
interface ActionDefinition {
|
|
2044
|
+
/** Action handler */
|
|
2045
|
+
readonly handler: ActionHandlerFn;
|
|
2046
|
+
/** Per-action permission check (overrides resource-level actionPermissions) */
|
|
2047
|
+
readonly permissions?: PermissionCheck;
|
|
2048
|
+
/** JSON Schema for action-specific body fields */
|
|
2049
|
+
readonly schema?: Record<string, Record<string, unknown>>;
|
|
2050
|
+
/** Description for OpenAPI docs and MCP tool */
|
|
2051
|
+
readonly description?: string;
|
|
2052
|
+
/**
|
|
2053
|
+
* MCP tool generation:
|
|
2054
|
+
* - omitted/true: auto-generate
|
|
2055
|
+
* - false: skip
|
|
2056
|
+
* - object: explicit config
|
|
2057
|
+
*/
|
|
2058
|
+
readonly mcp?: boolean | RouteMcpConfig;
|
|
2059
|
+
}
|
|
2060
|
+
/** Action config: bare handler function OR full ActionDefinition */
|
|
2061
|
+
type ActionEntry = ActionHandlerFn | ActionDefinition;
|
|
2062
|
+
/** Actions configuration map */
|
|
2063
|
+
type ActionsMap = Record<string, ActionEntry>;
|
|
1923
2064
|
interface RouteSchemaOptions {
|
|
1924
2065
|
hiddenFields?: string[];
|
|
1925
2066
|
readonlyFields?: string[];
|
|
@@ -2612,4 +2753,4 @@ interface ValidationResult {
|
|
|
2612
2753
|
}
|
|
2613
2754
|
type AdapterFactory<TDoc> = (config: unknown) => DataAdapter<TDoc>;
|
|
2614
2755
|
//#endregion
|
|
2615
|
-
export {
|
|
2756
|
+
export { PresetFunction as $, QueryOptions as $t, EventsDecorator as A, BaseController as At, InferResourceDoc as B, FastifyHandler as Bt, ConfigError as C, defineHook as Cn, TypedResourceConfig as Ct, CrudRouterOptions as D, ValidationResult$1 as Dt, CrudRouteKey as E, ValidateOptions as Et, GracefulShutdownOptions as F, BodySanitizerConfig as Ft, LookupOption as G, RegisterOptions as Gt, IntrospectionPluginOptions as H, IControllerResponse as Ht, HealthCheck as I, AccessControl as It, ObjectId as J, defineResource as Jt, MiddlewareConfig as K, ResourceRegistry as Kt, HealthOptions as L, AccessControlConfig as Lt, FastifyWithAuth as M, QueryResolver as Mt, FastifyWithDecorators as N, QueryResolverConfig as Nt, CrudSchemas as O, envelope as Ot, FieldRule as P, BodySanitizer as Pt, PopulateOption as Q, PaginationParams as Qt, InferAdapterDoc as R, ControllerHandler as Rt, AuthenticatorContext as S, createHookSystem as Sn, TypedRepository as St, CrudController as T, UserOrganization as Tt, JWTPayload as U, IRequestContext as Ut, IntrospectionData as V, IController as Vt, JwtContext as W, RouteHandler as Wt, OwnershipCheck as X, InferDoc as Xt, OpenApiSchemas as Y, CrudRepository as Yt, ParsedQuery as Z, PaginatedResult as Zt, ArcInternalMetadata as _, afterDelete as _n, RouteMcpConfig as _t, RelationMetadata as a, PipelineContext as an, RegistryStats as at, AuthPluginOptions as b, beforeDelete as bn, TokenPair as bt, ValidationResult as c, DefineHookOptions as cn, RequestWithExtras as ct, ActionHandlerFn as d, HookOperation as dn, ResourceHookContext as dt, Guard as en, PresetHook as et, ActionsMap as f, HookPhase as fn, ResourceHooks as ft, ArcDecorator as g, afterCreate as gn, RouteHandlerMethod$1 as gt, ApiResponse as h, HookSystemOptions as hn, RouteDefinition as ht, FieldMetadata as i, PipelineConfig as in, RegistryEntry as it, FastifyRequestExtras as j, BaseControllerOptions as jt, EventDefinition as k, getUserId as kt, ActionDefinition as l, HookContext as ln, ResourceCacheConfig as lt, AnyRecord as m, HookSystem as mn, ResourcePermissions as mt, AdapterSchemaContext as n, NextFunction as nn, QueryParserInterface as nt, RepositoryLike as o, PipelineStep as on, RequestContext as ot, AdditionalRoute as p, HookRegistration as pn, ResourceMetadata as pt, MiddlewareHandler as q, ResourceDefinition as qt, DataAdapter as r, OperationFilter as rn, RateLimitConfig as rt, SchemaMetadata as s, Transform as sn, RequestIdOptions as st, AdapterFactory as t, Interceptor as tn, PresetResult as tt, ActionEntry as u, HookHandler as un, ResourceConfig as ut, ArcRequest as v, afterUpdate as vn, RouteSchemaOptions as vt, ControllerQueryOptions as w, UserLike as wt, Authenticator as x, beforeUpdate as xn, TypedController as xt, AuthHelpers as y, beforeCreate as yn, ServiceContext as yt, InferDocType as z, ControllerLike as zt };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as getUserRoles } from "./types-ZUu_h0jp.mjs";
|
|
2
|
-
import { n as convertRouteSchema } from "./schemaConverter-
|
|
2
|
+
import { n as convertRouteSchema } from "./schemaConverter-Y5EejTnJ.mjs";
|
|
3
3
|
import fp from "fastify-plugin";
|
|
4
4
|
//#region src/docs/openapi.ts
|
|
5
5
|
const openApiPlugin = async (fastify, opts = {}) => {
|
package/dist/org/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as UserBase } from "../types-
|
|
1
|
+
import { Wt as RouteHandler } from "../interface-IJqN3pXK.mjs";
|
|
2
|
+
import { i as UserBase } from "../types-BoaZHr-2.mjs";
|
|
3
3
|
import { InvitationAdapter, InvitationDoc, MemberDoc, OrgAdapter, OrgDoc, OrgPermissionStatement, OrgRole, OrganizationPluginOptions } from "./types.mjs";
|
|
4
4
|
import { FastifyPluginAsync, RouteHandlerMethod } from "fastify";
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as applyFieldWritePermissions, i as applyFieldReadPermissions, n as FieldPermissionMap, o as fields, r as FieldPermissionType, s as resolveEffectiveRoles, t as FieldPermission } from "../fields-
|
|
2
|
-
import { a as getUserRoles, i as UserBase, n as PermissionContext, o as normalizeRoles, r as PermissionResult, t as PermissionCheck } from "../types-
|
|
3
|
-
import { A as RoleHierarchy, C as authenticated, D as publicRead, E as presets_d_exports, M as applyPermissionResult, N as normalizePermissionResult, O as publicReadAdminWrite, S as adminOnly, T as ownerWithAdminBypass, _ as requireScopeContext, a as allOf, b as roles, c as createDynamicPermissionMatrix, d as requireAuth, f as requireOrgInScope, g as requireRoles, h as requireOwnership, i as PermissionEventBus, j as createRoleHierarchy, k as readOnly, l as createOrgPermissions, m as requireOrgRole, n as DynamicPermissionMatrix, o as allowPublic, p as requireOrgMembership, r as DynamicPermissionMatrixConfig, s as anyOf, t as ConnectEventsOptions, u as denyAll, v as requireServiceScope, w as fullPublic, x as when, y as requireTeamMembership } from "../index-
|
|
1
|
+
import { a as applyFieldWritePermissions, i as applyFieldReadPermissions, n as FieldPermissionMap, o as fields, r as FieldPermissionType, s as resolveEffectiveRoles, t as FieldPermission } from "../fields-DoeDgh2b.mjs";
|
|
2
|
+
import { a as getUserRoles, i as UserBase, n as PermissionContext, o as normalizeRoles, r as PermissionResult, t as PermissionCheck } from "../types-BoaZHr-2.mjs";
|
|
3
|
+
import { A as RoleHierarchy, C as authenticated, D as publicRead, E as presets_d_exports, M as applyPermissionResult, N as normalizePermissionResult, O as publicReadAdminWrite, S as adminOnly, T as ownerWithAdminBypass, _ as requireScopeContext, a as allOf, b as roles, c as createDynamicPermissionMatrix, d as requireAuth, f as requireOrgInScope, g as requireRoles, h as requireOwnership, i as PermissionEventBus, j as createRoleHierarchy, k as readOnly, l as createOrgPermissions, m as requireOrgRole, n as DynamicPermissionMatrix, o as allowPublic, p as requireOrgMembership, r as DynamicPermissionMatrixConfig, s as anyOf, t as ConnectEventsOptions, u as denyAll, v as requireServiceScope, w as fullPublic, x as when, y as requireTeamMembership } from "../index-CBru2y5Y.mjs";
|
|
4
4
|
export { ConnectEventsOptions, DynamicPermissionMatrix, DynamicPermissionMatrixConfig, FieldPermission, FieldPermissionMap, FieldPermissionType, PermissionCheck, PermissionContext, PermissionEventBus, PermissionResult, RoleHierarchy, UserBase, adminOnly, allOf, allowPublic, anyOf, applyFieldReadPermissions, applyFieldWritePermissions, applyPermissionResult, authenticated, createDynamicPermissionMatrix, createOrgPermissions, createRoleHierarchy, denyAll, fields, fullPublic, getUserRoles, normalizePermissionResult, normalizeRoles, ownerWithAdminBypass, presets_d_exports as permissions, publicRead, publicReadAdminWrite, readOnly, requireAuth, requireOrgInScope, requireOrgMembership, requireOrgRole, requireOwnership, requireRoles, requireScopeContext, requireServiceScope, requireTeamMembership, resolveEffectiveRoles, roles, when };
|
package/dist/plugins/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as ExternalOpenApiPaths } from "../externalPaths-
|
|
3
|
-
import { _ as cachingPlugin, a as versioningPlugin, c as MetricsOptions, d as SSEOptions, f as _default$6, g as _default$1, h as CachingRule, i as _default$7, l as _default$4, m as CachingOptions, n as errorHandlerPlugin, o as MetricEntry, p as ssePlugin, r as VersioningOptions, s as MetricsCollector, t as ErrorHandlerOptions, u as metricsPlugin } from "../errorHandler-
|
|
4
|
-
import { t as TracingOptions } from "../tracing-
|
|
1
|
+
import { K as MiddlewareConfig, Kt as ResourceRegistry, et as PresetHook, m as AnyRecord, mn as HookSystem, p as AdditionalRoute, vt as RouteSchemaOptions } from "../interface-IJqN3pXK.mjs";
|
|
2
|
+
import { t as ExternalOpenApiPaths } from "../externalPaths-BQ8QijNH.mjs";
|
|
3
|
+
import { _ as cachingPlugin, a as versioningPlugin, c as MetricsOptions, d as SSEOptions, f as _default$6, g as _default$1, h as CachingRule, i as _default$7, l as _default$4, m as CachingOptions, n as errorHandlerPlugin, o as MetricEntry, p as ssePlugin, r as VersioningOptions, s as MetricsCollector, t as ErrorHandlerOptions, u as metricsPlugin } from "../errorHandler-BeN-ERN7.mjs";
|
|
4
|
+
import { t as TracingOptions } from "../tracing-xqXzWeaf.mjs";
|
|
5
5
|
import { FastifyInstance, FastifyPluginAsync } from "fastify";
|
|
6
6
|
import * as _$node_stream0 from "node:stream";
|
|
7
7
|
|
package/dist/plugins/index.mjs
CHANGED
|
@@ -2,14 +2,14 @@ import { p as MUTATION_OPERATIONS } from "../constants-Cxde4rpC.mjs";
|
|
|
2
2
|
import { o as getOrgId } from "../types-AOD8fxIw.mjs";
|
|
3
3
|
import { t as requestContext } from "../requestContext-xHIKedG6.mjs";
|
|
4
4
|
import { t as hasEvents } from "../typeGuards-CcFZXgU7.mjs";
|
|
5
|
-
import { t as HookSystem } from "../HookSystem-
|
|
6
|
-
import { t as ResourceRegistry } from "../ResourceRegistry-
|
|
7
|
-
import { n as caching_default, t as cachingPlugin } from "../caching-
|
|
8
|
-
import { t as errorHandlerPlugin } from "../errorHandler-
|
|
9
|
-
import { n as metrics_default, t as metricsPlugin } from "../metrics-
|
|
10
|
-
import { t as replyHelpersPlugin } from "../replyHelpers-
|
|
11
|
-
import { n as sse_default, t as ssePlugin } from "../sse-
|
|
12
|
-
import { n as versioning_default, t as versioningPlugin } from "../versioning-
|
|
5
|
+
import { t as HookSystem } from "../HookSystem-BjFu7zf1.mjs";
|
|
6
|
+
import { t as ResourceRegistry } from "../ResourceRegistry-BOtJuRCs.mjs";
|
|
7
|
+
import { n as caching_default, t as cachingPlugin } from "../caching-CHH-iHs3.mjs";
|
|
8
|
+
import { t as errorHandlerPlugin } from "../errorHandler-BW08lEiy.mjs";
|
|
9
|
+
import { n as metrics_default, t as metricsPlugin } from "../metrics-DuhiSEZI.mjs";
|
|
10
|
+
import { t as replyHelpersPlugin } from "../replyHelpers-CXtJDAZ0.mjs";
|
|
11
|
+
import { n as sse_default, t as ssePlugin } from "../sse-CD5Hghpu.mjs";
|
|
12
|
+
import { n as versioning_default, t as versioningPlugin } from "../versioning-CPU_5Xfs.mjs";
|
|
13
13
|
import { randomUUID } from "node:crypto";
|
|
14
14
|
import fp from "fastify-plugin";
|
|
15
15
|
//#region src/core/arcCorePlugin.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as traced, i as isTracingAvailable, n as _default, r as createSpan, t as TracingOptions } from "../tracing-
|
|
1
|
+
import { a as traced, i as isTracingAvailable, n as _default, r as createSpan, t as TracingOptions } from "../tracing-xqXzWeaf.mjs";
|
|
2
2
|
export { type TracingOptions, createSpan, isTracingAvailable, traced, _default as tracingPlugin };
|
|
@@ -44,7 +44,7 @@ try {
|
|
|
44
44
|
function createTracerProvider(options) {
|
|
45
45
|
if (!isAvailable) return null;
|
|
46
46
|
const { serviceName = "@classytic/arc", serviceVersion, exporterUrl = "http://localhost:4318/v1/traces" } = options;
|
|
47
|
-
const resolvedVersion = serviceVersion ?? "2.
|
|
47
|
+
const resolvedVersion = serviceVersion ?? "2.8.0";
|
|
48
48
|
const exporter = new OTLPTraceExporter({ url: exporterUrl });
|
|
49
49
|
const provider = new NodeTracerProvider({ resource: { attributes: {
|
|
50
50
|
"service.name": serviceName,
|
package/dist/presets/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ht as IControllerResponse, Ut as IRequestContext, Zt as PaginatedResult, m as AnyRecord, tt as PresetResult, ut as ResourceConfig } from "../interface-IJqN3pXK.mjs";
|
|
2
2
|
import { MultiTenantOptions, TenantFieldSpec, multiTenantPreset } from "./multiTenant.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/presets/ownedByUser.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as EventTransport, n as EventHandler, r as EventLogger, t as DomainEvent } from "./EventTransport-
|
|
1
|
+
import { i as EventTransport, n as EventHandler, r as EventLogger, t as DomainEvent } from "./EventTransport-n1KBxC_N.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/events/transports/redis-stream.d.ts
|
|
4
4
|
interface RedisStreamLike {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Gt as RegisterOptions, H as IntrospectionPluginOptions, Kt as ResourceRegistry } from "../interface-IJqN3pXK.mjs";
|
|
2
2
|
import { FastifyPluginAsync } from "fastify";
|
|
3
3
|
|
|
4
4
|
//#region src/registry/introspectionPlugin.d.ts
|
package/dist/registry/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as introspectionPlugin_default, t as introspectionPlugin } from "../registry-
|
|
2
|
-
import { t as ResourceRegistry } from "../ResourceRegistry-
|
|
1
|
+
import { n as introspectionPlugin_default, t as introspectionPlugin } from "../registry-B0Wl7uVV.mjs";
|
|
2
|
+
import { t as ResourceRegistry } from "../ResourceRegistry-BOtJuRCs.mjs";
|
|
3
3
|
export { ResourceRegistry, introspectionPlugin_default as introspectionPlugin, introspectionPlugin as introspectionPluginFn };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as BaseController } from "./BaseController-CpMfCXdn.mjs";
|
|
2
2
|
import { n as normalizePermissionResult } from "./applyPermissionResult-D6GPMsvh.mjs";
|
|
3
|
-
import { t as pluralize } from "./pluralize-
|
|
3
|
+
import { t as pluralize } from "./pluralize-BneOJkpi.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/integrations/mcp/createMcpServer.ts
|
|
6
6
|
/**
|
package/dist/rpc/index.d.mts
CHANGED
|
@@ -34,10 +34,7 @@ function toJsonSchema(input) {
|
|
|
34
34
|
if (typeof input !== "object") return void 0;
|
|
35
35
|
if (isJsonSchema(input)) return input;
|
|
36
36
|
if (isZodSchema(input)) {
|
|
37
|
-
if (!_toJSONSchema)
|
|
38
|
-
console.warn("[Arc] Zod schema detected but zod is not installed. Install zod v4: npm install zod");
|
|
39
|
-
return input;
|
|
40
|
-
}
|
|
37
|
+
if (!_toJSONSchema) return input;
|
|
41
38
|
try {
|
|
42
39
|
return _toJSONSchema(input, { target: "openapi-3.0" });
|
|
43
40
|
} catch {
|
package/dist/scope/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as isAuthenticated, a as getClientId, b as isOrgInScope, c as getOrgRoles, d as getScopeContextMap, f as getServiceScopes, g as hasOrgAccess, h as getUserRoles, i as getAncestorOrgIds, l as getRequestScope, m as getUserId, n as PUBLIC_SCOPE, o as getOrgContext, p as getTeamId, r as RequestScope, s as getOrgId, t as AUTHENTICATED_SCOPE, u as getScopeContext, v as isElevated, x as isService, y as isMember } from "../types
|
|
2
|
-
import { i as elevationPlugin, n as ElevationOptions, r as _default, t as ElevationEvent } from "../elevation-
|
|
1
|
+
import { _ as isAuthenticated, a as getClientId, b as isOrgInScope, c as getOrgRoles, d as getScopeContextMap, f as getServiceScopes, g as hasOrgAccess, h as getUserRoles, i as getAncestorOrgIds, l as getRequestScope, m as getUserId, n as PUBLIC_SCOPE, o as getOrgContext, p as getTeamId, r as RequestScope, s as getOrgId, t as AUTHENTICATED_SCOPE, u as getScopeContext, v as isElevated, x as isService, y as isMember } from "../types-CN6JvmYz.mjs";
|
|
2
|
+
import { i as elevationPlugin, n as ElevationOptions, r as _default, t as ElevationEvent } from "../elevation-UJO3-NvX.mjs";
|
|
3
3
|
import { FastifyReply, FastifyRequest } from "fastify";
|
|
4
4
|
|
|
5
5
|
//#region src/scope/rateLimitKey.d.ts
|
package/dist/scope/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as isElevated, a as getOrgContext, b as isService, c as getRequestScope, d as getServiceScopes, f as getTeamId, g as isAuthenticated, h as hasOrgAccess, i as getClientId, l as getScopeContext, m as getUserRoles, n as PUBLIC_SCOPE, o as getOrgId, p as getUserId, r as getAncestorOrgIds, s as getOrgRoles, t as AUTHENTICATED_SCOPE, u as getScopeContextMap, v as isMember, y as isOrgInScope } from "../types-AOD8fxIw.mjs";
|
|
2
2
|
import { n as normalizeRoles } from "../types-ZUu_h0jp.mjs";
|
|
3
|
-
import { n as elevation_default, t as elevationPlugin } from "../elevation-
|
|
3
|
+
import { n as elevation_default, t as elevationPlugin } from "../elevation-BBGFjzIP.mjs";
|
|
4
4
|
//#region src/scope/rateLimitKey.ts
|
|
5
5
|
function createTenantKeyGenerator(opts) {
|
|
6
6
|
if (opts?.strategy) return opts.strategy;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-BpYLSNr0.mjs";
|
|
2
2
|
import { n as PUBLIC_SCOPE, o as getOrgId } from "./types-AOD8fxIw.mjs";
|
|
3
|
-
import { t as arcLog } from "./logger-
|
|
3
|
+
import { t as arcLog } from "./logger-CDjpjySd.mjs";
|
|
4
4
|
import fp from "fastify-plugin";
|
|
5
5
|
//#region src/plugins/sse.ts
|
|
6
6
|
var sse_exports = /* @__PURE__ */ __exportAll({
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as ResourceLike, r as CreateAppOptions } from "../types-
|
|
1
|
+
import { Yt as CrudRepository, m as AnyRecord, qt as ResourceDefinition } from "../interface-IJqN3pXK.mjs";
|
|
2
|
+
import { d as ResourceLike, r as CreateAppOptions } from "../types-gUxAIZHp.mjs";
|
|
3
3
|
import Fastify, { FastifyInstance, FastifyServerOptions } from "fastify";
|
|
4
4
|
import { Connection } from "mongoose";
|
|
5
5
|
import { Mock } from "vitest";
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1796,7 +1796,7 @@ function runEventTests(resourceName, displayName, events) {
|
|
|
1796
1796
|
* ```
|
|
1797
1797
|
*/
|
|
1798
1798
|
async function createTestApp(options = {}) {
|
|
1799
|
-
const { createApp } = await import("../createApp-
|
|
1799
|
+
const { createApp } = await import("../createApp-Cy8eUNKQ.mjs").then((n) => n.r);
|
|
1800
1800
|
const { useInMemoryDb = true, mongoUri: providedMongoUri, ...appOptions } = options;
|
|
1801
1801
|
const defaultAuth = {
|
|
1802
1802
|
type: "jwt",
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as isAuthenticated, c as getOrgRoles, g as hasOrgAccess, n as PUBLIC_SCOPE, p as getTeamId, r as RequestScope, s as getOrgId, t as AUTHENTICATED_SCOPE, v as isElevated, y as isMember } from "../types
|
|
2
|
-
import { $ as
|
|
3
|
-
import { i as UserBase, n as PermissionContext, r as PermissionResult, t as PermissionCheck } from "../types-
|
|
4
|
-
import { n as ElevationOptions, t as ElevationEvent } from "../elevation-
|
|
5
|
-
export { AUTHENTICATED_SCOPE, AdditionalRoute, AnyRecord, ApiResponse, ArcDecorator, ArcInternalMetadata, ArcRequest, AuthHelpers, AuthPluginOptions, Authenticator, AuthenticatorContext, BaseControllerOptions, ConfigError, ControllerHandler, ControllerLike, ControllerQueryOptions, CrudController, CrudRepository, CrudRouteKey, CrudRouterOptions, CrudSchemas, ElevationEvent, ElevationOptions, EventDefinition, EventsDecorator, FastifyHandler, FastifyRequestExtras, FastifyWithAuth, FastifyWithDecorators, FieldRule, GracefulShutdownOptions, HealthCheck, HealthOptions, IController, IControllerResponse, IRequestContext, InferAdapterDoc, InferDoc, InferDocType, InferResourceDoc, IntrospectionData, IntrospectionPluginOptions, JWTPayload, JwtContext, LookupOption, MiddlewareConfig, MiddlewareHandler, ObjectId, OpenApiSchemas, OwnershipCheck, PUBLIC_SCOPE, PaginatedResult, PaginationParams, ParsedQuery, PermissionCheck, PermissionContext, PermissionResult, PopulateOption, PresetFunction, PresetHook, PresetResult, QueryOptions, QueryParserInterface, RateLimitConfig, RegistryEntry, RegistryStats, RequestContext, RequestIdOptions, RequestScope, RequestWithExtras, ResourceCacheConfig, ResourceConfig, ResourceHookContext, ResourceHooks, ResourceMetadata, ResourcePermissions, RouteHandler, RouteHandlerMethod, RouteSchemaOptions, ServiceContext, TokenPair, TypedController, TypedRepository, TypedResourceConfig, UserBase, UserLike, UserOrganization, ValidateOptions, ValidationResult, envelope, getOrgId, getOrgRoles, getTeamId, getUserId, hasOrgAccess, isAuthenticated, isElevated, isMember };
|
|
1
|
+
import { _ as isAuthenticated, c as getOrgRoles, g as hasOrgAccess, n as PUBLIC_SCOPE, p as getTeamId, r as RequestScope, s as getOrgId, t as AUTHENTICATED_SCOPE, v as isElevated, y as isMember } from "../types-CN6JvmYz.mjs";
|
|
2
|
+
import { $ as PresetFunction, $t as QueryOptions, A as EventsDecorator, B as InferResourceDoc, Bt as FastifyHandler, C as ConfigError, Ct as TypedResourceConfig, D as CrudRouterOptions, Dt as ValidationResult, E as CrudRouteKey, Et as ValidateOptions, F as GracefulShutdownOptions, G as LookupOption, H as IntrospectionPluginOptions, Ht as IControllerResponse, I as HealthCheck, J as ObjectId, K as MiddlewareConfig, L as HealthOptions, M as FastifyWithAuth, N as FastifyWithDecorators, O as CrudSchemas, Ot as envelope, P as FieldRule, Q as PopulateOption, Qt as PaginationParams, R as InferAdapterDoc, Rt as ControllerHandler, S as AuthenticatorContext, St as TypedRepository, T as CrudController, Tt as UserOrganization, U as JWTPayload, Ut as IRequestContext, V as IntrospectionData, Vt as IController, W as JwtContext, Wt as RouteHandler, X as OwnershipCheck, Xt as InferDoc, Y as OpenApiSchemas, Yt as CrudRepository, Z as ParsedQuery, Zt as PaginatedResult, _ as ArcInternalMetadata, _t as RouteMcpConfig, at as RegistryStats, b as AuthPluginOptions, bt as TokenPair, ct as RequestWithExtras, d as ActionHandlerFn, dt as ResourceHookContext, et as PresetHook, f as ActionsMap, ft as ResourceHooks, g as ArcDecorator, gt as RouteHandlerMethod, h as ApiResponse, ht as RouteDefinition, it as RegistryEntry, j as FastifyRequestExtras, jt as BaseControllerOptions, k as EventDefinition, kt as getUserId, l as ActionDefinition, lt as ResourceCacheConfig, m as AnyRecord, mt as ResourcePermissions, nt as QueryParserInterface, ot as RequestContext, p as AdditionalRoute, pt as ResourceMetadata, q as MiddlewareHandler, rt as RateLimitConfig, st as RequestIdOptions, tt as PresetResult, u as ActionEntry, ut as ResourceConfig, v as ArcRequest, vt as RouteSchemaOptions, w as ControllerQueryOptions, wt as UserLike, x as Authenticator, xt as TypedController, y as AuthHelpers, yt as ServiceContext, z as InferDocType, zt as ControllerLike } from "../interface-IJqN3pXK.mjs";
|
|
3
|
+
import { i as UserBase, n as PermissionContext, r as PermissionResult, t as PermissionCheck } from "../types-BoaZHr-2.mjs";
|
|
4
|
+
import { n as ElevationOptions, t as ElevationEvent } from "../elevation-UJO3-NvX.mjs";
|
|
5
|
+
export { AUTHENTICATED_SCOPE, ActionDefinition, ActionEntry, ActionHandlerFn, ActionsMap, AdditionalRoute, AnyRecord, ApiResponse, ArcDecorator, ArcInternalMetadata, ArcRequest, AuthHelpers, AuthPluginOptions, Authenticator, AuthenticatorContext, BaseControllerOptions, ConfigError, ControllerHandler, ControllerLike, ControllerQueryOptions, CrudController, CrudRepository, CrudRouteKey, CrudRouterOptions, CrudSchemas, ElevationEvent, ElevationOptions, EventDefinition, EventsDecorator, FastifyHandler, FastifyRequestExtras, FastifyWithAuth, FastifyWithDecorators, FieldRule, GracefulShutdownOptions, HealthCheck, HealthOptions, IController, IControllerResponse, IRequestContext, InferAdapterDoc, InferDoc, InferDocType, InferResourceDoc, IntrospectionData, IntrospectionPluginOptions, JWTPayload, JwtContext, LookupOption, MiddlewareConfig, MiddlewareHandler, ObjectId, OpenApiSchemas, OwnershipCheck, PUBLIC_SCOPE, PaginatedResult, PaginationParams, ParsedQuery, PermissionCheck, PermissionContext, PermissionResult, PopulateOption, PresetFunction, PresetHook, PresetResult, QueryOptions, QueryParserInterface, RateLimitConfig, RegistryEntry, RegistryStats, RequestContext, RequestIdOptions, RequestScope, RequestWithExtras, ResourceCacheConfig, ResourceConfig, ResourceHookContext, ResourceHooks, ResourceMetadata, ResourcePermissions, RouteDefinition, RouteHandler, RouteHandlerMethod, RouteMcpConfig, RouteSchemaOptions, ServiceContext, TokenPair, TypedController, TypedRepository, TypedResourceConfig, UserBase, UserLike, UserOrganization, ValidateOptions, ValidationResult, envelope, getOrgId, getOrgRoles, getTeamId, getUserId, hasOrgAccess, isAuthenticated, isElevated, isMember };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as ElevationOptions } from "./elevation-
|
|
3
|
-
import { t as ExternalOpenApiPaths } from "./externalPaths-
|
|
4
|
-
import { i as CacheStore } from "./interface-
|
|
5
|
-
import { r as QueryCachePluginOptions } from "./queryCachePlugin-
|
|
6
|
-
import { i as EventTransport } from "./EventTransport-
|
|
7
|
-
import { t as EventPluginOptions } from "./eventPlugin-
|
|
8
|
-
import { c as MetricsOptions, d as SSEOptions, m as CachingOptions, r as VersioningOptions, t as ErrorHandlerOptions } from "./errorHandler-
|
|
9
|
-
import { r as IdempotencyStore } from "./interface-
|
|
1
|
+
import { x as Authenticator } from "./interface-IJqN3pXK.mjs";
|
|
2
|
+
import { n as ElevationOptions } from "./elevation-UJO3-NvX.mjs";
|
|
3
|
+
import { t as ExternalOpenApiPaths } from "./externalPaths-BQ8QijNH.mjs";
|
|
4
|
+
import { i as CacheStore } from "./interface-bpoLKKqx.mjs";
|
|
5
|
+
import { r as QueryCachePluginOptions } from "./queryCachePlugin-BCFVXnxK.mjs";
|
|
6
|
+
import { i as EventTransport } from "./EventTransport-n1KBxC_N.mjs";
|
|
7
|
+
import { t as EventPluginOptions } from "./eventPlugin-CAOWMQS8.mjs";
|
|
8
|
+
import { c as MetricsOptions, d as SSEOptions, m as CachingOptions, r as VersioningOptions, t as ErrorHandlerOptions } from "./errorHandler-BeN-ERN7.mjs";
|
|
9
|
+
import { r as IdempotencyStore } from "./interface-CkkWm5uR.mjs";
|
|
10
10
|
import { FastifyInstance, FastifyPluginAsync, FastifyReply, FastifyRequest, FastifyServerOptions } from "fastify";
|
|
11
11
|
|
|
12
12
|
//#region src/factory/loadResources.d.ts
|
|
@@ -107,6 +107,10 @@ interface LoadResourcesOptions {
|
|
|
107
107
|
* @default false
|
|
108
108
|
*/
|
|
109
109
|
silent?: boolean;
|
|
110
|
+
/** Optional logger for diagnostics. No output when omitted (silent by default). */
|
|
111
|
+
logger?: {
|
|
112
|
+
warn: (msg: string) => void;
|
|
113
|
+
};
|
|
110
114
|
}
|
|
111
115
|
/**
|
|
112
116
|
* Scan a directory for resource files and import their default exports.
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as NotFoundError, c as RateLimitError, d as ValidationError, i as ForbiddenError, l as ServiceUnavailableError, m as isArcError, n as ConflictError, o as OrgAccessDeniedError, p as createError, r as ErrorDetails, s as OrgRequiredError, t as ArcError, u as UnauthorizedError } from "../errors-
|
|
3
|
-
import { a as CircuitBreakerStats, c as createCircuitBreakerRegistry, i as CircuitBreakerRegistry, n as CircuitBreakerError, o as CircuitState, r as CircuitBreakerOptions, s as createCircuitBreaker, t as CircuitBreaker } from "../circuitBreaker-
|
|
1
|
+
import { Y as OpenApiSchemas, Z as ParsedQuery, m as AnyRecord, nt as QueryParserInterface } from "../interface-IJqN3pXK.mjs";
|
|
2
|
+
import { a as NotFoundError, c as RateLimitError, d as ValidationError, i as ForbiddenError, l as ServiceUnavailableError, m as isArcError, n as ConflictError, o as OrgAccessDeniedError, p as createError, r as ErrorDetails, s as OrgRequiredError, t as ArcError, u as UnauthorizedError } from "../errors-BI8kEKsO.mjs";
|
|
3
|
+
import { a as CircuitBreakerStats, c as createCircuitBreakerRegistry, i as CircuitBreakerRegistry, n as CircuitBreakerError, o as CircuitState, r as CircuitBreakerOptions, s as createCircuitBreaker, t as CircuitBreaker } from "../circuitBreaker-BGVoB1hD.mjs";
|
|
4
4
|
import { FastifyInstance } from "fastify";
|
|
5
5
|
|
|
6
6
|
//#region src/utils/compensation.d.ts
|
package/dist/utils/index.mjs
CHANGED
|
@@ -2,6 +2,6 @@ import { n as createQueryParser, t as ArcQueryParser } from "../queryParser-CgCt
|
|
|
2
2
|
import { a as createCircuitBreaker, i as CircuitState, n as CircuitBreakerError, o as createCircuitBreakerRegistry, r as CircuitBreakerRegistry, t as CircuitBreaker } from "../circuitBreaker-l18oRgL5.mjs";
|
|
3
3
|
import { _ as defineCompensation, a as getListQueryParams, c as listResponse, d as paginateWrapper, f as paginationSchema, g as wrapResponse, h as successResponseSchema, i as getDefaultCrudSchemas, l as messageWrapper, m as responses, n as deleteResponse, o as itemResponse, p as queryParams, r as errorResponseSchema, s as itemWrapper, t as createStateMachine, u as mutationResponse, v as withCompensation } from "../utils-B-l6410F.mjs";
|
|
4
4
|
import { a as OrgAccessDeniedError, c as ServiceUnavailableError, f as createError, i as NotFoundError, l as UnauthorizedError, n as ConflictError, o as OrgRequiredError, p as isArcError, r as ForbiddenError, s as RateLimitError, t as ArcError, u as ValidationError } from "../errors-Cg58SLNi.mjs";
|
|
5
|
-
import { a as toJsonSchema, i as isZodSchema, n as convertRouteSchema, r as isJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-
|
|
5
|
+
import { a as toJsonSchema, i as isZodSchema, n as convertRouteSchema, r as isJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-Y5EejTnJ.mjs";
|
|
6
6
|
import { t as hasEvents } from "../typeGuards-CcFZXgU7.mjs";
|
|
7
7
|
export { ArcError, ArcQueryParser, CircuitBreaker, CircuitBreakerError, CircuitBreakerRegistry, CircuitState, ConflictError, ForbiddenError, NotFoundError, OrgAccessDeniedError, OrgRequiredError, RateLimitError, ServiceUnavailableError, UnauthorizedError, ValidationError, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createError, createQueryParser, createStateMachine, defineCompensation, deleteResponse, errorResponseSchema, getDefaultCrudSchemas, getListQueryParams, hasEvents, isArcError, isJsonSchema, isZodSchema, itemResponse, itemWrapper, listResponse, messageWrapper, mutationResponse, paginateWrapper, paginationSchema, queryParams, responses, successResponseSchema, toJsonSchema, withCompensation, wrapResponse };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classytic/arc",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "Resource-oriented backend framework for Fastify — clean, minimal, powerful, tree-shakable",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -221,14 +221,14 @@
|
|
|
221
221
|
"test:e2e": "vitest run tests/e2e",
|
|
222
222
|
"test:unit": "vitest run tests/core tests/hooks tests/utils tests/plugins",
|
|
223
223
|
"smoke": "node scripts/smoke-test.mjs",
|
|
224
|
-
"prepublishOnly": "npm run typecheck && npm run
|
|
224
|
+
"prepublishOnly": "npm run typecheck && npm run lint && npm run build && npm run test:ci && npm run smoke"
|
|
225
225
|
},
|
|
226
226
|
"engines": {
|
|
227
227
|
"node": ">=22"
|
|
228
228
|
},
|
|
229
229
|
"peerDependencies": {
|
|
230
|
-
"@classytic/mongokit": ">=3.5.
|
|
231
|
-
"@classytic/streamline": ">=2.
|
|
230
|
+
"@classytic/mongokit": ">=3.5.6",
|
|
231
|
+
"@classytic/streamline": ">=2.1.0",
|
|
232
232
|
"@fastify/cors": ">=11.0.0",
|
|
233
233
|
"@fastify/helmet": ">=13.0.0",
|
|
234
234
|
"@fastify/jwt": ">=10.0.0",
|
|
@@ -245,12 +245,12 @@
|
|
|
245
245
|
"@opentelemetry/instrumentation-mongodb": ">=0.40.0",
|
|
246
246
|
"@opentelemetry/sdk-node": ">=0.50.0",
|
|
247
247
|
"@sinclair/typebox": ">=0.34.0",
|
|
248
|
-
"better-auth": ">=1.6.
|
|
248
|
+
"better-auth": ">=1.6.2",
|
|
249
249
|
"bullmq": ">=5.0.0",
|
|
250
250
|
"fastify": ">=5.0.0",
|
|
251
251
|
"fastify-raw-body": ">=5.0.0",
|
|
252
252
|
"ioredis": ">=5.0.0",
|
|
253
|
-
"mongodb": ">=
|
|
253
|
+
"mongodb": ">=7.0.0",
|
|
254
254
|
"mongoose": ">=9.4.1",
|
|
255
255
|
"pino-pretty": ">=13.0.0",
|
|
256
256
|
"zod": ">=4.0.0"
|
|
@@ -346,7 +346,8 @@
|
|
|
346
346
|
"devDependencies": {
|
|
347
347
|
"@better-auth/mongo-adapter": "^1.6.0",
|
|
348
348
|
"@biomejs/biome": "^2.4.10",
|
|
349
|
-
"@classytic/mongokit": "
|
|
349
|
+
"@classytic/mongokit": "3.5.6",
|
|
350
|
+
"@classytic/streamline": "^2.1.0",
|
|
350
351
|
"@fastify/cors": "^11.2.0",
|
|
351
352
|
"@fastify/helmet": "^13.0.2",
|
|
352
353
|
"@fastify/jwt": "^10.0.0",
|