@stellaris/metrics-shared 0.1.9 → 0.1.12

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
@@ -1,6 +1,8 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
3
  export type ReportStatus = "draft" | "published" | "archived";
4
+ export type RpaStage = "queued" | "executing" | "success" | "failed";
5
+ export type RpaActionEventType = "reply-message" | "change-cs-status";
4
6
  declare const app: import("hono/hono-base").HonoBase<{}, {
5
7
  "/health": {
6
8
  $get: {
@@ -54,11 +56,11 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
54
56
  };
55
57
  };
56
58
  } & {
57
- "/:id": {
59
+ "/by-name/:name": {
58
60
  $get: {
59
61
  input: {
60
62
  param: {
61
- id: string;
63
+ name: string;
62
64
  };
63
65
  };
64
66
  output: {
@@ -69,7 +71,7 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
69
71
  } | {
70
72
  input: {
71
73
  param: {
72
- id: string;
74
+ name: string;
73
75
  };
74
76
  };
75
77
  output: {
@@ -84,11 +86,11 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
84
86
  };
85
87
  };
86
88
  } & {
87
- "/by-name/:name": {
89
+ "/:id": {
88
90
  $get: {
89
91
  input: {
90
92
  param: {
91
- name: string;
93
+ id: string;
92
94
  };
93
95
  };
94
96
  output: {
@@ -103,7 +105,7 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
103
105
  } | {
104
106
  input: {
105
107
  param: {
106
- name: string;
108
+ id: string;
107
109
  };
108
110
  };
109
111
  output: {
@@ -910,17 +912,18 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
910
912
  aiAgentConfigId: number;
911
913
  host: string;
912
914
  platformCode: string;
913
- ignoreTransferred: boolean;
914
- tbUid?: string | undefined;
915
+ tbUid: string;
915
916
  msgId?: string | undefined;
916
917
  procState?: string | undefined;
917
918
  transferReason?: string | undefined;
918
919
  messageType?: "specialSceneTransfer" | undefined;
919
920
  orderRemark?: string | undefined;
921
+ ignoreTransferred?: boolean | undefined;
920
922
  };
921
923
  message?: string | null | undefined;
922
924
  timestamp?: number | undefined;
923
925
  sequence?: number | undefined;
926
+ actionId?: string | undefined;
924
927
  } | {
925
928
  shopId: string;
926
929
  agentConfigId: string;
@@ -937,6 +940,7 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
937
940
  message?: string | null | undefined;
938
941
  timestamp?: number | undefined;
939
942
  sequence?: number | undefined;
943
+ actionId?: string | undefined;
940
944
  } | {
941
945
  shopId: string;
942
946
  agentConfigId: string;
@@ -950,6 +954,7 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
950
954
  message?: string | null | undefined;
951
955
  timestamp?: number | undefined;
952
956
  sequence?: number | undefined;
957
+ actionId?: string | undefined;
953
958
  };
954
959
  };
955
960
  output: {
@@ -2179,17 +2184,18 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
2179
2184
  aiAgentConfigId: number;
2180
2185
  host: string;
2181
2186
  platformCode: string;
2182
- ignoreTransferred: boolean;
2183
- tbUid?: string | undefined;
2187
+ tbUid: string;
2184
2188
  msgId?: string | undefined;
2185
2189
  procState?: string | undefined;
2186
2190
  transferReason?: string | undefined;
2187
2191
  messageType?: "specialSceneTransfer" | undefined;
2188
2192
  orderRemark?: string | undefined;
2193
+ ignoreTransferred?: boolean | undefined;
2189
2194
  };
2190
2195
  message?: string | null | undefined;
2191
2196
  timestamp?: number | undefined;
2192
2197
  sequence?: number | undefined;
2198
+ actionId?: string | undefined;
2193
2199
  } | {
2194
2200
  shopId: string;
2195
2201
  agentConfigId: string;
@@ -2206,6 +2212,7 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
2206
2212
  message?: string | null | undefined;
2207
2213
  timestamp?: number | undefined;
2208
2214
  sequence?: number | undefined;
2215
+ actionId?: string | undefined;
2209
2216
  } | {
2210
2217
  shopId: string;
2211
2218
  agentConfigId: string;
@@ -2219,6 +2226,7 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
2219
2226
  message?: string | null | undefined;
2220
2227
  timestamp?: number | undefined;
2221
2228
  sequence?: number | undefined;
2229
+ actionId?: string | undefined;
2222
2230
  };
2223
2231
  };
2224
2232
  output: {
@@ -2249,17 +2257,18 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
2249
2257
  aiAgentConfigId: number;
2250
2258
  host: string;
2251
2259
  platformCode: string;
2252
- ignoreTransferred: boolean;
2253
- tbUid?: string | undefined;
2260
+ tbUid: string;
2254
2261
  msgId?: string | undefined;
2255
2262
  procState?: string | undefined;
2256
2263
  transferReason?: string | undefined;
2257
2264
  messageType?: "specialSceneTransfer" | undefined;
2258
2265
  orderRemark?: string | undefined;
2266
+ ignoreTransferred?: boolean | undefined;
2259
2267
  };
2260
2268
  message?: string | null | undefined;
2261
2269
  timestamp?: number | undefined;
2262
2270
  sequence?: number | undefined;
2271
+ actionId?: string | undefined;
2263
2272
  } | {
2264
2273
  shopId: string;
2265
2274
  agentConfigId: string;
@@ -2276,6 +2285,7 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
2276
2285
  message?: string | null | undefined;
2277
2286
  timestamp?: number | undefined;
2278
2287
  sequence?: number | undefined;
2288
+ actionId?: string | undefined;
2279
2289
  } | {
2280
2290
  shopId: string;
2281
2291
  agentConfigId: string;
@@ -2289,6 +2299,7 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
2289
2299
  message?: string | null | undefined;
2290
2300
  timestamp?: number | undefined;
2291
2301
  sequence?: number | undefined;
2302
+ actionId?: string | undefined;
2292
2303
  })[];
2293
2304
  };
2294
2305
  };
