@classytic/arc 2.13.1 → 2.14.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 (49) hide show
  1. package/dist/{BaseController-DX_T-bDB.mjs → BaseController-Dv60tU83.mjs} +47 -11
  2. package/dist/auth/index.d.mts +79 -2
  3. package/dist/auth/index.mjs +19 -1
  4. package/dist/{buildHandler-olo-gt94.mjs → buildHandler-BamHHpH8.mjs} +26 -5
  5. package/dist/cli/commands/describe.d.mts +1 -1
  6. package/dist/cli/commands/docs.mjs +1 -1
  7. package/dist/core/index.d.mts +3 -3
  8. package/dist/core/index.mjs +4 -4
  9. package/dist/{core-D72ia0EH.mjs → core-DEdN6zKD.mjs} +105 -8
  10. package/dist/{createActionRouter-CEvzKcy8.mjs → createActionRouter-S3MLVYot.mjs} +11 -4
  11. package/dist/{createAggregationRouter-CyecOxnO.mjs → createAggregationRouter-Bk-58SbZ.mjs} +2 -2
  12. package/dist/{createApp-XX2-N0Yd.mjs → createApp-BarYhXCZ.mjs} +4 -3
  13. package/dist/docs/index.d.mts +24 -11
  14. package/dist/docs/index.mjs +1 -1
  15. package/dist/factory/index.d.mts +1 -1
  16. package/dist/factory/index.mjs +1 -1
  17. package/dist/hooks/index.d.mts +1 -1
  18. package/dist/{index-Dz5IKsrE.d.mts → index-Bt0F3nJj.d.mts} +1 -1
  19. package/dist/{index-Ds61mrJE.d.mts → index-D1-Kp_dP.d.mts} +48 -2
  20. package/dist/{index-BtW7qYwa.d.mts → index-Dwc0orNd.d.mts} +68 -7
  21. package/dist/index.d.mts +3 -3
  22. package/dist/index.mjs +4 -4
  23. package/dist/integrations/index.d.mts +1 -1
  24. package/dist/integrations/mcp/index.d.mts +2 -2
  25. package/dist/integrations/mcp/index.mjs +1 -1
  26. package/dist/integrations/mcp/testing.d.mts +1 -1
  27. package/dist/integrations/mcp/testing.mjs +1 -1
  28. package/dist/middleware/index.d.mts +1 -1
  29. package/dist/openapi-BHXhoX8O.mjs +968 -0
  30. package/dist/org/index.d.mts +1 -1
  31. package/dist/pipeline/index.d.mts +1 -1
  32. package/dist/plugins/index.d.mts +1 -1
  33. package/dist/plugins/tracing-entry.mjs +1 -1
  34. package/dist/presets/filesUpload.d.mts +1 -1
  35. package/dist/presets/index.d.mts +1 -1
  36. package/dist/presets/multiTenant.d.mts +1 -1
  37. package/dist/presets/search.d.mts +1 -1
  38. package/dist/registry/index.d.mts +1 -1
  39. package/dist/{resourceToTools-C5coh64w.mjs → resourceToTools-CZ-ZhS7v.mjs} +4 -4
  40. package/dist/{routerShared-D6_fEGHh.mjs → routerShared-DrOa-26E.mjs} +1 -0
  41. package/dist/testing/index.d.mts +2 -2
  42. package/dist/testing/index.mjs +1 -1
  43. package/dist/types/index.d.mts +1 -1
  44. package/dist/{types-DQHFc8PM.d.mts → types-C6ONJ_Z2.d.mts} +1 -1
  45. package/dist/{types-BvqwCCSx.d.mts → types-NGtx3uxV.d.mts} +1 -1
  46. package/dist/utils/index.d.mts +1 -1
  47. package/package.json +1 -1
  48. package/dist/openapi-CiOMVW1p.mjs +0 -687
  49. /package/dist/{schemaIR-7Vl611Qs.mjs → schemaIR-lYhC2gE5.mjs} +0 -0
@@ -1,4 +1,4 @@
1
- import { a as CustomPluginAuthOption, c as RawBodyOptions, d as ResourceLike, f as ResourceModule, i as CustomAuthenticatorOption, l as UnderPressureOptions, n as BetterAuthOption, o as JwtAuthOption, p as loadResources, r as CreateAppOptions, s as MultipartOptions, t as AuthOption, u as LoadResourcesOptions } from "../types-BvqwCCSx.mjs";
1
+ import { a as CustomPluginAuthOption, c as RawBodyOptions, d as ResourceLike, f as ResourceModule, i as CustomAuthenticatorOption, l as UnderPressureOptions, n as BetterAuthOption, o as JwtAuthOption, p as loadResources, r as CreateAppOptions, s as MultipartOptions, t as AuthOption, u as LoadResourcesOptions } from "../types-NGtx3uxV.mjs";
2
2
  import { FastifyInstance } from "fastify";
