@plandesk/api 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,6 +35,19 @@ export type ListTasksFilter = {
35
35
  status?: string;
36
36
  };
37
37
  export declare function createTaskService(deps: TaskServiceDeps): {
38
+ get(id: string): {
39
+ id: string;
40
+ project_id: string;
41
+ label: string;
42
+ status: "scope" | "todo" | "in_progress" | "done" | "backlog";
43
+ description: string | null;
44
+ x: number;
45
+ y: number;
46
+ assignee: string | null;
47
+ due_date: string | null;
48
+ created_at: string;
49
+ updated_at: string;
50
+ } | undefined;
38
51
  listByProject(projectId: string, filter?: ListTasksFilter, pagination?: PaginationParams): {
39
52
  id: string;
40
53
  project_id: string;
@@ -13,6 +13,13 @@ function prerequisiteAndDependent(edge) {
13
13
  export function createTaskService(deps) {
14
14
  const { db, eventBus } = deps;
15
15
  return {
16
+ get(id) {
17
+ const task = getTask(db, id);
18
+ if (!task) {
19
+ return undefined;
20
+ }
21
+ return serializeTask(task);
22
+ },
16
23
  listByProject(projectId, filter = {}, pagination = {}) {
17
24
  if (filter.status !== undefined && !isTaskStatus(filter.status)) {
18
25
  throw new InvalidTaskStatusError(filter.status);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plandesk/api",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {