raiton 1.1.1

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.
Files changed (311) hide show
  1. package/.releaserc.json +39 -0
  2. package/CHANGELOG.md +90 -0
  3. package/README.md +2 -0
  4. package/build/bin/bootstrapper.d.ts +5 -0
  5. package/build/bin/bootstrapper.mjs +46 -0
  6. package/build/bin/cli.d.ts +5 -0
  7. package/build/bin/cli.mjs +6 -0
  8. package/build/bin/index.d.ts +1 -0
  9. package/build/bin/index.mjs +50 -0
  10. package/build/chunk-3PWMRP6G.mjs +16 -0
  11. package/build/chunk-4OWCGDUD.mjs +0 -0
  12. package/build/chunk-52JR26TI.mjs +29 -0
  13. package/build/chunk-5LNOA4SK.mjs +16 -0
  14. package/build/chunk-AUGL35CF.mjs +24 -0
  15. package/build/chunk-BYYJRCB4.mjs +10 -0
  16. package/build/chunk-DIWD7ZCJ.mjs +0 -0
  17. package/build/chunk-FFRJ4AUA.mjs +16 -0
  18. package/build/chunk-GPJSLV3Q.mjs +50 -0
  19. package/build/chunk-HVFHDVAH.mjs +20 -0
  20. package/build/chunk-IOCHNQMF.mjs +13 -0
  21. package/build/chunk-JATYBWHL.mjs +36 -0
  22. package/build/chunk-JWNBO7XV.mjs +53 -0
  23. package/build/chunk-K4IQQ2KF.mjs +55 -0
  24. package/build/chunk-K4KLOLSO.mjs +645 -0
  25. package/build/chunk-M2RZZJQR.mjs +27 -0
  26. package/build/chunk-MLFGBJDV.mjs +12 -0
  27. package/build/chunk-NB62GSFI.mjs +27 -0
  28. package/build/chunk-O7R3NJQN.mjs +19 -0
  29. package/build/chunk-P2YCCBFR.mjs +14 -0
  30. package/build/chunk-P3IRIFPT.mjs +53 -0
  31. package/build/chunk-QFSXFOEN.mjs +56 -0
  32. package/build/chunk-QHCQ4AUA.mjs +14 -0
  33. package/build/chunk-QI7OFSXB.mjs +37 -0
  34. package/build/chunk-RVH2YBNU.mjs +111 -0
  35. package/build/chunk-RXG7754R.mjs +25 -0
  36. package/build/chunk-S3ONGVNZ.mjs +11 -0
  37. package/build/chunk-SRR4467I.mjs +29 -0
  38. package/build/chunk-T6L55AUG.mjs +32 -0
  39. package/build/chunk-TOJFTPAY.mjs +83 -0
  40. package/build/chunk-UAPCBU3J.mjs +12 -0
  41. package/build/chunk-UCHBN3DV.mjs +52 -0
  42. package/build/chunk-UWM46HLZ.mjs +18 -0
  43. package/build/chunk-UZFCGVHP.mjs +8 -0
  44. package/build/chunk-VQINCGLQ.mjs +59 -0
  45. package/build/chunk-VRL4S7UF.mjs +74 -0
  46. package/build/chunk-WAWFDMOH.mjs +72 -0
  47. package/build/chunk-X3JFRRRQ.mjs +45 -0
  48. package/build/chunk-XFBLELHI.mjs +34 -0
  49. package/build/chunk-XIGE72LC.mjs +34 -0
  50. package/build/chunk-XW7EPAD7.mjs +0 -0
  51. package/build/chunk-YGIZFKLJ.mjs +20 -0
  52. package/build/chunk-YRVIAORI.mjs +8 -0
  53. package/build/chunk-YXU5W2CB.mjs +12 -0
  54. package/build/commands/artifact.command.d.ts +14 -0
  55. package/build/commands/artifact.command.mjs +59 -0
  56. package/build/commands/build.command.d.ts +14 -0
  57. package/build/commands/build.command.mjs +65 -0
  58. package/build/commands/develop.command.d.ts +13 -0
  59. package/build/commands/develop.command.mjs +75 -0
  60. package/build/commands/grafts.command.d.ts +12 -0
  61. package/build/commands/grafts.command.mjs +58 -0
  62. package/build/commands/start.command.d.ts +12 -0
  63. package/build/commands/start.command.mjs +64 -0
  64. package/build/core/application.d.ts +27 -0
  65. package/build/core/application.mjs +124 -0
  66. package/build/core/artifact.d.ts +19 -0
  67. package/build/core/artifact.mjs +133 -0
  68. package/build/core/builder.d.ts +35 -0
  69. package/build/core/builder.mjs +45 -0
  70. package/build/core/bytes.util.d.ts +6 -0
  71. package/build/core/bytes.util.mjs +8 -0
  72. package/build/core/command.d.ts +15 -0
  73. package/build/core/command.mjs +6 -0
  74. package/build/core/commands.d.ts +13 -0
  75. package/build/core/commands.mjs +7 -0
  76. package/build/core/config.d.ts +10 -0
  77. package/build/core/config.mjs +7 -0
  78. package/build/core/context.d.ts +15 -0
  79. package/build/core/context.mjs +6 -0
  80. package/build/core/controller/builder.d.ts +10 -0
  81. package/build/core/controller/builder.mjs +45 -0
  82. package/build/core/controller/compiler.d.ts +6 -0
  83. package/build/core/controller/compiler.mjs +45 -0
  84. package/build/core/controller/index.d.ts +13 -0
  85. package/build/core/controller/index.mjs +50 -0
  86. package/build/core/controller/metadata.d.ts +10 -0
  87. package/build/core/controller/metadata.mjs +6 -0
  88. package/build/core/directories.d.ts +11 -0
  89. package/build/core/directories.mjs +8 -0
  90. package/build/core/hmr.d.ts +22 -0
  91. package/build/core/hmr.mjs +6 -0
  92. package/build/core/hooks.d.ts +12 -0
  93. package/build/core/hooks.mjs +6 -0
  94. package/build/core/index.d.ts +41 -0
  95. package/build/core/index.mjs +100 -0
  96. package/build/core/middleware/compose.d.ts +8 -0
  97. package/build/core/middleware/compose.mjs +6 -0
  98. package/build/core/middleware/index.d.ts +6 -0
  99. package/build/core/middleware/index.mjs +11 -0
  100. package/build/core/middleware/pipeline.d.ts +14 -0
  101. package/build/core/middleware/pipeline.mjs +7 -0
  102. package/build/core/plugins/index.d.ts +14 -0
  103. package/build/core/plugins/index.mjs +48 -0
  104. package/build/core/plugins/plugin.d.ts +17 -0
  105. package/build/core/plugins/plugin.mjs +6 -0
  106. package/build/core/plugins/scope.d.ts +24 -0
  107. package/build/core/plugins/scope.mjs +45 -0
  108. package/build/core/process.util.d.ts +3 -0
  109. package/build/core/process.util.mjs +6 -0
  110. package/build/core/raiton.d.ts +20 -0
  111. package/build/core/raiton.mjs +6 -0
  112. package/build/core/router/handler.d.ts +10 -0
  113. package/build/core/router/handler.mjs +45 -0
  114. package/build/core/router/index.d.ts +12 -0
  115. package/build/core/router/index.mjs +54 -0
  116. package/build/core/router/matcher.d.ts +21 -0
  117. package/build/core/router/matcher.mjs +6 -0
  118. package/build/core/router/route.d.ts +20 -0
  119. package/build/core/router/route.mjs +6 -0
  120. package/build/core/router/router.d.ts +16 -0
  121. package/build/core/router/router.mjs +8 -0
  122. package/build/core/thread.d.ts +30 -0
  123. package/build/core/thread.mjs +45 -0
  124. package/build/env.d.d.ts +2 -0
  125. package/build/env.d.mjs +0 -0
  126. package/build/raiton-1.1.1.tgz +0 -0
  127. package/build/requirements.d.ts +2 -0
  128. package/build/requirements.mjs +19 -0
  129. package/build/sdk/artifacts.d.ts +13 -0
  130. package/build/sdk/artifacts.mjs +45 -0
  131. package/build/sdk/constants/decorators.constant.d.ts +11 -0
  132. package/build/sdk/constants/decorators.constant.mjs +6 -0
  133. package/build/sdk/constants/index.d.ts +2 -0
  134. package/build/sdk/constants/index.mjs +11 -0
  135. package/build/sdk/constants/microservices.constant.d.ts +5 -0
  136. package/build/sdk/constants/microservices.constant.mjs +6 -0
  137. package/build/sdk/controllers.d.ts +4 -0
  138. package/build/sdk/controllers.mjs +6 -0
  139. package/build/sdk/data-transfer-object.d.ts +7 -0
  140. package/build/sdk/data-transfer-object.mjs +7 -0
  141. package/build/sdk/decorators/access-guard.decorator.d.ts +2 -0
  142. package/build/sdk/decorators/access-guard.decorator.mjs +0 -0
  143. package/build/sdk/decorators/controllable.d.ts +3 -0
  144. package/build/sdk/decorators/controllable.mjs +45 -0
  145. package/build/sdk/decorators/controllers.decorator.d.ts +2 -0
  146. package/build/sdk/decorators/controllers.decorator.mjs +0 -0
  147. package/build/sdk/decorators/grafts.decorator.d.ts +2 -0
  148. package/build/sdk/decorators/grafts.decorator.mjs +0 -0
  149. package/build/sdk/decorators/index.d.ts +3 -0
  150. package/build/sdk/decorators/index.mjs +75 -0
  151. package/build/sdk/decorators/parameters.decorator.d.ts +2 -0
  152. package/build/sdk/decorators/parameters.decorator.mjs +0 -0
  153. package/build/sdk/decorators/parametrable.d.ts +9 -0
  154. package/build/sdk/decorators/parametrable.mjs +57 -0
  155. package/build/sdk/decorators/payload.decorator.d.ts +2 -0
  156. package/build/sdk/decorators/payload.decorator.mjs +0 -0
  157. package/build/sdk/decorators/routable.d.ts +10 -0
  158. package/build/sdk/decorators/routable.mjs +59 -0
  159. package/build/sdk/dependency-container.d.ts +19 -0
  160. package/build/sdk/dependency-container.mjs +46 -0
  161. package/build/sdk/encryption.d.ts +27 -0
  162. package/build/sdk/encryption.mjs +141 -0
  163. package/build/sdk/enums/encrypted.enum.d.ts +15 -0
  164. package/build/sdk/enums/encrypted.enum.mjs +6 -0
  165. package/build/sdk/enums/event.message.enum.d.ts +6 -0
  166. package/build/sdk/enums/event.message.enum.mjs +6 -0
  167. package/build/sdk/enums/http-parameters.enum.d.ts +12 -0
  168. package/build/sdk/enums/http-parameters.enum.mjs +6 -0
  169. package/build/sdk/enums/http.enum.d.ts +12 -0
  170. package/build/sdk/enums/http.enum.mjs +6 -0
  171. package/build/sdk/enums/index.d.ts +6 -0
  172. package/build/sdk/enums/index.mjs +27 -0
  173. package/build/sdk/enums/runtime.enum.d.ts +8 -0
  174. package/build/sdk/enums/runtime.enum.mjs +6 -0
  175. package/build/sdk/enums/timestamp.enum.d.ts +8 -0
  176. package/build/sdk/enums/timestamp.enum.mjs +6 -0
  177. package/build/sdk/env.d.ts +6 -0
  178. package/build/sdk/env.mjs +74 -0
  179. package/build/sdk/fastify.d.ts +11 -0
  180. package/build/sdk/fastify.mjs +9 -0
  181. package/build/sdk/grafts.d.ts +15 -0
  182. package/build/sdk/grafts.mjs +71 -0
  183. package/build/sdk/index.d.ts +34 -0
  184. package/build/sdk/index.mjs +126 -0
  185. package/build/sdk/json.d.ts +17 -0
  186. package/build/sdk/json.mjs +87 -0
  187. package/build/sdk/plugins/body-parser.plugin.d.ts +17 -0
  188. package/build/sdk/plugins/body-parser.plugin.mjs +7 -0
  189. package/build/sdk/plugins/index.d.ts +17 -0
  190. package/build/sdk/plugins/index.mjs +48 -0
  191. package/build/sdk/plugins/security/body-limit.d.ts +17 -0
  192. package/build/sdk/plugins/security/body-limit.mjs +45 -0
  193. package/build/sdk/plugins/security/cors.d.ts +22 -0
  194. package/build/sdk/plugins/security/cors.mjs +45 -0
  195. package/build/sdk/plugins/security/headers.d.ts +17 -0
  196. package/build/sdk/plugins/security/headers.mjs +45 -0
  197. package/build/sdk/plugins/security/index.d.ts +25 -0
  198. package/build/sdk/plugins/security/index.mjs +45 -0
  199. package/build/sdk/plugins/security/method-guard.d.ts +17 -0
  200. package/build/sdk/plugins/security/method-guard.mjs +45 -0
  201. package/build/sdk/plugins/security/rate-limit.d.ts +21 -0
  202. package/build/sdk/plugins/security/rate-limit.mjs +45 -0
  203. package/build/sdk/repositories.d.ts +7 -0
  204. package/build/sdk/repositories.mjs +17 -0
  205. package/build/sdk/request.d.ts +4 -0
  206. package/build/sdk/request.mjs +6 -0
  207. package/build/sdk/responses.d.ts +8 -0
  208. package/build/sdk/responses.mjs +20 -0
  209. package/build/sdk/routes.d.ts +7 -0
  210. package/build/sdk/routes.mjs +61 -0
  211. package/build/sdk/runtime/bun/server.d.ts +6 -0
  212. package/build/sdk/runtime/bun/server.mjs +6 -0
  213. package/build/sdk/runtime/deno/server.d.ts +6 -0
  214. package/build/sdk/runtime/deno/server.mjs +6 -0
  215. package/build/sdk/runtime/index.d.ts +15 -0
  216. package/build/sdk/runtime/index.mjs +11 -0
  217. package/build/sdk/runtime/node/reply.d.ts +2 -0
  218. package/build/sdk/runtime/node/reply.mjs +0 -0
  219. package/build/sdk/runtime/node/request.d.ts +2 -0
  220. package/build/sdk/runtime/node/request.mjs +0 -0
  221. package/build/sdk/runtime/node/server.d.ts +6 -0
  222. package/build/sdk/runtime/node/server.mjs +6 -0
  223. package/build/sdk/runtime/web/server.d.ts +6 -0
  224. package/build/sdk/runtime/web/server.mjs +6 -0
  225. package/build/sdk/schemes.d.ts +120 -0
  226. package/build/sdk/schemes.mjs +129 -0
  227. package/build/sdk/services.d.ts +8 -0
  228. package/build/sdk/services.mjs +10 -0
  229. package/build/sdk/throwable.d.ts +78 -0
  230. package/build/sdk/throwable.mjs +14 -0
  231. package/build/sdk/utilities/alias-path.util.d.ts +9 -0
  232. package/build/sdk/utilities/alias-path.util.mjs +6 -0
  233. package/build/sdk/utilities/artifacts.util.d.ts +3 -0
  234. package/build/sdk/utilities/artifacts.util.mjs +45 -0
  235. package/build/sdk/utilities/callable.util.d.ts +3 -0
  236. package/build/sdk/utilities/callable.util.mjs +6 -0
  237. package/build/sdk/utilities/controller.util.d.ts +3 -0
  238. package/build/sdk/utilities/controller.util.mjs +6 -0
  239. package/build/sdk/utilities/index.d.ts +7 -0
  240. package/build/sdk/utilities/index.mjs +62 -0
  241. package/build/sdk/utilities/json.util.d.ts +3 -0
  242. package/build/sdk/utilities/json.util.mjs +6 -0
  243. package/build/sdk/utilities/parameters-arguments.util.d.ts +2 -0
  244. package/build/sdk/utilities/parameters-arguments.util.mjs +0 -0
  245. package/build/sdk/utilities/url.d.ts +3 -0
  246. package/build/sdk/utilities/url.mjs +7 -0
  247. package/build/sdk/utilities/utilities.util.d.ts +6 -0
  248. package/build/sdk/utilities/utilities.util.mjs +8 -0
  249. package/build/types/access-guards.d.ts +6 -0
  250. package/build/types/access-guards.mjs +0 -0
  251. package/build/types/application.d.ts +30 -0
  252. package/build/types/application.mjs +0 -0
  253. package/build/types/artifact.d.ts +21 -0
  254. package/build/types/artifact.mjs +0 -0
  255. package/build/types/builder.d.ts +32 -0
  256. package/build/types/builder.mjs +0 -0
  257. package/build/types/config.d.ts +6 -0
  258. package/build/types/config.mjs +0 -0
  259. package/build/types/controller.d.ts +25 -0
  260. package/build/types/controller.mjs +0 -0
  261. package/build/types/contruct.d.ts +3 -0
  262. package/build/types/contruct.mjs +0 -0
  263. package/build/types/core.d.ts +15 -0
  264. package/build/types/core.mjs +0 -0
  265. package/build/types/data-transfer-object.d.ts +5 -0
  266. package/build/types/data-transfer-object.mjs +0 -0
  267. package/build/types/dependency-container.d.ts +20 -0
  268. package/build/types/dependency-container.mjs +0 -0
  269. package/build/types/directory.d.ts +8 -0
  270. package/build/types/directory.mjs +0 -0
  271. package/build/types/encryption.d.ts +16 -0
  272. package/build/types/encryption.mjs +0 -0
  273. package/build/types/generic.d.ts +4 -0
  274. package/build/types/generic.mjs +0 -0
  275. package/build/types/hmr.d.ts +25 -0
  276. package/build/types/hmr.mjs +0 -0
  277. package/build/types/http-responses.d.ts +10 -0
  278. package/build/types/http-responses.mjs +0 -0
  279. package/build/types/index.d.ts +45 -0
  280. package/build/types/index.mjs +0 -0
  281. package/build/types/middleware.d.ts +12 -0
  282. package/build/types/middleware.mjs +0 -0
  283. package/build/types/parameters.d.ts +19 -0
  284. package/build/types/parameters.mjs +0 -0
  285. package/build/types/parseable.d.ts +5 -0
  286. package/build/types/parseable.mjs +0 -0
  287. package/build/types/payload.d.ts +6 -0
  288. package/build/types/payload.mjs +0 -0
  289. package/build/types/plugin.d.ts +20 -0
  290. package/build/types/plugin.mjs +0 -0
  291. package/build/types/raiton.d.ts +12 -0
  292. package/build/types/raiton.mjs +0 -0
  293. package/build/types/repositories.d.ts +8 -0
  294. package/build/types/repositories.mjs +0 -0
  295. package/build/types/router.d.ts +14 -0
  296. package/build/types/router.mjs +0 -0
  297. package/build/types/runtime.d.ts +37 -0
  298. package/build/types/runtime.mjs +0 -0
  299. package/build/types/scheme.d.ts +128 -0
  300. package/build/types/scheme.mjs +0 -0
  301. package/build/types/server.d.ts +57 -0
  302. package/build/types/server.mjs +0 -0
  303. package/build/types/services.d.ts +8 -0
  304. package/build/types/services.mjs +0 -0
  305. package/build/types/thread.d.ts +24 -0
  306. package/build/types/thread.mjs +0 -0
  307. package/build/types/utilities.d.ts +6 -0
  308. package/build/types/utilities.mjs +0 -0
  309. package/build/types/values.d.ts +4 -0
  310. package/build/types/values.mjs +0 -0
  311. package/package.json +97 -0
