@arken/node 1.5.1 → 1.5.3
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 +39 -82
- package/build/api.js.map +1 -0
- package/build/array.js.map +1 -0
- package/build/browser.js.map +1 -0
- package/build/codebase.js.map +1 -0
- package/build/config.js.map +1 -0
- package/build/db.d.ts +41 -0
- package/build/db.js +234 -0
- package/build/db.js.map +1 -0
- package/build/{util/decoder.js → decoder.js} +3 -3
- package/build/decoder.js.map +1 -0
- package/build/format.js.map +1 -0
- package/build/guid.js.map +1 -0
- package/build/index.d.ts +70 -18
- package/build/index.js +216 -18
- package/build/index.js.map +1 -1
- package/build/json.js.map +1 -0
- package/build/legacy/data/items.js +1 -1
- package/build/legacy/data/items.js.map +1 -1
- package/build/log.d.ts +5 -0
- package/build/log.js +28 -0
- package/build/log.js.map +1 -0
- package/build/math.js.map +1 -0
- package/build/{util/merkle.js → merkle.js} +1 -1
- package/build/merkle.js.map +1 -0
- package/build/{util/mongo.js → mongo.js} +1 -1
- package/build/mongo.js.map +1 -0
- package/build/number.js.map +1 -0
- package/build/object.js.map +1 -0
- package/build/otp.js.map +1 -0
- package/build/package.json +3 -3
- package/build/physics.js.map +1 -0
- package/build/{util/process.js → process.js} +1 -1
- package/build/process.js.map +1 -0
- package/build/rpc.js.map +1 -0
- package/build/schema.d.ts +42 -51
- package/build/seer.js.map +1 -0
- package/build/string.js.map +1 -0
- package/build/text.js.map +1 -0
- package/build/time/date.js.map +1 -0
- package/build/time/fancyTimeFormat.js.map +1 -0
- package/build/time/index.js.map +1 -0
- package/build/time/now.js.map +1 -0
- package/build/trpc/socketLink.d.ts +62 -0
- package/build/trpc/socketLink.js +261 -0
- package/build/trpc/socketLink.js.map +1 -0
- package/build/trpc/socketServer.d.ts +15 -0
- package/build/trpc/socketServer.js +47 -0
- package/build/trpc/socketServer.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/util.d.ts +1 -0
- package/build/util.js +2 -0
- package/build/util.js.map +1 -0
- package/build/web3/httpProvider.js.map +1 -0
- package/build/{util/web3.js → web3.js} +1 -1
- package/build/web3.js.map +1 -0
- package/build/{util/websocket.js → websocket.js} +1 -1
- package/build/websocket.js.map +1 -0
- package/build/zk.js.map +1 -0
- package/build/{util/zod.d.ts → zod.d.ts} +2 -0
- package/build/{util/zod.js → zod.js} +1 -0
- package/build/zod.js.map +1 -0
- package/db.ts +76 -1
- package/{util/decoder.ts → decoder.ts} +3 -3
- package/index.ts +306 -18
- package/legacy/data/items.ts +1 -1
- package/log.ts +51 -0
- package/{util/merkle.ts → merkle.ts} +3 -1
- package/{util/mongo.ts → mongo.ts} +1 -1
- package/package.json +3 -3
- package/{util/process.ts → process.ts} +1 -1
- package/trpc/socketLink.ts +2 -2
- package/trpc/socketServer.ts +1 -1
- package/tsconfig.json +35 -6
- package/util.ts +1 -0
- package/{util/web3.ts → web3.ts} +2 -1
- package/{util/websocket.ts → websocket.ts} +1 -1
- package/{util/zod.ts → zod.ts} +2 -0
- package/build/modules/area/area.models.d.ts +0 -6
- package/build/modules/area/area.models.js +0 -11
- package/build/modules/area/area.models.js.map +0 -1
- package/build/modules/area/area.router.d.ts +0 -274
- package/build/modules/area/area.router.js +0 -59
- package/build/modules/area/area.router.js.map +0 -1
- package/build/modules/area/area.schema.d.ts +0 -245
- package/build/modules/area/area.schema.js +0 -13
- package/build/modules/area/area.schema.js.map +0 -1
- package/build/modules/area/area.service.d.ts +0 -12
- package/build/modules/area/area.service.js +0 -95
- package/build/modules/area/area.service.js.map +0 -1
- package/build/modules/area/area.types.d.ts +0 -20
- package/build/modules/area/area.types.js +0 -2
- package/build/modules/area/area.types.js.map +0 -1
- package/build/modules/area/index.d.ts +0 -5
- package/build/modules/area/index.js +0 -6
- package/build/modules/area/index.js.map +0 -1
- package/build/modules/asset/asset.models.d.ts +0 -5
- package/build/modules/asset/asset.models.js +0 -44
- package/build/modules/asset/asset.models.js.map +0 -1
- package/build/modules/asset/asset.router.d.ts +0 -189
- package/build/modules/asset/asset.router.js +0 -41
- package/build/modules/asset/asset.router.js.map +0 -1
- package/build/modules/asset/asset.schema.d.ts +0 -207
- package/build/modules/asset/asset.schema.js +0 -19
- package/build/modules/asset/asset.schema.js.map +0 -1
- package/build/modules/asset/asset.service.d.ts +0 -9
- package/build/modules/asset/asset.service.js +0 -68
- package/build/modules/asset/asset.service.js.map +0 -1
- package/build/modules/asset/asset.types.d.ts +0 -17
- package/build/modules/asset/asset.types.js +0 -2
- package/build/modules/asset/asset.types.js.map +0 -1
- package/build/modules/asset/index.d.ts +0 -5
- package/build/modules/asset/index.js +0 -6
- package/build/modules/asset/index.js.map +0 -1
- package/build/modules/chain/chain.models.d.ts +0 -6
- package/build/modules/chain/chain.models.js +0 -42
- package/build/modules/chain/chain.models.js.map +0 -1
- package/build/modules/chain/chain.router.d.ts +0 -364
- package/build/modules/chain/chain.router.js +0 -84
- package/build/modules/chain/chain.router.js.map +0 -1
- package/build/modules/chain/chain.schema.d.ts +0 -323
- package/build/modules/chain/chain.schema.js +0 -41
- package/build/modules/chain/chain.schema.js.map +0 -1
- package/build/modules/chain/chain.service.d.ts +0 -15
- package/build/modules/chain/chain.service.js +0 -115
- package/build/modules/chain/chain.service.js.map +0 -1
- package/build/modules/chain/chain.types.d.ts +0 -20
- package/build/modules/chain/chain.types.js +0 -2
- package/build/modules/chain/chain.types.js.map +0 -1
- package/build/modules/chain/index.d.ts +0 -5
- package/build/modules/chain/index.js +0 -6
- package/build/modules/chain/index.js.map +0 -1
- package/build/modules/character/character.models.d.ts +0 -14
- package/build/modules/character/character.models.js +0 -123
- package/build/modules/character/character.models.js.map +0 -1
- package/build/modules/character/character.router.d.ts +0 -945
- package/build/modules/character/character.router.js +0 -246
- package/build/modules/character/character.router.js.map +0 -1
- package/build/modules/character/character.schema.d.ts +0 -1239
- package/build/modules/character/character.schema.js +0 -67
- package/build/modules/character/character.schema.js.map +0 -1
- package/build/modules/character/character.service.d.ts +0 -73
- package/build/modules/character/character.service.js +0 -533
- package/build/modules/character/character.service.js.map +0 -1
- package/build/modules/character/character.types.d.ts +0 -48
- package/build/modules/character/character.types.js +0 -2
- package/build/modules/character/character.types.js.map +0 -1
- package/build/modules/character/index.d.ts +0 -5
- package/build/modules/character/index.js +0 -6
- package/build/modules/character/index.js.map +0 -1
- package/build/modules/chat/chat.models.d.ts +0 -4
- package/build/modules/chat/chat.models.js +0 -35
- package/build/modules/chat/chat.models.js.map +0 -1
- package/build/modules/chat/chat.router.d.ts +0 -223
- package/build/modules/chat/chat.router.js +0 -51
- package/build/modules/chat/chat.router.js.map +0 -1
- package/build/modules/chat/chat.schema.d.ts +0 -183
- package/build/modules/chat/chat.schema.js +0 -29
- package/build/modules/chat/chat.schema.js.map +0 -1
- package/build/modules/chat/chat.service.d.ts +0 -12
- package/build/modules/chat/chat.service.js +0 -85
- package/build/modules/chat/chat.service.js.map +0 -1
- package/build/modules/chat/chat.types.d.ts +0 -14
- package/build/modules/chat/chat.types.js +0 -2
- package/build/modules/chat/chat.types.js.map +0 -1
- package/build/modules/chat/index.d.ts +0 -5
- package/build/modules/chat/index.js +0 -6
- package/build/modules/chat/index.js.map +0 -1
- package/build/modules/collection/collection.models.d.ts +0 -9
- package/build/modules/collection/collection.models.js +0 -69
- package/build/modules/collection/collection.models.js.map +0 -1
- package/build/modules/collection/collection.router.d.ts +0 -361
- package/build/modules/collection/collection.router.js +0 -71
- package/build/modules/collection/collection.router.js.map +0 -1
- package/build/modules/collection/collection.schema.d.ts +0 -676
- package/build/modules/collection/collection.schema.js +0 -70
- package/build/modules/collection/collection.schema.js.map +0 -1
- package/build/modules/collection/collection.service.d.ts +0 -15
- package/build/modules/collection/collection.service.js +0 -117
- package/build/modules/collection/collection.service.js.map +0 -1
- package/build/modules/collection/collection.types.d.ts +0 -29
- package/build/modules/collection/collection.types.js +0 -2
- package/build/modules/collection/collection.types.js.map +0 -1
- package/build/modules/collection/index.d.ts +0 -5
- package/build/modules/collection/index.js +0 -6
- package/build/modules/collection/index.js.map +0 -1
- package/build/modules/core/core.models.d.ts +0 -123
- package/build/modules/core/core.models.js +0 -811
- package/build/modules/core/core.models.js.map +0 -1
- package/build/modules/core/core.router.d.ts +0 -5297
- package/build/modules/core/core.router.js +0 -1372
- package/build/modules/core/core.router.js.map +0 -1
- package/build/modules/core/core.schema.d.ts +0 -5918
- package/build/modules/core/core.schema.js +0 -519
- package/build/modules/core/core.schema.js.map +0 -1
- package/build/modules/core/core.service.d.ts +0 -270
- package/build/modules/core/core.service.js +0 -2515
- package/build/modules/core/core.service.js.map +0 -1
- package/build/modules/core/core.types.d.ts +0 -251
- package/build/modules/core/core.types.js +0 -2
- package/build/modules/core/core.types.js.map +0 -1
- package/build/modules/core/index.d.ts +0 -5
- package/build/modules/core/index.js +0 -6
- package/build/modules/core/index.js.map +0 -1
- package/build/modules/core/mail/applyPatchesOrMail.d.ts +0 -72
- package/build/modules/core/mail/applyPatchesOrMail.js +0 -416
- package/build/modules/core/mail/applyPatchesOrMail.js.map +0 -1
- package/build/modules/core/mail/mailClaimablePatchesBatch.d.ts +0 -51
- package/build/modules/core/mail/mailClaimablePatchesBatch.js +0 -239
- package/build/modules/core/mail/mailClaimablePatchesBatch.js.map +0 -1
- package/build/modules/game/game.models.d.ts +0 -6
- package/build/modules/game/game.models.js +0 -29
- package/build/modules/game/game.models.js.map +0 -1
- package/build/modules/game/game.router.d.ts +0 -428
- package/build/modules/game/game.router.js +0 -90
- package/build/modules/game/game.router.js.map +0 -1
- package/build/modules/game/game.schema.d.ts +0 -344
- package/build/modules/game/game.schema.js +0 -14
- package/build/modules/game/game.schema.js.map +0 -1
- package/build/modules/game/game.service.d.ts +0 -16
- package/build/modules/game/game.service.js +0 -111
- package/build/modules/game/game.service.js.map +0 -1
- package/build/modules/game/game.types.d.ts +0 -20
- package/build/modules/game/game.types.js +0 -2
- package/build/modules/game/game.types.js.map +0 -1
- package/build/modules/game/index.d.ts +0 -5
- package/build/modules/game/index.js +0 -5
- package/build/modules/game/index.js.map +0 -1
- package/build/modules/interface/index.d.ts +0 -5
- package/build/modules/interface/index.js +0 -6
- package/build/modules/interface/index.js.map +0 -1
- package/build/modules/interface/interface.canonicalize.d.ts +0 -2
- package/build/modules/interface/interface.canonicalize.js +0 -241
- package/build/modules/interface/interface.canonicalize.js.map +0 -1
- package/build/modules/interface/interface.models.d.ts +0 -6
- package/build/modules/interface/interface.models.js +0 -30
- package/build/modules/interface/interface.models.js.map +0 -1
- package/build/modules/interface/interface.router.d.ts +0 -472
- package/build/modules/interface/interface.router.js +0 -113
- package/build/modules/interface/interface.router.js.map +0 -1
- package/build/modules/interface/interface.schema.d.ts +0 -313
- package/build/modules/interface/interface.schema.js +0 -36
- package/build/modules/interface/interface.schema.js.map +0 -1
- package/build/modules/interface/interface.service.d.ts +0 -19
- package/build/modules/interface/interface.service.js +0 -168
- package/build/modules/interface/interface.service.js.map +0 -1
- package/build/modules/interface/interface.types.d.ts +0 -19
- package/build/modules/interface/interface.types.js +0 -2
- package/build/modules/interface/interface.types.js.map +0 -1
- package/build/modules/item/index.d.ts +0 -5
- package/build/modules/item/index.js +0 -6
- package/build/modules/item/index.js.map +0 -1
- package/build/modules/item/item.models.d.ts +0 -16
- package/build/modules/item/item.models.js +0 -101
- package/build/modules/item/item.models.js.map +0 -1
- package/build/modules/item/item.router.d.ts +0 -263
- package/build/modules/item/item.router.js +0 -70
- package/build/modules/item/item.router.js.map +0 -1
- package/build/modules/item/item.schema.d.ts +0 -778
- package/build/modules/item/item.schema.js +0 -56
- package/build/modules/item/item.schema.js.map +0 -1
- package/build/modules/item/item.service.d.ts +0 -13
- package/build/modules/item/item.service.js +0 -116
- package/build/modules/item/item.service.js.map +0 -1
- package/build/modules/item/item.types.d.ts +0 -55
- package/build/modules/item/item.types.js +0 -2
- package/build/modules/item/item.types.js.map +0 -1
- package/build/modules/job/index.d.ts +0 -5
- package/build/modules/job/index.js +0 -6
- package/build/modules/job/index.js.map +0 -1
- package/build/modules/job/job.models.d.ts +0 -3
- package/build/modules/job/job.models.js +0 -9
- package/build/modules/job/job.models.js.map +0 -1
- package/build/modules/job/job.router.d.ts +0 -146
- package/build/modules/job/job.router.js +0 -32
- package/build/modules/job/job.router.js.map +0 -1
- package/build/modules/job/job.schema.d.ts +0 -67
- package/build/modules/job/job.schema.js +0 -7
- package/build/modules/job/job.schema.js.map +0 -1
- package/build/modules/job/job.service.d.ts +0 -7
- package/build/modules/job/job.service.js +0 -144
- package/build/modules/job/job.service.js.map +0 -1
- package/build/modules/job/job.types.d.ts +0 -16
- package/build/modules/job/job.types.js +0 -2
- package/build/modules/job/job.types.js.map +0 -1
- package/build/modules/market/index.d.ts +0 -5
- package/build/modules/market/index.js +0 -6
- package/build/modules/market/index.js.map +0 -1
- package/build/modules/market/market.models.d.ts +0 -14
- package/build/modules/market/market.models.js +0 -98
- package/build/modules/market/market.models.js.map +0 -1
- package/build/modules/market/market.router.d.ts +0 -230
- package/build/modules/market/market.router.js +0 -56
- package/build/modules/market/market.router.js.map +0 -1
- package/build/modules/market/market.schema.d.ts +0 -949
- package/build/modules/market/market.schema.js +0 -101
- package/build/modules/market/market.schema.js.map +0 -1
- package/build/modules/market/market.service.d.ts +0 -12
- package/build/modules/market/market.service.js +0 -88
- package/build/modules/market/market.service.js.map +0 -1
- package/build/modules/market/market.types.d.ts +0 -49
- package/build/modules/market/market.types.js +0 -2
- package/build/modules/market/market.types.js.map +0 -1
- package/build/modules/product/index.d.ts +0 -5
- package/build/modules/product/index.js +0 -6
- package/build/modules/product/index.js.map +0 -1
- package/build/modules/product/product.models.d.ts +0 -4
- package/build/modules/product/product.models.js +0 -113
- package/build/modules/product/product.models.js.map +0 -1
- package/build/modules/product/product.router.d.ts +0 -447
- package/build/modules/product/product.router.js +0 -71
- package/build/modules/product/product.router.js.map +0 -1
- package/build/modules/product/product.schema.d.ts +0 -654
- package/build/modules/product/product.schema.js +0 -117
- package/build/modules/product/product.schema.js.map +0 -1
- package/build/modules/product/product.service.d.ts +0 -15
- package/build/modules/product/product.service.js +0 -115
- package/build/modules/product/product.service.js.map +0 -1
- package/build/modules/product/product.types.d.ts +0 -28
- package/build/modules/product/product.types.js +0 -2
- package/build/modules/product/product.types.js.map +0 -1
- package/build/modules/profile/index.d.ts +0 -5
- package/build/modules/profile/index.js +0 -6
- package/build/modules/profile/index.js.map +0 -1
- package/build/modules/profile/profile.models.d.ts +0 -2
- package/build/modules/profile/profile.models.js +0 -165
- package/build/modules/profile/profile.models.js.map +0 -1
- package/build/modules/profile/profile.router.d.ts +0 -163
- package/build/modules/profile/profile.router.js +0 -54
- package/build/modules/profile/profile.router.js.map +0 -1
- package/build/modules/profile/profile.schema.d.ts +0 -1
- package/build/modules/profile/profile.schema.js +0 -138
- package/build/modules/profile/profile.schema.js.map +0 -1
- package/build/modules/profile/profile.service.d.ts +0 -11
- package/build/modules/profile/profile.service.js +0 -120
- package/build/modules/profile/profile.service.js.map +0 -1
- package/build/modules/profile/profile.types.d.ts +0 -16
- package/build/modules/profile/profile.types.js +0 -2
- package/build/modules/profile/profile.types.js.map +0 -1
- package/build/modules/raffle/index.d.ts +0 -5
- package/build/modules/raffle/index.js +0 -6
- package/build/modules/raffle/index.js.map +0 -1
- package/build/modules/raffle/raffle.models.d.ts +0 -6
- package/build/modules/raffle/raffle.models.js +0 -36
- package/build/modules/raffle/raffle.models.js.map +0 -1
- package/build/modules/raffle/raffle.router.d.ts +0 -299
- package/build/modules/raffle/raffle.router.js +0 -71
- package/build/modules/raffle/raffle.router.js.map +0 -1
- package/build/modules/raffle/raffle.schema.d.ts +0 -265
- package/build/modules/raffle/raffle.schema.js +0 -21
- package/build/modules/raffle/raffle.schema.js.map +0 -1
- package/build/modules/raffle/raffle.service.d.ts +0 -15
- package/build/modules/raffle/raffle.service.js +0 -115
- package/build/modules/raffle/raffle.service.js.map +0 -1
- package/build/modules/raffle/raffle.types.d.ts +0 -25
- package/build/modules/raffle/raffle.types.js +0 -2
- package/build/modules/raffle/raffle.types.js.map +0 -1
- package/build/modules/skill/index.d.ts +0 -5
- package/build/modules/skill/index.js +0 -6
- package/build/modules/skill/index.js.map +0 -1
- package/build/modules/skill/skill.models.d.ts +0 -9
- package/build/modules/skill/skill.models.js +0 -9
- package/build/modules/skill/skill.models.js.map +0 -1
- package/build/modules/skill/skill.router.d.ts +0 -659
- package/build/modules/skill/skill.router.js +0 -152
- package/build/modules/skill/skill.router.js.map +0 -1
- package/build/modules/skill/skill.schema.d.ts +0 -548
- package/build/modules/skill/skill.schema.js +0 -26
- package/build/modules/skill/skill.schema.js.map +0 -1
- package/build/modules/skill/skill.service.d.ts +0 -32
- package/build/modules/skill/skill.service.js +0 -279
- package/build/modules/skill/skill.service.js.map +0 -1
- package/build/modules/skill/skill.types.d.ts +0 -29
- package/build/modules/skill/skill.types.js +0 -2
- package/build/modules/skill/skill.types.js.map +0 -1
- package/build/modules/video/index.d.ts +0 -5
- package/build/modules/video/index.js +0 -6
- package/build/modules/video/index.js.map +0 -1
- package/build/modules/video/video.models.d.ts +0 -7
- package/build/modules/video/video.models.js +0 -19
- package/build/modules/video/video.models.js.map +0 -1
- package/build/modules/video/video.router.d.ts +0 -563
- package/build/modules/video/video.router.js +0 -112
- package/build/modules/video/video.router.js.map +0 -1
- package/build/modules/video/video.schema.d.ts +0 -456
- package/build/modules/video/video.schema.js +0 -31
- package/build/modules/video/video.schema.js.map +0 -1
- package/build/modules/video/video.service.d.ts +0 -23
- package/build/modules/video/video.service.js +0 -197
- package/build/modules/video/video.service.js.map +0 -1
- package/build/modules/video/video.types.d.ts +0 -28
- package/build/modules/video/video.types.js +0 -2
- package/build/modules/video/video.types.js.map +0 -1
- package/build/router.d.ts +0 -10406
- package/build/router.js +0 -44
- package/build/router.js.map +0 -1
- package/build/types.d.ts +0 -164
- package/build/types.js +0 -19
- package/build/types.js.map +0 -1
- package/build/util/api.js.map +0 -1
- package/build/util/array.js.map +0 -1
- package/build/util/browser.js.map +0 -1
- package/build/util/codebase.js.map +0 -1
- package/build/util/config.js.map +0 -1
- package/build/util/db/index.d.ts +0 -5
- package/build/util/db/index.js +0 -7
- package/build/util/db/index.js.map +0 -1
- package/build/util/db/isPostgresError.d.ts +0 -2
- package/build/util/db/isPostgresError.js +0 -8
- package/build/util/db/isPostgresError.js.map +0 -1
- package/build/util/db/isUniqueConstraintViolation.d.ts +0 -2
- package/build/util/db/isUniqueConstraintViolation.js +0 -3
- package/build/util/db/isUniqueConstraintViolation.js.map +0 -1
- package/build/util/db.d.ts +0 -6
- package/build/util/db.js +0 -51
- package/build/util/db.js.map +0 -1
- package/build/util/decoder.js.map +0 -1
- package/build/util/decoder.test.d.ts +0 -1
- package/build/util/decoder.test.js +0 -7
- package/build/util/decoder.test.js.map +0 -1
- package/build/util/format.js.map +0 -1
- package/build/util/guid.js.map +0 -1
- package/build/util/index.d.ts +0 -74
- package/build/util/index.js +0 -239
- package/build/util/index.js.map +0 -1
- package/build/util/json.js.map +0 -1
- package/build/util/log.d.ts +0 -1
- package/build/util/log.js +0 -6
- package/build/util/log.js.map +0 -1
- package/build/util/math.js.map +0 -1
- package/build/util/merkle.js.map +0 -1
- package/build/util/mongo.js.map +0 -1
- package/build/util/number.js.map +0 -1
- package/build/util/object.js.map +0 -1
- package/build/util/otp.js.map +0 -1
- package/build/util/physics.js.map +0 -1
- package/build/util/process.js.map +0 -1
- package/build/util/rpc.js.map +0 -1
- package/build/util/seer.js.map +0 -1
- package/build/util/string.js.map +0 -1
- package/build/util/text.js.map +0 -1
- package/build/util/time/date.js.map +0 -1
- package/build/util/time/fancyTimeFormat.js.map +0 -1
- package/build/util/time/index.js.map +0 -1
- package/build/util/time/now.js.map +0 -1
- package/build/util/web3/httpProvider.js.map +0 -1
- package/build/util/web3.js.map +0 -1
- package/build/util/websocket.js.map +0 -1
- package/build/util/zk.js.map +0 -1
- package/build/util/zod.js.map +0 -1
- package/modules/area/area.models.ts +0 -15
- package/modules/area/area.router.ts +0 -74
- package/modules/area/area.schema.ts +0 -22
- package/modules/area/area.service.ts +0 -124
- package/modules/area/area.types.ts +0 -26
- package/modules/area/index.ts +0 -5
- package/modules/asset/asset.models.ts +0 -59
- package/modules/asset/asset.router.ts +0 -55
- package/modules/asset/asset.schema.ts +0 -27
- package/modules/asset/asset.service.ts +0 -85
- package/modules/asset/asset.types.ts +0 -22
- package/modules/asset/index.ts +0 -5
- package/modules/chain/chain.models.ts +0 -50
- package/modules/chain/chain.router.ts +0 -104
- package/modules/chain/chain.schema.ts +0 -52
- package/modules/chain/chain.service.ts +0 -167
- package/modules/chain/chain.types.ts +0 -24
- package/modules/chain/index.ts +0 -5
- package/modules/character/character.models.ts +0 -174
- package/modules/character/character.router.ts +0 -314
- package/modules/character/character.schema.ts +0 -147
- package/modules/character/character.service.ts +0 -876
- package/modules/character/character.types.ts +0 -64
- package/modules/character/index.ts +0 -5
- package/modules/chat/chat.models.ts +0 -43
- package/modules/chat/chat.router.ts +0 -67
- package/modules/chat/chat.schema.ts +0 -36
- package/modules/chat/chat.service.ts +0 -128
- package/modules/chat/chat.types.ts +0 -20
- package/modules/chat/index.ts +0 -5
- package/modules/collection/collection.models.ts +0 -76
- package/modules/collection/collection.router.ts +0 -91
- package/modules/collection/collection.schema.ts +0 -90
- package/modules/collection/collection.service.ts +0 -192
- package/modules/collection/collection.types.ts +0 -36
- package/modules/collection/index.ts +0 -5
- package/modules/core/core.models.ts +0 -1380
- package/modules/core/core.router.ts +0 -1781
- package/modules/core/core.schema.ts +0 -847
- package/modules/core/core.service.ts +0 -2824
- package/modules/core/core.types.ts +0 -340
- package/modules/core/index.ts +0 -5
- package/modules/core/mail/applyPatchesOrMail.ts +0 -568
- package/modules/core/mail/mailClaimablePatchesBatch.ts +0 -381
- package/modules/game/game.models.ts +0 -53
- package/modules/game/game.router.ts +0 -110
- package/modules/game/game.schema.ts +0 -23
- package/modules/game/game.service.ts +0 -143
- package/modules/game/game.types.ts +0 -28
- package/modules/game/index.ts +0 -5
- package/modules/interface/index.ts +0 -5
- package/modules/interface/interface.canonicalize.ts +0 -279
- package/modules/interface/interface.models.ts +0 -40
- package/modules/interface/interface.router.ts +0 -175
- package/modules/interface/interface.schema.ts +0 -59
- package/modules/interface/interface.service.ts +0 -356
- package/modules/interface/interface.types.ts +0 -25
- package/modules/item/index.ts +0 -5
- package/modules/item/item.models.ts +0 -124
- package/modules/item/item.router.ts +0 -103
- package/modules/item/item.schema.ts +0 -120
- package/modules/item/item.service.ts +0 -167
- package/modules/item/item.types.ts +0 -74
- package/modules/job/index.ts +0 -5
- package/modules/job/job.models.ts +0 -14
- package/modules/job/job.router.ts +0 -44
- package/modules/job/job.schema.ts +0 -9
- package/modules/job/job.service.ts +0 -243
- package/modules/job/job.types.ts +0 -23
- package/modules/market/index.ts +0 -5
- package/modules/market/market.models.ts +0 -113
- package/modules/market/market.router.ts +0 -73
- package/modules/market/market.schema.ts +0 -140
- package/modules/market/market.service.ts +0 -122
- package/modules/market/market.types.ts +0 -56
- package/modules/product/index.ts +0 -5
- package/modules/product/product.models.ts +0 -166
- package/modules/product/product.router.ts +0 -93
- package/modules/product/product.schema.ts +0 -149
- package/modules/product/product.service.ts +0 -160
- package/modules/product/product.types.ts +0 -33
- package/modules/profile/index.ts +0 -5
- package/modules/profile/profile.models.ts +0 -214
- package/modules/profile/profile.router.ts +0 -72
- package/modules/profile/profile.schema.ts +0 -156
- package/modules/profile/profile.service.ts +0 -149
- package/modules/profile/profile.types.ts +0 -22
- package/modules/raffle/index.ts +0 -5
- package/modules/raffle/raffle.models.ts +0 -44
- package/modules/raffle/raffle.router.ts +0 -90
- package/modules/raffle/raffle.schema.ts +0 -32
- package/modules/raffle/raffle.service.ts +0 -167
- package/modules/raffle/raffle.types.ts +0 -30
- package/modules/skill/index.ts +0 -5
- package/modules/skill/skill.models.ts +0 -16
- package/modules/skill/skill.router.ts +0 -201
- package/modules/skill/skill.schema.ts +0 -40
- package/modules/skill/skill.service.ts +0 -390
- package/modules/skill/skill.types.ts +0 -33
- package/modules/video/index.ts +0 -5
- package/modules/video/video.models.ts +0 -25
- package/modules/video/video.router.ts +0 -143
- package/modules/video/video.schema.ts +0 -46
- package/modules/video/video.service.ts +0 -274
- package/modules/video/video.types.ts +0 -33
- package/router.ts +0 -49
- package/types.ts +0 -183
- package/util/db/index.ts +0 -7
- package/util/db/isPostgresError.ts +0 -9
- package/util/db/isUniqueConstraintViolation.ts +0 -3
- package/util/db.ts +0 -62
- package/util/index.ts +0 -351
- package/util/log.ts +0 -5
- /package/{util/api.ts → api.ts} +0 -0
- /package/{util/array.ts → array.ts} +0 -0
- /package/{util/browser.ts → browser.ts} +0 -0
- /package/build/{util/api.d.ts → api.d.ts} +0 -0
- /package/build/{util/api.js → api.js} +0 -0
- /package/build/{util/array.d.ts → array.d.ts} +0 -0
- /package/build/{util/array.js → array.js} +0 -0
- /package/build/{util/browser.d.ts → browser.d.ts} +0 -0
- /package/build/{util/browser.js → browser.js} +0 -0
- /package/build/{util/codebase.d.ts → codebase.d.ts} +0 -0
- /package/build/{util/codebase.js → codebase.js} +0 -0
- /package/build/{util/config.d.ts → config.d.ts} +0 -0
- /package/build/{util/config.js → config.js} +0 -0
- /package/build/{util/decoder.d.ts → decoder.d.ts} +0 -0
- /package/build/{util/format.d.ts → format.d.ts} +0 -0
- /package/build/{util/format.js → format.js} +0 -0
- /package/build/{util/guid.d.ts → guid.d.ts} +0 -0
- /package/build/{util/guid.js → guid.js} +0 -0
- /package/build/{util/json.d.ts → json.d.ts} +0 -0
- /package/build/{util/json.js → json.js} +0 -0
- /package/build/{util/math.d.ts → math.d.ts} +0 -0
- /package/build/{util/math.js → math.js} +0 -0
- /package/build/{util/merkle.d.ts → merkle.d.ts} +0 -0
- /package/build/{util/mongo.d.ts → mongo.d.ts} +0 -0
- /package/build/{util/number.d.ts → number.d.ts} +0 -0
- /package/build/{util/number.js → number.js} +0 -0
- /package/build/{util/object.d.ts → object.d.ts} +0 -0
- /package/build/{util/object.js → object.js} +0 -0
- /package/build/{util/otp.d.ts → otp.d.ts} +0 -0
- /package/build/{util/otp.js → otp.js} +0 -0
- /package/build/{util/physics.d.ts → physics.d.ts} +0 -0
- /package/build/{util/physics.js → physics.js} +0 -0
- /package/build/{util/process.d.ts → process.d.ts} +0 -0
- /package/build/{util/rpc.d.ts → rpc.d.ts} +0 -0
- /package/build/{util/rpc.js → rpc.js} +0 -0
- /package/build/{util/seer.d.ts → seer.d.ts} +0 -0
- /package/build/{util/seer.js → seer.js} +0 -0
- /package/build/{util/string.d.ts → string.d.ts} +0 -0
- /package/build/{util/string.js → string.js} +0 -0
- /package/build/{util/text.d.ts → text.d.ts} +0 -0
- /package/build/{util/text.js → text.js} +0 -0
- /package/build/{util/time → time}/date.d.ts +0 -0
- /package/build/{util/time → time}/date.js +0 -0
- /package/build/{util/time → time}/fancyTimeFormat.d.ts +0 -0
- /package/build/{util/time → time}/fancyTimeFormat.js +0 -0
- /package/build/{util/time → time}/index.d.ts +0 -0
- /package/build/{util/time → time}/index.js +0 -0
- /package/build/{util/time → time}/now.d.ts +0 -0
- /package/build/{util/time → time}/now.js +0 -0
- /package/build/{util/web3 → web3}/httpProvider.d.ts +0 -0
- /package/build/{util/web3 → web3}/httpProvider.js +0 -0
- /package/build/{util/web3.d.ts → web3.d.ts} +0 -0
- /package/build/{util/websocket.d.ts → websocket.d.ts} +0 -0
- /package/build/{util/zk.d.ts → zk.d.ts} +0 -0
- /package/build/{util/zk.js → zk.js} +0 -0
- /package/{util/codebase.ts → codebase.ts} +0 -0
- /package/{util/config.ts → config.ts} +0 -0
- /package/{util/decoder.test.ts → decoder.test.ts} +0 -0
- /package/{util/format.ts → format.ts} +0 -0
- /package/{util/guid.ts → guid.ts} +0 -0
- /package/{util/json.ts → json.ts} +0 -0
- /package/{util/math.ts → math.ts} +0 -0
- /package/{util/number.ts → number.ts} +0 -0
- /package/{util/object.ts → object.ts} +0 -0
- /package/{util/otp.ts → otp.ts} +0 -0
- /package/{util/physics.ts → physics.ts} +0 -0
- /package/{util/rpc.ts → rpc.ts} +0 -0
- /package/{util/seer.ts → seer.ts} +0 -0
- /package/{util/string.ts → string.ts} +0 -0
- /package/{util/text.ts → text.ts} +0 -0
- /package/{util/time → time}/date.ts +0 -0
- /package/{util/time → time}/fancyTimeFormat.ts +0 -0
- /package/{util/time → time}/index.ts +0 -0
- /package/{util/time → time}/now.ts +0 -0
- /package/{util/types → types}/mongo.d.ts +0 -0
- /package/{util/web3 → web3}/httpProvider.ts +0 -0
- /package/{util/zk.ts → zk.ts} +0 -0
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import * as mongo from '../../util/mongo';
|
|
2
|
-
import type * as Types from './product.types';
|
|
3
|
-
|
|
4
|
-
export const Product = mongo.createModel<Types.ProductDocument>(
|
|
5
|
-
'Product',
|
|
6
|
-
{
|
|
7
|
-
shortDescription: { type: String, maxlength: 300, required: false },
|
|
8
|
-
content: { type: String, required: false },
|
|
9
|
-
communityId: { type: mongo.Schema.Types.ObjectId, ref: 'Community', required: false },
|
|
10
|
-
type: { type: String, default: 'game', maxlength: 100 },
|
|
11
|
-
releaseDate: { type: Date },
|
|
12
|
-
|
|
13
|
-
// New fields from Objection.js model
|
|
14
|
-
parentId: { type: mongo.Schema.Types.ObjectId, ref: 'Product' },
|
|
15
|
-
score: { type: Number },
|
|
16
|
-
ownerId: { type: mongo.Schema.Types.ObjectId, ref: 'Profile' },
|
|
17
|
-
ratingId: { type: mongo.Schema.Types.ObjectId, ref: 'Rating' },
|
|
18
|
-
ideaId: { type: mongo.Schema.Types.ObjectId, ref: 'Idea' },
|
|
19
|
-
meta: {
|
|
20
|
-
name: String,
|
|
21
|
-
members: [{ type: mongo.Schema.Types.ObjectId, ref: 'Profile' }],
|
|
22
|
-
isProposal: Boolean,
|
|
23
|
-
price: Number,
|
|
24
|
-
oldPrice: Number,
|
|
25
|
-
images: Object,
|
|
26
|
-
video: String,
|
|
27
|
-
genre: String,
|
|
28
|
-
releaseDate: String,
|
|
29
|
-
developer: String,
|
|
30
|
-
publisher: String,
|
|
31
|
-
developerTags: [String],
|
|
32
|
-
languageSupport: [Object], // Adjust as needed
|
|
33
|
-
systemRequirements: [Object], // Adjust as needed
|
|
34
|
-
tags: [{ type: mongo.Schema.Types.ObjectId, ref: 'Tag' }],
|
|
35
|
-
type: String,
|
|
36
|
-
downloads: Number,
|
|
37
|
-
plans: [Object], // Adjust as needed
|
|
38
|
-
frequentlyTradedAssets: [{ type: mongo.Schema.Types.ObjectId, ref: 'Asset' }],
|
|
39
|
-
saleBox: Object,
|
|
40
|
-
assets: [{ type: mongo.Schema.Types.ObjectId, ref: 'Asset' }],
|
|
41
|
-
community: Object,
|
|
42
|
-
nameUrl: String,
|
|
43
|
-
steamId: Number,
|
|
44
|
-
author: String,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
virtuals: [
|
|
49
|
-
{
|
|
50
|
-
name: 'projects',
|
|
51
|
-
ref: 'Project',
|
|
52
|
-
localField: '_id',
|
|
53
|
-
foreignField: 'productId',
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: 'leaderboards',
|
|
57
|
-
ref: 'Leaderboard',
|
|
58
|
-
localField: '_id',
|
|
59
|
-
foreignField: 'productId',
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: 'games',
|
|
63
|
-
ref: 'Game',
|
|
64
|
-
localField: '_id',
|
|
65
|
-
foreignField: 'productId',
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: 'productUpdates',
|
|
69
|
-
ref: 'ProductUpdate',
|
|
70
|
-
localField: '_id',
|
|
71
|
-
foreignField: 'productId',
|
|
72
|
-
},
|
|
73
|
-
// Adding missing relations as virtuals
|
|
74
|
-
{
|
|
75
|
-
name: 'owner',
|
|
76
|
-
ref: 'Profile',
|
|
77
|
-
localField: 'ownerId',
|
|
78
|
-
foreignField: '_id',
|
|
79
|
-
justOne: true,
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
name: 'rating',
|
|
83
|
-
ref: 'Rating',
|
|
84
|
-
localField: 'ratingId',
|
|
85
|
-
foreignField: '_id',
|
|
86
|
-
justOne: true,
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
name: 'community',
|
|
90
|
-
ref: 'Community',
|
|
91
|
-
localField: 'communityId',
|
|
92
|
-
foreignField: '_id',
|
|
93
|
-
justOne: true,
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
name: 'idea',
|
|
97
|
-
ref: 'Idea',
|
|
98
|
-
localField: 'ideaId',
|
|
99
|
-
foreignField: '_id',
|
|
100
|
-
justOne: true,
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
name: 'subproducts',
|
|
104
|
-
ref: 'Product',
|
|
105
|
-
localField: '_id',
|
|
106
|
-
foreignField: 'parentId',
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
name: 'servers',
|
|
110
|
-
ref: 'Server',
|
|
111
|
-
localField: '_id',
|
|
112
|
-
foreignField: 'productId',
|
|
113
|
-
},
|
|
114
|
-
// {
|
|
115
|
-
// name: 'votes',
|
|
116
|
-
// ref: 'Vote',
|
|
117
|
-
// localField: '_id',
|
|
118
|
-
// foreignField: 'productId',
|
|
119
|
-
// through: {
|
|
120
|
-
// from: 'nodes.toProductId',
|
|
121
|
-
// to: 'nodes.fromVoteId',
|
|
122
|
-
// extra: ['relationKey'],
|
|
123
|
-
// },
|
|
124
|
-
// },
|
|
125
|
-
// {
|
|
126
|
-
// name: 'files',
|
|
127
|
-
// ref: 'File',
|
|
128
|
-
// localField: '_id',
|
|
129
|
-
// foreignField: 'productId',
|
|
130
|
-
// through: {
|
|
131
|
-
// from: 'nodes.fromProductId',
|
|
132
|
-
// to: 'nodes.toFileId',
|
|
133
|
-
// extra: ['relationKey'],
|
|
134
|
-
// },
|
|
135
|
-
// },
|
|
136
|
-
// {
|
|
137
|
-
// name: 'tags',
|
|
138
|
-
// ref: 'Tag',
|
|
139
|
-
// localField: '_id',
|
|
140
|
-
// foreignField: 'productId',
|
|
141
|
-
// through: {
|
|
142
|
-
// from: 'nodes.fromProductId',
|
|
143
|
-
// to: 'nodes.toTagId',
|
|
144
|
-
// extra: ['relationKey'],
|
|
145
|
-
// },
|
|
146
|
-
// },
|
|
147
|
-
// {
|
|
148
|
-
// name: 'internalTags',
|
|
149
|
-
// ref: 'Tag',
|
|
150
|
-
// localField: '_id',
|
|
151
|
-
// foreignField: 'productId',
|
|
152
|
-
// through: {
|
|
153
|
-
// from: 'nodes.fromProductId',
|
|
154
|
-
// to: 'nodes.toTagId',
|
|
155
|
-
// extra: ['relationKey'],
|
|
156
|
-
// },
|
|
157
|
-
// },
|
|
158
|
-
],
|
|
159
|
-
}
|
|
160
|
-
);
|
|
161
|
-
|
|
162
|
-
export const ProductUpdate = mongo.createModel<Types.ProductUpdateDocument>('ProductUpdate', {
|
|
163
|
-
productId: { type: mongo.Schema.Types.ObjectId, ref: 'Product', required: true },
|
|
164
|
-
updateContent: { type: String, required: true },
|
|
165
|
-
updateDate: { type: Date, required: true },
|
|
166
|
-
});
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { z as zod } from 'zod';
|
|
2
|
-
import { initTRPC, inferRouterInputs, inferRouterOutputs } from '@trpc/server';
|
|
3
|
-
import { customErrorFormatter, hasRole } from '../../util/rpc';
|
|
4
|
-
import type { RouterContext } from '../../types';
|
|
5
|
-
import { Product, ProductDLC, ProductBundle, ProductReview } from './product.schema';
|
|
6
|
-
|
|
7
|
-
export const z = zod;
|
|
8
|
-
export const t = initTRPC.context<RouterContext>().create();
|
|
9
|
-
export const router = t.router;
|
|
10
|
-
export const procedure = t.procedure;
|
|
11
|
-
|
|
12
|
-
export const createRouter = () =>
|
|
13
|
-
router({
|
|
14
|
-
// Product endpoints
|
|
15
|
-
getProduct: procedure
|
|
16
|
-
.use(hasRole('guest', t))
|
|
17
|
-
.use(customErrorFormatter(t))
|
|
18
|
-
.input(z.object({ productId: z.string() }))
|
|
19
|
-
.query(({ input, ctx }) => (ctx.app.service.Product.getProduct as any)(input, ctx)),
|
|
20
|
-
|
|
21
|
-
createProduct: procedure
|
|
22
|
-
.use(hasRole('admin', t))
|
|
23
|
-
.use(customErrorFormatter(t))
|
|
24
|
-
.input(Product)
|
|
25
|
-
.mutation(({ input, ctx }) => (ctx.app.service.Product.createProduct as any)(input, ctx)),
|
|
26
|
-
|
|
27
|
-
updateProduct: procedure
|
|
28
|
-
.use(hasRole('admin', t))
|
|
29
|
-
.use(customErrorFormatter(t))
|
|
30
|
-
.input(z.object({ productId: z.string(), data: Product.partial() }))
|
|
31
|
-
.mutation(({ input, ctx }) => (ctx.app.service.Product.updateProduct as any)(input, ctx)),
|
|
32
|
-
|
|
33
|
-
// ProductDLC endpoints
|
|
34
|
-
getProductDLC: procedure
|
|
35
|
-
.use(hasRole('guest', t))
|
|
36
|
-
.use(customErrorFormatter(t))
|
|
37
|
-
.input(z.object({ dlcId: z.string() }))
|
|
38
|
-
.query(({ input, ctx }) => (ctx.app.service.Product.getProductDLC as any)(input, ctx)),
|
|
39
|
-
|
|
40
|
-
createProductDLC: procedure
|
|
41
|
-
.use(hasRole('admin', t))
|
|
42
|
-
.use(customErrorFormatter(t))
|
|
43
|
-
.input(ProductDLC)
|
|
44
|
-
.mutation(({ input, ctx }) => (ctx.app.service.Product.createProductDLC as any)(input, ctx)),
|
|
45
|
-
|
|
46
|
-
updateProductDLC: procedure
|
|
47
|
-
.use(hasRole('admin', t))
|
|
48
|
-
.use(customErrorFormatter(t))
|
|
49
|
-
.input(z.object({ dlcId: z.string(), data: ProductDLC.partial() }))
|
|
50
|
-
.mutation(({ input, ctx }) => (ctx.app.service.Product.updateProductDLC as any)(input, ctx)),
|
|
51
|
-
|
|
52
|
-
// ProductBundle endpoints
|
|
53
|
-
getProductBundle: procedure
|
|
54
|
-
.use(hasRole('guest', t))
|
|
55
|
-
.use(customErrorFormatter(t))
|
|
56
|
-
.input(z.object({ bundleId: z.string() }))
|
|
57
|
-
.query(({ input, ctx }) => (ctx.app.service.Product.getProductBundle as any)(input, ctx)),
|
|
58
|
-
|
|
59
|
-
createProductBundle: procedure
|
|
60
|
-
.use(hasRole('admin', t))
|
|
61
|
-
.use(customErrorFormatter(t))
|
|
62
|
-
.input(ProductBundle)
|
|
63
|
-
.mutation(({ input, ctx }) => (ctx.app.service.Product.createProductBundle as any)(input, ctx)),
|
|
64
|
-
|
|
65
|
-
updateProductBundle: procedure
|
|
66
|
-
.use(hasRole('admin', t))
|
|
67
|
-
.use(customErrorFormatter(t))
|
|
68
|
-
.input(z.object({ bundleId: z.string(), data: ProductBundle.partial() }))
|
|
69
|
-
.mutation(({ input, ctx }) => (ctx.app.service.Product.updateProductBundle as any)(input, ctx)),
|
|
70
|
-
|
|
71
|
-
// ProductReview endpoints
|
|
72
|
-
getProductReview: procedure
|
|
73
|
-
.use(hasRole('guest', t))
|
|
74
|
-
.use(customErrorFormatter(t))
|
|
75
|
-
.input(z.object({ reviewId: z.string() }))
|
|
76
|
-
.query(({ input, ctx }) => (ctx.app.service.Product.getProductReview as any)(input, ctx)),
|
|
77
|
-
|
|
78
|
-
createProductReview: procedure
|
|
79
|
-
.use(hasRole('admin', t))
|
|
80
|
-
.use(customErrorFormatter(t))
|
|
81
|
-
.input(ProductReview)
|
|
82
|
-
.mutation(({ input, ctx }) => (ctx.app.service.Product.createProductReview as any)(input, ctx)),
|
|
83
|
-
|
|
84
|
-
updateProductReview: procedure
|
|
85
|
-
.use(hasRole('admin', t))
|
|
86
|
-
.use(customErrorFormatter(t))
|
|
87
|
-
.input(z.object({ reviewId: z.string(), data: ProductReview.partial() }))
|
|
88
|
-
.mutation(({ input, ctx }) => (ctx.app.service.Product.updateProductReview as any)(input, ctx)),
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
export type Router = ReturnType<typeof createRouter>;
|
|
92
|
-
export type RouterInput = inferRouterInputs<Router>;
|
|
93
|
-
export type RouterOutput = inferRouterOutputs<Router>;
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { z, ObjectId, Entity } from '../../schema';
|
|
2
|
-
|
|
3
|
-
// Extend the ProductMeta schema
|
|
4
|
-
const ProductMeta = z.object({
|
|
5
|
-
name: z.string(),
|
|
6
|
-
members: z.array(ObjectId), // Array of Profile references
|
|
7
|
-
isProposal: z.boolean(),
|
|
8
|
-
price: z.number().nonnegative(),
|
|
9
|
-
oldPrice: z.number().nonnegative().optional(),
|
|
10
|
-
images: z.record(z.string(), z.any()),
|
|
11
|
-
video: z.string().url(),
|
|
12
|
-
genre: z.string(),
|
|
13
|
-
releaseDate: z.string(),
|
|
14
|
-
developer: z.string(),
|
|
15
|
-
publisher: z.string(),
|
|
16
|
-
developerTags: z.array(z.string()),
|
|
17
|
-
languageSupport: z.array(z.any()), // Replace with actual Language schema if available
|
|
18
|
-
systemRequirements: z.array(z.any()), // Replace with actual SystemRequirement schema if available
|
|
19
|
-
tags: z.array(ObjectId), // Array of Tag references
|
|
20
|
-
type: z.string(),
|
|
21
|
-
downloads: z.number().int().nonnegative(),
|
|
22
|
-
plans: z.array(z.any()), // Replace with actual ProductPlan schema if available
|
|
23
|
-
frequentlyTradedAssets: z.array(ObjectId), // Array of Asset references
|
|
24
|
-
saleBox: z.record(z.string(), z.any()),
|
|
25
|
-
assets: z.array(ObjectId), // Array of Asset references
|
|
26
|
-
community: z.record(z.string(), z.any()),
|
|
27
|
-
nameUrl: z.string(),
|
|
28
|
-
steamId: z.number().int(),
|
|
29
|
-
author: z.string(),
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
// Updated Product schema
|
|
33
|
-
export const Product = Entity.merge(
|
|
34
|
-
z.object({
|
|
35
|
-
shortDescription: z.string().max(300).min(1),
|
|
36
|
-
content: z.string().min(1),
|
|
37
|
-
communityId: ObjectId,
|
|
38
|
-
type: z.string().max(100).default('game'),
|
|
39
|
-
releaseDate: z.date().optional(),
|
|
40
|
-
sku: z.string().min(1),
|
|
41
|
-
categoryId: ObjectId.optional(),
|
|
42
|
-
price: z.number().nonnegative(),
|
|
43
|
-
discountPrice: z.number().nonnegative().optional(),
|
|
44
|
-
currency: z.string().length(3),
|
|
45
|
-
images: z.array(z.string().url()).optional(),
|
|
46
|
-
videos: z.array(z.string().url()).optional(),
|
|
47
|
-
digitalContent: z
|
|
48
|
-
.array(
|
|
49
|
-
z.object({
|
|
50
|
-
url: z.string().url(),
|
|
51
|
-
size: z.number().nonnegative(),
|
|
52
|
-
drm: z.enum(['None', 'Steam', 'Epic', 'Uplay', 'Origin']).optional(),
|
|
53
|
-
})
|
|
54
|
-
)
|
|
55
|
-
.optional(),
|
|
56
|
-
dlcs: z.array(ObjectId).optional(),
|
|
57
|
-
bundles: z.array(ObjectId).optional(),
|
|
58
|
-
achievements: z
|
|
59
|
-
.array(
|
|
60
|
-
z.object({
|
|
61
|
-
name: z.string(),
|
|
62
|
-
description: z.string().optional(),
|
|
63
|
-
icon: z.string().url().optional(),
|
|
64
|
-
})
|
|
65
|
-
)
|
|
66
|
-
.optional(),
|
|
67
|
-
reviews: z
|
|
68
|
-
.array(
|
|
69
|
-
z.object({
|
|
70
|
-
userId: ObjectId,
|
|
71
|
-
rating: z.number().min(1).max(5),
|
|
72
|
-
comment: z.string().optional(),
|
|
73
|
-
createdDate: z.date().default(() => new Date()),
|
|
74
|
-
})
|
|
75
|
-
)
|
|
76
|
-
.optional(),
|
|
77
|
-
cloudSave: z.boolean().default(false),
|
|
78
|
-
ugcSupport: z.boolean().default(false),
|
|
79
|
-
wishlistCount: z.number().int().nonnegative().default(0),
|
|
80
|
-
|
|
81
|
-
// Additional fields from Objection.js model
|
|
82
|
-
parentId: ObjectId.optional(),
|
|
83
|
-
score: z.number().optional(),
|
|
84
|
-
ownerId: ObjectId.optional(),
|
|
85
|
-
ratingId: ObjectId.optional(),
|
|
86
|
-
ideaId: ObjectId.optional(),
|
|
87
|
-
meta: ProductMeta.optional(),
|
|
88
|
-
})
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
// ProductDLC schema
|
|
92
|
-
export const ProductDLC = Entity.merge(
|
|
93
|
-
z.object({
|
|
94
|
-
name: z.string().min(1),
|
|
95
|
-
description: z.string().optional(),
|
|
96
|
-
gameId: ObjectId,
|
|
97
|
-
price: z.number().nonnegative(),
|
|
98
|
-
discountPrice: z.number().nonnegative().optional(),
|
|
99
|
-
currency: z.string().length(3),
|
|
100
|
-
digitalContent: z
|
|
101
|
-
.array(
|
|
102
|
-
z.object({
|
|
103
|
-
url: z.string().url(),
|
|
104
|
-
size: z.number().nonnegative(),
|
|
105
|
-
drm: z.enum(['None', 'Steam', 'Epic', 'Uplay', 'Origin']).optional(),
|
|
106
|
-
})
|
|
107
|
-
)
|
|
108
|
-
.optional(),
|
|
109
|
-
achievements: z
|
|
110
|
-
.array(
|
|
111
|
-
z.object({
|
|
112
|
-
name: z.string(),
|
|
113
|
-
description: z.string().optional(),
|
|
114
|
-
icon: z.string().url().optional(),
|
|
115
|
-
})
|
|
116
|
-
)
|
|
117
|
-
.optional(),
|
|
118
|
-
})
|
|
119
|
-
);
|
|
120
|
-
|
|
121
|
-
// ProductBundle schema
|
|
122
|
-
export const ProductBundle = Entity.merge(
|
|
123
|
-
z.object({
|
|
124
|
-
name: z.string().min(1),
|
|
125
|
-
description: z.string().optional(),
|
|
126
|
-
products: z.array(ObjectId),
|
|
127
|
-
price: z.number().nonnegative(),
|
|
128
|
-
discountPrice: z.number().nonnegative().optional(),
|
|
129
|
-
currency: z.string().length(3),
|
|
130
|
-
})
|
|
131
|
-
);
|
|
132
|
-
|
|
133
|
-
// ProductReview schema
|
|
134
|
-
export const ProductReview = Entity.merge(
|
|
135
|
-
z.object({
|
|
136
|
-
userId: ObjectId,
|
|
137
|
-
productId: ObjectId,
|
|
138
|
-
rating: z.number().min(1).max(5),
|
|
139
|
-
comment: z.string().optional(),
|
|
140
|
-
})
|
|
141
|
-
);
|
|
142
|
-
|
|
143
|
-
export const ProductUpdate = Entity.merge(
|
|
144
|
-
z.object({
|
|
145
|
-
productId: ObjectId,
|
|
146
|
-
updateContent: z.string().min(1),
|
|
147
|
-
updateDate: z.date(),
|
|
148
|
-
})
|
|
149
|
-
);
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Product,
|
|
3
|
-
ProductDLC,
|
|
4
|
-
ProductBundle,
|
|
5
|
-
ProductReview,
|
|
6
|
-
RouterContext,
|
|
7
|
-
Router,
|
|
8
|
-
RouterInput,
|
|
9
|
-
RouterOutput,
|
|
10
|
-
} from './product.types';
|
|
11
|
-
|
|
12
|
-
export class Service {
|
|
13
|
-
async getProduct(input: RouterInput['getProduct'], ctx: RouterContext): Promise<RouterOutput['getProduct']> {
|
|
14
|
-
if (!input) throw new Error('Input should not be void');
|
|
15
|
-
console.log('Product.Service.getProduct', input.productId);
|
|
16
|
-
|
|
17
|
-
const product = await ctx.app.model.Product.findById(input.productId).lean().exec();
|
|
18
|
-
if (!product) throw new Error('Product not found');
|
|
19
|
-
|
|
20
|
-
return product as Product;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async createProduct(input: RouterInput['createProduct'], ctx: RouterContext): Promise<RouterOutput['createProduct']> {
|
|
24
|
-
if (!input) throw new Error('Input should not be void');
|
|
25
|
-
console.log('Product.Service.createProduct', input);
|
|
26
|
-
|
|
27
|
-
const product = await ctx.app.model.Product.create(input);
|
|
28
|
-
return product as Product;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
async updateProduct(input: RouterInput['updateProduct'], ctx: RouterContext): Promise<RouterOutput['updateProduct']> {
|
|
32
|
-
if (!input) throw new Error('Input should not be void');
|
|
33
|
-
console.log('Product.Service.updateProduct', input.productId, input.data);
|
|
34
|
-
|
|
35
|
-
const updatedProduct = await ctx.app.model.Product.findByIdAndUpdate(input.productId, input.data, { new: true })
|
|
36
|
-
.lean()
|
|
37
|
-
.exec();
|
|
38
|
-
if (!updatedProduct) throw new Error('Product update failed');
|
|
39
|
-
|
|
40
|
-
return updatedProduct as Product;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
async getProductDLC(input: RouterInput['getProductDLC'], ctx: RouterContext): Promise<RouterOutput['getProductDLC']> {
|
|
44
|
-
if (!input) throw new Error('Input should not be void');
|
|
45
|
-
console.log('Product.Service.getProductDLC', input.dlcId);
|
|
46
|
-
|
|
47
|
-
const productDLC = await ctx.app.model.ProductDLC.findById(input.dlcId).lean().exec();
|
|
48
|
-
if (!productDLC) throw new Error('ProductDLC not found');
|
|
49
|
-
|
|
50
|
-
return productDLC as ProductDLC;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
async createProductDLC(
|
|
54
|
-
input: RouterInput['createProductDLC'],
|
|
55
|
-
ctx: RouterContext
|
|
56
|
-
): Promise<RouterOutput['createProductDLC']> {
|
|
57
|
-
if (!input) throw new Error('Input should not be void');
|
|
58
|
-
console.log('Product.Service.createProductDLC', input);
|
|
59
|
-
|
|
60
|
-
const productDLC = await ctx.app.model.ProductDLC.create(input);
|
|
61
|
-
return productDLC as ProductDLC;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
async updateProductDLC(
|
|
65
|
-
input: RouterInput['updateProductDLC'],
|
|
66
|
-
ctx: RouterContext
|
|
67
|
-
): Promise<RouterOutput['updateProductDLC']> {
|
|
68
|
-
if (!input) throw new Error('Input should not be void');
|
|
69
|
-
console.log('Product.Service.updateProductDLC', input.dlcId, input.data);
|
|
70
|
-
|
|
71
|
-
const updatedProductDLC = await ctx.app.model.ProductDLC.findByIdAndUpdate(input.dlcId, input.data, { new: true })
|
|
72
|
-
.lean()
|
|
73
|
-
.exec();
|
|
74
|
-
if (!updatedProductDLC) throw new Error('ProductDLC update failed');
|
|
75
|
-
|
|
76
|
-
return updatedProductDLC as ProductDLC;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
async getProductBundle(
|
|
80
|
-
input: RouterInput['getProductBundle'],
|
|
81
|
-
ctx: RouterContext
|
|
82
|
-
): Promise<RouterOutput['getProductBundle']> {
|
|
83
|
-
if (!input) throw new Error('Input should not be void');
|
|
84
|
-
console.log('Product.Service.getProductBundle', input.bundleId);
|
|
85
|
-
|
|
86
|
-
const productBundle = await ctx.app.model.ProductBundle.findById(input.bundleId).lean().exec();
|
|
87
|
-
if (!productBundle) throw new Error('ProductBundle not found');
|
|
88
|
-
|
|
89
|
-
return productBundle as ProductBundle;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
async createProductBundle(
|
|
93
|
-
input: RouterInput['createProductBundle'],
|
|
94
|
-
ctx: RouterContext
|
|
95
|
-
): Promise<RouterOutput['createProductBundle']> {
|
|
96
|
-
if (!input) throw new Error('Input should not be void');
|
|
97
|
-
console.log('Product.Service.createProductBundle', input);
|
|
98
|
-
|
|
99
|
-
const productBundle = await ctx.app.model.ProductBundle.create(input);
|
|
100
|
-
return productBundle as ProductBundle;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
async updateProductBundle(
|
|
104
|
-
input: RouterInput['updateProductBundle'],
|
|
105
|
-
ctx: RouterContext
|
|
106
|
-
): Promise<RouterOutput['updateProductBundle']> {
|
|
107
|
-
if (!input) throw new Error('Input should not be void');
|
|
108
|
-
console.log('Product.Service.updateProductBundle', input.bundleId, input.data);
|
|
109
|
-
|
|
110
|
-
const updatedProductBundle = await ctx.app.model.ProductBundle.findByIdAndUpdate(input.bundleId, input.data, {
|
|
111
|
-
new: true,
|
|
112
|
-
})
|
|
113
|
-
.lean()
|
|
114
|
-
.exec();
|
|
115
|
-
if (!updatedProductBundle) throw new Error('ProductBundle update failed');
|
|
116
|
-
|
|
117
|
-
return updatedProductBundle as ProductBundle;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
async getProductReview(
|
|
121
|
-
input: RouterInput['getProductReview'],
|
|
122
|
-
ctx: RouterContext
|
|
123
|
-
): Promise<RouterOutput['getProductReview']> {
|
|
124
|
-
if (!input) throw new Error('Input should not be void');
|
|
125
|
-
console.log('Product.Service.getProductReview', input.reviewId);
|
|
126
|
-
|
|
127
|
-
const productReview = await ctx.app.model.ProductReview.findById(input.reviewId).lean().exec();
|
|
128
|
-
if (!productReview) throw new Error('ProductReview not found');
|
|
129
|
-
|
|
130
|
-
return productReview as ProductReview;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
async createProductReview(
|
|
134
|
-
input: RouterInput['createProductReview'],
|
|
135
|
-
ctx: RouterContext
|
|
136
|
-
): Promise<RouterOutput['createProductReview']> {
|
|
137
|
-
if (!input) throw new Error('Input should not be void');
|
|
138
|
-
console.log('Product.Service.createProductReview', input);
|
|
139
|
-
|
|
140
|
-
const productReview = await ctx.app.model.ProductReview.create(input);
|
|
141
|
-
return productReview as ProductReview;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
async updateProductReview(
|
|
145
|
-
input: RouterInput['updateProductReview'],
|
|
146
|
-
ctx: RouterContext
|
|
147
|
-
): Promise<RouterOutput['updateProductReview']> {
|
|
148
|
-
if (!input) throw new Error('Input should not be void');
|
|
149
|
-
console.log('Product.Service.updateProductReview', input.reviewId, input.data);
|
|
150
|
-
|
|
151
|
-
const updatedProductReview = await ctx.app.model.ProductReview.findByIdAndUpdate(input.reviewId, input.data, {
|
|
152
|
-
new: true,
|
|
153
|
-
})
|
|
154
|
-
.lean()
|
|
155
|
-
.exec();
|
|
156
|
-
if (!updatedProductReview) throw new Error('ProductReview update failed');
|
|
157
|
-
|
|
158
|
-
return updatedProductReview as ProductReview;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import * as schema from './product.schema';
|
|
3
|
-
import { Document, Model } from '../../util/mongo';
|
|
4
|
-
import type { RouterContext } from '../../types';
|
|
5
|
-
import type { inferRouterInputs, inferRouterOutputs } from '@trpc/server';
|
|
6
|
-
import type { Router } from './product.router';
|
|
7
|
-
|
|
8
|
-
export type * from './product.router';
|
|
9
|
-
export type * from './product.service';
|
|
10
|
-
export type { RouterContext };
|
|
11
|
-
|
|
12
|
-
export type Product = z.infer<typeof schema.Product>;
|
|
13
|
-
export type ProductUpdate = z.infer<typeof schema.ProductUpdate>;
|
|
14
|
-
export type ProductDLC = z.infer<typeof schema.ProductDLC>;
|
|
15
|
-
export type ProductBundle = z.infer<typeof schema.ProductBundle>;
|
|
16
|
-
export type ProductReview = z.infer<typeof schema.ProductReview>;
|
|
17
|
-
|
|
18
|
-
export type ProductDocument = Product & Document;
|
|
19
|
-
export type ProductUpdateDocument = ProductUpdate & Document;
|
|
20
|
-
export type ProductDLCDocument = ProductDLC & Document;
|
|
21
|
-
export type ProductBundleDocument = ProductBundle & Document;
|
|
22
|
-
export type ProductReviewDocument = ProductReview & Document;
|
|
23
|
-
|
|
24
|
-
export type Mappings = {
|
|
25
|
-
Product: Model<ProductDocument>;
|
|
26
|
-
ProductUpdate: Model<ProductUpdateDocument>;
|
|
27
|
-
ProductDLC: Model<ProductDLCDocument>;
|
|
28
|
-
ProductBundle: Model<ProductBundleDocument>;
|
|
29
|
-
ProductReview: Model<ProductReviewDocument>;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export type RouterInput = inferRouterInputs<Router>;
|
|
33
|
-
export type RouterOutput = inferRouterOutputs<Router>;
|