@firfi/huly-mcp 0.1.49 → 0.1.50

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: () => SortingOrder25,
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 SortingOrder25 = /* @__PURE__ */ ((SortingOrder26) => {
34045
+ SortingOrder26[SortingOrder26["Ascending"] = 1] = "Ascending";
34046
+ SortingOrder26[SortingOrder26["Descending"] = -1] = "Descending";
34047
+ return SortingOrder26;
34048
+ })(SortingOrder25 || {});
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_core45 = 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_core45.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_core45.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_core45.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_core45 = require_lib4();
35416
35416
  async function loadServerConfig4(url4) {
35417
- const configUrl = (0, import_core42.concatLink)(url4, "/config.json");
35417
+ const configUrl = (0, import_core45.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_core45 = 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_core45.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_core45 = require_dist16();
53090
53090
  var import_utils14 = require_utils5();
53091
- var ImageNode = import_core42.Node.create({
53091
+ var ImageNode = import_core45.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_core45.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_core45 = require_dist16();
53195
53195
  var import_utils14 = require_utils5();
53196
- var ReferenceNode = import_core42.Node.create({
53196
+ var ReferenceNode = import_core45.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_core45.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_core45 = require_dist16();
53291
+ var EmojiNode = import_core45.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_core45.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_core45.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_core45.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_core45.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_core45 = require_dist16();
53692
+ var FileNode = import_core45.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_core45 = 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_core45.textblockTypeInputRule)({
54049
54049
  find: backtickInputRegex,
54050
54050
  type: this.type
54051
54051
  }),
54052
- (0, import_core42.textblockTypeInputRule)({
54052
+ (0, import_core45.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_core45 = require_dist16();
54089
+ var CommentNode = import_core45.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_core45 = require_dist16();
54136
+ var MarkdownNode = import_core45.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_core45.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_core45 = require_dist16();
54189
+ var EmbedNode = import_core45.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_core45.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_core45 = 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_core45.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_core45 = require_dist16();
54361
54361
  var NAME2 = "node-uuid";
54362
- var QMSInlineCommentMark = import_core42.Mark.create({
54362
+ var QMSInlineCommentMark = import_core45.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_core45 = require_dist16();
54408
54408
  function extensionKit(name, fn2) {
54409
- return import_core42.Extension.create({
54409
+ return import_core45.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_core45 = require_dist16();
61439
61439
  var import_extension_text_style = require_dist20();
61440
- var BackgroundColor = import_core42.Extension.create({
61440
+ var BackgroundColor = import_core45.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_core45.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_core45 = 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_core45.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_core45 = 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_core45.concatLink)(this.url, `/browse?workspace=${workspace}`);
77089
+ this.imageUrl = (0, import_core45.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_core45.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_core45.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_core45 = __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_core45.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_core45.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_core45.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_core45.ClientConnectEvent.Reconnected : import_core45.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_core45.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_core45.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_core45.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_core45.default.class.TxApplyIf) {
82266
+ return (await this.findAll(import_core45.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_core45.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_core45.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_core45 = __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_core45.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_core45.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_core45.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_core45.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_core45.default.class.TxWorkspaceEvent) {
82413
82413
  const event = tx;
82414
- if (event.event === import_core42.WorkspaceEvent.MaintenanceNotification) {
82414
+ if (event.event === import_core45.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_core45.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_core45.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_core45.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_core45.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_core45.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_core45.pluginFilterTx)(excludedPlugins, configs, txes).filter((tx) => {
82519
+ if (tx?._class === import_core45.default.class.TxCreateDoc || tx?._class === import_core45.default.class.TxUpdateDoc || tx?._class === import_core45.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_core45 = 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_core45.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_core45.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_core45.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_core45.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_core45 = 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_core45.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_core45.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_core45.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_core45.Hierarchy();
83212
+ const model = new import_core45.ModelDb(hierarchy);
83213
+ const ctx = new import_core45.MeasureMetricsContext("loadModel", {});
83214
+ (0, import_core45.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_core45.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_core45.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_core45.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_core45.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_core45 = 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_core45.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_core45.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_core45 = __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_core45.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_core45.default.space.Configuration,
83607
+ modifiedBy: import_core45.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_core45.default.class.Blob,
83643
83643
  _id: fileResult.id,
83644
- space: import_core42.default.space.Configuration,
83644
+ space: import_core45.default.space.Configuration,
83645
83645
  modifiedOn: fileResult.metadata.lastModified,
83646
- modifiedBy: import_core42.default.account.System,
83646
+ modifiedBy: import_core45.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_core45.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_core45.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_core45 = 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_core45.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_core45.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_core45 = __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_core45.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_core45 = __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_core45.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_core45.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_core45.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_core45.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_core45.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_core45.TxProcessor.updateDoc2Doc(person, tx) : import_core45.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_core45 = 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_core45.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_core45.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_core45.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_core45.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_core45.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_core45.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_core45.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_core45.AccountRole.Guest || person.role === import_core45.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_core45.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_core45.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_core45.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_core45.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_core45.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_core45.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_core45 = 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_core45.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_core45 = __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_core45.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_core45.default.class.RefTo && h.isDerived(it.type.to, import_core45.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_core45.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_core45.default.class.Mixin,
88664
+ import_core45.default.space.Model,
88665
88665
  {
88666
88666
  extends: categoryObj.baseClass,
88667
- kind: import_core42.ClassifierKind.MIXIN,
88667
+ kind: import_core45.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_core45.default.class.Mixin, import_core45.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_core45.default.class.Mixin,
88733
+ import_core45.default.space.Model,
88734
88734
  {
88735
88735
  extends: data.ofClass,
88736
- kind: import_core42.ClassifierKind.MIXIN,
88736
+ kind: import_core45.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_core45.default.class.Mixin, import_core45.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_core45.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,
@@ -154442,6 +154464,9 @@ var TestPlanIdentifier = NonEmptyString2.pipe(Schema_exports.brand("TestPlanIden
154442
154464
  var TestRunIdentifier = NonEmptyString2.pipe(Schema_exports.brand("TestRunIdentifier"));
154443
154465
  var TestResultIdentifier = NonEmptyString2.pipe(Schema_exports.brand("TestResultIdentifier"));
154444
154466
 
154467
+ // src/utils/normalize.ts
154468
+ var normalizeForComparison = (s) => s.replace(/[-_ ]/g, "").toLowerCase();
154469
+
154445
154470
  // src/huly/huly-plugins.ts
154446
154471
  var activity = require_lib22().default;
154447
154472
  var attachment = require_lib23().default;
@@ -154659,6 +154684,16 @@ var findPersonByEmailOrName = (client, emailOrName) => Effect_exports.gen(functi
154659
154684
  );
154660
154685
  return likePerson;
154661
154686
  });
154687
+ var resolveStatusByName = (statuses, statusName, project3) => {
154688
+ const normalizedInput = normalizeForComparison(statusName);
154689
+ const matchingStatus = statuses.find(
154690
+ (s) => normalizeForComparison(s.name) === normalizedInput
154691
+ );
154692
+ if (matchingStatus === void 0) {
154693
+ return Effect_exports.fail(new InvalidStatusError({ status: statusName, project: project3 }));
154694
+ }
154695
+ return Effect_exports.succeed(matchingStatus._id);
154696
+ };
154662
154697
 
154663
154698
  // src/huly/storage.ts
154664
154699
  var MAX_FILE_SIZE_MB = 100;
@@ -174043,7 +174078,7 @@ var PostHog = class extends PostHogBackendClient {
174043
174078
  };
174044
174079
 
174045
174080
  // src/version.ts
174046
- var VERSION = true ? "0.1.48" : "0.0.0-dev";
174081
+ var VERSION = true ? "0.1.50" : "0.0.0-dev";
174047
174082
 
174048
174083
  // src/telemetry/posthog.ts
174049
174084
  var POSTHOG_API_KEY = "phc_TGfFqCGdnF0p68wuFzd5WSw1IsBvOJW0YgoMJDyZPjm";
@@ -175710,8 +175745,10 @@ var parseCreateRecurringEventParams = Schema_exports.decodeUnknown(CreateRecurri
175710
175745
  var parseListEventInstancesParams = Schema_exports.decodeUnknown(ListEventInstancesParamsSchema);
175711
175746
 
175712
175747
  // src/huly/operations/calendar.ts
175713
- var import_calendar = __toESM(require_lib24(), 1);
175714
- var import_core22 = __toESM(require_lib4(), 1);
175748
+ var import_calendar2 = __toESM(require_lib24(), 1);
175749
+ var import_core23 = __toESM(require_lib4(), 1);
175750
+
175751
+ // src/huly/operations/calendar-shared.ts
175715
175752
  var descriptionAsMarkupRef = (desc) => desc;
175716
175753
  var markupRefAsDescription = (ref) => ref ?? "";
175717
175754
  var emptyEventDescription = "";
@@ -175722,31 +175759,6 @@ var SECONDS_PER_MINUTE = 60;
175722
175759
  var MINUTES_PER_HOUR = 60;
175723
175760
  var MS_PER_SECOND = 1e3;
175724
175761
  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
175762
  var findPersonsByEmails = (client, emails) => Effect_exports.gen(function* () {
175751
175763
  if (emails.length === 0) return [];
175752
175764
  const allChannels = yield* client.findAll(
@@ -175789,6 +175801,167 @@ var resolveEventInputs = (client, params, eventClass, eventId) => Effect_exports
175789
175801
  ) : null;
175790
175802
  return { calendarRef, participantRefs, descriptionRef };
175791
175803
  });
175804
+
175805
+ // src/huly/operations/calendar-recurring.ts
175806
+ var import_calendar = __toESM(require_lib24(), 1);
175807
+ var import_core22 = __toESM(require_lib4(), 1);
175808
+ var hulyRuleToRule = (rule) => ({
175809
+ freq: rule.freq,
175810
+ endDate: rule.endDate,
175811
+ count: rule.count,
175812
+ interval: rule.interval,
175813
+ byDay: rule.byDay,
175814
+ byMonthDay: rule.byMonthDay,
175815
+ byMonth: rule.byMonth,
175816
+ bySetPos: rule.bySetPos,
175817
+ wkst: rule.wkst
175818
+ });
175819
+ var ruleToHulyRule = (rule) => {
175820
+ const result = {
175821
+ freq: rule.freq
175822
+ };
175823
+ if (rule.endDate !== void 0) result.endDate = rule.endDate;
175824
+ if (rule.count !== void 0) result.count = rule.count;
175825
+ if (rule.interval !== void 0) result.interval = rule.interval;
175826
+ if (rule.byDay !== void 0) result.byDay = [...rule.byDay];
175827
+ if (rule.byMonthDay !== void 0) result.byMonthDay = [...rule.byMonthDay];
175828
+ if (rule.byMonth !== void 0) result.byMonth = [...rule.byMonth];
175829
+ if (rule.bySetPos !== void 0) result.bySetPos = [...rule.bySetPos];
175830
+ if (rule.wkst !== void 0) result.wkst = rule.wkst;
175831
+ return result;
175832
+ };
175833
+ var listRecurringEvents = (params) => Effect_exports.gen(function* () {
175834
+ const client = yield* HulyClient;
175835
+ const limit = clampLimit(params.limit);
175836
+ const events = yield* client.findAll(
175837
+ calendar.class.ReccuringEvent,
175838
+ {},
175839
+ {
175840
+ limit,
175841
+ sort: { modifiedOn: import_core22.SortingOrder.Descending }
175842
+ }
175843
+ );
175844
+ const summaries = events.map((event) => ({
175845
+ eventId: EventId.make(event.eventId),
175846
+ title: event.title,
175847
+ originalStartTime: event.originalStartTime,
175848
+ rules: event.rules.map(hulyRuleToRule),
175849
+ timeZone: event.timeZone,
175850
+ modifiedOn: event.modifiedOn
175851
+ }));
175852
+ return summaries;
175853
+ });
175854
+ var createRecurringEvent = (params) => Effect_exports.gen(function* () {
175855
+ const client = yield* HulyClient;
175856
+ const eventId = (0, import_calendar.generateEventId)();
175857
+ const dueDate = params.dueDate ?? params.startDate + ONE_HOUR_MS;
175858
+ const { calendarRef, descriptionRef, participantRefs } = yield* resolveEventInputs(
175859
+ client,
175860
+ params,
175861
+ calendar.class.ReccuringEvent,
175862
+ eventId
175863
+ );
175864
+ const hulyRules = params.rules.map(ruleToHulyRule);
175865
+ const eventData = {
175866
+ eventId,
175867
+ title: params.title,
175868
+ description: markupRefAsDescription(descriptionRef),
175869
+ date: params.startDate,
175870
+ dueDate,
175871
+ allDay: params.allDay ?? false,
175872
+ calendar: calendarRef,
175873
+ participants: participantRefs,
175874
+ externalParticipants: [],
175875
+ access: import_calendar.AccessLevel.Owner,
175876
+ user: serverPopulatedUser,
175877
+ blockTime: false,
175878
+ rules: hulyRules,
175879
+ exdate: [],
175880
+ rdate: [],
175881
+ originalStartTime: params.startDate,
175882
+ timeZone: params.timeZone ?? Intl.DateTimeFormat().resolvedOptions().timeZone
175883
+ };
175884
+ if (params.location !== void 0) {
175885
+ eventData.location = params.location;
175886
+ }
175887
+ if (params.visibility !== void 0) {
175888
+ const vis = stringToVisibility(params.visibility);
175889
+ if (vis !== void 0) {
175890
+ eventData.visibility = vis;
175891
+ }
175892
+ }
175893
+ yield* client.addCollection(
175894
+ calendar.class.ReccuringEvent,
175895
+ toRef(calendar.space.Calendar),
175896
+ toRef(calendar.space.Calendar),
175897
+ toRef(core.class.Space),
175898
+ "events",
175899
+ eventData
175900
+ );
175901
+ return { eventId: EventId.make(eventId) };
175902
+ });
175903
+ var listEventInstances = (params) => Effect_exports.gen(function* () {
175904
+ const client = yield* HulyClient;
175905
+ const recurringEvent = yield* client.findOne(
175906
+ calendar.class.ReccuringEvent,
175907
+ { eventId: params.recurringEventId }
175908
+ );
175909
+ if (recurringEvent === void 0) {
175910
+ return yield* new RecurringEventNotFoundError({ eventId: params.recurringEventId });
175911
+ }
175912
+ const query = {
175913
+ recurringEventId: params.recurringEventId
175914
+ };
175915
+ if (params.from !== void 0) {
175916
+ query.date = { $gte: params.from };
175917
+ }
175918
+ if (params.to !== void 0) {
175919
+ query.dueDate = { $lte: params.to };
175920
+ }
175921
+ const limit = clampLimit(params.limit);
175922
+ const instances = yield* client.findAll(
175923
+ calendar.class.ReccuringInstance,
175924
+ query,
175925
+ {
175926
+ limit,
175927
+ sort: { date: import_core22.SortingOrder.Ascending }
175928
+ }
175929
+ );
175930
+ const participantMap = /* @__PURE__ */ new Map();
175931
+ if (params.includeParticipants) {
175932
+ const allParticipantRefs = [...new Set(instances.flatMap((i) => i.participants))];
175933
+ if (allParticipantRefs.length > 0) {
175934
+ const participants = yield* buildParticipants(client, allParticipantRefs);
175935
+ const participantById = new Map(participants.map((p) => [p.id, p]));
175936
+ for (const instance of instances) {
175937
+ const instanceParticipants = instance.participants.map((ref) => participantById.get(PersonId.make(ref))).filter((p) => p !== void 0);
175938
+ participantMap.set(instance.eventId, instanceParticipants);
175939
+ }
175940
+ } else {
175941
+ for (const instance of instances) {
175942
+ participantMap.set(instance.eventId, []);
175943
+ }
175944
+ }
175945
+ }
175946
+ const results = instances.map((instance) => ({
175947
+ eventId: EventId.make(instance.eventId),
175948
+ recurringEventId: EventId.make(instance.recurringEventId),
175949
+ title: instance.title,
175950
+ date: instance.date,
175951
+ dueDate: instance.dueDate,
175952
+ originalStartTime: instance.originalStartTime,
175953
+ allDay: instance.allDay,
175954
+ location: instance.location,
175955
+ visibility: visibilityToString(instance.visibility),
175956
+ isCancelled: instance.isCancelled,
175957
+ isVirtual: instance.virtual,
175958
+ participants: params.includeParticipants ? participantMap.get(instance.eventId) ?? [] : void 0,
175959
+ externalParticipants: instance.externalParticipants ? instance.externalParticipants.map((p) => Email.make(p)) : void 0
175960
+ }));
175961
+ return results;
175962
+ });
175963
+
175964
+ // src/huly/operations/calendar.ts
175792
175965
  var listEvents = (params) => Effect_exports.gen(function* () {
175793
175966
  const client = yield* HulyClient;
175794
175967
  const query = {};
@@ -175804,7 +175977,7 @@ var listEvents = (params) => Effect_exports.gen(function* () {
175804
175977
  query,
175805
175978
  {
175806
175979
  limit,
175807
- sort: { date: import_core22.SortingOrder.Ascending }
175980
+ sort: { date: import_core23.SortingOrder.Ascending }
175808
175981
  }
175809
175982
  );
175810
175983
  const summaries = events.map((event) => ({
@@ -175854,7 +176027,7 @@ var getEvent = (params) => Effect_exports.gen(function* () {
175854
176027
  });
175855
176028
  var createEvent = (params) => Effect_exports.gen(function* () {
175856
176029
  const client = yield* HulyClient;
175857
- const eventId = (0, import_calendar.generateEventId)();
176030
+ const eventId = (0, import_calendar2.generateEventId)();
175858
176031
  const dueDate = params.dueDate ?? params.date + ONE_HOUR_MS;
175859
176032
  const { calendarRef, descriptionRef, participantRefs } = yield* resolveEventInputs(
175860
176033
  client,
@@ -175872,7 +176045,7 @@ var createEvent = (params) => Effect_exports.gen(function* () {
175872
176045
  calendar: calendarRef,
175873
176046
  participants: participantRefs,
175874
176047
  externalParticipants: [],
175875
- access: import_calendar.AccessLevel.Owner,
176048
+ access: import_calendar2.AccessLevel.Owner,
175876
176049
  user: serverPopulatedUser,
175877
176050
  blockTime: false
175878
176051
  };
@@ -175979,136 +176152,6 @@ var deleteEvent = (params) => Effect_exports.gen(function* () {
175979
176152
  );
175980
176153
  return { eventId: EventId.make(params.eventId), deleted: true };
175981
176154
  });
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
176155
 
176113
176156
  // src/mcp/tools/calendar.ts
176114
176157
  var CATEGORY3 = "calendar";
@@ -176381,9 +176424,6 @@ var parseCreateCardParams = Schema_exports.decodeUnknown(CreateCardParamsSchema)
176381
176424
  var parseUpdateCardParams = Schema_exports.decodeUnknown(UpdateCardParamsSchema);
176382
176425
  var parseDeleteCardParams = Schema_exports.decodeUnknown(DeleteCardParamsSchema);
176383
176426
 
176384
- // src/utils/normalize.ts
176385
- var normalizeForComparison = (s) => s.replace(/[-_ ]/g, "").toLowerCase();
176386
-
176387
176427
  // src/domain/schemas/issues.ts
176388
176428
  var IssuePriorityValues = ["urgent", "high", "medium", "low", "no-priority"];
176389
176429
  var IssuePriorityLiteral = Schema_exports.Literal(...IssuePriorityValues);
@@ -178772,7 +178812,7 @@ var parseDeleteTestResultParams = Schema_exports.decodeUnknown(DeleteTestResultP
178772
178812
  var parseRunTestPlanParams = Schema_exports.decodeUnknown(RunTestPlanParamsSchema);
178773
178813
 
178774
178814
  // src/huly/operations/cards.ts
178775
- var import_core23 = __toESM(require_lib4(), 1);
178815
+ var import_core24 = __toESM(require_lib4(), 1);
178776
178816
  var import_rank2 = __toESM(require_lib32(), 1);
178777
178817
  var findCardSpace = (identifier2) => Effect_exports.gen(function* () {
178778
178818
  const client = yield* HulyClient;
@@ -178837,7 +178877,7 @@ var listCardSpaces = (params) => Effect_exports.gen(function* () {
178837
178877
  {
178838
178878
  limit,
178839
178879
  sort: {
178840
- name: import_core23.SortingOrder.Ascending
178880
+ name: import_core24.SortingOrder.Ascending
178841
178881
  }
178842
178882
  }
178843
178883
  );
@@ -178893,7 +178933,7 @@ var listCards = (params) => Effect_exports.gen(function* () {
178893
178933
  {
178894
178934
  limit,
178895
178935
  sort: {
178896
- modifiedOn: import_core23.SortingOrder.Descending
178936
+ modifiedOn: import_core24.SortingOrder.Descending
178897
178937
  }
178898
178938
  }
178899
178939
  );
@@ -178935,11 +178975,11 @@ var getCard = (params) => Effect_exports.gen(function* () {
178935
178975
  var createCard = (params) => Effect_exports.gen(function* () {
178936
178976
  const { cardSpace, client } = yield* findCardSpace(params.cardSpace);
178937
178977
  const masterTag = yield* findMasterTag(client, cardSpace, params.type);
178938
- const cardId = (0, import_core23.generateId)();
178978
+ const cardId = (0, import_core24.generateId)();
178939
178979
  const lastCard = yield* client.findOne(
178940
178980
  cardPlugin.class.Card,
178941
178981
  { space: cardSpace._id },
178942
- { sort: { rank: import_core23.SortingOrder.Descending } }
178982
+ { sort: { rank: import_core24.SortingOrder.Descending } }
178943
178983
  );
178944
178984
  const rank = (0, import_rank2.makeRank)(lastCard?.rank, void 0);
178945
178985
  const contentMarkupRef = yield* client.uploadMarkup(
@@ -179127,7 +179167,7 @@ var cardTools = [
179127
179167
  ];
179128
179168
 
179129
179169
  // src/huly/operations/channels.ts
179130
- var import_core24 = __toESM(require_lib4(), 1);
179170
+ var import_core25 = __toESM(require_lib4(), 1);
179131
179171
  var import_text2 = __toESM(require_lib9(), 1);
179132
179172
  var import_text_markdown2 = __toESM(require_lib17(), 1);
179133
179173
  var personIdsAsSocialIdentityRefs = (ids3) => ids3;
@@ -179214,7 +179254,7 @@ var listChannels = (params) => Effect_exports.gen(function* () {
179214
179254
  {
179215
179255
  limit,
179216
179256
  sort: {
179217
- name: import_core24.SortingOrder.Ascending
179257
+ name: import_core25.SortingOrder.Ascending
179218
179258
  }
179219
179259
  }
179220
179260
  );
@@ -179252,7 +179292,7 @@ var getChannel = (params) => Effect_exports.gen(function* () {
179252
179292
  });
179253
179293
  var createChannel = (params) => Effect_exports.gen(function* () {
179254
179294
  const client = yield* HulyClient;
179255
- const channelId = (0, import_core24.generateId)();
179295
+ const channelId = (0, import_core25.generateId)();
179256
179296
  const channelData = {
179257
179297
  name: params.name,
179258
179298
  topic: params.topic || "",
@@ -179310,7 +179350,7 @@ var listChannelMessages = (params) => Effect_exports.gen(function* () {
179310
179350
  {
179311
179351
  limit,
179312
179352
  sort: {
179313
- createdOn: import_core24.SortingOrder.Descending
179353
+ createdOn: import_core25.SortingOrder.Descending
179314
179354
  }
179315
179355
  }
179316
179356
  );
@@ -179338,7 +179378,7 @@ var listChannelMessages = (params) => Effect_exports.gen(function* () {
179338
179378
  });
179339
179379
  var sendChannelMessage = (params) => Effect_exports.gen(function* () {
179340
179380
  const { channel, client } = yield* findChannel(params.channel);
179341
- const messageId = (0, import_core24.generateId)();
179381
+ const messageId = (0, import_core25.generateId)();
179342
179382
  const markup = markdownToMarkupString(params.body);
179343
179383
  const messageData = {
179344
179384
  message: markup,
@@ -179364,7 +179404,7 @@ var listDirectMessages = (params) => Effect_exports.gen(function* () {
179364
179404
  {
179365
179405
  limit,
179366
179406
  sort: {
179367
- modifiedOn: import_core24.SortingOrder.Descending
179407
+ modifiedOn: import_core25.SortingOrder.Descending
179368
179408
  }
179369
179409
  }
179370
179410
  );
@@ -179390,7 +179430,7 @@ var listDirectMessages = (params) => Effect_exports.gen(function* () {
179390
179430
  });
179391
179431
 
179392
179432
  // src/huly/operations/threads.ts
179393
- var import_core25 = __toESM(require_lib4(), 1);
179433
+ var import_core26 = __toESM(require_lib4(), 1);
179394
179434
  var findMessage = (channelIdentifier, messageId) => Effect_exports.gen(function* () {
179395
179435
  const { channel, client } = yield* findChannel(channelIdentifier);
179396
179436
  const message = yield* client.findOne(
@@ -179434,7 +179474,7 @@ var listThreadReplies = (params) => Effect_exports.gen(function* () {
179434
179474
  {
179435
179475
  limit,
179436
179476
  sort: {
179437
- createdOn: import_core25.SortingOrder.Ascending
179477
+ createdOn: import_core26.SortingOrder.Ascending
179438
179478
  }
179439
179479
  }
179440
179480
  );
@@ -179461,7 +179501,7 @@ var listThreadReplies = (params) => Effect_exports.gen(function* () {
179461
179501
  });
179462
179502
  var addThreadReply = (params) => Effect_exports.gen(function* () {
179463
179503
  const { channel, client, message } = yield* findMessage(params.channel, params.messageId);
179464
- const replyId = (0, import_core25.generateId)();
179504
+ const replyId = (0, import_core26.generateId)();
179465
179505
  const markup = markdownToMarkupString(params.body);
179466
179506
  const replyData = {
179467
179507
  message: markup,
@@ -179649,7 +179689,7 @@ var channelTools = [
179649
179689
  ];
179650
179690
 
179651
179691
  // src/huly/operations/comments.ts
179652
- var import_core26 = __toESM(require_lib4(), 1);
179692
+ var import_core27 = __toESM(require_lib4(), 1);
179653
179693
  var findProjectAndIssue2 = (params) => findProjectAndIssue({ project: params.project, identifier: params.issueIdentifier });
179654
179694
  var findComment = (params) => Effect_exports.gen(function* () {
179655
179695
  const { client, issue: issue2, project: project3 } = yield* findProjectAndIssue2({
@@ -179687,7 +179727,7 @@ var listComments = (params) => Effect_exports.gen(function* () {
179687
179727
  {
179688
179728
  limit,
179689
179729
  sort: {
179690
- createdOn: import_core26.SortingOrder.Ascending
179730
+ createdOn: import_core27.SortingOrder.Ascending
179691
179731
  }
179692
179732
  }
179693
179733
  );
@@ -179706,7 +179746,7 @@ var addComment = (params) => Effect_exports.gen(function* () {
179706
179746
  project: params.project,
179707
179747
  issueIdentifier: params.issueIdentifier
179708
179748
  });
179709
- const commentId = (0, import_core26.generateId)();
179749
+ const commentId = (0, import_core27.generateId)();
179710
179750
  const commentData = {
179711
179751
  message: params.body
179712
179752
  };
@@ -179814,7 +179854,7 @@ var commentTools = [
179814
179854
 
179815
179855
  // src/huly/operations/contacts.ts
179816
179856
  var import_contact = __toESM(require_lib27(), 1);
179817
- var import_core27 = __toESM(require_lib4(), 1);
179857
+ var import_core28 = __toESM(require_lib4(), 1);
179818
179858
  var formatName = (firstName, lastName) => `${lastName},${firstName}`;
179819
179859
  var parseName = (name) => {
179820
179860
  const parts2 = name.split(",");
@@ -179873,7 +179913,7 @@ var listPersons = (params) => Effect_exports.gen(function* () {
179873
179913
  query,
179874
179914
  {
179875
179915
  limit,
179876
- sort: { modifiedOn: import_core27.SortingOrder.Descending }
179916
+ sort: { modifiedOn: import_core28.SortingOrder.Descending }
179877
179917
  }
179878
179918
  );
179879
179919
  const personIds = persons.map((p) => p._id);
@@ -179943,7 +179983,7 @@ var getPerson = (params) => Effect_exports.gen(function* () {
179943
179983
  });
179944
179984
  var createPerson = (params) => Effect_exports.gen(function* () {
179945
179985
  const client = yield* HulyClient;
179946
- const personId = (0, import_core27.generateId)();
179986
+ const personId = (0, import_core28.generateId)();
179947
179987
  const personData = {
179948
179988
  name: formatName(params.firstName, params.lastName),
179949
179989
  // Huly API requires city field to be set, even if empty
@@ -180019,7 +180059,7 @@ var listEmployees = (params) => Effect_exports.gen(function* () {
180019
180059
  {},
180020
180060
  {
180021
180061
  limit,
180022
- sort: { modifiedOn: import_core27.SortingOrder.Descending }
180062
+ sort: { modifiedOn: import_core28.SortingOrder.Descending }
180023
180063
  }
180024
180064
  );
180025
180065
  const employeeIds = employees.map((e) => e._id);
@@ -180044,7 +180084,7 @@ var listOrganizations = (params) => Effect_exports.gen(function* () {
180044
180084
  {},
180045
180085
  {
180046
180086
  limit,
180047
- sort: { modifiedOn: import_core27.SortingOrder.Descending }
180087
+ sort: { modifiedOn: import_core28.SortingOrder.Descending }
180048
180088
  }
180049
180089
  );
180050
180090
  return orgs.map((org) => ({
@@ -180057,7 +180097,7 @@ var listOrganizations = (params) => Effect_exports.gen(function* () {
180057
180097
  });
180058
180098
  var createOrganization = (params) => Effect_exports.gen(function* () {
180059
180099
  const client = yield* HulyClient;
180060
- const orgId = (0, import_core27.generateId)();
180100
+ const orgId = (0, import_core28.generateId)();
180061
180101
  const orgData = {
180062
180102
  name: params.name,
180063
180103
  city: "",
@@ -180183,7 +180223,7 @@ var contactTools = [
180183
180223
  ];
180184
180224
 
180185
180225
  // src/huly/operations/components.ts
180186
- var import_core28 = __toESM(require_lib4(), 1);
180226
+ var import_core29 = __toESM(require_lib4(), 1);
180187
180227
 
180188
180228
  // src/utils/assertions.ts
180189
180229
  var AssertionError = class extends Error {
@@ -180237,7 +180277,7 @@ var listComponents = (params) => Effect_exports.gen(function* () {
180237
180277
  { space: project3._id },
180238
180278
  {
180239
180279
  limit,
180240
- sort: { modifiedOn: import_core28.SortingOrder.Descending }
180280
+ sort: { modifiedOn: import_core29.SortingOrder.Descending }
180241
180281
  }
180242
180282
  );
180243
180283
  const leadIds = [
@@ -180277,7 +180317,7 @@ var getComponent = (params) => Effect_exports.gen(function* () {
180277
180317
  });
180278
180318
  var createComponent = (params) => Effect_exports.gen(function* () {
180279
180319
  const { client, project: project3 } = yield* findProject(params.project);
180280
- const componentId = (0, import_core28.generateId)();
180320
+ const componentId = (0, import_core29.generateId)();
180281
180321
  const leadParam = params.lead;
180282
180322
  const leadRef = leadParam !== void 0 ? yield* Effect_exports.gen(function* () {
180283
180323
  const person = yield* findPersonByEmailOrName(client, leadParam);
@@ -180649,38 +180689,171 @@ var documentTools = [
180649
180689
  ];
180650
180690
 
180651
180691
  // src/huly/operations/issue-templates.ts
180652
- var import_core30 = __toESM(require_lib4(), 1);
180692
+ var import_core33 = __toESM(require_lib4(), 1);
180653
180693
 
180654
- // src/huly/operations/issues.ts
180655
- var import_core29 = __toESM(require_lib4(), 1);
180656
- var import_rank3 = __toESM(require_lib32(), 1);
180694
+ // src/huly/operations/issues-move.ts
180695
+ var import_core30 = __toESM(require_lib4(), 1);
180657
180696
  var import_tracker2 = __toESM(require_lib21(), 1);
180658
- var TxIncResult = Schema_exports.Struct({
180659
- object: Schema_exports.Struct({
180660
- sequence: Schema_exports.Number
180661
- })
180697
+ var addLabel = (params) => Effect_exports.gen(function* () {
180698
+ const { client, issue: issue2, project: project3 } = yield* findProjectAndIssue(params);
180699
+ const existingLabels = yield* client.findAll(
180700
+ tags.class.TagReference,
180701
+ {
180702
+ attachedTo: issue2._id,
180703
+ attachedToClass: tracker.class.Issue
180704
+ }
180705
+ );
180706
+ const labelTitle = params.label.trim();
180707
+ const labelExists = existingLabels.some(
180708
+ (l) => l.title.toLowerCase() === labelTitle.toLowerCase()
180709
+ );
180710
+ if (labelExists) {
180711
+ return { identifier: IssueIdentifier.make(issue2.identifier), labelAdded: false };
180712
+ }
180713
+ const color = params.color ?? 0;
180714
+ let tagElement = yield* client.findOne(
180715
+ tags.class.TagElement,
180716
+ {
180717
+ title: labelTitle,
180718
+ targetClass: toRef(tracker.class.Issue)
180719
+ }
180720
+ );
180721
+ if (tagElement === void 0) {
180722
+ const tagElementId = (0, import_core30.generateId)();
180723
+ const tagElementData = {
180724
+ title: labelTitle,
180725
+ description: "",
180726
+ targetClass: toRef(tracker.class.Issue),
180727
+ color,
180728
+ category: tracker.category.Other
180729
+ };
180730
+ yield* client.createDoc(
180731
+ tags.class.TagElement,
180732
+ toRef(core.space.Workspace),
180733
+ tagElementData,
180734
+ tagElementId
180735
+ );
180736
+ tagElement = yield* client.findOne(
180737
+ tags.class.TagElement,
180738
+ { _id: tagElementId }
180739
+ );
180740
+ }
180741
+ if (tagElement === void 0) {
180742
+ return { identifier: IssueIdentifier.make(issue2.identifier), labelAdded: false };
180743
+ }
180744
+ const tagRefData = {
180745
+ title: tagElement.title,
180746
+ color: tagElement.color,
180747
+ tag: tagElement._id
180748
+ };
180749
+ yield* client.addCollection(
180750
+ tags.class.TagReference,
180751
+ project3._id,
180752
+ issue2._id,
180753
+ tracker.class.Issue,
180754
+ "labels",
180755
+ tagRefData
180756
+ );
180757
+ return { identifier: IssueIdentifier.make(issue2.identifier), labelAdded: true };
180662
180758
  });
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
180759
+ var moveIssue = (params) => Effect_exports.gen(function* () {
180760
+ const { client, issue: issue2, project: project3 } = yield* findProjectAndIssue(params);
180761
+ const oldParentIsIssue = issue2.attachedToClass === tracker.class.Issue;
180762
+ const newParentParam = params.newParent;
180763
+ const { newAttachedTo, newAttachedToClass, newCollection, newParentIdentifier, newParents } = newParentParam !== null ? yield* Effect_exports.gen(function* () {
180764
+ const parentIssue = yield* findIssueInProject(client, project3, newParentParam);
180765
+ return {
180766
+ newAttachedTo: parentIssue._id,
180767
+ newAttachedToClass: tracker.class.Issue,
180768
+ newCollection: "subIssues",
180769
+ newParents: [
180770
+ ...parentIssue.parents,
180771
+ {
180772
+ parentId: parentIssue._id,
180773
+ identifier: parentIssue.identifier,
180774
+ parentTitle: parentIssue.title,
180775
+ space: project3._id
180776
+ }
180777
+ ],
180778
+ newParentIdentifier: parentIssue.identifier
180779
+ };
180780
+ }) : {
180781
+ newAttachedTo: project3._id,
180782
+ newAttachedToClass: tracker.class.Project,
180783
+ newCollection: "issues",
180784
+ newParents: [],
180785
+ newParentIdentifier: void 0
180786
+ };
180787
+ const updateOps = {
180788
+ attachedTo: toRef(newAttachedTo),
180789
+ attachedToClass: newAttachedToClass,
180790
+ collection: newCollection,
180791
+ parents: newParents
180792
+ };
180793
+ yield* client.updateDoc(
180794
+ tracker.class.Issue,
180795
+ project3._id,
180796
+ issue2._id,
180797
+ updateOps
180671
180798
  );
180672
- if (matchingStatus === void 0) {
180673
- return Effect_exports.fail(new InvalidStatusError({ status: statusName, project: project3 }));
180799
+ if (oldParentIsIssue) {
180800
+ yield* client.updateDoc(
180801
+ tracker.class.Issue,
180802
+ project3._id,
180803
+ // issue.attachedTo is Ref<Doc>; for sub-issues it points to the parent issue.
180804
+ // Cast needed because updateDoc expects Ref<HulyIssue> but attachedTo is Ref<Doc>.
180805
+ toRef(issue2.attachedTo),
180806
+ { $inc: { subIssues: -1 } }
180807
+ );
180674
180808
  }
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 });
180809
+ if (params.newParent !== null) {
180810
+ yield* client.updateDoc(
180811
+ tracker.class.Issue,
180812
+ project3._id,
180813
+ toRef(newAttachedTo),
180814
+ { $inc: { subIssues: 1 } }
180815
+ );
180681
180816
  }
180682
- return person;
180817
+ if (issue2.subIssues > 0) {
180818
+ yield* updateDescendantParents(client, project3._id, issue2, newParents);
180819
+ }
180820
+ const result = {
180821
+ identifier: IssueIdentifier.make(issue2.identifier),
180822
+ moved: true
180823
+ };
180824
+ if (newParentIdentifier !== void 0) {
180825
+ return { ...result, newParent: IssueIdentifier.make(newParentIdentifier) };
180826
+ }
180827
+ return result;
180683
180828
  });
180829
+ var updateDescendantParents = (client, spaceId, parentIssue, parentNewParents) => Effect_exports.gen(function* () {
180830
+ const thisParentInfo = {
180831
+ parentId: parentIssue._id,
180832
+ identifier: parentIssue.identifier,
180833
+ parentTitle: parentIssue.title,
180834
+ space: spaceId
180835
+ };
180836
+ const children = yield* client.findAll(
180837
+ tracker.class.Issue,
180838
+ { attachedTo: parentIssue._id, space: spaceId }
180839
+ );
180840
+ for (const child of children) {
180841
+ const childNewParents = [...parentNewParents, thisParentInfo];
180842
+ yield* client.updateDoc(
180843
+ tracker.class.Issue,
180844
+ spaceId,
180845
+ child._id,
180846
+ { parents: childNewParents }
180847
+ );
180848
+ if (child.subIssues > 0) {
180849
+ yield* updateDescendantParents(client, spaceId, child, childNewParents);
180850
+ }
180851
+ }
180852
+ });
180853
+
180854
+ // src/huly/operations/issues-read.ts
180855
+ var import_core31 = __toESM(require_lib4(), 1);
180856
+ var import_tracker3 = __toESM(require_lib21(), 1);
180684
180857
  var resolveStatusName = (statuses, statusId) => {
180685
180858
  const statusDoc = statuses.find((s) => s._id === statusId);
180686
180859
  return statusDoc?.name ?? "Unknown";
@@ -180749,7 +180922,7 @@ var listIssues = (params) => Effect_exports.gen(function* () {
180749
180922
  {
180750
180923
  limit,
180751
180924
  sort: {
180752
- modifiedOn: import_core29.SortingOrder.Descending
180925
+ modifiedOn: import_core31.SortingOrder.Descending
180753
180926
  }
180754
180927
  },
180755
180928
  { assignee: contact.class.Person }
@@ -180816,6 +180989,27 @@ var getIssue = (params) => Effect_exports.gen(function* () {
180816
180989
  };
180817
180990
  return result;
180818
180991
  });
180992
+
180993
+ // src/huly/operations/issues-write.ts
180994
+ var import_core32 = __toESM(require_lib4(), 1);
180995
+ var import_rank3 = __toESM(require_lib32(), 1);
180996
+ var import_tracker4 = __toESM(require_lib21(), 1);
180997
+ var TxIncResult = Schema_exports.Struct({
180998
+ object: Schema_exports.Struct({
180999
+ sequence: Schema_exports.Number
181000
+ })
181001
+ });
181002
+ var extractUpdatedSequence = (txResult) => {
181003
+ const decoded = Schema_exports.decodeUnknownOption(TxIncResult)(txResult);
181004
+ return decoded._tag === "Some" ? decoded.value.object.sequence : void 0;
181005
+ };
181006
+ var resolveAssignee = (client, assigneeIdentifier) => Effect_exports.gen(function* () {
181007
+ const person = yield* findPersonByEmailOrName(client, assigneeIdentifier);
181008
+ if (person === void 0) {
181009
+ return yield* new PersonNotFoundError({ identifier: assigneeIdentifier });
181010
+ }
181011
+ return person;
181012
+ });
180819
181013
  var createIssue = (params) => Effect_exports.gen(function* () {
180820
181014
  const result = params.status !== void 0 ? yield* findProjectWithStatuses(params.project) : yield* Effect_exports.map(findProject(params.project), ({ client: client2, project: project4 }) => ({
180821
181015
  client: client2,
@@ -180823,7 +181017,7 @@ var createIssue = (params) => Effect_exports.gen(function* () {
180823
181017
  statuses: []
180824
181018
  }));
180825
181019
  const { client, project: project3, statuses } = result;
180826
- const issueId = (0, import_core29.generateId)();
181020
+ const issueId = (0, import_core32.generateId)();
180827
181021
  const incOps = { $inc: { sequence: 1 } };
180828
181022
  const incResult = yield* client.updateDoc(
180829
181023
  tracker.class.Project,
@@ -180838,7 +181032,7 @@ var createIssue = (params) => Effect_exports.gen(function* () {
180838
181032
  const lastIssue = yield* client.findOne(
180839
181033
  tracker.class.Issue,
180840
181034
  { space: project3._id },
180841
- { sort: { rank: import_core29.SortingOrder.Descending } }
181035
+ { sort: { rank: import_core32.SortingOrder.Descending } }
180842
181036
  );
180843
181037
  const rank = (0, import_rank3.makeRank)(lastIssue?.rank, void 0);
180844
181038
  const descriptionMarkupRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
@@ -180962,68 +181156,6 @@ var updateIssue = (params) => Effect_exports.gen(function* () {
180962
181156
  }
180963
181157
  return { identifier: IssueIdentifier.make(issue2.identifier), updated: true };
180964
181158
  });
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
181159
  var deleteIssue = (params) => Effect_exports.gen(function* () {
181028
181160
  const { client, issue: issue2, project: project3 } = yield* findProjectAndIssue(params);
181029
181161
  yield* client.removeDoc(
@@ -181033,100 +181165,6 @@ var deleteIssue = (params) => Effect_exports.gen(function* () {
181033
181165
  );
181034
181166
  return { identifier: IssueIdentifier.make(issue2.identifier), deleted: true };
181035
181167
  });
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
181168
 
181131
181169
  // src/huly/operations/issue-templates.ts
181132
181170
  var findTemplateByIdOrTitle = (client, projectId, templateIdOrTitle) => Effect_exports.gen(function* () {
@@ -181192,7 +181230,7 @@ var buildTemplateChild = (client, projectId, projectIdentifier, input) => Effect
181192
181230
  return component._id;
181193
181231
  }) : null;
181194
181232
  return {
181195
- id: (0, import_core30.generateId)(),
181233
+ id: (0, import_core33.generateId)(),
181196
181234
  title: input.title,
181197
181235
  description: input.description ?? "",
181198
181236
  priority: stringToPriority(input.priority || "no-priority"),
@@ -181209,7 +181247,7 @@ var listIssueTemplates = (params) => Effect_exports.gen(function* () {
181209
181247
  { space: project3._id },
181210
181248
  {
181211
181249
  limit,
181212
- sort: { modifiedOn: import_core30.SortingOrder.Descending }
181250
+ sort: { modifiedOn: import_core33.SortingOrder.Descending }
181213
181251
  }
181214
181252
  );
181215
181253
  const summaries = templates.map((t) => {
@@ -181253,7 +181291,7 @@ var getIssueTemplate = (params) => Effect_exports.gen(function* () {
181253
181291
  });
181254
181292
  var createIssueTemplate = (params) => Effect_exports.gen(function* () {
181255
181293
  const { client, project: project3 } = yield* findProject(params.project);
181256
- const templateId = (0, import_core30.generateId)();
181294
+ const templateId = (0, import_core33.generateId)();
181257
181295
  const assigneeParam = params.assignee;
181258
181296
  const assigneeRef = assigneeParam !== void 0 ? yield* Effect_exports.gen(function* () {
181259
181297
  const person = yield* findPersonByEmailOrName(client, assigneeParam);
@@ -181487,10 +181525,10 @@ var removeTemplateChild = (params) => Effect_exports.gen(function* () {
181487
181525
  });
181488
181526
 
181489
181527
  // src/huly/operations/labels.ts
181490
- var import_core32 = __toESM(require_lib4(), 1);
181528
+ var import_core35 = __toESM(require_lib4(), 1);
181491
181529
 
181492
181530
  // src/huly/operations/tag-categories.ts
181493
- var import_core31 = __toESM(require_lib4(), 1);
181531
+ var import_core34 = __toESM(require_lib4(), 1);
181494
181532
  var issueClassRef = toRef(tracker.class.Issue);
181495
181533
  var findCategoryByIdOrLabel = (client, idOrLabel) => Effect_exports.gen(function* () {
181496
181534
  const cat = (yield* client.findOne(
@@ -181528,7 +181566,7 @@ var listTagCategories = (params) => Effect_exports.gen(function* () {
181528
181566
  query,
181529
181567
  {
181530
181568
  limit,
181531
- sort: { modifiedOn: import_core31.SortingOrder.Descending }
181569
+ sort: { modifiedOn: import_core34.SortingOrder.Descending }
181532
181570
  }
181533
181571
  );
181534
181572
  return categories.map(toSummary);
@@ -181543,7 +181581,7 @@ var createTagCategory = (params) => Effect_exports.gen(function* () {
181543
181581
  if (existing !== void 0) {
181544
181582
  return { id: TagCategoryId.make(existing._id), label: existing.label, created: false };
181545
181583
  }
181546
- const catId = (0, import_core31.generateId)();
181584
+ const catId = (0, import_core34.generateId)();
181547
181585
  const catData = {
181548
181586
  // Asset is a branded string type (Metadata<URL>) with no runtime constructor.
181549
181587
  // Empty string is the "no icon" sentinel; Huly UI renders a default icon.
@@ -181644,7 +181682,7 @@ var listLabels = (params) => Effect_exports.gen(function* () {
181644
181682
  query,
181645
181683
  {
181646
181684
  limit,
181647
- sort: { modifiedOn: import_core32.SortingOrder.Descending }
181685
+ sort: { modifiedOn: import_core35.SortingOrder.Descending }
181648
181686
  }
181649
181687
  );
181650
181688
  return elements.map((e) => ({
@@ -181669,7 +181707,7 @@ var createLabel = (params) => Effect_exports.gen(function* () {
181669
181707
  return { id: TagElementId.make(existing._id), title: existing.title, created: false };
181670
181708
  }
181671
181709
  const categoryRef = yield* resolveCategoryRef(client, params.category);
181672
- const tagId = (0, import_core32.generateId)();
181710
+ const tagId = (0, import_core35.generateId)();
181673
181711
  const color = params.color ?? 0;
181674
181712
  const tagData = {
181675
181713
  title: params.title,
@@ -182233,20 +182271,20 @@ var labelTools = [
182233
182271
  ];
182234
182272
 
182235
182273
  // src/huly/operations/milestones.ts
182236
- var import_core33 = __toESM(require_lib4(), 1);
182237
- var import_tracker3 = __toESM(require_lib21(), 1);
182274
+ var import_core36 = __toESM(require_lib4(), 1);
182275
+ var import_tracker5 = __toESM(require_lib21(), 1);
182238
182276
  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"
182277
+ [import_tracker5.MilestoneStatus.Planned]: "planned",
182278
+ [import_tracker5.MilestoneStatus.InProgress]: "in-progress",
182279
+ [import_tracker5.MilestoneStatus.Completed]: "completed",
182280
+ [import_tracker5.MilestoneStatus.Canceled]: "canceled"
182243
182281
  };
182244
182282
  var milestoneStatusToString = (status) => milestoneStatusToStringMap[status];
182245
182283
  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
182284
+ "planned": import_tracker5.MilestoneStatus.Planned,
182285
+ "in-progress": import_tracker5.MilestoneStatus.InProgress,
182286
+ "completed": import_tracker5.MilestoneStatus.Completed,
182287
+ "canceled": import_tracker5.MilestoneStatus.Canceled
182250
182288
  };
182251
182289
  var stringToMilestoneStatus = (status) => stringToMilestoneStatusMap[status];
182252
182290
  var findMilestone = (client, project3, milestoneIdentifier, projectIdentifier) => Effect_exports.gen(function* () {
@@ -182277,7 +182315,7 @@ var listMilestones = (params) => Effect_exports.gen(function* () {
182277
182315
  { space: project3._id },
182278
182316
  {
182279
182317
  limit,
182280
- sort: { modifiedOn: import_core33.SortingOrder.Descending }
182318
+ sort: { modifiedOn: import_core36.SortingOrder.Descending }
182281
182319
  }
182282
182320
  );
182283
182321
  const summaries = milestones.map((m) => ({
@@ -182305,11 +182343,11 @@ var getMilestone = (params) => Effect_exports.gen(function* () {
182305
182343
  });
182306
182344
  var createMilestone = (params) => Effect_exports.gen(function* () {
182307
182345
  const { client, project: project3 } = yield* findProject(params.project);
182308
- const milestoneId = (0, import_core33.generateId)();
182346
+ const milestoneId = (0, import_core36.generateId)();
182309
182347
  const milestoneData = {
182310
182348
  label: params.label,
182311
182349
  description: params.description ?? "",
182312
- status: import_tracker3.MilestoneStatus.Planned,
182350
+ status: import_tracker5.MilestoneStatus.Planned,
182313
182351
  targetDate: params.targetDate,
182314
182352
  comments: 0
182315
182353
  };
@@ -182440,7 +182478,7 @@ var milestoneTools = [
182440
182478
  ];
182441
182479
 
182442
182480
  // src/huly/operations/notifications.ts
182443
- var import_core34 = __toESM(require_lib4(), 1);
182481
+ var import_core37 = __toESM(require_lib4(), 1);
182444
182482
  var toDocNotifyContextSummary = (ctx) => ({
182445
182483
  id: NotificationContextId.make(ctx._id),
182446
182484
  objectId: ctx.objectId,
@@ -182486,7 +182524,7 @@ var listNotifications = (params) => Effect_exports.gen(function* () {
182486
182524
  {
182487
182525
  limit,
182488
182526
  sort: {
182489
- modifiedOn: import_core34.SortingOrder.Descending
182527
+ modifiedOn: import_core37.SortingOrder.Descending
182490
182528
  }
182491
182529
  }
182492
182530
  );
@@ -182628,7 +182666,7 @@ var listNotificationContexts = (params) => Effect_exports.gen(function* () {
182628
182666
  {
182629
182667
  limit,
182630
182668
  sort: {
182631
- lastUpdateTimestamp: import_core34.SortingOrder.Descending
182669
+ lastUpdateTimestamp: import_core37.SortingOrder.Descending
182632
182670
  }
182633
182671
  }
182634
182672
  );
@@ -182845,8 +182883,8 @@ var notificationTools = [
182845
182883
  ];
182846
182884
 
182847
182885
  // src/huly/operations/projects.ts
182848
- var import_core35 = __toESM(require_lib4(), 1);
182849
- var import_tracker4 = __toESM(require_lib21(), 1);
182886
+ var import_core38 = __toESM(require_lib4(), 1);
182887
+ var import_tracker6 = __toESM(require_lib21(), 1);
182850
182888
  var listProjects = (params) => Effect_exports.gen(function* () {
182851
182889
  const client = yield* HulyClient;
182852
182890
  const query = {};
@@ -182860,7 +182898,7 @@ var listProjects = (params) => Effect_exports.gen(function* () {
182860
182898
  {
182861
182899
  limit,
182862
182900
  sort: {
182863
- name: import_core35.SortingOrder.Ascending
182901
+ name: import_core38.SortingOrder.Ascending
182864
182902
  }
182865
182903
  }
182866
182904
  );
@@ -182902,7 +182940,7 @@ var createProject = (params) => Effect_exports.gen(function* () {
182902
182940
  created: false
182903
182941
  };
182904
182942
  }
182905
- const projectId = (0, import_core35.generateId)();
182943
+ const projectId = (0, import_core38.generateId)();
182906
182944
  const projectData = {
182907
182945
  name: params.name,
182908
182946
  description: params.description ?? "",
@@ -182915,7 +182953,7 @@ var createProject = (params) => Effect_exports.gen(function* () {
182915
182953
  // Huly SDK: defaultIssueStatus expects Ref<IssueStatus> but is set by the platform
182916
182954
  // on first issue creation. Empty string sentinel is safe for initial project creation.
182917
182955
  defaultIssueStatus: "",
182918
- defaultTimeReportDay: import_tracker4.TimeReportDayType.CurrentWorkDay,
182956
+ defaultTimeReportDay: import_tracker6.TimeReportDayType.CurrentWorkDay,
182919
182957
  // tracker.ids.ClassingProjectType is the default classic tracker ProjectType.
182920
182958
  type: tracker.ids.ClassingProjectType
182921
182959
  };
@@ -183023,7 +183061,7 @@ var projectTools = [
183023
183061
  ];
183024
183062
 
183025
183063
  // src/huly/operations/search.ts
183026
- var import_core36 = __toESM(require_lib4(), 1);
183064
+ var import_core39 = __toESM(require_lib4(), 1);
183027
183065
  var fulltextSearch = (params) => Effect_exports.gen(function* () {
183028
183066
  const client = yield* HulyClient;
183029
183067
  const limit = clampLimit(params.limit);
@@ -183033,7 +183071,7 @@ var fulltextSearch = (params) => Effect_exports.gen(function* () {
183033
183071
  {
183034
183072
  limit,
183035
183073
  sort: {
183036
- modifiedOn: import_core36.SortingOrder.Descending
183074
+ modifiedOn: import_core39.SortingOrder.Descending
183037
183075
  }
183038
183076
  }
183039
183077
  );
@@ -183145,7 +183183,7 @@ var tagCategoryTools = [
183145
183183
  ];
183146
183184
 
183147
183185
  // src/huly/operations/test-management-core.ts
183148
- var import_core37 = __toESM(require_lib4(), 1);
183186
+ var import_core40 = __toESM(require_lib4(), 1);
183149
183187
 
183150
183188
  // src/huly/test-management-classes.ts
183151
183189
  var testManagement = {
@@ -183353,7 +183391,7 @@ var listTestProjects = (params) => Effect_exports.gen(function* () {
183353
183391
  {},
183354
183392
  {
183355
183393
  limit,
183356
- sort: { name: import_core37.SortingOrder.Ascending }
183394
+ sort: { name: import_core40.SortingOrder.Ascending }
183357
183395
  }
183358
183396
  );
183359
183397
  return {
@@ -183375,7 +183413,7 @@ var listTestSuites = (params) => Effect_exports.gen(function* () {
183375
183413
  query,
183376
183414
  {
183377
183415
  limit,
183378
- sort: { modifiedOn: import_core37.SortingOrder.Descending }
183416
+ sort: { modifiedOn: import_core40.SortingOrder.Descending }
183379
183417
  }
183380
183418
  );
183381
183419
  return {
@@ -183408,7 +183446,7 @@ var createTestSuite = (params) => Effect_exports.gen(function* () {
183408
183446
  if (existing !== void 0) {
183409
183447
  return { id: TestSuiteId.make(existing._id), name: existing.name, created: false };
183410
183448
  }
183411
- const suiteId = (0, import_core37.generateId)();
183449
+ const suiteId = (0, import_core40.generateId)();
183412
183450
  const suiteData = {
183413
183451
  name: params.name,
183414
183452
  description: params.description ?? "",
@@ -183477,7 +183515,7 @@ var listTestCases = (params) => Effect_exports.gen(function* () {
183477
183515
  query,
183478
183516
  {
183479
183517
  limit,
183480
- sort: { modifiedOn: import_core37.SortingOrder.Descending }
183518
+ sort: { modifiedOn: import_core40.SortingOrder.Descending }
183481
183519
  }
183482
183520
  );
183483
183521
  return {
@@ -183505,7 +183543,7 @@ var createTestCase = (params) => Effect_exports.gen(function* () {
183505
183543
  const client = yield* HulyClient;
183506
183544
  const project3 = yield* findTestProject(client, params.project);
183507
183545
  const suite = yield* findTestSuite(client, project3, params.suite);
183508
- const caseId = (0, import_core37.generateId)();
183546
+ const caseId = (0, import_core40.generateId)();
183509
183547
  const assigneeRef = params.assignee !== void 0 ? toRef((yield* resolveAssignee2(params.assignee))._id) : null;
183510
183548
  const typeEnum = params.type !== void 0 ? stringToTestCaseType(params.type) ?? 0 /* Functional */ : 0 /* Functional */;
183511
183549
  const priorityEnum = params.priority !== void 0 ? stringToTestCasePriority(params.priority) ?? 1 /* Medium */ : 1 /* Medium */;
@@ -183733,7 +183771,7 @@ var testManagementCoreTools = [
183733
183771
  ];
183734
183772
 
183735
183773
  // src/huly/operations/test-management-plans.ts
183736
- var import_core38 = __toESM(require_lib4(), 1);
183774
+ var import_core41 = __toESM(require_lib4(), 1);
183737
183775
  var toPlanSummary = (p) => ({
183738
183776
  id: TestPlanId.make(p._id),
183739
183777
  name: p.name
@@ -183751,7 +183789,7 @@ var listTestPlans = (params) => Effect_exports.gen(function* () {
183751
183789
  const plans = yield* client.findAll(
183752
183790
  testManagement.class.TestPlan,
183753
183791
  { space: project3._id },
183754
- { limit, sort: { modifiedOn: import_core38.SortingOrder.Descending } }
183792
+ { limit, sort: { modifiedOn: import_core41.SortingOrder.Descending } }
183755
183793
  );
183756
183794
  return { plans: plans.map(toPlanSummary), total: plans.total };
183757
183795
  });
@@ -183786,7 +183824,7 @@ var createTestPlan = (params) => Effect_exports.gen(function* () {
183786
183824
  if (existing !== void 0) {
183787
183825
  return { id: TestPlanId.make(existing._id), name: existing.name, created: false };
183788
183826
  }
183789
- const planId = (0, import_core38.generateId)();
183827
+ const planId = (0, import_core41.generateId)();
183790
183828
  const descRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
183791
183829
  testManagement.class.TestPlan,
183792
183830
  planId,
@@ -183867,7 +183905,7 @@ var removeTestPlanItem = (params) => Effect_exports.gen(function* () {
183867
183905
  });
183868
183906
 
183869
183907
  // src/huly/operations/test-management-runs.ts
183870
- var import_core39 = __toESM(require_lib4(), 1);
183908
+ var import_core42 = __toESM(require_lib4(), 1);
183871
183909
  var BATCH_CONCURRENCY = 10;
183872
183910
  var toRunSummary = (r) => ({
183873
183911
  id: TestRunId.make(r._id),
@@ -183888,7 +183926,7 @@ var listTestRuns = (params) => Effect_exports.gen(function* () {
183888
183926
  const runs = yield* client.findAll(
183889
183927
  testManagement.class.TestRun,
183890
183928
  { space: project3._id },
183891
- { limit, sort: { modifiedOn: import_core39.SortingOrder.Descending } }
183929
+ { limit, sort: { modifiedOn: import_core42.SortingOrder.Descending } }
183892
183930
  );
183893
183931
  return { runs: runs.map(toRunSummary), total: runs.total };
183894
183932
  });
@@ -183917,7 +183955,7 @@ var getTestRun = (params) => Effect_exports.gen(function* () {
183917
183955
  var createTestRun = (params) => Effect_exports.gen(function* () {
183918
183956
  const client = yield* HulyClient;
183919
183957
  const project3 = yield* findTestProject(client, params.project);
183920
- const runId = (0, import_core39.generateId)();
183958
+ const runId = (0, import_core42.generateId)();
183921
183959
  const descRef = params.description !== void 0 && params.description.trim() !== "" ? yield* client.uploadMarkup(
183922
183960
  testManagement.class.TestRun,
183923
183961
  runId,
@@ -183974,7 +184012,7 @@ var listTestResults = (params) => Effect_exports.gen(function* () {
183974
184012
  const results = yield* client.findAll(
183975
184013
  testManagement.class.TestResult,
183976
184014
  { attachedTo: run3._id },
183977
- { limit, sort: { modifiedOn: import_core39.SortingOrder.Descending } }
184015
+ { limit, sort: { modifiedOn: import_core42.SortingOrder.Descending } }
183978
184016
  );
183979
184017
  return { results: results.map(toResultSummary), total: results.total };
183980
184018
  });
@@ -184074,7 +184112,7 @@ var runTestPlan = (params) => Effect_exports.gen(function* () {
184074
184112
  }
184075
184113
  return { item, tc };
184076
184114
  }), { concurrency: BATCH_CONCURRENCY });
184077
- const runId = (0, import_core39.generateId)();
184115
+ const runId = (0, import_core42.generateId)();
184078
184116
  const runName = params.runName ?? `${plan.name} - Run`;
184079
184117
  yield* client.createDoc(testManagement.class.TestRun, project3._id, {
184080
184118
  name: runName,
@@ -184246,9 +184284,9 @@ var testManagementPlansTools = [
184246
184284
  ];
184247
184285
 
184248
184286
  // 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);
184287
+ var import_calendar6 = __toESM(require_lib24(), 1);
184288
+ var import_core43 = __toESM(require_lib4(), 1);
184289
+ var import_tracker7 = __toESM(require_lib21(), 1);
184252
184290
  var serverPopulatedCalendar = toRef("");
184253
184291
  var serverPopulatedPersonId = "";
184254
184292
  var refAsPersonId = (ref) => ref;
@@ -184257,7 +184295,7 @@ var logTime = (params) => Effect_exports.gen(function* () {
184257
184295
  project: params.project,
184258
184296
  identifier: params.identifier
184259
184297
  });
184260
- const reportId = (0, import_core40.generateId)();
184298
+ const reportId = (0, import_core43.generateId)();
184261
184299
  const reportData = {
184262
184300
  employee: null,
184263
184301
  date: Date.now(),
@@ -184296,7 +184334,7 @@ var getTimeReport = (params) => Effect_exports.gen(function* () {
184296
184334
  const reports = yield* client.findAll(
184297
184335
  tracker.class.TimeSpendReport,
184298
184336
  { attachedTo: issue2._id },
184299
- { sort: { date: import_core40.SortingOrder.Descending } }
184337
+ { sort: { date: import_core43.SortingOrder.Descending } }
184300
184338
  );
184301
184339
  const employeeIds = [
184302
184340
  ...new Set(
@@ -184348,7 +184386,7 @@ var listTimeSpendReports = (params) => Effect_exports.gen(function* () {
184348
184386
  tracker.class.TimeSpendReport,
184349
184387
  query,
184350
184388
  withLookup(
184351
- { limit, sort: { date: import_core40.SortingOrder.Descending } },
184389
+ { limit, sort: { date: import_core43.SortingOrder.Descending } },
184352
184390
  {
184353
184391
  attachedTo: tracker.class.Issue,
184354
184392
  employee: contact.class.Person
@@ -184377,7 +184415,7 @@ var getDetailedTimeReport = (params) => Effect_exports.gen(function* () {
184377
184415
  tracker.class.TimeSpendReport,
184378
184416
  query,
184379
184417
  withLookup(
184380
- { sort: { date: import_core40.SortingOrder.Descending } },
184418
+ { sort: { date: import_core43.SortingOrder.Descending } },
184381
184419
  {
184382
184420
  attachedTo: tracker.class.Issue,
184383
184421
  employee: contact.class.Person
@@ -184453,7 +184491,7 @@ var listWorkSlots = (params) => Effect_exports.gen(function* () {
184453
184491
  const slots = yield* client.findAll(
184454
184492
  time.class.WorkSlot,
184455
184493
  query,
184456
- { limit, sort: { date: import_core40.SortingOrder.Descending } }
184494
+ { limit, sort: { date: import_core43.SortingOrder.Descending } }
184457
184495
  );
184458
184496
  return slots.map((s) => ({
184459
184497
  id: s._id,
@@ -184465,7 +184503,7 @@ var listWorkSlots = (params) => Effect_exports.gen(function* () {
184465
184503
  });
184466
184504
  var createWorkSlot = (params) => Effect_exports.gen(function* () {
184467
184505
  const client = yield* HulyClient;
184468
- const slotId = (0, import_core40.generateId)();
184506
+ const slotId = (0, import_core43.generateId)();
184469
184507
  const slotData = {
184470
184508
  date: params.date,
184471
184509
  dueDate: params.dueDate,
@@ -184473,7 +184511,7 @@ var createWorkSlot = (params) => Effect_exports.gen(function* () {
184473
184511
  description: "",
184474
184512
  allDay: false,
184475
184513
  participants: [],
184476
- access: import_calendar5.AccessLevel.Owner,
184514
+ access: import_calendar6.AccessLevel.Owner,
184477
184515
  reminders: [],
184478
184516
  visibility: "public",
184479
184517
  eventId: "",
@@ -184609,15 +184647,15 @@ var timeTools = [
184609
184647
  ];
184610
184648
 
184611
184649
  // src/huly/operations/workspace.ts
184612
- var import_core41 = __toESM(require_lib4(), 1);
184650
+ var import_core44 = __toESM(require_lib4(), 1);
184613
184651
  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
184652
+ READONLYGUEST: import_core44.AccountRole.ReadOnlyGuest,
184653
+ DocGuest: import_core44.AccountRole.DocGuest,
184654
+ GUEST: import_core44.AccountRole.Guest,
184655
+ USER: import_core44.AccountRole.User,
184656
+ MAINTAINER: import_core44.AccountRole.Maintainer,
184657
+ OWNER: import_core44.AccountRole.Owner,
184658
+ ADMIN: import_core44.AccountRole.Admin
184621
184659
  };
184622
184660
  var toHulyAccountRole = (role) => accountRoleMap[role];
184623
184661
  var formatVersion = (info) => `${info.versionMajor}.${info.versionMinor}.${info.versionPatch}`;