@stellaris/metrics-shared 0.1.8 → 0.1.9
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 +1 -1
- package/schemas/rpa-event.ts +14 -0
package/package.json
CHANGED
package/schemas/rpa-event.ts
CHANGED
|
@@ -4,6 +4,7 @@ import z from "zod";
|
|
|
4
4
|
* 消息场景类型
|
|
5
5
|
*/
|
|
6
6
|
export const messageSceneTypeSchema = z.literal("specialSceneTransfer");
|
|
7
|
+
export type MessageSceneType = z.infer<typeof messageSceneTypeSchema>;
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* 客服状态枚举
|
|
@@ -13,6 +14,7 @@ export const csStatusSchema = z.union([
|
|
|
13
14
|
z.literal(2),
|
|
14
15
|
z.literal(3),
|
|
15
16
|
]);
|
|
17
|
+
export type CsStatus = z.infer<typeof csStatusSchema>;
|
|
16
18
|
|
|
17
19
|
// RPA 事件基础字段
|
|
18
20
|
export const rpaEventBaseSchema = z.object({
|
|
@@ -46,6 +48,10 @@ export const replyMessageEventSchema = rpaEventBaseSchema.extend({
|
|
|
46
48
|
ignoreTransferred: z.boolean(),
|
|
47
49
|
}),
|
|
48
50
|
});
|
|
51
|
+
export type ReplyMessageEventPayload = z.infer<
|
|
52
|
+
typeof replyMessageEventSchema
|
|
53
|
+
>["payload"];
|
|
54
|
+
export type ReplyMessageRpaEvent = z.infer<typeof replyMessageEventSchema>;
|
|
49
55
|
|
|
50
56
|
// 变更客服状态事件
|
|
51
57
|
export const changeCsStatusEventSchema = rpaEventBaseSchema.extend({
|
|
@@ -58,6 +64,10 @@ export const changeCsStatusEventSchema = rpaEventBaseSchema.extend({
|
|
|
58
64
|
taskId: z.string().optional(),
|
|
59
65
|
}),
|
|
60
66
|
});
|
|
67
|
+
export type ChangeCsStatusEventPayload = z.infer<
|
|
68
|
+
typeof changeCsStatusEventSchema
|
|
69
|
+
>["payload"];
|
|
70
|
+
export type ChangeCsStatusRpaEvent = z.infer<typeof changeCsStatusEventSchema>;
|
|
61
71
|
|
|
62
72
|
// 用户消息事件
|
|
63
73
|
export const userMessageEventSchema = rpaEventBaseSchema.extend({
|
|
@@ -68,6 +78,10 @@ export const userMessageEventSchema = rpaEventBaseSchema.extend({
|
|
|
68
78
|
uid: z.string(),
|
|
69
79
|
}),
|
|
70
80
|
});
|
|
81
|
+
export type UserMessageEventPayload = z.infer<
|
|
82
|
+
typeof userMessageEventSchema
|
|
83
|
+
>["payload"];
|
|
84
|
+
export type UserMessageRpaEvent = z.infer<typeof userMessageEventSchema>;
|
|
71
85
|
|
|
72
86
|
// RPA 事件 Schema (Discriminated Union)
|
|
73
87
|
export const rpaEventSchema = z.discriminatedUnion("eventType", [
|