nitrostack 1.0.82 → 1.0.84
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 +1 -1
- package/README.md +38 -143
- package/package.json +13 -49
- package/dist/auth/__tests__/api-key.test.d.ts +0 -2
- package/dist/auth/__tests__/api-key.test.d.ts.map +0 -1
- package/dist/auth/__tests__/api-key.test.js +0 -156
- package/dist/auth/__tests__/api-key.test.js.map +0 -1
- package/dist/auth/__tests__/client.test.d.ts +0 -2
- package/dist/auth/__tests__/client.test.d.ts.map +0 -1
- package/dist/auth/__tests__/client.test.js +0 -173
- package/dist/auth/__tests__/client.test.js.map +0 -1
- package/dist/auth/__tests__/middleware.test.d.ts +0 -2
- package/dist/auth/__tests__/middleware.test.d.ts.map +0 -1
- package/dist/auth/__tests__/middleware.test.js +0 -232
- package/dist/auth/__tests__/middleware.test.js.map +0 -1
- package/dist/auth/__tests__/pkce.test.d.ts +0 -2
- package/dist/auth/__tests__/pkce.test.d.ts.map +0 -1
- package/dist/auth/__tests__/pkce.test.js +0 -110
- package/dist/auth/__tests__/pkce.test.js.map +0 -1
- package/dist/auth/__tests__/quick-setup.test.d.ts +0 -2
- package/dist/auth/__tests__/quick-setup.test.d.ts.map +0 -1
- package/dist/auth/__tests__/quick-setup.test.js +0 -95
- package/dist/auth/__tests__/quick-setup.test.js.map +0 -1
- package/dist/auth/__tests__/secure-secret.test.d.ts +0 -2
- package/dist/auth/__tests__/secure-secret.test.d.ts.map +0 -1
- package/dist/auth/__tests__/secure-secret.test.js +0 -104
- package/dist/auth/__tests__/secure-secret.test.js.map +0 -1
- package/dist/auth/__tests__/server-integration.test.d.ts +0 -2
- package/dist/auth/__tests__/server-integration.test.d.ts.map +0 -1
- package/dist/auth/__tests__/server-integration.test.js +0 -156
- package/dist/auth/__tests__/server-integration.test.js.map +0 -1
- package/dist/auth/__tests__/server-metadata.test.d.ts +0 -2
- package/dist/auth/__tests__/server-metadata.test.d.ts.map +0 -1
- package/dist/auth/__tests__/server-metadata.test.js +0 -72
- package/dist/auth/__tests__/server-metadata.test.js.map +0 -1
- package/dist/auth/__tests__/simple-jwt.test.d.ts +0 -2
- package/dist/auth/__tests__/simple-jwt.test.d.ts.map +0 -1
- package/dist/auth/__tests__/simple-jwt.test.js +0 -125
- package/dist/auth/__tests__/simple-jwt.test.js.map +0 -1
- package/dist/auth/__tests__/token-store.test.d.ts +0 -2
- package/dist/auth/__tests__/token-store.test.d.ts.map +0 -1
- package/dist/auth/__tests__/token-store.test.js +0 -167
- package/dist/auth/__tests__/token-store.test.js.map +0 -1
- package/dist/auth/__tests__/token-validation.test.d.ts +0 -2
- package/dist/auth/__tests__/token-validation.test.d.ts.map +0 -1
- package/dist/auth/__tests__/token-validation.test.js +0 -219
- package/dist/auth/__tests__/token-validation.test.js.map +0 -1
- package/dist/auth/api-key.d.ts +0 -118
- package/dist/auth/api-key.d.ts.map +0 -1
- package/dist/auth/api-key.js +0 -168
- package/dist/auth/api-key.js.map +0 -1
- package/dist/auth/client.d.ts +0 -151
- package/dist/auth/client.d.ts.map +0 -1
- package/dist/auth/client.js +0 -330
- package/dist/auth/client.js.map +0 -1
- package/dist/auth/index.d.ts +0 -31
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js +0 -46
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/middleware.d.ts +0 -95
- package/dist/auth/middleware.d.ts.map +0 -1
- package/dist/auth/middleware.js +0 -260
- package/dist/auth/middleware.js.map +0 -1
- package/dist/auth/pkce.d.ts +0 -53
- package/dist/auth/pkce.d.ts.map +0 -1
- package/dist/auth/pkce.js +0 -105
- package/dist/auth/pkce.js.map +0 -1
- package/dist/auth/quick-setup.d.ts +0 -94
- package/dist/auth/quick-setup.d.ts.map +0 -1
- package/dist/auth/quick-setup.js +0 -210
- package/dist/auth/quick-setup.js.map +0 -1
- package/dist/auth/secure-secret.d.ts +0 -136
- package/dist/auth/secure-secret.d.ts.map +0 -1
- package/dist/auth/secure-secret.js +0 -182
- package/dist/auth/secure-secret.js.map +0 -1
- package/dist/auth/server-integration.d.ts +0 -97
- package/dist/auth/server-integration.d.ts.map +0 -1
- package/dist/auth/server-integration.js +0 -182
- package/dist/auth/server-integration.js.map +0 -1
- package/dist/auth/server-metadata.d.ts +0 -51
- package/dist/auth/server-metadata.d.ts.map +0 -1
- package/dist/auth/server-metadata.js +0 -106
- package/dist/auth/server-metadata.js.map +0 -1
- package/dist/auth/simple-jwt.d.ts +0 -174
- package/dist/auth/simple-jwt.d.ts.map +0 -1
- package/dist/auth/simple-jwt.js +0 -162
- package/dist/auth/simple-jwt.js.map +0 -1
- package/dist/auth/token-store.d.ts +0 -104
- package/dist/auth/token-store.d.ts.map +0 -1
- package/dist/auth/token-store.js +0 -205
- package/dist/auth/token-store.js.map +0 -1
- package/dist/auth/token-validation.d.ts +0 -59
- package/dist/auth/token-validation.d.ts.map +0 -1
- package/dist/auth/token-validation.js +0 -241
- package/dist/auth/token-validation.js.map +0 -1
- package/dist/auth/types.d.ts +0 -215
- package/dist/auth/types.d.ts.map +0 -1
- package/dist/auth/types.js +0 -6
- package/dist/auth/types.js.map +0 -1
- package/dist/core/__tests__/app-decorator.test.d.ts +0 -2
- package/dist/core/__tests__/app-decorator.test.d.ts.map +0 -1
- package/dist/core/__tests__/app-decorator.test.js +0 -100
- package/dist/core/__tests__/app-decorator.test.js.map +0 -1
- package/dist/core/__tests__/app-factory.extended.test.d.ts +0 -2
- package/dist/core/__tests__/app-factory.extended.test.d.ts.map +0 -1
- package/dist/core/__tests__/app-factory.extended.test.js +0 -244
- package/dist/core/__tests__/app-factory.extended.test.js.map +0 -1
- package/dist/core/__tests__/builders.test.d.ts +0 -2
- package/dist/core/__tests__/builders.test.d.ts.map +0 -1
- package/dist/core/__tests__/builders.test.js +0 -98
- package/dist/core/__tests__/builders.test.js.map +0 -1
- package/dist/core/__tests__/component.test.d.ts +0 -2
- package/dist/core/__tests__/component.test.d.ts.map +0 -1
- package/dist/core/__tests__/component.test.js +0 -151
- package/dist/core/__tests__/component.test.js.map +0 -1
- package/dist/core/__tests__/config-module.test.d.ts +0 -2
- package/dist/core/__tests__/config-module.test.d.ts.map +0 -1
- package/dist/core/__tests__/config-module.test.js +0 -90
- package/dist/core/__tests__/config-module.test.js.map +0 -1
- package/dist/core/__tests__/core-modules.test.d.ts +0 -2
- package/dist/core/__tests__/core-modules.test.d.ts.map +0 -1
- package/dist/core/__tests__/core-modules.test.js +0 -36
- package/dist/core/__tests__/core-modules.test.js.map +0 -1
- package/dist/core/__tests__/di.test.d.ts +0 -2
- package/dist/core/__tests__/di.test.d.ts.map +0 -1
- package/dist/core/__tests__/di.test.js +0 -101
- package/dist/core/__tests__/di.test.js.map +0 -1
- package/dist/core/__tests__/errors.test.d.ts +0 -2
- package/dist/core/__tests__/errors.test.d.ts.map +0 -1
- package/dist/core/__tests__/errors.test.js +0 -109
- package/dist/core/__tests__/errors.test.js.map +0 -1
- package/dist/core/__tests__/final.blitz.test.d.ts +0 -2
- package/dist/core/__tests__/final.blitz.test.d.ts.map +0 -1
- package/dist/core/__tests__/final.blitz.test.js +0 -327
- package/dist/core/__tests__/final.blitz.test.js.map +0 -1
- package/dist/core/__tests__/jwt-module.test.d.ts +0 -2
- package/dist/core/__tests__/jwt-module.test.d.ts.map +0 -1
- package/dist/core/__tests__/jwt-module.test.js +0 -60
- package/dist/core/__tests__/jwt-module.test.js.map +0 -1
- package/dist/core/__tests__/logger.test.d.ts +0 -2
- package/dist/core/__tests__/logger.test.d.ts.map +0 -1
- package/dist/core/__tests__/logger.test.js +0 -83
- package/dist/core/__tests__/logger.test.js.map +0 -1
- package/dist/core/__tests__/models.test.d.ts +0 -2
- package/dist/core/__tests__/models.test.d.ts.map +0 -1
- package/dist/core/__tests__/models.test.js +0 -142
- package/dist/core/__tests__/models.test.js.map +0 -1
- package/dist/core/__tests__/module.test.d.ts +0 -2
- package/dist/core/__tests__/module.test.d.ts.map +0 -1
- package/dist/core/__tests__/module.test.js +0 -58
- package/dist/core/__tests__/module.test.js.map +0 -1
- package/dist/core/__tests__/oauth-module.test.d.ts +0 -2
- package/dist/core/__tests__/oauth-module.test.d.ts.map +0 -1
- package/dist/core/__tests__/oauth-module.test.js +0 -168
- package/dist/core/__tests__/oauth-module.test.js.map +0 -1
- package/dist/core/__tests__/oauth.extended.test.d.ts +0 -2
- package/dist/core/__tests__/oauth.extended.test.d.ts.map +0 -1
- package/dist/core/__tests__/oauth.extended.test.js +0 -146
- package/dist/core/__tests__/oauth.extended.test.js.map +0 -1
- package/dist/core/__tests__/prompt.test.d.ts +0 -2
- package/dist/core/__tests__/prompt.test.d.ts.map +0 -1
- package/dist/core/__tests__/prompt.test.js +0 -126
- package/dist/core/__tests__/prompt.test.js.map +0 -1
- package/dist/core/__tests__/resource.test.d.ts +0 -2
- package/dist/core/__tests__/resource.test.d.ts.map +0 -1
- package/dist/core/__tests__/resource.test.js +0 -173
- package/dist/core/__tests__/resource.test.js.map +0 -1
- package/dist/core/__tests__/server.extended.test.d.ts +0 -2
- package/dist/core/__tests__/server.extended.test.d.ts.map +0 -1
- package/dist/core/__tests__/server.extended.test.js +0 -242
- package/dist/core/__tests__/server.extended.test.js.map +0 -1
- package/dist/core/__tests__/server.test.d.ts +0 -2
- package/dist/core/__tests__/server.test.d.ts.map +0 -1
- package/dist/core/__tests__/server.test.js +0 -120
- package/dist/core/__tests__/server.test.js.map +0 -1
- package/dist/core/__tests__/transport.http.test.d.ts +0 -2
- package/dist/core/__tests__/transport.http.test.d.ts.map +0 -1
- package/dist/core/__tests__/transport.http.test.js +0 -119
- package/dist/core/__tests__/transport.http.test.js.map +0 -1
- package/dist/core/__tests__/transport.streamable.test.d.ts +0 -2
- package/dist/core/__tests__/transport.streamable.test.d.ts.map +0 -1
- package/dist/core/__tests__/transport.streamable.test.js +0 -168
- package/dist/core/__tests__/transport.streamable.test.js.map +0 -1
- package/dist/core/__tests__/transports.test.d.ts +0 -2
- package/dist/core/__tests__/transports.test.d.ts.map +0 -1
- package/dist/core/__tests__/transports.test.js +0 -12
- package/dist/core/__tests__/transports.test.js.map +0 -1
- package/dist/core/apikey-module.d.ts +0 -69
- package/dist/core/apikey-module.d.ts.map +0 -1
- package/dist/core/apikey-module.js +0 -114
- package/dist/core/apikey-module.js.map +0 -1
- package/dist/core/app-decorator.d.ts +0 -59
- package/dist/core/app-decorator.d.ts.map +0 -1
- package/dist/core/app-decorator.js +0 -322
- package/dist/core/app-decorator.js.map +0 -1
- package/dist/core/builders.d.ts +0 -50
- package/dist/core/builders.d.ts.map +0 -1
- package/dist/core/builders.js +0 -139
- package/dist/core/builders.js.map +0 -1
- package/dist/core/component.d.ts +0 -111
- package/dist/core/component.d.ts.map +0 -1
- package/dist/core/component.js +0 -228
- package/dist/core/component.js.map +0 -1
- package/dist/core/config-module.d.ts +0 -62
- package/dist/core/config-module.d.ts.map +0 -1
- package/dist/core/config-module.js +0 -94
- package/dist/core/config-module.js.map +0 -1
- package/dist/core/decorators/__tests__/decorators.test.d.ts +0 -2
- package/dist/core/decorators/__tests__/decorators.test.d.ts.map +0 -1
- package/dist/core/decorators/__tests__/decorators.test.js +0 -103
- package/dist/core/decorators/__tests__/decorators.test.js.map +0 -1
- package/dist/core/decorators/__tests__/extended-decorators.test.d.ts +0 -2
- package/dist/core/decorators/__tests__/extended-decorators.test.d.ts.map +0 -1
- package/dist/core/decorators/__tests__/extended-decorators.test.js +0 -194
- package/dist/core/decorators/__tests__/extended-decorators.test.js.map +0 -1
- package/dist/core/decorators/__tests__/health-check.test.d.ts +0 -2
- package/dist/core/decorators/__tests__/health-check.test.d.ts.map +0 -1
- package/dist/core/decorators/__tests__/health-check.test.js +0 -119
- package/dist/core/decorators/__tests__/health-check.test.js.map +0 -1
- package/dist/core/decorators/cache.decorator.d.ts +0 -61
- package/dist/core/decorators/cache.decorator.d.ts.map +0 -1
- package/dist/core/decorators/cache.decorator.js +0 -115
- package/dist/core/decorators/cache.decorator.js.map +0 -1
- package/dist/core/decorators/health-check.decorator.d.ts +0 -80
- package/dist/core/decorators/health-check.decorator.d.ts.map +0 -1
- package/dist/core/decorators/health-check.decorator.js +0 -153
- package/dist/core/decorators/health-check.decorator.js.map +0 -1
- package/dist/core/decorators/rate-limit.decorator.d.ts +0 -63
- package/dist/core/decorators/rate-limit.decorator.d.ts.map +0 -1
- package/dist/core/decorators/rate-limit.decorator.js +0 -129
- package/dist/core/decorators/rate-limit.decorator.js.map +0 -1
- package/dist/core/decorators.d.ts +0 -190
- package/dist/core/decorators.d.ts.map +0 -1
- package/dist/core/decorators.js +0 -170
- package/dist/core/decorators.js.map +0 -1
- package/dist/core/di/__tests__/container.test.d.ts +0 -2
- package/dist/core/di/__tests__/container.test.d.ts.map +0 -1
- package/dist/core/di/__tests__/container.test.js +0 -88
- package/dist/core/di/__tests__/container.test.js.map +0 -1
- package/dist/core/di/container.d.ts +0 -59
- package/dist/core/di/container.d.ts.map +0 -1
- package/dist/core/di/container.js +0 -93
- package/dist/core/di/container.js.map +0 -1
- package/dist/core/di/injectable.decorator.d.ts +0 -37
- package/dist/core/di/injectable.decorator.d.ts.map +0 -1
- package/dist/core/di/injectable.decorator.js +0 -57
- package/dist/core/di/injectable.decorator.js.map +0 -1
- package/dist/core/errors.d.ts +0 -54
- package/dist/core/errors.d.ts.map +0 -1
- package/dist/core/errors.js +0 -87
- package/dist/core/errors.js.map +0 -1
- package/dist/core/events/__tests__/events.test.d.ts +0 -2
- package/dist/core/events/__tests__/events.test.d.ts.map +0 -1
- package/dist/core/events/__tests__/events.test.js +0 -177
- package/dist/core/events/__tests__/events.test.js.map +0 -1
- package/dist/core/events/event-emitter.d.ts +0 -50
- package/dist/core/events/event-emitter.d.ts.map +0 -1
- package/dist/core/events/event-emitter.js +0 -94
- package/dist/core/events/event-emitter.js.map +0 -1
- package/dist/core/events/event.decorator.d.ts +0 -48
- package/dist/core/events/event.decorator.d.ts.map +0 -1
- package/dist/core/events/event.decorator.js +0 -72
- package/dist/core/events/event.decorator.js.map +0 -1
- package/dist/core/events/log-emitter.d.ts +0 -14
- package/dist/core/events/log-emitter.d.ts.map +0 -1
- package/dist/core/events/log-emitter.js +0 -20
- package/dist/core/events/log-emitter.js.map +0 -1
- package/dist/core/filters/__tests__/filters.test.d.ts +0 -2
- package/dist/core/filters/__tests__/filters.test.d.ts.map +0 -1
- package/dist/core/filters/__tests__/filters.test.js +0 -72
- package/dist/core/filters/__tests__/filters.test.js.map +0 -1
- package/dist/core/filters/exception-filter.decorator.d.ts +0 -40
- package/dist/core/filters/exception-filter.decorator.d.ts.map +0 -1
- package/dist/core/filters/exception-filter.decorator.js +0 -54
- package/dist/core/filters/exception-filter.decorator.js.map +0 -1
- package/dist/core/filters/exception-filter.interface.d.ts +0 -39
- package/dist/core/filters/exception-filter.interface.d.ts.map +0 -1
- package/dist/core/filters/exception-filter.interface.js +0 -2
- package/dist/core/filters/exception-filter.interface.js.map +0 -1
- package/dist/core/guards/__tests__/guards.test.d.ts +0 -2
- package/dist/core/guards/__tests__/guards.test.d.ts.map +0 -1
- package/dist/core/guards/__tests__/guards.test.js +0 -55
- package/dist/core/guards/__tests__/guards.test.js.map +0 -1
- package/dist/core/guards/apikey.guard.d.ts +0 -22
- package/dist/core/guards/apikey.guard.d.ts.map +0 -1
- package/dist/core/guards/apikey.guard.js +0 -11
- package/dist/core/guards/apikey.guard.js.map +0 -1
- package/dist/core/guards/guard.interface.d.ts +0 -18
- package/dist/core/guards/guard.interface.d.ts.map +0 -1
- package/dist/core/guards/guard.interface.js +0 -2
- package/dist/core/guards/guard.interface.js.map +0 -1
- package/dist/core/guards/jwt.guard.d.ts +0 -18
- package/dist/core/guards/jwt.guard.d.ts.map +0 -1
- package/dist/core/guards/jwt.guard.js +0 -2
- package/dist/core/guards/jwt.guard.js.map +0 -1
- package/dist/core/guards/oauth.guard.d.ts +0 -35
- package/dist/core/guards/oauth.guard.d.ts.map +0 -1
- package/dist/core/guards/oauth.guard.js +0 -2
- package/dist/core/guards/oauth.guard.js.map +0 -1
- package/dist/core/guards/use-guards.decorator.d.ts +0 -25
- package/dist/core/guards/use-guards.decorator.d.ts.map +0 -1
- package/dist/core/guards/use-guards.decorator.js +0 -32
- package/dist/core/guards/use-guards.decorator.js.map +0 -1
- package/dist/core/health/__tests__/health.test.d.ts +0 -2
- package/dist/core/health/__tests__/health.test.d.ts.map +0 -1
- package/dist/core/health/__tests__/health.test.js +0 -31
- package/dist/core/health/__tests__/health.test.js.map +0 -1
- package/dist/core/health/health-checks.resource.d.ts +0 -14
- package/dist/core/health/health-checks.resource.d.ts.map +0 -1
- package/dist/core/health/health-checks.resource.js +0 -29
- package/dist/core/health/health-checks.resource.js.map +0 -1
- package/dist/core/index.d.ts +0 -56
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -60
- package/dist/core/index.js.map +0 -1
- package/dist/core/interceptors/__tests__/interceptors.test.d.ts +0 -2
- package/dist/core/interceptors/__tests__/interceptors.test.d.ts.map +0 -1
- package/dist/core/interceptors/__tests__/interceptors.test.js +0 -52
- package/dist/core/interceptors/__tests__/interceptors.test.js.map +0 -1
- package/dist/core/interceptors/interceptor.decorator.d.ts +0 -37
- package/dist/core/interceptors/interceptor.decorator.d.ts.map +0 -1
- package/dist/core/interceptors/interceptor.decorator.js +0 -51
- package/dist/core/interceptors/interceptor.decorator.js.map +0 -1
- package/dist/core/interceptors/interceptor.interface.d.ts +0 -31
- package/dist/core/interceptors/interceptor.interface.d.ts.map +0 -1
- package/dist/core/interceptors/interceptor.interface.js +0 -2
- package/dist/core/interceptors/interceptor.interface.js.map +0 -1
- package/dist/core/jwt-module.d.ts +0 -51
- package/dist/core/jwt-module.d.ts.map +0 -1
- package/dist/core/jwt-module.js +0 -52
- package/dist/core/jwt-module.js.map +0 -1
- package/dist/core/logger.d.ts +0 -18
- package/dist/core/logger.d.ts.map +0 -1
- package/dist/core/logger.js +0 -53
- package/dist/core/logger.js.map +0 -1
- package/dist/core/middleware/__tests__/middleware.test.d.ts +0 -2
- package/dist/core/middleware/__tests__/middleware.test.d.ts.map +0 -1
- package/dist/core/middleware/__tests__/middleware.test.js +0 -105
- package/dist/core/middleware/__tests__/middleware.test.js.map +0 -1
- package/dist/core/middleware/middleware.decorator.d.ts +0 -39
- package/dist/core/middleware/middleware.decorator.d.ts.map +0 -1
- package/dist/core/middleware/middleware.decorator.js +0 -53
- package/dist/core/middleware/middleware.decorator.js.map +0 -1
- package/dist/core/middleware/middleware.interface.d.ts +0 -29
- package/dist/core/middleware/middleware.interface.d.ts.map +0 -1
- package/dist/core/middleware/middleware.interface.js +0 -2
- package/dist/core/middleware/middleware.interface.js.map +0 -1
- package/dist/core/module.d.ts +0 -93
- package/dist/core/module.d.ts.map +0 -1
- package/dist/core/module.js +0 -87
- package/dist/core/module.js.map +0 -1
- package/dist/core/oauth-module.d.ts +0 -123
- package/dist/core/oauth-module.d.ts.map +0 -1
- package/dist/core/oauth-module.js +0 -324
- package/dist/core/oauth-module.js.map +0 -1
- package/dist/core/pipes/__tests__/pipes.test.d.ts +0 -2
- package/dist/core/pipes/__tests__/pipes.test.d.ts.map +0 -1
- package/dist/core/pipes/__tests__/pipes.test.js +0 -164
- package/dist/core/pipes/__tests__/pipes.test.js.map +0 -1
- package/dist/core/pipes/pipe.decorator.d.ts +0 -64
- package/dist/core/pipes/pipe.decorator.d.ts.map +0 -1
- package/dist/core/pipes/pipe.decorator.js +0 -85
- package/dist/core/pipes/pipe.decorator.js.map +0 -1
- package/dist/core/pipes/pipe.interface.d.ts +0 -41
- package/dist/core/pipes/pipe.interface.d.ts.map +0 -1
- package/dist/core/pipes/pipe.interface.js +0 -2
- package/dist/core/pipes/pipe.interface.js.map +0 -1
- package/dist/core/prompt.d.ts +0 -46
- package/dist/core/prompt.d.ts.map +0 -1
- package/dist/core/prompt.js +0 -76
- package/dist/core/prompt.js.map +0 -1
- package/dist/core/resource.d.ts +0 -47
- package/dist/core/resource.d.ts.map +0 -1
- package/dist/core/resource.js +0 -90
- package/dist/core/resource.js.map +0 -1
- package/dist/core/server.d.ts +0 -129
- package/dist/core/server.d.ts.map +0 -1
- package/dist/core/server.js +0 -617
- package/dist/core/server.js.map +0 -1
- package/dist/core/tool.d.ts +0 -108
- package/dist/core/tool.d.ts.map +0 -1
- package/dist/core/tool.js +0 -241
- package/dist/core/tool.js.map +0 -1
- package/dist/core/transports/__tests__/transports.test.d.ts +0 -2
- package/dist/core/transports/__tests__/transports.test.d.ts.map +0 -1
- package/dist/core/transports/__tests__/transports.test.js +0 -249
- package/dist/core/transports/__tests__/transports.test.js.map +0 -1
- package/dist/core/transports/discovery-http-server.d.ts +0 -19
- package/dist/core/transports/discovery-http-server.d.ts.map +0 -1
- package/dist/core/transports/discovery-http-server.js +0 -54
- package/dist/core/transports/discovery-http-server.js.map +0 -1
- package/dist/core/transports/http-server.d.ts +0 -108
- package/dist/core/transports/http-server.d.ts.map +0 -1
- package/dist/core/transports/http-server.js +0 -293
- package/dist/core/transports/http-server.js.map +0 -1
- package/dist/core/transports/streamable-http.d.ts +0 -177
- package/dist/core/transports/streamable-http.d.ts.map +0 -1
- package/dist/core/transports/streamable-http.js +0 -1287
- package/dist/core/transports/streamable-http.js.map +0 -1
- package/dist/core/types.d.ts +0 -195
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js +0 -2
- package/dist/core/types.js.map +0 -1
- package/dist/core/widgets/__tests__/registry.test.d.ts +0 -2
- package/dist/core/widgets/__tests__/registry.test.d.ts.map +0 -1
- package/dist/core/widgets/__tests__/registry.test.js +0 -69
- package/dist/core/widgets/__tests__/registry.test.js.map +0 -1
- package/dist/core/widgets/widget-examples.resource.d.ts +0 -17
- package/dist/core/widgets/widget-examples.resource.d.ts.map +0 -1
- package/dist/core/widgets/widget-examples.resource.js +0 -28
- package/dist/core/widgets/widget-examples.resource.js.map +0 -1
- package/dist/core/widgets/widget-registry.d.ts +0 -56
- package/dist/core/widgets/widget-registry.d.ts.map +0 -1
- package/dist/core/widgets/widget-registry.js +0 -75
- package/dist/core/widgets/widget-registry.js.map +0 -1
- package/dist/testing/__tests__/testing.test.d.ts +0 -2
- package/dist/testing/__tests__/testing.test.d.ts.map +0 -1
- package/dist/testing/__tests__/testing.test.js +0 -167
- package/dist/testing/__tests__/testing.test.js.map +0 -1
- package/dist/testing/index.d.ts +0 -103
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js +0 -161
- package/dist/testing/index.js.map +0 -1
- package/dist/ui-next/__tests__/ui-next.test.d.ts +0 -2
- package/dist/ui-next/__tests__/ui-next.test.d.ts.map +0 -1
- package/dist/ui-next/__tests__/ui-next.test.js +0 -74
- package/dist/ui-next/__tests__/ui-next.test.js.map +0 -1
- package/dist/ui-next/index.d.ts +0 -31
- package/dist/ui-next/index.d.ts.map +0 -1
- package/dist/ui-next/index.js +0 -687
- package/dist/ui-next/index.js.map +0 -1
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { describe, it, expect } from '@jest/globals';
|
|
11
|
-
import 'reflect-metadata';
|
|
12
|
-
import { UseFilters, getExceptionFilterMetadata } from '../exception-filter.decorator';
|
|
13
|
-
// Verify what was actually exported
|
|
14
|
-
// The previous view showed:
|
|
15
|
-
// export const EXCEPTION_FILTERS_METADATA = Symbol('filters:exception');
|
|
16
|
-
// export function UseFilters(...filters: ExceptionFilterConstructor[]) ...
|
|
17
|
-
// export function getExceptionFiltersMetadata(target: object, methodName: string): ExceptionFilterConstructor[] ...
|
|
18
|
-
// And interface:
|
|
19
|
-
// export interface ExceptionFilter<T = any> { catch(exception: T, host: ArgumentsHost): void; }
|
|
20
|
-
// Wait, the lint said "Module ... has no exported member 'ExceptionFilter'".
|
|
21
|
-
// Maybe I missed something in view_file 384 output? No output was shown for view_file there?
|
|
22
|
-
// Ah, I viewed file 387 in step 387 but didn't see content?
|
|
23
|
-
// In Step 387/388/389 I listed dir and wrote file. I didn't actually READ the filter interface file content in the prompt history I have.
|
|
24
|
-
// I requested view_file in step 401 (this step).
|
|
25
|
-
// I will see the content NOW. So I should wait for output before replace?
|
|
26
|
-
// But I can guess or try to start pipe test.
|
|
27
|
-
// Actually I am in step 401 generation. I can't read the file yet.
|
|
28
|
-
// I will blindly assume I need to read first.
|
|
29
|
-
// Oh wait, I am generating 401. I requested view_file.
|
|
30
|
-
// I can't do replace_file_content immediately if I rely on that info.
|
|
31
|
-
// But I can queue it if I am confident.
|
|
32
|
-
// I'll wait.
|
|
33
|
-
describe('Filters Module', () => {
|
|
34
|
-
describe('@UseFilters Decorator', () => {
|
|
35
|
-
it('should register filters metadata', () => {
|
|
36
|
-
class MockFilter {
|
|
37
|
-
catch(exception, host) { }
|
|
38
|
-
}
|
|
39
|
-
class TestController {
|
|
40
|
-
method() { }
|
|
41
|
-
}
|
|
42
|
-
__decorate([
|
|
43
|
-
UseFilters(MockFilter),
|
|
44
|
-
__metadata("design:type", Function),
|
|
45
|
-
__metadata("design:paramtypes", []),
|
|
46
|
-
__metadata("design:returntype", void 0)
|
|
47
|
-
], TestController.prototype, "method", null);
|
|
48
|
-
const metadata = getExceptionFilterMetadata(TestController.prototype, 'method');
|
|
49
|
-
expect(metadata).toEqual([MockFilter]);
|
|
50
|
-
});
|
|
51
|
-
it('should register multiple filters', () => {
|
|
52
|
-
class Filter1 {
|
|
53
|
-
catch() { }
|
|
54
|
-
}
|
|
55
|
-
class Filter2 {
|
|
56
|
-
catch() { }
|
|
57
|
-
}
|
|
58
|
-
class TestController {
|
|
59
|
-
method() { }
|
|
60
|
-
}
|
|
61
|
-
__decorate([
|
|
62
|
-
UseFilters(Filter1, Filter2),
|
|
63
|
-
__metadata("design:type", Function),
|
|
64
|
-
__metadata("design:paramtypes", []),
|
|
65
|
-
__metadata("design:returntype", void 0)
|
|
66
|
-
], TestController.prototype, "method", null);
|
|
67
|
-
const metadata = getExceptionFilterMetadata(TestController.prototype, 'method');
|
|
68
|
-
expect(metadata).toEqual([Filter1, Filter2]);
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
//# sourceMappingURL=filters.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filters.test.js","sourceRoot":"","sources":["../../../../src/core/filters/__tests__/filters.test.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAQ,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAGvF,oCAAoC;AACpC,4BAA4B;AAC5B,yEAAyE;AACzE,2EAA2E;AAC3E,oHAAoH;AAEpH,iBAAiB;AACjB,gGAAgG;AAEhG,6EAA6E;AAC7E,6FAA6F;AAC7F,4DAA4D;AAC5D,0IAA0I;AAC1I,iDAAiD;AACjD,0EAA0E;AAC1E,6CAA6C;AAC7C,mEAAmE;AACnE,8CAA8C;AAE9C,uDAAuD;AACvD,sEAAsE;AACtE,wCAAwC;AACxC,aAAa;AAGb,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC5B,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;QACnC,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;YACxC,MAAM,UAAU;gBACZ,KAAK,CAAC,SAAkB,EAAE,IAAS,IAAI,CAAC;aAC3C;YAED,MAAM,cAAc;gBAEhB,MAAM,KAAK,CAAC;aACf;YADG;gBADC,UAAU,CAAC,UAAU,CAAC;;;;wDACX;YAGhB,MAAM,QAAQ,GAAG,0BAA0B,CAAC,cAAc,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;YAChF,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;YACxC,MAAM,OAAO;gBAAuC,KAAK,KAAK,CAAC;aAAE;YACjE,MAAM,OAAO;gBAAuC,KAAK,KAAK,CAAC;aAAE;YAEjE,MAAM,cAAc;gBAEhB,MAAM,KAAK,CAAC;aACf;YADG;gBADC,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC;;;;wDACjB;YAGhB,MAAM,QAAQ,GAAG,0BAA0B,CAAC,cAAc,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;YAChF,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
import { ExceptionFilterConstructor } from './exception-filter.interface.js';
|
|
3
|
-
/**
|
|
4
|
-
* Marks a class as an exception filter
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```typescript
|
|
8
|
-
* @ExceptionFilter()
|
|
9
|
-
* export class GlobalExceptionFilter implements ExceptionFilterInterface {
|
|
10
|
-
* catch(exception: unknown, context: ExecutionContext) {
|
|
11
|
-
* context.logger.error('Exception caught:', exception);
|
|
12
|
-
* return {
|
|
13
|
-
* error: exception instanceof Error ? exception.message : String(exception),
|
|
14
|
-
* timestamp: new Date().toISOString(),
|
|
15
|
-
* };
|
|
16
|
-
* }
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export declare function ExceptionFilter(): ClassDecorator;
|
|
21
|
-
/**
|
|
22
|
-
* Apply exception filters to a tool method
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```typescript
|
|
26
|
-
* @Tool({ name: 'create_user', ... })
|
|
27
|
-
* @UseFilters(ValidationExceptionFilter, HttpExceptionFilter)
|
|
28
|
-
* async createUser(input: Record<string, unknown>) { }
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export declare function UseFilters(...filters: ExceptionFilterConstructor[]): MethodDecorator;
|
|
32
|
-
/**
|
|
33
|
-
* Get exception filters for a method
|
|
34
|
-
*/
|
|
35
|
-
export declare function getExceptionFilterMetadata(target: object, propertyKey: string | symbol): ExceptionFilterConstructor[];
|
|
36
|
-
/**
|
|
37
|
-
* Check if a class is marked as an exception filter
|
|
38
|
-
*/
|
|
39
|
-
export declare function isExceptionFilter(target: object): boolean;
|
|
40
|
-
//# sourceMappingURL=exception-filter.decorator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exception-filter.decorator.d.ts","sourceRoot":"","sources":["../../../src/core/filters/exception-filter.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAK7E;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,IAAI,cAAc,CAIhD;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,GAAG,OAAO,EAAE,0BAA0B,EAAE,GAAG,eAAe,CAUpF;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,0BAA0B,EAAE,CAErH;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEzD"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
const EXCEPTION_FILTER_KEY = 'nitrostack:exception_filter';
|
|
3
|
-
const IS_EXCEPTION_FILTER_KEY = 'nitrostack:is_exception_filter';
|
|
4
|
-
/**
|
|
5
|
-
* Marks a class as an exception filter
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* @ExceptionFilter()
|
|
10
|
-
* export class GlobalExceptionFilter implements ExceptionFilterInterface {
|
|
11
|
-
* catch(exception: unknown, context: ExecutionContext) {
|
|
12
|
-
* context.logger.error('Exception caught:', exception);
|
|
13
|
-
* return {
|
|
14
|
-
* error: exception instanceof Error ? exception.message : String(exception),
|
|
15
|
-
* timestamp: new Date().toISOString(),
|
|
16
|
-
* };
|
|
17
|
-
* }
|
|
18
|
-
* }
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export function ExceptionFilter() {
|
|
22
|
-
return (target) => {
|
|
23
|
-
Reflect.defineMetadata(IS_EXCEPTION_FILTER_KEY, true, target);
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Apply exception filters to a tool method
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* @Tool({ name: 'create_user', ... })
|
|
32
|
-
* @UseFilters(ValidationExceptionFilter, HttpExceptionFilter)
|
|
33
|
-
* async createUser(input: Record<string, unknown>) { }
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export function UseFilters(...filters) {
|
|
37
|
-
return (target, propertyKey, descriptor) => {
|
|
38
|
-
const existingFilters = Reflect.getMetadata(EXCEPTION_FILTER_KEY, target, propertyKey) || [];
|
|
39
|
-
Reflect.defineMetadata(EXCEPTION_FILTER_KEY, [...existingFilters, ...filters], target, propertyKey);
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Get exception filters for a method
|
|
44
|
-
*/
|
|
45
|
-
export function getExceptionFilterMetadata(target, propertyKey) {
|
|
46
|
-
return Reflect.getMetadata(EXCEPTION_FILTER_KEY, target, propertyKey) || [];
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Check if a class is marked as an exception filter
|
|
50
|
-
*/
|
|
51
|
-
export function isExceptionFilter(target) {
|
|
52
|
-
return Reflect.getMetadata(IS_EXCEPTION_FILTER_KEY, target) === true;
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=exception-filter.decorator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exception-filter.decorator.js","sourceRoot":"","sources":["../../../src/core/filters/exception-filter.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAG1B,MAAM,oBAAoB,GAAG,6BAA6B,CAAC;AAC3D,MAAM,uBAAuB,GAAG,gCAAgC,CAAC;AAEjE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,CAAC,MAAc,EAAE,EAAE;QACxB,OAAO,CAAC,cAAc,CAAC,uBAAuB,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAChE,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,GAAG,OAAqC;IACjE,OAAO,CAAC,MAAc,EAAE,WAA4B,EAAE,UAA8B,EAAE,EAAE;QACtF,MAAM,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC,oBAAoB,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC;QAC7F,OAAO,CAAC,cAAc,CACpB,oBAAoB,EACpB,CAAC,GAAG,eAAe,EAAE,GAAG,OAAO,CAAC,EAChC,MAAM,EACN,WAAW,CACZ,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,MAAc,EAAE,WAA4B;IACrF,OAAO,OAAO,CAAC,WAAW,CAAC,oBAAoB,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC;AAC9E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,OAAO,OAAO,CAAC,WAAW,CAAC,uBAAuB,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;AACvE,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
import { ExecutionContext } from '../types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Exception with optional status code
|
|
5
|
-
*/
|
|
6
|
-
export interface ExceptionWithStatus extends Error {
|
|
7
|
-
status?: number;
|
|
8
|
-
statusCode?: number;
|
|
9
|
-
code?: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Exception Filter Interface
|
|
13
|
-
*
|
|
14
|
-
* Exception filters handle errors thrown during tool execution.
|
|
15
|
-
* They can transform errors into user-friendly responses.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```typescript
|
|
19
|
-
* @ExceptionFilter()
|
|
20
|
-
* export class HttpExceptionFilter implements ExceptionFilterInterface {
|
|
21
|
-
* catch(exception: unknown, context: ExecutionContext) {
|
|
22
|
-
* const err = exception as ExceptionWithStatus;
|
|
23
|
-
* return {
|
|
24
|
-
* statusCode: err.status || 500,
|
|
25
|
-
* message: err.message,
|
|
26
|
-
* timestamp: new Date().toISOString(),
|
|
27
|
-
* };
|
|
28
|
-
* }
|
|
29
|
-
* }
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
export interface ExceptionFilterInterface {
|
|
33
|
-
catch(exception: unknown, context: ExecutionContext): unknown | Promise<unknown>;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Exception filter constructor type
|
|
37
|
-
*/
|
|
38
|
-
export type ExceptionFilterConstructor = new (...args: unknown[]) => ExceptionFilterInterface;
|
|
39
|
-
//# sourceMappingURL=exception-filter.interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exception-filter.interface.d.ts","sourceRoot":"","sources":["../../../src/core/filters/exception-filter.interface.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,KAAK;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,wBAAwB;IACvC,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAClF;AAED;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,wBAAwB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exception-filter.interface.js","sourceRoot":"","sources":["../../../src/core/filters/exception-filter.interface.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"guards.test.d.ts","sourceRoot":"","sources":["../../../../src/core/guards/__tests__/guards.test.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { describe, it, expect } from '@jest/globals';
|
|
11
|
-
import 'reflect-metadata';
|
|
12
|
-
import { UseGuards, getGuardsMetadata } from '../use-guards.decorator';
|
|
13
|
-
describe('Guards Module', () => {
|
|
14
|
-
describe('@UseGuards Decorator', () => {
|
|
15
|
-
it('should register guards metadata', () => {
|
|
16
|
-
class MockGuard {
|
|
17
|
-
canActivate(context) {
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
class TestController {
|
|
22
|
-
testMethod() { }
|
|
23
|
-
}
|
|
24
|
-
__decorate([
|
|
25
|
-
UseGuards(MockGuard),
|
|
26
|
-
__metadata("design:type", Function),
|
|
27
|
-
__metadata("design:paramtypes", []),
|
|
28
|
-
__metadata("design:returntype", void 0)
|
|
29
|
-
], TestController.prototype, "testMethod", null);
|
|
30
|
-
const metadata = getGuardsMetadata(TestController.prototype, 'testMethod');
|
|
31
|
-
expect(metadata).toEqual([MockGuard]);
|
|
32
|
-
});
|
|
33
|
-
it('should register multiple guards', () => {
|
|
34
|
-
class Guard1 {
|
|
35
|
-
canActivate() { return true; }
|
|
36
|
-
}
|
|
37
|
-
class Guard2 {
|
|
38
|
-
canActivate() { return true; }
|
|
39
|
-
}
|
|
40
|
-
class TestController {
|
|
41
|
-
method() { }
|
|
42
|
-
}
|
|
43
|
-
__decorate([
|
|
44
|
-
UseGuards(Guard1, Guard2),
|
|
45
|
-
__metadata("design:type", Function),
|
|
46
|
-
__metadata("design:paramtypes", []),
|
|
47
|
-
__metadata("design:returntype", void 0)
|
|
48
|
-
], TestController.prototype, "method", null);
|
|
49
|
-
const metadata = getGuardsMetadata(TestController.prototype, 'method');
|
|
50
|
-
expect(metadata).toHaveLength(2);
|
|
51
|
-
expect(metadata).toEqual([Guard1, Guard2]);
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
//# sourceMappingURL=guards.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"guards.test.js","sourceRoot":"","sources":["../../../../src/core/guards/__tests__/guards.test.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAQ,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAIvE,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAE3B,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;QAClC,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;YACvC,MAAM,SAAS;gBACX,WAAW,CAAC,OAAyB;oBACjC,OAAO,IAAI,CAAC;gBAChB,CAAC;aACJ;YAED,MAAM,cAAc;gBAEhB,UAAU,KAAK,CAAC;aACnB;YADG;gBADC,SAAS,CAAC,SAAS,CAAC;;;;4DACL;YAGpB,MAAM,QAAQ,GAAG,iBAAiB,CAAC,cAAc,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;YAC3E,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;YACvC,MAAM,MAAM;gBAAoB,WAAW,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;aAAE;YAChE,MAAM,MAAM;gBAAoB,WAAW,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;aAAE;YAEhE,MAAM,cAAc;gBAEhB,MAAM,KAAK,CAAC;aACf;YADG;gBADC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;;;;wDACd;YAGhB,MAAM,QAAQ,GAAG,iBAAiB,CAAC,cAAc,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;YACvE,MAAM,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YACjC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API Key Guard Interface
|
|
3
|
-
*
|
|
4
|
-
* This is exported from the SDK for type definitions.
|
|
5
|
-
* The actual ApiKeyGuard implementation should be in your project's guards folder.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* See templates/typescript-auth-api-key/src/guards/apikey.guard.ts for implementation
|
|
9
|
-
*/
|
|
10
|
-
export interface ApiKeyMetadata {
|
|
11
|
-
/** The API key value (raw) */
|
|
12
|
-
key: string;
|
|
13
|
-
/** Optional: API key name/identifier */
|
|
14
|
-
name?: string;
|
|
15
|
-
/** Optional: Key prefix (e.g., 'sk' for secret key, 'pk' for public key) */
|
|
16
|
-
prefix?: string;
|
|
17
|
-
/** Optional: Scopes/permissions */
|
|
18
|
-
scopes?: string[];
|
|
19
|
-
/** Optional: Additional metadata */
|
|
20
|
-
[key: string]: unknown;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=apikey.guard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apikey.guard.d.ts","sourceRoot":"","sources":["../../../src/core/guards/apikey.guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,GAAG,EAAE,MAAM,CAAC;IAEZ,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB,oCAAoC;IACpC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API Key Guard Interface
|
|
3
|
-
*
|
|
4
|
-
* This is exported from the SDK for type definitions.
|
|
5
|
-
* The actual ApiKeyGuard implementation should be in your project's guards folder.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* See templates/typescript-auth-api-key/src/guards/apikey.guard.ts for implementation
|
|
9
|
-
*/
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=apikey.guard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apikey.guard.js","sourceRoot":"","sources":["../../../src/core/guards/apikey.guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ExecutionContext } from '../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Guard interface for protecting tool execution
|
|
4
|
-
* Guards can perform authentication, authorization, validation, etc.
|
|
5
|
-
*/
|
|
6
|
-
export interface Guard {
|
|
7
|
-
/**
|
|
8
|
-
* Determines if the current execution context is allowed to proceed
|
|
9
|
-
* @param context Execution context with request metadata
|
|
10
|
-
* @returns true if allowed, false if denied, or throws an error
|
|
11
|
-
*/
|
|
12
|
-
canActivate(context: ExecutionContext): boolean | Promise<boolean>;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Type for guard constructor
|
|
16
|
-
*/
|
|
17
|
-
export type GuardConstructor = new (...args: unknown[]) => Guard;
|
|
18
|
-
//# sourceMappingURL=guard.interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"guard.interface.d.ts","sourceRoot":"","sources":["../../../src/core/guards/guard.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB;;;;OAIG;IACH,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACpE;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,KAAK,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"guard.interface.js","sourceRoot":"","sources":["../../../src/core/guards/guard.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* JWT payload interface
|
|
3
|
-
*
|
|
4
|
-
* This is exported from the SDK for type definitions.
|
|
5
|
-
* The actual JWTGuard implementation should be in your project's guards folder.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* See templates/typescript-auth/src/guards/jwt.guard.ts for implementation
|
|
9
|
-
*/
|
|
10
|
-
export interface JWTPayload {
|
|
11
|
-
sub: string;
|
|
12
|
-
email?: string;
|
|
13
|
-
name?: string;
|
|
14
|
-
iat?: number;
|
|
15
|
-
exp?: number;
|
|
16
|
-
[key: string]: unknown;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=jwt.guard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.guard.d.ts","sourceRoot":"","sources":["../../../src/core/guards/jwt.guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.guard.js","sourceRoot":"","sources":["../../../src/core/guards/jwt.guard.ts"],"names":[],"mappings":""}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OAuth Token Payload Interface
|
|
3
|
-
*
|
|
4
|
-
* Standard OAuth 2.1 / JWT claims (RFC 9068)
|
|
5
|
-
*
|
|
6
|
-
* This is exported from the SDK for type definitions.
|
|
7
|
-
* The actual OAuthGuard implementation should be in your project's guards folder.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* See templates/typescript-oauth/src/guards/oauth.guard.ts for implementation
|
|
11
|
-
*/
|
|
12
|
-
export interface OAuthTokenPayload {
|
|
13
|
-
/** Subject - typically the user ID */
|
|
14
|
-
sub: string;
|
|
15
|
-
/** Issuer - the authorization server that issued the token */
|
|
16
|
-
iss?: string;
|
|
17
|
-
/** Audience - who the token is intended for (RFC 8707) */
|
|
18
|
-
aud?: string | string[];
|
|
19
|
-
/** Expiration time (Unix timestamp) */
|
|
20
|
-
exp?: number;
|
|
21
|
-
/** Issued at time (Unix timestamp) */
|
|
22
|
-
iat?: number;
|
|
23
|
-
/** Not before time (Unix timestamp) */
|
|
24
|
-
nbf?: number;
|
|
25
|
-
/** JWT ID - unique identifier for the token */
|
|
26
|
-
jti?: string;
|
|
27
|
-
/** Scopes - permissions granted to the token */
|
|
28
|
-
scope?: string;
|
|
29
|
-
scopes?: string[];
|
|
30
|
-
/** Client ID that requested the token */
|
|
31
|
-
client_id?: string;
|
|
32
|
-
/** Custom claims */
|
|
33
|
-
[key: string]: unknown;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=oauth.guard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.guard.d.ts","sourceRoot":"","sources":["../../../src/core/guards/oauth.guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,iBAAiB;IAChC,sCAAsC;IACtC,GAAG,EAAE,MAAM,CAAC;IAEZ,8DAA8D;IAC9D,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,0DAA0D;IAC1D,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAExB,uCAAuC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,sCAAsC;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,uCAAuC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,oBAAoB;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.guard.js","sourceRoot":"","sources":["../../../src/core/guards/oauth.guard.ts"],"names":[],"mappings":""}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
import { GuardConstructor } from './guard.interface.js';
|
|
3
|
-
/**
|
|
4
|
-
* Metadata key for guards
|
|
5
|
-
*/
|
|
6
|
-
export declare const GUARDS_METADATA: unique symbol;
|
|
7
|
-
/**
|
|
8
|
-
* UseGuards decorator - Applies guards to a tool method
|
|
9
|
-
* Guards are executed before the tool handler
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* @Tool({ name: 'whoami', ... })
|
|
14
|
-
* @UseGuards(JWTGuard)
|
|
15
|
-
* async whoami(input: Record<string, unknown>, context: ExecutionContext) {
|
|
16
|
-
* // This only executes if JWTGuard.canActivate returns true
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export declare function UseGuards(...guards: GuardConstructor[]): (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
21
|
-
/**
|
|
22
|
-
* Get guards metadata for a specific method
|
|
23
|
-
*/
|
|
24
|
-
export declare function getGuardsMetadata(target: object, methodName: string): GuardConstructor[];
|
|
25
|
-
//# sourceMappingURL=use-guards.decorator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-guards.decorator.d.ts","sourceRoot":"","sources":["../../../src/core/guards/use-guards.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,eAAe,eAA4B,CAAC;AAEzD;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,GAAG,MAAM,EAAE,gBAAgB,EAAE,IACpC,QAAQ,MAAM,EAAE,aAAa,MAAM,EAAE,YAAY,kBAAkB,wBAKrF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAExF"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
/**
|
|
3
|
-
* Metadata key for guards
|
|
4
|
-
*/
|
|
5
|
-
export const GUARDS_METADATA = Symbol('guards:metadata');
|
|
6
|
-
/**
|
|
7
|
-
* UseGuards decorator - Applies guards to a tool method
|
|
8
|
-
* Guards are executed before the tool handler
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* @Tool({ name: 'whoami', ... })
|
|
13
|
-
* @UseGuards(JWTGuard)
|
|
14
|
-
* async whoami(input: Record<string, unknown>, context: ExecutionContext) {
|
|
15
|
-
* // This only executes if JWTGuard.canActivate returns true
|
|
16
|
-
* }
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export function UseGuards(...guards) {
|
|
20
|
-
return function (target, propertyKey, descriptor) {
|
|
21
|
-
// Store guards metadata for this method
|
|
22
|
-
Reflect.defineMetadata(GUARDS_METADATA, guards, target, propertyKey);
|
|
23
|
-
return descriptor;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Get guards metadata for a specific method
|
|
28
|
-
*/
|
|
29
|
-
export function getGuardsMetadata(target, methodName) {
|
|
30
|
-
return Reflect.getMetadata(GUARDS_METADATA, target, methodName) || [];
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=use-guards.decorator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-guards.decorator.js","sourceRoot":"","sources":["../../../src/core/guards/use-guards.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAG1B;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAEzD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,SAAS,CAAC,GAAG,MAA0B;IACrD,OAAO,UAAU,MAAc,EAAE,WAAmB,EAAE,UAA8B;QAClF,wCAAwC;QACxC,OAAO,CAAC,cAAc,CAAC,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QACrE,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc,EAAE,UAAkB;IAClE,OAAO,OAAO,CAAC,WAAW,CAAC,eAAe,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC;AACxE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"health.test.d.ts","sourceRoot":"","sources":["../../../../src/core/health/__tests__/health.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jest, describe, it, expect } from '@jest/globals';
|
|
2
|
-
const mockGetAllHealthChecks = jest.fn();
|
|
3
|
-
jest.unstable_mockModule('../../decorators/health-check.decorator.js', () => ({
|
|
4
|
-
getAllHealthChecks: mockGetAllHealthChecks,
|
|
5
|
-
}));
|
|
6
|
-
const { buildHealthChecksResource } = await import('../health-checks.resource.js');
|
|
7
|
-
describe('Health Checks', () => {
|
|
8
|
-
it('should build health resource with checks', async () => {
|
|
9
|
-
mockGetAllHealthChecks.mockResolvedValue({
|
|
10
|
-
db: { status: 'ok', latency: 10 },
|
|
11
|
-
api: { status: 'ok' }
|
|
12
|
-
});
|
|
13
|
-
const resource = await buildHealthChecksResource();
|
|
14
|
-
expect(resource.uri).toBe('health://checks');
|
|
15
|
-
expect(resource.read).toBeDefined();
|
|
16
|
-
const resultJson = await resource.read();
|
|
17
|
-
const result = JSON.parse(resultJson);
|
|
18
|
-
expect(result.count).toBe(2);
|
|
19
|
-
expect(result.checks).toHaveLength(2);
|
|
20
|
-
expect(result.checks[0].name).toBe('db');
|
|
21
|
-
expect(result.checks[0].status).toBe('ok');
|
|
22
|
-
});
|
|
23
|
-
it('should handle empty checks', async () => {
|
|
24
|
-
mockGetAllHealthChecks.mockResolvedValue({});
|
|
25
|
-
const resource = await buildHealthChecksResource();
|
|
26
|
-
const result = JSON.parse(await resource.read());
|
|
27
|
-
expect(result.count).toBe(0);
|
|
28
|
-
expect(result.checks).toHaveLength(0);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
//# sourceMappingURL=health.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"health.test.js","sourceRoot":"","sources":["../../../../src/core/health/__tests__/health.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE3D,MAAM,sBAAsB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAEzC,IAAI,CAAC,mBAAmB,CAAC,4CAA4C,EAAE,GAAG,EAAE,CAAC,CAAC;IAC1E,kBAAkB,EAAE,sBAAsB;CAC7C,CAAC,CAAC,CAAC;AAEJ,MAAM,EAAE,yBAAyB,EAAE,GAAG,MAAM,MAAM,CAAC,8BAA8B,CAAC,CAAC;AAEnF,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACrD,sBAA8B,CAAC,iBAAiB,CAAC;YAC9C,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;YACjC,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;SACxB,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,MAAM,yBAAyB,EAAE,CAAC;QAEnD,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC7C,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;QAEpC,MAAM,UAAU,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACzC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAEtC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACtC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QACvC,sBAA8B,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;QAEtD,MAAM,QAAQ,GAAG,MAAM,yBAAyB,EAAE,CAAC;QACnD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QAEjD,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Health Checks Resource
|
|
3
|
-
*
|
|
4
|
-
* Exposes all registered health checks as an MCP resource
|
|
5
|
-
* so clients can query health status
|
|
6
|
-
*/
|
|
7
|
-
export declare function buildHealthChecksResource(): Promise<{
|
|
8
|
-
uri: string;
|
|
9
|
-
name: string;
|
|
10
|
-
description: string;
|
|
11
|
-
mimeType: string;
|
|
12
|
-
read(): Promise<string>;
|
|
13
|
-
}>;
|
|
14
|
-
//# sourceMappingURL=health-checks.resource.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"health-checks.resource.d.ts","sourceRoot":"","sources":["../../../src/core/health/health-checks.resource.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAsB,yBAAyB;;;;;;GAsB9C"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { getAllHealthChecks } from '../decorators/health-check.decorator.js';
|
|
2
|
-
/**
|
|
3
|
-
* Health Checks Resource
|
|
4
|
-
*
|
|
5
|
-
* Exposes all registered health checks as an MCP resource
|
|
6
|
-
* so clients can query health status
|
|
7
|
-
*/
|
|
8
|
-
export async function buildHealthChecksResource() {
|
|
9
|
-
return {
|
|
10
|
-
uri: 'health://checks',
|
|
11
|
-
name: 'Health Checks',
|
|
12
|
-
description: 'Current health status of all registered health checks',
|
|
13
|
-
mimeType: 'application/json',
|
|
14
|
-
async read() {
|
|
15
|
-
const checks = await getAllHealthChecks();
|
|
16
|
-
// Transform to array format
|
|
17
|
-
const checksArray = Object.entries(checks).map(([name, result]) => ({
|
|
18
|
-
name,
|
|
19
|
-
...result,
|
|
20
|
-
}));
|
|
21
|
-
return JSON.stringify({
|
|
22
|
-
checks: checksArray,
|
|
23
|
-
count: checksArray.length,
|
|
24
|
-
timestamp: new Date().toISOString(),
|
|
25
|
-
}, null, 2);
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=health-checks.resource.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"health-checks.resource.js","sourceRoot":"","sources":["../../../src/core/health/health-checks.resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB;IAC7C,OAAO;QACL,GAAG,EAAE,iBAAiB;QACtB,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,uDAAuD;QACpE,QAAQ,EAAE,kBAAkB;QAC5B,KAAK,CAAC,IAAI;YACR,MAAM,MAAM,GAAG,MAAM,kBAAkB,EAAE,CAAC;YAE1C,4BAA4B;YAC5B,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;gBAClE,IAAI;gBACJ,GAAG,MAAM;aACV,CAAC,CAAC,CAAC;YAEJ,OAAO,IAAI,CAAC,SAAS,CAAC;gBACpB,MAAM,EAAE,WAAW;gBACnB,KAAK,EAAE,WAAW,CAAC,MAAM;gBACzB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACpC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACd,CAAC;KACF,CAAC;AACJ,CAAC"}
|