@classytic/arc 2.8.5 → 2.9.1

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.
Files changed (140) hide show
  1. package/README.md +88 -5
  2. package/dist/{BaseController-DAGGc5Xn.mjs → BaseController-Vu2yc56T.mjs} +188 -102
  3. package/dist/EventTransport-CqZ8FyM_.d.mts +293 -0
  4. package/dist/adapters/index.d.mts +2 -2
  5. package/dist/audit/index.d.mts +100 -11
  6. package/dist/audit/index.mjs +71 -18
  7. package/dist/auth/index.d.mts +16 -8
  8. package/dist/auth/index.mjs +13 -6
  9. package/dist/auth/redis-session.d.mts +1 -1
  10. package/dist/{betterAuthOpenApi-BuUcUEJq.mjs → betterAuthOpenApi--rdY15Ld.mjs} +1 -1
  11. package/dist/cache/index.d.mts +2 -2
  12. package/dist/cache/index.mjs +2 -2
  13. package/dist/cli/commands/docs.mjs +2 -2
  14. package/dist/cli/commands/introspect.mjs +1 -1
  15. package/dist/core/index.d.mts +3 -3
  16. package/dist/core/index.mjs +4 -5
  17. package/dist/{core-F0QoWBt2.mjs → core-DNncu0xF.mjs} +1 -1
  18. package/dist/{createActionRouter-BORM8f17.mjs → createActionRouter-DH1YFL9m.mjs} +3 -3
  19. package/dist/{createApp-B1EY8zxa.mjs → createApp-CBJUJKGP.mjs} +13 -12
  20. package/dist/{defineResource-tcgySDo1.mjs → defineResource-C__jkwvs.mjs} +22 -57
  21. package/dist/docs/index.d.mts +2 -2
  22. package/dist/docs/index.mjs +1 -1
  23. package/dist/dynamic/index.d.mts +1 -1
  24. package/dist/dynamic/index.mjs +3 -3
  25. package/dist/{elevation-DtFxrG0s.mjs → elevation-DxQ6ACbt.mjs} +21 -7
  26. package/dist/{errorHandler-f869_8PQ.mjs → errorHandler-CZDW4EXS.mjs} +59 -7
  27. package/dist/{errorHandler-Bah5JhBd.d.mts → errorHandler-DixGcttC.d.mts} +37 -2
  28. package/dist/{eventPlugin-D9DKB2zM.d.mts → eventPlugin-BxvaCIZF.d.mts} +14 -2
  29. package/dist/{eventPlugin-CDjVTM82.mjs → eventPlugin-Dl7MoVWH.mjs} +83 -5
  30. package/dist/events/index.d.mts +147 -36
  31. package/dist/events/index.mjs +338 -101
  32. package/dist/events/transports/redis-stream-entry.d.mts +1 -1
  33. package/dist/events/transports/redis.d.mts +1 -1
  34. package/dist/factory/index.d.mts +1 -1
  35. package/dist/factory/index.mjs +2 -2
  36. package/dist/{fields-DpZQa_Q3.d.mts → fields-BC7zcmI9.d.mts} +15 -3
  37. package/dist/{fields-ipsbIRPK.mjs → fields-CU6FlaDV.mjs} +18 -5
  38. package/dist/{filesUpload-C7r7HIeA.mjs → filesUpload-q8oHt--L.mjs} +65 -7
  39. package/dist/hooks/index.d.mts +1 -1
  40. package/dist/hooks/index.mjs +1 -1
  41. package/dist/idempotency/index.d.mts +29 -5
  42. package/dist/idempotency/index.mjs +111 -2
  43. package/dist/idempotency/redis.d.mts +1 -1
  44. package/dist/{index-BLXBmWud.d.mts → index-C-xjcA6F.d.mts} +1 -1
  45. package/dist/{index-DtDzOBn8.d.mts → index-Cibkchnx.d.mts} +3 -134
  46. package/dist/{index-C1meYuDn.d.mts → index-CtGKT0lf.d.mts} +1 -1
  47. package/dist/index.d.mts +7 -7
  48. package/dist/index.mjs +9 -9
  49. package/dist/integrations/event-gateway.d.mts +1 -1
  50. package/dist/integrations/event-gateway.mjs +1 -1
  51. package/dist/integrations/index.d.mts +1 -1
  52. package/dist/integrations/mcp/index.d.mts +26 -8
  53. package/dist/integrations/mcp/index.mjs +96 -17
  54. package/dist/integrations/mcp/testing.d.mts +1 -1
  55. package/dist/integrations/mcp/testing.mjs +1 -1
  56. package/dist/integrations/webhooks.d.mts +5 -0
  57. package/dist/integrations/webhooks.mjs +6 -0
  58. package/dist/{interface-CMRutPfe.d.mts → interface-YrWsmKqE.d.mts} +287 -179
  59. package/dist/{openapi-CbKUJY_m.mjs → openapi-CXuTG1M9.mjs} +2 -2
  60. package/dist/org/index.d.mts +1 -1
  61. package/dist/permissions/index.d.mts +2 -2
  62. package/dist/permissions/index.mjs +3 -3
  63. package/dist/{permissions-CH4cNwJi.mjs → permissions-oNZawnkR.mjs} +1 -1
  64. package/dist/plugins/index.d.mts +7 -7
  65. package/dist/plugins/index.mjs +11 -11
  66. package/dist/plugins/response-cache.mjs +1 -1
  67. package/dist/plugins/tracing-entry.d.mts +1 -1
  68. package/dist/plugins/tracing-entry.mjs +1 -1
  69. package/dist/policies/index.d.mts +25 -32
  70. package/dist/presets/filesUpload.d.mts +26 -4
  71. package/dist/presets/filesUpload.mjs +1 -1
  72. package/dist/presets/index.d.mts +3 -2
  73. package/dist/presets/index.mjs +4 -3
  74. package/dist/presets/multiTenant.d.mts +1 -1
  75. package/dist/presets/multiTenant.mjs +1 -1
  76. package/dist/presets/search.d.mts +91 -0
  77. package/dist/presets/search.mjs +150 -0
  78. package/dist/{presets-C2xgzW6x.mjs → presets-hM4WhNWY.mjs} +1 -1
  79. package/dist/{queryCachePlugin-BJJGBTlu.d.mts → queryCachePlugin-CnTZZTC5.d.mts} +1 -1
  80. package/dist/{queryCachePlugin-BH-fidlv.mjs → queryCachePlugin-DbUVroUG.mjs} +2 -2
  81. package/dist/{redis-BM00zaPB.d.mts → redis-MXLp1oOf.d.mts} +1 -1
  82. package/dist/{redis-stream-CrsfUmPt.d.mts → redis-stream-Bz-4q96t.d.mts} +1 -1
  83. package/dist/registry/index.d.mts +1 -1
  84. package/dist/registry/index.mjs +2 -2
  85. package/dist/{resourceToTools-8s-EsCCe.mjs → resourceToTools-C3cWymnW.mjs} +64 -47
  86. package/dist/rpc/index.d.mts +1 -1
  87. package/dist/rpc/index.mjs +1 -1
  88. package/dist/{schemaConverter-Y7nCYaLJ.mjs → schemaConverter-BxFDdtXu.mjs} +1 -1
  89. package/dist/scope/index.mjs +1 -1
  90. package/dist/{sse-Ad7ypl9e.mjs → sse-CJpt7LGI.mjs} +1 -1
  91. package/dist/store-helpers-DFiZl5TL.mjs +57 -0
  92. package/dist/testing/index.d.mts +5 -14
  93. package/dist/testing/index.mjs +21 -75
  94. package/dist/testing/storageContract.d.mts +1 -1
  95. package/dist/types/index.d.mts +2 -2
  96. package/dist/types/storage.d.mts +1 -1
  97. package/dist/{types-BsbNMEDR.d.mts → types-CoSzA-s-.d.mts} +1 -1
  98. package/dist/{types-Ch9pTQbf.d.mts → types-CunEX4UX.d.mts} +10 -8
  99. package/dist/utils/index.d.mts +4 -4
  100. package/dist/utils/index.mjs +6 -6
  101. package/dist/{utils-yYT3HDXt.mjs → utils-B7FuRr9w.mjs} +1 -1
  102. package/package.json +8 -11
  103. package/skills/arc/SKILL.md +92 -14
  104. package/skills/arc/references/auth.md +94 -0
  105. package/skills/arc/references/events.md +200 -12
  106. package/skills/arc/references/mcp.md +4 -17
  107. package/skills/arc/references/multi-tenancy.md +43 -0
  108. package/skills/arc/references/production.md +34 -19
  109. package/dist/EventTransport-BXja8NOc.d.mts +0 -135
  110. package/dist/audit/mongodb.d.mts +0 -2
  111. package/dist/audit/mongodb.mjs +0 -2
  112. package/dist/idempotency/mongodb.d.mts +0 -2
  113. package/dist/idempotency/mongodb.mjs +0 -123
  114. package/dist/mongodb-BsP-WbhN.d.mts +0 -127
  115. package/dist/mongodb-CTcp0hQZ.d.mts +0 -80
  116. package/dist/mongodb-Utc5k_-0.mjs +0 -90
  117. /package/dist/{HookSystem-HprTmvVY.mjs → HookSystem-BjFu7zf1.mjs} +0 -0
  118. /package/dist/{ResourceRegistry-C6uXlWe3.mjs → ResourceRegistry-Dq3_zBQP.mjs} +0 -0
  119. /package/dist/{applyPermissionResult-D6GPMsvh.mjs → applyPermissionResult-bqGpo9ML.mjs} +0 -0
  120. /package/dist/{caching-IMuYVjTL.mjs → caching-CjybdRwx.mjs} +0 -0
  121. /package/dist/{circuitBreaker-dTtG-UyS.d.mts → circuitBreaker-CvXkjfrW.d.mts} +0 -0
  122. /package/dist/{circuitBreaker-cmi5XDv5.mjs → circuitBreaker-l18oRgL5.mjs} +0 -0
  123. /package/dist/{errors-Ck2h67pm.d.mts → errors-BI8kEKsO.d.mts} +0 -0
  124. /package/dist/{errors-BF2bIOIS.mjs → errors-CqWnSqM-.mjs} +0 -0
  125. /package/dist/{externalPaths-BnkYrNzp.d.mts → externalPaths-Bapitwvd.d.mts} +0 -0
  126. /package/dist/{interface-DfLGcus7.d.mts → interface-B-pe8fhj.d.mts} +0 -0
  127. /package/dist/{interface-4y979v99.d.mts → interface-DplgQO2e.d.mts} +0 -0
  128. /package/dist/{loadResources-PWd0OCpV.mjs → loadResources-Bksk8ydA.mjs} +0 -0
  129. /package/dist/{logger-D1YrIImS.mjs → logger-CDjpjySd.mjs} +0 -0
  130. /package/dist/{memory-Cp7_cAko.mjs → memory-BFAYkf8H.mjs} +0 -0
  131. /package/dist/{metrics-B-PU4-Yu.mjs → metrics-TuOmguhi.mjs} +0 -0
  132. /package/dist/{queryParser-CgCtsjti.mjs → queryParser-Cs-6SHQK.mjs} +0 -0
  133. /package/dist/{registry-BiTKT1Dg.mjs → registry-B0Wl7uVV.mjs} +0 -0
  134. /package/dist/{replyHelpers-CxkYGT81.mjs → replyHelpers-BLojtuvR.mjs} +0 -0
  135. /package/dist/{requestContext-DYvHl113.mjs → requestContext-DYtmNpm5.mjs} +0 -0
  136. /package/dist/{sessionManager-DDCmiNIo.d.mts → sessionManager-D-oNWHz3.d.mts} +0 -0
  137. /package/dist/{storage-Dfzt4VTl.d.mts → storage-BwGQXUpd.d.mts} +0 -0
  138. /package/dist/{tracing-DdN2-wHJ.d.mts → tracing-xqXzWeaf.d.mts} +0 -0
  139. /package/dist/{typeGuards-CcFZXgU7.mjs → typeGuards-Cj5Rgvlg.mjs} +0 -0
  140. /package/dist/{versioning-CDugduqI.mjs → versioning-Cm8qoFDg.mjs} +0 -0
