@hardlydifficult/task-list 1.0.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.
package/README.md ADDED
@@ -0,0 +1,128 @@
1
+ # @hardlydifficult/task-list
2
+
3
+ Provider-agnostic task list management. One API for Trello, Linear, and future providers — switch by changing config.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @hardlydifficult/task-list
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```typescript
14
+ import { createTaskListClient } from "@hardlydifficult/task-list";
15
+
16
+ const client = createTaskListClient({ type: "trello" });
17
+
18
+ // Get all boards with full state
19
+ const state = await client.getBoards();
20
+
21
+ // Chainable lookups
22
+ const list = state.findBoard("My Project").findList("To Do");
23
+ const label = state.findBoard("My Project").findLabel("Bug");
24
+
25
+ // Create a task
26
+ const task = await list.createTask("Fix login page", {
27
+ description: "Users can't log in on mobile",
28
+ labels: [label],
29
+ });
30
+
31
+ // Update a task
32
+ await task.update({ name: "Fixed login page" });
33
+
34
+ // Move to another list
35
+ const doneList = state.findBoard("My Project").findList("Done");
36
+ await task.update({ list: doneList });
37
+ ```
38
+
39
+ ## API
40
+
41
+ ### `createTaskListClient(config)`
42
+
43
+ Factory function — returns a `TaskListClient` based on config type.
44
+
45
+ ```typescript
46
+ // Trello (uses TRELLO_API_KEY / TRELLO_API_TOKEN env vars by default)
47
+ const client = createTaskListClient({ type: "trello" });
48
+
49
+ // Explicit credentials
50
+ const client = createTaskListClient({
51
+ type: "trello",
52
+ apiKey: "your-key",
53
+ token: "your-token",
54
+ });
55
+ ```
56
+
57
+ ### `TaskListClient`
58
+
59
+ | Method | Returns | Description |
60
+ |--------|---------|-------------|
61
+ | `getBoards()` | `FullState` | All boards with lists, tasks, and labels |
62
+ | `getBoard(boardId)` | `BoardState` | Single board with lists, tasks, and labels |
63
+ | `getTask(taskId)` | `Task` | Single task by ID |
64
+
65
+ ### `FullState`
66
+
67
+ | Method | Returns | Description |
68
+ |--------|---------|-------------|
69
+ | `findBoard(name)` | `BoardState` | Find by name (case-insensitive partial match) |
70
+ | `findTask(taskId)` | `Task` | Find task by ID across all boards |
71
+
72
+ ### `BoardState`
73
+
74
+ | Property | Type | Description |
75
+ |----------|------|-------------|
76
+ | `board` | `Board` | Board info (id, name, url) |
77
+ | `lists` | `TaskList[]` | All lists on the board |
78
+ | `tasks` | `Task[]` | All tasks on the board |
79
+ | `labels` | `Label[]` | All labels on the board |
80
+
81
+ | Method | Returns | Description |
82
+ |--------|---------|-------------|
83
+ | `findList(name)` | `TaskList` | Find by name (case-insensitive partial match) |
84
+ | `findTask(taskId)` | `Task` | Find task by ID |
85
+ | `findLabel(name)` | `Label` | Find by name (case-insensitive partial match) |
86
+
87
+ ### `TaskList`
88
+
89
+ | Method | Returns | Description |
90
+ |--------|---------|-------------|
91
+ | `createTask(name, options?)` | `Task` | Create a task in this list |
92
+
93
+ Options: `{ description?: string, labels?: Label[] }`
94
+
95
+ ### `Task`
96
+
97
+ | Property | Type |
98
+ |----------|------|
99
+ | `id` | `string` |
100
+ | `name` | `string` |
101
+ | `description` | `string` |
102
+ | `listId` | `string` |
103
+ | `boardId` | `string` |
104
+ | `labels` | `Label[]` |
105
+ | `url` | `string` |
106
+
107
+ | Method | Returns | Description |
108
+ |--------|---------|-------------|
109
+ | `update(params)` | `Task` | Update and return new Task with server state |
110
+
111
+ Params: `{ name?: string, description?: string, list?: TaskList, labels?: Label[] }`
112
+
113
+ ## Switching Providers
114
+
115
+ Change the config — zero client code changes:
116
+
117
+ ```typescript
118
+ // Before
119
+ const client = createTaskListClient({ type: "trello" });
120
+
121
+ // After
122
+ const client = createTaskListClient({ type: "linear" });
123
+ ```
124
+
125
+ ## Supported Providers
126
+
127
+ - **Trello** — fully implemented
128
+ - **Linear** — coming soon
@@ -0,0 +1,36 @@
1
+ import type { Task } from "./Task.js";
2
+ import type { TaskList } from "./TaskList.js";
3
+ import type { Board, Label } from "./types.js";
4
+ /**
5
+ * Full state of a single board: board info, lists, tasks, and labels.
6
+ * Provides chainable finder methods that throw on not found.
7
+ */
8
+ export declare class BoardState {
9
+ readonly board: Board;
10
+ readonly lists: readonly TaskList[];
11
+ readonly tasks: readonly Task[];
12
+ readonly labels: readonly Label[];
13
+ constructor(board: Board, lists: readonly TaskList[], tasks: readonly Task[], labels: readonly Label[]);
14
+ /**
15
+ * Find a list by name (case-insensitive partial match)
16
+ * @param name - Partial list name to search for
17
+ * @returns The matching TaskList
18
+ * @throws Error if no list matches
19
+ */
20
+ findList(name: string): TaskList;
21
+ /**
22
+ * Find a task by ID
23
+ * @param taskId - Task ID to find
24
+ * @returns The matching Task
25
+ * @throws Error if no task matches
26
+ */
27
+ findTask(taskId: string): Task;
28
+ /**
29
+ * Find a label by name (case-insensitive partial match)
30
+ * @param name - Partial label name to search for
31
+ * @returns The matching Label
32
+ * @throws Error if no label matches
33
+ */
34
+ findLabel(name: string): Label;
35
+ }
36
+ //# sourceMappingURL=BoardState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BoardState.d.ts","sourceRoot":"","sources":["../src/BoardState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAE/C;;;GAGG;AACH,qBAAa,UAAU;IACrB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;gBAGhC,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,SAAS,QAAQ,EAAE,EAC1B,KAAK,EAAE,SAAS,IAAI,EAAE,EACtB,MAAM,EAAE,SAAS,KAAK,EAAE;IAQ1B;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ;IAShC;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAU9B;;;;;OAKG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK;CAU/B"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BoardState = void 0;
4
+ /**
5
+ * Full state of a single board: board info, lists, tasks, and labels.
6
+ * Provides chainable finder methods that throw on not found.
7
+ */
8
+ class BoardState {
9
+ board;
10
+ lists;
11
+ tasks;
12
+ labels;
13
+ constructor(board, lists, tasks, labels) {
14
+ this.board = board;
15
+ this.lists = lists;
16
+ this.tasks = tasks;
17
+ this.labels = labels;
18
+ }
19
+ /**
20
+ * Find a list by name (case-insensitive partial match)
21
+ * @param name - Partial list name to search for
22
+ * @returns The matching TaskList
23
+ * @throws Error if no list matches
24
+ */
25
+ findList(name) {
26
+ const lower = name.toLowerCase();
27
+ const list = this.lists.find((l) => l.name.toLowerCase().includes(lower));
28
+ if (!list) {
29
+ throw new Error(`List "${name}" not found on board "${this.board.name}"`);
30
+ }
31
+ return list;
32
+ }
33
+ /**
34
+ * Find a task by ID
35
+ * @param taskId - Task ID to find
36
+ * @returns The matching Task
37
+ * @throws Error if no task matches
38
+ */
39
+ findTask(taskId) {
40
+ const task = this.tasks.find((t) => t.id === taskId);
41
+ if (!task) {
42
+ throw new Error(`Task "${taskId}" not found on board "${this.board.name}"`);
43
+ }
44
+ return task;
45
+ }
46
+ /**
47
+ * Find a label by name (case-insensitive partial match)
48
+ * @param name - Partial label name to search for
49
+ * @returns The matching Label
50
+ * @throws Error if no label matches
51
+ */
52
+ findLabel(name) {
53
+ const lower = name.toLowerCase();
54
+ const label = this.labels.find((l) => l.name.toLowerCase().includes(lower));
55
+ if (!label) {
56
+ throw new Error(`Label "${name}" not found on board "${this.board.name}"`);
57
+ }
58
+ return label;
59
+ }
60
+ }
61
+ exports.BoardState = BoardState;
62
+ //# sourceMappingURL=BoardState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BoardState.js","sourceRoot":"","sources":["../src/BoardState.ts"],"names":[],"mappings":";;;AAIA;;;GAGG;AACH,MAAa,UAAU;IACZ,KAAK,CAAQ;IACb,KAAK,CAAsB;IAC3B,KAAK,CAAkB;IACvB,MAAM,CAAmB;IAElC,YACE,KAAY,EACZ,KAA0B,EAC1B,KAAsB,EACtB,MAAwB;QAExB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,IAAY;QACnB,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1E,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,SAAS,IAAI,yBAAyB,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;QAC5E,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,MAAc;QACrB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC;QACrD,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CACb,SAAS,MAAM,yBAAyB,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAC3D,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,IAAY;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QAC5E,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CACb,UAAU,IAAI,yBAAyB,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAC1D,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAjED,gCAiEC"}
@@ -0,0 +1,33 @@
1
+ import type { BoardState } from "./BoardState.js";
2
+ import type { Task } from "./Task.js";
3
+ /**
4
+ * Full state across all boards.
5
+ * Provides chainable finder methods that throw on not found.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * const state = await client.getBoards();
10
+ * const list = state.findBoard("Alpha").findList("To Do");
11
+ * const task = await list.createTask("New task");
12
+ * ```
13
+ */
14
+ export declare class FullState {
15
+ readonly boards: readonly BoardState[];
16
+ constructor(boards: readonly BoardState[]);
17
+ /**
18
+ * Find a board by name (case-insensitive partial match).
19
+ * Returns a BoardState, enabling chaining: `state.findBoard("X").findList("Y")`
20
+ * @param name - Partial board name to search for
21
+ * @returns The matching BoardState
22
+ * @throws Error if no board matches
23
+ */
24
+ findBoard(name: string): BoardState;
25
+ /**
26
+ * Find a task by ID across all boards
27
+ * @param taskId - Task ID to find
28
+ * @returns The matching Task
29
+ * @throws Error if no task matches on any board
30
+ */
31
+ findTask(taskId: string): Task;
32
+ }
33
+ //# sourceMappingURL=FullState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FullState.d.ts","sourceRoot":"","sources":["../src/FullState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC;;;;;;;;;;GAUG;AACH,qBAAa,SAAS;IACpB,QAAQ,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC;gBAE3B,MAAM,EAAE,SAAS,UAAU,EAAE;IAIzC;;;;;;OAMG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU;IAWnC;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAS/B"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FullState = void 0;
4
+ /**
5
+ * Full state across all boards.
6
+ * Provides chainable finder methods that throw on not found.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * const state = await client.getBoards();
11
+ * const list = state.findBoard("Alpha").findList("To Do");
12
+ * const task = await list.createTask("New task");
13
+ * ```
14
+ */
15
+ class FullState {
16
+ boards;
17
+ constructor(boards) {
18
+ this.boards = boards;
19
+ }
20
+ /**
21
+ * Find a board by name (case-insensitive partial match).
22
+ * Returns a BoardState, enabling chaining: `state.findBoard("X").findList("Y")`
23
+ * @param name - Partial board name to search for
24
+ * @returns The matching BoardState
25
+ * @throws Error if no board matches
26
+ */
27
+ findBoard(name) {
28
+ const lower = name.toLowerCase();
29
+ const board = this.boards.find((b) => b.board.name.toLowerCase().includes(lower));
30
+ if (!board) {
31
+ throw new Error(`Board "${name}" not found`);
32
+ }
33
+ return board;
34
+ }
35
+ /**
36
+ * Find a task by ID across all boards
37
+ * @param taskId - Task ID to find
38
+ * @returns The matching Task
39
+ * @throws Error if no task matches on any board
40
+ */
41
+ findTask(taskId) {
42
+ for (const boardState of this.boards) {
43
+ const task = boardState.tasks.find((t) => t.id === taskId);
44
+ if (task) {
45
+ return task;
46
+ }
47
+ }
48
+ throw new Error(`Task "${taskId}" not found on any board`);
49
+ }
50
+ }
51
+ exports.FullState = FullState;
52
+ //# sourceMappingURL=FullState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FullState.js","sourceRoot":"","sources":["../src/FullState.ts"],"names":[],"mappings":";;;AAGA;;;;;;;;;;GAUG;AACH,MAAa,SAAS;IACX,MAAM,CAAwB;IAEvC,YAAY,MAA6B;QACvC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;OAMG;IACH,SAAS,CAAC,IAAY;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CACnC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAC3C,CAAC;QACF,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,UAAU,IAAI,aAAa,CAAC,CAAC;QAC/C,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,MAAc;QACrB,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACrC,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC;YAC3D,IAAI,IAAI,EAAE,CAAC;gBACT,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,SAAS,MAAM,0BAA0B,CAAC,CAAC;IAC7D,CAAC;CACF;AAxCD,8BAwCC"}
package/dist/Task.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ import type { Label, TaskData, TaskOperations, UpdateTaskParams } from "./types.js";
2
+ /**
3
+ * A task (Trello Card, Linear Issue) with update capability
4
+ */
5
+ export declare class Task {
6
+ readonly id: string;
7
+ readonly name: string;
8
+ readonly description: string;
9
+ readonly listId: string;
10
+ readonly boardId: string;
11
+ readonly labels: readonly Label[];
12
+ readonly url: string;
13
+ private readonly operations;
14
+ constructor(data: TaskData, operations: TaskOperations);
15
+ /**
16
+ * Update this task. Returns a new Task with the updated data.
17
+ * @param params - Fields to update
18
+ * @returns New Task reflecting the server state after update
19
+ */
20
+ update(params: UpdateTaskParams): Promise<Task>;
21
+ }
22
+ //# sourceMappingURL=Task.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Task.d.ts","sourceRoot":"","sources":["../src/Task.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,QAAQ,EACR,cAAc,EACd,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,qBAAa,IAAI;IACf,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAiB;gBAEhC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc;IAWtD;;;;OAIG;IACG,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAUtD"}
package/dist/Task.js ADDED
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Task = void 0;
4
+ /**
5
+ * A task (Trello Card, Linear Issue) with update capability
6
+ */
7
+ class Task {
8
+ id;
9
+ name;
10
+ description;
11
+ listId;
12
+ boardId;
13
+ labels;
14
+ url;
15
+ operations;
16
+ constructor(data, operations) {
17
+ this.id = data.id;
18
+ this.name = data.name;
19
+ this.description = data.description;
20
+ this.listId = data.listId;
21
+ this.boardId = data.boardId;
22
+ this.labels = data.labels;
23
+ this.url = data.url;
24
+ this.operations = operations;
25
+ }
26
+ /**
27
+ * Update this task. Returns a new Task with the updated data.
28
+ * @param params - Fields to update
29
+ * @returns New Task reflecting the server state after update
30
+ */
31
+ async update(params) {
32
+ const data = await this.operations.updateTask(this.id, params.name, params.description, params.list?.id, params.labels?.map((l) => l.id));
33
+ return new Task(data, this.operations);
34
+ }
35
+ }
36
+ exports.Task = Task;
37
+ //# sourceMappingURL=Task.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Task.js","sourceRoot":"","sources":["../src/Task.ts"],"names":[],"mappings":";;;AAOA;;GAEG;AACH,MAAa,IAAI;IACN,EAAE,CAAS;IACX,IAAI,CAAS;IACb,WAAW,CAAS;IACpB,MAAM,CAAS;IACf,OAAO,CAAS;IAChB,MAAM,CAAmB;IACzB,GAAG,CAAS;IAEJ,UAAU,CAAiB;IAE5C,YAAY,IAAc,EAAE,UAA0B;QACpD,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,MAAwB;QACnC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAC3C,IAAI,CAAC,EAAE,EACP,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,IAAI,EAAE,EAAE,EACf,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAChC,CAAC;QACF,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;CACF;AArCD,oBAqCC"}
@@ -0,0 +1,20 @@
1
+ import { Task } from "./Task.js";
2
+ import type { CreateTaskOptions, TaskListData, TaskOperations } from "./types.js";
3
+ /**
4
+ * A task list (Trello List, Linear Status) with task creation capability
5
+ */
6
+ export declare class TaskList {
7
+ readonly id: string;
8
+ readonly name: string;
9
+ readonly boardId: string;
10
+ private readonly operations;
11
+ constructor(data: TaskListData, operations: TaskOperations);
12
+ /**
13
+ * Create a new task in this list
14
+ * @param name - Task name/title
15
+ * @param options - Optional description and labels
16
+ * @returns The created Task
17
+ */
18
+ createTask(name: string, options?: CreateTaskOptions): Promise<Task>;
19
+ }
20
+ //# sourceMappingURL=TaskList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaskList.d.ts","sourceRoot":"","sources":["../src/TaskList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,qBAAa,QAAQ;IACnB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAiB;gBAEhC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc;IAO1D;;;;;OAKG;IACG,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;CAS3E"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaskList = void 0;
4
+ const Task_js_1 = require("./Task.js");
5
+ /**
6
+ * A task list (Trello List, Linear Status) with task creation capability
7
+ */
8
+ class TaskList {
9
+ id;
10
+ name;
11
+ boardId;
12
+ operations;
13
+ constructor(data, operations) {
14
+ this.id = data.id;
15
+ this.name = data.name;
16
+ this.boardId = data.boardId;
17
+ this.operations = operations;
18
+ }
19
+ /**
20
+ * Create a new task in this list
21
+ * @param name - Task name/title
22
+ * @param options - Optional description and labels
23
+ * @returns The created Task
24
+ */
25
+ async createTask(name, options) {
26
+ const data = await this.operations.createTask(this.id, name, options?.description, options?.labels?.map((l) => l.id));
27
+ return new Task_js_1.Task(data, this.operations);
28
+ }
29
+ }
30
+ exports.TaskList = TaskList;
31
+ //# sourceMappingURL=TaskList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaskList.js","sourceRoot":"","sources":["../src/TaskList.ts"],"names":[],"mappings":";;;AAAA,uCAAiC;AAOjC;;GAEG;AACH,MAAa,QAAQ;IACV,EAAE,CAAS;IACX,IAAI,CAAS;IACb,OAAO,CAAS;IAER,UAAU,CAAiB;IAE5C,YAAY,IAAkB,EAAE,UAA0B;QACxD,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,UAAU,CAAC,IAAY,EAAE,OAA2B;QACxD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAC3C,IAAI,CAAC,EAAE,EACP,IAAI,EACJ,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAClC,CAAC;QACF,OAAO,IAAI,cAAI,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;CACF;AA7BD,4BA6BC"}
@@ -0,0 +1,30 @@
1
+ import type { BoardState } from "./BoardState.js";
2
+ import type { FullState } from "./FullState.js";
3
+ import type { Task } from "./Task.js";
4
+ import type { TaskListConfig } from "./types.js";
5
+ /**
6
+ * Abstract base class for task list platform clients.
7
+ * Provides a unified API for Trello, Linear, and future providers.
8
+ */
9
+ export declare abstract class TaskListClient {
10
+ protected readonly config: TaskListConfig;
11
+ constructor(config: TaskListConfig);
12
+ /**
13
+ * Get full state for all boards (boards, lists, tasks, labels)
14
+ * @returns FullState with chainable finders
15
+ */
16
+ abstract getBoards(): Promise<FullState>;
17
+ /**
18
+ * Get full state for a single board (lists, tasks, labels)
19
+ * @param boardId - Board identifier
20
+ * @returns BoardState with chainable finders
21
+ */
22
+ abstract getBoard(boardId: string): Promise<BoardState>;
23
+ /**
24
+ * Get a single task by ID
25
+ * @param taskId - Task identifier
26
+ * @returns Task with update capability
27
+ */
28
+ abstract getTask(taskId: string): Promise<Task>;
29
+ }
30
+ //# sourceMappingURL=TaskListClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaskListClient.d.ts","sourceRoot":"","sources":["../src/TaskListClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;GAGG;AACH,8BAAsB,cAAc;IACtB,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,cAAc;gBAAtB,MAAM,EAAE,cAAc;IAErD;;;OAGG;IACH,QAAQ,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC;IAExC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAEvD;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAChD"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaskListClient = void 0;
4
+ /**
5
+ * Abstract base class for task list platform clients.
6
+ * Provides a unified API for Trello, Linear, and future providers.
7
+ */
8
+ class TaskListClient {
9
+ config;
10
+ constructor(config) {
11
+ this.config = config;
12
+ }
13
+ }
14
+ exports.TaskListClient = TaskListClient;
15
+ //# sourceMappingURL=TaskListClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaskListClient.js","sourceRoot":"","sources":["../src/TaskListClient.ts"],"names":[],"mappings":";;;AAKA;;;GAGG;AACH,MAAsB,cAAc;IACH;IAA/B,YAA+B,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;IAAG,CAAC;CAqB1D;AAtBD,wCAsBC"}
@@ -0,0 +1,26 @@
1
+ export { type Board, type Label, type CreateTaskOptions, type UpdateTaskParams, type TrelloConfig, type LinearConfig, type TaskListConfig, type Provider, } from "./types.js";
2
+ export { TaskListClient } from "./TaskListClient.js";
3
+ export { Task } from "./Task.js";
4
+ export { TaskList } from "./TaskList.js";
5
+ export { BoardState } from "./BoardState.js";
6
+ export { FullState } from "./FullState.js";
7
+ export { TrelloTaskListClient } from "./trello";
8
+ import type { TaskListClient } from "./TaskListClient.js";
9
+ import type { TaskListConfig } from "./types.js";
10
+ /**
11
+ * Factory function to create a task list client based on config type
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * // Trello (uses env vars by default)
16
+ * const client = createTaskListClient({ type: 'trello' });
17
+ *
18
+ * // Usage
19
+ * const state = await client.getBoards();
20
+ * const list = state.findBoard("My Board").findList("To Do");
21
+ * const task = await list.createTask("New task");
22
+ * await task.update({ name: "Updated task" });
23
+ * ```
24
+ */
25
+ export declare function createTaskListClient(config: TaskListConfig): TaskListClient;
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,KAAK,EACV,KAAK,KAAK,EACV,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,QAAQ,GACd,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAW3E"}
package/dist/index.js ADDED
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TrelloTaskListClient = exports.FullState = exports.BoardState = exports.TaskList = exports.Task = exports.TaskListClient = void 0;
4
+ exports.createTaskListClient = createTaskListClient;
5
+ // Core classes
6
+ var TaskListClient_js_1 = require("./TaskListClient.js");
7
+ Object.defineProperty(exports, "TaskListClient", { enumerable: true, get: function () { return TaskListClient_js_1.TaskListClient; } });
8
+ var Task_js_1 = require("./Task.js");
9
+ Object.defineProperty(exports, "Task", { enumerable: true, get: function () { return Task_js_1.Task; } });
10
+ var TaskList_js_1 = require("./TaskList.js");
11
+ Object.defineProperty(exports, "TaskList", { enumerable: true, get: function () { return TaskList_js_1.TaskList; } });
12
+ var BoardState_js_1 = require("./BoardState.js");
13
+ Object.defineProperty(exports, "BoardState", { enumerable: true, get: function () { return BoardState_js_1.BoardState; } });
14
+ var FullState_js_1 = require("./FullState.js");
15
+ Object.defineProperty(exports, "FullState", { enumerable: true, get: function () { return FullState_js_1.FullState; } });
16
+ // Platform implementations
17
+ var trello_1 = require("./trello");
18
+ Object.defineProperty(exports, "TrelloTaskListClient", { enumerable: true, get: function () { return trello_1.TrelloTaskListClient; } });
19
+ const trello_2 = require("./trello");
20
+ /**
21
+ * Factory function to create a task list client based on config type
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * // Trello (uses env vars by default)
26
+ * const client = createTaskListClient({ type: 'trello' });
27
+ *
28
+ * // Usage
29
+ * const state = await client.getBoards();
30
+ * const list = state.findBoard("My Board").findList("To Do");
31
+ * const task = await list.createTask("New task");
32
+ * await task.update({ name: "Updated task" });
33
+ * ```
34
+ */
35
+ function createTaskListClient(config) {
36
+ switch (config.type) {
37
+ case "trello":
38
+ return new trello_2.TrelloTaskListClient(config);
39
+ case "linear":
40
+ throw new Error("Linear provider not yet implemented");
41
+ default:
42
+ throw new Error(`Unknown task list provider: ${config.type}`);
43
+ }
44
+ }
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AA0CA,oDAWC;AAzCD,eAAe;AACf,yDAAqD;AAA5C,mHAAA,cAAc,OAAA;AACvB,qCAAiC;AAAxB,+FAAA,IAAI,OAAA;AACb,6CAAyC;AAAhC,uGAAA,QAAQ,OAAA;AACjB,iDAA6C;AAApC,2GAAA,UAAU,OAAA;AACnB,+CAA2C;AAAlC,yGAAA,SAAS,OAAA;AAElB,2BAA2B;AAC3B,mCAAgD;AAAvC,8GAAA,oBAAoB,OAAA;AAI7B,qCAAgD;AAGhD;;;;;;;;;;;;;;GAcG;AACH,SAAgB,oBAAoB,CAAC,MAAsB;IACzD,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,QAAQ;YACX,OAAO,IAAI,6BAAoB,CAAC,MAAM,CAAC,CAAC;QAC1C,KAAK,QAAQ;YACX,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACzD;YACE,MAAM,IAAI,KAAK,CACb,+BAAgC,MAA2B,CAAC,IAAI,EAAE,CACnE,CAAC;IACN,CAAC;AACH,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { BoardState } from "../BoardState.js";
2
+ import { FullState } from "../FullState.js";
3
+ import { Task } from "../Task.js";
4
+ import { TaskListClient } from "../TaskListClient.js";
5
+ import type { TrelloConfig } from "../types.js";
6
+ /**
7
+ * Trello implementation of TaskListClient
8
+ */
9
+ export declare class TrelloTaskListClient extends TaskListClient {
10
+ private readonly apiKey;
11
+ private readonly token;
12
+ constructor(config: TrelloConfig);
13
+ private request;
14
+ private toBoard;
15
+ private toLabel;
16
+ private toTaskData;
17
+ private createOperations;
18
+ getBoards(): Promise<FullState>;
19
+ getBoard(boardId: string): Promise<BoardState>;
20
+ getTask(taskId: string): Promise<Task>;
21
+ }
22
+ //# sourceMappingURL=TrelloTaskListClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrelloTaskListClient.d.ts","sourceRoot":"","sources":["../../src/trello/TrelloTaskListClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAKV,YAAY,EACb,MAAM,aAAa,CAAC;AAmCrB;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,cAAc;IACtD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;gBAEnB,MAAM,EAAE,YAAY;YAMlB,OAAO;IA0BrB,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,UAAU;IAclB,OAAO,CAAC,gBAAgB;IAqDlB,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC;IA2B/B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAmB9C,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAK7C"}
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TrelloTaskListClient = void 0;
4
+ const BoardState_js_1 = require("../BoardState.js");
5
+ const FullState_js_1 = require("../FullState.js");
6
+ const Task_js_1 = require("../Task.js");
7
+ const TaskList_js_1 = require("../TaskList.js");
8
+ const TaskListClient_js_1 = require("../TaskListClient.js");
9
+ const TRELLO_API_BASE = "https://api.trello.com/1";
10
+ /**
11
+ * Trello implementation of TaskListClient
12
+ */
13
+ class TrelloTaskListClient extends TaskListClient_js_1.TaskListClient {
14
+ apiKey;
15
+ token;
16
+ constructor(config) {
17
+ super(config);
18
+ this.apiKey = config.apiKey ?? process.env.TRELLO_API_KEY ?? "";
19
+ this.token = config.token ?? process.env.TRELLO_API_TOKEN ?? "";
20
+ }
21
+ async request(path, options = {}) {
22
+ const url = new URL(`${TRELLO_API_BASE}${path}`);
23
+ url.searchParams.set("key", this.apiKey);
24
+ url.searchParams.set("token", this.token);
25
+ const response = await fetch(url.toString(), {
26
+ method: options.method,
27
+ body: options.body,
28
+ headers: {
29
+ "Content-Type": "application/json",
30
+ },
31
+ });
32
+ if (!response.ok) {
33
+ const text = await response.text();
34
+ throw new Error(`Trello API error: ${String(response.status)} ${text}`);
35
+ }
36
+ return response.json();
37
+ }
38
+ // --- Mappers: Trello API shapes → platform-agnostic types ---
39
+ toBoard(b) {
40
+ return { id: b.id, name: b.name, url: b.url };
41
+ }
42
+ toLabel(l) {
43
+ return { id: l.id, name: l.name, color: l.color };
44
+ }
45
+ toTaskData(c) {
46
+ return {
47
+ id: c.id,
48
+ name: c.name,
49
+ description: c.desc,
50
+ listId: c.idList,
51
+ boardId: c.idBoard,
52
+ labels: c.labels.map((l) => this.toLabel(l)),
53
+ url: c.url,
54
+ };
55
+ }
56
+ // --- Operations object wired into domain classes ---
57
+ createOperations() {
58
+ return {
59
+ createTask: async (listId, name, description, labelIds) => {
60
+ const body = { name, idList: listId };
61
+ if (description !== undefined) {
62
+ body.desc = description;
63
+ }
64
+ if (labelIds !== undefined && labelIds.length > 0) {
65
+ body.idLabels = labelIds.join(",");
66
+ }
67
+ const card = await this.request("/cards", {
68
+ method: "POST",
69
+ body: JSON.stringify(body),
70
+ });
71
+ return this.toTaskData(card);
72
+ },
73
+ updateTask: async (taskId, name, description, listId, labelIds) => {
74
+ const body = {};
75
+ if (name !== undefined) {
76
+ body.name = name;
77
+ }
78
+ if (description !== undefined) {
79
+ body.desc = description;
80
+ }
81
+ if (listId !== undefined) {
82
+ body.idList = listId;
83
+ }
84
+ if (labelIds !== undefined) {
85
+ body.idLabels = labelIds.join(",");
86
+ }
87
+ const card = await this.request(`/cards/${taskId}`, {
88
+ method: "PUT",
89
+ body: JSON.stringify(body),
90
+ });
91
+ return this.toTaskData(card);
92
+ },
93
+ };
94
+ }
95
+ // --- Abstract method implementations ---
96
+ async getBoards() {
97
+ const ops = this.createOperations();
98
+ const trelloBoards = await this.request("/members/me/boards");
99
+ const boardStates = await Promise.all(trelloBoards.map(async (tb) => {
100
+ const [lists, cards, labels] = await Promise.all([
101
+ this.request(`/boards/${tb.id}/lists`),
102
+ this.request(`/boards/${tb.id}/cards`),
103
+ this.request(`/boards/${tb.id}/labels`),
104
+ ]);
105
+ return new BoardState_js_1.BoardState(this.toBoard(tb), lists.map((l) => new TaskList_js_1.TaskList({ id: l.id, name: l.name, boardId: l.idBoard }, ops)), cards.map((c) => new Task_js_1.Task(this.toTaskData(c), ops)), labels.map((l) => this.toLabel(l)));
106
+ }));
107
+ return new FullState_js_1.FullState(boardStates);
108
+ }
109
+ async getBoard(boardId) {
110
+ const ops = this.createOperations();
111
+ const [tb, trelloLists, trelloCards, trelloLabels] = await Promise.all([
112
+ this.request(`/boards/${boardId}`),
113
+ this.request(`/boards/${boardId}/lists`),
114
+ this.request(`/boards/${boardId}/cards`),
115
+ this.request(`/boards/${boardId}/labels`),
116
+ ]);
117
+ return new BoardState_js_1.BoardState(this.toBoard(tb), trelloLists.map((l) => new TaskList_js_1.TaskList({ id: l.id, name: l.name, boardId: l.idBoard }, ops)), trelloCards.map((c) => new Task_js_1.Task(this.toTaskData(c), ops)), trelloLabels.map((l) => this.toLabel(l)));
118
+ }
119
+ async getTask(taskId) {
120
+ const ops = this.createOperations();
121
+ const card = await this.request(`/cards/${taskId}`);
122
+ return new Task_js_1.Task(this.toTaskData(card), ops);
123
+ }
124
+ }
125
+ exports.TrelloTaskListClient = TrelloTaskListClient;
126
+ //# sourceMappingURL=TrelloTaskListClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrelloTaskListClient.js","sourceRoot":"","sources":["../../src/trello/TrelloTaskListClient.ts"],"names":[],"mappings":";;;A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URL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/trello/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TrelloTaskListClient = void 0;
4
+ var TrelloTaskListClient_js_1 = require("./TrelloTaskListClient.js");
5
+ Object.defineProperty(exports, "TrelloTaskListClient", { enumerable: true, get: function () { return TrelloTaskListClient_js_1.TrelloTaskListClient; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/trello/index.ts"],"names":[],"mappings":";;;AAAA,qEAAiE;AAAxD,+HAAA,oBAAoB,OAAA"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Configuration for Trello provider
3
+ */
4
+ export interface TrelloConfig {
5
+ type: "trello";
6
+ apiKey?: string;
7
+ token?: string;
8
+ }
9
+ /**
10
+ * Configuration for Linear provider
11
+ */
12
+ export interface LinearConfig {
13
+ type: "linear";
14
+ apiKey?: string;
15
+ }
16
+ export type TaskListConfig = TrelloConfig | LinearConfig;
17
+ /**
18
+ * Provider identifier
19
+ */
20
+ export type Provider = "trello" | "linear";
21
+ /**
22
+ * A project board (Trello Board, Linear Project)
23
+ */
24
+ export interface Board {
25
+ readonly id: string;
26
+ readonly name: string;
27
+ readonly url: string;
28
+ }
29
+ /**
30
+ * A label/tag on a task
31
+ */
32
+ export interface Label {
33
+ readonly id: string;
34
+ readonly name: string;
35
+ readonly color: string;
36
+ }
37
+ /**
38
+ * Options for creating a task (passed to TaskList.createTask)
39
+ */
40
+ export interface CreateTaskOptions {
41
+ readonly description?: string | undefined;
42
+ readonly labels?: readonly Label[] | undefined;
43
+ }
44
+ /**
45
+ * Parameters for updating a task (passed to Task.update)
46
+ */
47
+ export interface UpdateTaskParams {
48
+ readonly name?: string | undefined;
49
+ readonly description?: string | undefined;
50
+ readonly list?: {
51
+ readonly id: string;
52
+ } | undefined;
53
+ readonly labels?: readonly Label[] | undefined;
54
+ }
55
+ /**
56
+ * Internal raw task data returned by provider operations
57
+ * @internal
58
+ */
59
+ export interface TaskData {
60
+ readonly id: string;
61
+ readonly name: string;
62
+ readonly description: string;
63
+ readonly listId: string;
64
+ readonly boardId: string;
65
+ readonly labels: readonly Label[];
66
+ readonly url: string;
67
+ }
68
+ /**
69
+ * Internal raw task list data returned by provider operations
70
+ * @internal
71
+ */
72
+ export interface TaskListData {
73
+ readonly id: string;
74
+ readonly name: string;
75
+ readonly boardId: string;
76
+ }
77
+ /**
78
+ * Internal interface for provider-specific task operations
79
+ * @internal
80
+ */
81
+ export interface TaskOperations {
82
+ createTask(listId: string, name: string, description?: string, labelIds?: readonly string[]): Promise<TaskData>;
83
+ updateTask(taskId: string, name?: string, description?: string, listId?: string, labelIds?: readonly string[]): Promise<TaskData>;
84
+ }
85
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,YAAY,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAA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IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,CACR,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,MAAM,EACpB,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,GAC3B,OAAO,CAAC,QAAQ,CAAC,CAAC;IAErB,UAAU,CACR,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,GAC3B,OAAO,CAAC,QAAQ,CAAC,CAAC;CACtB"}
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@hardlydifficult/task-list",
3
+ "version": "1.0.0",
4
+ "main": "./dist/index.js",
5
+ "types": "./dist/index.d.ts",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "scripts": {
10
+ "build": "tsc",
11
+ "test": "vitest run",
12
+ "test:watch": "vitest",
13
+ "test:coverage": "vitest run --coverage",
14
+ "lint": "tsc --noEmit",
15
+ "clean": "rm -rf dist"
16
+ },
17
+ "devDependencies": {
18
+ "@types/node": "20.19.31",
19
+ "typescript": "5.8.3",
20
+ "vitest": "1.6.1"
21
+ }
22
+ }