import { GlobalOptions, APIRequestContext, FerantConfigurable } from '../../util/types'; export declare namespace karma_v1 { interface Options extends GlobalOptions { version: 'v1'; } /** */ interface Returns$Karma$Send { /** */ new_commit_id?: string; /** */ last_commit_id?: string; } /** */ enum Commit$Action$Enum { CREATE = 0, UPDATE = 1, ARCHIVE = 2, DELETE = 3, COMPLETE = 4, UNCOMPLETE = 5, CLOSE = 6, COMPLETE_BY_TASKS = 7 } /** */ enum Commit$Item$Enum { TASK = 0, GOAL = 1 } /** */ enum Commit$Relation$Enum { IDENTITY = 0, GOAL = 1 } /** */ enum Commit$Author$Enum { USER = 0, COURSE = 1, SYSTEM = 2 } /** */ interface Params$Commit$Envelope { /** */ action: Commit$Action$Enum; /** */ item_type: Commit$Item$Enum; /** */ relation_type?: Commit$Relation$Enum; /** */ relation_item_id?: string; /** */ due_date?: string; /** */ attribute_affected: object[]; /** */ item_id: string; /** */ course_id?: string; /** */ achievement?: boolean; } /** */ interface Params$Commit$Header { /** */ commit_id?: string; /** */ created_at: string; /** */ last_commit_id?: string; /** */ fid?: string; /** */ author: Commit$Author$Enum; } /** */ interface Params$Commit extends Params$Commit$Envelope, Params$Commit$Header { } /** * Class based functionality. Functions here represent karma actions. */ class Karma { context: APIRequestContext; commits: Resource$Commits; stats: Resource$Stats; constructor(options: GlobalOptions, ferant?: FerantConfigurable); /** * Send commit to the server. * * ## Karma API overview * Karma allows us to calculate the type of activity for the user; `productivity` or `efficiency`. This information is used to display the user's engagement with the application. * * ### Productivity * Productivity is the basic interaction with the to-dos. Each interaction is an addition to the aggregate for the day (+1). In order for the event to be considered as productivity, it must be one of the following: * - Task was completed * - Daily goal has been reached (the amount of tasks to complete in a day) * - Streak (the amount of consecutive days that the user has completed tasks) * * __Note:__ _Productivity also receives a negative point (-1) if the user allows tasks to become overdue._ * * ### Efficiency * Efficiency is the ability to make more granular decisions with regards to the to-dos. Each interaction is an addition to the aggregate for the day (+1). In order for the event to be considered as efficiency, it must be one of the following: * - Tasks with __an identity marker or goal assigned__ was completed * - Goal was completed by completing tasks assigned to it * - Goal was closed/completed * * __Note:__ Efficiency also receives a negative point (-1) if the user allows goals to become overdue._ * * @param data to be sent to the server * @returns commit after process */ send(data: Params$Commit): Promise; } /** Return schema for commits delete */ interface Returns$Commits$Delete { result?: string; } /** * Class based functionality. Functions here represent commit actions. */ class Resource$Commits { context: APIRequestContext; constructor(context: APIRequestContext); /** * Get the commit history for a particular commit. * @param commitId * @returns list of commits */ get(data?: { commitId?: string; fid?: string; }): Promise; /** * Delete commit history * @returns success result */ delete(fid?: string): Promise; } /** Return schema for stats get */ interface Returns$Stats$Get { stats?: Returns$Stats$Get$Aggregate[]; } /** */ interface Returns$Stats$Get$Aggregate { /** */ productivity?: number; /** */ efficiency?: number; /** */ total?: number; /** */ date?: string; /** */ fid?: string; /** */ daily_goal_achieved?: boolean; /** */ tasks_completed?: number; } /** * Class based functionality. Functions here represent stats actions. */ class Resource$Stats { context: APIRequestContext; constructor(context: APIRequestContext); /** * Retrieve the stats for a whole year. * @param year to be retrieved * @returns list of stats */ get(data?: { year?: string; fid?: string; }): Promise; } }