@classytic/arc 2.38.0 → 2.40.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-CYaDvmOB.mjs → BaseController-BqJtbiUA.mjs} +107 -23
- package/dist/{EventTransport-Cx60_s-6.d.mts → EventTransport-BPOQsEer.d.mts} +8 -0
- package/dist/{EventTransport-Gq7JWbWw.mjs → EventTransport-BUkTwY_x.mjs} +13 -2
- package/dist/{HookSystem-C0ikzqQf.mjs → HookSystem-96nzZLmk.mjs} +2 -2
- package/dist/{ResourceRegistry-DPcX--zk.mjs → ResourceRegistry-B9WnuG2Q.mjs} +2 -2
- package/dist/{actionPermissions-jlFZ1it4.mjs → actionPermissions-4OGbe3Hf.mjs} +6 -6
- package/dist/audit/index.d.mts +1 -1
- package/dist/audit/index.mjs +2 -2
- package/dist/auth/audit.mjs +1 -1
- package/dist/auth/index.d.mts +1 -1
- package/dist/auth/index.mjs +6 -6
- package/dist/auth/redis-session.mjs +1 -1
- package/dist/{authorizationDecision-BP8GHtjc.mjs → authorizationDecision-D_LFvMlm.mjs} +2 -2
- package/dist/{buildHandler-DjXOqIvX.mjs → buildHandler-BG_CHXqQ.mjs} +4 -4
- package/dist/cache/index.mjs +4 -4
- package/dist/{caching-a3ZEcJJs.mjs → caching-Bqcn3Brl.mjs} +2 -2
- package/dist/cleanup/index.d.mts +2 -2
- package/dist/cleanup/index.mjs +21 -5
- 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-BONghE1Y.mjs → constants-BQ2FbhPB.mjs} +1 -1
- package/dist/context/index.d.mts +34 -6
- package/dist/context/index.mjs +12 -19
- package/dist/core/index.d.mts +2 -2
- package/dist/core/index.mjs +7 -7
- package/dist/{core-8She7FgF.mjs → core-CsZR037F.mjs} +3 -3
- package/dist/{createActionRouter-Bqi6Bhhx.mjs → createActionRouter-BR93gCKg.mjs} +7 -7
- package/dist/{createAggregationRouter-BsYO7ktd.mjs → createAggregationRouter-CF40Aw95.mjs} +7 -7
- package/dist/createMcpServer-BVTs2S5G.d.mts +48 -0
- package/dist/{defineAggregation-0KBvqEEC.mjs → defineAggregation-BDA2Tw7v.mjs} +1 -1
- package/dist/{defineResource-BMdyRelW.mjs → defineResource-DaIySrQr.mjs} +20 -22
- 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-C6woysGC.mjs → elevation-CZy6n50b.mjs} +4 -4
- package/dist/encryption/index.mjs +3 -3
- package/dist/{errorHandler-DI5AN2b5.d.mts → errorHandler--4rSMMvq.d.mts} +7 -1
- package/dist/{errorHandler-BdmIWPba.mjs → errorHandler-By9keRvX.mjs} +3 -3
- package/dist/{errors-2ExmOgIJ.mjs → errors-BHD3L8of.mjs} +1 -1
- package/dist/{eventPlugin-DJwpGMzx.mjs → eventPlugin-DB26V7uX.mjs} +5 -5
- package/dist/{eventPlugin-DFvHa4Nf.d.mts → eventPlugin-DfHaKEWQ.d.mts} +1 -1
- package/dist/events/index.d.mts +4 -4
- package/dist/events/index.mjs +5 -5
- package/dist/events/transports/redis-stream-entry.d.mts +1 -1
- package/dist/events/transports/redis-stream-entry.mjs +21 -20
- package/dist/events/transports/redis.d.mts +1 -1
- package/dist/events/transports/redis.mjs +11 -8
- package/dist/factory/index.d.mts +4 -4
- package/dist/factory/index.mjs +5 -5
- package/dist/{fastify-augmentation-jYA2oHyL.d.mts → fastify-augmentation-HncZMmze.d.mts} +3 -3
- package/dist/{fields-Cha2QCKH.mjs → fields-fA-Dkou5.mjs} +1 -1
- package/dist/{generate-BUP4Oydg.mjs → generate-BSSdtiOy.mjs} +4 -3
- package/dist/{headers-DeXNifVj.mjs → headers-BFEEshDS.mjs} +2 -2
- package/dist/{health-Bh0N_FLk.mjs → health-BlGHjkqZ.mjs} +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/idempotency/index.mjs +4 -4
- package/dist/idempotency/redis.mjs +1 -1
- package/dist/{index-B78WZom8.d.mts → index-D3sIPcD4.d.mts} +47 -11
- package/dist/{index-D2uIUSQk.d.mts → index-DbMglURO.d.mts} +2 -2
- package/dist/{index-BRoDtjek.d.mts → index-SCsOJxWB.d.mts} +2 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +11 -11
- package/dist/{init-Dg_Am2o_.mjs → init-pl88PHzb.mjs} +9 -9
- package/dist/integrations/event-gateway.d.mts +1 -1
- 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 +2 -2
- package/dist/integrations/mcp/index.d.mts +3 -46
- package/dist/integrations/mcp/index.mjs +2 -2
- package/dist/integrations/mcp/testing.d.mts +22 -2
- package/dist/integrations/mcp/testing.mjs +55 -33
- package/dist/integrations/streamline.mjs +3 -3
- package/dist/integrations/webhooks.d.mts +2 -2
- package/dist/integrations/webhooks.mjs +3 -3
- package/dist/integrations/websocket-pushref-redis.mjs +1 -1
- package/dist/integrations/websocket-redis.mjs +1 -1
- package/dist/integrations/websocket.mjs +13 -6
- package/dist/{interface-DYPVscCU.mjs → interface-DjtFnZxH.mjs} +1 -1
- package/dist/{jsonBody-DVui0uJl.mjs → jsonBody-Dx6jH_Nb.mjs} +2 -2
- package/dist/{keys-BSuxGS-B.mjs → keys-Ds3ekBiu.mjs} +1 -1
- package/dist/{loadResources-CNd1DWnK.mjs → loadResources-E5UFlRrT.mjs} +2 -2
- package/dist/{loadResourcesFromEntry-DNj8cpiY.mjs → loadResourcesFromEntry-C2jrJbWG.mjs} +2 -2
- package/dist/logger/index.mjs +1 -1
- package/dist/{mcpPlugin-KWsezMx7.mjs → mcpPlugin-D-3OLxNz.mjs} +75 -31
- package/dist/{memory-BiPVaCPg.mjs → memory-CNvjxzB2.mjs} +2 -2
- package/dist/{metrics-CsWaIVTa.mjs → metrics-P37sNV5H.mjs} +2 -2
- package/dist/middleware/index.d.mts +1 -1
- package/dist/middleware/index.mjs +3 -3
- package/dist/migrations/index.mjs +2 -2
- package/dist/{module-BQXHxMEk.mjs → module-CNcwCKUJ.mjs} +1 -1
- package/dist/{multipartBody-u6VrS_iH.mjs → multipartBody-Bl_gU3Wg.mjs} +1 -1
- package/dist/{openapi-Dxc8RLy_.mjs → openapi-BYrL8zvY.mjs} +6 -6
- package/dist/outbox-admin/index.d.mts +1 -1
- package/dist/outbox-admin/index.mjs +4 -4
- package/dist/{outbox-module-DyIqA5vo.mjs → outbox-module-6DMC_WNu.mjs} +40 -21
- package/dist/{outbox-module-CQXu_O6o.d.mts → outbox-module-CzsKRBvO.d.mts} +11 -2
- package/dist/permissions/index.mjs +5 -5
- package/dist/{permissions-H7Zcb82Z.mjs → permissions-C0GpDsB_.mjs} +6 -6
- package/dist/{pipe-SunhEaZ6.mjs → pipe-4_XamfxI.mjs} +2 -2
- package/dist/pipeline/index.d.mts +1 -1
- package/dist/pipeline/index.mjs +2 -2
- package/dist/plugins/index.d.mts +5 -5
- package/dist/plugins/index.mjs +17 -16
- package/dist/plugins/response-cache.mjs +2 -2
- package/dist/plugins/tracing-entry.mjs +2 -2
- package/dist/{pluralize-Da7IT_qJ.mjs → pluralize-BaQ62hOW.mjs} +1 -1
- package/dist/{preloadResources-DlhH81py.mjs → preloadResources-BAx5s9EF.mjs} +70 -21
- package/dist/{preloadResources-BbBkNkqK.d.mts → preloadResources-DVgPCNcD.d.mts} +7 -7
- package/dist/presets/filesUpload.d.mts +1 -1
- package/dist/presets/filesUpload.mjs +5 -5
- package/dist/presets/index.d.mts +1 -1
- 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 +1 -1
- package/dist/presets/search.mjs +2 -2
- package/dist/{presets-CNyfaxGL.mjs → presets-CAaqVVcW.mjs} +4 -4
- package/dist/{projection-DSfEoooA.mjs → projection-qbCOEvsh.mjs} +2 -2
- package/dist/{queryCachePlugin-oTsmVyEQ.mjs → queryCachePlugin-2Pp9w-8D.mjs} +5 -5
- package/dist/rateLimitKey-umrS6-vu.mjs +41 -0
- package/dist/{realtime-CPmjjgqd.mjs → realtime-zzoNLDtj.mjs} +9 -9
- package/dist/{redis-stream-eh0eOtjh.d.mts → redis-stream-DSsPyYzd.d.mts} +7 -2
- package/dist/{registerRoute-XvcI_3sh.mjs → registerRoute-_6zHiz0x.mjs} +6 -6
- package/dist/registry/index.d.mts +2 -2
- package/dist/registry/index.mjs +3 -3
- package/dist/{registry-UFEJQN8R.mjs → registry-CEpoRpLP.mjs} +2 -2
- package/dist/{renewingLease-DuRGVOMe.mjs → renewingLease-B5Grm0pI.mjs} +1 -1
- package/dist/{replyHelpers-BHebarf0.mjs → replyHelpers-9h-a592u.mjs} +2 -2
- package/dist/{requestContext-DpmntRZy.mjs → requestContext-D4PuGhEw.mjs} +1 -1
- package/dist/{rolldown-runtime-Add2L50I.mjs → rolldown-runtime-DzE6ikSH.mjs} +1 -1
- package/dist/{runtimeCapabilities-D793Pxci.mjs → runtimeCapabilities-Bo7rSKjm.mjs} +1 -1
- package/dist/{schedules-DthM8Qag.mjs → schedules-Dm21pqHU.mjs} +8 -4
- package/dist/{schemaConverter-Db-MMsH6.mjs → schemaConverter-DENbixyA.mjs} +1 -1
- package/dist/{schemaIR-CIXShch7.mjs → schemaIR-C2qUNzC6.mjs} +2 -2
- package/dist/schemas/index.mjs +1 -1
- package/dist/scim/index.mjs +2 -2
- package/dist/scope/index.mjs +5 -5
- package/dist/{scope-D03sk17n.mjs → scope-CdYxQVxt.mjs} +4 -4
- package/dist/{simpleEqualityMatcher-B7qVjQBv.mjs → simpleEqualityMatcher-Cldubvul.mjs} +1 -1
- package/dist/{sse-D4MYqkic.mjs → sse-DbyXoQun.mjs} +5 -5
- package/dist/{sseStream-BuMNPR6r.mjs → sseStream-BfZtL5-m.mjs} +2 -2
- package/dist/{store-helpers-CIF4RG8s.mjs → store-helpers-BfyOd5i6.mjs} +1 -1
- package/dist/{streaming-DkpW1HwJ.mjs → streaming-CFwCzEvU.mjs} +1 -1
- package/dist/{subscribe-helpers-CBZOi6pk.mjs → subscribe-helpers-KgVEcn8L.mjs} +2 -2
- package/dist/sync/changelog.mjs +1 -1
- package/dist/testing/cleanupStoreContract.mjs +1 -1
- package/dist/testing/index.d.mts +4 -4
- package/dist/testing/index.mjs +10 -10
- package/dist/testing/outboxStoreContract.mjs +14 -3
- package/dist/testing/storageContract.mjs +1 -1
- package/dist/{transactionContext-DMmvcfdo.mjs → transactionContext-46KyUADP.mjs} +1 -1
- package/dist/{typeGuards-DHTnEs5X.mjs → typeGuards-t_CVgRXN.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-LQFwC37d.d.mts → types-9rvxn5Ym.d.mts} +46 -1
- package/dist/{types-BRU-Kd3t.d.mts → types-BVlowlm7.d.mts} +2 -2
- package/dist/{types-BqLyyH0o.mjs → types-CNQyOrLk.mjs} +4 -4
- package/dist/usage/index.mjs +0 -0
- package/dist/{userHelpers-CXySQFRg.mjs → userHelpers-DLueLQdQ.mjs} +1 -1
- package/dist/utils/index.d.mts +4 -4
- package/dist/utils/index.mjs +11 -11
- package/dist/{utils-BbGG8XNT.mjs → utils-CUFBrhq-.mjs} +14 -6
- package/dist/{validate-CidSeUrx.mjs → validate-DV3hRbsz.mjs} +2 -2
- package/dist/{versioning-C2r0eOZ4.mjs → versioning-BXwmj5SD.mjs} +3 -3
- package/dist/{versioning-B843jOYX.d.mts → versioning-P3V6ATyC.d.mts} +1 -1
- package/dist/workScope-CoGpuzDX.mjs +42 -0
- package/package.json +48 -39
- package/skills/arc/references/mcp.md +20 -0
- package/skills/arc/references/testing.md +0 -12
- package/skills/arc-code-review/references/anti-patterns.md +1 -1
- package/skills/arc-code-review/references/migration-recipes.md +0 -60
- package/skills/arc-code-review/references/mongokit-migration.md +0 -27
- package/skills/arc-module-publishing/references/package-manifest.md +3 -1
- package/dist/rateLimitKey-CewdR-m6.mjs +0 -15
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
3
|
-
import { t as
|
|
1
|
+
/*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-DzE6ikSH.mjs";
|
|
3
|
+
import { t as runWorkScope } from "./workScope-CoGpuzDX.mjs";
|
|
4
|
+
import { t as startRenewingLease } from "./renewingLease-B5Grm0pI.mjs";
|
|
4
5
|
import fp from "fastify-plugin";
|
|
5
6
|
//#region src/plugins/schedules.ts
|
|
6
7
|
var schedules_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -60,7 +61,10 @@ const schedulesPlugin = async (fastify, opts) => {
|
|
|
60
61
|
}
|
|
61
62
|
stat.runs++;
|
|
62
63
|
stat.lastRunAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
63
|
-
await
|
|
64
|
+
await runWorkScope({
|
|
65
|
+
kind: "job",
|
|
66
|
+
id: s.name
|
|
67
|
+
}, () => s.handler(fastify));
|
|
64
68
|
stat.lastError = null;
|
|
65
69
|
} catch (err) {
|
|
66
70
|
stat.failures++;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { o as toJsonSchema } from "./schemaConverter-
|
|
1
|
+
/*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
|
|
2
|
+
import { o as toJsonSchema } from "./schemaConverter-DENbixyA.mjs";
|
|
3
3
|
//#region src/core/schemaIR.ts
|
|
4
4
|
/**
|
|
5
5
|
* Schema IR — one canonical representation, two adapters.
|
package/dist/schemas/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
|
|
2
2
|
import { errorContractSchema, errorDetailSchema } from "@classytic/repo-core/errors";
|
|
3
3
|
import { Type, Type as Type$1 } from "typebox";
|
|
4
4
|
//#region src/schemas/index.ts
|
package/dist/scim/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as parseJsonBody } from "../jsonBody-
|
|
1
|
+
/*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as parseJsonBody } from "../jsonBody-Dx6jH_Nb.mjs";
|
|
3
3
|
import fp from "fastify-plugin";
|
|
4
4
|
//#region src/scim/errors.ts
|
|
5
5
|
var ScimError = class extends Error {
|
package/dist/scope/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { C as isService, D as requireUserId, E as requireTeamId, O as scopeFirstCtx, S as isOrgInScope, T as requireOrgId, _ as getUserRoles, a as getDPoPJkt, b as isElevated, c as getOrgId, d as getScopeContext, f as getScopeContextMap, g as getUserId, h as getTenantFromRequest, i as getClientId, l as getOrgRoles, m as getTeamId, n as PUBLIC_SCOPE, o as getMandate, p as getServiceScopes, r as getAncestorOrgIds, s as getOrgContext, t as AUTHENTICATED_SCOPE, u as getRequestScope, v as hasOrgAccess, w as requireClientId, x as isMember, y as isAuthenticated } from "../types-
|
|
3
|
-
import { n as elevation_default, t as elevationPlugin } from "../elevation-
|
|
4
|
-
import { t as createTenantKeyGenerator } from "../rateLimitKey-
|
|
5
|
-
import { t as resolveOrgFromHeader } from "../scope-
|
|
1
|
+
/*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
|
|
2
|
+
import { C as isService, D as requireUserId, E as requireTeamId, O as scopeFirstCtx, S as isOrgInScope, T as requireOrgId, _ as getUserRoles, a as getDPoPJkt, b as isElevated, c as getOrgId, d as getScopeContext, f as getScopeContextMap, g as getUserId, h as getTenantFromRequest, i as getClientId, l as getOrgRoles, m as getTeamId, n as PUBLIC_SCOPE, o as getMandate, p as getServiceScopes, r as getAncestorOrgIds, s as getOrgContext, t as AUTHENTICATED_SCOPE, u as getRequestScope, v as hasOrgAccess, w as requireClientId, x as isMember, y as isAuthenticated } from "../types-CNQyOrLk.mjs";
|
|
3
|
+
import { n as elevation_default, t as elevationPlugin } from "../elevation-CZy6n50b.mjs";
|
|
4
|
+
import { t as createTenantKeyGenerator } from "../rateLimitKey-umrS6-vu.mjs";
|
|
5
|
+
import { t as resolveOrgFromHeader } from "../scope-CdYxQVxt.mjs";
|
|
6
6
|
export { AUTHENTICATED_SCOPE, PUBLIC_SCOPE, createTenantKeyGenerator, elevation_default as elevationPlugin, elevationPlugin as elevationPluginFn, getAncestorOrgIds, getClientId, getDPoPJkt, getMandate, getOrgContext, getOrgId, getOrgRoles, getRequestScope, getScopeContext, getScopeContextMap, getServiceScopes, getTeamId, getTenantFromRequest, getUserId, getUserRoles, hasOrgAccess, isAuthenticated, isElevated, isMember, isOrgInScope, isService, requireClientId, requireOrgId, requireTeamId, requireUserId, resolveOrgFromHeader, scopeFirstCtx };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { a as OrgAccessDeniedError, l as UnauthorizedError } from "./errors-
|
|
3
|
-
import { n as requireSingleHeaderValue } from "./headers-
|
|
4
|
-
import { n as getUserRoles } from "./userHelpers-
|
|
1
|
+
/*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
|
|
2
|
+
import { a as OrgAccessDeniedError, l as UnauthorizedError } from "./errors-BHD3L8of.mjs";
|
|
3
|
+
import { n as requireSingleHeaderValue } from "./headers-BFEEshDS.mjs";
|
|
4
|
+
import { n as getUserRoles } from "./userHelpers-DLueLQdQ.mjs";
|
|
5
5
|
//#region src/scope/resolveOrgFromHeader.ts
|
|
6
6
|
/**
|
|
7
7
|
* Create a preHandler hook that resolves org scope from a header.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
/*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-DzE6ikSH.mjs";
|
|
3
3
|
import { arcLog } from "./logger/index.mjs";
|
|
4
|
-
import { c as getOrgId, n as PUBLIC_SCOPE } from "./types-
|
|
5
|
-
import { a as promoteStreamTokenToHeader } from "./streaming-
|
|
6
|
-
import { t as openSseStream } from "./sseStream-
|
|
4
|
+
import { c as getOrgId, n as PUBLIC_SCOPE } from "./types-CNQyOrLk.mjs";
|
|
5
|
+
import { a as promoteStreamTokenToHeader } from "./streaming-CFwCzEvU.mjs";
|
|
6
|
+
import { t as openSseStream } from "./sseStream-BfZtL5-m.mjs";
|
|
7
7
|
import fp from "fastify-plugin";
|
|
8
8
|
//#region src/plugins/sse.ts
|
|
9
9
|
var sse_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { n as forwardedStreamHeaders } from "./streaming-
|
|
1
|
+
/*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as forwardedStreamHeaders } from "./streaming-CFwCzEvU.mjs";
|
|
3
3
|
//#region src/utils/sseStream.ts
|
|
4
4
|
/**
|
|
5
5
|
* Take over the reply socket and open an SSE stream. Call ONLY after every
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { r as createEvent } from "./EventTransport-
|
|
1
|
+
/*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
|
|
2
|
+
import { r as createEvent } from "./EventTransport-BUkTwY_x.mjs";
|
|
3
3
|
//#region src/events/defineEvent.ts
|
|
4
4
|
/**
|
|
5
5
|
* Typed event declarations, a registry for introspection, and `.create()` to
|
package/dist/sync/changelog.mjs
CHANGED
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
import { i as RequestScope } from "../types-Ddl9OjmE.mjs";
|
|
3
3
|
import { l as PermissionCheck, t as AnyRecord } from "../base-C-NL2fTi.mjs";
|
|
4
|
-
import { V as ResourceDefinition } from "../index-
|
|
5
|
-
import { n as ArcModuleInput, o as ModuleDisposer, s as ModuleSetupContext } from "../types-
|
|
6
|
-
import "../index-
|
|
7
|
-
import { n as preloadResourcesAsync, r as CreateAppOptions, t as preloadResources } from "../preloadResources-
|
|
4
|
+
import { V as ResourceDefinition } from "../index-D3sIPcD4.mjs";
|
|
5
|
+
import { n as ArcModuleInput, o as ModuleDisposer, s as ModuleSetupContext } from "../types-BVlowlm7.mjs";
|
|
6
|
+
import "../index-DbMglURO.mjs";
|
|
7
|
+
import { n as preloadResourcesAsync, r as CreateAppOptions, t as preloadResources } from "../preloadResources-DVgPCNcD.mjs";
|
|
8
8
|
import { StorageContractSetup, StorageContractSetupResult, runStorageContract } from "./storageContract.mjs";
|
|
9
9
|
import { StandardRepo } from "@classytic/repo-core/repository";
|
|
10
10
|
import { FastifyInstance, FastifyServerOptions } from "fastify";
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as CRUD_OPERATIONS } from "../constants-
|
|
3
|
-
import { g as getUserId } from "../types-
|
|
4
|
-
import { t as BaseController } from "../BaseController-
|
|
5
|
-
import { t as defineAggregation } from "../defineAggregation-
|
|
6
|
-
import { t as defineResource } from "../defineResource-
|
|
7
|
-
import { E as requireOrgRole } from "../permissions-
|
|
8
|
-
import { a as createApp, n as preloadResourcesAsync, t as preloadResources } from "../preloadResources-
|
|
9
|
-
import { n as getModuleExports } from "../module-
|
|
1
|
+
/*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as CRUD_OPERATIONS } from "../constants-BQ2FbhPB.mjs";
|
|
3
|
+
import { g as getUserId } from "../types-CNQyOrLk.mjs";
|
|
4
|
+
import { t as BaseController } from "../BaseController-BqJtbiUA.mjs";
|
|
5
|
+
import { t as defineAggregation } from "../defineAggregation-BDA2Tw7v.mjs";
|
|
6
|
+
import { t as defineResource } from "../defineResource-DaIySrQr.mjs";
|
|
7
|
+
import { E as requireOrgRole } from "../permissions-C0GpDsB_.mjs";
|
|
8
|
+
import { a as createApp, n as preloadResourcesAsync, t as preloadResources } from "../preloadResources-BAx5s9EF.mjs";
|
|
9
|
+
import { n as getModuleExports } from "../module-CNcwCKUJ.mjs";
|
|
10
10
|
import { runStorageContract } from "./storageContract.mjs";
|
|
11
11
|
import Fastify from "fastify";
|
|
12
12
|
import { afterAll, describe, expect, it, vi } from "vitest";
|
|
@@ -1504,7 +1504,7 @@ function pickDefaultAuth(authMode, callerAuth) {
|
|
|
1504
1504
|
};
|
|
1505
1505
|
}
|
|
1506
1506
|
async function createTestApp(options = {}) {
|
|
1507
|
-
const { createApp } = await import("../preloadResources-
|
|
1507
|
+
const { createApp } = await import("../preloadResources-BAx5s9EF.mjs").then((n) => n.o);
|
|
1508
1508
|
const { resources = [], db = "in-memory", connectMongoose = false, authMode = "jwt", defaultOrgId, plugins, auth: callerAuth, ...appOptions } = options;
|
|
1509
1509
|
let dbHandle;
|
|
1510
1510
|
let dbUri;
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
|
|
2
2
|
import { OutboxOwnershipError } from "@classytic/primitives/outbox";
|
|
3
3
|
import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
4
4
|
//#region src/testing/outboxStoreContract.ts
|
|
5
5
|
let seq = 0;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* A minimal well-formed event. Ids are unique per call.
|
|
8
|
+
*
|
|
9
|
+
* It was NOT well-formed until 2.40: `meta` carried `occurredAt: string`, which
|
|
10
|
+
* is not a field of `EventMeta`, and omitted the REQUIRED `timestamp: Date`.
|
|
11
|
+
* An `as unknown as DomainEvent` made it compile — a total override that hid the
|
|
12
|
+
* mismatch, so every third party running this shipped suite conformance-tested
|
|
13
|
+
* their store against an event shape the transports never produce. `createEvent`
|
|
14
|
+
* in `@classytic/primitives` is the reference: `{ id, timestamp: new Date() }`.
|
|
15
|
+
*
|
|
16
|
+
* No cast now — if `EventMeta` changes, this stops compiling, which is the point.
|
|
17
|
+
*/
|
|
7
18
|
function event(type = "test.event") {
|
|
8
19
|
seq += 1;
|
|
9
20
|
return {
|
|
@@ -11,7 +22,7 @@ function event(type = "test.event") {
|
|
|
11
22
|
payload: { n: seq },
|
|
12
23
|
meta: {
|
|
13
24
|
id: `evt-${Date.now()}-${seq}`,
|
|
14
|
-
|
|
25
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
15
26
|
}
|
|
16
27
|
};
|
|
17
28
|
}
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { i as RequestScope } from "../types-Ddl9OjmE.mjs";
|
|
3
3
|
import { a as UserLike, c as DataPolicy, d as UserBase, i as ObjectId, l as PermissionCheck, n as ArcRequest, o as UserOrganization, r as JWTPayload, s as AuthorizationDecision, t as AnyRecord, u as PermissionContext } from "../base-C-NL2fTi.mjs";
|
|
4
|
-
import { $ as OpenApiSchemas, A as RequestIdOptions, An as WriteVerbKey, At as RouteDefinition, C as RequestContext, D as HealthCheck, Dn as MutationWriteContext, Dt as ActionEntry, E as GracefulShutdownOptions, Et as ActionDefinition, F as FastifyWithDecorators, Fn as IControllerResponse, Ft as AuthPluginOptions, G as OnTenantDeleteConfig, H as CrudController, I as MiddlewareHandler, In as IRequestContext, It as Authenticator, J as PresetHook, K as ResolvedTenantPurge, L as RequestWithExtras, Ln as RawRouteHandler, Lt as AuthenticatorContext, M as EventsDecorator, Mn as ControllerLike, Mt as RouteMethod, N as FastifyRequestExtras, Nn as FastifyHandler, Nt as RateLimitConfig, O as HealthOptions, On as ResourceWrites, Ot as ActionHandlerFn, P as FastifyWithAuth, Pn as IController, Pt as AuthHelpers, Q as MiddlewareConfig, Rn as RouteHandler, Rt as JwtContext, S as QueryParserInterface, T as CrudRouterOptions, Tt as ResourceCacheConfig, U as ResourceConfig, W as ResourcePermissions, X as CrudRouteKey, Y as PresetResult, Z as CrudSchemas, _ as ControllerQueryOptions, a as InferAdapterDoc, at as ResourceExtensions, b as ParsedQuery, c as TypedController, d as PaginationResult, et as RouteSchemaOptions, f as IntrospectionData, g as ArcInternalMetadata, h as ResourceMetadata, i as ValidationResult, it as ResourceHooks, j as ArcDecorator, jn as ControllerHandler, jt as RouteMcpConfig, k as IntrospectionPluginOptions, kn as WriteContext, kt as ActionsMap, l as TypedRepository, m as RegistryStats, n as ConfigError, nt as FieldRule, o as InferDocType, ot as EventDefinition, p as RegistryEntry, q as PresetFunction, r as ValidateOptions, rt as ResourceHookContext, s as InferResourceDoc, t as RouteHandlerMethod, tt as ArcFieldRule, u as TypedResourceConfig, v as LookupOption, w as ServiceContext, x as PopulateOption, xn as BaseControllerOptions, y as OwnershipCheck, zt as TokenPair } from "../index-
|
|
4
|
+
import { $ as OpenApiSchemas, A as RequestIdOptions, An as WriteVerbKey, At as RouteDefinition, C as RequestContext, D as HealthCheck, Dn as MutationWriteContext, Dt as ActionEntry, E as GracefulShutdownOptions, Et as ActionDefinition, F as FastifyWithDecorators, Fn as IControllerResponse, Ft as AuthPluginOptions, G as OnTenantDeleteConfig, H as CrudController, I as MiddlewareHandler, In as IRequestContext, It as Authenticator, J as PresetHook, K as ResolvedTenantPurge, L as RequestWithExtras, Ln as RawRouteHandler, Lt as AuthenticatorContext, M as EventsDecorator, Mn as ControllerLike, Mt as RouteMethod, N as FastifyRequestExtras, Nn as FastifyHandler, Nt as RateLimitConfig, O as HealthOptions, On as ResourceWrites, Ot as ActionHandlerFn, P as FastifyWithAuth, Pn as IController, Pt as AuthHelpers, Q as MiddlewareConfig, Rn as RouteHandler, Rt as JwtContext, S as QueryParserInterface, T as CrudRouterOptions, Tt as ResourceCacheConfig, U as ResourceConfig, W as ResourcePermissions, X as CrudRouteKey, Y as PresetResult, Z as CrudSchemas, _ as ControllerQueryOptions, a as InferAdapterDoc, at as ResourceExtensions, b as ParsedQuery, c as TypedController, d as PaginationResult, et as RouteSchemaOptions, f as IntrospectionData, g as ArcInternalMetadata, h as ResourceMetadata, i as ValidationResult, it as ResourceHooks, j as ArcDecorator, jn as ControllerHandler, jt as RouteMcpConfig, k as IntrospectionPluginOptions, kn as WriteContext, kt as ActionsMap, l as TypedRepository, m as RegistryStats, n as ConfigError, nt as FieldRule, o as InferDocType, ot as EventDefinition, p as RegistryEntry, q as PresetFunction, r as ValidateOptions, rt as ResourceHookContext, s as InferResourceDoc, t as RouteHandlerMethod, tt as ArcFieldRule, u as TypedResourceConfig, v as LookupOption, w as ServiceContext, x as PopulateOption, xn as BaseControllerOptions, y as OwnershipCheck, zt as TokenPair } from "../index-D3sIPcD4.mjs";
|
|
5
5
|
import { n as ElevationOptions, t as ElevationEvent } from "../elevation-BXCfVcNG.mjs";
|
|
6
6
|
export type { ActionDefinition, ActionEntry, ActionHandlerFn, ActionsMap, AnyRecord, ArcDecorator, ArcFieldRule, ArcInternalMetadata, ArcRequest, AuthHelpers, AuthPluginOptions, Authenticator, AuthenticatorContext, AuthorizationDecision, BaseControllerOptions, ConfigError, ControllerHandler, ControllerLike, ControllerQueryOptions, CrudController, CrudRouteKey, CrudRouterOptions, CrudSchemas, DataPolicy, ElevationEvent, ElevationOptions, EventDefinition, EventsDecorator, FastifyHandler, FastifyRequestExtras, FastifyWithAuth, FastifyWithDecorators, FieldRule, GracefulShutdownOptions, HealthCheck, HealthOptions, IController, IControllerResponse, IRequestContext, InferAdapterDoc, InferDocType, InferResourceDoc, IntrospectionData, IntrospectionPluginOptions, JWTPayload, JwtContext, LookupOption, MiddlewareConfig, MiddlewareHandler, MutationWriteContext, ObjectId, OnTenantDeleteConfig, OpenApiSchemas, OwnershipCheck, PaginationResult, ParsedQuery, PermissionCheck, PermissionContext, PopulateOption, PresetFunction, PresetHook, PresetResult, QueryParserInterface, RateLimitConfig, RawRouteHandler, RegistryEntry, RegistryStats, RequestContext, RequestIdOptions, RequestScope, RequestWithExtras, ResolvedTenantPurge, ResourceCacheConfig, ResourceConfig, ResourceExtensions, ResourceHookContext, ResourceHooks, ResourceMetadata, ResourcePermissions, ResourceWrites, RouteDefinition, RouteHandler, RouteHandlerMethod, RouteMcpConfig, RouteMethod, RouteSchemaOptions, ServiceContext, TokenPair, TypedController, TypedRepository, TypedResourceConfig, UserBase, UserLike, UserOrganization, ValidateOptions, ValidationResult, WriteContext, WriteVerbKey };
|
package/dist/types/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
|
|
2
2
|
export {};
|
package/dist/types/storage.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
|
|
2
2
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { V as ResourceDefinition } from "./index-
|
|
2
|
+
import { V as ResourceDefinition } from "./index-D3sIPcD4.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/integrations/mcp/types.d.ts
|
|
5
5
|
/** Behavioral hints for MCP clients (tool annotations per MCP spec) */
|
|
@@ -275,6 +275,51 @@ interface McpPluginOptions {
|
|
|
275
275
|
* - `McpAuthResolver` — custom function that resolves identity from headers
|
|
276
276
|
*/
|
|
277
277
|
auth?: BetterAuthHandler | McpAuthResolver | false;
|
|
278
|
+
/**
|
|
279
|
+
* DNS-rebinding protection for the MCP routes — `Host` / `Origin` validation.
|
|
280
|
+
*
|
|
281
|
+
* The attack this closes: a page the developer visits can POST to
|
|
282
|
+
* `127.0.0.1:<port>`. If a DNS name the attacker controls resolves to
|
|
283
|
+
* loopback, the browser treats the response as same-origin and the page can
|
|
284
|
+
* READ it — every registered tool, from any website. Validating that `Host`
|
|
285
|
+
* names a host you expect is what breaks it, which is why the MCP SDK ships
|
|
286
|
+
* this as a default for localhost servers.
|
|
287
|
+
*
|
|
288
|
+
* **Default: on when `auth: false`, off otherwise.** Not a guess — it follows
|
|
289
|
+
* the threat:
|
|
290
|
+
* - `auth: false` is the local/dev shape the attack targets, and nothing else
|
|
291
|
+
* is standing in the way. Defaults to the SDK's localhost set
|
|
292
|
+
* (`localhost`, `127.0.0.1`, `[::1]`).
|
|
293
|
+
* - With auth configured, the endpoint is normally a real domain whose `Host`
|
|
294
|
+
* is not localhost — defaulting protection ON would 403 every production
|
|
295
|
+
* deployment. There, credentials are the gate.
|
|
296
|
+
*
|
|
297
|
+
* Set explicitly whenever the default's assumption is wrong for you: a
|
|
298
|
+
* localhost server that DOES use auth, or a deliberately-public `auth: false`
|
|
299
|
+
* endpoint that must keep answering (`false` to disable).
|
|
300
|
+
*
|
|
301
|
+
* Validation itself is `@modelcontextprotocol/server`'s `validateHostHeader` /
|
|
302
|
+
* `validateOriginHeader` — arc does not reimplement the matching rules.
|
|
303
|
+
* Hostnames only, no scheme or port; IPv6 in brackets (`[::1]`). A request
|
|
304
|
+
* with no `Origin` header passes (non-browser MCP clients send none); a
|
|
305
|
+
* present-but-unlisted `Origin` is rejected.
|
|
306
|
+
*
|
|
307
|
+
* @example
|
|
308
|
+
* ```ts
|
|
309
|
+
* // localhost server that uses auth — opt in explicitly
|
|
310
|
+
* mcpPlugin({ resources, auth, dnsRebindingProtection: {} });
|
|
311
|
+
* // reachable under a known public name
|
|
312
|
+
* mcpPlugin({ resources, dnsRebindingProtection: { allowedHosts: ['mcp.example.com'] } });
|
|
313
|
+
* // deliberately public, no Host constraint
|
|
314
|
+
* mcpPlugin({ resources, auth: false, dnsRebindingProtection: false });
|
|
315
|
+
* ```
|
|
316
|
+
*/
|
|
317
|
+
dnsRebindingProtection?: false | {
|
|
318
|
+
/** Allowed `Host` hostnames. Default: `localhost`, `127.0.0.1`, `[::1]`. */
|
|
319
|
+
allowedHosts?: string[];
|
|
320
|
+
/** Allowed `Origin` hostnames. Default: same localhost set. */
|
|
321
|
+
allowedOrigins?: string[];
|
|
322
|
+
};
|
|
278
323
|
/** MCP endpoint path (default: '/mcp') */
|
|
279
324
|
prefix?: string;
|
|
280
325
|
/** Server identity */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { n as DomainEvent, r as EventHandler } from "./EventTransport-
|
|
3
|
-
import { n as ErrorMapper } from "./errorHandler
|
|
2
|
+
import { n as DomainEvent, r as EventHandler } from "./EventTransport-BPOQsEer.mjs";
|
|
3
|
+
import { n as ErrorMapper } from "./errorHandler--4rSMMvq.mjs";
|
|
4
4
|
import { FastifyInstance, FastifyPluginAsync } from "fastify";
|
|
5
5
|
import { LockAdapter } from "@classytic/repo-core/lock";
|
|
6
6
|
//#region src/plugins/health.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { l as UnauthorizedError, o as OrgRequiredError } from "./errors-
|
|
3
|
-
import { n as requireSingleHeaderValue } from "./headers-
|
|
4
|
-
import { t as getUserId$1 } from "./userHelpers-
|
|
1
|
+
/*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
|
|
2
|
+
import { l as UnauthorizedError, o as OrgRequiredError } from "./errors-BHD3L8of.mjs";
|
|
3
|
+
import { n as requireSingleHeaderValue } from "./headers-BFEEshDS.mjs";
|
|
4
|
+
import { t as getUserId$1 } from "./userHelpers-DLueLQdQ.mjs";
|
|
5
5
|
//#region src/scope/types.ts
|
|
6
6
|
/**
|
|
7
7
|
* Request Scope — The One Standard
|
package/dist/usage/index.mjs
CHANGED
|
Binary file
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import { F as getHeader, I as requireSingleHeaderValue, P as ArcHeaders } from "../types-Ddl9OjmE.mjs";
|
|
3
3
|
import { f as getUserId, m as normalizeRoles, p as getUserRoles, t as AnyRecord } from "../base-C-NL2fTi.mjs";
|
|
4
|
-
import { $ as OpenApiSchemas, S as QueryParserInterface, b as ParsedQuery } from "../index-
|
|
5
|
-
import { n as ErrorMapper } from "../errorHandler
|
|
4
|
+
import { $ as OpenApiSchemas, S as QueryParserInterface, b as ParsedQuery } from "../index-D3sIPcD4.mjs";
|
|
5
|
+
import { n as ErrorMapper } from "../errorHandler--4rSMMvq.mjs";
|
|
6
6
|
import { a as NotFoundError, c as RateLimitError, d as ValidationError, f as createDomainError, i as ForbiddenError, l as ServiceUnavailableError, m as isArcError, n as ConflictError, o as OrgAccessDeniedError, p as createError, r as ErrorOptions, s as OrgRequiredError, t as ArcError, u as UnauthorizedError } from "../errors-BGdVwP25.mjs";
|
|
7
7
|
import { scheduleBackground } from "@classytic/repo-core/cache";
|
|
8
8
|
import { errorContractSchema, errorDetailSchema } from "@classytic/repo-core/errors";
|
|
@@ -691,8 +691,8 @@ declare const paginationSchema: JsonSchema;
|
|
|
691
691
|
* validation PER RESPONSE to pick the branch, on the hottest route of
|
|
692
692
|
* every arc app. The merge keeps the exact bytes (pinned by
|
|
693
693
|
* `tests/utils/list-response-serialization.test.ts`) and drops the
|
|
694
|
-
* per-response branch validation.
|
|
695
|
-
*
|
|
694
|
+
* per-response branch validation. The list route also serves count, exists
|
|
695
|
+
* and distinct dispatch verbs, so no field is common to every valid shape.
|
|
696
696
|
*/
|
|
697
697
|
declare function listResponse(itemSchema: JsonSchema): JsonSchema;
|
|
698
698
|
/** Offset variant — `{ method: 'offset', data, page, limit, total, pages, hasNext, hasPrev }`. */
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { a as OrgAccessDeniedError, c as ServiceUnavailableError, d as createDomainError, f as createError, i as NotFoundError, l as UnauthorizedError, n as ConflictError, o as OrgRequiredError, p as isArcError, r as ForbiddenError, s as RateLimitError, t as ArcError, u as ValidationError } from "../errors-
|
|
3
|
-
import { n as requireSingleHeaderValue, t as getHeader } from "../headers-
|
|
4
|
-
import { n as getUserRoles, r as normalizeRoles, t as getUserId } from "../userHelpers-
|
|
5
|
-
import { t as simpleEqualityMatcher } from "../simpleEqualityMatcher-
|
|
6
|
-
import { A as scheduleBackground, C as paginationSchema, D as createQueryParser, E as ArcQueryParser, O as MONGO_DIALECT, S as offsetListResponse, T as responses, _ as errorDetailSchema, a as defineCompensation, b as keysetListResponse, c as CircuitBreakerError, d as createCircuitBreaker, f as createCircuitBreakerRegistry, g as errorContractSchema, h as deleteResponse, i as defineErrorMapper, k as NEUTRAL_DIALECT, l as CircuitBreakerRegistry, m as bareListResponse, n as handleRaw, o as withCompensation, p as aggregateListResponse, r as defineGuard, s as CircuitBreaker, t as createStateMachine, u as CircuitState, v as getDefaultCrudSchemas, w as queryParams, x as listResponse, y as getListQueryParams } from "../utils-
|
|
7
|
-
import { a as isZodSchema, i as isJsonSchema, n as convertRouteSchema, o as toJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-
|
|
8
|
-
import { a as promoteStreamTokenToHeader, i as pipeUIMessageStreamToReply, n as forwardedStreamHeaders, r as isReadableStream, t as UI_MESSAGE_STREAM_HEADERS } from "../streaming-
|
|
9
|
-
import { n as declareRuntimeCapability } from "../runtimeCapabilities-
|
|
10
|
-
import { t as openSseStream } from "../sseStream-
|
|
11
|
-
import { t as hasEvents } from "../typeGuards-
|
|
1
|
+
/*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
|
|
2
|
+
import { a as OrgAccessDeniedError, c as ServiceUnavailableError, d as createDomainError, f as createError, i as NotFoundError, l as UnauthorizedError, n as ConflictError, o as OrgRequiredError, p as isArcError, r as ForbiddenError, s as RateLimitError, t as ArcError, u as ValidationError } from "../errors-BHD3L8of.mjs";
|
|
3
|
+
import { n as requireSingleHeaderValue, t as getHeader } from "../headers-BFEEshDS.mjs";
|
|
4
|
+
import { n as getUserRoles, r as normalizeRoles, t as getUserId } from "../userHelpers-DLueLQdQ.mjs";
|
|
5
|
+
import { t as simpleEqualityMatcher } from "../simpleEqualityMatcher-Cldubvul.mjs";
|
|
6
|
+
import { A as scheduleBackground, C as paginationSchema, D as createQueryParser, E as ArcQueryParser, O as MONGO_DIALECT, S as offsetListResponse, T as responses, _ as errorDetailSchema, a as defineCompensation, b as keysetListResponse, c as CircuitBreakerError, d as createCircuitBreaker, f as createCircuitBreakerRegistry, g as errorContractSchema, h as deleteResponse, i as defineErrorMapper, k as NEUTRAL_DIALECT, l as CircuitBreakerRegistry, m as bareListResponse, n as handleRaw, o as withCompensation, p as aggregateListResponse, r as defineGuard, s as CircuitBreaker, t as createStateMachine, u as CircuitState, v as getDefaultCrudSchemas, w as queryParams, x as listResponse, y as getListQueryParams } from "../utils-CUFBrhq-.mjs";
|
|
7
|
+
import { a as isZodSchema, i as isJsonSchema, n as convertRouteSchema, o as toJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-DENbixyA.mjs";
|
|
8
|
+
import { a as promoteStreamTokenToHeader, i as pipeUIMessageStreamToReply, n as forwardedStreamHeaders, r as isReadableStream, t as UI_MESSAGE_STREAM_HEADERS } from "../streaming-CFwCzEvU.mjs";
|
|
9
|
+
import { n as declareRuntimeCapability } from "../runtimeCapabilities-Bo7rSKjm.mjs";
|
|
10
|
+
import { t as openSseStream } from "../sseStream-BfZtL5-m.mjs";
|
|
11
|
+
import { t as hasEvents } from "../typeGuards-t_CVgRXN.mjs";
|
|
12
12
|
export { ArcError, ArcQueryParser, CircuitBreaker, CircuitBreakerError, CircuitBreakerRegistry, CircuitState, ConflictError, ForbiddenError, MONGO_DIALECT, NEUTRAL_DIALECT, NotFoundError, OrgAccessDeniedError, OrgRequiredError, RateLimitError, ServiceUnavailableError, UI_MESSAGE_STREAM_HEADERS, UnauthorizedError, ValidationError, aggregateListResponse, bareListResponse, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createDomainError, createError, createQueryParser, createStateMachine, declareRuntimeCapability, defineCompensation, defineErrorMapper, defineGuard, deleteResponse, errorContractSchema, errorDetailSchema, forwardedStreamHeaders, getDefaultCrudSchemas, getHeader, getListQueryParams, getUserId, getUserRoles, handleRaw, hasEvents, isArcError, isJsonSchema, isReadableStream, isZodSchema, keysetListResponse, listResponse, normalizeRoles, offsetListResponse, openSseStream, paginationSchema, pipeUIMessageStreamToReply, promoteStreamTokenToHeader, queryParams, requireSingleHeaderValue, responses, scheduleBackground, simpleEqualityMatcher, toJsonSchema, withCompensation };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { m as RESERVED_QUERY_PARAMS } from "./constants-
|
|
1
|
+
/*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
|
|
2
|
+
import { m as RESERVED_QUERY_PARAMS } from "./constants-BQ2FbhPB.mjs";
|
|
3
3
|
import { arcLog } from "./logger/index.mjs";
|
|
4
|
-
import { t as ArcError, u as ValidationError } from "./errors-
|
|
4
|
+
import { t as ArcError, u as ValidationError } from "./errors-BHD3L8of.mjs";
|
|
5
5
|
import { scheduleBackground } from "@classytic/repo-core/cache";
|
|
6
6
|
import { errorContractSchema as errorContractSchema$1, errorDetailSchema as errorDetailSchema$1 } from "@classytic/repo-core/errors";
|
|
7
7
|
//#region src/utils/filter-dialect.ts
|
|
@@ -561,8 +561,8 @@ const paginationSchema = {
|
|
|
561
561
|
* validation PER RESPONSE to pick the branch, on the hottest route of
|
|
562
562
|
* every arc app. The merge keeps the exact bytes (pinned by
|
|
563
563
|
* `tests/utils/list-response-serialization.test.ts`) and drops the
|
|
564
|
-
* per-response branch validation.
|
|
565
|
-
*
|
|
564
|
+
* per-response branch validation. The list route also serves count, exists
|
|
565
|
+
* and distinct dispatch verbs, so no field is common to every valid shape.
|
|
566
566
|
*/
|
|
567
567
|
function listResponse(itemSchema) {
|
|
568
568
|
return {
|
|
@@ -577,6 +577,15 @@ function listResponse(itemSchema) {
|
|
|
577
577
|
type: "array",
|
|
578
578
|
items: itemSchema
|
|
579
579
|
},
|
|
580
|
+
count: {
|
|
581
|
+
type: "integer",
|
|
582
|
+
minimum: 0
|
|
583
|
+
},
|
|
584
|
+
exists: { type: "boolean" },
|
|
585
|
+
values: {
|
|
586
|
+
type: "array",
|
|
587
|
+
items: {}
|
|
588
|
+
},
|
|
580
589
|
page: {
|
|
581
590
|
type: "integer",
|
|
582
591
|
example: 1
|
|
@@ -607,7 +616,6 @@ function listResponse(itemSchema) {
|
|
|
607
616
|
description: "Cursor token for the next page, or null."
|
|
608
617
|
}
|
|
609
618
|
},
|
|
610
|
-
required: ["data"],
|
|
611
619
|
additionalProperties: true
|
|
612
620
|
};
|
|
613
621
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
/*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-DzE6ikSH.mjs";
|
|
3
3
|
//#region src/core/aggregation/normalize.ts
|
|
4
4
|
/**
|
|
5
5
|
* Framework cap on URL-driven aggregation limits when the host opts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
3
|
-
import { d as createDomainError } from "./errors-
|
|
1
|
+
/*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-DzE6ikSH.mjs";
|
|
3
|
+
import { d as createDomainError } from "./errors-BHD3L8of.mjs";
|
|
4
4
|
import fp from "fastify-plugin";
|
|
5
5
|
//#region src/plugins/versioning.ts
|
|
6
6
|
var versioning_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as requestContext } from "./requestContext-D4PuGhEw.mjs";
|
|
3
|
+
//#region src/context/workScope.ts
|
|
4
|
+
/** Enter a scope for `fn`, or run it inside the active one. */
|
|
5
|
+
function runWorkScope(seed, fn) {
|
|
6
|
+
if (requestContext.get()) return fn();
|
|
7
|
+
const store = {
|
|
8
|
+
kind: seed.kind,
|
|
9
|
+
requestId: seed.id,
|
|
10
|
+
startTime: performance.now(),
|
|
11
|
+
...seed.organizationId !== void 0 ? { organizationId: seed.organizationId } : {}
|
|
12
|
+
};
|
|
13
|
+
return requestContext.run(store, fn);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A per-scope memo slot: created once on first use, the same instance after.
|
|
17
|
+
* `undefined` outside a scope.
|
|
18
|
+
*/
|
|
19
|
+
function scopedValue(slot, create) {
|
|
20
|
+
const store = requestContext.get();
|
|
21
|
+
if (!store) return void 0;
|
|
22
|
+
const slots = store;
|
|
23
|
+
const existing = slots[slot];
|
|
24
|
+
if (existing !== void 0) return existing;
|
|
25
|
+
const created = create();
|
|
26
|
+
slots[slot] = created;
|
|
27
|
+
return created;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The scope an event dispatch runs in. The correlation id is the scope id so a
|
|
31
|
+
* child event published from a handler chains to the same correlation; the
|
|
32
|
+
* tenant rides `meta`, never the payload.
|
|
33
|
+
*/
|
|
34
|
+
function workSeedFromEvent(event) {
|
|
35
|
+
return {
|
|
36
|
+
kind: "event",
|
|
37
|
+
id: event.meta.correlationId ?? event.meta.id,
|
|
38
|
+
...event.meta.organizationId !== void 0 ? { organizationId: event.meta.organizationId } : {}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { scopedValue as n, workSeedFromEvent as r, runWorkScope as t };
|