3
3
 
4
4
  //#region src/factory/createApp.d.ts
@@ -1,4 +1,4 @@
1
- import { a as edgePreset, c as testingPreset, i as developmentPreset, n as createApp, o as getPreset, s as productionPreset, t as ArcFactory } from "../createApp-XX2-N0Yd.mjs";
1
+ import { a as edgePreset, c as testingPreset, i as developmentPreset, n as createApp, o as getPreset, s as productionPreset, t as ArcFactory } from "../createApp-BarYhXCZ.mjs";
2
2
  import { t as loadResources } from "../loadResources-DBMQg_Aj.mjs";
3
3
  //#region src/factory/edge.ts
4
4
  /**
@@ -1,2 +1,2 @@
1
- import { An as afterUpdate, Cn as HookOperation, Dn as HookSystemOptions, En as HookSystem, Fn as defineHook, Mn as beforeDelete, Nn as beforeUpdate, On as afterCreate, Pn as createHookSystem, Sn as HookHandler, Tn as HookRegistration, bn as DefineHookOptions, jn as beforeCreate, kn as afterDelete, wn as HookPhase, xn as HookContext } from "../index-BtW7qYwa.mjs";
1
+ import { An as afterUpdate, Cn as HookOperation, Dn as HookSystemOptions, En as HookSystem, Fn as defineHook, Mn as beforeDelete, Nn as beforeUpdate, On as afterCreate, Pn as createHookSystem, Sn as HookHandler, Tn as HookRegistration, bn as DefineHookOptions, jn as beforeCreate, kn as afterDelete, wn as HookPhase, xn as HookContext } from "../index-Dwc0orNd.mjs";
2
2
  export { type DefineHookOptions, type HookContext, type HookHandler, type HookOperation, type HookPhase, type HookRegistration, HookSystem, type HookSystemOptions, afterCreate, afterDelete, afterUpdate, beforeCreate, beforeDelete, beforeUpdate, createHookSystem, defineHook };
@@ -1,4 +1,4 @@
1
- import { $ as OpenApiSchemas, S as QueryParserInterface, Wt as AnyRecord, Yt as UserLike, at as ResourceConfig, b as ParsedQuery } from "./index-BtW7qYwa.mjs";
1
+ import { $ as OpenApiSchemas, S as QueryParserInterface, Wt as AnyRecord, Yt as UserLike, at as ResourceConfig, b as ParsedQuery } from "./index-Dwc0orNd.mjs";
2
2
  import { n as ErrorMapper } from "./errorHandler-DFr45ZG4.mjs";
3
3
  import { HttpError, errorContractSchema as errorContractSchema$1, errorDetailSchema as errorDetailSchema$1 } from "@classytic/repo-core/errors";
4
4
  import { FastifyInstance, FastifyReply, FastifyRequest, RouteHandlerMethod } from "fastify";
@@ -1,4 +1,4 @@
1
- import { C as RequestContext, Ct as AggregationConfig, F as FastifyWithDecorators, T as CrudRouterOptions, V as ResourceDefinition, Wt as AnyRecord, _t as IControllerResponse, at as ResourceConfig, gt as IController, q as CrudController, vt as IRequestContext } from "./index-BtW7qYwa.mjs";
1
+ import { C as RequestContext, Ct as AggregationConfig, F as FastifyWithDecorators, K as ArcFieldRule, L as RequestWithExtras, T as CrudRouterOptions, V as ResourceDefinition, Wt as AnyRecord, _t as IControllerResponse, at as ResourceConfig, ft as RouteSchemaOptions, gt as IController, q as CrudController, vt as IRequestContext } from "./index-Dwc0orNd.mjs";
2
2
  import { i as RequestScope } from "./types-CTYvcwHe.mjs";
3
3
  import { c as PermissionCheck } from "./fields-COhcH3fk.mjs";
4
4
  import { FastifyReply, FastifyRequest, RouteHandlerMethod } from "fastify";
@@ -159,6 +159,34 @@ type VariantsResult<TDoc, V extends VariantsMap<TDoc>> = { [K in keyof V]: Resou
159
159
  */
160
160
  declare function defineResourceVariants<TDoc extends AnyRecord = AnyRecord, V extends VariantsMap<TDoc> = VariantsMap<TDoc>>(base: Omit<ResourceConfig<TDoc>, "name" | "prefix">, variants: V): VariantsResult<TDoc, V>;
