@firfi/huly-mcp 0.1.49 → 0.1.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -31019,7 +31019,7 @@ var require_utils2 = __commonJS({
31019
31019
  escapeLikeForRegexp: () => escapeLikeForRegexp,
31020
31020
  fillConfiguration: () => fillConfiguration,
31021
31021
  fillDefaults: () => fillDefaults,
31022
- generateId: () => generateId20,
31022
+ generateId: () => generateId21,
31023
31023
  generateUuid: () => generateUuid,
31024
31024
  getBranding: () => getBranding,
31025
31025
  getCurrentAccount: () => getCurrentAccount,
@@ -31080,10 +31080,10 @@ var require_utils2 = __commonJS({
31080
31080
  return toHex(val, 6);
31081
31081
  }
31082
31082
  __name(count3, "count");
31083
- function generateId20(join4 = "") {
31083
+ function generateId21(join4 = "") {
31084
31084
  return timestamp() + join4 + random4 + join4 + count3();
31085
31085
  }
31086
- __name(generateId20, "generateId");
31086
+ __name(generateId21, "generateId");
31087
31087
  function generateUuid() {
31088
31088
  return crypto.randomUUID();
31089
31089
  }
@@ -34037,15 +34037,15 @@ var require_storage = __commonJS({
34037
34037
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
34038
34038
  var storage_exports = {};
34039
34039
  __export2(storage_exports, {
34040
- SortingOrder: () => SortingOrder23,
34040
+ SortingOrder: () => SortingOrder24,
34041
34041
  shouldShowArchived: () => shouldShowArchived
34042
34042
  });
34043
34043
  module2.exports = __toCommonJS2(storage_exports);
34044
- var SortingOrder23 = /* @__PURE__ */ ((SortingOrder24) => {
34045
- SortingOrder24[SortingOrder24["Ascending"] = 1] = "Ascending";
34046
- SortingOrder24[SortingOrder24["Descending"] = -1] = "Descending";
34047
- return SortingOrder24;
34048
- })(SortingOrder23 || {});
34044
+ var SortingOrder24 = /* @__PURE__ */ ((SortingOrder25) => {
34045
+ SortingOrder25[SortingOrder25["Ascending"] = 1] = "Ascending";
34046
+ SortingOrder25[SortingOrder25["Descending"] = -1] = "Descending";
34047
+ return SortingOrder25;
34048
+ })(SortingOrder24 || {});
34049
34049
  function shouldShowArchived(query, options) {
34050
34050
  if (options?.showArchived !== void 0) {
34051
34051
  return options.showArchived;
@@ -34475,7 +34475,7 @@ var require_client3 = __commonJS({
34475
34475
  getClient: () => getClient
34476
34476
  });
34477
34477
  module2.exports = __toCommonJS2(client_exports);
34478
- var import_core42 = require_lib4();
34478
+ var import_core44 = require_lib4();
34479
34479
  var import_platform2 = __toESM2(require_lib());
34480
34480
  var import_utils14 = require_utils3();
34481
34481
  function getClient(accountsUrl, token, retryTimeoutMs) {
@@ -34511,7 +34511,7 @@ var require_client3 = __commonJS({
34511
34511
  rpc;
34512
34512
  async getProviders() {
34513
34513
  return await withRetryUntilMaxAttempts(async () => {
34514
- const response = await fetch((0, import_core42.concatLink)(this.url, "/providers"));
34514
+ const response = await fetch((0, import_core44.concatLink)(this.url, "/providers"));
34515
34515
  return await response.json();
34516
34516
  })();
34517
34517
  }
@@ -35152,7 +35152,7 @@ var require_client3 = __commonJS({
35152
35152
  await this.rpc(request2);
35153
35153
  }
35154
35154
  async setCookie() {
35155
- const url4 = (0, import_core42.concatLink)(this.url, "/cookie");
35155
+ const url4 = (0, import_core44.concatLink)(this.url, "/cookie");
35156
35156
  const response = await fetch(url4, { ...this.request, method: "PUT" });
35157
35157
  if (!response.ok) {
35158
35158
  const result = await response.json();
@@ -35162,7 +35162,7 @@ var require_client3 = __commonJS({
35162
35162
  }
35163
35163
  }
35164
35164
  async deleteCookie() {
35165
- const url4 = (0, import_core42.concatLink)(this.url, "/cookie");
35165
+ const url4 = (0, import_core44.concatLink)(this.url, "/cookie");
35166
35166
  const response = await fetch(url4, { ...this.request, method: "DELETE" });
35167
35167
  if (!response.ok) {
35168
35168
  const result = await response.json();
@@ -35412,9 +35412,9 @@ var require_config = __commonJS({
35412
35412
  loadServerConfig: () => loadServerConfig4
35413
35413
  });
35414
35414
  module2.exports = __toCommonJS2(config_exports3);
35415
- var import_core42 = require_lib4();
35415
+ var import_core44 = require_lib4();
35416
35416
  async function loadServerConfig4(url4) {
35417
- const configUrl = (0, import_core42.concatLink)(url4, "/config.json");
35417
+ const configUrl = (0, import_core44.concatLink)(url4, "/config.json");
35418
35418
  const res = await fetch(configUrl, { keepalive: true });
35419
35419
  if (res.ok) {
35420
35420
  return await res.json();
@@ -35500,7 +35500,7 @@ var require_client4 = __commonJS({
35500
35500
  getClient: () => getClient
35501
35501
  });
35502
35502
  module2.exports = __toCommonJS2(client_exports);
35503
- var import_core42 = require_lib4();
35503
+ var import_core44 = require_lib4();
35504
35504
  var import_utils14 = require_utils4();
35505
35505
  function getClient(workspaceId, token, collaboratorUrl) {
35506
35506
  const url4 = collaboratorUrl.replaceAll("wss://", "https://").replace("ws://", "http://");
@@ -35519,7 +35519,7 @@ var require_client4 = __commonJS({
35519
35519
  async rpc(document2, method, payload) {
35520
35520
  const workspace = this.workspace;
35521
35521
  const documentId = (0, import_utils14.encodeDocumentId)(workspace, document2);
35522
- const url4 = (0, import_core42.concatLink)(this.collaboratorUrl, `/rpc/${encodeURIComponent(documentId)}`);
35522
+ const url4 = (0, import_core44.concatLink)(this.collaboratorUrl, `/rpc/${encodeURIComponent(documentId)}`);
35523
35523
  const res = await fetch(url4, {
35524
35524
  method: "POST",
35525
35525
  headers: {
@@ -53086,9 +53086,9 @@ var require_image = __commonJS({
53086
53086
  ImageNode: () => ImageNode
53087
53087
  });
53088
53088
  module2.exports = __toCommonJS2(image_exports);
53089
- var import_core42 = require_dist16();
53089
+ var import_core44 = require_dist16();
53090
53090
  var import_utils14 = require_utils5();
53091
- var ImageNode = import_core42.Node.create({
53091
+ var ImageNode = import_core44.Node.create({
53092
53092
  name: "image",
53093
53093
  addOptions() {
53094
53094
  return {
@@ -53147,7 +53147,7 @@ var require_image = __commonJS({
53147
53147
  "data-type": this.name,
53148
53148
  "data-align": node.attrs.align
53149
53149
  };
53150
- const imgAttributes = (0, import_core42.mergeAttributes)(
53150
+ const imgAttributes = (0, import_core44.mergeAttributes)(
53151
53151
  {
53152
53152
  "data-type": this.name
53153
53153
  },
@@ -53191,9 +53191,9 @@ var require_reference = __commonJS({
53191
53191
  ReferenceNode: () => ReferenceNode
53192
53192
  });
53193
53193
  module2.exports = __toCommonJS2(reference_exports);
53194
- var import_core42 = require_dist16();
53194
+ var import_core44 = require_dist16();
53195
53195
  var import_utils14 = require_utils5();
53196
- var ReferenceNode = import_core42.Node.create({
53196
+ var ReferenceNode = import_core44.Node.create({
53197
53197
  name: "reference",
53198
53198
  group: "inline",
53199
53199
  inline: true,
@@ -53228,7 +53228,7 @@ var require_reference = __commonJS({
53228
53228
  renderHTML({ node, HTMLAttributes }) {
53229
53229
  return [
53230
53230
  "span",
53231
- (0, import_core42.mergeAttributes)(
53231
+ (0, import_core44.mergeAttributes)(
53232
53232
  {
53233
53233
  "data-type": this.name,
53234
53234
  "data-id": node.attrs.id,
@@ -53287,8 +53287,8 @@ var require_emoji = __commonJS({
53287
53287
  EmojiNode: () => EmojiNode
53288
53288
  });
53289
53289
  module2.exports = __toCommonJS2(emoji_exports);
53290
- var import_core42 = require_dist16();
53291
- var EmojiNode = import_core42.Node.create({
53290
+ var import_core44 = require_dist16();
53291
+ var EmojiNode = import_core44.Node.create({
53292
53292
  name: "emoji",
53293
53293
  group: "inline",
53294
53294
  inline: true,
@@ -53328,7 +53328,7 @@ var require_emoji = __commonJS({
53328
53328
  addNodeView() {
53329
53329
  return ({ node, HTMLAttributes }) => {
53330
53330
  const container = document.createElement("span");
53331
- const containerAttributes = (0, import_core42.mergeAttributes)(
53331
+ const containerAttributes = (0, import_core44.mergeAttributes)(
53332
53332
  {
53333
53333
  "data-type": this.name,
53334
53334
  class: "emoji"
@@ -53361,7 +53361,7 @@ var require_emoji = __commonJS({
53361
53361
  if (node.attrs.kind === "image") {
53362
53362
  return [
53363
53363
  "span",
53364
- (0, import_core42.mergeAttributes)(
53364
+ (0, import_core44.mergeAttributes)(
53365
53365
  {
53366
53366
  "data-type": this.name,
53367
53367
  class: "emoji"
@@ -53370,7 +53370,7 @@ var require_emoji = __commonJS({
53370
53370
  ),
53371
53371
  [
53372
53372
  "img",
53373
- (0, import_core42.mergeAttributes)({
53373
+ (0, import_core44.mergeAttributes)({
53374
53374
  "data-type": this.name,
53375
53375
  src: node.attrs.image,
53376
53376
  alt: node.attrs.emoji
@@ -53380,7 +53380,7 @@ var require_emoji = __commonJS({
53380
53380
  }
53381
53381
  return [
53382
53382
  "span",
53383
- (0, import_core42.mergeAttributes)(
53383
+ (0, import_core44.mergeAttributes)(
53384
53384
  {
53385
53385
  "data-type": this.name,
53386
53386
  class: "emoji"
@@ -53688,8 +53688,8 @@ var require_file = __commonJS({
53688
53688
  FileNode: () => FileNode
53689
53689
  });
53690
53690
  module2.exports = __toCommonJS2(file_exports);
53691
- var import_core42 = require_dist16();
53692
- var FileNode = import_core42.Node.create({
53691
+ var import_core44 = require_dist16();
53692
+ var FileNode = import_core44.Node.create({
53693
53693
  name: "file",
53694
53694
  addOptions() {
53695
53695
  return {
@@ -53999,7 +53999,7 @@ var require_codeblock = __commonJS({
53999
53999
  tildeInputRegex: () => tildeInputRegex
54000
54000
  });
54001
54001
  module2.exports = __toCommonJS2(codeblock_exports);
54002
- var import_core42 = require_dist16();
54002
+ var import_core44 = require_dist16();
54003
54003
  var import_extension_code_block = __toESM2(require_dist19());
54004
54004
  var codeBlockOptions = {
54005
54005
  defaultLanguage: "plaintext",
@@ -54045,11 +54045,11 @@ var require_codeblock = __commonJS({
54045
54045
  },
54046
54046
  addInputRules() {
54047
54047
  return [
54048
- (0, import_core42.textblockTypeInputRule)({
54048
+ (0, import_core44.textblockTypeInputRule)({
54049
54049
  find: backtickInputRegex,
54050
54050
  type: this.type
54051
54051
  }),
54052
- (0, import_core42.textblockTypeInputRule)({
54052
+ (0, import_core44.textblockTypeInputRule)({
54053
54053
  find: tildeInputRegex,
54054
54054
  type: this.type
54055
54055
  })
@@ -54085,8 +54085,8 @@ var require_comment = __commonJS({
54085
54085
  CommentNode: () => CommentNode
54086
54086
  });
54087
54087
  module2.exports = __toCommonJS2(comment_exports);
54088
- var import_core42 = require_dist16();
54089
- var CommentNode = import_core42.Node.create({
54088
+ var import_core44 = require_dist16();
54089
+ var CommentNode = import_core44.Node.create({
54090
54090
  name: "comment",
54091
54091
  group: "inline",
54092
54092
  inline: true,
@@ -54132,8 +54132,8 @@ var require_markdown = __commonJS({
54132
54132
  MarkdownNode: () => MarkdownNode
54133
54133
  });
54134
54134
  module2.exports = __toCommonJS2(markdown_exports);
54135
- var import_core42 = require_dist16();
54136
- var MarkdownNode = import_core42.Node.create({
54135
+ var import_core44 = require_dist16();
54136
+ var MarkdownNode = import_core44.Node.create({
54137
54137
  name: "markdown",
54138
54138
  group: "block",
54139
54139
  content: "text*",
@@ -54151,7 +54151,7 @@ var require_markdown = __commonJS({
54151
54151
  renderHTML({ node, HTMLAttributes }) {
54152
54152
  return [
54153
54153
  "pre",
54154
- (0, import_core42.mergeAttributes)({ "data-type": this.name }, this.options.HTMLAttributes, HTMLAttributes),
54154
+ (0, import_core44.mergeAttributes)({ "data-type": this.name }, this.options.HTMLAttributes, HTMLAttributes),
54155
54155
  ["code", {}, 0]
54156
54156
  ];
54157
54157
  }
@@ -54185,8 +54185,8 @@ var require_embed = __commonJS({
54185
54185
  EmbedNode: () => EmbedNode
54186
54186
  });
54187
54187
  module2.exports = __toCommonJS2(embed_exports);
54188
- var import_core42 = require_dist16();
54189
- var EmbedNode = import_core42.Node.create({
54188
+ var import_core44 = require_dist16();
54189
+ var EmbedNode = import_core44.Node.create({
54190
54190
  name: "embed",
54191
54191
  addOptions() {
54192
54192
  return {};
@@ -54211,7 +54211,7 @@ var require_embed = __commonJS({
54211
54211
  ];
54212
54212
  },
54213
54213
  renderHTML({ HTMLAttributes }) {
54214
- return ["figure", { "data-type": this.name }, ["iframe", (0, import_core42.mergeAttributes)(HTMLAttributes)]];
54214
+ return ["figure", { "data-type": this.name }, ["iframe", (0, import_core44.mergeAttributes)(HTMLAttributes)]];
54215
54215
  }
54216
54216
  });
54217
54217
  }
@@ -54285,7 +54285,7 @@ var require_noteBase = __commonJS({
54285
54285
  name: () => name
54286
54286
  });
54287
54287
  module2.exports = __toCommonJS2(noteBase_exports);
54288
- var import_core42 = require_dist16();
54288
+ var import_core44 = require_dist16();
54289
54289
  var import_nodes = require_nodes();
54290
54290
  var name = "note";
54291
54291
  var NoteKind = /* @__PURE__ */ ((NoteKind2) => {
@@ -54300,7 +54300,7 @@ var require_noteBase = __commonJS({
54300
54300
  NoteKind2["PrimaryLight"] = "primary-light";
54301
54301
  return NoteKind2;
54302
54302
  })(NoteKind || {});
54303
- var NoteBaseExtension = import_core42.Mark.create({
54303
+ var NoteBaseExtension = import_core44.Mark.create({
54304
54304
  name,
54305
54305
  parseHTML() {
54306
54306
  return [
@@ -54357,9 +54357,9 @@ var require_qmsInlineCommentMark = __commonJS({
54357
54357
  QMSInlineCommentMark: () => QMSInlineCommentMark
54358
54358
  });
54359
54359
  module2.exports = __toCommonJS2(qmsInlineCommentMark_exports);
54360
- var import_core42 = require_dist16();
54360
+ var import_core44 = require_dist16();
54361
54361
  var NAME2 = "node-uuid";
54362
- var QMSInlineCommentMark = import_core42.Mark.create({
54362
+ var QMSInlineCommentMark = import_core44.Mark.create({
54363
54363
  name: NAME2,
54364
54364
  inline: true,
54365
54365
  parseHTML() {
@@ -54404,9 +54404,9 @@ var require_kit = __commonJS({
54404
54404
  mergeKitOptions: () => mergeKitOptions
54405
54405
  });
54406
54406
  module2.exports = __toCommonJS2(kit_exports);
54407
- var import_core42 = require_dist16();
54407
+ var import_core44 = require_dist16();
54408
54408
  function extensionKit(name, fn2) {
54409
- return import_core42.Extension.create({
54409
+ return import_core44.Extension.create({
54410
54410
  name,
54411
54411
  addExtensions() {
54412
54412
  const e = /* @__PURE__ */ __name((extension, options) => {
@@ -61435,9 +61435,9 @@ var require_colors = __commonJS({
61435
61435
  TextColor: () => TextColor
61436
61436
  });
61437
61437
  module2.exports = __toCommonJS2(colors_exports);
61438
- var import_core42 = require_dist16();
61438
+ var import_core44 = require_dist16();
61439
61439
  var import_extension_text_style = require_dist20();
61440
- var BackgroundColor = import_core42.Extension.create({
61440
+ var BackgroundColor = import_core44.Extension.create({
61441
61441
  name: "backgroundColor",
61442
61442
  addOptions() {
61443
61443
  return {
@@ -61478,7 +61478,7 @@ var require_colors = __commonJS({
61478
61478
  };
61479
61479
  }
61480
61480
  });
61481
- var TextColor = import_core42.Extension.create({
61481
+ var TextColor = import_core44.Extension.create({
61482
61482
  name: "textColor",
61483
61483
  addOptions() {
61484
61484
  return {
@@ -61550,10 +61550,10 @@ var require_inlineComment = __commonJS({
61550
61550
  InlineCommentPasteFixPlugin: () => InlineCommentPasteFixPlugin
61551
61551
  });
61552
61552
  module2.exports = __toCommonJS2(inlineComment_exports);
61553
- var import_core42 = require_dist16();
61553
+ var import_core44 = require_dist16();
61554
61554
  var import_model = require_dist10();
61555
61555
  var import_state = require_dist5();
61556
- var InlineCommentMark = import_core42.Mark.create({
61556
+ var InlineCommentMark = import_core44.Mark.create({
61557
61557
  name: "inline-comment",
61558
61558
  excludes: "",
61559
61559
  inclusive: false,
@@ -77071,7 +77071,7 @@ var require_client5 = __commonJS({
77071
77071
  createMarkupOperations: () => createMarkupOperations
77072
77072
  });
77073
77073
  module2.exports = __toCommonJS2(client_exports);
77074
- var import_core42 = require_lib4();
77074
+ var import_core44 = require_lib4();
77075
77075
  var import_collaborator_client2 = require_lib7();
77076
77076
  var import_text3 = require_lib9();
77077
77077
  var import_text_markdown3 = require_lib17();
@@ -77085,8 +77085,8 @@ var require_client5 = __commonJS({
77085
77085
  this.workspace = workspace;
77086
77086
  this.token = token;
77087
77087
  this.config = config3;
77088
- this.refUrl = (0, import_core42.concatLink)(this.url, `/browse?workspace=${workspace}`);
77089
- this.imageUrl = (0, import_core42.concatLink)(this.url, `/files?workspace=${workspace}&file=`);
77088
+ this.refUrl = (0, import_core44.concatLink)(this.url, `/browse?workspace=${workspace}`);
77089
+ this.imageUrl = (0, import_core44.concatLink)(this.url, `/files?workspace=${workspace}&file=`);
77090
77090
  this.collaborator = (0, import_collaborator_client2.getClient)(workspace, token, config3.COLLABORATOR_URL);
77091
77091
  }
77092
77092
  static {
@@ -77096,7 +77096,7 @@ var require_client5 = __commonJS({
77096
77096
  imageUrl;
77097
77097
  refUrl;
77098
77098
  async fetchMarkup(objectClass, objectId, objectAttr, doc, format7) {
77099
- const collabId = (0, import_core42.makeCollabId)(objectClass, objectId, objectAttr);
77099
+ const collabId = (0, import_core44.makeCollabId)(objectClass, objectId, objectAttr);
77100
77100
  const markup = await this.collaborator.getMarkup(collabId, doc);
77101
77101
  const json3 = (0, import_text3.markupToJSON)(markup);
77102
77102
  switch (format7) {
@@ -77125,7 +77125,7 @@ var require_client5 = __commonJS({
77125
77125
  default:
77126
77126
  throw new Error("Unknown content format");
77127
77127
  }
77128
- const collabId = (0, import_core42.makeCollabId)(objectClass, objectId, objectAttr);
77128
+ const collabId = (0, import_core44.makeCollabId)(objectClass, objectId, objectAttr);
77129
77129
  return await this.collaborator.createMarkup(collabId, markup);
77130
77130
  }
77131
77131
  };
@@ -81609,8 +81609,8 @@ var require_connection2 = __commonJS({
81609
81609
  });
81610
81610
  module2.exports = __toCommonJS2(connection_exports);
81611
81611
  var import_analytics = require_lib2();
81612
- var import_client23 = __toESM2(require_lib6());
81613
- var import_core42 = __toESM2(require_lib4());
81612
+ var import_client24 = __toESM2(require_lib6());
81613
+ var import_core44 = __toESM2(require_lib4());
81614
81614
  var import_platform2 = __toESM2(require_lib());
81615
81615
  var import_rpc = require_lib18();
81616
81616
  var import_snappyjs = require_snappyjs();
@@ -81654,7 +81654,7 @@ var require_connection2 = __commonJS({
81654
81654
  const sKey = "session.id." + this.url;
81655
81655
  let sessionId = sessionStorage.getItem(sKey) ?? void 0;
81656
81656
  if (sessionId === void 0) {
81657
- sessionId = (0, import_core42.generateId)();
81657
+ sessionId = (0, import_core44.generateId)();
81658
81658
  console.log("Generate new SessionId", sessionId);
81659
81659
  this.sessionId = sessionId;
81660
81660
  } else {
@@ -81665,7 +81665,7 @@ var require_connection2 = __commonJS({
81665
81665
  sessionStorage.setItem(sKey, sessionId);
81666
81666
  });
81667
81667
  } else {
81668
- this.sessionId = (0, import_core42.generateId)();
81668
+ this.sessionId = (0, import_core44.generateId)();
81669
81669
  }
81670
81670
  this.rpcHandler = opt?.useGlobalRPCHandler === true ? globalRPCHandler : new import_rpc.RPCHandler();
81671
81671
  this.pushHandler(handler);
@@ -81720,7 +81720,7 @@ var require_connection2 = __commonJS({
81720
81720
  }
81721
81721
  if (!this.closed) {
81722
81722
  void this.sendRequest({
81723
- method: import_client23.pingConst,
81723
+ method: import_client24.pingConst,
81724
81724
  params: [],
81725
81725
  once: true,
81726
81726
  handleResult: /* @__PURE__ */ __name(async (result) => {
@@ -81753,7 +81753,7 @@ var require_connection2 = __commonJS({
81753
81753
  }
81754
81754
  }
81755
81755
  isConnected() {
81756
- return this.websocket != null && this.websocket.readyState === import_client23.ClientSocketReadyState.OPEN && this.helloReceived;
81756
+ return this.websocket != null && this.websocket.readyState === import_client24.ClientSocketReadyState.OPEN && this.helloReceived;
81757
81757
  }
81758
81758
  delay = 0;
81759
81759
  onConnectHandlers = [];
@@ -81845,7 +81845,7 @@ var require_connection2 = __commonJS({
81845
81845
  if (resp.id === -1) {
81846
81846
  this.delay = 0;
81847
81847
  if (resp.result?.state === "upgrading") {
81848
- void this.onConnect?.(import_core42.ClientConnectEvent.Maintenance, void 0, resp.result.stats);
81848
+ void this.onConnect?.(import_core44.ClientConnectEvent.Maintenance, void 0, resp.result.stats);
81849
81849
  this.upgrading = true;
81850
81850
  this.delay = 3;
81851
81851
  return;
@@ -81880,7 +81880,7 @@ var require_connection2 = __commonJS({
81880
81880
  v.reconnect?.();
81881
81881
  }
81882
81882
  void this.onConnect?.(
81883
- helloResp.reconnect === true ? import_core42.ClientConnectEvent.Reconnected : import_core42.ClientConnectEvent.Connected,
81883
+ helloResp.reconnect === true ? import_core44.ClientConnectEvent.Reconnected : import_core44.ClientConnectEvent.Connected,
81884
81884
  helloResp.lastTx,
81885
81885
  this.sessionId
81886
81886
  )?.catch((err) => {
@@ -81893,8 +81893,8 @@ var require_connection2 = __commonJS({
81893
81893
  }
81894
81894
  return;
81895
81895
  }
81896
- if (resp.result === import_client23.pingConst) {
81897
- void this.sendRequest({ method: import_client23.pingConst, params: [] }).catch((err) => {
81896
+ if (resp.result === import_client24.pingConst) {
81897
+ void this.sendRequest({ method: import_client24.pingConst, params: [] }).catch((err) => {
81898
81898
  this.ctx.error("failed to send ping", { err });
81899
81899
  });
81900
81900
  return;
@@ -81930,7 +81930,7 @@ var require_connection2 = __commonJS({
81930
81930
  }
81931
81931
  result = result.concat(c.data);
81932
81932
  }
81933
- resp.result = (0, import_core42.toFindResult)(result, total, lookupMap);
81933
+ resp.result = (0, import_core44.toFindResult)(result, total, lookupMap);
81934
81934
  resp.chunk = void 0;
81935
81935
  } else {
81936
81936
  return;
@@ -81974,7 +81974,7 @@ var require_connection2 = __commonJS({
81974
81974
  } else {
81975
81975
  const txArr = Array.isArray(resp.result) ? resp.result : [resp.result];
81976
81976
  for (const tx of txArr) {
81977
- if (tx?._class === import_core42.default.class.TxModelUpgrade) {
81977
+ if (tx?._class === import_core44.default.class.TxModelUpgrade) {
81978
81978
  console.log("Processing upgrade", this.workspace, this.user);
81979
81979
  this.opt?.onUpgrade?.();
81980
81980
  return;
@@ -81986,15 +81986,15 @@ var require_connection2 = __commonJS({
81986
81986
  }
81987
81987
  }
81988
81988
  checkArrayBufferPing(data) {
81989
- if (data.byteLength === import_client23.pingConst.length || data.byteLength === import_client23.pongConst.length) {
81989
+ if (data.byteLength === import_client24.pingConst.length || data.byteLength === import_client24.pongConst.length) {
81990
81990
  const text = new TextDecoder().decode(data);
81991
- if (text === import_client23.pingConst) {
81992
- void this.sendRequest({ method: import_client23.pingConst, params: [] }).catch((err) => {
81991
+ if (text === import_client24.pingConst) {
81992
+ void this.sendRequest({ method: import_client24.pingConst, params: [] }).catch((err) => {
81993
81993
  this.ctx.error("failed to send ping", { err });
81994
81994
  });
81995
81995
  return true;
81996
81996
  }
81997
- if (text === import_client23.pongConst) {
81997
+ if (text === import_client24.pongConst) {
81998
81998
  this.pingResponse = Date.now();
81999
81999
  return true;
82000
82000
  }
@@ -82004,7 +82004,7 @@ var require_connection2 = __commonJS({
82004
82004
  openConnection(ctx, socketId) {
82005
82005
  this.binaryMode = false;
82006
82006
  this.helloReceived = false;
82007
- const clientSocketFactory = this.opt?.socketFactory ?? (0, import_platform2.getMetadata)(import_client23.default.metadata.ClientSocketFactory) ?? ((url4) => {
82007
+ const clientSocketFactory = this.opt?.socketFactory ?? (0, import_platform2.getMetadata)(import_client24.default.metadata.ClientSocketFactory) ?? ((url4) => {
82008
82008
  const s = new WebSocket(url4);
82009
82009
  return s;
82010
82010
  });
@@ -82039,12 +82039,12 @@ var require_connection2 = __commonJS({
82039
82039
  if (this.websocket !== wsocket) {
82040
82040
  return;
82041
82041
  }
82042
- if (event.data === import_client23.pongConst) {
82042
+ if (event.data === import_client24.pongConst) {
82043
82043
  this.pingResponse = Date.now();
82044
82044
  return;
82045
82045
  }
82046
- if (event.data === import_client23.pingConst) {
82047
- void this.sendRequest({ method: import_client23.pingConst, params: [] }).catch((err) => {
82046
+ if (event.data === import_client24.pingConst) {
82047
+ void this.sendRequest({ method: import_client24.pingConst, params: [] }).catch((err) => {
82048
82048
  this.ctx.error("failed to send ping", { err });
82049
82049
  });
82050
82050
  return;
@@ -82109,8 +82109,8 @@ var require_connection2 = __commonJS({
82109
82109
  if (this.websocket !== wsocket) {
82110
82110
  return;
82111
82111
  }
82112
- const useBinary = this.opt?.useBinaryProtocol ?? (0, import_platform2.getMetadata)(import_client23.default.metadata.UseBinaryProtocol) ?? true;
82113
- this.compressionMode = this.opt?.useProtocolCompression ?? (0, import_platform2.getMetadata)(import_client23.default.metadata.UseProtocolCompression) ?? false;
82112
+ const useBinary = this.opt?.useBinaryProtocol ?? (0, import_platform2.getMetadata)(import_client24.default.metadata.UseBinaryProtocol) ?? true;
82113
+ this.compressionMode = this.opt?.useProtocolCompression ?? (0, import_platform2.getMetadata)(import_client24.default.metadata.UseProtocolCompression) ?? false;
82114
82114
  const helloRequest = {
82115
82115
  method: "hello",
82116
82116
  params: [],
@@ -82156,13 +82156,13 @@ var require_connection2 = __commonJS({
82156
82156
  if (w instanceof Promise) {
82157
82157
  await w;
82158
82158
  }
82159
- if (data.method !== import_client23.pingConst) {
82159
+ if (data.method !== import_client24.pingConst) {
82160
82160
  this.requests.set(id, promise4);
82161
82161
  }
82162
82162
  promise4.sendData = () => {
82163
- if (this.websocket?.readyState === import_client23.ClientSocketReadyState.OPEN) {
82163
+ if (this.websocket?.readyState === import_client24.ClientSocketReadyState.OPEN) {
82164
82164
  promise4.startTime = Date.now();
82165
- if (data.method !== import_client23.pingConst) {
82165
+ if (data.method !== import_client24.pingConst) {
82166
82166
  const dta = this.rpcHandler.serialize(
82167
82167
  {
82168
82168
  method: data.method,
@@ -82175,7 +82175,7 @@ var require_connection2 = __commonJS({
82175
82175
  );
82176
82176
  this.websocket?.send(dta);
82177
82177
  } else {
82178
- this.websocket?.send(import_client23.pingConst);
82178
+ this.websocket?.send(import_client24.pingConst);
82179
82179
  }
82180
82180
  }
82181
82181
  };
@@ -82189,7 +82189,7 @@ var require_connection2 = __commonJS({
82189
82189
  };
82190
82190
  }
82191
82191
  promise4.sendData();
82192
- if (data.method !== import_client23.pingConst) {
82192
+ if (data.method !== import_client24.pingConst) {
82193
82193
  return await promise4.promise;
82194
82194
  }
82195
82195
  },
@@ -82204,7 +82204,7 @@ var require_connection2 = __commonJS({
82204
82204
  }
82205
82205
  getAccount() {
82206
82206
  if (this.account !== void 0) {
82207
- return Promise.resolve((0, import_core42.clone)(this.account));
82207
+ return Promise.resolve((0, import_core44.clone)(this.account));
82208
82208
  }
82209
82209
  return this.sendRequest({ method: "getAccount", params: [] });
82210
82210
  }
@@ -82262,10 +82262,10 @@ var require_connection2 = __commonJS({
82262
82262
  method: "tx",
82263
82263
  params: [tx],
82264
82264
  retry: /* @__PURE__ */ __name(async () => {
82265
- if (tx._class === import_core42.default.class.TxApplyIf) {
82266
- return (await this.findAll(import_core42.default.class.Tx, { _id: tx.txes[0]._id }, { limit: 1 })).length === 0;
82265
+ if (tx._class === import_core44.default.class.TxApplyIf) {
82266
+ return (await this.findAll(import_core44.default.class.Tx, { _id: tx.txes[0]._id }, { limit: 1 })).length === 0;
82267
82267
  }
82268
- return (await this.findAll(import_core42.default.class.Tx, { _id: tx._id }, { limit: 1 })).length === 0;
82268
+ return (await this.findAll(import_core44.default.class.Tx, { _id: tx._id }, { limit: 1 })).length === 0;
82269
82269
  }, "retry")
82270
82270
  });
82271
82271
  }
@@ -82305,7 +82305,7 @@ var require_connection2 = __commonJS({
82305
82305
  };
82306
82306
  function connect(url4, handler, workspace, user, opt) {
82307
82307
  return new Connection(
82308
- opt?.ctx?.newChild?.("connection", {}) ?? new import_core42.MeasureMetricsContext("connection", {}),
82308
+ opt?.ctx?.newChild?.("connection", {}) ?? new import_core44.MeasureMetricsContext("connection", {}),
82309
82309
  url4,
82310
82310
  handler,
82311
82311
  workspace,
@@ -82355,14 +82355,14 @@ var require_lib19 = __commonJS({
82355
82355
  default: () => index_default
82356
82356
  });
82357
82357
  module2.exports = __toCommonJS2(index_exports2);
82358
- var import_client23 = __toESM2(require_lib6());
82359
- var import_core42 = __toESM2(require_lib4());
82358
+ var import_client24 = __toESM2(require_lib6());
82359
+ var import_core44 = __toESM2(require_lib4());
82360
82360
  var import_platform2 = __toESM2(require_lib());
82361
82361
  var import_connection = require_connection2();
82362
82362
  var dbRequest;
82363
82363
  var dbPromise = Promise.resolve(void 0);
82364
82364
  if (typeof localStorage !== "undefined") {
82365
- const st = (0, import_core42.platformNow)();
82365
+ const st = (0, import_core44.platformNow)();
82366
82366
  dbPromise = new Promise((resolve2) => {
82367
82367
  dbRequest = indexedDB.open("model.db.persistence", 2);
82368
82368
  dbRequest.onupgradeneeded = function() {
@@ -82373,7 +82373,7 @@ var require_lib19 = __commonJS({
82373
82373
  };
82374
82374
  dbRequest.onsuccess = function() {
82375
82375
  const db = dbRequest.result;
82376
- console.log("init DB complete", (0, import_core42.platformNow)() - st);
82376
+ console.log("init DB complete", (0, import_core44.platformNow)() - st);
82377
82377
  resolve2(db);
82378
82378
  };
82379
82379
  });
@@ -82399,19 +82399,19 @@ var require_lib19 = __commonJS({
82399
82399
  return {
82400
82400
  function: {
82401
82401
  GetClient: /* @__PURE__ */ __name(async (token, endpoint, opt) => {
82402
- const filterModel = (0, import_platform2.getMetadata)(import_client23.default.metadata.FilterModel) ?? "none";
82403
- const extraFilter = (0, import_platform2.getMetadata)(import_client23.default.metadata.ExtraFilter) ?? [];
82402
+ const filterModel = (0, import_platform2.getMetadata)(import_client24.default.metadata.FilterModel) ?? "none";
82403
+ const extraFilter = (0, import_platform2.getMetadata)(import_client24.default.metadata.ExtraFilter) ?? [];
82404
82404
  const handler = /* @__PURE__ */ __name(async (handler2) => {
82405
- const url4 = (0, import_core42.concatLink)(endpoint, `/${token}`);
82405
+ const url4 = (0, import_core44.concatLink)(endpoint, `/${token}`);
82406
82406
  const upgradeHandler = /* @__PURE__ */ __name((...txes) => {
82407
82407
  for (const tx of txes) {
82408
- if (tx?._class === import_core42.default.class.TxModelUpgrade) {
82408
+ if (tx?._class === import_core44.default.class.TxModelUpgrade) {
82409
82409
  opt?.onUpgrade?.();
82410
82410
  return;
82411
82411
  }
82412
- if (tx?._class === import_core42.default.class.TxWorkspaceEvent) {
82412
+ if (tx?._class === import_core44.default.class.TxWorkspaceEvent) {
82413
82413
  const event = tx;
82414
- if (event.event === import_core42.WorkspaceEvent.MaintenanceNotification) {
82414
+ if (event.event === import_core44.WorkspaceEvent.MaintenanceNotification) {
82415
82415
  void (0, import_platform2.setPlatformStatus)(
82416
82416
  new import_platform2.Status(import_platform2.Severity.WARNING, import_platform2.default.status.MaintenanceWarning, {
82417
82417
  time: event.params.timeMinutes,
@@ -82428,7 +82428,7 @@ var require_lib19 = __commonJS({
82428
82428
  throw new Error("Workspace or account not found in token");
82429
82429
  }
82430
82430
  const newOpt = { ...opt };
82431
- const connectTimeout = opt?.connectionTimeout ?? (0, import_platform2.getMetadata)(import_client23.default.metadata.ConnectionTimeout);
82431
+ const connectTimeout = opt?.connectionTimeout ?? (0, import_platform2.getMetadata)(import_client24.default.metadata.ConnectionTimeout);
82432
82432
  let connectPromise;
82433
82433
  if ((connectTimeout ?? 0) > 0) {
82434
82434
  connectPromise = new Promise((resolve2, reject) => {
@@ -82449,7 +82449,7 @@ var require_lib19 = __commonJS({
82449
82449
  reject(error2);
82450
82450
  return;
82451
82451
  }
82452
- if (event !== import_core42.ClientConnectEvent.Maintenance) {
82452
+ if (event !== import_core44.ClientConnectEvent.Maintenance) {
82453
82453
  clearTimeout(connectTO);
82454
82454
  resolve2();
82455
82455
  }
@@ -82471,7 +82471,7 @@ var require_lib19 = __commonJS({
82471
82471
  }
82472
82472
  return txes;
82473
82473
  }, "modelFilter");
82474
- const client = (0, import_core42.createClient)(handler, modelFilter, createModelPersistence(getWSFromToken(token)), opt?.ctx);
82474
+ const client = (0, import_core44.createClient)(handler, modelFilter, createModelPersistence(getWSFromToken(token)), opt?.ctx);
82475
82475
  return await client;
82476
82476
  }, "GetClient")
82477
82477
  }
@@ -82479,17 +82479,17 @@ var require_lib19 = __commonJS({
82479
82479
  }, "default");
82480
82480
  function returnUITxes(txes, extraFilter) {
82481
82481
  const configs = /* @__PURE__ */ new Map();
82482
- (0, import_core42.fillConfiguration)(txes, configs);
82483
- const allowedPlugins = [...(0, import_platform2.getPlugins)(), ...(0, import_platform2.getMetadata)(import_client23.default.metadata.ExtraPlugins) ?? []];
82482
+ (0, import_core44.fillConfiguration)(txes, configs);
82483
+ const allowedPlugins = [...(0, import_platform2.getPlugins)(), ...(0, import_platform2.getMetadata)(import_client24.default.metadata.ExtraPlugins) ?? []];
82484
82484
  const excludedPlugins = Array.from(configs.values()).filter(
82485
82485
  (it) => !it.enabled || !allowedPlugins.includes(it.pluginId) || extraFilter.includes(it.pluginId)
82486
82486
  );
82487
- return (0, import_core42.pluginFilterTx)(excludedPlugins, configs, txes);
82487
+ return (0, import_core44.pluginFilterTx)(excludedPlugins, configs, txes);
82488
82488
  }
82489
82489
  __name(returnUITxes, "returnUITxes");
82490
82490
  function returnClientTxes(txes) {
82491
82491
  const configs = /* @__PURE__ */ new Map();
82492
- (0, import_core42.fillConfiguration)(txes, configs);
82492
+ (0, import_core44.fillConfiguration)(txes, configs);
82493
82493
  const excludedPlugins = Array.from(configs.values()).filter((it) => !it.enabled || it.pluginId.startsWith("server-"));
82494
82494
  const toExclude = /* @__PURE__ */ new Set([
82495
82495
  "workbench:class:Application",
@@ -82515,8 +82515,8 @@ var require_lib19 = __commonJS({
82515
82515
  "setting:class:WorkspaceSettingCategory",
82516
82516
  "notification:class:NotificationProvider"
82517
82517
  ]);
82518
- const result = (0, import_core42.pluginFilterTx)(excludedPlugins, configs, txes).filter((tx) => {
82519
- if (tx?._class === import_core42.default.class.TxCreateDoc || tx?._class === import_core42.default.class.TxUpdateDoc || tx?._class === import_core42.default.class.TxRemoveDoc) {
82518
+ const result = (0, import_core44.pluginFilterTx)(excludedPlugins, configs, txes).filter((tx) => {
82519
+ if (tx?._class === import_core44.default.class.TxCreateDoc || tx?._class === import_core44.default.class.TxUpdateDoc || tx?._class === import_core44.default.class.TxRemoveDoc) {
82520
82520
  const cud = tx;
82521
82521
  if (toExclude.has(cud.objectClass)) {
82522
82522
  return false;
@@ -82528,7 +82528,7 @@ var require_lib19 = __commonJS({
82528
82528
  }
82529
82529
  __name(returnClientTxes, "returnClientTxes");
82530
82530
  function createModelPersistence(workspace) {
82531
- const overrideStore = (0, import_platform2.getMetadata)(import_client23.default.metadata.OverridePersistenceStore);
82531
+ const overrideStore = (0, import_platform2.getMetadata)(import_client24.default.metadata.OverridePersistenceStore);
82532
82532
  if (overrideStore !== void 0) {
82533
82533
  return overrideStore;
82534
82534
  }
@@ -82625,8 +82625,8 @@ var require_client6 = __commonJS({
82625
82625
  });
82626
82626
  module2.exports = __toCommonJS2(client_exports);
82627
82627
  var import_account_client2 = require_lib5();
82628
- var import_client23 = __toESM2(require_lib6());
82629
- var import_core42 = require_lib4();
82628
+ var import_client24 = __toESM2(require_lib6());
82629
+ var import_core44 = require_lib4();
82630
82630
  var import_platform2 = require_lib();
82631
82631
  var import_config8 = require_config();
82632
82632
  var import_markup = require_markup();
@@ -82643,7 +82643,7 @@ var require_client6 = __commonJS({
82643
82643
  const account = {
82644
82644
  uuid: wsLoginInfo.account,
82645
82645
  role: wsLoginInfo.role,
82646
- primarySocialId: (0, import_core42.pickPrimarySocialId)(socialIds)._id,
82646
+ primarySocialId: (0, import_core44.pickPrimarySocialId)(socialIds)._id,
82647
82647
  socialIds: socialIds.map((si) => si._id),
82648
82648
  fullSocialIds: socialIds
82649
82649
  };
@@ -82651,9 +82651,9 @@ var require_client6 = __commonJS({
82651
82651
  }
82652
82652
  __name(connect, "connect");
82653
82653
  async function createClient(url4, endpoint, token, workspaceUuid, account, config3, options) {
82654
- (0, import_platform2.addLocation)(import_client23.clientId, () => Promise.resolve().then(() => __toESM(require_lib19())));
82654
+ (0, import_platform2.addLocation)(import_client24.clientId, () => Promise.resolve().then(() => __toESM(require_lib19())));
82655
82655
  const { socketFactory, connectionTimeout } = options;
82656
- const clientFactory = await (0, import_platform2.getResource)(import_client23.default.function.GetClient);
82656
+ const clientFactory = await (0, import_platform2.getResource)(import_client24.default.function.GetClient);
82657
82657
  const connection = await clientFactory(token, endpoint, {
82658
82658
  socketFactory,
82659
82659
  connectionTimeout
@@ -82669,7 +82669,7 @@ var require_client6 = __commonJS({
82669
82669
  this.config = config3;
82670
82670
  this.connection = connection;
82671
82671
  this.account = account;
82672
- this.client = new import_core42.TxOperations(connection, account.primarySocialId);
82672
+ this.client = new import_core44.TxOperations(connection, account.primarySocialId);
82673
82673
  this.markup = (0, import_markup.createMarkupOperations)(url4, workspace, token, config3);
82674
82674
  }
82675
82675
  static {
@@ -82709,7 +82709,7 @@ var require_client6 = __commonJS({
82709
82709
  }
82710
82710
  // DocOperations
82711
82711
  async createDoc(_class, space, attributes, id) {
82712
- id ??= (0, import_core42.generateId)();
82712
+ id ??= (0, import_core44.generateId)();
82713
82713
  const data = await this.processMarkup(_class, id, attributes);
82714
82714
  return await this.client.createDoc(_class, space, data, id);
82715
82715
  }
@@ -82722,7 +82722,7 @@ var require_client6 = __commonJS({
82722
82722
  }
82723
82723
  // CollectionOperations
82724
82724
  async addCollection(_class, space, attachedTo, attachedToClass, collection, attributes, id) {
82725
- id ??= (0, import_core42.generateId)();
82725
+ id ??= (0, import_core44.generateId)();
82726
82726
  const data = await this.processMarkup(_class, id, attributes);
82727
82727
  return await this.client.addCollection(_class, space, attachedTo, attachedToClass, collection, data, id);
82728
82728
  }
@@ -83049,7 +83049,7 @@ var require_rest = __commonJS({
83049
83049
  createRestClient: () => createRestClient2
83050
83050
  });
83051
83051
  module2.exports = __toCommonJS2(rest_exports);
83052
- var import_core42 = require_lib4();
83052
+ var import_core44 = require_lib4();
83053
83053
  var import_platform2 = require_lib();
83054
83054
  var import_utils14 = require_utils9();
83055
83055
  var import_utils22 = require_utils10();
@@ -83104,7 +83104,7 @@ var require_rest = __commonJS({
83104
83104
  if (options !== void 0 && Object.keys(options).length > 0) {
83105
83105
  params.append("options", JSON.stringify(options));
83106
83106
  }
83107
- const requestUrl = (0, import_core42.concatLink)(this.endpoint, `/api/v1/find-all/${this.workspace}?${params.toString()}`);
83107
+ const requestUrl = (0, import_core44.concatLink)(this.endpoint, `/api/v1/find-all/${this.workspace}?${params.toString()}`);
83108
83108
  const result = await (0, import_utils22.withRetry)(async () => {
83109
83109
  const response = await fetch(requestUrl, this.requestInit());
83110
83110
  if (!response.ok) {
@@ -83178,7 +83178,7 @@ var require_rest = __commonJS({
83178
83178
  }
83179
83179
  }
83180
83180
  async getAccount() {
83181
- const requestUrl = (0, import_core42.concatLink)(this.endpoint, `/api/v1/account/${this.workspace}`);
83181
+ const requestUrl = (0, import_core44.concatLink)(this.endpoint, `/api/v1/account/${this.workspace}`);
83182
83182
  await this.checkRate();
83183
83183
  const result = await (0, import_utils22.withRetry)(async () => {
83184
83184
  const response = await fetch(requestUrl, this.requestInit());
@@ -83195,7 +83195,7 @@ var require_rest = __commonJS({
83195
83195
  return result;
83196
83196
  }
83197
83197
  async getModel(full = false) {
83198
- const requestUrl = new URL((0, import_core42.concatLink)(this.endpoint, `/api/v1/load-model/${this.workspace}`));
83198
+ const requestUrl = new URL((0, import_core44.concatLink)(this.endpoint, `/api/v1/load-model/${this.workspace}`));
83199
83199
  if (full) {
83200
83200
  requestUrl.searchParams.append("full", "true");
83201
83201
  }
@@ -83208,10 +83208,10 @@ var require_rest = __commonJS({
83208
83208
  }
83209
83209
  this.updateRateLimit(response);
83210
83210
  const modelResponse = await (0, import_utils22.extractJson)(response);
83211
- const hierarchy = new import_core42.Hierarchy();
83212
- const model = new import_core42.ModelDb(hierarchy);
83213
- const ctx = new import_core42.MeasureMetricsContext("loadModel", {});
83214
- (0, import_core42.buildModel)(ctx, modelResponse, void 0, hierarchy, model);
83211
+ const hierarchy = new import_core44.Hierarchy();
83212
+ const model = new import_core44.ModelDb(hierarchy);
83213
+ const ctx = new import_core44.MeasureMetricsContext("loadModel", {});
83214
+ (0, import_core44.buildModel)(ctx, modelResponse, void 0, hierarchy, model);
83215
83215
  return { hierarchy, model };
83216
83216
  }, isRLE);
83217
83217
  if (result.error !== void 0) {
@@ -83223,7 +83223,7 @@ var require_rest = __commonJS({
83223
83223
  return (await this.findAll(_class, query, { ...options, limit: 1 })).shift();
83224
83224
  }
83225
83225
  async tx(tx) {
83226
- const requestUrl = (0, import_core42.concatLink)(this.endpoint, `/api/v1/tx/${this.workspace}`);
83226
+ const requestUrl = (0, import_core44.concatLink)(this.endpoint, `/api/v1/tx/${this.workspace}`);
83227
83227
  await this.checkRate();
83228
83228
  const result = await (0, import_utils22.withRetry)(async () => {
83229
83229
  const response = await fetch(requestUrl, {
@@ -83257,7 +83257,7 @@ var require_rest = __commonJS({
83257
83257
  if (options.limit != null) {
83258
83258
  params.append("limit", `${options.limit}`);
83259
83259
  }
83260
- const requestUrl = (0, import_core42.concatLink)(this.endpoint, `/api/v1/search-fulltext/${this.workspace}?${params.toString()}`);
83260
+ const requestUrl = (0, import_core44.concatLink)(this.endpoint, `/api/v1/search-fulltext/${this.workspace}?${params.toString()}`);
83261
83261
  const response = await fetch(requestUrl, {
83262
83262
  method: "GET",
83263
83263
  headers: this.jsonHeaders(),
@@ -83276,7 +83276,7 @@ var require_rest = __commonJS({
83276
83276
  return result;
83277
83277
  }
83278
83278
  async domainRequest(domain3, params, options) {
83279
- const requestUrl = (0, import_core42.concatLink)(this.endpoint, `/api/v1/request/${domain3}/${this.workspace}`);
83279
+ const requestUrl = (0, import_core44.concatLink)(this.endpoint, `/api/v1/request/${domain3}/${this.workspace}`);
83280
83280
  await this.checkRate();
83281
83281
  return await (0, import_utils22.withRetry)(async () => {
83282
83282
  const response = await fetch(requestUrl, {
@@ -83295,7 +83295,7 @@ var require_rest = __commonJS({
83295
83295
  }, isRLE);
83296
83296
  }
83297
83297
  async ensurePerson(socialType, socialValue, firstName, lastName) {
83298
- const requestUrl = (0, import_core42.concatLink)(this.endpoint, `/api/v1/ensure-person/${this.workspace}`);
83298
+ const requestUrl = (0, import_core44.concatLink)(this.endpoint, `/api/v1/ensure-person/${this.workspace}`);
83299
83299
  await this.checkRate();
83300
83300
  const result = await (0, import_utils22.withRetry)(async () => {
83301
83301
  const response = await fetch(requestUrl, {
@@ -83352,13 +83352,13 @@ var require_tx2 = __commonJS({
83352
83352
  createRestTxOperations: () => createRestTxOperations2
83353
83353
  });
83354
83354
  module2.exports = __toCommonJS2(tx_exports);
83355
- var import_core42 = require_lib4();
83355
+ var import_core44 = require_lib4();
83356
83356
  var import_rest = require_rest();
83357
83357
  async function createRestTxOperations2(endpoint, workspaceId, token, fullModel = false) {
83358
83358
  const restClient = new import_rest.RestClientImpl(endpoint, workspaceId, token);
83359
83359
  const account = await restClient.getAccount();
83360
83360
  const { hierarchy, model } = await restClient.getModel(fullModel);
83361
- return new import_core42.TxOperations(new RestTxClient(restClient, hierarchy, model, account), account.socialIds[0]);
83361
+ return new import_core44.TxOperations(new RestTxClient(restClient, hierarchy, model, account), account.socialIds[0]);
83362
83362
  }
83363
83363
  __name(createRestTxOperations2, "createRestTxOperations");
83364
83364
  var RestTxClient = class {
@@ -83379,7 +83379,7 @@ var require_tx2 = __commonJS({
83379
83379
  const result = data.map((v) => {
83380
83380
  return this.hierarchy.updateLookupMixin(_class, v, options);
83381
83381
  });
83382
- return (0, import_core42.toFindResult)(result, data.total);
83382
+ return (0, import_core44.toFindResult)(result, data.total);
83383
83383
  }
83384
83384
  async domainRequest(domain3, params, options) {
83385
83385
  return await this.client.domainRequest(domain3, params, options);
@@ -83561,7 +83561,7 @@ var require_client7 = __commonJS({
83561
83561
  createStorageClient: () => createStorageClient2
83562
83562
  });
83563
83563
  module2.exports = __toCommonJS2(client_exports);
83564
- var import_core42 = __toESM2(require_lib4());
83564
+ var import_core44 = __toESM2(require_lib4());
83565
83565
  var import_stream2 = require("stream");
83566
83566
  var import_config8 = require_config();
83567
83567
  var import_error = require_error3();
@@ -83598,13 +83598,13 @@ var require_client7 = __commonJS({
83598
83598
  const size13 = parseInt(headers.get("Content-Length") ?? "0", 10);
83599
83599
  return {
83600
83600
  provider: "",
83601
- _class: import_core42.default.class.Blob,
83601
+ _class: import_core44.default.class.Blob,
83602
83602
  _id: objectName,
83603
83603
  contentType: headers.get("Content-Type") ?? "",
83604
83604
  size: isNaN(size13) ? 0 : size13 ?? 0,
83605
83605
  etag: headers.get("ETag") ?? "",
83606
- space: import_core42.default.space.Configuration,
83607
- modifiedBy: import_core42.default.account.System,
83606
+ space: import_core44.default.space.Configuration,
83607
+ modifiedBy: import_core44.default.account.System,
83608
83608
  modifiedOn: isNaN(lastModified) ? 0 : lastModified,
83609
83609
  version: null
83610
83610
  };
@@ -83639,11 +83639,11 @@ var require_client7 = __commonJS({
83639
83639
  if (Object.hasOwn(result[0], "id")) {
83640
83640
  const fileResult = result[0];
83641
83641
  return {
83642
- _class: import_core42.default.class.Blob,
83642
+ _class: import_core44.default.class.Blob,
83643
83643
  _id: fileResult.id,
83644
- space: import_core42.default.space.Configuration,
83644
+ space: import_core44.default.space.Configuration,
83645
83645
  modifiedOn: fileResult.metadata.lastModified,
83646
- modifiedBy: import_core42.default.account.System,
83646
+ modifiedBy: import_core44.default.account.System,
83647
83647
  provider: "",
83648
83648
  contentType: fileResult.metadata.contentType,
83649
83649
  etag: fileResult.metadata.etag,
@@ -83717,11 +83717,11 @@ var require_client7 = __commonJS({
83717
83717
  async function connectStorage(url4, options, config3) {
83718
83718
  config3 ??= await (0, import_config8.loadServerConfig)(url4);
83719
83719
  const token = await (0, import_utils14.getWorkspaceToken)(url4, options, config3);
83720
- const filesUrl = (config3.FILES_URL.startsWith("/") ? (0, import_core42.concatLink)(url4, config3.FILES_URL) : config3.FILES_URL).replace(
83720
+ const filesUrl = (config3.FILES_URL.startsWith("/") ? (0, import_core44.concatLink)(url4, config3.FILES_URL) : config3.FILES_URL).replace(
83721
83721
  ":workspace",
83722
83722
  token.workspaceId
83723
83723
  );
83724
- const uploadUrl = (config3.UPLOAD_URL.startsWith("/") ? (0, import_core42.concatLink)(url4, config3.UPLOAD_URL) : config3.UPLOAD_URL).replace(":workspace", token.workspaceId);
83724
+ const uploadUrl = (config3.UPLOAD_URL.startsWith("/") ? (0, import_core44.concatLink)(url4, config3.UPLOAD_URL) : config3.UPLOAD_URL).replace(":workspace", token.workspaceId);
83725
83725
  return new StorageClientImpl(filesUrl, uploadUrl, token.token, token.workspaceId);
83726
83726
  }
83727
83727
  __name(connectStorage, "connectStorage");
@@ -83774,11 +83774,11 @@ var require_storage2 = __commonJS({
83774
83774
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
83775
83775
  var storage_exports = {};
83776
83776
  __export2(storage_exports, {
83777
- connectStorage: () => import_client23.connectStorage,
83778
- createStorageClient: () => import_client23.createStorageClient
83777
+ connectStorage: () => import_client24.connectStorage,
83778
+ createStorageClient: () => import_client24.createStorageClient
83779
83779
  });
83780
83780
  module2.exports = __toCommonJS2(storage_exports);
83781
- var import_client23 = require_client7();
83781
+ var import_client24 = require_client7();
83782
83782
  __reExport2(storage_exports, require_error3(), module2.exports);
83783
83783
  __reExport2(storage_exports, require_types8(), module2.exports);
83784
83784
  }
@@ -84427,14 +84427,14 @@ var require_utils11 = __commonJS({
84427
84427
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
84428
84428
  var utils_exports = {};
84429
84429
  __export2(utils_exports, {
84430
- generateEventId: () => generateEventId2,
84430
+ generateEventId: () => generateEventId3,
84431
84431
  generateRecurringValues: () => generateRecurringValues,
84432
84432
  getAllEvents: () => getAllEvents,
84433
84433
  getPrimaryCalendar: () => getPrimaryCalendar,
84434
84434
  getWeekday: () => getWeekday
84435
84435
  });
84436
84436
  module2.exports = __toCommonJS2(utils_exports);
84437
- var import_core42 = require_lib4();
84437
+ var import_core44 = require_lib4();
84438
84438
  var import__ = __toESM2(require_lib24());
84439
84439
  function getInstance(event, date7) {
84440
84440
  const diff8 = event.dueDate - event.date;
@@ -84445,8 +84445,8 @@ var require_utils11 = __commonJS({
84445
84445
  dueDate: date7 + diff8,
84446
84446
  originalStartTime: date7,
84447
84447
  _class: import__.default.class.ReccuringInstance,
84448
- eventId: generateEventId2(),
84449
- _id: (0, import_core42.generateId)(),
84448
+ eventId: generateEventId3(),
84449
+ _id: (0, import_core44.generateId)(),
84450
84450
  virtual: true
84451
84451
  };
84452
84452
  }
@@ -84758,11 +84758,11 @@ var require_utils11 = __commonJS({
84758
84758
  return res;
84759
84759
  }
84760
84760
  __name(getAllEvents, "getAllEvents");
84761
- function generateEventId2() {
84762
- const id = (0, import_core42.generateId)();
84761
+ function generateEventId3() {
84762
+ const id = (0, import_core44.generateId)();
84763
84763
  return encodeToBase32Hex(id);
84764
84764
  }
84765
- __name(generateEventId2, "generateEventId");
84765
+ __name(generateEventId3, "generateEventId");
84766
84766
  function encodeToBase32Hex(input) {
84767
84767
  const encoder2 = new TextEncoder();
84768
84768
  const bytes = encoder2.encode(input);
@@ -84826,7 +84826,7 @@ var require_lib24 = __commonJS({
84826
84826
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
84827
84827
  var index_exports2 = {};
84828
84828
  __export2(index_exports2, {
84829
- AccessLevel: () => AccessLevel3,
84829
+ AccessLevel: () => AccessLevel4,
84830
84830
  caldavIntegrationKind: () => caldavIntegrationKind,
84831
84831
  calendarId: () => calendarId,
84832
84832
  calendarIntegrationKind: () => calendarIntegrationKind,
@@ -84835,13 +84835,13 @@ var require_lib24 = __commonJS({
84835
84835
  module2.exports = __toCommonJS2(index_exports2);
84836
84836
  var import_platform2 = require_lib();
84837
84837
  __reExport2(index_exports2, require_utils11(), module2.exports);
84838
- var AccessLevel3 = /* @__PURE__ */ ((AccessLevel22) => {
84838
+ var AccessLevel4 = /* @__PURE__ */ ((AccessLevel22) => {
84839
84839
  AccessLevel22["FreeBusyReader"] = "freeBusyReader";
84840
84840
  AccessLevel22["Reader"] = "reader";
84841
84841
  AccessLevel22["Writer"] = "writer";
84842
84842
  AccessLevel22["Owner"] = "owner";
84843
84843
  return AccessLevel22;
84844
- })(AccessLevel3 || {});
84844
+ })(AccessLevel4 || {});
84845
84845
  var calendarIntegrationKind = "google-calendar";
84846
84846
  var caldavIntegrationKind = "caldav";
84847
84847
  var calendarId = "calendar";
@@ -85173,7 +85173,7 @@ var require_utils12 = __commonJS({
85173
85173
  });
85174
85174
  module2.exports = __toCommonJS2(utils_exports);
85175
85175
  var import_fast_equals = require_cjs();
85176
- var import_core42 = __toESM2(require_lib4());
85176
+ var import_core44 = __toESM2(require_lib4());
85177
85177
  var import__ = __toESM2(require_lib26());
85178
85178
  async function getDirectChannel(client, me, employeeAccount) {
85179
85179
  const accIds = [me, employeeAccount].sort();
@@ -85183,7 +85183,7 @@ var require_utils12 = __commonJS({
85183
85183
  return dm._id;
85184
85184
  }
85185
85185
  }
85186
- return await client.createDoc(import__.default.class.DirectMessage, import_core42.default.space.Space, {
85186
+ return await client.createDoc(import__.default.class.DirectMessage, import_core44.default.space.Space, {
85187
85187
  name: "",
85188
85188
  description: "",
85189
85189
  private: true,
@@ -85487,18 +85487,18 @@ var require_cache4 = __commonJS({
85487
85487
  default: () => ContactCache
85488
85488
  });
85489
85489
  module2.exports = __toCommonJS2(cache_exports);
85490
- var import_core42 = __toESM2(require_lib4());
85490
+ var import_core44 = __toESM2(require_lib4());
85491
85491
  var import__ = __toESM2(require_lib27());
85492
85492
  function isCreateTx(tx) {
85493
- return tx._class === import_core42.default.class.TxCreateDoc;
85493
+ return tx._class === import_core44.default.class.TxCreateDoc;
85494
85494
  }
85495
85495
  __name(isCreateTx, "isCreateTx");
85496
85496
  function isUpdateTx(tx) {
85497
- return tx._class === import_core42.default.class.TxUpdateDoc;
85497
+ return tx._class === import_core44.default.class.TxUpdateDoc;
85498
85498
  }
85499
85499
  __name(isUpdateTx, "isUpdateTx");
85500
85500
  function isMixinTx(tx) {
85501
- return tx._class === import_core42.default.class.TxMixin;
85501
+ return tx._class === import_core44.default.class.TxMixin;
85502
85502
  }
85503
85503
  __name(isMixinTx, "isMixinTx");
85504
85504
  function isPersonTx(tx) {
@@ -85605,7 +85605,7 @@ var require_cache4 = __commonJS({
85605
85605
  const ref = tx.objectId;
85606
85606
  const person = this._personByRef.get(ref);
85607
85607
  if (person === void 0) return;
85608
- const createdPerson = import_core42.TxProcessor.createDoc2Doc(tx);
85608
+ const createdPerson = import_core44.TxProcessor.createDoc2Doc(tx);
85609
85609
  this._personByRef.set(ref, createdPerson);
85610
85610
  const personIds = Array.from(this._personIdsByPersonRef.get(ref) ?? []);
85611
85611
  for (const personId of personIds) {
@@ -85623,7 +85623,7 @@ var require_cache4 = __commonJS({
85623
85623
  const newPersonRef = tx.attachedTo;
85624
85624
  this._personRefByPersonId.set(personId, newPersonRef);
85625
85625
  this.addPersonIdToPersonRef(newPersonRef, personId);
85626
- const createdSocialId = import_core42.TxProcessor.createDoc2Doc(tx);
85626
+ const createdSocialId = import_core44.TxProcessor.createDoc2Doc(tx);
85627
85627
  this._socialIdByPersonId.set(personId, createdSocialId);
85628
85628
  this.broadcastChange({
85629
85629
  personRef: newPersonRef,
@@ -85634,7 +85634,7 @@ var require_cache4 = __commonJS({
85634
85634
  const ref = tx.objectId;
85635
85635
  const person = this._personByRef.get(ref);
85636
85636
  if (person == null) return;
85637
- const updatedPerson = isUpdateTx(tx) ? import_core42.TxProcessor.updateDoc2Doc(person, tx) : import_core42.TxProcessor.updateMixin4Doc(person, tx);
85637
+ const updatedPerson = isUpdateTx(tx) ? import_core44.TxProcessor.updateDoc2Doc(person, tx) : import_core44.TxProcessor.updateMixin4Doc(person, tx);
85638
85638
  this._personByRef.set(ref, updatedPerson);
85639
85639
  const personIds = Array.from(this._personIdsByPersonRef.get(ref) ?? []);
85640
85640
  for (const personId of personIds) {
@@ -85749,7 +85749,7 @@ var require_utils13 = __commonJS({
85749
85749
  setCurrentEmployeeSpace: () => setCurrentEmployeeSpace
85750
85750
  });
85751
85751
  module2.exports = __toCommonJS2(utils_exports);
85752
- var import_core42 = require_lib4();
85752
+ var import_core44 = require_lib4();
85753
85753
  var import_platform2 = require_lib();
85754
85754
  var import__ = __toESM2(require_lib27());
85755
85755
  var import_types11 = require_types9();
@@ -85953,7 +85953,7 @@ var require_utils13 = __commonJS({
85953
85953
  if (socialIds.length === 0) {
85954
85954
  return;
85955
85955
  }
85956
- return (0, import_core42.pickPrimarySocialId)(socialIds)._id;
85956
+ return (0, import_core44.pickPrimarySocialId)(socialIds)._id;
85957
85957
  }
85958
85958
  __name(getPrimarySocialId, "getPrimarySocialId");
85959
85959
  async function getAllSocialStringsByPersonId(client, personId) {
@@ -85992,12 +85992,12 @@ var require_utils13 = __commonJS({
85992
85992
  __name(getSocialStringsByEmployee, "getSocialStringsByEmployee");
85993
85993
  async function getAllAccounts(client) {
85994
85994
  const employees = await client.findAll(import__.default.mixin.Employee, { active: true });
85995
- return employees.map((it) => it.personUuid).filter(import_core42.notEmpty);
85995
+ return employees.map((it) => it.personUuid).filter(import_core44.notEmpty);
85996
85996
  }
85997
85997
  __name(getAllAccounts, "getAllAccounts");
85998
85998
  async function getAllUserAccounts(client) {
85999
85999
  const employees = await client.findAll(import__.default.mixin.Employee, { active: true });
86000
- return employees.map((it) => it.personUuid).filter(import_core42.notEmpty);
86000
+ return employees.map((it) => it.personUuid).filter(import_core44.notEmpty);
86001
86001
  }
86002
86002
  __name(getAllUserAccounts, "getAllUserAccounts");
86003
86003
  async function ensureEmployee(ctx, me, client, socialIds, getGlobalPerson) {
@@ -86006,7 +86006,7 @@ var require_utils13 = __commonJS({
86006
86006
  }
86007
86007
  __name(ensureEmployee, "ensureEmployee");
86008
86008
  async function ensureEmployeeForPerson(ctx, me, person, client, socialIds, globalPerson) {
86009
- const txFactory = new import_core42.TxFactory(me.primarySocialId);
86009
+ const txFactory = new import_core44.TxFactory(me.primarySocialId);
86010
86010
  const personByUuid = await client.findOne(import__.default.class.Person, { personUuid: person.uuid });
86011
86011
  let personRef = personByUuid?._id;
86012
86012
  if (personRef === void 0) {
@@ -86027,7 +86027,7 @@ var require_utils13 = __commonJS({
86027
86027
  city: globalPerson.city,
86028
86028
  avatarType: import__.AvatarType.COLOR
86029
86029
  };
86030
- personRef = (0, import_core42.generateId)();
86030
+ personRef = (0, import_core44.generateId)();
86031
86031
  const createPersonTx = txFactory.createTxCreateDoc(import__.default.class.Person, import__.default.space.Contacts, data, personRef);
86032
86032
  await client.tx(createPersonTx);
86033
86033
  });
@@ -86037,7 +86037,7 @@ var require_utils13 = __commonJS({
86037
86037
  });
86038
86038
  await client.tx(updatePersonTx);
86039
86039
  }
86040
- const existingIdentifiers = (0, import_core42.toIdMap)(
86040
+ const existingIdentifiers = (0, import_core44.toIdMap)(
86041
86041
  await client.findAll(import__.default.class.SocialIdentity, { _id: { $in: person.socialIds } })
86042
86042
  );
86043
86043
  for (const socialId of socialIds) {
@@ -86062,7 +86062,7 @@ var require_utils13 = __commonJS({
86062
86062
  collection: "socialIds",
86063
86063
  type: socialId.type,
86064
86064
  value: socialId.value,
86065
- key: (0, import_core42.buildSocialIdString)(socialId),
86065
+ key: (0, import_core44.buildSocialIdString)(socialId),
86066
86066
  // TODO: fill it in trigger or on DB level as stored calculated column or smth?
86067
86067
  verifiedOn: socialId.verifiedOn,
86068
86068
  isDeleted: socialId.isDeleted
@@ -86103,9 +86103,9 @@ var require_utils13 = __commonJS({
86103
86103
  }
86104
86104
  }
86105
86105
  }
86106
- const employeeRole = person.role === import_core42.AccountRole.Guest || person.role === import_core42.AccountRole.ReadOnlyGuest ? "GUEST" : "USER";
86106
+ const employeeRole = person.role === import_core44.AccountRole.Guest || person.role === import_core44.AccountRole.ReadOnlyGuest ? "GUEST" : "USER";
86107
86107
  const employee = await client.findOne(import__.default.mixin.Employee, { _id: personRef });
86108
- if (employee === void 0 || !import_core42.Hierarchy.hasMixin(employee, import__.default.mixin.Employee) || !employee.active || employee.role !== employeeRole) {
86108
+ if (employee === void 0 || !import_core44.Hierarchy.hasMixin(employee, import__.default.mixin.Employee) || !employee.active || employee.role !== employeeRole) {
86109
86109
  await ctx.with("create-employee", {}, async () => {
86110
86110
  if (personRef === void 0) {
86111
86111
  console.error("Person not found");
@@ -86145,7 +86145,7 @@ var require_utils13 = __commonJS({
86145
86145
  }
86146
86146
  __name(loadCachesForPersonId, "loadCachesForPersonId");
86147
86147
  async function loadCachesForPersonIds(client, personIds) {
86148
- const sidObjsMap = (0, import_core42.toIdMap)(
86148
+ const sidObjsMap = (0, import_core44.toIdMap)(
86149
86149
  await client.findAll(
86150
86150
  import__.default.class.SocialIdentity,
86151
86151
  {
@@ -86180,7 +86180,7 @@ var require_utils13 = __commonJS({
86180
86180
  }
86181
86181
  __name(loadCachesForPersonRef, "loadCachesForPersonRef");
86182
86182
  async function loadCachesForPersonRefs(client, personRefs) {
86183
- const persons = (0, import_core42.toIdMap)(
86183
+ const persons = (0, import_core44.toIdMap)(
86184
86184
  await client.findAll(
86185
86185
  import__.default.class.Person,
86186
86186
  {
@@ -86223,7 +86223,7 @@ var require_utils13 = __commonJS({
86223
86223
  personIds.map((pid) => {
86224
86224
  const ref = contactCache.personRefByPersonId.get(pid);
86225
86225
  return ref != null ? [pid, ref] : void 0;
86226
- }).filter(import_core42.notEmpty)
86226
+ }).filter(import_core44.notEmpty)
86227
86227
  );
86228
86228
  }
86229
86229
  __name(getPersonRefsByPersonIdsFromCache, "getPersonRefsByPersonIdsFromCache");
@@ -86270,7 +86270,7 @@ var require_utils13 = __commonJS({
86270
86270
  personIds.map((pid) => {
86271
86271
  const person = contactCache.personByPersonId.get(pid);
86272
86272
  return person != null ? [pid, person] : void 0;
86273
- }).filter(import_core42.notEmpty)
86273
+ }).filter(import_core44.notEmpty)
86274
86274
  );
86275
86275
  }
86276
86276
  __name(getPersonsByPersonIdsFromCache, "getPersonsByPersonIdsFromCache");
@@ -86317,7 +86317,7 @@ var require_utils13 = __commonJS({
86317
86317
  personRefs.map((personRef) => {
86318
86318
  const person = contactCache.personByRef.get(personRef);
86319
86319
  return person != null ? [personRef, person] : void 0;
86320
- }).filter(import_core42.notEmpty)
86320
+ }).filter(import_core44.notEmpty)
86321
86321
  );
86322
86322
  }
86323
86323
  __name(getPersonsByPersonRefsFromCache, "getPersonsByPersonRefsFromCache");
@@ -86922,9 +86922,9 @@ var require_utils14 = __commonJS({
86922
86922
  getFirstRank: () => getFirstRank
86923
86923
  });
86924
86924
  module2.exports = __toCommonJS2(utils_exports);
86925
- var import_core42 = require_lib4();
86925
+ var import_core44 = require_lib4();
86926
86926
  var import_plugin = __toESM2(require_plugin2());
86927
- async function getFirstRank(client, space, parent, sort3 = import_core42.SortingOrder.Descending, extra = {}) {
86927
+ async function getFirstRank(client, space, parent, sort3 = import_core44.SortingOrder.Descending, extra = {}) {
86928
86928
  const doc = await client.findOne(
86929
86929
  import_plugin.default.class.Document,
86930
86930
  { space, parent, ...extra },
@@ -88547,7 +88547,7 @@ var require_utils16 = __commonJS({
88547
88547
  updateProjectType: () => updateProjectType
88548
88548
  });
88549
88549
  module2.exports = __toCommonJS2(utils_exports);
88550
- var import_core42 = __toESM2(require_lib4());
88550
+ var import_core44 = __toESM2(require_lib4());
88551
88551
  var import_platform2 = require_lib();
88552
88552
  var import__ = __toESM2(require_lib33());
88553
88553
  var import_rank4 = require_lib32();
@@ -88583,7 +88583,7 @@ var require_utils16 = __commonJS({
88583
88583
  if (exists5 !== void 0) {
88584
88584
  return exists5._id;
88585
88585
  }
88586
- const res = await client.createDoc(_class, import_core42.default.space.Model, data);
88586
+ const res = await client.createDoc(_class, import_core44.default.space.Model, data);
88587
88587
  return res;
88588
88588
  }
88589
88589
  __name(createState, "createState");
@@ -88613,7 +88613,7 @@ var require_utils16 = __commonJS({
88613
88613
  function findStatusAttr(h, _class) {
88614
88614
  const attrs = h.getAllAttributes(_class);
88615
88615
  for (const it of attrs.values()) {
88616
- if (it.type._class === import_core42.default.class.RefTo && h.isDerived(it.type.to, import_core42.default.class.Status)) {
88616
+ if (it.type._class === import_core44.default.class.RefTo && h.isDerived(it.type.to, import_core44.default.class.Status)) {
88617
88617
  return it;
88618
88618
  }
88619
88619
  }
@@ -88645,7 +88645,7 @@ var require_utils16 = __commonJS({
88645
88645
  const targetProjectClassId = `${_id}:type:mixin`;
88646
88646
  const tmpl = await client.createDoc(
88647
88647
  import__.default.class.ProjectType,
88648
- import_core42.default.space.Model,
88648
+ import_core44.default.space.Model,
88649
88649
  {
88650
88650
  description: data.description,
88651
88651
  shortDescription: data.shortDescription,
@@ -88660,17 +88660,17 @@ var require_utils16 = __commonJS({
88660
88660
  _id
88661
88661
  );
88662
88662
  await client.createDoc(
88663
- import_core42.default.class.Mixin,
88664
- import_core42.default.space.Model,
88663
+ import_core44.default.class.Mixin,
88664
+ import_core44.default.space.Model,
88665
88665
  {
88666
88666
  extends: categoryObj.baseClass,
88667
- kind: import_core42.ClassifierKind.MIXIN,
88667
+ kind: import_core44.ClassifierKind.MIXIN,
88668
88668
  label: (0, import_platform2.getEmbeddedLabel)(data.name),
88669
88669
  icon: baseClassClass.icon
88670
88670
  },
88671
88671
  targetProjectClassId
88672
88672
  );
88673
- await client.createMixin(targetProjectClassId, import_core42.default.class.Mixin, import_core42.default.space.Model, import__.default.mixin.ProjectTypeClass, {
88673
+ await client.createMixin(targetProjectClassId, import_core44.default.class.Mixin, import_core44.default.space.Model, import__.default.mixin.ProjectTypeClass, {
88674
88674
  projectType: _id
88675
88675
  });
88676
88676
  return tmpl;
@@ -88729,22 +88729,22 @@ var require_utils16 = __commonJS({
88729
88729
  const targetClassId = `${taskId}:type:mixin`;
88730
88730
  tdata.targetClass = targetClassId;
88731
88731
  await client.createDoc(
88732
- import_core42.default.class.Mixin,
88733
- import_core42.default.space.Model,
88732
+ import_core44.default.class.Mixin,
88733
+ import_core44.default.space.Model,
88734
88734
  {
88735
88735
  extends: data.ofClass,
88736
- kind: import_core42.ClassifierKind.MIXIN,
88736
+ kind: import_core44.ClassifierKind.MIXIN,
88737
88737
  label: ofClassClass.label,
88738
88738
  icon: ofClassClass.icon
88739
88739
  },
88740
88740
  targetClassId
88741
88741
  );
88742
- await client.createMixin(targetClassId, import_core42.default.class.Mixin, import_core42.default.space.Model, import__.default.mixin.TaskTypeClass, {
88742
+ await client.createMixin(targetClassId, import_core44.default.class.Mixin, import_core44.default.space.Model, import__.default.mixin.TaskTypeClass, {
88743
88743
  taskType: taskId,
88744
88744
  projectType: _id
88745
88745
  });
88746
88746
  }
88747
- await client.createDoc(import__.default.class.TaskType, import_core42.default.space.Model, tdata, taskId);
88747
+ await client.createDoc(import__.default.class.TaskType, import_core44.default.space.Model, tdata, taskId);
88748
88748
  tasksData.set(taskId, tdata);
88749
88749
  _tasks.push(taskId);
88750
88750
  }
@@ -153628,8 +153628,7 @@ var concatLink = (host, path2) => {
153628
153628
  // src/huly/auth-utils.ts
153629
153629
  var import_platform = __toESM(require_lib(), 1);
153630
153630
 
153631
- // src/huly/errors.ts
153632
- var BYTES_PER_MB = 1024 * 1024;
153631
+ // src/huly/errors-base.ts
153633
153632
  var HulyError = class extends Schema_exports.TaggedError()("HulyError", {
153634
153633
  message: Schema_exports.String,
153635
153634
  cause: Schema_exports.optional(Schema_exports.Defect)
@@ -153650,38 +153649,64 @@ var HulyAuthError = class extends Schema_exports.TaggedError()(
153650
153649
  }
153651
153650
  ) {
153652
153651
  };
153653
- var IssueNotFoundError = class extends Schema_exports.TaggedError()(
153654
- "IssueNotFoundError",
153652
+
153653
+ // src/huly/errors-calendar.ts
153654
+ var EventNotFoundError = class extends Schema_exports.TaggedError()(
153655
+ "EventNotFoundError",
153655
153656
  {
153656
- identifier: Schema_exports.String,
153657
- project: Schema_exports.String
153657
+ eventId: Schema_exports.String
153658
153658
  }
153659
153659
  ) {
153660
153660
  get message() {
153661
- return `Issue '${this.identifier}' not found in project '${this.project}'`;
153661
+ return `Event '${this.eventId}' not found`;
153662
153662
  }
153663
153663
  };
153664
- var ProjectNotFoundError = class extends Schema_exports.TaggedError()(
153665
- "ProjectNotFoundError",
153664
+ var RecurringEventNotFoundError = class extends Schema_exports.TaggedError()(
153665
+ "RecurringEventNotFoundError",
153666
+ {
153667
+ eventId: Schema_exports.String
153668
+ }
153669
+ ) {
153670
+ get message() {
153671
+ return `Recurring event '${this.eventId}' not found`;
153672
+ }
153673
+ };
153674
+
153675
+ // src/huly/errors-cards.ts
153676
+ var CardSpaceNotFoundError = class extends Schema_exports.TaggedError()(
153677
+ "CardSpaceNotFoundError",
153666
153678
  {
153667
153679
  identifier: Schema_exports.String
153668
153680
  }
153669
153681
  ) {
153670
153682
  get message() {
153671
- return `Project '${this.identifier}' not found`;
153683
+ return `Card space '${this.identifier}' not found`;
153672
153684
  }
153673
153685
  };
153674
- var InvalidStatusError = class extends Schema_exports.TaggedError()(
153675
- "InvalidStatusError",
153686
+ var CardNotFoundError = class extends Schema_exports.TaggedError()(
153687
+ "CardNotFoundError",
153676
153688
  {
153677
- status: Schema_exports.String,
153678
- project: Schema_exports.String
153689
+ identifier: Schema_exports.String,
153690
+ cardSpace: Schema_exports.String
153679
153691
  }
153680
153692
  ) {
153681
153693
  get message() {
153682
- return `Invalid status '${this.status}' for project '${this.project}'`;
153694
+ return `Card '${this.identifier}' not found in card space '${this.cardSpace}'`;
153683
153695
  }
153684
153696
  };
153697
+ var MasterTagNotFoundError = class extends Schema_exports.TaggedError()(
153698
+ "MasterTagNotFoundError",
153699
+ {
153700
+ identifier: Schema_exports.String,
153701
+ cardSpace: Schema_exports.String
153702
+ }
153703
+ ) {
153704
+ get message() {
153705
+ return `Master tag '${this.identifier}' not found in card space '${this.cardSpace}'`;
153706
+ }
153707
+ };
153708
+
153709
+ // src/huly/errors-contacts.ts
153685
153710
  var PersonNotFoundError = class extends Schema_exports.TaggedError()(
153686
153711
  "PersonNotFoundError",
153687
153712
  {
@@ -153692,6 +153717,42 @@ var PersonNotFoundError = class extends Schema_exports.TaggedError()(
153692
153717
  return `Person '${this.identifier}' not found`;
153693
153718
  }
153694
153719
  };
153720
+ var InvalidPersonUuidError = class extends Schema_exports.TaggedError()(
153721
+ "InvalidPersonUuidError",
153722
+ {
153723
+ uuid: Schema_exports.String
153724
+ }
153725
+ ) {
153726
+ get message() {
153727
+ return `Invalid PersonUuid format: '${this.uuid}'`;
153728
+ }
153729
+ };
153730
+
153731
+ // src/huly/errors-documents.ts
153732
+ var TeamspaceNotFoundError = class extends Schema_exports.TaggedError()(
153733
+ "TeamspaceNotFoundError",
153734
+ {
153735
+ identifier: Schema_exports.String
153736
+ }
153737
+ ) {
153738
+ get message() {
153739
+ return `Teamspace '${this.identifier}' not found`;
153740
+ }
153741
+ };
153742
+ var DocumentNotFoundError = class extends Schema_exports.TaggedError()(
153743
+ "DocumentNotFoundError",
153744
+ {
153745
+ identifier: Schema_exports.String,
153746
+ teamspace: Schema_exports.String
153747
+ }
153748
+ ) {
153749
+ get message() {
153750
+ return `Document '${this.identifier}' not found in teamspace '${this.teamspace}'`;
153751
+ }
153752
+ };
153753
+
153754
+ // src/huly/errors-files.ts
153755
+ var BYTES_PER_MB = 1024 * 1024;
153695
153756
  var FileUploadError = class extends Schema_exports.TaggedError()(
153696
153757
  "FileUploadError",
153697
153758
  {
@@ -153728,50 +153789,66 @@ var FileFetchError = class extends Schema_exports.TaggedError()(
153728
153789
  return `Failed to fetch file from ${this.fileUrl}: ${this.reason}`;
153729
153790
  }
153730
153791
  };
153731
- var TeamspaceNotFoundError = class extends Schema_exports.TaggedError()(
153732
- "TeamspaceNotFoundError",
153792
+ var AttachmentNotFoundError = class extends Schema_exports.TaggedError()(
153793
+ "AttachmentNotFoundError",
153733
153794
  {
153734
- identifier: Schema_exports.String
153795
+ attachmentId: Schema_exports.String
153735
153796
  }
153736
153797
  ) {
153737
153798
  get message() {
153738
- return `Teamspace '${this.identifier}' not found`;
153799
+ return `Attachment '${this.attachmentId}' not found`;
153739
153800
  }
153740
153801
  };
153741
- var DocumentNotFoundError = class extends Schema_exports.TaggedError()(
153742
- "DocumentNotFoundError",
153802
+ var FileTooLargeError = class extends Schema_exports.TaggedError()(
153803
+ "FileTooLargeError",
153743
153804
  {
153744
- identifier: Schema_exports.String,
153745
- teamspace: Schema_exports.String
153805
+ filename: Schema_exports.String,
153806
+ size: Schema_exports.Number,
153807
+ maxSize: Schema_exports.Number
153746
153808
  }
153747
153809
  ) {
153748
153810
  get message() {
153749
- return `Document '${this.identifier}' not found in teamspace '${this.teamspace}'`;
153811
+ const DECIMAL_PLACES = 2;
153812
+ const sizeMB = (this.size / BYTES_PER_MB).toFixed(DECIMAL_PLACES);
153813
+ const maxMB = (this.maxSize / BYTES_PER_MB).toFixed(0);
153814
+ return `File '${this.filename}' is too large (${sizeMB}MB). Maximum allowed: ${maxMB}MB`;
153750
153815
  }
153751
153816
  };
153752
- var CommentNotFoundError = class extends Schema_exports.TaggedError()(
153753
- "CommentNotFoundError",
153817
+ var InvalidContentTypeError = class extends Schema_exports.TaggedError()(
153818
+ "InvalidContentTypeError",
153754
153819
  {
153755
- commentId: Schema_exports.String,
153756
- issueIdentifier: Schema_exports.String,
153757
- project: Schema_exports.String
153820
+ filename: Schema_exports.String,
153821
+ contentType: Schema_exports.String
153758
153822
  }
153759
153823
  ) {
153760
153824
  get message() {
153761
- return `Comment '${this.commentId}' not found on issue '${this.issueIdentifier}' in project '${this.project}'`;
153825
+ return `Invalid content type '${this.contentType}' for file '${this.filename}'`;
153762
153826
  }
153763
153827
  };
153764
- var MilestoneNotFoundError = class extends Schema_exports.TaggedError()(
153765
- "MilestoneNotFoundError",
153828
+
153829
+ // src/huly/errors-labels.ts
153830
+ var TagNotFoundError = class extends Schema_exports.TaggedError()(
153831
+ "TagNotFoundError",
153766
153832
  {
153767
- identifier: Schema_exports.String,
153768
- project: Schema_exports.String
153833
+ identifier: Schema_exports.String
153769
153834
  }
153770
153835
  ) {
153771
153836
  get message() {
153772
- return `Milestone '${this.identifier}' not found in project '${this.project}'`;
153837
+ return `Tag/label '${this.identifier}' not found`;
153773
153838
  }
153774
153839
  };
153840
+ var TagCategoryNotFoundError = class extends Schema_exports.TaggedError()(
153841
+ "TagCategoryNotFoundError",
153842
+ {
153843
+ identifier: Schema_exports.String
153844
+ }
153845
+ ) {
153846
+ get message() {
153847
+ return `Tag category '${this.identifier}' not found`;
153848
+ }
153849
+ };
153850
+
153851
+ // src/huly/errors-messaging.ts
153775
153852
  var ChannelNotFoundError = class extends Schema_exports.TaggedError()(
153776
153853
  "ChannelNotFoundError",
153777
153854
  {
@@ -153804,26 +153881,6 @@ var ThreadReplyNotFoundError = class extends Schema_exports.TaggedError()(
153804
153881
  return `Thread reply '${this.replyId}' not found on message '${this.messageId}'`;
153805
153882
  }
153806
153883
  };
153807
- var EventNotFoundError = class extends Schema_exports.TaggedError()(
153808
- "EventNotFoundError",
153809
- {
153810
- eventId: Schema_exports.String
153811
- }
153812
- ) {
153813
- get message() {
153814
- return `Event '${this.eventId}' not found`;
153815
- }
153816
- };
153817
- var RecurringEventNotFoundError = class extends Schema_exports.TaggedError()(
153818
- "RecurringEventNotFoundError",
153819
- {
153820
- eventId: Schema_exports.String
153821
- }
153822
- ) {
153823
- get message() {
153824
- return `Recurring event '${this.eventId}' not found`;
153825
- }
153826
- };
153827
153884
  var ActivityMessageNotFoundError = class extends Schema_exports.TaggedError()(
153828
153885
  "ActivityMessageNotFoundError",
153829
153886
  {
@@ -153855,68 +153912,30 @@ var SavedMessageNotFoundError = class extends Schema_exports.TaggedError()(
153855
153912
  return `Saved message for '${this.messageId}' not found`;
153856
153913
  }
153857
153914
  };
153858
- var AttachmentNotFoundError = class extends Schema_exports.TaggedError()(
153859
- "AttachmentNotFoundError",
153860
- {
153861
- attachmentId: Schema_exports.String
153862
- }
153863
- ) {
153864
- get message() {
153865
- return `Attachment '${this.attachmentId}' not found`;
153866
- }
153867
- };
153868
- var CardSpaceNotFoundError = class extends Schema_exports.TaggedError()(
153869
- "CardSpaceNotFoundError",
153870
- {
153871
- identifier: Schema_exports.String
153872
- }
153873
- ) {
153874
- get message() {
153875
- return `Card space '${this.identifier}' not found`;
153876
- }
153877
- };
153878
- var CardNotFoundError = class extends Schema_exports.TaggedError()(
153879
- "CardNotFoundError",
153880
- {
153881
- identifier: Schema_exports.String,
153882
- cardSpace: Schema_exports.String
153883
- }
153884
- ) {
153885
- get message() {
153886
- return `Card '${this.identifier}' not found in card space '${this.cardSpace}'`;
153887
- }
153888
- };
153889
- var MasterTagNotFoundError = class extends Schema_exports.TaggedError()(
153890
- "MasterTagNotFoundError",
153891
- {
153892
- identifier: Schema_exports.String,
153893
- cardSpace: Schema_exports.String
153894
- }
153895
- ) {
153896
- get message() {
153897
- return `Master tag '${this.identifier}' not found in card space '${this.cardSpace}'`;
153898
- }
153899
- };
153900
- var TagNotFoundError = class extends Schema_exports.TaggedError()(
153901
- "TagNotFoundError",
153915
+
153916
+ // src/huly/errors-notifications.ts
153917
+ var NotificationNotFoundError = class extends Schema_exports.TaggedError()(
153918
+ "NotificationNotFoundError",
153902
153919
  {
153903
- identifier: Schema_exports.String
153920
+ notificationId: Schema_exports.String
153904
153921
  }
153905
153922
  ) {
153906
153923
  get message() {
153907
- return `Tag/label '${this.identifier}' not found`;
153924
+ return `Notification '${this.notificationId}' not found`;
153908
153925
  }
153909
153926
  };
153910
- var TagCategoryNotFoundError = class extends Schema_exports.TaggedError()(
153911
- "TagCategoryNotFoundError",
153927
+ var NotificationContextNotFoundError = class extends Schema_exports.TaggedError()(
153928
+ "NotificationContextNotFoundError",
153912
153929
  {
153913
- identifier: Schema_exports.String
153930
+ contextId: Schema_exports.String
153914
153931
  }
153915
153932
  ) {
153916
153933
  get message() {
153917
- return `Tag category '${this.identifier}' not found`;
153934
+ return `Notification context '${this.contextId}' not found`;
153918
153935
  }
153919
153936
  };
153937
+
153938
+ // src/huly/errors-test-management.ts
153920
153939
  var TestProjectNotFoundError = class extends Schema_exports.TaggedError()(
153921
153940
  "TestProjectNotFoundError",
153922
153941
  {
@@ -153988,96 +154007,99 @@ var TestPlanItemNotFoundError = class extends Schema_exports.TaggedError()(
153988
154007
  return `Test plan item '${this.identifier}' not found in plan '${this.plan}'`;
153989
154008
  }
153990
154009
  };
153991
- var ComponentNotFoundError = class extends Schema_exports.TaggedError()(
153992
- "ComponentNotFoundError",
154010
+
154011
+ // src/huly/errors-tracker.ts
154012
+ var IssueNotFoundError = class extends Schema_exports.TaggedError()(
154013
+ "IssueNotFoundError",
153993
154014
  {
153994
154015
  identifier: Schema_exports.String,
153995
154016
  project: Schema_exports.String
153996
154017
  }
153997
154018
  ) {
153998
154019
  get message() {
153999
- return `Component '${this.identifier}' not found in project '${this.project}'`;
154020
+ return `Issue '${this.identifier}' not found in project '${this.project}'`;
154000
154021
  }
154001
154022
  };
154002
- var IssueTemplateNotFoundError = class extends Schema_exports.TaggedError()(
154003
- "IssueTemplateNotFoundError",
154023
+ var ProjectNotFoundError = class extends Schema_exports.TaggedError()(
154024
+ "ProjectNotFoundError",
154004
154025
  {
154005
- identifier: Schema_exports.String,
154006
- project: Schema_exports.String
154026
+ identifier: Schema_exports.String
154007
154027
  }
154008
154028
  ) {
154009
154029
  get message() {
154010
- return `Issue template '${this.identifier}' not found in project '${this.project}'`;
154030
+ return `Project '${this.identifier}' not found`;
154011
154031
  }
154012
154032
  };
154013
- var TemplateChildNotFoundError = class extends Schema_exports.TaggedError()(
154014
- "TemplateChildNotFoundError",
154033
+ var InvalidStatusError = class extends Schema_exports.TaggedError()(
154034
+ "InvalidStatusError",
154015
154035
  {
154016
- childId: Schema_exports.String,
154017
- template: Schema_exports.String,
154036
+ status: Schema_exports.String,
154018
154037
  project: Schema_exports.String
154019
154038
  }
154020
154039
  ) {
154021
154040
  get message() {
154022
- return `Child template '${this.childId}' not found in template '${this.template}' of project '${this.project}'`;
154041
+ return `Invalid status '${this.status}' for project '${this.project}'`;
154023
154042
  }
154024
154043
  };
154025
- var NotificationNotFoundError = class extends Schema_exports.TaggedError()(
154026
- "NotificationNotFoundError",
154044
+ var CommentNotFoundError = class extends Schema_exports.TaggedError()(
154045
+ "CommentNotFoundError",
154027
154046
  {
154028
- notificationId: Schema_exports.String
154047
+ commentId: Schema_exports.String,
154048
+ issueIdentifier: Schema_exports.String,
154049
+ project: Schema_exports.String
154029
154050
  }
154030
154051
  ) {
154031
154052
  get message() {
154032
- return `Notification '${this.notificationId}' not found`;
154053
+ return `Comment '${this.commentId}' not found on issue '${this.issueIdentifier}' in project '${this.project}'`;
154033
154054
  }
154034
154055
  };
154035
- var NotificationContextNotFoundError = class extends Schema_exports.TaggedError()(
154036
- "NotificationContextNotFoundError",
154056
+ var MilestoneNotFoundError = class extends Schema_exports.TaggedError()(
154057
+ "MilestoneNotFoundError",
154037
154058
  {
154038
- contextId: Schema_exports.String
154059
+ identifier: Schema_exports.String,
154060
+ project: Schema_exports.String
154039
154061
  }
154040
154062
  ) {
154041
154063
  get message() {
154042
- return `Notification context '${this.contextId}' not found`;
154064
+ return `Milestone '${this.identifier}' not found in project '${this.project}'`;
154043
154065
  }
154044
154066
  };
154045
- var InvalidPersonUuidError = class extends Schema_exports.TaggedError()(
154046
- "InvalidPersonUuidError",
154067
+ var ComponentNotFoundError = class extends Schema_exports.TaggedError()(
154068
+ "ComponentNotFoundError",
154047
154069
  {
154048
- uuid: Schema_exports.String
154070
+ identifier: Schema_exports.String,
154071
+ project: Schema_exports.String
154049
154072
  }
154050
154073
  ) {
154051
154074
  get message() {
154052
- return `Invalid PersonUuid format: '${this.uuid}'`;
154075
+ return `Component '${this.identifier}' not found in project '${this.project}'`;
154053
154076
  }
154054
154077
  };
154055
- var FileTooLargeError = class extends Schema_exports.TaggedError()(
154056
- "FileTooLargeError",
154078
+ var IssueTemplateNotFoundError = class extends Schema_exports.TaggedError()(
154079
+ "IssueTemplateNotFoundError",
154057
154080
  {
154058
- filename: Schema_exports.String,
154059
- size: Schema_exports.Number,
154060
- maxSize: Schema_exports.Number
154081
+ identifier: Schema_exports.String,
154082
+ project: Schema_exports.String
154061
154083
  }
154062
154084
  ) {
154063
154085
  get message() {
154064
- const DECIMAL_PLACES = 2;
154065
- const sizeMB = (this.size / BYTES_PER_MB).toFixed(DECIMAL_PLACES);
154066
- const maxMB = (this.maxSize / BYTES_PER_MB).toFixed(0);
154067
- return `File '${this.filename}' is too large (${sizeMB}MB). Maximum allowed: ${maxMB}MB`;
154086
+ return `Issue template '${this.identifier}' not found in project '${this.project}'`;
154068
154087
  }
154069
154088
  };
154070
- var InvalidContentTypeError = class extends Schema_exports.TaggedError()(
154071
- "InvalidContentTypeError",
154089
+ var TemplateChildNotFoundError = class extends Schema_exports.TaggedError()(
154090
+ "TemplateChildNotFoundError",
154072
154091
  {
154073
- filename: Schema_exports.String,
154074
- contentType: Schema_exports.String
154092
+ childId: Schema_exports.String,
154093
+ template: Schema_exports.String,
154094
+ project: Schema_exports.String
154075
154095
  }
154076
154096
  ) {
154077
154097
  get message() {
154078
- return `Invalid content type '${this.contentType}' for file '${this.filename}'`;
154098
+ return `Child template '${this.childId}' not found in template '${this.template}' of project '${this.project}'`;
154079
154099
  }
154080
154100
  };
154101
+
154102
+ // src/huly/errors.ts
154081
154103
  var HulyDomainError = Schema_exports.Union(
154082
154104
  HulyError,
154083
154105
  HulyConnectionError,
@@ -154263,7 +154285,11 @@ var HulyClient = class _HulyClient extends Context_exports.Tag("@hulymcp/HulyCli
154263
154285
  message: `updateMarkup failed: ${String(e)}`,
154264
154286
  cause: e
154265
154287
  })
154266
- })
154288
+ }),
154289
+ searchFulltext: (query, options) => withClient(
154290
+ (client2) => client2.searchFulltext(query, options),
154291
+ "searchFulltext failed"
154292
+ )
154267
154293
  };
154268
154294
  return operations;
154269
154295
  })
@@ -154284,7 +154310,8 @@ var HulyClient = class _HulyClient extends Context_exports.Tag("@hulymcp/HulyCli
154284
154310
  removeDoc: notImplemented("removeDoc"),
154285
154311
  uploadMarkup: notImplemented("uploadMarkup"),
154286
154312
  fetchMarkup: noopFetchMarkup,
154287
- updateMarkup: notImplemented("updateMarkup")
154313
+ updateMarkup: notImplemented("updateMarkup"),
154314
+ searchFulltext: notImplemented("searchFulltext")
154288
154315
  };
154289
154316
  return Layer_exports.succeed(_HulyClient, { ...defaultOps, ...mockOperations });
154290
154317
  }
@@ -154442,6 +154469,9 @@ var TestPlanIdentifier = NonEmptyString2.pipe(Schema_exports.brand("TestPlanIden
154442
154469
  var TestRunIdentifier = NonEmptyString2.pipe(Schema_exports.brand("TestRunIdentifier"));
154443
154470
  var TestResultIdentifier = NonEmptyString2.pipe(Schema_exports.brand("TestResultIdentifier"));
154444
154471
 
154472
+ // src/utils/normalize.ts
154473
+ var normalizeForComparison = (s) => s.replace(/[-_ ]/g, "").toLowerCase();
154474
+
154445
154475
  // src/huly/huly-plugins.ts
154446
154476
  var activity = require_lib22().default;
154447
154477
  var attachment = require_lib23().default;
@@ -154659,6 +154689,16 @@ var findPersonByEmailOrName = (client, emailOrName) => Effect_exports.gen(functi
154659
154689
  );
154660
154690
  return likePerson;
154661
154691
  });
154692
+ var resolveStatusByName = (statuses, statusName, project3) => {
154693
+ const normalizedInput = normalizeForComparison(statusName);
154694
+ const matchingStatus = statuses.find(
154695
+ (s) => normalizeForComparison(s.name) === normalizedInput
154696
+ );
154697
+ if (matchingStatus === void 0) {
154698
+ return Effect_exports.fail(new InvalidStatusError({ status: statusName, project: project3 }));
154699
+ }
154700
+ return Effect_exports.succeed(matchingStatus._id);
154701
+ };
154662
154702
 
154663
154703
  // src/huly/storage.ts
154664
154704
  var MAX_FILE_SIZE_MB = 100;
@@ -174043,7 +174083,7 @@ var PostHog = class extends PostHogBackendClient {
174043
174083
  };
174044
174084
 
174045
174085
  // src/version.ts
174046
- var VERSION = true ? "0.1.48" : "0.0.0-dev";
174086
+ var VERSION = true ? "0.1.50" : "0.0.0-dev";
174047
174087
 
174048
174088
  // src/telemetry/posthog.ts
174049
174089
  var POSTHOG_API_KEY = "phc_TGfFqCGdnF0p68wuFzd5WSw1IsBvOJW0YgoMJDyZPjm";
@@ -175710,8 +175750,10 @@ var parseCreateRecurringEventParams = Schema_exports.decodeUnknown(CreateRecurri
175710
175750
  var parseListEventInstancesParams = Schema_exports.decodeUnknown(ListEventInstancesParamsSchema);
175711
175751
 
175712
175752
  // src/huly/operations/calendar.ts
175713
- var import_calendar = __toESM(require_lib24(), 1);
175714
- var import_core22 = __toESM(require_lib4(), 1);
175753
+ var import_calendar2 = __toESM(require_lib24(), 1);
175754
+ var import_core23 = __toESM(require_lib4(), 1);
175755
+
175756
+ // src/huly/operations/calendar-shared.ts
175715
175757
  var descriptionAsMarkupRef = (desc) => desc;
175716
175758
  var markupRefAsDescription = (ref) => ref ?? "";
175717
175759
  var emptyEventDescription = "";
@@ -175722,31 +175764,6 @@ var SECONDS_PER_MINUTE = 60;
175722
175764
  var MINUTES_PER_HOUR = 60;
175723
175765
  var MS_PER_SECOND = 1e3;
175724
175766
  var ONE_HOUR_MS = SECONDS_PER_MINUTE * MINUTES_PER_HOUR * MS_PER_SECOND;
175725
- var hulyRuleToRule = (rule) => ({
175726
- freq: rule.freq,
175727
- endDate: rule.endDate,
175728
- count: rule.count,
175729
- interval: rule.interval,
175730
- byDay: rule.byDay,
175731
- byMonthDay: rule.byMonthDay,
175732
- byMonth: rule.byMonth,
175733
- bySetPos: rule.bySetPos,
175734
- wkst: rule.wkst
175735
- });
175736
- var ruleToHulyRule = (rule) => {
175737
- const result = {
175738
- freq: rule.freq
175739
- };
175740
- if (rule.endDate !== void 0) result.endDate = rule.endDate;
175741
- if (rule.count !== void 0) result.count = rule.count;
175742
- if (rule.interval !== void 0) result.interval = rule.interval;
175743
- if (rule.byDay !== void 0) result.byDay = [...rule.byDay];
175744
- if (rule.byMonthDay !== void 0) result.byMonthDay = [...rule.byMonthDay];
175745
- if (rule.byMonth !== void 0) result.byMonth = [...rule.byMonth];
175746
- if (rule.bySetPos !== void 0) result.bySetPos = [...rule.bySetPos];
175747
- if (rule.wkst !== void 0) result.wkst = rule.wkst;
175748
- return result;
175749
- };
175750
175767
  var findPersonsByEmails = (client, emails) => Effect_exports.gen(function* () {
175751
175768
  if (emails.length === 0) return [];
175752
175769
  const allChannels = yield* client.findAll(
@@ -175789,6 +175806,167 @@ var resolveEventInputs = (client, params, eventClass, eventId) => Effect_exports
175789
175806
  ) : null;
175790
175807
  return { calendarRef, participantRefs, descriptionRef };
175791
175808
  });
175809
+
175810
+ // src/huly/operations/calendar-recurring.ts
175811
+ var import_calendar = __toESM(require_lib24(), 1);
175812
+ var import_core22 = __toESM(require_lib4(), 1);
175813
+ var hulyRuleToRule = (rule) => ({
175814
+ freq: rule.freq,
175815
+ endDate: rule.endDate,
175816
+ count: rule.count,
175817
+ interval: rule.interval,
175818
+ byDay: rule.byDay,
175819
+ byMonthDay: rule.byMonthDay,
175820
+ byMonth: rule.byMonth,
175821
+ bySetPos: rule.bySetPos,
175822
+ wkst: rule.wkst
175823
+ });
175824
+ var ruleToHulyRule = (rule) => {
175825
+ const result = {
175826
+ freq: rule.freq
175827
+ };
175828
+ if (rule.endDate !== void 0) result.endDate = rule.endDate;
175829
+ if (rule.count !== void 0) result.count = rule.count;
175830
+ if (rule.interval !== void 0) result.interval = rule.interval;
175831
+ if (rule.byDay !== void 0) result.byDay = [...rule.byDay];
175832
+ if (rule.byMonthDay !== void 0) result.byMonthDay = [...rule.byMonthDay];
175833
+ if (rule.byMonth !== void 0) result.byMonth = [...rule.byMonth];
175834
+ if (rule.bySetPos !== void 0) result.bySetPos = [...rule.bySetPos];
175835
+ if (rule.wkst !== void 0) result.wkst = rule.wkst;
175836
+ return result;
175837
+ };
175838
+ var listRecurringEvents = (params) => Effect_exports.gen(function* () {
175839
+ const client = yield* HulyClient;
175840
+ const limit = clampLimit(params.limit);
175841
+ const events = yield* client.findAll(
175842
+ calendar.class.ReccuringEvent,
175843
+ {},
175844
+ {
175845
+ limit,
175846
+ sort: { modifiedOn: import_core22.SortingOrder.Descending }
175847
+ }
175848
+ );
175849
+ const summaries = events.map((event) => ({
175850
+ eventId: EventId.make(event.eventId),
175851
+ title: event.title,
175852
+ originalStartTime: event.originalStartTime,
175853
+ rules: event.rules.map(hulyRuleToRule),
175854
+ timeZone: event.timeZone,
175855
+ modifiedOn: event.modifiedOn
175856
+ }));
175857
+ return summaries;
175858
+ });
175859
+ var createRecurringEvent = (params) => Effect_exports.gen(function* () {
175860
+ const client = yield* HulyClient;
175861
+ const eventId = (0, import_calendar.generateEventId)();
175862
+ const dueDate = params.dueDate ?? params.startDate + ONE_HOUR_MS;
175863
+ const { calendarRef, descriptionRef, participantRefs } = yield* resolveEventInputs(
175864
+ client,
175865
+ params,
175866
+ calendar.class.ReccuringEvent,
175867
+ eventId
175868
+ );
175869
+ const hulyRules = params.rules.map(ruleToHulyRule);
175870
+ const eventData = {
175871
+ eventId,
175872
+ title: params.title,
175873
+ description: markupRefAsDescription(descriptionRef),
175874
+ date: params.startDate,
175875
+ dueDate,
175876
+ allDay: params.allDay ?? false,
175877
+ calendar: calendarRef,
175878
+ participants: participantRefs,
175879
+ externalParticipants: [],
175880
+ access: import_calendar.AccessLevel.Owner,
175881
+ user: serverPopulatedUser,
175882
+ blockTime: false,
175883
+ rules: hulyRules,
175884
+ exdate: [],
175885
+ rdate: [],
175886
+ originalStartTime: params.startDate,
175887
+ timeZone: params.timeZone ?? Intl.DateTimeFormat().resolvedOptions().timeZone
175888
+ };
175889
+ if (params.location !== void 0) {
175890
+ eventData.location = params.location;
175891
+ }
175892
+ if (params.visibility !== void 0) {
175893
+ const vis = stringToVisibility(params.visibility);
175894
+ if (vis !== void 0) {
175895
+ eventData.visibility = vis;
175896
+ }
175897
+ }
175898
+ yield* client.addCollection(
175899
+ calendar.class.ReccuringEvent,
175900
+ toRef(calendar.space.Calendar),
175901
+ toRef(calendar.space.Calendar),
175902
+ toRef(core.class.Space),
175903
+ "events",
175904
+ eventData
175905
+ );
175906
+ return { eventId: EventId.make(eventId) };
175907
+ });
175908
+ var listEventInstances = (params) => Effect_exports.gen(function* () {
175909
+ const client = yield* HulyClient;
175910
+ const recurringEvent = yield* client.findOne(
175911
+ calendar.class.ReccuringEvent,
175912
+ { eventId: params.recurringEventId }
175913
+ );
175914
+ if (recurringEvent === void 0) {
175915
+ return yield* new RecurringEventNotFoundError({ eventId: params.recurringEventId });
175916
+ }
175917
+ const query = {
175918
+ recurringEventId: params.recurringEventId
175919
+ };
175920
+ if (params.from !== void 0) {
175921
+ query.date = { $gte: params.from };
175922
+ }
175923
+ if (params.to !== void 0) {
175924
+ query.dueDate = { $lte: params.to };
175925
+ }
175926
+ const limit = clampLimit(params.limit);
175927
+ const instances = yield* client.findAll(
175928
+ calendar.class.ReccuringInstance,
175929
+ query,
175930
+ {
175931
+ limit,
175932
+ sort: { date: import_core22.SortingOrder.Ascending }
175933
+ }
175934
+ );
175935
+ const participantMap = /* @__PURE__ */ new Map();
175936
+ if (params.includeParticipants) {
175937
+ const allParticipantRefs = [...new Set(instances.flatMap((i) => i.participants))];
175938
+ if (allParticipantRefs.length > 0) {
175939
+ const participants = yield* buildParticipants(client, allParticipantRefs);
175940
+ const participantById = new Map(participants.map((p) => [p.id, p]));
175941
+ for (const instance of instances) {
175942
+ const instanceParticipants = instance.participants.map((ref) => participantById.get(PersonId.make(ref))).filter((p) => p !== void 0);
175943
+ participantMap.set(instance.eventId, instanceParticipants);
175944
+ }
175945
+ } else {
175946
+ for (const instance of instances) {
175947
+ participantMap.set(instance.eventId, []);
175948
+ }
175949
+ }
175950
+ }
175951
+ const results = instances.map((instance) => ({
175952
+ eventId: EventId.make(instance.eventId),
175953
+ recurringEventId: EventId.make(instance.recurringEventId),
175954
+ title: instance.title,
175955
+ date: instance.date,
175956
+ dueDate: instance.dueDate,
175957
+ originalStartTime: instance.originalStartTime,
175958
+ allDay: instance.allDay,
175959
+ location: instance.location,
175960
+ visibility: visibilityToString(instance.visibility),
175961
+ isCancelled: instance.isCancelled,
175962
+ isVirtual: instance.virtual,
175963
+ participants: params.includeParticipants ? participantMap.get(instance.eventId) ?? [] : void 0,
175964
+ externalParticipants: instance.externalParticipants ? instance.externalParticipants.map((p) => Email.make(p)) : void 0
175965
+ }));
175966
+ return results;
175967
+ });
175968
+
175969
+ // src/huly/operations/calendar.ts
175792
175970
  var listEvents = (params) => Effect_exports.gen(function* () {
175793
175971
  const client = yield* HulyClient;
175794
175972
  const query = {};
@@ -175804,7 +175982,7 @@ var listEvents = (params) => Effect_exports.gen(function* () {
175804
175982
  query,
175805
175983
  {
175806
175984
  limit,
175807
- sort: { date: import_core22.SortingOrder.Ascending }
175985
+ sort: { date: import_core23.SortingOrder.Ascending }
175808
175986
  }
175809
175987
  );
175810
175988
  const summaries = events.map((event) => ({
@@ -175854,7 +176032,7 @@ var getEvent = (params) => Effect_exports.gen(function* () {
175854
176032
  });
175855
176033
  var createEvent = (params) => Effect_exports.gen(function* () {
175856
176034
  const client = yield* HulyClient;
175857
- const eventId = (0, import_calendar.generateEventId)();
176035
+ const eventId = (0, import_calendar2.generateEventId)();
175858
176036
  const dueDate = params.dueDate ?? params.date + ONE_HOUR_MS;
175859
176037
  const { calendarRef, descriptionRef, participantRefs } = yield* resolveEventInputs(
175860
176038
  client,
@@ -175872,7 +176050,7 @@ var createEvent = (params) => Effect_exports.gen(function* () {
175872
176050
  calendar: calendarRef,
175873
176051
  participants: participantRefs,
175874
176052
  externalParticipants: [],
175875
- access: import_calendar.AccessLevel.Owner,
176053
+ access: import_calendar2.AccessLevel.Owner,
175876
176054
  user: serverPopulatedUser,
175877
176055
  blockTime: false
175878
176056
  };
@@ -175979,136 +176157,6 @@ var deleteEvent = (params) => Effect_exports.gen(function* () {
175979
176157
  );
175980
176158
  return { eventId: EventId.make(params.eventId), deleted: true };
175981
176159
  });
175982
- var listRecurringEvents = (params) => Effect_exports.gen(function* () {
175983
- const client = yield* HulyClient;
175984
- const limit = clampLimit(params.limit);
175985
- const events = yield* client.findAll(
175986
- calendar.class.ReccuringEvent,
175987
- {},
175988
- {
175989
- limit,
175990
- sort: { modifiedOn: import_core22.SortingOrder.Descending }
175991
- }
175992
- );
175993
- const summaries = events.map((event) => ({
175994
- eventId: EventId.make(event.eventId),
175995
- title: event.title,
175996
- originalStartTime: event.originalStartTime,
175997
- rules: event.rules.map(hulyRuleToRule),
175998
- timeZone: event.timeZone,
175999
- modifiedOn: event.modifiedOn
176000
- }));
176001
- return summaries;
176002
- });
176003
- var createRecurringEvent = (params) => Effect_exports.gen(function* () {
176004
- const client = yield* HulyClient;
176005
- const eventId = (0, import_calendar.generateEventId)();
176006
- const dueDate = params.dueDate ?? params.startDate + ONE_HOUR_MS;
176007
- const { calendarRef, descriptionRef, participantRefs } = yield* resolveEventInputs(
176008
- client,
176009
- params,
176010
- calendar.class.ReccuringEvent,
176011
- eventId
176012
- );
176013
- const hulyRules = params.rules.map(ruleToHulyRule);
176014
- const eventData = {
176015
- eventId,
176016
- title: params.title,
176017
- description: markupRefAsDescription(descriptionRef),
176018
- date: params.startDate,
176019
- dueDate,
176020
- allDay: params.allDay ?? false,
176021
- calendar: calendarRef,
176022
- participants: participantRefs,
176023
- externalParticipants: [],
176024
- access: import_calendar.AccessLevel.Owner,
176025
- user: serverPopulatedUser,
176026
- blockTime: false,
176027
- rules: hulyRules,
176028
- exdate: [],
176029
- rdate: [],
176030
- originalStartTime: params.startDate,
176031
- timeZone: params.timeZone ?? Intl.DateTimeFormat().resolvedOptions().timeZone
176032
- };
176033
- if (params.location !== void 0) {
176034
- eventData.location = params.location;
176035
- }
176036
- if (params.visibility !== void 0) {
176037
- const vis = stringToVisibility(params.visibility);
176038
- if (vis !== void 0) {
176039
- eventData.visibility = vis;
176040
- }
176041
- }
176042
- yield* client.addCollection(
176043
- calendar.class.ReccuringEvent,
176044
- toRef(calendar.space.Calendar),
176045
- toRef(calendar.space.Calendar),
176046
- toRef(core.class.Space),
176047
- "events",
176048
- eventData
176049
- );
176050
- return { eventId: EventId.make(eventId) };
176051
- });
176052
- var listEventInstances = (params) => Effect_exports.gen(function* () {
176053
- const client = yield* HulyClient;
176054
- const recurringEvent = yield* client.findOne(
176055
- calendar.class.ReccuringEvent,
176056
- { eventId: params.recurringEventId }
176057
- );
176058
- if (recurringEvent === void 0) {
176059
- return yield* new RecurringEventNotFoundError({ eventId: params.recurringEventId });
176060
- }
176061
- const query = {
176062
- recurringEventId: params.recurringEventId
176063
- };
176064
- if (params.from !== void 0) {
176065
- query.date = { $gte: params.from };
176066
- }
176067
- if (params.to !== void 0) {
176068
- query.dueDate = { $lte: params.to };
176069
- }
176070
- const limit = clampLimit(params.limit);
176071
- const instances = yield* client.findAll(
176072
- calendar.class.ReccuringInstance,
176073
- query,
176074
- {
176075
- limit,
176076
- sort: { date: import_core22.SortingOrder.Ascending }
176077
- }
176078
- );
176079
- const participantMap = /* @__PURE__ */ new Map();
176080
- if (params.includeParticipants) {
176081
- const allParticipantRefs = [...new Set(instances.flatMap((i) => i.participants))];
176082
- if (allParticipantRefs.length > 0) {
176083
- const participants = yield* buildParticipants(client, allParticipantRefs);
176084
- const participantById = new Map(participants.map((p) => [p.id, p]));
176085
- for (const instance of instances) {
176086
- const instanceParticipants = instance.participants.map((ref) => participantById.get(PersonId.make(ref))).filter((p) => p !== void 0);
176087
- participantMap.set(instance.eventId, instanceParticipants);
176088
- }
176089
- } else {
176090
- for (const instance of instances) {
176091
- participantMap.set(instance.eventId, []);
176092
- }
176093
- }
176094
- }
176095
- const results = instances.map((instance) => ({
176096
- eventId: EventId.make(instance.eventId),
176097
- recurringEventId: EventId.make(instance.recurringEventId),
176098
- title: instance.title,
176099
- date: instance.date,
176100
- dueDate: instance.dueDate,
176101
- originalStartTime: instance.originalStartTime,
176102
- allDay: instance.allDay,
176103
- location: instance.location,
176104
- visibility: visibilityToString(instance.visibility),
176105
- isCancelled: instance.isCancelled,
176106
- isVirtual: instance.virtual,
176107
- participants: params.includeParticipants ? participantMap.get(instance.eventId) ?? [] : void 0,
176108
- externalParticipants: instance.externalParticipants ? instance.externalParticipants.map((p) => Email.make(p)) : void 0
176109
- }));
176110
- return results;
176111
- });
176112
176160
 
176113
176161
  // src/mcp/tools/calendar.ts
176114
176162
  var CATEGORY3 = "calendar";
@@ -176381,9 +176429,6 @@ var parseCreateCardParams = Schema_exports.decodeUnknown(CreateCardParamsSchema)
176381
176429
  var parseUpdateCardParams = Schema_exports.decodeUnknown(UpdateCardParamsSchema);
176382
176430
  var parseDeleteCardParams = Schema_exports.decodeUnknown(DeleteCardParamsSchema);
176383
176431
 
176384
- // src/utils/normalize.ts
176385
- var normalizeForComparison = (s) => s.replace(/[-_ ]/g, "").toLowerCase();
176386
-
176387
176432
  // src/domain/schemas/issues.ts
176388
176433
  var IssuePriorityValues = ["urgent", "high", "medium", "low", "no-priority"];
176389
176434
  var IssuePriorityLiteral = Schema_exports.Literal(...IssuePriorityValues);
@@ -178053,6 +178098,23 @@ var FulltextSearchParamsSchema = Schema_exports.Struct({
178053
178098
  title: "FulltextSearchParams",
178054
178099
  description: "Parameters for fulltext search"
178055
178100
  });
178101
+ var SearchResultDocInner = Schema_exports.Struct({
178102
+ _id: Schema_exports.String,
178103
+ _class: Schema_exports.String,
178104
+ createdOn: Schema_exports.optional(Schema_exports.Number)
178105
+ });
178106
+ var SearchResultDocSchema = Schema_exports.Struct({
178107
+ id: Schema_exports.String,
178108
+ title: Schema_exports.optional(Schema_exports.String),
178109
+ description: Schema_exports.optional(Schema_exports.String),
178110
+ score: Schema_exports.optional(Schema_exports.Number),
178111
+ doc: SearchResultDocInner
178112
+ });
178113
+ var SearchResultSchema = Schema_exports.Struct({
178114
+ docs: Schema_exports.Array(SearchResultDocSchema),
178115
+ total: Schema_exports.optional(Schema_exports.Number)
178116
+ });
178117
+ var parseSearchResult = Schema_exports.decodeUnknown(SearchResultSchema);
178056
178118
  var fulltextSearchParamsJsonSchema = JSONSchema_exports.make(FulltextSearchParamsSchema);
178057
178119
  var parseFulltextSearchParams = Schema_exports.decodeUnknown(FulltextSearchParamsSchema);
178058
178120
 
@@ -178772,7 +178834,7 @@ var parseDeleteTestResultParams = Schema_exports.decodeUnknown(DeleteTestResultP
178772
178834
  var parseRunTestPlanParams = Schema_exports.decodeUnknown(RunTestPlanParamsSchema);
178773
178835
 
178774
178836
  // src/huly/operations/cards.ts
178775
- var import_core23 = __toESM(require_lib4(), 1);
178837
+ var import_core24 = __toESM(require_lib4(), 1);
178776
178838
  var import_rank2 = __toESM(require_lib32(), 1);
178777
178839
  var findCardSpace = (identifier2) => Effect_exports.gen(function* () {
178778
178840
  const client = yield* HulyClient;
@@ -178837,7 +178899,7 @@ var listCardSpaces = (params) => Effect_exports.gen(function* () {
178837
178899
  {
178838
178900
  limit,
178839
178901
  sort: {
178840
- name: import_core23.SortingOrder.Ascending
178902
+ name: import_core24.SortingOrder.Ascending
178841
178903
  }
178842
178904
  }
178843
178905
  );
@@ -178893,7 +178955,7 @@ var listCards = (params) => Effect_exports.gen(function* () {
178893
178955
  {
178894
178956
  limit,
178895
178957
  sort: {
178896
- modifiedOn: import_core23.SortingOrder.Descending
178958
+ modifiedOn: import_core24.SortingOrder.Descending
178897
178959
  }
178898
178960
  }
178899
178961
  );
@@ -178935,11 +178997,11 @@ var getCard = (params) => Effect_exports.gen(function* () {
178935
178997
  var createCard = (params) => Effect_exports.gen(function* () {
178936
178998
  const { cardSpace, client } = yield* findCardSpace(params.cardSpace);
178937
178999
  const masterTag = yield* findMasterTag(client, cardSpace, params.type);
178938
- const cardId = (0, import_core23.generateId)();
179000
+ const cardId = (0, import_core24.generateId)();
178939
179001
  const lastCard = yield* client.findOne(
178940
179002
  cardPlugin.class.Card,
178941
179003
  { space: cardSpace._id },
178942
- { sort: { rank: import_core23.SortingOrder.Descending } }
179004
+ { sort: { rank: import_core24.SortingOrder.Descending } }
178943
179005
  );
178944
179006
  const rank = (0, import_rank2.makeRank)(lastCard?.rank, void 0);
178945
179007
  const contentMarkupRef = yield* client.uploadMarkup(
@@ -179127,7 +179189,7 @@ var cardTools = [
179127
179189
  ];
179128
179190
 
179129
179191
  // src/huly/operations/channels.ts
179130
- var import_core24 = __toESM(require_lib4(), 1);
179192
+ var import_core25 = __toESM(require_lib4(), 1);
179131
179193
  var import_text2 = __toESM(require_lib9(), 1);
179132
179194
  var import_text_markdown2 = __toESM(require_lib17(), 1);
179133
179195
  var personIdsAsSocialIdentityRefs = (ids3) => ids3;
@@ -179214,7 +179276,7 @@ var listChannels = (params) => Effect_exports.gen(function* () {
179214
179276
  {
179215
179277
  limit,
179216
179278
  sort: {
179217
- name: import_core24.SortingOrder.Ascending
179279
+ name: import_core25.SortingOrder.Ascending
179218
179280
  }
179219
179281
  }
179220
179282
  );
@@ -179252,7 +179314,7 @@ var getChannel = (params) => Effect_exports.gen(function* () {
179252
179314
  });
179253
179315
  var createChannel = (params) => Effect_exports.gen(function* () {
179254
179316
  const client = yield* HulyClient;
179255
- const channelId = (0, import_core24.generateId)();
179317
+ const channelId = (0, import_core25.generateId)();
179256
179318
  const channelData = {
179257
179319
  name: params.name,
179258
179320
  topic: params.topic || "",
@@ -179310,7 +179372,7 @@ var listChannelMessages = (params) => Effect_exports.gen(function* () {
179310
179372
  {
179311
179373
  limit,
179312
179374
  sort: {
179313
- createdOn: import_core24.SortingOrder.Descending
179375
+ createdOn: import_core25.SortingOrder.Descending
179314
179376
  }
179315
179377
  }
179316
179378
  );
@@ -179338,7 +179400,7 @@ var listChannelMessages = (params) => Effect_exports.gen(function* () {
179338
179400
  });
179339
179401
  var sendChannelMessage = (params) => Effect_exports.gen(function* () {
179340
179402
  const { channel, client } = yield* findChannel(params.channel);
179341
- const messageId = (0, import_core24.generateId)();
179403
+ const messageId = (0, import_core25.generateId)();
179342
179404
  const markup = markdownToMarkupString(params.body);
179343
179405
  const messageData = {
179344
179406
  message: markup,
@@ -179364,7 +179426,7 @@ var listDirectMessages = (params) => Effect_exports.gen(function* () {
179364
179426
  {
179365
179427
  limit,
179366
179428
  sort: {
179367
- modifiedOn: import_core24.SortingOrder.Descending
179429
+ modifiedOn: import_core25.SortingOrder.Descending
179368
179430
  }
179369
179431
  }
179370
179432
  );
@@ -179390,7 +179452,7 @@ var listDirectMessages = (params) => Effect_exports.gen(function* () {
179390
179452
  });
179391
179453
 
179392
179454
  // src/huly/operations/threads.ts
179393
- var import_core25 = __toESM(require_lib4(), 1);
179455
+ var import_core26 = __toESM(require_lib4(), 1);
179394
179456
  var findMessage = (channelIdentifier, messageId) => Effect_exports.gen(function* () {
179395
179457
  const { channel, client } = yield* findChannel(channelIdentifier);
179396
179458
  const message = yield* client.findOne(
@@ -179434,7 +179496,7 @@ var listThreadReplies = (params) => Effect_exports.gen(function* () {
179434
179496
  {
179435
179497
  limit,
179436
179498
  sort: {
179437
- createdOn: import_core25.SortingOrder.Ascending
179499
+ createdOn: import_core26.SortingOrder.Ascending
179438
179500
  }
179439
179501
  }
179440
179502
  );
@@ -179461,7 +179523,7 @@ var listThreadReplies = (params) => Effect_exports.gen(function* () {
179461
179523
  });
179462
179524
  var addThreadReply = (params) => Effect_exports.gen(function* () {
179463
179525
  const { channel, client, message } = yield* findMessage(params.channel, params.messageId);
179464
- const replyId = (0, import_core25.generateId)();
179526
+ const replyId = (0, import_core26.generateId)();
179465
179527
  const markup = markdownToMarkupString(params.body);
179466
179528
  const replyData = {
179467
179529
  message: markup,
@@ -179649,7 +179711,7 @@ var channelTools = [
179649
179711
  ];
179650
179712
 
179651
179713
  // src/huly/operations/comments.ts
179652
- var import_core26 = __toESM(require_lib4(), 1);
179714
+ var import_core27 = __toESM(require_lib4(), 1);
179653
179715
  var findProjectAndIssue2 = (params) => findProjectAndIssue({ project: params.project, identifier: params.issueIdentifier });
179654
179716
  var findComment = (params) => Effect_exports.gen(function* () {
179655
179717
  const { client, issue: issue2, project: project3 } = yield* findProjectAndIssue2({
@@ -179687,7 +179749,7 @@ var listComments = (params) => Effect_exports.gen(function* () {
179687
179749
  {
179688
179750
  limit,
179689
179751
  sort: {
179690
- createdOn: import_core26.SortingOrder.Ascending
179752
+ createdOn: import_core27.SortingOrder.Ascending
179691
179753
  }
179692
179754
  }
179693
179755
  );
@@ -179706,7 +179768,7 @@ var addComment = (params) => Effect_exports.gen(function* () {
179706
179768
  project: params.project,
179707
179769
  issueIdentifier: params.issueIdentifier
179708
179770
  });
179709
- const commentId = (0, import_core26.generateId)();
179771
+ const commentId = (0, import_core27.generateId)();
179710
179772
  const commentData = {
179711
179773
  message: params.body
179712
179774
  };
@@ -179814,7 +179876,7 @@ var commentTools = [
179814
179876
 
179815
179877
  // src/huly/operations/contacts.ts
179816
179878
  var import_contact = __toESM(require_lib27(), 1);
179817
- var import_core27 = __toESM(require_lib4(), 1);
179879
+ var import_core28 = __toESM(require_lib4(), 1);
179818
179880
  var formatName = (firstName, lastName) => `${lastName},${firstName}`;
179819
179881
  var parseName = (name) => {
179820
179882
  const parts2 = name.split(",");
@@ -179873,7 +179935,7 @@ var listPersons = (params) => Effect_exports.gen(function* () {
179873
179935
  query,
179874
179936
  {
179875
179937
  limit,
179876
- sort: { modifiedOn: import_core27.SortingOrder.Descending }
179938
+ sort: { modifiedOn: import_core28.SortingOrder.Descending }
179877
179939
  }
179878
179940
  );
179879
179941
  const personIds = persons.map((p) => p._id);
@@ -179943,7 +180005,7 @@ var getPerson = (params) => Effect_exports.gen(function* () {
179943
180005
  });
179944
180006
  var createPerson = (params) => Effect_exports.gen(function* () {
179945
180007
  const client = yield* HulyClient;
179946
- const personId = (0, import_core27.generateId)();
180008
+ const personId = (0, import_core28.generateId)();
179947
180009
  const personData = {
179948
180010
  name: formatName(params.firstName, params.lastName),
179949
180011
  // Huly API requires city field to be set, even if empty
@@ -180019,7 +180081,7 @@ var listEmployees = (params) => Effect_exports.gen(function* () {
180019
180081
  {},
180020
180082
  {
180021
180083
  limit,
180022
- sort: { modifiedOn: import_core27.SortingOrder.Descending }
180084
+ sort: { modifiedOn: import_core28.SortingOrder.Descending }
180023
180085
  }
180024
180086
  );
180025
180087
  const employeeIds = employees.map((e) => e._id);
@@ -180044,7 +180106,7 @@ var listOrganizations = (params) => Effect_exports.gen(function* () {
180044
180106
  {},
180045
180107
  {
180046
180108
  limit,
180047
- sort: { modifiedOn: import_core27.SortingOrder.Descending }
180109
+ sort: { modifiedOn: import_core28.SortingOrder.Descending }
180048
180110
  }
180049
180111
  );
180050
180112
  return orgs.map((org) => ({
@@ -180057,7 +180119,7 @@ var listOrganizations = (params) => Effect_exports.gen(function* () {
180057
180119
  });
180058
180120
  var createOrganization = (params) => Effect_exports.gen(function* () {
180059
180121
  const client = yield* HulyClient;
180060
- const orgId = (0, import_core27.generateId)();
180122
+ const orgId = (0, import_core28.generateId)();
180061
180123
  const orgData = {
180062
180124
  name: params.name,
180063
180125
  city: "",
@@ -180183,7 +180245,7 @@ var contactTools = [
180183
180245
  ];
180184
180246
 
180185
180247
  // src/huly/operations/components.ts
180186
- var import_core28 = __toESM(require_lib4(), 1);
180248
+ var import_core29 = __toESM(require_lib4(), 1);
180187
180249
 
180188
180250
  // src/utils/assertions.ts
180189
180251
  var AssertionError = class extends Error {
@@ -180237,7 +180299,7 @@ var listComponents = (params) => Effect_exports.gen(function* () {
180237
180299
  { space: project3._id },
180238
180300
  {
180239
180301
  limit,
180240
- sort: { modifiedOn: import_core28.SortingOrder.Descending }
180302
+ sort: { modifiedOn: import_core29.SortingOrder.Descending }
180241
180303
  }
180242
180304
  );
180243
180305
  const leadIds = [
@@ -180277,7 +180339,7 @@ var getComponent = (params) => Effect_exports.gen(function* () {
180277
180339
  });
180278
180340
  var createComponent = (params) => Effect_exports.gen(function* () {
180279
180341
  const { client, project: project3 } = yield* findProject(params.project);
180280
- const componentId = (0, import_core28.generateId)();
180342
+ const componentId = (0, import_core29.generateId)();
180281
180343
  const leadParam = params.lead;
180282
180344
  const leadRef = leadParam !== void 0 ? yield* Effect_exports.gen(function* () {
180283
180345
  const person = yield* findPersonByEmailOrName(client, leadParam);
@@ -180649,38 +180711,171 @@ var documentTools = [
180649
180711
  ];
180650
180712
 
180651
180713
  // src/huly/operations/issue-templates.ts
180652
- var import_core30 = __toESM(require_lib4(), 1);
180714
+ var import_core33 = __toESM(require_lib4(), 1);
180653
180715
 
180654
- // src/huly/operations/issues.ts
180655
- var import_core29 = __toESM(require_lib4(), 1);
180656
- var import_rank3 = __toESM(require_lib32(), 1);
180716
+ // src/huly/operations/issues-move.ts
180717
+ var import_core30 = __toESM(require_lib4(), 1);
180657
180718
  var import_tracker2 = __toESM(require_lib21(), 1);
180658
- var TxIncResult = Schema_exports.Struct({
180659
- object: Schema_exports.Struct({
180660
- sequence: Schema_exports.Number
180661
- })
180719
+ var addLabel = (params) => Effect_exports.gen(function* () {
180720
+ const { client, issue: issue2, project: project3 } = yield* findProjectAndIssue(params);
180721
+ const existingLabels = yield* client.findAll(
180722
+ tags.class.TagReference,
180723
+ {
180724
+ attachedTo: issue2._id,
180725
+ attachedToClass: tracker.class.Issue
180726
+ }
180727
+ );
180728
+ const labelTitle = params.label.trim();
180729
+ const labelExists = existingLabels.some(
180730
+ (l) => l.title.toLowerCase() === labelTitle.toLowerCase()
180731
+ );
180732
+ if (labelExists) {
180733
+ return { identifier: IssueIdentifier.make(issue2.identifier), labelAdded: false };
180734
+ }
180735
+ const color = params.color ?? 0;
180736
+ let tagElement = yield* client.findOne(
180737
+ tags.class.TagElement,
180738
+ {
180739
+ title: labelTitle,
180740
+ targetClass: toRef(tracker.class.Issue)
180741
+ }
180742
+ );
180743
+ if (tagElement === void 0) {
180744
+ const tagElementId = (0, import_core30.generateId)();
180745
+ const tagElementData = {
180746
+ title: labelTitle,
180747
+ description: "",
180748
+ targetClass: toRef(tracker.class.Issue),
180749
+ color,
180750
+ category: tracker.category.Other
180751
+ };
180752
+ yield* client.createDoc(
180753
+ tags.class.TagElement,
180754
+ toRef(core.space.Workspace),
180755
+ tagElementData,
180756
+ tagElementId
180757
+ );
180758
+ tagElement = yield* client.findOne(
180759
+ tags.class.TagElement,
180760
+ { _id: tagElementId }
180761
+ );
180762
+ }
180763
+ if (tagElement === void 0) {
180764
+ return { identifier: IssueIdentifier.make(issue2.identifier), labelAdded: false };
180765
+ }
180766
+ const tagRefData = {
180767
+ title: tagElement.title,
180768
+ color: tagElement.color,
180769
+ tag: tagElement._id
180770
+ };
180771
+ yield* client.addCollection(
180772
+ tags.class.TagReference,
180773
+ project3._id,
180774
+ issue2._id,
180775
+ tracker.class.Issue,
180776
+ "labels",
180777
+ tagRefData
180778
+ );
180779
+ return { identifier: IssueIdentifier.make(issue2.identifier), labelAdded: true };
180662
180780
  });
180663
- var extractUpdatedSequence = (txResult) => {
180664
- const decoded = Schema_exports.decodeUnknownOption(TxIncResult)(txResult);
180665
- return decoded._tag === "Some" ? decoded.value.object.sequence : void 0;
180666
- };
180667
- var resolveStatusByName = (statuses, statusName, project3) => {
180668
- const normalizedInput = normalizeForComparison(statusName);
180669
- const matchingStatus = statuses.find(
180670
- (s) => normalizeForComparison(s.name) === normalizedInput
180781
+ var moveIssue = (params) => Effect_exports.gen(function* () {
180782
+ const { client, issue: issue2, project: project3 } = yield* findProjectAndIssue(params);
180783
+ const oldParentIsIssue = issue2.attachedToClass === tracker.class.Issue;
180784
+ const newParentParam = params.newParent;
180785
+ const { newAttachedTo, newAttachedToClass, newCollection, newParentIdentifier, newParents } = newParentParam !== null ? yield* Effect_exports.gen(function* () {
180786
+ const parentIssue = yield* findIssueInProject(client, project3, newParentParam);
180787
+ return {
180788
+ newAttachedTo: parentIssue._id,
180789
+ newAttachedToClass: tracker.class.Issue,
180790
+ newCollection: "subIssues",
180791
+ newParents: [
180792
+ ...parentIssue.parents,
180793
+ {
180794
+ parentId: parentIssue._id,
180795
+ identifier: parentIssue.identifier,
180796
+ parentTitle: parentIssue.title,
180797
+ space: project3._id
180798
+ }
180799
+ ],
180800
+ newParentIdentifier: parentIssue.identifier
180801
+ };
180802
+ }) : {
180803
+ newAttachedTo: project3._id,
180804
+ newAttachedToClass: tracker.class.Project,
180805
+ newCollection: "issues",
180806
+ newParents: [],
180807
+ newParentIdentifier: void 0
180808
+ };
180809
+ const updateOps = {
180810
+ attachedTo: toRef(newAttachedTo),
180811
+ attachedToClass: newAttachedToClass,
180812
+ collection: newCollection,
180813
+ parents: newParents
180814
+ };
180815
+ yield* client.updateDoc(
180816
+ tracker.class.Issue,
180817
+ project3._id,
180818
+ issue2._id,
180819
+ updateOps
180671
180820
  );
180672
- if (matchingStatus === void 0) {
180673
- return Effect_exports.fail(new InvalidStatusError({ status: statusName, project: project3 }));
180821
+ if (oldParentIsIssue) {
180822
+ yield* client.updateDoc(
180823
+ tracker.class.Issue,
180824
+ project3._id,
180825
+ // issue.attachedTo is Ref<Doc>; for sub-issues it points to the parent issue.
180826
+ // Cast needed because updateDoc expects Ref<HulyIssue> but attachedTo is Ref<Doc>.
180827
+ toRef(issue2.attachedTo),
180828
+ { $inc: { subIssues: -1 } }
180829
+ );
180674
180830
  }
180675
- return Effect_exports.succeed(matchingStatus._id);
180676
- };
180677
- var resolveAssignee = (client, assigneeIdentifier) => Effect_exports.gen(function* () {
180678
- const person = yield* findPersonByEmailOrName(client, assigneeIdentifier);
180679
- if (person === void 0) {
180680
- return yield* new PersonNotFoundError({ identifier: assigneeIdentifier });
180831
+ if (params.newParent !== null) {
180832
+ yield* client.updateDoc(
180833
+ tracker.class.Issue,
180834
+ project3._id,
180835
+ toRef(newAttachedTo),
180836
+ { $inc: { subIssues: 1 } }
180837
+ );
180838
+ }
180839
+ if (issue2.subIssues > 0) {
180840
+ yield* updateDescendantParents(client, project3._id, issue2, newParents);
180841
+ }
180842
+ const result = {
180843
+ identifier: IssueIdentifier.make(issue2.identifier),
180844
+ moved: true
180845
+ };
180846
+ if (newParentIdentifier !== void 0) {
180847
+ return { ...result, newParent: IssueIdentifier.make(newParentIdentifier) };
180848
+ }
180849
+ return result;
180850
+ });
180851
+ var updateDescendantParents = (client, spaceId, parentIssue, parentNewParents) => Effect_exports.gen(function* () {
180852
+ const thisParentInfo = {
180853
+ parentId: parentIssue._id,
180854
+ identifier: parentIssue.identifier,
180855
+ parentTitle: parentIssue.title,
180856
+ space: spaceId
180857
+ };
180858
+ const children = yield* client.findAll(
180859
+ tracker.class.Issue,
180860
+ { attachedTo: parentIssue._id, space: spaceId }
180861
+ );
180862
+ for (const child of children) {
180863
+ const childNewParents = [...parentNewParents, thisParentInfo];
180864
+ yield* client.updateDoc(
180865
+ tracker.class.Issue,
180866
+ spaceId,
180867
+ child._id,
180868
+ { parents: childNewParents }
180869
+ );
180870
+ if (child.subIssues > 0) {
180871
+ yield* updateDescendantParents(client, spaceId, child, childNewParents);
180872
+ }
180681
180873
  }
180682
- return person;
180683
180874
  });
180875
+
180876
+ // src/huly/operations/issues-read.ts
180877
+ var import_core31 = __toESM(require_lib4(), 1);
180878
+ var import_tracker3 = __toESM(require_lib21(), 1);
180684
180879
  var resolveStatusName = (statuses, statusId) => {
180685
180880
  const statusDoc = statuses.find((s) => s._id === statusId);
180686
180881
  return statusDoc?.name ?? "Unknown";
@@ -180749,7 +180944,7 @@ var listIssues = (params) => Effect_exports.gen(function* () {
180749
180944
  {
180750
180945
  limit,
180751
180946
  sort: {
180752
- modifiedOn: import_core29.SortingOrder.Descending
180947
+ modifiedOn: import_core31.SortingOrder.Descending
180753
180948
  }
180754
180949
  },
180755
180950
  { assignee: contact.class.Person }
@@ -180816,6 +181011,27 @@ var getIssue = (params) => Effect_exports.gen(function* () {
180816
181011
  };
180817
181012
  return result;
180818
181013
  });
181014
+
181015
+ // src/huly/operations/issues-write.ts
181016
+ var import_core32 = __toESM(require_lib4(), 1);
181017
+ var import_rank3 = __toESM(require_lib32(), 1);
181018
+ var import_tracker4 = __toESM(require_lib21(), 1);
181019
+ var TxIncResult = Schema_exports.Struct({
181020
+ object: Schema_exports.Struct({
181021
+ sequence: Schema_exports.Number
181022
+ })
181023
+ });
181024
+ var extractUpdatedSequence = (txResult) => {
181025
+ const decoded = Schema_exports.decodeUnknownOption(TxIncResult)(txResult);
181026
+ return decoded._tag === "Some" ? decoded.value.object.sequence : void 0;
181027
+ };
181028
+ var resolveAssignee = (client, assigneeIdentifier) => Effect_exports.gen(function* () {
181029
+ const person = yield* findPersonByEmailOrName(client, assigneeIdentifier);
181030
+ if (person === void 0) {
181031
+ return yield* new PersonNotFoundError({ identifier: assigneeIdentifier });
181032
+ }
181033
+ return person;
181034
+ });
180819
181035
  var createIssue = (params) => Effect_exports.gen(function* () {
180820
181036
  const result = params.status !== void 0 ? yield* findProjectWithStatuses(params.project) : yield* Effect_exports.map(findProject(params.project), ({ client: client2, project: project4 }) => ({
180821
181037
  client: client2,
@@ -180823,7 +181039,7 @@ var createIssue = (params) => Effect_exports.gen(function* () {
180823
181039
  statuses: []
180824
181040
  }));
180825
181041
  const { client, project: project3, statuses } = result;
180826
- const issueId = (0, import_core29.generateId)();
181042
+ const issueId = (0, import_core32.generateId)();
180827
181043
  const incOps = { $inc: { sequence: 1 } };
180828
181044
  const incResult = yield* client.updateDoc(
180829
181045
  tracker.class.Project,
@@ -180838,7 +181054,7 @@ var createIssue = (params) => Effect_exports.gen(function* () {
180838
181054
  const lastIssue = yield* client.findOne(
180839
181055
  tracker.class.Issue,
180840
181056
  { space: project3._id },
180841
- { sort: { rank: import_core29.SortingOrder.Descending } }
181057
+ { sort: { rank: import_core32.SortingOrder.Descending } }
180842
181058
  );
180843
181059
  const rank = (0, import_rank3.makeRank)(lastIssue?.rank, void 0);
180844
181060
  const descriptionMarkupRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
@@ -180962,68 +181178,6 @@ var updateIssue = (params) => Effect_exports.gen(function* () {
180962
181178
  }
180963
181179
  return { identifier: IssueIdentifier.make(issue2.identifier), updated: true };
180964
181180
  });
180965
- var addLabel = (params) => Effect_exports.gen(function* () {
180966
- const { client, issue: issue2, project: project3 } = yield* findProjectAndIssue(params);
180967
- const existingLabels = yield* client.findAll(
180968
- tags.class.TagReference,
180969
- {
180970
- attachedTo: issue2._id,
180971
- attachedToClass: tracker.class.Issue
180972
- }
180973
- );
180974
- const labelTitle = params.label.trim();
180975
- const labelExists = existingLabels.some(
180976
- (l) => l.title.toLowerCase() === labelTitle.toLowerCase()
180977
- );
180978
- if (labelExists) {
180979
- return { identifier: IssueIdentifier.make(issue2.identifier), labelAdded: false };
180980
- }
180981
- const color = params.color ?? 0;
180982
- let tagElement = yield* client.findOne(
180983
- tags.class.TagElement,
180984
- {
180985
- title: labelTitle,
180986
- targetClass: toRef(tracker.class.Issue)
180987
- }
180988
- );
180989
- if (tagElement === void 0) {
180990
- const tagElementId = (0, import_core29.generateId)();
180991
- const tagElementData = {
180992
- title: labelTitle,
180993
- description: "",
180994
- targetClass: toRef(tracker.class.Issue),
180995
- color,
180996
- category: tracker.category.Other
180997
- };
180998
- yield* client.createDoc(
180999
- tags.class.TagElement,
181000
- toRef(core.space.Workspace),
181001
- tagElementData,
181002
- tagElementId
181003
- );
181004
- tagElement = yield* client.findOne(
181005
- tags.class.TagElement,
181006
- { _id: tagElementId }
181007
- );
181008
- }
181009
- if (tagElement === void 0) {
181010
- return { identifier: IssueIdentifier.make(issue2.identifier), labelAdded: false };
181011
- }
181012
- const tagRefData = {
181013
- title: tagElement.title,
181014
- color: tagElement.color,
181015
- tag: tagElement._id
181016
- };
181017
- yield* client.addCollection(
181018
- tags.class.TagReference,
181019
- project3._id,
181020
- issue2._id,
181021
- tracker.class.Issue,
181022
- "labels",
181023
- tagRefData
181024
- );
181025
- return { identifier: IssueIdentifier.make(issue2.identifier), labelAdded: true };
181026
- });
181027
181181
  var deleteIssue = (params) => Effect_exports.gen(function* () {
181028
181182
  const { client, issue: issue2, project: project3 } = yield* findProjectAndIssue(params);
181029
181183
  yield* client.removeDoc(
@@ -181033,100 +181187,6 @@ var deleteIssue = (params) => Effect_exports.gen(function* () {
181033
181187
  );
181034
181188
  return { identifier: IssueIdentifier.make(issue2.identifier), deleted: true };
181035
181189
  });
181036
- var moveIssue = (params) => Effect_exports.gen(function* () {
181037
- const { client, issue: issue2, project: project3 } = yield* findProjectAndIssue(params);
181038
- const oldParentIsIssue = issue2.attachedToClass === tracker.class.Issue;
181039
- const newParentParam = params.newParent;
181040
- const { newAttachedTo, newAttachedToClass, newCollection, newParentIdentifier, newParents } = newParentParam !== null ? yield* Effect_exports.gen(function* () {
181041
- const parentIssue = yield* findIssueInProject(client, project3, newParentParam);
181042
- return {
181043
- newAttachedTo: parentIssue._id,
181044
- newAttachedToClass: tracker.class.Issue,
181045
- newCollection: "subIssues",
181046
- newParents: [
181047
- ...parentIssue.parents,
181048
- {
181049
- parentId: parentIssue._id,
181050
- identifier: parentIssue.identifier,
181051
- parentTitle: parentIssue.title,
181052
- space: project3._id
181053
- }
181054
- ],
181055
- newParentIdentifier: parentIssue.identifier
181056
- };
181057
- }) : {
181058
- newAttachedTo: project3._id,
181059
- newAttachedToClass: tracker.class.Project,
181060
- newCollection: "issues",
181061
- newParents: [],
181062
- newParentIdentifier: void 0
181063
- };
181064
- const updateOps = {
181065
- attachedTo: toRef(newAttachedTo),
181066
- attachedToClass: newAttachedToClass,
181067
- collection: newCollection,
181068
- parents: newParents
181069
- };
181070
- yield* client.updateDoc(
181071
- tracker.class.Issue,
181072
- project3._id,
181073
- issue2._id,
181074
- updateOps
181075
- );
181076
- if (oldParentIsIssue) {
181077
- yield* client.updateDoc(
181078
- tracker.class.Issue,
181079
- project3._id,
181080
- // issue.attachedTo is Ref<Doc>; for sub-issues it points to the parent issue.
181081
- // Cast needed because updateDoc expects Ref<HulyIssue> but attachedTo is Ref<Doc>.
181082
- toRef(issue2.attachedTo),
181083
- { $inc: { subIssues: -1 } }
181084
- );
181085
- }
181086
- if (params.newParent !== null) {
181087
- yield* client.updateDoc(
181088
- tracker.class.Issue,
181089
- project3._id,
181090
- toRef(newAttachedTo),
181091
- { $inc: { subIssues: 1 } }
181092
- );
181093
- }
181094
- if (issue2.subIssues > 0) {
181095
- yield* updateDescendantParents(client, project3._id, issue2, newParents);
181096
- }
181097
- const result = {
181098
- identifier: IssueIdentifier.make(issue2.identifier),
181099
- moved: true
181100
- };
181101
- if (newParentIdentifier !== void 0) {
181102
- return { ...result, newParent: IssueIdentifier.make(newParentIdentifier) };
181103
- }
181104
- return result;
181105
- });
181106
- var updateDescendantParents = (client, spaceId, parentIssue, parentNewParents) => Effect_exports.gen(function* () {
181107
- const thisParentInfo = {
181108
- parentId: parentIssue._id,
181109
- identifier: parentIssue.identifier,
181110
- parentTitle: parentIssue.title,
181111
- space: spaceId
181112
- };
181113
- const children = yield* client.findAll(
181114
- tracker.class.Issue,
181115
- { attachedTo: parentIssue._id, space: spaceId }
181116
- );
181117
- for (const child of children) {
181118
- const childNewParents = [...parentNewParents, thisParentInfo];
181119
- yield* client.updateDoc(
181120
- tracker.class.Issue,
181121
- spaceId,
181122
- child._id,
181123
- { parents: childNewParents }
181124
- );
181125
- if (child.subIssues > 0) {
181126
- yield* updateDescendantParents(client, spaceId, child, childNewParents);
181127
- }
181128
- }
181129
- });
181130
181190
 
181131
181191
  // src/huly/operations/issue-templates.ts
181132
181192
  var findTemplateByIdOrTitle = (client, projectId, templateIdOrTitle) => Effect_exports.gen(function* () {
@@ -181192,7 +181252,7 @@ var buildTemplateChild = (client, projectId, projectIdentifier, input) => Effect
181192
181252
  return component._id;
181193
181253
  }) : null;
181194
181254
  return {
181195
- id: (0, import_core30.generateId)(),
181255
+ id: (0, import_core33.generateId)(),
181196
181256
  title: input.title,
181197
181257
  description: input.description ?? "",
181198
181258
  priority: stringToPriority(input.priority || "no-priority"),
@@ -181209,7 +181269,7 @@ var listIssueTemplates = (params) => Effect_exports.gen(function* () {
181209
181269
  { space: project3._id },
181210
181270
  {
181211
181271
  limit,
181212
- sort: { modifiedOn: import_core30.SortingOrder.Descending }
181272
+ sort: { modifiedOn: import_core33.SortingOrder.Descending }
181213
181273
  }
181214
181274
  );
181215
181275
  const summaries = templates.map((t) => {
@@ -181253,7 +181313,7 @@ var getIssueTemplate = (params) => Effect_exports.gen(function* () {
181253
181313
  });
181254
181314
  var createIssueTemplate = (params) => Effect_exports.gen(function* () {
181255
181315
  const { client, project: project3 } = yield* findProject(params.project);
181256
- const templateId = (0, import_core30.generateId)();
181316
+ const templateId = (0, import_core33.generateId)();
181257
181317
  const assigneeParam = params.assignee;
181258
181318
  const assigneeRef = assigneeParam !== void 0 ? yield* Effect_exports.gen(function* () {
181259
181319
  const person = yield* findPersonByEmailOrName(client, assigneeParam);
@@ -181487,10 +181547,10 @@ var removeTemplateChild = (params) => Effect_exports.gen(function* () {
181487
181547
  });
181488
181548
 
181489
181549
  // src/huly/operations/labels.ts
181490
- var import_core32 = __toESM(require_lib4(), 1);
181550
+ var import_core35 = __toESM(require_lib4(), 1);
181491
181551
 
181492
181552
  // src/huly/operations/tag-categories.ts
181493
- var import_core31 = __toESM(require_lib4(), 1);
181553
+ var import_core34 = __toESM(require_lib4(), 1);
181494
181554
  var issueClassRef = toRef(tracker.class.Issue);
181495
181555
  var findCategoryByIdOrLabel = (client, idOrLabel) => Effect_exports.gen(function* () {
181496
181556
  const cat = (yield* client.findOne(
@@ -181528,7 +181588,7 @@ var listTagCategories = (params) => Effect_exports.gen(function* () {
181528
181588
  query,
181529
181589
  {
181530
181590
  limit,
181531
- sort: { modifiedOn: import_core31.SortingOrder.Descending }
181591
+ sort: { modifiedOn: import_core34.SortingOrder.Descending }
181532
181592
  }
181533
181593
  );
181534
181594
  return categories.map(toSummary);
@@ -181543,7 +181603,7 @@ var createTagCategory = (params) => Effect_exports.gen(function* () {
181543
181603
  if (existing !== void 0) {
181544
181604
  return { id: TagCategoryId.make(existing._id), label: existing.label, created: false };
181545
181605
  }
181546
- const catId = (0, import_core31.generateId)();
181606
+ const catId = (0, import_core34.generateId)();
181547
181607
  const catData = {
181548
181608
  // Asset is a branded string type (Metadata<URL>) with no runtime constructor.
181549
181609
  // Empty string is the "no icon" sentinel; Huly UI renders a default icon.
@@ -181644,7 +181704,7 @@ var listLabels = (params) => Effect_exports.gen(function* () {
181644
181704
  query,
181645
181705
  {
181646
181706
  limit,
181647
- sort: { modifiedOn: import_core32.SortingOrder.Descending }
181707
+ sort: { modifiedOn: import_core35.SortingOrder.Descending }
181648
181708
  }
181649
181709
  );
181650
181710
  return elements.map((e) => ({
@@ -181669,7 +181729,7 @@ var createLabel = (params) => Effect_exports.gen(function* () {
181669
181729
  return { id: TagElementId.make(existing._id), title: existing.title, created: false };
181670
181730
  }
181671
181731
  const categoryRef = yield* resolveCategoryRef(client, params.category);
181672
- const tagId = (0, import_core32.generateId)();
181732
+ const tagId = (0, import_core35.generateId)();
181673
181733
  const color = params.color ?? 0;
181674
181734
  const tagData = {
181675
181735
  title: params.title,
@@ -182233,20 +182293,20 @@ var labelTools = [
182233
182293
  ];
182234
182294
 
182235
182295
  // src/huly/operations/milestones.ts
182236
- var import_core33 = __toESM(require_lib4(), 1);
182237
- var import_tracker3 = __toESM(require_lib21(), 1);
182296
+ var import_core36 = __toESM(require_lib4(), 1);
182297
+ var import_tracker5 = __toESM(require_lib21(), 1);
182238
182298
  var milestoneStatusToStringMap = {
182239
- [import_tracker3.MilestoneStatus.Planned]: "planned",
182240
- [import_tracker3.MilestoneStatus.InProgress]: "in-progress",
182241
- [import_tracker3.MilestoneStatus.Completed]: "completed",
182242
- [import_tracker3.MilestoneStatus.Canceled]: "canceled"
182299
+ [import_tracker5.MilestoneStatus.Planned]: "planned",
182300
+ [import_tracker5.MilestoneStatus.InProgress]: "in-progress",
182301
+ [import_tracker5.MilestoneStatus.Completed]: "completed",
182302
+ [import_tracker5.MilestoneStatus.Canceled]: "canceled"
182243
182303
  };
182244
182304
  var milestoneStatusToString = (status) => milestoneStatusToStringMap[status];
182245
182305
  var stringToMilestoneStatusMap = {
182246
- "planned": import_tracker3.MilestoneStatus.Planned,
182247
- "in-progress": import_tracker3.MilestoneStatus.InProgress,
182248
- "completed": import_tracker3.MilestoneStatus.Completed,
182249
- "canceled": import_tracker3.MilestoneStatus.Canceled
182306
+ "planned": import_tracker5.MilestoneStatus.Planned,
182307
+ "in-progress": import_tracker5.MilestoneStatus.InProgress,
182308
+ "completed": import_tracker5.MilestoneStatus.Completed,
182309
+ "canceled": import_tracker5.MilestoneStatus.Canceled
182250
182310
  };
182251
182311
  var stringToMilestoneStatus = (status) => stringToMilestoneStatusMap[status];
182252
182312
  var findMilestone = (client, project3, milestoneIdentifier, projectIdentifier) => Effect_exports.gen(function* () {
@@ -182277,7 +182337,7 @@ var listMilestones = (params) => Effect_exports.gen(function* () {
182277
182337
  { space: project3._id },
182278
182338
  {
182279
182339
  limit,
182280
- sort: { modifiedOn: import_core33.SortingOrder.Descending }
182340
+ sort: { modifiedOn: import_core36.SortingOrder.Descending }
182281
182341
  }
182282
182342
  );
182283
182343
  const summaries = milestones.map((m) => ({
@@ -182305,11 +182365,11 @@ var getMilestone = (params) => Effect_exports.gen(function* () {
182305
182365
  });
182306
182366
  var createMilestone = (params) => Effect_exports.gen(function* () {
182307
182367
  const { client, project: project3 } = yield* findProject(params.project);
182308
- const milestoneId = (0, import_core33.generateId)();
182368
+ const milestoneId = (0, import_core36.generateId)();
182309
182369
  const milestoneData = {
182310
182370
  label: params.label,
182311
182371
  description: params.description ?? "",
182312
- status: import_tracker3.MilestoneStatus.Planned,
182372
+ status: import_tracker5.MilestoneStatus.Planned,
182313
182373
  targetDate: params.targetDate,
182314
182374
  comments: 0
182315
182375
  };
@@ -182440,7 +182500,7 @@ var milestoneTools = [
182440
182500
  ];
182441
182501
 
182442
182502
  // src/huly/operations/notifications.ts
182443
- var import_core34 = __toESM(require_lib4(), 1);
182503
+ var import_core37 = __toESM(require_lib4(), 1);
182444
182504
  var toDocNotifyContextSummary = (ctx) => ({
182445
182505
  id: NotificationContextId.make(ctx._id),
182446
182506
  objectId: ctx.objectId,
@@ -182486,7 +182546,7 @@ var listNotifications = (params) => Effect_exports.gen(function* () {
182486
182546
  {
182487
182547
  limit,
182488
182548
  sort: {
182489
- modifiedOn: import_core34.SortingOrder.Descending
182549
+ modifiedOn: import_core37.SortingOrder.Descending
182490
182550
  }
182491
182551
  }
182492
182552
  );
@@ -182628,7 +182688,7 @@ var listNotificationContexts = (params) => Effect_exports.gen(function* () {
182628
182688
  {
182629
182689
  limit,
182630
182690
  sort: {
182631
- lastUpdateTimestamp: import_core34.SortingOrder.Descending
182691
+ lastUpdateTimestamp: import_core37.SortingOrder.Descending
182632
182692
  }
182633
182693
  }
182634
182694
  );
@@ -182845,8 +182905,8 @@ var notificationTools = [
182845
182905
  ];
182846
182906
 
182847
182907
  // src/huly/operations/projects.ts
182848
- var import_core35 = __toESM(require_lib4(), 1);
182849
- var import_tracker4 = __toESM(require_lib21(), 1);
182908
+ var import_core38 = __toESM(require_lib4(), 1);
182909
+ var import_tracker6 = __toESM(require_lib21(), 1);
182850
182910
  var listProjects = (params) => Effect_exports.gen(function* () {
182851
182911
  const client = yield* HulyClient;
182852
182912
  const query = {};
@@ -182860,7 +182920,7 @@ var listProjects = (params) => Effect_exports.gen(function* () {
182860
182920
  {
182861
182921
  limit,
182862
182922
  sort: {
182863
- name: import_core35.SortingOrder.Ascending
182923
+ name: import_core38.SortingOrder.Ascending
182864
182924
  }
182865
182925
  }
182866
182926
  );
@@ -182902,7 +182962,7 @@ var createProject = (params) => Effect_exports.gen(function* () {
182902
182962
  created: false
182903
182963
  };
182904
182964
  }
182905
- const projectId = (0, import_core35.generateId)();
182965
+ const projectId = (0, import_core38.generateId)();
182906
182966
  const projectData = {
182907
182967
  name: params.name,
182908
182968
  description: params.description ?? "",
@@ -182915,7 +182975,7 @@ var createProject = (params) => Effect_exports.gen(function* () {
182915
182975
  // Huly SDK: defaultIssueStatus expects Ref<IssueStatus> but is set by the platform
182916
182976
  // on first issue creation. Empty string sentinel is safe for initial project creation.
182917
182977
  defaultIssueStatus: "",
182918
- defaultTimeReportDay: import_tracker4.TimeReportDayType.CurrentWorkDay,
182978
+ defaultTimeReportDay: import_tracker6.TimeReportDayType.CurrentWorkDay,
182919
182979
  // tracker.ids.ClassingProjectType is the default classic tracker ProjectType.
182920
182980
  type: tracker.ids.ClassingProjectType
182921
182981
  };
@@ -183023,26 +183083,29 @@ var projectTools = [
183023
183083
  ];
183024
183084
 
183025
183085
  // src/huly/operations/search.ts
183026
- var import_core36 = __toESM(require_lib4(), 1);
183027
183086
  var fulltextSearch = (params) => Effect_exports.gen(function* () {
183028
183087
  const client = yield* HulyClient;
183029
183088
  const limit = clampLimit(params.limit);
183030
- const results = yield* client.findAll(
183031
- core.class.Doc,
183032
- { $search: params.query },
183033
- {
183034
- limit,
183035
- sort: {
183036
- modifiedOn: import_core36.SortingOrder.Descending
183037
- }
183038
- }
183089
+ const raw = yield* client.searchFulltext(
183090
+ { query: params.query },
183091
+ { limit }
183039
183092
  );
183040
- const total = results.total;
183041
- const items = results.map((doc) => ({
183042
- id: String(doc._id),
183043
- class: String(doc._class),
183044
- space: doc.space ? String(doc.space) : void 0,
183045
- modifiedOn: doc.modifiedOn
183093
+ const results = yield* parseSearchResult(raw).pipe(
183094
+ Effect_exports.mapError(
183095
+ (parseError2) => new HulyConnectionError({
183096
+ message: `searchFulltext response failed schema validation: ${parseError2.message}`,
183097
+ cause: parseError2
183098
+ })
183099
+ )
183100
+ );
183101
+ const total = results.total ?? -1;
183102
+ const items = results.docs.map((doc) => ({
183103
+ id: doc.doc._id,
183104
+ class: doc.doc._class,
183105
+ title: doc.title,
183106
+ description: doc.description,
183107
+ score: doc.score,
183108
+ createdOn: doc.doc.createdOn
183046
183109
  }));
183047
183110
  return {
183048
183111
  items,
@@ -183145,7 +183208,7 @@ var tagCategoryTools = [
183145
183208
  ];
183146
183209
 
183147
183210
  // src/huly/operations/test-management-core.ts
183148
- var import_core37 = __toESM(require_lib4(), 1);
183211
+ var import_core39 = __toESM(require_lib4(), 1);
183149
183212
 
183150
183213
  // src/huly/test-management-classes.ts
183151
183214
  var testManagement = {
@@ -183353,7 +183416,7 @@ var listTestProjects = (params) => Effect_exports.gen(function* () {
183353
183416
  {},
183354
183417
  {
183355
183418
  limit,
183356
- sort: { name: import_core37.SortingOrder.Ascending }
183419
+ sort: { name: import_core39.SortingOrder.Ascending }
183357
183420
  }
183358
183421
  );
183359
183422
  return {
@@ -183375,7 +183438,7 @@ var listTestSuites = (params) => Effect_exports.gen(function* () {
183375
183438
  query,
183376
183439
  {
183377
183440
  limit,
183378
- sort: { modifiedOn: import_core37.SortingOrder.Descending }
183441
+ sort: { modifiedOn: import_core39.SortingOrder.Descending }
183379
183442
  }
183380
183443
  );
183381
183444
  return {
@@ -183408,7 +183471,7 @@ var createTestSuite = (params) => Effect_exports.gen(function* () {
183408
183471
  if (existing !== void 0) {
183409
183472
  return { id: TestSuiteId.make(existing._id), name: existing.name, created: false };
183410
183473
  }
183411
- const suiteId = (0, import_core37.generateId)();
183474
+ const suiteId = (0, import_core39.generateId)();
183412
183475
  const suiteData = {
183413
183476
  name: params.name,
183414
183477
  description: params.description ?? "",
@@ -183477,7 +183540,7 @@ var listTestCases = (params) => Effect_exports.gen(function* () {
183477
183540
  query,
183478
183541
  {
183479
183542
  limit,
183480
- sort: { modifiedOn: import_core37.SortingOrder.Descending }
183543
+ sort: { modifiedOn: import_core39.SortingOrder.Descending }
183481
183544
  }
183482
183545
  );
183483
183546
  return {
@@ -183505,7 +183568,7 @@ var createTestCase = (params) => Effect_exports.gen(function* () {
183505
183568
  const client = yield* HulyClient;
183506
183569
  const project3 = yield* findTestProject(client, params.project);
183507
183570
  const suite = yield* findTestSuite(client, project3, params.suite);
183508
- const caseId = (0, import_core37.generateId)();
183571
+ const caseId = (0, import_core39.generateId)();
183509
183572
  const assigneeRef = params.assignee !== void 0 ? toRef((yield* resolveAssignee2(params.assignee))._id) : null;
183510
183573
  const typeEnum = params.type !== void 0 ? stringToTestCaseType(params.type) ?? 0 /* Functional */ : 0 /* Functional */;
183511
183574
  const priorityEnum = params.priority !== void 0 ? stringToTestCasePriority(params.priority) ?? 1 /* Medium */ : 1 /* Medium */;
@@ -183733,7 +183796,7 @@ var testManagementCoreTools = [
183733
183796
  ];
183734
183797
 
183735
183798
  // src/huly/operations/test-management-plans.ts
183736
- var import_core38 = __toESM(require_lib4(), 1);
183799
+ var import_core40 = __toESM(require_lib4(), 1);
183737
183800
  var toPlanSummary = (p) => ({
183738
183801
  id: TestPlanId.make(p._id),
183739
183802
  name: p.name
@@ -183751,7 +183814,7 @@ var listTestPlans = (params) => Effect_exports.gen(function* () {
183751
183814
  const plans = yield* client.findAll(
183752
183815
  testManagement.class.TestPlan,
183753
183816
  { space: project3._id },
183754
- { limit, sort: { modifiedOn: import_core38.SortingOrder.Descending } }
183817
+ { limit, sort: { modifiedOn: import_core40.SortingOrder.Descending } }
183755
183818
  );
183756
183819
  return { plans: plans.map(toPlanSummary), total: plans.total };
183757
183820
  });
@@ -183786,7 +183849,7 @@ var createTestPlan = (params) => Effect_exports.gen(function* () {
183786
183849
  if (existing !== void 0) {
183787
183850
  return { id: TestPlanId.make(existing._id), name: existing.name, created: false };
183788
183851
  }
183789
- const planId = (0, import_core38.generateId)();
183852
+ const planId = (0, import_core40.generateId)();
183790
183853
  const descRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
183791
183854
  testManagement.class.TestPlan,
183792
183855
  planId,
@@ -183867,7 +183930,7 @@ var removeTestPlanItem = (params) => Effect_exports.gen(function* () {
183867
183930
  });
183868
183931
 
183869
183932
  // src/huly/operations/test-management-runs.ts
183870
- var import_core39 = __toESM(require_lib4(), 1);
183933
+ var import_core41 = __toESM(require_lib4(), 1);
183871
183934
  var BATCH_CONCURRENCY = 10;
183872
183935
  var toRunSummary = (r) => ({
183873
183936
  id: TestRunId.make(r._id),
@@ -183888,7 +183951,7 @@ var listTestRuns = (params) => Effect_exports.gen(function* () {
183888
183951
  const runs = yield* client.findAll(
183889
183952
  testManagement.class.TestRun,
183890
183953
  { space: project3._id },
183891
- { limit, sort: { modifiedOn: import_core39.SortingOrder.Descending } }
183954
+ { limit, sort: { modifiedOn: import_core41.SortingOrder.Descending } }
183892
183955
  );
183893
183956
  return { runs: runs.map(toRunSummary), total: runs.total };
183894
183957
  });
@@ -183917,7 +183980,7 @@ var getTestRun = (params) => Effect_exports.gen(function* () {
183917
183980
  var createTestRun = (params) => Effect_exports.gen(function* () {
183918
183981
  const client = yield* HulyClient;
183919
183982
  const project3 = yield* findTestProject(client, params.project);
183920
- const runId = (0, import_core39.generateId)();
183983
+ const runId = (0, import_core41.generateId)();
183921
183984
  const descRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
183922
183985
  testManagement.class.TestRun,
183923
183986
  runId,
@@ -183974,7 +184037,7 @@ var listTestResults = (params) => Effect_exports.gen(function* () {
183974
184037
  const results = yield* client.findAll(
183975
184038
  testManagement.class.TestResult,
183976
184039
  { attachedTo: run3._id },
183977
- { limit, sort: { modifiedOn: import_core39.SortingOrder.Descending } }
184040
+ { limit, sort: { modifiedOn: import_core41.SortingOrder.Descending } }
183978
184041
  );
183979
184042
  return { results: results.map(toResultSummary), total: results.total };
183980
184043
  });
@@ -184074,7 +184137,7 @@ var runTestPlan = (params) => Effect_exports.gen(function* () {
184074
184137
  }
184075
184138
  return { item, tc };
184076
184139
  }), { concurrency: BATCH_CONCURRENCY });
184077
- const runId = (0, import_core39.generateId)();
184140
+ const runId = (0, import_core41.generateId)();
184078
184141
  const runName = params.runName ?? `${plan.name} - Run`;
184079
184142
  yield* client.createDoc(testManagement.class.TestRun, project3._id, {
184080
184143
  name: runName,
@@ -184246,9 +184309,9 @@ var testManagementPlansTools = [
184246
184309
  ];
184247
184310
 
184248
184311
  // src/huly/operations/time.ts
184249
- var import_calendar5 = __toESM(require_lib24(), 1);
184250
- var import_core40 = __toESM(require_lib4(), 1);
184251
- var import_tracker5 = __toESM(require_lib21(), 1);
184312
+ var import_calendar6 = __toESM(require_lib24(), 1);
184313
+ var import_core42 = __toESM(require_lib4(), 1);
184314
+ var import_tracker7 = __toESM(require_lib21(), 1);
184252
184315
  var serverPopulatedCalendar = toRef("");
184253
184316
  var serverPopulatedPersonId = "";
184254
184317
  var refAsPersonId = (ref) => ref;
@@ -184257,7 +184320,7 @@ var logTime = (params) => Effect_exports.gen(function* () {
184257
184320
  project: params.project,
184258
184321
  identifier: params.identifier
184259
184322
  });
184260
- const reportId = (0, import_core40.generateId)();
184323
+ const reportId = (0, import_core42.generateId)();
184261
184324
  const reportData = {
184262
184325
  employee: null,
184263
184326
  date: Date.now(),
@@ -184296,7 +184359,7 @@ var getTimeReport = (params) => Effect_exports.gen(function* () {
184296
184359
  const reports = yield* client.findAll(
184297
184360
  tracker.class.TimeSpendReport,
184298
184361
  { attachedTo: issue2._id },
184299
- { sort: { date: import_core40.SortingOrder.Descending } }
184362
+ { sort: { date: import_core42.SortingOrder.Descending } }
184300
184363
  );
184301
184364
  const employeeIds = [
184302
184365
  ...new Set(
@@ -184348,7 +184411,7 @@ var listTimeSpendReports = (params) => Effect_exports.gen(function* () {
184348
184411
  tracker.class.TimeSpendReport,
184349
184412
  query,
184350
184413
  withLookup(
184351
- { limit, sort: { date: import_core40.SortingOrder.Descending } },
184414
+ { limit, sort: { date: import_core42.SortingOrder.Descending } },
184352
184415
  {
184353
184416
  attachedTo: tracker.class.Issue,
184354
184417
  employee: contact.class.Person
@@ -184377,7 +184440,7 @@ var getDetailedTimeReport = (params) => Effect_exports.gen(function* () {
184377
184440
  tracker.class.TimeSpendReport,
184378
184441
  query,
184379
184442
  withLookup(
184380
- { sort: { date: import_core40.SortingOrder.Descending } },
184443
+ { sort: { date: import_core42.SortingOrder.Descending } },
184381
184444
  {
184382
184445
  attachedTo: tracker.class.Issue,
184383
184446
  employee: contact.class.Person
@@ -184453,7 +184516,7 @@ var listWorkSlots = (params) => Effect_exports.gen(function* () {
184453
184516
  const slots = yield* client.findAll(
184454
184517
  time.class.WorkSlot,
184455
184518
  query,
184456
- { limit, sort: { date: import_core40.SortingOrder.Descending } }
184519
+ { limit, sort: { date: import_core42.SortingOrder.Descending } }
184457
184520
  );
184458
184521
  return slots.map((s) => ({
184459
184522
  id: s._id,
@@ -184465,7 +184528,7 @@ var listWorkSlots = (params) => Effect_exports.gen(function* () {
184465
184528
  });
184466
184529
  var createWorkSlot = (params) => Effect_exports.gen(function* () {
184467
184530
  const client = yield* HulyClient;
184468
- const slotId = (0, import_core40.generateId)();
184531
+ const slotId = (0, import_core42.generateId)();
184469
184532
  const slotData = {
184470
184533
  date: params.date,
184471
184534
  dueDate: params.dueDate,
@@ -184473,7 +184536,7 @@ var createWorkSlot = (params) => Effect_exports.gen(function* () {
184473
184536
  description: "",
184474
184537
  allDay: false,
184475
184538
  participants: [],
184476
- access: import_calendar5.AccessLevel.Owner,
184539
+ access: import_calendar6.AccessLevel.Owner,
184477
184540
  reminders: [],
184478
184541
  visibility: "public",
184479
184542
  eventId: "",
@@ -184609,15 +184672,15 @@ var timeTools = [
184609
184672
  ];
184610
184673
 
184611
184674
  // src/huly/operations/workspace.ts
184612
- var import_core41 = __toESM(require_lib4(), 1);
184675
+ var import_core43 = __toESM(require_lib4(), 1);
184613
184676
  var accountRoleMap = {
184614
- READONLYGUEST: import_core41.AccountRole.ReadOnlyGuest,
184615
- DocGuest: import_core41.AccountRole.DocGuest,
184616
- GUEST: import_core41.AccountRole.Guest,
184617
- USER: import_core41.AccountRole.User,
184618
- MAINTAINER: import_core41.AccountRole.Maintainer,
184619
- OWNER: import_core41.AccountRole.Owner,
184620
- ADMIN: import_core41.AccountRole.Admin
184677
+ READONLYGUEST: import_core43.AccountRole.ReadOnlyGuest,
184678
+ DocGuest: import_core43.AccountRole.DocGuest,
184679
+ GUEST: import_core43.AccountRole.Guest,
184680
+ USER: import_core43.AccountRole.User,
184681
+ MAINTAINER: import_core43.AccountRole.Maintainer,
184682
+ OWNER: import_core43.AccountRole.Owner,
184683
+ ADMIN: import_core43.AccountRole.Admin
184621
184684
  };
184622
184685
  var toHulyAccountRole = (role) => accountRoleMap[role];
184623
184686
  var formatVersion = (info) => `${info.versionMajor}.${info.versionMinor}.${info.versionPatch}`;