@firfi/huly-mcp 0.4.0 → 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 +678 -385
- package/dist/index.js +0 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +30 -18
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);
|
|
@@ -177708,8 +177791,217 @@ var contactTools = [
|
|
|
177708
177791
|
}
|
|
177709
177792
|
];
|
|
177710
177793
|
|
|
177711
|
-
// src/huly/operations/
|
|
177794
|
+
// src/huly/operations/custom-fields.ts
|
|
177712
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);
|
|
177713
178005
|
|
|
177714
178006
|
// src/utils/assertions.ts
|
|
177715
178007
|
var AssertionError = class extends Error {
|
|
@@ -177763,7 +178055,7 @@ var listComponents = (params) => Effect_exports.gen(function* () {
|
|
|
177763
178055
|
{ space: project3._id },
|
|
177764
178056
|
{
|
|
177765
178057
|
limit,
|
|
177766
|
-
sort: { modifiedOn:
|
|
178058
|
+
sort: { modifiedOn: import_core31.SortingOrder.Descending }
|
|
177767
178059
|
}
|
|
177768
178060
|
);
|
|
177769
178061
|
const leadIds = [
|
|
@@ -177803,7 +178095,7 @@ var getComponent = (params) => Effect_exports.gen(function* () {
|
|
|
177803
178095
|
});
|
|
177804
178096
|
var createComponent = (params) => Effect_exports.gen(function* () {
|
|
177805
178097
|
const { client, project: project3 } = yield* findProject(params.project);
|
|
177806
|
-
const componentId = (0,
|
|
178098
|
+
const componentId = (0, import_core31.generateId)();
|
|
177807
178099
|
const leadParam = params.lead;
|
|
177808
178100
|
const leadRef = leadParam !== void 0 ? yield* Effect_exports.gen(function* () {
|
|
177809
178101
|
const person = yield* findPersonByEmailOrName(client, leadParam);
|
|
@@ -178044,12 +178336,12 @@ var previewDeletion = (params) => {
|
|
|
178044
178336
|
};
|
|
178045
178337
|
|
|
178046
178338
|
// src/mcp/tools/deletion.ts
|
|
178047
|
-
var
|
|
178339
|
+
var CATEGORY9 = "issues";
|
|
178048
178340
|
var deletionTools = [
|
|
178049
178341
|
{
|
|
178050
178342
|
name: "preview_deletion",
|
|
178051
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.",
|
|
178052
|
-
category:
|
|
178344
|
+
category: CATEGORY9,
|
|
178053
178345
|
inputSchema: previewDeletionParamsJsonSchema,
|
|
178054
178346
|
handler: createToolHandler(
|
|
178055
178347
|
"preview_deletion",
|
|
@@ -178060,12 +178352,12 @@ var deletionTools = [
|
|
|
178060
178352
|
];
|
|
178061
178353
|
|
|
178062
178354
|
// src/mcp/tools/documents.ts
|
|
178063
|
-
var
|
|
178355
|
+
var CATEGORY10 = "documents";
|
|
178064
178356
|
var documentTools = [
|
|
178065
178357
|
{
|
|
178066
178358
|
name: "list_teamspaces",
|
|
178067
178359
|
description: "List all Huly document teamspaces. Returns teamspaces sorted by name. Supports filtering by archived status.",
|
|
178068
|
-
category:
|
|
178360
|
+
category: CATEGORY10,
|
|
178069
178361
|
inputSchema: listTeamspacesParamsJsonSchema,
|
|
178070
178362
|
handler: createToolHandler(
|
|
178071
178363
|
"list_teamspaces",
|
|
@@ -178076,7 +178368,7 @@ var documentTools = [
|
|
|
178076
178368
|
{
|
|
178077
178369
|
name: "get_teamspace",
|
|
178078
178370
|
description: "Get details for a Huly document teamspace including document count. Finds by name or ID, including archived teamspaces.",
|
|
178079
|
-
category:
|
|
178371
|
+
category: CATEGORY10,
|
|
178080
178372
|
inputSchema: getTeamspaceParamsJsonSchema,
|
|
178081
178373
|
handler: createToolHandler(
|
|
178082
178374
|
"get_teamspace",
|
|
@@ -178087,7 +178379,7 @@ var documentTools = [
|
|
|
178087
178379
|
{
|
|
178088
178380
|
name: "create_teamspace",
|
|
178089
178381
|
description: "Create a new Huly document teamspace. Idempotent: returns existing teamspace if one with the same name exists.",
|
|
178090
|
-
category:
|
|
178382
|
+
category: CATEGORY10,
|
|
178091
178383
|
inputSchema: createTeamspaceParamsJsonSchema,
|
|
178092
178384
|
handler: createToolHandler(
|
|
178093
178385
|
"create_teamspace",
|
|
@@ -178098,7 +178390,7 @@ var documentTools = [
|
|
|
178098
178390
|
{
|
|
178099
178391
|
name: "update_teamspace",
|
|
178100
178392
|
description: "Update fields on an existing Huly document teamspace. Only provided fields are modified. Set description to null to clear it.",
|
|
178101
|
-
category:
|
|
178393
|
+
category: CATEGORY10,
|
|
178102
178394
|
inputSchema: updateTeamspaceParamsJsonSchema,
|
|
178103
178395
|
handler: createToolHandler(
|
|
178104
178396
|
"update_teamspace",
|
|
@@ -178109,7 +178401,7 @@ var documentTools = [
|
|
|
178109
178401
|
{
|
|
178110
178402
|
name: "delete_teamspace",
|
|
178111
178403
|
description: "Permanently delete a Huly document teamspace. This action cannot be undone.",
|
|
178112
|
-
category:
|
|
178404
|
+
category: CATEGORY10,
|
|
178113
178405
|
inputSchema: deleteTeamspaceParamsJsonSchema,
|
|
178114
178406
|
handler: createToolHandler(
|
|
178115
178407
|
"delete_teamspace",
|
|
@@ -178120,7 +178412,7 @@ var documentTools = [
|
|
|
178120
178412
|
{
|
|
178121
178413
|
name: "list_documents",
|
|
178122
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).",
|
|
178123
|
-
category:
|
|
178415
|
+
category: CATEGORY10,
|
|
178124
178416
|
inputSchema: listDocumentsParamsJsonSchema,
|
|
178125
178417
|
handler: createToolHandler(
|
|
178126
178418
|
"list_documents",
|
|
@@ -178131,7 +178423,7 @@ var documentTools = [
|
|
|
178131
178423
|
{
|
|
178132
178424
|
name: "get_document",
|
|
178133
178425
|
description: "Retrieve full details for a Huly document including markdown content. Use this to view document content and metadata.",
|
|
178134
|
-
category:
|
|
178426
|
+
category: CATEGORY10,
|
|
178135
178427
|
inputSchema: getDocumentParamsJsonSchema,
|
|
178136
178428
|
handler: createToolHandler(
|
|
178137
178429
|
"get_document",
|
|
@@ -178142,7 +178434,7 @@ var documentTools = [
|
|
|
178142
178434
|
{
|
|
178143
178435
|
name: "create_document",
|
|
178144
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.",
|
|
178145
|
-
category:
|
|
178437
|
+
category: CATEGORY10,
|
|
178146
178438
|
inputSchema: createDocumentParamsJsonSchema,
|
|
178147
178439
|
handler: createToolHandler(
|
|
178148
178440
|
"create_document",
|
|
@@ -178153,7 +178445,7 @@ var documentTools = [
|
|
|
178153
178445
|
{
|
|
178154
178446
|
name: "edit_document",
|
|
178155
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.",
|
|
178156
|
-
category:
|
|
178448
|
+
category: CATEGORY10,
|
|
178157
178449
|
inputSchema: editDocumentParamsJsonSchema,
|
|
178158
178450
|
handler: createToolHandler(
|
|
178159
178451
|
"edit_document",
|
|
@@ -178164,7 +178456,7 @@ var documentTools = [
|
|
|
178164
178456
|
{
|
|
178165
178457
|
name: "list_inline_comments",
|
|
178166
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.",
|
|
178167
|
-
category:
|
|
178459
|
+
category: CATEGORY10,
|
|
178168
178460
|
inputSchema: listInlineCommentsParamsJsonSchema,
|
|
178169
178461
|
handler: createToolHandler(
|
|
178170
178462
|
"list_inline_comments",
|
|
@@ -178175,7 +178467,7 @@ var documentTools = [
|
|
|
178175
178467
|
{
|
|
178176
178468
|
name: "delete_document",
|
|
178177
178469
|
description: "Permanently delete a Huly document. This action cannot be undone.",
|
|
178178
|
-
category:
|
|
178470
|
+
category: CATEGORY10,
|
|
178179
178471
|
inputSchema: deleteDocumentParamsJsonSchema,
|
|
178180
178472
|
handler: createToolHandler(
|
|
178181
178473
|
"delete_document",
|
|
@@ -178443,10 +178735,10 @@ var unlinkDocumentFromIssue = (params) => Effect_exports.gen(function* () {
|
|
|
178443
178735
|
});
|
|
178444
178736
|
|
|
178445
178737
|
// src/huly/operations/issue-templates.ts
|
|
178446
|
-
var
|
|
178738
|
+
var import_core35 = __toESM(require_lib4(), 1);
|
|
178447
178739
|
|
|
178448
178740
|
// src/huly/operations/issues-move.ts
|
|
178449
|
-
var
|
|
178741
|
+
var import_core32 = __toESM(require_lib4(), 1);
|
|
178450
178742
|
var import_tracker2 = __toESM(require_lib21(), 1);
|
|
178451
178743
|
var addLabel = (params) => Effect_exports.gen(function* () {
|
|
178452
178744
|
const { client, issue: issue2, project: project3 } = yield* findProjectAndIssue(params);
|
|
@@ -178473,7 +178765,7 @@ var addLabel = (params) => Effect_exports.gen(function* () {
|
|
|
178473
178765
|
}
|
|
178474
178766
|
);
|
|
178475
178767
|
if (tagElement === void 0) {
|
|
178476
|
-
const tagElementId = (0,
|
|
178768
|
+
const tagElementId = (0, import_core32.generateId)();
|
|
178477
178769
|
const tagElementData = {
|
|
178478
178770
|
title: labelTitle,
|
|
178479
178771
|
description: "",
|
|
@@ -178606,7 +178898,7 @@ var updateDescendantParents = (client, spaceId, parentIssue, parentNewParents) =
|
|
|
178606
178898
|
});
|
|
178607
178899
|
|
|
178608
178900
|
// src/huly/operations/issues-read.ts
|
|
178609
|
-
var
|
|
178901
|
+
var import_core33 = __toESM(require_lib4(), 1);
|
|
178610
178902
|
var import_tracker3 = __toESM(require_lib21(), 1);
|
|
178611
178903
|
var resolveStatusName = (statuses, statusId) => {
|
|
178612
178904
|
const statusDoc = statuses.find((s) => s._id === statusId);
|
|
@@ -178697,7 +178989,7 @@ var listIssues = (params) => Effect_exports.gen(function* () {
|
|
|
178697
178989
|
{
|
|
178698
178990
|
limit,
|
|
178699
178991
|
sort: {
|
|
178700
|
-
modifiedOn:
|
|
178992
|
+
modifiedOn: import_core33.SortingOrder.Descending
|
|
178701
178993
|
}
|
|
178702
178994
|
},
|
|
178703
178995
|
{ assignee: contact.class.Person }
|
|
@@ -178777,7 +179069,7 @@ var getIssue = (params) => Effect_exports.gen(function* () {
|
|
|
178777
179069
|
});
|
|
178778
179070
|
|
|
178779
179071
|
// src/huly/operations/issues-write.ts
|
|
178780
|
-
var
|
|
179072
|
+
var import_core34 = __toESM(require_lib4(), 1);
|
|
178781
179073
|
var import_rank3 = __toESM(require_lib32(), 1);
|
|
178782
179074
|
var import_tracker4 = __toESM(require_lib21(), 1);
|
|
178783
179075
|
var TxIncResult = Schema_exports.Struct({
|
|
@@ -178798,7 +179090,7 @@ var resolveAssignee = (client, assigneeIdentifier) => Effect_exports.gen(functio
|
|
|
178798
179090
|
});
|
|
178799
179091
|
var createIssue = (params) => Effect_exports.gen(function* () {
|
|
178800
179092
|
const { client, defaultStatusId, project: project3, statuses } = yield* findProjectWithStatuses(params.project);
|
|
178801
|
-
const issueId = (0,
|
|
179093
|
+
const issueId = (0, import_core34.generateId)();
|
|
178802
179094
|
const incOps = { $inc: { sequence: 1 } };
|
|
178803
179095
|
const incResult = yield* client.updateDoc(
|
|
178804
179096
|
tracker.class.Project,
|
|
@@ -178813,7 +179105,7 @@ var createIssue = (params) => Effect_exports.gen(function* () {
|
|
|
178813
179105
|
const lastIssue = yield* client.findOne(
|
|
178814
179106
|
tracker.class.Issue,
|
|
178815
179107
|
{ space: project3._id },
|
|
178816
|
-
{ sort: { rank:
|
|
179108
|
+
{ sort: { rank: import_core34.SortingOrder.Descending } }
|
|
178817
179109
|
);
|
|
178818
179110
|
const rank = (0, import_rank3.makeRank)(lastIssue?.rank, void 0);
|
|
178819
179111
|
const descriptionMarkupRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
|
|
@@ -179017,7 +179309,7 @@ var buildTemplateChild = (client, projectId, projectIdentifier, input) => Effect
|
|
|
179017
179309
|
return component._id;
|
|
179018
179310
|
}) : null;
|
|
179019
179311
|
return {
|
|
179020
|
-
id: (0,
|
|
179312
|
+
id: (0, import_core35.generateId)(),
|
|
179021
179313
|
title: input.title,
|
|
179022
179314
|
description: input.description ?? "",
|
|
179023
179315
|
priority: stringToPriority(input.priority || "no-priority"),
|
|
@@ -179034,7 +179326,7 @@ var listIssueTemplates = (params) => Effect_exports.gen(function* () {
|
|
|
179034
179326
|
{ space: project3._id },
|
|
179035
179327
|
{
|
|
179036
179328
|
limit,
|
|
179037
|
-
sort: { modifiedOn:
|
|
179329
|
+
sort: { modifiedOn: import_core35.SortingOrder.Descending }
|
|
179038
179330
|
}
|
|
179039
179331
|
);
|
|
179040
179332
|
const summaries = templates.map((t) => {
|
|
@@ -179078,7 +179370,7 @@ var getIssueTemplate = (params) => Effect_exports.gen(function* () {
|
|
|
179078
179370
|
});
|
|
179079
179371
|
var createIssueTemplate = (params) => Effect_exports.gen(function* () {
|
|
179080
179372
|
const { client, project: project3 } = yield* findProject(params.project);
|
|
179081
|
-
const templateId = (0,
|
|
179373
|
+
const templateId = (0, import_core35.generateId)();
|
|
179082
179374
|
const assigneeParam = params.assignee;
|
|
179083
179375
|
const assigneeRef = assigneeParam !== void 0 ? yield* Effect_exports.gen(function* () {
|
|
179084
179376
|
const person = yield* findPersonByEmailOrName(client, assigneeParam);
|
|
@@ -179312,10 +179604,10 @@ var removeTemplateChild = (params) => Effect_exports.gen(function* () {
|
|
|
179312
179604
|
});
|
|
179313
179605
|
|
|
179314
179606
|
// src/huly/operations/labels.ts
|
|
179315
|
-
var
|
|
179607
|
+
var import_core37 = __toESM(require_lib4(), 1);
|
|
179316
179608
|
|
|
179317
179609
|
// src/huly/operations/tag-categories.ts
|
|
179318
|
-
var
|
|
179610
|
+
var import_core36 = __toESM(require_lib4(), 1);
|
|
179319
179611
|
var issueClassRef = toRef(tracker.class.Issue);
|
|
179320
179612
|
var findCategoryByIdOrLabel = (client, idOrLabel) => Effect_exports.gen(function* () {
|
|
179321
179613
|
const cat = (yield* client.findOne(
|
|
@@ -179353,7 +179645,7 @@ var listTagCategories = (params) => Effect_exports.gen(function* () {
|
|
|
179353
179645
|
query,
|
|
179354
179646
|
{
|
|
179355
179647
|
limit,
|
|
179356
|
-
sort: { modifiedOn:
|
|
179648
|
+
sort: { modifiedOn: import_core36.SortingOrder.Descending }
|
|
179357
179649
|
}
|
|
179358
179650
|
);
|
|
179359
179651
|
return categories.map(toSummary);
|
|
@@ -179368,7 +179660,7 @@ var createTagCategory = (params) => Effect_exports.gen(function* () {
|
|
|
179368
179660
|
if (existing !== void 0) {
|
|
179369
179661
|
return { id: TagCategoryId.make(existing._id), label: existing.label, created: false };
|
|
179370
179662
|
}
|
|
179371
|
-
const catId = (0,
|
|
179663
|
+
const catId = (0, import_core36.generateId)();
|
|
179372
179664
|
const catData = {
|
|
179373
179665
|
// Asset is a branded string type (Metadata<URL>) with no runtime constructor.
|
|
179374
179666
|
// Empty string is the "no icon" sentinel; Huly UI renders a default icon.
|
|
@@ -179470,7 +179762,7 @@ var listLabels = (params) => Effect_exports.gen(function* () {
|
|
|
179470
179762
|
query,
|
|
179471
179763
|
{
|
|
179472
179764
|
limit,
|
|
179473
|
-
sort: { modifiedOn:
|
|
179765
|
+
sort: { modifiedOn: import_core37.SortingOrder.Descending }
|
|
179474
179766
|
}
|
|
179475
179767
|
);
|
|
179476
179768
|
return elements.map((e) => ({
|
|
@@ -179495,7 +179787,7 @@ var createLabel = (params) => Effect_exports.gen(function* () {
|
|
|
179495
179787
|
return { id: TagElementId.make(existing._id), title: existing.title, created: false };
|
|
179496
179788
|
}
|
|
179497
179789
|
const categoryRef = yield* resolveCategoryRef(client, params.category);
|
|
179498
|
-
const tagId = (0,
|
|
179790
|
+
const tagId = (0, import_core37.generateId)();
|
|
179499
179791
|
const color = params.color ?? 0;
|
|
179500
179792
|
const tagData = {
|
|
179501
179793
|
title: params.title,
|
|
@@ -179571,12 +179863,12 @@ var removeIssueLabel = (params) => Effect_exports.gen(function* () {
|
|
|
179571
179863
|
});
|
|
179572
179864
|
|
|
179573
179865
|
// src/mcp/tools/issues.ts
|
|
179574
|
-
var
|
|
179866
|
+
var CATEGORY11 = "issues";
|
|
179575
179867
|
var issueTools = [
|
|
179576
179868
|
{
|
|
179577
179869
|
name: "list_issues",
|
|
179578
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).",
|
|
179579
|
-
category:
|
|
179871
|
+
category: CATEGORY11,
|
|
179580
179872
|
inputSchema: listIssuesParamsJsonSchema,
|
|
179581
179873
|
handler: createToolHandler(
|
|
179582
179874
|
"list_issues",
|
|
@@ -179587,7 +179879,7 @@ var issueTools = [
|
|
|
179587
179879
|
{
|
|
179588
179880
|
name: "get_issue",
|
|
179589
179881
|
description: "Retrieve full details for a Huly issue including markdown description. Use this to view issue content, comments, or full metadata.",
|
|
179590
|
-
category:
|
|
179882
|
+
category: CATEGORY11,
|
|
179591
179883
|
inputSchema: getIssueParamsJsonSchema,
|
|
179592
179884
|
handler: createToolHandler(
|
|
179593
179885
|
"get_issue",
|
|
@@ -179598,7 +179890,7 @@ var issueTools = [
|
|
|
179598
179890
|
{
|
|
179599
179891
|
name: "create_issue",
|
|
179600
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.",
|
|
179601
|
-
category:
|
|
179893
|
+
category: CATEGORY11,
|
|
179602
179894
|
inputSchema: createIssueParamsJsonSchema,
|
|
179603
179895
|
handler: createToolHandler(
|
|
179604
179896
|
"create_issue",
|
|
@@ -179609,7 +179901,7 @@ var issueTools = [
|
|
|
179609
179901
|
{
|
|
179610
179902
|
name: "update_issue",
|
|
179611
179903
|
description: "Update fields on an existing Huly issue. Only provided fields are modified. Description updates support markdown.",
|
|
179612
|
-
category:
|
|
179904
|
+
category: CATEGORY11,
|
|
179613
179905
|
inputSchema: updateIssueParamsJsonSchema,
|
|
179614
179906
|
handler: createToolHandler(
|
|
179615
179907
|
"update_issue",
|
|
@@ -179620,7 +179912,7 @@ var issueTools = [
|
|
|
179620
179912
|
{
|
|
179621
179913
|
name: "add_issue_label",
|
|
179622
179914
|
description: "Add a tag/label to a Huly issue. Creates the tag if it doesn't exist in the project.",
|
|
179623
|
-
category:
|
|
179915
|
+
category: CATEGORY11,
|
|
179624
179916
|
inputSchema: addLabelParamsJsonSchema,
|
|
179625
179917
|
handler: createToolHandler(
|
|
179626
179918
|
"add_issue_label",
|
|
@@ -179631,7 +179923,7 @@ var issueTools = [
|
|
|
179631
179923
|
{
|
|
179632
179924
|
name: "remove_issue_label",
|
|
179633
179925
|
description: "Remove a tag/label from a Huly issue. Detaches the label reference; does not delete the label definition.",
|
|
179634
|
-
category:
|
|
179926
|
+
category: CATEGORY11,
|
|
179635
179927
|
inputSchema: removeLabelParamsJsonSchema,
|
|
179636
179928
|
handler: createToolHandler(
|
|
179637
179929
|
"remove_issue_label",
|
|
@@ -179642,7 +179934,7 @@ var issueTools = [
|
|
|
179642
179934
|
{
|
|
179643
179935
|
name: "delete_issue",
|
|
179644
179936
|
description: "Permanently delete a Huly issue. This action cannot be undone.",
|
|
179645
|
-
category:
|
|
179937
|
+
category: CATEGORY11,
|
|
179646
179938
|
inputSchema: deleteIssueParamsJsonSchema,
|
|
179647
179939
|
handler: createToolHandler(
|
|
179648
179940
|
"delete_issue",
|
|
@@ -179653,7 +179945,7 @@ var issueTools = [
|
|
|
179653
179945
|
{
|
|
179654
179946
|
name: "move_issue",
|
|
179655
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.",
|
|
179656
|
-
category:
|
|
179948
|
+
category: CATEGORY11,
|
|
179657
179949
|
inputSchema: moveIssueParamsJsonSchema,
|
|
179658
179950
|
handler: createToolHandler(
|
|
179659
179951
|
"move_issue",
|
|
@@ -179664,7 +179956,7 @@ var issueTools = [
|
|
|
179664
179956
|
{
|
|
179665
179957
|
name: "list_components",
|
|
179666
179958
|
description: "List components in a Huly project. Components organize issues by area/feature. Returns components sorted by modification date (newest first).",
|
|
179667
|
-
category:
|
|
179959
|
+
category: CATEGORY11,
|
|
179668
179960
|
inputSchema: listComponentsParamsJsonSchema,
|
|
179669
179961
|
handler: createToolHandler(
|
|
179670
179962
|
"list_components",
|
|
@@ -179675,7 +179967,7 @@ var issueTools = [
|
|
|
179675
179967
|
{
|
|
179676
179968
|
name: "get_component",
|
|
179677
179969
|
description: "Retrieve full details for a Huly component. Use this to view component content and metadata.",
|
|
179678
|
-
category:
|
|
179970
|
+
category: CATEGORY11,
|
|
179679
179971
|
inputSchema: getComponentParamsJsonSchema,
|
|
179680
179972
|
handler: createToolHandler(
|
|
179681
179973
|
"get_component",
|
|
@@ -179686,7 +179978,7 @@ var issueTools = [
|
|
|
179686
179978
|
{
|
|
179687
179979
|
name: "create_component",
|
|
179688
179980
|
description: "Create a new component in a Huly project. Components help organize issues by area/feature. Returns the created component ID and label.",
|
|
179689
|
-
category:
|
|
179981
|
+
category: CATEGORY11,
|
|
179690
179982
|
inputSchema: createComponentParamsJsonSchema,
|
|
179691
179983
|
handler: createToolHandler(
|
|
179692
179984
|
"create_component",
|
|
@@ -179697,7 +179989,7 @@ var issueTools = [
|
|
|
179697
179989
|
{
|
|
179698
179990
|
name: "update_component",
|
|
179699
179991
|
description: "Update fields on an existing Huly component. Only provided fields are modified.",
|
|
179700
|
-
category:
|
|
179992
|
+
category: CATEGORY11,
|
|
179701
179993
|
inputSchema: updateComponentParamsJsonSchema,
|
|
179702
179994
|
handler: createToolHandler(
|
|
179703
179995
|
"update_component",
|
|
@@ -179708,7 +180000,7 @@ var issueTools = [
|
|
|
179708
180000
|
{
|
|
179709
180001
|
name: "set_issue_component",
|
|
179710
180002
|
description: "Set or clear the component on a Huly issue. Pass null for component to clear it.",
|
|
179711
|
-
category:
|
|
180003
|
+
category: CATEGORY11,
|
|
179712
180004
|
inputSchema: setIssueComponentParamsJsonSchema,
|
|
179713
180005
|
handler: createToolHandler(
|
|
179714
180006
|
"set_issue_component",
|
|
@@ -179719,7 +180011,7 @@ var issueTools = [
|
|
|
179719
180011
|
{
|
|
179720
180012
|
name: "delete_component",
|
|
179721
180013
|
description: "Permanently delete a Huly component. This action cannot be undone.",
|
|
179722
|
-
category:
|
|
180014
|
+
category: CATEGORY11,
|
|
179723
180015
|
inputSchema: deleteComponentParamsJsonSchema,
|
|
179724
180016
|
handler: createToolHandler(
|
|
179725
180017
|
"delete_component",
|
|
@@ -179730,7 +180022,7 @@ var issueTools = [
|
|
|
179730
180022
|
{
|
|
179731
180023
|
name: "list_issue_templates",
|
|
179732
180024
|
description: "List issue templates in a Huly project. Templates define reusable issue configurations. Returns templates sorted by modification date (newest first).",
|
|
179733
|
-
category:
|
|
180025
|
+
category: CATEGORY11,
|
|
179734
180026
|
inputSchema: listIssueTemplatesParamsJsonSchema,
|
|
179735
180027
|
handler: createToolHandler(
|
|
179736
180028
|
"list_issue_templates",
|
|
@@ -179741,7 +180033,7 @@ var issueTools = [
|
|
|
179741
180033
|
{
|
|
179742
180034
|
name: "get_issue_template",
|
|
179743
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.",
|
|
179744
|
-
category:
|
|
180036
|
+
category: CATEGORY11,
|
|
179745
180037
|
inputSchema: getIssueTemplateParamsJsonSchema,
|
|
179746
180038
|
handler: createToolHandler(
|
|
179747
180039
|
"get_issue_template",
|
|
@@ -179752,7 +180044,7 @@ var issueTools = [
|
|
|
179752
180044
|
{
|
|
179753
180045
|
name: "create_issue_template",
|
|
179754
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.",
|
|
179755
|
-
category:
|
|
180047
|
+
category: CATEGORY11,
|
|
179756
180048
|
inputSchema: createIssueTemplateParamsJsonSchema,
|
|
179757
180049
|
handler: createToolHandler(
|
|
179758
180050
|
"create_issue_template",
|
|
@@ -179763,7 +180055,7 @@ var issueTools = [
|
|
|
179763
180055
|
{
|
|
179764
180056
|
name: "create_issue_from_template",
|
|
179765
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.",
|
|
179766
|
-
category:
|
|
180058
|
+
category: CATEGORY11,
|
|
179767
180059
|
inputSchema: createIssueFromTemplateParamsJsonSchema,
|
|
179768
180060
|
handler: createToolHandler(
|
|
179769
180061
|
"create_issue_from_template",
|
|
@@ -179774,7 +180066,7 @@ var issueTools = [
|
|
|
179774
180066
|
{
|
|
179775
180067
|
name: "update_issue_template",
|
|
179776
180068
|
description: "Update fields on an existing Huly issue template. Only provided fields are modified.",
|
|
179777
|
-
category:
|
|
180069
|
+
category: CATEGORY11,
|
|
179778
180070
|
inputSchema: updateIssueTemplateParamsJsonSchema,
|
|
179779
180071
|
handler: createToolHandler(
|
|
179780
180072
|
"update_issue_template",
|
|
@@ -179785,7 +180077,7 @@ var issueTools = [
|
|
|
179785
180077
|
{
|
|
179786
180078
|
name: "delete_issue_template",
|
|
179787
180079
|
description: "Permanently delete a Huly issue template. This action cannot be undone.",
|
|
179788
|
-
category:
|
|
180080
|
+
category: CATEGORY11,
|
|
179789
180081
|
inputSchema: deleteIssueTemplateParamsJsonSchema,
|
|
179790
180082
|
handler: createToolHandler(
|
|
179791
180083
|
"delete_issue_template",
|
|
@@ -179796,7 +180088,7 @@ var issueTools = [
|
|
|
179796
180088
|
{
|
|
179797
180089
|
name: "add_template_child",
|
|
179798
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.",
|
|
179799
|
-
category:
|
|
180091
|
+
category: CATEGORY11,
|
|
179800
180092
|
inputSchema: addTemplateChildParamsJsonSchema,
|
|
179801
180093
|
handler: createToolHandler(
|
|
179802
180094
|
"add_template_child",
|
|
@@ -179807,7 +180099,7 @@ var issueTools = [
|
|
|
179807
180099
|
{
|
|
179808
180100
|
name: "remove_template_child",
|
|
179809
180101
|
description: "Remove a child (sub-task) template from an issue template by its child ID. Get child IDs from get_issue_template response.",
|
|
179810
|
-
category:
|
|
180102
|
+
category: CATEGORY11,
|
|
179811
180103
|
inputSchema: removeTemplateChildParamsJsonSchema,
|
|
179812
180104
|
handler: createToolHandler(
|
|
179813
180105
|
"remove_template_child",
|
|
@@ -179818,7 +180110,7 @@ var issueTools = [
|
|
|
179818
180110
|
{
|
|
179819
180111
|
name: "add_issue_relation",
|
|
179820
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.",
|
|
179821
|
-
category:
|
|
180113
|
+
category: CATEGORY11,
|
|
179822
180114
|
inputSchema: addIssueRelationParamsJsonSchema,
|
|
179823
180115
|
handler: createToolHandler(
|
|
179824
180116
|
"add_issue_relation",
|
|
@@ -179829,7 +180121,7 @@ var issueTools = [
|
|
|
179829
180121
|
{
|
|
179830
180122
|
name: "remove_issue_relation",
|
|
179831
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.",
|
|
179832
|
-
category:
|
|
180124
|
+
category: CATEGORY11,
|
|
179833
180125
|
inputSchema: removeIssueRelationParamsJsonSchema,
|
|
179834
180126
|
handler: createToolHandler(
|
|
179835
180127
|
"remove_issue_relation",
|
|
@@ -179840,7 +180132,7 @@ var issueTools = [
|
|
|
179840
180132
|
{
|
|
179841
180133
|
name: "list_issue_relations",
|
|
179842
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.",
|
|
179843
|
-
category:
|
|
180135
|
+
category: CATEGORY11,
|
|
179844
180136
|
inputSchema: listIssueRelationsParamsJsonSchema,
|
|
179845
180137
|
handler: createToolHandler(
|
|
179846
180138
|
"list_issue_relations",
|
|
@@ -179851,7 +180143,7 @@ var issueTools = [
|
|
|
179851
180143
|
{
|
|
179852
180144
|
name: "link_document_to_issue",
|
|
179853
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.",
|
|
179854
|
-
category:
|
|
180146
|
+
category: CATEGORY11,
|
|
179855
180147
|
inputSchema: linkDocumentToIssueParamsJsonSchema,
|
|
179856
180148
|
handler: createToolHandler(
|
|
179857
180149
|
"link_document_to_issue",
|
|
@@ -179862,7 +180154,7 @@ var issueTools = [
|
|
|
179862
180154
|
{
|
|
179863
180155
|
name: "unlink_document_from_issue",
|
|
179864
180156
|
description: "Remove a document link from an issue. Idempotent: no-op if the document is not linked.",
|
|
179865
|
-
category:
|
|
180157
|
+
category: CATEGORY11,
|
|
179866
180158
|
inputSchema: unlinkDocumentFromIssueParamsJsonSchema,
|
|
179867
180159
|
handler: createToolHandler(
|
|
179868
180160
|
"unlink_document_from_issue",
|
|
@@ -179873,12 +180165,12 @@ var issueTools = [
|
|
|
179873
180165
|
];
|
|
179874
180166
|
|
|
179875
180167
|
// src/mcp/tools/labels.ts
|
|
179876
|
-
var
|
|
180168
|
+
var CATEGORY12 = "labels";
|
|
179877
180169
|
var labelTools = [
|
|
179878
180170
|
{
|
|
179879
180171
|
name: "list_labels",
|
|
179880
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).",
|
|
179881
|
-
category:
|
|
180173
|
+
category: CATEGORY12,
|
|
179882
180174
|
inputSchema: listLabelsParamsJsonSchema,
|
|
179883
180175
|
handler: createToolHandler(
|
|
179884
180176
|
"list_labels",
|
|
@@ -179889,7 +180181,7 @@ var labelTools = [
|
|
|
179889
180181
|
{
|
|
179890
180182
|
name: "create_label",
|
|
179891
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.",
|
|
179892
|
-
category:
|
|
180184
|
+
category: CATEGORY12,
|
|
179893
180185
|
inputSchema: createLabelParamsJsonSchema,
|
|
179894
180186
|
handler: createToolHandler(
|
|
179895
180187
|
"create_label",
|
|
@@ -179900,7 +180192,7 @@ var labelTools = [
|
|
|
179900
180192
|
{
|
|
179901
180193
|
name: "update_label",
|
|
179902
180194
|
description: "Update a label/tag definition. Accepts label ID or title. Only provided fields are modified.",
|
|
179903
|
-
category:
|
|
180195
|
+
category: CATEGORY12,
|
|
179904
180196
|
inputSchema: updateLabelParamsJsonSchema,
|
|
179905
180197
|
handler: createToolHandler(
|
|
179906
180198
|
"update_label",
|
|
@@ -179911,7 +180203,7 @@ var labelTools = [
|
|
|
179911
180203
|
{
|
|
179912
180204
|
name: "delete_label",
|
|
179913
180205
|
description: "Permanently delete a label/tag definition. Accepts label ID or title. This action cannot be undone.",
|
|
179914
|
-
category:
|
|
180206
|
+
category: CATEGORY12,
|
|
179915
180207
|
inputSchema: deleteLabelParamsJsonSchema,
|
|
179916
180208
|
handler: createToolHandler(
|
|
179917
180209
|
"delete_label",
|
|
@@ -179922,7 +180214,7 @@ var labelTools = [
|
|
|
179922
180214
|
];
|
|
179923
180215
|
|
|
179924
180216
|
// src/huly/operations/milestones.ts
|
|
179925
|
-
var
|
|
180217
|
+
var import_core38 = __toESM(require_lib4(), 1);
|
|
179926
180218
|
var import_tracker5 = __toESM(require_lib21(), 1);
|
|
179927
180219
|
var milestoneStatusToStringMap = {
|
|
179928
180220
|
[import_tracker5.MilestoneStatus.Planned]: "planned",
|
|
@@ -179966,7 +180258,7 @@ var listMilestones = (params) => Effect_exports.gen(function* () {
|
|
|
179966
180258
|
{ space: project3._id },
|
|
179967
180259
|
{
|
|
179968
180260
|
limit,
|
|
179969
|
-
sort: { modifiedOn:
|
|
180261
|
+
sort: { modifiedOn: import_core38.SortingOrder.Descending }
|
|
179970
180262
|
}
|
|
179971
180263
|
);
|
|
179972
180264
|
const summaries = milestones.map((m) => ({
|
|
@@ -179994,7 +180286,7 @@ var getMilestone = (params) => Effect_exports.gen(function* () {
|
|
|
179994
180286
|
});
|
|
179995
180287
|
var createMilestone = (params) => Effect_exports.gen(function* () {
|
|
179996
180288
|
const { client, project: project3 } = yield* findProject(params.project);
|
|
179997
|
-
const milestoneId = (0,
|
|
180289
|
+
const milestoneId = (0, import_core38.generateId)();
|
|
179998
180290
|
const milestoneData = {
|
|
179999
180291
|
label: params.label,
|
|
180000
180292
|
description: params.description ?? "",
|
|
@@ -180058,12 +180350,12 @@ var deleteMilestone = (params) => Effect_exports.gen(function* () {
|
|
|
180058
180350
|
});
|
|
180059
180351
|
|
|
180060
180352
|
// src/mcp/tools/milestones.ts
|
|
180061
|
-
var
|
|
180353
|
+
var CATEGORY13 = "milestones";
|
|
180062
180354
|
var milestoneTools = [
|
|
180063
180355
|
{
|
|
180064
180356
|
name: "list_milestones",
|
|
180065
180357
|
description: "List milestones in a Huly project. Returns milestones sorted by modification date (newest first).",
|
|
180066
|
-
category:
|
|
180358
|
+
category: CATEGORY13,
|
|
180067
180359
|
inputSchema: listMilestonesParamsJsonSchema,
|
|
180068
180360
|
handler: createToolHandler(
|
|
180069
180361
|
"list_milestones",
|
|
@@ -180074,7 +180366,7 @@ var milestoneTools = [
|
|
|
180074
180366
|
{
|
|
180075
180367
|
name: "get_milestone",
|
|
180076
180368
|
description: "Retrieve full details for a Huly milestone. Use this to view milestone content and metadata.",
|
|
180077
|
-
category:
|
|
180369
|
+
category: CATEGORY13,
|
|
180078
180370
|
inputSchema: getMilestoneParamsJsonSchema,
|
|
180079
180371
|
handler: createToolHandler(
|
|
180080
180372
|
"get_milestone",
|
|
@@ -180085,7 +180377,7 @@ var milestoneTools = [
|
|
|
180085
180377
|
{
|
|
180086
180378
|
name: "create_milestone",
|
|
180087
180379
|
description: "Create a new milestone in a Huly project. Returns the created milestone ID and label.",
|
|
180088
|
-
category:
|
|
180380
|
+
category: CATEGORY13,
|
|
180089
180381
|
inputSchema: createMilestoneParamsJsonSchema,
|
|
180090
180382
|
handler: createToolHandler(
|
|
180091
180383
|
"create_milestone",
|
|
@@ -180096,7 +180388,7 @@ var milestoneTools = [
|
|
|
180096
180388
|
{
|
|
180097
180389
|
name: "update_milestone",
|
|
180098
180390
|
description: "Update fields on an existing Huly milestone. Only provided fields are modified.",
|
|
180099
|
-
category:
|
|
180391
|
+
category: CATEGORY13,
|
|
180100
180392
|
inputSchema: updateMilestoneParamsJsonSchema,
|
|
180101
180393
|
handler: createToolHandler(
|
|
180102
180394
|
"update_milestone",
|
|
@@ -180107,7 +180399,7 @@ var milestoneTools = [
|
|
|
180107
180399
|
{
|
|
180108
180400
|
name: "set_issue_milestone",
|
|
180109
180401
|
description: "Set or clear the milestone on a Huly issue. Pass null for milestone to clear it.",
|
|
180110
|
-
category:
|
|
180402
|
+
category: CATEGORY13,
|
|
180111
180403
|
inputSchema: setIssueMilestoneParamsJsonSchema,
|
|
180112
180404
|
handler: createToolHandler(
|
|
180113
180405
|
"set_issue_milestone",
|
|
@@ -180118,7 +180410,7 @@ var milestoneTools = [
|
|
|
180118
180410
|
{
|
|
180119
180411
|
name: "delete_milestone",
|
|
180120
180412
|
description: "Permanently delete a Huly milestone. This action cannot be undone.",
|
|
180121
|
-
category:
|
|
180413
|
+
category: CATEGORY13,
|
|
180122
180414
|
inputSchema: deleteMilestoneParamsJsonSchema,
|
|
180123
180415
|
handler: createToolHandler(
|
|
180124
180416
|
"delete_milestone",
|
|
@@ -180129,7 +180421,7 @@ var milestoneTools = [
|
|
|
180129
180421
|
];
|
|
180130
180422
|
|
|
180131
180423
|
// src/huly/operations/notifications.ts
|
|
180132
|
-
var
|
|
180424
|
+
var import_core39 = __toESM(require_lib4(), 1);
|
|
180133
180425
|
var toDocNotifyContextSummary = (ctx) => ({
|
|
180134
180426
|
id: NotificationContextId.make(ctx._id),
|
|
180135
180427
|
objectId: ctx.objectId,
|
|
@@ -180175,7 +180467,7 @@ var listNotifications = (params) => Effect_exports.gen(function* () {
|
|
|
180175
180467
|
{
|
|
180176
180468
|
limit,
|
|
180177
180469
|
sort: {
|
|
180178
|
-
modifiedOn:
|
|
180470
|
+
modifiedOn: import_core39.SortingOrder.Descending
|
|
180179
180471
|
}
|
|
180180
180472
|
}
|
|
180181
180473
|
);
|
|
@@ -180317,7 +180609,7 @@ var listNotificationContexts = (params) => Effect_exports.gen(function* () {
|
|
|
180317
180609
|
{
|
|
180318
180610
|
limit,
|
|
180319
180611
|
sort: {
|
|
180320
|
-
lastUpdateTimestamp:
|
|
180612
|
+
lastUpdateTimestamp: import_core39.SortingOrder.Descending
|
|
180321
180613
|
}
|
|
180322
180614
|
}
|
|
180323
180615
|
);
|
|
@@ -180386,12 +180678,12 @@ var getUnreadNotificationCount = () => Effect_exports.gen(function* () {
|
|
|
180386
180678
|
});
|
|
180387
180679
|
|
|
180388
180680
|
// src/mcp/tools/notifications.ts
|
|
180389
|
-
var
|
|
180681
|
+
var CATEGORY14 = "notifications";
|
|
180390
180682
|
var notificationTools = [
|
|
180391
180683
|
{
|
|
180392
180684
|
name: "list_notifications",
|
|
180393
180685
|
description: "List inbox notifications. Returns notifications sorted by modification date (newest first). Supports filtering by read/archived status.",
|
|
180394
|
-
category:
|
|
180686
|
+
category: CATEGORY14,
|
|
180395
180687
|
inputSchema: listNotificationsParamsJsonSchema,
|
|
180396
180688
|
handler: createToolHandler(
|
|
180397
180689
|
"list_notifications",
|
|
@@ -180402,7 +180694,7 @@ var notificationTools = [
|
|
|
180402
180694
|
{
|
|
180403
180695
|
name: "get_notification",
|
|
180404
180696
|
description: "Retrieve full details for a notification. Use this to view notification content and metadata.",
|
|
180405
|
-
category:
|
|
180697
|
+
category: CATEGORY14,
|
|
180406
180698
|
inputSchema: getNotificationParamsJsonSchema,
|
|
180407
180699
|
handler: createToolHandler(
|
|
180408
180700
|
"get_notification",
|
|
@@ -180413,7 +180705,7 @@ var notificationTools = [
|
|
|
180413
180705
|
{
|
|
180414
180706
|
name: "mark_notification_read",
|
|
180415
180707
|
description: "Mark a notification as read.",
|
|
180416
|
-
category:
|
|
180708
|
+
category: CATEGORY14,
|
|
180417
180709
|
inputSchema: markNotificationReadParamsJsonSchema,
|
|
180418
180710
|
handler: createToolHandler(
|
|
180419
180711
|
"mark_notification_read",
|
|
@@ -180424,7 +180716,7 @@ var notificationTools = [
|
|
|
180424
180716
|
{
|
|
180425
180717
|
name: "mark_all_notifications_read",
|
|
180426
180718
|
description: "Mark all unread notifications as read. Returns the count of notifications marked.",
|
|
180427
|
-
category:
|
|
180719
|
+
category: CATEGORY14,
|
|
180428
180720
|
inputSchema: emptyParamsJsonSchema,
|
|
180429
180721
|
handler: createToolHandler(
|
|
180430
180722
|
"mark_all_notifications_read",
|
|
@@ -180435,7 +180727,7 @@ var notificationTools = [
|
|
|
180435
180727
|
{
|
|
180436
180728
|
name: "archive_notification",
|
|
180437
180729
|
description: "Archive a notification. Archived notifications are hidden from the main inbox view.",
|
|
180438
|
-
category:
|
|
180730
|
+
category: CATEGORY14,
|
|
180439
180731
|
inputSchema: archiveNotificationParamsJsonSchema,
|
|
180440
180732
|
handler: createToolHandler(
|
|
180441
180733
|
"archive_notification",
|
|
@@ -180446,7 +180738,7 @@ var notificationTools = [
|
|
|
180446
180738
|
{
|
|
180447
180739
|
name: "archive_all_notifications",
|
|
180448
180740
|
description: "Archive all notifications. Returns the count of notifications archived.",
|
|
180449
|
-
category:
|
|
180741
|
+
category: CATEGORY14,
|
|
180450
180742
|
inputSchema: emptyParamsJsonSchema,
|
|
180451
180743
|
handler: createToolHandler(
|
|
180452
180744
|
"archive_all_notifications",
|
|
@@ -180457,7 +180749,7 @@ var notificationTools = [
|
|
|
180457
180749
|
{
|
|
180458
180750
|
name: "delete_notification",
|
|
180459
180751
|
description: "Permanently delete a notification. This action cannot be undone.",
|
|
180460
|
-
category:
|
|
180752
|
+
category: CATEGORY14,
|
|
180461
180753
|
inputSchema: deleteNotificationParamsJsonSchema,
|
|
180462
180754
|
handler: createToolHandler(
|
|
180463
180755
|
"delete_notification",
|
|
@@ -180468,7 +180760,7 @@ var notificationTools = [
|
|
|
180468
180760
|
{
|
|
180469
180761
|
name: "get_notification_context",
|
|
180470
180762
|
description: "Get notification context for an entity. Returns tracking information for a specific object.",
|
|
180471
|
-
category:
|
|
180763
|
+
category: CATEGORY14,
|
|
180472
180764
|
inputSchema: getNotificationContextParamsJsonSchema,
|
|
180473
180765
|
handler: createToolHandler(
|
|
180474
180766
|
"get_notification_context",
|
|
@@ -180479,7 +180771,7 @@ var notificationTools = [
|
|
|
180479
180771
|
{
|
|
180480
180772
|
name: "list_notification_contexts",
|
|
180481
180773
|
description: "List notification contexts. Returns contexts sorted by last update timestamp (newest first). Supports filtering by pinned status.",
|
|
180482
|
-
category:
|
|
180774
|
+
category: CATEGORY14,
|
|
180483
180775
|
inputSchema: listNotificationContextsParamsJsonSchema,
|
|
180484
180776
|
handler: createToolHandler(
|
|
180485
180777
|
"list_notification_contexts",
|
|
@@ -180490,7 +180782,7 @@ var notificationTools = [
|
|
|
180490
180782
|
{
|
|
180491
180783
|
name: "pin_notification_context",
|
|
180492
180784
|
description: "Pin or unpin a notification context. Pinned contexts are highlighted in the inbox.",
|
|
180493
|
-
category:
|
|
180785
|
+
category: CATEGORY14,
|
|
180494
180786
|
inputSchema: pinNotificationContextParamsJsonSchema,
|
|
180495
180787
|
handler: createToolHandler(
|
|
180496
180788
|
"pin_notification_context",
|
|
@@ -180501,7 +180793,7 @@ var notificationTools = [
|
|
|
180501
180793
|
{
|
|
180502
180794
|
name: "list_notification_settings",
|
|
180503
180795
|
description: "List notification provider settings. Returns current notification preferences.",
|
|
180504
|
-
category:
|
|
180796
|
+
category: CATEGORY14,
|
|
180505
180797
|
inputSchema: listNotificationSettingsParamsJsonSchema,
|
|
180506
180798
|
handler: createToolHandler(
|
|
180507
180799
|
"list_notification_settings",
|
|
@@ -180512,7 +180804,7 @@ var notificationTools = [
|
|
|
180512
180804
|
{
|
|
180513
180805
|
name: "update_notification_provider_setting",
|
|
180514
180806
|
description: "Update notification provider setting. Enable or disable notifications for a specific provider.",
|
|
180515
|
-
category:
|
|
180807
|
+
category: CATEGORY14,
|
|
180516
180808
|
inputSchema: updateNotificationProviderSettingParamsJsonSchema,
|
|
180517
180809
|
handler: createToolHandler(
|
|
180518
180810
|
"update_notification_provider_setting",
|
|
@@ -180523,7 +180815,7 @@ var notificationTools = [
|
|
|
180523
180815
|
{
|
|
180524
180816
|
name: "get_unread_notification_count",
|
|
180525
180817
|
description: "Get the count of unread notifications.",
|
|
180526
|
-
category:
|
|
180818
|
+
category: CATEGORY14,
|
|
180527
180819
|
inputSchema: emptyParamsJsonSchema,
|
|
180528
180820
|
handler: createToolHandler(
|
|
180529
180821
|
"get_unread_notification_count",
|
|
@@ -180534,7 +180826,7 @@ var notificationTools = [
|
|
|
180534
180826
|
];
|
|
180535
180827
|
|
|
180536
180828
|
// src/huly/operations/projects.ts
|
|
180537
|
-
var
|
|
180829
|
+
var import_core40 = __toESM(require_lib4(), 1);
|
|
180538
180830
|
var import_tracker6 = __toESM(require_lib21(), 1);
|
|
180539
180831
|
var listProjects = (params) => Effect_exports.gen(function* () {
|
|
180540
180832
|
const client = yield* HulyClient;
|
|
@@ -180549,7 +180841,7 @@ var listProjects = (params) => Effect_exports.gen(function* () {
|
|
|
180549
180841
|
{
|
|
180550
180842
|
limit,
|
|
180551
180843
|
sort: {
|
|
180552
|
-
name:
|
|
180844
|
+
name: import_core40.SortingOrder.Ascending
|
|
180553
180845
|
}
|
|
180554
180846
|
}
|
|
180555
180847
|
);
|
|
@@ -180618,7 +180910,7 @@ var createProject = (params) => Effect_exports.gen(function* () {
|
|
|
180618
180910
|
created: false
|
|
180619
180911
|
};
|
|
180620
180912
|
}
|
|
180621
|
-
const projectId = (0,
|
|
180913
|
+
const projectId = (0, import_core40.generateId)();
|
|
180622
180914
|
const projectData = {
|
|
180623
180915
|
name: params.name,
|
|
180624
180916
|
description: params.description ?? "",
|
|
@@ -180680,12 +180972,12 @@ var deleteProject = (params) => Effect_exports.gen(function* () {
|
|
|
180680
180972
|
});
|
|
180681
180973
|
|
|
180682
180974
|
// src/mcp/tools/projects.ts
|
|
180683
|
-
var
|
|
180975
|
+
var CATEGORY15 = "projects";
|
|
180684
180976
|
var projectTools = [
|
|
180685
180977
|
{
|
|
180686
180978
|
name: "list_projects",
|
|
180687
180979
|
description: "List all Huly projects. Returns projects sorted by name. Supports filtering by archived status.",
|
|
180688
|
-
category:
|
|
180980
|
+
category: CATEGORY15,
|
|
180689
180981
|
inputSchema: listProjectsParamsJsonSchema,
|
|
180690
180982
|
handler: createToolHandler(
|
|
180691
180983
|
"list_projects",
|
|
@@ -180696,7 +180988,7 @@ var projectTools = [
|
|
|
180696
180988
|
{
|
|
180697
180989
|
name: "get_project",
|
|
180698
180990
|
description: "Get full details of a Huly project including its statuses. Returns project name, description, archived flag, default status, and all available statuses.",
|
|
180699
|
-
category:
|
|
180991
|
+
category: CATEGORY15,
|
|
180700
180992
|
inputSchema: getProjectParamsJsonSchema,
|
|
180701
180993
|
handler: createToolHandler(
|
|
180702
180994
|
"get_project",
|
|
@@ -180707,7 +180999,7 @@ var projectTools = [
|
|
|
180707
180999
|
{
|
|
180708
181000
|
name: "list_statuses",
|
|
180709
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.",
|
|
180710
|
-
category:
|
|
181002
|
+
category: CATEGORY15,
|
|
180711
181003
|
inputSchema: listStatusesParamsJsonSchema,
|
|
180712
181004
|
handler: createToolHandler(
|
|
180713
181005
|
"list_statuses",
|
|
@@ -180718,7 +181010,7 @@ var projectTools = [
|
|
|
180718
181010
|
{
|
|
180719
181011
|
name: "create_project",
|
|
180720
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.",
|
|
180721
|
-
category:
|
|
181013
|
+
category: CATEGORY15,
|
|
180722
181014
|
inputSchema: createProjectParamsJsonSchema,
|
|
180723
181015
|
handler: createToolHandler(
|
|
180724
181016
|
"create_project",
|
|
@@ -180729,7 +181021,7 @@ var projectTools = [
|
|
|
180729
181021
|
{
|
|
180730
181022
|
name: "update_project",
|
|
180731
181023
|
description: "Update a Huly project. Only provided fields are modified. Set description to null to clear it.",
|
|
180732
|
-
category:
|
|
181024
|
+
category: CATEGORY15,
|
|
180733
181025
|
inputSchema: updateProjectParamsJsonSchema,
|
|
180734
181026
|
handler: createToolHandler(
|
|
180735
181027
|
"update_project",
|
|
@@ -180740,7 +181032,7 @@ var projectTools = [
|
|
|
180740
181032
|
{
|
|
180741
181033
|
name: "delete_project",
|
|
180742
181034
|
description: "Permanently delete a Huly project. All issues, milestones, and components in this project will be orphaned. This action cannot be undone.",
|
|
180743
|
-
category:
|
|
181035
|
+
category: CATEGORY15,
|
|
180744
181036
|
inputSchema: deleteProjectParamsJsonSchema,
|
|
180745
181037
|
handler: createToolHandler(
|
|
180746
181038
|
"delete_project",
|
|
@@ -180783,12 +181075,12 @@ var fulltextSearch = (params) => Effect_exports.gen(function* () {
|
|
|
180783
181075
|
});
|
|
180784
181076
|
|
|
180785
181077
|
// src/mcp/tools/search.ts
|
|
180786
|
-
var
|
|
181078
|
+
var CATEGORY16 = "search";
|
|
180787
181079
|
var searchTools = [
|
|
180788
181080
|
{
|
|
180789
181081
|
name: "fulltext_search",
|
|
180790
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).",
|
|
180791
|
-
category:
|
|
181083
|
+
category: CATEGORY16,
|
|
180792
181084
|
inputSchema: fulltextSearchParamsJsonSchema,
|
|
180793
181085
|
handler: createToolHandler(
|
|
180794
181086
|
"fulltext_search",
|
|
@@ -180811,12 +181103,12 @@ var uploadFile = (params) => Effect_exports.gen(function* () {
|
|
|
180811
181103
|
});
|
|
180812
181104
|
|
|
180813
181105
|
// src/mcp/tools/storage.ts
|
|
180814
|
-
var
|
|
181106
|
+
var CATEGORY17 = "storage";
|
|
180815
181107
|
var storageTools = [
|
|
180816
181108
|
{
|
|
180817
181109
|
name: "upload_file",
|
|
180818
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.",
|
|
180819
|
-
category:
|
|
181111
|
+
category: CATEGORY17,
|
|
180820
181112
|
inputSchema: uploadFileParamsJsonSchema,
|
|
180821
181113
|
handler: createStorageToolHandler(
|
|
180822
181114
|
"upload_file",
|
|
@@ -180827,12 +181119,12 @@ var storageTools = [
|
|
|
180827
181119
|
];
|
|
180828
181120
|
|
|
180829
181121
|
// src/mcp/tools/tag-categories.ts
|
|
180830
|
-
var
|
|
181122
|
+
var CATEGORY18 = "tag-categories";
|
|
180831
181123
|
var tagCategoryTools = [
|
|
180832
181124
|
{
|
|
180833
181125
|
name: "list_tag_categories",
|
|
180834
181126
|
description: "List tag/label categories in the workspace. Categories group labels (e.g., 'Priority Labels', 'Type Labels'). Optional targetClass filter (defaults to all).",
|
|
180835
|
-
category:
|
|
181127
|
+
category: CATEGORY18,
|
|
180836
181128
|
inputSchema: listTagCategoriesParamsJsonSchema,
|
|
180837
181129
|
handler: createToolHandler(
|
|
180838
181130
|
"list_tag_categories",
|
|
@@ -180843,7 +181135,7 @@ var tagCategoryTools = [
|
|
|
180843
181135
|
{
|
|
180844
181136
|
name: "create_tag_category",
|
|
180845
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.",
|
|
180846
|
-
category:
|
|
181138
|
+
category: CATEGORY18,
|
|
180847
181139
|
inputSchema: createTagCategoryParamsJsonSchema,
|
|
180848
181140
|
handler: createToolHandler(
|
|
180849
181141
|
"create_tag_category",
|
|
@@ -180854,7 +181146,7 @@ var tagCategoryTools = [
|
|
|
180854
181146
|
{
|
|
180855
181147
|
name: "update_tag_category",
|
|
180856
181148
|
description: "Update a tag/label category. Accepts category ID or label name. Only provided fields are modified.",
|
|
180857
|
-
category:
|
|
181149
|
+
category: CATEGORY18,
|
|
180858
181150
|
inputSchema: updateTagCategoryParamsJsonSchema,
|
|
180859
181151
|
handler: createToolHandler(
|
|
180860
181152
|
"update_tag_category",
|
|
@@ -180865,7 +181157,7 @@ var tagCategoryTools = [
|
|
|
180865
181157
|
{
|
|
180866
181158
|
name: "delete_tag_category",
|
|
180867
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.",
|
|
180868
|
-
category:
|
|
181160
|
+
category: CATEGORY18,
|
|
180869
181161
|
inputSchema: deleteTagCategoryParamsJsonSchema,
|
|
180870
181162
|
handler: createToolHandler(
|
|
180871
181163
|
"delete_tag_category",
|
|
@@ -180876,7 +181168,7 @@ var tagCategoryTools = [
|
|
|
180876
181168
|
];
|
|
180877
181169
|
|
|
180878
181170
|
// src/huly/operations/test-management-core.ts
|
|
180879
|
-
var
|
|
181171
|
+
var import_core41 = __toESM(require_lib4(), 1);
|
|
180880
181172
|
|
|
180881
181173
|
// src/huly/test-management-classes.ts
|
|
180882
181174
|
var testManagement = {
|
|
@@ -181084,7 +181376,7 @@ var listTestProjects = (params) => Effect_exports.gen(function* () {
|
|
|
181084
181376
|
{},
|
|
181085
181377
|
{
|
|
181086
181378
|
limit,
|
|
181087
|
-
sort: { name:
|
|
181379
|
+
sort: { name: import_core41.SortingOrder.Ascending }
|
|
181088
181380
|
}
|
|
181089
181381
|
);
|
|
181090
181382
|
return {
|
|
@@ -181106,7 +181398,7 @@ var listTestSuites = (params) => Effect_exports.gen(function* () {
|
|
|
181106
181398
|
query,
|
|
181107
181399
|
{
|
|
181108
181400
|
limit,
|
|
181109
|
-
sort: { modifiedOn:
|
|
181401
|
+
sort: { modifiedOn: import_core41.SortingOrder.Descending }
|
|
181110
181402
|
}
|
|
181111
181403
|
);
|
|
181112
181404
|
return {
|
|
@@ -181139,7 +181431,7 @@ var createTestSuite = (params) => Effect_exports.gen(function* () {
|
|
|
181139
181431
|
if (existing !== void 0) {
|
|
181140
181432
|
return { id: TestSuiteId.make(existing._id), name: existing.name, created: false };
|
|
181141
181433
|
}
|
|
181142
|
-
const suiteId = (0,
|
|
181434
|
+
const suiteId = (0, import_core41.generateId)();
|
|
181143
181435
|
const suiteData = {
|
|
181144
181436
|
name: params.name,
|
|
181145
181437
|
description: params.description ?? "",
|
|
@@ -181209,7 +181501,7 @@ var listTestCases = (params) => Effect_exports.gen(function* () {
|
|
|
181209
181501
|
query,
|
|
181210
181502
|
{
|
|
181211
181503
|
limit,
|
|
181212
|
-
sort: { modifiedOn:
|
|
181504
|
+
sort: { modifiedOn: import_core41.SortingOrder.Descending }
|
|
181213
181505
|
}
|
|
181214
181506
|
);
|
|
181215
181507
|
return {
|
|
@@ -181237,7 +181529,7 @@ var createTestCase = (params) => Effect_exports.gen(function* () {
|
|
|
181237
181529
|
const client = yield* HulyClient;
|
|
181238
181530
|
const project3 = yield* findTestProject(client, params.project);
|
|
181239
181531
|
const suite = yield* findTestSuite(client, project3, params.suite);
|
|
181240
|
-
const caseId = (0,
|
|
181532
|
+
const caseId = (0, import_core41.generateId)();
|
|
181241
181533
|
const assigneeRef = params.assignee !== void 0 ? toRef((yield* resolveAssignee2(params.assignee))._id) : null;
|
|
181242
181534
|
const typeEnum = params.type !== void 0 ? stringToTestCaseType(params.type) ?? 0 /* Functional */ : 0 /* Functional */;
|
|
181243
181535
|
const priorityEnum = params.priority !== void 0 ? stringToTestCasePriority(params.priority) ?? 1 /* Medium */ : 1 /* Medium */;
|
|
@@ -181341,12 +181633,12 @@ var deleteTestCase = (params) => Effect_exports.gen(function* () {
|
|
|
181341
181633
|
});
|
|
181342
181634
|
|
|
181343
181635
|
// src/mcp/tools/test-management-core.ts
|
|
181344
|
-
var
|
|
181636
|
+
var CATEGORY19 = "test-management";
|
|
181345
181637
|
var testManagementCoreTools = [
|
|
181346
181638
|
{
|
|
181347
181639
|
name: "list_test_projects",
|
|
181348
181640
|
description: "List test management projects. Returns test projects sorted by name. These are separate from tracker projects.",
|
|
181349
|
-
category:
|
|
181641
|
+
category: CATEGORY19,
|
|
181350
181642
|
inputSchema: listTestProjectsParamsJsonSchema,
|
|
181351
181643
|
handler: createToolHandler(
|
|
181352
181644
|
"list_test_projects",
|
|
@@ -181357,7 +181649,7 @@ var testManagementCoreTools = [
|
|
|
181357
181649
|
{
|
|
181358
181650
|
name: "list_test_suites",
|
|
181359
181651
|
description: "List test suites in a test project. Accepts project ID or name. Optional parent filter for nested suites.",
|
|
181360
|
-
category:
|
|
181652
|
+
category: CATEGORY19,
|
|
181361
181653
|
inputSchema: listTestSuitesParamsJsonSchema,
|
|
181362
181654
|
handler: createToolHandler(
|
|
181363
181655
|
"list_test_suites",
|
|
@@ -181368,7 +181660,7 @@ var testManagementCoreTools = [
|
|
|
181368
181660
|
{
|
|
181369
181661
|
name: "get_test_suite",
|
|
181370
181662
|
description: "Get a single test suite by ID or name within a test project. Returns suite details and test case count.",
|
|
181371
|
-
category:
|
|
181663
|
+
category: CATEGORY19,
|
|
181372
181664
|
inputSchema: getTestSuiteParamsJsonSchema,
|
|
181373
181665
|
handler: createToolHandler(
|
|
181374
181666
|
"get_test_suite",
|
|
@@ -181379,7 +181671,7 @@ var testManagementCoreTools = [
|
|
|
181379
181671
|
{
|
|
181380
181672
|
name: "create_test_suite",
|
|
181381
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.",
|
|
181382
|
-
category:
|
|
181674
|
+
category: CATEGORY19,
|
|
181383
181675
|
inputSchema: createTestSuiteParamsJsonSchema,
|
|
181384
181676
|
handler: createToolHandler(
|
|
181385
181677
|
"create_test_suite",
|
|
@@ -181390,7 +181682,7 @@ var testManagementCoreTools = [
|
|
|
181390
181682
|
{
|
|
181391
181683
|
name: "update_test_suite",
|
|
181392
181684
|
description: "Update a test suite. Accepts suite ID or name. Only provided fields are modified.",
|
|
181393
|
-
category:
|
|
181685
|
+
category: CATEGORY19,
|
|
181394
181686
|
inputSchema: updateTestSuiteParamsJsonSchema,
|
|
181395
181687
|
handler: createToolHandler(
|
|
181396
181688
|
"update_test_suite",
|
|
@@ -181401,7 +181693,7 @@ var testManagementCoreTools = [
|
|
|
181401
181693
|
{
|
|
181402
181694
|
name: "delete_test_suite",
|
|
181403
181695
|
description: "Permanently delete a test suite. Accepts suite ID or name. This action cannot be undone.",
|
|
181404
|
-
category:
|
|
181696
|
+
category: CATEGORY19,
|
|
181405
181697
|
inputSchema: deleteTestSuiteParamsJsonSchema,
|
|
181406
181698
|
handler: createToolHandler(
|
|
181407
181699
|
"delete_test_suite",
|
|
@@ -181412,7 +181704,7 @@ var testManagementCoreTools = [
|
|
|
181412
181704
|
{
|
|
181413
181705
|
name: "list_test_cases",
|
|
181414
181706
|
description: "List test cases in a test project. Optional filters: suite (ID or name), assignee (name or email).",
|
|
181415
|
-
category:
|
|
181707
|
+
category: CATEGORY19,
|
|
181416
181708
|
inputSchema: listTestCasesParamsJsonSchema,
|
|
181417
181709
|
handler: createToolHandler(
|
|
181418
181710
|
"list_test_cases",
|
|
@@ -181423,7 +181715,7 @@ var testManagementCoreTools = [
|
|
|
181423
181715
|
{
|
|
181424
181716
|
name: "get_test_case",
|
|
181425
181717
|
description: "Get a single test case by ID or name within a test project.",
|
|
181426
|
-
category:
|
|
181718
|
+
category: CATEGORY19,
|
|
181427
181719
|
inputSchema: getTestCaseParamsJsonSchema,
|
|
181428
181720
|
handler: createToolHandler(
|
|
181429
181721
|
"get_test_case",
|
|
@@ -181434,7 +181726,7 @@ var testManagementCoreTools = [
|
|
|
181434
181726
|
{
|
|
181435
181727
|
name: "create_test_case",
|
|
181436
181728
|
description: "Create a test case attached to a suite. Requires project and suite. Defaults: type=functional, priority=medium, status=draft.",
|
|
181437
|
-
category:
|
|
181729
|
+
category: CATEGORY19,
|
|
181438
181730
|
inputSchema: createTestCaseParamsJsonSchema,
|
|
181439
181731
|
handler: createToolHandler(
|
|
181440
181732
|
"create_test_case",
|
|
@@ -181445,7 +181737,7 @@ var testManagementCoreTools = [
|
|
|
181445
181737
|
{
|
|
181446
181738
|
name: "update_test_case",
|
|
181447
181739
|
description: "Update a test case. Accepts test case ID or name. Only provided fields are modified. Set assignee to null to unassign.",
|
|
181448
|
-
category:
|
|
181740
|
+
category: CATEGORY19,
|
|
181449
181741
|
inputSchema: updateTestCaseParamsJsonSchema,
|
|
181450
181742
|
handler: createToolHandler(
|
|
181451
181743
|
"update_test_case",
|
|
@@ -181456,7 +181748,7 @@ var testManagementCoreTools = [
|
|
|
181456
181748
|
{
|
|
181457
181749
|
name: "delete_test_case",
|
|
181458
181750
|
description: "Permanently delete a test case. Accepts test case ID or name. This action cannot be undone.",
|
|
181459
|
-
category:
|
|
181751
|
+
category: CATEGORY19,
|
|
181460
181752
|
inputSchema: deleteTestCaseParamsJsonSchema,
|
|
181461
181753
|
handler: createToolHandler(
|
|
181462
181754
|
"delete_test_case",
|
|
@@ -181467,7 +181759,7 @@ var testManagementCoreTools = [
|
|
|
181467
181759
|
];
|
|
181468
181760
|
|
|
181469
181761
|
// src/huly/operations/test-management-plans.ts
|
|
181470
|
-
var
|
|
181762
|
+
var import_core42 = __toESM(require_lib4(), 1);
|
|
181471
181763
|
var toPlanSummary = (p) => ({
|
|
181472
181764
|
id: TestPlanId.make(p._id),
|
|
181473
181765
|
name: p.name
|
|
@@ -181485,7 +181777,7 @@ var listTestPlans = (params) => Effect_exports.gen(function* () {
|
|
|
181485
181777
|
const plans = yield* client.findAll(
|
|
181486
181778
|
testManagement.class.TestPlan,
|
|
181487
181779
|
{ space: project3._id },
|
|
181488
|
-
{ limit, sort: { modifiedOn:
|
|
181780
|
+
{ limit, sort: { modifiedOn: import_core42.SortingOrder.Descending } }
|
|
181489
181781
|
);
|
|
181490
181782
|
return { plans: plans.map(toPlanSummary), total: plans.total };
|
|
181491
181783
|
});
|
|
@@ -181520,7 +181812,7 @@ var createTestPlan = (params) => Effect_exports.gen(function* () {
|
|
|
181520
181812
|
if (existing !== void 0) {
|
|
181521
181813
|
return { id: TestPlanId.make(existing._id), name: existing.name, created: false };
|
|
181522
181814
|
}
|
|
181523
|
-
const planId = (0,
|
|
181815
|
+
const planId = (0, import_core42.generateId)();
|
|
181524
181816
|
const descRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
|
|
181525
181817
|
testManagement.class.TestPlan,
|
|
181526
181818
|
planId,
|
|
@@ -181602,7 +181894,7 @@ var removeTestPlanItem = (params) => Effect_exports.gen(function* () {
|
|
|
181602
181894
|
});
|
|
181603
181895
|
|
|
181604
181896
|
// src/huly/operations/test-management-runs.ts
|
|
181605
|
-
var
|
|
181897
|
+
var import_core43 = __toESM(require_lib4(), 1);
|
|
181606
181898
|
var BATCH_CONCURRENCY = 10;
|
|
181607
181899
|
var toRunSummary = (r) => ({
|
|
181608
181900
|
id: TestRunId.make(r._id),
|
|
@@ -181623,7 +181915,7 @@ var listTestRuns = (params) => Effect_exports.gen(function* () {
|
|
|
181623
181915
|
const runs = yield* client.findAll(
|
|
181624
181916
|
testManagement.class.TestRun,
|
|
181625
181917
|
{ space: project3._id },
|
|
181626
|
-
{ limit, sort: { modifiedOn:
|
|
181918
|
+
{ limit, sort: { modifiedOn: import_core43.SortingOrder.Descending } }
|
|
181627
181919
|
);
|
|
181628
181920
|
return { runs: runs.map(toRunSummary), total: runs.total };
|
|
181629
181921
|
});
|
|
@@ -181652,7 +181944,7 @@ var getTestRun = (params) => Effect_exports.gen(function* () {
|
|
|
181652
181944
|
var createTestRun = (params) => Effect_exports.gen(function* () {
|
|
181653
181945
|
const client = yield* HulyClient;
|
|
181654
181946
|
const project3 = yield* findTestProject(client, params.project);
|
|
181655
|
-
const runId = (0,
|
|
181947
|
+
const runId = (0, import_core43.generateId)();
|
|
181656
181948
|
const descRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
|
|
181657
181949
|
testManagement.class.TestRun,
|
|
181658
181950
|
runId,
|
|
@@ -181709,7 +182001,7 @@ var listTestResults = (params) => Effect_exports.gen(function* () {
|
|
|
181709
182001
|
const results = yield* client.findAll(
|
|
181710
182002
|
testManagement.class.TestResult,
|
|
181711
182003
|
{ attachedTo: run3._id },
|
|
181712
|
-
{ limit, sort: { modifiedOn:
|
|
182004
|
+
{ limit, sort: { modifiedOn: import_core43.SortingOrder.Descending } }
|
|
181713
182005
|
);
|
|
181714
182006
|
return { results: results.map(toResultSummary), total: results.total };
|
|
181715
182007
|
});
|
|
@@ -181810,7 +182102,7 @@ var runTestPlan = (params) => Effect_exports.gen(function* () {
|
|
|
181810
182102
|
}
|
|
181811
182103
|
return { item, tc };
|
|
181812
182104
|
}), { concurrency: BATCH_CONCURRENCY });
|
|
181813
|
-
const runId = (0,
|
|
182105
|
+
const runId = (0, import_core43.generateId)();
|
|
181814
182106
|
const runName = params.runName ?? `${plan.name} - Run`;
|
|
181815
182107
|
yield* client.createDoc(testManagement.class.TestRun, project3._id, {
|
|
181816
182108
|
name: runName,
|
|
@@ -181840,41 +182132,41 @@ var runTestPlan = (params) => Effect_exports.gen(function* () {
|
|
|
181840
182132
|
});
|
|
181841
182133
|
|
|
181842
182134
|
// src/mcp/tools/test-management-plans.ts
|
|
181843
|
-
var
|
|
182135
|
+
var CATEGORY20 = "test-management";
|
|
181844
182136
|
var testManagementPlansTools = [
|
|
181845
182137
|
// --- Test Plans ---
|
|
181846
182138
|
{
|
|
181847
182139
|
name: "list_test_plans",
|
|
181848
182140
|
description: "List test plans in a test management project. Returns plan names and IDs. Requires project ID or name.",
|
|
181849
|
-
category:
|
|
182141
|
+
category: CATEGORY20,
|
|
181850
182142
|
inputSchema: listTestPlansParamsJsonSchema,
|
|
181851
182143
|
handler: createToolHandler("list_test_plans", parseListTestPlansParams, listTestPlans)
|
|
181852
182144
|
},
|
|
181853
182145
|
{
|
|
181854
182146
|
name: "get_test_plan",
|
|
181855
182147
|
description: "Get test plan details including its items (test cases). Accepts plan ID or name within a project.",
|
|
181856
|
-
category:
|
|
182148
|
+
category: CATEGORY20,
|
|
181857
182149
|
inputSchema: getTestPlanParamsJsonSchema,
|
|
181858
182150
|
handler: createToolHandler("get_test_plan", parseGetTestPlanParams, getTestPlan)
|
|
181859
182151
|
},
|
|
181860
182152
|
{
|
|
181861
182153
|
name: "create_test_plan",
|
|
181862
182154
|
description: "Create a test plan in a project. Idempotent: returns existing plan if one with the same name exists (created=false).",
|
|
181863
|
-
category:
|
|
182155
|
+
category: CATEGORY20,
|
|
181864
182156
|
inputSchema: createTestPlanParamsJsonSchema,
|
|
181865
182157
|
handler: createToolHandler("create_test_plan", parseCreateTestPlanParams, createTestPlan)
|
|
181866
182158
|
},
|
|
181867
182159
|
{
|
|
181868
182160
|
name: "update_test_plan",
|
|
181869
182161
|
description: "Update a test plan's name or description. Only provided fields are modified. Pass description=null to clear.",
|
|
181870
|
-
category:
|
|
182162
|
+
category: CATEGORY20,
|
|
181871
182163
|
inputSchema: updateTestPlanParamsJsonSchema,
|
|
181872
182164
|
handler: createToolHandler("update_test_plan", parseUpdateTestPlanParams, updateTestPlan)
|
|
181873
182165
|
},
|
|
181874
182166
|
{
|
|
181875
182167
|
name: "delete_test_plan",
|
|
181876
182168
|
description: "Permanently delete a test plan. This does not delete associated test runs. Cannot be undone.",
|
|
181877
|
-
category:
|
|
182169
|
+
category: CATEGORY20,
|
|
181878
182170
|
inputSchema: deleteTestPlanParamsJsonSchema,
|
|
181879
182171
|
handler: createToolHandler("delete_test_plan", parseDeleteTestPlanParams, deleteTestPlan)
|
|
181880
182172
|
},
|
|
@@ -181882,14 +182174,14 @@ var testManagementPlansTools = [
|
|
|
181882
182174
|
{
|
|
181883
182175
|
name: "add_test_plan_item",
|
|
181884
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.",
|
|
181885
|
-
category:
|
|
182177
|
+
category: CATEGORY20,
|
|
181886
182178
|
inputSchema: addTestPlanItemParamsJsonSchema,
|
|
181887
182179
|
handler: createToolHandler("add_test_plan_item", parseAddTestPlanItemParams, addTestPlanItem)
|
|
181888
182180
|
},
|
|
181889
182181
|
{
|
|
181890
182182
|
name: "remove_test_plan_item",
|
|
181891
182183
|
description: "Remove a test case from a test plan by item ID. Get item IDs from get_test_plan.",
|
|
181892
|
-
category:
|
|
182184
|
+
category: CATEGORY20,
|
|
181893
182185
|
inputSchema: removeTestPlanItemParamsJsonSchema,
|
|
181894
182186
|
handler: createToolHandler("remove_test_plan_item", parseRemoveTestPlanItemParams, removeTestPlanItem)
|
|
181895
182187
|
},
|
|
@@ -181897,35 +182189,35 @@ var testManagementPlansTools = [
|
|
|
181897
182189
|
{
|
|
181898
182190
|
name: "list_test_runs",
|
|
181899
182191
|
description: "List test runs in a test management project. Returns run names, IDs, and due dates.",
|
|
181900
|
-
category:
|
|
182192
|
+
category: CATEGORY20,
|
|
181901
182193
|
inputSchema: listTestRunsParamsJsonSchema,
|
|
181902
182194
|
handler: createToolHandler("list_test_runs", parseListTestRunsParams, listTestRuns)
|
|
181903
182195
|
},
|
|
181904
182196
|
{
|
|
181905
182197
|
name: "get_test_run",
|
|
181906
182198
|
description: "Get test run details including all results. Accepts run ID or name within a project.",
|
|
181907
|
-
category:
|
|
182199
|
+
category: CATEGORY20,
|
|
181908
182200
|
inputSchema: getTestRunParamsJsonSchema,
|
|
181909
182201
|
handler: createToolHandler("get_test_run", parseGetTestRunParams, getTestRun)
|
|
181910
182202
|
},
|
|
181911
182203
|
{
|
|
181912
182204
|
name: "create_test_run",
|
|
181913
182205
|
description: "Create a test run in a project. For bulk creation from a plan, use run_test_plan instead.",
|
|
181914
|
-
category:
|
|
182206
|
+
category: CATEGORY20,
|
|
181915
182207
|
inputSchema: createTestRunParamsJsonSchema,
|
|
181916
182208
|
handler: createToolHandler("create_test_run", parseCreateTestRunParams, createTestRun)
|
|
181917
182209
|
},
|
|
181918
182210
|
{
|
|
181919
182211
|
name: "update_test_run",
|
|
181920
182212
|
description: "Update a test run's name, description, or due date. Only provided fields are modified. Pass null to clear optional fields.",
|
|
181921
|
-
category:
|
|
182213
|
+
category: CATEGORY20,
|
|
181922
182214
|
inputSchema: updateTestRunParamsJsonSchema,
|
|
181923
182215
|
handler: createToolHandler("update_test_run", parseUpdateTestRunParams, updateTestRun)
|
|
181924
182216
|
},
|
|
181925
182217
|
{
|
|
181926
182218
|
name: "delete_test_run",
|
|
181927
182219
|
description: "Permanently delete a test run. This does not delete associated test results. Cannot be undone.",
|
|
181928
|
-
category:
|
|
182220
|
+
category: CATEGORY20,
|
|
181929
182221
|
inputSchema: deleteTestRunParamsJsonSchema,
|
|
181930
182222
|
handler: createToolHandler("delete_test_run", parseDeleteTestRunParams, deleteTestRun)
|
|
181931
182223
|
},
|
|
@@ -181933,35 +182225,35 @@ var testManagementPlansTools = [
|
|
|
181933
182225
|
{
|
|
181934
182226
|
name: "list_test_results",
|
|
181935
182227
|
description: "List test results in a test run. Returns result names, statuses, and assignees.",
|
|
181936
|
-
category:
|
|
182228
|
+
category: CATEGORY20,
|
|
181937
182229
|
inputSchema: listTestResultsParamsJsonSchema,
|
|
181938
182230
|
handler: createToolHandler("list_test_results", parseListTestResultsParams, listTestResults)
|
|
181939
182231
|
},
|
|
181940
182232
|
{
|
|
181941
182233
|
name: "get_test_result",
|
|
181942
182234
|
description: "Get test result details. Accepts result ID or name.",
|
|
181943
|
-
category:
|
|
182235
|
+
category: CATEGORY20,
|
|
181944
182236
|
inputSchema: getTestResultParamsJsonSchema,
|
|
181945
182237
|
handler: createToolHandler("get_test_result", parseGetTestResultParams, getTestResult)
|
|
181946
182238
|
},
|
|
181947
182239
|
{
|
|
181948
182240
|
name: "create_test_result",
|
|
181949
182241
|
description: "Create a test result in a run. Resolves test case by ID or name. Status defaults to 'untested'.",
|
|
181950
|
-
category:
|
|
182242
|
+
category: CATEGORY20,
|
|
181951
182243
|
inputSchema: createTestResultParamsJsonSchema,
|
|
181952
182244
|
handler: createToolHandler("create_test_result", parseCreateTestResultParams, createTestResult)
|
|
181953
182245
|
},
|
|
181954
182246
|
{
|
|
181955
182247
|
name: "update_test_result",
|
|
181956
182248
|
description: "Update a test result's status, assignee, or description. Status values: untested, blocked, passed, failed.",
|
|
181957
|
-
category:
|
|
182249
|
+
category: CATEGORY20,
|
|
181958
182250
|
inputSchema: updateTestResultParamsJsonSchema,
|
|
181959
182251
|
handler: createToolHandler("update_test_result", parseUpdateTestResultParams, updateTestResult)
|
|
181960
182252
|
},
|
|
181961
182253
|
{
|
|
181962
182254
|
name: "delete_test_result",
|
|
181963
182255
|
description: "Permanently delete a test result. Cannot be undone.",
|
|
181964
|
-
category:
|
|
182256
|
+
category: CATEGORY20,
|
|
181965
182257
|
inputSchema: deleteTestResultParamsJsonSchema,
|
|
181966
182258
|
handler: createToolHandler("delete_test_result", parseDeleteTestResultParams, deleteTestResult)
|
|
181967
182259
|
},
|
|
@@ -181969,7 +182261,7 @@ var testManagementPlansTools = [
|
|
|
181969
182261
|
{
|
|
181970
182262
|
name: "run_test_plan",
|
|
181971
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.",
|
|
181972
|
-
category:
|
|
182264
|
+
category: CATEGORY20,
|
|
181973
182265
|
inputSchema: runTestPlanParamsJsonSchema,
|
|
181974
182266
|
annotations: {
|
|
181975
182267
|
title: "Run Test Plan",
|
|
@@ -181984,7 +182276,7 @@ var testManagementPlansTools = [
|
|
|
181984
182276
|
|
|
181985
182277
|
// src/huly/operations/time.ts
|
|
181986
182278
|
var import_calendar6 = __toESM(require_lib24(), 1);
|
|
181987
|
-
var
|
|
182279
|
+
var import_core44 = __toESM(require_lib4(), 1);
|
|
181988
182280
|
var import_tracker7 = __toESM(require_lib21(), 1);
|
|
181989
182281
|
var serverPopulatedCalendar = toRef("");
|
|
181990
182282
|
var serverPopulatedPersonId = "";
|
|
@@ -181994,7 +182286,7 @@ var logTime = (params) => Effect_exports.gen(function* () {
|
|
|
181994
182286
|
project: params.project,
|
|
181995
182287
|
identifier: params.identifier
|
|
181996
182288
|
});
|
|
181997
|
-
const reportId = (0,
|
|
182289
|
+
const reportId = (0, import_core44.generateId)();
|
|
181998
182290
|
const now2 = yield* Clock_exports.currentTimeMillis;
|
|
181999
182291
|
const reportData = {
|
|
182000
182292
|
employee: null,
|
|
@@ -182034,7 +182326,7 @@ var getTimeReport = (params) => Effect_exports.gen(function* () {
|
|
|
182034
182326
|
const reports = yield* client.findAll(
|
|
182035
182327
|
tracker.class.TimeSpendReport,
|
|
182036
182328
|
{ attachedTo: issue2._id },
|
|
182037
|
-
{ sort: { date:
|
|
182329
|
+
{ sort: { date: import_core44.SortingOrder.Descending } }
|
|
182038
182330
|
);
|
|
182039
182331
|
const employeeIds = [
|
|
182040
182332
|
...new Set(
|
|
@@ -182086,7 +182378,7 @@ var listTimeSpendReports = (params) => Effect_exports.gen(function* () {
|
|
|
182086
182378
|
tracker.class.TimeSpendReport,
|
|
182087
182379
|
query,
|
|
182088
182380
|
withLookup(
|
|
182089
|
-
{ limit, sort: { date:
|
|
182381
|
+
{ limit, sort: { date: import_core44.SortingOrder.Descending } },
|
|
182090
182382
|
{
|
|
182091
182383
|
attachedTo: tracker.class.Issue,
|
|
182092
182384
|
employee: contact.class.Person
|
|
@@ -182115,7 +182407,7 @@ var getDetailedTimeReport = (params) => Effect_exports.gen(function* () {
|
|
|
182115
182407
|
tracker.class.TimeSpendReport,
|
|
182116
182408
|
query,
|
|
182117
182409
|
withLookup(
|
|
182118
|
-
{ sort: { date:
|
|
182410
|
+
{ sort: { date: import_core44.SortingOrder.Descending } },
|
|
182119
182411
|
{
|
|
182120
182412
|
attachedTo: tracker.class.Issue,
|
|
182121
182413
|
employee: contact.class.Person
|
|
@@ -182191,7 +182483,7 @@ var listWorkSlots = (params) => Effect_exports.gen(function* () {
|
|
|
182191
182483
|
const slots = yield* client.findAll(
|
|
182192
182484
|
time.class.WorkSlot,
|
|
182193
182485
|
query,
|
|
182194
|
-
{ limit, sort: { date:
|
|
182486
|
+
{ limit, sort: { date: import_core44.SortingOrder.Descending } }
|
|
182195
182487
|
);
|
|
182196
182488
|
return slots.map((s) => ({
|
|
182197
182489
|
id: s._id,
|
|
@@ -182203,7 +182495,7 @@ var listWorkSlots = (params) => Effect_exports.gen(function* () {
|
|
|
182203
182495
|
});
|
|
182204
182496
|
var createWorkSlot = (params) => Effect_exports.gen(function* () {
|
|
182205
182497
|
const client = yield* HulyClient;
|
|
182206
|
-
const slotId = (0,
|
|
182498
|
+
const slotId = (0, import_core44.generateId)();
|
|
182207
182499
|
const slotData = {
|
|
182208
182500
|
date: params.date,
|
|
182209
182501
|
dueDate: params.dueDate,
|
|
@@ -182254,12 +182546,12 @@ var stopTimer = (params) => Effect_exports.gen(function* () {
|
|
|
182254
182546
|
});
|
|
182255
182547
|
|
|
182256
182548
|
// src/mcp/tools/time.ts
|
|
182257
|
-
var
|
|
182549
|
+
var CATEGORY21 = "time tracking";
|
|
182258
182550
|
var timeTools = [
|
|
182259
182551
|
{
|
|
182260
182552
|
name: "log_time",
|
|
182261
182553
|
description: "Log time spent on a Huly issue. Records a time entry with optional description. Time value is in minutes.",
|
|
182262
|
-
category:
|
|
182554
|
+
category: CATEGORY21,
|
|
182263
182555
|
inputSchema: logTimeParamsJsonSchema,
|
|
182264
182556
|
handler: createToolHandler(
|
|
182265
182557
|
"log_time",
|
|
@@ -182270,7 +182562,7 @@ var timeTools = [
|
|
|
182270
182562
|
{
|
|
182271
182563
|
name: "get_time_report",
|
|
182272
182564
|
description: "Get time tracking report for a specific Huly issue. Shows total time, estimation, remaining time, and all time entries.",
|
|
182273
|
-
category:
|
|
182565
|
+
category: CATEGORY21,
|
|
182274
182566
|
inputSchema: getTimeReportParamsJsonSchema,
|
|
182275
182567
|
handler: createToolHandler(
|
|
182276
182568
|
"get_time_report",
|
|
@@ -182281,7 +182573,7 @@ var timeTools = [
|
|
|
182281
182573
|
{
|
|
182282
182574
|
name: "list_time_spend_reports",
|
|
182283
182575
|
description: "List all time entries across issues. Supports filtering by project and date range. Returns entries sorted by date (newest first).",
|
|
182284
|
-
category:
|
|
182576
|
+
category: CATEGORY21,
|
|
182285
182577
|
inputSchema: listTimeSpendReportsParamsJsonSchema,
|
|
182286
182578
|
handler: createToolHandler(
|
|
182287
182579
|
"list_time_spend_reports",
|
|
@@ -182292,7 +182584,7 @@ var timeTools = [
|
|
|
182292
182584
|
{
|
|
182293
182585
|
name: "get_detailed_time_report",
|
|
182294
182586
|
description: "Get detailed time breakdown for a project. Shows total time grouped by issue and by employee. Supports date range filtering.",
|
|
182295
|
-
category:
|
|
182587
|
+
category: CATEGORY21,
|
|
182296
182588
|
inputSchema: getDetailedTimeReportParamsJsonSchema,
|
|
182297
182589
|
handler: createToolHandler(
|
|
182298
182590
|
"get_detailed_time_report",
|
|
@@ -182303,7 +182595,7 @@ var timeTools = [
|
|
|
182303
182595
|
{
|
|
182304
182596
|
name: "list_work_slots",
|
|
182305
182597
|
description: "List scheduled work slots. Shows planned time blocks attached to ToDos. Supports filtering by employee and date range.",
|
|
182306
|
-
category:
|
|
182598
|
+
category: CATEGORY21,
|
|
182307
182599
|
inputSchema: listWorkSlotsParamsJsonSchema,
|
|
182308
182600
|
handler: createToolHandler(
|
|
182309
182601
|
"list_work_slots",
|
|
@@ -182314,7 +182606,7 @@ var timeTools = [
|
|
|
182314
182606
|
{
|
|
182315
182607
|
name: "create_work_slot",
|
|
182316
182608
|
description: "Create a scheduled work slot. Attaches a time block to a ToDo for planning purposes.",
|
|
182317
|
-
category:
|
|
182609
|
+
category: CATEGORY21,
|
|
182318
182610
|
inputSchema: createWorkSlotParamsJsonSchema,
|
|
182319
182611
|
handler: createToolHandler(
|
|
182320
182612
|
"create_work_slot",
|
|
@@ -182325,7 +182617,7 @@ var timeTools = [
|
|
|
182325
182617
|
{
|
|
182326
182618
|
name: "start_timer",
|
|
182327
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.",
|
|
182328
|
-
category:
|
|
182620
|
+
category: CATEGORY21,
|
|
182329
182621
|
inputSchema: startTimerParamsJsonSchema,
|
|
182330
182622
|
handler: createToolHandler(
|
|
182331
182623
|
"start_timer",
|
|
@@ -182336,7 +182628,7 @@ var timeTools = [
|
|
|
182336
182628
|
{
|
|
182337
182629
|
name: "stop_timer",
|
|
182338
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.",
|
|
182339
|
-
category:
|
|
182631
|
+
category: CATEGORY21,
|
|
182340
182632
|
inputSchema: stopTimerParamsJsonSchema,
|
|
182341
182633
|
handler: createToolHandler(
|
|
182342
182634
|
"stop_timer",
|
|
@@ -182347,15 +182639,15 @@ var timeTools = [
|
|
|
182347
182639
|
];
|
|
182348
182640
|
|
|
182349
182641
|
// src/huly/operations/workspace.ts
|
|
182350
|
-
var
|
|
182642
|
+
var import_core45 = __toESM(require_lib4(), 1);
|
|
182351
182643
|
var accountRoleMap = {
|
|
182352
|
-
READONLYGUEST:
|
|
182353
|
-
DocGuest:
|
|
182354
|
-
GUEST:
|
|
182355
|
-
USER:
|
|
182356
|
-
MAINTAINER:
|
|
182357
|
-
OWNER:
|
|
182358
|
-
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
|
|
182359
182651
|
};
|
|
182360
182652
|
var toHulyAccountRole = (role) => accountRoleMap[role];
|
|
182361
182653
|
var formatVersion = (info) => `${info.versionMajor}.${info.versionMinor}.${info.versionPatch}`;
|
|
@@ -182507,12 +182799,12 @@ var getRegions = () => Effect_exports.gen(function* () {
|
|
|
182507
182799
|
});
|
|
182508
182800
|
|
|
182509
182801
|
// src/mcp/tools/workspace.ts
|
|
182510
|
-
var
|
|
182802
|
+
var CATEGORY22 = "workspace";
|
|
182511
182803
|
var workspaceTools = [
|
|
182512
182804
|
{
|
|
182513
182805
|
name: "list_workspace_members",
|
|
182514
182806
|
description: "List members in the current Huly workspace with their roles. Returns members with account IDs and roles.",
|
|
182515
|
-
category:
|
|
182807
|
+
category: CATEGORY22,
|
|
182516
182808
|
inputSchema: listWorkspaceMembersParamsJsonSchema,
|
|
182517
182809
|
handler: createWorkspaceToolHandler(
|
|
182518
182810
|
"list_workspace_members",
|
|
@@ -182523,7 +182815,7 @@ var workspaceTools = [
|
|
|
182523
182815
|
{
|
|
182524
182816
|
name: "update_member_role",
|
|
182525
182817
|
description: "Update a workspace member's role. Requires appropriate permissions. Valid roles: READONLYGUEST, DocGuest, GUEST, USER, MAINTAINER, OWNER, ADMIN.",
|
|
182526
|
-
category:
|
|
182818
|
+
category: CATEGORY22,
|
|
182527
182819
|
inputSchema: updateMemberRoleParamsJsonSchema,
|
|
182528
182820
|
handler: createWorkspaceToolHandler(
|
|
182529
182821
|
"update_member_role",
|
|
@@ -182534,7 +182826,7 @@ var workspaceTools = [
|
|
|
182534
182826
|
{
|
|
182535
182827
|
name: "get_workspace_info",
|
|
182536
182828
|
description: "Get information about the current workspace including name, URL, region, and settings.",
|
|
182537
|
-
category:
|
|
182829
|
+
category: CATEGORY22,
|
|
182538
182830
|
inputSchema: emptyParamsJsonSchema,
|
|
182539
182831
|
handler: createNoParamsWorkspaceToolHandler(
|
|
182540
182832
|
getWorkspaceInfo
|
|
@@ -182543,7 +182835,7 @@ var workspaceTools = [
|
|
|
182543
182835
|
{
|
|
182544
182836
|
name: "list_workspaces",
|
|
182545
182837
|
description: "List all workspaces accessible to the current user. Returns workspace summaries sorted by last visit.",
|
|
182546
|
-
category:
|
|
182838
|
+
category: CATEGORY22,
|
|
182547
182839
|
inputSchema: listWorkspacesParamsJsonSchema,
|
|
182548
182840
|
handler: createWorkspaceToolHandler(
|
|
182549
182841
|
"list_workspaces",
|
|
@@ -182554,7 +182846,7 @@ var workspaceTools = [
|
|
|
182554
182846
|
{
|
|
182555
182847
|
name: "create_workspace",
|
|
182556
182848
|
description: "Create a new Huly workspace. Returns the workspace UUID and URL. Optionally specify a region.",
|
|
182557
|
-
category:
|
|
182849
|
+
category: CATEGORY22,
|
|
182558
182850
|
inputSchema: createWorkspaceParamsJsonSchema,
|
|
182559
182851
|
handler: createWorkspaceToolHandler(
|
|
182560
182852
|
"create_workspace",
|
|
@@ -182565,7 +182857,7 @@ var workspaceTools = [
|
|
|
182565
182857
|
{
|
|
182566
182858
|
name: "delete_workspace",
|
|
182567
182859
|
description: "Permanently delete the current workspace. This action cannot be undone. Use with extreme caution.",
|
|
182568
|
-
category:
|
|
182860
|
+
category: CATEGORY22,
|
|
182569
182861
|
inputSchema: emptyParamsJsonSchema,
|
|
182570
182862
|
handler: createNoParamsWorkspaceToolHandler(
|
|
182571
182863
|
deleteWorkspace
|
|
@@ -182574,7 +182866,7 @@ var workspaceTools = [
|
|
|
182574
182866
|
{
|
|
182575
182867
|
name: "get_user_profile",
|
|
182576
182868
|
description: "Get the current user's profile information including bio, location, and social links.",
|
|
182577
|
-
category:
|
|
182869
|
+
category: CATEGORY22,
|
|
182578
182870
|
inputSchema: emptyParamsJsonSchema,
|
|
182579
182871
|
handler: createNoParamsWorkspaceToolHandler(
|
|
182580
182872
|
getUserProfile
|
|
@@ -182583,7 +182875,7 @@ var workspaceTools = [
|
|
|
182583
182875
|
{
|
|
182584
182876
|
name: "update_user_profile",
|
|
182585
182877
|
description: "Update the current user's profile. Supports bio, city, country, website, social links, and public visibility.",
|
|
182586
|
-
category:
|
|
182878
|
+
category: CATEGORY22,
|
|
182587
182879
|
inputSchema: updateUserProfileParamsJsonSchema,
|
|
182588
182880
|
handler: createWorkspaceToolHandler(
|
|
182589
182881
|
"update_user_profile",
|
|
@@ -182594,7 +182886,7 @@ var workspaceTools = [
|
|
|
182594
182886
|
{
|
|
182595
182887
|
name: "update_guest_settings",
|
|
182596
182888
|
description: "Update workspace guest settings. Control read-only guest access and guest sign-up permissions.",
|
|
182597
|
-
category:
|
|
182889
|
+
category: CATEGORY22,
|
|
182598
182890
|
inputSchema: updateGuestSettingsParamsJsonSchema,
|
|
182599
182891
|
handler: createWorkspaceToolHandler(
|
|
182600
182892
|
"update_guest_settings",
|
|
@@ -182605,7 +182897,7 @@ var workspaceTools = [
|
|
|
182605
182897
|
{
|
|
182606
182898
|
name: "get_regions",
|
|
182607
182899
|
description: "Get available regions for workspace creation. Returns region codes and display names.",
|
|
182608
|
-
category:
|
|
182900
|
+
category: CATEGORY22,
|
|
182609
182901
|
inputSchema: getRegionsParamsJsonSchema,
|
|
182610
182902
|
handler: createWorkspaceToolHandler(
|
|
182611
182903
|
"get_regions",
|
|
@@ -182630,6 +182922,7 @@ var allTools = [
|
|
|
182630
182922
|
...contactTools,
|
|
182631
182923
|
...channelTools,
|
|
182632
182924
|
...cardTools,
|
|
182925
|
+
...customFieldTools,
|
|
182633
182926
|
...calendarTools,
|
|
182634
182927
|
...timeTools,
|
|
182635
182928
|
...searchTools,
|