@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
@@ -2,13 +2,12 @@
2
2
  //
3
3
  import { z } from 'zod';
4
4
  import * as schema from './profile.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 './profile.router';
9
9
 
10
10
  export type * from './profile.router';
11
- export type * from './profile.service';
12
11
  export type { RouterContext };
13
12
 
14
13
  export type Profile = z.infer<typeof schema.Profile>;
package/raffle/index.ts CHANGED
@@ -2,4 +2,3 @@ export * as Types from './raffle.types';
2
2
  export * as Models from './raffle.models';
3
3
  export * as Schemas from './raffle.schema';
4
4
  export * from './raffle.router';
5
- export * from './raffle.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 './raffle.types';
3
3
 
4
4
  export const Raffle = mongo.createModel<Types.RaffleDocument>(
@@ -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 { Raffle, RaffleRequirement, RaffleReward, RaffleEntry } from './raffle.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
  export const Raffle = Entity.merge(
4
4
  z.object({
@@ -1,12 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import * as schema from './raffle.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 './raffle.router';
7
7
 
8
8
  export type * from './raffle.router';
9
- export type * from './raffle.service';
10
9
  export type { RouterContext };
11
10
 
12
11
  export type Raffle = z.infer<typeof schema.Raffle>;
package/skill/index.ts CHANGED
@@ -2,4 +2,3 @@ export * as Types from './skill.types';
2
2
  export * as Models from './skill.models';
3
3
  export * as Schemas from './skill.schema';
4
4
  export * from './skill.router';
5
- export * from './skill.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 './skill.types';
3
3
 
4
4
  export const Skill = mongo.createModel<Types.SkillDocument>('Skill', {});
@@ -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 {
6
6
  Skill,
7
7
  SkillMod,
@@ -11,7 +11,7 @@ import {
11
11
  SkillTree,
12
12
  SkillTreeNode,
13
13
  } from './skill.schema';
14
- import { Query } from '../../schema';
14
+ import { Query } from '../schema';
15
15
 
16
16
  export const z = zod;
17
17
  export const t = initTRPC.context<RouterContext>().create();
@@ -1,12 +1,21 @@
1
- import { z, ObjectId, Entity } from '../../schema';
1
+ import { z, ObjectId, Entity } from '../schema';
2
2
 
3
3
  export const Skill = Entity.merge(
4
4
  z.object({
5
5
  name: z.string().min(1),
6
- description: z.string().min(1).optional(),
6
+ description: z
7
+ .string()
8
+ .min(1)
9
+ .optional(),
7
10
  type: z.enum(['attack', 'defense', 'utility']),
8
- cooldown: z.number().min(0).optional(),
9
- power: z.number().min(0).optional(),
11
+ cooldown: z
12
+ .number()
13
+ .min(0)
14
+ .optional(),
15
+ power: z
16
+ .number()
17
+ .min(0)
18
+ .optional(),
10
19
  })
11
20
  );
12
21
 
@@ -15,7 +24,10 @@ export const SkillEffect = Entity.merge(
15
24
  skillId: ObjectId, // Reference to the associated Skill
16
25
  effectType: z.enum(['damage', 'heal', 'buff', 'debuff']),
17
26
  magnitude: z.number().min(0),
18
- duration: z.number().min(0).optional(),
27
+ duration: z
28
+ .number()
29
+ .min(0)
30
+ .optional(),
19
31
  })
20
32
  );
21
33
 
@@ -1,10 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import * as schema from './skill.schema';
3
- import { Document, Model } from '../../util/mongo';
3
+ import { Document, Model } from '@arken/node/mongo';
4
4
 
5
5
  export type * from './skill.router';
6
- export type * from './skill.service';
7
- export type { RouterContext } from '../../types';
6
+ export type { RouterContext } from '../types';
8
7
 
9
8
  export type Skill = z.infer<typeof schema.Skill>;
10
9
  export type SkillMod = z.infer<typeof schema.SkillMod>;
package/trek/index.ts CHANGED
@@ -2,4 +2,3 @@ export type * as Types from './trek.types';
2
2
  export * as Models from './trek.models';
3
3
  export * as Schemas from './trek.schema';
4
4
  export * from './trek.router';
5
- export * from './trek.service';
@@ -4,7 +4,7 @@ import { z as zod } from 'zod';
4
4
  import { initTRPC } from '@trpc/server';
5
5
  import { customErrorFormatter, hasRole } from '@arken/node/rpc';
6
6
  import type { inferRouterOutputs, inferRouterInputs } from '@trpc/server';
7
- import type { RouterContext } from '../../types';
7
+ import type { RouterContext } from '../types';
8
8
 
9
9
  export const z = zod;
10
10
  export const t = initTRPC.context<RouterContext>().create();
package/tsconfig.json CHANGED
@@ -1,25 +1,33 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "module": "CommonJS",
4
- "preserveSymlinks": true,
5
3
  "esModuleInterop": true,
4
+ "module": "ESNext",
5
+ "lib": ["ES2020", "DOM"],
6
+ "noImplicitAny": false,
7
+ "outDir": "build",
8
+ "preserveSymlinks": false,
9
+ "preserveConstEnums": true,
6
10
  "experimentalDecorators": true,
7
11
  "emitDecoratorMetadata": true,
12
+ "removeComments": true,
13
+ "skipLibCheck": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ "strict": false,
16
+ "checkJs": true,
17
+ "sourceMap": true,
18
+ "target": "ES2020",
19
+ "moduleResolution": "Node",
8
20
  "resolveJsonModule": true,
9
21
  "allowSyntheticDefaultImports": true,
10
- "noImplicitAny": false,
11
- "sourceMap": true,
12
- "strictNullChecks": false,
13
- "outDir": "./dist",
14
- "baseUrl": ".",
15
- "types": ["node", "jest"],
16
- "paths": {
17
- "~/*": ["./src/*"]
18
- },
19
- "target": "ESNext",
20
- "lib": ["ESNext"],
21
- "moduleResolution": "Node"
22
+ "types": ["jest", "node"],
23
+ "paths": {},
24
+ "allowJs": true,
25
+ "declaration": true,
26
+ "isolatedModules": true,
27
+ "noFallthroughCasesInSwitch": true,
28
+ "noEmit": false,
29
+ "composite": true
22
30
  },
23
- "include": ["./src/**/*"],
24
- "exclude": []
25
- }
31
+ "include": ["./area/**/*","./asset/**/*", "./chain/**/*","./chain/**/*","./character/**/*","./chat/**/*","./collection/**/*","./core/**/*","./evolution/**/*", "./game/**/*","./infinite/**/*","./interface/**/*","./isles/**/*","./item/**/*","./job/**/*","./market/**/*","./oasis/**/*","./product/**/*","./profile/**/*","./raffle/**/*","./skill/**/*","./trek/**/*","./video/**/*","./index.ts","./router.ts","./schema.ts","./types.ts"],
32
+ "exclude": ["node_modules", "build"]
33
+ }
package/types.ts CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
2
  // arken/packages/seer/protocol/types.ts
