@voltro/plugin-progression 0.0.0-stage → 0.87.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/CHANGELOG.md +24329 -0
- package/LICENSE +61 -0
- package/README.md +478 -2
- package/SECURITY.md +56 -0
- package/THIRD-PARTY-NOTICES.md +9189 -0
- package/dist/achievementComponents.js +92 -0
- package/dist/achievementStore.js +603 -0
- package/dist/achievementTables.entity.js +98 -0
- package/dist/achievements.d.ts +188 -0
- package/dist/achievements.js +205 -0
- package/dist/capture.js +64 -0
- package/dist/cmsQuests.d.ts +91 -0
- package/dist/cmsQuests.js +83 -0
- package/dist/components.d.ts +172 -0
- package/dist/components.js +4 -0
- package/dist/curve.d.ts +27 -0
- package/dist/curve.js +38 -0
- package/dist/daily.d.ts +152 -0
- package/dist/daily.js +126 -0
- package/dist/dailyStore.js +421 -0
- package/dist/dailySystem.fixture.js +138 -0
- package/dist/dailyTables.entity.js +90 -0
- package/dist/declarationFixtures.js +143 -0
- package/dist/errors.d.ts +13 -0
- package/dist/errors.js +20 -0
- package/dist/index.d.ts +1833 -0
- package/dist/index.js +19 -0
- package/dist/pass.d.ts +186 -0
- package/dist/pass.js +122 -0
- package/dist/passRules.js +96 -0
- package/dist/passStore.js +485 -0
- package/dist/passTables.entity.js +96 -0
- package/dist/plugin.js +1086 -0
- package/dist/port.js +5 -0
- package/dist/progressionStore.js +706 -0
- package/dist/questComponents.js +163 -0
- package/dist/questPort.d.ts +126 -0
- package/dist/questPort.js +5 -0
- package/dist/questRefresh.js +56 -0
- package/dist/questRefresh.server.js +126 -0
- package/dist/questRerollJournal.js +77 -0
- package/dist/questStore.js +592 -0
- package/dist/questTables.entity.js +117 -0
- package/dist/quests.d.ts +142 -0
- package/dist/quests.js +153 -0
- package/dist/rank-app/schedules/progression.dispatchRankClosures.cron.tsx +19 -0
- package/dist/rank-app/workflows/progression.closeRankSeason.workflow.server.tsx +10 -0
- package/dist/rank-app/workflows/progression.closeRankSeason.workflow.tsx +1 -0
- package/dist/rankClosure.d.ts +69 -0
- package/dist/rankClosure.js +35 -0
- package/dist/rankClosure.server.js +139 -0
- package/dist/rankClosureWorkflow.d.ts +34 -0
- package/dist/rankClosureWorkflow.js +16 -0
- package/dist/rankReader.server.js +57 -0
- package/dist/rankRewardParent.server.js +65 -0
- package/dist/rankSeasons.d.ts +144 -0
- package/dist/rankSeasons.js +91 -0
- package/dist/rankStore.js +521 -0
- package/dist/rankSystem.fixture.js +170 -0
- package/dist/rankTables.entity.js +101 -0
- package/dist/ranks.d.ts +167 -0
- package/dist/ranks.js +219 -0
- package/dist/resourceStore.js +464 -0
- package/dist/resourceTables.entity.js +89 -0
- package/dist/resources.d.ts +105 -0
- package/dist/resources.js +60 -0
- package/dist/reward-app/schedules/progression.dispatchRewards.cron.tsx +19 -0
- package/dist/reward-app/workflows/progression.deliverReward.workflow.server.tsx +10 -0
- package/dist/reward-app/workflows/progression.deliverReward.workflow.tsx +1 -0
- package/dist/reward.d.ts +27 -0
- package/dist/reward.js +39 -0
- package/dist/rewardDelivery.d.ts +163 -0
- package/dist/rewardDelivery.js +38 -0
- package/dist/rewardDelivery.server.js +430 -0
- package/dist/rewardDeliveryRecord.js +48 -0
- package/dist/rewardDeliveryWorkflow.d.ts +36 -0
- package/dist/rewardDeliveryWorkflow.js +16 -0
- package/dist/rpc.d.ts +880 -0
- package/dist/rpc.js +498 -0
- package/dist/server.d.ts +2812 -0
- package/dist/server.js +21 -0
- package/dist/stats.js +45 -0
- package/dist/strategies.d.ts +131 -0
- package/dist/strategies.js +4 -0
- package/dist/systemFixtures.js +474 -0
- package/dist/tables.entity.js +155 -0
- package/dist/testing.d.ts +1566 -0
- package/dist/testing.js +11 -0
- package/dist/track.js +72 -0
- package/dist/tutorial.d.ts +157 -0
- package/dist/tutorial.js +110 -0
- package/dist/tutorialStore.js +496 -0
- package/dist/tutorialSystem.fixture.js +100 -0
- package/dist/tutorialTables.entity.js +91 -0
- package/dist/web.d.ts +363 -0
- package/dist/web.js +7 -0
- package/package.json +167 -4
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,2812 @@
|
|
|
1
|
+
import { ColumnBuilder } from '@voltro/database';
|
|
2
|
+
import { DataStore } from '@voltro/database';
|
|
3
|
+
import { EconomyService } from '@voltro/plugin-economy';
|
|
4
|
+
import { Effect } from 'effect';
|
|
5
|
+
import { FieldDefinitions } from '@voltro/database';
|
|
6
|
+
import { InventoryService } from '@voltro/plugin-inventory';
|
|
7
|
+
import { PluginPrivacyTarget } from '@voltro/protocol';
|
|
8
|
+
import { Schema } from 'effect';
|
|
9
|
+
import { Subject } from '@voltro/protocol';
|
|
10
|
+
import { Table } from '@voltro/database';
|
|
11
|
+
import { WorkflowRunHandle } from '@voltro/protocol';
|
|
12
|
+
import { YieldableError } from 'effect/Cause';
|
|
13
|
+
|
|
14
|
+
declare interface Achievement {
|
|
15
|
+
readonly id: string;
|
|
16
|
+
readonly version: number;
|
|
17
|
+
readonly hidden: boolean;
|
|
18
|
+
readonly tiers: readonly AchievementTier[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export declare interface AchievementAudit {
|
|
22
|
+
readonly acceptedOperations: number;
|
|
23
|
+
readonly unlocked: number;
|
|
24
|
+
readonly rewardRows: number;
|
|
25
|
+
readonly matches: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare type AchievementCondition = StatThreshold | CompositeCondition;
|
|
29
|
+
|
|
30
|
+
declare interface AchievementDefinition {
|
|
31
|
+
readonly id: string;
|
|
32
|
+
readonly version?: number;
|
|
33
|
+
readonly condition: AchievementCondition;
|
|
34
|
+
readonly tiers?: readonly AchievementTierDefinition[];
|
|
35
|
+
readonly hidden?: boolean;
|
|
36
|
+
readonly reward?: readonly ProgressionReward[];
|
|
37
|
+
readonly platform?: AchievementPlatform;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export declare const achievementDefinitionsTable: Table<"_voltro_prog_achievement_definitions", FieldDefinitions<{
|
|
41
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
42
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
43
|
+
readonly achievementId: ColumnBuilder<string, "text", boolean>;
|
|
44
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
45
|
+
readonly config: ColumnBuilder<unknown, "json", boolean>;
|
|
46
|
+
readonly rulesVersion: ColumnBuilder<string, "text", boolean>;
|
|
47
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
48
|
+
}>, true, "voltro_prog_achievement_definitions_version_idx">;
|
|
49
|
+
|
|
50
|
+
declare interface AchievementEvaluation {
|
|
51
|
+
readonly met: boolean;
|
|
52
|
+
readonly progress: readonly AchievementProgress[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare type AchievementEvaluator = (input: {
|
|
56
|
+
readonly condition: AchievementCondition;
|
|
57
|
+
readonly stats: readonly AchievementStat[];
|
|
58
|
+
}) => AchievementEvaluation;
|
|
59
|
+
|
|
60
|
+
export declare const achievementOperationsTable: Table<"_voltro_prog_achievement_operations", FieldDefinitions<{
|
|
61
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
62
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
63
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
64
|
+
readonly state: ColumnBuilder<"erased" | "committed", "text", boolean>;
|
|
65
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
66
|
+
readonly throughSequence: ColumnBuilder<number, "integer", boolean>;
|
|
67
|
+
readonly sourceVersion: ColumnBuilder<string | null, "text", boolean>;
|
|
68
|
+
readonly sourceDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
69
|
+
readonly configDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
70
|
+
readonly view: ColumnBuilder<unknown, "json", boolean>;
|
|
71
|
+
readonly receipt: ColumnBuilder<unknown, "json", boolean>;
|
|
72
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
73
|
+
}>, true, never>;
|
|
74
|
+
|
|
75
|
+
declare interface AchievementPlatform {
|
|
76
|
+
readonly steam?: string;
|
|
77
|
+
readonly gameCenter?: string;
|
|
78
|
+
readonly playGames?: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
declare interface AchievementProgress extends AchievementStat {
|
|
82
|
+
readonly target: string;
|
|
83
|
+
readonly met: boolean;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
declare interface AchievementReceipt {
|
|
87
|
+
readonly operationId: string;
|
|
88
|
+
readonly throughSequence: number;
|
|
89
|
+
readonly unlockedIds: readonly string[];
|
|
90
|
+
readonly rewardsQueued: number;
|
|
91
|
+
readonly at: number;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export declare const achievementRewardsTable: Table<"_voltro_prog_achievement_rewards", FieldDefinitions<{
|
|
95
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
96
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
97
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
98
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
99
|
+
readonly unlockId: ColumnBuilder<string, "text", boolean>;
|
|
100
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
101
|
+
readonly reward: ColumnBuilder<unknown, "json", boolean>;
|
|
102
|
+
readonly state: ColumnBuilder<"pending" | "erased" | "delivered", "text", boolean>;
|
|
103
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
104
|
+
readonly deliveredAt: ColumnBuilder<Date | null, "timestamp", boolean>;
|
|
105
|
+
readonly deliveryIntent: ColumnBuilder<unknown, "json", boolean>;
|
|
106
|
+
readonly deliveryDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
107
|
+
readonly deliveryReceipt: ColumnBuilder<unknown, "json", boolean>;
|
|
108
|
+
}>, true, never>;
|
|
109
|
+
|
|
110
|
+
declare interface AchievementService {
|
|
111
|
+
readonly evaluate: (subject: Subject, input: EvaluateAchievementsInput) => Effect.Effect<AchievementReceipt, ProgressionError>;
|
|
112
|
+
readonly mine: (subject: Subject) => Effect.Effect<readonly PlayerAchievement[], ProgressionError>;
|
|
113
|
+
readonly exportSubject: (target: PluginPrivacyTarget) => Effect.Effect<unknown, ProgressionError>;
|
|
114
|
+
readonly eraseSubject: (target: PluginPrivacyTarget) => Effect.Effect<void, ProgressionError>;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export declare interface AchievementSqlService extends AchievementService {
|
|
118
|
+
readonly auditAchievements: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<AchievementAudit, ProgressionError>;
|
|
119
|
+
readonly rebuildAchievements: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<AchievementAudit, ProgressionError>;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export declare const achievementsTable: Table<"_voltro_prog_achievements", FieldDefinitions<{
|
|
123
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
124
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
125
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
126
|
+
readonly achievementId: ColumnBuilder<string, "text", boolean>;
|
|
127
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
128
|
+
readonly tierId: ColumnBuilder<string, "text", boolean>;
|
|
129
|
+
readonly unlockedAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
130
|
+
readonly sourceSequence: ColumnBuilder<number, "integer", boolean>;
|
|
131
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
132
|
+
}>, true, never>;
|
|
133
|
+
|
|
134
|
+
declare interface AchievementStat {
|
|
135
|
+
readonly stat: string;
|
|
136
|
+
readonly period: 'lifetime' | 'season';
|
|
137
|
+
readonly seasonId: string | null;
|
|
138
|
+
readonly value: string;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
declare interface AchievementStatEvent extends AchievementStat {
|
|
142
|
+
readonly operationId: string;
|
|
143
|
+
readonly sequence: number;
|
|
144
|
+
readonly at: number;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
declare interface AchievementStatHistory {
|
|
148
|
+
readonly version: string;
|
|
149
|
+
readonly throughSequence: number;
|
|
150
|
+
readonly initial: readonly AchievementStat[];
|
|
151
|
+
readonly events: readonly AchievementStatEvent[];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
declare interface AchievementStatSourceService {
|
|
155
|
+
readonly history: (subject: Subject, input: {
|
|
156
|
+
readonly tenantId: string;
|
|
157
|
+
readonly ownerId: string;
|
|
158
|
+
readonly limit: number;
|
|
159
|
+
}) => Effect.Effect<AchievementStatHistory, ProgressionError>;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export declare interface AchievementStoreOptions {
|
|
163
|
+
readonly definitions: readonly (AchievementDefinition | Achievement)[];
|
|
164
|
+
readonly source: AchievementStatSourceService;
|
|
165
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
166
|
+
readonly maxHistoryRows?: number | undefined;
|
|
167
|
+
readonly maxPendingRewards?: number | undefined;
|
|
168
|
+
readonly now?: (() => number) | undefined;
|
|
169
|
+
readonly strategies?: {
|
|
170
|
+
readonly achievementEvaluator?: AchievementEvaluator | undefined;
|
|
171
|
+
readonly version?: string;
|
|
172
|
+
} | undefined;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export declare const achievementSubjectsTable: Table<"_voltro_prog_achievement_subjects", FieldDefinitions<{
|
|
176
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
177
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
178
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
179
|
+
readonly erased: ColumnBuilder<boolean, "boolean", boolean>;
|
|
180
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
181
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
182
|
+
readonly throughSequence: ColumnBuilder<number, "integer", boolean>;
|
|
183
|
+
readonly sourceVersion: ColumnBuilder<string | null, "text", boolean>;
|
|
184
|
+
readonly sourceDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
185
|
+
readonly configDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
186
|
+
readonly view: ColumnBuilder<unknown, "json", boolean>;
|
|
187
|
+
}>, true, never>;
|
|
188
|
+
|
|
189
|
+
export declare const achievementTables: readonly [ Table<"_voltro_prog_achievement_definitions", FieldDefinitions<{
|
|
190
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
191
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
192
|
+
readonly achievementId: ColumnBuilder<string, "text", boolean>;
|
|
193
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
194
|
+
readonly config: ColumnBuilder<unknown, "json", boolean>;
|
|
195
|
+
readonly rulesVersion: ColumnBuilder<string, "text", boolean>;
|
|
196
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
197
|
+
}>, true, "voltro_prog_achievement_definitions_version_idx">, Table<"_voltro_prog_achievement_subjects", FieldDefinitions<{
|
|
198
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
199
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
200
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
201
|
+
readonly erased: ColumnBuilder<boolean, "boolean", boolean>;
|
|
202
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
203
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
204
|
+
readonly throughSequence: ColumnBuilder<number, "integer", boolean>;
|
|
205
|
+
readonly sourceVersion: ColumnBuilder<string | null, "text", boolean>;
|
|
206
|
+
readonly sourceDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
207
|
+
readonly configDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
208
|
+
readonly view: ColumnBuilder<unknown, "json", boolean>;
|
|
209
|
+
}>, true, never>, Table<"_voltro_prog_achievements", FieldDefinitions<{
|
|
210
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
211
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
212
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
213
|
+
readonly achievementId: ColumnBuilder<string, "text", boolean>;
|
|
214
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
215
|
+
readonly tierId: ColumnBuilder<string, "text", boolean>;
|
|
216
|
+
readonly unlockedAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
217
|
+
readonly sourceSequence: ColumnBuilder<number, "integer", boolean>;
|
|
218
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
219
|
+
}>, true, never>, Table<"_voltro_prog_achievement_unlock_ledger", FieldDefinitions<{
|
|
220
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
221
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
222
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
223
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
224
|
+
readonly unlockId: ColumnBuilder<string, "text", boolean>;
|
|
225
|
+
readonly achievementId: ColumnBuilder<string, "text", boolean>;
|
|
226
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
227
|
+
readonly tierId: ColumnBuilder<string, "text", boolean>;
|
|
228
|
+
readonly unlockedAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
229
|
+
readonly sourceSequence: ColumnBuilder<number, "integer", boolean>;
|
|
230
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
231
|
+
readonly proof: ColumnBuilder<unknown, "json", boolean>;
|
|
232
|
+
}>, true, never>, Table<"_voltro_prog_achievement_operations", FieldDefinitions<{
|
|
233
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
234
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
235
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
236
|
+
readonly state: ColumnBuilder<"erased" | "committed", "text", boolean>;
|
|
237
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
238
|
+
readonly throughSequence: ColumnBuilder<number, "integer", boolean>;
|
|
239
|
+
readonly sourceVersion: ColumnBuilder<string | null, "text", boolean>;
|
|
240
|
+
readonly sourceDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
241
|
+
readonly configDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
242
|
+
readonly view: ColumnBuilder<unknown, "json", boolean>;
|
|
243
|
+
readonly receipt: ColumnBuilder<unknown, "json", boolean>;
|
|
244
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
245
|
+
}>, true, never>, Table<"_voltro_prog_achievement_rewards", FieldDefinitions<{
|
|
246
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
247
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
248
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
249
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
250
|
+
readonly unlockId: ColumnBuilder<string, "text", boolean>;
|
|
251
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
252
|
+
readonly reward: ColumnBuilder<unknown, "json", boolean>;
|
|
253
|
+
readonly state: ColumnBuilder<"pending" | "erased" | "delivered", "text", boolean>;
|
|
254
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
255
|
+
readonly deliveredAt: ColumnBuilder<Date | null, "timestamp", boolean>;
|
|
256
|
+
readonly deliveryIntent: ColumnBuilder<unknown, "json", boolean>;
|
|
257
|
+
readonly deliveryDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
258
|
+
readonly deliveryReceipt: ColumnBuilder<unknown, "json", boolean>;
|
|
259
|
+
}>, true, never>];
|
|
260
|
+
|
|
261
|
+
declare interface AchievementTier {
|
|
262
|
+
readonly id: string;
|
|
263
|
+
readonly condition: AchievementCondition;
|
|
264
|
+
readonly reward: readonly ProgressionReward[];
|
|
265
|
+
readonly platform: AchievementPlatform;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
declare interface AchievementTierDefinition {
|
|
269
|
+
readonly id: string;
|
|
270
|
+
readonly condition: AchievementCondition;
|
|
271
|
+
readonly reward?: readonly ProgressionReward[];
|
|
272
|
+
readonly platform?: AchievementPlatform;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export declare const achievementUnlockLedgerTable: Table<"_voltro_prog_achievement_unlock_ledger", FieldDefinitions<{
|
|
276
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
277
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
278
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
279
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
280
|
+
readonly unlockId: ColumnBuilder<string, "text", boolean>;
|
|
281
|
+
readonly achievementId: ColumnBuilder<string, "text", boolean>;
|
|
282
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
283
|
+
readonly tierId: ColumnBuilder<string, "text", boolean>;
|
|
284
|
+
readonly unlockedAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
285
|
+
readonly sourceSequence: ColumnBuilder<number, "integer", boolean>;
|
|
286
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
287
|
+
readonly proof: ColumnBuilder<unknown, "json", boolean>;
|
|
288
|
+
}>, true, never>;
|
|
289
|
+
|
|
290
|
+
declare interface ApplyStatInput {
|
|
291
|
+
readonly tenantId: string;
|
|
292
|
+
readonly ownerId: string;
|
|
293
|
+
readonly stat: string;
|
|
294
|
+
readonly period: 'lifetime' | 'season';
|
|
295
|
+
readonly seasonId?: string | null;
|
|
296
|
+
readonly operator: StatOperator;
|
|
297
|
+
readonly operand: ProgressValue;
|
|
298
|
+
readonly requestId: string;
|
|
299
|
+
readonly source: string;
|
|
300
|
+
readonly origin: string;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
declare interface ApplyXpInput {
|
|
304
|
+
readonly tenantId: string;
|
|
305
|
+
readonly ownerId: string;
|
|
306
|
+
readonly trackId: string;
|
|
307
|
+
readonly amount: ProgressValue;
|
|
308
|
+
readonly requestId: string;
|
|
309
|
+
readonly source: string;
|
|
310
|
+
readonly origin: string;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
declare interface AssignQuestsInput {
|
|
314
|
+
readonly tenantId: string;
|
|
315
|
+
readonly ownerId: string;
|
|
316
|
+
readonly poolId: string;
|
|
317
|
+
readonly requestId: string;
|
|
318
|
+
readonly expectedPoolDigest?: string;
|
|
319
|
+
readonly windowId: string;
|
|
320
|
+
readonly from: number;
|
|
321
|
+
readonly until: number;
|
|
322
|
+
readonly timezone: string;
|
|
323
|
+
readonly seed: number;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export declare const captureAchievementHistory: (input: unknown, limit: number) => AchievementStatHistory;
|
|
327
|
+
|
|
328
|
+
declare interface CompositeCondition {
|
|
329
|
+
readonly kind: 'composite';
|
|
330
|
+
readonly mode: 'all' | 'any';
|
|
331
|
+
readonly conditions: readonly AchievementCondition[];
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export declare interface DailyAudit {
|
|
335
|
+
readonly claims: number;
|
|
336
|
+
readonly rewardRows: number;
|
|
337
|
+
readonly calendars: number;
|
|
338
|
+
readonly matches: boolean;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
declare interface DailyClaimInput {
|
|
342
|
+
readonly calendarId: string;
|
|
343
|
+
readonly requestId: string;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
declare interface DailyClaimPlan {
|
|
347
|
+
readonly dayIndex: number;
|
|
348
|
+
readonly streak: number;
|
|
349
|
+
readonly protectionRemaining: number;
|
|
350
|
+
readonly cycle: number;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
declare type DailyClaimPolicy = (input: DailyClaimPolicyContext) => DailyClaimPlan;
|
|
354
|
+
|
|
355
|
+
declare interface DailyClaimPolicyContext {
|
|
356
|
+
readonly calendar: LoginCalendar;
|
|
357
|
+
readonly previous: DailyState | null;
|
|
358
|
+
readonly window: DailyWindow;
|
|
359
|
+
readonly at: number;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export declare const dailyClaimsTable: Table<"_voltro_prog_daily_claims", FieldDefinitions<{
|
|
363
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
364
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
365
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
366
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
367
|
+
readonly calendarId: ColumnBuilder<string, "text", boolean>;
|
|
368
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
369
|
+
readonly dayOrdinal: ColumnBuilder<number, "integer", boolean>;
|
|
370
|
+
readonly dayKey: ColumnBuilder<string, "text", boolean>;
|
|
371
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
372
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
373
|
+
readonly before: ColumnBuilder<unknown, "json", boolean>;
|
|
374
|
+
readonly after: ColumnBuilder<unknown, "json", boolean>;
|
|
375
|
+
readonly profileVersion: ColumnBuilder<string | null, "text", boolean>;
|
|
376
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
377
|
+
}>, true, never>;
|
|
378
|
+
|
|
379
|
+
export declare const dailyDefinitionsTable: Table<"_voltro_prog_daily_definitions", FieldDefinitions<{
|
|
380
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
381
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
382
|
+
readonly calendarId: ColumnBuilder<string, "text", boolean>;
|
|
383
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
384
|
+
readonly config: ColumnBuilder<unknown, "json", boolean>;
|
|
385
|
+
readonly rulesVersion: ColumnBuilder<string, "text", boolean>;
|
|
386
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
387
|
+
}>, true, never>;
|
|
388
|
+
|
|
389
|
+
export declare const dailyOperationsTable: Table<"_voltro_prog_daily_operations", FieldDefinitions<{
|
|
390
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
391
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
392
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
393
|
+
readonly state: ColumnBuilder<"replayed" | "erased" | "committed", "text", boolean>;
|
|
394
|
+
readonly linkedOperationId: ColumnBuilder<string | null, "text", boolean>;
|
|
395
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
396
|
+
readonly receipt: ColumnBuilder<unknown, "json", boolean>;
|
|
397
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
398
|
+
}>, true, never>;
|
|
399
|
+
|
|
400
|
+
declare interface DailyProfile {
|
|
401
|
+
readonly timezone: string;
|
|
402
|
+
readonly version: string;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
declare interface DailyProfileSourceService {
|
|
406
|
+
readonly read: (subject: Subject, scope: {
|
|
407
|
+
readonly tenantId: string;
|
|
408
|
+
readonly ownerId: string;
|
|
409
|
+
}) => Effect.Effect<DailyProfile, ProgressionError>;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
declare interface DailyReceipt {
|
|
413
|
+
readonly operationId: string;
|
|
414
|
+
readonly claimId: string;
|
|
415
|
+
readonly calendarId: string;
|
|
416
|
+
readonly dayKey: string;
|
|
417
|
+
readonly after: DailyState;
|
|
418
|
+
readonly rewardsQueued: number;
|
|
419
|
+
readonly at: number;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
export declare const dailyRewardsTable: Table<"_voltro_prog_daily_rewards", FieldDefinitions<{
|
|
423
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
424
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
425
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
426
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
427
|
+
readonly claimId: ColumnBuilder<string, "text", boolean>;
|
|
428
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
429
|
+
readonly reward: ColumnBuilder<unknown, "json", boolean>;
|
|
430
|
+
readonly state: ColumnBuilder<"pending" | "erased" | "delivered", "text", boolean>;
|
|
431
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
432
|
+
readonly deliveredAt: ColumnBuilder<Date | null, "timestamp", boolean>;
|
|
433
|
+
readonly deliveryIntent: ColumnBuilder<unknown, "json", boolean>;
|
|
434
|
+
readonly deliveryDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
435
|
+
readonly deliveryReceipt: ColumnBuilder<unknown, "json", boolean>;
|
|
436
|
+
}>, true, never>;
|
|
437
|
+
|
|
438
|
+
export declare interface DailySqlService extends LoginCalendarService {
|
|
439
|
+
readonly auditDaily: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<DailyAudit, ProgressionError>;
|
|
440
|
+
readonly rebuildDaily: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<DailyAudit, ProgressionError>;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
declare interface DailyState extends DailyWindow {
|
|
444
|
+
readonly calendarId: string;
|
|
445
|
+
readonly version: number;
|
|
446
|
+
readonly dayIndex: number;
|
|
447
|
+
readonly streak: number;
|
|
448
|
+
readonly protectionRemaining: number;
|
|
449
|
+
readonly cycle: number;
|
|
450
|
+
readonly at: number;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
export declare const dailyStatesTable: Table<"_voltro_prog_daily", FieldDefinitions<{
|
|
454
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
455
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
456
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
457
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
458
|
+
readonly calendarId: ColumnBuilder<string, "text", boolean>;
|
|
459
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
460
|
+
readonly state: ColumnBuilder<unknown, "json", boolean>;
|
|
461
|
+
readonly updatedAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
462
|
+
}>, true, never>;
|
|
463
|
+
|
|
464
|
+
export declare interface DailyStoreOptions {
|
|
465
|
+
readonly calendars: readonly LoginCalendarDefinition[];
|
|
466
|
+
readonly profileSource: DailyProfileSourceService;
|
|
467
|
+
readonly now?: (() => number) | undefined;
|
|
468
|
+
readonly maxHistoryRows?: number | undefined;
|
|
469
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
470
|
+
readonly strategies?: {
|
|
471
|
+
readonly claimPolicy?: DailyClaimPolicy | undefined;
|
|
472
|
+
readonly version?: string;
|
|
473
|
+
} | undefined;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
export declare const dailySubjectsTable: Table<"_voltro_prog_daily_subjects", FieldDefinitions<{
|
|
477
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
478
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
479
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
480
|
+
readonly erased: ColumnBuilder<boolean, "boolean", boolean>;
|
|
481
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
482
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
483
|
+
}>, true, never>;
|
|
484
|
+
|
|
485
|
+
export declare const dailyTables: readonly [ Table<"_voltro_prog_daily_definitions", FieldDefinitions<{
|
|
486
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
487
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
488
|
+
readonly calendarId: ColumnBuilder<string, "text", boolean>;
|
|
489
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
490
|
+
readonly config: ColumnBuilder<unknown, "json", boolean>;
|
|
491
|
+
readonly rulesVersion: ColumnBuilder<string, "text", boolean>;
|
|
492
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
493
|
+
}>, true, never>, Table<"_voltro_prog_daily_subjects", FieldDefinitions<{
|
|
494
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
495
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
496
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
497
|
+
readonly erased: ColumnBuilder<boolean, "boolean", boolean>;
|
|
498
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
499
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
500
|
+
}>, true, never>, Table<"_voltro_prog_daily", FieldDefinitions<{
|
|
501
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
502
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
503
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
504
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
505
|
+
readonly calendarId: ColumnBuilder<string, "text", boolean>;
|
|
506
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
507
|
+
readonly state: ColumnBuilder<unknown, "json", boolean>;
|
|
508
|
+
readonly updatedAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
509
|
+
}>, true, never>, Table<"_voltro_prog_daily_claims", FieldDefinitions<{
|
|
510
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
511
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
512
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
513
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
514
|
+
readonly calendarId: ColumnBuilder<string, "text", boolean>;
|
|
515
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
516
|
+
readonly dayOrdinal: ColumnBuilder<number, "integer", boolean>;
|
|
517
|
+
readonly dayKey: ColumnBuilder<string, "text", boolean>;
|
|
518
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
519
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
520
|
+
readonly before: ColumnBuilder<unknown, "json", boolean>;
|
|
521
|
+
readonly after: ColumnBuilder<unknown, "json", boolean>;
|
|
522
|
+
readonly profileVersion: ColumnBuilder<string | null, "text", boolean>;
|
|
523
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
524
|
+
}>, true, never>, Table<"_voltro_prog_daily_operations", FieldDefinitions<{
|
|
525
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
526
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
527
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
528
|
+
readonly state: ColumnBuilder<"replayed" | "erased" | "committed", "text", boolean>;
|
|
529
|
+
readonly linkedOperationId: ColumnBuilder<string | null, "text", boolean>;
|
|
530
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
531
|
+
readonly receipt: ColumnBuilder<unknown, "json", boolean>;
|
|
532
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
533
|
+
}>, true, never>, Table<"_voltro_prog_daily_rewards", FieldDefinitions<{
|
|
534
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
535
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
536
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
537
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
538
|
+
readonly claimId: ColumnBuilder<string, "text", boolean>;
|
|
539
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
540
|
+
readonly reward: ColumnBuilder<unknown, "json", boolean>;
|
|
541
|
+
readonly state: ColumnBuilder<"pending" | "erased" | "delivered", "text", boolean>;
|
|
542
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
543
|
+
readonly deliveredAt: ColumnBuilder<Date | null, "timestamp", boolean>;
|
|
544
|
+
readonly deliveryIntent: ColumnBuilder<unknown, "json", boolean>;
|
|
545
|
+
readonly deliveryDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
546
|
+
readonly deliveryReceipt: ColumnBuilder<unknown, "json", boolean>;
|
|
547
|
+
}>, true, never>];
|
|
548
|
+
|
|
549
|
+
declare interface DailyWindow {
|
|
550
|
+
readonly dayKey: string;
|
|
551
|
+
readonly dayOrdinal: number;
|
|
552
|
+
readonly from: number;
|
|
553
|
+
readonly until: number;
|
|
554
|
+
readonly timezone: string;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/** Source I/O and evaluator planning stay outside the owner SQL callback. */
|
|
558
|
+
export declare const dataStoreAchievements: (store: DataStore, input: AchievementStoreOptions) => AchievementSqlService;
|
|
559
|
+
|
|
560
|
+
export declare const dataStoreLoginCalendars: (store: DataStore, input: DailyStoreOptions) => DailySqlService;
|
|
561
|
+
|
|
562
|
+
/** Exact XP/stat materialization and durable reward intent; borrows one SQL owner. */
|
|
563
|
+
export declare const dataStoreProgression: (store: DataStore, input: ProgressionStoreOptions) => ProgressionSqlService;
|
|
564
|
+
|
|
565
|
+
/** Source I/O runs outside transactions; each mutation has one atomic value commit. */
|
|
566
|
+
export declare const dataStoreQuests: (store: DataStore, input: QuestStoreOptions) => QuestService;
|
|
567
|
+
|
|
568
|
+
/** Borrow accepted SQL truth. Missing units are errors; only retained erasure markers end erased. */
|
|
569
|
+
export declare const dataStoreRankClosure: (store: DataStore, ranks: RankSqlService, input: RankStoreOptions, closureInput?: RankClosureOptions) => RankClosureService;
|
|
570
|
+
|
|
571
|
+
/** Captured accepted observations, not a substitute authority for Ratings or a complete season scheduler. */
|
|
572
|
+
export declare const dataStoreRankSeasons: (store: DataStore, input: RankStoreOptions) => RankSqlService;
|
|
573
|
+
|
|
574
|
+
/** Borrow one root store; never invoke a port or nested transactional callback inside its value commit. */
|
|
575
|
+
export declare const dataStoreResources: (store: DataStore, input: ResourceStoreOptions) => ResourceSqlService;
|
|
576
|
+
|
|
577
|
+
/** One app owns reward SQL; actual external ports retain permanent accepted request identities. */
|
|
578
|
+
export declare const dataStoreRewardDelivery: (store: DataStore, input: RewardDeliveryOptions, installed: readonly RewardSourceKind[]) => RewardDeliveryService;
|
|
579
|
+
|
|
580
|
+
export declare const dataStoreSeasonPasses: (store: DataStore, input: PassStoreOptions) => PassSqlService;
|
|
581
|
+
|
|
582
|
+
export declare const dataStoreTutorials: (store: DataStore, input: TutorialStoreOptions) => TutorialSqlService;
|
|
583
|
+
|
|
584
|
+
export declare const defaultQuestSeed: QuestSeedResolver;
|
|
585
|
+
|
|
586
|
+
declare interface EvaluateAchievementsInput {
|
|
587
|
+
readonly tenantId: string;
|
|
588
|
+
readonly ownerId: string;
|
|
589
|
+
readonly requestId: string;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
declare type InitializeResourceInput = Omit<ResourceChangeInput, 'amount'>;
|
|
593
|
+
|
|
594
|
+
declare interface LevelCurve {
|
|
595
|
+
readonly thresholds: readonly string[];
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
declare interface LevelReward {
|
|
599
|
+
readonly level: number;
|
|
600
|
+
readonly reward: ProgressionReward;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
declare interface LoginCalendar {
|
|
604
|
+
readonly id: string;
|
|
605
|
+
readonly version: number;
|
|
606
|
+
readonly days: readonly (readonly ProgressionReward[])[];
|
|
607
|
+
readonly streakProtection: number;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
declare interface LoginCalendarDefinition {
|
|
611
|
+
readonly id: string;
|
|
612
|
+
readonly version?: number;
|
|
613
|
+
readonly days: readonly (readonly ProgressionReward[])[];
|
|
614
|
+
readonly streakProtection?: number;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
declare interface LoginCalendarService {
|
|
618
|
+
readonly claim: (subject: Subject, input: DailyClaimInput) => Effect.Effect<DailyReceipt, ProgressionError>;
|
|
619
|
+
readonly mine: (subject: Subject) => Effect.Effect<readonly PlayerDaily[], ProgressionError>;
|
|
620
|
+
readonly exportSubject: (target: PluginPrivacyTarget) => Effect.Effect<unknown, ProgressionError>;
|
|
621
|
+
readonly eraseSubject: (target: PluginPrivacyTarget) => Effect.Effect<void, ProgressionError>;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
/** Meta-worker only: all port I/O is outside the QuestStore's SQL callbacks. */
|
|
625
|
+
export declare const makeQuestRefreshService: (quests: QuestService, source: QuestStoreOptions, input: QuestRefreshOptions) => QuestRefreshService;
|
|
626
|
+
|
|
627
|
+
/** Explicitly composed read service, not yet an installed plugin route or season journal. */
|
|
628
|
+
export declare const makeRankReader: (input: RankReaderOptions) => RankReaderService;
|
|
629
|
+
|
|
630
|
+
export declare interface PassAudit {
|
|
631
|
+
readonly operations: number;
|
|
632
|
+
readonly passes: number;
|
|
633
|
+
readonly rewardRows: number;
|
|
634
|
+
readonly matches: boolean;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
declare type PassCatchUp = (input: PassCatchUpContext) => ProgressValue;
|
|
638
|
+
|
|
639
|
+
declare interface PassCatchUpContext {
|
|
640
|
+
readonly pass: SeasonPass;
|
|
641
|
+
readonly amount: string;
|
|
642
|
+
readonly at: number;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
declare interface PassClaimInput {
|
|
646
|
+
readonly passId: string;
|
|
647
|
+
readonly tier: number;
|
|
648
|
+
readonly track: PassTrack;
|
|
649
|
+
readonly requestId: string;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
declare interface PassCloseInput {
|
|
653
|
+
readonly tenantId: string;
|
|
654
|
+
readonly ownerId: string;
|
|
655
|
+
readonly passId: string;
|
|
656
|
+
readonly requestId: string;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
export declare const passDefinitionsTable: Table<"_voltro_prog_pass_definitions", FieldDefinitions<{
|
|
660
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
661
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
662
|
+
readonly passId: ColumnBuilder<string, "text", boolean>;
|
|
663
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
664
|
+
readonly config: ColumnBuilder<unknown, "json", boolean>;
|
|
665
|
+
readonly rulesVersion: ColumnBuilder<string, "text", boolean>;
|
|
666
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
667
|
+
}>, true, never>;
|
|
668
|
+
|
|
669
|
+
export declare const passLedgerTable: Table<"_voltro_prog_pass_ledger", FieldDefinitions<{
|
|
670
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
671
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
672
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
673
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
674
|
+
readonly passId: ColumnBuilder<string, "text", boolean>;
|
|
675
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
676
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
677
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
678
|
+
readonly intent: ColumnBuilder<unknown, "json", boolean>;
|
|
679
|
+
readonly before: ColumnBuilder<unknown, "json", boolean>;
|
|
680
|
+
readonly after: ColumnBuilder<unknown, "json", boolean>;
|
|
681
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
682
|
+
}>, true, never>;
|
|
683
|
+
|
|
684
|
+
export declare const passOperationsTable: Table<"_voltro_prog_pass_operations", FieldDefinitions<{
|
|
685
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
686
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
687
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
688
|
+
readonly originKey: ColumnBuilder<string | null, "text", boolean>;
|
|
689
|
+
readonly state: ColumnBuilder<"replayed" | "erased" | "committed", "text", boolean>;
|
|
690
|
+
readonly linkedOperationId: ColumnBuilder<string | null, "text", boolean>;
|
|
691
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
692
|
+
readonly receipt: ColumnBuilder<unknown, "json", boolean>;
|
|
693
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
694
|
+
}>, true, never>;
|
|
695
|
+
|
|
696
|
+
declare interface PassPremiumInput {
|
|
697
|
+
readonly tenantId: string;
|
|
698
|
+
readonly ownerId: string;
|
|
699
|
+
readonly passId: string;
|
|
700
|
+
readonly offerId: string;
|
|
701
|
+
readonly fulfillmentId: string;
|
|
702
|
+
readonly requestId: string;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
declare interface PassReceipt {
|
|
706
|
+
readonly operationId: string;
|
|
707
|
+
readonly kind: 'xp' | 'premium' | 'claim' | 'close';
|
|
708
|
+
readonly after: PassState;
|
|
709
|
+
readonly claims: readonly PassTierClaim[];
|
|
710
|
+
readonly rewardsQueued: number;
|
|
711
|
+
readonly at: number;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
export declare const passRewardsTable: Table<"_voltro_prog_pass_rewards", FieldDefinitions<{
|
|
715
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
716
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
717
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
718
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
719
|
+
readonly passId: ColumnBuilder<string, "text", boolean>;
|
|
720
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
721
|
+
readonly tier: ColumnBuilder<number, "integer", boolean>;
|
|
722
|
+
readonly track: ColumnBuilder<"free" | "premium", "text", boolean>;
|
|
723
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
724
|
+
readonly reward: ColumnBuilder<unknown, "json", boolean>;
|
|
725
|
+
readonly state: ColumnBuilder<"pending" | "erased" | "delivered", "text", boolean>;
|
|
726
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
727
|
+
readonly deliveredAt: ColumnBuilder<Date | null, "timestamp", boolean>;
|
|
728
|
+
readonly deliveryIntent: ColumnBuilder<unknown, "json", boolean>;
|
|
729
|
+
readonly deliveryDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
730
|
+
readonly deliveryReceipt: ColumnBuilder<unknown, "json", boolean>;
|
|
731
|
+
}>, true, never>;
|
|
732
|
+
|
|
733
|
+
export declare interface PassSqlService extends SeasonPassService {
|
|
734
|
+
readonly auditPasses: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<PassAudit, ProgressionError>;
|
|
735
|
+
readonly rebuildPasses: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<PassAudit, ProgressionError>;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
declare interface PassState {
|
|
739
|
+
readonly passId: string;
|
|
740
|
+
readonly version: number;
|
|
741
|
+
readonly xp: string;
|
|
742
|
+
readonly claimedFree: string;
|
|
743
|
+
readonly claimedPremium: string;
|
|
744
|
+
readonly premium: boolean;
|
|
745
|
+
readonly purchasedAt: number | null;
|
|
746
|
+
readonly fulfillmentId: string | null;
|
|
747
|
+
readonly closed: boolean;
|
|
748
|
+
readonly updatedAt: number;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
export declare const passStatesTable: Table<"_voltro_prog_pass", FieldDefinitions<{
|
|
752
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
753
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
754
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
755
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
756
|
+
readonly passId: ColumnBuilder<string, "text", boolean>;
|
|
757
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
758
|
+
readonly state: ColumnBuilder<unknown, "json", boolean>;
|
|
759
|
+
readonly updatedAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
760
|
+
}>, true, never>;
|
|
761
|
+
|
|
762
|
+
export declare interface PassStoreOptions {
|
|
763
|
+
readonly definitions: readonly (SeasonPassDefinition | SeasonPass)[];
|
|
764
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
765
|
+
readonly now?: (() => number) | undefined;
|
|
766
|
+
readonly maxHistoryRows?: number | undefined;
|
|
767
|
+
readonly maxPendingRewards?: number | undefined;
|
|
768
|
+
readonly strategies?: {
|
|
769
|
+
readonly passCatchUp?: PassCatchUp | undefined;
|
|
770
|
+
readonly version?: string;
|
|
771
|
+
} | undefined;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
export declare const passSubjectsTable: Table<"_voltro_prog_pass_subjects", FieldDefinitions<{
|
|
775
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
776
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
777
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
778
|
+
readonly erased: ColumnBuilder<boolean, "boolean", boolean>;
|
|
779
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
780
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
781
|
+
}>, true, never>;
|
|
782
|
+
|
|
783
|
+
export declare const passTables: readonly [ Table<"_voltro_prog_pass_definitions", FieldDefinitions<{
|
|
784
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
785
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
786
|
+
readonly passId: ColumnBuilder<string, "text", boolean>;
|
|
787
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
788
|
+
readonly config: ColumnBuilder<unknown, "json", boolean>;
|
|
789
|
+
readonly rulesVersion: ColumnBuilder<string, "text", boolean>;
|
|
790
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
791
|
+
}>, true, never>, Table<"_voltro_prog_pass_subjects", FieldDefinitions<{
|
|
792
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
793
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
794
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
795
|
+
readonly erased: ColumnBuilder<boolean, "boolean", boolean>;
|
|
796
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
797
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
798
|
+
}>, true, never>, Table<"_voltro_prog_pass", FieldDefinitions<{
|
|
799
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
800
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
801
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
802
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
803
|
+
readonly passId: ColumnBuilder<string, "text", boolean>;
|
|
804
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
805
|
+
readonly state: ColumnBuilder<unknown, "json", boolean>;
|
|
806
|
+
readonly updatedAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
807
|
+
}>, true, never>, Table<"_voltro_prog_pass_ledger", FieldDefinitions<{
|
|
808
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
809
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
810
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
811
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
812
|
+
readonly passId: ColumnBuilder<string, "text", boolean>;
|
|
813
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
814
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
815
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
816
|
+
readonly intent: ColumnBuilder<unknown, "json", boolean>;
|
|
817
|
+
readonly before: ColumnBuilder<unknown, "json", boolean>;
|
|
818
|
+
readonly after: ColumnBuilder<unknown, "json", boolean>;
|
|
819
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
820
|
+
}>, true, never>, Table<"_voltro_prog_pass_operations", FieldDefinitions<{
|
|
821
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
822
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
823
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
824
|
+
readonly originKey: ColumnBuilder<string | null, "text", boolean>;
|
|
825
|
+
readonly state: ColumnBuilder<"replayed" | "erased" | "committed", "text", boolean>;
|
|
826
|
+
readonly linkedOperationId: ColumnBuilder<string | null, "text", boolean>;
|
|
827
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
828
|
+
readonly receipt: ColumnBuilder<unknown, "json", boolean>;
|
|
829
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
830
|
+
}>, true, never>, Table<"_voltro_prog_pass_rewards", FieldDefinitions<{
|
|
831
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
832
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
833
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
834
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
835
|
+
readonly passId: ColumnBuilder<string, "text", boolean>;
|
|
836
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
837
|
+
readonly tier: ColumnBuilder<number, "integer", boolean>;
|
|
838
|
+
readonly track: ColumnBuilder<"free" | "premium", "text", boolean>;
|
|
839
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
840
|
+
readonly reward: ColumnBuilder<unknown, "json", boolean>;
|
|
841
|
+
readonly state: ColumnBuilder<"pending" | "erased" | "delivered", "text", boolean>;
|
|
842
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
843
|
+
readonly deliveredAt: ColumnBuilder<Date | null, "timestamp", boolean>;
|
|
844
|
+
readonly deliveryIntent: ColumnBuilder<unknown, "json", boolean>;
|
|
845
|
+
readonly deliveryDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
846
|
+
readonly deliveryReceipt: ColumnBuilder<unknown, "json", boolean>;
|
|
847
|
+
}>, true, never>];
|
|
848
|
+
|
|
849
|
+
declare interface PassTierClaim {
|
|
850
|
+
readonly tier: number;
|
|
851
|
+
readonly track: PassTrack;
|
|
852
|
+
readonly rewards: readonly ProgressionReward[];
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
declare type PassTrack = 'free' | 'premium';
|
|
856
|
+
|
|
857
|
+
declare interface PassXpInput {
|
|
858
|
+
readonly tenantId: string;
|
|
859
|
+
readonly ownerId: string;
|
|
860
|
+
readonly passId: string;
|
|
861
|
+
readonly amount: ProgressValue;
|
|
862
|
+
readonly source: string;
|
|
863
|
+
readonly originId: string;
|
|
864
|
+
readonly requestId: string;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
declare interface PlayerAchievement {
|
|
868
|
+
readonly achievementId: string;
|
|
869
|
+
readonly version: number;
|
|
870
|
+
readonly tierId: string;
|
|
871
|
+
readonly unlocked: boolean;
|
|
872
|
+
readonly unlockedAt: number | null;
|
|
873
|
+
readonly progress: readonly AchievementProgress[];
|
|
874
|
+
readonly platform: AchievementPlatform | null;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
declare interface PlayerDaily {
|
|
878
|
+
readonly calendarId: string;
|
|
879
|
+
readonly version: number;
|
|
880
|
+
readonly dayKey: string;
|
|
881
|
+
readonly timezone: string;
|
|
882
|
+
readonly from: number;
|
|
883
|
+
readonly until: number;
|
|
884
|
+
readonly observedAt: number;
|
|
885
|
+
readonly claimed: boolean;
|
|
886
|
+
readonly dayIndex: number;
|
|
887
|
+
readonly streak: number;
|
|
888
|
+
readonly protectionRemaining: number;
|
|
889
|
+
readonly reward: readonly ProgressionReward[];
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
declare interface PlayerPass extends PassState {
|
|
893
|
+
readonly tier: number;
|
|
894
|
+
readonly from: number;
|
|
895
|
+
readonly until: number;
|
|
896
|
+
readonly observedAt: number;
|
|
897
|
+
readonly active: boolean;
|
|
898
|
+
readonly premiumOffer: string | null;
|
|
899
|
+
readonly claimable: readonly PassTierClaim[];
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
declare interface PlayerQuest {
|
|
903
|
+
readonly id: string;
|
|
904
|
+
readonly poolId: string;
|
|
905
|
+
readonly windowId: string;
|
|
906
|
+
readonly quest: QuestDefinition;
|
|
907
|
+
readonly progress: readonly number[];
|
|
908
|
+
readonly state: 'active' | 'completed';
|
|
909
|
+
readonly assignedAt: number;
|
|
910
|
+
readonly expiresAt: number;
|
|
911
|
+
readonly rerollsUsed: number;
|
|
912
|
+
readonly rerollsAllowed: number;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
declare interface PlayerRank {
|
|
916
|
+
readonly ladderId: string;
|
|
917
|
+
readonly version: number;
|
|
918
|
+
readonly pool: string;
|
|
919
|
+
readonly games: number;
|
|
920
|
+
readonly placementsRemaining: number;
|
|
921
|
+
readonly rawScore: number;
|
|
922
|
+
readonly score: number;
|
|
923
|
+
readonly grade: RankGrade | null;
|
|
924
|
+
readonly ratingUpdatedAt: number | null;
|
|
925
|
+
readonly observedAt: number;
|
|
926
|
+
readonly rulesVersion: string;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
declare interface PlayerResource {
|
|
930
|
+
readonly resourceId: string;
|
|
931
|
+
readonly value: string;
|
|
932
|
+
readonly max: string;
|
|
933
|
+
readonly initialized: boolean;
|
|
934
|
+
readonly observedAt: number;
|
|
935
|
+
readonly nextRegenAt: number | null;
|
|
936
|
+
readonly refillOffer?: string;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
declare interface PlayerStat {
|
|
940
|
+
readonly stat: string;
|
|
941
|
+
readonly period: 'lifetime' | 'season';
|
|
942
|
+
readonly seasonId: string | null;
|
|
943
|
+
readonly value: string;
|
|
944
|
+
readonly updatedAt: number;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
declare interface PlayerTrack {
|
|
948
|
+
readonly trackId: string;
|
|
949
|
+
readonly xp: string;
|
|
950
|
+
readonly level: number;
|
|
951
|
+
readonly prestige: number;
|
|
952
|
+
readonly updatedAt: number | null;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
declare interface PlayerTutorial extends TutorialState {
|
|
956
|
+
readonly nextStep: string | null;
|
|
957
|
+
readonly skippable: boolean;
|
|
958
|
+
readonly hints: string | null;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
export declare interface ProgressionAudit {
|
|
962
|
+
readonly tracks: number;
|
|
963
|
+
readonly stats: number;
|
|
964
|
+
readonly acceptedOperations: number;
|
|
965
|
+
readonly xpLedgerRows: number;
|
|
966
|
+
readonly statLedgerRows: number;
|
|
967
|
+
readonly rewardRows: number;
|
|
968
|
+
readonly matches: boolean;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
declare type ProgressionChange = {
|
|
972
|
+
readonly kind: 'xp';
|
|
973
|
+
readonly trackId: string;
|
|
974
|
+
readonly xp: string;
|
|
975
|
+
readonly delta: string;
|
|
976
|
+
readonly fromLevel: number;
|
|
977
|
+
readonly toLevel: number;
|
|
978
|
+
} | {
|
|
979
|
+
readonly kind: 'stat';
|
|
980
|
+
readonly stat: string;
|
|
981
|
+
readonly period: 'lifetime' | 'season';
|
|
982
|
+
readonly seasonId: string | null;
|
|
983
|
+
readonly value: string;
|
|
984
|
+
readonly operator: StatOperator;
|
|
985
|
+
};
|
|
986
|
+
|
|
987
|
+
declare interface ProgressionDefinition {
|
|
988
|
+
readonly id: string;
|
|
989
|
+
readonly version?: number;
|
|
990
|
+
readonly xpCurve: LevelCurve;
|
|
991
|
+
readonly sources: readonly string[];
|
|
992
|
+
readonly rewards?: Readonly<Record<string, readonly ProgressionReward[] | Readonly<Record<string, readonly ProgressionReward[]>>>>;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
export declare const progressionDefinitionsTable: Table<"_voltro_prog_definitions", FieldDefinitions<{
|
|
996
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
997
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
998
|
+
readonly kind: ColumnBuilder<"track" | "stat", "text", boolean>;
|
|
999
|
+
readonly definitionId: ColumnBuilder<string, "text", boolean>;
|
|
1000
|
+
readonly config: ColumnBuilder<unknown, "json", boolean>;
|
|
1001
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
1002
|
+
}>, true, never>;
|
|
1003
|
+
|
|
1004
|
+
declare class ProgressionError extends ProgressionError_base {
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
declare const ProgressionError_base: Schema.Class<ProgressionError, Schema.TaggedStruct<"ProgressionError", {
|
|
1008
|
+
readonly code: Schema.Literals<readonly ["invalid_input", "invalid_record", "invalid_curve", "invalid_reward", "invalid_track", "invalid_stat", "overflow", "insufficient_resource", "forbidden", "conflict", "erased", "not_found", "limit_exceeded", "unavailable"]>;
|
|
1009
|
+
}>, YieldableError>;
|
|
1010
|
+
|
|
1011
|
+
export declare const progressionOperationsTable: Table<"_voltro_prog_operations", FieldDefinitions<{
|
|
1012
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1013
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1014
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1015
|
+
readonly state: ColumnBuilder<"pending" | "replayed" | "erased" | "committed", "text", boolean>;
|
|
1016
|
+
readonly linkedOperationId: ColumnBuilder<string | null, "text", boolean>;
|
|
1017
|
+
readonly sequence: ColumnBuilder<number | null, "integer", boolean>;
|
|
1018
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
1019
|
+
readonly receipt: ColumnBuilder<unknown, "json", boolean>;
|
|
1020
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1021
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
1022
|
+
}>, true, never>;
|
|
1023
|
+
|
|
1024
|
+
export declare const progressionOriginsTable: Table<"_voltro_prog_origins", FieldDefinitions<{
|
|
1025
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1026
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1027
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1028
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
1029
|
+
readonly source: ColumnBuilder<string | null, "text", boolean>;
|
|
1030
|
+
readonly origin: ColumnBuilder<string | null, "text", boolean>;
|
|
1031
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
1032
|
+
}>, true, never>;
|
|
1033
|
+
|
|
1034
|
+
declare interface ProgressionReceipt {
|
|
1035
|
+
readonly operationId: string;
|
|
1036
|
+
readonly at: number;
|
|
1037
|
+
readonly change: ProgressionChange;
|
|
1038
|
+
readonly rewardsQueued: number;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
declare type ProgressionReward = {
|
|
1042
|
+
readonly kind: 'currency';
|
|
1043
|
+
readonly currency: string;
|
|
1044
|
+
readonly amount: string;
|
|
1045
|
+
} | {
|
|
1046
|
+
readonly kind: 'item';
|
|
1047
|
+
readonly itemId: string;
|
|
1048
|
+
readonly qty: number;
|
|
1049
|
+
} | {
|
|
1050
|
+
readonly kind: 'xp';
|
|
1051
|
+
readonly trackId: string;
|
|
1052
|
+
readonly amount: string;
|
|
1053
|
+
};
|
|
1054
|
+
|
|
1055
|
+
export declare const progressionRewardsTable: Table<"_voltro_prog_rewards", FieldDefinitions<{
|
|
1056
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1057
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1058
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
1059
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1060
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
1061
|
+
readonly level: ColumnBuilder<number, "integer", boolean>;
|
|
1062
|
+
readonly reward: ColumnBuilder<unknown, "json", boolean>;
|
|
1063
|
+
readonly state: ColumnBuilder<"pending" | "erased" | "delivered", "text", boolean>;
|
|
1064
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1065
|
+
readonly deliveredAt: ColumnBuilder<Date | null, "timestamp", boolean>;
|
|
1066
|
+
readonly deliveryIntent: ColumnBuilder<unknown, "json", boolean>;
|
|
1067
|
+
readonly deliveryDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
1068
|
+
readonly deliveryReceipt: ColumnBuilder<unknown, "json", boolean>;
|
|
1069
|
+
}>, true, never>;
|
|
1070
|
+
|
|
1071
|
+
declare interface ProgressionService {
|
|
1072
|
+
readonly applyXp: (subject: Subject, input: ApplyXpInput) => Effect.Effect<ProgressionReceipt, ProgressionError>;
|
|
1073
|
+
readonly applyStat: (subject: Subject, input: ApplyStatInput) => Effect.Effect<ProgressionReceipt, ProgressionError>;
|
|
1074
|
+
readonly mine: (subject: Subject) => Effect.Effect<readonly PlayerTrack[], ProgressionError>;
|
|
1075
|
+
readonly stats: (subject: Subject) => Effect.Effect<readonly PlayerStat[], ProgressionError>;
|
|
1076
|
+
readonly exportSubject: (target: PluginPrivacyTarget) => Effect.Effect<unknown, ProgressionError>;
|
|
1077
|
+
readonly eraseSubject: (target: PluginPrivacyTarget) => Effect.Effect<void, ProgressionError>;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
export declare interface ProgressionSqlService extends ProgressionService {
|
|
1081
|
+
readonly achievementHistory: (subject: Subject, tenantId: string, ownerId: string, limit: number) => Effect.Effect<AchievementStatHistory, ProgressionError>;
|
|
1082
|
+
readonly auditProgression: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<ProgressionAudit, ProgressionError>;
|
|
1083
|
+
readonly rebuildProgression: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<ProgressionAudit, ProgressionError>;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
declare interface ProgressionStat {
|
|
1087
|
+
readonly id: string;
|
|
1088
|
+
readonly initial: string;
|
|
1089
|
+
readonly cap: string;
|
|
1090
|
+
readonly operators: readonly StatOperator[];
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
export declare const progressionStatLedgerTable: Table<"_voltro_prog_stat_ledger", FieldDefinitions<{
|
|
1094
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1095
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1096
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
1097
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1098
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
1099
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
1100
|
+
readonly stat: ColumnBuilder<string, "text", boolean>;
|
|
1101
|
+
readonly period: ColumnBuilder<"season" | "lifetime", "text", boolean>;
|
|
1102
|
+
readonly seasonId: ColumnBuilder<string | null, "text", boolean>;
|
|
1103
|
+
readonly operator: ColumnBuilder<"min" | "max" | "set" | "increment", "text", boolean>;
|
|
1104
|
+
readonly operand: ColumnBuilder<string, "bigint", boolean>;
|
|
1105
|
+
readonly beforeValue: ColumnBuilder<string | null, "bigint", boolean>;
|
|
1106
|
+
readonly afterValue: ColumnBuilder<string, "bigint", boolean>;
|
|
1107
|
+
readonly source: ColumnBuilder<string, "text", boolean>;
|
|
1108
|
+
readonly origin: ColumnBuilder<string | null, "text", boolean>;
|
|
1109
|
+
readonly actor: ColumnBuilder<string | null, "text", boolean>;
|
|
1110
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1111
|
+
}>, true, never>;
|
|
1112
|
+
|
|
1113
|
+
export declare const progressionStatsTable: Table<"_voltro_prog_stats", FieldDefinitions<{
|
|
1114
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1115
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1116
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
1117
|
+
readonly stat: ColumnBuilder<string, "text", boolean>;
|
|
1118
|
+
readonly period: ColumnBuilder<"season" | "lifetime", "text", boolean>;
|
|
1119
|
+
readonly seasonId: ColumnBuilder<string | null, "text", boolean>;
|
|
1120
|
+
readonly value: ColumnBuilder<string, "bigint", boolean>;
|
|
1121
|
+
readonly updatedAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1122
|
+
}>, true, never>;
|
|
1123
|
+
|
|
1124
|
+
export declare interface ProgressionStoreOptions {
|
|
1125
|
+
readonly tracks: readonly ProgressionDefinition[];
|
|
1126
|
+
readonly stats?: readonly StatDefinition[] | undefined;
|
|
1127
|
+
readonly statSources?: readonly string[] | undefined;
|
|
1128
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
1129
|
+
readonly maxHistoryRows?: number | undefined;
|
|
1130
|
+
readonly maxPendingRewards?: number | undefined;
|
|
1131
|
+
readonly now?: (() => number) | undefined;
|
|
1132
|
+
readonly strategies?: {
|
|
1133
|
+
readonly xpCurve?: XpCurve | undefined;
|
|
1134
|
+
readonly rewardResolver?: RewardResolver;
|
|
1135
|
+
readonly version?: string;
|
|
1136
|
+
} | undefined;
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
export declare const progressionSubjectsTable: Table<"_voltro_prog_subjects", FieldDefinitions<{
|
|
1140
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1141
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1142
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
1143
|
+
readonly erased: ColumnBuilder<boolean, "boolean", boolean>;
|
|
1144
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
1145
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
1146
|
+
}>, true, never>;
|
|
1147
|
+
|
|
1148
|
+
export declare const progressionTables: readonly [ Table<"_voltro_prog_definitions", FieldDefinitions<{
|
|
1149
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1150
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1151
|
+
readonly kind: ColumnBuilder<"track" | "stat", "text", boolean>;
|
|
1152
|
+
readonly definitionId: ColumnBuilder<string, "text", boolean>;
|
|
1153
|
+
readonly config: ColumnBuilder<unknown, "json", boolean>;
|
|
1154
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
1155
|
+
}>, true, never>, Table<"_voltro_prog_subjects", FieldDefinitions<{
|
|
1156
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1157
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1158
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
1159
|
+
readonly erased: ColumnBuilder<boolean, "boolean", boolean>;
|
|
1160
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
1161
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
1162
|
+
}>, true, never>, Table<"_voltro_prog_tracks", FieldDefinitions<{
|
|
1163
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1164
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1165
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
1166
|
+
readonly trackId: ColumnBuilder<string, "text", boolean>;
|
|
1167
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
1168
|
+
readonly xp: ColumnBuilder<string, "bigint", boolean>;
|
|
1169
|
+
readonly level: ColumnBuilder<number, "integer", boolean>;
|
|
1170
|
+
readonly prestige: ColumnBuilder<number, "integer", boolean>;
|
|
1171
|
+
readonly updatedAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1172
|
+
readonly metadata: ColumnBuilder<unknown, "json", boolean>;
|
|
1173
|
+
}>, true, never>, Table<"_voltro_prog_xp_ledger", FieldDefinitions<{
|
|
1174
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1175
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1176
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
1177
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1178
|
+
readonly trackId: ColumnBuilder<string, "text", boolean>;
|
|
1179
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
1180
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
1181
|
+
readonly delta: ColumnBuilder<string, "bigint", boolean>;
|
|
1182
|
+
readonly afterXp: ColumnBuilder<string, "bigint", boolean>;
|
|
1183
|
+
readonly fromLevel: ColumnBuilder<number, "integer", boolean>;
|
|
1184
|
+
readonly toLevel: ColumnBuilder<number, "integer", boolean>;
|
|
1185
|
+
readonly source: ColumnBuilder<string, "text", boolean>;
|
|
1186
|
+
readonly origin: ColumnBuilder<string | null, "text", boolean>;
|
|
1187
|
+
readonly actor: ColumnBuilder<string | null, "text", boolean>;
|
|
1188
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1189
|
+
}>, true, never>, Table<"_voltro_prog_stats", FieldDefinitions<{
|
|
1190
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1191
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1192
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
1193
|
+
readonly stat: ColumnBuilder<string, "text", boolean>;
|
|
1194
|
+
readonly period: ColumnBuilder<"season" | "lifetime", "text", boolean>;
|
|
1195
|
+
readonly seasonId: ColumnBuilder<string | null, "text", boolean>;
|
|
1196
|
+
readonly value: ColumnBuilder<string, "bigint", boolean>;
|
|
1197
|
+
readonly updatedAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1198
|
+
}>, true, never>, Table<"_voltro_prog_stat_ledger", FieldDefinitions<{
|
|
1199
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1200
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1201
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
1202
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1203
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
1204
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
1205
|
+
readonly stat: ColumnBuilder<string, "text", boolean>;
|
|
1206
|
+
readonly period: ColumnBuilder<"season" | "lifetime", "text", boolean>;
|
|
1207
|
+
readonly seasonId: ColumnBuilder<string | null, "text", boolean>;
|
|
1208
|
+
readonly operator: ColumnBuilder<"min" | "max" | "set" | "increment", "text", boolean>;
|
|
1209
|
+
readonly operand: ColumnBuilder<string, "bigint", boolean>;
|
|
1210
|
+
readonly beforeValue: ColumnBuilder<string | null, "bigint", boolean>;
|
|
1211
|
+
readonly afterValue: ColumnBuilder<string, "bigint", boolean>;
|
|
1212
|
+
readonly source: ColumnBuilder<string, "text", boolean>;
|
|
1213
|
+
readonly origin: ColumnBuilder<string | null, "text", boolean>;
|
|
1214
|
+
readonly actor: ColumnBuilder<string | null, "text", boolean>;
|
|
1215
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1216
|
+
}>, true, never>, Table<"_voltro_prog_operations", FieldDefinitions<{
|
|
1217
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1218
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1219
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1220
|
+
readonly state: ColumnBuilder<"pending" | "replayed" | "erased" | "committed", "text", boolean>;
|
|
1221
|
+
readonly linkedOperationId: ColumnBuilder<string | null, "text", boolean>;
|
|
1222
|
+
readonly sequence: ColumnBuilder<number | null, "integer", boolean>;
|
|
1223
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
1224
|
+
readonly receipt: ColumnBuilder<unknown, "json", boolean>;
|
|
1225
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1226
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
1227
|
+
}>, true, never>, Table<"_voltro_prog_origins", FieldDefinitions<{
|
|
1228
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1229
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1230
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1231
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
1232
|
+
readonly source: ColumnBuilder<string | null, "text", boolean>;
|
|
1233
|
+
readonly origin: ColumnBuilder<string | null, "text", boolean>;
|
|
1234
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
1235
|
+
}>, true, never>, Table<"_voltro_prog_rewards", FieldDefinitions<{
|
|
1236
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1237
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1238
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
1239
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1240
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
1241
|
+
readonly level: ColumnBuilder<number, "integer", boolean>;
|
|
1242
|
+
readonly reward: ColumnBuilder<unknown, "json", boolean>;
|
|
1243
|
+
readonly state: ColumnBuilder<"pending" | "erased" | "delivered", "text", boolean>;
|
|
1244
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1245
|
+
readonly deliveredAt: ColumnBuilder<Date | null, "timestamp", boolean>;
|
|
1246
|
+
readonly deliveryIntent: ColumnBuilder<unknown, "json", boolean>;
|
|
1247
|
+
readonly deliveryDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
1248
|
+
readonly deliveryReceipt: ColumnBuilder<unknown, "json", boolean>;
|
|
1249
|
+
}>, true, never>];
|
|
1250
|
+
|
|
1251
|
+
declare interface ProgressionTrack {
|
|
1252
|
+
readonly id: string;
|
|
1253
|
+
readonly version: number;
|
|
1254
|
+
readonly xpCurve: LevelCurve;
|
|
1255
|
+
readonly sources: readonly string[];
|
|
1256
|
+
readonly rewards: Readonly<Record<string, readonly ProgressionReward[]>>;
|
|
1257
|
+
readonly every: Readonly<Record<string, readonly ProgressionReward[]>>;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
export declare const progressionTracksTable: Table<"_voltro_prog_tracks", FieldDefinitions<{
|
|
1261
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1262
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1263
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
1264
|
+
readonly trackId: ColumnBuilder<string, "text", boolean>;
|
|
1265
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
1266
|
+
readonly xp: ColumnBuilder<string, "bigint", boolean>;
|
|
1267
|
+
readonly level: ColumnBuilder<number, "integer", boolean>;
|
|
1268
|
+
readonly prestige: ColumnBuilder<number, "integer", boolean>;
|
|
1269
|
+
readonly updatedAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1270
|
+
readonly metadata: ColumnBuilder<unknown, "json", boolean>;
|
|
1271
|
+
}>, true, never>;
|
|
1272
|
+
|
|
1273
|
+
export declare const progressionXpLedgerTable: Table<"_voltro_prog_xp_ledger", FieldDefinitions<{
|
|
1274
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1275
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1276
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
1277
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1278
|
+
readonly trackId: ColumnBuilder<string, "text", boolean>;
|
|
1279
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
1280
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
1281
|
+
readonly delta: ColumnBuilder<string, "bigint", boolean>;
|
|
1282
|
+
readonly afterXp: ColumnBuilder<string, "bigint", boolean>;
|
|
1283
|
+
readonly fromLevel: ColumnBuilder<number, "integer", boolean>;
|
|
1284
|
+
readonly toLevel: ColumnBuilder<number, "integer", boolean>;
|
|
1285
|
+
readonly source: ColumnBuilder<string, "text", boolean>;
|
|
1286
|
+
readonly origin: ColumnBuilder<string | null, "text", boolean>;
|
|
1287
|
+
readonly actor: ColumnBuilder<string | null, "text", boolean>;
|
|
1288
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1289
|
+
}>, true, never>;
|
|
1290
|
+
|
|
1291
|
+
declare type ProgressValue = string | number | bigint;
|
|
1292
|
+
|
|
1293
|
+
declare interface QuestDefinition {
|
|
1294
|
+
readonly id: string;
|
|
1295
|
+
readonly titleKey?: string;
|
|
1296
|
+
readonly objectives: readonly QuestObjective[];
|
|
1297
|
+
readonly reward: readonly ProgressionReward[];
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
export declare const questDefinitionsTable: Table<"_voltro_prog_quest_definitions", FieldDefinitions<{
|
|
1301
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1302
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1303
|
+
readonly poolId: ColumnBuilder<string, "text", boolean>;
|
|
1304
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
1305
|
+
readonly config: ColumnBuilder<unknown, "json", boolean>;
|
|
1306
|
+
readonly rulesVersion: ColumnBuilder<string, "text", boolean>;
|
|
1307
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
1308
|
+
}>, true, never>;
|
|
1309
|
+
|
|
1310
|
+
declare type QuestObjective = {
|
|
1311
|
+
readonly stat: string;
|
|
1312
|
+
readonly target: number;
|
|
1313
|
+
} | {
|
|
1314
|
+
readonly event: string;
|
|
1315
|
+
readonly target: number;
|
|
1316
|
+
readonly where?: Readonly<Record<string, QuestScalar>>;
|
|
1317
|
+
};
|
|
1318
|
+
|
|
1319
|
+
export declare const questOperationsTable: Table<"_voltro_prog_quest_operations", FieldDefinitions<{
|
|
1320
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1321
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1322
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1323
|
+
readonly state: ColumnBuilder<"pending" | "replayed" | "erased" | "committed", "text", boolean>;
|
|
1324
|
+
readonly linkedOperationId: ColumnBuilder<string | null, "text", boolean>;
|
|
1325
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
1326
|
+
readonly receipt: ColumnBuilder<unknown, "json", boolean>;
|
|
1327
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1328
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
1329
|
+
}>, true, never>;
|
|
1330
|
+
|
|
1331
|
+
export declare const questOriginsTable: Table<"_voltro_prog_quest_origins", FieldDefinitions<{
|
|
1332
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1333
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1334
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1335
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
1336
|
+
readonly source: ColumnBuilder<string | null, "text", boolean>;
|
|
1337
|
+
readonly origin: ColumnBuilder<string | null, "text", boolean>;
|
|
1338
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
1339
|
+
}>, true, never>;
|
|
1340
|
+
|
|
1341
|
+
/** Trusted profile data, obtained from the owning player service; never client input. */
|
|
1342
|
+
declare interface QuestPlayer {
|
|
1343
|
+
readonly tenantId: string;
|
|
1344
|
+
readonly ownerId: string;
|
|
1345
|
+
readonly timezone: string;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
declare interface QuestPlayerSourceService {
|
|
1349
|
+
/** Complete bounded roster. Return over-limit as an error; do not truncate it silently. */
|
|
1350
|
+
readonly read: (input: {
|
|
1351
|
+
readonly limit: number;
|
|
1352
|
+
}) => Effect.Effect<readonly QuestPlayer[], ProgressionError>;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
declare interface QuestPool extends QuestPoolDefinition {
|
|
1356
|
+
readonly version: number;
|
|
1357
|
+
readonly rerolls: number;
|
|
1358
|
+
readonly weights: Readonly<Record<string, number>>;
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
declare interface QuestPoolDefinition {
|
|
1362
|
+
readonly id: string;
|
|
1363
|
+
readonly version?: number;
|
|
1364
|
+
readonly slots: number;
|
|
1365
|
+
readonly rerolls?: number;
|
|
1366
|
+
readonly refresh: {
|
|
1367
|
+
readonly cron: string;
|
|
1368
|
+
readonly timezone: string;
|
|
1369
|
+
};
|
|
1370
|
+
readonly quests: readonly QuestDefinition[];
|
|
1371
|
+
readonly weights?: Readonly<Record<string, number>>;
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
declare interface QuestProgressContext {
|
|
1375
|
+
readonly quest: QuestDefinition;
|
|
1376
|
+
readonly progress: readonly number[];
|
|
1377
|
+
readonly signal: QuestSignal;
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
declare type QuestProgressResolver = (context: QuestProgressContext) => readonly number[];
|
|
1381
|
+
|
|
1382
|
+
declare interface QuestReceipt {
|
|
1383
|
+
readonly operationId: string;
|
|
1384
|
+
readonly kind: 'assign' | 'record' | 'reroll';
|
|
1385
|
+
readonly assignmentIds: readonly string[];
|
|
1386
|
+
readonly completedIds: readonly string[];
|
|
1387
|
+
readonly rewardsQueued: number;
|
|
1388
|
+
readonly at: number;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
declare interface QuestRefreshOptions {
|
|
1392
|
+
readonly players: QuestPlayerSourceService;
|
|
1393
|
+
readonly intervalMs?: number;
|
|
1394
|
+
readonly maxPlayers?: number;
|
|
1395
|
+
readonly strategies?: {
|
|
1396
|
+
readonly questWindow?: QuestWindowResolver | undefined;
|
|
1397
|
+
readonly questSeed?: QuestSeedResolver;
|
|
1398
|
+
readonly version?: string;
|
|
1399
|
+
} | undefined;
|
|
1400
|
+
readonly service?: QuestRefreshService | undefined;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
declare interface QuestRefreshReport {
|
|
1404
|
+
readonly players: number;
|
|
1405
|
+
readonly assignments: number;
|
|
1406
|
+
readonly erased: number;
|
|
1407
|
+
readonly failures: readonly ProgressionError['code'][];
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
declare interface QuestRefreshService {
|
|
1411
|
+
readonly refreshOwner: (subject: Subject, player: QuestPlayer) => Effect.Effect<readonly QuestReceipt[], ProgressionError>;
|
|
1412
|
+
readonly refreshAll: (subject: Subject) => Effect.Effect<QuestRefreshReport, ProgressionError>;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
export declare const questRewardsTable: Table<"_voltro_prog_quest_rewards", FieldDefinitions<{
|
|
1416
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1417
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1418
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
1419
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1420
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
1421
|
+
readonly assignmentId: ColumnBuilder<string, "text", boolean>;
|
|
1422
|
+
readonly reward: ColumnBuilder<unknown, "json", boolean>;
|
|
1423
|
+
readonly state: ColumnBuilder<"pending" | "erased" | "delivered", "text", boolean>;
|
|
1424
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1425
|
+
readonly deliveredAt: ColumnBuilder<Date | null, "timestamp", boolean>;
|
|
1426
|
+
readonly deliveryIntent: ColumnBuilder<unknown, "json", boolean>;
|
|
1427
|
+
readonly deliveryDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
1428
|
+
readonly deliveryReceipt: ColumnBuilder<unknown, "json", boolean>;
|
|
1429
|
+
}>, true, never>;
|
|
1430
|
+
|
|
1431
|
+
declare type QuestScalar = string | number | boolean | null;
|
|
1432
|
+
|
|
1433
|
+
declare interface QuestSeedContext extends QuestWindowContext {
|
|
1434
|
+
readonly window: QuestWindow;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
declare type QuestSeedResolver = (input: QuestSeedContext) => number;
|
|
1438
|
+
|
|
1439
|
+
declare type QuestSelector = (context: QuestSelectorContext) => readonly string[];
|
|
1440
|
+
|
|
1441
|
+
declare interface QuestSelectorContext {
|
|
1442
|
+
readonly pool: QuestPool;
|
|
1443
|
+
readonly count: number;
|
|
1444
|
+
readonly seed: number;
|
|
1445
|
+
readonly excluded: readonly string[];
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
declare interface QuestService {
|
|
1449
|
+
readonly assign: (subject: Subject, input: AssignQuestsInput) => Effect.Effect<QuestReceipt, ProgressionError>;
|
|
1450
|
+
readonly record: (subject: Subject, input: RecordQuestInput) => Effect.Effect<QuestReceipt, ProgressionError>;
|
|
1451
|
+
readonly reroll: (subject: Subject, input: RerollQuestInput) => Effect.Effect<QuestReceipt, ProgressionError>;
|
|
1452
|
+
readonly mine: (subject: Subject) => Effect.Effect<readonly PlayerQuest[], ProgressionError>;
|
|
1453
|
+
readonly exportSubject: (target: PluginPrivacyTarget) => Effect.Effect<unknown, ProgressionError>;
|
|
1454
|
+
readonly eraseSubject: (target: PluginPrivacyTarget) => Effect.Effect<void, ProgressionError>;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
declare type QuestSignal = {
|
|
1458
|
+
readonly kind: 'stat';
|
|
1459
|
+
readonly stat: string;
|
|
1460
|
+
readonly delta: string;
|
|
1461
|
+
} | {
|
|
1462
|
+
readonly kind: 'event';
|
|
1463
|
+
readonly event: string;
|
|
1464
|
+
readonly data: Readonly<Record<string, QuestScalar>>;
|
|
1465
|
+
};
|
|
1466
|
+
|
|
1467
|
+
declare type QuestSignalInput = {
|
|
1468
|
+
readonly kind: 'stat';
|
|
1469
|
+
readonly stat: string;
|
|
1470
|
+
readonly delta: ProgressValue;
|
|
1471
|
+
} | {
|
|
1472
|
+
readonly kind: 'event';
|
|
1473
|
+
readonly event: string;
|
|
1474
|
+
readonly data?: Readonly<Record<string, QuestScalar>>;
|
|
1475
|
+
};
|
|
1476
|
+
|
|
1477
|
+
declare interface QuestSourceScope {
|
|
1478
|
+
readonly tenantId: string;
|
|
1479
|
+
readonly channel: string;
|
|
1480
|
+
readonly locale: string;
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
declare interface QuestSourceService {
|
|
1484
|
+
readonly read: (scope: QuestSourceScope) => Effect.Effect<{
|
|
1485
|
+
readonly revision: string;
|
|
1486
|
+
readonly pools: readonly QuestPool[];
|
|
1487
|
+
}, ProgressionError>;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
export declare const questsTable: Table<"_voltro_prog_quests", FieldDefinitions<{
|
|
1491
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1492
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1493
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
1494
|
+
readonly ownerKey: ColumnBuilder<string, "text", boolean>;
|
|
1495
|
+
readonly windowKey: ColumnBuilder<string, "text", boolean>;
|
|
1496
|
+
readonly poolId: ColumnBuilder<string, "text", boolean>;
|
|
1497
|
+
readonly windowId: ColumnBuilder<string, "text", boolean>;
|
|
1498
|
+
readonly slot: ColumnBuilder<number, "integer", boolean>;
|
|
1499
|
+
readonly generation: ColumnBuilder<number, "integer", boolean>;
|
|
1500
|
+
readonly questId: ColumnBuilder<string, "text", boolean>;
|
|
1501
|
+
readonly definition: ColumnBuilder<unknown, "json", boolean>;
|
|
1502
|
+
readonly progress: ColumnBuilder<unknown, "json", boolean>;
|
|
1503
|
+
readonly state: ColumnBuilder<"completed" | "active" | "rerolled", "text", boolean>;
|
|
1504
|
+
readonly assignedAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1505
|
+
readonly expiresAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1506
|
+
readonly completedAt: ColumnBuilder<Date | null, "timestamp", boolean>;
|
|
1507
|
+
}>, true, never>;
|
|
1508
|
+
|
|
1509
|
+
export declare interface QuestStoreOptions {
|
|
1510
|
+
readonly source: QuestSourceService;
|
|
1511
|
+
readonly channel: string;
|
|
1512
|
+
readonly locale: string;
|
|
1513
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
1514
|
+
readonly eventSources?: readonly string[] | undefined;
|
|
1515
|
+
readonly statSources?: readonly string[] | undefined;
|
|
1516
|
+
readonly maxWorkRows?: number | undefined;
|
|
1517
|
+
readonly now?: (() => number) | undefined;
|
|
1518
|
+
readonly strategies?: {
|
|
1519
|
+
readonly questSelector?: QuestSelector | undefined;
|
|
1520
|
+
readonly questProgressResolver?: QuestProgressResolver;
|
|
1521
|
+
readonly version?: string;
|
|
1522
|
+
} | undefined;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
export declare const questSubjectsTable: Table<"_voltro_prog_quest_subjects", FieldDefinitions<{
|
|
1526
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1527
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1528
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
1529
|
+
readonly erased: ColumnBuilder<boolean, "boolean", boolean>;
|
|
1530
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
1531
|
+
}>, true, never>;
|
|
1532
|
+
|
|
1533
|
+
export declare const questTables: readonly [ Table<"_voltro_prog_quest_definitions", FieldDefinitions<{
|
|
1534
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1535
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1536
|
+
readonly poolId: ColumnBuilder<string, "text", boolean>;
|
|
1537
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
1538
|
+
readonly config: ColumnBuilder<unknown, "json", boolean>;
|
|
1539
|
+
readonly rulesVersion: ColumnBuilder<string, "text", boolean>;
|
|
1540
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
1541
|
+
}>, true, never>, Table<"_voltro_prog_quest_subjects", FieldDefinitions<{
|
|
1542
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1543
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1544
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
1545
|
+
readonly erased: ColumnBuilder<boolean, "boolean", boolean>;
|
|
1546
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
1547
|
+
}>, true, never>, Table<"_voltro_prog_quest_windows", FieldDefinitions<{
|
|
1548
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1549
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1550
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
1551
|
+
readonly ownerKey: ColumnBuilder<string, "text", boolean>;
|
|
1552
|
+
readonly poolId: ColumnBuilder<string, "text", boolean>;
|
|
1553
|
+
readonly windowId: ColumnBuilder<string, "text", boolean>;
|
|
1554
|
+
readonly startsAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1555
|
+
readonly expiresAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1556
|
+
readonly timezone: ColumnBuilder<string, "text", boolean>;
|
|
1557
|
+
readonly seed: ColumnBuilder<number, "integer", boolean>;
|
|
1558
|
+
readonly rerollsUsed: ColumnBuilder<number, "integer", boolean>;
|
|
1559
|
+
readonly pool: ColumnBuilder<unknown, "json", boolean>;
|
|
1560
|
+
readonly sourceRevision: ColumnBuilder<string, "text", boolean>;
|
|
1561
|
+
readonly rulesVersion: ColumnBuilder<string, "text", boolean>;
|
|
1562
|
+
}>, true, never>, Table<"_voltro_prog_quests", FieldDefinitions<{
|
|
1563
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1564
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1565
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
1566
|
+
readonly ownerKey: ColumnBuilder<string, "text", boolean>;
|
|
1567
|
+
readonly windowKey: ColumnBuilder<string, "text", boolean>;
|
|
1568
|
+
readonly poolId: ColumnBuilder<string, "text", boolean>;
|
|
1569
|
+
readonly windowId: ColumnBuilder<string, "text", boolean>;
|
|
1570
|
+
readonly slot: ColumnBuilder<number, "integer", boolean>;
|
|
1571
|
+
readonly generation: ColumnBuilder<number, "integer", boolean>;
|
|
1572
|
+
readonly questId: ColumnBuilder<string, "text", boolean>;
|
|
1573
|
+
readonly definition: ColumnBuilder<unknown, "json", boolean>;
|
|
1574
|
+
readonly progress: ColumnBuilder<unknown, "json", boolean>;
|
|
1575
|
+
readonly state: ColumnBuilder<"completed" | "active" | "rerolled", "text", boolean>;
|
|
1576
|
+
readonly assignedAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1577
|
+
readonly expiresAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1578
|
+
readonly completedAt: ColumnBuilder<Date | null, "timestamp", boolean>;
|
|
1579
|
+
}>, true, never>, Table<"_voltro_prog_quest_operations", FieldDefinitions<{
|
|
1580
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1581
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1582
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1583
|
+
readonly state: ColumnBuilder<"pending" | "replayed" | "erased" | "committed", "text", boolean>;
|
|
1584
|
+
readonly linkedOperationId: ColumnBuilder<string | null, "text", boolean>;
|
|
1585
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
1586
|
+
readonly receipt: ColumnBuilder<unknown, "json", boolean>;
|
|
1587
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1588
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
1589
|
+
}>, true, never>, Table<"_voltro_prog_quest_origins", FieldDefinitions<{
|
|
1590
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1591
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1592
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1593
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
1594
|
+
readonly source: ColumnBuilder<string | null, "text", boolean>;
|
|
1595
|
+
readonly origin: ColumnBuilder<string | null, "text", boolean>;
|
|
1596
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
1597
|
+
}>, true, never>, Table<"_voltro_prog_quest_rewards", FieldDefinitions<{
|
|
1598
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1599
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1600
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
1601
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1602
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
1603
|
+
readonly assignmentId: ColumnBuilder<string, "text", boolean>;
|
|
1604
|
+
readonly reward: ColumnBuilder<unknown, "json", boolean>;
|
|
1605
|
+
readonly state: ColumnBuilder<"pending" | "erased" | "delivered", "text", boolean>;
|
|
1606
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1607
|
+
readonly deliveredAt: ColumnBuilder<Date | null, "timestamp", boolean>;
|
|
1608
|
+
readonly deliveryIntent: ColumnBuilder<unknown, "json", boolean>;
|
|
1609
|
+
readonly deliveryDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
1610
|
+
readonly deliveryReceipt: ColumnBuilder<unknown, "json", boolean>;
|
|
1611
|
+
}>, true, never>];
|
|
1612
|
+
|
|
1613
|
+
declare interface QuestWindow {
|
|
1614
|
+
readonly from: number;
|
|
1615
|
+
readonly until: number;
|
|
1616
|
+
readonly timezone: string;
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
declare interface QuestWindowContext {
|
|
1620
|
+
readonly pool: QuestPool;
|
|
1621
|
+
readonly player: QuestPlayer;
|
|
1622
|
+
readonly at: number;
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
declare type QuestWindowResolver = (input: QuestWindowContext) => QuestWindow;
|
|
1626
|
+
|
|
1627
|
+
export declare const questWindowsTable: Table<"_voltro_prog_quest_windows", FieldDefinitions<{
|
|
1628
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1629
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1630
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
1631
|
+
readonly ownerKey: ColumnBuilder<string, "text", boolean>;
|
|
1632
|
+
readonly poolId: ColumnBuilder<string, "text", boolean>;
|
|
1633
|
+
readonly windowId: ColumnBuilder<string, "text", boolean>;
|
|
1634
|
+
readonly startsAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1635
|
+
readonly expiresAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1636
|
+
readonly timezone: ColumnBuilder<string, "text", boolean>;
|
|
1637
|
+
readonly seed: ColumnBuilder<number, "integer", boolean>;
|
|
1638
|
+
readonly rerollsUsed: ColumnBuilder<number, "integer", boolean>;
|
|
1639
|
+
readonly pool: ColumnBuilder<unknown, "json", boolean>;
|
|
1640
|
+
readonly sourceRevision: ColumnBuilder<string, "text", boolean>;
|
|
1641
|
+
readonly rulesVersion: ColumnBuilder<string, "text", boolean>;
|
|
1642
|
+
}>, true, never>;
|
|
1643
|
+
|
|
1644
|
+
export declare interface RankAudit {
|
|
1645
|
+
readonly operations: number;
|
|
1646
|
+
readonly seasons: number;
|
|
1647
|
+
readonly rewardRows: number;
|
|
1648
|
+
readonly matches: boolean;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
declare interface RankCloseInput extends RankObserveInput {
|
|
1652
|
+
readonly tenantId: string;
|
|
1653
|
+
readonly ownerId: string;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
declare interface RankClosureDispatchInput {
|
|
1657
|
+
readonly limit?: number;
|
|
1658
|
+
readonly after?: string;
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
declare interface RankClosureDispatchResult {
|
|
1662
|
+
readonly scanned: number;
|
|
1663
|
+
readonly admitted: number;
|
|
1664
|
+
readonly failed: readonly string[];
|
|
1665
|
+
readonly next: string | null;
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
declare interface RankClosureOptions {
|
|
1669
|
+
readonly service?: RankClosureService | undefined;
|
|
1670
|
+
readonly now?: (() => number) | undefined;
|
|
1671
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
declare interface RankClosureReceipt {
|
|
1675
|
+
readonly unitId: string;
|
|
1676
|
+
readonly status: 'closed' | 'erased';
|
|
1677
|
+
readonly operationId: string | null;
|
|
1678
|
+
readonly rewardsQueued: number;
|
|
1679
|
+
readonly at: number;
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
declare interface RankClosureRequest {
|
|
1683
|
+
readonly unitId: string;
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
declare interface RankClosureService {
|
|
1687
|
+
readonly execute: (subject: Subject, input: RankClosureRequest) => Effect.Effect<RankClosureReceipt, ProgressionError>;
|
|
1688
|
+
readonly dispatch: (subject: Subject, input: RankClosureDispatchInput, start: (payload: RankClosureRequest) => Effect.Effect<WorkflowRunHandle, unknown>) => Effect.Effect<RankClosureDispatchResult, ProgressionError>;
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
export declare const rankClosureUnitsTable: Table<"_voltro_prog_rank_closure_units", FieldDefinitions<{
|
|
1692
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1693
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1694
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
1695
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1696
|
+
readonly seasonId: ColumnBuilder<string, "text", boolean>;
|
|
1697
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
1698
|
+
readonly stateId: ColumnBuilder<string, "text", boolean>;
|
|
1699
|
+
readonly until: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1700
|
+
readonly state: ColumnBuilder<"closed" | "open" | "erased", "text", boolean>;
|
|
1701
|
+
readonly receipt: ColumnBuilder<unknown, "json", boolean>;
|
|
1702
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1703
|
+
}>, true, never>;
|
|
1704
|
+
|
|
1705
|
+
declare interface RankContext {
|
|
1706
|
+
readonly ladder: RankLadder;
|
|
1707
|
+
readonly rating: RankRating;
|
|
1708
|
+
readonly at: number;
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
declare interface RankDecayDefinition {
|
|
1712
|
+
readonly afterDays: number;
|
|
1713
|
+
readonly perDay: number;
|
|
1714
|
+
readonly floor: number;
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
declare type RankDecayResolver = (input: RankGradeContext) => number;
|
|
1718
|
+
|
|
1719
|
+
export declare const rankDefinitionsTable: Table<"_voltro_prog_rank_definitions", FieldDefinitions<{
|
|
1720
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1721
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1722
|
+
readonly seasonId: ColumnBuilder<string, "text", boolean>;
|
|
1723
|
+
readonly config: ColumnBuilder<unknown, "json", boolean>;
|
|
1724
|
+
readonly rulesVersion: ColumnBuilder<string, "text", boolean>;
|
|
1725
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
1726
|
+
}>, true, never>;
|
|
1727
|
+
|
|
1728
|
+
declare interface RankGrade {
|
|
1729
|
+
readonly index: number;
|
|
1730
|
+
readonly tier: string;
|
|
1731
|
+
readonly tierIndex: number;
|
|
1732
|
+
readonly division: number;
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
declare interface RankGradeContext extends RankContext {
|
|
1736
|
+
readonly score: number;
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
declare type RankGradeResolver = (input: RankGradeContext) => RankGrade | null;
|
|
1740
|
+
|
|
1741
|
+
declare interface RankLadder {
|
|
1742
|
+
readonly id: string;
|
|
1743
|
+
readonly version: number;
|
|
1744
|
+
readonly rating: string;
|
|
1745
|
+
readonly tiers: readonly string[];
|
|
1746
|
+
readonly divisions: number;
|
|
1747
|
+
readonly thresholds: readonly number[];
|
|
1748
|
+
readonly placements: number;
|
|
1749
|
+
readonly confidence: number;
|
|
1750
|
+
readonly decay: RankDecayDefinition | null;
|
|
1751
|
+
readonly softReset: RankResetDefinition | null;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
declare interface RankLadderDefinition {
|
|
1755
|
+
readonly id?: string;
|
|
1756
|
+
readonly version?: number;
|
|
1757
|
+
readonly rating: string;
|
|
1758
|
+
readonly tiers: readonly string[];
|
|
1759
|
+
readonly divisions?: number;
|
|
1760
|
+
/** Ascending cutoffs for each boundary, lowest division to highest. No hidden balancing values. */
|
|
1761
|
+
readonly thresholds: readonly number[];
|
|
1762
|
+
readonly placements?: number;
|
|
1763
|
+
readonly confidence?: number;
|
|
1764
|
+
readonly decay?: RankDecayDefinition | null;
|
|
1765
|
+
readonly softReset?: RankResetDefinition | null;
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
export declare const rankLedgerTable: Table<"_voltro_prog_rank_ledger", FieldDefinitions<{
|
|
1769
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1770
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1771
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
1772
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1773
|
+
readonly seasonId: ColumnBuilder<string, "text", boolean>;
|
|
1774
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
1775
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
1776
|
+
readonly claimKey: ColumnBuilder<string, "text", boolean>;
|
|
1777
|
+
readonly intent: ColumnBuilder<unknown, "json", boolean>;
|
|
1778
|
+
readonly before: ColumnBuilder<unknown, "json", boolean>;
|
|
1779
|
+
readonly after: ColumnBuilder<unknown, "json", boolean>;
|
|
1780
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1781
|
+
}>, true, never>;
|
|
1782
|
+
|
|
1783
|
+
declare interface RankObserveInput {
|
|
1784
|
+
readonly seasonId: string;
|
|
1785
|
+
readonly requestId: string;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
export declare const rankOperationsTable: Table<"_voltro_prog_rank_operations", FieldDefinitions<{
|
|
1789
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1790
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1791
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1792
|
+
readonly state: ColumnBuilder<"replayed" | "erased" | "committed", "text", boolean>;
|
|
1793
|
+
readonly claimKey: ColumnBuilder<string, "text", boolean>;
|
|
1794
|
+
readonly linkedOperationId: ColumnBuilder<string | null, "text", boolean>;
|
|
1795
|
+
readonly intent: ColumnBuilder<unknown, "json", boolean>;
|
|
1796
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
1797
|
+
readonly receipt: ColumnBuilder<unknown, "json", boolean>;
|
|
1798
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1799
|
+
}>, true, never>;
|
|
1800
|
+
|
|
1801
|
+
declare interface RankRating {
|
|
1802
|
+
readonly pool: string;
|
|
1803
|
+
readonly state: RankRatingState;
|
|
1804
|
+
readonly games: number;
|
|
1805
|
+
readonly updatedAt: number | null;
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
declare interface RankRatingSourceService {
|
|
1809
|
+
readonly read: (subject: Subject, pool: string) => Effect.Effect<RankRating, ProgressionError>;
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
/** SQL Ratings remain the authority; this detached shape matches Ratings.myRating. */
|
|
1813
|
+
declare type RankRatingState = {
|
|
1814
|
+
readonly algorithm: 'elo';
|
|
1815
|
+
readonly rating: number;
|
|
1816
|
+
} | {
|
|
1817
|
+
readonly algorithm: 'openskill';
|
|
1818
|
+
readonly mu: number;
|
|
1819
|
+
readonly sigma: number;
|
|
1820
|
+
} | {
|
|
1821
|
+
readonly algorithm: 'glicko2';
|
|
1822
|
+
readonly rating: number;
|
|
1823
|
+
readonly deviation: number;
|
|
1824
|
+
readonly volatility: number;
|
|
1825
|
+
};
|
|
1826
|
+
|
|
1827
|
+
export declare interface RankReaderOptions {
|
|
1828
|
+
readonly ladders: readonly (RankLadderDefinition | RankLadder)[];
|
|
1829
|
+
readonly source: RankRatingSourceService;
|
|
1830
|
+
readonly strategies?: RankStrategies | undefined;
|
|
1831
|
+
readonly now?: (() => number) | undefined;
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
declare interface RankReaderService {
|
|
1835
|
+
readonly mine: (subject: Subject) => Effect.Effect<readonly PlayerRank[], ProgressionError>;
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
declare interface RankResetContext {
|
|
1839
|
+
readonly ladder: RankLadder;
|
|
1840
|
+
readonly score: number;
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
declare interface RankResetDefinition {
|
|
1844
|
+
readonly target: number;
|
|
1845
|
+
readonly retain: number;
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
export declare const rankRewardsTable: Table<"_voltro_prog_rank_rewards", FieldDefinitions<{
|
|
1849
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1850
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1851
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
1852
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1853
|
+
readonly seasonId: ColumnBuilder<string, "text", boolean>;
|
|
1854
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
1855
|
+
readonly reward: ColumnBuilder<unknown, "json", boolean>;
|
|
1856
|
+
readonly state: ColumnBuilder<"pending" | "erased" | "delivered", "text", boolean>;
|
|
1857
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1858
|
+
readonly deliveredAt: ColumnBuilder<Date | null, "timestamp", boolean>;
|
|
1859
|
+
readonly deliveryIntent: ColumnBuilder<unknown, "json", boolean>;
|
|
1860
|
+
readonly deliveryDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
1861
|
+
readonly deliveryReceipt: ColumnBuilder<unknown, "json", boolean>;
|
|
1862
|
+
}>, true, never>;
|
|
1863
|
+
|
|
1864
|
+
declare type RankScoreResolver = (input: RankContext) => number;
|
|
1865
|
+
|
|
1866
|
+
declare interface RankSeason {
|
|
1867
|
+
readonly id: string;
|
|
1868
|
+
readonly version: number;
|
|
1869
|
+
readonly ladderId: string;
|
|
1870
|
+
readonly from: number;
|
|
1871
|
+
readonly until: number;
|
|
1872
|
+
readonly rewards: readonly (readonly ProgressionReward[])[];
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
declare interface RankSeasonDefinition {
|
|
1876
|
+
readonly id: string;
|
|
1877
|
+
readonly version?: number;
|
|
1878
|
+
readonly ladderId: string;
|
|
1879
|
+
readonly from: number;
|
|
1880
|
+
readonly until: number;
|
|
1881
|
+
readonly rewards: readonly (readonly ProgressionReward[])[];
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
declare interface RankSeasonReceipt {
|
|
1885
|
+
readonly operationId: string;
|
|
1886
|
+
readonly kind: 'observe' | 'close';
|
|
1887
|
+
readonly after: RankSeasonState;
|
|
1888
|
+
readonly rewardsQueued: number;
|
|
1889
|
+
readonly at: number;
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
declare type RankSeasonReset = (input: RankResetContext) => number;
|
|
1893
|
+
|
|
1894
|
+
declare interface RankSeasonService {
|
|
1895
|
+
readonly observe: (subject: Subject, input: RankObserveInput) => Effect.Effect<RankSeasonReceipt, ProgressionError>;
|
|
1896
|
+
readonly close: (subject: Subject, input: RankCloseInput) => Effect.Effect<RankSeasonReceipt, ProgressionError>;
|
|
1897
|
+
readonly mine: (subject: Subject) => Effect.Effect<readonly RankSeasonState[], ProgressionError>;
|
|
1898
|
+
readonly exportSubject: (target: PluginPrivacyTarget) => Effect.Effect<unknown, ProgressionError>;
|
|
1899
|
+
readonly eraseSubject: (target: PluginPrivacyTarget) => Effect.Effect<void, ProgressionError>;
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
declare interface RankSeasonState {
|
|
1903
|
+
readonly seasonId: string;
|
|
1904
|
+
readonly version: number;
|
|
1905
|
+
readonly ladderId: string;
|
|
1906
|
+
readonly observations: number;
|
|
1907
|
+
readonly last: PlayerRank | null;
|
|
1908
|
+
readonly highest: RankGrade | null;
|
|
1909
|
+
readonly closedAt: number | null;
|
|
1910
|
+
readonly resetScore: number | null;
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1913
|
+
export declare interface RankSqlService extends RankSeasonService {
|
|
1914
|
+
readonly auditRanks: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<RankAudit, ProgressionError>;
|
|
1915
|
+
readonly rebuildRanks: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<RankAudit, ProgressionError>;
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
export declare const rankStatesTable: Table<"_voltro_prog_rank", FieldDefinitions<{
|
|
1919
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1920
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1921
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
1922
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1923
|
+
readonly seasonId: ColumnBuilder<string, "text", boolean>;
|
|
1924
|
+
readonly state: ColumnBuilder<unknown, "json", boolean>;
|
|
1925
|
+
readonly updatedAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1926
|
+
}>, true, never>;
|
|
1927
|
+
|
|
1928
|
+
export declare interface RankStoreOptions {
|
|
1929
|
+
readonly ladders: readonly (RankLadderDefinition | RankLadder)[];
|
|
1930
|
+
readonly seasons: readonly (RankSeasonDefinition | RankSeason)[];
|
|
1931
|
+
readonly source: RankRatingSourceService;
|
|
1932
|
+
readonly strategies?: RankStrategies | undefined;
|
|
1933
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
1934
|
+
readonly maxHistoryRows?: number | undefined;
|
|
1935
|
+
readonly maxPendingRewards?: number | undefined;
|
|
1936
|
+
readonly now?: (() => number) | undefined;
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1939
|
+
declare interface RankStrategies {
|
|
1940
|
+
readonly version?: string;
|
|
1941
|
+
readonly score?: RankScoreResolver;
|
|
1942
|
+
readonly decay?: RankDecayResolver;
|
|
1943
|
+
readonly grade?: RankGradeResolver;
|
|
1944
|
+
readonly seasonReset?: RankSeasonReset;
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
export declare const rankSubjectsTable: Table<"_voltro_prog_rank_subjects", FieldDefinitions<{
|
|
1948
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1949
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1950
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
1951
|
+
readonly erased: ColumnBuilder<boolean, "boolean", boolean>;
|
|
1952
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
1953
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
1954
|
+
}>, true, never>;
|
|
1955
|
+
|
|
1956
|
+
export declare const rankTables: readonly [ Table<"_voltro_prog_rank_definitions", FieldDefinitions<{
|
|
1957
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1958
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1959
|
+
readonly seasonId: ColumnBuilder<string, "text", boolean>;
|
|
1960
|
+
readonly config: ColumnBuilder<unknown, "json", boolean>;
|
|
1961
|
+
readonly rulesVersion: ColumnBuilder<string, "text", boolean>;
|
|
1962
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
1963
|
+
}>, true, never>, Table<"_voltro_prog_rank_subjects", FieldDefinitions<{
|
|
1964
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1965
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1966
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
1967
|
+
readonly erased: ColumnBuilder<boolean, "boolean", boolean>;
|
|
1968
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
1969
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
1970
|
+
}>, true, never>, Table<"_voltro_prog_rank", FieldDefinitions<{
|
|
1971
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1972
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1973
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
1974
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1975
|
+
readonly seasonId: ColumnBuilder<string, "text", boolean>;
|
|
1976
|
+
readonly state: ColumnBuilder<unknown, "json", boolean>;
|
|
1977
|
+
readonly updatedAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1978
|
+
}>, true, never>, Table<"_voltro_prog_rank_ledger", FieldDefinitions<{
|
|
1979
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1980
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1981
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
1982
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1983
|
+
readonly seasonId: ColumnBuilder<string, "text", boolean>;
|
|
1984
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
1985
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
1986
|
+
readonly claimKey: ColumnBuilder<string, "text", boolean>;
|
|
1987
|
+
readonly intent: ColumnBuilder<unknown, "json", boolean>;
|
|
1988
|
+
readonly before: ColumnBuilder<unknown, "json", boolean>;
|
|
1989
|
+
readonly after: ColumnBuilder<unknown, "json", boolean>;
|
|
1990
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
1991
|
+
}>, true, never>, Table<"_voltro_prog_rank_operations", FieldDefinitions<{
|
|
1992
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
1993
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
1994
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
1995
|
+
readonly state: ColumnBuilder<"replayed" | "erased" | "committed", "text", boolean>;
|
|
1996
|
+
readonly claimKey: ColumnBuilder<string, "text", boolean>;
|
|
1997
|
+
readonly linkedOperationId: ColumnBuilder<string | null, "text", boolean>;
|
|
1998
|
+
readonly intent: ColumnBuilder<unknown, "json", boolean>;
|
|
1999
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
2000
|
+
readonly receipt: ColumnBuilder<unknown, "json", boolean>;
|
|
2001
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
2002
|
+
}>, true, never>, Table<"_voltro_prog_rank_rewards", FieldDefinitions<{
|
|
2003
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2004
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2005
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
2006
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
2007
|
+
readonly seasonId: ColumnBuilder<string, "text", boolean>;
|
|
2008
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
2009
|
+
readonly reward: ColumnBuilder<unknown, "json", boolean>;
|
|
2010
|
+
readonly state: ColumnBuilder<"pending" | "erased" | "delivered", "text", boolean>;
|
|
2011
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
2012
|
+
readonly deliveredAt: ColumnBuilder<Date | null, "timestamp", boolean>;
|
|
2013
|
+
readonly deliveryIntent: ColumnBuilder<unknown, "json", boolean>;
|
|
2014
|
+
readonly deliveryDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
2015
|
+
readonly deliveryReceipt: ColumnBuilder<unknown, "json", boolean>;
|
|
2016
|
+
}>, true, never>, Table<"_voltro_prog_rank_closure_units", FieldDefinitions<{
|
|
2017
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2018
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2019
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
2020
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
2021
|
+
readonly seasonId: ColumnBuilder<string, "text", boolean>;
|
|
2022
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
2023
|
+
readonly stateId: ColumnBuilder<string, "text", boolean>;
|
|
2024
|
+
readonly until: ColumnBuilder<Date, "timestamp", boolean>;
|
|
2025
|
+
readonly state: ColumnBuilder<"closed" | "open" | "erased", "text", boolean>;
|
|
2026
|
+
readonly receipt: ColumnBuilder<unknown, "json", boolean>;
|
|
2027
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
2028
|
+
}>, true, never>];
|
|
2029
|
+
|
|
2030
|
+
/** Structural adapter to the actual Leaderboards SQL myRating service, with no copied storage or algorithm. */
|
|
2031
|
+
export declare const ratingSourceFromLeaderboards: <E>(service: {
|
|
2032
|
+
readonly myRating: (subject: Subject, pool: string) => Effect.Effect<RankRating, E>;
|
|
2033
|
+
}) => RankRatingSourceService;
|
|
2034
|
+
|
|
2035
|
+
declare interface RecordQuestInput {
|
|
2036
|
+
readonly tenantId: string;
|
|
2037
|
+
readonly ownerId: string;
|
|
2038
|
+
readonly poolId: string;
|
|
2039
|
+
readonly windowId: string;
|
|
2040
|
+
readonly requestId: string;
|
|
2041
|
+
readonly source: string;
|
|
2042
|
+
readonly origin: string;
|
|
2043
|
+
readonly signal: QuestSignalInput;
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
declare interface RegenResource {
|
|
2047
|
+
readonly id: string;
|
|
2048
|
+
readonly version: number;
|
|
2049
|
+
readonly max: string;
|
|
2050
|
+
readonly initial: string;
|
|
2051
|
+
readonly regenPer: string;
|
|
2052
|
+
readonly regenAmount: string;
|
|
2053
|
+
readonly regenEveryMs: number;
|
|
2054
|
+
readonly refillOffer?: string;
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
declare interface RegenResourceDefinition {
|
|
2058
|
+
readonly id: string;
|
|
2059
|
+
readonly version?: number;
|
|
2060
|
+
readonly max: ProgressValue;
|
|
2061
|
+
readonly initial?: ProgressValue;
|
|
2062
|
+
readonly regenPer: string;
|
|
2063
|
+
readonly regenAmount?: ProgressValue;
|
|
2064
|
+
readonly refillOffer?: string;
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
declare interface RegenResourceService {
|
|
2068
|
+
readonly initialize: (subject: Subject, input: InitializeResourceInput) => Effect.Effect<ResourceReceipt, ProgressionError>;
|
|
2069
|
+
readonly consume: (subject: Subject, input: ResourceChangeInput) => Effect.Effect<ResourceReceipt, ProgressionError>;
|
|
2070
|
+
readonly grant: (subject: Subject, input: ResourceChangeInput) => Effect.Effect<ResourceReceipt, ProgressionError>;
|
|
2071
|
+
readonly mine: (subject: Subject) => Effect.Effect<readonly PlayerResource[], ProgressionError>;
|
|
2072
|
+
readonly exportSubject: (target: PluginPrivacyTarget) => Effect.Effect<unknown, ProgressionError>;
|
|
2073
|
+
readonly eraseSubject: (target: PluginPrivacyTarget) => Effect.Effect<void, ProgressionError>;
|
|
2074
|
+
}
|
|
2075
|
+
|
|
2076
|
+
declare interface RerollQuestInput {
|
|
2077
|
+
readonly poolId: string;
|
|
2078
|
+
readonly windowId: string;
|
|
2079
|
+
readonly assignmentId: string;
|
|
2080
|
+
readonly requestId: string;
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
export declare const resolveAchievementOptions: (input: AchievementStoreOptions) => Readonly<{
|
|
2084
|
+
definitions: readonly Achievement[];
|
|
2085
|
+
source: AchievementStatSourceService;
|
|
2086
|
+
allowedServices: readonly string[];
|
|
2087
|
+
maxHistoryRows: number;
|
|
2088
|
+
maxPendingRewards: number;
|
|
2089
|
+
now: () => number;
|
|
2090
|
+
strategies: Readonly<{
|
|
2091
|
+
achievementEvaluator: AchievementEvaluator;
|
|
2092
|
+
version: string;
|
|
2093
|
+
}>;
|
|
2094
|
+
}>;
|
|
2095
|
+
|
|
2096
|
+
export declare const resolveDailyOptions: (input: DailyStoreOptions) => Readonly<{
|
|
2097
|
+
calendars: readonly LoginCalendar[];
|
|
2098
|
+
profileSource: DailyProfileSourceService;
|
|
2099
|
+
now: () => number;
|
|
2100
|
+
maxHistoryRows: number;
|
|
2101
|
+
allowedServices: readonly string[];
|
|
2102
|
+
strategies: Readonly<{
|
|
2103
|
+
claimPolicy: DailyClaimPolicy;
|
|
2104
|
+
version: string;
|
|
2105
|
+
}>;
|
|
2106
|
+
}>;
|
|
2107
|
+
|
|
2108
|
+
export declare const resolvePassOptions: (input: PassStoreOptions) => Readonly<{
|
|
2109
|
+
definitions: readonly SeasonPass[];
|
|
2110
|
+
allowedServices: readonly string[];
|
|
2111
|
+
now: () => number;
|
|
2112
|
+
maxHistoryRows: number;
|
|
2113
|
+
maxPendingRewards: number;
|
|
2114
|
+
strategies: Readonly<{
|
|
2115
|
+
passCatchUp: PassCatchUp;
|
|
2116
|
+
version: string;
|
|
2117
|
+
}>;
|
|
2118
|
+
}>;
|
|
2119
|
+
|
|
2120
|
+
export declare const resolveProgressionOptions: (input: ProgressionStoreOptions) => Readonly<{
|
|
2121
|
+
tracks: readonly ProgressionTrack[];
|
|
2122
|
+
stats: readonly ProgressionStat[];
|
|
2123
|
+
statSources: readonly string[];
|
|
2124
|
+
allowedServices: readonly string[];
|
|
2125
|
+
maxHistoryRows: number;
|
|
2126
|
+
maxPendingRewards: number;
|
|
2127
|
+
now: () => number;
|
|
2128
|
+
strategies: Readonly<{
|
|
2129
|
+
xpCurve: XpCurve;
|
|
2130
|
+
rewardResolver: RewardResolver;
|
|
2131
|
+
version: string;
|
|
2132
|
+
}>;
|
|
2133
|
+
}>;
|
|
2134
|
+
|
|
2135
|
+
export declare const resolveQuestOptions: (input: QuestStoreOptions) => Readonly<{
|
|
2136
|
+
source: QuestSourceService;
|
|
2137
|
+
channel: string;
|
|
2138
|
+
locale: string;
|
|
2139
|
+
allowedServices: readonly string[];
|
|
2140
|
+
eventSources: readonly string[];
|
|
2141
|
+
statSources: readonly string[];
|
|
2142
|
+
maxWorkRows: number;
|
|
2143
|
+
now: () => number;
|
|
2144
|
+
strategies: Readonly<{
|
|
2145
|
+
questSelector: QuestSelector;
|
|
2146
|
+
questProgressResolver: QuestProgressResolver;
|
|
2147
|
+
version: string;
|
|
2148
|
+
}>;
|
|
2149
|
+
}>;
|
|
2150
|
+
|
|
2151
|
+
export declare const resolveQuestRefreshOptions: (input: QuestRefreshOptions) => Readonly<{
|
|
2152
|
+
players: QuestRefreshOptions["players"];
|
|
2153
|
+
intervalMs: number;
|
|
2154
|
+
maxPlayers: number;
|
|
2155
|
+
strategies: Readonly<{
|
|
2156
|
+
questWindow: QuestWindowResolver;
|
|
2157
|
+
questSeed: QuestSeedResolver;
|
|
2158
|
+
version: string;
|
|
2159
|
+
}>;
|
|
2160
|
+
service: QuestRefreshService | undefined;
|
|
2161
|
+
}>;
|
|
2162
|
+
|
|
2163
|
+
export declare const resolveRankClosureOptions: (input?: RankClosureOptions) => Readonly<{
|
|
2164
|
+
service: Readonly<{
|
|
2165
|
+
execute: (subject: Subject, input: RankClosureRequest) => Effect.Effect<RankClosureReceipt, ProgressionError>;
|
|
2166
|
+
dispatch: (subject: Subject, input: RankClosureDispatchInput, start: (payload: RankClosureRequest) => Effect.Effect< WorkflowRunHandle, unknown>) => Effect.Effect< RankClosureDispatchResult, ProgressionError>;
|
|
2167
|
+
}> | undefined;
|
|
2168
|
+
now: () => number;
|
|
2169
|
+
allowedServices: readonly string[];
|
|
2170
|
+
}>;
|
|
2171
|
+
|
|
2172
|
+
export declare const resolveRankStoreOptions: (input: RankStoreOptions) => Readonly<{
|
|
2173
|
+
ladders: readonly RankLadder[];
|
|
2174
|
+
seasons: readonly RankSeason[];
|
|
2175
|
+
source: Readonly<{
|
|
2176
|
+
read: (subject: Subject, pool: string) => Effect.Effect<RankRating, ProgressionError>;
|
|
2177
|
+
}>;
|
|
2178
|
+
strategies: Readonly<{
|
|
2179
|
+
version: string;
|
|
2180
|
+
score: RankScoreResolver;
|
|
2181
|
+
decay: RankDecayResolver;
|
|
2182
|
+
grade: RankGradeResolver;
|
|
2183
|
+
seasonReset: RankSeasonReset;
|
|
2184
|
+
}>;
|
|
2185
|
+
allowedServices: readonly string[];
|
|
2186
|
+
now: () => number;
|
|
2187
|
+
maxHistoryRows: number;
|
|
2188
|
+
maxPendingRewards: number;
|
|
2189
|
+
}>;
|
|
2190
|
+
|
|
2191
|
+
export declare const resolveResourceOptions: (input: ResourceStoreOptions) => Readonly<{
|
|
2192
|
+
definitions: readonly RegenResource[];
|
|
2193
|
+
sources: readonly string[];
|
|
2194
|
+
allowedServices: readonly string[];
|
|
2195
|
+
maxHistoryRows: number;
|
|
2196
|
+
now: () => number;
|
|
2197
|
+
strategies: Readonly<{
|
|
2198
|
+
regen: ResourceRegenResolver;
|
|
2199
|
+
version: string;
|
|
2200
|
+
}>;
|
|
2201
|
+
}>;
|
|
2202
|
+
|
|
2203
|
+
export declare const resolveRewardDeliveryOptions: (input: RewardDeliveryOptions) => Readonly<{
|
|
2204
|
+
systemAccount: string;
|
|
2205
|
+
version: string;
|
|
2206
|
+
economy: EconomyService | undefined;
|
|
2207
|
+
inventory: InventoryService | undefined;
|
|
2208
|
+
progression: ProgressionService | undefined;
|
|
2209
|
+
service: RewardDeliveryService | undefined;
|
|
2210
|
+
allowedServices: readonly string[];
|
|
2211
|
+
now: () => number;
|
|
2212
|
+
}>;
|
|
2213
|
+
|
|
2214
|
+
export declare const resolveTutorialOptions: (input: TutorialStoreOptions) => Readonly<{
|
|
2215
|
+
definitions: readonly Tutorial[];
|
|
2216
|
+
eventSources: readonly string[];
|
|
2217
|
+
allowedServices: readonly string[];
|
|
2218
|
+
now: () => number;
|
|
2219
|
+
verifier: TutorialVerifierService | undefined;
|
|
2220
|
+
maxHistoryRows: number;
|
|
2221
|
+
maxPendingRewards: number;
|
|
2222
|
+
strategies: Readonly<{
|
|
2223
|
+
stepPolicy: TutorialStepPolicy;
|
|
2224
|
+
version: string;
|
|
2225
|
+
}>;
|
|
2226
|
+
}>;
|
|
2227
|
+
|
|
2228
|
+
export declare interface ResourceAudit {
|
|
2229
|
+
readonly acceptedOperations: number;
|
|
2230
|
+
readonly resources: number;
|
|
2231
|
+
readonly matches: boolean;
|
|
2232
|
+
readonly at: number;
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2235
|
+
declare interface ResourceChangeInput {
|
|
2236
|
+
readonly tenantId: string;
|
|
2237
|
+
readonly ownerId: string;
|
|
2238
|
+
readonly resourceId: string;
|
|
2239
|
+
readonly requestId: string;
|
|
2240
|
+
readonly source: string;
|
|
2241
|
+
readonly origin: string;
|
|
2242
|
+
readonly amount: ProgressValue;
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
export declare const resourceDefinitionsTable: Table<"_voltro_prog_resource_definitions", FieldDefinitions<{
|
|
2246
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2247
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2248
|
+
readonly resourceId: ColumnBuilder<string, "text", boolean>;
|
|
2249
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
2250
|
+
readonly config: ColumnBuilder<unknown, "json", boolean>;
|
|
2251
|
+
readonly rulesVersion: ColumnBuilder<string, "text", boolean>;
|
|
2252
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
2253
|
+
}>, true, "voltro_prog_resource_definitions_version_idx">;
|
|
2254
|
+
|
|
2255
|
+
export declare const resourceMovementsTable: Table<"_voltro_prog_resource_movements", FieldDefinitions<{
|
|
2256
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2257
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2258
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
2259
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
2260
|
+
readonly resourceId: ColumnBuilder<string, "text", boolean>;
|
|
2261
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
2262
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
2263
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
2264
|
+
readonly kind: ColumnBuilder<"grant" | "consume" | "initialize", "text", boolean>;
|
|
2265
|
+
readonly amount: ColumnBuilder<string, "bigint", boolean>;
|
|
2266
|
+
readonly regenerated: ColumnBuilder<string, "bigint", boolean>;
|
|
2267
|
+
readonly before: ColumnBuilder<unknown, "json", boolean>;
|
|
2268
|
+
readonly after: ColumnBuilder<unknown, "json", boolean>;
|
|
2269
|
+
readonly source: ColumnBuilder<string | null, "text", boolean>;
|
|
2270
|
+
readonly origin: ColumnBuilder<string | null, "text", boolean>;
|
|
2271
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
2272
|
+
}>, true, "voltro_prog_resource_movements_owner_idx">;
|
|
2273
|
+
|
|
2274
|
+
export declare const resourceOperationsTable: Table<"_voltro_prog_resource_operations", FieldDefinitions<{
|
|
2275
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2276
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2277
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
2278
|
+
readonly state: ColumnBuilder<"replayed" | "erased" | "committed", "text", boolean>;
|
|
2279
|
+
readonly linkedOperationId: ColumnBuilder<string | null, "text", boolean>;
|
|
2280
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
2281
|
+
readonly receipt: ColumnBuilder<unknown, "json", boolean>;
|
|
2282
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
2283
|
+
}>, true, never>;
|
|
2284
|
+
|
|
2285
|
+
export declare const resourceOriginsTable: Table<"_voltro_prog_resource_origins", FieldDefinitions<{
|
|
2286
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2287
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2288
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
2289
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
2290
|
+
readonly source: ColumnBuilder<string | null, "text", boolean>;
|
|
2291
|
+
readonly origin: ColumnBuilder<string | null, "text", boolean>;
|
|
2292
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
2293
|
+
}>, true, never>;
|
|
2294
|
+
|
|
2295
|
+
declare interface ResourceReceipt {
|
|
2296
|
+
readonly operationId: string;
|
|
2297
|
+
readonly kind: 'initialize' | 'consume' | 'grant';
|
|
2298
|
+
readonly resourceId: string;
|
|
2299
|
+
readonly amount: string;
|
|
2300
|
+
readonly regenerated: string;
|
|
2301
|
+
readonly after: ResourceState;
|
|
2302
|
+
readonly at: number;
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
declare interface ResourceRegenContext {
|
|
2306
|
+
readonly resource: RegenResource;
|
|
2307
|
+
readonly state: ResourceState;
|
|
2308
|
+
readonly at: number;
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
declare type ResourceRegenResolver = (input: ResourceRegenContext) => ResourceState;
|
|
2312
|
+
|
|
2313
|
+
export declare interface ResourceSqlService extends RegenResourceService {
|
|
2314
|
+
readonly auditResources: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<ResourceAudit, ProgressionError>;
|
|
2315
|
+
readonly rebuildResources: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<ResourceAudit, ProgressionError>;
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
export declare const resourcesTable: Table<"_voltro_prog_resources", FieldDefinitions<{
|
|
2319
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2320
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2321
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
2322
|
+
readonly resourceId: ColumnBuilder<string, "text", boolean>;
|
|
2323
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
2324
|
+
readonly value: ColumnBuilder<string, "bigint", boolean>;
|
|
2325
|
+
readonly anchorAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
2326
|
+
}>, true, never>;
|
|
2327
|
+
|
|
2328
|
+
declare interface ResourceState {
|
|
2329
|
+
readonly value: string;
|
|
2330
|
+
readonly anchorAt: number;
|
|
2331
|
+
}
|
|
2332
|
+
|
|
2333
|
+
export declare interface ResourceStoreOptions {
|
|
2334
|
+
readonly definitions: readonly RegenResourceDefinition[];
|
|
2335
|
+
readonly sources: readonly string[];
|
|
2336
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
2337
|
+
readonly maxHistoryRows?: number | undefined;
|
|
2338
|
+
readonly now?: (() => number) | undefined;
|
|
2339
|
+
readonly strategies?: {
|
|
2340
|
+
readonly regen?: ResourceRegenResolver | undefined;
|
|
2341
|
+
readonly version?: string;
|
|
2342
|
+
} | undefined;
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2345
|
+
export declare const resourceSubjectsTable: Table<"_voltro_prog_resource_subjects", FieldDefinitions<{
|
|
2346
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2347
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2348
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
2349
|
+
readonly erased: ColumnBuilder<boolean, "boolean", boolean>;
|
|
2350
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
2351
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
2352
|
+
}>, true, never>;
|
|
2353
|
+
|
|
2354
|
+
export declare const resourceTables: readonly [ Table<"_voltro_prog_resource_definitions", FieldDefinitions<{
|
|
2355
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2356
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2357
|
+
readonly resourceId: ColumnBuilder<string, "text", boolean>;
|
|
2358
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
2359
|
+
readonly config: ColumnBuilder<unknown, "json", boolean>;
|
|
2360
|
+
readonly rulesVersion: ColumnBuilder<string, "text", boolean>;
|
|
2361
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
2362
|
+
}>, true, "voltro_prog_resource_definitions_version_idx">, Table<"_voltro_prog_resource_subjects", FieldDefinitions<{
|
|
2363
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2364
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2365
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
2366
|
+
readonly erased: ColumnBuilder<boolean, "boolean", boolean>;
|
|
2367
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
2368
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
2369
|
+
}>, true, never>, Table<"_voltro_prog_resources", FieldDefinitions<{
|
|
2370
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2371
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2372
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
2373
|
+
readonly resourceId: ColumnBuilder<string, "text", boolean>;
|
|
2374
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
2375
|
+
readonly value: ColumnBuilder<string, "bigint", boolean>;
|
|
2376
|
+
readonly anchorAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
2377
|
+
}>, true, never>, Table<"_voltro_prog_resource_movements", FieldDefinitions<{
|
|
2378
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2379
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2380
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
2381
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
2382
|
+
readonly resourceId: ColumnBuilder<string, "text", boolean>;
|
|
2383
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
2384
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
2385
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
2386
|
+
readonly kind: ColumnBuilder<"grant" | "consume" | "initialize", "text", boolean>;
|
|
2387
|
+
readonly amount: ColumnBuilder<string, "bigint", boolean>;
|
|
2388
|
+
readonly regenerated: ColumnBuilder<string, "bigint", boolean>;
|
|
2389
|
+
readonly before: ColumnBuilder<unknown, "json", boolean>;
|
|
2390
|
+
readonly after: ColumnBuilder<unknown, "json", boolean>;
|
|
2391
|
+
readonly source: ColumnBuilder<string | null, "text", boolean>;
|
|
2392
|
+
readonly origin: ColumnBuilder<string | null, "text", boolean>;
|
|
2393
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
2394
|
+
}>, true, "voltro_prog_resource_movements_owner_idx">, Table<"_voltro_prog_resource_operations", FieldDefinitions<{
|
|
2395
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2396
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2397
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
2398
|
+
readonly state: ColumnBuilder<"replayed" | "erased" | "committed", "text", boolean>;
|
|
2399
|
+
readonly linkedOperationId: ColumnBuilder<string | null, "text", boolean>;
|
|
2400
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
2401
|
+
readonly receipt: ColumnBuilder<unknown, "json", boolean>;
|
|
2402
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
2403
|
+
}>, true, never>, Table<"_voltro_prog_resource_origins", FieldDefinitions<{
|
|
2404
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2405
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2406
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
2407
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
2408
|
+
readonly source: ColumnBuilder<string | null, "text", boolean>;
|
|
2409
|
+
readonly origin: ColumnBuilder<string | null, "text", boolean>;
|
|
2410
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
2411
|
+
}>, true, never>];
|
|
2412
|
+
|
|
2413
|
+
declare interface RewardDeliveryOptions {
|
|
2414
|
+
/** An explicit app-owned funding account; never a balance/price/credential. */
|
|
2415
|
+
readonly systemAccount: string;
|
|
2416
|
+
readonly economy?: EconomyService | undefined;
|
|
2417
|
+
readonly inventory?: InventoryService | undefined;
|
|
2418
|
+
readonly progression?: ProgressionService | undefined;
|
|
2419
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
2420
|
+
readonly now?: (() => number) | undefined;
|
|
2421
|
+
readonly version?: string;
|
|
2422
|
+
/** Full replacement must own queue/privacy semantics of its source ports. */
|
|
2423
|
+
readonly service?: RewardDeliveryService | undefined;
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
declare interface RewardDeliveryReceipt extends RewardDeliveryRequest {
|
|
2427
|
+
readonly status: 'delivered' | 'erased';
|
|
2428
|
+
readonly outputKind: 'currency' | 'item' | 'xp' | null;
|
|
2429
|
+
readonly externalOperationId: string | null;
|
|
2430
|
+
readonly at: number;
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
declare interface RewardDeliveryRequest {
|
|
2434
|
+
readonly kind: RewardSourceKind;
|
|
2435
|
+
readonly rewardId: string;
|
|
2436
|
+
}
|
|
2437
|
+
|
|
2438
|
+
declare interface RewardDeliveryService {
|
|
2439
|
+
readonly execute: (subject: Subject, input: RewardDeliveryRequest) => Effect.Effect<RewardDeliveryReceipt, ProgressionError>;
|
|
2440
|
+
readonly dispatch: (subject: Subject, input: RewardDispatchInput, start: (payload: RewardDeliveryRequest) => Promise<WorkflowRunHandle>) => Effect.Effect<RewardDispatchResult, ProgressionError>;
|
|
2441
|
+
}
|
|
2442
|
+
|
|
2443
|
+
declare interface RewardDispatchCursor extends RewardDeliveryRequest {
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2446
|
+
declare interface RewardDispatchInput {
|
|
2447
|
+
readonly limit: number;
|
|
2448
|
+
readonly after?: RewardDispatchCursor;
|
|
2449
|
+
}
|
|
2450
|
+
|
|
2451
|
+
declare interface RewardDispatchResult {
|
|
2452
|
+
readonly submitted: readonly {
|
|
2453
|
+
readonly request: RewardDeliveryRequest;
|
|
2454
|
+
readonly status: WorkflowRunHandle['status'];
|
|
2455
|
+
}[];
|
|
2456
|
+
readonly failed: readonly RewardDeliveryRequest[];
|
|
2457
|
+
readonly next: RewardDispatchCursor | null;
|
|
2458
|
+
}
|
|
2459
|
+
|
|
2460
|
+
declare type RewardResolver = (context: RewardResolverContext) => readonly LevelReward[];
|
|
2461
|
+
|
|
2462
|
+
declare interface RewardResolverContext {
|
|
2463
|
+
readonly track: ProgressionTrack;
|
|
2464
|
+
readonly fromLevel: number;
|
|
2465
|
+
readonly toLevel: number;
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
declare type RewardSourceKind = 'level' | 'quest' | 'achievement' | 'daily' | 'pass' | 'tutorial' | 'rank';
|
|
2469
|
+
|
|
2470
|
+
declare interface SeasonPass {
|
|
2471
|
+
readonly id: string;
|
|
2472
|
+
readonly version: number;
|
|
2473
|
+
readonly from: number;
|
|
2474
|
+
readonly until: number;
|
|
2475
|
+
readonly tiers: number;
|
|
2476
|
+
readonly xpPerTier: string;
|
|
2477
|
+
readonly tracks: {
|
|
2478
|
+
readonly free: readonly (readonly ProgressionReward[])[];
|
|
2479
|
+
readonly premium: readonly (readonly ProgressionReward[])[];
|
|
2480
|
+
};
|
|
2481
|
+
readonly premiumOffer: string | null;
|
|
2482
|
+
readonly sources: readonly string[];
|
|
2483
|
+
readonly catchUp: {
|
|
2484
|
+
readonly xpBoostAfterDay: number;
|
|
2485
|
+
readonly multiplier: number;
|
|
2486
|
+
} | null;
|
|
2487
|
+
readonly autoClaim: boolean;
|
|
2488
|
+
readonly expireUnclaimed: 'mail' | 'forfeit';
|
|
2489
|
+
}
|
|
2490
|
+
|
|
2491
|
+
declare interface SeasonPassDefinition {
|
|
2492
|
+
readonly id: string;
|
|
2493
|
+
readonly version?: number;
|
|
2494
|
+
readonly from: number;
|
|
2495
|
+
readonly until: number;
|
|
2496
|
+
readonly tiers: number;
|
|
2497
|
+
readonly xpPerTier: ProgressValue;
|
|
2498
|
+
readonly tracks: {
|
|
2499
|
+
readonly free: readonly (readonly ProgressionReward[])[];
|
|
2500
|
+
readonly premium: readonly (readonly ProgressionReward[])[];
|
|
2501
|
+
};
|
|
2502
|
+
readonly premiumOffer?: string;
|
|
2503
|
+
readonly sources: readonly string[];
|
|
2504
|
+
readonly catchUp?: {
|
|
2505
|
+
readonly xpBoostAfterDay: number;
|
|
2506
|
+
readonly multiplier?: number;
|
|
2507
|
+
};
|
|
2508
|
+
readonly autoClaim?: boolean;
|
|
2509
|
+
readonly expireUnclaimed?: 'mail' | 'forfeit';
|
|
2510
|
+
}
|
|
2511
|
+
|
|
2512
|
+
declare interface SeasonPassService {
|
|
2513
|
+
readonly applyXp: (subject: Subject, input: PassXpInput) => Effect.Effect<PassReceipt, ProgressionError>;
|
|
2514
|
+
readonly grantPremium: (subject: Subject, input: PassPremiumInput) => Effect.Effect<PassReceipt, ProgressionError>;
|
|
2515
|
+
readonly claim: (subject: Subject, input: PassClaimInput) => Effect.Effect<PassReceipt, ProgressionError>;
|
|
2516
|
+
readonly close: (subject: Subject, input: PassCloseInput) => Effect.Effect<PassReceipt, ProgressionError>;
|
|
2517
|
+
readonly mine: (subject: Subject) => Effect.Effect<readonly PlayerPass[], ProgressionError>;
|
|
2518
|
+
readonly exportSubject: (target: PluginPrivacyTarget) => Effect.Effect<unknown, ProgressionError>;
|
|
2519
|
+
readonly eraseSubject: (target: PluginPrivacyTarget) => Effect.Effect<void, ProgressionError>;
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
declare const STAT_OPERATORS: readonly ["increment", "max", "min", "set"];
|
|
2523
|
+
|
|
2524
|
+
declare interface StatDefinition {
|
|
2525
|
+
readonly id: string;
|
|
2526
|
+
readonly initial?: ProgressValue;
|
|
2527
|
+
readonly cap?: ProgressValue;
|
|
2528
|
+
readonly operators?: readonly StatOperator[];
|
|
2529
|
+
}
|
|
2530
|
+
|
|
2531
|
+
declare type StatOperator = typeof STAT_OPERATORS[number];
|
|
2532
|
+
|
|
2533
|
+
declare interface StatThreshold {
|
|
2534
|
+
readonly kind: 'statAtLeast';
|
|
2535
|
+
readonly stat: string;
|
|
2536
|
+
readonly target: string;
|
|
2537
|
+
readonly period: 'lifetime' | 'season';
|
|
2538
|
+
readonly seasonId: string | null;
|
|
2539
|
+
}
|
|
2540
|
+
|
|
2541
|
+
declare interface Tutorial {
|
|
2542
|
+
readonly id: string;
|
|
2543
|
+
readonly version: number;
|
|
2544
|
+
readonly steps: readonly string[];
|
|
2545
|
+
readonly skippable: boolean;
|
|
2546
|
+
readonly reward: readonly ProgressionReward[];
|
|
2547
|
+
readonly rewardOnSkip: boolean;
|
|
2548
|
+
readonly hints: string | null;
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
export declare interface TutorialAudit {
|
|
2552
|
+
readonly operations: number;
|
|
2553
|
+
readonly tutorials: number;
|
|
2554
|
+
readonly rewardRows: number;
|
|
2555
|
+
readonly matches: boolean;
|
|
2556
|
+
}
|
|
2557
|
+
|
|
2558
|
+
declare interface TutorialDefinition {
|
|
2559
|
+
readonly id?: string;
|
|
2560
|
+
readonly version?: number;
|
|
2561
|
+
readonly steps: readonly string[];
|
|
2562
|
+
readonly skippable?: boolean;
|
|
2563
|
+
readonly reward?: readonly ProgressionReward[];
|
|
2564
|
+
readonly rewardOnSkip?: boolean;
|
|
2565
|
+
readonly hints?: string;
|
|
2566
|
+
}
|
|
2567
|
+
|
|
2568
|
+
export declare const tutorialDefinitionsTable: Table<"_voltro_prog_tutorial_definitions", FieldDefinitions<{
|
|
2569
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2570
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2571
|
+
readonly tutorialId: ColumnBuilder<string, "text", boolean>;
|
|
2572
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
2573
|
+
readonly config: ColumnBuilder<unknown, "json", boolean>;
|
|
2574
|
+
readonly rulesVersion: ColumnBuilder<string, "text", boolean>;
|
|
2575
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
2576
|
+
}>, true, "voltro_prog_tutorial_definitions_version_idx">;
|
|
2577
|
+
|
|
2578
|
+
declare interface TutorialEvidence {
|
|
2579
|
+
readonly source: string;
|
|
2580
|
+
readonly originId: string;
|
|
2581
|
+
readonly version: string;
|
|
2582
|
+
readonly from: number;
|
|
2583
|
+
readonly until: number;
|
|
2584
|
+
}
|
|
2585
|
+
|
|
2586
|
+
export declare const tutorialLedgerTable: Table<"_voltro_prog_tutorial_ledger", FieldDefinitions<{
|
|
2587
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2588
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2589
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
2590
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
2591
|
+
readonly tutorialId: ColumnBuilder<string, "text", boolean>;
|
|
2592
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
2593
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
2594
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
2595
|
+
readonly claimKey: ColumnBuilder<string, "text", boolean>;
|
|
2596
|
+
readonly intent: ColumnBuilder<unknown, "json", boolean>;
|
|
2597
|
+
readonly before: ColumnBuilder<unknown, "json", boolean>;
|
|
2598
|
+
readonly after: ColumnBuilder<unknown, "json", boolean>;
|
|
2599
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
2600
|
+
}>, true, never>;
|
|
2601
|
+
|
|
2602
|
+
export declare const tutorialOperationsTable: Table<"_voltro_prog_tutorial_operations", FieldDefinitions<{
|
|
2603
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2604
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2605
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
2606
|
+
readonly state: ColumnBuilder<"replayed" | "erased" | "committed", "text", boolean>;
|
|
2607
|
+
readonly linkedOperationId: ColumnBuilder<string | null, "text", boolean>;
|
|
2608
|
+
readonly intent: ColumnBuilder<unknown, "json", boolean>;
|
|
2609
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
2610
|
+
readonly receipt: ColumnBuilder<unknown, "json", boolean>;
|
|
2611
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
2612
|
+
}>, true, never>;
|
|
2613
|
+
|
|
2614
|
+
declare interface TutorialReceipt {
|
|
2615
|
+
readonly operationId: string;
|
|
2616
|
+
readonly kind: 'step' | 'skip';
|
|
2617
|
+
readonly step: string | null;
|
|
2618
|
+
readonly after: TutorialState;
|
|
2619
|
+
readonly rewardsQueued: number;
|
|
2620
|
+
readonly at: number;
|
|
2621
|
+
}
|
|
2622
|
+
|
|
2623
|
+
declare interface TutorialRecordInput extends TutorialStepInput {
|
|
2624
|
+
readonly tenantId: string;
|
|
2625
|
+
readonly ownerId: string;
|
|
2626
|
+
readonly source: string;
|
|
2627
|
+
readonly originId: string;
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2630
|
+
export declare const tutorialRewardsTable: Table<"_voltro_prog_tutorial_rewards", FieldDefinitions<{
|
|
2631
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2632
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2633
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
2634
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
2635
|
+
readonly tutorialId: ColumnBuilder<string, "text", boolean>;
|
|
2636
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
2637
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
2638
|
+
readonly reward: ColumnBuilder<unknown, "json", boolean>;
|
|
2639
|
+
readonly state: ColumnBuilder<"pending" | "erased" | "delivered", "text", boolean>;
|
|
2640
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
2641
|
+
readonly deliveredAt: ColumnBuilder<Date | null, "timestamp", boolean>;
|
|
2642
|
+
readonly deliveryIntent: ColumnBuilder<unknown, "json", boolean>;
|
|
2643
|
+
readonly deliveryDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
2644
|
+
readonly deliveryReceipt: ColumnBuilder<unknown, "json", boolean>;
|
|
2645
|
+
}>, true, never>;
|
|
2646
|
+
|
|
2647
|
+
declare interface TutorialService {
|
|
2648
|
+
readonly completeStep: (subject: Subject, input: TutorialStepInput) => Effect.Effect<TutorialReceipt, ProgressionError>;
|
|
2649
|
+
readonly record: (subject: Subject, input: TutorialRecordInput) => Effect.Effect<TutorialReceipt, ProgressionError>;
|
|
2650
|
+
readonly skip: (subject: Subject, input: TutorialSkipInput) => Effect.Effect<TutorialReceipt, ProgressionError>;
|
|
2651
|
+
readonly mine: (subject: Subject) => Effect.Effect<readonly PlayerTutorial[], ProgressionError>;
|
|
2652
|
+
readonly exportSubject: (target: PluginPrivacyTarget) => Effect.Effect<unknown, ProgressionError>;
|
|
2653
|
+
readonly eraseSubject: (target: PluginPrivacyTarget) => Effect.Effect<void, ProgressionError>;
|
|
2654
|
+
}
|
|
2655
|
+
|
|
2656
|
+
declare interface TutorialSkipInput {
|
|
2657
|
+
readonly tutorialId: string;
|
|
2658
|
+
readonly requestId: string;
|
|
2659
|
+
}
|
|
2660
|
+
|
|
2661
|
+
export declare interface TutorialSqlService extends TutorialService {
|
|
2662
|
+
readonly auditTutorials: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<TutorialAudit, ProgressionError>;
|
|
2663
|
+
readonly rebuildTutorials: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<TutorialAudit, ProgressionError>;
|
|
2664
|
+
}
|
|
2665
|
+
|
|
2666
|
+
declare interface TutorialState {
|
|
2667
|
+
readonly tutorialId: string;
|
|
2668
|
+
readonly version: number;
|
|
2669
|
+
readonly completedSteps: readonly string[];
|
|
2670
|
+
readonly completed: boolean;
|
|
2671
|
+
readonly skipped: boolean;
|
|
2672
|
+
readonly completedAt: number | null;
|
|
2673
|
+
readonly updatedAt: number | null;
|
|
2674
|
+
}
|
|
2675
|
+
|
|
2676
|
+
export declare const tutorialStatesTable: Table<"_voltro_prog_tutorial", FieldDefinitions<{
|
|
2677
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2678
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2679
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
2680
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
2681
|
+
readonly tutorialId: ColumnBuilder<string, "text", boolean>;
|
|
2682
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
2683
|
+
readonly state: ColumnBuilder<unknown, "json", boolean>;
|
|
2684
|
+
readonly updatedAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
2685
|
+
}>, true, never>;
|
|
2686
|
+
|
|
2687
|
+
declare interface TutorialStepInput {
|
|
2688
|
+
readonly tutorialId: string;
|
|
2689
|
+
readonly step: string;
|
|
2690
|
+
readonly requestId: string;
|
|
2691
|
+
}
|
|
2692
|
+
|
|
2693
|
+
declare type TutorialStepPolicy = (input: TutorialStepPolicyContext) => boolean;
|
|
2694
|
+
|
|
2695
|
+
declare interface TutorialStepPolicyContext {
|
|
2696
|
+
readonly tutorial: Tutorial;
|
|
2697
|
+
readonly before: TutorialState;
|
|
2698
|
+
readonly step: string;
|
|
2699
|
+
readonly evidence: TutorialEvidence;
|
|
2700
|
+
readonly at: number;
|
|
2701
|
+
}
|
|
2702
|
+
|
|
2703
|
+
export declare interface TutorialStoreOptions {
|
|
2704
|
+
readonly definitions: readonly (TutorialDefinition | Tutorial)[];
|
|
2705
|
+
readonly eventSources: readonly string[];
|
|
2706
|
+
readonly verifier?: TutorialVerifierService | undefined;
|
|
2707
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
2708
|
+
readonly maxHistoryRows?: number | undefined;
|
|
2709
|
+
readonly maxPendingRewards?: number | undefined;
|
|
2710
|
+
readonly now?: (() => number) | undefined;
|
|
2711
|
+
readonly strategies?: {
|
|
2712
|
+
readonly stepPolicy?: TutorialStepPolicy | undefined;
|
|
2713
|
+
readonly version?: string;
|
|
2714
|
+
} | undefined;
|
|
2715
|
+
}
|
|
2716
|
+
|
|
2717
|
+
export declare const tutorialSubjectsTable: Table<"_voltro_prog_tutorial_subjects", FieldDefinitions<{
|
|
2718
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2719
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2720
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
2721
|
+
readonly erased: ColumnBuilder<boolean, "boolean", boolean>;
|
|
2722
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
2723
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
2724
|
+
}>, true, never>;
|
|
2725
|
+
|
|
2726
|
+
export declare const tutorialTables: readonly [ Table<"_voltro_prog_tutorial_definitions", FieldDefinitions<{
|
|
2727
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2728
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2729
|
+
readonly tutorialId: ColumnBuilder<string, "text", boolean>;
|
|
2730
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
2731
|
+
readonly config: ColumnBuilder<unknown, "json", boolean>;
|
|
2732
|
+
readonly rulesVersion: ColumnBuilder<string, "text", boolean>;
|
|
2733
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
2734
|
+
}>, true, "voltro_prog_tutorial_definitions_version_idx">, Table<"_voltro_prog_tutorial_subjects", FieldDefinitions<{
|
|
2735
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2736
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2737
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
2738
|
+
readonly erased: ColumnBuilder<boolean, "boolean", boolean>;
|
|
2739
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
2740
|
+
readonly admission: ColumnBuilder<number, "integer", boolean>;
|
|
2741
|
+
}>, true, never>, Table<"_voltro_prog_tutorial", FieldDefinitions<{
|
|
2742
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2743
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2744
|
+
readonly ownerId: ColumnBuilder<string, "text", boolean>;
|
|
2745
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
2746
|
+
readonly tutorialId: ColumnBuilder<string, "text", boolean>;
|
|
2747
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
2748
|
+
readonly state: ColumnBuilder<unknown, "json", boolean>;
|
|
2749
|
+
readonly updatedAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
2750
|
+
}>, true, never>, Table<"_voltro_prog_tutorial_ledger", FieldDefinitions<{
|
|
2751
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2752
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2753
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
2754
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
2755
|
+
readonly tutorialId: ColumnBuilder<string, "text", boolean>;
|
|
2756
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
2757
|
+
readonly sequence: ColumnBuilder<number, "integer", boolean>;
|
|
2758
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
2759
|
+
readonly claimKey: ColumnBuilder<string, "text", boolean>;
|
|
2760
|
+
readonly intent: ColumnBuilder<unknown, "json", boolean>;
|
|
2761
|
+
readonly before: ColumnBuilder<unknown, "json", boolean>;
|
|
2762
|
+
readonly after: ColumnBuilder<unknown, "json", boolean>;
|
|
2763
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
2764
|
+
}>, true, never>, Table<"_voltro_prog_tutorial_operations", FieldDefinitions<{
|
|
2765
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2766
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2767
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
2768
|
+
readonly state: ColumnBuilder<"replayed" | "erased" | "committed", "text", boolean>;
|
|
2769
|
+
readonly linkedOperationId: ColumnBuilder<string | null, "text", boolean>;
|
|
2770
|
+
readonly intent: ColumnBuilder<unknown, "json", boolean>;
|
|
2771
|
+
readonly digest: ColumnBuilder<string | null, "text", boolean>;
|
|
2772
|
+
readonly receipt: ColumnBuilder<unknown, "json", boolean>;
|
|
2773
|
+
readonly at: ColumnBuilder<Date, "timestamp", boolean>;
|
|
2774
|
+
}>, true, never>, Table<"_voltro_prog_tutorial_rewards", FieldDefinitions<{
|
|
2775
|
+
readonly id: ColumnBuilder<string, "id", boolean>;
|
|
2776
|
+
readonly tenantId: ColumnBuilder<string, "text", boolean>;
|
|
2777
|
+
readonly ownerId: ColumnBuilder<string | null, "text", boolean>;
|
|
2778
|
+
readonly ownerKey: ColumnBuilder<string | null, "text", boolean>;
|
|
2779
|
+
readonly tutorialId: ColumnBuilder<string, "text", boolean>;
|
|
2780
|
+
readonly version: ColumnBuilder<number, "integer", boolean>;
|
|
2781
|
+
readonly operationId: ColumnBuilder<string, "text", boolean>;
|
|
2782
|
+
readonly reward: ColumnBuilder<unknown, "json", boolean>;
|
|
2783
|
+
readonly state: ColumnBuilder<"pending" | "erased" | "delivered", "text", boolean>;
|
|
2784
|
+
readonly createdAt: ColumnBuilder<Date, "timestamp", boolean>;
|
|
2785
|
+
readonly deliveredAt: ColumnBuilder<Date | null, "timestamp", boolean>;
|
|
2786
|
+
readonly deliveryIntent: ColumnBuilder<unknown, "json", boolean>;
|
|
2787
|
+
readonly deliveryDigest: ColumnBuilder<string | null, "text", boolean>;
|
|
2788
|
+
readonly deliveryReceipt: ColumnBuilder<unknown, "json", boolean>;
|
|
2789
|
+
}>, true, never>];
|
|
2790
|
+
|
|
2791
|
+
declare interface TutorialVerificationInput {
|
|
2792
|
+
readonly tenantId: string;
|
|
2793
|
+
readonly ownerId: string;
|
|
2794
|
+
readonly tutorialId: string;
|
|
2795
|
+
readonly version: number;
|
|
2796
|
+
readonly step: string;
|
|
2797
|
+
readonly requestId: string;
|
|
2798
|
+
}
|
|
2799
|
+
|
|
2800
|
+
/** An app checks actual authoritative gameplay evidence; a client completion boolean is never evidence. */
|
|
2801
|
+
declare interface TutorialVerifierService {
|
|
2802
|
+
readonly verify: (subject: Subject, input: TutorialVerificationInput) => Effect.Effect<TutorialEvidence, ProgressionError>;
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2805
|
+
declare type XpCurve = (context: XpCurveContext) => number;
|
|
2806
|
+
|
|
2807
|
+
declare interface XpCurveContext {
|
|
2808
|
+
readonly xp: string;
|
|
2809
|
+
readonly curve: LevelCurve;
|
|
2810
|
+
}
|
|
2811
|
+
|
|
2812
|
+
export { }
|