@classytic/arc 2.20.0 → 2.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BaseController-D-MHZ27_.mjs → BaseController-BnLYgE9A.mjs} +2 -2
- package/dist/{EventTransport-IEn7Tn-Q.d.mts → EventTransport-QmY7A258.d.mts} +0 -1
- package/dist/{QueryCache-TRfXau3W.d.mts → QueryCache-Z1B38koh.d.mts} +0 -1
- package/dist/{actionPermissions-C9RMiIpc.mjs → actionPermissions-ze70xXJi.mjs} +1 -1
- package/dist/audit/index.d.mts +9 -5
- package/dist/auth/audit.d.mts +7 -4
- package/dist/auth/audit.mjs +5 -0
- package/dist/auth/index.d.mts +7 -14
- package/dist/auth/index.mjs +1 -1
- package/dist/auth/redis-session.d.mts +1 -2
- package/dist/cache/index.d.mts +2 -3
- package/dist/cli/commands/describe.d.mts +1 -2
- package/dist/cli/commands/docs.mjs +1 -1
- package/dist/cli/commands/init.mjs +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/context/index.d.mts +2 -2
- package/dist/core/index.d.mts +3 -3
- package/dist/core/index.mjs +4 -4
- package/dist/{core-CWhyGkiM.mjs → core-DZ6Xe1jR.mjs} +65 -10
- package/dist/{createActionRouter-HlQso0jO.mjs → createActionRouter-BWMDW-dL.mjs} +2 -2
- package/dist/{createAggregationRouter-5LzPzgw1.mjs → createAggregationRouter-l5mNdYrZ.mjs} +1 -1
- package/dist/{createApp-D6uwzCKu.mjs → createApp-Bi61XxqU.mjs} +149 -137
- package/dist/discovery/index.d.mts +0 -1
- package/dist/docs/index.d.mts +1 -2
- package/dist/docs/index.mjs +1 -1
- package/dist/{elevation-xGUBq6p_.d.mts → elevation-C9s5hFP_.d.mts} +0 -1
- package/dist/encryption/index.d.mts +2 -144
- package/dist/{errorHandler-BtUUDPEa.d.mts → errorHandler-B0e-bq-O.d.mts} +0 -1
- package/dist/{errors-DOHkjQlD.d.mts → errors-DHcHVAgk.d.mts} +0 -1
- package/dist/{eventPlugin-DbBFd3x_.d.mts → eventPlugin-A6EbthXR.d.mts} +10 -6
- package/dist/events/index.d.mts +9 -6
- package/dist/events/transports/redis-stream-entry.d.mts +1 -1
- package/dist/events/transports/redis.d.mts +1 -2
- package/dist/factory/index.d.mts +4 -4
- package/dist/factory/index.mjs +2 -2
- package/dist/{fastify-augmentation-CCQJEDgh.d.mts → fastify-augmentation-DafigGQp.d.mts} +2 -3
- package/dist/{fields-C7ahdGYf.d.mts → fields-BGqrAa_u.d.mts} +1 -2
- package/dist/hooks/index.d.mts +1 -1
- package/dist/idempotency/index.d.mts +4 -3
- package/dist/idempotency/redis.d.mts +1 -1
- package/dist/{index-DUa8WHz3.d.mts → index-B5N-NaHs.d.mts} +88 -7
- package/dist/{index-CdFkIMEd.d.mts → index-B5PoNbfu.d.mts} +36 -7
- package/dist/{index-_--GyzcO.d.mts → index-Dtrj6XZk.d.mts} +62 -28
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +6 -6
- package/dist/{init-YH_nslQR.mjs → init-0YhHkXGk.mjs} +154 -137
- package/dist/integrations/event-gateway.d.mts +2 -3
- package/dist/integrations/index.d.mts +2 -2
- package/dist/integrations/jobs.d.mts +0 -1
- package/dist/integrations/mcp/index.d.mts +6 -7
- package/dist/integrations/mcp/index.mjs +1 -1
- package/dist/integrations/mcp/testing.d.mts +1 -2
- package/dist/integrations/mcp/testing.mjs +1 -1
- package/dist/integrations/streamline.d.mts +2 -2
- package/dist/integrations/webhooks.d.mts +0 -1
- package/dist/integrations/websocket-pushref-redis.d.mts +1 -2
- package/dist/integrations/websocket-redis.d.mts +1 -2
- package/dist/integrations/websocket.d.mts +2 -2
- package/dist/{loadResources-B8UmpITt.mjs → loadResources-DpU8pfjV.mjs} +4 -3
- package/dist/{mcpPlugin-CuW6L_uD.mjs → mcpPlugin-B9XjjNVG.mjs} +3 -3
- package/dist/middleware/index.d.mts +1 -2
- package/dist/{module-JYH9V0I8.d.mts → module-WeuU5jfd.d.mts} +46 -1
- package/dist/{openapi-Dq6RbEGK.mjs → openapi-Kyod_di6.mjs} +2 -2
- package/dist/permissions/index.d.mts +3 -3
- package/dist/permissions/index.mjs +2 -2
- package/dist/{permissions-CgbOLJZG.mjs → permissions-BJMuKMl7.mjs} +33 -1
- package/dist/pipeline/index.d.mts +1 -2
- package/dist/plugins/index.d.mts +79 -7
- package/dist/plugins/index.mjs +88 -1
- package/dist/plugins/response-cache.d.mts +5 -3
- package/dist/plugins/tracing-entry.d.mts +1 -1
- package/dist/plugins/tracing-entry.mjs +1 -1
- package/dist/presets/filesUpload.d.mts +4 -5
- package/dist/presets/filesUpload.mjs +1 -1
- package/dist/presets/index.d.mts +1 -2
- package/dist/presets/index.mjs +1 -1
- package/dist/presets/multiTenant.d.mts +1 -2
- package/dist/presets/search.d.mts +2 -3
- package/dist/presets/search.mjs +1 -1
- package/dist/{presets-DWsYQdbV.mjs → presets-gw0ciIUD.mjs} +1 -1
- package/dist/{pushref-registry-DnCqL3aa.d.mts → pushref-registry-BbcnpNTm.d.mts} +4 -2
- package/dist/{queryCachePlugin-xzFyKAjT.d.mts → queryCachePlugin-CfYWq-Ak.d.mts} +1 -2
- package/dist/{redis-C3W0qbz8.d.mts → redis-UDtLaNj6.d.mts} +0 -1
- package/dist/{redis-stream-DsP1vqZB.d.mts → redis-stream-iVR2l7aS.d.mts} +1 -2
- package/dist/{registerRoute-DGSREwPw.mjs → registerRoute-oGAl0oA8.mjs} +1 -1
- package/dist/registry/index.d.mts +2 -2
- package/dist/schemas/index.d.mts +0 -1
- package/dist/scim/index.d.mts +0 -1
- package/dist/scope/index.d.mts +2 -3
- package/dist/{sessionManager-BXG-HGwG.d.mts → sessionManager-BHOM3N_0.d.mts} +10 -6
- package/dist/{storage-Co_PQpeQ.d.mts → storage-DLUZ04kK.d.mts} +8 -4
- package/dist/testing/index.d.mts +2 -3
- package/dist/testing/index.mjs +5 -2
- package/dist/testing/storageContract.d.mts +1 -2
- package/dist/{tracing-D8jlGXP7.d.mts → tracing-CsGKQJGg.d.mts} +0 -1
- package/dist/types/index.d.mts +4 -4
- package/dist/types/storage.d.mts +1 -1
- package/dist/types-Cc91nXuA.d.mts +132 -0
- package/dist/{types-LNebCoJx.d.mts → types-DH0GupI7.d.mts} +8 -4
- package/dist/{types-C9b2HR5W.d.mts → types-DRj-Ut4n.d.mts} +1 -2
- package/dist/{types-BHMKlMBU.d.mts → types-DpxoNX5v.d.mts} +61 -21
- package/dist/utils/index.d.mts +182 -128
- package/dist/utils/index.mjs +2 -2
- package/dist/{utils-ChjYQpjn.mjs → utils-CO8a3B_1.mjs} +70 -26
- package/dist/{versioning-D_eBCfNr.d.mts → versioning-DQ4mCvg0.d.mts} +1 -2
- package/dist/{websocket-MlYlrYq0.d.mts → websocket-uuWqM6UY.d.mts} +5 -4
- package/package.json +7 -7
- package/skills/arc-module-publishing/SKILL.md +242 -0
- package/skills/arc-module-publishing/references/authoring-modules.md +272 -0
- package/skills/arc-module-publishing/references/package-manifest.md +155 -0
- package/skills/arc-module-publishing/references/publishing-workflow.md +182 -0
|
@@ -2,8 +2,8 @@ import { h as SYSTEM_FIELDS, o as DEFAULT_TENANT_FIELD } from "./constants-DNre0
|
|
|
2
2
|
import { arcLog } from "./logger/index.mjs";
|
|
3
3
|
import { d as createDomainError, f as createError, i as NotFoundError, r as ForbiddenError } from "./errors-DkO8Nk6-.mjs";
|
|
4
4
|
import { b as isElevated, c as getOrgId, n as PUBLIC_SCOPE, x as isMember } from "./types-bHblZ9YN.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { F as simpleEqualityMatcher, _ as ArcQueryParser, r as scheduleBackground, t as getUserId } from "./utils-CO8a3B_1.mjs";
|
|
6
|
+
import { I as applyFieldWritePermissions, R as resolveEffectiveRoles } from "./permissions-BJMuKMl7.mjs";
|
|
7
7
|
import { t as getUserRoles } from "./types-XTApa8b6.mjs";
|
|
8
8
|
import { t as buildQueryKey } from "./keys-Cd316u_y.mjs";
|
|
9
9
|
//#region src/core/AccessControl.ts
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DeadLetteredEvent, DomainEvent, DomainEvent as DomainEvent$1, EventHandler, EventHandler as EventHandler$1, EventLogger, EventLogger as EventLogger$1, EventTransport, EventTransport as EventTransport$1, PublishManyResult } from "@classytic/primitives/events";
|
|
2
|
-
|
|
3
2
|
//#region src/events/EventTransport.d.ts
|
|
4
3
|
interface MemoryEventTransportOptions {
|
|
5
4
|
/** Logger for error/warning messages (default: console) */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { b as isElevated, c as getOrgId, g as getUserId, n as PUBLIC_SCOPE, x as isMember } from "./types-bHblZ9YN.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { F as applyFieldReadPermissions, R as resolveEffectiveRoles } from "./permissions-BJMuKMl7.mjs";
|
|
3
3
|
import { t as getUserRoles } from "./types-XTApa8b6.mjs";
|
|
4
4
|
import { t as executePipeline } from "./pipe-BOLmGIxa.mjs";
|
|
5
5
|
import { isPaginatedResult, toCanonicalList } from "@classytic/repo-core/pagination";
|
package/dist/audit/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../index-Dtrj6XZk.mjs";
|
|
2
|
+
import { d as UserBase } from "../fields-BGqrAa_u.mjs";
|
|
2
3
|
import { FastifyPluginAsync } from "fastify";
|
|
3
4
|
import { RepositoryLike } from "@classytic/repo-core/adapter";
|
|
4
|
-
|
|
5
5
|
//#region src/audit/stores/interface.d.ts
|
|
6
6
|
type AuditAction = "create" | "update" | "delete" | "restore" | "custom";
|
|
7
7
|
interface AuditEntry {
|
|
@@ -126,7 +126,9 @@ interface AuditPluginOptions {
|
|
|
126
126
|
* Set `purgeIntervalMs: 0` to skip the timer (manual purge only).
|
|
127
127
|
*/
|
|
128
128
|
retention?: {
|
|
129
|
-
/** Max entry age in ms. Entries with `timestamp < now - maxAgeMs` are purged. */
|
|
129
|
+
/** Max entry age in ms. Entries with `timestamp < now - maxAgeMs` are purged. */
|
|
130
|
+
maxAgeMs: number;
|
|
131
|
+
/** Interval between purges in ms. Default 86_400_000 (24h). 0 disables the timer. */
|
|
130
132
|
purgeIntervalMs?: number;
|
|
131
133
|
};
|
|
132
134
|
/**
|
|
@@ -159,8 +161,10 @@ interface AuditPluginOptions {
|
|
|
159
161
|
* - `false`: Disable auto-audit (manual `fastify.audit.*()` calls only)
|
|
160
162
|
*/
|
|
161
163
|
autoAudit?: boolean | {
|
|
162
|
-
operations?: ("create" | "update" | "delete")[];
|
|
163
|
-
|
|
164
|
+
operations?: ("create" | "update" | "delete")[];
|
|
165
|
+
/** Allowlist — only listed resources are audited (mutually exclusive with exclude) */
|
|
166
|
+
include?: string[];
|
|
167
|
+
/** Denylist — audit everything except listed resources */
|
|
164
168
|
exclude?: string[];
|
|
165
169
|
/**
|
|
166
170
|
* Per-resource opt-in mode: only audit resources with `audit: true` in their
|
package/dist/auth/audit.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FastifyInstance } from "fastify";
|
|
2
|
-
|
|
3
2
|
//#region src/auth/audit.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Canonical auth event names emitted by the bridge. Hosts pattern-match
|
|
@@ -143,9 +142,13 @@ interface BetterAuthAuditBridge {
|
|
|
143
142
|
* is called again. Useful for Prometheus exporters that scrape periodically.
|
|
144
143
|
*/
|
|
145
144
|
getStats(): {
|
|
146
|
-
/** Events buffered during pre-`attach` phase that were dropped due to `bufferSize` overflow. */
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
/** Events buffered during pre-`attach` phase that were dropped due to `bufferSize` overflow. */
|
|
146
|
+
droppedFromBuffer: number;
|
|
147
|
+
/** Events that reached `app.audit.custom(...)` but threw (audit store failure). */
|
|
148
|
+
dispatchFailures: number;
|
|
149
|
+
/** Total `dispatch` calls — useful to verify BA is actually invoking the bridge's hooks. */
|
|
150
|
+
dispatchAttempts: number;
|
|
151
|
+
/** Events currently buffered awaiting `attach`. */
|
|
149
152
|
pendingBuffered: number;
|
|
150
153
|
};
|
|
151
154
|
}
|
package/dist/auth/audit.mjs
CHANGED
|
@@ -100,6 +100,11 @@ const ENDPOINT_TO_EVENT = [
|
|
|
100
100
|
test: /\/api-key\/delete\b/,
|
|
101
101
|
phase: "after",
|
|
102
102
|
name: "apikey.delete"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
test: /\/sign-out\b/,
|
|
106
|
+
phase: "after",
|
|
107
|
+
name: "session.delete"
|
|
103
108
|
}
|
|
104
109
|
];
|
|
105
110
|
function classifyEndpoint(phase, ctx) {
|
package/dist/auth/index.d.mts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Ht as AuthPluginOptions, Vt as AuthHelpers } from "../index-
|
|
2
|
-
import { c as PermissionCheck } from "../fields-
|
|
1
|
+
import { Ht as AuthPluginOptions, Vt as AuthHelpers } from "../index-Dtrj6XZk.mjs";
|
|
2
|
+
import { c as PermissionCheck } from "../fields-BGqrAa_u.mjs";
|
|
3
3
|
import { t as ExternalOpenApiPaths } from "../externalPaths-BE6wFpYv.mjs";
|
|
4
|
-
import { a as SessionManagerOptions, c as createSessionManager, i as SessionData, n as MemorySessionStoreOptions, o as SessionManagerResult, r as SessionCookieOptions, s as SessionStore, t as MemorySessionStore } from "../sessionManager-
|
|
4
|
+
import { a as SessionManagerOptions, c as createSessionManager, i as SessionData, n as MemorySessionStoreOptions, o as SessionManagerResult, r as SessionCookieOptions, s as SessionStore, t as MemorySessionStore } from "../sessionManager-BHOM3N_0.mjs";
|
|
5
5
|
import { FastifyPluginAsync, FastifyReply as FastifyReply$1, FastifyRequest } from "fastify";
|
|
6
|
-
|
|
7
6
|
//#region src/auth/authPlugin.d.ts
|
|
8
7
|
declare module "fastify" {
|
|
9
8
|
interface FastifyInstance {
|
|
@@ -17,14 +16,6 @@ declare module "fastify" {
|
|
|
17
16
|
auth: AuthHelpers;
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
|
-
/**
|
|
21
|
-
* Extract Bearer token from Authorization header.
|
|
22
|
-
*
|
|
23
|
-
* Exported for property-based test coverage — the contract is:
|
|
24
|
-
* - header must start with exactly `"Bearer "` (case-sensitive, one space)
|
|
25
|
-
* - everything after that prefix is returned verbatim (no trim, no parse)
|
|
26
|
-
* - missing header → `null`; any other shape → `null`
|
|
27
|
-
*/
|
|
28
19
|
declare const authPlugin: FastifyPluginAsync<AuthPluginOptions>;
|
|
29
20
|
declare const _default: FastifyPluginAsync<AuthPluginOptions>;
|
|
30
21
|
//#endregion
|
|
@@ -177,8 +168,10 @@ interface BetterAuthOpenApiOptions {
|
|
|
177
168
|
*/
|
|
178
169
|
userFields?: Record<string, {
|
|
179
170
|
type: string;
|
|
180
|
-
description?: string;
|
|
181
|
-
|
|
171
|
+
description?: string;
|
|
172
|
+
/** Whether this field is required in sign-up (default: false) */
|
|
173
|
+
required?: boolean;
|
|
174
|
+
/** Whether this field is accepted in request body (default: true). Set false for output-only fields. */
|
|
182
175
|
input?: boolean;
|
|
183
176
|
}>;
|
|
184
177
|
}
|
package/dist/auth/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as createDomainError, l as UnauthorizedError, p as isArcError, t as ArcError } from "../errors-DkO8Nk6-.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { h as requireOrgRole, m as requireOrgMembership, v as requireTeamMembership } from "../permissions-BJMuKMl7.mjs";
|
|
3
3
|
import { n as normalizeRoles, t as getUserRoles } from "../types-XTApa8b6.mjs";
|
|
4
4
|
import { a as toJsonSchema } from "../schemaConverter-U0MnO9vd.mjs";
|
|
5
5
|
import { createHmac, randomUUID, timingSafeEqual } from "node:crypto";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { i as SessionData, s as SessionStore } from "../sessionManager-
|
|
2
|
-
|
|
1
|
+
import { i as SessionData, s as SessionStore } from "../sessionManager-BHOM3N_0.mjs";
|
|
3
2
|
//#region src/auth/redis-session.d.ts
|
|
4
3
|
/** Minimal Redis client interface — compatible with ioredis */
|
|
5
4
|
interface RedisLike {
|
package/dist/cache/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { n as CacheStats, r as CacheStore, t as CacheLogger } from "../interface-C1_WLTMK.mjs";
|
|
2
|
-
import { a as QueryCacheConfig, i as QueryCache, n as CacheResult, r as CacheStatus, t as CacheEnvelope } from "../QueryCache-
|
|
3
|
-
import { i as queryCachePlugin, n as QueryCacheDefaults, r as QueryCachePluginOptions, t as CrossResourceRule } from "../queryCachePlugin-
|
|
4
|
-
|
|
2
|
+
import { a as QueryCacheConfig, i as QueryCache, n as CacheResult, r as CacheStatus, t as CacheEnvelope } from "../QueryCache-Z1B38koh.mjs";
|
|
3
|
+
import { i as queryCachePlugin, n as QueryCacheDefaults, r as QueryCachePluginOptions, t as CrossResourceRule } from "../queryCachePlugin-CfYWq-Ak.mjs";
|
|
5
4
|
//#region src/cache/keys.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Cache Key Utilities
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { V as ResourceDefinition, ht as RouteSchemaOptions, it as RateLimitConfig } from "../../index-
|
|
2
|
-
|
|
1
|
+
import { V as ResourceDefinition, ht as RouteSchemaOptions, it as RateLimitConfig } from "../../index-Dtrj6XZk.mjs";
|
|
3
2
|
//#region src/cli/commands/describe.d.ts
|
|
4
3
|
interface DescribedResource {
|
|
5
4
|
name: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as buildOpenApiSpec } from "../../openapi-
|
|
1
|
+
import { t as buildOpenApiSpec } from "../../openapi-Kyod_di6.mjs";
|
|
2
2
|
import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-OMCvIEE7.mjs";
|
|
3
3
|
import { dirname, resolve } from "node:path";
|
|
4
4
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as init } from "../../init-
|
|
1
|
+
import { t as init } from "../../init-0YhHkXGk.mjs";
|
|
2
2
|
export { init };
|
package/dist/cli/index.mjs
CHANGED
|
@@ -2,6 +2,6 @@ import { describe } from "./commands/describe.mjs";
|
|
|
2
2
|
import { exportDocs } from "./commands/docs.mjs";
|
|
3
3
|
import { doctor } from "./commands/doctor.mjs";
|
|
4
4
|
import { t as generate } from "../generate-usRSdQmP.mjs";
|
|
5
|
-
import { t as init } from "../init-
|
|
5
|
+
import { t as init } from "../init-0YhHkXGk.mjs";
|
|
6
6
|
import { introspect } from "./commands/introspect.mjs";
|
|
7
7
|
export { describe, doctor, exportDocs, generate, init, introspect };
|
package/dist/context/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
-
|
|
3
2
|
//#region src/context/requestContext.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Shape of the request-scoped context store.
|
|
@@ -104,7 +103,8 @@ declare const transactionContext: {
|
|
|
104
103
|
* Get the current DB session, or `undefined` if not inside a
|
|
105
104
|
* `transactionContext.run(...)` scope.
|
|
106
105
|
*/
|
|
107
|
-
get(): DbSession | undefined;
|
|
106
|
+
get(): DbSession | undefined;
|
|
107
|
+
/** The underlying AsyncLocalStorage instance. Exposed for advanced integrations. */
|
|
108
108
|
storage: AsyncLocalStorage<unknown>;
|
|
109
109
|
};
|
|
110
110
|
//#endregion
|
package/dist/core/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { At as AggregationMaterializedResult, B as defineResource, Bn as BodySanitizerConfig, Ct as AggMeasureInput, Dt as AggregationDateRangeRequirement, Et as AggregationConfig, Fn as BaseControllerOptions, In as ControllerConfigurableOptions, Ln as ControllerConstructionOptions, Mt as AggregationsMap, Ot as AggregationIndexHint, Rn as ListResult, Tt as AggregationCacheConfig, V as ResourceDefinition, an as SlugExt, cn as BulkMixin, dn as QueryResolverConfig, en as BaseController, fn as AccessControl, in as TreeMixin, jt as AggregationRateLimit, kt as AggregationMaterializedContext, ln as BaseCrudController, nn as SoftDeleteMixin, on as SlugMixin, pn as AccessControlConfig, rn as TreeExt, sn as BulkExt, tn as SoftDeleteExt, un as QueryResolver, wt as AggMeasureShorthand, zn as BodySanitizer } from "../index-
|
|
2
|
-
import { A as
|
|
3
|
-
export { AccessControl, type AccessControlConfig, type AggMeasureInput, type AggMeasureShorthand, type AggregationCacheConfig, type AggregationConfig, type AggregationDateRangeRequirement, type AggregationIndexHint, type AggregationMaterializedContext, type AggregationMaterializedResult, type AggregationRateLimit, type AggregationsMap, BaseController, type BaseControllerOptions, BaseCrudController, BodySanitizer, type BodySanitizerConfig, type BulkExt, BulkMixin, CRUD_OPERATIONS, type ControllerConfigurableOptions, type ControllerConstructionOptions, CrudOperation, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, type DefineActionConfig, HOOK_OPERATIONS, HOOK_PHASES, HookOperation, HookPhase, type ListResult, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, MutationOperation, QueryResolver, type QueryResolverConfig, RESERVED_QUERY_PARAMS, ResourceDefinition, SYSTEM_FIELDS, type SlugExt, SlugMixin, type SoftDeleteExt, SoftDeleteMixin, type TreeExt, TreeMixin, collectReadBlockedFields, createCrudHandlers, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAction, defineAggregation, defineResource, defineResourceVariants, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, sendControllerResponse };
|
|
1
|
+
import { At as AggregationMaterializedResult, B as defineResource, Bn as BodySanitizerConfig, Ct as AggMeasureInput, Dt as AggregationDateRangeRequirement, Et as AggregationConfig, Fn as BaseControllerOptions, In as ControllerConfigurableOptions, Ln as ControllerConstructionOptions, Mt as AggregationsMap, Ot as AggregationIndexHint, Rn as ListResult, Tt as AggregationCacheConfig, V as ResourceDefinition, an as SlugExt, cn as BulkMixin, dn as QueryResolverConfig, en as BaseController, fn as AccessControl, in as TreeMixin, jt as AggregationRateLimit, kt as AggregationMaterializedContext, ln as BaseCrudController, nn as SoftDeleteMixin, on as SlugMixin, pn as AccessControlConfig, rn as TreeExt, sn as BulkExt, tn as SoftDeleteExt, un as QueryResolver, wt as AggMeasureShorthand, zn as BodySanitizer } from "../index-Dtrj6XZk.mjs";
|
|
2
|
+
import { A as HOOK_OPERATIONS, B as SYSTEM_FIELDS, C as CrudOperation, D as DEFAULT_SORT, E as DEFAULT_MAX_LIMIT, F as MAX_REGEX_LENGTH, I as MAX_SEARCH_LENGTH, L as MUTATION_OPERATIONS, M as HookOperation, N as HookPhase, O as DEFAULT_TENANT_FIELD, P as MAX_FILTER_DEPTH, R as MutationOperation, S as CRUD_OPERATIONS, T as DEFAULT_LIMIT, _ as DefineActionConfig, a as createRequestContext, b as createPermissionMiddleware, c as sendControllerResponse, d as getEntityQuery, f as defineResourceVariants, g as mergeResourceConfig, h as SeamedResourceConfig, i as createFastifyHandler, j as HOOK_PHASES, k as DEFAULT_UPDATE_METHOD, l as getEntityId, m as ResourceSeams, n as isFieldReadable, o as getControllerContext, p as AdapterLike, r as createCrudHandlers, s as getControllerScope, t as collectReadBlockedFields, u as getEntityIdField, v as defineAction, w as DEFAULT_ID_FIELD, x as defineAggregation, y as createCrudRouter, z as RESERVED_QUERY_PARAMS } from "../index-B5N-NaHs.mjs";
|
|
3
|
+
export { AccessControl, type AccessControlConfig, type AdapterLike, type AggMeasureInput, type AggMeasureShorthand, type AggregationCacheConfig, type AggregationConfig, type AggregationDateRangeRequirement, type AggregationIndexHint, type AggregationMaterializedContext, type AggregationMaterializedResult, type AggregationRateLimit, type AggregationsMap, BaseController, type BaseControllerOptions, BaseCrudController, BodySanitizer, type BodySanitizerConfig, type BulkExt, BulkMixin, CRUD_OPERATIONS, type ControllerConfigurableOptions, type ControllerConstructionOptions, CrudOperation, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, type DefineActionConfig, HOOK_OPERATIONS, HOOK_PHASES, HookOperation, HookPhase, type ListResult, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, MutationOperation, QueryResolver, type QueryResolverConfig, RESERVED_QUERY_PARAMS, ResourceDefinition, type ResourceSeams, SYSTEM_FIELDS, type SeamedResourceConfig, type SlugExt, SlugMixin, type SoftDeleteExt, SoftDeleteMixin, type TreeExt, TreeMixin, collectReadBlockedFields, createCrudHandlers, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAction, defineAggregation, defineResource, defineResourceVariants, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, mergeResourceConfig, sendControllerResponse };
|
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-DNre0wRg.mjs";
|
|
2
|
-
import { a as BulkMixin, c as collectReadBlockedFields, f as AccessControl, i as SlugMixin, l as isFieldReadable, n as TreeMixin, o as BaseCrudController, r as SoftDeleteMixin, s as QueryResolver, t as BaseController, u as BodySanitizer } from "../BaseController-
|
|
3
|
-
import { a as
|
|
4
|
-
import { a as createCrudHandlers, c as getControllerContext, l as getControllerScope, o as createFastifyHandler, s as createRequestContext, u as sendControllerResponse } from "../actionPermissions-
|
|
5
|
-
export { AccessControl, BaseController, BaseCrudController, BodySanitizer, BulkMixin, 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, SlugMixin, SoftDeleteMixin, TreeMixin, collectReadBlockedFields, createCrudHandlers, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAction, defineAggregation, defineResource, defineResourceVariants, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, sendControllerResponse };
|
|
2
|
+
import { a as BulkMixin, c as collectReadBlockedFields, f as AccessControl, i as SlugMixin, l as isFieldReadable, n as TreeMixin, o as BaseCrudController, r as SoftDeleteMixin, s as QueryResolver, t as BaseController, u as BodySanitizer } from "../BaseController-BnLYgE9A.mjs";
|
|
3
|
+
import { a as mergeResourceConfig, c as defineAction, d as defineAggregation, i as defineResourceVariants, l as createCrudRouter, n as getEntityIdField, o as defineResource, r as getEntityQuery, s as ResourceDefinition, t as getEntityId, u as createPermissionMiddleware } from "../core-DZ6Xe1jR.mjs";
|
|
4
|
+
import { a as createCrudHandlers, c as getControllerContext, l as getControllerScope, o as createFastifyHandler, s as createRequestContext, u as sendControllerResponse } from "../actionPermissions-ze70xXJi.mjs";
|
|
5
|
+
export { AccessControl, BaseController, BaseCrudController, BodySanitizer, BulkMixin, 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, SlugMixin, SoftDeleteMixin, TreeMixin, collectReadBlockedFields, createCrudHandlers, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAction, defineAggregation, defineResource, defineResourceVariants, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, mergeResourceConfig, sendControllerResponse };
|
|
@@ -2,16 +2,16 @@ import { s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS } from "./constants-DN
|
|
|
2
2
|
import { arcLog } from "./logger/index.mjs";
|
|
3
3
|
import { r as ForbiddenError } from "./errors-DkO8Nk6-.mjs";
|
|
4
4
|
import { b as isElevated, n as PUBLIC_SCOPE, x as isMember } from "./types-bHblZ9YN.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { d as DEFAULT_FIELD_WRITE_DENIAL_POLICY, t as BaseController } from "./BaseController-
|
|
7
|
-
import { a as selectPluginMw, c as buildPreHandlerChain, f as buildArcDecorator, i as resolveRouterPluginMw, l as resolveRoutePreHandlers, n as buildRateLimitConfig, r as buildRouteConfig, s as buildCrudPermissionMw, t as tryRegisterRoute, u as buildAuthMiddleware } from "./registerRoute-
|
|
8
|
-
import {
|
|
5
|
+
import { M as assertValidConfig, l as getDefaultCrudSchemas } from "./utils-CO8a3B_1.mjs";
|
|
6
|
+
import { d as DEFAULT_FIELD_WRITE_DENIAL_POLICY, t as BaseController } from "./BaseController-BnLYgE9A.mjs";
|
|
7
|
+
import { a as selectPluginMw, c as buildPreHandlerChain, f as buildArcDecorator, i as resolveRouterPluginMw, l as resolveRoutePreHandlers, n as buildRateLimitConfig, r as buildRouteConfig, s as buildCrudPermissionMw, t as tryRegisterRoute, u as buildAuthMiddleware } from "./registerRoute-oGAl0oA8.mjs";
|
|
8
|
+
import { I as applyFieldWritePermissions, R as resolveEffectiveRoles } from "./permissions-BJMuKMl7.mjs";
|
|
9
9
|
import { t as getUserRoles } from "./types-XTApa8b6.mjs";
|
|
10
|
-
import { t as applyPresets } from "./presets-
|
|
10
|
+
import { t as applyPresets } from "./presets-gw0ciIUD.mjs";
|
|
11
11
|
import { n as convertRouteSchema, t as convertOpenApiSchemas } from "./schemaConverter-U0MnO9vd.mjs";
|
|
12
12
|
import { i as pipeUIMessageStreamToReply, r as isReadableStream } from "./streaming-BQcW6_Kq.mjs";
|
|
13
13
|
import { t as hasEvents } from "./typeGuards-C9KXUly6.mjs";
|
|
14
|
-
import { a as createCrudHandlers, d as buildRequestScopeProjection, i as resolvePipelineSteps, o as createFastifyHandler, r as buildPipelineHandler, s as createRequestContext, t as resolveActionPermission } from "./actionPermissions-
|
|
14
|
+
import { a as createCrudHandlers, d as buildRequestScopeProjection, i as resolvePipelineSteps, o as createFastifyHandler, r as buildPipelineHandler, s as createRequestContext, t as resolveActionPermission } from "./actionPermissions-ze70xXJi.mjs";
|
|
15
15
|
import { t as pluralize } from "./pluralize-BhrgwZb9.mjs";
|
|
16
16
|
//#region src/core/middlewares/fieldWrite.ts
|
|
17
17
|
/**
|
|
@@ -1068,7 +1068,10 @@ function buildGeneratedCrudSchemas(openApi, customSchemas) {
|
|
|
1068
1068
|
for (const [op, customSchema] of Object.entries(customSchemas)) {
|
|
1069
1069
|
const key = op;
|
|
1070
1070
|
const converted = convertRouteSchema(customSchema);
|
|
1071
|
-
schemas[key] = schemas[key] ?
|
|
1071
|
+
schemas[key] = schemas[key] ? {
|
|
1072
|
+
...schemas[key],
|
|
1073
|
+
...converted
|
|
1074
|
+
} : converted;
|
|
1072
1075
|
}
|
|
1073
1076
|
}
|
|
1074
1077
|
return schemas;
|
|
@@ -1283,7 +1286,7 @@ function buildResourcePlugin(resource) {
|
|
|
1283
1286
|
extensions: resource.extensions
|
|
1284
1287
|
});
|
|
1285
1288
|
if (resource.actions && Object.keys(resource.actions).length > 0) {
|
|
1286
|
-
const { createActionRouter } = await import("./createActionRouter-
|
|
1289
|
+
const { createActionRouter } = await import("./createActionRouter-BWMDW-dL.mjs").then((n) => n.n);
|
|
1287
1290
|
createActionRouter(typedInstance, {
|
|
1288
1291
|
...normalizeActionsToRouterConfig(resource.actions, resource.actionPermissions, resource.tag, resource.permissions, resource.name, typedInstance.log),
|
|
1289
1292
|
resourceName: resource.name,
|
|
@@ -1298,7 +1301,7 @@ function buildResourcePlugin(resource) {
|
|
|
1298
1301
|
});
|
|
1299
1302
|
}
|
|
1300
1303
|
if (resource.aggregations && Object.keys(resource.aggregations).length > 0) {
|
|
1301
|
-
const [{ createAggregationRouter }, { adapterSupportsAggregate, ArcAggregationConfigError }] = await Promise.all([import("./createAggregationRouter-
|
|
1304
|
+
const [{ createAggregationRouter }, { adapterSupportsAggregate, ArcAggregationConfigError }] = await Promise.all([import("./createAggregationRouter-l5mNdYrZ.mjs"), import("./validate-C2mGgSXg.mjs").then((n) => n.r)]);
|
|
1302
1305
|
const repoForAgg = resource.controller?.repository ?? resource.repository;
|
|
1303
1306
|
if (!adapterSupportsAggregate(repoForAgg)) {
|
|
1304
1307
|
const undispatchable = Object.entries(resource.aggregations).filter(([, cfg]) => !cfg.materialized).map(([name]) => name);
|
|
@@ -1910,6 +1913,58 @@ function defineResource(config) {
|
|
|
1910
1913
|
return resource;
|
|
1911
1914
|
}
|
|
1912
1915
|
//#endregion
|
|
1916
|
+
//#region src/core/defineResource/seams.ts
|
|
1917
|
+
/** Plain object test — literals only; class instances must replace, not merge. */
|
|
1918
|
+
function isPlainObject(value) {
|
|
1919
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
|
|
1920
|
+
const proto = Object.getPrototypeOf(value);
|
|
1921
|
+
return proto === Object.prototype || proto === null;
|
|
1922
|
+
}
|
|
1923
|
+
/** Recursive plain-object merge; nested arrays REPLACE (they're value lists). */
|
|
1924
|
+
function mergePlain(base, next) {
|
|
1925
|
+
const out = { ...base };
|
|
1926
|
+
for (const [key, value] of Object.entries(next)) {
|
|
1927
|
+
if (value === void 0) continue;
|
|
1928
|
+
const existing = out[key];
|
|
1929
|
+
out[key] = isPlainObject(existing) && isPlainObject(value) ? mergePlain(existing, value) : value;
|
|
1930
|
+
}
|
|
1931
|
+
return out;
|
|
1932
|
+
}
|
|
1933
|
+
/**
|
|
1934
|
+
* Canonical slot-aware merge of a base resource config with host seams.
|
|
1935
|
+
* Later seams win over earlier ones; `undefined` values never clobber.
|
|
1936
|
+
*
|
|
1937
|
+
* Merge semantics (value-driven — no per-slot registry to drift):
|
|
1938
|
+
*
|
|
1939
|
+
* - **Top-level arrays CONCAT** — `routes`, `middlewares`, `presets`,
|
|
1940
|
+
* `routeGuards`, `disabledRoutes`: additive collections, base first.
|
|
1941
|
+
* - **Plain objects merge recursively** — `permissions`, `actions`,
|
|
1942
|
+
* `schemaOptions` (incl. `fieldRules`), `aggregations`, `customSchemas`,
|
|
1943
|
+
* `fields`, `cache`, `events`: per-key composition. Arrays NESTED inside
|
|
1944
|
+
* them replace (they're value lists — enums, sort specs), not concat.
|
|
1945
|
+
* - **Everything else last-wins** — class instances (`adapter`,
|
|
1946
|
+
* `controller`, `queryParser`), functions, scalars.
|
|
1947
|
+
*
|
|
1948
|
+
* The single `as` at the return is the one documented erasure for the
|
|
1949
|
+
* {@link AdapterLike}-widened seam slots — inside the helper so no module
|
|
1950
|
+
* author ever writes one (mirrors mongokit's one-cast-at-the-boundary rule).
|
|
1951
|
+
*/
|
|
1952
|
+
function mergeResourceConfig(base, ...seams) {
|
|
1953
|
+
const out = { ...base };
|
|
1954
|
+
for (const seam of seams) {
|
|
1955
|
+
if (!seam) continue;
|
|
1956
|
+
for (const [key, value] of Object.entries(seam)) {
|
|
1957
|
+
if (value === void 0) continue;
|
|
1958
|
+
const existing = out[key];
|
|
1959
|
+
if (Array.isArray(existing) && Array.isArray(value)) out[key] = [...existing, ...value];
|
|
1960
|
+
else if (isPlainObject(existing) && isPlainObject(value)) out[key] = mergePlain(existing, value);
|
|
1961
|
+
else if (Array.isArray(value)) out[key] = [...value];
|
|
1962
|
+
else out[key] = value;
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
return out;
|
|
1966
|
+
}
|
|
1967
|
+
//#endregion
|
|
1913
1968
|
//#region src/core/defineResourceVariants.ts
|
|
1914
1969
|
/**
|
|
1915
1970
|
* Define multiple resources from a shared base config and per-variant overrides.
|
|
@@ -2008,4 +2063,4 @@ function getEntityQuery(req) {
|
|
|
2008
2063
|
return { [getEntityIdField(req)]: id };
|
|
2009
2064
|
}
|
|
2010
2065
|
//#endregion
|
|
2011
|
-
export {
|
|
2066
|
+
export { mergeResourceConfig as a, defineAction as c, defineAggregation as d, defineResourceVariants as i, createCrudRouter as l, getEntityIdField as n, defineResource as o, getEntityQuery as r, ResourceDefinition as s, getEntityId as t, createPermissionMiddleware as u };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
2
|
import "./constants-DNre0wRg.mjs";
|
|
3
3
|
import { f as createError } from "./errors-DkO8Nk6-.mjs";
|
|
4
|
-
import { a as selectPluginMw, c as buildPreHandlerChain, d as buildAuthMiddlewareForPermissions, f as buildArcDecorator, i as resolveRouterPluginMw, n as buildRateLimitConfig, o as buildActionPermissionMw, r as buildRouteConfig, t as tryRegisterRoute } from "./registerRoute-
|
|
5
|
-
import { i as resolvePipelineSteps, n as buildActionPipelineHandler, u as sendControllerResponse } from "./actionPermissions-
|
|
4
|
+
import { a as selectPluginMw, c as buildPreHandlerChain, d as buildAuthMiddlewareForPermissions, f as buildArcDecorator, i as resolveRouterPluginMw, n as buildRateLimitConfig, o as buildActionPermissionMw, r as buildRouteConfig, t as tryRegisterRoute } from "./registerRoute-oGAl0oA8.mjs";
|
|
5
|
+
import { i as resolvePipelineSteps, n as buildActionPipelineHandler, u as sendControllerResponse } from "./actionPermissions-ze70xXJi.mjs";
|
|
6
6
|
import { n as schemaIRToJsonSchemaBranch, t as normalizeSchemaIR } from "./schemaIR-ajetw3Fv.mjs";
|
|
7
7
|
//#region src/core/createActionRouter.ts
|
|
8
8
|
var createActionRouter_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { f as createError, l as UnauthorizedError, r as ForbiddenError } from "./errors-DkO8Nk6-.mjs";
|
|
2
|
-
import { a as selectPluginMw, c as buildPreHandlerChain, f as buildArcDecorator, i as resolveRouterPluginMw, n as buildRateLimitConfig, u as buildAuthMiddleware } from "./registerRoute-
|
|
2
|
+
import { a as selectPluginMw, c as buildPreHandlerChain, f as buildArcDecorator, i as resolveRouterPluginMw, n as buildRateLimitConfig, u as buildAuthMiddleware } from "./registerRoute-oGAl0oA8.mjs";
|
|
3
3
|
import { n as validateAggregations } from "./validate-C2mGgSXg.mjs";
|
|
4
4
|
import { t as buildAggregationHandler } from "./buildHandler-D_2ULWxZ.mjs";
|
|
5
5
|
//#region src/core/aggregation/createAggregationRouter.ts
|