Class: Workspace

Workspace(attributes)

Class representing a Shortcut workspace. Handles workspace data, story management, and interactions with the Shortcut API.

Constructor

new Workspace(attributes)

Creates a new Workspace instance

Parameters:
Name Type Description
attributes WorkspaceAttributes

The workspace attributes

Source:

Extends

Classes

Workspace
Workspace

Members

(static) cacheKey :string

Key used for caching workspace data

Type:
  • string
Source:

cacheKey

Key used for caching workspace data

Source:

client

The Shortcut API client instance used for making API requests

Overrides:
Source:

context

The VS Code extension context

Overrides:
Source:

Methods

(static) deleteCache(workspaces)

Deletes workspace cache and related caches

Parameters:
Name Type Description
workspaces Array.<Workspace> | undefined

Optional workspaces to clear related caches

Source:

(static) deleteCache(workspaces)

Deletes workspace cache and related caches

Parameters:
Name Type Description
workspaces Array.<Workspace> | undefined

Optional workspaces to clear related caches

Source:

(static) fromJSON(json) → {Array.<Workspace>}

Creates Workspace instances from JSON string

Parameters:
Name Type Description
json string

JSON string containing workspace data

Source:
Returns:

Array of Workspace instances

Type
Array.<Workspace>

(static) fromJSON(json) → {Array.<Workspace>}

Creates Workspace instances from JSON string

Parameters:
Name Type Description
json string

JSON string containing workspace data

Source:
Returns:

Array of Workspace instances

Type
Array.<Workspace>

(async, static) get(apiTokens) → {Promise.<Array.<Workspace>>}

Retrieves workspaces from cache or creates new ones from API tokens

Parameters:
Name Type Description
apiTokens object | undefined

API tokens for workspace creation

Source:
Returns:

Array of workspace instances

Type
Promise.<Array.<Workspace>>

(async, static) get(apiTokens) → {Promise.<Array.<Workspace>>}

Retrieves workspaces from cache or creates new ones from API tokens

Parameters:
Name Type Description
apiTokens object | undefined

API tokens for workspace creation

Source:
Returns:

Array of workspace instances

Type
Promise.<Array.<Workspace>>

(static) getFromCache() → {Array.<Workspace>|undefined}

Retrieves workspaces from cache

Source:
Returns:

Array of workspace instances or undefined if cache is empty

Type
Array.<Workspace> | undefined

(static) getFromCache() → {Array.<Workspace>|undefined}

Retrieves workspaces from cache

Source:
Returns:

Array of workspace instances or undefined if cache is empty

Type
Array.<Workspace> | undefined

(static) saveToCache(workspaces)

Saves workspaces to cache

Parameters:
Name Type Description
workspaces Array.<Workspace>

Array of workspaces to cache

Source:

(static) saveToCache(workspaces)

Saves workspaces to cache

Parameters:
Name Type Description
workspaces Array.<Workspace>

Array of workspaces to cache

Source:

(async) getAssignedStories() → {Promise.<void>}

Fetches and organizes stories assigned to the workspace member Groups stories by workflow and workflow state

Source:
Returns:
Type
Promise.<void>

(async) getAssignedStories() → {Promise.<void>}

Fetches and organizes stories assigned to the workspace member Groups stories by workflow and workflow state

Source:
Returns:
Type
Promise.<void>

(async) getPendingStories() → {Promise.<void>}

Fetches and updates pending stories for the workspace

Source:
Returns:
Type
Promise.<void>

(async) getPendingStories() → {Promise.<void>}

Fetches and updates pending stories for the workspace

Source:
Returns:
Type
Promise.<void>

(async) getWorkflows() → {Promise.<Array.<Workflow>>}

Fetches and updates workflows for the workspace

Source:
Returns:

Array of workflows

Type
Promise.<Array.<Workflow>>

(async) getWorkflows() → {Promise.<Array.<Workflow>>}

Fetches and updates workflows for the workspace

Source:
Returns:

Array of workflows

Type
Promise.<Array.<Workflow>>

toJSON() → {string}

Converts workspace instance to JSON string

Source:
Returns:

JSON string representation of the workspace

Type
string

toJSON() → {string}

Converts workspace instance to JSON string

Source:
Returns:

JSON string representation of the workspace

Type
string

toObject() → {WorkspaceAttributes}

Converts workspace instance to plain object

Source:
Returns:

Plain object representation of the workspace

Type
WorkspaceAttributes

toObject() → {WorkspaceAttributes}

Converts workspace instance to plain object

Source:
Returns:

Plain object representation of the workspace

Type
WorkspaceAttributes

updateAttributes(data, memberInfo)

Updates workspace attributes with new data

Parameters:
Name Type Description
data Object

New workspace data

memberInfo MemberInfo

Updated member information

Source:

updateAttributes(data, memberInfo)

Updates workspace attributes with new data

Parameters:
Name Type Description
data Object

New workspace data

memberInfo MemberInfo

Updated member information

Source: