@ragbits/api-client-react 1.3.0 → 1.4.0-dev.202512021005

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.
@@ -1,6 +1,5 @@
1
1
  import { http, HttpResponse } from 'msw'
2
2
  import type { FeedbackResponse, ChatResponse } from '@ragbits/api-client'
3
- import { ChatResponseType } from '@ragbits/api-client'
4
3
  import { defaultConfigResponse } from '../utils'
5
4
 
6
5
  export const handlers = [
@@ -26,10 +25,10 @@ export const handlers = [
26
25
  start(controller) {
27
26
  // Send multiple chunks to simulate streaming with proper TypedChatResponse format
28
27
  const chunks: string[] = [
29
- `data: ${JSON.stringify({ type: ChatResponseType.Text, content: 'Hello' } as ChatResponse)}\n\n`,
30
- `data: ${JSON.stringify({ type: ChatResponseType.Text, content: ' there!' } as ChatResponse)}\n\n`,
31
- `data: ${JSON.stringify({ type: ChatResponseType.MessageId, content: 'msg-123' } as ChatResponse)}\n\n`,
32
- `data: ${JSON.stringify({ type: ChatResponseType.ConversationId, content: 'conv-456' } as ChatResponse)}\n\n`,
28
+ `data: ${JSON.stringify({ type: 'text', content: 'Hello' } as ChatResponse)}\n\n`,
29
+ `data: ${JSON.stringify({ type: 'text', content: ' there!' } as ChatResponse)}\n\n`,
30
+ `data: ${JSON.stringify({ type: 'message_id', content: 'msg-123' } as ChatResponse)}\n\n`,
31
+ `data: ${JSON.stringify({ type: 'conversation_id', content: 'conv-456' } as ChatResponse)}\n\n`,
33
32
  ]
34
33
 
35
34
  let index = 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ragbits/api-client-react",
3
- "version": "1.3.0",
3
+ "version": "1.4.0-dev.202512021005",
4
4
  "description": "React hooks for the Ragbits API client",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,7 +33,7 @@
33
33
  "react-dom": ">=16.8.0"
34
34
  },
35
35
  "dependencies": {
36
- "@ragbits/api-client": "*"
36
+ "@ragbits/api-client": "1.4.0-dev.202512021005"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@eslint/js": "^9.17.0",
@@ -42,7 +42,7 @@
42
42
  "@testing-library/user-event": "^14.5.0",
43
43
  "@types/react": "^18.2.0",
44
44
  "@types/react-dom": "^18.2.0",
45
- "@vitest/coverage-v8": "^1.6.0",
45
+ "@vitest/coverage-v8": "^4.0.7",
46
46
  "eslint": "^9.17.0",
47
47
  "eslint-plugin-react-hooks": "^5.0.0",
48
48
  "eslint-plugin-react-refresh": "^0.4.16",
@@ -53,7 +53,7 @@
53
53
  "tsup": "^8.0.0",
54
54
  "typescript": "^5.0.0",
55
55
  "typescript-eslint": "^8.18.2",
56
- "vitest": "^1.6.0"
56
+ "vitest": "^4.0.7"
57
57
  },
58
58
  "keywords": [
59
59
  "ragbits",