@classytic/arc 1.1.0 → 2.1.3
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 +247 -794
- package/bin/arc.js +91 -52
- package/dist/EventTransport-BkUDYZEb.d.mts +99 -0
- package/dist/HookSystem-BsGV-j2l.mjs +404 -0
- package/dist/ResourceRegistry-7Ic20ZMw.mjs +249 -0
- package/dist/adapters/index.d.mts +5 -0
- package/dist/adapters/index.mjs +3 -0
- package/dist/audit/index.d.mts +81 -0
- package/dist/audit/index.mjs +275 -0
- package/dist/audit/mongodb.d.mts +5 -0
- package/dist/audit/mongodb.mjs +3 -0
- package/dist/audited-CGdLiSlE.mjs +140 -0
- package/dist/auth/index.d.mts +188 -0
- package/dist/auth/index.mjs +1096 -0
- package/dist/auth/redis-session.d.mts +43 -0
- package/dist/auth/redis-session.mjs +75 -0
- package/dist/betterAuthOpenApi-DjWDddNc.mjs +249 -0
- package/dist/cache/index.d.mts +145 -0
- package/dist/cache/index.mjs +91 -0
- package/dist/caching-GSDJcA6-.mjs +93 -0
- package/dist/chunk-C7Uep-_p.mjs +20 -0
- package/dist/circuitBreaker-DYhWBW_D.mjs +1096 -0
- package/dist/cli/commands/describe.d.mts +18 -0
- package/dist/cli/commands/describe.mjs +238 -0
- package/dist/cli/commands/docs.d.mts +13 -0
- package/dist/cli/commands/docs.mjs +52 -0
- package/dist/cli/commands/{generate.d.ts → generate.d.mts} +3 -2
- package/dist/cli/commands/generate.mjs +357 -0
- package/dist/cli/commands/{init.d.ts → init.d.mts} +11 -8
- package/dist/cli/commands/{init.js → init.mjs} +807 -617
- package/dist/cli/commands/introspect.d.mts +10 -0
- package/dist/cli/commands/introspect.mjs +75 -0
- package/dist/cli/index.d.mts +16 -0
- package/dist/cli/index.mjs +156 -0
- package/dist/constants-DdXFXQtN.mjs +84 -0
- package/dist/core/index.d.mts +5 -0
- package/dist/core/index.mjs +4 -0
- package/dist/createApp-D2D5XXaV.mjs +559 -0
- package/dist/defineResource-PXzSJ15_.mjs +2197 -0
- package/dist/discovery/index.d.mts +46 -0
- package/dist/discovery/index.mjs +109 -0
- package/dist/docs/index.d.mts +162 -0
- package/dist/docs/index.mjs +74 -0
- package/dist/elevation-DGo5shaX.d.mts +87 -0
- package/dist/elevation-DSTbVvYj.mjs +113 -0
- package/dist/errorHandler-C3GY3_ow.mjs +108 -0
- package/dist/errorHandler-CW3OOeYq.d.mts +72 -0
- package/dist/errors-DAWRdiYP.d.mts +124 -0
- package/dist/errors-DBANPbGr.mjs +211 -0
- package/dist/eventPlugin-BEOvaDqo.mjs +229 -0
- package/dist/eventPlugin-H6wDDjGO.d.mts +124 -0
- package/dist/events/index.d.mts +53 -0
- package/dist/events/index.mjs +51 -0
- package/dist/events/transports/redis-stream-entry.d.mts +2 -0
- package/dist/events/transports/redis-stream-entry.mjs +177 -0
- package/dist/events/transports/redis.d.mts +76 -0
- package/dist/events/transports/redis.mjs +124 -0
- package/dist/externalPaths-SyPF2tgK.d.mts +50 -0
- package/dist/factory/index.d.mts +63 -0
- package/dist/factory/index.mjs +3 -0
- package/dist/fastifyAdapter-C8DlE0YH.d.mts +216 -0
- package/dist/fields-Bi_AVKSo.d.mts +109 -0
- package/dist/fields-CTd_CrKr.mjs +114 -0
- package/dist/hooks/index.d.mts +4 -0
- package/dist/hooks/index.mjs +3 -0
- package/dist/idempotency/index.d.mts +96 -0
- package/dist/idempotency/index.mjs +319 -0
- package/dist/idempotency/mongodb.d.mts +2 -0
- package/dist/idempotency/mongodb.mjs +114 -0
- package/dist/idempotency/redis.d.mts +2 -0
- package/dist/idempotency/redis.mjs +103 -0
- package/dist/index.d.mts +260 -0
- package/dist/index.mjs +104 -0
- package/dist/integrations/event-gateway.d.mts +46 -0
- package/dist/integrations/event-gateway.mjs +43 -0
- package/dist/integrations/index.d.mts +5 -0
- package/dist/integrations/index.mjs +1 -0
- package/dist/integrations/jobs.d.mts +103 -0
- package/dist/integrations/jobs.mjs +123 -0
- package/dist/integrations/streamline.d.mts +60 -0
- package/dist/integrations/streamline.mjs +125 -0
- package/dist/integrations/websocket.d.mts +82 -0
- package/dist/integrations/websocket.mjs +288 -0
- package/dist/interface-CSNjltAc.d.mts +77 -0
- package/dist/interface-DTbsvIWe.d.mts +54 -0
- package/dist/interface-e9XfSsUV.d.mts +1097 -0
- package/dist/introspectionPlugin-B3JkrjwU.mjs +53 -0
- package/dist/keys-DhqDRxv3.mjs +42 -0
- package/dist/logger-ByrvQWZO.mjs +78 -0
- package/dist/memory-B2v7KrCB.mjs +143 -0
- package/dist/migrations/index.d.mts +156 -0
- package/dist/migrations/index.mjs +260 -0
- package/dist/mongodb-ClykrfGo.d.mts +118 -0
- package/dist/mongodb-DNKEExbf.mjs +93 -0
- package/dist/mongodb-Dg8O_gvd.d.mts +71 -0
- package/dist/openapi-9nB_kiuR.mjs +525 -0
- package/dist/org/index.d.mts +68 -0
- package/dist/org/index.mjs +513 -0
- package/dist/org/types.d.mts +82 -0
- package/dist/org/types.mjs +1 -0
- package/dist/permissions/index.d.mts +278 -0
- package/dist/permissions/index.mjs +579 -0
- package/dist/plugins/index.d.mts +172 -0
- package/dist/plugins/index.mjs +522 -0
- package/dist/plugins/response-cache.d.mts +87 -0
- package/dist/plugins/response-cache.mjs +283 -0
- package/dist/plugins/tracing-entry.d.mts +2 -0
- package/dist/plugins/tracing-entry.mjs +185 -0
- package/dist/pluralize-CM-jZg7p.mjs +86 -0
- package/dist/policies/{index.d.ts → index.d.mts} +204 -170
- package/dist/policies/index.mjs +321 -0
- package/dist/presets/{index.d.ts → index.d.mts} +62 -131
- package/dist/presets/index.mjs +143 -0
- package/dist/presets/multiTenant.d.mts +24 -0
- package/dist/presets/multiTenant.mjs +113 -0
- package/dist/presets-BTeYbw7h.d.mts +57 -0
- package/dist/presets-CeFtfDR8.mjs +119 -0
- package/dist/prisma-C3iornoK.d.mts +274 -0
- package/dist/prisma-DJbMt3yf.mjs +627 -0
- package/dist/queryCachePlugin-B6R0d4av.mjs +138 -0
- package/dist/queryCachePlugin-Q6SYuHZ6.d.mts +71 -0
- package/dist/redis-UwjEp8Ea.d.mts +49 -0
- package/dist/redis-stream-CBg0upHI.d.mts +103 -0
- package/dist/registry/index.d.mts +11 -0
- package/dist/registry/index.mjs +4 -0
- package/dist/requestContext-xi6OKBL-.mjs +55 -0
- package/dist/schemaConverter-Dtg0Kt9T.mjs +98 -0
- package/dist/schemas/index.d.mts +63 -0
- package/dist/schemas/index.mjs +82 -0
- package/dist/scope/index.d.mts +21 -0
- package/dist/scope/index.mjs +65 -0
- package/dist/sessionManager-D_iEHjQl.d.mts +186 -0
- package/dist/sse-DkqQ1uxb.mjs +123 -0
- package/dist/testing/index.d.mts +907 -0
- package/dist/testing/index.mjs +1976 -0
- package/dist/tracing-8CEbhF0w.d.mts +70 -0
- package/dist/typeGuards-DwxA1t_L.mjs +9 -0
- package/dist/types/index.d.mts +946 -0
- package/dist/types/index.mjs +14 -0
- package/dist/types-B0dhNrnd.d.mts +445 -0
- package/dist/types-Beqn1Un7.mjs +38 -0
- package/dist/types-DelU6kln.mjs +25 -0
- package/dist/types-RLkFVgaw.d.mts +101 -0
- package/dist/utils/index.d.mts +747 -0
- package/dist/utils/index.mjs +6 -0
- package/package.json +194 -68
- package/dist/BaseController-DVAiHxEQ.d.ts +0 -233
- package/dist/adapters/index.d.ts +0 -237
- package/dist/adapters/index.js +0 -668
- package/dist/arcCorePlugin-CsShQdyP.d.ts +0 -273
- package/dist/audit/index.d.ts +0 -195
- package/dist/audit/index.js +0 -319
- package/dist/auth/index.d.ts +0 -47
- package/dist/auth/index.js +0 -174
- package/dist/cli/commands/docs.d.ts +0 -11
- package/dist/cli/commands/docs.js +0 -474
- package/dist/cli/commands/generate.js +0 -334
- package/dist/cli/commands/introspect.d.ts +0 -8
- package/dist/cli/commands/introspect.js +0 -338
- package/dist/cli/index.d.ts +0 -4
- package/dist/cli/index.js +0 -3269
- package/dist/core/index.d.ts +0 -220
- package/dist/core/index.js +0 -2786
- package/dist/createApp-Ce9wl8W9.d.ts +0 -77
- package/dist/docs/index.d.ts +0 -166
- package/dist/docs/index.js +0 -658
- package/dist/errors-8WIxGS_6.d.ts +0 -122
- package/dist/events/index.d.ts +0 -117
- package/dist/events/index.js +0 -89
- package/dist/factory/index.d.ts +0 -38
- package/dist/factory/index.js +0 -1652
- package/dist/hooks/index.d.ts +0 -4
- package/dist/hooks/index.js +0 -199
- package/dist/idempotency/index.d.ts +0 -323
- package/dist/idempotency/index.js +0 -500
- package/dist/index-B4t03KQ0.d.ts +0 -1366
- package/dist/index.d.ts +0 -135
- package/dist/index.js +0 -4756
- package/dist/migrations/index.d.ts +0 -185
- package/dist/migrations/index.js +0 -274
- package/dist/org/index.d.ts +0 -129
- package/dist/org/index.js +0 -220
- package/dist/permissions/index.d.ts +0 -144
- package/dist/permissions/index.js +0 -103
- package/dist/plugins/index.d.ts +0 -46
- package/dist/plugins/index.js +0 -1069
- package/dist/policies/index.js +0 -196
- package/dist/presets/index.js +0 -384
- package/dist/presets/multiTenant.d.ts +0 -39
- package/dist/presets/multiTenant.js +0 -112
- package/dist/registry/index.d.ts +0 -16
- package/dist/registry/index.js +0 -253
- package/dist/testing/index.d.ts +0 -618
- package/dist/testing/index.js +0 -48020
- package/dist/types/index.d.ts +0 -4
- package/dist/types/index.js +0 -8
- package/dist/types-B99TBmFV.d.ts +0 -76
- package/dist/types-BvckRbs2.d.ts +0 -143
- package/dist/utils/index.d.ts +0 -679
- package/dist/utils/index.js +0 -931
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { D as CrudRepository, a as RepositoryLike, n as DataAdapter, o as SchemaMetadata, s as ValidationResult } from "./interface-e9XfSsUV.mjs";
|
|
2
|
+
import { OpenApiSchemas, ParsedQuery, QueryParserInterface, RouteSchemaOptions } from "./types/index.mjs";
|
|
3
|
+
import { Model } from "mongoose";
|
|
4
|
+
|
|
5
|
+
//#region src/adapters/mongoose.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Options for creating a Mongoose adapter
|
|
8
|
+
*
|
|
9
|
+
* @typeParam TDoc - The document type (inferred or explicit)
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Options for creating a Mongoose adapter
|
|
13
|
+
*
|
|
14
|
+
* @typeParam TDoc - The document type (inferred or explicit)
|
|
15
|
+
*/
|
|
16
|
+
interface MongooseAdapterOptions<TDoc = unknown> {
|
|
17
|
+
/** Mongoose model instance — preserves document type for type safety */
|
|
18
|
+
model: Model<TDoc>;
|
|
19
|
+
/** Repository implementing CRUD operations - accepts any repository-like object */
|
|
20
|
+
repository: CrudRepository<TDoc> | RepositoryLike;
|
|
21
|
+
/**
|
|
22
|
+
* External schema generator plugin for OpenAPI docs.
|
|
23
|
+
* When provided, replaces the built-in basic type conversion.
|
|
24
|
+
* Receives the Mongoose model and schema options, must return OpenApiSchemas.
|
|
25
|
+
*
|
|
26
|
+
* @example MongoKit integration
|
|
27
|
+
* ```typescript
|
|
28
|
+
* import { buildCrudSchemasFromModel } from '@classytic/mongokit';
|
|
29
|
+
*
|
|
30
|
+
* createMongooseAdapter({
|
|
31
|
+
* model: JobModel,
|
|
32
|
+
* repository: jobRepository,
|
|
33
|
+
* schemaGenerator: (model, options) => buildCrudSchemasFromModel(model, options),
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
schemaGenerator?: (model: Model<TDoc>, options?: RouteSchemaOptions) => OpenApiSchemas;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Mongoose data adapter with proper type safety
|
|
41
|
+
*
|
|
42
|
+
* @typeParam TDoc - The document type
|
|
43
|
+
*/
|
|
44
|
+
declare class MongooseAdapter<TDoc = unknown> implements DataAdapter<TDoc> {
|
|
45
|
+
readonly type: "mongoose";
|
|
46
|
+
readonly name: string;
|
|
47
|
+
readonly model: Model<TDoc>;
|
|
48
|
+
readonly repository: CrudRepository<TDoc> | RepositoryLike;
|
|
49
|
+
private readonly schemaGenerator?;
|
|
50
|
+
constructor(options: MongooseAdapterOptions<TDoc>);
|
|
51
|
+
/**
|
|
52
|
+
* Get schema metadata from Mongoose model
|
|
53
|
+
*/
|
|
54
|
+
getSchemaMetadata(): SchemaMetadata;
|
|
55
|
+
/**
|
|
56
|
+
* Generate OpenAPI schemas from Mongoose model.
|
|
57
|
+
*
|
|
58
|
+
* If a `schemaGenerator` plugin was provided (e.g. MongoKit's buildCrudSchemasFromModel),
|
|
59
|
+
* it is used instead of the built-in basic conversion.
|
|
60
|
+
*/
|
|
61
|
+
generateSchemas(schemaOptions?: RouteSchemaOptions): OpenApiSchemas | null;
|
|
62
|
+
/**
|
|
63
|
+
* Extract relation metadata
|
|
64
|
+
*/
|
|
65
|
+
private extractRelations;
|
|
66
|
+
/**
|
|
67
|
+
* Convert Mongoose type to OpenAPI type
|
|
68
|
+
*/
|
|
69
|
+
private mongooseTypeToOpenApi;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Create Mongoose adapter with flexible type acceptance.
|
|
73
|
+
* Accepts any repository with CRUD methods — no `as any` needed.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* // Object form (explicit)
|
|
78
|
+
* const adapter = createMongooseAdapter({
|
|
79
|
+
* model: ProductModel,
|
|
80
|
+
* repository: productRepository,
|
|
81
|
+
* });
|
|
82
|
+
*
|
|
83
|
+
* // Shorthand form (2-arg) — most common path
|
|
84
|
+
* const adapter = createMongooseAdapter(ProductModel, productRepository);
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
declare function createMongooseAdapter<TDoc = unknown>(model: Model<TDoc>, repository: CrudRepository<TDoc> | RepositoryLike): DataAdapter<TDoc>;
|
|
88
|
+
declare function createMongooseAdapter<TDoc = unknown>(options: MongooseAdapterOptions<TDoc>): DataAdapter<TDoc>;
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/adapters/prisma.d.ts
|
|
91
|
+
/** Prisma DMMF field shape */
|
|
92
|
+
interface DmmfField {
|
|
93
|
+
name: string;
|
|
94
|
+
type: string;
|
|
95
|
+
kind: string;
|
|
96
|
+
isList: boolean;
|
|
97
|
+
isRequired: boolean;
|
|
98
|
+
isUnique?: boolean;
|
|
99
|
+
isId?: boolean;
|
|
100
|
+
isGenerated?: boolean;
|
|
101
|
+
hasDefaultValue?: boolean;
|
|
102
|
+
default?: unknown;
|
|
103
|
+
documentation?: string;
|
|
104
|
+
relationName?: string;
|
|
105
|
+
}
|
|
106
|
+
/** Prisma DMMF enum value */
|
|
107
|
+
interface DmmfEnumValue {
|
|
108
|
+
name: string;
|
|
109
|
+
}
|
|
110
|
+
/** Prisma DMMF enum */
|
|
111
|
+
interface DmmfEnum {
|
|
112
|
+
name: string;
|
|
113
|
+
values: DmmfEnumValue[];
|
|
114
|
+
}
|
|
115
|
+
/** Prisma DMMF model shape */
|
|
116
|
+
interface DmmfModel {
|
|
117
|
+
name: string;
|
|
118
|
+
fields: DmmfField[];
|
|
119
|
+
uniqueIndexes?: Array<{
|
|
120
|
+
fields: string[];
|
|
121
|
+
}>;
|
|
122
|
+
}
|
|
123
|
+
/** Prisma DMMF datamodel */
|
|
124
|
+
interface DmmfDatamodel {
|
|
125
|
+
models: DmmfModel[];
|
|
126
|
+
enums?: DmmfEnum[];
|
|
127
|
+
}
|
|
128
|
+
/** Prisma DMMF root shape */
|
|
129
|
+
interface PrismaDmmf {
|
|
130
|
+
datamodel?: DmmfDatamodel;
|
|
131
|
+
}
|
|
132
|
+
/** Prisma client shape */
|
|
133
|
+
interface PrismaClientLike {
|
|
134
|
+
$disconnect(): Promise<void>;
|
|
135
|
+
[key: string]: unknown;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Options for PrismaQueryParser
|
|
139
|
+
*/
|
|
140
|
+
interface PrismaQueryParserOptions {
|
|
141
|
+
/** Maximum allowed limit value (default: 1000) */
|
|
142
|
+
maxLimit?: number;
|
|
143
|
+
/** Default limit for pagination (default: 20) */
|
|
144
|
+
defaultLimit?: number;
|
|
145
|
+
/** Enable soft delete filtering by default (default: true) */
|
|
146
|
+
softDeleteEnabled?: boolean;
|
|
147
|
+
/** Field name for soft delete (default: 'deletedAt') */
|
|
148
|
+
softDeleteField?: string;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Prisma Query Parser - Converts URL parameters to Prisma query format
|
|
152
|
+
*
|
|
153
|
+
* Translates Arc's query format to Prisma's where/orderBy/take/skip structure.
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```typescript
|
|
157
|
+
* const parser = new PrismaQueryParser();
|
|
158
|
+
*
|
|
159
|
+
* // URL: ?status=active&price[gte]=100&sort=-createdAt&page=2&limit=10
|
|
160
|
+
* const prismaQuery = parser.toPrismaQuery(parsedQuery);
|
|
161
|
+
* // Returns:
|
|
162
|
+
* // {
|
|
163
|
+
* // where: { status: 'active', price: { gte: 100 }, deletedAt: null },
|
|
164
|
+
* // orderBy: { createdAt: 'desc' },
|
|
165
|
+
* // take: 10,
|
|
166
|
+
* // skip: 10,
|
|
167
|
+
* // }
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
170
|
+
declare class PrismaQueryParser implements QueryParserInterface {
|
|
171
|
+
private readonly maxLimit;
|
|
172
|
+
private readonly defaultLimit;
|
|
173
|
+
private readonly softDeleteEnabled;
|
|
174
|
+
private readonly softDeleteField;
|
|
175
|
+
/** Map Arc operators to Prisma operators */
|
|
176
|
+
private readonly operatorMap;
|
|
177
|
+
constructor(options?: PrismaQueryParserOptions);
|
|
178
|
+
/**
|
|
179
|
+
* Parse URL query parameters (delegates to ArcQueryParser format)
|
|
180
|
+
*/
|
|
181
|
+
parse(query: Record<string, unknown> | null | undefined): ParsedQuery;
|
|
182
|
+
/**
|
|
183
|
+
* Convert ParsedQuery to Prisma query options
|
|
184
|
+
*/
|
|
185
|
+
toPrismaQuery(parsed: ParsedQuery, policyFilters?: Record<string, unknown>): PrismaQueryOptions;
|
|
186
|
+
/**
|
|
187
|
+
* Translate Arc/MongoDB-style filters to Prisma where clause
|
|
188
|
+
*/
|
|
189
|
+
private translateFilters;
|
|
190
|
+
private parseNumber;
|
|
191
|
+
private parseSort;
|
|
192
|
+
private parseSelect;
|
|
193
|
+
private parseFilters;
|
|
194
|
+
private coerceValue;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Prisma query options returned by toPrismaQuery
|
|
198
|
+
*/
|
|
199
|
+
interface PrismaQueryOptions {
|
|
200
|
+
where?: Record<string, unknown>;
|
|
201
|
+
orderBy?: Array<Record<string, 'asc' | 'desc'>>;
|
|
202
|
+
take?: number;
|
|
203
|
+
skip?: number;
|
|
204
|
+
select?: Record<string, boolean>;
|
|
205
|
+
include?: Record<string, boolean>;
|
|
206
|
+
}
|
|
207
|
+
interface PrismaAdapterOptions<TModel> {
|
|
208
|
+
/** Prisma client instance */
|
|
209
|
+
client: PrismaClientLike;
|
|
210
|
+
/** Model name (e.g., 'user', 'product') */
|
|
211
|
+
modelName: string;
|
|
212
|
+
/** Repository instance implementing CRUD operations */
|
|
213
|
+
repository: CrudRepository<TModel>;
|
|
214
|
+
/** Optional: Prisma DMMF (Data Model Meta Format) for schema extraction */
|
|
215
|
+
dmmf?: PrismaDmmf;
|
|
216
|
+
/** Optional: Custom query parser (default: PrismaQueryParser) */
|
|
217
|
+
queryParser?: PrismaQueryParser;
|
|
218
|
+
/** Enable soft delete filtering (default: true) */
|
|
219
|
+
softDeleteEnabled?: boolean;
|
|
220
|
+
/** Field name for soft delete (default: 'deletedAt') */
|
|
221
|
+
softDeleteField?: string;
|
|
222
|
+
}
|
|
223
|
+
declare class PrismaAdapter<TModel = unknown> implements DataAdapter<TModel> {
|
|
224
|
+
readonly type: "prisma";
|
|
225
|
+
readonly name: string;
|
|
226
|
+
readonly repository: CrudRepository<TModel>;
|
|
227
|
+
readonly queryParser: PrismaQueryParser;
|
|
228
|
+
private client;
|
|
229
|
+
private modelName;
|
|
230
|
+
private dmmf?;
|
|
231
|
+
private softDeleteEnabled;
|
|
232
|
+
private softDeleteField;
|
|
233
|
+
constructor(options: PrismaAdapterOptions<TModel>);
|
|
234
|
+
/**
|
|
235
|
+
* Parse URL query parameters and convert to Prisma query options
|
|
236
|
+
*/
|
|
237
|
+
parseQuery(query: Record<string, unknown>, policyFilters?: Record<string, unknown>): PrismaQueryOptions;
|
|
238
|
+
/**
|
|
239
|
+
* Apply policy filters to existing Prisma where clause
|
|
240
|
+
* Used for multi-tenant, ownership, and other security filters
|
|
241
|
+
*/
|
|
242
|
+
applyPolicyFilters(where: Record<string, unknown>, policyFilters: Record<string, unknown>): Record<string, unknown>;
|
|
243
|
+
generateSchemas(options?: RouteSchemaOptions): OpenApiSchemas | null;
|
|
244
|
+
getSchemaMetadata(): SchemaMetadata | null;
|
|
245
|
+
validate(data: unknown): Promise<ValidationResult>;
|
|
246
|
+
healthCheck(): Promise<boolean>;
|
|
247
|
+
close(): Promise<void>;
|
|
248
|
+
private buildEntitySchema;
|
|
249
|
+
private buildCreateSchema;
|
|
250
|
+
private buildUpdateSchema;
|
|
251
|
+
private shouldSkipField;
|
|
252
|
+
private convertPrismaFieldToJsonSchema;
|
|
253
|
+
private convertPrismaFieldToMetadata;
|
|
254
|
+
private mapPrismaTypeToMetadataType;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Factory function to create Prisma adapter
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* import { PrismaClient } from '@prisma/client';
|
|
261
|
+
* import { createPrismaAdapter } from '@classytic/arc';
|
|
262
|
+
*
|
|
263
|
+
* const prisma = new PrismaClient();
|
|
264
|
+
*
|
|
265
|
+
* const userAdapter = createPrismaAdapter({
|
|
266
|
+
* client: prisma,
|
|
267
|
+
* modelName: 'user',
|
|
268
|
+
* repository: userRepository,
|
|
269
|
+
* dmmf: Prisma.dmmf, // Optional: for schema generation
|
|
270
|
+
* });
|
|
271
|
+
*/
|
|
272
|
+
declare function createPrismaAdapter<TModel>(options: PrismaAdapterOptions<TModel>): PrismaAdapter<TModel>;
|
|
273
|
+
//#endregion
|
|
274
|
+
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 };
|