raiton 1.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +97 -1
- package/build/bin/index.mjs +7012 -47
- package/deno.json +9 -0
- package/package.json +22 -43
- 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-BEV2YOPG.mjs +0 -14
- 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-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.0.0.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,21 +0,0 @@
|
|
|
1
|
-
import { Plugin } from '../../../types/plugin.js';
|
|
2
|
-
import '../../../core/plugins/scope.js';
|
|
3
|
-
import '../../../core/hooks.js';
|
|
4
|
-
import '../../../types/core.js';
|
|
5
|
-
import '../../../types/runtime.js';
|
|
6
|
-
import '../../enums/runtime.enum.js';
|
|
7
|
-
import '../../../core/middleware/pipeline.js';
|
|
8
|
-
import '../../../types/middleware.js';
|
|
9
|
-
import '../../../core/context.js';
|
|
10
|
-
import '../../../core/router/route.js';
|
|
11
|
-
import '../../../types/router.js';
|
|
12
|
-
import '../../enums/http.enum.js';
|
|
13
|
-
import '../../../core/router/router.js';
|
|
14
|
-
|
|
15
|
-
interface RateLimitOptions {
|
|
16
|
-
windowMs?: number;
|
|
17
|
-
max?: number;
|
|
18
|
-
}
|
|
19
|
-
declare const secureRateLimit: (opts?: RateLimitOptions) => Plugin;
|
|
20
|
-
|
|
21
|
-
export { type RateLimitOptions, secureRateLimit };
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
secureRateLimit
|
|
3
|
-
} from "../../../chunk-K4KLOLSO.mjs";
|
|
4
|
-
import "../../../chunk-RXG7754R.mjs";
|
|
5
|
-
import "../../../chunk-IOCHNQMF.mjs";
|
|
6
|
-
import "../../../chunk-M2RZZJQR.mjs";
|
|
7
|
-
import "../../../chunk-RVH2YBNU.mjs";
|
|
8
|
-
import "../../../chunk-MLFGBJDV.mjs";
|
|
9
|
-
import "../../../chunk-GPJSLV3Q.mjs";
|
|
10
|
-
import "../../../chunk-QFSXFOEN.mjs";
|
|
11
|
-
import "../../../chunk-JWNBO7XV.mjs";
|
|
12
|
-
import "../../../chunk-K4IQQ2KF.mjs";
|
|
13
|
-
import "../../../chunk-UCHBN3DV.mjs";
|
|
14
|
-
import "../../../chunk-VRL4S7UF.mjs";
|
|
15
|
-
import "../../../chunk-XW7EPAD7.mjs";
|
|
16
|
-
import "../../../chunk-QHCQ4AUA.mjs";
|
|
17
|
-
import "../../../chunk-YRVIAORI.mjs";
|
|
18
|
-
import "../../../chunk-UZFCGVHP.mjs";
|
|
19
|
-
import "../../../chunk-XIGE72LC.mjs";
|
|
20
|
-
import "../../../chunk-X3JFRRRQ.mjs";
|
|
21
|
-
import "../../../chunk-P3IRIFPT.mjs";
|
|
22
|
-
import "../../../chunk-S3ONGVNZ.mjs";
|
|
23
|
-
import "../../../chunk-DIWD7ZCJ.mjs";
|
|
24
|
-
import "../../../chunk-52JR26TI.mjs";
|
|
25
|
-
import "../../../chunk-JATYBWHL.mjs";
|
|
26
|
-
import "../../../chunk-VQINCGLQ.mjs";
|
|
27
|
-
import "../../../chunk-4OWCGDUD.mjs";
|
|
28
|
-
import "../../../chunk-YXU5W2CB.mjs";
|
|
29
|
-
import "../../../chunk-UAPCBU3J.mjs";
|
|
30
|
-
import "../../../chunk-O7R3NJQN.mjs";
|
|
31
|
-
import "../../../chunk-BYYJRCB4.mjs";
|
|
32
|
-
import "../../../chunk-FFRJ4AUA.mjs";
|
|
33
|
-
import "../../../chunk-3PWMRP6G.mjs";
|
|
34
|
-
import "../../../chunk-T6L55AUG.mjs";
|
|
35
|
-
import "../../../chunk-QI7OFSXB.mjs";
|
|
36
|
-
import "../../../chunk-TOJFTPAY.mjs";
|
|
37
|
-
import "../../../chunk-NB62GSFI.mjs";
|
|
38
|
-
import "../../../chunk-5LNOA4SK.mjs";
|
|
39
|
-
import "../../../chunk-YGIZFKLJ.mjs";
|
|
40
|
-
import "../../../chunk-UWM46HLZ.mjs";
|
|
41
|
-
import "../../../chunk-XFBLELHI.mjs";
|
|
42
|
-
import "../../../chunk-HVFHDVAH.mjs";
|
|
43
|
-
export {
|
|
44
|
-
secureRateLimit
|
|
45
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Throwable
|
|
3
|
-
} from "../chunk-VQINCGLQ.mjs";
|
|
4
|
-
|
|
5
|
-
// source/sdk/repositories.ts
|
|
6
|
-
var DelegateRepository = class {
|
|
7
|
-
client;
|
|
8
|
-
model;
|
|
9
|
-
supported(method) {
|
|
10
|
-
if (typeof this.model !== "object") throw new Throwable("Model not found, please check your repository");
|
|
11
|
-
else if (!(method in this.model)) throw new Throwable(`Method ${method} not found, please check your repository`);
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
DelegateRepository
|
|
17
|
-
};
|
package/build/sdk/request.d.ts
DELETED
package/build/sdk/request.mjs
DELETED
package/build/sdk/responses.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { IHttpResponse } from '../types/http-responses.js';
|
|
2
|
-
import { IParseableEntry } from '../types/parseable.js';
|
|
3
|
-
|
|
4
|
-
declare function httpResponse<T extends IParseableEntry>(statusCode: number, message?: string, data?: T, error?: any): IHttpResponse<T>;
|
|
5
|
-
declare function successResponse<T extends IParseableEntry>(message?: string, data?: T, error?: any): IHttpResponse<T>;
|
|
6
|
-
declare function errorResponse<T extends IParseableEntry>(message?: string, data?: T, error?: any): IHttpResponse<T>;
|
|
7
|
-
|
|
8
|
-
export { errorResponse, httpResponse, successResponse };
|
package/build/sdk/responses.mjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// source/sdk/responses.ts
|
|
2
|
-
function httpResponse(statusCode, message, data, error) {
|
|
3
|
-
return {
|
|
4
|
-
statusCode,
|
|
5
|
-
message,
|
|
6
|
-
data,
|
|
7
|
-
error
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
function successResponse(message, data, error) {
|
|
11
|
-
return httpResponse(200, message, data, error);
|
|
12
|
-
}
|
|
13
|
-
function errorResponse(message, data, error) {
|
|
14
|
-
return httpResponse(500, message, data, error);
|
|
15
|
-
}
|
|
16
|
-
export {
|
|
17
|
-
errorResponse,
|
|
18
|
-
httpResponse,
|
|
19
|
-
successResponse
|
|
20
|
-
};
|
package/build/sdk/routes.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as node_http from 'node:http';
|
|
2
|
-
import * as fastify from 'fastify';
|
|
3
|
-
import { FastifyInstance } from 'fastify';
|
|
4
|
-
|
|
5
|
-
declare function registryRoutes(app: FastifyInstance): Promise<FastifyInstance<fastify.RawServerDefault, node_http.IncomingMessage, node_http.ServerResponse<node_http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault>>;
|
|
6
|
-
|
|
7
|
-
export { registryRoutes };
|
package/build/sdk/routes.mjs
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import "../chunk-K4KLOLSO.mjs";
|
|
2
|
-
import "../chunk-RXG7754R.mjs";
|
|
3
|
-
import "../chunk-IOCHNQMF.mjs";
|
|
4
|
-
import "../chunk-M2RZZJQR.mjs";
|
|
5
|
-
import "../chunk-RVH2YBNU.mjs";
|
|
6
|
-
import "../chunk-MLFGBJDV.mjs";
|
|
7
|
-
import "../chunk-GPJSLV3Q.mjs";
|
|
8
|
-
import "../chunk-QFSXFOEN.mjs";
|
|
9
|
-
import "../chunk-JWNBO7XV.mjs";
|
|
10
|
-
import "../chunk-K4IQQ2KF.mjs";
|
|
11
|
-
import "../chunk-UCHBN3DV.mjs";
|
|
12
|
-
import {
|
|
13
|
-
aliasPath
|
|
14
|
-
} from "../chunk-VRL4S7UF.mjs";
|
|
15
|
-
import "../chunk-XW7EPAD7.mjs";
|
|
16
|
-
import "../chunk-QHCQ4AUA.mjs";
|
|
17
|
-
import "../chunk-YRVIAORI.mjs";
|
|
18
|
-
import "../chunk-UZFCGVHP.mjs";
|
|
19
|
-
import "../chunk-XIGE72LC.mjs";
|
|
20
|
-
import "../chunk-X3JFRRRQ.mjs";
|
|
21
|
-
import "../chunk-P3IRIFPT.mjs";
|
|
22
|
-
import "../chunk-S3ONGVNZ.mjs";
|
|
23
|
-
import "../chunk-DIWD7ZCJ.mjs";
|
|
24
|
-
import "../chunk-52JR26TI.mjs";
|
|
25
|
-
import "../chunk-JATYBWHL.mjs";
|
|
26
|
-
import "../chunk-VQINCGLQ.mjs";
|
|
27
|
-
import "../chunk-4OWCGDUD.mjs";
|
|
28
|
-
import "../chunk-YXU5W2CB.mjs";
|
|
29
|
-
import "../chunk-UAPCBU3J.mjs";
|
|
30
|
-
import "../chunk-O7R3NJQN.mjs";
|
|
31
|
-
import "../chunk-BYYJRCB4.mjs";
|
|
32
|
-
import "../chunk-FFRJ4AUA.mjs";
|
|
33
|
-
import "../chunk-3PWMRP6G.mjs";
|
|
34
|
-
import "../chunk-T6L55AUG.mjs";
|
|
35
|
-
import "../chunk-QI7OFSXB.mjs";
|
|
36
|
-
import "../chunk-TOJFTPAY.mjs";
|
|
37
|
-
import "../chunk-NB62GSFI.mjs";
|
|
38
|
-
import "../chunk-5LNOA4SK.mjs";
|
|
39
|
-
import "../chunk-YGIZFKLJ.mjs";
|
|
40
|
-
import "../chunk-UWM46HLZ.mjs";
|
|
41
|
-
import "../chunk-XFBLELHI.mjs";
|
|
42
|
-
import "../chunk-HVFHDVAH.mjs";
|
|
43
|
-
|
|
44
|
-
// source/sdk/routes.ts
|
|
45
|
-
import path from "path";
|
|
46
|
-
import * as fs from "fs";
|
|
47
|
-
async function registryRoutes(app) {
|
|
48
|
-
const dir = aliasPath("@/routes");
|
|
49
|
-
if (!dir || !fs.existsSync(dir)) return app;
|
|
50
|
-
const files = fs.readdirSync(dir);
|
|
51
|
-
for (const file of files) {
|
|
52
|
-
if (file.endsWith(".route.ts")) {
|
|
53
|
-
const route = await import(path.join(dir, file));
|
|
54
|
-
route.default(app);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return app;
|
|
58
|
-
}
|
|
59
|
-
export {
|
|
60
|
-
registryRoutes
|
|
61
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { RuntimeType } from '../enums/runtime.enum.js';
|
|
2
|
-
import { RuntimeInterface, RuntimeAdapter, RuntimeHandlerCallable, RuntimeServer } from '../../types/runtime.js';
|
|
3
|
-
|
|
4
|
-
declare class Runtime implements RuntimeInterface {
|
|
5
|
-
readonly type: RuntimeType;
|
|
6
|
-
constructor(type?: RuntimeType);
|
|
7
|
-
get isNode(): boolean;
|
|
8
|
-
get isDeno(): boolean;
|
|
9
|
-
get isWeb(): boolean;
|
|
10
|
-
get isBun(): boolean;
|
|
11
|
-
adapter(): RuntimeAdapter;
|
|
12
|
-
createServer(handler: RuntimeHandlerCallable): RuntimeServer;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { Runtime };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Runtime
|
|
3
|
-
} from "../../chunk-GPJSLV3Q.mjs";
|
|
4
|
-
import "../../chunk-QFSXFOEN.mjs";
|
|
5
|
-
import "../../chunk-JWNBO7XV.mjs";
|
|
6
|
-
import "../../chunk-K4IQQ2KF.mjs";
|
|
7
|
-
import "../../chunk-UCHBN3DV.mjs";
|
|
8
|
-
import "../../chunk-UAPCBU3J.mjs";
|
|
9
|
-
export {
|
|
10
|
-
Runtime
|
|
11
|
-
};
|
|
File without changes
|
|
File without changes
|
package/build/sdk/schemes.d.ts
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { TSchema, TProperties } from '@sinclair/typebox';
|
|
2
|
-
export * from '@sinclair/typebox';
|
|
3
|
-
import { IScheme, ISchemeConfig, ISchemeOptions } from '../types/scheme.js';
|
|
4
|
-
|
|
5
|
-
declare function scheme(): Scheme<undefined, undefined, undefined, undefined>;
|
|
6
|
-
/**
|
|
7
|
-
* A utility type for casting and inferring a type based on the provided `Schematic` generic structure.
|
|
8
|
-
* It checks if the given type `T` extends from the `Schematic` type and applies the inference logic
|
|
9
|
-
* defined by the `Schematic.infer` function. If the condition is not met, the type resolves to `never`.
|
|
10
|
-
*
|
|
11
|
-
* @template T - The generic type to evaluate and potentially infer from the `Schematic` structure.
|
|
12
|
-
*
|
|
13
|
-
* If `T` is an instance of `Schematic` with defined type parameters, this utility resolves to the
|
|
14
|
-
* result returned by the `Schematic.infer` method applied to `T`. Otherwise, it will resolve to `never`.
|
|
15
|
-
*/
|
|
16
|
-
type SchematicCast<T> = T extends Scheme<any, any, any, any> ? ReturnType<typeof Scheme.infer<T>> : never;
|
|
17
|
-
/**
|
|
18
|
-
* Represents a schema configuration that can be used with type-safe operations
|
|
19
|
-
* and is compatible with fastify route options.
|
|
20
|
-
*
|
|
21
|
-
* @template TBody - Optional schema type for the request body.
|
|
22
|
-
* @template TParams - Optional schema type for the route parameters.
|
|
23
|
-
* @template TQuery - Optional schema type for the query string parameters.
|
|
24
|
-
* @template TResponse - Optional schema type for the response, where each status code can have its own schema.
|
|
25
|
-
*/
|
|
26
|
-
declare class Scheme<TBody extends TSchema | undefined = undefined, TParams extends TSchema | undefined = undefined, TQuery extends TSchema | undefined = undefined, TResponse extends Record<number, TSchema> | undefined = undefined> implements IScheme<TBody, TParams, TQuery, TResponse> {
|
|
27
|
-
protected _$body?: TBody;
|
|
28
|
-
protected _$params?: TParams;
|
|
29
|
-
protected _$querystring?: TQuery;
|
|
30
|
-
protected _$response?: TResponse;
|
|
31
|
-
constructor(config: ISchemeConfig<TBody, TParams, TQuery, TResponse>);
|
|
32
|
-
/**
|
|
33
|
-
* Retrieves the current value of the $body property.
|
|
34
|
-
*
|
|
35
|
-
* @return {TBody | undefined} The value of the $body property, or undefined if it is not set.
|
|
36
|
-
*/
|
|
37
|
-
get $body(): TBody | undefined;
|
|
38
|
-
/**
|
|
39
|
-
* Adds or updates a key-value pair in the body object.
|
|
40
|
-
*
|
|
41
|
-
* @param {string} key - The key to set or update in the body object.
|
|
42
|
-
* @param {TProperties} value - The value to associate with the specified key.
|
|
43
|
-
* @return {this} The current instance with the updated body object.
|
|
44
|
-
*/
|
|
45
|
-
body(key: string, value: TProperties): this;
|
|
46
|
-
/**
|
|
47
|
-
* Retrieves the current value of the `$params` property.
|
|
48
|
-
*
|
|
49
|
-
* @return {TParams | undefined} The value of `$params` if set, otherwise undefined.
|
|
50
|
-
*/
|
|
51
|
-
get $params(): TParams | undefined;
|
|
52
|
-
/**
|
|
53
|
-
* Adds or updates a parameter with the specified key and value.
|
|
54
|
-
*
|
|
55
|
-
* @param {string} key - The key associated with the parameter to set or update.
|
|
56
|
-
* @param {TProperties} value - The value to associate with the specified key.
|
|
57
|
-
* @return {this} The current instance with the updated parameters.
|
|
58
|
-
*/
|
|
59
|
-
params(key: string, value: TProperties): this;
|
|
60
|
-
/**
|
|
61
|
-
* Retrieves the current query string.
|
|
62
|
-
*
|
|
63
|
-
* @return {TQuery | undefined} The query string object if available, otherwise undefined.
|
|
64
|
-
*/
|
|
65
|
-
get $querystring(): TQuery | undefined;
|
|
66
|
-
/**
|
|
67
|
-
* Updates the query string parameters by setting the specified key-value pair.
|
|
68
|
-
*
|
|
69
|
-
* @param {string} key - The key of the query string parameter to set or update.
|
|
70
|
-
* @param {TProperties} value - The value associated with the specified key.
|
|
71
|
-
* @return {this} The current instance of the class for method chaining.
|
|
72
|
-
*/
|
|
73
|
-
querystring(key: string, value: TProperties): this;
|
|
74
|
-
/**
|
|
75
|
-
* Retrieves the current response object.
|
|
76
|
-
*
|
|
77
|
-
* @return {TResponse | undefined} The response object if available; otherwise, undefined.
|
|
78
|
-
*/
|
|
79
|
-
get $response(): TResponse | undefined;
|
|
80
|
-
/**
|
|
81
|
-
* Adds or updates a response key-value pair in the internal response object.
|
|
82
|
-
*
|
|
83
|
-
* @param {number} key - The key to be added or updated in the response object.
|
|
84
|
-
* @param {TProperties} value - The value associated with the given key.
|
|
85
|
-
* @return {this} The current instance to allow method chaining.
|
|
86
|
-
*/
|
|
87
|
-
response(key: number, value: TProperties): this;
|
|
88
|
-
/**
|
|
89
|
-
* Generates a schema object for validating different parts of an HTTP request.
|
|
90
|
-
*
|
|
91
|
-
* @return {Object} An object containing the schema definitions for `body`, `params`, `querystring`, and `response`. Each property returns a corresponding schema object.
|
|
92
|
-
*/
|
|
93
|
-
schema(): ISchemeOptions<TBody, TParams, TQuery, TResponse>;
|
|
94
|
-
/**
|
|
95
|
-
* Infers and extracts static types from a given schema object.
|
|
96
|
-
*
|
|
97
|
-
* @param {T extends Schematic<any, any, any, any>} schema - The schema to infer types from. This should extend the Schematic type.
|
|
98
|
-
* @return {Object} An object containing inferred types including:
|
|
99
|
-
* - Body: The static type of the request body if defined in the schema, otherwise undefined.
|
|
100
|
-
* - Params: The static type of the request parameters if defined in the schema, otherwise undefined.
|
|
101
|
-
* - Query: The static type of the query string if defined in the schema, otherwise undefined.
|
|
102
|
-
* - Reply: The response type mappings if defined in the schema, otherwise undefined.
|
|
103
|
-
*/
|
|
104
|
-
static infer<T extends Scheme<any, any, any, any>>(schema: T): {
|
|
105
|
-
Body: (T["$body"] & {
|
|
106
|
-
params: [];
|
|
107
|
-
})["static"] | undefined;
|
|
108
|
-
Params: (T["$params"] & {
|
|
109
|
-
params: [];
|
|
110
|
-
})["static"] | undefined;
|
|
111
|
-
Query: (T["$querystring"] & {
|
|
112
|
-
params: [];
|
|
113
|
-
})["static"] | undefined;
|
|
114
|
-
Reply: { [K in keyof NonNullable<T["$response"]>]: (NonNullable<T["$response"]>[K] & {
|
|
115
|
-
params: [];
|
|
116
|
-
})["static"]; } | undefined;
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export { type SchematicCast, Scheme, scheme };
|
package/build/sdk/schemes.mjs
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
// source/sdk/schemes.ts
|
|
2
|
-
import { Type } from "@sinclair/typebox";
|
|
3
|
-
export * from "@sinclair/typebox";
|
|
4
|
-
function scheme() {
|
|
5
|
-
return new Scheme({});
|
|
6
|
-
}
|
|
7
|
-
var Scheme = class {
|
|
8
|
-
_$body;
|
|
9
|
-
_$params;
|
|
10
|
-
_$querystring;
|
|
11
|
-
_$response;
|
|
12
|
-
constructor(config) {
|
|
13
|
-
this._$body = config.body;
|
|
14
|
-
this._$params = config.params;
|
|
15
|
-
this._$querystring = config.querystring;
|
|
16
|
-
this._$response = config.response;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Retrieves the current value of the $body property.
|
|
20
|
-
*
|
|
21
|
-
* @return {TBody | undefined} The value of the $body property, or undefined if it is not set.
|
|
22
|
-
*/
|
|
23
|
-
get $body() {
|
|
24
|
-
return this._$body;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Adds or updates a key-value pair in the body object.
|
|
28
|
-
*
|
|
29
|
-
* @param {string} key - The key to set or update in the body object.
|
|
30
|
-
* @param {TProperties} value - The value to associate with the specified key.
|
|
31
|
-
* @return {this} The current instance with the updated body object.
|
|
32
|
-
*/
|
|
33
|
-
body(key, value) {
|
|
34
|
-
this._$body = { ...this._$body || {}, [key]: value };
|
|
35
|
-
return this;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Retrieves the current value of the `$params` property.
|
|
39
|
-
*
|
|
40
|
-
* @return {TParams | undefined} The value of `$params` if set, otherwise undefined.
|
|
41
|
-
*/
|
|
42
|
-
get $params() {
|
|
43
|
-
return this._$params;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Adds or updates a parameter with the specified key and value.
|
|
47
|
-
*
|
|
48
|
-
* @param {string} key - The key associated with the parameter to set or update.
|
|
49
|
-
* @param {TProperties} value - The value to associate with the specified key.
|
|
50
|
-
* @return {this} The current instance with the updated parameters.
|
|
51
|
-
*/
|
|
52
|
-
params(key, value) {
|
|
53
|
-
this._$params = { ...this._$params || {}, [key]: value };
|
|
54
|
-
return this;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Retrieves the current query string.
|
|
58
|
-
*
|
|
59
|
-
* @return {TQuery | undefined} The query string object if available, otherwise undefined.
|
|
60
|
-
*/
|
|
61
|
-
get $querystring() {
|
|
62
|
-
return this._$querystring;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Updates the query string parameters by setting the specified key-value pair.
|
|
66
|
-
*
|
|
67
|
-
* @param {string} key - The key of the query string parameter to set or update.
|
|
68
|
-
* @param {TProperties} value - The value associated with the specified key.
|
|
69
|
-
* @return {this} The current instance of the class for method chaining.
|
|
70
|
-
*/
|
|
71
|
-
querystring(key, value) {
|
|
72
|
-
this._$querystring = { ...this._$querystring || {}, [key]: value };
|
|
73
|
-
return this;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Retrieves the current response object.
|
|
77
|
-
*
|
|
78
|
-
* @return {TResponse | undefined} The response object if available; otherwise, undefined.
|
|
79
|
-
*/
|
|
80
|
-
get $response() {
|
|
81
|
-
return this._$response;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Adds or updates a response key-value pair in the internal response object.
|
|
85
|
-
*
|
|
86
|
-
* @param {number} key - The key to be added or updated in the response object.
|
|
87
|
-
* @param {TProperties} value - The value associated with the given key.
|
|
88
|
-
* @return {this} The current instance to allow method chaining.
|
|
89
|
-
*/
|
|
90
|
-
response(key, value) {
|
|
91
|
-
this._$response = { ...this._$response || {}, [key]: value };
|
|
92
|
-
return this;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Generates a schema object for validating different parts of an HTTP request.
|
|
96
|
-
*
|
|
97
|
-
* @return {Object} An object containing the schema definitions for `body`, `params`, `querystring`, and `response`. Each property returns a corresponding schema object.
|
|
98
|
-
*/
|
|
99
|
-
schema() {
|
|
100
|
-
const schema = {};
|
|
101
|
-
if (this._$body) schema.body = Type.Object(this._$body);
|
|
102
|
-
if (this._$params) schema.params = Type.Object(this._$params);
|
|
103
|
-
if (this._$querystring) schema.querystring = Type.Object(this._$querystring);
|
|
104
|
-
if (this._$response) schema.response = Type.Object(this._$response);
|
|
105
|
-
return schema;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Infers and extracts static types from a given schema object.
|
|
109
|
-
*
|
|
110
|
-
* @param {T extends Schematic<any, any, any, any>} schema - The schema to infer types from. This should extend the Schematic type.
|
|
111
|
-
* @return {Object} An object containing inferred types including:
|
|
112
|
-
* - Body: The static type of the request body if defined in the schema, otherwise undefined.
|
|
113
|
-
* - Params: The static type of the request parameters if defined in the schema, otherwise undefined.
|
|
114
|
-
* - Query: The static type of the query string if defined in the schema, otherwise undefined.
|
|
115
|
-
* - Reply: The response type mappings if defined in the schema, otherwise undefined.
|
|
116
|
-
*/
|
|
117
|
-
static infer(schema) {
|
|
118
|
-
return {
|
|
119
|
-
Body: schema._$body ? {} : void 0,
|
|
120
|
-
Params: schema._$params ? {} : void 0,
|
|
121
|
-
Query: schema._$querystring ? {} : void 0,
|
|
122
|
-
Reply: schema._$response ? schema._$response : void 0
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
export {
|
|
127
|
-
Scheme,
|
|
128
|
-
scheme
|
|
129
|
-
};
|
package/build/sdk/services.d.ts
DELETED
package/build/sdk/services.mjs
DELETED
package/build/sdk/throwable.mjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolves the provided pathname to its corresponding alias path based on the configured TypeScript paths and output directories.
|
|
3
|
-
*
|
|
4
|
-
* @param {string} pathname - The input path to resolve as per the alias configurations in the TypeScript configuration.
|
|
5
|
-
* @return {string | null} - The resolved alias path if it exists, or null if no matching alias is found.
|
|
6
|
-
*/
|
|
7
|
-
declare function aliasPath(pathname: string): string | null;
|
|
8
|
-
|
|
9
|
-
export { aliasPath };
|