@arken/seer-protocol 0.1.2 → 0.1.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 (104) hide show
  1. package/.rush/temp/shrinkwrap-deps.json +246 -2
  2. package/area/area.models.ts +1 -1
  3. package/area/area.router.ts +3 -3
  4. package/area/area.schema.ts +1 -1
  5. package/area/area.types.ts +2 -3
  6. package/area/index.ts +0 -1
  7. package/asset/asset.models.ts +1 -1
  8. package/asset/asset.router.ts +2 -2
  9. package/asset/asset.schema.ts +5 -2
  10. package/asset/asset.types.ts +2 -3
  11. package/asset/index.ts +0 -1
  12. package/chain/chain.models.ts +1 -1
  13. package/chain/chain.router.ts +3 -3
  14. package/chain/chain.schema.ts +21 -6
  15. package/chain/chain.types.ts +2 -3
  16. package/chain/index.ts +0 -1
  17. package/character/character.models.ts +1 -1
  18. package/character/character.router.ts +3 -3
  19. package/character/character.schema.ts +5 -2
  20. package/character/character.types.ts +2 -3
  21. package/character/index.ts +0 -1
  22. package/chat/chat.models.ts +1 -1
  23. package/chat/chat.router.ts +2 -2
  24. package/chat/chat.schema.ts +5 -2
  25. package/chat/chat.types.ts +2 -3
  26. package/chat/index.ts +0 -1
  27. package/collection/collection.models.ts +1 -1
  28. package/collection/collection.router.ts +2 -2
  29. package/collection/collection.schema.ts +1 -1
  30. package/collection/collection.types.ts +2 -3
  31. package/collection/index.ts +0 -1
  32. package/core/core.models.ts +1 -1
  33. package/core/core.router.ts +4 -4
  34. package/core/core.schema.ts +123 -30
  35. package/core/core.types.ts +2 -3
  36. package/core/index.ts +0 -1
  37. package/evolution/evolution.router.ts +11 -11
  38. package/evolution/evolution.types.ts +1 -2
  39. package/evolution/index.ts +0 -1
  40. package/game/game.models.ts +1 -1
  41. package/game/game.router.ts +3 -3
  42. package/game/game.schema.ts +1 -1
  43. package/game/game.types.ts +2 -3
  44. package/game/index.ts +0 -1
  45. package/index.ts +39 -39
  46. package/infinite/index.ts +0 -1
  47. package/infinite/infinite.router.ts +1 -1
  48. package/infinite/infinite.types.ts +1 -2
  49. package/interface/index.ts +0 -1
  50. package/interface/interface.models.ts +1 -1
  51. package/interface/interface.router.ts +3 -3
  52. package/interface/interface.schema.ts +1 -1
  53. package/interface/interface.types.ts +2 -3
  54. package/isles/index.ts +0 -1
  55. package/isles/isles.router.ts +1 -1
  56. package/isles/isles.types.ts +1 -2
  57. package/item/index.ts +0 -1
  58. package/item/item.models.ts +1 -1
  59. package/item/item.router.ts +3 -3
  60. package/item/item.schema.ts +39 -9
  61. package/item/item.types.ts +2 -3
  62. package/job/index.ts +0 -1
  63. package/job/job.models.ts +1 -1
  64. package/job/job.router.ts +3 -3
  65. package/job/job.schema.ts +1 -1
  66. package/job/job.types.ts +2 -3
  67. package/market/index.ts +0 -1
  68. package/market/market.models.ts +1 -1
  69. package/market/market.router.ts +2 -2
  70. package/market/market.schema.ts +13 -4
  71. package/market/market.types.ts +2 -3
  72. package/oasis/index.ts +0 -1
  73. package/oasis/oasis.router.ts +3 -4
  74. package/oasis/oasis.types.ts +1 -2
  75. package/package.json +10 -4
  76. package/product/index.ts +0 -1
  77. package/product/product.models.ts +1 -1
  78. package/product/product.router.ts +2 -2
  79. package/product/product.schema.ts +50 -13
  80. package/product/product.types.ts +2 -3
  81. package/profile/index.ts +0 -1
  82. package/profile/profile.models.ts +1 -1
  83. package/profile/profile.router.ts +3 -3
  84. package/profile/profile.schema.ts +82 -19
  85. package/profile/profile.types.ts +2 -3
  86. package/raffle/index.ts +0 -1
  87. package/raffle/raffle.models.ts +1 -1
  88. package/raffle/raffle.router.ts +2 -2
  89. package/raffle/raffle.schema.ts +1 -1
  90. package/raffle/raffle.types.ts +2 -3
  91. package/skill/index.ts +0 -1
  92. package/skill/skill.models.ts +1 -1
  93. package/skill/skill.router.ts +3 -3
  94. package/skill/skill.schema.ts +17 -5
  95. package/skill/skill.types.ts +2 -3
  96. package/trek/index.ts +0 -1
  97. package/trek/trek.router.ts +1 -1
  98. package/tsconfig.json +25 -17
  99. package/types.ts +35 -54
  100. package/video/index.ts +0 -1
  101. package/video/video.models.ts +1 -1
  102. package/video/video.router.ts +3 -3
  103. package/video/video.schema.ts +1 -1
  104. package/video/video.types.ts +2 -3
