Skip to content

Commit 76854b5

Browse files
committed
feat: remove @mixcore/signalr package and add @mixcore/realtime package with SignalR integration
- Deleted the @mixcore/signalr package including its README, configuration files, source code, and tests. - Introduced the @mixcore/realtime package with a complete implementation of real-time communication services. - Added README.md for @mixcore/realtime with features, installation, usage examples, API reference, and security considerations. - Implemented SignalRService and ChatService classes for managing real-time connections and chat functionalities. - Created Jest configuration and test files for the new package. - Updated TypeScript configuration and build setup using tsup.
1 parent 7be1cbd commit 76854b5

File tree

10 files changed

+18
-18
lines changed

10 files changed

+18
-18
lines changed
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# @mixcore/signalr
1+
# @mixcore/realtime
22

3-
SignalR real-time communication services for Mixcore SDK.
3+
Real-time communication services for Mixcore SDK.
44

55
## Features
66

7-
- **Real-time Communication**: Full SignalR client implementation with connection management
7+
- **Real-time Communication**: Full real-time client implementation with connection management
88
- **Type Safety**: Complete TypeScript support with strongly typed interfaces
99
- **Chat Services**: High-level chat service abstraction for common messaging patterns
1010
- **Connection Management**: Automatic reconnection, state management, and error handling
@@ -14,19 +14,19 @@ SignalR real-time communication services for Mixcore SDK.
1414
## Installation
1515

1616
```bash
17-
npm install @mixcore/signalr
17+
npm install @mixcore/realtime
1818
# or
19-
yarn add @mixcore/signalr
19+
yarn add @mixcore/realtime
2020
# or
21-
pnpm add @mixcore/signalr
21+
pnpm add @mixcore/realtime
2222
```
2323

2424
## Usage
2525

26-
### Basic SignalR Service
26+
### Basic Real-time Service
2727

2828
```typescript
29-
import { SignalRService } from '@mixcore/signalr';
29+
import { SignalRService } from '@mixcore/realtime';
3030

3131
const service = new SignalRService({
3232
hubUrl: 'https://your-hub-url/hub',
@@ -51,7 +51,7 @@ await service.invoke('SendMessage', 'Hello World');
5151
### Chat Service
5252

5353
```typescript
54-
import { ChatService } from '@mixcore/signalr';
54+
import { ChatService } from '@mixcore/realtime';
5555

5656
const chatService = new ChatService({
5757
baseUrl: 'https://your-api-url',
@@ -77,13 +77,13 @@ chatService.onMessageReceived((message) => {
7777

7878
### SignalRService
7979

80-
Main service class for SignalR connections.
80+
Main service class for real-time connections.
8181

8282
#### Constructor Options
8383

84-
- `hubUrl`: SignalR hub URL
84+
- `hubUrl`: Real-time hub URL
8585
- `accessTokenFactory`: Function that returns the access token
86-
- `logLevel`: SignalR logging level (optional)
86+
- `logLevel`: Connection logging level (optional)
8787
- `automaticReconnect`: Enable automatic reconnection (default: true)
8888
- `onConnected`: Connection established callback
8989
- `onDisconnected`: Connection lost callback
@@ -93,8 +93,8 @@ Main service class for SignalR connections.
9393

9494
#### Methods
9595

96-
- `start()`: Start the SignalR connection
97-
- `stop()`: Stop the SignalR connection
96+
- `start()`: Start the real-time connection
97+
- `stop()`: Stop the real-time connection
9898
- `invoke(method, ...args)`: Invoke a server method and wait for response
9999
- `send(method, ...args)`: Send a message to server without waiting for response
100100
- `onMessage(event, handler)`: Register message handler
@@ -109,7 +109,7 @@ High-level service for chat functionality.
109109

110110
#### Constructor Options
111111

112-
- `baseUrl`: Base URL for the SignalR hub (optional, defaults to current origin)
112+
- `baseUrl`: Base URL for the real-time hub (optional, defaults to current origin)
113113
- `hubPath`: Hub path (optional, defaults to '/hub/llm_chat')
114114
- All SignalRService options except `hubUrl`
115115

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "@mixcore/signalr",
2+
"name": "@mixcore/realtime",
33
"version": "0.0.1",
44
"main": "dist/index.js",
55
"module": "dist/index.esm.js",
66
"types": "dist/index.d.ts",
7-
"description": "SignalR real-time communication services for Mixcore SDK",
7+
"description": "Real-time communication services for Mixcore SDK",
88
"scripts": {
99
"build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist",
1010
"test": "jest",
@@ -25,7 +25,7 @@
2525
"publishConfig": {
2626
"access": "public"
2727
},
28-
"keywords": ["mixcore", "sdk", "signalr", "realtime", "chat", "typescript"],
28+
"keywords": ["mixcore", "sdk", "realtime", "communication", "chat", "typescript"],
2929
"engines": {
3030
"node": ">=18.0.0"
3131
}
File renamed without changes.

0 commit comments

Comments
 (0)