@bgx4k3p/huly-mcp-server 2.2.3 → 2.2.5

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.
Files changed (696) hide show
  1. package/README.md +186 -56
  2. package/node_modules/@hcengineering/account-client/lib/__tests__/utils.test.js +249 -0
  3. package/node_modules/@hcengineering/account-client/lib/__tests__/utils.test.js.map +7 -0
  4. package/node_modules/@hcengineering/account-client/lib/client.js +88 -3
  5. package/node_modules/@hcengineering/account-client/lib/client.js.map +2 -2
  6. package/node_modules/@hcengineering/account-client/lib/types.js.map +2 -2
  7. package/node_modules/@hcengineering/account-client/lib/utils.js +50 -0
  8. package/node_modules/@hcengineering/account-client/lib/utils.js.map +2 -2
  9. package/node_modules/@hcengineering/account-client/package.json +22 -19
  10. package/node_modules/@hcengineering/account-client/src/__tests__/utils.test.ts +304 -0
  11. package/node_modules/@hcengineering/account-client/src/client.ts +127 -6
  12. package/node_modules/@hcengineering/account-client/src/types.ts +7 -0
  13. package/node_modules/@hcengineering/account-client/src/utils.ts +65 -1
  14. package/node_modules/@hcengineering/analytics/lib/index.js +1 -1
  15. package/node_modules/@hcengineering/analytics/lib/index.js.map +2 -2
  16. package/node_modules/@hcengineering/analytics/package.json +19 -16
  17. package/node_modules/@hcengineering/analytics/src/index.ts +2 -1
  18. package/node_modules/@hcengineering/api-client/lib/client.js +9 -4
  19. package/node_modules/@hcengineering/api-client/lib/client.js.map +2 -2
  20. package/node_modules/@hcengineering/api-client/lib/rest/adapter.js +64 -0
  21. package/node_modules/@hcengineering/api-client/lib/rest/adapter.js.map +7 -0
  22. package/node_modules/@hcengineering/api-client/lib/rest/index.js +2 -0
  23. package/node_modules/@hcengineering/api-client/lib/rest/index.js.map +2 -2
  24. package/node_modules/@hcengineering/api-client/lib/socket/node.js +5 -1
  25. package/node_modules/@hcengineering/api-client/lib/socket/node.js.map +2 -2
  26. package/node_modules/@hcengineering/api-client/package.json +28 -25
  27. package/node_modules/@hcengineering/api-client/src/client.ts +10 -1
  28. package/node_modules/@hcengineering/api-client/src/rest/adapter.ts +96 -0
  29. package/node_modules/@hcengineering/api-client/src/rest/index.ts +1 -0
  30. package/node_modules/@hcengineering/api-client/src/socket/node.ts +6 -1
  31. package/node_modules/@hcengineering/chunter/lib/index.js.map +2 -2
  32. package/node_modules/@hcengineering/chunter/package.json +13 -10
  33. package/node_modules/@hcengineering/client/package.json +21 -18
  34. package/node_modules/@hcengineering/client-resources/package.json +24 -21
  35. package/node_modules/@hcengineering/collaborator-client/package.json +21 -18
  36. package/node_modules/@hcengineering/contact/lib/__tests__/workspaceMemberStatusUtils.test.js +38 -0
  37. package/node_modules/@hcengineering/contact/lib/__tests__/workspaceMemberStatusUtils.test.js.map +7 -0
  38. package/node_modules/@hcengineering/contact/lib/index.js +13 -4
  39. package/node_modules/@hcengineering/contact/lib/index.js.map +2 -2
  40. package/node_modules/@hcengineering/contact/lib/types.js.map +1 -1
  41. package/node_modules/@hcengineering/contact/lib/utils.js +132 -108
  42. package/node_modules/@hcengineering/contact/lib/utils.js.map +3 -3
  43. package/node_modules/@hcengineering/contact/lib/workspaceMemberStatusUtils.js +79 -0
  44. package/node_modules/@hcengineering/contact/lib/workspaceMemberStatusUtils.js.map +7 -0
  45. package/node_modules/@hcengineering/contact/package.json +12 -9
  46. package/node_modules/@hcengineering/core/CHANGELOG.md +9 -1
  47. package/node_modules/@hcengineering/core/lang/cs.json +6 -1
  48. package/node_modules/@hcengineering/core/lang/de.json +6 -1
  49. package/node_modules/@hcengineering/core/lang/en.json +6 -1
  50. package/node_modules/@hcengineering/core/lang/es.json +6 -1
  51. package/node_modules/@hcengineering/core/lang/fr.json +6 -1
  52. package/node_modules/@hcengineering/core/lang/it.json +6 -1
  53. package/node_modules/@hcengineering/core/lang/ja.json +6 -1
  54. package/node_modules/@hcengineering/core/lang/pt-br.json +70 -0
  55. package/node_modules/@hcengineering/core/lang/pt.json +6 -1
  56. package/node_modules/@hcengineering/core/lang/ru.json +6 -1
  57. package/node_modules/@hcengineering/core/lang/tr.json +6 -1
  58. package/node_modules/@hcengineering/core/lang/zh.json +6 -1
  59. package/node_modules/@hcengineering/core/lib/__tests__/autoJoinRoles.test.js +13 -0
  60. package/node_modules/@hcengineering/core/lib/__tests__/autoJoinRoles.test.js.map +7 -0
  61. package/node_modules/@hcengineering/core/lib/__tests__/memdb.test.js +133 -0
  62. package/node_modules/@hcengineering/core/lib/__tests__/memdb.test.js.map +2 -2
  63. package/node_modules/@hcengineering/core/lib/__tests__/minmodel.js +25 -0
  64. package/node_modules/@hcengineering/core/lib/__tests__/minmodel.js.map +2 -2
  65. package/node_modules/@hcengineering/core/lib/__tests__/query.test.js +43 -0
  66. package/node_modules/@hcengineering/core/lib/__tests__/query.test.js.map +7 -0
  67. package/node_modules/@hcengineering/core/lib/autoJoinRoles.js +36 -0
  68. package/node_modules/@hcengineering/core/lib/autoJoinRoles.js.map +7 -0
  69. package/node_modules/@hcengineering/core/lib/classes.js +5 -0
  70. package/node_modules/@hcengineering/core/lib/classes.js.map +3 -3
  71. package/node_modules/@hcengineering/core/lib/clone.js +13 -2
  72. package/node_modules/@hcengineering/core/lib/clone.js.map +2 -2
  73. package/node_modules/@hcengineering/core/lib/component.js +14 -3
  74. package/node_modules/@hcengineering/core/lib/component.js.map +2 -2
  75. package/node_modules/@hcengineering/core/lib/index.js +2 -0
  76. package/node_modules/@hcengineering/core/lib/index.js.map +2 -2
  77. package/node_modules/@hcengineering/core/lib/memdb.js +6 -2
  78. package/node_modules/@hcengineering/core/lib/memdb.js.map +2 -2
  79. package/node_modules/@hcengineering/core/lib/operations.js +11 -0
  80. package/node_modules/@hcengineering/core/lib/operations.js.map +2 -2
  81. package/node_modules/@hcengineering/core/lib/predicate.js +3 -0
  82. package/node_modules/@hcengineering/core/lib/predicate.js.map +2 -2
  83. package/node_modules/@hcengineering/core/lib/storage.js.map +2 -2
  84. package/node_modules/@hcengineering/core/lib/tx.js +3 -1
  85. package/node_modules/@hcengineering/core/lib/tx.js.map +2 -2
  86. package/node_modules/@hcengineering/core/lib/utils.js +1 -1
  87. package/node_modules/@hcengineering/core/lib/utils.js.map +2 -2
  88. package/node_modules/@hcengineering/core/lib/versioning.js +17 -0
  89. package/node_modules/@hcengineering/core/lib/versioning.js.map +7 -0
  90. package/node_modules/@hcengineering/core/package.json +22 -19
  91. package/node_modules/@hcengineering/core/src/__tests__/autoJoinRoles.test.ts +27 -0
  92. package/node_modules/@hcengineering/core/src/__tests__/memdb.test.ts +150 -1
  93. package/node_modules/@hcengineering/core/src/__tests__/minmodel.ts +29 -1
  94. package/node_modules/@hcengineering/core/src/__tests__/query.test.ts +66 -0
  95. package/node_modules/@hcengineering/core/src/autoJoinRoles.ts +33 -0
  96. package/node_modules/@hcengineering/core/src/classes.ts +61 -1
  97. package/node_modules/@hcengineering/core/src/clone.ts +13 -2
  98. package/node_modules/@hcengineering/core/src/component.ts +25 -9
  99. package/node_modules/@hcengineering/core/src/index.ts +2 -0
  100. package/node_modules/@hcengineering/core/src/memdb.ts +7 -3
  101. package/node_modules/@hcengineering/core/src/operations.ts +11 -0
  102. package/node_modules/@hcengineering/core/src/predicate.ts +3 -0
  103. package/node_modules/@hcengineering/core/src/storage.ts +6 -3
  104. package/node_modules/@hcengineering/core/src/tx.ts +4 -1
  105. package/node_modules/@hcengineering/core/src/utils.ts +1 -1
  106. package/node_modules/@hcengineering/core/src/versioning.ts +13 -0
  107. package/node_modules/@hcengineering/measurements/lib/__tests__/performance.test.js +3 -3
  108. package/node_modules/@hcengineering/measurements/lib/__tests__/performance.test.js.map +2 -2
  109. package/node_modules/@hcengineering/measurements/package.json +17 -14
  110. package/node_modules/@hcengineering/measurements/src/__tests__/performance.test.ts +3 -3
  111. package/node_modules/@hcengineering/platform/lang/pt-br.json +31 -0
  112. package/node_modules/@hcengineering/platform/lib/__tests__/i18n.test.js +100 -0
  113. package/node_modules/@hcengineering/platform/lib/__tests__/i18n.test.js.map +2 -2
  114. package/node_modules/@hcengineering/platform/lib/__tests__/status.test.js +78 -0
  115. package/node_modules/@hcengineering/platform/lib/__tests__/status.test.js.map +7 -0
  116. package/node_modules/@hcengineering/platform/lib/i18n.js +78 -69
  117. package/node_modules/@hcengineering/platform/lib/i18n.js.map +3 -3
  118. package/node_modules/@hcengineering/platform/lib/status.js +25 -0
  119. package/node_modules/@hcengineering/platform/lib/status.js.map +2 -2
  120. package/node_modules/@hcengineering/platform/package.json +18 -15
  121. package/node_modules/@hcengineering/platform/src/__tests__/i18n.test.ts +114 -2
  122. package/node_modules/@hcengineering/platform/src/__tests__/status.test.ts +77 -0
  123. package/node_modules/@hcengineering/platform/src/i18n.ts +99 -71
  124. package/node_modules/@hcengineering/platform/src/status.ts +30 -0
  125. package/node_modules/@hcengineering/rank/package.json +19 -16
  126. package/node_modules/@hcengineering/rpc/package.json +21 -18
  127. package/node_modules/@hcengineering/tags/package.json +12 -9
  128. package/node_modules/@hcengineering/task/package.json +14 -11
  129. package/node_modules/@hcengineering/text/lib/markup/__tests__/utils.test.js +25 -0
  130. package/node_modules/@hcengineering/text/lib/markup/__tests__/utils.test.js.map +2 -2
  131. package/node_modules/@hcengineering/text/lib/tiptapExtensions.js +6 -0
  132. package/node_modules/@hcengineering/text/lib/tiptapExtensions.js.map +2 -2
  133. package/node_modules/@hcengineering/text/package.json +23 -18
  134. package/node_modules/@hcengineering/text/src/markup/__tests__/utils.test.ts +27 -0
  135. package/node_modules/@hcengineering/text/src/tiptapExtensions.ts +3 -0
  136. package/node_modules/@hcengineering/text-core/lib/markup/model.js +1 -0
  137. package/node_modules/@hcengineering/text-core/lib/markup/model.js.map +2 -2
  138. package/node_modules/@hcengineering/text-core/package.json +20 -17
  139. package/node_modules/@hcengineering/text-core/src/markup/model.ts +2 -1
  140. package/node_modules/@hcengineering/text-html/package.json +19 -16
  141. package/node_modules/@hcengineering/text-markdown/lib/serializer.js +14 -0
  142. package/node_modules/@hcengineering/text-markdown/lib/serializer.js.map +2 -2
  143. package/node_modules/@hcengineering/text-markdown/package.json +20 -17
  144. package/node_modules/@hcengineering/text-markdown/src/serializer.ts +14 -0
  145. package/node_modules/@hcengineering/tracker/lib/index.js +1 -0
  146. package/node_modules/@hcengineering/tracker/lib/index.js.map +2 -2
  147. package/node_modules/@hcengineering/tracker/package.json +16 -13
  148. package/node_modules/@tiptap/core/dist/commands/focus.d.ts.map +1 -1
  149. package/node_modules/@tiptap/core/dist/index.cjs +19 -2
  150. package/node_modules/@tiptap/core/dist/index.cjs.map +1 -1
  151. package/node_modules/@tiptap/core/dist/index.js +19 -3
  152. package/node_modules/@tiptap/core/dist/index.js.map +1 -1
  153. package/node_modules/@tiptap/core/dist/index.umd.js +19 -2
  154. package/node_modules/@tiptap/core/dist/index.umd.js.map +1 -1
  155. package/node_modules/@tiptap/core/dist/utilities/index.d.ts +1 -0
  156. package/node_modules/@tiptap/core/dist/utilities/index.d.ts.map +1 -1
  157. package/node_modules/@tiptap/core/dist/utilities/isSafari.d.ts +10 -0
  158. package/node_modules/@tiptap/core/dist/utilities/isSafari.d.ts.map +1 -0
  159. package/node_modules/@tiptap/core/package.json +2 -2
  160. package/node_modules/@tiptap/core/src/commands/focus.ts +7 -2
  161. package/node_modules/@tiptap/core/src/utilities/index.ts +1 -0
  162. package/node_modules/@tiptap/core/src/utilities/isSafari.ts +11 -0
  163. package/node_modules/@tiptap/extension-blockquote/package.json +2 -2
  164. package/node_modules/@tiptap/extension-bold/package.json +2 -2
  165. package/node_modules/@tiptap/extension-bullet-list/package.json +2 -2
  166. package/node_modules/@tiptap/extension-code/package.json +2 -2
  167. package/node_modules/@tiptap/extension-code-block/package.json +3 -3
  168. package/node_modules/@tiptap/extension-document/package.json +2 -2
  169. package/node_modules/@tiptap/extension-dropcursor/package.json +3 -3
  170. package/node_modules/@tiptap/extension-gapcursor/package.json +3 -3
  171. package/node_modules/@tiptap/extension-hard-break/package.json +2 -2
  172. package/node_modules/@tiptap/extension-heading/package.json +2 -2
  173. package/node_modules/@tiptap/extension-highlight/package.json +2 -2
  174. package/node_modules/@tiptap/extension-history/package.json +3 -3
  175. package/node_modules/@tiptap/extension-horizontal-rule/package.json +3 -3
  176. package/node_modules/@tiptap/extension-italic/package.json +2 -2
  177. package/node_modules/@tiptap/extension-link/package.json +3 -3
  178. package/node_modules/@tiptap/extension-list-item/package.json +2 -2
  179. package/node_modules/@tiptap/extension-mention/package.json +4 -4
  180. package/node_modules/@tiptap/extension-ordered-list/package.json +2 -2
  181. package/node_modules/@tiptap/extension-paragraph/package.json +2 -2
  182. package/node_modules/@tiptap/extension-strike/package.json +2 -2
  183. package/node_modules/@tiptap/extension-subscript/README.md +14 -0
  184. package/node_modules/@tiptap/extension-subscript/dist/index.cjs +61 -0
  185. package/node_modules/@tiptap/extension-subscript/dist/index.cjs.map +1 -0
  186. package/node_modules/@tiptap/extension-subscript/dist/index.d.ts +4 -0
  187. package/node_modules/@tiptap/extension-subscript/dist/index.d.ts.map +1 -0
  188. package/node_modules/@tiptap/extension-subscript/dist/index.js +56 -0
  189. package/node_modules/@tiptap/extension-subscript/dist/index.js.map +1 -0
  190. package/node_modules/@tiptap/extension-subscript/dist/index.umd.js +65 -0
  191. package/node_modules/@tiptap/extension-subscript/dist/index.umd.js.map +1 -0
  192. package/node_modules/@tiptap/extension-subscript/dist/subscript.d.ts +36 -0
  193. package/node_modules/@tiptap/extension-subscript/dist/subscript.d.ts.map +1 -0
  194. package/node_modules/@tiptap/extension-subscript/package.json +49 -0
  195. package/node_modules/@tiptap/extension-subscript/src/index.ts +5 -0
  196. package/node_modules/@tiptap/extension-subscript/src/subscript.ts +91 -0
  197. package/node_modules/@tiptap/extension-superscript/README.md +14 -0
  198. package/node_modules/@tiptap/extension-superscript/dist/index.cjs +61 -0
  199. package/node_modules/@tiptap/extension-superscript/dist/index.cjs.map +1 -0
  200. package/node_modules/@tiptap/extension-superscript/dist/index.d.ts +4 -0
  201. package/node_modules/@tiptap/extension-superscript/dist/index.d.ts.map +1 -0
  202. package/node_modules/@tiptap/extension-superscript/dist/index.js +56 -0
  203. package/node_modules/@tiptap/extension-superscript/dist/index.js.map +1 -0
  204. package/node_modules/@tiptap/extension-superscript/dist/index.umd.js +65 -0
  205. package/node_modules/@tiptap/extension-superscript/dist/index.umd.js.map +1 -0
  206. package/node_modules/@tiptap/extension-superscript/dist/superscript.d.ts +36 -0
  207. package/node_modules/@tiptap/extension-superscript/dist/superscript.d.ts.map +1 -0
  208. package/node_modules/@tiptap/extension-superscript/package.json +49 -0
  209. package/node_modules/@tiptap/extension-superscript/src/index.ts +5 -0
  210. package/node_modules/@tiptap/extension-superscript/src/superscript.ts +91 -0
  211. package/node_modules/@tiptap/extension-table/package.json +3 -3
  212. package/node_modules/@tiptap/extension-table-cell/package.json +2 -2
  213. package/node_modules/@tiptap/extension-table-header/package.json +2 -2
  214. package/node_modules/@tiptap/extension-table-row/package.json +2 -2
  215. package/node_modules/@tiptap/extension-task-item/package.json +3 -3
  216. package/node_modules/@tiptap/extension-task-list/package.json +2 -2
  217. package/node_modules/@tiptap/extension-text/package.json +2 -2
  218. package/node_modules/@tiptap/extension-typography/package.json +2 -2
  219. package/node_modules/@tiptap/extension-underline/package.json +2 -2
  220. package/node_modules/@tiptap/html/package.json +3 -3
  221. package/node_modules/@tiptap/pm/package.json +1 -1
  222. package/node_modules/@tiptap/starter-kit/node_modules/@tiptap/extension-text-style/package.json +2 -2
  223. package/node_modules/@tiptap/starter-kit/package.json +22 -22
  224. package/node_modules/@tiptap/suggestion/package.json +3 -3
  225. package/node_modules/linkify-it/build/index.cjs.js +99 -94
  226. package/node_modules/linkify-it/index.mjs +99 -94
  227. package/node_modules/linkify-it/package.json +11 -1
  228. package/node_modules/linkifyjs/README.md +4 -2
  229. package/node_modules/linkifyjs/dist/linkify.cjs +8 -11
  230. package/node_modules/linkifyjs/dist/linkify.d.cts +14 -14
  231. package/node_modules/linkifyjs/dist/linkify.d.mts +14 -14
  232. package/node_modules/linkifyjs/dist/linkify.js +8 -11
  233. package/node_modules/linkifyjs/dist/linkify.min.js +1 -1
  234. package/node_modules/linkifyjs/dist/linkify.mjs +8 -11
  235. package/node_modules/linkifyjs/package.json +1 -1
  236. package/node_modules/markdown-it/README.md +13 -17
  237. package/node_modules/markdown-it/dist/index.cjs.js +111 -31
  238. package/node_modules/markdown-it/dist/markdown-it.js +117 -31
  239. package/node_modules/markdown-it/dist/markdown-it.min.js +2 -2
  240. package/node_modules/markdown-it/lib/common/utils.mjs +30 -1
  241. package/node_modules/markdown-it/lib/index.mjs +1 -1
  242. package/node_modules/markdown-it/lib/rules_block/heading.mjs +2 -2
  243. package/node_modules/markdown-it/lib/rules_block/html_block.mjs +12 -1
  244. package/node_modules/markdown-it/lib/rules_block/lheading.mjs +4 -1
  245. package/node_modules/markdown-it/lib/rules_block/paragraph.mjs +3 -1
  246. package/node_modules/markdown-it/lib/rules_core/smartquotes.mjs +37 -21
  247. package/node_modules/markdown-it/lib/rules_inline/entity.mjs +2 -2
  248. package/node_modules/markdown-it/lib/rules_inline/state_inline.mjs +37 -6
  249. package/node_modules/markdown-it/package.json +14 -3
  250. package/node_modules/msgpackr/README.md +1 -3
  251. package/node_modules/msgpackr/benchmark.md +26 -16
  252. package/node_modules/msgpackr/dist/index-no-eval.cjs +35 -16
  253. package/node_modules/msgpackr/dist/index-no-eval.cjs.map +1 -1
  254. package/node_modules/msgpackr/dist/index-no-eval.min.js +1 -1
  255. package/node_modules/msgpackr/dist/index-no-eval.min.js.map +1 -1
  256. package/node_modules/msgpackr/dist/index.js +35 -16
  257. package/node_modules/msgpackr/dist/index.js.map +1 -1
  258. package/node_modules/msgpackr/dist/index.min.js +1 -1
  259. package/node_modules/msgpackr/dist/index.min.js.map +1 -1
  260. package/node_modules/msgpackr/dist/node.cjs +50 -26
  261. package/node_modules/msgpackr/dist/node.cjs.map +1 -1
  262. package/node_modules/msgpackr/dist/test.js +44 -16
  263. package/node_modules/msgpackr/dist/test.js.map +1 -1
  264. package/node_modules/msgpackr/dist/unpack-no-eval.cjs +35 -16
  265. package/node_modules/msgpackr/dist/unpack-no-eval.cjs.map +1 -1
  266. package/node_modules/msgpackr/index.d.cts +2 -0
  267. package/node_modules/msgpackr/index.d.ts +2 -0
  268. package/node_modules/msgpackr/package.json +1 -1
  269. package/node_modules/msgpackr/stream.js +15 -10
  270. package/node_modules/msgpackr/unpack.js +35 -16
  271. package/node_modules/prosemirror-changeset/CHANGELOG.md +12 -0
  272. package/node_modules/prosemirror-changeset/README.md +31 -2
  273. package/node_modules/prosemirror-changeset/dist/index.cjs +17 -2
  274. package/node_modules/prosemirror-changeset/dist/index.d.cts +32 -2
  275. package/node_modules/prosemirror-changeset/dist/index.d.ts +32 -2
  276. package/node_modules/prosemirror-changeset/dist/index.js +18 -3
  277. package/node_modules/prosemirror-changeset/package.json +2 -2
  278. package/node_modules/prosemirror-changeset/src/README.md +4 -2
  279. package/node_modules/prosemirror-changeset/src/change.ts +18 -0
  280. package/node_modules/prosemirror-changeset/src/changeset.ts +10 -4
  281. package/node_modules/prosemirror-changeset/src/simplify.ts +1 -1
  282. package/node_modules/prosemirror-changeset/test/test-simplify.ts +3 -0
  283. package/node_modules/prosemirror-gapcursor/CHANGELOG.md +6 -0
  284. package/node_modules/prosemirror-gapcursor/dist/index.cjs +1 -1
  285. package/node_modules/prosemirror-gapcursor/dist/index.js +1 -1
  286. package/node_modules/prosemirror-gapcursor/package.json +3 -2
  287. package/node_modules/prosemirror-gapcursor/src/gapcursor.ts +1 -1
  288. package/node_modules/prosemirror-markdown/CHANGELOG.md +12 -0
  289. package/node_modules/prosemirror-markdown/dist/index.cjs +11 -1
  290. package/node_modules/prosemirror-markdown/dist/index.js +14 -2
  291. package/node_modules/prosemirror-markdown/package.json +1 -1
  292. package/node_modules/prosemirror-markdown/src/to_markdown.ts +12 -3
  293. package/node_modules/prosemirror-menu/CHANGELOG.md +18 -0
  294. package/node_modules/prosemirror-menu/CONTRIBUTING.md +22 -18
  295. package/node_modules/prosemirror-menu/README.md +69 -29
  296. package/node_modules/prosemirror-menu/dist/index.cjs +232 -48
  297. package/node_modules/prosemirror-menu/dist/index.d.cts +29 -14
  298. package/node_modules/prosemirror-menu/dist/index.d.ts +29 -14
  299. package/node_modules/prosemirror-menu/dist/index.js +229 -36
  300. package/node_modules/prosemirror-menu/package.json +2 -2
  301. package/node_modules/prosemirror-menu/src/README.md +30 -1
  302. package/node_modules/prosemirror-menu/src/icons.ts +3 -2
  303. package/node_modules/prosemirror-menu/src/menu.ts +193 -40
  304. package/node_modules/prosemirror-menu/src/menubar.ts +50 -5
  305. package/node_modules/prosemirror-menu/style/menu.css +28 -7
  306. package/node_modules/prosemirror-model/CHANGELOG.md +20 -0
  307. package/node_modules/prosemirror-model/CONTRIBUTING.md +19 -19
  308. package/node_modules/prosemirror-model/README.md +3 -3
  309. package/node_modules/prosemirror-model/dist/index.cjs +13 -10
  310. package/node_modules/prosemirror-model/dist/index.d.cts +25 -21
  311. package/node_modules/prosemirror-model/dist/index.d.ts +25 -21
  312. package/node_modules/prosemirror-model/dist/index.js +19 -23
  313. package/node_modules/prosemirror-model/package.json +2 -2
  314. package/node_modules/prosemirror-model/src/fragment.ts +1 -1
  315. package/node_modules/prosemirror-model/src/from_dom.ts +4 -1
  316. package/node_modules/prosemirror-model/src/node.ts +5 -4
  317. package/node_modules/prosemirror-model/src/replace.ts +6 -15
  318. package/node_modules/prosemirror-model/src/schema.ts +1 -1
  319. package/node_modules/prosemirror-model/src/to_dom.ts +24 -20
  320. package/node_modules/prosemirror-transform/CHANGELOG.md +16 -0
  321. package/node_modules/prosemirror-transform/dist/index.cjs +38 -4
  322. package/node_modules/prosemirror-transform/dist/index.d.cts +19 -0
  323. package/node_modules/prosemirror-transform/dist/index.d.ts +19 -0
  324. package/node_modules/prosemirror-transform/dist/index.js +52 -1
  325. package/node_modules/prosemirror-transform/package.json +1 -1
  326. package/node_modules/prosemirror-transform/src/replace.ts +16 -0
  327. package/node_modules/prosemirror-transform/src/replace_step.ts +10 -1
  328. package/node_modules/prosemirror-transform/src/transform.ts +21 -2
  329. package/node_modules/prosemirror-view/CHANGELOG.md +34 -2
  330. package/node_modules/prosemirror-view/CONTRIBUTING.md +19 -19
  331. package/node_modules/prosemirror-view/README.md +3 -3
  332. package/node_modules/prosemirror-view/dist/index.cjs +96 -40
  333. package/node_modules/prosemirror-view/dist/index.d.cts +2 -2
  334. package/node_modules/prosemirror-view/dist/index.d.ts +2 -2
  335. package/node_modules/prosemirror-view/dist/index.js +90 -39
  336. package/node_modules/prosemirror-view/package.json +2 -2
  337. package/node_modules/prosemirror-view/src/domchange.ts +1 -1
  338. package/node_modules/prosemirror-view/src/domobserver.ts +59 -16
  339. package/node_modules/prosemirror-view/src/index.ts +4 -4
  340. package/node_modules/prosemirror-view/src/input.ts +9 -6
  341. package/node_modules/prosemirror-view/src/viewdesc.ts +26 -22
  342. package/node_modules/prosemirror-view/style/prosemirror.css +1 -1
  343. package/package.json +5 -4
  344. package/src/client.mjs +2 -2
  345. package/src/config.mjs +1 -0
  346. package/src/helpers.mjs +2 -2
  347. package/src/index.mjs +31 -1
  348. package/src/initCodex.mjs +281 -0
  349. package/src/mcp.mjs +11 -1
  350. package/src/mcpShared.mjs +95 -5
  351. package/node_modules/@hcengineering/account-client/types/client.d.ts +0 -140
  352. package/node_modules/@hcengineering/account-client/types/client.d.ts.map +0 -1
  353. package/node_modules/@hcengineering/account-client/types/index.d.ts +0 -4
  354. package/node_modules/@hcengineering/account-client/types/index.d.ts.map +0 -1
  355. package/node_modules/@hcengineering/account-client/types/types.d.ts +0 -177
  356. package/node_modules/@hcengineering/account-client/types/types.d.ts.map +0 -1
  357. package/node_modules/@hcengineering/account-client/types/utils.d.ts +0 -5
  358. package/node_modules/@hcengineering/account-client/types/utils.d.ts.map +0 -1
  359. package/node_modules/@hcengineering/analytics/types/index.d.ts +0 -25
  360. package/node_modules/@hcengineering/analytics/types/index.d.ts.map +0 -1
  361. package/node_modules/@hcengineering/api-client/types/__tests__/config.test.d.ts +0 -2
  362. package/node_modules/@hcengineering/api-client/types/__tests__/config.test.d.ts.map +0 -1
  363. package/node_modules/@hcengineering/api-client/types/__tests__/markup-client.test.d.ts +0 -2
  364. package/node_modules/@hcengineering/api-client/types/__tests__/markup-client.test.d.ts.map +0 -1
  365. package/node_modules/@hcengineering/api-client/types/__tests__/markup-types.test.d.ts +0 -2
  366. package/node_modules/@hcengineering/api-client/types/__tests__/markup-types.test.d.ts.map +0 -1
  367. package/node_modules/@hcengineering/api-client/types/__tests__/rest-utils.test.d.ts +0 -2
  368. package/node_modules/@hcengineering/api-client/types/__tests__/rest-utils.test.d.ts.map +0 -1
  369. package/node_modules/@hcengineering/api-client/types/__tests__/utils.test.d.ts +0 -2
  370. package/node_modules/@hcengineering/api-client/types/__tests__/utils.test.d.ts.map +0 -1
  371. package/node_modules/@hcengineering/api-client/types/client.d.ts +0 -6
  372. package/node_modules/@hcengineering/api-client/types/client.d.ts.map +0 -1
  373. package/node_modules/@hcengineering/api-client/types/config.d.ts +0 -8
  374. package/node_modules/@hcengineering/api-client/types/config.d.ts.map +0 -1
  375. package/node_modules/@hcengineering/api-client/types/index.d.ts +0 -9
  376. package/node_modules/@hcengineering/api-client/types/index.d.ts.map +0 -1
  377. package/node_modules/@hcengineering/api-client/types/markup/client.d.ts +0 -5
  378. package/node_modules/@hcengineering/api-client/types/markup/client.d.ts.map +0 -1
  379. package/node_modules/@hcengineering/api-client/types/markup/index.d.ts +0 -3
  380. package/node_modules/@hcengineering/api-client/types/markup/index.d.ts.map +0 -1
  381. package/node_modules/@hcengineering/api-client/types/markup/types.d.ts +0 -41
  382. package/node_modules/@hcengineering/api-client/types/markup/types.d.ts.map +0 -1
  383. package/node_modules/@hcengineering/api-client/types/rest/index.d.ts +0 -4
  384. package/node_modules/@hcengineering/api-client/types/rest/index.d.ts.map +0 -1
  385. package/node_modules/@hcengineering/api-client/types/rest/rest.d.ts +0 -39
  386. package/node_modules/@hcengineering/api-client/types/rest/rest.d.ts.map +0 -1
  387. package/node_modules/@hcengineering/api-client/types/rest/tx.d.ts +0 -3
  388. package/node_modules/@hcengineering/api-client/types/rest/tx.d.ts.map +0 -1
  389. package/node_modules/@hcengineering/api-client/types/rest/types.d.ts +0 -16
  390. package/node_modules/@hcengineering/api-client/types/rest/types.d.ts.map +0 -1
  391. package/node_modules/@hcengineering/api-client/types/rest/utils.d.ts +0 -3
  392. package/node_modules/@hcengineering/api-client/types/rest/utils.d.ts.map +0 -1
  393. package/node_modules/@hcengineering/api-client/types/socket/browser.d.ts +0 -4
  394. package/node_modules/@hcengineering/api-client/types/socket/browser.d.ts.map +0 -1
  395. package/node_modules/@hcengineering/api-client/types/socket/index.d.ts +0 -3
  396. package/node_modules/@hcengineering/api-client/types/socket/index.d.ts.map +0 -1
  397. package/node_modules/@hcengineering/api-client/types/socket/node.d.ts +0 -4
  398. package/node_modules/@hcengineering/api-client/types/socket/node.d.ts.map +0 -1
  399. package/node_modules/@hcengineering/api-client/types/storage/client.d.ts +0 -21
  400. package/node_modules/@hcengineering/api-client/types/storage/client.d.ts.map +0 -1
  401. package/node_modules/@hcengineering/api-client/types/storage/error.d.ts +0 -10
  402. package/node_modules/@hcengineering/api-client/types/storage/error.d.ts.map +0 -1
  403. package/node_modules/@hcengineering/api-client/types/storage/index.d.ts +0 -4
  404. package/node_modules/@hcengineering/api-client/types/storage/index.d.ts.map +0 -1
  405. package/node_modules/@hcengineering/api-client/types/storage/types.d.ts +0 -10
  406. package/node_modules/@hcengineering/api-client/types/storage/types.d.ts.map +0 -1
  407. package/node_modules/@hcengineering/api-client/types/types.d.ts +0 -101
  408. package/node_modules/@hcengineering/api-client/types/types.d.ts.map +0 -1
  409. package/node_modules/@hcengineering/api-client/types/utils.d.ts +0 -12
  410. package/node_modules/@hcengineering/api-client/types/utils.d.ts.map +0 -1
  411. package/node_modules/@hcengineering/chunter/types/analytics.d.ts +0 -5
  412. package/node_modules/@hcengineering/chunter/types/analytics.d.ts.map +0 -1
  413. package/node_modules/@hcengineering/chunter/types/index.d.ts +0 -211
  414. package/node_modules/@hcengineering/chunter/types/index.d.ts.map +0 -1
  415. package/node_modules/@hcengineering/chunter/types/utils.d.ts +0 -7
  416. package/node_modules/@hcengineering/chunter/types/utils.d.ts.map +0 -1
  417. package/node_modules/@hcengineering/client/types/__tests__/client.test.d.ts +0 -2
  418. package/node_modules/@hcengineering/client/types/__tests__/client.test.d.ts.map +0 -1
  419. package/node_modules/@hcengineering/client/types/index.d.ts +0 -69
  420. package/node_modules/@hcengineering/client/types/index.d.ts.map +0 -1
  421. package/node_modules/@hcengineering/client-resources/types/__tests__/connection.test.d.ts +0 -2
  422. package/node_modules/@hcengineering/client-resources/types/__tests__/connection.test.d.ts.map +0 -1
  423. package/node_modules/@hcengineering/client-resources/types/__tests__/integration.test.d.ts +0 -45
  424. package/node_modules/@hcengineering/client-resources/types/__tests__/integration.test.d.ts.map +0 -1
  425. package/node_modules/@hcengineering/client-resources/types/connection.d.ts +0 -7
  426. package/node_modules/@hcengineering/client-resources/types/connection.d.ts.map +0 -1
  427. package/node_modules/@hcengineering/client-resources/types/index.d.ts +0 -11
  428. package/node_modules/@hcengineering/client-resources/types/index.d.ts.map +0 -1
  429. package/node_modules/@hcengineering/collaborator-client/types/__tests__/utils.test.d.ts +0 -2
  430. package/node_modules/@hcengineering/collaborator-client/types/__tests__/utils.test.d.ts.map +0 -1
  431. package/node_modules/@hcengineering/collaborator-client/types/client.d.ts +0 -34
  432. package/node_modules/@hcengineering/collaborator-client/types/client.d.ts.map +0 -1
  433. package/node_modules/@hcengineering/collaborator-client/types/index.d.ts +0 -3
  434. package/node_modules/@hcengineering/collaborator-client/types/index.d.ts.map +0 -1
  435. package/node_modules/@hcengineering/collaborator-client/types/utils.d.ts +0 -9
  436. package/node_modules/@hcengineering/collaborator-client/types/utils.d.ts.map +0 -1
  437. package/node_modules/@hcengineering/contact/types/__tests__/cache.test.d.ts +0 -2
  438. package/node_modules/@hcengineering/contact/types/__tests__/cache.test.d.ts.map +0 -1
  439. package/node_modules/@hcengineering/contact/types/analytics.d.ts +0 -6
  440. package/node_modules/@hcengineering/contact/types/analytics.d.ts.map +0 -1
  441. package/node_modules/@hcengineering/contact/types/avatar.d.ts +0 -12
  442. package/node_modules/@hcengineering/contact/types/avatar.d.ts.map +0 -1
  443. package/node_modules/@hcengineering/contact/types/cache.d.ts +0 -49
  444. package/node_modules/@hcengineering/contact/types/cache.d.ts.map +0 -1
  445. package/node_modules/@hcengineering/contact/types/index.d.ts +0 -367
  446. package/node_modules/@hcengineering/contact/types/index.d.ts.map +0 -1
  447. package/node_modules/@hcengineering/contact/types/types.d.ts +0 -25
  448. package/node_modules/@hcengineering/contact/types/types.d.ts.map +0 -1
  449. package/node_modules/@hcengineering/contact/types/utils.d.ts +0 -110
  450. package/node_modules/@hcengineering/contact/types/utils.d.ts.map +0 -1
  451. package/node_modules/@hcengineering/core/types/__tests__/client.test.d.ts +0 -2
  452. package/node_modules/@hcengineering/core/types/__tests__/client.test.d.ts.map +0 -1
  453. package/node_modules/@hcengineering/core/types/__tests__/clone.test.d.ts +0 -2
  454. package/node_modules/@hcengineering/core/types/__tests__/clone.test.d.ts.map +0 -1
  455. package/node_modules/@hcengineering/core/types/__tests__/collaboration.test.d.ts +0 -2
  456. package/node_modules/@hcengineering/core/types/__tests__/collaboration.test.d.ts.map +0 -1
  457. package/node_modules/@hcengineering/core/types/__tests__/collaborators.test.d.ts +0 -2
  458. package/node_modules/@hcengineering/core/types/__tests__/collaborators.test.d.ts.map +0 -1
  459. package/node_modules/@hcengineering/core/types/__tests__/common.test.d.ts +0 -2
  460. package/node_modules/@hcengineering/core/types/__tests__/common.test.d.ts.map +0 -1
  461. package/node_modules/@hcengineering/core/types/__tests__/connection.d.ts +0 -4
  462. package/node_modules/@hcengineering/core/types/__tests__/connection.d.ts.map +0 -1
  463. package/node_modules/@hcengineering/core/types/__tests__/contexts.test.d.ts +0 -2
  464. package/node_modules/@hcengineering/core/types/__tests__/contexts.test.d.ts.map +0 -1
  465. package/node_modules/@hcengineering/core/types/__tests__/hierarchy.test.d.ts +0 -2
  466. package/node_modules/@hcengineering/core/types/__tests__/hierarchy.test.d.ts.map +0 -1
  467. package/node_modules/@hcengineering/core/types/__tests__/lang.test.d.ts +0 -2
  468. package/node_modules/@hcengineering/core/types/__tests__/lang.test.d.ts.map +0 -1
  469. package/node_modules/@hcengineering/core/types/__tests__/limiter-edge-cases.test.d.ts +0 -2
  470. package/node_modules/@hcengineering/core/types/__tests__/limiter-edge-cases.test.d.ts.map +0 -1
  471. package/node_modules/@hcengineering/core/types/__tests__/limits.test.d.ts +0 -2
  472. package/node_modules/@hcengineering/core/types/__tests__/limits.test.d.ts.map +0 -1
  473. package/node_modules/@hcengineering/core/types/__tests__/memdb.test.d.ts +0 -2
  474. package/node_modules/@hcengineering/core/types/__tests__/memdb.test.d.ts.map +0 -1
  475. package/node_modules/@hcengineering/core/types/__tests__/minmodel.d.ts +0 -50
  476. package/node_modules/@hcengineering/core/types/__tests__/minmodel.d.ts.map +0 -1
  477. package/node_modules/@hcengineering/core/types/__tests__/objvalue.test.d.ts +0 -2
  478. package/node_modules/@hcengineering/core/types/__tests__/objvalue.test.d.ts.map +0 -1
  479. package/node_modules/@hcengineering/core/types/__tests__/operator-bugs.test.d.ts +0 -2
  480. package/node_modules/@hcengineering/core/types/__tests__/operator-bugs.test.d.ts.map +0 -1
  481. package/node_modules/@hcengineering/core/types/__tests__/operator.test.d.ts +0 -2
  482. package/node_modules/@hcengineering/core/types/__tests__/operator.test.d.ts.map +0 -1
  483. package/node_modules/@hcengineering/core/types/__tests__/rate-limiter.test.d.ts +0 -2
  484. package/node_modules/@hcengineering/core/types/__tests__/rate-limiter.test.d.ts.map +0 -1
  485. package/node_modules/@hcengineering/core/types/__tests__/time.test.d.ts +0 -2
  486. package/node_modules/@hcengineering/core/types/__tests__/time.test.d.ts.map +0 -1
  487. package/node_modules/@hcengineering/core/types/__tests__/utils.test.d.ts +0 -2
  488. package/node_modules/@hcengineering/core/types/__tests__/utils.test.d.ts.map +0 -1
  489. package/node_modules/@hcengineering/core/types/backup.d.ts +0 -26
  490. package/node_modules/@hcengineering/core/types/backup.d.ts.map +0 -1
  491. package/node_modules/@hcengineering/core/types/benchmark.d.ts +0 -19
  492. package/node_modules/@hcengineering/core/types/benchmark.d.ts.map +0 -1
  493. package/node_modules/@hcengineering/core/types/classes.d.ts +0 -716
  494. package/node_modules/@hcengineering/core/types/classes.d.ts.map +0 -1
  495. package/node_modules/@hcengineering/core/types/client.d.ts +0 -69
  496. package/node_modules/@hcengineering/core/types/client.d.ts.map +0 -1
  497. package/node_modules/@hcengineering/core/types/clone.d.ts +0 -3
  498. package/node_modules/@hcengineering/core/types/clone.d.ts.map +0 -1
  499. package/node_modules/@hcengineering/core/types/collaboration.d.ts +0 -16
  500. package/node_modules/@hcengineering/core/types/collaboration.d.ts.map +0 -1
  501. package/node_modules/@hcengineering/core/types/collaborators.d.ts +0 -3
  502. package/node_modules/@hcengineering/core/types/collaborators.d.ts.map +0 -1
  503. package/node_modules/@hcengineering/core/types/common.d.ts +0 -4
  504. package/node_modules/@hcengineering/core/types/common.d.ts.map +0 -1
  505. package/node_modules/@hcengineering/core/types/component.d.ts +0 -229
  506. package/node_modules/@hcengineering/core/types/component.d.ts.map +0 -1
  507. package/node_modules/@hcengineering/core/types/hierarchy.d.ts +0 -84
  508. package/node_modules/@hcengineering/core/types/hierarchy.d.ts.map +0 -1
  509. package/node_modules/@hcengineering/core/types/index.d.ts +0 -25
  510. package/node_modules/@hcengineering/core/types/index.d.ts.map +0 -1
  511. package/node_modules/@hcengineering/core/types/memdb.d.ts +0 -60
  512. package/node_modules/@hcengineering/core/types/memdb.d.ts.map +0 -1
  513. package/node_modules/@hcengineering/core/types/objvalue.d.ts +0 -10
  514. package/node_modules/@hcengineering/core/types/objvalue.d.ts.map +0 -1
  515. package/node_modules/@hcengineering/core/types/operations.d.ts +0 -87
  516. package/node_modules/@hcengineering/core/types/operations.d.ts.map +0 -1
  517. package/node_modules/@hcengineering/core/types/operator.d.ts +0 -16
  518. package/node_modules/@hcengineering/core/types/operator.d.ts.map +0 -1
  519. package/node_modules/@hcengineering/core/types/predicate.d.ts +0 -6
  520. package/node_modules/@hcengineering/core/types/predicate.d.ts.map +0 -1
  521. package/node_modules/@hcengineering/core/types/proxy.d.ts +0 -21
  522. package/node_modules/@hcengineering/core/types/proxy.d.ts.map +0 -1
  523. package/node_modules/@hcengineering/core/types/query.d.ts +0 -21
  524. package/node_modules/@hcengineering/core/types/query.d.ts.map +0 -1
  525. package/node_modules/@hcengineering/core/types/server.d.ts +0 -82
  526. package/node_modules/@hcengineering/core/types/server.d.ts.map +0 -1
  527. package/node_modules/@hcengineering/core/types/status.d.ts +0 -30
  528. package/node_modules/@hcengineering/core/types/status.d.ts.map +0 -1
  529. package/node_modules/@hcengineering/core/types/storage.d.ts +0 -233
  530. package/node_modules/@hcengineering/core/types/storage.d.ts.map +0 -1
  531. package/node_modules/@hcengineering/core/types/time.d.ts +0 -8
  532. package/node_modules/@hcengineering/core/types/time.d.ts.map +0 -1
  533. package/node_modules/@hcengineering/core/types/tx.d.ts +0 -261
  534. package/node_modules/@hcengineering/core/types/tx.d.ts.map +0 -1
  535. package/node_modules/@hcengineering/core/types/utils.d.ts +0 -207
  536. package/node_modules/@hcengineering/core/types/utils.d.ts.map +0 -1
  537. package/node_modules/@hcengineering/measurements/types/__tests__/context.test.d.ts +0 -2
  538. package/node_modules/@hcengineering/measurements/types/__tests__/context.test.d.ts.map +0 -1
  539. package/node_modules/@hcengineering/measurements/types/__tests__/index.test.d.ts +0 -2
  540. package/node_modules/@hcengineering/measurements/types/__tests__/index.test.d.ts.map +0 -1
  541. package/node_modules/@hcengineering/measurements/types/__tests__/metrics.test.d.ts +0 -2
  542. package/node_modules/@hcengineering/measurements/types/__tests__/metrics.test.d.ts.map +0 -1
  543. package/node_modules/@hcengineering/measurements/types/__tests__/performance.test.d.ts +0 -2
  544. package/node_modules/@hcengineering/measurements/types/__tests__/performance.test.d.ts.map +0 -1
  545. package/node_modules/@hcengineering/measurements/types/context.d.ts +0 -64
  546. package/node_modules/@hcengineering/measurements/types/context.d.ts.map +0 -1
  547. package/node_modules/@hcengineering/measurements/types/index.d.ts +0 -12
  548. package/node_modules/@hcengineering/measurements/types/index.d.ts.map +0 -1
  549. package/node_modules/@hcengineering/measurements/types/metrics.d.ts +0 -34
  550. package/node_modules/@hcengineering/measurements/types/metrics.d.ts.map +0 -1
  551. package/node_modules/@hcengineering/measurements/types/types.d.ts +0 -88
  552. package/node_modules/@hcengineering/measurements/types/types.d.ts.map +0 -1
  553. package/node_modules/@hcengineering/platform/types/__tests__/i18n.test.d.ts +0 -2
  554. package/node_modules/@hcengineering/platform/types/__tests__/i18n.test.d.ts.map +0 -1
  555. package/node_modules/@hcengineering/platform/types/__tests__/ident.test.d.ts +0 -2
  556. package/node_modules/@hcengineering/platform/types/__tests__/ident.test.d.ts.map +0 -1
  557. package/node_modules/@hcengineering/platform/types/__tests__/plugin.d.ts +0 -7
  558. package/node_modules/@hcengineering/platform/types/__tests__/plugin.d.ts.map +0 -1
  559. package/node_modules/@hcengineering/platform/types/__tests__/resource.test.d.ts +0 -2
  560. package/node_modules/@hcengineering/platform/types/__tests__/resource.test.d.ts.map +0 -1
  561. package/node_modules/@hcengineering/platform/types/event.d.ts +0 -39
  562. package/node_modules/@hcengineering/platform/types/event.d.ts.map +0 -1
  563. package/node_modules/@hcengineering/platform/types/i18n.d.ts +0 -28
  564. package/node_modules/@hcengineering/platform/types/i18n.d.ts.map +0 -1
  565. package/node_modules/@hcengineering/platform/types/ident.d.ts +0 -14
  566. package/node_modules/@hcengineering/platform/types/ident.d.ts.map +0 -1
  567. package/node_modules/@hcengineering/platform/types/index.d.ts +0 -19
  568. package/node_modules/@hcengineering/platform/types/index.d.ts.map +0 -1
  569. package/node_modules/@hcengineering/platform/types/metadata.d.ts +0 -38
  570. package/node_modules/@hcengineering/platform/types/metadata.d.ts.map +0 -1
  571. package/node_modules/@hcengineering/platform/types/platform.d.ts +0 -218
  572. package/node_modules/@hcengineering/platform/types/platform.d.ts.map +0 -1
  573. package/node_modules/@hcengineering/platform/types/resource.d.ts +0 -49
  574. package/node_modules/@hcengineering/platform/types/resource.d.ts.map +0 -1
  575. package/node_modules/@hcengineering/platform/types/status.d.ts +0 -60
  576. package/node_modules/@hcengineering/platform/types/status.d.ts.map +0 -1
  577. package/node_modules/@hcengineering/platform/types/testUtils.d.ts +0 -8
  578. package/node_modules/@hcengineering/platform/types/testUtils.d.ts.map +0 -1
  579. package/node_modules/@hcengineering/rank/types/__tests__/utils.test.d.ts +0 -2
  580. package/node_modules/@hcengineering/rank/types/__tests__/utils.test.d.ts.map +0 -1
  581. package/node_modules/@hcengineering/rank/types/index.d.ts +0 -3
  582. package/node_modules/@hcengineering/rank/types/index.d.ts.map +0 -1
  583. package/node_modules/@hcengineering/rank/types/types.d.ts +0 -2
  584. package/node_modules/@hcengineering/rank/types/types.d.ts.map +0 -1
  585. package/node_modules/@hcengineering/rank/types/utils.d.ts +0 -6
  586. package/node_modules/@hcengineering/rank/types/utils.d.ts.map +0 -1
  587. package/node_modules/@hcengineering/rpc/types/index.d.ts +0 -3
  588. package/node_modules/@hcengineering/rpc/types/index.d.ts.map +0 -1
  589. package/node_modules/@hcengineering/rpc/types/rpc.d.ts +0 -96
  590. package/node_modules/@hcengineering/rpc/types/rpc.d.ts.map +0 -1
  591. package/node_modules/@hcengineering/rpc/types/sliding.d.ts +0 -11
  592. package/node_modules/@hcengineering/rpc/types/sliding.d.ts.map +0 -1
  593. package/node_modules/@hcengineering/rpc/types/test/rateLimit.spec.d.ts +0 -2
  594. package/node_modules/@hcengineering/rpc/types/test/rateLimit.spec.d.ts.map +0 -1
  595. package/node_modules/@hcengineering/tags/types/analytics.d.ts +0 -5
  596. package/node_modules/@hcengineering/tags/types/analytics.d.ts.map +0 -1
  597. package/node_modules/@hcengineering/tags/types/index.d.ts +0 -105
  598. package/node_modules/@hcengineering/tags/types/index.d.ts.map +0 -1
  599. package/node_modules/@hcengineering/task/types/index.d.ts +0 -227
  600. package/node_modules/@hcengineering/task/types/index.d.ts.map +0 -1
  601. package/node_modules/@hcengineering/task/types/utils.d.ts +0 -61
  602. package/node_modules/@hcengineering/task/types/utils.d.ts.map +0 -1
  603. package/node_modules/@hcengineering/text/types/extensions.d.ts +0 -53
  604. package/node_modules/@hcengineering/text/types/extensions.d.ts.map +0 -1
  605. package/node_modules/@hcengineering/text/types/index.d.ts +0 -13
  606. package/node_modules/@hcengineering/text/types/index.d.ts.map +0 -1
  607. package/node_modules/@hcengineering/text/types/kit.d.ts +0 -12
  608. package/node_modules/@hcengineering/text/types/kit.d.ts.map +0 -1
  609. package/node_modules/@hcengineering/text/types/kits/common-kit.d.ts +0 -72
  610. package/node_modules/@hcengineering/text/types/kits/common-kit.d.ts.map +0 -1
  611. package/node_modules/@hcengineering/text/types/kits/server-kit.d.ts +0 -106
  612. package/node_modules/@hcengineering/text/types/kits/server-kit.d.ts.map +0 -1
  613. package/node_modules/@hcengineering/text/types/marks/code.d.ts +0 -8
  614. package/node_modules/@hcengineering/text/types/marks/code.d.ts.map +0 -1
  615. package/node_modules/@hcengineering/text/types/marks/colors.d.ts +0 -21
  616. package/node_modules/@hcengineering/text/types/marks/colors.d.ts.map +0 -1
  617. package/node_modules/@hcengineering/text/types/marks/inlineComment.d.ts +0 -5
  618. package/node_modules/@hcengineering/text/types/marks/inlineComment.d.ts.map +0 -1
  619. package/node_modules/@hcengineering/text/types/marks/noteBase.d.ts +0 -23
  620. package/node_modules/@hcengineering/text/types/marks/noteBase.d.ts.map +0 -1
  621. package/node_modules/@hcengineering/text/types/marks/qmsInlineCommentMark.d.ts +0 -6
  622. package/node_modules/@hcengineering/text/types/marks/qmsInlineCommentMark.d.ts.map +0 -1
  623. package/node_modules/@hcengineering/text/types/markup/__tests__/dsl.test.d.ts +0 -2
  624. package/node_modules/@hcengineering/text/types/markup/__tests__/dsl.test.d.ts.map +0 -1
  625. package/node_modules/@hcengineering/text/types/markup/__tests__/utils.test.d.ts +0 -5
  626. package/node_modules/@hcengineering/text/types/markup/__tests__/utils.test.d.ts.map +0 -1
  627. package/node_modules/@hcengineering/text/types/markup/utils.d.ts +0 -19
  628. package/node_modules/@hcengineering/text/types/markup/utils.d.ts.map +0 -1
  629. package/node_modules/@hcengineering/text/types/nodes/codeblock.d.ts +0 -12
  630. package/node_modules/@hcengineering/text/types/nodes/codeblock.d.ts.map +0 -1
  631. package/node_modules/@hcengineering/text/types/nodes/comment.d.ts +0 -6
  632. package/node_modules/@hcengineering/text/types/nodes/comment.d.ts.map +0 -1
  633. package/node_modules/@hcengineering/text/types/nodes/embed.d.ts +0 -3
  634. package/node_modules/@hcengineering/text/types/nodes/embed.d.ts.map +0 -1
  635. package/node_modules/@hcengineering/text/types/nodes/emoji.d.ts +0 -17
  636. package/node_modules/@hcengineering/text/types/nodes/emoji.d.ts.map +0 -1
  637. package/node_modules/@hcengineering/text/types/nodes/file.d.ts +0 -13
  638. package/node_modules/@hcengineering/text/types/nodes/file.d.ts.map +0 -1
  639. package/node_modules/@hcengineering/text/types/nodes/image.d.ts +0 -52
  640. package/node_modules/@hcengineering/text/types/nodes/image.d.ts.map +0 -1
  641. package/node_modules/@hcengineering/text/types/nodes/index.d.ts +0 -11
  642. package/node_modules/@hcengineering/text/types/nodes/index.d.ts.map +0 -1
  643. package/node_modules/@hcengineering/text/types/nodes/markdown.d.ts +0 -3
  644. package/node_modules/@hcengineering/text/types/nodes/markdown.d.ts.map +0 -1
  645. package/node_modules/@hcengineering/text/types/nodes/mermaid.d.ts +0 -4
  646. package/node_modules/@hcengineering/text/types/nodes/mermaid.d.ts.map +0 -1
  647. package/node_modules/@hcengineering/text/types/nodes/reference.d.ts +0 -18
  648. package/node_modules/@hcengineering/text/types/nodes/reference.d.ts.map +0 -1
  649. package/node_modules/@hcengineering/text/types/nodes/todo.d.ts +0 -3
  650. package/node_modules/@hcengineering/text/types/nodes/todo.d.ts.map +0 -1
  651. package/node_modules/@hcengineering/text/types/nodes/utils.d.ts +0 -6
  652. package/node_modules/@hcengineering/text/types/nodes/utils.d.ts.map +0 -1
  653. package/node_modules/@hcengineering/text/types/tiptapExtensions.d.ts +0 -28
  654. package/node_modules/@hcengineering/text/types/tiptapExtensions.d.ts.map +0 -1
  655. package/node_modules/@hcengineering/text-core/types/index.d.ts +0 -6
  656. package/node_modules/@hcengineering/text-core/types/index.d.ts.map +0 -1
  657. package/node_modules/@hcengineering/text-core/types/markup/__tests__/traverse.test.d.ts +0 -2
  658. package/node_modules/@hcengineering/text-core/types/markup/__tests__/traverse.test.d.ts.map +0 -1
  659. package/node_modules/@hcengineering/text-core/types/markup/__tests__/utils.test.d.ts +0 -2
  660. package/node_modules/@hcengineering/text-core/types/markup/__tests__/utils.test.d.ts.map +0 -1
  661. package/node_modules/@hcengineering/text-core/types/markup/dsl.d.ts +0 -25
  662. package/node_modules/@hcengineering/text-core/types/markup/dsl.d.ts.map +0 -1
  663. package/node_modules/@hcengineering/text-core/types/markup/model.d.ts +0 -74
  664. package/node_modules/@hcengineering/text-core/types/markup/model.d.ts.map +0 -1
  665. package/node_modules/@hcengineering/text-core/types/markup/reference.d.ts +0 -15
  666. package/node_modules/@hcengineering/text-core/types/markup/reference.d.ts.map +0 -1
  667. package/node_modules/@hcengineering/text-core/types/markup/traverse.d.ts +0 -6
  668. package/node_modules/@hcengineering/text-core/types/markup/traverse.d.ts.map +0 -1
  669. package/node_modules/@hcengineering/text-core/types/markup/utils.d.ts +0 -25
  670. package/node_modules/@hcengineering/text-core/types/markup/utils.d.ts.map +0 -1
  671. package/node_modules/@hcengineering/text-html/types/__tests__/html.test.d.ts +0 -2
  672. package/node_modules/@hcengineering/text-html/types/__tests__/html.test.d.ts.map +0 -1
  673. package/node_modules/@hcengineering/text-html/types/index.d.ts +0 -6
  674. package/node_modules/@hcengineering/text-html/types/index.d.ts.map +0 -1
  675. package/node_modules/@hcengineering/text-html/types/parser.d.ts +0 -10
  676. package/node_modules/@hcengineering/text-html/types/parser.d.ts.map +0 -1
  677. package/node_modules/@hcengineering/text-html/types/serializer.d.ts +0 -9
  678. package/node_modules/@hcengineering/text-html/types/serializer.d.ts.map +0 -1
  679. package/node_modules/@hcengineering/text-markdown/types/__tests__/markdown.test.d.ts +0 -9
  680. package/node_modules/@hcengineering/text-markdown/types/__tests__/markdown.test.d.ts.map +0 -1
  681. package/node_modules/@hcengineering/text-markdown/types/compare.d.ts +0 -10
  682. package/node_modules/@hcengineering/text-markdown/types/compare.d.ts.map +0 -1
  683. package/node_modules/@hcengineering/text-markdown/types/index.d.ts +0 -14
  684. package/node_modules/@hcengineering/text-markdown/types/index.d.ts.map +0 -1
  685. package/node_modules/@hcengineering/text-markdown/types/marks.d.ts +0 -8
  686. package/node_modules/@hcengineering/text-markdown/types/marks.d.ts.map +0 -1
  687. package/node_modules/@hcengineering/text-markdown/types/node.d.ts +0 -4
  688. package/node_modules/@hcengineering/text-markdown/types/node.d.ts.map +0 -1
  689. package/node_modules/@hcengineering/text-markdown/types/parser.d.ts +0 -50
  690. package/node_modules/@hcengineering/text-markdown/types/parser.d.ts.map +0 -1
  691. package/node_modules/@hcengineering/text-markdown/types/serializer.d.ts +0 -102
  692. package/node_modules/@hcengineering/text-markdown/types/serializer.d.ts.map +0 -1
  693. package/node_modules/@hcengineering/tracker/types/analytics.d.ts +0 -24
  694. package/node_modules/@hcengineering/tracker/types/analytics.d.ts.map +0 -1
  695. package/node_modules/@hcengineering/tracker/types/index.d.ts +0 -431
  696. package/node_modules/@hcengineering/tracker/types/index.d.ts.map +0 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hcengineering/analytics",
