@arken/seer-protocol 0.1.4 → 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 +10 -3
- 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,811 @@
|
|
|
1
|
+
import * as mongo from '@arken/node/mongo';
|
|
2
|
+
const { createModel, addTagVirtuals, addApplicationVirtual } = mongo;
|
|
3
|
+
export const MerkleTree = createModel('MerkleTree', {
|
|
4
|
+
root: { type: String, required: true, default: '0x' + '0'.repeat(64) },
|
|
5
|
+
depth: { type: Number, required: true, default: 16 },
|
|
6
|
+
}, {
|
|
7
|
+
virtuals: [...addTagVirtuals('MerkleTree'), ...addApplicationVirtual()],
|
|
8
|
+
});
|
|
9
|
+
export const MerkleNode = createModel('MerkleNode', {
|
|
10
|
+
treeId: { type: mongo.Schema.Types.ObjectId, ref: 'MerkleTree', required: true },
|
|
11
|
+
level: { type: Number, required: true },
|
|
12
|
+
index: { type: Number, required: true },
|
|
13
|
+
hash: { type: String, required: true },
|
|
14
|
+
}, {
|
|
15
|
+
indexes: [{ treeId: 1, level: 1, index: 1 }],
|
|
16
|
+
virtuals: [...addTagVirtuals('MerkleNode'), ...addApplicationVirtual()],
|
|
17
|
+
});
|
|
18
|
+
export const Omniverse = createModel('Omniverse', {
|
|
19
|
+
ratingId: { type: mongo.Schema.Types.ObjectId, ref: 'Rating' },
|
|
20
|
+
}, {
|
|
21
|
+
extend: 'CommonFields',
|
|
22
|
+
virtuals: [...addTagVirtuals('Omniverse'), ...addApplicationVirtual()],
|
|
23
|
+
});
|
|
24
|
+
export const Metaverse = createModel('Metaverse', {
|
|
25
|
+
omniverseId: { type: mongo.Schema.Types.ObjectId, ref: 'Omniverse', required: true },
|
|
26
|
+
ratingId: { type: mongo.Schema.Types.ObjectId, ref: 'Rating' },
|
|
27
|
+
}, {
|
|
28
|
+
extend: 'CommonFields',
|
|
29
|
+
virtuals: [...addTagVirtuals('Metaverse'), ...addApplicationVirtual()],
|
|
30
|
+
});
|
|
31
|
+
export const Application = createModel('Application', {
|
|
32
|
+
ownerId: { type: mongo.Schema.Types.ObjectId, ref: 'Account' },
|
|
33
|
+
metaverseId: { type: mongo.Schema.Types.ObjectId, ref: 'Metaverse' },
|
|
34
|
+
name: { type: String, required: true },
|
|
35
|
+
description: { type: String },
|
|
36
|
+
}, {
|
|
37
|
+
extend: 'CommonFields',
|
|
38
|
+
indexes: [{ metaverseId: 1, name: 1, unique: true }],
|
|
39
|
+
virtuals: [
|
|
40
|
+
...addTagVirtuals('Application'),
|
|
41
|
+
{ name: 'agents', ref: 'Agent', localField: '_id', foreignField: 'applicationId' },
|
|
42
|
+
{ name: 'chain' },
|
|
43
|
+
{ name: 'account' },
|
|
44
|
+
{ name: 'assets' },
|
|
45
|
+
{ name: 'badges' },
|
|
46
|
+
{ name: 'battlePasses' },
|
|
47
|
+
{ name: 'collections' },
|
|
48
|
+
{ name: 'communities' },
|
|
49
|
+
{ name: 'discussions' },
|
|
50
|
+
{ name: 'events' },
|
|
51
|
+
{ name: 'exchanges' },
|
|
52
|
+
{ name: 'files' },
|
|
53
|
+
{ name: 'ideas' },
|
|
54
|
+
{ name: 'leaderboards' },
|
|
55
|
+
{ name: 'assetLicenses' },
|
|
56
|
+
{ name: 'logs' },
|
|
57
|
+
{ name: 'marketPairs' },
|
|
58
|
+
{ name: 'markets' },
|
|
59
|
+
{ name: 'messages' },
|
|
60
|
+
{ name: 'offers' },
|
|
61
|
+
{ name: 'orders' },
|
|
62
|
+
{ name: 'products' },
|
|
63
|
+
{ name: 'projects' },
|
|
64
|
+
{ name: 'ratings' },
|
|
65
|
+
{ name: 'realms' },
|
|
66
|
+
{ name: 'reviews' },
|
|
67
|
+
{ name: 'roles' },
|
|
68
|
+
{ name: 'realmShards' },
|
|
69
|
+
{ name: 'suggestions' },
|
|
70
|
+
{ name: 'tags' },
|
|
71
|
+
{ name: 'tokens' },
|
|
72
|
+
{ name: 'tradeIdeas' },
|
|
73
|
+
{ name: 'trades' },
|
|
74
|
+
{ name: 'buyerTrades' },
|
|
75
|
+
{ name: 'transactions' },
|
|
76
|
+
{ name: 'votes' },
|
|
77
|
+
{ name: 'payments' },
|
|
78
|
+
{ name: 'permissions' },
|
|
79
|
+
{ name: 'stats' },
|
|
80
|
+
{ name: 'revisions' },
|
|
81
|
+
{ name: 'comments' },
|
|
82
|
+
{ name: 'interfaces' },
|
|
83
|
+
{ name: 'characters' },
|
|
84
|
+
{ name: 'metaverses' },
|
|
85
|
+
{ name: 'omniverses' },
|
|
86
|
+
{ name: 'referrals' },
|
|
87
|
+
{ name: 'recipientReferrals' },
|
|
88
|
+
{ name: 'senderReferrals' },
|
|
89
|
+
{ name: 'chains' },
|
|
90
|
+
{ name: 'characterAbilities' },
|
|
91
|
+
{ name: 'tournaments' },
|
|
92
|
+
{ name: 'teams' },
|
|
93
|
+
{ name: 'items' },
|
|
94
|
+
{ name: 'skills' },
|
|
95
|
+
{ name: 'itemRecipes' },
|
|
96
|
+
{ name: 'itemSkins' },
|
|
97
|
+
{ name: 'stashes' },
|
|
98
|
+
{ name: 'biomes' },
|
|
99
|
+
{ name: 'planets' },
|
|
100
|
+
{ name: 'solarSystems' },
|
|
101
|
+
{ name: 'universes' },
|
|
102
|
+
{ name: 'stars' },
|
|
103
|
+
{ name: 'areas' },
|
|
104
|
+
{ name: 'acts' },
|
|
105
|
+
{ name: 'characterClasses' },
|
|
106
|
+
{ name: 'characterFactions' },
|
|
107
|
+
{ name: 'eras' },
|
|
108
|
+
{ name: 'seasons' },
|
|
109
|
+
{ name: 'itemAttributes' },
|
|
110
|
+
{ name: 'itemMaterials' },
|
|
111
|
+
{ name: 'itemSets' },
|
|
112
|
+
{ name: 'itemSlots' },
|
|
113
|
+
{ name: 'itemRarities' },
|
|
114
|
+
{ name: 'itemTypes' },
|
|
115
|
+
{ name: 'itemSubTypes' },
|
|
116
|
+
{ name: 'itemSpecificTypes' },
|
|
117
|
+
{ name: 'characterGenders' },
|
|
118
|
+
{ name: 'characterRaces' },
|
|
119
|
+
{ name: 'characterPersonalities' },
|
|
120
|
+
{ name: 'characterTitles' },
|
|
121
|
+
{ name: 'lores' },
|
|
122
|
+
{ name: 'energies' },
|
|
123
|
+
{ name: 'guides' },
|
|
124
|
+
{ name: 'achievements' },
|
|
125
|
+
{ name: 'games' },
|
|
126
|
+
{ name: 'npcs' },
|
|
127
|
+
{ name: 'characterAttributes' },
|
|
128
|
+
{ name: 'characterTypes' },
|
|
129
|
+
{ name: 'areaTypes' },
|
|
130
|
+
{ name: 'areaLandmarks' },
|
|
131
|
+
{ name: 'biomeFeatures' },
|
|
132
|
+
{ name: 'skillMods' },
|
|
133
|
+
{ name: 'skillClassifications' },
|
|
134
|
+
{ name: 'skillConditions' },
|
|
135
|
+
{ name: 'skillStatusEffects' },
|
|
136
|
+
{ name: 'skillTrees' },
|
|
137
|
+
{ name: 'skillTreeNodes' },
|
|
138
|
+
{ name: 'areaNameChoices' },
|
|
139
|
+
{ name: 'characterNameChoices' },
|
|
140
|
+
{ name: 'validators' },
|
|
141
|
+
{ name: 'productUpdates' },
|
|
142
|
+
{ name: 'polls' },
|
|
143
|
+
{ name: 'galaxies' },
|
|
144
|
+
{ name: 'quests' },
|
|
145
|
+
{ name: 'raffles' },
|
|
146
|
+
{ name: 'raffleEntries' },
|
|
147
|
+
{ name: 'raffleRequirements' },
|
|
148
|
+
{ name: 'raffleRewards' },
|
|
149
|
+
{ name: 'proposals' },
|
|
150
|
+
{ name: 'companies' },
|
|
151
|
+
{ name: 'people' },
|
|
152
|
+
],
|
|
153
|
+
});
|
|
154
|
+
export const Account = createModel('Account', {
|
|
155
|
+
username: { type: String },
|
|
156
|
+
email: { type: String },
|
|
157
|
+
address: { type: String },
|
|
158
|
+
addressIndex: { type: Number },
|
|
159
|
+
telegramUserId: { type: Number },
|
|
160
|
+
activeProfileId: { type: mongo.Schema.Types.ObjectId, ref: 'Profile' },
|
|
161
|
+
sessionUserId: { type: String },
|
|
162
|
+
}, {
|
|
163
|
+
indexes: [
|
|
164
|
+
{
|
|
165
|
+
fields: { applicationId: 1, telegramUserId: 1 },
|
|
166
|
+
options: {
|
|
167
|
+
unique: true,
|
|
168
|
+
partialFilterExpression: { telegramUserId: { $exists: true } },
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
virtuals: [
|
|
173
|
+
{
|
|
174
|
+
name: 'profiles',
|
|
175
|
+
ref: 'Profile',
|
|
176
|
+
localField: '_id',
|
|
177
|
+
foreignField: 'accountId',
|
|
178
|
+
justOne: false,
|
|
179
|
+
},
|
|
180
|
+
...addTagVirtuals('Account'),
|
|
181
|
+
...addApplicationVirtual(),
|
|
182
|
+
],
|
|
183
|
+
});
|
|
184
|
+
export const Achievement = createModel('Achievement', {}, {
|
|
185
|
+
virtuals: [...addTagVirtuals('Achievement'), ...addApplicationVirtual()],
|
|
186
|
+
});
|
|
187
|
+
export const Act = createModel('Act', {}, {
|
|
188
|
+
virtuals: [...addTagVirtuals('Act'), ...addApplicationVirtual()],
|
|
189
|
+
});
|
|
190
|
+
export const Agent = createModel('Agent', {}, {
|
|
191
|
+
virtuals: [...addTagVirtuals('Agent'), ...addApplicationVirtual()],
|
|
192
|
+
});
|
|
193
|
+
export const Badge = createModel('Badge', {}, {
|
|
194
|
+
virtuals: [...addTagVirtuals('Badge'), ...addApplicationVirtual()],
|
|
195
|
+
});
|
|
196
|
+
export const BattlePass = createModel('BattlePass', {}, {
|
|
197
|
+
virtuals: [...addTagVirtuals('BattlePass'), ...addApplicationVirtual()],
|
|
198
|
+
});
|
|
199
|
+
export const Biome = createModel('Biome', {}, {
|
|
200
|
+
virtuals: [...addTagVirtuals('Biome'), ...addApplicationVirtual()],
|
|
201
|
+
});
|
|
202
|
+
export const BiomeFeature = createModel('BiomeFeature', {}, {
|
|
203
|
+
virtuals: [...addTagVirtuals('BiomeFeature'), ...addApplicationVirtual()],
|
|
204
|
+
});
|
|
205
|
+
export const Bounty = createModel('Bounty', {}, {
|
|
206
|
+
virtuals: [...addTagVirtuals('Bounty'), ...addApplicationVirtual()],
|
|
207
|
+
});
|
|
208
|
+
export const Counter = createModel('Counter', { _id: { type: String, required: true }, seq: { type: Number, default: 0 } }, { versionKey: false, virtuals: [...addTagVirtuals('Counter'), ...addApplicationVirtual()] });
|
|
209
|
+
export const Collection = createModel('Collection', {}, {
|
|
210
|
+
virtuals: [...addTagVirtuals('Collection'), ...addApplicationVirtual()],
|
|
211
|
+
});
|
|
212
|
+
export const Comment = createModel('Comment', {
|
|
213
|
+
body: { type: String, required: true },
|
|
214
|
+
entity: { type: mongo.Schema.Types.ObjectId },
|
|
215
|
+
entityModel: { type: String },
|
|
216
|
+
text: { type: String },
|
|
217
|
+
ratingId: { type: mongo.Schema.Types.ObjectId, ref: 'Rating' },
|
|
218
|
+
}, {
|
|
219
|
+
virtuals: [...addTagVirtuals('Comment'), ...addApplicationVirtual()],
|
|
220
|
+
});
|
|
221
|
+
export const Community = createModel('Community', {
|
|
222
|
+
ideas: [{ type: mongo.Schema.Types.ObjectId, ref: 'Idea' }],
|
|
223
|
+
products: [{ type: mongo.Schema.Types.ObjectId, ref: 'Product' }],
|
|
224
|
+
projects: [{ type: mongo.Schema.Types.ObjectId, ref: 'Project' }],
|
|
225
|
+
}, {
|
|
226
|
+
virtuals: [...addTagVirtuals('Community'), ...addApplicationVirtual()],
|
|
227
|
+
});
|
|
228
|
+
export const Company = createModel('Company', {
|
|
229
|
+
content: { type: String },
|
|
230
|
+
people: [{ type: mongo.Schema.Types.ObjectId, ref: 'Person' }],
|
|
231
|
+
}, {
|
|
232
|
+
virtuals: [...addTagVirtuals('Company'), ...addApplicationVirtual()],
|
|
233
|
+
});
|
|
234
|
+
export const Conversation = createModel('Conversation', {
|
|
235
|
+
profileId: { type: mongo.Schema.Types.ObjectId, ref: 'Profile', index: true },
|
|
236
|
+
kind: {
|
|
237
|
+
type: String,
|
|
238
|
+
enum: ['mail', 'dm', 'group', 'support', 'system'],
|
|
239
|
+
default: 'mail',
|
|
240
|
+
index: true,
|
|
241
|
+
},
|
|
242
|
+
participants: [
|
|
243
|
+
{
|
|
244
|
+
profileId: { type: mongo.Schema.Types.ObjectId, ref: 'Profile', required: true },
|
|
245
|
+
role: { type: String, enum: ['user', 'system', 'gm', 'npc'], default: 'user' },
|
|
246
|
+
lastReadAt: { type: Date, default: new Date(0) },
|
|
247
|
+
unreadCount: { type: Number, default: 0 },
|
|
248
|
+
isMuted: { type: Boolean, default: false },
|
|
249
|
+
isPinned: { type: Boolean, default: false },
|
|
250
|
+
isArchived: { type: Boolean, default: false },
|
|
251
|
+
isDeleted: { type: Boolean, default: false },
|
|
252
|
+
},
|
|
253
|
+
],
|
|
254
|
+
isLocked: { type: Boolean, default: true },
|
|
255
|
+
allowUserSend: { type: Boolean, default: false },
|
|
256
|
+
category: { type: String, default: 'system' },
|
|
257
|
+
importance: { type: Number, default: 0 },
|
|
258
|
+
lastMessageDate: { type: Date, default: null, index: true },
|
|
259
|
+
lastMessagePreview: { type: String, default: '' },
|
|
260
|
+
messageCount: { type: Number, default: 0 },
|
|
261
|
+
messages: [{ type: mongo.Schema.Types.ObjectId, ref: 'ConversationMessage' }],
|
|
262
|
+
}, {
|
|
263
|
+
indexes: [
|
|
264
|
+
{ fields: { 'participants.profileId': 1, lastMessageDate: -1 } },
|
|
265
|
+
{ fields: { kind: 1, 'participants.profileId': 1, lastMessageDate: -1 } },
|
|
266
|
+
{ fields: { profileId: 1, kind: 1, lastMessageDate: -1 } },
|
|
267
|
+
{
|
|
268
|
+
fields: { key: 1, profileId: 1 },
|
|
269
|
+
options: {
|
|
270
|
+
unique: true,
|
|
271
|
+
partialFilterExpression: { profileId: { $type: 'objectId' } },
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
fields: { kind: 1, profileId: 1 },
|
|
276
|
+
options: {
|
|
277
|
+
unique: true,
|
|
278
|
+
partialFilterExpression: { profileId: { $type: 'objectId' } },
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
fields: { applicationId: 1, kind: 1, profileId: 1, key: 1 },
|
|
283
|
+
options: {
|
|
284
|
+
unique: true,
|
|
285
|
+
partialFilterExpression: { key: { $type: 'string' } },
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
],
|
|
289
|
+
virtuals: [...addTagVirtuals('Conversation'), ...addApplicationVirtual()],
|
|
290
|
+
});
|
|
291
|
+
export const ConversationMessage = createModel('ConversationMessage', {
|
|
292
|
+
conversationId: { type: mongo.Schema.Types.ObjectId, ref: 'Conversation', required: true, index: true },
|
|
293
|
+
role: { type: String, enum: ['user', 'assistant', 'system'], required: true },
|
|
294
|
+
type: {
|
|
295
|
+
type: String,
|
|
296
|
+
enum: ['text', 'notice', 'reward', 'action', 'system'],
|
|
297
|
+
default: 'text',
|
|
298
|
+
index: true,
|
|
299
|
+
},
|
|
300
|
+
isStarred: { type: Boolean, default: false, index: true },
|
|
301
|
+
content: { type: String, default: '' },
|
|
302
|
+
payload: { type: mongo.Schema.Types.Mixed },
|
|
303
|
+
replyToId: { type: mongo.Schema.Types.ObjectId, ref: 'ConversationMessage' },
|
|
304
|
+
claim: {
|
|
305
|
+
isClaimable: { type: Boolean, default: false, index: true },
|
|
306
|
+
claimedDate: { type: Date, default: null },
|
|
307
|
+
claimedByProfileId: { type: mongo.Schema.Types.ObjectId, ref: 'Profile', default: null },
|
|
308
|
+
dedupeKey: { type: String, default: null },
|
|
309
|
+
attachments: { type: [mongo.Schema.Types.Mixed], default: [] },
|
|
310
|
+
revokedDate: { type: Date, default: null },
|
|
311
|
+
revokeReason: { type: String, default: null },
|
|
312
|
+
},
|
|
313
|
+
}, {
|
|
314
|
+
indexes: [
|
|
315
|
+
{ fields: { conversationId: 1, _id: -1 } },
|
|
316
|
+
{ fields: { conversationId: 1, createdDate: -1 } },
|
|
317
|
+
{ fields: { 'claim.isClaimable': 1, 'claim.claimedDate': 1 } },
|
|
318
|
+
{ fields: { conversationId: 1, 'claim.isClaimable': 1, 'claim.claimedDate': 1, _id: -1 } },
|
|
319
|
+
{ fields: { conversationId: 1, 'claim.dedupeKey': 1 } },
|
|
320
|
+
{
|
|
321
|
+
fields: { conversationId: 1, 'claim.dedupeKey': 1 },
|
|
322
|
+
options: {
|
|
323
|
+
unique: true,
|
|
324
|
+
partialFilterExpression: { 'claim.dedupeKey': { $type: 'string' } },
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
{ fields: { isStarred: 1, conversationId: 1, _id: -1 } },
|
|
328
|
+
],
|
|
329
|
+
virtuals: [...addTagVirtuals('ConversationMessage'), ...addApplicationVirtual()],
|
|
330
|
+
});
|
|
331
|
+
export const Data = createModel('Data', {
|
|
332
|
+
mod: { type: String, required: true },
|
|
333
|
+
}, {
|
|
334
|
+
virtuals: [...addTagVirtuals('Data'), ...addApplicationVirtual()],
|
|
335
|
+
});
|
|
336
|
+
export const Meta = createModel('Meta', {}, {
|
|
337
|
+
virtuals: [...addTagVirtuals('Meta'), ...addApplicationVirtual()],
|
|
338
|
+
});
|
|
339
|
+
export const Discussion = createModel('Discussion', {
|
|
340
|
+
content: { type: String },
|
|
341
|
+
parentId: { type: mongo.Schema.Types.ObjectId, ref: 'Discussion' },
|
|
342
|
+
rootMessageId: { type: mongo.Schema.Types.ObjectId, ref: 'Message' },
|
|
343
|
+
type: { type: String, default: 'Discussion' },
|
|
344
|
+
}, {
|
|
345
|
+
virtuals: [...addTagVirtuals('Discussion'), ...addApplicationVirtual()],
|
|
346
|
+
});
|
|
347
|
+
export const Energy = createModel('Energy', {}, {
|
|
348
|
+
virtuals: [...addTagVirtuals('Energy'), ...addApplicationVirtual()],
|
|
349
|
+
});
|
|
350
|
+
export const Event = createModel('Event', {}, {
|
|
351
|
+
virtuals: [...addTagVirtuals('Event'), ...addApplicationVirtual()],
|
|
352
|
+
});
|
|
353
|
+
export const File = createModel('File', {
|
|
354
|
+
content: { type: String },
|
|
355
|
+
storageType: { type: String, max: 100 },
|
|
356
|
+
accessType: { type: String, max: 100 },
|
|
357
|
+
}, {
|
|
358
|
+
virtuals: [...addTagVirtuals('File'), ...addApplicationVirtual()],
|
|
359
|
+
});
|
|
360
|
+
export const Galaxy = createModel('Galaxy', {
|
|
361
|
+
universeId: { type: mongo.Schema.Types.ObjectId, ref: 'Universe' },
|
|
362
|
+
}, {
|
|
363
|
+
virtuals: [...addTagVirtuals('Galaxy'), ...addApplicationVirtual()],
|
|
364
|
+
});
|
|
365
|
+
export const Guide = createModel('Guide', {
|
|
366
|
+
content: { type: String },
|
|
367
|
+
gameId: { type: mongo.Schema.Types.ObjectId, ref: 'Game' },
|
|
368
|
+
attachments: [mongo.Schema.Types.Mixed],
|
|
369
|
+
}, {
|
|
370
|
+
virtuals: [...addTagVirtuals('Guide'), ...addApplicationVirtual()],
|
|
371
|
+
});
|
|
372
|
+
export const Idea = createModel('Idea', {
|
|
373
|
+
type: { type: String, max: 100 },
|
|
374
|
+
communityId: { type: mongo.Schema.Types.ObjectId, ref: 'Community' },
|
|
375
|
+
}, {
|
|
376
|
+
virtuals: [...addTagVirtuals('Idea'), ...addApplicationVirtual()],
|
|
377
|
+
});
|
|
378
|
+
export const Leaderboard = createModel('Leaderboard', {
|
|
379
|
+
productId: { type: mongo.Schema.Types.ObjectId, ref: 'Product' },
|
|
380
|
+
}, {
|
|
381
|
+
virtuals: [...addTagVirtuals('Leaderboard'), ...addApplicationVirtual()],
|
|
382
|
+
});
|
|
383
|
+
export const Log = createModel('Log', {
|
|
384
|
+
mod: { type: String, required: true },
|
|
385
|
+
messages: [mongo.Schema.Types.Mixed],
|
|
386
|
+
}, {
|
|
387
|
+
virtuals: [...addTagVirtuals('Log'), ...addApplicationVirtual()],
|
|
388
|
+
});
|
|
389
|
+
export const Lore = createModel('Lore', {
|
|
390
|
+
gameId: { type: mongo.Schema.Types.ObjectId, ref: 'Game' },
|
|
391
|
+
}, {
|
|
392
|
+
virtuals: [...addTagVirtuals('Lore'), ...addApplicationVirtual()],
|
|
393
|
+
});
|
|
394
|
+
export const Market = createModel('Market', {}, {
|
|
395
|
+
virtuals: [...addTagVirtuals('Market'), ...addApplicationVirtual()],
|
|
396
|
+
});
|
|
397
|
+
export const Memory = createModel('Memory', {}, {
|
|
398
|
+
virtuals: [...addTagVirtuals('Memory'), ...addApplicationVirtual()],
|
|
399
|
+
});
|
|
400
|
+
export const Message = createModel('Message', {
|
|
401
|
+
content: { type: String },
|
|
402
|
+
type: { type: String, max: 100 },
|
|
403
|
+
replyToId: { type: mongo.Schema.Types.ObjectId, ref: 'Message' },
|
|
404
|
+
parentId: { type: mongo.Schema.Types.ObjectId, ref: 'Message' },
|
|
405
|
+
conversationId: { type: mongo.Schema.Types.ObjectId, ref: 'Conversation' },
|
|
406
|
+
}, {
|
|
407
|
+
virtuals: [...addTagVirtuals('Message'), ...addApplicationVirtual()],
|
|
408
|
+
});
|
|
409
|
+
export const NewsArticle = createModel('NewsArticle', {
|
|
410
|
+
href: { type: String, required: true },
|
|
411
|
+
source: { type: String, required: true },
|
|
412
|
+
}, {
|
|
413
|
+
virtuals: [...addTagVirtuals('NewsArticle'), ...addApplicationVirtual()],
|
|
414
|
+
});
|
|
415
|
+
export const Npc = createModel('Npc', {
|
|
416
|
+
characterId: { type: mongo.Schema.Types.ObjectId, ref: 'Character' },
|
|
417
|
+
}, {
|
|
418
|
+
virtuals: [...addTagVirtuals('Npc'), ...addApplicationVirtual()],
|
|
419
|
+
});
|
|
420
|
+
export const Offer = createModel('Offer', {}, {
|
|
421
|
+
virtuals: [...addTagVirtuals('Offer'), ...addApplicationVirtual()],
|
|
422
|
+
});
|
|
423
|
+
export const Order = createModel('Order', {}, {
|
|
424
|
+
virtuals: [...addTagVirtuals('Order'), ...addApplicationVirtual()],
|
|
425
|
+
});
|
|
426
|
+
export const Payment = createModel('Payment', {
|
|
427
|
+
status: {
|
|
428
|
+
type: String,
|
|
429
|
+
default: 'Submitted',
|
|
430
|
+
enum: [
|
|
431
|
+
'Archived',
|
|
432
|
+
'Processing',
|
|
433
|
+
'Failed',
|
|
434
|
+
'Submitted',
|
|
435
|
+
'Denied',
|
|
436
|
+
'Processed',
|
|
437
|
+
'Voided',
|
|
438
|
+
'Completed',
|
|
439
|
+
'Refunding',
|
|
440
|
+
'Refunded',
|
|
441
|
+
'Expired',
|
|
442
|
+
],
|
|
443
|
+
},
|
|
444
|
+
}, {
|
|
445
|
+
virtuals: [{ name: 'owner' }, ...addTagVirtuals('Payment'), ...addApplicationVirtual()],
|
|
446
|
+
});
|
|
447
|
+
export const Permission = createModel('Permission', {
|
|
448
|
+
roles: [{ type: mongo.Schema.Types.ObjectId, ref: 'Role' }],
|
|
449
|
+
}, {
|
|
450
|
+
virtuals: [...addTagVirtuals('Permission'), ...addApplicationVirtual()],
|
|
451
|
+
});
|
|
452
|
+
export const Person = createModel('Person', {
|
|
453
|
+
content: { type: String },
|
|
454
|
+
companyId: { type: mongo.Schema.Types.ObjectId, ref: 'Company' },
|
|
455
|
+
}, {
|
|
456
|
+
virtuals: [...addTagVirtuals('Person'), ...addApplicationVirtual()],
|
|
457
|
+
});
|
|
458
|
+
export const Planet = createModel('Planet', {
|
|
459
|
+
solarSystemId: { type: mongo.Schema.Types.ObjectId, ref: 'SolarSystem' },
|
|
460
|
+
}, {
|
|
461
|
+
virtuals: [...addTagVirtuals('Planet'), ...addApplicationVirtual()],
|
|
462
|
+
});
|
|
463
|
+
export const Poll = createModel('Poll', {}, {
|
|
464
|
+
virtuals: [...addTagVirtuals('Poll'), ...addApplicationVirtual()],
|
|
465
|
+
});
|
|
466
|
+
export const Project = createModel('Project', {
|
|
467
|
+
content: { type: String },
|
|
468
|
+
contractStatus: { type: String, default: 'Pending' },
|
|
469
|
+
parentId: { type: mongo.Schema.Types.ObjectId, ref: 'Project' },
|
|
470
|
+
realmId: { type: mongo.Schema.Types.ObjectId, ref: 'Realm' },
|
|
471
|
+
communityId: { type: mongo.Schema.Types.ObjectId, ref: 'Community' },
|
|
472
|
+
productId: { type: mongo.Schema.Types.ObjectId, ref: 'Product' },
|
|
473
|
+
ratingId: { type: mongo.Schema.Types.ObjectId, ref: 'Rating' },
|
|
474
|
+
}, {
|
|
475
|
+
virtuals: [...addTagVirtuals('Project'), ...addApplicationVirtual()],
|
|
476
|
+
});
|
|
477
|
+
export const Proposal = createModel('Proposal', {
|
|
478
|
+
content: { type: String },
|
|
479
|
+
}, {
|
|
480
|
+
virtuals: [...addTagVirtuals('Proposal'), ...addApplicationVirtual()],
|
|
481
|
+
});
|
|
482
|
+
export const Quest = createModel('Quest', {
|
|
483
|
+
type: { type: String, default: 'zone' },
|
|
484
|
+
}, {
|
|
485
|
+
virtuals: [...addTagVirtuals('Quest'), ...addApplicationVirtual()],
|
|
486
|
+
});
|
|
487
|
+
export const Question = createModel('Question', {
|
|
488
|
+
topics: [mongo.Schema.Types.Mixed],
|
|
489
|
+
text: { type: String, required: true },
|
|
490
|
+
answer: { type: String, required: true },
|
|
491
|
+
popularity: { type: Number },
|
|
492
|
+
}, {
|
|
493
|
+
virtuals: [...addTagVirtuals('Question'), ...addApplicationVirtual()],
|
|
494
|
+
});
|
|
495
|
+
export const Rating = createModel('Rating', {
|
|
496
|
+
votes: [{ type: mongo.Schema.Types.ObjectId, ref: 'Vote' }],
|
|
497
|
+
}, {
|
|
498
|
+
virtuals: [...addTagVirtuals('Rating'), ...addApplicationVirtual()],
|
|
499
|
+
});
|
|
500
|
+
export const Realm = createModel('Realm', {
|
|
501
|
+
endpoint: { type: String },
|
|
502
|
+
status: { type: String },
|
|
503
|
+
clientCount: { type: Number },
|
|
504
|
+
regionCode: { type: String },
|
|
505
|
+
gameId: { type: mongo.Schema.Types.ObjectId, ref: 'Game', required: true },
|
|
506
|
+
}, {
|
|
507
|
+
virtuals: [
|
|
508
|
+
...addTagVirtuals('Realm'),
|
|
509
|
+
...addApplicationVirtual(),
|
|
510
|
+
{ name: 'realmShards' },
|
|
511
|
+
{ name: 'realmTraits' },
|
|
512
|
+
{ name: 'realmEvents' },
|
|
513
|
+
],
|
|
514
|
+
});
|
|
515
|
+
export const RealmEvent = createModel('RealmEvent', {
|
|
516
|
+
description: { type: String, required: true },
|
|
517
|
+
startDate: { type: Date, required: false },
|
|
518
|
+
endDate: { type: Date, required: false },
|
|
519
|
+
}, {
|
|
520
|
+
virtuals: [...addTagVirtuals('RealmEvent'), ...addApplicationVirtual()],
|
|
521
|
+
});
|
|
522
|
+
export const RealmTrait = createModel('RealmTrait', {
|
|
523
|
+
description: { type: String, required: true },
|
|
524
|
+
}, {
|
|
525
|
+
virtuals: [...addTagVirtuals('RealmTrait'), ...addApplicationVirtual()],
|
|
526
|
+
});
|
|
527
|
+
export const Referral = createModel('Referral', {
|
|
528
|
+
recipientId: { type: mongo.Schema.Types.ObjectId, ref: 'Profile', required: true },
|
|
529
|
+
senderId: { type: mongo.Schema.Types.ObjectId, ref: 'Profile', required: true },
|
|
530
|
+
}, {
|
|
531
|
+
virtuals: [...addTagVirtuals('Referral'), ...addApplicationVirtual()],
|
|
532
|
+
});
|
|
533
|
+
export const Review = createModel('Review', {
|
|
534
|
+
value: { type: String },
|
|
535
|
+
}, {
|
|
536
|
+
virtuals: [...addTagVirtuals('Review'), ...addApplicationVirtual()],
|
|
537
|
+
});
|
|
538
|
+
export const Role = createModel('Role', {
|
|
539
|
+
value: { type: String },
|
|
540
|
+
profiles: [{ type: mongo.Schema.Types.ObjectId, ref: 'Profile' }],
|
|
541
|
+
permissions: [{ type: mongo.Schema.Types.ObjectId, ref: 'Permission' }],
|
|
542
|
+
}, {
|
|
543
|
+
virtuals: [...addTagVirtuals('Role'), ...addApplicationVirtual()],
|
|
544
|
+
});
|
|
545
|
+
export const Season = createModel('Season', {}, {
|
|
546
|
+
virtuals: [...addTagVirtuals('Season'), ...addApplicationVirtual()],
|
|
547
|
+
});
|
|
548
|
+
export const RealmShard = createModel('RealmShard', {
|
|
549
|
+
realmId: { type: mongo.Schema.Types.ObjectId, ref: 'Realm' },
|
|
550
|
+
endpoint: { type: String },
|
|
551
|
+
status: { type: String },
|
|
552
|
+
clientCount: { type: Number },
|
|
553
|
+
}, {
|
|
554
|
+
virtuals: [...addTagVirtuals('RealmShard'), ...addApplicationVirtual()],
|
|
555
|
+
});
|
|
556
|
+
export const Session = createModel('Session', {
|
|
557
|
+
expired: { type: Date, required: true },
|
|
558
|
+
}, {
|
|
559
|
+
virtuals: [...addTagVirtuals('Session'), ...addApplicationVirtual()],
|
|
560
|
+
});
|
|
561
|
+
export const SolarSystem = createModel('SolarSystem', {
|
|
562
|
+
galaxyId: { type: mongo.Schema.Types.ObjectId, ref: 'Galaxy' },
|
|
563
|
+
}, {
|
|
564
|
+
virtuals: [...addTagVirtuals('SolarSystem'), ...addApplicationVirtual()],
|
|
565
|
+
});
|
|
566
|
+
export const Star = createModel('Star', {}, {
|
|
567
|
+
virtuals: [...addTagVirtuals('Star'), ...addApplicationVirtual()],
|
|
568
|
+
});
|
|
569
|
+
export const Stat = createModel('Stat', {
|
|
570
|
+
number: { type: Number, default: 0 },
|
|
571
|
+
}, {
|
|
572
|
+
virtuals: [...addTagVirtuals('Stat'), ...addApplicationVirtual()],
|
|
573
|
+
});
|
|
574
|
+
export const Stash = createModel('Stash', {}, {
|
|
575
|
+
virtuals: [...addTagVirtuals('Stash'), ...addApplicationVirtual()],
|
|
576
|
+
});
|
|
577
|
+
export const Stock = createModel('Stock', {
|
|
578
|
+
rank: { type: Number, min: 0 },
|
|
579
|
+
price: { type: Number, min: 0 },
|
|
580
|
+
hourChange: { type: Number },
|
|
581
|
+
dayChange: { type: Number },
|
|
582
|
+
weekChange: { type: Number },
|
|
583
|
+
marketCap: { type: Number, min: 0 },
|
|
584
|
+
volume: { type: Number, min: 0 },
|
|
585
|
+
ticker: { type: String },
|
|
586
|
+
unusualActivity: { type: Number, min: 0 },
|
|
587
|
+
}, {
|
|
588
|
+
virtuals: [...addTagVirtuals('Stock'), ...addApplicationVirtual()],
|
|
589
|
+
});
|
|
590
|
+
export const Suggestion = createModel('Suggestion', {
|
|
591
|
+
content: { type: String },
|
|
592
|
+
}, {
|
|
593
|
+
virtuals: [...addTagVirtuals('Suggestion'), ...addApplicationVirtual()],
|
|
594
|
+
});
|
|
595
|
+
export const Tag = createModel('Tag', {
|
|
596
|
+
value: { type: String },
|
|
597
|
+
}, {
|
|
598
|
+
virtuals: [...addApplicationVirtual()],
|
|
599
|
+
});
|
|
600
|
+
export const Team = createModel('Team', {
|
|
601
|
+
ratingId: { type: mongo.Schema.Types.ObjectId, ref: 'Rating' },
|
|
602
|
+
points: { type: Number, default: 0 },
|
|
603
|
+
memberCount: { type: Number, default: 0 },
|
|
604
|
+
}, {
|
|
605
|
+
virtuals: [
|
|
606
|
+
...addTagVirtuals('Team'),
|
|
607
|
+
...addApplicationVirtual(),
|
|
608
|
+
{
|
|
609
|
+
name: 'profiles',
|
|
610
|
+
ref: 'Profile',
|
|
611
|
+
localField: '_id',
|
|
612
|
+
foreignField: 'teamId',
|
|
613
|
+
},
|
|
614
|
+
],
|
|
615
|
+
});
|
|
616
|
+
export const Tournament = createModel('Tournament', {}, {
|
|
617
|
+
virtuals: [...addTagVirtuals('Tournament'), ...addApplicationVirtual()],
|
|
618
|
+
});
|
|
619
|
+
export const Trade = createModel('Trade', {
|
|
620
|
+
status: {
|
|
621
|
+
type: String,
|
|
622
|
+
default: 'Active',
|
|
623
|
+
enum: ['Paused', 'Pending', 'Active', 'Delisted', 'Sold'],
|
|
624
|
+
},
|
|
625
|
+
chainId: { type: mongo.Schema.Types.ObjectId, ref: 'Chain' },
|
|
626
|
+
buyerId: { type: mongo.Schema.Types.ObjectId, ref: 'Profile' },
|
|
627
|
+
parentId: { type: mongo.Schema.Types.ObjectId, ref: 'Trade' },
|
|
628
|
+
productId: { type: mongo.Schema.Types.ObjectId, ref: 'Product' },
|
|
629
|
+
sellerId: { type: mongo.Schema.Types.ObjectId, ref: 'Profile' },
|
|
630
|
+
tokenId: { type: mongo.Schema.Types.ObjectId, ref: 'ChainToken' },
|
|
631
|
+
}, {
|
|
632
|
+
virtuals: [...addTagVirtuals('Trade'), ...addApplicationVirtual()],
|
|
633
|
+
});
|
|
634
|
+
export const Universe = createModel('Universe', {}, {
|
|
635
|
+
virtuals: [...addTagVirtuals('Universe'), ...addApplicationVirtual()],
|
|
636
|
+
});
|
|
637
|
+
export const Validator = createModel('Validator', {}, {
|
|
638
|
+
virtuals: [...addTagVirtuals('Validator'), ...addApplicationVirtual()],
|
|
639
|
+
});
|
|
640
|
+
export const Vote = createModel('Vote', {
|
|
641
|
+
ratingId: { type: mongo.Schema.Types.ObjectId, ref: 'Rating' },
|
|
642
|
+
}, {
|
|
643
|
+
virtuals: [
|
|
644
|
+
{
|
|
645
|
+
name: 'parent',
|
|
646
|
+
ref: 'Node',
|
|
647
|
+
localField: '_id',
|
|
648
|
+
foreignField: 'from',
|
|
649
|
+
justOne: true,
|
|
650
|
+
match: { fromModel: 'Vote' },
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
name: 'owner',
|
|
654
|
+
ref: 'Profile',
|
|
655
|
+
localField: '_id',
|
|
656
|
+
foreignField: '_id',
|
|
657
|
+
justOne: true,
|
|
658
|
+
},
|
|
659
|
+
...addTagVirtuals('Vote'),
|
|
660
|
+
...addApplicationVirtual(),
|
|
661
|
+
],
|
|
662
|
+
});
|
|
663
|
+
export const WorldEvent = createModel('WorldEvent', {
|
|
664
|
+
text: { type: String, required: true },
|
|
665
|
+
importance: { type: Number },
|
|
666
|
+
}, {
|
|
667
|
+
virtuals: [...addTagVirtuals('WorldEvent'), ...addApplicationVirtual()],
|
|
668
|
+
});
|
|
669
|
+
export const WorldRecord = createModel('WorldRecord', {
|
|
670
|
+
holderId: { type: mongo.Schema.Types.ObjectId, ref: 'Profile' },
|
|
671
|
+
score: { type: Number },
|
|
672
|
+
}, {
|
|
673
|
+
virtuals: [
|
|
674
|
+
{
|
|
675
|
+
name: 'holder',
|
|
676
|
+
ref: 'Profile',
|
|
677
|
+
localField: '_id',
|
|
678
|
+
foreignField: '_id',
|
|
679
|
+
justOne: true,
|
|
680
|
+
},
|
|
681
|
+
...addTagVirtuals('WorldRecord'),
|
|
682
|
+
...addApplicationVirtual(),
|
|
683
|
+
],
|
|
684
|
+
});
|
|
685
|
+
export const Node = createModel('Node', {
|
|
686
|
+
relationKey: { type: String, required: true },
|
|
687
|
+
fromModel: { type: String, required: true },
|
|
688
|
+
from: { type: mongo.Schema.Types.ObjectId, required: true },
|
|
689
|
+
toModel: { type: String, required: true },
|
|
690
|
+
to: { type: mongo.Schema.Types.ObjectId, required: true },
|
|
691
|
+
}, {
|
|
692
|
+
indexes: [
|
|
693
|
+
{ fromModel: 1, from: 1 },
|
|
694
|
+
{ toModel: 1, to: 1 },
|
|
695
|
+
],
|
|
696
|
+
});
|
|
697
|
+
export const Prefab = createModel('Prefab', {
|
|
698
|
+
name: { type: String, required: true },
|
|
699
|
+
fbxPath: { type: String, required: true },
|
|
700
|
+
customizationOptions: { type: mongo.Schema.Types.Mixed },
|
|
701
|
+
childPrefabs: [
|
|
702
|
+
{
|
|
703
|
+
prefabId: { type: mongo.Schema.Types.ObjectId, ref: 'Prefab' },
|
|
704
|
+
position: { type: mongo.Schema.Types.Mixed },
|
|
705
|
+
rotation: { type: mongo.Schema.Types.Mixed },
|
|
706
|
+
scale: { type: Number, default: 1.0 },
|
|
707
|
+
},
|
|
708
|
+
],
|
|
709
|
+
}, {
|
|
710
|
+
extend: 'EntityFields',
|
|
711
|
+
virtuals: [...addTagVirtuals('Prefab'), ...addApplicationVirtual()],
|
|
712
|
+
});
|
|
713
|
+
export const Object = createModel('Object', {
|
|
714
|
+
prefabId: { type: mongo.Schema.Types.ObjectId, ref: 'Prefab', required: true },
|
|
715
|
+
rotation: { type: mongo.Schema.Types.Mixed },
|
|
716
|
+
scale: { type: Number, default: 1.0 },
|
|
717
|
+
customizations: { type: mongo.Schema.Types.Mixed },
|
|
718
|
+
childInstances: [
|
|
719
|
+
{
|
|
720
|
+
prefabId: { type: mongo.Schema.Types.ObjectId, ref: 'Prefab' },
|
|
721
|
+
worldCoordinates: { type: mongo.Schema.Types.Mixed },
|
|
722
|
+
rotation: { type: mongo.Schema.Types.Mixed },
|
|
723
|
+
scale: { type: Number, default: 1.0 },
|
|
724
|
+
},
|
|
725
|
+
],
|
|
726
|
+
}, {
|
|
727
|
+
extend: 'EntityFields',
|
|
728
|
+
virtuals: [...addTagVirtuals('Object'), ...addApplicationVirtual()],
|
|
729
|
+
});
|
|
730
|
+
export const ObjectInteraction = createModel('ObjectInteraction', {
|
|
731
|
+
profileId: { type: mongo.Schema.Types.ObjectId, ref: 'Profile', required: true },
|
|
732
|
+
objectId: { type: mongo.Schema.Types.ObjectId, ref: 'Object', required: true },
|
|
733
|
+
interactionType: { type: String, enum: ['use', 'fight', 'open', 'talk'], required: true },
|
|
734
|
+
outcome: { type: mongo.Schema.Types.Mixed },
|
|
735
|
+
}, {
|
|
736
|
+
extend: 'EntityFields',
|
|
737
|
+
virtuals: [...addTagVirtuals('Interaction'), ...addApplicationVirtual()],
|
|
738
|
+
});
|
|
739
|
+
export const Party = createModel('Party', {
|
|
740
|
+
targetAreaId: { type: mongo.Schema.Types.ObjectId, ref: 'Area', required: false },
|
|
741
|
+
limit: { type: Number, default: 6 },
|
|
742
|
+
isPublic: { type: Boolean, default: true },
|
|
743
|
+
isVisibleToEnemies: { type: Boolean, default: true },
|
|
744
|
+
isApprovalRequired: { type: Boolean, default: false },
|
|
745
|
+
isNonLeaderInviteAllowed: { type: Boolean, default: false },
|
|
746
|
+
isCombatEnabled: { type: Boolean, default: true },
|
|
747
|
+
isFriendlyFireEnabled: { type: Boolean, default: true },
|
|
748
|
+
isLocalQuestShared: { type: Boolean, default: true },
|
|
749
|
+
isGlobalQuestShared: { type: Boolean, default: true },
|
|
750
|
+
isMergeEnabled: { type: Boolean, default: false },
|
|
751
|
+
isRejoinEnabled: { type: Boolean, default: false },
|
|
752
|
+
itemDistribution: {
|
|
753
|
+
type: String,
|
|
754
|
+
enum: ['Random', 'Personal'],
|
|
755
|
+
required: true,
|
|
756
|
+
},
|
|
757
|
+
leaderId: { type: mongo.Schema.Types.ObjectId, ref: 'Profile', required: false },
|
|
758
|
+
powerRequired: { type: Number, required: true, default: 1 },
|
|
759
|
+
levelRequired: { type: Number, required: true, default: 1 },
|
|
760
|
+
approvalMethod: {
|
|
761
|
+
type: String,
|
|
762
|
+
enum: ['Auto Accept', 'Approval Required'],
|
|
763
|
+
required: true,
|
|
764
|
+
},
|
|
765
|
+
memberIds: [{ type: mongo.Schema.Types.ObjectId, ref: 'Profile' }],
|
|
766
|
+
assistantIds: [{ type: mongo.Schema.Types.ObjectId, ref: 'Profile' }],
|
|
767
|
+
pendingMemberIds: [{ type: mongo.Schema.Types.ObjectId, ref: 'Profile' }],
|
|
768
|
+
blockedMemberIds: [{ type: mongo.Schema.Types.ObjectId, ref: 'Profile' }],
|
|
769
|
+
}, {
|
|
770
|
+
virtuals: [
|
|
771
|
+
{ name: 'owner' },
|
|
772
|
+
{
|
|
773
|
+
name: 'members',
|
|
774
|
+
ref: 'Profile',
|
|
775
|
+
localField: '_id',
|
|
776
|
+
foreignField: 'partyId',
|
|
777
|
+
},
|
|
778
|
+
...addTagVirtuals('Party'),
|
|
779
|
+
...addApplicationVirtual(),
|
|
780
|
+
],
|
|
781
|
+
});
|
|
782
|
+
export const SeerEvent = mongo.createModel('SeerEvent', {
|
|
783
|
+
kind: { type: String, required: true },
|
|
784
|
+
operation: {
|
|
785
|
+
type: String,
|
|
786
|
+
enum: ['create', 'update', 'delete'],
|
|
787
|
+
required: true,
|
|
788
|
+
},
|
|
789
|
+
recordId: { type: String, required: true },
|
|
790
|
+
applicationId: { type: mongo.Schema.Types.ObjectId, ref: 'Application' },
|
|
791
|
+
payload: { type: mongo.Schema.Types.Mixed, required: true },
|
|
792
|
+
seq: { type: Number, required: true, index: true },
|
|
793
|
+
timestamp: { type: Date, default: Date.now, index: true },
|
|
794
|
+
}, {
|
|
795
|
+
indexes: [{ seq: 1 }, { timestamp: 1 }],
|
|
796
|
+
});
|
|
797
|
+
export const SeerPayload = mongo.createModel('SeerPayload', {
|
|
798
|
+
fromSeer: { type: String, required: true },
|
|
799
|
+
applicationId: { type: mongo.Schema.Types.ObjectId, ref: 'Application' },
|
|
800
|
+
events: {
|
|
801
|
+
type: [mongo.Schema.Types.Mixed],
|
|
802
|
+
default: [],
|
|
803
|
+
},
|
|
804
|
+
eventsHash: { type: String, required: true },
|
|
805
|
+
merkleRoot: { type: String, required: true },
|
|
806
|
+
proof: { type: mongo.Schema.Types.Mixed, required: true },
|
|
807
|
+
publicSignals: { type: [String], default: [] },
|
|
808
|
+
}, {
|
|
809
|
+
indexes: [{ createdDate: 1 }],
|
|
810
|
+
});
|
|
811
|
+
//# sourceMappingURL=core.models.js.map
|