@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
@@ -0,0 +1,33 @@
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 { AccountRole } from './classes'
17
+
18
+ /**
19
+ * Toggle {@link AccountRole.Guest} in {@link Space.autoJoinForRoles}; other roles are preserved.
20
+ * @public
21
+ */
22
+ export function setWorkspaceGuestAutoJoinRoles (
23
+ existing: AccountRole[] | undefined,
24
+ includeGuest: boolean
25
+ ): AccountRole[] {
26
+ const next = new Set(existing ?? [])
27
+ if (includeGuest) {
28
+ next.add(AccountRole.Guest)
29
+ } else {
30
+ next.delete(AccountRole.Guest)
31
+ }
32
+ return Array.from(next)
33
+ }
@@ -15,9 +15,9 @@
15
15
  //
16
16
 
17
17
  import type { Asset, IntlString, Plugin } from '@hcengineering/platform'
18
+ import { Tx } from '.'
18
19
  import type { DocumentQuery } from './storage'
19
20
  import { type WorkspaceDataId, type WorkspaceUuid } from './utils'
20
- import { Tx } from '.'
21
21
 
22
22
  /**
23
23
  * @public
@@ -139,6 +139,7 @@ export interface Association extends Doc {
139
139
  nameA: string
140
140
  nameB: string
141
141
  type: '1:1' | '1:N' | 'N:N'
142
+ automationOnly?: boolean
142
143
  }
143
144
 
144
145
  /**
@@ -150,6 +151,21 @@ export interface Relation extends Doc {
150
151
  association: Ref<Association>
151
152
  }
152
153
 
154
+ /**
155
+ * Describes an existing class field with reference to other document: which relations to follow when building documents graph.
156
+ * @public
157
+ */
158
+ export interface RelationMetadata extends Doc {
159
+ /** Class (source) */
160
+ sourceClass: Ref<Class<Doc>>
161
+ /** Class referenced by the field (target) */
162
+ targetClass: Ref<Class<Doc>>
163
+ /** Field on the source class */
164
+ field: string
165
+ /** Whether this is a forward (source→target) or inverse (target→source) relation */
166
+ direction?: 'forward' | 'inverse'
167
+ }
168
+
153
169
  /**
154
170
  * @public
155
171
  */
@@ -394,6 +410,13 @@ export interface EnumOf extends Type<string> {
394
410
  */
395
411
  export interface TypeHyperlink extends Type<Hyperlink> {}
396
412
 
413
+ /**
414
+ * @public
415
+ */
416
+ export interface TypeRank extends Type<Rank> {
417
+ pos?: 'start' | 'end'
418
+ }
419
+
397
420
  /**
398
421
  * @public
399
422
  *
@@ -476,6 +499,8 @@ export interface Space extends Doc {
476
499
  archived: boolean
477
500
  owners?: AccountUuid[]
478
501
  autoJoin?: boolean
502
+ /** If it includes {@link AccountRole.Guest}, that guest is auto-added to members on activation (see OnEmployeeCreate). */
503
+ autoJoinForRoles?: AccountRole[]
479
504
  }
480
505
 
481
506
  /**
@@ -490,6 +515,7 @@ export interface SystemSpace extends Space {}
490
515
  */
491
516
  export interface TypedSpace extends Space {
492
517
  type: Ref<SpaceType>
518
+ restricted?: boolean // if true user must have permission to any txes
493
519
  }
494
520
 
495
521
  /**
@@ -551,6 +577,27 @@ export interface Permission extends Doc {
551
577
  icon?: Asset
552
578
  }
553
579
 
580
+ export interface AttributePermission extends Permission {
581
+ attribute: Ref<AnyAttribute>
582
+ }
583
+
584
+ export interface ClassPermission extends Permission {
585
+ targetClass: Ref<Class<Doc>>
586
+ }
587
+
588
+ /**
589
+ * @public
590
+ */
591
+ export interface ModulePermissionGroup extends Doc {
592
+ application: Ref<Doc>
593
+ role: AccountRole
594
+ permissions: Ref<Permission>[]
595
+ disabledPermissions?: Ref<Permission>[]
596
+ spaceClass?: Ref<Class<Space>>
597
+ enabled: boolean
598
+ order?: number
599
+ }
600
+
554
601
  /**
555
602
  * @public
556
603
  */
