rategame-shared 1.0.20 → 1.0.21

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 { createRatingSchema, ratingLikeSchema, ratingSchema } from "../schemas/rating";
2
+ import { createRatingSchema, ratingLikeSchema, ratingSchema, searchRatingSchema } from "../schemas/rating";
3
3
  export type Rating = z.infer<typeof ratingSchema>;
4
4
  export type RatingLike = z.infer<typeof ratingLikeSchema>;
5
5
  export type CreateRating = z.infer<typeof createRatingSchema>;
6
+ export type SearchRatingSchema = z.infer<typeof searchRatingSchema>;
@@ -172,6 +172,28 @@ export declare const ratingSchema: import("zod").ZodObject<{
172
172
  };
173
173
  comment?: string | undefined;
174
174
  }>;
175
+ export declare const searchRatingSchema: import("zod").ZodObject<{
176
+ q: import("zod").ZodOptional<import("zod").ZodString>;
177
+ team: import("zod").ZodOptional<import("zod").ZodString>;
178
+ round: import("zod").ZodOptional<import("zod").ZodNumber>;
179
+ sortBy: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodLiteral<"ranking">, import("zod").ZodLiteral<"date">]>>;
180
+ limit: import("zod").ZodOptional<import("zod").ZodNumber>;
181
+ offset: import("zod").ZodOptional<import("zod").ZodNumber>;
182
+ }, "strip", import("zod").ZodTypeAny, {
183
+ q?: string | undefined;
184
+ team?: string | undefined;
185
+ round?: number | undefined;
186
+ sortBy?: "date" | "ranking" | undefined;
187
+ limit?: number | undefined;
188
+ offset?: number | undefined;
189
+ }, {
190
+ q?: string | undefined;
191
+ team?: string | undefined;
192
+ round?: number | undefined;
193
+ sortBy?: "date" | "ranking" | undefined;
194
+ limit?: number | undefined;
195
+ offset?: number | undefined;
196
+ }>;
175
197
  export declare const ratingLikeSchema: import("zod").ZodObject<{
176
198
  id: import("zod").ZodString;
177
199
  likedAt: import("zod").ZodNumber;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createRatingSchema = exports.ratingLikeSchema = exports.ratingSchema = void 0;
3
+ exports.createRatingSchema = exports.ratingLikeSchema = exports.searchRatingSchema = exports.ratingSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const game_1 = require("./game");
6
6
  exports.ratingSchema = (0, zod_1.object)({
@@ -19,6 +19,14 @@ exports.ratingSchema = (0, zod_1.object)({
19
19
  awayTeam: game_1.gameTeamSchema,
20
20
  }),
21
21
  });
22
+ exports.searchRatingSchema = (0, zod_1.object)({
23
+ q: (0, zod_1.string)().optional(),
24
+ team: (0, zod_1.string)().optional(),
25
+ round: (0, zod_1.number)().optional(),
26
+ sortBy: (0, zod_1.union)([(0, zod_1.literal)("ranking"), (0, zod_1.literal)("date")]).optional(),
27
+ limit: (0, zod_1.number)().optional(),
28
+ offset: (0, zod_1.number)().optional(),
29
+ });
22
30
  exports.ratingLikeSchema = (0, zod_1.object)({
23
31
  id: (0, zod_1.string)(),
24
32
  likedAt: (0, zod_1.number)(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rategame-shared",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
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",