@firfi/huly-mcp 0.3.2 → 0.5.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 +9 -1
- package/dist/index.cjs +705 -388
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -28673,7 +28673,7 @@ var require_classes = __commonJS({
|
|
|
28673
28673
|
var classes_exports = {};
|
|
28674
28674
|
__export2(classes_exports, {
|
|
28675
28675
|
AccountRole: () => AccountRole,
|
|
28676
|
-
ClassifierKind: () =>
|
|
28676
|
+
ClassifierKind: () => ClassifierKind2,
|
|
28677
28677
|
DOMAIN_BLOB: () => DOMAIN_BLOB,
|
|
28678
28678
|
DOMAIN_COLLABORATOR: () => DOMAIN_COLLABORATOR,
|
|
28679
28679
|
DOMAIN_CONFIGURATION: () => DOMAIN_CONFIGURATION,
|
|
@@ -28705,12 +28705,12 @@ var require_classes = __commonJS({
|
|
|
28705
28705
|
IndexKind2[IndexKind2["IndexedDsc"] = 2] = "IndexedDsc";
|
|
28706
28706
|
return IndexKind2;
|
|
28707
28707
|
})(IndexKind || {});
|
|
28708
|
-
var
|
|
28709
|
-
|
|
28710
|
-
|
|
28711
|
-
|
|
28712
|
-
return
|
|
28713
|
-
})(
|
|
28708
|
+
var ClassifierKind2 = /* @__PURE__ */ ((ClassifierKind22) => {
|
|
28709
|
+
ClassifierKind22[ClassifierKind22["CLASS"] = 0] = "CLASS";
|
|
28710
|
+
ClassifierKind22[ClassifierKind22["INTERFACE"] = 1] = "INTERFACE";
|
|
28711
|
+
ClassifierKind22[ClassifierKind22["MIXIN"] = 2] = "MIXIN";
|
|
28712
|
+
return ClassifierKind22;
|
|
28713
|
+
})(ClassifierKind2 || {});
|
|
28714
28714
|
var DateRangeMode = /* @__PURE__ */ ((DateRangeMode2) => {
|
|
28715
28715
|
DateRangeMode2["DATE"] = "date";
|
|
28716
28716
|
DateRangeMode2["TIME"] = "time";
|
|
@@ -34077,15 +34077,15 @@ var require_storage = __commonJS({
|
|
|
34077
34077
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
34078
34078
|
var storage_exports = {};
|
|
34079
34079
|
__export2(storage_exports, {
|
|
34080
|
-
SortingOrder: () =>
|
|
34080
|
+
SortingOrder: () => SortingOrder26,
|
|
34081
34081
|
shouldShowArchived: () => shouldShowArchived
|
|
34082
34082
|
});
|
|
34083
34083
|
module2.exports = __toCommonJS2(storage_exports);
|
|
34084
|
-
var
|
|
34085
|
-
|
|
34086
|
-
|
|
34087
|
-
return
|
|
34088
|
-
})(
|
|
34084
|
+
var SortingOrder26 = /* @__PURE__ */ ((SortingOrder27) => {
|
|
34085
|
+
SortingOrder27[SortingOrder27["Ascending"] = 1] = "Ascending";
|
|
34086
|
+
SortingOrder27[SortingOrder27["Descending"] = -1] = "Descending";
|
|
34087
|
+
return SortingOrder27;
|
|
34088
|
+
})(SortingOrder26 || {});
|
|
34089
34089
|
function shouldShowArchived(query, options) {
|
|
34090
34090
|
if (options?.showArchived !== void 0) {
|
|
34091
34091
|
return options.showArchived;
|
|
@@ -34588,7 +34588,7 @@ var require_client3 = __commonJS({
|
|
|
34588
34588
|
getClient: () => getClient
|
|
34589
34589
|
});
|
|
34590
34590
|
module2.exports = __toCommonJS2(client_exports);
|
|
34591
|
-
var
|
|
34591
|
+
var import_core46 = require_lib4();
|
|
34592
34592
|
var import_platform2 = __toESM2(require_lib());
|
|
34593
34593
|
var import_utils14 = require_utils3();
|
|
34594
34594
|
function getClient(accountsUrl, token, retryTimeoutMs) {
|
|
@@ -34624,7 +34624,7 @@ var require_client3 = __commonJS({
|
|
|
34624
34624
|
rpc;
|
|
34625
34625
|
async getProviders() {
|
|
34626
34626
|
return await withRetryUntilMaxAttempts(async () => {
|
|
34627
|
-
const response = await fetch((0,
|
|
34627
|
+
const response = await fetch((0, import_core46.concatLink)(this.url, "/providers"));
|
|
34628
34628
|
return await response.json();
|
|
34629
34629
|
})();
|
|
34630
34630
|
}
|
|
@@ -35279,7 +35279,7 @@ var require_client3 = __commonJS({
|
|
|
35279
35279
|
await this.rpc(request2);
|
|
35280
35280
|
}
|
|
35281
35281
|
async setCookie() {
|
|
35282
|
-
const url4 = (0,
|
|
35282
|
+
const url4 = (0, import_core46.concatLink)(this.url, "/cookie");
|
|
35283
35283
|
const response = await fetch(url4, { ...this.request, method: "PUT" });
|
|
35284
35284
|
if (!response.ok) {
|
|
35285
35285
|
const result = await response.json();
|
|
@@ -35289,7 +35289,7 @@ var require_client3 = __commonJS({
|
|
|
35289
35289
|
}
|
|
35290
35290
|
}
|
|
35291
35291
|
async deleteCookie() {
|
|
35292
|
-
const url4 = (0,
|
|
35292
|
+
const url4 = (0, import_core46.concatLink)(this.url, "/cookie");
|
|
35293
35293
|
const response = await fetch(url4, { ...this.request, method: "DELETE" });
|
|
35294
35294
|
if (!response.ok) {
|
|
35295
35295
|
const result = await response.json();
|
|
@@ -35568,9 +35568,9 @@ var require_config = __commonJS({
|
|
|
35568
35568
|
loadServerConfig: () => loadServerConfig4
|
|
35569
35569
|
});
|
|
35570
35570
|
module2.exports = __toCommonJS2(config_exports3);
|
|
35571
|
-
var
|
|
35571
|
+
var import_core46 = require_lib4();
|
|
35572
35572
|
async function loadServerConfig4(url4) {
|
|
35573
|
-
const configUrl = (0,
|
|
35573
|
+
const configUrl = (0, import_core46.concatLink)(url4, "/config.json");
|
|
35574
35574
|
const res = await fetch(configUrl, { keepalive: true });
|
|
35575
35575
|
if (res.ok) {
|
|
35576
35576
|
return await res.json();
|
|
@@ -35656,7 +35656,7 @@ var require_client4 = __commonJS({
|
|
|
35656
35656
|
getClient: () => getClient
|
|
35657
35657
|
});
|
|
35658
35658
|
module2.exports = __toCommonJS2(client_exports);
|
|
35659
|
-
var
|
|
35659
|
+
var import_core46 = require_lib4();
|
|
35660
35660
|
var import_utils14 = require_utils4();
|
|
35661
35661
|
function getClient(workspaceId, token, collaboratorUrl) {
|
|
35662
35662
|
const url4 = collaboratorUrl.replaceAll("wss://", "https://").replace("ws://", "http://");
|
|
@@ -35675,7 +35675,7 @@ var require_client4 = __commonJS({
|
|
|
35675
35675
|
async rpc(document2, method, payload) {
|
|
35676
35676
|
const workspace = this.workspace;
|
|
35677
35677
|
const documentId = (0, import_utils14.encodeDocumentId)(workspace, document2);
|
|
35678
|
-
const url4 = (0,
|
|
35678
|
+
const url4 = (0, import_core46.concatLink)(this.collaboratorUrl, `/rpc/${encodeURIComponent(documentId)}`);
|
|
35679
35679
|
const res = await fetch(url4, {
|
|
35680
35680
|
method: "POST",
|
|
35681
35681
|
headers: {
|
|
@@ -53242,9 +53242,9 @@ var require_image = __commonJS({
|
|
|
53242
53242
|
ImageNode: () => ImageNode
|
|
53243
53243
|
});
|
|
53244
53244
|
module2.exports = __toCommonJS2(image_exports);
|
|
53245
|
-
var
|
|
53245
|
+
var import_core46 = require_dist16();
|
|
53246
53246
|
var import_utils14 = require_utils5();
|
|
53247
|
-
var ImageNode =
|
|
53247
|
+
var ImageNode = import_core46.Node.create({
|
|
53248
53248
|
name: "image",
|
|
53249
53249
|
addOptions() {
|
|
53250
53250
|
return {
|
|
@@ -53303,7 +53303,7 @@ var require_image = __commonJS({
|
|
|
53303
53303
|
"data-type": this.name,
|
|
53304
53304
|
"data-align": node.attrs.align
|
|
53305
53305
|
};
|
|
53306
|
-
const imgAttributes = (0,
|
|
53306
|
+
const imgAttributes = (0, import_core46.mergeAttributes)(
|
|
53307
53307
|
{
|
|
53308
53308
|
"data-type": this.name
|
|
53309
53309
|
},
|
|
@@ -53347,9 +53347,9 @@ var require_reference = __commonJS({
|
|
|
53347
53347
|
ReferenceNode: () => ReferenceNode
|
|
53348
53348
|
});
|
|
53349
53349
|
module2.exports = __toCommonJS2(reference_exports);
|
|
53350
|
-
var
|
|
53350
|
+
var import_core46 = require_dist16();
|
|
53351
53351
|
var import_utils14 = require_utils5();
|
|
53352
|
-
var ReferenceNode =
|
|
53352
|
+
var ReferenceNode = import_core46.Node.create({
|
|
53353
53353
|
name: "reference",
|
|
53354
53354
|
group: "inline",
|
|
53355
53355
|
inline: true,
|
|
@@ -53384,7 +53384,7 @@ var require_reference = __commonJS({
|
|
|
53384
53384
|
renderHTML({ node, HTMLAttributes }) {
|
|
53385
53385
|
return [
|
|
53386
53386
|
"span",
|
|
53387
|
-
(0,
|
|
53387
|
+
(0, import_core46.mergeAttributes)(
|
|
53388
53388
|
{
|
|
53389
53389
|
"data-type": this.name,
|
|
53390
53390
|
"data-id": node.attrs.id,
|
|
@@ -53443,8 +53443,8 @@ var require_emoji = __commonJS({
|
|
|
53443
53443
|
EmojiNode: () => EmojiNode
|
|
53444
53444
|
});
|
|
53445
53445
|
module2.exports = __toCommonJS2(emoji_exports);
|
|
53446
|
-
var
|
|
53447
|
-
var EmojiNode =
|
|
53446
|
+
var import_core46 = require_dist16();
|
|
53447
|
+
var EmojiNode = import_core46.Node.create({
|
|
53448
53448
|
name: "emoji",
|
|
53449
53449
|
group: "inline",
|
|
53450
53450
|
inline: true,
|
|
@@ -53484,7 +53484,7 @@ var require_emoji = __commonJS({
|
|
|
53484
53484
|
addNodeView() {
|
|
53485
53485
|
return ({ node, HTMLAttributes }) => {
|
|
53486
53486
|
const container = document.createElement("span");
|
|
53487
|
-
const containerAttributes = (0,
|
|
53487
|
+
const containerAttributes = (0, import_core46.mergeAttributes)(
|
|
53488
53488
|
{
|
|
53489
53489
|
"data-type": this.name,
|
|
53490
53490
|
class: "emoji"
|
|
@@ -53517,7 +53517,7 @@ var require_emoji = __commonJS({
|
|
|
53517
53517
|
if (node.attrs.kind === "image") {
|
|
53518
53518
|
return [
|
|
53519
53519
|
"span",
|
|
53520
|
-
(0,
|
|
53520
|
+
(0, import_core46.mergeAttributes)(
|
|
53521
53521
|
{
|
|
53522
53522
|
"data-type": this.name,
|
|
53523
53523
|
class: "emoji"
|
|
@@ -53526,7 +53526,7 @@ var require_emoji = __commonJS({
|
|
|
53526
53526
|
),
|
|
53527
53527
|
[
|
|
53528
53528
|
"img",
|
|
53529
|
-
(0,
|
|
53529
|
+
(0, import_core46.mergeAttributes)({
|
|
53530
53530
|
"data-type": this.name,
|
|
53531
53531
|
src: node.attrs.image,
|
|
53532
53532
|
alt: node.attrs.emoji
|
|
@@ -53536,7 +53536,7 @@ var require_emoji = __commonJS({
|
|
|
53536
53536
|
}
|
|
53537
53537
|
return [
|
|
53538
53538
|
"span",
|
|
53539
|
-
(0,
|
|
53539
|
+
(0, import_core46.mergeAttributes)(
|
|
53540
53540
|
{
|
|
53541
53541
|
"data-type": this.name,
|
|
53542
53542
|
class: "emoji"
|
|
@@ -53844,8 +53844,8 @@ var require_file = __commonJS({
|
|
|
53844
53844
|
FileNode: () => FileNode
|
|
53845
53845
|
});
|
|
53846
53846
|
module2.exports = __toCommonJS2(file_exports);
|
|
53847
|
-
var
|
|
53848
|
-
var FileNode =
|
|
53847
|
+
var import_core46 = require_dist16();
|
|
53848
|
+
var FileNode = import_core46.Node.create({
|
|
53849
53849
|
name: "file",
|
|
53850
53850
|
addOptions() {
|
|
53851
53851
|
return {
|
|
@@ -54155,7 +54155,7 @@ var require_codeblock = __commonJS({
|
|
|
54155
54155
|
tildeInputRegex: () => tildeInputRegex
|
|
54156
54156
|
});
|
|
54157
54157
|
module2.exports = __toCommonJS2(codeblock_exports);
|
|
54158
|
-
var
|
|
54158
|
+
var import_core46 = require_dist16();
|
|
54159
54159
|
var import_extension_code_block = __toESM2(require_dist19());
|
|
54160
54160
|
var codeBlockOptions = {
|
|
54161
54161
|
defaultLanguage: "plaintext",
|
|
@@ -54201,11 +54201,11 @@ var require_codeblock = __commonJS({
|
|
|
54201
54201
|
},
|
|
54202
54202
|
addInputRules() {
|
|
54203
54203
|
return [
|
|
54204
|
-
(0,
|
|
54204
|
+
(0, import_core46.textblockTypeInputRule)({
|
|
54205
54205
|
find: backtickInputRegex,
|
|
54206
54206
|
type: this.type
|
|
54207
54207
|
}),
|
|
54208
|
-
(0,
|
|
54208
|
+
(0, import_core46.textblockTypeInputRule)({
|
|
54209
54209
|
find: tildeInputRegex,
|
|
54210
54210
|
type: this.type
|
|
54211
54211
|
})
|
|
@@ -54241,8 +54241,8 @@ var require_comment = __commonJS({
|
|
|
54241
54241
|
CommentNode: () => CommentNode
|
|
54242
54242
|
});
|
|
54243
54243
|
module2.exports = __toCommonJS2(comment_exports);
|
|
54244
|
-
var
|
|
54245
|
-
var CommentNode =
|
|
54244
|
+
var import_core46 = require_dist16();
|
|
54245
|
+
var CommentNode = import_core46.Node.create({
|
|
54246
54246
|
name: "comment",
|
|
54247
54247
|
group: "inline",
|
|
54248
54248
|
inline: true,
|
|
@@ -54288,8 +54288,8 @@ var require_markdown = __commonJS({
|
|
|
54288
54288
|
MarkdownNode: () => MarkdownNode
|
|
54289
54289
|
});
|
|
54290
54290
|
module2.exports = __toCommonJS2(markdown_exports);
|
|
54291
|
-
var
|
|
54292
|
-
var MarkdownNode =
|
|
54291
|
+
var import_core46 = require_dist16();
|
|
54292
|
+
var MarkdownNode = import_core46.Node.create({
|
|
54293
54293
|
name: "markdown",
|
|
54294
54294
|
group: "block",
|
|
54295
54295
|
content: "text*",
|
|
@@ -54307,7 +54307,7 @@ var require_markdown = __commonJS({
|
|
|
54307
54307
|
renderHTML({ node, HTMLAttributes }) {
|
|
54308
54308
|
return [
|
|
54309
54309
|
"pre",
|
|
54310
|
-
(0,
|
|
54310
|
+
(0, import_core46.mergeAttributes)({ "data-type": this.name }, this.options.HTMLAttributes, HTMLAttributes),
|
|
54311
54311
|
["code", {}, 0]
|
|
54312
54312
|
];
|
|
54313
54313
|
}
|
|
@@ -54341,8 +54341,8 @@ var require_embed = __commonJS({
|
|
|
54341
54341
|
EmbedNode: () => EmbedNode
|
|
54342
54342
|
});
|
|
54343
54343
|
module2.exports = __toCommonJS2(embed_exports);
|
|
54344
|
-
var
|
|
54345
|
-
var EmbedNode =
|
|
54344
|
+
var import_core46 = require_dist16();
|
|
54345
|
+
var EmbedNode = import_core46.Node.create({
|
|
54346
54346
|
name: "embed",
|
|
54347
54347
|
addOptions() {
|
|
54348
54348
|
return {};
|
|
@@ -54367,7 +54367,7 @@ var require_embed = __commonJS({
|
|
|
54367
54367
|
];
|
|
54368
54368
|
},
|
|
54369
54369
|
renderHTML({ HTMLAttributes }) {
|
|
54370
|
-
return ["figure", { "data-type": this.name }, ["iframe", (0,
|
|
54370
|
+
return ["figure", { "data-type": this.name }, ["iframe", (0, import_core46.mergeAttributes)(HTMLAttributes)]];
|
|
54371
54371
|
}
|
|
54372
54372
|
});
|
|
54373
54373
|
}
|
|
@@ -54441,7 +54441,7 @@ var require_noteBase = __commonJS({
|
|
|
54441
54441
|
name: () => name
|
|
54442
54442
|
});
|
|
54443
54443
|
module2.exports = __toCommonJS2(noteBase_exports);
|
|
54444
|
-
var
|
|
54444
|
+
var import_core46 = require_dist16();
|
|
54445
54445
|
var import_nodes = require_nodes();
|
|
54446
54446
|
var name = "note";
|
|
54447
54447
|
var NoteKind = /* @__PURE__ */ ((NoteKind2) => {
|
|
@@ -54456,7 +54456,7 @@ var require_noteBase = __commonJS({
|
|
|
54456
54456
|
NoteKind2["PrimaryLight"] = "primary-light";
|
|
54457
54457
|
return NoteKind2;
|
|
54458
54458
|
})(NoteKind || {});
|
|
54459
|
-
var NoteBaseExtension =
|
|
54459
|
+
var NoteBaseExtension = import_core46.Mark.create({
|
|
54460
54460
|
name,
|
|
54461
54461
|
parseHTML() {
|
|
54462
54462
|
return [
|
|
@@ -54513,9 +54513,9 @@ var require_qmsInlineCommentMark = __commonJS({
|
|
|
54513
54513
|
QMSInlineCommentMark: () => QMSInlineCommentMark
|
|
54514
54514
|
});
|
|
54515
54515
|
module2.exports = __toCommonJS2(qmsInlineCommentMark_exports);
|
|
54516
|
-
var
|
|
54516
|
+
var import_core46 = require_dist16();
|
|
54517
54517
|
var NAME2 = "node-uuid";
|
|
54518
|
-
var QMSInlineCommentMark =
|
|
54518
|
+
var QMSInlineCommentMark = import_core46.Mark.create({
|
|
54519
54519
|
name: NAME2,
|
|
54520
54520
|
inline: true,
|
|
54521
54521
|
parseHTML() {
|
|
@@ -54560,9 +54560,9 @@ var require_kit = __commonJS({
|
|
|
54560
54560
|
mergeKitOptions: () => mergeKitOptions
|
|
54561
54561
|
});
|
|
54562
54562
|
module2.exports = __toCommonJS2(kit_exports);
|
|
54563
|
-
var
|
|
54563
|
+
var import_core46 = require_dist16();
|
|
54564
54564
|
function extensionKit(name, fn2) {
|
|
54565
|
-
return
|
|
54565
|
+
return import_core46.Extension.create({
|
|
54566
54566
|
name,
|
|
54567
54567
|
addExtensions() {
|
|
54568
54568
|
const e = /* @__PURE__ */ __name((extension, options) => {
|
|
@@ -61591,9 +61591,9 @@ var require_colors = __commonJS({
|
|
|
61591
61591
|
TextColor: () => TextColor
|
|
61592
61592
|
});
|
|
61593
61593
|
module2.exports = __toCommonJS2(colors_exports);
|
|
61594
|
-
var
|
|
61594
|
+
var import_core46 = require_dist16();
|
|
61595
61595
|
var import_extension_text_style = require_dist20();
|
|
61596
|
-
var BackgroundColor =
|
|
61596
|
+
var BackgroundColor = import_core46.Extension.create({
|
|
61597
61597
|
name: "backgroundColor",
|
|
61598
61598
|
addOptions() {
|
|
61599
61599
|
return {
|
|
@@ -61634,7 +61634,7 @@ var require_colors = __commonJS({
|
|
|
61634
61634
|
};
|
|
61635
61635
|
}
|
|
61636
61636
|
});
|
|
61637
|
-
var TextColor =
|
|
61637
|
+
var TextColor = import_core46.Extension.create({
|
|
61638
61638
|
name: "textColor",
|
|
61639
61639
|
addOptions() {
|
|
61640
61640
|
return {
|
|
@@ -61706,10 +61706,10 @@ var require_inlineComment = __commonJS({
|
|
|
61706
61706
|
InlineCommentPasteFixPlugin: () => InlineCommentPasteFixPlugin
|
|
61707
61707
|
});
|
|
61708
61708
|
module2.exports = __toCommonJS2(inlineComment_exports);
|
|
61709
|
-
var
|
|
61709
|
+
var import_core46 = require_dist16();
|
|
61710
61710
|
var import_model = require_dist10();
|
|
61711
61711
|
var import_state = require_dist5();
|
|
61712
|
-
var InlineCommentMark =
|
|
61712
|
+
var InlineCommentMark = import_core46.Mark.create({
|
|
61713
61713
|
name: "inline-comment",
|
|
61714
61714
|
excludes: "",
|
|
61715
61715
|
inclusive: false,
|
|
@@ -77233,7 +77233,7 @@ var require_client5 = __commonJS({
|
|
|
77233
77233
|
createMarkupOperations: () => createMarkupOperations
|
|
77234
77234
|
});
|
|
77235
77235
|
module2.exports = __toCommonJS2(client_exports);
|
|
77236
|
-
var
|
|
77236
|
+
var import_core46 = require_lib4();
|
|
77237
77237
|
var import_collaborator_client2 = require_lib7();
|
|
77238
77238
|
var import_text4 = require_lib9();
|
|
77239
77239
|
var import_text_markdown3 = require_lib17();
|
|
@@ -77247,8 +77247,8 @@ var require_client5 = __commonJS({
|
|
|
77247
77247
|
this.workspace = workspace;
|
|
77248
77248
|
this.token = token;
|
|
77249
77249
|
this.config = config3;
|
|
77250
|
-
this.refUrl = (0,
|
|
77251
|
-
this.imageUrl = (0,
|
|
77250
|
+
this.refUrl = (0, import_core46.concatLink)(this.url, `/browse?workspace=${workspace}`);
|
|
77251
|
+
this.imageUrl = (0, import_core46.concatLink)(this.url, `/files?workspace=${workspace}&file=`);
|
|
77252
77252
|
this.collaborator = (0, import_collaborator_client2.getClient)(workspace, token, config3.COLLABORATOR_URL);
|
|
77253
77253
|
}
|
|
77254
77254
|
static {
|
|
@@ -77258,7 +77258,7 @@ var require_client5 = __commonJS({
|
|
|
77258
77258
|
imageUrl;
|
|
77259
77259
|
refUrl;
|
|
77260
77260
|
async fetchMarkup(objectClass, objectId, objectAttr, doc, format7) {
|
|
77261
|
-
const collabId = (0,
|
|
77261
|
+
const collabId = (0, import_core46.makeCollabId)(objectClass, objectId, objectAttr);
|
|
77262
77262
|
const markup = await this.collaborator.getMarkup(collabId, doc);
|
|
77263
77263
|
const json3 = (0, import_text4.markupToJSON)(markup);
|
|
77264
77264
|
switch (format7) {
|
|
@@ -77287,7 +77287,7 @@ var require_client5 = __commonJS({
|
|
|
77287
77287
|
default:
|
|
77288
77288
|
throw new Error("Unknown content format");
|
|
77289
77289
|
}
|
|
77290
|
-
const collabId = (0,
|
|
77290
|
+
const collabId = (0, import_core46.makeCollabId)(objectClass, objectId, objectAttr);
|
|
77291
77291
|
return await this.collaborator.createMarkup(collabId, markup);
|
|
77292
77292
|
}
|
|
77293
77293
|
};
|
|
@@ -81771,8 +81771,8 @@ var require_connection2 = __commonJS({
|
|
|
81771
81771
|
});
|
|
81772
81772
|
module2.exports = __toCommonJS2(connection_exports);
|
|
81773
81773
|
var import_analytics = require_lib2();
|
|
81774
|
-
var
|
|
81775
|
-
var
|
|
81774
|
+
var import_client24 = __toESM2(require_lib6());
|
|
81775
|
+
var import_core46 = __toESM2(require_lib4());
|
|
81776
81776
|
var import_platform2 = __toESM2(require_lib());
|
|
81777
81777
|
var import_rpc = require_lib18();
|
|
81778
81778
|
var import_snappyjs = require_snappyjs();
|
|
@@ -81816,7 +81816,7 @@ var require_connection2 = __commonJS({
|
|
|
81816
81816
|
const sKey = "session.id." + this.url;
|
|
81817
81817
|
let sessionId = sessionStorage.getItem(sKey) ?? void 0;
|
|
81818
81818
|
if (sessionId === void 0) {
|
|
81819
|
-
sessionId = (0,
|
|
81819
|
+
sessionId = (0, import_core46.generateId)();
|
|
81820
81820
|
console.log("Generate new SessionId", sessionId);
|
|
81821
81821
|
this.sessionId = sessionId;
|
|
81822
81822
|
} else {
|
|
@@ -81827,7 +81827,7 @@ var require_connection2 = __commonJS({
|
|
|
81827
81827
|
sessionStorage.setItem(sKey, sessionId);
|
|
81828
81828
|
});
|
|
81829
81829
|
} else {
|
|
81830
|
-
this.sessionId = (0,
|
|
81830
|
+
this.sessionId = (0, import_core46.generateId)();
|
|
81831
81831
|
}
|
|
81832
81832
|
this.rpcHandler = opt?.useGlobalRPCHandler === true ? globalRPCHandler : new import_rpc.RPCHandler();
|
|
81833
81833
|
this.pushHandler(handler);
|
|
@@ -81882,7 +81882,7 @@ var require_connection2 = __commonJS({
|
|
|
81882
81882
|
}
|
|
81883
81883
|
if (!this.closed) {
|
|
81884
81884
|
void this.sendRequest({
|
|
81885
|
-
method:
|
|
81885
|
+
method: import_client24.pingConst,
|
|
81886
81886
|
params: [],
|
|
81887
81887
|
once: true,
|
|
81888
81888
|
handleResult: /* @__PURE__ */ __name(async (result) => {
|
|
@@ -81915,7 +81915,7 @@ var require_connection2 = __commonJS({
|
|
|
81915
81915
|
}
|
|
81916
81916
|
}
|
|
81917
81917
|
isConnected() {
|
|
81918
|
-
return this.websocket != null && this.websocket.readyState ===
|
|
81918
|
+
return this.websocket != null && this.websocket.readyState === import_client24.ClientSocketReadyState.OPEN && this.helloReceived;
|
|
81919
81919
|
}
|
|
81920
81920
|
delay = 0;
|
|
81921
81921
|
onConnectHandlers = [];
|
|
@@ -82007,7 +82007,7 @@ var require_connection2 = __commonJS({
|
|
|
82007
82007
|
if (resp.id === -1) {
|
|
82008
82008
|
this.delay = 0;
|
|
82009
82009
|
if (resp.result?.state === "upgrading") {
|
|
82010
|
-
void this.onConnect?.(
|
|
82010
|
+
void this.onConnect?.(import_core46.ClientConnectEvent.Maintenance, void 0, resp.result.stats);
|
|
82011
82011
|
this.upgrading = true;
|
|
82012
82012
|
this.delay = 3;
|
|
82013
82013
|
return;
|
|
@@ -82042,7 +82042,7 @@ var require_connection2 = __commonJS({
|
|
|
82042
82042
|
v.reconnect?.();
|
|
82043
82043
|
}
|
|
82044
82044
|
void this.onConnect?.(
|
|
82045
|
-
helloResp.reconnect === true ?
|
|
82045
|
+
helloResp.reconnect === true ? import_core46.ClientConnectEvent.Reconnected : import_core46.ClientConnectEvent.Connected,
|
|
82046
82046
|
helloResp.lastTx,
|
|
82047
82047
|
this.sessionId
|
|
82048
82048
|
)?.catch((err) => {
|
|
@@ -82055,8 +82055,8 @@ var require_connection2 = __commonJS({
|
|
|
82055
82055
|
}
|
|
82056
82056
|
return;
|
|
82057
82057
|
}
|
|
82058
|
-
if (resp.result ===
|
|
82059
|
-
void this.sendRequest({ method:
|
|
82058
|
+
if (resp.result === import_client24.pingConst) {
|
|
82059
|
+
void this.sendRequest({ method: import_client24.pingConst, params: [] }).catch((err) => {
|
|
82060
82060
|
this.ctx.error("failed to send ping", { err });
|
|
82061
82061
|
});
|
|
82062
82062
|
return;
|
|
@@ -82092,7 +82092,7 @@ var require_connection2 = __commonJS({
|
|
|
82092
82092
|
}
|
|
82093
82093
|
result = result.concat(c.data);
|
|
82094
82094
|
}
|
|
82095
|
-
resp.result = (0,
|
|
82095
|
+
resp.result = (0, import_core46.toFindResult)(result, total, lookupMap);
|
|
82096
82096
|
resp.chunk = void 0;
|
|
82097
82097
|
} else {
|
|
82098
82098
|
return;
|
|
@@ -82136,7 +82136,7 @@ var require_connection2 = __commonJS({
|
|
|
82136
82136
|
} else {
|
|
82137
82137
|
const txArr = Array.isArray(resp.result) ? resp.result : [resp.result];
|
|
82138
82138
|
for (const tx of txArr) {
|
|
82139
|
-
if (tx?._class ===
|
|
82139
|
+
if (tx?._class === import_core46.default.class.TxModelUpgrade) {
|
|
82140
82140
|
console.log("Processing upgrade", this.workspace, this.user);
|
|
82141
82141
|
this.opt?.onUpgrade?.();
|
|
82142
82142
|
return;
|
|
@@ -82148,15 +82148,15 @@ var require_connection2 = __commonJS({
|
|
|
82148
82148
|
}
|
|
82149
82149
|
}
|
|
82150
82150
|
checkArrayBufferPing(data) {
|
|
82151
|
-
if (data.byteLength ===
|
|
82151
|
+
if (data.byteLength === import_client24.pingConst.length || data.byteLength === import_client24.pongConst.length) {
|
|
82152
82152
|
const text = new TextDecoder().decode(data);
|
|
82153
|
-
if (text ===
|
|
82154
|
-
void this.sendRequest({ method:
|
|
82153
|
+
if (text === import_client24.pingConst) {
|
|
82154
|
+
void this.sendRequest({ method: import_client24.pingConst, params: [] }).catch((err) => {
|
|
82155
82155
|
this.ctx.error("failed to send ping", { err });
|
|
82156
82156
|
});
|
|
82157
82157
|
return true;
|
|
82158
82158
|
}
|
|
82159
|
-
if (text ===
|
|
82159
|
+
if (text === import_client24.pongConst) {
|
|
82160
82160
|
this.pingResponse = Date.now();
|
|
82161
82161
|
return true;
|
|
82162
82162
|
}
|
|
@@ -82166,7 +82166,7 @@ var require_connection2 = __commonJS({
|
|
|
82166
82166
|
openConnection(ctx, socketId) {
|
|
82167
82167
|
this.binaryMode = false;
|
|
82168
82168
|
this.helloReceived = false;
|
|
82169
|
-
const clientSocketFactory = this.opt?.socketFactory ?? (0, import_platform2.getMetadata)(
|
|
82169
|
+
const clientSocketFactory = this.opt?.socketFactory ?? (0, import_platform2.getMetadata)(import_client24.default.metadata.ClientSocketFactory) ?? ((url4) => {
|
|
82170
82170
|
const s = new WebSocket(url4);
|
|
82171
82171
|
return s;
|
|
82172
82172
|
});
|
|
@@ -82201,12 +82201,12 @@ var require_connection2 = __commonJS({
|
|
|
82201
82201
|
if (this.websocket !== wsocket) {
|
|
82202
82202
|
return;
|
|
82203
82203
|
}
|
|
82204
|
-
if (event.data ===
|
|
82204
|
+
if (event.data === import_client24.pongConst) {
|
|
82205
82205
|
this.pingResponse = Date.now();
|
|
82206
82206
|
return;
|
|
82207
82207
|
}
|
|
82208
|
-
if (event.data ===
|
|
82209
|
-
void this.sendRequest({ method:
|
|
82208
|
+
if (event.data === import_client24.pingConst) {
|
|
82209
|
+
void this.sendRequest({ method: import_client24.pingConst, params: [] }).catch((err) => {
|
|
82210
82210
|
this.ctx.error("failed to send ping", { err });
|
|
82211
82211
|
});
|
|
82212
82212
|
return;
|
|
@@ -82271,8 +82271,8 @@ var require_connection2 = __commonJS({
|
|
|
82271
82271
|
if (this.websocket !== wsocket) {
|
|
82272
82272
|
return;
|
|
82273
82273
|
}
|
|
82274
|
-
const useBinary = this.opt?.useBinaryProtocol ?? (0, import_platform2.getMetadata)(
|
|
82275
|
-
this.compressionMode = this.opt?.useProtocolCompression ?? (0, import_platform2.getMetadata)(
|
|
82274
|
+
const useBinary = this.opt?.useBinaryProtocol ?? (0, import_platform2.getMetadata)(import_client24.default.metadata.UseBinaryProtocol) ?? true;
|
|
82275
|
+
this.compressionMode = this.opt?.useProtocolCompression ?? (0, import_platform2.getMetadata)(import_client24.default.metadata.UseProtocolCompression) ?? false;
|
|
82276
82276
|
const helloRequest = {
|
|
82277
82277
|
method: "hello",
|
|
82278
82278
|
params: [],
|
|
@@ -82318,13 +82318,13 @@ var require_connection2 = __commonJS({
|
|
|
82318
82318
|
if (w instanceof Promise) {
|
|
82319
82319
|
await w;
|
|
82320
82320
|
}
|
|
82321
|
-
if (data.method !==
|
|
82321
|
+
if (data.method !== import_client24.pingConst) {
|
|
82322
82322
|
this.requests.set(id, promise4);
|
|
82323
82323
|
}
|
|
82324
82324
|
promise4.sendData = () => {
|
|
82325
|
-
if (this.websocket?.readyState ===
|
|
82325
|
+
if (this.websocket?.readyState === import_client24.ClientSocketReadyState.OPEN) {
|
|
82326
82326
|
promise4.startTime = Date.now();
|
|
82327
|
-
if (data.method !==
|
|
82327
|
+
if (data.method !== import_client24.pingConst) {
|
|
82328
82328
|
const dta = this.rpcHandler.serialize(
|
|
82329
82329
|
{
|
|
82330
82330
|
method: data.method,
|
|
@@ -82337,7 +82337,7 @@ var require_connection2 = __commonJS({
|
|
|
82337
82337
|
);
|
|
82338
82338
|
this.websocket?.send(dta);
|
|
82339
82339
|
} else {
|
|
82340
|
-
this.websocket?.send(
|
|
82340
|
+
this.websocket?.send(import_client24.pingConst);
|
|
82341
82341
|
}
|
|
82342
82342
|
}
|
|
82343
82343
|
};
|
|
@@ -82351,7 +82351,7 @@ var require_connection2 = __commonJS({
|
|
|
82351
82351
|
};
|
|
82352
82352
|
}
|
|
82353
82353
|
promise4.sendData();
|
|
82354
|
-
if (data.method !==
|
|
82354
|
+
if (data.method !== import_client24.pingConst) {
|
|
82355
82355
|
return await promise4.promise;
|
|
82356
82356
|
}
|
|
82357
82357
|
},
|
|
@@ -82366,7 +82366,7 @@ var require_connection2 = __commonJS({
|
|
|
82366
82366
|
}
|
|
82367
82367
|
getAccount() {
|
|
82368
82368
|
if (this.account !== void 0) {
|
|
82369
|
-
return Promise.resolve((0,
|
|
82369
|
+
return Promise.resolve((0, import_core46.clone)(this.account));
|
|
82370
82370
|
}
|
|
82371
82371
|
return this.sendRequest({ method: "getAccount", params: [] });
|
|
82372
82372
|
}
|
|
@@ -82424,10 +82424,10 @@ var require_connection2 = __commonJS({
|
|
|
82424
82424
|
method: "tx",
|
|
82425
82425
|
params: [tx],
|
|
82426
82426
|
retry: /* @__PURE__ */ __name(async () => {
|
|
82427
|
-
if (tx._class ===
|
|
82428
|
-
return (await this.findAll(
|
|
82427
|
+
if (tx._class === import_core46.default.class.TxApplyIf) {
|
|
82428
|
+
return (await this.findAll(import_core46.default.class.Tx, { _id: tx.txes[0]._id }, { limit: 1 })).length === 0;
|
|
82429
82429
|
}
|
|
82430
|
-
return (await this.findAll(
|
|
82430
|
+
return (await this.findAll(import_core46.default.class.Tx, { _id: tx._id }, { limit: 1 })).length === 0;
|
|
82431
82431
|
}, "retry")
|
|
82432
82432
|
});
|
|
82433
82433
|
}
|
|
@@ -82467,7 +82467,7 @@ var require_connection2 = __commonJS({
|
|
|
82467
82467
|
};
|
|
82468
82468
|
function connect(url4, handler, workspace, user, opt) {
|
|
82469
82469
|
return new Connection(
|
|
82470
|
-
opt?.ctx?.newChild?.("connection", {}) ?? new
|
|
82470
|
+
opt?.ctx?.newChild?.("connection", {}) ?? new import_core46.MeasureMetricsContext("connection", {}),
|
|
82471
82471
|
url4,
|
|
82472
82472
|
handler,
|
|
82473
82473
|
workspace,
|
|
@@ -82517,14 +82517,14 @@ var require_lib19 = __commonJS({
|
|
|
82517
82517
|
default: () => index_default
|
|
82518
82518
|
});
|
|
82519
82519
|
module2.exports = __toCommonJS2(index_exports2);
|
|
82520
|
-
var
|
|
82521
|
-
var
|
|
82520
|
+
var import_client24 = __toESM2(require_lib6());
|
|
82521
|
+
var import_core46 = __toESM2(require_lib4());
|
|
82522
82522
|
var import_platform2 = __toESM2(require_lib());
|
|
82523
82523
|
var import_connection = require_connection2();
|
|
82524
82524
|
var dbRequest;
|
|
82525
82525
|
var dbPromise = Promise.resolve(void 0);
|
|
82526
82526
|
if (typeof localStorage !== "undefined") {
|
|
82527
|
-
const st = (0,
|
|
82527
|
+
const st = (0, import_core46.platformNow)();
|
|
82528
82528
|
dbPromise = new Promise((resolve2) => {
|
|
82529
82529
|
dbRequest = indexedDB.open("model.db.persistence", 2);
|
|
82530
82530
|
dbRequest.onupgradeneeded = function() {
|
|
@@ -82535,7 +82535,7 @@ var require_lib19 = __commonJS({
|
|
|
82535
82535
|
};
|
|
82536
82536
|
dbRequest.onsuccess = function() {
|
|
82537
82537
|
const db = dbRequest.result;
|
|
82538
|
-
console.log("init DB complete", (0,
|
|
82538
|
+
console.log("init DB complete", (0, import_core46.platformNow)() - st);
|
|
82539
82539
|
resolve2(db);
|
|
82540
82540
|
};
|
|
82541
82541
|
});
|
|
@@ -82561,19 +82561,19 @@ var require_lib19 = __commonJS({
|
|
|
82561
82561
|
return {
|
|
82562
82562
|
function: {
|
|
82563
82563
|
GetClient: /* @__PURE__ */ __name(async (token, endpoint, opt) => {
|
|
82564
|
-
const filterModel = (0, import_platform2.getMetadata)(
|
|
82565
|
-
const extraFilter = (0, import_platform2.getMetadata)(
|
|
82564
|
+
const filterModel = (0, import_platform2.getMetadata)(import_client24.default.metadata.FilterModel) ?? "none";
|
|
82565
|
+
const extraFilter = (0, import_platform2.getMetadata)(import_client24.default.metadata.ExtraFilter) ?? [];
|
|
82566
82566
|
const handler = /* @__PURE__ */ __name(async (handler2) => {
|
|
82567
|
-
const url4 = (0,
|
|
82567
|
+
const url4 = (0, import_core46.concatLink)(endpoint, `/${token}`);
|
|
82568
82568
|
const upgradeHandler = /* @__PURE__ */ __name((...txes) => {
|
|
82569
82569
|
for (const tx of txes) {
|
|
82570
|
-
if (tx?._class ===
|
|
82570
|
+
if (tx?._class === import_core46.default.class.TxModelUpgrade) {
|
|
82571
82571
|
opt?.onUpgrade?.();
|
|
82572
82572
|
return;
|
|
82573
82573
|
}
|
|
82574
|
-
if (tx?._class ===
|
|
82574
|
+
if (tx?._class === import_core46.default.class.TxWorkspaceEvent) {
|
|
82575
82575
|
const event = tx;
|
|
82576
|
-
if (event.event ===
|
|
82576
|
+
if (event.event === import_core46.WorkspaceEvent.MaintenanceNotification) {
|
|
82577
82577
|
void (0, import_platform2.setPlatformStatus)(
|
|
82578
82578
|
new import_platform2.Status(import_platform2.Severity.WARNING, import_platform2.default.status.MaintenanceWarning, {
|
|
82579
82579
|
time: event.params.timeMinutes,
|
|
@@ -82590,7 +82590,7 @@ var require_lib19 = __commonJS({
|
|
|
82590
82590
|
throw new Error("Workspace or account not found in token");
|
|
82591
82591
|
}
|
|
82592
82592
|
const newOpt = { ...opt };
|
|
82593
|
-
const connectTimeout = opt?.connectionTimeout ?? (0, import_platform2.getMetadata)(
|
|
82593
|
+
const connectTimeout = opt?.connectionTimeout ?? (0, import_platform2.getMetadata)(import_client24.default.metadata.ConnectionTimeout);
|
|
82594
82594
|
let connectPromise;
|
|
82595
82595
|
if ((connectTimeout ?? 0) > 0) {
|
|
82596
82596
|
connectPromise = new Promise((resolve2, reject) => {
|
|
@@ -82611,7 +82611,7 @@ var require_lib19 = __commonJS({
|
|
|
82611
82611
|
reject(error2);
|
|
82612
82612
|
return;
|
|
82613
82613
|
}
|
|
82614
|
-
if (event !==
|
|
82614
|
+
if (event !== import_core46.ClientConnectEvent.Maintenance) {
|
|
82615
82615
|
clearTimeout(connectTO);
|
|
82616
82616
|
resolve2();
|
|
82617
82617
|
}
|
|
@@ -82633,7 +82633,7 @@ var require_lib19 = __commonJS({
|
|
|
82633
82633
|
}
|
|
82634
82634
|
return txes;
|
|
82635
82635
|
}, "modelFilter");
|
|
82636
|
-
const client = (0,
|
|
82636
|
+
const client = (0, import_core46.createClient)(handler, modelFilter, createModelPersistence(getWSFromToken(token)), opt?.ctx);
|
|
82637
82637
|
return await client;
|
|
82638
82638
|
}, "GetClient")
|
|
82639
82639
|
}
|
|
@@ -82641,17 +82641,17 @@ var require_lib19 = __commonJS({
|
|
|
82641
82641
|
}, "default");
|
|
82642
82642
|
function returnUITxes(txes, extraFilter) {
|
|
82643
82643
|
const configs = /* @__PURE__ */ new Map();
|
|
82644
|
-
(0,
|
|
82645
|
-
const allowedPlugins = [...(0, import_platform2.getPlugins)(), ...(0, import_platform2.getMetadata)(
|
|
82644
|
+
(0, import_core46.fillConfiguration)(txes, configs);
|
|
82645
|
+
const allowedPlugins = [...(0, import_platform2.getPlugins)(), ...(0, import_platform2.getMetadata)(import_client24.default.metadata.ExtraPlugins) ?? []];
|
|
82646
82646
|
const excludedPlugins = Array.from(configs.values()).filter(
|
|
82647
82647
|
(it) => !it.enabled || !allowedPlugins.includes(it.pluginId) || extraFilter.includes(it.pluginId)
|
|
82648
82648
|
);
|
|
82649
|
-
return (0,
|
|
82649
|
+
return (0, import_core46.pluginFilterTx)(excludedPlugins, configs, txes);
|
|
82650
82650
|
}
|
|
82651
82651
|
__name(returnUITxes, "returnUITxes");
|
|
82652
82652
|
function returnClientTxes(txes) {
|
|
82653
82653
|
const configs = /* @__PURE__ */ new Map();
|
|
82654
|
-
(0,
|
|
82654
|
+
(0, import_core46.fillConfiguration)(txes, configs);
|
|
82655
82655
|
const excludedPlugins = Array.from(configs.values()).filter((it) => !it.enabled || it.pluginId.startsWith("server-"));
|
|
82656
82656
|
const toExclude = /* @__PURE__ */ new Set([
|
|
82657
82657
|
"workbench:class:Application",
|
|
@@ -82677,8 +82677,8 @@ var require_lib19 = __commonJS({
|
|
|
82677
82677
|
"setting:class:WorkspaceSettingCategory",
|
|
82678
82678
|
"notification:class:NotificationProvider"
|
|
82679
82679
|
]);
|
|
82680
|
-
const result = (0,
|
|
82681
|
-
if (tx?._class ===
|
|
82680
|
+
const result = (0, import_core46.pluginFilterTx)(excludedPlugins, configs, txes).filter((tx) => {
|
|
82681
|
+
if (tx?._class === import_core46.default.class.TxCreateDoc || tx?._class === import_core46.default.class.TxUpdateDoc || tx?._class === import_core46.default.class.TxRemoveDoc) {
|
|
82682
82682
|
const cud = tx;
|
|
82683
82683
|
if (toExclude.has(cud.objectClass)) {
|
|
82684
82684
|
return false;
|
|
@@ -82690,7 +82690,7 @@ var require_lib19 = __commonJS({
|
|
|
82690
82690
|
}
|
|
82691
82691
|
__name(returnClientTxes, "returnClientTxes");
|
|
82692
82692
|
function createModelPersistence(workspace) {
|
|
82693
|
-
const overrideStore = (0, import_platform2.getMetadata)(
|
|
82693
|
+
const overrideStore = (0, import_platform2.getMetadata)(import_client24.default.metadata.OverridePersistenceStore);
|
|
82694
82694
|
if (overrideStore !== void 0) {
|
|
82695
82695
|
return overrideStore;
|
|
82696
82696
|
}
|
|
@@ -82787,8 +82787,8 @@ var require_client6 = __commonJS({
|
|
|
82787
82787
|
});
|
|
82788
82788
|
module2.exports = __toCommonJS2(client_exports);
|
|
82789
82789
|
var import_account_client2 = require_lib5();
|
|
82790
|
-
var
|
|
82791
|
-
var
|
|
82790
|
+
var import_client24 = __toESM2(require_lib6());
|
|
82791
|
+
var import_core46 = require_lib4();
|
|
82792
82792
|
var import_platform2 = require_lib();
|
|
82793
82793
|
var import_config8 = require_config();
|
|
82794
82794
|
var import_markup = require_markup();
|
|
@@ -82805,7 +82805,7 @@ var require_client6 = __commonJS({
|
|
|
82805
82805
|
const account = {
|
|
82806
82806
|
uuid: wsLoginInfo.account,
|
|
82807
82807
|
role: wsLoginInfo.role,
|
|
82808
|
-
primarySocialId: (0,
|
|
82808
|
+
primarySocialId: (0, import_core46.pickPrimarySocialId)(socialIds)._id,
|
|
82809
82809
|
socialIds: socialIds.map((si) => si._id),
|
|
82810
82810
|
fullSocialIds: socialIds
|
|
82811
82811
|
};
|
|
@@ -82813,9 +82813,9 @@ var require_client6 = __commonJS({
|
|
|
82813
82813
|
}
|
|
82814
82814
|
__name(connect, "connect");
|
|
82815
82815
|
async function createClient(url4, endpoint, token, workspaceUuid, account, config3, options) {
|
|
82816
|
-
(0, import_platform2.addLocation)(
|
|
82816
|
+
(0, import_platform2.addLocation)(import_client24.clientId, () => Promise.resolve().then(() => __toESM(require_lib19())));
|
|
82817
82817
|
const { socketFactory, connectionTimeout } = options;
|
|
82818
|
-
const clientFactory = await (0, import_platform2.getResource)(
|
|
82818
|
+
const clientFactory = await (0, import_platform2.getResource)(import_client24.default.function.GetClient);
|
|
82819
82819
|
const connection = await clientFactory(token, endpoint, {
|
|
82820
82820
|
socketFactory,
|
|
82821
82821
|
connectionTimeout
|
|
@@ -82831,7 +82831,7 @@ var require_client6 = __commonJS({
|
|
|
82831
82831
|
this.config = config3;
|
|
82832
82832
|
this.connection = connection;
|
|
82833
82833
|
this.account = account;
|
|
82834
|
-
this.client = new
|
|
82834
|
+
this.client = new import_core46.TxOperations(connection, account.primarySocialId);
|
|
82835
82835
|
this.markup = (0, import_markup.createMarkupOperations)(url4, workspace, token, config3);
|
|
82836
82836
|
}
|
|
82837
82837
|
static {
|
|
@@ -82871,7 +82871,7 @@ var require_client6 = __commonJS({
|
|
|
82871
82871
|
}
|
|
82872
82872
|
// DocOperations
|
|
82873
82873
|
async createDoc(_class, space, attributes, id) {
|
|
82874
|
-
id ??= (0,
|
|
82874
|
+
id ??= (0, import_core46.generateId)();
|
|
82875
82875
|
const data = await this.processMarkup(_class, id, attributes);
|
|
82876
82876
|
return await this.client.createDoc(_class, space, data, id);
|
|
82877
82877
|
}
|
|
@@ -82884,7 +82884,7 @@ var require_client6 = __commonJS({
|
|
|
82884
82884
|
}
|
|
82885
82885
|
// CollectionOperations
|
|
82886
82886
|
async addCollection(_class, space, attachedTo, attachedToClass, collection, attributes, id) {
|
|
82887
|
-
id ??= (0,
|
|
82887
|
+
id ??= (0, import_core46.generateId)();
|
|
82888
82888
|
const data = await this.processMarkup(_class, id, attributes);
|
|
82889
82889
|
return await this.client.addCollection(_class, space, attachedTo, attachedToClass, collection, data, id);
|
|
82890
82890
|
}
|
|
@@ -83211,7 +83211,7 @@ var require_rest = __commonJS({
|
|
|
83211
83211
|
createRestClient: () => createRestClient2
|
|
83212
83212
|
});
|
|
83213
83213
|
module2.exports = __toCommonJS2(rest_exports);
|
|
83214
|
-
var
|
|
83214
|
+
var import_core46 = require_lib4();
|
|
83215
83215
|
var import_platform2 = require_lib();
|
|
83216
83216
|
var import_utils14 = require_utils9();
|
|
83217
83217
|
var import_utils22 = require_utils10();
|
|
@@ -83266,7 +83266,7 @@ var require_rest = __commonJS({
|
|
|
83266
83266
|
if (options !== void 0 && Object.keys(options).length > 0) {
|
|
83267
83267
|
params.append("options", JSON.stringify(options));
|
|
83268
83268
|
}
|
|
83269
|
-
const requestUrl = (0,
|
|
83269
|
+
const requestUrl = (0, import_core46.concatLink)(this.endpoint, `/api/v1/find-all/${this.workspace}?${params.toString()}`);
|
|
83270
83270
|
const result = await (0, import_utils22.withRetry)(async () => {
|
|
83271
83271
|
const response = await fetch(requestUrl, this.requestInit());
|
|
83272
83272
|
if (!response.ok) {
|
|
@@ -83340,7 +83340,7 @@ var require_rest = __commonJS({
|
|
|
83340
83340
|
}
|
|
83341
83341
|
}
|
|
83342
83342
|
async getAccount() {
|
|
83343
|
-
const requestUrl = (0,
|
|
83343
|
+
const requestUrl = (0, import_core46.concatLink)(this.endpoint, `/api/v1/account/${this.workspace}`);
|
|
83344
83344
|
await this.checkRate();
|
|
83345
83345
|
const result = await (0, import_utils22.withRetry)(async () => {
|
|
83346
83346
|
const response = await fetch(requestUrl, this.requestInit());
|
|
@@ -83357,7 +83357,7 @@ var require_rest = __commonJS({
|
|
|
83357
83357
|
return result;
|
|
83358
83358
|
}
|
|
83359
83359
|
async getModel(full = false) {
|
|
83360
|
-
const requestUrl = new URL((0,
|
|
83360
|
+
const requestUrl = new URL((0, import_core46.concatLink)(this.endpoint, `/api/v1/load-model/${this.workspace}`));
|
|
83361
83361
|
if (full) {
|
|
83362
83362
|
requestUrl.searchParams.append("full", "true");
|
|
83363
83363
|
}
|
|
@@ -83370,10 +83370,10 @@ var require_rest = __commonJS({
|
|
|
83370
83370
|
}
|
|
83371
83371
|
this.updateRateLimit(response);
|
|
83372
83372
|
const modelResponse = await (0, import_utils22.extractJson)(response);
|
|
83373
|
-
const hierarchy = new
|
|
83374
|
-
const model = new
|
|
83375
|
-
const ctx = new
|
|
83376
|
-
(0,
|
|
83373
|
+
const hierarchy = new import_core46.Hierarchy();
|
|
83374
|
+
const model = new import_core46.ModelDb(hierarchy);
|
|
83375
|
+
const ctx = new import_core46.MeasureMetricsContext("loadModel", {});
|
|
83376
|
+
(0, import_core46.buildModel)(ctx, modelResponse, void 0, hierarchy, model);
|
|
83377
83377
|
return { hierarchy, model };
|
|
83378
83378
|
}, isRLE);
|
|
83379
83379
|
if (result.error !== void 0) {
|
|
@@ -83385,7 +83385,7 @@ var require_rest = __commonJS({
|
|
|
83385
83385
|
return (await this.findAll(_class, query, { ...options, limit: 1 })).shift();
|
|
83386
83386
|
}
|
|
83387
83387
|
async tx(tx) {
|
|
83388
|
-
const requestUrl = (0,
|
|
83388
|
+
const requestUrl = (0, import_core46.concatLink)(this.endpoint, `/api/v1/tx/${this.workspace}`);
|
|
83389
83389
|
await this.checkRate();
|
|
83390
83390
|
const result = await (0, import_utils22.withRetry)(async () => {
|
|
83391
83391
|
const response = await fetch(requestUrl, {
|
|
@@ -83419,7 +83419,7 @@ var require_rest = __commonJS({
|
|
|
83419
83419
|
if (options.limit != null) {
|
|
83420
83420
|
params.append("limit", `${options.limit}`);
|
|
83421
83421
|
}
|
|
83422
|
-
const requestUrl = (0,
|
|
83422
|
+
const requestUrl = (0, import_core46.concatLink)(this.endpoint, `/api/v1/search-fulltext/${this.workspace}?${params.toString()}`);
|
|
83423
83423
|
const response = await fetch(requestUrl, {
|
|
83424
83424
|
method: "GET",
|
|
83425
83425
|
headers: this.jsonHeaders(),
|
|
@@ -83438,7 +83438,7 @@ var require_rest = __commonJS({
|
|
|
83438
83438
|
return result;
|
|
83439
83439
|
}
|
|
83440
83440
|
async domainRequest(domain3, params, options) {
|
|
83441
|
-
const requestUrl = (0,
|
|
83441
|
+
const requestUrl = (0, import_core46.concatLink)(this.endpoint, `/api/v1/request/${domain3}/${this.workspace}`);
|
|
83442
83442
|
await this.checkRate();
|
|
83443
83443
|
return await (0, import_utils22.withRetry)(async () => {
|
|
83444
83444
|
const response = await fetch(requestUrl, {
|
|
@@ -83457,7 +83457,7 @@ var require_rest = __commonJS({
|
|
|
83457
83457
|
}, isRLE);
|
|
83458
83458
|
}
|
|
83459
83459
|
async ensurePerson(socialType, socialValue, firstName, lastName) {
|
|
83460
|
-
const requestUrl = (0,
|
|
83460
|
+
const requestUrl = (0, import_core46.concatLink)(this.endpoint, `/api/v1/ensure-person/${this.workspace}`);
|
|
83461
83461
|
await this.checkRate();
|
|
83462
83462
|
const result = await (0, import_utils22.withRetry)(async () => {
|
|
83463
83463
|
const response = await fetch(requestUrl, {
|
|
@@ -83514,13 +83514,13 @@ var require_tx2 = __commonJS({
|
|
|
83514
83514
|
createRestTxOperations: () => createRestTxOperations2
|
|
83515
83515
|
});
|
|
83516
83516
|
module2.exports = __toCommonJS2(tx_exports);
|
|
83517
|
-
var
|
|
83517
|
+
var import_core46 = require_lib4();
|
|
83518
83518
|
var import_rest = require_rest();
|
|
83519
83519
|
async function createRestTxOperations2(endpoint, workspaceId, token, fullModel = false) {
|
|
83520
83520
|
const restClient = new import_rest.RestClientImpl(endpoint, workspaceId, token);
|
|
83521
83521
|
const account = await restClient.getAccount();
|
|
83522
83522
|
const { hierarchy, model } = await restClient.getModel(fullModel);
|
|
83523
|
-
return new
|
|
83523
|
+
return new import_core46.TxOperations(new RestTxClient(restClient, hierarchy, model, account), account.socialIds[0]);
|
|
83524
83524
|
}
|
|
83525
83525
|
__name(createRestTxOperations2, "createRestTxOperations");
|
|
83526
83526
|
var RestTxClient = class {
|
|
@@ -83541,7 +83541,7 @@ var require_tx2 = __commonJS({
|
|
|
83541
83541
|
const result = data.map((v) => {
|
|
83542
83542
|
return this.hierarchy.updateLookupMixin(_class, v, options);
|
|
83543
83543
|
});
|
|
83544
|
-
return (0,
|
|
83544
|
+
return (0, import_core46.toFindResult)(result, data.total);
|
|
83545
83545
|
}
|
|
83546
83546
|
async domainRequest(domain3, params, options) {
|
|
83547
83547
|
return await this.client.domainRequest(domain3, params, options);
|
|
@@ -83723,7 +83723,7 @@ var require_client7 = __commonJS({
|
|
|
83723
83723
|
createStorageClient: () => createStorageClient2
|
|
83724
83724
|
});
|
|
83725
83725
|
module2.exports = __toCommonJS2(client_exports);
|
|
83726
|
-
var
|
|
83726
|
+
var import_core46 = __toESM2(require_lib4());
|
|
83727
83727
|
var import_stream2 = require("stream");
|
|
83728
83728
|
var import_config8 = require_config();
|
|
83729
83729
|
var import_error = require_error3();
|
|
@@ -83760,13 +83760,13 @@ var require_client7 = __commonJS({
|
|
|
83760
83760
|
const size13 = parseInt(headers.get("Content-Length") ?? "0", 10);
|
|
83761
83761
|
return {
|
|
83762
83762
|
provider: "",
|
|
83763
|
-
_class:
|
|
83763
|
+
_class: import_core46.default.class.Blob,
|
|
83764
83764
|
_id: objectName,
|
|
83765
83765
|
contentType: headers.get("Content-Type") ?? "",
|
|
83766
83766
|
size: isNaN(size13) ? 0 : size13 ?? 0,
|
|
83767
83767
|
etag: headers.get("ETag") ?? "",
|
|
83768
|
-
space:
|
|
83769
|
-
modifiedBy:
|
|
83768
|
+
space: import_core46.default.space.Configuration,
|
|
83769
|
+
modifiedBy: import_core46.default.account.System,
|
|
83770
83770
|
modifiedOn: isNaN(lastModified) ? 0 : lastModified,
|
|
83771
83771
|
version: null
|
|
83772
83772
|
};
|
|
@@ -83801,11 +83801,11 @@ var require_client7 = __commonJS({
|
|
|
83801
83801
|
if (Object.hasOwn(result[0], "id")) {
|
|
83802
83802
|
const fileResult = result[0];
|
|
83803
83803
|
return {
|
|
83804
|
-
_class:
|
|
83804
|
+
_class: import_core46.default.class.Blob,
|
|
83805
83805
|
_id: fileResult.id,
|
|
83806
|
-
space:
|
|
83806
|
+
space: import_core46.default.space.Configuration,
|
|
83807
83807
|
modifiedOn: fileResult.metadata.lastModified,
|
|
83808
|
-
modifiedBy:
|
|
83808
|
+
modifiedBy: import_core46.default.account.System,
|
|
83809
83809
|
provider: "",
|
|
83810
83810
|
contentType: fileResult.metadata.contentType,
|
|
83811
83811
|
etag: fileResult.metadata.etag,
|
|
@@ -83879,11 +83879,11 @@ var require_client7 = __commonJS({
|
|
|
83879
83879
|
async function connectStorage(url4, options, config3) {
|
|
83880
83880
|
config3 ??= await (0, import_config8.loadServerConfig)(url4);
|
|
83881
83881
|
const token = await (0, import_utils14.getWorkspaceToken)(url4, options, config3);
|
|
83882
|
-
const filesUrl = (config3.FILES_URL.startsWith("/") ? (0,
|
|
83882
|
+
const filesUrl = (config3.FILES_URL.startsWith("/") ? (0, import_core46.concatLink)(url4, config3.FILES_URL) : config3.FILES_URL).replace(
|
|
83883
83883
|
":workspace",
|
|
83884
83884
|
token.workspaceId
|
|
83885
83885
|
);
|
|
83886
|
-
const uploadUrl = (config3.UPLOAD_URL.startsWith("/") ? (0,
|
|
83886
|
+
const uploadUrl = (config3.UPLOAD_URL.startsWith("/") ? (0, import_core46.concatLink)(url4, config3.UPLOAD_URL) : config3.UPLOAD_URL).replace(":workspace", token.workspaceId);
|
|
83887
83887
|
return new StorageClientImpl(filesUrl, uploadUrl, token.token, token.workspaceId);
|
|
83888
83888
|
}
|
|
83889
83889
|
__name(connectStorage, "connectStorage");
|
|
@@ -83936,11 +83936,11 @@ var require_storage2 = __commonJS({
|
|
|
83936
83936
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
83937
83937
|
var storage_exports = {};
|
|
83938
83938
|
__export2(storage_exports, {
|
|
83939
|
-
connectStorage: () =>
|
|
83940
|
-
createStorageClient: () =>
|
|
83939
|
+
connectStorage: () => import_client24.connectStorage,
|
|
83940
|
+
createStorageClient: () => import_client24.createStorageClient
|
|
83941
83941
|
});
|
|
83942
83942
|
module2.exports = __toCommonJS2(storage_exports);
|
|
83943
|
-
var
|
|
83943
|
+
var import_client24 = require_client7();
|
|
83944
83944
|
__reExport2(storage_exports, require_error3(), module2.exports);
|
|
83945
83945
|
__reExport2(storage_exports, require_types8(), module2.exports);
|
|
83946
83946
|
}
|
|
@@ -84596,7 +84596,7 @@ var require_utils11 = __commonJS({
|
|
|
84596
84596
|
getWeekday: () => getWeekday
|
|
84597
84597
|
});
|
|
84598
84598
|
module2.exports = __toCommonJS2(utils_exports);
|
|
84599
|
-
var
|
|
84599
|
+
var import_core46 = require_lib4();
|
|
84600
84600
|
var import__ = __toESM2(require_lib24());
|
|
84601
84601
|
function getInstance(event, date7) {
|
|
84602
84602
|
const diff8 = event.dueDate - event.date;
|
|
@@ -84608,7 +84608,7 @@ var require_utils11 = __commonJS({
|
|
|
84608
84608
|
originalStartTime: date7,
|
|
84609
84609
|
_class: import__.default.class.ReccuringInstance,
|
|
84610
84610
|
eventId: generateEventId3(),
|
|
84611
|
-
_id: (0,
|
|
84611
|
+
_id: (0, import_core46.generateId)(),
|
|
84612
84612
|
virtual: true
|
|
84613
84613
|
};
|
|
84614
84614
|
}
|
|
@@ -84921,7 +84921,7 @@ var require_utils11 = __commonJS({
|
|
|
84921
84921
|
}
|
|
84922
84922
|
__name(getAllEvents, "getAllEvents");
|
|
84923
84923
|
function generateEventId3() {
|
|
84924
|
-
const id = (0,
|
|
84924
|
+
const id = (0, import_core46.generateId)();
|
|
84925
84925
|
return encodeToBase32Hex(id);
|
|
84926
84926
|
}
|
|
84927
84927
|
__name(generateEventId3, "generateEventId");
|
|
@@ -85335,7 +85335,7 @@ var require_utils12 = __commonJS({
|
|
|
85335
85335
|
});
|
|
85336
85336
|
module2.exports = __toCommonJS2(utils_exports);
|
|
85337
85337
|
var import_fast_equals = require_cjs();
|
|
85338
|
-
var
|
|
85338
|
+
var import_core46 = __toESM2(require_lib4());
|
|
85339
85339
|
var import__ = __toESM2(require_lib26());
|
|
85340
85340
|
async function getDirectChannel(client, me, employeeAccount) {
|
|
85341
85341
|
const accIds = [me, employeeAccount].sort();
|
|
@@ -85345,7 +85345,7 @@ var require_utils12 = __commonJS({
|
|
|
85345
85345
|
return dm._id;
|
|
85346
85346
|
}
|
|
85347
85347
|
}
|
|
85348
|
-
return await client.createDoc(import__.default.class.DirectMessage,
|
|
85348
|
+
return await client.createDoc(import__.default.class.DirectMessage, import_core46.default.space.Space, {
|
|
85349
85349
|
name: "",
|
|
85350
85350
|
description: "",
|
|
85351
85351
|
private: true,
|
|
@@ -85649,18 +85649,18 @@ var require_cache4 = __commonJS({
|
|
|
85649
85649
|
default: () => ContactCache
|
|
85650
85650
|
});
|
|
85651
85651
|
module2.exports = __toCommonJS2(cache_exports);
|
|
85652
|
-
var
|
|
85652
|
+
var import_core46 = __toESM2(require_lib4());
|
|
85653
85653
|
var import__ = __toESM2(require_lib27());
|
|
85654
85654
|
function isCreateTx(tx) {
|
|
85655
|
-
return tx._class ===
|
|
85655
|
+
return tx._class === import_core46.default.class.TxCreateDoc;
|
|
85656
85656
|
}
|
|
85657
85657
|
__name(isCreateTx, "isCreateTx");
|
|
85658
85658
|
function isUpdateTx(tx) {
|
|
85659
|
-
return tx._class ===
|
|
85659
|
+
return tx._class === import_core46.default.class.TxUpdateDoc;
|
|
85660
85660
|
}
|
|
85661
85661
|
__name(isUpdateTx, "isUpdateTx");
|
|
85662
85662
|
function isMixinTx(tx) {
|
|
85663
|
-
return tx._class ===
|
|
85663
|
+
return tx._class === import_core46.default.class.TxMixin;
|
|
85664
85664
|
}
|
|
85665
85665
|
__name(isMixinTx, "isMixinTx");
|
|
85666
85666
|
function isPersonTx(tx) {
|
|
@@ -85767,7 +85767,7 @@ var require_cache4 = __commonJS({
|
|
|
85767
85767
|
const ref = tx.objectId;
|
|
85768
85768
|
const person = this._personByRef.get(ref);
|
|
85769
85769
|
if (person === void 0) return;
|
|
85770
|
-
const createdPerson =
|
|
85770
|
+
const createdPerson = import_core46.TxProcessor.createDoc2Doc(tx);
|
|
85771
85771
|
this._personByRef.set(ref, createdPerson);
|
|
85772
85772
|
const personIds = Array.from(this._personIdsByPersonRef.get(ref) ?? []);
|
|
85773
85773
|
for (const personId of personIds) {
|
|
@@ -85785,7 +85785,7 @@ var require_cache4 = __commonJS({
|
|
|
85785
85785
|
const newPersonRef = tx.attachedTo;
|
|
85786
85786
|
this._personRefByPersonId.set(personId, newPersonRef);
|
|
85787
85787
|
this.addPersonIdToPersonRef(newPersonRef, personId);
|
|
85788
|
-
const createdSocialId =
|
|
85788
|
+
const createdSocialId = import_core46.TxProcessor.createDoc2Doc(tx);
|
|
85789
85789
|
this._socialIdByPersonId.set(personId, createdSocialId);
|
|
85790
85790
|
this.broadcastChange({
|
|
85791
85791
|
personRef: newPersonRef,
|
|
@@ -85796,7 +85796,7 @@ var require_cache4 = __commonJS({
|
|
|
85796
85796
|
const ref = tx.objectId;
|
|
85797
85797
|
const person = this._personByRef.get(ref);
|
|
85798
85798
|
if (person == null) return;
|
|
85799
|
-
const updatedPerson = isUpdateTx(tx) ?
|
|
85799
|
+
const updatedPerson = isUpdateTx(tx) ? import_core46.TxProcessor.updateDoc2Doc(person, tx) : import_core46.TxProcessor.updateMixin4Doc(person, tx);
|
|
85800
85800
|
this._personByRef.set(ref, updatedPerson);
|
|
85801
85801
|
const personIds = Array.from(this._personIdsByPersonRef.get(ref) ?? []);
|
|
85802
85802
|
for (const personId of personIds) {
|
|
@@ -85911,7 +85911,7 @@ var require_utils13 = __commonJS({
|
|
|
85911
85911
|
setCurrentEmployeeSpace: () => setCurrentEmployeeSpace
|
|
85912
85912
|
});
|
|
85913
85913
|
module2.exports = __toCommonJS2(utils_exports);
|
|
85914
|
-
var
|
|
85914
|
+
var import_core46 = require_lib4();
|
|
85915
85915
|
var import_platform2 = require_lib();
|
|
85916
85916
|
var import__ = __toESM2(require_lib27());
|
|
85917
85917
|
var import_types12 = require_types9();
|
|
@@ -86115,7 +86115,7 @@ var require_utils13 = __commonJS({
|
|
|
86115
86115
|
if (socialIds.length === 0) {
|
|
86116
86116
|
return;
|
|
86117
86117
|
}
|
|
86118
|
-
return (0,
|
|
86118
|
+
return (0, import_core46.pickPrimarySocialId)(socialIds)._id;
|
|
86119
86119
|
}
|
|
86120
86120
|
__name(getPrimarySocialId, "getPrimarySocialId");
|
|
86121
86121
|
async function getAllSocialStringsByPersonId(client, personId) {
|
|
@@ -86154,12 +86154,12 @@ var require_utils13 = __commonJS({
|
|
|
86154
86154
|
__name(getSocialStringsByEmployee, "getSocialStringsByEmployee");
|
|
86155
86155
|
async function getAllAccounts(client) {
|
|
86156
86156
|
const employees = await client.findAll(import__.default.mixin.Employee, { active: true });
|
|
86157
|
-
return employees.map((it) => it.personUuid).filter(
|
|
86157
|
+
return employees.map((it) => it.personUuid).filter(import_core46.notEmpty);
|
|
86158
86158
|
}
|
|
86159
86159
|
__name(getAllAccounts, "getAllAccounts");
|
|
86160
86160
|
async function getAllUserAccounts(client) {
|
|
86161
86161
|
const employees = await client.findAll(import__.default.mixin.Employee, { active: true });
|
|
86162
|
-
return employees.map((it) => it.personUuid).filter(
|
|
86162
|
+
return employees.map((it) => it.personUuid).filter(import_core46.notEmpty);
|
|
86163
86163
|
}
|
|
86164
86164
|
__name(getAllUserAccounts, "getAllUserAccounts");
|
|
86165
86165
|
async function ensureEmployee(ctx, me, client, socialIds, getGlobalPerson) {
|
|
@@ -86168,7 +86168,7 @@ var require_utils13 = __commonJS({
|
|
|
86168
86168
|
}
|
|
86169
86169
|
__name(ensureEmployee, "ensureEmployee");
|
|
86170
86170
|
async function ensureEmployeeForPerson(ctx, me, person, client, socialIds, globalPerson) {
|
|
86171
|
-
const txFactory = new
|
|
86171
|
+
const txFactory = new import_core46.TxFactory(me.primarySocialId);
|
|
86172
86172
|
const personByUuid = await client.findOne(import__.default.class.Person, { personUuid: person.uuid });
|
|
86173
86173
|
let personRef = personByUuid?._id;
|
|
86174
86174
|
if (personRef === void 0) {
|
|
@@ -86189,7 +86189,7 @@ var require_utils13 = __commonJS({
|
|
|
86189
86189
|
city: globalPerson.city,
|
|
86190
86190
|
avatarType: import__.AvatarType.COLOR
|
|
86191
86191
|
};
|
|
86192
|
-
personRef = (0,
|
|
86192
|
+
personRef = (0, import_core46.generateId)();
|
|
86193
86193
|
const createPersonTx = txFactory.createTxCreateDoc(import__.default.class.Person, import__.default.space.Contacts, data, personRef);
|
|
86194
86194
|
await client.tx(createPersonTx);
|
|
86195
86195
|
});
|
|
@@ -86199,7 +86199,7 @@ var require_utils13 = __commonJS({
|
|
|
86199
86199
|
});
|
|
86200
86200
|
await client.tx(updatePersonTx);
|
|
86201
86201
|
}
|
|
86202
|
-
const existingIdentifiers = (0,
|
|
86202
|
+
const existingIdentifiers = (0, import_core46.toIdMap)(
|
|
86203
86203
|
await client.findAll(import__.default.class.SocialIdentity, { _id: { $in: person.socialIds } })
|
|
86204
86204
|
);
|
|
86205
86205
|
for (const socialId of socialIds) {
|
|
@@ -86224,7 +86224,7 @@ var require_utils13 = __commonJS({
|
|
|
86224
86224
|
collection: "socialIds",
|
|
86225
86225
|
type: socialId.type,
|
|
86226
86226
|
value: socialId.value,
|
|
86227
|
-
key: (0,
|
|
86227
|
+
key: (0, import_core46.buildSocialIdString)(socialId),
|
|
86228
86228
|
// TODO: fill it in trigger or on DB level as stored calculated column or smth?
|
|
86229
86229
|
verifiedOn: socialId.verifiedOn,
|
|
86230
86230
|
isDeleted: socialId.isDeleted
|
|
@@ -86265,9 +86265,9 @@ var require_utils13 = __commonJS({
|
|
|
86265
86265
|
}
|
|
86266
86266
|
}
|
|
86267
86267
|
}
|
|
86268
|
-
const employeeRole = person.role ===
|
|
86268
|
+
const employeeRole = person.role === import_core46.AccountRole.Guest || person.role === import_core46.AccountRole.ReadOnlyGuest ? "GUEST" : "USER";
|
|
86269
86269
|
const employee = await client.findOne(import__.default.mixin.Employee, { _id: personRef });
|
|
86270
|
-
if (employee === void 0 || !
|
|
86270
|
+
if (employee === void 0 || !import_core46.Hierarchy.hasMixin(employee, import__.default.mixin.Employee) || !employee.active || employee.role !== employeeRole) {
|
|
86271
86271
|
await ctx.with("create-employee", {}, async () => {
|
|
86272
86272
|
if (personRef === void 0) {
|
|
86273
86273
|
console.error("Person not found");
|
|
@@ -86307,7 +86307,7 @@ var require_utils13 = __commonJS({
|
|
|
86307
86307
|
}
|
|
86308
86308
|
__name(loadCachesForPersonId, "loadCachesForPersonId");
|
|
86309
86309
|
async function loadCachesForPersonIds(client, personIds) {
|
|
86310
|
-
const sidObjsMap = (0,
|
|
86310
|
+
const sidObjsMap = (0, import_core46.toIdMap)(
|
|
86311
86311
|
await client.findAll(
|
|
86312
86312
|
import__.default.class.SocialIdentity,
|
|
86313
86313
|
{
|
|
@@ -86342,7 +86342,7 @@ var require_utils13 = __commonJS({
|
|
|
86342
86342
|
}
|
|
86343
86343
|
__name(loadCachesForPersonRef, "loadCachesForPersonRef");
|
|
86344
86344
|
async function loadCachesForPersonRefs(client, personRefs) {
|
|
86345
|
-
const persons = (0,
|
|
86345
|
+
const persons = (0, import_core46.toIdMap)(
|
|
86346
86346
|
await client.findAll(
|
|
86347
86347
|
import__.default.class.Person,
|
|
86348
86348
|
{
|
|
@@ -86385,7 +86385,7 @@ var require_utils13 = __commonJS({
|
|
|
86385
86385
|
personIds.map((pid) => {
|
|
86386
86386
|
const ref = contactCache.personRefByPersonId.get(pid);
|
|
86387
86387
|
return ref != null ? [pid, ref] : void 0;
|
|
86388
|
-
}).filter(
|
|
86388
|
+
}).filter(import_core46.notEmpty)
|
|
86389
86389
|
);
|
|
86390
86390
|
}
|
|
86391
86391
|
__name(getPersonRefsByPersonIdsFromCache, "getPersonRefsByPersonIdsFromCache");
|
|
@@ -86432,7 +86432,7 @@ var require_utils13 = __commonJS({
|
|
|
86432
86432
|
personIds.map((pid) => {
|
|
86433
86433
|
const person = contactCache.personByPersonId.get(pid);
|
|
86434
86434
|
return person != null ? [pid, person] : void 0;
|
|
86435
|
-
}).filter(
|
|
86435
|
+
}).filter(import_core46.notEmpty)
|
|
86436
86436
|
);
|
|
86437
86437
|
}
|
|
86438
86438
|
__name(getPersonsByPersonIdsFromCache, "getPersonsByPersonIdsFromCache");
|
|
@@ -86479,7 +86479,7 @@ var require_utils13 = __commonJS({
|
|
|
86479
86479
|
personRefs.map((personRef) => {
|
|
86480
86480
|
const person = contactCache.personByRef.get(personRef);
|
|
86481
86481
|
return person != null ? [personRef, person] : void 0;
|
|
86482
|
-
}).filter(
|
|
86482
|
+
}).filter(import_core46.notEmpty)
|
|
86483
86483
|
);
|
|
86484
86484
|
}
|
|
86485
86485
|
__name(getPersonsByPersonRefsFromCache, "getPersonsByPersonRefsFromCache");
|
|
@@ -87084,9 +87084,9 @@ var require_utils14 = __commonJS({
|
|
|
87084
87084
|
getFirstRank: () => getFirstRank
|
|
87085
87085
|
});
|
|
87086
87086
|
module2.exports = __toCommonJS2(utils_exports);
|
|
87087
|
-
var
|
|
87087
|
+
var import_core46 = require_lib4();
|
|
87088
87088
|
var import_plugin = __toESM2(require_plugin2());
|
|
87089
|
-
async function getFirstRank(client, space, parent, sort3 =
|
|
87089
|
+
async function getFirstRank(client, space, parent, sort3 = import_core46.SortingOrder.Descending, extra = {}) {
|
|
87090
87090
|
const doc = await client.findOne(
|
|
87091
87091
|
import_plugin.default.class.Document,
|
|
87092
87092
|
{ space, parent, ...extra },
|
|
@@ -88709,7 +88709,7 @@ var require_utils16 = __commonJS({
|
|
|
88709
88709
|
updateProjectType: () => updateProjectType
|
|
88710
88710
|
});
|
|
88711
88711
|
module2.exports = __toCommonJS2(utils_exports);
|
|
88712
|
-
var
|
|
88712
|
+
var import_core46 = __toESM2(require_lib4());
|
|
88713
88713
|
var import_platform2 = require_lib();
|
|
88714
88714
|
var import__ = __toESM2(require_lib33());
|
|
88715
88715
|
var import_rank4 = require_lib32();
|
|
@@ -88745,7 +88745,7 @@ var require_utils16 = __commonJS({
|
|
|
88745
88745
|
if (exists5 !== void 0) {
|
|
88746
88746
|
return exists5._id;
|
|
88747
88747
|
}
|
|
88748
|
-
const res = await client.createDoc(_class,
|
|
88748
|
+
const res = await client.createDoc(_class, import_core46.default.space.Model, data);
|
|
88749
88749
|
return res;
|
|
88750
88750
|
}
|
|
88751
88751
|
__name(createState, "createState");
|
|
@@ -88775,7 +88775,7 @@ var require_utils16 = __commonJS({
|
|
|
88775
88775
|
function findStatusAttr(h, _class) {
|
|
88776
88776
|
const attrs = h.getAllAttributes(_class);
|
|
88777
88777
|
for (const it of attrs.values()) {
|
|
88778
|
-
if (it.type._class ===
|
|
88778
|
+
if (it.type._class === import_core46.default.class.RefTo && h.isDerived(it.type.to, import_core46.default.class.Status)) {
|
|
88779
88779
|
return it;
|
|
88780
88780
|
}
|
|
88781
88781
|
}
|
|
@@ -88807,7 +88807,7 @@ var require_utils16 = __commonJS({
|
|
|
88807
88807
|
const targetProjectClassId = `${_id}:type:mixin`;
|
|
88808
88808
|
const tmpl = await client.createDoc(
|
|
88809
88809
|
import__.default.class.ProjectType,
|
|
88810
|
-
|
|
88810
|
+
import_core46.default.space.Model,
|
|
88811
88811
|
{
|
|
88812
88812
|
description: data.description,
|
|
88813
88813
|
shortDescription: data.shortDescription,
|
|
@@ -88822,17 +88822,17 @@ var require_utils16 = __commonJS({
|
|
|
88822
88822
|
_id
|
|
88823
88823
|
);
|
|
88824
88824
|
await client.createDoc(
|
|
88825
|
-
|
|
88826
|
-
|
|
88825
|
+
import_core46.default.class.Mixin,
|
|
88826
|
+
import_core46.default.space.Model,
|
|
88827
88827
|
{
|
|
88828
88828
|
extends: categoryObj.baseClass,
|
|
88829
|
-
kind:
|
|
88829
|
+
kind: import_core46.ClassifierKind.MIXIN,
|
|
88830
88830
|
label: (0, import_platform2.getEmbeddedLabel)(data.name),
|
|
88831
88831
|
icon: baseClassClass.icon
|
|
88832
88832
|
},
|
|
88833
88833
|
targetProjectClassId
|
|
88834
88834
|
);
|
|
88835
|
-
await client.createMixin(targetProjectClassId,
|
|
88835
|
+
await client.createMixin(targetProjectClassId, import_core46.default.class.Mixin, import_core46.default.space.Model, import__.default.mixin.ProjectTypeClass, {
|
|
88836
88836
|
projectType: _id
|
|
88837
88837
|
});
|
|
88838
88838
|
return tmpl;
|
|
@@ -88891,22 +88891,22 @@ var require_utils16 = __commonJS({
|
|
|
88891
88891
|
const targetClassId = `${taskId}:type:mixin`;
|
|
88892
88892
|
tdata.targetClass = targetClassId;
|
|
88893
88893
|
await client.createDoc(
|
|
88894
|
-
|
|
88895
|
-
|
|
88894
|
+
import_core46.default.class.Mixin,
|
|
88895
|
+
import_core46.default.space.Model,
|
|
88896
88896
|
{
|
|
88897
88897
|
extends: data.ofClass,
|
|
88898
|
-
kind:
|
|
88898
|
+
kind: import_core46.ClassifierKind.MIXIN,
|
|
88899
88899
|
label: ofClassClass.label,
|
|
88900
88900
|
icon: ofClassClass.icon
|
|
88901
88901
|
},
|
|
88902
88902
|
targetClassId
|
|
88903
88903
|
);
|
|
88904
|
-
await client.createMixin(targetClassId,
|
|
88904
|
+
await client.createMixin(targetClassId, import_core46.default.class.Mixin, import_core46.default.space.Model, import__.default.mixin.TaskTypeClass, {
|
|
88905
88905
|
taskType: taskId,
|
|
88906
88906
|
projectType: _id
|
|
88907
88907
|
});
|
|
88908
88908
|
}
|
|
88909
|
-
await client.createDoc(import__.default.class.TaskType,
|
|
88909
|
+
await client.createDoc(import__.default.class.TaskType, import_core46.default.space.Model, tdata, taskId);
|
|
88910
88910
|
tasksData.set(taskId, tdata);
|
|
88911
88911
|
_tasks.push(taskId);
|
|
88912
88912
|
}
|
|
@@ -150644,6 +150644,29 @@ var InvalidPersonUuidError = class extends Schema_exports.TaggedError()(
|
|
|
150644
150644
|
}
|
|
150645
150645
|
};
|
|
150646
150646
|
|
|
150647
|
+
// src/huly/errors-custom-fields.ts
|
|
150648
|
+
var CustomFieldNotFoundError = class extends Schema_exports.TaggedError()(
|
|
150649
|
+
"CustomFieldNotFoundError",
|
|
150650
|
+
{
|
|
150651
|
+
identifier: Schema_exports.String
|
|
150652
|
+
}
|
|
150653
|
+
) {
|
|
150654
|
+
get message() {
|
|
150655
|
+
return `Custom field '${this.identifier}' not found`;
|
|
150656
|
+
}
|
|
150657
|
+
};
|
|
150658
|
+
var CustomFieldObjectNotFoundError = class extends Schema_exports.TaggedError()(
|
|
150659
|
+
"CustomFieldObjectNotFoundError",
|
|
150660
|
+
{
|
|
150661
|
+
objectId: Schema_exports.String,
|
|
150662
|
+
objectClass: Schema_exports.String
|
|
150663
|
+
}
|
|
150664
|
+
) {
|
|
150665
|
+
get message() {
|
|
150666
|
+
return `Object '${this.objectId}' of class '${this.objectClass}' not found`;
|
|
150667
|
+
}
|
|
150668
|
+
};
|
|
150669
|
+
|
|
150647
150670
|
// src/huly/errors-documents.ts
|
|
150648
150671
|
var TeamspaceNotFoundError = class extends Schema_exports.TaggedError()(
|
|
150649
150672
|
"TeamspaceNotFoundError",
|
|
@@ -151090,6 +151113,8 @@ var HulyDomainError = Schema_exports.Union(
|
|
|
151090
151113
|
TestResultNotFoundError,
|
|
151091
151114
|
TestPlanItemNotFoundError,
|
|
151092
151115
|
ComponentNotFoundError,
|
|
151116
|
+
CustomFieldNotFoundError,
|
|
151117
|
+
CustomFieldObjectNotFoundError,
|
|
151093
151118
|
IssueTemplateNotFoundError,
|
|
151094
151119
|
TemplateChildNotFoundError,
|
|
151095
151120
|
NotificationNotFoundError,
|
|
@@ -151217,6 +151242,10 @@ var HulyClient = class _HulyClient extends Context_exports.Tag("@hulymcp/HulyCli
|
|
|
151217
151242
|
(client2) => client2.removeDoc(_class, space, objectId),
|
|
151218
151243
|
"removeDoc failed"
|
|
151219
151244
|
),
|
|
151245
|
+
updateMixin: (objectId, objectClass, objectSpace, mixin, attributes) => withClient(
|
|
151246
|
+
(client2) => client2.updateMixin(objectId, objectClass, objectSpace, mixin, attributes),
|
|
151247
|
+
"updateMixin failed"
|
|
151248
|
+
),
|
|
151220
151249
|
uploadMarkup: (objectClass, objectId, objectAttr, markup, format7) => Effect_exports.tryPromise({
|
|
151221
151250
|
try: () => markupOps.uploadMarkup(objectClass, objectId, objectAttr, markup, format7),
|
|
151222
151251
|
catch: (e) => new HulyConnectionError({
|
|
@@ -151263,6 +151292,7 @@ var HulyClient = class _HulyClient extends Context_exports.Tag("@hulymcp/HulyCli
|
|
|
151263
151292
|
removeDoc: notImplemented("removeDoc"),
|
|
151264
151293
|
uploadMarkup: notImplemented("uploadMarkup"),
|
|
151265
151294
|
fetchMarkup: noopFetchMarkup,
|
|
151295
|
+
updateMixin: notImplemented("updateMixin"),
|
|
151266
151296
|
updateMarkup: notImplemented("updateMarkup"),
|
|
151267
151297
|
searchFulltext: notImplemented("searchFulltext")
|
|
151268
151298
|
};
|
|
@@ -171196,7 +171226,7 @@ var PostHog = class extends PostHogBackendClient {
|
|
|
171196
171226
|
};
|
|
171197
171227
|
|
|
171198
171228
|
// src/version.ts
|
|
171199
|
-
var VERSION = true ? "0.
|
|
171229
|
+
var VERSION = true ? "0.5.0" : "0.0.0-dev";
|
|
171200
171230
|
|
|
171201
171231
|
// src/telemetry/posthog.ts
|
|
171202
171232
|
var POSTHOG_API_KEY = "phc_TGfFqCGdnF0p68wuFzd5WSw1IsBvOJW0YgoMJDyZPjm";
|
|
@@ -171351,6 +171381,8 @@ var INVALID_PARAMS_TAGS = /* @__PURE__ */ new Set([
|
|
|
171351
171381
|
"TestResultNotFoundError",
|
|
171352
171382
|
"TestPlanItemNotFoundError",
|
|
171353
171383
|
"ComponentNotFoundError",
|
|
171384
|
+
"CustomFieldNotFoundError",
|
|
171385
|
+
"CustomFieldObjectNotFoundError",
|
|
171354
171386
|
"IssueTemplateNotFoundError",
|
|
171355
171387
|
"TemplateChildNotFoundError",
|
|
171356
171388
|
"NotificationNotFoundError",
|
|
@@ -173984,6 +174016,57 @@ var parseCreateCardParams = Schema_exports.decodeUnknown(CreateCardParamsSchema)
|
|
|
173984
174016
|
var parseUpdateCardParams = Schema_exports.decodeUnknown(UpdateCardParamsSchema);
|
|
173985
174017
|
var parseDeleteCardParams = Schema_exports.decodeUnknown(DeleteCardParamsSchema);
|
|
173986
174018
|
|
|
174019
|
+
// src/domain/schemas/custom-fields.ts
|
|
174020
|
+
var ListCustomFieldsParamsSchema = Schema_exports.Struct({
|
|
174021
|
+
targetClass: Schema_exports.optional(
|
|
174022
|
+
NonEmptyString2.annotations({
|
|
174023
|
+
description: "Filter by owner class/mixin ID (e.g. 'tracker:mixin:IssueTypeData' or a dynamic class ID). Returns fields defined on that class only."
|
|
174024
|
+
})
|
|
174025
|
+
),
|
|
174026
|
+
limit: Schema_exports.optional(
|
|
174027
|
+
LimitParam.annotations({
|
|
174028
|
+
description: "Maximum number of fields to return (default: 200)"
|
|
174029
|
+
})
|
|
174030
|
+
)
|
|
174031
|
+
}).annotations({
|
|
174032
|
+
title: "ListCustomFieldsParams",
|
|
174033
|
+
description: "Parameters for listing custom field definitions"
|
|
174034
|
+
});
|
|
174035
|
+
var GetCustomFieldValuesParamsSchema = Schema_exports.Struct({
|
|
174036
|
+
objectId: NonEmptyString2.annotations({
|
|
174037
|
+
description: "Document ID to read custom field values from"
|
|
174038
|
+
}),
|
|
174039
|
+
objectClass: NonEmptyString2.annotations({
|
|
174040
|
+
description: "Class of the document (e.g. 'tracker:class:Issue', 'card:class:Card', or a dynamic master tag class ID)"
|
|
174041
|
+
})
|
|
174042
|
+
}).annotations({
|
|
174043
|
+
title: "GetCustomFieldValuesParams",
|
|
174044
|
+
description: "Parameters for reading custom field values from a document"
|
|
174045
|
+
});
|
|
174046
|
+
var SetCustomFieldParamsSchema = Schema_exports.Struct({
|
|
174047
|
+
objectId: NonEmptyString2.annotations({
|
|
174048
|
+
description: "Document ID to set the custom field value on"
|
|
174049
|
+
}),
|
|
174050
|
+
objectClass: NonEmptyString2.annotations({
|
|
174051
|
+
description: "Class of the document (e.g. 'tracker:class:Issue', 'card:class:Card', or a dynamic master tag class ID)"
|
|
174052
|
+
}),
|
|
174053
|
+
fieldId: NonEmptyString2.annotations({
|
|
174054
|
+
description: "Custom field attribute ID (the _id from list_custom_fields)"
|
|
174055
|
+
}),
|
|
174056
|
+
value: Schema_exports.String.annotations({
|
|
174057
|
+
description: "Value to set. Strings are passed as-is. For numbers, pass a numeric string (e.g. '42'). For booleans, pass 'true' or 'false'. For enums, pass the enum value string."
|
|
174058
|
+
})
|
|
174059
|
+
}).annotations({
|
|
174060
|
+
title: "SetCustomFieldParams",
|
|
174061
|
+
description: "Parameters for setting a custom field value on a document"
|
|
174062
|
+
});
|
|
174063
|
+
var listCustomFieldsParamsJsonSchema = JSONSchema_exports.make(ListCustomFieldsParamsSchema);
|
|
174064
|
+
var getCustomFieldValuesParamsJsonSchema = JSONSchema_exports.make(GetCustomFieldValuesParamsSchema);
|
|
174065
|
+
var setCustomFieldParamsJsonSchema = JSONSchema_exports.make(SetCustomFieldParamsSchema);
|
|
174066
|
+
var parseListCustomFieldsParams = Schema_exports.decodeUnknown(ListCustomFieldsParamsSchema);
|
|
174067
|
+
var parseGetCustomFieldValuesParams = Schema_exports.decodeUnknown(GetCustomFieldValuesParamsSchema);
|
|
174068
|
+
var parseSetCustomFieldParams = Schema_exports.decodeUnknown(SetCustomFieldParamsSchema);
|
|
174069
|
+
|
|
173987
174070
|
// src/domain/schemas/issues.ts
|
|
173988
174071
|
var IssuePriorityValues = ["urgent", "high", "medium", "low", "no-priority"];
|
|
173989
174072
|
var IssuePriorityLiteral = Schema_exports.Literal(...IssuePriorityValues);
|
|
@@ -174151,6 +174234,14 @@ var CreateIssueParamsSchema = Schema_exports.Struct({
|
|
|
174151
174234
|
})),
|
|
174152
174235
|
parentIssue: Schema_exports.optional(IssueIdentifier.annotations({
|
|
174153
174236
|
description: "Parent issue identifier (e.g., 'HULY-42') to create as sub-issue"
|
|
174237
|
+
})),
|
|
174238
|
+
dueDate: Schema_exports.optional(
|
|
174239
|
+
Schema_exports.NullOr(Timestamp).annotations({
|
|
174240
|
+
description: "Due date as Unix timestamp in milliseconds (e.g., 1719792000000 for 2024-07-01), or null to clear"
|
|
174241
|
+
})
|
|
174242
|
+
),
|
|
174243
|
+
estimation: Schema_exports.optional(PositiveNumber.annotations({
|
|
174244
|
+
description: "Time estimation in minutes"
|
|
174154
174245
|
}))
|
|
174155
174246
|
}).annotations({
|
|
174156
174247
|
title: "CreateIssueParams",
|
|
@@ -174179,7 +174270,17 @@ var UpdateIssueParamsSchema = Schema_exports.Struct({
|
|
|
174179
174270
|
),
|
|
174180
174271
|
status: Schema_exports.optional(StatusName.annotations({
|
|
174181
174272
|
description: "New status"
|
|
174182
|
-
}))
|
|
174273
|
+
})),
|
|
174274
|
+
dueDate: Schema_exports.optional(
|
|
174275
|
+
Schema_exports.NullOr(Timestamp).annotations({
|
|
174276
|
+
description: "Due date as Unix timestamp in milliseconds (e.g., 1719792000000 for 2024-07-01), or null to clear"
|
|
174277
|
+
})
|
|
174278
|
+
),
|
|
174279
|
+
estimation: Schema_exports.optional(
|
|
174280
|
+
Schema_exports.NullOr(PositiveNumber).annotations({
|
|
174281
|
+
description: "Time estimation in minutes, or null to clear"
|
|
174282
|
+
})
|
|
174283
|
+
)
|
|
174183
174284
|
}).annotations({
|
|
174184
174285
|
title: "UpdateIssueParams",
|
|
174185
174286
|
description: "Parameters for updating an issue"
|
|
@@ -177690,8 +177791,217 @@ var contactTools = [
|
|
|
177690
177791
|
}
|
|
177691
177792
|
];
|
|
177692
177793
|
|
|
177693
|
-
// src/huly/operations/
|
|
177794
|
+
// src/huly/operations/custom-fields.ts
|
|
177694
177795
|
var import_core30 = __toESM(require_lib4(), 1);
|
|
177796
|
+
var DEFAULT_LIMIT2 = 200;
|
|
177797
|
+
var extractLabel = (label) => {
|
|
177798
|
+
if (typeof label === "string") {
|
|
177799
|
+
const parts2 = label.split(":");
|
|
177800
|
+
return parts2.length > 0 ? parts2[parts2.length - 1] : label;
|
|
177801
|
+
}
|
|
177802
|
+
return String(label ?? "");
|
|
177803
|
+
};
|
|
177804
|
+
var describeType = (type) => {
|
|
177805
|
+
const _class = String(type._class ?? "");
|
|
177806
|
+
if (_class.includes("TypeString")) return { typeName: "string", typeDetails: {} };
|
|
177807
|
+
if (_class.includes("TypeNumber")) return { typeName: "number", typeDetails: {} };
|
|
177808
|
+
if (_class.includes("TypeBoolean")) return { typeName: "boolean", typeDetails: {} };
|
|
177809
|
+
if (_class.includes("EnumOf")) return { typeName: "enum", typeDetails: { enumRef: type.of } };
|
|
177810
|
+
if (_class.includes("ArrOf")) return { typeName: "array", typeDetails: { of: type.of } };
|
|
177811
|
+
if (_class.includes("RefTo")) return { typeName: "ref", typeDetails: { to: type.to } };
|
|
177812
|
+
if (_class.includes("TypeDate")) return { typeName: "date", typeDetails: {} };
|
|
177813
|
+
if (_class.includes("TypeMarkup")) return { typeName: "markup", typeDetails: {} };
|
|
177814
|
+
return { typeName: _class, typeDetails: type };
|
|
177815
|
+
};
|
|
177816
|
+
var classRef = core.class.Class;
|
|
177817
|
+
var resolveClassInfo = (client, classId) => Effect_exports.gen(function* () {
|
|
177818
|
+
const cls = yield* client.findOne(
|
|
177819
|
+
classRef,
|
|
177820
|
+
{ _id: toRef(classId) }
|
|
177821
|
+
);
|
|
177822
|
+
if (cls !== void 0) {
|
|
177823
|
+
const record4 = cls;
|
|
177824
|
+
return { label: extractLabel(record4.label), kind: record4.kind };
|
|
177825
|
+
}
|
|
177826
|
+
return { label: classId, kind: import_core30.ClassifierKind.CLASS };
|
|
177827
|
+
});
|
|
177828
|
+
var batchResolveClassLabels = (client, classIds) => Effect_exports.gen(function* () {
|
|
177829
|
+
if (classIds.length === 0) return /* @__PURE__ */ new Map();
|
|
177830
|
+
const classes = yield* client.findAll(
|
|
177831
|
+
classRef,
|
|
177832
|
+
{ _id: { $in: classIds.map(toRef) } }
|
|
177833
|
+
);
|
|
177834
|
+
const result = /* @__PURE__ */ new Map();
|
|
177835
|
+
for (const cls of classes) {
|
|
177836
|
+
const record4 = cls;
|
|
177837
|
+
result.set(cls._id, extractLabel(record4.label));
|
|
177838
|
+
}
|
|
177839
|
+
for (const id of classIds) {
|
|
177840
|
+
if (!result.has(id)) {
|
|
177841
|
+
result.set(id, id);
|
|
177842
|
+
}
|
|
177843
|
+
}
|
|
177844
|
+
return result;
|
|
177845
|
+
});
|
|
177846
|
+
var listCustomFields = (params) => Effect_exports.gen(function* () {
|
|
177847
|
+
const client = yield* HulyClient;
|
|
177848
|
+
const limit = clampLimit(params.limit ?? DEFAULT_LIMIT2);
|
|
177849
|
+
const query = { isCustom: true };
|
|
177850
|
+
if (params.targetClass !== void 0) {
|
|
177851
|
+
query.attributeOf = params.targetClass;
|
|
177852
|
+
}
|
|
177853
|
+
const customAttrs = yield* client.findAll(
|
|
177854
|
+
core.class.Attribute,
|
|
177855
|
+
query,
|
|
177856
|
+
{ limit, sort: { modifiedOn: import_core30.SortingOrder.Descending } }
|
|
177857
|
+
);
|
|
177858
|
+
const uniqueOwnerIds = [...new Set(customAttrs.map((a) => a.attributeOf))];
|
|
177859
|
+
const ownerLabels = yield* batchResolveClassLabels(client, uniqueOwnerIds);
|
|
177860
|
+
return customAttrs.map((attr) => {
|
|
177861
|
+
const ownerId = attr.attributeOf;
|
|
177862
|
+
const typeRecord = attr.type;
|
|
177863
|
+
const { typeDetails, typeName } = describeType(typeRecord);
|
|
177864
|
+
return {
|
|
177865
|
+
id: attr._id,
|
|
177866
|
+
name: attr.name,
|
|
177867
|
+
label: extractLabel(attr.label),
|
|
177868
|
+
ownerClassId: ownerId,
|
|
177869
|
+
ownerLabel: ownerLabels.get(ownerId) ?? ownerId,
|
|
177870
|
+
type: typeName,
|
|
177871
|
+
typeDetails
|
|
177872
|
+
};
|
|
177873
|
+
});
|
|
177874
|
+
});
|
|
177875
|
+
var getCustomFieldValues = (params) => Effect_exports.gen(function* () {
|
|
177876
|
+
const client = yield* HulyClient;
|
|
177877
|
+
const objectClassRef = toRef(params.objectClass);
|
|
177878
|
+
const objectRef = toRef(params.objectId);
|
|
177879
|
+
const [doc, customAttrs] = yield* Effect_exports.all([
|
|
177880
|
+
client.findOne(objectClassRef, { _id: objectRef }),
|
|
177881
|
+
client.findAll(core.class.Attribute, { isCustom: true })
|
|
177882
|
+
]);
|
|
177883
|
+
if (doc === void 0) {
|
|
177884
|
+
return yield* new CustomFieldObjectNotFoundError({
|
|
177885
|
+
objectId: params.objectId,
|
|
177886
|
+
objectClass: params.objectClass
|
|
177887
|
+
});
|
|
177888
|
+
}
|
|
177889
|
+
const docRecord = doc;
|
|
177890
|
+
const docKeys = new Set(Object.keys(docRecord));
|
|
177891
|
+
return customAttrs.filter((attr) => docKeys.has(attr.name)).map((attr) => {
|
|
177892
|
+
const typeRecord = attr.type;
|
|
177893
|
+
const { typeName } = describeType(typeRecord);
|
|
177894
|
+
return {
|
|
177895
|
+
fieldId: attr._id,
|
|
177896
|
+
label: extractLabel(attr.label),
|
|
177897
|
+
value: docRecord[attr.name],
|
|
177898
|
+
type: typeName
|
|
177899
|
+
};
|
|
177900
|
+
});
|
|
177901
|
+
});
|
|
177902
|
+
var parseValueForType = (value3, typeName) => {
|
|
177903
|
+
switch (typeName) {
|
|
177904
|
+
case "number": {
|
|
177905
|
+
const num = Number(value3);
|
|
177906
|
+
if (Number.isNaN(num)) return value3;
|
|
177907
|
+
return num;
|
|
177908
|
+
}
|
|
177909
|
+
case "boolean":
|
|
177910
|
+
return value3.toLowerCase() === "true";
|
|
177911
|
+
default:
|
|
177912
|
+
return value3;
|
|
177913
|
+
}
|
|
177914
|
+
};
|
|
177915
|
+
var setCustomField = (params) => Effect_exports.gen(function* () {
|
|
177916
|
+
const client = yield* HulyClient;
|
|
177917
|
+
const objectClassRef = toRef(params.objectClass);
|
|
177918
|
+
const objectRef = toRef(params.objectId);
|
|
177919
|
+
const [attr, doc] = yield* Effect_exports.all([
|
|
177920
|
+
client.findOne(
|
|
177921
|
+
core.class.Attribute,
|
|
177922
|
+
{ _id: toRef(params.fieldId), isCustom: true }
|
|
177923
|
+
),
|
|
177924
|
+
client.findOne(objectClassRef, { _id: objectRef })
|
|
177925
|
+
]);
|
|
177926
|
+
if (attr === void 0) {
|
|
177927
|
+
return yield* new CustomFieldNotFoundError({ identifier: params.fieldId });
|
|
177928
|
+
}
|
|
177929
|
+
if (doc === void 0) {
|
|
177930
|
+
return yield* new CustomFieldObjectNotFoundError({
|
|
177931
|
+
objectId: params.objectId,
|
|
177932
|
+
objectClass: params.objectClass
|
|
177933
|
+
});
|
|
177934
|
+
}
|
|
177935
|
+
const typeRecord = attr.type;
|
|
177936
|
+
const { typeName } = describeType(typeRecord);
|
|
177937
|
+
const parsedValue = parseValueForType(params.value, typeName);
|
|
177938
|
+
const ownerClassId = attr.attributeOf;
|
|
177939
|
+
const ownerInfo = yield* resolveClassInfo(client, ownerClassId);
|
|
177940
|
+
if (ownerInfo.kind === import_core30.ClassifierKind.MIXIN) {
|
|
177941
|
+
yield* client.updateMixin(
|
|
177942
|
+
objectRef,
|
|
177943
|
+
objectClassRef,
|
|
177944
|
+
doc.space,
|
|
177945
|
+
toRef(ownerClassId),
|
|
177946
|
+
{ [attr.name]: parsedValue }
|
|
177947
|
+
);
|
|
177948
|
+
} else {
|
|
177949
|
+
yield* client.updateDoc(
|
|
177950
|
+
toRef(ownerClassId),
|
|
177951
|
+
doc.space,
|
|
177952
|
+
objectRef,
|
|
177953
|
+
{ [attr.name]: parsedValue }
|
|
177954
|
+
);
|
|
177955
|
+
}
|
|
177956
|
+
return {
|
|
177957
|
+
objectId: params.objectId,
|
|
177958
|
+
fieldId: attr._id,
|
|
177959
|
+
label: extractLabel(attr.label),
|
|
177960
|
+
value: parsedValue,
|
|
177961
|
+
updated: true
|
|
177962
|
+
};
|
|
177963
|
+
});
|
|
177964
|
+
|
|
177965
|
+
// src/mcp/tools/custom-fields.ts
|
|
177966
|
+
var CATEGORY8 = "custom-fields";
|
|
177967
|
+
var customFieldTools = [
|
|
177968
|
+
{
|
|
177969
|
+
name: "list_custom_fields",
|
|
177970
|
+
description: "List custom field definitions in the workspace. Returns fields with their labels, types, and owner class info. Custom fields are created in the Huly UI on Card types, Issue types, or other classes. Use targetClass to filter fields for a specific class.",
|
|
177971
|
+
category: CATEGORY8,
|
|
177972
|
+
inputSchema: listCustomFieldsParamsJsonSchema,
|
|
177973
|
+
handler: createToolHandler(
|
|
177974
|
+
"list_custom_fields",
|
|
177975
|
+
parseListCustomFieldsParams,
|
|
177976
|
+
listCustomFields
|
|
177977
|
+
)
|
|
177978
|
+
},
|
|
177979
|
+
{
|
|
177980
|
+
name: "get_custom_field_values",
|
|
177981
|
+
description: "Read custom field values from a document. Pass the document's ID and class (from list_cards, list_issues, etc.). Returns all custom field values found on the document with their labels and types.",
|
|
177982
|
+
category: CATEGORY8,
|
|
177983
|
+
inputSchema: getCustomFieldValuesParamsJsonSchema,
|
|
177984
|
+
handler: createToolHandler(
|
|
177985
|
+
"get_custom_field_values",
|
|
177986
|
+
parseGetCustomFieldValuesParams,
|
|
177987
|
+
getCustomFieldValues
|
|
177988
|
+
)
|
|
177989
|
+
},
|
|
177990
|
+
{
|
|
177991
|
+
name: "set_custom_field",
|
|
177992
|
+
description: "Set a custom field value on a document. Requires the document ID, class, field ID (from list_custom_fields), and value. Values are auto-parsed: numbers from numeric strings, booleans from 'true'/'false', strings as-is.",
|
|
177993
|
+
category: CATEGORY8,
|
|
177994
|
+
inputSchema: setCustomFieldParamsJsonSchema,
|
|
177995
|
+
handler: createToolHandler(
|
|
177996
|
+
"set_custom_field",
|
|
177997
|
+
parseSetCustomFieldParams,
|
|
177998
|
+
setCustomField
|
|
177999
|
+
)
|
|
178000
|
+
}
|
|
178001
|
+
];
|
|
178002
|
+
|
|
178003
|
+
// src/huly/operations/components.ts
|
|
178004
|
+
var import_core31 = __toESM(require_lib4(), 1);
|
|
177695
178005
|
|
|
177696
178006
|
// src/utils/assertions.ts
|
|
177697
178007
|
var AssertionError = class extends Error {
|
|
@@ -177745,7 +178055,7 @@ var listComponents = (params) => Effect_exports.gen(function* () {
|
|
|
177745
178055
|
{ space: project3._id },
|
|
177746
178056
|
{
|
|
177747
178057
|
limit,
|
|
177748
|
-
sort: { modifiedOn:
|
|
178058
|
+
sort: { modifiedOn: import_core31.SortingOrder.Descending }
|
|
177749
178059
|
}
|
|
177750
178060
|
);
|
|
177751
178061
|
const leadIds = [
|
|
@@ -177785,7 +178095,7 @@ var getComponent = (params) => Effect_exports.gen(function* () {
|
|
|
177785
178095
|
});
|
|
177786
178096
|
var createComponent = (params) => Effect_exports.gen(function* () {
|
|
177787
178097
|
const { client, project: project3 } = yield* findProject(params.project);
|
|
177788
|
-
const componentId = (0,
|
|
178098
|
+
const componentId = (0, import_core31.generateId)();
|
|
177789
178099
|
const leadParam = params.lead;
|
|
177790
178100
|
const leadRef = leadParam !== void 0 ? yield* Effect_exports.gen(function* () {
|
|
177791
178101
|
const person = yield* findPersonByEmailOrName(client, leadParam);
|
|
@@ -178026,12 +178336,12 @@ var previewDeletion = (params) => {
|
|
|
178026
178336
|
};
|
|
178027
178337
|
|
|
178028
178338
|
// src/mcp/tools/deletion.ts
|
|
178029
|
-
var
|
|
178339
|
+
var CATEGORY9 = "issues";
|
|
178030
178340
|
var deletionTools = [
|
|
178031
178341
|
{
|
|
178032
178342
|
name: "preview_deletion",
|
|
178033
178343
|
description: "Preview the impact of deleting a Huly entity before actually deleting it. Shows affected sub-entities, relations, and warnings. Supports issues, projects, components, and milestones. Use this to understand cascade effects before calling a delete operation.",
|
|
178034
|
-
category:
|
|
178344
|
+
category: CATEGORY9,
|
|
178035
178345
|
inputSchema: previewDeletionParamsJsonSchema,
|
|
178036
178346
|
handler: createToolHandler(
|
|
178037
178347
|
"preview_deletion",
|
|
@@ -178042,12 +178352,12 @@ var deletionTools = [
|
|
|
178042
178352
|
];
|
|
178043
178353
|
|
|
178044
178354
|
// src/mcp/tools/documents.ts
|
|
178045
|
-
var
|
|
178355
|
+
var CATEGORY10 = "documents";
|
|
178046
178356
|
var documentTools = [
|
|
178047
178357
|
{
|
|
178048
178358
|
name: "list_teamspaces",
|
|
178049
178359
|
description: "List all Huly document teamspaces. Returns teamspaces sorted by name. Supports filtering by archived status.",
|
|
178050
|
-
category:
|
|
178360
|
+
category: CATEGORY10,
|
|
178051
178361
|
inputSchema: listTeamspacesParamsJsonSchema,
|
|
178052
178362
|
handler: createToolHandler(
|
|
178053
178363
|
"list_teamspaces",
|
|
@@ -178058,7 +178368,7 @@ var documentTools = [
|
|
|
178058
178368
|
{
|
|
178059
178369
|
name: "get_teamspace",
|
|
178060
178370
|
description: "Get details for a Huly document teamspace including document count. Finds by name or ID, including archived teamspaces.",
|
|
178061
|
-
category:
|
|
178371
|
+
category: CATEGORY10,
|
|
178062
178372
|
inputSchema: getTeamspaceParamsJsonSchema,
|
|
178063
178373
|
handler: createToolHandler(
|
|
178064
178374
|
"get_teamspace",
|
|
@@ -178069,7 +178379,7 @@ var documentTools = [
|
|
|
178069
178379
|
{
|
|
178070
178380
|
name: "create_teamspace",
|
|
178071
178381
|
description: "Create a new Huly document teamspace. Idempotent: returns existing teamspace if one with the same name exists.",
|
|
178072
|
-
category:
|
|
178382
|
+
category: CATEGORY10,
|
|
178073
178383
|
inputSchema: createTeamspaceParamsJsonSchema,
|
|
178074
178384
|
handler: createToolHandler(
|
|
178075
178385
|
"create_teamspace",
|
|
@@ -178080,7 +178390,7 @@ var documentTools = [
|
|
|
178080
178390
|
{
|
|
178081
178391
|
name: "update_teamspace",
|
|
178082
178392
|
description: "Update fields on an existing Huly document teamspace. Only provided fields are modified. Set description to null to clear it.",
|
|
178083
|
-
category:
|
|
178393
|
+
category: CATEGORY10,
|
|
178084
178394
|
inputSchema: updateTeamspaceParamsJsonSchema,
|
|
178085
178395
|
handler: createToolHandler(
|
|
178086
178396
|
"update_teamspace",
|
|
@@ -178091,7 +178401,7 @@ var documentTools = [
|
|
|
178091
178401
|
{
|
|
178092
178402
|
name: "delete_teamspace",
|
|
178093
178403
|
description: "Permanently delete a Huly document teamspace. This action cannot be undone.",
|
|
178094
|
-
category:
|
|
178404
|
+
category: CATEGORY10,
|
|
178095
178405
|
inputSchema: deleteTeamspaceParamsJsonSchema,
|
|
178096
178406
|
handler: createToolHandler(
|
|
178097
178407
|
"delete_teamspace",
|
|
@@ -178102,7 +178412,7 @@ var documentTools = [
|
|
|
178102
178412
|
{
|
|
178103
178413
|
name: "list_documents",
|
|
178104
178414
|
description: "List documents in a Huly teamspace. Returns documents sorted by modification date (newest first). Supports searching by title substring (titleSearch) and content (contentSearch).",
|
|
178105
|
-
category:
|
|
178415
|
+
category: CATEGORY10,
|
|
178106
178416
|
inputSchema: listDocumentsParamsJsonSchema,
|
|
178107
178417
|
handler: createToolHandler(
|
|
178108
178418
|
"list_documents",
|
|
@@ -178113,7 +178423,7 @@ var documentTools = [
|
|
|
178113
178423
|
{
|
|
178114
178424
|
name: "get_document",
|
|
178115
178425
|
description: "Retrieve full details for a Huly document including markdown content. Use this to view document content and metadata.",
|
|
178116
|
-
category:
|
|
178426
|
+
category: CATEGORY10,
|
|
178117
178427
|
inputSchema: getDocumentParamsJsonSchema,
|
|
178118
178428
|
handler: createToolHandler(
|
|
178119
178429
|
"get_document",
|
|
@@ -178124,7 +178434,7 @@ var documentTools = [
|
|
|
178124
178434
|
{
|
|
178125
178435
|
name: "create_document",
|
|
178126
178436
|
description: "Create a new document in a Huly teamspace. Content supports full markdown including native Mermaid diagrams (```mermaid blocks render interactively in Huly UI). Returns the created document id. Use link_document_to_issue to associate the document with a tracker issue.",
|
|
178127
|
-
category:
|
|
178437
|
+
category: CATEGORY10,
|
|
178128
178438
|
inputSchema: createDocumentParamsJsonSchema,
|
|
178129
178439
|
handler: createToolHandler(
|
|
178130
178440
|
"create_document",
|
|
@@ -178135,7 +178445,7 @@ var documentTools = [
|
|
|
178135
178445
|
{
|
|
178136
178446
|
name: "edit_document",
|
|
178137
178447
|
description: "Edit an existing Huly document. Two content modes (mutually exclusive): (1) 'content' for full replace, (2) 'old_text' + 'new_text' for targeted search-and-replace. Multiple matches error unless replace_all is true. Empty new_text deletes matched text. Also supports renaming via 'title'. Content supports full markdown including native Mermaid diagrams.",
|
|
178138
|
-
category:
|
|
178448
|
+
category: CATEGORY10,
|
|
178139
178449
|
inputSchema: editDocumentParamsJsonSchema,
|
|
178140
178450
|
handler: createToolHandler(
|
|
178141
178451
|
"edit_document",
|
|
@@ -178146,7 +178456,7 @@ var documentTools = [
|
|
|
178146
178456
|
{
|
|
178147
178457
|
name: "list_inline_comments",
|
|
178148
178458
|
description: "List inline comment threads from a Huly document. Extracts comments embedded in document content as ProseMirror marks. Each comment includes the highlighted text and thread ID. Set includeReplies=true to also fetch thread reply messages with sender names.",
|
|
178149
|
-
category:
|
|
178459
|
+
category: CATEGORY10,
|
|
178150
178460
|
inputSchema: listInlineCommentsParamsJsonSchema,
|
|
178151
178461
|
handler: createToolHandler(
|
|
178152
178462
|
"list_inline_comments",
|
|
@@ -178157,7 +178467,7 @@ var documentTools = [
|
|
|
178157
178467
|
{
|
|
178158
178468
|
name: "delete_document",
|
|
178159
178469
|
description: "Permanently delete a Huly document. This action cannot be undone.",
|
|
178160
|
-
category:
|
|
178470
|
+
category: CATEGORY10,
|
|
178161
178471
|
inputSchema: deleteDocumentParamsJsonSchema,
|
|
178162
178472
|
handler: createToolHandler(
|
|
178163
178473
|
"delete_document",
|
|
@@ -178425,10 +178735,10 @@ var unlinkDocumentFromIssue = (params) => Effect_exports.gen(function* () {
|
|
|
178425
178735
|
});
|
|
178426
178736
|
|
|
178427
178737
|
// src/huly/operations/issue-templates.ts
|
|
178428
|
-
var
|
|
178738
|
+
var import_core35 = __toESM(require_lib4(), 1);
|
|
178429
178739
|
|
|
178430
178740
|
// src/huly/operations/issues-move.ts
|
|
178431
|
-
var
|
|
178741
|
+
var import_core32 = __toESM(require_lib4(), 1);
|
|
178432
178742
|
var import_tracker2 = __toESM(require_lib21(), 1);
|
|
178433
178743
|
var addLabel = (params) => Effect_exports.gen(function* () {
|
|
178434
178744
|
const { client, issue: issue2, project: project3 } = yield* findProjectAndIssue(params);
|
|
@@ -178455,7 +178765,7 @@ var addLabel = (params) => Effect_exports.gen(function* () {
|
|
|
178455
178765
|
}
|
|
178456
178766
|
);
|
|
178457
178767
|
if (tagElement === void 0) {
|
|
178458
|
-
const tagElementId = (0,
|
|
178768
|
+
const tagElementId = (0, import_core32.generateId)();
|
|
178459
178769
|
const tagElementData = {
|
|
178460
178770
|
title: labelTitle,
|
|
178461
178771
|
description: "",
|
|
@@ -178588,7 +178898,7 @@ var updateDescendantParents = (client, spaceId, parentIssue, parentNewParents) =
|
|
|
178588
178898
|
});
|
|
178589
178899
|
|
|
178590
178900
|
// src/huly/operations/issues-read.ts
|
|
178591
|
-
var
|
|
178901
|
+
var import_core33 = __toESM(require_lib4(), 1);
|
|
178592
178902
|
var import_tracker3 = __toESM(require_lib21(), 1);
|
|
178593
178903
|
var resolveStatusName = (statuses, statusId) => {
|
|
178594
178904
|
const statusDoc = statuses.find((s) => s._id === statusId);
|
|
@@ -178679,7 +178989,7 @@ var listIssues = (params) => Effect_exports.gen(function* () {
|
|
|
178679
178989
|
{
|
|
178680
178990
|
limit,
|
|
178681
178991
|
sort: {
|
|
178682
|
-
modifiedOn:
|
|
178992
|
+
modifiedOn: import_core33.SortingOrder.Descending
|
|
178683
178993
|
}
|
|
178684
178994
|
},
|
|
178685
178995
|
{ assignee: contact.class.Person }
|
|
@@ -178759,7 +179069,7 @@ var getIssue = (params) => Effect_exports.gen(function* () {
|
|
|
178759
179069
|
});
|
|
178760
179070
|
|
|
178761
179071
|
// src/huly/operations/issues-write.ts
|
|
178762
|
-
var
|
|
179072
|
+
var import_core34 = __toESM(require_lib4(), 1);
|
|
178763
179073
|
var import_rank3 = __toESM(require_lib32(), 1);
|
|
178764
179074
|
var import_tracker4 = __toESM(require_lib21(), 1);
|
|
178765
179075
|
var TxIncResult = Schema_exports.Struct({
|
|
@@ -178780,7 +179090,7 @@ var resolveAssignee = (client, assigneeIdentifier) => Effect_exports.gen(functio
|
|
|
178780
179090
|
});
|
|
178781
179091
|
var createIssue = (params) => Effect_exports.gen(function* () {
|
|
178782
179092
|
const { client, defaultStatusId, project: project3, statuses } = yield* findProjectWithStatuses(params.project);
|
|
178783
|
-
const issueId = (0,
|
|
179093
|
+
const issueId = (0, import_core34.generateId)();
|
|
178784
179094
|
const incOps = { $inc: { sequence: 1 } };
|
|
178785
179095
|
const incResult = yield* client.updateDoc(
|
|
178786
179096
|
tracker.class.Project,
|
|
@@ -178795,7 +179105,7 @@ var createIssue = (params) => Effect_exports.gen(function* () {
|
|
|
178795
179105
|
const lastIssue = yield* client.findOne(
|
|
178796
179106
|
tracker.class.Issue,
|
|
178797
179107
|
{ space: project3._id },
|
|
178798
|
-
{ sort: { rank:
|
|
179108
|
+
{ sort: { rank: import_core34.SortingOrder.Descending } }
|
|
178799
179109
|
);
|
|
178800
179110
|
const rank = (0, import_rank3.makeRank)(lastIssue?.rank, void 0);
|
|
178801
179111
|
const descriptionMarkupRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
|
|
@@ -178840,14 +179150,14 @@ var createIssue = (params) => Effect_exports.gen(function* () {
|
|
|
178840
179150
|
priority,
|
|
178841
179151
|
assignee: assigneeRef,
|
|
178842
179152
|
component: null,
|
|
178843
|
-
estimation: 0,
|
|
179153
|
+
estimation: params.estimation ?? 0,
|
|
178844
179154
|
remainingTime: 0,
|
|
178845
179155
|
reportedTime: 0,
|
|
178846
179156
|
reports: 0,
|
|
178847
179157
|
subIssues: 0,
|
|
178848
179158
|
parents,
|
|
178849
179159
|
childInfo: [],
|
|
178850
|
-
dueDate: null,
|
|
179160
|
+
dueDate: params.dueDate ?? null,
|
|
178851
179161
|
rank
|
|
178852
179162
|
};
|
|
178853
179163
|
yield* client.addCollection(
|
|
@@ -178906,6 +179216,12 @@ var updateIssue = (params) => Effect_exports.gen(function* () {
|
|
|
178906
179216
|
updateOps.assignee = person._id;
|
|
178907
179217
|
}
|
|
178908
179218
|
}
|
|
179219
|
+
if (params.dueDate !== void 0) {
|
|
179220
|
+
updateOps.dueDate = params.dueDate;
|
|
179221
|
+
}
|
|
179222
|
+
if (params.estimation !== void 0) {
|
|
179223
|
+
updateOps.estimation = params.estimation ?? 0;
|
|
179224
|
+
}
|
|
178909
179225
|
if (Object.keys(updateOps).length === 0 && !descriptionUpdatedInPlace) {
|
|
178910
179226
|
return { identifier: IssueIdentifier.make(issue2.identifier), updated: false };
|
|
178911
179227
|
}
|
|
@@ -178993,7 +179309,7 @@ var buildTemplateChild = (client, projectId, projectIdentifier, input) => Effect
|
|
|
178993
179309
|
return component._id;
|
|
178994
179310
|
}) : null;
|
|
178995
179311
|
return {
|
|
178996
|
-
id: (0,
|
|
179312
|
+
id: (0, import_core35.generateId)(),
|
|
178997
179313
|
title: input.title,
|
|
178998
179314
|
description: input.description ?? "",
|
|
178999
179315
|
priority: stringToPriority(input.priority || "no-priority"),
|
|
@@ -179010,7 +179326,7 @@ var listIssueTemplates = (params) => Effect_exports.gen(function* () {
|
|
|
179010
179326
|
{ space: project3._id },
|
|
179011
179327
|
{
|
|
179012
179328
|
limit,
|
|
179013
|
-
sort: { modifiedOn:
|
|
179329
|
+
sort: { modifiedOn: import_core35.SortingOrder.Descending }
|
|
179014
179330
|
}
|
|
179015
179331
|
);
|
|
179016
179332
|
const summaries = templates.map((t) => {
|
|
@@ -179054,7 +179370,7 @@ var getIssueTemplate = (params) => Effect_exports.gen(function* () {
|
|
|
179054
179370
|
});
|
|
179055
179371
|
var createIssueTemplate = (params) => Effect_exports.gen(function* () {
|
|
179056
179372
|
const { client, project: project3 } = yield* findProject(params.project);
|
|
179057
|
-
const templateId = (0,
|
|
179373
|
+
const templateId = (0, import_core35.generateId)();
|
|
179058
179374
|
const assigneeParam = params.assignee;
|
|
179059
179375
|
const assigneeRef = assigneeParam !== void 0 ? yield* Effect_exports.gen(function* () {
|
|
179060
179376
|
const person = yield* findPersonByEmailOrName(client, assigneeParam);
|
|
@@ -179288,10 +179604,10 @@ var removeTemplateChild = (params) => Effect_exports.gen(function* () {
|
|
|
179288
179604
|
});
|
|
179289
179605
|
|
|
179290
179606
|
// src/huly/operations/labels.ts
|
|
179291
|
-
var
|
|
179607
|
+
var import_core37 = __toESM(require_lib4(), 1);
|
|
179292
179608
|
|
|
179293
179609
|
// src/huly/operations/tag-categories.ts
|
|
179294
|
-
var
|
|
179610
|
+
var import_core36 = __toESM(require_lib4(), 1);
|
|
179295
179611
|
var issueClassRef = toRef(tracker.class.Issue);
|
|
179296
179612
|
var findCategoryByIdOrLabel = (client, idOrLabel) => Effect_exports.gen(function* () {
|
|
179297
179613
|
const cat = (yield* client.findOne(
|
|
@@ -179329,7 +179645,7 @@ var listTagCategories = (params) => Effect_exports.gen(function* () {
|
|
|
179329
179645
|
query,
|
|
179330
179646
|
{
|
|
179331
179647
|
limit,
|
|
179332
|
-
sort: { modifiedOn:
|
|
179648
|
+
sort: { modifiedOn: import_core36.SortingOrder.Descending }
|
|
179333
179649
|
}
|
|
179334
179650
|
);
|
|
179335
179651
|
return categories.map(toSummary);
|
|
@@ -179344,7 +179660,7 @@ var createTagCategory = (params) => Effect_exports.gen(function* () {
|
|
|
179344
179660
|
if (existing !== void 0) {
|
|
179345
179661
|
return { id: TagCategoryId.make(existing._id), label: existing.label, created: false };
|
|
179346
179662
|
}
|
|
179347
|
-
const catId = (0,
|
|
179663
|
+
const catId = (0, import_core36.generateId)();
|
|
179348
179664
|
const catData = {
|
|
179349
179665
|
// Asset is a branded string type (Metadata<URL>) with no runtime constructor.
|
|
179350
179666
|
// Empty string is the "no icon" sentinel; Huly UI renders a default icon.
|
|
@@ -179446,7 +179762,7 @@ var listLabels = (params) => Effect_exports.gen(function* () {
|
|
|
179446
179762
|
query,
|
|
179447
179763
|
{
|
|
179448
179764
|
limit,
|
|
179449
|
-
sort: { modifiedOn:
|
|
179765
|
+
sort: { modifiedOn: import_core37.SortingOrder.Descending }
|
|
179450
179766
|
}
|
|
179451
179767
|
);
|
|
179452
179768
|
return elements.map((e) => ({
|
|
@@ -179471,7 +179787,7 @@ var createLabel = (params) => Effect_exports.gen(function* () {
|
|
|
179471
179787
|
return { id: TagElementId.make(existing._id), title: existing.title, created: false };
|
|
179472
179788
|
}
|
|
179473
179789
|
const categoryRef = yield* resolveCategoryRef(client, params.category);
|
|
179474
|
-
const tagId = (0,
|
|
179790
|
+
const tagId = (0, import_core37.generateId)();
|
|
179475
179791
|
const color = params.color ?? 0;
|
|
179476
179792
|
const tagData = {
|
|
179477
179793
|
title: params.title,
|
|
@@ -179547,12 +179863,12 @@ var removeIssueLabel = (params) => Effect_exports.gen(function* () {
|
|
|
179547
179863
|
});
|
|
179548
179864
|
|
|
179549
179865
|
// src/mcp/tools/issues.ts
|
|
179550
|
-
var
|
|
179866
|
+
var CATEGORY11 = "issues";
|
|
179551
179867
|
var issueTools = [
|
|
179552
179868
|
{
|
|
179553
179869
|
name: "list_issues",
|
|
179554
179870
|
description: "Query Huly issues with optional filters. Returns issues sorted by modification date (newest first). Supports filtering by project, status, assignee, component, and parentIssue (to list children of a specific issue). Supports searching by title substring (titleSearch) and description content (descriptionSearch).",
|
|
179555
|
-
category:
|
|
179871
|
+
category: CATEGORY11,
|
|
179556
179872
|
inputSchema: listIssuesParamsJsonSchema,
|
|
179557
179873
|
handler: createToolHandler(
|
|
179558
179874
|
"list_issues",
|
|
@@ -179563,7 +179879,7 @@ var issueTools = [
|
|
|
179563
179879
|
{
|
|
179564
179880
|
name: "get_issue",
|
|
179565
179881
|
description: "Retrieve full details for a Huly issue including markdown description. Use this to view issue content, comments, or full metadata.",
|
|
179566
|
-
category:
|
|
179882
|
+
category: CATEGORY11,
|
|
179567
179883
|
inputSchema: getIssueParamsJsonSchema,
|
|
179568
179884
|
handler: createToolHandler(
|
|
179569
179885
|
"get_issue",
|
|
@@ -179574,7 +179890,7 @@ var issueTools = [
|
|
|
179574
179890
|
{
|
|
179575
179891
|
name: "create_issue",
|
|
179576
179892
|
description: "Create a new issue in a Huly project. Optionally create as a sub-issue by specifying parentIssue. Description supports markdown formatting. Returns the created issue identifier.",
|
|
179577
|
-
category:
|
|
179893
|
+
category: CATEGORY11,
|
|
179578
179894
|
inputSchema: createIssueParamsJsonSchema,
|
|
179579
179895
|
handler: createToolHandler(
|
|
179580
179896
|
"create_issue",
|
|
@@ -179585,7 +179901,7 @@ var issueTools = [
|
|
|
179585
179901
|
{
|
|
179586
179902
|
name: "update_issue",
|
|
179587
179903
|
description: "Update fields on an existing Huly issue. Only provided fields are modified. Description updates support markdown.",
|
|
179588
|
-
category:
|
|
179904
|
+
category: CATEGORY11,
|
|
179589
179905
|
inputSchema: updateIssueParamsJsonSchema,
|
|
179590
179906
|
handler: createToolHandler(
|
|
179591
179907
|
"update_issue",
|
|
@@ -179596,7 +179912,7 @@ var issueTools = [
|
|
|
179596
179912
|
{
|
|
179597
179913
|
name: "add_issue_label",
|
|
179598
179914
|
description: "Add a tag/label to a Huly issue. Creates the tag if it doesn't exist in the project.",
|
|
179599
|
-
category:
|
|
179915
|
+
category: CATEGORY11,
|
|
179600
179916
|
inputSchema: addLabelParamsJsonSchema,
|
|
179601
179917
|
handler: createToolHandler(
|
|
179602
179918
|
"add_issue_label",
|
|
@@ -179607,7 +179923,7 @@ var issueTools = [
|
|
|
179607
179923
|
{
|
|
179608
179924
|
name: "remove_issue_label",
|
|
179609
179925
|
description: "Remove a tag/label from a Huly issue. Detaches the label reference; does not delete the label definition.",
|
|
179610
|
-
category:
|
|
179926
|
+
category: CATEGORY11,
|
|
179611
179927
|
inputSchema: removeLabelParamsJsonSchema,
|
|
179612
179928
|
handler: createToolHandler(
|
|
179613
179929
|
"remove_issue_label",
|
|
@@ -179618,7 +179934,7 @@ var issueTools = [
|
|
|
179618
179934
|
{
|
|
179619
179935
|
name: "delete_issue",
|
|
179620
179936
|
description: "Permanently delete a Huly issue. This action cannot be undone.",
|
|
179621
|
-
category:
|
|
179937
|
+
category: CATEGORY11,
|
|
179622
179938
|
inputSchema: deleteIssueParamsJsonSchema,
|
|
179623
179939
|
handler: createToolHandler(
|
|
179624
179940
|
"delete_issue",
|
|
@@ -179629,7 +179945,7 @@ var issueTools = [
|
|
|
179629
179945
|
{
|
|
179630
179946
|
name: "move_issue",
|
|
179631
179947
|
description: "Move an issue to a new parent (making it a sub-issue) or to top-level (null). Updates parent/child relationships and sub-issue counts.",
|
|
179632
|
-
category:
|
|
179948
|
+
category: CATEGORY11,
|
|
179633
179949
|
inputSchema: moveIssueParamsJsonSchema,
|
|
179634
179950
|
handler: createToolHandler(
|
|
179635
179951
|
"move_issue",
|
|
@@ -179640,7 +179956,7 @@ var issueTools = [
|
|
|
179640
179956
|
{
|
|
179641
179957
|
name: "list_components",
|
|
179642
179958
|
description: "List components in a Huly project. Components organize issues by area/feature. Returns components sorted by modification date (newest first).",
|
|
179643
|
-
category:
|
|
179959
|
+
category: CATEGORY11,
|
|
179644
179960
|
inputSchema: listComponentsParamsJsonSchema,
|
|
179645
179961
|
handler: createToolHandler(
|
|
179646
179962
|
"list_components",
|
|
@@ -179651,7 +179967,7 @@ var issueTools = [
|
|
|
179651
179967
|
{
|
|
179652
179968
|
name: "get_component",
|
|
179653
179969
|
description: "Retrieve full details for a Huly component. Use this to view component content and metadata.",
|
|
179654
|
-
category:
|
|
179970
|
+
category: CATEGORY11,
|
|
179655
179971
|
inputSchema: getComponentParamsJsonSchema,
|
|
179656
179972
|
handler: createToolHandler(
|
|
179657
179973
|
"get_component",
|
|
@@ -179662,7 +179978,7 @@ var issueTools = [
|
|
|
179662
179978
|
{
|
|
179663
179979
|
name: "create_component",
|
|
179664
179980
|
description: "Create a new component in a Huly project. Components help organize issues by area/feature. Returns the created component ID and label.",
|
|
179665
|
-
category:
|
|
179981
|
+
category: CATEGORY11,
|
|
179666
179982
|
inputSchema: createComponentParamsJsonSchema,
|
|
179667
179983
|
handler: createToolHandler(
|
|
179668
179984
|
"create_component",
|
|
@@ -179673,7 +179989,7 @@ var issueTools = [
|
|
|
179673
179989
|
{
|
|
179674
179990
|
name: "update_component",
|
|
179675
179991
|
description: "Update fields on an existing Huly component. Only provided fields are modified.",
|
|
179676
|
-
category:
|
|
179992
|
+
category: CATEGORY11,
|
|
179677
179993
|
inputSchema: updateComponentParamsJsonSchema,
|
|
179678
179994
|
handler: createToolHandler(
|
|
179679
179995
|
"update_component",
|
|
@@ -179684,7 +180000,7 @@ var issueTools = [
|
|
|
179684
180000
|
{
|
|
179685
180001
|
name: "set_issue_component",
|
|
179686
180002
|
description: "Set or clear the component on a Huly issue. Pass null for component to clear it.",
|
|
179687
|
-
category:
|
|
180003
|
+
category: CATEGORY11,
|
|
179688
180004
|
inputSchema: setIssueComponentParamsJsonSchema,
|
|
179689
180005
|
handler: createToolHandler(
|
|
179690
180006
|
"set_issue_component",
|
|
@@ -179695,7 +180011,7 @@ var issueTools = [
|
|
|
179695
180011
|
{
|
|
179696
180012
|
name: "delete_component",
|
|
179697
180013
|
description: "Permanently delete a Huly component. This action cannot be undone.",
|
|
179698
|
-
category:
|
|
180014
|
+
category: CATEGORY11,
|
|
179699
180015
|
inputSchema: deleteComponentParamsJsonSchema,
|
|
179700
180016
|
handler: createToolHandler(
|
|
179701
180017
|
"delete_component",
|
|
@@ -179706,7 +180022,7 @@ var issueTools = [
|
|
|
179706
180022
|
{
|
|
179707
180023
|
name: "list_issue_templates",
|
|
179708
180024
|
description: "List issue templates in a Huly project. Templates define reusable issue configurations. Returns templates sorted by modification date (newest first).",
|
|
179709
|
-
category:
|
|
180025
|
+
category: CATEGORY11,
|
|
179710
180026
|
inputSchema: listIssueTemplatesParamsJsonSchema,
|
|
179711
180027
|
handler: createToolHandler(
|
|
179712
180028
|
"list_issue_templates",
|
|
@@ -179717,7 +180033,7 @@ var issueTools = [
|
|
|
179717
180033
|
{
|
|
179718
180034
|
name: "get_issue_template",
|
|
179719
180035
|
description: "Retrieve full details for a Huly issue template including children (sub-task templates). Use this to view template content, default values, and child template IDs.",
|
|
179720
|
-
category:
|
|
180036
|
+
category: CATEGORY11,
|
|
179721
180037
|
inputSchema: getIssueTemplateParamsJsonSchema,
|
|
179722
180038
|
handler: createToolHandler(
|
|
179723
180039
|
"get_issue_template",
|
|
@@ -179728,7 +180044,7 @@ var issueTools = [
|
|
|
179728
180044
|
{
|
|
179729
180045
|
name: "create_issue_template",
|
|
179730
180046
|
description: "Create a new issue template in a Huly project. Templates define default values for new issues. Optionally include children (sub-task templates) that will become sub-issues when creating issues from this template. Returns the created template ID and title.",
|
|
179731
|
-
category:
|
|
180047
|
+
category: CATEGORY11,
|
|
179732
180048
|
inputSchema: createIssueTemplateParamsJsonSchema,
|
|
179733
180049
|
handler: createToolHandler(
|
|
179734
180050
|
"create_issue_template",
|
|
@@ -179739,7 +180055,7 @@ var issueTools = [
|
|
|
179739
180055
|
{
|
|
179740
180056
|
name: "create_issue_from_template",
|
|
179741
180057
|
description: "Create a new issue from a template. Applies template defaults, allowing overrides for specific fields. If the template has children (sub-task templates), sub-issues are created automatically unless includeChildren is set to false. Returns the created issue identifier and count of children created.",
|
|
179742
|
-
category:
|
|
180058
|
+
category: CATEGORY11,
|
|
179743
180059
|
inputSchema: createIssueFromTemplateParamsJsonSchema,
|
|
179744
180060
|
handler: createToolHandler(
|
|
179745
180061
|
"create_issue_from_template",
|
|
@@ -179750,7 +180066,7 @@ var issueTools = [
|
|
|
179750
180066
|
{
|
|
179751
180067
|
name: "update_issue_template",
|
|
179752
180068
|
description: "Update fields on an existing Huly issue template. Only provided fields are modified.",
|
|
179753
|
-
category:
|
|
180069
|
+
category: CATEGORY11,
|
|
179754
180070
|
inputSchema: updateIssueTemplateParamsJsonSchema,
|
|
179755
180071
|
handler: createToolHandler(
|
|
179756
180072
|
"update_issue_template",
|
|
@@ -179761,7 +180077,7 @@ var issueTools = [
|
|
|
179761
180077
|
{
|
|
179762
180078
|
name: "delete_issue_template",
|
|
179763
180079
|
description: "Permanently delete a Huly issue template. This action cannot be undone.",
|
|
179764
|
-
category:
|
|
180080
|
+
category: CATEGORY11,
|
|
179765
180081
|
inputSchema: deleteIssueTemplateParamsJsonSchema,
|
|
179766
180082
|
handler: createToolHandler(
|
|
179767
180083
|
"delete_issue_template",
|
|
@@ -179772,7 +180088,7 @@ var issueTools = [
|
|
|
179772
180088
|
{
|
|
179773
180089
|
name: "add_template_child",
|
|
179774
180090
|
description: "Add a child (sub-task) template to an issue template. The child defines default values for sub-issues created when using create_issue_from_template. Returns the child template ID.",
|
|
179775
|
-
category:
|
|
180091
|
+
category: CATEGORY11,
|
|
179776
180092
|
inputSchema: addTemplateChildParamsJsonSchema,
|
|
179777
180093
|
handler: createToolHandler(
|
|
179778
180094
|
"add_template_child",
|
|
@@ -179783,7 +180099,7 @@ var issueTools = [
|
|
|
179783
180099
|
{
|
|
179784
180100
|
name: "remove_template_child",
|
|
179785
180101
|
description: "Remove a child (sub-task) template from an issue template by its child ID. Get child IDs from get_issue_template response.",
|
|
179786
|
-
category:
|
|
180102
|
+
category: CATEGORY11,
|
|
179787
180103
|
inputSchema: removeTemplateChildParamsJsonSchema,
|
|
179788
180104
|
handler: createToolHandler(
|
|
179789
180105
|
"remove_template_child",
|
|
@@ -179794,7 +180110,7 @@ var issueTools = [
|
|
|
179794
180110
|
{
|
|
179795
180111
|
name: "add_issue_relation",
|
|
179796
180112
|
description: "Add a relation between two issues. Relation types: 'blocks' (source blocks target \u2014 pushes into target's blockedBy), 'is-blocked-by' (source is blocked by target \u2014 pushes into source's blockedBy), 'relates-to' (bidirectional link \u2014 updates both sides). targetIssue accepts cross-project identifiers like 'OTHER-42'. No-op if the relation already exists.",
|
|
179797
|
-
category:
|
|
180113
|
+
category: CATEGORY11,
|
|
179798
180114
|
inputSchema: addIssueRelationParamsJsonSchema,
|
|
179799
180115
|
handler: createToolHandler(
|
|
179800
180116
|
"add_issue_relation",
|
|
@@ -179805,7 +180121,7 @@ var issueTools = [
|
|
|
179805
180121
|
{
|
|
179806
180122
|
name: "remove_issue_relation",
|
|
179807
180123
|
description: "Remove a relation between two issues. Mirrors add_issue_relation: 'blocks' pulls from target's blockedBy, 'is-blocked-by' pulls from source's blockedBy, 'relates-to' pulls from both sides. No-op if the relation doesn't exist.",
|
|
179808
|
-
category:
|
|
180124
|
+
category: CATEGORY11,
|
|
179809
180125
|
inputSchema: removeIssueRelationParamsJsonSchema,
|
|
179810
180126
|
handler: createToolHandler(
|
|
179811
180127
|
"remove_issue_relation",
|
|
@@ -179816,7 +180132,7 @@ var issueTools = [
|
|
|
179816
180132
|
{
|
|
179817
180133
|
name: "list_issue_relations",
|
|
179818
180134
|
description: "List all relations of an issue. Returns blockedBy (issues blocking this one), relations (bidirectional issue links), and documents (linked documents with title/teamspace). Does NOT return issues that this issue blocks \u2014 use list_issue_relations on the target issue to see that.",
|
|
179819
|
-
category:
|
|
180135
|
+
category: CATEGORY11,
|
|
179820
180136
|
inputSchema: listIssueRelationsParamsJsonSchema,
|
|
179821
180137
|
handler: createToolHandler(
|
|
179822
180138
|
"list_issue_relations",
|
|
@@ -179827,7 +180143,7 @@ var issueTools = [
|
|
|
179827
180143
|
{
|
|
179828
180144
|
name: "link_document_to_issue",
|
|
179829
180145
|
description: "Link a Huly document to an issue. The link appears in the issue's Relations panel in the UI. Idempotent: no-op if the document is already linked. Use list_issue_relations to see linked documents.",
|
|
179830
|
-
category:
|
|
180146
|
+
category: CATEGORY11,
|
|
179831
180147
|
inputSchema: linkDocumentToIssueParamsJsonSchema,
|
|
179832
180148
|
handler: createToolHandler(
|
|
179833
180149
|
"link_document_to_issue",
|
|
@@ -179838,7 +180154,7 @@ var issueTools = [
|
|
|
179838
180154
|
{
|
|
179839
180155
|
name: "unlink_document_from_issue",
|
|
179840
180156
|
description: "Remove a document link from an issue. Idempotent: no-op if the document is not linked.",
|
|
179841
|
-
category:
|
|
180157
|
+
category: CATEGORY11,
|
|
179842
180158
|
inputSchema: unlinkDocumentFromIssueParamsJsonSchema,
|
|
179843
180159
|
handler: createToolHandler(
|
|
179844
180160
|
"unlink_document_from_issue",
|
|
@@ -179849,12 +180165,12 @@ var issueTools = [
|
|
|
179849
180165
|
];
|
|
179850
180166
|
|
|
179851
180167
|
// src/mcp/tools/labels.ts
|
|
179852
|
-
var
|
|
180168
|
+
var CATEGORY12 = "labels";
|
|
179853
180169
|
var labelTools = [
|
|
179854
180170
|
{
|
|
179855
180171
|
name: "list_labels",
|
|
179856
180172
|
description: "List label/tag definitions in the workspace. Labels are global (not project-scoped). Returns labels for tracker issues sorted by modification date (newest first).",
|
|
179857
|
-
category:
|
|
180173
|
+
category: CATEGORY12,
|
|
179858
180174
|
inputSchema: listLabelsParamsJsonSchema,
|
|
179859
180175
|
handler: createToolHandler(
|
|
179860
180176
|
"list_labels",
|
|
@@ -179865,7 +180181,7 @@ var labelTools = [
|
|
|
179865
180181
|
{
|
|
179866
180182
|
name: "create_label",
|
|
179867
180183
|
description: "Create a new label/tag definition in the workspace. Labels are global and can be attached to any issue. Returns existing label if one with the same title already exists (created=false). Use add_issue_label to attach a label to a specific issue.",
|
|
179868
|
-
category:
|
|
180184
|
+
category: CATEGORY12,
|
|
179869
180185
|
inputSchema: createLabelParamsJsonSchema,
|
|
179870
180186
|
handler: createToolHandler(
|
|
179871
180187
|
"create_label",
|
|
@@ -179876,7 +180192,7 @@ var labelTools = [
|
|
|
179876
180192
|
{
|
|
179877
180193
|
name: "update_label",
|
|
179878
180194
|
description: "Update a label/tag definition. Accepts label ID or title. Only provided fields are modified.",
|
|
179879
|
-
category:
|
|
180195
|
+
category: CATEGORY12,
|
|
179880
180196
|
inputSchema: updateLabelParamsJsonSchema,
|
|
179881
180197
|
handler: createToolHandler(
|
|
179882
180198
|
"update_label",
|
|
@@ -179887,7 +180203,7 @@ var labelTools = [
|
|
|
179887
180203
|
{
|
|
179888
180204
|
name: "delete_label",
|
|
179889
180205
|
description: "Permanently delete a label/tag definition. Accepts label ID or title. This action cannot be undone.",
|
|
179890
|
-
category:
|
|
180206
|
+
category: CATEGORY12,
|
|
179891
180207
|
inputSchema: deleteLabelParamsJsonSchema,
|
|
179892
180208
|
handler: createToolHandler(
|
|
179893
180209
|
"delete_label",
|
|
@@ -179898,7 +180214,7 @@ var labelTools = [
|
|
|
179898
180214
|
];
|
|
179899
180215
|
|
|
179900
180216
|
// src/huly/operations/milestones.ts
|
|
179901
|
-
var
|
|
180217
|
+
var import_core38 = __toESM(require_lib4(), 1);
|
|
179902
180218
|
var import_tracker5 = __toESM(require_lib21(), 1);
|
|
179903
180219
|
var milestoneStatusToStringMap = {
|
|
179904
180220
|
[import_tracker5.MilestoneStatus.Planned]: "planned",
|
|
@@ -179942,7 +180258,7 @@ var listMilestones = (params) => Effect_exports.gen(function* () {
|
|
|
179942
180258
|
{ space: project3._id },
|
|
179943
180259
|
{
|
|
179944
180260
|
limit,
|
|
179945
|
-
sort: { modifiedOn:
|
|
180261
|
+
sort: { modifiedOn: import_core38.SortingOrder.Descending }
|
|
179946
180262
|
}
|
|
179947
180263
|
);
|
|
179948
180264
|
const summaries = milestones.map((m) => ({
|
|
@@ -179970,7 +180286,7 @@ var getMilestone = (params) => Effect_exports.gen(function* () {
|
|
|
179970
180286
|
});
|
|
179971
180287
|
var createMilestone = (params) => Effect_exports.gen(function* () {
|
|
179972
180288
|
const { client, project: project3 } = yield* findProject(params.project);
|
|
179973
|
-
const milestoneId = (0,
|
|
180289
|
+
const milestoneId = (0, import_core38.generateId)();
|
|
179974
180290
|
const milestoneData = {
|
|
179975
180291
|
label: params.label,
|
|
179976
180292
|
description: params.description ?? "",
|
|
@@ -180034,12 +180350,12 @@ var deleteMilestone = (params) => Effect_exports.gen(function* () {
|
|
|
180034
180350
|
});
|
|
180035
180351
|
|
|
180036
180352
|
// src/mcp/tools/milestones.ts
|
|
180037
|
-
var
|
|
180353
|
+
var CATEGORY13 = "milestones";
|
|
180038
180354
|
var milestoneTools = [
|
|
180039
180355
|
{
|
|
180040
180356
|
name: "list_milestones",
|
|
180041
180357
|
description: "List milestones in a Huly project. Returns milestones sorted by modification date (newest first).",
|
|
180042
|
-
category:
|
|
180358
|
+
category: CATEGORY13,
|
|
180043
180359
|
inputSchema: listMilestonesParamsJsonSchema,
|
|
180044
180360
|
handler: createToolHandler(
|
|
180045
180361
|
"list_milestones",
|
|
@@ -180050,7 +180366,7 @@ var milestoneTools = [
|
|
|
180050
180366
|
{
|
|
180051
180367
|
name: "get_milestone",
|
|
180052
180368
|
description: "Retrieve full details for a Huly milestone. Use this to view milestone content and metadata.",
|
|
180053
|
-
category:
|
|
180369
|
+
category: CATEGORY13,
|
|
180054
180370
|
inputSchema: getMilestoneParamsJsonSchema,
|
|
180055
180371
|
handler: createToolHandler(
|
|
180056
180372
|
"get_milestone",
|
|
@@ -180061,7 +180377,7 @@ var milestoneTools = [
|
|
|
180061
180377
|
{
|
|
180062
180378
|
name: "create_milestone",
|
|
180063
180379
|
description: "Create a new milestone in a Huly project. Returns the created milestone ID and label.",
|
|
180064
|
-
category:
|
|
180380
|
+
category: CATEGORY13,
|
|
180065
180381
|
inputSchema: createMilestoneParamsJsonSchema,
|
|
180066
180382
|
handler: createToolHandler(
|
|
180067
180383
|
"create_milestone",
|
|
@@ -180072,7 +180388,7 @@ var milestoneTools = [
|
|
|
180072
180388
|
{
|
|
180073
180389
|
name: "update_milestone",
|
|
180074
180390
|
description: "Update fields on an existing Huly milestone. Only provided fields are modified.",
|
|
180075
|
-
category:
|
|
180391
|
+
category: CATEGORY13,
|
|
180076
180392
|
inputSchema: updateMilestoneParamsJsonSchema,
|
|
180077
180393
|
handler: createToolHandler(
|
|
180078
180394
|
"update_milestone",
|
|
@@ -180083,7 +180399,7 @@ var milestoneTools = [
|
|
|
180083
180399
|
{
|
|
180084
180400
|
name: "set_issue_milestone",
|
|
180085
180401
|
description: "Set or clear the milestone on a Huly issue. Pass null for milestone to clear it.",
|
|
180086
|
-
category:
|
|
180402
|
+
category: CATEGORY13,
|
|
180087
180403
|
inputSchema: setIssueMilestoneParamsJsonSchema,
|
|
180088
180404
|
handler: createToolHandler(
|
|
180089
180405
|
"set_issue_milestone",
|
|
@@ -180094,7 +180410,7 @@ var milestoneTools = [
|
|
|
180094
180410
|
{
|
|
180095
180411
|
name: "delete_milestone",
|
|
180096
180412
|
description: "Permanently delete a Huly milestone. This action cannot be undone.",
|
|
180097
|
-
category:
|
|
180413
|
+
category: CATEGORY13,
|
|
180098
180414
|
inputSchema: deleteMilestoneParamsJsonSchema,
|
|
180099
180415
|
handler: createToolHandler(
|
|
180100
180416
|
"delete_milestone",
|
|
@@ -180105,7 +180421,7 @@ var milestoneTools = [
|
|
|
180105
180421
|
];
|
|
180106
180422
|
|
|
180107
180423
|
// src/huly/operations/notifications.ts
|
|
180108
|
-
var
|
|
180424
|
+
var import_core39 = __toESM(require_lib4(), 1);
|
|
180109
180425
|
var toDocNotifyContextSummary = (ctx) => ({
|
|
180110
180426
|
id: NotificationContextId.make(ctx._id),
|
|
180111
180427
|
objectId: ctx.objectId,
|
|
@@ -180151,7 +180467,7 @@ var listNotifications = (params) => Effect_exports.gen(function* () {
|
|
|
180151
180467
|
{
|
|
180152
180468
|
limit,
|
|
180153
180469
|
sort: {
|
|
180154
|
-
modifiedOn:
|
|
180470
|
+
modifiedOn: import_core39.SortingOrder.Descending
|
|
180155
180471
|
}
|
|
180156
180472
|
}
|
|
180157
180473
|
);
|
|
@@ -180293,7 +180609,7 @@ var listNotificationContexts = (params) => Effect_exports.gen(function* () {
|
|
|
180293
180609
|
{
|
|
180294
180610
|
limit,
|
|
180295
180611
|
sort: {
|
|
180296
|
-
lastUpdateTimestamp:
|
|
180612
|
+
lastUpdateTimestamp: import_core39.SortingOrder.Descending
|
|
180297
180613
|
}
|
|
180298
180614
|
}
|
|
180299
180615
|
);
|
|
@@ -180362,12 +180678,12 @@ var getUnreadNotificationCount = () => Effect_exports.gen(function* () {
|
|
|
180362
180678
|
});
|
|
180363
180679
|
|
|
180364
180680
|
// src/mcp/tools/notifications.ts
|
|
180365
|
-
var
|
|
180681
|
+
var CATEGORY14 = "notifications";
|
|
180366
180682
|
var notificationTools = [
|
|
180367
180683
|
{
|
|
180368
180684
|
name: "list_notifications",
|
|
180369
180685
|
description: "List inbox notifications. Returns notifications sorted by modification date (newest first). Supports filtering by read/archived status.",
|
|
180370
|
-
category:
|
|
180686
|
+
category: CATEGORY14,
|
|
180371
180687
|
inputSchema: listNotificationsParamsJsonSchema,
|
|
180372
180688
|
handler: createToolHandler(
|
|
180373
180689
|
"list_notifications",
|
|
@@ -180378,7 +180694,7 @@ var notificationTools = [
|
|
|
180378
180694
|
{
|
|
180379
180695
|
name: "get_notification",
|
|
180380
180696
|
description: "Retrieve full details for a notification. Use this to view notification content and metadata.",
|
|
180381
|
-
category:
|
|
180697
|
+
category: CATEGORY14,
|
|
180382
180698
|
inputSchema: getNotificationParamsJsonSchema,
|
|
180383
180699
|
handler: createToolHandler(
|
|
180384
180700
|
"get_notification",
|
|
@@ -180389,7 +180705,7 @@ var notificationTools = [
|
|
|
180389
180705
|
{
|
|
180390
180706
|
name: "mark_notification_read",
|
|
180391
180707
|
description: "Mark a notification as read.",
|
|
180392
|
-
category:
|
|
180708
|
+
category: CATEGORY14,
|
|
180393
180709
|
inputSchema: markNotificationReadParamsJsonSchema,
|
|
180394
180710
|
handler: createToolHandler(
|
|
180395
180711
|
"mark_notification_read",
|
|
@@ -180400,7 +180716,7 @@ var notificationTools = [
|
|
|
180400
180716
|
{
|
|
180401
180717
|
name: "mark_all_notifications_read",
|
|
180402
180718
|
description: "Mark all unread notifications as read. Returns the count of notifications marked.",
|
|
180403
|
-
category:
|
|
180719
|
+
category: CATEGORY14,
|
|
180404
180720
|
inputSchema: emptyParamsJsonSchema,
|
|
180405
180721
|
handler: createToolHandler(
|
|
180406
180722
|
"mark_all_notifications_read",
|
|
@@ -180411,7 +180727,7 @@ var notificationTools = [
|
|
|
180411
180727
|
{
|
|
180412
180728
|
name: "archive_notification",
|
|
180413
180729
|
description: "Archive a notification. Archived notifications are hidden from the main inbox view.",
|
|
180414
|
-
category:
|
|
180730
|
+
category: CATEGORY14,
|
|
180415
180731
|
inputSchema: archiveNotificationParamsJsonSchema,
|
|
180416
180732
|
handler: createToolHandler(
|
|
180417
180733
|
"archive_notification",
|
|
@@ -180422,7 +180738,7 @@ var notificationTools = [
|
|
|
180422
180738
|
{
|
|
180423
180739
|
name: "archive_all_notifications",
|
|
180424
180740
|
description: "Archive all notifications. Returns the count of notifications archived.",
|
|
180425
|
-
category:
|
|
180741
|
+
category: CATEGORY14,
|
|
180426
180742
|
inputSchema: emptyParamsJsonSchema,
|
|
180427
180743
|
handler: createToolHandler(
|
|
180428
180744
|
"archive_all_notifications",
|
|
@@ -180433,7 +180749,7 @@ var notificationTools = [
|
|
|
180433
180749
|
{
|
|
180434
180750
|
name: "delete_notification",
|
|
180435
180751
|
description: "Permanently delete a notification. This action cannot be undone.",
|
|
180436
|
-
category:
|
|
180752
|
+
category: CATEGORY14,
|
|
180437
180753
|
inputSchema: deleteNotificationParamsJsonSchema,
|
|
180438
180754
|
handler: createToolHandler(
|
|
180439
180755
|
"delete_notification",
|
|
@@ -180444,7 +180760,7 @@ var notificationTools = [
|
|
|
180444
180760
|
{
|
|
180445
180761
|
name: "get_notification_context",
|
|
180446
180762
|
description: "Get notification context for an entity. Returns tracking information for a specific object.",
|
|
180447
|
-
category:
|
|
180763
|
+
category: CATEGORY14,
|
|
180448
180764
|
inputSchema: getNotificationContextParamsJsonSchema,
|
|
180449
180765
|
handler: createToolHandler(
|
|
180450
180766
|
"get_notification_context",
|
|
@@ -180455,7 +180771,7 @@ var notificationTools = [
|
|
|
180455
180771
|
{
|
|
180456
180772
|
name: "list_notification_contexts",
|
|
180457
180773
|
description: "List notification contexts. Returns contexts sorted by last update timestamp (newest first). Supports filtering by pinned status.",
|
|
180458
|
-
category:
|
|
180774
|
+
category: CATEGORY14,
|
|
180459
180775
|
inputSchema: listNotificationContextsParamsJsonSchema,
|
|
180460
180776
|
handler: createToolHandler(
|
|
180461
180777
|
"list_notification_contexts",
|
|
@@ -180466,7 +180782,7 @@ var notificationTools = [
|
|
|
180466
180782
|
{
|
|
180467
180783
|
name: "pin_notification_context",
|
|
180468
180784
|
description: "Pin or unpin a notification context. Pinned contexts are highlighted in the inbox.",
|
|
180469
|
-
category:
|
|
180785
|
+
category: CATEGORY14,
|
|
180470
180786
|
inputSchema: pinNotificationContextParamsJsonSchema,
|
|
180471
180787
|
handler: createToolHandler(
|
|
180472
180788
|
"pin_notification_context",
|
|
@@ -180477,7 +180793,7 @@ var notificationTools = [
|
|
|
180477
180793
|
{
|
|
180478
180794
|
name: "list_notification_settings",
|
|
180479
180795
|
description: "List notification provider settings. Returns current notification preferences.",
|
|
180480
|
-
category:
|
|
180796
|
+
category: CATEGORY14,
|
|
180481
180797
|
inputSchema: listNotificationSettingsParamsJsonSchema,
|
|
180482
180798
|
handler: createToolHandler(
|
|
180483
180799
|
"list_notification_settings",
|
|
@@ -180488,7 +180804,7 @@ var notificationTools = [
|
|
|
180488
180804
|
{
|
|
180489
180805
|
name: "update_notification_provider_setting",
|
|
180490
180806
|
description: "Update notification provider setting. Enable or disable notifications for a specific provider.",
|
|
180491
|
-
category:
|
|
180807
|
+
category: CATEGORY14,
|
|
180492
180808
|
inputSchema: updateNotificationProviderSettingParamsJsonSchema,
|
|
180493
180809
|
handler: createToolHandler(
|
|
180494
180810
|
"update_notification_provider_setting",
|
|
@@ -180499,7 +180815,7 @@ var notificationTools = [
|
|
|
180499
180815
|
{
|
|
180500
180816
|
name: "get_unread_notification_count",
|
|
180501
180817
|
description: "Get the count of unread notifications.",
|
|
180502
|
-
category:
|
|
180818
|
+
category: CATEGORY14,
|
|
180503
180819
|
inputSchema: emptyParamsJsonSchema,
|
|
180504
180820
|
handler: createToolHandler(
|
|
180505
180821
|
"get_unread_notification_count",
|
|
@@ -180510,7 +180826,7 @@ var notificationTools = [
|
|
|
180510
180826
|
];
|
|
180511
180827
|
|
|
180512
180828
|
// src/huly/operations/projects.ts
|
|
180513
|
-
var
|
|
180829
|
+
var import_core40 = __toESM(require_lib4(), 1);
|
|
180514
180830
|
var import_tracker6 = __toESM(require_lib21(), 1);
|
|
180515
180831
|
var listProjects = (params) => Effect_exports.gen(function* () {
|
|
180516
180832
|
const client = yield* HulyClient;
|
|
@@ -180525,7 +180841,7 @@ var listProjects = (params) => Effect_exports.gen(function* () {
|
|
|
180525
180841
|
{
|
|
180526
180842
|
limit,
|
|
180527
180843
|
sort: {
|
|
180528
|
-
name:
|
|
180844
|
+
name: import_core40.SortingOrder.Ascending
|
|
180529
180845
|
}
|
|
180530
180846
|
}
|
|
180531
180847
|
);
|
|
@@ -180594,7 +180910,7 @@ var createProject = (params) => Effect_exports.gen(function* () {
|
|
|
180594
180910
|
created: false
|
|
180595
180911
|
};
|
|
180596
180912
|
}
|
|
180597
|
-
const projectId = (0,
|
|
180913
|
+
const projectId = (0, import_core40.generateId)();
|
|
180598
180914
|
const projectData = {
|
|
180599
180915
|
name: params.name,
|
|
180600
180916
|
description: params.description ?? "",
|
|
@@ -180656,12 +180972,12 @@ var deleteProject = (params) => Effect_exports.gen(function* () {
|
|
|
180656
180972
|
});
|
|
180657
180973
|
|
|
180658
180974
|
// src/mcp/tools/projects.ts
|
|
180659
|
-
var
|
|
180975
|
+
var CATEGORY15 = "projects";
|
|
180660
180976
|
var projectTools = [
|
|
180661
180977
|
{
|
|
180662
180978
|
name: "list_projects",
|
|
180663
180979
|
description: "List all Huly projects. Returns projects sorted by name. Supports filtering by archived status.",
|
|
180664
|
-
category:
|
|
180980
|
+
category: CATEGORY15,
|
|
180665
180981
|
inputSchema: listProjectsParamsJsonSchema,
|
|
180666
180982
|
handler: createToolHandler(
|
|
180667
180983
|
"list_projects",
|
|
@@ -180672,7 +180988,7 @@ var projectTools = [
|
|
|
180672
180988
|
{
|
|
180673
180989
|
name: "get_project",
|
|
180674
180990
|
description: "Get full details of a Huly project including its statuses. Returns project name, description, archived flag, default status, and all available statuses.",
|
|
180675
|
-
category:
|
|
180991
|
+
category: CATEGORY15,
|
|
180676
180992
|
inputSchema: getProjectParamsJsonSchema,
|
|
180677
180993
|
handler: createToolHandler(
|
|
180678
180994
|
"get_project",
|
|
@@ -180683,7 +180999,7 @@ var projectTools = [
|
|
|
180683
180999
|
{
|
|
180684
181000
|
name: "list_statuses",
|
|
180685
181001
|
description: "List all issue statuses for a Huly project with category info. Returns status name, isDone, isCanceled, and isDefault flags. Use this to discover valid statuses before creating or updating issues.",
|
|
180686
|
-
category:
|
|
181002
|
+
category: CATEGORY15,
|
|
180687
181003
|
inputSchema: listStatusesParamsJsonSchema,
|
|
180688
181004
|
handler: createToolHandler(
|
|
180689
181005
|
"list_statuses",
|
|
@@ -180694,7 +181010,7 @@ var projectTools = [
|
|
|
180694
181010
|
{
|
|
180695
181011
|
name: "create_project",
|
|
180696
181012
|
description: "Create a new Huly tracker project. Idempotent: returns existing project if one with the same identifier already exists (created=false). Identifier must be 1-5 uppercase alphanumeric chars starting with a letter.",
|
|
180697
|
-
category:
|
|
181013
|
+
category: CATEGORY15,
|
|
180698
181014
|
inputSchema: createProjectParamsJsonSchema,
|
|
180699
181015
|
handler: createToolHandler(
|
|
180700
181016
|
"create_project",
|
|
@@ -180705,7 +181021,7 @@ var projectTools = [
|
|
|
180705
181021
|
{
|
|
180706
181022
|
name: "update_project",
|
|
180707
181023
|
description: "Update a Huly project. Only provided fields are modified. Set description to null to clear it.",
|
|
180708
|
-
category:
|
|
181024
|
+
category: CATEGORY15,
|
|
180709
181025
|
inputSchema: updateProjectParamsJsonSchema,
|
|
180710
181026
|
handler: createToolHandler(
|
|
180711
181027
|
"update_project",
|
|
@@ -180716,7 +181032,7 @@ var projectTools = [
|
|
|
180716
181032
|
{
|
|
180717
181033
|
name: "delete_project",
|
|
180718
181034
|
description: "Permanently delete a Huly project. All issues, milestones, and components in this project will be orphaned. This action cannot be undone.",
|
|
180719
|
-
category:
|
|
181035
|
+
category: CATEGORY15,
|
|
180720
181036
|
inputSchema: deleteProjectParamsJsonSchema,
|
|
180721
181037
|
handler: createToolHandler(
|
|
180722
181038
|
"delete_project",
|
|
@@ -180759,12 +181075,12 @@ var fulltextSearch = (params) => Effect_exports.gen(function* () {
|
|
|
180759
181075
|
});
|
|
180760
181076
|
|
|
180761
181077
|
// src/mcp/tools/search.ts
|
|
180762
|
-
var
|
|
181078
|
+
var CATEGORY16 = "search";
|
|
180763
181079
|
var searchTools = [
|
|
180764
181080
|
{
|
|
180765
181081
|
name: "fulltext_search",
|
|
180766
181082
|
description: "Perform a global fulltext search across all Huly content. Searches issues, documents, messages, and other indexed content. Returns matching items sorted by relevance (newest first).",
|
|
180767
|
-
category:
|
|
181083
|
+
category: CATEGORY16,
|
|
180768
181084
|
inputSchema: fulltextSearchParamsJsonSchema,
|
|
180769
181085
|
handler: createToolHandler(
|
|
180770
181086
|
"fulltext_search",
|
|
@@ -180787,12 +181103,12 @@ var uploadFile = (params) => Effect_exports.gen(function* () {
|
|
|
180787
181103
|
});
|
|
180788
181104
|
|
|
180789
181105
|
// src/mcp/tools/storage.ts
|
|
180790
|
-
var
|
|
181106
|
+
var CATEGORY17 = "storage";
|
|
180791
181107
|
var storageTools = [
|
|
180792
181108
|
{
|
|
180793
181109
|
name: "upload_file",
|
|
180794
181110
|
description: "Upload a file to Huly storage. Provide ONE of: filePath (local file - preferred), fileUrl (fetch from URL), or data (base64 - for small files only). Returns blob ID and URL for referencing the file.",
|
|
180795
|
-
category:
|
|
181111
|
+
category: CATEGORY17,
|
|
180796
181112
|
inputSchema: uploadFileParamsJsonSchema,
|
|
180797
181113
|
handler: createStorageToolHandler(
|
|
180798
181114
|
"upload_file",
|
|
@@ -180803,12 +181119,12 @@ var storageTools = [
|
|
|
180803
181119
|
];
|
|
180804
181120
|
|
|
180805
181121
|
// src/mcp/tools/tag-categories.ts
|
|
180806
|
-
var
|
|
181122
|
+
var CATEGORY18 = "tag-categories";
|
|
180807
181123
|
var tagCategoryTools = [
|
|
180808
181124
|
{
|
|
180809
181125
|
name: "list_tag_categories",
|
|
180810
181126
|
description: "List tag/label categories in the workspace. Categories group labels (e.g., 'Priority Labels', 'Type Labels'). Optional targetClass filter (defaults to all).",
|
|
180811
|
-
category:
|
|
181127
|
+
category: CATEGORY18,
|
|
180812
181128
|
inputSchema: listTagCategoriesParamsJsonSchema,
|
|
180813
181129
|
handler: createToolHandler(
|
|
180814
181130
|
"list_tag_categories",
|
|
@@ -180819,7 +181135,7 @@ var tagCategoryTools = [
|
|
|
180819
181135
|
{
|
|
180820
181136
|
name: "create_tag_category",
|
|
180821
181137
|
description: "Create a new tag/label category. Idempotent: returns existing category if one with the same label and targetClass already exists (created=false). Defaults targetClass to tracker issues.",
|
|
180822
|
-
category:
|
|
181138
|
+
category: CATEGORY18,
|
|
180823
181139
|
inputSchema: createTagCategoryParamsJsonSchema,
|
|
180824
181140
|
handler: createToolHandler(
|
|
180825
181141
|
"create_tag_category",
|
|
@@ -180830,7 +181146,7 @@ var tagCategoryTools = [
|
|
|
180830
181146
|
{
|
|
180831
181147
|
name: "update_tag_category",
|
|
180832
181148
|
description: "Update a tag/label category. Accepts category ID or label name. Only provided fields are modified.",
|
|
180833
|
-
category:
|
|
181149
|
+
category: CATEGORY18,
|
|
180834
181150
|
inputSchema: updateTagCategoryParamsJsonSchema,
|
|
180835
181151
|
handler: createToolHandler(
|
|
180836
181152
|
"update_tag_category",
|
|
@@ -180841,7 +181157,7 @@ var tagCategoryTools = [
|
|
|
180841
181157
|
{
|
|
180842
181158
|
name: "delete_tag_category",
|
|
180843
181159
|
description: "Permanently delete a tag/label category. Accepts category ID or label name. Labels in this category will be orphaned (not deleted). This action cannot be undone.",
|
|
180844
|
-
category:
|
|
181160
|
+
category: CATEGORY18,
|
|
180845
181161
|
inputSchema: deleteTagCategoryParamsJsonSchema,
|
|
180846
181162
|
handler: createToolHandler(
|
|
180847
181163
|
"delete_tag_category",
|
|
@@ -180852,7 +181168,7 @@ var tagCategoryTools = [
|
|
|
180852
181168
|
];
|
|
180853
181169
|
|
|
180854
181170
|
// src/huly/operations/test-management-core.ts
|
|
180855
|
-
var
|
|
181171
|
+
var import_core41 = __toESM(require_lib4(), 1);
|
|
180856
181172
|
|
|
180857
181173
|
// src/huly/test-management-classes.ts
|
|
180858
181174
|
var testManagement = {
|
|
@@ -181060,7 +181376,7 @@ var listTestProjects = (params) => Effect_exports.gen(function* () {
|
|
|
181060
181376
|
{},
|
|
181061
181377
|
{
|
|
181062
181378
|
limit,
|
|
181063
|
-
sort: { name:
|
|
181379
|
+
sort: { name: import_core41.SortingOrder.Ascending }
|
|
181064
181380
|
}
|
|
181065
181381
|
);
|
|
181066
181382
|
return {
|
|
@@ -181082,7 +181398,7 @@ var listTestSuites = (params) => Effect_exports.gen(function* () {
|
|
|
181082
181398
|
query,
|
|
181083
181399
|
{
|
|
181084
181400
|
limit,
|
|
181085
|
-
sort: { modifiedOn:
|
|
181401
|
+
sort: { modifiedOn: import_core41.SortingOrder.Descending }
|
|
181086
181402
|
}
|
|
181087
181403
|
);
|
|
181088
181404
|
return {
|
|
@@ -181115,7 +181431,7 @@ var createTestSuite = (params) => Effect_exports.gen(function* () {
|
|
|
181115
181431
|
if (existing !== void 0) {
|
|
181116
181432
|
return { id: TestSuiteId.make(existing._id), name: existing.name, created: false };
|
|
181117
181433
|
}
|
|
181118
|
-
const suiteId = (0,
|
|
181434
|
+
const suiteId = (0, import_core41.generateId)();
|
|
181119
181435
|
const suiteData = {
|
|
181120
181436
|
name: params.name,
|
|
181121
181437
|
description: params.description ?? "",
|
|
@@ -181185,7 +181501,7 @@ var listTestCases = (params) => Effect_exports.gen(function* () {
|
|
|
181185
181501
|
query,
|
|
181186
181502
|
{
|
|
181187
181503
|
limit,
|
|
181188
|
-
sort: { modifiedOn:
|
|
181504
|
+
sort: { modifiedOn: import_core41.SortingOrder.Descending }
|
|
181189
181505
|
}
|
|
181190
181506
|
);
|
|
181191
181507
|
return {
|
|
@@ -181213,7 +181529,7 @@ var createTestCase = (params) => Effect_exports.gen(function* () {
|
|
|
181213
181529
|
const client = yield* HulyClient;
|
|
181214
181530
|
const project3 = yield* findTestProject(client, params.project);
|
|
181215
181531
|
const suite = yield* findTestSuite(client, project3, params.suite);
|
|
181216
|
-
const caseId = (0,
|
|
181532
|
+
const caseId = (0, import_core41.generateId)();
|
|
181217
181533
|
const assigneeRef = params.assignee !== void 0 ? toRef((yield* resolveAssignee2(params.assignee))._id) : null;
|
|
181218
181534
|
const typeEnum = params.type !== void 0 ? stringToTestCaseType(params.type) ?? 0 /* Functional */ : 0 /* Functional */;
|
|
181219
181535
|
const priorityEnum = params.priority !== void 0 ? stringToTestCasePriority(params.priority) ?? 1 /* Medium */ : 1 /* Medium */;
|
|
@@ -181317,12 +181633,12 @@ var deleteTestCase = (params) => Effect_exports.gen(function* () {
|
|
|
181317
181633
|
});
|
|
181318
181634
|
|
|
181319
181635
|
// src/mcp/tools/test-management-core.ts
|
|
181320
|
-
var
|
|
181636
|
+
var CATEGORY19 = "test-management";
|
|
181321
181637
|
var testManagementCoreTools = [
|
|
181322
181638
|
{
|
|
181323
181639
|
name: "list_test_projects",
|
|
181324
181640
|
description: "List test management projects. Returns test projects sorted by name. These are separate from tracker projects.",
|
|
181325
|
-
category:
|
|
181641
|
+
category: CATEGORY19,
|
|
181326
181642
|
inputSchema: listTestProjectsParamsJsonSchema,
|
|
181327
181643
|
handler: createToolHandler(
|
|
181328
181644
|
"list_test_projects",
|
|
@@ -181333,7 +181649,7 @@ var testManagementCoreTools = [
|
|
|
181333
181649
|
{
|
|
181334
181650
|
name: "list_test_suites",
|
|
181335
181651
|
description: "List test suites in a test project. Accepts project ID or name. Optional parent filter for nested suites.",
|
|
181336
|
-
category:
|
|
181652
|
+
category: CATEGORY19,
|
|
181337
181653
|
inputSchema: listTestSuitesParamsJsonSchema,
|
|
181338
181654
|
handler: createToolHandler(
|
|
181339
181655
|
"list_test_suites",
|
|
@@ -181344,7 +181660,7 @@ var testManagementCoreTools = [
|
|
|
181344
181660
|
{
|
|
181345
181661
|
name: "get_test_suite",
|
|
181346
181662
|
description: "Get a single test suite by ID or name within a test project. Returns suite details and test case count.",
|
|
181347
|
-
category:
|
|
181663
|
+
category: CATEGORY19,
|
|
181348
181664
|
inputSchema: getTestSuiteParamsJsonSchema,
|
|
181349
181665
|
handler: createToolHandler(
|
|
181350
181666
|
"get_test_suite",
|
|
@@ -181355,7 +181671,7 @@ var testManagementCoreTools = [
|
|
|
181355
181671
|
{
|
|
181356
181672
|
name: "create_test_suite",
|
|
181357
181673
|
description: "Create a test suite in a test project. Idempotent: returns existing suite if one with the same name exists (created=false). Optional parent for nesting.",
|
|
181358
|
-
category:
|
|
181674
|
+
category: CATEGORY19,
|
|
181359
181675
|
inputSchema: createTestSuiteParamsJsonSchema,
|
|
181360
181676
|
handler: createToolHandler(
|
|
181361
181677
|
"create_test_suite",
|
|
@@ -181366,7 +181682,7 @@ var testManagementCoreTools = [
|
|
|
181366
181682
|
{
|
|
181367
181683
|
name: "update_test_suite",
|
|
181368
181684
|
description: "Update a test suite. Accepts suite ID or name. Only provided fields are modified.",
|
|
181369
|
-
category:
|
|
181685
|
+
category: CATEGORY19,
|
|
181370
181686
|
inputSchema: updateTestSuiteParamsJsonSchema,
|
|
181371
181687
|
handler: createToolHandler(
|
|
181372
181688
|
"update_test_suite",
|
|
@@ -181377,7 +181693,7 @@ var testManagementCoreTools = [
|
|
|
181377
181693
|
{
|
|
181378
181694
|
name: "delete_test_suite",
|
|
181379
181695
|
description: "Permanently delete a test suite. Accepts suite ID or name. This action cannot be undone.",
|
|
181380
|
-
category:
|
|
181696
|
+
category: CATEGORY19,
|
|
181381
181697
|
inputSchema: deleteTestSuiteParamsJsonSchema,
|
|
181382
181698
|
handler: createToolHandler(
|
|
181383
181699
|
"delete_test_suite",
|
|
@@ -181388,7 +181704,7 @@ var testManagementCoreTools = [
|
|
|
181388
181704
|
{
|
|
181389
181705
|
name: "list_test_cases",
|
|
181390
181706
|
description: "List test cases in a test project. Optional filters: suite (ID or name), assignee (name or email).",
|
|
181391
|
-
category:
|
|
181707
|
+
category: CATEGORY19,
|
|
181392
181708
|
inputSchema: listTestCasesParamsJsonSchema,
|
|
181393
181709
|
handler: createToolHandler(
|
|
181394
181710
|
"list_test_cases",
|
|
@@ -181399,7 +181715,7 @@ var testManagementCoreTools = [
|
|
|
181399
181715
|
{
|
|
181400
181716
|
name: "get_test_case",
|
|
181401
181717
|
description: "Get a single test case by ID or name within a test project.",
|
|
181402
|
-
category:
|
|
181718
|
+
category: CATEGORY19,
|
|
181403
181719
|
inputSchema: getTestCaseParamsJsonSchema,
|
|
181404
181720
|
handler: createToolHandler(
|
|
181405
181721
|
"get_test_case",
|
|
@@ -181410,7 +181726,7 @@ var testManagementCoreTools = [
|
|
|
181410
181726
|
{
|
|
181411
181727
|
name: "create_test_case",
|
|
181412
181728
|
description: "Create a test case attached to a suite. Requires project and suite. Defaults: type=functional, priority=medium, status=draft.",
|
|
181413
|
-
category:
|
|
181729
|
+
category: CATEGORY19,
|
|
181414
181730
|
inputSchema: createTestCaseParamsJsonSchema,
|
|
181415
181731
|
handler: createToolHandler(
|
|
181416
181732
|
"create_test_case",
|
|
@@ -181421,7 +181737,7 @@ var testManagementCoreTools = [
|
|
|
181421
181737
|
{
|
|
181422
181738
|
name: "update_test_case",
|
|
181423
181739
|
description: "Update a test case. Accepts test case ID or name. Only provided fields are modified. Set assignee to null to unassign.",
|
|
181424
|
-
category:
|
|
181740
|
+
category: CATEGORY19,
|
|
181425
181741
|
inputSchema: updateTestCaseParamsJsonSchema,
|
|
181426
181742
|
handler: createToolHandler(
|
|
181427
181743
|
"update_test_case",
|
|
@@ -181432,7 +181748,7 @@ var testManagementCoreTools = [
|
|
|
181432
181748
|
{
|
|
181433
181749
|
name: "delete_test_case",
|
|
181434
181750
|
description: "Permanently delete a test case. Accepts test case ID or name. This action cannot be undone.",
|
|
181435
|
-
category:
|
|
181751
|
+
category: CATEGORY19,
|
|
181436
181752
|
inputSchema: deleteTestCaseParamsJsonSchema,
|
|
181437
181753
|
handler: createToolHandler(
|
|
181438
181754
|
"delete_test_case",
|
|
@@ -181443,7 +181759,7 @@ var testManagementCoreTools = [
|
|
|
181443
181759
|
];
|
|
181444
181760
|
|
|
181445
181761
|
// src/huly/operations/test-management-plans.ts
|
|
181446
|
-
var
|
|
181762
|
+
var import_core42 = __toESM(require_lib4(), 1);
|
|
181447
181763
|
var toPlanSummary = (p) => ({
|
|
181448
181764
|
id: TestPlanId.make(p._id),
|
|
181449
181765
|
name: p.name
|
|
@@ -181461,7 +181777,7 @@ var listTestPlans = (params) => Effect_exports.gen(function* () {
|
|
|
181461
181777
|
const plans = yield* client.findAll(
|
|
181462
181778
|
testManagement.class.TestPlan,
|
|
181463
181779
|
{ space: project3._id },
|
|
181464
|
-
{ limit, sort: { modifiedOn:
|
|
181780
|
+
{ limit, sort: { modifiedOn: import_core42.SortingOrder.Descending } }
|
|
181465
181781
|
);
|
|
181466
181782
|
return { plans: plans.map(toPlanSummary), total: plans.total };
|
|
181467
181783
|
});
|
|
@@ -181496,7 +181812,7 @@ var createTestPlan = (params) => Effect_exports.gen(function* () {
|
|
|
181496
181812
|
if (existing !== void 0) {
|
|
181497
181813
|
return { id: TestPlanId.make(existing._id), name: existing.name, created: false };
|
|
181498
181814
|
}
|
|
181499
|
-
const planId = (0,
|
|
181815
|
+
const planId = (0, import_core42.generateId)();
|
|
181500
181816
|
const descRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
|
|
181501
181817
|
testManagement.class.TestPlan,
|
|
181502
181818
|
planId,
|
|
@@ -181578,7 +181894,7 @@ var removeTestPlanItem = (params) => Effect_exports.gen(function* () {
|
|
|
181578
181894
|
});
|
|
181579
181895
|
|
|
181580
181896
|
// src/huly/operations/test-management-runs.ts
|
|
181581
|
-
var
|
|
181897
|
+
var import_core43 = __toESM(require_lib4(), 1);
|
|
181582
181898
|
var BATCH_CONCURRENCY = 10;
|
|
181583
181899
|
var toRunSummary = (r) => ({
|
|
181584
181900
|
id: TestRunId.make(r._id),
|
|
@@ -181599,7 +181915,7 @@ var listTestRuns = (params) => Effect_exports.gen(function* () {
|
|
|
181599
181915
|
const runs = yield* client.findAll(
|
|
181600
181916
|
testManagement.class.TestRun,
|
|
181601
181917
|
{ space: project3._id },
|
|
181602
|
-
{ limit, sort: { modifiedOn:
|
|
181918
|
+
{ limit, sort: { modifiedOn: import_core43.SortingOrder.Descending } }
|
|
181603
181919
|
);
|
|
181604
181920
|
return { runs: runs.map(toRunSummary), total: runs.total };
|
|
181605
181921
|
});
|
|
@@ -181628,7 +181944,7 @@ var getTestRun = (params) => Effect_exports.gen(function* () {
|
|
|
181628
181944
|
var createTestRun = (params) => Effect_exports.gen(function* () {
|
|
181629
181945
|
const client = yield* HulyClient;
|
|
181630
181946
|
const project3 = yield* findTestProject(client, params.project);
|
|
181631
|
-
const runId = (0,
|
|
181947
|
+
const runId = (0, import_core43.generateId)();
|
|
181632
181948
|
const descRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
|
|
181633
181949
|
testManagement.class.TestRun,
|
|
181634
181950
|
runId,
|
|
@@ -181685,7 +182001,7 @@ var listTestResults = (params) => Effect_exports.gen(function* () {
|
|
|
181685
182001
|
const results = yield* client.findAll(
|
|
181686
182002
|
testManagement.class.TestResult,
|
|
181687
182003
|
{ attachedTo: run3._id },
|
|
181688
|
-
{ limit, sort: { modifiedOn:
|
|
182004
|
+
{ limit, sort: { modifiedOn: import_core43.SortingOrder.Descending } }
|
|
181689
182005
|
);
|
|
181690
182006
|
return { results: results.map(toResultSummary), total: results.total };
|
|
181691
182007
|
});
|
|
@@ -181786,7 +182102,7 @@ var runTestPlan = (params) => Effect_exports.gen(function* () {
|
|
|
181786
182102
|
}
|
|
181787
182103
|
return { item, tc };
|
|
181788
182104
|
}), { concurrency: BATCH_CONCURRENCY });
|
|
181789
|
-
const runId = (0,
|
|
182105
|
+
const runId = (0, import_core43.generateId)();
|
|
181790
182106
|
const runName = params.runName ?? `${plan.name} - Run`;
|
|
181791
182107
|
yield* client.createDoc(testManagement.class.TestRun, project3._id, {
|
|
181792
182108
|
name: runName,
|
|
@@ -181816,41 +182132,41 @@ var runTestPlan = (params) => Effect_exports.gen(function* () {
|
|
|
181816
182132
|
});
|
|
181817
182133
|
|
|
181818
182134
|
// src/mcp/tools/test-management-plans.ts
|
|
181819
|
-
var
|
|
182135
|
+
var CATEGORY20 = "test-management";
|
|
181820
182136
|
var testManagementPlansTools = [
|
|
181821
182137
|
// --- Test Plans ---
|
|
181822
182138
|
{
|
|
181823
182139
|
name: "list_test_plans",
|
|
181824
182140
|
description: "List test plans in a test management project. Returns plan names and IDs. Requires project ID or name.",
|
|
181825
|
-
category:
|
|
182141
|
+
category: CATEGORY20,
|
|
181826
182142
|
inputSchema: listTestPlansParamsJsonSchema,
|
|
181827
182143
|
handler: createToolHandler("list_test_plans", parseListTestPlansParams, listTestPlans)
|
|
181828
182144
|
},
|
|
181829
182145
|
{
|
|
181830
182146
|
name: "get_test_plan",
|
|
181831
182147
|
description: "Get test plan details including its items (test cases). Accepts plan ID or name within a project.",
|
|
181832
|
-
category:
|
|
182148
|
+
category: CATEGORY20,
|
|
181833
182149
|
inputSchema: getTestPlanParamsJsonSchema,
|
|
181834
182150
|
handler: createToolHandler("get_test_plan", parseGetTestPlanParams, getTestPlan)
|
|
181835
182151
|
},
|
|
181836
182152
|
{
|
|
181837
182153
|
name: "create_test_plan",
|
|
181838
182154
|
description: "Create a test plan in a project. Idempotent: returns existing plan if one with the same name exists (created=false).",
|
|
181839
|
-
category:
|
|
182155
|
+
category: CATEGORY20,
|
|
181840
182156
|
inputSchema: createTestPlanParamsJsonSchema,
|
|
181841
182157
|
handler: createToolHandler("create_test_plan", parseCreateTestPlanParams, createTestPlan)
|
|
181842
182158
|
},
|
|
181843
182159
|
{
|
|
181844
182160
|
name: "update_test_plan",
|
|
181845
182161
|
description: "Update a test plan's name or description. Only provided fields are modified. Pass description=null to clear.",
|
|
181846
|
-
category:
|
|
182162
|
+
category: CATEGORY20,
|
|
181847
182163
|
inputSchema: updateTestPlanParamsJsonSchema,
|
|
181848
182164
|
handler: createToolHandler("update_test_plan", parseUpdateTestPlanParams, updateTestPlan)
|
|
181849
182165
|
},
|
|
181850
182166
|
{
|
|
181851
182167
|
name: "delete_test_plan",
|
|
181852
182168
|
description: "Permanently delete a test plan. This does not delete associated test runs. Cannot be undone.",
|
|
181853
|
-
category:
|
|
182169
|
+
category: CATEGORY20,
|
|
181854
182170
|
inputSchema: deleteTestPlanParamsJsonSchema,
|
|
181855
182171
|
handler: createToolHandler("delete_test_plan", parseDeleteTestPlanParams, deleteTestPlan)
|
|
181856
182172
|
},
|
|
@@ -181858,14 +182174,14 @@ var testManagementPlansTools = [
|
|
|
181858
182174
|
{
|
|
181859
182175
|
name: "add_test_plan_item",
|
|
181860
182176
|
description: "Add a test case to a test plan. Resolves test case by ID or name. Optionally assign a person by email or name.",
|
|
181861
|
-
category:
|
|
182177
|
+
category: CATEGORY20,
|
|
181862
182178
|
inputSchema: addTestPlanItemParamsJsonSchema,
|
|
181863
182179
|
handler: createToolHandler("add_test_plan_item", parseAddTestPlanItemParams, addTestPlanItem)
|
|
181864
182180
|
},
|
|
181865
182181
|
{
|
|
181866
182182
|
name: "remove_test_plan_item",
|
|
181867
182183
|
description: "Remove a test case from a test plan by item ID. Get item IDs from get_test_plan.",
|
|
181868
|
-
category:
|
|
182184
|
+
category: CATEGORY20,
|
|
181869
182185
|
inputSchema: removeTestPlanItemParamsJsonSchema,
|
|
181870
182186
|
handler: createToolHandler("remove_test_plan_item", parseRemoveTestPlanItemParams, removeTestPlanItem)
|
|
181871
182187
|
},
|
|
@@ -181873,35 +182189,35 @@ var testManagementPlansTools = [
|
|
|
181873
182189
|
{
|
|
181874
182190
|
name: "list_test_runs",
|
|
181875
182191
|
description: "List test runs in a test management project. Returns run names, IDs, and due dates.",
|
|
181876
|
-
category:
|
|
182192
|
+
category: CATEGORY20,
|
|
181877
182193
|
inputSchema: listTestRunsParamsJsonSchema,
|
|
181878
182194
|
handler: createToolHandler("list_test_runs", parseListTestRunsParams, listTestRuns)
|
|
181879
182195
|
},
|
|
181880
182196
|
{
|
|
181881
182197
|
name: "get_test_run",
|
|
181882
182198
|
description: "Get test run details including all results. Accepts run ID or name within a project.",
|
|
181883
|
-
category:
|
|
182199
|
+
category: CATEGORY20,
|
|
181884
182200
|
inputSchema: getTestRunParamsJsonSchema,
|
|
181885
182201
|
handler: createToolHandler("get_test_run", parseGetTestRunParams, getTestRun)
|
|
181886
182202
|
},
|
|
181887
182203
|
{
|
|
181888
182204
|
name: "create_test_run",
|
|
181889
182205
|
description: "Create a test run in a project. For bulk creation from a plan, use run_test_plan instead.",
|
|
181890
|
-
category:
|
|
182206
|
+
category: CATEGORY20,
|
|
181891
182207
|
inputSchema: createTestRunParamsJsonSchema,
|
|
181892
182208
|
handler: createToolHandler("create_test_run", parseCreateTestRunParams, createTestRun)
|
|
181893
182209
|
},
|
|
181894
182210
|
{
|
|
181895
182211
|
name: "update_test_run",
|
|
181896
182212
|
description: "Update a test run's name, description, or due date. Only provided fields are modified. Pass null to clear optional fields.",
|
|
181897
|
-
category:
|
|
182213
|
+
category: CATEGORY20,
|
|
181898
182214
|
inputSchema: updateTestRunParamsJsonSchema,
|
|
181899
182215
|
handler: createToolHandler("update_test_run", parseUpdateTestRunParams, updateTestRun)
|
|
181900
182216
|
},
|
|
181901
182217
|
{
|
|
181902
182218
|
name: "delete_test_run",
|
|
181903
182219
|
description: "Permanently delete a test run. This does not delete associated test results. Cannot be undone.",
|
|
181904
|
-
category:
|
|
182220
|
+
category: CATEGORY20,
|
|
181905
182221
|
inputSchema: deleteTestRunParamsJsonSchema,
|
|
181906
182222
|
handler: createToolHandler("delete_test_run", parseDeleteTestRunParams, deleteTestRun)
|
|
181907
182223
|
},
|
|
@@ -181909,35 +182225,35 @@ var testManagementPlansTools = [
|
|
|
181909
182225
|
{
|
|
181910
182226
|
name: "list_test_results",
|
|
181911
182227
|
description: "List test results in a test run. Returns result names, statuses, and assignees.",
|
|
181912
|
-
category:
|
|
182228
|
+
category: CATEGORY20,
|
|
181913
182229
|
inputSchema: listTestResultsParamsJsonSchema,
|
|
181914
182230
|
handler: createToolHandler("list_test_results", parseListTestResultsParams, listTestResults)
|
|
181915
182231
|
},
|
|
181916
182232
|
{
|
|
181917
182233
|
name: "get_test_result",
|
|
181918
182234
|
description: "Get test result details. Accepts result ID or name.",
|
|
181919
|
-
category:
|
|
182235
|
+
category: CATEGORY20,
|
|
181920
182236
|
inputSchema: getTestResultParamsJsonSchema,
|
|
181921
182237
|
handler: createToolHandler("get_test_result", parseGetTestResultParams, getTestResult)
|
|
181922
182238
|
},
|
|
181923
182239
|
{
|
|
181924
182240
|
name: "create_test_result",
|
|
181925
182241
|
description: "Create a test result in a run. Resolves test case by ID or name. Status defaults to 'untested'.",
|
|
181926
|
-
category:
|
|
182242
|
+
category: CATEGORY20,
|
|
181927
182243
|
inputSchema: createTestResultParamsJsonSchema,
|
|
181928
182244
|
handler: createToolHandler("create_test_result", parseCreateTestResultParams, createTestResult)
|
|
181929
182245
|
},
|
|
181930
182246
|
{
|
|
181931
182247
|
name: "update_test_result",
|
|
181932
182248
|
description: "Update a test result's status, assignee, or description. Status values: untested, blocked, passed, failed.",
|
|
181933
|
-
category:
|
|
182249
|
+
category: CATEGORY20,
|
|
181934
182250
|
inputSchema: updateTestResultParamsJsonSchema,
|
|
181935
182251
|
handler: createToolHandler("update_test_result", parseUpdateTestResultParams, updateTestResult)
|
|
181936
182252
|
},
|
|
181937
182253
|
{
|
|
181938
182254
|
name: "delete_test_result",
|
|
181939
182255
|
description: "Permanently delete a test result. Cannot be undone.",
|
|
181940
|
-
category:
|
|
182256
|
+
category: CATEGORY20,
|
|
181941
182257
|
inputSchema: deleteTestResultParamsJsonSchema,
|
|
181942
182258
|
handler: createToolHandler("delete_test_result", parseDeleteTestResultParams, deleteTestResult)
|
|
181943
182259
|
},
|
|
@@ -181945,7 +182261,7 @@ var testManagementPlansTools = [
|
|
|
181945
182261
|
{
|
|
181946
182262
|
name: "run_test_plan",
|
|
181947
182263
|
description: "Execute a test plan: creates a test run and one test result per plan item. Returns the run ID and count of results created. Optionally name the run and set a due date.",
|
|
181948
|
-
category:
|
|
182264
|
+
category: CATEGORY20,
|
|
181949
182265
|
inputSchema: runTestPlanParamsJsonSchema,
|
|
181950
182266
|
annotations: {
|
|
181951
182267
|
title: "Run Test Plan",
|
|
@@ -181960,7 +182276,7 @@ var testManagementPlansTools = [
|
|
|
181960
182276
|
|
|
181961
182277
|
// src/huly/operations/time.ts
|
|
181962
182278
|
var import_calendar6 = __toESM(require_lib24(), 1);
|
|
181963
|
-
var
|
|
182279
|
+
var import_core44 = __toESM(require_lib4(), 1);
|
|
181964
182280
|
var import_tracker7 = __toESM(require_lib21(), 1);
|
|
181965
182281
|
var serverPopulatedCalendar = toRef("");
|
|
181966
182282
|
var serverPopulatedPersonId = "";
|
|
@@ -181970,7 +182286,7 @@ var logTime = (params) => Effect_exports.gen(function* () {
|
|
|
181970
182286
|
project: params.project,
|
|
181971
182287
|
identifier: params.identifier
|
|
181972
182288
|
});
|
|
181973
|
-
const reportId = (0,
|
|
182289
|
+
const reportId = (0, import_core44.generateId)();
|
|
181974
182290
|
const now2 = yield* Clock_exports.currentTimeMillis;
|
|
181975
182291
|
const reportData = {
|
|
181976
182292
|
employee: null,
|
|
@@ -182010,7 +182326,7 @@ var getTimeReport = (params) => Effect_exports.gen(function* () {
|
|
|
182010
182326
|
const reports = yield* client.findAll(
|
|
182011
182327
|
tracker.class.TimeSpendReport,
|
|
182012
182328
|
{ attachedTo: issue2._id },
|
|
182013
|
-
{ sort: { date:
|
|
182329
|
+
{ sort: { date: import_core44.SortingOrder.Descending } }
|
|
182014
182330
|
);
|
|
182015
182331
|
const employeeIds = [
|
|
182016
182332
|
...new Set(
|
|
@@ -182062,7 +182378,7 @@ var listTimeSpendReports = (params) => Effect_exports.gen(function* () {
|
|
|
182062
182378
|
tracker.class.TimeSpendReport,
|
|
182063
182379
|
query,
|
|
182064
182380
|
withLookup(
|
|
182065
|
-
{ limit, sort: { date:
|
|
182381
|
+
{ limit, sort: { date: import_core44.SortingOrder.Descending } },
|
|
182066
182382
|
{
|
|
182067
182383
|
attachedTo: tracker.class.Issue,
|
|
182068
182384
|
employee: contact.class.Person
|
|
@@ -182091,7 +182407,7 @@ var getDetailedTimeReport = (params) => Effect_exports.gen(function* () {
|
|
|
182091
182407
|
tracker.class.TimeSpendReport,
|
|
182092
182408
|
query,
|
|
182093
182409
|
withLookup(
|
|
182094
|
-
{ sort: { date:
|
|
182410
|
+
{ sort: { date: import_core44.SortingOrder.Descending } },
|
|
182095
182411
|
{
|
|
182096
182412
|
attachedTo: tracker.class.Issue,
|
|
182097
182413
|
employee: contact.class.Person
|
|
@@ -182167,7 +182483,7 @@ var listWorkSlots = (params) => Effect_exports.gen(function* () {
|
|
|
182167
182483
|
const slots = yield* client.findAll(
|
|
182168
182484
|
time.class.WorkSlot,
|
|
182169
182485
|
query,
|
|
182170
|
-
{ limit, sort: { date:
|
|
182486
|
+
{ limit, sort: { date: import_core44.SortingOrder.Descending } }
|
|
182171
182487
|
);
|
|
182172
182488
|
return slots.map((s) => ({
|
|
182173
182489
|
id: s._id,
|
|
@@ -182179,7 +182495,7 @@ var listWorkSlots = (params) => Effect_exports.gen(function* () {
|
|
|
182179
182495
|
});
|
|
182180
182496
|
var createWorkSlot = (params) => Effect_exports.gen(function* () {
|
|
182181
182497
|
const client = yield* HulyClient;
|
|
182182
|
-
const slotId = (0,
|
|
182498
|
+
const slotId = (0, import_core44.generateId)();
|
|
182183
182499
|
const slotData = {
|
|
182184
182500
|
date: params.date,
|
|
182185
182501
|
dueDate: params.dueDate,
|
|
@@ -182230,12 +182546,12 @@ var stopTimer = (params) => Effect_exports.gen(function* () {
|
|
|
182230
182546
|
});
|
|
182231
182547
|
|
|
182232
182548
|
// src/mcp/tools/time.ts
|
|
182233
|
-
var
|
|
182549
|
+
var CATEGORY21 = "time tracking";
|
|
182234
182550
|
var timeTools = [
|
|
182235
182551
|
{
|
|
182236
182552
|
name: "log_time",
|
|
182237
182553
|
description: "Log time spent on a Huly issue. Records a time entry with optional description. Time value is in minutes.",
|
|
182238
|
-
category:
|
|
182554
|
+
category: CATEGORY21,
|
|
182239
182555
|
inputSchema: logTimeParamsJsonSchema,
|
|
182240
182556
|
handler: createToolHandler(
|
|
182241
182557
|
"log_time",
|
|
@@ -182246,7 +182562,7 @@ var timeTools = [
|
|
|
182246
182562
|
{
|
|
182247
182563
|
name: "get_time_report",
|
|
182248
182564
|
description: "Get time tracking report for a specific Huly issue. Shows total time, estimation, remaining time, and all time entries.",
|
|
182249
|
-
category:
|
|
182565
|
+
category: CATEGORY21,
|
|
182250
182566
|
inputSchema: getTimeReportParamsJsonSchema,
|
|
182251
182567
|
handler: createToolHandler(
|
|
182252
182568
|
"get_time_report",
|
|
@@ -182257,7 +182573,7 @@ var timeTools = [
|
|
|
182257
182573
|
{
|
|
182258
182574
|
name: "list_time_spend_reports",
|
|
182259
182575
|
description: "List all time entries across issues. Supports filtering by project and date range. Returns entries sorted by date (newest first).",
|
|
182260
|
-
category:
|
|
182576
|
+
category: CATEGORY21,
|
|
182261
182577
|
inputSchema: listTimeSpendReportsParamsJsonSchema,
|
|
182262
182578
|
handler: createToolHandler(
|
|
182263
182579
|
"list_time_spend_reports",
|
|
@@ -182268,7 +182584,7 @@ var timeTools = [
|
|
|
182268
182584
|
{
|
|
182269
182585
|
name: "get_detailed_time_report",
|
|
182270
182586
|
description: "Get detailed time breakdown for a project. Shows total time grouped by issue and by employee. Supports date range filtering.",
|
|
182271
|
-
category:
|
|
182587
|
+
category: CATEGORY21,
|
|
182272
182588
|
inputSchema: getDetailedTimeReportParamsJsonSchema,
|
|
182273
182589
|
handler: createToolHandler(
|
|
182274
182590
|
"get_detailed_time_report",
|
|
@@ -182279,7 +182595,7 @@ var timeTools = [
|
|
|
182279
182595
|
{
|
|
182280
182596
|
name: "list_work_slots",
|
|
182281
182597
|
description: "List scheduled work slots. Shows planned time blocks attached to ToDos. Supports filtering by employee and date range.",
|
|
182282
|
-
category:
|
|
182598
|
+
category: CATEGORY21,
|
|
182283
182599
|
inputSchema: listWorkSlotsParamsJsonSchema,
|
|
182284
182600
|
handler: createToolHandler(
|
|
182285
182601
|
"list_work_slots",
|
|
@@ -182290,7 +182606,7 @@ var timeTools = [
|
|
|
182290
182606
|
{
|
|
182291
182607
|
name: "create_work_slot",
|
|
182292
182608
|
description: "Create a scheduled work slot. Attaches a time block to a ToDo for planning purposes.",
|
|
182293
|
-
category:
|
|
182609
|
+
category: CATEGORY21,
|
|
182294
182610
|
inputSchema: createWorkSlotParamsJsonSchema,
|
|
182295
182611
|
handler: createToolHandler(
|
|
182296
182612
|
"create_work_slot",
|
|
@@ -182301,7 +182617,7 @@ var timeTools = [
|
|
|
182301
182617
|
{
|
|
182302
182618
|
name: "start_timer",
|
|
182303
182619
|
description: "Start a client-side timer on a Huly issue. Validates the issue exists and returns a start timestamp. Use log_time to record the elapsed time when done.",
|
|
182304
|
-
category:
|
|
182620
|
+
category: CATEGORY21,
|
|
182305
182621
|
inputSchema: startTimerParamsJsonSchema,
|
|
182306
182622
|
handler: createToolHandler(
|
|
182307
182623
|
"start_timer",
|
|
@@ -182312,7 +182628,7 @@ var timeTools = [
|
|
|
182312
182628
|
{
|
|
182313
182629
|
name: "stop_timer",
|
|
182314
182630
|
description: "Stop a client-side timer on a Huly issue. Returns the stop timestamp. Calculate elapsed time from start/stop timestamps and use log_time to record it.",
|
|
182315
|
-
category:
|
|
182631
|
+
category: CATEGORY21,
|
|
182316
182632
|
inputSchema: stopTimerParamsJsonSchema,
|
|
182317
182633
|
handler: createToolHandler(
|
|
182318
182634
|
"stop_timer",
|
|
@@ -182323,15 +182639,15 @@ var timeTools = [
|
|
|
182323
182639
|
];
|
|
182324
182640
|
|
|
182325
182641
|
// src/huly/operations/workspace.ts
|
|
182326
|
-
var
|
|
182642
|
+
var import_core45 = __toESM(require_lib4(), 1);
|
|
182327
182643
|
var accountRoleMap = {
|
|
182328
|
-
READONLYGUEST:
|
|
182329
|
-
DocGuest:
|
|
182330
|
-
GUEST:
|
|
182331
|
-
USER:
|
|
182332
|
-
MAINTAINER:
|
|
182333
|
-
OWNER:
|
|
182334
|
-
ADMIN:
|
|
182644
|
+
READONLYGUEST: import_core45.AccountRole.ReadOnlyGuest,
|
|
182645
|
+
DocGuest: import_core45.AccountRole.DocGuest,
|
|
182646
|
+
GUEST: import_core45.AccountRole.Guest,
|
|
182647
|
+
USER: import_core45.AccountRole.User,
|
|
182648
|
+
MAINTAINER: import_core45.AccountRole.Maintainer,
|
|
182649
|
+
OWNER: import_core45.AccountRole.Owner,
|
|
182650
|
+
ADMIN: import_core45.AccountRole.Admin
|
|
182335
182651
|
};
|
|
182336
182652
|
var toHulyAccountRole = (role) => accountRoleMap[role];
|
|
182337
182653
|
var formatVersion = (info) => `${info.versionMajor}.${info.versionMinor}.${info.versionPatch}`;
|
|
@@ -182483,12 +182799,12 @@ var getRegions = () => Effect_exports.gen(function* () {
|
|
|
182483
182799
|
});
|
|
182484
182800
|
|
|
182485
182801
|
// src/mcp/tools/workspace.ts
|
|
182486
|
-
var
|
|
182802
|
+
var CATEGORY22 = "workspace";
|
|
182487
182803
|
var workspaceTools = [
|
|
182488
182804
|
{
|
|
182489
182805
|
name: "list_workspace_members",
|
|
182490
182806
|
description: "List members in the current Huly workspace with their roles. Returns members with account IDs and roles.",
|
|
182491
|
-
category:
|
|
182807
|
+
category: CATEGORY22,
|
|
182492
182808
|
inputSchema: listWorkspaceMembersParamsJsonSchema,
|
|
182493
182809
|
handler: createWorkspaceToolHandler(
|
|
182494
182810
|
"list_workspace_members",
|
|
@@ -182499,7 +182815,7 @@ var workspaceTools = [
|
|
|
182499
182815
|
{
|
|
182500
182816
|
name: "update_member_role",
|
|
182501
182817
|
description: "Update a workspace member's role. Requires appropriate permissions. Valid roles: READONLYGUEST, DocGuest, GUEST, USER, MAINTAINER, OWNER, ADMIN.",
|
|
182502
|
-
category:
|
|
182818
|
+
category: CATEGORY22,
|
|
182503
182819
|
inputSchema: updateMemberRoleParamsJsonSchema,
|
|
182504
182820
|
handler: createWorkspaceToolHandler(
|
|
182505
182821
|
"update_member_role",
|
|
@@ -182510,7 +182826,7 @@ var workspaceTools = [
|
|
|
182510
182826
|
{
|
|
182511
182827
|
name: "get_workspace_info",
|
|
182512
182828
|
description: "Get information about the current workspace including name, URL, region, and settings.",
|
|
182513
|
-
category:
|
|
182829
|
+
category: CATEGORY22,
|
|
182514
182830
|
inputSchema: emptyParamsJsonSchema,
|
|
182515
182831
|
handler: createNoParamsWorkspaceToolHandler(
|
|
182516
182832
|
getWorkspaceInfo
|
|
@@ -182519,7 +182835,7 @@ var workspaceTools = [
|
|
|
182519
182835
|
{
|
|
182520
182836
|
name: "list_workspaces",
|
|
182521
182837
|
description: "List all workspaces accessible to the current user. Returns workspace summaries sorted by last visit.",
|
|
182522
|
-
category:
|
|
182838
|
+
category: CATEGORY22,
|
|
182523
182839
|
inputSchema: listWorkspacesParamsJsonSchema,
|
|
182524
182840
|
handler: createWorkspaceToolHandler(
|
|
182525
182841
|
"list_workspaces",
|
|
@@ -182530,7 +182846,7 @@ var workspaceTools = [
|
|
|
182530
182846
|
{
|
|
182531
182847
|
name: "create_workspace",
|
|
182532
182848
|
description: "Create a new Huly workspace. Returns the workspace UUID and URL. Optionally specify a region.",
|
|
182533
|
-
category:
|
|
182849
|
+
category: CATEGORY22,
|
|
182534
182850
|
inputSchema: createWorkspaceParamsJsonSchema,
|
|
182535
182851
|
handler: createWorkspaceToolHandler(
|
|
182536
182852
|
"create_workspace",
|
|
@@ -182541,7 +182857,7 @@ var workspaceTools = [
|
|
|
182541
182857
|
{
|
|
182542
182858
|
name: "delete_workspace",
|
|
182543
182859
|
description: "Permanently delete the current workspace. This action cannot be undone. Use with extreme caution.",
|
|
182544
|
-
category:
|
|
182860
|
+
category: CATEGORY22,
|
|
182545
182861
|
inputSchema: emptyParamsJsonSchema,
|
|
182546
182862
|
handler: createNoParamsWorkspaceToolHandler(
|
|
182547
182863
|
deleteWorkspace
|
|
@@ -182550,7 +182866,7 @@ var workspaceTools = [
|
|
|
182550
182866
|
{
|
|
182551
182867
|
name: "get_user_profile",
|
|
182552
182868
|
description: "Get the current user's profile information including bio, location, and social links.",
|
|
182553
|
-
category:
|
|
182869
|
+
category: CATEGORY22,
|
|
182554
182870
|
inputSchema: emptyParamsJsonSchema,
|
|
182555
182871
|
handler: createNoParamsWorkspaceToolHandler(
|
|
182556
182872
|
getUserProfile
|
|
@@ -182559,7 +182875,7 @@ var workspaceTools = [
|
|
|
182559
182875
|
{
|
|
182560
182876
|
name: "update_user_profile",
|
|
182561
182877
|
description: "Update the current user's profile. Supports bio, city, country, website, social links, and public visibility.",
|
|
182562
|
-
category:
|
|
182878
|
+
category: CATEGORY22,
|
|
182563
182879
|
inputSchema: updateUserProfileParamsJsonSchema,
|
|
182564
182880
|
handler: createWorkspaceToolHandler(
|
|
182565
182881
|
"update_user_profile",
|
|
@@ -182570,7 +182886,7 @@ var workspaceTools = [
|
|
|
182570
182886
|
{
|
|
182571
182887
|
name: "update_guest_settings",
|
|
182572
182888
|
description: "Update workspace guest settings. Control read-only guest access and guest sign-up permissions.",
|
|
182573
|
-
category:
|
|
182889
|
+
category: CATEGORY22,
|
|
182574
182890
|
inputSchema: updateGuestSettingsParamsJsonSchema,
|
|
182575
182891
|
handler: createWorkspaceToolHandler(
|
|
182576
182892
|
"update_guest_settings",
|
|
@@ -182581,7 +182897,7 @@ var workspaceTools = [
|
|
|
182581
182897
|
{
|
|
182582
182898
|
name: "get_regions",
|
|
182583
182899
|
description: "Get available regions for workspace creation. Returns region codes and display names.",
|
|
182584
|
-
category:
|
|
182900
|
+
category: CATEGORY22,
|
|
182585
182901
|
inputSchema: getRegionsParamsJsonSchema,
|
|
182586
182902
|
handler: createWorkspaceToolHandler(
|
|
182587
182903
|
"get_regions",
|
|
@@ -182606,6 +182922,7 @@ var allTools = [
|
|
|
182606
182922
|
...contactTools,
|
|
182607
182923
|
...channelTools,
|
|
182608
182924
|
...cardTools,
|
|
182925
|
+
...customFieldTools,
|
|
182609
182926
|
...calendarTools,
|
|
182610
182927
|
...timeTools,
|
|
182611
182928
|
...searchTools,
|