@classytic/arc 1.0.0 → 1.0.5
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/bin/arc.js +118 -103
- package/dist/adapters/index.d.ts +2 -2
- package/dist/{arcCorePlugin-DTPWXcZN.d.ts → arcCorePlugin-Cqi7j5-_.d.ts} +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/cli/commands/generate.d.ts +16 -0
- package/dist/cli/commands/generate.js +334 -0
- package/dist/cli/commands/init.d.ts +24 -0
- package/dist/cli/commands/init.js +2410 -0
- package/dist/cli/index.d.ts +4 -43
- package/dist/cli/index.js +3145 -411
- package/dist/{createApp-pzUAkzbz.d.ts → createApp-9q_I1la4.d.ts} +1 -1
- package/dist/docs/index.js +19 -11
- package/dist/factory/index.d.ts +4 -4
- package/dist/factory/index.js +6 -23
- package/dist/hooks/index.d.ts +1 -1
- package/dist/{index-DkAW8BXh.d.ts → index-WBEvhmWM.d.ts} +32 -12
- package/dist/index.d.ts +67 -34
- package/dist/index.js +103 -111
- package/dist/org/index.d.ts +1 -1
- package/dist/plugins/index.d.ts +2 -2
- package/dist/presets/index.d.ts +6 -6
- package/dist/presets/multiTenant.d.ts +1 -1
- package/dist/registry/index.d.ts +2 -2
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/index.js +6 -23
- package/dist/types/index.d.ts +1 -1
- package/dist/{types-0IPhH_NR.d.ts → types-EBZBXrg-.d.ts} +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +8 -14
- package/README.md +0 -900
package/dist/testing/index.js
CHANGED
|
@@ -46935,9 +46935,7 @@ async function loadPlugin(name, logger) {
|
|
|
46935
46935
|
const err = error2;
|
|
46936
46936
|
const isModuleNotFound = err.message.includes("Cannot find module") || err.message.includes("Cannot find package") || err.message.includes("MODULE_NOT_FOUND") || err.message.includes("Could not resolve");
|
|
46937
46937
|
if (isModuleNotFound && OPTIONAL_PLUGINS.has(name)) {
|
|
46938
|
-
logger?.warn(
|
|
46939
|
-
`ℹ️ Optional plugin '${name}' skipped (${packageName} not installed)`
|
|
46940
|
-
);
|
|
46938
|
+
logger?.warn(`ℹ️ Optional plugin '${name}' skipped (${packageName} not installed)`);
|
|
46941
46939
|
return null;
|
|
46942
46940
|
}
|
|
46943
46941
|
if (isModuleNotFound) {
|
|
@@ -46976,10 +46974,7 @@ async function createApp(options2) {
|
|
|
46976
46974
|
});
|
|
46977
46975
|
if (config.helmet !== false) {
|
|
46978
46976
|
const helmet = await loadPlugin("helmet");
|
|
46979
|
-
await fastify.register(
|
|
46980
|
-
helmet,
|
|
46981
|
-
config.helmet ?? {}
|
|
46982
|
-
);
|
|
46977
|
+
await fastify.register(helmet, config.helmet ?? {});
|
|
46983
46978
|
fastify.log.info("✅ Helmet (security headers) enabled");
|
|
46984
46979
|
} else {
|
|
46985
46980
|
fastify.log.warn("⚠️ Helmet disabled - security headers not applied");
|
|
@@ -46999,20 +46994,14 @@ async function createApp(options2) {
|
|
|
46999
46994
|
}
|
|
47000
46995
|
if (config.rateLimit !== false) {
|
|
47001
46996
|
const rateLimit = await loadPlugin("rateLimit");
|
|
47002
|
-
await fastify.register(
|
|
47003
|
-
rateLimit,
|
|
47004
|
-
config.rateLimit ?? { max: 100, timeWindow: "1 minute" }
|
|
47005
|
-
);
|
|
46997
|
+
await fastify.register(rateLimit, config.rateLimit ?? { max: 100, timeWindow: "1 minute" });
|
|
47006
46998
|
fastify.log.info("✅ Rate limiting enabled");
|
|
47007
46999
|
} else {
|
|
47008
47000
|
fastify.log.warn("⚠️ Rate limiting disabled");
|
|
47009
47001
|
}
|
|
47010
47002
|
if (config.underPressure !== false) {
|
|
47011
47003
|
const underPressure = await loadPlugin("underPressure");
|
|
47012
|
-
await fastify.register(
|
|
47013
|
-
underPressure,
|
|
47014
|
-
config.underPressure ?? { exposeStatusRoute: true }
|
|
47015
|
-
);
|
|
47004
|
+
await fastify.register(underPressure, config.underPressure ?? { exposeStatusRoute: true });
|
|
47016
47005
|
fastify.log.info("✅ Health monitoring (under-pressure) enabled");
|
|
47017
47006
|
} else {
|
|
47018
47007
|
fastify.log.info("ℹ️ Health monitoring disabled");
|
|
@@ -47032,10 +47021,7 @@ async function createApp(options2) {
|
|
|
47032
47021
|
files: 10
|
|
47033
47022
|
}
|
|
47034
47023
|
};
|
|
47035
|
-
await fastify.register(multipart, {
|
|
47036
|
-
...multipartDefaults,
|
|
47037
|
-
...config.multipart
|
|
47038
|
-
});
|
|
47024
|
+
await fastify.register(multipart, { ...multipartDefaults, ...config.multipart });
|
|
47039
47025
|
fastify.log.info("✅ Multipart (file uploads) enabled");
|
|
47040
47026
|
}
|
|
47041
47027
|
}
|
|
@@ -47048,10 +47034,7 @@ async function createApp(options2) {
|
|
|
47048
47034
|
encoding: "utf8",
|
|
47049
47035
|
runFirst: true
|
|
47050
47036
|
};
|
|
47051
|
-
await fastify.register(rawBody, {
|
|
47052
|
-
...rawBodyDefaults,
|
|
47053
|
-
...config.rawBody
|
|
47054
|
-
});
|
|
47037
|
+
await fastify.register(rawBody, { ...rawBodyDefaults, ...config.rawBody });
|
|
47055
47038
|
fastify.log.info("✅ Raw body parsing enabled");
|
|
47056
47039
|
}
|
|
47057
47040
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { K as AdditionalRoute, d as AnyRecord,
|
|
1
|
+
export { K as AdditionalRoute, d as AnyRecord, s as ApiResponse, ak as ArcDecorator, A as AuthHelpers, a as AuthPluginOptions, ar as Authenticator, aq as AuthenticatorContext, au as BaseControllerOptions, a4 as ConfigError, ax as ControllerHandler, t as ControllerLike, h as ControllerQueryOptions, B as CrudController, y as CrudRepository, C as CrudRouteKey, _ as CrudRouterOptions, G as CrudSchemas, N as EventDefinition, al as EventsDecorator, ay as FastifyHandler, u as FastifyRequestExtras, v as FastifyWithAuth, w as FastifyWithDecorators, E as FieldRule, a9 as GracefulShutdownOptions, a7 as HealthCheck, a8 as HealthOptions, e as IController, j as IControllerResponse, g as IRequestContext, aw as InferDoc, $ as InferDocType, a0 as InferResourceDoc, Y as IntrospectionData, I as IntrospectionPluginOptions, J as JWTPayload, ap as JwtContext, M as MiddlewareConfig, ao as MiddlewareHandler, ah as ObjectId, af as OpenApiSchemas, Z as OrgScopeOptions, O as OwnershipCheck, k as PaginatedResult, av as PaginationParams, ae as ParsedQuery, L as PresetFunction, at as PresetHook, P as PresetResult, x as QueryOptions, Q as QueryParserInterface, W as RegistryEntry, X as RegistryStats, i as RequestContext, aa as RequestIdOptions, R as RequestWithExtras, l as ResourceConfig, an as ResourceHooks, T as ResourceMetadata, am as ResourcePermissions, z as RouteHandler, f as RouteSchemaOptions, S as ServiceContext, as as TokenPair, a2 as TypedController, a3 as TypedRepository, a1 as TypedResourceConfig, ai as UserLike, U as UserOrganization, a6 as ValidateOptions, a5 as ValidationResult, aj as getUserId } from '../index-WBEvhmWM.js';
|
|
2
2
|
export { RouteHandlerMethod } from 'fastify';
|
|
3
3
|
export { Document, Model } from 'mongoose';
|
|
4
4
|
export { P as PermissionCheck, a as PermissionContext, b as PermissionResult, U as UserBase } from '../types-B99TBmFV.js';
|
|
@@ -2,7 +2,7 @@ import { FastifyServerOptions } from 'fastify';
|
|
|
2
2
|
import { FastifyCorsOptions } from '@fastify/cors';
|
|
3
3
|
import { FastifyHelmetOptions } from '@fastify/helmet';
|
|
4
4
|
import { RateLimitOptions } from '@fastify/rate-limit';
|
|
5
|
-
import { a as AuthPluginOptions } from './index-
|
|
5
|
+
import { a as AuthPluginOptions } from './index-WBEvhmWM.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Types for createApp factory
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { A as ArcError, C as ConflictError, E as ErrorDetails, F as ForbiddenError, N as NotFoundError, a as OrgAccessDeniedError, O as OrgRequiredError, R as RateLimitError, S as ServiceUnavailableError, U as UnauthorizedError, V as ValidationError, c as createError, i as isArcError } from '../errors-8WIxGS_6.js';
|
|
2
|
-
import { d as AnyRecord,
|
|
2
|
+
import { d as AnyRecord, Q as QueryParserInterface, ae as ParsedQuery } from '../index-WBEvhmWM.js';
|
|
3
3
|
import 'mongoose';
|
|
4
4
|
import 'fastify';
|
|
5
5
|
import '../types-B99TBmFV.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classytic/arc",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Resource-oriented backend framework for Fastify + MongoDB",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -120,15 +120,15 @@
|
|
|
120
120
|
},
|
|
121
121
|
"peerDependencies": {
|
|
122
122
|
"@classytic/mongokit": "^3.0.0",
|
|
123
|
+
"fastify": "^5.0.0",
|
|
124
|
+
"mongoose": "^8.0.0 || ^9.0.0",
|
|
123
125
|
"@fastify/cors": "^11.0.0",
|
|
124
126
|
"@fastify/helmet": "^13.0.0",
|
|
125
|
-
"@fastify/multipart": "^9.0.0",
|
|
126
127
|
"@fastify/rate-limit": "^10.0.0",
|
|
127
128
|
"@fastify/sensible": "^6.0.0",
|
|
128
129
|
"@fastify/under-pressure": "^9.0.0",
|
|
129
|
-
"fastify": "^
|
|
130
|
+
"@fastify/multipart": "^9.0.0",
|
|
130
131
|
"fastify-raw-body": "^5.0.0",
|
|
131
|
-
"mongoose": "^8.0.0 || ^9.0.0",
|
|
132
132
|
"pino-pretty": "^13.0.0"
|
|
133
133
|
},
|
|
134
134
|
"peerDependenciesMeta": {
|
|
@@ -189,18 +189,12 @@
|
|
|
189
189
|
},
|
|
190
190
|
"devDependencies": {
|
|
191
191
|
"@classytic/mongokit": "^3.1.0",
|
|
192
|
-
"@fastify/cors": "^11.2.0",
|
|
193
|
-
"@fastify/helmet": "^13.0.2",
|
|
194
192
|
"@fastify/jwt": "^9.0.0",
|
|
195
|
-
"@fastify/multipart": "^9.
|
|
196
|
-
"@
|
|
197
|
-
"@fastify/sensible": "^6.0.4",
|
|
198
|
-
"@fastify/under-pressure": "^9.0.3",
|
|
199
|
-
"@types/jsonwebtoken": "^9.0.10",
|
|
193
|
+
"@fastify/multipart": "^9.0.0",
|
|
194
|
+
"@types/jsonwebtoken": "^9.0.0",
|
|
200
195
|
"@types/node": "^22.10.0",
|
|
201
|
-
"fastify": "^5.7.1",
|
|
202
196
|
"fastify-raw-body": "^5.0.0",
|
|
203
|
-
"jsonwebtoken": "^9.0.
|
|
197
|
+
"jsonwebtoken": "^9.0.0",
|
|
204
198
|
"mongodb-memory-server": "^11.0.1",
|
|
205
199
|
"tsup": "^8.3.5",
|
|
206
200
|
"typescript": "^5.7.2",
|
|
@@ -224,4 +218,4 @@
|
|
|
224
218
|
"type": "git",
|
|
225
219
|
"url": "https://github.com/classytic/arc.git"
|
|
226
220
|
}
|
|
227
|
-
}
|
|
221
|
+
}
|