3
- "version": "0.7.17",
3
+ "version": "0.7.423",
4
4
  "main": "lib/index.js",
5
5
  "svelte": "src/index.ts",
6
6
  "types": "types/index.d.ts",
@@ -13,8 +13,18 @@
13
13
  ],
14
14
  "author": "Anticrm Platform Contributors",
15
15
  "license": "EPL-2.0",
16
+ "scripts": {
17
+ "build": "compile",
18
+ "build:watch": "compile",
19
+ "test": "jest --passWithNoTests --silent --coverage",
20
+ "format": "format src",
21
+ "_phase:build": "compile transpile src",
22
+ "_phase:test": "jest --passWithNoTests --silent --coverage",
23
+ "_phase:format": "format src",
24
+ "_phase:validate": "compile validate"
25
+ },
16
26
  "devDependencies": {
17
- "@hcengineering/platform-rig": "^0.7.19",
27
+ "@hcengineering/platform-rig": "^0.7.423",
18
28
  "@typescript-eslint/eslint-plugin": "^6.21.0",
19
29
  "eslint-plugin-import": "^2.26.0",
20
30
  "eslint-plugin-promise": "^6.1.1",
@@ -22,7 +32,7 @@
22
32
  "eslint": "^8.54.0",
23
33
  "@typescript-eslint/parser": "^6.21.0",
24
34
  "eslint-config-standard-with-typescript": "^40.0.0",
25
- "prettier": "^3.1.0",
35
+ "prettier": "^3.6.2",
26
36
  "typescript": "^5.9.3",
27
37
  "jest": "^29.7.0",
28
38
  "ts-jest": "^29.1.1",
@@ -30,9 +40,12 @@
30
40
  "eslint-plugin-svelte": "^2.35.1"
31
41
  },
