@classytic/arc 2.4.2 → 2.4.3
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/auth/index.mjs +1 -1
- package/dist/cache/index.mjs +2 -2
- package/dist/cli/commands/describe.d.mts +1 -1
- package/dist/cli/commands/describe.mjs +1 -1
- package/dist/cli/commands/generate.d.mts +1 -1
- package/dist/cli/commands/generate.mjs +1 -1
- package/dist/cli/commands/init.d.mts +1 -1
- package/dist/cli/commands/init.mjs +1 -1
- package/dist/cli/commands/introspect.d.mts +1 -1
- package/dist/cli/commands/introspect.mjs +1 -1
- package/dist/cli/index.d.mts +4 -4
- package/dist/cli/index.mjs +4 -4
- package/dist/core/index.mjs +1 -1
- package/dist/{createApp-ByWNRsZj.mjs → createApp-CBgVaFyh.mjs} +3 -3
- package/dist/{defineResource-D9aY5Cy6.mjs → defineResource-B22gcNvn.mjs} +1 -1
- package/dist/discovery/index.d.mts +1 -1
- package/dist/discovery/index.mjs +1 -1
- package/dist/dynamic/index.mjs +2 -2
- package/dist/{errorHandler--zp54tGc.mjs → errorHandler-DMbGdzBG.mjs} +4 -4
- package/dist/events/transports/redis.d.mts +1 -1
- package/dist/events/transports/redis.mjs +1 -1
- package/dist/factory/index.mjs +1 -1
- package/dist/index.mjs +3 -3
- package/dist/integrations/event-gateway.d.mts +1 -1
- package/dist/integrations/event-gateway.mjs +1 -1
- package/dist/integrations/jobs.d.mts +1 -1
- package/dist/integrations/jobs.mjs +1 -1
- package/dist/integrations/streamline.d.mts +1 -1
- package/dist/integrations/streamline.mjs +1 -1
- package/dist/integrations/websocket-redis.d.mts +1 -1
- package/dist/integrations/websocket-redis.mjs +1 -1
- package/dist/integrations/websocket.d.mts +1 -1
- package/dist/integrations/websocket.mjs +1 -1
- package/dist/{memory-Cb_7iy9e.mjs → memory-BFAYkf8H.mjs} +1 -4
- package/dist/permissions/index.mjs +1 -1
- package/dist/{permissions-CA5zg0yK.mjs → permissions-Jk5x3sxz.mjs} +1 -1
- package/dist/plugins/index.mjs +1 -1
- package/dist/plugins/response-cache.d.mts +1 -1
- package/dist/plugins/response-cache.mjs +1 -1
- package/dist/plugins/tracing-entry.mjs +1 -1
- package/dist/presets/index.d.mts +1 -1
- package/dist/presets/index.mjs +2 -2
- package/dist/presets/multiTenant.d.mts +1 -1
- package/dist/presets/multiTenant.mjs +1 -1
- package/dist/{presets-C9QXJV1u.mjs → presets-OMPaHMTY.mjs} +2 -2
- package/dist/{queryCachePlugin-ClosZdNS.mjs → queryCachePlugin-XtFplYO9.mjs} +1 -1
- package/dist/testing/index.mjs +1 -1
- package/package.json +4 -3
- package/skills/arc/SKILL.md +11 -4
package/dist/auth/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as normalizeRoles, t as getUserRoles } from "../types-ZUu_h0jp.mjs";
|
|
2
2
|
import { t as ArcError } from "../errors-rxhfP7Hf.mjs";
|
|
3
|
-
import { c as requireOrgMembership, f as requireTeamMembership, l as requireOrgRole } from "../permissions-
|
|
3
|
+
import { c as requireOrgMembership, f as requireTeamMembership, l as requireOrgRole } from "../permissions-Jk5x3sxz.mjs";
|
|
4
4
|
import { n as extractBetterAuthOpenApi } from "../betterAuthOpenApi-lz0IRbXJ.mjs";
|
|
5
5
|
import { createHmac, randomUUID, timingSafeEqual } from "node:crypto";
|
|
6
6
|
import fp from "fastify-plugin";
|
package/dist/cache/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as versionKey, n as hashParams, r as tagVersionKey, t as buildQueryKey } from "../keys-qcD-TVJl.mjs";
|
|
2
|
-
import { t as MemoryCacheStore } from "../memory-
|
|
3
|
-
import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-
|
|
2
|
+
import { t as MemoryCacheStore } from "../memory-BFAYkf8H.mjs";
|
|
3
|
+
import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-XtFplYO9.mjs";
|
|
4
4
|
//#region src/cache/redis.ts
|
|
5
5
|
/**
|
|
6
6
|
* Redis-backed cache store.
|
package/dist/cli/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import describe from "./commands/describe.mjs";
|
|
1
|
+
import { describe } from "./commands/describe.mjs";
|
|
2
2
|
import { exportDocs } from "./commands/docs.mjs";
|
|
3
3
|
import { doctor } from "./commands/doctor.mjs";
|
|
4
|
-
import generate from "./commands/generate.mjs";
|
|
5
|
-
import init from "./commands/init.mjs";
|
|
6
|
-
import introspect from "./commands/introspect.mjs";
|
|
4
|
+
import { generate } from "./commands/generate.mjs";
|
|
5
|
+
import { init } from "./commands/init.mjs";
|
|
6
|
+
import { introspect } from "./commands/introspect.mjs";
|
|
7
7
|
export { describe, doctor, exportDocs, generate, init, introspect };
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import describe from "./commands/describe.mjs";
|
|
1
|
+
import { describe } from "./commands/describe.mjs";
|
|
2
2
|
import { exportDocs } from "./commands/docs.mjs";
|
|
3
3
|
import { doctor } from "./commands/doctor.mjs";
|
|
4
|
-
import generate from "./commands/generate.mjs";
|
|
5
|
-
import init from "./commands/init.mjs";
|
|
6
|
-
import introspect from "./commands/introspect.mjs";
|
|
4
|
+
import { generate } from "./commands/generate.mjs";
|
|
5
|
+
import { init } from "./commands/init.mjs";
|
|
6
|
+
import { introspect } from "./commands/introspect.mjs";
|
|
7
7
|
export { describe, doctor, exportDocs, generate, init, introspect };
|
package/dist/core/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as DEFAULT_SORT, c as HOOK_OPERATIONS, d as MAX_REGEX_LENGTH, f as MAX_SEARCH_LENGTH, h as SYSTEM_FIELDS, i as DEFAULT_MAX_LIMIT, l as HOOK_PHASES, m as RESERVED_QUERY_PARAMS, n as DEFAULT_ID_FIELD, o as DEFAULT_TENANT_FIELD, p as MUTATION_OPERATIONS, r as DEFAULT_LIMIT, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS, u as MAX_FILTER_DEPTH } from "../constants-Cxde4rpC.mjs";
|
|
2
2
|
import { i as AccessControl, n as QueryResolver, r as BodySanitizer, t as BaseController } from "../BaseController-CkM5dUh_.mjs";
|
|
3
3
|
import { t as createActionRouter } from "../core-C1XCMtqM.mjs";
|
|
4
|
-
import { c as createCrudHandlers, d as getControllerContext, f as getControllerScope, l as createFastifyHandler, n as defineResource, o as createCrudRouter, p as sendControllerResponse, s as createPermissionMiddleware, t as ResourceDefinition, u as createRequestContext } from "../defineResource-
|
|
4
|
+
import { c as createCrudHandlers, d as getControllerContext, f as getControllerScope, l as createFastifyHandler, n as defineResource, o as createCrudRouter, p as sendControllerResponse, s as createPermissionMiddleware, t as ResourceDefinition, u as createRequestContext } from "../defineResource-B22gcNvn.mjs";
|
|
5
5
|
export { AccessControl, BaseController, BodySanitizer, CRUD_OPERATIONS, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, HOOK_OPERATIONS, HOOK_PHASES, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, QueryResolver, RESERVED_QUERY_PARAMS, ResourceDefinition, SYSTEM_FIELDS, createActionRouter, createCrudHandlers, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineResource, getControllerContext, getControllerScope, sendControllerResponse };
|
|
@@ -458,9 +458,9 @@ async function createApp(options) {
|
|
|
458
458
|
fastify.log.debug("Arc caching plugin enabled");
|
|
459
459
|
}
|
|
460
460
|
if (config.arcPlugins?.queryCache) {
|
|
461
|
-
const { queryCachePlugin } = await import("./queryCachePlugin-
|
|
461
|
+
const { queryCachePlugin } = await import("./queryCachePlugin-XtFplYO9.mjs").then((n) => n.n);
|
|
462
462
|
const qcOpts = config.arcPlugins.queryCache === true ? {} : config.arcPlugins.queryCache;
|
|
463
|
-
const store = options.stores?.queryCache ?? new (await (import("./memory-
|
|
463
|
+
const store = options.stores?.queryCache ?? new (await (import("./memory-BFAYkf8H.mjs").then((n) => n.n))).MemoryCacheStore();
|
|
464
464
|
await fastify.register(queryCachePlugin, {
|
|
465
465
|
store,
|
|
466
466
|
...qcOpts
|
|
@@ -557,7 +557,7 @@ async function createApp(options) {
|
|
|
557
557
|
fastify.log.debug("Elevation plugin enabled");
|
|
558
558
|
}
|
|
559
559
|
if (config.errorHandler !== false) {
|
|
560
|
-
const { errorHandlerPlugin } = await import("./errorHandler
|
|
560
|
+
const { errorHandlerPlugin } = await import("./errorHandler-DMbGdzBG.mjs").then((n) => n.n);
|
|
561
561
|
const errorOpts = typeof config.errorHandler === "object" ? config.errorHandler : { includeStack: config.preset !== "production" };
|
|
562
562
|
await fastify.register(errorHandlerPlugin, errorOpts);
|
|
563
563
|
trackPlugin("arc-error-handler", errorOpts);
|
|
@@ -8,7 +8,7 @@ import { i as getDefaultCrudSchemas } from "./utils-Dc0WhlIl.mjs";
|
|
|
8
8
|
import { r as ForbiddenError } from "./errors-rxhfP7Hf.mjs";
|
|
9
9
|
import { n as convertRouteSchema, t as convertOpenApiSchemas } from "./schemaConverter-DjzHpFam.mjs";
|
|
10
10
|
import { t as hasEvents } from "./typeGuards-Cj5Rgvlg.mjs";
|
|
11
|
-
import { r as getAvailablePresets, t as applyPresets } from "./presets-
|
|
11
|
+
import { r as getAvailablePresets, t as applyPresets } from "./presets-OMPaHMTY.mjs";
|
|
12
12
|
//#region src/pipeline/pipe.ts
|
|
13
13
|
/**
|
|
14
14
|
* Compose pipeline steps into an ordered array.
|
|
@@ -43,4 +43,4 @@ declare function discoverResources(options: DiscoveryOptions): Promise<Array<{
|
|
|
43
43
|
/** Auto-discovery plugin for Arc resources */
|
|
44
44
|
declare const discoveryPlugin: FastifyPluginAsync<DiscoveryPluginOptions>;
|
|
45
45
|
//#endregion
|
|
46
|
-
export { DiscoverableResource, DiscoveryOptions, DiscoveryPluginOptions,
|
|
46
|
+
export { DiscoverableResource, DiscoveryOptions, DiscoveryPluginOptions, discoverResources, discoveryPlugin };
|
package/dist/discovery/index.mjs
CHANGED
|
@@ -138,4 +138,4 @@ const discoveryPluginImpl = async (fastify, options) => {
|
|
|
138
138
|
/** Auto-discovery plugin for Arc resources */
|
|
139
139
|
const discoveryPlugin = discoveryPluginImpl;
|
|
140
140
|
//#endregion
|
|
141
|
-
export {
|
|
141
|
+
export { discoverResources, discoveryPlugin };
|
package/dist/dynamic/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as ArcQueryParser } from "../queryParser-CgCtsjti.mjs";
|
|
2
|
-
import { n as defineResource } from "../defineResource-
|
|
3
|
-
import { _ as ownerWithAdminBypass, b as publicReadAdminWrite, g as fullPublic, h as authenticated, m as adminOnly, x as readOnly, y as publicRead } from "../permissions-
|
|
2
|
+
import { n as defineResource } from "../defineResource-B22gcNvn.mjs";
|
|
3
|
+
import { _ as ownerWithAdminBypass, b as publicReadAdminWrite, g as fullPublic, h as authenticated, m as adminOnly, x as readOnly, y as publicRead } from "../permissions-Jk5x3sxz.mjs";
|
|
4
4
|
//#region src/dynamic/ArcDynamicLoader.ts
|
|
5
5
|
const VALID_FIELD_TYPES = new Set([
|
|
6
6
|
"string",
|
|
@@ -2,10 +2,7 @@ import { t as __exportAll } from "./chunk-BpYLSNr0.mjs";
|
|
|
2
2
|
import { f as isArcError } from "./errors-rxhfP7Hf.mjs";
|
|
3
3
|
import fp from "fastify-plugin";
|
|
4
4
|
//#region src/plugins/errorHandler.ts
|
|
5
|
-
var errorHandler_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
-
default: () => errorHandlerPlugin,
|
|
7
|
-
errorHandlerPlugin: () => errorHandlerPlugin
|
|
8
|
-
});
|
|
5
|
+
var errorHandler_exports = /* @__PURE__ */ __exportAll({ errorHandlerPlugin: () => errorHandlerPlugin });
|
|
9
6
|
async function errorHandlerPluginFn(fastify, options = {}) {
|
|
10
7
|
const isProduction = process.env.NODE_ENV === "production";
|
|
11
8
|
const { includeStack = !isProduction, onError, errorMap = {} } = options;
|
|
@@ -42,6 +39,9 @@ async function errorHandlerPluginFn(fastify, options = {}) {
|
|
|
42
39
|
} else if ("statusCode" in error && typeof error.statusCode === "number") {
|
|
43
40
|
statusCode = error.statusCode;
|
|
44
41
|
response.code = statusCodeToCode(statusCode);
|
|
42
|
+
} else if ("status" in error && typeof error.status === "number") {
|
|
43
|
+
statusCode = error.status;
|
|
44
|
+
response.code = statusCodeToCode(statusCode);
|
|
45
45
|
} else if (error.name && errorMap[error.name]) {
|
|
46
46
|
const mapping = errorMap[error.name];
|
|
47
47
|
statusCode = mapping.statusCode;
|
|
@@ -73,4 +73,4 @@ declare class RedisEventTransport implements EventTransport {
|
|
|
73
73
|
private isGlob;
|
|
74
74
|
}
|
|
75
75
|
//#endregion
|
|
76
|
-
export { RedisEventTransport,
|
|
76
|
+
export { RedisEventTransport, RedisEventTransportOptions, RedisLike };
|
package/dist/factory/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getPreset, i as developmentPreset, n as createApp, o as productionPreset, s as testingPreset, t as ArcFactory } from "../createApp-
|
|
1
|
+
import { a as getPreset, i as developmentPreset, n as createApp, o as productionPreset, s as testingPreset, t as ArcFactory } from "../createApp-CBgVaFyh.mjs";
|
|
2
2
|
//#region src/factory/edge.ts
|
|
3
3
|
/**
|
|
4
4
|
* Convert a Fastify app into a Web Standards fetch handler.
|
package/dist/index.mjs
CHANGED
|
@@ -4,8 +4,8 @@ import { t as BaseController } from "./BaseController-CkM5dUh_.mjs";
|
|
|
4
4
|
import { n as applyFieldWritePermissions, r as fields, t as applyFieldReadPermissions } from "./fields-ipsbIRPK.mjs";
|
|
5
5
|
import { t as requestContext } from "./requestContext-DYtmNpm5.mjs";
|
|
6
6
|
import { i as NotFoundError, l as UnauthorizedError, r as ForbiddenError, t as ArcError, u as ValidationError } from "./errors-rxhfP7Hf.mjs";
|
|
7
|
-
import { a as validateResourceConfig, f as getControllerScope, i as formatValidationErrors, m as pipe, n as defineResource, r as assertValidConfig, t as ResourceDefinition } from "./defineResource-
|
|
8
|
-
import { _ as ownerWithAdminBypass, a as createOrgPermissions, b as publicReadAdminWrite, c as requireOrgMembership, d as requireRoles, f as requireTeamMembership, g as fullPublic, h as authenticated, i as createDynamicPermissionMatrix, l as requireOrgRole, m as adminOnly, n as allowPublic, o as denyAll, p as when, r as anyOf, s as requireAuth, t as allOf, u as requireOwnership, v as presets_exports, x as readOnly, y as publicRead } from "./permissions-
|
|
7
|
+
import { a as validateResourceConfig, f as getControllerScope, i as formatValidationErrors, m as pipe, n as defineResource, r as assertValidConfig, t as ResourceDefinition } from "./defineResource-B22gcNvn.mjs";
|
|
8
|
+
import { _ as ownerWithAdminBypass, a as createOrgPermissions, b as publicReadAdminWrite, c as requireOrgMembership, d as requireRoles, f as requireTeamMembership, g as fullPublic, h as authenticated, i as createDynamicPermissionMatrix, l as requireOrgRole, m as adminOnly, n as allowPublic, o as denyAll, p as when, r as anyOf, s as requireAuth, t as allOf, u as requireOwnership, v as presets_exports, x as readOnly, y as publicRead } from "./permissions-Jk5x3sxz.mjs";
|
|
9
9
|
import { n as configureArcLogger, t as arcLog } from "./logger-Dz3j1ItV.mjs";
|
|
10
10
|
//#region src/middleware/middleware.ts
|
|
11
11
|
/**
|
|
@@ -126,6 +126,6 @@ function transform(name, handlerOrOptions) {
|
|
|
126
126
|
}
|
|
127
127
|
//#endregion
|
|
128
128
|
//#region src/index.ts
|
|
129
|
-
const version = "2.4.
|
|
129
|
+
const version = "2.4.3";
|
|
130
130
|
//#endregion
|
|
131
131
|
export { ArcError, BaseController, 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, MongooseAdapter, NotFoundError, PrismaAdapter, RESERVED_QUERY_PARAMS, ResourceDefinition, SYSTEM_FIELDS, UnauthorizedError, ValidationError, adminOnly, allOf, allowPublic, anyOf, applyFieldReadPermissions, applyFieldWritePermissions, arcLog, assertValidConfig, authenticated, configureArcLogger, createDynamicPermissionMatrix, createMongooseAdapter, createOrgPermissions, createPrismaAdapter, defineResource, denyAll, fields, formatValidationErrors, fullPublic, getControllerScope, guard, intercept, middleware, ownerWithAdminBypass, presets_exports as permissions, pipe, publicRead, publicReadAdminWrite, readOnly, requestContext, requireAuth, requireOrgMembership, requireOrgRole, requireOwnership, requireRoles, requireTeamMembership, sortMiddlewares, transform, validateResourceConfig, version, when };
|
|
@@ -43,4 +43,4 @@ interface EventGatewayOptions {
|
|
|
43
43
|
}
|
|
44
44
|
declare const eventGatewayPlugin: FastifyPluginAsync<EventGatewayOptions>;
|
|
45
45
|
//#endregion
|
|
46
|
-
export { EventGatewayOptions, eventGatewayPlugin
|
|
46
|
+
export { EventGatewayOptions, eventGatewayPlugin };
|
|
@@ -100,4 +100,4 @@ declare function defineJob<TData = unknown, TResult = unknown>(definition: JobDe
|
|
|
100
100
|
/** Pluggable BullMQ job queue integration for Arc */
|
|
101
101
|
declare const jobsPlugin: FastifyPluginAsync<JobsPluginOptions>;
|
|
102
102
|
//#endregion
|
|
103
|
-
export { JobDefinition, JobDispatchOptions, JobDispatcher, JobMeta, JobsPluginOptions, QueueStats,
|
|
103
|
+
export { JobDefinition, JobDispatchOptions, JobDispatcher, JobMeta, JobsPluginOptions, QueueStats, defineJob, jobsPlugin };
|
|
@@ -169,4 +169,4 @@ const jobsPluginImpl = async (fastify, options) => {
|
|
|
169
169
|
/** Pluggable BullMQ job queue integration for Arc */
|
|
170
170
|
const jobsPlugin = jobsPluginImpl;
|
|
171
171
|
//#endregion
|
|
172
|
-
export {
|
|
172
|
+
export { defineJob, jobsPlugin };
|
|
@@ -57,4 +57,4 @@ interface StreamlinePluginOptions {
|
|
|
57
57
|
/** Pluggable streamline integration for Arc */
|
|
58
58
|
declare const streamlinePlugin: FastifyPluginAsync<StreamlinePluginOptions>;
|
|
59
59
|
//#endregion
|
|
60
|
-
export { StreamlinePluginOptions, WorkflowLike, WorkflowRunLike, streamlinePlugin
|
|
60
|
+
export { StreamlinePluginOptions, WorkflowLike, WorkflowRunLike, streamlinePlugin };
|
|
@@ -142,4 +142,4 @@ const streamlinePluginImpl = async (fastify, options) => {
|
|
|
142
142
|
/** Pluggable streamline integration for Arc */
|
|
143
143
|
const streamlinePlugin = streamlinePluginImpl;
|
|
144
144
|
//#endregion
|
|
145
|
-
export { streamlinePlugin
|
|
145
|
+
export { streamlinePlugin };
|
|
@@ -43,4 +43,4 @@ declare class RedisWebSocketAdapter implements WebSocketAdapter {
|
|
|
43
43
|
close(): Promise<void>;
|
|
44
44
|
}
|
|
45
45
|
//#endregion
|
|
46
|
-
export { RedisLike, RedisWebSocketAdapter,
|
|
46
|
+
export { RedisLike, RedisWebSocketAdapter, RedisWebSocketAdapterOptions };
|
|
@@ -145,4 +145,4 @@ declare class RoomManager {
|
|
|
145
145
|
/** Pluggable WebSocket integration for Arc */
|
|
146
146
|
declare const websocketPlugin: FastifyPluginAsync<WebSocketPluginOptions>;
|
|
147
147
|
//#endregion
|
|
148
|
-
export { LocalWebSocketAdapter, RoomManager, WebSocketAdapter, WebSocketClient, WebSocketMessage, WebSocketPluginOptions, websocketPlugin
|
|
148
|
+
export { LocalWebSocketAdapter, RoomManager, WebSocketAdapter, WebSocketClient, WebSocketMessage, WebSocketPluginOptions, websocketPlugin };
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-BpYLSNr0.mjs";
|
|
2
2
|
//#region src/cache/memory.ts
|
|
3
|
-
var memory_exports = /* @__PURE__ */ __exportAll({
|
|
4
|
-
MemoryCacheStore: () => MemoryCacheStore,
|
|
5
|
-
default: () => MemoryCacheStore
|
|
6
|
-
});
|
|
3
|
+
var memory_exports = /* @__PURE__ */ __exportAll({ MemoryCacheStore: () => MemoryCacheStore });
|
|
7
4
|
/**
|
|
8
5
|
* In-memory LRU+TTL cache store with hard entry cap and memory budget.
|
|
9
6
|
* - LRU eviction when `maxEntries` or `maxMemoryBytes` is reached
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { i as resolveEffectiveRoles, n as applyFieldWritePermissions, r as fields, t as applyFieldReadPermissions } from "../fields-ipsbIRPK.mjs";
|
|
2
2
|
import { n as normalizeRoles, t as getUserRoles } from "../types-ZUu_h0jp.mjs";
|
|
3
|
-
import { S as createRoleHierarchy, _ as ownerWithAdminBypass, a as createOrgPermissions, b as publicReadAdminWrite, c as requireOrgMembership, d as requireRoles, f as requireTeamMembership, g as fullPublic, h as authenticated, i as createDynamicPermissionMatrix, l as requireOrgRole, m as adminOnly, n as allowPublic, o as denyAll, p as when, r as anyOf, s as requireAuth, t as allOf, u as requireOwnership, v as presets_exports, x as readOnly, y as publicRead } from "../permissions-
|
|
3
|
+
import { S as createRoleHierarchy, _ as ownerWithAdminBypass, a as createOrgPermissions, b as publicReadAdminWrite, c as requireOrgMembership, d as requireRoles, f as requireTeamMembership, g as fullPublic, h as authenticated, i as createDynamicPermissionMatrix, l as requireOrgRole, m as adminOnly, n as allowPublic, o as denyAll, p as when, r as anyOf, s as requireAuth, t as allOf, u as requireOwnership, v as presets_exports, x as readOnly, y as publicRead } from "../permissions-Jk5x3sxz.mjs";
|
|
4
4
|
export { adminOnly, allOf, allowPublic, anyOf, applyFieldReadPermissions, applyFieldWritePermissions, authenticated, createDynamicPermissionMatrix, createOrgPermissions, createRoleHierarchy, denyAll, fields, fullPublic, getUserRoles, normalizeRoles, ownerWithAdminBypass, presets_exports as permissions, publicRead, publicReadAdminWrite, readOnly, requireAuth, requireOrgMembership, requireOrgRole, requireOwnership, requireRoles, requireTeamMembership, resolveEffectiveRoles, when };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-BpYLSNr0.mjs";
|
|
2
2
|
import { a as getTeamId, d as isMember, n as PUBLIC_SCOPE, o as getUserId, u as isElevated } from "./types-C6TQjtdi.mjs";
|
|
3
3
|
import { t as getUserRoles } from "./types-ZUu_h0jp.mjs";
|
|
4
|
-
import { t as MemoryCacheStore } from "./memory-
|
|
4
|
+
import { t as MemoryCacheStore } from "./memory-BFAYkf8H.mjs";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
6
|
//#region src/permissions/roleHierarchy.ts
|
|
7
7
|
/**
|
package/dist/plugins/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { t as hasEvents } from "../typeGuards-Cj5Rgvlg.mjs";
|
|
|
5
5
|
import { t as HookSystem } from "../HookSystem-COkyWztM.mjs";
|
|
6
6
|
import { t as ResourceRegistry } from "../ResourceRegistry-DeCIFlix.mjs";
|
|
7
7
|
import { n as caching_default, t as cachingPlugin } from "../caching-BSXB-Xr7.mjs";
|
|
8
|
-
import { t as errorHandlerPlugin } from "../errorHandler
|
|
8
|
+
import { t as errorHandlerPlugin } from "../errorHandler-DMbGdzBG.mjs";
|
|
9
9
|
import { n as metrics_default, t as metricsPlugin } from "../metrics-Csh4nsvv.mjs";
|
|
10
10
|
import { n as sse_default, t as ssePlugin } from "../sse-BkViJPlT.mjs";
|
|
11
11
|
import { n as versioning_default, t as versioningPlugin } from "../versioning-BzfeHmhj.mjs";
|
|
@@ -84,4 +84,4 @@ declare module "fastify" {
|
|
|
84
84
|
}
|
|
85
85
|
declare const responseCachePlugin: FastifyPluginAsync<ResponseCacheOptions>;
|
|
86
86
|
//#endregion
|
|
87
|
-
export { ResponseCacheOptions, ResponseCacheRule, ResponseCacheStats, responseCachePlugin
|
|
87
|
+
export { ResponseCacheOptions, ResponseCacheRule, ResponseCacheStats, responseCachePlugin };
|
|
@@ -44,7 +44,7 @@ try {
|
|
|
44
44
|
function createTracerProvider(options) {
|
|
45
45
|
if (!isAvailable) return null;
|
|
46
46
|
const { serviceName = "@classytic/arc", serviceVersion, exporterUrl = "http://localhost:4318/v1/traces" } = options;
|
|
47
|
-
const resolvedVersion = serviceVersion ?? "2.4.
|
|
47
|
+
const resolvedVersion = serviceVersion ?? "2.4.3";
|
|
48
48
|
const exporter = new OTLPTraceExporter({ url: exporterUrl });
|
|
49
49
|
const provider = new NodeTracerProvider({ resource: { attributes: {
|
|
50
50
|
"service.name": serviceName,
|
package/dist/presets/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Mt as IControllerResponse, Nt as IRequestContext, Vt as PaginatedResult, Y as PresetResult, it as ResourceConfig, l as AnyRecord } from "../interface-DGmPxakH.mjs";
|
|
2
|
-
import
|
|
2
|
+
import { MultiTenantOptions, multiTenantPreset } from "./multiTenant.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/presets/ownedByUser.d.ts
|
|
5
5
|
interface OwnedByUserOptions {
|
package/dist/presets/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import multiTenantPreset from "./multiTenant.mjs";
|
|
2
|
-
import { a as registerPreset, c as auditedPreset, d as ownedByUserPreset, i as getPreset, l as softDeletePreset, n as flexibleMultiTenantPreset, o as treePreset, r as getAvailablePresets, s as bulkPreset, t as applyPresets, u as slugLookupPreset } from "../presets-
|
|
1
|
+
import { multiTenantPreset } from "./multiTenant.mjs";
|
|
2
|
+
import { a as registerPreset, c as auditedPreset, d as ownedByUserPreset, i as getPreset, l as softDeletePreset, n as flexibleMultiTenantPreset, o as treePreset, r as getAvailablePresets, s as bulkPreset, t as applyPresets, u as slugLookupPreset } from "../presets-OMPaHMTY.mjs";
|
|
3
3
|
export { applyPresets, auditedPreset, bulkPreset, flexibleMultiTenantPreset, getAvailablePresets, getPreset, multiTenantPreset, ownedByUserPreset, registerPreset, slugLookupPreset, softDeletePreset, treePreset };
|
|
@@ -18,4 +18,4 @@ interface MultiTenantOptions {
|
|
|
18
18
|
}
|
|
19
19
|
declare function multiTenantPreset(options?: MultiTenantOptions): PresetResult;
|
|
20
20
|
//#endregion
|
|
21
|
-
export { MultiTenantOptions, multiTenantPreset
|
|
21
|
+
export { MultiTenantOptions, multiTenantPreset };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as PUBLIC_SCOPE, u as isElevated } from "./types-C6TQjtdi.mjs";
|
|
2
|
-
import multiTenantPreset from "./presets/multiTenant.mjs";
|
|
3
|
-
import { d as requireRoles, n as allowPublic, s as requireAuth } from "./permissions-
|
|
2
|
+
import { multiTenantPreset } from "./presets/multiTenant.mjs";
|
|
3
|
+
import { d as requireRoles, n as allowPublic, s as requireAuth } from "./permissions-Jk5x3sxz.mjs";
|
|
4
4
|
//#region src/presets/ownedByUser.ts
|
|
5
5
|
/**
|
|
6
6
|
* Create ownership check middleware.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-BpYLSNr0.mjs";
|
|
2
2
|
import { i as versionKey, r as tagVersionKey } from "./keys-qcD-TVJl.mjs";
|
|
3
3
|
import { t as hasEvents } from "./typeGuards-Cj5Rgvlg.mjs";
|
|
4
|
-
import { t as MemoryCacheStore } from "./memory-
|
|
4
|
+
import { t as MemoryCacheStore } from "./memory-BFAYkf8H.mjs";
|
|
5
5
|
import fp from "fastify-plugin";
|
|
6
6
|
//#region src/cache/QueryCache.ts
|
|
7
7
|
var QueryCache = class {
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1752,7 +1752,7 @@ function runEventTests(resourceName, displayName, events) {
|
|
|
1752
1752
|
* ```
|
|
1753
1753
|
*/
|
|
1754
1754
|
async function createTestApp(options = {}) {
|
|
1755
|
-
const { createApp } = await import("../createApp-
|
|
1755
|
+
const { createApp } = await import("../createApp-CBgVaFyh.mjs").then((n) => n.r);
|
|
1756
1756
|
const { useInMemoryDb = true, mongoUri: providedMongoUri, ...appOptions } = options;
|
|
1757
1757
|
const defaultAuth = {
|
|
1758
1758
|
type: "jwt",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classytic/arc",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.3",
|
|
4
4
|
"description": "Resource-oriented backend framework for Fastify — clean, minimal, powerful, tree-shakable",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
"node": ">=22"
|
|
221
221
|
},
|
|
222
222
|
"peerDependencies": {
|
|
223
|
-
"@classytic/mongokit": ">=3.4.
|
|
223
|
+
"@classytic/mongokit": ">=3.4.5",
|
|
224
224
|
"@classytic/streamline": ">=2.0.0",
|
|
225
225
|
"@fastify/cors": "^11.0.0",
|
|
226
226
|
"@fastify/helmet": "^13.0.0",
|
|
@@ -337,7 +337,7 @@
|
|
|
337
337
|
},
|
|
338
338
|
"devDependencies": {
|
|
339
339
|
"@biomejs/biome": "^2.4.10",
|
|
340
|
-
"@classytic/mongokit": "^3.4.
|
|
340
|
+
"@classytic/mongokit": "^3.4.5",
|
|
341
341
|
"@fastify/jwt": "^10.0.0",
|
|
342
342
|
"@fastify/multipart": "^9.0.0",
|
|
343
343
|
"@fastify/type-provider-typebox": "^6.0.0",
|
|
@@ -349,6 +349,7 @@
|
|
|
349
349
|
"@vitest/coverage-v8": "^3.2.4",
|
|
350
350
|
"fastify-raw-body": "^5.0.0",
|
|
351
351
|
"jsonwebtoken": "^9.0.0",
|
|
352
|
+
"knip": "^6.3.0",
|
|
352
353
|
"mongodb": "^7.1.0",
|
|
353
354
|
"mongodb-memory-server": "^11.0.1",
|
|
354
355
|
"tsdown": "^0.21.7",
|
package/skills/arc/SKILL.md
CHANGED
|
@@ -360,7 +360,7 @@ GET /products?lookup[cat][from]=categories&...&lookup[cat][select]=name,slug
|
|
|
360
360
|
|
|
361
361
|
Operators: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`, `like`, `regex`, `exists`
|
|
362
362
|
|
|
363
|
-
**Custom query parser (e.g., MongoKit for $lookup
|
|
363
|
+
**Custom query parser (e.g., MongoKit >=3.4.5 for $lookup, whitelists, MCP auto-derive):**
|
|
364
364
|
|
|
365
365
|
```typescript
|
|
366
366
|
import { QueryParser } from '@classytic/mongokit';
|
|
@@ -368,11 +368,16 @@ import { QueryParser } from '@classytic/mongokit';
|
|
|
368
368
|
defineResource({
|
|
369
369
|
name: 'product',
|
|
370
370
|
adapter: createMongooseAdapter({ model: ProductModel, repository: productRepo }),
|
|
371
|
-
queryParser: new QueryParser(
|
|
371
|
+
queryParser: new QueryParser({
|
|
372
|
+
allowedFilterFields: ['status', 'category', 'orgId'], // whitelist filter fields
|
|
373
|
+
allowedSortFields: ['createdAt', 'price'], // whitelist sort fields
|
|
374
|
+
allowedOperators: ['eq', 'gte', 'lte', 'in'], // whitelist operators
|
|
375
|
+
}),
|
|
376
|
+
// MCP auto-derives filterableFields from queryParser — no duplication needed
|
|
372
377
|
schemaOptions: {
|
|
373
378
|
query: {
|
|
374
|
-
allowedPopulate: ['category', 'brand'],
|
|
375
|
-
allowedLookups: ['categories', 'brands'],
|
|
379
|
+
allowedPopulate: ['category', 'brand'],
|
|
380
|
+
allowedLookups: ['categories', 'brands'],
|
|
376
381
|
},
|
|
377
382
|
},
|
|
378
383
|
});
|
|
@@ -385,6 +390,8 @@ import { ArcError, NotFoundError, ValidationError, UnauthorizedError, ForbiddenE
|
|
|
385
390
|
throw new NotFoundError('Product not found'); // 404
|
|
386
391
|
```
|
|
387
392
|
|
|
393
|
+
Error handler catches: `ArcError` → `.statusCode` (Fastify) → `.status` (MongoKit, http-errors) → `errorMap` → Mongoose/MongoDB → fallback 500. DB-agnostic — any error with `.status` or `.statusCode` gets the correct HTTP response.
|
|
394
|
+
|
|
388
395
|
## Compensating Transaction
|
|
389
396
|
|
|
390
397
|
In-process rollback for multi-step operations. Not a distributed saga — use Temporal/Streamline for that.
|