@classytic/arc 2.10.3 → 2.11.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/README.md +1 -1
- package/dist/{BaseController-CbKKIflT.mjs → BaseController-JNV08qOT.mjs} +595 -537
- package/dist/{queryCachePlugin-BKbWjgDG.d.mts → QueryCache-DOBNHBE0.d.mts} +2 -32
- package/dist/actionPermissions-C8YYU92K.mjs +22 -0
- package/dist/adapters/index.d.mts +2 -2
- package/dist/adapters/index.mjs +1 -1
- package/dist/{adapters-BXY4i-hw.mjs → adapters-D0tT2Tyo.mjs} +54 -0
- package/dist/audit/index.d.mts +2 -2
- package/dist/audit/index.mjs +15 -17
- package/dist/auth/index.d.mts +4 -4
- package/dist/auth/index.mjs +3 -3
- package/dist/auth/redis-session.d.mts +1 -1
- package/dist/{betterAuthOpenApi-BBRVhjQN.mjs → betterAuthOpenApi-DwxtK3uG.mjs} +1 -1
- package/dist/cache/index.d.mts +3 -2
- package/dist/cache/index.mjs +3 -3
- package/dist/cli/commands/docs.mjs +2 -2
- package/dist/cli/commands/generate.mjs +37 -27
- package/dist/cli/commands/init.mjs +47 -34
- package/dist/cli/commands/introspect.mjs +1 -1
- package/dist/context/index.d.mts +58 -0
- package/dist/context/index.mjs +2 -0
- package/dist/core/index.d.mts +3 -3
- package/dist/core/index.mjs +4 -3
- package/dist/core-DXdSSFW-.mjs +1037 -0
- package/dist/createActionRouter-BwaSM0No.mjs +166 -0
- package/dist/{createApp-BuvPma24.mjs → createApp-DvNYEhpb.mjs} +118 -36
- package/dist/docs/index.d.mts +2 -2
- package/dist/docs/index.mjs +1 -1
- package/dist/{elevation-C7hgL_aI.mjs → elevation-DOFoxoDs.mjs} +1 -1
- package/dist/errorHandler-Co3lnVmJ.d.mts +114 -0
- package/dist/{eventPlugin-DCUjuiQT.mjs → eventPlugin--5HIkdPU.mjs} +1 -1
- package/dist/{eventPlugin-CxWgpd6K.d.mts → eventPlugin-CUNjYYRY.d.mts} +1 -1
- package/dist/events/index.d.mts +4 -4
- package/dist/events/index.mjs +69 -51
- package/dist/events/transports/redis-stream-entry.d.mts +1 -1
- package/dist/events/transports/redis.d.mts +1 -1
- package/dist/factory/index.d.mts +1 -1
- package/dist/factory/index.mjs +2 -2
- package/dist/{fields-Lo1VUDpt.d.mts → fields-C8Y0XLAu.d.mts} +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/idempotency/index.d.mts +3 -3
- package/dist/idempotency/index.mjs +38 -27
- package/dist/idempotency/redis.d.mts +1 -1
- package/dist/{index-ChIw3776.d.mts → index-BYCqHCVu.d.mts} +4 -4
- package/dist/{index-Cl0uoKd5.d.mts → index-Cm0vUrr_.d.mts} +2100 -1688
- package/dist/{index-DStwgFUK.d.mts → index-DAushRTt.d.mts} +29 -10
- package/dist/index-DsJ1MNfC.d.mts +1179 -0
- package/dist/{index-8qw4y6ff.d.mts → index-t8pLpPFW.d.mts} +13 -10
- package/dist/index.d.mts +7 -251
- package/dist/index.mjs +8 -128
- package/dist/integrations/event-gateway.d.mts +2 -2
- package/dist/integrations/event-gateway.mjs +1 -1
- package/dist/integrations/index.d.mts +2 -2
- 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/integrations/streamline.d.mts +46 -5
- package/dist/integrations/streamline.mjs +50 -21
- package/dist/integrations/websocket-redis.d.mts +1 -1
- package/dist/integrations/websocket.d.mts +2 -154
- package/dist/integrations/websocket.mjs +292 -224
- package/dist/{keys-qcD-TVJl.mjs → keys-CARyUjiR.mjs} +2 -0
- package/dist/{loadResources-BAzJItAJ.mjs → loadResources-YNwKHvRA.mjs} +3 -1
- package/dist/logger/index.d.mts +81 -0
- package/dist/{logger-DLg8-Ueg.mjs → logger/index.mjs} +1 -6
- package/dist/middleware/index.d.mts +109 -0
- package/dist/middleware/index.mjs +70 -0
- package/dist/multipartBody-CvTR1Un6.mjs +123 -0
- package/dist/{openapi-B5F8AddX.mjs → openapi-C0L9ar7m.mjs} +9 -7
- package/dist/org/index.d.mts +2 -2
- package/dist/permissions/index.d.mts +2 -2
- package/dist/permissions/index.mjs +1 -3
- package/dist/{permissions-Dk6mshja.mjs → permissions-B4vU9L0Q.mjs} +220 -2
- package/dist/pipe-DVoIheVC.mjs +62 -0
- package/dist/pipeline/index.d.mts +62 -0
- package/dist/pipeline/index.mjs +53 -0
- package/dist/plugins/index.d.mts +25 -5
- package/dist/plugins/index.mjs +10 -10
- package/dist/plugins/response-cache.mjs +1 -1
- package/dist/plugins/tracing-entry.d.mts +1 -1
- package/dist/plugins/tracing-entry.mjs +42 -24
- package/dist/presets/filesUpload.d.mts +4 -4
- package/dist/presets/filesUpload.mjs +255 -1
- package/dist/presets/index.d.mts +1 -1
- package/dist/presets/index.mjs +2 -2
- package/dist/presets/multiTenant.d.mts +1 -1
- package/dist/presets/multiTenant.mjs +48 -8
- package/dist/presets/search.d.mts +2 -2
- package/dist/presets/search.mjs +1 -1
- package/dist/{presets-fLJVXdVn.mjs → presets-k604Lj99.mjs} +1 -1
- package/dist/queryCachePlugin-BUXBSm4F.d.mts +34 -0
- package/dist/{queryCachePlugin-DQCEfJis.mjs → queryCachePlugin-Bq6bO6vc.mjs} +3 -3
- package/dist/{redis-DqyeggCa.d.mts → redis-Cm1gnRDf.d.mts} +1 -1
- package/dist/{redis-stream-CakIQmwR.d.mts → redis-stream-CM8TXTix.d.mts} +1 -1
- package/dist/registry/index.d.mts +1 -1
- package/dist/registry/index.mjs +2 -2
- package/dist/{requestContext-xHIKedG6.mjs → requestContext-CfRkaxwf.mjs} +1 -1
- package/dist/{resourceToTools-BElv3xPT.mjs → resourceToTools--okX6QBr.mjs} +534 -415
- package/dist/routerShared-DeESFp4a.mjs +515 -0
- package/dist/schemaIR-BlG9bY7v.mjs +137 -0
- package/dist/scope/index.d.mts +2 -2
- package/dist/scope/index.mjs +1 -1
- package/dist/{sse-yBCgOLGu.mjs → sse-V7aXc3bW.mjs} +1 -1
- package/dist/{store-helpers-ZCSMJJAX.mjs → store-helpers-BhrzxvyQ.mjs} +4 -0
- package/dist/testing/index.d.mts +367 -711
- package/dist/testing/index.mjs +646 -1434
- package/dist/testing/storageContract.d.mts +1 -1
- package/dist/{tracing-65B51Dw3.d.mts → tracing-DokiEsuz.d.mts} +9 -4
- package/dist/types/index.d.mts +5 -5
- package/dist/types/index.mjs +1 -3
- package/dist/types/storage.d.mts +1 -1
- package/dist/{types-Co8k3NyS.d.mts → types-CgikqKAj.d.mts} +133 -21
- package/dist/{types-Btdda02s.d.mts → types-D9NqiYIw.d.mts} +1 -1
- package/dist/utils/index.d.mts +2 -898
- package/dist/utils/index.mjs +4 -5
- package/dist/utils-D3Yxnrwr.mjs +1639 -0
- package/dist/versioning-M9lNLhO8.d.mts +117 -0
- package/dist/websocket-CyJ1VIFI.d.mts +186 -0
- package/package.json +26 -8
- package/skills/arc/SKILL.md +124 -39
- package/skills/arc/references/testing.md +212 -183
- package/dist/applyPermissionResult-QhV1Pa-g.mjs +0 -37
- package/dist/core-CcR01lup.mjs +0 -1411
- package/dist/createActionRouter-Bp_5c_2b.mjs +0 -249
- package/dist/errorHandler-DRQ3EqfL.d.mts +0 -218
- package/dist/errors-CCSsMpXE.d.mts +0 -140
- package/dist/fields-bxkeltzz.mjs +0 -126
- package/dist/filesUpload-t21LS-py.mjs +0 -377
- package/dist/queryParser-DBqBB6AC.mjs +0 -352
- package/dist/types-Csi3FLfq.mjs +0 -27
- package/dist/utils-B2fNOD_i.mjs +0 -929
- /package/dist/{EventTransport-CUw5NNWe.d.mts → EventTransport-CfVEGaEl.d.mts} +0 -0
- /package/dist/{HookSystem-BNYKnrXF.mjs → HookSystem-CGsMd6oK.mjs} +0 -0
- /package/dist/{ResourceRegistry-BPd6NQDm.mjs → ResourceRegistry-DkAeAuTX.mjs} +0 -0
- /package/dist/{caching-CBpK_SCM.mjs → caching-CheW3m-S.mjs} +0 -0
- /package/dist/{elevation-C5SwtkAn.d.mts → elevation-s5ykdNHr.d.mts} +0 -0
- /package/dist/{errorHandler-Bb49BvPD.mjs → errorHandler-BQm8ZxTK.mjs} +0 -0
- /package/dist/{externalPaths-BQ8QijNH.d.mts → externalPaths-Bapitwvd.d.mts} +0 -0
- /package/dist/{interface-CSbZdv_3.d.mts → interface-CkkWm5uR.d.mts} +0 -0
- /package/dist/{interface-D218ikEo.d.mts → interface-Da0r7Lna.d.mts} +0 -0
- /package/dist/{memory-B5Amv9A1.mjs → memory-DikHSvWa.mjs} +0 -0
- /package/dist/{metrics-DuhiSEZI.mjs → metrics-Csh4nsvv.mjs} +0 -0
- /package/dist/{pluralize-A0tWEl1K.mjs → pluralize-BneOJkpi.mjs} +0 -0
- /package/dist/{registry-B3lRFBWo.mjs → registry-D63ee7fl.mjs} +0 -0
- /package/dist/{replyHelpers-CXtJDAZ0.mjs → replyHelpers-ByllIXXV.mjs} +0 -0
- /package/dist/{schemaConverter-BxFDdtXu.mjs → schemaConverter-B0oKLuqI.mjs} +0 -0
- /package/dist/{sessionManager-BkzVU8h2.d.mts → sessionManager-D-oNWHz3.d.mts} +0 -0
- /package/dist/{storage-CVk_SEn2.d.mts → storage-BwGQXUpd.d.mts} +0 -0
- /package/dist/{typeGuards-Cj5Rgvlg.mjs → typeGuards-CcFZXgU7.mjs} +0 -0
- /package/dist/{types-BD85MlEK.d.mts → types-tgR4Pt8F.d.mts} +0 -0
- /package/dist/{versioning-C2U_bLY0.mjs → versioning-CGPjkqAg.mjs} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Model } from "mongoose";
|
|
1
|
+
import { $ as OpenApiSchemas, Dn as AdapterSchemaContext, Mn as SchemaMetadata, Nn as ValidationResult, On as DataAdapter, S as QueryParserInterface, b as ParsedQuery, ft as RouteSchemaOptions, jn as RepositoryLike } from "./index-Cm0vUrr_.mjs";
|
|
3
2
|
import { StandardRepo } from "@classytic/repo-core/repository";
|
|
3
|
+
import { Model } from "mongoose";
|
|
4
4
|
|
|
5
5
|
//#region src/adapters/drizzle.d.ts
|
|
6
6
|
/**
|
|
@@ -30,7 +30,7 @@ interface DrizzleAdapterOptions<TDoc = unknown> {
|
|
|
30
30
|
/** Drizzle table — used for schema introspection. */
|
|
31
31
|
table: DrizzleTableLike;
|
|
32
32
|
/** Repository implementing the repo-core contract. */
|
|
33
|
-
repository:
|
|
33
|
+
repository: RepositoryLike<TDoc>;
|
|
34
34
|
/**
|
|
35
35
|
* External schema generator. When provided, replaces the built-in
|
|
36
36
|
* type-only conversion. Wire it to your kit's `buildCrudSchemasFromTable`
|
|
@@ -46,7 +46,7 @@ declare class DrizzleAdapter<TDoc = unknown> implements DataAdapter<TDoc> {
|
|
|
46
46
|
readonly type: "drizzle";
|
|
47
47
|
readonly name: string;
|
|
48
48
|
readonly table: DrizzleTableLike;
|
|
49
|
-
readonly repository:
|
|
49
|
+
readonly repository: RepositoryLike<TDoc>;
|
|
50
50
|
private readonly schemaGenerator?;
|
|
51
51
|
constructor(options: DrizzleAdapterOptions<TDoc>);
|
|
52
52
|
/**
|
|
@@ -86,24 +86,32 @@ interface MongooseAdapterOptions<TDoc = unknown> {
|
|
|
86
86
|
/** Mongoose model instance — preserves document type for type safety */
|
|
87
87
|
model: Model<TDoc>;
|
|
88
88
|
/** Repository implementing CRUD operations - accepts any repository-like object */
|
|
89
|
-
repository:
|
|
89
|
+
repository: RepositoryLike<TDoc>;
|
|
90
90
|
/**
|
|
91
91
|
* External schema generator plugin for OpenAPI docs.
|
|
92
92
|
* When provided, replaces the built-in basic type conversion.
|
|
93
93
|
* Receives the Mongoose model and schema options, must return OpenApiSchemas.
|
|
94
94
|
*
|
|
95
|
-
*
|
|
95
|
+
* **Model type is intentionally `Model<unknown>`, not `Model<TDoc>`**:
|
|
96
|
+
* schema generators introspect `.schema.paths` — they read metadata, not
|
|
97
|
+
* document types. Typing as `Model<TDoc>` forced every mongokit host to
|
|
98
|
+
* cast `m as unknown as Model<unknown>` when handing the model to
|
|
99
|
+
* `buildCrudSchemasFromModel` (which is typed `Model<unknown>`), because
|
|
100
|
+
* `Model<T>` is invariant in T. Widening here at the callback boundary
|
|
101
|
+
* trades one documented internal cast for zero host-side casts.
|
|
102
|
+
*
|
|
103
|
+
* @example MongoKit integration — direct pass-through, no casts
|
|
96
104
|
* ```typescript
|
|
97
105
|
* import { buildCrudSchemasFromModel } from '@classytic/mongokit';
|
|
98
106
|
*
|
|
99
107
|
* createMongooseAdapter({
|
|
100
108
|
* model: JobModel,
|
|
101
109
|
* repository: jobRepository,
|
|
102
|
-
* schemaGenerator:
|
|
110
|
+
* schemaGenerator: buildCrudSchemasFromModel,
|
|
103
111
|
* });
|
|
104
112
|
* ```
|
|
105
113
|
*/
|
|
106
|
-
schemaGenerator?: (model: Model<
|
|
114
|
+
schemaGenerator?: (model: Model<unknown>, options?: RouteSchemaOptions, context?: AdapterSchemaContext) => OpenApiSchemas | Record<string, unknown>;
|
|
107
115
|
}
|
|
108
116
|
/**
|
|
109
117
|
* Mongoose data adapter with proper type safety
|
|
@@ -114,7 +122,7 @@ declare class MongooseAdapter<TDoc = unknown> implements DataAdapter<TDoc> {
|
|
|
114
122
|
readonly type: "mongoose";
|
|
115
123
|
readonly name: string;
|
|
116
124
|
readonly model: Model<TDoc>;
|
|
117
|
-
readonly repository:
|
|
125
|
+
readonly repository: RepositoryLike<TDoc>;
|
|
118
126
|
private readonly schemaGenerator?;
|
|
119
127
|
constructor(options: MongooseAdapterOptions<TDoc>);
|
|
120
128
|
/**
|
|
@@ -141,6 +149,17 @@ declare class MongooseAdapter<TDoc = unknown> implements DataAdapter<TDoc> {
|
|
|
141
149
|
* Create Mongoose adapter with flexible type acceptance.
|
|
142
150
|
* Accepts any repository with CRUD methods — no `as any` needed.
|
|
143
151
|
*
|
|
152
|
+
* **Type parameter (v2.11):** `TDoc` is UNCONSTRAINED. An earlier v2.11
|
|
153
|
+
* revision added `TDoc extends AnyRecord` to surface errors at the
|
|
154
|
+
* adapter call site, but Mongoose's own document types
|
|
155
|
+
* (`HydratedDocument<T>`, `T & Document`) don't carry an index signature
|
|
156
|
+
* — so the constraint fired on the exact Mongoose idioms this factory
|
|
157
|
+
* is designed to accept. Hosts were casting with
|
|
158
|
+
* `as RepositoryLike<Record<string, unknown>>` at every call just to
|
|
159
|
+
* silence it. The constraint now lives exclusively on `BaseController`
|
|
160
|
+
* where it's load-bearing for mixin composition; `defineResource`
|
|
161
|
+
* widens once internally so every other layer stays permissive.
|
|
162
|
+
*
|
|
144
163
|
* @example
|
|
145
164
|
* ```typescript
|
|
146
165
|
* // Object form (explicit)
|
|
@@ -153,7 +172,7 @@ declare class MongooseAdapter<TDoc = unknown> implements DataAdapter<TDoc> {
|
|
|
153
172
|
* const adapter = createMongooseAdapter(ProductModel, productRepository);
|
|
154
173
|
* ```
|
|
155
174
|
*/
|
|
156
|
-
declare function createMongooseAdapter<TDoc = unknown>(model: Model<TDoc>, repository:
|
|
175
|
+
declare function createMongooseAdapter<TDoc = unknown>(model: Model<TDoc>, repository: RepositoryLike<TDoc>): DataAdapter<TDoc>;
|
|
157
176
|
declare function createMongooseAdapter<TDoc = unknown>(options: MongooseAdapterOptions<TDoc>): DataAdapter<TDoc>;
|
|
158
177
|
//#endregion
|
|
159
178
|
//#region src/adapters/prisma.d.ts
|