3
3
  //
4
- import * as Arken from '@arken/node';
5
- import { Router, RouterInput, RouterOutput } from './router';
4
+ // import * as Arken from '@arken/node';
5
+ // import { Router, RouterInput, RouterOutput } from './router';
6
6
 
7
7
 
8
8
  // Imports
@@ -28,24 +28,34 @@ import * as Infinite from './infinite';
28
28
  import * as Oasis from './oasis';
29
29
  import * as Trek from './trek';
30
30
 
31
- export type { Router, RouterInput, RouterOutput };
32
-
33
- export type ApplicationServiceType = Partial<{
34
- Trek: Trek.Service;
35
- Evolution: Evolution.Service;
36
- Infinite: Infinite.Service;
37
- Oasis: Oasis.Service;
38
- }> &
39
- Arken.ApplicationServiceType;
40
-
41
- export type ApplicationModelType = Partial<Evolution.Types.Mappings & Infinite.Types.Mappings> &
42
- Arken.ApplicationModelType;
43
-
44
- export class Application {
31
+ // Exports
32
+ export * as Area from './area';
33
+ export * as Asset from './asset';
34
+ export * as Chain from './chain';
35
+ export * as Character from './character';
36
+ export * as Chat from './chat';
37
+ export * as Collection from './collection';
38
+ export * as Core from './core';
39
+ export * as Game from './game';
40
+ export * as Interface from './interface';
41
+ export * as Item from './item';
42
+ export * as Job from './job';
43
+ export * as Market from './market';
44
+ export * as Product from './product';
45
+ export * as Profile from './profile';
46
+ export * as Raffle from './raffle';
47
+ export * as Skill from './skill';
48
+ export * as Video from './video';
49
+ export * as Evolution from './evolution';
50
+ export * as Infinite from './infinite';
51
+ export * as Oasis from './oasis';
52
+ export * as Trek from './trek';
53
+
54
+ export class Application<ServiceType> {
45
55
  router: Router;
46
- service: ApplicationServiceType = {};
56
+ service: ServiceType;
47
57
  model: ApplicationModelType = {};
48
- realms: Arken.Core.Types.Realm[] = [];
58
+ realms: Core.Types.Realm[] = [];
49
59
 
50
60
  server: any;
51
61
  http: any;
@@ -103,8 +113,10 @@ export type ApplicationType = typeof Application;
103
113
  // };
104
114
 
105
115
  export type RouterContext = {
106
- app: Application;
107
- } & Arken.RouterContext;
116
+ app: Application<any>;
117
+ client?: RouterClient;
118
+ profile?: Profile.Types.Profile;
119
+ };
108
120
 
109
121
  export interface Client {
110
122
  id: string;
@@ -130,32 +142,10 @@ export interface ServiceContext {
130
142
 
131
143
  import { createRouter } from './router';
132
144
 
133
- export * as util from './util';
134
-
135
145
  export type * as Schema from './schema';
136
146
 
137
147
  export type Router = ReturnType<typeof createRouter>;
138
148
 
139
- export type ApplicationServiceType = Partial<{
140
- Area: Area.Service;
141
- Asset: Asset.Service;
142
- Chain: Chain.Service;
143
- Character: Character.Service;
144
- Chat: Chat.Service;
145
- Collection: Collection.Service;
146
- Core: Core.Service;
147
- Game: Game.Service;
148
- Interface: Interface.Service;
149
- Item: Item.Service;
150
- Job: Job.Service;
151
- Market: Market.Service;
152
- Product: Product.Service;
153
- Profile: Profile.Service;
154
- Raffle: Raffle.Service;
155
- Skill: Skill.Service;
156
- Video: Video.Service;
157
- }>;
158
-
159
149
  export type ApplicationModelType = Partial<
160
150
  Area.Types.Mappings &
161
151
  Asset.Types.Mappings &
@@ -173,15 +163,11 @@ export type ApplicationModelType = Partial<
173
163
  Profile.Types.Mappings &
174
164
  Raffle.Types.Mappings &
175
165
  Skill.Types.Mappings &
176
- Video.Types.Mappings
166
+ Video.Types.Mappings &
167
+ Evolution.Types.Mappings &
168
+ Infinite.Types.Mappings
177
169
  >;
178
170
 
179
- export interface Application {
180
- model: ApplicationModelType;
181
- service: ApplicationServiceType;
182
- web3?: any;
183
- }
184
-
185
171
  export type RouterClient = {
186
172
  socket: any;
187
173
  roles: string[];
@@ -190,11 +176,6 @@ export type RouterClient = {
190
176
  emit: any;
191
177
  };
192
178
 
193
- export type RouterContext = {
194
- app: Application;
195
- client?: RouterClient;
196
- profile?: Profile.Types.Profile;
197
- };
198
179
 
199
180
  export interface Signature {
200
181
  hash?: string;
package/video/index.ts CHANGED
@@ -2,4 +2,3 @@ export * as Types from './video.types';
2
2
  export * as Models from './video.models';
3
3
  export * as Schemas from './video.schema';
4
4
  export * from './video.router';
5
- export * from './video.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 './video.types';
3
3
 
4
4
  export const Video = mongo.createModel<Types.VideoDocument>('Video', {
@@ -1,9 +1,9 @@
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 { Video, VideoParticipant, VideoDialogue, VideoTranscript, VideoScene } from './video.schema';
6
- import { Query } from '../../schema'; // Assuming the Query schema is located in '../../schema'
6
+ import { Query } from '../schema'; // Assuming the Query schema is located in '../schema'
7
7
 
8
8
  export const z = zod;
9
9
  export const t = initTRPC.context<RouterContext>().create();
@@ -1,4 +1,4 @@
1
- import { z, ObjectId, Entity } from '../../schema';
1
+ import { z, ObjectId, Entity } from '../schema';
2
2
 
3
3
  export const Video = Entity.merge(
4
4
  z.object({
@@ -1,12 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import * as schema from './video.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 './video.router';
7
7
 
8
8
  export type * from './video.router';
9
- export type * from './video.service';
10
9
  export type { RouterContext };
11
10
 
12
11
  export type Video = z.infer<typeof schema.Video>;