@trophyso/node
Version:
NodeJS SDK for the Trophy API
38 lines (37 loc) • 2.24 kB
TypeScript
import type * as TrophyApi from "../index";
export interface PointsTrigger {
/** The ID of the trigger */
id: string;
/** The type of trigger */
type: TrophyApi.PointsTriggerType;
/** The points awarded by this trigger. */
points: number;
/** The status of the trigger. */
status: TrophyApi.PointsTriggerStatus;
/** The unique ID of the achievement associated with this trigger, if the trigger is an achievement. */
achievementId?: string;
/** The unique ID of the metric associated with this trigger, if the trigger is a metric. */
metricId?: string;
/** If the trigger has type 'metric', the name of the metric */
metricName?: string;
/** If the trigger has type 'metric', the threshold of the metric that triggers the points */
metricThreshold?: number;
/** If the trigger has type 'streak', the threshold of the streak that triggers the points */
streakLengthThreshold?: number;
/** If the trigger has type 'achievement', the name of the achievement */
achievementName?: string;
/** If the trigger has type 'time', the unit of time after which to award points */
timeUnit?: TrophyApi.PointsTriggerTimeUnit;
/** If the trigger has type 'time', the numer of units of timeUnit after which to award points */
timeInterval?: number;
/** User attribute filters that must be met for this trigger to award points. Empty when the trigger has no user attribute filters configured. */
userAttributes: TrophyApi.PointsTriggerUserAttributesItem[];
/** Deprecated. Event attribute filter that must be met for this trigger to award points. Only present if the trigger has an event filter configured. */
eventAttribute?: TrophyApi.PointsTriggerEventAttribute;
/** If the trigger has type 'metric', the event attributes that must match for the trigger to award points. Empty when the trigger is metric-based and has no event attribute filters. Omitted for non-metric triggers. */
eventAttributes?: TrophyApi.PointsTriggerEventAttributesItem[];
/** The date and time the trigger was created, in ISO 8601 format. */
created: Date;
/** The date and time the trigger was last updated, in ISO 8601 format. */
updated: Date;
}