@@ -1,4 +1,4 @@
1
- import { z, ObjectId, Entity } from '../../schema';
1
+ import { z, ObjectId, Entity } from '../schema';
2
2
 
3
3
  export const ItemAttribute = Entity.merge(
4
4
  z.object({
@@ -60,7 +60,10 @@ export const ItemAffix = Entity.merge(
60
60
  isPrefix: z.boolean().default(false),
61
61
  isSuffix: z.boolean().default(false),
62
62
  isTitle: z.boolean().default(false),
63
- weight: z.number().min(0).default(1),
63
+ weight: z
64
+ .number()
65
+ .min(0)
66
+ .default(1),
64
67
  typeIds: z.array(ObjectId).optional(),
65
68
  rarityIds: z.array(ObjectId).optional(),
66
69
  })
@@ -80,7 +83,10 @@ export const ItemSkin = Entity.merge(
80
83
 
81
84
  export const ItemTransmute = Entity.merge(
82
85
  z.object({
83
- token: z.string().max(500).min(1),
86
+ token: z
87
+ .string()
88
+ .max(500)
89
+ .min(1),
84
90
  assetId: ObjectId,
85
91
  itemId: ObjectId,
86
92
  chainId: ObjectId.optional(),
@@ -104,17 +110,41 @@ export const Item = Entity.merge(
104
110
  slotIds: z.array(ItemSlot.optional()),
105
111
  setId: ItemSet.optional(),
106
112
  attributes: z.array(ItemAttribute).optional(),
107
- token: z.string().max(500).min(1).optional(),
108
- quantity: z.number().int().nonnegative().default(1),
109
- x: z.number().int().nonnegative().optional(),
110
- y: z.number().int().nonnegative().optional(),
113
+ token: z
114
+ .string()
115
+ .max(500)
116
+ .min(1)
117
+ .optional(),
118
+ quantity: z
119
+ .number()
120
+ .int()
121
+ .nonnegative()
122
+ .default(1),
123
+ x: z
124
+ .number()
125
+ .int()
126
+ .nonnegative()
127
+ .optional(),
128
+ y: z
129
+ .number()
130
+ .int()
131
+ .nonnegative()
132
+ .optional(),
111
133
  distribution: z
112
134
  .enum(['Unknown', 'Found', 'Fundraiser', 'Claimed', 'Crafted', 'Airdrop', 'Reward', 'Farmed', 'Migration'])
113
135
  .default('Unknown'),
114
136
  // properties: z.record(z.any()).optional(),
115
137
  // type: z.string().default('bag'), // stash, bag, equipment, etc.
116
138
  items: z.array(z.lazy(() => Item)).default([]),
117
- capacity: z.number().int().nonnegative().default(60),
118
- points: z.number().int().nonnegative().default(0),
139
+ capacity: z
140
+ .number()
141
+ .int()
142
+ .nonnegative()
143
+ .default(60),
144
+ points: z
145
+ .number()
146
+ .int()
147
+ .nonnegative()
148
+ .default(0),
119
149
  })
120
150
  );
@@ -2,13 +2,12 @@
2
2
 
3
3
  import { z } from 'zod';
4
4
  import * as schema from './item.schema';
5
- import { Document, Model } from '../../util/mongo';
6
- import type { RouterContext } from '../../types';
5
+ import { Document, Model } from '@arken/node/mongo';
6
+ import type { RouterContext } from '../types';
7
7
  import type { inferRouterInputs, inferRouterOutputs } from '@trpc/server';
8
8
  import type { Router } from './item.router';
9
9
 
10
10
  export type * from './item.router';
11
- export type * from './item.service';
12
11
  export type { RouterContext };
13
12
 
14
13
  export type Item = z.infer<typeof schema.Item>;
package/job/index.ts CHANGED
@@ -2,4 +2,3 @@ export * as Types from './job.types';
2
2
  export * as Models from './job.models';
3
3
  export * as Schemas from './job.schema';
4
4
  export * from './job.router';
5
- export * from './job.service';
package/job/job.models.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as mongo from '../../util/mongo';
1
+ import * as mongo from '@arken/node/mongo';
2
2
  import type * as Types from './job.types';
3
3
 
4
4
  export const Job = mongo.createModel<Types.JobDocument>(
package/job/job.router.ts CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  import { z as zod } from 'zod';
4
4
  import { initTRPC, inferRouterInputs, inferRouterOutputs } from '@trpc/server';
5
- import { customErrorFormatter, hasRole } from '../../util/rpc';
6
- import type { RouterContext } from '../../types';
5
+ import { customErrorFormatter, hasRole } from '@arken/node/rpc';
6
+ import type { RouterContext } from '../types';
7
7
  import { Job } from './job.schema';
8
- import { Query } from '../../schema';
8
+ import { Query } from '../schema';
9
9
 
10
10
  export const z = zod;
11
11
  export const t = initTRPC.context<RouterContext>().create();
package/job/job.schema.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { z, ObjectId, Entity } from '../../schema';
1
+ import { z, ObjectId, Entity } from '../schema';
2
2
 
3
3
  export const Job = Entity.merge(
4
4
  z.object({
package/job/job.types.ts CHANGED
@@ -2,13 +2,12 @@
2
2
 
3
3
  import { z } from 'zod';
4
4
  import * as schema from './job.schema';
5
- import { Document, Model } from '../../util/mongo';
6
- import type { RouterContext } from '../../types';
5
+ import { Document, Model } from '@arken/node/mongo';
6
+ import type { RouterContext } from '../types';
7
7
  import type { inferRouterInputs, inferRouterOutputs } from '@trpc/server';
8
8
  import type { Router } from './job.router';
9
9
 
10
10
  export type * from './job.router';
11
- export type * from './job.service';
12
11
  export type { RouterContext };
13
12
 
14
13
  export type Job = z.infer<typeof schema.Job>;
package/market/index.ts CHANGED
@@ -2,4 +2,3 @@ export * as Types from './market.types';
2
2
  export * as Models from './market.models';
3
3
  export * as Schemas from './market.schema';
4
4
  export * from './market.router';
5
- export * from './market.service';
@@ -1,4 +1,4 @@
1
- import * as mongo from '../../util/mongo';
1
+ import * as mongo from '@arken/node/mongo';
2
2
  import type * as Types from './market.types';
3
3
 
4
4
  export const Market = mongo.createModel<Types.MarketDocument>('Market', {
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { z as zod } from 'zod';
4
4
  import { initTRPC, inferRouterInputs, inferRouterOutputs } from '@trpc/server';
5
- import { customErrorFormatter, hasRole } from '../../util/rpc';
6
- import type { RouterContext } from '../../types';
5
+ import { customErrorFormatter, hasRole } from '@arken/node/rpc';
6
+ import type { RouterContext } from '../types';
7
7
  import { Market, MarketPair, MarketExchange } from './market.schema';
8
8
 
9
9
  export const z = zod;
@@ -1,4 +1,4 @@
1
- import { z, Entity, ObjectId } from '../../schema';
1
+ import { z, Entity, ObjectId } from '../schema';
2
2
 
3
3
  export const Market = Entity.merge(
4
4
  z.object({
@@ -23,7 +23,10 @@ export const MarketAnalysis = Entity.merge(
23
23
  action: z.enum(['Buy', 'Sell']), // buy or sell action
24
24
  asset: z.string().min(1), // the asset being traded (e.g., oil, Bitcoin)
25
25
  signalType: z.string().min(1), // type of signal (e.g., news)
26
- confidence: z.number().min(0).max(100), // confidence level from 0 to 100
26
+ confidence: z
27
+ .number()
28
+ .min(0)
29
+ .max(100), // confidence level from 0 to 100
27
30
  riskLevel: z.enum(['Low', 'Medium', 'High']), // risk level
28
31
  timeFrame: z.enum(['Short-Term', 'Long-Term']), // investment time frame
29
32
  source: z.string().min(1), // source of information (e.g., FinancialJuice, Ground News)
@@ -133,8 +136,14 @@ export const MarketStockSentiment = Entity.merge(
133
136
  companyId: ObjectId,
134
137
  sentiment: z.object({
135
138
  label: z.enum(['Positive', 'Neutral', 'Negative']), // predefined sentiment labels
136
- score: z.number().min(0).max(1), // sentiment score as a confidence percentage
139
+ score: z
140
+ .number()
141
+ .min(0)
142
+ .max(1), // sentiment score as a confidence percentage
137
143
  }),
138
- confidence: z.number().min(0).max(1), // overall confidence level for the analysis
144
+ confidence: z
145
+ .number()
146
+ .min(0)
147
+ .max(1), // overall confidence level for the analysis
139
148
  })
140
149
  );
@@ -2,13 +2,12 @@
2
2
 
3
3
  import { z } from 'zod';
4
4
  import * as schema from './market.schema';
5
- import { Document, Model } from '../../util/mongo';
6
- import type { RouterContext } from '../../types';
5
+ import { Document, Model } from '@arken/node/mongo';
6
+ import type { RouterContext } from '../types';
7
7
  import type { inferRouterInputs, inferRouterOutputs } from '@trpc/server';
8
8
  import type { Router } from './market.router';
9
9
 
10
10
  export type * from './market.router';
11
- export type * from './market.service';
12
11
  export type { RouterContext };
13
12
 
14
13
  export type Market = z.infer<typeof schema.Market>;
package/oasis/index.ts CHANGED
@@ -2,4 +2,3 @@ export type * as Types from './oasis.types';
2
2
  export * as Models from './oasis.models';
3
3
  export * as Schemas from './oasis.schema';
4
4
  export * from './oasis.router';
5
- export * from './oasis.service';
@@ -1,9 +1,8 @@
1
1
  import { z as zod } from 'zod';
2
2
  import { initTRPC } from '@trpc/server';
3
3
  import { customErrorFormatter, hasRole } from '@arken/node/rpc';
4
- import * as Arken from '@arken/node';
5
4
  import { Query, getQueryInput, inferRouterOutputs, inferRouterInputs } from '@arken/node/schema';
6
- import { RouterContext } from '../../types';
5
+ import { RouterContext, Core, Profile } from '../types';
7
6
 
8
7
  export const z = zod;
9
8
  export const t = initTRPC.context<RouterContext>().create();
@@ -15,7 +14,7 @@ export const createRouter = () =>
15
14
  getPatrons: procedure
16
15
  .use(hasRole('guest', t))
17
16
  .use(customErrorFormatter(t))
18
- .output(z.array(Arken.Profile.Schemas.Profile))
17
+ .output(z.array(Profile.Schemas.Profile))
19
18
  .query(({ input, ctx }) => (ctx.app.service.Oasis.getPatrons as any)(input, ctx)),
20
19
 
21
20
  interact: t.procedure
@@ -55,7 +54,7 @@ export const createRouter = () =>
55
54
  z: 1000,
56
55
  },
57
56
  },
58
- ] as Arken.Core.Types.Object,
57
+ ] as Core.Types.Object,
59
58
  };
60
59
  }
61
60
 
@@ -3,8 +3,7 @@ import { Model, Document } from '@arken/node/mongo';
3
3
  import * as schema from './oasis.schema';
4
4
 
5
5
  export type * from './oasis.router';
6
- export type * from './oasis.service';
7
- export type { RouterContext } from '../../types';
6
+ export type { RouterContext } from '../types';
8
7
 
9
8
  // // Define types based on the schema
10
9
  // export type Game = z.infer<typeof schema.Game>;
package/package.json CHANGED
@@ -1,23 +1,29 @@
1
1
  {
2
2
  "name": "@arken/seer-protocol",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "build": "npm-run-all dist",
7
7
  "clean": "del-cli ./build && make-dir ./build",
8
8
  "dist": "npm-run-all clean tsc:*",
9
9
  "publish": "npm publish --access=public",
10
- "tsc:1": "rm -rf ./build && mkdir ./build && cp package.json ./build && NODE_ENV=production NODE_OPTIONS=--max-old-space-size=8192 tsc"
10
+ "tsc:1": "rm -rf ./build && mkdir ./build && cp package.json ./build && NODE_ENV=production NODE_OPTIONS=--max-old-space-size=8192 tsc --listFiles"
11
11
  },
12
12
  "dependencies": {
13
- "@arken/node": "^1.5.2",
13
+ "@arken/node": "^1.5.3",
14
14
  "@arken/forge-protocol": "^0.1.1",
15
15
  "@trpc/client": "11.0.0-rc.660",
16
16
  "@trpc/server": "11.0.0-rc.660",
17
+ "make-dir-cli": "^3",
18
+ "jest": "^29",
19
+ "@types/jest": "^29",
20
+ "@types/node": "^20",
17
21
  "zod": "^3",
18
22
  "dotenv": "^16",
19
23
  "lodash": "^4",
20
24
  "dayjs": "^1"
21
25
  },
22
- "devDependencies": {}
26
+ "devDependencies": {
27
+ "del-cli": "^5"
28
+ }
23
29
  }
package/product/index.ts CHANGED
@@ -2,4 +2,3 @@ export * as Types from './product.types';
2
2
  export * as Models from './product.models';
3
3
  export * as Schemas from './product.schema';
4
4
  export * from './product.router';
5
- export * from './product.service';
@@ -1,4 +1,4 @@
1
- import * as mongo from '../../util/mongo';
1
+ import * as mongo from '@arken/node/mongo';
2
2
  import type * as Types from './product.types';
3
3
 
4
4
  export const Product = mongo.createModel<Types.ProductDocument>(
@@ -1,7 +1,7 @@
1
1
  import { z as zod } from 'zod';
2
2
  import { initTRPC, inferRouterInputs, inferRouterOutputs } from '@trpc/server';
3
- import { customErrorFormatter, hasRole } from '../../util/rpc';
4
- import type { RouterContext } from '../../types';
3
+ import { customErrorFormatter, hasRole } from '@arken/node/rpc';
4
+ import type { RouterContext } from '../types';
5
5
  import { Product, ProductDLC, ProductBundle, ProductReview } from './product.schema';
6
6
 
7
7
  export const z = zod;
@@ -1,4 +1,4 @@
1
- import { z, ObjectId, Entity } from '../../schema';
1
+ import { z, ObjectId, Entity } from '../schema';
2
2
 
3
3
  // Extend the ProductMeta schema
4
4
  const ProductMeta = z.object({
@@ -6,7 +6,10 @@ const ProductMeta = z.object({
6
6
  members: z.array(ObjectId), // Array of Profile references
7
7
  isProposal: z.boolean(),
8
8
  price: z.number().nonnegative(),
9
- oldPrice: z.number().nonnegative().optional(),
9
+ oldPrice: z
10
+ .number()
11
+ .nonnegative()
12
+ .optional(),
10
13
  images: z.record(z.string(), z.any()),
11
14
  video: z.string().url(),
12
15
  genre: z.string(),
@@ -18,7 +21,10 @@ const ProductMeta = z.object({
18
21
  systemRequirements: z.array(z.any()), // Replace with actual SystemRequirement schema if available
19
22
  tags: z.array(ObjectId), // Array of Tag references
20
23
  type: z.string(),
21
- downloads: z.number().int().nonnegative(),
24
+ downloads: z
25
+ .number()
26
+ .int()
27
+ .nonnegative(),
22
28
  plans: z.array(z.any()), // Replace with actual ProductPlan schema if available
23
29
  frequentlyTradedAssets: z.array(ObjectId), // Array of Asset references
24
30
  saleBox: z.record(z.string(), z.any()),
@@ -32,15 +38,24 @@ const ProductMeta = z.object({
32
38
  // Updated Product schema
33
39
  export const Product = Entity.merge(
34
40
  z.object({
35
- shortDescription: z.string().max(300).min(1),
41
+ shortDescription: z
42
+ .string()
43
+ .max(300)
44
+ .min(1),
36
45
  content: z.string().min(1),
37
46
  communityId: ObjectId,
38
- type: z.string().max(100).default('game'),
47
+ type: z
48
+ .string()
49
+ .max(100)
50
+ .default('game'),
39
51
  releaseDate: z.date().optional(),
40
52
  sku: z.string().min(1),
41
53
  categoryId: ObjectId.optional(),
42
54
  price: z.number().nonnegative(),
43
- discountPrice: z.number().nonnegative().optional(),
55
+ discountPrice: z
56
+ .number()
57
+ .nonnegative()
58
+ .optional(),
44
59
  currency: z.string().length(3),
45
60
  images: z.array(z.string().url()).optional(),
46
61
  videos: z.array(z.string().url()).optional(),
@@ -60,7 +75,10 @@ export const Product = Entity.merge(
60
75
  z.object({
61
76
  name: z.string(),
62
77
  description: z.string().optional(),
63
- icon: z.string().url().optional(),
78
+ icon: z
79
+ .string()
80
+ .url()
81
+ .optional(),
64
82
  })
65
83
  )
66
84
  .optional(),
@@ -68,7 +86,10 @@ export const Product = Entity.merge(
68
86
  .array(
69
87
  z.object({
70
88
  userId: ObjectId,
71
- rating: z.number().min(1).max(5),
89
+ rating: z
90
+ .number()
91
+ .min(1)
92
+ .max(5),
72
93
  comment: z.string().optional(),
73
94
  createdDate: z.date().default(() => new Date()),
74
95
  })
@@ -76,7 +97,11 @@ export const Product = Entity.merge(
76
97
  .optional(),
77
98
  cloudSave: z.boolean().default(false),
78
99
  ugcSupport: z.boolean().default(false),
79
- wishlistCount: z.number().int().nonnegative().default(0),
100
+ wishlistCount: z
101
+ .number()
102
+ .int()
103
+ .nonnegative()
104
+ .default(0),
80
105
 
81
106
  // Additional fields from Objection.js model
82
107
  parentId: ObjectId.optional(),
@@ -95,7 +120,10 @@ export const ProductDLC = Entity.merge(
95
120
  description: z.string().optional(),
96
121
  gameId: ObjectId,
97
122
  price: z.number().nonnegative(),
98
- discountPrice: z.number().nonnegative().optional(),
123
+ discountPrice: z
124
+ .number()
125
+ .nonnegative()
126
+ .optional(),
99
127
  currency: z.string().length(3),
100
128
  digitalContent: z
101
129
  .array(
@@ -111,7 +139,10 @@ export const ProductDLC = Entity.merge(
111
139
  z.object({
112
140
  name: z.string(),
113
141
  description: z.string().optional(),
114
- icon: z.string().url().optional(),
142
+ icon: z
143
+ .string()
144
+ .url()
145
+ .optional(),
115
146
  })
116
147
  )
117
148
  .optional(),
@@ -125,7 +156,10 @@ export const ProductBundle = Entity.merge(
125
156
  description: z.string().optional(),
126
157
  products: z.array(ObjectId),
127
158
  price: z.number().nonnegative(),
128
- discountPrice: z.number().nonnegative().optional(),
159
+ discountPrice: z
160
+ .number()
161
+ .nonnegative()
162
+ .optional(),
129
163
  currency: z.string().length(3),
130
164
  })
131
165
  );
@@ -135,7 +169,10 @@ export const ProductReview = Entity.merge(
135
169
  z.object({
136
170
  userId: ObjectId,
137
171
  productId: ObjectId,
138
- rating: z.number().min(1).max(5),
172
+ rating: z
173
+ .number()
174
+ .min(1)
175
+ .max(5),
139
176
  comment: z.string().optional(),
140
177
  })
141
178
  );
@@ -1,12 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import * as schema from './product.schema';
3
- import { Document, Model } from '../../util/mongo';
4
- import type { RouterContext } from '../../types';
3
+ import { Document, Model } from '@arken/node/mongo';
4
+ import type { RouterContext } from '../types';
5
5
  import type { inferRouterInputs, inferRouterOutputs } from '@trpc/server';
6
6
  import type { Router } from './product.router';
7
7
 
8
8
  export type * from './product.router';
9
- export type * from './product.service';
10
9
  export type { RouterContext };
11
10
 
12
11
  export type Product = z.infer<typeof schema.Product>;
package/profile/index.ts CHANGED
@@ -2,4 +2,3 @@ export * as Types from './profile.types';
2
2
  export * as Models from './profile.models';
3
3
  export * as Schemas from './profile.schema';
4
4
  export * from './profile.router';
5
- export * from './profile.service';
@@ -1,6 +1,6 @@
1
1
  // profile.models.ts
2
2
  //
3
- import * as mongo from '../../util/mongo';
3
+ import * as mongo from '@arken/node/mongo';
4
4
  import type * as Types from './profile.types';
5
5
 
6
6
  const { addTagVirtuals, addApplicationVirtual } = mongo;
@@ -1,9 +1,9 @@
1
1
  import { z as zod } from 'zod';
2
2
  import { initTRPC, inferRouterInputs } from '@trpc/server';
3
- import { customErrorFormatter, hasRole } from '../../util/rpc';
4
- import type { RouterContext } from '../../types';
3
+ import { customErrorFormatter, hasRole } from '@arken/node/rpc';
4
+ import type { RouterContext } from '../types';
5
5
  import { Profile } from './profile.schema';
6
- import { Query, getQueryInput, getQueryOutput, inferRouterOutputs } from '../../schema';
6
+ import { Query, getQueryInput, getQueryOutput, inferRouterOutputs } from '../schema';
7
7
 
8
8
  export const z = zod;
9
9
  export const t = initTRPC.context<RouterContext>().create();
@@ -1,6 +1,6 @@
1
1
  // profile.schema.ts
2
2
  //
3
- import { z, ObjectId, Entity } from '../../schema';
3
+ import { z, ObjectId, Entity } from '../schema';
4
4
  import { Character } from '../character/character.schema';
5
5
  import { Achievement, Badge } from '../core/core.schema';
6
6
 
@@ -44,7 +44,10 @@ const ServerDataSchema = z.object({
44
44
  winRatio: z.number().optional(),
45
45
  timeSpent: z.number().optional(),
46
46
  winStreak: z.number().optional(),
47
- averageLatency: z.number().nullable().optional(),
47
+ averageLatency: z
48
+ .number()
49
+ .nullable()
50
+ .optional(),
48
51
  killDeathRatio: z.number().optional(),
49
52
  roundPointRatio: z.number().optional(),
50
53
  });
@@ -59,21 +62,39 @@ export const Profile = Entity.merge(
59
62
  telegramUserId: z.number().optional(),
60
63
  interactions: z.number().default(0),
61
64
  activityRating: z.number().default(0),
62
- address: z.string().max(100).optional(),
63
- avatar: z.string().max(100).optional(),
65
+ address: z
66
+ .string()
67
+ .max(100)
68
+ .optional(),
69
+ avatar: z
70
+ .string()
71
+ .max(100)
72
+ .optional(),
64
73
  roleId: ObjectId.optional(),
65
- privateKey: z.string().max(300).optional(),
66
- signature: z.string().max(200).optional(),
74
+ privateKey: z
75
+ .string()
76
+ .max(300)
77
+ .optional(),
78
+ signature: z
79
+ .string()
80
+ .max(200)
81
+ .optional(),
67
82
  chainId: ObjectId.optional(),
68
83
  teamId: ObjectId.optional(),
69
84
  characterId: ObjectId.optional(),
70
85
  isBanned: z.boolean().optional(),
71
86
  banExpireDate: z.date().optional(),
72
87
  banReason: z.string().optional(),
73
- mode: z.string().default('gamer').optional(),
88
+ mode: z
89
+ .string()
90
+ .default('gamer')
91
+ .optional(),
74
92
 
75
93
  bio: z.string().optional(),
76
- banner: z.string().url().optional(), // URL to the user's banner image
94
+ banner: z
95
+ .string()
96
+ .url()
97
+ .optional(), // URL to the user's banner image
77
98
  friends: z
78
99
  .array(
79
100
  z.object({
@@ -111,16 +132,55 @@ export const Profile = Entity.merge(
111
132
  .optional(),
112
133
  stats: z
113
134
  .object({
114
- gamesOwned: z.number().int().nonnegative().default(0),
115
- playedMinutes: z.number().nonnegative().default(0), // Total playtime in hours
116
- leveledUpCount: z.number().int().nonnegative().default(0),
117
- xpEarnedCount: z.number().int().nonnegative().default(0),
118
- craftedItemCount: z.number().int().nonnegative().default(0),
119
- equippedItemCount: z.number().int().nonnegative().default(0),
120
- transferredInCount: z.number().int().nonnegative().default(0),
121
- transferredOutCount: z.number().int().nonnegative().default(0),
122
- marketTradeSoldCount: z.number().int().nonnegative().default(0),
123
- marketTradeListedCount: z.number().int().nonnegative().default(0),
135
+ gamesOwned: z
136
+ .number()
137
+ .int()
138
+ .nonnegative()
139
+ .default(0),
140
+ playedMinutes: z
141
+ .number()
142
+ .nonnegative()
143
+ .default(0), // Total playtime in hours
144
+ leveledUpCount: z
145
+ .number()
146
+ .int()
147
+ .nonnegative()
148
+ .default(0),
149
+ xpEarnedCount: z
150
+ .number()
151
+ .int()
152
+ .nonnegative()
153
+ .default(0),
154
+ craftedItemCount: z
155
+ .number()
156
+ .int()
157
+ .nonnegative()
158
+ .default(0),
159
+ equippedItemCount: z
160
+ .number()
161
+ .int()
162
+ .nonnegative()
163
+ .default(0),
164
+ transferredInCount: z
165
+ .number()
166
+ .int()
167
+ .nonnegative()
168
+ .default(0),
169
+ transferredOutCount: z
170
+ .number()
171
+ .int()
172
+ .nonnegative()
173
+ .default(0),
174
+ marketTradeSoldCount: z
175
+ .number()
176
+ .int()
177
+ .nonnegative()
178
+ .default(0),
179
+ marketTradeListedCount: z
180
+ .number()
181
+ .int()
182
+ .nonnegative()
183
+ .default(0),
124
184
  evolution: z
125
185
  .object({
126
186
  hashes: z.array(z.string()).default([]),
@@ -141,7 +201,10 @@ export const Profile = Entity.merge(
141
201
  winRatio: z.number().optional(),
142
202
  timeSpent: z.number().optional(),
143
203
  winStreak: z.number().optional(),
144
- averageLatency: z.number().optional().nullable(),
204
+ averageLatency: z
205
+ .number()
206
+ .optional()
207
+ .nullable(),
145
208
  killDeathRatio: z.number().optional(),
146
209
  roundPointRatio: z.number().optional(),
147
210
  })