@classytic/arc 2.4.2 → 2.6.1

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.
Files changed (104) hide show
  1. package/README.md +22 -6
  2. package/dist/{BaseController-CkM5dUh_.mjs → BaseController-AbbRx3e0.mjs} +5 -2
  3. package/dist/adapters/index.d.mts +2 -2
  4. package/dist/adapters/index.mjs +1 -1
  5. package/dist/{adapters-DTC4Ug66.mjs → adapters-CTn28N4y.mjs} +72 -11
  6. package/dist/audit/index.d.mts +1 -1
  7. package/dist/audit/index.mjs +11 -1
  8. package/dist/audit/mongodb.d.mts +1 -1
  9. package/dist/auth/index.d.mts +1 -1
  10. package/dist/auth/index.mjs +2 -2
  11. package/dist/cache/index.mjs +2 -2
  12. package/dist/cli/commands/describe.d.mts +1 -1
  13. package/dist/cli/commands/describe.mjs +1 -1
  14. package/dist/cli/commands/generate.d.mts +1 -1
  15. package/dist/cli/commands/generate.mjs +1 -1
  16. package/dist/cli/commands/init.d.mts +1 -1
  17. package/dist/cli/commands/init.mjs +13 -10
  18. package/dist/cli/commands/introspect.d.mts +1 -1
  19. package/dist/cli/commands/introspect.mjs +1 -1
  20. package/dist/cli/index.d.mts +4 -4
  21. package/dist/cli/index.mjs +4 -4
  22. package/dist/core/index.d.mts +2 -2
  23. package/dist/core/index.mjs +2 -2
  24. package/dist/{createApp-ByWNRsZj.mjs → createApp-Bol7DLUf.mjs} +404 -279
  25. package/dist/{defineResource-D9aY5Cy6.mjs → defineResource-bVKHjQzE.mjs} +116 -19
  26. package/dist/discovery/index.d.mts +1 -1
  27. package/dist/discovery/index.mjs +2 -2
  28. package/dist/docs/index.d.mts +1 -1
  29. package/dist/dynamic/index.d.mts +1 -1
  30. package/dist/dynamic/index.mjs +2 -2
  31. package/dist/{elevation-Ca_yveIO.d.mts → elevation-C_taLQrM.d.mts} +27 -1
  32. package/dist/{errorHandler--zp54tGc.mjs → errorHandler-r2595m8T.mjs} +5 -5
  33. package/dist/{errors-CPpvPHT0.d.mts → errors-CcVbl1-T.d.mts} +17 -1
  34. package/dist/{errors-rxhfP7Hf.mjs → errors-NoQKsbAT.mjs} +23 -1
  35. package/dist/{eventPlugin-iGrSEmwJ.d.mts → eventPlugin-DW45v4V5.d.mts} +30 -2
  36. package/dist/events/index.d.mts +2 -2
  37. package/dist/events/index.mjs +40 -10
  38. package/dist/events/transports/redis.d.mts +1 -1
  39. package/dist/events/transports/redis.mjs +1 -1
  40. package/dist/factory/index.d.mts +44 -23
  41. package/dist/factory/index.mjs +136 -2
  42. package/dist/hooks/index.d.mts +1 -1
  43. package/dist/idempotency/index.d.mts +3 -3
  44. package/dist/idempotency/mongodb.d.mts +1 -1
  45. package/dist/idempotency/redis.d.mts +1 -1
  46. package/dist/{index-yhxyjqNb.d.mts → index-BIsZ_su5.d.mts} +4 -8
  47. package/dist/{index-BL8CaQih.d.mts → index-Cb3gtbg7.d.mts} +2 -2
  48. package/dist/{index-Diqcm14c.d.mts → index-NGZksqM5.d.mts} +30 -1
  49. package/dist/index.d.mts +6 -6
  50. package/dist/index.mjs +8 -7
  51. package/dist/integrations/event-gateway.d.mts +1 -1
  52. package/dist/integrations/event-gateway.mjs +2 -2
  53. package/dist/integrations/index.d.mts +1 -1
  54. package/dist/integrations/jobs.d.mts +1 -1
  55. package/dist/integrations/jobs.mjs +1 -1
  56. package/dist/integrations/mcp/index.d.mts +4 -2
  57. package/dist/integrations/mcp/index.mjs +1 -1
  58. package/dist/integrations/mcp/testing.d.mts +1 -1
  59. package/dist/integrations/mcp/testing.mjs +1 -1
  60. package/dist/integrations/streamline.d.mts +1 -1
  61. package/dist/integrations/streamline.mjs +1 -1
  62. package/dist/integrations/websocket-redis.d.mts +1 -1
  63. package/dist/integrations/websocket-redis.mjs +1 -1
  64. package/dist/integrations/websocket.d.mts +1 -1
  65. package/dist/integrations/websocket.mjs +1 -1
  66. package/dist/{interface-DGmPxakH.d.mts → interface-DDW43OmS.d.mts} +194 -13
  67. package/dist/{memory-Cb_7iy9e.mjs → memory-BFAYkf8H.mjs} +1 -4
  68. package/dist/{mongodb-CUpYfxfD.d.mts → mongodb-kltrBPa1.d.mts} +10 -0
  69. package/dist/{mongodb-bga9AbkD.d.mts → mongodb-pMvOlR5_.d.mts} +1 -1
  70. package/dist/org/index.d.mts +1 -1
  71. package/dist/org/index.mjs +1 -1
  72. package/dist/permissions/index.d.mts +2 -2
  73. package/dist/permissions/index.mjs +2 -2
  74. package/dist/{permissions-CA5zg0yK.mjs → permissions-C8ImI8gC.mjs} +45 -3
  75. package/dist/plugins/index.d.mts +1 -1
  76. package/dist/plugins/index.mjs +3 -3
  77. package/dist/plugins/response-cache.d.mts +1 -1
  78. package/dist/plugins/response-cache.mjs +1 -1
  79. package/dist/plugins/tracing-entry.mjs +1 -1
  80. package/dist/presets/index.d.mts +2 -2
  81. package/dist/presets/index.mjs +2 -2
  82. package/dist/presets/multiTenant.d.mts +2 -2
  83. package/dist/presets/multiTenant.mjs +2 -2
  84. package/dist/{presets-C9QXJV1u.mjs → presets-BMfdy34e.mjs} +3 -3
  85. package/dist/{queryCachePlugin-ClosZdNS.mjs → queryCachePlugin-XtFplYO9.mjs} +1 -1
  86. package/dist/{redis-CQ5YxMC5.d.mts → redis-D0Qc-9EW.d.mts} +1 -1
  87. package/dist/registry/index.d.mts +1 -1
  88. package/dist/{resourceToTools-PMFE8HIv.mjs → resourceToTools-DH3c3e-T.mjs} +81 -7
  89. package/dist/scope/index.d.mts +2 -2
  90. package/dist/scope/index.mjs +2 -2
  91. package/dist/{sse-BkViJPlT.mjs → sse-BF7GR7IB.mjs} +1 -1
  92. package/dist/testing/index.d.mts +2 -2
  93. package/dist/testing/index.mjs +1 -1
  94. package/dist/types/index.d.mts +3 -3
  95. package/dist/types/index.mjs +23 -2
  96. package/dist/{types-C6TQjtdi.mjs → types-BhtYdxZU.mjs} +26 -1
  97. package/dist/{types-Dt0-AI6E.d.mts → types-D5hJ-k_3.d.mts} +189 -6
  98. package/dist/{types-BJmgxNbF.d.mts → types-D5rjsS_i.d.mts} +1 -1
  99. package/dist/utils/index.d.mts +2 -2
  100. package/dist/utils/index.mjs +1 -1
  101. package/package.json +7 -5
  102. package/skills/arc/SKILL.md +115 -8
  103. package/skills/arc/references/mcp.md +160 -2
  104. /package/dist/{interface-B4awm1RJ.d.mts → interface-gr-7qo9j.d.mts} +0 -0
