@c9up/ream 0.1.3
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/LICENSE +21 -0
- package/README.md +70 -0
- package/dist/Application.d.ts +71 -0
- package/dist/Application.d.ts.map +1 -0
- package/dist/Application.js +151 -0
- package/dist/Application.js.map +1 -0
- package/dist/Codemods.d.ts +16 -0
- package/dist/Codemods.d.ts.map +1 -0
- package/dist/Codemods.js +277 -0
- package/dist/Codemods.js.map +1 -0
- package/dist/ConfigLoader.d.ts +29 -0
- package/dist/ConfigLoader.d.ts.map +1 -0
- package/dist/ConfigLoader.js +43 -0
- package/dist/ConfigLoader.js.map +1 -0
- package/dist/ErrorBoundary.d.ts +51 -0
- package/dist/ErrorBoundary.d.ts.map +1 -0
- package/dist/ErrorBoundary.js +122 -0
- package/dist/ErrorBoundary.js.map +1 -0
- package/dist/GracefulShutdown.d.ts +28 -0
- package/dist/GracefulShutdown.d.ts.map +1 -0
- package/dist/GracefulShutdown.js +55 -0
- package/dist/GracefulShutdown.js.map +1 -0
- package/dist/HealthCheck.d.ts +42 -0
- package/dist/HealthCheck.d.ts.map +1 -0
- package/dist/HealthCheck.js +65 -0
- package/dist/HealthCheck.js.map +1 -0
- package/dist/HotReload.d.ts +28 -0
- package/dist/HotReload.d.ts.map +1 -0
- package/dist/HotReload.js +60 -0
- package/dist/HotReload.js.map +1 -0
- package/dist/HttpKernel.d.ts +62 -0
- package/dist/HttpKernel.d.ts.map +1 -0
- package/dist/HttpKernel.js +210 -0
- package/dist/HttpKernel.js.map +1 -0
- package/dist/Ignitor.d.ts +195 -0
- package/dist/Ignitor.d.ts.map +1 -0
- package/dist/Ignitor.js +505 -0
- package/dist/Ignitor.js.map +1 -0
- package/dist/Provider.d.ts +54 -0
- package/dist/Provider.d.ts.map +1 -0
- package/dist/Provider.js +37 -0
- package/dist/Provider.js.map +1 -0
- package/dist/bodyparser/BodyParserMiddleware.d.ts +38 -0
- package/dist/bodyparser/BodyParserMiddleware.d.ts.map +1 -0
- package/dist/bodyparser/BodyParserMiddleware.js +143 -0
- package/dist/bodyparser/BodyParserMiddleware.js.map +1 -0
- package/dist/bodyparser/MultipartFile.d.ts +77 -0
- package/dist/bodyparser/MultipartFile.d.ts.map +1 -0
- package/dist/bodyparser/MultipartFile.js +138 -0
- package/dist/bodyparser/MultipartFile.js.map +1 -0
- package/dist/bodyparser/parseSize.d.ts +6 -0
- package/dist/bodyparser/parseSize.d.ts.map +1 -0
- package/dist/bodyparser/parseSize.js +21 -0
- package/dist/bodyparser/parseSize.js.map +1 -0
- package/dist/bootstrap/hyper-server.d.ts +27 -0
- package/dist/bootstrap/hyper-server.d.ts.map +1 -0
- package/dist/bootstrap/hyper-server.js +63 -0
- package/dist/bootstrap/hyper-server.js.map +1 -0
- package/dist/console/CommandRunner.d.ts +18 -0
- package/dist/console/CommandRunner.d.ts.map +1 -0
- package/dist/console/CommandRunner.js +65 -0
- package/dist/console/CommandRunner.js.map +1 -0
- package/dist/container/Container.d.ts +60 -0
- package/dist/container/Container.d.ts.map +1 -0
- package/dist/container/Container.js +329 -0
- package/dist/container/Container.js.map +1 -0
- package/dist/container/types.d.ts +25 -0
- package/dist/container/types.d.ts.map +1 -0
- package/dist/container/types.js +6 -0
- package/dist/container/types.js.map +1 -0
- package/dist/decorators/Lazy.d.ts +19 -0
- package/dist/decorators/Lazy.d.ts.map +1 -0
- package/dist/decorators/Lazy.js +53 -0
- package/dist/decorators/Lazy.js.map +1 -0
- package/dist/decorators/Service.d.ts +48 -0
- package/dist/decorators/Service.d.ts.map +1 -0
- package/dist/decorators/Service.js +70 -0
- package/dist/decorators/Service.js.map +1 -0
- package/dist/errors/FuzzyMatcher.d.ts +41 -0
- package/dist/errors/FuzzyMatcher.d.ts.map +1 -0
- package/dist/errors/FuzzyMatcher.js +81 -0
- package/dist/errors/FuzzyMatcher.js.map +1 -0
- package/dist/errors/ModuleErrors.d.ts +41 -0
- package/dist/errors/ModuleErrors.d.ts.map +1 -0
- package/dist/errors/ModuleErrors.js +65 -0
- package/dist/errors/ModuleErrors.js.map +1 -0
- package/dist/errors/PipelineStageError.d.ts +31 -0
- package/dist/errors/PipelineStageError.d.ts.map +1 -0
- package/dist/errors/PipelineStageError.js +77 -0
- package/dist/errors/PipelineStageError.js.map +1 -0
- package/dist/errors/ReamError.d.ts +50 -0
- package/dist/errors/ReamError.d.ts.map +1 -0
- package/dist/errors/ReamError.js +108 -0
- package/dist/errors/ReamError.js.map +1 -0
- package/dist/events/Emitter.d.ts +124 -0
- package/dist/events/Emitter.d.ts.map +1 -0
- package/dist/events/Emitter.js +271 -0
- package/dist/events/Emitter.js.map +1 -0
- package/dist/events/EventsProvider.d.ts +28 -0
- package/dist/events/EventsProvider.d.ts.map +1 -0
- package/dist/events/EventsProvider.js +36 -0
- package/dist/events/EventsProvider.js.map +1 -0
- package/dist/events/config.d.ts +8 -0
- package/dist/events/config.d.ts.map +1 -0
- package/dist/events/config.js +4 -0
- package/dist/events/config.js.map +1 -0
- package/dist/events/configure.d.ts +10 -0
- package/dist/events/configure.d.ts.map +1 -0
- package/dist/events/configure.js +11 -0
- package/dist/events/configure.js.map +1 -0
- package/dist/events/helix/helpers.d.ts +62 -0
- package/dist/events/helix/helpers.d.ts.map +1 -0
- package/dist/events/helix/helpers.js +187 -0
- package/dist/events/helix/helpers.js.map +1 -0
- package/dist/events/index.d.ts +17 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +15 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/native.d.ts +21 -0
- package/dist/events/native.d.ts.map +1 -0
- package/dist/events/native.js +17 -0
- package/dist/events/native.js.map +1 -0
- package/dist/events/services/main.d.ts +18 -0
- package/dist/events/services/main.d.ts.map +1 -0
- package/dist/events/services/main.js +31 -0
- package/dist/events/services/main.js.map +1 -0
- package/dist/events/testing/FakeBus.d.ts +66 -0
- package/dist/events/testing/FakeBus.d.ts.map +1 -0
- package/dist/events/testing/FakeBus.js +356 -0
- package/dist/events/testing/FakeBus.js.map +1 -0
- package/dist/graphql/GraphQLEngine.d.ts +69 -0
- package/dist/graphql/GraphQLEngine.d.ts.map +1 -0
- package/dist/graphql/GraphQLEngine.js +309 -0
- package/dist/graphql/GraphQLEngine.js.map +1 -0
- package/dist/graphql/GraphQLProvider.d.ts +32 -0
- package/dist/graphql/GraphQLProvider.d.ts.map +1 -0
- package/dist/graphql/GraphQLProvider.js +49 -0
- package/dist/graphql/GraphQLProvider.js.map +1 -0
- package/dist/helpers/base64.d.ts +40 -0
- package/dist/helpers/base64.d.ts.map +1 -0
- package/dist/helpers/base64.js +70 -0
- package/dist/helpers/base64.js.map +1 -0
- package/dist/helpers/index.d.ts +7 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +5 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/is.d.ts +101 -0
- package/dist/helpers/is.d.ts.map +1 -0
- package/dist/helpers/is.js +151 -0
- package/dist/helpers/is.js.map +1 -0
- package/dist/helpers/napi-loader.d.ts +46 -0
- package/dist/helpers/napi-loader.d.ts.map +1 -0
- package/dist/helpers/napi-loader.js +69 -0
- package/dist/helpers/napi-loader.js.map +1 -0
- package/dist/helpers/safeEqual.d.ts +9 -0
- package/dist/helpers/safeEqual.d.ts.map +1 -0
- package/dist/helpers/safeEqual.js +16 -0
- package/dist/helpers/safeEqual.js.map +1 -0
- package/dist/helpers/string.d.ts +161 -0
- package/dist/helpers/string.d.ts.map +1 -0
- package/dist/helpers/string.js +429 -0
- package/dist/helpers/string.js.map +1 -0
- package/dist/helpers/types.d.ts +83 -0
- package/dist/helpers/types.d.ts.map +1 -0
- package/dist/helpers/types.js +6 -0
- package/dist/helpers/types.js.map +1 -0
- package/dist/http/Exception.d.ts +103 -0
- package/dist/http/Exception.d.ts.map +1 -0
- package/dist/http/Exception.js +228 -0
- package/dist/http/Exception.js.map +1 -0
- package/dist/http/HttpContext.d.ts +69 -0
- package/dist/http/HttpContext.d.ts.map +1 -0
- package/dist/http/HttpContext.js +55 -0
- package/dist/http/HttpContext.js.map +1 -0
- package/dist/http/RedirectBuilder.d.ts +31 -0
- package/dist/http/RedirectBuilder.d.ts.map +1 -0
- package/dist/http/RedirectBuilder.js +75 -0
- package/dist/http/RedirectBuilder.js.map +1 -0
- package/dist/http/Request.d.ts +160 -0
- package/dist/http/Request.d.ts.map +1 -0
- package/dist/http/Request.js +484 -0
- package/dist/http/Request.js.map +1 -0
- package/dist/http/Response.d.ts +114 -0
- package/dist/http/Response.d.ts.map +1 -0
- package/dist/http/Response.js +303 -0
- package/dist/http/Response.js.map +1 -0
- package/dist/http/SseStream.d.ts +89 -0
- package/dist/http/SseStream.d.ts.map +1 -0
- package/dist/http/SseStream.js +228 -0
- package/dist/http/SseStream.js.map +1 -0
- package/dist/http/urlDecode.d.ts +8 -0
- package/dist/http/urlDecode.d.ts.map +1 -0
- package/dist/http/urlDecode.js +18 -0
- package/dist/http/urlDecode.js.map +1 -0
- package/dist/index.d.ts +92 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +67 -0
- package/dist/index.js.map +1 -0
- package/dist/middleware/Pipeline.d.ts +36 -0
- package/dist/middleware/Pipeline.d.ts.map +1 -0
- package/dist/middleware/Pipeline.js +104 -0
- package/dist/middleware/Pipeline.js.map +1 -0
- package/dist/openapi/OpenApiGenerator.d.ts +58 -0
- package/dist/openapi/OpenApiGenerator.d.ts.map +1 -0
- package/dist/openapi/OpenApiGenerator.js +192 -0
- package/dist/openapi/OpenApiGenerator.js.map +1 -0
- package/dist/openapi/OpenApiMiddleware.d.ts +24 -0
- package/dist/openapi/OpenApiMiddleware.d.ts.map +1 -0
- package/dist/openapi/OpenApiMiddleware.js +78 -0
- package/dist/openapi/OpenApiMiddleware.js.map +1 -0
- package/dist/openapi/OpenApiProvider.d.ts +36 -0
- package/dist/openapi/OpenApiProvider.d.ts.map +1 -0
- package/dist/openapi/OpenApiProvider.js +42 -0
- package/dist/openapi/OpenApiProvider.js.map +1 -0
- package/dist/resources/ApiResource.d.ts +45 -0
- package/dist/resources/ApiResource.d.ts.map +1 -0
- package/dist/resources/ApiResource.js +58 -0
- package/dist/resources/ApiResource.js.map +1 -0
- package/dist/router/Router.d.ts +205 -0
- package/dist/router/Router.d.ts.map +1 -0
- package/dist/router/Router.js +552 -0
- package/dist/router/Router.js.map +1 -0
- package/dist/rpc/RpcProvider.d.ts +34 -0
- package/dist/rpc/RpcProvider.d.ts.map +1 -0
- package/dist/rpc/RpcProvider.js +37 -0
- package/dist/rpc/RpcProvider.js.map +1 -0
- package/dist/rpc/RpcRouter.d.ts +61 -0
- package/dist/rpc/RpcRouter.d.ts.map +1 -0
- package/dist/rpc/RpcRouter.js +187 -0
- package/dist/rpc/RpcRouter.js.map +1 -0
- package/dist/scheduler/Schedule.d.ts +53 -0
- package/dist/scheduler/Schedule.d.ts.map +1 -0
- package/dist/scheduler/Schedule.js +76 -0
- package/dist/scheduler/Schedule.js.map +1 -0
- package/dist/scheduler/ScheduleProvider.d.ts +56 -0
- package/dist/scheduler/ScheduleProvider.d.ts.map +1 -0
- package/dist/scheduler/ScheduleProvider.js +145 -0
- package/dist/scheduler/ScheduleProvider.js.map +1 -0
- package/dist/scheduler/Scheduler.d.ts +209 -0
- package/dist/scheduler/Scheduler.d.ts.map +1 -0
- package/dist/scheduler/Scheduler.js +432 -0
- package/dist/scheduler/Scheduler.js.map +1 -0
- package/dist/scheduler/index.d.ts +14 -0
- package/dist/scheduler/index.d.ts.map +1 -0
- package/dist/scheduler/index.js +6 -0
- package/dist/scheduler/index.js.map +1 -0
- package/dist/scheduler/locks/LockBackend.d.ts +37 -0
- package/dist/scheduler/locks/LockBackend.d.ts.map +1 -0
- package/dist/scheduler/locks/LockBackend.js +13 -0
- package/dist/scheduler/locks/LockBackend.js.map +1 -0
- package/dist/scheduler/locks/MemoryLockBackend.d.ts +39 -0
- package/dist/scheduler/locks/MemoryLockBackend.d.ts.map +1 -0
- package/dist/scheduler/locks/MemoryLockBackend.js +71 -0
- package/dist/scheduler/locks/MemoryLockBackend.js.map +1 -0
- package/dist/scheduler/observability/ErrorReporter.d.ts +15 -0
- package/dist/scheduler/observability/ErrorReporter.d.ts.map +1 -0
- package/dist/scheduler/observability/ErrorReporter.js +13 -0
- package/dist/scheduler/observability/ErrorReporter.js.map +1 -0
- package/dist/scheduler/observability/ScheduleEvent.d.ts +57 -0
- package/dist/scheduler/observability/ScheduleEvent.d.ts.map +1 -0
- package/dist/scheduler/observability/ScheduleEvent.js +12 -0
- package/dist/scheduler/observability/ScheduleEvent.js.map +1 -0
- package/dist/scheduler/observability/ScheduleEventSink.d.ts +20 -0
- package/dist/scheduler/observability/ScheduleEventSink.d.ts.map +1 -0
- package/dist/scheduler/observability/ScheduleEventSink.js +17 -0
- package/dist/scheduler/observability/ScheduleEventSink.js.map +1 -0
- package/dist/scheduler/observability/StatsTracker.d.ts +50 -0
- package/dist/scheduler/observability/StatsTracker.d.ts.map +1 -0
- package/dist/scheduler/observability/StatsTracker.js +96 -0
- package/dist/scheduler/observability/StatsTracker.js.map +1 -0
- package/dist/security/CookieSigner.d.ts +13 -0
- package/dist/security/CookieSigner.d.ts.map +1 -0
- package/dist/security/CookieSigner.js +51 -0
- package/dist/security/CookieSigner.js.map +1 -0
- package/dist/security/SignedUrl.d.ts +17 -0
- package/dist/security/SignedUrl.d.ts.map +1 -0
- package/dist/security/SignedUrl.js +63 -0
- package/dist/security/SignedUrl.js.map +1 -0
- package/dist/security/crypto.d.ts +25 -0
- package/dist/security/crypto.d.ts.map +1 -0
- package/dist/security/crypto.js +82 -0
- package/dist/security/crypto.js.map +1 -0
- package/dist/server/HyperServer.d.ts +64 -0
- package/dist/server/HyperServer.d.ts.map +1 -0
- package/dist/server/HyperServer.js +54 -0
- package/dist/server/HyperServer.js.map +1 -0
- package/dist/server/Server.d.ts +68 -0
- package/dist/server/Server.d.ts.map +1 -0
- package/dist/server/Server.js +113 -0
- package/dist/server/Server.js.map +1 -0
- package/dist/services/app.d.ts +14 -0
- package/dist/services/app.d.ts.map +1 -0
- package/dist/services/app.js +27 -0
- package/dist/services/app.js.map +1 -0
- package/dist/services/router.d.ts +21 -0
- package/dist/services/router.d.ts.map +1 -0
- package/dist/services/router.js +36 -0
- package/dist/services/router.js.map +1 -0
- package/dist/services/server.d.ts +16 -0
- package/dist/services/server.d.ts.map +1 -0
- package/dist/services/server.js +32 -0
- package/dist/services/server.js.map +1 -0
- package/dist/session/Session.d.ts +88 -0
- package/dist/session/Session.d.ts.map +1 -0
- package/dist/session/Session.js +186 -0
- package/dist/session/Session.js.map +1 -0
- package/dist/session/SessionMiddleware.d.ts +16 -0
- package/dist/session/SessionMiddleware.d.ts.map +1 -0
- package/dist/session/SessionMiddleware.js +132 -0
- package/dist/session/SessionMiddleware.js.map +1 -0
- package/dist/session/drivers/CookieDriver.d.ts +17 -0
- package/dist/session/drivers/CookieDriver.d.ts.map +1 -0
- package/dist/session/drivers/CookieDriver.js +42 -0
- package/dist/session/drivers/CookieDriver.js.map +1 -0
- package/dist/session/drivers/MemoryDriver.d.ts +9 -0
- package/dist/session/drivers/MemoryDriver.d.ts.map +1 -0
- package/dist/session/drivers/MemoryDriver.js +24 -0
- package/dist/session/drivers/MemoryDriver.js.map +1 -0
- package/dist/storage/S3Driver.d.ts +27 -0
- package/dist/storage/S3Driver.d.ts.map +1 -0
- package/dist/storage/S3Driver.js +135 -0
- package/dist/storage/S3Driver.js.map +1 -0
- package/dist/storage/StaticMiddleware.d.ts +27 -0
- package/dist/storage/StaticMiddleware.d.ts.map +1 -0
- package/dist/storage/StaticMiddleware.js +153 -0
- package/dist/storage/StaticMiddleware.js.map +1 -0
- package/dist/storage/StaticProvider.d.ts +26 -0
- package/dist/storage/StaticProvider.d.ts.map +1 -0
- package/dist/storage/StaticProvider.js +31 -0
- package/dist/storage/StaticProvider.js.map +1 -0
- package/dist/storage/StorageManager.d.ts +31 -0
- package/dist/storage/StorageManager.d.ts.map +1 -0
- package/dist/storage/StorageManager.js +120 -0
- package/dist/storage/StorageManager.js.map +1 -0
- package/dist/testing/RequestBuilder.d.ts +67 -0
- package/dist/testing/RequestBuilder.d.ts.map +1 -0
- package/dist/testing/RequestBuilder.js +202 -0
- package/dist/testing/RequestBuilder.js.map +1 -0
- package/dist/testing/TestClient.d.ts +96 -0
- package/dist/testing/TestClient.d.ts.map +1 -0
- package/dist/testing/TestClient.js +263 -0
- package/dist/testing/TestClient.js.map +1 -0
- package/dist/types/helpers.d.ts +47 -0
- package/dist/types/helpers.d.ts.map +1 -0
- package/dist/types/helpers.js +5 -0
- package/dist/types/helpers.js.map +1 -0
- package/events.darwin-arm64.node +0 -0
- package/events.darwin-x64.node +0 -0
- package/events.linux-arm64-gnu.node +0 -0
- package/events.linux-x64-gnu.node +0 -0
- package/events.win32-x64-msvc.node +0 -0
- package/index.darwin-arm64.node +0 -0
- package/index.darwin-x64.node +0 -0
- package/index.linux-arm64-gnu.node +0 -0
- package/index.linux-x64-gnu.node +0 -0
- package/index.win32-x64-msvc.node +0 -0
- package/package.json +106 -0
- package/scheduler.darwin-arm64.node +0 -0
- package/scheduler.darwin-x64.node +0 -0
- package/scheduler.linux-arm64-gnu.node +0 -0
- package/scheduler.linux-x64-gnu.node +0 -0
- package/scheduler.win32-x64-msvc.node +0 -0
- package/scripts/copy-napi.mjs +113 -0
- package/src/Application.ts +177 -0
- package/src/Codemods.ts +343 -0
- package/src/ConfigLoader.ts +49 -0
- package/src/ErrorBoundary.ts +157 -0
- package/src/GracefulShutdown.ts +80 -0
- package/src/HealthCheck.ts +96 -0
- package/src/HotReload.ts +78 -0
- package/src/HttpKernel.ts +305 -0
- package/src/Ignitor.ts +656 -0
- package/src/Provider.ts +74 -0
- package/src/bodyparser/BodyParserMiddleware.ts +183 -0
- package/src/bodyparser/MultipartFile.ts +181 -0
- package/src/bodyparser/parseSize.ts +19 -0
- package/src/bootstrap/hyper-server.ts +78 -0
- package/src/console/CommandRunner.ts +82 -0
- package/src/container/Container.ts +383 -0
- package/src/container/types.ts +30 -0
- package/src/decorators/Lazy.ts +57 -0
- package/src/decorators/Service.ts +85 -0
- package/src/errors/FuzzyMatcher.ts +93 -0
- package/src/errors/ModuleErrors.ts +73 -0
- package/src/errors/PipelineStageError.ts +97 -0
- package/src/errors/ReamError.ts +138 -0
- package/src/events/Emitter.ts +333 -0
- package/src/events/EventsProvider.ts +58 -0
- package/src/events/config.ts +10 -0
- package/src/events/configure.ts +19 -0
- package/src/events/helix/helpers.ts +260 -0
- package/src/events/index.ts +22 -0
- package/src/events/native.ts +37 -0
- package/src/events/services/main.ts +39 -0
- package/src/events/testing/FakeBus.ts +420 -0
- package/src/graphql/GraphQLEngine.ts +421 -0
- package/src/graphql/GraphQLProvider.ts +59 -0
- package/src/helpers/base64.ts +72 -0
- package/src/helpers/index.ts +6 -0
- package/src/helpers/is.ts +162 -0
- package/src/helpers/napi-loader.ts +106 -0
- package/src/helpers/safeEqual.ts +15 -0
- package/src/helpers/string.ts +469 -0
- package/src/helpers/types.ts +100 -0
- package/src/http/Exception.ts +272 -0
- package/src/http/HttpContext.ts +108 -0
- package/src/http/RedirectBuilder.ts +89 -0
- package/src/http/Request.ts +540 -0
- package/src/http/Response.ts +351 -0
- package/src/http/SseStream.ts +250 -0
- package/src/http/urlDecode.ts +18 -0
- package/src/index.ts +263 -0
- package/src/middleware/Pipeline.ts +136 -0
- package/src/openapi/OpenApiGenerator.ts +254 -0
- package/src/openapi/OpenApiMiddleware.ts +101 -0
- package/src/openapi/OpenApiProvider.ts +67 -0
- package/src/resources/ApiResource.ts +79 -0
- package/src/router/Router.ts +733 -0
- package/src/rpc/RpcProvider.ts +54 -0
- package/src/rpc/RpcRouter.ts +243 -0
- package/src/scheduler/Schedule.ts +96 -0
- package/src/scheduler/ScheduleProvider.ts +177 -0
- package/src/scheduler/Scheduler.ts +601 -0
- package/src/scheduler/index.ts +24 -0
- package/src/scheduler/locks/LockBackend.ts +38 -0
- package/src/scheduler/locks/MemoryLockBackend.ts +85 -0
- package/src/scheduler/observability/ErrorReporter.ts +13 -0
- package/src/scheduler/observability/ScheduleEvent.ts +61 -0
- package/src/scheduler/observability/ScheduleEventSink.ts +21 -0
- package/src/scheduler/observability/StatsTracker.ts +134 -0
- package/src/security/CookieSigner.ts +54 -0
- package/src/security/SignedUrl.ts +71 -0
- package/src/security/crypto.ts +98 -0
- package/src/server/HyperServer.ts +121 -0
- package/src/server/Server.ts +147 -0
- package/src/services/app.ts +34 -0
- package/src/services/router.ts +44 -0
- package/src/services/server.ts +40 -0
- package/src/session/Session.ts +231 -0
- package/src/session/SessionMiddleware.ts +153 -0
- package/src/session/drivers/CookieDriver.ts +48 -0
- package/src/session/drivers/MemoryDriver.ts +29 -0
- package/src/storage/S3Driver.ts +171 -0
- package/src/storage/StaticMiddleware.ts +182 -0
- package/src/storage/StaticProvider.ts +40 -0
- package/src/storage/StorageManager.ts +142 -0
- package/src/testing/RequestBuilder.ts +275 -0
- package/src/testing/TestClient.ts +344 -0
- package/src/types/helpers.ts +52 -0
- package/swcrc.app.json +17 -0
- package/tsconfig.app.json +21 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is.d.ts","sourceRoot":"","sources":["../../src/helpers/is.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,MAAM,CAEhD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,MAAM,CAEhD;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,OAAO,CAElD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAE3E;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAA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value is a string.
|
|
3
|
+
* @example isString('hi') // true
|
|
4
|
+
*/
|
|
5
|
+
export function isString(v) {
|
|
6
|
+
return typeof v === 'string';
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Returns true if value is a finite number (excludes NaN).
|
|
10
|
+
* @example isNumber(42) // true; isNumber(NaN) // false
|
|
11
|
+
*/
|
|
12
|
+
export function isNumber(v) {
|
|
13
|
+
return typeof v === 'number' && !Number.isNaN(v);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Returns true if value is a boolean.
|
|
17
|
+
* @example isBoolean(true) // true
|
|
18
|
+
*/
|
|
19
|
+
export function isBoolean(v) {
|
|
20
|
+
return typeof v === 'boolean';
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Returns true if value is a callable function.
|
|
24
|
+
* @example isFunction(() => {}) // true
|
|
25
|
+
*/
|
|
26
|
+
export function isFunction(v) {
|
|
27
|
+
return typeof v === 'function';
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Returns true if value is a non-null object.
|
|
31
|
+
* @example isObject({}) // true; isObject(null) // false
|
|
32
|
+
*/
|
|
33
|
+
export function isObject(v) {
|
|
34
|
+
return v !== null && typeof v === 'object';
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Returns true if value is a plain object (non-null, non-array, prototype is Object or null).
|
|
38
|
+
* @example isPlainObject({ a: 1 }) // true; isPlainObject([]) // false
|
|
39
|
+
*/
|
|
40
|
+
export function isPlainObject(v) {
|
|
41
|
+
if (v === null || typeof v !== 'object')
|
|
42
|
+
return false;
|
|
43
|
+
if (Array.isArray(v))
|
|
44
|
+
return false;
|
|
45
|
+
const proto = Object.getPrototypeOf(v);
|
|
46
|
+
return proto === null || proto === Object.prototype;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Returns true if value is an array.
|
|
50
|
+
* @example isArray([1, 2]) // true
|
|
51
|
+
*/
|
|
52
|
+
export function isArray(v) {
|
|
53
|
+
return Array.isArray(v);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Returns true if value has a thenable interface (is a Promise or promise-like).
|
|
57
|
+
* @example isPromise(Promise.resolve()) // true
|
|
58
|
+
*/
|
|
59
|
+
export function isPromise(v) {
|
|
60
|
+
return (v !== null &&
|
|
61
|
+
typeof v === 'object' &&
|
|
62
|
+
'then' in v &&
|
|
63
|
+
typeof v.then === 'function');
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Returns true if value is null.
|
|
67
|
+
* @example isNull(null) // true
|
|
68
|
+
*/
|
|
69
|
+
export function isNull(v) {
|
|
70
|
+
return v === null;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Returns true if value is undefined.
|
|
74
|
+
* @example isUndefined(undefined) // true
|
|
75
|
+
*/
|
|
76
|
+
export function isUndefined(v) {
|
|
77
|
+
return v === undefined;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Returns true if value is null or undefined.
|
|
81
|
+
* @example isNullOrUndefined(null) // true; isNullOrUndefined(undefined) // true
|
|
82
|
+
*/
|
|
83
|
+
export function isNullOrUndefined(v) {
|
|
84
|
+
return v === null || v === undefined;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Returns true if value is a Node.js Buffer.
|
|
88
|
+
* @example isBuffer(Buffer.from('hi')) // true
|
|
89
|
+
*/
|
|
90
|
+
export function isBuffer(v) {
|
|
91
|
+
return Buffer.isBuffer(v);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Returns true if value is a Date object.
|
|
95
|
+
* @example isDate(new Date()) // true
|
|
96
|
+
*/
|
|
97
|
+
export function isDate(v) {
|
|
98
|
+
return v instanceof Date;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Returns true if value is a RegExp.
|
|
102
|
+
* @example isRegExp(/foo/) // true
|
|
103
|
+
*/
|
|
104
|
+
export function isRegExp(v) {
|
|
105
|
+
return v instanceof RegExp;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Returns true if value is an Error instance.
|
|
109
|
+
* @example isError(new Error()) // true
|
|
110
|
+
*/
|
|
111
|
+
export function isError(v) {
|
|
112
|
+
return v instanceof Error;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Returns true for null, undefined, empty string, empty array, empty plain object,
|
|
116
|
+
* empty Map, or empty Set.
|
|
117
|
+
* @example isEmpty('') // true; isEmpty([]) // true; isEmpty({}) // true
|
|
118
|
+
*/
|
|
119
|
+
export function isEmpty(v) {
|
|
120
|
+
if (v === null || v === undefined)
|
|
121
|
+
return true;
|
|
122
|
+
if (typeof v === 'string')
|
|
123
|
+
return v.length === 0;
|
|
124
|
+
if (Array.isArray(v))
|
|
125
|
+
return v.length === 0;
|
|
126
|
+
if (v instanceof Map || v instanceof Set)
|
|
127
|
+
return v.size === 0;
|
|
128
|
+
if (isPlainObject(v))
|
|
129
|
+
return Object.keys(v).length === 0;
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
const is = {
|
|
133
|
+
isString,
|
|
134
|
+
isNumber,
|
|
135
|
+
isBoolean,
|
|
136
|
+
isFunction,
|
|
137
|
+
isObject,
|
|
138
|
+
isPlainObject,
|
|
139
|
+
isArray,
|
|
140
|
+
isPromise,
|
|
141
|
+
isNull,
|
|
142
|
+
isUndefined,
|
|
143
|
+
isNullOrUndefined,
|
|
144
|
+
isBuffer,
|
|
145
|
+
isDate,
|
|
146
|
+
isRegExp,
|
|
147
|
+
isError,
|
|
148
|
+
isEmpty,
|
|
149
|
+
};
|
|
150
|
+
export default is;
|
|
151
|
+
//# sourceMappingURL=is.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is.js","sourceRoot":"","sources":["../../src/helpers/is.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAU;IACjC,OAAO,OAAO,CAAC,KAAK,QAA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K,CAAA;AACd,CAAC;AAED,MAAM,EAAE,GAAG;IACT,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,UAAU;IACV,QAAQ;IACR,aAAa;IACb,OAAO;IACP,SAAS;IACT,MAAM;IACN,WAAW;IACX,iBAAiB;IACjB,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,OAAO;IACP,OAAO;CACR,CAAA;AAED,eAAe,EAAE,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared NAPI binary loader. Every `.node` file distributed with
|
|
3
|
+
* `@c9up/ream` uses the same platform-suffix convention and lookup
|
|
4
|
+
* strategy — extracting this helper avoids drift between the three
|
|
5
|
+
* call sites (HyperServer, Scheduler, and future NAPI consumers) and
|
|
6
|
+
* matches the codex review's "stop duplicating native loaders"
|
|
7
|
+
* guidance.
|
|
8
|
+
*/
|
|
9
|
+
/** Platform triple suffix (matches napi-rs naming). */
|
|
10
|
+
export declare const NAPI_PLATFORM_MAP: Record<string, string>;
|
|
11
|
+
export interface LoadNapiOptions {
|
|
12
|
+
/**
|
|
13
|
+
* Base filename of the `.node` binary (without the platform suffix
|
|
14
|
+
* or `.node` extension). E.g. `"index"` for HyperServer,
|
|
15
|
+
* `"scheduler"` for the Ream scheduler.
|
|
16
|
+
*/
|
|
17
|
+
binaryName: string;
|
|
18
|
+
/**
|
|
19
|
+
* Caller's `import.meta.url` — used to compute the candidate paths
|
|
20
|
+
* relative to the caller's module location.
|
|
21
|
+
*/
|
|
22
|
+
callerMetaUrl: string;
|
|
23
|
+
/**
|
|
24
|
+
* Error-code prefix used to build `<PREFIX>_NAPI_NOT_FOUND`,
|
|
25
|
+
* `<PREFIX>_NAPI_LOAD_FAILED`, and `<PREFIX>_UNSUPPORTED_PLATFORM`
|
|
26
|
+
* codes when loading fails. E.g. `"SCHEDULER"`.
|
|
27
|
+
*/
|
|
28
|
+
errorCodePrefix: string;
|
|
29
|
+
/** Hint appended to the "not found" error (typically a build command). */
|
|
30
|
+
notFoundHint?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Resolve and `require` a Ream NAPI binary, returning the native
|
|
34
|
+
* module export. Throws a typed `ReamError` on any failure.
|
|
35
|
+
*
|
|
36
|
+
* Search order (first hit wins):
|
|
37
|
+
* 1. `<caller>/../../<binaryName>.<suffix>.node`
|
|
38
|
+
* 2. `<caller>/../<binaryName>.<suffix>.node`
|
|
39
|
+
* 3. `<caller>/<binaryName>.<suffix>.node`
|
|
40
|
+
*
|
|
41
|
+
* The three-level fallback matches the layout where the compiled
|
|
42
|
+
* `.node` sits either at the package root, a subdirectory, or next to
|
|
43
|
+
* the calling module.
|
|
44
|
+
*/
|
|
45
|
+
export declare function loadNapi<T>(options: LoadNapiOptions): T;
|
|
46
|
+
//# sourceMappingURL=napi-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"napi-loader.d.ts","sourceRoot":"","sources":["../../src/helpers/napi-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,uDAAuD;AACvD,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAMpD,CAAA;AAED,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAA;IACvB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,eAAe,GAAG,CAAC,CA8CvD"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared NAPI binary loader. Every `.node` file distributed with
|
|
3
|
+
* `@c9up/ream` uses the same platform-suffix convention and lookup
|
|
4
|
+
* strategy — extracting this helper avoids drift between the three
|
|
5
|
+
* call sites (HyperServer, Scheduler, and future NAPI consumers) and
|
|
6
|
+
* matches the codex review's "stop duplicating native loaders"
|
|
7
|
+
* guidance.
|
|
8
|
+
*/
|
|
9
|
+
import { createRequire } from 'node:module';
|
|
10
|
+
import { dirname, join } from 'node:path';
|
|
11
|
+
import { arch, platform } from 'node:process';
|
|
12
|
+
import { fileURLToPath } from 'node:url';
|
|
13
|
+
import { ReamError } from '../errors/ReamError.js';
|
|
14
|
+
/** Platform triple suffix (matches napi-rs naming). */
|
|
15
|
+
export const NAPI_PLATFORM_MAP = {
|
|
16
|
+
'linux-x64': 'linux-x64-gnu',
|
|
17
|
+
'linux-arm64': 'linux-arm64-gnu',
|
|
18
|
+
'darwin-x64': 'darwin-x64',
|
|
19
|
+
'darwin-arm64': 'darwin-arm64',
|
|
20
|
+
'win32-x64': 'win32-x64-msvc',
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Resolve and `require` a Ream NAPI binary, returning the native
|
|
24
|
+
* module export. Throws a typed `ReamError` on any failure.
|
|
25
|
+
*
|
|
26
|
+
* Search order (first hit wins):
|
|
27
|
+
* 1. `<caller>/../../<binaryName>.<suffix>.node`
|
|
28
|
+
* 2. `<caller>/../<binaryName>.<suffix>.node`
|
|
29
|
+
* 3. `<caller>/<binaryName>.<suffix>.node`
|
|
30
|
+
*
|
|
31
|
+
* The three-level fallback matches the layout where the compiled
|
|
32
|
+
* `.node` sits either at the package root, a subdirectory, or next to
|
|
33
|
+
* the calling module.
|
|
34
|
+
*/
|
|
35
|
+
export function loadNapi(options) {
|
|
36
|
+
const { binaryName, callerMetaUrl, errorCodePrefix } = options;
|
|
37
|
+
const suffix = NAPI_PLATFORM_MAP[`${platform}-${arch}`];
|
|
38
|
+
if (!suffix) {
|
|
39
|
+
throw new ReamError(`${errorCodePrefix}_UNSUPPORTED_PLATFORM`, `Unsupported platform: ${platform}-${arch}`);
|
|
40
|
+
}
|
|
41
|
+
const req = createRequire(callerMetaUrl);
|
|
42
|
+
const dir = dirname(fileURLToPath(callerMetaUrl));
|
|
43
|
+
const candidates = [
|
|
44
|
+
join(dir, '..', '..', `${binaryName}.${suffix}.node`),
|
|
45
|
+
join(dir, '..', `${binaryName}.${suffix}.node`),
|
|
46
|
+
join(dir, `${binaryName}.${suffix}.node`),
|
|
47
|
+
];
|
|
48
|
+
for (const path of candidates) {
|
|
49
|
+
try {
|
|
50
|
+
return req(path);
|
|
51
|
+
}
|
|
52
|
+
catch (e) {
|
|
53
|
+
const code = e?.code;
|
|
54
|
+
if (code === 'MODULE_NOT_FOUND')
|
|
55
|
+
continue;
|
|
56
|
+
// Any other error (SyntaxError, ABI mismatch, permissions,
|
|
57
|
+
// corrupt binary) means the file exists but cannot load. Surface
|
|
58
|
+
// the real cause rather than a generic "not found".
|
|
59
|
+
throw new ReamError(`${errorCodePrefix}_NAPI_LOAD_FAILED`, `${binaryName} NAPI binary exists at '${path}' but failed to load: ${e.message}`, {
|
|
60
|
+
hint: 'Check that the binary was built for the current platform and Node ABI. Rebuild with `pnpm --filter @c9up/ream build:rust`.',
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
throw new ReamError(`${errorCodePrefix}_NAPI_NOT_FOUND`, `${binaryName} NAPI binary not found. Expected ${binaryName}.${suffix}.node`, {
|
|
65
|
+
hint: options.notFoundHint ??
|
|
66
|
+
"Run 'pnpm --filter @c9up/ream build:rust' to build the native module.",
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=napi-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"napi-loader.js","sourceRoot":"","sources":["../../src/helpers/napi-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAA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;YACX,MAAM,IAAI,GAAI,CAAuC,EAAE,IAAI,CAAA;YAC3D,IAAI,IAAI,KAAK,kBAAkB;gBAAE,SAAQ;YACzC,2DAA2D;YAC3D,iEAAiE;YACjE,oDAAoD;YACpD,MAAM,IAAI,SAAS,CACjB,GAAG,eAAe,mBAAmB,EACrC,GAAG,UAAU,2BAA2B,IAAI,yBAA0B,CAAW,CAAC,OAAO,EAAE,EAC3F;gBACE,IAAI,EAAE,4HAA4H;aACnI,CACF,CAAA;QACH,CAAC;IACH,CAAC;IAED,MAAM,IAAI,SAAS,CACjB,GAAG,eAAe,iBAAiB,EACnC,GAAG,UAAU,oCAAoC,UAAU,IAAI,MAAM,OAAO,EAC5E;QACE,IAAI,EACF,OAAO,CAAC,YAAY;YACpB,uEAAuE;KAC1E,CACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Timing-safe comparison of two strings or buffers. Prevents timing attacks.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* safeEqual('secret', 'secret') // true
|
|
6
|
+
* safeEqual('secret', 'wrong') // false
|
|
7
|
+
*/
|
|
8
|
+
export declare function safeEqual(a: string | Buffer, b: string | Buffer): boolean;
|
|
9
|
+
//# sourceMappingURL=safeEqual.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safeEqual.d.ts","sourceRoot":"","sources":["../../src/helpers/safeEqual.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAKzE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { timingSafeEqual } from 'node:crypto';
|
|
2
|
+
/**
|
|
3
|
+
* Timing-safe comparison of two strings or buffers. Prevents timing attacks.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* safeEqual('secret', 'secret') // true
|
|
7
|
+
* safeEqual('secret', 'wrong') // false
|
|
8
|
+
*/
|
|
9
|
+
export function safeEqual(a, b) {
|
|
10
|
+
const bufA = typeof a === 'string' ? Buffer.from(a) : a;
|
|
11
|
+
const bufB = typeof b === 'string' ? Buffer.from(b) : b;
|
|
12
|
+
if (bufA.length !== bufB.length)
|
|
13
|
+
return false;
|
|
14
|
+
return timingSafeEqual(bufA, bufB);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=safeEqual.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safeEqual.js","sourceRoot":"","sources":["../../src/helpers/safeEqual.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,CAAkB,EAAE,CAAkB;IAC9D,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAA;IAC7C,OAAO,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AACpC,CAAC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a string to camelCase.
|
|
3
|
+
* @example camelCase('user_name') // 'userName'
|
|
4
|
+
*/
|
|
5
|
+
export declare function camelCase(s: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Converts a string to snake_case.
|
|
8
|
+
* @example snakeCase('userName') // 'user_name'
|
|
9
|
+
*/
|
|
10
|
+
export declare function snakeCase(s: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Converts a string to PascalCase.
|
|
13
|
+
* @example pascalCase('user team') // 'UserTeam'
|
|
14
|
+
*/
|
|
15
|
+
export declare function pascalCase(s: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Converts a string to dash-case (kebab-case). Optionally capitalizes each segment.
|
|
18
|
+
* @example dashCase('helloWorld') // 'hello-world'
|
|
19
|
+
* @example dashCase('helloWorld', { capitalize: true }) // 'Hello-World'
|
|
20
|
+
*/
|
|
21
|
+
export declare function dashCase(s: string, options?: {
|
|
22
|
+
capitalize?: boolean;
|
|
23
|
+
}): string;
|
|
24
|
+
/**
|
|
25
|
+
* Converts a string to Title Case.
|
|
26
|
+
* @example titleCase('hello world') // 'Hello World'
|
|
27
|
+
*/
|
|
28
|
+
export declare function titleCase(s: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Converts a snake_case/camelCase string to a human-readable form.
|
|
31
|
+
* @example humanize('user_name') // 'User name'
|
|
32
|
+
*/
|
|
33
|
+
export declare function humanize(s: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Truncates a string to maxLength characters.
|
|
36
|
+
* @example truncate('Hello world', 8) // 'Hello wo...'
|
|
37
|
+
*/
|
|
38
|
+
export declare function truncate(text: string, maxLength: number, options?: {
|
|
39
|
+
completeWords?: boolean;
|
|
40
|
+
suffix?: string;
|
|
41
|
+
}): string;
|
|
42
|
+
/**
|
|
43
|
+
* Strips HTML tags then truncates. See `truncate` for options.
|
|
44
|
+
* @example excerpt('<p>Hello world</p>', 8) // 'Hello wo...'
|
|
45
|
+
*/
|
|
46
|
+
export declare function excerpt(text: string, maxLength: number, options?: {
|
|
47
|
+
completeWords?: boolean;
|
|
48
|
+
suffix?: string;
|
|
49
|
+
}): string;
|
|
50
|
+
/**
|
|
51
|
+
* Escapes HTML special characters. Optionally encodes non-ASCII characters as numeric entities.
|
|
52
|
+
* @example escapeHTML('<b>hi</b>') // '<b>hi</b>'
|
|
53
|
+
*/
|
|
54
|
+
export declare function escapeHTML(text: string, options?: {
|
|
55
|
+
encodeSymbols?: boolean;
|
|
56
|
+
}): string;
|
|
57
|
+
/**
|
|
58
|
+
* Encodes only non-ASCII characters as &#xHEX; numeric entities.
|
|
59
|
+
* @example encodeSymbols('héllo') // 'héllo'
|
|
60
|
+
*/
|
|
61
|
+
export declare function encodeSymbols(text: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Returns true if the string is empty or contains only whitespace.
|
|
64
|
+
* @example isEmpty(' ') // true
|
|
65
|
+
*/
|
|
66
|
+
export declare function isEmpty(value: string): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Trims a string and collapses internal whitespace sequences to a single space.
|
|
69
|
+
* @example condenseWhitespace(' hello world ') // 'hello world'
|
|
70
|
+
*/
|
|
71
|
+
export declare function condenseWhitespace(s: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* Converts a string to a URL-friendly slug.
|
|
74
|
+
* @example slug('Hello World!') // 'hello-world'
|
|
75
|
+
*/
|
|
76
|
+
export declare function slug(text: string, options?: {
|
|
77
|
+
replacement?: string;
|
|
78
|
+
lower?: boolean;
|
|
79
|
+
strict?: boolean;
|
|
80
|
+
}): string;
|
|
81
|
+
/**
|
|
82
|
+
* Returns the plural form of an English word.
|
|
83
|
+
* @example plural('person') // 'people'; plural('box') // 'boxes'
|
|
84
|
+
*/
|
|
85
|
+
export declare function plural(word: string): string;
|
|
86
|
+
/**
|
|
87
|
+
* Returns the singular form of an English word.
|
|
88
|
+
* @example singular('people') // 'person'; singular('boxes') // 'box'
|
|
89
|
+
*/
|
|
90
|
+
export declare function singular(word: string): string;
|
|
91
|
+
/**
|
|
92
|
+
* Returns true if the word appears to be plural.
|
|
93
|
+
* @example isPlural('dogs') // true
|
|
94
|
+
*/
|
|
95
|
+
export declare function isPlural(word: string): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Returns true if the word appears to be singular.
|
|
98
|
+
* @example isSingular('dog') // true
|
|
99
|
+
*/
|
|
100
|
+
export declare function isSingular(word: string): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Returns a base64url random string of exactly `length` characters.
|
|
103
|
+
* @example random(16) // e.g. 'Xk3mN9pQ2vR7tZ1w'
|
|
104
|
+
*/
|
|
105
|
+
export declare function random(length: number): string;
|
|
106
|
+
/**
|
|
107
|
+
* Alias for `random`. Generates a base64url random string of `size` characters.
|
|
108
|
+
* @example generateRandom(16) // e.g. 'Xk3mN9pQ2vR7tZ1w'
|
|
109
|
+
*/
|
|
110
|
+
export declare function generateRandom(size: number): string;
|
|
111
|
+
/**
|
|
112
|
+
* Returns the ordinal representation of a number.
|
|
113
|
+
* @example ordinal(1) // '1st'; ordinal(11) // '11th'; ordinal(22) // '22nd'
|
|
114
|
+
*/
|
|
115
|
+
export declare function ordinal(n: number): string;
|
|
116
|
+
/**
|
|
117
|
+
* Formats an hrtime tuple to a human-readable string.
|
|
118
|
+
* @example prettyHrTime([0, 1234567]) // '1.235 ms'
|
|
119
|
+
* @example prettyHrTime([2, 500000000]) // '2.500 s'
|
|
120
|
+
*/
|
|
121
|
+
export declare function prettyHrTime(time: [number, number]): string;
|
|
122
|
+
/**
|
|
123
|
+
* Converts Windows backslash paths to Unix forward slashes.
|
|
124
|
+
* @example toUnixSlash('C:\\foo\\bar') // 'C:/foo/bar'
|
|
125
|
+
*/
|
|
126
|
+
export declare function toUnixSlash(p: string): string;
|
|
127
|
+
/**
|
|
128
|
+
* Interpolates `{{ key.path }}` placeholders in a template string using `data`.
|
|
129
|
+
* Escape with backslash: `\{{` outputs literal `{{`. Missing keys produce empty string.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* interpolate('Hello {{ user.name }}!', { user: { name: 'Alice' } }) // 'Hello Alice!'
|
|
133
|
+
*/
|
|
134
|
+
export declare function interpolate(template: string, data: Record<string, unknown>): string;
|
|
135
|
+
declare const string: {
|
|
136
|
+
camelCase: typeof camelCase;
|
|
137
|
+
snakeCase: typeof snakeCase;
|
|
138
|
+
pascalCase: typeof pascalCase;
|
|
139
|
+
dashCase: typeof dashCase;
|
|
140
|
+
titleCase: typeof titleCase;
|
|
141
|
+
humanize: typeof humanize;
|
|
142
|
+
truncate: typeof truncate;
|
|
143
|
+
excerpt: typeof excerpt;
|
|
144
|
+
escapeHTML: typeof escapeHTML;
|
|
145
|
+
encodeSymbols: typeof encodeSymbols;
|
|
146
|
+
isEmpty: typeof isEmpty;
|
|
147
|
+
condenseWhitespace: typeof condenseWhitespace;
|
|
148
|
+
slug: typeof slug;
|
|
149
|
+
plural: typeof plural;
|
|
150
|
+
singular: typeof singular;
|
|
151
|
+
isPlural: typeof isPlural;
|
|
152
|
+
isSingular: typeof isSingular;
|
|
153
|
+
random: typeof random;
|
|
154
|
+
generateRandom: typeof generateRandom;
|
|
155
|
+
ordinal: typeof ordinal;
|
|
156
|
+
prettyHrTime: typeof prettyHrTime;
|
|
157
|
+
toUnixSlash: typeof toUnixSlash;
|
|
158
|
+
interpolate: typeof interpolate;
|
|
159
|
+
};
|
|
160
|
+
export default string;
|
|
161
|
+
//# sourceMappingURL=string.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/helpers/string.ts"],"names":[],"mappings":"AA8BA;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAG3C;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAI5C;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAM9E;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,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