@@ -2331,10 +2342,16 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
2331
2342
  userId: string;
2332
2343
  status: "active";
2333
2344
  lastEventType: string;
2334
- lastStage: string;
2345
+ lastStage: RpaStage;
2335
2346
  lastEventSeq: number;
2336
2347
  lastEventAt: number;
2337
2348
  lastMessage?: string | null | undefined;
2349
+ lastActionType?: RpaActionEventType | undefined;
2350
+ lastActionStage?: RpaStage | undefined;
2351
+ lastActionSeq?: number | undefined;
2352
+ lastActionAt?: number | undefined;
2353
+ lastActionMessage?: string | null | undefined;
2354
+ lastActionId?: string | null | undefined;
2338
2355
  }[];
2339
2356
  total: number;
2340
2357
  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.12",
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
  // 回复消息事件
@@ -39,13 +40,13 @@ export const replyMessageEventSchema = rpaEventBaseSchema.extend({
39
40
  aiAgentConfigId: z.number(),
40
41
  host: z.string(),
41
42
  platformCode: z.string(),
42
- tbUid: z.string().optional(),
43
+ tbUid: z.string(),
43
44
  msgId: z.string().optional(),
44
45
  procState: z.string().optional(),
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,72 @@
1
+ export type RpaStage = "queued" | "executing" | "success" | "failed";
2
+
3
+ export type RpaActionEventType = "reply-message" | "change-cs-status";
4
+
5
+ export type AgentStatus = "online" | "suspended" | "offline";
6
+
7
+ export type SessionUpdateMessage =
8
+ | {
9
+ type: "upsert";
10
+ session: RpaSession;
11
+ shopId: string;
12
+ sequence: number;
13
+ timestamp: number;
14
+ }
15
+ | {
16
+ type: "remove";
17
+ sessionId: string;
18
+ shopId: string;
19
+ agentConfigId?: string;
20
+ sequence: number;
21
+ timestamp: number;
22
+ };
23
+
24
+ export type ActionUpdateMessage = {
25
+ type: "action-upsert";
26
+ action: RpaAction;
27
+ shopId: string;
28
+ sequence: number;
29
+ timestamp: number;
30
+ };
31
+
32
+ export type StreamUpdateMessage = SessionUpdateMessage | ActionUpdateMessage;
33
+
34
+ export type RpaSession = {
35
+ sessionId: string;
36
+ shopId: string;
37
+ agentConfigId: string;
38
+ platform: string;
39
+ uid: string;
40
+ userId: string;
41
+ status: "active";
42
+ lastEventType: string;
43
+ lastStage: RpaStage;
44
+ lastEventSeq: number;
45
+ lastEventAt: number;
46
+ lastMessage?: string | null;
47
+ lastActionType?: RpaActionEventType;
48
+ lastActionStage?: RpaStage;
49
+ lastActionSeq?: number;
50
+ lastActionAt?: number;
51
+ lastActionMessage?: string | null;
52
+ lastActionId?: string | null;
53
+ };
54
+
55
+ export type RpaAction = {
56
+ actionKey: string;
57
+ actionId?: string | null;
58
+ eventType: RpaActionEventType;
59
+ stage: RpaStage;
60
+ message?: string | null;
61
+ timestamp: number;
62
+ sequence: number;
63
+ shopId: string;
64
+ agentConfigId: string;
65
+ uid?: string;
66
+ };
67
+
68
+ export type SessionIdentity = {
69
+ platform: string;
70
+ uid: string;
71
+ userId: string;
72
+ };