@arken/seer-protocol 0.1.1 → 0.1.2
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 +537 -56
- package/area/area.models.ts +15 -0
- package/area/area.router.ts +74 -0
- package/area/area.schema.ts +22 -0
- package/area/area.types.ts +26 -0
- package/area/index.ts +5 -0
- package/asset/asset.models.ts +59 -0
- package/asset/asset.router.ts +55 -0
- package/asset/asset.schema.ts +27 -0
- package/asset/asset.types.ts +22 -0
- package/asset/index.ts +5 -0
- package/chain/chain.models.ts +50 -0
- package/chain/chain.router.ts +104 -0
- package/chain/chain.schema.ts +52 -0
- package/chain/chain.types.ts +24 -0
- package/chain/index.ts +5 -0
- package/character/character.models.ts +174 -0
- package/character/character.router.ts +314 -0
- package/character/character.schema.ts +147 -0
- package/character/character.types.ts +64 -0
- package/character/index.ts +5 -0
- package/chat/chat.models.ts +43 -0
- package/chat/chat.router.ts +67 -0
- package/chat/chat.schema.ts +36 -0
- package/chat/chat.types.ts +20 -0
- package/chat/index.ts +5 -0
- package/collection/collection.models.ts +76 -0
- package/collection/collection.router.ts +91 -0
- package/collection/collection.schema.ts +90 -0
- package/collection/collection.types.ts +36 -0
- package/collection/index.ts +5 -0
- package/core/core.models.ts +1380 -0
- package/core/core.router.ts +1781 -0
- package/core/core.schema.ts +847 -0
- package/core/core.types.ts +340 -0
- package/core/index.ts +5 -0
- package/evolution/evolution.models.ts +1 -1
- package/evolution/evolution.router.ts +8 -8
- package/evolution/evolution.schema.ts +1 -1
- package/evolution/evolution.types.ts +1 -1
- package/game/game.models.ts +53 -0
- package/game/game.router.ts +110 -0
- package/game/game.schema.ts +23 -0
- package/game/game.types.ts +28 -0
- package/game/index.ts +5 -0
- package/index.ts +39 -2
- package/infinite/infinite.models.ts +1 -1
- package/infinite/infinite.router.ts +8 -8
- package/infinite/infinite.schema.ts +1 -1
- package/infinite/infinite.types.ts +1 -1
- package/interface/index.ts +5 -0
- package/interface/interface.canonicalize.ts +279 -0
- package/interface/interface.models.ts +40 -0
- package/interface/interface.router.ts +175 -0
- package/interface/interface.schema.ts +59 -0
- package/interface/interface.types.ts +25 -0
- package/isles/isles.models.ts +1 -1
- package/isles/isles.router.ts +8 -8
- package/isles/isles.schema.ts +1 -1
- package/isles/isles.types.ts +1 -1
- package/item/index.ts +5 -0
- package/item/item.models.ts +124 -0
- package/item/item.router.ts +103 -0
- package/item/item.schema.ts +120 -0
- package/item/item.types.ts +74 -0
- package/job/index.ts +5 -0
- package/job/job.models.ts +14 -0
- package/job/job.router.ts +44 -0
- package/job/job.schema.ts +9 -0
- package/job/job.types.ts +23 -0
- package/market/index.ts +5 -0
- package/market/market.models.ts +113 -0
- package/market/market.router.ts +73 -0
- package/market/market.schema.ts +140 -0
- package/market/market.types.ts +56 -0
- package/oasis/oasis.models.ts +1 -1
- package/oasis/oasis.router.ts +2 -2
- package/oasis/oasis.schema.ts +1 -1
- package/oasis/oasis.types.ts +1 -1
- package/package.json +10 -3
- package/product/index.ts +5 -0
- package/product/product.models.ts +166 -0
- package/product/product.router.ts +93 -0
- package/product/product.schema.ts +149 -0
- package/product/product.types.ts +33 -0
- package/profile/index.ts +5 -0
- package/profile/profile.models.ts +214 -0
- package/profile/profile.router.ts +72 -0
- package/profile/profile.schema.ts +156 -0
- package/profile/profile.types.ts +22 -0
- package/raffle/index.ts +5 -0
- package/raffle/raffle.models.ts +44 -0
- package/raffle/raffle.router.ts +90 -0
- package/raffle/raffle.schema.ts +32 -0
- package/raffle/raffle.types.ts +30 -0
- package/router.ts +23 -29
- package/schema.ts +321 -0
- package/skill/index.ts +5 -0
- package/skill/skill.models.ts +16 -0
- package/skill/skill.router.ts +201 -0
- package/skill/skill.schema.ts +40 -0
- package/skill/skill.types.ts +33 -0
- package/trek/trek.models.ts +1 -1
- package/trek/trek.router.ts +1 -1
- package/trek/trek.schema.ts +1 -1
- package/trek/trek.types.ts +1 -1
- package/types.ts +172 -5
- package/video/index.ts +5 -0
- package/video/video.models.ts +25 -0
- package/video/video.router.ts +143 -0
- package/video/video.schema.ts +46 -0
- package/video/video.types.ts +33 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
// core.types.ts
|
|
2
|
+
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { HydratedDocument } from 'mongoose';
|
|
5
|
+
import * as schema from './core.schema';
|
|
6
|
+
import { Document, Model } from '../../util/mongo';
|
|
7
|
+
|
|
8
|
+
// Export types from other modules if necessary
|
|
9
|
+
export type * from './core.router';
|
|
10
|
+
export type * from './core.service';
|
|
11
|
+
export type { RouterContext } from '../../types';
|
|
12
|
+
|
|
13
|
+
export type MerkleTree = z.infer<typeof schema.MerkleTree>;
|
|
14
|
+
export type MerkleTreeDocument = MerkleTree & Document;
|
|
15
|
+
|
|
16
|
+
export type MerkleNode = z.infer<typeof schema.MerkleNode>;
|
|
17
|
+
export type MerkleNodeDocument = MerkleNode & Document;
|
|
18
|
+
|
|
19
|
+
// Define all core types from schemas
|
|
20
|
+
export type Account = z.infer<typeof schema.Account>;
|
|
21
|
+
export type AccountDocument = Account & Document;
|
|
22
|
+
|
|
23
|
+
export type Achievement = z.infer<typeof schema.Achievement>;
|
|
24
|
+
export type AchievementDocument = Achievement & Document;
|
|
25
|
+
|
|
26
|
+
export type Act = z.infer<typeof schema.Act>;
|
|
27
|
+
export type ActDocument = Act & Document;
|
|
28
|
+
|
|
29
|
+
export type Agent = z.infer<typeof schema.Agent>;
|
|
30
|
+
export type AgentDocument = Agent & Document;
|
|
31
|
+
|
|
32
|
+
export type Application = z.infer<typeof schema.Application>;
|
|
33
|
+
export type ApplicationDocument = Application & Document;
|
|
34
|
+
|
|
35
|
+
export type Badge = z.infer<typeof schema.Badge>;
|
|
36
|
+
export type BadgeDocument = Badge & Document;
|
|
37
|
+
|
|
38
|
+
export type BattlePass = z.infer<typeof schema.BattlePass>;
|
|
39
|
+
export type BattlePassDocument = BattlePass & Document;
|
|
40
|
+
|
|
41
|
+
export type Biome = z.infer<typeof schema.Biome>;
|
|
42
|
+
export type BiomeDocument = Biome & Document;
|
|
43
|
+
|
|
44
|
+
export type BiomeFeature = z.infer<typeof schema.BiomeFeature>;
|
|
45
|
+
export type BiomeFeatureDocument = BiomeFeature & Document;
|
|
46
|
+
|
|
47
|
+
export type Bounty = z.infer<typeof schema.Bounty>;
|
|
48
|
+
export type BountyDocument = Bounty & Document;
|
|
49
|
+
|
|
50
|
+
export type Counter = z.infer<typeof schema.Counter>;
|
|
51
|
+
export type CounterDocument = Counter & Document;
|
|
52
|
+
|
|
53
|
+
export type Collection = z.infer<typeof schema.Collection>;
|
|
54
|
+
export type CollectionDocument = Collection & Document;
|
|
55
|
+
|
|
56
|
+
export type Comment = z.infer<typeof schema.Comment>;
|
|
57
|
+
export type CommentDocument = Comment & Document;
|
|
58
|
+
|
|
59
|
+
export type Community = z.infer<typeof schema.Community>;
|
|
60
|
+
export type CommunityDocument = Community & Document;
|
|
61
|
+
|
|
62
|
+
export type Company = z.infer<typeof schema.Company>;
|
|
63
|
+
export type CompanyDocument = Company & Document;
|
|
64
|
+
|
|
65
|
+
export type Conversation = z.infer<typeof schema.Conversation>;
|
|
66
|
+
export type ConversationDocument = Conversation & Document;
|
|
67
|
+
|
|
68
|
+
export type ConversationMessage = z.infer<typeof schema.ConversationMessage>;
|
|
69
|
+
export type ConversationMessageDocument = ConversationMessage & Document;
|
|
70
|
+
|
|
71
|
+
export type Data = z.infer<typeof schema.Data>;
|
|
72
|
+
export type DataDocument = Data & Document;
|
|
73
|
+
|
|
74
|
+
export type Meta = z.infer<typeof schema.Meta>;
|
|
75
|
+
export type MetaDocument = Meta & Document;
|
|
76
|
+
|
|
77
|
+
export type Discussion = z.infer<typeof schema.Discussion>;
|
|
78
|
+
export type DiscussionDocument = Discussion & Document;
|
|
79
|
+
|
|
80
|
+
export type Energy = z.infer<typeof schema.Energy>;
|
|
81
|
+
export type EnergyDocument = Energy & Document;
|
|
82
|
+
|
|
83
|
+
export type Event = z.infer<typeof schema.Event>;
|
|
84
|
+
export type EventDocument = Event & Document;
|
|
85
|
+
|
|
86
|
+
export type File = z.infer<typeof schema.File>;
|
|
87
|
+
export type FileDocument = File & Document;
|
|
88
|
+
|
|
89
|
+
export type Galaxy = z.infer<typeof schema.Galaxy>;
|
|
90
|
+
export type GalaxyDocument = Galaxy & Document;
|
|
91
|
+
|
|
92
|
+
export type Guide = z.infer<typeof schema.Guide>;
|
|
93
|
+
export type GuideDocument = Guide & Document;
|
|
94
|
+
|
|
95
|
+
export type Idea = z.infer<typeof schema.Idea>;
|
|
96
|
+
export type IdeaDocument = Idea & Document;
|
|
97
|
+
|
|
98
|
+
export type Leaderboard = z.infer<typeof schema.Leaderboard>;
|
|
99
|
+
export type LeaderboardDocument = Leaderboard & Document;
|
|
100
|
+
|
|
101
|
+
export type Log = z.infer<typeof schema.Log>;
|
|
102
|
+
export type LogDocument = Log & Document;
|
|
103
|
+
|
|
104
|
+
export type Lore = z.infer<typeof schema.Lore>;
|
|
105
|
+
export type LoreDocument = Lore & Document;
|
|
106
|
+
|
|
107
|
+
export type Market = z.infer<typeof schema.Market>;
|
|
108
|
+
export type MarketDocument = Market & Document;
|
|
109
|
+
|
|
110
|
+
export type Memory = z.infer<typeof schema.Memory>;
|
|
111
|
+
export type MemoryDocument = Memory & Document;
|
|
112
|
+
|
|
113
|
+
export type Message = z.infer<typeof schema.Message>;
|
|
114
|
+
export type MessageDocument = Message & Document;
|
|
115
|
+
|
|
116
|
+
export type Metaverse = z.infer<typeof schema.Metaverse>;
|
|
117
|
+
export type MetaverseDocument = Metaverse & Document;
|
|
118
|
+
|
|
119
|
+
export type NewsArticle = z.infer<typeof schema.NewsArticle>;
|
|
120
|
+
export type NewsArticleDocument = NewsArticle & Document;
|
|
121
|
+
|
|
122
|
+
export type Npc = z.infer<typeof schema.Npc>;
|
|
123
|
+
export type NpcDocument = Npc & Document;
|
|
124
|
+
|
|
125
|
+
export type Offer = z.infer<typeof schema.Offer>;
|
|
126
|
+
export type OfferDocument = Offer & Document;
|
|
127
|
+
|
|
128
|
+
export type Omniverse = z.infer<typeof schema.Omniverse>;
|
|
129
|
+
export type OmniverseDocument = Omniverse & Document;
|
|
130
|
+
|
|
131
|
+
export type Order = z.infer<typeof schema.Order>;
|
|
132
|
+
export type OrderDocument = Order & Document;
|
|
133
|
+
|
|
134
|
+
export type Party = z.infer<typeof schema.Party>;
|
|
135
|
+
export type PartyDocument = Party & Document;
|
|
136
|
+
|
|
137
|
+
export type Payment = z.infer<typeof schema.Payment>;
|
|
138
|
+
export type PaymentDocument = HydratedDocument<Payment>;
|
|
139
|
+
|
|
140
|
+
export type Permission = z.infer<typeof schema.Permission>;
|
|
141
|
+
export type PermissionDocument = Permission & Document;
|
|
142
|
+
|
|
143
|
+
export type Person = z.infer<typeof schema.Person>;
|
|
144
|
+
export type PersonDocument = Person & Document;
|
|
145
|
+
|
|
146
|
+
export type Planet = z.infer<typeof schema.Planet>;
|
|
147
|
+
export type PlanetDocument = Planet & Document;
|
|
148
|
+
|
|
149
|
+
export type Poll = z.infer<typeof schema.Poll>;
|
|
150
|
+
export type PollDocument = Poll & Document;
|
|
151
|
+
|
|
152
|
+
export type Project = z.infer<typeof schema.Project>;
|
|
153
|
+
export type ProjectDocument = Project & Document;
|
|
154
|
+
|
|
155
|
+
export type Proposal = z.infer<typeof schema.Proposal>;
|
|
156
|
+
export type ProposalDocument = Proposal & Document;
|
|
157
|
+
|
|
158
|
+
export type Quest = z.infer<typeof schema.Quest>;
|
|
159
|
+
export type QuestDocument = Quest & Document;
|
|
160
|
+
|
|
161
|
+
export type Question = z.infer<typeof schema.Question>;
|
|
162
|
+
export type QuestionDocument = Question & Document;
|
|
163
|
+
|
|
164
|
+
export type Rating = z.infer<typeof schema.Rating>;
|
|
165
|
+
export type RatingDocument = Rating & Document;
|
|
166
|
+
|
|
167
|
+
export type Realm = z.infer<typeof schema.Realm>;
|
|
168
|
+
export type RealmDocument = Realm & Document;
|
|
169
|
+
|
|
170
|
+
export type RealmEvent = z.infer<typeof schema.RealmEvent>;
|
|
171
|
+
export type RealmEventDocument = RealmEvent & Document;
|
|
172
|
+
|
|
173
|
+
export type RealmShard = z.infer<typeof schema.RealmShard>;
|
|
174
|
+
export type RealmShardDocument = RealmShard & Document;
|
|
175
|
+
|
|
176
|
+
export type RealmTrait = z.infer<typeof schema.RealmTrait>;
|
|
177
|
+
export type RealmTraitDocument = RealmTrait & Document;
|
|
178
|
+
|
|
179
|
+
export type Revision = z.infer<typeof schema.Revision>;
|
|
180
|
+
export type RevisionDocument = Revision & Document;
|
|
181
|
+
|
|
182
|
+
export type Referral = z.infer<typeof schema.Referral>;
|
|
183
|
+
export type ReferralDocument = Referral & Document;
|
|
184
|
+
|
|
185
|
+
export type Review = z.infer<typeof schema.Review>;
|
|
186
|
+
export type ReviewDocument = Review & Document;
|
|
187
|
+
|
|
188
|
+
export type Role = z.infer<typeof schema.Role>;
|
|
189
|
+
export type RoleDocument = Role & Document;
|
|
190
|
+
|
|
191
|
+
export type Season = z.infer<typeof schema.Season>;
|
|
192
|
+
export type SeasonDocument = Season & Document;
|
|
193
|
+
|
|
194
|
+
export type Session = z.infer<typeof schema.Session>;
|
|
195
|
+
export type SessionDocument = Session & Document;
|
|
196
|
+
|
|
197
|
+
export type SolarSystem = z.infer<typeof schema.SolarSystem>;
|
|
198
|
+
export type SolarSystemDocument = SolarSystem & Document;
|
|
199
|
+
|
|
200
|
+
export type Star = z.infer<typeof schema.Star>;
|
|
201
|
+
export type StarDocument = Star & Document;
|
|
202
|
+
|
|
203
|
+
export type Stat = z.infer<typeof schema.Stat>;
|
|
204
|
+
export type StatDocument = Stat & Document;
|
|
205
|
+
|
|
206
|
+
export type Stash = z.infer<typeof schema.Stash>;
|
|
207
|
+
export type StashDocument = Stash & Document;
|
|
208
|
+
|
|
209
|
+
export type Stock = z.infer<typeof schema.Stock>;
|
|
210
|
+
export type StockDocument = Stock & Document;
|
|
211
|
+
|
|
212
|
+
export type Suggestion = z.infer<typeof schema.Suggestion>;
|
|
213
|
+
export type SuggestionDocument = Suggestion & Document;
|
|
214
|
+
|
|
215
|
+
export type Tag = z.infer<typeof schema.Tag>;
|
|
216
|
+
export type TagDocument = Tag & Document;
|
|
217
|
+
|
|
218
|
+
export type Team = z.infer<typeof schema.Team>;
|
|
219
|
+
export type TeamDocument = Team & Document;
|
|
220
|
+
|
|
221
|
+
export type Tournament = z.infer<typeof schema.Tournament>;
|
|
222
|
+
export type TournamentDocument = Tournament & Document;
|
|
223
|
+
|
|
224
|
+
export type Trade = z.infer<typeof schema.Trade>;
|
|
225
|
+
export type TradeDocument = Trade & Document;
|
|
226
|
+
|
|
227
|
+
export type Universe = z.infer<typeof schema.Universe>;
|
|
228
|
+
export type UniverseDocument = Universe & Document;
|
|
229
|
+
|
|
230
|
+
export type Validator = z.infer<typeof schema.Validator>;
|
|
231
|
+
export type ValidatorDocument = Validator & Document;
|
|
232
|
+
|
|
233
|
+
export type Vote = z.infer<typeof schema.Vote>;
|
|
234
|
+
export type VoteDocument = Vote & Document;
|
|
235
|
+
|
|
236
|
+
export type WorldEvent = z.infer<typeof schema.WorldEvent>;
|
|
237
|
+
export type WorldEventDocument = WorldEvent & Document;
|
|
238
|
+
|
|
239
|
+
export type WorldRecord = z.infer<typeof schema.WorldRecord>;
|
|
240
|
+
export type WorldRecordDocument = WorldRecord & Document;
|
|
241
|
+
|
|
242
|
+
export type Node = z.infer<typeof schema.Node>;
|
|
243
|
+
export type NodeDocument = Node & Document;
|
|
244
|
+
|
|
245
|
+
export type Prefab = z.infer<typeof schema.Prefab>;
|
|
246
|
+
export type PrefabDocument = Prefab & Document;
|
|
247
|
+
|
|
248
|
+
export type Object = z.infer<typeof schema.Object>;
|
|
249
|
+
export type ObjectDocument = Object & Document;
|
|
250
|
+
|
|
251
|
+
export type ObjectInteraction = z.infer<typeof schema.ObjectInteraction>;
|
|
252
|
+
export type ObjectInteractionDocument = ObjectInteraction & Document;
|
|
253
|
+
|
|
254
|
+
export type SeerEvent = z.infer<typeof schema.SeerEvent>;
|
|
255
|
+
export type SeerEventDocument = SeerEvent & Document;
|
|
256
|
+
|
|
257
|
+
export type SeerPayload = z.infer<typeof schema.SeerPayload>;
|
|
258
|
+
export type SeerPayloadDocument = SeerPayload & Document;
|
|
259
|
+
|
|
260
|
+
// Define model mappings
|
|
261
|
+
export type Mappings = {
|
|
262
|
+
Account: Model<AccountDocument>;
|
|
263
|
+
Achievement: Model<AchievementDocument>;
|
|
264
|
+
Act: Model<ActDocument>;
|
|
265
|
+
Agent: Model<AgentDocument>;
|
|
266
|
+
Application: Model<ApplicationDocument>;
|
|
267
|
+
Badge: Model<BadgeDocument>;
|
|
268
|
+
BattlePass: Model<BattlePassDocument>;
|
|
269
|
+
Biome: Model<BiomeDocument>;
|
|
270
|
+
BiomeFeature: Model<BiomeFeatureDocument>;
|
|
271
|
+
Bounty: Model<BountyDocument>;
|
|
272
|
+
Counter: Model<CounterDocument>;
|
|
273
|
+
Collection: Model<CollectionDocument>;
|
|
274
|
+
Comment: Model<CommentDocument>;
|
|
275
|
+
Community: Model<CommunityDocument>;
|
|
276
|
+
Company: Model<CompanyDocument>;
|
|
277
|
+
Conversation: Model<ConversationDocument>;
|
|
278
|
+
ConversationMessage: Model<ConversationMessageDocument>;
|
|
279
|
+
Data: Model<DataDocument>;
|
|
280
|
+
Discussion: Model<DiscussionDocument>;
|
|
281
|
+
Energy: Model<EnergyDocument>;
|
|
282
|
+
Event: Model<EventDocument>;
|
|
283
|
+
File: Model<FileDocument>;
|
|
284
|
+
Galaxy: Model<GalaxyDocument>;
|
|
285
|
+
Guide: Model<GuideDocument>;
|
|
286
|
+
Idea: Model<IdeaDocument>;
|
|
287
|
+
Leaderboard: Model<LeaderboardDocument>;
|
|
288
|
+
Log: Model<LogDocument>;
|
|
289
|
+
Lore: Model<LoreDocument>;
|
|
290
|
+
Market: Model<MarketDocument>;
|
|
291
|
+
Memory: Model<MemoryDocument>;
|
|
292
|
+
Message: Model<MessageDocument>;
|
|
293
|
+
Metaverse: Model<MetaverseDocument>;
|
|
294
|
+
NewsArticle: Model<NewsArticleDocument>;
|
|
295
|
+
Npc: Model<NpcDocument>;
|
|
296
|
+
Object: Model<ObjectDocument>;
|
|
297
|
+
ObjectInteraction: Model<ObjectInteractionDocument>;
|
|
298
|
+
Offer: Model<OfferDocument>;
|
|
299
|
+
Omniverse: Model<OmniverseDocument>;
|
|
300
|
+
Order: Model<OrderDocument>;
|
|
301
|
+
Payment: Model<PaymentDocument>;
|
|
302
|
+
Party: Model<PartyDocument>;
|
|
303
|
+
Permission: Model<PermissionDocument>;
|
|
304
|
+
Person: Model<PersonDocument>;
|
|
305
|
+
Planet: Model<PlanetDocument>;
|
|
306
|
+
Poll: Model<PollDocument>;
|
|
307
|
+
Prefab: Model<PrefabDocument>;
|
|
308
|
+
Project: Model<ProjectDocument>;
|
|
309
|
+
Proposal: Model<ProposalDocument>;
|
|
310
|
+
Quest: Model<QuestDocument>;
|
|
311
|
+
Question: Model<QuestionDocument>;
|
|
312
|
+
Rating: Model<RatingDocument>;
|
|
313
|
+
Realm: Model<RealmDocument>;
|
|
314
|
+
RealmEvent: Model<RealmEventDocument>;
|
|
315
|
+
RealmShard: Model<RealmShardDocument>;
|
|
316
|
+
Revision: Model<RevisionDocument>;
|
|
317
|
+
Referral: Model<ReferralDocument>;
|
|
318
|
+
Review: Model<ReviewDocument>;
|
|
319
|
+
Role: Model<RoleDocument>;
|
|
320
|
+
Season: Model<SeasonDocument>;
|
|
321
|
+
SeerEvent: Model<SeerEventDocument>;
|
|
322
|
+
SeerPayload: Model<SeerPayloadDocument>;
|
|
323
|
+
Session: Model<SessionDocument>;
|
|
324
|
+
SolarSystem: Model<SolarSystemDocument>;
|
|
325
|
+
Star: Model<StarDocument>;
|
|
326
|
+
Stat: Model<StatDocument>;
|
|
327
|
+
Stash: Model<StashDocument>;
|
|
328
|
+
Stock: Model<StockDocument>;
|
|
329
|
+
Suggestion: Model<SuggestionDocument>;
|
|
330
|
+
Tag: Model<TagDocument>;
|
|
331
|
+
Team: Model<TeamDocument>;
|
|
332
|
+
Tournament: Model<TournamentDocument>;
|
|
333
|
+
Trade: Model<TradeDocument>;
|
|
334
|
+
Universe: Model<UniverseDocument>;
|
|
335
|
+
Validator: Model<ValidatorDocument>;
|
|
336
|
+
Vote: Model<VoteDocument>;
|
|
337
|
+
WorldEvent: Model<WorldEventDocument>;
|
|
338
|
+
WorldRecord: Model<WorldRecordDocument>;
|
|
339
|
+
Node: Model<NodeDocument>; // Added Node model mapping
|
|
340
|
+
};
|
package/core/index.ts
ADDED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z as zod } from 'zod';
|
|
2
2
|
import { initTRPC } from '@trpc/server';
|
|
3
|
-
import { customErrorFormatter, hasRole } from '@arken/rpc';
|
|
3
|
+
import { customErrorFormatter, hasRole } from '@arken/node/rpc';
|
|
4
4
|
import * as Arken from '@arken/node';
|
|
5
|
-
import { Query, getQueryInput, inferRouterOutputs, inferRouterInputs } from '@arken/schema';
|
|
5
|
+
import { Query, getQueryInput, inferRouterOutputs, inferRouterInputs } from '@arken/node/schema';
|
|
6
6
|
import { RouterContext } from '../../types';
|
|
7
7
|
|
|
8
8
|
export const z = zod;
|
|
@@ -1406,20 +1406,20 @@ export type RouterOutput = inferRouterOutputs<Router>;
|
|
|
1406
1406
|
// }
|
|
1407
1407
|
// });
|
|
1408
1408
|
|
|
1409
|
-
// import type * as Arken from '@arken/types';
|
|
1410
|
-
// import { isDebug, log } from '@arken/util';
|
|
1409
|
+
// import type * as Arken from '@arken/node/types';
|
|
1410
|
+
// import { isDebug, log } from '@arken/node/util';
|
|
1411
1411
|
// import * as dotenv from 'dotenv';
|
|
1412
|
-
// import { catchExceptions, subProcesses } from '@arken/process';
|
|
1412
|
+
// import { catchExceptions, subProcesses } from '@arken/node/process';
|
|
1413
1413
|
// import fetch from 'node-fetch';
|
|
1414
1414
|
|
|
1415
1415
|
// import path from 'path';
|
|
1416
1416
|
// import jetpack, { find } from 'fs-jetpack';
|
|
1417
1417
|
// import beautify from 'json-beautify';
|
|
1418
|
-
// import { fancyTimeFormat } from '@arken/time';
|
|
1418
|
+
// import { fancyTimeFormat } from '@arken/node/time';
|
|
1419
1419
|
// import md5 from 'js-md5';
|
|
1420
1420
|
// import { getClientSocket } from '@arken/websocket';
|
|
1421
|
-
// import { isValidRequest, getSignedRequest } from '@arken/web3';
|
|
1422
|
-
// import getUsername from '@arken/legacy/getOldUsername';
|
|
1421
|
+
// import { isValidRequest, getSignedRequest } from '@arken/node/web3';
|
|
1422
|
+
// import getUsername from '@arken/node/legacy/getOldUsername';
|
|
1423
1423
|
// import { z } from 'zod';
|
|
1424
1424
|
|
|
1425
1425
|
// export async function monitorEvolutionRealms(app) {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import { z, ObjectId, Entity } from '@arken/schema';
|
|
1
|
+
import { z, ObjectId, Entity } from '@arken/node/schema';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as mongo from '../../util/mongo';
|
|
2
|
+
import type * as Types from './game.types';
|
|
3
|
+
|
|
4
|
+
const { addTagVirtuals, addApplicationVirtual } = mongo;
|
|
5
|
+
|
|
6
|
+
export const Game = mongo.createModel<Types.GameDocument>(
|
|
7
|
+
'Game',
|
|
8
|
+
{
|
|
9
|
+
productId: { type: mongo.Schema.Types.ObjectId, ref: 'Product', required: true },
|
|
10
|
+
statId: { type: mongo.Schema.Types.ObjectId, ref: 'GameStat' },
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
extend: 'EntityFields',
|
|
14
|
+
indexes: [{ applicationId: 1, name: 1, unique: true }],
|
|
15
|
+
virtuals: [
|
|
16
|
+
...addTagVirtuals('Application'),
|
|
17
|
+
{ name: 'stat' },
|
|
18
|
+
{ name: 'stats', ref: 'GameStat', localField: '_id', foreignField: 'gameId' },
|
|
19
|
+
{ name: 'rounds', ref: 'GameRound', localField: '_id', foreignField: 'gameId' },
|
|
20
|
+
// {
|
|
21
|
+
// name: 'latestStat',
|
|
22
|
+
// ref: 'GameStat',
|
|
23
|
+
// localField: '_id',
|
|
24
|
+
// foreignField: 'gameId',
|
|
25
|
+
// options: { sort: { createdAt: -1 }, limit: 1 },
|
|
26
|
+
// },
|
|
27
|
+
],
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
export const GameStat = mongo.createModel<Types.GameStatDocument>(
|
|
32
|
+
'GameStat',
|
|
33
|
+
{
|
|
34
|
+
gameId: { type: mongo.Schema.Types.ObjectId, ref: 'Game', required: true },
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
extend: 'EntityFields',
|
|
38
|
+
virtuals: [...addTagVirtuals('Application'), { name: 'game' }],
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
export const GameRound = mongo.createModel<Types.GameRoundDocument>(
|
|
43
|
+
'GameRound',
|
|
44
|
+
{
|
|
45
|
+
gameId: { type: mongo.Schema.Types.ObjectId, ref: 'Game', required: true },
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
extend: 'EntityFields',
|
|
49
|
+
virtuals: [...addTagVirtuals('Application'), { name: 'game' }],
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
export const Era = mongo.createModel<Types.EraDocument>('Era', {});
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { z as zod } from 'zod';
|
|
2
|
+
import { initTRPC } from '@trpc/server';
|
|
3
|
+
import { customErrorFormatter, hasRole } from '../../util/rpc';
|
|
4
|
+
import type { RouterContext } from '../../types';
|
|
5
|
+
import { Era, Game, GameStat } from './game.schema';
|
|
6
|
+
import { Query, getQueryInput, inferRouterOutputs, inferRouterInputs } from '../../schema';
|
|
7
|
+
|
|
8
|
+
export const z = zod;
|
|
9
|
+
export const t = initTRPC.context<RouterContext>().create();
|
|
10
|
+
export const router = t.router;
|
|
11
|
+
export const procedure = t.procedure;
|
|
12
|
+
|
|
13
|
+
export const createRouter = () =>
|
|
14
|
+
router({
|
|
15
|
+
getGame: procedure
|
|
16
|
+
.use(hasRole('guest', t))
|
|
17
|
+
.use(customErrorFormatter(t))
|
|
18
|
+
.input(getQueryInput(Game))
|
|
19
|
+
.output(Game)
|
|
20
|
+
.query(({ input, ctx }) => (ctx.app.service.Game.getGame as any)(input, ctx)),
|
|
21
|
+
|
|
22
|
+
getGames: procedure
|
|
23
|
+
.use(hasRole('guest', t))
|
|
24
|
+
.use(customErrorFormatter(t))
|
|
25
|
+
.input(getQueryInput(Game))
|
|
26
|
+
.output(z.array(Game))
|
|
27
|
+
.query(({ input, ctx }) => (ctx.app.service.Game.getGames as any)(input, ctx)),
|
|
28
|
+
|
|
29
|
+
createGame: procedure
|
|
30
|
+
.use(hasRole('guest', t))
|
|
31
|
+
.use(customErrorFormatter(t))
|
|
32
|
+
.input(getQueryInput(Game))
|
|
33
|
+
.output(Game.pick({ id: true }))
|
|
34
|
+
.query(({ input, ctx }) => (ctx.app.service.Game.createGame as any)(input, ctx)),
|
|
35
|
+
|
|
36
|
+
updateGame: procedure
|
|
37
|
+
.use(hasRole('guest', t))
|
|
38
|
+
.use(customErrorFormatter(t))
|
|
39
|
+
.input(getQueryInput(Game))
|
|
40
|
+
.output(Game.pick({ id: true }))
|
|
41
|
+
.query(({ input, ctx }) => (ctx.app.service.Game.updateGame as any)(input, ctx)),
|
|
42
|
+
|
|
43
|
+
getGameStat: procedure
|
|
44
|
+
.use(hasRole('guest', t))
|
|
45
|
+
.use(customErrorFormatter(t))
|
|
46
|
+
.input(getQueryInput(GameStat))
|
|
47
|
+
.output(GameStat)
|
|
48
|
+
.query(({ input, ctx }) => (ctx.app.service.Game.getGameStat as any)(input, ctx)),
|
|
49
|
+
|
|
50
|
+
getGameStats: procedure
|
|
51
|
+
.use(hasRole('guest', t))
|
|
52
|
+
.use(customErrorFormatter(t))
|
|
53
|
+
.input(getQueryInput(GameStat))
|
|
54
|
+
.output(z.array(GameStat))
|
|
55
|
+
.query(({ input, ctx }) => (ctx.app.service.Game.getGameStats as any)(input, ctx)),
|
|
56
|
+
|
|
57
|
+
createGameStat: procedure
|
|
58
|
+
.use(hasRole('guest', t))
|
|
59
|
+
.use(customErrorFormatter(t))
|
|
60
|
+
.input(getQueryInput(GameStat))
|
|
61
|
+
.output(GameStat.pick({ id: true }))
|
|
62
|
+
.query(({ input, ctx }) => (ctx.app.service.Game.createGameStat as any)(input, ctx)),
|
|
63
|
+
|
|
64
|
+
updateGameStat: procedure
|
|
65
|
+
.use(hasRole('guest', t))
|
|
66
|
+
.use(customErrorFormatter(t))
|
|
67
|
+
.input(getQueryInput(GameStat))
|
|
68
|
+
.output(GameStat.pick({ id: true }))
|
|
69
|
+
.query(({ input, ctx }) => (ctx.app.service.Game.updateGame as any)(input, ctx)),
|
|
70
|
+
|
|
71
|
+
// Era Procedures
|
|
72
|
+
getEra: procedure
|
|
73
|
+
.use(hasRole('guest', t))
|
|
74
|
+
.use(customErrorFormatter(t))
|
|
75
|
+
.input(getQueryInput(Era))
|
|
76
|
+
.output(Era)
|
|
77
|
+
.query(({ input, ctx }) => (ctx.app.service.Game.getEra as any)(input, ctx)),
|
|
78
|
+
|
|
79
|
+
getEras: procedure
|
|
80
|
+
.use(hasRole('guest', t))
|
|
81
|
+
.use(customErrorFormatter(t))
|
|
82
|
+
.input(getQueryInput(Era))
|
|
83
|
+
.output(z.array(Era))
|
|
84
|
+
.query(({ input, ctx }) => (ctx.app.service.Game.getEras as any)(input, ctx)),
|
|
85
|
+
|
|
86
|
+
createEra: procedure
|
|
87
|
+
.use(hasRole('admin', t))
|
|
88
|
+
.use(customErrorFormatter(t))
|
|
89
|
+
.input(getQueryInput(Era))
|
|
90
|
+
.output(Era.pick({ id: true }))
|
|
91
|
+
.mutation(({ input, ctx }) => (ctx.app.service.Game.createEra as any)(input, ctx)),
|
|
92
|
+
|
|
93
|
+
updateEra: procedure
|
|
94
|
+
.use(hasRole('admin', t))
|
|
95
|
+
.use(customErrorFormatter(t))
|
|
96
|
+
.input(getQueryInput(Era))
|
|
97
|
+
.output(Era.pick({ id: true }))
|
|
98
|
+
.mutation(({ input, ctx }) => (ctx.app.service.Game.updateEra as any)(input, ctx)),
|
|
99
|
+
|
|
100
|
+
deleteEra: procedure
|
|
101
|
+
.use(hasRole('admin', t))
|
|
102
|
+
.use(customErrorFormatter(t))
|
|
103
|
+
.input(getQueryInput(Era))
|
|
104
|
+
.output(Era.pick({ id: true }))
|
|
105
|
+
.mutation(({ input, ctx }) => (ctx.app.service.Game.deleteEra as any)(input, ctx)),
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
export type Router = ReturnType<typeof createRouter>;
|
|
109
|
+
export type RouterInput = inferRouterInputs<Router>;
|
|
110
|
+
export type RouterOutput = inferRouterOutputs<Router>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z, ObjectId, Entity } from '../../schema';
|
|
2
|
+
|
|
3
|
+
export const GameStat = Entity.merge(
|
|
4
|
+
z.object({
|
|
5
|
+
gameId: ObjectId,
|
|
6
|
+
})
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
export const Game = Entity.merge(
|
|
10
|
+
z.object({
|
|
11
|
+
productId: ObjectId,
|
|
12
|
+
statId: ObjectId.optional(),
|
|
13
|
+
stat: GameStat.nullable().optional(),
|
|
14
|
+
})
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export const GameRound = Entity.merge(
|
|
18
|
+
z.object({
|
|
19
|
+
gameId: ObjectId,
|
|
20
|
+
})
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export const Era = Entity.merge(z.object({}));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Model, Document } from '../../util/mongo';
|
|
3
|
+
import * as schema from './game.schema';
|
|
4
|
+
|
|
5
|
+
export type * from './game.router';
|
|
6
|
+
export type * from './game.service';
|
|
7
|
+
export type { RouterContext } from '../../types';
|
|
8
|
+
|
|
9
|
+
// Define types based on the schema
|
|
10
|
+
export type Game = z.infer<typeof schema.Game>;
|
|
11
|
+
export type GameDocument = Game & Document;
|
|
12
|
+
|
|
13
|
+
export type GameStat = z.infer<typeof schema.GameStat>;
|
|
14
|
+
export type GameStatDocument = GameStat & Document;
|
|
15
|
+
|
|
16
|
+
export type GameRound = z.infer<typeof schema.GameRound>;
|
|
17
|
+
export type GameRoundDocument = GameRound & Document;
|
|
18
|
+
|
|
19
|
+
export type Era = z.infer<typeof schema.Era>;
|
|
20
|
+
export type EraDocument = Era & Document;
|
|
21
|
+
|
|
22
|
+
// Mappings for MongoDB models
|
|
23
|
+
export type Mappings = {
|
|
24
|
+
Game: Model<GameDocument>;
|
|
25
|
+
GameStat: Model<GameStatDocument>;
|
|
26
|
+
GameRound: Model<GameRoundDocument>;
|
|
27
|
+
Era: Model<EraDocument>;
|
|
28
|
+
};
|
package/game/index.ts
ADDED
package/index.ts
CHANGED
|
@@ -1,9 +1,46 @@
|
|
|
1
|
-
import type * as Arken from '@arken/types';
|
|
1
|
+
import type * as Arken from '@arken/node/types';
|
|
2
2
|
import * as dotenv from 'dotenv';
|
|
3
|
-
import * as Schema from '@arken/schema';
|
|
3
|
+
import * as Schema from '@arken/node/schema';
|
|
4
4
|
import { createRouter as createRouter2 } from './router';
|
|
5
5
|
import type * as Types from './types';
|
|
6
6
|
|
|
7
|
+
// Imports
|
|
8
|
+
import * as Area from './modules/area';
|
|
9
|
+
import * as Asset from './modules/asset';
|
|
10
|
+
import * as Chain from './modules/chain';
|
|
11
|
+
import * as Character from './modules/character';
|
|
12
|
+
import * as Chat from './modules/chat';
|
|
13
|
+
import * as Collection from './modules/collection';
|
|
14
|
+
import * as Core from './modules/core';
|
|
15
|
+
import * as Game from './modules/game';
|
|
16
|
+
import * as Interface from './modules/interface';
|
|
17
|
+
import * as Item from './modules/item';
|
|
18
|
+
import * as Job from './modules/job';
|
|
19
|
+
import * as Market from './modules/market';
|
|
20
|
+
import * as Product from './modules/product';
|
|
21
|
+
import * as Profile from './modules/profile';
|
|
22
|
+
import * as Raffle from './modules/raffle';
|
|
23
|
+
import * as Skill from './modules/skill';
|
|
24
|
+
import * as Video from './modules/video';
|
|
25
|
+
|
|
26
|
+
// Exports
|
|
27
|
+
export * as Area from './modules/asrea';
|
|
28
|
+
export * as Asset from './modules/asset';
|
|
29
|
+
export * as Chain from './modules/chain';
|
|
30
|
+
export * as Character from './modules/character';
|
|
31
|
+
export * as Chat from './modules/chat';
|
|
32
|
+
export * as Collection from './modules/collection';
|
|
33
|
+
export * as Core from './modules/core';
|
|
34
|
+
export * as Game from './modules/game';
|
|
35
|
+
export * as Interface from './modules/interface';
|
|
36
|
+
export * as Item from './modules/item';
|
|
37
|
+
export * as Job from './modules/job';
|
|
38
|
+
export * as Market from './modules/market';
|
|
39
|
+
export * as Product from './modules/product';
|
|
40
|
+
export * as Profile from './modules/profile';
|
|
41
|
+
export * as Raffle from './modules/raffle';
|
|
42
|
+
export * as Skill from './modules/skill';
|
|
43
|
+
export * as Video from './modules/video';
|
|
7
44
|
export * as Trek from './modules/trek';
|
|
8
45
|
export * as Evolution from './modules/evolution';
|
|
9
46
|
export * as Infinite from './modules/infinite';
|