@classytic/arc 2.9.1 → 2.10.8
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 +20 -91
- package/dist/{BaseController-Vu2yc56T.mjs → BaseController-DVNKvoX4.mjs} +154 -170
- package/dist/{ResourceRegistry-Dq3_zBQP.mjs → ResourceRegistry-CcN2LVrc.mjs} +1 -1
- package/dist/actionPermissions-TUVR3uiZ.mjs +22 -0
- package/dist/adapters/index.d.mts +3 -3
- package/dist/adapters/index.mjs +2 -2
- package/dist/{adapters-BBqAVvPK.mjs → adapters-BXY4i-hw.mjs} +210 -41
- package/dist/audit/index.d.mts +38 -3
- package/dist/audit/index.mjs +54 -22
- package/dist/auth/index.d.mts +2 -2
- package/dist/auth/index.mjs +3 -3
- package/dist/cache/index.d.mts +17 -15
- package/dist/cache/index.mjs +16 -15
- package/dist/{caching-CjybdRwx.mjs → caching-3h93rkJM.mjs} +8 -3
- package/dist/cli/commands/describe.mjs +1 -1
- package/dist/cli/commands/docs.mjs +2 -2
- package/dist/cli/commands/init.mjs +1 -1
- 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 +2 -2
- package/dist/core/index.mjs +3 -4
- package/dist/{defineResource-C__jkwvs.mjs → core-3MWJosCH.mjs} +174 -94
- package/dist/{createActionRouter-DH1YFL9m.mjs → createActionRouter-C8UUB3Px.mjs} +1 -1
- package/dist/{createApp-CBJUJKGP.mjs → createApp-BwnEAO2h.mjs} +53 -19
- package/dist/docs/index.d.mts +1 -1
- package/dist/docs/index.mjs +2 -2
- package/dist/{elevation-DxQ6ACbt.mjs → elevation-Dci0AYLT.mjs} +2 -2
- package/dist/errorHandler-2ii4RIYr.d.mts +114 -0
- package/dist/{errorHandler-CZDW4EXS.mjs → errorHandler-CSxe7KIM.mjs} +1 -1
- package/dist/{eventPlugin-Dl7MoVWH.mjs → eventPlugin-ByU4Cv0e.mjs} +1 -1
- package/dist/{eventPlugin-BxvaCIZF.d.mts → eventPlugin-D1ThQ1Pp.d.mts} +1 -1
- package/dist/events/index.d.mts +8 -5
- package/dist/events/index.mjs +87 -52
- package/dist/events/transports/redis-stream-entry.d.mts +1 -1
- package/dist/events/transports/redis.d.mts +1 -1
- package/dist/factory/index.d.mts +1 -1
- package/dist/factory/index.mjs +1 -1
- package/dist/{types-DZi1aYhm.d.mts → fields-C8Y0XLAu.d.mts} +122 -2
- package/dist/hooks/index.d.mts +1 -1
- package/dist/idempotency/index.d.mts +5 -2
- package/dist/idempotency/index.mjs +46 -37
- package/dist/{interface-YrWsmKqE.d.mts → index-BGbpGVyM.d.mts} +2107 -2756
- package/dist/{index-CtGKT0lf.d.mts → index-BziRPS4H.d.mts} +81 -7
- package/dist/{index-C-xjcA6F.d.mts → index-C_Noptz-.d.mts} +284 -409
- package/dist/{index-Cibkchnx.d.mts → index-EqQN6p0W.d.mts} +3 -3
- package/dist/index.d.mts +6 -219
- package/dist/index.mjs +10 -131
- package/dist/integrations/event-gateway.d.mts +1 -1
- package/dist/integrations/event-gateway.mjs +1 -1
- package/dist/integrations/index.d.mts +1 -1
- package/dist/integrations/mcp/index.d.mts +2 -2
- package/dist/integrations/mcp/index.mjs +1 -1
- package/dist/integrations/mcp/testing.d.mts +1 -1
- package/dist/integrations/mcp/testing.mjs +1 -1
- package/dist/interface-yhyb_pLY.d.mts +77 -0
- package/dist/logger/index.d.mts +81 -0
- package/dist/{logger-CDjpjySd.mjs → logger/index.mjs} +1 -6
- package/dist/{memory-BFAYkf8H.mjs → memory-DqI-449b.mjs} +23 -8
- package/dist/middleware/index.d.mts +109 -0
- package/dist/middleware/index.mjs +70 -0
- package/dist/multipartBody-CUQGVlM_.mjs +123 -0
- package/dist/{openapi-CXuTG1M9.mjs → openapi-DpNpqBmo.mjs} +9 -7
- package/dist/org/index.d.mts +2 -2
- package/dist/permissions/index.d.mts +3 -4
- package/dist/permissions/index.mjs +5 -5
- package/dist/{permissions-oNZawnkR.mjs → permissions-wkqRwicB.mjs} +315 -397
- package/dist/pipe-CGJxqDGx.mjs +62 -0
- package/dist/pipeline/index.d.mts +62 -0
- package/dist/pipeline/index.mjs +53 -0
- package/dist/plugins/index.d.mts +23 -3
- package/dist/plugins/index.mjs +9 -11
- package/dist/plugins/response-cache.mjs +1 -1
- package/dist/plugins/tracing-entry.mjs +1 -1
- package/dist/presets/filesUpload.d.mts +3 -3
- 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 +43 -9
- package/dist/presets/search.d.mts +91 -4
- package/dist/presets/search.mjs +1 -1
- package/dist/{presets-hM4WhNWY.mjs → presets-CrwOvuXI.mjs} +1 -1
- package/dist/{queryCachePlugin-DbUVroUG.mjs → queryCachePlugin-ChLNZvFT.mjs} +9 -9
- package/dist/{queryCachePlugin-CnTZZTC5.d.mts → queryCachePlugin-Dumka73q.d.mts} +1 -1
- package/dist/{queryParser-Cs-6SHQK.mjs → queryParser-NR__Qiju.mjs} +69 -2
- package/dist/{redis-stream-Bz-4q96t.d.mts → redis-stream-bkO88VHx.d.mts} +1 -1
- package/dist/registry/index.d.mts +1 -1
- package/dist/registry/index.mjs +1 -1
- package/dist/{requestContext-DYtmNpm5.mjs → requestContext-C38GskNt.mjs} +1 -1
- package/dist/{resourceToTools-C3cWymnW.mjs → resourceToTools-BhF3JV5p.mjs} +8 -3
- package/dist/scope/index.d.mts +2 -2
- package/dist/scope/index.mjs +2 -2
- package/dist/{sse-CJpt7LGI.mjs → sse-D8UeDwis.mjs} +1 -1
- package/dist/{store-helpers-DFiZl5TL.mjs → store-helpers-DYYUQbQN.mjs} +4 -0
- package/dist/testing/index.d.mts +6 -5
- package/dist/testing/index.mjs +17 -10
- package/dist/types/index.d.mts +5 -5
- package/dist/types/index.mjs +1 -31
- package/dist/types-CDnTEpga.mjs +27 -0
- package/dist/{types-CoSzA-s-.d.mts → types-CVKBssX5.d.mts} +1 -1
- package/dist/{types-CunEX4UX.d.mts → types-CVdgPXBW.d.mts} +20 -7
- package/dist/utils/index.d.mts +277 -3
- package/dist/utils/index.mjs +4 -5
- package/dist/{utils-B7FuRr9w.mjs → utils-LMwVidKy.mjs} +303 -2
- package/dist/{versioning-Cm8qoFDg.mjs → versioning-B6mimogM.mjs} +3 -5
- package/dist/versioning-CeUXHfjw.d.mts +117 -0
- package/package.json +31 -18
- package/skills/arc/SKILL.md +8 -12
- package/skills/arc/references/production.md +0 -41
- package/dist/circuitBreaker-CvXkjfrW.d.mts +0 -206
- package/dist/circuitBreaker-l18oRgL5.mjs +0 -284
- package/dist/core-DNncu0xF.mjs +0 -34
- package/dist/dynamic/index.d.mts +0 -93
- package/dist/dynamic/index.mjs +0 -122
- package/dist/errorHandler-DixGcttC.d.mts +0 -218
- package/dist/fields-BC7zcmI9.d.mts +0 -121
- package/dist/filesUpload-q8oHt--L.mjs +0 -377
- package/dist/interface-DplgQO2e.d.mts +0 -54
- package/dist/policies/index.d.mts +0 -425
- package/dist/policies/index.mjs +0 -318
- package/dist/rpc/index.d.mts +0 -90
- package/dist/rpc/index.mjs +0 -248
- /package/dist/{EventTransport-CqZ8FyM_.d.mts → EventTransport-CfVEGaEl.d.mts} +0 -0
- /package/dist/{applyPermissionResult-bqGpo9ML.mjs → applyPermissionResult-QhV1Pa-g.mjs} +0 -0
- /package/dist/{constants-Cxde4rpC.mjs → constants-BhY1OHoH.mjs} +0 -0
- /package/dist/{elevation-B6S5csVA.d.mts → elevation-s5ykdNHr.d.mts} +0 -0
- /package/dist/{errors-CqWnSqM-.mjs → errors-BqdUDja_.mjs} +0 -0
- /package/dist/{fields-CU6FlaDV.mjs → fields-CTMWOUDt.mjs} +0 -0
- /package/dist/{keys-qcD-TVJl.mjs → keys-nWQGUTu1.mjs} +0 -0
- /package/dist/{types-ZUu_h0jp.mjs → types-D57iXYb8.mjs} +0 -0
- /package/dist/{types-BD85MlEK.d.mts → types-tgR4Pt8F.d.mts} +0 -0
|
@@ -1,6 +1,80 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dt as RouteSchemaOptions, S as QueryParserInterface, _n as RepositoryLike, b as ParsedQuery, mn as DataAdapter, mt as OpenApiSchemas, pn as AdapterSchemaContext, vn as SchemaMetadata, yn as ValidationResult } from "./index-BGbpGVyM.mjs";
|
|
2
2
|
import { Model } from "mongoose";
|
|
3
|
+
import { StandardRepo } from "@classytic/repo-core/repository";
|
|
3
4
|
|
|
5
|
+
//#region src/adapters/drizzle.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Minimum shape arc needs from a Drizzle column. Every SQLite, PG, and MySQL
|
|
8
|
+
* column in `drizzle-orm` exposes these via `getTableColumns(table)`. Held
|
|
9
|
+
* structurally so arc doesn't depend on `drizzle-orm` types.
|
|
10
|
+
*/
|
|
11
|
+
interface DrizzleColumnLike {
|
|
12
|
+
columnType?: string;
|
|
13
|
+
dataType?: "number" | "string" | "date" | "boolean" | "json" | "buffer" | "bigint" | "custom";
|
|
14
|
+
notNull?: boolean;
|
|
15
|
+
hasDefault?: boolean;
|
|
16
|
+
primary?: boolean;
|
|
17
|
+
enumValues?: readonly string[];
|
|
18
|
+
length?: number;
|
|
19
|
+
name?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Structural Drizzle table — only requires `[Symbol.for('drizzle:Columns')]`,
|
|
23
|
+
* which every Drizzle table exposes. Matches `drizzle-orm`'s `Table` at
|
|
24
|
+
* runtime without importing it at compile time.
|
|
25
|
+
*/
|
|
26
|
+
type DrizzleTableLike = Record<symbol, Record<string, DrizzleColumnLike>> & {
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
};
|
|
29
|
+
interface DrizzleAdapterOptions<TDoc = unknown> {
|
|
30
|
+
/** Drizzle table — used for schema introspection. */
|
|
31
|
+
table: DrizzleTableLike;
|
|
32
|
+
/** Repository implementing the repo-core contract. */
|
|
33
|
+
repository: StandardRepo<TDoc> | RepositoryLike<TDoc>;
|
|
34
|
+
/**
|
|
35
|
+
* External schema generator. When provided, replaces the built-in
|
|
36
|
+
* type-only conversion. Wire it to your kit's `buildCrudSchemasFromTable`
|
|
37
|
+
* (sqlitekit, pgkit, ...) to get the full CRUD schemas — strict
|
|
38
|
+
* additional-property control, field-rule application, param-type
|
|
39
|
+
* narrowing from primary-key columns, etc.
|
|
40
|
+
*/
|
|
41
|
+
schemaGenerator?: (table: DrizzleTableLike, options?: RouteSchemaOptions, context?: AdapterSchemaContext) => OpenApiSchemas | Record<string, unknown>;
|
|
42
|
+
/** Optional name — defaults to "DrizzleAdapter". */
|
|
43
|
+
name?: string;
|
|
44
|
+
}
|
|
45
|
+
declare class DrizzleAdapter<TDoc = unknown> implements DataAdapter<TDoc> {
|
|
46
|
+
readonly type: "drizzle";
|
|
47
|
+
readonly name: string;
|
|
48
|
+
readonly table: DrizzleTableLike;
|
|
49
|
+
readonly repository: StandardRepo<TDoc> | RepositoryLike<TDoc>;
|
|
50
|
+
private readonly schemaGenerator?;
|
|
51
|
+
constructor(options: DrizzleAdapterOptions<TDoc>);
|
|
52
|
+
/**
|
|
53
|
+
* Introspect Drizzle columns into arc's schema metadata shape.
|
|
54
|
+
*/
|
|
55
|
+
getSchemaMetadata(): SchemaMetadata;
|
|
56
|
+
/**
|
|
57
|
+
* Generate OpenAPI schemas. Delegates to the user-provided
|
|
58
|
+
* `schemaGenerator` when available (strongly recommended — that's where
|
|
59
|
+
* field rules, omit lists, and param-type narrowing live). The built-in
|
|
60
|
+
* fallback emits a permissive entity + CRUD body shape so routes still
|
|
61
|
+
* register when no generator is provided.
|
|
62
|
+
*
|
|
63
|
+
* After the kit generator runs, arc merges constraint-style field rules
|
|
64
|
+
* (`minLength`, `maxLength`, `min`, `max`, `pattern`, `enum`, `description`)
|
|
65
|
+
* into the resulting property schemas so sqlitekit / pgkit behave
|
|
66
|
+
* identically to mongoose here — rule-driven AJV constraints apply
|
|
67
|
+
* regardless of backend.
|
|
68
|
+
*/
|
|
69
|
+
generateSchemas(schemaOptions?: RouteSchemaOptions, context?: AdapterSchemaContext): OpenApiSchemas | Record<string, unknown> | null;
|
|
70
|
+
healthCheck(): Promise<boolean>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Factory — preferred construction style for symmetry with
|
|
74
|
+
* `createMongooseAdapter` / `createPrismaAdapter`.
|
|
75
|
+
*/
|
|
76
|
+
declare function createDrizzleAdapter<TDoc = unknown>(options: DrizzleAdapterOptions<TDoc>): DrizzleAdapter<TDoc>;
|
|
77
|
+
//#endregion
|
|
4
78
|
//#region src/adapters/mongoose.d.ts
|
|
5
79
|
/**
|
|
6
80
|
* Options for creating a Mongoose adapter.
|
|
@@ -12,7 +86,7 @@ interface MongooseAdapterOptions<TDoc = unknown> {
|
|
|
12
86
|
/** Mongoose model instance — preserves document type for type safety */
|
|
13
87
|
model: Model<TDoc>;
|
|
14
88
|
/** Repository implementing CRUD operations - accepts any repository-like object */
|
|
15
|
-
repository:
|
|
89
|
+
repository: StandardRepo<TDoc> | RepositoryLike<TDoc>;
|
|
16
90
|
/**
|
|
17
91
|
* External schema generator plugin for OpenAPI docs.
|
|
18
92
|
* When provided, replaces the built-in basic type conversion.
|
|
@@ -40,7 +114,7 @@ declare class MongooseAdapter<TDoc = unknown> implements DataAdapter<TDoc> {
|
|
|
40
114
|
readonly type: "mongoose";
|
|
41
115
|
readonly name: string;
|
|
42
116
|
readonly model: Model<TDoc>;
|
|
43
|
-
readonly repository:
|
|
117
|
+
readonly repository: StandardRepo<TDoc> | RepositoryLike<TDoc>;
|
|
44
118
|
private readonly schemaGenerator?;
|
|
45
119
|
constructor(options: MongooseAdapterOptions<TDoc>);
|
|
46
120
|
/**
|
|
@@ -79,7 +153,7 @@ declare class MongooseAdapter<TDoc = unknown> implements DataAdapter<TDoc> {
|
|
|
79
153
|
* const adapter = createMongooseAdapter(ProductModel, productRepository);
|
|
80
154
|
* ```
|
|
81
155
|
*/
|
|
82
|
-
declare function createMongooseAdapter<TDoc = unknown>(model: Model<TDoc>, repository:
|
|
156
|
+
declare function createMongooseAdapter<TDoc = unknown>(model: Model<TDoc>, repository: StandardRepo<TDoc> | RepositoryLike<TDoc>): DataAdapter<TDoc>;
|
|
83
157
|
declare function createMongooseAdapter<TDoc = unknown>(options: MongooseAdapterOptions<TDoc>): DataAdapter<TDoc>;
|
|
84
158
|
//#endregion
|
|
85
159
|
//#region src/adapters/prisma.d.ts
|
|
@@ -205,7 +279,7 @@ interface PrismaAdapterOptions<TModel> {
|
|
|
205
279
|
/** Model name (e.g., 'user', 'product') */
|
|
206
280
|
modelName: string;
|
|
207
281
|
/** Repository instance implementing CRUD operations */
|
|
208
|
-
repository:
|
|
282
|
+
repository: StandardRepo<TModel>;
|
|
209
283
|
/** Optional: Prisma DMMF (Data Model Meta Format) for schema extraction */
|
|
210
284
|
dmmf?: PrismaDmmf;
|
|
211
285
|
/** Optional: Custom query parser (default: PrismaQueryParser) */
|
|
@@ -218,7 +292,7 @@ interface PrismaAdapterOptions<TModel> {
|
|
|
218
292
|
declare class PrismaAdapter<TModel = unknown> implements DataAdapter<TModel> {
|
|
219
293
|
readonly type: "prisma";
|
|
220
294
|
readonly name: string;
|
|
221
|
-
readonly repository:
|
|
295
|
+
readonly repository: StandardRepo<TModel>;
|
|
222
296
|
readonly queryParser: PrismaQueryParser;
|
|
223
297
|
private client;
|
|
224
298
|
private modelName;
|
|
@@ -266,4 +340,4 @@ declare class PrismaAdapter<TModel = unknown> implements DataAdapter<TModel> {
|
|
|
266
340
|
*/
|
|
267
341
|
declare function createPrismaAdapter<TModel>(options: PrismaAdapterOptions<TModel>): PrismaAdapter<TModel>;
|
|
268
342
|
//#endregion
|
|
269
|
-
export { PrismaQueryParserOptions as a, MongooseAdapterOptions as c, PrismaQueryParser as i, createMongooseAdapter as l, PrismaAdapterOptions as n, createPrismaAdapter as o, PrismaQueryOptions as r, MongooseAdapter as s, PrismaAdapter as t };
|
|
343
|
+
export { PrismaQueryParserOptions as a, MongooseAdapterOptions as c, DrizzleAdapterOptions as d, createDrizzleAdapter as f, PrismaQueryParser as i, createMongooseAdapter as l, PrismaAdapterOptions as n, createPrismaAdapter as o, PrismaQueryOptions as r, MongooseAdapter as s, PrismaAdapter as t, DrizzleAdapter as u };
|