0.5.0: typecheck against regenerated models
listQuests no longer takes a body, battle-pass track is a union, scenario run status has no unknown_run. This ships loginWithCustom and quest metric helpers that never reached the registry after the v0.4.0 publish job failed.
This commit is contained in:
@@ -79,7 +79,7 @@ export interface QuestEffect {
|
||||
export interface BattlePassEffect {
|
||||
getProgress(): Promise<GetBattlePassProgressResponse>;
|
||||
addXp(source: string, amount: number): Promise<AddBattlePassXpResponse>;
|
||||
claimReward(level: number, track?: string): Promise<ClaimBattlePassRewardResponse>;
|
||||
claimReward(level: number, track?: 'free' | 'premium'): Promise<ClaimBattlePassRewardResponse>;
|
||||
purchasePremium(): Promise<PurchaseBattlePassPremiumResponse>;
|
||||
levelUp(): Promise<void>;
|
||||
end(): Promise<void>;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* QuestMetrics — builders for the quest metric strings known to the platform.
|
||||
*
|
||||
* Purchase metrics are reported automatically by the shop purchase fan-out,
|
||||
* so these helpers exist mainly to name the format instead of hardcoding it.
|
||||
* Any other metric is a custom string reported via
|
||||
* Purchase metrics are reported automatically server-side by the shop
|
||||
* purchase fan-out, so these helpers exist mainly to name the format
|
||||
* instead of hardcoding it. Any other metric is a custom string reported via
|
||||
* {@link QuestsService.reportProgress}.
|
||||
*/
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export class QuestsService {
|
||||
|
||||
/** Lists the player's quests with per-objective progress and rewards. */
|
||||
async list(): Promise<Quest[]> {
|
||||
const response = await api.listQuests(this.ctx, {});
|
||||
const response = await api.listQuests(this.ctx);
|
||||
return response.quests ?? [];
|
||||
}
|
||||
|
||||
|
||||
@@ -136,8 +136,9 @@ export class ScenarioService<TConfig extends RemoteConfigShape = RemoteConfigSha
|
||||
|
||||
try {
|
||||
const response = await api.getScenarioRun(this.ctx, { runId: saved.runId });
|
||||
const status: string | undefined = response?.status;
|
||||
|
||||
if (response?.status === 'unknown_run' || response?.status === 'expired') {
|
||||
if (status === 'unknown_run' || status === 'expired') {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -466,8 +467,9 @@ export class ScenarioService<TConfig extends RemoteConfigShape = RemoteConfigSha
|
||||
let reconciled = false;
|
||||
try {
|
||||
const reconcile = await api.getScenarioRun(this.ctx, { runId: run.runId });
|
||||
const reconcileStatus: string | undefined = reconcile?.status;
|
||||
|
||||
if (reconcile?.status === 'unknown_run' || reconcile?.status === 'expired') {
|
||||
if (reconcileStatus === 'unknown_run' || reconcileStatus === 'expired') {
|
||||
this.runs.delete(run.runId);
|
||||
await this.persist();
|
||||
reconciled = true;
|
||||
|
||||
@@ -278,7 +278,7 @@ export class BattlePassSession {
|
||||
}
|
||||
|
||||
/** Claims a tier reward at a reached level. */
|
||||
claimReward(level: number, track?: string): Promise<ClaimBattlePassRewardResponse> {
|
||||
claimReward(level: number, track?: 'free' | 'premium'): Promise<ClaimBattlePassRewardResponse> {
|
||||
const { scenarioId, nodeId, runId } = this.ids();
|
||||
return this.battlePass.claimReward({ scenarioId, nodeId, level, track, runId });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user