rategame-shared 1.1.224 → 1.1.225
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/dist/models/chat.d.ts +1 -0
- package/dist/schemas/chat.d.ts +12 -4
- package/dist/schemas/chat.js +10 -2
- package/package.json +1 -1
package/dist/models/chat.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ import { chatMessageSchema, communityChatMessageSchema, messageReactionSchema }
|
|
|
3
3
|
export type ChatMessage = z.infer<typeof chatMessageSchema>;
|
|
4
4
|
export type CommunityChatMessage = z.infer<typeof communityChatMessageSchema>;
|
|
5
5
|
export type MessageReaction = z.infer<typeof messageReactionSchema>;
|
|
6
|
+
export type UnionChatMessage = ChatMessage | CommunityChatMessage;
|
package/dist/schemas/chat.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const chatMessageSchema: z.ZodObject<{
|
|
2
|
+
export declare const chatMessageSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
3
3
|
id: z.ZodString;
|
|
4
4
|
content: z.ZodString;
|
|
5
5
|
createdAt: z.ZodAny;
|
|
@@ -1763,7 +1763,9 @@ export declare const chatMessageSchema: z.ZodObject<{
|
|
|
1763
1763
|
avatarUrl?: string | null | undefined;
|
|
1764
1764
|
badge?: string | undefined;
|
|
1765
1765
|
}>>>;
|
|
1766
|
-
},
|
|
1766
|
+
}, {
|
|
1767
|
+
replyToMessage: z.ZodOptional<z.ZodNullable<z.ZodType<any, z.ZodTypeDef, any>>>;
|
|
1768
|
+
}>, "strip", z.ZodTypeAny, {
|
|
1767
1769
|
type: "text" | "rating" | "game" | "profile" | "list" | "gif";
|
|
1768
1770
|
id: string;
|
|
1769
1771
|
content: string;
|
|
@@ -1789,6 +1791,7 @@ export declare const chatMessageSchema: z.ZodObject<{
|
|
|
1789
1791
|
} | null | undefined;
|
|
1790
1792
|
itemId?: string | undefined;
|
|
1791
1793
|
gifUrl?: string | undefined;
|
|
1794
|
+
replyToMessage?: any;
|
|
1792
1795
|
}, {
|
|
1793
1796
|
type: "text" | "rating" | "game" | "profile" | "list" | "gif";
|
|
1794
1797
|
id: string;
|
|
@@ -1815,8 +1818,9 @@ export declare const chatMessageSchema: z.ZodObject<{
|
|
|
1815
1818
|
} | null | undefined;
|
|
1816
1819
|
itemId?: string | undefined;
|
|
1817
1820
|
gifUrl?: string | undefined;
|
|
1821
|
+
replyToMessage?: any;
|
|
1818
1822
|
}>;
|
|
1819
|
-
export declare const communityChatMessageSchema: z.ZodObject<{
|
|
1823
|
+
export declare const communityChatMessageSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
1820
1824
|
id: z.ZodString;
|
|
1821
1825
|
content: z.ZodOptional<z.ZodString>;
|
|
1822
1826
|
createdAt: z.ZodAny;
|
|
@@ -3578,7 +3582,9 @@ export declare const communityChatMessageSchema: z.ZodObject<{
|
|
|
3578
3582
|
avatarUrl?: string | null | undefined;
|
|
3579
3583
|
badge?: string | undefined;
|
|
3580
3584
|
}>>>;
|
|
3581
|
-
},
|
|
3585
|
+
}, {
|
|
3586
|
+
replyToMessage: z.ZodOptional<z.ZodNullable<z.ZodType<any, z.ZodTypeDef, any>>>;
|
|
3587
|
+
}>, "strip", z.ZodTypeAny, {
|
|
3582
3588
|
type: "text" | "rating" | "game" | "profile" | "list" | "gif";
|
|
3583
3589
|
id: string;
|
|
3584
3590
|
user: {
|
|
@@ -3602,6 +3608,7 @@ export declare const communityChatMessageSchema: z.ZodObject<{
|
|
|
3602
3608
|
} | null | undefined;
|
|
3603
3609
|
itemId?: string | undefined;
|
|
3604
3610
|
gifUrl?: string | undefined;
|
|
3611
|
+
replyToMessage?: any;
|
|
3605
3612
|
}, {
|
|
3606
3613
|
type: "text" | "rating" | "game" | "profile" | "list" | "gif";
|
|
3607
3614
|
id: string;
|
|
@@ -3626,6 +3633,7 @@ export declare const communityChatMessageSchema: z.ZodObject<{
|
|
|
3626
3633
|
} | null | undefined;
|
|
3627
3634
|
itemId?: string | undefined;
|
|
3628
3635
|
gifUrl?: string | undefined;
|
|
3636
|
+
replyToMessage?: any;
|
|
3629
3637
|
}>;
|
|
3630
3638
|
export declare const messageReactionSchema: z.ZodObject<{
|
|
3631
3639
|
id: z.ZodString;
|
package/dist/schemas/chat.js
CHANGED
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.messageReactionSchema = exports.communityChatMessageSchema = exports.chatMessageSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const user_1 = require("./user");
|
|
6
|
-
|
|
6
|
+
// Define the schemas without the circular reference first
|
|
7
|
+
const baseChatMessageSchema = zod_1.z.object({
|
|
7
8
|
id: zod_1.z.string(),
|
|
8
9
|
content: zod_1.z.string().min(1),
|
|
9
10
|
createdAt: zod_1.z.any(),
|
|
@@ -25,7 +26,7 @@ exports.chatMessageSchema = zod_1.z.object({
|
|
|
25
26
|
isReply: zod_1.z.boolean().optional(),
|
|
26
27
|
replyTo: user_1.reducedUserSchema.nullable().optional(),
|
|
27
28
|
});
|
|
28
|
-
|
|
29
|
+
const baseCommunityChatMessageSchema = zod_1.z.object({
|
|
29
30
|
id: zod_1.z.string(),
|
|
30
31
|
content: zod_1.z.string().min(1).optional(),
|
|
31
32
|
createdAt: zod_1.z.any(),
|
|
@@ -45,6 +46,13 @@ exports.communityChatMessageSchema = zod_1.z.object({
|
|
|
45
46
|
isReply: zod_1.z.boolean().optional(),
|
|
46
47
|
replyTo: user_1.reducedUserSchema.nullable().optional(),
|
|
47
48
|
});
|
|
49
|
+
const UnionChatMessage = zod_1.z.lazy(() => zod_1.z.union([exports.chatMessageSchema, exports.communityChatMessageSchema]));
|
|
50
|
+
exports.chatMessageSchema = baseChatMessageSchema.extend({
|
|
51
|
+
replyToMessage: UnionChatMessage.nullable().optional(),
|
|
52
|
+
});
|
|
53
|
+
exports.communityChatMessageSchema = baseCommunityChatMessageSchema.extend({
|
|
54
|
+
replyToMessage: UnionChatMessage.nullable().optional(),
|
|
55
|
+
});
|
|
48
56
|
exports.messageReactionSchema = zod_1.z.object({
|
|
49
57
|
id: zod_1.z.string(),
|
|
50
58
|
messageId: zod_1.z.string(),
|