@classytic/arc 2.33.0 → 2.35.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/dist/{BaseController-CaQC5EXX.mjs → BaseController-C-pofd0v.mjs} +131 -16
- package/dist/{EventTransport-tq4CEB-q.mjs → EventTransport-BrPeGUil.mjs} +1 -1
- package/dist/{HookSystem-DqXkMXkB.mjs → HookSystem-LlPm3Anm.mjs} +6 -4
- package/dist/{ResourceRegistry-DoALUlOO.mjs → ResourceRegistry-yuD1Ra53.mjs} +2 -2
- package/dist/{pipeline-q69DZzgG.mjs → actionPermissions-LFuOra7W.mjs} +30 -7
- package/dist/audit/index.d.mts +2 -2
- package/dist/audit/index.mjs +2 -2
- package/dist/auth/audit.mjs +1 -1
- package/dist/auth/index.d.mts +2 -2
- package/dist/auth/index.mjs +6 -6
- package/dist/auth/redis-session.mjs +1 -1
- package/dist/{authorizationDecision-B3mP_QTy.mjs → authorizationDecision-DYXBBgtg.mjs} +6 -2
- package/dist/{base-Csjc2oF-.d.mts → base-GZU3LlzP.d.mts} +1 -1
- package/dist/{buildHandler-DLE9xX-V.mjs → buildHandler-Do9aMIvL.mjs} +4 -4
- package/dist/cache/index.mjs +4 -4
- package/dist/{caching-BcGmvnHh.mjs → caching-cN5X9VEL.mjs} +2 -2
- package/dist/cleanup/index.d.mts +2 -2
- package/dist/cleanup/index.mjs +4 -4
- package/dist/cli/commands/describe.d.mts +1 -1
- package/dist/cli/commands/describe.mjs +3 -3
- package/dist/cli/commands/docs.mjs +3 -3
- package/dist/cli/commands/doctor.mjs +1 -1
- package/dist/cli/commands/generate.mjs +2 -2
- package/dist/cli/commands/init.mjs +2 -2
- package/dist/cli/commands/introspect.mjs +2 -2
- package/dist/cli/index.mjs +3 -3
- package/dist/{constants-BxCoxmiN.mjs → constants-BhzLXCfN.mjs} +1 -1
- package/dist/context/index.d.mts +16 -1
- package/dist/context/index.mjs +64 -4
- package/dist/core/index.d.mts +3 -3
- package/dist/core/index.mjs +8 -8
- package/dist/{core-dxhcHhUD.mjs → core-DdEvmmkY.mjs} +3 -3
- package/dist/{createActionRouter-DVpoA0do.mjs → createActionRouter-EYWgd0ly.mjs} +27 -64
- package/dist/{createAggregationRouter-B_B48JZ-.mjs → createAggregationRouter-ByOK9Iev.mjs} +7 -7
- package/dist/defineAggregation-DoIijIFq.mjs +25 -0
- package/dist/{defineResource-DR9vsUYy.mjs → defineResource-BOrGeocE.mjs} +62 -66
- package/dist/discovery/index.mjs +1 -1
- package/dist/docs/index.d.mts +1 -1
- package/dist/docs/index.mjs +3 -3
- package/dist/{elevation-B0tlY8y1.mjs → elevation-tGIAldco.mjs} +4 -4
- package/dist/encryption/index.mjs +3 -3
- package/dist/{errorHandler-C7xBqHsI.mjs → errorHandler-BbQ1nQdk.mjs} +3 -3
- package/dist/{errors-Cd_yy7aW.mjs → errors-CLid6atr.mjs} +1 -1
- package/dist/{eventPlugin-DSNEZWfV.d.mts → eventPlugin-B47sfCJ8.d.mts} +1 -1
- package/dist/{eventPlugin-Dar8qRaj.mjs → eventPlugin-ClPn5kjn.mjs} +5 -5
- package/dist/events/index.d.mts +2 -2
- package/dist/events/index.mjs +5 -5
- package/dist/events/transports/redis-stream-entry.mjs +1 -1
- package/dist/events/transports/redis.mjs +1 -1
- package/dist/factory/index.d.mts +5 -5
- package/dist/factory/index.mjs +5 -6
- package/dist/{fastify-augmentation-DVsTAy6X.d.mts → fastify-augmentation-CMMTL3cj.d.mts} +3 -3
- package/dist/{fields-CojeUkS4.mjs → fields-UtpiJO5R.mjs} +1 -1
- package/dist/{generate-DiB0nHPR.mjs → generate-BoAVy3_b.mjs} +2 -2
- package/dist/{headers-CveNO9gR.mjs → headers-DODWf7aC.mjs} +2 -2
- package/dist/{health-CasG2A28.mjs → health-_Zs3R_Sb.mjs} +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/idempotency/index.mjs +23 -58
- package/dist/idempotency/redis.mjs +1 -1
- package/dist/{index-C5NnMEKF.d.mts → index-C50BUxKs.d.mts} +1 -1
- package/dist/{index-BcR2bFZQ.d.mts → index-C5K78SXo.d.mts} +33 -105
- package/dist/{index-ugr1tQlW.d.mts → index-CJCcbADG.d.mts} +1 -1
- package/dist/{index-B-DvUzsr.d.mts → index-K7auNNW0.d.mts} +2 -2
- package/dist/{index-Brin0ODU.d.mts → index-h-mTgMqy.d.mts} +21 -31
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +12 -12
- package/dist/{init-mdJ-v4Xp.mjs → init-Ce4R0ZGK.mjs} +1 -1
- package/dist/integrations/event-gateway.mjs +2 -2
- package/dist/integrations/index.d.mts +2 -2
- package/dist/integrations/index.mjs +1 -1
- package/dist/integrations/jobs/index.d.mts +1 -1
- package/dist/integrations/jobs/index.mjs +2 -2
- package/dist/integrations/mcp/index.d.mts +4 -4
- package/dist/integrations/mcp/index.mjs +2 -2
- package/dist/integrations/mcp/testing.d.mts +1 -1
- package/dist/integrations/mcp/testing.mjs +3 -3
- package/dist/integrations/streamline.mjs +3 -3
- package/dist/integrations/webhooks.d.mts +1 -1
- package/dist/integrations/webhooks.mjs +11 -24
- package/dist/integrations/websocket-pushref-redis.mjs +1 -1
- package/dist/integrations/websocket-redis.mjs +1 -1
- package/dist/integrations/websocket.mjs +1 -1
- package/dist/{interface-DznJrm9R.mjs → interface-my7sxjw5.mjs} +1 -1
- package/dist/{jsonBody-CfGH-GxO.mjs → jsonBody-CVKA7C5m.mjs} +2 -2
- package/dist/{keys-WeKvY1dE.mjs → keys-GlU7XpmG.mjs} +1 -1
- package/dist/{loadResources-Bj-aSsXi.mjs → loadResources-DdQb0qgV.mjs} +2 -2
- package/dist/{loadResourcesFromEntry-DwaxNcE2.mjs → loadResourcesFromEntry-s6aGs6-0.mjs} +2 -2
- package/dist/logger/index.d.mts +23 -4
- package/dist/logger/index.mjs +50 -7
- package/dist/{mcpPlugin-aJg5TqHi.mjs → mcpPlugin-DkzZ7Nfx.mjs} +15 -16
- package/dist/{memory-qYSB7rMQ.mjs → memory-BwedEXau.mjs} +2 -2
- package/dist/{metrics-D7uchLjN.mjs → metrics-5LNPvL3P.mjs} +2 -2
- package/dist/middleware/index.d.mts +1 -1
- package/dist/middleware/index.mjs +3 -3
- package/dist/migrations/index.mjs +7 -4
- package/dist/{module-CwKsgZXp.mjs → module-Bh5OC7ww.mjs} +1 -1
- package/dist/{multipartBody-4w-S3-PU.mjs → multipartBody-DjilSDAT.mjs} +1 -1
- package/dist/{openapi-BN5cQaO2.mjs → openapi-ItLH12_L.mjs} +6 -6
- package/dist/outbox-admin/index.d.mts +2 -2
- package/dist/outbox-admin/index.mjs +4 -4
- package/dist/{outbox-module-CXB79bvt.mjs → outbox-module-SGIZz6oS.mjs} +14 -5
- package/dist/{outbox-module-D-VFq37T.d.mts → outbox-module-b1TyDGGi.d.mts} +40 -3
- package/dist/permissions/index.d.mts +2 -2
- package/dist/permissions/index.mjs +5 -5
- package/dist/{permissions-BAfwgBxc.mjs → permissions-CpSBlFXZ.mjs} +6 -6
- package/dist/{pipe-BzzoEhHj.mjs → pipe-DNOuCfAs.mjs} +2 -2
- package/dist/pipeline/index.d.mts +1 -1
- package/dist/pipeline/index.mjs +2 -2
- package/dist/plugins/index.d.mts +92 -7
- package/dist/plugins/index.mjs +168 -17
- package/dist/plugins/response-cache.mjs +2 -2
- package/dist/plugins/tracing-entry.mjs +2 -2
- package/dist/{pluralize-B7xf8qZF.mjs → pluralize-DGAQQKL8.mjs} +1 -1
- package/dist/{preloadResources-g07ldtzh.d.mts → preloadResources--ZtY9pe9.d.mts} +54 -270
- package/dist/{createApp-CLGegqiG.mjs → preloadResources-DYMzmUk1.mjs} +112 -31
- package/dist/presets/filesUpload.d.mts +3 -3
- package/dist/presets/filesUpload.mjs +5 -5
- package/dist/presets/index.d.mts +2 -2
- package/dist/presets/index.mjs +2 -2
- package/dist/presets/multiTenant.d.mts +1 -1
- package/dist/presets/multiTenant.mjs +3 -3
- package/dist/presets/search.d.mts +9 -47
- package/dist/presets/search.mjs +2 -2
- package/dist/{presets-D-h0uWtP.mjs → presets-Bi0Z6Iq8.mjs} +4 -4
- package/dist/{projection-BKM0Ui-s.mjs → projection-aevMua7Q.mjs} +2 -2
- package/dist/{queryCachePlugin-DhsZ0ZIc.mjs → queryCachePlugin-BI7Z88Cx.mjs} +5 -5
- package/dist/{rateLimitKey-XngqVNEV.mjs → rateLimitKey-pyevMUVf.mjs} +1 -1
- package/dist/{realtime-CTkv3O59.mjs → realtime-Cfl2bVjj.mjs} +9 -9
- package/dist/{rateLimit-D4-ASwsI.mjs → registerRoute-u1opU66a.mjs} +114 -3
- package/dist/registry/index.d.mts +2 -2
- package/dist/registry/index.mjs +3 -3
- package/dist/{registry-CLxCR5LF.mjs → registry-B4sf9Rfm.mjs} +15 -56
- package/dist/{renewingLease-BnWtbA2U.mjs → renewingLease-5ESPMxp0.mjs} +14 -2
- package/dist/{replyHelpers-BSBVCwL3.mjs → replyHelpers-2jfmMnnV.mjs} +2 -2
- package/dist/{requestContext-uYE35JxI.mjs → requestContext-DzOUGNdY.mjs} +1 -1
- package/dist/{rolldown-runtime-DNg-KNCk.mjs → rolldown-runtime-CEvvVXTC.mjs} +1 -1
- package/dist/{runtimeCapabilities-Dm88DaTW.mjs → runtimeCapabilities-BagWc3TI.mjs} +1 -1
- package/dist/{schedules-CAcZgia0.mjs → schedules-BLpZLWGF.mjs} +6 -4
- package/dist/{schemaConverter-XH1RZRyu.mjs → schemaConverter-D2_bHGil.mjs} +19 -32
- package/dist/{schemaIR-CDvclAew.mjs → schemaIR-s3-ouZmP.mjs} +2 -2
- package/dist/schemas/index.mjs +1 -1
- package/dist/scim/index.mjs +2 -2
- package/dist/scope/index.d.mts +1 -1
- package/dist/scope/index.mjs +5 -5
- package/dist/{scope-BaWcqBvr.mjs → scope-DgepeCv6.mjs} +4 -4
- package/dist/simpleEqualityMatcher-BO-sFTQf.mjs +43 -0
- package/dist/{sse-Cf0jUHsh.mjs → sse-DUIP1XH6.mjs} +5 -5
- package/dist/{sseStream-Bvpi-UXQ.mjs → sseStream-ByFGyIVr.mjs} +2 -2
- package/dist/{store-helpers-B88p99Z2.mjs → store-helpers-kIJCY0wI.mjs} +1 -1
- package/dist/{streaming-DsT1B5zJ.mjs → streaming-DOpZVht6.mjs} +1 -1
- package/dist/{subscribe-helpers-CLIOHsOK.mjs → subscribe-helpers-Dh2BnzJf.mjs} +12 -46
- package/dist/sync/changelog.mjs +1 -1
- package/dist/testing/cleanupStoreContract.mjs +1 -1
- package/dist/testing/index.d.mts +6 -6
- package/dist/testing/index.mjs +10 -11
- package/dist/testing/outboxStoreContract.mjs +1 -1
- package/dist/testing/storageContract.mjs +1 -1
- package/dist/{transactionContext-BYtWnwAS.mjs → transactionContext-BTZzEcRo.mjs} +1 -1
- package/dist/{typeGuards-jjKJDN13.mjs → typeGuards-B-_jqaMi.mjs} +1 -1
- package/dist/types/index.d.mts +3 -3
- package/dist/types/index.mjs +1 -1
- package/dist/types/storage.mjs +1 -1
- package/dist/{types-BcTumAz_.d.mts → types-DDD5RKTu.d.mts} +30 -87
- package/dist/{types-BfC83KsP.d.mts → types-DSvHH0uR.d.mts} +1 -1
- package/dist/{types-ChuShpCP.d.mts → types-Ddl9OjmE.d.mts} +18 -121
- package/dist/{types-CoqIRrkY.mjs → types-GY4kATJb.mjs} +10 -53
- package/dist/usage/index.d.mts +2 -2
- package/dist/usage/index.mjs +0 -0
- package/dist/{userHelpers-CWF5pbZD.mjs → userHelpers-AKcB4V03.mjs} +1 -1
- package/dist/utils/index.d.mts +16 -42
- package/dist/utils/index.mjs +11 -11
- package/dist/{utils-h1V_sT-t.mjs → utils-CBK9HQOI.mjs} +3 -3
- package/dist/{validate-CdQlz52F.mjs → validate-dosAIvQU.mjs} +2 -2
- package/dist/{versioning-rZbyLVD-.mjs → versioning-BbTs4pwM.mjs} +3 -3
- package/package.json +8 -8
- package/skills/arc/SKILL.md +9 -9
- package/skills/arc/references/api-reference.md +1 -1
- package/dist/actionPermissions-CUeCmpUd.mjs +0 -25
- package/dist/defineAggregation-Nv-DwfOf.mjs +0 -48
- package/dist/preloadResources-BkyqeTDz.mjs +0 -46
- package/dist/registerRoute-DNnd3vkz.mjs +0 -113
- package/dist/repositoryFilter-DKny7PDn.mjs +0 -45
- package/dist/simpleEqualityMatcher-Se8VrsaP.mjs +0 -69
package/dist/core/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
import { $t as AccessControlConfig, B as defineResource, Bt as BaseController, Cn as ControllerConstructionOptions, En as BodySanitizerConfig, Gt as SlugExt, Ht as SoftDeleteMixin, Jt as BulkMixin, Kt as SlugMixin, Qt as AccessControl, Sn as ControllerConfigurableOptions, Tn as BodySanitizer, Ut as TreeExt, V as ResourceDefinition, Vt as SoftDeleteExt, Wt as TreeMixin, Xt as QueryResolver, Yt as BaseCrudController, Zt as QueryResolverConfig, ct as AggMeasureShorthand, dt as AggregationDateRangeRequirement, ft as AggregationIndexHint, gt as AggregationsMap, ht as AggregationRateLimit, lt as AggregationCacheConfig, mt as AggregationMaterializedResult, pt as AggregationMaterializedContext, qt as BulkExt, st as AggMeasureInput, ut as AggregationConfig, wn as ListResult, xn as BaseControllerOptions } from "../index-
|
|
3
|
-
import { A as
|
|
4
|
-
export { AccessControl, type AccessControlConfig, type AdapterLike, type AggMeasureInput, type AggMeasureShorthand, type AggregationCacheConfig, type AggregationConfig, type AggregationDateRangeRequirement, type AggregationIndexHint, type AggregationMaterializedContext, type AggregationMaterializedResult, type AggregationRateLimit, type AggregationsMap, BaseController, type BaseControllerOptions, BaseCrudController, BodySanitizer, type BodySanitizerConfig, type BulkExt, BulkMixin, CRUD_OPERATIONS, type ConfigError, type ControllerConfigurableOptions, type ControllerConstructionOptions, CrudOperation, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, type DefineActionConfig, HOOK_OPERATIONS, HOOK_PHASES, HookOperation, HookPhase, type ListResult, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, MutationOperation, QueryResolver, type QueryResolverConfig, RESERVED_QUERY_PARAMS, ResourceDefinition, type ResourceSeams, SYSTEM_FIELDS, type SeamedResourceConfig, type SlugExt, SlugMixin, type SoftDeleteExt, SoftDeleteMixin, type TreeExt, TreeMixin, type ValidateOptions, type ValidationResult, assertValidConfig, collectReadBlockedFields, createCrudHandlers, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAction, defineAggregation, defineResource, defineResourceVariants, formatValidationErrors, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, mergeResourceConfig, sendControllerResponse, validateResourceConfig };
|
|
2
|
+
import { $t as AccessControlConfig, B as defineResource, Bt as BaseController, Cn as ControllerConstructionOptions, En as BodySanitizerConfig, Gt as SlugExt, Ht as SoftDeleteMixin, Jt as BulkMixin, Kt as SlugMixin, Qt as AccessControl, Sn as ControllerConfigurableOptions, Tn as BodySanitizer, Ut as TreeExt, V as ResourceDefinition, Vt as SoftDeleteExt, Wt as TreeMixin, Xt as QueryResolver, Yt as BaseCrudController, Zt as QueryResolverConfig, ct as AggMeasureShorthand, dt as AggregationDateRangeRequirement, ft as AggregationIndexHint, gt as AggregationsMap, ht as AggregationRateLimit, lt as AggregationCacheConfig, mt as AggregationMaterializedResult, pt as AggregationMaterializedContext, qt as BulkExt, st as AggMeasureInput, ut as AggregationConfig, wn as ListResult, xn as BaseControllerOptions } from "../index-C5K78SXo.mjs";
|
|
3
|
+
import { A as CRUD_OPERATIONS, B as HookOperation, C as SeamedResourceConfig, D as createCrudRouter, E as defineAction, F as DEFAULT_SORT, G as MUTATION_OPERATIONS, H as MAX_FILTER_DEPTH, I as DEFAULT_TENANT_FIELD, J as SYSTEM_FIELDS, K as MutationOperation, L as DEFAULT_UPDATE_METHOD, M as DEFAULT_ID_FIELD, N as DEFAULT_LIMIT, O as createPermissionMiddleware, P as DEFAULT_MAX_LIMIT, R as HOOK_OPERATIONS, S as ResourceSeams, T as DefineActionConfig, U as MAX_REGEX_LENGTH, V as HookPhase, W as MAX_SEARCH_LENGTH, _ as getEntityId, a as formatValidationErrors, b as defineResourceVariants, c as nativePolicyFilter, d as createCrudHandlers, f as createFastifyHandler, g as sendControllerResponse, h as getControllerScope, i as assertValidConfig, j as CrudOperation, k as defineAggregation, l as collectReadBlockedFields, m as getControllerContext, n as ValidateOptions, o as validateResourceConfig, p as createRequestContext, q as RESERVED_QUERY_PARAMS, r as ValidationResult, s as NativePolicyFilter, t as ConfigError, u as isFieldReadable, v as getEntityIdField, w as mergeResourceConfig, x as AdapterLike, y as getEntityQuery, z as HOOK_PHASES } from "../index-h-mTgMqy.mjs";
|
|
4
|
+
export { AccessControl, type AccessControlConfig, type AdapterLike, type AggMeasureInput, type AggMeasureShorthand, type AggregationCacheConfig, type AggregationConfig, type AggregationDateRangeRequirement, type AggregationIndexHint, type AggregationMaterializedContext, type AggregationMaterializedResult, type AggregationRateLimit, type AggregationsMap, BaseController, type BaseControllerOptions, BaseCrudController, BodySanitizer, type BodySanitizerConfig, type BulkExt, BulkMixin, CRUD_OPERATIONS, type ConfigError, type ControllerConfigurableOptions, type ControllerConstructionOptions, CrudOperation, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, type DefineActionConfig, HOOK_OPERATIONS, HOOK_PHASES, HookOperation, HookPhase, type ListResult, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, MutationOperation, type NativePolicyFilter, QueryResolver, type QueryResolverConfig, RESERVED_QUERY_PARAMS, ResourceDefinition, type ResourceSeams, SYSTEM_FIELDS, type SeamedResourceConfig, type SlugExt, SlugMixin, type SoftDeleteExt, SoftDeleteMixin, type TreeExt, TreeMixin, type ValidateOptions, type ValidationResult, assertValidConfig, collectReadBlockedFields, createCrudHandlers, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAction, defineAggregation, defineResource, defineResourceVariants, formatValidationErrors, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, mergeResourceConfig, nativePolicyFilter, sendControllerResponse, validateResourceConfig };
|
package/dist/core/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
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-
|
|
3
|
-
import { a as BulkMixin, c as collectReadBlockedFields, f as BodySanitizer, i as SlugMixin, l as isFieldReadable, m as AccessControl, n as TreeMixin, o as BaseCrudController, r as SoftDeleteMixin, s as QueryResolver, t as BaseController } from "../BaseController-
|
|
4
|
-
import { a as ResourceDefinition, i as validateResourceConfig, n as assertValidConfig, o as createCrudRouter, r as formatValidationErrors, s as createPermissionMiddleware, t as defineResource } from "../defineResource-
|
|
5
|
-
import { a as
|
|
6
|
-
import { t as defineAggregation } from "../defineAggregation-
|
|
7
|
-
import { a as mergeResourceConfig, i as defineResourceVariants, n as getEntityIdField, o as defineAction, r as getEntityQuery, t as getEntityId } from "../core-
|
|
8
|
-
export { AccessControl, BaseController, BaseCrudController, BodySanitizer, BulkMixin, CRUD_OPERATIONS, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, HOOK_OPERATIONS, HOOK_PHASES, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, QueryResolver, RESERVED_QUERY_PARAMS, ResourceDefinition, SYSTEM_FIELDS, SlugMixin, SoftDeleteMixin, TreeMixin, assertValidConfig, collectReadBlockedFields, createCrudHandlers, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAction, defineAggregation, defineResource, defineResourceVariants, formatValidationErrors, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, mergeResourceConfig, sendControllerResponse, validateResourceConfig };
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
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-BhzLXCfN.mjs";
|
|
3
|
+
import { a as BulkMixin, c as collectReadBlockedFields, f as BodySanitizer, h as nativePolicyFilter, i as SlugMixin, l as isFieldReadable, m as AccessControl, n as TreeMixin, o as BaseCrudController, r as SoftDeleteMixin, s as QueryResolver, t as BaseController } from "../BaseController-C-pofd0v.mjs";
|
|
4
|
+
import { a as ResourceDefinition, i as validateResourceConfig, n as assertValidConfig, o as createCrudRouter, r as formatValidationErrors, s as createPermissionMiddleware, t as defineResource } from "../defineResource-BOrGeocE.mjs";
|
|
5
|
+
import { a as createCrudHandlers, c as getControllerContext, l as getControllerScope, o as createFastifyHandler, s as createRequestContext, u as sendControllerResponse } from "../actionPermissions-LFuOra7W.mjs";
|
|
6
|
+
import { t as defineAggregation } from "../defineAggregation-DoIijIFq.mjs";
|
|
7
|
+
import { a as mergeResourceConfig, i as defineResourceVariants, n as getEntityIdField, o as defineAction, r as getEntityQuery, t as getEntityId } from "../core-DdEvmmkY.mjs";
|
|
8
|
+
export { AccessControl, BaseController, BaseCrudController, BodySanitizer, BulkMixin, CRUD_OPERATIONS, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, HOOK_OPERATIONS, HOOK_PHASES, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, QueryResolver, RESERVED_QUERY_PARAMS, ResourceDefinition, SYSTEM_FIELDS, SlugMixin, SoftDeleteMixin, TreeMixin, assertValidConfig, collectReadBlockedFields, createCrudHandlers, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAction, defineAggregation, defineResource, defineResourceVariants, formatValidationErrors, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, mergeResourceConfig, nativePolicyFilter, sendControllerResponse, validateResourceConfig };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import "./constants-
|
|
3
|
-
import { t as defineResource } from "./defineResource-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import "./constants-BhzLXCfN.mjs";
|
|
3
|
+
import { t as defineResource } from "./defineResource-BOrGeocE.mjs";
|
|
4
4
|
//#region src/core/defineAction.ts
|
|
5
5
|
/**
|
|
6
6
|
* Build an `ActionDefinition` with a typed handler. The literal schema
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
3
|
-
import "./constants-
|
|
4
|
-
import { f as createError } from "./errors-
|
|
5
|
-
import { a as
|
|
6
|
-
import { n as
|
|
7
|
-
import {
|
|
8
|
-
import { n as schemaIRToJsonSchemaBranch, t as normalizeSchemaIR } from "./schemaIR-CDvclAew.mjs";
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-CEvvVXTC.mjs";
|
|
3
|
+
import "./constants-BhzLXCfN.mjs";
|
|
4
|
+
import { f as createError } from "./errors-CLid6atr.mjs";
|
|
5
|
+
import { a as selectPluginMw, c as buildRouteHooks, f as buildAuthMiddlewareForPermissions, i as resolveRouterPluginMw, n as buildRateLimitConfig, o as buildActionPermissionMw, p as buildArcDecorator, r as buildRouteConfig, t as tryRegisterRoute, u as routeHookOptions } from "./registerRoute-u1opU66a.mjs";
|
|
6
|
+
import { i as resolvePipelineSteps, n as buildActionPipelineHandler, u as sendControllerResponse } from "./actionPermissions-LFuOra7W.mjs";
|
|
7
|
+
import { n as schemaIRToJsonSchemaBranch, t as normalizeSchemaIR } from "./schemaIR-s3-ouZmP.mjs";
|
|
9
8
|
//#region src/core/createActionRouter.ts
|
|
10
9
|
var createActionRouter_exports = /* @__PURE__ */ __exportAll({
|
|
11
10
|
buildActionBodySchema: () => buildActionBodySchema,
|
|
@@ -186,65 +185,29 @@ function createActionRouter(fastify, config) {
|
|
|
186
185
|
});
|
|
187
186
|
}
|
|
188
187
|
/**
|
|
189
|
-
*
|
|
188
|
+
* Discriminated body schema for the unified action endpoint: a top-level
|
|
189
|
+
* `action` enum plus a `oneOf` branch per action, each branch pinning
|
|
190
|
+
* `action: { const }` and carrying its own `required`.
|
|
190
191
|
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
* "oneOf": [
|
|
201
|
-
* {
|
|
202
|
-
* "properties": {
|
|
203
|
-
* "action": { "const": "dispatch" },
|
|
204
|
-
* "carrier": { "type": "string" } // ← every branch lists the union
|
|
205
|
-
* },
|
|
206
|
-
* "required": ["action", "carrier"]
|
|
207
|
-
* },
|
|
208
|
-
* {
|
|
209
|
-
* "properties": {
|
|
210
|
-
* "action": { "const": "approve" },
|
|
211
|
-
* "carrier": { "type": "string" } // ← even though approve doesn't use it
|
|
212
|
-
* },
|
|
213
|
-
* "required": ["action"]
|
|
214
|
-
* }
|
|
215
|
-
* ]
|
|
216
|
-
* }
|
|
217
|
-
* ```
|
|
192
|
+
* EVERY BRANCH LISTS THE FULL PROPERTY UNION — the non-obvious part. AJV's
|
|
193
|
+
* `removeAdditional: 'all'` (Fastify's default) strips a field during a
|
|
194
|
+
* branch's evaluation when that branch's `properties` omits it, EVEN IF
|
|
195
|
+
* another branch would have allowed it. The strip mutates the body before
|
|
196
|
+
* `oneOf` finishes discriminating, so the winning branch receives a body that
|
|
197
|
+
* has already lost fields: `POST { action: 'hold', amount, reason }` arrived at
|
|
198
|
+
* the handler as `{ action: 'hold' }`. Listing every action's properties on
|
|
199
|
+
* every branch makes each walk see every field as its own, so nothing is
|
|
200
|
+
* stripped; `required` stays per-action, so dispatch still gates correctly.
|
|
218
201
|
*
|
|
219
|
-
*
|
|
220
|
-
* `removeAdditional: 'all'`
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
* `oneOf` finishes discriminating, so by the time the matching branch
|
|
225
|
-
* wins, the body has already lost fields. Concretely: `actions: { verify:
|
|
226
|
-
* {}, hold: { schema: z.object({ amount, reason }.optional()) } }` +
|
|
227
|
-
* `POST { action: 'hold', amount: 1, reason }` lands at the handler as
|
|
228
|
-
* `{ action: 'hold' }`. Empirically reproduced and locked at
|
|
229
|
-
* [tests/core/action-discriminator-strip.test.ts](../../tests/core/action-discriminator-strip.test.ts).
|
|
202
|
+
* Per-branch `additionalProperties: false` survives but cannot reject
|
|
203
|
+
* sibling-action fields under host `removeAdditional: 'all'` — those strip at
|
|
204
|
+
* top level instead. That is the host's opt-in; arc's job is only to stop
|
|
205
|
+
* losing an action's OWN declared fields. Under arc's `createApp`
|
|
206
|
+
* (`removeAdditional: false`) strict rejection works normally.
|
|
230
207
|
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
* `required` array stays per-action, so the handler still gets called
|
|
235
|
-
* only when the matching branch's required-field contract is satisfied.
|
|
236
|
-
* Per-branch `additionalProperties: false` (Zod v4 default) carries
|
|
237
|
-
* through but, under host removeAdditional: 'all', it can no longer
|
|
238
|
-
* reject sibling-action fields — those become silently stripped at top
|
|
239
|
-
* level instead. That's the host's opt-in to stripping; arc's job is to
|
|
240
|
-
* stop accidentally losing the action's *own* declared fields.
|
|
241
|
-
*
|
|
242
|
-
* Under arc's own `createApp` (`removeAdditional: false`), strict-mode
|
|
243
|
-
* rejection still functions normally — see
|
|
244
|
-
* [tests/core/action-strict-schema-parity.test.ts](../../tests/core/action-strict-schema-parity.test.ts).
|
|
245
|
-
*
|
|
246
|
-
* Exported so OpenAPI generation and MCP tool generation can reuse the same
|
|
247
|
-
* schema shape (single source of truth).
|
|
208
|
+
* Pinned by `tests/core/action-discriminator-strip.test.ts` and
|
|
209
|
+
* `action-strict-schema-parity.test.ts`. Exported so OpenAPI and MCP tool
|
|
210
|
+
* generation reuse one shape.
|
|
248
211
|
*/
|
|
249
212
|
function buildActionBodySchema(actionEnum, actionSchemas = {}) {
|
|
250
213
|
const unionProperties = {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { n as evaluateAndApplyPermission } from "./authorizationDecision-
|
|
3
|
-
import { f as createError } from "./errors-
|
|
4
|
-
import { u as getRequestScope } from "./types-
|
|
5
|
-
import { a as
|
|
6
|
-
import { n as validateAggregations } from "./validate-
|
|
7
|
-
import { t as buildAggregationHandler } from "./buildHandler-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as evaluateAndApplyPermission } from "./authorizationDecision-DYXBBgtg.mjs";
|
|
3
|
+
import { f as createError } from "./errors-CLid6atr.mjs";
|
|
4
|
+
import { u as getRequestScope } from "./types-GY4kATJb.mjs";
|
|
5
|
+
import { a as selectPluginMw, c as buildRouteHooks, d as buildAuthMiddleware, i as resolveRouterPluginMw, n as buildRateLimitConfig, p as buildArcDecorator, u as routeHookOptions } from "./registerRoute-u1opU66a.mjs";
|
|
6
|
+
import { n as validateAggregations } from "./validate-dosAIvQU.mjs";
|
|
7
|
+
import { t as buildAggregationHandler } from "./buildHandler-Do9aMIvL.mjs";
|
|
8
8
|
//#region src/core/aggregation/createAggregationRouter.ts
|
|
9
9
|
/**
|
|
10
10
|
* Register one Fastify route per aggregation. No-op when the map is
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
//#region src/core/aggregation/defineAggregation.ts
|
|
3
|
+
/**
|
|
4
|
+
* Declare a single resource aggregation. Exported configs flow into
|
|
5
|
+
* `defineResource({ aggregations: { ... } })` either as named keys or
|
|
6
|
+
* via auto-discovery patterns (loadAggregations — future).
|
|
7
|
+
*
|
|
8
|
+
* A namespace import lets many live in their own files and flow in at once
|
|
9
|
+
* (`import * as aggregations` → `defineResource({ aggregations })`).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* export const revenueByStatus = defineAggregation({
|
|
14
|
+
* groupBy: 'status',
|
|
15
|
+
* measures: { count: 'count', revenue: 'sum:totalPrice' },
|
|
16
|
+
* permissions: requireRoles(['admin']),
|
|
17
|
+
* cache: { staleTime: 60 },
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
function defineAggregation(config) {
|
|
22
|
+
return config;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { defineAggregation as t };
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { p as MUTATION_OPERATIONS, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS } from "./constants-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { p as MUTATION_OPERATIONS, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS } from "./constants-BhzLXCfN.mjs";
|
|
3
3
|
import { arcLog } from "./logger/index.mjs";
|
|
4
|
-
import { r as ForbiddenError } from "./errors-
|
|
5
|
-
import { n as getUserRoles } from "./userHelpers-
|
|
6
|
-
import { b as isElevated, n as PUBLIC_SCOPE, x as isMember } from "./types-
|
|
7
|
-
import { d as isWriteVerbCapable, p as DEFAULT_FIELD_WRITE_DENIAL_POLICY, t as BaseController, u as detectOverriddenWriteSlots } from "./BaseController-
|
|
8
|
-
import { a as
|
|
9
|
-
import { i as resolveEffectiveRoles, n as applyFieldWritePermissions } from "./fields-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { t as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { t as pluralize } from "./pluralize-B7xf8qZF.mjs";
|
|
19
|
-
import { t as resolveActionPermission } from "./actionPermissions-CUeCmpUd.mjs";
|
|
4
|
+
import { r as ForbiddenError } from "./errors-CLid6atr.mjs";
|
|
5
|
+
import { n as getUserRoles } from "./userHelpers-AKcB4V03.mjs";
|
|
6
|
+
import { b as isElevated, n as PUBLIC_SCOPE, x as isMember } from "./types-GY4kATJb.mjs";
|
|
7
|
+
import { d as isWriteVerbCapable, p as DEFAULT_FIELD_WRITE_DENIAL_POLICY, t as BaseController, u as detectOverriddenWriteSlots } from "./BaseController-C-pofd0v.mjs";
|
|
8
|
+
import { a as selectPluginMw, c as buildRouteHooks, d as buildAuthMiddleware, i as resolveRouterPluginMw, l as resolveRoutePreHandlers, n as buildRateLimitConfig, p as buildArcDecorator, r as buildRouteConfig, s as buildCrudPermissionMw, t as tryRegisterRoute, u as routeHookOptions } from "./registerRoute-u1opU66a.mjs";
|
|
9
|
+
import { i as resolveEffectiveRoles, n as applyFieldWritePermissions } from "./fields-UtpiJO5R.mjs";
|
|
10
|
+
import { c as getDefaultCrudSchemas } from "./utils-CBK9HQOI.mjs";
|
|
11
|
+
import { n as convertRouteSchema, r as ensureSchemaConverter, t as convertOpenApiSchemas } from "./schemaConverter-D2_bHGil.mjs";
|
|
12
|
+
import { i as pipeUIMessageStreamToReply, r as isReadableStream } from "./streaming-DOpZVht6.mjs";
|
|
13
|
+
import { t as hasEvents } from "./typeGuards-B-_jqaMi.mjs";
|
|
14
|
+
import { a as createCrudHandlers, i as resolvePipelineSteps, o as createFastifyHandler, r as buildPipelineHandler, s as createRequestContext, t as resolveActionPermission } from "./actionPermissions-LFuOra7W.mjs";
|
|
15
|
+
import { B as requireAuth } from "./permissions-CpSBlFXZ.mjs";
|
|
16
|
+
import { r as getAvailablePresets, t as applyPresets } from "./presets-Bi0Z6Iq8.mjs";
|
|
17
|
+
import { t as pluralize } from "./pluralize-DGAQQKL8.mjs";
|
|
20
18
|
import { isReadOnlyRepo } from "@classytic/repo-core/repository";
|
|
21
19
|
//#region src/core/middlewares/fieldWrite.ts
|
|
22
20
|
/**
|
|
@@ -939,50 +937,27 @@ function stripFromRequired(schema, fieldName) {
|
|
|
939
937
|
return next;
|
|
940
938
|
}
|
|
941
939
|
/**
|
|
942
|
-
*
|
|
943
|
-
*
|
|
944
|
-
*
|
|
945
|
-
*
|
|
946
|
-
*
|
|
947
|
-
*
|
|
948
|
-
*
|
|
949
|
-
* `required
|
|
950
|
-
*
|
|
951
|
-
*
|
|
952
|
-
*
|
|
953
|
-
*
|
|
954
|
-
*
|
|
955
|
-
*
|
|
956
|
-
*
|
|
957
|
-
*
|
|
958
|
-
*
|
|
959
|
-
*
|
|
960
|
-
*
|
|
961
|
-
*
|
|
962
|
-
*
|
|
963
|
-
*
|
|
964
|
-
* The only workaround before 2.11 was
|
|
965
|
-
* `createEngine({ tenant: { required: false } })` at every consumer site —
|
|
966
|
-
* a leaky abstraction every new engine-backed resource had to remember.
|
|
967
|
-
*
|
|
968
|
-
* **Secondary coverage (defense-in-depth):** the same transform also fires
|
|
969
|
-
* for `auditedPreset`'s `createdBy` / `updatedBy`, any future preset that
|
|
970
|
-
* marks fields `systemManaged`, and any host-declared `fieldRules` with
|
|
971
|
-
* `systemManaged: true`. Every framework-injected field gets the wire
|
|
972
|
-
* contract / runtime pairing for free.
|
|
973
|
-
*
|
|
974
|
-
* **Leaves `properties` intact** — elevated admins or advanced callers can
|
|
975
|
-
* still send systemManaged fields in the body. `BodySanitizer` enforces
|
|
976
|
-
* the runtime policy (`preserveForElevated`, `strip` vs `reject`, etc.).
|
|
977
|
-
*
|
|
978
|
-
* **No-op when:**
|
|
979
|
-
* - `schemaOptions.fieldRules` is undefined / empty
|
|
980
|
-
* - No rule has `systemManaged: true`
|
|
981
|
-
* - The generated schemas object is undefined (adapter didn't generate any)
|
|
982
|
-
*
|
|
983
|
-
* Applies to both `createBody` and `updateBody` — update middleware also
|
|
984
|
-
* injects tenant/audit fields, so the update wire contract has the same
|
|
985
|
-
* problem as create.
|
|
940
|
+
* Drop `systemManaged` fields from `required[]` in generated body schemas.
|
|
941
|
+
*
|
|
942
|
+
* Arc populates those from scope / preset middleware / controller, so a client
|
|
943
|
+
* never supplies them — but the DB schema may still mark them required, and the
|
|
944
|
+
* adapter reflects that into the wire contract.
|
|
945
|
+
*
|
|
946
|
+
* THE GOTCHA THIS CLOSES: engines on `@classytic/primitives` default to
|
|
947
|
+
* `tenant: { required: true }`, stamping `organizationId` as required. Fastify
|
|
948
|
+
* preValidation runs BEFORE arc's preHandler chain, so the tenant-injection
|
|
949
|
+
* hook never gets to run and the request dies on
|
|
950
|
+
* `must have required property 'organizationId'` — even though the client sent
|
|
951
|
+
* `x-organization-id` and arc had promised to inject it. The alternative was
|
|
952
|
+
* `tenant: { required: false }` at every consumer site.
|
|
953
|
+
*
|
|
954
|
+
* Also covers `auditedPreset`'s `createdBy`/`updatedBy` and any host rule
|
|
955
|
+
* marked `systemManaged`. Applies to create AND update, since update middleware
|
|
956
|
+
* injects the same fields.
|
|
957
|
+
*
|
|
958
|
+
* `properties` is left INTACT — an elevated caller may still send these, and
|
|
959
|
+
* `BodySanitizer` owns that runtime policy (`preserveForElevated`,
|
|
960
|
+
* strip-vs-reject). No-op without `systemManaged` rules or generated schemas.
|
|
986
961
|
*/
|
|
987
962
|
function stripSystemManagedFromBodyRequired(schemas, schemaOptions) {
|
|
988
963
|
if (!schemas) return schemas;
|
|
@@ -1188,8 +1163,8 @@ function buildGeneratedCrudSchemas(openApi, customSchemas) {
|
|
|
1188
1163
|
const { createBody, updateBody, params } = openApi;
|
|
1189
1164
|
if (createBody) generated.create = { body: safeBody(createBody) };
|
|
1190
1165
|
if (updateBody) {
|
|
1191
|
-
const patchBody =
|
|
1192
|
-
|
|
1166
|
+
const patchBody = structuredClone(updateBody);
|
|
1167
|
+
stripRequiredDeep(patchBody);
|
|
1193
1168
|
generated.update = { body: safeBody(patchBody) };
|
|
1194
1169
|
if (params) generated.update.params = cloneShallow(params);
|
|
1195
1170
|
}
|
|
@@ -1287,6 +1262,27 @@ function deepMergeSchemas(base, override) {
|
|
|
1287
1262
|
function cloneShallow(value) {
|
|
1288
1263
|
return { ...value };
|
|
1289
1264
|
}
|
|
1265
|
+
/**
|
|
1266
|
+
* Delete every `required` from a JSON-schema subtree — PATCH means optional at
|
|
1267
|
+
* every depth, not just the root.
|
|
1268
|
+
*
|
|
1269
|
+
* A generator may legitimately return an `updateBody` whose nested
|
|
1270
|
+
* subdocument-array `items` carries its own `required`. Stripping only the
|
|
1271
|
+
* root left that intact, so a PATCH adding one item to a subdocument array was
|
|
1272
|
+
* rejected by AJV for a field the caller had no way to know it must resend.
|
|
1273
|
+
* Recursing here enforces PATCH semantics on whatever a generator produces,
|
|
1274
|
+
* rather than trusting each to recurse correctly.
|
|
1275
|
+
*/
|
|
1276
|
+
function stripRequiredDeep(node) {
|
|
1277
|
+
if (Array.isArray(node)) {
|
|
1278
|
+
for (const item of node) stripRequiredDeep(item);
|
|
1279
|
+
return;
|
|
1280
|
+
}
|
|
1281
|
+
if (!node || typeof node !== "object") return;
|
|
1282
|
+
const obj = node;
|
|
1283
|
+
delete obj.required;
|
|
1284
|
+
for (const value of Object.values(obj)) stripRequiredDeep(value);
|
|
1285
|
+
}
|
|
1290
1286
|
function safeBody(schema) {
|
|
1291
1287
|
if (schema && typeof schema === "object" && schema.type === "object") return {
|
|
1292
1288
|
additionalProperties: true,
|
|
@@ -1429,7 +1425,7 @@ function buildResourcePlugin(resource) {
|
|
|
1429
1425
|
extensions: resource.extensions
|
|
1430
1426
|
});
|
|
1431
1427
|
if (resource.actions && Object.keys(resource.actions).length > 0) {
|
|
1432
|
-
const { createActionRouter } = await import("./createActionRouter-
|
|
1428
|
+
const { createActionRouter } = await import("./createActionRouter-EYWgd0ly.mjs").then((n) => n.n);
|
|
1433
1429
|
createActionRouter(typedInstance, {
|
|
1434
1430
|
...normalizeActionsToRouterConfig(resource.actions, resource.actionPermissions, resource.tag, resource.permissions, resource.name, typedInstance.log),
|
|
1435
1431
|
resourceName: resource.name,
|
|
@@ -1444,7 +1440,7 @@ function buildResourcePlugin(resource) {
|
|
|
1444
1440
|
});
|
|
1445
1441
|
}
|
|
1446
1442
|
if (resource.aggregations && Object.keys(resource.aggregations).length > 0) {
|
|
1447
|
-
const [{ createAggregationRouter }, { adapterSupportsAggregate, ArcAggregationConfigError }] = await Promise.all([import("./createAggregationRouter-
|
|
1443
|
+
const [{ createAggregationRouter }, { adapterSupportsAggregate, ArcAggregationConfigError }] = await Promise.all([import("./createAggregationRouter-ByOK9Iev.mjs"), import("./validate-dosAIvQU.mjs").then((n) => n.r)]);
|
|
1448
1444
|
const repoForAgg = resource.controller?.repository ?? resource.repository;
|
|
1449
1445
|
if (!adapterSupportsAggregate(repoForAgg)) {
|
|
1450
1446
|
const undispatchable = Object.entries(resource.aggregations).filter(([, cfg]) => !cfg.materialized).map(([name]) => name);
|
package/dist/discovery/index.mjs
CHANGED
package/dist/docs/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { p as RegistryEntry } from "../index-
|
|
2
|
+
import { p as RegistryEntry } from "../index-C5K78SXo.mjs";
|
|
3
3
|
import { t as ExternalOpenApiPaths } from "../externalPaths-CmGOxOtD.mjs";
|
|
4
4
|
import { FastifyPluginAsync } from "fastify";
|
|
5
5
|
//#region src/docs/openapi/types.d.ts
|
package/dist/docs/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { n as getUserRoles } from "../userHelpers-
|
|
3
|
-
import { n as openApiPlugin, r as openapi_default, t as buildOpenApiSpec } from "../openapi-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as getUserRoles } from "../userHelpers-AKcB4V03.mjs";
|
|
3
|
+
import { n as openApiPlugin, r as openapi_default, t as buildOpenApiSpec } from "../openapi-ItLH12_L.mjs";
|
|
4
4
|
import fp from "fastify-plugin";
|
|
5
5
|
//#region src/docs/scalar.ts
|
|
6
6
|
const scalarPlugin = async (fastify, opts = {}) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-CEvvVXTC.mjs";
|
|
3
3
|
import { arcLog } from "./logger/index.mjs";
|
|
4
|
-
import { n as requireSingleHeaderValue } from "./headers-
|
|
5
|
-
import { n as getUserRoles } from "./userHelpers-
|
|
4
|
+
import { n as requireSingleHeaderValue } from "./headers-DODWf7aC.mjs";
|
|
5
|
+
import { n as getUserRoles } from "./userHelpers-AKcB4V03.mjs";
|
|
6
6
|
import fp from "fastify-plugin";
|
|
7
7
|
//#region src/scope/elevation.ts
|
|
8
8
|
var elevation_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as ArcError } from "../errors-
|
|
3
|
-
import { t as parseJsonBody } from "../jsonBody-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as ArcError } from "../errors-CLid6atr.mjs";
|
|
3
|
+
import { t as parseJsonBody } from "../jsonBody-CVKA7C5m.mjs";
|
|
4
4
|
import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
|
|
5
5
|
import fp from "fastify-plugin";
|
|
6
6
|
//#region src/encryption/fieldCipher.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
3
|
-
import { m as statusToArcCode, p as isArcError } from "./errors-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-CEvvVXTC.mjs";
|
|
3
|
+
import { m as statusToArcCode, p as isArcError } from "./errors-CLid6atr.mjs";
|
|
4
4
|
import { isHttpError, toErrorContract } from "@classytic/repo-core/errors";
|
|
5
5
|
import { isProductionEnv } from "@classytic/primitives/environment";
|
|
6
6
|
import fp from "fastify-plugin";
|
|
@@ -340,7 +340,7 @@ interface EventPluginOptions {
|
|
|
340
340
|
*/
|
|
341
341
|
validateMode?: "warn" | "reject" | "off";
|
|
342
342
|
/**
|
|
343
|
-
* Dev-mode duplicate-publish detector
|
|
343
|
+
* Dev-mode duplicate-publish detector.
|
|
344
344
|
*
|
|
345
345
|
* When enabled, arc keeps a 5-second LRU on `(eventType, correlationId)`
|
|
346
346
|
* and emits an `arcLog("events").warn(...)` the second time a request
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-CEvvVXTC.mjs";
|
|
3
3
|
import { arcLog } from "./logger/index.mjs";
|
|
4
|
-
import { d as createDomainError } from "./errors-
|
|
5
|
-
import { n as requestContext } from "./requestContext-
|
|
6
|
-
import { n as MemoryEventTransport, r as createEvent, t as ARC_EVENT_TRANSPORT } from "./EventTransport-
|
|
4
|
+
import { d as createDomainError } from "./errors-CLid6atr.mjs";
|
|
5
|
+
import { n as requestContext } from "./requestContext-DzOUGNdY.mjs";
|
|
6
|
+
import { n as MemoryEventTransport, r as createEvent, t as ARC_EVENT_TRANSPORT } from "./EventTransport-BrPeGUil.mjs";
|
|
7
7
|
import { isProductionEnv } from "@classytic/primitives/environment";
|
|
8
8
|
import fp from "fastify-plugin";
|
|
9
9
|
//#region src/events/retry.ts
|
package/dist/events/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { i as EventLogger, n as DomainEvent, o as MemoryEventTransport, r as EventHandler, s as MemoryEventTransportOptions } from "../EventTransport-BEVP50ka.mjs";
|
|
3
|
-
import { a as withRetry, c as EventDefinitionOutput, d as EventSchema, f as ValidationResult, i as createDeadLetterPublisher, l as EventRegistry, m as defineEvent, n as eventPlugin, o as CustomValidator, p as createEventRegistry, r as RetryOptions, s as EventDefinitionInput, t as EventPluginOptions, u as EventRegistryOptions } from "../eventPlugin-
|
|
4
|
-
import { a as EventOutbox, c as OutboxRelayErrorKind, i as MemoryOutboxStore, l as RelayResult, n as OutboxModuleOptions, o as EventOutboxOptions, r as createOutboxModule, s as OutboxRelayErrorHandler, t as OutboxModuleExports } from "../outbox-module-
|
|
3
|
+
import { a as withRetry, c as EventDefinitionOutput, d as EventSchema, f as ValidationResult, i as createDeadLetterPublisher, l as EventRegistry, m as defineEvent, n as eventPlugin, o as CustomValidator, p as createEventRegistry, r as RetryOptions, s as EventDefinitionInput, t as EventPluginOptions, u as EventRegistryOptions } from "../eventPlugin-B47sfCJ8.mjs";
|
|
4
|
+
import { a as EventOutbox, c as OutboxRelayErrorKind, i as MemoryOutboxStore, l as RelayResult, n as OutboxModuleOptions, o as EventOutboxOptions, r as createOutboxModule, s as OutboxRelayErrorHandler, t as OutboxModuleExports } from "../outbox-module-b1TyDGGi.mjs";
|
|
5
5
|
import { RedisEventTransportOptions, RedisLike } from "./transports/redis.mjs";
|
|
6
6
|
import { r as RedisStreamTransportOptions, t as RedisStreamLike } from "../redis-stream-mwLWlfHG.mjs";
|
|
7
7
|
import { OutboxStore } from "@classytic/primitives/outbox";
|
package/dist/events/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { n as MemoryEventTransport } from "../EventTransport-
|
|
3
|
-
import { a as createEventRegistry, i as wrapWithSchema, n as subscribeWithSchema, o as defineEvent, r as wrapWithBoundary, t as subscribeWithBoundary } from "../subscribe-helpers-
|
|
4
|
-
import { i as withRetry, r as createDeadLetterPublisher, t as eventPlugin } from "../eventPlugin-
|
|
5
|
-
import { i as exponentialBackoff, n as EventOutbox, r as repositoryAsOutboxStore, t as createOutboxModule } from "../outbox-module-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as MemoryEventTransport } from "../EventTransport-BrPeGUil.mjs";
|
|
3
|
+
import { a as createEventRegistry, i as wrapWithSchema, n as subscribeWithSchema, o as defineEvent, r as wrapWithBoundary, t as subscribeWithBoundary } from "../subscribe-helpers-Dh2BnzJf.mjs";
|
|
4
|
+
import { i as withRetry, r as createDeadLetterPublisher, t as eventPlugin } from "../eventPlugin-ClPn5kjn.mjs";
|
|
5
|
+
import { i as exponentialBackoff, n as EventOutbox, r as repositoryAsOutboxStore, t as createOutboxModule } from "../outbox-module-SGIZz6oS.mjs";
|
|
6
6
|
import { MemoryOutboxStore } from "@classytic/primitives/memory-outbox";
|
|
7
7
|
//#region src/events/eventTypes.ts
|
|
8
8
|
/**
|
package/dist/factory/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import { _ as HealthCheck, a as ModuleContribution, c as LoadResourcesOptions, d as loadResources, i as EventHandlerDefinition, l as ResourceLike, n as ArcModuleInput, o as ModuleDisposer, r as ArcModuleRegistry, s as ModuleSetupContext, t as ArcModule, u as ResourceModule } from "../types-
|
|
3
|
-
import { _ as collectModuleScheduledJobs, a as lazyModuleExports, c as getModuleState, d as resolveModule, f as orderModules, g as collectModuleHealthChecks, h as extendModule, i as hasModuleExports, l as hasModule, m as ModuleExtension, n as getModuleExports, o as lazyRequiredModuleExports, p as subscribeModuleEventHandlers, r as getOptionalModuleExports, s as ModuleState, t as defineModule, u as resolveContribution, v as collectModuleWorkflows } from "../index-
|
|
4
|
-
import { c as ResolvedResourceDescriptor, l as describeResolvedModule, o as ResolvedModuleDescriptor, s as ResolvedModuleLifecycle } from "../fastify-augmentation-
|
|
5
|
-
import { a as RawBodyOptions, c as BetterAuthOption, d as JwtAuthOption, i as MultipartOptions, l as CustomAuthenticatorOption, n as preloadResourcesAsync, o as UnderPressureOptions, r as CreateAppOptions, s as AuthOption, t as preloadResources, u as CustomPluginAuthOption } from "../preloadResources
|
|
2
|
+
import { _ as HealthCheck, a as ModuleContribution, c as LoadResourcesOptions, d as loadResources, i as EventHandlerDefinition, l as ResourceLike, n as ArcModuleInput, o as ModuleDisposer, r as ArcModuleRegistry, s as ModuleSetupContext, t as ArcModule, u as ResourceModule } from "../types-DDD5RKTu.mjs";
|
|
3
|
+
import { _ as collectModuleScheduledJobs, a as lazyModuleExports, c as getModuleState, d as resolveModule, f as orderModules, g as collectModuleHealthChecks, h as extendModule, i as hasModuleExports, l as hasModule, m as ModuleExtension, n as getModuleExports, o as lazyRequiredModuleExports, p as subscribeModuleEventHandlers, r as getOptionalModuleExports, s as ModuleState, t as defineModule, u as resolveContribution, v as collectModuleWorkflows } from "../index-C50BUxKs.mjs";
|
|
4
|
+
import { c as ResolvedResourceDescriptor, l as describeResolvedModule, o as ResolvedModuleDescriptor, s as ResolvedModuleLifecycle } from "../fastify-augmentation-CMMTL3cj.mjs";
|
|
5
|
+
import { a as RawBodyOptions, c as BetterAuthOption, d as JwtAuthOption, i as MultipartOptions, l as CustomAuthenticatorOption, n as preloadResourcesAsync, o as UnderPressureOptions, r as CreateAppOptions, s as AuthOption, t as preloadResources, u as CustomPluginAuthOption } from "../preloadResources--ZtY9pe9.mjs";
|
|
6
6
|
import { FastifyInstance, FastifyServerOptions } from "fastify";
|
|
7
7
|
//#region src/factory/createApp.d.ts
|
|
8
8
|
/**
|
|
@@ -17,7 +17,7 @@ import { FastifyInstance, FastifyServerOptions } from "fastify";
|
|
|
17
17
|
* Hosts that need NO redaction (test fixtures, security audits) opt out
|
|
18
18
|
* with `logger: { redact: [] }`. Hosts that need MORE redaction supply
|
|
19
19
|
* their own `redact` and arc steps aside — this default never overrides
|
|
20
|
-
* an explicit setting.
|
|
20
|
+
* an explicit setting.
|
|
21
21
|
*/
|
|
22
22
|
declare const DEFAULT_LOGGER_REDACT_PATHS: readonly ["req.headers.authorization", 'req.headers["x-api-key"]', 'req.headers["x-internal-api-key"]', "req.headers.cookie", 'req.headers["set-cookie"]', 'res.headers["set-cookie"]', "*.password", "*.passwordHash", "*.token", "*.accessToken", "*.refreshToken", "*.secret", "*.apiKey"];
|
|
23
23
|
/**
|
package/dist/factory/index.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { r as mergeHealthChecks, t as healthPlugin } from "../health-
|
|
3
|
-
import { _ as
|
|
4
|
-
import { a as lazyModuleExports, i as hasModuleExports, n as getModuleExports, o as lazyRequiredModuleExports, r as getOptionalModuleExports, t as defineModule } from "../module-
|
|
5
|
-
import { t as loadResources } from "../loadResources-
|
|
6
|
-
import { n as preloadResourcesAsync, t as preloadResources } from "../preloadResources-BkyqeTDz.mjs";
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { r as mergeHealthChecks, t as healthPlugin } from "../health-_Zs3R_Sb.mjs";
|
|
3
|
+
import { S as resolveModule, _ as describeResolvedModule, a as createApp, b as collectModuleWorkflows, c as edgePreset, d as testingPreset, f as workerPreset, g as subscribeModuleEventHandlers, h as orderModules, i as DEFAULT_LOGGER_REDACT_PATHS, l as getPreset, m as hasModule, n as preloadResourcesAsync, p as getModuleState, r as ArcFactory, s as developmentPreset, t as preloadResources, u as productionPreset, v as collectModuleHealthChecks, x as resolveContribution, y as collectModuleScheduledJobs } from "../preloadResources-DYMzmUk1.mjs";
|
|
4
|
+
import { a as lazyModuleExports, i as hasModuleExports, n as getModuleExports, o as lazyRequiredModuleExports, r as getOptionalModuleExports, t as defineModule } from "../module-Bh5OC7ww.mjs";
|
|
5
|
+
import { t as loadResources } from "../loadResources-DdQb0qgV.mjs";
|
|
7
6
|
//#region src/factory/module/extend.ts
|
|
8
7
|
/** Concatenate two contributions, resolving factories only when arc asks. */
|
|
9
8
|
function mergeContribution(own, extra) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import { on as HookSystem, z as ResourceRegistry } from "./index-
|
|
2
|
+
import { on as HookSystem, z as ResourceRegistry } from "./index-C5K78SXo.mjs";
|
|
3
3
|
import { t as ExternalOpenApiPaths } from "./externalPaths-CmGOxOtD.mjs";
|
|
4
|
-
import { _ as HealthCheck, f as ScheduleDefinition, r as ArcModuleRegistry, t as ArcModule } from "./types-
|
|
5
|
-
import { s as ModuleState } from "./index-
|
|
4
|
+
import { _ as HealthCheck, f as ScheduleDefinition, r as ArcModuleRegistry, t as ArcModule } from "./types-DDD5RKTu.mjs";
|
|
5
|
+
import { s as ModuleState } from "./index-C50BUxKs.mjs";
|
|
6
6
|
import { FastifyPluginAsync } from "fastify";
|
|
7
7
|
//#region src/factory/module/descriptor.d.ts
|
|
8
8
|
/**
|