@classytic/arc 2.14.1 → 2.15.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-Dv60tU83.mjs → BaseController-Cn8KykUn.mjs} +101 -2
- package/dist/auth/index.d.mts +1 -1
- package/dist/{buildHandler-BamHHpH8.mjs → buildHandler-jSZ6Fdvi.mjs} +64 -4
- package/dist/cli/commands/describe.d.mts +1 -1
- package/dist/core/index.d.mts +3 -3
- package/dist/core/index.mjs +2 -2
- package/dist/{core-DEdN6zKD.mjs → core--_Dnl7n-.mjs} +67 -12
- package/dist/{createAggregationRouter-Bk-58SbZ.mjs → createAggregationRouter-DhR-Ofiz.mjs} +1 -1
- package/dist/docs/index.d.mts +1 -1
- package/dist/factory/index.d.mts +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/{index-D1-Kp_dP.d.mts → index-BstGxcc3.d.mts} +1 -1
- package/dist/{index-Dwc0orNd.d.mts → index-BswOSJCE.d.mts} +88 -17
- package/dist/{index-Bt0F3nJj.d.mts → index-bRjYu21O.d.mts} +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +3 -3
- 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/middleware/index.d.mts +1 -1
- package/dist/org/index.d.mts +1 -1
- package/dist/pipeline/index.d.mts +1 -1
- package/dist/plugins/index.d.mts +1 -1
- package/dist/plugins/tracing-entry.mjs +1 -1
- package/dist/presets/filesUpload.d.mts +1 -1
- package/dist/presets/index.d.mts +1 -1
- package/dist/presets/multiTenant.d.mts +1 -1
- package/dist/presets/search.d.mts +1 -1
- package/dist/registry/index.d.mts +1 -1
- package/dist/{resourceToTools-CZ-ZhS7v.mjs → resourceToTools-D4pWzVGA.mjs} +2 -2
- package/dist/testing/index.d.mts +2 -2
- package/dist/testing/index.mjs +10 -13
- package/dist/types/index.d.mts +1 -1
- package/dist/{types-NGtx3uxV.d.mts → types-3YTpuLZ1.d.mts} +1 -1
- package/dist/{types-C6ONJ_Z2.d.mts → types-BQsjgQzS.d.mts} +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/package.json +1 -1
|
@@ -481,9 +481,20 @@ var BaseCrudController = class {
|
|
|
481
481
|
resourceName;
|
|
482
482
|
tenantField;
|
|
483
483
|
idField = "_id";
|
|
484
|
-
/**
|
|
484
|
+
/**
|
|
485
|
+
* Composable access control (ID filtering, policy checks, org scope, ownership).
|
|
486
|
+
*
|
|
487
|
+
* Not `readonly` since 2.15.0 — `configure()` rebuilds it when the host
|
|
488
|
+
* supplies tenant/idField/matchesFilter post-construction. Same model as
|
|
489
|
+
* `queryResolver` after `setQueryParser` shipped in 2.10.9.
|
|
490
|
+
*/
|
|
485
491
|
accessControl;
|
|
486
|
-
/**
|
|
492
|
+
/**
|
|
493
|
+
* Composable body sanitization (field permissions, system fields).
|
|
494
|
+
*
|
|
495
|
+
* Not `readonly` since 2.15.0 — `configure()` rebuilds it when the host
|
|
496
|
+
* supplies schemaOptions/onFieldWriteDenied post-construction.
|
|
497
|
+
*/
|
|
487
498
|
bodySanitizer;
|
|
488
499
|
/**
|
|
489
500
|
* Composable query resolution (parsing, pagination, sort, select/populate).
|
|
@@ -548,6 +559,94 @@ var BaseCrudController = class {
|
|
|
548
559
|
this.queryResolver.setParser(queryParser);
|
|
549
560
|
}
|
|
550
561
|
/**
|
|
562
|
+
* Apply resource-level options to a custom controller AFTER construction.
|
|
563
|
+
*
|
|
564
|
+
* Closes the pre-2.15 footgun where `defineResource({ controller, tenantField,
|
|
565
|
+
* schemaOptions, ... })` warned that the options were "dropped" because the
|
|
566
|
+
* user-supplied controller never received them. Hosts had to remember to
|
|
567
|
+
* forward each one through `super(repo, { ... })` — easy to miss, silently
|
|
568
|
+
* mis-scopes queries when missed.
|
|
569
|
+
*
|
|
570
|
+
* `defineResource()` now calls `controller.configure(resolvedOpts)` after
|
|
571
|
+
* `resolveOrAutoCreateController()` runs. Configure-aware controllers receive
|
|
572
|
+
* the resolved values; arc skips the dropped-options warn for them.
|
|
573
|
+
*
|
|
574
|
+
* Only the keys that affect cross-cutting state (tenant scope, schema/field
|
|
575
|
+
* rules, sort/limit policy, cache, write-denial policy) are honoured —
|
|
576
|
+
* `repository` / `resourceName` are constructor-only because they participate
|
|
577
|
+
* in mixin composition. Each known key rebuilds the affected sub-component
|
|
578
|
+
* (AccessControl / BodySanitizer / QueryResolver) so referentially-stable
|
|
579
|
+
* consumers don't see stale state.
|
|
580
|
+
*
|
|
581
|
+
* Idempotent: safe to call zero, one, or many times before first request;
|
|
582
|
+
* arc calls it exactly once.
|
|
583
|
+
*
|
|
584
|
+
* Type narrowed to `ControllerConfigurableOptions` — `resourceName` is
|
|
585
|
+
* construction-only and intentionally excluded so accidental "rename
|
|
586
|
+
* the resource at runtime" calls fail to typecheck.
|
|
587
|
+
*/
|
|
588
|
+
configure(options) {
|
|
589
|
+
let rebuildAccessControl = false;
|
|
590
|
+
let rebuildBodySanitizer = false;
|
|
591
|
+
let rebuildQueryResolver = false;
|
|
592
|
+
let bodySanitizerOnFieldWriteDenied;
|
|
593
|
+
let resolverDefaultSort;
|
|
594
|
+
if (options.tenantField !== void 0) {
|
|
595
|
+
this.tenantField = options.tenantField;
|
|
596
|
+
rebuildAccessControl = true;
|
|
597
|
+
rebuildQueryResolver = true;
|
|
598
|
+
}
|
|
599
|
+
if (options.idField !== void 0) {
|
|
600
|
+
this.idField = options.idField;
|
|
601
|
+
rebuildAccessControl = true;
|
|
602
|
+
}
|
|
603
|
+
if (options.matchesFilter !== void 0) {
|
|
604
|
+
this._matchesFilter = options.matchesFilter;
|
|
605
|
+
rebuildAccessControl = true;
|
|
606
|
+
}
|
|
607
|
+
if (options.schemaOptions !== void 0) {
|
|
608
|
+
this.schemaOptions = options.schemaOptions;
|
|
609
|
+
rebuildBodySanitizer = true;
|
|
610
|
+
rebuildQueryResolver = true;
|
|
611
|
+
}
|
|
612
|
+
if (options.onFieldWriteDenied !== void 0) {
|
|
613
|
+
bodySanitizerOnFieldWriteDenied = options.onFieldWriteDenied;
|
|
614
|
+
rebuildBodySanitizer = true;
|
|
615
|
+
}
|
|
616
|
+
if (options.queryParser !== void 0) this.setQueryParser(options.queryParser);
|
|
617
|
+
if (options.maxLimit !== void 0) {
|
|
618
|
+
this.maxLimit = options.maxLimit;
|
|
619
|
+
rebuildQueryResolver = true;
|
|
620
|
+
}
|
|
621
|
+
if (options.defaultLimit !== void 0) {
|
|
622
|
+
this.defaultLimit = options.defaultLimit;
|
|
623
|
+
rebuildQueryResolver = true;
|
|
624
|
+
}
|
|
625
|
+
if (options.defaultSort !== void 0) {
|
|
626
|
+
resolverDefaultSort = options.defaultSort;
|
|
627
|
+
rebuildQueryResolver = true;
|
|
628
|
+
}
|
|
629
|
+
if (options.cache !== void 0) this._cacheConfig = options.cache;
|
|
630
|
+
if (options.presetFields !== void 0) this._presetFields = options.presetFields;
|
|
631
|
+
if (rebuildAccessControl) this.accessControl = new AccessControl({
|
|
632
|
+
tenantField: this.tenantField,
|
|
633
|
+
idField: this.idField,
|
|
634
|
+
matchesFilter: this._matchesFilter
|
|
635
|
+
});
|
|
636
|
+
if (rebuildBodySanitizer) this.bodySanitizer = new BodySanitizer({
|
|
637
|
+
schemaOptions: this.schemaOptions,
|
|
638
|
+
onFieldWriteDenied: bodySanitizerOnFieldWriteDenied
|
|
639
|
+
});
|
|
640
|
+
if (rebuildQueryResolver) this.queryResolver = new QueryResolver({
|
|
641
|
+
queryParser: this.queryParser,
|
|
642
|
+
maxLimit: this.maxLimit,
|
|
643
|
+
defaultLimit: this.defaultLimit,
|
|
644
|
+
defaultSort: resolverDefaultSort,
|
|
645
|
+
schemaOptions: this.schemaOptions,
|
|
646
|
+
tenantField: this.tenantField
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
551
650
|
* Get the tenant field name if multi-tenant scoping is enabled.
|
|
552
651
|
* Returns `undefined` when `tenantField` is `false`.
|
|
553
652
|
*/
|
package/dist/auth/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Rt as AuthHelpers, zt as AuthPluginOptions } from "../index-
|
|
1
|
+
import { Rt as AuthHelpers, zt as AuthPluginOptions } from "../index-BswOSJCE.mjs";
|
|
2
2
|
import { c as PermissionCheck } from "../fields-COhcH3fk.mjs";
|
|
3
3
|
import { t as ExternalOpenApiPaths } from "../externalPaths-BD5nw6St.mjs";
|
|
4
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-C4Le_UB3.mjs";
|
|
@@ -560,13 +560,73 @@ function parseDateRange(query, field) {
|
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
562
|
/**
|
|
563
|
+
* Bracket-syntax operator shorthand → canonical Mongo operator. Mirrors
|
|
564
|
+
* the `operators` map in `ArcQueryParser` so the aggregation route emits
|
|
565
|
+
* the same shape the CRUD list route produces. Aggregations don't run
|
|
566
|
+
* through the resource-level QueryParser (they have their own URL→IR
|
|
567
|
+
* compile path), so this translation has to happen in arc itself —
|
|
568
|
+
* downstream kits' filter compilers expect canonical `$gte/$lte/$in/...`
|
|
569
|
+
* keys, not bare `gte/lte/in/...` shorthand.
|
|
570
|
+
*/
|
|
571
|
+
const OPERATOR_SHORTHAND = {
|
|
572
|
+
eq: "$eq",
|
|
573
|
+
ne: "$ne",
|
|
574
|
+
gt: "$gt",
|
|
575
|
+
gte: "$gte",
|
|
576
|
+
lt: "$lt",
|
|
577
|
+
lte: "$lte",
|
|
578
|
+
in: "$in",
|
|
579
|
+
nin: "$nin",
|
|
580
|
+
like: "$regex",
|
|
581
|
+
contains: "$regex",
|
|
582
|
+
regex: "$regex",
|
|
583
|
+
exists: "$exists",
|
|
584
|
+
size: "$size",
|
|
585
|
+
type: "$type"
|
|
586
|
+
};
|
|
587
|
+
const SHORTHAND_RANGE_OPS = new Set([
|
|
588
|
+
"gt",
|
|
589
|
+
"gte",
|
|
590
|
+
"lt",
|
|
591
|
+
"lte"
|
|
592
|
+
]);
|
|
593
|
+
const ISO_DATE_RE = /^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})?)?$/;
|
|
594
|
+
function tryCoerceDate(v) {
|
|
595
|
+
if (typeof v !== "string" || !ISO_DATE_RE.test(v)) return v;
|
|
596
|
+
const d = new Date(v);
|
|
597
|
+
return Number.isNaN(d.getTime()) ? v : d;
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Translate a qs-parsed nested-operator object (`{ field: { gte, lte } }`)
|
|
601
|
+
* into Mongo-shape (`{ field: { $gte: Date, $lte: Date } }`). Only fires
|
|
602
|
+
* when EVERY key is a known shorthand operator — leaves user-data
|
|
603
|
+
* objects untouched so callers can still equality-match on a stored
|
|
604
|
+
* sub-document.
|
|
605
|
+
*/
|
|
606
|
+
function expandShorthandOperators(value) {
|
|
607
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return value;
|
|
608
|
+
const nested = value;
|
|
609
|
+
const keys = Object.keys(nested);
|
|
610
|
+
if (keys.length === 0) return value;
|
|
611
|
+
if (!keys.every((k) => !k.startsWith("$") && OPERATOR_SHORTHAND[k] !== void 0)) return value;
|
|
612
|
+
const expanded = {};
|
|
613
|
+
for (const [op, opVal] of Object.entries(nested)) {
|
|
614
|
+
const mongoOp = OPERATOR_SHORTHAND[op];
|
|
615
|
+
if (!mongoOp) continue;
|
|
616
|
+
expanded[mongoOp] = SHORTHAND_RANGE_OPS.has(op) ? tryCoerceDate(opVal) : opVal;
|
|
617
|
+
}
|
|
618
|
+
return expanded;
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
563
621
|
* Strip control params (page/limit/sort/select/...) and the resource-
|
|
564
622
|
* dispatch verbs from the query, leaving only filter predicates the
|
|
565
|
-
* caller used to narrow the aggregation.
|
|
623
|
+
* caller used to narrow the aggregation. Bracket-syntax operator
|
|
624
|
+
* shorthand (`createdAt[gte]=...`) gets translated to canonical Mongo-
|
|
625
|
+
* shape here so kits don't have to reimplement the URL grammar — same
|
|
626
|
+
* contract `ArcQueryParser` enforces for the CRUD list route.
|
|
566
627
|
*
|
|
567
628
|
* The resulting record is shallow-merged into the AggRequest filter
|
|
568
|
-
* via `compileAggRequest`.
|
|
569
|
-
* preserved — the kit's filter compiler handles them.
|
|
629
|
+
* via `compileAggRequest`.
|
|
570
630
|
*/
|
|
571
631
|
function extractCallerFilter(query) {
|
|
572
632
|
const out = {};
|
|
@@ -585,7 +645,7 @@ function extractCallerFilter(query) {
|
|
|
585
645
|
for (const [key, value] of Object.entries(query)) {
|
|
586
646
|
if (reserved.has(key)) continue;
|
|
587
647
|
if (value === void 0 || value === "") continue;
|
|
588
|
-
out[key] = value;
|
|
648
|
+
out[key] = expandShorthandOperators(value);
|
|
589
649
|
}
|
|
590
650
|
return out;
|
|
591
651
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as ResourceDefinition, ft as RouteSchemaOptions, rt as RateLimitConfig } from "../../index-
|
|
1
|
+
import { V as ResourceDefinition, ft as RouteSchemaOptions, rt as RateLimitConfig } from "../../index-BswOSJCE.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/cli/commands/describe.d.ts
|
|
4
4
|
interface DescribedResource {
|
package/dist/core/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $t as SoftDeleteMixin, B as defineResource, Ct as AggregationConfig, Dt as AggregationMaterializedResult, Et as AggregationMaterializedContext, Ot as AggregationRateLimit, Qt as SoftDeleteExt, St as AggregationCacheConfig, Tt as AggregationIndexHint, V as ResourceDefinition, Zt as BaseController, _n as
|
|
2
|
-
import { A as MAX_SEARCH_LENGTH, C as DEFAULT_UPDATE_METHOD, D as HookPhase, E as HookOperation, M as MutationOperation, N as RESERVED_QUERY_PARAMS, O as MAX_FILTER_DEPTH, P as SYSTEM_FIELDS, S as DEFAULT_TENANT_FIELD, T as HOOK_PHASES, _ as CrudOperation, a as createRequestContext, b as DEFAULT_MAX_LIMIT, c as sendControllerResponse, d as getEntityQuery, f as defineResourceVariants, g as CRUD_OPERATIONS, h as defineAggregation, i as createFastifyHandler, j as MUTATION_OPERATIONS, k as MAX_REGEX_LENGTH, l as getEntityId, m as createPermissionMiddleware, n as isFieldReadable, o as getControllerContext, p as createCrudRouter, r as createCrudHandlers, s as getControllerScope, t as collectReadBlockedFields, u as getEntityIdField, v as DEFAULT_ID_FIELD, w as HOOK_OPERATIONS, x as DEFAULT_SORT, y as DEFAULT_LIMIT } from "../index-
|
|
3
|
-
export { AccessControl, AccessControlConfig, AggMeasureInput, AggMeasureShorthand, AggregationCacheConfig, AggregationConfig, AggregationDateRangeRequirement, AggregationIndexHint, AggregationMaterializedContext, AggregationMaterializedResult, AggregationRateLimit, AggregationsMap, BaseController, BaseControllerOptions, BaseCrudController, BodySanitizer, BodySanitizerConfig, BulkExt, BulkMixin, CRUD_OPERATIONS, CrudOperation, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, HOOK_OPERATIONS, HOOK_PHASES, HookOperation, HookPhase, ListResult, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, MutationOperation, QueryResolver, QueryResolverConfig, RESERVED_QUERY_PARAMS, ResourceDefinition, SYSTEM_FIELDS, SlugExt, SlugMixin, SoftDeleteExt, SoftDeleteMixin, TreeExt, TreeMixin, collectReadBlockedFields, createCrudHandlers, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAggregation, defineResource, defineResourceVariants, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, sendControllerResponse };
|
|
1
|
+
import { $t as SoftDeleteMixin, B as defineResource, Ct as AggregationConfig, Dt as AggregationMaterializedResult, Et as AggregationMaterializedContext, Ot as AggregationRateLimit, Qt as SoftDeleteExt, St as AggregationCacheConfig, Tt as AggregationIndexHint, V as ResourceDefinition, Zt as BaseController, _n as ListResult, an as BulkMixin, bn as AccessControl, bt as AggMeasureInput, cn as ControllerConfigurableOptions, dn as QueryResolverConfig, en as TreeExt, in as BulkExt, kt as AggregationsMap, ln as ControllerConstructionOptions, nn as SlugExt, on as BaseControllerOptions, rn as SlugMixin, sn as BaseCrudController, tn as TreeMixin, un as QueryResolver, vn as BodySanitizer, wt as AggregationDateRangeRequirement, xn as AccessControlConfig, xt as AggMeasureShorthand, yn as BodySanitizerConfig } from "../index-BswOSJCE.mjs";
|
|
2
|
+
import { A as MAX_SEARCH_LENGTH, C as DEFAULT_UPDATE_METHOD, D as HookPhase, E as HookOperation, M as MutationOperation, N as RESERVED_QUERY_PARAMS, O as MAX_FILTER_DEPTH, P as SYSTEM_FIELDS, S as DEFAULT_TENANT_FIELD, T as HOOK_PHASES, _ as CrudOperation, a as createRequestContext, b as DEFAULT_MAX_LIMIT, c as sendControllerResponse, d as getEntityQuery, f as defineResourceVariants, g as CRUD_OPERATIONS, h as defineAggregation, i as createFastifyHandler, j as MUTATION_OPERATIONS, k as MAX_REGEX_LENGTH, l as getEntityId, m as createPermissionMiddleware, n as isFieldReadable, o as getControllerContext, p as createCrudRouter, r as createCrudHandlers, s as getControllerScope, t as collectReadBlockedFields, u as getEntityIdField, v as DEFAULT_ID_FIELD, w as HOOK_OPERATIONS, x as DEFAULT_SORT, y as DEFAULT_LIMIT } from "../index-BstGxcc3.mjs";
|
|
3
|
+
export { AccessControl, AccessControlConfig, AggMeasureInput, AggMeasureShorthand, AggregationCacheConfig, AggregationConfig, AggregationDateRangeRequirement, AggregationIndexHint, AggregationMaterializedContext, AggregationMaterializedResult, AggregationRateLimit, AggregationsMap, BaseController, BaseControllerOptions, BaseCrudController, BodySanitizer, BodySanitizerConfig, BulkExt, BulkMixin, CRUD_OPERATIONS, ControllerConfigurableOptions, ControllerConstructionOptions, CrudOperation, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, HOOK_OPERATIONS, HOOK_PHASES, HookOperation, HookPhase, ListResult, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, MutationOperation, QueryResolver, QueryResolverConfig, RESERVED_QUERY_PARAMS, ResourceDefinition, SYSTEM_FIELDS, SlugExt, SlugMixin, SoftDeleteExt, SoftDeleteMixin, TreeExt, TreeMixin, collectReadBlockedFields, createCrudHandlers, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAggregation, defineResource, defineResourceVariants, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, 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-Cxde4rpC.mjs";
|
|
2
|
-
import { a as BulkMixin, c as collectReadBlockedFields, d 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-
|
|
2
|
+
import { a as BulkMixin, c as collectReadBlockedFields, d 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-Cn8KykUn.mjs";
|
|
3
3
|
import { _ as getControllerContext, g as createRequestContext, h as createFastifyHandler, m as createCrudHandlers, v as getControllerScope, y as sendControllerResponse } from "../routerShared-DrOa-26E.mjs";
|
|
4
|
-
import { a as defineResource, c as createPermissionMiddleware, i as defineResourceVariants, l as defineAggregation, n as getEntityIdField, o as ResourceDefinition, r as getEntityQuery, s as createCrudRouter, t as getEntityId } from "../core
|
|
4
|
+
import { a as defineResource, c as createPermissionMiddleware, i as defineResourceVariants, l as defineAggregation, n as getEntityIdField, o as ResourceDefinition, r as getEntityQuery, s as createCrudRouter, t as getEntityId } from "../core--_Dnl7n-.mjs";
|
|
5
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, defineAggregation, defineResource, defineResourceVariants, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, sendControllerResponse };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS } from "./constants-Cxde4rpC.mjs";
|
|
2
2
|
import { arcLog } from "./logger/index.mjs";
|
|
3
3
|
import { A as assertValidConfig, l as getDefaultCrudSchemas } from "./utils-_h9B3c57.mjs";
|
|
4
|
-
import { t as BaseController } from "./BaseController-
|
|
4
|
+
import { t as BaseController } from "./BaseController-Cn8KykUn.mjs";
|
|
5
5
|
import { t as applyPresets } from "./presets-BbkjdPeH.mjs";
|
|
6
6
|
import { n as convertRouteSchema, t as convertOpenApiSchemas } from "./schemaConverter-De34B1ZG.mjs";
|
|
7
7
|
import { t as hasEvents } from "./typeGuards-BzkXkvVv.mjs";
|
|
8
|
-
import { b as buildRequestScopeProjection, c as buildPreHandlerChain, d as resolveRoutePreHandlers, f as resolveRouterPluginMw, h as createFastifyHandler, i as buildAuthMiddleware, l as buildRateLimitConfig, m as createCrudHandlers, o as buildCrudPermissionMw, p as selectPluginMw, r as buildArcDecorator, s as buildPipelineHandler, u as resolvePipelineSteps } from "./routerShared-DrOa-26E.mjs";
|
|
8
|
+
import { b as buildRequestScopeProjection, c as buildPreHandlerChain, d as resolveRoutePreHandlers, f as resolveRouterPluginMw, g as createRequestContext, h as createFastifyHandler, i as buildAuthMiddleware, l as buildRateLimitConfig, m as createCrudHandlers, o as buildCrudPermissionMw, p as selectPluginMw, r as buildArcDecorator, s as buildPipelineHandler, u as resolvePipelineSteps } from "./routerShared-DrOa-26E.mjs";
|
|
9
9
|
import { t as resolveActionPermission } from "./actionPermissions-CyUkQu6O.mjs";
|
|
10
10
|
//#region src/core/aggregation/defineAggregation.ts
|
|
11
11
|
/**
|
|
@@ -283,6 +283,7 @@ function resolveOrAutoCreateController(resolvedConfig, adapter, repository, hasC
|
|
|
283
283
|
const userController = resolvedConfig.controller;
|
|
284
284
|
if (userController) {
|
|
285
285
|
threadQueryParser(userController, resolvedConfig);
|
|
286
|
+
threadConfigureLifecycle(userController, resolvedConfig, adapter);
|
|
286
287
|
warnOnDroppedAuthorOptions(resolvedConfig);
|
|
287
288
|
warnOnDroppedPresetOptions(resolvedConfig);
|
|
288
289
|
return userController;
|
|
@@ -291,11 +292,57 @@ function resolveOrAutoCreateController(resolvedConfig, adapter, repository, hasC
|
|
|
291
292
|
return buildBaseController(resolvedConfig, adapter, repository);
|
|
292
293
|
}
|
|
293
294
|
/**
|
|
295
|
+
* Forward resource-level options into a user-supplied controller via
|
|
296
|
+
* the duck-typed `configure(opts)` lifecycle hook. Closes the pre-2.15
|
|
297
|
+
* gap where `tenantField` / `schemaOptions` / `idField` / `defaultSort`
|
|
298
|
+
* / `cache` / `onFieldWriteDenied` had no path into a host controller
|
|
299
|
+
* unless the host remembered to forward them through `super(repo,
|
|
300
|
+
* { ... })`. `BaseController` / `BaseCrudController` ship `configure()`;
|
|
301
|
+
* custom controllers can opt in by adding the method.
|
|
302
|
+
*
|
|
303
|
+
* **Gate by `_declaredKeys`**: only forward keys the user literally
|
|
304
|
+
* passed at the resource level. Without this gate, arc-inferred values
|
|
305
|
+
* (e.g. `inferTenantFieldFromAdapter` setting `tenantField: false`
|
|
306
|
+
* because the model's organizationId path doesn't exist) would clobber
|
|
307
|
+
* the matching value the host already set in the controller's
|
|
308
|
+
* constructor (e.g. `new BaseController(repo, { tenantField:
|
|
309
|
+
* "companyId" })`). Resource-level explicit values still win — the
|
|
310
|
+
* snapshot captures what the user typed before any inference runs.
|
|
311
|
+
*/
|
|
312
|
+
function threadConfigureLifecycle(controller, resolvedConfig, adapter) {
|
|
313
|
+
const ctrl = controller;
|
|
314
|
+
if (typeof ctrl.configure !== "function") return;
|
|
315
|
+
const declared = resolvedConfig._declaredKeys;
|
|
316
|
+
const wasDeclared = (key) => declared ? declared.has(key) : true;
|
|
317
|
+
const opts = {};
|
|
318
|
+
if (resolvedConfig.tenantField !== void 0 && wasDeclared("tenantField")) opts.tenantField = resolvedConfig.tenantField;
|
|
319
|
+
if (resolvedConfig.schemaOptions !== void 0 && wasDeclared("schemaOptions")) opts.schemaOptions = resolvedConfig.schemaOptions;
|
|
320
|
+
if (resolvedConfig.idField !== void 0 && wasDeclared("idField")) opts.idField = resolvedConfig.idField;
|
|
321
|
+
if (resolvedConfig.defaultSort !== void 0 && wasDeclared("defaultSort")) opts.defaultSort = resolvedConfig.defaultSort;
|
|
322
|
+
if (resolvedConfig.cache !== void 0 && wasDeclared("cache")) opts.cache = resolvedConfig.cache;
|
|
323
|
+
if (resolvedConfig.onFieldWriteDenied !== void 0 && wasDeclared("onFieldWriteDenied")) opts.onFieldWriteDenied = resolvedConfig.onFieldWriteDenied;
|
|
324
|
+
if (resolvedConfig.queryParser !== void 0 && wasDeclared("queryParser")) opts.queryParser = resolvedConfig.queryParser;
|
|
325
|
+
if (adapter?.matchesFilter !== void 0) opts.matchesFilter = adapter.matchesFilter;
|
|
326
|
+
if (resolvedConfig._controllerOptions) opts.presetFields = {
|
|
327
|
+
slugField: resolvedConfig._controllerOptions.slugField,
|
|
328
|
+
parentField: resolvedConfig._controllerOptions.parentField
|
|
329
|
+
};
|
|
330
|
+
if (Object.keys(opts).length === 0) return;
|
|
331
|
+
ctrl.configure(opts);
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
294
334
|
* Forward a resource-level `queryParser` into a user-supplied
|
|
295
335
|
* controller via duck-typed `setQueryParser`. Without this the
|
|
296
336
|
* controller's internal default would silently override the
|
|
297
337
|
* resource's parser, drifting `[contains]` / `[like]` semantics
|
|
298
338
|
* away from what the OpenAPI schema advertises.
|
|
339
|
+
*
|
|
340
|
+
* **Fail-loud (2.15.0):** older versions warned and continued —
|
|
341
|
+
* letting the resource register with a silently-shadowed parser. The
|
|
342
|
+
* "ship and pray they read the log" path produced 90-minute "why
|
|
343
|
+
* doesn't `[contains]` work" debugs in production. Now throws at
|
|
344
|
+
* registration so the misconfig surfaces immediately, with the same
|
|
345
|
+
* fix-it message in the error.
|
|
299
346
|
*/
|
|
300
347
|
function threadQueryParser(controller, resolvedConfig) {
|
|
301
348
|
if (!resolvedConfig.queryParser) return;
|
|
@@ -304,7 +351,7 @@ function threadQueryParser(controller, resolvedConfig) {
|
|
|
304
351
|
ctrl.setQueryParser(resolvedConfig.queryParser);
|
|
305
352
|
return;
|
|
306
353
|
}
|
|
307
|
-
|
|
354
|
+
throw new Error(`Resource "${resolvedConfig.name}" declares a custom \`queryParser\` but its controller does not expose \`setQueryParser(qp)\`. The parser would be silently dropped, drifting \`[contains]\` / \`[like]\` semantics away from the OpenAPI schema. Extend \`BaseController\` / \`BaseCrudController\` (both implement \`setQueryParser\`) OR add a \`setQueryParser(qp)\` method to your custom controller that actually wires the parser into the controller's query resolution path. (arc 2.15.0 hardened this to a registration-time throw — pre-2.15 it was a warn.)`);
|
|
308
355
|
}
|
|
309
356
|
/**
|
|
310
357
|
* Warn when the user supplies their own controller AND declares
|
|
@@ -314,15 +361,18 @@ function threadQueryParser(controller, resolvedConfig) {
|
|
|
314
361
|
* fix.
|
|
315
362
|
*/
|
|
316
363
|
function warnOnDroppedAuthorOptions(resolvedConfig) {
|
|
364
|
+
if (typeof resolvedConfig.controller?.configure === "function") return;
|
|
365
|
+
const declared = resolvedConfig._declaredKeys;
|
|
366
|
+
const isDeclared = (key) => declared ? declared.has(key) : true;
|
|
317
367
|
const dropped = [];
|
|
318
|
-
if (resolvedConfig.tenantField !== void 0) dropped.push("tenantField");
|
|
319
|
-
if (resolvedConfig.schemaOptions !== void 0 && Object.keys(resolvedConfig.schemaOptions).length > 0) dropped.push("schemaOptions");
|
|
320
|
-
if (resolvedConfig.idField !== void 0) dropped.push("idField");
|
|
321
|
-
if (resolvedConfig.defaultSort !== void 0) dropped.push("defaultSort");
|
|
322
|
-
if (resolvedConfig.cache !== void 0) dropped.push("cache");
|
|
323
|
-
if (resolvedConfig.onFieldWriteDenied !== void 0) dropped.push("onFieldWriteDenied");
|
|
368
|
+
if (resolvedConfig.tenantField !== void 0 && isDeclared("tenantField")) dropped.push("tenantField");
|
|
369
|
+
if (resolvedConfig.schemaOptions !== void 0 && Object.keys(resolvedConfig.schemaOptions).length > 0 && isDeclared("schemaOptions")) dropped.push("schemaOptions");
|
|
370
|
+
if (resolvedConfig.idField !== void 0 && isDeclared("idField")) dropped.push("idField");
|
|
371
|
+
if (resolvedConfig.defaultSort !== void 0 && isDeclared("defaultSort")) dropped.push("defaultSort");
|
|
372
|
+
if (resolvedConfig.cache !== void 0 && isDeclared("cache")) dropped.push("cache");
|
|
373
|
+
if (resolvedConfig.onFieldWriteDenied !== void 0 && isDeclared("onFieldWriteDenied")) dropped.push("onFieldWriteDenied");
|
|
324
374
|
if (dropped.length === 0) return;
|
|
325
|
-
arcLog("defineResource").warn(`Resource "${resolvedConfig.name}" declares a custom controller AND resource-level option(s) [${dropped.join(", ")}]. Arc only threads these when it auto-builds the controller — when you pass your own, they are dropped silently and the controller falls back to its own defaults (e.g. tenantField → 'organizationId').
|
|
375
|
+
arcLog("defineResource").warn(`Resource "${resolvedConfig.name}" declares a custom controller AND resource-level option(s) [${dropped.join(", ")}]. Arc only threads these when it auto-builds the controller — when you pass your own, they are dropped silently and the controller falls back to its own defaults (e.g. tenantField → 'organizationId'). Either implement \`configure(opts)\` on the controller (arc 2.15+ canonical) or forward them via \`super(repo, { ... })\`. Same root cause as the \`queryParser\` warn above.`);
|
|
326
376
|
}
|
|
327
377
|
/**
|
|
328
378
|
* Warn when a preset injected `_controllerOptions` (slugLookup,
|
|
@@ -636,8 +686,10 @@ function stripSystemManagedFromBodyRequired(schemas, schemaOptions) {
|
|
|
636
686
|
*/
|
|
637
687
|
function applyPresetsAndAutoInject(config) {
|
|
638
688
|
const originalPresets = (config.presets ?? []).map((p) => typeof p === "string" ? p : p.name);
|
|
689
|
+
const declaredKeys = new Set(Object.keys(config).filter((k) => config[k] !== void 0));
|
|
639
690
|
const resolvedConfig = config.presets?.length ? applyPresets(config, config.presets) : { ...config };
|
|
640
691
|
resolvedConfig._appliedPresets = originalPresets;
|
|
692
|
+
resolvedConfig._declaredKeys = declaredKeys;
|
|
641
693
|
inferTenantFieldFromAdapter(resolvedConfig);
|
|
642
694
|
resolvedConfig.schemaOptions = autoInjectTenantFieldRules(resolvedConfig.schemaOptions, resolvedConfig.tenantField);
|
|
643
695
|
return resolvedConfig;
|
|
@@ -945,10 +997,13 @@ function buildResourcePlugin(resource) {
|
|
|
945
997
|
});
|
|
946
998
|
}
|
|
947
999
|
if (resource.aggregations && Object.keys(resource.aggregations).length > 0) {
|
|
948
|
-
const { createAggregationRouter } = await import("./createAggregationRouter-
|
|
1000
|
+
const { createAggregationRouter } = await import("./createAggregationRouter-DhR-Ofiz.mjs");
|
|
949
1001
|
const repoForAgg = resource.controller?.repository;
|
|
950
1002
|
const buildOptions = (req) => {
|
|
951
|
-
|
|
1003
|
+
const ctrl = resource.controller;
|
|
1004
|
+
if (!ctrl?.tenantRepoOptions) return {};
|
|
1005
|
+
const ctx = createRequestContext(req);
|
|
1006
|
+
return ctrl.tenantRepoOptions(ctx);
|
|
952
1007
|
};
|
|
953
1008
|
createAggregationRouter(typedInstance, {
|
|
954
1009
|
tag: resource.tag,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { f as createError, l as UnauthorizedError, r as ForbiddenError } from "./errors-j4aJm1Wg.mjs";
|
|
2
2
|
import { c as buildPreHandlerChain, f as resolveRouterPluginMw, i as buildAuthMiddleware, l as buildRateLimitConfig, p as selectPluginMw, r as buildArcDecorator } from "./routerShared-DrOa-26E.mjs";
|
|
3
|
-
import { r as validateAggregations, t as buildAggregationHandler } from "./buildHandler-
|
|
3
|
+
import { r as validateAggregations, t as buildAggregationHandler } from "./buildHandler-jSZ6Fdvi.mjs";
|
|
4
4
|
//#region src/core/aggregation/createAggregationRouter.ts
|
|
5
5
|
/**
|
|
6
6
|
* Register one Fastify route per aggregation. No-op when the map is
|
package/dist/docs/index.d.mts
CHANGED
package/dist/factory/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as CustomPluginAuthOption, c as RawBodyOptions, d as ResourceLike, f as ResourceModule, i as CustomAuthenticatorOption, l as UnderPressureOptions, n as BetterAuthOption, o as JwtAuthOption, p as loadResources, r as CreateAppOptions, s as MultipartOptions, t as AuthOption, u as LoadResourcesOptions } from "../types-
|
|
1
|
+
import { a as CustomPluginAuthOption, c as RawBodyOptions, d as ResourceLike, f as ResourceModule, i as CustomAuthenticatorOption, l as UnderPressureOptions, n as BetterAuthOption, o as JwtAuthOption, p as loadResources, r as CreateAppOptions, s as MultipartOptions, t as AuthOption, u as LoadResourcesOptions } from "../types-3YTpuLZ1.mjs";
|
|
2
2
|
import { FastifyInstance } from "fastify";
|
|
3
3
|
|
|
4
4
|
//#region src/factory/createApp.d.ts
|
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { An as
|
|
1
|
+
import { An as afterCreate, Cn as HookContext, Dn as HookRegistration, En as HookPhase, Fn as beforeUpdate, In as createHookSystem, Ln as defineHook, Mn as afterUpdate, Nn as beforeCreate, On as HookSystem, Pn as beforeDelete, Sn as DefineHookOptions, Tn as HookOperation, jn as afterDelete, kn as HookSystemOptions, wn as HookHandler } from "../index-BswOSJCE.mjs";
|
|
2
2
|
export { type DefineHookOptions, type HookContext, type HookHandler, type HookOperation, type HookPhase, type HookRegistration, HookSystem, type HookSystemOptions, afterCreate, afterDelete, afterUpdate, beforeCreate, beforeDelete, beforeUpdate, createHookSystem, defineHook };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as RequestContext, Ct as AggregationConfig, F as FastifyWithDecorators, K as ArcFieldRule, L as RequestWithExtras, T as CrudRouterOptions, V as ResourceDefinition, Wt as AnyRecord, _t as IControllerResponse, at as ResourceConfig, ft as RouteSchemaOptions, gt as IController, q as CrudController, vt as IRequestContext } from "./index-
|
|
1
|
+
import { C as RequestContext, Ct as AggregationConfig, F as FastifyWithDecorators, K as ArcFieldRule, L as RequestWithExtras, T as CrudRouterOptions, V as ResourceDefinition, Wt as AnyRecord, _t as IControllerResponse, at as ResourceConfig, ft as RouteSchemaOptions, gt as IController, q as CrudController, vt as IRequestContext } from "./index-BswOSJCE.mjs";
|
|
2
2
|
import { i as RequestScope } from "./types-CTYvcwHe.mjs";
|
|
3
3
|
import { c as PermissionCheck } from "./fields-COhcH3fk.mjs";
|
|
4
4
|
import { FastifyReply, FastifyRequest, RouteHandlerMethod } from "fastify";
|
|
@@ -551,8 +551,35 @@ declare class QueryResolver {
|
|
|
551
551
|
}
|
|
552
552
|
//#endregion
|
|
553
553
|
//#region src/core/BaseCrudController.d.ts
|
|
554
|
-
|
|
555
|
-
|
|
554
|
+
/**
|
|
555
|
+
* Construction-only options — fields that participate in the
|
|
556
|
+
* controller's mixin composition / hook identity and **cannot** be
|
|
557
|
+
* re-tuned post-construction via `configure()`. Pass these once at
|
|
558
|
+
* construction; if they need to change, build a new controller.
|
|
559
|
+
*
|
|
560
|
+
* Layer split (2.15.0): keeping this distinct from the configurable
|
|
561
|
+
* surface makes the layer explicit at compile time — `configure()`
|
|
562
|
+
* can't accept these, so accidental "I'll re-name the resource at
|
|
563
|
+
* runtime" calls fail to typecheck.
|
|
564
|
+
*/
|
|
565
|
+
interface ControllerConstructionOptions {
|
|
566
|
+
/** Resource name for hook execution (e.g., 'product' → 'product.created'). */
|
|
567
|
+
resourceName?: string;
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* Configurable options — fields arc can forward post-construction via
|
|
571
|
+
* `BaseController.configure(opts)`. `defineResource()` calls
|
|
572
|
+
* `configure()` automatically when a user-supplied controller exposes
|
|
573
|
+
* the method, so resource-level options reach the controller without a
|
|
574
|
+
* `super(repo, { ... })` dance. Everything except `resourceName` /
|
|
575
|
+
* `repository` lives here.
|
|
576
|
+
*
|
|
577
|
+
* Each field maps 1:1 to a resource-level option on `defineResource()`:
|
|
578
|
+
* the resource is the public-API source of truth, this interface is
|
|
579
|
+
* the controller-internal surface arc forwards into.
|
|
580
|
+
*/
|
|
581
|
+
interface ControllerConfigurableOptions {
|
|
582
|
+
/** Schema options for field sanitization. */
|
|
556
583
|
schemaOptions?: RouteSchemaOptions;
|
|
557
584
|
/**
|
|
558
585
|
* Query parser instance.
|
|
@@ -560,19 +587,17 @@ interface BaseControllerOptions {
|
|
|
560
587
|
* Swap in MongoKit QueryParser, pgkit parser, etc.
|
|
561
588
|
*/
|
|
562
589
|
queryParser?: QueryParserInterface;
|
|
563
|
-
/** Maximum limit for pagination (default: 100) */
|
|
590
|
+
/** Maximum limit for pagination (default: 100). */
|
|
564
591
|
maxLimit?: number;
|
|
565
|
-
/** Default limit for pagination (default: 20) */
|
|
592
|
+
/** Default limit for pagination (default: 20). */
|
|
566
593
|
defaultLimit?: number;
|
|
567
594
|
/**
|
|
568
595
|
* Default sort applied when the request doesn't specify one.
|
|
569
|
-
* - `string` (default: `'-createdAt'`)
|
|
570
|
-
* - `false`
|
|
596
|
+
* - `string` (default: `'-createdAt'`) — Mongo `-field` DESC convention.
|
|
597
|
+
* - `false` — disable the default sort entirely (SQL/Drizzle resources
|
|
571
598
|
* without a `createdAt` column).
|
|
572
599
|
*/
|
|
573
600
|
defaultSort?: string | false;
|
|
574
|
-
/** Resource name for hook execution (e.g., 'product' -> 'product.created') */
|
|
575
|
-
resourceName?: string;
|
|
576
601
|
/**
|
|
577
602
|
* Field name used for multi-tenant scoping (default: 'organizationId').
|
|
578
603
|
* Override to match your schema: 'workspaceId', 'tenantId', 'teamId', etc.
|
|
@@ -589,9 +614,9 @@ interface BaseControllerOptions {
|
|
|
589
614
|
* Provided by the DataAdapter for non-MongoDB databases (SQL, etc.).
|
|
590
615
|
*/
|
|
591
616
|
matchesFilter?: (item: unknown, filters: Record<string, unknown>) => boolean;
|
|
592
|
-
/** Cache configuration for the resource */
|
|
617
|
+
/** Cache configuration for the resource. */
|
|
593
618
|
cache?: ResourceCacheConfig;
|
|
594
|
-
/** Internal preset fields map (slug, tree, etc.) */
|
|
619
|
+
/** Internal preset fields map (slug, tree, etc.). */
|
|
595
620
|
presetFields?: {
|
|
596
621
|
slugField?: string;
|
|
597
622
|
parentField?: string;
|
|
@@ -603,6 +628,12 @@ interface BaseControllerOptions {
|
|
|
603
628
|
*/
|
|
604
629
|
onFieldWriteDenied?: FieldWriteDenialPolicy;
|
|
605
630
|
}
|
|
631
|
+
/**
|
|
632
|
+
* Full constructor options — union of construction-only + configurable.
|
|
633
|
+
* The constructor accepts everything; `configure()` accepts only
|
|
634
|
+
* `ControllerConfigurableOptions`.
|
|
635
|
+
*/
|
|
636
|
+
interface BaseControllerOptions extends ControllerConstructionOptions, ControllerConfigurableOptions {}
|
|
606
637
|
/**
|
|
607
638
|
* Framework-agnostic CRUD controller implementing IController.
|
|
608
639
|
*
|
|
@@ -622,10 +653,21 @@ declare class BaseCrudController<TDoc = AnyRecord, TRepository extends Repositor
|
|
|
622
653
|
protected resourceName?: string;
|
|
623
654
|
protected tenantField: string | false;
|
|
624
655
|
protected idField: string;
|
|
625
|
-
/**
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
656
|
+
/**
|
|
657
|
+
* Composable access control (ID filtering, policy checks, org scope, ownership).
|
|
658
|
+
*
|
|
659
|
+
* Not `readonly` since 2.15.0 — `configure()` rebuilds it when the host
|
|
660
|
+
* supplies tenant/idField/matchesFilter post-construction. Same model as
|
|
661
|
+
* `queryResolver` after `setQueryParser` shipped in 2.10.9.
|
|
662
|
+
*/
|
|
663
|
+
accessControl: AccessControl;
|
|
664
|
+
/**
|
|
665
|
+
* Composable body sanitization (field permissions, system fields).
|
|
666
|
+
*
|
|
667
|
+
* Not `readonly` since 2.15.0 — `configure()` rebuilds it when the host
|
|
668
|
+
* supplies schemaOptions/onFieldWriteDenied post-construction.
|
|
669
|
+
*/
|
|
670
|
+
bodySanitizer: BodySanitizer;
|
|
629
671
|
/**
|
|
630
672
|
* Composable query resolution (parsing, pagination, sort, select/populate).
|
|
631
673
|
*
|
|
@@ -654,6 +696,34 @@ declare class BaseCrudController<TDoc = AnyRecord, TRepository extends Repositor
|
|
|
654
696
|
* supplied; controllers that don't implement it are left untouched.
|
|
655
697
|
*/
|
|
656
698
|
setQueryParser(queryParser: QueryParserInterface): void;
|
|
699
|
+
/**
|
|
700
|
+
* Apply resource-level options to a custom controller AFTER construction.
|
|
701
|
+
*
|
|
702
|
+
* Closes the pre-2.15 footgun where `defineResource({ controller, tenantField,
|
|
703
|
+
* schemaOptions, ... })` warned that the options were "dropped" because the
|
|
704
|
+
* user-supplied controller never received them. Hosts had to remember to
|
|
705
|
+
* forward each one through `super(repo, { ... })` — easy to miss, silently
|
|
706
|
+
* mis-scopes queries when missed.
|
|
707
|
+
*
|
|
708
|
+
* `defineResource()` now calls `controller.configure(resolvedOpts)` after
|
|
709
|
+
* `resolveOrAutoCreateController()` runs. Configure-aware controllers receive
|
|
710
|
+
* the resolved values; arc skips the dropped-options warn for them.
|
|
711
|
+
*
|
|
712
|
+
* Only the keys that affect cross-cutting state (tenant scope, schema/field
|
|
713
|
+
* rules, sort/limit policy, cache, write-denial policy) are honoured —
|
|
714
|
+
* `repository` / `resourceName` are constructor-only because they participate
|
|
715
|
+
* in mixin composition. Each known key rebuilds the affected sub-component
|
|
716
|
+
* (AccessControl / BodySanitizer / QueryResolver) so referentially-stable
|
|
717
|
+
* consumers don't see stale state.
|
|
718
|
+
*
|
|
719
|
+
* Idempotent: safe to call zero, one, or many times before first request;
|
|
720
|
+
* arc calls it exactly once.
|
|
721
|
+
*
|
|
722
|
+
* Type narrowed to `ControllerConfigurableOptions` — `resourceName` is
|
|
723
|
+
* construction-only and intentionally excluded so accidental "rename
|
|
724
|
+
* the resource at runtime" calls fail to typecheck.
|
|
725
|
+
*/
|
|
726
|
+
configure(options: ControllerConfigurableOptions): void;
|
|
657
727
|
/**
|
|
658
728
|
* Get the tenant field name if multi-tenant scoping is enabled.
|
|
659
729
|
* Returns `undefined` when `tenantField` is `false`.
|
|
@@ -960,10 +1030,11 @@ declare function SoftDeleteMixin<TBase extends Constructor<BaseCrudController>>(
|
|
|
960
1030
|
* Spec reference: https://www.typescriptlang.org/docs/handbook/declaration-merging.html#merging-classes-with-other-types
|
|
961
1031
|
*/
|
|
962
1032
|
interface BaseController<TDoc extends AnyRecord = AnyRecord, _TRepository extends RepositoryLike = RepositoryLike<TDoc>> {
|
|
963
|
-
|
|
964
|
-
|
|
1033
|
+
accessControl: AccessControl;
|
|
1034
|
+
bodySanitizer: BodySanitizer;
|
|
965
1035
|
queryResolver: QueryResolver;
|
|
966
1036
|
setQueryParser(queryParser: QueryParserInterface): void;
|
|
1037
|
+
configure(options: ControllerConfigurableOptions): void;
|
|
967
1038
|
list(req: IRequestContext): Promise<IControllerResponse<ListResult<TDoc>>>;
|
|
968
1039
|
get(req: IRequestContext): Promise<IControllerResponse<TDoc>>;
|
|
969
1040
|
create(req: IRequestContext): Promise<IControllerResponse<TDoc>>;
|
|
@@ -3392,4 +3463,4 @@ interface ValidateOptions {
|
|
|
3392
3463
|
strict?: boolean;
|
|
3393
3464
|
}
|
|
3394
3465
|
//#endregion
|
|
3395
|
-
export { OpenApiSchemas as $, SoftDeleteMixin as $t, RequestIdOptions as A,
|
|
3466
|
+
export { OpenApiSchemas as $, SoftDeleteMixin as $t, RequestIdOptions as A, afterCreate as An, Guard as At, defineResource as B, Authenticator as Bt, RequestContext as C, HookContext as Cn, AggregationConfig as Ct, HealthCheck as D, HookRegistration as Dn, AggregationMaterializedResult as Dt, GracefulShutdownOptions as E, HookPhase as En, AggregationMaterializedContext as Et, FastifyWithDecorators as F, beforeUpdate as Fn, PipelineContext as Ft, ActionsMap as G, ApiResponse as Gt, ActionDefinition as H, JwtContext as Ht, MiddlewareHandler as I, createHookSystem as In, PipelineStep as It, CrudRouteKey as J, ObjectId as Jt, ArcFieldRule as K, ArcRequest as Kt, RequestWithExtras as L, defineHook as Ln, Transform as Lt, EventsDecorator as M, afterUpdate as Mn, NextFunction as Mt, FastifyRequestExtras as N, beforeCreate as Nn, OperationFilter as Nt, HealthOptions as O, HookSystem as On, AggregationRateLimit as Ot, FastifyWithAuth as P, beforeDelete as Pn, PipelineConfig as Pt, MiddlewareConfig as Q, SoftDeleteExt as Qt, RegisterOptions as R, AuthHelpers as Rt, QueryParserInterface as S, DefineHookOptions as Sn, AggregationCacheConfig as St, CrudRouterOptions as T, HookOperation as Tn, AggregationIndexHint as Tt, ActionEntry as U, TokenPair as Ut, ResourceDefinition as V, AuthenticatorContext as Vt, ActionHandlerFn as W, AnyRecord as Wt, EventDefinition as X, UserOrganization as Xt, CrudSchemas as Y, UserLike as Yt, FieldRule$1 as Z, BaseController as Zt, ControllerQueryOptions as _, ListResult as _n, IControllerResponse as _t, InferAdapterDoc as a, BulkMixin as an, ResourceConfig as at, ParsedQuery as b, AccessControl as bn, AggMeasureInput as bt, TypedController as c, ControllerConfigurableOptions as cn, ResourcePermissions as ct, PaginationResult as d, QueryResolverConfig as dn, RouteMethod as dt, TreeExt as en, PresetFunction as et, IntrospectionData as f, ArcCreateResult as fn, RouteSchemaOptions as ft, ArcInternalMetadata as g, ArcUpdateResult as gn, IController as gt, ResourceMetadata as h, ArcListResult as hn, FastifyHandler as ht, ValidationResult as i, BulkExt as in, ResourceCacheConfig as it, ArcDecorator as j, afterDelete as jn, Interceptor as jt, IntrospectionPluginOptions as k, HookSystemOptions as kn, AggregationsMap as kt, TypedRepository as l, ControllerConstructionOptions as ln, RouteDefinition as lt, RegistryStats as m, ArcGetResult as mn, ControllerLike as mt, ConfigError as n, SlugExt as nn, PresetResult as nt, InferDocType as o, BaseControllerOptions as on, ResourceHookContext as ot, RegistryEntry as p, ArcDeleteResult as pn, ControllerHandler as pt, CrudController as q, JWTPayload as qt, ValidateOptions as r, SlugMixin as rn, RateLimitConfig as rt, InferResourceDoc as s, BaseCrudController as sn, ResourceHooks as st, RouteHandlerMethod$1 as t, TreeMixin as tn, PresetHook as tt, TypedResourceConfig as u, QueryResolver as un, RouteMcpConfig as ut, LookupOption as v, BodySanitizer as vn, IRequestContext as vt, ServiceContext as w, HookHandler as wn, AggregationDateRangeRequirement as wt, PopulateOption as x, AccessControlConfig as xn, AggMeasureShorthand as xt, OwnershipCheck as y, BodySanitizerConfig as yn, RouteHandler as yt, ResourceRegistry as z, AuthPluginOptions as zt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as OpenApiSchemas, S as QueryParserInterface, Wt as AnyRecord, Yt as UserLike, at as ResourceConfig, b as ParsedQuery } from "./index-
|
|
1
|
+
import { $ as OpenApiSchemas, S as QueryParserInterface, Wt as AnyRecord, Yt as UserLike, at as ResourceConfig, b as ParsedQuery } from "./index-BswOSJCE.mjs";
|
|
2
2
|
import { n as ErrorMapper } from "./errorHandler-DFr45ZG4.mjs";
|
|
3
3
|
import { HttpError, errorContractSchema as errorContractSchema$1, errorDetailSchema as errorDetailSchema$1 } from "@classytic/repo-core/errors";
|
|
4
4
|
import { FastifyInstance, FastifyReply, FastifyRequest, RouteHandlerMethod } from "fastify";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { $t as SoftDeleteMixin, A as RequestIdOptions, B as defineResource, C as RequestContext, Ct as AggregationConfig, D as HealthCheck, Dt as AggregationMaterializedResult, E as GracefulShutdownOptions, Et as AggregationMaterializedContext, F as FastifyWithDecorators, Gt as ApiResponse, J as CrudRouteKey, Kt as ArcRequest, L as RequestWithExtras, N as FastifyRequestExtras, O as HealthOptions, Ot as AggregationRateLimit, P as FastifyWithAuth, Q as MiddlewareConfig, Qt as SoftDeleteExt, S as QueryParserInterface, St as AggregationCacheConfig, T as CrudRouterOptions, Tt as AggregationIndexHint, V as ResourceDefinition, Wt as AnyRecord, X as EventDefinition, Xt as UserOrganization, Y as CrudSchemas, Z as FieldRule, Zt as BaseController, _t as IControllerResponse, a as InferAdapterDoc, an as BulkMixin, at as ResourceConfig, bt as AggMeasureInput, c as TypedController,
|
|
1
|
+
import { $t as SoftDeleteMixin, A as RequestIdOptions, B as defineResource, C as RequestContext, Ct as AggregationConfig, D as HealthCheck, Dt as AggregationMaterializedResult, E as GracefulShutdownOptions, Et as AggregationMaterializedContext, F as FastifyWithDecorators, Gt as ApiResponse, J as CrudRouteKey, Kt as ArcRequest, L as RequestWithExtras, N as FastifyRequestExtras, O as HealthOptions, Ot as AggregationRateLimit, P as FastifyWithAuth, Q as MiddlewareConfig, Qt as SoftDeleteExt, S as QueryParserInterface, St as AggregationCacheConfig, T as CrudRouterOptions, Tt as AggregationIndexHint, V as ResourceDefinition, Wt as AnyRecord, X as EventDefinition, Xt as UserOrganization, Y as CrudSchemas, Z as FieldRule, Zt as BaseController, _n as ListResult, _t as IControllerResponse, a as InferAdapterDoc, an as BulkMixin, at as ResourceConfig, bt as AggMeasureInput, c as TypedController, cn as ControllerConfigurableOptions, d as PaginationResult, en as TreeExt, et as PresetFunction, f as IntrospectionData, fn as ArcCreateResult, ft as RouteSchemaOptions, g as ArcInternalMetadata, gn as ArcUpdateResult, gt as IController, h as ResourceMetadata, hn as ArcListResult, i as ValidationResult, in as BulkExt, k as IntrospectionPluginOptions, kt as AggregationsMap, l as TypedRepository, ln as ControllerConstructionOptions, m as RegistryStats, mn as ArcGetResult, mt as ControllerLike, n as ConfigError, nn as SlugExt, nt as PresetResult, o as InferDocType, on as BaseControllerOptions, p as RegistryEntry, pn as ArcDeleteResult, q as CrudController, qt as JWTPayload, r as ValidateOptions, rn as SlugMixin, rt as RateLimitConfig, s as InferResourceDoc, sn as BaseCrudController, t as RouteHandlerMethod, tn as TreeMixin, u as TypedResourceConfig, vt as IRequestContext, w as ServiceContext, wt as AggregationDateRangeRequirement, xt as AggMeasureShorthand, y as OwnershipCheck, yt as RouteHandler, zt as AuthPluginOptions } from "./index-BswOSJCE.mjs";
|
|
2
2
|
import { a as applyFieldWritePermissions, c as PermissionCheck, d as UserBase, i as applyFieldReadPermissions, l as PermissionContext, n as FieldPermissionMap, o as fields, t as FieldPermission, u as PermissionResult } from "./fields-COhcH3fk.mjs";
|
|
3
|
-
import { A as MAX_SEARCH_LENGTH, C as DEFAULT_UPDATE_METHOD, D as HookPhase, E as HookOperation, M as MutationOperation, N as RESERVED_QUERY_PARAMS, O as MAX_FILTER_DEPTH, P as SYSTEM_FIELDS, S as DEFAULT_TENANT_FIELD, T as HOOK_PHASES, _ as CrudOperation, b as DEFAULT_MAX_LIMIT, f as defineResourceVariants, g as CRUD_OPERATIONS, h as defineAggregation, j as MUTATION_OPERATIONS, k as MAX_REGEX_LENGTH, s as getControllerScope, v as DEFAULT_ID_FIELD, w as HOOK_OPERATIONS, x as DEFAULT_SORT, y as DEFAULT_LIMIT } from "./index-
|
|
3
|
+
import { A as MAX_SEARCH_LENGTH, C as DEFAULT_UPDATE_METHOD, D as HookPhase, E as HookOperation, M as MutationOperation, N as RESERVED_QUERY_PARAMS, O as MAX_FILTER_DEPTH, P as SYSTEM_FIELDS, S as DEFAULT_TENANT_FIELD, T as HOOK_PHASES, _ as CrudOperation, b as DEFAULT_MAX_LIMIT, f as defineResourceVariants, g as CRUD_OPERATIONS, h as defineAggregation, j as MUTATION_OPERATIONS, k as MAX_REGEX_LENGTH, s as getControllerScope, v as DEFAULT_ID_FIELD, w as HOOK_OPERATIONS, x as DEFAULT_SORT, y as DEFAULT_LIMIT } from "./index-BstGxcc3.mjs";
|
|
4
4
|
import { A as requireRoles, C as allOf, E as denyAll, M as when, O as requireAuth, S as createOrgPermissions, T as anyOf, a as presets_d_exports, c as readOnly, d as requireOrgRole, f as requireScopeContext, i as ownerWithAdminBypass, k as requireOwnership, l as requireOrgInScope, m as requireTeamMembership, n as authenticated, o as publicRead, p as requireServiceScope, r as fullPublic, s as publicReadAdminWrite, t as adminOnly, u as requireOrgMembership, v as DynamicPermissionMatrix, w as allowPublic, x as createDynamicPermissionMatrix, y as DynamicPermissionMatrixConfig } from "./index-BTqLEvhu.mjs";
|
|
5
|
-
import { ct as NotFoundError, ht as createDomainError, it as ArcError, mt as ValidationError, pt as UnauthorizedError, st as ForbiddenError, t as getUserId } from "./index-
|
|
5
|
+
import { ct as NotFoundError, ht as createDomainError, it as ArcError, mt as ValidationError, pt as UnauthorizedError, st as ForbiddenError, t as getUserId } from "./index-bRjYu21O.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/index.d.ts
|
|
8
8
|
declare const version: string;
|
|
9
9
|
//#endregion
|
|
10
|
-
export { type AggMeasureInput, type AggMeasureShorthand, type AggregationCacheConfig, type AggregationConfig, type AggregationDateRangeRequirement, type AggregationIndexHint, type AggregationMaterializedContext, type AggregationMaterializedResult, type AggregationRateLimit, type AggregationsMap, type AnyRecord, type ApiResponse, type ArcCreateResult, type ArcDeleteResult, ArcError, type ArcGetResult, type ArcInternalMetadata, type ArcListResult, type ArcRequest, type ArcUpdateResult, type AuthPluginOptions, BaseController, type BaseControllerOptions, BaseCrudController, type BulkExt, BulkMixin, CRUD_OPERATIONS, type ConfigError, type ControllerLike, type CrudController, type CrudOperation, type CrudRouteKey, type CrudRouterOptions, type CrudSchemas, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, type DynamicPermissionMatrix, type DynamicPermissionMatrixConfig, type EventDefinition, type FastifyRequestExtras, type FastifyWithAuth, type FastifyWithDecorators, type FieldPermission, type FieldPermissionMap, type FieldRule, ForbiddenError, type GracefulShutdownOptions, HOOK_OPERATIONS, HOOK_PHASES, type HealthCheck, type HealthOptions, type HookOperation, type HookPhase, type IController, type IControllerResponse, type IRequestContext, type InferAdapterDoc, type InferDocType, type InferResourceDoc, type IntrospectionData, type IntrospectionPluginOptions, type JWTPayload, type ListResult, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, type MiddlewareConfig, type MutationOperation, NotFoundError, type OwnershipCheck, type PaginationResult, type PermissionCheck, type PermissionContext, type PermissionResult, type PresetFunction, type PresetResult, type QueryParserInterface, RESERVED_QUERY_PARAMS, type RateLimitConfig, type RegistryEntry, type RegistryStats, type RequestContext, type RequestIdOptions, type RequestWithExtras, type ResourceConfig, ResourceDefinition, type ResourceMetadata, type RouteHandler, type RouteHandlerMethod, type RouteSchemaOptions, SYSTEM_FIELDS, type ServiceContext, type SlugExt, SlugMixin, type SoftDeleteExt, SoftDeleteMixin, type TreeExt, TreeMixin, type TypedController, type TypedRepository, type TypedResourceConfig, UnauthorizedError, type UserBase, type UserOrganization, type ValidateOptions, ValidationError, type ValidationResult, adminOnly, allOf, allowPublic, anyOf, applyFieldReadPermissions, applyFieldWritePermissions, authenticated, createDomainError, createDynamicPermissionMatrix, createOrgPermissions, defineAggregation, defineResource, defineResourceVariants, denyAll, fields, fullPublic, getControllerScope, getUserId, ownerWithAdminBypass, presets_d_exports as permissions, publicRead, publicReadAdminWrite, readOnly, requireAuth, requireOrgInScope, requireOrgMembership, requireOrgRole, requireOwnership, requireRoles, requireScopeContext, requireServiceScope, requireTeamMembership, version, when };
|
|
10
|
+
export { type AggMeasureInput, type AggMeasureShorthand, type AggregationCacheConfig, type AggregationConfig, type AggregationDateRangeRequirement, type AggregationIndexHint, type AggregationMaterializedContext, type AggregationMaterializedResult, type AggregationRateLimit, type AggregationsMap, type AnyRecord, type ApiResponse, type ArcCreateResult, type ArcDeleteResult, ArcError, type ArcGetResult, type ArcInternalMetadata, type ArcListResult, type ArcRequest, type ArcUpdateResult, type AuthPluginOptions, BaseController, type BaseControllerOptions, BaseCrudController, type BulkExt, BulkMixin, CRUD_OPERATIONS, type ConfigError, type ControllerConfigurableOptions, type ControllerConstructionOptions, type ControllerLike, type CrudController, type CrudOperation, type CrudRouteKey, type CrudRouterOptions, type CrudSchemas, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, type DynamicPermissionMatrix, type DynamicPermissionMatrixConfig, type EventDefinition, type FastifyRequestExtras, type FastifyWithAuth, type FastifyWithDecorators, type FieldPermission, type FieldPermissionMap, type FieldRule, ForbiddenError, type GracefulShutdownOptions, HOOK_OPERATIONS, HOOK_PHASES, type HealthCheck, type HealthOptions, type HookOperation, type HookPhase, type IController, type IControllerResponse, type IRequestContext, type InferAdapterDoc, type InferDocType, type InferResourceDoc, type IntrospectionData, type IntrospectionPluginOptions, type JWTPayload, type ListResult, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, type MiddlewareConfig, type MutationOperation, NotFoundError, type OwnershipCheck, type PaginationResult, type PermissionCheck, type PermissionContext, type PermissionResult, type PresetFunction, type PresetResult, type QueryParserInterface, RESERVED_QUERY_PARAMS, type RateLimitConfig, type RegistryEntry, type RegistryStats, type RequestContext, type RequestIdOptions, type RequestWithExtras, type ResourceConfig, ResourceDefinition, type ResourceMetadata, type RouteHandler, type RouteHandlerMethod, type RouteSchemaOptions, SYSTEM_FIELDS, type ServiceContext, type SlugExt, SlugMixin, type SoftDeleteExt, SoftDeleteMixin, type TreeExt, TreeMixin, type TypedController, type TypedRepository, type TypedResourceConfig, UnauthorizedError, type UserBase, type UserOrganization, type ValidateOptions, ValidationError, type ValidationResult, adminOnly, allOf, allowPublic, anyOf, applyFieldReadPermissions, applyFieldWritePermissions, authenticated, createDomainError, createDynamicPermissionMatrix, createOrgPermissions, defineAggregation, defineResource, defineResourceVariants, denyAll, fields, fullPublic, getControllerScope, getUserId, ownerWithAdminBypass, presets_d_exports as permissions, publicRead, publicReadAdminWrite, readOnly, requireAuth, requireOrgInScope, requireOrgMembership, requireOrgRole, requireOwnership, requireRoles, requireScopeContext, requireServiceScope, requireTeamMembership, version, when };
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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 { d as createDomainError, i as NotFoundError, l as UnauthorizedError, r as ForbiddenError, t as ArcError, u as ValidationError } from "./errors-j4aJm1Wg.mjs";
|
|
3
3
|
import { t as getUserId } from "./utils-_h9B3c57.mjs";
|
|
4
|
-
import { a as BulkMixin, i as SlugMixin, n as TreeMixin, o as BaseCrudController, r as SoftDeleteMixin, t as BaseController } from "./BaseController-
|
|
4
|
+
import { a as BulkMixin, i as SlugMixin, n as TreeMixin, o as BaseCrudController, r as SoftDeleteMixin, t as BaseController } from "./BaseController-Cn8KykUn.mjs";
|
|
5
5
|
import { C as allowPublic, D as requireAuth, O as requireOwnership, S as allOf, T as denyAll, _ as requireOrgMembership, a as presets_exports, b as requireServiceScope, c as readOnly, d as applyFieldWritePermissions, f as fields, g as requireOrgInScope, h as createOrgPermissions, i as ownerWithAdminBypass, j as when, k as requireRoles, m as createDynamicPermissionMatrix, n as authenticated, o as publicRead, r as fullPublic, s as publicReadAdminWrite, t as adminOnly, u as applyFieldReadPermissions, v as requireOrgRole, w as anyOf, x as requireTeamMembership, y as requireScopeContext } from "./permissions-ohQyv50e.mjs";
|
|
6
6
|
import { v as getControllerScope } from "./routerShared-DrOa-26E.mjs";
|
|
7
|
-
import { a as defineResource, i as defineResourceVariants, l as defineAggregation, o as ResourceDefinition } from "./core
|
|
7
|
+
import { a as defineResource, i as defineResourceVariants, l as defineAggregation, o as ResourceDefinition } from "./core--_Dnl7n-.mjs";
|
|
8
8
|
//#region src/index.ts
|
|
9
|
-
const version = "2.
|
|
9
|
+
const version = "2.15.0";
|
|
10
10
|
//#endregion
|
|
11
11
|
export { ArcError, BaseController, BaseCrudController, BulkMixin, 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, NotFoundError, RESERVED_QUERY_PARAMS, ResourceDefinition, SYSTEM_FIELDS, SlugMixin, SoftDeleteMixin, TreeMixin, UnauthorizedError, ValidationError, adminOnly, allOf, allowPublic, anyOf, applyFieldReadPermissions, applyFieldWritePermissions, authenticated, createDomainError, createDynamicPermissionMatrix, createOrgPermissions, defineAggregation, defineResource, defineResourceVariants, denyAll, fields, fullPublic, getControllerScope, getUserId, ownerWithAdminBypass, presets_exports as permissions, publicRead, publicReadAdminWrite, readOnly, requireAuth, requireOrgInScope, requireOrgMembership, requireOrgRole, requireOwnership, requireRoles, requireScopeContext, requireServiceScope, requireTeamMembership, version, when };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as WebSocketMessage, i as WebSocketClient, o as WebSocketPluginOptions } from "../websocket-ChC2rqe1.mjs";
|
|
2
2
|
import { EventGatewayOptions } from "./event-gateway.mjs";
|
|
3
3
|
import { JobDefinition, JobDispatchOptions, JobDispatcher, JobMeta, JobsPluginOptions, QueueStats } from "./jobs.mjs";
|
|
4
|
-
import { c as McpResourceConfig, f as ToolAnnotations, i as CrudOperation, l as PromptDefinition, m as ToolDefinition, n as CallToolResult, o as McpAuthResult, p as ToolContext, r as CreateMcpServerConfig, s as McpPluginOptions, t as BetterAuthHandler } from "../types-
|
|
4
|
+
import { c as McpResourceConfig, f as ToolAnnotations, i as CrudOperation, l as PromptDefinition, m as ToolDefinition, n as CallToolResult, o as McpAuthResult, p as ToolContext, r as CreateMcpServerConfig, s as McpPluginOptions, t as BetterAuthHandler } from "../types-BQsjgQzS.mjs";
|
|
5
5
|
import { StreamlinePluginOptions, WorkflowLike, WorkflowRunLike } from "./streamline.mjs";
|
|
6
6
|
import { WebhookDeliveryRecord, WebhookManager, WebhookPluginOptions, WebhookStore, WebhookSubscription } from "./webhooks.mjs";
|
|
7
7
|
export { type BetterAuthHandler, type CallToolResult, type CreateMcpServerConfig, type CrudOperation, type EventGatewayOptions, type JobDefinition, type JobDispatchOptions, type JobDispatcher, type JobMeta, type JobsPluginOptions, type McpAuthResult, type McpPluginOptions, type McpResourceConfig, type PromptDefinition, type QueueStats, type StreamlinePluginOptions, type ToolAnnotations, type ToolContext, type ToolDefinition, type WebSocketClient, type WebSocketMessage, type WebSocketPluginOptions, type WebhookDeliveryRecord, type WebhookManager, type WebhookPluginOptions, type WebhookStore, type WebhookSubscription, type WorkflowLike, type WorkflowRunLike };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as ResourceDefinition } from "../../index-
|
|
2
|
-
import { a as McpAuthResolver, c as McpResourceConfig, d as SessionEntry, f as ToolAnnotations, i as CrudOperation, l as PromptDefinition, m as ToolDefinition, n as CallToolResult, o as McpAuthResult, p as ToolContext, r as CreateMcpServerConfig, s as McpPluginOptions, t as BetterAuthHandler, u as PromptResult } from "../../types-
|
|
1
|
+
import { V as ResourceDefinition } from "../../index-BswOSJCE.mjs";
|
|
2
|
+
import { a as McpAuthResolver, c as McpResourceConfig, d as SessionEntry, f as ToolAnnotations, i as CrudOperation, l as PromptDefinition, m as ToolDefinition, n as CallToolResult, o as McpAuthResult, p as ToolContext, r as CreateMcpServerConfig, s as McpPluginOptions, t as BetterAuthHandler, u as PromptResult } from "../../types-BQsjgQzS.mjs";
|
|
3
3
|
import { FastifyPluginAsync } from "fastify";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as fieldRulesToZod, r as createMcpServer, t as resourceToTools } from "../../resourceToTools-
|
|
1
|
+
import { n as fieldRulesToZod, r as createMcpServer, t as resourceToTools } from "../../resourceToTools-D4pWzVGA.mjs";
|
|
2
2
|
import { createHash, randomUUID } from "node:crypto";
|
|
3
3
|
import fp from "fastify-plugin";
|
|
4
4
|
//#region src/integrations/mcp/defineTool.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as createMcpServer, t as resourceToTools } from "../../resourceToTools-
|
|
1
|
+
import { r as createMcpServer, t as resourceToTools } from "../../resourceToTools-D4pWzVGA.mjs";
|
|
2
2
|
//#region src/integrations/mcp/testing.ts
|
|
3
3
|
/**
|
|
4
4
|
* @classytic/arc/mcp/testing — MCP Test Utilities
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as MiddlewareHandler, L as RequestWithExtras, Q as MiddlewareConfig } from "../index-
|
|
1
|
+
import { I as MiddlewareHandler, L as RequestWithExtras, Q as MiddlewareConfig } from "../index-BswOSJCE.mjs";
|
|
2
2
|
import { RouteHandlerMethod } from "fastify";
|
|
3
3
|
|
|
4
4
|
//#region src/middleware/middleware.d.ts
|
package/dist/org/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { yt as RouteHandler } from "../index-
|
|
1
|
+
import { yt as RouteHandler } from "../index-BswOSJCE.mjs";
|
|
2
2
|
import { d as UserBase } from "../fields-COhcH3fk.mjs";
|
|
3
3
|
import { InvitationAdapter, InvitationDoc, MemberDoc, OrgAdapter, OrgDoc, OrgPermissionStatement, OrgRole, OrganizationPluginOptions } from "./types.mjs";
|
|
4
4
|
import { FastifyPluginAsync, RouteHandlerMethod } from "fastify";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as Guard, Ft as PipelineContext, It as PipelineStep, Lt as Transform, Mt as NextFunction, Nt as OperationFilter, Pt as PipelineConfig, _t as IControllerResponse, jt as Interceptor } from "../index-
|
|
1
|
+
import { At as Guard, Ft as PipelineContext, It as PipelineStep, Lt as Transform, Mt as NextFunction, Nt as OperationFilter, Pt as PipelineConfig, _t as IControllerResponse, jt as Interceptor } from "../index-BswOSJCE.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/pipeline/guard.d.ts
|
|
4
4
|
interface GuardOptions {
|
package/dist/plugins/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { On as HookSystem, Q as MiddlewareConfig, Wt as AnyRecord, ft as RouteSchemaOptions, lt as RouteDefinition, tt as PresetHook, z as ResourceRegistry } from "../index-BswOSJCE.mjs";
|
|
2
2
|
import { t as ExternalOpenApiPaths } from "../externalPaths-BD5nw6St.mjs";
|
|
3
3
|
import { a as MetricsCollector, c as metricsPlugin, d as ssePlugin, f as CachingOptions, h as cachingPlugin, i as MetricEntry, l as SSEOptions, m as _default$1, n as _default$7, o as MetricsOptions, p as CachingRule, r as versioningPlugin, s as _default$4, t as VersioningOptions, u as _default$6 } from "../versioning-DTTvc80y.mjs";
|
|
4
4
|
import { i as errorHandlerPlugin, n as ErrorMapper, r as defaultIsDuplicateKeyError, t as ErrorHandlerOptions } from "../errorHandler-DFr45ZG4.mjs";
|
|
@@ -58,7 +58,7 @@ try {
|
|
|
58
58
|
function createTracerProvider(options) {
|
|
59
59
|
if (!isAvailable || !NodeTracerProvider || !BatchSpanProcessor || !OTLPTraceExporter) return null;
|
|
60
60
|
const { serviceName = "@classytic/arc", serviceVersion, exporterUrl = "http://localhost:4318/v1/traces" } = options;
|
|
61
|
-
const resolvedVersion = serviceVersion ?? "2.
|
|
61
|
+
const resolvedVersion = serviceVersion ?? "2.15.0";
|
|
62
62
|
const exporter = new OTLPTraceExporter({ url: exporterUrl });
|
|
63
63
|
const provider = new NodeTracerProvider({ resource: { attributes: {
|
|
64
64
|
"service.name": serviceName,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nt as PresetResult } from "../index-
|
|
1
|
+
import { nt as PresetResult } from "../index-BswOSJCE.mjs";
|
|
2
2
|
import { i as RequestScope } from "../types-CTYvcwHe.mjs";
|
|
3
3
|
import { c as PermissionCheck } from "../fields-COhcH3fk.mjs";
|
|
4
4
|
import { a as StorageReadResult, i as StorageReadRange, n as StorageContext, o as StorageUploadInput, r as StorageFile, t as Storage } from "../storage-Dfzt4VTl.mjs";
|
package/dist/presets/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Wt as AnyRecord, _t as IControllerResponse, at as ResourceConfig, d as PaginationResult, nt as PresetResult, vt as IRequestContext } from "../index-
|
|
1
|
+
import { Wt as AnyRecord, _t as IControllerResponse, at as ResourceConfig, d as PaginationResult, nt as PresetResult, vt as IRequestContext } from "../index-BswOSJCE.mjs";
|
|
2
2
|
import { FilesUploadPresetOptions, FilesUploadPresetPermissions, FilesUploadPresetRoutes, filesUploadPreset } from "./filesUpload.mjs";
|
|
3
3
|
import { MultiTenantOptions, TenantFieldSpec, multiTenantPreset } from "./multiTenant.mjs";
|
|
4
4
|
import { SearchHandler, SearchPresetOptions, SearchRouteConfig, searchPreset } from "./search.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { lt as RouteDefinition, nt as PresetResult, pt as ControllerHandler, ut as RouteMcpConfig } from "../index-
|
|
1
|
+
import { lt as RouteDefinition, nt as PresetResult, pt as ControllerHandler, ut as RouteMcpConfig } from "../index-BswOSJCE.mjs";
|
|
2
2
|
import { c as PermissionCheck } from "../fields-COhcH3fk.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/presets/search.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RegisterOptions, k as IntrospectionPluginOptions, z as ResourceRegistry } from "../index-
|
|
1
|
+
import { R as RegisterOptions, k as IntrospectionPluginOptions, z as ResourceRegistry } from "../index-BswOSJCE.mjs";
|
|
2
2
|
import { FastifyPluginAsync } from "fastify";
|
|
3
3
|
|
|
4
4
|
//#region src/registry/introspectionPlugin.d.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { p as isArcError } from "./errors-j4aJm1Wg.mjs";
|
|
2
|
-
import { t as BaseController } from "./BaseController-
|
|
2
|
+
import { t as BaseController } from "./BaseController-Cn8KykUn.mjs";
|
|
3
3
|
import { L as normalizePermissionResult } from "./permissions-ohQyv50e.mjs";
|
|
4
4
|
import { t as executePipeline } from "./pipe-Zr0KXjQe.mjs";
|
|
5
5
|
import { u as resolvePipelineSteps } from "./routerShared-DrOa-26E.mjs";
|
|
6
|
-
import { n as executeAggregation, r as validateAggregations } from "./buildHandler-
|
|
6
|
+
import { n as executeAggregation, r as validateAggregations } from "./buildHandler-jSZ6Fdvi.mjs";
|
|
7
7
|
import { t as resolveActionPermission } from "./actionPermissions-CyUkQu6O.mjs";
|
|
8
8
|
import { i as shouldRejectAdditionalProperties, r as schemaIRToZodShape, t as normalizeSchemaIR } from "./schemaIR-lYhC2gE5.mjs";
|
|
9
9
|
import { t as pluralize } from "./pluralize-DQgqgifU.mjs";
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as ResourceDefinition, Wt as AnyRecord } from "../index-
|
|
2
|
-
import { d as ResourceLike, r as CreateAppOptions } from "../types-
|
|
1
|
+
import { V as ResourceDefinition, Wt as AnyRecord } from "../index-BswOSJCE.mjs";
|
|
2
|
+
import { d as ResourceLike, r as CreateAppOptions } from "../types-3YTpuLZ1.mjs";
|
|
3
3
|
import { StorageContractSetup, StorageContractSetupResult, runStorageContract } from "./storageContract.mjs";
|
|
4
4
|
import { FastifyInstance, FastifyServerOptions } from "fastify";
|
|
5
5
|
import { Mock } from "vitest";
|
package/dist/testing/index.mjs
CHANGED
|
@@ -564,9 +564,8 @@ var HttpTestHarness = class {
|
|
|
564
564
|
});
|
|
565
565
|
expect(res.statusCode).toBeLessThan(300);
|
|
566
566
|
const body = JSON.parse(res.body);
|
|
567
|
-
expect(body.
|
|
568
|
-
|
|
569
|
-
createdId = body.data._id;
|
|
567
|
+
expect(body._id).toBeDefined();
|
|
568
|
+
createdId = body._id;
|
|
570
569
|
});
|
|
571
570
|
if (enabledRoutes.has("list")) it("GET should list resources", async () => {
|
|
572
571
|
const { app } = this.getOptions();
|
|
@@ -576,9 +575,7 @@ var HttpTestHarness = class {
|
|
|
576
575
|
headers: this.adminHeaders()
|
|
577
576
|
});
|
|
578
577
|
expect(res.statusCode).toBe(200);
|
|
579
|
-
const
|
|
580
|
-
expect(body.success).toBe(true);
|
|
581
|
-
const list = body.data ?? body.data;
|
|
578
|
+
const list = JSON.parse(res.body).data;
|
|
582
579
|
expect(Array.isArray(list)).toBe(true);
|
|
583
580
|
});
|
|
584
581
|
if (enabledRoutes.has("get")) {
|
|
@@ -591,7 +588,7 @@ var HttpTestHarness = class {
|
|
|
591
588
|
headers: this.adminHeaders()
|
|
592
589
|
});
|
|
593
590
|
expect(res.statusCode).toBe(200);
|
|
594
|
-
expect(JSON.parse(res.body).
|
|
591
|
+
expect(JSON.parse(res.body)._id).toBe(createdId);
|
|
595
592
|
});
|
|
596
593
|
it("GET /:id with non-existent ID should return 404", async () => {
|
|
597
594
|
const { app } = this.getOptions();
|
|
@@ -601,7 +598,7 @@ var HttpTestHarness = class {
|
|
|
601
598
|
headers: this.adminHeaders()
|
|
602
599
|
});
|
|
603
600
|
expect(res.statusCode).toBe(404);
|
|
604
|
-
expect(JSON.parse(res.body).
|
|
601
|
+
expect(JSON.parse(res.body).status).toBe(404);
|
|
605
602
|
});
|
|
606
603
|
}
|
|
607
604
|
if (enabledRoutes.has("update")) for (const verb of updateMethods) {
|
|
@@ -616,7 +613,7 @@ var HttpTestHarness = class {
|
|
|
616
613
|
payload
|
|
617
614
|
});
|
|
618
615
|
expect(res.statusCode).toBe(200);
|
|
619
|
-
expect(JSON.parse(res.body).
|
|
616
|
+
expect(JSON.parse(res.body)._id).toBe(createdId);
|
|
620
617
|
});
|
|
621
618
|
it(`${verb} /:id with non-existent ID should return 404`, async () => {
|
|
622
619
|
const { app, fixtures } = this.getOptions();
|
|
@@ -640,7 +637,7 @@ var HttpTestHarness = class {
|
|
|
640
637
|
headers: this.adminHeaders(),
|
|
641
638
|
payload: fixtures.valid
|
|
642
639
|
});
|
|
643
|
-
deleteId = JSON.parse(createRes.body).
|
|
640
|
+
deleteId = JSON.parse(createRes.body)._id;
|
|
644
641
|
}
|
|
645
642
|
if (!deleteId) return;
|
|
646
643
|
expect((await app.inject({
|
|
@@ -731,9 +728,9 @@ var HttpTestHarness = class {
|
|
|
731
728
|
});
|
|
732
729
|
expect(res.statusCode).toBeLessThan(400);
|
|
733
730
|
const body = JSON.parse(res.body);
|
|
734
|
-
if (body.
|
|
731
|
+
if (body._id && enabledRoutes.has("delete")) await app.inject({
|
|
735
732
|
method: "DELETE",
|
|
736
|
-
url: `${this.getBaseUrl()}/${body.
|
|
733
|
+
url: `${this.getBaseUrl()}/${body._id}`,
|
|
737
734
|
headers: this.adminHeaders()
|
|
738
735
|
});
|
|
739
736
|
});
|
|
@@ -753,7 +750,7 @@ var HttpTestHarness = class {
|
|
|
753
750
|
payload: fixtures.invalid
|
|
754
751
|
});
|
|
755
752
|
expect(res.statusCode).toBeGreaterThanOrEqual(400);
|
|
756
|
-
expect(JSON.parse(res.body).
|
|
753
|
+
expect(JSON.parse(res.body).status).toBeGreaterThanOrEqual(400);
|
|
757
754
|
});
|
|
758
755
|
});
|
|
759
756
|
}
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as OpenApiSchemas, A as RequestIdOptions, Bt as Authenticator, C as RequestContext, D as HealthCheck, E as GracefulShutdownOptions, F as FastifyWithDecorators, G as ActionsMap, Gt as ApiResponse, H as ActionDefinition, Ht as JwtContext, I as MiddlewareHandler, J as CrudRouteKey, Jt as ObjectId, K as ArcFieldRule, Kt as ArcRequest, L as RequestWithExtras, M as EventsDecorator, N as FastifyRequestExtras, O as HealthOptions, P as FastifyWithAuth, Q as MiddlewareConfig, Rt as AuthHelpers, S as QueryParserInterface, T as CrudRouterOptions, U as ActionEntry, Ut as TokenPair, Vt as AuthenticatorContext, W as ActionHandlerFn, Wt as AnyRecord, X as EventDefinition, Xt as UserOrganization, Y as CrudSchemas, Yt as UserLike, Z as FieldRule, _ as ControllerQueryOptions, _t as IControllerResponse, a as InferAdapterDoc, at as ResourceConfig, b as ParsedQuery, c as TypedController, ct as ResourcePermissions, d as PaginationResult, dt as RouteMethod, et as PresetFunction, f as IntrospectionData, ft as RouteSchemaOptions, g as ArcInternalMetadata, gt as IController, h as ResourceMetadata, ht as FastifyHandler, i as ValidationResult, it as ResourceCacheConfig, j as ArcDecorator, k as IntrospectionPluginOptions, l as TypedRepository, lt as RouteDefinition, m as RegistryStats, mt as ControllerLike, n as ConfigError, nt as PresetResult, o as InferDocType, on as BaseControllerOptions, ot as ResourceHookContext, p as RegistryEntry, pt as ControllerHandler, q as CrudController, qt as JWTPayload, r as ValidateOptions, rt as RateLimitConfig, s as InferResourceDoc, st as ResourceHooks, t as RouteHandlerMethod, tt as PresetHook, u as TypedResourceConfig, ut as RouteMcpConfig, v as LookupOption, vt as IRequestContext, w as ServiceContext, x as PopulateOption, y as OwnershipCheck, yt as RouteHandler, zt as AuthPluginOptions } from "../index-
|
|
1
|
+
import { $ as OpenApiSchemas, A as RequestIdOptions, Bt as Authenticator, C as RequestContext, D as HealthCheck, E as GracefulShutdownOptions, F as FastifyWithDecorators, G as ActionsMap, Gt as ApiResponse, H as ActionDefinition, Ht as JwtContext, I as MiddlewareHandler, J as CrudRouteKey, Jt as ObjectId, K as ArcFieldRule, Kt as ArcRequest, L as RequestWithExtras, M as EventsDecorator, N as FastifyRequestExtras, O as HealthOptions, P as FastifyWithAuth, Q as MiddlewareConfig, Rt as AuthHelpers, S as QueryParserInterface, T as CrudRouterOptions, U as ActionEntry, Ut as TokenPair, Vt as AuthenticatorContext, W as ActionHandlerFn, Wt as AnyRecord, X as EventDefinition, Xt as UserOrganization, Y as CrudSchemas, Yt as UserLike, Z as FieldRule, _ as ControllerQueryOptions, _t as IControllerResponse, a as InferAdapterDoc, at as ResourceConfig, b as ParsedQuery, c as TypedController, ct as ResourcePermissions, d as PaginationResult, dt as RouteMethod, et as PresetFunction, f as IntrospectionData, ft as RouteSchemaOptions, g as ArcInternalMetadata, gt as IController, h as ResourceMetadata, ht as FastifyHandler, i as ValidationResult, it as ResourceCacheConfig, j as ArcDecorator, k as IntrospectionPluginOptions, l as TypedRepository, lt as RouteDefinition, m as RegistryStats, mt as ControllerLike, n as ConfigError, nt as PresetResult, o as InferDocType, on as BaseControllerOptions, ot as ResourceHookContext, p as RegistryEntry, pt as ControllerHandler, q as CrudController, qt as JWTPayload, r as ValidateOptions, rt as RateLimitConfig, s as InferResourceDoc, st as ResourceHooks, t as RouteHandlerMethod, tt as PresetHook, u as TypedResourceConfig, ut as RouteMcpConfig, v as LookupOption, vt as IRequestContext, w as ServiceContext, x as PopulateOption, y as OwnershipCheck, yt as RouteHandler, zt as AuthPluginOptions } from "../index-BswOSJCE.mjs";
|
|
2
2
|
import { i as RequestScope } from "../types-CTYvcwHe.mjs";
|
|
3
3
|
import { c as PermissionCheck, d as UserBase, l as PermissionContext, u as PermissionResult } from "../fields-COhcH3fk.mjs";
|
|
4
4
|
import { n as ElevationOptions, t as ElevationEvent } from "../elevation-BXOWoGCF.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as CacheStore } from "./interface-beEtJyWM.mjs";
|
|
2
|
-
import { Bt as Authenticator } from "./index-
|
|
2
|
+
import { Bt as Authenticator } from "./index-BswOSJCE.mjs";
|
|
3
3
|
import { n as ElevationOptions } from "./elevation-BXOWoGCF.mjs";
|
|
4
4
|
import { a as EventTransport } from "./EventTransport-CT_52aWU.mjs";
|
|
5
5
|
import { t as ExternalOpenApiPaths } from "./externalPaths-BD5nw6St.mjs";
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as ValidateOptions, A as ArcQueryParserOptions, B as CompensationResult, C as keysetListResponse, D as queryParams, E as paginationSchema, F as defineGuard, G as CircuitBreakerError, H as defineCompensation, I as defineErrorMapper, J as CircuitBreakerStats, K as CircuitBreakerOptions, L as CompensationDefinition, M as handleRaw, N as Guard, O as responses, P as GuardConfig, Q as ConfigError, R as CompensationError, S as getListQueryParams, T as offsetListResponse, U as withCompensation, V as CompensationStep, W as CircuitBreaker, X as createCircuitBreaker, Y as CircuitState, Z as createCircuitBreakerRegistry, _ as bareListResponse, _t as isArcError, a as TransitionConfig, at as ConflictError, b as errorDetailSchema, c as JsonSchemaTarget, ct as NotFoundError, d as isJsonSchema, dt as RateLimitError, et as ValidationResult, f as isZodSchema, ft as ServiceUnavailableError, g as aggregateListResponse, gt as createError, h as JsonSchema, ht as createDomainError, i as StateMachine, it as ArcError, j as createQueryParser, k as ArcQueryParser, l as convertOpenApiSchemas, lt as OrgAccessDeniedError, m as scheduleBackground, mt as ValidationError, n as EventsDecorator, nt as formatValidationErrors, o as createStateMachine, ot as ErrorOptions, p as toJsonSchema, pt as UnauthorizedError, q as CircuitBreakerRegistry, r as hasEvents, rt as validateResourceConfig, s as simpleEqualityMatcher, st as ForbiddenError, t as getUserId, tt as assertValidConfig, u as convertRouteSchema, ut as OrgRequiredError, v as deleteResponse, w as listResponse, x as getDefaultCrudSchemas, y as errorContractSchema, z as CompensationHooks } from "../index-
|
|
1
|
+
import { $ as ValidateOptions, A as ArcQueryParserOptions, B as CompensationResult, C as keysetListResponse, D as queryParams, E as paginationSchema, F as defineGuard, G as CircuitBreakerError, H as defineCompensation, I as defineErrorMapper, J as CircuitBreakerStats, K as CircuitBreakerOptions, L as CompensationDefinition, M as handleRaw, N as Guard, O as responses, P as GuardConfig, Q as ConfigError, R as CompensationError, S as getListQueryParams, T as offsetListResponse, U as withCompensation, V as CompensationStep, W as CircuitBreaker, X as createCircuitBreaker, Y as CircuitState, Z as createCircuitBreakerRegistry, _ as bareListResponse, _t as isArcError, a as TransitionConfig, at as ConflictError, b as errorDetailSchema, c as JsonSchemaTarget, ct as NotFoundError, d as isJsonSchema, dt as RateLimitError, et as ValidationResult, f as isZodSchema, ft as ServiceUnavailableError, g as aggregateListResponse, gt as createError, h as JsonSchema, ht as createDomainError, i as StateMachine, it as ArcError, j as createQueryParser, k as ArcQueryParser, l as convertOpenApiSchemas, lt as OrgAccessDeniedError, m as scheduleBackground, mt as ValidationError, n as EventsDecorator, nt as formatValidationErrors, o as createStateMachine, ot as ErrorOptions, p as toJsonSchema, pt as UnauthorizedError, q as CircuitBreakerRegistry, r as hasEvents, rt as validateResourceConfig, s as simpleEqualityMatcher, st as ForbiddenError, t as getUserId, tt as assertValidConfig, u as convertRouteSchema, ut as OrgRequiredError, v as deleteResponse, w as listResponse, x as getDefaultCrudSchemas, y as errorContractSchema, z as CompensationHooks } from "../index-bRjYu21O.mjs";
|
|
2
2
|
export { ArcError, ArcQueryParser, ArcQueryParserOptions, CircuitBreaker, CircuitBreakerError, CircuitBreakerOptions, CircuitBreakerRegistry, CircuitBreakerStats, CircuitState, CompensationDefinition, CompensationError, CompensationHooks, CompensationResult, CompensationStep, ConfigError, ConflictError, ErrorOptions, EventsDecorator, ForbiddenError, Guard, GuardConfig, JsonSchema, JsonSchemaTarget, NotFoundError, OrgAccessDeniedError, OrgRequiredError, RateLimitError, ServiceUnavailableError, StateMachine, TransitionConfig, UnauthorizedError, ValidateOptions, ValidationError, ValidationResult, aggregateListResponse, assertValidConfig, bareListResponse, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createDomainError, createError, createQueryParser, createStateMachine, defineCompensation, defineErrorMapper, defineGuard, deleteResponse, errorContractSchema, errorDetailSchema, formatValidationErrors, getDefaultCrudSchemas, getListQueryParams, getUserId, handleRaw, hasEvents, isArcError, isJsonSchema, isZodSchema, keysetListResponse, listResponse, offsetListResponse, paginationSchema, queryParams, responses, scheduleBackground, simpleEqualityMatcher, toJsonSchema, validateResourceConfig, withCompensation };
|