@onebun/core 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/{application.test.ts → application/application.test.ts} +6 -5
- package/src/{application.ts → application/application.ts} +131 -12
- package/src/application/index.ts +9 -0
- package/src/{multi-service-application.test.ts → application/multi-service-application.test.ts} +2 -1
- package/src/{multi-service-application.ts → application/multi-service-application.ts} +2 -1
- package/src/{multi-service.types.ts → application/multi-service.types.ts} +1 -1
- package/src/{decorators.test.ts → decorators/decorators.test.ts} +2 -1
- package/src/{decorators.ts → decorators/decorators.ts} +3 -2
- package/src/decorators/index.ts +15 -0
- package/src/index.ts +47 -134
- package/src/module/index.ts +12 -0
- package/src/{module.test.ts → module/module.test.ts} +3 -2
- package/src/{module.ts → module/module.ts} +6 -5
- package/src/queue/adapters/index.ts +8 -0
- package/src/queue/adapters/memory.adapter.test.ts +405 -0
- package/src/queue/adapters/memory.adapter.ts +509 -0
- package/src/queue/adapters/redis.adapter.ts +673 -0
- package/src/queue/cron-expression.test.ts +145 -0
- package/src/queue/cron-expression.ts +115 -0
- package/src/queue/cron-parser.test.ts +185 -0
- package/src/queue/cron-parser.ts +287 -0
- package/src/queue/decorators.test.ts +292 -0
- package/src/queue/decorators.ts +493 -0
- package/src/queue/docs-examples.test.ts +449 -0
- package/src/queue/guards.test.ts +309 -0
- package/src/queue/guards.ts +307 -0
- package/src/queue/index.ts +118 -0
- package/src/queue/pattern-matcher.test.ts +191 -0
- package/src/queue/pattern-matcher.ts +252 -0
- package/src/queue/queue.service.ts +421 -0
- package/src/queue/scheduler.test.ts +235 -0
- package/src/queue/scheduler.ts +379 -0
- package/src/queue/types.ts +502 -0
- package/src/redis/index.ts +8 -0
- package/src/{env-resolver.ts → service-client/env-resolver.ts} +1 -1
- package/src/service-client/index.ts +10 -0
- package/src/{service-client.test.ts → service-client/service-client.test.ts} +3 -2
- package/src/{service-client.ts → service-client/service-client.ts} +1 -1
- package/src/{service-definition.test.ts → service-client/service-definition.test.ts} +3 -2
- package/src/{service-definition.ts → service-client/service-definition.ts} +2 -2
- package/src/testing/index.ts +7 -0
- package/src/types.ts +34 -5
- package/src/websocket/index.ts +50 -0
- package/src/{ws-decorators.ts → websocket/ws-decorators.ts} +2 -1
- package/src/{ws-integration.test.ts → websocket/ws-integration.test.ts} +3 -2
- package/src/{ws-service-definition.ts → websocket/ws-service-definition.ts} +2 -1
- package/src/{ws-storage-redis.ts → websocket/ws-storage-redis.ts} +1 -1
- /package/src/{metadata.test.ts → decorators/metadata.test.ts} +0 -0
- /package/src/{metadata.ts → decorators/metadata.ts} +0 -0
- /package/src/{config.service.test.ts → module/config.service.test.ts} +0 -0
- /package/src/{config.service.ts → module/config.service.ts} +0 -0
- /package/src/{controller.test.ts → module/controller.test.ts} +0 -0
- /package/src/{controller.ts → module/controller.ts} +0 -0
- /package/src/{service.test.ts → module/service.test.ts} +0 -0
- /package/src/{service.ts → module/service.ts} +0 -0
- /package/src/{redis-client.ts → redis/redis-client.ts} +0 -0
- /package/src/{shared-redis.ts → redis/shared-redis.ts} +0 -0
- /package/src/{env-resolver.test.ts → service-client/env-resolver.test.ts} +0 -0
- /package/src/{service-client.types.ts → service-client/service-client.types.ts} +0 -0
- /package/src/{test-utils.test.ts → testing/test-utils.test.ts} +0 -0
- /package/src/{test-utils.ts → testing/test-utils.ts} +0 -0
- /package/src/{ws-base-gateway.test.ts → websocket/ws-base-gateway.test.ts} +0 -0
- /package/src/{ws-base-gateway.ts → websocket/ws-base-gateway.ts} +0 -0
- /package/src/{ws-client.test.ts → websocket/ws-client.test.ts} +0 -0
- /package/src/{ws-client.ts → websocket/ws-client.ts} +0 -0
- /package/src/{ws-client.types.ts → websocket/ws-client.types.ts} +0 -0
- /package/src/{ws-decorators.test.ts → websocket/ws-decorators.test.ts} +0 -0
- /package/src/{ws-guards.test.ts → websocket/ws-guards.test.ts} +0 -0
- /package/src/{ws-guards.ts → websocket/ws-guards.ts} +0 -0
- /package/src/{ws-handler.ts → websocket/ws-handler.ts} +0 -0
- /package/src/{ws-pattern-matcher.test.ts → websocket/ws-pattern-matcher.test.ts} +0 -0
- /package/src/{ws-pattern-matcher.ts → websocket/ws-pattern-matcher.ts} +0 -0
- /package/src/{ws-socketio-protocol.test.ts → websocket/ws-socketio-protocol.test.ts} +0 -0
- /package/src/{ws-socketio-protocol.ts → websocket/ws-socketio-protocol.ts} +0 -0
- /package/src/{ws-storage-memory.test.ts → websocket/ws-storage-memory.test.ts} +0 -0
- /package/src/{ws-storage-memory.ts → websocket/ws-storage-memory.ts} +0 -0
- /package/src/{ws-storage.ts → websocket/ws-storage.ts} +0 -0
- /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 '
|
|
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 '
|
|
24
|
-
import { Module } from '
|
|
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 '
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|