@@ -1,4 +1,4 @@
1
- import { s as RequestScope } from "./elevation-Ca_yveIO.mjs";
1
+ import { s as RequestScope } from "./elevation-C_taLQrM.mjs";
2
2
  import { n as FieldPermissionMap } from "./fields-DFwdaWCq.mjs";
3
3
  import { i as UserBase, t as PermissionCheck } from "./types-BNUccdcf.mjs";
4
4
  import { FastifyInstance, FastifyPluginAsync, FastifyReply, FastifyRequest, RouteHandlerMethod, RouteHandlerMethod as RouteHandlerMethod$1 } from "fastify";
@@ -474,6 +474,7 @@ declare class ResourceDefinition<TDoc = AnyRecord> {
474
474
  readonly pipe?: PipelineConfig;
475
475
  readonly fields?: FieldPermissionMap;
476
476
  readonly cache?: ResourceCacheConfig;
477
+ readonly skipGlobalPrefix: boolean;
477
478
  readonly tenantField?: string | false;
478
479
  readonly idField?: string;
479
480
  readonly queryParser?: QueryParserInterface;
@@ -1073,6 +1074,46 @@ declare module 'fastify' {
1073
1074
  _ownershipCheck?: Record<string, unknown>;
1074
1075
  }
1075
1076
  }
1077
+ /**
1078
+ * Typed Fastify request with Arc decorations.
1079
+ *
1080
+ * Use this in `wrapHandler: false` handlers instead of `(req as any).user`.
1081
+ *
1082
+ * @example
1083
+ * ```typescript
1084
+ * import type { ArcRequest } from '@classytic/arc';
1085
+ *
1086
+ * handler: async (req: ArcRequest, reply: FastifyReply) => {
1087
+ * req.user?.id; // typed
1088
+ * req.scope.organizationId; // typed (when member)
1089
+ * req.signal; // AbortSignal (Fastify 5)
1090
+ * }
1091
+ * ```
1092
+ */
1093
+ type ArcRequest = FastifyRequest & {
1094
+ scope: RequestScope;
1095
+ user: Record<string, unknown> | undefined;
1096
+ signal: AbortSignal;
1097
+ };
1098
+ /**
1099
+ * Response envelope helper — wraps data in Arc's standard `{ success, data }` format.
1100
+ *
1101
+ * @example
1102
+ * ```typescript
1103
+ * import { envelope } from '@classytic/arc';
1104
+ *
1105
+ * handler: async (req, reply) => {
1106
+ * const data = await getResults();
1107
+ * return envelope(data);
1108
+ * // → { success: true, data }
1109
+ * }
1110
+ * ```
1111
+ */
1112
+ declare function envelope<T>(data: T, meta?: Record<string, unknown>): {
1113
+ success: true;
1114
+ data: T;
1115
+ [key: string]: unknown;
1116
+ };
1076
1117
  type AnyRecord = Record<string, unknown>;
1077
1118
  /** MongoDB ObjectId — accepts string or any object with a `toString()` (e.g. mongoose ObjectId). */
