@classytic/arc 2.7.7 → 2.8.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.
- package/README.md +11 -2
- package/dist/{BaseController-CpMfCXdn.mjs → BaseController-DAGGc5Xn.mjs} +76 -25
- package/dist/{EventTransport-C4VheKeC.d.mts → EventTransport-CLXJUzyT.d.mts} +37 -1
- package/dist/{ResourceRegistry-DsHiG9cL.mjs → ResourceRegistry-Dtcojmu8.mjs} +14 -2
- package/dist/adapters/index.d.mts +2 -2
- package/dist/adapters/index.mjs +1 -1
- package/dist/{adapters-BxGgSHjj.mjs → adapters-BBqAVvPK.mjs} +11 -0
- package/dist/audit/index.d.mts +1 -1
- package/dist/audit/index.mjs +1 -1
- package/dist/audit/mongodb.d.mts +1 -1
- package/dist/audit/mongodb.mjs +1 -1
- package/dist/auth/index.d.mts +4 -4
- package/dist/auth/index.mjs +3 -3
- package/dist/auth/redis-session.d.mts +1 -1
- package/dist/{betterAuthOpenApi-EkPaMWNM.mjs → betterAuthOpenApi-C5lDyRH2.mjs} +1 -1
- package/dist/cache/index.d.mts +2 -2
- package/dist/cache/index.mjs +1 -1
- package/dist/cli/commands/docs.mjs +2 -2
- package/dist/cli/commands/generate.mjs +1 -1
- package/dist/cli/commands/introspect.mjs +1 -1
- package/dist/core/index.d.mts +2 -2
- package/dist/core/index.mjs +4 -3
- package/dist/core-CrLDuqoT.mjs +34 -0
- package/dist/{core-B_zEeA2b.mjs → createActionRouter-Df1BuawX.mjs} +88 -52
- package/dist/{createApp-D7e77m8C.mjs → createApp-p2OThysU.mjs} +10 -10
- package/dist/{defineResource-BW2dMCu9.mjs → defineResource-CqeUltrW.mjs} +91 -8
- package/dist/docs/index.d.mts +2 -2
- package/dist/docs/index.mjs +1 -1
- package/dist/dynamic/index.d.mts +2 -2
- package/dist/dynamic/index.mjs +1 -1
- package/dist/{elevation-By_p2lnn.mjs → elevation-BBGFjzIP.mjs} +1 -1
- package/dist/{errorHandler-CH8wk1eD.mjs → errorHandler-Cw34h_om.mjs} +1 -1
- package/dist/{errorHandler-pCpEtNd7.d.mts → errorHandler-DJ7OAB2V.d.mts} +1 -1
- package/dist/{eventPlugin-CdvUoUna.d.mts → eventPlugin-Cdjwo0Gv.d.mts} +1 -1
- package/dist/{eventPlugin-B6U_nCFU.mjs → eventPlugin-XijlQmlL.mjs} +19 -1
- package/dist/events/index.d.mts +399 -28
- package/dist/events/index.mjs +345 -29
- package/dist/events/transports/redis-stream-entry.d.mts +1 -1
- package/dist/events/transports/redis.d.mts +1 -1
- package/dist/factory/index.d.mts +1 -1
- package/dist/factory/index.mjs +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/idempotency/index.d.mts +3 -3
- package/dist/idempotency/mongodb.d.mts +1 -1
- package/dist/idempotency/redis.d.mts +1 -1
- package/dist/{index-C9eYNjGR.d.mts → index-0zj73o2U.d.mts} +1 -1
- package/dist/{index-B0extFr4.d.mts → index-CBru2y5Y.d.mts} +3 -3
- package/dist/{index-BjShrzoj.d.mts → index-DadoLP51.d.mts} +48 -16
- package/dist/index.d.mts +8 -8
- package/dist/index.mjs +8 -8
- package/dist/integrations/event-gateway.d.mts +1 -1
- package/dist/integrations/event-gateway.mjs +1 -1
- package/dist/integrations/index.d.mts +1 -1
- package/dist/integrations/mcp/index.d.mts +2 -2
- package/dist/integrations/mcp/index.mjs +1 -1
- package/dist/integrations/mcp/testing.d.mts +1 -1
- package/dist/integrations/mcp/testing.mjs +1 -1
- package/dist/{interface-B91alUzq.d.mts → interface-CS6d7HiB.d.mts} +693 -110
- package/dist/{mongodb-Cgu9F1Nd.d.mts → mongodb-B1eVtFhw.d.mts} +1 -1
- package/dist/{mongodb-B7zupyck.d.mts → mongodb-NShVZDMr.d.mts} +1 -1
- package/dist/{openapi-D7Z7VODz.mjs → openapi-q6rNKfZy.mjs} +49 -2
- package/dist/org/index.d.mts +2 -2
- package/dist/permissions/index.d.mts +3 -3
- package/dist/plugins/index.d.mts +4 -4
- package/dist/plugins/index.mjs +9 -9
- package/dist/plugins/tracing-entry.d.mts +1 -1
- package/dist/plugins/tracing-entry.mjs +1 -1
- package/dist/policies/index.d.mts +1 -1
- package/dist/presets/index.d.mts +3 -3
- package/dist/presets/multiTenant.d.mts +1 -1
- package/dist/{queryCachePlugin-Ckl71mkc.d.mts → queryCachePlugin-BCFVXnxK.d.mts} +1 -1
- package/dist/{redis-3TQxm2VZ.d.mts → redis-Bunu3qWg.d.mts} +1 -1
- package/dist/{redis-stream-Dag5LFa9.d.mts → redis-stream-BgrYzpeq.d.mts} +1 -1
- package/dist/registry/index.d.mts +1 -1
- package/dist/registry/index.mjs +2 -2
- package/dist/{resourceToTools-BJkoQoUP.mjs → resourceToTools-DNNWnZtx.mjs} +194 -64
- package/dist/rpc/index.d.mts +1 -1
- package/dist/rpc/index.mjs +1 -1
- package/dist/scope/index.d.mts +2 -2
- package/dist/scope/index.mjs +1 -1
- package/dist/{sse-6W0hjVS_.mjs → sse-CD5Hghpu.mjs} +1 -1
- package/dist/testing/index.d.mts +2 -2
- package/dist/testing/index.mjs +1 -1
- package/dist/types/index.d.mts +5 -5
- package/dist/{types-CKB47kiu.d.mts → types-BlOuKTPw.d.mts} +9 -9
- package/dist/{types-B4BNthET.d.mts → types-BoaZHr-2.d.mts} +1 -1
- package/dist/{types-C5g2oRC7.d.mts → types-D3b7hA00.d.mts} +1 -1
- package/dist/utils/index.d.mts +4 -16
- package/dist/utils/index.mjs +5 -5
- package/dist/{utils-B-l6410F.mjs → utils-7sJ8X83I.mjs} +1 -13
- package/package.json +6 -5
- package/skills/arc/SKILL.md +23 -4
- package/skills/arc/references/integrations.md +1 -1
- package/skills/arc/references/mcp.md +2 -0
- /package/dist/{HookSystem-BNYKnrXF.mjs → HookSystem-BjFu7zf1.mjs} +0 -0
- /package/dist/{caching-5DtLwIqb.mjs → caching-CHH-iHs3.mjs} +0 -0
- /package/dist/{circuitBreaker-BBPDt-J_.d.mts → circuitBreaker-BGVoB1hD.d.mts} +0 -0
- /package/dist/{circuitBreaker-l18oRgL5.mjs → circuitBreaker-cmi5XDv5.mjs} +0 -0
- /package/dist/{elevation-D7WK0RXq.d.mts → elevation-UJO3-NvX.d.mts} +0 -0
- /package/dist/{errors-Cg58SLNi.mjs → errors-BF2bIOIS.mjs} +0 -0
- /package/dist/{errors-BS6lZvWy.d.mts → errors-BI8kEKsO.d.mts} +0 -0
- /package/dist/{externalPaths-iba7jD3d.d.mts → externalPaths-BQ8QijNH.d.mts} +0 -0
- /package/dist/{fields-D4nMDqnK.d.mts → fields-DoeDgh2b.d.mts} +0 -0
- /package/dist/{interface-CSbZdv_3.d.mts → interface-CkkWm5uR.d.mts} +0 -0
- /package/dist/{interface-CG7oRZjX.d.mts → interface-bpoLKKqx.d.mts} +0 -0
- /package/dist/{logger-DLg8-Ueg.mjs → logger-CDjpjySd.mjs} +0 -0
- /package/dist/{metrics-Qnvwc-LQ.mjs → metrics-DuhiSEZI.mjs} +0 -0
- /package/dist/{mongodb-B7X7P1P8.mjs → mongodb-5Ff3w8jy.mjs} +0 -0
- /package/dist/{pluralize-Dckfq6US.mjs → pluralize-BneOJkpi.mjs} +0 -0
- /package/dist/{queryCachePlugin-CwTpR04-.mjs → queryCachePlugin-D0iIVhW_.mjs} +0 -0
- /package/dist/{registry-B3lRFBWo.mjs → registry-B0Wl7uVV.mjs} +0 -0
- /package/dist/{replyHelpers-uDUIYh7u.mjs → replyHelpers-CXtJDAZ0.mjs} +0 -0
- /package/dist/{requestContext-xHIKedG6.mjs → requestContext-DYvHl113.mjs} +0 -0
- /package/dist/{schemaConverter-Y5EejTnJ.mjs → schemaConverter-OxfCshus.mjs} +0 -0
- /package/dist/{sessionManager-CEo9jwPI.d.mts → sessionManager-BkzVU8h2.d.mts} +0 -0
- /package/dist/{tracing-DEqdGkr-.d.mts → tracing-xqXzWeaf.d.mts} +0 -0
- /package/dist/{types--D3vvfdt.d.mts → types-CN6JvmYz.d.mts} +0 -0
- /package/dist/{versioning-CdBbFefk.mjs → versioning-CPU_5Xfs.mjs} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as ElevationOptions } from "./elevation-
|
|
3
|
-
import { t as ExternalOpenApiPaths } from "./externalPaths-
|
|
4
|
-
import { i as CacheStore } from "./interface-
|
|
5
|
-
import { r as QueryCachePluginOptions } from "./queryCachePlugin-
|
|
6
|
-
import { i as EventTransport } from "./EventTransport-
|
|
7
|
-
import { t as EventPluginOptions } from "./eventPlugin-
|
|
8
|
-
import { c as MetricsOptions, d as SSEOptions, m as CachingOptions, r as VersioningOptions, t as ErrorHandlerOptions } from "./errorHandler-
|
|
9
|
-
import { r as IdempotencyStore } from "./interface-
|
|
1
|
+
import { x as Authenticator } from "./interface-CS6d7HiB.mjs";
|
|
2
|
+
import { n as ElevationOptions } from "./elevation-UJO3-NvX.mjs";
|
|
3
|
+
import { t as ExternalOpenApiPaths } from "./externalPaths-BQ8QijNH.mjs";
|
|
4
|
+
import { i as CacheStore } from "./interface-bpoLKKqx.mjs";
|
|
5
|
+
import { r as QueryCachePluginOptions } from "./queryCachePlugin-BCFVXnxK.mjs";
|
|
6
|
+
import { i as EventTransport } from "./EventTransport-CLXJUzyT.mjs";
|
|
7
|
+
import { t as EventPluginOptions } from "./eventPlugin-Cdjwo0Gv.mjs";
|
|
8
|
+
import { c as MetricsOptions, d as SSEOptions, m as CachingOptions, r as VersioningOptions, t as ErrorHandlerOptions } from "./errorHandler-DJ7OAB2V.mjs";
|
|
9
|
+
import { r as IdempotencyStore } from "./interface-CkkWm5uR.mjs";
|
|
10
10
|
import { FastifyInstance, FastifyPluginAsync, FastifyReply, FastifyRequest, FastifyServerOptions } from "fastify";
|
|
11
11
|
|
|
12
12
|
//#region src/factory/loadResources.d.ts
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as NotFoundError, c as RateLimitError, d as ValidationError, 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-
|
|
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-
|
|
1
|
+
import { Y as OpenApiSchemas, Z as ParsedQuery, m as AnyRecord, nt as QueryParserInterface } from "../interface-CS6d7HiB.mjs";
|
|
2
|
+
import { a as NotFoundError, c as RateLimitError, d as ValidationError, 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-BGVoB1hD.mjs";
|
|
4
4
|
import { FastifyInstance } from "fastify";
|
|
5
5
|
|
|
6
6
|
//#region src/utils/compensation.d.ts
|
|
@@ -235,20 +235,12 @@ declare function wrapResponse(dataSchema: JsonSchema): JsonSchema;
|
|
|
235
235
|
* Note: Uses 'docs' array (not 'data') with flat pagination fields
|
|
236
236
|
*/
|
|
237
237
|
declare function listResponse(itemSchema: JsonSchema): JsonSchema;
|
|
238
|
-
/**
|
|
239
|
-
* Alias for listResponse - matches local responseSchemas.js naming
|
|
240
|
-
*/
|
|
241
|
-
declare const paginateWrapper: typeof listResponse;
|
|
242
238
|
/**
|
|
243
239
|
* Create a single item response schema
|
|
244
240
|
*
|
|
245
241
|
* Runtime format: { success, data: {...} }
|
|
246
242
|
*/
|
|
247
243
|
declare function itemResponse(itemSchema: JsonSchema): JsonSchema;
|
|
248
|
-
/**
|
|
249
|
-
* Alias for itemResponse - matches local responseSchemas.js naming
|
|
250
|
-
*/
|
|
251
|
-
declare const itemWrapper: typeof itemResponse;
|
|
252
244
|
/**
|
|
253
245
|
* Create a create/update response schema
|
|
254
246
|
*/
|
|
@@ -259,10 +251,6 @@ declare function mutationResponse(itemSchema: JsonSchema): JsonSchema;
|
|
|
259
251
|
* Runtime format: { success, data: { message, id?, soft? } }
|
|
260
252
|
*/
|
|
261
253
|
declare function deleteResponse(): JsonSchema;
|
|
262
|
-
/**
|
|
263
|
-
* Alias for deleteResponse - matches local responseSchemas.js naming
|
|
264
|
-
*/
|
|
265
|
-
declare const messageWrapper: typeof deleteResponse;
|
|
266
254
|
declare const responses: {
|
|
267
255
|
200: (schema: JsonSchema) => {
|
|
268
256
|
description: string;
|
|
@@ -647,4 +635,4 @@ declare function hasEvents(instance: FastifyInstance): instance is FastifyInstan
|
|
|
647
635
|
events: EventsDecorator;
|
|
648
636
|
};
|
|
649
637
|
//#endregion
|
|
650
|
-
export { ArcError, ArcQueryParser, type ArcQueryParserOptions, CircuitBreaker, CircuitBreakerError, type CircuitBreakerOptions, CircuitBreakerRegistry, type CircuitBreakerStats, CircuitState, type CompensationDefinition, type CompensationError, type CompensationHooks, type CompensationResult, type CompensationStep, ConflictError, type ErrorDetails, type EventsDecorator, ForbiddenError, type JsonSchema, NotFoundError, OrgAccessDeniedError, OrgRequiredError, RateLimitError, ServiceUnavailableError, type StateMachine, type TransitionConfig, UnauthorizedError, ValidationError, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createError, createQueryParser, createStateMachine, defineCompensation, deleteResponse, errorResponseSchema, getDefaultCrudSchemas, getListQueryParams, hasEvents, isArcError, isJsonSchema, isZodSchema, itemResponse,
|
|
638
|
+
export { ArcError, ArcQueryParser, type ArcQueryParserOptions, CircuitBreaker, CircuitBreakerError, type CircuitBreakerOptions, CircuitBreakerRegistry, type CircuitBreakerStats, CircuitState, type CompensationDefinition, type CompensationError, type CompensationHooks, type CompensationResult, type CompensationStep, ConflictError, type ErrorDetails, type EventsDecorator, ForbiddenError, type JsonSchema, NotFoundError, OrgAccessDeniedError, OrgRequiredError, RateLimitError, ServiceUnavailableError, type StateMachine, type TransitionConfig, UnauthorizedError, ValidationError, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createError, createQueryParser, createStateMachine, defineCompensation, deleteResponse, errorResponseSchema, getDefaultCrudSchemas, getListQueryParams, hasEvents, isArcError, isJsonSchema, isZodSchema, itemResponse, listResponse, mutationResponse, paginationSchema, queryParams, responses, successResponseSchema, toJsonSchema, withCompensation, wrapResponse };
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as createQueryParser, t as ArcQueryParser } from "../queryParser-CgCtsjti.mjs";
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
5
|
-
import { a as
|
|
2
|
+
import { a as toJsonSchema, i as isZodSchema, n as convertRouteSchema, r as isJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-OxfCshus.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 { a as getListQueryParams, c as mutationResponse, d as responses, f as successResponseSchema, h as withCompensation, i as getDefaultCrudSchemas, l as paginationSchema, m as defineCompensation, n as deleteResponse, o as itemResponse, p as wrapResponse, r as errorResponseSchema, s as listResponse, t as createStateMachine, u as queryParams } from "../utils-7sJ8X83I.mjs";
|
|
5
|
+
import { a as OrgAccessDeniedError, c as ServiceUnavailableError, 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
6
|
import { t as hasEvents } from "../typeGuards-CcFZXgU7.mjs";
|
|
7
|
-
export { ArcError, ArcQueryParser, CircuitBreaker, CircuitBreakerError, CircuitBreakerRegistry, CircuitState, ConflictError, ForbiddenError, NotFoundError, OrgAccessDeniedError, OrgRequiredError, RateLimitError, ServiceUnavailableError, UnauthorizedError, ValidationError, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createError, createQueryParser, createStateMachine, defineCompensation, deleteResponse, errorResponseSchema, getDefaultCrudSchemas, getListQueryParams, hasEvents, isArcError, isJsonSchema, isZodSchema, itemResponse,
|
|
7
|
+
export { ArcError, ArcQueryParser, CircuitBreaker, CircuitBreakerError, CircuitBreakerRegistry, CircuitState, ConflictError, ForbiddenError, NotFoundError, OrgAccessDeniedError, OrgRequiredError, RateLimitError, ServiceUnavailableError, UnauthorizedError, ValidationError, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createError, createQueryParser, createStateMachine, defineCompensation, deleteResponse, errorResponseSchema, getDefaultCrudSchemas, getListQueryParams, hasEvents, isArcError, isJsonSchema, isZodSchema, itemResponse, listResponse, mutationResponse, paginationSchema, queryParams, responses, successResponseSchema, toJsonSchema, withCompensation, wrapResponse };
|
|
@@ -216,10 +216,6 @@ function listResponse(itemSchema) {
|
|
|
216
216
|
};
|
|
217
217
|
}
|
|
218
218
|
/**
|
|
219
|
-
* Alias for listResponse - matches local responseSchemas.js naming
|
|
220
|
-
*/
|
|
221
|
-
const paginateWrapper = listResponse;
|
|
222
|
-
/**
|
|
223
219
|
* Create a single item response schema
|
|
224
220
|
*
|
|
225
221
|
* Runtime format: { success, data: {...} }
|
|
@@ -228,10 +224,6 @@ function itemResponse(itemSchema) {
|
|
|
228
224
|
return wrapResponse(itemSchema);
|
|
229
225
|
}
|
|
230
226
|
/**
|
|
231
|
-
* Alias for itemResponse - matches local responseSchemas.js naming
|
|
232
|
-
*/
|
|
233
|
-
const itemWrapper = itemResponse;
|
|
234
|
-
/**
|
|
235
227
|
* Create a create/update response schema
|
|
236
228
|
*/
|
|
237
229
|
function mutationResponse(itemSchema) {
|
|
@@ -288,10 +280,6 @@ function deleteResponse() {
|
|
|
288
280
|
additionalProperties: true
|
|
289
281
|
};
|
|
290
282
|
}
|
|
291
|
-
/**
|
|
292
|
-
* Alias for deleteResponse - matches local responseSchemas.js naming
|
|
293
|
-
*/
|
|
294
|
-
const messageWrapper = deleteResponse;
|
|
295
283
|
const responses = {
|
|
296
284
|
200: (schema) => ({
|
|
297
285
|
description: "Successful response",
|
|
@@ -591,4 +579,4 @@ function createStateMachine(name, transitions = {}, options = {}) {
|
|
|
591
579
|
};
|
|
592
580
|
}
|
|
593
581
|
//#endregion
|
|
594
|
-
export {
|
|
582
|
+
export { getListQueryParams as a, mutationResponse as c, responses as d, successResponseSchema as f, withCompensation as h, getDefaultCrudSchemas as i, paginationSchema as l, defineCompensation as m, deleteResponse as n, itemResponse as o, wrapResponse as p, errorResponseSchema as r, listResponse as s, createStateMachine as t, queryParams as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classytic/arc",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.1",
|
|
4
4
|
"description": "Resource-oriented backend framework for Fastify — clean, minimal, powerful, tree-shakable",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -227,7 +227,7 @@
|
|
|
227
227
|
"node": ">=22"
|
|
228
228
|
},
|
|
229
229
|
"peerDependencies": {
|
|
230
|
-
"@classytic/mongokit": ">=3.
|
|
230
|
+
"@classytic/mongokit": ">=3.6.0",
|
|
231
231
|
"@classytic/streamline": ">=2.1.0",
|
|
232
232
|
"@fastify/cors": ">=11.0.0",
|
|
233
233
|
"@fastify/helmet": ">=13.0.0",
|
|
@@ -245,12 +245,12 @@
|
|
|
245
245
|
"@opentelemetry/instrumentation-mongodb": ">=0.40.0",
|
|
246
246
|
"@opentelemetry/sdk-node": ">=0.50.0",
|
|
247
247
|
"@sinclair/typebox": ">=0.34.0",
|
|
248
|
-
"better-auth": ">=1.6.
|
|
248
|
+
"better-auth": ">=1.6.2",
|
|
249
249
|
"bullmq": ">=5.0.0",
|
|
250
250
|
"fastify": ">=5.0.0",
|
|
251
251
|
"fastify-raw-body": ">=5.0.0",
|
|
252
252
|
"ioredis": ">=5.0.0",
|
|
253
|
-
"mongodb": ">=
|
|
253
|
+
"mongodb": ">=7.0.0",
|
|
254
254
|
"mongoose": ">=9.4.1",
|
|
255
255
|
"pino-pretty": ">=13.0.0",
|
|
256
256
|
"zod": ">=4.0.0"
|
|
@@ -346,7 +346,8 @@
|
|
|
346
346
|
"devDependencies": {
|
|
347
347
|
"@better-auth/mongo-adapter": "^1.6.0",
|
|
348
348
|
"@biomejs/biome": "^2.4.10",
|
|
349
|
-
"
|
|
349
|
+
"ajv": "^8.18.0",
|
|
350
|
+
"@classytic/mongokit": "file:../../packages/mongokit/classytic-mongokit-3.6.0.tgz",
|
|
350
351
|
"@classytic/streamline": "^2.1.0",
|
|
351
352
|
"@fastify/cors": "^11.2.0",
|
|
352
353
|
"@fastify/helmet": "^13.0.2",
|
package/skills/arc/SKILL.md
CHANGED
|
@@ -8,11 +8,11 @@ description: |
|
|
|
8
8
|
Triggers: arc, fastify resource, defineResource, createApp, BaseController, arc preset,
|
|
9
9
|
arc auth, arc events, arc jobs, arc websocket, arc mcp, arc plugin, arc testing, arc cli,
|
|
10
10
|
arc permissions, arc hooks, arc pipeline, arc factory, arc cache, arc QueryCache.
|
|
11
|
-
version: 2.
|
|
11
|
+
version: 2.8.0
|
|
12
12
|
license: MIT
|
|
13
13
|
metadata:
|
|
14
14
|
author: Classytic
|
|
15
|
-
version: "2.
|
|
15
|
+
version: "2.8.0"
|
|
16
16
|
tags:
|
|
17
17
|
- fastify
|
|
18
18
|
- rest-api
|
|
@@ -91,6 +91,23 @@ const productResource = defineResource({
|
|
|
91
91
|
additionalRoutes: [
|
|
92
92
|
{ method: 'GET', path: '/featured', handler: 'getFeatured', permissions: allowPublic(), wrapHandler: true },
|
|
93
93
|
],
|
|
94
|
+
|
|
95
|
+
// v2.8: routes (replaces additionalRoutes — additionalRoutes still works but is deprecated)
|
|
96
|
+
routes: [
|
|
97
|
+
{ method: 'GET', path: '/stats', handler: 'getStats', permissions: auth() },
|
|
98
|
+
{ method: 'POST', path: '/webhook', handler: webhookFn, raw: true, permissions: auth() },
|
|
99
|
+
],
|
|
100
|
+
|
|
101
|
+
// v2.8: actions (replaces onRegister + createActionRouter)
|
|
102
|
+
actions: {
|
|
103
|
+
approve: async (id, data, req) => service.approve(id, req.user._id),
|
|
104
|
+
cancel: {
|
|
105
|
+
handler: async (id, data, req) => service.cancel(id, data.reason, req.user._id),
|
|
106
|
+
permissions: roles('admin'),
|
|
107
|
+
schema: { reason: { type: 'string' } },
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
actionPermissions: auth(),
|
|
94
111
|
});
|
|
95
112
|
|
|
96
113
|
await fastify.register(productResource.toPlugin());
|
|
@@ -867,7 +884,8 @@ permissions: {
|
|
|
867
884
|
**DX helpers:**
|
|
868
885
|
|
|
869
886
|
```typescript
|
|
870
|
-
// Typed request for
|
|
887
|
+
// Typed request for raw routes — no more (req as any).user
|
|
888
|
+
// v2.8: `raw: true` replaces `wrapHandler: false` (wrapHandler still works but is deprecated)
|
|
871
889
|
import type { ArcRequest } from '@classytic/arc';
|
|
872
890
|
handler: async (req: ArcRequest, reply) => { req.user?.id; req.scope; req.signal; }
|
|
873
891
|
|
|
@@ -884,6 +902,7 @@ import { createDomainError } from '@classytic/arc';
|
|
|
884
902
|
throw createDomainError('SELF_REFERRAL', 'Cannot refer yourself', 422);
|
|
885
903
|
|
|
886
904
|
// Resource lifecycle hook — wire singletons during registration
|
|
905
|
+
// v2.8: for action routes, use `actions` config instead of onRegister + createActionRouter
|
|
887
906
|
defineResource({ name: 'notification', onRegister: (f) => setSseManager(f.sseManager) });
|
|
888
907
|
|
|
889
908
|
// SSE auth — preAuth runs BEFORE auth middleware (EventSource can't set headers)
|
|
@@ -893,7 +912,7 @@ additionalRoutes: [{ preAuth: [(req) => { req.headers.authorization = `Bearer ${
|
|
|
893
912
|
additionalRoutes: [{ streamResponse: true, handler: async (req, reply) => reply.send(stream) }]
|
|
894
913
|
```
|
|
895
914
|
|
|
896
|
-
## DX Helpers (v2.7.3)
|
|
915
|
+
## DX Helpers (v2.7.3+)
|
|
897
916
|
|
|
898
917
|
**Reply helpers** — consistent response envelopes (opt-in via `createApp({ replyHelpers: true })`):
|
|
899
918
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Pluggable adapters for BullMQ jobs, WebSocket real-time, Streamline workflows, and MCP tools.
|
|
4
4
|
All are separate subpath imports — only loaded when explicitly used.
|
|
5
5
|
|
|
6
|
-
> **MCP** has its own dedicated reference: [mcp.md](mcp.md) — auto-generate tools from resources, custom tools, Better Auth OAuth 2.1.
|
|
6
|
+
> **MCP** has its own dedicated reference: [mcp.md](mcp.md) — auto-generate tools from resources (including actions, v2.8), custom tools, Better Auth OAuth 2.1.
|
|
7
7
|
|
|
8
8
|
## Job Queue (BullMQ)
|
|
9
9
|
|
|
@@ -46,6 +46,8 @@ await app.register(mcpPlugin, {
|
|
|
46
46
|
|
|
47
47
|
Per resource, generates up to 5 tools: `list_{plural}`, `get_{name}`, `create_{name}`, `update_{name}`, `delete_{name}`.
|
|
48
48
|
|
|
49
|
+
Resource `actions` (v2.8) also auto-generate MCP tools — each action becomes a tool named `{action}_{name}` with the action's input schema.
|
|
50
|
+
|
|
49
51
|
Tool handlers call `BaseController` — same pipeline as REST (auth, org-scoping, hooks, field permissions, cache).
|
|
50
52
|
|
|
51
53
|
### McpPluginOptions
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|