huly-mcp-selfhost 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/.env.example +16 -0
- package/README.md +522 -0
- package/dist/connection.d.ts +9 -0
- package/dist/connection.js +122 -0
- package/dist/connection.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas.d.ts +459 -0
- package/dist/schemas.js +196 -0
- package/dist/schemas.js.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +87 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/attachments.d.ts +28 -0
- package/dist/tools/attachments.js +61 -0
- package/dist/tools/attachments.js.map +1 -0
- package/dist/tools/channels.d.ts +44 -0
- package/dist/tools/channels.js +130 -0
- package/dist/tools/channels.js.map +1 -0
- package/dist/tools/comments.d.ts +27 -0
- package/dist/tools/comments.js +60 -0
- package/dist/tools/comments.js.map +1 -0
- package/dist/tools/components.d.ts +19 -0
- package/dist/tools/components.js +57 -0
- package/dist/tools/components.js.map +1 -0
- package/dist/tools/documents.d.ts +68 -0
- package/dist/tools/documents.js +207 -0
- package/dist/tools/documents.js.map +1 -0
- package/dist/tools/issues.d.ts +56 -0
- package/dist/tools/issues.js +262 -0
- package/dist/tools/issues.js.map +1 -0
- package/dist/tools/labels.d.ts +35 -0
- package/dist/tools/labels.js +150 -0
- package/dist/tools/labels.js.map +1 -0
- package/dist/tools/log-time.d.ts +10 -0
- package/dist/tools/log-time.js +31 -0
- package/dist/tools/log-time.js.map +1 -0
- package/dist/tools/members.d.ts +6 -0
- package/dist/tools/members.js +17 -0
- package/dist/tools/members.js.map +1 -0
- package/dist/tools/milestones.d.ts +19 -0
- package/dist/tools/milestones.js +80 -0
- package/dist/tools/milestones.js.map +1 -0
- package/dist/tools/organizations.d.ts +32 -0
- package/dist/tools/organizations.js +86 -0
- package/dist/tools/organizations.js.map +1 -0
- package/dist/tools/projects.d.ts +24 -0
- package/dist/tools/projects.js +64 -0
- package/dist/tools/projects.js.map +1 -0
- package/dist/tools/relations.d.ts +27 -0
- package/dist/tools/relations.js +103 -0
- package/dist/tools/relations.js.map +1 -0
- package/dist/tools/search.d.ts +9 -0
- package/dist/tools/search.js +32 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/statuses.d.ts +16 -0
- package/dist/tools/statuses.js +93 -0
- package/dist/tools/statuses.js.map +1 -0
- package/dist/utils/errors.d.ts +11 -0
- package/dist/utils/errors.js +24 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/format.d.ts +4 -0
- package/dist/utils/format.js +28 -0
- package/dist/utils/format.js.map +1 -0
- package/dist/utils/markdown.d.ts +14 -0
- package/dist/utils/markdown.js +144 -0
- package/dist/utils/markdown.js.map +1 -0
- package/dist/utils/storage.d.ts +7 -0
- package/dist/utils/storage.js +82 -0
- package/dist/utils/storage.js.map +1 -0
- package/package.json +68 -0
- package/scripts/cleanup-issues.js +132 -0
- package/scripts/demo.js +193 -0
- package/scripts/import-csv.js +242 -0
- package/scripts/sample-tasks.csv +11 -0
- package/scripts/setup.js +103 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const listLabels: (args: {
|
|
2
|
+
projectIdentifier?: string | undefined;
|
|
3
|
+
}) => Promise<{
|
|
4
|
+
content: Array<{
|
|
5
|
+
type: "text";
|
|
6
|
+
text: string;
|
|
7
|
+
}>;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const createLabel: (args: {
|
|
10
|
+
title: string;
|
|
11
|
+
color?: string | undefined;
|
|
12
|
+
}) => Promise<{
|
|
13
|
+
content: Array<{
|
|
14
|
+
type: "text";
|
|
15
|
+
text: string;
|
|
16
|
+
}>;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const addLabel: (args: {
|
|
19
|
+
identifier: string;
|
|
20
|
+
labelName: string;
|
|
21
|
+
}) => Promise<{
|
|
22
|
+
content: Array<{
|
|
23
|
+
type: "text";
|
|
24
|
+
text: string;
|
|
25
|
+
}>;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const removeLabel: (args: {
|
|
28
|
+
identifier: string;
|
|
29
|
+
labelName: string;
|
|
30
|
+
}) => Promise<{
|
|
31
|
+
content: Array<{
|
|
32
|
+
type: "text";
|
|
33
|
+
text: string;
|
|
34
|
+
}>;
|
|
35
|
+
}>;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.removeLabel = exports.addLabel = exports.createLabel = exports.listLabels = void 0;
|
|
40
|
+
const tags_1 = __importDefault(require("@hcengineering/tags"));
|
|
41
|
+
const tracker_1 = __importDefault(require("@hcengineering/tracker"));
|
|
42
|
+
const core_1 = __importStar(require("@hcengineering/core"));
|
|
43
|
+
const connection_1 = require("../connection");
|
|
44
|
+
const errors_1 = require("../utils/errors");
|
|
45
|
+
exports.listLabels = (0, errors_1.wrapToolHandler)(async (args) => {
|
|
46
|
+
const client = await (0, connection_1.getConnection)();
|
|
47
|
+
const query = args.projectIdentifier != null
|
|
48
|
+
? { targetClass: tracker_1.default.class.Issue }
|
|
49
|
+
: { targetClass: tracker_1.default.class.Issue };
|
|
50
|
+
const allLabels = await client.findAll(tags_1.default.class.TagElement, { targetClass: tracker_1.default.class.Issue });
|
|
51
|
+
if (allLabels.length === 0)
|
|
52
|
+
return 'No labels found in this workspace.';
|
|
53
|
+
const lines = allLabels.map((l) => {
|
|
54
|
+
const color = l.color != null ? ` (color: #${l.color.toString(16).padStart(6, '0')})` : '';
|
|
55
|
+
return `- **${l.title}**${color} — used ${l.refCount ?? 0} time(s) | id: \`${l._id}\``;
|
|
56
|
+
});
|
|
57
|
+
return `## Labels (${allLabels.length})\n\n${lines.join('\n')}`;
|
|
58
|
+
});
|
|
59
|
+
exports.createLabel = (0, errors_1.wrapToolHandler)(async (args) => {
|
|
60
|
+
const client = await (0, connection_1.getConnection)();
|
|
61
|
+
// Check if label already exists
|
|
62
|
+
const existing = await client.findOne(tags_1.default.class.TagElement, {
|
|
63
|
+
targetClass: tracker_1.default.class.Issue,
|
|
64
|
+
title: args.title
|
|
65
|
+
});
|
|
66
|
+
if (existing != null) {
|
|
67
|
+
return `Label **${args.title}** already exists (id: \`${existing._id}\`).`;
|
|
68
|
+
}
|
|
69
|
+
// Find or use the default no-category
|
|
70
|
+
const category = await client.findOne(tags_1.default.class.TagCategory, {
|
|
71
|
+
targetClass: tracker_1.default.class.Issue
|
|
72
|
+
});
|
|
73
|
+
const labelId = (0, core_1.generateId)();
|
|
74
|
+
await client.createDoc(tags_1.default.class.TagElement, core_1.default.space.Workspace, {
|
|
75
|
+
title: args.title,
|
|
76
|
+
targetClass: tracker_1.default.class.Issue,
|
|
77
|
+
description: '',
|
|
78
|
+
color: args.color != null ? parseInt(args.color.replace('#', ''), 16) : 8,
|
|
79
|
+
category: category?._id ?? tags_1.default.category.NoCategory,
|
|
80
|
+
refCount: 0
|
|
81
|
+
}, labelId);
|
|
82
|
+
return `✅ Created label **${args.title}** (id: \`${labelId}\`)`;
|
|
83
|
+
});
|
|
84
|
+
exports.addLabel = (0, errors_1.wrapToolHandler)(async (args) => {
|
|
85
|
+
const client = await (0, connection_1.getConnection)();
|
|
86
|
+
// Find issue
|
|
87
|
+
const issue = await client.findOne(tracker_1.default.class.Issue, { identifier: args.identifier });
|
|
88
|
+
if (issue == null)
|
|
89
|
+
throw new Error(`Issue '${args.identifier}' not found.`);
|
|
90
|
+
// Find label by name or create it
|
|
91
|
+
let label = await client.findOne(tags_1.default.class.TagElement, {
|
|
92
|
+
targetClass: tracker_1.default.class.Issue,
|
|
93
|
+
title: args.labelName
|
|
94
|
+
});
|
|
95
|
+
if (label == null) {
|
|
96
|
+
// Auto-create label
|
|
97
|
+
const category = await client.findOne(tags_1.default.class.TagCategory, {
|
|
98
|
+
targetClass: tracker_1.default.class.Issue
|
|
99
|
+
});
|
|
100
|
+
const labelId = (0, core_1.generateId)();
|
|
101
|
+
await client.createDoc(tags_1.default.class.TagElement, core_1.default.space.Workspace, {
|
|
102
|
+
title: args.labelName,
|
|
103
|
+
targetClass: tracker_1.default.class.Issue,
|
|
104
|
+
description: '',
|
|
105
|
+
color: 8,
|
|
106
|
+
category: category?._id ?? tags_1.default.category.NoCategory,
|
|
107
|
+
refCount: 0
|
|
108
|
+
}, labelId);
|
|
109
|
+
label = await client.findOne(tags_1.default.class.TagElement, { _id: labelId });
|
|
110
|
+
if (label == null)
|
|
111
|
+
throw new Error(`Failed to create label '${args.labelName}'.`);
|
|
112
|
+
}
|
|
113
|
+
// Check if already attached
|
|
114
|
+
const existing = await client.findOne(tags_1.default.class.TagReference, {
|
|
115
|
+
attachedTo: issue._id,
|
|
116
|
+
tag: label._id
|
|
117
|
+
});
|
|
118
|
+
if (existing != null) {
|
|
119
|
+
return `Label **${args.labelName}** is already on **${args.identifier}**.`;
|
|
120
|
+
}
|
|
121
|
+
// Attach label via addCollection
|
|
122
|
+
await client.addCollection(tags_1.default.class.TagReference, issue.space, issue._id, tracker_1.default.class.Issue, 'labels', {
|
|
123
|
+
tag: label._id,
|
|
124
|
+
title: label.title,
|
|
125
|
+
color: label.color
|
|
126
|
+
});
|
|
127
|
+
return `✅ Added label **${args.labelName}** to **${args.identifier}**`;
|
|
128
|
+
});
|
|
129
|
+
exports.removeLabel = (0, errors_1.wrapToolHandler)(async (args) => {
|
|
130
|
+
const client = await (0, connection_1.getConnection)();
|
|
131
|
+
const issue = await client.findOne(tracker_1.default.class.Issue, { identifier: args.identifier });
|
|
132
|
+
if (issue == null)
|
|
133
|
+
throw new Error(`Issue '${args.identifier}' not found.`);
|
|
134
|
+
const label = await client.findOne(tags_1.default.class.TagElement, {
|
|
135
|
+
targetClass: tracker_1.default.class.Issue,
|
|
136
|
+
title: args.labelName
|
|
137
|
+
});
|
|
138
|
+
if (label == null)
|
|
139
|
+
throw new Error(`Label '${args.labelName}' not found.`);
|
|
140
|
+
const ref = await client.findOne(tags_1.default.class.TagReference, {
|
|
141
|
+
attachedTo: issue._id,
|
|
142
|
+
tag: label._id
|
|
143
|
+
});
|
|
144
|
+
if (ref == null) {
|
|
145
|
+
return `Label **${args.labelName}** is not on **${args.identifier}**.`;
|
|
146
|
+
}
|
|
147
|
+
await client.removeCollection(tags_1.default.class.TagReference, issue.space, ref._id, issue._id, tracker_1.default.class.Issue, 'labels');
|
|
148
|
+
return `✅ Removed label **${args.labelName}** from **${args.identifier}**`;
|
|
149
|
+
});
|
|
150
|
+
//# sourceMappingURL=labels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.js","sourceRoot":"","sources":["../../src/tools/labels.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAsC;AACtC,qEAA4C;AAC5C,4DAAgE;AAEhE,8CAA6C;AAC7C,4CAAiD;AASpC,QAAA,UAAU,GAAG,IAAA,wBAAe,EAAmC,KAAK,EAAE,IAAI,EAAE,EAAE;IACzF,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAa,GAAE,CAAA;IAEpC,MAAM,KAAK,GAAG,IAAI,CAAC,iBAAiB,IAAI,IAAI;QAC1C,CAAC,CAAC,EAAE,WAAW,EAAE,iBAAO,CAAC,KAAK,CAAC,KAAK,EAAE;QACtC,CAAC,CAAC,EAAE,WAAW,EAAE,iBAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;IAExC,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,cAAI,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,WAAW,EAAE,iBAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAA;IAEnG,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,oCAAoC,CAAA;IAEvE,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QAChC,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,KAAK,CAA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,YAAY,EACvB,KAAK,CAAC,KAAK,EACX,GAAG,CAAC,GAAG,EACP,KAAK,CAAC,GAAG,EACT,iBAAO,CAAC,KAAK,CAAC,KAAK,EACnB,QAAQ,CACT,CAAA;IAED,OAAO,qBAAqB,IAAI,CAAC,SAAS,aAAa,IAAI,CAAC,UAAU,IAAI,CAAA;AAC5E,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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.logTime = void 0;
|
|
7
|
+
const tracker_1 = __importDefault(require("@hcengineering/tracker"));
|
|
8
|
+
const contact_1 = __importDefault(require("@hcengineering/contact"));
|
|
9
|
+
const connection_1 = require("../connection");
|
|
10
|
+
const errors_1 = require("../utils/errors");
|
|
11
|
+
const core_1 = require("@hcengineering/core");
|
|
12
|
+
exports.logTime = (0, errors_1.wrapToolHandler)(async (args) => {
|
|
13
|
+
const client = await (0, connection_1.getConnection)();
|
|
14
|
+
const issue = await client.findOne(tracker_1.default.class.Issue, { identifier: args.identifier });
|
|
15
|
+
if (issue == null)
|
|
16
|
+
throw new Error(`Issue '${args.identifier}' not found.`);
|
|
17
|
+
// Get current user
|
|
18
|
+
const me = await client.findOne(contact_1.default.class.Member, {});
|
|
19
|
+
if (me == null)
|
|
20
|
+
throw new Error('Could not identify current user.');
|
|
21
|
+
const now = new Date().getTime();
|
|
22
|
+
const valueInHours = args.hours;
|
|
23
|
+
await client.addCollection(tracker_1.default.class.TimeSpendReport, issue.space, issue._id, tracker_1.default.class.Issue, 'reports', {
|
|
24
|
+
employee: me._id,
|
|
25
|
+
date: now,
|
|
26
|
+
value: valueInHours,
|
|
27
|
+
description: args.description ?? ''
|
|
28
|
+
}, (0, core_1.generateId)());
|
|
29
|
+
return `✅ Logged **${args.hours}h** on **${args.identifier}**${args.description ? ` — "${args.description}"` : ''}`;
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=log-time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-time.js","sourceRoot":"","sources":["../../src/tools/log-time.ts"],"names":[],"mappings":";;;;;;AAAA,qEAA4C;AAC5C,qEAA4C;AAC5C,8CAA6C;AAC7C,4CAAiD;AAIjD,8CAAgD;AAEnC,QAAA,OAAO,GAAG,IAAA,wBAAe,EAAgC,KAAK,EAAE,IAAI,EAAE,EAAE;IACnF,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAa,GAAE,CAAA;IACpC,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,iBAAO,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAA;IACxF,IAAI,KAAK,IAAI,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,UAAU,IAAI,CAAC,UAAU,cAAc,CAAC,CAAA;IAE3E,mBAAmB;IACnB,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,iBAAO,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IACzD,IAAI,EAAE,IAAI,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAA;IAEnE,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;IAChC,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAA;IAE/B,MAAM,MAAM,CAAC,aAAa,CACxB,iBAAO,CAAC,KAAK,CAAC,eAAe,EAC7B,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,GAAG,EACT,iBAAO,CAAC,KAAK,CAAC,KAAK,EACnB,SAAS,EACT;QACE,QAAQ,EAAE,EAAE,CAAC,GAAqB;QAClC,IAAI,EAAE,GAAG;QACT,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,EAAE;KACpC,EACD,IAAA,iBAAU,GAAE,CACb,CAAA;IAED,OAAO,cAAc,IAAI,CAAC,KAAK,YAAY,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA;AACrH,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listMembers = void 0;
|
|
4
|
+
const connection_1 = require("../connection");
|
|
5
|
+
const errors_1 = require("../utils/errors");
|
|
6
|
+
exports.listMembers = (0, errors_1.wrapToolHandler)(async () => {
|
|
7
|
+
const accountClient = await (0, connection_1.getAccountClient)();
|
|
8
|
+
const members = await accountClient.getWorkspaceMembers();
|
|
9
|
+
if (members.length === 0)
|
|
10
|
+
return 'No members found in this workspace.';
|
|
11
|
+
const lines = members.map((m) => {
|
|
12
|
+
const role = String(m.role ?? 'member');
|
|
13
|
+
return `- \`${m.person}\` — role: **${role}**`;
|
|
14
|
+
});
|
|
15
|
+
return `## Workspace Members (${members.length})\n\n${lines.join('\n')}`;
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=members.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"members.js","sourceRoot":"","sources":["../../src/tools/members.ts"],"names":[],"mappings":";;;AAAA,8CAAgD;AAChD,4CAAiD;AAEpC,QAAA,WAAW,GAAG,IAAA,wBAAe,EAAwB,KAAK,IAAI,EAAE;IAC3E,MAAM,aAAa,GAAG,MAAM,IAAA,6BAAgB,GAAE,CAAA;IAC9C,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,mBAAmB,EAAE,CAAA;IAEzD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,qCAAqC,CAAA;IAEtE,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QAC9B,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,QAAQ,CAAC,CAAA;QACvC,OAAO,OAAO,CAAC,CAAC,MAAM,gBAAgB,IAAI,IAAI,CAAA;IAChD,CAAC,CAAC,CAAA;IAEF,OAAO,yBAAyB,OAAO,CAAC,MAAM,QAAQ,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAA;AAC1E,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const listMilestones: (args: {
|
|
2
|
+
projectIdentifier: string;
|
|
3
|
+
}) => Promise<{
|
|
4
|
+
content: Array<{
|
|
5
|
+
type: "text";
|
|
6
|
+
text: string;
|
|
7
|
+
}>;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const createMilestone: (args: {
|
|
10
|
+
status: "Planned" | "InProgress" | "Completed" | "Canceled";
|
|
11
|
+
label: string;
|
|
12
|
+
projectIdentifier: string;
|
|
13
|
+
targetDate: string;
|
|
14
|
+
}) => Promise<{
|
|
15
|
+
content: Array<{
|
|
16
|
+
type: "text";
|
|
17
|
+
text: string;
|
|
18
|
+
}>;
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.createMilestone = exports.listMilestones = void 0;
|
|
37
|
+
const tracker_1 = __importStar(require("@hcengineering/tracker"));
|
|
38
|
+
const core_1 = require("@hcengineering/core");
|
|
39
|
+
const connection_1 = require("../connection");
|
|
40
|
+
const errors_1 = require("../utils/errors");
|
|
41
|
+
const format_1 = require("../utils/format");
|
|
42
|
+
exports.listMilestones = (0, errors_1.wrapToolHandler)(async (args) => {
|
|
43
|
+
const client = await (0, connection_1.getConnection)();
|
|
44
|
+
const project = await client.findOne(tracker_1.default.class.Project, { identifier: args.projectIdentifier });
|
|
45
|
+
if (project == null)
|
|
46
|
+
throw new Error(`Project '${args.projectIdentifier}' not found.`);
|
|
47
|
+
const milestones = await client.findAll(tracker_1.default.class.Milestone, { space: project._id });
|
|
48
|
+
if (milestones.length === 0)
|
|
49
|
+
return `No milestones found in project ${args.projectIdentifier}.`;
|
|
50
|
+
const lines = milestones.map((m) => {
|
|
51
|
+
const status = format_1.MILESTONE_STATUS_LABELS[m.status] ?? 'Unknown';
|
|
52
|
+
const target = (0, format_1.formatDate)(m.targetDate);
|
|
53
|
+
return `- **${m.label}** [${status}] — Target: ${target}`;
|
|
54
|
+
});
|
|
55
|
+
return `## Milestones in ${args.projectIdentifier} (${milestones.length})\n\n${lines.join('\n')}`;
|
|
56
|
+
});
|
|
57
|
+
const MILESTONE_STATUS_MAP = {
|
|
58
|
+
Planned: tracker_1.MilestoneStatus.Planned,
|
|
59
|
+
InProgress: tracker_1.MilestoneStatus.InProgress,
|
|
60
|
+
Completed: tracker_1.MilestoneStatus.Completed,
|
|
61
|
+
Canceled: tracker_1.MilestoneStatus.Canceled
|
|
62
|
+
};
|
|
63
|
+
exports.createMilestone = (0, errors_1.wrapToolHandler)(async (args) => {
|
|
64
|
+
const client = await (0, connection_1.getConnection)();
|
|
65
|
+
const project = await client.findOne(tracker_1.default.class.Project, { identifier: args.projectIdentifier });
|
|
66
|
+
if (project == null)
|
|
67
|
+
throw new Error(`Project '${args.projectIdentifier}' not found.`);
|
|
68
|
+
const targetDate = new Date(args.targetDate).getTime();
|
|
69
|
+
if (isNaN(targetDate))
|
|
70
|
+
throw new Error(`Invalid date: '${args.targetDate}'`);
|
|
71
|
+
const status = MILESTONE_STATUS_MAP[args.status] ?? tracker_1.MilestoneStatus.Planned;
|
|
72
|
+
await client.createDoc(tracker_1.default.class.Milestone, project._id, {
|
|
73
|
+
label: args.label,
|
|
74
|
+
targetDate,
|
|
75
|
+
status,
|
|
76
|
+
comments: 0
|
|
77
|
+
}, (0, core_1.generateId)());
|
|
78
|
+
return `Milestone **${args.label}** created in project ${args.projectIdentifier} with target date ${args.targetDate}.`;
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=milestones.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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AAG,CAAA;AACxH,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const listOrganizations: (args: {}) => Promise<{
|
|
2
|
+
content: Array<{
|
|
3
|
+
type: "text";
|
|
4
|
+
text: string;
|
|
5
|
+
}>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const getOrganization: (args: {
|
|
8
|
+
organizationId: string;
|
|
9
|
+
}) => Promise<{
|
|
10
|
+
content: Array<{
|
|
11
|
+
type: "text";
|
|
12
|
+
text: string;
|
|
13
|
+
}>;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const createOrganization: (args: {
|
|
16
|
+
name: string;
|
|
17
|
+
city?: string | undefined;
|
|
18
|
+
}) => Promise<{
|
|
19
|
+
content: Array<{
|
|
20
|
+
type: "text";
|
|
21
|
+
text: string;
|
|
22
|
+
}>;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const updateOrganization: (args: {
|
|
25
|
+
description: string;
|
|
26
|
+
organizationId: string;
|
|
27
|
+
}) => Promise<{
|
|
28
|
+
content: Array<{
|
|
29
|
+
type: "text";
|
|
30
|
+
text: string;
|
|
31
|
+
}>;
|
|
32
|
+
}>;
|
|
@@ -0,0 +1,86 @@
|
|
|
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.updateOrganization = exports.createOrganization = exports.getOrganization = exports.listOrganizations = void 0;
|
|
7
|
+
const contact_1 = __importDefault(require("@hcengineering/contact"));
|
|
8
|
+
const core_1 = require("@hcengineering/core");
|
|
9
|
+
const connection_1 = require("../connection");
|
|
10
|
+
const errors_1 = require("../utils/errors");
|
|
11
|
+
const markdown_1 = require("../utils/markdown");
|
|
12
|
+
const storage_1 = require("../utils/storage");
|
|
13
|
+
exports.listOrganizations = (0, errors_1.wrapToolHandler)(async () => {
|
|
14
|
+
const client = await (0, connection_1.getConnection)();
|
|
15
|
+
const orgs = await client.findAll(contact_1.default.class.Organization, {});
|
|
16
|
+
if (orgs.length === 0)
|
|
17
|
+
return 'No organizations found in this workspace.';
|
|
18
|
+
const lines = orgs.map((o) => `- **${o.name}** (id: \`${o._id}\`)${o.city != null && o.city !== '' ? ` — ${o.city}` : ''}`);
|
|
19
|
+
return `## Organizations (${orgs.length})\n\n${lines.join('\n')}`;
|
|
20
|
+
});
|
|
21
|
+
exports.getOrganization = (0, errors_1.wrapToolHandler)(async (args) => {
|
|
22
|
+
const client = await (0, connection_1.getConnection)();
|
|
23
|
+
const org = await client.findOne(contact_1.default.class.Organization, { _id: args.organizationId });
|
|
24
|
+
if (org == null)
|
|
25
|
+
throw new Error(`Organization '${args.organizationId}' not found.`);
|
|
26
|
+
const lines = [`## ${org.name}`, `**ID:** \`${org._id}\``];
|
|
27
|
+
if (org.city != null && org.city !== '')
|
|
28
|
+
lines.push(`**City:** ${org.city}`);
|
|
29
|
+
lines.push(`**Members linked:** ${org.members ?? 0}`);
|
|
30
|
+
if (org.description != null) {
|
|
31
|
+
const frontUrl = process.env.HULY_FRONT_URL;
|
|
32
|
+
if (frontUrl != null && frontUrl !== '') {
|
|
33
|
+
const { wsToken, workspaceUuid } = await (0, connection_1.getWorkspaceInfo)();
|
|
34
|
+
const blobUrl = `${frontUrl}/files?file=${encodeURIComponent(org.description)}&workspace=${workspaceUuid}&token=${wsToken}`;
|
|
35
|
+
try {
|
|
36
|
+
const res = await fetch(blobUrl);
|
|
37
|
+
if (res.ok) {
|
|
38
|
+
const text = await res.text();
|
|
39
|
+
try {
|
|
40
|
+
const extracted = (0, markdown_1.extractText)(JSON.parse(text));
|
|
41
|
+
if (extracted.length > 0)
|
|
42
|
+
lines.push(`\n**Description:**\n${extracted}`);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
lines.push(`\n**Description (raw):**\n${text.substring(0, 2000)}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
lines.push('\n**Description:** _(fetch failed)_');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
lines.push(`\n**Description blob ref:** \`${org.description}\``);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return lines.join('\n');
|
|
58
|
+
});
|
|
59
|
+
exports.createOrganization = (0, errors_1.wrapToolHandler)(async (args) => {
|
|
60
|
+
const client = await (0, connection_1.getConnection)();
|
|
61
|
+
const existing = await client.findOne(contact_1.default.class.Organization, { name: args.name });
|
|
62
|
+
if (existing != null)
|
|
63
|
+
return `ℹ️ Organization **"${args.name}"** already exists (id: \`${existing._id}\`).`;
|
|
64
|
+
const orgId = (0, core_1.generateId)();
|
|
65
|
+
await client.createDoc(contact_1.default.class.Organization, contact_1.default.space.Contacts, {
|
|
66
|
+
name: args.name,
|
|
67
|
+
city: args.city ?? '',
|
|
68
|
+
description: null,
|
|
69
|
+
members: 0,
|
|
70
|
+
avatar: null
|
|
71
|
+
}, orgId);
|
|
72
|
+
return `✅ Organization **"${args.name}"** created (id: \`${orgId}\`).`;
|
|
73
|
+
});
|
|
74
|
+
exports.updateOrganization = (0, errors_1.wrapToolHandler)(async (args) => {
|
|
75
|
+
const client = await (0, connection_1.getConnection)();
|
|
76
|
+
const { wsToken, workspaceUuid } = await (0, connection_1.getWorkspaceInfo)();
|
|
77
|
+
const org = await client.findOne(contact_1.default.class.Organization, { _id: args.organizationId });
|
|
78
|
+
if (org == null)
|
|
79
|
+
throw new Error(`Organization '${args.organizationId}' not found.`);
|
|
80
|
+
const prosemirror = (0, markdown_1.markdownToProseMirror)(args.description);
|
|
81
|
+
const blobId = `${org._id}-description-${Date.now()}`;
|
|
82
|
+
const uploadedId = await (0, storage_1.uploadMarkupBlob)(wsToken, workspaceUuid, blobId, JSON.stringify(prosemirror));
|
|
83
|
+
await client.updateDoc(contact_1.default.class.Organization, org.space, org._id, { description: uploadedId });
|
|
84
|
+
return `✅ Organization **"${org.name}"** description updated.`;
|
|
85
|
+
});
|
|
86
|
+
//# sourceMappingURL=organizations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizations.js","sourceRoot":"","sources":["../../src/tools/organizations.ts"],"names":[],"mappings":";;;;;;AAAA,qEAAmE;AACnE,8CAA0D;AAC1D,8CAA+D;AAC/D,4CAAiD;AACjD,gDAAsE;AACtE,8CAAmD;AAItC,QAAA,iBAAiB,GAAG,IAAA,wBAAe,EAA0C,KAAK,IAAI,EAAE;IACnG,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAa,GAAE,CAAA;IACpC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,iBAAO,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,CAAC,CAAA;IACjE,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,2CAA2C,CAAA;IAEzE,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,IAAI,IAAI,IAAI,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IAC3H,OAAO,qBAAqB,IAAI,CAAC,MAAM,QAAQ,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAA;AACnE,CAAC,CAAC,CAAA;AAEW,QAAA,eAAe,GAAG,IAAA,wBAAe,EAAwC,KAAK,EAAE,IAAI,EAAE,EAAE;IACnG,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAa,GAAE,CAAA;IACpC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,iBAAO,CAAC,KAAK,CAAC,YAAY,E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
type: "text";
|
|
4
|
+
text: string;
|
|
5
|
+
}>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const getProject: (args: {
|
|
8
|
+
identifier: string;
|
|
9
|
+
}) => Promise<{
|
|
10
|
+
content: Array<{
|
|
11
|
+
type: "text";
|
|
12
|
+
text: string;
|
|
13
|
+
}>;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const createProject: (args: {
|
|
16
|
+
identifier: string;
|
|
17
|
+
name: string;
|
|
18
|
+
description?: string | undefined;
|
|
19
|
+
}) => Promise<{
|
|
20
|
+
content: Array<{
|
|
21
|
+
type: "text";
|
|
22
|
+
text: string;
|
|
23
|
+
}>;
|
|
24
|
+
}>;
|
|
@@ -0,0 +1,64 @@
|
|
|
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.createProject = exports.getProject = exports.listProjects = void 0;
|
|
7
|
+
const tracker_1 = __importDefault(require("@hcengineering/tracker"));
|
|
8
|
+
const core_1 = __importDefault(require("@hcengineering/core"));
|
|
9
|
+
const task_1 = __importDefault(require("@hcengineering/task"));
|
|
10
|
+
const core_2 = require("@hcengineering/core");
|
|
11
|
+
const connection_1 = require("../connection");
|
|
12
|
+
const errors_1 = require("../utils/errors");
|
|
13
|
+
exports.listProjects = (0, errors_1.wrapToolHandler)(async () => {
|
|
14
|
+
const client = await (0, connection_1.getConnection)();
|
|
15
|
+
const projects = await client.findAll(tracker_1.default.class.Project, {});
|
|
16
|
+
if (projects.length === 0)
|
|
17
|
+
return 'No projects found in this workspace.';
|
|
18
|
+
const lines = projects.map((p) => `- **${p.identifier}** — ${p.name ?? '(no name)'}${p.description != null && p.description !== '' ? `\n ${p.description}` : ''}`);
|
|
19
|
+
return `## Projects (${projects.length})\n\n${lines.join('\n')}`;
|
|
20
|
+
});
|
|
21
|
+
exports.getProject = (0, errors_1.wrapToolHandler)(async (args) => {
|
|
22
|
+
const client = await (0, connection_1.getConnection)();
|
|
23
|
+
const project = await client.findOne(tracker_1.default.class.Project, { identifier: args.identifier });
|
|
24
|
+
if (project == null)
|
|
25
|
+
throw new Error(`Project '${args.identifier}' not found.`);
|
|
26
|
+
const statuses = await client.findAll(tracker_1.default.class.IssueStatus, {});
|
|
27
|
+
const statusList = statuses.map((s) => ` - ${s.name}`).join('\n');
|
|
28
|
+
return [
|
|
29
|
+
`## Project: ${project.identifier}`,
|
|
30
|
+
`**Name:** ${project.name ?? '(no name)'}`,
|
|
31
|
+
project.description != null && project.description !== '' ? `**Description:** ${project.description}` : null,
|
|
32
|
+
`**Issues created:** ${project.sequence}`,
|
|
33
|
+
`\n**Statuses:**\n${statusList}`
|
|
34
|
+
].filter(Boolean).join('\n');
|
|
35
|
+
});
|
|
36
|
+
exports.createProject = (0, errors_1.wrapToolHandler)(async (args) => {
|
|
37
|
+
const client = await (0, connection_1.getConnection)();
|
|
38
|
+
// Check identifier is unique
|
|
39
|
+
const existing = await client.findOne(tracker_1.default.class.Project, { identifier: args.identifier });
|
|
40
|
+
if (existing != null)
|
|
41
|
+
throw new Error(`A project with identifier '${args.identifier}' already exists.`);
|
|
42
|
+
// Find the classic project type (used by Huly Tracker)
|
|
43
|
+
const projectType = await client.findOne(task_1.default.class.ProjectType, {
|
|
44
|
+
_id: tracker_1.default.ids.ClassingProjectType
|
|
45
|
+
}) ?? await client.findOne(task_1.default.class.ProjectType, {});
|
|
46
|
+
if (projectType == null)
|
|
47
|
+
throw new Error('Could not find a ProjectType. Ensure the Huly Tracker is set up.');
|
|
48
|
+
const projectId = (0, core_2.generateId)();
|
|
49
|
+
await client.createDoc(tracker_1.default.class.Project, core_1.default.space.Space, {
|
|
50
|
+
name: args.name,
|
|
51
|
+
description: args.description ?? '',
|
|
52
|
+
identifier: args.identifier,
|
|
53
|
+
sequence: 0,
|
|
54
|
+
defaultAssignee: undefined,
|
|
55
|
+
defaultTimeReportDay: 'CurrentWorkDay',
|
|
56
|
+
defaultIssueStatus: undefined,
|
|
57
|
+
type: projectType._id,
|
|
58
|
+
members: [client.user],
|
|
59
|
+
archived: false,
|
|
60
|
+
private: false
|
|
61
|
+
}, projectId);
|
|
62
|
+
return `✅ Project **${args.identifier}** ("${args.name}") created successfully.\nNote: default statuses are set up automatically by the platform.`;
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=projects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/tools/projects.ts"],"names":[],"mappings":";;;;;;AAAA,qEAA4C;AAC5C,+DAAsC;AACtC,+DAAsC;AACtC,8CAA0D;AAE1D,8CAA6C;AAC7C,4CAAiD;AAIpC,QAAA,YAAY,GAAG,IAAA,wBAAe,EAAwB,KAAK,IAAI,EAAE;IAC5E,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAa,GAAE,CAAA;IACpC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,iBAAO,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;IAEhE,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,sCAAsC,CAAA;IAExE,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAC/B,OAAO,CAAC,CAAC,UAAU,QAAQ,CAAC,CAAC,IAAI,IAAI,WAAW,GAAG,CAAC,CAAC,WAAW,IAAI,IAAI,IAAI,CAAC,CAAC,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CACjI,CAAA;IACD,OAAO,gBAAgB,QAAQ,CAAC,MAAM,QAAQ,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAA;AAClE,CAAC,CAAC,CAAA;AAEW,QAAA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
1
|
+
export declare const addRelation: (args: {
|
|
2
|
+
identifier: string;
|
|
3
|
+
relatedTo: string;
|
|
4
|
+
}) => Promise<{
|
|
5
|
+
content: Array<{
|
|
6
|
+
type: "text";
|
|
7
|
+
text: string;
|
|
8
|
+
}>;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const addBlockedBy: (args: {
|
|
11
|
+
identifier: string;
|
|
12
|
+
blockedBy: string;
|
|
13
|
+
}) => Promise<{
|
|
14
|
+
content: Array<{
|
|
15
|
+
type: "text";
|
|
16
|
+
text: string;
|
|
17
|
+
}>;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const setParent: (args: {
|
|
20
|
+
identifier: string;
|
|
21
|
+
parentIdentifier?: string | null | undefined;
|
|
22
|
+
}) => Promise<{
|
|
23
|
+
content: Array<{
|
|
24
|
+
type: "text";
|
|
25
|
+
text: string;
|
|
26
|
+
}>;
|
|
27
|
+
}>;
|