@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.
Files changed (640) hide show
  1. package/.rush/temp/shrinkwrap-deps.json +39 -82
  2. package/build/api.js.map +1 -0
  3. package/build/array.js.map +1 -0
  4. package/build/browser.js.map +1 -0
  5. package/build/codebase.js.map +1 -0
  6. package/build/config.js.map +1 -0
  7. package/build/db.d.ts +41 -0
  8. package/build/db.js +234 -0
  9. package/build/db.js.map +1 -0
  10. package/build/{util/decoder.js → decoder.js} +3 -3
  11. package/build/decoder.js.map +1 -0
  12. package/build/format.js.map +1 -0
  13. package/build/guid.js.map +1 -0
  14. package/build/index.d.ts +70 -18
  15. package/build/index.js +216 -18
  16. package/build/index.js.map +1 -1
  17. package/build/json.js.map +1 -0
  18. package/build/legacy/data/items.js +1 -1
  19. package/build/legacy/data/items.js.map +1 -1
  20. package/build/log.d.ts +5 -0
  21. package/build/log.js +28 -0
  22. package/build/log.js.map +1 -0
  23. package/build/math.js.map +1 -0
  24. package/build/{util/merkle.js → merkle.js} +1 -1
  25. package/build/merkle.js.map +1 -0
  26. package/build/{util/mongo.js → mongo.js} +1 -1
  27. package/build/mongo.js.map +1 -0
  28. package/build/number.js.map +1 -0
  29. package/build/object.js.map +1 -0
  30. package/build/otp.js.map +1 -0
  31. package/build/package.json +3 -3
  32. package/build/physics.js.map +1 -0
  33. package/build/{util/process.js → process.js} +1 -1
  34. package/build/process.js.map +1 -0
  35. package/build/rpc.js.map +1 -0
  36. package/build/schema.d.ts +42 -51
  37. package/build/seer.js.map +1 -0
  38. package/build/string.js.map +1 -0
  39. package/build/text.js.map +1 -0
  40. package/build/time/date.js.map +1 -0
  41. package/build/time/fancyTimeFormat.js.map +1 -0
  42. package/build/time/index.js.map +1 -0
  43. package/build/time/now.js.map +1 -0
  44. package/build/trpc/socketLink.d.ts +62 -0
  45. package/build/trpc/socketLink.js +261 -0
  46. package/build/trpc/socketLink.js.map +1 -0
  47. package/build/trpc/socketServer.d.ts +15 -0
  48. package/build/trpc/socketServer.js +47 -0
  49. package/build/trpc/socketServer.js.map +1 -0
  50. package/build/tsconfig.tsbuildinfo +1 -1
  51. package/build/util.d.ts +1 -0
  52. package/build/util.js +2 -0
  53. package/build/util.js.map +1 -0
  54. package/build/web3/httpProvider.js.map +1 -0
  55. package/build/{util/web3.js → web3.js} +1 -1
  56. package/build/web3.js.map +1 -0
  57. package/build/{util/websocket.js → websocket.js} +1 -1
  58. package/build/websocket.js.map +1 -0
  59. package/build/zk.js.map +1 -0
  60. package/build/{util/zod.d.ts → zod.d.ts} +2 -0
  61. package/build/{util/zod.js → zod.js} +1 -0
  62. package/build/zod.js.map +1 -0
  63. package/db.ts +76 -1
  64. package/{util/decoder.ts → decoder.ts} +3 -3
  65. package/index.ts +306 -18
  66. package/legacy/data/items.ts +1 -1
  67. package/log.ts +51 -0
  68. package/{util/merkle.ts → merkle.ts} +3 -1
  69. package/{util/mongo.ts → mongo.ts} +1 -1
  70. package/package.json +3 -3
  71. package/{util/process.ts → process.ts} +1 -1
  72. package/trpc/socketLink.ts +2 -2
  73. package/trpc/socketServer.ts +1 -1
  74. package/tsconfig.json +35 -6
  75. package/util.ts +1 -0
  76. package/{util/web3.ts → web3.ts} +2 -1
  77. package/{util/websocket.ts → websocket.ts} +1 -1
  78. package/{util/zod.ts → zod.ts} +2 -0
  79. package/build/modules/area/area.models.d.ts +0 -6
  80. package/build/modules/area/area.models.js +0 -11
  81. package/build/modules/area/area.models.js.map +0 -1
  82. package/build/modules/area/area.router.d.ts +0 -274
  83. package/build/modules/area/area.router.js +0 -59
  84. package/build/modules/area/area.router.js.map +0 -1
  85. package/build/modules/area/area.schema.d.ts +0 -245
  86. package/build/modules/area/area.schema.js +0 -13
  87. package/build/modules/area/area.schema.js.map +0 -1
  88. package/build/modules/area/area.service.d.ts +0 -12
  89. package/build/modules/area/area.service.js +0 -95
  90. package/build/modules/area/area.service.js.map +0 -1
  91. package/build/modules/area/area.types.d.ts +0 -20
  92. package/build/modules/area/area.types.js +0 -2
  93. package/build/modules/area/area.types.js.map +0 -1
  94. package/build/modules/area/index.d.ts +0 -5
  95. package/build/modules/area/index.js +0 -6
  96. package/build/modules/area/index.js.map +0 -1
  97. package/build/modules/asset/asset.models.d.ts +0 -5
  98. package/build/modules/asset/asset.models.js +0 -44
  99. package/build/modules/asset/asset.models.js.map +0 -1
  100. package/build/modules/asset/asset.router.d.ts +0 -189
  101. package/build/modules/asset/asset.router.js +0 -41
  102. package/build/modules/asset/asset.router.js.map +0 -1
  103. package/build/modules/asset/asset.schema.d.ts +0 -207
  104. package/build/modules/asset/asset.schema.js +0 -19
  105. package/build/modules/asset/asset.schema.js.map +0 -1
  106. package/build/modules/asset/asset.service.d.ts +0 -9
  107. package/build/modules/asset/asset.service.js +0 -68
  108. package/build/modules/asset/asset.service.js.map +0 -1
  109. package/build/modules/asset/asset.types.d.ts +0 -17
  110. package/build/modules/asset/asset.types.js +0 -2
  111. package/build/modules/asset/asset.types.js.map +0 -1
  112. package/build/modules/asset/index.d.ts +0 -5
  113. package/build/modules/asset/index.js +0 -6
  114. package/build/modules/asset/index.js.map +0 -1
  115. package/build/modules/chain/chain.models.d.ts +0 -6
  116. package/build/modules/chain/chain.models.js +0 -42
  117. package/build/modules/chain/chain.models.js.map +0 -1
  118. package/build/modules/chain/chain.router.d.ts +0 -364
  119. package/build/modules/chain/chain.router.js +0 -84
  120. package/build/modules/chain/chain.router.js.map +0 -1
  121. package/build/modules/chain/chain.schema.d.ts +0 -323
  122. package/build/modules/chain/chain.schema.js +0 -41
  123. package/build/modules/chain/chain.schema.js.map +0 -1
  124. package/build/modules/chain/chain.service.d.ts +0 -15
  125. package/build/modules/chain/chain.service.js +0 -115
  126. package/build/modules/chain/chain.service.js.map +0 -1
  127. package/build/modules/chain/chain.types.d.ts +0 -20
  128. package/build/modules/chain/chain.types.js +0 -2
  129. package/build/modules/chain/chain.types.js.map +0 -1
  130. package/build/modules/chain/index.d.ts +0 -5
  131. package/build/modules/chain/index.js +0 -6
  132. package/build/modules/chain/index.js.map +0 -1
  133. package/build/modules/character/character.models.d.ts +0 -14
  134. package/build/modules/character/character.models.js +0 -123
  135. package/build/modules/character/character.models.js.map +0 -1
  136. package/build/modules/character/character.router.d.ts +0 -945
  137. package/build/modules/character/character.router.js +0 -246
  138. package/build/modules/character/character.router.js.map +0 -1
  139. package/build/modules/character/character.schema.d.ts +0 -1239
  140. package/build/modules/character/character.schema.js +0 -67
  141. package/build/modules/character/character.schema.js.map +0 -1
  142. package/build/modules/character/character.service.d.ts +0 -73
  143. package/build/modules/character/character.service.js +0 -533
  144. package/build/modules/character/character.service.js.map +0 -1
  145. package/build/modules/character/character.types.d.ts +0 -48
  146. package/build/modules/character/character.types.js +0 -2
  147. package/build/modules/character/character.types.js.map +0 -1
  148. package/build/modules/character/index.d.ts +0 -5
  149. package/build/modules/character/index.js +0 -6
  150. package/build/modules/character/index.js.map +0 -1
  151. package/build/modules/chat/chat.models.d.ts +0 -4
  152. package/build/modules/chat/chat.models.js +0 -35
  153. package/build/modules/chat/chat.models.js.map +0 -1
  154. package/build/modules/chat/chat.router.d.ts +0 -223
  155. package/build/modules/chat/chat.router.js +0 -51
  156. package/build/modules/chat/chat.router.js.map +0 -1
  157. package/build/modules/chat/chat.schema.d.ts +0 -183
  158. package/build/modules/chat/chat.schema.js +0 -29
  159. package/build/modules/chat/chat.schema.js.map +0 -1
  160. package/build/modules/chat/chat.service.d.ts +0 -12
  161. package/build/modules/chat/chat.service.js +0 -85
  162. package/build/modules/chat/chat.service.js.map +0 -1
  163. package/build/modules/chat/chat.types.d.ts +0 -14
  164. package/build/modules/chat/chat.types.js +0 -2
  165. package/build/modules/chat/chat.types.js.map +0 -1
  166. package/build/modules/chat/index.d.ts +0 -5
  167. package/build/modules/chat/index.js +0 -6
  168. package/build/modules/chat/index.js.map +0 -1
  169. package/build/modules/collection/collection.models.d.ts +0 -9
  170. package/build/modules/collection/collection.models.js +0 -69
  171. package/build/modules/collection/collection.models.js.map +0 -1
  172. package/build/modules/collection/collection.router.d.ts +0 -361
  173. package/build/modules/collection/collection.router.js +0 -71
  174. package/build/modules/collection/collection.router.js.map +0 -1
  175. package/build/modules/collection/collection.schema.d.ts +0 -676
  176. package/build/modules/collection/collection.schema.js +0 -70
  177. package/build/modules/collection/collection.schema.js.map +0 -1
  178. package/build/modules/collection/collection.service.d.ts +0 -15
  179. package/build/modules/collection/collection.service.js +0 -117
  180. package/build/modules/collection/collection.service.js.map +0 -1
  181. package/build/modules/collection/collection.types.d.ts +0 -29
  182. package/build/modules/collection/collection.types.js +0 -2
  183. package/build/modules/collection/collection.types.js.map +0 -1
  184. package/build/modules/collection/index.d.ts +0 -5
  185. package/build/modules/collection/index.js +0 -6
  186. package/build/modules/collection/index.js.map +0 -1
  187. package/build/modules/core/core.models.d.ts +0 -123
  188. package/build/modules/core/core.models.js +0 -811
  189. package/build/modules/core/core.models.js.map +0 -1
  190. package/build/modules/core/core.router.d.ts +0 -5297
  191. package/build/modules/core/core.router.js +0 -1372
  192. package/build/modules/core/core.router.js.map +0 -1
  193. package/build/modules/core/core.schema.d.ts +0 -5918
  194. package/build/modules/core/core.schema.js +0 -519
  195. package/build/modules/core/core.schema.js.map +0 -1
  196. package/build/modules/core/core.service.d.ts +0 -270
  197. package/build/modules/core/core.service.js +0 -2515
  198. package/build/modules/core/core.service.js.map +0 -1
  199. package/build/modules/core/core.types.d.ts +0 -251
  200. package/build/modules/core/core.types.js +0 -2
  201. package/build/modules/core/core.types.js.map +0 -1
  202. package/build/modules/core/index.d.ts +0 -5
  203. package/build/modules/core/index.js +0 -6
  204. package/build/modules/core/index.js.map +0 -1
  205. package/build/modules/core/mail/applyPatchesOrMail.d.ts +0 -72
  206. package/build/modules/core/mail/applyPatchesOrMail.js +0 -416
  207. package/build/modules/core/mail/applyPatchesOrMail.js.map +0 -1
  208. package/build/modules/core/mail/mailClaimablePatchesBatch.d.ts +0 -51
  209. package/build/modules/core/mail/mailClaimablePatchesBatch.js +0 -239
  210. package/build/modules/core/mail/mailClaimablePatchesBatch.js.map +0 -1
  211. package/build/modules/game/game.models.d.ts +0 -6
  212. package/build/modules/game/game.models.js +0 -29
  213. package/build/modules/game/game.models.js.map +0 -1
  214. package/build/modules/game/game.router.d.ts +0 -428
  215. package/build/modules/game/game.router.js +0 -90
  216. package/build/modules/game/game.router.js.map +0 -1
  217. package/build/modules/game/game.schema.d.ts +0 -344
  218. package/build/modules/game/game.schema.js +0 -14
  219. package/build/modules/game/game.schema.js.map +0 -1
  220. package/build/modules/game/game.service.d.ts +0 -16
  221. package/build/modules/game/game.service.js +0 -111
  222. package/build/modules/game/game.service.js.map +0 -1
  223. package/build/modules/game/game.types.d.ts +0 -20
  224. package/build/modules/game/game.types.js +0 -2
  225. package/build/modules/game/game.types.js.map +0 -1
  226. package/build/modules/game/index.d.ts +0 -5
  227. package/build/modules/game/index.js +0 -5
  228. package/build/modules/game/index.js.map +0 -1
  229. package/build/modules/interface/index.d.ts +0 -5
  230. package/build/modules/interface/index.js +0 -6
  231. package/build/modules/interface/index.js.map +0 -1
  232. package/build/modules/interface/interface.canonicalize.d.ts +0 -2
  233. package/build/modules/interface/interface.canonicalize.js +0 -241
  234. package/build/modules/interface/interface.canonicalize.js.map +0 -1
  235. package/build/modules/interface/interface.models.d.ts +0 -6
  236. package/build/modules/interface/interface.models.js +0 -30
  237. package/build/modules/interface/interface.models.js.map +0 -1
  238. package/build/modules/interface/interface.router.d.ts +0 -472
  239. package/build/modules/interface/interface.router.js +0 -113
  240. package/build/modules/interface/interface.router.js.map +0 -1
  241. package/build/modules/interface/interface.schema.d.ts +0 -313
  242. package/build/modules/interface/interface.schema.js +0 -36
  243. package/build/modules/interface/interface.schema.js.map +0 -1
  244. package/build/modules/interface/interface.service.d.ts +0 -19
  245. package/build/modules/interface/interface.service.js +0 -168
  246. package/build/modules/interface/interface.service.js.map +0 -1
  247. package/build/modules/interface/interface.types.d.ts +0 -19
  248. package/build/modules/interface/interface.types.js +0 -2
  249. package/build/modules/interface/interface.types.js.map +0 -1
  250. package/build/modules/item/index.d.ts +0 -5
  251. package/build/modules/item/index.js +0 -6
  252. package/build/modules/item/index.js.map +0 -1
  253. package/build/modules/item/item.models.d.ts +0 -16
  254. package/build/modules/item/item.models.js +0 -101
  255. package/build/modules/item/item.models.js.map +0 -1
  256. package/build/modules/item/item.router.d.ts +0 -263
  257. package/build/modules/item/item.router.js +0 -70
  258. package/build/modules/item/item.router.js.map +0 -1
  259. package/build/modules/item/item.schema.d.ts +0 -778
  260. package/build/modules/item/item.schema.js +0 -56
  261. package/build/modules/item/item.schema.js.map +0 -1
  262. package/build/modules/item/item.service.d.ts +0 -13
  263. package/build/modules/item/item.service.js +0 -116
  264. package/build/modules/item/item.service.js.map +0 -1
  265. package/build/modules/item/item.types.d.ts +0 -55
  266. package/build/modules/item/item.types.js +0 -2
  267. package/build/modules/item/item.types.js.map +0 -1
  268. package/build/modules/job/index.d.ts +0 -5
  269. package/build/modules/job/index.js +0 -6
  270. package/build/modules/job/index.js.map +0 -1
  271. package/build/modules/job/job.models.d.ts +0 -3
  272. package/build/modules/job/job.models.js +0 -9
  273. package/build/modules/job/job.models.js.map +0 -1
  274. package/build/modules/job/job.router.d.ts +0 -146
  275. package/build/modules/job/job.router.js +0 -32
  276. package/build/modules/job/job.router.js.map +0 -1
  277. package/build/modules/job/job.schema.d.ts +0 -67
  278. package/build/modules/job/job.schema.js +0 -7
  279. package/build/modules/job/job.schema.js.map +0 -1
  280. package/build/modules/job/job.service.d.ts +0 -7
  281. package/build/modules/job/job.service.js +0 -144
  282. package/build/modules/job/job.service.js.map +0 -1
  283. package/build/modules/job/job.types.d.ts +0 -16
  284. package/build/modules/job/job.types.js +0 -2
  285. package/build/modules/job/job.types.js.map +0 -1
  286. package/build/modules/market/index.d.ts +0 -5
  287. package/build/modules/market/index.js +0 -6
  288. package/build/modules/market/index.js.map +0 -1
  289. package/build/modules/market/market.models.d.ts +0 -14
  290. package/build/modules/market/market.models.js +0 -98
  291. package/build/modules/market/market.models.js.map +0 -1
  292. package/build/modules/market/market.router.d.ts +0 -230
  293. package/build/modules/market/market.router.js +0 -56
  294. package/build/modules/market/market.router.js.map +0 -1
  295. package/build/modules/market/market.schema.d.ts +0 -949
  296. package/build/modules/market/market.schema.js +0 -101
  297. package/build/modules/market/market.schema.js.map +0 -1
  298. package/build/modules/market/market.service.d.ts +0 -12
  299. package/build/modules/market/market.service.js +0 -88
  300. package/build/modules/market/market.service.js.map +0 -1
  301. package/build/modules/market/market.types.d.ts +0 -49
  302. package/build/modules/market/market.types.js +0 -2
  303. package/build/modules/market/market.types.js.map +0 -1
  304. package/build/modules/product/index.d.ts +0 -5
  305. package/build/modules/product/index.js +0 -6
  306. package/build/modules/product/index.js.map +0 -1
  307. package/build/modules/product/product.models.d.ts +0 -4
  308. package/build/modules/product/product.models.js +0 -113
  309. package/build/modules/product/product.models.js.map +0 -1
  310. package/build/modules/product/product.router.d.ts +0 -447
  311. package/build/modules/product/product.router.js +0 -71
  312. package/build/modules/product/product.router.js.map +0 -1
  313. package/build/modules/product/product.schema.d.ts +0 -654
  314. package/build/modules/product/product.schema.js +0 -117
  315. package/build/modules/product/product.schema.js.map +0 -1
  316. package/build/modules/product/product.service.d.ts +0 -15
  317. package/build/modules/product/product.service.js +0 -115
  318. package/build/modules/product/product.service.js.map +0 -1
  319. package/build/modules/product/product.types.d.ts +0 -28
  320. package/build/modules/product/product.types.js +0 -2
  321. package/build/modules/product/product.types.js.map +0 -1
  322. package/build/modules/profile/index.d.ts +0 -5
  323. package/build/modules/profile/index.js +0 -6
  324. package/build/modules/profile/index.js.map +0 -1
  325. package/build/modules/profile/profile.models.d.ts +0 -2
  326. package/build/modules/profile/profile.models.js +0 -165
  327. package/build/modules/profile/profile.models.js.map +0 -1
  328. package/build/modules/profile/profile.router.d.ts +0 -163
  329. package/build/modules/profile/profile.router.js +0 -54
  330. package/build/modules/profile/profile.router.js.map +0 -1
  331. package/build/modules/profile/profile.schema.d.ts +0 -1
  332. package/build/modules/profile/profile.schema.js +0 -138
  333. package/build/modules/profile/profile.schema.js.map +0 -1
  334. package/build/modules/profile/profile.service.d.ts +0 -11
  335. package/build/modules/profile/profile.service.js +0 -120
  336. package/build/modules/profile/profile.service.js.map +0 -1
  337. package/build/modules/profile/profile.types.d.ts +0 -16
  338. package/build/modules/profile/profile.types.js +0 -2
  339. package/build/modules/profile/profile.types.js.map +0 -1
  340. package/build/modules/raffle/index.d.ts +0 -5
  341. package/build/modules/raffle/index.js +0 -6
  342. package/build/modules/raffle/index.js.map +0 -1
  343. package/build/modules/raffle/raffle.models.d.ts +0 -6
  344. package/build/modules/raffle/raffle.models.js +0 -36
  345. package/build/modules/raffle/raffle.models.js.map +0 -1
  346. package/build/modules/raffle/raffle.router.d.ts +0 -299
  347. package/build/modules/raffle/raffle.router.js +0 -71
  348. package/build/modules/raffle/raffle.router.js.map +0 -1
  349. package/build/modules/raffle/raffle.schema.d.ts +0 -265
  350. package/build/modules/raffle/raffle.schema.js +0 -21
  351. package/build/modules/raffle/raffle.schema.js.map +0 -1
  352. package/build/modules/raffle/raffle.service.d.ts +0 -15
  353. package/build/modules/raffle/raffle.service.js +0 -115
  354. package/build/modules/raffle/raffle.service.js.map +0 -1
  355. package/build/modules/raffle/raffle.types.d.ts +0 -25
  356. package/build/modules/raffle/raffle.types.js +0 -2
  357. package/build/modules/raffle/raffle.types.js.map +0 -1
  358. package/build/modules/skill/index.d.ts +0 -5
  359. package/build/modules/skill/index.js +0 -6
  360. package/build/modules/skill/index.js.map +0 -1
  361. package/build/modules/skill/skill.models.d.ts +0 -9
  362. package/build/modules/skill/skill.models.js +0 -9
  363. package/build/modules/skill/skill.models.js.map +0 -1
  364. package/build/modules/skill/skill.router.d.ts +0 -659
  365. package/build/modules/skill/skill.router.js +0 -152
  366. package/build/modules/skill/skill.router.js.map +0 -1
  367. package/build/modules/skill/skill.schema.d.ts +0 -548
  368. package/build/modules/skill/skill.schema.js +0 -26
  369. package/build/modules/skill/skill.schema.js.map +0 -1
  370. package/build/modules/skill/skill.service.d.ts +0 -32
  371. package/build/modules/skill/skill.service.js +0 -279
  372. package/build/modules/skill/skill.service.js.map +0 -1
  373. package/build/modules/skill/skill.types.d.ts +0 -29
  374. package/build/modules/skill/skill.types.js +0 -2
  375. package/build/modules/skill/skill.types.js.map +0 -1
  376. package/build/modules/video/index.d.ts +0 -5
  377. package/build/modules/video/index.js +0 -6
  378. package/build/modules/video/index.js.map +0 -1
  379. package/build/modules/video/video.models.d.ts +0 -7
  380. package/build/modules/video/video.models.js +0 -19
  381. package/build/modules/video/video.models.js.map +0 -1
  382. package/build/modules/video/video.router.d.ts +0 -563
  383. package/build/modules/video/video.router.js +0 -112
  384. package/build/modules/video/video.router.js.map +0 -1
  385. package/build/modules/video/video.schema.d.ts +0 -456
  386. package/build/modules/video/video.schema.js +0 -31
  387. package/build/modules/video/video.schema.js.map +0 -1
  388. package/build/modules/video/video.service.d.ts +0 -23
  389. package/build/modules/video/video.service.js +0 -197
  390. package/build/modules/video/video.service.js.map +0 -1
  391. package/build/modules/video/video.types.d.ts +0 -28
  392. package/build/modules/video/video.types.js +0 -2
  393. package/build/modules/video/video.types.js.map +0 -1
  394. package/build/router.d.ts +0 -10406
  395. package/build/router.js +0 -44
  396. package/build/router.js.map +0 -1
  397. package/build/types.d.ts +0 -164
  398. package/build/types.js +0 -19
  399. package/build/types.js.map +0 -1
  400. package/build/util/api.js.map +0 -1
  401. package/build/util/array.js.map +0 -1
  402. package/build/util/browser.js.map +0 -1
  403. package/build/util/codebase.js.map +0 -1
  404. package/build/util/config.js.map +0 -1
  405. package/build/util/db/index.d.ts +0 -5
  406. package/build/util/db/index.js +0 -7
  407. package/build/util/db/index.js.map +0 -1
  408. package/build/util/db/isPostgresError.d.ts +0 -2
  409. package/build/util/db/isPostgresError.js +0 -8
  410. package/build/util/db/isPostgresError.js.map +0 -1
  411. package/build/util/db/isUniqueConstraintViolation.d.ts +0 -2
  412. package/build/util/db/isUniqueConstraintViolation.js +0 -3
  413. package/build/util/db/isUniqueConstraintViolation.js.map +0 -1
  414. package/build/util/db.d.ts +0 -6
  415. package/build/util/db.js +0 -51
  416. package/build/util/db.js.map +0 -1
  417. package/build/util/decoder.js.map +0 -1
  418. package/build/util/decoder.test.d.ts +0 -1
  419. package/build/util/decoder.test.js +0 -7
  420. package/build/util/decoder.test.js.map +0 -1
  421. package/build/util/format.js.map +0 -1
  422. package/build/util/guid.js.map +0 -1
  423. package/build/util/index.d.ts +0 -74
  424. package/build/util/index.js +0 -239
  425. package/build/util/index.js.map +0 -1
  426. package/build/util/json.js.map +0 -1
  427. package/build/util/log.d.ts +0 -1
  428. package/build/util/log.js +0 -6
  429. package/build/util/log.js.map +0 -1
  430. package/build/util/math.js.map +0 -1
  431. package/build/util/merkle.js.map +0 -1
  432. package/build/util/mongo.js.map +0 -1
  433. package/build/util/number.js.map +0 -1
  434. package/build/util/object.js.map +0 -1
  435. package/build/util/otp.js.map +0 -1
  436. package/build/util/physics.js.map +0 -1
  437. package/build/util/process.js.map +0 -1
  438. package/build/util/rpc.js.map +0 -1
  439. package/build/util/seer.js.map +0 -1
  440. package/build/util/string.js.map +0 -1
  441. package/build/util/text.js.map +0 -1
  442. package/build/util/time/date.js.map +0 -1
  443. package/build/util/time/fancyTimeFormat.js.map +0 -1
  444. package/build/util/time/index.js.map +0 -1
  445. package/build/util/time/now.js.map +0 -1
  446. package/build/util/web3/httpProvider.js.map +0 -1
  447. package/build/util/web3.js.map +0 -1
  448. package/build/util/websocket.js.map +0 -1
  449. package/build/util/zk.js.map +0 -1
  450. package/build/util/zod.js.map +0 -1
  451. package/modules/area/area.models.ts +0 -15
  452. package/modules/area/area.router.ts +0 -74
  453. package/modules/area/area.schema.ts +0 -22
  454. package/modules/area/area.service.ts +0 -124
  455. package/modules/area/area.types.ts +0 -26
  456. package/modules/area/index.ts +0 -5
  457. package/modules/asset/asset.models.ts +0 -59
  458. package/modules/asset/asset.router.ts +0 -55
  459. package/modules/asset/asset.schema.ts +0 -27
  460. package/modules/asset/asset.service.ts +0 -85
  461. package/modules/asset/asset.types.ts +0 -22
  462. package/modules/asset/index.ts +0 -5
  463. package/modules/chain/chain.models.ts +0 -50
  464. package/modules/chain/chain.router.ts +0 -104
  465. package/modules/chain/chain.schema.ts +0 -52
  466. package/modules/chain/chain.service.ts +0 -167
  467. package/modules/chain/chain.types.ts +0 -24
  468. package/modules/chain/index.ts +0 -5
  469. package/modules/character/character.models.ts +0 -174
  470. package/modules/character/character.router.ts +0 -314
  471. package/modules/character/character.schema.ts +0 -147
  472. package/modules/character/character.service.ts +0 -876
  473. package/modules/character/character.types.ts +0 -64
  474. package/modules/character/index.ts +0 -5
  475. package/modules/chat/chat.models.ts +0 -43
  476. package/modules/chat/chat.router.ts +0 -67
  477. package/modules/chat/chat.schema.ts +0 -36
  478. package/modules/chat/chat.service.ts +0 -128
  479. package/modules/chat/chat.types.ts +0 -20
  480. package/modules/chat/index.ts +0 -5
  481. package/modules/collection/collection.models.ts +0 -76
  482. package/modules/collection/collection.router.ts +0 -91
  483. package/modules/collection/collection.schema.ts +0 -90
  484. package/modules/collection/collection.service.ts +0 -192
  485. package/modules/collection/collection.types.ts +0 -36
  486. package/modules/collection/index.ts +0 -5
  487. package/modules/core/core.models.ts +0 -1380
  488. package/modules/core/core.router.ts +0 -1781
  489. package/modules/core/core.schema.ts +0 -847
  490. package/modules/core/core.service.ts +0 -2824
  491. package/modules/core/core.types.ts +0 -340
  492. package/modules/core/index.ts +0 -5
  493. package/modules/core/mail/applyPatchesOrMail.ts +0 -568
  494. package/modules/core/mail/mailClaimablePatchesBatch.ts +0 -381
  495. package/modules/game/game.models.ts +0 -53
  496. package/modules/game/game.router.ts +0 -110
  497. package/modules/game/game.schema.ts +0 -23
  498. package/modules/game/game.service.ts +0 -143
  499. package/modules/game/game.types.ts +0 -28
  500. package/modules/game/index.ts +0 -5
  501. package/modules/interface/index.ts +0 -5
  502. package/modules/interface/interface.canonicalize.ts +0 -279
  503. package/modules/interface/interface.models.ts +0 -40
  504. package/modules/interface/interface.router.ts +0 -175
  505. package/modules/interface/interface.schema.ts +0 -59
  506. package/modules/interface/interface.service.ts +0 -356
  507. package/modules/interface/interface.types.ts +0 -25
  508. package/modules/item/index.ts +0 -5
  509. package/modules/item/item.models.ts +0 -124
  510. package/modules/item/item.router.ts +0 -103
  511. package/modules/item/item.schema.ts +0 -120
  512. package/modules/item/item.service.ts +0 -167
  513. package/modules/item/item.types.ts +0 -74
  514. package/modules/job/index.ts +0 -5
  515. package/modules/job/job.models.ts +0 -14
  516. package/modules/job/job.router.ts +0 -44
  517. package/modules/job/job.schema.ts +0 -9
  518. package/modules/job/job.service.ts +0 -243
  519. package/modules/job/job.types.ts +0 -23
  520. package/modules/market/index.ts +0 -5
  521. package/modules/market/market.models.ts +0 -113
  522. package/modules/market/market.router.ts +0 -73
  523. package/modules/market/market.schema.ts +0 -140
  524. package/modules/market/market.service.ts +0 -122
  525. package/modules/market/market.types.ts +0 -56
  526. package/modules/product/index.ts +0 -5
  527. package/modules/product/product.models.ts +0 -166
  528. package/modules/product/product.router.ts +0 -93
  529. package/modules/product/product.schema.ts +0 -149
  530. package/modules/product/product.service.ts +0 -160
  531. package/modules/product/product.types.ts +0 -33
  532. package/modules/profile/index.ts +0 -5
  533. package/modules/profile/profile.models.ts +0 -214
  534. package/modules/profile/profile.router.ts +0 -72
  535. package/modules/profile/profile.schema.ts +0 -156
  536. package/modules/profile/profile.service.ts +0 -149
  537. package/modules/profile/profile.types.ts +0 -22
  538. package/modules/raffle/index.ts +0 -5
  539. package/modules/raffle/raffle.models.ts +0 -44
  540. package/modules/raffle/raffle.router.ts +0 -90
  541. package/modules/raffle/raffle.schema.ts +0 -32
  542. package/modules/raffle/raffle.service.ts +0 -167
  543. package/modules/raffle/raffle.types.ts +0 -30
  544. package/modules/skill/index.ts +0 -5
  545. package/modules/skill/skill.models.ts +0 -16
  546. package/modules/skill/skill.router.ts +0 -201
  547. package/modules/skill/skill.schema.ts +0 -40
  548. package/modules/skill/skill.service.ts +0 -390
  549. package/modules/skill/skill.types.ts +0 -33
  550. package/modules/video/index.ts +0 -5
  551. package/modules/video/video.models.ts +0 -25
  552. package/modules/video/video.router.ts +0 -143
  553. package/modules/video/video.schema.ts +0 -46
  554. package/modules/video/video.service.ts +0 -274
  555. package/modules/video/video.types.ts +0 -33
  556. package/router.ts +0 -49
  557. package/types.ts +0 -183
  558. package/util/db/index.ts +0 -7
  559. package/util/db/isPostgresError.ts +0 -9
  560. package/util/db/isUniqueConstraintViolation.ts +0 -3
  561. package/util/db.ts +0 -62
  562. package/util/index.ts +0 -351
  563. package/util/log.ts +0 -5
  564. /package/{util/api.ts → api.ts} +0 -0
  565. /package/{util/array.ts → array.ts} +0 -0
  566. /package/{util/browser.ts → browser.ts} +0 -0
  567. /package/build/{util/api.d.ts → api.d.ts} +0 -0
  568. /package/build/{util/api.js → api.js} +0 -0
  569. /package/build/{util/array.d.ts → array.d.ts} +0 -0
  570. /package/build/{util/array.js → array.js} +0 -0
  571. /package/build/{util/browser.d.ts → browser.d.ts} +0 -0
  572. /package/build/{util/browser.js → browser.js} +0 -0
  573. /package/build/{util/codebase.d.ts → codebase.d.ts} +0 -0
  574. /package/build/{util/codebase.js → codebase.js} +0 -0
  575. /package/build/{util/config.d.ts → config.d.ts} +0 -0
  576. /package/build/{util/config.js → config.js} +0 -0
  577. /package/build/{util/decoder.d.ts → decoder.d.ts} +0 -0
  578. /package/build/{util/format.d.ts → format.d.ts} +0 -0
  579. /package/build/{util/format.js → format.js} +0 -0
  580. /package/build/{util/guid.d.ts → guid.d.ts} +0 -0
  581. /package/build/{util/guid.js → guid.js} +0 -0
  582. /package/build/{util/json.d.ts → json.d.ts} +0 -0
  583. /package/build/{util/json.js → json.js} +0 -0
  584. /package/build/{util/math.d.ts → math.d.ts} +0 -0
  585. /package/build/{util/math.js → math.js} +0 -0
  586. /package/build/{util/merkle.d.ts → merkle.d.ts} +0 -0
  587. /package/build/{util/mongo.d.ts → mongo.d.ts} +0 -0
  588. /package/build/{util/number.d.ts → number.d.ts} +0 -0
  589. /package/build/{util/number.js → number.js} +0 -0
  590. /package/build/{util/object.d.ts → object.d.ts} +0 -0
  591. /package/build/{util/object.js → object.js} +0 -0
  592. /package/build/{util/otp.d.ts → otp.d.ts} +0 -0
  593. /package/build/{util/otp.js → otp.js} +0 -0
  594. /package/build/{util/physics.d.ts → physics.d.ts} +0 -0
  595. /package/build/{util/physics.js → physics.js} +0 -0
  596. /package/build/{util/process.d.ts → process.d.ts} +0 -0
  597. /package/build/{util/rpc.d.ts → rpc.d.ts} +0 -0
  598. /package/build/{util/rpc.js → rpc.js} +0 -0
  599. /package/build/{util/seer.d.ts → seer.d.ts} +0 -0
  600. /package/build/{util/seer.js → seer.js} +0 -0
  601. /package/build/{util/string.d.ts → string.d.ts} +0 -0
  602. /package/build/{util/string.js → string.js} +0 -0
  603. /package/build/{util/text.d.ts → text.d.ts} +0 -0
  604. /package/build/{util/text.js → text.js} +0 -0
  605. /package/build/{util/time → time}/date.d.ts +0 -0
  606. /package/build/{util/time → time}/date.js +0 -0
  607. /package/build/{util/time → time}/fancyTimeFormat.d.ts +0 -0
  608. /package/build/{util/time → time}/fancyTimeFormat.js +0 -0
  609. /package/build/{util/time → time}/index.d.ts +0 -0
  610. /package/build/{util/time → time}/index.js +0 -0
  611. /package/build/{util/time → time}/now.d.ts +0 -0
  612. /package/build/{util/time → time}/now.js +0 -0
  613. /package/build/{util/web3 → web3}/httpProvider.d.ts +0 -0
  614. /package/build/{util/web3 → web3}/httpProvider.js +0 -0
  615. /package/build/{util/web3.d.ts → web3.d.ts} +0 -0
  616. /package/build/{util/websocket.d.ts → websocket.d.ts} +0 -0
  617. /package/build/{util/zk.d.ts → zk.d.ts} +0 -0
  618. /package/build/{util/zk.js → zk.js} +0 -0
  619. /package/{util/codebase.ts → codebase.ts} +0 -0
  620. /package/{util/config.ts → config.ts} +0 -0
  621. /package/{util/decoder.test.ts → decoder.test.ts} +0 -0
  622. /package/{util/format.ts → format.ts} +0 -0
  623. /package/{util/guid.ts → guid.ts} +0 -0
  624. /package/{util/json.ts → json.ts} +0 -0
  625. /package/{util/math.ts → math.ts} +0 -0
  626. /package/{util/number.ts → number.ts} +0 -0
  627. /package/{util/object.ts → object.ts} +0 -0
  628. /package/{util/otp.ts → otp.ts} +0 -0
  629. /package/{util/physics.ts → physics.ts} +0 -0
  630. /package/{util/rpc.ts → rpc.ts} +0 -0
  631. /package/{util/seer.ts → seer.ts} +0 -0
  632. /package/{util/string.ts → string.ts} +0 -0
  633. /package/{util/text.ts → text.ts} +0 -0
  634. /package/{util/time → time}/date.ts +0 -0
  635. /package/{util/time → time}/fancyTimeFormat.ts +0 -0
  636. /package/{util/time → time}/index.ts +0 -0
  637. /package/{util/time → time}/now.ts +0 -0
  638. /package/{util/types → types}/mongo.d.ts +0 -0
  639. /package/{util/web3 → web3}/httpProvider.ts +0 -0
  640. /package/{util/zk.ts → zk.ts} +0 -0
