@classytic/arc 2.32.0 → 2.34.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/README.md +1 -1
- package/bin/arc.js +58 -17
- package/dist/{BaseController-Dk34dxhI.mjs → BaseController-CbkuhNI2.mjs} +329 -35
- package/dist/{EventTransport-2uVV34WU.d.mts → EventTransport-BEVP50ka.d.mts} +16 -0
- package/dist/{EventTransport-BV10D0oG.mjs → EventTransport-tq4CEB-q.mjs} +39 -2
- package/dist/{HookSystem-vimw5D7Z.mjs → HookSystem-DqXkMXkB.mjs} +2 -2
- package/dist/{ResourceRegistry-BVr7PgA0.mjs → ResourceRegistry-DoALUlOO.mjs} +3 -2
- package/dist/{actionPermissions-Dti7ebyv.mjs → actionPermissions-CUeCmpUd.mjs} +1 -1
- package/dist/audit/index.d.mts +2 -2
- package/dist/audit/index.mjs +2 -2
- package/dist/auth/audit.mjs +1 -1
- package/dist/auth/index.d.mts +2 -2
- package/dist/auth/index.mjs +39 -7
- package/dist/auth/redis-session.mjs +1 -1
- package/dist/{authorizationDecision-__T3EJDA.mjs → authorizationDecision-CMMLWmuZ.mjs} +6 -2
- package/dist/{types-B7XeLEgK.d.mts → base-Csjc2oF-.d.mts} +74 -74
- package/dist/{buildHandler-Dn7rzUJo.mjs → buildHandler-BrdYrG_1.mjs} +4 -4
- package/dist/cache/index.mjs +4 -4
- package/dist/{caching-DFJqHyFs.mjs → caching-BcGmvnHh.mjs} +2 -2
- package/dist/cleanup/index.d.mts +17 -5
- package/dist/cleanup/index.mjs +240 -7
- 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-J99LGTJI.mjs → constants-BxCoxmiN.mjs} +1 -1
- package/dist/context/index.mjs +3 -3
- package/dist/core/index.d.mts +3 -3
- package/dist/core/index.mjs +9 -8
- package/dist/{core-BwwmNSp7.mjs → core-BYKa8wHu.mjs} +3 -3
- package/dist/{createActionRouter-DkJZWo0m.mjs → createActionRouter-D6T0jWhS.mjs} +8 -8
- package/dist/{createAggregationRouter-B1exOVD8.mjs → createAggregationRouter-QLV2PrWP.mjs} +7 -7
- package/dist/{createApp-Bv0m-Q6_.mjs → createApp-zR-DEesr.mjs} +128 -24
- package/dist/{defineAggregation-gX4No1gt.mjs → defineAggregation-Nv-DwfOf.mjs} +1 -1
- package/dist/{defineResource-XFPPUu2c.mjs → defineResource-ZhuLonLm.mjs} +297 -23
- 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-DNXXxgjl.mjs → elevation-B0tlY8y1.mjs} +4 -4
- package/dist/encryption/index.mjs +3 -3
- package/dist/{errorHandler-B2AZUJUj.mjs → errorHandler-C7xBqHsI.mjs} +42 -5
- package/dist/{errorHandler-CpYUJmPA.d.mts → errorHandler-DI5AN2b5.d.mts} +14 -3
- package/dist/{errors-Bh1KK5ps.mjs → errors-Cd_yy7aW.mjs} +1 -1
- package/dist/{eventPlugin-GF5nnBIq.d.mts → eventPlugin-DSNEZWfV.d.mts} +29 -1
- package/dist/{eventPlugin-Dk_TyXeE.mjs → eventPlugin-Dar8qRaj.mjs} +65 -9
- package/dist/events/index.d.mts +5 -351
- package/dist/events/index.mjs +5 -780
- package/dist/events/transports/redis-stream-entry.d.mts +1 -1
- package/dist/events/transports/redis-stream-entry.mjs +1 -1
- package/dist/events/transports/redis.d.mts +1 -1
- package/dist/events/transports/redis.mjs +1 -1
- package/dist/factory/index.d.mts +20 -5
- package/dist/factory/index.mjs +7 -7
- package/dist/{fastify-augmentation-BppG5bMT.d.mts → fastify-augmentation-DVsTAy6X.d.mts} +3 -3
- package/dist/{fields-DEi65pGj.mjs → fields-CojeUkS4.mjs} +1 -1
- package/dist/{generate-CRSG0jTv.mjs → generate-DiB0nHPR.mjs} +2 -2
- package/dist/{headers-BXjQYbeC.mjs → headers-CveNO9gR.mjs} +2 -2
- package/dist/{health-5XnTa2uo.mjs → health-CasG2A28.mjs} +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/idempotency/index.d.mts +45 -1
- package/dist/idempotency/index.mjs +90 -9
- package/dist/idempotency/redis.mjs +1 -1
- package/dist/{index-zq6VrjaB.d.mts → index-B-DvUzsr.d.mts} +12 -2
- package/dist/{index-CpzxqePp.d.mts → index-BcR2bFZQ.d.mts} +707 -373
- package/dist/{index-ZWhLTp_s.d.mts → index-C5NnMEKF.d.mts} +1 -1
- package/dist/{index-DXlHwvuE.d.mts → index-CFAJEWCX.d.mts} +18 -5
- package/dist/{index-C-481Zf2.d.mts → index-ugr1tQlW.d.mts} +17 -1
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +13 -12
- package/dist/{init-BbfP8aky.mjs → init-mdJ-v4Xp.mjs} +18 -12
- package/dist/integrations/event-gateway.d.mts +1 -1
- package/dist/integrations/event-gateway.mjs +2 -2
- package/dist/integrations/index.d.mts +2 -2
- package/dist/integrations/index.mjs +1 -1
- package/dist/integrations/jobs/index.d.mts +1 -1
- package/dist/integrations/jobs/index.mjs +99 -97
- package/dist/integrations/mcp/index.d.mts +12 -3
- package/dist/integrations/mcp/index.mjs +2 -2
- package/dist/integrations/mcp/testing.d.mts +1 -1
- package/dist/integrations/mcp/testing.mjs +2 -2
- package/dist/integrations/streamline.mjs +3 -3
- package/dist/integrations/webhooks.d.mts +124 -1
- package/dist/integrations/webhooks.mjs +180 -2
- package/dist/integrations/websocket-pushref-redis.mjs +1 -1
- package/dist/integrations/websocket-redis.mjs +1 -1
- package/dist/integrations/websocket.mjs +1 -1
- package/dist/{interface-BP4IJCBO.mjs → interface-DznJrm9R.mjs} +1 -1
- package/dist/{jsonBody-DDSR2HFl.mjs → jsonBody-CfGH-GxO.mjs} +2 -2
- package/dist/{keys-B-HBTGXl.mjs → keys-WeKvY1dE.mjs} +1 -1
- package/dist/{loadResources-DisEAmkm.mjs → loadResources-Bj-aSsXi.mjs} +2 -2
- package/dist/{loadResourcesFromEntry-D1MJp13f.mjs → loadResourcesFromEntry-DwaxNcE2.mjs} +2 -2
- package/dist/logger/index.mjs +1 -1
- package/dist/{mcpPlugin-CpfVpKHE.mjs → mcpPlugin-DX3PHD7K.mjs} +60 -21
- package/dist/{memory-DsuWnj4T.mjs → memory-qYSB7rMQ.mjs} +2 -2
- package/dist/{metrics-DdQL8syd.mjs → metrics-D7uchLjN.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-Br81am6m.mjs → module-CwKsgZXp.mjs} +1 -1
- package/dist/{multipartBody-BnkBLN7v.mjs → multipartBody-4w-S3-PU.mjs} +1 -1
- package/dist/{openapi-DIRzvxC0.mjs → openapi-CkV5mQ53.mjs} +6 -6
- package/dist/outbox-admin/index.d.mts +2 -2
- package/dist/outbox-admin/index.mjs +4 -4
- package/dist/outbox-module-C1Bs_FXF.d.mts +382 -0
- package/dist/outbox-module-D1QfHqO4.mjs +846 -0
- package/dist/permissions/index.d.mts +2 -2
- package/dist/permissions/index.mjs +5 -5
- package/dist/{permissions-Dl_m0NCe.mjs → permissions-CP47jdi7.mjs} +25 -6
- package/dist/{pipe-ELHCP3zj.mjs → pipe-BzzoEhHj.mjs} +2 -2
- package/dist/pipeline/index.d.mts +1 -1
- package/dist/pipeline/index.mjs +2 -2
- package/dist/{pipeline-CPA-jx0M.mjs → pipeline-q69DZzgG.mjs} +6 -6
- package/dist/plugins/index.d.mts +6 -6
- package/dist/plugins/index.mjs +16 -16
- package/dist/plugins/response-cache.mjs +2 -2
- package/dist/plugins/tracing-entry.mjs +2 -2
- package/dist/{pluralize-C2ZkKbsn.mjs → pluralize-B7xf8qZF.mjs} +1 -1
- package/dist/{preloadResources-CDs87fTw.mjs → preloadResources-BkyqeTDz.mjs} +1 -1
- package/dist/{preloadResources-T1hmlTEZ.d.mts → preloadResources-g07ldtzh.d.mts} +30 -7
- package/dist/presets/filesUpload.d.mts +2 -2
- package/dist/presets/filesUpload.mjs +5 -5
- package/dist/presets/index.d.mts +2 -2
- package/dist/presets/index.mjs +2 -2
- package/dist/presets/multiTenant.d.mts +1 -1
- package/dist/presets/multiTenant.mjs +3 -3
- package/dist/presets/search.d.mts +2 -2
- package/dist/presets/search.mjs +2 -2
- package/dist/{presets-Dntd_pUO.mjs → presets-BAPijK_A.mjs} +4 -4
- package/dist/projection-BKM0Ui-s.mjs +42 -0
- package/dist/{queryCachePlugin-Dhps-Ldt.mjs → queryCachePlugin-DhsZ0ZIc.mjs} +49 -7
- package/dist/{rateLimit-C7mmAGs3.mjs → rateLimit-D4-ASwsI.mjs} +2 -2
- package/dist/{rateLimitKey-CccEFBfk.mjs → rateLimitKey-XngqVNEV.mjs} +1 -1
- package/dist/{realtime-DVvVZZFz.mjs → realtime-G1TC6Yzc.mjs} +9 -9
- package/dist/{redis-stream-qN6A-RFv.d.mts → redis-stream-mwLWlfHG.d.mts} +1 -1
- package/dist/{registerRoute-B_QrjYZS.mjs → registerRoute-Ba8v0PCa.mjs} +4 -4
- package/dist/registry/index.d.mts +3 -3
- package/dist/registry/index.mjs +3 -3
- package/dist/{registry-DqUmzA9W.mjs → registry-CLxCR5LF.mjs} +2 -2
- package/dist/{renewingLease-BpP9wwj7.mjs → renewingLease-BnWtbA2U.mjs} +1 -1
- package/dist/{replyHelpers-DS-P0b32.mjs → replyHelpers-BSBVCwL3.mjs} +2 -2
- package/dist/repositoryFilter-BANpz6BX.mjs +78 -0
- package/dist/{requestContext-B6vQF-sy.mjs → requestContext-uYE35JxI.mjs} +1 -1
- package/dist/{rolldown-runtime-BhflRrBs.mjs → rolldown-runtime-DNg-KNCk.mjs} +1 -1
- package/dist/runtimeCapabilities-Dm88DaTW.mjs +49 -0
- package/dist/{schedules-C2Q3uv2d.mjs → schedules-CAcZgia0.mjs} +3 -3
- package/dist/{schemaConverter-Crjvczi_.mjs → schemaConverter-XH1RZRyu.mjs} +1 -1
- package/dist/{schemaIR-CnyKK_1j.mjs → schemaIR-CDvclAew.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-afz_Ieek.mjs → scope-BaWcqBvr.mjs} +4 -4
- package/dist/{simpleEqualityMatcher-C4KiMWUa.mjs → simpleEqualityMatcher-Se8VrsaP.mjs} +1 -1
- package/dist/{sse-B9P4Y-UI.mjs → sse-Cf0jUHsh.mjs} +5 -5
- package/dist/{sseStream-B3zb_d1h.mjs → sseStream-Bvpi-UXQ.mjs} +2 -2
- package/dist/{store-helpers-DmEMHlPQ.mjs → store-helpers-B88p99Z2.mjs} +1 -1
- package/dist/{streaming-DPZdQmDz.mjs → streaming-DsT1B5zJ.mjs} +1 -1
- package/dist/{subscribe-helpers-sp5xTDVA.mjs → subscribe-helpers-CLIOHsOK.mjs} +2 -2
- package/dist/sync/changelog.mjs +1 -1
- package/dist/testing/cleanupStoreContract.d.mts +1 -1
- package/dist/testing/cleanupStoreContract.mjs +3 -1
- package/dist/testing/index.d.mts +24 -12
- package/dist/testing/index.mjs +24 -12
- package/dist/testing/outboxStoreContract.mjs +1 -1
- package/dist/testing/storageContract.mjs +1 -1
- package/dist/{transactionContext-BvLKvOIL.mjs → transactionContext-BYtWnwAS.mjs} +1 -1
- package/dist/{typeGuards-B_5-hKjJ.mjs → typeGuards-jjKJDN13.mjs} +1 -1
- package/dist/types/index.d.mts +3 -3
- package/dist/types/index.mjs +1 -1
- package/dist/types/storage.mjs +1 -1
- package/dist/{types-CT5vu6M0.d.mts → types-BcTumAz_.d.mts} +41 -7
- package/dist/{types-CwcUQ610.d.mts → types-BfC83KsP.d.mts} +15 -1
- package/dist/{types-DXYX7dIR.mjs → types-CoqIRrkY.mjs} +4 -4
- package/dist/{types-C4QE8qnm.d.mts → types-DVLddu2q.d.mts} +144 -1
- package/dist/usage/index.d.mts +1 -1
- package/dist/usage/index.mjs +0 -0
- package/dist/{userHelpers-BNsOXzOd.mjs → userHelpers-CWF5pbZD.mjs} +1 -1
- package/dist/utils/index.d.mts +57 -5
- package/dist/utils/index.mjs +12 -11
- package/dist/{utils-BtOha_Sp.mjs → utils-h1V_sT-t.mjs} +38 -7
- package/dist/{validate-PMCPR9El.mjs → validate-CdQlz52F.mjs} +2 -2
- package/dist/{versioning-D_rhHfZm.d.mts → versioning-DEs-_hFi.d.mts} +1 -1
- package/dist/{versioning-CKv2jz_U.mjs → versioning-rZbyLVD-.mjs} +3 -3
- package/package.json +17 -16
- package/skills/arc/SKILL.md +96 -4
- package/skills/arc/references/api-reference.md +19 -0
- package/skills/arc/references/production.md +2 -2
- package/dist/projection-CjHhM5W1.mjs +0 -18
- package/dist/repositoryFilter-DotlxG3L.mjs +0 -45
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
/*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-DNg-KNCk.mjs";
|
|
3
3
|
import { toCanonicalList } from "@classytic/repo-core/pagination";
|
|
4
4
|
import fp from "fastify-plugin";
|
|
5
5
|
//#region src/plugins/replyHelpers.ts
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
|
|
2
|
+
import { arcLog } from "./logger/index.mjs";
|
|
3
|
+
import { policyRecordToFilter } from "@classytic/repo-core/filter";
|
|
4
|
+
//#region src/core/repositoryFilter.ts
|
|
5
|
+
const NATIVE_FILTER_DIALECT = Symbol.for("@classytic/arc/native-filter-dialect");
|
|
6
|
+
/**
|
|
7
|
+
* Mark a server-owned policy as intentionally adapter-native. This is an
|
|
8
|
+
* explicit escape hatch for semantics absent from repo-core's universal IR
|
|
9
|
+
* (for example MongoDB `$elemMatch`). Never apply it to client input.
|
|
10
|
+
*/
|
|
11
|
+
function nativePolicyFilter(dialect, record) {
|
|
12
|
+
return Object.freeze({
|
|
13
|
+
...record,
|
|
14
|
+
[NATIVE_FILTER_DIALECT]: dialect
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function nativeDialects(value, found = /* @__PURE__ */ new Set()) {
|
|
18
|
+
if (value === null || typeof value !== "object") return found;
|
|
19
|
+
const dialect = value[NATIVE_FILTER_DIALECT];
|
|
20
|
+
if (typeof dialect === "string") found.add(dialect);
|
|
21
|
+
if (Array.isArray(value)) for (const entry of value) nativeDialects(entry, found);
|
|
22
|
+
else for (const entry of Object.values(value)) nativeDialects(entry, found);
|
|
23
|
+
return found;
|
|
24
|
+
}
|
|
25
|
+
function stripNativeMarkers(value) {
|
|
26
|
+
if (Array.isArray(value)) return value.map(stripNativeMarkers);
|
|
27
|
+
if (value === null || typeof value !== "object" || value instanceof Date) return value;
|
|
28
|
+
const out = {};
|
|
29
|
+
for (const [key, entry] of Object.entries(value)) out[key] = stripNativeMarkers(entry);
|
|
30
|
+
return out;
|
|
31
|
+
}
|
|
32
|
+
const log = arcLog("repository-filter");
|
|
33
|
+
let warnedUnconvertible = false;
|
|
34
|
+
/** True for a `{ $op: ... }` operator object (all keys `$`-prefixed). */
|
|
35
|
+
function isOperatorObject(value) {
|
|
36
|
+
if (value === null || typeof value !== "object") return false;
|
|
37
|
+
if (Array.isArray(value) || value instanceof Date) return false;
|
|
38
|
+
const keys = Object.keys(value);
|
|
39
|
+
return keys.length > 0 && keys.some((k) => k.startsWith("$"));
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Does this compound filter contain any `$`-operator (top-level logical like
|
|
43
|
+
* `$and`/`$or`, or a field operator object like `{ $in: [...] }`)? If not, it is
|
|
44
|
+
* pure flat equality and portable as-is.
|
|
45
|
+
*/
|
|
46
|
+
function filterHasDollarOperator(record) {
|
|
47
|
+
for (const [key, value] of Object.entries(record)) {
|
|
48
|
+
if (key.startsWith("$")) return true;
|
|
49
|
+
if (isOperatorObject(value)) return true;
|
|
50
|
+
}
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Normalize a compound query/policy filter for the repository layer. Flat
|
|
55
|
+
* equality records pass through unchanged; anything carrying `$`-operators is
|
|
56
|
+
* converted to repo-core {@link Filter} IR so semantics stay explicit. Common
|
|
57
|
+
* operators compile identically across kits; capability-specific operators
|
|
58
|
+
* such as array-element matching fail loudly on adapters that cannot model them.
|
|
59
|
+
*/
|
|
60
|
+
function toRepositoryFilter(record) {
|
|
61
|
+
const dialects = nativeDialects(record);
|
|
62
|
+
if (dialects.size > 0) {
|
|
63
|
+
if (dialects.size > 1) throw new Error(`Cannot compose native policy-filter dialects: ${[...dialects].sort().join(", ")}`);
|
|
64
|
+
return stripNativeMarkers(record);
|
|
65
|
+
}
|
|
66
|
+
if (!filterHasDollarOperator(record)) return record;
|
|
67
|
+
try {
|
|
68
|
+
return policyRecordToFilter(record);
|
|
69
|
+
} catch (err) {
|
|
70
|
+
if (!warnedUnconvertible) {
|
|
71
|
+
warnedUnconvertible = true;
|
|
72
|
+
log.warn(`A \`\$\`-operator filter could not be normalized to portable Filter IR (operator outside arc's policy dialect). Passing the raw record to the repository — MongoKit handles it; non-Mongo kits may not. (${err instanceof Error ? err.message : String(err)})`);
|
|
73
|
+
}
|
|
74
|
+
return record;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { toRepositoryFilter as n, nativePolicyFilter as t };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
|
|
2
|
+
//#region src/utils/runtimeCapabilities.ts
|
|
3
|
+
/**
|
|
4
|
+
* `Symbol.for` so declarations from two arc copies in one dependency graph
|
|
5
|
+
* land in ONE registry — same reasoning as `ARC_EVENT_TRANSPORT`. Not on the
|
|
6
|
+
* public `fastify.arc` surface; the audit result is the product, not the list.
|
|
7
|
+
*/
|
|
8
|
+
const ARC_RUNTIME_CAPABILITIES = Symbol.for("arc.runtimeCapabilities");
|
|
9
|
+
function registryOf(fastify) {
|
|
10
|
+
const holder = fastify;
|
|
11
|
+
if (!holder[ARC_RUNTIME_CAPABILITIES]) holder[ARC_RUNTIME_CAPABILITIES] = [];
|
|
12
|
+
return holder[ARC_RUNTIME_CAPABILITIES];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Declare a runtime capability. Callable from ANY registration context —
|
|
16
|
+
* arc's own plugins, host `plugins()` callbacks, module `plugins` phases —
|
|
17
|
+
* which is the point: the audit sees what the constructor-time guard cannot.
|
|
18
|
+
*/
|
|
19
|
+
function declareRuntimeCapability(fastify, decl) {
|
|
20
|
+
registryOf(fastify).push(decl);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The boot audit. Runs once at the end of `buildApp`, after every declarant.
|
|
24
|
+
*
|
|
25
|
+
* - `runtime: 'distributed'` + `durability: 'memory'` + not `accepted` →
|
|
26
|
+
* collected and THROWN as one error naming every violator (fixing them one
|
|
27
|
+
* boot at a time is the checklist experience this replaces).
|
|
28
|
+
* - accepted memory declarations → one info line, so the topology decision is
|
|
29
|
+
* visible in the boot log it was made for.
|
|
30
|
+
* - non-distributed runtimes → nothing to enforce; declarations still logged
|
|
31
|
+
* at debug for `arc doctor`-style tooling.
|
|
32
|
+
*/
|
|
33
|
+
function auditRuntimeCapabilities(fastify, runtime) {
|
|
34
|
+
const declarations = registryOf(fastify);
|
|
35
|
+
if (declarations.length === 0) return;
|
|
36
|
+
if (runtime !== "distributed") {
|
|
37
|
+
fastify.log.debug({ capabilities: declarations }, "[arc] runtime capabilities declared (no distributed profile — informational)");
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const violations = declarations.filter((d) => d.durability === "memory" && !d.accepted);
|
|
41
|
+
const acceptedMemory = declarations.filter((d) => d.durability === "memory" && d.accepted);
|
|
42
|
+
if (acceptedMemory.length > 0) fastify.log.info({ accepted: acceptedMemory.map((d) => d.subsystem) }, "[arc] per-process state accepted by design under runtime: 'distributed'");
|
|
43
|
+
if (violations.length > 0) {
|
|
44
|
+
const lines = violations.map((d) => ` - ${d.subsystem}${d.detail ? ` — ${d.detail}` : ""}`).join("\n");
|
|
45
|
+
throw new Error(`runtime: 'distributed' — ${violations.length} subsystem(s) hold PER-PROCESS state that multi-replica deployment breaks:\n${lines}\nWire a shared store for each, or — where per-process is genuinely intended — have the declarant pass \`accepted: true\` with a reason.`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { declareRuntimeCapability as n, auditRuntimeCapabilities as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
3
|
-
import { t as startRenewingLease } from "./renewingLease-
|
|
1
|
+
/*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-DNg-KNCk.mjs";
|
|
3
|
+
import { t as startRenewingLease } from "./renewingLease-BnWtbA2U.mjs";
|
|
4
4
|
import fp from "fastify-plugin";
|
|
5
5
|
//#region src/plugins/schedules.ts
|
|
6
6
|
var schedules_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { o as toJsonSchema } from "./schemaConverter-
|
|
1
|
+
/*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
|
|
2
|
+
import { o as toJsonSchema } from "./schemaConverter-XH1RZRyu.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.34.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.34.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as parseJsonBody } from "../jsonBody-CfGH-GxO.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.34.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-CoqIRrkY.mjs";
|
|
3
|
+
import { n as elevation_default, t as elevationPlugin } from "../elevation-B0tlY8y1.mjs";
|
|
4
|
+
import { t as createTenantKeyGenerator } from "../rateLimitKey-XngqVNEV.mjs";
|
|
5
|
+
import { t as resolveOrgFromHeader } from "../scope-BaWcqBvr.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.34.0 | MIT | https://classytic.com */
|
|
2
|
+
import { a as OrgAccessDeniedError, l as UnauthorizedError } from "./errors-Cd_yy7aW.mjs";
|
|
3
|
+
import { n as requireSingleHeaderValue } from "./headers-CveNO9gR.mjs";
|
|
4
|
+
import { n as getUserRoles } from "./userHelpers-CWF5pbZD.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.34.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-DNg-KNCk.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-CoqIRrkY.mjs";
|
|
5
|
+
import { a as promoteStreamTokenToHeader } from "./streaming-DsT1B5zJ.mjs";
|
|
6
|
+
import { t as openSseStream } from "./sseStream-Bvpi-UXQ.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.34.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as forwardedStreamHeaders } from "./streaming-DsT1B5zJ.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 {
|
|
1
|
+
/*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
|
|
2
|
+
import { r as createEvent } from "./EventTransport-tq4CEB-q.mjs";
|
|
3
3
|
//#region src/events/defineEvent.ts
|
|
4
4
|
/**
|
|
5
5
|
* defineEvent — Typed Event Definitions with Optional Schema Validation
|
package/dist/sync/changelog.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
|
|
2
2
|
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
3
3
|
//#region src/testing/cleanupStoreContract.ts
|
|
4
4
|
/**
|
|
@@ -50,6 +50,8 @@ function plan(recipeId) {
|
|
|
50
50
|
rebuildActions: [],
|
|
51
51
|
warnings: [],
|
|
52
52
|
estimatedTotal: 1,
|
|
53
|
+
protectedTotal: 0,
|
|
54
|
+
excludeSteps: [],
|
|
53
55
|
confirmationPhrase: recipeId,
|
|
54
56
|
digest: `digest-${recipeId}`
|
|
55
57
|
};
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
import { V as ResourceDefinition } from "../index-CpzxqePp.mjs";
|
|
3
2
|
import { i as RequestScope } from "../types-ChuShpCP.mjs";
|
|
4
|
-
import { l as
|
|
5
|
-
import {
|
|
6
|
-
import "../
|
|
7
|
-
import
|
|
3
|
+
import { l as PermissionCheck, t as AnyRecord } from "../base-Csjc2oF-.mjs";
|
|
4
|
+
import { V as ResourceDefinition } from "../index-BcR2bFZQ.mjs";
|
|
5
|
+
import { n as ArcModuleInput, o as ModuleDisposer, s as ModuleSetupContext } from "../types-BcTumAz_.mjs";
|
|
6
|
+
import "../index-C5NnMEKF.mjs";
|
|
7
|
+
import { n as preloadResourcesAsync, r as CreateAppOptions, t as preloadResources } from "../preloadResources-g07ldtzh.mjs";
|
|
8
8
|
import { StorageContractSetup, StorageContractSetupResult, runStorageContract } from "./storageContract.mjs";
|
|
9
|
+
import { StandardRepo } from "@classytic/repo-core/repository";
|
|
9
10
|
import { FastifyInstance, FastifyServerOptions } from "fastify";
|
|
10
11
|
import { Mock } from "vitest";
|
|
11
|
-
import { StandardRepo } from "@classytic/repo-core/repository";
|
|
12
12
|
//#region src/testing/assertions.d.ts
|
|
13
13
|
/**
|
|
14
14
|
* expectArc — Arc-specific response assertions
|
|
@@ -611,15 +611,27 @@ declare function createMockRequest(overrides?: Partial<AnyRecord>): unknown;
|
|
|
611
611
|
*/
|
|
612
612
|
declare function createMockReply(): unknown;
|
|
613
613
|
/**
|
|
614
|
-
* Create a mock controller for testing
|
|
614
|
+
* Create a mock controller for testing.
|
|
615
|
+
*
|
|
616
|
+
* The return type is ANNOTATED rather than inferred, and writing it out IS the
|
|
617
|
+
* fix: inference expands `Mock`'s default type argument to `Procedure`, which
|
|
618
|
+
* vitest declares in an internal sub-package arc does not depend on. The
|
|
619
|
+
* emitted declaration then referenced that package by name — resolvable under
|
|
620
|
+
* npm's hoisting because `vitest` (a real peer) drags it in, and broken under
|
|
621
|
+
* pnpm's strict layout, where a transitive dep is not reachable from a
|
|
622
|
+
* consumer's root.
|
|
623
|
+
*
|
|
624
|
+
* Bare `Mock` keeps the permissive ergonomics (`.mockResolvedValue(...)`, any
|
|
625
|
+
* arguments) while naming only `vitest`, which arc does declare. Same shape
|
|
626
|
+
* `MockRepository` above uses.
|
|
615
627
|
*/
|
|
616
628
|
declare function createMockController(repository: StandardRepo<AnyRecord>): {
|
|
617
629
|
repository: StandardRepo<AnyRecord>;
|
|
618
|
-
list: Mock
|
|
619
|
-
get: Mock
|
|
620
|
-
create: Mock
|
|
621
|
-
update: Mock
|
|
622
|
-
delete: Mock
|
|
630
|
+
list: Mock;
|
|
631
|
+
get: Mock;
|
|
632
|
+
create: Mock;
|
|
633
|
+
update: Mock;
|
|
634
|
+
delete: Mock;
|
|
623
635
|
};
|
|
624
636
|
/**
|
|
625
637
|
* Create mock data factory
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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 defineResource } from "../defineResource-
|
|
6
|
-
import { t as defineAggregation } from "../defineAggregation-
|
|
7
|
-
import { E as requireOrgRole } from "../permissions-
|
|
8
|
-
import {
|
|
9
|
-
import { n as getModuleExports } from "../module-
|
|
10
|
-
import { n as preloadResourcesAsync, t as preloadResources } from "../preloadResources-
|
|
1
|
+
/*! @classytic/arc v2.34.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as CRUD_OPERATIONS } from "../constants-BxCoxmiN.mjs";
|
|
3
|
+
import { g as getUserId } from "../types-CoqIRrkY.mjs";
|
|
4
|
+
import { t as BaseController } from "../BaseController-CbkuhNI2.mjs";
|
|
5
|
+
import { t as defineResource } from "../defineResource-ZhuLonLm.mjs";
|
|
6
|
+
import { t as defineAggregation } from "../defineAggregation-Nv-DwfOf.mjs";
|
|
7
|
+
import { E as requireOrgRole } from "../permissions-CP47jdi7.mjs";
|
|
8
|
+
import { r as createApp } from "../createApp-zR-DEesr.mjs";
|
|
9
|
+
import { n as getModuleExports } from "../module-CwKsgZXp.mjs";
|
|
10
|
+
import { n as preloadResourcesAsync, t as preloadResources } from "../preloadResources-BkyqeTDz.mjs";
|
|
11
11
|
import { runStorageContract } from "./storageContract.mjs";
|
|
12
12
|
import Fastify from "fastify";
|
|
13
13
|
import { afterAll, describe, expect, it, vi } from "vitest";
|
|
@@ -251,7 +251,19 @@ function createMockReply() {
|
|
|
251
251
|
};
|
|
252
252
|
}
|
|
253
253
|
/**
|
|
254
|
-
* Create a mock controller for testing
|
|
254
|
+
* Create a mock controller for testing.
|
|
255
|
+
*
|
|
256
|
+
* The return type is ANNOTATED rather than inferred, and writing it out IS the
|
|
257
|
+
* fix: inference expands `Mock`'s default type argument to `Procedure`, which
|
|
258
|
+
* vitest declares in an internal sub-package arc does not depend on. The
|
|
259
|
+
* emitted declaration then referenced that package by name — resolvable under
|
|
260
|
+
* npm's hoisting because `vitest` (a real peer) drags it in, and broken under
|
|
261
|
+
* pnpm's strict layout, where a transitive dep is not reachable from a
|
|
262
|
+
* consumer's root.
|
|
263
|
+
*
|
|
264
|
+
* Bare `Mock` keeps the permissive ergonomics (`.mockResolvedValue(...)`, any
|
|
265
|
+
* arguments) while naming only `vitest`, which arc does declare. Same shape
|
|
266
|
+
* `MockRepository` above uses.
|
|
255
267
|
*/
|
|
256
268
|
function createMockController(repository) {
|
|
257
269
|
return {
|
|
@@ -1493,7 +1505,7 @@ function pickDefaultAuth(authMode, callerAuth) {
|
|
|
1493
1505
|
};
|
|
1494
1506
|
}
|
|
1495
1507
|
async function createTestApp(options = {}) {
|
|
1496
|
-
const { createApp } = await import("../createApp-
|
|
1508
|
+
const { createApp } = await import("../createApp-zR-DEesr.mjs").then((n) => n.i);
|
|
1497
1509
|
const { resources = [], db = "in-memory", connectMongoose = false, authMode = "jwt", defaultOrgId, plugins, auth: callerAuth, ...appOptions } = options;
|
|
1498
1510
|
let dbHandle;
|
|
1499
1511
|
let dbUri;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.34.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
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { $ as OpenApiSchemas, A as RequestIdOptions, An as BaseControllerOptions, At as RouteDefinition, Bt as RawRouteHandler, C as RequestContext, D as HealthCheck, Dt as ActionEntry, E as GracefulShutdownOptions, Et as ActionDefinition, F as FastifyWithDecorators, Ft as ControllerLike, G as OnTenantDeleteConfig, Gt as Authenticator, H as CrudController, I as MiddlewareHandler, It as FastifyHandler, J as PresetHook, Jt as TokenPair, K as ResolvedTenantPurge, Kt as AuthenticatorContext, L as RequestWithExtras, Lt as IController, M as EventsDecorator, Mt as RouteMethod, N as FastifyRequestExtras, Nt as RateLimitConfig, O as HealthOptions, Ot as ActionHandlerFn, P as FastifyWithAuth, Pt as ControllerHandler, Q as MiddlewareConfig, Rt as IControllerResponse, S as QueryParserInterface, T as CrudRouterOptions, Tt as ResourceCacheConfig, U as ResourceConfig, Ut as AuthHelpers, Vt as RouteHandler, W as ResourcePermissions, Wt as AuthPluginOptions, 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, jt as RouteMcpConfig, k as IntrospectionPluginOptions, 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, qt as JwtContext, 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, y as OwnershipCheck, zt as IRequestContext } from "../index-CpzxqePp.mjs";
|
|
3
2
|
import { i as RequestScope } from "../types-ChuShpCP.mjs";
|
|
4
|
-
import { a as
|
|
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-Csjc2oF-.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-BcR2bFZQ.mjs";
|
|
5
5
|
import { n as ElevationOptions, t as ElevationEvent } from "../elevation-BXCfVcNG.mjs";
|
|
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, 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, RouteDefinition, RouteHandler, RouteHandlerMethod, RouteMcpConfig, RouteMethod, RouteSchemaOptions, ServiceContext, TokenPair, TypedController, TypedRepository, TypedResourceConfig, UserBase, UserLike, UserOrganization, ValidateOptions, ValidationResult };
|
|
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.34.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.34.0 | MIT | https://classytic.com */
|
|
2
2
|
export {};
|
|
@@ -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-BEVP50ka.mjs";
|
|
3
|
+
import { n as ErrorMapper } from "./errorHandler-DI5AN2b5.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
|
|
@@ -49,6 +49,12 @@ interface ScheduleDefinition {
|
|
|
49
49
|
handler: (fastify: FastifyInstance) => void | Promise<void>;
|
|
50
50
|
/** Fire once immediately when the app becomes ready (default: false). */
|
|
51
51
|
runOnStart?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Topology tag: `'relay'` marks an arm a `role: 'relay'` process runs
|
|
54
|
+
* (outbox relays); everything else is `'job'` (default). See
|
|
55
|
+
* `CreateAppOptions.role`.
|
|
56
|
+
*/
|
|
57
|
+
kind?: "relay" | "job";
|
|
52
58
|
/**
|
|
53
59
|
* Random extra delay in `[0, jitterMs)` added to the FIRST tick only.
|
|
54
60
|
* Spreads boot-aligned jobs so multiple same-cadence schedules don't all
|
|
@@ -440,11 +446,39 @@ interface ArcModule<TExports = unknown> {
|
|
|
440
446
|
*/
|
|
441
447
|
readonly dependsOn?: readonly string[];
|
|
442
448
|
/**
|
|
443
|
-
*
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
*
|
|
447
|
-
*
|
|
449
|
+
* Infra SETUP function — the module-level analog of the app's `plugins()`
|
|
450
|
+
* slot. Runs in the plugins phase: AFTER the app's own `plugins()` (so
|
|
451
|
+
* module infra can build on app foundations like a DB connection) and in
|
|
452
|
+
* `dependsOn` order, but BEFORE any module `bootstrap` — so engines
|
|
453
|
+
* initialised in `bootstrap` can rely on what's registered here.
|
|
454
|
+
*
|
|
455
|
+
* ## ⚠ This is NOT itself a Fastify plugin
|
|
456
|
+
*
|
|
457
|
+
* Despite the name, arc CALLS this function directly — it is never handed
|
|
458
|
+
* to `fastify.register()`. Two consequences, both of which bite module
|
|
459
|
+
* authors coming from ordinary Fastify plugins:
|
|
460
|
+
*
|
|
461
|
+
* - **You must register plugins yourself.** `await fastify.register(x)`,
|
|
462
|
+
* not `return x`. A returned function is read as a DISPOSER (below),
|
|
463
|
+
* so returning a plugin silently registers nothing and then invokes
|
|
464
|
+
* your plugin as a teardown callback. Arc detects the `fastify-plugin`
|
|
465
|
+
* case and throws; the bare-function case warns.
|
|
466
|
+
* - **There is no encapsulation and no prefix here.** Decorators and
|
|
467
|
+
* hooks you add land on the instance arc passes you — the same
|
|
468
|
+
* instance every other module sees. Fastify's encapsulation applies
|
|
469
|
+
* only inside a `register()` call you make yourself. See
|
|
470
|
+
* https://fastify.dev/docs/latest/Reference/Plugins/
|
|
471
|
+
*
|
|
472
|
+
* ```ts
|
|
473
|
+
* plugins: async (fastify) => {
|
|
474
|
+
* await fastify.register(somePlugin, { prefix: '/x' }); // ✅ register
|
|
475
|
+
* fastify.decorate('thing', thing); // ✅ root-visible
|
|
476
|
+
* // return somePlugin // ❌ never registered
|
|
477
|
+
* },
|
|
478
|
+
* ```
|
|
479
|
+
*
|
|
480
|
+
* The name is kept for the 2.x line; v3 renames the slot to `setup` and
|
|
481
|
+
* REMOVES `plugins` outright — v3 ships no compatibility aliases (v3.md).
|
|
448
482
|
*
|
|
449
483
|
* Separating this from `bootstrap` keeps lifecycle intent explicit for
|
|
450
484
|
* published ecosystem packages: `plugins` = "register infra"; `bootstrap` =
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { V as ResourceDefinition } from "./index-
|
|
2
|
+
import { V as ResourceDefinition } from "./index-BcR2bFZQ.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) */
|
|
@@ -377,6 +377,20 @@ interface McpAuthResult {
|
|
|
377
377
|
* Carried on the `service` RequestScope for fine-grained permission checks.
|
|
378
378
|
*/
|
|
379
379
|
scopes?: readonly string[];
|
|
380
|
+
/**
|
|
381
|
+
* Active team — carried onto a `member` scope so `getTeamId()` answers the
|
|
382
|
+
* same on MCP as on HTTP. Member-only, like the HTTP surface.
|
|
383
|
+
*/
|
|
384
|
+
teamId?: string;
|
|
385
|
+
/**
|
|
386
|
+
* Host-defined scope dimensions (`branchId`, `projectId`, `region`, …),
|
|
387
|
+
* carried onto `member` / `service` scopes.
|
|
388
|
+
*
|
|
389
|
+
* Declared explicitly because `requireScopeContext()` AUTHORISES against
|
|
390
|
+
* these: a resource gated on `branchId` denies every MCP call until the
|
|
391
|
+
* resolver supplies it. Non-string entries are dropped rather than coerced.
|
|
392
|
+
*/
|
|
393
|
+
context?: Record<string, string>;
|
|
380
394
|
/** Any extra metadata from the auth resolver */
|
|
381
395
|
[key: string]: unknown;
|
|
382
396
|
}
|
|
@@ -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.34.0 | MIT | https://classytic.com */
|
|
2
|
+
import { l as UnauthorizedError, o as OrgRequiredError } from "./errors-Cd_yy7aW.mjs";
|
|
3
|
+
import { n as requireSingleHeaderValue } from "./headers-CveNO9gR.mjs";
|
|
4
|
+
import { t as getUserId$1 } from "./userHelpers-CWF5pbZD.mjs";
|
|
5
5
|
//#region src/scope/types.ts
|
|
6
6
|
/**
|
|
7
7
|
* Request Scope — The One Standard
|