@gigapay-dev/contracts 1.8.6 → 2.0.0
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/README.md +1 -0
- package/build/client.d.ts +934 -0
- package/build/client.d.ts.map +1 -0
- package/build/client.js +184 -0
- package/build/client.js.map +1 -0
- package/build/commands/api-response.d.ts +1 -0
- package/build/commands/api-response.d.ts.map +1 -0
- package/build/commands/api-response.js +1 -0
- package/build/commands/api-response.js.map +1 -0
- package/build/commands/auth/confirm.d.ts +1 -0
- package/build/commands/auth/confirm.d.ts.map +1 -0
- package/build/commands/auth/confirm.js +1 -0
- package/build/commands/auth/confirm.js.map +1 -0
- package/build/commands/auth/endpoints.d.ts +1 -0
- package/build/commands/auth/endpoints.d.ts.map +1 -0
- package/build/commands/auth/endpoints.js +1 -0
- package/build/commands/auth/endpoints.js.map +1 -0
- package/build/commands/auth/index.d.ts +2 -0
- package/build/commands/auth/index.d.ts.map +1 -0
- package/build/commands/auth/index.js +2 -0
- package/build/commands/auth/index.js.map +1 -0
- package/build/commands/auth/login.d.ts +1 -0
- package/build/commands/auth/login.d.ts.map +1 -0
- package/build/commands/auth/login.js +1 -0
- package/build/commands/auth/login.js.map +1 -0
- package/build/commands/auth/profile.d.ts +1 -0
- package/build/commands/auth/profile.d.ts.map +1 -0
- package/build/commands/auth/profile.js +1 -0
- package/build/commands/auth/profile.js.map +1 -0
- package/build/commands/auth/register.d.ts +1 -0
- package/build/commands/auth/register.d.ts.map +1 -0
- package/build/commands/auth/register.js +1 -0
- package/build/commands/auth/register.js.map +1 -0
- package/build/commands/auth/reset.d.ts +1 -0
- package/build/commands/auth/reset.d.ts.map +1 -0
- package/build/commands/auth/reset.js +1 -0
- package/build/commands/auth/reset.js.map +1 -0
- package/build/commands/common.d.ts +65 -0
- package/build/commands/common.d.ts.map +1 -0
- package/build/commands/common.js +29 -0
- package/build/commands/common.js.map +1 -0
- package/build/commands/consts.d.ts +1 -0
- package/build/commands/consts.d.ts.map +1 -0
- package/build/commands/consts.js +1 -0
- package/build/commands/consts.js.map +1 -0
- package/build/commands/endpoints.d.ts +4643 -0
- package/build/commands/endpoints.d.ts.map +1 -0
- package/build/commands/endpoints.js +26 -0
- package/build/commands/endpoints.js.map +1 -0
- package/build/commands/index.d.ts +3 -0
- package/build/commands/index.d.ts.map +1 -0
- package/build/commands/index.js +3 -0
- package/build/commands/index.js.map +1 -0
- package/build/commands/orders/create.d.ts +5 -0
- package/build/commands/orders/create.d.ts.map +1 -0
- package/build/commands/orders/create.js +3 -0
- package/build/commands/orders/create.js.map +1 -0
- package/build/commands/orders/endpoints.d.ts +40 -24
- package/build/commands/orders/endpoints.d.ts.map +1 -0
- package/build/commands/orders/endpoints.js +1 -0
- package/build/commands/orders/endpoints.js.map +1 -0
- package/build/commands/orders/enums.d.ts +1 -0
- package/build/commands/orders/enums.d.ts.map +1 -0
- package/build/commands/orders/enums.js +1 -0
- package/build/commands/orders/enums.js.map +1 -0
- package/build/commands/orders/index.d.ts +1 -0
- package/build/commands/orders/index.d.ts.map +1 -0
- package/build/commands/orders/index.js +1 -0
- package/build/commands/orders/index.js.map +1 -0
- package/build/commands/orders/query.d.ts +7 -6
- package/build/commands/orders/query.d.ts.map +1 -0
- package/build/commands/orders/query.js +1 -0
- package/build/commands/orders/query.js.map +1 -0
- package/build/commands/orders/read.d.ts +8 -3
- package/build/commands/orders/read.d.ts.map +1 -0
- package/build/commands/orders/read.js +4 -1
- package/build/commands/orders/read.js.map +1 -0
- package/build/commands/orders/update.d.ts +1 -0
- package/build/commands/orders/update.d.ts.map +1 -0
- package/build/commands/orders/update.js +1 -0
- package/build/commands/orders/update.js.map +1 -0
- package/build/commands/pagination.d.ts +8 -7
- package/build/commands/pagination.d.ts.map +1 -0
- package/build/commands/pagination.js +5 -7
- package/build/commands/pagination.js.map +1 -0
- package/build/commands/payment-methods/create.d.ts +1 -0
- package/build/commands/payment-methods/create.d.ts.map +1 -0
- package/build/commands/payment-methods/create.js +1 -0
- package/build/commands/payment-methods/create.js.map +1 -0
- package/build/commands/payment-methods/endpoints.d.ts +1 -0
- package/build/commands/payment-methods/endpoints.d.ts.map +1 -0
- package/build/commands/payment-methods/endpoints.js +1 -0
- package/build/commands/payment-methods/endpoints.js.map +1 -0
- package/build/commands/payment-methods/index.d.ts +1 -0
- package/build/commands/payment-methods/index.d.ts.map +1 -0
- package/build/commands/payment-methods/index.js +1 -0
- package/build/commands/payment-methods/index.js.map +1 -0
- package/build/commands/payment-methods/read.d.ts +1 -0
- package/build/commands/payment-methods/read.d.ts.map +1 -0
- package/build/commands/payment-methods/read.js +1 -0
- package/build/commands/payment-methods/read.js.map +1 -0
- package/build/commands/payment-methods/update.d.ts +1 -0
- package/build/commands/payment-methods/update.d.ts.map +1 -0
- package/build/commands/payment-methods/update.js +1 -0
- package/build/commands/payment-methods/update.js.map +1 -0
- package/build/commands/products/create.d.ts +13 -0
- package/build/commands/products/create.d.ts.map +1 -0
- package/build/commands/products/create.js +7 -0
- package/build/commands/products/create.js.map +1 -0
- package/build/commands/products/endpoints.d.ts +99 -0
- package/build/commands/products/endpoints.d.ts.map +1 -0
- package/build/commands/products/endpoints.js +1 -0
- package/build/commands/products/endpoints.js.map +1 -0
- package/build/commands/products/enums.d.ts +1 -0
- package/build/commands/products/enums.d.ts.map +1 -0
- package/build/commands/products/enums.js +1 -0
- package/build/commands/products/enums.js.map +1 -0
- package/build/commands/products/index.d.ts +1 -0
- package/build/commands/products/index.d.ts.map +1 -0
- package/build/commands/products/index.js +1 -0
- package/build/commands/products/index.js.map +1 -0
- package/build/commands/products/query.d.ts +1 -0
- package/build/commands/products/query.d.ts.map +1 -0
- package/build/commands/products/query.js +1 -0
- package/build/commands/products/query.js.map +1 -0
- package/build/commands/products/read.d.ts +55 -0
- package/build/commands/products/read.d.ts.map +1 -0
- package/build/commands/products/read.js +11 -0
- package/build/commands/products/read.js.map +1 -0
- package/build/commands/products/update.d.ts +7 -0
- package/build/commands/products/update.d.ts.map +1 -0
- package/build/commands/products/update.js +1 -0
- package/build/commands/products/update.js.map +1 -0
- package/build/commands/promocode-activations/create.d.ts +1 -0
- package/build/commands/promocode-activations/create.d.ts.map +1 -0
- package/build/commands/promocode-activations/create.js +1 -0
- package/build/commands/promocode-activations/create.js.map +1 -0
- package/build/commands/promocode-activations/endpoints.d.ts +158 -0
- package/build/commands/promocode-activations/endpoints.d.ts.map +1 -0
- package/build/commands/promocode-activations/endpoints.js +39 -0
- package/build/commands/promocode-activations/endpoints.js.map +1 -0
- package/build/commands/promocode-activations/index.d.ts +2 -0
- package/build/commands/promocode-activations/index.d.ts.map +1 -0
- package/build/commands/promocode-activations/index.js +2 -0
- package/build/commands/promocode-activations/index.js.map +1 -0
- package/build/commands/promocode-activations/read.d.ts +1 -0
- package/build/commands/promocode-activations/read.d.ts.map +1 -0
- package/build/commands/promocode-activations/read.js +1 -0
- package/build/commands/promocode-activations/read.js.map +1 -0
- package/build/commands/promocode-activations/update.d.ts +1 -0
- package/build/commands/promocode-activations/update.d.ts.map +1 -0
- package/build/commands/promocode-activations/update.js +1 -0
- package/build/commands/promocode-activations/update.js.map +1 -0
- package/build/commands/promocodes/create.d.ts +1 -0
- package/build/commands/promocodes/create.d.ts.map +1 -0
- package/build/commands/promocodes/create.js +1 -0
- package/build/commands/promocodes/create.js.map +1 -0
- package/build/commands/promocodes/endpoints.d.ts +1 -0
- package/build/commands/promocodes/endpoints.d.ts.map +1 -0
- package/build/commands/promocodes/endpoints.js +1 -0
- package/build/commands/promocodes/endpoints.js.map +1 -0
- package/build/commands/promocodes/enums.d.ts +1 -0
- package/build/commands/promocodes/enums.d.ts.map +1 -0
- package/build/commands/promocodes/enums.js +1 -0
- package/build/commands/promocodes/enums.js.map +1 -0
- package/build/commands/promocodes/index.d.ts +1 -0
- package/build/commands/promocodes/index.d.ts.map +1 -0
- package/build/commands/promocodes/index.js +1 -0
- package/build/commands/promocodes/index.js.map +1 -0
- package/build/commands/promocodes/read.d.ts +1 -0
- package/build/commands/promocodes/read.d.ts.map +1 -0
- package/build/commands/promocodes/read.js +1 -0
- package/build/commands/promocodes/read.js.map +1 -0
- package/build/commands/promocodes/update.d.ts +1 -0
- package/build/commands/promocodes/update.d.ts.map +1 -0
- package/build/commands/promocodes/update.js +1 -0
- package/build/commands/promocodes/update.js.map +1 -0
- package/build/commands/refresh-sessions/create.d.ts +1 -0
- package/build/commands/refresh-sessions/create.d.ts.map +1 -0
- package/build/commands/refresh-sessions/create.js +1 -0
- package/build/commands/refresh-sessions/create.js.map +1 -0
- package/build/commands/refresh-sessions/endpoints.d.ts +216 -0
- package/build/commands/refresh-sessions/endpoints.d.ts.map +1 -0
- package/build/commands/refresh-sessions/endpoints.js +47 -0
- package/build/commands/refresh-sessions/endpoints.js.map +1 -0
- package/build/commands/refresh-sessions/enums.d.ts +1 -0
- package/build/commands/refresh-sessions/enums.d.ts.map +1 -0
- package/build/commands/refresh-sessions/enums.js +1 -0
- package/build/commands/refresh-sessions/enums.js.map +1 -0
- package/build/commands/refresh-sessions/index.d.ts +2 -0
- package/build/commands/refresh-sessions/index.d.ts.map +1 -0
- package/build/commands/refresh-sessions/index.js +2 -0
- package/build/commands/refresh-sessions/index.js.map +1 -0
- package/build/commands/refresh-sessions/read.d.ts +1 -0
- package/build/commands/refresh-sessions/read.d.ts.map +1 -0
- package/build/commands/refresh-sessions/read.js +1 -0
- package/build/commands/refresh-sessions/read.js.map +1 -0
- package/build/commands/refresh-sessions/update.d.ts +1 -0
- package/build/commands/refresh-sessions/update.d.ts.map +1 -0
- package/build/commands/refresh-sessions/update.js +1 -0
- package/build/commands/refresh-sessions/update.js.map +1 -0
- package/build/commands/settings/endpoints.d.ts +1 -0
- package/build/commands/settings/endpoints.d.ts.map +1 -0
- package/build/commands/settings/endpoints.js +1 -0
- package/build/commands/settings/endpoints.js.map +1 -0
- package/build/commands/settings/index.d.ts +1 -0
- package/build/commands/settings/index.d.ts.map +1 -0
- package/build/commands/settings/index.js +1 -0
- package/build/commands/settings/index.js.map +1 -0
- package/build/commands/settings/read.d.ts +1 -0
- package/build/commands/settings/read.d.ts.map +1 -0
- package/build/commands/settings/read.js +1 -0
- package/build/commands/settings/read.js.map +1 -0
- package/build/commands/settings/update.d.ts +1 -0
- package/build/commands/settings/update.d.ts.map +1 -0
- package/build/commands/settings/update.js +1 -0
- package/build/commands/settings/update.js.map +1 -0
- package/build/commands/stats/endpoints.d.ts +1 -0
- package/build/commands/stats/endpoints.d.ts.map +1 -0
- package/build/commands/stats/endpoints.js +1 -0
- package/build/commands/stats/endpoints.js.map +1 -0
- package/build/commands/stats/index.d.ts +1 -0
- package/build/commands/stats/index.d.ts.map +1 -0
- package/build/commands/stats/index.js +1 -0
- package/build/commands/stats/index.js.map +1 -0
- package/build/commands/stats/query.d.ts +1 -0
- package/build/commands/stats/query.d.ts.map +1 -0
- package/build/commands/stats/query.js +1 -0
- package/build/commands/stats/query.js.map +1 -0
- package/build/commands/stats/read.d.ts +1 -0
- package/build/commands/stats/read.d.ts.map +1 -0
- package/build/commands/stats/read.js +1 -0
- package/build/commands/stats/read.js.map +1 -0
- package/build/commands/users/create.d.ts +1 -0
- package/build/commands/users/create.d.ts.map +1 -0
- package/build/commands/users/create.js +1 -0
- package/build/commands/users/create.js.map +1 -0
- package/build/commands/users/endpoints.d.ts +7 -6
- package/build/commands/users/endpoints.d.ts.map +1 -0
- package/build/commands/users/endpoints.js +1 -0
- package/build/commands/users/endpoints.js.map +1 -0
- package/build/commands/users/enums.d.ts +1 -0
- package/build/commands/users/enums.d.ts.map +1 -0
- package/build/commands/users/enums.js +1 -0
- package/build/commands/users/enums.js.map +1 -0
- package/build/commands/users/index.d.ts +1 -0
- package/build/commands/users/index.d.ts.map +1 -0
- package/build/commands/users/index.js +1 -0
- package/build/commands/users/index.js.map +1 -0
- package/build/commands/users/query.d.ts +7 -6
- package/build/commands/users/query.d.ts.map +1 -0
- package/build/commands/users/query.js +1 -0
- package/build/commands/users/query.js.map +1 -0
- package/build/commands/users/read.d.ts +1 -0
- package/build/commands/users/read.d.ts.map +1 -0
- package/build/commands/users/read.js +1 -0
- package/build/commands/users/read.js.map +1 -0
- package/build/commands/users/update.d.ts +1 -0
- package/build/commands/users/update.d.ts.map +1 -0
- package/build/commands/users/update.js +1 -0
- package/build/commands/users/update.js.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +1 -0
- package/build/index.js.map +1 -0
- package/build/types.d.ts +1 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +1 -0
- package/build/types.js.map +1 -0
- package/package.json +48 -17
- package/commands/api-response.ts +0 -10
- package/commands/auth/confirm.ts +0 -10
- package/commands/auth/endpoints.ts +0 -51
- package/commands/auth/index.ts +0 -5
- package/commands/auth/login.ts +0 -13
- package/commands/auth/profile.ts +0 -10
- package/commands/auth/register.ts +0 -8
- package/commands/auth/reset.ts +0 -9
- package/commands/consts.ts +0 -1
- package/commands/index.ts +0 -13
- package/commands/orders/create.ts +0 -41
- package/commands/orders/endpoints.ts +0 -51
- package/commands/orders/enums.ts +0 -25
- package/commands/orders/index.ts +0 -6
- package/commands/orders/query.ts +0 -46
- package/commands/orders/read.ts +0 -83
- package/commands/orders/update.ts +0 -16
- package/commands/pagination.ts +0 -8
- package/commands/payment-methods/create.ts +0 -19
- package/commands/payment-methods/endpoints.ts +0 -67
- package/commands/payment-methods/index.ts +0 -4
- package/commands/payment-methods/read.ts +0 -30
- package/commands/payment-methods/update.ts +0 -19
- package/commands/products/create.ts +0 -134
- package/commands/products/endpoints.ts +0 -108
- package/commands/products/enums.ts +0 -33
- package/commands/products/index.ts +0 -6
- package/commands/products/query.ts +0 -52
- package/commands/products/read.ts +0 -268
- package/commands/products/update.ts +0 -11
- package/commands/promocode-activations/create.ts +0 -10
- package/commands/promocode-activations/index.ts +0 -3
- package/commands/promocode-activations/read.ts +0 -11
- package/commands/promocode-activations/update.ts +0 -10
- package/commands/promocodes/create.ts +0 -18
- package/commands/promocodes/endpoints.ts +0 -62
- package/commands/promocodes/enums.ts +0 -9
- package/commands/promocodes/index.ts +0 -5
- package/commands/promocodes/read.ts +0 -20
- package/commands/promocodes/update.ts +0 -16
- package/commands/refresh-sessions/create.ts +0 -13
- package/commands/refresh-sessions/enums.ts +0 -4
- package/commands/refresh-sessions/index.ts +0 -4
- package/commands/refresh-sessions/read.ts +0 -14
- package/commands/refresh-sessions/update.ts +0 -13
- package/commands/settings/endpoints.ts +0 -52
- package/commands/settings/index.ts +0 -3
- package/commands/settings/read.ts +0 -10
- package/commands/settings/update.ts +0 -10
- package/commands/stats/endpoints.ts +0 -23
- package/commands/stats/index.ts +0 -3
- package/commands/stats/query.ts +0 -18
- package/commands/stats/read.ts +0 -14
- package/commands/users/create.ts +0 -19
- package/commands/users/endpoints.ts +0 -47
- package/commands/users/enums.ts +0 -10
- package/commands/users/index.ts +0 -6
- package/commands/users/query.ts +0 -20
- package/commands/users/read.ts +0 -25
- package/commands/users/update.ts +0 -19
- package/index.ts +0 -1
- package/tsconfig.json +0 -111
- package/types.ts +0 -9
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
|
|
3
|
-
/** Фильтры каталога продуктов */
|
|
4
|
-
export const ProductFilterSchema = z.object({
|
|
5
|
-
/** Slug категории */
|
|
6
|
-
category: z.string().optional(),
|
|
7
|
-
/** Тип продукта (GAME_KEY, TOPUP, ...) */
|
|
8
|
-
type: z.string().optional(),
|
|
9
|
-
/** Slugs жанров через запятую */
|
|
10
|
-
genre: z.string().optional(),
|
|
11
|
-
/** Slugs тегов через запятую */
|
|
12
|
-
tag: z.string().optional(),
|
|
13
|
-
/** Код региона (RU, TR, KZ, GLOBAL) */
|
|
14
|
-
region: z.string().optional(),
|
|
15
|
-
/** Платформа (Steam, Epic Games, ...) */
|
|
16
|
-
platform: z.string().optional(),
|
|
17
|
-
/** Минимальная цена */
|
|
18
|
-
minPrice: z.coerce.number().optional(),
|
|
19
|
-
/** Максимальная цена */
|
|
20
|
-
maxPrice: z.coerce.number().optional(),
|
|
21
|
-
/** Фильтр: мультиплеер */
|
|
22
|
-
hasMultiplayer: z
|
|
23
|
-
.enum(["true", "false"])
|
|
24
|
-
.transform(v => v === "true")
|
|
25
|
-
.optional(),
|
|
26
|
-
/** Фильтр: кооператив */
|
|
27
|
-
hasCoop: z
|
|
28
|
-
.enum(["true", "false"])
|
|
29
|
-
.transform(v => v === "true")
|
|
30
|
-
.optional(),
|
|
31
|
-
/** Фильтр: издатель (частичное совпадение) */
|
|
32
|
-
publisher: z.string().optional(),
|
|
33
|
-
/** Минимальный рейтинг */
|
|
34
|
-
minRating: z.coerce.number().optional(),
|
|
35
|
-
/** Фильтр: наличие скидки */
|
|
36
|
-
hasDiscount: z
|
|
37
|
-
.enum(["true", "false"])
|
|
38
|
-
.transform(v => v === "true")
|
|
39
|
-
.optional(),
|
|
40
|
-
/** Поиск по названию */
|
|
41
|
-
search: z.string().optional(),
|
|
42
|
-
/** Поле сортировки */
|
|
43
|
-
sortBy: z.enum(["price", "popularity", "rating", "releaseDate", "title"]).default("popularity"),
|
|
44
|
-
/** Направление сортировки */
|
|
45
|
-
sortDir: z.enum(["asc", "desc"]).default("desc"),
|
|
46
|
-
/** Смещение для пагинации */
|
|
47
|
-
skip: z.coerce.number().default(0),
|
|
48
|
-
/** Количество записей */
|
|
49
|
-
take: z.coerce.number().default(20),
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
export type ProductFilter = z.infer<typeof ProductFilterSchema>;
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
import { ProductType, ProductStatus, DeliveryType, MediaType, SystemRequirementType } from "./enums";
|
|
3
|
-
|
|
4
|
-
// === Вложенные схемы ===
|
|
5
|
-
|
|
6
|
-
/** Категория (краткая) */
|
|
7
|
-
export const CategoryBriefSchema = z.object({
|
|
8
|
-
slug: z.string(),
|
|
9
|
-
name: z.string(),
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
/** Категория (полная, для списка категорий) */
|
|
13
|
-
export const CategoryResponseSchema = z.object({
|
|
14
|
-
id: z.number(),
|
|
15
|
-
slug: z.string(),
|
|
16
|
-
name: z.string(),
|
|
17
|
-
description: z.string().nullable(),
|
|
18
|
-
iconUrl: z.string().nullable(),
|
|
19
|
-
_count: z.object({
|
|
20
|
-
products: z.number(),
|
|
21
|
-
}),
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
/** Жанр (краткий, без ID) */
|
|
25
|
-
export const GenreBriefSchema = z.object({
|
|
26
|
-
slug: z.string(),
|
|
27
|
-
name: z.string(),
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
/** Жанр (полный, для списка жанров) */
|
|
31
|
-
export const GenreResponseSchema = z.object({
|
|
32
|
-
id: z.number(),
|
|
33
|
-
slug: z.string(),
|
|
34
|
-
name: z.string(),
|
|
35
|
-
_count: z.object({
|
|
36
|
-
products: z.number(),
|
|
37
|
-
}),
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
/** Тег */
|
|
41
|
-
export const TagBriefSchema = z.object({
|
|
42
|
-
id: z.number(),
|
|
43
|
-
slug: z.string(),
|
|
44
|
-
name: z.string(),
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
/** Регион (краткий, без ID) */
|
|
48
|
-
export const RegionBriefSchema = z.object({
|
|
49
|
-
code: z.string(),
|
|
50
|
-
name: z.string(),
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
/** Регион (полный, для списка регионов) */
|
|
54
|
-
export const RegionResponseSchema = z.object({
|
|
55
|
-
id: z.number(),
|
|
56
|
-
code: z.string(),
|
|
57
|
-
name: z.string(),
|
|
58
|
-
_count: z.object({
|
|
59
|
-
products: z.number(),
|
|
60
|
-
}),
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
/** Вариант в каталоге (краткий) */
|
|
64
|
-
export const VariantCatalogSchema = z.object({
|
|
65
|
-
id: z.number(),
|
|
66
|
-
name: z.string(),
|
|
67
|
-
price: z.string(),
|
|
68
|
-
originalPrice: z.string().nullable(),
|
|
69
|
-
platform: z.string().nullable(),
|
|
70
|
-
regionCode: z.string().nullable(),
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
/** Вариант в детальной карточке */
|
|
74
|
-
export const VariantDetailSchema = z.object({
|
|
75
|
-
id: z.number(),
|
|
76
|
-
name: z.string(),
|
|
77
|
-
sku: z.string(),
|
|
78
|
-
price: z.string(),
|
|
79
|
-
originalPrice: z.string().nullable(),
|
|
80
|
-
topupAmount: z.string().nullable(),
|
|
81
|
-
currency: z.string().nullable(),
|
|
82
|
-
durationDays: z.number().nullable(),
|
|
83
|
-
platform: z.string().nullable(),
|
|
84
|
-
regionCode: z.string().nullable(),
|
|
85
|
-
deliveryType: z.string(),
|
|
86
|
-
inStock: z.boolean(),
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
/** Медиа */
|
|
90
|
-
export const MediaResponseSchema = z.object({
|
|
91
|
-
id: z.number(),
|
|
92
|
-
type: z.string(),
|
|
93
|
-
url: z.string(),
|
|
94
|
-
alt: z.string().nullable(),
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
/** Системные требования */
|
|
98
|
-
export const SystemRequirementsResponseSchema = z.object({
|
|
99
|
-
type: z.string(),
|
|
100
|
-
os: z.string().nullable(),
|
|
101
|
-
processor: z.string().nullable(),
|
|
102
|
-
memory: z.string().nullable(),
|
|
103
|
-
graphics: z.string().nullable(),
|
|
104
|
-
storage: z.string().nullable(),
|
|
105
|
-
directx: z.string().nullable(),
|
|
106
|
-
network: z.string().nullable(),
|
|
107
|
-
additional: z.string().nullable(),
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
/** DLC в детальной карточке */
|
|
111
|
-
export const DlcBriefSchema = z.object({
|
|
112
|
-
id: z.number(),
|
|
113
|
-
slug: z.string(),
|
|
114
|
-
title: z.string(),
|
|
115
|
-
coverImageUrl: z.string().nullable(),
|
|
116
|
-
variants: z.array(z.object({
|
|
117
|
-
price: z.any(),
|
|
118
|
-
originalPrice: z.any(),
|
|
119
|
-
})),
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
// === Основные схемы ответов ===
|
|
123
|
-
|
|
124
|
-
/** Продукт в каталоге (карточка) */
|
|
125
|
-
export const ProductCatalogResponseSchema = z.object({
|
|
126
|
-
id: z.number(),
|
|
127
|
-
slug: z.string(),
|
|
128
|
-
title: z.string(),
|
|
129
|
-
type: z.string(),
|
|
130
|
-
shortDescription: z.string().nullable(),
|
|
131
|
-
coverImageUrl: z.string().nullable(),
|
|
132
|
-
steamRating: z.number().nullable(),
|
|
133
|
-
hasMultiplayer: z.boolean(),
|
|
134
|
-
hasCoop: z.boolean(),
|
|
135
|
-
salesCount: z.number(),
|
|
136
|
-
publisher: z.string().nullable(),
|
|
137
|
-
releaseDate: z.coerce.date().nullable(),
|
|
138
|
-
category: CategoryBriefSchema,
|
|
139
|
-
genres: z.array(GenreBriefSchema),
|
|
140
|
-
regions: z.array(RegionBriefSchema),
|
|
141
|
-
variants: z.array(VariantCatalogSchema),
|
|
142
|
-
minPrice: z.string().nullable(),
|
|
143
|
-
hasDiscount: z.boolean(),
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
/** Продукт (полная детальная карточка) */
|
|
147
|
-
export const ProductDetailResponseSchema = z.object({
|
|
148
|
-
id: z.number(),
|
|
149
|
-
slug: z.string(),
|
|
150
|
-
title: z.string(),
|
|
151
|
-
originalTitle: z.string().nullable(),
|
|
152
|
-
type: z.string(),
|
|
153
|
-
status: z.string(),
|
|
154
|
-
description: z.string().nullable(),
|
|
155
|
-
customDescription: z.string().nullable(),
|
|
156
|
-
shortDescription: z.string().nullable(),
|
|
157
|
-
coverImageUrl: z.string().nullable(),
|
|
158
|
-
developer: z.string().nullable(),
|
|
159
|
-
publisher: z.string().nullable(),
|
|
160
|
-
releaseDate: z.coerce.date().nullable(),
|
|
161
|
-
steamAppId: z.number().nullable(),
|
|
162
|
-
steamRating: z.number().nullable(),
|
|
163
|
-
hasMultiplayer: z.boolean(),
|
|
164
|
-
hasCoop: z.boolean(),
|
|
165
|
-
hasSinglePlayer: z.boolean(),
|
|
166
|
-
metaTitle: z.string().nullable(),
|
|
167
|
-
metaDescription: z.string().nullable(),
|
|
168
|
-
salesCount: z.number(),
|
|
169
|
-
viewsCount: z.number(),
|
|
170
|
-
category: CategoryBriefSchema.extend({ id: z.number() }),
|
|
171
|
-
variants: z.array(VariantDetailSchema),
|
|
172
|
-
media: z.array(MediaResponseSchema),
|
|
173
|
-
genres: z.array(TagBriefSchema),
|
|
174
|
-
tags: z.array(TagBriefSchema),
|
|
175
|
-
regions: z.array(RegionResponseSchema.omit({ _count: true })),
|
|
176
|
-
systemRequirements: z.array(SystemRequirementsResponseSchema),
|
|
177
|
-
dlcs: z.array(DlcBriefSchema),
|
|
178
|
-
createdAt: z.coerce.date(),
|
|
179
|
-
updatedAt: z.coerce.date(),
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
/** Статистика ключей по варианту */
|
|
183
|
-
export const KeysCountResponseSchema = z.object({
|
|
184
|
-
available: z.number(),
|
|
185
|
-
sold: z.number(),
|
|
186
|
-
reserved: z.number(),
|
|
187
|
-
total: z.number(),
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
// === Парсинг Steam ===
|
|
191
|
-
|
|
192
|
-
/** Спарсенные системные требования */
|
|
193
|
-
const ParsedSystemRequirementsSchema = z.object({
|
|
194
|
-
os: z.string().optional(),
|
|
195
|
-
processor: z.string().optional(),
|
|
196
|
-
memory: z.string().optional(),
|
|
197
|
-
graphics: z.string().optional(),
|
|
198
|
-
storage: z.string().optional(),
|
|
199
|
-
directx: z.string().optional(),
|
|
200
|
-
network: z.string().optional(),
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
/** Данные игры из Steam Store API */
|
|
204
|
-
const SteamParsedDataSchema = z.object({
|
|
205
|
-
title: z.string(),
|
|
206
|
-
originalTitle: z.string().optional(),
|
|
207
|
-
description: z.string(),
|
|
208
|
-
shortDescription: z.string(),
|
|
209
|
-
coverImageUrl: z.string(),
|
|
210
|
-
developer: z.string().optional(),
|
|
211
|
-
publisher: z.string().optional(),
|
|
212
|
-
releaseDate: z.string().optional(),
|
|
213
|
-
steamAppId: z.number(),
|
|
214
|
-
steamRating: z.number().optional(),
|
|
215
|
-
hasMultiplayer: z.boolean(),
|
|
216
|
-
hasCoop: z.boolean(),
|
|
217
|
-
hasSinglePlayer: z.boolean(),
|
|
218
|
-
genres: z.array(z.string()),
|
|
219
|
-
screenshots: z.array(z.string()),
|
|
220
|
-
systemRequirements: z.object({
|
|
221
|
-
minimum: ParsedSystemRequirementsSchema.optional(),
|
|
222
|
-
recommended: ParsedSystemRequirementsSchema.optional(),
|
|
223
|
-
}),
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
/** Региональная цена из Dessly */
|
|
227
|
-
const DesslyRegionPriceSchema = z.object({
|
|
228
|
-
region: z.string(),
|
|
229
|
-
price: z.string(),
|
|
230
|
-
priceOriginal: z.string(),
|
|
231
|
-
discount: z.string(),
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
/** Издание игры из Dessly */
|
|
235
|
-
const DesslyEditionSchema = z.object({
|
|
236
|
-
edition: z.string(),
|
|
237
|
-
packageId: z.number(),
|
|
238
|
-
regions: z.array(DesslyRegionPriceSchema),
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
/** Данные из Dessly API */
|
|
242
|
-
const DesslyParsedDataSchema = z.object({
|
|
243
|
-
editions: z.array(DesslyEditionSchema),
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
/** Ответ парсинга игры по Steam App ID */
|
|
247
|
-
export const SteamParseResponseSchema = z.object({
|
|
248
|
-
steam: SteamParsedDataSchema.nullable(),
|
|
249
|
-
dessly: DesslyParsedDataSchema.nullable(),
|
|
250
|
-
});
|
|
251
|
-
|
|
252
|
-
// === Type exports ===
|
|
253
|
-
|
|
254
|
-
export type CategoryBrief = z.infer<typeof CategoryBriefSchema>;
|
|
255
|
-
export type CategoryResponse = z.infer<typeof CategoryResponseSchema>;
|
|
256
|
-
export type GenreBrief = z.infer<typeof GenreBriefSchema>;
|
|
257
|
-
export type GenreResponse = z.infer<typeof GenreResponseSchema>;
|
|
258
|
-
export type TagBrief = z.infer<typeof TagBriefSchema>;
|
|
259
|
-
export type RegionBrief = z.infer<typeof RegionBriefSchema>;
|
|
260
|
-
export type RegionResponse = z.infer<typeof RegionResponseSchema>;
|
|
261
|
-
export type VariantCatalog = z.infer<typeof VariantCatalogSchema>;
|
|
262
|
-
export type VariantDetail = z.infer<typeof VariantDetailSchema>;
|
|
263
|
-
export type MediaResponse = z.infer<typeof MediaResponseSchema>;
|
|
264
|
-
export type SystemRequirementsResponse = z.infer<typeof SystemRequirementsResponseSchema>;
|
|
265
|
-
export type ProductCatalogResponse = z.infer<typeof ProductCatalogResponseSchema>;
|
|
266
|
-
export type ProductDetailResponse = z.infer<typeof ProductDetailResponseSchema>;
|
|
267
|
-
export type KeysCountResponse = z.infer<typeof KeysCountResponseSchema>;
|
|
268
|
-
export type SteamParseResponse = z.infer<typeof SteamParseResponseSchema>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { ProductCreateRequestSchema } from "./create";
|
|
3
|
-
import { ProductStatus } from "./enums";
|
|
4
|
-
|
|
5
|
-
/** Запрос на обновление продукта (частичное) */
|
|
6
|
-
export const ProductUpdateRequestSchema = ProductCreateRequestSchema.partial().extend({
|
|
7
|
-
/** Статус продукта */
|
|
8
|
-
status: ProductStatus.optional(),
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
export type ProductUpdateRequest = z.infer<typeof ProductUpdateRequestSchema>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const PromoCodeActivationCreateSchema = z.object({
|
|
4
|
-
promocodeId: z.coerce.number(),
|
|
5
|
-
refferalId: z.coerce.number(),
|
|
6
|
-
discountValue: z.coerce.number(),
|
|
7
|
-
activatedAt: z.coerce.date(),
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export type PromoCodeActivationCreate = z.infer<typeof PromoCodeActivationCreateSchema>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
|
|
3
|
-
export const PromoCodeActivationReadResponseSchema = z.object({
|
|
4
|
-
id: z.coerce.number().positive(),
|
|
5
|
-
promocodeId: z.coerce.number().positive(),
|
|
6
|
-
refferalId: z.coerce.number().positive(),
|
|
7
|
-
discountValue: z.string(),
|
|
8
|
-
activatedAt: z.coerce.date(),
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
export type PromoCodeActivationReadResponse = z.infer<typeof PromoCodeActivationReadResponseSchema>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const PromoCodeActivationUpdateSchema = z.object({
|
|
4
|
-
promocodeId: z.coerce.number().optional(),
|
|
5
|
-
refferalId: z.coerce.number().optional(),
|
|
6
|
-
discountValue: z.coerce.number().optional(),
|
|
7
|
-
activatedAt: z.coerce.date().nullable().optional(),
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export type PromoCodeActivationUpdate = z.infer<typeof PromoCodeActivationUpdateSchema>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { PromoCodeStatus, PromoCodeType } from "./enums";
|
|
3
|
-
|
|
4
|
-
export const PromoCodeCreateSchema = z.object({
|
|
5
|
-
value: z.string(),
|
|
6
|
-
discountValue: z.string(),
|
|
7
|
-
expiredAt: z.coerce.date().nullable().optional(),
|
|
8
|
-
startedAt: z.coerce.date().nullable().optional(),
|
|
9
|
-
createdAt: z.coerce.date().nullable().optional(),
|
|
10
|
-
deletedAt: z.coerce.date().nullable().optional(),
|
|
11
|
-
updatedAt: z.coerce.date().nullable().optional(),
|
|
12
|
-
activationLimit: z.coerce.number().positive().nullable().optional(),
|
|
13
|
-
activationPerUserLimit: z.coerce.number().positive().nullable().optional(),
|
|
14
|
-
type: PromoCodeType,
|
|
15
|
-
status: PromoCodeStatus,
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export type PromoCodeCreate = z.infer<typeof PromoCodeCreateSchema>;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { EndpointContract } from "../../types";
|
|
3
|
-
import {
|
|
4
|
-
PromoCodeCreateSchema,
|
|
5
|
-
} from "./create";
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
PromoCodeReadResponseSchema,
|
|
9
|
-
} from "./read";
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
PromoCodeUpdateSchema,
|
|
13
|
-
} from "./update";
|
|
14
|
-
|
|
15
|
-
export const PromoCodeEndpoints = {
|
|
16
|
-
create: {
|
|
17
|
-
method: "POST",
|
|
18
|
-
path: "/promo-codes",
|
|
19
|
-
request: PromoCodeCreateSchema,
|
|
20
|
-
response: PromoCodeReadResponseSchema,
|
|
21
|
-
},
|
|
22
|
-
list: {
|
|
23
|
-
method: "GET",
|
|
24
|
-
path: "/promo-codes",
|
|
25
|
-
request: z.object({}),
|
|
26
|
-
response: z.array(PromoCodeReadResponseSchema),
|
|
27
|
-
},
|
|
28
|
-
getById: {
|
|
29
|
-
method: "GET",
|
|
30
|
-
path: "/promo-codes/:id",
|
|
31
|
-
request: z.object({
|
|
32
|
-
id: z.coerce.number().positive(),
|
|
33
|
-
}),
|
|
34
|
-
response: PromoCodeReadResponseSchema,
|
|
35
|
-
},
|
|
36
|
-
getByValue: {
|
|
37
|
-
method: "GET",
|
|
38
|
-
path: "/promo-codes/value/:value",
|
|
39
|
-
request: z.object({
|
|
40
|
-
value: z.string(),
|
|
41
|
-
}),
|
|
42
|
-
response: PromoCodeReadResponseSchema,
|
|
43
|
-
},
|
|
44
|
-
update: {
|
|
45
|
-
method: "PATCH",
|
|
46
|
-
path: "/promo-codes/:id",
|
|
47
|
-
request: z.object({
|
|
48
|
-
id: z.coerce.number().positive(),
|
|
49
|
-
body: PromoCodeUpdateSchema,
|
|
50
|
-
}),
|
|
51
|
-
response: PromoCodeReadResponseSchema,
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
} satisfies Record<string, EndpointContract>;
|
|
55
|
-
|
|
56
|
-
export type PromoCodeEndpointKey = keyof typeof PromoCodeEndpoints;
|
|
57
|
-
|
|
58
|
-
export type GetPromoCodeRequest<K extends PromoCodeEndpointKey> =
|
|
59
|
-
z.infer<typeof PromoCodeEndpoints[K]["request"]>;
|
|
60
|
-
|
|
61
|
-
export type GetPromoCodeResponse<K extends PromoCodeEndpointKey> =
|
|
62
|
-
z.infer<typeof PromoCodeEndpoints[K]["response"]>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
|
|
3
|
-
export const PromoCodeType = z.enum(["USER", "AD", "SYSTEM"]);
|
|
4
|
-
export const PromoCodeStatus = z.enum(["ACTIVE", "INACTIVE", "LIMITED", "EXPIRED", "DELETED"]);
|
|
5
|
-
|
|
6
|
-
export type PromoCodeType = z.infer<typeof PromoCodeType>;
|
|
7
|
-
export type PromoCodeStatus = z.infer<typeof PromoCodeStatus>;
|
|
8
|
-
|
|
9
|
-
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
import { PromoCodeStatus, PromoCodeType } from "./enums";
|
|
3
|
-
|
|
4
|
-
export const PromoCodeReadResponseSchema = z.object({
|
|
5
|
-
id: z.coerce.number().positive(),
|
|
6
|
-
value: z.string(),
|
|
7
|
-
activated: z.coerce.number(),
|
|
8
|
-
discountValue: z.string(),
|
|
9
|
-
startedAt: z.coerce.date().nullable().optional(),
|
|
10
|
-
expiredAt: z.coerce.date().nullable().optional(),
|
|
11
|
-
createdAt: z.coerce.date().nullable().optional(),
|
|
12
|
-
deletedAt: z.coerce.date().nullable().optional(),
|
|
13
|
-
updatedAt: z.coerce.date().nullable().optional(),
|
|
14
|
-
activationLimit: z.coerce.number().positive().nullable().optional(),
|
|
15
|
-
activationPerUserLimit: z.coerce.number().positive().nullable().optional(),
|
|
16
|
-
type: PromoCodeType,
|
|
17
|
-
status: PromoCodeStatus,
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
export type PromoCodeReadResponse = z.infer<typeof PromoCodeReadResponseSchema>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { PromoCodeStatus, PromoCodeType } from "./enums";
|
|
3
|
-
|
|
4
|
-
export const PromoCodeUpdateSchema = z.object({
|
|
5
|
-
value: z.string().optional(),
|
|
6
|
-
discountValue: z.string().optional(),
|
|
7
|
-
startedAt: z.coerce.date().nullable().optional(),
|
|
8
|
-
expiredAt: z.coerce.date().nullable().optional(),
|
|
9
|
-
activationLimit: z.coerce.number().positive().nullable().optional(),
|
|
10
|
-
activationPerUserLimit: z.coerce.number().positive().nullable().optional(),
|
|
11
|
-
deletedAt: z.coerce.date().nullable().optional(),
|
|
12
|
-
type: PromoCodeType.optional(),
|
|
13
|
-
status: PromoCodeStatus.optional(),
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
export type PromoCodeUpdate = z.infer<typeof PromoCodeUpdateSchema>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { RefreshSessionStatus } from "./enums";
|
|
3
|
-
|
|
4
|
-
export const RefreshSessionCreateSchema = z.object({
|
|
5
|
-
userId: z.number(),
|
|
6
|
-
refreshToken: z.string(),
|
|
7
|
-
expiredAt: z.coerce.date().nullable().optional(),
|
|
8
|
-
status: RefreshSessionStatus,
|
|
9
|
-
IP: z.string().nullable().optional(),
|
|
10
|
-
UA: z.string().nullable().optional(),
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
export type RefreshSessionCreate = z.infer<typeof RefreshSessionCreateSchema>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
import { RefreshSessionStatus } from "./enums";
|
|
3
|
-
|
|
4
|
-
export const RefreshSessionReadResponseSchema = z.object({
|
|
5
|
-
id: z.number().positive(),
|
|
6
|
-
userId: z.number().positive(),
|
|
7
|
-
refreshToken: z.string(),
|
|
8
|
-
expiredAt: z.coerce.date().nullable().optional(),
|
|
9
|
-
status: RefreshSessionStatus,
|
|
10
|
-
createdAt: z.coerce.date().nullable().optional(),
|
|
11
|
-
updatedAt: z.coerce.date().nullable().optional(),
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export type RefreshSessionReadResponse = z.infer<typeof RefreshSessionReadResponseSchema>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
import { RefreshSessionStatus } from "./enums";
|
|
3
|
-
|
|
4
|
-
export const RefreshSessionUpdateSchema = z.object({
|
|
5
|
-
userId: z.number().optional(),
|
|
6
|
-
refreshToken: z.string().optional(),
|
|
7
|
-
expiredAt: z.coerce.date().nullable().optional(),
|
|
8
|
-
status: RefreshSessionStatus.optional(),
|
|
9
|
-
IP: z.string().nullable().optional(),
|
|
10
|
-
UA: z.string().nullable().optional(),
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
export type RefreshSessionUpdate = z.infer<typeof RefreshSessionUpdateSchema>;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { EndpointContract } from "../../types";
|
|
3
|
-
import { SettingsReadResponseSchema } from "./read";
|
|
4
|
-
import { SettingsUpdateRequestSchema } from "./update";
|
|
5
|
-
|
|
6
|
-
export const SettingsEndpoints = {
|
|
7
|
-
getAll: {
|
|
8
|
-
method: "GET",
|
|
9
|
-
path: "/settings",
|
|
10
|
-
request: z.object({}),
|
|
11
|
-
response: SettingsReadResponseSchema,
|
|
12
|
-
},
|
|
13
|
-
getOne: {
|
|
14
|
-
method: "GET",
|
|
15
|
-
path: "/settings/:key",
|
|
16
|
-
request: z.object({
|
|
17
|
-
key: z.string(),
|
|
18
|
-
}),
|
|
19
|
-
response: z.object({
|
|
20
|
-
key: z.string(),
|
|
21
|
-
value: z.union([z.string(), z.boolean()]),
|
|
22
|
-
}),
|
|
23
|
-
},
|
|
24
|
-
updateAll: {
|
|
25
|
-
method: "PUT",
|
|
26
|
-
path: "/settings",
|
|
27
|
-
request: SettingsUpdateRequestSchema,
|
|
28
|
-
response: SettingsReadResponseSchema,
|
|
29
|
-
},
|
|
30
|
-
updateOne: {
|
|
31
|
-
method: "PUT",
|
|
32
|
-
path: "/settings/:key",
|
|
33
|
-
request: z.object({
|
|
34
|
-
key: z.string(),
|
|
35
|
-
value: z.union([z.string(), z.boolean()]),
|
|
36
|
-
}),
|
|
37
|
-
response: z.object({
|
|
38
|
-
key: z.string(),
|
|
39
|
-
value: z.union([z.string(), z.boolean()]),
|
|
40
|
-
}),
|
|
41
|
-
},
|
|
42
|
-
} satisfies Record<string, EndpointContract>;
|
|
43
|
-
|
|
44
|
-
export type SettingsEndpointKey = keyof typeof SettingsEndpoints;
|
|
45
|
-
|
|
46
|
-
export type GetSettingsRequest<K extends SettingsEndpointKey> = z.infer<
|
|
47
|
-
typeof SettingsEndpoints[K]["request"]
|
|
48
|
-
>;
|
|
49
|
-
|
|
50
|
-
export type GetSettingsResponse<K extends SettingsEndpointKey> = z.infer<
|
|
51
|
-
typeof SettingsEndpoints[K]["response"]
|
|
52
|
-
>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const SettingsReadResponseSchema = z.object({
|
|
4
|
-
desslyDiscount: z.string(),
|
|
5
|
-
serviceEnabled: z.boolean(),
|
|
6
|
-
worksEnabled: z.boolean(),
|
|
7
|
-
paymentsEnabled: z.boolean(),
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export type SettingsReadResponse = z.infer<typeof SettingsReadResponseSchema>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const SettingsUpdateRequestSchema = z.object({
|
|
4
|
-
desslyDiscount: z.string().optional(),
|
|
5
|
-
serviceEnabled: z.boolean().optional(),
|
|
6
|
-
worksEnabled: z.boolean().optional(),
|
|
7
|
-
paymentsEnabled: z.boolean().optional(),
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export type SettingsUpdateRequest = z.infer<typeof SettingsUpdateRequestSchema>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { EndpointContract } from "../../types";
|
|
3
|
-
import { StatsReadResponseSchema } from "./read";
|
|
4
|
-
import { StatsReadRequestSchema } from "./query";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export const StatsEndpoints = {
|
|
9
|
-
list: {
|
|
10
|
-
method: "GET",
|
|
11
|
-
path: "/stats",
|
|
12
|
-
request: StatsReadRequestSchema,
|
|
13
|
-
response: StatsReadResponseSchema,
|
|
14
|
-
},
|
|
15
|
-
} satisfies Record<string, EndpointContract>;
|
|
16
|
-
|
|
17
|
-
export type StatsEndpointKey = keyof typeof StatsEndpoints;
|
|
18
|
-
|
|
19
|
-
export type GetStatsRequest<K extends StatsEndpointKey> =
|
|
20
|
-
z.infer<typeof StatsEndpoints[K]["request"]>;
|
|
21
|
-
|
|
22
|
-
export type GetStatsResponse<K extends StatsEndpointKey> =
|
|
23
|
-
z.infer<typeof StatsEndpoints[K]["response"]>;
|
package/commands/stats/index.ts
DELETED