161
161
  //#endregion
162
+ //#region src/core/entityHelpers.d.ts
163
+ /**
164
+ * Read the resource's configured `idField` for the current request.
165
+ * Falls back to the framework default (`_id`) when the route hasn't
166
+ * bound an idField — keeps handlers safe to author without checking
167
+ * the resource config.
168
+ */
169
+ declare function getEntityIdField(req: RequestWithExtras): string;
170
+ /**
171
+ * Read the URL `:id` path param value as the resource handle.
172
+ * Returns `undefined` when the route has no `:id` segment (collection
173
+ * routes) — handlers that need the entity must be on row routes.
174
+ */
175
+ declare function getEntityId(req: RequestWithExtras): string | undefined;
176
+ /**
177
+ * Compose a `findOne` filter that resolves the current request's
178
+ * entity, regardless of whether the resource binds `_id` or a custom
179
+ * field. Idiomatic shape for arc action handlers.
180
+ *
181
+ * ```ts
182
+ * const doc = await Model.findOne(getEntityQuery(req));
183
+ * ```
184
+ *
185
+ * Returns `{}` when the route has no entity context (collection routes
186
+ * or tests bypassing the router) — caller decides what that means.
187
+ */
188
+ declare function getEntityQuery(req: RequestWithExtras): Record<string, string>;
189
+ //#endregion
162
190
  //#region src/core/fastifyAdapter.d.ts
163
191
  /**
164
192
  * Create IRequestContext from Fastify request
@@ -227,4 +255,22 @@ declare function createCrudHandlers<TDoc>(controller: IController<TDoc>): {
227
255
  delete: (req: FastifyRequest, reply: FastifyReply) => Promise<void>;
228
256
  };
229
257
  //#endregion
230
- export { MAX_FILTER_DEPTH as C, MutationOperation as D, MUTATION_OPERATIONS as E, RESERVED_QUERY_PARAMS as O, HookPhase as S, MAX_SEARCH_LENGTH as T, DEFAULT_TENANT_FIELD as _, getControllerScope as a, HOOK_PHASES as b, createCrudRouter as c, CRUD_OPERATIONS as d, CrudOperation as f, DEFAULT_SORT as g, DEFAULT_MAX_LIMIT as h, getControllerContext as i, SYSTEM_FIELDS as k, createPermissionMiddleware as l, DEFAULT_LIMIT as m, createFastifyHandler as n, sendControllerResponse as o, DEFAULT_ID_FIELD as p, createRequestContext as r, defineResourceVariants as s, createCrudHandlers as t, defineAggregation as u, DEFAULT_UPDATE_METHOD as v, MAX_REGEX_LENGTH as w, HookOperation as x, HOOK_OPERATIONS as y };
258
+ //#region src/core/fieldRulePredicates.d.ts
259
+ /**
260
+ * True when the field is allowed to appear in client-readable surfaces
261
+ * (response payloads, `select=` whitelists, `_distinct` queries).
262
+ *
263
+ * Mirror of every read-side gate. Don't reach for `rules.systemManaged`
264
+ * here — that's a write rule.
265
+ */
266
+ declare function isFieldReadable(rule: ArcFieldRule | undefined): boolean;
267
+ /**
268
+ * The set of field names blocked from read-side surfaces (used by
269
+ * `QueryResolver.sanitizeSelectAny` and `BaseCrudController._distinct`).
270
+ *
271
+ * Returns `null` (not an empty array) when there are no rules to apply,
272
+ * so call-sites can early-out without creating empty allocations.
273
+ */
274
+ declare function collectReadBlockedFields(schemaOptions: RouteSchemaOptions | undefined): Set<string> | null;
275
+ //#endregion
276
+ export { MAX_SEARCH_LENGTH as A, DEFAULT_UPDATE_METHOD as C, HookPhase as D, HookOperation as E, MutationOperation as M, RESERVED_QUERY_PARAMS as N, MAX_FILTER_DEPTH as O, SYSTEM_FIELDS as P, DEFAULT_TENANT_FIELD as S, HOOK_PHASES as T, CrudOperation as _, createRequestContext as a, DEFAULT_MAX_LIMIT as b, sendControllerResponse as c, getEntityQuery as d, defineResourceVariants as f, CRUD_OPERATIONS as g, defineAggregation as h, createFastifyHandler as i, MUTATION_OPERATIONS as j, MAX_REGEX_LENGTH as k, getEntityId as l, createPermissionMiddleware as m, isFieldReadable as n, getControllerContext as o, createCrudRouter as p, createCrudHandlers as r, getControllerScope as s, collectReadBlockedFields as t, getEntityIdField as u, DEFAULT_ID_FIELD as v, HOOK_OPERATIONS as w, DEFAULT_SORT as x, DEFAULT_LIMIT as y };
@@ -541,7 +541,12 @@ declare class QueryResolver {
541
541
  * Validates lookup structure to prevent injection.
542
542
  */
543
543
  private sanitizeLookups;
544
- /** Get blocked fields from schema options */
544
+ /**
545
+ * Read-side allowlist gate for `select=` / `populate=`.
546
+ *
547
+ * Only `hidden: true` blocks. `systemManaged` is a *write* rule and
548
+ * doesn't gate visibility — see `core/fieldRulePredicates.ts`.
549
+ */
545
550
  private getBlockedFields;
546
551
  }
