@xeno-js/core 2.0.0 → 2.0.2

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/dist/index.d.ts CHANGED
@@ -1,21 +1,8 @@
1
- import { ICache, Optional, IExtendendAuthService, IBaseAuthService, ICacheKeyBuilder, IPipelineBehavior, ICommand, IConcurrencyService, IConfigurationService, ILogger, IMediator, IMiddleware, IQuery, RequestContext, IServiceResilience, IServiceExtractor, Metadata, IUnitOfWork, IDisposable, IValidatorService, IIdentityAccessor, IContextAccessor, INetworkContextAccessor, IFactory, UserContext, ITransactionState, Factory, IBaseAccessor, Identity, ExtendedRequest, HttpMethod, AuthConfig, CookieOptions, SetupAction, HttpClientConfig, LogLevel, ILoggerClient, Dictionary, AuthPolicy, IStrategy, IRequest, ResponseDto, IHandler, ResultType, ISpecification, CacheConfig, DbConfig, IReadDao, IReadDataSource, IMapper, IRepository, IWriteDataSource, IController, AppError } from '@xeno-js/shared';
1
+ import { Optional, RequestContext, HttpMethod, AuthConfig, CookieOptions, IServiceExtractor, IExtendendAuthService, SetupAction, HttpClientConfig, LogLevel, ILoggerClient, Dictionary, AuthPolicy, IStrategy, IRequest, ResponseDto, IContextAccessor, ResultType, Identity, ISpecification, IConfigurationService, CacheConfig, DbConfig, ExtendedRequest, IReadDao, IReadDataSource, IMapper, UserContext, IRepository, IWriteDataSource, IController, IMediator, AppError, IQuery, ICommand } from '@xeno-js/shared';
2
2
  export * from '@xeno-js/shared';
3
3
  export { Query } from '@xeno-js/shared';
4
-
5
- /**
6
- * @description IAtomicCache is an interface that extends the ICache interface and adds an increment method. The increment method takes a key and an optional ttlSeconds parameter and returns a Promise that resolves to an incremented value.
7
- *
8
- */
9
- interface IAtomicCache extends ICache {
10
- /**
11
- * @description The increment method increments the value associated with the given key in the cache. If the key does not exist, it is created with an initial value of 1. The method returns a Promise that resolves to the incremented value.
12
- *
13
- * @param key The key to increment the value for.
14
- * @param ttlSeconds The time-to-live (TTL) in seconds for the key-value pair. If not provided, the default TTL is used.
15
- * @returns A Promise that resolves to the incremented value.
16
- */
17
- increment(key: string, ttlSeconds: Optional<number | string>): Promise<number>;
18
- }
4
+ import { A as ApplicationRegistry, I as IServiceProvider, a as IServiceScope, b as IServiceContainer, c as IHttpAdapter, X as XenoWebTransport } from './itoken-service.contracts-3GrRvKeZ.js';
5
+ export { d as IAtomicCache, e as ICryptoService, f as ICsrfTokenService, g as IRequestContext, h as IServiceScopeAccessor } from './itoken-service.contracts-3GrRvKeZ.js';
19
6
 
