nextrush 2.0.1 → 3.0.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/LICENSE +1 -1
- package/README.md +144 -1265
- package/dist/class.d.ts +3 -0
- package/dist/class.js +60 -0
- package/dist/class.js.map +1 -0
- package/dist/index.d.ts +56 -3011
- package/dist/index.js +58 -9046
- package/dist/index.js.map +1 -1
- package/package.json +68 -101
- package/dist/index.d.mts +0 -3044
- package/dist/index.mjs +0 -9012
- package/dist/index.mjs.map +0 -1
package/dist/class.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { AutoInjectable, ClassProvider, Config, ConfigOptions, ContainerInterface, FactoryProvider, Injectable, Optional, Provider, Repository, Scope, Service, ServiceOptions, Token, ValueProvider, container, createContainer, delay, inject } from '@nextrush/di';
|
|
2
|
+
export { All, Body, BodyOptions, CanActivate, Controller, ControllerMetadata, ControllerOptions, Ctx, CustomParamExtractor, Delete, Get, GuardContext, GuardFn, Head, Header, HeaderOptions, Options, Param, ParamMetadata, ParamOptions, ParamSource, Patch, Post, Put, Query, QueryOptions, Redirect, Req, Res, RouteMetadata, RouteOptions, SetHeader, TransformFn, UseGuard, createCustomParamDecorator } from '@nextrush/decorators';
|
|
3
|
+
export { ControllersPluginOptions, controllersPlugin } from '@nextrush/controllers';
|
package/dist/class.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// src/class.ts
|
|
2
|
+
import "reflect-metadata";
|
|
3
|
+
import { AutoInjectable, Config, container, createContainer, delay, inject, Injectable, Optional, Repository, Service } from "@nextrush/di";
|
|
4
|
+
import {
|
|
5
|
+
All,
|
|
6
|
+
Body,
|
|
7
|
+
Controller,
|
|
8
|
+
createCustomParamDecorator,
|
|
9
|
+
Ctx,
|
|
10
|
+
Delete,
|
|
11
|
+
Get,
|
|
12
|
+
Head,
|
|
13
|
+
Header,
|
|
14
|
+
Options,
|
|
15
|
+
Param,
|
|
16
|
+
Patch,
|
|
17
|
+
Post,
|
|
18
|
+
Put,
|
|
19
|
+
Query,
|
|
20
|
+
Redirect,
|
|
21
|
+
Req,
|
|
22
|
+
Res,
|
|
23
|
+
SetHeader,
|
|
24
|
+
UseGuard
|
|
25
|
+
} from "@nextrush/decorators";
|
|
26
|
+
import { controllersPlugin } from "@nextrush/controllers";
|
|
27
|
+
export {
|
|
28
|
+
All,
|
|
29
|
+
AutoInjectable,
|
|
30
|
+
Body,
|
|
31
|
+
Config,
|
|
32
|
+
Controller,
|
|
33
|
+
Ctx,
|
|
34
|
+
Delete,
|
|
35
|
+
Get,
|
|
36
|
+
Head,
|
|
37
|
+
Header,
|
|
38
|
+
Injectable,
|
|
39
|
+
Optional,
|
|
40
|
+
Options,
|
|
41
|
+
Param,
|
|
42
|
+
Patch,
|
|
43
|
+
Post,
|
|
44
|
+
Put,
|
|
45
|
+
Query,
|
|
46
|
+
Redirect,
|
|
47
|
+
Repository,
|
|
48
|
+
Req,
|
|
49
|
+
Res,
|
|
50
|
+
Service,
|
|
51
|
+
SetHeader,
|
|
52
|
+
UseGuard,
|
|
53
|
+
container,
|
|
54
|
+
controllersPlugin,
|
|
55
|
+
createContainer,
|
|
56
|
+
createCustomParamDecorator,
|
|
57
|
+
delay,
|
|
58
|
+
inject
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/class.ts"],"sourcesContent":["/**\n * NextRush Class-Based API — Decorators, DI, and Controllers\n *\n * Import from `nextrush/class` when using the class-based paradigm.\n * This entry point auto-loads `reflect-metadata` and re-exports all\n * DI, decorator, and controller APIs in a single import.\n *\n * Functional users who only need `createApp` / `createRouter` should\n * import from `nextrush` (the default entry) — no reflect-metadata overhead.\n *\n * @packageDocumentation\n * @module nextrush/class\n *\n * @example\n * ```typescript\n * import { createApp, listen } from 'nextrush';\n * import { Controller, Get, Service, controllersPlugin } from 'nextrush/class';\n *\n * @Service()\n * class UserService {\n * findAll() { return [{ id: 1, name: 'Alice' }]; }\n * }\n *\n * @Controller('/users')\n * class UserController {\n * constructor(private users: UserService) {}\n *\n * @Get()\n * findAll() { return this.users.findAll(); }\n * }\n *\n * const app = createApp();\n * app.plugin(controllersPlugin({ root: './src' }));\n * listen(app, 3000);\n * ```\n */\n\n// Side-effect: ensure reflect-metadata polyfill is loaded for DI/decorators.\n// This runs once when 'nextrush/class' is imported — no manual import needed.\nimport 'reflect-metadata';\n\n// ============================================\n// DI: Dependency Injection Container\n// ============================================\nexport {\n AutoInjectable,\n Config,\n container,\n createContainer,\n delay,\n inject,\n Injectable,\n Optional,\n Repository,\n Service,\n} from '@nextrush/di';\nexport type {\n ClassProvider,\n ConfigOptions,\n ContainerInterface,\n FactoryProvider,\n Provider,\n Scope,\n ServiceOptions,\n Token,\n ValueProvider,\n} from '@nextrush/di';\n\n// ============================================\n// DECORATORS: Controller, Route & Parameter\n// ============================================\nexport {\n // Route decorators\n All,\n // Parameter decorators\n Body,\n // Class decorators\n Controller,\n // Custom param decorator factory\n createCustomParamDecorator,\n Ctx,\n Delete,\n Get,\n Head,\n Header,\n Options,\n Param,\n Patch,\n Post,\n Put,\n Query,\n // Response decorators\n Redirect,\n Req,\n Res,\n SetHeader,\n // Guard decorators\n UseGuard,\n} from '@nextrush/decorators';\nexport type {\n BodyOptions,\n CanActivate,\n ControllerMetadata,\n ControllerOptions,\n CustomParamExtractor,\n GuardContext,\n GuardFn,\n HeaderOptions,\n ParamMetadata,\n ParamOptions,\n ParamSource,\n QueryOptions,\n RouteMetadata,\n RouteOptions,\n TransformFn,\n} from '@nextrush/decorators';\n\n// ============================================\n// CONTROLLERS: Auto-discovery Plugin\n// ============================================\nexport { controllersPlugin } from '@nextrush/controllers';\nexport type { ControllersPluginOptions } from '@nextrush/controllers';\n"],"mappings":";AAuCA,OAAO;AAKP,SACEA,gBACAC,QACAC,WACAC,iBACAC,OACAC,QACAC,YACAC,UACAC,YACAC,eACK;AAgBP;EAEEC;EAEAC;EAEAC;EAEAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EAEAC;EACAC;EACAC;EACAC;EAEAC;OACK;AAsBP,SAASC,yBAAyB;","names":["AutoInjectable","Config","container","createContainer","delay","inject","Injectable","Optional","Repository","Service","All","Body","Controller","createCustomParamDecorator","Ctx","Delete","Get","Head","Header","Options","Param","Patch","Post","Put","Query","Redirect","Req","Res","SetHeader","UseGuard","controllersPlugin"]}
|