@@ -1,5 +1,5 @@
1
- import { t as BaseController } from "./BaseController-DAGGc5Xn.mjs";
2
- import { n as normalizePermissionResult } from "./applyPermissionResult-D6GPMsvh.mjs";
1
+ import { t as BaseController } from "./BaseController-Vu2yc56T.mjs";
2
+ import { n as normalizePermissionResult } from "./applyPermissionResult-bqGpo9ML.mjs";
3
3
  import { t as pluralize } from "./pluralize-CWP6MB39.mjs";
4
4
  import { z } from "zod";
5
5
  //#region src/integrations/mcp/createMcpServer.ts
@@ -568,7 +568,7 @@ function resourceToTools(resource, config = {}) {
568
568
  const hasSoftDelete = resource._appliedPresets?.includes("softDelete") ?? false;
569
569
  const tools = [];
570
570
  const prefix = config.toolNamePrefix;
571
- if (!controller) {} else {
571
+ if (controller) {
572
572
  let ops = ALL_CRUD_OPS.filter((op) => {
573
573
  if (resource.disabledRoutes?.includes(op)) return false;
574
574
  return true;
@@ -595,50 +595,51 @@ function resourceToTools(resource, config = {}) {
595
595
  handler: createHandler(op, controller, resource.name, resource.permissions)
596
596
  });
597
597
  }
598
- for (const route of resource.additionalRoutes ?? []) {
599
- if (route.mcp === false) continue;
600
- const mcpHandler = route.mcpHandler;
601
- if (!route.wrapHandler && !mcpHandler) continue;
602
- if (!mcpHandler && ![
603
- "POST",
604
- "PUT",
605
- "PATCH",
606
- "DELETE"
607
- ].includes(route.method)) continue;
608
- const opName = route.operation ?? slugifyRoute(route.method, route.path);
609
- const hasId = route.path.includes(":id");
610
- const mcpConfig = typeof route.mcp === "object" && route.mcp !== null ? route.mcp : void 0;
611
- const toolDescription = mcpConfig?.description ?? route.summary ?? route.description ?? `${opName} on ${resource.displayName}`;
612
- const toolAnnotations = mcpConfig?.annotations ? { ...mcpConfig.annotations } : { openWorldHint: true };
613
- const inputShape = {};
614
- if (hasId) inputShape.id = z.string().describe("Resource ID");
615
- if (mcpHandler) tools.push({
616
- name: prefix ? `${prefix}_${opName}_${resource.name}` : `${opName}_${resource.name}`,
617
- description: toolDescription,
618
- annotations: toolAnnotations,
619
- inputSchema: inputShape,
620
- handler: async (input, _ctx) => {
621
- try {
622
- return await mcpHandler(input);
623
- } catch (err) {
624
- return {
625
- content: [{
626
- type: "text",
627
- text: `Error: ${err instanceof Error ? err.message : String(err)}`
628
- }],
629
- isError: true
630
- };
631
- }
598
+ }
599
+ for (const route of resource.routes ?? []) {
600
+ if (route.mcp === false) continue;
601
+ const mcpHandler = route.mcpHandler;
602
+ if (!!route.raw && !mcpHandler) continue;
603
+ if (!mcpHandler && ![
604
+ "POST",
605
+ "PUT",
606
+ "PATCH",
607
+ "DELETE"
608
+ ].includes(route.method)) continue;
609
+ if (!mcpHandler && typeof route.handler === "string" && !controller) continue;
610
+ const opName = route.operation ?? slugifyRoute(route.method, route.path);
611
+ const hasId = route.path.includes(":id");
612
+ const mcpConfig = typeof route.mcp === "object" && route.mcp !== null ? route.mcp : void 0;
613
+ const toolDescription = mcpConfig?.description ?? route.summary ?? route.description ?? `${opName} on ${resource.displayName}`;
614
+ const toolAnnotations = mcpConfig?.annotations ? { ...mcpConfig.annotations } : { openWorldHint: true };
615
+ const inputShape = {};
616
+ if (hasId) inputShape.id = z.string().describe("Resource ID");
617
+ if (mcpHandler) tools.push({
618
+ name: prefix ? `${prefix}_${opName}_${resource.name}` : `${opName}_${resource.name}`,
619
+ description: toolDescription,
620
+ annotations: toolAnnotations,
621
+ inputSchema: inputShape,
622
+ handler: async (input, _ctx) => {
623
+ try {
624
+ return await mcpHandler(input);
625
+ } catch (err) {
626
+ return {
627
+ content: [{
628
+ type: "text",
629
+ text: `Error: ${err instanceof Error ? err.message : String(err)}`
630
+ }],
631
+ isError: true
632
+ };
632
633
  }
633
- });
634
- else tools.push({
635
- name: prefix ? `${prefix}_${opName}_${resource.name}` : `${opName}_${resource.name}`,
636
- description: toolDescription,
637
- annotations: toolAnnotations,
638
- inputSchema: inputShape,
639
- handler: createAdditionalRouteHandler(route, controller, hasId)
640
- });
641
- }
634
+ }
635
+ });
636
+ else tools.push({
637
+ name: prefix ? `${prefix}_${opName}_${resource.name}` : `${opName}_${resource.name}`,
638
+ description: toolDescription,
639
+ annotations: toolAnnotations,
640
+ inputSchema: inputShape,
641
+ handler: createCustomRouteHandler(route, controller, hasId)
642
+ });
642
643
  }
643
644
  if (resource.actions) for (const [actionName, entry] of Object.entries(resource.actions)) {
644
645
  const def = typeof entry === "function" ? { handler: entry } : entry;
@@ -757,11 +758,27 @@ function createHandler(op, controller, resourceName, permissions) {
757
758
  }
758
759
  };
759
760
  }
760
- function createAdditionalRouteHandler(route, controller, hasId) {
761
+ function createCustomRouteHandler(route, controller, hasId) {
761
762
  const ctrl = controller;
762
763
  const handlerName = typeof route.handler === "string" ? route.handler : route.operation ?? slugifyRoute(route.method, route.path);
763
764
  return async (input, ctx) => {
764
765
  try {
766
+ if (typeof route.handler === "function") {
767
+ const reqCtx = buildRequestContext(input, ctx.session, hasId ? "update" : "create");
768
+ const fn = route.handler;
769
+ const out = await fn(reqCtx);
770
+ return toCallToolResult(out !== null && typeof out === "object" && "success" in out ? out : {
771
+ success: true,
772
+ data: out
773
+ });
774
+ }
775
+ if (!ctrl) return {
776
+ content: [{
777
+ type: "text",
778
+ text: `Handler "${handlerName}" has no controller available`
779
+ }],
780
+ isError: true
781
+ };
765
782
  const method = ctrl[handlerName];
766
783
  if (typeof method !== "function") return {
767
784
  content: [{
@@ -1,4 +1,4 @@
1
- import { r as CircuitBreakerOptions } from "../circuitBreaker-dTtG-UyS.mjs";
1
+ import { r as CircuitBreakerOptions } from "../circuitBreaker-CvXkjfrW.mjs";
2
2
 
3
3
  //#region src/rpc/serviceClient.d.ts
4
4
  interface RetryConfig {
@@ -1,4 +1,4 @@
1
- import { t as CircuitBreaker } from "../circuitBreaker-cmi5XDv5.mjs";
1
+ import { t as CircuitBreaker } from "../circuitBreaker-l18oRgL5.mjs";
2
2
  //#region src/rpc/serviceClient.ts
3
3
  /**
4
4
  * Service Client — Resource-Oriented RPC
@@ -85,7 +85,7 @@ function convertOpenApiSchemas(schemas, target = DEFAULT_OPENAPI_TARGET) {
85
85
  *
86
86
  * JSON Schema values pass through unchanged. Only Zod schemas are converted.
87
87
  *
88
- * Used for both additionalRoutes and customSchemas (CRUD overrides).
88
+ * Used for both custom routes and customSchemas (CRUD overrides).
89
89
  *
90
90
  * Defaults to `draft-7` so Fastify v5's bundled AJV 8 accepts the output.
91
91
  * Pass `openapi-3.0` (or `openapi-3.1`) when generating OpenAPI documents.
@@ -1,6 +1,6 @@
1
1
  import { _ as isElevated, a as getOrgContext, b as isService, c as getRequestScope, d as getServiceScopes, f as getTeamId, g as isAuthenticated, h as hasOrgAccess, i as getClientId, l as getScopeContext, m as getUserRoles, n as PUBLIC_SCOPE, o as getOrgId, p as getUserId, r as getAncestorOrgIds, s as getOrgRoles, t as AUTHENTICATED_SCOPE, u as getScopeContextMap, v as isMember, y as isOrgInScope } from "../types-AOD8fxIw.mjs";
2
2
  import { n as normalizeRoles } from "../types-ZUu_h0jp.mjs";
3
- import { n as elevation_default, t as elevationPlugin } from "../elevation-DtFxrG0s.mjs";
3
+ import { n as elevation_default, t as elevationPlugin } from "../elevation-DxQ6ACbt.mjs";
4
4
  //#region src/scope/rateLimitKey.ts
5
5
  function createTenantKeyGenerator(opts) {
6
6
  if (opts?.strategy) return opts.strategy;
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./chunk-BpYLSNr0.mjs";
2
2
  import { n as PUBLIC_SCOPE, o as getOrgId } from "./types-AOD8fxIw.mjs";
3
- import { t as arcLog } from "./logger-D1YrIImS.mjs";
3
+ import { t as arcLog } from "./logger-CDjpjySd.mjs";
4
4
  import fp from "fastify-plugin";
5
5
  //#region src/plugins/sse.ts
6
6
  var sse_exports = /* @__PURE__ */ __exportAll({
@@ -0,0 +1,57 @@
1
+ //#region src/adapters/store-helpers.ts
2
+ /**
3
+ * Classify an error thrown by `getOne` / `getById` / `update` as a
4
+ * "document not found" miss. Mongokit uses `status: 404`, Prisma uses
5
+ * `code: 'P2025'`, some kits throw `DocumentNotFoundError`. Kits that
6
+ * return `null` on miss never see this predicate fire — it only kicks in
7
+ * when a driver chose to throw.
8
+ */
9
+ function isNotFoundError(err) {
10
+ if (!err || typeof err !== "object") return false;
11
+ const e = err;
12
+ if (e.status === 404 || e.statusCode === 404) return true;
13
+ if (e.code === "P2025") return true;
14
+ if (e.name === "DocumentNotFoundError") return true;
15
+ return false;
16
+ }
17
+ /**
18
+ * Build a `safeGetOne(filter)` that papers over the throw-vs-null split
19
+ * in kit implementations. Real errors propagate; miss returns `null`.
20
+ * Throws if the repository lacks `getOne` — callers must check.
21
+ */
22
+ function createSafeGetOne(repository) {
23
+ if (typeof repository.getOne !== "function") throw new Error("createSafeGetOne: repository.getOne is required");
24
+ const getOne = repository.getOne.bind(repository);
25
+ return async (filter) => {
26
+ try {
27
+ return await getOne(filter) ?? null;
28
+ } catch (err) {
29
+ if (isNotFoundError(err)) return null;
30
+ throw err;
31
+ }
32
+ };
33
+ }
34
+ /**
35
+ * Build a dup-key predicate for the given repository. Prefers the kit's
36
+ * own `isDuplicateKeyError` (it knows its driver — Mongo `11000`, Prisma
37
+ * `P2002`, Postgres `23505`, MySQL `1062`, etc.); falls back to a
38
+ * conservative Mongo check so mongokit ≤3.8 keeps working without changes.
39
+ *
40
+ * Non-mongo kits MUST implement the predicate to participate in
41
+ * idempotency/outbox dup-handling semantics.
42
+ *
43
+ * `name === "MongoServerError"` alone is deliberately NOT matched — that
44
+ * also fires on WriteConflict / NotWritablePrimary / transient failures,
45
+ * which must propagate rather than silently become 409s.
46
+ */
47
+ function createIsDuplicateKeyError(repository) {
48
+ const repoPredicate = typeof repository.isDuplicateKeyError === "function" ? repository.isDuplicateKeyError.bind(repository) : null;
49
+ return (err) => {
50
+ if (repoPredicate) return repoPredicate(err);
51
+ if (!err || typeof err !== "object") return false;
52
+ const e = err;
53
+ return e.code === 11e3 || e.codeName === "DuplicateKey";
54
+ };
55
+ }
56
+ //#endregion
57
+ export { createSafeGetOne as n, createIsDuplicateKeyError as t };
@@ -1,5 +1,5 @@
1
- import { Zt as CrudRepository, m as AnyRecord, qt as ResourceDefinition } from "../interface-CMRutPfe.mjs";
2
- import { d as ResourceLike, r as CreateAppOptions } from "../types-Ch9pTQbf.mjs";
1
+ import { Kt as ResourceDefinition, Xt as CrudRepository, p as AnyRecord } from "../interface-YrWsmKqE.mjs";
2
+ import { d as ResourceLike, r as CreateAppOptions } from "../types-CunEX4UX.mjs";
3
3
  import { StorageContractSetup, StorageContractSetupResult, runStorageContract } from "./storageContract.mjs";
4
4
  import Fastify, { FastifyInstance, FastifyServerOptions } from "fastify";
5
5
  import { Connection } from "mongoose";
@@ -631,21 +631,12 @@ declare class TestHarness<T = unknown> {
631
631
  private _createdIds;
632
632
  constructor(resource: ResourceDefinition<unknown>, options: TestHarnessOptions<T>);
633
633
  /**
634
- * Run all baseline tests
634
+ * Run all baseline tests (schema, presets, field permissions, pipeline, events).
635
635
  *
636
- * Executes CRUD, validation, and preset tests
636
+ * For HTTP-level CRUD coverage (routes, auth, permissions), use
637
+ * {@link HttpTestHarness} instead.
637
638
  */
638
639
  runAll(): void;
639
- /**
640
- * Run CRUD operation tests (model-level)
641
- *
642
- * Tests: create, read (list + getById), update, delete
643
- *
644
- * @deprecated Use `HttpTestHarness.runCrud()` for HTTP-level CRUD tests.
645
- * This method tests Mongoose models directly and does not exercise
646
- * HTTP routes, authentication, permissions, or the Arc pipeline.
647
- */
648
- runCrud(): void;
649
640
  /**
650
641
  * Run validation tests
651
642
  *
@@ -1,5 +1,5 @@
1
1
  import { t as CRUD_OPERATIONS } from "../constants-Cxde4rpC.mjs";
2
- import { n as applyFieldWritePermissions, t as applyFieldReadPermissions } from "../fields-ipsbIRPK.mjs";
2
+ import { n as applyFieldWritePermissions, t as applyFieldReadPermissions } from "../fields-CU6FlaDV.mjs";
3
3
  import { runStorageContract } from "./storageContract.mjs";
4
4
  import Fastify from "fastify";
5
5
  import mongoose from "mongoose";
@@ -1133,8 +1133,11 @@ function pickResource(value) {
1133
1133
  * harness.runAll();
1134
1134
  *
1135
1135
  * // Or run specific test suites
1136
- * harness.runCrud();
1137
1136
  * harness.runPresets();
1137
+ * harness.runValidation();
1138
+ *
1139
+ * // For HTTP-level CRUD coverage (auth, permissions, routes), use
1140
+ * // `HttpTestHarness` from `@classytic/arc/testing`.
1138
1141
  */
1139
1142
  var TestHarness = class {
1140
1143
  resource;
@@ -1157,12 +1160,12 @@ var TestHarness = class {
1157
1160
  this.Model = model;
1158
1161
  }
1159
1162
  /**
1160
- * Run all baseline tests
1163
+ * Run all baseline tests (schema, presets, field permissions, pipeline, events).
1161
1164
  *
1162
- * Executes CRUD, validation, and preset tests
1165
+ * For HTTP-level CRUD coverage (routes, auth, permissions), use
1166
+ * {@link HttpTestHarness} instead.
1163
1167
  */
1164
1168
  runAll() {
1165
- this.runCrud();
1166
1169
  this.runValidation();
1167
1170
  this.runPresets();
1168
1171
  this.runFieldPermissions();
@@ -1170,67 +1173,6 @@ var TestHarness = class {
1170
1173
  this.runEvents();
1171
1174
  }
1172
1175
  /**
1173
- * Run CRUD operation tests (model-level)
1174
- *
1175
- * Tests: create, read (list + getById), update, delete
1176
- *
1177
- * @deprecated Use `HttpTestHarness.runCrud()` for HTTP-level CRUD tests.
1178
- * This method tests Mongoose models directly and does not exercise
1179
- * HTTP routes, authentication, permissions, or the Arc pipeline.
1180
- */
1181
- runCrud() {
1182
- const { resource, fixtures, Model } = this;
1183
- describe(`${resource.displayName} CRUD Operations`, () => {
1184
- beforeAll(async () => {
1185
- await mongoose.connect(this.mongoUri);
1186
- if (this.setupFn) await this.setupFn();
1187
- });
1188
- afterAll(async () => {
1189
- if (this._createdIds.length > 0) await Model.deleteMany({ _id: { $in: this._createdIds } });
1190
- if (this.teardownFn) await this.teardownFn();
1191
- await mongoose.disconnect();
1192
- });
1193
- describe("Create", () => {
1194
- it("should create a new document with valid data", async () => {
1195
- const doc = await Model.create(fixtures.valid);
1196
- this._createdIds.push(doc._id);
1197
- expect(doc).toBeDefined();
1198
- expect(doc._id).toBeDefined();
1199
- for (const [key, value] of Object.entries(fixtures.valid)) if (typeof value !== "object") expect(doc[key]).toEqual(value);
1200
- });
1201
- it("should have timestamps", async () => {
1202
- const doc = await Model.findById(this._createdIds[0]);
1203
- expect(doc).toBeDefined();
1204
- expect(doc?.createdAt).toBeDefined();
1205
- expect(doc?.updatedAt).toBeDefined();
1206
- });
1207
- });
1208
- describe("Read", () => {
1209
- it("should find document by ID", async () => {
1210
- expect(await Model.findById(this._createdIds[0])).toBeDefined();
1211
- });
1212
- it("should list documents", async () => {
1213
- const docs = await Model.find({});
1214
- expect(Array.isArray(docs)).toBe(true);
1215
- expect(docs.length).toBeGreaterThan(0);
1216
- });
1217
- });
1218
- describe("Update", () => {
1219
- it("should update document", async () => {
1220
- const updateData = fixtures.update || { updatedAt: /* @__PURE__ */ new Date() };
1221
- expect(await Model.findByIdAndUpdate(this._createdIds[0], updateData, { new: true })).toBeDefined();
1222
- });
1223
- });
1224
- describe("Delete", () => {
1225
- it("should delete document", async () => {
1226
- const toDelete = await Model.create(fixtures.valid);
1227
- await Model.findByIdAndDelete(toDelete._id);
1228
- expect(await Model.findById(toDelete._id)).toBeNull();
1229
- });
1230
- });
1231
- });
1232
- }
1233
- /**
1234
1176
  * Run validation tests
1235
1177
  *
1236
1178
  * Tests schema validation, required fields, etc.
@@ -1371,7 +1313,7 @@ var TestHarness = class {
1371
1313
  expect(result.otherField).toBe("visible");
1372
1314
  });
1373
1315
  it(`should strip hidden field '${field}' from writes`, () => {
1374
- const result = applyFieldWritePermissions({
1316
+ const { body: result } = applyFieldWritePermissions({
1375
1317
  [field]: "attempt",
1376
1318
  name: "test"
1377
1319
  }, fieldPerms, []);
@@ -1392,7 +1334,7 @@ var TestHarness = class {
1392
1334
  break;
1393
1335
  case "writableBy":
1394
1336
  it(`should strip field '${field}' from writes by non-privileged users`, () => {
1395
- const result = applyFieldWritePermissions({
1337
+ const { body: result } = applyFieldWritePermissions({
1396
1338
  [field]: "new-value",
1397
1339
  name: "test"
1398
1340
  }, fieldPerms, ["viewer"]);
@@ -1402,7 +1344,8 @@ var TestHarness = class {
1402
1344
  if (perm.roles && perm.roles.length > 0) {
1403
1345
  const writeRole = perm.roles[0];
1404
1346
  it(`should allow writing field '${field}' by roles: ${[...perm.roles].join(", ")}`, () => {
1405
- expect(applyFieldWritePermissions({ [field]: "new-value" }, fieldPerms, [writeRole])[field]).toBe("new-value");
1347
+ const { body: result } = applyFieldWritePermissions({ [field]: "new-value" }, fieldPerms, [writeRole]);
1348
+ expect(result[field]).toBe("new-value");
1406
1349
  });
1407
1350
  }
1408
1351
  break;
@@ -1654,10 +1597,11 @@ function runFieldPermissionTests(displayName, fieldPerms) {
1654
1597
  }, fieldPerms, [])[field]).toBeUndefined();
1655
1598
  });
1656
1599
  it(`should strip hidden field '${field}' from writes`, () => {
1657
- expect(applyFieldWritePermissions({
1600
+ const { body: result } = applyFieldWritePermissions({
1658
1601
  [field]: "attempt",
1659
1602
  name: "test"
1660
- }, fieldPerms, [])[field]).toBeUndefined();
1603
+ }, fieldPerms, []);
1604
+ expect(result[field]).toBeUndefined();
1661
1605
  });
1662
1606
  break;
1663
1607
  case "visibleTo":
@@ -1673,15 +1617,17 @@ function runFieldPermissionTests(displayName, fieldPerms) {
1673
1617
  break;
1674
1618
  case "writableBy":
1675
1619
  it(`should strip field '${field}' from writes by non-privileged users`, () => {
1676
- expect(applyFieldWritePermissions({
1620
+ const { body: result } = applyFieldWritePermissions({
1677
1621
  [field]: "v",
1678
1622
  name: "test"
1679
- }, fieldPerms, ["_no_role_"])[field]).toBeUndefined();
1623
+ }, fieldPerms, ["_no_role_"]);
1624
+ expect(result[field]).toBeUndefined();
1680
1625
  });
1681
1626
  if (perm.roles && perm.roles.length > 0) {
1682
1627
  const writeRole = perm.roles[0];
1683
1628
  it(`should allow writing field '${field}' by roles: ${[...perm.roles].join(", ")}`, () => {
1684
- expect(applyFieldWritePermissions({ [field]: "v" }, fieldPerms, [writeRole])[field]).toBe("v");
1629
+ const { body: result } = applyFieldWritePermissions({ [field]: "v" }, fieldPerms, [writeRole]);
1630
+ expect(result[field]).toBe("v");
1685
1631
  });
1686
1632
  }
1687
1633
  break;
@@ -1797,7 +1743,7 @@ function runEventTests(resourceName, displayName, events) {
1797
1743
  * ```
1798
1744
  */
1799
1745
  async function createTestApp(options = {}) {
1800
- const { createApp } = await import("../createApp-B1EY8zxa.mjs").then((n) => n.r);
1746
+ const { createApp } = await import("../createApp-CBJUJKGP.mjs").then((n) => n.r);
1801
1747
  const { useInMemoryDb = true, mongoUri: providedMongoUri, ...appOptions } = options;
1802
1748
  const defaultAuth = {
1803
1749
  type: "jwt",
@@ -1,4 +1,4 @@
1
- import { t as Storage } from "../storage-Dfzt4VTl.mjs";
1
+ import { t as Storage } from "../storage-BwGQXUpd.mjs";
2
2
 
3
3
  //#region src/testing/storageContract.d.ts
4
4
  interface StorageContractSetupResult {
@@ -1,5 +1,5 @@
1
1
  import { _ as isAuthenticated, c as getOrgRoles, g as hasOrgAccess, n as PUBLIC_SCOPE, p as getTeamId, r as RequestScope, s as getOrgId, t as AUTHENTICATED_SCOPE, v as isElevated, y as isMember } from "../types-BD85MlEK.mjs";
2
- import { $ as PresetFunction, $t as DeleteOptions, A as EventsDecorator, B as InferResourceDoc, Bt as FastifyHandler, C as ConfigError, Ct as TypedResourceConfig, D as CrudRouterOptions, Dt as ValidationResult, E as CrudRouteKey, Et as ValidateOptions, F as GracefulShutdownOptions, G as LookupOption, H as IntrospectionPluginOptions, Ht as IControllerResponse, I as HealthCheck, J as ObjectId, K as MiddlewareConfig, L as HealthOptions, M as FastifyWithAuth, N as FastifyWithDecorators, O as CrudSchemas, Ot as envelope, P as FieldRule, Q as PopulateOption, Qt as DeleteManyResult, R as InferAdapterDoc, Rt as ControllerHandler, S as AuthenticatorContext, St as TypedRepository, T as CrudController, Tt as UserOrganization, U as JWTPayload, Ut as IRequestContext, V as IntrospectionData, Vt as IController, W as JwtContext, Wt as RouteHandler, X as OwnershipCheck, Xt as BulkWriteResult, Y as OpenApiSchemas, Yt as BulkWriteOperation, Z as ParsedQuery, Zt as CrudRepository, _ as ArcInternalMetadata, _t as RouteMcpConfig, an as PaginationParams, at as RegistryStats, b as AuthPluginOptions, bt as TokenPair, cn as RepositorySession, ct as RequestWithExtras, d as ActionHandlerFn, dt as ResourceHookContext, en as DeleteResult, et as PresetHook, f as ActionsMap, ft as ResourceHooks, g as ArcDecorator, gt as RouteHandlerMethod, h as ApiResponse, ht as RouteDefinition, in as PaginatedResult, it as RegistryEntry, j as FastifyRequestExtras, jt as BaseControllerOptions, k as EventDefinition, kt as getUserId, l as ActionDefinition, ln as UpdateManyResult, lt as ResourceCacheConfig, m as AnyRecord, mt as ResourcePermissions, nn as KeysetPaginatedResult, nt as QueryParserInterface, on as PaginationResult, ot as RequestContext, p as AdditionalRoute, pt as ResourceMetadata, q as MiddlewareHandler, rn as OffsetPaginatedResult, rt as RateLimitConfig, sn as QueryOptions, st as RequestIdOptions, tn as InferDoc, tt as PresetResult, u as ActionEntry, un as WriteOptions, ut as ResourceConfig, v as ArcRequest, vt as RouteSchemaOptions, w as ControllerQueryOptions, wt as UserLike, x as Authenticator, xt as TypedController, y as AuthHelpers, yt as ServiceContext, z as InferDocType, zt as ControllerLike } from "../interface-CMRutPfe.mjs";
2
+ import { $ as PresetHook, $t as DeleteResult, A as FastifyRequestExtras, At as BaseControllerOptions, B as IntrospectionData, Bt as IController, C as ControllerQueryOptions, Ct as UserLike, D as CrudSchemas, Dt as envelope, E as CrudRouterOptions, Et as ValidationResult, F as HealthCheck, G as MiddlewareConfig, H as JWTPayload, Ht as IRequestContext, I as HealthOptions, J as OpenApiSchemas, Jt as BulkWriteOperation, K as MiddlewareHandler, L as InferAdapterDoc, Lt as ControllerHandler, M as FastifyWithDecorators, N as FieldRule, O as EventDefinition, Ot as getUserId, P as GracefulShutdownOptions, Q as PresetFunction, Qt as DeleteOptions, R as InferDocType, Rt as ControllerLike, S as ConfigError, St as TypedResourceConfig, T as CrudRouteKey, Tt as ValidateOptions, U as JwtContext, Ut as RouteHandler, V as IntrospectionPluginOptions, Vt as IControllerResponse, W as LookupOption, X as ParsedQuery, Xt as CrudRepository, Y as OwnershipCheck, Yt as BulkWriteResult, Z as PopulateOption, Zt as DeleteManyResult, _ as ArcRequest, _t as RouteSchemaOptions, an as PaginationParams, at as RequestContext, b as Authenticator, bt as TypedController, cn as RepositorySession, ct as ResourceCacheConfig, d as ActionHandlerFn, dt as ResourceHooks, en as FindOneAndUpdateOptions, et as PresetResult, f as ActionsMap, ft as ResourceMetadata, g as ArcInternalMetadata, gt as RouteMcpConfig, h as ArcDecorator, ht as RouteHandlerMethod, in as PaginatedResult, it as RegistryStats, j as FastifyWithAuth, k as EventsDecorator, l as ActionDefinition, ln as UpdateManyResult, lt as ResourceConfig, m as ApiResponse, mt as RouteDefinition, nn as KeysetPaginatedResult, nt as RateLimitConfig, on as PaginationResult, ot as RequestIdOptions, p as AnyRecord, pt as ResourcePermissions, q as ObjectId, rn as OffsetPaginatedResult, rt as RegistryEntry, sn as QueryOptions, st as RequestWithExtras, tn as InferDoc, tt as QueryParserInterface, u as ActionEntry, un as WriteOptions, ut as ResourceHookContext, v as AuthHelpers, vt as ServiceContext, w as CrudController, wt as UserOrganization, x as AuthenticatorContext, xt as TypedRepository, y as AuthPluginOptions, yt as TokenPair, z as InferResourceDoc, zt as FastifyHandler } from "../interface-YrWsmKqE.mjs";
3
3
  import { i as UserBase, n as PermissionContext, r as PermissionResult, t as PermissionCheck } from "../types-DZi1aYhm.mjs";
4
4
  import { n as ElevationOptions, t as ElevationEvent } from "../elevation-B6S5csVA.mjs";
5
- export { AUTHENTICATED_SCOPE, ActionDefinition, ActionEntry, ActionHandlerFn, ActionsMap, AdditionalRoute, AnyRecord, ApiResponse, ArcDecorator, ArcInternalMetadata, ArcRequest, AuthHelpers, AuthPluginOptions, Authenticator, AuthenticatorContext, BaseControllerOptions, BulkWriteOperation, BulkWriteResult, ConfigError, ControllerHandler, ControllerLike, ControllerQueryOptions, CrudController, CrudRepository, CrudRouteKey, CrudRouterOptions, CrudSchemas, DeleteManyResult, DeleteOptions, DeleteResult, ElevationEvent, ElevationOptions, EventDefinition, EventsDecorator, FastifyHandler, FastifyRequestExtras, FastifyWithAuth, FastifyWithDecorators, FieldRule, GracefulShutdownOptions, HealthCheck, HealthOptions, IController, IControllerResponse, IRequestContext, InferAdapterDoc, InferDoc, InferDocType, InferResourceDoc, IntrospectionData, IntrospectionPluginOptions, JWTPayload, JwtContext, KeysetPaginatedResult, LookupOption, MiddlewareConfig, MiddlewareHandler, ObjectId, OffsetPaginatedResult, OpenApiSchemas, OwnershipCheck, PUBLIC_SCOPE, PaginatedResult, PaginationParams, PaginationResult, ParsedQuery, PermissionCheck, PermissionContext, PermissionResult, PopulateOption, PresetFunction, PresetHook, PresetResult, QueryOptions, QueryParserInterface, RateLimitConfig, RegistryEntry, RegistryStats, RepositorySession, RequestContext, RequestIdOptions, RequestScope, RequestWithExtras, ResourceCacheConfig, ResourceConfig, ResourceHookContext, ResourceHooks, ResourceMetadata, ResourcePermissions, RouteDefinition, RouteHandler, RouteHandlerMethod, RouteMcpConfig, RouteSchemaOptions, ServiceContext, TokenPair, TypedController, TypedRepository, TypedResourceConfig, UpdateManyResult, UserBase, UserLike, UserOrganization, ValidateOptions, ValidationResult, WriteOptions, envelope, getOrgId, getOrgRoles, getTeamId, getUserId, hasOrgAccess, isAuthenticated, isElevated, isMember };
5
+ export { AUTHENTICATED_SCOPE, ActionDefinition, ActionEntry, ActionHandlerFn, ActionsMap, AnyRecord, ApiResponse, ArcDecorator, ArcInternalMetadata, ArcRequest, AuthHelpers, AuthPluginOptions, Authenticator, AuthenticatorContext, BaseControllerOptions, BulkWriteOperation, BulkWriteResult, ConfigError, ControllerHandler, ControllerLike, ControllerQueryOptions, CrudController, CrudRepository, CrudRouteKey, CrudRouterOptions, CrudSchemas, DeleteManyResult, DeleteOptions, DeleteResult, ElevationEvent, ElevationOptions, EventDefinition, EventsDecorator, FastifyHandler, FastifyRequestExtras, FastifyWithAuth, FastifyWithDecorators, FieldRule, FindOneAndUpdateOptions, GracefulShutdownOptions, HealthCheck, HealthOptions, IController, IControllerResponse, IRequestContext, InferAdapterDoc, InferDoc, InferDocType, InferResourceDoc, IntrospectionData, IntrospectionPluginOptions, JWTPayload, JwtContext, KeysetPaginatedResult, LookupOption, MiddlewareConfig, MiddlewareHandler, ObjectId, OffsetPaginatedResult, OpenApiSchemas, OwnershipCheck, PUBLIC_SCOPE, PaginatedResult, PaginationParams, PaginationResult, ParsedQuery, PermissionCheck, PermissionContext, PermissionResult, PopulateOption, PresetFunction, PresetHook, PresetResult, QueryOptions, QueryParserInterface, RateLimitConfig, RegistryEntry, RegistryStats, RepositorySession, RequestContext, RequestIdOptions, RequestScope, RequestWithExtras, ResourceCacheConfig, ResourceConfig, ResourceHookContext, ResourceHooks, ResourceMetadata, ResourcePermissions, RouteDefinition, RouteHandler, RouteHandlerMethod, RouteMcpConfig, RouteSchemaOptions, ServiceContext, TokenPair, TypedController, TypedRepository, TypedResourceConfig, UpdateManyResult, UserBase, UserLike, UserOrganization, ValidateOptions, ValidationResult, WriteOptions, envelope, getOrgId, getOrgRoles, getTeamId, getUserId, hasOrgAccess, isAuthenticated, isElevated, isMember };
@@ -1,2 +1,2 @@
1
- import { a as StorageReadResult, i as StorageReadRange, n as StorageContext, o as StorageUploadInput, r as StorageFile, t as Storage } from "../storage-Dfzt4VTl.mjs";
1
+ import { a as StorageReadResult, i as StorageReadRange, n as StorageContext, o as StorageUploadInput, r as StorageFile, t as Storage } from "../storage-BwGQXUpd.mjs";
2
2
  export { Storage, StorageContext, StorageFile, StorageReadRange, StorageReadResult, StorageUploadInput };
@@ -1,4 +1,4 @@
1
- import { qt as ResourceDefinition } from "./interface-CMRutPfe.mjs";
1
+ import { Kt as ResourceDefinition } from "./interface-YrWsmKqE.mjs";
2
2
  import { z } from "zod";
3
3
 
4
4
  //#region src/integrations/mcp/types.d.ts
@@ -1,12 +1,12 @@
1
- import { x as Authenticator } from "./interface-CMRutPfe.mjs";
1
+ import { b as Authenticator } from "./interface-YrWsmKqE.mjs";
2
2
  import { n as ElevationOptions } from "./elevation-B6S5csVA.mjs";
3
- import { t as ExternalOpenApiPaths } from "./externalPaths-BnkYrNzp.mjs";
4
- import { i as CacheStore } from "./interface-4y979v99.mjs";
5
- import { r as QueryCachePluginOptions } from "./queryCachePlugin-BJJGBTlu.mjs";
6
- import { i as EventTransport } from "./EventTransport-BXja8NOc.mjs";
7
- import { t as EventPluginOptions } from "./eventPlugin-D9DKB2zM.mjs";
8
- import { f as SSEOptions, h as CachingOptions, i as VersioningOptions, l as MetricsOptions, t as ErrorHandlerOptions } from "./errorHandler-Bah5JhBd.mjs";
9
- import { r as IdempotencyStore } from "./interface-DfLGcus7.mjs";
3
+ import { t as ExternalOpenApiPaths } from "./externalPaths-Bapitwvd.mjs";
4
+ import { i as CacheStore } from "./interface-DplgQO2e.mjs";
5
+ import { r as QueryCachePluginOptions } from "./queryCachePlugin-CnTZZTC5.mjs";
6
+ import { o as EventTransport } from "./EventTransport-CqZ8FyM_.mjs";
7
+ import { t as EventPluginOptions } from "./eventPlugin-BxvaCIZF.mjs";
8
+ import { a as VersioningOptions, g as CachingOptions, p as SSEOptions, t as ErrorHandlerOptions, u as MetricsOptions } from "./errorHandler-DixGcttC.mjs";
9
+ import { r as IdempotencyStore } from "./interface-B-pe8fhj.mjs";
10
10
  import { FastifyInstance, FastifyPluginAsync, FastifyReply, FastifyRequest, FastifyServerOptions } from "fastify";
11
11
 
12
12
  //#region src/factory/loadResources.d.ts
@@ -409,6 +409,8 @@ interface CreateAppOptions {
409
409
  debug?: boolean | string;
410
410
  /** Trust proxy headers (X-Forwarded-For, etc.) */
411
411
  trustProxy?: boolean;
412
+ /** Fastify plugin/onReady timeout in ms (default: 10_000). Raise for slow boot work (index materialisation, WAL replay, external warm-up). */
413
+ pluginTimeout?: number;
412
414
  /**
413
415
  * Auth configuration
414
416
  *
@@ -1,6 +1,6 @@
1
- import { Y as OpenApiSchemas, Z as ParsedQuery, m as AnyRecord, nt as QueryParserInterface } from "../interface-CMRutPfe.mjs";
2
- import { a as NotFoundError, c as RateLimitError, d as ValidationError, f as createDomainError, i as ForbiddenError, l as ServiceUnavailableError, m as isArcError, n as ConflictError, o as OrgAccessDeniedError, p as createError, r as ErrorDetails, s as OrgRequiredError, t as ArcError, u as UnauthorizedError } from "../errors-Ck2h67pm.mjs";
3
- import { a as CircuitBreakerStats, c as createCircuitBreakerRegistry, i as CircuitBreakerRegistry, n as CircuitBreakerError, o as CircuitState, r as CircuitBreakerOptions, s as createCircuitBreaker, t as CircuitBreaker } from "../circuitBreaker-dTtG-UyS.mjs";
1
+ import { J as OpenApiSchemas, X as ParsedQuery, p as AnyRecord, tt as QueryParserInterface } from "../interface-YrWsmKqE.mjs";
2
+ import { a as NotFoundError, c as RateLimitError, d as ValidationError, f as createDomainError, i as ForbiddenError, l as ServiceUnavailableError, m as isArcError, n as ConflictError, o as OrgAccessDeniedError, p as createError, r as ErrorDetails, s as OrgRequiredError, t as ArcError, u as UnauthorizedError } from "../errors-BI8kEKsO.mjs";
3
+ import { a as CircuitBreakerStats, c as createCircuitBreakerRegistry, i as CircuitBreakerRegistry, n as CircuitBreakerError, o as CircuitState, r as CircuitBreakerOptions, s as createCircuitBreaker, t as CircuitBreaker } from "../circuitBreaker-CvXkjfrW.mjs";
4
4
  import { FastifyInstance, FastifyReply, FastifyRequest, RouteHandlerMethod } from "fastify";
5
5
 
6
6
  //#region src/utils/compensation.d.ts
@@ -554,7 +554,7 @@ declare function convertOpenApiSchemas(schemas: OpenApiSchemas, target?: JsonSch
554
554
  *
555
555
  * JSON Schema values pass through unchanged. Only Zod schemas are converted.
556
556
  *
557
- * Used for both additionalRoutes and customSchemas (CRUD overrides).
557
+ * Used for both custom routes and customSchemas (CRUD overrides).
558
558
  *
559
559
  * Defaults to `draft-7` so Fastify v5's bundled AJV 8 accepts the output.
560
560
  * Pass `openapi-3.0` (or `openapi-3.1`) when generating OpenAPI documents.
@@ -1,7 +1,7 @@
1
- import { n as createQueryParser, t as ArcQueryParser } from "../queryParser-CgCtsjti.mjs";
2
- import { a as toJsonSchema, i as isZodSchema, n as convertRouteSchema, r as isJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-Y7nCYaLJ.mjs";
3
- import { a as createCircuitBreaker, i as CircuitState, n as CircuitBreakerError, o as createCircuitBreakerRegistry, r as CircuitBreakerRegistry, t as CircuitBreaker } from "../circuitBreaker-cmi5XDv5.mjs";
4
- import { _ as withCompensation, a as getListQueryParams, c as mutationResponse, d as responses, f as successResponseSchema, g as defineCompensation, h as defineGuard, i as getDefaultCrudSchemas, l as paginationSchema, m as handleRaw, n as deleteResponse, o as itemResponse, p as wrapResponse, r as errorResponseSchema, s as listResponse, t as createStateMachine, u as queryParams } from "../utils-yYT3HDXt.mjs";
5
- import { a as OrgAccessDeniedError, c as ServiceUnavailableError, d as createDomainError, f as createError, i as NotFoundError, l as UnauthorizedError, n as ConflictError, o as OrgRequiredError, p as isArcError, r as ForbiddenError, s as RateLimitError, t as ArcError, u as ValidationError } from "../errors-BF2bIOIS.mjs";
6
- import { t as hasEvents } from "../typeGuards-CcFZXgU7.mjs";
1
+ import { a as OrgAccessDeniedError, c as ServiceUnavailableError, d as createDomainError, f as createError, i as NotFoundError, l as UnauthorizedError, n as ConflictError, o as OrgRequiredError, p as isArcError, r as ForbiddenError, s as RateLimitError, t as ArcError, u as ValidationError } from "../errors-CqWnSqM-.mjs";
2
+ import { n as createQueryParser, t as ArcQueryParser } from "../queryParser-Cs-6SHQK.mjs";
3
+ import { a as createCircuitBreaker, i as CircuitState, n as CircuitBreakerError, o as createCircuitBreakerRegistry, r as CircuitBreakerRegistry, t as CircuitBreaker } from "../circuitBreaker-l18oRgL5.mjs";
4
+ import { _ as withCompensation, a as getListQueryParams, c as mutationResponse, d as responses, f as successResponseSchema, g as defineCompensation, h as defineGuard, i as getDefaultCrudSchemas, l as paginationSchema, m as handleRaw, n as deleteResponse, o as itemResponse, p as wrapResponse, r as errorResponseSchema, s as listResponse, t as createStateMachine, u as queryParams } from "../utils-B7FuRr9w.mjs";
5
+ import { a as toJsonSchema, i as isZodSchema, n as convertRouteSchema, r as isJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-BxFDdtXu.mjs";
6
+ import { t as hasEvents } from "../typeGuards-Cj5Rgvlg.mjs";
7
7
  export { ArcError, ArcQueryParser, CircuitBreaker, CircuitBreakerError, CircuitBreakerRegistry, CircuitState, ConflictError, ForbiddenError, NotFoundError, OrgAccessDeniedError, OrgRequiredError, RateLimitError, ServiceUnavailableError, UnauthorizedError, ValidationError, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createDomainError, createError, createQueryParser, createStateMachine, defineCompensation, defineGuard, deleteResponse, errorResponseSchema, getDefaultCrudSchemas, getListQueryParams, handleRaw, hasEvents, isArcError, isJsonSchema, isZodSchema, itemResponse, listResponse, mutationResponse, paginationSchema, queryParams, responses, successResponseSchema, toJsonSchema, withCompensation, wrapResponse };
@@ -1,4 +1,4 @@
1
- import { t as ArcError } from "./errors-BF2bIOIS.mjs";
1
+ import { t as ArcError } from "./errors-CqWnSqM-.mjs";
2
2
  //#region src/utils/compensation.ts
3
3
  /**
4
4
  * Run steps in order with automatic compensation on failure.