agkan 2.5.0 → 2.7.1
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/dist/board/server.d.ts.map +1 -1
- package/dist/board/server.js +285 -8
- package/dist/board/server.js.map +1 -1
- package/dist/cli/commands/comment/delete.js +1 -1
- package/dist/cli/commands/comment/delete.js.map +1 -1
- package/dist/cli/commands/comment/list.js +2 -2
- package/dist/cli/commands/comment/list.js.map +1 -1
- package/dist/cli/commands/task/find.d.ts.map +1 -1
- package/dist/cli/commands/task/find.js +31 -15
- package/dist/cli/commands/task/find.js.map +1 -1
- package/dist/cli/commands/task/get.d.ts.map +1 -1
- package/dist/cli/commands/task/get.js +23 -0
- package/dist/cli/commands/task/get.js.map +1 -1
- package/dist/cli/commands/task/list.d.ts.map +1 -1
- package/dist/cli/commands/task/list.js +27 -12
- package/dist/cli/commands/task/list.js.map +1 -1
- package/dist/cli/index.js +8 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/db/schema.js +19 -0
- package/dist/db/schema.js.map +1 -1
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.d.ts.map +1 -1
- package/dist/services/TaskService.d.ts +2 -1
- package/dist/services/TaskService.d.ts.map +1 -1
- package/dist/services/TaskService.js +10 -2
- package/dist/services/TaskService.js.map +1 -1
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +3 -1
- package/dist/services/index.js.map +1 -1
- package/dist/utils/input-validators.d.ts +7 -0
- package/dist/utils/input-validators.d.ts.map +1 -1
- package/dist/utils/input-validators.js +30 -0
- package/dist/utils/input-validators.js.map +1 -1
- package/package.json +2 -2
- package/dist/models/Attachment.d.ts +0 -25
- package/dist/models/Attachment.d.ts.map +0 -1
- package/dist/models/Attachment.js +0 -7
- package/dist/models/Attachment.js.map +0 -1
- package/dist/services/AttachmentService.d.ts +0 -62
- package/dist/services/AttachmentService.d.ts.map +0 -1
- package/dist/services/AttachmentService.js +0 -95
- package/dist/services/AttachmentService.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-validators.js","sourceRoot":"","sources":["../../src/utils/input-validators.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"input-validators.js","sourceRoot":"","sources":["../../src/utils/input-validators.ts"],"names":[],"mappings":";;AAsBA,8CAyCC;AAOD,0DA2CC;AAiBD,4DAqBC;AAOD,oDAyBC;AAED,4CAsBC;AA9LD;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,KAAsB;IACtD,MAAM,MAAM,GAAsB,EAAE,CAAC;IAErC,2CAA2C;IAC3C,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpD,MAAM,CAAC,IAAI,CAAC;YACV,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,mBAAmB;SAC7B,CAAC,CAAC;IACL,CAAC;SAAM,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;QACpC,MAAM,CAAC,IAAI,CAAC;YACV,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,sCAAsC;SAChD,CAAC,CAAC;IACL,CAAC;IAED,4CAA4C;IAC5C,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,EAAE,CAAC;QAC5C,MAAM,CAAC,IAAI,CAAC;YACV,KAAK,EAAE,MAAM;YACb,OAAO,EAAE,uCAAuC;SACjD,CAAC,CAAC;IACL,CAAC;IAED,4CAA4C;IAC5C,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;QAC9C,MAAM,CAAC,IAAI,CAAC;YACV,KAAK,EAAE,QAAQ;YACf,OAAO,EAAE,uCAAuC;SACjD,CAAC,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I,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;QAC3C,MAAM,CAAC,IAAI,CAAC;YACV,KAAK,EAAE,MAAM;YACb,OAAO,EAAE,mCAAmC;SAC7C,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agkan",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.1",
|
|
4
4
|
"description": "TypeScript-based CLI task management tool with SQLite storage",
|
|
5
5
|
"main": "dist/cli/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"type-check": "tsc --noEmit",
|
|
27
27
|
"check": "npm run type-check && npm run lint && npm run format:check",
|
|
28
28
|
"prepublishOnly": "npm run check && npm run build && vitest run",
|
|
29
|
-
"prepare": "husky || true"
|
|
29
|
+
"prepare": "husky || true && chmod +x node_modules/.bin/* node_modules/prettier/bin/*.cjs 2>/dev/null || true"
|
|
30
30
|
},
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Attachment model
|
|
3
|
-
* Type definitions for attachments
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Complete attachment type definition
|
|
7
|
-
* Represents an attachment retrieved from the database
|
|
8
|
-
*/
|
|
9
|
-
export interface Attachment {
|
|
10
|
-
id: number;
|
|
11
|
-
task_id: number;
|
|
12
|
-
file_name: string;
|
|
13
|
-
file_path: string;
|
|
14
|
-
created_at: string;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Attachment creation input type
|
|
18
|
-
* Excludes id and created_at as they are auto-generated
|
|
19
|
-
*/
|
|
20
|
-
export interface CreateAttachmentInput {
|
|
21
|
-
task_id: number;
|
|
22
|
-
file_name: string;
|
|
23
|
-
file_path: string;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=Attachment.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Attachment.d.ts","sourceRoot":"","sources":["../../src/models/Attachment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Attachment.js","sourceRoot":"","sources":["../../src/models/Attachment.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Attachment, CreateAttachmentInput } from '../models';
|
|
2
|
-
import Database from 'better-sqlite3';
|
|
3
|
-
/**
|
|
4
|
-
* Attachment Service
|
|
5
|
-
* Provides management of attachment records
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* **Future Feature**: This service is fully implemented but CLI commands are not yet available.
|
|
9
|
-
* See docs/planned-features.md for implementation timeline and planned CLI interface.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* const service = new AttachmentService();
|
|
14
|
-
* const attachment = service.createAttachment({
|
|
15
|
-
* task_id: 1,
|
|
16
|
-
* file_name: 'design.pdf',
|
|
17
|
-
* file_path: '/path/to/design.pdf'
|
|
18
|
-
* });
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export declare class AttachmentService {
|
|
22
|
-
private db;
|
|
23
|
-
constructor(db?: Database.Database);
|
|
24
|
-
/**
|
|
25
|
-
* Create a new attachment record
|
|
26
|
-
*
|
|
27
|
-
* @remarks
|
|
28
|
-
* **Future Feature**: CLI command not yet implemented.
|
|
29
|
-
* Planned command: `agkan task attach add <task-id> <file-path>`
|
|
30
|
-
*
|
|
31
|
-
* @param input - Attachment creation input
|
|
32
|
-
* @returns Created attachment record
|
|
33
|
-
* @throws Will throw if task_id does not exist (foreign key constraint)
|
|
34
|
-
*/
|
|
35
|
-
createAttachment(input: CreateAttachmentInput): Attachment;
|
|
36
|
-
/**
|
|
37
|
-
* Get attachments for a specific task
|
|
38
|
-
*
|
|
39
|
-
* @remarks
|
|
40
|
-
* **Future Feature**: CLI command not yet implemented.
|
|
41
|
-
* Planned command: `agkan task attach list <task-id>`
|
|
42
|
-
*
|
|
43
|
-
* @param taskId - Task ID
|
|
44
|
-
* @returns Array of attachments ordered by creation date (newest first)
|
|
45
|
-
*/
|
|
46
|
-
getAttachmentsByTaskId(taskId: number): Attachment[];
|
|
47
|
-
/**
|
|
48
|
-
* Delete an attachment record
|
|
49
|
-
*
|
|
50
|
-
* @remarks
|
|
51
|
-
* **Future Feature**: CLI command not yet implemented.
|
|
52
|
-
* Planned command: `agkan task attach delete <attachment-id>`
|
|
53
|
-
*
|
|
54
|
-
* @param id - Attachment ID
|
|
55
|
-
* @returns True if deletion succeeded, false if not found
|
|
56
|
-
*
|
|
57
|
-
* @todo Implement file deletion from filesystem
|
|
58
|
-
* @todo Add --keep-file option to CLI command
|
|
59
|
-
*/
|
|
60
|
-
deleteAttachment(id: number): boolean;
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=AttachmentService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentService.d.ts","sourceRoot":"","sources":["../../src/services/AttachmentService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAE9D,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,EAAE,CAAoB;gBAElB,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ;IAIlC;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,UAAU;IAoB1D;;;;;;;;;OASG;IACH,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE;IAOpD;;;;;;;;;;;;OAYG;IACH,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;CAetC"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AttachmentService = void 0;
|
|
4
|
-
const connection_1 = require("../db/connection");
|
|
5
|
-
/**
|
|
6
|
-
* Attachment Service
|
|
7
|
-
* Provides management of attachment records
|
|
8
|
-
*
|
|
9
|
-
* @remarks
|
|
10
|
-
* **Future Feature**: This service is fully implemented but CLI commands are not yet available.
|
|
11
|
-
* See docs/planned-features.md for implementation timeline and planned CLI interface.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```typescript
|
|
15
|
-
* const service = new AttachmentService();
|
|
16
|
-
* const attachment = service.createAttachment({
|
|
17
|
-
* task_id: 1,
|
|
18
|
-
* file_name: 'design.pdf',
|
|
19
|
-
* file_path: '/path/to/design.pdf'
|
|
20
|
-
* });
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
class AttachmentService {
|
|
24
|
-
constructor(db) {
|
|
25
|
-
this.db = db || (0, connection_1.getDatabase)();
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Create a new attachment record
|
|
29
|
-
*
|
|
30
|
-
* @remarks
|
|
31
|
-
* **Future Feature**: CLI command not yet implemented.
|
|
32
|
-
* Planned command: `agkan task attach add <task-id> <file-path>`
|
|
33
|
-
*
|
|
34
|
-
* @param input - Attachment creation input
|
|
35
|
-
* @returns Created attachment record
|
|
36
|
-
* @throws Will throw if task_id does not exist (foreign key constraint)
|
|
37
|
-
*/
|
|
38
|
-
createAttachment(input) {
|
|
39
|
-
const db = this.db;
|
|
40
|
-
const now = new Date().toISOString();
|
|
41
|
-
const stmt = db.prepare(`
|
|
42
|
-
INSERT INTO attachments (task_id, file_name, file_path, created_at)
|
|
43
|
-
VALUES (?, ?, ?, ?)
|
|
44
|
-
`);
|
|
45
|
-
const result = stmt.run(input.task_id, input.file_name, input.file_path, now);
|
|
46
|
-
return {
|
|
47
|
-
id: result.lastInsertRowid,
|
|
48
|
-
task_id: input.task_id,
|
|
49
|
-
file_name: input.file_name,
|
|
50
|
-
file_path: input.file_path,
|
|
51
|
-
created_at: now,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Get attachments for a specific task
|
|
56
|
-
*
|
|
57
|
-
* @remarks
|
|
58
|
-
* **Future Feature**: CLI command not yet implemented.
|
|
59
|
-
* Planned command: `agkan task attach list <task-id>`
|
|
60
|
-
*
|
|
61
|
-
* @param taskId - Task ID
|
|
62
|
-
* @returns Array of attachments ordered by creation date (newest first)
|
|
63
|
-
*/
|
|
64
|
-
getAttachmentsByTaskId(taskId) {
|
|
65
|
-
const db = this.db;
|
|
66
|
-
const stmt = db.prepare('SELECT * FROM attachments WHERE task_id = ? ORDER BY created_at DESC');
|
|
67
|
-
return stmt.all(taskId);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Delete an attachment record
|
|
71
|
-
*
|
|
72
|
-
* @remarks
|
|
73
|
-
* **Future Feature**: CLI command not yet implemented.
|
|
74
|
-
* Planned command: `agkan task attach delete <attachment-id>`
|
|
75
|
-
*
|
|
76
|
-
* @param id - Attachment ID
|
|
77
|
-
* @returns True if deletion succeeded, false if not found
|
|
78
|
-
*
|
|
79
|
-
* @todo Implement file deletion from filesystem
|
|
80
|
-
* @todo Add --keep-file option to CLI command
|
|
81
|
-
*/
|
|
82
|
-
deleteAttachment(id) {
|
|
83
|
-
const db = this.db;
|
|
84
|
-
const stmt = db.prepare('SELECT * FROM attachments WHERE id = ?');
|
|
85
|
-
const attachment = stmt.get(id);
|
|
86
|
-
if (!attachment) {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
const deleteStmt = db.prepare('DELETE FROM attachments WHERE id = ?');
|
|
90
|
-
deleteStmt.run(id);
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
exports.AttachmentService = AttachmentService;
|
|
95
|
-
//# sourceMappingURL=AttachmentService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentService.js","sourceRoot":"","sources":["../../src/services/AttachmentService.ts"],"names":[],"mappings":";;;AACA,iDAA+C;AAG/C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,iBAAiB;IAG5B,YAAY,EAAsB;QAChC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,IAAA,wBAAW,GAAE,CAAC;IAChC,CAAC;IAED;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,KAA4B;QAC3C,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACnB,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAErC,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC;;;KAGvB,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QAE9E,OAAO;YACL,EAAE,EAAE,MAAM,CAAC,eAAyB;YACpC,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,SAAS,EAAE,KAAK,CAAC,SAAS;YA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