@bgx4k3p/huly-mcp-server 2.2.4 → 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 +1 -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
@@ -213,6 +213,13 @@ class AccountClientImpl {
213
213
  };
214
214
  await this.rpc(request);
215
215
  }
216
+ async checkHasPassword() {
217
+ const request = {
218
+ method: "checkHasPassword",
219
+ params: {}
220
+ };
221
+ return await this.rpc(request);
222
+ }
216
223
  async changePassword(oldPassword, newPassword) {
217
224
  const request = {
218
225
  method: "changePassword",
@@ -220,6 +227,13 @@ class AccountClientImpl {
220
227
  };
221
228
  await this.rpc(request);
222
229
  }
230
+ async requestPasswordSetup() {
231
+ const request = {
232
+ method: "requestPasswordSetup",
233
+ params: {}
234
+ };
235
+ await this.rpc(request);
236
+ }
223
237
  async updatePasswordAgingRule(days) {
224
238
  const request = {
225
239
  method: "updatePasswordAgingRule",
@@ -262,6 +276,13 @@ class AccountClientImpl {
262
276
  };
263
277
  return await this.rpc(request);
264
278
  }
279
+ async joinByToken(inviteId) {
280
+ const request = {
281
+ method: "joinByToken",
282
+ params: { inviteId }
283
+ };
284
+ return await this.rpc(request);
285
+ }
265
286
  async checkAutoJoin(inviteId, firstName, lastName) {
266
287
  const request = {
267
288
  method: "checkAutoJoin",
@@ -269,6 +290,13 @@ class AccountClientImpl {
269
290
  };
270
291
  return await this.rpc(request);
271
292
  }
293
+ async getInviteInfo(inviteId) {
294
+ const request = {
295
+ method: "getInviteInfo",
296
+ params: { inviteId }
297
+ };
298
+ return await this.rpc(request);
299
+ }
272
300
  async getWorkspacesInfo(ids) {
273
301
  const request = {
274
302
  method: "getWorkspacesInfo",
@@ -777,6 +805,64 @@ class AccountClientImpl {
777
805
  params: subscription
778
806
  });
779
807
  }
808
+ async batchAssignWorkspacePermission(params) {
809
+ await this._rpc({
810
+ method: "batchAssignWorkspacePermission",
811
+ params
812
+ });
813
+ }
814
+ async batchRevokeWorkspacePermission(params) {
815
+ await this._rpc({
816
+ method: "batchRevokeWorkspacePermission",
817
+ params
818
+ });
819
+ }
820
+ async hasWorkspacePermission(params) {
821
+ return await this._rpc({
822
+ method: "hasWorkspacePermission",
823
+ params
824
+ });
825
+ }
826
+ async getWorkspacePermissions(params) {
827
+ return await this._rpc({
828
+ method: "getWorkspacePermissions",
829
+ params
830
+ });
831
+ }
832
+ async getWorkspaceUsersWithPermission(params) {
833
+ return await this._rpc({
834
+ method: "getWorkspaceUsersWithPermission",
835
+ params
836
+ });
837
+ }
838
+ async verify2fa(code) {
839
+ const request = {
840
+ method: "verify2fa",
841
+ params: { code }
842
+ };
843
+ return await this.rpc(request);
844
+ }
845
+ async generate2faSecret() {
846
+ const request = {
847
+ method: "generate2faSecret",
848
+ params: {}
849
+ };
850
+ return await this.rpc(request);
851
+ }
852
+ async enable2fa(secret, code) {
853
+ const request = {
854
+ method: "enable2fa",
855
+ params: { secret, code }
856
+ };
857
+ await this.rpc(request);
858
+ }
859
+ async disable2fa(code) {
860
+ const request = {
861
+ method: "disable2fa",
862
+ params: { code }
863
+ };
864
+ await this.rpc(request);
865
+ }
780
866
  }
781
867
  function withRetry(f, shouldFail, intervalMs = 25) {
782
868
  return async function(...params) {
@@ -798,15 +884,14 @@ function withRetry(f, shouldFail, intervalMs = 25) {
798
884
  };
799
885
  }
800
886
  __name(withRetry, "withRetry");
801
- const connectionErrorCodes = ["ECONNRESET", "ECONNREFUSED", "ENOTFOUND"];
802
887
  function withRetryUntilTimeout(f, timeoutMs = 5e3) {
803
888
  const timeout = Date.now() + timeoutMs;
804
- const shouldFail = /* @__PURE__ */ __name((err) => !connectionErrorCodes.includes(err?.cause?.code) || timeout < Date.now(), "shouldFail");
889
+ const shouldFail = /* @__PURE__ */ __name((err) => !(0, import_utils.isNetworkError)(err) || timeout < Date.now(), "shouldFail");
805
890
  return withRetry(f, shouldFail);
806
891
  }
807
892
  __name(withRetryUntilTimeout, "withRetryUntilTimeout");
808
893
  function withRetryUntilMaxAttempts(f, maxAttempts = 5) {
809
- const shouldFail = /* @__PURE__ */ __name((err, attempt) => !connectionErrorCodes.includes(err?.cause?.code) || attempt === maxAttempts, "shouldFail");
894
+ const shouldFail = /* @__PURE__ */ __name((err, attempt) => !(0, import_utils.isNetworkError)(err) || attempt === maxAttempts, "shouldFail");
810
895
  return withRetry(f, shouldFail);
811
896
  }
812
897
  __name(withRetryUntilMaxAttempts, "withRetryUntilMaxAttempts");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/client.ts"],
4
- "sourcesContent": ["//\n// Copyright \u00A9 2024 Hardcore Engineering Inc.\n//\n// Licensed under the Eclipse Public License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License. You may\n// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\nimport {\n type AccountInfo,\n type AccountRole,\n type AccountUuid,\n type BackupStatus,\n concatLink,\n Data,\n type Person,\n type PersonId,\n type PersonInfo,\n type PersonUuid,\n type SocialIdType,\n Version,\n type UsageStatus,\n type WorkspaceInfoWithStatus,\n type WorkspaceMemberInfo,\n WorkspaceMode,\n type WorkspaceUserOperation,\n type WorkspaceUuid\n} from '@hcengineering/core'\nimport platform, { PlatformError, Severity, Status } from '@hcengineering/platform'\nimport type {\n AccountAggregatedInfo,\n Integration,\n IntegrationKey,\n IntegrationSecret,\n IntegrationSecretKey,\n LoginInfo,\n LoginInfoByToken,\n LoginInfoRequestData,\n LoginInfoWithWorkspaces,\n MailboxInfo,\n MailboxOptions,\n MailboxSecret,\n OtpInfo,\n PersonWithProfile,\n ProviderInfo,\n RegionInfo,\n SocialId,\n Subscription,\n SubscriptionData,\n UserProfile,\n WorkspaceLoginInfo,\n WorkspaceOperation\n} from './types'\nimport { getClientTimezone } from './utils'\n\n/** @public */\nexport interface AccountClient {\n // Static methods\n getProviders: () => Promise<ProviderInfo[]>\n\n // RPC\n getUserWorkspaces: () => Promise<WorkspaceInfoWithStatus[]>\n selectWorkspace: (\n workspaceUrl: string,\n kind?: 'external' | 'internal' | 'byregion',\n externalRegions?: string[]\n ) => Promise<WorkspaceLoginInfo>\n validateOtp: (email: string, code: string, password?: string, action?: 'verify') => Promise<LoginInfo>\n loginOtp: (email: string) => Promise<OtpInfo>\n getLoginInfoByToken: (data?: LoginInfoRequestData) => Promise<LoginInfoByToken>\n getLoginWithWorkspaceInfo: () => Promise<LoginInfoWithWorkspaces>\n restorePassword: (password: string) => Promise<LoginInfo>\n confirm: () => Promise<LoginInfo>\n requestPasswordReset: (email: string) => Promise<void>\n sendInvite: (email: string, role: AccountRole) => Promise<void>\n resendInvite: (email: string, role: AccountRole) => Promise<void>\n createInviteLink: (\n email: string,\n role: AccountRole,\n autoJoin: boolean,\n firstName: string,\n lastName: string,\n navigateUrl?: string,\n expHours?: number\n ) => Promise<string>\n leaveWorkspace: (account: AccountUuid) => Promise<LoginInfo | null>\n changeUsername: (first: string, last: string) => Promise<void>\n changePassword: (oldPassword: string, newPassword: string) => Promise<void>\n signUpJoin: (\n email: string,\n password: string,\n first: string,\n last: string,\n inviteId: string,\n workspaceUrl: string\n ) => Promise<WorkspaceLoginInfo>\n join: (email: string, password: string, inviteId: string, workspaceUrl: string) => Promise<WorkspaceLoginInfo>\n createInvite: (exp: number, emailMask: string, limit: number, role: AccountRole) => Promise<string>\n /**\n * @param options.personalized\n * If true, will generate a link with a personalized token for one person access\n * If false, will generate a link with an open-ended account in the token. Every token use will generate a new account.\n * When false, notBefore and expiration parameters are mandatory.\n * @param options.notBefore - not valid before; timestamp in seconds\n * @param options.expiration - expires after; timestamp in seconds\n */\n createAccessLink: (\n role: AccountRole,\n options?: {\n firstName?: string\n lastName?: string\n navigateUrl?: string\n extra?: Record<string, any>\n spaces?: string[]\n notBefore?: number\n expiration?: number\n personalized?: boolean\n }\n ) => Promise<string>\n checkJoin: (inviteId: string) => Promise<WorkspaceLoginInfo>\n checkAutoJoin: (inviteId: string, firstName?: string, lastName?: string) => Promise<WorkspaceLoginInfo>\n getWorkspaceInfo: (updateLastVisit?: boolean) => Promise<WorkspaceInfoWithStatus>\n getWorkspacesInfo: (workspaces: WorkspaceUuid[]) => Promise<WorkspaceInfoWithStatus[]>\n updateLastVisit: (workspaces: WorkspaceUuid[]) => Promise<void>\n getRegionInfo: () => Promise<RegionInfo[]>\n createWorkspace: (name: string, region?: string) => Promise<WorkspaceLoginInfo>\n signUpOtp: (email: string, first: string, last: string) => Promise<OtpInfo>\n /**\n * Deprecated. Only to be used for dev setups without mail service.\n */\n signUp: (email: string, password: string, first: string, last: string) => Promise<LoginInfo>\n login: (email: string, password: string) => Promise<LoginInfo>\n loginAsGuest: () => Promise<LoginInfo>\n isReadOnlyGuest: () => Promise<boolean>\n getPerson: () => Promise<Person>\n getPersonInfo: (account: PersonUuid) => Promise<PersonInfo>\n getSocialIds: (includeDeleted?: boolean) => Promise<SocialId[]>\n getWorkspaceMembers: () => Promise<WorkspaceMemberInfo[]>\n updateWorkspaceRole: (account: string, role: AccountRole) => Promise<void>\n updateAllowReadOnlyGuests: (\n readOnlyGuestsAllowed: boolean\n ) => Promise<{ guestPerson: Person, guestSocialIds: SocialId[] } | undefined>\n updateAllowGuestSignUp: (guestSignUpAllowed: boolean) => Promise<void>\n updateWorkspaceName: (name: string) => Promise<void>\n deleteWorkspace: () => Promise<void>\n findPersonBySocialKey: (socialKey: string, requireAccount?: boolean) => Promise<PersonUuid | undefined>\n findPersonBySocialId: (socialId: PersonId, requireAccount?: boolean) => Promise<PersonUuid | undefined>\n findSocialIdBySocialKey: (socialKey: string) => Promise<PersonId | undefined>\n findFullSocialIdBySocialKey: (socialKey: string) => Promise<SocialId | undefined>\n findFullSocialIds: (socialIds: PersonId[]) => Promise<SocialId[]>\n getMailboxOptions: () => Promise<MailboxOptions>\n getMailboxSecret: (mailbox: string) => Promise<MailboxSecret | undefined>\n createMailbox: (name: string, domain: string) => Promise<{ mailbox: string, socialId: PersonId }>\n getMailboxes: () => Promise<MailboxInfo[]>\n deleteMailbox: (mailbox: string) => Promise<void>\n listAccounts: (search?: string, skip?: number, limit?: number) => Promise<AccountAggregatedInfo[]>\n deleteAccount: (uuid: AccountUuid) => Promise<void>\n\n workerHandshake: (region: string, version: Data<Version>, operation: WorkspaceOperation) => Promise<void>\n getPendingWorkspace: (\n region: string,\n version: Data<Version>,\n operation: WorkspaceOperation\n ) => Promise<WorkspaceInfoWithStatus | null>\n updateWorkspaceInfo: (\n wsUuid: string,\n event: string,\n version: Data<Version>,\n progress: number,\n message?: string\n ) => Promise<void>\n listWorkspaces: (region?: string | null, mode?: WorkspaceMode | null) => Promise<WorkspaceInfoWithStatus[]>\n performWorkspaceOperation: (\n workspaceId: string | string[],\n event: WorkspaceUserOperation,\n ...params: any\n ) => Promise<boolean>\n assignWorkspace: (email: string, workspaceUuid: string, role: AccountRole) => Promise<void>\n updateBackupInfo: (info: BackupStatus) => Promise<void>\n updateUsageInfo: (info: UsageStatus) => Promise<void>\n updateWorkspaceRoleBySocialKey: (socialKey: string, targetRole: AccountRole) => Promise<void>\n ensurePerson: (\n socialType: SocialIdType,\n socialValue: string,\n firstName: string,\n lastName: string\n ) => Promise<{ uuid: PersonUuid, socialId: PersonId }>\n addSocialIdToPerson: (\n person: PersonUuid,\n type: SocialIdType,\n value: string,\n confirmed: boolean,\n displayValue?: string\n ) => Promise<PersonId>\n updateSocialId: (personId: PersonId, displayValue: string) => Promise<PersonId>\n exchangeGuestToken: (token: string) => Promise<string>\n /**\n * Releases the target social id for the target account.\n * If called with user's token it releases the social id for the user's account.\n * @param personUuid Required for services\n * @param type Social id type\n * @param value Social id value\n * @param deleteIntegrations Deletes associated integrations if true. Otherwise, throws an error if any.\n * @returns Deleted social id with updated isDeleted flag and key/value\n */\n releaseSocialId: (\n personUuid: PersonUuid | undefined,\n type: SocialIdType,\n value: string,\n deleteIntegrations?: boolean\n ) => Promise<SocialId>\n createIntegration: (integration: Integration) => Promise<void>\n updateIntegration: (integration: Integration) => Promise<void>\n deleteIntegration: (integrationKey: IntegrationKey) => Promise<void>\n getIntegration: (integrationKey: IntegrationKey) => Promise<Integration | null>\n listIntegrations: (filter: Partial<IntegrationKey>) => Promise<Integration[]>\n addIntegrationSecret: (integrationSecret: IntegrationSecret) => Promise<void>\n updateIntegrationSecret: (integrationSecret: IntegrationSecret) => Promise<void>\n deleteIntegrationSecret: (integrationSecretKey: IntegrationSecretKey) => Promise<void>\n getIntegrationSecret: (integrationSecretKey: IntegrationSecretKey) => Promise<IntegrationSecret | null>\n listIntegrationsSecrets: (filter: Partial<IntegrationSecretKey>) => Promise<IntegrationSecret[]>\n getAccountInfo: (uuid: AccountUuid) => Promise<AccountInfo>\n canMergeSpecifiedPersons: (primaryPerson: PersonUuid, secondaryPerson: PersonUuid) => Promise<boolean>\n mergeSpecifiedPersons: (primaryPerson: PersonUuid, secondaryPerson: PersonUuid) => Promise<void>\n mergeSpecifiedAccounts: (primaryAccount: AccountUuid, secondaryAccount: AccountUuid) => Promise<void>\n addEmailSocialId: (email: string) => Promise<OtpInfo>\n addHulyAssistantSocialId: () => Promise<PersonId>\n refreshHulyAssistantToken: () => Promise<void>\n updatePasswordAgingRule: (days: number) => Promise<void>\n checkPasswordAging: () => Promise<boolean>\n\n setMyProfile: (profile: Partial<Omit<UserProfile, 'personUuid'>>) => Promise<void>\n getUserProfile: (personUuid?: PersonUuid) => Promise<PersonWithProfile | null>\n\n getSubscriptions: (workspaceUuid?: WorkspaceUuid | undefined, activeOnly?: boolean) => Promise<Subscription[]>\n getSubscriptionByProviderId: (provider: string, providerSubscriptionId: string) => Promise<Subscription | null>\n getSubscriptionById: (subscriptionId: string) => Promise<Subscription | null>\n upsertSubscription: (subscription: SubscriptionData) => Promise<void>\n\n setCookie: () => Promise<void>\n deleteCookie: () => Promise<void>\n}\n\n/** @public */\nexport function getClient (accountsUrl?: string, token?: string, retryTimeoutMs?: number): AccountClient {\n if (accountsUrl === undefined) {\n throw new Error('Accounts url not specified')\n }\n\n return new AccountClientImpl(accountsUrl, token, retryTimeoutMs)\n}\n\ninterface Request {\n method: string\n params: Record<string, any>\n}\n\nclass AccountClientImpl implements AccountClient {\n private readonly request: RequestInit\n private readonly rpc: typeof this._rpc\n\n constructor (\n private readonly url: string,\n private readonly token?: string,\n retryTimeoutMs?: number\n ) {\n if (url === '') {\n throw new Error('Accounts url not specified')\n }\n\n const isBrowser = typeof window !== 'undefined'\n\n this.request = {\n keepalive: true,\n headers: {\n ...(this.token === undefined\n ? {}\n : {\n Authorization: 'Bearer ' + this.token\n })\n },\n ...(isBrowser ? { credentials: 'include' } : {})\n }\n this.rpc = withRetryUntilTimeout(this._rpc.bind(this), retryTimeoutMs ?? 5000)\n }\n\n async getProviders (): Promise<ProviderInfo[]> {\n return await withRetryUntilMaxAttempts(async () => {\n const response = await fetch(concatLink(this.url, '/providers'))\n\n return await response.json()\n })()\n }\n\n private async _rpc<T>(request: Request): Promise<T> {\n const timezone = getClientTimezone()\n const meta: Record<string, string> = timezone !== undefined ? { 'x-timezone': timezone } : {}\n const response = await fetch(this.url, {\n ...this.request,\n headers: {\n ...this.request.headers,\n 'Content-Type': 'application/json',\n Connection: 'keep-alive',\n ...meta\n },\n method: 'POST',\n body: JSON.stringify(request)\n })\n\n const result = await response.json()\n if (result.error != null) {\n throw new PlatformError(result.error)\n }\n\n return result.result\n }\n\n private flattenStatus (ws: any): WorkspaceInfoWithStatus {\n if (ws === undefined) {\n throw new PlatformError(new Status(Severity.ERROR, platform.status.WorkspaceNotFound, {}))\n }\n\n const status = ws.status\n if (status === undefined) {\n return ws\n }\n\n const result = { ...ws, ...status, processingAttemps: status.processingAttempts ?? 0 }\n delete result.status\n\n return result\n }\n\n async getUserWorkspaces (): Promise<WorkspaceInfoWithStatus[]> {\n const request = {\n method: 'getUserWorkspaces' as const,\n params: {}\n }\n\n return (await this.rpc<any[]>(request)).map((ws) => this.flattenStatus(ws))\n }\n\n async selectWorkspace (\n workspaceUrl: string,\n kind: 'external' | 'internal' | 'byregion' = 'external',\n externalRegions: string[] = []\n ): Promise<WorkspaceLoginInfo> {\n const request = {\n method: 'selectWorkspace' as const,\n params: { workspaceUrl, kind, externalRegions }\n }\n\n return await this.rpc(request)\n }\n\n async validateOtp (email: string, code: string, password?: string, action?: 'verify'): Promise<LoginInfo> {\n const request = {\n method: 'validateOtp' as const,\n params: { email, code, password, action }\n }\n\n return await this.rpc(request)\n }\n\n async loginOtp (email: string): Promise<OtpInfo> {\n const request = {\n method: 'loginOtp' as const,\n params: { email }\n }\n\n return await this.rpc(request)\n }\n\n async getLoginInfoByToken (data?: LoginInfoRequestData): Promise<LoginInfoByToken> {\n const request = {\n method: 'getLoginInfoByToken' as const,\n params: data ?? {}\n }\n\n return await this.rpc(request)\n }\n\n async getLoginWithWorkspaceInfo (): Promise<LoginInfoWithWorkspaces> {\n const request = {\n method: 'getLoginWithWorkspaceInfo' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async restorePassword (password: string): Promise<LoginInfo> {\n const request = {\n method: 'restorePassword' as const,\n params: { password }\n }\n\n return await this.rpc(request)\n }\n\n async confirm (): Promise<LoginInfo> {\n const request = {\n method: 'confirm' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async requestPasswordReset (email: string): Promise<void> {\n const request = {\n method: 'requestPasswordReset' as const,\n params: { email }\n }\n\n await this.rpc(request)\n }\n\n async sendInvite (email: string, role: AccountRole): Promise<void> {\n const request = {\n method: 'sendInvite' as const,\n params: { email, role }\n }\n\n await this.rpc(request)\n }\n\n async resendInvite (email: string, role: AccountRole): Promise<void> {\n const request = {\n method: 'resendInvite' as const,\n params: { email, role }\n }\n\n await this.rpc(request)\n }\n\n async createInviteLink (\n email: string,\n role: AccountRole,\n autoJoin: boolean,\n firstName: string,\n lastName: string,\n navigateUrl?: string,\n expHours?: number\n ): Promise<string> {\n const request = {\n method: 'createInviteLink' as const,\n params: { email, role, autoJoin, firstName, lastName, navigateUrl, expHours }\n }\n\n return await this.rpc(request)\n }\n\n async createAccessLink (\n role: AccountRole,\n options?: {\n firstName?: string\n lastName?: string\n navigateUrl?: string\n extra?: Record<string, any>\n spaces?: string[]\n notBefore?: number\n expiration?: number\n personalized?: boolean\n }\n ): Promise<string> {\n const params: any = { ...(options ?? {}), role }\n if (params.extra != null) {\n params.extra = JSON.stringify(params.extra)\n }\n\n const request = {\n method: 'createAccessLink' as const,\n params\n }\n\n return await this.rpc(request)\n }\n\n async leaveWorkspace (account: AccountUuid): Promise<LoginInfo | null> {\n const request = {\n method: 'leaveWorkspace' as const,\n params: { account }\n }\n\n return await this.rpc(request)\n }\n\n async changeUsername (first: string, last: string): Promise<void> {\n const request = {\n method: 'changeUsername' as const,\n params: { first, last }\n }\n\n await this.rpc(request)\n }\n\n async changePassword (oldPassword: string, newPassword: string): Promise<void> {\n const request = {\n method: 'changePassword' as const,\n params: { oldPassword, newPassword }\n }\n\n await this.rpc(request)\n }\n\n async updatePasswordAgingRule (days: number): Promise<void> {\n const request = {\n method: 'updatePasswordAgingRule' as const,\n params: { days }\n }\n\n await this.rpc(request)\n }\n\n async checkPasswordAging (): Promise<boolean> {\n const request = {\n method: 'checkPasswordAging' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async signUpJoin (\n email: string,\n password: string,\n first: string,\n last: string,\n inviteId: string,\n workspaceUrl: string\n ): Promise<WorkspaceLoginInfo> {\n const request = {\n method: 'signUpJoin' as const,\n params: { email, password, first, last, inviteId, workspaceUrl }\n }\n\n return await this.rpc(request)\n }\n\n async join (email: string, password: string, inviteId: string, workspaceUrl: string): Promise<WorkspaceLoginInfo> {\n const request = {\n method: 'join' as const,\n params: { email, password, inviteId, workspaceUrl }\n }\n\n return await this.rpc(request)\n }\n\n async createInvite (exp: number, emailMask: string, limit: number, role: AccountRole): Promise<string> {\n const request = {\n method: 'createInvite' as const,\n params: { exp, emailMask, limit, role }\n }\n\n return await this.rpc(request)\n }\n\n async checkJoin (inviteId: string): Promise<WorkspaceLoginInfo> {\n const request = {\n method: 'checkJoin' as const,\n params: { inviteId }\n }\n\n return await this.rpc(request)\n }\n\n async checkAutoJoin (inviteId: string, firstName?: string, lastName?: string): Promise<WorkspaceLoginInfo> {\n const request = {\n method: 'checkAutoJoin' as const,\n params: { inviteId, firstName, lastName }\n }\n\n return await this.rpc(request)\n }\n\n async getWorkspacesInfo (ids: WorkspaceUuid[]): Promise<WorkspaceInfoWithStatus[]> {\n const request = {\n method: 'getWorkspacesInfo' as const,\n params: { ids }\n }\n const infos: any[] = await this.rpc(request)\n return Array.from(infos).map((it) => this.flattenStatus(it))\n }\n\n async updateLastVisit (ids: WorkspaceUuid[]): Promise<void> {\n const request = {\n method: 'updateLastVisit' as const,\n params: { ids }\n }\n await this.rpc(request)\n }\n\n async getWorkspaceInfo (updateLastVisit: boolean = false): Promise<WorkspaceInfoWithStatus> {\n const request = {\n method: 'getWorkspaceInfo' as const,\n params: updateLastVisit ? { updateLastVisit: true } : {}\n }\n\n return this.flattenStatus(await this.rpc(request))\n }\n\n async getRegionInfo (): Promise<RegionInfo[]> {\n const request = {\n method: 'getRegionInfo' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async createWorkspace (workspaceName: string, region?: string): Promise<WorkspaceLoginInfo> {\n const request = {\n method: 'createWorkspace' as const,\n params: { workspaceName, region }\n }\n\n return await this.rpc(request)\n }\n\n async signUpOtp (email: string, firstName: string, lastName: string): Promise<OtpInfo> {\n const request = {\n method: 'signUpOtp' as const,\n params: { email, firstName, lastName }\n }\n\n return await this.rpc(request)\n }\n\n async signUp (email: string, password: string, firstName: string, lastName: string): Promise<LoginInfo> {\n const request = {\n method: 'signUp' as const,\n params: { email, password, firstName, lastName }\n }\n\n return await this.rpc(request)\n }\n\n async login (email: string, password: string): Promise<LoginInfo> {\n const request = {\n method: 'login' as const,\n params: { email, password }\n }\n\n return await this.rpc(request)\n }\n\n async loginAsGuest (): Promise<LoginInfo> {\n const request = {\n method: 'loginAsGuest' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async isReadOnlyGuest (): Promise<boolean> {\n const request = {\n method: 'isReadOnlyGuest' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async getPerson (): Promise<Person> {\n const request = {\n method: 'getPerson' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async getPersonInfo (account: PersonUuid): Promise<PersonInfo> {\n const request = {\n method: 'getPersonInfo' as const,\n params: { account }\n }\n\n return await this.rpc(request)\n }\n\n async getSocialIds (includeDeleted?: boolean): Promise<SocialId[]> {\n const request = {\n method: 'getSocialIds' as const,\n params: { includeDeleted }\n }\n\n return await this.rpc(request)\n }\n\n async workerHandshake (region: string, version: Data<Version>, operation: WorkspaceOperation): Promise<void> {\n const request = {\n method: 'workerHandshake' as const,\n params: { region, version, operation }\n }\n\n await this.rpc(request)\n }\n\n async getPendingWorkspace (\n region: string,\n version: Data<Version>,\n operation: WorkspaceOperation\n ): Promise<WorkspaceInfoWithStatus | null> {\n const request = {\n method: 'getPendingWorkspace' as const,\n params: { region, version, operation }\n }\n\n const result = await this.rpc(request)\n if (result == null) {\n return null\n }\n\n return this.flattenStatus(result)\n }\n\n async updateWorkspaceInfo (\n workspaceUuid: string,\n event: string,\n version: Data<Version>,\n progress: number,\n message?: string\n ): Promise<void> {\n const request = {\n method: 'updateWorkspaceInfo' as const,\n params: { workspaceUuid, event, version, progress, message }\n }\n\n await this.rpc(request)\n }\n\n async updateAllowReadOnlyGuests (\n readOnlyGuestsAllowed: boolean\n ): Promise<{ guestPerson: Person, guestSocialIds: SocialId[] } | undefined> {\n const request = {\n method: 'updateAllowReadOnlyGuests' as const,\n params: { readOnlyGuestsAllowed }\n }\n\n return await this.rpc(request)\n }\n\n async updateAllowGuestSignUp (guestSignUpAllowed: boolean): Promise<void> {\n const request = {\n method: 'updateAllowGuestSignUp' as const,\n params: { guestSignUpAllowed }\n }\n\n await this.rpc(request)\n }\n\n async getWorkspaceMembers (): Promise<WorkspaceMemberInfo[]> {\n const request = {\n method: 'getWorkspaceMembers' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async updateWorkspaceRole (targetAccount: string, targetRole: AccountRole): Promise<void> {\n const request = {\n method: 'updateWorkspaceRole' as const,\n params: { targetAccount, targetRole }\n }\n\n await this.rpc(request)\n }\n\n async updateWorkspaceName (name: string): Promise<void> {\n const request = {\n method: 'updateWorkspaceName' as const,\n params: { name }\n }\n\n await this.rpc(request)\n }\n\n async deleteWorkspace (): Promise<void> {\n const request = {\n method: 'deleteWorkspace' as const,\n params: {}\n }\n\n await this.rpc(request)\n }\n\n async findPersonBySocialKey (socialString: string, requireAccount?: boolean): Promise<PersonUuid | undefined> {\n const request = {\n method: 'findPersonBySocialKey' as const,\n params: { socialString, requireAccount }\n }\n\n return await this.rpc(request)\n }\n\n async findPersonBySocialId (socialId: PersonId, requireAccount?: boolean): Promise<PersonUuid | undefined> {\n const request = {\n method: 'findPersonBySocialId' as const,\n params: { socialId, requireAccount }\n }\n\n return await this.rpc(request)\n }\n\n async findSocialIdBySocialKey (socialKey: string): Promise<PersonId | undefined> {\n const request = {\n method: 'findSocialIdBySocialKey' as const,\n params: { socialKey }\n }\n\n return await this.rpc(request)\n }\n\n async findFullSocialIdBySocialKey (socialKey: string): Promise<SocialId | undefined> {\n const request = {\n method: 'findFullSocialIdBySocialKey' as const,\n params: { socialKey }\n }\n return await this.rpc(request)\n }\n\n async findFullSocialIds (socialIds: PersonId[]): Promise<SocialId[]> {\n const request = {\n method: 'findFullSocialIds' as const,\n params: { socialIds }\n }\n return await this.rpc(request)\n }\n\n async listWorkspaces (region?: string | null, mode: WorkspaceMode | null = null): Promise<WorkspaceInfoWithStatus[]> {\n const request = {\n method: 'listWorkspaces' as const,\n params: { region, mode }\n }\n\n return ((await this.rpc<any[]>(request)) ?? []).map((ws) => this.flattenStatus(ws))\n }\n\n async performWorkspaceOperation (\n workspaceId: string | string[],\n event: WorkspaceUserOperation,\n ...params: any\n ): Promise<boolean> {\n const request = {\n method: 'performWorkspaceOperation' as const,\n params: { workspaceId, event, params }\n }\n\n return await this.rpc(request)\n }\n\n async updateBackupInfo (backupInfo: BackupStatus): Promise<void> {\n const request = {\n method: 'updateBackupInfo' as const,\n params: { backupInfo }\n }\n\n await this.rpc(request)\n }\n\n async updateUsageInfo (usageInfo: UsageStatus): Promise<void> {\n const request = {\n method: 'updateUsageInfo' as const,\n params: { usageInfo }\n }\n\n await this.rpc(request)\n }\n\n async assignWorkspace (email: string, workspaceUuid: string, role: AccountRole): Promise<void> {\n const request = {\n method: 'assignWorkspace' as const,\n params: { email, workspaceUuid, role }\n }\n\n await this.rpc(request)\n }\n\n async updateWorkspaceRoleBySocialKey (socialKey: string, targetRole: AccountRole): Promise<void> {\n const request = {\n method: 'updateWorkspaceRoleBySocialKey' as const,\n params: { socialKey, targetRole }\n }\n\n await this.rpc(request)\n }\n\n async ensurePerson (\n socialType: SocialIdType,\n socialValue: string,\n firstName: string,\n lastName: string\n ): Promise<{ uuid: PersonUuid, socialId: PersonId }> {\n const request = {\n method: 'ensurePerson' as const,\n params: { socialType, socialValue, firstName, lastName }\n }\n\n return await this.rpc(request)\n }\n\n async exchangeGuestToken (token: string): Promise<string> {\n const request = {\n method: 'exchangeGuestToken' as const,\n params: { token }\n }\n\n return await this.rpc(request)\n }\n\n async addSocialIdToPerson (\n person: PersonUuid,\n type: SocialIdType,\n value: string,\n confirmed: boolean,\n displayValue?: string\n ): Promise<PersonId> {\n const request = {\n method: 'addSocialIdToPerson' as const,\n params: { person, type, value, confirmed, displayValue }\n }\n\n return await this.rpc(request)\n }\n\n async updateSocialId (personId: PersonId, displayValue: string): Promise<PersonId> {\n const request = {\n method: 'updateSocialId' as const,\n params: { personId, displayValue }\n }\n return await this.rpc(request)\n }\n\n async getMailboxOptions (): Promise<MailboxOptions> {\n const request = {\n method: 'getMailboxOptions' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async getMailboxSecret (mailbox: string): Promise<MailboxSecret | undefined> {\n const request = {\n method: 'getMailboxSecret' as const,\n params: { mailbox }\n }\n\n return await this.rpc(request)\n }\n\n async createMailbox (name: string, domain: string): Promise<{ mailbox: string, socialId: PersonId }> {\n const request = {\n method: 'createMailbox' as const,\n params: { name, domain }\n }\n\n return await this.rpc(request)\n }\n\n async getMailboxes (): Promise<MailboxInfo[]> {\n const request = {\n method: 'getMailboxes' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async deleteMailbox (mailbox: string): Promise<void> {\n const request = {\n method: 'deleteMailbox' as const,\n params: { mailbox }\n }\n\n await this.rpc(request)\n }\n\n async listAccounts (search?: string, skip?: number, limit?: number): Promise<AccountAggregatedInfo[]> {\n const request = {\n method: 'listAccounts' as const,\n params: { search, skip, limit }\n }\n\n return await this.rpc(request)\n }\n\n async deleteAccount (uuid: AccountUuid): Promise<void> {\n const request = {\n method: 'deleteAccount' as const,\n params: { uuid }\n }\n\n await this.rpc(request)\n }\n\n async releaseSocialId (\n personUuid: PersonUuid | undefined,\n type: SocialIdType,\n value: string,\n deleteIntegrations = false\n ): Promise<SocialId> {\n const request = {\n method: 'releaseSocialId' as const,\n params: { personUuid, type, value, deleteIntegrations }\n }\n\n return await this.rpc(request)\n }\n\n async createIntegration (integration: Integration): Promise<void> {\n const request = {\n method: 'createIntegration' as const,\n params: integration\n }\n\n await this.rpc(request)\n }\n\n async updateIntegration (integration: Integration): Promise<void> {\n const request = {\n method: 'updateIntegration' as const,\n params: integration\n }\n\n await this.rpc(request)\n }\n\n async deleteIntegration (integrationKey: IntegrationKey): Promise<void> {\n const request = {\n method: 'deleteIntegration' as const,\n params: integrationKey\n }\n\n await this.rpc(request)\n }\n\n async getIntegration (integrationKey: IntegrationKey): Promise<Integration | null> {\n const request = {\n method: 'getIntegration' as const,\n params: integrationKey\n }\n\n return await this.rpc(request)\n }\n\n async listIntegrations (filter: Partial<IntegrationKey>): Promise<Integration[]> {\n const request = {\n method: 'listIntegrations' as const,\n params: filter\n }\n\n return await this.rpc(request)\n }\n\n async addIntegrationSecret (integrationSecret: IntegrationSecret): Promise<void> {\n const request = {\n method: 'addIntegrationSecret' as const,\n params: integrationSecret\n }\n\n await this.rpc(request)\n }\n\n async updateIntegrationSecret (integrationSecret: IntegrationSecret): Promise<void> {\n const request = {\n method: 'updateIntegrationSecret' as const,\n params: integrationSecret\n }\n\n await this.rpc(request)\n }\n\n async deleteIntegrationSecret (integrationSecretKey: IntegrationSecretKey): Promise<void> {\n const request = {\n method: 'deleteIntegrationSecret' as const,\n params: integrationSecretKey\n }\n\n await this.rpc(request)\n }\n\n async getIntegrationSecret (integrationSecretKey: IntegrationSecretKey): Promise<IntegrationSecret | null> {\n const request = {\n method: 'getIntegrationSecret' as const,\n params: integrationSecretKey\n }\n\n return await this.rpc(request)\n }\n\n async listIntegrationsSecrets (filter: Partial<IntegrationSecretKey>): Promise<IntegrationSecret[]> {\n const request = {\n method: 'listIntegrationsSecrets' as const,\n params: filter\n }\n\n return await this.rpc(request)\n }\n\n async getAccountInfo (uuid: AccountUuid): Promise<AccountInfo> {\n const request = {\n method: 'getAccountInfo' as const,\n params: { accountId: uuid }\n }\n\n return await this.rpc(request)\n }\n\n async canMergeSpecifiedPersons (primaryPerson: PersonUuid, secondaryPerson: PersonUuid): Promise<boolean> {\n const request = {\n method: 'canMergeSpecifiedPersons' as const,\n params: { primaryPerson, secondaryPerson }\n }\n\n return await this.rpc(request)\n }\n\n async mergeSpecifiedPersons (primaryPerson: PersonUuid, secondaryPerson: PersonUuid): Promise<void> {\n const request = {\n method: 'mergeSpecifiedPersons' as const,\n params: { primaryPerson, secondaryPerson }\n }\n\n await this.rpc(request)\n }\n\n async mergeSpecifiedAccounts (primaryAccount: AccountUuid, secondaryAccount: AccountUuid): Promise<void> {\n const request = {\n method: 'mergeSpecifiedAccounts' as const,\n params: { primaryAccount, secondaryAccount }\n }\n\n await this.rpc(request)\n }\n\n async addEmailSocialId (email: string): Promise<OtpInfo> {\n const request = {\n method: 'addEmailSocialId' as const,\n params: { email }\n }\n\n return await this.rpc(request)\n }\n\n async addHulyAssistantSocialId (): Promise<PersonId> {\n const request = {\n method: 'addHulyAssistantSocialId' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async refreshHulyAssistantToken (): Promise<void> {\n const request = {\n method: 'refreshHulyAssistantToken' as const,\n params: {}\n }\n\n await this.rpc(request)\n }\n\n async setCookie (): Promise<void> {\n const url = concatLink(this.url, '/cookie')\n const response = await fetch(url, { ...this.request, method: 'PUT' })\n\n if (!response.ok) {\n const result = await response.json()\n if (result.error != null) {\n throw new PlatformError(result.error)\n }\n }\n }\n\n async deleteCookie (): Promise<void> {\n const url = concatLink(this.url, '/cookie')\n const response = await fetch(url, { ...this.request, method: 'DELETE' })\n\n if (!response.ok) {\n const result = await response.json()\n if (result.error != null) {\n throw new PlatformError(result.error)\n }\n }\n }\n\n async setMyProfile (profile: Partial<Omit<UserProfile, 'personUuid'>>): Promise<void> {\n const request = {\n method: 'setMyProfile',\n params: {\n profile\n }\n }\n\n await this._rpc(request)\n }\n\n async getUserProfile (personUuid?: PersonUuid): Promise<PersonWithProfile | null> {\n return await this._rpc({\n method: 'getUserProfile',\n params: {\n personUuid\n }\n })\n }\n\n async getSubscriptions (\n workspaceUuid: WorkspaceUuid | undefined = undefined,\n activeOnly: boolean = true\n ): Promise<Subscription[]> {\n return await this._rpc({\n method: 'getSubscriptions',\n params: {\n workspaceUuid,\n activeOnly\n }\n })\n }\n\n async getSubscriptionByProviderId (provider: string, providerSubscriptionId: string): Promise<Subscription | null> {\n return await this._rpc({\n method: 'getSubscriptionByProviderId',\n params: {\n provider,\n providerSubscriptionId\n }\n })\n }\n\n async getSubscriptionById (subscriptionId: string): Promise<Subscription | null> {\n return await this._rpc({\n method: 'getSubscriptionById',\n params: {\n subscriptionId\n }\n })\n }\n\n async upsertSubscription (subscription: SubscriptionData): Promise<void> {\n await this._rpc({\n method: 'upsertSubscription',\n params: subscription\n })\n }\n}\n\nfunction withRetry<T, F extends (...args: any[]) => Promise<T>> (\n f: F,\n shouldFail: (err: any, attempt: number) => boolean,\n intervalMs: number = 25\n): F {\n return async function (...params: any[]): Promise<T> {\n let attempt = 0\n while (true) {\n try {\n return await f(...params)\n } catch (err: any) {\n if (shouldFail(err, attempt)) {\n throw err\n }\n\n attempt++\n await new Promise<void>((resolve) => setTimeout(resolve, intervalMs))\n if (intervalMs < 1000) {\n intervalMs += 100\n }\n }\n }\n } as F\n}\n\nconst connectionErrorCodes = ['ECONNRESET', 'ECONNREFUSED', 'ENOTFOUND']\n\nfunction withRetryUntilTimeout<T, F extends (...args: any[]) => Promise<T>> (f: F, timeoutMs: number = 5000): F {\n const timeout = Date.now() + timeoutMs\n const shouldFail = (err: any): boolean => !connectionErrorCodes.includes(err?.cause?.code) || timeout < Date.now()\n\n return withRetry(f, shouldFail)\n}\n\nfunction withRetryUntilMaxAttempts<T, F extends (...args: any[]) => Promise<T>> (f: F, maxAttempts: number = 5): F {\n const shouldFail = (err: any, attempt: number): boolean =>\n !connectionErrorCodes.includes(err?.cause?.code) || attempt === maxAttempts\n\n return withRetry(f, shouldFail)\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcA,kBAmBO;AACP,sBAA0D;AAyB1D,mBAAkC;AA+L3B,SAAS,UAAW,aAAsB,OAAgB,gBAAwC;AACvG,MAAI,gBAAgB,QAAW;AAC7B,UAAM,IAAI,MAAM,4BAA4B;AAAA,EAC9C;AAEA,SAAO,IAAI,kBAAkB,aAAa,OAAO,cAAc;AACjE;AANgB;AAahB,MAAM,kBAA2C;AAAA,EAI/C,YACmB,KACA,OACjB,gBACA;AAHiB;AACA;AAGjB,QAAI,QAAQ,IAAI;AACd,YAAM,IAAI,MAAM,4BAA4B;AAAA,IAC9C;AAEA,UAAM,YAAY,OAAO,WAAW;AAEpC,SAAK,UAAU;AAAA,MACb,WAAW;AAAA,MACX,SAAS;AAAA,QACP,GAAI,KAAK,UAAU,SACf,CAAC,IACD;AAAA,UACE,eAAe,YAAY,KAAK;AAAA,QAClC;AAAA,MACN;AAAA,MACA,GAAI,YAAY,EAAE,aAAa,UAAU,IAAI,CAAC;AAAA,IAChD;AACA,SAAK,MAAM,sBAAsB,KAAK,KAAK,KAAK,IAAI,GAAG,kBAAkB,GAAI;AAAA,EAC/E;AAAA,EAlSF,OAuQiD;AAAA;AAAA;AAAA,EAC9B;AAAA,EACA;AAAA,EA2BjB,MAAM,eAAyC;AAC7C,WAAO,MAAM,0BAA0B,YAAY;AAC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AAI,WAAW,KAAK,OAAO,GAAG;AAC5B,gBAAM;AAAA,QACR;AAEA;AACA,cAAM,IAAI,QAAc,CAAC,YAAY,WAAW,SAAS,UAAU,CAAC;AACpE,YAAI,aAAa,KAAM;AACrB,wBAAc;AAAA,QAChB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAvBS;AAyBT,MAAM,uBAAuB,CAAC,cAAc,gBAAgB,WAAW;AAEvE,SAAS,sBAAoE,GAAM,YAAoB,KAAS;AAC9G,QAAM,UAAU,KAAK,IAAI,IAAI;AAC7B,QAAM,aAAa,wBAAC,QAAsB,CAAC,qBAAqB,SAAS,KAAK,OAAO,IAAI,KAAK,UAAU,KAAK,IAAI,GAA9F;AAEnB,SAAO,UAAU,GAAG,UAAU;AAChC;AALS;AAOT,SAAS,0BAAwE,GAAM,cAAsB,GAAM;AACjH,QAAM,aAAa,wBAAC,KAAU,YAC5B,CAAC,qBAAqB,SAAS,KAAK,OAAO,IAAI,KAAK,YAAY,aAD/C;AAGnB,SAAO,UAAU,GAAG,UAAU;AAChC;AALS;",
4
+ "sourcesContent": ["//\n// Copyright \u00A9 2024 Hardcore Engineering Inc.\n//\n// Licensed under the Eclipse Public License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License. You may\n// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\nimport {\n type AccountInfo,\n type AccountRole,\n type AccountUuid,\n type BackupStatus,\n concatLink,\n Data,\n type Person,\n type PersonId,\n type PersonInfo,\n type PersonUuid,\n type SocialIdType,\n Version,\n type UsageStatus,\n type WorkspaceInfoWithStatus,\n type WorkspaceMemberInfo,\n WorkspaceMode,\n type WorkspaceUserOperation,\n type WorkspaceUuid\n} from '@hcengineering/core'\nimport platform, { PlatformError, Severity, Status } from '@hcengineering/platform'\nimport type {\n AccountAggregatedInfo,\n Integration,\n IntegrationKey,\n IntegrationSecret,\n IntegrationSecretKey,\n LoginInfo,\n LoginInfoByToken,\n LoginInfoRequestData,\n InviteInfo,\n LoginInfoWithWorkspaces,\n MailboxInfo,\n MailboxOptions,\n MailboxSecret,\n OtpInfo,\n PersonWithProfile,\n ProviderInfo,\n RegionInfo,\n SocialId,\n Subscription,\n SubscriptionData,\n UserProfile,\n WorkspaceLoginInfo,\n WorkspaceOperation\n} from './types'\nimport { getClientTimezone, isNetworkError } from './utils'\n\n/** @public */\nexport interface AccountClient {\n // Static methods\n getProviders: () => Promise<ProviderInfo[]>\n\n // RPC\n getUserWorkspaces: () => Promise<WorkspaceInfoWithStatus[]>\n selectWorkspace: (\n workspaceUrl: string,\n kind?: 'external' | 'internal' | 'byregion',\n externalRegions?: string[]\n ) => Promise<WorkspaceLoginInfo>\n validateOtp: (email: string, code: string, password?: string, action?: 'verify') => Promise<LoginInfo>\n loginOtp: (email: string) => Promise<OtpInfo>\n getLoginInfoByToken: (data?: LoginInfoRequestData) => Promise<LoginInfoByToken>\n getLoginWithWorkspaceInfo: () => Promise<LoginInfoWithWorkspaces>\n restorePassword: (password: string) => Promise<LoginInfo>\n confirm: () => Promise<LoginInfo>\n requestPasswordReset: (email: string) => Promise<void>\n sendInvite: (email: string, role: AccountRole) => Promise<void>\n resendInvite: (email: string, role: AccountRole) => Promise<void>\n createInviteLink: (\n email: string,\n role: AccountRole,\n autoJoin: boolean,\n firstName: string,\n lastName: string,\n navigateUrl?: string,\n expHours?: number\n ) => Promise<string>\n leaveWorkspace: (account: AccountUuid) => Promise<LoginInfo | null>\n changeUsername: (first: string, last: string) => Promise<void>\n checkHasPassword: () => Promise<boolean>\n changePassword: (oldPassword: string, newPassword: string) => Promise<void>\n requestPasswordSetup: () => Promise<void>\n signUpJoin: (\n email: string,\n password: string,\n first: string,\n last: string,\n inviteId: string,\n workspaceUrl: string\n ) => Promise<WorkspaceLoginInfo>\n join: (email: string, password: string, inviteId: string, workspaceUrl: string) => Promise<WorkspaceLoginInfo>\n createInvite: (exp: number, emailMask: string, limit: number, role: AccountRole) => Promise<string>\n /**\n * @param options.personalized\n * If true, will generate a link with a personalized token for one person access\n * If false, will generate a link with an open-ended account in the token. Every token use will generate a new account.\n * When false, notBefore and expiration parameters are mandatory.\n * @param options.notBefore - not valid before; timestamp in seconds\n * @param options.expiration - expires after; timestamp in seconds\n */\n createAccessLink: (\n role: AccountRole,\n options?: {\n firstName?: string\n lastName?: string\n navigateUrl?: string\n extra?: Record<string, any>\n spaces?: string[]\n notBefore?: number\n expiration?: number\n personalized?: boolean\n }\n ) => Promise<string>\n checkJoin: (inviteId: string) => Promise<WorkspaceLoginInfo>\n joinByToken: (inviteId: string) => Promise<WorkspaceLoginInfo>\n checkAutoJoin: (inviteId: string, firstName?: string, lastName?: string) => Promise<WorkspaceLoginInfo>\n getInviteInfo: (inviteId: string) => Promise<InviteInfo>\n getWorkspaceInfo: (updateLastVisit?: boolean) => Promise<WorkspaceInfoWithStatus>\n getWorkspacesInfo: (workspaces: WorkspaceUuid[]) => Promise<WorkspaceInfoWithStatus[]>\n updateLastVisit: (workspaces: WorkspaceUuid[]) => Promise<void>\n getRegionInfo: () => Promise<RegionInfo[]>\n createWorkspace: (name: string, region?: string) => Promise<WorkspaceLoginInfo>\n signUpOtp: (email: string, first: string, last: string) => Promise<OtpInfo>\n /**\n * Deprecated. Only to be used for dev setups without mail service.\n */\n signUp: (email: string, password: string, first: string, last: string) => Promise<LoginInfo>\n login: (email: string, password: string) => Promise<LoginInfo>\n loginAsGuest: () => Promise<LoginInfo>\n isReadOnlyGuest: () => Promise<boolean>\n getPerson: () => Promise<Person>\n getPersonInfo: (account: PersonUuid) => Promise<PersonInfo>\n getSocialIds: (includeDeleted?: boolean) => Promise<SocialId[]>\n getWorkspaceMembers: () => Promise<WorkspaceMemberInfo[]>\n updateWorkspaceRole: (account: string, role: AccountRole) => Promise<void>\n updateAllowReadOnlyGuests: (\n readOnlyGuestsAllowed: boolean\n ) => Promise<{ guestPerson: Person, guestSocialIds: SocialId[] } | undefined>\n updateAllowGuestSignUp: (guestSignUpAllowed: boolean) => Promise<void>\n updateWorkspaceName: (name: string) => Promise<void>\n deleteWorkspace: () => Promise<void>\n findPersonBySocialKey: (socialKey: string, requireAccount?: boolean) => Promise<PersonUuid | undefined>\n findPersonBySocialId: (socialId: PersonId, requireAccount?: boolean) => Promise<PersonUuid | undefined>\n findSocialIdBySocialKey: (socialKey: string) => Promise<PersonId | undefined>\n findFullSocialIdBySocialKey: (socialKey: string) => Promise<SocialId | undefined>\n findFullSocialIds: (socialIds: PersonId[]) => Promise<SocialId[]>\n getMailboxOptions: () => Promise<MailboxOptions>\n getMailboxSecret: (mailbox: string) => Promise<MailboxSecret | undefined>\n createMailbox: (name: string, domain: string) => Promise<{ mailbox: string, socialId: PersonId }>\n getMailboxes: () => Promise<MailboxInfo[]>\n deleteMailbox: (mailbox: string) => Promise<void>\n listAccounts: (search?: string, skip?: number, limit?: number) => Promise<AccountAggregatedInfo[]>\n deleteAccount: (uuid: AccountUuid) => Promise<void>\n\n workerHandshake: (region: string, version: Data<Version>, operation: WorkspaceOperation) => Promise<void>\n getPendingWorkspace: (\n region: string,\n version: Data<Version>,\n operation: WorkspaceOperation\n ) => Promise<WorkspaceInfoWithStatus | null>\n updateWorkspaceInfo: (\n wsUuid: string,\n event: string,\n version: Data<Version>,\n progress: number,\n message?: string\n ) => Promise<void>\n listWorkspaces: (region?: string | null, mode?: WorkspaceMode | null) => Promise<WorkspaceInfoWithStatus[]>\n performWorkspaceOperation: (\n workspaceId: string | string[],\n event: WorkspaceUserOperation,\n ...params: any\n ) => Promise<boolean>\n assignWorkspace: (email: string, workspaceUuid: string, role: AccountRole) => Promise<void>\n updateBackupInfo: (info: BackupStatus) => Promise<void>\n updateUsageInfo: (info: UsageStatus) => Promise<void>\n updateWorkspaceRoleBySocialKey: (socialKey: string, targetRole: AccountRole) => Promise<void>\n ensurePerson: (\n socialType: SocialIdType,\n socialValue: string,\n firstName: string,\n lastName: string\n ) => Promise<{ uuid: PersonUuid, socialId: PersonId }>\n addSocialIdToPerson: (\n person: PersonUuid,\n type: SocialIdType,\n value: string,\n confirmed: boolean,\n displayValue?: string\n ) => Promise<PersonId>\n updateSocialId: (personId: PersonId, displayValue: string) => Promise<PersonId>\n exchangeGuestToken: (token: string) => Promise<string>\n /**\n * Releases the target social id for the target account.\n * If called with user's token it releases the social id for the user's account.\n * @param personUuid Required for services\n * @param type Social id type\n * @param value Social id value\n * @param deleteIntegrations Deletes associated integrations if true. Otherwise, throws an error if any.\n * @returns Deleted social id with updated isDeleted flag and key/value\n */\n releaseSocialId: (\n personUuid: PersonUuid | undefined,\n type: SocialIdType,\n value: string,\n deleteIntegrations?: boolean\n ) => Promise<SocialId>\n createIntegration: (integration: Integration) => Promise<void>\n updateIntegration: (integration: Integration) => Promise<void>\n deleteIntegration: (integrationKey: IntegrationKey) => Promise<void>\n getIntegration: (integrationKey: IntegrationKey) => Promise<Integration | null>\n listIntegrations: (filter: Partial<IntegrationKey>) => Promise<Integration[]>\n addIntegrationSecret: (integrationSecret: IntegrationSecret) => Promise<void>\n updateIntegrationSecret: (integrationSecret: IntegrationSecret) => Promise<void>\n deleteIntegrationSecret: (integrationSecretKey: IntegrationSecretKey) => Promise<void>\n getIntegrationSecret: (integrationSecretKey: IntegrationSecretKey) => Promise<IntegrationSecret | null>\n listIntegrationsSecrets: (filter: Partial<IntegrationSecretKey>) => Promise<IntegrationSecret[]>\n getAccountInfo: (uuid: AccountUuid) => Promise<AccountInfo>\n canMergeSpecifiedPersons: (primaryPerson: PersonUuid, secondaryPerson: PersonUuid) => Promise<boolean>\n mergeSpecifiedPersons: (primaryPerson: PersonUuid, secondaryPerson: PersonUuid) => Promise<void>\n mergeSpecifiedAccounts: (primaryAccount: AccountUuid, secondaryAccount: AccountUuid) => Promise<void>\n addEmailSocialId: (email: string) => Promise<OtpInfo>\n addHulyAssistantSocialId: () => Promise<PersonId>\n refreshHulyAssistantToken: () => Promise<void>\n updatePasswordAgingRule: (days: number) => Promise<void>\n checkPasswordAging: () => Promise<boolean>\n\n setMyProfile: (profile: Partial<Omit<UserProfile, 'personUuid'>>) => Promise<void>\n getUserProfile: (personUuid?: PersonUuid) => Promise<PersonWithProfile | null>\n\n getSubscriptions: (workspaceUuid?: WorkspaceUuid | undefined, activeOnly?: boolean) => Promise<Subscription[]>\n getSubscriptionByProviderId: (provider: string, providerSubscriptionId: string) => Promise<Subscription | null>\n getSubscriptionById: (subscriptionId: string) => Promise<Subscription | null>\n upsertSubscription: (subscription: SubscriptionData) => Promise<void>\n\n batchAssignWorkspacePermission: (params: { accountIds: AccountUuid[], permission: string }) => Promise<void>\n batchRevokeWorkspacePermission: (params: { accountIds: AccountUuid[], permission: string }) => Promise<void>\n hasWorkspacePermission: (params: { accountId: AccountUuid, permission: string }) => Promise<boolean>\n getWorkspacePermissions: (params: { accountId: AccountUuid, permission: string }) => Promise<WorkspaceUuid[]>\n getWorkspaceUsersWithPermission: (params: { permission: string }) => Promise<AccountUuid[]>\n\n verify2fa: (code: string) => Promise<LoginInfo>\n\n setCookie: () => Promise<void>\n deleteCookie: () => Promise<void>\n\n generate2faSecret: () => Promise<{ secret: string, url: string }>\n enable2fa: (secret: string, code: string) => Promise<void>\n disable2fa: (code: string) => Promise<void>\n}\n\n/** @public */\nexport function getClient (accountsUrl?: string, token?: string, retryTimeoutMs?: number): AccountClient {\n if (accountsUrl === undefined) {\n throw new Error('Accounts url not specified')\n }\n\n return new AccountClientImpl(accountsUrl, token, retryTimeoutMs)\n}\n\ninterface Request {\n method: string\n params: Record<string, any>\n}\n\nclass AccountClientImpl implements AccountClient {\n private readonly request: RequestInit\n private readonly rpc: typeof this._rpc\n\n constructor (\n private readonly url: string,\n private readonly token?: string,\n retryTimeoutMs?: number\n ) {\n if (url === '') {\n throw new Error('Accounts url not specified')\n }\n\n const isBrowser = typeof window !== 'undefined'\n\n this.request = {\n keepalive: true,\n headers: {\n ...(this.token === undefined\n ? {}\n : {\n Authorization: 'Bearer ' + this.token\n })\n },\n ...(isBrowser ? { credentials: 'include' } : {})\n }\n this.rpc = withRetryUntilTimeout(this._rpc.bind(this), retryTimeoutMs ?? 5000)\n }\n\n async getProviders (): Promise<ProviderInfo[]> {\n return await withRetryUntilMaxAttempts(async () => {\n const response = await fetch(concatLink(this.url, '/providers'))\n\n return await response.json()\n })()\n }\n\n private async _rpc<T>(request: Request): Promise<T> {\n const timezone = getClientTimezone()\n const meta: Record<string, string> = timezone !== undefined ? { 'x-timezone': timezone } : {}\n const response = await fetch(this.url, {\n ...this.request,\n headers: {\n ...this.request.headers,\n 'Content-Type': 'application/json',\n Connection: 'keep-alive',\n ...meta\n },\n method: 'POST',\n body: JSON.stringify(request)\n })\n\n const result = await response.json()\n if (result.error != null) {\n throw new PlatformError(result.error)\n }\n\n return result.result\n }\n\n private flattenStatus (ws: any): WorkspaceInfoWithStatus {\n if (ws === undefined) {\n throw new PlatformError(new Status(Severity.ERROR, platform.status.WorkspaceNotFound, {}))\n }\n\n const status = ws.status\n if (status === undefined) {\n return ws\n }\n\n const result = { ...ws, ...status, processingAttemps: status.processingAttempts ?? 0 }\n delete result.status\n\n return result\n }\n\n async getUserWorkspaces (): Promise<WorkspaceInfoWithStatus[]> {\n const request = {\n method: 'getUserWorkspaces' as const,\n params: {}\n }\n\n return (await this.rpc<any[]>(request)).map((ws) => this.flattenStatus(ws))\n }\n\n async selectWorkspace (\n workspaceUrl: string,\n kind: 'external' | 'internal' | 'byregion' = 'external',\n externalRegions: string[] = []\n ): Promise<WorkspaceLoginInfo> {\n const request = {\n method: 'selectWorkspace' as const,\n params: { workspaceUrl, kind, externalRegions }\n }\n\n return await this.rpc(request)\n }\n\n async validateOtp (email: string, code: string, password?: string, action?: 'verify'): Promise<LoginInfo> {\n const request = {\n method: 'validateOtp' as const,\n params: { email, code, password, action }\n }\n\n return await this.rpc(request)\n }\n\n async loginOtp (email: string): Promise<OtpInfo> {\n const request = {\n method: 'loginOtp' as const,\n params: { email }\n }\n\n return await this.rpc(request)\n }\n\n async getLoginInfoByToken (data?: LoginInfoRequestData): Promise<LoginInfoByToken> {\n const request = {\n method: 'getLoginInfoByToken' as const,\n params: data ?? {}\n }\n\n return await this.rpc(request)\n }\n\n async getLoginWithWorkspaceInfo (): Promise<LoginInfoWithWorkspaces> {\n const request = {\n method: 'getLoginWithWorkspaceInfo' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async restorePassword (password: string): Promise<LoginInfo> {\n const request = {\n method: 'restorePassword' as const,\n params: { password }\n }\n\n return await this.rpc(request)\n }\n\n async confirm (): Promise<LoginInfo> {\n const request = {\n method: 'confirm' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async requestPasswordReset (email: string): Promise<void> {\n const request = {\n method: 'requestPasswordReset' as const,\n params: { email }\n }\n\n await this.rpc(request)\n }\n\n async sendInvite (email: string, role: AccountRole): Promise<void> {\n const request = {\n method: 'sendInvite' as const,\n params: { email, role }\n }\n\n await this.rpc(request)\n }\n\n async resendInvite (email: string, role: AccountRole): Promise<void> {\n const request = {\n method: 'resendInvite' as const,\n params: { email, role }\n }\n\n await this.rpc(request)\n }\n\n async createInviteLink (\n email: string,\n role: AccountRole,\n autoJoin: boolean,\n firstName: string,\n lastName: string,\n navigateUrl?: string,\n expHours?: number\n ): Promise<string> {\n const request = {\n method: 'createInviteLink' as const,\n params: { email, role, autoJoin, firstName, lastName, navigateUrl, expHours }\n }\n\n return await this.rpc(request)\n }\n\n async createAccessLink (\n role: AccountRole,\n options?: {\n firstName?: string\n lastName?: string\n navigateUrl?: string\n extra?: Record<string, any>\n spaces?: string[]\n notBefore?: number\n expiration?: number\n personalized?: boolean\n }\n ): Promise<string> {\n const params: any = { ...(options ?? {}), role }\n if (params.extra != null) {\n params.extra = JSON.stringify(params.extra)\n }\n\n const request = {\n method: 'createAccessLink' as const,\n params\n }\n\n return await this.rpc(request)\n }\n\n async leaveWorkspace (account: AccountUuid): Promise<LoginInfo | null> {\n const request = {\n method: 'leaveWorkspace' as const,\n params: { account }\n }\n\n return await this.rpc(request)\n }\n\n async changeUsername (first: string, last: string): Promise<void> {\n const request = {\n method: 'changeUsername' as const,\n params: { first, last }\n }\n\n await this.rpc(request)\n }\n\n async checkHasPassword (): Promise<boolean> {\n const request = {\n method: 'checkHasPassword' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async changePassword (oldPassword: string, newPassword: string): Promise<void> {\n const request = {\n method: 'changePassword' as const,\n params: { oldPassword, newPassword }\n }\n\n await this.rpc(request)\n }\n\n async requestPasswordSetup (): Promise<void> {\n const request = {\n method: 'requestPasswordSetup' as const,\n params: {}\n }\n\n await this.rpc(request)\n }\n\n async updatePasswordAgingRule (days: number): Promise<void> {\n const request = {\n method: 'updatePasswordAgingRule' as const,\n params: { days }\n }\n\n await this.rpc(request)\n }\n\n async checkPasswordAging (): Promise<boolean> {\n const request = {\n method: 'checkPasswordAging' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async signUpJoin (\n email: string,\n password: string,\n first: string,\n last: string,\n inviteId: string,\n workspaceUrl: string\n ): Promise<WorkspaceLoginInfo> {\n const request = {\n method: 'signUpJoin' as const,\n params: { email, password, first, last, inviteId, workspaceUrl }\n }\n\n return await this.rpc(request)\n }\n\n async join (email: string, password: string, inviteId: string, workspaceUrl: string): Promise<WorkspaceLoginInfo> {\n const request = {\n method: 'join' as const,\n params: { email, password, inviteId, workspaceUrl }\n }\n\n return await this.rpc(request)\n }\n\n async createInvite (exp: number, emailMask: string, limit: number, role: AccountRole): Promise<string> {\n const request = {\n method: 'createInvite' as const,\n params: { exp, emailMask, limit, role }\n }\n\n return await this.rpc(request)\n }\n\n async checkJoin (inviteId: string): Promise<WorkspaceLoginInfo> {\n const request = {\n method: 'checkJoin' as const,\n params: { inviteId }\n }\n\n return await this.rpc(request)\n }\n\n async joinByToken (inviteId: string): Promise<WorkspaceLoginInfo> {\n const request = {\n method: 'joinByToken' as const,\n params: { inviteId }\n }\n\n return await this.rpc(request)\n }\n\n async checkAutoJoin (inviteId: string, firstName?: string, lastName?: string): Promise<WorkspaceLoginInfo> {\n const request = {\n method: 'checkAutoJoin' as const,\n params: { inviteId, firstName, lastName }\n }\n\n return await this.rpc(request)\n }\n\n async getInviteInfo (inviteId: string): Promise<InviteInfo> {\n const request = {\n method: 'getInviteInfo' as const,\n params: { inviteId }\n }\n\n return await this.rpc(request)\n }\n\n async getWorkspacesInfo (ids: WorkspaceUuid[]): Promise<WorkspaceInfoWithStatus[]> {\n const request = {\n method: 'getWorkspacesInfo' as const,\n params: { ids }\n }\n const infos: any[] = await this.rpc(request)\n return Array.from(infos).map((it) => this.flattenStatus(it))\n }\n\n async updateLastVisit (ids: WorkspaceUuid[]): Promise<void> {\n const request = {\n method: 'updateLastVisit' as const,\n params: { ids }\n }\n await this.rpc(request)\n }\n\n async getWorkspaceInfo (updateLastVisit: boolean = false): Promise<WorkspaceInfoWithStatus> {\n const request = {\n method: 'getWorkspaceInfo' as const,\n params: updateLastVisit ? { updateLastVisit: true } : {}\n }\n\n return this.flattenStatus(await this.rpc(request))\n }\n\n async getRegionInfo (): Promise<RegionInfo[]> {\n const request = {\n method: 'getRegionInfo' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async createWorkspace (workspaceName: string, region?: string): Promise<WorkspaceLoginInfo> {\n const request = {\n method: 'createWorkspace' as const,\n params: { workspaceName, region }\n }\n\n return await this.rpc(request)\n }\n\n async signUpOtp (email: string, firstName: string, lastName: string): Promise<OtpInfo> {\n const request = {\n method: 'signUpOtp' as const,\n params: { email, firstName, lastName }\n }\n\n return await this.rpc(request)\n }\n\n async signUp (email: string, password: string, firstName: string, lastName: string): Promise<LoginInfo> {\n const request = {\n method: 'signUp' as const,\n params: { email, password, firstName, lastName }\n }\n\n return await this.rpc(request)\n }\n\n async login (email: string, password: string): Promise<LoginInfo> {\n const request = {\n method: 'login' as const,\n params: { email, password }\n }\n\n return await this.rpc(request)\n }\n\n async loginAsGuest (): Promise<LoginInfo> {\n const request = {\n method: 'loginAsGuest' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async isReadOnlyGuest (): Promise<boolean> {\n const request = {\n method: 'isReadOnlyGuest' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async getPerson (): Promise<Person> {\n const request = {\n method: 'getPerson' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async getPersonInfo (account: PersonUuid): Promise<PersonInfo> {\n const request = {\n method: 'getPersonInfo' as const,\n params: { account }\n }\n\n return await this.rpc(request)\n }\n\n async getSocialIds (includeDeleted?: boolean): Promise<SocialId[]> {\n const request = {\n method: 'getSocialIds' as const,\n params: { includeDeleted }\n }\n\n return await this.rpc(request)\n }\n\n async workerHandshake (region: string, version: Data<Version>, operation: WorkspaceOperation): Promise<void> {\n const request = {\n method: 'workerHandshake' as const,\n params: { region, version, operation }\n }\n\n await this.rpc(request)\n }\n\n async getPendingWorkspace (\n region: string,\n version: Data<Version>,\n operation: WorkspaceOperation\n ): Promise<WorkspaceInfoWithStatus | null> {\n const request = {\n method: 'getPendingWorkspace' as const,\n params: { region, version, operation }\n }\n\n const result = await this.rpc(request)\n if (result == null) {\n return null\n }\n\n return this.flattenStatus(result)\n }\n\n async updateWorkspaceInfo (\n workspaceUuid: string,\n event: string,\n version: Data<Version>,\n progress: number,\n message?: string\n ): Promise<void> {\n const request = {\n method: 'updateWorkspaceInfo' as const,\n params: { workspaceUuid, event, version, progress, message }\n }\n\n await this.rpc(request)\n }\n\n async updateAllowReadOnlyGuests (\n readOnlyGuestsAllowed: boolean\n ): Promise<{ guestPerson: Person, guestSocialIds: SocialId[] } | undefined> {\n const request = {\n method: 'updateAllowReadOnlyGuests' as const,\n params: { readOnlyGuestsAllowed }\n }\n\n return await this.rpc(request)\n }\n\n async updateAllowGuestSignUp (guestSignUpAllowed: boolean): Promise<void> {\n const request = {\n method: 'updateAllowGuestSignUp' as const,\n params: { guestSignUpAllowed }\n }\n\n await this.rpc(request)\n }\n\n async getWorkspaceMembers (): Promise<WorkspaceMemberInfo[]> {\n const request = {\n method: 'getWorkspaceMembers' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async updateWorkspaceRole (targetAccount: string, targetRole: AccountRole): Promise<void> {\n const request = {\n method: 'updateWorkspaceRole' as const,\n params: { targetAccount, targetRole }\n }\n\n await this.rpc(request)\n }\n\n async updateWorkspaceName (name: string): Promise<void> {\n const request = {\n method: 'updateWorkspaceName' as const,\n params: { name }\n }\n\n await this.rpc(request)\n }\n\n async deleteWorkspace (): Promise<void> {\n const request = {\n method: 'deleteWorkspace' as const,\n params: {}\n }\n\n await this.rpc(request)\n }\n\n async findPersonBySocialKey (socialString: string, requireAccount?: boolean): Promise<PersonUuid | undefined> {\n const request = {\n method: 'findPersonBySocialKey' as const,\n params: { socialString, requireAccount }\n }\n\n return await this.rpc(request)\n }\n\n async findPersonBySocialId (socialId: PersonId, requireAccount?: boolean): Promise<PersonUuid | undefined> {\n const request = {\n method: 'findPersonBySocialId' as const,\n params: { socialId, requireAccount }\n }\n\n return await this.rpc(request)\n }\n\n async findSocialIdBySocialKey (socialKey: string): Promise<PersonId | undefined> {\n const request = {\n method: 'findSocialIdBySocialKey' as const,\n params: { socialKey }\n }\n\n return await this.rpc(request)\n }\n\n async findFullSocialIdBySocialKey (socialKey: string): Promise<SocialId | undefined> {\n const request = {\n method: 'findFullSocialIdBySocialKey' as const,\n params: { socialKey }\n }\n return await this.rpc(request)\n }\n\n async findFullSocialIds (socialIds: PersonId[]): Promise<SocialId[]> {\n const request = {\n method: 'findFullSocialIds' as const,\n params: { socialIds }\n }\n return await this.rpc(request)\n }\n\n async listWorkspaces (region?: string | null, mode: WorkspaceMode | null = null): Promise<WorkspaceInfoWithStatus[]> {\n const request = {\n method: 'listWorkspaces' as const,\n params: { region, mode }\n }\n\n return ((await this.rpc<any[]>(request)) ?? []).map((ws) => this.flattenStatus(ws))\n }\n\n async performWorkspaceOperation (\n workspaceId: string | string[],\n event: WorkspaceUserOperation,\n ...params: any\n ): Promise<boolean> {\n const request = {\n method: 'performWorkspaceOperation' as const,\n params: { workspaceId, event, params }\n }\n\n return await this.rpc(request)\n }\n\n async updateBackupInfo (backupInfo: BackupStatus): Promise<void> {\n const request = {\n method: 'updateBackupInfo' as const,\n params: { backupInfo }\n }\n\n await this.rpc(request)\n }\n\n async updateUsageInfo (usageInfo: UsageStatus): Promise<void> {\n const request = {\n method: 'updateUsageInfo' as const,\n params: { usageInfo }\n }\n\n await this.rpc(request)\n }\n\n async assignWorkspace (email: string, workspaceUuid: string, role: AccountRole): Promise<void> {\n const request = {\n method: 'assignWorkspace' as const,\n params: { email, workspaceUuid, role }\n }\n\n await this.rpc(request)\n }\n\n async updateWorkspaceRoleBySocialKey (socialKey: string, targetRole: AccountRole): Promise<void> {\n const request = {\n method: 'updateWorkspaceRoleBySocialKey' as const,\n params: { socialKey, targetRole }\n }\n\n await this.rpc(request)\n }\n\n async ensurePerson (\n socialType: SocialIdType,\n socialValue: string,\n firstName: string,\n lastName: string\n ): Promise<{ uuid: PersonUuid, socialId: PersonId }> {\n const request = {\n method: 'ensurePerson' as const,\n params: { socialType, socialValue, firstName, lastName }\n }\n\n return await this.rpc(request)\n }\n\n async exchangeGuestToken (token: string): Promise<string> {\n const request = {\n method: 'exchangeGuestToken' as const,\n params: { token }\n }\n\n return await this.rpc(request)\n }\n\n async addSocialIdToPerson (\n person: PersonUuid,\n type: SocialIdType,\n value: string,\n confirmed: boolean,\n displayValue?: string\n ): Promise<PersonId> {\n const request = {\n method: 'addSocialIdToPerson' as const,\n params: { person, type, value, confirmed, displayValue }\n }\n\n return await this.rpc(request)\n }\n\n async updateSocialId (personId: PersonId, displayValue: string): Promise<PersonId> {\n const request = {\n method: 'updateSocialId' as const,\n params: { personId, displayValue }\n }\n return await this.rpc(request)\n }\n\n async getMailboxOptions (): Promise<MailboxOptions> {\n const request = {\n method: 'getMailboxOptions' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async getMailboxSecret (mailbox: string): Promise<MailboxSecret | undefined> {\n const request = {\n method: 'getMailboxSecret' as const,\n params: { mailbox }\n }\n\n return await this.rpc(request)\n }\n\n async createMailbox (name: string, domain: string): Promise<{ mailbox: string, socialId: PersonId }> {\n const request = {\n method: 'createMailbox' as const,\n params: { name, domain }\n }\n\n return await this.rpc(request)\n }\n\n async getMailboxes (): Promise<MailboxInfo[]> {\n const request = {\n method: 'getMailboxes' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async deleteMailbox (mailbox: string): Promise<void> {\n const request = {\n method: 'deleteMailbox' as const,\n params: { mailbox }\n }\n\n await this.rpc(request)\n }\n\n async listAccounts (search?: string, skip?: number, limit?: number): Promise<AccountAggregatedInfo[]> {\n const request = {\n method: 'listAccounts' as const,\n params: { search, skip, limit }\n }\n\n return await this.rpc(request)\n }\n\n async deleteAccount (uuid: AccountUuid): Promise<void> {\n const request = {\n method: 'deleteAccount' as const,\n params: { uuid }\n }\n\n await this.rpc(request)\n }\n\n async releaseSocialId (\n personUuid: PersonUuid | undefined,\n type: SocialIdType,\n value: string,\n deleteIntegrations = false\n ): Promise<SocialId> {\n const request = {\n method: 'releaseSocialId' as const,\n params: { personUuid, type, value, deleteIntegrations }\n }\n\n return await this.rpc(request)\n }\n\n async createIntegration (integration: Integration): Promise<void> {\n const request = {\n method: 'createIntegration' as const,\n params: integration\n }\n\n await this.rpc(request)\n }\n\n async updateIntegration (integration: Integration): Promise<void> {\n const request = {\n method: 'updateIntegration' as const,\n params: integration\n }\n\n await this.rpc(request)\n }\n\n async deleteIntegration (integrationKey: IntegrationKey): Promise<void> {\n const request = {\n method: 'deleteIntegration' as const,\n params: integrationKey\n }\n\n await this.rpc(request)\n }\n\n async getIntegration (integrationKey: IntegrationKey): Promise<Integration | null> {\n const request = {\n method: 'getIntegration' as const,\n params: integrationKey\n }\n\n return await this.rpc(request)\n }\n\n async listIntegrations (filter: Partial<IntegrationKey>): Promise<Integration[]> {\n const request = {\n method: 'listIntegrations' as const,\n params: filter\n }\n\n return await this.rpc(request)\n }\n\n async addIntegrationSecret (integrationSecret: IntegrationSecret): Promise<void> {\n const request = {\n method: 'addIntegrationSecret' as const,\n params: integrationSecret\n }\n\n await this.rpc(request)\n }\n\n async updateIntegrationSecret (integrationSecret: IntegrationSecret): Promise<void> {\n const request = {\n method: 'updateIntegrationSecret' as const,\n params: integrationSecret\n }\n\n await this.rpc(request)\n }\n\n async deleteIntegrationSecret (integrationSecretKey: IntegrationSecretKey): Promise<void> {\n const request = {\n method: 'deleteIntegrationSecret' as const,\n params: integrationSecretKey\n }\n\n await this.rpc(request)\n }\n\n async getIntegrationSecret (integrationSecretKey: IntegrationSecretKey): Promise<IntegrationSecret | null> {\n const request = {\n method: 'getIntegrationSecret' as const,\n params: integrationSecretKey\n }\n\n return await this.rpc(request)\n }\n\n async listIntegrationsSecrets (filter: Partial<IntegrationSecretKey>): Promise<IntegrationSecret[]> {\n const request = {\n method: 'listIntegrationsSecrets' as const,\n params: filter\n }\n\n return await this.rpc(request)\n }\n\n async getAccountInfo (uuid: AccountUuid): Promise<AccountInfo> {\n const request = {\n method: 'getAccountInfo' as const,\n params: { accountId: uuid }\n }\n\n return await this.rpc(request)\n }\n\n async canMergeSpecifiedPersons (primaryPerson: PersonUuid, secondaryPerson: PersonUuid): Promise<boolean> {\n const request = {\n method: 'canMergeSpecifiedPersons' as const,\n params: { primaryPerson, secondaryPerson }\n }\n\n return await this.rpc(request)\n }\n\n async mergeSpecifiedPersons (primaryPerson: PersonUuid, secondaryPerson: PersonUuid): Promise<void> {\n const request = {\n method: 'mergeSpecifiedPersons' as const,\n params: { primaryPerson, secondaryPerson }\n }\n\n await this.rpc(request)\n }\n\n async mergeSpecifiedAccounts (primaryAccount: AccountUuid, secondaryAccount: AccountUuid): Promise<void> {\n const request = {\n method: 'mergeSpecifiedAccounts' as const,\n params: { primaryAccount, secondaryAccount }\n }\n\n await this.rpc(request)\n }\n\n async addEmailSocialId (email: string): Promise<OtpInfo> {\n const request = {\n method: 'addEmailSocialId' as const,\n params: { email }\n }\n\n return await this.rpc(request)\n }\n\n async addHulyAssistantSocialId (): Promise<PersonId> {\n const request = {\n method: 'addHulyAssistantSocialId' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async refreshHulyAssistantToken (): Promise<void> {\n const request = {\n method: 'refreshHulyAssistantToken' as const,\n params: {}\n }\n\n await this.rpc(request)\n }\n\n async setCookie (): Promise<void> {\n const url = concatLink(this.url, '/cookie')\n const response = await fetch(url, { ...this.request, method: 'PUT' })\n\n if (!response.ok) {\n const result = await response.json()\n if (result.error != null) {\n throw new PlatformError(result.error)\n }\n }\n }\n\n async deleteCookie (): Promise<void> {\n const url = concatLink(this.url, '/cookie')\n const response = await fetch(url, { ...this.request, method: 'DELETE' })\n\n if (!response.ok) {\n const result = await response.json()\n if (result.error != null) {\n throw new PlatformError(result.error)\n }\n }\n }\n\n async setMyProfile (profile: Partial<Omit<UserProfile, 'personUuid'>>): Promise<void> {\n const request = {\n method: 'setMyProfile',\n params: {\n profile\n }\n }\n\n await this._rpc(request)\n }\n\n async getUserProfile (personUuid?: PersonUuid): Promise<PersonWithProfile | null> {\n return await this._rpc({\n method: 'getUserProfile',\n params: {\n personUuid\n }\n })\n }\n\n async getSubscriptions (\n workspaceUuid: WorkspaceUuid | undefined = undefined,\n activeOnly: boolean = true\n ): Promise<Subscription[]> {\n return await this._rpc({\n method: 'getSubscriptions',\n params: {\n workspaceUuid,\n activeOnly\n }\n })\n }\n\n async getSubscriptionByProviderId (provider: string, providerSubscriptionId: string): Promise<Subscription | null> {\n return await this._rpc({\n method: 'getSubscriptionByProviderId',\n params: {\n provider,\n providerSubscriptionId\n }\n })\n }\n\n async getSubscriptionById (subscriptionId: string): Promise<Subscription | null> {\n return await this._rpc({\n method: 'getSubscriptionById',\n params: {\n subscriptionId\n }\n })\n }\n\n async upsertSubscription (subscription: SubscriptionData): Promise<void> {\n await this._rpc({\n method: 'upsertSubscription',\n params: subscription\n })\n }\n\n async batchAssignWorkspacePermission (params: { accountIds: AccountUuid[], permission: string }): Promise<void> {\n await this._rpc({\n method: 'batchAssignWorkspacePermission',\n params\n })\n }\n\n async batchRevokeWorkspacePermission (params: { accountIds: AccountUuid[], permission: string }): Promise<void> {\n await this._rpc({\n method: 'batchRevokeWorkspacePermission',\n params\n })\n }\n\n async hasWorkspacePermission (params: { accountId: AccountUuid, permission: string }): Promise<boolean> {\n return await this._rpc({\n method: 'hasWorkspacePermission',\n params\n })\n }\n\n async getWorkspacePermissions (params: { accountId: AccountUuid, permission: string }): Promise<WorkspaceUuid[]> {\n return await this._rpc({\n method: 'getWorkspacePermissions',\n params\n })\n }\n\n async getWorkspaceUsersWithPermission (params: { permission: string }): Promise<AccountUuid[]> {\n return await this._rpc({\n method: 'getWorkspaceUsersWithPermission',\n params\n })\n }\n\n async verify2fa (code: string): Promise<LoginInfo> {\n const request = {\n method: 'verify2fa' as const,\n params: { code }\n }\n\n return await this.rpc(request)\n }\n\n async generate2faSecret (): Promise<{ secret: string, url: string }> {\n const request = {\n method: 'generate2faSecret' as const,\n params: {}\n }\n\n return await this.rpc(request)\n }\n\n async enable2fa (secret: string, code: string): Promise<void> {\n const request = {\n method: 'enable2fa' as const,\n params: { secret, code }\n }\n\n await this.rpc(request)\n }\n\n async disable2fa (code: string): Promise<void> {\n const request = {\n method: 'disable2fa' as const,\n params: { code }\n }\n\n await this.rpc(request)\n }\n}\n\nfunction withRetry<T, F extends (...args: any[]) => Promise<T>> (\n f: F,\n shouldFail: (err: any, attempt: number) => boolean,\n intervalMs: number = 25\n): F {\n return async function (...params: any[]): Promise<T> {\n let attempt = 0\n while (true) {\n try {\n return await f(...params)\n } catch (err: any) {\n if (shouldFail(err, attempt)) {\n throw err\n }\n\n attempt++\n await new Promise<void>((resolve) => setTimeout(resolve, intervalMs))\n if (intervalMs < 1000) {\n intervalMs += 100\n }\n }\n }\n } as F\n}\n\nfunction withRetryUntilTimeout<T, F extends (...args: any[]) => Promise<T>> (f: F, timeoutMs: number = 5000): F {\n const timeout = Date.now() + timeoutMs\n const shouldFail = (err: any): boolean => !isNetworkError(err) || timeout < Date.now()\n\n return withRetry(f, shouldFail)\n}\n\nfunction withRetryUntilMaxAttempts<T, F extends (...args: any[]) => Promise<T>> (f: F, maxAttempts: number = 5): F {\n const shouldFail = (err: any, attempt: number): boolean => !isNetworkError(err) || attempt === maxAttempts\n\n return withRetry(f, shouldFail)\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcA,kBAmBO;AACP,sBAA0D;AA0B1D,mBAAkD;AA+M3C,SAAS,UAAW,aAAsB,OAAgB,gBAAwC;AACvG,MAAI,gBAAgB,QAAW;AAC7B,UAAM,IAAI,MAAM,4BAA4B;AAAA,EAC9C;AAEA,SAAO,IAAI,kBAAkB,aAAa,OAAO,cAAc;AACjE;AANgB;AAahB,MAAM,kBAA2C;AAAA,EAI/C,YACmB,KACA,OACjB,gBACA;AAHiB;AACA;AAGjB,QAAI,QAAQ,IAAI;AACd,YAAM,IAAI,MAAM,4BAA4B;AAAA,IAC9C;AAEA,UAAM,YAAY,OAAO,WAAW;AAEpC,SAAK,UAAU;AAAA,MACb,WAAW;AAAA,MACX,SAAS;AAAA,QACP,GAAI,KAAK,UAAU,SACf,CAAC,IACD;AAAA,UACE,eAAe,YAAY,KAAK;AAAA,QAClC;AAAA,MACN;AAAA,MACA,GAAI,YAAY,EAAE,aAAa,UAAU,IAAI,CAAC;AAAA,IAChD;AACA,SAAK,MAAM,sBAAsB,KAAK,KAAK,KAAK,IAAI,GAAG,kBAAkB,GAAI;AAAA,EAC/E;AAAA,EAnTF,OAwRiD;AAAA;AAAA;AAAA,EAC9B;AAAA,EACA;AAAA,EA2BjB,MAAM,eAAyC;AAC7C,WAAO,MAAM,0BAA0B,YAAY;AACjD,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2
  "version": 3,
3
3
  "sources": ["../src/types.ts"],
4
- "sourcesContent": ["import {\n type AccountUuid,\n PersonId,\n WorkspaceDataId,\n WorkspaceUuid,\n type AccountRole,\n type Timestamp,\n type SocialId as SocialIdBase,\n PersonUuid,\n type WorkspaceMode,\n Person,\n WorkspaceInfo,\n AccountInfo,\n IntegrationKind\n} from '@hcengineering/core'\n\nexport interface LoginInfo {\n account: AccountUuid\n name?: string\n socialId?: PersonId\n token?: string\n}\n\nexport interface EndpointInfo {\n internalUrl: string\n externalUrl: string\n region: string\n}\nexport interface WorkspaceVersion {\n versionMajor: number\n versionMinor: number\n versionPatch: number\n}\n\nexport interface LoginInfoWorkspace {\n url: string\n dataId?: WorkspaceDataId\n mode: WorkspaceMode\n version: WorkspaceVersion\n endpoint: EndpointInfo\n role: AccountRole | null\n progress?: number\n branding?: string\n passwordAgingRule?: number // in days\n}\n\nexport interface LoginInfoWithWorkspaces extends LoginInfo {\n // Information necessary to handle user <--> transactor connectivity.\n workspaces: Record<WorkspaceUuid, LoginInfoWorkspace>\n socialIds: SocialId[]\n}\n\nexport type LoginInfoByToken = LoginInfo | WorkspaceLoginInfo | LoginInfoRequest | null\n\n/**\n * @public\n */\nexport interface WorkspaceLoginInfo extends LoginInfo {\n workspace: WorkspaceUuid // worspace uuid\n workspaceDataId?: WorkspaceDataId\n workspaceUrl: string\n endpoint: string\n token: string\n role: AccountRole\n allowGuestSignUp?: boolean\n}\n\nexport interface LoginInfoRequestData {\n firstName?: string\n lastName?: string\n}\n\nexport type LoginInfoRequest = {\n request: true\n} & LoginInfoRequestData\n\nexport interface WorkspaceInviteInfo {\n workspace: WorkspaceUuid\n email?: string\n name?: string\n}\n\nexport interface OtpInfo {\n sent: boolean\n retryOn: Timestamp\n}\n\nexport interface RegionInfo {\n region: string\n name: string\n}\n\nexport type WorkspaceOperation = 'create' | 'upgrade' | 'all' | 'all+backup'\n\nexport interface MailboxOptions {\n availableDomains: string[]\n minNameLength: number\n maxNameLength: number\n maxMailboxCount: number\n}\n\nexport interface MailboxInfo {\n mailbox: string\n aliases: string[]\n appPasswords: string[]\n}\n\nexport interface MailboxSecret {\n mailbox: string\n app?: string\n secret: string\n}\n\nexport interface Integration {\n socialId: PersonId\n kind: IntegrationKind // Integration kind. E.g. 'github', 'mail', 'telegram-bot', 'telegram' etc.\n workspaceUuid: WorkspaceUuid | null\n data?: Record<string, any>\n disabled?: boolean\n}\n\nexport interface SocialId extends SocialIdBase {\n personUuid: PersonUuid\n isDeleted?: boolean\n}\n\nexport type IntegrationKey = Omit<Integration, 'data'>\n\nexport interface IntegrationSecret {\n socialId: PersonId\n kind: IntegrationKind // Integration kind. E.g. 'github', 'mail', 'telegram-bot', 'telegram' etc.\n workspaceUuid: WorkspaceUuid | null\n key: string // Key for the secret in the integration. Different secrets for the same integration must have different keys. Can be any string. E.g. '', 'user_app_1' etc.\n secret: string\n}\n\nexport type IntegrationSecretKey = Omit<IntegrationSecret, 'secret'>\n\nexport interface ProviderInfo {\n name: string\n displayName?: string\n}\n\nexport interface AccountAggregatedInfo extends AccountInfo, Person {\n uuid: AccountUuid\n integrations: Omit<Integration, 'data'>[]\n socialIds: SocialId[]\n workspaces: Omit<WorkspaceInfo, 'allowReadOnlyGuest' | 'allowGuestSignUp'>[]\n}\n\n/**\n * User profile with additional information for public sharing\n * Stored in accounts database (global, not workspace-specific)\n */\nexport interface UserProfile {\n personUuid: PersonUuid\n bio?: string // LinkedIn-style bio (up to ~2000 chars)\n city?: string\n country?: string\n website?: string // Personal website URL\n socialLinks?: Record<string, string> // Flexible storage for social links\n isPublic: boolean // Public visibility toggle (default: false)\n}\n\nexport type PersonWithProfile = Person & Omit<UserProfile, 'personUuid'>\n\n/**\n * Subscription status enum\n * Reflects the subscription lifecycle from active to canceled/expired\n */\nexport enum SubscriptionStatus {\n Active = 'active', // Subscription is active and paid\n Trialing = 'trialing', // In trial period (free usage)\n PastDue = 'past_due', // Payment failed but subscription not yet canceled\n Canceled = 'canceled', // Subscription was canceled by user or admin\n Paused = 'paused', // Subscription is temporarily paused (some providers support this)\n Expired = 'expired' // Subscription or trial has expired\n}\n\n/**\n * Subscription type/purpose\n * Allows multiple active subscriptions per workspace for different purposes\n */\nexport enum SubscriptionType {\n Tier = 'tier', // Main workspace tier (free, starter, pro, enterprise)\n Support = 'support' // Voluntary support/donation subscription\n}\n\n/**\n * Workspace subscription information\n * Provider-agnostic subscription data managed by billing service\n * Multiple subscriptions can be active per workspace (tier + addons + support)\n * Historical subscriptions are preserved with status: canceled/expired\n */\nexport interface Subscription {\n id: string // Our internal unique subscription ID (UUID)\n workspaceUuid: WorkspaceUuid\n accountUuid: AccountUuid // Account that paid for the subscription\n\n // Provider details\n provider: string // Payment provider identifier (e.g. 'polar', 'stripe', 'manual')\n providerSubscriptionId: string // External subscription ID from the provider\n providerCheckoutId?: string // External checkout/session ID that created this subscription\n\n // Subscription classification\n type: SubscriptionType // What this subscription is for (tier, addon, support)\n status: SubscriptionStatus // Current status\n plan: string // Plan/product identifier (e.g. 'free', 'pro', 'storage-100gb', 'supporter')\n\n // Amount paid (in cents, e.g. 9999 = $99.99)\n // Used primarily for pay-what-you-want/donation subscriptions to track actual payment\n amount?: number\n\n // Billing period (optional - not set for free/manual plans)\n periodStart?: Timestamp\n periodEnd?: Timestamp\n\n // Trial information (optional)\n trialEnd?: Timestamp\n\n // Cancellation tracking (optional)\n canceledAt?: Timestamp\n\n // Provider-specific data stored as JSONB (optional)\n providerData?: Record<string, any>\n\n // Timestamps (managed by database)\n createdOn: Timestamp\n updatedOn: Timestamp\n}\n\n/**\n * Subscription data for creating/updating subscriptions (without timestamps)\n * Used by billing service to upsert subscription data\n */\nexport type SubscriptionData = Omit<Subscription, 'createdOn' | 'updatedOn'>\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0KO,IAAK,qBAAL,kBAAKA,wBAAL;AACL,EAAAA,oBAAA,YAAS;AACT,EAAAA,oBAAA,cAAW;AACX,EAAAA,oBAAA,aAAU;AACV,EAAAA,oBAAA,cAAW;AACX,EAAAA,oBAAA,YAAS;AACT,EAAAA,oBAAA,aAAU;AANA,SAAAA;AAAA,GAAA;AAaL,IAAK,mBAAL,kBAAKC,sBAAL;AACL,EAAAA,kBAAA,UAAO;AACP,EAAAA,kBAAA,aAAU;AAFA,SAAAA;AAAA,GAAA;",
4
+ "sourcesContent": ["import {\n type AccountUuid,\n PersonId,\n WorkspaceDataId,\n WorkspaceUuid,\n type AccountRole,\n type Timestamp,\n type SocialId as SocialIdBase,\n PersonUuid,\n type WorkspaceMode,\n Person,\n WorkspaceInfo,\n AccountInfo,\n IntegrationKind\n} from '@hcengineering/core'\n\nexport interface LoginInfo {\n account: AccountUuid\n name?: string\n socialId?: PersonId\n token?: string\n tfaRequired?: boolean\n extra?: Record<string, string>\n}\n\nexport interface EndpointInfo {\n internalUrl: string\n externalUrl: string\n region: string\n}\nexport interface WorkspaceVersion {\n versionMajor: number\n versionMinor: number\n versionPatch: number\n}\n\nexport interface LoginInfoWorkspace {\n url: string\n dataId?: WorkspaceDataId\n mode: WorkspaceMode\n version: WorkspaceVersion\n endpoint: EndpointInfo\n role: AccountRole | null\n progress?: number\n branding?: string\n passwordAgingRule?: number // in days\n}\n\nexport interface LoginInfoWithWorkspaces extends LoginInfo {\n // Information necessary to handle user <--> transactor connectivity.\n workspaces: Record<WorkspaceUuid, LoginInfoWorkspace>\n socialIds: SocialId[]\n}\n\nexport type LoginInfoByToken = LoginInfo | WorkspaceLoginInfo | LoginInfoRequest | null\n\n/**\n * @public\n */\nexport interface WorkspaceLoginInfo extends LoginInfo {\n workspace: WorkspaceUuid // worspace uuid\n workspaceDataId?: WorkspaceDataId\n workspaceUrl: string\n endpoint: string\n token: string\n role: AccountRole\n allowGuestSignUp?: boolean\n}\n\nexport interface LoginInfoRequestData {\n firstName?: string\n lastName?: string\n}\n\nexport type LoginInfoRequest = {\n request: true\n} & LoginInfoRequestData\n\nexport interface WorkspaceInviteInfo {\n workspace: WorkspaceUuid\n email?: string\n name?: string\n}\n\n/** Public invite details from getInviteInfo (no auth required). */\nexport interface InviteInfo {\n workspaceName: string | null\n}\n\nexport interface OtpInfo {\n sent: boolean\n retryOn: Timestamp\n}\n\nexport interface RegionInfo {\n region: string\n name: string\n}\n\nexport type WorkspaceOperation = 'create' | 'upgrade' | 'all' | 'all+backup'\n\nexport interface MailboxOptions {\n availableDomains: string[]\n minNameLength: number\n maxNameLength: number\n maxMailboxCount: number\n}\n\nexport interface MailboxInfo {\n mailbox: string\n aliases: string[]\n appPasswords: string[]\n}\n\nexport interface MailboxSecret {\n mailbox: string\n app?: string\n secret: string\n}\n\nexport interface Integration {\n socialId: PersonId\n kind: IntegrationKind // Integration kind. E.g. 'github', 'mail', 'telegram-bot', 'telegram' etc.\n workspaceUuid: WorkspaceUuid | null\n data?: Record<string, any>\n disabled?: boolean\n}\n\nexport interface SocialId extends SocialIdBase {\n personUuid: PersonUuid\n isDeleted?: boolean\n}\n\nexport type IntegrationKey = Omit<Integration, 'data'>\n\nexport interface IntegrationSecret {\n socialId: PersonId\n kind: IntegrationKind // Integration kind. E.g. 'github', 'mail', 'telegram-bot', 'telegram' etc.\n workspaceUuid: WorkspaceUuid | null\n key: string // Key for the secret in the integration. Different secrets for the same integration must have different keys. Can be any string. E.g. '', 'user_app_1' etc.\n secret: string\n}\n\nexport type IntegrationSecretKey = Omit<IntegrationSecret, 'secret'>\n\nexport interface ProviderInfo {\n name: string\n displayName?: string\n}\n\nexport interface AccountAggregatedInfo extends AccountInfo, Person {\n uuid: AccountUuid\n integrations: Omit<Integration, 'data'>[]\n socialIds: SocialId[]\n workspaces: Omit<WorkspaceInfo, 'allowReadOnlyGuest' | 'allowGuestSignUp'>[]\n}\n\n/**\n * User profile with additional information for public sharing\n * Stored in accounts database (global, not workspace-specific)\n */\nexport interface UserProfile {\n personUuid: PersonUuid\n bio?: string // LinkedIn-style bio (up to ~2000 chars)\n city?: string\n country?: string\n website?: string // Personal website URL\n socialLinks?: Record<string, string> // Flexible storage for social links\n isPublic: boolean // Public visibility toggle (default: false)\n}\n\nexport type PersonWithProfile = Person & Omit<UserProfile, 'personUuid'>\n\n/**\n * Subscription status enum\n * Reflects the subscription lifecycle from active to canceled/expired\n */\nexport enum SubscriptionStatus {\n Active = 'active', // Subscription is active and paid\n Trialing = 'trialing', // In trial period (free usage)\n PastDue = 'past_due', // Payment failed but subscription not yet canceled\n Canceled = 'canceled', // Subscription was canceled by user or admin\n Paused = 'paused', // Subscription is temporarily paused (some providers support this)\n Expired = 'expired' // Subscription or trial has expired\n}\n\n/**\n * Subscription type/purpose\n * Allows multiple active subscriptions per workspace for different purposes\n */\nexport enum SubscriptionType {\n Tier = 'tier', // Main workspace tier (free, starter, pro, enterprise)\n Support = 'support' // Voluntary support/donation subscription\n}\n\n/**\n * Workspace subscription information\n * Provider-agnostic subscription data managed by billing service\n * Multiple subscriptions can be active per workspace (tier + addons + support)\n * Historical subscriptions are preserved with status: canceled/expired\n */\nexport interface Subscription {\n id: string // Our internal unique subscription ID (UUID)\n workspaceUuid: WorkspaceUuid\n accountUuid: AccountUuid // Account that paid for the subscription\n\n // Provider details\n provider: string // Payment provider identifier (e.g. 'polar', 'stripe', 'manual')\n providerSubscriptionId: string // External subscription ID from the provider\n providerCheckoutId?: string // External checkout/session ID that created this subscription\n\n // Subscription classification\n type: SubscriptionType // What this subscription is for (tier, addon, support)\n status: SubscriptionStatus // Current status\n plan: string // Plan/product identifier (e.g. 'free', 'pro', 'storage-100gb', 'supporter')\n\n // Amount paid (in cents, e.g. 9999 = $99.99)\n // Used primarily for pay-what-you-want/donation subscriptions to track actual payment\n amount?: number\n\n // Billing period (optional - not set for free/manual plans)\n periodStart?: Timestamp\n periodEnd?: Timestamp\n\n // Trial information (optional)\n trialEnd?: Timestamp\n\n // Cancellation tracking (optional)\n canceledAt?: Timestamp\n\n // Provider-specific data stored as JSONB (optional)\n providerData?: Record<string, any>\n\n // Timestamps (managed by database)\n createdOn: Timestamp\n updatedOn: Timestamp\n}\n\n/**\n * Subscription data for creating/updating subscriptions (without timestamps)\n * Used by billing service to upsert subscription data\n */\nexport type SubscriptionData = Omit<Subscription, 'createdOn' | 'updatedOn'>\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiLO,IAAK,qBAAL,kBAAKA,wBAAL;AACL,EAAAA,oBAAA,YAAS;AACT,EAAAA,oBAAA,cAAW;AACX,EAAAA,oBAAA,aAAU;AACV,EAAAA,oBAAA,cAAW;AACX,EAAAA,oBAAA,YAAS;AACT,EAAAA,oBAAA,aAAU;AANA,SAAAA;AAAA,GAAA;AAaL,IAAK,mBAAL,kBAAKC,sBAAL;AACL,EAAAA,kBAAA,UAAO;AACP,EAAAA,kBAAA,aAAU;AAFA,SAAAA;AAAA,GAAA;",
6
6
  "names": ["SubscriptionStatus", "SubscriptionType"]
7
7
  }
@@ -21,6 +21,7 @@ var utils_exports = {};
21
21
  __export(utils_exports, {
22
22
  getClientTimezone: () => getClientTimezone,
23
23
  isLoginInfoRequest: () => isLoginInfoRequest,
24
+ isNetworkError: () => isNetworkError,
24
25
  isWorkspaceLoginInfo: () => isWorkspaceLoginInfo
25
26
  });
26
27
  module.exports = __toCommonJS(utils_exports);
@@ -41,4 +42,53 @@ function getClientTimezone() {
41
42
  }
42
43
  }
43
44
  __name(getClientTimezone, "getClientTimezone");
45
+ const connectionErrorCodes = ["ECONNRESET", "ECONNREFUSED", "ENOTFOUND"];
46
+ const networkErrorNames = ["NetworkError", "TypeError", "FetchError"];
47
+ const browserFetchErrorMessages = ["failed to fetch", "networkerror", "network request failed"];
48
+ const networkMessageKeywords = ["fetch", "network", "connection"];
49
+ function hasNetworkMessage(message) {
50
+ const lowerMessage = message.toLowerCase();
51
+ return networkMessageKeywords.some((keyword) => lowerMessage.includes(keyword));
52
+ }
53
+ __name(hasNetworkMessage, "hasNetworkMessage");
54
+ function isNetworkError(err) {
55
+ if (err == null) {
56
+ return false;
57
+ }
58
+ if (typeof err === "object" && "cause" in err) {
59
+ const cause = err.cause;
60
+ if (cause != null && typeof cause === "object" && "code" in cause) {
61
+ const code = cause.code;
62
+ if (typeof code === "string" && connectionErrorCodes.includes(code)) {
63
+ return true;
64
+ }
65
+ }
66
+ }
67
+ let errorName;
68
+ let message;
69
+ if (err instanceof TypeError) {
70
+ errorName = "TypeError";
71
+ message = err.message;
72
+ } else if (typeof err === "object" && "name" in err && "message" in err) {
73
+ const name = err.name;
74
+ const msg = err.message;
75
+ if (typeof name === "string") {
76
+ errorName = name;
77
+ }
78
+ if (typeof msg === "string") {
79
+ message = msg;
80
+ }
81
+ }
82
+ if (errorName != null && networkErrorNames.includes(errorName) && message != null) {
83
+ const lowerMessage = message.toLowerCase();
84
+ if (browserFetchErrorMessages.some((pattern) => lowerMessage.includes(pattern))) {
85
+ return true;
86
+ }
87
+ if (hasNetworkMessage(message)) {
88
+ return true;
89
+ }
90
+ }
91
+ return false;
92
+ }
93
+ __name(isNetworkError, "isNetworkError");
44
94
  //# sourceMappingURL=utils.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/utils.ts"],
4
- "sourcesContent": ["//\n// Copyright \u00A9 2024 Hardcore Engineering Inc.\n//\n// Licensed under the Eclipse Public License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License. You may\n// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport type { LoginInfoByToken, LoginInfoRequest, WorkspaceLoginInfo } from './types'\n\nexport function isWorkspaceLoginInfo (loginInfo: LoginInfoByToken): loginInfo is WorkspaceLoginInfo {\n return !isLoginInfoRequest(loginInfo) && (loginInfo as WorkspaceLoginInfo)?.workspace != null\n}\n\nexport function isLoginInfoRequest (info: LoginInfoByToken): info is LoginInfoRequest {\n return (info as LoginInfoRequest)?.request\n}\n\nexport function getClientTimezone (): string | undefined {\n try {\n return Intl.DateTimeFormat().resolvedOptions().timeZone\n } catch (err: any) {\n console.error('Failed to get client timezone', err)\n return undefined\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBO,SAAS,qBAAsB,WAA8D;AAClG,SAAO,CAAC,mBAAmB,SAAS,KAAM,WAAkC,aAAa;AAC3F;AAFgB;AAIT,SAAS,mBAAoB,MAAkD;AACpF,SAAQ,MAA2B;AACrC;AAFgB;AAIT,SAAS,oBAAyC;AACvD,MAAI;AACF,WAAO,KAAK,eAAe,EAAE,gBAAgB,EAAE;AAAA,EACjD,SAAS,KAAU;AACjB,YAAQ,MAAM,iCAAiC,GAAG;AAClD,WAAO;AAAA,EACT;AACF;AAPgB;",
4
+ "sourcesContent": ["//\n// Copyright \u00A9 2026 Hardcore Engineering Inc.\n//\n// Licensed under the Eclipse Public License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License. You may\n// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport type { LoginInfoByToken, LoginInfoRequest, WorkspaceLoginInfo } from './types'\n\nexport function isWorkspaceLoginInfo (loginInfo: LoginInfoByToken): loginInfo is WorkspaceLoginInfo {\n return !isLoginInfoRequest(loginInfo) && (loginInfo as WorkspaceLoginInfo)?.workspace != null\n}\n\nexport function isLoginInfoRequest (info: LoginInfoByToken): info is LoginInfoRequest {\n return (info as LoginInfoRequest)?.request\n}\n\nexport function getClientTimezone (): string | undefined {\n try {\n return Intl.DateTimeFormat().resolvedOptions().timeZone\n } catch (err: any) {\n console.error('Failed to get client timezone', err)\n return undefined\n }\n}\n\nconst connectionErrorCodes = ['ECONNRESET', 'ECONNREFUSED', 'ENOTFOUND']\nconst networkErrorNames = ['NetworkError', 'TypeError', 'FetchError']\nconst browserFetchErrorMessages = ['failed to fetch', 'networkerror', 'network request failed']\nconst networkMessageKeywords = ['fetch', 'network', 'connection']\n\n/**\n * Check if a message contains network-related keywords\n */\nfunction hasNetworkMessage (message: string): boolean {\n const lowerMessage = message.toLowerCase()\n return networkMessageKeywords.some((keyword) => lowerMessage.includes(keyword))\n}\n\n/**\n * Check if an error is a network/connection error that should be retried\n */\nexport function isNetworkError (err: unknown): boolean {\n if (err == null) {\n return false\n }\n\n // Check Node.js-style connection error codes\n if (typeof err === 'object' && 'cause' in err) {\n const cause = (err as { cause?: unknown }).cause\n if (cause != null && typeof cause === 'object' && 'code' in cause) {\n const code = (cause as { code?: unknown }).code\n if (typeof code === 'string' && connectionErrorCodes.includes(code)) {\n return true\n }\n }\n }\n\n // Get error name and message (handles both Error instances and plain objects)\n let errorName: string | undefined\n let message: string | undefined\n\n if (err instanceof TypeError) {\n errorName = 'TypeError'\n message = err.message\n } else if (typeof err === 'object' && 'name' in err && 'message' in err) {\n const name = (err as { name?: unknown }).name\n const msg = (err as { message?: unknown }).message\n if (typeof name === 'string') {\n errorName = name\n }\n if (typeof msg === 'string') {\n message = msg\n }\n }\n\n // Check if error name matches network error types\n if (errorName != null && networkErrorNames.includes(errorName) && message != null) {\n const lowerMessage = message.toLowerCase()\n if (browserFetchErrorMessages.some((pattern) => lowerMessage.includes(pattern))) {\n return true\n }\n if (hasNetworkMessage(message)) {\n return true\n }\n }\n\n return false\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBO,SAAS,qBAAsB,WAA8D;AAClG,SAAO,CAAC,mBAAmB,SAAS,KAAM,WAAkC,aAAa;AAC3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AQ,kBAAkB,SAAS,SAAS,KAAK,WAAW,MAAM;AACjF,UAAM,eAAe,QAAQ,YAAY;AACzC,QAAI,0BAA0B,KAAK,CAAC,YAAY,aAAa,SAAS,OAAO,CAAC,GAAG;AAC/E,aAAO;AAAA,IACT;AACA,QAAI,kBAAkB,OAAO,GAAG;AAC9B,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;AA9CgB;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hcengineering/account-client",
3
- "version": "0.7.20",
3
+ "version": "0.7.423",
4
4
  "main": "lib/index.js",
5
5
  "svelte": "src/index.ts",
6
6
  "types": "types/index.d.ts",
@@ -13,19 +13,29 @@
13
13
  ],
14
14
  "author": "Hardcore Engineering Inc.",
15
15
  "license": "EPL-2.0",
16
+ "scripts": {
17
+ "build": "compile",
18
+ "build:watch": "compile",
19
+ "format": "format src",
20
+ "test": "jest --passWithNoTests --silent --coverage",
21
+ "_phase:build": "compile transpile src",
22
+ "_phase:test": "jest --passWithNoTests --silent --coverage",
23
+ "_phase:format": "format src",
24
+ "_phase:validate": "compile validate"
25
+ },
16
26
  "devDependencies": {
17
27
  "cross-env": "~7.0.3",
18
- "@hcengineering/platform-rig": "^0.7.19",
19
- "@types/node": "^22.15.29",
28
+ "@hcengineering/platform-rig": "^0.7.423",
29
+ "@types/node": "^22.18.1",
20
30
  "@typescript-eslint/eslint-plugin": "^6.21.0",
21
31
  "eslint-plugin-import": "^2.26.0",
22
32
  "eslint-plugin-promise": "^6.1.1",
23
33
  "eslint-plugin-n": "^15.4.0",
24
34
  "eslint": "^8.54.0",
25
- "esbuild": "^0.25.9",
35
+ "esbuild": "^0.25.10",
26
36
  "@typescript-eslint/parser": "^6.21.0",
27
37
  "eslint-config-standard-with-typescript": "^40.0.0",
28
- "prettier": "^3.1.0",
38
+ "prettier": "^3.6.2",
29
39
  "typescript": "^5.9.3",
30
40
  "jest": "^29.7.0",
31
41
  "ts-jest": "^29.1.1",
@@ -33,10 +43,13 @@
33
43
  "eslint-plugin-svelte": "^2.35.1"
34
44
  },
35
45
  "dependencies": {
36
- "@hcengineering/core": "^0.7.23",
37
- "@hcengineering/platform": "^0.7.19"
46
+ "@hcengineering/core": "^0.7.423",
47
+ "@hcengineering/platform": "^0.7.423"
48
+ },
49
+ "repository": {
50
+ "type": "git",
51
+ "url": "git+https://github.com/hcengineering/huly.core.git"
38
52
  },
39
- "repository": "https://github.com/hcengineering/huly.core",
40
53
  "publishConfig": {
41
54
  "access": "public"
42
55
  },
@@ -46,15 +59,5 @@
46
59
  "require": "./lib/index.js",
47
60
  "import": "./lib/index.js"
48
61
  }
49
- },
50
- "scripts": {
51
- "build": "compile",
52
- "build:watch": "compile",
53
- "format": "format src",
54
- "test": "jest --passWithNoTests --silent --coverage",
55
- "_phase:build": "compile transpile src",
56
- "_phase:test": "jest --passWithNoTests --silent --coverage",
57
- "_phase:format": "format src",
58
- "_phase:validate": "compile validate"
59
62
  }
60
- }
63
+ }