-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import BaseData from '@sx/base-data' | ||
import UUID from '@sx/utils/uuid' | ||
|
||
|
||
export default interface EpicApiData extends BaseData { | ||
app_url: string | ||
archived: boolean | ||
associated_groups: [] | ||
completed: boolean | ||
completed_at: string | null | ||
completed_at_override: string | null | ||
deadline: string | null | ||
description: string | ||
entity_type: string | ||
epic_state_id: number | ||
external_id: string | null | ||
follower_ids: UUID[] | ||
group_ids: UUID[] | ||
id: number | ||
label_ids: number[] | ||
labels: [] | ||
member_mention_ids: UUID[] | ||
mention_ids: UUID[] | ||
milestone_id: number | null | ||
name: string | ||
objective_ids: number[] | ||
owner_ids: UUID[] | ||
planned_start_date: string | null | ||
position: number | ||
productboard_id: UUID | null | ||
productboard_name: string | null | ||
productboard_plugin_id: UUID | null | ||
productboard_url: string | null | ||
project_ids: number[] | ||
requested_by_id: UUID | ||
started: boolean | ||
started_at: string | null | ||
started_at_override: string | null | ||
stats: object | ||
stories_without_projects: number | ||
updated_at: string | null | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import UUID from '@sx/utils/uuid' | ||
|
||
|
||
export default interface EpicInterface { | ||
appUrl: string | ||
archived: boolean | ||
associatedGroups: [] | ||
completed: boolean | ||
completedAt: string | null | ||
completedAtOverride: string | null | ||
deadline: string | null | ||
description: string | ||
entityType: string | ||
epicStateId: number | ||
externalId: string | null | ||
followerIds: UUID[] | ||
groupIds: UUID[] | ||
id: number | ||
labelIds: number[] | ||
labels: [] | ||
memberMentionIds: UUID[] | ||
mentionIds: UUID[] | ||
milestoneId: number | null | ||
name: string | ||
objectiveIds: number[] | ||
ownerIds: UUID[] | ||
plannedStartDate: string | null | ||
position: number | ||
productboardId: UUID | null | ||
productboardName: string | null | ||
productboardPluginId: UUID | null | ||
productboardUrl: string | null | ||
projectIds: number[] | ||
requestedById: UUID | ||
started: boolean | ||
startedAt: string | null | ||
startedAtOverride: string | null | ||
stats: object | ||
storiesWithoutProjects: number | ||
updatedAt: string | null | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import ShortcutResource from '@sx/base-resource' | ||
import IterationInterface from '@sx/iterations/contracts/iteration-interface' | ||
import Member from '@sx/members/member' | ||
import MembersService from '@sx/members/members-service' | ||
import Team from '@sx/teams/team' | ||
import TeamService from '@sx/teams/team-service' | ||
import {getHeaders} from '@sx/utils/headers' | ||
import UUID from '@sx/utils/uuid' | ||
|
||
|
||
export default class Epic extends ShortcutResource { | ||
public static baseUrl: string = 'https://api.app.shortcut.com/api/v3/epics' | ||
|
||
constructor(init: IterationInterface | object) { | ||
super() | ||
Object.assign(this, init) | ||
this.changedFields = [] | ||
} | ||
|
||
/** | ||
* Get the teams assigned to the story, labelled as "Group" in the Shortcut API | ||
* @returns {Promise<Team>} | ||
*/ | ||
get teams(): Promise<Team[]> { | ||
const service = new TeamService({headers: getHeaders()}) | ||
return service.getMany(this.groupIds) | ||
} | ||
|
||
/** | ||
* Get the members following the epic | ||
* @returns {Promise<Member[]>} | ||
*/ | ||
get followers(): Promise<Member[]> { | ||
const service: MembersService = new MembersService({headers: getHeaders()}) | ||
return service.getMany(this.followerIds) | ||
} | ||
|
||
appUrl!: string | ||
archived!: boolean | ||
associatedGroups!: [] | ||
completed!: boolean | ||
completedAt!: string | null | ||
completedAtOverride!: string | null | ||
deadline!: string | null | ||
description!: string | ||
entityType!: string | ||
epicStateId!: number | ||
externalId!: string | null | ||
followerIds!: UUID[] | ||
groupIds!: UUID[] | ||
id!: number | ||
labelIds!: number[] | ||
labels!: [] | ||
memberMentionIds!: UUID[] | ||
mentionIds!: UUID[] | ||
milestoneId!: number | null | ||
name!: string | ||
objectiveIds!: number[] | ||
ownerIds!: UUID[] | ||
plannedStartDate!: string | null | ||
position!: number | ||
productboardId!: UUID | null | ||
productboardName!: string | null | ||
productboardPluginId!: UUID | null | ||
productboardUrl!: string | null | ||
projectIds!: number[] | ||
requestedById!: UUID | ||
started!: boolean | ||
startedAt!: string | null | ||
startedAtOverride!: string | null | ||
stats!: object | ||
storiesWithoutProjects!: number | ||
updatedAt!: string | null | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import BaseService from '@sx/base-service' | ||
import Epic from '@sx/epics/epic' | ||
import UUID from '@sx/utils/uuid' | ||
|
||
|
||
export default class EpicsService extends BaseService<Epic> { | ||
public baseUrl = 'https://api.app.shortcut.com/api/v3/epics' | ||
protected factory = (data: object) => new Epic(data) | ||
public static epics: Record<number, Epic> = {} | ||
|
||
} |
This file was deleted.