omniarena-nurvus-shared 0.22.0 → 0.23.0

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/dist/index.d.ts CHANGED
@@ -6,3 +6,4 @@ export * from './social.js';
6
6
  export * from './store.js';
7
7
  export * from './skins.js';
8
8
  export * from './socket.js';
9
+ export * from './rewards.js';
@@ -0,0 +1,61 @@
1
+ export type MissionCadence = 'daily' | 'weekly';
2
+ export type WeeklyMissionSlot = 'wed' | 'sat' | 'sun';
3
+ export type MissionStatus = 'active' | 'completed' | 'expired';
4
+ export type DailyUnlockOutcome = 'unlocked' | 'full' | 'unavailable';
5
+ export type MissionParameters = Record<string, unknown>;
6
+ export type MissionSnapshot = {
7
+ key: string;
8
+ title: string;
9
+ description: string;
10
+ type: string;
11
+ params: MissionParameters;
12
+ target: number;
13
+ rewardLeaves: number;
14
+ };
15
+ export type MissionDefinitionInput = MissionSnapshot & {
16
+ cadence: MissionCadence;
17
+ slot: WeeklyMissionSlot | null;
18
+ active: boolean;
19
+ };
20
+ export type MissionDefinitionDto = MissionDefinitionInput & {
21
+ id: string;
22
+ availableFrom: Date | null;
23
+ availableTo: Date | null;
24
+ createdAt: Date;
25
+ };
26
+ export type MissionDto = MissionSnapshot & {
27
+ id: string;
28
+ definitionId: string;
29
+ cadence: MissionCadence;
30
+ slot: WeeklyMissionSlot | null;
31
+ progress: number;
32
+ status: MissionStatus;
33
+ assignedAt: Date;
34
+ expiresAt: Date | null;
35
+ completedAt: Date | null;
36
+ };
37
+ export type RewardStateDto = {
38
+ leaves: number;
39
+ leavesPerBranch: number;
40
+ shardsPerBranch: number;
41
+ bonusRemaining: number;
42
+ bonusResetAt: Date;
43
+ branchesCompleted: number;
44
+ shards: number;
45
+ dailyQuestLimit: number;
46
+ dailyUnlock: {
47
+ day: string | null;
48
+ outcome: DailyUnlockOutcome | null;
49
+ missionId: string | null;
50
+ };
51
+ };
52
+ export type RewardUpdateDto = {
53
+ state: RewardStateDto;
54
+ battleHistoryId: string;
55
+ baseLeaves: number;
56
+ bonusLeaves: number;
57
+ missionLeaves: number;
58
+ branchesAwarded: number;
59
+ shardsAwarded: number;
60
+ completedMissionIds: string[];
61
+ };
package/dist/socket.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { BattleEndReason, BattleMode } from './common.js';
2
2
  import type { UserHeaderDto } from './common.js';
3
3
  import type { ActionData } from './engine.js';
4
+ import type { RewardStateDto, RewardUpdateDto } from './rewards.js';
4
5
  export type ChallengeDenyReason = 'declined' | 'busy' | 'offline' | 'expired' | 'withdrawn';
5
6
  export type BotDifficulty = 'easiest' | 'easy';
6
7
  export type ClientToServerEvents = {
@@ -29,6 +30,8 @@ export type ServerToClientEvents = {
29
30
  battle_paused: (reason: BattlePausedReason) => void;
30
31
  battle_ended: (winner: string, reason: BattleEndReason, error?: string) => void;
31
32
  battle_resolved: () => void;
33
+ rewards_state: (state: RewardStateDto) => void;
34
+ rewards_updated: (update: RewardUpdateDto) => void;
32
35
  new_turn: (data: string) => void;
33
36
  receive_message: (senderId: string, content: string) => void;
34
37
  challenge_received: (challenger: UserHeaderDto) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omniarena-nurvus-shared",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "type": "module",
5
5
  "description": "Shared contract types for OmniArena (nurvus slice). Type-only, zero dependencies.",
6
6
  "types": "./dist/index.d.ts",