-
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.
-
fetchFromClubhouse(url, params) ⇒
Promise.<(Array.<(Project|Story|BasicMember)>|MemberInfo|Error)>
-
Fetch from a Clubhouse API endpoint. Fetch calls from this method differ from regular fetches in that they send the desired fetch call through a CORS proxy.
-
fetchMemberInfoAsync(apiToken) ⇒
Promise.<MemberInfo>
-
Fetch info about a member
-
fetchMembersAsync(apiToken) ⇒
Promise.<Array.<BasicMember>>
-
Fetch all members in the workspace
- validateMember(apiKey)
-
Validates a potential member using their API key. First, validates their API key by checking with the Clubhouse API. If the API key is valid, stores the member's API key, member ID, name, and workspace in browser storage, then changes window to popup. If the API key is invalid or another error occurs, this method does nothing (TODO).
-
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.<Contributor>
-
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.
-
getAllMembers() ⇒
Array.<Member>
-
Get all team members.
-
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.
-
getProgress() ⇒
Progress
-
Get the overall progress of stories, in terms of points completed
-
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.
- 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
- toggleMembersList()
-
Toggle members list for honors
- honorMember(member)
-
TODO: Record honoring of member in database
- completeStory(story)
-
TODO: Complete story
-
Project :
object
-
Story :
object
-
BasicMember :
object
-
Basic (not modified/enhanced by us) member object fetched from Clubhouse
-
Member :
object
-
BasicMember that we have enhanced with additional attributes (i.e. points)
-
MemberDisplay :
object
-
Sub-object of BasicMember, with simplified structure
-
Contributor :
object
-
Sub-object of Member, with simplified structure
-
MemberInfo :
object
-
Member object, containing workspace info (but less member info than BasicMember), fetched from Clubhouse
-
Progress :
object
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
STORIES : Array.<Story>
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 from a Clubhouse API endpoint. Fetch calls from this method differ from regular fetches in that they send the desired fetch call through a CORS proxy.
Kind: global function
Returns: Promise.<(Array.<(Project|Story|BasicMember)>|MemberInfo|Error)>
- If successful, a promise to the requested object. Otherwise, an Error with
message equal to the value of:
- ERR_MSG_INTERNET
- ERR_MSG_INVALID_API_TOKEN
- ERR_MSG_CLUBHOUSE_API_QUOTA_EXCEEDED
- ERR_MSG_UNKNOWN_CLUBHOUSE_RESPONSE
Param | Type | Description |
---|---|---|
url | string |
The Clubhouse URL to fetch from |
params | object |
Optional parameters to pass to fetch (i.e. headers) |
fetchMemberInfoAsync(apiToken) ⇒ Promise.<MemberInfo>
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
Param | Type | Description |
---|---|---|
apiToken | string |
Member's API token |
Validates a potential member using their API key. First, validates their API key by checking with the Clubhouse API. If the API key is valid, stores the member's API key, member ID, name, and workspace in browser storage, then changes window to popup. If the API key is invalid or another error occurs, this method does nothing (TODO).
Kind: global function
Param | Type | Description |
---|---|---|
apiKey | string |
The API key of the potential member |
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 |
getStories([params]) ⇒ Array.<Story>
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. |
getMyIncompleteStories() ⇒ Array.<Story>
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
getAllIncompleteStories() ⇒ Array.<Story>
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
getTopWarriors() ⇒ Array.<Contributor>
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.<Contributor>
- An array of top contributors (max 3). If less
than 3 top contributors exist, the returned array will have length less
than 3. If there are no top contributors, an empty array is returned.
getAllMembers() ⇒ Array.<Member>
Get all team members.
Kind: global function
Returns: Array.<Member>
- Array of all members.
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.
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 |
getMemberProfile() ⇒ MemberDisplay
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
getProgress() ⇒ Progress
Get the overall progress of stories, in terms of points completed
Kind: global function
Returns: Progress
- Completed points and total points
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
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 |
Toggle members list for honors
TODO: Record honoring of member in database
Kind: global function
Param | Type | Description |
---|---|---|
member | Member |
Member object that is being honored |
TODO: Complete story
Kind: global function
Param | Type | Description |
---|---|---|
story | Story |
Story that is being completed |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
id | string |
ID of the project |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
completed | boolean |
Whether the story is completed |
completed_at | string |
String representation of the time of completion |
estimate | number |
Story point estimate |
name | string |
Name of the story |
owner_ids | Array.<string> |
Member IDs of members assigned to the story |
Basic (not modified/enhanced by us) member object fetched from Clubhouse
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
profile | object |
Profile of the member containing personal info |
profile.name | string |
Name of the member |
BasicMember that we have enhanced with additional attributes (i.e. points)
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
points | number |
Total story points completed by the member |
profile | object |
Profile of the member containing personal info |
profile.name | string |
Name of the member |
Sub-object of BasicMember, with simplified structure
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
workspace | string |
Name of the member's workspace |
name | name |
Name of the member |
icon | string |
URL of the member's display icon |
Sub-object of Member, with simplified structure
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
name | string |
Name of the contributor (member) |
points | string |
Total story points completed by the member |
Member object, containing workspace info (but less member info than BasicMember), fetched from Clubhouse
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
name | string |
Name of the member |
workspace2 | object |
Info about the member's workspace |
workspace2.url_slug | string |
Member's workspace URL slug |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
total | number |
Number of total story points |