raiton 3.1.1 → 5.4.0-beta.2
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/CHANGELOG.md +37 -0
- package/README.md +38 -3
- package/build/bin/index.mjs +822 -524
- package/examples/user-controller.example.ts +53 -0
- package/package.json +8 -10
- package/scripts/update-version.ts +1 -1
- package/source/bin/bootstrapper.ts +1 -1
- package/source/bin/cli-tools.ts +2 -0
- package/source/commands/build.command.ts +2 -1
- package/source/commands/develop.command.ts +2 -1
- package/source/commands/start.command.ts +15 -10
- package/source/core/application.ts +42 -33
- package/source/core/artifacts/artifact.ts +10 -0
- package/source/core/artifacts/index.ts +1 -0
- package/source/core/artifacts/runner.ts +3 -0
- package/source/core/builder.ts +44 -15
- package/source/core/config/define.ts +1 -1
- package/source/core/controller/builder.ts +1 -1
- package/source/core/controller/metadata.ts +1 -1
- package/source/core/hooks.ts +0 -8
- package/source/core/index.ts +15 -14
- package/source/core/injection/injection.ts +9 -6
- package/source/core/middleware/compose.ts +1 -1
- package/source/core/middleware/pipeline.ts +2 -8
- package/source/core/plugins/scope.ts +18 -6
- package/source/core/router/handler.ts +26 -80
- package/source/core/router/handler.utils.ts +135 -0
- package/source/core/router/matcher.ts +13 -9
- package/source/core/router/router.ts +6 -2
- package/source/core/socket/index.ts +1 -0
- package/source/core/socket/metadata.ts +13 -0
- package/source/core/thread.ts +23 -20
- package/source/{sdk → framework}/artifacts.ts +8 -1
- package/source/framework/constants/decorators.constant.ts +17 -0
- package/source/framework/decorators/api-response.decorator.ts +127 -0
- package/source/framework/decorators/api.decorator.ts +185 -0
- package/source/framework/decorators/index.ts +9 -0
- package/source/{sdk/decorators/parametrable.ts → framework/decorators/parametrable.decorator.ts} +1 -1
- package/source/framework/decorators/socket.decorator.ts +41 -0
- package/source/{sdk → framework}/encryption.ts +2 -1
- package/source/{sdk → framework}/enums/encrypted.enum.ts +2 -2
- package/source/{sdk → framework}/enums/http-parameters.enum.ts +1 -0
- package/source/{sdk → framework}/enums/runtime.enum.ts +2 -2
- package/source/{sdk → framework}/env.ts +2 -2
- package/source/{sdk → framework}/exceptions/http-exception.ts +1 -1
- package/source/{sdk → framework}/index.ts +3 -2
- package/source/{sdk → framework}/plugins/body-parser.plugin.ts +28 -11
- package/source/framework/plugins/index.ts +3 -0
- package/source/framework/plugins/openapi.plugin.ts +98 -0
- package/source/framework/plugins/security/cors.ts +78 -0
- package/source/{sdk → framework}/responses/helpers.ts +4 -3
- package/source/{sdk → framework}/responses/http-throwable.ts +2 -2
- package/source/{sdk → framework}/responses/http.ts +3 -3
- package/source/{sdk → framework}/runtime/bun/server.ts +6 -2
- package/source/framework/runtime/deno/server.ts +104 -0
- package/source/{sdk → framework}/runtime/index.ts +18 -13
- package/source/framework/runtime/node/reply.ts +37 -0
- package/source/framework/runtime/node/request.ts +47 -0
- package/source/framework/runtime/node/server.ts +32 -0
- package/source/framework/runtime/web/server.ts +73 -0
- package/source/{sdk → framework}/utilities/artifact.util.ts +3 -0
- package/source/framework/utilities/cookie.util.ts +11 -0
- package/source/{sdk → framework}/utilities/index.ts +3 -1
- package/source/framework/utilities/openapi.utils.ts +497 -0
- package/source/framework/view-model.ts +4 -0
- package/source/types/access-guards.ts +4 -0
- package/source/types/application.ts +1 -1
- package/source/types/artifact.ts +42 -1
- package/source/types/builder.ts +6 -1
- package/source/types/controller.ts +1 -1
- package/source/types/http-responses.ts +8 -0
- package/source/types/index.ts +1 -0
- package/source/types/responses.ts +1 -1
- package/source/types/router.ts +1 -1
- package/source/types/runtime.ts +5 -3
- package/source/types/scheme.ts +153 -0
- package/source/types/socket.ts +15 -0
- package/source/types/thread.ts +4 -2
- package/source/sdk/constants/decorators.constant.ts +0 -8
- package/source/sdk/decorators/index.ts +0 -6
- package/source/sdk/plugins/index.ts +0 -2
- package/source/sdk/plugins/security/cors.ts +0 -44
- package/source/sdk/runtime/deno/server.ts +0 -53
- package/source/sdk/runtime/node/reply.ts +0 -0
- package/source/sdk/runtime/node/request.ts +0 -0
- package/source/sdk/runtime/node/server.ts +0 -60
- package/source/sdk/runtime/web/server.ts +0 -57
- /package/source/{sdk → framework}/constants/index.ts +0 -0
- /package/source/{sdk → framework}/constants/microservices.constant.ts +0 -0
- /package/source/{sdk → framework}/controllers.ts +0 -0
- /package/source/{sdk → framework}/data-transfer-object.ts +0 -0
- /package/source/{sdk → framework}/decorators/access-guard.decorator.ts +0 -0
- /package/source/{sdk → framework}/decorators/controllable.decorator.ts +0 -0
- /package/source/{sdk → framework}/decorators/guard.decorator.ts +0 -0
- /package/source/{sdk → framework}/decorators/injection.decorator.ts +0 -0
- /package/source/{sdk → framework}/decorators/middleware.decorator.ts +0 -0
- /package/source/{sdk → framework}/decorators/routable.decorator.ts +0 -0
- /package/source/{sdk → framework}/enums/event.message.enum.ts +0 -0
- /package/source/{sdk → framework}/enums/http-method.enum.ts +0 -0
- /package/source/{sdk → framework}/enums/http-status.enum.ts +0 -0
- /package/source/{sdk → framework}/enums/index.ts +0 -0
- /package/source/{sdk → framework}/enums/timestamp.enum.ts +0 -0
- /package/source/{sdk → framework}/exceptions/index.ts +0 -0
- /package/source/{sdk → framework}/exceptions/throwable.ts +0 -0
- /package/source/{sdk → framework}/parameter-bag.ts +0 -0
- /package/source/{sdk → framework}/plugins/security/body-limit.ts +0 -0
- /package/source/{sdk → framework}/plugins/security/headers.ts +0 -0
- /package/source/{sdk → framework}/plugins/security/index.ts +0 -0
- /package/source/{sdk → framework}/plugins/security/method-guard.ts +0 -0
- /package/source/{sdk → framework}/plugins/security/rate-limit.ts +0 -0
- /package/source/{sdk → framework}/repositories.ts +0 -0
- /package/source/{sdk → framework}/responses/error.ts +0 -0
- /package/source/{sdk → framework}/responses/index.ts +0 -0
- /package/source/{sdk → framework}/services.ts +0 -0
- /package/source/{sdk → framework}/utilities/alias-path.util.ts +0 -0
- /package/source/{sdk → framework}/utilities/callable.util.ts +0 -0
- /package/source/{sdk → framework}/utilities/json.util.ts +0 -0
- /package/source/{sdk → framework}/utilities/path.util.ts +0 -0
- /package/source/{sdk → framework}/utilities/url.ts +0 -0
- /package/source/{sdk → framework}/utilities/utilities.util.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
1
|
+
# [1.0.0-alpha.4](https://github.com/protorians/raiton/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2026-02-17)
|
|
2
|
+
|
|
3
|
+
## Breaking Changes
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* remove emojis from README section titles for consistency ([8d604ee](https://github.com/protorians/raiton/commit/8d604eec0825bfdf172988ee9fe662076b7e46be))
|
|
7
|
+
* remove unused Fastify dependencies and deprecate parameter handling utilities ([282db2c](https://github.com/protorians/raiton/commit/282db2cb4baeb52b816e1444f9d618570a073443))
|
|
8
|
+
* update `.releaserc.json` to refine branch configurations and format `assets` array ([0f803c0](https://github.com/protorians/raiton/commit/0f803c08d03549bd28ef9e61fe9c6c121d2f781d))
|
|
9
|
+
* update keywords in `package.json` and reset version to `0.0.0` ([44f7c85](https://github.com/protorians/raiton/commit/44f7c858330fc5455260d66d05b78a5a33d388f8))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* add `NODE_AUTH_TOKEN` to `publish.yml` for semantic-release environment setup ([44a561b](https://github.com/protorians/raiton/commit/44a561b60bc3f35ae59bb404c343ef56baab4d26))
|
|
15
|
+
* enable provenance support in `package.json` and `.releaserc.json` ([b5db171](https://github.com/protorians/raiton/commit/b5db171a84150aefc2978b37c5d3544b5769b160))
|
|
16
|
+
* make package public and fix `publish.yml` token variable ([0293ee6](https://github.com/protorians/raiton/commit/0293ee629e444be0d90823896ea57212743d357d))
|
|
17
|
+
* remove redundant comments from `publish.yml` workflow ([37ddce9](https://github.com/protorians/raiton/commit/37ddce94356dba8f2c2d5e87af7fc3ade4ca3cf5))
|
|
18
|
+
|
|
19
|
+
# [1.0.0-alpha.3](https://github.com/protorians/raiton/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2026-02-17)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* extend `ChildProcess` types to include `ChildProcessWithoutNullStreams` and adjust `Logger` for optional child process PID ([e1e7e17](https://github.com/protorians/raiton/commit/e1e7e17ddd921da5f09cf3240f06a64fddd274f5))
|
|
25
|
+
* refactor runtime detection in `CliTools` and streamline imports in bin files ([b431aa3](https://github.com/protorians/raiton/commit/b431aa31d86e2ef480fbafa8a2cfbb5ae6a4c640))
|
|
26
|
+
* remove unused HMR and artifact modules, refactor thread lifecycle, and optimize artifact initialization in application core ([af88e34](https://github.com/protorians/raiton/commit/af88e341ba8c695b3a9817d450845e25bb004b9e))
|
|
27
|
+
* remove unused SDK modules, rework artifacts handling, and enhance parametrable decorators ([ddc6d35](https://github.com/protorians/raiton/commit/ddc6d35cd070e25f0da19185e776feead0843ad0))
|
|
28
|
+
* remove unused types, streamline imports, and enhance type definitions with Lifecycle interfaces ([5ef2e46](https://github.com/protorians/raiton/commit/5ef2e46ecec191c1e51d79c997ebe2f8244dc7fc))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
|
|
33
|
+
* add `class-validator` dependency and update README to remove Deno beta references ([a616086](https://github.com/protorians/raiton/commit/a616086652d437d0763d7c8313150c56ee4d11d9))
|
|
34
|
+
* add basic `deno.json` with imports and tasks configuration ([e31b024](https://github.com/protorians/raiton/commit/e31b02414bc4378a7125678fe88268f57367c646))
|
|
35
|
+
* add global runtime detection constants for Bun and Deno in `constants.ts` ([c63ac8e](https://github.com/protorians/raiton/commit/c63ac8e36089e58856c180706c89b51390ae850f))
|
|
36
|
+
* introduce HTTP response handling modules with enums, exceptions, and utilities for streamlined error management and parameterized responses ([e1c5fa3](https://github.com/protorians/raiton/commit/e1c5fa3cc00fd7e7ce61ac44243483c2127f1dfe))
|
|
37
|
+
|
|
1
38
|
# [1.0.0-alpha.2](https://github.com/protorians/raiton/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2026-02-16)
|
|
2
39
|
|
|
3
40
|
|
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ npm install raiton reflect-metadata
|
|
|
30
30
|
### 1. Créez un contrôleur (`source/controllers/hello.controller.ts`)
|
|
31
31
|
|
|
32
32
|
```typescript
|
|
33
|
-
import { Controllable, Get, Param } from "raiton/
|
|
33
|
+
import { Controllable, Get, Param } from "raiton/framework";
|
|
34
34
|
|
|
35
35
|
@Controllable('/hello')
|
|
36
36
|
export class HelloController {
|
|
@@ -82,7 +82,7 @@ bun raiton build
|
|
|
82
82
|
bun raiton start
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
##
|
|
85
|
+
## Runtimes supportés
|
|
86
86
|
|
|
87
87
|
Raiton détecte automatiquement l'environnement d'exécution et adapte son serveur :
|
|
88
88
|
|
|
@@ -90,7 +90,42 @@ Raiton détecte automatiquement l'environnement d'exécution et adapte son serve
|
|
|
90
90
|
- **Node.js** : Adaptateur pour serveurs HTTP Node.
|
|
91
91
|
- **Web** : Compatible avec les environnements basés sur les standards Web (Fetch API).
|
|
92
92
|
|
|
93
|
-
##
|
|
93
|
+
## Documentation API
|
|
94
|
+
|
|
95
|
+
Example
|
|
96
|
+
```typescript
|
|
97
|
+
import { Controllable, Get, ApiOkResponse, ApiResponse } from '@protorians/framework';
|
|
98
|
+
|
|
99
|
+
@Controllable('/users')
|
|
100
|
+
export class UserController {
|
|
101
|
+
@Get()
|
|
102
|
+
@ApiOkResponse({
|
|
103
|
+
description: 'Returns a list of users',
|
|
104
|
+
type: Array,
|
|
105
|
+
isArray: true
|
|
106
|
+
})
|
|
107
|
+
async getUsers() {
|
|
108
|
+
return [{ id: 1, name: 'John Doe' }, { id: 2, name: 'Jane Smith' }];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@Get('/:id')
|
|
112
|
+
@ApiResponse({
|
|
113
|
+
status: 200,
|
|
114
|
+
description: 'Returns the user if found',
|
|
115
|
+
type: Object
|
|
116
|
+
})
|
|
117
|
+
@ApiResponse({
|
|
118
|
+
status: 404,
|
|
119
|
+
description: 'User not found'
|
|
120
|
+
})
|
|
121
|
+
async getUserById() {
|
|
122
|
+
// ... implementation
|
|
123
|
+
return { id: 1, name: 'John Doe' };
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Licence
|
|
94
129
|
|
|
95
130
|
Ce projet est sous licence MIT. Voir le fichier [LICENSE](LICENSE) pour plus de détails.
|
|
96
131
|
|