547
552
  //#endregion
@@ -817,10 +822,13 @@ declare class BaseCrudController<TDoc = AnyRecord, TRepository extends Repositor
817
822
  exists: boolean;
818
823
  }>>;
819
824
  /**
820
- * True when `field` is safe to expose via `_distinct`. Mirrors the
821
- * `select` allowlist — fields marked `hidden` or `systemManaged` in
822
- * `schemaOptions.fieldRules` are NOT exposed (would leak password
823
- * hashes, internal flags, etc).
825
+ * True when `field` is safe to expose via `_distinct`.
826
+ *
827
+ * Read-side gate only only `hidden: true` blocks. `systemManaged`
828
+ * is a *write* rule (clients can't PATCH the value); the field is
829
+ * still in every list response, so blocking `_distinct` adds nothing
830
+ * but inconvenience. See `core/fieldRulePredicates.ts` for the
831
+ * canonical predicate shared with `QueryResolver`.
824
832
  */
825
833
  protected isFieldExposedForRead(field: string): boolean;
826
834
  /** Execute list query through hooks (extracted for cache revalidation) */
@@ -1947,6 +1955,32 @@ interface ArcFieldRule extends FieldRule {
1947
1955
  */
1948
1956
  preserveForElevated?: boolean;
1949
1957
  hidden?: boolean;
1958
+ /**
1959
+ * Aggregation visibility override. By default, only `hidden: true`
1960
+ * blocks a field from `groupBy` / `measures.field` / `sort` / `dateBuckets`
1961
+ * — that's the genuine cardinality-leak guard (the value is omitted from
1962
+ * list/get responses, so exposing it via aggregation would reveal data
1963
+ * the client can't otherwise see).
1964
+ *
1965
+ * `systemManaged: true` does **not** block aggregation — it's a write
1966
+ * rule, not a visibility rule. Server-stamped fields like `createdAt`,
1967
+ * `status`, or plugin-generated handles are visible in every list
1968
+ * response and should aggregate freely.
1969
+ *
1970
+ * Use this flag to override the default:
1971
+ *
1972
+ * - `aggregable: false` — explicit deny, even on visible fields. Useful
1973
+ * when a value is exposed per-row but the cardinality across rows is
1974
+ * itself sensitive (e.g. `email` is visible in `get/:id` to admins
1975
+ * but you don't want a public-readable agg of email distributions).
1976
+ * - `aggregable: true` — escape hatch on `hidden` fields. Lets you
1977
+ * aggregate a hidden column when you're sure cardinality leakage
1978
+ * isn't a concern (e.g. `internalScore` hidden from list, but a
1979
+ * committee-only `byScore` agg is fine).
1980
+ *
1981
+ * Defaults to `undefined` (use the `hidden`-only rule).
1982
+ */
1983
+ aggregable?: boolean;
1950
1984
  /** String minimum length — auto-maps to OpenAPI `minLength` and MCP tool schema */
1951
1985
  minLength?: number;
1952
1986
  /** String maximum length — auto-maps to OpenAPI `maxLength` and MCP tool schema */
@@ -2837,13 +2871,33 @@ interface FastifyRequestExtras {
2837
2871
  }
2838
2872
  interface RequestWithExtras extends FastifyRequest {
2839
2873
  /**
2840
- * Arc metadata — set by createCrudRouter. Contains resource configuration
2841
- * and schema options.
2874
+ * Arc metadata — set by createCrudRouter / createActionRouter / etc.
2875
+ * Contains resource configuration and runtime resolution of the URL
2876
+ * `:id` path param into the resource's `idField`.
2842
2877
  */
2843
2878
  arc?: {
2844
2879
  resourceName?: string;
2845
2880
  schemaOptions?: RouteSchemaOptions;
2846
2881
  permissions?: ResourcePermissions;
2882
+ /**
2883
+ * The configured `idField` for this resource (e.g. `_id`, `slug`,
2884
+ * `reportId`). Set by routers that bind a path `:id` segment so
2885
+ * handlers can compose the right query without remembering the
2886
+ * resource-config detail.
2887
+ *
2888
+ * Use `getEntityQuery(req)` for the canonical
2889
+ * `{ [idField]: entityId }` filter shape — saves the action handler
2890
+ * from a typo class where `Model.findById(id)` silently fails when
2891
+ * `idField !== "_id"`.
2892
+ */
2893
+ idField?: string;
2894
+ /**
2895
+ * The current request's `:id` path-param value, surfaced verbatim.
2896
+ * For most resources this equals `req.params.id`; we mirror it on
2897
+ * `req.arc` so middleware that doesn't have a typed `params` shape
2898
+ * can still read the entity handle.
2899
+ */
2900
+ entityId?: string;
2847
2901
  };
2848
2902
  context?: Record<string, unknown>;
2849
2903
  _policyFilters?: Record<string, unknown>;
@@ -2958,6 +3012,13 @@ interface CrudRouterOptions {
2958
3012
  rateLimit?: RateLimitConfig | false;
2959
3013
  /** PreHandler guards applied to every route (CRUD + custom + preset). */
2960
3014
  routeGuards?: RouteHandlerMethod[];
3015
+ /**
3016
+ * Resource's bound `idField` (`_id`, `slug`, `reportId`, …). Surfaces on
3017
+ * `req.arc.idField` for every CRUD route so handlers + middleware can
3018
+ * compose `findOne` filters via `getEntityQuery(req)` without
3019
+ * re-reading resource config. Defaults to `_id`.
3020
+ */
3021
+ idField?: string;
2961
3022
  }
2962
3023
  //#endregion
2963
3024
  //#region src/types/query.d.ts
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
- import { $t as SoftDeleteMixin, A as RequestIdOptions, B as defineResource, C as RequestContext, Ct as AggregationConfig, D as HealthCheck, Dt as AggregationMaterializedResult, E as GracefulShutdownOptions, Et as AggregationMaterializedContext, F as FastifyWithDecorators, Gt as ApiResponse, J as CrudRouteKey, Kt as ArcRequest, L as RequestWithExtras, N as FastifyRequestExtras, O as HealthOptions, Ot as AggregationRateLimit, P as FastifyWithAuth, Q as MiddlewareConfig, Qt as SoftDeleteExt, S as QueryParserInterface, St as AggregationCacheConfig, T as CrudRouterOptions, Tt as AggregationIndexHint, V as ResourceDefinition, Wt as AnyRecord, X as EventDefinition, Xt as UserOrganization, Y as CrudSchemas, Z as FieldRule, Zt as BaseController, _t as IControllerResponse, a as InferAdapterDoc, an as BulkMixin, at as ResourceConfig, bt as AggMeasureInput, c as TypedController, d as PaginationResult, dn as ArcDeleteResult, en as TreeExt, et as PresetFunction, f as IntrospectionData, fn as ArcGetResult, ft as RouteSchemaOptions, g as ArcInternalMetadata, gt as IController, h as ResourceMetadata, hn as ListResult, i as ValidationResult, in as BulkExt, k as IntrospectionPluginOptions, kt as AggregationsMap, l as TypedRepository, m as RegistryStats, mn as ArcUpdateResult, mt as ControllerLike, n as ConfigError, nn as SlugExt, nt as PresetResult, o as InferDocType, on as BaseControllerOptions, p as RegistryEntry, pn as ArcListResult, q as CrudController, qt as JWTPayload, r as ValidateOptions, rn as SlugMixin, rt as RateLimitConfig, s as InferResourceDoc, sn as BaseCrudController, t as RouteHandlerMethod, tn as TreeMixin, u as TypedResourceConfig, un as ArcCreateResult, vt as IRequestContext, w as ServiceContext, wt as AggregationDateRangeRequirement, xt as AggMeasureShorthand, y as OwnershipCheck, yt as RouteHandler, zt as AuthPluginOptions } from "./index-BtW7qYwa.mjs";
1
+ import { $t as SoftDeleteMixin, A as RequestIdOptions, B as defineResource, C as RequestContext, Ct as AggregationConfig, D as HealthCheck, Dt as AggregationMaterializedResult, E as GracefulShutdownOptions, Et as AggregationMaterializedContext, F as FastifyWithDecorators, Gt as ApiResponse, J as CrudRouteKey, Kt as ArcRequest, L as RequestWithExtras, N as FastifyRequestExtras, O as HealthOptions, Ot as AggregationRateLimit, P as FastifyWithAuth, Q as MiddlewareConfig, Qt as SoftDeleteExt, S as QueryParserInterface, St as AggregationCacheConfig, T as CrudRouterOptions, Tt as AggregationIndexHint, V as ResourceDefinition, Wt as AnyRecord, X as EventDefinition, Xt as UserOrganization, Y as CrudSchemas, Z as FieldRule, Zt as BaseController, _t as IControllerResponse, a as InferAdapterDoc, an as BulkMixin, at as ResourceConfig, bt as AggMeasureInput, c as TypedController, d as PaginationResult, dn as ArcDeleteResult, en as TreeExt, et as PresetFunction, f as IntrospectionData, fn as ArcGetResult, ft as RouteSchemaOptions, g as ArcInternalMetadata, gt as IController, h as ResourceMetadata, hn as ListResult, i as ValidationResult, in as BulkExt, k as IntrospectionPluginOptions, kt as AggregationsMap, l as TypedRepository, m as RegistryStats, mn as ArcUpdateResult, mt as ControllerLike, n as ConfigError, nn as SlugExt, nt as PresetResult, o as InferDocType, on as BaseControllerOptions, p as RegistryEntry, pn as ArcListResult, q as CrudController, qt as JWTPayload, r as ValidateOptions, rn as SlugMixin, rt as RateLimitConfig, s as InferResourceDoc, sn as BaseCrudController, t as RouteHandlerMethod, tn as TreeMixin, u as TypedResourceConfig, un as ArcCreateResult, vt as IRequestContext, w as ServiceContext, wt as AggregationDateRangeRequirement, xt as AggMeasureShorthand, y as OwnershipCheck, yt as RouteHandler, zt as AuthPluginOptions } from "./index-Dwc0orNd.mjs";
2
2
  import { a as applyFieldWritePermissions, c as PermissionCheck, d as UserBase, i as applyFieldReadPermissions, l as PermissionContext, n as FieldPermissionMap, o as fields, t as FieldPermission, u as PermissionResult } from "./fields-COhcH3fk.mjs";
3
- import { C as MAX_FILTER_DEPTH, D as MutationOperation, E as MUTATION_OPERATIONS, O as RESERVED_QUERY_PARAMS, S as HookPhase, T as MAX_SEARCH_LENGTH, _ as DEFAULT_TENANT_FIELD, a as getControllerScope, b as HOOK_PHASES, d as CRUD_OPERATIONS, f as CrudOperation, g as DEFAULT_SORT, h as DEFAULT_MAX_LIMIT, k as SYSTEM_FIELDS, m as DEFAULT_LIMIT, p as DEFAULT_ID_FIELD, s as defineResourceVariants, u as defineAggregation, v as DEFAULT_UPDATE_METHOD, w as MAX_REGEX_LENGTH, x as HookOperation, y as HOOK_OPERATIONS } from "./index-Ds61mrJE.mjs";
3
+ import { A as MAX_SEARCH_LENGTH, C as DEFAULT_UPDATE_METHOD, D as HookPhase, E as HookOperation, M as MutationOperation, N as RESERVED_QUERY_PARAMS, O as MAX_FILTER_DEPTH, P as SYSTEM_FIELDS, S as DEFAULT_TENANT_FIELD, T as HOOK_PHASES, _ as CrudOperation, b as DEFAULT_MAX_LIMIT, f as defineResourceVariants, g as CRUD_OPERATIONS, h as defineAggregation, j as MUTATION_OPERATIONS, k as MAX_REGEX_LENGTH, s as getControllerScope, v as DEFAULT_ID_FIELD, w as HOOK_OPERATIONS, x as DEFAULT_SORT, y as DEFAULT_LIMIT } from "./index-D1-Kp_dP.mjs";
4
4
  import { A as requireRoles, C as allOf, E as denyAll, M as when, O as requireAuth, S as createOrgPermissions, T as anyOf, a as presets_d_exports, c as readOnly, d as requireOrgRole, f as requireScopeContext, i as ownerWithAdminBypass, k as requireOwnership, l as requireOrgInScope, m as requireTeamMembership, n as authenticated, o as publicRead, p as requireServiceScope, r as fullPublic, s as publicReadAdminWrite, t as adminOnly, u as requireOrgMembership, v as DynamicPermissionMatrix, w as allowPublic, x as createDynamicPermissionMatrix, y as DynamicPermissionMatrixConfig } from "./index-BTqLEvhu.mjs";
5
- import { ct as NotFoundError, ht as createDomainError, it as ArcError, mt as ValidationError, pt as UnauthorizedError, st as ForbiddenError, t as getUserId } from "./index-Dz5IKsrE.mjs";
5
+ import { ct as NotFoundError, ht as createDomainError, it as ArcError, mt as ValidationError, pt as UnauthorizedError, st as ForbiddenError, t as getUserId } from "./index-Bt0F3nJj.mjs";
6
6
 
7
7
  //#region src/index.d.ts
8
8
  declare const version: string;
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  import { a as DEFAULT_SORT, c as HOOK_OPERATIONS, d as MAX_REGEX_LENGTH, f as MAX_SEARCH_LENGTH, h as SYSTEM_FIELDS, i as DEFAULT_MAX_LIMIT, l as HOOK_PHASES, m as RESERVED_QUERY_PARAMS, n as DEFAULT_ID_FIELD, o as DEFAULT_TENANT_FIELD, p as MUTATION_OPERATIONS, r as DEFAULT_LIMIT, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS, u as MAX_FILTER_DEPTH } from "./constants-Cxde4rpC.mjs";
2
2
  import { d as createDomainError, i as NotFoundError, l as UnauthorizedError, r as ForbiddenError, t as ArcError, u as ValidationError } from "./errors-j4aJm1Wg.mjs";
3
3
  import { t as getUserId } from "./utils-_h9B3c57.mjs";
4
- import { a as BulkMixin, i as SlugMixin, n as TreeMixin, o as BaseCrudController, r as SoftDeleteMixin, t as BaseController } from "./BaseController-DX_T-bDB.mjs";
4
+ import { a as BulkMixin, i as SlugMixin, n as TreeMixin, o as BaseCrudController, r as SoftDeleteMixin, t as BaseController } from "./BaseController-Dv60tU83.mjs";
5
5
  import { C as allowPublic, D as requireAuth, O as requireOwnership, S as allOf, T as denyAll, _ as requireOrgMembership, a as presets_exports, b as requireServiceScope, c as readOnly, d as applyFieldWritePermissions, f as fields, g as requireOrgInScope, h as createOrgPermissions, i as ownerWithAdminBypass, j as when, k as requireRoles, m as createDynamicPermissionMatrix, n as authenticated, o as publicRead, r as fullPublic, s as publicReadAdminWrite, t as adminOnly, u as applyFieldReadPermissions, v as requireOrgRole, w as anyOf, x as requireTeamMembership, y as requireScopeContext } from "./permissions-ohQyv50e.mjs";
6
- import { v as getControllerScope } from "./routerShared-D6_fEGHh.mjs";
7
- import { n as defineResource, o as defineAggregation, r as ResourceDefinition, t as defineResourceVariants } from "./core-D72ia0EH.mjs";
6
+ import { v as getControllerScope } from "./routerShared-DrOa-26E.mjs";
7
+ import { a as defineResource, i as defineResourceVariants, l as defineAggregation, o as ResourceDefinition } from "./core-DEdN6zKD.mjs";
8
8
  //#region src/index.ts
9
- const version = "2.13.1";
9
+ const version = "2.14.1";
10
10
  //#endregion
11
11
  export { ArcError, BaseController, BaseCrudController, BulkMixin, CRUD_OPERATIONS, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, ForbiddenError, HOOK_OPERATIONS, HOOK_PHASES, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, NotFoundError, RESERVED_QUERY_PARAMS, ResourceDefinition, SYSTEM_FIELDS, SlugMixin, SoftDeleteMixin, TreeMixin, UnauthorizedError, ValidationError, adminOnly, allOf, allowPublic, anyOf, applyFieldReadPermissions, applyFieldWritePermissions, authenticated, createDomainError, createDynamicPermissionMatrix, createOrgPermissions, defineAggregation, defineResource, defineResourceVariants, denyAll, fields, fullPublic, getControllerScope, getUserId, ownerWithAdminBypass, presets_exports as permissions, publicRead, publicReadAdminWrite, readOnly, requireAuth, requireOrgInScope, requireOrgMembership, requireOrgRole, requireOwnership, requireRoles, requireScopeContext, requireServiceScope, requireTeamMembership, version, when };
@@ -1,7 +1,7 @@
1
1
  import { a as WebSocketMessage, i as WebSocketClient, o as WebSocketPluginOptions } from "../websocket-ChC2rqe1.mjs";
2
2
  import { EventGatewayOptions } from "./event-gateway.mjs";
3
3
  import { JobDefinition, JobDispatchOptions, JobDispatcher, JobMeta, JobsPluginOptions, QueueStats } from "./jobs.mjs";
4
- import { c as McpResourceConfig, f as ToolAnnotations, i as CrudOperation, l as PromptDefinition, m as ToolDefinition, n as CallToolResult, o as McpAuthResult, p as ToolContext, r as CreateMcpServerConfig, s as McpPluginOptions, t as BetterAuthHandler } from "../types-DQHFc8PM.mjs";
4
+ import { c as McpResourceConfig, f as ToolAnnotations, i as CrudOperation, l as PromptDefinition, m as ToolDefinition, n as CallToolResult, o as McpAuthResult, p as ToolContext, r as CreateMcpServerConfig, s as McpPluginOptions, t as BetterAuthHandler } from "../types-C6ONJ_Z2.mjs";
5
5
  import { StreamlinePluginOptions, WorkflowLike, WorkflowRunLike } from "./streamline.mjs";
6
6
  import { WebhookDeliveryRecord, WebhookManager, WebhookPluginOptions, WebhookStore, WebhookSubscription } from "./webhooks.mjs";
7
7
  export { type BetterAuthHandler, type CallToolResult, type CreateMcpServerConfig, type CrudOperation, type EventGatewayOptions, type JobDefinition, type JobDispatchOptions, type JobDispatcher, type JobMeta, type JobsPluginOptions, type McpAuthResult, type McpPluginOptions, type McpResourceConfig, type PromptDefinition, type QueueStats, type StreamlinePluginOptions, type ToolAnnotations, type ToolContext, type ToolDefinition, type WebSocketClient, type WebSocketMessage, type WebSocketPluginOptions, type WebhookDeliveryRecord, type WebhookManager, type WebhookPluginOptions, type WebhookStore, type WebhookSubscription, type WorkflowLike, type WorkflowRunLike };
@@ -1,5 +1,5 @@
1
- import { V as ResourceDefinition } from "../../index-BtW7qYwa.mjs";
2
- import { a as McpAuthResolver, c as McpResourceConfig, d as SessionEntry, f as ToolAnnotations, i as CrudOperation, l as PromptDefinition, m as ToolDefinition, n as CallToolResult, o as McpAuthResult, p as ToolContext, r as CreateMcpServerConfig, s as McpPluginOptions, t as BetterAuthHandler, u as PromptResult } from "../../types-DQHFc8PM.mjs";
1
+ import { V as ResourceDefinition } from "../../index-Dwc0orNd.mjs";
2
+ import { a as McpAuthResolver, c as McpResourceConfig, d as SessionEntry, f as ToolAnnotations, i as CrudOperation, l as PromptDefinition, m as ToolDefinition, n as CallToolResult, o as McpAuthResult, p as ToolContext, r as CreateMcpServerConfig, s as McpPluginOptions, t as BetterAuthHandler, u as PromptResult } from "../../types-C6ONJ_Z2.mjs";
3
3
  import { FastifyPluginAsync } from "fastify";
4
4
  import { z } from "zod";
5
5
 
@@ -1,4 +1,4 @@
1
- import { n as fieldRulesToZod, r as createMcpServer, t as resourceToTools } from "../../resourceToTools-C5coh64w.mjs";
1
+ import { n as fieldRulesToZod, r as createMcpServer, t as resourceToTools } from "../../resourceToTools-CZ-ZhS7v.mjs";
2
2
  import { createHash, randomUUID } from "node:crypto";
3
3
  import fp from "fastify-plugin";
4
4
  //#region src/integrations/mcp/defineTool.ts
@@ -1,4 +1,4 @@
1
- import { o as McpAuthResult, s as McpPluginOptions } from "../../types-DQHFc8PM.mjs";
1
+ import { o as McpAuthResult, s as McpPluginOptions } from "../../types-C6ONJ_Z2.mjs";
2
2
 
3
3
  //#region src/integrations/mcp/testing.d.ts
4
4
  interface TestMcpClientOptions {
@@ -1,4 +1,4 @@
1
- import { r as createMcpServer, t as resourceToTools } from "../../resourceToTools-C5coh64w.mjs";
1
+ import { r as createMcpServer, t as resourceToTools } from "../../resourceToTools-CZ-ZhS7v.mjs";
2
2
  //#region src/integrations/mcp/testing.ts
3
3
  /**
4
4
  * @classytic/arc/mcp/testing — MCP Test Utilities
@@ -1,4 +1,4 @@
1
- import { I as MiddlewareHandler, L as RequestWithExtras, Q as MiddlewareConfig } from "../index-BtW7qYwa.mjs";
1
+ import { I as MiddlewareHandler, L as RequestWithExtras, Q as MiddlewareConfig } from "../index-Dwc0orNd.mjs";
2
2
  import { RouteHandlerMethod } from "fastify";
3
3
 
4
4
  //#region src/middleware/middleware.d.ts