@trophyso/node
Version:
NodeJS SDK for the Trophy API
32 lines (31 loc) • 1.91 kB
TypeScript
import type * as TrophyApi from "../index";
export interface AchievementResponse {
/** The unique ID of the achievement. */
id: string;
/** The name of this achievement. */
name: string;
/** The trigger of the achievement. */
trigger: TrophyApi.AchievementResponseTrigger;
/** The description of this achievement. */
description?: string;
/** The URL of the badge image for the achievement, if one has been uploaded. */
badgeUrl?: string;
/** The key used to reference this achievement in the API (only applicable if trigger = 'api') */
key?: string;
/** The length of the streak required to complete the achievement (only applicable if trigger = 'streak') */
streakLength?: number;
/** The IDs of the prerequisite achievements that must be completed to earn this achievement (only applicable if trigger = 'achievement') */
achievementIds?: string[];
/** The ID of the metric associated with this achievement (only applicable if trigger = 'metric') */
metricId?: string;
/** The value of the metric required to complete the achievement (only applicable if trigger = 'metric') */
metricValue?: number;
/** The name of the metric associated with this achievement (only applicable if trigger = 'metric') */
metricName?: string;
/** User attribute filters that must be met for this achievement to be completed. */
userAttributes: TrophyApi.AchievementResponseUserAttributesItem[];
/** Deprecated. Event attribute filter that must be met for this achievement to be completed. Only present if the achievement has an event filter configured. */
eventAttribute?: TrophyApi.AchievementResponseEventAttribute;
/** Event attribute filters that must be met for this achievement to be completed. Omitted for non-metric achievements. */
eventAttributes?: TrophyApi.AchievementResponseEventAttributesItem[];
}