@stellaris/metrics-shared 0.1.9 → 0.1.10

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/bff-service.d.ts CHANGED
@@ -54,11 +54,11 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
54
54
  };
55
55
  };
56
56
  } & {
57
- "/:id": {
57
+ "/by-name/:name": {
58
58
  $get: {
59
59
  input: {
60
60
  param: {
61
- id: string;
61
+ name: string;
62
62
  };
63
63
  };
64
64
  output: {
@@ -69,7 +69,7 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
69
69
  } | {
70
70
  input: {
71
71
  param: {
72
- id: string;
72
+ name: string;
73
73
  };
74
74
  };
75
75
  output: {
@@ -84,11 +84,11 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
84
84
  };
85
85
  };
86
86
  } & {
87
- "/by-name/:name": {
87
+ "/:id": {
88
88
  $get: {
89
89
  input: {
90
90
  param: {
91
- name: string;
91
+ id: string;
92
92
  };
93
93
  };
94
94
  output: {
@@ -103,7 +103,7 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
103
103
  } | {
104
104
  input: {
105
105
  param: {
106
- name: string;
106
+ id: string;
107
107
  };
108
108
  };
109
109
  output: {
@@ -910,17 +910,18 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
910
910
  aiAgentConfigId: number;
911
911
  host: string;
912
912
  platformCode: string;
913
- ignoreTransferred: boolean;
914
913
  tbUid?: string | undefined;
915
914
  msgId?: string | undefined;
916
915
  procState?: string | undefined;
917
916
  transferReason?: string | undefined;
918
917
  messageType?: "specialSceneTransfer" | undefined;
919
918
  orderRemark?: string | undefined;
919
+ ignoreTransferred?: boolean | undefined;
920
920
  };
921
921
  message?: string | null | undefined;
922
922
  timestamp?: number | undefined;
923
923
  sequence?: number | undefined;
924
+ actionId?: string | undefined;
924
925
  } | {
925
926
  shopId: string;
926
927
  agentConfigId: string;
@@ -937,6 +938,7 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
937
938
  message?: string | null | undefined;
938
939
  timestamp?: number | undefined;
939
940
  sequence?: number | undefined;
941
+ actionId?: string | undefined;
940
942
  } | {
941
943
  shopId: string;
942
944
  agentConfigId: string;
@@ -950,6 +952,7 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
950
952
  message?: string | null | undefined;
951
953
  timestamp?: number | undefined;
952
954
  sequence?: number | undefined;
955
+ actionId?: string | undefined;
953
956
  };
954
957
  };
955
958
  output: {
@@ -2179,17 +2182,18 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
2179
2182
  aiAgentConfigId: number;
2180
2183
  host: string;
2181
2184
  platformCode: string;
2182
- ignoreTransferred: boolean;
2183
2185
  tbUid?: string | undefined;
2184
2186
  msgId?: string | undefined;
2185
2187
  procState?: string | undefined;
2186
2188
  transferReason?: string | undefined;
2187
2189
  messageType?: "specialSceneTransfer" | undefined;
2188
2190
  orderRemark?: string | undefined;
2191
+ ignoreTransferred?: boolean | undefined;
2189
2192
  };
2190
2193
  message?: string | null | undefined;
2191
2194
  timestamp?: number | undefined;
2192
2195
  sequence?: number | undefined;
2196
+ actionId?: string | undefined;
2193
2197
  } | {
2194
2198
  shopId: string;
2195
2199
  agentConfigId: string;
@@ -2206,6 +2210,7 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
2206
2210
  message?: string | null | undefined;
2207
2211
  timestamp?: number | undefined;
2208
2212
  sequence?: number | undefined;
2213
+ actionId?: string | undefined;
2209
2214
  } | {
2210
2215
  shopId: string;
2211
2216
  agentConfigId: string;
@@ -2219,6 +2224,7 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
2219
2224
  message?: string | null | undefined;
2220
2225
  timestamp?: number | undefined;
2221
2226
  sequence?: number | undefined;
2227
+ actionId?: string | undefined;
2222
2228
  };
2223
2229
  };
2224
2230
  output: {
@@ -2249,17 +2255,18 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
2249
2255
  aiAgentConfigId: number;
2250
2256
  host: string;
2251
2257
  platformCode: string;
2252
- ignoreTransferred: boolean;
2253
2258
  tbUid?: string | undefined;
2254
2259
  msgId?: string | undefined;
2255
2260
  procState?: string | undefined;
2256
2261
  transferReason?: string | undefined;
2257
2262
  messageType?: "specialSceneTransfer" | undefined;
2258
2263
  orderRemark?: string | undefined;
2264
+ ignoreTransferred?: boolean | undefined;
2259
2265
  };
2260
2266
  message?: string | null | undefined;
2261
2267
  timestamp?: number | undefined;
2262
2268
  sequence?: number | undefined;
2269
+ actionId?: string | undefined;
2263
2270
  } | {
2264
2271
  shopId: string;
2265
2272
  agentConfigId: string;
@@ -2276,6 +2283,7 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
2276
2283
  message?: string | null | undefined;
2277
2284
  timestamp?: number | undefined;
2278
2285
  sequence?: number | undefined;
2286
+ actionId?: string | undefined;
2279
2287
  } | {
2280
2288
  shopId: string;
2281
2289
  agentConfigId: string;
@@ -2289,6 +2297,7 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
2289
2297
  message?: string | null | undefined;
2290
2298
  timestamp?: number | undefined;
2291
2299
  sequence?: number | undefined;
2300
+ actionId?: string | undefined;
2292
2301
  })[];
2293
2302
  };
2294
2303
  };
