-
Notifications
You must be signed in to change notification settings - Fork 1
API_Documentation
-
API_TOKEN :
string
-
Signed-in member's API key
-
WORKSPACE :
string
-
Name of the workspace (workspace URL slug, actually) that the signed-in member is a part of
-
MEMBER_ID :
string
-
Signed-in member's member ID
-
MEMBER_MAP :
Object.<string, Member>
-
Object mapping member ID -> member object. Contains all members
-
STORIES :
Array.<Story>
-
All stories in the workspace
-
SETUP :
Promise.<void>
-
A promise to all global variables being initialized; promise that fulfills when all global vars are initialized. Once all global vars are initialized (without errors), all methods can execute correctly.
-
fetchProjectsAsync() ⇒
Promise.<Array.<Project>>
-
Fetch all projects
-
fetchProjectStoriesAsync(projectId) ⇒
Promise.<Array.<Story>>
-
Fetch all stories in a project
-
fetchStoriesAsync() ⇒
Promise.<Array.<Story>>
-
Fetch all stories in all projects
-
fetchMemberInfoAsync(apiToken) ⇒
Promise.<MemberInfo>
-
Fetch info about a member
-
fetchMembersAsync() ⇒
Promise.<Array.<BasicMember>>
-
Fetch all members in the workspace
-
isComplete(story) ⇒
boolean
-
Check if a story is complete
-
getStories([params]) ⇒
Array.<Story>
-
Get stories - using optional filters - from the set of all stories in the workspace (STORIES).
-
getMyIncompleteStories() ⇒
Array.<Story>
-
Get incomplete stories that are assigned to the signed-in member
-
getAllIncompleteStories() ⇒
Array.<Story>
-
Get all incomplete stories in the workspace
-
getTopWarriors() ⇒
Array.<TopContributor>
-
Get up to top 3 point contributors. If less than 3 members have completed any stories (and have more than 0 points), only return those that do.
-
getBattleLog() ⇒
Array.<Story>
-
Returns stories in sorted by most recently completed Get stories to show in the battle log - all completed stories sorted by most recently completed.
-
getMemberName(memberId) ⇒
string
-
Get the name of a member
-
getMemberProfile() ⇒
MemberDisplay
-
Get the display info - workspace, name, and display icon - of the signed-in member.
- removeApiToken()
-
Set the value of API_TOKEN to undefined
-
getProgress() ⇒
Progress
-
Get the overall progress of stories, in terms of points completed
- onLogin(apiToken, memberId, workspace)
-
Method to be called during the sign-in process once the member's API token, ID, and workspace are known. Initializes global variables that are known, and triggers the initialization of all other global variables (by calling setup).
-
setup() ⇒
Promise.<void>
-
Get the SETUP promise. If SETUP hasn't been initialized yet, create it. Otherwise, return the existing promise - do not recreate/restart it.
- setupTest(apiToken, memberID)
-
Used for testing only. Does the same thing as setup, but does not use chrome storage
- signout()
-
Signout by removing all items from StorageArea storage.sync
- toggleMemberMenu()
-
Show member profile menu
- selectTab(tabIndex)
-
Apply appropriate styles to selected tab and panel item
- completeStory(story)
-
TODO: Complete story
Signed-in member's API key
Name of the workspace (workspace URL slug, actually) that the signed-in member is a part of
Signed-in member's member ID
Object mapping member ID -> member object. Contains all members
All stories in the workspace
A promise to all global variables being initialized; promise that fulfills when all global vars are initialized. Once all global vars are initialized (without errors), all methods can execute correctly.
Kind: global variable
See: setup
Fetch all projects
Kind: global function
Returns: Promise.<Array.<Project>>
- A promise to all projects in the workspace
Fetch all stories in a project
Kind: global function
Returns: Promise.<Array.<Story>>
- A promise to all stories in the project
Param | Type | Description |
---|---|---|
projectId | string |
ID of the project |
Fetch all stories in all projects
Kind: global function
Returns: Promise.<Array.<Story>>
- A promise to all stories in the workspace
Fetch info about a member
Kind: global function
Returns: Promise.<MemberInfo>
- A promise to the member info object
Param | Type | Description |
---|---|---|
apiToken | string |
Member's API token |
Fetch all members in the workspace
Kind: global function
Returns: Promise.<Array.<BasicMember>>
- A promise to the array of member objects
Check if a story is complete
Kind: global function
Returns: boolean
- True if the story is complete, false otherwise
Param | Type | Description |
---|---|---|
story | Story |
Story to check |
Get stories - using optional filters - from the set of all stories in the workspace (STORIES).
Kind: global function
Returns: Array.<Story>
- Stories specified by the filters (if any). If no
filters are specified, returns all stories in the
workspace (STORIES). If STORIES is null, returns
null.
Param | Type | Default | Description |
---|---|---|---|
[params] | Object.<string, boolean> |
Optional parameter to specify filter flags. | |
[params.memberOnly] | boolean |
false |
Flag to only include stories assigned to the signed-in member. |
[params.incompleteOnly] | boolean |
false |
Flag to only include stories that are incomplete. |
[params.completeOnly] | boolean |
false |
Flag to only include stories that are complete. |
Get incomplete stories that are assigned to the signed-in member
Kind: global function
Returns: Array.<Story>
- Incomplete stories assigned to the signed-in member.
If STORIES is null, returns null.
See: getStories
Get all incomplete stories in the workspace
Kind: global function
Returns: Array.<Story>
- All incomplete stories in the workspace. If STORIES
is null, returns null.
See: getStories
Get up to top 3 point contributors. If less than 3 members have completed any stories (and have more than 0 points), only return those that do.
Kind: global function
Returns: Array.<TopContributor>
- The top contributors (max 3). If less than
3 top contributors exist, only those, the
returned array will have length less than 3.
Finds top warrior by points and removes from map. If a top warrior doesn't exist, return null.
Kind: inner method of getTopWarriors
Returns: TopContributor
- Top contributor in map or null if none exists
Returns stories in sorted by most recently completed Get stories to show in the battle log - all completed stories sorted by most recently completed.
Kind: global function
Returns: Array.<Story>
- Stories for battle log. If STORIES is null, returns null
Get the name of a member
Kind: global function
Returns: string
- Name of the specified member
Param | Type | Description |
---|---|---|
memberId | string |
ID of the member to get the name of |
Get the display info - workspace, name, and display icon - of the signed-in member.
Kind: global function
Returns: MemberDisplay
- The display info of the signed-in member
Set the value of API_TOKEN to undefined
Get the overall progress of stories, in terms of points completed
Kind: global function
Returns: Progress
- Completed points and total points
Method to be called during the sign-in process once the member's API token, ID, and workspace are known. Initializes global variables that are known, and triggers the initialization of all other global variables (by calling setup).
Kind: global function
See: setup
Param | Type | Description |
---|---|---|
apiToken | string |
API token of the member signing in |
memberId | string |
Member ID of the member signing in |
workspace | string |
Workspace of the member signing in |
Get the SETUP promise. If SETUP hasn't been initialized yet, create it. Otherwise, return the existing promise - do not recreate/restart it.
Kind: global function
Returns: Promise.<void>
- A promise to all global variables being initialized
without error and all methods being ready for
execution.
See: SETUP
Used for testing only. Does the same thing as setup, but does not use chrome storage
Kind: global function
Param | Description |
---|---|
apiToken | the token to set the API_TOKEN var to |
memberID | the id to set MEMBER_ID var to |
Signout by removing all items from StorageArea storage.sync
Show member profile menu
Apply appropriate styles to selected tab and panel item
Kind: global function
Param | Type | Description |
---|---|---|
tabIndex | number |
index of tab |
TODO: Complete story
Kind: global function
Param | Type |
---|---|
story | Story |