@arken/seer-protocol 0.1.3 → 0.1.5
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/.rush/temp/shrinkwrap-deps.json +5 -229
- package/build/area/area.models.d.ts +6 -0
- package/build/area/area.models.js +11 -0
- package/build/area/area.models.js.map +1 -0
- package/build/area/area.router.d.ts +274 -0
- package/build/area/area.router.js +59 -0
- package/build/area/area.router.js.map +1 -0
- package/build/area/area.schema.d.ts +241 -0
- package/build/area/area.schema.js +13 -0
- package/build/area/area.schema.js.map +1 -0
- package/build/area/area.types.d.ts +19 -0
- package/build/area/area.types.js +2 -0
- package/build/area/area.types.js.map +1 -0
- package/build/area/index.d.ts +4 -0
- package/build/area/index.js +5 -0
- package/build/area/index.js.map +1 -0
- package/build/asset/asset.models.d.ts +5 -0
- package/build/asset/asset.models.js +44 -0
- package/build/asset/asset.models.js.map +1 -0
- package/build/asset/asset.router.d.ts +189 -0
- package/build/asset/asset.router.js +41 -0
- package/build/asset/asset.router.js.map +1 -0
- package/build/asset/asset.schema.d.ts +204 -0
- package/build/asset/asset.schema.js +22 -0
- package/build/asset/asset.schema.js.map +1 -0
- package/build/asset/asset.types.d.ts +16 -0
- package/build/asset/asset.types.js +2 -0
- package/build/asset/asset.types.js.map +1 -0
- package/build/asset/index.d.ts +4 -0
- package/build/asset/index.js +5 -0
- package/build/asset/index.js.map +1 -0
- package/build/chain/chain.models.d.ts +6 -0
- package/build/chain/chain.models.js +42 -0
- package/build/chain/chain.models.js.map +1 -0
- package/build/chain/chain.router.d.ts +364 -0
- package/build/chain/chain.router.js +84 -0
- package/build/chain/chain.router.js.map +1 -0
- package/build/chain/chain.schema.d.ts +317 -0
- package/build/chain/chain.schema.js +56 -0
- package/build/chain/chain.schema.js.map +1 -0
- package/build/chain/chain.types.d.ts +19 -0
- package/build/chain/chain.types.js +2 -0
- package/build/chain/chain.types.js.map +1 -0
- package/build/chain/index.d.ts +4 -0
- package/build/chain/index.js +5 -0
- package/build/chain/index.js.map +1 -0
- package/build/character/character.models.d.ts +14 -0
- package/build/character/character.models.js +123 -0
- package/build/character/character.models.js.map +1 -0
- package/build/character/character.router.d.ts +945 -0
- package/build/character/character.router.js +246 -0
- package/build/character/character.router.js.map +1 -0
- package/build/character/character.schema.d.ts +1223 -0
- package/build/character/character.schema.js +70 -0
- package/build/character/character.schema.js.map +1 -0
- package/build/character/character.types.d.ts +47 -0
- package/build/character/character.types.js +2 -0
- package/build/character/character.types.js.map +1 -0
- package/build/character/index.d.ts +4 -0
- package/build/character/index.js +5 -0
- package/build/character/index.js.map +1 -0
- package/build/chat/chat.models.d.ts +4 -0
- package/build/chat/chat.models.js +35 -0
- package/build/chat/chat.models.js.map +1 -0
- package/build/chat/chat.router.d.ts +223 -0
- package/build/chat/chat.router.js +51 -0
- package/build/chat/chat.router.js.map +1 -0
- package/build/chat/chat.schema.d.ts +179 -0
- package/build/chat/chat.schema.js +32 -0
- package/build/chat/chat.schema.js.map +1 -0
- package/build/chat/chat.types.d.ts +13 -0
- package/build/chat/chat.types.js +2 -0
- package/build/chat/chat.types.js.map +1 -0
- package/build/chat/index.d.ts +4 -0
- package/build/chat/index.js +5 -0
- package/build/chat/index.js.map +1 -0
- package/build/collection/collection.models.d.ts +9 -0
- package/build/collection/collection.models.js +69 -0
- package/build/collection/collection.models.js.map +1 -0
- package/build/collection/collection.router.d.ts +361 -0
- package/build/collection/collection.router.js +71 -0
- package/build/collection/collection.router.js.map +1 -0
- package/build/collection/collection.schema.d.ts +660 -0
- package/build/collection/collection.schema.js +70 -0
- package/build/collection/collection.schema.js.map +1 -0
- package/build/collection/collection.types.d.ts +28 -0
- package/build/collection/collection.types.js +2 -0
- package/build/collection/collection.types.js.map +1 -0
- package/build/collection/index.d.ts +4 -0
- package/build/collection/index.js +5 -0
- package/build/collection/index.js.map +1 -0
- package/build/core/core.models.d.ts +123 -0
- package/build/core/core.models.js +811 -0
- package/build/core/core.models.js.map +1 -0
- package/build/core/core.router.d.ts +5297 -0
- package/build/core/core.router.js +1372 -0
- package/build/core/core.router.js.map +1 -0
- package/build/core/core.schema.d.ts +5808 -0
- package/build/core/core.schema.js +612 -0
- package/build/core/core.schema.js.map +1 -0
- package/build/core/core.types.d.ts +250 -0
- package/build/core/core.types.js +2 -0
- package/build/core/core.types.js.map +1 -0
- package/build/core/index.d.ts +4 -0
- package/build/core/index.js +5 -0
- package/build/core/index.js.map +1 -0
- package/build/evolution/evolution.models.d.ts +1 -0
- package/build/evolution/evolution.models.js +3 -0
- package/build/evolution/evolution.models.js.map +1 -0
- package/build/evolution/evolution.router.d.ts +244 -0
- package/build/evolution/evolution.router.js +112 -0
- package/build/evolution/evolution.router.js.map +1 -0
- package/build/evolution/evolution.schema.d.ts +1 -0
- package/build/evolution/evolution.schema.js +2 -0
- package/build/evolution/evolution.schema.js.map +1 -0
- package/build/evolution/evolution.types.d.ts +3 -0
- package/build/evolution/evolution.types.js +2 -0
- package/build/evolution/evolution.types.js.map +1 -0
- package/build/evolution/index.d.ts +4 -0
- package/build/evolution/index.js +4 -0
- package/build/evolution/index.js.map +1 -0
- package/build/game/game.models.d.ts +6 -0
- package/build/game/game.models.js +29 -0
- package/build/game/game.models.js.map +1 -0
- package/build/game/game.router.d.ts +428 -0
- package/build/game/game.router.js +90 -0
- package/build/game/game.router.js.map +1 -0
- package/build/game/game.schema.d.ts +339 -0
- package/build/game/game.schema.js +14 -0
- package/build/game/game.schema.js.map +1 -0
- package/build/game/game.types.d.ts +19 -0
- package/build/game/game.types.js +2 -0
- package/build/game/game.types.js.map +1 -0
- package/build/game/index.d.ts +4 -0
- package/build/game/index.js +4 -0
- package/build/game/index.js.map +1 -0
- package/build/index.d.ts +30 -0
- package/build/index.js +26 -0
- package/build/index.js.map +1 -0
- package/build/infinite/index.d.ts +4 -0
- package/build/infinite/index.js +4 -0
- package/build/infinite/index.js.map +1 -0
- package/build/infinite/infinite.models.d.ts +1 -0
- package/build/infinite/infinite.models.js +3 -0
- package/build/infinite/infinite.models.js.map +1 -0
- package/build/infinite/infinite.router.d.ts +95 -0
- package/build/infinite/infinite.router.js +40 -0
- package/build/infinite/infinite.router.js.map +1 -0
- package/build/infinite/infinite.schema.d.ts +1 -0
- package/build/infinite/infinite.schema.js +2 -0
- package/build/infinite/infinite.schema.js.map +1 -0
- package/build/infinite/infinite.types.d.ts +3 -0
- package/build/infinite/infinite.types.js +2 -0
- package/build/infinite/infinite.types.js.map +1 -0
- package/build/interface/index.d.ts +4 -0
- package/build/interface/index.js +5 -0
- package/build/interface/index.js.map +1 -0
- package/build/interface/interface.canonicalize.d.ts +2 -0
- package/build/interface/interface.canonicalize.js +241 -0
- package/build/interface/interface.canonicalize.js.map +1 -0
- package/build/interface/interface.models.d.ts +6 -0
- package/build/interface/interface.models.js +30 -0
- package/build/interface/interface.models.js.map +1 -0
- package/build/interface/interface.router.d.ts +472 -0
- package/build/interface/interface.router.js +113 -0
- package/build/interface/interface.router.js.map +1 -0
- package/build/interface/interface.schema.d.ts +305 -0
- package/build/interface/interface.schema.js +36 -0
- package/build/interface/interface.schema.js.map +1 -0
- package/build/interface/interface.types.d.ts +18 -0
- package/build/interface/interface.types.js +2 -0
- package/build/interface/interface.types.js.map +1 -0
- package/build/isles/index.d.ts +4 -0
- package/build/isles/index.js +4 -0
- package/build/isles/index.js.map +1 -0
- package/build/isles/isles.models.d.ts +1 -0
- package/build/isles/isles.models.js +3 -0
- package/build/isles/isles.models.js.map +1 -0
- package/build/isles/isles.router.d.ts +95 -0
- package/build/isles/isles.router.js +40 -0
- package/build/isles/isles.router.js.map +1 -0
- package/build/isles/isles.schema.d.ts +1 -0
- package/build/isles/isles.schema.js +2 -0
- package/build/isles/isles.schema.js.map +1 -0
- package/build/isles/isles.types.d.ts +3 -0
- package/build/isles/isles.types.js +2 -0
- package/build/isles/isles.types.js.map +1 -0
- package/build/item/index.d.ts +4 -0
- package/build/item/index.js +5 -0
- package/build/item/index.js.map +1 -0
- package/build/item/item.models.d.ts +16 -0
- package/build/item/item.models.js +101 -0
- package/build/item/item.models.js.map +1 -0
- package/build/item/item.router.d.ts +263 -0
- package/build/item/item.router.js +70 -0
- package/build/item/item.router.js.map +1 -0
- package/build/item/item.schema.d.ts +765 -0
- package/build/item/item.schema.js +86 -0
- package/build/item/item.schema.js.map +1 -0
- package/build/item/item.types.d.ts +54 -0
- package/build/item/item.types.js +2 -0
- package/build/item/item.types.js.map +1 -0
- package/build/job/index.d.ts +4 -0
- package/build/job/index.js +5 -0
- package/build/job/index.js.map +1 -0
- package/build/job/job.models.d.ts +3 -0
- package/build/job/job.models.js +9 -0
- package/build/job/job.models.js.map +1 -0
- package/build/job/job.router.d.ts +146 -0
- package/build/job/job.router.js +32 -0
- package/build/job/job.router.js.map +1 -0
- package/build/job/job.schema.d.ts +66 -0
- package/build/job/job.schema.js +7 -0
- package/build/job/job.schema.js.map +1 -0
- package/build/job/job.types.d.ts +15 -0
- package/build/job/job.types.js +2 -0
- package/build/job/job.types.js.map +1 -0
- package/build/market/index.d.ts +4 -0
- package/build/market/index.js +5 -0
- package/build/market/index.js.map +1 -0
- package/build/market/market.models.d.ts +14 -0
- package/build/market/market.models.js +98 -0
- package/build/market/market.models.js.map +1 -0
- package/build/market/market.router.d.ts +230 -0
- package/build/market/market.router.js +56 -0
- package/build/market/market.router.js.map +1 -0
- package/build/market/market.schema.d.ts +937 -0
- package/build/market/market.schema.js +110 -0
- package/build/market/market.schema.js.map +1 -0
- package/build/market/market.types.d.ts +48 -0
- package/build/market/market.types.js +2 -0
- package/build/market/market.types.js.map +1 -0
- package/build/oasis/index.d.ts +4 -0
- package/build/oasis/index.js +4 -0
- package/build/oasis/index.js.map +1 -0
- package/build/oasis/oasis.models.d.ts +1 -0
- package/build/oasis/oasis.models.js +3 -0
- package/build/oasis/oasis.models.js.map +1 -0
- package/build/oasis/oasis.router.d.ts +91 -0
- package/build/oasis/oasis.router.js +52 -0
- package/build/oasis/oasis.router.js.map +1 -0
- package/build/oasis/oasis.schema.d.ts +1 -0
- package/build/oasis/oasis.schema.js +2 -0
- package/build/oasis/oasis.schema.js.map +1 -0
- package/build/oasis/oasis.types.d.ts +3 -0
- package/build/oasis/oasis.types.js +2 -0
- package/build/oasis/oasis.types.js.map +1 -0
- package/build/package.json +29 -0
- package/build/product/index.d.ts +4 -0
- package/build/product/index.js +5 -0
- package/build/product/index.js.map +1 -0
- package/build/product/product.models.d.ts +4 -0
- package/build/product/product.models.js +113 -0
- package/build/product/product.models.js.map +1 -0
- package/build/product/product.router.d.ts +447 -0
- package/build/product/product.router.js +71 -0
- package/build/product/product.router.js.map +1 -0
- package/build/product/product.schema.d.ts +640 -0
- package/build/product/product.schema.js +154 -0
- package/build/product/product.schema.js.map +1 -0
- package/build/product/product.types.d.ts +27 -0
- package/build/product/product.types.js +2 -0
- package/build/product/product.types.js.map +1 -0
- package/build/profile/index.d.ts +4 -0
- package/build/profile/index.js +5 -0
- package/build/profile/index.js.map +1 -0
- package/build/profile/profile.models.d.ts +2 -0
- package/build/profile/profile.models.js +165 -0
- package/build/profile/profile.models.js.map +1 -0
- package/build/profile/profile.router.d.ts +163 -0
- package/build/profile/profile.router.js +54 -0
- package/build/profile/profile.router.js.map +1 -0
- package/build/profile/profile.schema.d.ts +1 -0
- package/build/profile/profile.schema.js +201 -0
- package/build/profile/profile.schema.js.map +1 -0
- package/build/profile/profile.types.d.ts +15 -0
- package/build/profile/profile.types.js +2 -0
- package/build/profile/profile.types.js.map +1 -0
- package/build/raffle/index.d.ts +4 -0
- package/build/raffle/index.js +5 -0
- package/build/raffle/index.js.map +1 -0
- package/build/raffle/raffle.models.d.ts +6 -0
- package/build/raffle/raffle.models.js +36 -0
- package/build/raffle/raffle.models.js.map +1 -0
- package/build/raffle/raffle.router.d.ts +299 -0
- package/build/raffle/raffle.router.js +71 -0
- package/build/raffle/raffle.router.js.map +1 -0
- package/build/raffle/raffle.schema.d.ts +261 -0
- package/build/raffle/raffle.schema.js +21 -0
- package/build/raffle/raffle.schema.js.map +1 -0
- package/build/raffle/raffle.types.d.ts +24 -0
- package/build/raffle/raffle.types.js +2 -0
- package/build/raffle/raffle.types.js.map +1 -0
- package/build/router.d.ts +10755 -0
- package/build/router.js +87 -0
- package/build/router.js.map +1 -0
- package/build/schema.d.ts +279 -0
- package/build/schema.js +157 -0
- package/build/schema.js.map +1 -0
- package/build/skill/index.d.ts +4 -0
- package/build/skill/index.js +5 -0
- package/build/skill/index.js.map +1 -0
- package/build/skill/skill.models.d.ts +9 -0
- package/build/skill/skill.models.js +9 -0
- package/build/skill/skill.models.js.map +1 -0
- package/build/skill/skill.router.d.ts +659 -0
- package/build/skill/skill.router.js +152 -0
- package/build/skill/skill.router.js.map +1 -0
- package/build/skill/skill.schema.d.ts +536 -0
- package/build/skill/skill.schema.js +38 -0
- package/build/skill/skill.schema.js.map +1 -0
- package/build/skill/skill.types.d.ts +28 -0
- package/build/skill/skill.types.js +2 -0
- package/build/skill/skill.types.js.map +1 -0
- package/build/trek/index.d.ts +4 -0
- package/build/trek/index.js +4 -0
- package/build/trek/index.js.map +1 -0
- package/build/trek/trek.models.d.ts +1 -0
- package/build/trek/trek.models.js +2 -0
- package/build/trek/trek.models.js.map +1 -0
- package/build/trek/trek.router.d.ts +86 -0
- package/build/trek/trek.router.js +43 -0
- package/build/trek/trek.router.js.map +1 -0
- package/build/trek/trek.schema.d.ts +1 -0
- package/build/trek/trek.schema.js +2 -0
- package/build/trek/trek.schema.js.map +1 -0
- package/build/trek/trek.types.d.ts +1 -0
- package/build/trek/trek.types.js +2 -0
- package/build/trek/trek.types.js.map +1 -0
- package/build/types.d.ts +187 -0
- package/build/types.js +29 -0
- package/build/types.js.map +1 -0
- package/build/video/index.d.ts +4 -0
- package/build/video/index.js +5 -0
- package/build/video/index.js.map +1 -0
- package/build/video/video.models.d.ts +7 -0
- package/build/video/video.models.js +19 -0
- package/build/video/video.models.js.map +1 -0
- package/build/video/video.router.d.ts +563 -0
- package/build/video/video.router.js +112 -0
- package/build/video/video.router.js.map +1 -0
- package/build/video/video.schema.d.ts +446 -0
- package/build/video/video.schema.js +31 -0
- package/build/video/video.schema.js.map +1 -0
- package/build/video/video.types.d.ts +27 -0
- package/build/video/video.types.js +2 -0
- package/build/video/video.types.js.map +1 -0
- package/package.json +11 -4
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { z, ObjectId, Entity } from '../schema';
|
|
2
|
+
const ProductMeta = z.object({
|
|
3
|
+
name: z.string(),
|
|
4
|
+
members: z.array(ObjectId),
|
|
5
|
+
isProposal: z.boolean(),
|
|
6
|
+
price: z.number().nonnegative(),
|
|
7
|
+
oldPrice: z
|
|
8
|
+
.number()
|
|
9
|
+
.nonnegative()
|
|
10
|
+
.optional(),
|
|
11
|
+
images: z.record(z.string(), z.any()),
|
|
12
|
+
video: z.string().url(),
|
|
13
|
+
genre: z.string(),
|
|
14
|
+
releaseDate: z.string(),
|
|
15
|
+
developer: z.string(),
|
|
16
|
+
publisher: z.string(),
|
|
17
|
+
developerTags: z.array(z.string()),
|
|
18
|
+
languageSupport: z.array(z.any()),
|
|
19
|
+
systemRequirements: z.array(z.any()),
|
|
20
|
+
tags: z.array(ObjectId),
|
|
21
|
+
type: z.string(),
|
|
22
|
+
downloads: z
|
|
23
|
+
.number()
|
|
24
|
+
.int()
|
|
25
|
+
.nonnegative(),
|
|
26
|
+
plans: z.array(z.any()),
|
|
27
|
+
frequentlyTradedAssets: z.array(ObjectId),
|
|
28
|
+
saleBox: z.record(z.string(), z.any()),
|
|
29
|
+
assets: z.array(ObjectId),
|
|
30
|
+
community: z.record(z.string(), z.any()),
|
|
31
|
+
nameUrl: z.string(),
|
|
32
|
+
steamId: z.number().int(),
|
|
33
|
+
author: z.string(),
|
|
34
|
+
});
|
|
35
|
+
export const Product = Entity.merge(z.object({
|
|
36
|
+
shortDescription: z
|
|
37
|
+
.string()
|
|
38
|
+
.max(300)
|
|
39
|
+
.min(1),
|
|
40
|
+
content: z.string().min(1),
|
|
41
|
+
communityId: ObjectId,
|
|
42
|
+
type: z
|
|
43
|
+
.string()
|
|
44
|
+
.max(100)
|
|
45
|
+
.default('game'),
|
|
46
|
+
releaseDate: z.date().optional(),
|
|
47
|
+
sku: z.string().min(1),
|
|
48
|
+
categoryId: ObjectId.optional(),
|
|
49
|
+
price: z.number().nonnegative(),
|
|
50
|
+
discountPrice: z
|
|
51
|
+
.number()
|
|
52
|
+
.nonnegative()
|
|
53
|
+
.optional(),
|
|
54
|
+
currency: z.string().length(3),
|
|
55
|
+
images: z.array(z.string().url()).optional(),
|
|
56
|
+
videos: z.array(z.string().url()).optional(),
|
|
57
|
+
digitalContent: z
|
|
58
|
+
.array(z.object({
|
|
59
|
+
url: z.string().url(),
|
|
60
|
+
size: z.number().nonnegative(),
|
|
61
|
+
drm: z.enum(['None', 'Steam', 'Epic', 'Uplay', 'Origin']).optional(),
|
|
62
|
+
}))
|
|
63
|
+
.optional(),
|
|
64
|
+
dlcs: z.array(ObjectId).optional(),
|
|
65
|
+
bundles: z.array(ObjectId).optional(),
|
|
66
|
+
achievements: z
|
|
67
|
+
.array(z.object({
|
|
68
|
+
name: z.string(),
|
|
69
|
+
description: z.string().optional(),
|
|
70
|
+
icon: z
|
|
71
|
+
.string()
|
|
72
|
+
.url()
|
|
73
|
+
.optional(),
|
|
74
|
+
}))
|
|
75
|
+
.optional(),
|
|
76
|
+
reviews: z
|
|
77
|
+
.array(z.object({
|
|
78
|
+
userId: ObjectId,
|
|
79
|
+
rating: z
|
|
80
|
+
.number()
|
|
81
|
+
.min(1)
|
|
82
|
+
.max(5),
|
|
83
|
+
comment: z.string().optional(),
|
|
84
|
+
createdDate: z.date().default(() => new Date()),
|
|
85
|
+
}))
|
|
86
|
+
.optional(),
|
|
87
|
+
cloudSave: z.boolean().default(false),
|
|
88
|
+
ugcSupport: z.boolean().default(false),
|
|
89
|
+
wishlistCount: z
|
|
90
|
+
.number()
|
|
91
|
+
.int()
|
|
92
|
+
.nonnegative()
|
|
93
|
+
.default(0),
|
|
94
|
+
parentId: ObjectId.optional(),
|
|
95
|
+
score: z.number().optional(),
|
|
96
|
+
ownerId: ObjectId.optional(),
|
|
97
|
+
ratingId: ObjectId.optional(),
|
|
98
|
+
ideaId: ObjectId.optional(),
|
|
99
|
+
meta: ProductMeta.optional(),
|
|
100
|
+
}));
|
|
101
|
+
export const ProductDLC = Entity.merge(z.object({
|
|
102
|
+
name: z.string().min(1),
|
|
103
|
+
description: z.string().optional(),
|
|
104
|
+
gameId: ObjectId,
|
|
105
|
+
price: z.number().nonnegative(),
|
|
106
|
+
discountPrice: z
|
|
107
|
+
.number()
|
|
108
|
+
.nonnegative()
|
|
109
|
+
.optional(),
|
|
110
|
+
currency: z.string().length(3),
|
|
111
|
+
digitalContent: z
|
|
112
|
+
.array(z.object({
|
|
113
|
+
url: z.string().url(),
|
|
114
|
+
size: z.number().nonnegative(),
|
|
115
|
+
drm: z.enum(['None', 'Steam', 'Epic', 'Uplay', 'Origin']).optional(),
|
|
116
|
+
}))
|
|
117
|
+
.optional(),
|
|
118
|
+
achievements: z
|
|
119
|
+
.array(z.object({
|
|
120
|
+
name: z.string(),
|
|
121
|
+
description: z.string().optional(),
|
|
122
|
+
icon: z
|
|
123
|
+
.string()
|
|
124
|
+
.url()
|
|
125
|
+
.optional(),
|
|
126
|
+
}))
|
|
127
|
+
.optional(),
|
|
128
|
+
}));
|
|
129
|
+
export const ProductBundle = Entity.merge(z.object({
|
|
130
|
+
name: z.string().min(1),
|
|
131
|
+
description: z.string().optional(),
|
|
132
|
+
products: z.array(ObjectId),
|
|
133
|
+
price: z.number().nonnegative(),
|
|
134
|
+
discountPrice: z
|
|
135
|
+
.number()
|
|
136
|
+
.nonnegative()
|
|
137
|
+
.optional(),
|
|
138
|
+
currency: z.string().length(3),
|
|
139
|
+
}));
|
|
140
|
+
export const ProductReview = Entity.merge(z.object({
|
|
141
|
+
userId: ObjectId,
|
|
142
|
+
productId: ObjectId,
|
|
143
|
+
rating: z
|
|
144
|
+
.number()
|
|
145
|
+
.min(1)
|
|
146
|
+
.max(5),
|
|
147
|
+
comment: z.string().optional(),
|
|
148
|
+
}));
|
|
149
|
+
export const ProductUpdate = Entity.merge(z.object({
|
|
150
|
+
productId: ObjectId,
|
|
151
|
+
updateContent: z.string().min(1),
|
|
152
|
+
updateDate: z.date(),
|
|
153
|
+
}));
|
|
154
|
+
//# sourceMappingURL=product.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product.schema.js","sourceRoot":"","sources":["../../product/product.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGhD,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC1B,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE;IACvB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE;IAC/B,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,WAAW,EAAE;SACb,QAAQ,EAAE;IACb,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;IACrC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACvB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACjC,kBAAkB,EAAE,CAA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AAW,EAAE;IAC/B,aAAa,EAAE,CAAC;SACb,MAAM,EAAE;SACR,WAAW,EAAE;SACb,QAAQ,EAAE;IACb,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;CAC/B,CAAC,CACH,CAAC;AAGF,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CACvC,CAAC,CAAC,MAAM,CAAC;IACP,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,CAAC,CAAC;IACT,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CACH,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CACvC,CAAC,CAAC,MAAM,CAAC;IACP,SAAS,EAAE,QAAQ;IACnB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,UAAU,EAAE,CAAC,CAAC,IAAI,EAAE;CACrB,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import * as schema from './product.schema';
|
|
3
|
+
import { Document, Model } from '@arken/node/mongo';
|
|
4
|
+
import type { RouterContext } from '../types';
|
|
5
|
+
import type { inferRouterInputs, inferRouterOutputs } from '@trpc/server';
|
|
6
|
+
import type { Router } from './product.router';
|
|
7
|
+
export type * from './product.router';
|
|
8
|
+
export type { RouterContext };
|
|
9
|
+
export type Product = z.infer<typeof schema.Product>;
|
|
10
|
+
export type ProductUpdate = z.infer<typeof schema.ProductUpdate>;
|
|
11
|
+
export type ProductDLC = z.infer<typeof schema.ProductDLC>;
|
|
12
|
+
export type ProductBundle = z.infer<typeof schema.ProductBundle>;
|
|
13
|
+
export type ProductReview = z.infer<typeof schema.ProductReview>;
|
|
14
|
+
export type ProductDocument = Product & Document;
|
|
15
|
+
export type ProductUpdateDocument = ProductUpdate & Document;
|
|
16
|
+
export type ProductDLCDocument = ProductDLC & Document;
|
|
17
|
+
export type ProductBundleDocument = ProductBundle & Document;
|
|
18
|
+
export type ProductReviewDocument = ProductReview & Document;
|
|
19
|
+
export type Mappings = {
|
|
20
|
+
Product: Model<ProductDocument>;
|
|
21
|
+
ProductUpdate: Model<ProductUpdateDocument>;
|
|
22
|
+
ProductDLC: Model<ProductDLCDocument>;
|
|
23
|
+
ProductBundle: Model<ProductBundleDocument>;
|
|
24
|
+
ProductReview: Model<ProductReviewDocument>;
|
|
25
|
+
};
|
|
26
|
+
export type RouterInput = inferRouterInputs<Router>;
|
|
27
|
+
export type RouterOutput = inferRouterOutputs<Router>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product.types.js","sourceRoot":"","sources":["../../product/product.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../profile/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import * as mongo from '@arken/node/mongo';
|
|
2
|
+
const { addTagVirtuals, addApplicationVirtual } = mongo;
|
|
3
|
+
const RankingStatSchema = new mongo.Schema({
|
|
4
|
+
total: { type: Number, required: true },
|
|
5
|
+
position: { type: Number, required: true },
|
|
6
|
+
}, { _id: false });
|
|
7
|
+
const RankingSchema = new mongo.Schema({
|
|
8
|
+
orbs: { type: RankingStatSchema, required: true },
|
|
9
|
+
wins: { type: RankingStatSchema, required: true },
|
|
10
|
+
kills: { type: RankingStatSchema, required: true },
|
|
11
|
+
deaths: { type: RankingStatSchema, required: true },
|
|
12
|
+
points: { type: RankingStatSchema, required: true },
|
|
13
|
+
rounds: { type: RankingStatSchema, required: true },
|
|
14
|
+
evolves: { type: RankingStatSchema, required: true },
|
|
15
|
+
rewards: { type: RankingStatSchema, required: true },
|
|
16
|
+
powerups: { type: RankingStatSchema, required: true },
|
|
17
|
+
revenges: { type: RankingStatSchema, required: true },
|
|
18
|
+
winRatio: { type: RankingStatSchema, required: true },
|
|
19
|
+
timeSpent: { type: RankingStatSchema, required: true },
|
|
20
|
+
averageLatency: { type: RankingStatSchema, required: true },
|
|
21
|
+
killDeathRatio: { type: RankingStatSchema, required: true },
|
|
22
|
+
roundPointRatio: { type: RankingStatSchema, required: true },
|
|
23
|
+
}, { _id: false });
|
|
24
|
+
const ServerDataSchema = new mongo.Schema({
|
|
25
|
+
orbs: { type: Number },
|
|
26
|
+
wins: { type: Number },
|
|
27
|
+
kills: { type: Number },
|
|
28
|
+
deaths: { type: Number },
|
|
29
|
+
points: { type: Number },
|
|
30
|
+
rounds: { type: Number },
|
|
31
|
+
evolves: { type: Number },
|
|
32
|
+
ranking: { type: RankingSchema },
|
|
33
|
+
rewards: { type: Number },
|
|
34
|
+
earnings: { type: Number },
|
|
35
|
+
powerups: { type: Number },
|
|
36
|
+
revenges: { type: Number },
|
|
37
|
+
winRatio: { type: Number },
|
|
38
|
+
timeSpent: { type: Number },
|
|
39
|
+
winStreak: { type: Number },
|
|
40
|
+
averageLatency: { type: Number, default: null },
|
|
41
|
+
killDeathRatio: { type: Number },
|
|
42
|
+
roundPointRatio: { type: Number },
|
|
43
|
+
}, { _id: false });
|
|
44
|
+
const EvolutionSchema = new mongo.Schema({
|
|
45
|
+
hashes: [{ type: String }],
|
|
46
|
+
overall: {
|
|
47
|
+
orbs: { type: Number },
|
|
48
|
+
wins: { type: Number },
|
|
49
|
+
kills: { type: Number },
|
|
50
|
+
deaths: { type: Number },
|
|
51
|
+
points: { type: Number },
|
|
52
|
+
rounds: { type: Number },
|
|
53
|
+
evolves: { type: Number },
|
|
54
|
+
ranking: { type: RankingSchema },
|
|
55
|
+
rewards: { type: Number },
|
|
56
|
+
earnings: { type: Number },
|
|
57
|
+
powerups: { type: Number },
|
|
58
|
+
revenges: { type: Number },
|
|
59
|
+
winRatio: { type: Number },
|
|
60
|
+
timeSpent: { type: Number },
|
|
61
|
+
winStreak: { type: Number },
|
|
62
|
+
averageLatency: { type: Number },
|
|
63
|
+
killDeathRatio: { type: Number },
|
|
64
|
+
roundPointRatio: { type: Number },
|
|
65
|
+
},
|
|
66
|
+
servers: { type: Map, of: ServerDataSchema },
|
|
67
|
+
lastUpdated: { type: Number },
|
|
68
|
+
}, { _id: false });
|
|
69
|
+
const StatsSchema = new mongo.Schema({
|
|
70
|
+
gamesOwned: { type: Number, default: 0 },
|
|
71
|
+
playedMinutes: { type: Number, default: 0 },
|
|
72
|
+
leveledUpCount: { type: Number, default: 0 },
|
|
73
|
+
xpEarnedCount: { type: Number, default: 0 },
|
|
74
|
+
craftedItemCount: { type: Number, default: 0 },
|
|
75
|
+
equippedItemCount: { type: Number, default: 0 },
|
|
76
|
+
transferredInCount: { type: Number, default: 0 },
|
|
77
|
+
transferredOutCount: { type: Number, default: 0 },
|
|
78
|
+
marketTradeSoldCount: { type: Number, default: 0 },
|
|
79
|
+
marketTradeListedCount: { type: Number, default: 0 },
|
|
80
|
+
evolution: { type: EvolutionSchema },
|
|
81
|
+
}, { _id: false });
|
|
82
|
+
const SettingsSchema = new mongo.Schema({
|
|
83
|
+
warp: { type: mongo.Schema.Types.Mixed, default: {} },
|
|
84
|
+
designer: { type: mongo.Schema.Types.Mixed, default: {} },
|
|
85
|
+
privacy: {
|
|
86
|
+
type: String,
|
|
87
|
+
enum: ['public', 'private', 'friends-only'],
|
|
88
|
+
default: 'public',
|
|
89
|
+
},
|
|
90
|
+
notifications: { type: Boolean, default: true },
|
|
91
|
+
}, { _id: false });
|
|
92
|
+
export const Profile = mongo.createModel('Profile', {
|
|
93
|
+
accountId: { type: mongo.Schema.Types.ObjectId, ref: 'Account', required: true },
|
|
94
|
+
points: { type: Number, default: 0 },
|
|
95
|
+
telegramUserId: { type: Number },
|
|
96
|
+
interactions: { type: Number, default: 0 },
|
|
97
|
+
activityRating: { type: Number, default: 0 },
|
|
98
|
+
address: { type: String, maxlength: 100 },
|
|
99
|
+
avatar: { type: String, maxlength: 100 },
|
|
100
|
+
roleId: { type: mongo.Schema.Types.ObjectId, ref: 'Role' },
|
|
101
|
+
privateKey: { type: String, maxlength: 300 },
|
|
102
|
+
signature: { type: String, maxlength: 200 },
|
|
103
|
+
chainId: { type: mongo.Schema.Types.ObjectId, ref: 'Chain' },
|
|
104
|
+
teamId: { type: mongo.Schema.Types.ObjectId, ref: 'Team' },
|
|
105
|
+
characterId: { type: mongo.Schema.Types.ObjectId, ref: 'Character' },
|
|
106
|
+
partyId: { type: mongo.Schema.Types.ObjectId, ref: 'Party' },
|
|
107
|
+
isBanned: { type: Boolean },
|
|
108
|
+
banExpireDate: { type: Date },
|
|
109
|
+
banReason: { type: String },
|
|
110
|
+
bio: { type: String },
|
|
111
|
+
banner: { type: String },
|
|
112
|
+
mode: { type: String, default: 'gamer' },
|
|
113
|
+
friends: [
|
|
114
|
+
{
|
|
115
|
+
profileId: { type: mongo.Schema.Types.ObjectId, ref: 'Profile', required: true },
|
|
116
|
+
meta: { type: mongo.Schema.Types.Mixed, default: {} },
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
badges: [
|
|
120
|
+
{
|
|
121
|
+
badgeId: { type: mongo.Schema.Types.ObjectId, ref: 'Badge', required: true },
|
|
122
|
+
meta: { type: mongo.Schema.Types.Mixed, default: {} },
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
settings: SettingsSchema,
|
|
126
|
+
stats: StatsSchema,
|
|
127
|
+
achievements: [
|
|
128
|
+
{
|
|
129
|
+
achievementId: { type: mongo.Schema.Types.ObjectId, ref: 'Achievement', required: true },
|
|
130
|
+
meta: { type: mongo.Schema.Types.Mixed, default: {} },
|
|
131
|
+
current: { type: Number, default: 0 },
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
}, {
|
|
135
|
+
virtuals: [
|
|
136
|
+
...addTagVirtuals('Profile'),
|
|
137
|
+
...addApplicationVirtual(),
|
|
138
|
+
{
|
|
139
|
+
name: 'character',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: 'characters',
|
|
143
|
+
ref: 'Character',
|
|
144
|
+
localField: '_id',
|
|
145
|
+
foreignField: 'ownerId',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: 'chain',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: 'role',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: 'account',
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: 'team',
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
indexes: [
|
|
161
|
+
{ applicationId: 1, telegramUserId: 1, unique: true },
|
|
162
|
+
{ applicationId: 1, accountId: 1, name: 1, unique: true },
|
|
163
|
+
],
|
|
164
|
+
});
|
|
165
|
+
//# sourceMappingURL=profile.models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.models.js","sourceRoot":"","sources":["../../profile/profile.models.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAG3C,MAAM,EAAE,cAAc,EAAE,qBAAqB,EAAE,GAAG,KAAK,CAAC;AAExD,MAAM,iBAAiB,GAAG,IAAI,KAAK,CAAC,MAAM,CACxC;IACE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACvC,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;CAC3C,EACD,EAAE,GAAG,EAAE,KAAK,EAAE,CACf,CAAC;AAEF,MAAM,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EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE;SACtC;KACF;CACF,EACD;IACE,QAAQ,EAAE;QACR,GAAG,cAAc,CAAC,SAAS,CAAC;QAC5B,GAAG,qBAAqB,EAAE;QAC1B;YACE,IAAI,EAAE,WAAW;SAClB;QACD;YACE,IAAI,EAAE,YAAY;YAClB,GAAG,EAAE,WAAW;YAChB,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,SAAS;SACxB;QACD;YACE,IAAI,EAAE,OAAO;SACd;QACD;YACE,IAAI,EAAE,MAAM;SACb;QACD;YACE,IAAI,EAAE,SAAS;SAChB;QACD;YACE,IAAI,EAAE,MAAM;SACb;KACF;IACD,OAAO,EAAE;QACP,EAAE,aAAa,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE;QACrD,EAAE,aAAa,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE;KAC1D;CACF,CACF,CAAC"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { z as zod } from 'zod';
|
|
2
|
+
import { inferRouterInputs } from '@trpc/server';
|
|
3
|
+
import type { RouterContext } from '../types';
|
|
4
|
+
import { inferRouterOutputs } from '../schema';
|
|
5
|
+
export declare const z: typeof zod;
|
|
6
|
+
export declare const t: {
|
|
7
|
+
_config: import("@trpc/server/dist/unstable-core-do-not-import").RootConfig<{
|
|
8
|
+
ctx: RouterContext;
|
|
9
|
+
meta: object;
|
|
10
|
+
errorShape: import("@trpc/server/dist/unstable-core-do-not-import").DefaultErrorShape;
|
|
11
|
+
transformer: false;
|
|
12
|
+
}>;
|
|
13
|
+
procedure: import("@trpc/server/dist/unstable-core-do-not-import").ProcedureBuilder<RouterContext, object, object, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, false>;
|
|
14
|
+
middleware: <$ContextOverrides>(fn: import("@trpc/server/dist/unstable-core-do-not-import").MiddlewareFunction<RouterContext, object, object, $ContextOverrides, unknown>) => import("@trpc/server/dist/unstable-core-do-not-import").MiddlewareBuilder<RouterContext, object, $ContextOverrides, unknown>;
|
|
15
|
+
router: {
|
|
16
|
+
<TInput extends import("@trpc/server").RouterRecord>(input: TInput): import("@trpc/server/dist/unstable-core-do-not-import").BuiltRouter<{
|
|
17
|
+
ctx: RouterContext;
|
|
18
|
+
meta: object;
|
|
19
|
+
errorShape: import("@trpc/server/dist/unstable-core-do-not-import").DefaultErrorShape;
|
|
20
|
+
transformer: false;
|
|
21
|
+
}, TInput>;
|
|
22
|
+
<TInput extends import("@trpc/server/dist/unstable-core-do-not-import").CreateRouterOptions>(input: TInput): import("@trpc/server/dist/unstable-core-do-not-import").BuiltRouter<{
|
|
23
|
+
ctx: RouterContext;
|
|
24
|
+
meta: object;
|
|
25
|
+
errorShape: import("@trpc/server/dist/unstable-core-do-not-import").DefaultErrorShape;
|
|
26
|
+
transformer: false;
|
|
27
|
+
}, import("@trpc/server/dist/unstable-core-do-not-import").DecorateCreateRouterOptions<TInput>>;
|
|
28
|
+
};
|
|
29
|
+
mergeRouters: typeof import("@trpc/server/dist/unstable-core-do-not-import").mergeRouters;
|
|
30
|
+
createCallerFactory: <TRecord extends import("@trpc/server").RouterRecord>(router: Pick<import("@trpc/server/dist/unstable-core-do-not-import").Router<{
|
|
31
|
+
ctx: RouterContext;
|
|
32
|
+
meta: object;
|
|
33
|
+
errorShape: import("@trpc/server/dist/unstable-core-do-not-import").DefaultErrorShape;
|
|
34
|
+
transformer: false;
|
|
35
|
+
}, TRecord>, "_def">) => import("@trpc/server/dist/unstable-core-do-not-import").RouterCaller<{
|
|
36
|
+
ctx: RouterContext;
|
|
37
|
+
meta: object;
|
|
38
|
+
errorShape: import("@trpc/server/dist/unstable-core-do-not-import").DefaultErrorShape;
|
|
39
|
+
transformer: false;
|
|
40
|
+
}, TRecord>;
|
|
41
|
+
};
|
|
42
|
+
export declare const router: {
|
|
43
|
+
<TInput extends import("@trpc/server").RouterRecord>(input: TInput): import("@trpc/server/dist/unstable-core-do-not-import").BuiltRouter<{
|
|
44
|
+
ctx: RouterContext;
|
|
45
|
+
meta: object;
|
|
46
|
+
errorShape: import("@trpc/server/dist/unstable-core-do-not-import").DefaultErrorShape;
|
|
47
|
+
transformer: false;
|
|
48
|
+
}, TInput>;
|
|
49
|
+
<TInput extends import("@trpc/server/dist/unstable-core-do-not-import").CreateRouterOptions>(input: TInput): import("@trpc/server/dist/unstable-core-do-not-import").BuiltRouter<{
|
|
50
|
+
ctx: RouterContext;
|
|
51
|
+
meta: object;
|
|
52
|
+
errorShape: import("@trpc/server/dist/unstable-core-do-not-import").DefaultErrorShape;
|
|
53
|
+
transformer: false;
|
|
54
|
+
}, import("@trpc/server/dist/unstable-core-do-not-import").DecorateCreateRouterOptions<TInput>>;
|
|
55
|
+
};
|
|
56
|
+
export declare const procedure: import("@trpc/server/dist/unstable-core-do-not-import").ProcedureBuilder<RouterContext, object, object, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, false>;
|
|
57
|
+
export declare const createRouter: () => import("@trpc/server/dist/unstable-core-do-not-import").BuiltRouter<{
|
|
58
|
+
ctx: RouterContext;
|
|
59
|
+
meta: object;
|
|
60
|
+
errorShape: import("@trpc/server/dist/unstable-core-do-not-import").DefaultErrorShape;
|
|
61
|
+
transformer: false;
|
|
62
|
+
}, {
|
|
63
|
+
setProfileMode: import("@trpc/server").TRPCMutationProcedure<{
|
|
64
|
+
input: string;
|
|
65
|
+
output: any;
|
|
66
|
+
}>;
|
|
67
|
+
me: import("@trpc/server").TRPCQueryProcedure<{
|
|
68
|
+
input: void;
|
|
69
|
+
output: any;
|
|
70
|
+
}>;
|
|
71
|
+
getProfile: import("@trpc/server").TRPCQueryProcedure<{
|
|
72
|
+
input: {
|
|
73
|
+
cursor?: Record<string, any>;
|
|
74
|
+
limit?: number;
|
|
75
|
+
select?: Record<string, boolean>;
|
|
76
|
+
skip?: number;
|
|
77
|
+
where?: {
|
|
78
|
+
[x: string]: any;
|
|
79
|
+
};
|
|
80
|
+
data?: any;
|
|
81
|
+
orderBy?: Record<string, "asc" | "desc">;
|
|
82
|
+
include?: Record<string, boolean>;
|
|
83
|
+
};
|
|
84
|
+
output: any;
|
|
85
|
+
}>;
|
|
86
|
+
getProfiles: import("@trpc/server").TRPCQueryProcedure<{
|
|
87
|
+
input: {
|
|
88
|
+
cursor?: Record<string, any>;
|
|
89
|
+
limit?: number;
|
|
90
|
+
select?: Record<string, boolean>;
|
|
91
|
+
skip?: number;
|
|
92
|
+
where?: {
|
|
93
|
+
[x: string]: any;
|
|
94
|
+
};
|
|
95
|
+
data?: any;
|
|
96
|
+
orderBy?: Record<string, "asc" | "desc">;
|
|
97
|
+
include?: Record<string, boolean>;
|
|
98
|
+
};
|
|
99
|
+
output: any[];
|
|
100
|
+
}>;
|
|
101
|
+
createProfile: import("@trpc/server").TRPCMutationProcedure<{
|
|
102
|
+
input: {
|
|
103
|
+
cursor?: Record<string, any>;
|
|
104
|
+
limit?: number;
|
|
105
|
+
select?: Record<string, boolean>;
|
|
106
|
+
skip?: number;
|
|
107
|
+
where?: {
|
|
108
|
+
[x: string]: any;
|
|
109
|
+
};
|
|
110
|
+
data?: any;
|
|
111
|
+
orderBy?: Record<string, "asc" | "desc">;
|
|
112
|
+
include?: Record<string, boolean>;
|
|
113
|
+
};
|
|
114
|
+
output: unknown;
|
|
115
|
+
}>;
|
|
116
|
+
updateProfile: import("@trpc/server").TRPCMutationProcedure<{
|
|
117
|
+
input: {
|
|
118
|
+
cursor?: Record<string, any>;
|
|
119
|
+
limit?: number;
|
|
120
|
+
select?: Record<string, boolean>;
|
|
121
|
+
skip?: number;
|
|
122
|
+
where?: {
|
|
123
|
+
[x: string]: any;
|
|
124
|
+
};
|
|
125
|
+
data?: any;
|
|
126
|
+
orderBy?: Record<string, "asc" | "desc">;
|
|
127
|
+
include?: Record<string, boolean>;
|
|
128
|
+
};
|
|
129
|
+
output: unknown;
|
|
130
|
+
}>;
|
|
131
|
+
getProfileStats: import("@trpc/server").TRPCQueryProcedure<{
|
|
132
|
+
input: {
|
|
133
|
+
query?: {
|
|
134
|
+
cursor?: Record<string, any>;
|
|
135
|
+
select?: Record<string, boolean>;
|
|
136
|
+
skip?: number;
|
|
137
|
+
where?: any;
|
|
138
|
+
take?: number;
|
|
139
|
+
orderBy?: Record<string, "asc" | "desc">;
|
|
140
|
+
include?: Record<string, boolean>;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
output: any;
|
|
144
|
+
}>;
|
|
145
|
+
updateProfileSettings: import("@trpc/server").TRPCMutationProcedure<{
|
|
146
|
+
input: {
|
|
147
|
+
query?: {
|
|
148
|
+
cursor?: Record<string, any>;
|
|
149
|
+
select?: Record<string, boolean>;
|
|
150
|
+
skip?: number;
|
|
151
|
+
where?: any;
|
|
152
|
+
take?: number;
|
|
153
|
+
orderBy?: Record<string, "asc" | "desc">;
|
|
154
|
+
include?: Record<string, boolean>;
|
|
155
|
+
};
|
|
156
|
+
settings?: any;
|
|
157
|
+
};
|
|
158
|
+
output: any;
|
|
159
|
+
}>;
|
|
160
|
+
}>;
|
|
161
|
+
export type Router = ReturnType<typeof createRouter>;
|
|
162
|
+
export type RouterInput = inferRouterInputs<Router>;
|
|
163
|
+
export type RouterOutput = inferRouterOutputs<Router>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z as zod } from 'zod';
|
|
2
|
+
import { initTRPC } from '@trpc/server';
|
|
3
|
+
import { customErrorFormatter, hasRole } from '@arken/node/rpc';
|
|
4
|
+
import { Profile } from './profile.schema';
|
|
5
|
+
import { Query, getQueryInput } from '../schema';
|
|
6
|
+
export const z = zod;
|
|
7
|
+
export const t = initTRPC.context().create();
|
|
8
|
+
export const router = t.router;
|
|
9
|
+
export const procedure = t.procedure;
|
|
10
|
+
export const createRouter = () => router({
|
|
11
|
+
setProfileMode: procedure
|
|
12
|
+
.use(hasRole('user', t))
|
|
13
|
+
.use(customErrorFormatter(t))
|
|
14
|
+
.input(z.string())
|
|
15
|
+
.mutation(({ input, ctx }) => ctx.app.service.Profile.setProfileMode(input, ctx)),
|
|
16
|
+
me: procedure
|
|
17
|
+
.use(hasRole('user', t))
|
|
18
|
+
.use(customErrorFormatter(t))
|
|
19
|
+
.query(({ input, ctx }) => ctx.app.service.Profile.me(input, ctx)),
|
|
20
|
+
getProfile: procedure
|
|
21
|
+
.use(hasRole('guest', t))
|
|
22
|
+
.use(customErrorFormatter(t))
|
|
23
|
+
.input(getQueryInput(Profile))
|
|
24
|
+
.query(({ input, ctx }) => ctx.app.service.Profile.getProfile(input, ctx)),
|
|
25
|
+
getProfiles: procedure
|
|
26
|
+
.use(hasRole('guest', t))
|
|
27
|
+
.use(customErrorFormatter(t))
|
|
28
|
+
.input(getQueryInput(Profile))
|
|
29
|
+
.output(z.array(Profile))
|
|
30
|
+
.query(({ input, ctx }) => ctx.app.service.Profile.getProfiles(input, ctx)),
|
|
31
|
+
createProfile: procedure
|
|
32
|
+
.use(hasRole('user', t))
|
|
33
|
+
.use(customErrorFormatter(t))
|
|
34
|
+
.input(getQueryInput(Profile))
|
|
35
|
+
.output(Profile.partial())
|
|
36
|
+
.mutation(({ input, ctx }) => ctx.app.service.Profile.createProfile(input, ctx)),
|
|
37
|
+
updateProfile: procedure
|
|
38
|
+
.use(hasRole('user', t))
|
|
39
|
+
.use(customErrorFormatter(t))
|
|
40
|
+
.input(getQueryInput(Profile))
|
|
41
|
+
.output(Profile.partial())
|
|
42
|
+
.mutation(({ input, ctx }) => ctx.app.service.Profile.updateProfile(input, ctx)),
|
|
43
|
+
getProfileStats: procedure
|
|
44
|
+
.use(hasRole('guest', t))
|
|
45
|
+
.use(customErrorFormatter(t))
|
|
46
|
+
.input(z.object({ query: Query }))
|
|
47
|
+
.query(({ input, ctx }) => ctx.app.service.Profile.getProfileStats(input, ctx)),
|
|
48
|
+
updateProfileSettings: procedure
|
|
49
|
+
.use(hasRole('user', t))
|
|
50
|
+
.use(customErrorFormatter(t))
|
|
51
|
+
.input(z.object({ query: Query, settings: Profile.shape.settings }))
|
|
52
|
+
.mutation(({ input, ctx }) => ctx.app.service.Profile.updateProfileSettings(input, ctx)),
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=profile.router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.router.js","sourceRoot":"","sources":["../../profile/profile.router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,IAAI,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAqB,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,aAAa,EAAsC,MAAM,WAAW,CAAC;AAErF,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AACrB,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,OAAO,EAAiB,CAAC,MAAM,EAAE,CAAC;AAC5D,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;AAC/B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC;AAErC,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE,CAC/B,MAAM,CAAC;IACL,cAAc,EAAE,SAAS;SACtB,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;S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