chore: sync local changes
这个提交包含在:
父节点
7a5e79d419
当前提交
ea588a8f53
@ -148,7 +148,7 @@ describe('im/ImClient', () => {
|
||||
const body = JSON.parse(sendFrame?.body || '{}')
|
||||
expect(body.content).toBe('hello')
|
||||
expect(body.toId).toBe('user_b')
|
||||
expect(body.appId).toBe('ak_demo_chat')
|
||||
expect(body.appKey).toBe('ak_demo_chat')
|
||||
})
|
||||
|
||||
it('should return FAILED when WebSocket is not open', () => {
|
||||
@ -174,7 +174,7 @@ describe('im/ImClient', () => {
|
||||
const ws = MockWebSocket.instances[0]
|
||||
const payload = JSON.stringify({
|
||||
id: 'msg_1',
|
||||
appId: 'ak_demo_chat',
|
||||
appKey: 'ak_demo_chat',
|
||||
fromUserId: 'user_b',
|
||||
toId: 'user_a',
|
||||
chatType: 'SINGLE',
|
||||
@ -208,7 +208,7 @@ describe('im/ImClient', () => {
|
||||
const ws = MockWebSocket.instances[0]
|
||||
const payload = JSON.stringify({
|
||||
id: 'msg_1',
|
||||
appId: 'ak_demo_chat',
|
||||
appKey: 'ak_demo_chat',
|
||||
fromUserId: 'user_b',
|
||||
toId: 'user_a',
|
||||
chatType: 'SINGLE',
|
||||
@ -238,7 +238,7 @@ describe('im/ImClient', () => {
|
||||
const ws = MockWebSocket.instances[0]
|
||||
const payload = JSON.stringify({
|
||||
id: 'msg_1',
|
||||
appId: 'ak_demo_chat',
|
||||
appKey: 'ak_demo_chat',
|
||||
fromUserId: 'user_b',
|
||||
toId: 'user_a',
|
||||
chatType: 'SINGLE',
|
||||
|
||||
@ -130,7 +130,7 @@ describe('im/useIm', () => {
|
||||
const ws = MockWebSocket.instances[0]
|
||||
emitStompMessage(ws, {
|
||||
id: msg.id,
|
||||
appId: 'ak_demo_chat',
|
||||
appKey: 'ak_demo_chat',
|
||||
fromUserId: 'user_b',
|
||||
toId: 'user_a',
|
||||
chatType: 'SINGLE',
|
||||
@ -163,7 +163,7 @@ describe('im/useIm', () => {
|
||||
const ws = MockWebSocket.instances[0]
|
||||
emitStompMessage(ws, {
|
||||
id: msg.id,
|
||||
appId: 'ak_demo_chat',
|
||||
appKey: 'ak_demo_chat',
|
||||
fromUserId: 'user_b',
|
||||
toId: 'user_a',
|
||||
chatType: 'SINGLE',
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@xuqm/vue3-sdk",
|
||||
"version": "0.1.0",
|
||||
"version": "0.2.0",
|
||||
"description": "XuqmGroup Vue3 SDK — IM & platform integration for web",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
@ -16,7 +16,9 @@
|
||||
"require": "./dist/index.cjs.js"
|
||||
}
|
||||
},
|
||||
"files": ["dist"],
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "vite build --watch",
|
||||
"build": "tsc --emitDeclarationOnly && vite build",
|
||||
|
||||
@ -161,7 +161,7 @@ export class ImClient {
|
||||
const messageId = params.messageId ?? this.generateMessageId()
|
||||
const outgoing: ImMessage = {
|
||||
id: messageId,
|
||||
appId: config.appKey,
|
||||
appKey: config.appKey,
|
||||
fromUserId: userId,
|
||||
fromId: userId,
|
||||
toId: params.toId,
|
||||
@ -178,7 +178,7 @@ export class ImClient {
|
||||
}
|
||||
|
||||
const payload: Record<string, unknown> = {
|
||||
appId: config.appKey,
|
||||
appKey: config.appKey,
|
||||
messageId,
|
||||
toId: params.toId,
|
||||
chatType: params.chatType,
|
||||
@ -208,7 +208,7 @@ export class ImClient {
|
||||
buildStompFrame(
|
||||
'SEND',
|
||||
{ destination: '/app/chat.revoke', 'content-type': 'application/json' },
|
||||
JSON.stringify({ appId: config.appKey, messageId: msgId })
|
||||
JSON.stringify({ appKey: config.appKey, messageId: msgId })
|
||||
)
|
||||
)
|
||||
}
|
||||
@ -224,7 +224,7 @@ export class ImClient {
|
||||
buildStompFrame(
|
||||
'SEND',
|
||||
{ destination: '/app/chat.sync', 'content-type': 'application/json' },
|
||||
JSON.stringify({ appId: config.appKey })
|
||||
JSON.stringify({ appKey: config.appKey })
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ import type {
|
||||
|
||||
function appQuery(extra?: Record<string, string | number | boolean | Date | null | undefined>) {
|
||||
return {
|
||||
appId: getConfig().appKey,
|
||||
appKey: getConfig().appKey,
|
||||
...extra,
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ export type MsgStatus = 'SENDING' | 'SENT' | 'DELIVERED' | 'READ' | 'FAILED' | '
|
||||
|
||||
export interface ImMessage {
|
||||
id: string
|
||||
appId: string
|
||||
appKey: string
|
||||
fromUserId: string
|
||||
fromId?: string
|
||||
toId: string
|
||||
@ -78,7 +78,7 @@ export interface HistoryQuery {
|
||||
|
||||
export interface UserProfile {
|
||||
id?: string
|
||||
appId?: string
|
||||
appKey?: string
|
||||
userId: string
|
||||
nickname?: string | null
|
||||
avatar?: string | null
|
||||
@ -89,7 +89,7 @@ export interface UserProfile {
|
||||
|
||||
export interface ImGroup {
|
||||
id: string
|
||||
appId?: string
|
||||
appKey?: string
|
||||
name: string
|
||||
groupType?: string
|
||||
creatorId: string
|
||||
@ -109,7 +109,7 @@ export interface ConversationGroupItem {
|
||||
|
||||
export interface FriendRequest {
|
||||
id: string
|
||||
appId?: string
|
||||
appKey?: string
|
||||
fromUserId: string
|
||||
toUserId: string
|
||||
remark?: string | null
|
||||
@ -120,7 +120,7 @@ export interface FriendRequest {
|
||||
|
||||
export interface GroupJoinRequest {
|
||||
id: string
|
||||
appId?: string
|
||||
appKey?: string
|
||||
groupId: string
|
||||
requesterId: string
|
||||
remark?: string | null
|
||||
@ -131,7 +131,7 @@ export interface GroupJoinRequest {
|
||||
|
||||
export interface BlacklistEntry {
|
||||
id: string
|
||||
appId: string
|
||||
appKey: string
|
||||
userId: string
|
||||
blockedUserId: string
|
||||
createdAt: string | number
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户