@arken/seer-protocol 0.1.0 → 0.1.2

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 (124) hide show
  1. package/.rush/temp/shrinkwrap-deps.json +537 -56
  2. package/area/area.models.ts +15 -0
  3. package/area/area.router.ts +74 -0
  4. package/area/area.schema.ts +22 -0
  5. package/area/area.types.ts +26 -0
  6. package/area/index.ts +5 -0
  7. package/asset/asset.models.ts +59 -0
  8. package/asset/asset.router.ts +55 -0
  9. package/asset/asset.schema.ts +27 -0
  10. package/asset/asset.types.ts +22 -0
  11. package/asset/index.ts +5 -0
  12. package/chain/chain.models.ts +50 -0
  13. package/chain/chain.router.ts +104 -0
  14. package/chain/chain.schema.ts +52 -0
  15. package/chain/chain.types.ts +24 -0
  16. package/chain/index.ts +5 -0
  17. package/character/character.models.ts +174 -0
  18. package/character/character.router.ts +314 -0
  19. package/character/character.schema.ts +147 -0
  20. package/character/character.types.ts +64 -0
  21. package/character/index.ts +5 -0
  22. package/chat/chat.models.ts +43 -0
  23. package/chat/chat.router.ts +67 -0
  24. package/chat/chat.schema.ts +36 -0
  25. package/chat/chat.types.ts +20 -0
  26. package/chat/index.ts +5 -0
  27. package/collection/collection.models.ts +76 -0
  28. package/collection/collection.router.ts +91 -0
  29. package/collection/collection.schema.ts +90 -0
  30. package/collection/collection.types.ts +36 -0
  31. package/collection/index.ts +5 -0
  32. package/core/core.models.ts +1380 -0
  33. package/core/core.router.ts +1781 -0
  34. package/core/core.schema.ts +847 -0
  35. package/core/core.types.ts +340 -0
  36. package/core/index.ts +5 -0
  37. package/{src/modules/evolution → evolution}/evolution.models.ts +1 -1
  38. package/{src/modules/evolution → evolution}/evolution.router.ts +5 -5
  39. package/{src/modules/evolution → evolution}/evolution.types.ts +1 -1
  40. package/game/game.models.ts +53 -0
  41. package/game/game.router.ts +110 -0
  42. package/game/game.schema.ts +23 -0
  43. package/game/game.types.ts +28 -0
  44. package/game/index.ts +5 -0
  45. package/index.ts +59 -0
  46. package/{src/modules/infinite → infinite}/infinite.models.ts +1 -1
  47. package/{src/modules/infinite → infinite}/infinite.router.ts +5 -5
  48. package/{src/modules/infinite → infinite}/infinite.types.ts +1 -1
  49. package/interface/index.ts +5 -0
  50. package/interface/interface.canonicalize.ts +279 -0
  51. package/interface/interface.models.ts +40 -0
  52. package/interface/interface.router.ts +175 -0
  53. package/interface/interface.schema.ts +59 -0
  54. package/interface/interface.types.ts +25 -0
  55. package/{src/modules/isles → isles}/isles.models.ts +1 -1
  56. package/{src/modules/isles → isles}/isles.router.ts +5 -5
  57. package/{src/modules/isles → isles}/isles.types.ts +1 -1
  58. package/item/index.ts +5 -0
  59. package/item/item.models.ts +124 -0
  60. package/item/item.router.ts +103 -0
  61. package/item/item.schema.ts +120 -0
  62. package/item/item.types.ts +74 -0
  63. package/job/index.ts +5 -0
  64. package/job/job.models.ts +14 -0
  65. package/job/job.router.ts +44 -0
  66. package/job/job.schema.ts +9 -0
  67. package/job/job.types.ts +23 -0
  68. package/market/index.ts +5 -0
  69. package/market/market.models.ts +113 -0
  70. package/market/market.router.ts +73 -0
  71. package/market/market.schema.ts +140 -0
  72. package/market/market.types.ts +56 -0
  73. package/{src/modules/oasis → oasis}/oasis.models.ts +1 -1
  74. package/{src/modules/oasis → oasis}/oasis.router.ts +1 -1
  75. package/{src/modules/oasis → oasis}/oasis.types.ts +1 -1
  76. package/package.json +12 -14
  77. package/product/index.ts +5 -0
  78. package/product/product.models.ts +166 -0
  79. package/product/product.router.ts +93 -0
  80. package/product/product.schema.ts +149 -0
  81. package/product/product.types.ts +33 -0
  82. package/profile/index.ts +5 -0
  83. package/profile/profile.models.ts +214 -0
  84. package/profile/profile.router.ts +72 -0
  85. package/profile/profile.schema.ts +156 -0
  86. package/profile/profile.types.ts +22 -0
  87. package/raffle/index.ts +5 -0
  88. package/raffle/raffle.models.ts +44 -0
  89. package/raffle/raffle.router.ts +90 -0
  90. package/raffle/raffle.schema.ts +32 -0
  91. package/raffle/raffle.types.ts +30 -0
  92. package/{src/router.ts → router.ts} +22 -28
  93. package/schema.ts +321 -0
  94. package/skill/index.ts +5 -0
  95. package/skill/skill.models.ts +16 -0
  96. package/skill/skill.router.ts +201 -0
  97. package/skill/skill.schema.ts +40 -0
  98. package/skill/skill.types.ts +33 -0
  99. package/{src/modules/trek → trek}/trek.router.ts +1 -1
  100. package/types.ts +273 -0
  101. package/video/index.ts +5 -0
  102. package/video/video.models.ts +25 -0
  103. package/video/video.router.ts +143 -0
  104. package/video/video.schema.ts +46 -0
  105. package/video/video.types.ts +33 -0
  106. package/src/index.ts +0 -22
  107. package/src/modules/evolution/evolution.service.ts +0 -2000
  108. package/src/modules/infinite/infinite.service.ts +0 -40
  109. package/src/modules/isles/isles.service.ts +0 -40
  110. package/src/modules/oasis/oasis.service.ts +0 -38
  111. package/src/modules/trek/trek.service.ts +0 -1031
  112. package/src/types.ts +0 -106
  113. /package/{src/modules/evolution → evolution}/evolution.schema.ts +0 -0
  114. /package/{src/modules/evolution → evolution}/index.ts +0 -0
  115. /package/{src/modules/infinite → infinite}/index.ts +0 -0
  116. /package/{src/modules/infinite → infinite}/infinite.schema.ts +0 -0
  117. /package/{src/modules/isles → isles}/index.ts +0 -0
  118. /package/{src/modules/isles → isles}/isles.schema.ts +0 -0
  119. /package/{src/modules/oasis → oasis}/index.ts +0 -0
  120. /package/{src/modules/oasis → oasis}/oasis.schema.ts +0 -0
  121. /package/{src/modules/trek → trek}/index.ts +0 -0
  122. /package/{src/modules/trek → trek}/trek.models.ts +0 -0
  123. /package/{src/modules/trek → trek}/trek.schema.ts +0 -0
  124. /package/{src/modules/trek → trek}/trek.types.ts +0 -0
