raiton 1.1.1 → 3.0.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.
- package/CHANGELOG.md +55 -0
- package/README.md +97 -1
- package/build/bin/index.mjs +7012 -47
- package/deno.json +9 -0
- package/package.json +28 -44
- package/scripts/update-version.ts +97 -0
- package/source/bin/bootstrapper.ts +15 -0
- package/source/bin/cli-tools.ts +68 -0
- package/source/bin/cli.ts +12 -0
- package/source/bin/constants.ts +5 -0
- package/source/bin/index.ts +6 -0
- package/source/commands/artifact.command.ts +28 -0
- package/source/commands/build.command.ts +31 -0
- package/source/commands/develop.command.ts +47 -0
- package/source/commands/grafts.command.ts +27 -0
- package/source/commands/start.command.ts +28 -0
- package/source/core/application.ts +163 -0
- package/source/core/builder.ts +144 -0
- package/source/core/bytes.util.ts +17 -0
- package/source/core/command.ts +24 -0
- package/source/core/commands.ts +44 -0
- package/source/core/config/config.ts +51 -0
- package/source/core/config/define.ts +13 -0
- package/source/core/config/index.ts +2 -0
- package/source/core/context.ts +33 -0
- package/source/core/controller/builder.ts +41 -0
- package/source/core/controller/compiler.ts +22 -0
- package/source/core/controller/index.ts +3 -0
- package/source/core/controller/metadata.ts +13 -0
- package/source/core/directories.ts +30 -0
- package/source/core/helpers/index.ts +1 -0
- package/source/core/helpers/raiton.ts +3 -0
- package/source/core/hooks.ts +28 -0
- package/source/core/index.ts +14 -0
- package/source/core/injection/index.ts +1 -0
- package/source/core/injection/injection.ts +219 -0
- package/source/core/middleware/compose.ts +40 -0
- package/source/core/middleware/index.ts +2 -0
- package/source/core/middleware/pipeline.ts +27 -0
- package/source/core/plugins/index.ts +2 -0
- package/source/core/plugins/plugin.ts +8 -0
- package/source/core/plugins/scope.ts +46 -0
- package/source/core/process.util.ts +12 -0
- package/source/core/raiton.ts +20 -0
- package/source/core/router/handler.ts +115 -0
- package/source/core/router/index.ts +4 -0
- package/source/core/router/matcher.ts +51 -0
- package/source/core/router/route.ts +63 -0
- package/source/core/router/router.ts +31 -0
- package/source/core/server.ts +26 -0
- package/source/core/thread.ts +112 -0
- package/source/env.d.ts +3 -0
- package/source/requirements.ts +27 -0
- package/source/sdk/artifacts.ts +79 -0
- package/source/sdk/constants/decorators.constant.ts +8 -0
- package/source/sdk/constants/index.ts +2 -0
- package/source/sdk/constants/microservices.constant.ts +4 -0
- package/source/sdk/controllers.ts +4 -0
- package/source/sdk/data-transfer-object.ts +15 -0
- package/source/sdk/decorators/access-guard.decorator.ts +9 -0
- package/source/sdk/decorators/controllable.decorator.ts +20 -0
- package/source/sdk/decorators/index.ts +5 -0
- package/source/sdk/decorators/injection.decorator.ts +46 -0
- package/source/sdk/decorators/middleware.decorator.ts +15 -0
- package/source/sdk/decorators/parametrable.ts +28 -0
- package/source/sdk/decorators/routable.decorator.ts +45 -0
- package/source/sdk/encryption.ts +157 -0
- package/source/sdk/enums/encrypted.enum.ts +23 -0
- package/source/sdk/enums/event.message.enum.ts +4 -0
- package/source/sdk/enums/http-method.enum.ts +10 -0
- package/{build/sdk/enums/http-parameters.enum.d.ts → source/sdk/enums/http-parameters.enum.ts} +3 -5
- package/source/sdk/enums/http-status.enum.ts +73 -0
- package/source/sdk/enums/index.ts +7 -0
- package/{build/sdk/enums/runtime.enum.d.ts → source/sdk/enums/runtime.enum.ts} +2 -4
- package/{build/sdk/enums/timestamp.enum.d.ts → source/sdk/enums/timestamp.enum.ts} +2 -4
- package/source/sdk/env.ts +40 -0
- package/source/sdk/exceptions/http-exception.ts +28 -0
- package/source/sdk/exceptions/index.ts +2 -0
- package/{build/sdk/throwable.d.ts → source/sdk/exceptions/throwable.ts} +35 -12
- package/source/sdk/index.ts +14 -0
- package/source/sdk/parameter-bag.ts +55 -0
- package/source/sdk/plugins/body-parser.plugin.ts +160 -0
- package/source/sdk/plugins/index.ts +2 -0
- package/source/sdk/plugins/security/body-limit.ts +19 -0
- package/source/sdk/plugins/security/cors.ts +44 -0
- package/source/sdk/plugins/security/headers.ts +14 -0
- package/source/sdk/plugins/security/index.ts +13 -0
- package/source/sdk/plugins/security/method-guard.ts +14 -0
- package/source/sdk/plugins/security/rate-limit.ts +42 -0
- package/source/sdk/repositories.ts +14 -0
- package/source/sdk/responses/error.ts +52 -0
- package/source/sdk/responses/helpers.ts +28 -0
- package/source/sdk/responses/http-throwable.ts +28 -0
- package/source/sdk/responses/http.ts +48 -0
- package/source/sdk/responses/index.ts +4 -0
- package/source/sdk/runtime/bun/server.ts +73 -0
- package/source/sdk/runtime/deno/server.ts +53 -0
- package/source/sdk/runtime/index.ts +47 -0
- package/source/sdk/runtime/node/server.ts +60 -0
- package/source/sdk/runtime/web/server.ts +57 -0
- package/source/sdk/services.ts +9 -0
- package/source/sdk/utilities/alias-path.util.ts +49 -0
- package/source/sdk/utilities/artifact.util.ts +18 -0
- package/source/sdk/utilities/callable.util.ts +27 -0
- package/source/sdk/utilities/index.ts +5 -0
- package/source/sdk/utilities/json.util.ts +21 -0
- package/source/sdk/utilities/path.util.ts +19 -0
- package/source/sdk/utilities/url.ts +5 -0
- package/source/sdk/utilities/utilities.util.ts +25 -0
- package/source/types/access-guards.ts +4 -0
- package/{build/types/application.d.ts → source/types/application.ts} +23 -7
- package/source/types/artifact.ts +44 -0
- package/source/types/builder.ts +44 -0
- package/source/types/config.ts +7 -0
- package/source/types/controller.ts +33 -0
- package/source/types/contruct.ts +3 -0
- package/source/types/core.ts +28 -0
- package/{build/types/directory.d.ts → source/types/directory.ts} +4 -4
- package/source/types/encryption.ts +17 -0
- package/source/types/generic.ts +3 -0
- package/source/types/http-responses.ts +8 -0
- package/source/types/index.ts +25 -0
- package/source/types/injection.ts +13 -0
- package/source/types/lifecycle.ts +11 -0
- package/source/types/middleware.ts +18 -0
- package/source/types/parseable.ts +7 -0
- package/source/types/plugin.ts +10 -0
- package/source/types/raiton.ts +7 -0
- package/source/types/responses.ts +20 -0
- package/source/types/router.ts +11 -0
- package/source/types/runtime.ts +56 -0
- package/{build/types/scheme.d.ts → source/types/scheme.ts} +33 -8
- package/source/types/server.ts +12 -0
- package/source/types/thread.ts +31 -0
- package/source/types/utilities.ts +4 -0
- package/source/types/values.ts +3 -0
- package/.releaserc.json +0 -39
- package/build/bin/bootstrapper.d.ts +0 -5
- package/build/bin/bootstrapper.mjs +0 -46
- package/build/bin/cli.d.ts +0 -5
- package/build/bin/cli.mjs +0 -6
- package/build/bin/index.d.ts +0 -1
- package/build/chunk-3PWMRP6G.mjs +0 -16
- package/build/chunk-52JR26TI.mjs +0 -29
- package/build/chunk-5LNOA4SK.mjs +0 -16
- package/build/chunk-AUGL35CF.mjs +0 -24
- package/build/chunk-BYYJRCB4.mjs +0 -10
- package/build/chunk-FFRJ4AUA.mjs +0 -16
- package/build/chunk-GPJSLV3Q.mjs +0 -50
- package/build/chunk-HVFHDVAH.mjs +0 -20
- package/build/chunk-IOCHNQMF.mjs +0 -13
- package/build/chunk-JATYBWHL.mjs +0 -36
- package/build/chunk-JWNBO7XV.mjs +0 -53
- package/build/chunk-K4IQQ2KF.mjs +0 -55
- package/build/chunk-K4KLOLSO.mjs +0 -645
- package/build/chunk-M2RZZJQR.mjs +0 -27
- package/build/chunk-MLFGBJDV.mjs +0 -12
- package/build/chunk-NB62GSFI.mjs +0 -27
- package/build/chunk-O7R3NJQN.mjs +0 -19
- package/build/chunk-P2YCCBFR.mjs +0 -14
- package/build/chunk-P3IRIFPT.mjs +0 -53
- package/build/chunk-QFSXFOEN.mjs +0 -56
- package/build/chunk-QHCQ4AUA.mjs +0 -14
- package/build/chunk-QI7OFSXB.mjs +0 -37
- package/build/chunk-RVH2YBNU.mjs +0 -111
- package/build/chunk-RXG7754R.mjs +0 -25
- package/build/chunk-S3ONGVNZ.mjs +0 -11
- package/build/chunk-SRR4467I.mjs +0 -29
- package/build/chunk-T6L55AUG.mjs +0 -32
- package/build/chunk-TOJFTPAY.mjs +0 -83
- package/build/chunk-UAPCBU3J.mjs +0 -12
- package/build/chunk-UCHBN3DV.mjs +0 -52
- package/build/chunk-UWM46HLZ.mjs +0 -18
- package/build/chunk-UZFCGVHP.mjs +0 -8
- package/build/chunk-VQINCGLQ.mjs +0 -59
- package/build/chunk-VRL4S7UF.mjs +0 -74
- package/build/chunk-WAWFDMOH.mjs +0 -72
- package/build/chunk-X3JFRRRQ.mjs +0 -45
- package/build/chunk-XFBLELHI.mjs +0 -34
- package/build/chunk-XIGE72LC.mjs +0 -34
- package/build/chunk-XW7EPAD7.mjs +0 -0
- package/build/chunk-YGIZFKLJ.mjs +0 -20
- package/build/chunk-YRVIAORI.mjs +0 -8
- package/build/chunk-YXU5W2CB.mjs +0 -12
- package/build/commands/artifact.command.d.ts +0 -14
- package/build/commands/artifact.command.mjs +0 -59
- package/build/commands/build.command.d.ts +0 -14
- package/build/commands/build.command.mjs +0 -65
- package/build/commands/develop.command.d.ts +0 -13
- package/build/commands/develop.command.mjs +0 -75
- package/build/commands/grafts.command.d.ts +0 -12
- package/build/commands/grafts.command.mjs +0 -58
- package/build/commands/start.command.d.ts +0 -12
- package/build/commands/start.command.mjs +0 -64
- package/build/core/application.d.ts +0 -27
- package/build/core/application.mjs +0 -124
- package/build/core/artifact.d.ts +0 -19
- package/build/core/artifact.mjs +0 -133
- package/build/core/builder.d.ts +0 -35
- package/build/core/builder.mjs +0 -45
- package/build/core/bytes.util.d.ts +0 -6
- package/build/core/bytes.util.mjs +0 -8
- package/build/core/command.d.ts +0 -15
- package/build/core/command.mjs +0 -6
- package/build/core/commands.d.ts +0 -13
- package/build/core/commands.mjs +0 -7
- package/build/core/config.d.ts +0 -10
- package/build/core/config.mjs +0 -7
- package/build/core/context.d.ts +0 -15
- package/build/core/context.mjs +0 -6
- package/build/core/controller/builder.d.ts +0 -10
- package/build/core/controller/builder.mjs +0 -45
- package/build/core/controller/compiler.d.ts +0 -6
- package/build/core/controller/compiler.mjs +0 -45
- package/build/core/controller/index.d.ts +0 -13
- package/build/core/controller/index.mjs +0 -50
- package/build/core/controller/metadata.d.ts +0 -10
- package/build/core/controller/metadata.mjs +0 -6
- package/build/core/directories.d.ts +0 -11
- package/build/core/directories.mjs +0 -8
- package/build/core/hmr.d.ts +0 -22
- package/build/core/hmr.mjs +0 -6
- package/build/core/hooks.d.ts +0 -12
- package/build/core/hooks.mjs +0 -6
- package/build/core/index.d.ts +0 -41
- package/build/core/index.mjs +0 -100
- package/build/core/middleware/compose.d.ts +0 -8
- package/build/core/middleware/compose.mjs +0 -6
- package/build/core/middleware/index.d.ts +0 -6
- package/build/core/middleware/index.mjs +0 -11
- package/build/core/middleware/pipeline.d.ts +0 -14
- package/build/core/middleware/pipeline.mjs +0 -7
- package/build/core/plugins/index.d.ts +0 -14
- package/build/core/plugins/index.mjs +0 -48
- package/build/core/plugins/plugin.d.ts +0 -17
- package/build/core/plugins/plugin.mjs +0 -6
- package/build/core/plugins/scope.d.ts +0 -24
- package/build/core/plugins/scope.mjs +0 -45
- package/build/core/process.util.d.ts +0 -3
- package/build/core/process.util.mjs +0 -6
- package/build/core/raiton.d.ts +0 -20
- package/build/core/raiton.mjs +0 -6
- package/build/core/router/handler.d.ts +0 -10
- package/build/core/router/handler.mjs +0 -45
- package/build/core/router/index.d.ts +0 -12
- package/build/core/router/index.mjs +0 -54
- package/build/core/router/matcher.d.ts +0 -21
- package/build/core/router/matcher.mjs +0 -6
- package/build/core/router/route.d.ts +0 -20
- package/build/core/router/route.mjs +0 -6
- package/build/core/router/router.d.ts +0 -16
- package/build/core/router/router.mjs +0 -8
- package/build/core/thread.d.ts +0 -30
- package/build/core/thread.mjs +0 -45
- package/build/env.d.d.ts +0 -2
- package/build/env.d.mjs +0 -0
- package/build/raiton-1.1.1.tgz +0 -0
- package/build/requirements.d.ts +0 -2
- package/build/requirements.mjs +0 -19
- package/build/sdk/artifacts.d.ts +0 -13
- package/build/sdk/artifacts.mjs +0 -45
- package/build/sdk/constants/decorators.constant.d.ts +0 -11
- package/build/sdk/constants/decorators.constant.mjs +0 -6
- package/build/sdk/constants/index.d.ts +0 -2
- package/build/sdk/constants/index.mjs +0 -11
- package/build/sdk/constants/microservices.constant.d.ts +0 -5
- package/build/sdk/constants/microservices.constant.mjs +0 -6
- package/build/sdk/controllers.d.ts +0 -4
- package/build/sdk/controllers.mjs +0 -6
- package/build/sdk/data-transfer-object.d.ts +0 -7
- package/build/sdk/data-transfer-object.mjs +0 -7
- package/build/sdk/decorators/access-guard.decorator.d.ts +0 -2
- package/build/sdk/decorators/access-guard.decorator.mjs +0 -0
- package/build/sdk/decorators/controllable.d.ts +0 -3
- package/build/sdk/decorators/controllable.mjs +0 -45
- package/build/sdk/decorators/controllers.decorator.d.ts +0 -2
- package/build/sdk/decorators/controllers.decorator.mjs +0 -0
- package/build/sdk/decorators/grafts.decorator.d.ts +0 -2
- package/build/sdk/decorators/grafts.decorator.mjs +0 -0
- package/build/sdk/decorators/index.d.ts +0 -3
- package/build/sdk/decorators/index.mjs +0 -75
- package/build/sdk/decorators/parameters.decorator.d.ts +0 -2
- package/build/sdk/decorators/parameters.decorator.mjs +0 -0
- package/build/sdk/decorators/parametrable.d.ts +0 -9
- package/build/sdk/decorators/parametrable.mjs +0 -57
- package/build/sdk/decorators/payload.decorator.d.ts +0 -2
- package/build/sdk/decorators/payload.decorator.mjs +0 -0
- package/build/sdk/decorators/routable.d.ts +0 -10
- package/build/sdk/decorators/routable.mjs +0 -59
- package/build/sdk/dependency-container.d.ts +0 -19
- package/build/sdk/dependency-container.mjs +0 -46
- package/build/sdk/encryption.d.ts +0 -27
- package/build/sdk/encryption.mjs +0 -141
- package/build/sdk/enums/encrypted.enum.d.ts +0 -15
- package/build/sdk/enums/encrypted.enum.mjs +0 -6
- package/build/sdk/enums/event.message.enum.d.ts +0 -6
- package/build/sdk/enums/event.message.enum.mjs +0 -6
- package/build/sdk/enums/http-parameters.enum.mjs +0 -6
- package/build/sdk/enums/http.enum.d.ts +0 -12
- package/build/sdk/enums/http.enum.mjs +0 -6
- package/build/sdk/enums/index.d.ts +0 -6
- package/build/sdk/enums/index.mjs +0 -27
- package/build/sdk/enums/runtime.enum.mjs +0 -6
- package/build/sdk/enums/timestamp.enum.mjs +0 -6
- package/build/sdk/env.d.ts +0 -6
- package/build/sdk/env.mjs +0 -74
- package/build/sdk/fastify.d.ts +0 -11
- package/build/sdk/fastify.mjs +0 -9
- package/build/sdk/grafts.d.ts +0 -15
- package/build/sdk/grafts.mjs +0 -71
- package/build/sdk/index.d.ts +0 -34
- package/build/sdk/index.mjs +0 -126
- package/build/sdk/json.d.ts +0 -17
- package/build/sdk/json.mjs +0 -87
- package/build/sdk/plugins/body-parser.plugin.d.ts +0 -17
- package/build/sdk/plugins/body-parser.plugin.mjs +0 -7
- package/build/sdk/plugins/index.d.ts +0 -17
- package/build/sdk/plugins/index.mjs +0 -48
- package/build/sdk/plugins/security/body-limit.d.ts +0 -17
- package/build/sdk/plugins/security/body-limit.mjs +0 -45
- package/build/sdk/plugins/security/cors.d.ts +0 -22
- package/build/sdk/plugins/security/cors.mjs +0 -45
- package/build/sdk/plugins/security/headers.d.ts +0 -17
- package/build/sdk/plugins/security/headers.mjs +0 -45
- package/build/sdk/plugins/security/index.d.ts +0 -25
- package/build/sdk/plugins/security/index.mjs +0 -45
- package/build/sdk/plugins/security/method-guard.d.ts +0 -17
- package/build/sdk/plugins/security/method-guard.mjs +0 -45
- package/build/sdk/plugins/security/rate-limit.d.ts +0 -21
- package/build/sdk/plugins/security/rate-limit.mjs +0 -45
- package/build/sdk/repositories.d.ts +0 -7
- package/build/sdk/repositories.mjs +0 -17
- package/build/sdk/request.d.ts +0 -4
- package/build/sdk/request.mjs +0 -6
- package/build/sdk/responses.d.ts +0 -8
- package/build/sdk/responses.mjs +0 -20
- package/build/sdk/routes.d.ts +0 -7
- package/build/sdk/routes.mjs +0 -61
- package/build/sdk/runtime/bun/server.d.ts +0 -6
- package/build/sdk/runtime/bun/server.mjs +0 -6
- package/build/sdk/runtime/deno/server.d.ts +0 -6
- package/build/sdk/runtime/deno/server.mjs +0 -6
- package/build/sdk/runtime/index.d.ts +0 -15
- package/build/sdk/runtime/index.mjs +0 -11
- package/build/sdk/runtime/node/reply.d.ts +0 -2
- package/build/sdk/runtime/node/reply.mjs +0 -0
- package/build/sdk/runtime/node/request.d.ts +0 -2
- package/build/sdk/runtime/node/request.mjs +0 -0
- package/build/sdk/runtime/node/server.d.ts +0 -6
- package/build/sdk/runtime/node/server.mjs +0 -6
- package/build/sdk/runtime/web/server.d.ts +0 -6
- package/build/sdk/runtime/web/server.mjs +0 -6
- package/build/sdk/schemes.d.ts +0 -120
- package/build/sdk/schemes.mjs +0 -129
- package/build/sdk/services.d.ts +0 -8
- package/build/sdk/services.mjs +0 -10
- package/build/sdk/throwable.mjs +0 -14
- package/build/sdk/utilities/alias-path.util.d.ts +0 -9
- package/build/sdk/utilities/alias-path.util.mjs +0 -6
- package/build/sdk/utilities/artifacts.util.d.ts +0 -3
- package/build/sdk/utilities/artifacts.util.mjs +0 -45
- package/build/sdk/utilities/callable.util.d.ts +0 -3
- package/build/sdk/utilities/callable.util.mjs +0 -6
- package/build/sdk/utilities/controller.util.d.ts +0 -3
- package/build/sdk/utilities/controller.util.mjs +0 -6
- package/build/sdk/utilities/index.d.ts +0 -7
- package/build/sdk/utilities/index.mjs +0 -62
- package/build/sdk/utilities/json.util.d.ts +0 -3
- package/build/sdk/utilities/json.util.mjs +0 -6
- package/build/sdk/utilities/parameters-arguments.util.d.ts +0 -2
- package/build/sdk/utilities/parameters-arguments.util.mjs +0 -0
- package/build/sdk/utilities/url.d.ts +0 -3
- package/build/sdk/utilities/url.mjs +0 -7
- package/build/sdk/utilities/utilities.util.d.ts +0 -6
- package/build/sdk/utilities/utilities.util.mjs +0 -8
- package/build/types/access-guards.d.ts +0 -6
- package/build/types/access-guards.mjs +0 -0
- package/build/types/application.mjs +0 -0
- package/build/types/artifact.d.ts +0 -21
- package/build/types/artifact.mjs +0 -0
- package/build/types/builder.d.ts +0 -32
- package/build/types/builder.mjs +0 -0
- package/build/types/config.d.ts +0 -6
- package/build/types/config.mjs +0 -0
- package/build/types/controller.d.ts +0 -25
- package/build/types/controller.mjs +0 -0
- package/build/types/contruct.d.ts +0 -3
- package/build/types/contruct.mjs +0 -0
- package/build/types/core.d.ts +0 -15
- package/build/types/core.mjs +0 -0
- package/build/types/data-transfer-object.d.ts +0 -5
- package/build/types/data-transfer-object.mjs +0 -0
- package/build/types/dependency-container.d.ts +0 -20
- package/build/types/dependency-container.mjs +0 -0
- package/build/types/directory.mjs +0 -0
- package/build/types/encryption.d.ts +0 -16
- package/build/types/encryption.mjs +0 -0
- package/build/types/generic.d.ts +0 -4
- package/build/types/generic.mjs +0 -0
- package/build/types/hmr.d.ts +0 -25
- package/build/types/hmr.mjs +0 -0
- package/build/types/http-responses.d.ts +0 -10
- package/build/types/http-responses.mjs +0 -0
- package/build/types/index.d.ts +0 -45
- package/build/types/index.mjs +0 -0
- package/build/types/middleware.d.ts +0 -12
- package/build/types/middleware.mjs +0 -0
- package/build/types/parameters.d.ts +0 -19
- package/build/types/parameters.mjs +0 -0
- package/build/types/parseable.d.ts +0 -5
- package/build/types/parseable.mjs +0 -0
- package/build/types/payload.d.ts +0 -6
- package/build/types/payload.mjs +0 -0
- package/build/types/plugin.d.ts +0 -20
- package/build/types/plugin.mjs +0 -0
- package/build/types/raiton.d.ts +0 -12
- package/build/types/raiton.mjs +0 -0
- package/build/types/repositories.d.ts +0 -8
- package/build/types/repositories.mjs +0 -0
- package/build/types/router.d.ts +0 -14
- package/build/types/router.mjs +0 -0
- package/build/types/runtime.d.ts +0 -37
- package/build/types/runtime.mjs +0 -0
- package/build/types/scheme.mjs +0 -0
- package/build/types/server.d.ts +0 -57
- package/build/types/server.mjs +0 -0
- package/build/types/services.d.ts +0 -8
- package/build/types/services.mjs +0 -0
- package/build/types/thread.d.ts +0 -24
- package/build/types/thread.mjs +0 -0
- package/build/types/utilities.d.ts +0 -6
- package/build/types/utilities.mjs +0 -0
- package/build/types/values.d.ts +0 -4
- package/build/types/values.mjs +0 -0
- /package/{build/chunk-4OWCGDUD.mjs → source/sdk/runtime/node/reply.ts} +0 -0
- /package/{build/chunk-DIWD7ZCJ.mjs → source/sdk/runtime/node/request.ts} +0 -0
package/build/chunk-O7R3NJQN.mjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// source/sdk/enums/encrypted.enum.ts
|
|
2
|
-
var HashAlgoEnum = /* @__PURE__ */ ((HashAlgoEnum2) => {
|
|
3
|
-
HashAlgoEnum2["ARGON2ID"] = "ARGON2ID";
|
|
4
|
-
HashAlgoEnum2["BCRYPT"] = "BCRYPT";
|
|
5
|
-
HashAlgoEnum2["PBKDF2"] = "PBKDF2";
|
|
6
|
-
HashAlgoEnum2["SCRYPT"] = "SCRYPT";
|
|
7
|
-
HashAlgoEnum2["SHA256"] = "SHA256";
|
|
8
|
-
HashAlgoEnum2["SHA512"] = "SHA512";
|
|
9
|
-
HashAlgoEnum2["MD5"] = "MD5";
|
|
10
|
-
HashAlgoEnum2["RIPEMD160"] = "RIPEMD160";
|
|
11
|
-
HashAlgoEnum2["BLAKE2B"] = "BLAKE2B";
|
|
12
|
-
HashAlgoEnum2["SHA3_256"] = "SHA3_256";
|
|
13
|
-
HashAlgoEnum2["SHA3_512"] = "SHA3_512";
|
|
14
|
-
return HashAlgoEnum2;
|
|
15
|
-
})(HashAlgoEnum || {});
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
HashAlgoEnum
|
|
19
|
-
};
|
package/build/chunk-P2YCCBFR.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// source/bin/cli.ts
|
|
2
|
-
import { Command } from "commander";
|
|
3
|
-
|
|
4
|
-
// package.json
|
|
5
|
-
var version = "0.1.0";
|
|
6
|
-
|
|
7
|
-
// source/bin/cli.ts
|
|
8
|
-
var CLI = new Command();
|
|
9
|
-
CLI.name("raiton").description("Protorians Raiton development kit for backend microservice").version(version);
|
|
10
|
-
var cli_default = CLI;
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
cli_default
|
|
14
|
-
};
|
package/build/chunk-P3IRIFPT.mjs
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// source/core/router/route.ts
|
|
2
|
-
var Route = class {
|
|
3
|
-
method;
|
|
4
|
-
path;
|
|
5
|
-
version;
|
|
6
|
-
handler;
|
|
7
|
-
parameters = {};
|
|
8
|
-
constructor(def) {
|
|
9
|
-
this.method = def.method;
|
|
10
|
-
this.path = def.path;
|
|
11
|
-
this.version = def.version;
|
|
12
|
-
this.handler = def.handler;
|
|
13
|
-
}
|
|
14
|
-
get params() {
|
|
15
|
-
const fullPath = this.version ? `/${this.version}${this.path}` : this.path;
|
|
16
|
-
const matches = fullPath.match(/:[a-zA-Z0-9_]+/g);
|
|
17
|
-
return matches ? matches.map((m) => m.substring(1)) : [];
|
|
18
|
-
}
|
|
19
|
-
get name() {
|
|
20
|
-
return this.handler.name;
|
|
21
|
-
}
|
|
22
|
-
extractParams(url) {
|
|
23
|
-
const fullPath = (this.version ? `/${this.version}${this.path}` : this.path).replace(/\/+$/, "");
|
|
24
|
-
const paramNames = this.params;
|
|
25
|
-
if (paramNames.length === 0) return this;
|
|
26
|
-
const regexPath = fullPath.replace(/:[a-zA-Z0-9_]+/g, "([^/]+)");
|
|
27
|
-
const regex = new RegExp(`^${regexPath || "/"}/?$`);
|
|
28
|
-
const matches = url.match(regex);
|
|
29
|
-
if (matches) {
|
|
30
|
-
const params = {};
|
|
31
|
-
paramNames.forEach((name, index) => {
|
|
32
|
-
params[name] = matches[index + 1];
|
|
33
|
-
});
|
|
34
|
-
this.parameters = params;
|
|
35
|
-
}
|
|
36
|
-
return this;
|
|
37
|
-
}
|
|
38
|
-
match(method, url) {
|
|
39
|
-
if (method !== this.method) return false;
|
|
40
|
-
const fullPath = (this.version ? `/${this.version}${this.path}` : this.path).replace(/\/+$/, "");
|
|
41
|
-
const cleanUrl = url.replace(/\/+$/, "");
|
|
42
|
-
if (!fullPath.includes(":")) {
|
|
43
|
-
return (fullPath || "/") === (cleanUrl || "/");
|
|
44
|
-
}
|
|
45
|
-
const regexPath = fullPath.replace(/:[a-zA-Z0-9_]+/g, "([^/]+)");
|
|
46
|
-
const regex = new RegExp(`^${regexPath || "/"}/?$`);
|
|
47
|
-
return regex.test(url);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export {
|
|
52
|
-
Route
|
|
53
|
-
};
|
package/build/chunk-QFSXFOEN.mjs
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// source/sdk/runtime/node/server.ts
|
|
2
|
-
import http from "http";
|
|
3
|
-
var nodeRuntime = {
|
|
4
|
-
createServer(handler) {
|
|
5
|
-
const server = http.createServer(async (req, res) => {
|
|
6
|
-
const runtimeReq = {
|
|
7
|
-
method: req.method || "GET",
|
|
8
|
-
url: req.url || "/",
|
|
9
|
-
headers: new Headers(req.headers),
|
|
10
|
-
body: req,
|
|
11
|
-
remoteAddress: req.socket.remoteAddress
|
|
12
|
-
};
|
|
13
|
-
const runtimeReply = {
|
|
14
|
-
status(code) {
|
|
15
|
-
res.statusCode = code;
|
|
16
|
-
},
|
|
17
|
-
header(name, value) {
|
|
18
|
-
res.setHeader(name, value);
|
|
19
|
-
},
|
|
20
|
-
send(body) {
|
|
21
|
-
if (body === void 0) {
|
|
22
|
-
res.end();
|
|
23
|
-
} else if (typeof body === "string" || Buffer.isBuffer(body)) {
|
|
24
|
-
res.end(body);
|
|
25
|
-
} else {
|
|
26
|
-
res.setHeader("content-type", "application/json");
|
|
27
|
-
res.end(JSON.stringify(body));
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
text(text) {
|
|
31
|
-
res.end(text);
|
|
32
|
-
},
|
|
33
|
-
json(json) {
|
|
34
|
-
res.end(JSON.stringify(json));
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
await handler(runtimeReq, runtimeReply);
|
|
38
|
-
});
|
|
39
|
-
return {
|
|
40
|
-
listen(port) {
|
|
41
|
-
return new Promise(
|
|
42
|
-
(resolve) => server.listen(port, resolve)
|
|
43
|
-
);
|
|
44
|
-
},
|
|
45
|
-
close() {
|
|
46
|
-
return new Promise(
|
|
47
|
-
(resolve, reject) => server.close((err) => err ? reject(err) : resolve())
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export {
|
|
55
|
-
nodeRuntime
|
|
56
|
-
};
|
package/build/chunk-QHCQ4AUA.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// source/sdk/constants/decorators.constant.ts
|
|
2
|
-
var SYSTEM_DECORATORS_KEYS = {
|
|
3
|
-
CONTROLLERS: /* @__PURE__ */ Symbol("controllers"),
|
|
4
|
-
ROUTES: /* @__PURE__ */ Symbol("routes"),
|
|
5
|
-
ROUTES_PARAMETERS: /* @__PURE__ */ Symbol("routes:parameters"),
|
|
6
|
-
ROUTES_METHODS: /* @__PURE__ */ Symbol("routes:methods"),
|
|
7
|
-
ROUTES_SCHEMES: /* @__PURE__ */ Symbol("routes:scheme:schemas"),
|
|
8
|
-
GRAFT: /* @__PURE__ */ Symbol("graft"),
|
|
9
|
-
ACCESS_GUARD: /* @__PURE__ */ Symbol("acces:guard")
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
SYSTEM_DECORATORS_KEYS
|
|
14
|
-
};
|
package/build/chunk-QI7OFSXB.mjs
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Raiton
|
|
3
|
-
} from "./chunk-YGIZFKLJ.mjs";
|
|
4
|
-
|
|
5
|
-
// source/core/config.ts
|
|
6
|
-
import path from "path";
|
|
7
|
-
import fs from "fs";
|
|
8
|
-
import { Logger } from "@protorians/logger";
|
|
9
|
-
var RaitonConfig = class {
|
|
10
|
-
static current = /* @__PURE__ */ new Map();
|
|
11
|
-
static get(key) {
|
|
12
|
-
return this.current.get(key);
|
|
13
|
-
}
|
|
14
|
-
static defaultConfig = {
|
|
15
|
-
rootDir: ".",
|
|
16
|
-
version: "0.0.1"
|
|
17
|
-
};
|
|
18
|
-
static load(workdir) {
|
|
19
|
-
try {
|
|
20
|
-
if (!this.current.size) {
|
|
21
|
-
const file = path.join(workdir, `${Raiton.identifier}.config.json`);
|
|
22
|
-
if (!fs.existsSync(file)) return this.current;
|
|
23
|
-
const configContent = fs.readFileSync(file, "utf-8");
|
|
24
|
-
for (const [key, value] of Object.entries({ ...this.defaultConfig, ...JSON.parse(configContent) || {} }))
|
|
25
|
-
this.current.set(key, value);
|
|
26
|
-
}
|
|
27
|
-
return this.current;
|
|
28
|
-
} catch (e) {
|
|
29
|
-
Logger.error(`Failed to load ${Raiton.identifier} config:`, e.message ?? e);
|
|
30
|
-
return this.current;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export {
|
|
36
|
-
RaitonConfig
|
|
37
|
-
};
|
package/build/chunk-RVH2YBNU.mjs
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
tryParseJson
|
|
3
|
-
} from "./chunk-MLFGBJDV.mjs";
|
|
4
|
-
|
|
5
|
-
// source/sdk/plugins/body-parser.plugin.ts
|
|
6
|
-
import { Logger } from "@protorians/logger";
|
|
7
|
-
function bodyParserPlugin() {
|
|
8
|
-
return {
|
|
9
|
-
name: "body-parser-plugin",
|
|
10
|
-
setup: (scope) => {
|
|
11
|
-
scope.use(async (ctx, next) => {
|
|
12
|
-
const contentType = ctx.req.headers.get("content-type") || "";
|
|
13
|
-
if (ctx.req.body && !ctx.state.bodyParsed) {
|
|
14
|
-
try {
|
|
15
|
-
const rawBody = await readRawBody(ctx.req.body);
|
|
16
|
-
const bodyString = decode(rawBody);
|
|
17
|
-
readQueryBody(ctx);
|
|
18
|
-
readJsonBody(ctx, contentType, bodyString);
|
|
19
|
-
readUrlEncodedBody(ctx, contentType, bodyString);
|
|
20
|
-
readTextBody(ctx, contentType, bodyString);
|
|
21
|
-
if (!ctx.state.bodyParsed) {
|
|
22
|
-
ctx.req.body = rawBody;
|
|
23
|
-
ctx.state.bodyParsed = true;
|
|
24
|
-
}
|
|
25
|
-
} catch (e) {
|
|
26
|
-
Logger.error("Error parsing body:", e);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
await next();
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
function readJsonBody(ctx, contentType, body) {
|
|
35
|
-
if (contentType.includes("application/json")) {
|
|
36
|
-
ctx.req.body = tryParseJson(body) || {};
|
|
37
|
-
ctx.state.bodyParsed = true;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function readUrlEncodedBody(ctx, contentType, body) {
|
|
41
|
-
if (contentType.includes("application/x-www-form-urlencoded")) {
|
|
42
|
-
const params = new URLSearchParams(body);
|
|
43
|
-
const record = {};
|
|
44
|
-
params.forEach((value, key) => {
|
|
45
|
-
record[key] = value;
|
|
46
|
-
});
|
|
47
|
-
ctx.req.body = record;
|
|
48
|
-
ctx.state.bodyParsed = true;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
function readTextBody(ctx, contentType, body) {
|
|
52
|
-
if (contentType.includes("text/")) {
|
|
53
|
-
ctx.req.body = body;
|
|
54
|
-
ctx.state.bodyParsed = true;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function readQueryBody(ctx) {
|
|
58
|
-
const searchParams = new URLSearchParams(ctx.req.url.split("?")[1] || "");
|
|
59
|
-
const record = {};
|
|
60
|
-
searchParams.forEach((value, key) => record[key] = value);
|
|
61
|
-
ctx.req.query = record;
|
|
62
|
-
}
|
|
63
|
-
async function readRawBody(body) {
|
|
64
|
-
if (body instanceof ReadableStream) {
|
|
65
|
-
const reader = body.getReader();
|
|
66
|
-
const chunks = [];
|
|
67
|
-
while (true) {
|
|
68
|
-
const { done, value } = await reader.read();
|
|
69
|
-
if (done) break;
|
|
70
|
-
chunks.push(value);
|
|
71
|
-
}
|
|
72
|
-
const totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0);
|
|
73
|
-
const result = new Uint8Array(totalLength);
|
|
74
|
-
let offset = 0;
|
|
75
|
-
for (const chunk of chunks) {
|
|
76
|
-
result.set(chunk, offset);
|
|
77
|
-
offset += chunk.length;
|
|
78
|
-
}
|
|
79
|
-
return result;
|
|
80
|
-
}
|
|
81
|
-
if (typeof body === "object" && body !== null && "on" in body && typeof body.on === "function") {
|
|
82
|
-
return new Promise((resolve, reject) => {
|
|
83
|
-
const chunks = [];
|
|
84
|
-
body.on("data", (chunk) => chunks.push(chunk));
|
|
85
|
-
body.on("end", () => {
|
|
86
|
-
if (chunks.length > 0 && typeof chunks[0] === "string") {
|
|
87
|
-
resolve(chunks.join(""));
|
|
88
|
-
} else {
|
|
89
|
-
const totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0);
|
|
90
|
-
const result = new Uint8Array(totalLength);
|
|
91
|
-
let offset = 0;
|
|
92
|
-
for (const chunk of chunks) {
|
|
93
|
-
result.set(new Uint8Array(chunk), offset);
|
|
94
|
-
offset += chunk.length;
|
|
95
|
-
}
|
|
96
|
-
resolve(result);
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
body.on("error", reject);
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
return body;
|
|
103
|
-
}
|
|
104
|
-
function decode(data) {
|
|
105
|
-
if (typeof data === "string") return data;
|
|
106
|
-
return new TextDecoder().decode(data);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export {
|
|
110
|
-
bodyParserPlugin
|
|
111
|
-
};
|
package/build/chunk-RXG7754R.mjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// source/sdk/utilities/callable.util.ts
|
|
2
|
-
import { LBadge, Logger } from "@protorians/logger";
|
|
3
|
-
async function retryCallable(label, callback, onFail, trying = 0, limit = 7) {
|
|
4
|
-
try {
|
|
5
|
-
Logger.info(
|
|
6
|
-
LBadge.debug(label || "Running"),
|
|
7
|
-
LBadge.info(trying),
|
|
8
|
-
LBadge.log(limit)
|
|
9
|
-
);
|
|
10
|
-
await callback();
|
|
11
|
-
} catch (e) {
|
|
12
|
-
Logger.info(
|
|
13
|
-
LBadge.debug("Trying"),
|
|
14
|
-
LBadge.info(trying),
|
|
15
|
-
LBadge.log(limit)
|
|
16
|
-
);
|
|
17
|
-
if (trying < limit)
|
|
18
|
-
setTimeout(() => retryCallable(label, callback, onFail, trying + 1, limit), 1e3);
|
|
19
|
-
else onFail?.(e);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
retryCallable
|
|
25
|
-
};
|
package/build/chunk-S3ONGVNZ.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// source/core/controller/metadata.ts
|
|
2
|
-
var META = /* @__PURE__ */ Symbol("controller:meta");
|
|
3
|
-
function getControllerMetadata(target) {
|
|
4
|
-
if (!target[META])
|
|
5
|
-
target[META] = { routes: [], params: {} };
|
|
6
|
-
return target[META];
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export {
|
|
10
|
-
getControllerMetadata
|
|
11
|
-
};
|
package/build/chunk-SRR4467I.mjs
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// source/core/context.ts
|
|
2
|
-
var RequestContext = class {
|
|
3
|
-
constructor(req, reply) {
|
|
4
|
-
this.req = req;
|
|
5
|
-
this.reply = reply;
|
|
6
|
-
}
|
|
7
|
-
state = {};
|
|
8
|
-
decorations = /* @__PURE__ */ new Map();
|
|
9
|
-
decorate(key, value) {
|
|
10
|
-
if (this.decorations.has(key)) {
|
|
11
|
-
throw new Error(`Decoration "${key}" already exists`);
|
|
12
|
-
}
|
|
13
|
-
this.decorations.set(key, value);
|
|
14
|
-
}
|
|
15
|
-
get(key) {
|
|
16
|
-
if (key in this.state) return this.state[key];
|
|
17
|
-
if (this.decorations.has(key)) {
|
|
18
|
-
return this.decorations.get(key);
|
|
19
|
-
}
|
|
20
|
-
throw new Error(`Context value "${key}" not found`);
|
|
21
|
-
}
|
|
22
|
-
send(body) {
|
|
23
|
-
this.reply.send(body);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
RequestContext
|
|
29
|
-
};
|
package/build/chunk-T6L55AUG.mjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
RaitonConfig
|
|
3
|
-
} from "./chunk-QI7OFSXB.mjs";
|
|
4
|
-
import {
|
|
5
|
-
Raiton
|
|
6
|
-
} from "./chunk-YGIZFKLJ.mjs";
|
|
7
|
-
|
|
8
|
-
// source/core/directories.ts
|
|
9
|
-
import path from "path";
|
|
10
|
-
var RaitonDirectories = class {
|
|
11
|
-
static index = `.${Raiton.identifier}`;
|
|
12
|
-
static bootstrapFile = "main.js";
|
|
13
|
-
static caches(workdir) {
|
|
14
|
-
return path.join(workdir, this.index, "caches");
|
|
15
|
-
}
|
|
16
|
-
static artifacts(workdir) {
|
|
17
|
-
return path.join(workdir, this.index, "artifacts");
|
|
18
|
-
}
|
|
19
|
-
static server(workdir) {
|
|
20
|
-
return path.join(workdir, this.index, "server");
|
|
21
|
-
}
|
|
22
|
-
static root(workdir) {
|
|
23
|
-
return path.join(workdir, this.index);
|
|
24
|
-
}
|
|
25
|
-
static app() {
|
|
26
|
-
return path.join(Raiton.thread.builder.workdir, RaitonConfig.get("rootDir"));
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export {
|
|
31
|
-
RaitonDirectories
|
|
32
|
-
};
|
package/build/chunk-TOJFTPAY.mjs
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
// source/core/hmr.ts
|
|
2
|
-
import { Logger } from "@protorians/logger";
|
|
3
|
-
var Hmr = class {
|
|
4
|
-
files = /* @__PURE__ */ new Map();
|
|
5
|
-
set(file, filename, size = 0) {
|
|
6
|
-
if (!filename.endsWith(".js")) return this;
|
|
7
|
-
this.files.set(file, {
|
|
8
|
-
filename,
|
|
9
|
-
size,
|
|
10
|
-
version: 1,
|
|
11
|
-
timestamp: Date.now()
|
|
12
|
-
});
|
|
13
|
-
return this;
|
|
14
|
-
}
|
|
15
|
-
clear() {
|
|
16
|
-
this.files.clear();
|
|
17
|
-
return this;
|
|
18
|
-
}
|
|
19
|
-
entries() {
|
|
20
|
-
return Object.fromEntries(this.files.entries());
|
|
21
|
-
}
|
|
22
|
-
has(key) {
|
|
23
|
-
return this.files.has(key);
|
|
24
|
-
}
|
|
25
|
-
async refresh() {
|
|
26
|
-
await this.each(async (file, key) => await this.upsert(key, file.filename));
|
|
27
|
-
return this;
|
|
28
|
-
}
|
|
29
|
-
async load(key) {
|
|
30
|
-
const file = this.files.get(key);
|
|
31
|
-
Logger.log("HMR", file);
|
|
32
|
-
const mod = file ? await import(`${file.filename}?t=${file.timestamp}&v=${file.version}`) : void 0;
|
|
33
|
-
return mod;
|
|
34
|
-
}
|
|
35
|
-
async reload(key) {
|
|
36
|
-
const file = this.files.get(key);
|
|
37
|
-
if (!file) return void 0;
|
|
38
|
-
file.version++;
|
|
39
|
-
file.timestamp = Date.now();
|
|
40
|
-
this.files.set(key, file);
|
|
41
|
-
return await import(`${file.filename}?t=${file.timestamp}&v=${file.version}`);
|
|
42
|
-
}
|
|
43
|
-
unset(key) {
|
|
44
|
-
this.files.delete(key);
|
|
45
|
-
return this;
|
|
46
|
-
}
|
|
47
|
-
size() {
|
|
48
|
-
return this.files.size;
|
|
49
|
-
}
|
|
50
|
-
async each(callable) {
|
|
51
|
-
await Promise.all([...this.files.entries()].map(async ([key, value]) => await callable(value, key, this.files)));
|
|
52
|
-
return this;
|
|
53
|
-
}
|
|
54
|
-
get(key) {
|
|
55
|
-
return this.files.get(key);
|
|
56
|
-
}
|
|
57
|
-
getEntries() {
|
|
58
|
-
return [...this.files.entries()];
|
|
59
|
-
}
|
|
60
|
-
getKeys() {
|
|
61
|
-
return [...this.files.keys()];
|
|
62
|
-
}
|
|
63
|
-
getValues() {
|
|
64
|
-
return [...this.files.values()];
|
|
65
|
-
}
|
|
66
|
-
async upsert(key, filename, size = 0) {
|
|
67
|
-
let file = this.files.get(key);
|
|
68
|
-
if (!file) {
|
|
69
|
-
this.set(key, filename);
|
|
70
|
-
file = this.files.get(key);
|
|
71
|
-
}
|
|
72
|
-
if (!file) return void 0;
|
|
73
|
-
if (file.size === size) return void 0;
|
|
74
|
-
file.version++;
|
|
75
|
-
file.timestamp = Date.now();
|
|
76
|
-
file.size = size;
|
|
77
|
-
return await this.set(key, filename, size).load(key);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export {
|
|
82
|
-
Hmr
|
|
83
|
-
};
|
package/build/chunk-UAPCBU3J.mjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// source/sdk/enums/runtime.enum.ts
|
|
2
|
-
var RuntimeType = /* @__PURE__ */ ((RuntimeType2) => {
|
|
3
|
-
RuntimeType2["Node"] = "node";
|
|
4
|
-
RuntimeType2["Deno"] = "deno";
|
|
5
|
-
RuntimeType2["Bun"] = "bun";
|
|
6
|
-
RuntimeType2["Web"] = "web";
|
|
7
|
-
return RuntimeType2;
|
|
8
|
-
})(RuntimeType || {});
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
RuntimeType
|
|
12
|
-
};
|
package/build/chunk-UCHBN3DV.mjs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// source/sdk/runtime/deno/server.ts
|
|
2
|
-
var denoRuntime = {
|
|
3
|
-
createServer(handler) {
|
|
4
|
-
let controller;
|
|
5
|
-
return {
|
|
6
|
-
async listen(port) {
|
|
7
|
-
if (typeof Deno === "undefined") throw new Error(
|
|
8
|
-
"Deno is not installed, please run `deno install -A -f --unstable https://deno.land/x/raiton/cli.ts`"
|
|
9
|
-
);
|
|
10
|
-
controller = new AbortController();
|
|
11
|
-
Deno.serve({ port, signal: controller.signal }, async (req) => {
|
|
12
|
-
let body;
|
|
13
|
-
let status = 200;
|
|
14
|
-
const headers = new Headers();
|
|
15
|
-
await handler(
|
|
16
|
-
{
|
|
17
|
-
method: req.method,
|
|
18
|
-
url: req.url,
|
|
19
|
-
headers: req.headers,
|
|
20
|
-
body: req.body
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
status(code) {
|
|
24
|
-
status = code;
|
|
25
|
-
},
|
|
26
|
-
header(name, value) {
|
|
27
|
-
headers.set(name, value);
|
|
28
|
-
},
|
|
29
|
-
send(value) {
|
|
30
|
-
body = value;
|
|
31
|
-
},
|
|
32
|
-
text(text) {
|
|
33
|
-
body = text;
|
|
34
|
-
},
|
|
35
|
-
json(json) {
|
|
36
|
-
body = JSON.stringify(json);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
return new Response(body, { status, headers });
|
|
41
|
-
});
|
|
42
|
-
},
|
|
43
|
-
async close() {
|
|
44
|
-
controller.abort();
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export {
|
|
51
|
-
denoRuntime
|
|
52
|
-
};
|
package/build/chunk-UWM46HLZ.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// source/core/bytes.util.ts
|
|
2
|
-
function parseBytes(bytes, decimals = 2) {
|
|
3
|
-
if (bytes === 0) return { size: 0, unit: "o" };
|
|
4
|
-
const k = 1024;
|
|
5
|
-
const units = ["o", "Ko", "Mo", "Go", "To"];
|
|
6
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
7
|
-
const size = parseFloat((bytes / Math.pow(k, i)).toFixed(decimals));
|
|
8
|
-
return { size, unit: units[i] };
|
|
9
|
-
}
|
|
10
|
-
function formatBytes(bytes, decimals = 2) {
|
|
11
|
-
const { size, unit } = parseBytes(bytes, decimals);
|
|
12
|
-
return `${size.toString().trim()}${unit.trim()}`;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
parseBytes,
|
|
17
|
-
formatBytes
|
|
18
|
-
};
|
package/build/chunk-UZFCGVHP.mjs
DELETED
package/build/chunk-VQINCGLQ.mjs
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// source/sdk/throwable.ts
|
|
2
|
-
import { LBadge, Logger } from "@protorians/logger";
|
|
3
|
-
import { EventBus, EventBusEnum } from "@protorians/events-bus";
|
|
4
|
-
var Throwable = class _Throwable extends Error {
|
|
5
|
-
constructor(message, statusCode = 500, label) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.statusCode = statusCode;
|
|
8
|
-
this.name = "Throwable";
|
|
9
|
-
if (label) Logger.debug(LBadge.debug(label), message);
|
|
10
|
-
EventBus.dispatch(EventBusEnum.SERVER_THROW, { error: this });
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Dispatches a system server error event and optionally throws an error.
|
|
14
|
-
*
|
|
15
|
-
* @param {string} message - The error message to be dispatched and potentially thrown.
|
|
16
|
-
* @param {boolean} [soft=true] - Determines whether the error should be thrown. If true, the error is only dispatched. If false, the error is dispatched and then thrown.
|
|
17
|
-
* @param statusCode
|
|
18
|
-
* @return {void} This method does not return a value.
|
|
19
|
-
*/
|
|
20
|
-
static error(message, soft = true, statusCode = 500) {
|
|
21
|
-
EventBus.dispatch(EventBusEnum.SERVER_ERROR, { message, soft });
|
|
22
|
-
if (!soft) throw new _Throwable(message, statusCode, "ERR");
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Emits a system server warning event and optionally throws an error based on the severity of the warning.
|
|
26
|
-
*
|
|
27
|
-
* @param {string} message - The warning message to be dispatched and possibly thrown as an error.
|
|
28
|
-
* @param {boolean} [soft=true] - Determines whether the warning should be treated as non-critical (soft). If false, an error is thrown.
|
|
29
|
-
* @param statusCode
|
|
30
|
-
* @return {void} This method does not return a value.
|
|
31
|
-
*/
|
|
32
|
-
static warning(message, soft = true, statusCode = 500) {
|
|
33
|
-
EventBus.dispatch(EventBusEnum.SERVER_WARNING, { message, soft });
|
|
34
|
-
if (!soft) throw new _Throwable(message, statusCode, "WRN");
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Triggers a critical system event, dispatching an alert message and terminating the process.
|
|
38
|
-
*
|
|
39
|
-
* @param {string} message - The critical error message to be dispatched with the event.
|
|
40
|
-
* @return {void} This method does not return a value as it terminates the process.
|
|
41
|
-
*/
|
|
42
|
-
static critical(message) {
|
|
43
|
-
Logger.debug(LBadge.debug("CRITICAL"), message);
|
|
44
|
-
EventBus.dispatch(EventBusEnum.SERVER_CRITICAL, { message });
|
|
45
|
-
process.exit(1);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var throwError = (message, soft = true, statusCode = 500) => Throwable.error(message, soft, statusCode);
|
|
49
|
-
var throwException = (message, statusCode = 500) => throwError(message, false, statusCode);
|
|
50
|
-
var throwWarning = (message, soft = true, statusCode = 500) => Throwable.warning(message, soft, statusCode);
|
|
51
|
-
var throwCritical = (message) => Throwable.critical(message);
|
|
52
|
-
|
|
53
|
-
export {
|
|
54
|
-
Throwable,
|
|
55
|
-
throwError,
|
|
56
|
-
throwException,
|
|
57
|
-
throwWarning,
|
|
58
|
-
throwCritical
|
|
59
|
-
};
|