@@ -1,274 +0,0 @@
1
- import type {
2
- Video,
3
- VideoParticipant,
4
- VideoDialogue,
5
- VideoTranscript,
6
- VideoScene,
7
- RouterContext,
8
- Router,
9
- RouterInput,
10
- RouterOutput,
11
- } from './video.types';
12
- import { getFilter } from '../../util/api';
13
-
14
- export class Service {
15
- async getVideo(input: RouterInput['getVideo'], ctx: RouterContext): Promise<RouterOutput['getVideo']> {
16
- if (!input) throw new Error('Input should not be void');
17
- console.log('Video.Service.getVideo', input.query);
18
-
19
- const filter = getFilter(input.query);
20
- const video = await ctx.app.model.Video.findOne(filter).lean().exec();
21
- if (!video) throw new Error('Video not found');
22
-
23
- return video as Video;
24
- }
25
-
26
- async createVideo(input: RouterInput['createVideo'], ctx: RouterContext): Promise<RouterOutput['createVideo']> {
27
- if (!input) throw new Error('Input should not be void');
28
- console.log('Video.Service.createVideo', input.data);
29
-
30
- const video = await ctx.app.model.Video.create(input.data);
31
- return video as Video;
32
- }
33
-
34
- async updateVideo(input: RouterInput['updateVideo'], ctx: RouterContext): Promise<RouterOutput['updateVideo']> {
35
- if (!input) throw new Error('Input should not be void');
36
- console.log('Video.Service.updateVideo', input.query, input.data);
37
-
38
- const filter = getFilter(input.query);
39
- const updatedVideo = await ctx.app.model.Video.findOneAndUpdate(filter, input.data, { new: true }).lean().exec();
40
- if (!updatedVideo) throw new Error('Video update failed');
41
-
42
- return updatedVideo as Video;
43
- }
44
-
45
- async deleteVideo(input: RouterInput['deleteVideo'], ctx: RouterContext): Promise<RouterOutput['deleteVideo']> {
46
- if (!input) throw new Error('Input should not be void');
47
- console.log('Video.Service.deleteVideo', input.query);
48
-
49
- const filter = getFilter(input.query);
50
- const video = await ctx.app.model.Video.findOneAndDelete(filter).lean().exec();
51
- if (!video) throw new Error('Video not found');
52
-
53
- return video as Video;
54
- }
55
-
56
- // Similar changes for VideoParticipant, VideoDialogue, VideoTranscript, VideoScene...
57
-
58
- async getVideoParticipant(
59
- input: RouterInput['getVideoParticipant'],
60
- ctx: RouterContext
61
- ): Promise<RouterOutput['getVideoParticipant']> {
62
- if (!input) throw new Error('Input should not be void');
63
- console.log('Video.Service.getVideoParticipant', input.query);
64
-
65
- const filter = getFilter(input.query);
66
- const participant = await ctx.app.model.VideoParticipant.findOne(filter).lean().exec();
67
- if (!participant) throw new Error('VideoParticipant not found');
68
-
69
- return participant as VideoParticipant;
70
- }
71
-
72
- async createVideoParticipant(
73
- input: RouterInput['createVideoParticipant'],
74
- ctx: RouterContext
75
- ): Promise<RouterOutput['createVideoParticipant']> {
76
- if (!input) throw new Error('Input should not be void');
77
- console.log('Video.Service.createVideoParticipant', input.data);
78
-
79
- const participant = await ctx.app.model.VideoParticipant.create(input.data);
80
- return participant as VideoParticipant;
81
- }
82
-
83
- async updateVideoParticipant(
84
- input: RouterInput['updateVideoParticipant'],
85
- ctx: RouterContext
86
- ): Promise<RouterOutput['updateVideoParticipant']> {
87
- if (!input) throw new Error('Input should not be void');
88
- console.log('Video.Service.updateVideoParticipant', input.query, input.data);
89
-
90
- const filter = getFilter(input.query);
91
- const updatedParticipant = await ctx.app.model.VideoParticipant.findOneAndUpdate(filter, input.data, { new: true })
92
- .lean()
93
- .exec();
94
- if (!updatedParticipant) throw new Error('VideoParticipant update failed');
95
-
96
- return updatedParticipant as VideoParticipant;
97
- }
98
-
99
- async deleteVideoParticipant(
100
- input: RouterInput['deleteVideoParticipant'],
101
- ctx: RouterContext
102
- ): Promise<RouterOutput['deleteVideoParticipant']> {
103
- if (!input) throw new Error('Input should not be void');
104
- console.log('Video.Service.deleteVideoParticipant', input.query);
105
-
106
- const filter = getFilter(input.query);
107
- const participant = await ctx.app.model.VideoParticipant.findOneAndDelete(filter).lean().exec();
108
- if (!participant) throw new Error('VideoParticipant not found');
109
-
110
- return participant as VideoParticipant;
111
- }
112
-
113
- async getVideoDialogue(
114
- input: RouterInput['getVideoDialogue'],
115
- ctx: RouterContext
116
- ): Promise<RouterOutput['getVideoDialogue']> {
117
- if (!input) throw new Error('Input should not be void');
118
- console.log('Video.Service.getVideoDialogue', input.query);
119
-
120
- const filter = getFilter(input.query);
121
- const dialogue = await ctx.app.model.VideoDialogue.findOne(filter).lean().exec();
122
- if (!dialogue) throw new Error('VideoDialogue not found');
123
-
124
- return dialogue as VideoDialogue;
125
- }
126
-
127
- async createVideoDialogue(
128
- input: RouterInput['createVideoDialogue'],
129
- ctx: RouterContext
130
- ): Promise<RouterOutput['createVideoDialogue']> {
131
- if (!input) throw new Error('Input should not be void');
132
- console.log('Video.Service.createVideoDialogue', input.data);
133
-
134
- const dialogue = await ctx.app.model.VideoDialogue.create(input.data);
135
- return dialogue as VideoDialogue;
136
- }
137
-
138
- async updateVideoDialogue(
139
- input: RouterInput['updateVideoDialogue'],
140
- ctx: RouterContext
141
- ): Promise<RouterOutput['updateVideoDialogue']> {
142
- if (!input) throw new Error('Input should not be void');
143
- console.log('Video.Service.updateVideoDialogue', input.query, input.data);
144
-
145
- const filter = getFilter(input.query);
146
- const updatedDialogue = await ctx.app.model.VideoDialogue.findOneAndUpdate(filter, input.data, { new: true })
147
- .lean()
148
- .exec();
149
- if (!updatedDialogue) throw new Error('VideoDialogue update failed');
150
-
151
- return updatedDialogue as VideoDialogue;
152
- }
153
-
154
- async deleteVideoDialogue(
155
- input: RouterInput['deleteVideoDialogue'],
156
- ctx: RouterContext
157
- ): Promise<RouterOutput['deleteVideoDialogue']> {
158
- if (!input) throw new Error('Input should not be void');
159
- console.log('Video.Service.deleteVideoDialogue', input.query);
160
-
161
- const filter = getFilter(input.query);
162
- const dialogue = await ctx.app.model.VideoDialogue.findOneAndDelete(filter).lean().exec();
163
- if (!dialogue) throw new Error('VideoDialogue not found');
164
-
165
- return dialogue as VideoDialogue;
166
- }
167
-
168
- async getVideoTranscript(
169
- input: RouterInput['getVideoTranscript'],
170
- ctx: RouterContext
171
- ): Promise<RouterOutput['getVideoTranscript']> {
172
- if (!input) throw new Error('Input should not be void');
173
- console.log('Video.Service.getVideoTranscript', input.query);
174
-
175
- const filter = getFilter(input.query);
176
- const transcript = await ctx.app.model.VideoTranscript.findOne(filter).lean().exec();
177
- if (!transcript) throw new Error('VideoTranscript not found');
178
-
179
- return transcript as VideoTranscript;
180
- }
181
-
182
- async createVideoTranscript(
183
- input: RouterInput['createVideoTranscript'],
184
- ctx: RouterContext
185
- ): Promise<RouterOutput['createVideoTranscript']> {
186
- if (!input) throw new Error('Input should not be void');
187
- console.log('Video.Service.createVideoTranscript', input.data);
188
-
189
- const transcript = await ctx.app.model.VideoTranscript.create(input.data);
190
- return transcript as VideoTranscript;
191
- }
192
-
193
- async updateVideoTranscript(
194
- input: RouterInput['updateVideoTranscript'],
195
- ctx: RouterContext
196
- ): Promise<RouterOutput['updateVideoTranscript']> {
197
- if (!input) throw new Error('Input should not be void');
198
- console.log('Video.Service.updateVideoTranscript', input.query, input.data);
199
-
200
- const filter = getFilter(input.query);
201
- const updatedTranscript = await ctx.app.model.VideoTranscript.findOneAndUpdate(filter, input.data, { new: true })
202
- .lean()
203
- .exec();
204
- if (!updatedTranscript) throw new Error('VideoTranscript update failed');
205
-
206
- return updatedTranscript as VideoTranscript;
207
- }
208
-
209
- async deleteVideoTranscript(
210
- input: RouterInput['deleteVideoTranscript'],
211
- ctx: RouterContext
212
- ): Promise<RouterOutput['deleteVideoTranscript']> {
213
- if (!input) throw new Error('Input should not be void');
214
- console.log('Video.Service.deleteVideoTranscript', input.query);
215
-
216
- const filter = getFilter(input.query);
217
- const transcript = await ctx.app.model.VideoTranscript.findOneAndDelete(filter).lean().exec();
218
- if (!transcript) throw new Error('VideoTranscript not found');
219
-
220
- return transcript as VideoTranscript;
221
- }
222
-
223
- async getVideoScene(input: RouterInput['getVideoScene'], ctx: RouterContext): Promise<RouterOutput['getVideoScene']> {
224
- if (!input) throw new Error('Input should not be void');
225
- console.log('Video.Service.getVideoScene', input.query);
226
-
227
- const filter = getFilter(input.query);
228
- const scene = await ctx.app.model.VideoScene.findOne(filter).lean().exec();
229
- if (!scene) throw new Error('VideoScene not found');
230
-
231
- return scene as VideoScene;
232
- }
233
-
234
- async createVideoScene(
235
- input: RouterInput['createVideoScene'],
236
- ctx: RouterContext
237
- ): Promise<RouterOutput['createVideoScene']> {
238
- if (!input) throw new Error('Input should not be void');
239
- console.log('Video.Service.createVideoScene', input.data);
240
-
241
- const scene = await ctx.app.model.VideoScene.create(input.data);
242
- return scene as VideoScene;
243
- }
244
-
245
- async updateVideoScene(
246
- input: RouterInput['updateVideoScene'],
247
- ctx: RouterContext
248
- ): Promise<RouterOutput['updateVideoScene']> {
249
- if (!input) throw new Error('Input should not be void');
250
- console.log('Video.Service.updateVideoScene', input.query, input.data);
251
-
252
- const filter = getFilter(input.query);
253
- const updatedScene = await ctx.app.model.VideoScene.findOneAndUpdate(filter, input.data, { new: true })
254
- .lean()
255
- .exec();
256
- if (!updatedScene) throw new Error('VideoScene update failed');
257
-
258
- return updatedScene as VideoScene;
259
- }
260
-
261
- async deleteVideoScene(
262
- input: RouterInput['deleteVideoScene'],
263
- ctx: RouterContext
264
- ): Promise<RouterOutput['deleteVideoScene']> {
265
- if (!input) throw new Error('Input should not be void');
266
- console.log('Video.Service.deleteVideoScene', input.query);
267
-
268
- const filter = getFilter(input.query);
269
- const scene = await ctx.app.model.VideoScene.findOneAndDelete(filter).lean().exec();
270
- if (!scene) throw new Error('VideoScene not found');
271
-
272
- return scene as VideoScene;
273
- }
274
- }
@@ -1,33 +0,0 @@
1
- import { z } from 'zod';
2
- import * as schema from './video.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 './video.router';
7
-
8
- export type * from './video.router';
9
- export type * from './video.service';
10
- export type { RouterContext };
11
-
12
- export type Video = z.infer<typeof schema.Video>;
13
- export type VideoParticipant = z.infer<typeof schema.VideoParticipant>;
14
- export type VideoDialogue = z.infer<typeof schema.VideoDialogue>;
15
- export type VideoTranscript = z.infer<typeof schema.VideoTranscript>;
16
- export type VideoScene = z.infer<typeof schema.VideoScene>;
17
-
18
- export type VideoDocument = Video & Document;
19
- export type VideoParticipantDocument = VideoParticipant & Document;
20
- export type VideoDialogueDocument = VideoDialogue & Document;
21
- export type VideoTranscriptDocument = VideoTranscript & Document;
22
- export type VideoSceneDocument = VideoScene & Document;
23
-
24
- export type Mappings = {
25
- Video: Model<VideoDocument>;
26
- VideoParticipant: Model<VideoParticipantDocument>;
27
- VideoDialogue: Model<VideoDialogueDocument>;
28
- VideoTranscript: Model<VideoTranscriptDocument>;
29
- VideoScene: Model<VideoSceneDocument>;
30
- };
31
-
32
- export type RouterInput = inferRouterInputs<Router>;
33
- export type RouterOutput = inferRouterOutputs<Router>;
package/router.ts DELETED
@@ -1,49 +0,0 @@
1
- import zod from 'zod';
2
- import { initTRPC, TRPCError } from '@trpc/server';
3
- import type { RouterContext } from './types';
4
- import * as Area from './modules/area/area.router';
5
- import * as Asset from './modules/asset/asset.router';
6
- import * as Chain from './modules/chain/chain.router';
7
- import * as Character from './modules/character/character.router';
8
- import * as Chat from './modules/chat/chat.router';
9
- import * as Collection from './modules/collection/collection.router';
10
- import * as Core from './modules/core/core.router';
11
- import * as Game from './modules/game/game.router';
12
- import * as Interface from './modules/interface/interface.router';
13
- import * as Item from './modules/item/item.router';
14
- import * as Job from './modules/job/job.router';
15
- import * as Market from './modules/market/market.router';
16
- import * as Product from './modules/product/product.router';
17
- import * as Profile from './modules/profile/profile.router';
18
- import * as Raffle from './modules/raffle/raffle.router';
19
- import * as Skill from './modules/skill/skill.router';
20
- import * as Video from './modules/video/video.router';
21
-
22
- export const z = zod;
23
- export const t = initTRPC.context<RouterContext>().create();
24
- export const router = t.router;
25
- export const procedure = t.procedure;
26
- export const createCallerFactory = t.createCallerFactory;
27
-
28
- export const createRouter = () =>
29
- router({
30
- area: Area.createRouter(),
31
- asset: Asset.createRouter(),
32
- chain: Chain.createRouter(),
33
- character: Character.createRouter(),
34
- chat: Chat.createRouter(),
35
- collection: Collection.createRouter(),
36
- core: Core.createRouter(),
37
- game: Game.createRouter(),
38
- interface: Interface.createRouter(),
39
- item: Item.createRouter(),
40
- job: Job.createRouter(),
41
- market: Market.createRouter(),
42
- product: Product.createRouter(),
43
- profile: Profile.createRouter(),
44
- raffle: Raffle.createRouter(),
45
- skill: Skill.createRouter(),
46
- video: Video.createRouter(),
47
- });
48
-
49
- export type Router = ReturnType<typeof createRouter>;
package/types.ts DELETED
@@ -1,183 +0,0 @@
1
- // arken/packages/node/types.ts
2
- //
3
- import { createRouter } from './router';
4
-
5
- export * as util from './util';
6
-
7
- // Imports
8
- import * as Area from './modules/area';
9
- import * as Asset from './modules/asset';
10
- import * as Chain from './modules/chain';
11
- import * as Character from './modules/character';
12
- import * as Chat from './modules/chat';
13
- import * as Collection from './modules/collection';
14
- import * as Core from './modules/core';
15
- import * as Game from './modules/game';
16
- import * as Interface from './modules/interface';
17
- import * as Item from './modules/item';
18
- import * as Job from './modules/job';
19
- import * as Market from './modules/market';
20
- import * as Product from './modules/product';
21
- import * as Profile from './modules/profile';
22
- import * as Raffle from './modules/raffle';
23
- import * as Skill from './modules/skill';
24
- import * as Video from './modules/video';
25
-
26
- // Exports
27
- export * as Area from './modules/area';
28
- export * as Asset from './modules/asset';
29
- export * as Chain from './modules/chain';
30
- export * as Character from './modules/character';
31
- export * as Chat from './modules/chat';
32
- export * as Collection from './modules/collection';
33
- export * as Core from './modules/core';
34
- export * as Game from './modules/game';
35
- export * as Interface from './modules/interface';
36
- export * as Item from './modules/item';
37
- export * as Job from './modules/job';
38
- export * as Market from './modules/market';
39
- export * as Product from './modules/product';
40
- export * as Profile from './modules/profile';
41
- export * as Raffle from './modules/raffle';
42
- export * as Skill from './modules/skill';
43
- export * as Video from './modules/video';
44
-
45
- export type * as Schema from './schema';
46
-
47
- export type Router = ReturnType<typeof createRouter>;
48
-
49
- export type ApplicationServiceType = Partial<{
50
- Area: Area.Service;
51
- Asset: Asset.Service;
52
- Chain: Chain.Service;
53
- Character: Character.Service;
54
- Chat: Chat.Service;
55
- Collection: Collection.Service;
56
- Core: Core.Service;
57
- Game: Game.Service;
58
- Interface: Interface.Service;
59
- Item: Item.Service;
60
- Job: Job.Service;
61
- Market: Market.Service;
62
- Product: Product.Service;
63
- Profile: Profile.Service;
64
- Raffle: Raffle.Service;
65
- Skill: Skill.Service;
66
- Video: Video.Service;
67
- }>;
68
-
69
- export type ApplicationModelType = Partial<
70
- Area.Types.Mappings &
71
- Asset.Types.Mappings &
72
- Chain.Types.Mappings &
73
- Character.Types.Mappings &
74
- Chat.Types.Mappings &
75
- Collection.Types.Mappings &
76
- Core.Types.Mappings &
77
- Game.Types.Mappings &
78
- Interface.Types.Mappings &
79
- Item.Types.Mappings &
80
- Job.Types.Mappings &
81
- Market.Types.Mappings &
82
- Product.Types.Mappings &
83
- Profile.Types.Mappings &
84
- Raffle.Types.Mappings &
85
- Skill.Types.Mappings &
86
- Video.Types.Mappings
87
- >;
88
-
89
- export interface Application {
90
- model: ApplicationModelType;
91
- service: ApplicationServiceType;
92
- web3?: any;
93
- }
94
-
95
- export type RouterClient = {
96
- socket: any;
97
- roles: string[];
98
- permissions: any;
99
- profile?: Profile.Types.Profile;
100
- emit: any;
101
- };
102
-
103
- export type RouterContext = {
104
- app: Application;
105
- client?: RouterClient;
106
- profile?: Profile.Types.Profile;
107
- };
108
-
109
- export interface Signature {
110
- hash?: string;
111
- address?: string;
112
- }
113
-
114
- export type Position = {
115
- x: number;
116
- y: number;
117
- z?: number;
118
- };
119
-
120
- export type UnwrapPromise<T> = T extends Promise<infer U> ? U : T;
121
-
122
- export type PatchOp =
123
- | { op: 'set'; key: string; value: any }
124
- | { op: 'unset'; key: string }
125
- | { op: 'inc'; key: string; value: number }
126
- | { op: 'push'; key: string; value: any }
127
- | { op: 'merge'; key: string; value: Record<string, any> };
128
-
129
- export type EntityPatch = {
130
- entityType: string; // allow any string
131
- entityId: string;
132
- baseVersion?: number;
133
- ops: PatchOp[];
134
- claimable?: boolean;
135
- };
136
-
137
- export type GameObjectDef = {
138
- id: string;
139
- type: string; // allow any string
140
- name: string;
141
- position: { x: number; y: number };
142
- radius?: number; // interaction distance
143
- tags?: string[];
144
- meta?: Record<string, any>;
145
- };
146
-
147
- export type Requirement =
148
- | { kind: 'exists'; key: string }
149
- | { kind: 'touchedObject'; objectId: string; afterKey?: string; writeKey: string };
150
-
151
- // Generic effects (can be positive or negative)
152
- export type Effect =
153
- | { kind: 'item.grant'; itemKey: string; quantity?: number }
154
- | { kind: 'currency.grant'; key: string; amount: number } // negative amount allowed
155
- | { kind: 'reputation.delta'; npcId: string; amount: number } // negative allowed
156
- | { kind: 'state.patch'; patch: EntityPatch } // generic patch against any entityType
157
- | { kind: 'ui.unlock'; uiKey: string } // optional, future
158
- | { kind: 'emit'; eventType: string; payload?: any }; // optional, future
159
-
160
- export type QuestDef = {
161
- id: string;
162
- metaverseId: string;
163
- name: string;
164
-
165
- // Requirements can be checked shard-side (for anti-cheat) AND client-side (for UI state)
166
- requirements: Requirement[];
167
-
168
- // Effects are applied on completion/claim (seer-side)
169
- effects: Effect[];
170
-
171
- // keys shard will write (auditing + permissions)
172
- writes?: string[];
173
- };
174
-
175
- type QuestCompleteOp = {
176
- kind: 'quest.complete';
177
- id: string;
178
- ts: number;
179
- questId: string;
180
- metaverseId: string;
181
- evidence?: Record<string, any>;
182
- effects?: any[]; // can include effect refs for replay/debug
183
- };
package/util/db/index.ts DELETED
@@ -1,7 +0,0 @@
1
- import isPostgresError from './isPostgresError'
2
- import isUniqueConstraintViolation from './isUniqueConstraintViolation'
3
-
4
- export default {
5
- isPostgresError,
6
- isUniqueConstraintViolation,
7
- }
@@ -1,9 +0,0 @@
1
- import _ from 'lodash';
2
-
3
- export default (error: unknown): boolean => {
4
- if (!error) {
5
- return false;
6
- }
7
-
8
- return _.every(['severity', 'code', 'detail', 'internalQuery', 'routine'], (attr) => _.has(error as object, attr));
9
- };
@@ -1,3 +0,0 @@
1
- import isPostgresError from './isPostgresError'
2
-
3
- export default (error) => isPostgresError(error) && error.code === '23505'
package/util/db.ts DELETED
@@ -1,62 +0,0 @@
1
- import { v4 as uuidv4 } from 'uuid';
2
- import _ from 'lodash';
3
-
4
- export function generateLongId(): string {
5
- return uuidv4().toUpperCase();
6
- }
7
-
8
- export function generateShortId() {
9
- const timestamp = ((new Date().getTime() / 1000) | 0).toString(16);
10
- return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, () => ((Math.random() * 16) | 0).toString(16)).toLowerCase();
11
- }
12
-
13
- export const uuidFormat = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
14
-
15
- export function generateLongId2(): string {
16
- return uuidFormat
17
- .replace(/[xy]/g, (c) => {
18
- const r = (Math.random() * 16) | 0;
19
- const v = c === 'x' ? r : (r & 0x3) | 0x8;
20
- return v.toString(16);
21
- })
22
- .toUpperCase();
23
- }
24
-
25
- export function decodeRequest(data: any): any {
26
- if (
27
- data === undefined ||
28
- data === null ||
29
- typeof data === 'string' ||
30
- typeof data === 'number' ||
31
- typeof data === 'boolean'
32
- )
33
- return data;
34
-
35
- if (Array.isArray(data)) {
36
- return data.map(decodeRequest);
37
- }
38
-
39
- if (typeof data !== 'object') return data;
40
-
41
- const res: any = {};
42
-
43
- for (const key in data) {
44
- if (key === 'set') {
45
- return data[key];
46
- } else if (['create', 'connectOrCreate', 'upsert'].includes(key)) {
47
- return decodeRequest(data[key]);
48
- } else {
49
- res[key] = decodeRequest(data[key]);
50
- }
51
- }
52
-
53
- return Object.keys(res).length === 0 ? null : res;
54
- }
55
-
56
- export function escapeStringRegexp(string: string): string {
57
- if (typeof string !== 'string') {
58
- throw new TypeError('Expected a string');
59
- }
60
-
61
- return string.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d');
62
- }