@classytic/arc 2.14.0 → 2.14.2
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-DX_T-bDB.mjs → BaseController-Dv60tU83.mjs} +47 -11
- package/dist/auth/index.d.mts +79 -2
- package/dist/auth/index.mjs +19 -1
- package/dist/{buildHandler-olo-gt94.mjs → buildHandler-jSZ6Fdvi.mjs} +90 -9
- package/dist/cli/commands/describe.d.mts +1 -1
- package/dist/cli/commands/docs.mjs +1 -1
- package/dist/core/index.d.mts +3 -3
- package/dist/core/index.mjs +3 -3
- package/dist/{core-DECn6zaU.mjs → core-D29kkRL5.mjs} +104 -7
- package/dist/{createActionRouter-CBxLLbn3.mjs → createActionRouter-S3MLVYot.mjs} +9 -2
- package/dist/{createAggregationRouter-CRIBv4sC.mjs → createAggregationRouter-DhR-Ofiz.mjs} +1 -1
- package/dist/{createApp-XX2-N0Yd.mjs → createApp-BarYhXCZ.mjs} +4 -3
- package/dist/docs/index.d.mts +1 -1
- package/dist/docs/index.mjs +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/{index-Dz5IKsrE.d.mts → index-Bt0F3nJj.d.mts} +1 -1
- package/dist/{index-Ds61mrJE.d.mts → index-D1-Kp_dP.d.mts} +48 -2
- package/dist/{index-BtW7qYwa.d.mts → index-Dwc0orNd.d.mts} +68 -7
- package/dist/index.d.mts +3 -3
- 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/{openapi-noXno2CV.mjs → openapi-BHXhoX8O.mjs} +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-DLL32us3.mjs → resourceToTools-BM686jB4.mjs} +2 -2
- package/dist/testing/index.d.mts +2 -2
- package/dist/testing/index.mjs +11 -14
- package/dist/types/index.d.mts +1 -1
- package/dist/{types-DQHFc8PM.d.mts → types-C6ONJ_Z2.d.mts} +1 -1
- package/dist/{types-BvqwCCSx.d.mts → types-NGtx3uxV.d.mts} +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/package.json +1 -1
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-NGtx3uxV.mjs";
|
|
2
2
|
import { FastifyInstance } from "fastify";
|
|
3
3
|
|
|
4
4
|
//#region src/factory/createApp.d.ts
|
package/dist/factory/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as edgePreset, c as testingPreset, i as developmentPreset, n as createApp, o as getPreset, s as productionPreset, t as ArcFactory } from "../createApp-
|
|
1
|
+
import { a as edgePreset, c as testingPreset, i as developmentPreset, n as createApp, o as getPreset, s as productionPreset, t as ArcFactory } from "../createApp-BarYhXCZ.mjs";
|
|
2
2
|
import { t as loadResources } from "../loadResources-DBMQg_Aj.mjs";
|
|
3
3
|
//#region src/factory/edge.ts
|
|
4
4
|
/**
|
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { An as afterUpdate, Cn as HookOperation, Dn as HookSystemOptions, En as HookSystem, Fn as defineHook, Mn as beforeDelete, Nn as beforeUpdate, On as afterCreate, Pn as createHookSystem, Sn as HookHandler, Tn as HookRegistration, bn as DefineHookOptions, jn as beforeCreate, kn as afterDelete, wn as HookPhase, xn as HookContext } from "../index-
|
|
1
|
+
import { An as afterUpdate, Cn as HookOperation, Dn as HookSystemOptions, En as HookSystem, Fn as defineHook, Mn as beforeDelete, Nn as beforeUpdate, On as afterCreate, Pn as createHookSystem, Sn as HookHandler, Tn as HookRegistration, bn as DefineHookOptions, jn as beforeCreate, kn as afterDelete, wn as HookPhase, xn as HookContext } from "../index-Dwc0orNd.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 { $ 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-Dwc0orNd.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";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as RequestContext, Ct as AggregationConfig, F as FastifyWithDecorators, T as CrudRouterOptions, V as ResourceDefinition, Wt as AnyRecord, _t as IControllerResponse, at as ResourceConfig, 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-Dwc0orNd.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";
|
|
@@ -159,6 +159,34 @@ type VariantsResult<TDoc, V extends VariantsMap<TDoc>> = { [K in keyof V]: Resou
|
|
|
159
159
|
*/
|
|
160
160
|
declare function defineResourceVariants<TDoc extends AnyRecord = AnyRecord, V extends VariantsMap<TDoc> = VariantsMap<TDoc>>(base: Omit<ResourceConfig<TDoc>, "name" | "prefix">, variants: V): VariantsResult<TDoc, V>;
|
|
161
161
|
//#endregion
|
|
162
|
+
//#region src/core/entityHelpers.d.ts
|
|
163
|
+
/**
|
|
164
|
+
* Read the resource's configured `idField` for the current request.
|
|
165
|
+
* Falls back to the framework default (`_id`) when the route hasn't
|
|
166
|
+
* bound an idField — keeps handlers safe to author without checking
|
|
167
|
+
* the resource config.
|
|
168
|
+
*/
|
|
169
|
+
declare function getEntityIdField(req: RequestWithExtras): string;
|
|
170
|
+
/**
|
|
171
|
+
* Read the URL `:id` path param value as the resource handle.
|
|
172
|
+
* Returns `undefined` when the route has no `:id` segment (collection
|
|
173
|
+
* routes) — handlers that need the entity must be on row routes.
|
|
174
|
+
*/
|
|
175
|
+
declare function getEntityId(req: RequestWithExtras): string | undefined;
|
|
176
|
+
/**
|
|
177
|
+
* Compose a `findOne` filter that resolves the current request's
|
|
178
|
+
* entity, regardless of whether the resource binds `_id` or a custom
|
|
179
|
+
* field. Idiomatic shape for arc action handlers.
|
|
180
|
+
*
|
|
181
|
+
* ```ts
|
|
182
|
+
* const doc = await Model.findOne(getEntityQuery(req));
|
|
183
|
+
* ```
|
|
184
|
+
*
|
|
185
|
+
* Returns `{}` when the route has no entity context (collection routes
|
|
186
|
+
* or tests bypassing the router) — caller decides what that means.
|
|
187
|
+
*/
|
|
188
|
+
declare function getEntityQuery(req: RequestWithExtras): Record<string, string>;
|
|
189
|
+
//#endregion
|
|
162
190
|
//#region src/core/fastifyAdapter.d.ts
|
|
163
191
|
/**
|
|
164
192
|
* Create IRequestContext from Fastify request
|
|
@@ -227,4 +255,22 @@ declare function createCrudHandlers<TDoc>(controller: IController<TDoc>): {
|
|
|
227
255
|
delete: (req: FastifyRequest, reply: FastifyReply) => Promise<void>;
|
|
228
256
|
};
|
|
229
257
|
//#endregion
|
|
230
|
-
|
|
258
|
+
//#region src/core/fieldRulePredicates.d.ts
|
|
259
|
+
/**
|
|
260
|
+
* True when the field is allowed to appear in client-readable surfaces
|
|
261
|
+
* (response payloads, `select=` whitelists, `_distinct` queries).
|
|
262
|
+
*
|
|
263
|
+
* Mirror of every read-side gate. Don't reach for `rules.systemManaged`
|
|
264
|
+
* here — that's a write rule.
|
|
265
|
+
*/
|
|
266
|
+
declare function isFieldReadable(rule: ArcFieldRule | undefined): boolean;
|
|
267
|
+
/**
|
|
268
|
+
* The set of field names blocked from read-side surfaces (used by
|
|
269
|
+
* `QueryResolver.sanitizeSelectAny` and `BaseCrudController._distinct`).
|
|
270
|
+
*
|
|
271
|
+
* Returns `null` (not an empty array) when there are no rules to apply,
|
|
272
|
+
* so call-sites can early-out without creating empty allocations.
|
|
273
|
+
*/
|
|
274
|
+
declare function collectReadBlockedFields(schemaOptions: RouteSchemaOptions | undefined): Set<string> | null;
|
|
275
|
+
//#endregion
|
|
276
|
+
export { MAX_SEARCH_LENGTH as A, DEFAULT_UPDATE_METHOD as C, HookPhase as D, HookOperation as E, MutationOperation as M, RESERVED_QUERY_PARAMS as N, MAX_FILTER_DEPTH as O, SYSTEM_FIELDS as P, DEFAULT_TENANT_FIELD as S, HOOK_PHASES as T, CrudOperation as _, createRequestContext as a, DEFAULT_MAX_LIMIT as b, sendControllerResponse as c, getEntityQuery as d, defineResourceVariants as f, CRUD_OPERATIONS as g, defineAggregation as h, createFastifyHandler as i, MUTATION_OPERATIONS as j, MAX_REGEX_LENGTH as k, getEntityId as l, createPermissionMiddleware as m, isFieldReadable as n, getControllerContext as o, createCrudRouter as p, createCrudHandlers as r, getControllerScope as s, collectReadBlockedFields as t, getEntityIdField as u, DEFAULT_ID_FIELD as v, HOOK_OPERATIONS as w, DEFAULT_SORT as x, DEFAULT_LIMIT as y };
|
|
@@ -541,7 +541,12 @@ declare class QueryResolver {
|
|
|
541
541
|
* Validates lookup structure to prevent injection.
|
|
542
542
|
*/
|
|
543
543
|
private sanitizeLookups;
|
|
544
|
-
/**
|
|
544
|
+
/**
|
|
545
|
+
* Read-side allowlist gate for `select=` / `populate=`.
|
|
546
|
+
*
|
|
547
|
+
* Only `hidden: true` blocks. `systemManaged` is a *write* rule and
|
|
548
|
+
* doesn't gate visibility — see `core/fieldRulePredicates.ts`.
|
|
549
|
+
*/
|
|
545
550
|
private getBlockedFields;
|
|
546
551
|
}
|
|
547
552
|
//#endregion
|
|
@@ -817,10 +822,13 @@ declare class BaseCrudController<TDoc = AnyRecord, TRepository extends Repositor
|
|
|
817
822
|
exists: boolean;
|
|
818
823
|
}>>;
|
|
819
824
|
/**
|
|
820
|
-
* True when `field` is safe to expose via `_distinct`.
|
|
821
|
-
*
|
|
822
|
-
*
|
|
823
|
-
*
|
|
825
|
+
* True when `field` is safe to expose via `_distinct`.
|
|
826
|
+
*
|
|
827
|
+
* Read-side gate only — only `hidden: true` blocks. `systemManaged`
|
|
828
|
+
* is a *write* rule (clients can't PATCH the value); the field is
|
|
829
|
+
* still in every list response, so blocking `_distinct` adds nothing
|
|
830
|
+
* but inconvenience. See `core/fieldRulePredicates.ts` for the
|
|
831
|
+
* canonical predicate shared with `QueryResolver`.
|
|
824
832
|
*/
|
|
825
833
|
protected isFieldExposedForRead(field: string): boolean;
|
|
826
834
|
/** Execute list query through hooks (extracted for cache revalidation) */
|
|
@@ -1947,6 +1955,32 @@ interface ArcFieldRule extends FieldRule {
|
|
|
1947
1955
|
*/
|
|
1948
1956
|
preserveForElevated?: boolean;
|
|
1949
1957
|
hidden?: boolean;
|
|
1958
|
+
/**
|
|
1959
|
+
* Aggregation visibility override. By default, only `hidden: true`
|
|
1960
|
+
* blocks a field from `groupBy` / `measures.field` / `sort` / `dateBuckets`
|
|
1961
|
+
* — that's the genuine cardinality-leak guard (the value is omitted from
|
|
1962
|
+
* list/get responses, so exposing it via aggregation would reveal data
|
|
1963
|
+
* the client can't otherwise see).
|
|
1964
|
+
*
|
|
1965
|
+
* `systemManaged: true` does **not** block aggregation — it's a write
|
|
1966
|
+
* rule, not a visibility rule. Server-stamped fields like `createdAt`,
|
|
1967
|
+
* `status`, or plugin-generated handles are visible in every list
|
|
1968
|
+
* response and should aggregate freely.
|
|
1969
|
+
*
|
|
1970
|
+
* Use this flag to override the default:
|
|
1971
|
+
*
|
|
1972
|
+
* - `aggregable: false` — explicit deny, even on visible fields. Useful
|
|
1973
|
+
* when a value is exposed per-row but the cardinality across rows is
|
|
1974
|
+
* itself sensitive (e.g. `email` is visible in `get/:id` to admins
|
|
1975
|
+
* but you don't want a public-readable agg of email distributions).
|
|
1976
|
+
* - `aggregable: true` — escape hatch on `hidden` fields. Lets you
|
|
1977
|
+
* aggregate a hidden column when you're sure cardinality leakage
|
|
1978
|
+
* isn't a concern (e.g. `internalScore` hidden from list, but a
|
|
1979
|
+
* committee-only `byScore` agg is fine).
|
|
1980
|
+
*
|
|
1981
|
+
* Defaults to `undefined` (use the `hidden`-only rule).
|
|
1982
|
+
*/
|
|
1983
|
+
aggregable?: boolean;
|
|
1950
1984
|
/** String minimum length — auto-maps to OpenAPI `minLength` and MCP tool schema */
|
|
1951
1985
|
minLength?: number;
|
|
1952
1986
|
/** String maximum length — auto-maps to OpenAPI `maxLength` and MCP tool schema */
|
|
@@ -2837,13 +2871,33 @@ interface FastifyRequestExtras {
|
|
|
2837
2871
|
}
|
|
2838
2872
|
interface RequestWithExtras extends FastifyRequest {
|
|
2839
2873
|
/**
|
|
2840
|
-
* Arc metadata — set by createCrudRouter
|
|
2841
|
-
* and
|
|
2874
|
+
* Arc metadata — set by createCrudRouter / createActionRouter / etc.
|
|
2875
|
+
* Contains resource configuration and runtime resolution of the URL
|
|
2876
|
+
* `:id` path param into the resource's `idField`.
|
|
2842
2877
|
*/
|
|
2843
2878
|
arc?: {
|
|
2844
2879
|
resourceName?: string;
|
|
2845
2880
|
schemaOptions?: RouteSchemaOptions;
|
|
2846
2881
|
permissions?: ResourcePermissions;
|
|
2882
|
+
/**
|
|
2883
|
+
* The configured `idField` for this resource (e.g. `_id`, `slug`,
|
|
2884
|
+
* `reportId`). Set by routers that bind a path `:id` segment so
|
|
2885
|
+
* handlers can compose the right query without remembering the
|
|
2886
|
+
* resource-config detail.
|
|
2887
|
+
*
|
|
2888
|
+
* Use `getEntityQuery(req)` for the canonical
|
|
2889
|
+
* `{ [idField]: entityId }` filter shape — saves the action handler
|
|
2890
|
+
* from a typo class where `Model.findById(id)` silently fails when
|
|
2891
|
+
* `idField !== "_id"`.
|
|
2892
|
+
*/
|
|
2893
|
+
idField?: string;
|
|
2894
|
+
/**
|
|
2895
|
+
* The current request's `:id` path-param value, surfaced verbatim.
|
|
2896
|
+
* For most resources this equals `req.params.id`; we mirror it on
|
|
2897
|
+
* `req.arc` so middleware that doesn't have a typed `params` shape
|
|
2898
|
+
* can still read the entity handle.
|
|
2899
|
+
*/
|
|
2900
|
+
entityId?: string;
|
|
2847
2901
|
};
|
|
2848
2902
|
context?: Record<string, unknown>;
|
|
2849
2903
|
_policyFilters?: Record<string, unknown>;
|
|
@@ -2958,6 +3012,13 @@ interface CrudRouterOptions {
|
|
|
2958
3012
|
rateLimit?: RateLimitConfig | false;
|
|
2959
3013
|
/** PreHandler guards applied to every route (CRUD + custom + preset). */
|
|
2960
3014
|
routeGuards?: RouteHandlerMethod[];
|
|
3015
|
+
/**
|
|
3016
|
+
* Resource's bound `idField` (`_id`, `slug`, `reportId`, …). Surfaces on
|
|
3017
|
+
* `req.arc.idField` for every CRUD route so handlers + middleware can
|
|
3018
|
+
* compose `findOne` filters via `getEntityQuery(req)` without
|
|
3019
|
+
* re-reading resource config. Defaults to `_id`.
|
|
3020
|
+
*/
|
|
3021
|
+
idField?: string;
|
|
2961
3022
|
}
|
|
2962
3023
|
//#endregion
|
|
2963
3024
|
//#region src/types/query.d.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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, d as PaginationResult, dn as ArcDeleteResult, en as TreeExt, et as PresetFunction, f as IntrospectionData, fn as ArcGetResult, ft as RouteSchemaOptions, g as ArcInternalMetadata, gt as IController, h as ResourceMetadata, hn as ListResult, i as ValidationResult, in as BulkExt, k as IntrospectionPluginOptions, kt as AggregationsMap, l as TypedRepository, m as RegistryStats, mn as ArcUpdateResult, mt as ControllerLike, n as ConfigError, nn as SlugExt, nt as PresetResult, o as InferDocType, on as BaseControllerOptions, p as RegistryEntry, pn as ArcListResult, 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, un as ArcCreateResult, vt as IRequestContext, w as ServiceContext, wt as AggregationDateRangeRequirement, xt as AggMeasureShorthand, y as OwnershipCheck, yt as RouteHandler, zt as AuthPluginOptions } from "./index-
|
|
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, d as PaginationResult, dn as ArcDeleteResult, en as TreeExt, et as PresetFunction, f as IntrospectionData, fn as ArcGetResult, ft as RouteSchemaOptions, g as ArcInternalMetadata, gt as IController, h as ResourceMetadata, hn as ListResult, i as ValidationResult, in as BulkExt, k as IntrospectionPluginOptions, kt as AggregationsMap, l as TypedRepository, m as RegistryStats, mn as ArcUpdateResult, mt as ControllerLike, n as ConfigError, nn as SlugExt, nt as PresetResult, o as InferDocType, on as BaseControllerOptions, p as RegistryEntry, pn as ArcListResult, 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, un as ArcCreateResult, vt as IRequestContext, w as ServiceContext, wt as AggregationDateRangeRequirement, xt as AggMeasureShorthand, y as OwnershipCheck, yt as RouteHandler, zt as AuthPluginOptions } from "./index-Dwc0orNd.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 {
|
|
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-D1-Kp_dP.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-Bt0F3nJj.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/index.d.ts
|
|
8
8
|
declare const version: string;
|
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-Dv60tU83.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 {
|
|
7
|
+
import { a as defineResource, i as defineResourceVariants, l as defineAggregation, o as ResourceDefinition } from "./core-D29kkRL5.mjs";
|
|
8
8
|
//#region src/index.ts
|
|
9
|
-
const version = "2.14.
|
|
9
|
+
const version = "2.14.2";
|
|
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-C6ONJ_Z2.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-Dwc0orNd.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-C6ONJ_Z2.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-BM686jB4.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-BM686jB4.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-Dwc0orNd.mjs";
|
|
2
2
|
import { RouteHandlerMethod } from "fastify";
|
|
3
3
|
|
|
4
4
|
//#region src/middleware/middleware.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as getUserRoles } from "./types-D57iXYb8.mjs";
|
|
2
2
|
import { n as convertRouteSchema } from "./schemaConverter-De34B1ZG.mjs";
|
|
3
3
|
import { t as resolveActionPermission } from "./actionPermissions-CyUkQu6O.mjs";
|
|
4
|
-
import { t as buildActionBodySchema } from "./createActionRouter-
|
|
4
|
+
import { t as buildActionBodySchema } from "./createActionRouter-S3MLVYot.mjs";
|
|
5
5
|
import fp from "fastify-plugin";
|
|
6
6
|
//#region src/docs/openapi/canonical-schemas.ts
|
|
7
7
|
/**
|
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-Dwc0orNd.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-Dwc0orNd.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 { En as HookSystem, Q as MiddlewareConfig, Wt as AnyRecord, ft as RouteSchemaOptions, lt as RouteDefinition, tt as PresetHook, z as ResourceRegistry } from "../index-
|
|
1
|
+
import { En as HookSystem, Q as MiddlewareConfig, Wt as AnyRecord, ft as RouteSchemaOptions, lt as RouteDefinition, tt as PresetHook, z as ResourceRegistry } from "../index-Dwc0orNd.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.14.
|
|
61
|
+
const resolvedVersion = serviceVersion ?? "2.14.2";
|
|
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-Dwc0orNd.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-Dwc0orNd.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-Dwc0orNd.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-Dwc0orNd.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-Dv60tU83.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-Dwc0orNd.mjs";
|
|
2
|
+
import { d as ResourceLike, r as CreateAppOptions } from "../types-NGtx3uxV.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
|
}
|
|
@@ -1073,7 +1070,7 @@ function pickDefaultAuth(authMode, callerAuth) {
|
|
|
1073
1070
|
};
|
|
1074
1071
|
}
|
|
1075
1072
|
async function createTestApp(options = {}) {
|
|
1076
|
-
const { createApp } = await import("../createApp-
|
|
1073
|
+
const { createApp } = await import("../createApp-BarYhXCZ.mjs").then((n) => n.r);
|
|
1077
1074
|
const { resources = [], db = "in-memory", connectMongoose = false, authMode = "jwt", defaultOrgId, plugins, auth: callerAuth, ...appOptions } = options;
|
|
1078
1075
|
let dbHandle;
|
|
1079
1076
|
let dbUri;
|
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-Dwc0orNd.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-Dwc0orNd.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-Bt0F3nJj.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 };
|