rategame-shared 1.0.49 → 1.0.50

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.
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
- import { gameRatingAggregateSchema, gameSchema, gameTeamSchema } from "../schemas/game";
2
+ import { gameRatingAggregateSchema, gameSchema, gameTeamSchema, searchGameSchema } from "../schemas/game";
3
3
  export type Game = z.infer<typeof gameSchema>;
4
4
  export type GameRatingAggregate = z.infer<typeof gameRatingAggregateSchema>;
5
5
  export type GameTeam = z.infer<typeof gameTeamSchema>;
6
+ export type SearchGame = z.infer<typeof searchGameSchema>;
@@ -234,3 +234,28 @@ export declare const gameSchema: z.ZodObject<{
234
234
  userIds: string[];
235
235
  id?: string | undefined;
236
236
  }>;
237
+ export declare const searchGameSchema: z.ZodObject<{
238
+ q: z.ZodOptional<z.ZodString>;
239
+ teamId: z.ZodOptional<z.ZodString>;
240
+ round: z.ZodOptional<z.ZodString>;
241
+ createdAt: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"12h">, z.ZodLiteral<"daily">, z.ZodLiteral<"weekly">]>>;
242
+ sortBy: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"rating:asc">, z.ZodLiteral<"rating:desc">, z.ZodLiteral<"createdAt:asc">, z.ZodLiteral<"createdAt:desc">]>>;
243
+ limit: z.ZodOptional<z.ZodString>;
244
+ offset: z.ZodOptional<z.ZodString>;
245
+ }, "strip", z.ZodTypeAny, {
246
+ q?: string | undefined;
247
+ teamId?: string | undefined;
248
+ round?: string | undefined;
249
+ createdAt?: "12h" | "daily" | "weekly" | undefined;
250
+ sortBy?: "rating:asc" | "rating:desc" | "createdAt:asc" | "createdAt:desc" | undefined;
251
+ limit?: string | undefined;
252
+ offset?: string | undefined;
253
+ }, {
254
+ q?: string | undefined;
255
+ teamId?: string | undefined;
256
+ round?: string | undefined;
257
+ createdAt?: "12h" | "daily" | "weekly" | undefined;
258
+ sortBy?: "rating:asc" | "rating:desc" | "createdAt:asc" | "createdAt:desc" | undefined;
259
+ limit?: string | undefined;
260
+ offset?: string | undefined;
261
+ }>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.gameSchema = exports.gameRatingAggregateSchema = exports.gameTeamSchema = void 0;
3
+ exports.searchGameSchema = exports.gameSchema = exports.gameRatingAggregateSchema = exports.gameTeamSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.gameTeamSchema = zod_1.z.object({
6
6
  id: zod_1.z.string().optional(),
@@ -43,3 +43,21 @@ exports.gameSchema = zod_1.z.object({
43
43
  rating: exports.gameRatingAggregateSchema,
44
44
  userIds: zod_1.z.array(zod_1.z.string()),
45
45
  });
46
+ exports.searchGameSchema = zod_1.z.object({
47
+ q: zod_1.z.string().optional(),
48
+ teamId: zod_1.z.string().optional(),
49
+ round: zod_1.z.string().optional(),
50
+ createdAt: zod_1.z
51
+ .union([zod_1.z.literal("12h"), zod_1.z.literal("daily"), zod_1.z.literal("weekly")])
52
+ .optional(),
53
+ sortBy: zod_1.z
54
+ .union([
55
+ zod_1.z.literal("rating:asc"),
56
+ zod_1.z.literal("rating:desc"),
57
+ zod_1.z.literal("createdAt:asc"),
58
+ zod_1.z.literal("createdAt:desc"),
59
+ ])
60
+ .optional(),
61
+ limit: zod_1.z.string().optional(),
62
+ offset: zod_1.z.string().optional(),
63
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rategame-shared",
3
- "version": "1.0.49",
3
+ "version": "1.0.50",
4
4
  "description": "This package contains shared resources for the Rate Game project.",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",