@@ -2335,6 +2344,12 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
2335
2344
  lastEventSeq: number;
2336
2345
  lastEventAt: number;
2337
2346
  lastMessage?: string | null | undefined;
2347
+ lastActionType?: string | undefined;
2348
+ lastActionStage?: string | undefined;
2349
+ lastActionSeq?: number | undefined;
2350
+ lastActionAt?: number | undefined;
2351
+ lastActionMessage?: string | null | undefined;
2352
+ lastActionId?: string | null | undefined;
2338
2353
  }[];
2339
2354
  total: number;
2340
2355
  totalByShop: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stellaris/metrics-shared",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "type": "module",
5
5
  "main": "./index.ts",
6
6
  "types": "./index.ts",
package/schemas/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./filter";
2
2
  export * from "./metric";
3
3
  export * from "./rpa-event";
4
+ export * from "./rpa-session";
4
5
  export * from "./time";
@@ -24,6 +24,7 @@ export const rpaEventBaseSchema = z.object({
24
24
  message: z.string().nullable().optional(),
25
25
  timestamp: z.number().optional(),
26
26
  sequence: z.number().int().optional(),
27
+ actionId: z.string().optional(),
27
28
  });
28
29
 
29
30
  // 回复消息事件
@@ -45,7 +46,7 @@ export const replyMessageEventSchema = rpaEventBaseSchema.extend({
45
46
  transferReason: z.string().optional(),
46
47
  messageType: messageSceneTypeSchema.optional(),
47
48
  orderRemark: z.string().optional(),
48
- ignoreTransferred: z.boolean(),
49
+ ignoreTransferred: z.boolean().optional(),
49
50
  }),
50
51
  });
51
52
  export type ReplyMessageEventPayload = z.infer<
@@ -0,0 +1,66 @@
1
+ export type SessionUpdateMessage =
2
+ | {
3
+ type: "upsert";
4
+ session: RpaSession;
5
+ shopId: string;
6
+ sequence: number;
7
+ timestamp: number;
8
+ }
9
+ | {
10
+ type: "remove";
11
+ sessionId: string;
12
+ shopId: string;
13
+ agentConfigId?: string;
14
+ sequence: number;
15
+ timestamp: number;
16
+ };
17
+
18
+ export type ActionUpdateMessage = {
19
+ type: "action-upsert";
20
+ action: RpaAction;
21
+ shopId: string;
22
+ sequence: number;
23
+ timestamp: number;
24
+ };
25
+
26
+ export type StreamUpdateMessage = SessionUpdateMessage | ActionUpdateMessage;
27
+
28
+ export type RpaSession = {
29
+ sessionId: string;
30
+ shopId: string;
31
+ agentConfigId: string;
32
+ platform: string;
33
+ uid: string;
34
+ userId: string;
35
+ status: "active";
36
+ lastEventType: string;
37
+ lastStage: string;
38
+ lastEventSeq: number;
39
+ lastEventAt: number;
40
+ lastMessage?: string | null;
41
+ lastActionType?: string;
42
+ lastActionStage?: string;
43
+ lastActionSeq?: number;
44
+ lastActionAt?: number;
45
+ lastActionMessage?: string | null;
46
+ lastActionId?: string | null;
47
+ };
48
+
49
+ export type RpaAction = {
50
+ actionKey: string;
51
+ actionId?: string | null;
52
+ eventType: "reply-message" | "change-cs-status";
53
+ stage: string;
54
+ message?: string | null;
55
+ timestamp: number;
56
+ sequence: number;
57
+ shopId: string;
58
+ agentConfigId: string;
59
+ uid?: string;
60
+ };
61
+
62
+ export type SessionIdentity = {
63
+ platform: string;
64
+ uid: string;
65
+ userId?: string;
66
+ };