20
7
  /**
21
8
  * @description An interface that defines the contract for a rate limit key builder in a Xeno Vue application. This interface requires the implementation of a single method, buildRateLimitKey, which takes a resource and a client IP address as parameters and returns a string representing the rate limit key.
@@ -36,380 +23,6 @@ interface IRateLimitKeyBuilder {
36
23
  buildRateLimitKey(resource: string): Optional<string>;
37
24
  }
38
25
 
39
- /**
40
- * @description This file defines the injection tokens used for dependency injection in the application.
41
- * Injection tokens are unique identifiers that are used to register and resolve dependencies in the container.
42
- * They can be symbols, strings, or classes, but using symbols is a common practice to avoid naming collisions.
43
- *
44
- * @author Xeno
45
- * @version 1.0.0
46
- * @since 2025-09-30
47
- * @link https://github.com/xeno-js/xeno-js
48
- */
49
- interface ApplicationRegistry<T = unknown, Ttx = unknown> {
50
- /** @description Token used to register and resolve the Extended AuthService instance in the dependency injection container.
51
- *
52
- * @author Xeno
53
- * @version 1.0.0
54
- * @since 2025-09-30
55
- * @link https://github.com/xeno-js/xeno-js
56
- */
57
- readonly AUTH_SERVICE: IExtendendAuthService;
58
- /** @description Token used to register and resolve the BaseAuthService instance in the dependency injection container.
59
- *
60
- * @author Xeno
61
- * @version 1.0.0
62
- * @since 2025-09-30
63
- * @link https://github.com/xeno-js/xeno-js
64
- */
65
- readonly BASE_AUTH_SERVICE: IBaseAuthService;
66
- /** @description Token used to register and resolve the InMemoryCache instance in the dependency injection container.
67
- *
68
- * @author Xeno
69
- * @version 1.0.0
70
- * @since 2025-09-30
71
- * @link https://github.com/xeno-js/xeno-js
72
- */
73
- readonly CACHE: IAtomicCache;
74
- /** @description Token used to register and resolve the CacheKeyBuilder instance in the dependency injection container.
75
- *
76
- * @author Xeno
77
- * @version 1.0.0
78
- * @since 2025-09-30
79
- * @link https://github.com/xeno-js/xeno-js
80
- */
81
- readonly CACHE_KEY_BUILDER: ICacheKeyBuilder;
82
- /** @description Token used to register and resolve the CommandPipeline behaviors in the dependency injection container.
83
- *
84
- * @author Xeno
85
- * @version 1.0.0
86
- * @since 2025-09-30
87
- * @link https://github.com/xeno-js/xeno-js
88
- */
89
- readonly COMMAND_PIPELINES_BEHAVIOR: IPipelineBehavior<ICommand, unknown>;
90
- /** @description Token used to register and resolve the ConcurrencyService instance in the dependency injection container.
91
- *
92
- * @author Xeno
93
- * @version 1.0.0
94
- * @since 2025-09-30
95
- * @link https://github.com/xeno-js/xeno-js
96
- */
97
- readonly CONCURRENCY_SERVICE: IConcurrencyService;
98
- /** @description Token used to register and resolve the ConfigurationService instance in the dependency injection container.
99
- *
100
- * @author Xeno
101
- * @version 1.0.0
102
- * @since 2025-09-30
103
- * @link https://github.com/xeno-js/xeno-js
104
- */
105
- readonly CONFIGURATION_SERVICE: IConfigurationService;
106
- /** @description Token used to register and resolve the CsrfTokenService instance in the dependency injection container.
107
- *
108
- * @author Xeno
109
- * @version 1.0.0
110
- * @since 2025-09-30
111
- * @link https://github.com/xeno-js/xeno-js
112
- */
113
- readonly CSRF_TOKEN_SERVICE: ICsrfTokenService;
114
- /** @description Token used to register and resolve the CryptoService instance in the dependency injection container.
115
- *
116
- * @author Xeno
117
- * @version 1.0.0
118
- * @since 2025-09-30
119
- * @link https://github.com/xeno-js/xeno-js
120
- */
121
- readonly CRYPTO_SERVICE: ICryptoService;
122
- /** @description Token used to register and resolve the DbContext instance in the dependency injection container.
123
- *
124
- * @author Xeno
125
- * @version 1.0.0
126
- * @since 2025-09-30
127
- * @link https://github.com/xeno-js/xeno-js
128
- */
129
- readonly DB_CONTEXT: T;
130
- /** @description Token used to register and resolve the HTTP Adapter instance in the dependency injection container.
131
- *
132
- * @author Xeno
133
- * @version 1.2.1
134
- * @since 2025-09-30
135
- * @link https://github.com/xeno-js/xeno-js
136
- */
137
- readonly HTTP_ADAPTER: IHttpAdapter<unknown, unknown>;
138
- /** @description Token used to register and resolve the Logger instance in the dependency injection container.
139
- *
140
- * @author Xeno
141
- * @version 1.0.0
142
- * @since 2025-09-30
143
- * @link https://github.com/xeno-js/xeno-js
144
- */
145
- readonly LOGGER: ILogger;
146
- /** @description Token used to register and resolve the Mediator instance in the dependency injection container.
147
- *
148
- * @author Xeno
149
- * @version 1.0.0
150
- * @since 2025-09-30
151
- * @link https://github.com/xeno-js/xeno-js
152
- */
153
- readonly MEDIATOR: IMediator;
154
- /** @description Token used to register and resolve the RequestContextMiddleware in the dependency injection container.
155
- *
156
- * @author Xeno
157
- * @version 1.0.0
158
- * @since 2025-09-30
159
- * @link https://github.com/xeno-js/xeno-js
160
- */
161
- readonly MIDDLEWARE: IMiddleware;
162
- /** @description Token used to register and resolve the QueryPipeline behaviors in the dependency injection container.
163
- *
164
- * @author Xeno
165
- * @version 1.0.0
166
- * @since 2025-09-30
167
- * @link https://github.com/xeno-js/xeno-js
168
- */
169
- readonly QUERY_PIPELINES_BEHAVIOR: IPipelineBehavior<IQuery, unknown>;
170
- /** @description Token used to register and resolve the RequestContext instance in the dependency injection container.
171
- *
172
- * @author Xeno
173
- * @version 1.0.0
174
- * @since 2025-09-30
175
- * @link https://github.com/xeno-js/xeno-js
176
- */
177
- readonly REQUEST_CONTEXT: IRequestContext<RequestContext, ApplicationRegistry<T>>;
178
- /** @description Token used to register and resolve the IServiceResilience instance in the dependency injection container.
179
- *
180
- * @author Xeno
181
- * @version 1.0.0
182
- * @since 2025-09-30
183
- * @link https://github.com/xeno-js/xeno-js
184
- */
185
- readonly RESILIENCE_CLIENT: IServiceResilience;
186
- /** @description Token used to register and resolve the ServiceContainer instance in the dependency injection container.
187
- *
188
- * @author Xeno
189
- * @version 1.0.0
190
- * @since 2025-09-30
191
- * @link https://github.com/xeno-js/xeno-js
192
- */
193
- readonly SERVICE_CONTAINER: IServiceContainer;
194
- /** @description Token used to register and resolve the ServiceExtractor instance in the dependency injection container.
195
- *
196
- * @author Xeno
197
- * @version 1.0.0
198
- * @since 2025-09-30
199
- * @link https://github.com/xeno-js/xeno-js
200
- */
201
- readonly SERVICE_EXTRACTOR: IServiceExtractor<Request['headers'], Metadata>;
202
- /** @description Token used to register and resolve the UnitOfWork instance in the dependency injection container.
203
- *
204
- * @author Xeno
205
- * @version 1.0.0
206
- * @since 2025-09-30
207
- * @link https://github.com/xeno-js/xeno-js
208
- */
209
- readonly UNIT_OF_WORK: IUnitOfWork & IDisposable;
210
- /** @description Token used to register and resolve the ZodValidator instance in the dependency injection container.
211
- *
212
- * @author Xeno
213
- * @version 1.0.0
214
- * @since 2025-09-30
215
- * @link https://github.com/xeno-js/xeno-js
216
- */
217
- readonly VALIDATOR_SERVICE: IValidatorService;
218
- /** @description Token used to register and resolve the IIdentityAccessor in the dependency injection container, allowing access only to current user identity information.
219
- *
220
- * @author Xeno
221
- * @version 1.0.0
222
- * @since 2025-09-30
223
- * @link https://github.com/xeno-js/xeno-js
224
- */
225
- readonly IDENTITY_ACCESSOR: IIdentityAccessor;
226
- /** @description Token used to register and resolve the IServiceScopeAccessor in the dependency injection container, granting controlled access to the current request scope.
227
- *
228
- * @author Xeno
229
- * @version 1.0.0
230
- * @since 2025-09-30
231
- * @link https://github.com/xeno-js/xeno-js
232
- */
233
- readonly SERVICE_SCOPE_ACCESSOR: IServiceScopeAccessor<ApplicationRegistry<T>>;
234
- /** @description Token used to register and resolve the IContextAccessor instance in the dependency injection container to fetch execution context properties.
235
- *
236
- * @author Xeno
237
- * @version 1.0.0
238
- * @since 2025-09-30
239
- * @link https://github.com/xeno-js/xeno-js
240
- */
241
- readonly CONTEXT_ACCESSOR: IContextAccessor<RequestContext>;
242
- /** @description Token used to register and resolve the INetworkContextAccessor instance in the dependency injection container to fetch networking/observability context data.
243
- *
244
- * @author Xeno
245
- * @version 1.0.0
246
- * @since 2025-09-30
247
- * @link https://github.com/xeno-js/xeno-js
248
- */
249
- readonly NETWORK_CONTEXT_ACCESSOR: INetworkContextAccessor;
250
- /** @description Token used to register and resolve the UserContext factory in the dependency injection container.
251
- *
252
- * @author Xeno
253
- * @version 1.0.0
254
- * @since 2025-09-30
255
- * @link https://github.com/xeno-js/xeno-js
256
- */
257
- readonly USER_CONTEXT_FACTORY: IFactory<void, UserContext>;
258
- /** @description Token used to register and resolve the TransactionState instance in the dependency injection container.
259
- *
260
- * @author Xeno
261
- * @version 1.0.0
262
- * @since 2025-09-30
263
- * @link https://github.com/xeno-js/xeno-js
264
- */
265
- readonly TRANSACTION_STATE: ITransactionState<Ttx>;
266
- }
267
-
268
- /**
269
- * @fileoverview Defines the IServiceScope interface for scoped dependency injection.
270
- *
271
- * @author Xeno
272
- * @version 1.0.0
273
- * @since 2025-09-30
274
- * @link https://github.com/xeno-js/xeno-js
275
- */
276
- /**
277
- * @description Represents a logical scope for resolving scoped services,
278
- * mimicking the .NET `IServiceScope` pattern.
279
- *
280
- * A scope is created by {@link IServiceContainer.createScope} and provides
281
- * its own isolated instance cache for services registered with scoped lifetime.
282
- * Singleton and transient services are still resolved through the root container.
283
- *
284
- * Call {@link dispose} when the scope is no longer needed to release all
285
- * scoped instances and invalidate the scope.
286
- *
287
- * @author Xeno
288
- * @version 1.0.0
289
- * @since 2025-09-30
290
- * @link https://github.com/xeno-js/xeno-js
291
- */
292
- interface IServiceScope<Registry extends ApplicationRegistry<unknown> = ApplicationRegistry<unknown>> extends IDisposable {
293
- /**
294
- * Resolves and returns the service registered under the given token.
295
- * Scoped services can only be resolved through a scope;
296
- * resolving them directly from the root container throws an error.
297
- *
298
- * @param token - The injection token identifying the service to resolve.
299
- * @returns The resolved service instance of type `T`.
300
- * @throws An error if no registration is found for the given token.
301
- * @throws An error if the scope has already been disposed.
302
- *
303
- * @author Xeno
304
- * @version 1.0.0
305
- * @since 2025-09-30
306
- * @link https://github.com/xeno-js/xeno-js
307
- */
308
- resolve<K extends keyof Registry>(token: K): Registry[K];
309
- }
310
-
311
- /**
312
- * @fileoverview Defines the IServiceContainer interface for a dependency injection container.
313
- *
314
- * @author Xeno
315
- * @version 1.0.0
316
- * @since 2025-09-30
317
- * @link https://github.com/xeno-js/xeno-js
318
- */
319
- interface IServiceProvider<Registry extends ApplicationRegistry<unknown> = ApplicationRegistry<unknown>> {
320
- /**
321
- * Resolves and returns the service registered under the given token.
322
- * Scoped services can only be resolved through a scope;
323
- * resolving them directly from the root container throws an error.
324
- *
325
- * @param token - The injection token identifying the service to resolve.
326
- * @returns The resolved service instance of type `T`.
327
- * @throws An error if no registration is found for the given token.
328
- * @throws An error if the scope has already been disposed.
329
- *
330
- * @author Xeno
331
- * @version 1.0.0
332
- * @since 2025-09-30
333
- * @link https://github.com/xeno-js/xeno-js
334
- */
335
- resolve<K extends keyof Registry>(token: K): Registry[K];
336
- }
337
- /**
338
- * @description Agnostic contract for a dependency injection container that mimics
339
- * the .NET ServiceCollection builder pattern.
340
- *
341
- * Each registration method returns `this` to enable a fluent builder chain.
342
- * Dependencies are expressed as an ordered array of injection tokens
343
- * that the container will resolve and inject into the constructor.
344
- *
345
- * @author Xeno
346
- * @version 1.0.0
347
- * @since 2025-09-30
348
- * @link https://github.com/xeno-js/xeno-js
349
- */
350
- interface IServiceContainer<Registry extends ApplicationRegistry<unknown> = ApplicationRegistry<unknown>> extends IServiceProvider<Registry>, IDisposable {
351
- /**
352
- * Registers an implementation under the given token with **singleton** lifetime.
353
- * A single instance is created on first resolution and reused for every
354
- * subsequent call within the container's lifetime.
355
- *
356
- * @param token - The unique injection token that identifies this service binding.
357
- * @param factory - Factory function that creates the service instance, receiving the scope as an argument.
358
- * @returns The container instance to allow method chaining.
359
- *
360
- * @author Xeno
361
- * @version 1.0.0
362
- * @since 2025-09-30
363
- * @link https://github.com/xeno-js/xeno-js
364
- */
365
- addSingleton<K extends keyof Registry>(token: K, factory: Factory<Registry[K], [IServiceScope<Registry>]>): this;
366
- /**
367
- * Registers an implementation under the given token with **transient** lifetime.
368
- * A new instance is created on every call to {@link resolve}.
369
- *
370
- * @param token - The unique injection token that identifies this service binding.
371
- * @param factory - Factory function that creates the service instance, receiving the scope as an argument.
372
- * @returns The container instance to allow method chaining.
373
- *
374
- * @author Xeno
375
- * @version 1.0.0
376
- * @since 2025-09-30
377
- * @link https://github.com/xeno-js/xeno-js
378
- */
379
- addTransient<K extends keyof Registry>(token: K, factory: Factory<Registry[K], [IServiceScope<Registry>]>): this;
380
- /**
381
- * Registers an implementation under the given token with **scoped** lifetime.
382
- * One instance is created per logical scope (e.g. per HTTP request).
383
- * Scoped services must be resolved through an {@link IServiceScope} obtained
384
- * via {@link createScope}; resolving them directly from the root container throws.
385
- *
386
- * @param token - The unique injection token that identifies this service binding.
387
- * @param factory - Factory function that creates the service instance, receiving the scope as an argument.
388
- * @returns The container instance to allow method chaining.
389
- *
390
- * @author Xeno
391
- * @version 1.0.0
392
- * @since 2025-09-30
393
- * @link https://github.com/xeno-js/xeno-js
394
- */
395
- addScoped<K extends keyof Registry>(token: K, factory: Factory<Registry[K], [IServiceScope<Registry>]>): this;
396
- /**
397
- * Creates a new {@link IServiceScope}.
398
- *
399
- * The returned scope shares singleton instances with the root container
400
- * and maintains its own isolated cache for scoped services.
401
- * Call {@link IServiceScope.dispose} when the scope is no longer needed.
402
- *
403
- * @returns A new scope instance.
404
- *
405
- * @author Xeno
406
- * @version 1.0.0
407
- * @since 2025-09-30
408
- * @link https://github.com/xeno-js/xeno-js
409
- */
410
- createScope(): IServiceScope<Registry>;
411
- }
412
-
413
26
  /**
414
27
  * @fileoverview Defines the ServiceDescriptor type for service registrations.
415
28
 
@@ -512,122 +125,6 @@ interface ExecutionContext<TRegistry extends ApplicationRegistry = ApplicationRe
512
125
  scope: IServiceScope<TRegistry>;
513
126
  }
514
127
 
515
- /**
516
- * @fileoverview Defines the IRequestContext interface for managing user identity context within the application.
517
- *
518
- * @author Xeno
519
- * @version 1.0.0
520
- * @since 2025-09-30
521
- * @link https://github.com/xeno-js/xeno-js
522
- */
523
-
524
- /**
525
- * An interface for managing user identity context within the application. This interface provides methods for executing asynchronous functions with the current user's identity context and retrieving the current user's identity information. It allows for seamless integration of identity management into various parts of the application, ensuring that identity-related data is properly propagated and accessible when needed.
526
- *
527
- * @author Xeno
528
- * @version 1.0.0
529
- * @since 2025-09-30
530
- * @link https://github.com/xeno-js/xeno-js
531
- */
532
- interface IRequestContext<TCtx, TRegistry extends ApplicationRegistry = ApplicationRegistry> extends IBaseAccessor<TCtx>, IServiceScopeAccessor<TRegistry> {
533
- /**
534
- * Executes the provided asynchronous function with the current user's identity context. This allows the function to access identity information such as user ID, roles, and correlation ID while performing its operations. The function will be executed within the scope of the current request's identity, ensuring that any identity-related data is properly propagated throughout the execution flow.
535
- * @param ctx The current user's identity context.
536
- * @param fn An asynchronous function that takes the current user's identity as an argument and returns a promise of type T. This function will be executed with the identity context of the current request.
537
- * @returns A promise that resolves to the result of the provided function, allowing the caller to handle the outcome of the operation performed within the identity context.
538
- *
539
- * @author Xeno
540
- * @version 1.0.0
541
- * @since 2025-09-30
542
- * @link https://github.com/xeno-js/xeno-js
543
- */
544
- runAsync<T = unknown>(ctx: TCtx, fn: () => Promise<T>): Promise<T>;
545
- updateIdentity(identity: Identity): void;
546
- }
547
- /**
548
- * @description The IIdentityAccessor interface is a contract that defines the structure and behavior of an identity accessor within the application. It provides a method for retrieving the current user's identity information, including user ID, roles, and correlation ID. This interface is essential for managing user identity and ensuring that identity-related data is accessible when needed.
549
- *
550
- *
551
- * @author Xeno
552
- * @version 1.0.0
553
- * @since 2025-09-30
554
- * @link https://github.com/xeno-js/xeno-js
555
- */
556
- interface IServiceScopeAccessor<TRegistry extends ApplicationRegistry<unknown> = ApplicationRegistry<unknown>> {
557
- /**
558
- * Retrieves the current service scope, which allows for managing dependencies during the execution of a request. This method enables access to the service scope, ensuring that services are properly scoped and disposed of after the request is processed.
559
- * @returns An object representing the current service scope, allowing for resolution of dependencies and management of services during the execution of a request.
560
- *
561
- * @author Xeno
562
- * @version 1.0.0
563
- * @since 2025-09-30
564
- * @link https://github.com/xeno-js/xeno-js
565
- */
566
- getScope(): Optional<IServiceScope<TRegistry>>;
567
- }
568
-
569
- /**
570
- * @description Interface for the crypto service
571
- */
572
- interface ICryptoService {
573
- /**
574
- * @description Generates a random byte array of the specified size.
575
- * @param size The size of the byte array to generate.
576
- * @returns A random byte array of the specified size.
577
- */
578
- randomBytes(size: number): Uint8Array;
579
- /**
580
- * @description Generates a HMAC SHA-256 hash of the specified data using the specified secret.
581
- * @param secret The secret to use for the HMAC SHA-256 hash.
582
- * @param data The data to hash.
583
- * @returns A promise that resolves to the HMAC SHA-256 hash of the specified data.
584
- */
585
- hmacSha256(secret: string, data: string): Promise<string>;
586
- /**
587
- * @description Compares two byte arrays in a way that is resistant to timing attacks.
588
- * @param a The first byte array to compare.
589
- * @param b The second byte array to compare.
590
- * @returns True if the two byte arrays are equal, false otherwise.
591
- */
592
- timingSafeEqual(a: Uint8Array, b: Uint8Array): boolean;
593
- }
594
-
595
- /**
596
- * @description Interface for a WebTransport.
597
- * @author Xeno
598
- * @version 1.2.1
599
- * @since 2025-09-30
600
- * @link https://github.com/xeno-js/xeno-js
601
- */
602
- interface XenoWebTransport {
603
- /**
604
- * @description The Extendend native request.
605
- * @type ExtendedRequest
606
- */
607
- request: ExtendedRequest;
608
- /**
609
- * @description The native response.
610
- * @type Response
611
- */
612
- response: Response;
613
- }
614
- /**
615
- * @description Interface for an HTTP adapter.
616
- * @author Xeno
617
- * @version 1.2.1
618
- * @since 2025-09-30
619
- * @link https://github.com/xeno-js/xeno-js
620
- */
621
- interface IHttpAdapter<TReq = Request, TRes = Response> {
622
- /**
623
- * @description Adapts an HTTP request and response to an ExtendedRequest and Response.
624
- * @param req - The HTTP request.
625
- * @param res - The HTTP response.
626
- * @returns An object containing the adapted ExtendedRequest and Response.
627
- */
628
- adapt(req: TReq, res: TRes): XenoWebTransport;
629
- }
630
-
631
128
  /**
632
129
  * @description Represents a module that can be registered with the service container.
633
130
  *
@@ -721,25 +218,6 @@ interface IAllowOrigin {
721
218
  isAllowed(origin: Optional<string>): boolean;
722
219
  }
723
220
 
724
- /**
725
- * @description Interface for the CSRF token service
726
- */
727
- interface ICsrfTokenService {
728
- /**
729
- * @description Generate a new CSRF token
730
- * @param subject The subject of the token
731
- * @returns A promise that resolves to the token
732
- */
733
- generate(subject: string): Promise<string>;
734
- /**
735
- * @description Validate a CSRF token
736
- * @param token The token to validate
737
- * @param subject The subject of the token
738
- * @returns A priomise that resolves to true if the token is valid, false otherwise
739
- */
740
- validate(token: string, subject: string): Promise<boolean>;
741
- }
742
-
743
221
  interface ISsrCookie {
744
222
  name: string;
745
223
  value: string;
@@ -1516,45 +994,6 @@ declare const ContainerUtils: Readonly<{
1516
994
  runExecute<TResponse, T extends ApplicationRegistry, TRes, TReq>(res: TRes, req: TReq, container: IServiceContainer<T>, action: () => Promise<ResponseDto<TResponse>>): Promise<ResponseDto<TResponse>>;
1517
995
  }>;
1518
996
 
1519
- /**
1520
- * BaseHandler is an abstract class that implements the IHandler interface.
1521
- * It provides a base implementation for handling requests and executing strategies.
1522
- *
1523
- * @author Xeno
1524
- * @version 1.0.0
1525
- * @since 2025-09-30
1526
- * @link https://github.com/xeno-js/xeno-js
1527
- */
1528
- declare abstract class BaseHandler<TRequest extends IRequest<TResponse>, TResponse> implements IHandler<TRequest, TResponse> {
1529
- private readonly _identityFactory;
1530
- constructor(_identityFactory: IFactory<void, UserContext>);
1531
- handle(request: TRequest, signal: AbortSignal): Promise<ResultType<TResponse>>;
1532
- /**
1533
- * Executes the strategy for the given request.
1534
- * @param request - The request to be handled.
1535
- * @param signal - (Optional) The abort signal for the request.
1536
- * @throws {AppError} If the strategy execution fails.
1537
- * @protected - This method should be overridden by subclasses.
1538
- * @abstract - This method must be implemented by subclasses.
1539
- * @async - This method is asynchronous.
1540
- * @template TRequest - The type of the request.
1541
- * @template TResponse - The type of the response.
1542
- * @returns {Promise<ResultType<TResponse>>} A promise that resolves to the result of the strategy execution.
1543
- *
1544
- * @author Xeno
1545
- * @version 1.0.0
1546
- * @since 2025-09-30
1547
- * @link https://github.com/xeno-js/xeno-js
1548
- */
1549
- protected abstract executeAsync(request: TRequest, signal?: Optional<AbortSignal>): Promise<ResultType<TResponse>>;
1550
- /**
1551
- * Gets the current context.
1552
- * @returns {UserContext} The current context.
1553
- * {@link UserContext}
1554
- */
1555
- protected _getCurrentContext(): UserContext;
1556
- }
1557
-
1558
997
  /**
1559
998
  * @description Abstract base class for authorization strategies in the CQRS pipeline. This class implements the IStrategy interface and provides a common structure for performing authorization checks based on the identity of the authenticated user. It defines an abstract method performAuthorizationCheck that must be implemented by concrete authorization strategies to specify the logic for checking if the user has the necessary permissions to execute a given request. The execute method retrieves the user's identity from the request context and ensures that the user is authenticated before delegating to the performAuthorizationCheck method for further authorization validation. If the user is not authenticated, it returns a failed Result with an appropriate AppError indicating that authentication is required.
1560
999
  *
@@ -2070,4 +1509,4 @@ declare abstract class BaseController<TRequest, TResponse> implements IControlle
2070
1509
  protected getContext(): Optional<RequestContext>;
2071
1510
  }
2072
1511
 
2073
- export { AppBuilder, type ApplicationRegistry, type AuthSsrConfig, BaseAuthorizationStrategy, BaseController, BaseHandler, BaseHttpAdapter, ContainerUtils, type CookieHandlerOptions, type ExecutionContext, type HttpAdapterConfig, type HttpConfig, type HttpCoreConfig, type IAllowMethod, type IAllowOrigin, type IAtomicCache, type ICryptoService, type ICsrfTokenService, type IHttpAdapter, type IIPResolver, type IModule, type IRateLimitKeyBuilder, type IRequestContext, type IServiceContainer, type IServiceProvider, type IServiceScope, type IServiceScopeAccessor, type ISsrCookie, type ISsrCookieHandler, type ISsrCookieToSet, type Lifetime, type LoggerConfig, type MiddlewareConfig, type PinoLoggerConfig, type PipelineConfig, ReadDao, Repository, type ResilienceConfig, type SchemaConfig, type SentryLoggerConfig, type ServiceDescriptor, Specification, type XenoRegistry, type XenoWebTransport };
1512
+ export { AppBuilder, ApplicationRegistry, type AuthSsrConfig, BaseAuthorizationStrategy, BaseController, BaseHttpAdapter, ContainerUtils, type CookieHandlerOptions, type ExecutionContext, type HttpAdapterConfig, type HttpConfig, type HttpCoreConfig, type IAllowMethod, type IAllowOrigin, IHttpAdapter, type IIPResolver, type IModule, type IRateLimitKeyBuilder, IServiceContainer, IServiceProvider, IServiceScope, type ISsrCookie, type ISsrCookieHandler, type ISsrCookieToSet, type Lifetime, type LoggerConfig, type MiddlewareConfig, type PinoLoggerConfig, type PipelineConfig, ReadDao, Repository, type ResilienceConfig, type SchemaConfig, type SentryLoggerConfig, type ServiceDescriptor, Specification, type XenoRegistry, XenoWebTransport };