Skip to content

API_Documentation

mdkressin edited this page May 25, 2020 · 20 revisions

API Reference

Members

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.

Functions

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

getBattleLog()Array.<Story>

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.

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

Typedefs

Progress : Object

TYPE DECLARATIONS

API_TOKEN : string

Signed-in member's API key

Kind: global variable

WORKSPACE : string

Name of the workspace (workspace URL slug, actually) that the signed-in member is a part of

Kind: global variable

MEMBER_ID : string

Signed-in member's member ID

Kind: global variable

MEMBER_MAP : Object.<string, Member>

Object mapping member ID -> member object. Contains all members

Kind: global variable

STORIES : Array.<Story>

All stories in the workspace

Kind: global variable

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.

Kind: global variable
See: setup

fetchProjectsAsync() ⇒ Promise.<Array.<Project>>

Fetch all projects

Kind: global function
Returns: Promise.<Array.<Project>> - A promise to all projects in the workspace

fetchProjectStoriesAsync(projectId) ⇒ Promise.<Array.<Story>>

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

fetchStoriesAsync() ⇒ Promise.<Array.<Story>>

Fetch all stories in all projects

Kind: global function
Returns: Promise.<Array.<Story>> - A promise to all stories in the workspace

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

fetchMembersAsync() ⇒ Promise.<Array.<BasicMember>>

Fetch all members in the workspace

Kind: global function
Returns: Promise.<Array.<BasicMember>> - A promise to the array of member objects

isComplete(story) ⇒ boolean

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

getBattleLog() ⇒ Array.<Story>

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

getMemberName(memberId) ⇒ string

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

removeApiToken()

Set the value of API_TOKEN to undefined

Kind: global function

getProgress() ⇒ Progress

Get the overall progress of stories, in terms of points completed

Kind: global function
Returns: Progress - Completed points and total points

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).

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

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.

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()

Signout by removing all items from StorageArea storage.sync

Kind: global function

toggleMemberMenu()

Show member profile menu

Kind: global function

selectTab(tabIndex)

Apply appropriate styles to selected tab and panel item

Kind: global function

Param Type Description
tabIndex number index of tab

completeStory(story)

TODO: Complete story

Kind: global function

Param Type
story Story

Progress : Object

TYPE DECLARATIONS

Kind: global typedef
Properties

Name Type Description
id string ID of the project
completed boolean Whether the story is completed
completed_at string String representation of the time of completion
estimate number Story point estimate
id string ID of the story
name string Name of the story
owner_ids Array.<string> Member IDs of members assigned to the story
id string ID of the member
profile Object Profile of the member containing personal info
profile.name string Name of the member
id string ID of the member
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
workspace string Name of the member's workspace
name name Name of the member
icon string URL of the member's display icon
id string ID of the member
name string Name of the member
workspace2 Object Info about the member's workspace
workspace2.url_slug string Member's workspace URL slug
completed number Number of story points completed
total number Number of total story points
Clone this wiki locally