1078
1119
  type ObjectId = string | {
@@ -1188,8 +1229,8 @@ interface LookupOption {
1188
1229
  as?: string;
1189
1230
  /** Return a single object instead of array (default: false) */
1190
1231
  single?: boolean;
1191
- /** Field selection on the joined collection (comma-separated) */
1192
- select?: string;
1232
+ /** Field selection on the joined collection (comma-separated string or projection object) */
1233
+ select?: string | Record<string, 0 | 1>;
1193
1234
  }
1194
1235
  /**
1195
1236
  * Mongoose-compatible populate option for advanced field selection
@@ -1412,6 +1453,18 @@ interface ResourceConfig<TDoc = AnyRecord> {
1412
1453
  displayName?: string;
1413
1454
  tag?: string;
1414
1455
  prefix?: string;
1456
+ /**
1457
+ * Skip the global `resourcePrefix` from `createApp()`.
1458
+ * The resource registers at its own `prefix` (or `/${name}s`) directly on root.
1459
+ * Useful for webhooks, health, admin routes that shouldn't be under `/api/v1`.
1460
+ *
1461
+ * @example
1462
+ * ```typescript
1463
+ * defineResource({ name: 'webhook', prefix: '/webhooks', skipGlobalPrefix: true })
1464
+ * // Registers at /webhooks even when createApp({ resourcePrefix: '/api/v1' })
1465
+ * ```
1466
+ */
1467
+ skipGlobalPrefix?: boolean;
1415
1468
  adapter?: DataAdapter<TDoc>;
1416
1469
  /** Controller instance - accepts any object with CRUD methods */
1417
1470
  controller?: IController<TDoc> | ControllerLike;
@@ -1475,6 +1528,22 @@ interface ResourceConfig<TDoc = AnyRecord> {
1475
1528
  skipValidation?: boolean;
1476
1529
  skipRegistry?: boolean;
1477
1530
  _appliedPresets?: string[];
1531
+ /**
1532
+ * Called during plugin registration with the scoped Fastify instance.
1533
+ * Use for wiring singletons, reading decorators, or setting up resource-specific
1534
+ * services that need access to the Fastify instance.
1535
+ *
1536
+ * @example
1537
+ * ```typescript
1538
+ * defineResource({
1539
+ * name: 'notification',
1540
+ * onRegister: (fastify) => {
1541
+ * setSseManager(fastify.sseManager);
1542
+ * },
1543
+ * })
1544
+ * ```
1545
+ */
1546
+ onRegister?: (fastify: FastifyInstance) => void | Promise<void>;
1478
1547
  /** HTTP method for update routes. Default: 'PATCH' */
1479
1548
  updateMethod?: 'PUT' | 'PATCH' | 'both';
1480
1549
  /**
@@ -1501,13 +1570,53 @@ interface ResourcePermissions {
1501
1570
  update?: PermissionCheck;
1502
1571
  delete?: PermissionCheck;
1503
1572
  }
1573
+ /**
1574
+ * Hook context passed to resource-level hook handlers.
1575
+ * Mirrors HookSystem's HookContext but with a simpler API for inline use.
1576
+ */
1577
+ interface ResourceHookContext {
1578
+ /** The document data (create/update body, or existing doc for delete) */
1579
+ data: AnyRecord;
1580
+ /** Authenticated user or null */
1581
+ user?: UserBase;
1582
+ /** Additional metadata (e.g. `{ id, existing }` for update/delete) */
1583
+ meta?: AnyRecord;
1584
+ }
1585
+ /**
1586
+ * Inline lifecycle hooks on a resource definition.
1587
+ * These are wired into the HookSystem automatically — same pipeline as presets and app-level hooks.
1588
+ *
1589
+ * @example
1590
+ * ```typescript
1591
+ * defineResource({
1592
+ * name: 'chat',
1593
+ * hooks: {
1594
+ * afterCreate: async (ctx) => {
1595
+ * analytics.track('chat.created', { chatId: ctx.data._id, userId: ctx.user?.id });
1596
+ * },
1597
+ * beforeDelete: async (ctx) => {
1598
+ * if (ctx.data.isProtected) throw new Error('Cannot delete protected chat');
1599
+ * },
1600
+ * afterDelete: async (ctx) => {
1601
+ * await notificationService.send('chat.deleted', { id: ctx.meta?.id });
1602
+ * },
1603
+ * },
1604
+ * });
1605
+ * ```
1606
+ */
1504
1607
  interface ResourceHooks {
1505
- beforeCreate?: (data: AnyRecord) => Promise<AnyRecord> | AnyRecord;
1506
- afterCreate?: (doc: AnyRecord) => Promise<void> | void;
1507
- beforeUpdate?: (id: string, data: AnyRecord) => Promise<AnyRecord> | AnyRecord;
1508
- afterUpdate?: (doc: AnyRecord) => Promise<void> | void;
1509
- beforeDelete?: (id: string) => Promise<void> | void;
1510
- afterDelete?: (id: string) => Promise<void> | void;
1608
+ /** Runs before create — can modify data by returning a new object */
1609
+ beforeCreate?: (ctx: ResourceHookContext) => Promise<AnyRecord | void> | AnyRecord | void;
1610
+ /** Runs after create receives the created document */
1611
+ afterCreate?: (ctx: ResourceHookContext) => Promise<void> | void;
1612
+ /** Runs before update — ctx.meta.id has the resource ID, ctx.meta.existing has the current doc */
1613
+ beforeUpdate?: (ctx: ResourceHookContext) => Promise<AnyRecord | void> | AnyRecord | void;
1614
+ /** Runs after update — receives the updated document */
1615
+ afterUpdate?: (ctx: ResourceHookContext) => Promise<void> | void;
1616
+ /** Runs before delete — ctx.data is the existing doc, ctx.meta.id has the resource ID */
1617
+ beforeDelete?: (ctx: ResourceHookContext) => Promise<void> | void;
1618
+ /** Runs after delete — ctx.data is the deleted doc, ctx.meta.id has the resource ID */
1619
+ afterDelete?: (ctx: ResourceHookContext) => Promise<void> | void;
1511
1620
  }
1512
1621
  /**
1513
1622
  * Additional route definition for custom endpoints
@@ -1518,10 +1627,16 @@ interface AdditionalRoute {
1518
1627
  /** Route path (relative to resource prefix) */
1519
1628
  path: string;
1520
1629
  /**
1521
- * Handler - string (controller method name) or function
1522
- * Function can be Fastify handler or (request, reply) => Promise<unknown>
1630
+ * Handler - string (controller method name) or function.
1631
+ *
1632
+ * When `wrapHandler: true`:
1633
+ * - `string` — calls controller method by name (e.g., `'approve'`)
1634
+ * - `ControllerHandler` — receives `IRequestContext`, returns `IControllerResponse`
1635
+ *
1636
+ * When `wrapHandler: false`:
1637
+ * - Fastify handler `(request, reply) => unknown`
1523
1638
  */
1524
- handler: string | RouteHandlerMethod | ((request: FastifyRequest<any>, reply: FastifyReply) => unknown);
1639
+ handler: string | ControllerHandler | RouteHandlerMethod | ((request: FastifyRequest<any>, reply: FastifyReply) => unknown);
1525
1640
  /** Permission check - REQUIRED */
1526
1641
  permissions: PermissionCheck;
1527
1642
  /**
@@ -1556,6 +1671,41 @@ interface AdditionalRoute {
1556
1671
  * preHandler: (fastify) => [fastify.customerContext({ required: true })]
1557
1672
  */
1558
1673
  preHandler?: RouteHandlerMethod[] | ((fastify: FastifyInstance) => RouteHandlerMethod[]);
1674
+ /**
1675
+ * Pre-auth handlers — run BEFORE authentication middleware.
1676
+ * Use for promoting query params to headers (e.g., EventSource ?token= → Authorization).
1677
+ *
1678
+ * @example
1679
+ * ```typescript
1680
+ * preAuth: [(req) => {
1681
+ * const token = (req.query as Record<string, string>)?.token;
1682
+ * if (token) req.headers.authorization = `Bearer ${token}`;
1683
+ * }]
1684
+ * ```
1685
+ */
1686
+ preAuth?: RouteHandlerMethod[];
1687
+ /**
1688
+ * Streaming response mode — designed for SSE and AI streaming routes.
1689
+ * When `true`:
1690
+ * - Forces `wrapHandler: false` (no `{ success, data }` wrapper)
1691
+ * - Sets SSE headers: `Content-Type: text/event-stream`, `Cache-Control: no-cache`, `Connection: keep-alive`
1692
+ * - `request.signal` (Fastify 5 built-in) is available for abort-on-disconnect
1693
+ *
1694
+ * @example
1695
+ * ```typescript
1696
+ * {
1697
+ * method: 'POST',
1698
+ * path: '/stream',
1699
+ * streamResponse: true,
1700
+ * permissions: requireAuth(),
1701
+ * handler: async (request, reply) => {
1702
+ * const { stream } = await generateStream({ abortSignal: request.signal });
1703
+ * return reply.send(stream);
1704
+ * },
1705
+ * }
1706
+ * ```
1707
+ */
1708
+ streamResponse?: boolean;
1559
1709
  /** Fastify route schema */
1560
1710
  schema?: Record<string, unknown>;
1561
1711
  /**
@@ -2126,12 +2276,43 @@ type TypedRepository<TDoc> = CrudRepository<TDoc>;
2126
2276
  *
2127
2277
  * CrudRepository<TDoc> and MongoKit Repository both satisfy this interface.
2128
2278
  */
2279
+ /**
2280
+ * Minimal repository interface for flexible adapter compatibility.
2281
+ * Any repository with these method signatures is accepted.
2282
+ *
2283
+ * **Required** — core CRUD (every resource needs these):
2284
+ * getAll, getById, create, update, delete
2285
+ *
2286
+ * **Recommended** — used by AccessControl for compound queries:
2287
+ * getOne
2288
+ *
2289
+ * **Optional** — enabled by presets, checked at runtime:
2290
+ * getBySlug — slugLookup preset
2291
+ * getDeleted — softDelete preset (list soft-deleted)
2292
+ * restore — softDelete preset (restore soft-deleted)
2293
+ * getTree — tree preset (hierarchical queries)
2294
+ * getChildren — tree preset (child nodes)
2295
+ * createMany — bulk preset (batch create)
2296
+ * updateMany — bulk preset (batch update by filter)
2297
+ * deleteMany — bulk preset (batch delete by filter)
2298
+ */
2129
2299
  interface RepositoryLike {
2130
2300
  getAll(params?: unknown): Promise<unknown>;
2131
2301
  getById(id: string, options?: unknown): Promise<unknown>;
2132
2302
  create(data: unknown, options?: unknown): Promise<unknown>;
2133
2303
  update(id: string, data: unknown, options?: unknown): Promise<unknown>;
2134
2304
  delete(id: string, options?: unknown): Promise<unknown>;
2305
+ /** Find single doc by compound filter — used by AccessControl for idField + org/policy scoping.
2306
+ * Without this, Arc falls back to getById + post-fetch security checks. */
2307
+ getOne?(filter: Record<string, unknown>, options?: unknown): Promise<unknown>;
2308
+ getBySlug?(slug: string, options?: unknown): Promise<unknown>;
2309
+ getDeleted?(options?: unknown): Promise<unknown>;
2310
+ restore?(id: string): Promise<unknown>;
2311
+ getTree?(options?: unknown): Promise<unknown>;
2312
+ getChildren?(parentId: string, options?: unknown): Promise<unknown>;
2313
+ createMany?(items: unknown[], options?: unknown): Promise<unknown>;
2314
+ updateMany?(filter: Record<string, unknown>, data: unknown): Promise<unknown>;
2315
+ deleteMany?(filter: Record<string, unknown>): Promise<unknown>;
2135
2316
  [key: string]: unknown;
2136
2317
  }
2137
2318
  interface DataAdapter<TDoc = unknown> {
@@ -2210,4 +2391,4 @@ interface ValidationResult {
2210
2391
  }
2211
2392
  type AdapterFactory<TDoc> = (config: unknown) => DataAdapter<TDoc>;
2212
2393
  //#endregion
2213
- export { RegistryStats as $, HookContext as $t, HealthCheck as A, FastifyHandler as At, MiddlewareConfig as B, InferDoc as Bt, EventDefinition as C, QueryResolverConfig as Ct, FastifyWithDecorators as D, AccessControlConfig as Dt, FastifyWithAuth as E, AccessControl as Et, IntrospectionData as F, RegisterOptions as Ft, ParsedQuery as G, Interceptor as Gt, ObjectId as H, PaginationParams as Ht, IntrospectionPluginOptions as I, ResourceRegistry as It, PresetHook as J, PipelineConfig as Jt, PopulateOption as K, NextFunction as Kt, JWTPayload as L, ResourceDefinition as Lt, InferAdapterDoc as M, IControllerResponse as Mt, InferDocType as N, IRequestContext as Nt, FieldRule as O, ControllerHandler as Ot, InferResourceDoc as P, RouteHandler as Pt, RegistryEntry as Q, DefineHookOptions as Qt, JwtContext as R, defineResource as Rt, CrudSchemas as S, QueryResolver as St, FastifyRequestExtras as T, BodySanitizerConfig as Tt, OpenApiSchemas as U, QueryOptions as Ut, MiddlewareHandler as V, PaginatedResult as Vt, OwnershipCheck as W, Guard as Wt, QueryParserInterface as X, PipelineStep as Xt, PresetResult as Y, PipelineContext as Yt, RateLimitConfig as Z, Transform as Zt, ConfigError as _, ValidateOptions as _t, RepositoryLike as a, HookSystemOptions as an, ResourceHooks as at, CrudRouteKey as b, BaseController as bt, AdditionalRoute as c, afterUpdate as cn, RouteHandlerMethod$1 as ct, ArcDecorator as d, beforeUpdate as dn, TokenPair as dt, HookHandler as en, RequestContext as et, ArcInternalMetadata as f, createHookSystem as fn, TypedController as ft, AuthenticatorContext as g, UserOrganization as gt, Authenticator as h, UserLike as ht, RelationMetadata as i, HookSystem as in, ResourceConfig as it, HealthOptions as j, IController as jt, GracefulShutdownOptions as k, ControllerLike as kt, AnyRecord as l, beforeCreate as ln, RouteSchemaOptions as lt, AuthPluginOptions as m, TypedResourceConfig as mt, DataAdapter as n, HookPhase as nn, RequestWithExtras as nt, SchemaMetadata as o, afterCreate as on, ResourceMetadata as ot, AuthHelpers as p, defineHook as pn, TypedRepository as pt, PresetFunction as q, OperationFilter as qt, FieldMetadata as r, HookRegistration as rn, ResourceCacheConfig as rt, ValidationResult as s, afterDelete as sn, ResourcePermissions as st, AdapterFactory as t, HookOperation as tn, RequestIdOptions as tt, ApiResponse as u, beforeDelete as un, ServiceContext as ut, ControllerQueryOptions as v, ValidationResult$1 as vt, EventsDecorator as w, BodySanitizer as wt, CrudRouterOptions as x, BaseControllerOptions as xt, CrudController as y, getUserId as yt, LookupOption as z, CrudRepository as zt };
2394
+ export { RegistryEntry as $, PipelineStep as $t, GracefulShutdownOptions as A, AccessControlConfig as At, LookupOption as B, ResourceDefinition as Bt, CrudSchemas as C, BaseController as Ct, FastifyWithAuth as D, BodySanitizer as Dt, FastifyRequestExtras as E, QueryResolverConfig as Et, InferResourceDoc as F, IControllerResponse as Ft, OwnershipCheck as G, PaginationParams as Gt, MiddlewareHandler as H, CrudRepository as Ht, IntrospectionData as I, IRequestContext as It, PresetFunction as J, Interceptor as Jt, ParsedQuery as K, QueryOptions as Kt, IntrospectionPluginOptions as L, RouteHandler as Lt, HealthOptions as M, ControllerLike as Mt, InferAdapterDoc as N, FastifyHandler as Nt, FastifyWithDecorators as O, BodySanitizerConfig as Ot, InferDocType as P, IController as Pt, RateLimitConfig as Q, PipelineContext as Qt, JWTPayload as R, RegisterOptions as Rt, CrudRouterOptions as S, getUserId as St, EventsDecorator as T, QueryResolver as Tt, ObjectId as U, InferDoc as Ut, MiddlewareConfig as V, defineResource as Vt, OpenApiSchemas as W, PaginatedResult as Wt, PresetResult as X, OperationFilter as Xt, PresetHook as Y, NextFunction as Yt, QueryParserInterface as Z, PipelineConfig as Zt, AuthenticatorContext as _, UserLike as _t, RepositoryLike as a, HookPhase as an, ResourceConfig as at, CrudController as b, ValidationResult$1 as bt, AdditionalRoute as c, HookSystemOptions as cn, ResourceMetadata as ct, ArcDecorator as d, afterUpdate as dn, RouteSchemaOptions as dt, Transform as en, RegistryStats as et, ArcInternalMetadata as f, beforeCreate as fn, ServiceContext as ft, Authenticator as g, defineHook as gn, TypedResourceConfig as gt, AuthPluginOptions as h, createHookSystem as hn, TypedRepository as ht, RelationMetadata as i, HookOperation as in, ResourceCacheConfig as it, HealthCheck as j, ControllerHandler as jt, FieldRule as k, AccessControl as kt, AnyRecord as l, afterCreate as ln, ResourcePermissions as lt, AuthHelpers as m, beforeUpdate as mn, TypedController as mt, DataAdapter as n, HookContext as nn, RequestIdOptions as nt, SchemaMetadata as o, HookRegistration as on, ResourceHookContext as ot, ArcRequest as p, beforeDelete as pn, TokenPair as pt, PopulateOption as q, Guard as qt, FieldMetadata as r, HookHandler as rn, RequestWithExtras as rt, ValidationResult as s, HookSystem as sn, ResourceHooks as st, AdapterFactory as t, DefineHookOptions as tn, RequestContext as tt, ApiResponse as u, afterDelete as un, RouteHandlerMethod$1 as ut, ConfigError as v, UserOrganization as vt, EventDefinition as w, BaseControllerOptions as wt, CrudRouteKey as x, envelope as xt, ControllerQueryOptions as y, ValidateOptions as yt, JwtContext as z, ResourceRegistry as zt };
@@ -1,9 +1,6 @@
1
1
  import { t as __exportAll } from "./chunk-BpYLSNr0.mjs";
2
2
  //#region src/cache/memory.ts
3
- var memory_exports = /* @__PURE__ */ __exportAll({
4
- MemoryCacheStore: () => MemoryCacheStore,
5
- default: () => MemoryCacheStore
6
- });
3
+ var memory_exports = /* @__PURE__ */ __exportAll({ MemoryCacheStore: () => MemoryCacheStore });
7
4
  /**
8
5
  * In-memory LRU+TTL cache store with hard entry cap and memory budget.
9
6
  * - LRU eviction when `maxEntries` or `maxMemoryBytes` is reached
@@ -89,6 +89,16 @@ interface MongoAuditStoreOptions {
89
89
  /** TTL in days (default: 90, 0 = no expiry) */
90
90
  ttlDays?: number;
91
91
  }
92
+ /**
93
+ * Minimal MongoDB connection interface — DB-agnostic.
94
+ *
95
+ * Accepts:
96
+ * - Native MongoDB `Db` instance (has `.collection()`)
97
+ * - Mongoose `connection.db` (has `.collection()`)
98
+ * - Any object with `.collection(name)` method
99
+ *
100
+ * For Mongoose users: pass `mongoose.connection.db`, not `mongoose.connection`.
101
+ */
92
102
  interface MongoConnection {
93
103
  collection: (name: string) => MongoCollection;
94
104
  }
@@ -1,4 +1,4 @@
1
- import { n as IdempotencyResult, r as IdempotencyStore } from "./interface-B4awm1RJ.mjs";
1
+ import { n as IdempotencyResult, r as IdempotencyStore } from "./interface-gr-7qo9j.mjs";
2
2
 
3
3
  //#region src/idempotency/stores/mongodb.d.ts
4
4
  interface MongoConnection {
@@ -1,4 +1,4 @@
1
- import { Pt as RouteHandler } from "../interface-DGmPxakH.mjs";
1
+ import { Lt as RouteHandler } from "../interface-DDW43OmS.mjs";
2
2
  import { i as UserBase } from "../types-BNUccdcf.mjs";
3
3
  import { InvitationAdapter, InvitationDoc, MemberDoc, OrgAdapter, OrgDoc, OrgPermissionStatement, OrgRole, OrganizationPluginOptions } from "./types.mjs";
4
4
  import { FastifyPluginAsync, RouteHandlerMethod } from "fastify";
@@ -1,4 +1,4 @@
1
- import { c as hasOrgAccess, d as isMember, i as getOrgRoles, n as PUBLIC_SCOPE, u as isElevated } from "../types-C6TQjtdi.mjs";
1
+ import { a as getOrgRoles, d as isElevated, f as isMember, l as hasOrgAccess, n as PUBLIC_SCOPE } from "../types-BhtYdxZU.mjs";
2
2
  import fp from "fastify-plugin";
3
3
  //#region src/org/organizationPlugin.ts
4
4
  const DEFAULT_ROLES = [
@@ -1,4 +1,4 @@
1
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-DFwdaWCq.mjs";
2
2
  import { a as getUserRoles, i as UserBase, n as PermissionContext, o as normalizeRoles, r as PermissionResult, t as PermissionCheck } from "../types-BNUccdcf.mjs";
3
- import { C as publicRead, D as createRoleHierarchy, E as RoleHierarchy, S as presets_d_exports, T as readOnly, _ as when, a as allOf, b as fullPublic, c as createDynamicPermissionMatrix, d as requireAuth, f as requireOrgMembership, g as requireTeamMembership, h as requireRoles, i as PermissionEventBus, l as createOrgPermissions, m as requireOwnership, n as DynamicPermissionMatrix, o as allowPublic, p as requireOrgRole, r as DynamicPermissionMatrixConfig, s as anyOf, t as ConnectEventsOptions, u as denyAll, v as adminOnly, w as publicReadAdminWrite, x as ownerWithAdminBypass, y as authenticated } from "../index-Diqcm14c.mjs";
4
- export { ConnectEventsOptions, DynamicPermissionMatrix, DynamicPermissionMatrixConfig, FieldPermission, FieldPermissionMap, FieldPermissionType, PermissionCheck, PermissionContext, PermissionEventBus, PermissionResult, RoleHierarchy, UserBase, adminOnly, allOf, allowPublic, anyOf, applyFieldReadPermissions, applyFieldWritePermissions, authenticated, createDynamicPermissionMatrix, createOrgPermissions, createRoleHierarchy, denyAll, fields, fullPublic, getUserRoles, normalizeRoles, ownerWithAdminBypass, presets_d_exports as permissions, publicRead, publicReadAdminWrite, readOnly, requireAuth, requireOrgMembership, requireOrgRole, requireOwnership, requireRoles, requireTeamMembership, resolveEffectiveRoles, when };
3
+ import { C as presets_d_exports, D as RoleHierarchy, E as readOnly, O as createRoleHierarchy, S as ownerWithAdminBypass, T as publicReadAdminWrite, _ as roles, a as allOf, b as authenticated, c as createDynamicPermissionMatrix, d as requireAuth, f as requireOrgMembership, g as requireTeamMembership, h as requireRoles, i as PermissionEventBus, l as createOrgPermissions, m as requireOwnership, n as DynamicPermissionMatrix, o as allowPublic, p as requireOrgRole, r as DynamicPermissionMatrixConfig, s as anyOf, t as ConnectEventsOptions, u as denyAll, v as when, w as publicRead, x as fullPublic, y as adminOnly } from "../index-NGZksqM5.mjs";
4
+ export { ConnectEventsOptions, DynamicPermissionMatrix, DynamicPermissionMatrixConfig, FieldPermission, FieldPermissionMap, FieldPermissionType, PermissionCheck, PermissionContext, PermissionEventBus, PermissionResult, RoleHierarchy, UserBase, adminOnly, allOf, allowPublic, anyOf, applyFieldReadPermissions, applyFieldWritePermissions, authenticated, createDynamicPermissionMatrix, createOrgPermissions, createRoleHierarchy, denyAll, fields, fullPublic, getUserRoles, normalizeRoles, ownerWithAdminBypass, presets_d_exports as permissions, publicRead, publicReadAdminWrite, readOnly, requireAuth, requireOrgMembership, requireOrgRole, requireOwnership, requireRoles, requireTeamMembership, resolveEffectiveRoles, roles, when };
@@ -1,4 +1,4 @@
1
1
  import { i as resolveEffectiveRoles, n as applyFieldWritePermissions, r as fields, t as applyFieldReadPermissions } from "../fields-ipsbIRPK.mjs";
2
2
  import { n as normalizeRoles, t as getUserRoles } from "../types-ZUu_h0jp.mjs";
3
- import { S as createRoleHierarchy, _ as ownerWithAdminBypass, a as createOrgPermissions, b as publicReadAdminWrite, c as requireOrgMembership, d as requireRoles, f as requireTeamMembership, g as fullPublic, h as authenticated, i as createDynamicPermissionMatrix, l as requireOrgRole, m as adminOnly, n as allowPublic, o as denyAll, p as when, r as anyOf, s as requireAuth, t as allOf, u as requireOwnership, v as presets_exports, x as readOnly, y as publicRead } from "../permissions-CA5zg0yK.mjs";
4
- export { adminOnly, allOf, allowPublic, anyOf, applyFieldReadPermissions, applyFieldWritePermissions, authenticated, createDynamicPermissionMatrix, createOrgPermissions, createRoleHierarchy, denyAll, fields, fullPublic, getUserRoles, normalizeRoles, ownerWithAdminBypass, presets_exports as permissions, publicRead, publicReadAdminWrite, readOnly, requireAuth, requireOrgMembership, requireOrgRole, requireOwnership, requireRoles, requireTeamMembership, resolveEffectiveRoles, when };
3
+ import { C as createRoleHierarchy, S as readOnly, _ as fullPublic, a as createOrgPermissions, b as publicRead, c as requireOrgMembership, d as requireRoles, f as requireTeamMembership, g as authenticated, h as adminOnly, i as createDynamicPermissionMatrix, l as requireOrgRole, m as when, n as allowPublic, o as denyAll, p as roles, r as anyOf, s as requireAuth, t as allOf, u as requireOwnership, v as ownerWithAdminBypass, x as publicReadAdminWrite, y as presets_exports } from "../permissions-C8ImI8gC.mjs";
4
+ export { adminOnly, allOf, allowPublic, anyOf, applyFieldReadPermissions, applyFieldWritePermissions, authenticated, createDynamicPermissionMatrix, createOrgPermissions, createRoleHierarchy, denyAll, fields, fullPublic, getUserRoles, normalizeRoles, ownerWithAdminBypass, presets_exports as permissions, publicRead, publicReadAdminWrite, readOnly, requireAuth, requireOrgMembership, requireOrgRole, requireOwnership, requireRoles, requireTeamMembership, resolveEffectiveRoles, roles, when };
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./chunk-BpYLSNr0.mjs";
2
- import { a as getTeamId, d as isMember, n as PUBLIC_SCOPE, o as getUserId, u as isElevated } from "./types-C6TQjtdi.mjs";
2
+ import { d as isElevated, f as isMember, n as PUBLIC_SCOPE, o as getTeamId, s as getUserId } from "./types-BhtYdxZU.mjs";
3
3
  import { t as getUserRoles } from "./types-ZUu_h0jp.mjs";
4
- import { t as MemoryCacheStore } from "./memory-Cb_7iy9e.mjs";
4
+ import { t as MemoryCacheStore } from "./memory-BFAYkf8H.mjs";
5
5
  import { randomUUID } from "node:crypto";
6
6
  //#region src/permissions/roleHierarchy.ts
7
7
  /**
@@ -244,6 +244,10 @@ function requireRoles(roles, options) {
244
244
  const userRoles = getUserRoles(ctx.user);
245
245
  if (options?.bypassRoles?.some((r) => userRoles.includes(r))) return true;
246
246
  if (roles.some((r) => userRoles.includes(r))) return true;
247
+ if (options?.includeOrgRoles) {
248
+ const scope = getScope(ctx.request);
249
+ if (isMember(scope) && roles.some((r) => scope.orgRoles.includes(r))) return true;
250
+ }
247
251
  return {
248
252
  granted: false,
249
253
  reason: `Required roles: ${roles.join(", ")}`
@@ -253,6 +257,44 @@ function requireRoles(roles, options) {
253
257
  return check;
254
258
  }
255
259
  /**
260
+ * Unified role check — checks both platform roles AND org roles.
261
+ *
262
+ * This is the recommended helper for Better Auth organization plugin users.
263
+ * It checks `user.role` (platform) first, then `scope.orgRoles` (org membership).
264
+ * Elevated scope always passes.
265
+ *
266
+ * For platform-only checks: use `requireRoles(['admin'])`
267
+ * For org-only checks: use `requireOrgRole('admin')`
268
+ *
269
+ * @example
270
+ * ```typescript
271
+ * permissions: {
272
+ * create: roles('admin', 'editor'), // passes if user has role at either level
273
+ * delete: roles('admin'),
274
+ * }
275
+ * ```
276
+ */
277
+ function roles(...args) {
278
+ const roleList = Array.isArray(args[0]) ? args[0] : args;
279
+ const check = (ctx) => {
280
+ if (!ctx.user) return {
281
+ granted: false,
282
+ reason: "Authentication required"
283
+ };
284
+ const userRoles = getUserRoles(ctx.user);
285
+ if (roleList.some((r) => userRoles.includes(r))) return true;
286
+ const scope = getScope(ctx.request);
287
+ if (isElevated(scope)) return true;
288
+ if (isMember(scope) && roleList.some((r) => scope.orgRoles.includes(r))) return true;
289
+ return {
290
+ granted: false,
291
+ reason: `Required roles: ${roleList.join(", ")}`
292
+ };
293
+ };
294
+ check._roles = roleList;
295
+ return check;
296
+ }
297
+ /**
256
298
  * Require resource ownership
257
299
  *
258
300
  * Returns filters to scope queries to user's owned resources.
@@ -748,4 +790,4 @@ function requireTeamMembership() {
748
790
  return check;
749
791
  }
750
792
  //#endregion
751
- export { createRoleHierarchy as S, ownerWithAdminBypass as _, createOrgPermissions as a, publicReadAdminWrite as b, requireOrgMembership as c, requireRoles as d, requireTeamMembership as f, fullPublic as g, authenticated as h, createDynamicPermissionMatrix as i, requireOrgRole as l, adminOnly as m, allowPublic as n, denyAll as o, when as p, anyOf as r, requireAuth as s, allOf as t, requireOwnership as u, presets_exports as v, readOnly as x, publicRead as y };
793
+ export { createRoleHierarchy as C, readOnly as S, fullPublic as _, createOrgPermissions as a, publicRead as b, requireOrgMembership as c, requireRoles as d, requireTeamMembership as f, authenticated as g, adminOnly as h, createDynamicPermissionMatrix as i, requireOrgRole as l, when as m, allowPublic as n, denyAll as o, roles as p, anyOf as r, requireAuth as s, allOf as t, requireOwnership as u, ownerWithAdminBypass as v, publicReadAdminWrite as x, presets_exports as y };
@@ -1,4 +1,4 @@
1
- import { B as MiddlewareConfig, It as ResourceRegistry, J as PresetHook, c as AdditionalRoute, in as HookSystem, l as AnyRecord, lt as RouteSchemaOptions } from "../interface-DGmPxakH.mjs";
1
+ import { V as MiddlewareConfig, Y as PresetHook, c as AdditionalRoute, dt as RouteSchemaOptions, l as AnyRecord, sn as HookSystem, zt as ResourceRegistry } from "../interface-DDW43OmS.mjs";
2
2
  import { t as ExternalOpenApiPaths } from "../externalPaths-DpO-s7r8.mjs";
3
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-Do4vVQ1f.mjs";
4
4
  import { t as TracingOptions } from "../tracing-bz_U4EM1.mjs";
@@ -1,13 +1,13 @@
1
1
  import { p as MUTATION_OPERATIONS } from "../constants-Cxde4rpC.mjs";
2
- import { r as getOrgId } from "../types-C6TQjtdi.mjs";
2
+ import { i as getOrgId } from "../types-BhtYdxZU.mjs";
3
3
  import { t as requestContext } from "../requestContext-DYtmNpm5.mjs";
4
4
  import { t as hasEvents } from "../typeGuards-Cj5Rgvlg.mjs";
5
5
  import { t as HookSystem } from "../HookSystem-COkyWztM.mjs";
6
6
  import { t as ResourceRegistry } from "../ResourceRegistry-DeCIFlix.mjs";
7
7
  import { n as caching_default, t as cachingPlugin } from "../caching-BSXB-Xr7.mjs";
8
- import { t as errorHandlerPlugin } from "../errorHandler--zp54tGc.mjs";
8
+ import { t as errorHandlerPlugin } from "../errorHandler-r2595m8T.mjs";
9
9
  import { n as metrics_default, t as metricsPlugin } from "../metrics-Csh4nsvv.mjs";
10
- import { n as sse_default, t as ssePlugin } from "../sse-BkViJPlT.mjs";
10
+ import { n as sse_default, t as ssePlugin } from "../sse-BF7GR7IB.mjs";
11
11
  import { n as versioning_default, t as versioningPlugin } from "../versioning-BzfeHmhj.mjs";
12
12
  import { randomUUID } from "node:crypto";
13
13
  import fp from "fastify-plugin";
@@ -84,4 +84,4 @@ declare module "fastify" {
84
84
  }
85
85
  declare const responseCachePlugin: FastifyPluginAsync<ResponseCacheOptions>;
86
86
  //#endregion
87
- export { ResponseCacheOptions, ResponseCacheRule, ResponseCacheStats, responseCachePlugin as default, responseCachePlugin };
87
+ export { ResponseCacheOptions, ResponseCacheRule, ResponseCacheStats, responseCachePlugin };
@@ -215,4 +215,4 @@ const responseCachePlugin = fp(responseCachePluginImpl, {
215
215
  fastify: "5.x"
216
216
  });
217
217
  //#endregion
218
- export { responseCachePlugin as default, responseCachePlugin };
218
+ export { responseCachePlugin };
@@ -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.4.2";
47
+ const resolvedVersion = serviceVersion ?? "2.6.1";
48
48
  const exporter = new OTLPTraceExporter({ url: exporterUrl });
49
49
  const provider = new NodeTracerProvider({ resource: { attributes: {
50
50
  "service.name": serviceName,
@@ -1,5 +1,5 @@
1
- import { Mt as IControllerResponse, Nt as IRequestContext, Vt as PaginatedResult, Y as PresetResult, it as ResourceConfig, l as AnyRecord } from "../interface-DGmPxakH.mjs";
2
- import multiTenantPreset, { MultiTenantOptions } from "./multiTenant.mjs";
1
+ import { Ft as IControllerResponse, It as IRequestContext, Wt as PaginatedResult, X as PresetResult, at as ResourceConfig, l as AnyRecord } from "../interface-DDW43OmS.mjs";
2
+ import { MultiTenantOptions, multiTenantPreset } from "./multiTenant.mjs";
3
3
 
4
4
  //#region src/presets/ownedByUser.d.ts
5
5
  interface OwnedByUserOptions {
@@ -1,3 +1,3 @@
1
- import multiTenantPreset from "./multiTenant.mjs";
2
- import { a as registerPreset, c as auditedPreset, d as ownedByUserPreset, i as getPreset, l as softDeletePreset, n as flexibleMultiTenantPreset, o as treePreset, r as getAvailablePresets, s as bulkPreset, t as applyPresets, u as slugLookupPreset } from "../presets-C9QXJV1u.mjs";
1
+ import { multiTenantPreset } from "./multiTenant.mjs";
2
+ import { a as registerPreset, c as auditedPreset, d as ownedByUserPreset, i as getPreset, l as softDeletePreset, n as flexibleMultiTenantPreset, o as treePreset, r as getAvailablePresets, s as bulkPreset, t as applyPresets, u as slugLookupPreset } from "../presets-BMfdy34e.mjs";
3
3
  export { applyPresets, auditedPreset, bulkPreset, flexibleMultiTenantPreset, getAvailablePresets, getPreset, multiTenantPreset, ownedByUserPreset, registerPreset, slugLookupPreset, softDeletePreset, treePreset };
@@ -1,4 +1,4 @@
1
- import { Y as PresetResult, b as CrudRouteKey } from "../interface-DGmPxakH.mjs";
1
+ import { X as PresetResult, x as CrudRouteKey } from "../interface-DDW43OmS.mjs";
2
2
 
3
3
  //#region src/presets/multiTenant.d.ts
4
4
  interface MultiTenantOptions {
@@ -18,4 +18,4 @@ interface MultiTenantOptions {
18
18
  }
19
19
  declare function multiTenantPreset(options?: MultiTenantOptions): PresetResult;
20
20
  //#endregion
21
- export { MultiTenantOptions, multiTenantPreset as default, multiTenantPreset };
21
+ export { MultiTenantOptions, multiTenantPreset };
@@ -1,5 +1,5 @@
1
1
  import { o as DEFAULT_TENANT_FIELD } from "../constants-Cxde4rpC.mjs";
2
- import { d as isMember, n as PUBLIC_SCOPE, r as getOrgId, u as isElevated } from "../types-C6TQjtdi.mjs";
2
+ import { d as isElevated, f as isMember, i as getOrgId, n as PUBLIC_SCOPE } from "../types-BhtYdxZU.mjs";
3
3
  //#region src/presets/multiTenant.ts
4
4
  /** Read request.scope safely */
5
5
  function getScope(request) {
@@ -108,4 +108,4 @@ function multiTenantPreset(options = {}) {
108
108
  };
109
109
  }
110
110
  //#endregion
111
- export { multiTenantPreset as default, multiTenantPreset };
111
+ export { multiTenantPreset };
@@ -1,6 +1,6 @@
1
- import { n as PUBLIC_SCOPE, u as isElevated } from "./types-C6TQjtdi.mjs";
2
- import multiTenantPreset from "./presets/multiTenant.mjs";
3
- import { d as requireRoles, n as allowPublic, s as requireAuth } from "./permissions-CA5zg0yK.mjs";
1
+ import { d as isElevated, n as PUBLIC_SCOPE } from "./types-BhtYdxZU.mjs";
2
+ import { multiTenantPreset } from "./presets/multiTenant.mjs";
3
+ import { d as requireRoles, n as allowPublic, s as requireAuth } from "./permissions-C8ImI8gC.mjs";
4
4
  //#region src/presets/ownedByUser.ts
5
5
  /**
6
6
  * Create ownership check middleware.
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./chunk-BpYLSNr0.mjs";
2
2
  import { i as versionKey, r as tagVersionKey } from "./keys-qcD-TVJl.mjs";
3
3
  import { t as hasEvents } from "./typeGuards-Cj5Rgvlg.mjs";
4
- import { t as MemoryCacheStore } from "./memory-Cb_7iy9e.mjs";
4
+ import { t as MemoryCacheStore } from "./memory-BFAYkf8H.mjs";
5
5
  import fp from "fastify-plugin";
6
6
  //#region src/cache/QueryCache.ts
7
7
  var QueryCache = class {
@@ -1,4 +1,4 @@
1
- import { n as IdempotencyResult, r as IdempotencyStore } from "./interface-B4awm1RJ.mjs";
1
+ import { n as IdempotencyResult, r as IdempotencyStore } from "./interface-gr-7qo9j.mjs";
2
2
 
3
3
  //#region src/idempotency/stores/redis.d.ts
4
4
  interface RedisClient {
@@ -1,4 +1,4 @@
1
- import { Ft as RegisterOptions, I as IntrospectionPluginOptions, It as ResourceRegistry } from "../interface-DGmPxakH.mjs";
1
+ import { L as IntrospectionPluginOptions, Rt as RegisterOptions, zt as ResourceRegistry } from "../interface-DDW43OmS.mjs";
2
2
  import { FastifyPluginAsync } from "fastify";
3
3
 
4
4
  //#region src/registry/introspectionPlugin.d.ts