@@ -0,0 +1,143 @@
1
+ import { z as zod } from 'zod';
2
+ import { initTRPC, inferRouterInputs, inferRouterOutputs } from '@trpc/server';
3
+ import { customErrorFormatter, hasRole } from '../../util/rpc';
4
+ import type { RouterContext } from '../../types';
5
+ import { Video, VideoParticipant, VideoDialogue, VideoTranscript, VideoScene } from './video.schema';
6
+ import { Query } from '../../schema'; // Assuming the Query schema is located in '../../schema'
7
+
8
+ export const z = zod;
9
+ export const t = initTRPC.context<RouterContext>().create();
10
+ export const router = t.router;
11
+ export const procedure = t.procedure;
12
+
13
+ export const createRouter = () =>
14
+ router({
15
+ // Video endpoints
16
+ getVideo: procedure
17
+ .use(hasRole('guest', t))
18
+ .use(customErrorFormatter(t))
19
+ .input(z.object({ query: Query }))
20
+ .query(({ input, ctx }) => (ctx.app.service.Video.getVideo as any)(input, ctx)),
21
+
22
+ createVideo: procedure
23
+ .use(hasRole('admin', t))
24
+ .use(customErrorFormatter(t))
25
+ .input(z.object({ data: Video.omit({ id: true }) }))
26
+ .mutation(({ input, ctx }) => (ctx.app.service.Video.createVideo as any)(input, ctx)),
27
+
28
+ updateVideo: procedure
29
+ .use(hasRole('admin', t))
30
+ .use(customErrorFormatter(t))
31
+ .input(z.object({ query: Query, data: Video.partial() }))
32
+ .mutation(({ input, ctx }) => (ctx.app.service.Video.updateVideo as any)(input, ctx)),
33
+
34
+ deleteVideo: procedure
35
+ .use(hasRole('admin', t))
36
+ .use(customErrorFormatter(t))
37
+ .input(z.object({ query: Query }))
38
+ .mutation(({ input, ctx }) => (ctx.app.service.Video.deleteVideo as any)(input, ctx)),
39
+
40
+ // Video Participant endpoints
41
+ getVideoParticipant: procedure
42
+ .use(hasRole('guest', t))
43
+ .use(customErrorFormatter(t))
44
+ .input(z.object({ query: Query }))
45
+ .query(({ input, ctx }) => (ctx.app.service.Video.getVideoParticipant as any)(input, ctx)),
46
+
47
+ createVideoParticipant: procedure
48
+ .use(hasRole('admin', t))
49
+ .use(customErrorFormatter(t))
50
+ .input(z.object({ data: VideoParticipant.omit({ id: true }) }))
51
+ .mutation(({ input, ctx }) => (ctx.app.service.Video.createVideoParticipant as any)(input, ctx)),
52
+
53
+ updateVideoParticipant: procedure
54
+ .use(hasRole('admin', t))
55
+ .use(customErrorFormatter(t))
56
+ .input(z.object({ query: Query, data: VideoParticipant.partial() }))
57
+ .mutation(({ input, ctx }) => (ctx.app.service.Video.updateVideoParticipant as any)(input, ctx)),
58
+
59
+ deleteVideoParticipant: procedure
60
+ .use(hasRole('admin', t))
61
+ .use(customErrorFormatter(t))
62
+ .input(z.object({ query: Query }))
63
+ .mutation(({ input, ctx }) => (ctx.app.service.Video.deleteVideoParticipant as any)(input, ctx)),
64
+
65
+ // Video Dialogue endpoints
66
+ getVideoDialogue: procedure
67
+ .use(hasRole('guest', t))
68
+ .use(customErrorFormatter(t))
69
+ .input(z.object({ query: Query }))
70
+ .query(({ input, ctx }) => (ctx.app.service.Video.getVideoDialogue as any)(input, ctx)),
71
+
72
+ createVideoDialogue: procedure
73
+ .use(hasRole('admin', t))
74
+ .use(customErrorFormatter(t))
75
+ .input(z.object({ data: VideoDialogue.omit({ id: true }) }))
76
+ .mutation(({ input, ctx }) => (ctx.app.service.Video.createVideoDialogue as any)(input, ctx)),
77
+
78
+ updateVideoDialogue: procedure
79
+ .use(hasRole('admin', t))
80
+ .use(customErrorFormatter(t))
81
+ .input(z.object({ query: Query, data: VideoDialogue.partial() }))
82
+ .mutation(({ input, ctx }) => (ctx.app.service.Video.updateVideoDialogue as any)(input, ctx)),
83
+
84
+ deleteVideoDialogue: procedure
85
+ .use(hasRole('admin', t))
86
+ .use(customErrorFormatter(t))
87
+ .input(z.object({ query: Query }))
88
+ .mutation(({ input, ctx }) => (ctx.app.service.Video.deleteVideoDialogue as any)(input, ctx)),
89
+
90
+ // Video Transcript endpoints
91
+ getVideoTranscript: procedure
92
+ .use(hasRole('guest', t))
93
+ .use(customErrorFormatter(t))
94
+ .input(z.object({ query: Query }))
95
+ .query(({ input, ctx }) => (ctx.app.service.Video.getVideoTranscript as any)(input, ctx)),
96
+
97
+ createVideoTranscript: procedure
98
+ .use(hasRole('admin', t))
99
+ .use(customErrorFormatter(t))
100
+ .input(z.object({ data: VideoTranscript.omit({ id: true }) }))
101
+ .mutation(({ input, ctx }) => (ctx.app.service.Video.createVideoTranscript as any)(input, ctx)),
102
+
103
+ updateVideoTranscript: procedure
104
+ .use(hasRole('admin', t))
105
+ .use(customErrorFormatter(t))
106
+ .input(z.object({ query: Query, data: VideoTranscript.partial() }))
107
+ .mutation(({ input, ctx }) => (ctx.app.service.Video.updateVideoTranscript as any)(input, ctx)),
108
+
109
+ deleteVideoTranscript: procedure
110
+ .use(hasRole('admin', t))
111
+ .use(customErrorFormatter(t))
112
+ .input(z.object({ query: Query }))
113
+ .mutation(({ input, ctx }) => (ctx.app.service.Video.deleteVideoTranscript as any)(input, ctx)),
114
+
115
+ // Video Scene endpoints
116
+ getVideoScene: procedure
117
+ .use(hasRole('guest', t))
118
+ .use(customErrorFormatter(t))
119
+ .input(z.object({ query: Query }))
120
+ .query(({ input, ctx }) => (ctx.app.service.Video.getVideoScene as any)(input, ctx)),
121
+
122
+ createVideoScene: procedure
123
+ .use(hasRole('admin', t))
124
+ .use(customErrorFormatter(t))
125
+ .input(z.object({ data: VideoScene.omit({ id: true }) }))
126
+ .mutation(({ input, ctx }) => (ctx.app.service.Video.createVideoScene as any)(input, ctx)),
127
+
128
+ updateVideoScene: procedure
129
+ .use(hasRole('admin', t))
130
+ .use(customErrorFormatter(t))
131
+ .input(z.object({ query: Query, data: VideoScene.partial() }))
132
+ .mutation(({ input, ctx }) => (ctx.app.service.Video.updateVideoScene as any)(input, ctx)),
133
+
134
+ deleteVideoScene: procedure
135
+ .use(hasRole('admin', t))
136
+ .use(customErrorFormatter(t))
137
+ .input(z.object({ query: Query }))
138
+ .mutation(({ input, ctx }) => (ctx.app.service.Video.deleteVideoScene as any)(input, ctx)),
139
+ });
140
+
141
+ export type Router = ReturnType<typeof createRouter>;
142
+ export type RouterInput = inferRouterInputs<Router>;
143
+ export type RouterOutput = inferRouterOutputs<Router>;
@@ -0,0 +1,46 @@
1
+ import { z, ObjectId, Entity } from '../../schema';
2
+
3
+ export const Video = Entity.merge(
4
+ z.object({
5
+ youtubeId: z.string().min(1),
6
+ url: z.string().url(),
7
+ title: z.string().min(1),
8
+ description: z.string().optional(),
9
+ duration: z.number().min(0).optional(),
10
+ // publishedAt: z.date().optional(),
11
+ })
12
+ );
13
+
14
+ export const VideoParticipant = Entity.merge(
15
+ z.object({
16
+ videoId: ObjectId, // Reference to the associated Video
17
+ profileId: ObjectId.optional(), // Reference to a participant profile
18
+ role: z.enum(['Host', 'Contributor', 'Guest']).optional(),
19
+ })
20
+ );
21
+
22
+ export const VideoDialogue = Entity.merge(
23
+ z.object({
24
+ videoId: ObjectId, // Reference to the associated Video
25
+ participantId: ObjectId, // Reference to the VideoParticipant
26
+ text: z.string().min(1),
27
+ timestamp: z.string().regex(/^\d{2}:\d{2}:\d{2}$/), // Format HH:MM:SS
28
+ })
29
+ );
30
+
31
+ export const VideoTranscript = Entity.merge(
32
+ z.object({
33
+ videoId: ObjectId, // Reference to the associated Video
34
+ transcript: z.array(VideoDialogue), // Array of dialogues
35
+ summary: z.string().optional(),
36
+ })
37
+ );
38
+
39
+ export const VideoScene = Entity.merge(
40
+ z.object({
41
+ videoId: ObjectId, // Reference to the associated Video
42
+ startTime: z.string().regex(/^\d{2}:\d{2}:\d{2}$/), // Format HH:MM:SS
43
+ endTime: z.string().regex(/^\d{2}:\d{2}:\d{2}$/), // Format HH:MM:SS
44
+ description: z.string().optional(),
45
+ })
46
+ );
@@ -0,0 +1,33 @@
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/src/index.ts DELETED
@@ -1,22 +0,0 @@
1
- import type * as Arken from '@arken/node/types';
2
- import * as dotenv from 'dotenv';
3
- import * as Schema from '@arken/node/schema';
4
- import { createRouter as createRouter2 } from './router';
5
- import type * as Types from './types';
6
-
7
- export * as Trek from './modules/trek';
8
- export * as Evolution from './modules/evolution';
9
- export * as Infinite from './modules/infinite';
10
- export * as Oasis from './modules/oasis';
11
-
12
- export { Application } from './types';
13
-
14
- export type { Types };
15
-
16
- export { createRouter } from './router';
17
-
18
- export type Router = ReturnType<typeof createRouter2>;
19
- export type RouterInput = Schema.inferRouterInputs<Router>;
20
- export type RouterOutput = Schema.inferRouterOutputs<Router>;
21
-
22
- dotenv.config();