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