agent-messenger 2.23.2 → 2.23.4
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/.claude-plugin/plugin.json +1 -1
- package/dist/package.json +1 -1
- package/dist/src/platforms/webex/client.d.ts.map +1 -1
- package/dist/src/platforms/webex/client.js +28 -16
- package/dist/src/platforms/webex/client.js.map +1 -1
- package/dist/src/platforms/webex/commands/auth.js +1 -2
- package/dist/src/platforms/webex/commands/auth.js.map +1 -1
- package/dist/src/platforms/webex/commands/member.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/member.js +2 -3
- package/dist/src/platforms/webex/commands/member.js.map +1 -1
- package/dist/src/platforms/webex/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/message.js +2 -3
- package/dist/src/platforms/webex/commands/message.js.map +1 -1
- package/dist/src/platforms/webex/commands/whoami.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/whoami.js +2 -3
- package/dist/src/platforms/webex/commands/whoami.js.map +1 -1
- package/dist/src/platforms/webex/id-normalizer.d.ts +9 -5
- package/dist/src/platforms/webex/id-normalizer.d.ts.map +1 -1
- package/dist/src/platforms/webex/id-normalizer.js +87 -21
- package/dist/src/platforms/webex/id-normalizer.js.map +1 -1
- package/dist/src/platforms/webex/index.d.ts +1 -1
- package/dist/src/platforms/webex/index.d.ts.map +1 -1
- package/dist/src/platforms/webex/index.js.map +1 -1
- package/dist/src/platforms/webex/listener.d.ts +10 -9
- package/dist/src/platforms/webex/listener.d.ts.map +1 -1
- package/dist/src/platforms/webex/listener.js.map +1 -1
- package/dist/src/platforms/webex/types.d.ts +51 -0
- package/dist/src/platforms/webex/types.d.ts.map +1 -1
- package/dist/src/platforms/webex/types.js +10 -0
- package/dist/src/platforms/webex/types.js.map +1 -1
- package/dist/src/platforms/webexbot/commands/file.d.ts.map +1 -1
- package/dist/src/platforms/webexbot/commands/file.js +2 -3
- package/dist/src/platforms/webexbot/commands/file.js.map +1 -1
- package/dist/src/platforms/webexbot/commands/member.d.ts.map +1 -1
- package/dist/src/platforms/webexbot/commands/member.js +2 -3
- package/dist/src/platforms/webexbot/commands/member.js.map +1 -1
- package/dist/src/platforms/webexbot/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/webexbot/commands/message.js +6 -7
- package/dist/src/platforms/webexbot/commands/message.js.map +1 -1
- package/dist/src/platforms/webexbot/commands/snapshot.js +1 -1
- package/dist/src/platforms/webexbot/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/webexbot/commands/user.d.ts.map +1 -1
- package/dist/src/platforms/webexbot/commands/user.js +3 -4
- package/dist/src/platforms/webexbot/commands/user.js.map +1 -1
- package/dist/src/platforms/webexbot/commands/whoami.d.ts.map +1 -1
- package/dist/src/platforms/webexbot/commands/whoami.js +2 -3
- package/dist/src/platforms/webexbot/commands/whoami.js.map +1 -1
- package/dist/src/platforms/webexbot/index.d.ts +1 -1
- package/dist/src/platforms/webexbot/index.d.ts.map +1 -1
- package/dist/src/platforms/webexbot/index.js.map +1 -1
- package/dist/src/tui/adapters/webex-adapter.js +2 -2
- package/dist/src/tui/adapters/webex-adapter.js.map +1 -1
- package/package.json +1 -1
- package/skills/agent-channeltalk/SKILL.md +1 -1
- package/skills/agent-channeltalkbot/SKILL.md +1 -1
- package/skills/agent-discord/SKILL.md +1 -1
- package/skills/agent-discordbot/SKILL.md +1 -1
- package/skills/agent-instagram/SKILL.md +1 -1
- package/skills/agent-kakaotalk/SKILL.md +1 -1
- package/skills/agent-line/SKILL.md +1 -1
- package/skills/agent-slack/SKILL.md +1 -1
- package/skills/agent-slackbot/SKILL.md +1 -1
- package/skills/agent-teams/SKILL.md +1 -1
- package/skills/agent-telegram/SKILL.md +1 -1
- package/skills/agent-telegrambot/SKILL.md +1 -1
- package/skills/agent-webex/SKILL.md +1 -1
- package/skills/agent-webexbot/SKILL.md +1 -1
- package/skills/agent-wechatbot/SKILL.md +1 -1
- package/skills/agent-whatsapp/SKILL.md +1 -1
- package/skills/agent-whatsappbot/SKILL.md +1 -1
- package/src/platforms/webex/client.ts +36 -16
- package/src/platforms/webex/commands/auth.ts +3 -3
- package/src/platforms/webex/commands/member.test.ts +6 -0
- package/src/platforms/webex/commands/member.ts +2 -3
- package/src/platforms/webex/commands/message.test.ts +6 -0
- package/src/platforms/webex/commands/message.ts +2 -3
- package/src/platforms/webex/commands/whoami.test.ts +2 -0
- package/src/platforms/webex/commands/whoami.ts +2 -3
- package/src/platforms/webex/id-normalizer.test.ts +245 -2
- package/src/platforms/webex/id-normalizer.ts +106 -26
- package/src/platforms/webex/index.ts +13 -1
- package/src/platforms/webex/listener.test.ts +3 -0
- package/src/platforms/webex/listener.ts +16 -8
- package/src/platforms/webex/types.test.ts +20 -0
- package/src/platforms/webex/types.ts +68 -0
- package/src/platforms/webex/typings/webex-message-handler.d.ts +40 -2
- package/src/platforms/webexbot/commands/file.ts +2 -3
- package/src/platforms/webexbot/commands/member.ts +2 -3
- package/src/platforms/webexbot/commands/message.ts +6 -7
- package/src/platforms/webexbot/commands/snapshot.ts +1 -1
- package/src/platforms/webexbot/commands/user.test.ts +4 -0
- package/src/platforms/webexbot/commands/user.ts +3 -4
- package/src/platforms/webexbot/commands/whoami.ts +2 -3
- package/src/platforms/webexbot/index.ts +12 -1
- package/src/tui/adapters/webex-adapter.ts +2 -2
|
@@ -73,10 +73,13 @@ it('WebexSpaceSchema rejects invalid type', () => {
|
|
|
73
73
|
it('WebexMessageSchema validates valid message', () => {
|
|
74
74
|
const result = WebexMessageSchema.safeParse({
|
|
75
75
|
id: 'Y2lzY29zcGFyazovL3VzL01FU1NBR0UvbXNn',
|
|
76
|
+
ref: 'msg',
|
|
76
77
|
roomId: 'Y2lzY29zcGFyazovL3VzL1JPT00vYWJj',
|
|
78
|
+
roomRef: 'abc',
|
|
77
79
|
roomType: 'group',
|
|
78
80
|
text: 'Hello world',
|
|
79
81
|
personId: 'Y2lzY29zcGFyazovL3VzL1BFT1BMRS9hYmM',
|
|
82
|
+
personRef: 'abc',
|
|
80
83
|
personEmail: 'user@example.com',
|
|
81
84
|
created: '2024-01-15T10:30:00.000Z',
|
|
82
85
|
})
|
|
@@ -86,17 +89,22 @@ it('WebexMessageSchema validates valid message', () => {
|
|
|
86
89
|
it('WebexMessageSchema validates message with optional fields', () => {
|
|
87
90
|
const result = WebexMessageSchema.safeParse({
|
|
88
91
|
id: 'Y2lzY29zcGFyazovL3VzL01FU1NBR0UvbXNn',
|
|
92
|
+
ref: 'msg',
|
|
89
93
|
roomId: 'Y2lzY29zcGFyazovL3VzL1JPT00vYWJj',
|
|
94
|
+
roomRef: 'abc',
|
|
90
95
|
roomType: 'group',
|
|
91
96
|
text: 'Hello world',
|
|
92
97
|
markdown: '**Hello world**',
|
|
93
98
|
html: '<strong>Hello world</strong>',
|
|
94
99
|
files: ['https://webexapis.com/v1/contents/file1'],
|
|
95
100
|
personId: 'Y2lzY29zcGFyazovL3VzL1BFT1BMRS9hYmM',
|
|
101
|
+
personRef: 'abc',
|
|
96
102
|
personEmail: 'user@example.com',
|
|
97
103
|
created: '2024-01-15T10:30:00.000Z',
|
|
98
104
|
parentId: 'Y2lzY29zcGFyazovL3VzL01FU1NBR0UvcGFyZW50',
|
|
105
|
+
parentRef: 'parent',
|
|
99
106
|
mentionedPeople: ['Y2lzY29zcGFyazovL3VzL1BFT1BMRS9tZW50aW9u'],
|
|
107
|
+
mentionedPeopleRefs: ['mention'],
|
|
100
108
|
})
|
|
101
109
|
expect(result.success).toBe(true)
|
|
102
110
|
})
|
|
@@ -125,9 +133,11 @@ it('WebexMessageSchema rejects invalid roomType', () => {
|
|
|
125
133
|
it('WebexPersonSchema validates valid person', () => {
|
|
126
134
|
const result = WebexPersonSchema.safeParse({
|
|
127
135
|
id: 'Y2lzY29zcGFyazovL3VzL1BFT1BMRS9hYmM',
|
|
136
|
+
ref: 'abc',
|
|
128
137
|
emails: ['user@example.com'],
|
|
129
138
|
displayName: 'Test User',
|
|
130
139
|
orgId: 'Y2lzY29zcGFyazovL3VzL09SR0FOSVpBVElPTi9vcmc',
|
|
140
|
+
orgRef: 'org',
|
|
131
141
|
type: 'person',
|
|
132
142
|
created: '2024-01-01T00:00:00.000Z',
|
|
133
143
|
})
|
|
@@ -137,6 +147,7 @@ it('WebexPersonSchema validates valid person', () => {
|
|
|
137
147
|
it('WebexPersonSchema validates person with optional fields', () => {
|
|
138
148
|
const result = WebexPersonSchema.safeParse({
|
|
139
149
|
id: 'Y2lzY29zcGFyazovL3VzL1BFT1BMRS9hYmM',
|
|
150
|
+
ref: 'abc',
|
|
140
151
|
emails: ['user@example.com', 'user@work.com'],
|
|
141
152
|
displayName: 'Test User',
|
|
142
153
|
nickName: 'Tester',
|
|
@@ -144,6 +155,7 @@ it('WebexPersonSchema validates person with optional fields', () => {
|
|
|
144
155
|
lastName: 'User',
|
|
145
156
|
avatar: 'https://example.com/avatar.jpg',
|
|
146
157
|
orgId: 'Y2lzY29zcGFyazovL3VzL09SR0FOSVpBVElPTi9vcmc',
|
|
158
|
+
orgRef: 'org',
|
|
147
159
|
type: 'person',
|
|
148
160
|
created: '2024-01-01T00:00:00.000Z',
|
|
149
161
|
})
|
|
@@ -153,9 +165,11 @@ it('WebexPersonSchema validates person with optional fields', () => {
|
|
|
153
165
|
it('WebexPersonSchema validates bot type', () => {
|
|
154
166
|
const result = WebexPersonSchema.safeParse({
|
|
155
167
|
id: 'Y2lzY29zcGFyazovL3VzL1BFT1BMRS9ib3Q',
|
|
168
|
+
ref: 'bot',
|
|
156
169
|
emails: ['bot@webex.bot'],
|
|
157
170
|
displayName: 'My Bot',
|
|
158
171
|
orgId: 'Y2lzY29zcGFyazovL3VzL09SR0FOSVpBVElPTi9vcmc',
|
|
172
|
+
orgRef: 'org',
|
|
159
173
|
type: 'bot',
|
|
160
174
|
created: '2024-01-01T00:00:00.000Z',
|
|
161
175
|
})
|
|
@@ -185,8 +199,11 @@ it('WebexPersonSchema rejects invalid type', () => {
|
|
|
185
199
|
it('WebexMembershipSchema validates valid membership', () => {
|
|
186
200
|
const result = WebexMembershipSchema.safeParse({
|
|
187
201
|
id: 'Y2lzY29zcGFyazovL3VzL01FTUJFUlNISVAvbWVt',
|
|
202
|
+
ref: 'mem',
|
|
188
203
|
roomId: 'Y2lzY29zcGFyazovL3VzL1JPT00vYWJj',
|
|
204
|
+
roomRef: 'abc',
|
|
189
205
|
personId: 'Y2lzY29zcGFyazovL3VzL1BFT1BMRS9hYmM',
|
|
206
|
+
personRef: 'abc',
|
|
190
207
|
personEmail: 'user@example.com',
|
|
191
208
|
personDisplayName: 'Test User',
|
|
192
209
|
isModerator: false,
|
|
@@ -198,8 +215,11 @@ it('WebexMembershipSchema validates valid membership', () => {
|
|
|
198
215
|
it('WebexMembershipSchema validates moderator membership', () => {
|
|
199
216
|
const result = WebexMembershipSchema.safeParse({
|
|
200
217
|
id: 'Y2lzY29zcGFyazovL3VzL01FTUJFUlNISVAvbWVt',
|
|
218
|
+
ref: 'mem',
|
|
201
219
|
roomId: 'Y2lzY29zcGFyazovL3VzL1JPT00vYWJj',
|
|
220
|
+
roomRef: 'abc',
|
|
202
221
|
personId: 'Y2lzY29zcGFyazovL3VzL1BFT1BMRS9hYmM',
|
|
222
|
+
personRef: 'abc',
|
|
203
223
|
personEmail: 'moderator@example.com',
|
|
204
224
|
personDisplayName: 'Moderator User',
|
|
205
225
|
isModerator: true,
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AttachmentAction,
|
|
3
|
+
DecryptedMessage,
|
|
4
|
+
DeletedMessage,
|
|
5
|
+
MembershipActivity,
|
|
6
|
+
RoomActivity,
|
|
7
|
+
} from 'webex-message-handler'
|
|
1
8
|
import { z } from 'zod'
|
|
2
9
|
|
|
3
10
|
export interface WebexSpace {
|
|
@@ -13,21 +20,27 @@ export interface WebexSpace {
|
|
|
13
20
|
|
|
14
21
|
export interface WebexMessage {
|
|
15
22
|
id: string
|
|
23
|
+
ref: string
|
|
16
24
|
roomId: string
|
|
25
|
+
roomRef: string
|
|
17
26
|
roomType: 'group' | 'direct'
|
|
18
27
|
text?: string
|
|
19
28
|
markdown?: string
|
|
20
29
|
html?: string
|
|
21
30
|
files?: string[]
|
|
22
31
|
personId: string
|
|
32
|
+
personRef: string
|
|
23
33
|
personEmail: string
|
|
24
34
|
created: string
|
|
25
35
|
parentId?: string
|
|
36
|
+
parentRef?: string
|
|
26
37
|
mentionedPeople?: string[]
|
|
38
|
+
mentionedPeopleRefs?: string[]
|
|
27
39
|
}
|
|
28
40
|
|
|
29
41
|
export interface WebexPerson {
|
|
30
42
|
id: string
|
|
43
|
+
ref: string
|
|
31
44
|
emails: string[]
|
|
32
45
|
displayName: string
|
|
33
46
|
nickName?: string
|
|
@@ -35,14 +48,18 @@ export interface WebexPerson {
|
|
|
35
48
|
lastName?: string
|
|
36
49
|
avatar?: string
|
|
37
50
|
orgId: string
|
|
51
|
+
orgRef: string
|
|
38
52
|
type: 'person' | 'bot'
|
|
39
53
|
created: string
|
|
40
54
|
}
|
|
41
55
|
|
|
42
56
|
export interface WebexMembership {
|
|
43
57
|
id: string
|
|
58
|
+
ref: string
|
|
44
59
|
roomId: string
|
|
60
|
+
roomRef: string
|
|
45
61
|
personId: string
|
|
62
|
+
personRef: string
|
|
46
63
|
personEmail: string
|
|
47
64
|
personDisplayName: string
|
|
48
65
|
isModerator: boolean
|
|
@@ -61,6 +78,47 @@ export interface WebexConfig {
|
|
|
61
78
|
encryptionKeys?: Record<string, string>
|
|
62
79
|
}
|
|
63
80
|
|
|
81
|
+
export type WebexMessageEvent = DecryptedMessage & {
|
|
82
|
+
ref: string
|
|
83
|
+
parentRef?: string
|
|
84
|
+
roomRef: string
|
|
85
|
+
personRef: string
|
|
86
|
+
mentionedPeopleRefs: string[]
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type WebexDeletedMessageEvent = DeletedMessage & {
|
|
90
|
+
messageRef: string
|
|
91
|
+
roomRef: string
|
|
92
|
+
personRef: string
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export type WebexMembershipEvent = MembershipActivity & {
|
|
96
|
+
ref: string
|
|
97
|
+
actorRef: string
|
|
98
|
+
personRef: string
|
|
99
|
+
roomRef: string
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export type WebexAttachmentActionEvent = AttachmentAction & {
|
|
103
|
+
ref: string
|
|
104
|
+
messageRef: string
|
|
105
|
+
personRef: string
|
|
106
|
+
roomRef: string
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export type WebexRoomEvent = RoomActivity & {
|
|
110
|
+
ref: string
|
|
111
|
+
roomRef: string
|
|
112
|
+
actorRef: string
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export type WebexRealtimeEvent =
|
|
116
|
+
| WebexMessageEvent
|
|
117
|
+
| WebexDeletedMessageEvent
|
|
118
|
+
| WebexMembershipEvent
|
|
119
|
+
| WebexAttachmentActionEvent
|
|
120
|
+
| WebexRoomEvent
|
|
121
|
+
|
|
64
122
|
export class WebexError extends Error {
|
|
65
123
|
code: string
|
|
66
124
|
|
|
@@ -84,21 +142,27 @@ export const WebexSpaceSchema = z.object({
|
|
|
84
142
|
|
|
85
143
|
export const WebexMessageSchema = z.object({
|
|
86
144
|
id: z.string(),
|
|
145
|
+
ref: z.string(),
|
|
87
146
|
roomId: z.string(),
|
|
147
|
+
roomRef: z.string(),
|
|
88
148
|
roomType: z.enum(['group', 'direct']),
|
|
89
149
|
text: z.string().optional(),
|
|
90
150
|
markdown: z.string().optional(),
|
|
91
151
|
html: z.string().optional(),
|
|
92
152
|
files: z.array(z.string()).optional(),
|
|
93
153
|
personId: z.string(),
|
|
154
|
+
personRef: z.string(),
|
|
94
155
|
personEmail: z.string(),
|
|
95
156
|
created: z.string(),
|
|
96
157
|
parentId: z.string().optional(),
|
|
158
|
+
parentRef: z.string().optional(),
|
|
97
159
|
mentionedPeople: z.array(z.string()).optional(),
|
|
160
|
+
mentionedPeopleRefs: z.array(z.string()).optional(),
|
|
98
161
|
})
|
|
99
162
|
|
|
100
163
|
export const WebexPersonSchema = z.object({
|
|
101
164
|
id: z.string(),
|
|
165
|
+
ref: z.string(),
|
|
102
166
|
emails: z.array(z.string()),
|
|
103
167
|
displayName: z.string(),
|
|
104
168
|
nickName: z.string().optional(),
|
|
@@ -106,14 +170,18 @@ export const WebexPersonSchema = z.object({
|
|
|
106
170
|
lastName: z.string().optional(),
|
|
107
171
|
avatar: z.string().optional(),
|
|
108
172
|
orgId: z.string(),
|
|
173
|
+
orgRef: z.string(),
|
|
109
174
|
type: z.enum(['person', 'bot']),
|
|
110
175
|
created: z.string(),
|
|
111
176
|
})
|
|
112
177
|
|
|
113
178
|
export const WebexMembershipSchema = z.object({
|
|
114
179
|
id: z.string(),
|
|
180
|
+
ref: z.string(),
|
|
115
181
|
roomId: z.string(),
|
|
182
|
+
roomRef: z.string(),
|
|
116
183
|
personId: z.string(),
|
|
184
|
+
personRef: z.string(),
|
|
117
185
|
personEmail: z.string(),
|
|
118
186
|
personDisplayName: z.string(),
|
|
119
187
|
isModerator: z.boolean(),
|
|
@@ -155,6 +155,8 @@ declare module 'webex-message-handler' {
|
|
|
155
155
|
export interface DecryptedMessage {
|
|
156
156
|
/** Mercury activity UUID. Works as parentId for threaded replies. */
|
|
157
157
|
id: string
|
|
158
|
+
/** Raw UUID ref for `id`. */
|
|
159
|
+
ref: string
|
|
158
160
|
/**
|
|
159
161
|
* Full Conversation-service activity URL, when present on the raw Mercury
|
|
160
162
|
* activity (e.g. for an outbound "acknowledge" read-receipt). Undefined if
|
|
@@ -163,8 +165,14 @@ declare module 'webex-message-handler' {
|
|
|
163
165
|
url?: string
|
|
164
166
|
/** Parent activity UUID for threaded replies. Undefined if not a thread reply. */
|
|
165
167
|
parentId?: string
|
|
168
|
+
/** Raw UUID ref for `parentId`. Undefined when `parentId` is absent. */
|
|
169
|
+
parentRef?: string
|
|
166
170
|
roomId: string
|
|
171
|
+
/** Raw UUID ref for `roomId`. */
|
|
172
|
+
roomRef: string
|
|
167
173
|
personId: string
|
|
174
|
+
/** Raw UUID ref for `personId`. */
|
|
175
|
+
personRef: string
|
|
168
176
|
personEmail: string
|
|
169
177
|
text: string
|
|
170
178
|
html?: string
|
|
@@ -172,6 +180,8 @@ declare module 'webex-message-handler' {
|
|
|
172
180
|
roomType?: string
|
|
173
181
|
/** Person UUIDs mentioned via @mention in the message. */
|
|
174
182
|
mentionedPeople: string[]
|
|
183
|
+
/** Raw UUID refs for `mentionedPeople`, index-aligned. */
|
|
184
|
+
mentionedPeopleRefs: string[]
|
|
175
185
|
/** Group mention types (e.g. "all") in the message. */
|
|
176
186
|
mentionedGroups: string[]
|
|
177
187
|
/** File URLs attached to the message. Empty if no files. */
|
|
@@ -181,19 +191,33 @@ declare module 'webex-message-handler' {
|
|
|
181
191
|
|
|
182
192
|
export interface DeletedMessage {
|
|
183
193
|
messageId: string
|
|
194
|
+
/** Raw UUID ref for `messageId`. */
|
|
195
|
+
messageRef: string
|
|
184
196
|
roomId: string
|
|
197
|
+
/** Raw UUID ref for `roomId`. */
|
|
198
|
+
roomRef: string
|
|
185
199
|
personId: string
|
|
200
|
+
/** Raw UUID ref for `personId`. */
|
|
201
|
+
personRef: string
|
|
186
202
|
}
|
|
187
203
|
|
|
188
204
|
export interface MembershipActivity {
|
|
189
|
-
/** Activity ID. */
|
|
205
|
+
/** Activity ID (raw Mercury activity UUID). */
|
|
190
206
|
id: string
|
|
207
|
+
/** Raw UUID ref for `id`. Equal to `id` since the activity id is already raw. */
|
|
208
|
+
ref: string
|
|
191
209
|
/** ID of the person who performed the action. */
|
|
192
210
|
actorId: string
|
|
211
|
+
/** Raw UUID ref for `actorId`. */
|
|
212
|
+
actorRef: string
|
|
193
213
|
/** ID of the member affected. */
|
|
194
214
|
personId: string
|
|
215
|
+
/** Raw UUID ref for `personId`. */
|
|
216
|
+
personRef: string
|
|
195
217
|
/** Conversation/space ID. */
|
|
196
218
|
roomId: string
|
|
219
|
+
/** Raw UUID ref for `roomId`. */
|
|
220
|
+
roomRef: string
|
|
197
221
|
/** Membership action: "add", "leave", "assignModerator", or "unassignModerator". */
|
|
198
222
|
action: string
|
|
199
223
|
/** ISO 8601 timestamp. */
|
|
@@ -207,14 +231,22 @@ declare module 'webex-message-handler' {
|
|
|
207
231
|
export interface AttachmentAction {
|
|
208
232
|
/** Activity ID. */
|
|
209
233
|
id: string
|
|
234
|
+
/** Raw UUID ref for `id`. */
|
|
235
|
+
ref: string
|
|
210
236
|
/** ID of the message the card was attached to. */
|
|
211
237
|
messageId: string
|
|
238
|
+
/** Raw UUID ref for `messageId`. Empty when `messageId` is empty. */
|
|
239
|
+
messageRef: string
|
|
212
240
|
/** ID of the person who submitted the card. */
|
|
213
241
|
personId: string
|
|
242
|
+
/** Raw UUID ref for `personId`. */
|
|
243
|
+
personRef: string
|
|
214
244
|
/** Email of the person who submitted the card. */
|
|
215
245
|
personEmail: string
|
|
216
246
|
/** Conversation/space ID. */
|
|
217
247
|
roomId: string
|
|
248
|
+
/** Raw UUID ref for `roomId`. */
|
|
249
|
+
roomRef: string
|
|
218
250
|
/** Card form input values. */
|
|
219
251
|
inputs: Record<string, unknown>
|
|
220
252
|
/** ISO 8601 timestamp. */
|
|
@@ -224,12 +256,18 @@ declare module 'webex-message-handler' {
|
|
|
224
256
|
}
|
|
225
257
|
|
|
226
258
|
export interface RoomActivity {
|
|
227
|
-
/** Activity ID. */
|
|
259
|
+
/** Activity ID (raw Mercury activity UUID). */
|
|
228
260
|
id: string
|
|
261
|
+
/** Raw UUID ref for `id`. Equal to `id` since the activity id is already raw. */
|
|
262
|
+
ref: string
|
|
229
263
|
/** Conversation/space ID. */
|
|
230
264
|
roomId: string
|
|
265
|
+
/** Raw UUID ref for `roomId`. */
|
|
266
|
+
roomRef: string
|
|
231
267
|
/** ID of the person who performed the action. */
|
|
232
268
|
actorId: string
|
|
269
|
+
/** Raw UUID ref for `actorId`. */
|
|
270
|
+
actorRef: string
|
|
233
271
|
/** Room action: "created" or "updated". */
|
|
234
272
|
action: string
|
|
235
273
|
/** ISO 8601 timestamp. */
|
|
@@ -5,7 +5,6 @@ import { Command } from 'commander'
|
|
|
5
5
|
|
|
6
6
|
import { cliOutput } from '@/shared/utils/cli-output'
|
|
7
7
|
|
|
8
|
-
import { toRef } from '../../webex/id-normalizer'
|
|
9
8
|
import type { BotOption } from './shared'
|
|
10
9
|
import { getClient } from './shared'
|
|
11
10
|
|
|
@@ -40,9 +39,9 @@ export async function uploadAction(
|
|
|
40
39
|
|
|
41
40
|
return {
|
|
42
41
|
id: message.id,
|
|
43
|
-
ref:
|
|
42
|
+
ref: message.ref,
|
|
44
43
|
roomId: message.roomId,
|
|
45
|
-
roomRef:
|
|
44
|
+
roomRef: message.roomRef,
|
|
46
45
|
files: message.files,
|
|
47
46
|
created: message.created,
|
|
48
47
|
}
|
|
@@ -2,7 +2,6 @@ import { Command } from 'commander'
|
|
|
2
2
|
|
|
3
3
|
import { cliOutput } from '@/shared/utils/cli-output'
|
|
4
4
|
|
|
5
|
-
import { toRef } from '../../webex/id-normalizer'
|
|
6
5
|
import type { BotOption } from './shared'
|
|
7
6
|
import { getClient } from './shared'
|
|
8
7
|
|
|
@@ -29,9 +28,9 @@ export async function listAction(space: string, options: BotOption & { max?: str
|
|
|
29
28
|
return {
|
|
30
29
|
members: members.map((m) => ({
|
|
31
30
|
id: m.id,
|
|
32
|
-
ref:
|
|
31
|
+
ref: m.ref,
|
|
33
32
|
personId: m.personId,
|
|
34
|
-
personRef:
|
|
33
|
+
personRef: m.personRef,
|
|
35
34
|
personEmail: m.personEmail,
|
|
36
35
|
personDisplayName: m.personDisplayName,
|
|
37
36
|
isModerator: m.isModerator,
|
|
@@ -2,7 +2,6 @@ import { Command } from 'commander'
|
|
|
2
2
|
|
|
3
3
|
import { cliOutput } from '@/shared/utils/cli-output'
|
|
4
4
|
|
|
5
|
-
import { toRef } from '../../webex/id-normalizer'
|
|
6
5
|
import type { WebexMessage } from '../../webex/types'
|
|
7
6
|
import type { BotOption } from './shared'
|
|
8
7
|
import { getClient } from './shared'
|
|
@@ -33,9 +32,9 @@ interface MessageResult {
|
|
|
33
32
|
function formatMessage(message: WebexMessage): MessageResult {
|
|
34
33
|
return {
|
|
35
34
|
id: message.id,
|
|
36
|
-
ref:
|
|
35
|
+
ref: message.ref,
|
|
37
36
|
roomId: message.roomId,
|
|
38
|
-
roomRef:
|
|
37
|
+
roomRef: message.roomRef,
|
|
39
38
|
text: message.text,
|
|
40
39
|
markdown: message.markdown,
|
|
41
40
|
html: message.html,
|
|
@@ -88,9 +87,9 @@ export async function repliesAction(
|
|
|
88
87
|
return {
|
|
89
88
|
messages: messages.map((msg) => ({
|
|
90
89
|
id: msg.id,
|
|
91
|
-
ref:
|
|
90
|
+
ref: msg.ref,
|
|
92
91
|
roomId: msg.roomId,
|
|
93
|
-
roomRef:
|
|
92
|
+
roomRef: msg.roomRef,
|
|
94
93
|
text: msg.text,
|
|
95
94
|
personEmail: msg.personEmail,
|
|
96
95
|
created: msg.created,
|
|
@@ -125,9 +124,9 @@ export async function listAction(space: string, options: BotOption & { max?: str
|
|
|
125
124
|
return {
|
|
126
125
|
messages: messages.map((msg) => ({
|
|
127
126
|
id: msg.id,
|
|
128
|
-
ref:
|
|
127
|
+
ref: msg.ref,
|
|
129
128
|
roomId: msg.roomId,
|
|
130
|
-
roomRef:
|
|
129
|
+
roomRef: msg.roomRef,
|
|
131
130
|
text: msg.text,
|
|
132
131
|
personEmail: msg.personEmail,
|
|
133
132
|
created: msg.created,
|
|
@@ -12,9 +12,11 @@ const mockListPeople = mock(() =>
|
|
|
12
12
|
Promise.resolve([
|
|
13
13
|
{
|
|
14
14
|
id: personId,
|
|
15
|
+
ref: 'p1',
|
|
15
16
|
emails: ['alice@example.com'],
|
|
16
17
|
displayName: 'Alice',
|
|
17
18
|
orgId,
|
|
19
|
+
orgRef: 'o1',
|
|
18
20
|
type: 'person' as const,
|
|
19
21
|
created: '',
|
|
20
22
|
},
|
|
@@ -24,9 +26,11 @@ const mockListPeople = mock(() =>
|
|
|
24
26
|
const mockGetPerson = mock(() =>
|
|
25
27
|
Promise.resolve({
|
|
26
28
|
id: personId,
|
|
29
|
+
ref: 'p1',
|
|
27
30
|
emails: ['alice@example.com'],
|
|
28
31
|
displayName: 'Alice',
|
|
29
32
|
orgId,
|
|
33
|
+
orgRef: 'o1',
|
|
30
34
|
type: 'person' as const,
|
|
31
35
|
created: '2024-01-01T00:00:00Z',
|
|
32
36
|
}),
|
|
@@ -2,7 +2,6 @@ import { Command } from 'commander'
|
|
|
2
2
|
|
|
3
3
|
import { cliOutput } from '@/shared/utils/cli-output'
|
|
4
4
|
|
|
5
|
-
import { toRef } from '../../webex/id-normalizer'
|
|
6
5
|
import type { WebexPerson } from '../../webex/types'
|
|
7
6
|
import type { BotOption } from './shared'
|
|
8
7
|
import { getClient } from './shared'
|
|
@@ -33,7 +32,7 @@ interface UserResult {
|
|
|
33
32
|
function formatPerson(person: WebexPerson): UserResult {
|
|
34
33
|
return {
|
|
35
34
|
id: person.id,
|
|
36
|
-
ref:
|
|
35
|
+
ref: person.ref,
|
|
37
36
|
emails: person.emails,
|
|
38
37
|
displayName: person.displayName,
|
|
39
38
|
nickName: person.nickName,
|
|
@@ -41,7 +40,7 @@ function formatPerson(person: WebexPerson): UserResult {
|
|
|
41
40
|
lastName: person.lastName,
|
|
42
41
|
avatar: person.avatar,
|
|
43
42
|
orgId: person.orgId,
|
|
44
|
-
orgRef:
|
|
43
|
+
orgRef: person.orgRef,
|
|
45
44
|
type: person.type,
|
|
46
45
|
created: person.created,
|
|
47
46
|
}
|
|
@@ -58,7 +57,7 @@ export async function listAction(
|
|
|
58
57
|
return {
|
|
59
58
|
users: people.map((p) => ({
|
|
60
59
|
id: p.id,
|
|
61
|
-
ref:
|
|
60
|
+
ref: p.ref,
|
|
62
61
|
emails: p.emails,
|
|
63
62
|
displayName: p.displayName,
|
|
64
63
|
type: p.type,
|
|
@@ -2,7 +2,6 @@ import { Command } from 'commander'
|
|
|
2
2
|
|
|
3
3
|
import { cliOutput } from '@/shared/utils/cli-output'
|
|
4
4
|
|
|
5
|
-
import { toRef } from '../../webex/id-normalizer'
|
|
6
5
|
import type { BotOption } from './shared'
|
|
7
6
|
import { getClient } from './shared'
|
|
8
7
|
|
|
@@ -25,12 +24,12 @@ export async function whoamiAction(options: BotOption): Promise<WhoamiResult> {
|
|
|
25
24
|
const info = await client.testAuth()
|
|
26
25
|
return {
|
|
27
26
|
id: info.id,
|
|
28
|
-
ref:
|
|
27
|
+
ref: info.ref,
|
|
29
28
|
emails: info.emails,
|
|
30
29
|
displayName: info.displayName,
|
|
31
30
|
avatar: info.avatar,
|
|
32
31
|
orgId: info.orgId,
|
|
33
|
-
orgRef:
|
|
32
|
+
orgRef: info.orgRef,
|
|
34
33
|
type: info.type,
|
|
35
34
|
created: info.created,
|
|
36
35
|
}
|
|
@@ -6,5 +6,16 @@ export { WebexBotListener } from './listener'
|
|
|
6
6
|
export type { WebexBotListenerOptions } from './listener'
|
|
7
7
|
export type { WebexBotConfig, WebexBotCredentials, WebexBotEntry, WebexBotListenerEventMap } from './types'
|
|
8
8
|
export { WebexBotConfigSchema, WebexBotCredentialsSchema, WebexBotEntrySchema, WebexBotError } from './types'
|
|
9
|
-
export type {
|
|
9
|
+
export type {
|
|
10
|
+
WebexAttachmentActionEvent,
|
|
11
|
+
WebexDeletedMessageEvent,
|
|
12
|
+
WebexMembership,
|
|
13
|
+
WebexMembershipEvent,
|
|
14
|
+
WebexMessage,
|
|
15
|
+
WebexMessageEvent,
|
|
16
|
+
WebexPerson,
|
|
17
|
+
WebexRealtimeEvent,
|
|
18
|
+
WebexRoomEvent,
|
|
19
|
+
WebexSpace,
|
|
20
|
+
} from '../webex/types'
|
|
10
21
|
export { WebexMembershipSchema, WebexMessageSchema, WebexPersonSchema, WebexSpaceSchema } from '../webex/types'
|
|
@@ -37,9 +37,9 @@ export class WebexAdapter implements PlatformAdapter {
|
|
|
37
37
|
return messages
|
|
38
38
|
.map((msg) => ({
|
|
39
39
|
id: msg.id,
|
|
40
|
-
ref:
|
|
40
|
+
ref: msg.ref,
|
|
41
41
|
channelId: msg.roomId,
|
|
42
|
-
channelRef:
|
|
42
|
+
channelRef: msg.roomRef,
|
|
43
43
|
author: msg.personEmail,
|
|
44
44
|
content: msg.text ?? '',
|
|
45
45
|
timestamp: msg.created,
|