@onebun/core 0.1.2 → 0.1.4

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.
Files changed (79) hide show
  1. package/package.json +6 -6
  2. package/src/{application.test.ts → application/application.test.ts} +6 -5
  3. package/src/{application.ts → application/application.ts} +131 -12
  4. package/src/application/index.ts +9 -0
  5. package/src/{multi-service-application.test.ts → application/multi-service-application.test.ts} +2 -1
  6. package/src/{multi-service-application.ts → application/multi-service-application.ts} +2 -1
  7. package/src/{multi-service.types.ts → application/multi-service.types.ts} +1 -1
  8. package/src/{decorators.test.ts → decorators/decorators.test.ts} +2 -1
  9. package/src/{decorators.ts → decorators/decorators.ts} +3 -2
  10. package/src/decorators/index.ts +15 -0
  11. package/src/index.ts +47 -134
  12. package/src/module/index.ts +12 -0
  13. package/src/{module.test.ts → module/module.test.ts} +3 -2
  14. package/src/{module.ts → module/module.ts} +6 -5
  15. package/src/queue/adapters/index.ts +8 -0
  16. package/src/queue/adapters/memory.adapter.test.ts +405 -0
  17. package/src/queue/adapters/memory.adapter.ts +509 -0
  18. package/src/queue/adapters/redis.adapter.ts +673 -0
  19. package/src/queue/cron-expression.test.ts +145 -0
  20. package/src/queue/cron-expression.ts +115 -0
  21. package/src/queue/cron-parser.test.ts +185 -0
  22. package/src/queue/cron-parser.ts +287 -0
  23. package/src/queue/decorators.test.ts +292 -0
  24. package/src/queue/decorators.ts +493 -0
  25. package/src/queue/docs-examples.test.ts +449 -0
  26. package/src/queue/guards.test.ts +309 -0
  27. package/src/queue/guards.ts +307 -0
  28. package/src/queue/index.ts +118 -0
  29. package/src/queue/pattern-matcher.test.ts +191 -0
  30. package/src/queue/pattern-matcher.ts +252 -0
  31. package/src/queue/queue.service.ts +421 -0
  32. package/src/queue/scheduler.test.ts +235 -0
  33. package/src/queue/scheduler.ts +379 -0
  34. package/src/queue/types.ts +502 -0
  35. package/src/redis/index.ts +8 -0
  36. package/src/{env-resolver.ts → service-client/env-resolver.ts} +1 -1
  37. package/src/service-client/index.ts +10 -0
  38. package/src/{service-client.test.ts → service-client/service-client.test.ts} +3 -2
  39. package/src/{service-client.ts → service-client/service-client.ts} +1 -1
  40. package/src/{service-definition.test.ts → service-client/service-definition.test.ts} +3 -2
  41. package/src/{service-definition.ts → service-client/service-definition.ts} +2 -2
  42. package/src/testing/index.ts +7 -0
  43. package/src/types.ts +34 -5
  44. package/src/websocket/index.ts +50 -0
  45. package/src/{ws-decorators.ts → websocket/ws-decorators.ts} +2 -1
  46. package/src/{ws-integration.test.ts → websocket/ws-integration.test.ts} +3 -2
  47. package/src/{ws-service-definition.ts → websocket/ws-service-definition.ts} +2 -1
  48. package/src/{ws-storage-redis.ts → websocket/ws-storage-redis.ts} +1 -1
  49. /package/src/{metadata.test.ts → decorators/metadata.test.ts} +0 -0
  50. /package/src/{metadata.ts → decorators/metadata.ts} +0 -0
  51. /package/src/{config.service.test.ts → module/config.service.test.ts} +0 -0
  52. /package/src/{config.service.ts → module/config.service.ts} +0 -0
  53. /package/src/{controller.test.ts → module/controller.test.ts} +0 -0
  54. /package/src/{controller.ts → module/controller.ts} +0 -0
  55. /package/src/{service.test.ts → module/service.test.ts} +0 -0
  56. /package/src/{service.ts → module/service.ts} +0 -0
  57. /package/src/{redis-client.ts → redis/redis-client.ts} +0 -0
  58. /package/src/{shared-redis.ts → redis/shared-redis.ts} +0 -0
  59. /package/src/{env-resolver.test.ts → service-client/env-resolver.test.ts} +0 -0
  60. /package/src/{service-client.types.ts → service-client/service-client.types.ts} +0 -0
  61. /package/src/{test-utils.test.ts → testing/test-utils.test.ts} +0 -0
  62. /package/src/{test-utils.ts → testing/test-utils.ts} +0 -0
  63. /package/src/{ws-base-gateway.test.ts → websocket/ws-base-gateway.test.ts} +0 -0
  64. /package/src/{ws-base-gateway.ts → websocket/ws-base-gateway.ts} +0 -0
  65. /package/src/{ws-client.test.ts → websocket/ws-client.test.ts} +0 -0
  66. /package/src/{ws-client.ts → websocket/ws-client.ts} +0 -0
  67. /package/src/{ws-client.types.ts → websocket/ws-client.types.ts} +0 -0
  68. /package/src/{ws-decorators.test.ts → websocket/ws-decorators.test.ts} +0 -0
  69. /package/src/{ws-guards.test.ts → websocket/ws-guards.test.ts} +0 -0
  70. /package/src/{ws-guards.ts → websocket/ws-guards.ts} +0 -0
  71. /package/src/{ws-handler.ts → websocket/ws-handler.ts} +0 -0
  72. /package/src/{ws-pattern-matcher.test.ts → websocket/ws-pattern-matcher.test.ts} +0 -0
  73. /package/src/{ws-pattern-matcher.ts → websocket/ws-pattern-matcher.ts} +0 -0
  74. /package/src/{ws-socketio-protocol.test.ts → websocket/ws-socketio-protocol.test.ts} +0 -0
  75. /package/src/{ws-socketio-protocol.ts → websocket/ws-socketio-protocol.ts} +0 -0
  76. /package/src/{ws-storage-memory.test.ts → websocket/ws-storage-memory.test.ts} +0 -0
  77. /package/src/{ws-storage-memory.ts → websocket/ws-storage-memory.ts} +0 -0
  78. /package/src/{ws-storage.ts → websocket/ws-storage.ts} +0 -0
  79. /package/src/{ws.types.ts → websocket/ws.types.ts} +0 -0
