@arken/seer-protocol 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/shrinkwrap-deps.json +246 -233
- package/area/area.models.ts +1 -1
- package/area/area.router.ts +3 -3
- package/area/area.schema.ts +1 -1
- package/area/area.types.ts +2 -3
- package/area/index.ts +0 -1
- package/asset/asset.models.ts +1 -1
- package/asset/asset.router.ts +2 -2
- package/asset/asset.schema.ts +5 -2
- package/asset/asset.types.ts +2 -3
- package/asset/index.ts +0 -1
- package/chain/chain.models.ts +1 -1
- package/chain/chain.router.ts +3 -3
- package/chain/chain.schema.ts +21 -6
- package/chain/chain.types.ts +2 -3
- package/chain/index.ts +0 -1
- package/character/character.models.ts +1 -1
- package/character/character.router.ts +3 -3
- package/character/character.schema.ts +5 -2
- package/character/character.types.ts +2 -3
- package/character/index.ts +0 -1
- package/chat/chat.models.ts +1 -1
- package/chat/chat.router.ts +2 -2
- package/chat/chat.schema.ts +5 -2
- package/chat/chat.types.ts +2 -3
- package/chat/index.ts +0 -1
- package/collection/collection.models.ts +1 -1
- package/collection/collection.router.ts +2 -2
- package/collection/collection.schema.ts +1 -1
- package/collection/collection.types.ts +2 -3
- package/collection/index.ts +0 -1
- package/core/core.models.ts +1 -1
- package/core/core.router.ts +4 -4
- package/core/core.schema.ts +123 -30
- package/core/core.types.ts +2 -3
- package/core/index.ts +0 -1
- package/evolution/evolution.router.ts +11 -11
- package/evolution/evolution.types.ts +1 -2
- package/evolution/index.ts +0 -1
- package/game/game.models.ts +1 -1
- package/game/game.router.ts +3 -3
- package/game/game.schema.ts +1 -1
- package/game/game.types.ts +2 -3
- package/game/index.ts +0 -1
- package/index.ts +39 -39
- package/infinite/index.ts +0 -1
- package/infinite/infinite.router.ts +1 -1
- package/infinite/infinite.types.ts +1 -2
- package/interface/index.ts +0 -1
- package/interface/interface.models.ts +1 -1
- package/interface/interface.router.ts +3 -3
- package/interface/interface.schema.ts +1 -1
- package/interface/interface.types.ts +2 -3
- package/isles/index.ts +0 -1
- package/isles/isles.router.ts +1 -1
- package/isles/isles.types.ts +1 -2
- package/item/index.ts +0 -1
- package/item/item.models.ts +1 -1
- package/item/item.router.ts +3 -3
- package/item/item.schema.ts +39 -9
- package/item/item.types.ts +2 -3
- package/job/index.ts +0 -1
- package/job/job.models.ts +1 -1
- package/job/job.router.ts +3 -3
- package/job/job.schema.ts +1 -1
- package/job/job.types.ts +2 -3
- package/market/index.ts +0 -1
- package/market/market.models.ts +1 -1
- package/market/market.router.ts +2 -2
- package/market/market.schema.ts +13 -4
- package/market/market.types.ts +2 -3
- package/oasis/index.ts +0 -1
- package/oasis/oasis.router.ts +3 -4
- package/oasis/oasis.types.ts +1 -2
- package/package.json +10 -4
- package/product/index.ts +0 -1
- package/product/product.models.ts +1 -1
- package/product/product.router.ts +2 -2
- package/product/product.schema.ts +50 -13
- package/product/product.types.ts +2 -3
- package/profile/index.ts +0 -1
- package/profile/profile.models.ts +1 -1
- package/profile/profile.router.ts +3 -3
- package/profile/profile.schema.ts +82 -19
- package/profile/profile.types.ts +2 -3
- package/raffle/index.ts +0 -1
- package/raffle/raffle.models.ts +1 -1
- package/raffle/raffle.router.ts +2 -2
- package/raffle/raffle.schema.ts +1 -1
- package/raffle/raffle.types.ts +2 -3
- package/skill/index.ts +0 -1
- package/skill/skill.models.ts +1 -1
- package/skill/skill.router.ts +3 -3
- package/skill/skill.schema.ts +17 -5
- package/skill/skill.types.ts +2 -3
- package/trek/index.ts +0 -1
- package/trek/trek.router.ts +1 -1
- package/tsconfig.json +25 -17
- package/types.ts +35 -54
- package/video/index.ts +0 -1
- package/video/video.models.ts +1 -1
- package/video/video.router.ts +3 -3
- package/video/video.schema.ts +1 -1
- package/video/video.types.ts +2 -3
package/profile/profile.types.ts
CHANGED
|
@@ -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 '
|
|
6
|
-
import type { RouterContext } from '
|
|
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
package/raffle/raffle.models.ts
CHANGED
package/raffle/raffle.router.ts
CHANGED
|
@@ -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 '
|
|
4
|
-
import type { RouterContext } from '
|
|
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;
|
package/raffle/raffle.schema.ts
CHANGED
package/raffle/raffle.types.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import * as schema from './raffle.schema';
|
|
3
|
-
import { Document, Model } from '
|
|
4
|
-
import type { RouterContext } from '
|
|
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
package/skill/skill.models.ts
CHANGED
package/skill/skill.router.ts
CHANGED
|
@@ -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 '
|
|
4
|
-
import type { RouterContext } from '
|
|
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 '
|
|
14
|
+
import { Query } from '../schema';
|
|
15
15
|
|
|
16
16
|
export const z = zod;
|
|
17
17
|
export const t = initTRPC.context<RouterContext>().create();
|
package/skill/skill.schema.ts
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
import { z, ObjectId, Entity } from '
|
|
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
|
|
6
|
+
description: z
|
|
7
|
+
.string()
|
|
8
|
+
.min(1)
|
|
9
|
+
.optional(),
|
|
7
10
|
type: z.enum(['attack', 'defense', 'utility']),
|
|
8
|
-
cooldown: z
|
|
9
|
-
|
|
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
|
|
27
|
+
duration: z
|
|
28
|
+
.number()
|
|
29
|
+
.min(0)
|
|
30
|
+
.optional(),
|
|
19
31
|
})
|
|
20
32
|
);
|
|
21
33
|
|
package/skill/skill.types.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import * as schema from './skill.schema';
|
|
3
|
-
import { Document, Model } from '
|
|
3
|
+
import { Document, Model } from '@arken/node/mongo';
|
|
4
4
|
|
|
5
5
|
export type * from './skill.router';
|
|
6
|
-
export type
|
|
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
package/trek/trek.router.ts
CHANGED
|
@@ -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 '
|
|
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
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
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": ["./
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
export
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
export
|
|
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:
|
|
56
|
+
service: ServiceType;
|
|
47
57
|
model: ApplicationModelType = {};
|
|
48
|
-
realms:
|
|
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
|
-
|
|
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
package/video/video.models.ts
CHANGED
package/video/video.router.ts
CHANGED
|
@@ -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 '
|
|
4
|
-
import type { RouterContext } from '
|
|
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 '
|
|
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();
|
package/video/video.schema.ts
CHANGED
package/video/video.types.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import * as schema from './video.schema';
|
|
3
|
-
import { Document, Model } from '
|
|
4
|
-
import type { RouterContext } from '
|
|
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>;
|