@@ -0,0 +1,12 @@
1
+ import { RequestContext } from '../core/context.js';
2
+ import './runtime.js';
3
+ import '../sdk/enums/runtime.enum.js';
4
+
5
+ type Next = () => Promise<void>;
6
+ type MiddlewareStepped = {
7
+ setup: any;
8
+ name: string;
9
+ };
10
+ type Middleware = ((ctx: RequestContext, next: Next) => Promise<any> | void) | MiddlewareStepped;
11
+
12
+ export type { Middleware, MiddlewareStepped, Next };
File without changes
@@ -0,0 +1,19 @@
1
+ import { Parametrable } from '../sdk/enums/http-parameters.enum.js';
2
+ import { FastifyRequest, FastifyReply } from 'fastify';
3
+
4
+ interface RouteParametersMetadataPayload {
5
+ request: FastifyRequest;
6
+ reply: FastifyReply;
7
+ files: AsyncIterableIterator<any> | any[];
8
+ }
9
+ type RouteParametersMetadataCallable = (payload: RouteParametersMetadataPayload) => any[];
10
+ interface RouteParametersMetadataInterface {
11
+ index: number;
12
+ type: Parametrable;
13
+ key: string;
14
+ multiple: boolean;
15
+ optional: boolean;
16
+ callable?: RouteParametersMetadataCallable;
17
+ }
18
+
19
+ export type { RouteParametersMetadataCallable, RouteParametersMetadataInterface, RouteParametersMetadataPayload };
File without changes
@@ -0,0 +1,5 @@
1
+ type IParseableEntry = string | number | boolean | null | undefined | IParseableEntry[] | object;
2
+ type IParseableEntries = Record<string, IParseableEntry>;
3
+ type IParseablePrimitiveEntry<T extends IParseableEntries> = string | T | null;
4
+
5
+ export type { IParseableEntries, IParseableEntry, IParseablePrimitiveEntry };
File without changes
@@ -0,0 +1,6 @@
1
+ import { FastifySchema } from 'fastify/types/schema';
2
+
3
+ interface IPayload extends FastifySchema {
4
+ }
5
+
6
+ export type { IPayload };
File without changes
@@ -0,0 +1,20 @@
1
+ import { PluginScope } from '../core/plugins/scope.js';
2
+ import '../core/hooks.js';
3
+ import './core.js';
4
+ import './runtime.js';
5
+ import '../sdk/enums/runtime.enum.js';
6
+ import '../core/middleware/pipeline.js';
7
+ import './middleware.js';
8
+ import '../core/context.js';
9
+ import '../core/router/route.js';
10
+ import './router.js';
11
+ import '../sdk/enums/http.enum.js';
12
+ import '../core/router/router.js';
13
+
14
+ type PluginFn = (scope: PluginScope) => Promise<void> | void;
15
+ interface Plugin {
16
+ name?: string;
17
+ setup: PluginFn;
18
+ }
19
+
20
+ export type { Plugin, PluginFn };
File without changes
@@ -0,0 +1,12 @@
1
+ import { BuilderHMRDeclaration } from './builder.js';
2
+ import { Metafile } from 'esbuild';
3
+ import './hmr.js';
4
+
5
+ interface RaitonSignalMap {
6
+ ready?: undefined;
7
+ errors: any;
8
+ 'hmr:controller': BuilderHMRDeclaration;
9
+ 'hmr:triggered': Metafile | undefined;
10
+ }
11
+
12
+ export type { RaitonSignalMap };
File without changes
@@ -0,0 +1,8 @@
1
+ import { IDependencyContainerDefinition } from './dependency-container.js';
2
+ import './contruct.js';
3
+ import '@protorians/core';
4
+
5
+ interface IRepositoryDefinition<T = any> extends IDependencyContainerDefinition<T> {
6
+ }
7
+
8
+ export type { IRepositoryDefinition };
File without changes
@@ -0,0 +1,14 @@
1
+ import { RequestContext } from '../core/context.js';
2
+ import { HttpMethod } from '../sdk/enums/http.enum.js';
3
+ import './runtime.js';
4
+ import '../sdk/enums/runtime.enum.js';
5
+
6
+ type RouteHandler = (ctx: RequestContext) => Promise<any> | any;
7
+ interface RouteDefinition {
8
+ method: HttpMethod;
9
+ path: string;
10
+ version?: string;
11
+ handler: RouteHandler;
12
+ }
13
+
14
+ export type { RouteDefinition, RouteHandler };
File without changes
@@ -0,0 +1,37 @@
1
+ import { RuntimeType } from '../sdk/enums/runtime.enum.js';
2
+
3
+ interface RuntimeServer {
4
+ listen(port: number): Promise<void>;
5
+ close(): Promise<void>;
6
+ handle?(request: Request): Promise<Response>;
7
+ }
8
+ interface RuntimeRequest {
9
+ method: string;
10
+ url: string;
11
+ headers: Headers;
12
+ body?: ReadableStream<Uint8Array> | Uint8Array | Record<string, any> | null;
13
+ query?: Record<string, any>;
14
+ remoteAddress?: string;
15
+ }
16
+ type RuntimeHandlerCallable = (req: RuntimeRequest, reply: RuntimeReply) => Promise<void>;
17
+ interface RuntimeReply {
18
+ status(code: number): void;
19
+ header(name: string, value: string): void;
20
+ send(body: any): void;
21
+ text(text: string | Buffer): void;
22
+ json(data: any): void;
23
+ }
24
+ interface RuntimeAdapter {
25
+ createServer(handler: RuntimeHandlerCallable): RuntimeServer;
26
+ }
27
+ interface RuntimeInterface {
28
+ readonly type: RuntimeType;
29
+ get isNode(): boolean;
30
+ get isDeno(): boolean;
31
+ get isWeb(): boolean;
32
+ get isBun(): boolean;
33
+ adapter(): RuntimeAdapter;
34
+ createServer(handler: RuntimeHandlerCallable): RuntimeServer;
35
+ }
36
+
37
+ export type { RuntimeAdapter, RuntimeHandlerCallable, RuntimeInterface, RuntimeReply, RuntimeRequest, RuntimeServer };
File without changes
@@ -0,0 +1,128 @@
1
+ import { TSchema, TProperties, TObject } from '@sinclair/typebox';
2
+
3
+ interface ISchemePropertyOptions {
4
+ optional?: boolean;
5
+ }
6
+ /**
7
+ * The `ISchematic` interface provides a structured contract for managing and constructing schemas
8
+ * that define the shape of request bodies, parameters, query strings, and response structures.
9
+ * It allows dynamic assignment of schema properties and the retrieval of constructed schema configurations.
10
+ *
11
+ * @template TBody The schema type defining the request body.
12
+ * @template TParams The schema type defining the request parameters.
13
+ * @template TQuery The schema type defining the query string.
14
+ * @template TResponse The schema type defining the response structure, indexed by HTTP status codes.
15
+ */
16
+ interface IScheme<TBody extends TSchema | undefined = undefined, TParams extends TSchema | undefined = undefined, TQuery extends TSchema | undefined = undefined, TResponse extends Record<number, TSchema> | undefined = undefined> {
17
+ /**
18
+ * Retrieves the value of the `$body` property.
19
+ *
20
+ * @return {TBody | undefined} The body content of type `TBody` or `undefined` if not set.
21
+ */
22
+ get $body(): TBody | undefined;
23
+ /**
24
+ * Updates the body of the request with a specified key-value pair.
25
+ *
26
+ * @param {string} key - The key to be added or updated in the body of the request.
27
+ * @param {TProperties} value - The value associated with the specified key.
28
+ * @return {this} The current instance to allow method chaining.
29
+ */
30
+ body(key: string, value: TProperties): this;
31
+ /**
32
+ * Retrieves the current value of `$params`.
33
+ *
34
+ * This method returns the parameter(s) associated with the instance.
35
+ * It may return undefined if no parameters are set.
36
+ *
37
+ * @return {TParams | undefined} The current parameters or undefined if none are set.
38
+ */
39
+ get $params(): TParams | undefined;
40
+ /**
41
+ * Assigns a key-value pair to the parameters of the current instance.
42
+ *
43
+ * @param {string} key - The key for the parameter to be set.
44
+ * @param {TProperties} value - The value associated with the specified key.
45
+ * @return {this} The current instance with the updated parameter.
46
+ */
47
+ params(key: string, value: TProperties): this;
48
+ /**
49
+ * Retrieves the query string associated with the current object.
50
+ *
51
+ * @return {TQuery | undefined} The query string if defined, otherwise undefined.
52
+ */
53
+ get $querystring(): TQuery | undefined;
54
+ /**
55
+ * Updates or sets a query string parameter with the specified key and value.
56
+ * If the query string already contains the key, its value will be updated.
57
+ *
58
+ * @param {string} key - The key of the query string parameter to be updated or added.
59
+ * @param {TProperties} value - The value to be set for the specified query string key.
60
+ * @return {this} The current instance to allow for method chaining.
61
+ */
62
+ querystring(key: string, value: TProperties): this;
63
+ /**
64
+ * Retrieves the response object associated with the instance.
65
+ *
66
+ * @return {TResponse | undefined} The response object if it exists, otherwise undefined.
67
+ */
68
+ get $response(): TResponse | undefined;
69
+ /**
70
+ * Stores a key-value pair in the response object and returns the current instance for chaining.
71
+ *
72
+ * @param {number} key - The unique identifier for the value to be stored.
73
+ * @param {TProperties} value - The value to store associated with the provided key.
74
+ * @return {this} Returns the current instance to allow method chaining.
75
+ */
76
+ response(key: number, value: TProperties): this;
77
+ /**
78
+ * Provides the schema options for handling the request and response structure.
79
+ *
80
+ * @return {ISchemeOptions<TBody, TParams, TQuery, TResponse>} The schema options defining the types for body, params, query, and response.
81
+ */
82
+ schema(): ISchemeOptions<TBody, TParams, TQuery, TResponse>;
83
+ }
84
+ /**
85
+ * Interface representing the schema configuration for various aspects of a request-response process.
86
+ *
87
+ * @template TBody Represents the schema for the request body. Defaults to undefined if not specified.
88
+ * @template TParams Represents the schema for request parameters. Defaults to undefined if not specified.
89
+ * @template TQuery Represents the schema for query string parameters. Defaults to undefined if not specified.
90
+ * @template TResponse Represents the schema for response objects, mapped by status codes. Defaults to undefined if not specified.
91
+ *
92
+ * @property {TBody} [body] Optional schema definition for the request body.
93
+ * @property {TParams} [params] Optional schema definition for the request parameters.
94
+ * @property {TQuery} [querystring] Optional schema definition for query string parameters.
95
+ * @property {TResponse} [response] Optional schema definition for response objects, associated with HTTP status codes.
96
+ */
97
+ interface ISchemeConfig<TBody extends TSchema | undefined = undefined, TParams extends TSchema | undefined = undefined, TQuery extends TSchema | undefined = undefined, TResponse extends Record<number, TSchema> | undefined = undefined> {
98
+ body?: TBody;
99
+ params?: TParams;
100
+ querystring?: TQuery;
101
+ response?: TResponse;
102
+ }
103
+ /**
104
+ * Interface representing schema options for defining request and response payloads
105
+ * in a structured and strongly-typed manner.
106
+ *
107
+ * @template TBody - The type of the schema for the request body, or undefined if not applicable.
108
+ * @template TParams - The type of the schema for the request parameters, or undefined if not applicable.
109
+ * @template TQuery - The type of the schema for the query string, or undefined if not applicable.
110
+ * @template TResponse - A record of HTTP status codes to their respective response schemas, or undefined if not applicable.
111
+ *
112
+ * @property body - Represents the schema definition for the request body.
113
+ * This is an optional property and only applies if TBody is specified.
114
+ * @property params - Represents the schema definition for the request parameters.
115
+ * This is an optional property and only applies if TParams is specified.
116
+ * @property querystring - Represents the schema definition for the query string.
117
+ * This is an optional property and only applies if TQuery is specified.
118
+ * @property response - Represents the schema definition for the response body, mapped by status code.
119
+ * This is an optional property and only applies if TResponse is specified.
120
+ */
121
+ interface ISchemeOptions<TBody extends TSchema | undefined = undefined, TParams extends TSchema | undefined = undefined, TQuery extends TSchema | undefined = undefined, TResponse extends Record<number, TSchema> | undefined = undefined> {
122
+ body?: TObject<NonNullable<TBody>> | undefined;
123
+ params?: TObject<NonNullable<TParams>> | undefined;
124
+ querystring?: TObject<NonNullable<TQuery>> | undefined;
125
+ response?: TObject<NonNullable<TResponse>> | undefined;
126
+ }
127
+
128
+ export type { IScheme, ISchemeConfig, ISchemeOptions, ISchemePropertyOptions };
File without changes
@@ -0,0 +1,57 @@
1
+ import { FastifyRequest, FastifyReply, FastifyInstance } from 'fastify';
2
+ import { ISchemeOptions } from './scheme.js';
3
+ import { TSchema } from '@sinclair/typebox';
4
+ import { ISignalStack } from '@protorians/core';
5
+ import { Metafile } from 'esbuild';
6
+
7
+ interface ServerOptions {
8
+ workdir: string;
9
+ prefix?: string;
10
+ develop?: boolean;
11
+ port?: number;
12
+ verbose?: boolean;
13
+ trustProxy?: boolean;
14
+ }
15
+ type ServerFeaturesUsed = Map<string, any>;
16
+ interface ServerInterface {
17
+ readonly options: ServerOptions;
18
+ readonly controllers: Map<string, ServerControllerInterface>;
19
+ readonly signals: ISignalStack<ServerSignalMap>;
20
+ get runner(): FastifyInstance;
21
+ get feature(): ServerFeaturesUsed;
22
+ useAuthenticate(): Promise<this>;
23
+ useFormbody(): Promise<this>;
24
+ useMultipart(): Promise<this>;
25
+ useSwagger(): Promise<this>;
26
+ usePublicDirectory(directory?: string): Promise<this>;
27
+ prepare(): Promise<this>;
28
+ start(): Promise<this>;
29
+ }
30
+ interface ServerRouteInterface {
31
+ method: string;
32
+ path: string;
33
+ name: string;
34
+ url: string;
35
+ paramsMetadata: any[];
36
+ schema?: ISchemeOptions<TSchema, TSchema, TSchema, Record<number, TSchema>> | undefined;
37
+ }
38
+ interface ServerControllerInterface {
39
+ prefix: string;
40
+ routes: ServerRouteInterface[];
41
+ instance: (...args: any[]) => Record<string, Function>;
42
+ filename?: string;
43
+ handler: (handleName: string, params: any[]) => (req: FastifyRequest, reply: FastifyReply) => Promise<any>;
44
+ }
45
+ interface ServerHMRDeclaration {
46
+ filename: string;
47
+ timestamp?: number;
48
+ version?: number;
49
+ }
50
+ interface ServerSignalMap {
51
+ ready: undefined;
52
+ errors: any;
53
+ 'hmr:controller': ServerHMRDeclaration;
54
+ 'hmr:triggered': Metafile | undefined;
55
+ }
56
+
57
+ export type { ServerControllerInterface, ServerFeaturesUsed, ServerHMRDeclaration, ServerInterface, ServerOptions, ServerRouteInterface, ServerSignalMap };
File without changes
@@ -0,0 +1,8 @@
1
+ import { IDependencyContainerDefinition } from './dependency-container.js';
2
+ import './contruct.js';
3
+ import '@protorians/core';
4
+
5
+ interface IGraftDefinition<T = any> extends IDependencyContainerDefinition<T> {
6
+ }
7
+
8
+ export type { IGraftDefinition };
File without changes
@@ -0,0 +1,24 @@
1
+ import { BuilderInterface } from './builder.js';
2
+ import { ApplicationInterface } from './application.js';
3
+ import { RuntimeType } from '../sdk/enums/runtime.enum.js';
4
+ import 'esbuild';
5
+ import './hmr.js';
6
+ import '../sdk/enums/http.enum.js';
7
+
8
+ interface ThreadSetupOptions {
9
+ application: ApplicationInterface;
10
+ runtime?: RuntimeType;
11
+ }
12
+ type ThreadWaitCallable = () => (boolean | Promise<boolean>);
13
+ interface ThreadInterface {
14
+ readonly appDir: string;
15
+ readonly builder: BuilderInterface;
16
+ setup(options: ThreadSetupOptions): this;
17
+ run(): Promise<this>;
18
+ restart(): void;
19
+ stop(): void;
20
+ sleep(milliseconds: number): Promise<unknown>;
21
+ wait(condition: ThreadWaitCallable): Promise<void>;
22
+ }
23
+
24
+ export type { ThreadInterface, ThreadSetupOptions, ThreadWaitCallable };
File without changes
@@ -0,0 +1,6 @@
1
+ interface FileSizeFormated {
2
+ size: number;
3
+ unit: string;
4
+ }
5
+
6
+ export type { FileSizeFormated };
File without changes
@@ -0,0 +1,4 @@
1
+ type IString = string | Object | null | undefined;
2
+ type IStringable = IString | IString[] | Promise<IString | IString[]>;
3
+
4
+ export type { IString, IStringable };
File without changes
package/package.json ADDED
@@ -0,0 +1,97 @@
1
+ {
2
+ "name": "raiton",
3
+ "version": "1.1.1",
4
+ "private": false,
5
+ "type": "module",
6
+ "description": "Protorians Raiton Development Kit",
7
+ "bin": {
8
+ "raiton": "build/bin/index.mjs"
9
+ },
10
+ "keywords": [
11
+ "protorians",
12
+ "raiton"
13
+ ],
14
+ "author": "Y. Yannick GOBOU",
15
+ "license": "MIT",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/protorians/raiton.git"
19
+ },
20
+ "exports": {
21
+ "./core/*": {
22
+ "types": "./build/core/*.d.ts",
23
+ "import": "./build/core/*.mjs"
24
+ },
25
+ ".": {
26
+ "types": "./build/core/index.d.ts",
27
+ "import": "./build/core/index.mjs"
28
+ },
29
+ "./commands/*": {
30
+ "types": "./build/commands/*.d.ts",
31
+ "import": "./build/commands/*.mjs"
32
+ },
33
+ "./sdk/*": {
34
+ "types": "./build/sdk/*.d.ts",
35
+ "import": "./build/sdk/*.mjs"
36
+ },
37
+ "./sdk": {
38
+ "types": "./build/sdk/index.d.ts",
39
+ "import": "./build/sdk/index.mjs"
40
+ },
41
+ "./types/*": {
42
+ "types": "./build/types/index.d.ts",
43
+ "import": "./build/types/index.mjs"
44
+ }
45
+ },
46
+ "scripts": {
47
+ "dev": "tsup --watch --config tsup.config.ts",
48
+ "build": "tsup --config tsup.config.ts",
49
+ "commit": "pnpx semantic-release",
50
+ "commit:test": "pnpx semantic-release --dry-run"
51
+ },
52
+ "dependencies": {
53
+ "@protorians/core": "^0.6.13",
54
+ "@protorians/events-bus": "^0.0.1",
55
+ "@protorians/logger": "^0.0.10",
56
+ "@protorians/parameters": "^0.0.5",
57
+ "@sinclair/typebox": "^0.34.41",
58
+ "@types/node": "^25.0.3",
59
+ "argon2": "^0.44.0",
60
+ "bcrypt": "^6.0.0",
61
+ "commander": "^14.0.2",
62
+ "dotenv": "^17.2.3",
63
+ "esbuild": "^0.27.1",
64
+ "fastify": "^5.6.2",
65
+ "fastify-plugin": "^5.1.0",
66
+ "reflect-metadata": "^0.2.2"
67
+ },
68
+ "devDependencies": {
69
+ "@semantic-release/changelog": "^6.0.3",
70
+ "@semantic-release/git": "^10.0.1",
71
+ "@semantic-release/github": "^12.0.2",
72
+ "@semantic-release/npm": "^13.1.2",
73
+ "@types/bcrypt": "^6.0.0",
74
+ "@types/bun": "^1.3.5",
75
+ "@types/deno": "^2.5.0",
76
+ "commitizen": "^4.3.1",
77
+ "conventional-changelog-conventionalcommits": "^9.1.0",
78
+ "cz-conventional-changelog": "^3.3.0",
79
+ "semantic-release": "^25.0.2",
80
+ "tsup": "^8.3.0",
81
+ "typescript": "^5.9.3"
82
+ },
83
+ "config": {
84
+ "commitizen": {
85
+ "path": "./node_modules/cz-conventional-changelog"
86
+ }
87
+ },
88
+ "compilerOptions": {
89
+ "types": [
90
+ "node"
91
+ ]
92
+ },
93
+ "publishConfig": {
94
+ "access": "public",
95
+ "provenance": true
96
+ }
97
+ }