@@ -0,0 +1,50 @@
1
+ /**
2
+ * WebSocket Module
3
+ *
4
+ * WebSocket gateway system with Socket.IO protocol support.
5
+ */
6
+
7
+ // Types (excluding duplicates that come from ws-client.types)
8
+ // Note: WsServer type is exported from ws.types.ts but WsServer decorator is from ws-decorators.ts
9
+ // We export the type as WsServerType to avoid conflict with the decorator
10
+ export {
11
+ WsHandlerType,
12
+ WsParamType,
13
+ isWsMessage,
14
+ isWsHandlerResponse,
15
+ isWsClientData,
16
+ isWsRoom,
17
+ type WsClientData,
18
+ type WsAuthData,
19
+ type WsRoom,
20
+ type GatewayMetadata,
21
+ type WsHandlerMetadata,
22
+ type WsParamMetadata,
23
+ type WebSocketGatewayOptions,
24
+ type WsMessage,
25
+ type WsHandlerResponse,
26
+ type PatternMatch,
27
+ type WsExecutionContext,
28
+ type WsGuard,
29
+ // Export WsServer type as WsServerType to avoid conflict with WsServer decorator
30
+ type WsServer as WsServerType,
31
+ } from './ws.types';
32
+
33
+ export * from './ws-client.types';
34
+
35
+ // Core
36
+ export * from './ws-base-gateway';
37
+ export * from './ws-handler';
38
+ export * from './ws-decorators';
39
+ export * from './ws-guards';
40
+ export * from './ws-pattern-matcher';
41
+ export * from './ws-socketio-protocol';
42
+
43
+ // Storage
44
+ export * from './ws-storage';
45
+ export * from './ws-storage-memory';
46
+ export * from './ws-storage-redis';
47
+
48
+ // Service definition & client
49
+ export * from './ws-service-definition';
50
+ export * from './ws-client';
@@ -15,7 +15,8 @@ import type {
15
15
  WsGuard,
16
16
  } from './ws.types';
17
17
 
18
- import { Reflect } from './metadata';
18
+ import { Reflect } from '../decorators/metadata';
19
+
19
20
  import { WsHandlerType, WsParamType } from './ws.types';
20
21
 
21
22
  // ============================================================================
@@ -20,8 +20,9 @@ import {
20
20
 
21
21
  import type { WsClientData } from './ws.types';
22
22
 
23
- import { OneBunApplication } from './application';
24
- import { Module } from './decorators';
23
+ import { OneBunApplication } from '../application/application';
24
+ import { Module } from '../decorators/decorators';
25
+
25
26
  import { BaseWebSocketGateway } from './ws-base-gateway';
26
27
  import { createWsClient } from './ws-client';
27
28
  import {
@@ -6,7 +6,8 @@
6
6
 
7
7
  import type { WsHandlerType, WsParamMetadata } from './ws.types';
8
8
 
9
- import { getModuleMetadata } from './decorators';
9
+ import { getModuleMetadata } from '../decorators/decorators';
10
+
10
11
  import { getGatewayMetadata, isWebSocketGateway } from './ws-decorators';
11
12
 
12
13
  /**
@@ -5,9 +5,9 @@
5
5
  * for multi-instance deployments.
6
6
  */
7
7
 
8
- import type { RedisClient } from './redis-client';
9
8
  import type { WsPubSubStorageAdapter, WsStorageEventPayload } from './ws-storage';
10
9
  import type { WsClientData, WsRoom } from './ws.types';
10
+ import type { RedisClient } from '../redis/redis-client';
11
11
 
12
12
  import { isPatternMatch } from './ws-pattern-matcher';
13
13
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes