-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d3fe0c
commit 275bef5
Showing
9 changed files
with
115 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import BaseData from '@sx/base-data' | ||
|
||
export default interface LabelApiData extends BaseData { | ||
app_url: string | ||
archived: boolean | ||
color: string | null | ||
created_at: string | null | ||
description: string | null | ||
entity_type: string | ||
external_id: string | null | ||
id: number | ||
name: string | ||
stats: object[] | ||
updated_at: string | null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import BaseCreateData from '@sx/base-create-data' | ||
|
||
export default interface LabelCreateData extends BaseCreateData { | ||
color: string | null | ||
description: string | null | ||
externalId: string | null | ||
name: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import BaseInterface from '@sx/base-interface' | ||
|
||
export default interface LabelInterface extends BaseInterface { | ||
appUrl: string | ||
archived: boolean | ||
color: string | null | ||
createdAt: string | null | ||
description: string | null | ||
entityType: string | ||
externalId: string | null | ||
id: number | ||
name: string | ||
stats: object[] | ||
updatedAt: string | null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import ShortcutResource from '@sx/base-resource' | ||
import LabelInterface from '@sx/labels/contracts/label-interface' | ||
|
||
|
||
export default class Label extends ShortcutResource { | ||
public static baseUrl: string = 'https://api.shortcut.com/api/v3/labels' | ||
public createFields = ['color', 'description', 'externalId', 'name'] | ||
|
||
constructor(init: LabelInterface | object) { | ||
super() | ||
Object.assign(this, init) | ||
this.changedFields = [] | ||
} | ||
|
||
appUrl!: string | ||
archived!: boolean | ||
color!: string | null | ||
createdAt!: string | null | ||
description!: string | null | ||
entityType!: string | ||
externalId!: string | null | ||
id!: number | ||
name!: string | ||
stats!: object[] | ||
updatedAt!: string | null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import BaseService from '@sx/base-service' | ||
import Label from '@sx/labels/label' | ||
|
||
|
||
export default class LabelsService extends BaseService<Label> { | ||
public static baseUrl: string = 'https://api.shortcut.com/api/v3/labels' | ||
protected factory = (data: object) => new Label(data) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters