@stellaris/metrics-shared 0.1.6 → 0.1.8
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 +146 -43
- package/package.json +1 -1
- package/schemas/rpa-event.ts +40 -2
package/bff-service.d.ts
CHANGED
|
@@ -899,17 +899,44 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
|
|
|
899
899
|
agentConfigId: string;
|
|
900
900
|
stage: "success" | "queued" | "executing" | "failed";
|
|
901
901
|
eventType: "reply-message";
|
|
902
|
-
payload:
|
|
902
|
+
payload: {
|
|
903
|
+
[x: string]: unknown;
|
|
904
|
+
mallId: string;
|
|
905
|
+
shopId: string;
|
|
906
|
+
userId: string;
|
|
907
|
+
uid: string;
|
|
908
|
+
messageId: string;
|
|
909
|
+
content: string;
|
|
910
|
+
aiAgentConfigId: number;
|
|
911
|
+
host: string;
|
|
912
|
+
platformCode: string;
|
|
913
|
+
ignoreTransferred: boolean;
|
|
914
|
+
tbUid?: string | undefined;
|
|
915
|
+
msgId?: string | undefined;
|
|
916
|
+
procState?: string | undefined;
|
|
917
|
+
transferReason?: string | undefined;
|
|
918
|
+
messageType?: "specialSceneTransfer" | undefined;
|
|
919
|
+
orderRemark?: string | undefined;
|
|
920
|
+
};
|
|
903
921
|
message?: string | null | undefined;
|
|
904
922
|
timestamp?: number | undefined;
|
|
923
|
+
sequence?: number | undefined;
|
|
905
924
|
} | {
|
|
906
925
|
shopId: string;
|
|
907
926
|
agentConfigId: string;
|
|
908
927
|
stage: "success" | "queued" | "executing" | "failed";
|
|
909
928
|
eventType: "change-cs-status";
|
|
910
|
-
payload:
|
|
929
|
+
payload: {
|
|
930
|
+
[x: string]: unknown;
|
|
931
|
+
aiAgentConfigId: number;
|
|
932
|
+
host: string;
|
|
933
|
+
status: 3 | 1 | 2;
|
|
934
|
+
platformCode?: string | undefined;
|
|
935
|
+
taskId?: string | undefined;
|
|
936
|
+
};
|
|
911
937
|
message?: string | null | undefined;
|
|
912
938
|
timestamp?: number | undefined;
|
|
939
|
+
sequence?: number | undefined;
|
|
913
940
|
} | {
|
|
914
941
|
shopId: string;
|
|
915
942
|
agentConfigId: string;
|
|
@@ -922,6 +949,7 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
|
|
|
922
949
|
};
|
|
923
950
|
message?: string | null | undefined;
|
|
924
951
|
timestamp?: number | undefined;
|
|
952
|
+
sequence?: number | undefined;
|
|
925
953
|
};
|
|
926
954
|
};
|
|
927
955
|
output: {
|
|
@@ -2140,17 +2168,44 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
|
|
|
2140
2168
|
agentConfigId: string;
|
|
2141
2169
|
stage: "success" | "queued" | "executing" | "failed";
|
|
2142
2170
|
eventType: "reply-message";
|
|
2143
|
-
payload:
|
|
2171
|
+
payload: {
|
|
2172
|
+
[x: string]: unknown;
|
|
2173
|
+
mallId: string;
|
|
2174
|
+
shopId: string;
|
|
2175
|
+
userId: string;
|
|
2176
|
+
uid: string;
|
|
2177
|
+
messageId: string;
|
|
2178
|
+
content: string;
|
|
2179
|
+
aiAgentConfigId: number;
|
|
2180
|
+
host: string;
|
|
2181
|
+
platformCode: string;
|
|
2182
|
+
ignoreTransferred: boolean;
|
|
2183
|
+
tbUid?: string | undefined;
|
|
2184
|
+
msgId?: string | undefined;
|
|
2185
|
+
procState?: string | undefined;
|
|
2186
|
+
transferReason?: string | undefined;
|
|
2187
|
+
messageType?: "specialSceneTransfer" | undefined;
|
|
2188
|
+
orderRemark?: string | undefined;
|
|
2189
|
+
};
|
|
2144
2190
|
message?: string | null | undefined;
|
|
2145
2191
|
timestamp?: number | undefined;
|
|
2192
|
+
sequence?: number | undefined;
|
|
2146
2193
|
} | {
|
|
2147
2194
|
shopId: string;
|
|
2148
2195
|
agentConfigId: string;
|
|
2149
2196
|
stage: "success" | "queued" | "executing" | "failed";
|
|
2150
2197
|
eventType: "change-cs-status";
|
|
2151
|
-
payload:
|
|
2198
|
+
payload: {
|
|
2199
|
+
[x: string]: unknown;
|
|
2200
|
+
aiAgentConfigId: number;
|
|
2201
|
+
host: string;
|
|
2202
|
+
status: 3 | 1 | 2;
|
|
2203
|
+
platformCode?: string | undefined;
|
|
2204
|
+
taskId?: string | undefined;
|
|
2205
|
+
};
|
|
2152
2206
|
message?: string | null | undefined;
|
|
2153
2207
|
timestamp?: number | undefined;
|
|
2208
|
+
sequence?: number | undefined;
|
|
2154
2209
|
} | {
|
|
2155
2210
|
shopId: string;
|
|
2156
2211
|
agentConfigId: string;
|
|
@@ -2163,11 +2218,11 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
|
|
|
2163
2218
|
};
|
|
2164
2219
|
message?: string | null | undefined;
|
|
2165
2220
|
timestamp?: number | undefined;
|
|
2221
|
+
sequence?: number | undefined;
|
|
2166
2222
|
};
|
|
2167
2223
|
};
|
|
2168
2224
|
output: {
|
|
2169
2225
|
success: true;
|
|
2170
|
-
clients: number;
|
|
2171
2226
|
};
|
|
2172
2227
|
outputFormat: "json";
|
|
2173
2228
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
@@ -2183,17 +2238,44 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
|
|
|
2183
2238
|
agentConfigId: string;
|
|
2184
2239
|
stage: "success" | "queued" | "executing" | "failed";
|
|
2185
2240
|
eventType: "reply-message";
|
|
2186
|
-
payload:
|
|
2241
|
+
payload: {
|
|
2242
|
+
[x: string]: unknown;
|
|
2243
|
+
mallId: string;
|
|
2244
|
+
shopId: string;
|
|
2245
|
+
userId: string;
|
|
2246
|
+
uid: string;
|
|
2247
|
+
messageId: string;
|
|
2248
|
+
content: string;
|
|
2249
|
+
aiAgentConfigId: number;
|
|
2250
|
+
host: string;
|
|
2251
|
+
platformCode: string;
|
|
2252
|
+
ignoreTransferred: boolean;
|
|
2253
|
+
tbUid?: string | undefined;
|
|
2254
|
+
msgId?: string | undefined;
|
|
2255
|
+
procState?: string | undefined;
|
|
2256
|
+
transferReason?: string | undefined;
|
|
2257
|
+
messageType?: "specialSceneTransfer" | undefined;
|
|
2258
|
+
orderRemark?: string | undefined;
|
|
2259
|
+
};
|
|
2187
2260
|
message?: string | null | undefined;
|
|
2188
2261
|
timestamp?: number | undefined;
|
|
2262
|
+
sequence?: number | undefined;
|
|
2189
2263
|
} | {
|
|
2190
2264
|
shopId: string;
|
|
2191
2265
|
agentConfigId: string;
|
|
2192
2266
|
stage: "success" | "queued" | "executing" | "failed";
|
|
2193
2267
|
eventType: "change-cs-status";
|
|
2194
|
-
payload:
|
|
2268
|
+
payload: {
|
|
2269
|
+
[x: string]: unknown;
|
|
2270
|
+
aiAgentConfigId: number;
|
|
2271
|
+
host: string;
|
|
2272
|
+
status: 3 | 1 | 2;
|
|
2273
|
+
platformCode?: string | undefined;
|
|
2274
|
+
taskId?: string | undefined;
|
|
2275
|
+
};
|
|
2195
2276
|
message?: string | null | undefined;
|
|
2196
2277
|
timestamp?: number | undefined;
|
|
2278
|
+
sequence?: number | undefined;
|
|
2197
2279
|
} | {
|
|
2198
2280
|
shopId: string;
|
|
2199
2281
|
agentConfigId: string;
|
|
@@ -2206,72 +2288,93 @@ declare const app: import("hono/hono-base").HonoBase<{}, {
|
|
|
2206
2288
|
};
|
|
2207
2289
|
message?: string | null | undefined;
|
|
2208
2290
|
timestamp?: number | undefined;
|
|
2291
|
+
sequence?: number | undefined;
|
|
2209
2292
|
})[];
|
|
2210
2293
|
};
|
|
2211
2294
|
};
|
|
2212
2295
|
output: {
|
|
2213
2296
|
success: true;
|
|
2214
2297
|
count: number;
|
|
2215
|
-
clients: number;
|
|
2216
2298
|
};
|
|
2217
2299
|
outputFormat: "json";
|
|
2218
2300
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
2219
2301
|
};
|
|
2220
2302
|
};
|
|
2221
|
-
}
|
|
2303
|
+
}, "/api/rpa-events"> | import("hono/types").MergeSchemaPath<{
|
|
2222
2304
|
"/recent": {
|
|
2223
2305
|
$get: {
|
|
2224
|
-
input: {
|
|
2306
|
+
input: {
|
|
2307
|
+
query: {
|
|
2308
|
+
shopId: string | string[];
|
|
2309
|
+
limit?: string | string[] | undefined;
|
|
2310
|
+
};
|
|
2311
|
+
};
|
|
2225
2312
|
output: {
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
eventType: "change-cs-status";
|
|
2241
|
-
payload: {
|
|
2242
|
-
[x: string]: import("hono/utils/types").JSONValue;
|
|
2243
|
-
};
|
|
2244
|
-
message?: string | null | undefined;
|
|
2245
|
-
timestamp?: number | undefined;
|
|
2246
|
-
} | {
|
|
2313
|
+
error: string;
|
|
2314
|
+
};
|
|
2315
|
+
outputFormat: "json";
|
|
2316
|
+
status: 400;
|
|
2317
|
+
} | {
|
|
2318
|
+
input: {
|
|
2319
|
+
query: {
|
|
2320
|
+
shopId: string | string[];
|
|
2321
|
+
limit?: string | string[] | undefined;
|
|
2322
|
+
};
|
|
2323
|
+
};
|
|
2324
|
+
output: {
|
|
2325
|
+
sessions: {
|
|
2326
|
+
sessionId: string;
|
|
2247
2327
|
shopId: string;
|
|
2248
2328
|
agentConfigId: string;
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
}
|
|
2329
|
+
platform: string;
|
|
2330
|
+
uid: string;
|
|
2331
|
+
userId: string;
|
|
2332
|
+
status: "active";
|
|
2333
|
+
lastEventType: string;
|
|
2334
|
+
lastStage: string;
|
|
2335
|
+
lastEventSeq: number;
|
|
2336
|
+
lastEventAt: number;
|
|
2337
|
+
lastMessage?: string | null | undefined;
|
|
2338
|
+
}[];
|
|
2259
2339
|
total: number;
|
|
2340
|
+
totalByShop: {
|
|
2341
|
+
[x: string]: number;
|
|
2342
|
+
};
|
|
2343
|
+
snapshotSeqByShop: {
|
|
2344
|
+
[x: string]: number;
|
|
2345
|
+
};
|
|
2260
2346
|
};
|
|
2261
2347
|
outputFormat: "json";
|
|
2262
2348
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
2349
|
+
} | {
|
|
2350
|
+
input: {
|
|
2351
|
+
query: {
|
|
2352
|
+
shopId: string | string[];
|
|
2353
|
+
limit?: string | string[] | undefined;
|
|
2354
|
+
};
|
|
2355
|
+
};
|
|
2356
|
+
output: {
|
|
2357
|
+
error: string;
|
|
2358
|
+
};
|
|
2359
|
+
outputFormat: "json";
|
|
2360
|
+
status: 500;
|
|
2263
2361
|
};
|
|
2264
2362
|
};
|
|
2265
2363
|
} & {
|
|
2266
2364
|
"/stream": {
|
|
2267
2365
|
$get: {
|
|
2268
|
-
input: {
|
|
2366
|
+
input: {
|
|
2367
|
+
query: {
|
|
2368
|
+
shopId: string | string[];
|
|
2369
|
+
limit?: string | string[] | undefined;
|
|
2370
|
+
};
|
|
2371
|
+
};
|
|
2269
2372
|
output: {};
|
|
2270
2373
|
outputFormat: string;
|
|
2271
2374
|
status: import("hono/utils/http-status").StatusCode;
|
|
2272
2375
|
};
|
|
2273
2376
|
};
|
|
2274
|
-
}, "/api/rpa-
|
|
2377
|
+
}, "/api/rpa-sessions">, "/", "/health">;
|
|
2275
2378
|
export type AppType = typeof app;
|
|
2276
2379
|
|
|
2277
2380
|
export {
|
package/package.json
CHANGED
package/schemas/rpa-event.ts
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* 消息场景类型
|
|
5
|
+
*/
|
|
6
|
+
export const messageSceneTypeSchema = z.literal("specialSceneTransfer");
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 客服状态枚举
|
|
10
|
+
*/
|
|
11
|
+
export const csStatusSchema = z.union([
|
|
12
|
+
z.literal(1),
|
|
13
|
+
z.literal(2),
|
|
14
|
+
z.literal(3),
|
|
15
|
+
]);
|
|
16
|
+
|
|
3
17
|
// RPA 事件基础字段
|
|
4
18
|
export const rpaEventBaseSchema = z.object({
|
|
5
19
|
shopId: z.string(),
|
|
@@ -7,18 +21,42 @@ export const rpaEventBaseSchema = z.object({
|
|
|
7
21
|
stage: z.enum(["queued", "executing", "success", "failed"]),
|
|
8
22
|
message: z.string().nullable().optional(),
|
|
9
23
|
timestamp: z.number().optional(),
|
|
24
|
+
sequence: z.number().int().optional(),
|
|
10
25
|
});
|
|
11
26
|
|
|
12
27
|
// 回复消息事件
|
|
13
28
|
export const replyMessageEventSchema = rpaEventBaseSchema.extend({
|
|
14
29
|
eventType: z.literal("reply-message"),
|
|
15
|
-
payload: z.
|
|
30
|
+
payload: z.looseObject({
|
|
31
|
+
mallId: z.string(),
|
|
32
|
+
shopId: z.string(),
|
|
33
|
+
userId: z.string(),
|
|
34
|
+
uid: z.string(),
|
|
35
|
+
messageId: z.string(),
|
|
36
|
+
content: z.string(),
|
|
37
|
+
aiAgentConfigId: z.number(),
|
|
38
|
+
host: z.string(),
|
|
39
|
+
platformCode: z.string(),
|
|
40
|
+
tbUid: z.string().optional(),
|
|
41
|
+
msgId: z.string().optional(),
|
|
42
|
+
procState: z.string().optional(),
|
|
43
|
+
transferReason: z.string().optional(),
|
|
44
|
+
messageType: messageSceneTypeSchema.optional(),
|
|
45
|
+
orderRemark: z.string().optional(),
|
|
46
|
+
ignoreTransferred: z.boolean(),
|
|
47
|
+
}),
|
|
16
48
|
});
|
|
17
49
|
|
|
18
50
|
// 变更客服状态事件
|
|
19
51
|
export const changeCsStatusEventSchema = rpaEventBaseSchema.extend({
|
|
20
52
|
eventType: z.literal("change-cs-status"),
|
|
21
|
-
payload: z.
|
|
53
|
+
payload: z.looseObject({
|
|
54
|
+
aiAgentConfigId: z.number(),
|
|
55
|
+
host: z.string(),
|
|
56
|
+
status: csStatusSchema,
|
|
57
|
+
platformCode: z.string().optional(),
|
|
58
|
+
taskId: z.string().optional(),
|
|
59
|
+
}),
|
|
22
60
|
});
|
|
23
61
|
|
|
24
62
|
// 用户消息事件
|