32
42
  "dependencies": {
33
- "@hcengineering/platform": "^0.7.17"
43
+ "@hcengineering/platform": "^0.7.423"
44
+ },
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/hcengineering/huly.core.git"
34
48
  },
35
- "repository": "https://github.com/hcengineering/huly.core",
36
49
  "publishConfig": {
37
50
  "access": "public"
38
51
  },
@@ -42,15 +55,5 @@
42
55
  "require": "./lib/index.js",
43
56
  "import": "./lib/index.js"
44
57
  }
45
- },
46
- "scripts": {
47
- "build": "compile",
48
- "build:watch": "compile",
49
- "test": "jest --passWithNoTests --silent --coverage",
50
- "format": "format src",
51
- "_phase:build": "compile transpile src",
52
- "_phase:test": "jest --passWithNoTests --silent --coverage",
53
- "_phase:format": "format src",
54
- "_phase:validate": "compile validate"
55
58
  }
56
- }
59
+ }
@@ -78,7 +78,8 @@ export const Analytics = {
78
78
 
79
79
  addEventListener(PlatformEvent, async (_event, _status: Status) => {
80
80
  if (_status.severity === Severity.ERROR) {
81
- const label = await translate(_status.code, _status.params, 'en')
81
+ // Skip error broadcast in translate to avoid infinite loop
82
+ const label = await translate(_status.code, _status.params, 'en', true)
82
83
  Analytics.handleError(new Error(label))
83
84
  }
84
85
  })
@@ -59,10 +59,15 @@ async function connect(url, options) {
59
59
  }
60
60
  __name(connect, "connect");
61
61
  async function createClient(url, endpoint, token, workspaceUuid, account, config, options) {
62
- (0, import_platform.addLocation)(import_client.clientId, () => import(
63
- /* webpackChunkName: "client" */
64
- "@hcengineering/client-resources"
65
- ));
62
+ (0, import_platform.addLocation)(import_client.clientId, () => {
63
+ if (typeof window === "undefined") {
64
+ return Promise.resolve(require("@hcengineering/client-resources"));
65
+ }
66
+ return import(
67
+ /* webpackChunkName: "client" */
68
+ "@hcengineering/client-resources"
69
+ );
70
+ });
66
71
  const { socketFactory, connectionTimeout } = options;
67
72
  const clientFactory = await (0, import_platform.getResource)(import_client.default.function.GetClient);
68
73
  const connection = await clientFactory(token, endpoint, {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/client.ts"],
4
- "sourcesContent": ["//\n// Copyright \u00A9 2024 Hardcore Engineering Inc.\n//\n// Licensed under the Eclipse Public License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License. You may\n// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\nimport { getClient as getAccountClient } from '@hcengineering/account-client'\nimport client, { clientId } from '@hcengineering/client'\nimport {\n type Account,\n type Class,\n type Client,\n type Data,\n type Doc,\n type DocumentQuery,\n type FindOptions,\n type FindResult,\n type Hierarchy,\n type ModelDb,\n type Ref,\n type Space,\n type TxResult,\n type WithLookup,\n AttachedData,\n AttachedDoc,\n DocumentUpdate,\n Mixin,\n MixinData,\n MixinUpdate,\n TxOperations,\n WorkspaceUuid,\n generateId,\n pickPrimarySocialId\n} from '@hcengineering/core'\nimport { addLocation, getResource } from '@hcengineering/platform'\n\nimport { type ServerConfig, loadServerConfig } from './config'\nimport {\n type MarkupFormat,\n type MarkupOperations,\n type MarkupRef,\n MarkupContent,\n createMarkupOperations\n} from './markup'\nimport { type ConnectOptions, type PlatformClient, WithMarkup } from './types'\nimport { getWorkspaceToken } from './utils'\n\n/**\n * Create platform client\n * @public */\nexport async function connect (url: string, options: ConnectOptions): Promise<PlatformClient> {\n const config = await loadServerConfig(url)\n\n const { endpoint, token } = await getWorkspaceToken(url, options, config)\n const accountClient = getAccountClient(config.ACCOUNTS_URL, token)\n const socialIds = await accountClient.getSocialIds(true)\n const wsLoginInfo = await accountClient.selectWorkspace(options.workspace)\n\n if (wsLoginInfo === undefined) {\n throw new Error(`Workspace ${options.workspace} not found`)\n }\n\n const account: Account = {\n uuid: wsLoginInfo.account,\n role: wsLoginInfo.role,\n primarySocialId: pickPrimarySocialId(socialIds)._id,\n socialIds: socialIds.map((si) => si._id),\n fullSocialIds: socialIds\n }\n\n return await createClient(url, endpoint, token, wsLoginInfo.workspace, account, config, options)\n}\n\nasync function createClient (\n url: string,\n endpoint: string,\n token: string,\n workspaceUuid: WorkspaceUuid,\n account: Account,\n config: ServerConfig,\n options: ConnectOptions\n): Promise<PlatformClient> {\n addLocation(clientId, () => import(/* webpackChunkName: \"client\" */ '@hcengineering/client-resources'))\n\n const { socketFactory, connectionTimeout } = options\n\n const clientFactory = await getResource(client.function.GetClient)\n const connection = await clientFactory(token, endpoint, {\n socketFactory,\n connectionTimeout\n })\n\n return new PlatformClientImpl(url, workspaceUuid, token, config, connection, account)\n}\n\nclass PlatformClientImpl implements PlatformClient {\n private readonly client: TxOperations\n private readonly markup: MarkupOperations\n\n constructor (\n private readonly url: string,\n private readonly workspace: WorkspaceUuid,\n private readonly token: string,\n private readonly config: ServerConfig,\n private readonly connection: Client,\n private readonly account: Account\n ) {\n this.client = new TxOperations(connection, account.primarySocialId)\n this.markup = createMarkupOperations(url, workspace, token, config)\n }\n\n // Client\n\n getHierarchy (): Hierarchy {\n return this.client.getHierarchy()\n }\n\n getModel (): ModelDb {\n return this.client.getModel()\n }\n\n async getAccount (): Promise<Account> {\n return this.account\n }\n\n async findOne<T extends Doc>(\n _class: Ref<Class<T>>,\n query: DocumentQuery<T>,\n options?: FindOptions<T>\n ): Promise<WithLookup<T> | undefined> {\n return await this.client.findOne(_class, query, options)\n }\n\n async findAll<T extends Doc>(\n _class: Ref<Class<T>>,\n query: DocumentQuery<T>,\n options?: FindOptions<T>\n ): Promise<FindResult<T>> {\n return await this.client.findAll(_class, query, options)\n }\n\n async close (): Promise<void> {\n await this.connection.close()\n }\n\n private async processMarkup<T>(_class: Ref<Class<Doc>>, id: Ref<Doc>, data: WithMarkup<T>): Promise<T> {\n const result: any = {}\n\n for (const [key, value] of Object.entries(data)) {\n if (value instanceof MarkupContent) {\n result[key] = this.markup.uploadMarkup(_class, id, key, value.content, value.kind)\n } else {\n result[key] = value\n }\n }\n\n return result as T\n }\n\n // DocOperations\n\n async createDoc<T extends Doc>(\n _class: Ref<Class<T>>,\n space: Ref<Space>,\n attributes: WithMarkup<Data<T>>,\n id?: Ref<T>\n ): Promise<Ref<T>> {\n id ??= generateId()\n const data = await this.processMarkup<Data<T>>(_class, id, attributes)\n return await this.client.createDoc(_class, space, data, id)\n }\n\n async updateDoc<T extends Doc>(\n _class: Ref<Class<T>>,\n space: Ref<Space>,\n objectId: Ref<T>,\n operations: WithMarkup<DocumentUpdate<T>>,\n retrieve?: boolean\n ): Promise<TxResult> {\n const update = await this.processMarkup<DocumentUpdate<T>>(_class, objectId, operations)\n return await this.client.updateDoc(_class, space, objectId, update, retrieve)\n }\n\n async removeDoc<T extends Doc>(_class: Ref<Class<T>>, space: Ref<Space>, objectId: Ref<T>): Promise<TxResult> {\n return await this.client.removeDoc(_class, space, objectId)\n }\n\n // CollectionOperations\n\n async addCollection<T extends Doc, P extends AttachedDoc>(\n _class: Ref<Class<P>>,\n space: Ref<Space>,\n attachedTo: Ref<T>,\n attachedToClass: Ref<Class<T>>,\n collection: Extract<keyof T, string> | string,\n attributes: WithMarkup<AttachedData<P>>,\n id?: Ref<P>\n ): Promise<Ref<P>> {\n id ??= generateId()\n const data = await this.processMarkup<AttachedData<P>>(_class, id, attributes)\n return await this.client.addCollection(_class, space, attachedTo, attachedToClass, collection, data, id)\n }\n\n async updateCollection<T extends Doc, P extends AttachedDoc>(\n _class: Ref<Class<P>>,\n space: Ref<Space>,\n objectId: Ref<P>,\n attachedTo: Ref<T>,\n attachedToClass: Ref<Class<T>>,\n collection: Extract<keyof T, string> | string,\n operations: WithMarkup<DocumentUpdate<P>>,\n retrieve?: boolean\n ): Promise<Ref<T>> {\n const update = await this.processMarkup<DocumentUpdate<P>>(_class, objectId, operations)\n return await this.client.updateCollection(\n _class,\n space,\n objectId,\n attachedTo,\n attachedToClass,\n collection,\n update,\n retrieve\n )\n }\n\n async removeCollection<T extends Doc, P extends AttachedDoc>(\n _class: Ref<Class<P>>,\n space: Ref<Space>,\n objectId: Ref<P>,\n attachedTo: Ref<T>,\n attachedToClass: Ref<Class<T>>,\n collection: Extract<keyof T, string> | string\n ): Promise<Ref<T>> {\n return await this.client.removeCollection(_class, space, objectId, attachedTo, attachedToClass, collection)\n }\n\n // MixinOperations\n\n async createMixin<D extends Doc, M extends D>(\n objectId: Ref<D>,\n objectClass: Ref<Class<D>>,\n objectSpace: Ref<Space>,\n mixin: Ref<Mixin<M>>,\n attributes: WithMarkup<MixinData<D, M>>\n ): Promise<TxResult> {\n const data = await this.processMarkup<MixinData<D, M>>(objectClass, objectId, attributes)\n return await this.client.createMixin(objectId, objectClass, objectSpace, mixin, data)\n }\n\n async updateMixin<D extends Doc, M extends D>(\n objectId: Ref<D>,\n objectClass: Ref<Class<D>>,\n objectSpace: Ref<Space>,\n mixin: Ref<Mixin<M>>,\n attributes: WithMarkup<MixinUpdate<D, M>>\n ): Promise<TxResult> {\n const update = await this.processMarkup<MixinUpdate<D, M>>(objectClass, objectId, attributes)\n return await this.client.updateMixin(objectId, objectClass, objectSpace, mixin, update)\n }\n\n // Markup\n\n async fetchMarkup (\n objectClass: Ref<Class<Doc>>,\n objectId: Ref<Doc>,\n objectAttr: string,\n markup: MarkupRef,\n format: MarkupFormat\n ): Promise<string> {\n return await this.markup.fetchMarkup(objectClass, objectId, objectAttr, markup, format)\n }\n\n async uploadMarkup (\n objectClass: Ref<Class<Doc>>,\n objectId: Ref<Doc>,\n objectAttr: string,\n markup: string,\n format: MarkupFormat\n ): Promise<MarkupRef> {\n return await this.markup.uploadMarkup(objectClass, objectId, objectAttr, markup, format)\n }\n\n // AsyncDisposable\n\n async [Symbol.asyncDispose] (): Promise<void> {\n await this.close()\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcA,4BAA8C;AAC9C,oBAAiC;AACjC,kBAyBO;AACP,sBAAyC;AAEzC,oBAAoD;AACpD,oBAMO;AAEP,mBAAkC;AAKlC,eAAsB,QAAS,KAAa,SAAkD;AAC5F,QAAM,SAAS,UAAM,gCAAiB,GAAG;AAEzC,QAAM,EAAE,UAAU,MAAM,IAAI,UAAM,gCAAkB,KAAK,SAAS,MAAM;AACxE,QAAM,oBAAgB,sBAAAA,WAAiB,OAAO,cAAc,KAAK;AACjE,QAAM,YAAY,MAAM,cAAc,aAAa,IAAI;AACvD,QAAM,cAAc,MAAM,cAAc,gBAAgB,QAAQ,SAAS;AAEzE,MAAI,gBAAgB,QAAW;AAC7B,UAAM,IAAI,MAAM,aAAa,QAAQ,SAAS,YAAY;AAAA,EAC5D;AAEA,QAAM,UAAmB;AAAA,IACvB,MAAM,YAAY;AAAA,IAClB,MAAM,YAAY;AAAA,IAClB,qBAAiB,iCAAoB,SAAS,EAAE;AAAA,IAChD,WAAW,UAAU,IAAI,CAAC,OAAO,GAAG,GAAG;AAAA,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,MACvB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EAEA,MAAM,iBACJ,QACA,OACA,UACA,YACA,iBACA,YACiB;AACjB,WAAO,MAAM,KAAK,OAAO,iBAAiB,QAAQ,OAAO,UAAU,YAAY,iBAAiB,UAAU;AAAA,EAC5G;AAAA;AAAA,EAIA,MAAM,YACJ,UACA,aACA,aACA,OACA,YACmB;AACnB,UAAM,OAAO,MAAM,KAAK,cAA+B,aAAa,UAAU,UAAU;AACxF,WAAO,MAAM,KAAK,OAAO,YAAY,UAAU,aAAa,aAAa,OAAO,IAAI;AAAA,EACtF;AAAA,EAEA,MAAM,YACJ,UACA,aACA,aACA,OACA,YACmB;AACnB,UAAM,SAAS,MAAM,KAAK,cAAiC,aAAa,UAAU,UAAU;AAC5F,WAAO,MAAM,KAAK,OAAO,YAAY,UAAU,aAAa,aAAa,OAAO,MAAM;AAAA,EACxF;AAAA;AAAA,EAIA,MAAM,YACJ,aACA,UACA,YACA,QACA,QACiB;AACjB,WAAO,MAAM,KAAK,OAAO,YAAY,aAAa,UAAU,YAAY,QAAQ,MAAM;AAAA,EACxF;AAAA,EAEA,MAAM,aACJ,aACA,UACA,YACA,QACA,QACoB;AACpB,WAAO,MAAM,KAAK,OAAO,aAAa,aAAa,UAAU,YAAY,QAAQ,MAAM;AAAA,EACzF;AAAA;AAAA,EAIA,OAAO,OAAO,YAAY,IAAoB;AAC5C,UAAM,KAAK,MAAM;AAAA,EACnB;AACF;",
4
+ "sourcesContent": ["//\n// Copyright \u00A9 2024 Hardcore Engineering Inc.\n//\n// Licensed under the Eclipse Public License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License. You may\n// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\nimport { getClient as getAccountClient } from '@hcengineering/account-client'\nimport client, { clientId } from '@hcengineering/client'\nimport {\n type Account,\n type Class,\n type Client,\n type Data,\n type Doc,\n type DocumentQuery,\n type FindOptions,\n type FindResult,\n type Hierarchy,\n type ModelDb,\n type Ref,\n type Space,\n type TxResult,\n type WithLookup,\n AttachedData,\n AttachedDoc,\n DocumentUpdate,\n Mixin,\n MixinData,\n MixinUpdate,\n TxOperations,\n WorkspaceUuid,\n generateId,\n pickPrimarySocialId\n} from '@hcengineering/core'\nimport { addLocation, getResource } from '@hcengineering/platform'\n\nimport { type ServerConfig, loadServerConfig } from './config'\nimport {\n type MarkupFormat,\n type MarkupOperations,\n type MarkupRef,\n MarkupContent,\n createMarkupOperations\n} from './markup'\nimport { type ConnectOptions, type PlatformClient, WithMarkup } from './types'\nimport { getWorkspaceToken } from './utils'\n\n/**\n * Create platform client\n * @public */\nexport async function connect (url: string, options: ConnectOptions): Promise<PlatformClient> {\n const config = await loadServerConfig(url)\n\n const { endpoint, token } = await getWorkspaceToken(url, options, config)\n const accountClient = getAccountClient(config.ACCOUNTS_URL, token)\n const socialIds = await accountClient.getSocialIds(true)\n const wsLoginInfo = await accountClient.selectWorkspace(options.workspace)\n\n if (wsLoginInfo === undefined) {\n throw new Error(`Workspace ${options.workspace} not found`)\n }\n\n const account: Account = {\n uuid: wsLoginInfo.account,\n role: wsLoginInfo.role,\n primarySocialId: pickPrimarySocialId(socialIds)._id,\n socialIds: socialIds.map((si) => si._id),\n fullSocialIds: socialIds\n }\n\n return await createClient(url, endpoint, token, wsLoginInfo.workspace, account, config, options)\n}\n\nasync function createClient (\n url: string,\n endpoint: string,\n token: string,\n workspaceUuid: WorkspaceUuid,\n account: Account,\n config: ServerConfig,\n options: ConnectOptions\n): Promise<PlatformClient> {\n addLocation(clientId, () => {\n // In Node/Jest environments, dynamic import callbacks can fail without\n // --experimental-vm-modules. Use require there and keep dynamic import\n // for browser/bundler environments.\n if (typeof window === 'undefined') {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n return Promise.resolve(require('@hcengineering/client-resources'))\n }\n return import(/* webpackChunkName: \"client\" */ '@hcengineering/client-resources')\n })\n\n const { socketFactory, connectionTimeout } = options\n\n const clientFactory = await getResource(client.function.GetClient)\n const connection = await clientFactory(token, endpoint, {\n socketFactory,\n connectionTimeout\n })\n\n return new PlatformClientImpl(url, workspaceUuid, token, config, connection, account)\n}\n\nclass PlatformClientImpl implements PlatformClient {\n private readonly client: TxOperations\n private readonly markup: MarkupOperations\n\n constructor (\n private readonly url: string,\n private readonly workspace: WorkspaceUuid,\n private readonly token: string,\n private readonly config: ServerConfig,\n private readonly connection: Client,\n private readonly account: Account\n ) {\n this.client = new TxOperations(connection, account.primarySocialId)\n this.markup = createMarkupOperations(url, workspace, token, config)\n }\n\n // Client\n\n getHierarchy (): Hierarchy {\n return this.client.getHierarchy()\n }\n\n getModel (): ModelDb {\n return this.client.getModel()\n }\n\n async getAccount (): Promise<Account> {\n return this.account\n }\n\n async findOne<T extends Doc>(\n _class: Ref<Class<T>>,\n query: DocumentQuery<T>,\n options?: FindOptions<T>\n ): Promise<WithLookup<T> | undefined> {\n return await this.client.findOne(_class, query, options)\n }\n\n async findAll<T extends Doc>(\n _class: Ref<Class<T>>,\n query: DocumentQuery<T>,\n options?: FindOptions<T>\n ): Promise<FindResult<T>> {\n return await this.client.findAll(_class, query, options)\n }\n\n async close (): Promise<void> {\n await this.connection.close()\n }\n\n private async processMarkup<T>(_class: Ref<Class<Doc>>, id: Ref<Doc>, data: WithMarkup<T>): Promise<T> {\n const result: any = {}\n\n for (const [key, value] of Object.entries(data)) {\n if (value instanceof MarkupContent) {\n result[key] = this.markup.uploadMarkup(_class, id, key, value.content, value.kind)\n } else {\n result[key] = value\n }\n }\n\n return result as T\n }\n\n // DocOperations\n\n async createDoc<T extends Doc>(\n _class: Ref<Class<T>>,\n space: Ref<Space>,\n attributes: WithMarkup<Data<T>>,\n id?: Ref<T>\n ): Promise<Ref<T>> {\n id ??= generateId()\n const data = await this.processMarkup<Data<T>>(_class, id, attributes)\n return await this.client.createDoc(_class, space, data, id)\n }\n\n async updateDoc<T extends Doc>(\n _class: Ref<Class<T>>,\n space: Ref<Space>,\n objectId: Ref<T>,\n operations: WithMarkup<DocumentUpdate<T>>,\n retrieve?: boolean\n ): Promise<TxResult> {\n const update = await this.processMarkup<DocumentUpdate<T>>(_class, objectId, operations)\n return await this.client.updateDoc(_class, space, objectId, update, retrieve)\n }\n\n async removeDoc<T extends Doc>(_class: Ref<Class<T>>, space: Ref<Space>, objectId: Ref<T>): Promise<TxResult> {\n return await this.client.removeDoc(_class, space, objectId)\n }\n\n // CollectionOperations\n\n async addCollection<T extends Doc, P extends AttachedDoc>(\n _class: Ref<Class<P>>,\n space: Ref<Space>,\n attachedTo: Ref<T>,\n attachedToClass: Ref<Class<T>>,\n collection: Extract<keyof T, string> | string,\n attributes: WithMarkup<AttachedData<P>>,\n id?: Ref<P>\n ): Promise<Ref<P>> {\n id ??= generateId()\n const data = await this.processMarkup<AttachedData<P>>(_class, id, attributes)\n return await this.client.addCollection(_class, space, attachedTo, attachedToClass, collection, data, id)\n }\n\n async updateCollection<T extends Doc, P extends AttachedDoc>(\n _class: Ref<Class<P>>,\n space: Ref<Space>,\n objectId: Ref<P>,\n attachedTo: Ref<T>,\n attachedToClass: Ref<Class<T>>,\n collection: Extract<keyof T, string> | string,\n operations: WithMarkup<DocumentUpdate<P>>,\n retrieve?: boolean\n ): Promise<Ref<T>> {\n const update = await this.processMarkup<DocumentUpdate<P>>(_class, objectId, operations)\n return await this.client.updateCollection(\n _class,\n space,\n objectId,\n attachedTo,\n attachedToClass,\n collection,\n update,\n retrieve\n )\n }\n\n async removeCollection<T extends Doc, P extends AttachedDoc>(\n _class: Ref<Class<P>>,\n space: Ref<Space>,\n objectId: Ref<P>,\n attachedTo: Ref<T>,\n attachedToClass: Ref<Class<T>>,\n collection: Extract<keyof T, string> | string\n ): Promise<Ref<T>> {\n return await this.client.removeCollection(_class, space, objectId, attachedTo, attachedToClass, collection)\n }\n\n // MixinOperations\n\n async createMixin<D extends Doc, M extends D>(\n objectId: Ref<D>,\n objectClass: Ref<Class<D>>,\n objectSpace: Ref<Space>,\n mixin: Ref<Mixin<M>>,\n attributes: WithMarkup<MixinData<D, M>>\n ): Promise<TxResult> {\n const data = await this.processMarkup<MixinData<D, M>>(objectClass, objectId, attributes)\n return await this.client.createMixin(objectId, objectClass, objectSpace, mixin, data)\n }\n\n async updateMixin<D extends Doc, M extends D>(\n objectId: Ref<D>,\n objectClass: Ref<Class<D>>,\n objectSpace: Ref<Space>,\n mixin: Ref<Mixin<M>>,\n attributes: WithMarkup<MixinUpdate<D, M>>\n ): Promise<TxResult> {\n const update = await this.processMarkup<MixinUpdate<D, M>>(objectClass, objectId, attributes)\n return await this.client.updateMixin(objectId, objectClass, objectSpace, mixin, update)\n }\n\n // Markup\n\n async fetchMarkup (\n objectClass: Ref<Class<Doc>>,\n objectId: Ref<Doc>,\n objectAttr: string,\n markup: MarkupRef,\n format: MarkupFormat\n ): Promise<string> {\n return await this.markup.fetchMarkup(objectClass, objectId, objectAttr, markup, format)\n }\n\n async uploadMarkup (\n objectClass: Ref<Class<Doc>>,\n objectId: Ref<Doc>,\n objectAttr: string,\n markup: string,\n format: MarkupFormat\n ): Promise<MarkupRef> {\n return await this.markup.uploadMarkup(objectClass, objectId, objectAttr, markup, format)\n }\n\n // AsyncDisposable\n\n async [Symbol.asyncDispose] (): Promise<void> {\n await this.close()\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcA,4BAA8C;AAC9C,oBAAiC;AACjC,kBAyBO;AACP,sBAAyC;AAEzC,oBAAoD;AACpD,oBAMO;AAEP,mBAAkC;AAKlC,eAAsB,QAAS,KAAa,SAAkD;AAC5F,QAAM,SAAS,UAAM,g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;AAAA;AAAA,EAIA,MAAM,YACJ,aACA,UACA,YACA,QACA,QACiB;AACjB,WAAO,MAAM,KAAK,OAAO,YAAY,aAAa,UAAU,YAAY,QAAQ,MAAM;AAAA,EACxF;AAAA,EAEA,MAAM,aACJ,aACA,UACA,YACA,QACA,QACoB;AACpB,WAAO,MAAM,KAAK,OAAO,aAAa,aAAa,UAAU,YAAY,QAAQ,MAAM;AAAA,EACzF;AAAA;AAAA,EAIA,OAAO,OAAO,YAAY,IAAoB;AAC5C,UAAM,KAAK,MAAM;AAAA,EACnB;AACF;",
6
6
  "names": ["getAccountClient", "client"]
7
7
  }
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var adapter_exports = {};
21
+ __export(adapter_exports, {
22
+ RestClientAdapter: () => RestClientAdapter
23
+ });
24
+ module.exports = __toCommonJS(adapter_exports);
25
+ class RestClientAdapter {
26
+ constructor(client, hierarchy, model) {
27
+ this.client = client;
28
+ this.hierarchy = hierarchy;
29
+ this.model = model;
30
+ }
31
+ static {
32
+ __name(this, "RestClientAdapter");
33
+ }
34
+ async domainRequest(domain, params, options) {
35
+ return await this.client.domainRequest(domain, params, options);
36
+ }
37
+ async findAll(_class, query, options) {
38
+ return await this.client.findAll(_class, query, options);
39
+ }
40
+ async tx(tx) {
41
+ return await this.client.tx(tx);
42
+ }
43
+ async findOne(_class, query, options) {
44
+ return await this.client.findOne(_class, query, options);
45
+ }
46
+ async searchFulltext(query, options) {
47
+ return await this.client.searchFulltext(query, options);
48
+ }
49
+ async close() {
50
+ }
51
+ getHierarchy() {
52
+ if (this.hierarchy === void 0) {
53
+ throw new Error("Hierarchy is not defined");
54
+ }
55
+ return this.hierarchy;
56
+ }
57
+ getModel() {
58
+ if (this.model === void 0) {
59
+ throw new Error("Model is not defined");
60
+ }
61
+ return this.model;
62
+ }
63
+ }
64
+ //# sourceMappingURL=adapter.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/rest/adapter.ts"],
4
+ "sourcesContent": ["//\n// Copyright \u00A9 2026 Hardcore Engineering Inc.\n//\n// Licensed under the Eclipse Public License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License. You may\n// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport {\n type Class,\n Client,\n type Doc,\n type DocumentQuery,\n type DomainParams,\n type DomainRequestOptions,\n type DomainResult,\n type FindOptions,\n type FindResult,\n Hierarchy,\n ModelDb,\n OperationDomain,\n type Ref,\n type SearchOptions,\n type SearchQuery,\n type SearchResult,\n type Tx,\n type TxResult,\n type WithLookup\n} from '@hcengineering/core'\n\nimport type { RestClient } from './types'\n\nexport class RestClientAdapter implements Client {\n constructor (\n private readonly client: RestClient,\n private readonly hierarchy: Hierarchy | undefined,\n private readonly model: ModelDb | undefined\n ) {}\n\n async domainRequest<T>(\n domain: OperationDomain,\n params: DomainParams,\n options?: DomainRequestOptions\n ): Promise<DomainResult<T>> {\n return await this.client.domainRequest(domain, params, options)\n }\n\n async findAll<T extends Doc>(\n _class: Ref<Class<T>>,\n query: DocumentQuery<T>,\n options?: FindOptions<T>\n ): Promise<FindResult<T>> {\n return await this.client.findAll(_class, query, options)\n }\n\n async tx (tx: Tx): Promise<TxResult> {\n return await this.client.tx(tx)\n }\n\n async findOne<T extends Doc>(\n _class: Ref<Class<T>>,\n query: DocumentQuery<T>,\n options?: FindOptions<T>\n ): Promise<WithLookup<T> | undefined> {\n return await this.client.findOne(_class, query, options)\n }\n\n async searchFulltext (query: SearchQuery, options: SearchOptions): Promise<SearchResult> {\n return await this.client.searchFulltext(query, options)\n }\n\n async close (): Promise<void> {\n // No ned to close the REST client\n }\n\n getHierarchy (): Hierarchy {\n if (this.hierarchy === undefined) {\n throw new Error('Hierarchy is not defined')\n }\n return this.hierarchy\n }\n\n getModel (): ModelDb {\n if (this.model === undefined) {\n throw new Error('Model is not defined')\n }\n return this.model\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuCO,MAAM,kBAAoC;AAAA,EAC/C,YACmB,QACA,WACA,OACjB;AAHiB;AACA;AACA;AAAA,EAChB;AAAA,EA5CL,OAuCiD;AAAA;AAAA;AAAA,EAO/C,MAAM,cACJ,QACA,QACA,SAC0B;AAC1B,WAAO,MAAM,KAAK,OAAO,cAAc,QAAQ,QAAQ,OAAO;AAAA,EAChE;AAAA,EAEA,MAAM,QACJ,QACA,OACA,SACwB;AACxB,WAAO,MAAM,KAAK,OAAO,QAAQ,QAAQ,OAAO,OAAO;AAAA,EACzD;AAAA,EAEA,MAAM,GAAI,IAA2B;AACnC,WAAO,MAAM,KAAK,OAAO,GAAG,EAAE;AAAA,EAChC;AAAA,EAEA,MAAM,QACJ,QACA,OACA,SACoC;AACpC,WAAO,MAAM,KAAK,OAAO,QAAQ,QAAQ,OAAO,OAAO;AAAA,EACzD;AAAA,EAEA,MAAM,eAAgB,OAAoB,SAA+C;AACvF,WAAO,MAAM,KAAK,OAAO,eAAe,OAAO,OAAO;AAAA,EACxD;AAAA,EAEA,MAAM,QAAwB;AAAA,EAE9B;AAAA,EAEA,eAA2B;AACzB,QAAI,KAAK,cAAc,QAAW;AAChC,YAAM,IAAI,MAAM,0BAA0B;AAAA,IAC5C;AACA,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,WAAqB;AACnB,QAAI,KAAK,UAAU,QAAW;AAC5B,YAAM,IAAI,MAAM,sBAAsB;AAAA,IACxC;AACA,WAAO,KAAK;AAAA,EACd;AACF;",
6
+ "names": []
7
+ }
@@ -19,11 +19,13 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
19
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
20
  var rest_exports = {};
21
21
  __export(rest_exports, {
22
+ RestClientAdapter: () => import_adapter.RestClientAdapter,
22
23
  connectRest: () => import_rest.connectRest,
23
24
  createRestClient: () => import_rest.createRestClient,
24
25
  createRestTxOperations: () => import_tx.createRestTxOperations
25
26
  });
26
27
  module.exports = __toCommonJS(rest_exports);
28
+ var import_adapter = require("./adapter");
27
29
  var import_rest = require("./rest");
28
30
  var import_tx = require("./tx");
29
31
  __reExport(rest_exports, require("./types"), module.exports);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/rest/index.ts"],
4
- "sourcesContent": ["//\n// Copyright \u00A9 2025 Hardcore Engineering Inc.\n//\n// Licensed under the Eclipse Public License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License. You may\n// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nexport { createRestClient, connectRest } from './rest'\nexport { createRestTxOperations } from './tx'\nexport * from './types'\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,kBAA8C;AAC9C,gBAAuC;AACvC,yBAAc,oBAjBd;",
4
+ "sourcesContent": ["//\n// Copyright \u00A9 2025 Hardcore Engineering Inc.\n//\n// Licensed under the Eclipse Public License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License. You may\n// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nexport { RestClientAdapter } from './adapter'\nexport { createRestClient, connectRest } from './rest'\nexport { createRestTxOperations } from './tx'\nexport * from './types'\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,qBAAkC;AAClC,kBAA8C;AAC9C,gBAAuC;AACvC,yBAAc,oBAlBd;",
6
6
  "names": []
7
7
  }
@@ -49,8 +49,12 @@ const NodeWebSocketFactory = /* @__PURE__ */ __name((url) => {
49
49
  };
50
50
  ws.on("message", (data) => {
51
51
  if (client.onmessage != null) {
52
+ let eventData = data;
53
+ if (typeof Buffer !== "undefined" && data instanceof Buffer) {
54
+ eventData = new Uint8Array(data).buffer;
55
+ }
52
56
  const event = {
53
- data,
57
+ data: eventData,
54
58
  type: "message",
55
59
  target: void 0
56
60
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/socket/node.ts"],
4
- "sourcesContent": ["//\n// Copyright \u00A9 2024 Hardcore Engineering Inc.\n//\n// Licensed under the Eclipse Public License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License. You may\n// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport { type ClientSocket, type ClientSocketFactory } from '@hcengineering/client'\n\n/** @public */\nexport const NodeWebSocketFactory: ClientSocketFactory = (url: string): ClientSocket => {\n // We need to override default factory with 'ws' one.\n // eslint-disable-next-line\n let WebSocket\n try {\n WebSocket = require('ws')\n } catch (error) {\n throw new Error('The \"ws\" package is required for NodeWebSocketFactory. ')\n }\n type WebSocketData = Parameters<typeof ws.on>[1]\n\n const ws = new WebSocket(url)\n\n const client: ClientSocket = {\n get readyState (): number {\n return ws.readyState\n },\n\n send: (data: string | ArrayBufferLike | Blob | ArrayBufferView): void => {\n if (data instanceof Blob) {\n void data.arrayBuffer().then((buffer) => {\n ws.send(buffer)\n })\n } else {\n ws.send(data)\n }\n },\n\n close: (code?: number): void => {\n ws.close(code)\n }\n }\n\n ws.on('message', (data: WebSocketData) => {\n if (client.onmessage != null) {\n const event = {\n data,\n type: 'message',\n target: this\n } as unknown as MessageEvent\n\n client.onmessage(event)\n }\n })\n\n ws.on('close', (code: number, reason: string) => {\n if (client.onclose != null) {\n const closeEvent = {\n code,\n reason,\n wasClean: code === 1000,\n type: 'close',\n target: this\n } as unknown as CloseEvent\n\n client.onclose(closeEvent)\n }\n })\n\n ws.on('open', () => {\n if (client.onopen != null) {\n const event = {\n type: 'open',\n target: this\n } as unknown as Event\n\n client.onopen(event)\n }\n })\n\n ws.on('error', (error: Error) => {\n if (client.onerror != null) {\n const event = {\n type: 'error',\n target: this,\n error\n } as unknown as Event\n\n client.onerror(event)\n }\n })\n\n return client\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBO,MAAM,uBAA4C,wBAAC,QAA8B;AAGtF,MAAI;AACJ,MAAI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AM;AAAA,QACN,QAAQ;AAAA,QACR;AAAA,MACF;AAEA,aAAO,QAAQ,KAAK;AAAA,IACtB;AAAA,EACF,CAAC;AAED,SAAO;AACT,GAnFyD;",
4
+ "sourcesContent": ["//\n// Copyright \u00A9 2024 Hardcore Engineering Inc.\n//\n// Licensed under the Eclipse Public License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License. You may\n// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport { type ClientSocket, type ClientSocketFactory } from '@hcengineering/client'\n\n/** @public */\nexport const NodeWebSocketFactory: ClientSocketFactory = (url: string): ClientSocket => {\n // We need to override default factory with 'ws' one.\n // eslint-disable-next-line\n let WebSocket\n try {\n WebSocket = require('ws')\n } catch (error) {\n throw new Error('The \"ws\" package is required for NodeWebSocketFactory. ')\n }\n type WebSocketData = Parameters<typeof ws.on>[1]\n\n const ws = new WebSocket(url)\n\n const client: ClientSocket = {\n get readyState (): number {\n return ws.readyState\n },\n\n send: (data: string | ArrayBufferLike | Blob | ArrayBufferView): void => {\n if (data instanceof Blob) {\n void data.arrayBuffer().then((buffer) => {\n ws.send(buffer)\n })\n } else {\n ws.send(data)\n }\n },\n\n close: (code?: number): void => {\n ws.close(code)\n }\n }\n\n ws.on('message', (data: WebSocketData) => {\n if (client.onmessage != null) {\n let eventData: string | ArrayBuffer | SharedArrayBuffer = data as any\n if (typeof Buffer !== 'undefined' && data instanceof Buffer) {\n eventData = new Uint8Array(data).buffer\n }\n\n const event = {\n data: eventData,\n type: 'message',\n target: this\n } as unknown as MessageEvent\n\n client.onmessage(event)\n }\n })\n\n ws.on('close', (code: number, reason: string) => {\n if (client.onclose != null) {\n const closeEvent = {\n code,\n reason,\n wasClean: code === 1000,\n type: 'close',\n target: this\n } as unknown as CloseEvent\n\n client.onclose(closeEvent)\n }\n })\n\n ws.on('open', () => {\n if (client.onopen != null) {\n const event = {\n type: 'open',\n target: this\n } as unknown as Event\n\n client.onopen(event)\n }\n })\n\n ws.on('error', (error: Error) => {\n if (client.onerror != null) {\n const event = {\n type: 'error',\n target: this,\n error\n } as unknown as Event\n\n client.onerror(event)\n }\n })\n\n return client\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBO,MAAM,uBAA4C,wBAAC,QAA8B;AAGtF,MAAI;AACJ,MAAI;AACF,gBAAY,QAAQ,IAAI;AAAA,EAC1B,SAAS,OAAO;AACd,UAAM,IAAI,MAAM,yDAAyD;AAAA,EAC3E;AAGA,QAAM,KAAK,IAAI,UAAU,GAAG;AAE5B,QAAM,SAAuB;AAAA,IAC3B,IAAI,aAAsB;AACxB,aAAO,GAAG;AAAA,IACZ;AAAA,IAEA,MAAM,wBAAC,SAAkE;AACvE,UAAI,gBAAgB,MAAM;AACxB,aAAK,KAAK,YAAY,EAAE,KAAK,CAAC,WAAW;AACvC,aAAG,KAAK,MAAM;AAAA,QAChB,CAAC;AAAA,MACH,OAAO;AACL,WAAG,KAAK,IAAI;AAAA,MACd;AAAA,IACF,GARM;AAAA,IAUN,OAAO,wBAAC,SAAwB;AAC9B,SAAG,MAAM,IAAI;AAAA,IACf,GAFO;AAAA,EAGT;AAEA,KAAG,GAAG,WAAW,CAAC,SAAwB;AACxC,QAAI,OAAO,aAAa,MAAM;AAC5B,UAAI,YAAsD;AAC1D,UAAI,OAAO,WAAW,eAAe,gBAAgB,QAAQ;AAC3D,oBAAY,IAAI,WAAW,IAAI,EAAE;AAAA,MACnC;AAEA,YAAM,QAAQ;AAAA,QACZ,MAAM;AAAA,QACN,MAAM;AAAA,QACN,QAAQ;AAAA,MACV;AAEA,aAAO,UAAU,KAAK;AAAA,IACxB;AAAA,EACF,CAAC;AAED,KAAG,GAAG,SAAS,CAAC,MAAc,WAAmB;AAC/C,QAAI,OAAO,WAAW,MAAM;AAC1B,YAAM,aAAa;AAAA,QACjB;AAAA,QACA;AAAA,QACA,UAAU,SAAS;AAAA,QACnB,MAAM;AAAA,QACN,QAAQ;AAAA,MACV;AAEA,aAAO,QAAQ,UAAU;AAAA,IAC3B;AAAA,EACF,CAAC;AAED,KAAG,GAAG,QAAQ,MAAM;AAClB,QAAI,OAAO,UAAU,MAAM;AACzB,YAAM,QAAQ;AAAA,QACZ,MAAM;AAAA,QACN,QAAQ;AAAA,MACV;AAEA,aAAO,OAAO,KAAK;AAAA,IACrB;AAAA,EACF,CAAC;AAED,KAAG,GAAG,SAAS,CAAC,UAAiB;AAC/B,QAAI,OAAO,WAAW,MAAM;AAC1B,YAAM,QAAQ;AAAA,QACZ,MAAM;AAAA,QACN,QAAQ;AAAA,QACR;AAAA,MACF;AAEA,aAAO,QAAQ,KAAK;AAAA,IACtB;AAAA,EACF,CAAC;AAED,SAAO;AACT,GAxFyD;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hcengineering/api-client",
3
- "version": "0.7.18",
3
+ "version": "0.7.423",
4
4
  "main": "lib/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -21,8 +21,18 @@
21
21
  "author": "Anticrm Platform Contributors",
22
22
  "template": "@hcengineering/api-package",
23
23
  "license": "EPL-2.0",
24
+ "scripts": {
25
+ "build": "compile",
26
+ "build:watch": "compile",
27
+ "test": "jest --passWithNoTests --silent --coverage",
28
+ "format": "format src",
29
+ "_phase:build": "compile transpile src",
30
+ "_phase:test": "jest --passWithNoTests --silent --coverage",
31
+ "_phase:format": "format src",
32
+ "_phase:validate": "compile validate"
33
+ },
24
34
  "devDependencies": {
25
- "@hcengineering/platform-rig": "^0.7.19",
35
+ "@hcengineering/platform-rig": "^0.7.423",
26
36
  "@typescript-eslint/eslint-plugin": "^6.21.0",
27
37
  "eslint-plugin-import": "^2.26.0",
28
38
  "eslint-plugin-promise": "^6.1.1",
@@ -30,43 +40,36 @@
30
40
  "eslint": "^8.54.0",
31
41
  "@typescript-eslint/parser": "^6.21.0",
32
42
  "eslint-config-standard-with-typescript": "^40.0.0",
33
- "prettier": "^3.1.0",
43
+ "prettier": "^3.6.2",
34
44
  "typescript": "^5.9.3",
35
45
  "jest": "^29.7.0",
36
46
  "ts-jest": "^29.1.1",
37
- "ts-node": "^10.8.0",
38
- "@types/node": "^22.15.29",
47
+ "ts-node": "^10.9.2",
48
+ "@types/node": "^22.18.1",
39
49
  "@types/jest": "^29.5.5",
40
50
  "@types/ws": "^8.5.12",
41
51
  "@types/snappyjs": "^0.7.1",
42
52
  "eslint-plugin-svelte": "^2.35.1"
43
53
  },
44
54
  "dependencies": {
45
- "@hcengineering/account-client": "^0.7.17",
46
- "@hcengineering/client": "^0.7.17",
47
- "@hcengineering/client-resources": "^0.7.17",
48
- "@hcengineering/collaborator-client": "^0.7.17",
49
- "@hcengineering/core": "^0.7.18",
50
- "@hcengineering/platform": "^0.7.17",
51
- "@hcengineering/text": "^0.7.18",
52
- "@hcengineering/text-markdown": "^0.7.18",
55
+ "@hcengineering/account-client": "^0.7.423",
56
+ "@hcengineering/client": "^0.7.423",
57
+ "@hcengineering/client-resources": "^0.7.423",
58
+ "@hcengineering/collaborator-client": "^0.7.423",
59
+ "@hcengineering/core": "^0.7.423",
60
+ "@hcengineering/platform": "^0.7.423",
61
+ "@hcengineering/text": "^0.7.423",
62
+ "@hcengineering/text-markdown": "^0.7.423",
53
63
  "snappyjs": "^0.7.0"
54
64
  },
55
- "repository": "https://github.com/hcengineering/huly.core",
65
+ "repository": {
66
+ "type": "git",
67
+ "url": "git+https://github.com/hcengineering/huly.core.git"
68
+ },
56
69
  "publishConfig": {
57
70
  "access": "public"
58
71
  },
59
72
  "optionalDependencies": {
60
73
  "ws": "^8.18.2"
61
- },
62
- "scripts": {
63
- "build": "compile",
64
- "build:watch": "compile",
65
- "test": "jest --passWithNoTests --silent --coverage",
66
- "format": "format src",
67
- "_phase:build": "compile transpile src",
68
- "_phase:test": "jest --passWithNoTests --silent --coverage",
69
- "_phase:format": "format src",
70
- "_phase:validate": "compile validate"
71
74
  }
72
- }
75
+ }
@@ -88,7 +88,16 @@ async function createClient (
88
88
  config: ServerConfig,
89
89
  options: ConnectOptions
90
90
  ): Promise<PlatformClient> {
91
- addLocation(clientId, () => import(/* webpackChunkName: "client" */ '@hcengineering/client-resources'))
91
+ addLocation(clientId, () => {
92
+ // In Node/Jest environments, dynamic import callbacks can fail without
93
+ // --experimental-vm-modules. Use require there and keep dynamic import
94
+ // for browser/bundler environments.
95
+ if (typeof window === 'undefined') {
96
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
97
+ return Promise.resolve(require('@hcengineering/client-resources'))
98
+ }
99
+ return import(/* webpackChunkName: "client" */ '@hcengineering/client-resources')
100
+ })
92
101
 
93
102
  const { socketFactory, connectionTimeout } = options
94
103
 
@@ -0,0 +1,96 @@
1
+ //
2
+ // Copyright © 2026 Hardcore Engineering Inc.
3
+ //
4
+ // Licensed under the Eclipse Public License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License. You may
6
+ // obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ //
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ //
15
+
16
+ import {
17
+ type Class,
18
+ Client,
19
+ type Doc,
20
+ type DocumentQuery,
21
+ type DomainParams,
22
+ type DomainRequestOptions,
23
+ type DomainResult,
24
+ type FindOptions,
25
+ type FindResult,
26
+ Hierarchy,
27
+ ModelDb,
28
+ OperationDomain,
29
+ type Ref,
30
+ type SearchOptions,
31
+ type SearchQuery,
32
+ type SearchResult,
33
+ type Tx,
34
+ type TxResult,
35
+ type WithLookup
36
+ } from '@hcengineering/core'
37
+
38
+ import type { RestClient } from './types'
39
+
40
+ export class RestClientAdapter implements Client {
41
+ constructor (
42
+ private readonly client: RestClient,
43
+ private readonly hierarchy: Hierarchy | undefined,
44
+ private readonly model: ModelDb | undefined
45
+ ) {}
46
+
47
+ async domainRequest<T>(
48
+ domain: OperationDomain,
49
+ params: DomainParams,
50
+ options?: DomainRequestOptions
51
+ ): Promise<DomainResult<T>> {
52
+ return await this.client.domainRequest(domain, params, options)
53
+ }
54
+
55
+ async findAll<T extends Doc>(
56
+ _class: Ref<Class<T>>,
57
+ query: DocumentQuery<T>,
58
+ options?: FindOptions<T>
59
+ ): Promise<FindResult<T>> {
60
+ return await this.client.findAll(_class, query, options)
61
+ }
62
+
63
+ async tx (tx: Tx): Promise<TxResult> {
64
+ return await this.client.tx(tx)
65
+ }
66
+
67
+ async findOne<T extends Doc>(
68
+ _class: Ref<Class<T>>,
69
+ query: DocumentQuery<T>,
70
+ options?: FindOptions<T>
71
+ ): Promise<WithLookup<T> | undefined> {
72
+ return await this.client.findOne(_class, query, options)
73
+ }
74
+
75
+ async searchFulltext (query: SearchQuery, options: SearchOptions): Promise<SearchResult> {
76
+ return await this.client.searchFulltext(query, options)
77
+ }
78
+
79
+ async close (): Promise<void> {
80
+ // No ned to close the REST client
81
+ }
82
+
83
+ getHierarchy (): Hierarchy {
84
+ if (this.hierarchy === undefined) {
85
+ throw new Error('Hierarchy is not defined')
86
+ }
87
+ return this.hierarchy
88
+ }
89
+
90
+ getModel (): ModelDb {
91
+ if (this.model === undefined) {
92
+ throw new Error('Model is not defined')
93
+ }
94
+ return this.model
95
+ }
96
+ }
@@ -13,6 +13,7 @@
13
13
  // limitations under the License.
14
14
  //
15
15
 
16
+ export { RestClientAdapter } from './adapter'
16
17
  export { createRestClient, connectRest } from './rest'
17
18
  export { createRestTxOperations } from './tx'
18
19
  export * from './types'
@@ -51,8 +51,13 @@ export const NodeWebSocketFactory: ClientSocketFactory = (url: string): ClientSo
51
51
 
52
52
  ws.on('message', (data: WebSocketData) => {
53
53
  if (client.onmessage != null) {
54
+ let eventData: string | ArrayBuffer | SharedArrayBuffer = data as any
55
+ if (typeof Buffer !== 'undefined' && data instanceof Buffer) {
56
+ eventData = new Uint8Array(data).buffer
57
+ }
58
+
54
59
  const event = {
55
- data,
60
+ data: eventData,
56
61
  type: 'message',
57
62
  target: this
58
63
  } as unknown as MessageEvent
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["//\n// Copyright \u00A9 2020, 2021 Anticrm Platform Contributors.\n//\n// Licensed under the Eclipse Public License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License. You may\n// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport { ActivityMessage, ActivityMessageViewlet } from '@hcengineering/activity'\nimport type { Class, Doc, Markup, Mixin, Ref, Space, Timestamp } from '@hcengineering/core'\nimport { NotificationType } from '@hcengineering/notification'\nimport type { Asset, Plugin, Resource } from '@hcengineering/platform'\nimport { IntlString, plugin } from '@hcengineering/platform'\nimport { AnyComponent } from '@hcengineering/ui'\nimport { Action } from '@hcengineering/view'\nimport { Person, ChannelProvider as SocialChannelProvider } from '@hcengineering/contact'\nimport { Widget, WidgetTab } from '@hcengineering/workbench'\n\n/**\n * @public\n */\nexport interface ChunterSpace extends Space {\n messages?: number\n}\n\n/**\n * @public\n */\nexport interface Channel extends ChunterSpace {\n topic?: string\n}\n\n/**\n * @public\n */\nexport interface DirectMessage extends ChunterSpace {}\n\n/**\n * @public\n */\nexport interface ObjectChatPanel extends Class<Doc> {\n openByDefault?: boolean\n ignoreKeys: string[]\n}\n\n/**\n * @public\n */\nexport interface ChatMessage extends ActivityMessage {\n message: Markup\n attachments?: number\n editedOn?: Timestamp\n provider?: Ref<SocialChannelProvider>\n}\n\n/**\n * @public\n */\nexport interface ThreadMessage extends ChatMessage {\n attachedTo: Ref<ActivityMessage>\n attachedToClass: Ref<Class<ActivityMessage>>\n objectId: Ref<Doc>\n objectClass: Ref<Class<Doc>>\n}\n\n/**\n * @public\n */\nexport interface ChatMessageViewlet extends ActivityMessageViewlet {\n messageClass: Ref<Class<Doc>>\n label?: IntlString\n}\n\nexport interface ChatSyncInfo extends Doc {\n user: Ref<Person>\n timestamp: Timestamp\n}\n\nexport interface ChatWidgetTab extends WidgetTab {\n data: {\n _id?: Ref<Doc>\n _class?: Ref<Class<Doc>>\n thread?: Ref<ActivityMessage>\n channelName: string\n selectedMessageId?: Ref<ActivityMessage>\n props?: Record<string, any>\n }\n}\n\n/**\n * @public\n */\nexport const chunterId = 'chunter' as Plugin\n\nexport * from './utils'\nexport * from './analytics'\n\nexport default plugin(chunterId, {\n icon: {\n Chunter: '' as Asset,\n Hashtag: '' as Asset,\n Thread: '' as Asset,\n Lock: '' as Asset,\n ChannelBrowser: '' as Asset,\n ChunterBrowser: '' as Asset,\n Copy: '' as Asset,\n Messages: '' as Asset,\n Bookmarks: '' as Asset\n },\n component: {\n DmHeader: '' as AnyComponent,\n ThreadView: '' as AnyComponent,\n Thread: '' as AnyComponent,\n Reactions: '' as AnyComponent,\n ChatMessageInput: '' as AnyComponent,\n ChatMessagesPresenter: '' as AnyComponent,\n ChatMessagePresenter: '' as AnyComponent,\n ThreadMessagePresenter: '' as AnyComponent,\n ChatMessagePreview: '' as AnyComponent,\n ThreadMessagePreview: '' as AnyComponent,\n DirectIcon: '' as AnyComponent,\n InlineCommentThread: '' as AnyComponent\n },\n activity: {\n MembersChangedMessage: '' as AnyComponent\n },\n class: {\n ThreadMessage: '' as Ref<Class<ThreadMessage>>,\n ChunterSpace: '' as Ref<Class<ChunterSpace>>,\n Channel: '' as Ref<Class<Channel>>,\n DirectMessage: '' as Ref<Class<DirectMessage>>,\n ChatMessage: '' as Ref<Class<ChatMessage>>,\n ChatMessageViewlet: '' as Ref<Class<ChatMessageViewlet>>,\n ChatSyncInfo: '' as Ref<Class<ChatSyncInfo>>\n },\n mixin: {\n ObjectChatPanel: '' as Ref<Mixin<ObjectChatPanel>>\n },\n string: {\n Reactions: '' as IntlString,\n EditUpdate: '' as IntlString,\n EditCancel: '' as IntlString,\n Comments: '' as IntlString,\n Settings: '' as IntlString,\n ArchiveChannel: '' as IntlString,\n UnarchiveChannel: '' as IntlString,\n ArchiveConfirm: '' as IntlString,\n Message: '' as IntlString,\n MessageOn: '' as IntlString,\n UnarchiveConfirm: '' as IntlString,\n ConvertToPrivate: '' as IntlString,\n DirectNotificationTitle: '' as IntlString,\n DirectNotificationBody: '' as IntlString,\n MessageNotificationBody: '' as IntlString,\n AddCommentPlaceholder: '' as IntlString,\n LeftComment: '' as IntlString,\n Docs: '' as IntlString,\n Chat: '' as IntlString,\n Thread: '' as IntlString,\n ThreadMessage: '' as IntlString,\n ReplyToThread: '' as IntlString,\n Channels: '' as IntlString,\n Direct: '' as IntlString,\n RepliedTo: '' as IntlString,\n AllChannels: '' as IntlString,\n AllContacts: '' as IntlString,\n NewChannel: '' as IntlString,\n TopicOptional: '' as IntlString,\n Visibility: '' as IntlString,\n Public: '' as IntlString,\n Private: '' as IntlString,\n NewDirectChat: '' as IntlString,\n AddMembers: '' as IntlString,\n CloseConversation: '' as IntlString,\n Starred: '' as IntlString,\n DeleteStarred: '' as IntlString,\n StarChannel: '' as IntlString,\n StarConversation: '' as IntlString,\n UnstarChannel: '' as IntlString,\n UnstarConversation: '' as IntlString,\n NoMessagesInChannel: '' as IntlString,\n SendMessagesInChannel: '' as IntlString,\n Joined: '' as IntlString,\n Left: '' as IntlString,\n Added: '' as IntlString,\n Removed: '' as IntlString,\n CreatedChannelOn: '' as IntlString,\n YouJoinedChannel: '' as IntlString,\n AndMore: '' as IntlString,\n IsTyping: '' as IntlString,\n ThreadIn: '' as IntlString,\n TranslateMessage: '' as IntlString,\n Translate: '' as IntlString,\n ShowOriginal: '' as IntlString,\n Translating: '' as IntlString,\n StartConversation: '' as IntlString,\n ViewingThreadFromArchivedChannel: '' as IntlString,\n ViewingArchivedChannel: '' as IntlString,\n OpenChatInSidebar: '' as IntlString,\n SummarizeMessages: '' as IntlString\n },\n ids: {\n DMNotification: '' as Ref<NotificationType>,\n ThreadNotification: '' as Ref<NotificationType>,\n ChannelNotification: '' as Ref<NotificationType>,\n JoinChannelNotification: '' as Ref<NotificationType>,\n ThreadMessageViewlet: '' as Ref<ChatMessageViewlet>,\n ChatWidget: '' as Ref<Widget>\n },\n app: {\n Chunter: '' as Ref<Doc>\n },\n action: {\n DeleteChatMessage: '' as Ref<Action>,\n LeaveChannel: '' as Ref<Action>,\n RemoveChannel: '' as Ref<Action>,\n TranslateMessage: '' as Ref<Action>,\n SummarizeMessages: '' as Ref<Action>,\n ShowOriginalMessage: '' as Ref<Action>,\n CloseConversation: '' as Ref<Action>\n },\n function: {\n CanTranslateMessage: '' as Resource<(doc?: Doc | Doc[]) => Promise<boolean>>,\n CanSummarizeMessages: '' as Resource<(doc?: Doc | Doc[]) => Promise<boolean>>,\n OpenThreadInSidebar: '' as Resource<\n (\n _id: Ref<ActivityMessage>,\n msg?: ActivityMessage,\n doc?: Doc,\n selectedId?: Ref<ActivityMessage>,\n props?: Record<string, any>,\n force?: boolean\n ) => Promise<void>\n >,\n OpenChannelInSidebar: '' as Resource<\n (\n _id: Ref<Doc>,\n _class: Ref<Class<Doc>>,\n doc?: Doc,\n thread?: Ref<ActivityMessage>,\n newTab?: boolean,\n selectedMessageId?: Ref<ActivityMessage>\n ) => Promise<void>\n >\n }\n})\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBA,sBAAmC;AAkFnC,0BAAc,oBArGd;AAsGA,0BAAc,wBAtGd;AAmGO,MAAM,YAAY;AAKzB,IAAO,oBAAQ,wB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Y;AAAA,IACZ,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,mBAAmB;AAAA,IACnB,SAAS;AAAA,IACT,eAAe;AAAA,IACf,aAAa;AAAA,IACb,kBAAkB;AAAA,IAClB,eAAe;AAAA,IACf,oBAAoB;AAAA,IACpB,qBAAqB;AAAA,IACrB,uBAAuB;AAAA,IACvB,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,IACT,kBAAkB;AAAA,IAClB,kBAAkB;AAAA,IAClB,SAAS;AAAA,IACT,UAAU;AAAA,IACV,UAAU;AAAA,IACV,kBAAkB;AAAA,IAClB,WAAW;AAAA,IACX,cAAc;AAAA,IACd,aAAa;AAAA,IACb,mBAAmB;AAAA,IACnB,kCAAkC;AAAA,IAClC,wBAAwB;AAAA,IACxB,mBAAmB;AAAA,IACnB,mBAAmB;AAAA,EACrB;AAAA,EACA,KAAK;AAAA,IACH,gBAAgB;AAAA,IAChB,oBAAoB;AAAA,IACpB,qBAAqB;AAAA,IACrB,yBAAyB;AAAA,IACzB,sBAAsB;AAAA,IACtB,YAAY;AAAA,EACd;AAAA,EACA,KAAK;AAAA,IACH,SAAS;AAAA,EACX;AAAA,EACA,QAAQ;AAAA,IACN,mBAAmB;AAAA,IACnB,cAAc;AAAA,IACd,eAAe;AAAA,IACf,kBAAkB;AAAA,IAClB,mBAAmB;AAAA,IACnB,qBAAqB;AAAA,IACrB,mBAAmB;AAAA,EACrB;AAAA,EACA,UAAU;AAAA,IACR,qBAAqB;AAAA,IACrB,sBAAsB;AAAA,IACtB,qBAAqB;AAAA,IAUrB,sBAAsB;AAAA,EAUxB;AACF,CAAC;",
4
+ "sourcesContent": ["//\n// Copyright \u00A9 2020, 2021 Anticrm Platform Contributors.\n//\n// Licensed under the Eclipse Public License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License. You may\n// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport { ActivityMessage, ActivityMessageViewlet } from '@hcengineering/activity'\nimport type { Class, Doc, Markup, Mixin, Ref, Space, Timestamp } from '@hcengineering/core'\nimport { NotificationType } from '@hcengineering/notification'\nimport type { Asset, Plugin, Resource } from '@hcengineering/platform'\nimport { IntlString, plugin } from '@hcengineering/platform'\nimport { AnyComponent } from '@hcengineering/ui'\nimport { Action } from '@hcengineering/view'\nimport { Person, ChannelProvider as SocialChannelProvider } from '@hcengineering/contact'\nimport { Widget, WidgetTab } from '@hcengineering/workbench'\n\n/**\n * @public\n */\nexport interface ChunterSpace extends Space {\n messages?: number\n\n __migratedToCard?: {\n card?: Ref<Doc>\n space?: Ref<Space>\n }\n __migratedUntil?: Timestamp\n}\n\n/**\n * @public\n */\nexport interface Channel extends ChunterSpace {\n topic?: string\n}\n\n/**\n * @public\n */\nexport interface DirectMessage extends ChunterSpace {}\n\n/**\n * @public\n */\nexport interface ObjectChatPanel extends Class<Doc> {\n openByDefault?: boolean\n ignoreKeys: string[]\n}\n\n/**\n * @public\n */\nexport interface ChatMessage extends ActivityMessage {\n message: Markup\n attachments?: number\n editedOn?: Timestamp\n provider?: Ref<SocialChannelProvider>\n}\n\n/**\n * @public\n */\nexport interface ThreadMessage extends ChatMessage {\n attachedTo: Ref<ActivityMessage>\n attachedToClass: Ref<Class<ActivityMessage>>\n objectId: Ref<Doc>\n objectClass: Ref<Class<Doc>>\n}\n\n/**\n * @public\n */\nexport interface ChatMessageViewlet extends ActivityMessageViewlet {\n messageClass: Ref<Class<Doc>>\n label?: IntlString\n}\n\nexport interface ChatSyncInfo extends Doc {\n user: Ref<Person>\n timestamp: Timestamp\n}\n\nexport interface ChatWidgetTab extends WidgetTab {\n data: {\n _id?: Ref<Doc>\n _class?: Ref<Class<Doc>>\n thread?: Ref<ActivityMessage>\n channelName: string\n selectedMessageId?: Ref<ActivityMessage>\n props?: Record<string, any>\n }\n}\n\n/**\n * @public\n */\nexport const chunterId = 'chunter' as Plugin\n\nexport * from './utils'\nexport * from './analytics'\n\nexport default plugin(chunterId, {\n icon: {\n Chunter: '' as Asset,\n Hashtag: '' as Asset,\n Thread: '' as Asset,\n Lock: '' as Asset,\n ChannelBrowser: '' as Asset,\n ChunterBrowser: '' as Asset,\n Copy: '' as Asset,\n Messages: '' as Asset,\n Bookmarks: '' as Asset\n },\n component: {\n DmHeader: '' as AnyComponent,\n ThreadView: '' as AnyComponent,\n Thread: '' as AnyComponent,\n Reactions: '' as AnyComponent,\n ChatMessageInput: '' as AnyComponent,\n ChatMessagesPresenter: '' as AnyComponent,\n ChatMessagePresenter: '' as AnyComponent,\n ThreadMessagePresenter: '' as AnyComponent,\n ChatMessagePreview: '' as AnyComponent,\n ThreadMessagePreview: '' as AnyComponent,\n DirectIcon: '' as AnyComponent,\n InlineCommentThread: '' as AnyComponent\n },\n activity: {\n MembersChangedMessage: '' as AnyComponent\n },\n class: {\n ThreadMessage: '' as Ref<Class<ThreadMessage>>,\n ChunterSpace: '' as Ref<Class<ChunterSpace>>,\n Channel: '' as Ref<Class<Channel>>,\n DirectMessage: '' as Ref<Class<DirectMessage>>,\n ChatMessage: '' as Ref<Class<ChatMessage>>,\n ChatMessageViewlet: '' as Ref<Class<ChatMessageViewlet>>,\n ChatSyncInfo: '' as Ref<Class<ChatSyncInfo>>\n },\n mixin: {\n ObjectChatPanel: '' as Ref<Mixin<ObjectChatPanel>>\n },\n string: {\n Reactions: '' as IntlString,\n EditUpdate: '' as IntlString,\n EditCancel: '' as IntlString,\n Comments: '' as IntlString,\n Settings: '' as IntlString,\n ArchiveChannel: '' as IntlString,\n UnarchiveChannel: '' as IntlString,\n ArchiveConfirm: '' as IntlString,\n Message: '' as IntlString,\n MessageOn: '' as IntlString,\n UnarchiveConfirm: '' as IntlString,\n ConvertToPrivate: '' as IntlString,\n DirectNotificationTitle: '' as IntlString,\n DirectNotificationBody: '' as IntlString,\n MessageNotificationBody: '' as IntlString,\n AddCommentPlaceholder: '' as IntlString,\n LeftComment: '' as IntlString,\n Docs: '' as IntlString,\n Chat: '' as IntlString,\n Thread: '' as IntlString,\n ThreadMessage: '' as IntlString,\n ReplyToThread: '' as IntlString,\n Channels: '' as IntlString,\n Direct: '' as IntlString,\n RepliedTo: '' as IntlString,\n AllChannels: '' as IntlString,\n AllContacts: '' as IntlString,\n NewChannel: '' as IntlString,\n TopicOptional: '' as IntlString,\n Visibility: '' as IntlString,\n Public: '' as IntlString,\n Private: '' as IntlString,\n NewDirectChat: '' as IntlString,\n AddMembers: '' as IntlString,\n CloseConversation: '' as IntlString,\n Starred: '' as IntlString,\n DeleteStarred: '' as IntlString,\n StarChannel: '' as IntlString,\n StarConversation: '' as IntlString,\n UnstarChannel: '' as IntlString,\n UnstarConversation: '' as IntlString,\n NoMessagesInChannel: '' as IntlString,\n SendMessagesInChannel: '' as IntlString,\n Joined: '' as IntlString,\n Left: '' as IntlString,\n Added: '' as IntlString,\n Removed: '' as IntlString,\n CreatedChannelOn: '' as IntlString,\n YouJoinedChannel: '' as IntlString,\n AndMore: '' as IntlString,\n IsTyping: '' as IntlString,\n ThreadIn: '' as IntlString,\n TranslateMessage: '' as IntlString,\n Translate: '' as IntlString,\n ShowOriginal: '' as IntlString,\n Translating: '' as IntlString,\n StartConversation: '' as IntlString,\n ViewingThreadFromArchivedChannel: '' as IntlString,\n ViewingArchivedChannel: '' as IntlString,\n OpenChatInSidebar: '' as IntlString,\n SummarizeMessages: '' as IntlString\n },\n ids: {\n DMNotification: '' as Ref<NotificationType>,\n ThreadNotification: '' as Ref<NotificationType>,\n ChannelNotification: '' as Ref<NotificationType>,\n JoinChannelNotification: '' as Ref<NotificationType>,\n ThreadMessageViewlet: '' as Ref<ChatMessageViewlet>,\n ChatWidget: '' as Ref<Widget>\n },\n app: {\n Chunter: '' as Ref<Doc>\n },\n action: {\n DeleteChatMessage: '' as Ref<Action>,\n LeaveChannel: '' as Ref<Action>,\n RemoveChannel: '' as Ref<Action>,\n TranslateMessage: '' as Ref<Action>,\n SummarizeMessages: '' as Ref<Action>,\n ShowOriginalMessage: '' as Ref<Action>,\n CloseConversation: '' as Ref<Action>\n },\n function: {\n CanTranslateMessage: '' as Resource<(doc?: Doc | Doc[]) => Promise<boolean>>,\n CanSummarizeMessages: '' as Resource<(doc?: Doc | Doc[]) => Promise<boolean>>,\n OpenThreadInSidebar: '' as Resource<\n (\n _id: Ref<ActivityMessage>,\n msg?: ActivityMessage,\n doc?: Doc,\n selectedId?: Ref<ActivityMessage>,\n props?: Record<string, any>,\n force?: boolean\n ) => Promise<void>\n >,\n OpenChannelInSidebar: '' as Resource<\n (\n _id: Ref<Doc>,\n _class: Ref<Class<Doc>>,\n doc?: Doc,\n thread?: Ref<ActivityMessage>,\n newTab?: boolean,\n selectedMessageId?: Ref<ActivityMessage>\n ) => Promise<void>\n >\n }\n})\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBA,sBAAmC;AAwFnC,0BAAc,oBA3Gd;AA4GA,0BAAc,wBA5Gd;AAyGO,MAAM,YAAY;AAKzB,IAAO,oBAAQ,wBAAO,WAAW;AAAA,EAC/B,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,MAAM;AAAA,IACN,UAAU;AAAA,IACV,WAAW;AAAA,EACb;AAAA,EACA,WAAW;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,kBAAkB;AAAA,IAClB,uBAAuB;AAAA,IACvB,sBAAsB;AAAA,IACtB,wBAA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