@classytic/arc 2.48.0 → 2.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{EventTransport-BWwg5YAU.mjs → EventTransport-B18mcj_M.mjs} +2 -2
- package/dist/{HookSystem-B9x-Y_k7.mjs → HookSystem-FUBaLTRm.mjs} +2 -2
- package/dist/{QueryCache-DdvrGG8Q.d.mts → QueryCache-BE47tmlO.d.mts} +36 -1
- package/dist/{ResourceRegistry-BcvEJoZd.mjs → ResourceRegistry-C5NM07fZ.mjs} +2 -2
- package/dist/{acquire-D2yj6Zzl.mjs → acquire-MHCnbDtH.mjs} +1 -1
- package/dist/audit/index.d.mts +1 -1
- package/dist/audit/index.mjs +4 -4
- package/dist/auth/audit.mjs +1 -1
- package/dist/auth/index.d.mts +2 -2
- package/dist/auth/index.mjs +53 -15
- package/dist/auth/redis-session.mjs +1 -1
- package/dist/{authorizationDecision-BZSJcPNE.mjs → authorizationDecision-BD8K4jdQ.mjs} +4 -4
- package/dist/{boundedMap-o2KZDCWy.mjs → boundedMap-CuCwos_X.mjs} +1 -1
- package/dist/{buildHandler-G3k59KY2.mjs → buildHandler-BttjNkTM.mjs} +23 -16
- package/dist/cache/index.d.mts +2 -2
- package/dist/cache/index.mjs +4 -4
- package/dist/{caching-CJIDPZOv.mjs → caching-CxUQLHfR.mjs} +3 -6
- package/dist/{claimed-D0A43wjT.mjs → claimed-CQ4ZpD8K.mjs} +1 -1
- package/dist/cleanup/index.d.mts +2 -2
- package/dist/cleanup/index.mjs +4 -4
- package/dist/cli/commands/describe.d.mts +1 -1
- package/dist/cli/commands/describe.mjs +3 -3
- package/dist/cli/commands/docs.mjs +3 -3
- package/dist/cli/commands/doctor.mjs +1 -1
- package/dist/cli/commands/generate.mjs +2 -2
- package/dist/cli/commands/init.mjs +2 -2
- package/dist/cli/commands/introspect.mjs +2 -2
- package/dist/cli/index.mjs +3 -3
- package/dist/{constants-D-faL5SX.mjs → constants-BZFsZwJh.mjs} +1 -1
- package/dist/context/index.mjs +5 -5
- package/dist/core/index.d.mts +3 -3
- package/dist/core/index.mjs +7 -7
- package/dist/{core-NSu1peyq.mjs → core-DWA1-5IE.mjs} +3 -3
- package/dist/{createActionRouter-DTSVv1VK.mjs → createActionRouter-fP3l2xVF.mjs} +54 -18
- package/dist/{createAggregationRouter-zEasm-ax.mjs → createAggregationRouter-BJZeOmBa.mjs} +13 -11
- package/dist/{createApp-CjqhkX1x.mjs → createApp-Db9JRumw.mjs} +332 -40
- package/dist/{createMcpServer-hSFeqRUb.d.mts → createMcpServer-CS2KOVP6.d.mts} +1 -1
- package/dist/{defineAggregation-DH2L6_v9.mjs → defineAggregation-BskqRz8M.mjs} +1 -1
- package/dist/{defineResource-zYCrhNaN.mjs → defineResource-B2vTvKzW.mjs} +8 -8
- 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-z--rFcZ5.mjs → elevation-XoY0C73T.mjs} +6 -9
- package/dist/encryption/index.mjs +3 -3
- package/dist/{errorHandler-3_3oN-Uc.mjs → errorHandler-BYI-JQMm.mjs} +4 -7
- package/dist/{errors-DyY48oRi.mjs → errors-3xaK0i9n.mjs} +1 -1
- package/dist/{eventPlugin-Co9sABCg.mjs → eventPlugin-CVQ9ddnL.mjs} +9 -13
- package/dist/{eventTypes-HmAFyJmJ.mjs → eventTypes-UPYg7gW1.mjs} +2 -2
- package/dist/events/index.d.mts +18 -5
- package/dist/events/index.mjs +8 -8
- package/dist/events/transports/redis-stream-entry.mjs +4 -4
- package/dist/events/transports/redis.d.mts +35 -0
- package/dist/events/transports/redis.mjs +87 -11
- package/dist/factory/index.d.mts +4 -4
- package/dist/factory/index.mjs +6 -6
- package/dist/{fastify-augmentation-bzkWPt1f.d.mts → fastify-augmentation-baQc3MaO.d.mts} +2 -2
- package/dist/fieldTypes-CxRvCaaZ.mjs +80 -0
- package/dist/{fields-rfsl26Ov.mjs → fields-DLFcJiDe.mjs} +1 -1
- package/dist/{filter-merge-8glLr7Dk.mjs → filter-merge-Bvjk_8dV.mjs} +1 -1
- package/dist/{generate-BOfBueRt.mjs → generate-0OpCUjUv.mjs} +2 -2
- package/dist/{headers-CHSOqpcY.mjs → headers-BROW65-r.mjs} +2 -2
- package/dist/{health-ezwTHQh2.mjs → health-Cfh-kYI_.mjs} +1 -1
- package/dist/{health-DHvAIVmM.mjs → health-Cy6aOg1i.mjs} +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/http-cache/index.d.mts +2 -2
- package/dist/http-cache/index.mjs +4 -4
- package/dist/http-cache/purgers/cloudflare.mjs +2 -2
- package/dist/http-cache/purgers/fastly.mjs +2 -2
- package/dist/http-cache/testing/index.mjs +1 -1
- package/dist/idempotency/index.d.mts +1 -1
- package/dist/idempotency/index.mjs +10 -8
- package/dist/idempotency/redis.mjs +2 -2
- package/dist/{index-B5i9-vuP.d.mts → index-CMNpMBtW.d.mts} +1 -1
- package/dist/{index-BxZS-8So.d.mts → index-DKM2p5w5.d.mts} +48 -23
- package/dist/{index-Cy2-QffW.d.mts → index-DLCcLUQT.d.mts} +69 -6
- package/dist/{index-DFCCQ9AE.d.mts → index-DexdFs1a.d.mts} +1 -1
- package/dist/{index-D1X_C_qz.d.mts → index-Dhrks-hM.d.mts} +60 -10
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +11 -11
- package/dist/{init-MoE3eZNR.mjs → init-D7PQcvvL.mjs} +1 -1
- package/dist/integrations/event-gateway.mjs +2 -2
- package/dist/integrations/index.d.mts +2 -2
- package/dist/integrations/index.mjs +1 -1
- package/dist/integrations/jobs/index.mjs +3 -3
- package/dist/integrations/mcp/index.d.mts +5 -5
- package/dist/integrations/mcp/index.mjs +2 -2
- package/dist/integrations/mcp/testing.d.mts +2 -2
- package/dist/integrations/mcp/testing.mjs +2 -2
- package/dist/integrations/streamline.mjs +3 -3
- package/dist/integrations/webhooks.d.mts +1 -1
- package/dist/integrations/webhooks.mjs +4 -4
- package/dist/integrations/websocket-pushref-redis.mjs +1 -1
- package/dist/integrations/websocket-redis.mjs +1 -1
- package/dist/integrations/websocket.mjs +2 -2
- package/dist/{jsonBody-DZGiCawf.mjs → jsonBody-C0oREwUc.mjs} +2 -2
- package/dist/{keys-CrMOZuk6.mjs → keys-CGlPoVSn.mjs} +1 -1
- package/dist/{loadResources-CVQvYUhN.mjs → loadResources-Oi47dogA.mjs} +3 -3
- package/dist/{loadResourcesFromEntry-D0naccV2.mjs → loadResourcesFromEntry-BW-LexBz.mjs} +2 -2
- package/dist/logger/index.mjs +2 -2
- package/dist/{logger-VyMcSmVG.mjs → logger-BagW7_YA.mjs} +1 -1
- package/dist/{mcpPlugin-DQACaqVu.mjs → mcpPlugin-C6-wFsOX.mjs} +29 -26
- package/dist/{memory-Lpfu8Hga.mjs → memory-Bl7kv6TS.mjs} +3 -3
- package/dist/{metrics-DjVj1sg5.mjs → metrics-CqnMJKrJ.mjs} +4 -7
- 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-BqPJpZ_L.mjs → module-lbEbHUfI.mjs} +1 -1
- package/dist/{multiTenant-KZj8j1uJ.d.mts → multiTenant-QtDzxx_K.d.mts} +1 -1
- package/dist/{multipartBody-BNgNv7r0.mjs → multipartBody-CqNezaB3.mjs} +1 -1
- package/dist/{observeSend-BKJHibJz.mjs → observeSend-BjilzlYl.mjs} +1 -1
- package/dist/{openapi-T90KrPR6.mjs → openapi-DXNbadgd.mjs} +7 -7
- package/dist/outbox-admin/index.d.mts +1 -1
- package/dist/outbox-admin/index.mjs +5 -5
- package/dist/{outbox-module-5Mnwcycy.d.mts → outbox-module-DzW6zwWJ.d.mts} +103 -10
- package/dist/{outbox-module-C874VgBr.mjs → outbox-module-k5rIszQ4.mjs} +197 -28
- package/dist/permissions/index.d.mts +2 -2
- package/dist/permissions/index.mjs +7 -7
- package/dist/{permissions-R9T2G1PH.mjs → permissions-BJylQopQ.mjs} +9 -9
- package/dist/{pipe-DzqbsZy-.mjs → pipe-D1cq8hET.mjs} +2 -2
- package/dist/pipeline/index.d.mts +1 -1
- package/dist/pipeline/index.mjs +2 -2
- package/dist/{plan-C0gkeABY.mjs → plan-iEgaS5_H.mjs} +1 -1
- package/dist/{plugin-BJcVOX5r.mjs → plugin-DsLr6L4O.mjs} +94 -50
- package/dist/plugins/index.d.mts +6 -5
- package/dist/plugins/index.mjs +19 -18
- package/dist/plugins/response-cache.mjs +4 -4
- package/dist/plugins/tracing-entry.mjs +2 -2
- package/dist/{pluralize-CrCpyoZs.mjs → pluralize-CX4ZvwCa.mjs} +1 -1
- package/dist/presets/filesUpload.d.mts +1 -1
- 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 +5 -5
- package/dist/presets/search.d.mts +1 -1
- package/dist/presets/search.mjs +2 -2
- package/dist/{presets-CNDvNYsz.mjs → presets-D_suT4OY.mjs} +4 -4
- package/dist/{projection-CIUe8b59.mjs → projection-CmjGjFih.mjs} +2 -2
- package/dist/{purger.types-f83fTzGy.mjs → purger.types-CZwkTZ7B.mjs} +1 -1
- package/dist/{queryCachePlugin-B2jpwFcv.mjs → queryCachePlugin-BDOPEAmH.mjs} +114 -14
- package/dist/{queryCachePlugin-DYQUyeJ9.d.mts → queryCachePlugin-DrQNnGws.d.mts} +1 -1
- package/dist/{rateLimitKey-BWx-qep0.mjs → rateLimitKey-igF1x64n.mjs} +1 -1
- package/dist/{realtime-D2tqi3d2.mjs → realtime-Cq_ugiWw.mjs} +75 -22
- package/dist/registry/index.d.mts +2 -2
- package/dist/registry/index.mjs +3 -3
- package/dist/{registry-Dl0k6UXy.mjs → registry-DmF9Akvn.mjs} +2 -2
- package/dist/{relay-ZYvS4xyW.mjs → relay-DA89IhFt.mjs} +200 -99
- package/dist/{renewingLease-DT4yLb29.mjs → renewingLease-DBtGUt8T.mjs} +1 -1
- package/dist/{replyHelpers-BJFN5AW7.mjs → replyHelpers-CUbeUc5q.mjs} +2 -2
- package/dist/{requestContext-Ct5la-SA.mjs → requestContext-DO9Qv0gw.mjs} +1 -1
- package/dist/{requirement-CxDxjB6V.mjs → requirement-C3GaQmkR.mjs} +1 -1
- package/dist/{resourceRateLimit-DCWglD7V.d.mts → resourceRateLimit-BPiESPtG.d.mts} +4 -0
- package/dist/{resourceRateLimit-D1oH2obv.mjs → resourceRateLimit-KKn-sFhb.mjs} +19 -4
- package/dist/{rolldown-runtime-BdTN42uL.mjs → rolldown-runtime-Ck1Tj4Ax.mjs} +1 -1
- package/dist/{routeValidator-DclDl5WJ.mjs → routeValidator-BF7n34xV.mjs} +47 -5
- package/dist/{runtimeCapabilities-ClWr60El.mjs → runtimeCapabilities-D0A4kkrC.mjs} +1 -1
- package/dist/{schedules-gVkRcs-9.mjs → schedules-CLrQRSTt.mjs} +6 -9
- package/dist/{schemaConverter-CIwB5wPO.mjs → schemaConverter-JEmU21fu.mjs} +2 -2
- package/dist/{actionPermissions-Dha8sAz2.mjs → schemaIR-wOffQlbq.mjs} +184 -16
- package/dist/schemas/index.mjs +1 -1
- package/dist/scim/index.mjs +2 -2
- package/dist/scope/index.d.mts +1 -1
- package/dist/scope/index.mjs +5 -5
- package/dist/{scope-VMZhdkbT.mjs → scope-CcTMRd7s.mjs} +4 -4
- package/dist/{shutdown-Bi19vH0z.mjs → shutdown-BIR-QBYM.mjs} +1 -1
- package/dist/{simpleEqualityMatcher-CaCS09fh.mjs → simpleEqualityMatcher-DqqJqovq.mjs} +1 -1
- package/dist/{sse-BqM359f1.mjs → sse-OEuPpgss.mjs} +9 -35
- package/dist/sseStats-DQqNN385.d.mts +112 -0
- package/dist/sseStream-DknHE2K5.mjs +166 -0
- package/dist/{store-helpers-rx-F2ZGR.mjs → store-helpers-D4vtEXt2.mjs} +1 -1
- package/dist/{streaming-CPChx3A7.mjs → streaming-CcIpcx02.mjs} +1 -1
- package/dist/{subscriberIdentity-CYNYw8p_.mjs → subscriberIdentity-PO6kimAl.mjs} +1 -1
- package/dist/{tenancy-BoWImS3K.mjs → tenancy-CH2Kuksc.mjs} +2 -2
- package/dist/{tenantPreparation-oqKCZQZM.mjs → tenantPreparation-BTGpblQW.mjs} +4 -4
- package/dist/testing/cleanupStoreContract.mjs +1 -1
- package/dist/testing/index.d.mts +4 -4
- package/dist/testing/index.mjs +324 -17
- package/dist/testing/outboxStoreContract.mjs +2 -2
- package/dist/testing/requiredPorts.mjs +2 -2
- package/dist/testing/storageContract.mjs +1 -1
- package/dist/{timing-Dsteq59c.mjs → timing-Dii5X7AP.mjs} +1 -1
- package/dist/{transactionContext-C1OgH-hW.mjs → transactionContext-DMPhYEOt.mjs} +1 -1
- package/dist/{typeGuards-DNlpASzd.mjs → typeGuards-C1o_XEyp.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-DduBiYaI.d.mts → types-B4E0sc6D.d.mts} +2 -2
- package/dist/{types-HFFSwF_K.mjs → types-BuV_cFqT.mjs} +4 -4
- package/dist/usage/index.d.mts +1 -1
- package/dist/usage/index.mjs +7 -7
- package/dist/{userHelpers-N-k-8dNF.mjs → userHelpers-D4m_pLSC.mjs} +1 -1
- package/dist/utils/index.d.mts +193 -34
- package/dist/utils/index.mjs +13 -13
- package/dist/{utils-C7w_RVlx.mjs → utils-CxLMXGn5.mjs} +761 -8
- package/dist/{validate-Brr4b_fH.mjs → validate-CZ975J8N.mjs} +3 -3
- package/dist/{versioning-S18y2-0C.d.mts → versioning-B07RgD27.d.mts} +2 -13
- package/dist/{versioning-CE5kdWOY.mjs → versioning-B2_8SBZo.mjs} +4 -7
- package/dist/{workScope-A3XBpYTa.mjs → workScope-B3W3r35s.mjs} +2 -2
- package/llms.txt +2 -2
- package/package.json +34 -34
- package/skills/arc/references/api-reference.md +2 -2
- package/skills/arc/references/auth-better-auth.md +1 -0
- package/skills/arc/references/events-outbox.md +7 -4
- package/skills/arc/references/events.md +2 -2
- package/skills/arc/references/production-api.md +4 -0
- package/skills/arc/references/production-boot.md +2 -0
- package/skills/arc/references/production-idempotency.md +1 -1
- package/skills/arc/references/production-realtime.md +28 -2
- package/skills/arc/references/validation.md +4 -0
- package/skills/arc/references/writes-hooks-errors.md +1 -0
- package/dist/schemaIR-A0IoD05P.mjs +0 -108
- package/dist/sseStream-qSa-F2Qm.mjs +0 -57
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { d as createDomainError } from "../errors-
|
|
3
|
-
import { n as requireSingleHeaderValue } from "../headers-
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import { n as
|
|
7
|
-
import { n as
|
|
1
|
+
/*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
|
|
2
|
+
import { d as createDomainError } from "../errors-3xaK0i9n.mjs";
|
|
3
|
+
import { n as requireSingleHeaderValue } from "../headers-BROW65-r.mjs";
|
|
4
|
+
import { n as createIdempotencyResult, r as operationIdentity, t as resolveIdempotencyTiming } from "../timing-Dii5X7AP.mjs";
|
|
5
|
+
import { n as acquireIdempotencyKey, r as releaseIdempotencyLock } from "../acquire-MHCnbDtH.mjs";
|
|
6
|
+
import { n as createSafeGetOne, t as createIsDuplicateKeyError } from "../store-helpers-D4vtEXt2.mjs";
|
|
7
|
+
import { i as requestRequiresIdempotencyKey, n as idempotencyConfigProblem, r as requestDedupedByHandler, t as declaresIdempotencyFence } from "../requirement-C3GaQmkR.mjs";
|
|
8
8
|
import { ARC_ERROR_CODES } from "@classytic/repo-core/errors";
|
|
9
9
|
import { and, eq, exists, gt, lt, or, startsWith } from "@classytic/repo-core/filter";
|
|
10
10
|
import { createHash } from "node:crypto";
|
|
@@ -181,7 +181,9 @@ function repositoryAsIdempotencyStore(repository, defaultTtlMs) {
|
|
|
181
181
|
}
|
|
182
182
|
},
|
|
183
183
|
async unlock(key, requestId) {
|
|
184
|
-
|
|
184
|
+
const ours = and(eq(idField, key), eq("lock.requestId", requestId));
|
|
185
|
+
if (((await r.deleteMany(and(ours, exists("result.statusCode", false))))?.deletedCount ?? 0) > 0) return;
|
|
186
|
+
await r.findOneAndUpdate(ours, update({ unset: ["lock"] }));
|
|
185
187
|
},
|
|
186
188
|
async isLocked(key) {
|
|
187
189
|
const doc = await safeGetOne(eq(idField, key));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as acquireBySteps } from "../acquire-
|
|
1
|
+
/*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as acquireBySteps } from "../acquire-MHCnbDtH.mjs";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
// src/idempotency/stores/redis.ts
|
|
5
5
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { i as RequestScope, n as Mandate } from "./types-DnkIALZ8.mjs";
|
|
3
3
|
import { c as DataPolicy, l as PermissionCheck, s as AuthorizationDecision, u as PermissionContext } from "./base-HXNgPQww.mjs";
|
|
4
4
|
import { r as CacheStore, t as CacheLogger } from "./interface-WR1U0K7t.mjs";
|
|
5
|
-
import "./resourceRateLimit-
|
|
5
|
+
import "./resourceRateLimit-BPiESPtG.mjs";
|
|
6
6
|
import { FastifyInstance, FastifyReply, FastifyRequest } from "fastify";
|
|
7
7
|
/**
|
|
8
8
|
* Require a sender-constrained credential — the inbound token MUST carry a
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import
|
|
2
|
+
import "./fastify-augmentation-baQc3MaO.mjs";
|
|
3
|
+
import { A as RequestWithExtras, F as ResourceDefinition, I as CrudController, L as ResourceConfig, O as FastifyWithDecorators, Un as IControllerResponse, Wn as IRequestContext, X as RouteSchemaOptions, Z as ArcFieldRule, g as RequestContext, k as MiddlewareHandler, kt as RouteMcpConfig, ot as AggregationConfig, v as CrudRouterOptions, wt as ActionDefinition } from "./index-DLCcLUQT.mjs";
|
|
3
4
|
import { l as PermissionCheck, t as AnyRecord } from "./base-HXNgPQww.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import "./fastify-augmentation-bzkWPt1f.mjs";
|
|
5
|
+
import { i as RequestScope } from "./types-DnkIALZ8.mjs";
|
|
6
6
|
import { Filter } from "@classytic/repo-core/filter";
|
|
7
7
|
import { FastifyReply, FastifyRequest, RouteHandlerMethod } from "fastify";
|
|
8
8
|
import { z } from "zod";
|
|
@@ -333,11 +333,28 @@ interface RouteInputSlots {
|
|
|
333
333
|
/** Serialization + docs. A `z.object` response strips fields it does not declare. */
|
|
334
334
|
response?: Record<number, InputSchema> | undefined;
|
|
335
335
|
}
|
|
336
|
+
/** One zod issue as the parse saw it (`params` is what a refinement's `ctx.addIssue` attached). */
|
|
337
|
+
interface RouteInputIssue {
|
|
338
|
+
readonly path: ReadonlyArray<PropertyKey>;
|
|
339
|
+
readonly message: string;
|
|
340
|
+
readonly code?: string;
|
|
341
|
+
readonly params?: unknown;
|
|
342
|
+
}
|
|
343
|
+
/** Options shared by {@link routeInput}, {@link crudInput}. */
|
|
344
|
+
interface RouteInputOptions {
|
|
345
|
+
/**
|
|
346
|
+
* A failed parse's issues -> the error to throw instead of the default 400
|
|
347
|
+
* `arc.validation_error`, or `undefined` to keep it. Lets a schema choose its own code: a
|
|
348
|
+
* refinement tags its issue (`ctx.addIssue({ ..., params: { code: 'insights.range_too_long' } })`)
|
|
349
|
+
* and this returns `new ArcError(msg, { code, statusCode: 400 })` for it.
|
|
350
|
+
*/
|
|
351
|
+
readonly mapIssues?: ((issues: readonly RouteInputIssue[]) => Error | undefined) | undefined;
|
|
352
|
+
}
|
|
336
353
|
/**
|
|
337
354
|
* Spread into a route entry: `{ method, path, permissions, ...routeInput({ body }), handler }`.
|
|
338
355
|
* `preHandler` is empty when no zod body/querystring/params slot is declared.
|
|
339
356
|
*/
|
|
340
|
-
declare function routeInput<const S extends RouteInputSlots>(slots: S): {
|
|
357
|
+
declare function routeInput<const S extends RouteInputSlots>(slots: S, options?: RouteInputOptions): {
|
|
341
358
|
schema: S;
|
|
342
359
|
preHandler: RouteHandlerMethod[];
|
|
343
360
|
};
|
|
@@ -349,37 +366,45 @@ declare function parsed<S extends z.ZodType>(_schema: S, value: unknown): z.outp
|
|
|
349
366
|
*/
|
|
350
367
|
declare const noPayloadSchema: Readonly<Record<string, unknown>>;
|
|
351
368
|
/**
|
|
352
|
-
*
|
|
353
|
-
* `
|
|
354
|
-
* stays optional; `z.strictObject` refuses unknown keys); `openApiSchemas` makes the generated
|
|
355
|
-
* reference describe what the route accepts rather than the stored model.
|
|
356
|
-
*
|
|
357
|
-
* `parse: true` also adds a create/update middleware that replaces `request.body` with the zod
|
|
358
|
-
* OUTPUT (trim, defaults, refinements). It writes `middlewares.create` / `middlewares.update`, so
|
|
359
|
-
* merge your own: `middlewares: { create: [...mine, ...crud.middlewares.create] }`.
|
|
369
|
+
* What {@link crudInput} returns. Each slot is present only when its schema was given
|
|
370
|
+
* (never `undefined`), so the spread type-checks under `exactOptionalPropertyTypes`.
|
|
360
371
|
*/
|
|
361
|
-
|
|
362
|
-
create?: InputSchema;
|
|
363
|
-
update?: InputSchema;
|
|
364
|
-
parse?: boolean;
|
|
365
|
-
}): {
|
|
372
|
+
interface CrudInput {
|
|
366
373
|
customSchemas: {
|
|
367
374
|
create?: {
|
|
368
375
|
body: InputSchema;
|
|
369
|
-
}
|
|
376
|
+
};
|
|
370
377
|
update?: {
|
|
371
378
|
body: InputSchema;
|
|
372
|
-
}
|
|
379
|
+
};
|
|
373
380
|
};
|
|
374
381
|
openApiSchemas: {
|
|
375
|
-
createBody?: InputSchema
|
|
376
|
-
updateBody?: InputSchema
|
|
382
|
+
createBody?: InputSchema;
|
|
383
|
+
updateBody?: InputSchema;
|
|
377
384
|
};
|
|
385
|
+
/** Filled only with `parse: true`. */
|
|
378
386
|
middlewares: {
|
|
379
387
|
create?: MiddlewareHandler[];
|
|
380
388
|
update?: MiddlewareHandler[];
|
|
381
389
|
};
|
|
382
|
-
}
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Wire shape of a resource's own CRUD writes. Spread into `defineResource`:
|
|
393
|
+
* `customSchemas` is what AJV validates (and, for zod, converts input-direction: a `.default()`
|
|
394
|
+
* stays optional; `z.strictObject` refuses unknown keys); `openApiSchemas` makes the generated
|
|
395
|
+
* reference describe what the route accepts rather than the stored model.
|
|
396
|
+
*
|
|
397
|
+
* `parse: true` also adds a create/update middleware that replaces `request.body` with the zod
|
|
398
|
+
* OUTPUT (trim, defaults, refinements). It writes `middlewares.create` / `middlewares.update`, so
|
|
399
|
+
* merge your own: `middlewares: { create: [...mine, ...crud.middlewares.create] }`.
|
|
400
|
+
*/
|
|
401
|
+
declare function crudInput(input: {
|
|
402
|
+
create?: InputSchema | undefined;
|
|
403
|
+
update?: InputSchema | undefined;
|
|
404
|
+
parse?: boolean | undefined;
|
|
405
|
+
/** With `parse: true`: see {@link RouteInputOptions.mapIssues}. */
|
|
406
|
+
mapIssues?: RouteInputOptions["mapIssues"];
|
|
407
|
+
}): CrudInput;
|
|
383
408
|
interface ConfigError {
|
|
384
409
|
field: string;
|
|
385
410
|
message: string;
|
|
@@ -410,4 +435,4 @@ declare function formatValidationErrors(resourceName: string, result: Validation
|
|
|
410
435
|
* Validate and throw if invalid
|
|
411
436
|
*/
|
|
412
437
|
declare function assertValidConfig(config: ResourceConfig, options?: ValidateOptions): void;
|
|
413
|
-
export {
|
|
438
|
+
export { MAX_SEARCH_LENGTH as $, ResourceSeams as A, DEFAULT_ID_FIELD as B, getControllerScope as C, VariantsResult as D, VariantsMap as E, createCrudRouter as F, DEFAULT_UPDATE_METHOD as G, DEFAULT_MAX_LIMIT as H, createPermissionMiddleware as I, HOOK_PHASES as J, DEFAULT_VERSION_FIELD as K, defineAggregation as L, mergeResourceConfig as M, DefineActionConfig as N, defineResourceVariants as O, defineAction as P, MAX_REGEX_LENGTH as Q, CRUD_OPERATIONS as R, getControllerContext as S, VariantOverride as T, DEFAULT_SORT as U, DEFAULT_LIMIT as V, DEFAULT_TENANT_FIELD as W, HookPhase as X, HookOperation as Y, MAX_FILTER_DEPTH as Z, nativePolicyFilter as _, formatValidationErrors as a, createFastifyHandler as b, InputSchema as c, RouteInputSlots as d, MUTATION_OPERATIONS as et, crudInput as f, NativePolicyFilter as g, routeInput as h, assertValidConfig as i, SeamedResourceConfig as j, AdapterLike as k, RouteInputIssue as l, parsed as m, ValidateOptions as n, RESERVED_QUERY_PARAMS as nt, validateResourceConfig as o, noPayloadSchema as p, HOOK_OPERATIONS as q, ValidationResult as r, SYSTEM_FIELDS as rt, CrudInput as s, ConfigError as t, MutationOperation as tt, RouteInputOptions as u, collectReadBlockedFields as v, sendControllerResponse as w, createRequestContext as x, isFieldReadable as y, CrudOperation as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
import { P as ArcHeaders, i as RequestScope } from "./types-DnkIALZ8.mjs";
|
|
3
2
|
import { d as UserBase, l as PermissionCheck, t as AnyRecord } from "./base-HXNgPQww.mjs";
|
|
4
|
-
import {
|
|
3
|
+
import { P as ArcHeaders, i as RequestScope } from "./types-DnkIALZ8.mjs";
|
|
4
|
+
import { a as QueryCacheConfig } from "./QueryCache-BE47tmlO.mjs";
|
|
5
5
|
import "./elevation-DPD0hcU-.mjs";
|
|
6
6
|
import "./requirement-CTRQjjQx.mjs";
|
|
7
7
|
import { n as FieldPermissionMap } from "./fields-JTkrtO-r.mjs";
|
|
@@ -399,6 +399,26 @@ interface MutationWriteContext<TDoc = AnyRecord> extends WriteContext<TDoc> {
|
|
|
399
399
|
* against.
|
|
400
400
|
*/
|
|
401
401
|
existing: TDoc;
|
|
402
|
+
/**
|
|
403
|
+
* `update` only, and only when the resource declares `concurrency` and
|
|
404
|
+
* `existing` carries a numeric version: the version this write must apply
|
|
405
|
+
* at. CAS with it so a concurrent write in between fails instead of being
|
|
406
|
+
* overwritten (mongokit:
|
|
407
|
+
* `repo.claimVersion(id, { from: ctx.expectedVersion }, update, session)`;
|
|
408
|
+
* a null result → throw repo-core's `VersionConflictError`).
|
|
409
|
+
*
|
|
410
|
+
* Arc has already rejected a stale `If-Match` with 412 before the verb ran.
|
|
411
|
+
* A `version_conflict` the verb throws answers 412 when the version came
|
|
412
|
+
* from `If-Match`, and 409 otherwise. A conflict whose `id` names a
|
|
413
|
+
* different document (another aggregate the verb CASes) always stays 409.
|
|
414
|
+
*/
|
|
415
|
+
expectedVersion?: number;
|
|
416
|
+
/**
|
|
417
|
+
* Where {@link expectedVersion} came from: `'if-match'` — the client named
|
|
418
|
+
* it and arc verified it against `existing`; `'loaded'` — no `If-Match` (or
|
|
419
|
+
* `*`), so it is the version arc just loaded.
|
|
420
|
+
*/
|
|
421
|
+
expectedVersionSource?: "if-match" | "loaded";
|
|
402
422
|
}
|
|
403
423
|
/**
|
|
404
424
|
* Per-slot write commands. Every field is optional and independent: declare
|
|
@@ -1368,8 +1388,14 @@ declare class BaseCrudController<TDoc = AnyRecord, TRepository extends Repositor
|
|
|
1368
1388
|
* `existing` is the document the request was AUTHORISED against — handed over
|
|
1369
1389
|
* so the verb does not re-fetch and possibly observe a different document.
|
|
1370
1390
|
* `id` is the REPOSITORY PRIMARY KEY (`resolveRepoId` output), never the route param.
|
|
1391
|
+
* `cas` (update only, from {@link expectedVersion}) becomes `expectedVersion` /
|
|
1392
|
+
* `expectedVersionSource` when the resource declares `concurrency` and the loaded
|
|
1393
|
+
* document has a numeric version.
|
|
1371
1394
|
*/
|
|
1372
|
-
protected mutationWriteContext(req: IRequestContext, id: string, existing: unknown, repo?: TRepository, uow?: TransactionHandle
|
|
1395
|
+
protected mutationWriteContext(req: IRequestContext, id: string, existing: unknown, repo?: TRepository, uow?: TransactionHandle, cas?: {
|
|
1396
|
+
version?: number;
|
|
1397
|
+
fromClient: boolean;
|
|
1398
|
+
}): MutationWriteContext;
|
|
1373
1399
|
/**
|
|
1374
1400
|
* Run after-hooks for `op`. No-op without hooks or `resourceName`. `data` is the
|
|
1375
1401
|
* result for create/update, `existing` for delete.
|
|
@@ -2204,6 +2230,32 @@ type PipelineConfig = PipelineStep[] | {
|
|
|
2204
2230
|
delete?: PipelineStep[];
|
|
2205
2231
|
[operation: string]: PipelineStep[] | undefined;
|
|
2206
2232
|
};
|
|
2233
|
+
/**
|
|
2234
|
+
* Declared field types for the aggregation route's URL filter coercion.
|
|
2235
|
+
*
|
|
2236
|
+
* A URL carries every value as a string. Without types the aggregation route guessed from the
|
|
2237
|
+
* value's shape: a range operand that LOOKS like a date (`2026-11-01`) became a `Date`, so a
|
|
2238
|
+
* string field holding civil dates (`civilDate[gte]=2026-11-01`) compared a Date against
|
|
2239
|
+
* strings and matched nothing, while a number field got string operands (`amount[gte]=10`) and
|
|
2240
|
+
* matched nothing either. With a declared type the operand is coerced BY THE FIELD:
|
|
2241
|
+
*
|
|
2242
|
+
* - `string` — kept as sent (never a Date)
|
|
2243
|
+
* - `date` — a `Date` when it parses (else kept, as before)
|
|
2244
|
+
* - `number` — a number when it is a finite numeric string (else kept)
|
|
2245
|
+
* - `boolean` — `true` / `false` from `"true"` / `"false"` (else kept)
|
|
2246
|
+
*
|
|
2247
|
+
* A field with no declared type keeps the legacy behaviour exactly (range operands that look
|
|
2248
|
+
* like ISO dates become Dates; everything else stays a string).
|
|
2249
|
+
*
|
|
2250
|
+
* Sources, most specific first: the aggregation's own `fieldTypes`, then the types derived from
|
|
2251
|
+
* the resource's generated entity schema (`adapter.generateSchemas()`, the same JSON Schema the
|
|
2252
|
+
* OpenAPI document and MCP tools use). Only unambiguous JSON Schema shapes are mapped:
|
|
2253
|
+
* `format: "date-time"` is a date; `format: "date"` is NOT mapped (a Mongo `Date` emitted with
|
|
2254
|
+
* `dateAs: "date"` and a civil-date string column look the same), so it keeps the legacy guess.
|
|
2255
|
+
*/
|
|
2256
|
+
/** The coercion classes a URL filter operand can be cast to. */
|
|
2257
|
+
type AggregationFieldType = "string" | "number" | "boolean" | "date";
|
|
2258
|
+
type AggregationFieldTypes = Readonly<Record<string, AggregationFieldType>>;
|
|
2207
2259
|
/**
|
|
2208
2260
|
* Sugar for measures: `'count'` / `'count:field'` / `'sum:price'` /
|
|
2209
2261
|
* `'avg:rating'` / `'min:created'` / `'max:updated'` /
|
|
@@ -2465,6 +2517,15 @@ interface AggregationConfig {
|
|
|
2465
2517
|
* all-time scans on billion-row collections.
|
|
2466
2518
|
*/
|
|
2467
2519
|
requireDateRange?: AggregationDateRangeRequirement;
|
|
2520
|
+
/**
|
|
2521
|
+
* Declared types of the fields a caller may filter on (`field path → "string" | "number" |
|
|
2522
|
+
* "boolean" | "date"`). URL operands are coerced by the field's type, so a string field holding
|
|
2523
|
+
* `YYYY-MM-DD` civil dates keeps `?civilDate[gte]=2026-11-01` a string instead of a Date that
|
|
2524
|
+
* matches nothing. Merged over the types arc derives from the resource's generated entity
|
|
2525
|
+
* schema (these win). A field in neither keeps the legacy guess (ISO-looking range operands
|
|
2526
|
+
* become Dates).
|
|
2527
|
+
*/
|
|
2528
|
+
fieldTypes?: Readonly<Record<string, AggregationFieldType>>;
|
|
2468
2529
|
/**
|
|
2469
2530
|
* Documented index expectation. Arc warns at boot when the kit
|
|
2470
2531
|
* exposes index introspection and no matching index exists. NOT
|
|
@@ -3096,8 +3157,10 @@ interface ResourceConfig<TDoc = AnyRecord> {
|
|
|
3096
3157
|
transactional?: boolean;
|
|
3097
3158
|
/**
|
|
3098
3159
|
* Optimistic concurrency over HTTP (RFC 9110). Reads send `ETag: "<version>"`; an update
|
|
3099
|
-
* with `If-Match` applies only at that version (else 412), and EVERY update is a CAS
|
|
3100
|
-
* the version it loaded (else 409) — so the version, and the ETag, change on every
|
|
3160
|
+
* with `If-Match` applies only at that version (else 412), and EVERY default update is a CAS
|
|
3161
|
+
* write on the version it loaded (else 409) — so the version, and the ETag, change on every
|
|
3162
|
+
* write. With `writes.update` declared, arc still answers a stale `If-Match` with 412, but the
|
|
3163
|
+
* CAS is the verb's job: it receives `ctx.expectedVersion` (see `MutationWriteContext`).
|
|
3101
3164
|
* `versionField` defaults to `'__v'`. Boot-fatal on a repository without the
|
|
3102
3165
|
* `optimisticConcurrency` capability.
|
|
3103
3166
|
*/
|
|
@@ -4604,4 +4667,4 @@ type InferDocType<T> = T extends DataAdapter<infer D> ? D : T extends ResourceCo
|
|
|
4604
4667
|
*/
|
|
4605
4668
|
type InferAdapterDoc<A> = A extends DataAdapter<infer D> ? D : unknown;
|
|
4606
4669
|
type InferResourceDoc<T> = T extends ResourceConfig<infer D> ? D : never;
|
|
4607
|
-
export { ResourceHookContext as $,
|
|
4670
|
+
export { ResourceHookContext as $, getEntityIdField as $t, RequestWithExtras as A, ControllerConstructionOptions as An, RouteMethod as At, OnTenantDeleteConfig as B, ControllerLike as Bn, SoftDeleteMixin as Bt, RequestIdOptions as C, ArcCreateResult as Cn, ResourceCacheConfig as Ct, FastifyWithAuth as D, ArcUpdateResult as Dn, ActionsMap as Dt, FastifyRequestExtras as E, ArcListResult as En, ActionHandlerFn as Et, ResourceDefinition as F, MutationWriteContext as Fn, AuthenticatorContext as Ft, CrudRouteKey as G, RawRouteHandler as Gn, BulkExt as Gt, PresetFunction as H, IController as Hn, TreeMixin as Ht, CrudController as I, ResourceWrites as In, JwtContext as It, MiddlewareConfig as J, QueryResolver as Jt, CrudSchemas as K, RouteHandler as Kn, BulkMixin as Kt, ResourceConfig as L, WriteContext as Ln, TokenPair as Lt, ResourceRegistry as M, MixinConstructor as Mn, AuthHelpers as Mt, RouteRow as N, BodySanitizer as Nn, AuthPluginOptions as Nt, FastifyWithDecorators as O, BaseControllerOptions as On, RouteDefinition as Ot, defineResource as P, BodySanitizerConfig as Pn, Authenticator as Pt, FieldRule$1 as Q, getEntityId as Qt, ResourceIdempotencyConfig as R, WriteVerbKey as Rn, BaseController as Rt, IntrospectionPluginOptions as S, defineHook as Sn, Transform as St, EventsDecorator as T, ArcGetResult as Tn, ActionEntry as Tt, PresetHook as U, IControllerResponse as Un, SlugExt as Ut, ResolvedTenantPurge as V, FastifyHandler as Vn, TreeExt as Vt, PresetResult as W, IRequestContext as Wn, SlugMixin as Wt, RouteSchemaOptions as X, ActionTargetCheck as Xt, OpenApiSchemas as Y, QueryResolverConfig as Yt, ArcFieldRule as Z, getActionTarget as Zt, ServiceContext as _, afterUpdate as _n, NextFunction as _t, IntrospectionData as a, FetchResult as an, AggregationCacheConfig as at, HealthCheck as b, beforeUpdate as bn, PipelineContext as bt, ResourceMetadata as c, HookContext as cn, AggregationIndexHint as ct, LookupOption as d, HookPhase as dn, AggregationRateLimit as dt, getEntityQuery as en, ResourceHooks as et, OwnershipCheck as f, HookRegistration as fn, AggregationsMap as ft, RequestContext as g, afterDelete as gn, Interceptor as gt, QueryParserInterface as h, afterCreate as hn, Guard as ht, PaginationResult as i, FetchDenialReason as in, AggMeasureShorthand as it, RegisterOptions as j, ListResult as jn, RateLimitConfig as jt, MiddlewareHandler as k, ControllerConfigurableOptions as kn, RouteMcpConfig as kt, ArcInternalMetadata as l, HookHandler as ln, AggregationMaterializedContext as lt, PopulateOption as m, HookSystemOptions as mn, AggregationFieldTypes as mt, InferDocType as n, AccessControlConfig as nn, EventDefinition as nt, RegistryEntry as o, AroundHookHandler as on, AggregationConfig as ot, ParsedQuery as p, HookSystem as pn, AggregationFieldType as pt, LookupPolicy as q, ServerAccessor as qn, BaseCrudController as qt, InferResourceDoc as r, AccessControlRepository as rn, AggMeasureInput as rt, RegistryStats as s, DefineHookOptions as sn, AggregationDateRangeRequirement as st, InferAdapterDoc as t, AccessControl as tn, ResourceExtensions as tt, ControllerQueryOptions as u, HookOperation as un, AggregationMaterializedResult as ut, CrudRouterOptions as v, beforeCreate as vn, OperationFilter as vt, ArcDecorator as w, ArcDeleteResult as wn, ActionDefinition as wt, HealthOptions as x, createHookSystem as xn, PipelineStep as xt, GracefulShutdownOptions as y, beforeDelete as yn, PipelineConfig as yt, ResourcePermissions as z, ControllerHandler as zn, SoftDeleteExt as zt };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { F as ResourceDefinition } from "./index-Cy2-QffW.mjs";
|
|
3
2
|
import { h as ModuleSetupContext, i as ArcModuleRegistry, l as ModuleContribution, n as ArcModule, o as ArcPorts, p as PortName, r as ArcModuleInput, u as ModuleName } from "./types-BeEJm-DV.mjs";
|
|
3
|
+
import { F as ResourceDefinition } from "./index-DLCcLUQT.mjs";
|
|
4
4
|
import { FastifyInstance } from "fastify";
|
|
5
5
|
type ModuleKind = "domain" | "bridge" | "platform" | "aggregator";
|
|
6
6
|
/** How strictly the event graph is checked at boot. */
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
import { Mt as Authenticator } from "./index-Cy2-QffW.mjs";
|
|
3
|
-
import { r as CacheStore } from "./interface-WR1U0K7t.mjs";
|
|
4
|
-
import { n as ElevationOptions } from "./elevation-DPD0hcU-.mjs";
|
|
5
|
-
import { a as EventTransport } from "./EventTransport-CYEoCJGe.mjs";
|
|
6
|
-
import { t as ExternalOpenApiPaths } from "./externalPaths-BOqdq5wr.mjs";
|
|
7
|
-
import { r as QueryCachePluginOptions } from "./queryCachePlugin-DYQUyeJ9.mjs";
|
|
8
|
-
import { t as ErrorHandlerOptions } from "./errorHandler-B9r88jZV.mjs";
|
|
9
2
|
import { I as HealthOptions, _ as ResourceLike, o as ArcPorts, r as ArcModuleInput, w as SchedulesPluginOptions } from "./types-BeEJm-DV.mjs";
|
|
10
|
-
import {
|
|
3
|
+
import { a as MetricsOptions, c as RealtimeOptions, f as CachingOptions, h as GracefulShutdownOptions, t as VersioningOptions, u as SSEOptions } from "./versioning-B07RgD27.mjs";
|
|
11
4
|
import { t as EventPluginOptions } from "./eventPlugin-BY38F6yK.mjs";
|
|
12
|
-
import {
|
|
5
|
+
import { r as QueryCachePluginOptions } from "./queryCachePlugin-DrQNnGws.mjs";
|
|
6
|
+
import { t as ErrorHandlerOptions } from "./errorHandler-B9r88jZV.mjs";
|
|
7
|
+
import { H as ModuleGraphOptions } from "./index-DexdFs1a.mjs";
|
|
8
|
+
import { r as CacheStore } from "./interface-WR1U0K7t.mjs";
|
|
9
|
+
import { a as EventTransport } from "./EventTransport-CYEoCJGe.mjs";
|
|
13
10
|
import { i as IdempotencyStore } from "./interface-BmExzQRD.mjs";
|
|
11
|
+
import { n as ElevationOptions } from "./elevation-DPD0hcU-.mjs";
|
|
12
|
+
import { t as ExternalOpenApiPaths } from "./externalPaths-BOqdq5wr.mjs";
|
|
13
|
+
import { Pt as Authenticator } from "./index-DLCcLUQT.mjs";
|
|
14
14
|
import { FastifyInstance, FastifyPluginAsync, FastifyReply, FastifyRequest, FastifyServerOptions } from "fastify";
|
|
15
|
+
import { ServerOptions } from "node:http";
|
|
15
16
|
/**
|
|
16
17
|
* How other origins may EMBED these bytes — the value of
|
|
17
18
|
* `Cross-Origin-Resource-Policy` for this prefix.
|
|
@@ -374,6 +375,28 @@ type RateLimitOpts = Record<string, unknown> & {
|
|
|
374
375
|
* `createTenantKeyGenerator`'s IP fallback (documented there).
|
|
375
376
|
*/
|
|
376
377
|
plan?: RateLimitPlanConfig;
|
|
378
|
+
/**
|
|
379
|
+
* What happens when the SHARED store (`redis` / `store`) is unavailable.
|
|
380
|
+
* Default (on whenever a shared store is configured): every store call is
|
|
381
|
+
* bounded by `timeoutMs` (250), and an error or timeout is answered from an
|
|
382
|
+
* in-process fixed-window counter, so requests neither hang nor fail and
|
|
383
|
+
* still have a limit (per instance while degraded). One warning per outage,
|
|
384
|
+
* the shared store is probed every `retryAfterMs` (5000) and resumes on its
|
|
385
|
+
* first answer; `onStatus` reports each switch (for a health or metrics
|
|
386
|
+
* signal). `false` = `@fastify/rate-limit`'s own behaviour (`skipOnError`).
|
|
387
|
+
*/
|
|
388
|
+
storeFallback?: false | {
|
|
389
|
+
timeoutMs?: number;
|
|
390
|
+
retryAfterMs?: number;
|
|
391
|
+
/** Most live keys per fallback counter; the oldest is dropped beyond it. Default 10000. */
|
|
392
|
+
capacity?: number;
|
|
393
|
+
onStatus?: (status: {
|
|
394
|
+
readonly mode: "shared" | "fallback";
|
|
395
|
+
readonly since: Date;
|
|
396
|
+
readonly outages: number;
|
|
397
|
+
readonly lastError?: string;
|
|
398
|
+
}) => void;
|
|
399
|
+
};
|
|
377
400
|
};
|
|
378
401
|
/** Plan-aware rate limiting (2.22) — see `rateLimit.plan` on CreateAppOptions. */
|
|
379
402
|
interface RateLimitPlanConfig {
|
|
@@ -404,6 +427,8 @@ type BootDisposer = () => void | Promise<void>;
|
|
|
404
427
|
* });
|
|
405
428
|
* ```
|
|
406
429
|
*/
|
|
430
|
+
/** The Node HTTP server options {@link CreateAppOptions.http} passes through. */
|
|
431
|
+
type CreateAppHttpOptions = Pick<ServerOptions, "highWaterMark" | "maxHeaderSize" | "requireHostHeader" | "joinDuplicateHeaders" | "noDelay" | "keepAlive" | "keepAliveInitialDelay">;
|
|
407
432
|
interface CreateAppOptions {
|
|
408
433
|
/** Environment preset: 'production', 'development', 'testing', 'edge', or 'worker' */
|
|
409
434
|
preset?: "production" | "development" | "testing" | "edge" | "worker";
|
|
@@ -542,6 +567,22 @@ interface CreateAppOptions {
|
|
|
542
567
|
* the server just closed — intermittent 502s.
|
|
543
568
|
*/
|
|
544
569
|
keepAliveTimeout?: number;
|
|
570
|
+
/**
|
|
571
|
+
* Node HTTP server options, passed through as Fastify `http`
|
|
572
|
+
* (`http.createServer(options, handler)`). Pass-through only — no arc
|
|
573
|
+
* defaults. Limited to the per-socket and parser knobs that do not overlap
|
|
574
|
+
* the timeout options above:
|
|
575
|
+
*
|
|
576
|
+
* - `highWaterMark` (Node 20.1+): the write buffer every accepted socket gets
|
|
577
|
+
* before `write()` reports it full (Node default 16 KiB). SSE streams wait
|
|
578
|
+
* for `drain` within their own byte budget either way; a larger mark only
|
|
579
|
+
* means fewer drain round trips for a big replay.
|
|
580
|
+
* - `maxHeaderSize`, `requireHostHeader`, `joinDuplicateHeaders`, `noDelay`,
|
|
581
|
+
* `keepAlive`, `keepAliveInitialDelay`: as documented for `http.createServer`.
|
|
582
|
+
*
|
|
583
|
+
* Ignored by an `https` / `http2` server built outside arc.
|
|
584
|
+
*/
|
|
585
|
+
http?: CreateAppHttpOptions;
|
|
545
586
|
/**
|
|
546
587
|
* Max JSON body in bytes. Fastify default 1 MiB; over it is a 413
|
|
547
588
|
* (`FST_ERR_CTP_BODY_TOO_LARGE`) raised BEFORE any handler runs.
|
|
@@ -754,6 +795,15 @@ interface CreateAppOptions {
|
|
|
754
795
|
*/
|
|
755
796
|
ajv?: {
|
|
756
797
|
keywords?: string[];
|
|
798
|
+
/**
|
|
799
|
+
* Type-coerce JSON BODY values to their schema type (`"5"` → `5`). Default `false`.
|
|
800
|
+
*
|
|
801
|
+
* Querystring, params and headers always coerce (URL values are strings). A JSON body is
|
|
802
|
+
* already typed, and coercing it picks the FIRST `anyOf` branch: `{ value: false }` against
|
|
803
|
+
* `anyOf [number, boolean, string]` became `0`. Set `true` only for clients that send
|
|
804
|
+
* numbers/booleans as strings in a JSON or urlencoded body (migration escape hatch).
|
|
805
|
+
*/
|
|
806
|
+
coerceBody?: boolean;
|
|
757
807
|
};
|
|
758
808
|
/**
|
|
759
809
|
* Enable `reply.sendList()` + `reply.stream()` response decorators.
|
|
@@ -999,4 +1049,4 @@ interface CreateAppOptions {
|
|
|
999
1049
|
/** Hook called when the app is shutting down */
|
|
1000
1050
|
onClose?: (fastify: FastifyInstance) => void | Promise<void>;
|
|
1001
1051
|
}
|
|
1002
|
-
export {
|
|
1052
|
+
export { RawBodyOptions as a, BetterAuthOption as c, JwtAuthOption as d, MultipartOptions as i, CustomAuthenticatorOption as l, CreateAppHttpOptions as n, UnderPressureOptions as o, CreateAppOptions as r, AuthOption as s, BootDisposer as t, CustomPluginAuthOption as u };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
import { c as DataPolicy, d as UserBase, l as PermissionCheck, n as ArcRequest, o as UserOrganization, r as JWTPayload, s as AuthorizationDecision, t as AnyRecord, u as PermissionContext } from "./base-HXNgPQww.mjs";
|
|
3
|
-
import
|
|
3
|
+
import "./fastify-augmentation-baQc3MaO.mjs";
|
|
4
4
|
import { a as applyFieldReadPermissions, n as FieldPermissionMap, o as applyFieldWritePermissions, s as fields, t as FieldPermission } from "./fields-JTkrtO-r.mjs";
|
|
5
|
-
import "./
|
|
6
|
-
import {
|
|
7
|
-
import { C as requireScopeContext, G as createDynamicPermissionMatrix, H as DynamicPermissionMatrix, J as PublicPolicy, K as createOrgPermissions, Q as anyOf, S as requireOrgRole, T as requireTeamMembership, U as DynamicPermissionMatrixConfig, Y as allOf, Z as allowPublic, _ as publicRead, at as requireRoles, b as requireOrgInScope, d as adminOnly, et as denyAll, f as authenticated, g as presets_d_exports, m as ownerWithAdminBypass, nt as requireAuth, p as fullPublic, q as AllowPublicOptions, rt as requireOwnership, st as when, v as publicReadAdminWrite, w as requireServiceScope, x as requireOrgMembership, y as readOnly } from "./index-
|
|
5
|
+
import { $ as MAX_SEARCH_LENGTH, A as ResourceSeams, B as DEFAULT_ID_FIELD, C as getControllerScope, G as DEFAULT_UPDATE_METHOD, H as DEFAULT_MAX_LIMIT, J as HOOK_PHASES, L as defineAggregation, M as mergeResourceConfig, O as defineResourceVariants, P as defineAction, Q as MAX_REGEX_LENGTH, R as CRUD_OPERATIONS, U as DEFAULT_SORT, V as DEFAULT_LIMIT, W as DEFAULT_TENANT_FIELD, X as HookPhase, Y as HookOperation, Z as MAX_FILTER_DEPTH, _ as nativePolicyFilter, et as MUTATION_OPERATIONS, g as NativePolicyFilter, j as SeamedResourceConfig, k as AdapterLike, nt as RESERVED_QUERY_PARAMS, q as HOOK_OPERATIONS, rt as SYSTEM_FIELDS, tt as MutationOperation, z as CrudOperation } from "./index-DKM2p5w5.mjs";
|
|
6
|
+
import { A as RequestWithExtras, An as ControllerConstructionOptions, Bn as ControllerLike, Bt as SoftDeleteMixin, C as RequestIdOptions, Cn as ArcCreateResult, D as FastifyWithAuth, Dn as ArcUpdateResult, E as FastifyRequestExtras, En as ArcListResult, F as ResourceDefinition, Fn as MutationWriteContext, G as CrudRouteKey, Gn as RawRouteHandler, Gt as BulkExt, H as PresetFunction, Hn as IController, Ht as TreeMixin, I as CrudController, In as ResourceWrites, J as MiddlewareConfig, K as CrudSchemas, Kn as RouteHandler, Kt as BulkMixin, L as ResourceConfig, Ln as WriteContext, Nt as AuthPluginOptions, O as FastifyWithDecorators, On as BaseControllerOptions, P as defineResource, Q as FieldRule, Rn as WriteVerbKey, Rt as BaseController, S as IntrospectionPluginOptions, Tn as ArcGetResult, Un as IControllerResponse, Ut as SlugExt, Vt as TreeExt, W as PresetResult, Wn as IRequestContext, Wt as SlugMixin, X as RouteSchemaOptions, _ as ServiceContext, a as IntrospectionData, at as AggregationCacheConfig, b as HealthCheck, c as ResourceMetadata, ct as AggregationIndexHint, dt as AggregationRateLimit, f as OwnershipCheck, ft as AggregationsMap, g as RequestContext, h as QueryParserInterface, i as PaginationResult, it as AggMeasureShorthand, jn as ListResult, jt as RateLimitConfig, kn as ControllerConfigurableOptions, l as ArcInternalMetadata, lt as AggregationMaterializedContext, n as InferDocType, nt as EventDefinition, o as RegistryEntry, ot as AggregationConfig, qt as BaseCrudController, r as InferResourceDoc, rt as AggMeasureInput, s as RegistryStats, st as AggregationDateRangeRequirement, t as InferAdapterDoc, ut as AggregationMaterializedResult, v as CrudRouterOptions, wn as ArcDeleteResult, x as HealthOptions, y as GracefulShutdownOptions, zt as SoftDeleteExt } from "./index-DLCcLUQT.mjs";
|
|
7
|
+
import { C as requireScopeContext, G as createDynamicPermissionMatrix, H as DynamicPermissionMatrix, J as PublicPolicy, K as createOrgPermissions, Q as anyOf, S as requireOrgRole, T as requireTeamMembership, U as DynamicPermissionMatrixConfig, Y as allOf, Z as allowPublic, _ as publicRead, at as requireRoles, b as requireOrgInScope, d as adminOnly, et as denyAll, f as authenticated, g as presets_d_exports, m as ownerWithAdminBypass, nt as requireAuth, p as fullPublic, q as AllowPublicOptions, rt as requireOwnership, st as when, v as publicReadAdminWrite, w as requireServiceScope, x as requireOrgMembership, y as readOnly } from "./index-CMNpMBtW.mjs";
|
|
8
8
|
import { a as NotFoundError, d as ValidationError, f as createDomainError, i as ForbiddenError, t as ArcError, u as UnauthorizedError } from "./errors-DTo0me1o.mjs";
|
|
9
9
|
export declare const version: string;
|
|
10
10
|
export { type AdapterLike, type AggMeasureInput, type AggMeasureShorthand, type AggregationCacheConfig, type AggregationConfig, type AggregationDateRangeRequirement, type AggregationIndexHint, type AggregationMaterializedContext, type AggregationMaterializedResult, type AggregationRateLimit, type AggregationsMap, type AllowPublicOptions, type AnyRecord, type ArcCreateResult, type ArcDeleteResult, ArcError, type ArcGetResult, type ArcInternalMetadata, type ArcListResult, type ArcRequest, type ArcUpdateResult, type AuthPluginOptions, type AuthorizationDecision, BaseController, type BaseControllerOptions, BaseCrudController, type BulkExt, BulkMixin, CRUD_OPERATIONS, type ControllerConfigurableOptions, type ControllerConstructionOptions, type ControllerLike, type CrudController, type CrudOperation, type CrudRouteKey, type CrudRouterOptions, type CrudSchemas, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, type DataPolicy, type DynamicPermissionMatrix, type DynamicPermissionMatrixConfig, type EventDefinition, type FastifyRequestExtras, type FastifyWithAuth, type FastifyWithDecorators, type FieldPermission, type FieldPermissionMap, type FieldRule, ForbiddenError, type GracefulShutdownOptions, HOOK_OPERATIONS, HOOK_PHASES, type HealthCheck, type HealthOptions, type HookOperation, type HookPhase, type IController, type IControllerResponse, type IRequestContext, type InferAdapterDoc, type InferDocType, type InferResourceDoc, type IntrospectionData, type IntrospectionPluginOptions, type JWTPayload, type ListResult, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, type MiddlewareConfig, type MutationOperation, type MutationWriteContext, type NativePolicyFilter, NotFoundError, type OwnershipCheck, type PaginationResult, type PermissionCheck, type PermissionContext, type PresetFunction, type PresetResult, type PublicPolicy, type QueryParserInterface, RESERVED_QUERY_PARAMS, type RateLimitConfig, type RawRouteHandler, type RegistryEntry, type RegistryStats, type RequestContext, type RequestIdOptions, type RequestWithExtras, type ResourceConfig, ResourceDefinition, type ResourceMetadata, type ResourceSeams, type ResourceWrites, type RouteHandler, type RouteSchemaOptions, SYSTEM_FIELDS, type SeamedResourceConfig, type ServiceContext, type SlugExt, SlugMixin, type SoftDeleteExt, SoftDeleteMixin, type TreeExt, TreeMixin, UnauthorizedError, type UserBase, type UserOrganization, ValidationError, type WriteContext, type WriteVerbKey, adminOnly, allOf, allowPublic, anyOf, applyFieldReadPermissions, applyFieldWritePermissions, authenticated, createDomainError, createDynamicPermissionMatrix, createOrgPermissions, defineAction, defineAggregation, defineResource, defineResourceVariants, denyAll, fields, fullPublic, getControllerScope, mergeResourceConfig, nativePolicyFilter, ownerWithAdminBypass, presets_d_exports as permissions, publicRead, publicReadAdminWrite, readOnly, requireAuth, requireOrgInScope, requireOrgMembership, requireOrgRole, requireOwnership, requireRoles, requireScopeContext, requireServiceScope, requireTeamMembership, when };
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { a as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
/*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
|
|
2
|
+
import { E as nativePolicyFilter, _ as BaseCrudController, f as BaseController, g as BulkMixin, h as SlugMixin, m as SoftDeleteMixin, p as TreeMixin } from "./plugin-DsLr6L4O.mjs";
|
|
3
|
+
import { a as defineResourceVariants, o as mergeResourceConfig, s as defineAction } from "./core-DWA1-5IE.mjs";
|
|
4
|
+
import { t as defineAggregation } from "./defineAggregation-BskqRz8M.mjs";
|
|
5
|
+
import { a as ResourceDefinition, t as defineResource } from "./defineResource-B2vTvKzW.mjs";
|
|
6
|
+
import { E as getControllerScope } from "./schemaIR-wOffQlbq.mjs";
|
|
7
|
+
import { a as DEFAULT_SORT, d as MAX_FILTER_DEPTH, f as MAX_REGEX_LENGTH, g as SYSTEM_FIELDS, h as RESERVED_QUERY_PARAMS, i as DEFAULT_MAX_LIMIT, l as HOOK_OPERATIONS, m as MUTATION_OPERATIONS, n as DEFAULT_ID_FIELD, o as DEFAULT_TENANT_FIELD, p as MAX_SEARCH_LENGTH, r as DEFAULT_LIMIT, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS, u as HOOK_PHASES } from "./constants-BZFsZwJh.mjs";
|
|
8
|
+
import { B as requireAuth, C as createOrgPermissions, D as requireScopeContext, E as requireOrgRole, F as allowPublic, G as when, I as anyOf, N as allOf, O as requireServiceScope, R as denyAll, S as createDynamicPermissionMatrix, T as requireOrgMembership, U as requireRoles, V as requireOwnership, a as adminOnly, c as ownerWithAdminBypass, d as publicRead, f as publicReadAdminWrite, k as requireTeamMembership, o as authenticated, p as readOnly, s as fullPublic, u as presets_exports, w as requireOrgInScope } from "./permissions-BJylQopQ.mjs";
|
|
9
|
+
import { i as fields, n as applyFieldWritePermissions, t as applyFieldReadPermissions } from "./fields-DLFcJiDe.mjs";
|
|
10
|
+
import { d as createDomainError, i as NotFoundError, l as UnauthorizedError, r as ForbiddenError, t as ArcError, u as ValidationError } from "./errors-3xaK0i9n.mjs";
|
|
11
11
|
// src/index.ts
|
|
12
|
-
const version = "2.
|
|
12
|
+
const version = "2.50.0";
|
|
13
13
|
export { ArcError, BaseController, BaseCrudController, BulkMixin, CRUD_OPERATIONS, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, ForbiddenError, HOOK_OPERATIONS, HOOK_PHASES, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, NotFoundError, RESERVED_QUERY_PARAMS, ResourceDefinition, SYSTEM_FIELDS, SlugMixin, SoftDeleteMixin, TreeMixin, UnauthorizedError, ValidationError, adminOnly, allOf, allowPublic, anyOf, applyFieldReadPermissions, applyFieldWritePermissions, authenticated, createDomainError, createDynamicPermissionMatrix, createOrgPermissions, defineAction, defineAggregation, defineResource, defineResourceVariants, denyAll, fields, fullPublic, getControllerScope, mergeResourceConfig, nativePolicyFilter, ownerWithAdminBypass, presets_exports as permissions, publicRead, publicReadAdminWrite, readOnly, requireAuth, requireOrgInScope, requireOrgMembership, requireOrgRole, requireOwnership, requireRoles, requireScopeContext, requireServiceScope, requireTeamMembership, version, when };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
|
|
2
2
|
import fp from "fastify-plugin";
|
|
3
3
|
// src/integrations/event-gateway.ts
|
|
4
4
|
const eventGatewayPluginImpl = async (fastify, opts = {}) => {
|
|
5
5
|
const { auth = true, orgScoped, roomPolicy, maxMessageBytes, maxSubscriptionsPerClient, authenticate } = opts;
|
|
6
6
|
if (auth && !authenticate && !fastify.hasDecorator("authenticate")) throw new Error("[arc-event-gateway] auth is true but fastify.authenticate is not registered. Register an auth plugin first, provide a custom authenticate function, or set auth: false.");
|
|
7
7
|
if (opts.sse !== false) {
|
|
8
|
-
const { default: ssePlugin } = await import("../sse-
|
|
8
|
+
const { default: ssePlugin } = await import("../sse-OEuPpgss.mjs").then((n) => n.n);
|
|
9
9
|
await fastify.register(ssePlugin, {
|
|
10
10
|
path: opts.sse?.path ?? "/events/stream",
|
|
11
11
|
requireAuth: auth,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import { c as WebSocketClient, l as WebSocketMessage, u as WebSocketPluginOptions } from "../websocket-BGuc-WVZ.mjs";
|
|
3
2
|
import { EventGatewayOptions } from "./event-gateway.mjs";
|
|
4
3
|
import { a as JobMeta, c as JobsPluginOptions, i as JobDispatcher, l as QueueStats, n as JobDefinition, r as JobDispatchOptions } from "../index-BAXDo5eE.mjs";
|
|
5
|
-
import { _ as ToolDefinition, c as McpAuthResult, d as McpResourceConfig, g as ToolContext, h as ToolAnnotations, n as CallToolResult, o as CrudOperation, p as PromptDefinition, r as CreateMcpServerConfig, t as BetterAuthHandler, u as McpPluginOptions } from "../types-
|
|
4
|
+
import { _ as ToolDefinition, c as McpAuthResult, d as McpResourceConfig, g as ToolContext, h as ToolAnnotations, n as CallToolResult, o as CrudOperation, p as PromptDefinition, r as CreateMcpServerConfig, t as BetterAuthHandler, u as McpPluginOptions } from "../types-B4E0sc6D.mjs";
|
|
6
5
|
import { StreamlinePluginOptions, WorkflowLike, WorkflowRunLike } from "./streamline.mjs";
|
|
7
6
|
import { WebhookDeliveryRecord, WebhookManager, WebhookPluginOptions, WebhookStore, WebhookSubscription } from "./webhooks.mjs";
|
|
7
|
+
import { c as WebSocketClient, l as WebSocketMessage, u as WebSocketPluginOptions } from "../websocket-BGuc-WVZ.mjs";
|
|
8
8
|
export type { BetterAuthHandler, CallToolResult, CreateMcpServerConfig, CrudOperation, EventGatewayOptions, JobDefinition, JobDispatchOptions, JobDispatcher, JobMeta, JobsPluginOptions, McpAuthResult, McpPluginOptions, McpResourceConfig, PromptDefinition, QueueStats, StreamlinePluginOptions, ToolAnnotations, ToolContext, ToolDefinition, WebSocketClient, WebSocketMessage, WebSocketPluginOptions, WebhookDeliveryRecord, WebhookManager, WebhookPluginOptions, WebhookStore, WebhookSubscription, WorkflowLike, WorkflowRunLike };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
|
|
2
2
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { n as evaluateAndApplyPermission } from "../../authorizationDecision-
|
|
3
|
-
import { i as runAdmittedWork, r as registerShutdownParticipant } from "../../shutdown-
|
|
1
|
+
/*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as evaluateAndApplyPermission } from "../../authorizationDecision-BD8K4jdQ.mjs";
|
|
3
|
+
import { i as runAdmittedWork, r as registerShutdownParticipant } from "../../shutdown-BIR-QBYM.mjs";
|
|
4
4
|
import fp from "fastify-plugin";
|
|
5
5
|
// src/integrations/jobs/execution.ts
|
|
6
6
|
async function executeTimedHandler(options) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
import { _ as ToolDefinition, a as CrudDescriptionOverride, c as McpAuthResult, d as McpResourceConfig, f as McpToolLogger, g as ToolContext, h as ToolAnnotations, i as CrudDescriptionMeta, l as McpExecutionWiring, m as PromptResult, n as CallToolResult, o as CrudOperation, p as PromptDefinition, r as CreateMcpServerConfig, s as McpAuthResolver, t as BetterAuthHandler, u as McpPluginOptions, v as ToolInputSchema } from "../../types-B4E0sc6D.mjs";
|
|
2
3
|
import { i as RequestScope } from "../../types-DnkIALZ8.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
4
|
+
import { F as ResourceDefinition, Un as IControllerResponse, Wn as IRequestContext, qn as ServerAccessor } from "../../index-DLCcLUQT.mjs";
|
|
5
|
+
import { i as resolveToolCollisions, n as McpServerInstance, r as createMcpServer, t as AuthRef } from "../../createMcpServer-CS2KOVP6.mjs";
|
|
6
|
+
import "../../resourceRateLimit-BPiESPtG.mjs";
|
|
5
7
|
import { n as FieldPermissionMap } from "../../fields-JTkrtO-r.mjs";
|
|
6
|
-
import "../../
|
|
7
|
-
import { _ as ToolDefinition, a as CrudDescriptionOverride, c as McpAuthResult, d as McpResourceConfig, f as McpToolLogger, g as ToolContext, h as ToolAnnotations, i as CrudDescriptionMeta, l as McpExecutionWiring, m as PromptResult, n as CallToolResult, o as CrudOperation, p as PromptDefinition, r as CreateMcpServerConfig, s as McpAuthResolver, t as BetterAuthHandler, u as McpPluginOptions, v as ToolInputSchema } from "../../types-DduBiYaI.mjs";
|
|
8
|
-
import { i as resolveToolCollisions, n as McpServerInstance, r as createMcpServer, t as AuthRef } from "../../createMcpServer-hSFeqRUb.mjs";
|
|
8
|
+
import { l as PermissionCheck } from "../../base-HXNgPQww.mjs";
|
|
9
9
|
import { ErrorContract } from "@classytic/repo-core/errors";
|
|
10
10
|
import { FastifyPluginAsync } from "fastify";
|
|
11
11
|
import { z } from "zod";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { _ as createMcpServer, a as isZodTypeSchema, c as defaultCrudDescription, d as mcpHandlerAdapter, f as permissionDeniedResult, g as buildRequestContext, h as toCallToolSuccess, i as resourceToTools, l as resolveCrudDescription, m as toCallToolResult, n as filterResourcesForMcp, o as toolInputShape, p as toCallToolError, r as mcpPlugin, s as fieldRulesToZod, u as invokeController, v as resolveToolCollisions } from "../../mcpPlugin-
|
|
1
|
+
/*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
|
|
2
|
+
import { _ as createMcpServer, a as isZodTypeSchema, c as defaultCrudDescription, d as mcpHandlerAdapter, f as permissionDeniedResult, g as buildRequestContext, h as toCallToolSuccess, i as resourceToTools, l as resolveCrudDescription, m as toCallToolResult, n as filterResourcesForMcp, o as toolInputShape, p as toCallToolError, r as mcpPlugin, s as fieldRulesToZod, u as invokeController, v as resolveToolCollisions } from "../../mcpPlugin-C6-wFsOX.mjs";
|
|
3
3
|
// src/integrations/mcp/defineTool.ts
|
|
4
4
|
/**
|
|
5
5
|
* Define a type-safe MCP tool.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { n as McpServerInstance } from "../../createMcpServer-CS2KOVP6.mjs";
|
|
3
|
+
import { c as McpAuthResult, u as McpPluginOptions } from "../../types-B4E0sc6D.mjs";
|
|
4
4
|
import { Client } from "@modelcontextprotocol/client";
|
|
5
5
|
/** An MCP client bound to a server, plus its teardown. */
|
|
6
6
|
export interface ConnectedMcpTestClient {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { _ as createMcpServer, i as resourceToTools, n as filterResourcesForMcp, t as MCP_PROTOCOL_VERSION } from "../../mcpPlugin-
|
|
1
|
+
/*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
|
|
2
|
+
import { _ as createMcpServer, i as resourceToTools, n as filterResourcesForMcp, t as MCP_PROTOCOL_VERSION } from "../../mcpPlugin-C6-wFsOX.mjs";
|
|
3
3
|
// src/integrations/mcp/testing.ts
|
|
4
4
|
/**
|
|
5
5
|
* Connect a 2026-07-28 client to an already-built `McpServer`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { f as createError, i as NotFoundError, r as ForbiddenError } from "../errors-
|
|
3
|
-
import { a as promoteStreamTokenToHeader, n as forwardedStreamHeaders } from "../streaming-
|
|
1
|
+
/*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
|
|
2
|
+
import { f as createError, i as NotFoundError, r as ForbiddenError } from "../errors-3xaK0i9n.mjs";
|
|
3
|
+
import { a as promoteStreamTokenToHeader, n as forwardedStreamHeaders } from "../streaming-CcIpcx02.mjs";
|
|
4
4
|
import { ARC_ERROR_CODES } from "@classytic/repo-core/errors";
|
|
5
5
|
import fp from "fastify-plugin";
|
|
6
6
|
// src/integrations/streamline.ts
|