@@ -929,14 +976,17 @@ export interface SocialId {
929
976
  export interface AccountInfo {
930
977
  timezone?: string
931
978
  locale?: string
979
+ tfaEnabled?: boolean
932
980
  }
933
981
 
934
982
  export type SocialKey = Pick<SocialId, 'type' | 'value'>
935
983
 
936
984
  export interface ClassCollaborators<T extends Doc> extends Doc {
937
985
  attachedTo: Ref<Class<T>>
986
+ allFields?: boolean // for all (PersonId | Ref<Employee> | PersonId[] | Ref<Employee>[]) attributes
938
987
  fields: (keyof T)[] // PersonId | Ref<Employee> | PersonId[] | Ref<Employee>[]
939
988
  provideSecurity?: boolean // If true, will provide security for collaborators
989
+ provideAttachedSecurity?: boolean // If true, will provide security for collaborators of attached doc
940
990
  }
941
991
 
942
992
  export interface Collaborator extends AttachedDoc {
@@ -947,3 +997,13 @@ export interface Collaborator extends AttachedDoc {
947
997
  * @public
948
998
  */
949
999
  export type IntegrationKind = string & { __IntegrationKind: true }
1000
+
1001
+ /**
1002
+ * @public
1003
+ */
1004
+ export enum WorkspaceAccountPermission {
1005
+ /**
1006
+ * Allows users to import documents to workspace.
1007
+ */
1008
+ ImportDocument = 'ImportDocument'
1009
+ }
@@ -14,7 +14,14 @@ export function getTypeOf (obj: any): string {
14
14
  return 'Array'
15
15
  }
16
16
 
17
- const stringTag = ste && obj[Symbol.toStringTag]
17
+ let stringTag: string | undefined
18
+ if (ste) {
19
+ try {
20
+ stringTag = obj[Symbol.toStringTag]
21
+ } catch {
22
+ stringTag = undefined
23
+ }
24
+ }
18
25
  if (typeof stringTag === 'string') {
19
26
  return stringTag
20
27
  }
@@ -31,7 +38,11 @@ export function getTypeOf (obj: any): string {
31
38
  if (objPrototype === null) {
32
39
  return 'Object'
33
40
  }
34
- return {}.toString.call(obj).slice(8, -1)
41
+ try {
42
+ return {}.toString.call(obj).slice(8, -1)
43
+ } catch {
44
+ return 'Object'
45
+ }
35
46
  }
36
47
 
37
48
  export function clone (
@@ -15,18 +15,23 @@
15
15
  import type { Asset, IntlString, Metadata, Plugin, StatusCode } from '@hcengineering/platform'
16
16
  import { plugin } from '@hcengineering/platform'
17
17
  import type { BenchmarkDoc } from './benchmark'
18
- import { AccountRole, TxAccessLevel } from './classes'
19
18
  import type {
20
19
  Account,
20
+ AccountUuid,
21
21
  AnyAttribute,
22
22
  ArrOf,
23
23
  Association,
24
24
  AttachedDoc,
25
+ AttributePermission,
25
26
  Blob,
26
27
  Class,
28
+ ClassCollaborators,
29
+ ClassPermission,
30
+ Collaborator,
27
31
  Collection,
28
32
  Configuration,
29
33
  ConfigurationElement,
34
+ CustomSequence,
30
35
  Doc,
31
36
  DomainIndexConfiguration,
32
37
  Enum,
@@ -38,6 +43,7 @@ import type {
38
43
  MarkupBlobRef,
39
44
  MigrationState,
40
45
  Mixin,
46
+ ModulePermissionGroup,
41
47
  Obj,
42
48
  Permission,
43
49
  PersonId,
@@ -47,9 +53,9 @@ import type {
47
53
  RefTo,
48
54
  RelatedDocument,
49
55
  Relation,
56
+ RelationMetadata,
50
57
  Role,
51
58
  Sequence,
52
- CustomSequence,
53
59
  Space,
54
60
  SpaceType,
55
61
  SpaceTypeDescriptor,
@@ -60,11 +66,9 @@ import type {
60
66
  TypeAny,
61
67
  TypedSpace,
62
68
  UserStatus,
63
- Version,
64
- AccountUuid,
65
- ClassCollaborators,
66
- Collaborator
69
+ Version
67
70
  } from './classes'
71
+ import { AccountRole, TxAccessLevel } from './classes'
68
72
  import { type Status, type StatusCategory } from './status'
69
73
  import type {
70
74
  Tx,
@@ -78,6 +82,7 @@ import type {
78
82
  TxUpdateDoc,
79
83
  TxWorkspaceEvent
80
84
  } from './tx'
85
+ import { VersionableClass } from './versioning'
81
86
 
82
87
  /**
83
88
  * @public
@@ -129,6 +134,8 @@ export default plugin(coreId, {
129
134
  SpaceType: '' as Ref<Class<SpaceType>>,
130
135
  Role: '' as Ref<Class<Role>>,
131
136
  Permission: '' as Ref<Class<Permission>>,
137
+ AttributePermission: '' as Ref<Class<AttributePermission>>,
138
+ ClassPermission: '' as Ref<Class<ClassPermission>>,
132
139
  Type: '' as Ref<Class<Type<any>>>,
133
140
  TypeRelation: '' as Ref<Class<Type<string>>>,
134
141
  TypeString: '' as Ref<Class<Type<string>>>,
@@ -170,10 +177,12 @@ export default plugin(coreId, {
170
177
  FullTextSearchContext: '' as Ref<Mixin<FullTextSearchContext>>,
171
178
  Association: '' as Ref<Class<Association>>,
172
179
  Relation: '' as Ref<Class<Relation>>,
180
+ RelationMetadata: '' as Ref<Class<RelationMetadata>>,
173
181
  Sequence: '' as Ref<Class<Sequence>>,
174
182
  CustomSequence: '' as Ref<Class<CustomSequence>>,
175
183
  ClassCollaborators: '' as Ref<Class<ClassCollaborators<Doc>>>,
176
- Collaborator: '' as Ref<Class<Collaborator>>
184
+ Collaborator: '' as Ref<Class<Collaborator>>,
185
+ ModulePermissionGroup: '' as Ref<Class<ModulePermissionGroup>>
177
186
  },
178
187
  icon: {
179
188
  TypeString: '' as Asset,
@@ -195,7 +204,8 @@ export default plugin(coreId, {
195
204
  IndexConfiguration: '' as Ref<Mixin<IndexingConfiguration<Doc>>>,
196
205
  SpacesTypeData: '' as Ref<Mixin<Space>>,
197
206
  TransientConfiguration: '' as Ref<Mixin<TransientConfiguration>>,
198
- TxAccessLevel: '' as Ref<Mixin<TxAccessLevel>>
207
+ TxAccessLevel: '' as Ref<Mixin<TxAccessLevel>>,
208
+ VersionableClass: '' as Ref<Mixin<VersionableClass>>
199
209
  },
200
210
  space: {
201
211
  Tx: '' as Ref<Space>,
@@ -271,6 +281,7 @@ export default plugin(coreId, {
271
281
  Account: '' as IntlString,
272
282
  StatusCategory: '' as IntlString,
273
283
  Rank: '' as IntlString,
284
+ Order: '' as IntlString,
274
285
  Members: '' as IntlString,
275
286
  Owners: '' as IntlString,
276
287
  Permission: '' as IntlString,
@@ -287,7 +298,12 @@ export default plugin(coreId, {
287
298
  UpdateSpaceDescription: '' as IntlString,
288
299
  ArchiveSpaceDescription: '' as IntlString,
289
300
  AutoJoin: '' as IntlString,
290
- AutoJoinDescr: '' as IntlString
301
+ AutoJoinDescr: '' as IntlString,
302
+ AutoJoinGuests: '' as IntlString,
303
+ AutoJoinGuestsDescr: '' as IntlString,
304
+ RBAC: '' as IntlString,
305
+ RBACDescr: '' as IntlString,
306
+ Version: '' as IntlString
291
307
  },
292
308
  descriptor: {
293
309
  SpacesType: '' as Ref<SpaceTypeDescriptor>
@@ -15,6 +15,7 @@
15
15
  import core from './component'
16
16
 
17
17
  export * from './classes'
18
+ export * from './autoJoinRoles'
18
19
  export * from './client'
19
20
  export * from './collaboration'
20
21
  export {
@@ -43,5 +44,6 @@ export * from './common'
43
44
  export * from './time'
44
45
  export * from './benchmark'
45
46
  export * from './collaborators'
47
+ export * from './versioning'
46
48
 
47
49
  export default core
@@ -159,7 +159,7 @@ export abstract class MemDb extends TxProcessor implements Storage {
159
159
  private async getAssociationValue<T extends Doc>(
160
160
  doc: T,
161
161
  associations: AssociationQuery[]
162
- ): Promise<Record<string, Doc[]>> {
162
+ ): Promise<Record<string, WithLookup<Doc>[]>> {
163
163
  const result: Record<string, Doc[]> = {}
164
164
  for (const association of associations) {
165
165
  const _id = association[0]
@@ -170,8 +170,11 @@ export abstract class MemDb extends TxProcessor implements Storage {
170
170
  const key2 = !isReverse ? 'docB' : 'docA'
171
171
  const _class = !isReverse ? assoc.classB : assoc.classA
172
172
  const relations = await this.findAll(core.class.Relation, { association: _id, [key]: doc._id })
173
- const objects = await this.findAll(_class, { _id: { $in: relations.map((r) => r[key2]) } })
174
- result[_id] = objects
173
+ let objects = await this.findAll(_class, { _id: { $in: relations.map((r) => r[key2]) } })
174
+ if (association[2] !== undefined) {
175
+ objects = toFindResult(await this.fillAssociations(objects, association[2]), objects.length)
176
+ }
177
+ result[`${_id}_${!isReverse ? 'b' : 'a'}`] = objects
175
178
  }
176
179
  return result
177
180
  }
@@ -246,6 +249,7 @@ export abstract class MemDb extends TxProcessor implements Storage {
246
249
  // We need to filter instances without mixin was set
247
250
  result = result.filter((r) => (r as any)[_class] !== undefined)
248
251
  }
252
+ if (options?.sort !== undefined) resultSort(result, options?.sort, _class, this.hierarchy, this)
249
253
  const total = result.length
250
254
  result = result.slice(0, options?.limit)
251
255
 
@@ -531,6 +531,17 @@ export class ApplyOperations extends TxOperations {
531
531
  if (typeof window === 'object' && window !== null && this.measureName != null) {
532
532
  console.log(`measure ${this.measureName}`, dnow - st, 'server time', result.serverTime)
533
533
  }
534
+ if (!result.success) {
535
+ console.warn('ops.commit() failed', {
536
+ scope: this.scope,
537
+ measureName: this.measureName,
538
+ matchCount: this.matches.length,
539
+ notMatchCount: this.notMatches.length,
540
+ txCount: this.txes.length,
541
+ matches: this.matches.map((m) => ({ _class: m._class, query: m.query })),
542
+ notMatches: this.notMatches.map((m) => ({ _class: m._class, query: m.query }))
543
+ })
544
+ }
534
545
  this.txes = []
535
546
  return {
536
547
  result: result.success,
@@ -114,6 +114,9 @@ const predicates: Record<string, PredicateFactory> = {
114
114
  $size: (o, propertyKey) => {
115
115
  return (docs) =>
116
116
  execPredicate(docs, propertyKey, (value) => {
117
+ if (value == null) {
118
+ return false
119
+ }
117
120
  if (!Array.isArray(value)) {
118
121
  throw new Error('$size predicate requires array')
119
122
  }
@@ -18,6 +18,7 @@ import type { Asset, Resource } from '@hcengineering/platform'
18
18
  import type { Association, AttachedDoc, Class, Doc, Domain, Ref, Space } from './classes'
19
19
  import type { Tx } from './tx'
20
20
  import type { KeysByType } from './utils'
21
+ import { VersionableDoc } from './versioning'
21
22
 
22
23
  export type ArraySizeSelector =
23
24
  | {
@@ -128,7 +129,7 @@ export type Projection<T extends Doc> = {
128
129
  [P in keyof T]?: 0 | 1
129
130
  }
130
131
 
131
- export type AssociationQuery = [Ref<Association>, 1 | -1]
132
+ export type AssociationQuery = [Ref<Association>, 1 | -1] | [Ref<Association>, 1 | -1, AssociationQuery[]]
132
133
 
133
134
  /**
134
135
  * @public
@@ -205,7 +206,7 @@ export type LookupData<T extends Doc> = Partial<RefsAsDocs<T>>
205
206
  */
206
207
  export type WithLookup<T extends Doc> = T & {
207
208
  $lookup?: LookupData<T>
208
- $associations?: Record<string, Doc[]>
209
+ $associations?: Record<string, WithLookup<Doc>[]>
209
210
  $source?: {
210
211
  $score: number // Score for document result
211
212
  [key: string]: any
@@ -269,7 +270,9 @@ export interface SearchResultDoc {
269
270
  description?: string
270
271
  emojiIcon?: string
271
272
  score?: number
272
- doc: Pick<Doc, '_id' | '_class' | 'createdOn'> & Partial<Pick<AttachedDoc, 'attachedTo' | 'attachedToClass'>>
273
+ doc: Pick<Doc, '_id' | '_class' | 'createdOn'> &
274
+ Partial<Pick<AttachedDoc, 'attachedTo' | 'attachedToClass'>> &
275
+ Partial<Pick<VersionableDoc, 'baseId'>>
273
276
  }
274
277
 
275
278
  /**
@@ -436,7 +436,10 @@ export abstract class TxProcessor implements WithTx {
436
436
  }
437
437
 
438
438
  static txHasUpdate<T extends Doc>(tx: TxUpdateDoc<T>, attribute: string): boolean {
439
- const ops = tx.operations
439
+ return TxProcessor.hasUpdate(tx.operations, attribute)
440
+ }
441
+
442
+ static hasUpdate<T extends Doc>(ops: DocumentUpdate<T>, attribute: string): boolean {
440
443
  if ((ops as any)[attribute] !== undefined) return true
441
444
  for (const op in ops) {
442
445
  if (op.startsWith('$')) {
@@ -211,7 +211,7 @@ export function fillDefaults<T extends Doc> (
211
211
  const baseClass = hierarchy.isDerived(_class, core.class.AttachedDoc) ? core.class.AttachedDoc : core.class.Doc
212
212
  const attributes = hierarchy.getAllAttributes(_class, baseClass)
213
213
  for (const attribute of attributes) {
214
- if (attribute[1].defaultValue !== undefined) {
214
+ if (attribute[1].defaultValue != null) {
215
215
  if ((object as any)[attribute[0]] === undefined) {
216
216
  // Clone default value as it might be an object (e.g. array)
217
217
  ;(object as any)[attribute[0]] = structuredClone(attribute[1].defaultValue)
@@ -0,0 +1,13 @@
1
+ import { Class, Doc, PersonId, Ref } from './classes'
2
+
3
+ export interface VersionableDoc extends Doc {
4
+ baseId?: Ref<Doc>
5
+ version?: number
6
+ isLatest?: boolean
7
+ docCreatedBy?: PersonId
8
+ readonly?: boolean
9
+ }
10
+
11
+ export interface VersionableClass extends Class<Doc> {
12
+ enabled: boolean
13
+ }
@@ -32,7 +32,7 @@ describe("performance", () => {
32
32
  console.log(` Per operation: ${(overhead / iterations).toFixed(4)}ms`);
33
33
  expect(metrics.measurements.operation).toBeDefined();
34
34
  expect(metrics.measurements.operation.operations).toBe(iterations);
35
- expect(overheadPercentage).toBeLessThan(200);
35
+ expect(overheadPercentage).toBeLessThan(400);
36
36
  });
37
37
  it("should measure overhead with deep nested contexts", async () => {
38
38
  const metrics = (0, import_metrics.newMetrics)();
@@ -122,7 +122,7 @@ describe("performance", () => {
122
122
  console.log(` Raw time: ${rawTime.toFixed(2)}ms`);
123
123
  console.log(` NoMetrics time: ${noMetricsTime.toFixed(2)}ms`);
124
124
  console.log(` Overhead: ${overhead.toFixed(2)}ms (${overheadPercentage.toFixed(2)}%)`);
125
- expect(overheadPercentage).toBeLessThan(50);
125
+ expect(overheadPercentage).toBeLessThan(100);
126
126
  });
127
127
  });
128
128
  describe("realistic workload simulation", () => {
@@ -151,7 +151,7 @@ describe("performance", () => {
151
151
  const aggregated = (0, import_metrics.metricsAggregate)(metrics, 10);
152
152
  console.log(` Collected operations: ${aggregated.measurements.request?.operations ?? 0}`);
153
153
  expect(aggregated.measurements.request).toBeDefined();
154
- expect(overheadPercentage).toBeLessThan(100);
154
+ expect(overheadPercentage).toBeLessThan(200);
155
155
  });
156
156
  });
157
157
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/__tests__/performance.test.ts"],
4
- "sourcesContent": ["import { MeasureMetricsContext, NoMetricsContext, noParamsLogger } from '../context'\nimport { newMetrics, metricsAggregate } from '../metrics'\nimport type { MeasureContext } from '../types'\n\ndescribe('performance', () => {\n describe('overhead measurement', () => {\n // Reduced iterations to fit within 10 seconds total test time\n const iterations = 100\n const depth = 5\n\n it('should measure overhead of with() vs raw execution', async () => {\n // Baseline: raw execution without measurement\n const baselineStart = performance.now()\n for (let i = 0; i < iterations; i++) {\n await simulateWork(1)\n }\n const baselineTime = performance.now() - baselineStart\n\n // With measurement context\n const metrics = newMetrics()\n const ctx = new MeasureMetricsContext('root', {}, {}, metrics, noParamsLogger)\n\n const measuredStart = performance.now()\n for (let i = 0; i < iterations; i++) {\n await ctx.with('operation', { iteration: i }, async () => {\n await simulateWork(1)\n })\n }\n const measuredTime = performance.now() - measuredStart\n\n const overhead = measuredTime - baselineTime\n const overheadPercentage = (overhead / baselineTime) * 100\n\n console.log(`\\n\uD83D\uDCCA Overhead Analysis (${iterations} iterations):`)\n console.log(` Baseline time: ${baselineTime.toFixed(2)}ms`)\n console.log(` Measured time: ${measuredTime.toFixed(2)}ms`)\n console.log(` Overhead: ${overhead.toFixed(2)}ms (${overheadPercentage.toFixed(2)}%)`)\n console.log(` Per operation: ${(overhead / iterations).toFixed(4)}ms`)\n\n expect(metrics.measurements.operation).toBeDefined()\n expect(metrics.measurements.operation.operations).toBe(iterations)\n\n // Overhead should be reasonable (typically < 50% for simple operations)\n // This is informational rather than a strict assertion\n expect(overheadPercentage).toBeLessThan(200)\n })\n\n it('should measure overhead with deep nested contexts', async () => {\n const metrics = newMetrics()\n const ctx = new MeasureMetricsContext('root', {}, {}, metrics, noParamsLogger)\n\n // Baseline: single level\n const singleLevelStart = performance.now()\n for (let i = 0; i < iterations; i++) {\n await ctx.with('shallow', {}, async () => {\n await simulateWork(1)\n })\n }\n const singleLevelTime = performance.now() - singleLevelStart\n\n // Deep nesting\n const deepStart = performance.now()\n for (let i = 0; i < iterations; i++) {\n await deepNestedExecution(ctx, depth, 1)\n }\n const deepTime = performance.now() - deepStart\n\n const nestingOverhead = deepTime - singleLevelTime\n const overheadPerLevel = nestingOverhead / (iterations * depth)\n\n console.log(`\\n\uD83D\uDCCA Deep Nesting Overhead (${iterations} iterations, depth=${depth}):`)\n console.log(` Single level: ${singleLevelTime.toFixed(2)}ms`)\n console.log(` Deep nested: ${deepTime.toFixed(2)}ms`)\n console.log(` Nesting overhead: ${nestingOverhead.toFixed(2)}ms`)\n console.log(` Per level: ${overheadPerLevel.toFixed(4)}ms`)\n\n expect(metrics.measurements.shallow).toBeDefined()\n expect(metrics.measurements.level0).toBeDefined()\n })\n\n it('should measure overhead with complex parameter tracking', async () => {\n const metrics = newMetrics()\n const ctx = new MeasureMetricsContext('root', {}, {}, metrics, noParamsLogger)\n\n // Simple params\n const simpleStart = performance.now()\n for (let i = 0; i < iterations; i++) {\n await ctx.with('simple', { id: i }, async () => {\n await simulateWork(1)\n })\n }\n const simpleTime = performance.now() - simpleStart\n\n // Complex params with multiple tracked values\n const complexStart = performance.now()\n for (let i = 0; i < iterations; i++) {\n await ctx.with(\n 'complex',\n {\n method: i % 3 === 0 ? 'GET' : i % 3 === 1 ? 'POST' : 'PUT',\n status: i % 2 === 0 ? 200 : 404,\n cached: i % 4 === 0\n },\n async () => {\n await simulateWork(1)\n },\n {\n userId: `user_${i % 10}`,\n endpoint: `/api/v1/resource/${i % 5}`,\n timestamp: Date.now()\n }\n )\n }\n const complexTime = performance.now() - complexStart\n\n const paramOverhead = complexTime - simpleTime\n\n console.log(`\\n\uD83D\uDCCA Parameter Tracking Overhead (${iterations} iterations):`)\n console.log(` Simple params: ${simpleTime.toFixed(2)}ms`)\n console.log(` Complex params: ${complexTime.toFixed(2)}ms`)\n console.log(` Param overhead: ${paramOverhead.toFixed(2)}ms`)\n console.log(` Per operation: ${(paramOverhead / iterations).toFixed(4)}ms`)\n\n expect(metrics.measurements.simple).toBeDefined()\n expect(metrics.measurements.complex).toBeDefined()\n expect(Object.keys(metrics.measurements.complex.params).length).toBeGreaterThan(0)\n })\n\n it('should measure overhead with NoMetricsContext', async () => {\n // NoMetricsContext should have minimal overhead\n const noMetricsCtx = new NoMetricsContext(noParamsLogger)\n\n const start = performance.now()\n for (let i = 0; i < iterations; i++) {\n await noMetricsCtx.with('operation', { iteration: i }, async () => {\n await simulateWork(1)\n })\n }\n const noMetricsTime = performance.now() - start\n\n // Compare with raw execution\n const rawStart = performance.now()\n for (let i = 0; i < iterations; i++) {\n await simulateWork(1)\n }\n const rawTime = performance.now() - rawStart\n\n const overhead = noMetricsTime - rawTime\n const overheadPercentage = (overhead / rawTime) * 100\n\n console.log(`\\n\uD83D\uDCCA NoMetricsContext Overhead (${iterations} iterations):`)\n console.log(` Raw time: ${rawTime.toFixed(2)}ms`)\n console.log(` NoMetrics time: ${noMetricsTime.toFixed(2)}ms`)\n console.log(` Overhead: ${overhead.toFixed(2)}ms (${overheadPercentage.toFixed(2)}%)`)\n\n // NoMetricsContext should have very low overhead\n expect(overheadPercentage).toBeLessThan(50)\n })\n })\n\n describe('realistic workload simulation', () => {\n it('should measure overhead in complex realistic scenario', async () => {\n const metrics = newMetrics()\n const ctx = new MeasureMetricsContext('app', { service: 'api' }, {}, metrics, noParamsLogger)\n\n const requests = 50\n const baselineStart = performance.now()\n\n // Simulate without metrics\n for (let i = 0; i < requests; i++) {\n await simulateAPIRequest(null, i)\n }\n const baselineTime = performance.now() - baselineStart\n\n // Reset for measured run\n const measuredStart = performance.now()\n\n // Simulate with metrics\n for (let i = 0; i < requests; i++) {\n await simulateAPIRequest(ctx, i)\n }\n const measuredTime = performance.now() - measuredStart\n\n const overhead = measuredTime - baselineTime\n const overheadPercentage = (overhead / baselineTime) * 100\n\n console.log(`\\n\uD83D\uDCCA Realistic Workload Analysis (${requests} API requests):`)\n console.log(` Baseline: ${baselineTime.toFixed(2)}ms`)\n console.log(` With metrics: ${measuredTime.toFixed(2)}ms`)\n console.log(` Overhead: ${overhead.toFixed(2)}ms (${overheadPercentage.toFixed(2)}%)`)\n console.log(` Per request: ${(overhead / requests).toFixed(4)}ms`)\n\n // Check metrics structure\n const aggregated = metricsAggregate(metrics, 10)\n console.log(` Collected operations: ${aggregated.measurements.request?.operations ?? 0}`)\n\n expect(aggregated.measurements.request).toBeDefined()\n expect(overheadPercentage).toBeLessThan(100) // Should be less than 100% overhead\n })\n })\n})\n\n// Helper functions\n\nasync function simulateWork (durationMs: number): Promise<void> {\n const end = performance.now() + durationMs\n while (performance.now() < end) {\n // Busy wait to simulate work\n const r = Math.random() * Math.random()\n expect(r).toBeGreaterThanOrEqual(0)\n }\n}\n\nasync function deepNestedExecution (\n ctx: MeasureContext,\n depth: number,\n workMs: number,\n currentLevel: number = 0\n): Promise<void> {\n if (currentLevel >= depth) {\n await simulateWork(workMs)\n return\n }\n\n await ctx.with(`level${currentLevel}`, { level: currentLevel }, async (childCtx) => {\n await deepNestedExecution(childCtx, depth, workMs, currentLevel + 1)\n })\n}\n\nasync function simulateAPIRequest (ctx: MeasureContext | null, requestId: number): Promise<void> {\n const method = ['GET', 'POST', 'PUT'][requestId % 3]\n const endpoint = `/api/resource/${requestId % 10}`\n\n if (ctx === null) {\n // No metrics version\n await simulateWork(1)\n // Simulate DB query\n await simulateWork(2)\n // Simulate processing\n await simulateWork(1)\n return\n }\n\n // With metrics version\n await ctx.with('request', { method, endpoint }, async (reqCtx) => {\n await reqCtx.with('auth', { userId: `user_${requestId % 50}` }, async () => {\n await simulateWork(1)\n })\n\n await reqCtx.with('database', { query: 'SELECT' }, async (dbCtx) => {\n await dbCtx.with('query_execution', {}, async () => {\n await simulateWork(2)\n })\n })\n\n await reqCtx.with('processing', { items: requestId % 20 }, async () => {\n await simulateWork(1)\n })\n })\n}\n"],
5
- "mappings": ";;;AAAA,qBAAwE;AACxE,qBAA6C;AAG7C,SAAS,eAAe,MAAM;AAC5B,WAAS,wBAAwB,MAAM;AAErC,UAAM,aAAa;AACnB,UAAM,QAAQ;AAEd,OAAG,sDAAsD,YAAY;AAEnE,YAAM,gBAAgB,YAAY,IAAI;AACtC,eAAS,IAAI,GAAG,IAAI,YAAY,KAAK;AACnC,cAAM,aAAa,CAAC;AAAA,MACtB;AACA,YAAM,eAAe,YAAY,IAAI,IAAI;AAGzC,YAAM,cAAU,2BAAW;AAC3B,YAAM,MAAM,IAAI,qCAAsB,QAAQ,CAAC,GAAG,CAAC,GAAG,SAAS,6BAAc;AAE7E,YAAM,gBAAgB,YAAY,IAAI;AACtC,eAAS,IAAI,GAAG,IAAI,YAAY,KAAK;AACnC,cAAM,IAAI,KAAK,aAAa,EAAE,WAAW,EAAE,GAAG,YAAY;AACxD,gBAAM,aAAa,CAAC;AAAA,QACtB,CAAC;AAAA,MACH;AACA,YAAM,eAAe,YAAY,IAAI,IAAI;AAEzC,YAAM,WAAW,eAAe;AAChC,YAAM,qBAAsB,WAAW,eAAgB;AAEvD,cAAQ,IAAI;AAAA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AAAA,EACpC;AACF;AAPe;AASf,eAAe,oBACb,KACA,OACA,QACA,eAAuB,GACR;AACf,MAAI,gBAAgB,OAAO;AACzB,UAAM,aAAa,MAAM;AACzB;AAAA,EACF;AAEA,QAAM,IAAI,KAAK,QAAQ,YAAY,IAAI,EAAE,OAAO,aAAa,GAAG,OAAO,aAAa;AAClF,UAAM,oBAAoB,UAAU,OAAO,QAAQ,eAAe,CAAC;AAAA,EACrE,CAAC;AACH;AAde;AAgBf,eAAe,mBAAoB,KAA4B,WAAkC;AAC/F,QAAM,SAAS,CAAC,OAAO,QAAQ,KAAK,EAAE,YAAY,CAAC;AACnD,QAAM,WAAW,iBAAiB,YAAY,EAAE;AAEhD,MAAI,QAAQ,MAAM;AAEhB,UAAM,aAAa,CAAC;AAEpB,UAAM,aAAa,CAAC;AAEpB,UAAM,aAAa,CAAC;AACpB;AAAA,EACF;AAGA,QAAM,IAAI,KAAK,WAAW,EAAE,QAAQ,SAAS,GAAG,OAAO,WAAW;AAChE,UAAM,OAAO,KAAK,QAAQ,EAAE,QAAQ,QAAQ,YAAY,EAAE,GAAG,GAAG,YAAY;AAC1E,YAAM,aAAa,CAAC;AAAA,IACtB,CAAC;AAED,UAAM,OAAO,KAAK,YAAY,EAAE,OAAO,SAAS,GAAG,OAAO,UAAU;AAClE,YAAM,MAAM,KAAK,mBAAmB,CAAC,GAAG,YAAY;AAClD,cAAM,aAAa,CAAC;AAAA,MACtB,CAAC;AAAA,IACH,CAAC;AAED,UAAM,OAAO,KAAK,cAAc,EAAE,OAAO,YAAY,GAAG,GAAG,YAAY;AACrE,YAAM,aAAa,CAAC;AAAA,IACtB,CAAC;AAAA,EACH,CAAC;AACH;AA9Be;",
4
+ "sourcesContent": ["import { MeasureMetricsContext, NoMetricsContext, noParamsLogger } from '../context'\nimport { newMetrics, metricsAggregate } from '../metrics'\nimport type { MeasureContext } from '../types'\n\ndescribe('performance', () => {\n describe('overhead measurement', () => {\n // Reduced iterations to fit within 10 seconds total test time\n const iterations = 100\n const depth = 5\n\n it('should measure overhead of with() vs raw execution', async () => {\n // Baseline: raw execution without measurement\n const baselineStart = performance.now()\n for (let i = 0; i < iterations; i++) {\n await simulateWork(1)\n }\n const baselineTime = performance.now() - baselineStart\n\n // With measurement context\n const metrics = newMetrics()\n const ctx = new MeasureMetricsContext('root', {}, {}, metrics, noParamsLogger)\n\n const measuredStart = performance.now()\n for (let i = 0; i < iterations; i++) {\n await ctx.with('operation', { iteration: i }, async () => {\n await simulateWork(1)\n })\n }\n const measuredTime = performance.now() - measuredStart\n\n const overhead = measuredTime - baselineTime\n const overheadPercentage = (overhead / baselineTime) * 100\n\n console.log(`\\n\uD83D\uDCCA Overhead Analysis (${iterations} iterations):`)\n console.log(` Baseline time: ${baselineTime.toFixed(2)}ms`)\n console.log(` Measured time: ${measuredTime.toFixed(2)}ms`)\n console.log(` Overhead: ${overhead.toFixed(2)}ms (${overheadPercentage.toFixed(2)}%)`)\n console.log(` Per operation: ${(overhead / iterations).toFixed(4)}ms`)\n\n expect(metrics.measurements.operation).toBeDefined()\n expect(metrics.measurements.operation.operations).toBe(iterations)\n\n // Overhead should be reasonable (typically < 50% for simple operations)\n // This is informational rather than a strict assertion\n expect(overheadPercentage).toBeLessThan(400)\n })\n\n it('should measure overhead with deep nested contexts', async () => {\n const metrics = newMetrics()\n const ctx = new MeasureMetricsContext('root', {}, {}, metrics, noParamsLogger)\n\n // Baseline: single level\n const singleLevelStart = performance.now()\n for (let i = 0; i < iterations; i++) {\n await ctx.with('shallow', {}, async () => {\n await simulateWork(1)\n })\n }\n const singleLevelTime = performance.now() - singleLevelStart\n\n // Deep nesting\n const deepStart = performance.now()\n for (let i = 0; i < iterations; i++) {\n await deepNestedExecution(ctx, depth, 1)\n }\n const deepTime = performance.now() - deepStart\n\n const nestingOverhead = deepTime - singleLevelTime\n const overheadPerLevel = nestingOverhead / (iterations * depth)\n\n console.log(`\\n\uD83D\uDCCA Deep Nesting Overhead (${iterations} iterations, depth=${depth}):`)\n console.log(` Single level: ${singleLevelTime.toFixed(2)}ms`)\n console.log(` Deep nested: ${deepTime.toFixed(2)}ms`)\n console.log(` Nesting overhead: ${nestingOverhead.toFixed(2)}ms`)\n console.log(` Per level: ${overheadPerLevel.toFixed(4)}ms`)\n\n expect(metrics.measurements.shallow).toBeDefined()\n expect(metrics.measurements.level0).toBeDefined()\n })\n\n it('should measure overhead with complex parameter tracking', async () => {\n const metrics = newMetrics()\n const ctx = new MeasureMetricsContext('root', {}, {}, metrics, noParamsLogger)\n\n // Simple params\n const simpleStart = performance.now()\n for (let i = 0; i < iterations; i++) {\n await ctx.with('simple', { id: i }, async () => {\n await simulateWork(1)\n })\n }\n const simpleTime = performance.now() - simpleStart\n\n // Complex params with multiple tracked values\n const complexStart = performance.now()\n for (let i = 0; i < iterations; i++) {\n await ctx.with(\n 'complex',\n {\n method: i % 3 === 0 ? 'GET' : i % 3 === 1 ? 'POST' : 'PUT',\n status: i % 2 === 0 ? 200 : 404,\n cached: i % 4 === 0\n },\n async () => {\n await simulateWork(1)\n },\n {\n userId: `user_${i % 10}`,\n endpoint: `/api/v1/resource/${i % 5}`,\n timestamp: Date.now()\n }\n )\n }\n const complexTime = performance.now() - complexStart\n\n const paramOverhead = complexTime - simpleTime\n\n console.log(`\\n\uD83D\uDCCA Parameter Tracking Overhead (${iterations} iterations):`)\n console.log(` Simple params: ${simpleTime.toFixed(2)}ms`)\n console.log(` Complex params: ${complexTime.toFixed(2)}ms`)\n console.log(` Param overhead: ${paramOverhead.toFixed(2)}ms`)\n console.log(` Per operation: ${(paramOverhead / iterations).toFixed(4)}ms`)\n\n expect(metrics.measurements.simple).toBeDefined()\n expect(metrics.measurements.complex).toBeDefined()\n expect(Object.keys(metrics.measurements.complex.params).length).toBeGreaterThan(0)\n })\n\n it('should measure overhead with NoMetricsContext', async () => {\n // NoMetricsContext should have minimal overhead\n const noMetricsCtx = new NoMetricsContext(noParamsLogger)\n\n const start = performance.now()\n for (let i = 0; i < iterations; i++) {\n await noMetricsCtx.with('operation', { iteration: i }, async () => {\n await simulateWork(1)\n })\n }\n const noMetricsTime = performance.now() - start\n\n // Compare with raw execution\n const rawStart = performance.now()\n for (let i = 0; i < iterations; i++) {\n await simulateWork(1)\n }\n const rawTime = performance.now() - rawStart\n\n const overhead = noMetricsTime - rawTime\n const overheadPercentage = (overhead / rawTime) * 100\n\n console.log(`\\n\uD83D\uDCCA NoMetricsContext Overhead (${iterations} iterations):`)\n console.log(` Raw time: ${rawTime.toFixed(2)}ms`)\n console.log(` NoMetrics time: ${noMetricsTime.toFixed(2)}ms`)\n console.log(` Overhead: ${overhead.toFixed(2)}ms (${overheadPercentage.toFixed(2)}%)`)\n\n // NoMetricsContext should have very low overhead\n expect(overheadPercentage).toBeLessThan(100)\n })\n })\n\n describe('realistic workload simulation', () => {\n it('should measure overhead in complex realistic scenario', async () => {\n const metrics = newMetrics()\n const ctx = new MeasureMetricsContext('app', { service: 'api' }, {}, metrics, noParamsLogger)\n\n const requests = 50\n const baselineStart = performance.now()\n\n // Simulate without metrics\n for (let i = 0; i < requests; i++) {\n await simulateAPIRequest(null, i)\n }\n const baselineTime = performance.now() - baselineStart\n\n // Reset for measured run\n const measuredStart = performance.now()\n\n // Simulate with metrics\n for (let i = 0; i < requests; i++) {\n await simulateAPIRequest(ctx, i)\n }\n const measuredTime = performance.now() - measuredStart\n\n const overhead = measuredTime - baselineTime\n const overheadPercentage = (overhead / baselineTime) * 100\n\n console.log(`\\n\uD83D\uDCCA Realistic Workload Analysis (${requests} API requests):`)\n console.log(` Baseline: ${baselineTime.toFixed(2)}ms`)\n console.log(` With metrics: ${measuredTime.toFixed(2)}ms`)\n console.log(` Overhead: ${overhead.toFixed(2)}ms (${overheadPercentage.toFixed(2)}%)`)\n console.log(` Per request: ${(overhead / requests).toFixed(4)}ms`)\n\n // Check metrics structure\n const aggregated = metricsAggregate(metrics, 10)\n console.log(` Collected operations: ${aggregated.measurements.request?.operations ?? 0}`)\n\n expect(aggregated.measurements.request).toBeDefined()\n expect(overheadPercentage).toBeLessThan(200) // Should be less than 100% overhead\n })\n })\n})\n\n// Helper functions\n\nasync function simulateWork (durationMs: number): Promise<void> {\n const end = performance.now() + durationMs\n while (performance.now() < end) {\n // Busy wait to simulate work\n const r = Math.random() * Math.random()\n expect(r).toBeGreaterThanOrEqual(0)\n }\n}\n\nasync function deepNestedExecution (\n ctx: MeasureContext,\n depth: number,\n workMs: number,\n currentLevel: number = 0\n): Promise<void> {\n if (currentLevel >= depth) {\n await simulateWork(workMs)\n return\n }\n\n await ctx.with(`level${currentLevel}`, { level: currentLevel }, async (childCtx) => {\n await deepNestedExecution(childCtx, depth, workMs, currentLevel + 1)\n })\n}\n\nasync function simulateAPIRequest (ctx: MeasureContext | null, requestId: number): Promise<void> {\n const method = ['GET', 'POST', 'PUT'][requestId % 3]\n const endpoint = `/api/resource/${requestId % 10}`\n\n if (ctx === null) {\n // No metrics version\n await simulateWork(1)\n // Simulate DB query\n await simulateWork(2)\n // Simulate processing\n await simulateWork(1)\n return\n }\n\n // With metrics version\n await ctx.with('request', { method, endpoint }, async (reqCtx) => {\n await reqCtx.with('auth', { userId: `user_${requestId % 50}` }, async () => {\n await simulateWork(1)\n })\n\n await reqCtx.with('database', { query: 'SELECT' }, async (dbCtx) => {\n await dbCtx.with('query_execution', {}, async () => {\n await simulateWork(2)\n })\n })\n\n await reqCtx.with('processing', { items: requestId % 20 }, async () => {\n await simulateWork(1)\n })\n })\n}\n"],
5
+ "mappings": ";;;AAAA,qBAAwE;AACxE,qBAA6C;AAG7C,SAAS,eAAe,MAAM;AAC5B,WAAS,wBAAwB,MAAM;AAErC,UAAM,aAAa;AACnB,UAAM,QAAQ;AAEd,OAAG,sDAAsD,YAAY;AAEnE,YAAM,gBAAgB,YAAY,IAAI;AACtC,eAAS,IAAI,GAAG,IAAI,YAAY,KAAK;AACnC,cAAM,aAAa,CAAC;AAAA,MACtB;AACA,YAAM,eAAe,YAAY,IAAI,IAAI;AAGzC,YAAM,cAAU,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CAAC,GAAG,YAAY;AAClD,cAAM,aAAa,CAAC;AAAA,MACtB,CAAC;AAAA,IACH,CAAC;AAED,UAAM,OAAO,KAAK,cAAc,EAAE,OAAO,YAAY,GAAG,GAAG,YAAY;AACrE,YAAM,aAAa,CAAC;AAAA,IACtB,CAAC;AAAA,EACH,CAAC;AACH;AA9Be;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hcengineering/measurements",
3
- "version": "0.7.18",
3
+ "version": "0.7.423",
4
4
  "main": "lib/index.js",
5
5
  "svelte": "src/index.ts",
6
6
  "types": "types/index.d.ts",
@@ -16,8 +16,18 @@
16
16
  ],
17
17
  "author": "Anticrm Platform Contributors",
18
18
  "license": "EPL-2.0",
19
+ "scripts": {
20
+ "build": "compile",
21
+ "build:watch": "compile",
22
+ "test": "jest --passWithNoTests --silent",
23
+ "format": "format src",
24
+ "_phase:build": "compile transpile src",
25
+ "_phase:test": "jest --passWithNoTests --silent",
26
+ "_phase:format": "format src",
27
+ "_phase:validate": "compile validate"
28
+ },
19
29
  "devDependencies": {
20
- "@hcengineering/platform-rig": "^0.7.19",
30
+ "@hcengineering/platform-rig": "^0.7.423",
21
31
  "jest": "^29.7.0",
22
32
  "ts-jest": "^29.1.1",
23
33
  "@types/jest": "^29.5.5",
@@ -30,7 +40,10 @@
30
40
  "eslint-plugin-promise": "^6.1.1",
31
41
  "eslint-plugin-n": "^15.4.0"
32
42
  },
33
- "repository": "https://github.com/hcengineering/platform",
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "git+https://github.com/hcengineering/platform.git"
46
+ },
34
47
  "exports": {
35
48
  ".": {
36
49
  "types": "./types/index.d.ts",
@@ -40,15 +53,5 @@
40
53
  },
41
54
  "publishConfig": {
42
55
  "access": "public"
43
- },
44
- "scripts": {
45
- "build": "compile",
46
- "build:watch": "compile",
47
- "test": "jest --passWithNoTests --silent",
48
- "format": "format src",
49
- "_phase:build": "compile transpile src",
50
- "_phase:test": "jest --passWithNoTests --silent",
51
- "_phase:format": "format src",
52
- "_phase:validate": "compile validate"
53
56
  }
54
- }
57
+ }
@@ -42,7 +42,7 @@ describe('performance', () => {
42
42
 
43
43
  // Overhead should be reasonable (typically < 50% for simple operations)
44
44
  // This is informational rather than a strict assertion
45
- expect(overheadPercentage).toBeLessThan(200)
45
+ expect(overheadPercentage).toBeLessThan(400)
46
46
  })
47
47
 
48
48
  it('should measure overhead with deep nested contexts', async () => {
@@ -154,7 +154,7 @@ describe('performance', () => {
154
154
  console.log(` Overhead: ${overhead.toFixed(2)}ms (${overheadPercentage.toFixed(2)}%)`)
155
155
 
156
156
  // NoMetricsContext should have very low overhead
157
- expect(overheadPercentage).toBeLessThan(50)
157
+ expect(overheadPercentage).toBeLessThan(100)
158
158
  })
159
159
  })
160
160
 
@@ -195,7 +195,7 @@ describe('performance', () => {
195
195
  console.log(` Collected operations: ${aggregated.measurements.request?.operations ?? 0}`)
196
196
 
197
197
  expect(aggregated.measurements.request).toBeDefined()
198
- expect(overheadPercentage).toBeLessThan(100) // Should be less than 100% overhead
198
+ expect(overheadPercentage).toBeLessThan(200) // Should be less than 100% overhead
199
199
  })
200
200
  })
201
201
  })