agkan 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.ja.md +1127 -0
- package/README.md +1140 -0
- package/bin/agkan +2 -0
- package/dist/cli/commands/block/add.d.ts +6 -0
- package/dist/cli/commands/block/add.d.ts.map +1 -0
- package/dist/cli/commands/block/add.js +135 -0
- package/dist/cli/commands/block/add.js.map +1 -0
- package/dist/cli/commands/block/list.d.ts +6 -0
- package/dist/cli/commands/block/list.d.ts.map +1 -0
- package/dist/cli/commands/block/list.js +120 -0
- package/dist/cli/commands/block/list.js.map +1 -0
- package/dist/cli/commands/block/remove.d.ts +6 -0
- package/dist/cli/commands/block/remove.d.ts.map +1 -0
- package/dist/cli/commands/block/remove.js +117 -0
- package/dist/cli/commands/block/remove.js.map +1 -0
- package/dist/cli/commands/meta/delete.d.ts +6 -0
- package/dist/cli/commands/meta/delete.d.ts.map +1 -0
- package/dist/cli/commands/meta/delete.js +67 -0
- package/dist/cli/commands/meta/delete.js.map +1 -0
- package/dist/cli/commands/meta/get.d.ts +6 -0
- package/dist/cli/commands/meta/get.d.ts.map +1 -0
- package/dist/cli/commands/meta/get.js +71 -0
- package/dist/cli/commands/meta/get.js.map +1 -0
- package/dist/cli/commands/meta/list.d.ts +6 -0
- package/dist/cli/commands/meta/list.d.ts.map +1 -0
- package/dist/cli/commands/meta/list.js +69 -0
- package/dist/cli/commands/meta/list.js.map +1 -0
- package/dist/cli/commands/meta/set.d.ts +6 -0
- package/dist/cli/commands/meta/set.d.ts.map +1 -0
- package/dist/cli/commands/meta/set.js +85 -0
- package/dist/cli/commands/meta/set.js.map +1 -0
- package/dist/cli/commands/tag/add.d.ts +6 -0
- package/dist/cli/commands/tag/add.d.ts.map +1 -0
- package/dist/cli/commands/tag/add.js +99 -0
- package/dist/cli/commands/tag/add.js.map +1 -0
- package/dist/cli/commands/tag/attach.d.ts +6 -0
- package/dist/cli/commands/tag/attach.d.ts.map +1 -0
- package/dist/cli/commands/tag/attach.js +119 -0
- package/dist/cli/commands/tag/attach.js.map +1 -0
- package/dist/cli/commands/tag/delete.d.ts +6 -0
- package/dist/cli/commands/tag/delete.d.ts.map +1 -0
- package/dist/cli/commands/tag/delete.js +93 -0
- package/dist/cli/commands/tag/delete.js.map +1 -0
- package/dist/cli/commands/tag/detach.d.ts +6 -0
- package/dist/cli/commands/tag/detach.d.ts.map +1 -0
- package/dist/cli/commands/tag/detach.js +118 -0
- package/dist/cli/commands/tag/detach.js.map +1 -0
- package/dist/cli/commands/tag/list.d.ts +6 -0
- package/dist/cli/commands/tag/list.d.ts.map +1 -0
- package/dist/cli/commands/tag/list.js +80 -0
- package/dist/cli/commands/tag/list.js.map +1 -0
- package/dist/cli/commands/tag/show.d.ts +6 -0
- package/dist/cli/commands/tag/show.d.ts.map +1 -0
- package/dist/cli/commands/tag/show.js +88 -0
- package/dist/cli/commands/tag/show.js.map +1 -0
- package/dist/cli/commands/task/add-helpers.d.ts +17 -0
- package/dist/cli/commands/task/add-helpers.d.ts.map +1 -0
- package/dist/cli/commands/task/add-helpers.js +122 -0
- package/dist/cli/commands/task/add-helpers.js.map +1 -0
- package/dist/cli/commands/task/add.d.ts +6 -0
- package/dist/cli/commands/task/add.d.ts.map +1 -0
- package/dist/cli/commands/task/add.js +140 -0
- package/dist/cli/commands/task/add.js.map +1 -0
- package/dist/cli/commands/task/count.d.ts +6 -0
- package/dist/cli/commands/task/count.d.ts.map +1 -0
- package/dist/cli/commands/task/count.js +97 -0
- package/dist/cli/commands/task/count.js.map +1 -0
- package/dist/cli/commands/task/delete.d.ts +6 -0
- package/dist/cli/commands/task/delete.d.ts.map +1 -0
- package/dist/cli/commands/task/delete.js +59 -0
- package/dist/cli/commands/task/delete.js.map +1 -0
- package/dist/cli/commands/task/find.d.ts +7 -0
- package/dist/cli/commands/task/find.d.ts.map +1 -0
- package/dist/cli/commands/task/find.js +118 -0
- package/dist/cli/commands/task/find.js.map +1 -0
- package/dist/cli/commands/task/get.d.ts +6 -0
- package/dist/cli/commands/task/get.d.ts.map +1 -0
- package/dist/cli/commands/task/get.js +196 -0
- package/dist/cli/commands/task/get.js.map +1 -0
- package/dist/cli/commands/task/list.d.ts +6 -0
- package/dist/cli/commands/task/list.d.ts.map +1 -0
- package/dist/cli/commands/task/list.js +301 -0
- package/dist/cli/commands/task/list.js.map +1 -0
- package/dist/cli/commands/task/update-parent.d.ts +6 -0
- package/dist/cli/commands/task/update-parent.d.ts.map +1 -0
- package/dist/cli/commands/task/update-parent.js +123 -0
- package/dist/cli/commands/task/update-parent.js.map +1 -0
- package/dist/cli/commands/task/update.d.ts +6 -0
- package/dist/cli/commands/task/update.d.ts.map +1 -0
- package/dist/cli/commands/task/update.js +96 -0
- package/dist/cli/commands/task/update.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +68 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/utils/array-utils.d.ts +15 -0
- package/dist/cli/utils/array-utils.d.ts.map +1 -0
- package/dist/cli/utils/array-utils.js +20 -0
- package/dist/cli/utils/array-utils.js.map +1 -0
- package/dist/cli/utils/error-handler.d.ts +35 -0
- package/dist/cli/utils/error-handler.d.ts.map +1 -0
- package/dist/cli/utils/error-handler.js +84 -0
- package/dist/cli/utils/error-handler.js.map +1 -0
- package/dist/cli/utils/output-formatter.d.ts +34 -0
- package/dist/cli/utils/output-formatter.d.ts.map +1 -0
- package/dist/cli/utils/output-formatter.js +44 -0
- package/dist/cli/utils/output-formatter.js.map +1 -0
- package/dist/cli/utils/response-formatter.d.ts +19 -0
- package/dist/cli/utils/response-formatter.d.ts.map +1 -0
- package/dist/cli/utils/response-formatter.js +43 -0
- package/dist/cli/utils/response-formatter.js.map +1 -0
- package/dist/cli/utils/validators.d.ts +23 -0
- package/dist/cli/utils/validators.d.ts.map +1 -0
- package/dist/cli/utils/validators.js +47 -0
- package/dist/cli/utils/validators.js.map +1 -0
- package/dist/db/config.d.ts +27 -0
- package/dist/db/config.d.ts.map +1 -0
- package/dist/db/config.js +116 -0
- package/dist/db/config.js.map +1 -0
- package/dist/db/connection.d.ts +24 -0
- package/dist/db/connection.d.ts.map +1 -0
- package/dist/db/connection.js +62 -0
- package/dist/db/connection.js.map +1 -0
- package/dist/db/reset.d.ts +8 -0
- package/dist/db/reset.d.ts.map +1 -0
- package/dist/db/reset.js +33 -0
- package/dist/db/reset.js.map +1 -0
- package/dist/db/schema.d.ts +6 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +134 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/models/Attachment.d.ts +25 -0
- package/dist/models/Attachment.d.ts.map +1 -0
- package/dist/models/Attachment.js +7 -0
- package/dist/models/Attachment.js.map +1 -0
- package/dist/models/Tag.d.ts +24 -0
- package/dist/models/Tag.d.ts.map +1 -0
- package/dist/models/Tag.js +3 -0
- package/dist/models/Tag.js.map +1 -0
- package/dist/models/Task.d.ts +55 -0
- package/dist/models/Task.d.ts.map +1 -0
- package/dist/models/Task.js +7 -0
- package/dist/models/Task.js.map +1 -0
- package/dist/models/TaskBlock.d.ts +11 -0
- package/dist/models/TaskBlock.d.ts.map +1 -0
- package/dist/models/TaskBlock.js +3 -0
- package/dist/models/TaskBlock.js.map +1 -0
- package/dist/models/TaskMetadata.d.ts +30 -0
- package/dist/models/TaskMetadata.d.ts.map +1 -0
- package/dist/models/TaskMetadata.js +3 -0
- package/dist/models/TaskMetadata.js.map +1 -0
- package/dist/models/TaskTag.d.ts +11 -0
- package/dist/models/TaskTag.d.ts.map +1 -0
- package/dist/models/TaskTag.js +3 -0
- package/dist/models/TaskTag.js.map +1 -0
- package/dist/models/index.d.ts +10 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +7 -0
- package/dist/models/index.js.map +1 -0
- package/dist/services/AttachmentService.d.ts +62 -0
- package/dist/services/AttachmentService.d.ts.map +1 -0
- package/dist/services/AttachmentService.js +95 -0
- package/dist/services/AttachmentService.js.map +1 -0
- package/dist/services/FileService.d.ts +31 -0
- package/dist/services/FileService.d.ts.map +1 -0
- package/dist/services/FileService.js +77 -0
- package/dist/services/FileService.js.map +1 -0
- package/dist/services/MetadataService.d.ts +49 -0
- package/dist/services/MetadataService.d.ts.map +1 -0
- package/dist/services/MetadataService.js +126 -0
- package/dist/services/MetadataService.js.map +1 -0
- package/dist/services/TagService.d.ts +49 -0
- package/dist/services/TagService.d.ts.map +1 -0
- package/dist/services/TagService.js +127 -0
- package/dist/services/TagService.js.map +1 -0
- package/dist/services/TaskBlockService.d.ts +49 -0
- package/dist/services/TaskBlockService.d.ts.map +1 -0
- package/dist/services/TaskBlockService.js +118 -0
- package/dist/services/TaskBlockService.js.map +1 -0
- package/dist/services/TaskService.d.ts +89 -0
- package/dist/services/TaskService.d.ts.map +1 -0
- package/dist/services/TaskService.js +285 -0
- package/dist/services/TaskService.js.map +1 -0
- package/dist/services/TaskTagService.d.ts +66 -0
- package/dist/services/TaskTagService.d.ts.map +1 -0
- package/dist/services/TaskTagService.js +171 -0
- package/dist/services/TaskTagService.js.map +1 -0
- package/dist/services/index.d.ts +11 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +20 -0
- package/dist/services/index.js.map +1 -0
- package/dist/utils/cycle-detector.d.ts +14 -0
- package/dist/utils/cycle-detector.d.ts.map +1 -0
- package/dist/utils/cycle-detector.js +32 -0
- package/dist/utils/cycle-detector.js.map +1 -0
- package/dist/utils/format.d.ts +13 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/format.js +29 -0
- package/dist/utils/format.js.map +1 -0
- package/dist/utils/input-validators.d.ts +32 -0
- package/dist/utils/input-validators.d.ts.map +1 -0
- package/dist/utils/input-validators.js +108 -0
- package/dist/utils/input-validators.js.map +1 -0
- package/dist/utils/security.d.ts +11 -0
- package/dist/utils/security.d.ts.map +1 -0
- package/dist/utils/security.js +29 -0
- package/dist/utils/security.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Database from 'better-sqlite3';
|
|
2
|
+
/**
|
|
3
|
+
* Singleton management of database connection
|
|
4
|
+
*/
|
|
5
|
+
export declare class DatabaseConnection {
|
|
6
|
+
private static instance;
|
|
7
|
+
/**
|
|
8
|
+
* Get database instance (singleton)
|
|
9
|
+
*/
|
|
10
|
+
static getInstance(): Database.Database;
|
|
11
|
+
/**
|
|
12
|
+
* Initialize the database
|
|
13
|
+
*/
|
|
14
|
+
private static initialize;
|
|
15
|
+
/**
|
|
16
|
+
* Close database connection
|
|
17
|
+
*/
|
|
18
|
+
static close(): void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Convenience function to get database instance
|
|
22
|
+
*/
|
|
23
|
+
export declare function getDatabase(): Database.Database;
|
|
24
|
+
//# sourceMappingURL=connection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/db/connection.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAMtC;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAkC;IAEzD;;OAEG;WACW,WAAW,IAAI,QAAQ,CAAC,QAAQ;IAO9C;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAoBzB;;OAEG;WACW,KAAK,IAAI,IAAI;CAM5B;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAAC,QAAQ,CAE/C"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DatabaseConnection = void 0;
|
|
7
|
+
exports.getDatabase = getDatabase;
|
|
8
|
+
const better_sqlite3_1 = __importDefault(require("better-sqlite3"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const fs_1 = __importDefault(require("fs"));
|
|
11
|
+
const config_1 = require("./config");
|
|
12
|
+
const schema_1 = require("./schema");
|
|
13
|
+
/**
|
|
14
|
+
* Singleton management of database connection
|
|
15
|
+
*/
|
|
16
|
+
class DatabaseConnection {
|
|
17
|
+
/**
|
|
18
|
+
* Get database instance (singleton)
|
|
19
|
+
*/
|
|
20
|
+
static getInstance() {
|
|
21
|
+
if (!this.instance) {
|
|
22
|
+
this.initialize();
|
|
23
|
+
}
|
|
24
|
+
return this.instance;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Initialize the database
|
|
28
|
+
*/
|
|
29
|
+
static initialize() {
|
|
30
|
+
// Get database path from configuration file
|
|
31
|
+
const dbPath = (0, config_1.resolveDatabasePath)();
|
|
32
|
+
// Create data directory
|
|
33
|
+
const dataDir = path_1.default.dirname(dbPath);
|
|
34
|
+
if (!fs_1.default.existsSync(dataDir)) {
|
|
35
|
+
fs_1.default.mkdirSync(dataDir, { recursive: true });
|
|
36
|
+
}
|
|
37
|
+
// Create database connection
|
|
38
|
+
this.instance = new better_sqlite3_1.default(dbPath);
|
|
39
|
+
// Enable foreign key constraints
|
|
40
|
+
this.instance.pragma('foreign_keys = ON');
|
|
41
|
+
// Run migrations
|
|
42
|
+
(0, schema_1.runMigrations)(this.instance);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Close database connection
|
|
46
|
+
*/
|
|
47
|
+
static close() {
|
|
48
|
+
if (this.instance) {
|
|
49
|
+
this.instance.close();
|
|
50
|
+
this.instance = null;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.DatabaseConnection = DatabaseConnection;
|
|
55
|
+
DatabaseConnection.instance = null;
|
|
56
|
+
/**
|
|
57
|
+
* Convenience function to get database instance
|
|
58
|
+
*/
|
|
59
|
+
function getDatabase() {
|
|
60
|
+
return DatabaseConnection.getInstance();
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/db/connection.ts"],"names":[],"mappings":";;;;;;AA2DA,kCAEC;AA7DD,oEAAsC;AACtC,gDAAwB;AACxB,4CAAoB;AACpB,qCAA+C;AAC/C,qCAAyC;AAEzC;;GAEG;AACH,MAAa,kBAAkB;IAG7B;;OAEG;IACI,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC;QACD,OAAO,IAAI,CAAC,QAAS,CAAC;IACxB,CAAC;IAED;;OAEG;IACK,MAAM,CAAC,UAAU;QACvB,4CAA4C;QAC5C,MAAM,MAAM,GAAG,IAAA,4BAAmB,GAAE,CAAC;QAErC,wBAAwB;QACxB,MAAM,OAAO,GAAG,cAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACrC,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5B,YAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7C,CAAC;QAED,6BAA6B;QAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,wBAAQ,CAAC,MAAM,CAAC,CAAC;QAErC,iCAAiC;QACjC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;QAE1C,iBAAiB;QACjB,IAAA,sBAAa,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,KAAK;QACjB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YACtB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACvB,CAAC;IACH,CAAC;;AA5CH,gDA6CC;AA5CgB,2BAAQ,GAA6B,IAAI,CAAC;AA8C3D;;GAEG;AACH,SAAgB,WAAW;IACzB,OAAO,kBAAkB,CAAC,WAAW,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reset the database (delete and recreate)
|
|
3
|
+
* Ensures a clean state by calling before test execution
|
|
4
|
+
*
|
|
5
|
+
* @throws Error if called outside of test mode (NODE_ENV=test)
|
|
6
|
+
*/
|
|
7
|
+
export declare function resetDatabase(): void;
|
|
8
|
+
//# sourceMappingURL=reset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset.d.ts","sourceRoot":"","sources":["../../src/db/reset.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAsBpC"}
|
package/dist/db/reset.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.resetDatabase = resetDatabase;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const config_1 = require("./config");
|
|
9
|
+
const connection_1 = require("./connection");
|
|
10
|
+
/**
|
|
11
|
+
* Reset the database (delete and recreate)
|
|
12
|
+
* Ensures a clean state by calling before test execution
|
|
13
|
+
*
|
|
14
|
+
* @throws Error if called outside of test mode (NODE_ENV=test)
|
|
15
|
+
*/
|
|
16
|
+
function resetDatabase() {
|
|
17
|
+
// Safety guard: only allow database reset in test mode
|
|
18
|
+
if (!(0, config_1.isTestMode)()) {
|
|
19
|
+
throw new Error('resetDatabase() must only be called in test mode (NODE_ENV=test). ' +
|
|
20
|
+
'Calling this outside test mode risks deleting the production database.');
|
|
21
|
+
}
|
|
22
|
+
// Close existing connection
|
|
23
|
+
connection_1.DatabaseConnection.close();
|
|
24
|
+
// Database file path
|
|
25
|
+
const dbPath = (0, config_1.resolveDatabasePath)();
|
|
26
|
+
// Delete database file if it exists
|
|
27
|
+
if (fs_1.default.existsSync(dbPath)) {
|
|
28
|
+
fs_1.default.unlinkSync(dbPath);
|
|
29
|
+
}
|
|
30
|
+
// Initialize new database connection (schema is automatically created)
|
|
31
|
+
connection_1.DatabaseConnection.getInstance();
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=reset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset.js","sourceRoot":"","sources":["../../src/db/reset.ts"],"names":[],"mappings":";;;;;AAUA,sCAsBC;AAhCD,4CAAoB;AACpB,qCAA2D;AAC3D,6CAAkD;AAElD;;;;;GAKG;AACH,SAAgB,aAAa;IAC3B,uDAAuD;IACvD,IAAI,CAAC,IAAA,mBAAU,GAAE,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CACb,oEAAoE;YAClE,wEAAwE,CAC3E,CAAC;IACJ,CAAC;IAED,4BAA4B;IAC5B,+BAAkB,CAAC,KAAK,EAAE,CAAC;IAE3B,qBAAqB;IACrB,MAAM,MAAM,GAAG,IAAA,4BAAmB,GAAE,CAAC;IAErC,oCAAoC;IACpC,IAAI,YAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,YAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;IAED,uEAAuE;IACvE,+BAAkB,CAAC,WAAW,EAAE,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/db/schema.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAoJzD"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runMigrations = runMigrations;
|
|
4
|
+
/**
|
|
5
|
+
* Create database schema and run migrations
|
|
6
|
+
*/
|
|
7
|
+
function runMigrations(db) {
|
|
8
|
+
// Create tasks table
|
|
9
|
+
db.exec(`
|
|
10
|
+
CREATE TABLE IF NOT EXISTS tasks (
|
|
11
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
12
|
+
title TEXT NOT NULL,
|
|
13
|
+
body TEXT,
|
|
14
|
+
author TEXT,
|
|
15
|
+
status TEXT NOT NULL DEFAULT 'backlog' CHECK(status IN ('backlog', 'ready', 'in_progress', 'review', 'done', 'closed')),
|
|
16
|
+
created_at TEXT NOT NULL,
|
|
17
|
+
updated_at TEXT NOT NULL
|
|
18
|
+
);
|
|
19
|
+
`);
|
|
20
|
+
// Create index on tasks table
|
|
21
|
+
db.exec(`
|
|
22
|
+
CREATE INDEX IF NOT EXISTS idx_tasks_status ON tasks(status);
|
|
23
|
+
`);
|
|
24
|
+
db.exec(`
|
|
25
|
+
CREATE INDEX IF NOT EXISTS idx_tasks_author ON tasks(author);
|
|
26
|
+
`);
|
|
27
|
+
// Migrate tasks table to add 'review' status to CHECK constraint
|
|
28
|
+
const taskTableDef = db.prepare(`SELECT sql FROM sqlite_master WHERE type='table' AND name='tasks'`).get();
|
|
29
|
+
if (taskTableDef && !taskTableDef.sql.includes("'review'")) {
|
|
30
|
+
db.exec(`
|
|
31
|
+
CREATE TABLE tasks_new (
|
|
32
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
33
|
+
title TEXT NOT NULL,
|
|
34
|
+
body TEXT,
|
|
35
|
+
author TEXT,
|
|
36
|
+
status TEXT NOT NULL DEFAULT 'backlog' CHECK(status IN ('backlog', 'ready', 'in_progress', 'review', 'done', 'closed')),
|
|
37
|
+
created_at TEXT NOT NULL,
|
|
38
|
+
updated_at TEXT NOT NULL,
|
|
39
|
+
parent_id INTEGER DEFAULT NULL REFERENCES tasks_new(id) ON DELETE SET NULL
|
|
40
|
+
);
|
|
41
|
+
`);
|
|
42
|
+
db.exec(`INSERT INTO tasks_new SELECT id, title, body, author, status, created_at, updated_at, parent_id FROM tasks`);
|
|
43
|
+
db.exec(`DROP TABLE tasks`);
|
|
44
|
+
db.exec(`ALTER TABLE tasks_new RENAME TO tasks`);
|
|
45
|
+
db.exec(`CREATE INDEX IF NOT EXISTS idx_tasks_status ON tasks(status)`);
|
|
46
|
+
db.exec(`CREATE INDEX IF NOT EXISTS idx_tasks_author ON tasks(author)`);
|
|
47
|
+
db.exec(`CREATE INDEX IF NOT EXISTS idx_tasks_parent_id ON tasks(parent_id)`);
|
|
48
|
+
}
|
|
49
|
+
// Add parent_id column to tasks table (migration)
|
|
50
|
+
const columnExists = db
|
|
51
|
+
.prepare(`
|
|
52
|
+
SELECT COUNT(*) as count FROM pragma_table_info('tasks')
|
|
53
|
+
WHERE name = 'parent_id'
|
|
54
|
+
`)
|
|
55
|
+
.get();
|
|
56
|
+
if (columnExists.count === 0) {
|
|
57
|
+
db.exec(`
|
|
58
|
+
ALTER TABLE tasks ADD COLUMN parent_id INTEGER DEFAULT NULL
|
|
59
|
+
REFERENCES tasks(id) ON DELETE SET NULL
|
|
60
|
+
`);
|
|
61
|
+
db.exec(`
|
|
62
|
+
CREATE INDEX IF NOT EXISTS idx_tasks_parent_id ON tasks(parent_id)
|
|
63
|
+
`);
|
|
64
|
+
}
|
|
65
|
+
// Create task_blocks table
|
|
66
|
+
db.exec(`
|
|
67
|
+
CREATE TABLE IF NOT EXISTS task_blocks (
|
|
68
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
69
|
+
blocker_task_id INTEGER NOT NULL,
|
|
70
|
+
blocked_task_id INTEGER NOT NULL,
|
|
71
|
+
created_at TEXT NOT NULL,
|
|
72
|
+
FOREIGN KEY (blocker_task_id) REFERENCES tasks(id) ON DELETE CASCADE,
|
|
73
|
+
FOREIGN KEY (blocked_task_id) REFERENCES tasks(id) ON DELETE CASCADE,
|
|
74
|
+
UNIQUE(blocker_task_id, blocked_task_id),
|
|
75
|
+
CHECK(blocker_task_id != blocked_task_id)
|
|
76
|
+
);
|
|
77
|
+
`);
|
|
78
|
+
// Create index on task_blocks table
|
|
79
|
+
db.exec(`
|
|
80
|
+
CREATE INDEX IF NOT EXISTS idx_task_blocks_blocker ON task_blocks(blocker_task_id);
|
|
81
|
+
`);
|
|
82
|
+
db.exec(`
|
|
83
|
+
CREATE INDEX IF NOT EXISTS idx_task_blocks_blocked ON task_blocks(blocked_task_id);
|
|
84
|
+
`);
|
|
85
|
+
// Create tags table
|
|
86
|
+
db.exec(`
|
|
87
|
+
CREATE TABLE IF NOT EXISTS tags (
|
|
88
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
89
|
+
name TEXT NOT NULL UNIQUE,
|
|
90
|
+
created_at TEXT NOT NULL
|
|
91
|
+
);
|
|
92
|
+
`);
|
|
93
|
+
// Create index on tags table
|
|
94
|
+
db.exec(`
|
|
95
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_tags_name ON tags(name);
|
|
96
|
+
`);
|
|
97
|
+
// Create task_tags table
|
|
98
|
+
db.exec(`
|
|
99
|
+
CREATE TABLE IF NOT EXISTS task_tags (
|
|
100
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
101
|
+
task_id INTEGER NOT NULL,
|
|
102
|
+
tag_id INTEGER NOT NULL,
|
|
103
|
+
created_at TEXT NOT NULL,
|
|
104
|
+
FOREIGN KEY (task_id) REFERENCES tasks(id) ON DELETE CASCADE,
|
|
105
|
+
FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE,
|
|
106
|
+
UNIQUE(task_id, tag_id)
|
|
107
|
+
);
|
|
108
|
+
`);
|
|
109
|
+
// Create index on task_tags table
|
|
110
|
+
db.exec(`
|
|
111
|
+
CREATE INDEX IF NOT EXISTS idx_task_tags_task_id ON task_tags(task_id);
|
|
112
|
+
`);
|
|
113
|
+
db.exec(`
|
|
114
|
+
CREATE INDEX IF NOT EXISTS idx_task_tags_tag_id ON task_tags(tag_id);
|
|
115
|
+
`);
|
|
116
|
+
// Create task_metadata table
|
|
117
|
+
db.exec(`
|
|
118
|
+
CREATE TABLE IF NOT EXISTS task_metadata (
|
|
119
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
120
|
+
task_id INTEGER NOT NULL,
|
|
121
|
+
key TEXT NOT NULL,
|
|
122
|
+
value TEXT NOT NULL,
|
|
123
|
+
created_at TEXT NOT NULL,
|
|
124
|
+
updated_at TEXT NOT NULL,
|
|
125
|
+
FOREIGN KEY (task_id) REFERENCES tasks(id) ON DELETE CASCADE,
|
|
126
|
+
UNIQUE(task_id, key)
|
|
127
|
+
);
|
|
128
|
+
`);
|
|
129
|
+
// Create index on task_metadata table
|
|
130
|
+
db.exec(`
|
|
131
|
+
CREATE INDEX IF NOT EXISTS idx_task_metadata_task_id ON task_metadata(task_id);
|
|
132
|
+
`);
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/db/schema.ts"],"names":[],"mappings":";;AAKA,sCAoJC;AAvJD;;GAEG;AACH,SAAgB,aAAa,CAAC,EAAqB;IACjD,qBAAqB;IACrB,EAAE,CAAC,IAAI,CAAC;;;;;;;;;;GAUP,CAAC,CAAC;IAEH,8BAA8B;IAC9B,EAAE,CAAC,IAAI,CAAC;;GAEP,CAAC,CAAC;IAEH,EAAE,CAAC,IAAI,CAAC;;GAEP,CAAC,CAAC;IAEH,iEAAiE;IACjE,MAAM,YAAY,GAAG,EAAE,CAAC,OAAO,CAAC,mEAAmE,CAAC,CAAC,GAAG,EAE3F,CAAC;IAEd,IAAI,YAAY,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3D,EAAE,CAAC,IAAI,CAAC;;;;;;;;;;;KAWP,CAAC,CAAC;QACH,EAAE,CAAC,IAAI,CACL,4GAA4G,CAC7G,CAAC;QACF,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAC5B,EAAE,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;QACjD,EAAE,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;QACxE,EAAE,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;QACxE,EAAE,CAAC,IAAI,CAAC,oEAAoE,CAAC,CAAC;IAChF,CAAC;IAED,kDAAkD;IAClD,MAAM,YAAY,GAAG,EAAE;SACpB,OAAO,CACN;;;GAGH,CACE;SACA,GAAG,EAAuB,CAAC;IAE9B,IAAI,YAAY,CAAC,KAAK,KAAK,CAAC,EAAE,CAAC;QAC7B,EAAE,CAAC,IAAI,CAAC;;;KAGP,CAAC,CAAC;QACH,EAAE,CAAC,IAAI,CAAC;;KAEP,CAAC,CAAC;IACL,CAAC;IAED,2BAA2B;IAC3B,EAAE,CAAC,IAAI,CAAC;;;;;;;;;;;GAWP,CAAC,CAAC;IAEH,oCAAoC;IACpC,EAAE,CAAC,IAAI,CAAC;;GAEP,CAAC,CAAC;IAEH,EAAE,CAAC,IAAI,CAAC;;GAEP,CAAC,CAAC;IAEH,oBAAoB;IACpB,EAAE,CAAC,IAAI,CAAC;;;;;;GAMP,CAAC,CAAC;IAEH,6BAA6B;IAC7B,EAAE,CAAC,IAAI,CAAC;;GAEP,CAAC,CAAC;IAEH,yBAAyB;IACzB,EAAE,CAAC,IAAI,CAAC;;;;;;;;;;GAUP,CAAC,CAAC;IAEH,kCAAkC;IAClC,EAAE,CAAC,IAAI,CAAC;;GAEP,CAAC,CAAC;IAEH,EAAE,CAAC,IAAI,CAAC;;GAEP,CAAC,CAAC;IAEH,6BAA6B;IAC7B,EAAE,CAAC,IAAI,CAAC;;;;;;;;;;;GAWP,CAAC,CAAC;IAEH,sCAAsC;IACtC,EAAE,CAAC,IAAI,CAAC;;GAEP,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Attachment.js","sourceRoot":"","sources":["../../src/models/Attachment.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface Tag {
|
|
2
|
+
id: number;
|
|
3
|
+
name: string;
|
|
4
|
+
created_at: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Tag creation input type
|
|
8
|
+
*
|
|
9
|
+
* Security constraints:
|
|
10
|
+
* - name: max 50 characters (required)
|
|
11
|
+
*/
|
|
12
|
+
export interface CreateTagInput {
|
|
13
|
+
name: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Tag update input type
|
|
17
|
+
*
|
|
18
|
+
* Security constraints:
|
|
19
|
+
* - name: max 50 characters
|
|
20
|
+
*/
|
|
21
|
+
export interface UpdateTagInput {
|
|
22
|
+
name?: string;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=Tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../src/models/Tag.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../src/models/Tag.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task model
|
|
3
|
+
* Type definitions and status management for tasks
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Task status type
|
|
7
|
+
*/
|
|
8
|
+
export type TaskStatus = 'backlog' | 'ready' | 'in_progress' | 'review' | 'done' | 'closed';
|
|
9
|
+
/**
|
|
10
|
+
* Complete task type definition
|
|
11
|
+
* Represents a task retrieved from the database
|
|
12
|
+
*/
|
|
13
|
+
export interface Task {
|
|
14
|
+
id: number;
|
|
15
|
+
title: string;
|
|
16
|
+
body: string | null;
|
|
17
|
+
author: string | null;
|
|
18
|
+
status: TaskStatus;
|
|
19
|
+
created_at: string;
|
|
20
|
+
updated_at: string;
|
|
21
|
+
parent_id: number | null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Task creation input type
|
|
25
|
+
* Excludes id, created_at, and updated_at as they are auto-generated
|
|
26
|
+
*
|
|
27
|
+
* Security constraints:
|
|
28
|
+
* - title: max 200 characters (required)
|
|
29
|
+
* - body: max 10000 characters (optional)
|
|
30
|
+
* - author: max 100 characters (optional)
|
|
31
|
+
*/
|
|
32
|
+
export interface CreateTaskInput {
|
|
33
|
+
title: string;
|
|
34
|
+
body?: string;
|
|
35
|
+
author?: string;
|
|
36
|
+
status?: TaskStatus;
|
|
37
|
+
parent_id?: number | null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Task update input type
|
|
41
|
+
* All fields are optional to support partial updates
|
|
42
|
+
*
|
|
43
|
+
* Security constraints:
|
|
44
|
+
* - title: max 200 characters
|
|
45
|
+
* - body: max 10000 characters
|
|
46
|
+
* - author: max 100 characters
|
|
47
|
+
*/
|
|
48
|
+
export interface UpdateTaskInput {
|
|
49
|
+
title?: string;
|
|
50
|
+
body?: string;
|
|
51
|
+
author?: string;
|
|
52
|
+
status?: TaskStatus;
|
|
53
|
+
parent_id?: number | null;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=Task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Task.d.ts","sourceRoot":"","sources":["../../src/models/Task.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE5F;;;GAGG;AACH,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Task.js","sourceRoot":"","sources":["../../src/models/Task.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface TaskBlock {
|
|
2
|
+
id: number;
|
|
3
|
+
blocker_task_id: number;
|
|
4
|
+
blocked_task_id: number;
|
|
5
|
+
created_at: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CreateTaskBlockInput {
|
|
8
|
+
blocker_task_id: number;
|
|
9
|
+
blocked_task_id: number;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=TaskBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskBlock.d.ts","sourceRoot":"","sources":["../../src/models/TaskBlock.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskBlock.js","sourceRoot":"","sources":["../../src/models/TaskBlock.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface TaskMetadata {
|
|
2
|
+
id: number;
|
|
3
|
+
task_id: number;
|
|
4
|
+
key: string;
|
|
5
|
+
value: string;
|
|
6
|
+
created_at: string;
|
|
7
|
+
updated_at: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* TaskMetadata creation input type
|
|
11
|
+
*
|
|
12
|
+
* Security constraints:
|
|
13
|
+
* - key: max 50 characters (required)
|
|
14
|
+
* - value: max 500 characters (required)
|
|
15
|
+
*/
|
|
16
|
+
export interface CreateTaskMetadataInput {
|
|
17
|
+
task_id: number;
|
|
18
|
+
key: string;
|
|
19
|
+
value: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* TaskMetadata update input type
|
|
23
|
+
*
|
|
24
|
+
* Security constraints:
|
|
25
|
+
* - value: max 500 characters
|
|
26
|
+
*/
|
|
27
|
+
export interface UpdateTaskMetadataInput {
|
|
28
|
+
value?: string;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=TaskMetadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskMetadata.d.ts","sourceRoot":"","sources":["../../src/models/TaskMetadata.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskMetadata.js","sourceRoot":"","sources":["../../src/models/TaskMetadata.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskTag.d.ts","sourceRoot":"","sources":["../../src/models/TaskTag.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskTag.js","sourceRoot":"","sources":["../../src/models/TaskTag.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model layer exports
|
|
3
|
+
* Centralized management of all model type definitions
|
|
4
|
+
*/
|
|
5
|
+
export type { Task, CreateTaskInput, UpdateTaskInput, TaskStatus } from './Task';
|
|
6
|
+
export type { TaskBlock, CreateTaskBlockInput } from './TaskBlock';
|
|
7
|
+
export type { Tag, CreateTagInput, UpdateTagInput } from './Tag';
|
|
8
|
+
export type { TaskTag, CreateTaskTagInput } from './TaskTag';
|
|
9
|
+
export type { TaskMetadata, CreateTaskMetadataInput, UpdateTaskMetadataInput } from './TaskMetadata';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAGjF,YAAY,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGnE,YAAY,EAAE,GAAG,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGjE,YAAY,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAG7D,YAAY,EAAE,YAAY,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|