rategame-shared 1.0.4 → 1.0.6
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/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/models/game.d.ts +3 -0
- package/dist/models/game.js +2 -0
- package/dist/schemas/game.d.ts +191 -0
- package/dist/schemas/game.js +32 -0
- package/dist/schemas/user.d.ts +3 -0
- package/dist/schemas/user.js +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -16,5 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./schemas/user"), exports);
|
|
18
18
|
__exportStar(require("./schemas/rating"), exports);
|
|
19
|
+
__exportStar(require("./schemas/game"), exports);
|
|
19
20
|
__exportStar(require("./models/user"), exports);
|
|
20
21
|
__exportStar(require("./models/rating"), exports);
|
|
22
|
+
__exportStar(require("./models/game"), exports);
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const gameTeamSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodOptional<z.ZodString>;
|
|
4
|
+
teamId: z.ZodNumber;
|
|
5
|
+
score: z.ZodNumber;
|
|
6
|
+
isWinner: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
image: z.ZodString;
|
|
8
|
+
seed: z.ZodNumber;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
image: string;
|
|
11
|
+
teamId: number;
|
|
12
|
+
score: number;
|
|
13
|
+
seed: number;
|
|
14
|
+
id?: string | undefined;
|
|
15
|
+
isWinner?: boolean | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
image: string;
|
|
18
|
+
teamId: number;
|
|
19
|
+
score: number;
|
|
20
|
+
seed: number;
|
|
21
|
+
id?: string | undefined;
|
|
22
|
+
isWinner?: boolean | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const gameRatingAggregateSchema: z.ZodObject<{
|
|
25
|
+
avg: z.ZodNumber;
|
|
26
|
+
votes: z.ZodObject<{
|
|
27
|
+
options: z.ZodRecord<z.ZodNumber, z.ZodNumber>;
|
|
28
|
+
total: z.ZodNumber;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
total: number;
|
|
31
|
+
options: Record<number, number>;
|
|
32
|
+
}, {
|
|
33
|
+
total: number;
|
|
34
|
+
options: Record<number, number>;
|
|
35
|
+
}>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
avg: number;
|
|
38
|
+
votes: {
|
|
39
|
+
total: number;
|
|
40
|
+
options: Record<number, number>;
|
|
41
|
+
};
|
|
42
|
+
}, {
|
|
43
|
+
avg: number;
|
|
44
|
+
votes: {
|
|
45
|
+
total: number;
|
|
46
|
+
options: Record<number, number>;
|
|
47
|
+
};
|
|
48
|
+
}>;
|
|
49
|
+
export declare const gameSchema: z.ZodObject<{
|
|
50
|
+
id: z.ZodOptional<z.ZodString>;
|
|
51
|
+
status: z.ZodUnion<[z.ZodLiteral<"live">, z.ZodLiteral<"final">]>;
|
|
52
|
+
isClosed: z.ZodBoolean;
|
|
53
|
+
startedAt: z.ZodNumber;
|
|
54
|
+
finishedAt: z.ZodNumber;
|
|
55
|
+
ratingWindowClosedAt: z.ZodNumber;
|
|
56
|
+
round: z.ZodNumber;
|
|
57
|
+
gameId: z.ZodNumber;
|
|
58
|
+
homeTeam: z.ZodObject<{
|
|
59
|
+
id: z.ZodOptional<z.ZodString>;
|
|
60
|
+
teamId: z.ZodNumber;
|
|
61
|
+
score: z.ZodNumber;
|
|
62
|
+
isWinner: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
image: z.ZodString;
|
|
64
|
+
seed: z.ZodNumber;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
image: string;
|
|
67
|
+
teamId: number;
|
|
68
|
+
score: number;
|
|
69
|
+
seed: number;
|
|
70
|
+
id?: string | undefined;
|
|
71
|
+
isWinner?: boolean | undefined;
|
|
72
|
+
}, {
|
|
73
|
+
image: string;
|
|
74
|
+
teamId: number;
|
|
75
|
+
score: number;
|
|
76
|
+
seed: number;
|
|
77
|
+
id?: string | undefined;
|
|
78
|
+
isWinner?: boolean | undefined;
|
|
79
|
+
}>;
|
|
80
|
+
awayTeam: z.ZodObject<{
|
|
81
|
+
id: z.ZodOptional<z.ZodString>;
|
|
82
|
+
teamId: z.ZodNumber;
|
|
83
|
+
score: z.ZodNumber;
|
|
84
|
+
isWinner: z.ZodOptional<z.ZodBoolean>;
|
|
85
|
+
image: z.ZodString;
|
|
86
|
+
seed: z.ZodNumber;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
image: string;
|
|
89
|
+
teamId: number;
|
|
90
|
+
score: number;
|
|
91
|
+
seed: number;
|
|
92
|
+
id?: string | undefined;
|
|
93
|
+
isWinner?: boolean | undefined;
|
|
94
|
+
}, {
|
|
95
|
+
image: string;
|
|
96
|
+
teamId: number;
|
|
97
|
+
score: number;
|
|
98
|
+
seed: number;
|
|
99
|
+
id?: string | undefined;
|
|
100
|
+
isWinner?: boolean | undefined;
|
|
101
|
+
}>;
|
|
102
|
+
rating: z.ZodObject<{
|
|
103
|
+
avg: z.ZodNumber;
|
|
104
|
+
votes: z.ZodObject<{
|
|
105
|
+
options: z.ZodRecord<z.ZodNumber, z.ZodNumber>;
|
|
106
|
+
total: z.ZodNumber;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
total: number;
|
|
109
|
+
options: Record<number, number>;
|
|
110
|
+
}, {
|
|
111
|
+
total: number;
|
|
112
|
+
options: Record<number, number>;
|
|
113
|
+
}>;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
avg: number;
|
|
116
|
+
votes: {
|
|
117
|
+
total: number;
|
|
118
|
+
options: Record<number, number>;
|
|
119
|
+
};
|
|
120
|
+
}, {
|
|
121
|
+
avg: number;
|
|
122
|
+
votes: {
|
|
123
|
+
total: number;
|
|
124
|
+
options: Record<number, number>;
|
|
125
|
+
};
|
|
126
|
+
}>;
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
round: number;
|
|
129
|
+
status: "live" | "final";
|
|
130
|
+
gameId: number;
|
|
131
|
+
rating: {
|
|
132
|
+
avg: number;
|
|
133
|
+
votes: {
|
|
134
|
+
total: number;
|
|
135
|
+
options: Record<number, number>;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
isClosed: boolean;
|
|
139
|
+
startedAt: number;
|
|
140
|
+
finishedAt: number;
|
|
141
|
+
ratingWindowClosedAt: number;
|
|
142
|
+
homeTeam: {
|
|
143
|
+
image: string;
|
|
144
|
+
teamId: number;
|
|
145
|
+
score: number;
|
|
146
|
+
seed: number;
|
|
147
|
+
id?: string | undefined;
|
|
148
|
+
isWinner?: boolean | undefined;
|
|
149
|
+
};
|
|
150
|
+
awayTeam: {
|
|
151
|
+
image: string;
|
|
152
|
+
teamId: number;
|
|
153
|
+
score: number;
|
|
154
|
+
seed: number;
|
|
155
|
+
id?: string | undefined;
|
|
156
|
+
isWinner?: boolean | undefined;
|
|
157
|
+
};
|
|
158
|
+
id?: string | undefined;
|
|
159
|
+
}, {
|
|
160
|
+
round: number;
|
|
161
|
+
status: "live" | "final";
|
|
162
|
+
gameId: number;
|
|
163
|
+
rating: {
|
|
164
|
+
avg: number;
|
|
165
|
+
votes: {
|
|
166
|
+
total: number;
|
|
167
|
+
options: Record<number, number>;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
isClosed: boolean;
|
|
171
|
+
startedAt: number;
|
|
172
|
+
finishedAt: number;
|
|
173
|
+
ratingWindowClosedAt: number;
|
|
174
|
+
homeTeam: {
|
|
175
|
+
image: string;
|
|
176
|
+
teamId: number;
|
|
177
|
+
score: number;
|
|
178
|
+
seed: number;
|
|
179
|
+
id?: string | undefined;
|
|
180
|
+
isWinner?: boolean | undefined;
|
|
181
|
+
};
|
|
182
|
+
awayTeam: {
|
|
183
|
+
image: string;
|
|
184
|
+
teamId: number;
|
|
185
|
+
score: number;
|
|
186
|
+
seed: number;
|
|
187
|
+
id?: string | undefined;
|
|
188
|
+
isWinner?: boolean | undefined;
|
|
189
|
+
};
|
|
190
|
+
id?: string | undefined;
|
|
191
|
+
}>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gameSchema = exports.gameRatingAggregateSchema = exports.gameTeamSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.gameTeamSchema = zod_1.z.object({
|
|
6
|
+
id: zod_1.z.string().optional(),
|
|
7
|
+
teamId: zod_1.z.number(),
|
|
8
|
+
score: zod_1.z.number(),
|
|
9
|
+
isWinner: zod_1.z.boolean().optional(),
|
|
10
|
+
image: zod_1.z.string(),
|
|
11
|
+
seed: zod_1.z.number(),
|
|
12
|
+
});
|
|
13
|
+
exports.gameRatingAggregateSchema = zod_1.z.object({
|
|
14
|
+
avg: zod_1.z.number(),
|
|
15
|
+
votes: zod_1.z.object({
|
|
16
|
+
options: zod_1.z.record(zod_1.z.number(), zod_1.z.number()),
|
|
17
|
+
total: zod_1.z.number(),
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
exports.gameSchema = zod_1.z.object({
|
|
21
|
+
id: zod_1.z.string().optional(),
|
|
22
|
+
status: zod_1.z.union([zod_1.z.literal("live"), zod_1.z.literal("final")]),
|
|
23
|
+
isClosed: zod_1.z.boolean(),
|
|
24
|
+
startedAt: zod_1.z.number(),
|
|
25
|
+
finishedAt: zod_1.z.number(),
|
|
26
|
+
ratingWindowClosedAt: zod_1.z.number(),
|
|
27
|
+
round: zod_1.z.number(),
|
|
28
|
+
gameId: zod_1.z.number(),
|
|
29
|
+
homeTeam: exports.gameTeamSchema,
|
|
30
|
+
awayTeam: exports.gameTeamSchema,
|
|
31
|
+
rating: exports.gameRatingAggregateSchema,
|
|
32
|
+
});
|
package/dist/schemas/user.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare const userSchema: import("zod").ZodObject<{
|
|
|
5
5
|
avatarUrl: import("zod").ZodString;
|
|
6
6
|
createdAt: import("zod").ZodNumber;
|
|
7
7
|
updatedAt: import("zod").ZodNumber;
|
|
8
|
+
isRegistrationComplete: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
8
9
|
}, "strip", import("zod").ZodTypeAny, {
|
|
9
10
|
id: string;
|
|
10
11
|
email: string;
|
|
@@ -12,6 +13,7 @@ export declare const userSchema: import("zod").ZodObject<{
|
|
|
12
13
|
avatarUrl: string;
|
|
13
14
|
createdAt: number;
|
|
14
15
|
updatedAt: number;
|
|
16
|
+
isRegistrationComplete?: boolean | undefined;
|
|
15
17
|
}, {
|
|
16
18
|
id: string;
|
|
17
19
|
email: string;
|
|
@@ -19,4 +21,5 @@ export declare const userSchema: import("zod").ZodObject<{
|
|
|
19
21
|
avatarUrl: string;
|
|
20
22
|
createdAt: number;
|
|
21
23
|
updatedAt: number;
|
|
24
|
+
isRegistrationComplete?: boolean | undefined;
|
|
22
25
|
}>;
|
package/dist/schemas/user.js
CHANGED