@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,5 +1,6 @@
|
|
|
1
1
|
import { t as getUserRoles } from "./types-ZUu_h0jp.mjs";
|
|
2
|
-
import { n as convertRouteSchema } from "./schemaConverter-
|
|
2
|
+
import { n as convertRouteSchema } from "./schemaConverter-OxfCshus.mjs";
|
|
3
|
+
import { t as buildActionBodySchema } from "./createActionRouter-Df1BuawX.mjs";
|
|
3
4
|
import fp from "fastify-plugin";
|
|
4
5
|
//#region src/docs/openapi.ts
|
|
5
6
|
const openApiPlugin = async (fastify, opts = {}) => {
|
|
@@ -158,7 +159,7 @@ const DEFAULT_LIST_PARAMS = [
|
|
|
158
159
|
function generateResourcePaths(resource, apiPrefix = "", additionalSecurity = []) {
|
|
159
160
|
const paths = {};
|
|
160
161
|
const basePath = `${apiPrefix}${resource.prefix}`;
|
|
161
|
-
if (resource.disableDefaultRoutes && (!resource.additionalRoutes || resource.additionalRoutes.length === 0)) return paths;
|
|
162
|
+
if (resource.disableDefaultRoutes && (!resource.additionalRoutes || resource.additionalRoutes.length === 0) && (!resource.actions || resource.actions.length === 0)) return paths;
|
|
162
163
|
if (!resource.disableDefaultRoutes) {
|
|
163
164
|
const disabledSet = new Set(resource.disabledRoutes ?? []);
|
|
164
165
|
const updateMethod = resource.updateMethod ?? "PATCH";
|
|
@@ -309,6 +310,52 @@ function generateResourcePaths(resource, apiPrefix = "", additionalSecurity = []
|
|
|
309
310
|
}
|
|
310
311
|
paths[fullPath][method] = createOperation(resource, handlerName, route.summary ?? handlerName, extras, requiresAuthForRoute, additionalSecurity);
|
|
311
312
|
}
|
|
313
|
+
if (resource.actions && resource.actions.length > 0) {
|
|
314
|
+
const actionPath = toOpenApiPath(`${basePath}/:id/action`);
|
|
315
|
+
const actionEnum = resource.actions.map((a) => a.name);
|
|
316
|
+
const actionSchemas = {};
|
|
317
|
+
for (const a of resource.actions) if (a.schema) actionSchemas[a.name] = a.schema;
|
|
318
|
+
const bodySchema = buildActionBodySchema(actionEnum, actionSchemas);
|
|
319
|
+
const descLines = [
|
|
320
|
+
"Unified action endpoint for state transitions.",
|
|
321
|
+
"",
|
|
322
|
+
"**Available actions:**"
|
|
323
|
+
];
|
|
324
|
+
for (const a of resource.actions) {
|
|
325
|
+
const roles = a.permissions?._roles;
|
|
326
|
+
const roleStr = roles?.length ? ` — requires: ${roles.join(" or ")}` : "";
|
|
327
|
+
const descStr = a.description ? ` — ${a.description}` : "";
|
|
328
|
+
descLines.push(`- \`${a.name}\`${roleStr}${descStr}`);
|
|
329
|
+
}
|
|
330
|
+
const fallbackPerm = resource.actionPermissions;
|
|
331
|
+
const fallbackRequiresAuth = typeof fallbackPerm === "function" && !fallbackPerm._isPublic;
|
|
332
|
+
const anyAuthRequired = resource.actions.some((a) => {
|
|
333
|
+
const p = a.permissions;
|
|
334
|
+
if (typeof p === "function") return !p._isPublic;
|
|
335
|
+
return fallbackRequiresAuth;
|
|
336
|
+
});
|
|
337
|
+
if (!paths[actionPath]) paths[actionPath] = {};
|
|
338
|
+
paths[actionPath].post = createOperation(resource, "action", `Perform action (${actionEnum.join(" / ")})`, {
|
|
339
|
+
parameters: [{
|
|
340
|
+
name: "id",
|
|
341
|
+
in: "path",
|
|
342
|
+
required: true,
|
|
343
|
+
schema: { type: "string" },
|
|
344
|
+
description: "Resource ID"
|
|
345
|
+
}],
|
|
346
|
+
description: descLines.join("\n"),
|
|
347
|
+
requestBody: {
|
|
348
|
+
required: true,
|
|
349
|
+
content: { "application/json": { schema: bodySchema } }
|
|
350
|
+
},
|
|
351
|
+
responses: {
|
|
352
|
+
"200": { description: "Action executed successfully" },
|
|
353
|
+
"400": { description: "Invalid action or missing required fields" },
|
|
354
|
+
"401": { description: "Authentication required" },
|
|
355
|
+
"403": { description: "Permission denied" }
|
|
356
|
+
}
|
|
357
|
+
}, anyAuthRequired, additionalSecurity);
|
|
358
|
+
}
|
|
312
359
|
return paths;
|
|
313
360
|
}
|
|
314
361
|
/**
|
package/dist/org/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as UserBase } from "../types-
|
|
1
|
+
import { Wt as RouteHandler } from "../interface-CS6d7HiB.mjs";
|
|
2
|
+
import { i as UserBase } from "../types-BoaZHr-2.mjs";
|
|
3
3
|
import { InvitationAdapter, InvitationDoc, MemberDoc, OrgAdapter, OrgDoc, OrgPermissionStatement, OrgRole, OrganizationPluginOptions } from "./types.mjs";
|
|
4
4
|
import { FastifyPluginAsync, RouteHandlerMethod } from "fastify";
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as applyFieldWritePermissions, i as applyFieldReadPermissions, n as FieldPermissionMap, o as fields, r as FieldPermissionType, s as resolveEffectiveRoles, t as FieldPermission } from "../fields-
|
|
2
|
-
import { a as getUserRoles, i as UserBase, n as PermissionContext, o as normalizeRoles, r as PermissionResult, t as PermissionCheck } from "../types-
|
|
3
|
-
import { A as RoleHierarchy, C as authenticated, D as publicRead, E as presets_d_exports, M as applyPermissionResult, N as normalizePermissionResult, O as publicReadAdminWrite, S as adminOnly, T as ownerWithAdminBypass, _ as requireScopeContext, a as allOf, b as roles, c as createDynamicPermissionMatrix, d as requireAuth, f as requireOrgInScope, g as requireRoles, h as requireOwnership, i as PermissionEventBus, j as createRoleHierarchy, k as readOnly, l as createOrgPermissions, m as requireOrgRole, n as DynamicPermissionMatrix, o as allowPublic, p as requireOrgMembership, r as DynamicPermissionMatrixConfig, s as anyOf, t as ConnectEventsOptions, u as denyAll, v as requireServiceScope, w as fullPublic, x as when, y as requireTeamMembership } from "../index-
|
|
1
|
+
import { a as applyFieldWritePermissions, i as applyFieldReadPermissions, n as FieldPermissionMap, o as fields, r as FieldPermissionType, s as resolveEffectiveRoles, t as FieldPermission } from "../fields-DoeDgh2b.mjs";
|
|
2
|
+
import { a as getUserRoles, i as UserBase, n as PermissionContext, o as normalizeRoles, r as PermissionResult, t as PermissionCheck } from "../types-BoaZHr-2.mjs";
|
|
3
|
+
import { A as RoleHierarchy, C as authenticated, D as publicRead, E as presets_d_exports, M as applyPermissionResult, N as normalizePermissionResult, O as publicReadAdminWrite, S as adminOnly, T as ownerWithAdminBypass, _ as requireScopeContext, a as allOf, b as roles, c as createDynamicPermissionMatrix, d as requireAuth, f as requireOrgInScope, g as requireRoles, h as requireOwnership, i as PermissionEventBus, j as createRoleHierarchy, k as readOnly, l as createOrgPermissions, m as requireOrgRole, n as DynamicPermissionMatrix, o as allowPublic, p as requireOrgMembership, r as DynamicPermissionMatrixConfig, s as anyOf, t as ConnectEventsOptions, u as denyAll, v as requireServiceScope, w as fullPublic, x as when, y as requireTeamMembership } from "../index-CBru2y5Y.mjs";
|
|
4
4
|
export { ConnectEventsOptions, DynamicPermissionMatrix, DynamicPermissionMatrixConfig, FieldPermission, FieldPermissionMap, FieldPermissionType, PermissionCheck, PermissionContext, PermissionEventBus, PermissionResult, RoleHierarchy, UserBase, adminOnly, allOf, allowPublic, anyOf, applyFieldReadPermissions, applyFieldWritePermissions, applyPermissionResult, authenticated, createDynamicPermissionMatrix, createOrgPermissions, createRoleHierarchy, denyAll, fields, fullPublic, getUserRoles, normalizePermissionResult, normalizeRoles, ownerWithAdminBypass, presets_d_exports as permissions, publicRead, publicReadAdminWrite, readOnly, requireAuth, requireOrgInScope, requireOrgMembership, requireOrgRole, requireOwnership, requireRoles, requireScopeContext, requireServiceScope, requireTeamMembership, resolveEffectiveRoles, roles, when };
|
package/dist/plugins/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as ExternalOpenApiPaths } from "../externalPaths-
|
|
3
|
-
import { _ as cachingPlugin, a as versioningPlugin, c as MetricsOptions, d as SSEOptions, f as _default$6, g as _default$1, h as CachingRule, i as _default$7, l as _default$4, m as CachingOptions, n as errorHandlerPlugin, o as MetricEntry, p as ssePlugin, r as VersioningOptions, s as MetricsCollector, t as ErrorHandlerOptions, u as metricsPlugin } from "../errorHandler-
|
|
4
|
-
import { t as TracingOptions } from "../tracing-
|
|
1
|
+
import { K as MiddlewareConfig, Kt as ResourceRegistry, Tn as HookSystem, et as PresetHook, m as AnyRecord, p as AdditionalRoute, vt as RouteSchemaOptions } from "../interface-CS6d7HiB.mjs";
|
|
2
|
+
import { t as ExternalOpenApiPaths } from "../externalPaths-BQ8QijNH.mjs";
|
|
3
|
+
import { _ as cachingPlugin, a as versioningPlugin, c as MetricsOptions, d as SSEOptions, f as _default$6, g as _default$1, h as CachingRule, i as _default$7, l as _default$4, m as CachingOptions, n as errorHandlerPlugin, o as MetricEntry, p as ssePlugin, r as VersioningOptions, s as MetricsCollector, t as ErrorHandlerOptions, u as metricsPlugin } from "../errorHandler-DJ7OAB2V.mjs";
|
|
4
|
+
import { t as TracingOptions } from "../tracing-xqXzWeaf.mjs";
|
|
5
5
|
import { FastifyInstance, FastifyPluginAsync } from "fastify";
|
|
6
6
|
import * as _$node_stream0 from "node:stream";
|
|
7
7
|
|
package/dist/plugins/index.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { p as MUTATION_OPERATIONS } from "../constants-Cxde4rpC.mjs";
|
|
2
2
|
import { o as getOrgId } from "../types-AOD8fxIw.mjs";
|
|
3
|
-
import { t as requestContext } from "../requestContext-
|
|
3
|
+
import { t as requestContext } from "../requestContext-DYvHl113.mjs";
|
|
4
4
|
import { t as hasEvents } from "../typeGuards-CcFZXgU7.mjs";
|
|
5
|
-
import { t as HookSystem } from "../HookSystem-
|
|
6
|
-
import { t as ResourceRegistry } from "../ResourceRegistry-
|
|
7
|
-
import { n as caching_default, t as cachingPlugin } from "../caching-
|
|
8
|
-
import { t as errorHandlerPlugin } from "../errorHandler-
|
|
9
|
-
import { n as metrics_default, t as metricsPlugin } from "../metrics-
|
|
10
|
-
import { t as replyHelpersPlugin } from "../replyHelpers-
|
|
11
|
-
import { n as sse_default, t as ssePlugin } from "../sse-
|
|
12
|
-
import { n as versioning_default, t as versioningPlugin } from "../versioning-
|
|
5
|
+
import { t as HookSystem } from "../HookSystem-BjFu7zf1.mjs";
|
|
6
|
+
import { t as ResourceRegistry } from "../ResourceRegistry-Dtcojmu8.mjs";
|
|
7
|
+
import { n as caching_default, t as cachingPlugin } from "../caching-CHH-iHs3.mjs";
|
|
8
|
+
import { t as errorHandlerPlugin } from "../errorHandler-Cw34h_om.mjs";
|
|
9
|
+
import { n as metrics_default, t as metricsPlugin } from "../metrics-DuhiSEZI.mjs";
|
|
10
|
+
import { t as replyHelpersPlugin } from "../replyHelpers-CXtJDAZ0.mjs";
|
|
11
|
+
import { n as sse_default, t as ssePlugin } from "../sse-CD5Hghpu.mjs";
|
|
12
|
+
import { n as versioning_default, t as versioningPlugin } from "../versioning-CPU_5Xfs.mjs";
|
|
13
13
|
import { randomUUID } from "node:crypto";
|
|
14
14
|
import fp from "fastify-plugin";
|
|
15
15
|
//#region src/core/arcCorePlugin.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as traced, i as isTracingAvailable, n as _default, r as createSpan, t as TracingOptions } from "../tracing-
|
|
1
|
+
import { a as traced, i as isTracingAvailable, n as _default, r as createSpan, t as TracingOptions } from "../tracing-xqXzWeaf.mjs";
|
|
2
2
|
export { type TracingOptions, createSpan, isTracingAvailable, traced, _default as tracingPlugin };
|
|
@@ -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.
|
|
47
|
+
const resolvedVersion = serviceVersion ?? "2.8.1";
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ht as IControllerResponse, Ut as IRequestContext, m as AnyRecord, on as PaginationResult, tt as PresetResult, ut as ResourceConfig } from "../interface-CS6d7HiB.mjs";
|
|
2
2
|
import { MultiTenantOptions, TenantFieldSpec, multiTenantPreset } from "./multiTenant.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/presets/ownedByUser.d.ts
|
|
@@ -57,7 +57,7 @@ declare function treePreset(options?: TreeOptions): PresetResult;
|
|
|
57
57
|
*
|
|
58
58
|
* **Repository Requirements:**
|
|
59
59
|
* Your repository must implement:
|
|
60
|
-
* - `getDeleted(options): Promise<
|
|
60
|
+
* - `getDeleted(params?, options?): Promise<PaginationResult<T> | T[]>`
|
|
61
61
|
* - `restore(id): Promise<T | null>`
|
|
62
62
|
*
|
|
63
63
|
* @example
|
|
@@ -77,7 +77,7 @@ interface ISoftDeleteController<TDoc = unknown> {
|
|
|
77
77
|
* Get all soft-deleted items
|
|
78
78
|
* Called by: GET /deleted
|
|
79
79
|
*/
|
|
80
|
-
getDeleted(req: IRequestContext): Promise<IControllerResponse<
|
|
80
|
+
getDeleted(req: IRequestContext): Promise<IControllerResponse<PaginationResult<TDoc>>>;
|
|
81
81
|
/**
|
|
82
82
|
* Restore a soft-deleted item by ID
|
|
83
83
|
* Called by: POST /:id/restore
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as EventTransport, n as EventHandler, r as EventLogger, t as DomainEvent } from "./EventTransport-
|
|
1
|
+
import { i as EventTransport, n as EventHandler, r as EventLogger, t as DomainEvent } from "./EventTransport-CLXJUzyT.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/events/transports/redis-stream.d.ts
|
|
4
4
|
interface RedisStreamLike {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Gt as RegisterOptions, H as IntrospectionPluginOptions, Kt as ResourceRegistry } from "../interface-CS6d7HiB.mjs";
|
|
2
2
|
import { FastifyPluginAsync } from "fastify";
|
|
3
3
|
|
|
4
4
|
//#region src/registry/introspectionPlugin.d.ts
|
package/dist/registry/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as introspectionPlugin_default, t as introspectionPlugin } from "../registry-
|
|
2
|
-
import { t as ResourceRegistry } from "../ResourceRegistry-
|
|
1
|
+
import { n as introspectionPlugin_default, t as introspectionPlugin } from "../registry-B0Wl7uVV.mjs";
|
|
2
|
+
import { t as ResourceRegistry } from "../ResourceRegistry-Dtcojmu8.mjs";
|
|
3
3
|
export { ResourceRegistry, introspectionPlugin_default as introspectionPlugin, introspectionPlugin as introspectionPluginFn };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as BaseController } from "./BaseController-
|
|
1
|
+
import { t as BaseController } from "./BaseController-DAGGc5Xn.mjs";
|
|
2
2
|
import { n as normalizePermissionResult } from "./applyPermissionResult-D6GPMsvh.mjs";
|
|
3
|
-
import { t as pluralize } from "./pluralize-
|
|
3
|
+
import { t as pluralize } from "./pluralize-BneOJkpi.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/integrations/mcp/createMcpServer.ts
|
|
6
6
|
/**
|
|
@@ -274,6 +274,15 @@ function buildRequestContext(input, auth, operation, policyFilters, scopeOverrid
|
|
|
274
274
|
query: {},
|
|
275
275
|
body: void 0
|
|
276
276
|
};
|
|
277
|
+
case "action": {
|
|
278
|
+
const { id: _actionId, ...actionBody } = input;
|
|
279
|
+
return {
|
|
280
|
+
...base,
|
|
281
|
+
params: { id: String(_actionId ?? "") },
|
|
282
|
+
query: {},
|
|
283
|
+
body: actionBody
|
|
284
|
+
};
|
|
285
|
+
}
|
|
277
286
|
}
|
|
278
287
|
}
|
|
279
288
|
/**
|
|
@@ -548,7 +557,6 @@ const ANNOTATIONS = {
|
|
|
548
557
|
*/
|
|
549
558
|
function resourceToTools(resource, config = {}) {
|
|
550
559
|
const controller = resource.controller ?? (resource.adapter ? createMcpController(resource) : void 0);
|
|
551
|
-
if (!controller) return [];
|
|
552
560
|
const explicitFieldRules = resource.schemaOptions?.fieldRules;
|
|
553
561
|
const hiddenFields = resource.schemaOptions?.hiddenFields;
|
|
554
562
|
const readonlyFields = resource.schemaOptions?.readonlyFields;
|
|
@@ -558,72 +566,101 @@ function resourceToTools(resource, config = {}) {
|
|
|
558
566
|
const sortableFields = resource.queryParser?.allowedSortFields;
|
|
559
567
|
const allowedOperators = resource.queryParser?.allowedOperators;
|
|
560
568
|
const hasSoftDelete = resource._appliedPresets?.includes("softDelete") ?? false;
|
|
561
|
-
let ops = ALL_CRUD_OPS.filter((op) => {
|
|
562
|
-
if (resource.disabledRoutes?.includes(op)) return false;
|
|
563
|
-
return true;
|
|
564
|
-
});
|
|
565
|
-
if (config.operations) ops = ops.filter((op) => config.operations?.includes(op));
|
|
566
569
|
const tools = [];
|
|
567
570
|
const prefix = config.toolNamePrefix;
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
description: config.descriptions?.[op] ?? defaultDescription(op, resource.displayName, hasSoftDelete, {
|
|
573
|
-
filterableFields,
|
|
574
|
-
allowedOperators,
|
|
575
|
-
sortableFields
|
|
576
|
-
}),
|
|
577
|
-
annotations: ANNOTATIONS[op],
|
|
578
|
-
inputSchema: buildInputSchema(op, fieldRules, {
|
|
579
|
-
hiddenFields,
|
|
580
|
-
readonlyFields,
|
|
581
|
-
extraHideFields: config.hideFields,
|
|
582
|
-
filterableFields,
|
|
583
|
-
allowedOperators,
|
|
584
|
-
adapterBodies
|
|
585
|
-
}),
|
|
586
|
-
handler: createHandler(op, controller, resource.name, resource.permissions)
|
|
571
|
+
if (!controller) {} else {
|
|
572
|
+
let ops = ALL_CRUD_OPS.filter((op) => {
|
|
573
|
+
if (resource.disabledRoutes?.includes(op)) return false;
|
|
574
|
+
return true;
|
|
587
575
|
});
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
576
|
+
if (config.operations) ops = ops.filter((op) => config.operations?.includes(op));
|
|
577
|
+
for (const op of ops) {
|
|
578
|
+
const name = config.names?.[op] ?? (op === "list" ? `${prefix ? `${prefix}_` : ""}list_${pluralize(resource.name)}` : `${prefix ? `${prefix}_` : ""}${op}_${resource.name}`);
|
|
579
|
+
tools.push({
|
|
580
|
+
name,
|
|
581
|
+
description: config.descriptions?.[op] ?? defaultDescription(op, resource.displayName, hasSoftDelete, {
|
|
582
|
+
filterableFields,
|
|
583
|
+
allowedOperators,
|
|
584
|
+
sortableFields
|
|
585
|
+
}),
|
|
586
|
+
annotations: ANNOTATIONS[op],
|
|
587
|
+
inputSchema: buildInputSchema(op, fieldRules, {
|
|
588
|
+
hiddenFields,
|
|
589
|
+
readonlyFields,
|
|
590
|
+
extraHideFields: config.hideFields,
|
|
591
|
+
filterableFields,
|
|
592
|
+
allowedOperators,
|
|
593
|
+
adapterBodies
|
|
594
|
+
}),
|
|
595
|
+
handler: createHandler(op, controller, resource.name, resource.permissions)
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
for (const route of resource.additionalRoutes ?? []) {
|
|
599
|
+
if (route.mcp === false) continue;
|
|
600
|
+
const mcpHandler = route.mcpHandler;
|
|
601
|
+
if (!route.wrapHandler && !mcpHandler) continue;
|
|
602
|
+
if (!mcpHandler && ![
|
|
603
|
+
"POST",
|
|
604
|
+
"PUT",
|
|
605
|
+
"PATCH",
|
|
606
|
+
"DELETE"
|
|
607
|
+
].includes(route.method)) continue;
|
|
608
|
+
const opName = route.operation ?? slugifyRoute(route.method, route.path);
|
|
609
|
+
const hasId = route.path.includes(":id");
|
|
610
|
+
const mcpConfig = typeof route.mcp === "object" && route.mcp !== null ? route.mcp : void 0;
|
|
611
|
+
const toolDescription = mcpConfig?.description ?? route.summary ?? route.description ?? `${opName} on ${resource.displayName}`;
|
|
612
|
+
const toolAnnotations = mcpConfig?.annotations ? { ...mcpConfig.annotations } : { openWorldHint: true };
|
|
613
|
+
const inputShape = {};
|
|
614
|
+
if (hasId) inputShape.id = z.string().describe("Resource ID");
|
|
615
|
+
if (mcpHandler) tools.push({
|
|
616
|
+
name: prefix ? `${prefix}_${opName}_${resource.name}` : `${opName}_${resource.name}`,
|
|
617
|
+
description: toolDescription,
|
|
618
|
+
annotations: toolAnnotations,
|
|
619
|
+
inputSchema: inputShape,
|
|
620
|
+
handler: async (input, _ctx) => {
|
|
621
|
+
try {
|
|
622
|
+
return await mcpHandler(input);
|
|
623
|
+
} catch (err) {
|
|
624
|
+
return {
|
|
625
|
+
content: [{
|
|
626
|
+
type: "text",
|
|
627
|
+
text: `Error: ${err instanceof Error ? err.message : String(err)}`
|
|
628
|
+
}],
|
|
629
|
+
isError: true
|
|
630
|
+
};
|
|
631
|
+
}
|
|
618
632
|
}
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
633
|
+
});
|
|
634
|
+
else tools.push({
|
|
635
|
+
name: prefix ? `${prefix}_${opName}_${resource.name}` : `${opName}_${resource.name}`,
|
|
636
|
+
description: toolDescription,
|
|
637
|
+
annotations: toolAnnotations,
|
|
638
|
+
inputSchema: inputShape,
|
|
639
|
+
handler: createAdditionalRouteHandler(route, controller, hasId)
|
|
640
|
+
});
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
if (resource.actions) for (const [actionName, entry] of Object.entries(resource.actions)) {
|
|
644
|
+
const def = typeof entry === "function" ? { handler: entry } : entry;
|
|
645
|
+
if (typeof def !== "function" && "mcp" in def && def.mcp === false) continue;
|
|
646
|
+
const mcpCfg = typeof def !== "function" && typeof def.mcp === "object" ? def.mcp : void 0;
|
|
647
|
+
const description = mcpCfg?.description ?? (typeof def !== "function" ? def.description : void 0) ?? `${actionName} action on ${resource.displayName}`;
|
|
648
|
+
const annotations = mcpCfg?.annotations ? { ...mcpCfg.annotations } : { destructiveHint: true };
|
|
649
|
+
const inputShape = { id: z.string().describe("Resource ID") };
|
|
650
|
+
const rawSchema = typeof def !== "function" ? def.schema : void 0;
|
|
651
|
+
if (rawSchema && typeof rawSchema === "object") {
|
|
652
|
+
const converted = convertActionSchemaToZod(rawSchema);
|
|
653
|
+
for (const [key, val] of Object.entries(converted)) inputShape[key] = val;
|
|
654
|
+
}
|
|
655
|
+
const toolName = prefix ? `${prefix}_${actionName}_${resource.name}` : `${actionName}_${resource.name}`;
|
|
656
|
+
const handler = typeof entry === "function" ? entry : def.handler;
|
|
657
|
+
const actionPerms = (typeof def !== "function" ? def.permissions : void 0) ?? resource.actionPermissions;
|
|
658
|
+
tools.push({
|
|
659
|
+
name: toolName,
|
|
660
|
+
description: String(description),
|
|
661
|
+
annotations,
|
|
625
662
|
inputSchema: inputShape,
|
|
626
|
-
handler:
|
|
663
|
+
handler: createActionToolHandler(actionName, handler, actionPerms, resource.name, resource.permissions)
|
|
627
664
|
});
|
|
628
665
|
}
|
|
629
666
|
return tools;
|
|
@@ -889,5 +926,98 @@ function createMcpController(resource) {
|
|
|
889
926
|
matchesFilter: resource.adapter?.matchesFilter
|
|
890
927
|
});
|
|
891
928
|
}
|
|
929
|
+
/**
|
|
930
|
+
* Convert an action schema (JSON Schema, Zod, or legacy field map) to a Zod
|
|
931
|
+
* shape for MCP tool input. This mirrors `normalizeActionSchema` in
|
|
932
|
+
* `createActionRouter.ts` but produces Zod types for the MCP SDK.
|
|
933
|
+
*/
|
|
934
|
+
function convertActionSchemaToZod(raw) {
|
|
935
|
+
if ("_zod" in raw && typeof raw.shape === "object") return { ...raw.shape };
|
|
936
|
+
if ((raw.type === "object" || "properties" in raw) && typeof raw.properties === "object" && raw.properties !== null) {
|
|
937
|
+
const props = raw.properties;
|
|
938
|
+
return jsonSchemaPropsToZod(props, new Set(Array.isArray(raw.required) ? raw.required : []));
|
|
939
|
+
}
|
|
940
|
+
const result = {};
|
|
941
|
+
for (const [fieldName, fieldSchema] of Object.entries(raw)) {
|
|
942
|
+
if (fieldName === "type" || fieldName === "properties" || fieldName === "required") continue;
|
|
943
|
+
if (!fieldSchema || typeof fieldSchema !== "object") continue;
|
|
944
|
+
const fs = fieldSchema;
|
|
945
|
+
const desc = typeof fs.description === "string" ? fs.description : `${fieldName} field`;
|
|
946
|
+
const isOptional = fs.required === false;
|
|
947
|
+
const base = jsonSchemaTypeToZod(fs);
|
|
948
|
+
result[fieldName] = isOptional ? base.optional().describe(desc) : base.describe(desc);
|
|
949
|
+
}
|
|
950
|
+
return result;
|
|
951
|
+
}
|
|
952
|
+
function jsonSchemaPropsToZod(props, requiredSet) {
|
|
953
|
+
const result = {};
|
|
954
|
+
for (const [name, schema] of Object.entries(props)) {
|
|
955
|
+
const desc = typeof schema.description === "string" ? schema.description : name;
|
|
956
|
+
const base = jsonSchemaTypeToZod(schema);
|
|
957
|
+
result[name] = requiredSet.has(name) ? base.describe(desc) : base.optional().describe(desc);
|
|
958
|
+
}
|
|
959
|
+
return result;
|
|
960
|
+
}
|
|
961
|
+
function jsonSchemaTypeToZod(schema) {
|
|
962
|
+
const type = typeof schema.type === "string" ? schema.type : "string";
|
|
963
|
+
if (Array.isArray(schema.enum) && schema.enum.length > 0) return z.enum(schema.enum);
|
|
964
|
+
switch (type) {
|
|
965
|
+
case "number":
|
|
966
|
+
case "integer": return z.number();
|
|
967
|
+
case "boolean": return z.boolean();
|
|
968
|
+
case "array": return z.array(z.unknown());
|
|
969
|
+
case "object": return z.record(z.string(), z.unknown());
|
|
970
|
+
default: return z.string();
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* Create an MCP tool handler for a declarative action.
|
|
975
|
+
*
|
|
976
|
+
* Uses the SAME `evaluatePermission()` and `buildRequestContext()` as
|
|
977
|
+
* CRUD tools — single code path for permission side effects, scope
|
|
978
|
+
* construction, and request context assembly. This eliminates the
|
|
979
|
+
* DRY/drift risk flagged in the review: REST and MCP action tools now
|
|
980
|
+
* share identical context-building machinery.
|
|
981
|
+
*/
|
|
982
|
+
function createActionToolHandler(actionName, handler, permissions, resourceName, _resourcePermissions) {
|
|
983
|
+
return async (input, ctx) => {
|
|
984
|
+
const session = ctx.session;
|
|
985
|
+
const permResult = await evaluatePermission(permissions, session, resourceName, actionName, input);
|
|
986
|
+
if (permResult && !permResult.granted) return {
|
|
987
|
+
content: [{
|
|
988
|
+
type: "text",
|
|
989
|
+
text: JSON.stringify({
|
|
990
|
+
success: false,
|
|
991
|
+
error: permResult.reason ?? `Permission denied for action '${actionName}'`
|
|
992
|
+
})
|
|
993
|
+
}],
|
|
994
|
+
isError: true
|
|
995
|
+
};
|
|
996
|
+
const reqCtx = buildRequestContext({
|
|
997
|
+
...input,
|
|
998
|
+
action: actionName
|
|
999
|
+
}, session, "action", permResult?.filters, permResult?.scope);
|
|
1000
|
+
const id = typeof input.id === "string" ? input.id : "";
|
|
1001
|
+
const { id: _discardId, ...data } = input;
|
|
1002
|
+
try {
|
|
1003
|
+
const result = await handler(id, data, reqCtx);
|
|
1004
|
+
return { content: [{
|
|
1005
|
+
type: "text",
|
|
1006
|
+
text: JSON.stringify({
|
|
1007
|
+
success: true,
|
|
1008
|
+
data: result
|
|
1009
|
+
})
|
|
1010
|
+
}] };
|
|
1011
|
+
} catch (err) {
|
|
1012
|
+
return {
|
|
1013
|
+
content: [{
|
|
1014
|
+
type: "text",
|
|
1015
|
+
text: `Error: ${err instanceof Error ? err.message : String(err)}`
|
|
1016
|
+
}],
|
|
1017
|
+
isError: true
|
|
1018
|
+
};
|
|
1019
|
+
}
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
892
1022
|
//#endregion
|
|
893
1023
|
export { fieldRulesToZod as n, createMcpServer as r, resourceToTools as t };
|
package/dist/rpc/index.d.mts
CHANGED
package/dist/rpc/index.mjs
CHANGED
package/dist/scope/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as isAuthenticated, a as getClientId, b as isOrgInScope, c as getOrgRoles, d as getScopeContextMap, f as getServiceScopes, g as hasOrgAccess, h as getUserRoles, i as getAncestorOrgIds, l as getRequestScope, m as getUserId, n as PUBLIC_SCOPE, o as getOrgContext, p as getTeamId, r as RequestScope, s as getOrgId, t as AUTHENTICATED_SCOPE, u as getScopeContext, v as isElevated, x as isService, y as isMember } from "../types
|
|
2
|
-
import { i as elevationPlugin, n as ElevationOptions, r as _default, t as ElevationEvent } from "../elevation-
|
|
1
|
+
import { _ as isAuthenticated, a as getClientId, b as isOrgInScope, c as getOrgRoles, d as getScopeContextMap, f as getServiceScopes, g as hasOrgAccess, h as getUserRoles, i as getAncestorOrgIds, l as getRequestScope, m as getUserId, n as PUBLIC_SCOPE, o as getOrgContext, p as getTeamId, r as RequestScope, s as getOrgId, t as AUTHENTICATED_SCOPE, u as getScopeContext, v as isElevated, x as isService, y as isMember } from "../types-CN6JvmYz.mjs";
|
|
2
|
+
import { i as elevationPlugin, n as ElevationOptions, r as _default, t as ElevationEvent } from "../elevation-UJO3-NvX.mjs";
|
|
3
3
|
import { FastifyReply, FastifyRequest } from "fastify";
|
|
4
4
|
|
|
5
5
|
//#region src/scope/rateLimitKey.d.ts
|
package/dist/scope/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as isElevated, a as getOrgContext, b as isService, c as getRequestScope, d as getServiceScopes, f as getTeamId, g as isAuthenticated, h as hasOrgAccess, i as getClientId, l as getScopeContext, m as getUserRoles, n as PUBLIC_SCOPE, o as getOrgId, p as getUserId, r as getAncestorOrgIds, s as getOrgRoles, t as AUTHENTICATED_SCOPE, u as getScopeContextMap, v as isMember, y as isOrgInScope } from "../types-AOD8fxIw.mjs";
|
|
2
2
|
import { n as normalizeRoles } from "../types-ZUu_h0jp.mjs";
|
|
3
|
-
import { n as elevation_default, t as elevationPlugin } from "../elevation-
|
|
3
|
+
import { n as elevation_default, t as elevationPlugin } from "../elevation-BBGFjzIP.mjs";
|
|
4
4
|
//#region src/scope/rateLimitKey.ts
|
|
5
5
|
function createTenantKeyGenerator(opts) {
|
|
6
6
|
if (opts?.strategy) return opts.strategy;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-BpYLSNr0.mjs";
|
|
2
2
|
import { n as PUBLIC_SCOPE, o as getOrgId } from "./types-AOD8fxIw.mjs";
|
|
3
|
-
import { t as arcLog } from "./logger-
|
|
3
|
+
import { t as arcLog } from "./logger-CDjpjySd.mjs";
|
|
4
4
|
import fp from "fastify-plugin";
|
|
5
5
|
//#region src/plugins/sse.ts
|
|
6
6
|
var sse_exports = /* @__PURE__ */ __exportAll({
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as ResourceLike, r as CreateAppOptions } from "../types-
|
|
1
|
+
import { Zt as CrudRepository, m as AnyRecord, qt as ResourceDefinition } from "../interface-CS6d7HiB.mjs";
|
|
2
|
+
import { d as ResourceLike, r as CreateAppOptions } from "../types-BlOuKTPw.mjs";
|
|
3
3
|
import Fastify, { FastifyInstance, FastifyServerOptions } from "fastify";
|
|
4
4
|
import { Connection } from "mongoose";
|
|
5
5
|
import { Mock } from "vitest";
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1796,7 +1796,7 @@ function runEventTests(resourceName, displayName, events) {
|
|
|
1796
1796
|
* ```
|
|
1797
1797
|
*/
|
|
1798
1798
|
async function createTestApp(options = {}) {
|
|
1799
|
-
const { createApp } = await import("../createApp-
|
|
1799
|
+
const { createApp } = await import("../createApp-p2OThysU.mjs").then((n) => n.r);
|
|
1800
1800
|
const { useInMemoryDb = true, mongoUri: providedMongoUri, ...appOptions } = options;
|
|
1801
1801
|
const defaultAuth = {
|
|
1802
1802
|
type: "jwt",
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as isAuthenticated, c as getOrgRoles, g as hasOrgAccess, n as PUBLIC_SCOPE, p as getTeamId, r as RequestScope, s as getOrgId, t as AUTHENTICATED_SCOPE, v as isElevated, y as isMember } from "../types
|
|
2
|
-
import { $ as
|
|
3
|
-
import { i as UserBase, n as PermissionContext, r as PermissionResult, t as PermissionCheck } from "../types-
|
|
4
|
-
import { n as ElevationOptions, t as ElevationEvent } from "../elevation-
|
|
5
|
-
export { AUTHENTICATED_SCOPE, AdditionalRoute, AnyRecord, ApiResponse, ArcDecorator, ArcInternalMetadata, ArcRequest, AuthHelpers, AuthPluginOptions, Authenticator, AuthenticatorContext, BaseControllerOptions, ConfigError, ControllerHandler, ControllerLike, ControllerQueryOptions, CrudController, CrudRepository, CrudRouteKey, CrudRouterOptions, CrudSchemas, ElevationEvent, ElevationOptions, EventDefinition, EventsDecorator, FastifyHandler, FastifyRequestExtras, FastifyWithAuth, FastifyWithDecorators, FieldRule, GracefulShutdownOptions, HealthCheck, HealthOptions, IController, IControllerResponse, IRequestContext, InferAdapterDoc, InferDoc, InferDocType, InferResourceDoc, IntrospectionData, IntrospectionPluginOptions, JWTPayload, JwtContext, LookupOption, MiddlewareConfig, MiddlewareHandler, ObjectId, OpenApiSchemas, OwnershipCheck, PUBLIC_SCOPE, PaginatedResult, PaginationParams, ParsedQuery, PermissionCheck, PermissionContext, PermissionResult, PopulateOption, PresetFunction, PresetHook, PresetResult, QueryOptions, QueryParserInterface, RateLimitConfig, RegistryEntry, RegistryStats, RequestContext, RequestIdOptions, RequestScope, RequestWithExtras, ResourceCacheConfig, ResourceConfig, ResourceHookContext, ResourceHooks, ResourceMetadata, ResourcePermissions, RouteHandler, RouteHandlerMethod, RouteSchemaOptions, ServiceContext, TokenPair, TypedController, TypedRepository, TypedResourceConfig, UserBase, UserLike, UserOrganization, ValidateOptions, ValidationResult, envelope, getOrgId, getOrgRoles, getTeamId, getUserId, hasOrgAccess, isAuthenticated, isElevated, isMember };
|
|
1
|
+
import { _ as isAuthenticated, c as getOrgRoles, g as hasOrgAccess, n as PUBLIC_SCOPE, p as getTeamId, r as RequestScope, s as getOrgId, t as AUTHENTICATED_SCOPE, v as isElevated, y as isMember } from "../types-CN6JvmYz.mjs";
|
|
2
|
+
import { $ as PresetFunction, $t as DeleteOptions, A as EventsDecorator, B as InferResourceDoc, Bt as FastifyHandler, C as ConfigError, Ct as TypedResourceConfig, D as CrudRouterOptions, Dt as ValidationResult, E as CrudRouteKey, Et as ValidateOptions, F as GracefulShutdownOptions, G as LookupOption, H as IntrospectionPluginOptions, Ht as IControllerResponse, I as HealthCheck, J as ObjectId, K as MiddlewareConfig, L as HealthOptions, M as FastifyWithAuth, N as FastifyWithDecorators, O as CrudSchemas, Ot as envelope, P as FieldRule, Q as PopulateOption, Qt as DeleteManyResult, R as InferAdapterDoc, Rt as ControllerHandler, S as AuthenticatorContext, St as TypedRepository, T as CrudController, Tt as UserOrganization, U as JWTPayload, Ut as IRequestContext, V as IntrospectionData, Vt as IController, W as JwtContext, Wt as RouteHandler, X as OwnershipCheck, Xt as BulkWriteResult, Y as OpenApiSchemas, Yt as BulkWriteOperation, Z as ParsedQuery, Zt as CrudRepository, _ as ArcInternalMetadata, _t as RouteMcpConfig, an as PaginationParams, at as RegistryStats, b as AuthPluginOptions, bt as TokenPair, cn as RepositorySession, ct as RequestWithExtras, d as ActionHandlerFn, dt as ResourceHookContext, en as DeleteResult, et as PresetHook, f as ActionsMap, ft as ResourceHooks, g as ArcDecorator, gt as RouteHandlerMethod, h as ApiResponse, ht as RouteDefinition, in as PaginatedResult, it as RegistryEntry, j as FastifyRequestExtras, jt as BaseControllerOptions, k as EventDefinition, kt as getUserId, l as ActionDefinition, ln as UpdateManyResult, lt as ResourceCacheConfig, m as AnyRecord, mt as ResourcePermissions, nn as KeysetPaginatedResult, nt as QueryParserInterface, on as PaginationResult, ot as RequestContext, p as AdditionalRoute, pt as ResourceMetadata, q as MiddlewareHandler, rn as OffsetPaginatedResult, rt as RateLimitConfig, sn as QueryOptions, st as RequestIdOptions, tn as InferDoc, tt as PresetResult, u as ActionEntry, un as WriteOptions, ut as ResourceConfig, v as ArcRequest, vt as RouteSchemaOptions, w as ControllerQueryOptions, wt as UserLike, x as Authenticator, xt as TypedController, y as AuthHelpers, yt as ServiceContext, z as InferDocType, zt as ControllerLike } from "../interface-CS6d7HiB.mjs";
|
|
3
|
+
import { i as UserBase, n as PermissionContext, r as PermissionResult, t as PermissionCheck } from "../types-BoaZHr-2.mjs";
|
|
4
|
+
import { n as ElevationOptions, t as ElevationEvent } from "../elevation-UJO3-NvX.mjs";
|
|
5
|
+
export { AUTHENTICATED_SCOPE, ActionDefinition, ActionEntry, ActionHandlerFn, ActionsMap, AdditionalRoute, AnyRecord, ApiResponse, ArcDecorator, ArcInternalMetadata, ArcRequest, AuthHelpers, AuthPluginOptions, Authenticator, AuthenticatorContext, BaseControllerOptions, BulkWriteOperation, BulkWriteResult, ConfigError, ControllerHandler, ControllerLike, ControllerQueryOptions, CrudController, CrudRepository, CrudRouteKey, CrudRouterOptions, CrudSchemas, DeleteManyResult, DeleteOptions, DeleteResult, ElevationEvent, ElevationOptions, EventDefinition, EventsDecorator, FastifyHandler, FastifyRequestExtras, FastifyWithAuth, FastifyWithDecorators, FieldRule, GracefulShutdownOptions, HealthCheck, HealthOptions, IController, IControllerResponse, IRequestContext, InferAdapterDoc, InferDoc, InferDocType, InferResourceDoc, IntrospectionData, IntrospectionPluginOptions, JWTPayload, JwtContext, KeysetPaginatedResult, LookupOption, MiddlewareConfig, MiddlewareHandler, ObjectId, OffsetPaginatedResult, OpenApiSchemas, OwnershipCheck, PUBLIC_SCOPE, PaginatedResult, PaginationParams, PaginationResult, ParsedQuery, PermissionCheck, PermissionContext, PermissionResult, PopulateOption, PresetFunction, PresetHook, PresetResult, QueryOptions, QueryParserInterface, RateLimitConfig, RegistryEntry, RegistryStats, RepositorySession, RequestContext, RequestIdOptions, RequestScope, RequestWithExtras, ResourceCacheConfig, ResourceConfig, ResourceHookContext, ResourceHooks, ResourceMetadata, ResourcePermissions, RouteDefinition, RouteHandler, RouteHandlerMethod, RouteMcpConfig, RouteSchemaOptions, ServiceContext, TokenPair, TypedController, TypedRepository, TypedResourceConfig, UpdateManyResult, UserBase, UserLike, UserOrganization, ValidateOptions, ValidationResult, WriteOptions, envelope, getOrgId, getOrgRoles, getTeamId, getUserId, hasOrgAccess, isAuthenticated, isElevated, isMember };
|