@classytic/arc 2.43.0 → 2.44.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/{EventTransport-tzA7CAB4.mjs → EventTransport-DZWDsaPa.mjs} +2 -2
- package/dist/{HookSystem-B6UaKRbF.mjs → HookSystem-yjEgn7Cm.mjs} +2 -2
- package/dist/{ResourceRegistry-CuCARu2B.mjs → ResourceRegistry-DJxHUpE4.mjs} +2 -2
- package/dist/acquire-BozJ-9yt.mjs +35 -0
- package/dist/{actionPermissions-BotX1YOa.mjs → actionPermissions-5N04zBL4.mjs} +13 -17
- package/dist/audit/index.d.mts +6 -6
- package/dist/audit/index.mjs +4 -4
- package/dist/auth/audit.d.mts +8 -8
- package/dist/auth/audit.mjs +1 -1
- package/dist/auth/index.d.mts +5 -5
- package/dist/auth/index.mjs +11 -8
- package/dist/auth/redis-session.d.mts +4 -5
- package/dist/auth/redis-session.mjs +1 -1
- package/dist/{authorizationDecision-DQYrkl5f.mjs → authorizationDecision-wX3SA9w_.mjs} +4 -4
- package/dist/{boundedMap-BULzfXYU.mjs → boundedMap-DWiKW7lP.mjs} +1 -1
- package/dist/{buildHandler-CRQ8EcX5.mjs → buildHandler-Bswu_vNb.mjs} +4 -4
- package/dist/cache/index.d.mts +9 -9
- package/dist/cache/index.mjs +4 -4
- package/dist/{caching-Cc2M1DwO.mjs → caching-Drp68DIS.mjs} +2 -2
- package/dist/{claimed-B10RTfkM.mjs → claimed-DYvQoZLv.mjs} +1 -1
- package/dist/cleanup/index.d.mts +14 -14
- package/dist/cleanup/index.mjs +4 -4
- package/dist/cli/commands/describe.d.mts +5 -5
- package/dist/cli/commands/describe.mjs +3 -3
- package/dist/cli/commands/docs.d.mts +2 -3
- package/dist/cli/commands/docs.mjs +3 -3
- package/dist/cli/commands/doctor.d.mts +2 -3
- package/dist/cli/commands/doctor.mjs +1 -1
- package/dist/cli/commands/generate.mjs +2 -3
- package/dist/cli/commands/init.mjs +2 -3
- package/dist/cli/commands/introspect.d.mts +2 -3
- package/dist/cli/commands/introspect.mjs +2 -2
- package/dist/cli/index.mjs +3 -3
- package/dist/{constants-Cu7Mx7_U.mjs → constants-B2QHb6u6.mjs} +1 -1
- package/dist/context/index.d.mts +9 -9
- package/dist/context/index.mjs +5 -5
- package/dist/core/index.d.mts +3 -3
- package/dist/core/index.mjs +8 -8
- package/dist/{core-Cb0LjccA.mjs → core-COcqo0Cp.mjs} +13 -4
- package/dist/{createActionRouter-xjqonMRO.mjs → createActionRouter-zG13rpPJ.mjs} +18 -8
- package/dist/{createAggregationRouter-zRYWw_5D.mjs → createAggregationRouter-CWRz96Vr.mjs} +7 -7
- package/dist/{createApp-D-953ZAq.mjs → createApp-BGLYtErt.mjs} +34 -32
- package/dist/{createMcpServer-C9cxS8zt.d.mts → createMcpServer-DSztofa9.d.mts} +1 -1
- package/dist/{defineAggregation-Bm8RjMbq.mjs → defineAggregation--3xguLkk.mjs} +1 -1
- package/dist/{defineResource-DIC7JZGU.mjs → defineResource-gUp9ug66.mjs} +7 -7
- package/dist/discovery/index.d.mts +6 -7
- package/dist/discovery/index.mjs +1 -1
- package/dist/docs/index.d.mts +3 -3
- package/dist/docs/index.mjs +3 -3
- package/dist/{elevation-DG8SrLN-.mjs → elevation-BG4gnMsJ.mjs} +5 -5
- package/dist/encryption/index.d.mts +5 -5
- package/dist/encryption/index.mjs +3 -3
- package/dist/{errorHandler-BnfDviL1.mjs → errorHandler-COHw3N1b.mjs} +3 -3
- package/dist/{errors-CtrywMHP.mjs → errors-CW4anJBy.mjs} +1 -1
- package/dist/{eventPlugin-Q6BhzHzs.mjs → eventPlugin-BweHAVws.mjs} +8 -8
- package/dist/{eventTypes-Cdhm6ZlV.mjs → eventTypes-N4-omQFR.mjs} +2 -2
- package/dist/events/index.d.mts +14 -14
- package/dist/events/index.mjs +7 -7
- package/dist/events/transports/redis-stream-entry.mjs +4 -4
- package/dist/events/transports/redis.d.mts +4 -5
- package/dist/events/transports/redis.mjs +2 -2
- package/dist/factory/index.d.mts +16 -16
- package/dist/factory/index.mjs +6 -6
- package/dist/{fastify-augmentation-DhUJ-mvo.d.mts → fastify-augmentation-DRlCIWE9.d.mts} +2 -2
- package/dist/{fields-ToPYpMqS.mjs → fields-A5crhsJb.mjs} +1 -1
- package/dist/{filter-merge-IpGywvym.mjs → filter-merge-DGM-GQ1J.mjs} +1 -1
- package/dist/{generate-DRTkLlIl.mjs → generate-BXKo2Gc8.mjs} +2 -2
- package/dist/{headers-BbkIF6vA.mjs → headers-DKZQKL-Z.mjs} +2 -2
- package/dist/{health-D-Ft6JM6.mjs → health-BYAwA6YS.mjs} +1 -1
- package/dist/{health-DqbsG-_w.mjs → health-CrqUp3sz.mjs} +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +2 -3
- package/dist/idempotency/index.d.mts +8 -6
- package/dist/idempotency/index.mjs +108 -46
- package/dist/idempotency/redis.d.mts +1 -1
- package/dist/idempotency/redis.mjs +30 -2
- package/dist/{index-CRoPtISf.d.mts → index-Beg3aNnK.d.mts} +3 -31
- package/dist/{index-C8zVGYsk.d.mts → index-BkV55WlV.d.mts} +3 -3
- package/dist/{index-JdbZAIsm.d.mts → index-CUJvoyw3.d.mts} +1 -1
- package/dist/{index-mqaqZNpe.d.mts → index-WH7xgvxS.d.mts} +52 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +11 -11
- package/dist/{init-B_oUYDXI.mjs → init-BPzK5Lnr.mjs} +1 -1
- package/dist/integrations/event-gateway.d.mts +3 -4
- package/dist/integrations/event-gateway.mjs +2 -2
- package/dist/integrations/index.d.mts +1 -1
- package/dist/integrations/index.mjs +1 -1
- package/dist/integrations/jobs/index.mjs +3 -3
- package/dist/integrations/mcp/index.d.mts +36 -36
- package/dist/integrations/mcp/index.mjs +2 -2
- package/dist/integrations/mcp/testing.d.mts +8 -9
- package/dist/integrations/mcp/testing.mjs +2 -2
- package/dist/integrations/streamline.d.mts +12 -13
- package/dist/integrations/streamline.mjs +18 -4
- package/dist/integrations/webhooks.d.mts +23 -23
- package/dist/integrations/webhooks.mjs +3 -3
- package/dist/integrations/websocket-pushref-redis.d.mts +4 -5
- package/dist/integrations/websocket-pushref-redis.mjs +1 -1
- package/dist/integrations/websocket-redis.d.mts +4 -5
- package/dist/integrations/websocket-redis.mjs +1 -1
- package/dist/integrations/websocket.mjs +2 -2
- package/dist/{interface-C0395yUN.d.mts → interface-JJzwH4Ro.d.mts} +22 -2
- package/dist/{jsonBody-B4YVGcql.mjs → jsonBody-YIq-vGLv.mjs} +2 -2
- package/dist/{keys-B2KtgMLJ.mjs → keys-CpoiZ8hU.mjs} +1 -1
- package/dist/{loadResources-Dn4lalw2.mjs → loadResources-6jO52-RR.mjs} +3 -3
- package/dist/{loadResourcesFromEntry-3sLYbuse.mjs → loadResourcesFromEntry-MP8xEppu.mjs} +2 -2
- package/dist/logger/index.d.mts +9 -10
- package/dist/logger/index.mjs +2 -3
- package/dist/{logger-DXjfIqjV.mjs → logger-D4V1zGLI.mjs} +1 -1
- package/dist/{mcpPlugin-C08HalN5.mjs → mcpPlugin-srPc7ItN.mjs} +42 -29
- package/dist/{memory-9Cp7611C.mjs → memory-CTa5pOCW.mjs} +3 -3
- package/dist/{metrics-CWI11eRu.mjs → metrics-DsZrvnpB.mjs} +3 -3
- package/dist/middleware/index.d.mts +5 -5
- package/dist/middleware/index.mjs +3 -3
- package/dist/migrations/index.d.mts +13 -13
- package/dist/migrations/index.mjs +2 -2
- package/dist/{module-BSvOQC7E.mjs → module--L0iBIZz.mjs} +1 -1
- package/dist/mongodb-memory-server-CHhYSq5y.mjs +35539 -0
- package/dist/mongoose-CYJCLyi-.mjs +67451 -0
- package/dist/{multiTenant-cY0FkDiA.d.mts → multiTenant-CAtYlW6H.d.mts} +1 -1
- package/dist/{multipartBody-CXM2a-Dy.mjs → multipartBody-Cc7eZ9cq.mjs} +1 -1
- package/dist/node-D8UZv_8c.mjs +41236 -0
- package/dist/{openapi-DT_G4VhY.mjs → openapi-CMegfsm8.mjs} +6 -6
- package/dist/outbox-admin/index.d.mts +2 -2
- package/dist/outbox-admin/index.mjs +5 -5
- package/dist/{outbox-module-Bjgzl6tg.mjs → outbox-module-Ryk270jd.mjs} +9 -9
- package/dist/permissions/index.mjs +7 -7
- package/dist/{permissions-Cm0uYHvd.mjs → permissions-C5ijIz5Q.mjs} +9 -9
- package/dist/{pipe-BqeGT6UO.mjs → pipe-D81zMtWs.mjs} +2 -2
- package/dist/pipeline/index.d.mts +7 -7
- package/dist/pipeline/index.mjs +2 -2
- package/dist/{plan-FVR6LP59.mjs → plan-CJGMKoui.mjs} +1 -1
- package/dist/{plugin-BccET1tL.mjs → plugin-DALd9dcF.mjs} +39 -27
- package/dist/plugins/index.d.mts +7 -7
- package/dist/plugins/index.mjs +17 -17
- package/dist/plugins/response-cache.d.mts +5 -6
- package/dist/plugins/response-cache.mjs +4 -4
- package/dist/plugins/tracing-entry.mjs +2 -2
- package/dist/{pluralize-CVIOcgMF.mjs → pluralize-COUNYo3d.mjs} +1 -1
- package/dist/presets/filesUpload.d.mts +7 -7
- package/dist/presets/filesUpload.mjs +5 -5
- package/dist/presets/index.d.mts +14 -14
- package/dist/presets/index.mjs +2 -2
- package/dist/presets/multiTenant.d.mts +1 -1
- package/dist/presets/multiTenant.mjs +5 -5
- package/dist/presets/search.d.mts +8 -9
- package/dist/presets/search.mjs +2 -2
- package/dist/{presets-Cpvj6fGO.mjs → presets-CONf2Qem.mjs} +4 -4
- package/dist/{projection-Ce4aQhQk.mjs → projection-wFoLqdss.mjs} +2 -2
- package/dist/{queryCachePlugin-CFWNH8aT.mjs → queryCachePlugin-BATECpyh.mjs} +6 -6
- package/dist/{rateLimitKey-C4O-kPm0.mjs → rateLimitKey-DVEZ_UpV.mjs} +1 -1
- package/dist/{realtime-DmPE9S54.mjs → realtime-xyubMKSB.mjs} +11 -11
- package/dist/{redis-vLvtcGy_.d.mts → redis-BDgv9Glw.d.mts} +5 -1
- package/dist/registry/index.d.mts +9 -9
- package/dist/registry/index.mjs +3 -3
- package/dist/{registry-Bcz9G1bh.mjs → registry-Bdzg-hdm.mjs} +5 -4
- package/dist/{renewingLease-qODa7KJQ.mjs → renewingLease-BFJxGPuh.mjs} +1 -1
- package/dist/{replyHelpers-CG_VtVgS.mjs → replyHelpers-Bnc6lJyy.mjs} +2 -2
- package/dist/{requestContext-Dsu9P1bV.mjs → requestContext-C10UeFe5.mjs} +1 -1
- package/dist/{requirement-KDdoRcOP.mjs → requirement-Bu50QALH.mjs} +1 -1
- package/dist/{resourceRateLimit-dSjVr1pk.mjs → resourceRateLimit-urWPJxrt.mjs} +2 -2
- package/dist/rolldown-runtime-MYrLNGnq.mjs +45 -0
- package/dist/{routeValidator-D36SW8qt.mjs → routeValidator-DHtpzrzk.mjs} +1 -1
- package/dist/{runtimeCapabilities-0tccjRlj.mjs → runtimeCapabilities-DIMKMV2G.mjs} +1 -1
- package/dist/{schedules-C-OpmHBq.mjs → schedules-CKTs5ys8.mjs} +5 -5
- package/dist/{schemaConverter-BORek3O-.mjs → schemaConverter-BVjkQ5DD.mjs} +2 -2
- package/dist/{schemaIR-C7Vbp71I.mjs → schemaIR-BA0Hb21Y.mjs} +2 -2
- package/dist/schemas/index.d.mts +10 -10
- package/dist/schemas/index.mjs +1 -1
- package/dist/scim/index.d.mts +13 -13
- package/dist/scim/index.mjs +2 -2
- package/dist/scope/index.d.mts +3 -3
- package/dist/scope/index.mjs +5 -5
- package/dist/{scope-DQthe88b.mjs → scope-DINaj7Ax.mjs} +4 -4
- package/dist/{shutdown-MqA81z_P.mjs → shutdown-LpLMH8T1.mjs} +1 -1
- package/dist/{simpleEqualityMatcher-auW8QjXN.mjs → simpleEqualityMatcher-DbwIM1f1.mjs} +1 -1
- package/dist/{sse-CYzQBVFe.mjs → sse-BzJFPX_1.mjs} +7 -7
- package/dist/{sseStream-B5_Afiqn.mjs → sseStream-DQChzGTs.mjs} +2 -2
- package/dist/{store-helpers-BOzk-CuX.mjs → store-helpers-Coj9RhOZ.mjs} +1 -1
- package/dist/{streaming-DjTQhZrN.mjs → streaming-JzB5CAga.mjs} +1 -1
- package/dist/{subscriberIdentity-CW39uA8G.mjs → subscriberIdentity-DeyppIif.mjs} +1 -1
- package/dist/{tenancy--ed9eH_z.mjs → tenancy-DxV8OuX2.mjs} +2 -2
- package/dist/{tenantPreparation-BKon6Yox.mjs → tenantPreparation-CBvvAcAj.mjs} +4 -4
- package/dist/testing/cleanupStoreContract.d.mts +4 -5
- package/dist/testing/cleanupStoreContract.mjs +1 -1
- package/dist/testing/index.d.mts +35 -35
- package/dist/testing/index.mjs +16 -15
- package/dist/testing/outboxStoreContract.d.mts +4 -5
- package/dist/testing/outboxStoreContract.mjs +2 -2
- package/dist/testing/requiredPorts.d.mts +4 -5
- package/dist/testing/requiredPorts.mjs +2 -2
- package/dist/testing/storageContract.d.mts +4 -5
- package/dist/testing/storageContract.mjs +1 -1
- package/dist/{timing-qczZ0YC-.mjs → timing-CntavTlR.mjs} +1 -1
- package/dist/{transactionContext-DjFkrNG6.mjs → transactionContext-orvnGu4F.mjs} +1 -1
- package/dist/{typeGuards-CySF12G-.mjs → typeGuards-kEaP_WmO.mjs} +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/types/storage.mjs +1 -1
- package/dist/{types-B4Aq4Sdj.d.mts → types-D3Ixsh00.d.mts} +1 -1
- package/dist/{types-Bk9NOgOC.mjs → types-fvO6Ovzx.mjs} +4 -4
- package/dist/usage/index.d.mts +4 -4
- package/dist/usage/index.mjs +4 -4
- package/dist/{userHelpers-aklawRaK.mjs → userHelpers-C76zD5pa.mjs} +1 -1
- package/dist/utils/index.d.mts +47 -47
- package/dist/utils/index.mjs +12 -12
- package/dist/{utils-ec1oTo1n.mjs → utils-BpkVZ8rB.mjs} +4 -4
- package/dist/{validate-9yzHC1e2.mjs → validate-CWp-lsrm.mjs} +3 -3
- package/dist/{versioning-fhhWHV74.mjs → versioning-CHhL9P3o.mjs} +3 -3
- package/dist/{workScope-zpPyge4t.mjs → workScope-n9a7d_lZ.mjs} +2 -2
- package/package.json +45 -51
- package/dist/rolldown-runtime-D1w9Y1VJ.mjs +0 -15
|
@@ -6,6 +6,5 @@
|
|
|
6
6
|
* Export OpenAPI specification from registered resources.
|
|
7
7
|
* Requires an entry file that exports defineResource() results.
|
|
8
8
|
*/
|
|
9
|
-
declare function exportDocs(args: string[]): Promise<void>;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { exportDocs };
|
|
9
|
+
export declare function exportDocs(args: string[]): Promise<void>;
|
|
10
|
+
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as buildOpenApiSpec } from "../../openapi-
|
|
3
|
-
import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as buildOpenApiSpec } from "../../openapi-CMegfsm8.mjs";
|
|
3
|
+
import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-MP8xEppu.mjs";
|
|
4
4
|
import { dirname, resolve } from "node:path";
|
|
5
5
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
6
6
|
//#region src/cli/commands/docs.ts
|
|
@@ -6,6 +6,5 @@
|
|
|
6
6
|
* Health check utility that validates the development environment.
|
|
7
7
|
* Checks Node.js version, dependencies, configuration, and env variables.
|
|
8
8
|
*/
|
|
9
|
-
declare function doctor(_args?: string[]): Promise<void>;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { doctor };
|
|
9
|
+
export declare function doctor(_args?: string[]): Promise<void>;
|
|
10
|
+
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
2
|
import { dirname, join, parse, resolve } from "node:path";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
//#region src/cli/commands/doctor.ts
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
|
|
3
|
-
export { generate };
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
export { t as generate } from "../../generate-BXKo2Gc8.mjs";
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
|
|
3
|
-
export { init };
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
export { t as init } from "../../init-BPzK5Lnr.mjs";
|
|
@@ -6,6 +6,5 @@
|
|
|
6
6
|
* Shows all registered resources and their configuration.
|
|
7
7
|
* Requires an entry file that exports defineResource() results.
|
|
8
8
|
*/
|
|
9
|
-
declare function introspect(args: string[]): Promise<void>;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { introspect };
|
|
9
|
+
export declare function introspect(args: string[]): Promise<void>;
|
|
10
|
+
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-MP8xEppu.mjs";
|
|
3
3
|
//#region src/cli/commands/introspect.ts
|
|
4
4
|
function describePermission(value) {
|
|
5
5
|
if (!value) return "none";
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
2
|
import { describe } from "./commands/describe.mjs";
|
|
3
3
|
import { exportDocs } from "./commands/docs.mjs";
|
|
4
4
|
import { doctor } from "./commands/doctor.mjs";
|
|
5
|
-
import { t as generate } from "../generate-
|
|
6
|
-
import { t as init } from "../init-
|
|
5
|
+
import { t as generate } from "../generate-BXKo2Gc8.mjs";
|
|
6
|
+
import { t as init } from "../init-BPzK5Lnr.mjs";
|
|
7
7
|
import { introspect } from "./commands/introspect.mjs";
|
|
8
8
|
export { describe, doctor, exportDocs, generate, init, introspect };
|
package/dist/context/index.d.mts
CHANGED
|
@@ -52,7 +52,7 @@ interface RequestStore {
|
|
|
52
52
|
* - `run(store, fn)` — run a function with a specific store (used by Arc internals)
|
|
53
53
|
* - `getStore()` — alias for get() (matches Node.js API naming)
|
|
54
54
|
*/
|
|
55
|
-
declare const requestContext: {
|
|
55
|
+
export declare const requestContext: {
|
|
56
56
|
/**
|
|
57
57
|
* Get the current request context.
|
|
58
58
|
* Returns undefined if called outside a request lifecycle.
|
|
@@ -90,19 +90,19 @@ declare const requestContext: {
|
|
|
90
90
|
* await outbox.store(event, { headers: traceHeaders });
|
|
91
91
|
* ```
|
|
92
92
|
*/
|
|
93
|
-
declare function getTraceHeaders(): Record<string, string> | undefined;
|
|
93
|
+
export declare function getTraceHeaders(): Record<string, string> | undefined;
|
|
94
94
|
//#endregion
|
|
95
95
|
//#region src/context/requestScopedCache.d.ts
|
|
96
96
|
/**
|
|
97
97
|
* The cache for the CURRENT unit of work (see `runWorkScope`), or `undefined`
|
|
98
98
|
* outside one. Lazily created on first use.
|
|
99
99
|
*/
|
|
100
|
-
declare function requestScopedCache(): CacheAdapter | undefined;
|
|
100
|
+
export declare function requestScopedCache(): CacheAdapter | undefined;
|
|
101
101
|
/**
|
|
102
102
|
* Whether the current scope has allocated a cache yet. Diagnostics and
|
|
103
103
|
* tests only — never branch application behaviour on this.
|
|
104
104
|
*/
|
|
105
|
-
declare function hasRequestScopedCache(): boolean;
|
|
105
|
+
export declare function hasRequestScopedCache(): boolean;
|
|
106
106
|
//#endregion
|
|
107
107
|
//#region src/context/transactionContext.d.ts
|
|
108
108
|
/** DB session/transaction handle. Typed as unknown — arc is DB-agnostic. */
|
|
@@ -113,7 +113,7 @@ type DbSession = unknown;
|
|
|
113
113
|
* - `run(session, fn)` — install an active DB session for the duration of `fn`
|
|
114
114
|
* - `get()` — read the current session (undefined if outside a transaction scope)
|
|
115
115
|
*/
|
|
116
|
-
declare const transactionContext: {
|
|
116
|
+
export declare const transactionContext: {
|
|
117
117
|
/**
|
|
118
118
|
* Run `fn` with `session` as the active DB transaction context.
|
|
119
119
|
* Any call to `get()` within `fn`'s async call stack returns `session`.
|
|
@@ -136,17 +136,17 @@ interface WorkSeed {
|
|
|
136
136
|
readonly organizationId?: string;
|
|
137
137
|
}
|
|
138
138
|
/** Enter a scope for `fn`, or run it inside the active one. */
|
|
139
|
-
declare function runWorkScope<T>(seed: WorkSeed, fn: () => T): T;
|
|
139
|
+
export declare function runWorkScope<T>(seed: WorkSeed, fn: () => T): T;
|
|
140
140
|
/**
|
|
141
141
|
* A per-scope memo slot: created once on first use, the same instance after.
|
|
142
142
|
* `undefined` outside a scope.
|
|
143
143
|
*/
|
|
144
|
-
declare function scopedValue<T>(slot: symbol, create: () => T): T | undefined;
|
|
144
|
+
export declare function scopedValue<T>(slot: symbol, create: () => T): T | undefined;
|
|
145
145
|
/**
|
|
146
146
|
* The scope an event dispatch runs in. The correlation id is the scope id so a
|
|
147
147
|
* child event published from a handler chains to the same correlation; the
|
|
148
148
|
* tenant rides `meta`, never the payload.
|
|
149
149
|
*/
|
|
150
|
-
declare function workSeedFromEvent(event: DomainEvent): WorkSeed;
|
|
150
|
+
export declare function workSeedFromEvent(event: DomainEvent): WorkSeed;
|
|
151
151
|
//#endregion
|
|
152
|
-
export {
|
|
152
|
+
export type { DbSession, RequestStore, WorkKind, WorkSeed };
|
package/dist/context/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as transactionContext } from "../transactionContext-
|
|
3
|
-
import { n as requestContext, t as getTraceHeaders } from "../requestContext-
|
|
4
|
-
import { n as evictToSize, r as touch } from "../boundedMap-
|
|
5
|
-
import { n as scopedValue, r as workSeedFromEvent, t as runWorkScope } from "../workScope-
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as transactionContext } from "../transactionContext-orvnGu4F.mjs";
|
|
3
|
+
import { n as requestContext, t as getTraceHeaders } from "../requestContext-C10UeFe5.mjs";
|
|
4
|
+
import { n as evictToSize, r as touch } from "../boundedMap-DWiKW7lP.mjs";
|
|
5
|
+
import { n as scopedValue, r as workSeedFromEvent, t as runWorkScope } from "../workScope-n9a7d_lZ.mjs";
|
|
6
6
|
//#region src/context/requestScopedCache.ts
|
|
7
7
|
/** The memo slot the per-scope store hangs off. */
|
|
8
8
|
const SLOT = Symbol.for("arc.requestScopedCache");
|
package/dist/core/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { A as
|
|
4
|
-
export { AccessControl, type AccessControlConfig, type AccessControlRepository, 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, DEFAULT_VERSION_FIELD, type DefineActionConfig, type FetchDenialReason, type FetchResult, HOOK_OPERATIONS, HOOK_PHASES, HookOperation, HookPhase, type ListResult, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, type MixinConstructor, 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, type VariantOverride, type VariantsMap, type VariantsResult, assertValidConfig, collectReadBlockedFields, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAction, defineAggregation, defineResource, defineResourceVariants, formatValidationErrors, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, mergeResourceConfig, nativePolicyFilter, sendControllerResponse, validateResourceConfig };
|
|
2
|
+
import { $t as AccessControl, An as MixinConstructor, Bt as TreeMixin, Dn as ControllerConfigurableOptions, En as BaseControllerOptions, F as ResourceDefinition, Gt as BaseCrudController, Ht as SlugMixin, It as BaseController, Jt as ActionTargetCheck, Kt as QueryResolver, Lt as SoftDeleteExt, Mn as BodySanitizerConfig, On as ControllerConstructionOptions, P as defineResource, Qt as getEntityQuery, Rt as SoftDeleteMixin, Ut as BulkExt, Vt as SlugExt, Wt as BulkMixin, Xt as getEntityId, Yt as getActionTarget, Zt as getEntityIdField, at as AggregationCacheConfig, ct as AggregationIndexHint, dt as AggregationRateLimit, en as AccessControlConfig, ft as AggregationsMap, it as AggMeasureShorthand, jn as BodySanitizer, kn as ListResult, lt as AggregationMaterializedContext, nn as FetchDenialReason, ot as AggregationConfig, qt as QueryResolverConfig, rn as FetchResult, rt as AggMeasureInput, st as AggregationDateRangeRequirement, tn as AccessControlRepository, ut as AggregationMaterializedResult, zt as TreeExt } from "../index-WH7xgvxS.mjs";
|
|
3
|
+
import { A as CrudOperation, B as HookOperation, C as mergeResourceConfig, D as createPermissionMiddleware, E as createCrudRouter, F as DEFAULT_TENANT_FIELD, G as MUTATION_OPERATIONS, H as MAX_FILTER_DEPTH, I as DEFAULT_UPDATE_METHOD, J as SYSTEM_FIELDS, K as MutationOperation, L as DEFAULT_VERSION_FIELD, M as DEFAULT_LIMIT, N as DEFAULT_MAX_LIMIT, O as defineAggregation, P as DEFAULT_SORT, R as HOOK_OPERATIONS, S as SeamedResourceConfig, T as defineAction, U as MAX_REGEX_LENGTH, V as HookPhase, W as MAX_SEARCH_LENGTH, _ as VariantsMap, a as formatValidationErrors, b as AdapterLike, c as nativePolicyFilter, d as createFastifyHandler, f as createRequestContext, g as VariantOverride, h as sendControllerResponse, i as assertValidConfig, j as DEFAULT_ID_FIELD, k as CRUD_OPERATIONS, l as collectReadBlockedFields, m as getControllerScope, n as ValidateOptions, o as validateResourceConfig, p as getControllerContext, q as RESERVED_QUERY_PARAMS, r as ValidationResult, s as NativePolicyFilter, t as ConfigError, u as isFieldReadable, v as VariantsResult, w as DefineActionConfig, x as ResourceSeams, y as defineResourceVariants, z as HOOK_PHASES } from "../index-Beg3aNnK.mjs";
|
|
4
|
+
export { AccessControl, type AccessControlConfig, type AccessControlRepository, type ActionTargetCheck, 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, DEFAULT_VERSION_FIELD, type DefineActionConfig, type FetchDenialReason, type FetchResult, HOOK_OPERATIONS, HOOK_PHASES, HookOperation, HookPhase, type ListResult, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, type MixinConstructor, 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, type VariantOverride, type VariantsMap, type VariantsResult, assertValidConfig, collectReadBlockedFields, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAction, defineAggregation, defineResource, defineResourceVariants, formatValidationErrors, getActionTarget, 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 DEFAULT_VERSION_FIELD, d as MAX_FILTER_DEPTH, f as MAX_REGEX_LENGTH, g as SYSTEM_FIELDS, h as RESERVED_QUERY_PARAMS, i as DEFAULT_MAX_LIMIT, l as HOOK_OPERATIONS, m as MUTATION_OPERATIONS, n as DEFAULT_ID_FIELD, o as DEFAULT_TENANT_FIELD, p as MAX_SEARCH_LENGTH, r as DEFAULT_LIMIT, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS, u as HOOK_PHASES } from "../constants-
|
|
3
|
-
import { S as nativePolicyFilter, b as BodySanitizer, c as BaseController, d as SlugMixin, f as BulkMixin, g as isFieldReadable, h as collectReadBlockedFields, l as TreeMixin, m as QueryResolver, o as createCrudRouter, p as BaseCrudController, s as createPermissionMiddleware, u as SoftDeleteMixin, x as AccessControl } from "../plugin-
|
|
4
|
-
import { t as defineAggregation } from "../defineAggregation
|
|
5
|
-
import { C as sendControllerResponse, S as getControllerScope, b as createRequestContext, x as getControllerContext, y as createFastifyHandler } from "../actionPermissions-
|
|
6
|
-
import { a as
|
|
7
|
-
import { a as ResourceDefinition, i as validateResourceConfig, n as assertValidConfig, r as formatValidationErrors, t as defineResource } from "../defineResource-
|
|
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, DEFAULT_VERSION_FIELD, 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, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAction, defineAggregation, defineResource, defineResourceVariants, formatValidationErrors, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, mergeResourceConfig, nativePolicyFilter, sendControllerResponse, validateResourceConfig };
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
import { a as DEFAULT_SORT, c as DEFAULT_VERSION_FIELD, d as MAX_FILTER_DEPTH, f as MAX_REGEX_LENGTH, g as SYSTEM_FIELDS, h as RESERVED_QUERY_PARAMS, i as DEFAULT_MAX_LIMIT, l as HOOK_OPERATIONS, m as MUTATION_OPERATIONS, n as DEFAULT_ID_FIELD, o as DEFAULT_TENANT_FIELD, p as MAX_SEARCH_LENGTH, r as DEFAULT_LIMIT, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS, u as HOOK_PHASES } from "../constants-B2QHb6u6.mjs";
|
|
3
|
+
import { S as nativePolicyFilter, b as BodySanitizer, c as BaseController, d as SlugMixin, f as BulkMixin, g as isFieldReadable, h as collectReadBlockedFields, l as TreeMixin, m as QueryResolver, o as createCrudRouter, p as BaseCrudController, s as createPermissionMiddleware, u as SoftDeleteMixin, x as AccessControl } from "../plugin-DALd9dcF.mjs";
|
|
4
|
+
import { t as defineAggregation } from "../defineAggregation--3xguLkk.mjs";
|
|
5
|
+
import { C as sendControllerResponse, S as getControllerScope, b as createRequestContext, x as getControllerContext, y as createFastifyHandler } from "../actionPermissions-5N04zBL4.mjs";
|
|
6
|
+
import { a as defineResourceVariants, i as getEntityQuery, n as getEntityId, o as mergeResourceConfig, r as getEntityIdField, s as defineAction, t as getActionTarget } from "../core-COcqo0Cp.mjs";
|
|
7
|
+
import { a as ResourceDefinition, i as validateResourceConfig, n as assertValidConfig, r as formatValidationErrors, t as defineResource } from "../defineResource-gUp9ug66.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, DEFAULT_VERSION_FIELD, 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, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAction, defineAggregation, defineResource, defineResourceVariants, formatValidationErrors, getActionTarget, 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.44.0 | MIT | https://classytic.com */
|
|
2
|
+
import "./constants-B2QHb6u6.mjs";
|
|
3
|
+
import { t as defineResource } from "./defineResource-gUp9ug66.mjs";
|
|
4
4
|
//#region src/core/defineAction.ts
|
|
5
5
|
/**
|
|
6
6
|
* Build an `ActionDefinition` with a typed handler. The literal schema
|
|
@@ -173,5 +173,14 @@ function getEntityQuery(req) {
|
|
|
173
173
|
if (id === void 0) return {};
|
|
174
174
|
return { [getEntityIdField(req)]: id };
|
|
175
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* The row the action-target fence loaded for this request, so the handler need not read it
|
|
178
|
+
* again. `undefined` when no fence read happened (untenanted resource, `scope: 'handler'`,
|
|
179
|
+
* id-less action) — load it yourself then. It is a snapshot taken after the idempotency lock
|
|
180
|
+
* and before the handler: a guarded write must still carry its precondition in the filter.
|
|
181
|
+
*/
|
|
182
|
+
function getActionTarget(req) {
|
|
183
|
+
return req.arc?.actionTarget;
|
|
184
|
+
}
|
|
176
185
|
//#endregion
|
|
177
|
-
export {
|
|
186
|
+
export { defineResourceVariants as a, getEntityQuery as i, getEntityId as n, mergeResourceConfig as o, getEntityIdField as r, defineAction as s, getActionTarget as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import {
|
|
3
|
-
import "./constants-
|
|
4
|
-
import { f as createError, i as NotFoundError, u as ValidationError } from "./errors-
|
|
5
|
-
import { C as sendControllerResponse, _ as buildArcDecorator, a as resolveRouterPluginMw, f as buildRouteHooks, g as buildAuthMiddlewareForPermissions, i as buildRouteConfig, l as resolvePipelineSteps, m as routeHookOptions, n as tryRegisterRoute, o as selectPluginMw, r as buildRateLimitConfig, s as buildActionPipelineHandler, u as buildActionPermissionMw } from "./actionPermissions-
|
|
6
|
-
import { n as schemaIRToJsonSchemaBranch, t as normalizeSchemaIR } from "./schemaIR-
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
import { r as __exportAll } from "./rolldown-runtime-MYrLNGnq.mjs";
|
|
3
|
+
import "./constants-B2QHb6u6.mjs";
|
|
4
|
+
import { f as createError, i as NotFoundError, u as ValidationError } from "./errors-CW4anJBy.mjs";
|
|
5
|
+
import { C as sendControllerResponse, _ as buildArcDecorator, a as resolveRouterPluginMw, f as buildRouteHooks, g as buildAuthMiddlewareForPermissions, i as buildRouteConfig, l as resolvePipelineSteps, m as routeHookOptions, n as tryRegisterRoute, o as selectPluginMw, r as buildRateLimitConfig, s as buildActionPipelineHandler, u as buildActionPermissionMw } from "./actionPermissions-5N04zBL4.mjs";
|
|
6
|
+
import { n as schemaIRToJsonSchemaBranch, t as normalizeSchemaIR } from "./schemaIR-BA0Hb21Y.mjs";
|
|
7
7
|
//#region src/core/createActionRouter.ts
|
|
8
8
|
var createActionRouter_exports = /* @__PURE__ */ __exportAll({
|
|
9
9
|
buildActionBodySchema: () => buildActionBodySchema,
|
|
@@ -37,7 +37,7 @@ async function auditAction(req, resource, id, action) {
|
|
|
37
37
|
* (keyed by `body.action` at request time).
|
|
38
38
|
*/
|
|
39
39
|
function createActionRouter(fastify, config) {
|
|
40
|
-
const { tag, resourceName = tag ?? "action", actions, actionPermissions = {}, actionSchemas = {}, globalAuth, onError, fields: fieldPermissions, schemaOptions, idField = "_id", permissions: resourcePermissions, routeGuards = [], tenantMiddlewares = [], pipeline, rateLimit, idLessActionNames = [], extensions, isTargetVisible, handlerScopedActionNames = [], idempotentActionNames = [], handlerDedupOwners = {}, auditActions = false } = config;
|
|
40
|
+
const { tag, resourceName = tag ?? "action", actions, actionPermissions = {}, actionSchemas = {}, globalAuth, onError, fields: fieldPermissions, schemaOptions, idField = "_id", permissions: resourcePermissions, routeGuards = [], tenantMiddlewares = [], pipeline, rateLimit, idLessActionNames = [], extensions, isTargetVisible, loadTarget, handlerScopedActionNames = [], idempotentActionNames = [], handlerDedupOwners = {}, auditActions = false } = config;
|
|
41
41
|
const handlerScoped = new Set(handlerScopedActionNames);
|
|
42
42
|
const allActionNames = Object.keys(actions);
|
|
43
43
|
if (allActionNames.length === 0) {
|
|
@@ -169,7 +169,17 @@ function createActionRouter(fastify, config) {
|
|
|
169
169
|
}
|
|
170
170
|
const handler = wrappedHandlers.get(action);
|
|
171
171
|
if (!handler) throw createError(400, `Invalid action '${action}'. Valid actions: ${actionSubset.join(", ")}`, { validActions: actionSubset });
|
|
172
|
-
if (hasId && isTargetVisible && !handlerScoped.has(action)
|
|
172
|
+
if (hasId && (loadTarget || isTargetVisible) && !handlerScoped.has(action)) {
|
|
173
|
+
const target = loadTarget ? await loadTarget(id, req) : { visible: await isTargetVisible(id, req) };
|
|
174
|
+
if (!target.visible) throw new NotFoundError(resourceName);
|
|
175
|
+
if (target.doc !== void 0) {
|
|
176
|
+
const reqWithExtras = req;
|
|
177
|
+
reqWithExtras.arc = {
|
|
178
|
+
...reqWithExtras.arc ?? {},
|
|
179
|
+
actionTarget: target.doc
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
}
|
|
173
183
|
try {
|
|
174
184
|
const response = await handler(id, data, req);
|
|
175
185
|
if (auditActions && (response.status ?? 200) < 400) await auditAction(req, resourceName, id, action);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { f as createError } from "./errors-
|
|
3
|
-
import { u as getRequestScope } from "./types-
|
|
4
|
-
import { _ as buildArcDecorator, a as resolveRouterPluginMw, f as buildRouteHooks, h as buildAuthMiddleware, m as routeHookOptions, n as tryRegisterRoute, o as selectPluginMw, r as buildRateLimitConfig } from "./actionPermissions-
|
|
5
|
-
import { n as evaluateAndApplyPermission } from "./authorizationDecision-
|
|
6
|
-
import { n as validateAggregations } from "./validate-
|
|
7
|
-
import { t as buildAggregationHandler } from "./buildHandler-
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
import { f as createError } from "./errors-CW4anJBy.mjs";
|
|
3
|
+
import { u as getRequestScope } from "./types-fvO6Ovzx.mjs";
|
|
4
|
+
import { _ as buildArcDecorator, a as resolveRouterPluginMw, f as buildRouteHooks, h as buildAuthMiddleware, m as routeHookOptions, n as tryRegisterRoute, o as selectPluginMw, r as buildRateLimitConfig } from "./actionPermissions-5N04zBL4.mjs";
|
|
5
|
+
import { n as evaluateAndApplyPermission } from "./authorizationDecision-wX3SA9w_.mjs";
|
|
6
|
+
import { n as validateAggregations } from "./validate-CWp-lsrm.mjs";
|
|
7
|
+
import { t as buildAggregationHandler } from "./buildHandler-Bswu_vNb.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
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import {
|
|
3
|
-
import { a as enterArcLoggerScope, i as runWithArcLogger, n as configureArcLogger, r as createPinoWriter, t as arcLog } from "./logger-
|
|
4
|
-
import { n as PUBLIC_SCOPE } from "./types-
|
|
5
|
-
import { r as initRuntimeCapabilityRegistry, t as auditRuntimeCapabilities } from "./runtimeCapabilities-
|
|
6
|
-
import { a as runShutdown, t as initShutdownRegistry } from "./shutdown-
|
|
7
|
-
import { n as isScopeAwareKeyGenerator, t as createTenantKeyGenerator } from "./rateLimitKey-
|
|
8
|
-
import { i as resolveResourceRateLimiter, n as markRateLimitingDisabled } from "./resourceRateLimit-
|
|
9
|
-
import { r as markArcRootValidator, t as arcAjvCustomOptions } from "./routeValidator-
|
|
10
|
-
import { c as createRequestIdGenerator, r as mergeHealthChecks } from "./health-
|
|
11
|
-
import { t as parseJsonBody } from "./jsonBody-
|
|
12
|
-
import { a as portsForModule, b as verifyEventDurability, f as resolveModuleArm, g as crudEventsOf, h as buildModuleGraph, m as analyzeModuleGraph, n as composeModules, x as verifyModuleGraph } from "./plan-
|
|
13
|
-
import { c as wrapWithAttribution, f as defineEvent, l as wrapWithBoundary, r as CRUD_EVENT_SCHEMA } from "./eventTypes-
|
|
14
|
-
import { r as withSubscriberId } from "./subscriberIdentity-
|
|
15
|
-
import { r as getOptionalModuleExports } from "./module
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
import { r as __exportAll } from "./rolldown-runtime-MYrLNGnq.mjs";
|
|
3
|
+
import { a as enterArcLoggerScope, i as runWithArcLogger, n as configureArcLogger, r as createPinoWriter, t as arcLog } from "./logger-D4V1zGLI.mjs";
|
|
4
|
+
import { n as PUBLIC_SCOPE } from "./types-fvO6Ovzx.mjs";
|
|
5
|
+
import { r as initRuntimeCapabilityRegistry, t as auditRuntimeCapabilities } from "./runtimeCapabilities-DIMKMV2G.mjs";
|
|
6
|
+
import { a as runShutdown, t as initShutdownRegistry } from "./shutdown-LpLMH8T1.mjs";
|
|
7
|
+
import { n as isScopeAwareKeyGenerator, t as createTenantKeyGenerator } from "./rateLimitKey-DVEZ_UpV.mjs";
|
|
8
|
+
import { i as resolveResourceRateLimiter, n as markRateLimitingDisabled } from "./resourceRateLimit-urWPJxrt.mjs";
|
|
9
|
+
import { r as markArcRootValidator, t as arcAjvCustomOptions } from "./routeValidator-DHtpzrzk.mjs";
|
|
10
|
+
import { c as createRequestIdGenerator, r as mergeHealthChecks } from "./health-CrqUp3sz.mjs";
|
|
11
|
+
import { t as parseJsonBody } from "./jsonBody-YIq-vGLv.mjs";
|
|
12
|
+
import { a as portsForModule, b as verifyEventDurability, f as resolveModuleArm, g as crudEventsOf, h as buildModuleGraph, m as analyzeModuleGraph, n as composeModules, x as verifyModuleGraph } from "./plan-CJGMKoui.mjs";
|
|
13
|
+
import { c as wrapWithAttribution, f as defineEvent, l as wrapWithBoundary, r as CRUD_EVENT_SCHEMA } from "./eventTypes-N4-omQFR.mjs";
|
|
14
|
+
import { r as withSubscriberId } from "./subscriberIdentity-DeyppIif.mjs";
|
|
15
|
+
import { r as getOptionalModuleExports } from "./module--L0iBIZz.mjs";
|
|
16
16
|
import { isProductionEnv, readEnv } from "@classytic/primitives/environment";
|
|
17
17
|
import Fastify from "fastify";
|
|
18
18
|
import qs from "qs";
|
|
@@ -774,7 +774,7 @@ async function registerArcCore(fastify, config, trackPlugin) {
|
|
|
774
774
|
await fastify.register(arcCorePlugin, { emitEvents: config.arcPlugins?.emitEvents !== false });
|
|
775
775
|
trackPlugin("arc-core");
|
|
776
776
|
if (config.arcPlugins?.events !== false) {
|
|
777
|
-
const { default: eventPlugin } = await import("./eventPlugin-
|
|
777
|
+
const { default: eventPlugin } = await import("./eventPlugin-BweHAVws.mjs").then((n) => n.r);
|
|
778
778
|
const eventOpts = typeof config.arcPlugins?.events === "object" ? config.arcPlugins.events : {};
|
|
779
779
|
await fastify.register(eventPlugin, {
|
|
780
780
|
/**
|
|
@@ -829,15 +829,15 @@ async function registerArcPlugins(fastify, config, trackPlugin, modules, moduleH
|
|
|
829
829
|
trackPlugin("arc-graceful-shutdown", shutdownOpts);
|
|
830
830
|
}
|
|
831
831
|
if (config.arcPlugins?.caching) {
|
|
832
|
-
const { default: cachingPlugin } = await import("./caching-
|
|
832
|
+
const { default: cachingPlugin } = await import("./caching-Drp68DIS.mjs").then((n) => n.n);
|
|
833
833
|
const opts = config.arcPlugins.caching === true ? {} : config.arcPlugins.caching;
|
|
834
834
|
await fastify.register(cachingPlugin, opts);
|
|
835
835
|
trackPlugin("arc-caching", opts);
|
|
836
836
|
}
|
|
837
837
|
if (config.arcPlugins?.queryCache) {
|
|
838
|
-
const { queryCachePlugin } = await import("./queryCachePlugin-
|
|
838
|
+
const { queryCachePlugin } = await import("./queryCachePlugin-BATECpyh.mjs").then((n) => n.n);
|
|
839
839
|
const opts = config.arcPlugins.queryCache === true ? {} : config.arcPlugins.queryCache;
|
|
840
|
-
const store = config.stores?.queryCache ?? new (await (import("./memory-
|
|
840
|
+
const store = config.stores?.queryCache ?? new (await (import("./memory-CTa5pOCW.mjs").then((n) => n.n))).MemoryCacheStore();
|
|
841
841
|
await fastify.register(queryCachePlugin, {
|
|
842
842
|
store,
|
|
843
843
|
...opts
|
|
@@ -847,7 +847,7 @@ async function registerArcPlugins(fastify, config, trackPlugin, modules, moduleH
|
|
|
847
847
|
if (config.arcPlugins?.sse) {
|
|
848
848
|
if (config.arcPlugins?.events === false) fastify.log.warn("SSE plugin requires events plugin (arcPlugins.events). SSE disabled.");
|
|
849
849
|
else {
|
|
850
|
-
const { default: ssePlugin } = await import("./sse-
|
|
850
|
+
const { default: ssePlugin } = await import("./sse-BzJFPX_1.mjs").then((n) => n.n);
|
|
851
851
|
const opts = config.arcPlugins.sse === true ? {} : config.arcPlugins.sse;
|
|
852
852
|
await fastify.register(ssePlugin, opts);
|
|
853
853
|
trackPlugin("arc-sse", opts);
|
|
@@ -856,20 +856,20 @@ async function registerArcPlugins(fastify, config, trackPlugin, modules, moduleH
|
|
|
856
856
|
if (config.arcPlugins?.realtime) {
|
|
857
857
|
if (config.arcPlugins?.events === false) fastify.log.warn("Realtime plugin requires events plugin (arcPlugins.events). Realtime disabled.");
|
|
858
858
|
else {
|
|
859
|
-
const { default: realtimePlugin } = await import("./realtime-
|
|
859
|
+
const { default: realtimePlugin } = await import("./realtime-xyubMKSB.mjs").then((n) => n.n);
|
|
860
860
|
const opts = config.arcPlugins.realtime === true ? {} : config.arcPlugins.realtime;
|
|
861
861
|
await fastify.register(realtimePlugin, opts);
|
|
862
862
|
trackPlugin("arc-realtime", opts);
|
|
863
863
|
}
|
|
864
864
|
}
|
|
865
865
|
if (config.arcPlugins?.metrics) {
|
|
866
|
-
const { default: metricsPlugin } = await import("./metrics-
|
|
866
|
+
const { default: metricsPlugin } = await import("./metrics-DsZrvnpB.mjs").then((n) => n.n);
|
|
867
867
|
const opts = config.arcPlugins.metrics === true ? {} : config.arcPlugins.metrics;
|
|
868
868
|
await fastify.register(metricsPlugin, opts);
|
|
869
869
|
trackPlugin("arc-metrics", opts);
|
|
870
870
|
}
|
|
871
871
|
if (config.arcPlugins?.versioning) {
|
|
872
|
-
const { default: versioningPlugin } = await import("./versioning-
|
|
872
|
+
const { default: versioningPlugin } = await import("./versioning-CHhL9P3o.mjs").then((n) => n.n);
|
|
873
873
|
await fastify.register(versioningPlugin, config.arcPlugins.versioning);
|
|
874
874
|
trackPlugin("arc-versioning", config.arcPlugins.versioning);
|
|
875
875
|
}
|
|
@@ -946,7 +946,7 @@ async function registerAuth(fastify, config, trackPlugin) {
|
|
|
946
946
|
*/
|
|
947
947
|
async function registerElevation(fastify, config, trackPlugin) {
|
|
948
948
|
if (!config.elevation) return;
|
|
949
|
-
const { elevationPlugin } = await import("./elevation-
|
|
949
|
+
const { elevationPlugin } = await import("./elevation-BG4gnMsJ.mjs").then((n) => n.n);
|
|
950
950
|
await fastify.register(elevationPlugin, config.elevation);
|
|
951
951
|
trackPlugin("arc-elevation", config.elevation);
|
|
952
952
|
fastify.log.debug("Elevation plugin enabled");
|
|
@@ -961,7 +961,7 @@ async function registerElevation(fastify, config, trackPlugin) {
|
|
|
961
961
|
*/
|
|
962
962
|
async function registerErrorHandler(fastify, config, trackPlugin, moduleErrorMappers) {
|
|
963
963
|
if (config.errorHandler === false) return;
|
|
964
|
-
const { errorHandlerPlugin } = await import("./errorHandler-
|
|
964
|
+
const { errorHandlerPlugin } = await import("./errorHandler-COHw3N1b.mjs").then((n) => n.r);
|
|
965
965
|
/**
|
|
966
966
|
* DISCLOSURE DEFAULTS MERGE — they used to be REPLACED, and that was two bugs.
|
|
967
967
|
*
|
|
@@ -1180,7 +1180,7 @@ async function registerResources(fastify, config, preResolvedModules, skippedBri
|
|
|
1180
1180
|
let discoveryPath;
|
|
1181
1181
|
let discoveryYieldedZero = false;
|
|
1182
1182
|
if (resolvedResources === void 0 && config.resourceDir) {
|
|
1183
|
-
const { loadResources } = await import("./loadResources-
|
|
1183
|
+
const { loadResources } = await import("./loadResources-6jO52-RR.mjs").then((n) => n.n);
|
|
1184
1184
|
const { resolve, dirname } = await import("node:path");
|
|
1185
1185
|
const { fileURLToPath } = await import("node:url");
|
|
1186
1186
|
const rawDir = config.resourceDir;
|
|
@@ -1261,10 +1261,12 @@ Resources supplied by "${m.name}": ${provided}.`);
|
|
|
1261
1261
|
else prefixed.push(resource);
|
|
1262
1262
|
for (const resource of root) await registerOne(fastify, resource, config.mountRoutes);
|
|
1263
1263
|
if (prefixed.length) {
|
|
1264
|
-
if (config.resourcePrefix)
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1264
|
+
if (config.resourcePrefix) {
|
|
1265
|
+
const registerPrefixed = async (scoped) => {
|
|
1266
|
+
for (const resource of prefixed) await registerOne(scoped, resource, config.mountRoutes);
|
|
1267
|
+
};
|
|
1268
|
+
await fastify.register(registerPrefixed, { prefix: config.resourcePrefix });
|
|
1269
|
+
} else for (const resource of prefixed) await registerOne(fastify, resource, config.mountRoutes);
|
|
1268
1270
|
}
|
|
1269
1271
|
const names = resolvedResources.map((r) => r.name ?? "?").join(", ");
|
|
1270
1272
|
const prefix = config.resourcePrefix ? ` (prefix: ${config.resourcePrefix})` : "";
|
|
@@ -1303,7 +1305,7 @@ Resources supplied by "${m.name}": ${provided}.`);
|
|
|
1303
1305
|
if (fastify.hasDecorator("getScheduleStats")) throw new Error("[arc] modules declare scheduledJobs but schedulesPlugin was already registered manually. Configure their runner through arcPlugins.schedules so Arc can compose one schedule table.");
|
|
1304
1306
|
const frozenJobs = Object.freeze(scheduledJobs.map((job) => Object.freeze({ ...job })));
|
|
1305
1307
|
const scheduleOptions = typeof config.arcPlugins?.schedules === "object" ? config.arcPlugins.schedules : {};
|
|
1306
|
-
const { default: schedulesPlugin } = await import("./schedules-
|
|
1308
|
+
const { default: schedulesPlugin } = await import("./schedules-CKTs5ys8.mjs").then((n) => n.n);
|
|
1307
1309
|
await fastify.register(schedulesPlugin, {
|
|
1308
1310
|
...scheduleOptions,
|
|
1309
1311
|
schedules: frozenJobs
|
|
@@ -2009,7 +2011,7 @@ async function buildApp(options, loggerScope, onInstance, onBootDisposer) {
|
|
|
2009
2011
|
await registerErrorHandler(fastify, config, trackPlugin, moduleErrorMappers);
|
|
2010
2012
|
await registerResources(fastify, config, resolvedModules, skippedBridges);
|
|
2011
2013
|
if (config.replyHelpers) {
|
|
2012
|
-
const { replyHelpersPlugin } = await import("./replyHelpers-
|
|
2014
|
+
const { replyHelpersPlugin } = await import("./replyHelpers-Bnc6lJyy.mjs").then((n) => n.n);
|
|
2013
2015
|
await fastify.register(replyHelpersPlugin);
|
|
2014
2016
|
}
|
|
2015
2017
|
if (config.serializeBigInt) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { _ as ToolDefinition, c as McpAuthResult, r as CreateMcpServerConfig } from "./types-
|
|
2
|
+
import { _ as ToolDefinition, c as McpAuthResult, r as CreateMcpServerConfig } from "./types-D3Ixsh00.mjs";
|
|
3
3
|
//#region src/integrations/mcp/createMcpServer.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Mutable auth ref — updated per-request by mcpPlugin.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { m as MUTATION_OPERATIONS, t as CRUD_OPERATIONS } from "./constants-
|
|
3
|
-
import { t as arcLog } from "./logger-
|
|
4
|
-
import { a as autoInjectTenantFieldRules, c as BaseController, i as resolveOpenApiSchemas, t as buildResourcePlugin, v as detectOverriddenWriteSlots, y as isWriteVerbCapable } from "./plugin-
|
|
5
|
-
import { B as requireAuth } from "./permissions-
|
|
6
|
-
import { n as getAvailablePresets, t as applyPresets } from "./presets-
|
|
7
|
-
import { t as pluralize } from "./pluralize-
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
import { m as MUTATION_OPERATIONS, t as CRUD_OPERATIONS } from "./constants-B2QHb6u6.mjs";
|
|
3
|
+
import { t as arcLog } from "./logger-D4V1zGLI.mjs";
|
|
4
|
+
import { a as autoInjectTenantFieldRules, c as BaseController, i as resolveOpenApiSchemas, t as buildResourcePlugin, v as detectOverriddenWriteSlots, y as isWriteVerbCapable } from "./plugin-DALd9dcF.mjs";
|
|
5
|
+
import { B as requireAuth } from "./permissions-C5ijIz5Q.mjs";
|
|
6
|
+
import { n as getAvailablePresets, t as applyPresets } from "./presets-CONf2Qem.mjs";
|
|
7
|
+
import { t as pluralize } from "./pluralize-COUNYo3d.mjs";
|
|
8
8
|
import { isReadOnlyRepo } from "@classytic/repo-core/repository";
|
|
9
9
|
import { readEnv } from "@classytic/primitives/environment";
|
|
10
10
|
//#region src/core/defineResource/writeVerbs.ts
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { FastifyPluginAsync } from "fastify";
|
|
3
3
|
//#region src/discovery/index.d.ts
|
|
4
4
|
/** A discovered resource — must have toPlugin() method */
|
|
5
|
-
interface DiscoverableResource {
|
|
5
|
+
export interface DiscoverableResource {
|
|
6
6
|
toPlugin(): FastifyPluginAsync;
|
|
7
7
|
name?: string;
|
|
8
8
|
definition?: {
|
|
9
9
|
name: string;
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
interface DiscoveryOptions {
|
|
12
|
+
export interface DiscoveryOptions {
|
|
13
13
|
/** Directories to scan (relative to cwd or absolute) */
|
|
14
14
|
paths: string[];
|
|
15
15
|
/**
|
|
@@ -27,7 +27,7 @@ interface DiscoveryOptions {
|
|
|
27
27
|
/** Whether to scan recursively (default: true) */
|
|
28
28
|
recursive?: boolean;
|
|
29
29
|
}
|
|
30
|
-
interface DiscoveryPluginOptions extends DiscoveryOptions {
|
|
30
|
+
export interface DiscoveryPluginOptions extends DiscoveryOptions {
|
|
31
31
|
/** URL prefix applied to all discovered resources */
|
|
32
32
|
prefix?: string;
|
|
33
33
|
}
|
|
@@ -36,11 +36,10 @@ interface DiscoveryPluginOptions extends DiscoveryOptions {
|
|
|
36
36
|
*
|
|
37
37
|
* @returns Array of discovered resources with their file paths
|
|
38
38
|
*/
|
|
39
|
-
declare function discoverResources(options: DiscoveryOptions): Promise<Array<{
|
|
39
|
+
export declare function discoverResources(options: DiscoveryOptions): Promise<Array<{
|
|
40
40
|
resource: DiscoverableResource;
|
|
41
41
|
filePath: string;
|
|
42
42
|
}>>;
|
|
43
43
|
/** Auto-discovery plugin for Arc resources */
|
|
44
|
-
declare const discoveryPlugin: FastifyPluginAsync<DiscoveryPluginOptions>;
|
|
45
|
-
//#endregion
|
|
46
|
-
export { DiscoverableResource, DiscoveryOptions, DiscoveryPluginOptions, discoverResources, discoveryPlugin };
|
|
44
|
+
export declare const discoveryPlugin: FastifyPluginAsync<DiscoveryPluginOptions>;
|
|
45
|
+
//#endregion
|
package/dist/discovery/index.mjs
CHANGED
package/dist/docs/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { o as RegistryEntry } from "../index-
|
|
2
|
+
import { o as RegistryEntry } from "../index-WH7xgvxS.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
|
|
@@ -149,7 +149,7 @@ interface SecurityScheme {
|
|
|
149
149
|
* Build OpenAPI spec from registry resources.
|
|
150
150
|
* Shared by HTTP docs endpoint and CLI export command.
|
|
151
151
|
*/
|
|
152
|
-
declare function buildOpenApiSpec(resources: RegistryEntry[], options?: OpenApiBuildOptions, externalPaths?: ExternalOpenApiPaths[]): OpenApiSpec;
|
|
152
|
+
export declare function buildOpenApiSpec(resources: RegistryEntry[], options?: OpenApiBuildOptions, externalPaths?: ExternalOpenApiPaths[]): OpenApiSpec;
|
|
153
153
|
declare const _default: FastifyPluginAsync<OpenApiOptions>;
|
|
154
154
|
//#endregion
|
|
155
155
|
//#region src/docs/scalar.d.ts
|
|
@@ -175,4 +175,4 @@ interface ScalarOptions {
|
|
|
175
175
|
}
|
|
176
176
|
declare const _default$1: FastifyPluginAsync<ScalarOptions>;
|
|
177
177
|
//#endregion
|
|
178
|
-
export { type ExternalOpenApiPaths, type OpenApiBuildOptions, type OpenApiOptions, type OpenApiSpec, type ScalarOptions,
|
|
178
|
+
export { type ExternalOpenApiPaths, type OpenApiBuildOptions, type OpenApiOptions, type OpenApiSpec, type ScalarOptions, _default as openApiPlugin, _default$1 as scalarPlugin };
|
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 openapi_default, t as buildOpenApiSpec } from "../openapi-
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as getUserRoles } from "../userHelpers-C76zD5pa.mjs";
|
|
3
|
+
import { n as openapi_default, t as buildOpenApiSpec } from "../openapi-CMegfsm8.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 {
|
|
3
|
-
import { t as arcLog } from "./logger-
|
|
4
|
-
import { n as requireSingleHeaderValue } from "./headers-
|
|
5
|
-
import { n as getUserRoles } from "./userHelpers-
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
import { r as __exportAll } from "./rolldown-runtime-MYrLNGnq.mjs";
|
|
3
|
+
import { t as arcLog } from "./logger-D4V1zGLI.mjs";
|
|
4
|
+
import { n as requireSingleHeaderValue } from "./headers-DKZQKL-Z.mjs";
|
|
5
|
+
import { n as getUserRoles } from "./userHelpers-C76zD5pa.mjs";
|
|
6
6
|
import { ARC_ERROR_CODES } from "@classytic/repo-core/errors";
|
|
7
7
|
import fp from "fastify-plugin";
|
|
8
8
|
//#region src/scope/elevation.ts
|