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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {HttpMethod} from "@/sdk";
|
|
2
2
|
|
|
3
|
-
interface ApplicationConfig {
|
|
3
|
+
export interface ApplicationConfig {
|
|
4
4
|
workdir?: string;
|
|
5
5
|
hostname?: string;
|
|
6
6
|
port?: number;
|
|
@@ -10,21 +10,37 @@ interface ApplicationConfig {
|
|
|
10
10
|
develop?: boolean;
|
|
11
11
|
verbose?: boolean;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
export interface ApplicationInterface {
|
|
14
15
|
readonly config: ApplicationConfig;
|
|
16
|
+
|
|
15
17
|
get hostname(): string;
|
|
18
|
+
|
|
19
|
+
setOption<K extends keyof ApplicationConfig>(key: K, value: ApplicationConfig[K]): this;
|
|
20
|
+
|
|
21
|
+
setOptions(options: ApplicationConfig): this;
|
|
22
|
+
|
|
16
23
|
register(plugin: any): this;
|
|
24
|
+
|
|
17
25
|
use(mw: any): this;
|
|
18
|
-
|
|
26
|
+
|
|
27
|
+
route(method: HttpMethod, path: string, handler: any, version?: string): this
|
|
28
|
+
|
|
19
29
|
get(path: string, handler: any, version?: string): this;
|
|
30
|
+
|
|
20
31
|
post(path: string, handler: any, version?: string): this;
|
|
32
|
+
|
|
21
33
|
patch(path: string, handler: any, version?: string): this;
|
|
34
|
+
|
|
22
35
|
put(path: string, handler: any, version?: string): this;
|
|
36
|
+
|
|
23
37
|
delete(path: string, handler: any, version?: string): this;
|
|
38
|
+
|
|
24
39
|
options(path: string, handler: any, version?: string): this;
|
|
40
|
+
|
|
25
41
|
head(path: string, handler: any, version?: string): this;
|
|
42
|
+
|
|
26
43
|
trace(path: string, handler: any, version?: string): this;
|
|
27
|
-
handle(req: any, reply: any): Promise<any>;
|
|
28
|
-
}
|
|
29
44
|
|
|
30
|
-
|
|
45
|
+
handle(req: any, reply: any): Promise<any>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface ArtifactEntry {
|
|
2
|
+
id: string;
|
|
3
|
+
timestamp: Date;
|
|
4
|
+
size: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface ArtifactsConfig {
|
|
8
|
+
types: string[]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// export type ArtifactDecoratorHandler = () => void;
|
|
12
|
+
|
|
13
|
+
// export interface ArtifactDecorator {
|
|
14
|
+
// syntax: RegExp;
|
|
15
|
+
// handler: ArtifactDecoratorHandler;
|
|
16
|
+
// }
|
|
17
|
+
|
|
18
|
+
// export interface ArtifactOptions {
|
|
19
|
+
// readonly artifact: string;
|
|
20
|
+
// readonly provider: string;
|
|
21
|
+
// readonly decorator: ArtifactDecorator;
|
|
22
|
+
// verbose?: boolean;
|
|
23
|
+
// }
|
|
24
|
+
|
|
25
|
+
// export interface ArtifactInterface {
|
|
26
|
+
// readonly options: ArtifactOptions;
|
|
27
|
+
// readonly directory: string;
|
|
28
|
+
// readonly file: string;
|
|
29
|
+
// readonly workdir: string;
|
|
30
|
+
//
|
|
31
|
+
// get files(): string[];
|
|
32
|
+
//
|
|
33
|
+
// get extensions(): string[];
|
|
34
|
+
//
|
|
35
|
+
// scan(): string[];
|
|
36
|
+
//
|
|
37
|
+
// generate(): boolean;
|
|
38
|
+
// }
|
|
39
|
+
|
|
40
|
+
// export interface ArtifactEntry {
|
|
41
|
+
// vendor: string;
|
|
42
|
+
// decorator: string;
|
|
43
|
+
// pattern: string;
|
|
44
|
+
// }
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {WatchEventType} from "node:fs";
|
|
2
|
+
|
|
3
|
+
export interface BuildCommandOptions {
|
|
4
|
+
develop?: boolean;
|
|
5
|
+
bootstrap?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface BuilderConfig {
|
|
9
|
+
development?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type BuilderBootCallable = (builder: BuilderInterface) => Promise<void>
|
|
13
|
+
|
|
14
|
+
export interface BuilderInterface {
|
|
15
|
+
readonly workdir: string;
|
|
16
|
+
readonly options: BuilderConfig;
|
|
17
|
+
// readonly signal: ISignalStack<BuilderSignalMap>;
|
|
18
|
+
|
|
19
|
+
// get context(): BuildContext<BuildOptions> | null;
|
|
20
|
+
|
|
21
|
+
get source(): string | null;
|
|
22
|
+
|
|
23
|
+
get out(): string | null;
|
|
24
|
+
|
|
25
|
+
get bootstrapper(): string | null;
|
|
26
|
+
|
|
27
|
+
get bootstrapperFile(): string | null;
|
|
28
|
+
|
|
29
|
+
// get baseConfig(): BuildOptions;
|
|
30
|
+
|
|
31
|
+
prepare(): Promise<this>;
|
|
32
|
+
|
|
33
|
+
boot(): Promise<any>;
|
|
34
|
+
|
|
35
|
+
// start(callable?: BuilderBootCallable): Promise<this>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
export interface BuilderHMRDeclaration {
|
|
40
|
+
filename: string;
|
|
41
|
+
timestamp?: number;
|
|
42
|
+
version?: number;
|
|
43
|
+
type?: WatchEventType
|
|
44
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {HttpMethod, Parametrable} from "@/sdk/enums";
|
|
2
|
+
import {Context} from "@/types/core";
|
|
3
|
+
import {MiddlewareCallable, MiddlewareType} from "@/types/middleware";
|
|
4
|
+
|
|
5
|
+
export interface ControllerMetaInterface {
|
|
6
|
+
prefix?: string;
|
|
7
|
+
routes: RouteMetaInterface[];
|
|
8
|
+
middlewares: Record<string, MiddlewareCallable[]>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type ControllerDecoratorCallable = (metadata: ControllerMetaInterface) => void
|
|
12
|
+
|
|
13
|
+
export interface RouteMetaInterface {
|
|
14
|
+
method: HttpMethod;
|
|
15
|
+
path: string;
|
|
16
|
+
propertyKey: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ParamMetaInterface {
|
|
20
|
+
index: number;
|
|
21
|
+
type: Parametrable;
|
|
22
|
+
key?: string;
|
|
23
|
+
callable?: (ctx: Context) => any;
|
|
24
|
+
metatype?: any;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface RouteDecoratorParameters {
|
|
28
|
+
controller: ControllerMetaInterface;
|
|
29
|
+
route: RouteMetaInterface;
|
|
30
|
+
index: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type RouteDecoratorCallable = (parameters: RouteDecoratorParameters) => void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
RuntimeRequestInterface,
|
|
3
|
+
RuntimeReplyInterface
|
|
4
|
+
} from './runtime'
|
|
5
|
+
|
|
6
|
+
export type HookName =
|
|
7
|
+
| 'onRequest'
|
|
8
|
+
| 'preParsing'
|
|
9
|
+
| 'preHandler'
|
|
10
|
+
| 'onSend'
|
|
11
|
+
| 'onResponse'
|
|
12
|
+
|
|
13
|
+
export type HookHandler = (
|
|
14
|
+
ctx: Context
|
|
15
|
+
) => Promise<void> | void
|
|
16
|
+
|
|
17
|
+
export interface Context {
|
|
18
|
+
req: RuntimeRequestInterface
|
|
19
|
+
reply: RuntimeReplyInterface
|
|
20
|
+
|
|
21
|
+
state: Record<string, any>
|
|
22
|
+
|
|
23
|
+
decorate<T = any>(key: string, value: T): void
|
|
24
|
+
|
|
25
|
+
get<T = any>(key: string): T
|
|
26
|
+
|
|
27
|
+
send(body: any): void
|
|
28
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
export type IEncryptionResult = string;
|
|
3
|
+
|
|
4
|
+
export interface IDerivationOptions {
|
|
5
|
+
salt?: string; // hex string; if not provided, a random 16-byte salt will be generated
|
|
6
|
+
iterations?: number; // for PBKDF2
|
|
7
|
+
keylen?: number; // bytes length for derived key (default 64)
|
|
8
|
+
digest?: string; // for PBKDF2 digest (default 'sha512')
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface IScryptOptions {
|
|
12
|
+
salt?: string; // hex string; if not provided, a random 16-byte salt will be generated
|
|
13
|
+
keylen?: number; // bytes length for derived key (default 64)
|
|
14
|
+
cost?: number; // N parameter (default 16384)
|
|
15
|
+
blockSize?: number; // r parameter (default 8)
|
|
16
|
+
parallelization?: number; // p parameter (default 1)
|
|
17
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type * from "./config"
|
|
2
|
+
export type * from "./builder"
|
|
3
|
+
export type * from "./thread"
|
|
4
|
+
export type * from "./access-guards"
|
|
5
|
+
export type * from "./contruct"
|
|
6
|
+
export type * from "./directory"
|
|
7
|
+
export type * from "./encryption"
|
|
8
|
+
export type * from "./generic"
|
|
9
|
+
export type * from "./http-responses"
|
|
10
|
+
export type * from "./parseable"
|
|
11
|
+
export type * from "./scheme"
|
|
12
|
+
export type * from "./values"
|
|
13
|
+
export type * from "./utilities"
|
|
14
|
+
export type * from "./artifact"
|
|
15
|
+
export type * from "./middleware"
|
|
16
|
+
export type * from "./core"
|
|
17
|
+
export type * from "./plugin"
|
|
18
|
+
export type * from "./runtime"
|
|
19
|
+
export type * from "./router"
|
|
20
|
+
export type * from "./controller"
|
|
21
|
+
export type * from "./injection"
|
|
22
|
+
export type * from "./responses"
|
|
23
|
+
export type * from "./server"
|
|
24
|
+
export type * from "./raiton"
|
|
25
|
+
export type * from "./lifecycle"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {IConstructor} from "@/types/contruct";
|
|
2
|
+
import {LifetimeEnum} from "@protorians/core";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export interface ContainerDefinitionInterface<T = any> {
|
|
6
|
+
name: string;
|
|
7
|
+
construct: IConstructor<T>;
|
|
8
|
+
lifetime: LifetimeEnum;
|
|
9
|
+
instance?: any;
|
|
10
|
+
scope?: Symbol;
|
|
11
|
+
parameters?: any[];
|
|
12
|
+
properties?: Map<string | symbol, any>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {RequestContext} from "@/core/context";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export type NextCallable = () => Promise<void>
|
|
5
|
+
|
|
6
|
+
export interface MiddlewareSetupInterface {
|
|
7
|
+
setup: any,
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface MiddlewareParameters {
|
|
12
|
+
context: RequestContext;
|
|
13
|
+
next: NextCallable;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type MiddlewareCallable = (parameters: MiddlewareParameters) => Promise<any> | void
|
|
17
|
+
|
|
18
|
+
export type MiddlewareType = MiddlewareCallable | MiddlewareSetupInterface
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {HttpStatus} from "@/sdk/enums/http-status.enum";
|
|
2
|
+
|
|
3
|
+
export interface HttpResponseBaseInterface {
|
|
4
|
+
message: string;
|
|
5
|
+
statusCode?: HttpStatus;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface HttpResponseInterface<T = any> extends HttpResponseBaseInterface{
|
|
9
|
+
error?: boolean;
|
|
10
|
+
errorStack?: Error | ErrorResponseInterface[];
|
|
11
|
+
data?: T
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ErrorResponseInterface {
|
|
15
|
+
id: string;
|
|
16
|
+
message?: string;
|
|
17
|
+
code?: string;
|
|
18
|
+
statusCode?: HttpStatus;
|
|
19
|
+
error?: Error
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {RequestContext} from "@/core/context";
|
|
2
|
+
import {HttpMethod} from "@/sdk";
|
|
3
|
+
|
|
4
|
+
export type RouteHandler = (ctx: RequestContext) => Promise<any> | any
|
|
5
|
+
|
|
6
|
+
export interface RouteDefinition {
|
|
7
|
+
method: HttpMethod
|
|
8
|
+
path: string
|
|
9
|
+
version?: string
|
|
10
|
+
handler: RouteHandler
|
|
11
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {RuntimeType} from "@/sdk/enums/runtime.enum";
|
|
2
|
+
|
|
3
|
+
export interface RuntimeServerInterface {
|
|
4
|
+
listen(port: number, hostname?: string): Promise<void>
|
|
5
|
+
|
|
6
|
+
close(): Promise<void>
|
|
7
|
+
|
|
8
|
+
handle?(request: Request): Promise<Response>
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface RuntimeRequestInterface {
|
|
12
|
+
method: string
|
|
13
|
+
url: string
|
|
14
|
+
headers: Headers
|
|
15
|
+
body?: ReadableStream<Uint8Array> | Uint8Array | Record<string, any> | null;
|
|
16
|
+
query?: Record<string, any>
|
|
17
|
+
params?: Record<string, any>
|
|
18
|
+
file?: any
|
|
19
|
+
files?: any
|
|
20
|
+
remoteAddress?: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type RuntimeHandlerCallable = (req: RuntimeRequestInterface, reply: RuntimeReplyInterface) => Promise<void>
|
|
24
|
+
|
|
25
|
+
export interface RuntimeReplyInterface {
|
|
26
|
+
status(code: number): void
|
|
27
|
+
|
|
28
|
+
header(name: string, value: string): void
|
|
29
|
+
|
|
30
|
+
send(body: any): void
|
|
31
|
+
|
|
32
|
+
text(text: string | Buffer): void
|
|
33
|
+
|
|
34
|
+
json(data: any): void
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface RuntimeAdapterInterface {
|
|
38
|
+
createServer(handler: RuntimeHandlerCallable): RuntimeServerInterface
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
export interface RuntimeInterface {
|
|
43
|
+
readonly type: RuntimeType;
|
|
44
|
+
|
|
45
|
+
get isNode(): boolean;
|
|
46
|
+
|
|
47
|
+
get isDeno(): boolean;
|
|
48
|
+
|
|
49
|
+
get isWeb(): boolean;
|
|
50
|
+
|
|
51
|
+
get isBun(): boolean
|
|
52
|
+
|
|
53
|
+
adapter(): RuntimeAdapterInterface;
|
|
54
|
+
|
|
55
|
+
createServer(handler: RuntimeHandlerCallable): RuntimeServerInterface;
|
|
56
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {TObject, TProperties, TSchema} from "@sinclair/typebox";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
export interface ISchemePropertyOptions {
|
|
4
5
|
optional?: boolean;
|
|
5
6
|
}
|
|
7
|
+
|
|
6
8
|
/**
|
|
7
9
|
* The `ISchematic` interface provides a structured contract for managing and constructing schemas
|
|
8
10
|
* that define the shape of request bodies, parameters, query strings, and response structures.
|
|
@@ -13,13 +15,19 @@ interface ISchemePropertyOptions {
|
|
|
13
15
|
* @template TQuery The schema type defining the query string.
|
|
14
16
|
* @template TResponse The schema type defining the response structure, indexed by HTTP status codes.
|
|
15
17
|
*/
|
|
16
|
-
interface IScheme<
|
|
18
|
+
export interface IScheme<
|
|
19
|
+
TBody extends TSchema | undefined = undefined,
|
|
20
|
+
TParams extends TSchema | undefined = undefined,
|
|
21
|
+
TQuery extends TSchema | undefined = undefined,
|
|
22
|
+
TResponse extends Record<number, TSchema> | undefined = undefined
|
|
23
|
+
> {
|
|
17
24
|
/**
|
|
18
25
|
* Retrieves the value of the `$body` property.
|
|
19
26
|
*
|
|
20
27
|
* @return {TBody | undefined} The body content of type `TBody` or `undefined` if not set.
|
|
21
28
|
*/
|
|
22
29
|
get $body(): TBody | undefined;
|
|
30
|
+
|
|
23
31
|
/**
|
|
24
32
|
* Updates the body of the request with a specified key-value pair.
|
|
25
33
|
*
|
|
@@ -28,6 +36,7 @@ interface IScheme<TBody extends TSchema | undefined = undefined, TParams extends
|
|
|
28
36
|
* @return {this} The current instance to allow method chaining.
|
|
29
37
|
*/
|
|
30
38
|
body(key: string, value: TProperties): this;
|
|
39
|
+
|
|
31
40
|
/**
|
|
32
41
|
* Retrieves the current value of `$params`.
|
|
33
42
|
*
|
|
@@ -37,6 +46,7 @@ interface IScheme<TBody extends TSchema | undefined = undefined, TParams extends
|
|
|
37
46
|
* @return {TParams | undefined} The current parameters or undefined if none are set.
|
|
38
47
|
*/
|
|
39
48
|
get $params(): TParams | undefined;
|
|
49
|
+
|
|
40
50
|
/**
|
|
41
51
|
* Assigns a key-value pair to the parameters of the current instance.
|
|
42
52
|
*
|
|
@@ -45,12 +55,14 @@ interface IScheme<TBody extends TSchema | undefined = undefined, TParams extends
|
|
|
45
55
|
* @return {this} The current instance with the updated parameter.
|
|
46
56
|
*/
|
|
47
57
|
params(key: string, value: TProperties): this;
|
|
58
|
+
|
|
48
59
|
/**
|
|
49
60
|
* Retrieves the query string associated with the current object.
|
|
50
61
|
*
|
|
51
62
|
* @return {TQuery | undefined} The query string if defined, otherwise undefined.
|
|
52
63
|
*/
|
|
53
64
|
get $querystring(): TQuery | undefined;
|
|
65
|
+
|
|
54
66
|
/**
|
|
55
67
|
* Updates or sets a query string parameter with the specified key and value.
|
|
56
68
|
* If the query string already contains the key, its value will be updated.
|
|
@@ -60,12 +72,14 @@ interface IScheme<TBody extends TSchema | undefined = undefined, TParams extends
|
|
|
60
72
|
* @return {this} The current instance to allow for method chaining.
|
|
61
73
|
*/
|
|
62
74
|
querystring(key: string, value: TProperties): this;
|
|
75
|
+
|
|
63
76
|
/**
|
|
64
77
|
* Retrieves the response object associated with the instance.
|
|
65
78
|
*
|
|
66
79
|
* @return {TResponse | undefined} The response object if it exists, otherwise undefined.
|
|
67
80
|
*/
|
|
68
81
|
get $response(): TResponse | undefined;
|
|
82
|
+
|
|
69
83
|
/**
|
|
70
84
|
* Stores a key-value pair in the response object and returns the current instance for chaining.
|
|
71
85
|
*
|
|
@@ -74,6 +88,7 @@ interface IScheme<TBody extends TSchema | undefined = undefined, TParams extends
|
|
|
74
88
|
* @return {this} Returns the current instance to allow method chaining.
|
|
75
89
|
*/
|
|
76
90
|
response(key: number, value: TProperties): this;
|
|
91
|
+
|
|
77
92
|
/**
|
|
78
93
|
* Provides the schema options for handling the request and response structure.
|
|
79
94
|
*
|
|
@@ -81,6 +96,7 @@ interface IScheme<TBody extends TSchema | undefined = undefined, TParams extends
|
|
|
81
96
|
*/
|
|
82
97
|
schema(): ISchemeOptions<TBody, TParams, TQuery, TResponse>;
|
|
83
98
|
}
|
|
99
|
+
|
|
84
100
|
/**
|
|
85
101
|
* Interface representing the schema configuration for various aspects of a request-response process.
|
|
86
102
|
*
|
|
@@ -94,12 +110,18 @@ interface IScheme<TBody extends TSchema | undefined = undefined, TParams extends
|
|
|
94
110
|
* @property {TQuery} [querystring] Optional schema definition for query string parameters.
|
|
95
111
|
* @property {TResponse} [response] Optional schema definition for response objects, associated with HTTP status codes.
|
|
96
112
|
*/
|
|
97
|
-
interface ISchemeConfig<
|
|
113
|
+
export interface ISchemeConfig<
|
|
114
|
+
TBody extends TSchema | undefined = undefined,
|
|
115
|
+
TParams extends TSchema | undefined = undefined,
|
|
116
|
+
TQuery extends TSchema | undefined = undefined,
|
|
117
|
+
TResponse extends Record<number, TSchema> | undefined = undefined
|
|
118
|
+
> {
|
|
98
119
|
body?: TBody;
|
|
99
120
|
params?: TParams;
|
|
100
121
|
querystring?: TQuery;
|
|
101
122
|
response?: TResponse;
|
|
102
123
|
}
|
|
124
|
+
|
|
103
125
|
/**
|
|
104
126
|
* Interface representing schema options for defining request and response payloads
|
|
105
127
|
* in a structured and strongly-typed manner.
|
|
@@ -118,11 +140,14 @@ interface ISchemeConfig<TBody extends TSchema | undefined = undefined, TParams e
|
|
|
118
140
|
* @property response - Represents the schema definition for the response body, mapped by status code.
|
|
119
141
|
* This is an optional property and only applies if TResponse is specified.
|
|
120
142
|
*/
|
|
121
|
-
interface ISchemeOptions<
|
|
143
|
+
export interface ISchemeOptions<
|
|
144
|
+
TBody extends TSchema | undefined = undefined,
|
|
145
|
+
TParams extends TSchema | undefined = undefined,
|
|
146
|
+
TQuery extends TSchema | undefined = undefined,
|
|
147
|
+
TResponse extends Record<number, TSchema> | undefined = undefined
|
|
148
|
+
> {
|
|
122
149
|
body?: TObject<NonNullable<TBody>> | undefined;
|
|
123
150
|
params?: TObject<NonNullable<TParams>> | undefined;
|
|
124
151
|
querystring?: TObject<NonNullable<TQuery>> | undefined;
|
|
125
152
|
response?: TObject<NonNullable<TResponse>> | undefined;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export type { IScheme, ISchemeConfig, ISchemeOptions, ISchemePropertyOptions };
|
|
153
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {BuilderInterface} from "@/types/builder";
|
|
2
|
+
import {RuntimeAdapterInterface} from "@/types/runtime";
|
|
3
|
+
import {ApplicationInterface} from "@/types/application";
|
|
4
|
+
import {RuntimeType} from "@/sdk/enums/runtime.enum";
|
|
5
|
+
|
|
6
|
+
export interface ThreadSetupOptions {
|
|
7
|
+
application: ApplicationInterface;
|
|
8
|
+
runtime?: RuntimeType
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type ThreadWaitCallable = () => (boolean | Promise<boolean>)
|
|
12
|
+
|
|
13
|
+
export interface ThreadInterface {
|
|
14
|
+
readonly appDir: string;
|
|
15
|
+
readonly builder: BuilderInterface;
|
|
16
|
+
|
|
17
|
+
setup(options: ThreadSetupOptions): this
|
|
18
|
+
|
|
19
|
+
run(): Promise<this>;
|
|
20
|
+
|
|
21
|
+
restart(): void;
|
|
22
|
+
|
|
23
|
+
stop(): void;
|
|
24
|
+
|
|
25
|
+
sleep(milliseconds: number): Promise<unknown>;
|
|
26
|
+
|
|
27
|
+
wait(condition: ThreadWaitCallable): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
export interface ThreadOptions{}
|