zcw-shared 2.13.0 → 2.16.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zcw-shared",
3
- "version": "2.13.0",
3
+ "version": "2.16.0",
4
4
  "files": [
5
5
  "references",
6
6
  "dist",
@@ -439,6 +439,7 @@
439
439
  "./types/im-forward": "./types/im-forward.d.ts",
440
440
  "./types/im-message-display": "./types/im-message-display.d.ts",
441
441
  "./types/im-reply": "./types/im-reply.d.ts",
442
+ "./types/im-wallet-message": "./types/im-wallet-message.d.ts",
442
443
  "./types/ios-build": "./types/ios-build.d.ts",
443
444
  "./types/music": "./types/music.d.ts",
444
445
  "./types/notification": "./types/notification.d.ts",
package/types/im-api.d.ts CHANGED
@@ -41,6 +41,8 @@ export interface ImApiMessage {
41
41
  | 'video'
42
42
  | 'forward_bundle'
43
43
  | 'sticker'
44
+ | 'transfer'
45
+ | 'red_envelope'
44
46
  status: 'sent' | 'delivered' | 'read'
45
47
  /** 发送方在该会话中的第几条(由服务端写入;旧数据可由接口补算) */
46
48
  sender_seq?: number
@@ -7,6 +7,10 @@
7
7
  import type { ImMessageDisplaySpec } from './im-message-display'
8
8
  import type { ImForwardBundleStoredItem } from './im-forward'
9
9
  import type { ImReplyToRef } from './im-reply'
10
+ import type {
11
+ ImRedEnvelopeExtra,
12
+ ImWalletTransferExtra,
13
+ } from './im-wallet-message'
10
14
 
11
15
  /** 引用预览(仅 UI 解析 id 后填充,不落库) */
12
16
  export interface ChatMessageQuotePreview {
@@ -52,6 +56,8 @@ export interface ChatMessage {
52
56
  | 'file'
53
57
  | 'forward_bundle'
54
58
  | 'sticker'
59
+ | 'transfer'
60
+ | 'red_envelope'
55
61
  content: string
56
62
  timestamp: Date
57
63
  sender: {
@@ -122,6 +128,10 @@ export interface ChatMessage {
122
128
  stickerPackId?: number
123
129
  stickerId?: number
124
130
  stickerName?: string
131
+ /** `type === 'transfer'`:来自 extra_data.wallet_transfer */
132
+ walletTransfer?: ImWalletTransferExtra
133
+ /** `type === 'red_envelope'`:来自 extra_data.red_envelope */
134
+ redEnvelope?: ImRedEnvelopeExtra
125
135
  }
126
136
 
127
137
 
@@ -0,0 +1,24 @@
1
+ /** IM 钱包类消息 extra_data 契约(与 api im-wallet 对齐) */
2
+
3
+ export type ImWalletTransferStatus = 'completed'
4
+
5
+ export type ImRedEnvelopeStatus = 'pending' | 'claimed' | 'expired'
6
+
7
+ export interface ImWalletTransferExtra {
8
+ transfer_no: string
9
+ amount: number
10
+ currency: string
11
+ greeting?: string
12
+ receiver_id: string
13
+ status: ImWalletTransferStatus
14
+ }
15
+
16
+ export interface ImRedEnvelopeExtra {
17
+ envelope_no: string
18
+ amount: number
19
+ currency: string
20
+ greeting?: string
21
+ status: ImRedEnvelopeStatus
22
+ claimed_by?: string
23
+ claimed_at?: string
24
+ }