@sync-in/server 1.10.1 → 2.0.0

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 (1057) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/LICENSE +1 -1
  3. package/README.md +3 -11
  4. package/environment/environment.dist.min.yaml +1 -1
  5. package/environment/environment.dist.yaml +173 -28
  6. package/package.json +18 -17
  7. package/server/app.bootstrap.js +1 -5
  8. package/server/app.bootstrap.js.map +1 -1
  9. package/server/app.constants.js +1 -5
  10. package/server/app.constants.js.map +1 -1
  11. package/server/app.e2e-spec.js +1 -5
  12. package/server/app.e2e-spec.js.map +1 -1
  13. package/server/app.functions.js +1 -5
  14. package/server/app.functions.js.map +1 -1
  15. package/server/app.module.js +1 -5
  16. package/server/app.module.js.map +1 -1
  17. package/server/app.service.js +1 -5
  18. package/server/app.service.js.map +1 -1
  19. package/server/app.service.spec.js +2 -6
  20. package/server/app.service.spec.js.map +1 -1
  21. package/server/applications/admin/admin.module.js +1 -5
  22. package/server/applications/admin/admin.module.js.map +1 -1
  23. package/server/applications/admin/constants/routes.js +1 -5
  24. package/server/applications/admin/constants/routes.js.map +1 -1
  25. package/server/applications/admin/interfaces/check-update.interfaces.js +1 -5
  26. package/server/applications/admin/interfaces/check-update.interfaces.js.map +1 -1
  27. package/server/applications/admin/services/admin-scheduler.service.js +1 -5
  28. package/server/applications/admin/services/admin-scheduler.service.js.map +1 -1
  29. package/server/applications/admin/services/admin.service.js +13 -8
  30. package/server/applications/admin/services/admin.service.js.map +1 -1
  31. package/server/applications/admin/services/admin.service.spec.js +1 -5
  32. package/server/applications/admin/services/admin.service.spec.js.map +1 -1
  33. package/server/applications/admin/utils/check-update.js +1 -5
  34. package/server/applications/admin/utils/check-update.js.map +1 -1
  35. package/server/applications/applications.config.js +1 -5
  36. package/server/applications/applications.config.js.map +1 -1
  37. package/server/applications/applications.constants.js +5 -5
  38. package/server/applications/applications.constants.js.map +1 -1
  39. package/server/applications/applications.module.js +1 -5
  40. package/server/applications/applications.module.js.map +1 -1
  41. package/server/applications/comments/comments.controller.js +1 -5
  42. package/server/applications/comments/comments.controller.js.map +1 -1
  43. package/server/applications/comments/comments.controller.spec.js +1 -5
  44. package/server/applications/comments/comments.controller.spec.js.map +1 -1
  45. package/server/applications/comments/comments.module.js +1 -5
  46. package/server/applications/comments/comments.module.js.map +1 -1
  47. package/server/applications/comments/constants/routes.js +1 -5
  48. package/server/applications/comments/constants/routes.js.map +1 -1
  49. package/server/applications/comments/dto/comment.dto.js +1 -5
  50. package/server/applications/comments/dto/comment.dto.js.map +1 -1
  51. package/server/applications/comments/interfaces/comment-recent.interface.js +1 -5
  52. package/server/applications/comments/interfaces/comment-recent.interface.js.map +1 -1
  53. package/server/applications/comments/schemas/comment.interface.js +1 -5
  54. package/server/applications/comments/schemas/comment.interface.js.map +1 -1
  55. package/server/applications/comments/schemas/comments.schema.js +1 -5
  56. package/server/applications/comments/schemas/comments.schema.js.map +1 -1
  57. package/server/applications/comments/services/comments-manager.service.js +9 -7
  58. package/server/applications/comments/services/comments-manager.service.js.map +1 -1
  59. package/server/applications/comments/services/comments-manager.service.spec.js +10 -8
  60. package/server/applications/comments/services/comments-manager.service.spec.js.map +1 -1
  61. package/server/applications/comments/services/comments-queries.service.js +1 -5
  62. package/server/applications/comments/services/comments-queries.service.js.map +1 -1
  63. package/server/applications/files/adapters/files-indexer-mysql.service.js +29 -12
  64. package/server/applications/files/adapters/files-indexer-mysql.service.js.map +1 -1
  65. package/server/applications/files/adapters/files-indexer-mysql.service.spec.js +1 -5
  66. package/server/applications/files/adapters/files-indexer-mysql.service.spec.js.map +1 -1
  67. package/server/applications/files/constants/cache.js +1 -5
  68. package/server/applications/files/constants/cache.js.map +1 -1
  69. package/server/applications/files/constants/compress.js +1 -5
  70. package/server/applications/files/constants/compress.js.map +1 -1
  71. package/server/applications/files/constants/files.js +1 -5
  72. package/server/applications/files/constants/files.js.map +1 -1
  73. package/server/applications/files/constants/indexing.js +1 -5
  74. package/server/applications/files/constants/indexing.js.map +1 -1
  75. package/server/applications/files/constants/operations.js +1 -5
  76. package/server/applications/files/constants/operations.js.map +1 -1
  77. package/server/applications/files/constants/routes.js +1 -5
  78. package/server/applications/files/constants/routes.js.map +1 -1
  79. package/server/applications/files/constants/samples.js +1 -5
  80. package/server/applications/files/constants/samples.js.map +1 -1
  81. package/server/applications/files/dto/file-operations.dto.js +1 -5
  82. package/server/applications/files/dto/file-operations.dto.js.map +1 -1
  83. package/server/applications/files/events/file-task-event.js +1 -5
  84. package/server/applications/files/events/file-task-event.js.map +1 -1
  85. package/server/applications/files/files-tasks.controller.js +1 -5
  86. package/server/applications/files/files-tasks.controller.js.map +1 -1
  87. package/server/applications/files/files-tasks.controller.spec.js +1 -5
  88. package/server/applications/files/files-tasks.controller.spec.js.map +1 -1
  89. package/server/applications/files/files.config.js +1 -5
  90. package/server/applications/files/files.config.js.map +1 -1
  91. package/server/applications/files/files.controller.js +1 -5
  92. package/server/applications/files/files.controller.js.map +1 -1
  93. package/server/applications/files/files.controller.spec.js +1 -5
  94. package/server/applications/files/files.controller.spec.js.map +1 -1
  95. package/server/applications/files/files.module.js +1 -5
  96. package/server/applications/files/files.module.js.map +1 -1
  97. package/server/applications/files/interfaces/file-db-props.interface.js +1 -5
  98. package/server/applications/files/interfaces/file-db-props.interface.js.map +1 -1
  99. package/server/applications/files/interfaces/file-lock.interface.js +1 -5
  100. package/server/applications/files/interfaces/file-lock.interface.js.map +1 -1
  101. package/server/applications/files/interfaces/file-parse-index.js +1 -5
  102. package/server/applications/files/interfaces/file-parse-index.js.map +1 -1
  103. package/server/applications/files/interfaces/file-props.interface.js +1 -5
  104. package/server/applications/files/interfaces/file-props.interface.js.map +1 -1
  105. package/server/applications/files/interfaces/file-recent-location.interface.js +1 -5
  106. package/server/applications/files/interfaces/file-recent-location.interface.js.map +1 -1
  107. package/server/applications/files/interfaces/file-space.interface.js +1 -5
  108. package/server/applications/files/interfaces/file-space.interface.js.map +1 -1
  109. package/server/applications/files/interfaces/file-tree.interface.js +1 -5
  110. package/server/applications/files/interfaces/file-tree.interface.js.map +1 -1
  111. package/server/applications/files/models/file-error.js +1 -5
  112. package/server/applications/files/models/file-error.js.map +1 -1
  113. package/server/applications/files/models/file-lock-error.js +1 -5
  114. package/server/applications/files/models/file-lock-error.js.map +1 -1
  115. package/server/applications/files/models/file-task.js +1 -5
  116. package/server/applications/files/models/file-task.js.map +1 -1
  117. package/server/applications/files/models/files-indexer.js +1 -5
  118. package/server/applications/files/models/files-indexer.js.map +1 -1
  119. package/server/applications/files/modules/collabora-online/collabora-online-environment.decorator.js +1 -5
  120. package/server/applications/files/modules/collabora-online/collabora-online-environment.decorator.js.map +1 -1
  121. package/server/applications/files/modules/collabora-online/collabora-online-manager.service.js +21 -10
  122. package/server/applications/files/modules/collabora-online/collabora-online-manager.service.js.map +1 -1
  123. package/server/applications/files/modules/collabora-online/collabora-online-manager.service.spec.js +1 -5
  124. package/server/applications/files/modules/collabora-online/collabora-online-manager.service.spec.js.map +1 -1
  125. package/server/applications/files/modules/collabora-online/collabora-online.config.js +1 -5
  126. package/server/applications/files/modules/collabora-online/collabora-online.config.js.map +1 -1
  127. package/server/applications/files/modules/collabora-online/collabora-online.constants.js +1 -5
  128. package/server/applications/files/modules/collabora-online/collabora-online.constants.js.map +1 -1
  129. package/server/applications/files/modules/collabora-online/collabora-online.controller.js +1 -5
  130. package/server/applications/files/modules/collabora-online/collabora-online.controller.js.map +1 -1
  131. package/server/applications/files/modules/collabora-online/collabora-online.controller.spec.js +1 -5
  132. package/server/applications/files/modules/collabora-online/collabora-online.controller.spec.js.map +1 -1
  133. package/server/applications/files/modules/collabora-online/collabora-online.dtos.js +1 -5
  134. package/server/applications/files/modules/collabora-online/collabora-online.dtos.js.map +1 -1
  135. package/server/applications/files/modules/collabora-online/collabora-online.guard.js +1 -5
  136. package/server/applications/files/modules/collabora-online/collabora-online.guard.js.map +1 -1
  137. package/server/applications/files/modules/collabora-online/collabora-online.guard.spec.js +1 -5
  138. package/server/applications/files/modules/collabora-online/collabora-online.guard.spec.js.map +1 -1
  139. package/server/applications/files/modules/collabora-online/collabora-online.interface.js +1 -5
  140. package/server/applications/files/modules/collabora-online/collabora-online.interface.js.map +1 -1
  141. package/server/applications/files/modules/collabora-online/collabora-online.module.js +1 -5
  142. package/server/applications/files/modules/collabora-online/collabora-online.module.js.map +1 -1
  143. package/server/applications/files/modules/collabora-online/collabora-online.routes.js +1 -5
  144. package/server/applications/files/modules/collabora-online/collabora-online.routes.js.map +1 -1
  145. package/server/applications/files/modules/collabora-online/collabora-online.strategy.js +1 -5
  146. package/server/applications/files/modules/collabora-online/collabora-online.strategy.js.map +1 -1
  147. package/server/applications/files/modules/collabora-online/collabora-online.utils.js +1 -5
  148. package/server/applications/files/modules/collabora-online/collabora-online.utils.js.map +1 -1
  149. package/server/applications/files/modules/file-editor-providers.interface.js +6 -0
  150. package/server/applications/files/modules/file-editor-providers.interface.js.map +1 -0
  151. package/server/applications/files/modules/only-office/only-office-environment.decorator.js +1 -5
  152. package/server/applications/files/modules/only-office/only-office-environment.decorator.js.map +1 -1
  153. package/server/applications/files/modules/only-office/only-office-manager.service.js +57 -19
  154. package/server/applications/files/modules/only-office/only-office-manager.service.js.map +1 -1
  155. package/server/applications/files/modules/only-office/only-office-manager.service.spec.js +1 -5
  156. package/server/applications/files/modules/only-office/only-office-manager.service.spec.js.map +1 -1
  157. package/server/applications/files/modules/only-office/only-office.config.js +1 -5
  158. package/server/applications/files/modules/only-office/only-office.config.js.map +1 -1
  159. package/server/applications/files/modules/only-office/only-office.constants.js +1 -5
  160. package/server/applications/files/modules/only-office/only-office.constants.js.map +1 -1
  161. package/server/applications/files/modules/only-office/only-office.controller.js +1 -5
  162. package/server/applications/files/modules/only-office/only-office.controller.js.map +1 -1
  163. package/server/applications/files/modules/only-office/only-office.controller.spec.js +1 -5
  164. package/server/applications/files/modules/only-office/only-office.controller.spec.js.map +1 -1
  165. package/server/applications/files/modules/only-office/only-office.dtos.js +1 -5
  166. package/server/applications/files/modules/only-office/only-office.dtos.js.map +1 -1
  167. package/server/applications/files/modules/only-office/only-office.guard.js +1 -5
  168. package/server/applications/files/modules/only-office/only-office.guard.js.map +1 -1
  169. package/server/applications/files/modules/only-office/only-office.guard.spec.js +1 -5
  170. package/server/applications/files/modules/only-office/only-office.guard.spec.js.map +1 -1
  171. package/server/applications/files/modules/only-office/only-office.interface.js +1 -5
  172. package/server/applications/files/modules/only-office/only-office.interface.js.map +1 -1
  173. package/server/applications/files/modules/only-office/only-office.module.js +1 -5
  174. package/server/applications/files/modules/only-office/only-office.module.js.map +1 -1
  175. package/server/applications/files/modules/only-office/only-office.routes.js +1 -5
  176. package/server/applications/files/modules/only-office/only-office.routes.js.map +1 -1
  177. package/server/applications/files/modules/only-office/only-office.strategy.js +1 -5
  178. package/server/applications/files/modules/only-office/only-office.strategy.js.map +1 -1
  179. package/server/applications/files/schemas/file-content.interface.js +1 -5
  180. package/server/applications/files/schemas/file-content.interface.js.map +1 -1
  181. package/server/applications/files/schemas/file-recent.interface.js +1 -5
  182. package/server/applications/files/schemas/file-recent.interface.js.map +1 -1
  183. package/server/applications/files/schemas/file.interface.js +1 -5
  184. package/server/applications/files/schemas/file.interface.js.map +1 -1
  185. package/server/applications/files/schemas/files-content.schema.js +1 -5
  186. package/server/applications/files/schemas/files-content.schema.js.map +1 -1
  187. package/server/applications/files/schemas/files-recents.schema.js +1 -5
  188. package/server/applications/files/schemas/files-recents.schema.js.map +1 -1
  189. package/server/applications/files/schemas/files.schema.js +1 -5
  190. package/server/applications/files/schemas/files.schema.js.map +1 -1
  191. package/server/applications/files/services/files-content-manager.service.js +45 -16
  192. package/server/applications/files/services/files-content-manager.service.js.map +1 -1
  193. package/server/applications/files/services/files-lock-manager.service.js +53 -18
  194. package/server/applications/files/services/files-lock-manager.service.js.map +1 -1
  195. package/server/applications/files/services/files-lock-manager.service.spec.js +1 -5
  196. package/server/applications/files/services/files-lock-manager.service.spec.js.map +1 -1
  197. package/server/applications/files/services/files-manager.service.js +77 -24
  198. package/server/applications/files/services/files-manager.service.js.map +1 -1
  199. package/server/applications/files/services/files-manager.service.spec.js +1 -5
  200. package/server/applications/files/services/files-manager.service.spec.js.map +1 -1
  201. package/server/applications/files/services/files-methods.service.js +5 -6
  202. package/server/applications/files/services/files-methods.service.js.map +1 -1
  203. package/server/applications/files/services/files-methods.service.spec.js +1 -5
  204. package/server/applications/files/services/files-methods.service.spec.js.map +1 -1
  205. package/server/applications/files/services/files-parser.service.js +13 -8
  206. package/server/applications/files/services/files-parser.service.js.map +1 -1
  207. package/server/applications/files/services/files-parser.service.spec.js +1 -5
  208. package/server/applications/files/services/files-parser.service.spec.js.map +1 -1
  209. package/server/applications/files/services/files-queries.service.js +29 -12
  210. package/server/applications/files/services/files-queries.service.js.map +1 -1
  211. package/server/applications/files/services/files-recents.service.js +1 -5
  212. package/server/applications/files/services/files-recents.service.js.map +1 -1
  213. package/server/applications/files/services/files-recents.service.spec.js +1 -5
  214. package/server/applications/files/services/files-recents.service.spec.js.map +1 -1
  215. package/server/applications/files/services/files-scheduler.service.js +77 -24
  216. package/server/applications/files/services/files-scheduler.service.js.map +1 -1
  217. package/server/applications/files/services/files-search-manager.service.js +9 -7
  218. package/server/applications/files/services/files-search-manager.service.js.map +1 -1
  219. package/server/applications/files/services/files-search-manager.service.spec.js +1 -5
  220. package/server/applications/files/services/files-search-manager.service.spec.js.map +1 -1
  221. package/server/applications/files/services/files-tasks-manager.service.js +77 -24
  222. package/server/applications/files/services/files-tasks-manager.service.js.map +1 -1
  223. package/server/applications/files/services/files-tasks-manager.service.spec.js +1 -5
  224. package/server/applications/files/services/files-tasks-manager.service.spec.js.map +1 -1
  225. package/server/applications/files/utils/doc-textify/adapters/excel.js +1 -5
  226. package/server/applications/files/utils/doc-textify/adapters/excel.js.map +1 -1
  227. package/server/applications/files/utils/doc-textify/adapters/html.js +1 -5
  228. package/server/applications/files/utils/doc-textify/adapters/html.js.map +1 -1
  229. package/server/applications/files/utils/doc-textify/adapters/open-office.js +1 -5
  230. package/server/applications/files/utils/doc-textify/adapters/open-office.js.map +1 -1
  231. package/server/applications/files/utils/doc-textify/adapters/pdf.js +1 -5
  232. package/server/applications/files/utils/doc-textify/adapters/pdf.js.map +1 -1
  233. package/server/applications/files/utils/doc-textify/adapters/power-point.js +1 -5
  234. package/server/applications/files/utils/doc-textify/adapters/power-point.js.map +1 -1
  235. package/server/applications/files/utils/doc-textify/adapters/text.js +1 -5
  236. package/server/applications/files/utils/doc-textify/adapters/text.js.map +1 -1
  237. package/server/applications/files/utils/doc-textify/adapters/word.js +1 -5
  238. package/server/applications/files/utils/doc-textify/adapters/word.js.map +1 -1
  239. package/server/applications/files/utils/doc-textify/doc-textify.js +1 -5
  240. package/server/applications/files/utils/doc-textify/doc-textify.js.map +1 -1
  241. package/server/applications/files/utils/doc-textify/interfaces/doc-textify.interfaces.js +1 -5
  242. package/server/applications/files/utils/doc-textify/interfaces/doc-textify.interfaces.js.map +1 -1
  243. package/server/applications/files/utils/doc-textify/utils/clean.js +1 -5
  244. package/server/applications/files/utils/doc-textify/utils/clean.js.map +1 -1
  245. package/server/applications/files/utils/files-search.js +1 -5
  246. package/server/applications/files/utils/files-search.js.map +1 -1
  247. package/server/applications/files/utils/files-tree.js +1 -5
  248. package/server/applications/files/utils/files-tree.js.map +1 -1
  249. package/server/applications/files/utils/files.js +1 -5
  250. package/server/applications/files/utils/files.js.map +1 -1
  251. package/server/applications/files/utils/send-file.js +1 -5
  252. package/server/applications/files/utils/send-file.js.map +1 -1
  253. package/server/applications/files/utils/unzip-file.js +1 -5
  254. package/server/applications/files/utils/unzip-file.js.map +1 -1
  255. package/server/applications/files/utils/url-file.js +1 -5
  256. package/server/applications/files/utils/url-file.js.map +1 -1
  257. package/server/applications/links/constants/cache.js +1 -5
  258. package/server/applications/links/constants/cache.js.map +1 -1
  259. package/server/applications/links/constants/links.js +1 -5
  260. package/server/applications/links/constants/links.js.map +1 -1
  261. package/server/applications/links/constants/routes.js +1 -5
  262. package/server/applications/links/constants/routes.js.map +1 -1
  263. package/server/applications/links/dto/create-or-update-link.dto.js +1 -5
  264. package/server/applications/links/dto/create-or-update-link.dto.js.map +1 -1
  265. package/server/applications/links/interfaces/link-guest.interface.js +1 -5
  266. package/server/applications/links/interfaces/link-guest.interface.js.map +1 -1
  267. package/server/applications/links/interfaces/link-space.interface.js +1 -5
  268. package/server/applications/links/interfaces/link-space.interface.js.map +1 -1
  269. package/server/applications/links/links.controller.js +1 -5
  270. package/server/applications/links/links.controller.js.map +1 -1
  271. package/server/applications/links/links.controller.spec.js +1 -5
  272. package/server/applications/links/links.controller.spec.js.map +1 -1
  273. package/server/applications/links/schemas/link.interface.js +1 -5
  274. package/server/applications/links/schemas/link.interface.js.map +1 -1
  275. package/server/applications/links/schemas/links.schema.js +1 -5
  276. package/server/applications/links/schemas/links.schema.js.map +1 -1
  277. package/server/applications/links/services/links-manager.service.js +55 -20
  278. package/server/applications/links/services/links-manager.service.js.map +1 -1
  279. package/server/applications/links/services/links-manager.service.spec.js +3 -7
  280. package/server/applications/links/services/links-manager.service.spec.js.map +1 -1
  281. package/server/applications/links/services/links-queries.service.js +1 -5
  282. package/server/applications/links/services/links-queries.service.js.map +1 -1
  283. package/server/applications/notifications/constants/notifications.js +1 -5
  284. package/server/applications/notifications/constants/notifications.js.map +1 -1
  285. package/server/applications/notifications/constants/routes.js +1 -5
  286. package/server/applications/notifications/constants/routes.js.map +1 -1
  287. package/server/applications/notifications/constants/websocket.js +1 -5
  288. package/server/applications/notifications/constants/websocket.js.map +1 -1
  289. package/server/applications/notifications/i18n/de.js +1 -9
  290. package/server/applications/notifications/i18n/de.js.map +1 -1
  291. package/server/applications/notifications/i18n/es.js +1 -5
  292. package/server/applications/notifications/i18n/es.js.map +1 -1
  293. package/server/applications/notifications/i18n/fr.js +1 -5
  294. package/server/applications/notifications/i18n/fr.js.map +1 -1
  295. package/server/applications/notifications/i18n/hi.js +1 -5
  296. package/server/applications/notifications/i18n/hi.js.map +1 -1
  297. package/server/applications/notifications/i18n/index.js +1 -5
  298. package/server/applications/notifications/i18n/index.js.map +1 -1
  299. package/server/applications/notifications/i18n/it.js +1 -5
  300. package/server/applications/notifications/i18n/it.js.map +1 -1
  301. package/server/applications/notifications/i18n/ja.js +1 -5
  302. package/server/applications/notifications/i18n/ja.js.map +1 -1
  303. package/server/applications/notifications/i18n/ko.js +1 -5
  304. package/server/applications/notifications/i18n/ko.js.map +1 -1
  305. package/server/applications/notifications/i18n/pl.js +1 -5
  306. package/server/applications/notifications/i18n/pl.js.map +1 -1
  307. package/server/applications/notifications/i18n/pt.js +1 -5
  308. package/server/applications/notifications/i18n/pt.js.map +1 -1
  309. package/server/applications/notifications/i18n/pt_br.js +1 -5
  310. package/server/applications/notifications/i18n/pt_br.js.map +1 -1
  311. package/server/applications/notifications/i18n/ru.js +1 -5
  312. package/server/applications/notifications/i18n/ru.js.map +1 -1
  313. package/server/applications/notifications/i18n/tr.js +1 -5
  314. package/server/applications/notifications/i18n/tr.js.map +1 -1
  315. package/server/applications/notifications/i18n/zh.js +1 -5
  316. package/server/applications/notifications/i18n/zh.js.map +1 -1
  317. package/server/applications/notifications/interfaces/notification-properties.interface.js +1 -5
  318. package/server/applications/notifications/interfaces/notification-properties.interface.js.map +1 -1
  319. package/server/applications/notifications/interfaces/user-mail-notification.interface.js +1 -5
  320. package/server/applications/notifications/interfaces/user-mail-notification.interface.js.map +1 -1
  321. package/server/applications/notifications/mails/models.js +1 -5
  322. package/server/applications/notifications/mails/models.js.map +1 -1
  323. package/server/applications/notifications/mails/templates.js +1 -5
  324. package/server/applications/notifications/mails/templates.js.map +1 -1
  325. package/server/applications/notifications/mails/urls.js +1 -5
  326. package/server/applications/notifications/mails/urls.js.map +1 -1
  327. package/server/applications/notifications/notifications.controller.js +1 -5
  328. package/server/applications/notifications/notifications.controller.js.map +1 -1
  329. package/server/applications/notifications/notifications.controller.spec.js +1 -5
  330. package/server/applications/notifications/notifications.controller.spec.js.map +1 -1
  331. package/server/applications/notifications/notifications.gateway.js +1 -5
  332. package/server/applications/notifications/notifications.gateway.js.map +1 -1
  333. package/server/applications/notifications/notifications.module.js +1 -5
  334. package/server/applications/notifications/notifications.module.js.map +1 -1
  335. package/server/applications/notifications/schemas/notification.interface.js +1 -5
  336. package/server/applications/notifications/schemas/notification.interface.js.map +1 -1
  337. package/server/applications/notifications/schemas/notifications.schema.js +1 -5
  338. package/server/applications/notifications/schemas/notifications.schema.js.map +1 -1
  339. package/server/applications/notifications/services/notifications-manager.service.js +25 -11
  340. package/server/applications/notifications/services/notifications-manager.service.js.map +1 -1
  341. package/server/applications/notifications/services/notifications-manager.service.spec.js +20 -11
  342. package/server/applications/notifications/services/notifications-manager.service.spec.js.map +1 -1
  343. package/server/applications/notifications/services/notifications-queries.service.js +1 -5
  344. package/server/applications/notifications/services/notifications-queries.service.js.map +1 -1
  345. package/server/applications/shares/constants/routes.js +1 -5
  346. package/server/applications/shares/constants/routes.js.map +1 -1
  347. package/server/applications/shares/constants/shares.js +1 -5
  348. package/server/applications/shares/constants/shares.js.map +1 -1
  349. package/server/applications/shares/dto/create-or-update-share.dto.js +1 -5
  350. package/server/applications/shares/dto/create-or-update-share.dto.js.map +1 -1
  351. package/server/applications/shares/interfaces/share-child.interface.js +1 -5
  352. package/server/applications/shares/interfaces/share-child.interface.js.map +1 -1
  353. package/server/applications/shares/interfaces/share-env.interface.js +1 -5
  354. package/server/applications/shares/interfaces/share-env.interface.js.map +1 -1
  355. package/server/applications/shares/interfaces/share-file.interface.js +1 -5
  356. package/server/applications/shares/interfaces/share-file.interface.js.map +1 -1
  357. package/server/applications/shares/interfaces/share-link.interface.js +1 -5
  358. package/server/applications/shares/interfaces/share-link.interface.js.map +1 -1
  359. package/server/applications/shares/interfaces/share-props.interface.js +1 -5
  360. package/server/applications/shares/interfaces/share-props.interface.js.map +1 -1
  361. package/server/applications/shares/models/share-child.model.js +1 -5
  362. package/server/applications/shares/models/share-child.model.js.map +1 -1
  363. package/server/applications/shares/schemas/share-members.interface.js +1 -5
  364. package/server/applications/shares/schemas/share-members.interface.js.map +1 -1
  365. package/server/applications/shares/schemas/share.interface.js +1 -5
  366. package/server/applications/shares/schemas/share.interface.js.map +1 -1
  367. package/server/applications/shares/schemas/shares-members.schema.js +1 -5
  368. package/server/applications/shares/schemas/shares-members.schema.js.map +1 -1
  369. package/server/applications/shares/schemas/shares.schema.js +1 -5
  370. package/server/applications/shares/schemas/shares.schema.js.map +1 -1
  371. package/server/applications/shares/services/shares-manager.service.js +214 -68
  372. package/server/applications/shares/services/shares-manager.service.js.map +1 -1
  373. package/server/applications/shares/services/shares-manager.service.spec.js +1 -5
  374. package/server/applications/shares/services/shares-manager.service.spec.js.map +1 -1
  375. package/server/applications/shares/services/shares-queries.service.js +49 -17
  376. package/server/applications/shares/services/shares-queries.service.js.map +1 -1
  377. package/server/applications/shares/shares.controller.js +1 -5
  378. package/server/applications/shares/shares.controller.js.map +1 -1
  379. package/server/applications/shares/shares.controller.spec.js +1 -5
  380. package/server/applications/shares/shares.controller.spec.js.map +1 -1
  381. package/server/applications/shares/shares.module.js +1 -5
  382. package/server/applications/shares/shares.module.js.map +1 -1
  383. package/server/applications/spaces/constants/cache.js +1 -5
  384. package/server/applications/spaces/constants/cache.js.map +1 -1
  385. package/server/applications/spaces/constants/routes.js +1 -5
  386. package/server/applications/spaces/constants/routes.js.map +1 -1
  387. package/server/applications/spaces/constants/spaces.js +1 -5
  388. package/server/applications/spaces/constants/spaces.js.map +1 -1
  389. package/server/applications/spaces/decorators/space-override-permission.decorator.js +1 -5
  390. package/server/applications/spaces/decorators/space-override-permission.decorator.js.map +1 -1
  391. package/server/applications/spaces/decorators/space-skip-guard.decorator.js +1 -5
  392. package/server/applications/spaces/decorators/space-skip-guard.decorator.js.map +1 -1
  393. package/server/applications/spaces/decorators/space-skip-permissions.decorator.js +1 -5
  394. package/server/applications/spaces/decorators/space-skip-permissions.decorator.js.map +1 -1
  395. package/server/applications/spaces/decorators/space.decorator.js +1 -5
  396. package/server/applications/spaces/decorators/space.decorator.js.map +1 -1
  397. package/server/applications/spaces/dto/create-or-update-space.dto.js +1 -5
  398. package/server/applications/spaces/dto/create-or-update-space.dto.js.map +1 -1
  399. package/server/applications/spaces/dto/delete-space.dto.js +1 -5
  400. package/server/applications/spaces/dto/delete-space.dto.js.map +1 -1
  401. package/server/applications/spaces/dto/search-space.dto.js +1 -5
  402. package/server/applications/spaces/dto/search-space.dto.js.map +1 -1
  403. package/server/applications/spaces/dto/space-roots.dto.js +1 -5
  404. package/server/applications/spaces/dto/space-roots.dto.js.map +1 -1
  405. package/server/applications/spaces/guards/space.guard.js +17 -9
  406. package/server/applications/spaces/guards/space.guard.js.map +1 -1
  407. package/server/applications/spaces/guards/space.guard.spec.js +1 -5
  408. package/server/applications/spaces/guards/space.guard.spec.js.map +1 -1
  409. package/server/applications/spaces/interfaces/space-diff.interface.js +1 -5
  410. package/server/applications/spaces/interfaces/space-diff.interface.js.map +1 -1
  411. package/server/applications/spaces/interfaces/space-files.interface.js +1 -5
  412. package/server/applications/spaces/interfaces/space-files.interface.js.map +1 -1
  413. package/server/applications/spaces/interfaces/space-request.interface.js +1 -5
  414. package/server/applications/spaces/interfaces/space-request.interface.js.map +1 -1
  415. package/server/applications/spaces/interfaces/space-trash.interface.js +1 -5
  416. package/server/applications/spaces/interfaces/space-trash.interface.js.map +1 -1
  417. package/server/applications/spaces/models/space-env.model.js +1 -5
  418. package/server/applications/spaces/models/space-env.model.js.map +1 -1
  419. package/server/applications/spaces/models/space-props.model.js +1 -5
  420. package/server/applications/spaces/models/space-props.model.js.map +1 -1
  421. package/server/applications/spaces/models/space-root-props.model.js +1 -5
  422. package/server/applications/spaces/models/space-root-props.model.js.map +1 -1
  423. package/server/applications/spaces/models/space.model.js +1 -5
  424. package/server/applications/spaces/models/space.model.js.map +1 -1
  425. package/server/applications/spaces/schemas/space-members.interface.js +1 -5
  426. package/server/applications/spaces/schemas/space-members.interface.js.map +1 -1
  427. package/server/applications/spaces/schemas/space-root.interface.js +1 -5
  428. package/server/applications/spaces/schemas/space-root.interface.js.map +1 -1
  429. package/server/applications/spaces/schemas/space.interface.js +1 -5
  430. package/server/applications/spaces/schemas/space.interface.js.map +1 -1
  431. package/server/applications/spaces/schemas/spaces-members.schema.js +1 -5
  432. package/server/applications/spaces/schemas/spaces-members.schema.js.map +1 -1
  433. package/server/applications/spaces/schemas/spaces-roots.schema.js +1 -5
  434. package/server/applications/spaces/schemas/spaces-roots.schema.js.map +1 -1
  435. package/server/applications/spaces/schemas/spaces.schema.js +1 -5
  436. package/server/applications/spaces/schemas/spaces.schema.js.map +1 -1
  437. package/server/applications/spaces/services/spaces-browser.service.js +77 -24
  438. package/server/applications/spaces/services/spaces-browser.service.js.map +1 -1
  439. package/server/applications/spaces/services/spaces-browser.service.spec.js +1 -5
  440. package/server/applications/spaces/services/spaces-browser.service.spec.js.map +1 -1
  441. package/server/applications/spaces/services/spaces-manager.service.js +193 -53
  442. package/server/applications/spaces/services/spaces-manager.service.js.map +1 -1
  443. package/server/applications/spaces/services/spaces-manager.service.spec.js +1 -5
  444. package/server/applications/spaces/services/spaces-manager.service.spec.js.map +1 -1
  445. package/server/applications/spaces/services/spaces-queries.service.js +65 -21
  446. package/server/applications/spaces/services/spaces-queries.service.js.map +1 -1
  447. package/server/applications/spaces/services/spaces-scheduler.service.js +49 -17
  448. package/server/applications/spaces/services/spaces-scheduler.service.js.map +1 -1
  449. package/server/applications/spaces/spaces.controller.js +1 -5
  450. package/server/applications/spaces/spaces.controller.js.map +1 -1
  451. package/server/applications/spaces/spaces.controller.spec.js +1 -5
  452. package/server/applications/spaces/spaces.controller.spec.js.map +1 -1
  453. package/server/applications/spaces/spaces.module.js +1 -5
  454. package/server/applications/spaces/spaces.module.js.map +1 -1
  455. package/server/applications/spaces/utils/paths.js +1 -5
  456. package/server/applications/spaces/utils/paths.js.map +1 -1
  457. package/server/applications/spaces/utils/permissions.js +1 -5
  458. package/server/applications/spaces/utils/permissions.js.map +1 -1
  459. package/server/applications/spaces/utils/routes.js +1 -5
  460. package/server/applications/spaces/utils/routes.js.map +1 -1
  461. package/server/applications/sync/constants/auth.js +1 -5
  462. package/server/applications/sync/constants/auth.js.map +1 -1
  463. package/server/applications/sync/constants/routes.js +6 -5
  464. package/server/applications/sync/constants/routes.js.map +1 -1
  465. package/server/applications/sync/constants/store.js +1 -9
  466. package/server/applications/sync/constants/store.js.map +1 -1
  467. package/server/applications/sync/constants/sync.js +2 -6
  468. package/server/applications/sync/constants/sync.js.map +1 -1
  469. package/server/applications/sync/decorators/sync-context.decorator.js +1 -5
  470. package/server/applications/sync/decorators/sync-context.decorator.js.map +1 -1
  471. package/server/applications/sync/decorators/sync-environment.decorator.js +1 -5
  472. package/server/applications/sync/decorators/sync-environment.decorator.js.map +1 -1
  473. package/server/applications/sync/dtos/sync-client-auth.dto.js +12 -8
  474. package/server/applications/sync/dtos/sync-client-auth.dto.js.map +1 -1
  475. package/server/applications/sync/dtos/sync-client-info.dto.js +49 -0
  476. package/server/applications/sync/dtos/sync-client-info.dto.js.map +1 -0
  477. package/server/applications/sync/dtos/sync-client-registration.dto.js +34 -11
  478. package/server/applications/sync/dtos/sync-client-registration.dto.js.map +1 -1
  479. package/server/applications/sync/dtos/sync-operations.dto.js +1 -5
  480. package/server/applications/sync/dtos/sync-operations.dto.js.map +1 -1
  481. package/server/applications/sync/dtos/sync-path.dto.js +1 -5
  482. package/server/applications/sync/dtos/sync-path.dto.js.map +1 -1
  483. package/server/applications/sync/dtos/sync-upload.dto.js +1 -5
  484. package/server/applications/sync/dtos/sync-upload.dto.js.map +1 -1
  485. package/server/applications/sync/interceptors/sync-diff-gzip-body.interceptor.js +1 -5
  486. package/server/applications/sync/interceptors/sync-diff-gzip-body.interceptor.js.map +1 -1
  487. package/server/applications/sync/interceptors/sync-diff-gzip-body.interceptor.spec.js +1 -5
  488. package/server/applications/sync/interceptors/sync-diff-gzip-body.interceptor.spec.js.map +1 -1
  489. package/server/applications/sync/interfaces/store-manifest.interface.js +1 -5
  490. package/server/applications/sync/interfaces/store-manifest.interface.js.map +1 -1
  491. package/server/applications/sync/interfaces/sync-client-auth.interface.js +1 -25
  492. package/server/applications/sync/interfaces/sync-client-auth.interface.js.map +1 -1
  493. package/server/applications/sync/interfaces/sync-client-paths.interface.js +1 -5
  494. package/server/applications/sync/interfaces/sync-client-paths.interface.js.map +1 -1
  495. package/server/applications/sync/interfaces/sync-client.interface.js +1 -5
  496. package/server/applications/sync/interfaces/sync-client.interface.js.map +1 -1
  497. package/server/applications/sync/interfaces/sync-diff.interface.js +1 -5
  498. package/server/applications/sync/interfaces/sync-diff.interface.js.map +1 -1
  499. package/server/applications/sync/interfaces/sync-path.interface.js +1 -5
  500. package/server/applications/sync/interfaces/sync-path.interface.js.map +1 -1
  501. package/server/applications/sync/schemas/sync-client.interface.js +1 -5
  502. package/server/applications/sync/schemas/sync-client.interface.js.map +1 -1
  503. package/server/applications/sync/schemas/sync-clients.schema.js +1 -5
  504. package/server/applications/sync/schemas/sync-clients.schema.js.map +1 -1
  505. package/server/applications/sync/schemas/sync-path.interface.js +1 -5
  506. package/server/applications/sync/schemas/sync-path.interface.js.map +1 -1
  507. package/server/applications/sync/schemas/sync-paths.schema.js +1 -5
  508. package/server/applications/sync/schemas/sync-paths.schema.js.map +1 -1
  509. package/server/applications/sync/services/sync-clients-manager.service.js +108 -44
  510. package/server/applications/sync/services/sync-clients-manager.service.js.map +1 -1
  511. package/server/applications/sync/services/sync-clients-manager.service.spec.js +14 -17
  512. package/server/applications/sync/services/sync-clients-manager.service.spec.js.map +1 -1
  513. package/server/applications/sync/services/sync-manager.service.js +29 -12
  514. package/server/applications/sync/services/sync-manager.service.js.map +1 -1
  515. package/server/applications/sync/services/sync-manager.service.spec.js +1 -5
  516. package/server/applications/sync/services/sync-manager.service.spec.js.map +1 -1
  517. package/server/applications/sync/services/sync-paths-manager.service.js +27 -17
  518. package/server/applications/sync/services/sync-paths-manager.service.js.map +1 -1
  519. package/server/applications/sync/services/sync-paths-manager.service.spec.js +11 -15
  520. package/server/applications/sync/services/sync-paths-manager.service.spec.js.map +1 -1
  521. package/server/applications/sync/services/sync-queries.service.js +1 -5
  522. package/server/applications/sync/services/sync-queries.service.js.map +1 -1
  523. package/server/applications/sync/sync.config.js +1 -5
  524. package/server/applications/sync/sync.config.js.map +1 -1
  525. package/server/applications/sync/sync.controller.js +21 -6
  526. package/server/applications/sync/sync.controller.js.map +1 -1
  527. package/server/applications/sync/sync.controller.spec.js +1 -5
  528. package/server/applications/sync/sync.controller.spec.js.map +1 -1
  529. package/server/applications/sync/sync.module.js +1 -5
  530. package/server/applications/sync/sync.module.js.map +1 -1
  531. package/server/applications/sync/utils/functions.js +1 -5
  532. package/server/applications/sync/utils/functions.js.map +1 -1
  533. package/server/applications/sync/utils/normalizedMap.js +1 -5
  534. package/server/applications/sync/utils/normalizedMap.js.map +1 -1
  535. package/server/applications/sync/utils/routes.js +1 -5
  536. package/server/applications/sync/utils/routes.js.map +1 -1
  537. package/server/applications/users/admin-users.controller.js +2 -6
  538. package/server/applications/users/admin-users.controller.js.map +1 -1
  539. package/server/applications/users/admin-users.controller.spec.js +6 -10
  540. package/server/applications/users/admin-users.controller.spec.js.map +1 -1
  541. package/server/applications/users/constants/group.js +1 -5
  542. package/server/applications/users/constants/group.js.map +1 -1
  543. package/server/applications/users/constants/member.js +1 -5
  544. package/server/applications/users/constants/member.js.map +1 -1
  545. package/server/applications/users/constants/routes.js +1 -5
  546. package/server/applications/users/constants/routes.js.map +1 -1
  547. package/server/applications/users/constants/user.js +1 -5
  548. package/server/applications/users/constants/user.js.map +1 -1
  549. package/server/applications/users/constants/websocket.js +1 -5
  550. package/server/applications/users/constants/websocket.js.map +1 -1
  551. package/server/applications/users/decorators/permissions.decorator.js +1 -5
  552. package/server/applications/users/decorators/permissions.decorator.js.map +1 -1
  553. package/server/applications/users/decorators/roles.decorator.js +1 -5
  554. package/server/applications/users/decorators/roles.decorator.js.map +1 -1
  555. package/server/applications/users/decorators/user.decorator.js +1 -5
  556. package/server/applications/users/decorators/user.decorator.js.map +1 -1
  557. package/server/applications/users/dto/create-or-update-group.dto.js +1 -5
  558. package/server/applications/users/dto/create-or-update-group.dto.js.map +1 -1
  559. package/server/applications/users/dto/create-or-update-user.dto.js +1 -5
  560. package/server/applications/users/dto/create-or-update-user.dto.js.map +1 -1
  561. package/server/applications/users/dto/delete-user.dto.js +1 -5
  562. package/server/applications/users/dto/delete-user.dto.js.map +1 -1
  563. package/server/applications/users/dto/search-members.dto.js +1 -5
  564. package/server/applications/users/dto/search-members.dto.js.map +1 -1
  565. package/server/applications/users/dto/user-properties.dto.js +1 -5
  566. package/server/applications/users/dto/user-properties.dto.js.map +1 -1
  567. package/server/applications/users/guards/permissions.guard.js +1 -5
  568. package/server/applications/users/guards/permissions.guard.js.map +1 -1
  569. package/server/applications/users/guards/permissions.guard.spec.js +1 -5
  570. package/server/applications/users/guards/permissions.guard.spec.js.map +1 -1
  571. package/server/applications/users/guards/roles.guard.js +1 -5
  572. package/server/applications/users/guards/roles.guard.js.map +1 -1
  573. package/server/applications/users/guards/roles.guard.spec.js +1 -5
  574. package/server/applications/users/guards/roles.guard.spec.js.map +1 -1
  575. package/server/applications/users/interfaces/admin-group.interface.js +1 -5
  576. package/server/applications/users/interfaces/admin-group.interface.js.map +1 -1
  577. package/server/applications/users/interfaces/admin-user.interface.js +1 -5
  578. package/server/applications/users/interfaces/admin-user.interface.js.map +1 -1
  579. package/server/applications/users/interfaces/group-browse.interface.js +1 -5
  580. package/server/applications/users/interfaces/group-browse.interface.js.map +1 -1
  581. package/server/applications/users/interfaces/group-member.js +1 -5
  582. package/server/applications/users/interfaces/group-member.js.map +1 -1
  583. package/server/applications/users/interfaces/guest-user.interface.js +1 -5
  584. package/server/applications/users/interfaces/guest-user.interface.js.map +1 -1
  585. package/server/applications/users/interfaces/member.interface.js +1 -5
  586. package/server/applications/users/interfaces/member.interface.js.map +1 -1
  587. package/server/applications/users/interfaces/owner.interface.js +1 -5
  588. package/server/applications/users/interfaces/owner.interface.js.map +1 -1
  589. package/server/applications/users/interfaces/user-secrets.interface.js +1 -5
  590. package/server/applications/users/interfaces/user-secrets.interface.js.map +1 -1
  591. package/server/applications/users/interfaces/websocket.interface.js +1 -5
  592. package/server/applications/users/interfaces/websocket.interface.js.map +1 -1
  593. package/server/applications/users/models/user.model.js +1 -5
  594. package/server/applications/users/models/user.model.js.map +1 -1
  595. package/server/applications/users/schemas/group.interface.js +1 -5
  596. package/server/applications/users/schemas/group.interface.js.map +1 -1
  597. package/server/applications/users/schemas/groups.schema.js +1 -5
  598. package/server/applications/users/schemas/groups.schema.js.map +1 -1
  599. package/server/applications/users/schemas/user-group.interface.js +1 -5
  600. package/server/applications/users/schemas/user-group.interface.js.map +1 -1
  601. package/server/applications/users/schemas/user.interface.js +1 -5
  602. package/server/applications/users/schemas/user.interface.js.map +1 -1
  603. package/server/applications/users/schemas/users-groups.schema.js +1 -5
  604. package/server/applications/users/schemas/users-groups.schema.js.map +1 -1
  605. package/server/applications/users/schemas/users-guests.schema.js +1 -5
  606. package/server/applications/users/schemas/users-guests.schema.js.map +1 -1
  607. package/server/applications/users/schemas/users.schema.js +1 -5
  608. package/server/applications/users/schemas/users.schema.js.map +1 -1
  609. package/server/applications/users/services/admin-users-manager.service.js +67 -23
  610. package/server/applications/users/services/admin-users-manager.service.js.map +1 -1
  611. package/server/applications/users/services/admin-users-manager.service.spec.js +3 -7
  612. package/server/applications/users/services/admin-users-manager.service.spec.js.map +1 -1
  613. package/server/applications/users/services/admin-users-queries.service.js +65 -21
  614. package/server/applications/users/services/admin-users-queries.service.js.map +1 -1
  615. package/server/applications/users/services/users-manager.service.js +81 -25
  616. package/server/applications/users/services/users-manager.service.js.map +1 -1
  617. package/server/applications/users/services/users-manager.service.spec.js +14 -12
  618. package/server/applications/users/services/users-manager.service.spec.js.map +1 -1
  619. package/server/applications/users/services/users-queries.service.js +49 -17
  620. package/server/applications/users/services/users-queries.service.js.map +1 -1
  621. package/server/applications/users/users.controller.js +2 -6
  622. package/server/applications/users/users.controller.js.map +1 -1
  623. package/server/applications/users/users.controller.spec.js +5 -9
  624. package/server/applications/users/users.controller.spec.js.map +1 -1
  625. package/server/applications/users/users.e2e-spec.js +3 -7
  626. package/server/applications/users/users.e2e-spec.js.map +1 -1
  627. package/server/applications/users/users.gateway.js +29 -12
  628. package/server/applications/users/users.gateway.js.map +1 -1
  629. package/server/applications/users/users.gateway.spec.js +1 -5
  630. package/server/applications/users/users.gateway.spec.js.map +1 -1
  631. package/server/applications/users/users.module.js +1 -5
  632. package/server/applications/users/users.module.js.map +1 -1
  633. package/server/applications/users/utils/avatar.js +1 -5
  634. package/server/applications/users/utils/avatar.js.map +1 -1
  635. package/server/applications/users/utils/test.js +1 -5
  636. package/server/applications/users/utils/test.js.map +1 -1
  637. package/server/applications/webdav/constants/routes.js +1 -5
  638. package/server/applications/webdav/constants/routes.js.map +1 -1
  639. package/server/applications/webdav/constants/webdav.js +1 -5
  640. package/server/applications/webdav/constants/webdav.js.map +1 -1
  641. package/server/applications/webdav/decorators/if-header.decorator.js +1 -5
  642. package/server/applications/webdav/decorators/if-header.decorator.js.map +1 -1
  643. package/server/applications/webdav/decorators/webdav-context.decorator.js +1 -5
  644. package/server/applications/webdav/decorators/webdav-context.decorator.js.map +1 -1
  645. package/server/applications/webdav/filters/webdav.filter.js +1 -5
  646. package/server/applications/webdav/filters/webdav.filter.js.map +1 -1
  647. package/server/applications/webdav/filters/webdav.filter.spec.js +1 -5
  648. package/server/applications/webdav/filters/webdav.filter.spec.js.map +1 -1
  649. package/server/applications/webdav/guards/webdav-protocol.guard.js +54 -20
  650. package/server/applications/webdav/guards/webdav-protocol.guard.js.map +1 -1
  651. package/server/applications/webdav/guards/webdav-protocol.guard.spec.js +54 -0
  652. package/server/applications/webdav/guards/webdav-protocol.guard.spec.js.map +1 -1
  653. package/server/applications/webdav/interfaces/if-header.interface.js +1 -5
  654. package/server/applications/webdav/interfaces/if-header.interface.js.map +1 -1
  655. package/server/applications/webdav/interfaces/webdav.interface.js +1 -5
  656. package/server/applications/webdav/interfaces/webdav.interface.js.map +1 -1
  657. package/server/applications/webdav/models/webdav-file.model.js +1 -5
  658. package/server/applications/webdav/models/webdav-file.model.js.map +1 -1
  659. package/server/applications/webdav/services/webdav-methods.service.js +74 -26
  660. package/server/applications/webdav/services/webdav-methods.service.js.map +1 -1
  661. package/server/applications/webdav/services/webdav-methods.service.spec.js +15 -18
  662. package/server/applications/webdav/services/webdav-methods.service.spec.js.map +1 -1
  663. package/server/applications/webdav/services/webdav-spaces.service.js +17 -9
  664. package/server/applications/webdav/services/webdav-spaces.service.js.map +1 -1
  665. package/server/applications/webdav/services/webdav-spaces.service.spec.js +1 -5
  666. package/server/applications/webdav/services/webdav-spaces.service.spec.js.map +1 -1
  667. package/server/applications/webdav/utils/bootstrap.js +1 -5
  668. package/server/applications/webdav/utils/bootstrap.js.map +1 -1
  669. package/server/applications/webdav/utils/if-header.js +1 -5
  670. package/server/applications/webdav/utils/if-header.js.map +1 -1
  671. package/server/applications/webdav/utils/routes.js +1 -5
  672. package/server/applications/webdav/utils/routes.js.map +1 -1
  673. package/server/applications/webdav/utils/webdav.js +1 -5
  674. package/server/applications/webdav/utils/webdav.js.map +1 -1
  675. package/server/applications/webdav/utils/xml.js +1 -5
  676. package/server/applications/webdav/utils/xml.js.map +1 -1
  677. package/server/applications/webdav/webdav.controller.js +1 -5
  678. package/server/applications/webdav/webdav.controller.js.map +1 -1
  679. package/server/applications/webdav/webdav.controller.spec.js +1 -5
  680. package/server/applications/webdav/webdav.controller.spec.js.map +1 -1
  681. package/server/applications/webdav/webdav.e2e-spec.js +1 -5
  682. package/server/applications/webdav/webdav.e2e-spec.js.map +1 -1
  683. package/server/applications/webdav/webdav.module.js +1 -5
  684. package/server/applications/webdav/webdav.module.js.map +1 -1
  685. package/server/authentication/auth.config.js +23 -123
  686. package/server/authentication/auth.config.js.map +1 -1
  687. package/server/authentication/auth.controller.js +27 -21
  688. package/server/authentication/auth.controller.js.map +1 -1
  689. package/server/authentication/auth.controller.spec.js +6 -10
  690. package/server/authentication/auth.controller.spec.js.map +1 -1
  691. package/server/authentication/auth.e2e-spec.js +1 -5
  692. package/server/authentication/auth.e2e-spec.js.map +1 -1
  693. package/server/authentication/auth.module.js +17 -20
  694. package/server/authentication/auth.module.js.map +1 -1
  695. package/server/authentication/{services/auth-manager.service.js → auth.service.js} +41 -18
  696. package/server/authentication/auth.service.js.map +1 -0
  697. package/server/authentication/{services/auth-manager.service.spec.js → auth.service.spec.js} +6 -10
  698. package/server/authentication/auth.service.spec.js.map +1 -0
  699. package/server/authentication/constants/auth.js +1 -5
  700. package/server/authentication/constants/auth.js.map +1 -1
  701. package/server/authentication/constants/routes.js +41 -30
  702. package/server/authentication/constants/routes.js.map +1 -1
  703. package/server/authentication/constants/scope.js +2 -5
  704. package/server/authentication/constants/scope.js.map +1 -1
  705. package/server/authentication/decorators/auth-token-optional.decorator.js +1 -5
  706. package/server/authentication/decorators/auth-token-optional.decorator.js.map +1 -1
  707. package/server/authentication/decorators/auth-token-skip.decorator.js +1 -5
  708. package/server/authentication/decorators/auth-token-skip.decorator.js.map +1 -1
  709. package/server/authentication/dto/login-response.dto.js +1 -10
  710. package/server/authentication/dto/login-response.dto.js.map +1 -1
  711. package/server/authentication/dto/token-response.dto.js +1 -5
  712. package/server/authentication/dto/token-response.dto.js.map +1 -1
  713. package/server/authentication/guards/auth-anonymous.guard.js +1 -5
  714. package/server/authentication/guards/auth-anonymous.guard.js.map +1 -1
  715. package/server/authentication/guards/auth-anonymous.guard.spec.js +1 -5
  716. package/server/authentication/guards/auth-anonymous.guard.spec.js.map +1 -1
  717. package/server/authentication/guards/auth-anonymous.strategy.js +1 -5
  718. package/server/authentication/guards/auth-anonymous.strategy.js.map +1 -1
  719. package/server/authentication/guards/auth-basic.guard.js +1 -5
  720. package/server/authentication/guards/auth-basic.guard.js.map +1 -1
  721. package/server/authentication/guards/auth-basic.guard.spec.js +13 -14
  722. package/server/authentication/guards/auth-basic.guard.spec.js.map +1 -1
  723. package/server/authentication/guards/auth-basic.strategy.js +10 -11
  724. package/server/authentication/guards/auth-basic.strategy.js.map +1 -1
  725. package/server/authentication/guards/auth-digest.guard.js +1 -5
  726. package/server/authentication/guards/auth-digest.guard.js.map +1 -1
  727. package/server/authentication/guards/auth-digest.strategy.js +1 -5
  728. package/server/authentication/guards/auth-digest.strategy.js.map +1 -1
  729. package/server/authentication/guards/auth-local.guard.js +1 -5
  730. package/server/authentication/guards/auth-local.guard.js.map +1 -1
  731. package/server/authentication/guards/auth-local.guard.spec.js +9 -13
  732. package/server/authentication/guards/auth-local.guard.spec.js.map +1 -1
  733. package/server/authentication/guards/auth-local.strategy.js +6 -10
  734. package/server/authentication/guards/auth-local.strategy.js.map +1 -1
  735. package/server/authentication/guards/auth-token-access.guard.js +1 -5
  736. package/server/authentication/guards/auth-token-access.guard.js.map +1 -1
  737. package/server/authentication/guards/auth-token-access.guard.spec.js +3 -7
  738. package/server/authentication/guards/auth-token-access.guard.spec.js.map +1 -1
  739. package/server/authentication/guards/auth-token-access.strategy.js +3 -7
  740. package/server/authentication/guards/auth-token-access.strategy.js.map +1 -1
  741. package/server/authentication/guards/auth-token-refresh.guard.js +1 -5
  742. package/server/authentication/guards/auth-token-refresh.guard.js.map +1 -1
  743. package/server/authentication/guards/auth-token-refresh.guard.spec.js +3 -7
  744. package/server/authentication/guards/auth-token-refresh.guard.spec.js.map +1 -1
  745. package/server/authentication/guards/auth-token-refresh.strategy.js +3 -7
  746. package/server/authentication/guards/auth-token-refresh.strategy.js.map +1 -1
  747. package/server/authentication/guards/implementations/http-basic.strategy.js +1 -5
  748. package/server/authentication/guards/implementations/http-basic.strategy.js.map +1 -1
  749. package/server/authentication/guards/implementations/http-digest.strategy.js +1 -5
  750. package/server/authentication/guards/implementations/http-digest.strategy.js.map +1 -1
  751. package/server/authentication/interfaces/auth-request.interface.js +1 -5
  752. package/server/authentication/interfaces/auth-request.interface.js.map +1 -1
  753. package/server/authentication/interfaces/jwt-payload.interface.js +1 -5
  754. package/server/authentication/interfaces/jwt-payload.interface.js.map +1 -1
  755. package/server/authentication/interfaces/token.interface.js +1 -5
  756. package/server/authentication/interfaces/token.interface.js.map +1 -1
  757. package/server/authentication/providers/auth-providers.constants.js +18 -0
  758. package/server/authentication/providers/auth-providers.constants.js.map +1 -0
  759. package/server/authentication/providers/auth-providers.models.js +14 -0
  760. package/server/authentication/providers/auth-providers.models.js.map +1 -0
  761. package/server/authentication/providers/auth-providers.utils.js +42 -0
  762. package/server/authentication/providers/auth-providers.utils.js.map +1 -0
  763. package/server/authentication/providers/ldap/auth-ldap.config.js +143 -0
  764. package/server/authentication/providers/ldap/auth-ldap.config.js.map +1 -0
  765. package/server/authentication/{constants/auth-ldap.js → providers/ldap/auth-ldap.constants.js} +12 -6
  766. package/server/authentication/providers/ldap/auth-ldap.constants.js.map +1 -0
  767. package/server/authentication/providers/ldap/auth-provider-ldap.service.js +506 -0
  768. package/server/authentication/providers/ldap/auth-provider-ldap.service.js.map +1 -0
  769. package/server/authentication/providers/ldap/auth-provider-ldap.service.spec.js +674 -0
  770. package/server/authentication/providers/ldap/auth-provider-ldap.service.spec.js.map +1 -0
  771. package/server/authentication/{services/auth-methods/auth-method-database.service.js → providers/mysql/auth-provider-mysql.service.js} +16 -14
  772. package/server/authentication/providers/mysql/auth-provider-mysql.service.js.map +1 -0
  773. package/server/authentication/{services/auth-methods/auth-method-database.service.spec.js → providers/mysql/auth-provider-mysql.service.spec.js} +15 -19
  774. package/server/authentication/providers/mysql/auth-provider-mysql.service.spec.js.map +1 -0
  775. package/server/authentication/providers/oidc/auth-oidc-desktop.constants.js +30 -0
  776. package/server/authentication/providers/oidc/auth-oidc-desktop.constants.js.map +1 -0
  777. package/server/authentication/providers/oidc/auth-oidc.config.js +149 -0
  778. package/server/authentication/providers/oidc/auth-oidc.config.js.map +1 -0
  779. package/server/authentication/providers/oidc/auth-oidc.constants.js +39 -0
  780. package/server/authentication/providers/oidc/auth-oidc.constants.js.map +1 -0
  781. package/server/authentication/providers/oidc/auth-oidc.controller.js +83 -0
  782. package/server/authentication/providers/oidc/auth-oidc.controller.js.map +1 -0
  783. package/server/authentication/providers/oidc/auth-oidc.interfaces.js +6 -0
  784. package/server/authentication/providers/oidc/auth-oidc.interfaces.js.map +1 -0
  785. package/server/authentication/providers/oidc/auth-provider-oidc.module.js +36 -0
  786. package/server/authentication/providers/oidc/auth-provider-oidc.module.js.map +1 -0
  787. package/server/authentication/providers/oidc/auth-provider-oidc.service.js +373 -0
  788. package/server/authentication/providers/oidc/auth-provider-oidc.service.js.map +1 -0
  789. package/server/authentication/providers/oidc/auth-provider-oidc.service.spec.js +270 -0
  790. package/server/authentication/providers/oidc/auth-provider-oidc.service.spec.js.map +1 -0
  791. package/server/authentication/{services/auth-methods/auth-method-two-fa.service.js → providers/two-fa/auth-provider-two-fa.service.js} +56 -38
  792. package/server/authentication/providers/two-fa/auth-provider-two-fa.service.js.map +1 -0
  793. package/server/authentication/{services/auth-methods/auth-method-two-fa.service.spec.js → providers/two-fa/auth-provider-two-fa.service.spec.js} +6 -10
  794. package/server/authentication/providers/two-fa/auth-provider-two-fa.service.spec.js.map +1 -0
  795. package/server/authentication/{guards → providers/two-fa}/auth-two-fa-guard.js +10 -14
  796. package/server/authentication/providers/two-fa/auth-two-fa-guard.js.map +1 -0
  797. package/server/authentication/providers/two-fa/auth-two-fa.config.js +57 -0
  798. package/server/authentication/providers/two-fa/auth-two-fa.config.js.map +1 -0
  799. package/server/authentication/{dto/two-fa-verify.dto.js → providers/two-fa/auth-two-fa.dtos.js} +8 -6
  800. package/server/authentication/providers/two-fa/auth-two-fa.dtos.js.map +1 -0
  801. package/server/authentication/providers/two-fa/auth-two-fa.interfaces.js +6 -0
  802. package/server/authentication/providers/two-fa/auth-two-fa.interfaces.js.map +1 -0
  803. package/server/authentication/utils/crypt-secret.js +1 -5
  804. package/server/authentication/utils/crypt-secret.js.map +1 -1
  805. package/server/common/constants.js +1 -5
  806. package/server/common/constants.js.map +1 -1
  807. package/server/common/decorators.js +1 -5
  808. package/server/common/decorators.js.map +1 -1
  809. package/server/common/functions.js +25 -9
  810. package/server/common/functions.js.map +1 -1
  811. package/server/common/i18n.js +1 -5
  812. package/server/common/i18n.js.map +1 -1
  813. package/server/common/image.js +1 -5
  814. package/server/common/image.js.map +1 -1
  815. package/server/common/interfaces.js +1 -5
  816. package/server/common/interfaces.js.map +1 -1
  817. package/server/common/qrcode.js +1 -5
  818. package/server/common/qrcode.js.map +1 -1
  819. package/server/common/shared.js +6 -6
  820. package/server/common/shared.js.map +1 -1
  821. package/server/configuration/config.constants.js +1 -5
  822. package/server/configuration/config.constants.js.map +1 -1
  823. package/server/configuration/config.environment.js +2 -6
  824. package/server/configuration/config.environment.js.map +1 -1
  825. package/server/configuration/config.interfaces.js +1 -5
  826. package/server/configuration/config.interfaces.js.map +1 -1
  827. package/server/configuration/config.loader.js +1 -5
  828. package/server/configuration/config.loader.js.map +1 -1
  829. package/server/configuration/config.logger.js +4 -8
  830. package/server/configuration/config.logger.js.map +1 -1
  831. package/server/configuration/config.validation.js +7 -5
  832. package/server/configuration/config.validation.js.map +1 -1
  833. package/server/infrastructure/cache/adapters/mysql-cache.adapter.js +9 -7
  834. package/server/infrastructure/cache/adapters/mysql-cache.adapter.js.map +1 -1
  835. package/server/infrastructure/cache/adapters/redis-cache.adapter.js +1 -5
  836. package/server/infrastructure/cache/adapters/redis-cache.adapter.js.map +1 -1
  837. package/server/infrastructure/cache/cache.config.js +1 -5
  838. package/server/infrastructure/cache/cache.config.js.map +1 -1
  839. package/server/infrastructure/cache/cache.decorator.js +9 -7
  840. package/server/infrastructure/cache/cache.decorator.js.map +1 -1
  841. package/server/infrastructure/cache/cache.e2e-spec.js +1 -5
  842. package/server/infrastructure/cache/cache.e2e-spec.js.map +1 -1
  843. package/server/infrastructure/cache/cache.module.js +1 -5
  844. package/server/infrastructure/cache/cache.module.js.map +1 -1
  845. package/server/infrastructure/cache/schemas/mysql-cache.interface.js +1 -5
  846. package/server/infrastructure/cache/schemas/mysql-cache.interface.js.map +1 -1
  847. package/server/infrastructure/cache/schemas/mysql-cache.schema.js +1 -5
  848. package/server/infrastructure/cache/schemas/mysql-cache.schema.js.map +1 -1
  849. package/server/infrastructure/cache/services/cache.service.js +1 -5
  850. package/server/infrastructure/cache/services/cache.service.js.map +1 -1
  851. package/server/infrastructure/context/context.module.js +1 -5
  852. package/server/infrastructure/context/context.module.js.map +1 -1
  853. package/server/infrastructure/context/interceptors/context.interceptor.js +1 -5
  854. package/server/infrastructure/context/interceptors/context.interceptor.js.map +1 -1
  855. package/server/infrastructure/context/interceptors/context.interceptor.spec.js +2 -6
  856. package/server/infrastructure/context/interceptors/context.interceptor.spec.js.map +1 -1
  857. package/server/infrastructure/context/interfaces/context-store.interface.js +1 -5
  858. package/server/infrastructure/context/interfaces/context-store.interface.js.map +1 -1
  859. package/server/infrastructure/context/services/context-manager.service.js +1 -5
  860. package/server/infrastructure/context/services/context-manager.service.js.map +1 -1
  861. package/server/infrastructure/context/services/context-manager.service.spec.js +1 -5
  862. package/server/infrastructure/context/services/context-manager.service.spec.js.map +1 -1
  863. package/server/infrastructure/database/columns.js +1 -5
  864. package/server/infrastructure/database/columns.js.map +1 -1
  865. package/server/infrastructure/database/configuration.js +1 -5
  866. package/server/infrastructure/database/configuration.js.map +1 -1
  867. package/server/infrastructure/database/constants.js +2 -6
  868. package/server/infrastructure/database/constants.js.map +1 -1
  869. package/server/infrastructure/database/database.config.js +1 -5
  870. package/server/infrastructure/database/database.config.js.map +1 -1
  871. package/server/infrastructure/database/database.logger.js +1 -5
  872. package/server/infrastructure/database/database.logger.js.map +1 -1
  873. package/server/infrastructure/database/database.module.js +1 -5
  874. package/server/infrastructure/database/database.module.js.map +1 -1
  875. package/server/infrastructure/database/interfaces/database.interface.js +1 -5
  876. package/server/infrastructure/database/interfaces/database.interface.js.map +1 -1
  877. package/server/infrastructure/database/schema.js +1 -5
  878. package/server/infrastructure/database/schema.js.map +1 -1
  879. package/server/infrastructure/database/scripts/create-user.js +1 -5
  880. package/server/infrastructure/database/scripts/create-user.js.map +1 -1
  881. package/server/infrastructure/database/scripts/db.js +1 -5
  882. package/server/infrastructure/database/scripts/db.js.map +1 -1
  883. package/server/infrastructure/database/scripts/seed/main.js +1 -5
  884. package/server/infrastructure/database/scripts/seed/main.js.map +1 -1
  885. package/server/infrastructure/database/scripts/seed/usersgroups.js +1 -5
  886. package/server/infrastructure/database/scripts/seed/usersgroups.js.map +1 -1
  887. package/server/infrastructure/database/utils.js +1 -5
  888. package/server/infrastructure/database/utils.js.map +1 -1
  889. package/server/infrastructure/mailer/interfaces/mail.interface.js +1 -5
  890. package/server/infrastructure/mailer/interfaces/mail.interface.js.map +1 -1
  891. package/server/infrastructure/mailer/mailer.config.js +1 -5
  892. package/server/infrastructure/mailer/mailer.config.js.map +1 -1
  893. package/server/infrastructure/mailer/mailer.module.js +1 -5
  894. package/server/infrastructure/mailer/mailer.module.js.map +1 -1
  895. package/server/infrastructure/mailer/mailer.service.js +1 -5
  896. package/server/infrastructure/mailer/mailer.service.js.map +1 -1
  897. package/server/infrastructure/mailer/mailer.service.spec.js +2 -6
  898. package/server/infrastructure/mailer/mailer.service.spec.js.map +1 -1
  899. package/server/infrastructure/scheduler/scheduler.constants.js +1 -5
  900. package/server/infrastructure/scheduler/scheduler.constants.js.map +1 -1
  901. package/server/infrastructure/scheduler/scheduler.module.js +1 -5
  902. package/server/infrastructure/scheduler/scheduler.module.js.map +1 -1
  903. package/server/infrastructure/websocket/adapters/cluster.adapter.js +1 -5
  904. package/server/infrastructure/websocket/adapters/cluster.adapter.js.map +1 -1
  905. package/server/infrastructure/websocket/adapters/redis.adapter.js +1 -5
  906. package/server/infrastructure/websocket/adapters/redis.adapter.js.map +1 -1
  907. package/server/infrastructure/websocket/adapters/web-socket.adapter.js +1 -5
  908. package/server/infrastructure/websocket/adapters/web-socket.adapter.js.map +1 -1
  909. package/server/infrastructure/websocket/decorators/web-socket-user.decorator.js +1 -5
  910. package/server/infrastructure/websocket/decorators/web-socket-user.decorator.js.map +1 -1
  911. package/server/infrastructure/websocket/interfaces/auth-socket-io.interface.js +1 -5
  912. package/server/infrastructure/websocket/interfaces/auth-socket-io.interface.js.map +1 -1
  913. package/server/infrastructure/websocket/utils.js +1 -5
  914. package/server/infrastructure/websocket/utils.js.map +1 -1
  915. package/server/infrastructure/websocket/web-socket.config.js +1 -5
  916. package/server/infrastructure/websocket/web-socket.config.js.map +1 -1
  917. package/server/main.js +5 -0
  918. package/server/main.js.map +1 -1
  919. package/static/assets/pdfjs/build/pdf.mjs +724 -745
  920. package/static/assets/pdfjs/build/pdf.mjs.map +1 -1
  921. package/static/assets/pdfjs/build/pdf.sandbox.mjs +2 -2
  922. package/static/assets/pdfjs/build/pdf.worker.mjs +706 -193
  923. package/static/assets/pdfjs/build/pdf.worker.mjs.map +1 -1
  924. package/static/assets/pdfjs/version +1 -1
  925. package/static/assets/pdfjs/web/locale/dsb/viewer.ftl +5 -5
  926. package/static/assets/pdfjs/web/locale/en-US/viewer.ftl +1 -0
  927. package/static/assets/pdfjs/web/locale/fur/viewer.ftl +5 -0
  928. package/static/assets/pdfjs/web/locale/kk/viewer.ftl +28 -0
  929. package/static/assets/pdfjs/web/locale/ml/viewer.ftl +4 -0
  930. package/static/assets/pdfjs/web/locale/ru/viewer.ftl +3 -3
  931. package/static/assets/pdfjs/web/viewer.css +207 -65
  932. package/static/assets/pdfjs/web/viewer.html +11 -10
  933. package/static/assets/pdfjs/web/viewer.mjs +850 -270
  934. package/static/assets/pdfjs/web/viewer.mjs.map +1 -1
  935. package/static/assets/pdfjs/web/wasm/LICENSE_JBIG2 +196 -0
  936. package/static/assets/pdfjs/web/wasm/LICENSE_PDFJS_JBIG2 +13 -0
  937. package/static/assets/pdfjs/web/wasm/jbig2.wasm +0 -0
  938. package/static/chunk-22TZP6HW.js +1 -0
  939. package/static/{chunk-U5E5H2DD.js → chunk-27ATUHBH.js} +1 -1
  940. package/static/{chunk-HZAB6F4Q.js → chunk-2CKLZ3FM.js} +1 -1
  941. package/static/{chunk-XZHWESIY.js → chunk-2QZPX7LO.js} +1 -1
  942. package/static/{chunk-UOK3LKSX.js → chunk-2R6IBBPZ.js} +1 -1
  943. package/static/{chunk-DVCN3P7Q.js → chunk-4FIGEBNL.js} +1 -1
  944. package/static/chunk-4P3JABAP.js +13 -0
  945. package/static/chunk-5CZOSAMZ.js +1 -0
  946. package/static/{chunk-RBTLSPYJ.js → chunk-677WUBCT.js} +1 -1
  947. package/static/{chunk-KEZNIIFH.js → chunk-74CAHBFM.js} +1 -1
  948. package/static/{chunk-WRK2FTKU.js → chunk-7GWW6MJO.js} +1 -1
  949. package/static/{chunk-EKWB5W72.js → chunk-7WOPGQXB.js} +1 -1
  950. package/static/{chunk-IMFO2MI7.js → chunk-A4UGPSWX.js} +1 -1
  951. package/static/{chunk-KDUAB76O.js → chunk-AHO37FKW.js} +1 -1
  952. package/static/chunk-AQCXMKP3.js +1 -0
  953. package/static/chunk-B6PDYCRO.js +3 -0
  954. package/static/{chunk-PPJCVBJH.js → chunk-CU76ATCF.js} +1 -1
  955. package/static/{chunk-ARS47O5X.js → chunk-CWYHOPOP.js} +1 -1
  956. package/static/{chunk-CSVPAZHK.js → chunk-E5WI5725.js} +1 -1
  957. package/static/{chunk-XX3JPJUM.js → chunk-FC5HTKVM.js} +1 -1
  958. package/static/{chunk-QGHNJVJ6.js → chunk-FOSM7EYI.js} +1 -1
  959. package/static/{chunk-JAJ7VXMB.js → chunk-GAZO25PI.js} +1 -1
  960. package/static/{chunk-IHS5LSJJ.js → chunk-GB7ABR5N.js} +1 -1
  961. package/static/{chunk-27V66YJV.js → chunk-GEHFKZQ5.js} +2 -2
  962. package/static/{chunk-3QTROEHV.js → chunk-GQFMWVFD.js} +1 -1
  963. package/static/{chunk-FWQJ4ZCD.js → chunk-GVNTC564.js} +1 -1
  964. package/static/{chunk-4NIYCYRS.js → chunk-HGL3NYP2.js} +2 -2
  965. package/static/chunk-HLIWPWRA.js +1 -0
  966. package/static/{chunk-3VRUIWQG.js → chunk-HNYB3M4S.js} +1 -1
  967. package/static/{chunk-7HJFIMNF.js → chunk-HUXAUQMN.js} +1 -1
  968. package/static/chunk-I2XA6PPK.js +1 -0
  969. package/static/{chunk-RJULB733.js → chunk-ISV3BO6R.js} +1 -1
  970. package/static/{chunk-R4VYKZVJ.js → chunk-IWWBV6EM.js} +1 -1
  971. package/static/{chunk-TTWMFWEC.js → chunk-JV3AGU5B.js} +1 -1
  972. package/static/{chunk-X7NHX5C7.js → chunk-K25E7YGG.js} +1 -1
  973. package/static/chunk-K46PUTZB.js +1 -0
  974. package/static/{chunk-D2MLAO5N.js → chunk-KERFLJ56.js} +1 -7
  975. package/static/{chunk-LZUHREOF.js → chunk-KJD3KFF3.js} +1 -1
  976. package/static/chunk-KPKSI23S.js +1 -0
  977. package/static/{chunk-CMNMPG6Z.js → chunk-KZS7CTNR.js} +1 -1
  978. package/static/{chunk-RNVPQQKT.js → chunk-L5IHUVXL.js} +1 -1
  979. package/static/{chunk-2GXOVGTD.js → chunk-L7RRX2M3.js} +1 -1
  980. package/static/{chunk-WFMEUST4.js → chunk-LGWJ2WKU.js} +1 -1
  981. package/static/{chunk-ZOMRIN3G.js → chunk-MLC7JK2H.js} +2 -2
  982. package/static/{chunk-76REYAEA.js → chunk-MOHNYW2A.js} +1 -1
  983. package/static/{chunk-ZHUBWKA2.js → chunk-MTRXBVWZ.js} +1 -1
  984. package/static/{chunk-QJ22N76V.js → chunk-MZQK6LNV.js} +1 -1
  985. package/static/{chunk-SDJNZULP.js → chunk-NCDUOVMW.js} +1 -1
  986. package/static/chunk-NGUAJIGI.js +1 -0
  987. package/static/chunk-NIPP6JDI.js +1 -0
  988. package/static/{chunk-VD5JHSDS.js → chunk-NMTBMHUL.js} +1 -1
  989. package/static/chunk-O4XXMZFX.js +4 -0
  990. package/static/{chunk-WZPF4LS2.js → chunk-OANZITPM.js} +1 -1
  991. package/static/{chunk-JNTNMIUH.js → chunk-OGE4SAHU.js} +1 -1
  992. package/static/{chunk-S6H2ELRY.js → chunk-OI3ME22C.js} +1 -1
  993. package/static/{chunk-7KAYOR3A.js → chunk-Q3EGCMF5.js} +1 -1
  994. package/static/chunk-QF2NSHZA.js +1 -0
  995. package/static/{chunk-3ZBAQTHJ.js → chunk-QIGUDEZF.js} +1 -1
  996. package/static/{chunk-76M3BMK6.js → chunk-QJVC3SRJ.js} +11 -11
  997. package/static/{chunk-VBTZDHZ3.js → chunk-QKN6LAAA.js} +1 -1
  998. package/static/{chunk-JRXG43AA.js → chunk-QRFESU5O.js} +2 -2
  999. package/static/chunk-QVRVFYJH.js +1 -0
  1000. package/static/{chunk-BCN4T5DO.js → chunk-RFJIPIOK.js} +2 -2
  1001. package/static/{chunk-2RWLNKZH.js → chunk-RLL634K4.js} +1 -1
  1002. package/static/{chunk-D5FQ72R4.js → chunk-RS2OFKWP.js} +1 -1
  1003. package/static/{chunk-CN5YVRFT.js → chunk-RWAAC3A4.js} +1 -1
  1004. package/static/{chunk-LWSCODLD.js → chunk-RWCNTCU5.js} +1 -1
  1005. package/static/{chunk-FTFEQDWH.js → chunk-S5Y64DDS.js} +1 -1
  1006. package/static/{chunk-J7474P3L.js → chunk-SLG5KDU6.js} +1 -1
  1007. package/static/chunk-TJ4CVFEL.js +1 -0
  1008. package/static/{chunk-KAUCN24H.js → chunk-TWCGKSYE.js} +1 -1
  1009. package/static/{chunk-PDG7DOEF.js → chunk-UMDRE4S7.js} +1 -1
  1010. package/static/chunk-VRIOLRYR.js +5 -0
  1011. package/static/chunk-VS4O2XDP.js +1 -0
  1012. package/static/{chunk-ZEJLIGAY.js → chunk-VSBFNFOM.js} +1 -1
  1013. package/static/{chunk-XSURUW7C.js → chunk-WN4WXCVK.js} +1 -1
  1014. package/static/{chunk-S44QIK3G.js → chunk-WX7RXW7K.js} +1 -1
  1015. package/static/{chunk-3ZLBVUCX.js → chunk-XC4POKR3.js} +2 -2
  1016. package/static/{chunk-TNCKNU6I.js → chunk-Y4AUYQTG.js} +1 -1
  1017. package/static/{chunk-3MVPXC3U.js → chunk-Y67J3BOL.js} +1 -1
  1018. package/static/{chunk-QTPIEEZW.js → chunk-YMIXHRJQ.js} +1 -7
  1019. package/static/{chunk-VZFZUI6D.js → chunk-ZUNKFAKP.js} +1 -1
  1020. package/static/index.html +3 -3
  1021. package/static/main-QN4UCOC5.js +5 -0
  1022. package/static/{styles-XLLEY5Y3.css → styles-46GLIE7Y.css} +1 -1
  1023. package/server/authentication/constants/auth-ldap.js.map +0 -1
  1024. package/server/authentication/dto/two-fa-verify.dto.js.map +0 -1
  1025. package/server/authentication/guards/auth-two-fa-guard.js.map +0 -1
  1026. package/server/authentication/interfaces/two-fa-setup.interface.js +0 -10
  1027. package/server/authentication/interfaces/two-fa-setup.interface.js.map +0 -1
  1028. package/server/authentication/models/auth-method.js +0 -18
  1029. package/server/authentication/models/auth-method.js.map +0 -1
  1030. package/server/authentication/services/auth-manager.service.js.map +0 -1
  1031. package/server/authentication/services/auth-manager.service.spec.js.map +0 -1
  1032. package/server/authentication/services/auth-methods/auth-method-database.service.js.map +0 -1
  1033. package/server/authentication/services/auth-methods/auth-method-database.service.spec.js.map +0 -1
  1034. package/server/authentication/services/auth-methods/auth-method-ldap.service.js +0 -326
  1035. package/server/authentication/services/auth-methods/auth-method-ldap.service.js.map +0 -1
  1036. package/server/authentication/services/auth-methods/auth-method-ldap.service.spec.js +0 -534
  1037. package/server/authentication/services/auth-methods/auth-method-ldap.service.spec.js.map +0 -1
  1038. package/server/authentication/services/auth-methods/auth-method-two-fa.service.js.map +0 -1
  1039. package/server/authentication/services/auth-methods/auth-method-two-fa.service.spec.js.map +0 -1
  1040. package/static/chunk-2YQ4SX3A.js +0 -13
  1041. package/static/chunk-46TJLPJY.js +0 -1
  1042. package/static/chunk-6OEOADR6.js +0 -1
  1043. package/static/chunk-AALPWGPB.js +0 -3
  1044. package/static/chunk-CVXLHSO5.js +0 -1
  1045. package/static/chunk-G7RZN7HN.js +0 -1
  1046. package/static/chunk-LTJNLOX2.js +0 -1
  1047. package/static/chunk-NIKNG2FX.js +0 -1
  1048. package/static/chunk-NNZWSNAW.js +0 -1
  1049. package/static/chunk-NWKBB7J4.js +0 -1
  1050. package/static/chunk-PVYVY3GD.js +0 -1
  1051. package/static/chunk-Q5X5TPAG.js +0 -1
  1052. package/static/chunk-R4VMWCM5.js +0 -1
  1053. package/static/chunk-SNOOCDJD.js +0 -1
  1054. package/static/chunk-SPQH3ATC.js +0 -5
  1055. package/static/chunk-ZCSHU3D7.js +0 -1
  1056. package/static/chunk-ZU5MQTFN.js +0 -4
  1057. package/static/main-5O3KLGIR.js +0 -11
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../backend/src/applications/files/utils/doc-textify/adapters/word.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport { promisify } from 'node:util'\nimport sax from 'sax'\nimport { Entry, open as openZip, Options, ZipFile } from 'yauzl'\nimport { DocTextifyOptions } from '../interfaces/doc-textify.interfaces'\n\nconst openZipAsync: (path: string, options: Options) => Promise<ZipFile> = promisify(openZip)\n\n/**\n * Parses a DOCX file\n */\nexport async function parseWord(filePath: string, options: DocTextifyOptions): Promise<string> {\n // Patterns for main document, footnotes and endnotes\n const mainRegex = /^word\\/document(?:\\d*)\\.xml$/\n const footnotesRegex = /^word\\/footnotes(?:\\d*)\\.xml$/\n const endnotesRegex = /^word\\/endnotes(?:\\d*)\\.xml$/\n const texts: string[] = []\n let hasMain = false\n\n // 1. Open the DOCX (ZIP) in lazyEntries mode\n const zipFile = await openZipAsync(filePath, { lazyEntries: true })\n\n return new Promise<string>((resolve, reject) => {\n zipFile.readEntry()\n\n zipFile.on('entry', (entry: Entry) => {\n const path = entry.fileName\n\n // 2. Only process document, footnotes, endnotes parts\n if (!mainRegex.test(path) && !footnotesRegex.test(path) && !endnotesRegex.test(path)) {\n zipFile.readEntry()\n return\n }\n\n if (mainRegex.test(path)) {\n hasMain = true\n }\n\n // 3. Open a read stream for this entry\n zipFile.openReadStream(entry, (err, readStream) => {\n if (err) {\n zipFile.close()\n return reject(err)\n }\n\n // 4. SAX parser to extract <w:t> text nodes\n const parser = sax.createStream(true)\n let buffer = ''\n\n parser.on('error', (parseErr) => {\n readStream.destroy()\n zipFile.close()\n reject(parseErr)\n })\n\n parser.on('opentag', (node) => {\n // Start buffering when encountering a text tag\n if (node.name === 'w:t') {\n buffer = ''\n }\n })\n\n parser.on('text', (txt) => {\n buffer += txt\n })\n\n parser.on('closetag', (name) => {\n // On closing a text tag, store its content\n if (name === 'w:t') {\n texts.push(buffer)\n }\n })\n\n readStream\n .on('error', (streamErr) => {\n zipFile.close()\n reject(streamErr)\n })\n .on('end', () => {\n // Move on to the next entry\n zipFile.readEntry()\n })\n .pipe(parser)\n })\n })\n\n zipFile.on('end', () => {\n zipFile.close()\n // 5. Ensure at least the main document was found\n if (!hasMain) {\n return reject(new Error('file seems to be corrupted'))\n }\n // 6. Return all collected text joined by the delimiter\n resolve(texts.join(options.newlineDelimiter))\n })\n\n zipFile.on('error', (zipErr) => {\n zipFile.close()\n reject(zipErr)\n })\n })\n}\n"],"names":["parseWord","openZipAsync","promisify","openZip","filePath","options","mainRegex","footnotesRegex","endnotesRegex","texts","hasMain","zipFile","lazyEntries","Promise","resolve","reject","readEntry","on","entry","path","fileName","test","openReadStream","err","readStream","close","parser","sax","createStream","buffer","parseErr","destroy","node","name","txt","push","streamErr","pipe","Error","join","newlineDelimiter","zipErr"],"mappings":"AAAA;;;;CAIC;;;;+BAYqBA;;;eAAAA;;;0BAVI;4DACV;uBACyC;;;;;;AAGzD,MAAMC,eAAqEC,IAAAA,mBAAS,EAACC,WAAO;AAKrF,eAAeH,UAAUI,QAAgB,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ACmB;oBACZzB,QAAQc,KAAK;oBACbV,OAAOqB;gBACT,GACCnB,EAAE,CAAC,OAAO;oBACT,4BAA4B;oBAC5BN,QAAQK,SAAS;gBACnB,GACCqB,IAAI,CAACX;YACV;QACF;QAEAf,QAAQM,EAAE,CAAC,OAAO;YAChBN,QAAQc,KAAK;YACb,iDAAiD;YACjD,IAAI,CAACf,SAAS;gBACZ,OAAOK,OAAO,IAAIuB,MAAM;YAC1B;YACA,uDAAuD;YACvDxB,QAAQL,MAAM8B,IAAI,CAAClC,QAAQmC,gBAAgB;QAC7C;QAEA7B,QAAQM,EAAE,CAAC,SAAS,CAACwB;YACnB9B,QAAQc,KAAK;YACbV,OAAO0B;QACT;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../../../../backend/src/applications/files/utils/doc-textify/adapters/word.ts"],"sourcesContent":["import { promisify } from 'node:util'\nimport sax from 'sax'\nimport { Entry, open as openZip, Options, ZipFile } from 'yauzl'\nimport { DocTextifyOptions } from '../interfaces/doc-textify.interfaces'\n\nconst openZipAsync: (path: string, options: Options) => Promise<ZipFile> = promisify(openZip)\n\n/**\n * Parses a DOCX file\n */\nexport async function parseWord(filePath: string, options: DocTextifyOptions): Promise<string> {\n // Patterns for main document, footnotes and endnotes\n const mainRegex = /^word\\/document(?:\\d*)\\.xml$/\n const footnotesRegex = /^word\\/footnotes(?:\\d*)\\.xml$/\n const endnotesRegex = /^word\\/endnotes(?:\\d*)\\.xml$/\n const texts: string[] = []\n let hasMain = false\n\n // 1. Open the DOCX (ZIP) in lazyEntries mode\n const zipFile = await openZipAsync(filePath, { lazyEntries: true })\n\n return new Promise<string>((resolve, reject) => {\n zipFile.readEntry()\n\n zipFile.on('entry', (entry: Entry) => {\n const path = entry.fileName\n\n // 2. Only process document, footnotes, endnotes parts\n if (!mainRegex.test(path) && !footnotesRegex.test(path) && !endnotesRegex.test(path)) {\n zipFile.readEntry()\n return\n }\n\n if (mainRegex.test(path)) {\n hasMain = true\n }\n\n // 3. Open a read stream for this entry\n zipFile.openReadStream(entry, (err, readStream) => {\n if (err) {\n zipFile.close()\n return reject(err)\n }\n\n // 4. SAX parser to extract <w:t> text nodes\n const parser = sax.createStream(true)\n let buffer = ''\n\n parser.on('error', (parseErr) => {\n readStream.destroy()\n zipFile.close()\n reject(parseErr)\n })\n\n parser.on('opentag', (node) => {\n // Start buffering when encountering a text tag\n if (node.name === 'w:t') {\n buffer = ''\n }\n })\n\n parser.on('text', (txt) => {\n buffer += txt\n })\n\n parser.on('closetag', (name) => {\n // On closing a text tag, store its content\n if (name === 'w:t') {\n texts.push(buffer)\n }\n })\n\n readStream\n .on('error', (streamErr) => {\n zipFile.close()\n reject(streamErr)\n })\n .on('end', () => {\n // Move on to the next entry\n zipFile.readEntry()\n })\n .pipe(parser)\n })\n })\n\n zipFile.on('end', () => {\n zipFile.close()\n // 5. Ensure at least the main document was found\n if (!hasMain) {\n return reject(new Error('file seems to be corrupted'))\n }\n // 6. Return all collected text joined by the delimiter\n resolve(texts.join(options.newlineDelimiter))\n })\n\n zipFile.on('error', (zipErr) => {\n zipFile.close()\n reject(zipErr)\n })\n })\n}\n"],"names":["parseWord","openZipAsync","promisify","openZip","filePath","options","mainRegex","footnotesRegex","endnotesRegex","texts","hasMain","zipFile","lazyEntries","Promise","resolve","reject","readEntry","on","entry","path","fileName","test","openReadStream","err","readStream","close","parser","sax","createStream","buffer","parseErr","destroy","node","name","txt","push","streamErr","pipe","Error","join","newlineDelimiter","zipErr"],"mappings":";;;;+BAUsBA;;;eAAAA;;;0BAVI;4DACV;uBACyC;;;;;;AAGzD,MAAMC,eAAqEC,IAAAA,mBAAS,EAACC,WAAO;AAKrF,eAAeH,UAAUI,QAAgB,EAAEC,OAA0B;IAC1E,qDAAqD;IACrD,MAAMC,YAAY;IAClB,MAAMC,iBAAiB;IACvB,MAAMC,gBAAgB;IACtB,MAAMC,QAAkB,EAAE;IAC1B,IAAIC,UAAU;IAEd,6CAA6C;IAC7C,MAAMC,UAAU,MAAMV,aA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N,QAAQc,KAAK;YACb,iDAAiD;YACjD,IAAI,CAACf,SAAS;gBACZ,OAAOK,OAAO,IAAIuB,MAAM;YAC1B;YACA,uDAAuD;YACvDxB,QAAQL,MAAM8B,IAAI,CAAClC,QAAQmC,gBAAgB;QAC7C;QAEA7B,QAAQM,EAAE,CAAC,SAAS,CAACwB;YACnB9B,QAAQc,KAAK;YACbV,OAAO0B;QACT;IACF;AACF"}
@@ -1,8 +1,4 @@
1
- /*
2
- * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
3
- * This file is part of Sync-in | The open source file sync and share solution
4
- * See the LICENSE file for licensing details
5
- */ "use strict";
1
+ "use strict";
6
2
  Object.defineProperty(exports, "__esModule", {
7
3
  value: true
8
4
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../backend/src/applications/files/utils/doc-textify/doc-textify.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport fs from 'node:fs/promises'\nimport path from 'node:path'\nimport { parseExcel } from './adapters/excel'\nimport { parseHtml } from './adapters/html'\nimport { parseOpenOffice } from './adapters/open-office'\nimport { parsePdf } from './adapters/pdf'\nimport { parsePowerPoint } from './adapters/power-point'\nimport { parseText } from './adapters/text'\nimport { parseWord } from './adapters/word'\nimport { DocTextifyOptions } from './interfaces/doc-textify.interfaces'\nimport { cleanContent } from './utils/clean'\n\n/** Main: determine parser by extension and dispatch */\nexport async function docTextify(\n filePath: string,\n options: DocTextifyOptions,\n fileProperties?: { extension?: string; verified?: boolean }\n): Promise<string> {\n options = {\n newlineDelimiter: '\\n',\n minCharsToExtract: 10,\n outputErrorToConsole: false,\n ...options\n }\n\n if (!fileProperties?.verified) {\n try {\n await fs.access(filePath)\n } catch (e) {\n throw new Error(`file does not exist or not accessible : ${filePath} (${e})`)\n }\n }\n\n const ext = fileProperties?.extension || path.extname(filePath).slice(1).toLowerCase()\n\n try {\n switch (ext) {\n case 'docx':\n return cleanContent(await parseWord(filePath, options), options)\n case 'pptx':\n return cleanContent(await parsePowerPoint(filePath, options), options)\n case 'xlsx':\n return cleanContent(await parseExcel(filePath, options), options)\n case 'odt':\n case 'odp':\n case 'ods':\n return cleanContent(await parseOpenOffice(filePath, options), options)\n case 'pdf':\n return cleanContent(await parsePdf(filePath, options), options)\n case 'txt':\n return cleanContent(await parseText(filePath), options)\n case 'html':\n case 'htm':\n return cleanContent(await parseHtml(filePath), options)\n default:\n throw new Error('currently only supports docx, pptx, xlsx, odt, odp, ods, pdf files')\n }\n } catch (e) {\n if (options.outputErrorToConsole) {\n console.error(e.message)\n }\n throw e\n }\n}\n"],"names":["docTextify","filePath","options","fileProperties","newlineDelimiter","minCharsToExtract","outputErrorToConsole","verified","fs","access","e","Error","ext","extension","path","extname","slice","toLowerCase","cleanContent","parseWord","parsePowerPoint","parseExcel","parseOpenOffice","parsePdf","parseText","parseHtml","console","error","message"],"mappings":"AAAA;;;;CAIC;;;;+BAeqBA;;;eAAAA;;;iEAbP;iEACE;uBACU;sBACD;4BACM;qBACP;4BACO;sBACN;sBACA;uBAEG;;;;;;AAGtB,eAAeA,WACpBC,QAAgB,EAChBC,OAA0B,EAC1BC,cAA2D;IAE3DD,UAAU;QACRE,kBAAkB;QAClBC,mBAAmB;QACnBC,sBAAsB;QACtB,GAAGJ,OAAO;IACZ;IAEA,IAAI,CAACC,gBAAgBI,UAAU;QAC7B,IAAI;YACF,MAAMC,iBAAE,CAACC,MAAM,CAACR;QAClB,EAAE,OAAOS,GAAG;YACV,MAAM,IAAIC,MAAM,CAAC,wCAAwC,EAAEV,SAAS,EAAE,EAAES,EAAE,CAAC,CAAC;QAC9E;IACF;IAEA,MAAME,MAAMT,gBAAgBU,aAAaC,iBAAI,CAACC,OAAO,CAACd,UAAUe,KAAK,CAAC,GAAGC,WAAW;IAEpF,IAAI;QACF,OAAQL;YACN,KAAK;gBACH,OAAOM,IAAAA,mBAAY,EAAC,MAAMC,IAAAA,eAAS,EAAClB,UAAUC,UAAUA;YAC1D,KAAK;gBACH,OAAOgB,IAAAA,mBAAY,EAAC,MAAME,IAAAA,2BAAe,EAACnB,UAAUC,UAAUA;YAChE,KAAK;gBACH,OAAOgB,IAAAA,mBAAY,EAAC,MAAMG,IAAAA,iBAAU,EAACpB,UAAUC,UAAUA;YAC3D,KAAK;YACL,KAAK;YACL,KAAK;gBACH,OAAOgB,IAAAA,mBAAY,EAAC,MAAMI,IAAAA,2BAAe,EAACrB,UAAUC,UAAUA;YAChE,KAAK;gBACH,OAAOgB,IAAAA,mBAAY,EAAC,MAAMK,IAAAA,aAAQ,EAACtB,UAAUC,UAAUA;YACzD,KAAK;gBACH,OAAOgB,IAAAA,mBAAY,EAAC,MAAMM,IAAAA,eAAS,EAACvB,WAAWC;YACjD,KAAK;YACL,KAAK;gBACH,OAAOgB,IAAAA,mBAAY,EAAC,MAAMO,IAAAA,eAAS,EAACxB,WAAWC;YACjD;gBACE,MAAM,IAAIS,MAAM;QACpB;IACF,EAAE,OAAOD,GAAG;QACV,IAAIR,QAAQI,oBAAoB,EAAE;YAChCoB,QAAQC,KAAK,CAACjB,EAAEkB,OAAO;QACzB;QACA,MAAMlB;IACR;AACF"}
1
+ {"version":3,"sources":["../../../../../../backend/src/applications/files/utils/doc-textify/doc-textify.ts"],"sourcesContent":["import fs from 'node:fs/promises'\nimport path from 'node:path'\nimport { parseExcel } from './adapters/excel'\nimport { parseHtml } from './adapters/html'\nimport { parseOpenOffice } from './adapters/open-office'\nimport { parsePdf } from './adapters/pdf'\nimport { parsePowerPoint } from './adapters/power-point'\nimport { parseText } from './adapters/text'\nimport { parseWord } from './adapters/word'\nimport { DocTextifyOptions } from './interfaces/doc-textify.interfaces'\nimport { cleanContent } from './utils/clean'\n\n/** Main: determine parser by extension and dispatch */\nexport async function docTextify(\n filePath: string,\n options: DocTextifyOptions,\n fileProperties?: { extension?: string; verified?: boolean }\n): Promise<string> {\n options = {\n newlineDelimiter: '\\n',\n minCharsToExtract: 10,\n outputErrorToConsole: false,\n ...options\n }\n\n if (!fileProperties?.verified) {\n try {\n await fs.access(filePath)\n } catch (e) {\n throw new Error(`file does not exist or not accessible : ${filePath} (${e})`)\n }\n }\n\n const ext = fileProperties?.extension || path.extname(filePath).slice(1).toLowerCase()\n\n try {\n switch (ext) {\n case 'docx':\n return cleanContent(await parseWord(filePath, options), options)\n case 'pptx':\n return cleanContent(await parsePowerPoint(filePath, options), options)\n case 'xlsx':\n return cleanContent(await parseExcel(filePath, options), options)\n case 'odt':\n case 'odp':\n case 'ods':\n return cleanContent(await parseOpenOffice(filePath, options), options)\n case 'pdf':\n return cleanContent(await parsePdf(filePath, options), options)\n case 'txt':\n return cleanContent(await parseText(filePath), options)\n case 'html':\n case 'htm':\n return cleanContent(await parseHtml(filePath), options)\n default:\n throw new Error('currently only supports docx, pptx, xlsx, odt, odp, ods, pdf files')\n }\n } catch (e) {\n if (options.outputErrorToConsole) {\n console.error(e.message)\n }\n throw e\n }\n}\n"],"names":["docTextify","filePath","options","fileProperties","newlineDelimiter","minCharsToExtract","outputErrorToConsole","verified","fs","access","e","Error","ext","extension","path","extname","slice","toLowerCase","cleanContent","parseWord","parsePowerPoint","parseExcel","parseOpenOffice","parsePdf","parseText","parseHtml","console","error","message"],"mappings":";;;;+BAasBA;;;eAAAA;;;iEAbP;iEACE;uBACU;sBACD;4BACM;qBACP;4BACO;sBACN;sBACA;uBAEG;;;;;;AAGtB,eAAeA,WACpBC,QAAgB,EAChBC,OAA0B,EAC1BC,cAA2D;IAE3DD,UAAU;QACRE,kBAAkB;QAClBC,mBAAmB;QACnBC,sBAAsB;QACtB,GAAGJ,OAAO;IACZ;IAEA,IAAI,CAACC,gBAAgBI,UAAU;QAC7B,IAAI;YACF,MAAMC,iBAAE,CAACC,MAAM,CAACR;QAClB,EAAE,OAAOS,GAAG;YACV,MAAM,IAAIC,MAAM,CAAC,wCAAwC,EAAEV,SAAS,EAAE,EAAES,EAAE,CAAC,CAAC;QAC9E;IACF;IAEA,MAAME,MAAMT,gBAAgBU,aAAaC,iBAAI,CAACC,OAAO,CAACd,UAAUe,KAAK,CAAC,GAAGC,WAAW;IAEpF,IAAI;QACF,OAAQL;YACN,KAAK;gBACH,OAAOM,IAAAA,mBAAY,EAAC,MAAMC,IAAAA,eAAS,EAAClB,UAAUC,UAAUA;YAC1D,KAAK;gBACH,OAAOgB,IAAAA,mBAAY,EAAC,MAAME,IAAAA,2BAAe,EAACnB,UAAUC,UAAUA;YAChE,KAAK;gBACH,OAAOgB,IAAAA,mBAAY,EAAC,MAAMG,IAAAA,iBAAU,EAACpB,UAAUC,UAAUA;YAC3D,KAAK;YACL,KAAK;YACL,KAAK;gBACH,OAAOgB,IAAAA,mBAAY,EAAC,MAAMI,IAAAA,2BAAe,EAACrB,UAAUC,UAAUA;YAChE,KAAK;gBACH,OAAOgB,IAAAA,mBAAY,EAAC,MAAMK,IAAAA,aAAQ,EAACtB,UAAUC,UAAUA;YACzD,KAAK;gBACH,OAAOgB,IAAAA,mBAAY,EAAC,MAAMM,IAAAA,eAAS,EAACvB,WAAWC;YACjD,KAAK;YACL,KAAK;gBACH,OAAOgB,IAAAA,mBAAY,EAAC,MAAMO,IAAAA,eAAS,EAACxB,WAAWC;YACjD;gBACE,MAAM,IAAIS,MAAM;QACpB;IACF,EAAE,OAAOD,GAAG;QACV,IAAIR,QAAQI,oBAAoB,EAAE;YAChCoB,QAAQC,KAAK,CAACjB,EAAEkB,OAAO;QACzB;QACA,MAAMlB;IACR;AACF"}
@@ -1,8 +1,4 @@
1
- /*
2
- * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
3
- * This file is part of Sync-in | The open source file sync and share solution
4
- * See the LICENSE file for licensing details
5
- */ "use strict";
1
+ "use strict";
6
2
  Object.defineProperty(exports, "__esModule", {
7
3
  value: true
8
4
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../backend/src/applications/files/utils/doc-textify/interfaces/doc-textify.interfaces.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nexport interface DocTextifyOptions {\n outputErrorToConsole?: boolean\n newlineDelimiter: string\n minCharsToExtract: number\n}\n"],"names":[],"mappings":"AAAA;;;;CAIC"}
1
+ {"version":3,"sources":["../../../../../../../backend/src/applications/files/utils/doc-textify/interfaces/doc-textify.interfaces.ts"],"names":[],"mappings":""}
@@ -1,8 +1,4 @@
1
- /*
2
- * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
3
- * This file is part of Sync-in | The open source file sync and share solution
4
- * See the LICENSE file for licensing details
5
- */ "use strict";
1
+ "use strict";
6
2
  Object.defineProperty(exports, "__esModule", {
7
3
  value: true
8
4
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../backend/src/applications/files/utils/doc-textify/utils/clean.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport { DocTextifyOptions } from '../interfaces/doc-textify.interfaces'\n\nconst regexAlphanumeric = /[a-zA-Z0-9]/\nconst regexpLinesAndTabs = /\\r?\\n|\\r|\\t|\\u00A0/g\n\nexport function cleanContent(content: string, options: DocTextifyOptions) {\n if (!content || content.length <= options.minCharsToExtract) {\n return ''\n }\n\n let result = content[0]\n let prevChar = content[0]\n\n for (let i = 1; i < content.length; i++) {\n const currentChar = content[i]\n\n if (!regexAlphanumeric.test(currentChar) && currentChar === prevChar) {\n continue\n }\n\n result += currentChar\n prevChar = currentChar\n }\n\n return result.trim().replace(regexpLinesAndTabs, options.newlineDelimiter)\n}\n"],"names":["cleanContent","regexAlphanumeric","regexpLinesAndTabs","content","options","length","minCharsToExtract","result","prevChar","i","currentChar","test","trim","replace","newlineDelimiter"],"mappings":"AAAA;;;;CAIC;;;;+BAOeA;;;eAAAA;;;AAHhB,MAAMC,oBAAoB;AAC1B,MAAMC,qBAAqB;AAEpB,SAASF,aAAaG,OAAe,EAAEC,OAA0B;IACtE,IAAI,CAACD,WAAWA,QAAQE,MAAM,IAAID,QAAQE,iBAAiB,EAAE;QAC3D,OAAO;IACT;IAEA,IAAIC,SAASJ,OAAO,CAAC,EAAE;IACvB,IAAIK,WAAWL,OAAO,CAAC,EAAE;IAEzB,IAAK,IAAIM,IAAI,GAAGA,IAAIN,QAAQE,MAAM,EAAEI,IAAK;QACvC,MAAMC,cAAcP,OAAO,CAACM,EAAE;QAE9B,IAAI,CAACR,kBAAkBU,IAAI,CAACD,gBAAgBA,gBAAgBF,UAAU;YACpE;QACF;QAEAD,UAAUG;QACVF,WAAWE;IACb;IAEA,OAAOH,OAAOK,IAAI,GAAGC,OAAO,CAACX,oBAAoBE,QAAQU,gBAAgB;AAC3E"}
1
+ {"version":3,"sources":["../../../../../../../backend/src/applications/files/utils/doc-textify/utils/clean.ts"],"sourcesContent":["import { DocTextifyOptions } from '../interfaces/doc-textify.interfaces'\n\nconst regexAlphanumeric = /[a-zA-Z0-9]/\nconst regexpLinesAndTabs = /\\r?\\n|\\r|\\t|\\u00A0/g\n\nexport function cleanContent(content: string, options: DocTextifyOptions) {\n if (!content || content.length <= options.minCharsToExtract) {\n return ''\n }\n\n let result = content[0]\n let prevChar = content[0]\n\n for (let i = 1; i < content.length; i++) {\n const currentChar = content[i]\n\n if (!regexAlphanumeric.test(currentChar) && currentChar === prevChar) {\n continue\n }\n\n result += currentChar\n prevChar = currentChar\n }\n\n return result.trim().replace(regexpLinesAndTabs, options.newlineDelimiter)\n}\n"],"names":["cleanContent","regexAlphanumeric","regexpLinesAndTabs","content","options","length","minCharsToExtract","result","prevChar","i","currentChar","test","trim","replace","newlineDelimiter"],"mappings":";;;;+BAKgBA;;;eAAAA;;;AAHhB,MAAMC,oBAAoB;AAC1B,MAAMC,qBAAqB;AAEpB,SAASF,aAAaG,OAAe,EAAEC,OAA0B;IACtE,IAAI,CAACD,WAAWA,QAAQE,MAAM,IAAID,QAAQE,iBAAiB,EAAE;QAC3D,OAAO;IACT;IAEA,IAAIC,SAASJ,OAAO,CAAC,EAAE;IACvB,IAAIK,WAAWL,OAAO,CAAC,EAAE;IAEzB,IAAK,IAAIM,IAAI,GAAGA,IAAIN,QAAQE,MAAM,EAAEI,IAAK;QACvC,MAAMC,cAAcP,OAAO,CAACM,EAAE;QAE9B,IAAI,CAACR,kBAAkBU,IAAI,CAACD,gBAAgBA,gBAAgBF,UAAU;YACpE;QACF;QAEAD,UAAUG;QACVF,WAAWE;IACb;IAEA,OAAOH,OAAOK,IAAI,GAAGC,OAAO,CAACX,oBAAoBE,QAAQU,gBAAgB;AAC3E"}
@@ -1,8 +1,4 @@
1
- /*
2
- * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
3
- * This file is part of Sync-in | The open source file sync and share solution
4
- * See the LICENSE file for licensing details
5
- */ "use strict";
1
+ "use strict";
6
2
  Object.defineProperty(exports, "__esModule", {
7
3
  value: true
8
4
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../backend/src/applications/files/utils/files-search.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport { escapeString } from '../../../common/functions'\nimport { minCharsToSearch } from '../constants/indexing'\n\nconst regexMatchSearchBoolean = new RegExp(`([+-]?)(?:\"([^\"]+)\"|(\\\\S+))`)\nconst regexMatchesSearchBoolean = new RegExp(regexMatchSearchBoolean.source, 'g')\nconst booleanOperators = new Set(['+', '-', '<', '>', '~', '*'])\nconst accentToBaseMap = new Map<string, string>([\n ['a', '[aàáâä]'],\n ['e', '[eèéêë]'],\n ['i', '[iìíîï]'],\n ['o', '[oòóôö]'],\n ['u', '[uùúûü]'],\n ['c', '[cç]'],\n ['n', '[nñ]'],\n ['s', '[sš]'],\n ['z', '[zž]'],\n ['y', '[yýÿ]']\n])\n\nexport class MaxSortedList {\n public data: [number, string][] = []\n public nbItems: number\n\n constructor(nbItems: number) {\n this.nbItems = nbItems\n }\n\n insert(item: [number, string]) {\n if (this.data.length === 0) {\n this.data.push(item)\n return\n }\n // if score is smaller or the score already stored for another string ignore it and keep the first matches.\n if (item[0] < this.data[this.data.length - 1][0] || (this.data.length === this.nbItems && this.data.find(([num]) => num === item[0]))) {\n return\n }\n // insert data ordered by highest score\n const index: number = this.data.findIndex(([num]) => num < item[0])\n if (index === -1) {\n this.data.push(item)\n } else {\n this.data.splice(index, 0, item)\n }\n // remove the smaller code\n if (this.data.length > this.nbItems) {\n this.data.pop()\n }\n }\n}\n\nexport function analyzeTerms(search: string, onlyAllowNegative = false): string[] {\n /* Get the positive or negative terms list */\n const matches: RegExpMatchArray | [] = search.match(regexMatchesSearchBoolean) || []\n if (!matches.length) {\n return matches\n }\n return matches\n .flatMap((match: string) => {\n const [, operator, quoted, unquoted] = match.match(regexMatchSearchBoolean)\n let term: string = (quoted || unquoted).trim()\n\n if (term.length < minCharsToSearch) return null\n\n if ((onlyAllowNegative && operator !== '-') || (!onlyAllowNegative && (operator === '-' || operator === '~'))) return null\n\n if (booleanOperators.has(term[0])) {\n term = term.substring(1)\n }\n\n if (term[term.length - 1] === '*') {\n term = term.substring(0, term.length - 1)\n }\n\n return escapeString(term)\n })\n .filter(Boolean)\n}\n\nexport function genTermsPattern(terms: string[]): string {\n return terms.map((t) => genAccentInsensitiveRegexpPattern(t)).join('|')\n}\n\nexport function genRegexPositiveAndNegativeTerms(search: string): RegExp {\n const positiveTerms = analyzeTerms(search)\n const negativeTerms = analyzeTerms(search, true)\n const p = positiveTerms\n .map((t) => genAccentInsensitiveRegexpPattern(t))\n .map((t) => `(?=.*\\\\b${t})`)\n .join('')\n if (!negativeTerms.length) return new RegExp(p, 'i')\n const n = negativeTerms\n .map((t) => genAccentInsensitiveRegexpPattern(t))\n .map((t) => `\\\\b${t}\\\\b`)\n .join('|')\n return new RegExp(`^${p}(?!.*(${n})).*$`, 'i')\n}\n\nfunction genAccentInsensitiveRegexpPattern(input: string): string {\n /* Allow to catch all terms with accents or not */\n return input\n .split('')\n .map((char: string) => accentToBaseMap.get(char) || char)\n .join('')\n}\n"],"names":["MaxSortedList","analyzeTerms","genRegexPositiveAndNegativeTerms","genTermsPattern","regexMatchSearchBoolean","RegExp","regexMatchesSearchBoolean","source","booleanOperators","Set","accentToBaseMap","Map","insert","item","data","length","push","nbItems","find","num","index","findIndex","splice","pop","search","onlyAllowNegative","matches","match","flatMap","operator","quoted","unquoted","term","trim","minCharsToSearch","has","substring","escapeString","filter","Boolean","terms","map","t","genAccentInsensitiveRegexpPattern","join","positiveTerms","negativeTerms","p","n","input","split","char","get"],"mappings":"AAAA;;;;CAIC;;;;;;;;;;;QAqBYA;eAAAA;;QA+BGC;eAAAA;;QAgCAC;eAAAA;;QAJAC;eAAAA;;;2BA9Ea;0BACI;AAEjC,MAAMC,0BAA0B,IAAIC,OAAO,CAAC,2BAA2B,CAAC;AACxE,MAAMC,4BAA4B,IAAID,OAAOD,wBAAwBG,MAAM,EAAE;AAC7E,MAAMC,mBAAmB,IAAIC,IAAI;IAAC;IAAK;IAAK;IAAK;IAAK;IAAK;CAAI;AAC/D,MAAMC,kBAAkB,IAAIC,IAAoB;IAC9C;QAAC;QAAK;KAAU;IAChB;QAAC;QAAK;KAAU;IAChB;QAAC;QAAK;KAAU;IAChB;QAAC;QAAK;KAAU;IAChB;QAAC;QAAK;KAAU;IAChB;QAAC;QAAK;KAAO;IACb;QAAC;QAAK;KAAO;IACb;QAAC;QAAK;KAAO;IACb;QAAC;QAAK;KAAO;IACb;QAAC;QAAK;KAAQ;CACf;AAEM,IAAA,AAAMX,gBAAN,MAAMA;IAQXY,OAAOC,IAAsB,EAAE;QAC7B,IAAI,IAAI,CAACC,IAAI,CAACC,MAAM,KAAK,GAAG;YAC1B,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nDP,IAAI,CAAC;AACV"}
1
+ {"version":3,"sources":["../../../../../backend/src/applications/files/utils/files-search.ts"],"sourcesContent":["import { escapeString } from '../../../common/functions'\nimport { minCharsToSearch } from '../constants/indexing'\n\nconst regexMatchSearchBoolean = new RegExp(`([+-]?)(?:\"([^\"]+)\"|(\\\\S+))`)\nconst regexMatchesSearchBoolean = new RegExp(regexMatchSearchBoolean.source, 'g')\nconst booleanOperators = new Set(['+', '-', '<', '>', '~', '*'])\nconst accentToBaseMap = new Map<string, string>([\n ['a', '[aàáâä]'],\n ['e', '[eèéêë]'],\n ['i', '[iìíîï]'],\n ['o', '[oòóôö]'],\n ['u', '[uùúûü]'],\n ['c', '[cç]'],\n ['n', '[nñ]'],\n ['s', '[sš]'],\n ['z', '[zž]'],\n ['y', '[yýÿ]']\n])\n\nexport class MaxSortedList {\n public data: [number, string][] = []\n public nbItems: number\n\n constructor(nbItems: number) {\n this.nbItems = nbItems\n }\n\n insert(item: [number, string]) {\n if (this.data.length === 0) {\n this.data.push(item)\n return\n }\n // if score is smaller or the score already stored for another string ignore it and keep the first matches.\n if (item[0] < this.data[this.data.length - 1][0] || (this.data.length === this.nbItems && this.data.find(([num]) => num === item[0]))) {\n return\n }\n // insert data ordered by highest score\n const index: number = this.data.findIndex(([num]) => num < item[0])\n if (index === -1) {\n this.data.push(item)\n } else {\n this.data.splice(index, 0, item)\n }\n // remove the smaller code\n if (this.data.length > this.nbItems) {\n this.data.pop()\n }\n }\n}\n\nexport function analyzeTerms(search: string, onlyAllowNegative = false): string[] {\n /* Get the positive or negative terms list */\n const matches: RegExpMatchArray | [] = search.match(regexMatchesSearchBoolean) || []\n if (!matches.length) {\n return matches\n }\n return matches\n .flatMap((match: string) => {\n const [, operator, quoted, unquoted] = match.match(regexMatchSearchBoolean)\n let term: string = (quoted || unquoted).trim()\n\n if (term.length < minCharsToSearch) return null\n\n if ((onlyAllowNegative && operator !== '-') || (!onlyAllowNegative && (operator === '-' || operator === '~'))) return null\n\n if (booleanOperators.has(term[0])) {\n term = term.substring(1)\n }\n\n if (term[term.length - 1] === '*') {\n term = term.substring(0, term.length - 1)\n }\n\n return escapeString(term)\n })\n .filter(Boolean)\n}\n\nexport function genTermsPattern(terms: string[]): string {\n return terms.map((t) => genAccentInsensitiveRegexpPattern(t)).join('|')\n}\n\nexport function genRegexPositiveAndNegativeTerms(search: string): RegExp {\n const positiveTerms = analyzeTerms(search)\n const negativeTerms = analyzeTerms(search, true)\n const p = positiveTerms\n .map((t) => genAccentInsensitiveRegexpPattern(t))\n .map((t) => `(?=.*\\\\b${t})`)\n .join('')\n if (!negativeTerms.length) return new RegExp(p, 'i')\n const n = negativeTerms\n .map((t) => genAccentInsensitiveRegexpPattern(t))\n .map((t) => `\\\\b${t}\\\\b`)\n .join('|')\n return new RegExp(`^${p}(?!.*(${n})).*$`, 'i')\n}\n\nfunction genAccentInsensitiveRegexpPattern(input: string): string {\n /* Allow to catch all terms with accents or not */\n return input\n .split('')\n .map((char: string) => accentToBaseMap.get(char) || char)\n .join('')\n}\n"],"names":["MaxSortedList","analyzeTerms","genRegexPositiveAndNegativeTerms","genTermsPattern","regexMatchSearchBoolean","RegExp","regexMatchesSearchBoolean","source","booleanOperators","Set","accentToBaseMap","Map","insert","item","data","length","push","nbItems","find","num","index","findIndex","splice","pop","search","onlyAllowNegative","matches","match","flatMap","operator","quoted","unquoted","term","trim","minCharsToSearch","has","substring","escapeString","filter","Boolean","terms","map","t","genAccentInsensitiveRegexpPattern","join","positiveTerms","negativeTerms","p","n","input","split","char","get"],"mappings":";;;;;;;;;;;QAmBaA;eAAAA;;QA+BGC;eAAAA;;QAgCAC;eAAAA;;QAJAC;eAAAA;;;2BA9Ea;0BACI;AAEjC,MAAMC,0BAA0B,IAAIC,OAAO,CAAC,2BAA2B,CAAC;AACxE,MAAMC,4BAA4B,IAAID,OAAOD,wBAAwBG,MAAM,EAAE;AAC7E,MAAMC,mBAAmB,IAAIC,IAAI;IAAC;IAAK;IAAK;IAAK;IAA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EAAE,OAAO,IAAIV,OAAO0C,GAAG;IAChD,MAAMC,IAAIF,cACPL,GAAG,CAAC,CAACC,IAAMC,kCAAkCD,IAC7CD,GAAG,CAAC,CAACC,IAAM,CAAC,GAAG,EAAEA,EAAE,GAAG,CAAC,EACvBE,IAAI,CAAC;IACR,OAAO,IAAIvC,OAAO,CAAC,CAAC,EAAE0C,EAAE,MAAM,EAAEC,EAAE,KAAK,CAAC,EAAE;AAC5C;AAEA,SAASL,kCAAkCM,KAAa;IACtD,gDAAgD,GAChD,OAAOA,MACJC,KAAK,CAAC,IACNT,GAAG,CAAC,CAACU,OAAiBzC,gBAAgB0C,GAAG,CAACD,SAASA,MACnDP,IAAI,CAAC;AACV"}
@@ -1,8 +1,4 @@
1
- /*
2
- * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
3
- * This file is part of Sync-in | The open source file sync and share solution
4
- * See the LICENSE file for licensing details
5
- */ "use strict";
1
+ "use strict";
6
2
  Object.defineProperty(exports, "__esModule", {
7
3
  value: true
8
4
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../backend/src/applications/files/utils/files-tree.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport path from 'node:path'\nimport { sortObjByName } from '../../../common/functions'\nimport { SHARE_ALL_OPERATIONS } from '../../shares/constants/shares'\nimport { SPACE_ALL_OPERATIONS, SPACE_REPOSITORY } from '../../spaces/constants/spaces'\nimport { SpaceEnv } from '../../spaces/models/space-env.model'\nimport { getEnvPermissions } from '../../spaces/utils/permissions'\nimport { FileProps } from '../interfaces/file-props.interface'\nimport { FileTree } from '../interfaces/file-tree.interface'\nimport { dirHasChildren } from './files'\n\nasync function hasChildren(space: SpaceEnv, file: FileProps): Promise<boolean> {\n if (file.root?.alias) {\n // no need to check this\n return true\n } else if (space.realPath) {\n return await dirHasChildren(path.join(space.realPath, file.name))\n }\n // allows true by default\n return true\n}\n\nexport function convertToFilesTree(space: SpaceEnv, files: FileProps[], onlyDirs = true): Promise<FileTree[]> {\n if (space.inPersonalSpace) {\n // by default personal space endpoint has no permissions but in this case the root files must have all permissions\n space.permissions = SPACE_ALL_OPERATIONS\n } else if (space.inSharesList) {\n // by default shares space endpoint has no permissions\n // we are doing an intersection of the permissions, we need to grant all permissions to reflect the rights of the shares (root files)\n space.permissions = SHARE_ALL_OPERATIONS\n }\n return Promise.all(\n files\n .filter((f) => {\n return onlyDirs ? f.isDir : true\n })\n .sort(sortObjByName)\n .map(async (f) => {\n return {\n id: f.id,\n name: f.name,\n path: path.join(space.url, f.root?.alias || f.name),\n isDir: f.isDir,\n mime: f.mime,\n hasChildren: f.isDir ? await hasChildren(space, f) : false,\n inShare: space.inSharesRepository,\n enabled: f.root ? f.root.enabled : space.enabled,\n permissions: getEnvPermissions(space, f.root),\n quotaIsExceeded: space.quotaIsExceeded\n } as FileTree\n })\n )\n}\n\nexport function convertToSpacesTree(spaces: SpaceEnv[]): Promise<FileTree[]> {\n return Promise.all(\n spaces.sort(sortObjByName).map(async (space): Promise<FileTree> => {\n return {\n id: -space.id * 10, // random id must be greater than -9\n name: space.name,\n path: path.join(SPACE_REPOSITORY.FILES, space.alias),\n isDir: true,\n hasChildren: true,\n inShare: false,\n enabled: space.enabled,\n permissions: space.permissions,\n quotaIsExceeded: space.quotaIsExceeded\n } as FileTree\n })\n )\n}\n"],"names":["convertToFilesTree","convertToSpacesTree","hasChildren","space","file","root","alias","realPath","dirHasChildren","path","join","name","files","onlyDirs","inPersonalSpace","permissions","SPACE_ALL_OPERATIONS","inSharesList","SHARE_ALL_OPERATIONS","Promise","all","filter","f","isDir","sort","sortObjByName","map","id","url","mime","inShare","inSharesRepository","enabled","getEnvPermissions","quotaIsExceeded","spaces","SPACE_REPOSITORY","FILES"],"mappings":"AAAA;;;;CAIC;;;;;;;;;;;QAuBeA;eAAAA;;QAgCAC;eAAAA;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,MAAM+B,eAAe;QACxC;IACF;AAEN;AAEO,SAASjC,oBAAoBkC,MAAkB;IACpD,OAAOhB,QAAQC,GAAG,CAChBe,OAAOX,IAAI,CAACC,wBAAa,EAAEC,GAAG,CAAC,OAAOvB;QACpC,OAAO;YACLwB,IAAI,CAACxB,MAAMwB,EAAE,GAAG;YAChBhB,MAAMR,MAAMQ,IAAI;YAChBF,MAAMA,iBAAI,CAACC,IAAI,CAAC0B,wBAAgB,CAACC,KAAK,EAAElC,MAAMG,KAAK;YACnDiB,OAAO;YACPrB,aAAa;YACb4B,SAAS;YACTE,SAAS7B,MAAM6B,OAAO;YACtBjB,aAAaZ,MAAMY,WAAW;YAC9BmB,iBAAiB/B,MAAM+B,eAAe;QACxC;IACF;AAEJ"}
1
+ {"version":3,"sources":["../../../../../backend/src/applications/files/utils/files-tree.ts"],"sourcesContent":["import path from 'node:path'\nimport { sortObjByName } from '../../../common/functions'\nimport { SHARE_ALL_OPERATIONS } from '../../shares/constants/shares'\nimport { SPACE_ALL_OPERATIONS, SPACE_REPOSITORY } from '../../spaces/constants/spaces'\nimport { SpaceEnv } from '../../spaces/models/space-env.model'\nimport { getEnvPermissions } from '../../spaces/utils/permissions'\nimport { FileProps } from '../interfaces/file-props.interface'\nimport { FileTree } from '../interfaces/file-tree.interface'\nimport { dirHasChildren } from './files'\n\nasync function hasChildren(space: SpaceEnv, file: FileProps): Promise<boolean> {\n if (file.root?.alias) {\n // no need to check this\n return true\n } else if (space.realPath) {\n return await dirHasChildren(path.join(space.realPath, file.name))\n }\n // allows true by default\n return true\n}\n\nexport function convertToFilesTree(space: SpaceEnv, files: FileProps[], onlyDirs = true): Promise<FileTree[]> {\n if (space.inPersonalSpace) {\n // by default personal space endpoint has no permissions but in this case the root files must have all permissions\n space.permissions = SPACE_ALL_OPERATIONS\n } else if (space.inSharesList) {\n // by default shares space endpoint has no permissions\n // we are doing an intersection of the permissions, we need to grant all permissions to reflect the rights of the shares (root files)\n space.permissions = SHARE_ALL_OPERATIONS\n }\n return Promise.all(\n files\n .filter((f) => {\n return onlyDirs ? f.isDir : true\n })\n .sort(sortObjByName)\n .map(async (f) => {\n return {\n id: f.id,\n name: f.name,\n path: path.join(space.url, f.root?.alias || f.name),\n isDir: f.isDir,\n mime: f.mime,\n hasChildren: f.isDir ? await hasChildren(space, f) : false,\n inShare: space.inSharesRepository,\n enabled: f.root ? f.root.enabled : space.enabled,\n permissions: getEnvPermissions(space, f.root),\n quotaIsExceeded: space.quotaIsExceeded\n } as FileTree\n })\n )\n}\n\nexport function convertToSpacesTree(spaces: SpaceEnv[]): Promise<FileTree[]> {\n return Promise.all(\n spaces.sort(sortObjByName).map(async (space): Promise<FileTree> => {\n return {\n id: -space.id * 10, // random id must be greater than -9\n name: space.name,\n path: path.join(SPACE_REPOSITORY.FILES, space.alias),\n isDir: true,\n hasChildren: true,\n inShare: false,\n enabled: space.enabled,\n permissions: space.permissions,\n quotaIsExceeded: space.quotaIsExceeded\n } as FileTree\n })\n )\n}\n"],"names":["convertToFilesTree","convertToSpacesTree","hasChildren","space","file","root","alias","realPath","dirHasChildren","path","join","name","files","onlyDirs","inPersonalSpace","permissions","SPACE_ALL_OPERATIONS","inSharesList","SHARE_ALL_OPERATIONS","Promise","all","filter","f","isDir","sort","sortObjByName","map","id","url","mime","inShare","inSharesRepository","enabled","getEnvPermissions","quotaIsExceeded","spaces","SPACE_REPOSITORY","FILES"],"mappings":";;;;;;;;;;;QAqBgBA;eAAAA;;QAgCAC;eAAAA;;;iEArDC;2BACa;wBACO;wBACkB;6BAErB;uBAGH;;;;;;AAE/B,eAAeC,YAAYC,KAAe,EAAEC,IAAe;IACzD,IAAIA,KAAKC,IAAI,EAAEC,OAAO;QACpB,wBAAwB;QACxB,OAAO;IACT,OAAO,IAAIH,MAAMI,QAAQ,EAAE;QACzB,OAAO,MAAMC,IAAAA,qBAAc,EAACC,iBAAI,CAACC,IAAI,CAACP,MAAMI,QAAQ,EAAEH,KAAKO,IAAI;IACjE;IACA,y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AAMG,KAAK;YACnDiB,OAAO;YACPrB,aAAa;YACb4B,SAAS;YACTE,SAAS7B,MAAM6B,OAAO;YACtBjB,aAAaZ,MAAMY,WAAW;YAC9BmB,iBAAiB/B,MAAM+B,eAAe;QACxC;IACF;AAEJ"}
@@ -1,8 +1,4 @@
1
- /*
2
- * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
3
- * This file is part of Sync-in | The open source file sync and share solution
4
- * See the LICENSE file for licensing details
5
- */ "use strict";
1
+ "use strict";
6
2
  Object.defineProperty(exports, "__esModule", {
7
3
  value: true
8
4
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../backend/src/applications/files/utils/files.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport { HttpStatus } from '@nestjs/common'\nimport { WriteStream } from 'fs'\nimport fse from 'fs-extra'\nimport mime from 'mime-types'\nimport crypto from 'node:crypto'\nimport { createReadStream, createWriteStream, Dirent, statSync } from 'node:fs'\nimport fs from 'node:fs/promises'\nimport path from 'node:path'\nimport { Readable } from 'node:stream'\nimport { pipeline } from 'node:stream/promises'\nimport { formatDateISOString } from '../../../common/functions'\nimport { currentTimeStamp, isValidFileName, regExpPreventPathTraversal } from '../../../common/shared'\nimport { DEFAULT_CHECKSUM_ALGORITHM, DEFAULT_HIGH_WATER_MARK, EXTRA_MIMES_TYPE } from '../constants/files'\nimport type { FileDBProps } from '../interfaces/file-db-props.interface'\nimport type { FileProps } from '../interfaces/file-props.interface'\nimport { FileError } from '../models/file-error'\n\nexport function sanitizePath(fPath: string): string {\n return path.normalize(fPath).replace(regExpPreventPathTraversal, '')\n}\n\nexport function sanitizeName(name: string): string {\n return name\n .replace(/^\\s+|[. ]+$/g, '') // trimStart + trimEnd + strip trailing dots\n .replace(/[/\\\\]/g, '') // remove slashes\n .replace(/\\.\\./g, '') // remove '..'\n}\n\nexport function checkFileName(fPath: string): string {\n const fName = fileName(fPath)\n try {\n isValidFileName(fName)\n return fName\n } catch {\n throw new FileError(HttpStatus.BAD_REQUEST, 'Forbidden characters')\n }\n}\n\nexport function isPathExists(rPath: string): Promise<boolean> {\n return fse.pathExists(rPath)\n}\n\nexport async function isPathIsReadable(rPath: string): Promise<boolean> {\n try {\n await fs.access(rPath, fs.constants.R_OK)\n } catch {\n return false\n }\n return true\n}\n\nexport async function isPathIsWriteable(rPath: string): Promise<boolean> {\n try {\n await fs.access(rPath, fs.constants.W_OK)\n } catch {\n return false\n }\n return true\n}\n\nexport async function isPathIsDir(rPath: string): Promise<boolean> {\n return (await fs.stat(rPath)).isDirectory()\n}\n\nexport function fileName(fPath: string): string {\n return path.posix.basename(fPath)\n}\n\nexport function dirName(fPath: string): string {\n return path.dirname(fPath)\n}\n\nexport async function fileSize(rPath: string): Promise<number> {\n return (await fs.stat(rPath)).size\n}\n\nexport function createEmptyFile(rPath: string): Promise<void> {\n return fs.writeFile(rPath, '')\n}\n\nexport function makeDir(rPath: string, recursive?: boolean): Promise<string> {\n return fs.mkdir(rPath, { recursive: recursive })\n}\n\nexport function getMimeType(fPath: string, isDir: boolean): string {\n if (isDir) {\n return 'directory'\n }\n const extName: string = path.extname(fPath)\n if (EXTRA_MIMES_TYPE.has(extName)) {\n return EXTRA_MIMES_TYPE.get(extName)\n }\n const m = mime.lookup(extName)\n if (m) {\n return m.replace('/', '-')\n }\n return 'file'\n}\n\nexport function genEtag(file?: Pick<FileProps, 'size' | 'mtime'>, rPath?: string, weakPrefix = true): string {\n if (!file) {\n if (!rPath) throw new Error('File or path are missing')\n const stats = statSync(rPath)\n file = { size: stats.size, mtime: stats.mtime.getTime() }\n }\n const etag = `${file.size.toString(16)}-${file.mtime.toString(16)}`\n return weakPrefix ? `W/\"${etag}\"` : etag\n}\n\nexport function genUniqHashFromFileDBProps(dbFile: FileDBProps) {\n const dbFileString = `${Object.keys(dbFile)\n .sort()\n .map((k) => `${k}=${String(dbFile[k])}`)\n .join('|')}`\n return crypto.createHash(DEFAULT_CHECKSUM_ALGORITHM).update(dbFileString, 'utf-8').digest('hex')\n}\n\nexport function removeFiles(rPath: string): Promise<void> {\n // if the file does not exist, no error is thrown\n return fse.remove(rPath)\n}\n\nexport async function getProps(rPath: string, fPath?: string, isDir?: boolean): Promise<FileProps> {\n const stats = await fs.stat(rPath)\n const isDirectory = isDir === undefined ? stats.isDirectory() : isDir\n return {\n id: -stats.ino, // use negative number to avoid conflicts with existing database ids\n path: dirName(fPath !== undefined ? fPath : rPath),\n name: fileName(fPath !== undefined ? fPath : rPath),\n isDir: isDirectory,\n size: isDirectory ? 0 : stats.size,\n ctime: stats.birthtime.getTime(),\n mtime: stats.mtime.getTime(),\n mime: getMimeType(rPath, isDirectory)\n }\n}\n\nexport function touchFile(rPath: string, mtime?: number): Promise<void> {\n if (!mtime) mtime = currentTimeStamp()\n return fs.utimes(rPath, mtime, mtime)\n}\n\nexport async function copyFiles(srcPath: string, dstPath: string, overwrite = false, recursive = true, preserveTimestamps = true): Promise<void> {\n /*\n If src is a directory it will copy everything inside of this directory, not the entire directory itself\n If src is a file, dest cannot be a directory\n */\n if (!recursive && (await isPathIsDir(srcPath))) {\n await fs.mkdir(dstPath)\n if (preserveTimestamps) {\n const stat = await fs.stat(srcPath)\n await fs.utimes(dstPath, stat.atime, stat.mtime)\n }\n } else {\n await fse.copy(srcPath, dstPath, { overwrite, preserveTimestamps: preserveTimestamps })\n }\n}\n\nexport function moveFiles(srcPath: string, dstPath: string, overwrite = false): Promise<void> {\n /*\n If src is a file, dest must be a file and when src is a directory, dest must be a directory\n */\n return fse.move(srcPath, dstPath, { overwrite })\n}\n\nexport async function checksumFile(filePath: string, alg: string): Promise<string> {\n const hash = crypto.createHash(alg)\n const stream = createReadStream(filePath, { highWaterMark: DEFAULT_HIGH_WATER_MARK })\n await pipeline(stream, hash)\n return hash.digest('hex')\n}\n\nexport function writeFromStream(rPath: string, stream: Readable, start: number = 0): Promise<void> {\n const dst: WriteStream = createWriteStream(rPath, { flags: start ? 'a' : 'w', start: start, highWaterMark: DEFAULT_HIGH_WATER_MARK })\n return pipeline(stream, dst)\n}\n\nexport async function writeFromStreamAndChecksum(rPath: string, stream: Readable, hasRange: number, alg: string): Promise<string> {\n const hash = crypto.createHash(alg)\n if (hasRange) {\n const src = createReadStream(rPath, { highWaterMark: DEFAULT_HIGH_WATER_MARK })\n await pipeline(src, hash, { end: false })\n }\n const dst = createWriteStream(rPath, { flags: hasRange ? 'a' : 'w', highWaterMark: DEFAULT_HIGH_WATER_MARK })\n await pipeline(\n stream,\n async function* (source) {\n for await (const chunk of source) {\n hash.update(chunk)\n yield chunk\n }\n },\n dst\n )\n hash.end()\n return hash.digest('hex')\n}\n\nexport function copyFileContent(srcPath: string, dstPath: string): Promise<void> {\n const srcStream = createReadStream(srcPath, { highWaterMark: DEFAULT_HIGH_WATER_MARK })\n return writeFromStream(dstPath, srcStream)\n}\n\nexport async function dirSize(rPath: string): Promise<[number, any]> {\n let size = 0\n const errors: Record<string, string> = {}\n for (const f of await fs.readdir(rPath, { withFileTypes: true, recursive: true })) {\n if (f.isFile()) {\n const p = path.join(f.parentPath, f.name)\n try {\n size += (await fs.stat(p)).size\n } catch (e: any) {\n errors[p] = e.message\n }\n }\n }\n return [size, errors]\n}\n\nexport async function dirListFileNames(rPath: string): Promise<string[]> {\n return (await fs.readdir(rPath)).map((path: string) => fileName(path))\n}\n\nexport async function countDirEntries(rPath: string): Promise<{ files: number; directories: number }> {\n return (await fs.readdir(rPath, { withFileTypes: true, recursive: true })).reduce(\n (acc, f: Dirent) => {\n if (f.isDirectory()) {\n acc.directories++\n } else {\n acc.files++\n }\n return acc\n },\n { files: 0, directories: 0 }\n )\n}\n\nexport async function dirHasChildren(rPath: string, mustContainsDirs = true): Promise<boolean> {\n for await (const file of await fs.opendir(rPath)) {\n if (mustContainsDirs) {\n if (file.isDirectory()) return true\n } else {\n return true\n }\n }\n return false\n}\n\nexport async function uniqueFilePathFromDir(rPath: string): Promise<string> {\n if (await isPathExists(rPath)) {\n const parentDir = path.dirname(rPath)\n const extension = path.extname(rPath)\n const nameWithoutExtension = path.basename(rPath, extension)\n let count = 1\n while (await isPathExists(path.join(parentDir, `${nameWithoutExtension} (${count})${extension}`))) {\n count++\n }\n return path.join(parentDir, `${nameWithoutExtension} (${count})${extension}`)\n }\n return rPath\n}\n\nexport async function uniqueDatedFilePath(rPath: string): Promise<{ isDir: boolean; path: string }> {\n const date = formatDateISOString(new Date())\n if (await isPathIsDir(rPath)) {\n return { isDir: true, path: `${rPath}-${date}` }\n } else {\n const extension = path.extname(rPath)\n const nameWithoutExtension = path.basename(rPath, extension)\n return { isDir: false, path: path.join(path.dirname(rPath), `${nameWithoutExtension}-${date}${extension}`) }\n }\n}\n\nexport async function checkExternalPath(rPath: string) {\n if (!(await isPathExists(rPath))) {\n throw new FileError(HttpStatus.NOT_FOUND, 'The location does not exist')\n }\n if (!(await isPathIsReadable(rPath))) {\n throw new FileError(HttpStatus.NOT_ACCEPTABLE, 'The location is not readable')\n }\n if (!(await isPathIsWriteable(rPath))) {\n throw new FileError(HttpStatus.NOT_ACCEPTABLE, 'The location is not writeable')\n }\n}\n"],"names":["checkExternalPath","checkFileName","checksumFile","copyFileContent","copyFiles","countDirEntries","createEmptyFile","dirHasChildren","dirListFileNames","dirName","dirSize","fileName","fileSize","genEtag","genUniqHashFromFileDBProps","getMimeType","getProps","isPathExists","isPathIsDir","isPathIsReadable","isPathIsWriteable","makeDir","moveFiles","removeFiles","sanitizeName","sanitizePath","touchFile","uniqueDatedFilePath","uniqueFilePathFromDir","writeFromStream","writeFromStreamAndChecksum","fPath","path","normalize","replace","regExpPreventPathTraversal","name","fName","isValidFileName","FileError","HttpStatus","BAD_REQUEST","rPath","fse","pathExists","fs","access","constants","R_OK","W_OK","stat","isDirectory","posix","basename","dirname","size","writeFile","recursive","mkdir","isDir","extName","extname","EXTRA_MIMES_TYPE","has","get","m","mime","lookup","file","weakPrefix","Error","stats","statSync","mtime","getTime","etag","toString","dbFile","dbFileString","Object","keys","sort","map","k","String","join","crypto","createHash","DEFAULT_CHECKSUM_ALGORITHM","update","digest","remove","undefined","id","ino","ctime","birthtime","currentTimeStamp","utimes","srcPath","dstPath","overwrite","preserveTimestamps","atime","copy","move","filePath","alg","hash","stream","createReadStream","highWaterMark","DEFAULT_HIGH_WATER_MARK","pipeline","start","dst","createWriteStream","flags","hasRange","src","end","source","chunk","srcStream","errors","f","readdir","withFileTypes","isFile","p","parentPath","e","message","reduce","acc","directories","files","mustContainsDirs","opendir","parentDir","extension","nameWithoutExtension","count","date","formatDateISOString","Date","NOT_FOUND","NOT_ACCEPTABLE"],"mappings":"AAAA;;;;CAIC;;;;;;;;;;;QAmRqBA;eAAAA;;QArPNC;eAAAA;;QAyIMC;eAAAA;;QAiCNC;eAAAA;;QAxDMC;eAAAA;;QAiFAC;eAAAA;;QAnJNC;eAAAA;;QAiKMC;eAAAA;;QAlBAC;eAAAA;;QAvJNC;eAAAA;;QAuIMC;eAAAA;;QA3INC;eAAAA;;QAQMC;eAAAA;;QA2BNC;eAAAA;;QAUAC;eAAAA;;QAzBAC;eAAAA;;QAsCMC;eAAAA;;QApFNC;eAAAA;;QAsBMC;eAAAA;;QAlBAC;eAAAA;;QASAC;eAAAA;;QA6BNC;eAAAA;;QA8EAC;eAAAA;;QAzCAC;eAAAA;;QAhGAC;eAAAA;;QAJAC;eAAAA;;QAwHAC;eAAAA;;QA6HMC;eAAAA;;QAdAC;eAAAA;;QA5ENC;eAAAA;;QAKMC;eAAAA;;;wBAjLK;gEAEX;kEACC;mEACE;wBACmD;iEACvD;iEACE;2BAEQ;2BACW;wBAC0C;uBACQ;2BAG5D;;;;;;AAEnB,SAASL,aAAaM,KAAa;IACxC,OAAOC,iBAAI,CAACC,SAAS,CAACF,OAAOG,OAAO,CAACC,kCAA0B,EAAE;AACnE;AAEO,SAASX,aAAaY,IAAY;IACvC,OAAOA,KACJF,OAAO,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BAAS,CAACC,kBAAU,CAAC0G,SAAS,EAAE;IAC5C;IACA,IAAI,CAAE,MAAM/H,iBAAiBuB,QAAS;QACpC,MAAM,IAAIH,oBAAS,CAACC,kBAAU,CAAC2G,cAAc,EAAE;IACjD;IACA,IAAI,CAAE,MAAM/H,kBAAkBsB,QAAS;QACrC,MAAM,IAAIH,oBAAS,CAACC,kBAAU,CAAC2G,cAAc,EAAE;IACjD;AACF"}
1
+ {"version":3,"sources":["../../../../../backend/src/applications/files/utils/files.ts"],"sourcesContent":["import { HttpStatus } from '@nestjs/common'\nimport { WriteStream } from 'fs'\nimport fse from 'fs-extra'\nimport mime from 'mime-types'\nimport crypto from 'node:crypto'\nimport { createReadStream, createWriteStream, Dirent, statSync } from 'node:fs'\nimport fs from 'node:fs/promises'\nimport path from 'node:path'\nimport { Readable } from 'node:stream'\nimport { pipeline } from 'node:stream/promises'\nimport { formatDateISOString } from '../../../common/functions'\nimport { currentTimeStamp, isValidFileName, regExpPreventPathTraversal } from '../../../common/shared'\nimport { DEFAULT_CHECKSUM_ALGORITHM, DEFAULT_HIGH_WATER_MARK, EXTRA_MIMES_TYPE } from '../constants/files'\nimport type { FileDBProps } from '../interfaces/file-db-props.interface'\nimport type { FileProps } from '../interfaces/file-props.interface'\nimport { FileError } from '../models/file-error'\n\nexport function sanitizePath(fPath: string): string {\n return path.normalize(fPath).replace(regExpPreventPathTraversal, '')\n}\n\nexport function sanitizeName(name: string): string {\n return name\n .replace(/^\\s+|[. ]+$/g, '') // trimStart + trimEnd + strip trailing dots\n .replace(/[/\\\\]/g, '') // remove slashes\n .replace(/\\.\\./g, '') // remove '..'\n}\n\nexport function checkFileName(fPath: string): string {\n const fName = fileName(fPath)\n try {\n isValidFileName(fName)\n return fName\n } catch {\n throw new FileError(HttpStatus.BAD_REQUEST, 'Forbidden characters')\n }\n}\n\nexport function isPathExists(rPath: string): Promise<boolean> {\n return fse.pathExists(rPath)\n}\n\nexport async function isPathIsReadable(rPath: string): Promise<boolean> {\n try {\n await fs.access(rPath, fs.constants.R_OK)\n } catch {\n return false\n }\n return true\n}\n\nexport async function isPathIsWriteable(rPath: string): Promise<boolean> {\n try {\n await fs.access(rPath, fs.constants.W_OK)\n } catch {\n return false\n }\n return true\n}\n\nexport async function isPathIsDir(rPath: string): Promise<boolean> {\n return (await fs.stat(rPath)).isDirectory()\n}\n\nexport function fileName(fPath: string): string {\n return path.posix.basename(fPath)\n}\n\nexport function dirName(fPath: string): string {\n return path.dirname(fPath)\n}\n\nexport async function fileSize(rPath: string): Promise<number> {\n return (await fs.stat(rPath)).size\n}\n\nexport function createEmptyFile(rPath: string): Promise<void> {\n return fs.writeFile(rPath, '')\n}\n\nexport function makeDir(rPath: string, recursive?: boolean): Promise<string> {\n return fs.mkdir(rPath, { recursive: recursive })\n}\n\nexport function getMimeType(fPath: string, isDir: boolean): string {\n if (isDir) {\n return 'directory'\n }\n const extName: string = path.extname(fPath)\n if (EXTRA_MIMES_TYPE.has(extName)) {\n return EXTRA_MIMES_TYPE.get(extName)\n }\n const m = mime.lookup(extName)\n if (m) {\n return m.replace('/', '-')\n }\n return 'file'\n}\n\nexport function genEtag(file?: Pick<FileProps, 'size' | 'mtime'>, rPath?: string, weakPrefix = true): string {\n if (!file) {\n if (!rPath) throw new Error('File or path are missing')\n const stats = statSync(rPath)\n file = { size: stats.size, mtime: stats.mtime.getTime() }\n }\n const etag = `${file.size.toString(16)}-${file.mtime.toString(16)}`\n return weakPrefix ? `W/\"${etag}\"` : etag\n}\n\nexport function genUniqHashFromFileDBProps(dbFile: FileDBProps) {\n const dbFileString = `${Object.keys(dbFile)\n .sort()\n .map((k) => `${k}=${String(dbFile[k])}`)\n .join('|')}`\n return crypto.createHash(DEFAULT_CHECKSUM_ALGORITHM).update(dbFileString, 'utf-8').digest('hex')\n}\n\nexport function removeFiles(rPath: string): Promise<void> {\n // if the file does not exist, no error is thrown\n return fse.remove(rPath)\n}\n\nexport async function getProps(rPath: string, fPath?: string, isDir?: boolean): Promise<FileProps> {\n const stats = await fs.stat(rPath)\n const isDirectory = isDir === undefined ? stats.isDirectory() : isDir\n return {\n id: -stats.ino, // use negative number to avoid conflicts with existing database ids\n path: dirName(fPath !== undefined ? fPath : rPath),\n name: fileName(fPath !== undefined ? fPath : rPath),\n isDir: isDirectory,\n size: isDirectory ? 0 : stats.size,\n ctime: stats.birthtime.getTime(),\n mtime: stats.mtime.getTime(),\n mime: getMimeType(rPath, isDirectory)\n }\n}\n\nexport function touchFile(rPath: string, mtime?: number): Promise<void> {\n if (!mtime) mtime = currentTimeStamp()\n return fs.utimes(rPath, mtime, mtime)\n}\n\nexport async function copyFiles(srcPath: string, dstPath: string, overwrite = false, recursive = true, preserveTimestamps = true): Promise<void> {\n /*\n If src is a directory it will copy everything inside of this directory, not the entire directory itself\n If src is a file, dest cannot be a directory\n */\n if (!recursive && (await isPathIsDir(srcPath))) {\n await fs.mkdir(dstPath)\n if (preserveTimestamps) {\n const stat = await fs.stat(srcPath)\n await fs.utimes(dstPath, stat.atime, stat.mtime)\n }\n } else {\n await fse.copy(srcPath, dstPath, { overwrite, preserveTimestamps: preserveTimestamps })\n }\n}\n\nexport function moveFiles(srcPath: string, dstPath: string, overwrite = false): Promise<void> {\n /*\n If src is a file, dest must be a file and when src is a directory, dest must be a directory\n */\n return fse.move(srcPath, dstPath, { overwrite })\n}\n\nexport async function checksumFile(filePath: string, alg: string): Promise<string> {\n const hash = crypto.createHash(alg)\n const stream = createReadStream(filePath, { highWaterMark: DEFAULT_HIGH_WATER_MARK })\n await pipeline(stream, hash)\n return hash.digest('hex')\n}\n\nexport function writeFromStream(rPath: string, stream: Readable, start: number = 0): Promise<void> {\n const dst: WriteStream = createWriteStream(rPath, { flags: start ? 'a' : 'w', start: start, highWaterMark: DEFAULT_HIGH_WATER_MARK })\n return pipeline(stream, dst)\n}\n\nexport async function writeFromStreamAndChecksum(rPath: string, stream: Readable, hasRange: number, alg: string): Promise<string> {\n const hash = crypto.createHash(alg)\n if (hasRange) {\n const src = createReadStream(rPath, { highWaterMark: DEFAULT_HIGH_WATER_MARK })\n await pipeline(src, hash, { end: false })\n }\n const dst = createWriteStream(rPath, { flags: hasRange ? 'a' : 'w', highWaterMark: DEFAULT_HIGH_WATER_MARK })\n await pipeline(\n stream,\n async function* (source) {\n for await (const chunk of source) {\n hash.update(chunk)\n yield chunk\n }\n },\n dst\n )\n hash.end()\n return hash.digest('hex')\n}\n\nexport function copyFileContent(srcPath: string, dstPath: string): Promise<void> {\n const srcStream = createReadStream(srcPath, { highWaterMark: DEFAULT_HIGH_WATER_MARK })\n return writeFromStream(dstPath, srcStream)\n}\n\nexport async function dirSize(rPath: string): Promise<[number, any]> {\n let size = 0\n const errors: Record<string, string> = {}\n for (const f of await fs.readdir(rPath, { withFileTypes: true, recursive: true })) {\n if (f.isFile()) {\n const p = path.join(f.parentPath, f.name)\n try {\n size += (await fs.stat(p)).size\n } catch (e: any) {\n errors[p] = e.message\n }\n }\n }\n return [size, errors]\n}\n\nexport async function dirListFileNames(rPath: string): Promise<string[]> {\n return (await fs.readdir(rPath)).map((path: string) => fileName(path))\n}\n\nexport async function countDirEntries(rPath: string): Promise<{ files: number; directories: number }> {\n return (await fs.readdir(rPath, { withFileTypes: true, recursive: true })).reduce(\n (acc, f: Dirent) => {\n if (f.isDirectory()) {\n acc.directories++\n } else {\n acc.files++\n }\n return acc\n },\n { files: 0, directories: 0 }\n )\n}\n\nexport async function dirHasChildren(rPath: string, mustContainsDirs = true): Promise<boolean> {\n for await (const file of await fs.opendir(rPath)) {\n if (mustContainsDirs) {\n if (file.isDirectory()) return true\n } else {\n return true\n }\n }\n return false\n}\n\nexport async function uniqueFilePathFromDir(rPath: string): Promise<string> {\n if (await isPathExists(rPath)) {\n const parentDir = path.dirname(rPath)\n const extension = path.extname(rPath)\n const nameWithoutExtension = path.basename(rPath, extension)\n let count = 1\n while (await isPathExists(path.join(parentDir, `${nameWithoutExtension} (${count})${extension}`))) {\n count++\n }\n return path.join(parentDir, `${nameWithoutExtension} (${count})${extension}`)\n }\n return rPath\n}\n\nexport async function uniqueDatedFilePath(rPath: string): Promise<{ isDir: boolean; path: string }> {\n const date = formatDateISOString(new Date())\n if (await isPathIsDir(rPath)) {\n return { isDir: true, path: `${rPath}-${date}` }\n } else {\n const extension = path.extname(rPath)\n const nameWithoutExtension = path.basename(rPath, extension)\n return { isDir: false, path: path.join(path.dirname(rPath), `${nameWithoutExtension}-${date}${extension}`) }\n }\n}\n\nexport async function checkExternalPath(rPath: string) {\n if (!(await isPathExists(rPath))) {\n throw new FileError(HttpStatus.NOT_FOUND, 'The location does not exist')\n }\n if (!(await isPathIsReadable(rPath))) {\n throw new FileError(HttpStatus.NOT_ACCEPTABLE, 'The location is not readable')\n }\n if (!(await isPathIsWriteable(rPath))) {\n throw new FileError(HttpStatus.NOT_ACCEPTABLE, 'The location is not writeable')\n }\n}\n"],"names":["checkExternalPath","checkFileName","checksumFile","copyFileContent","copyFiles","countDirEntries","createEmptyFile","dirHasChildren","dirListFileNames","dirName","dirSize","fileName","fileSize","genEtag","genUniqHashFromFileDBProps","getMimeType","getProps","isPathExists","isPathIsDir","isPathIsReadable","isPathIsWriteable","makeDir","moveFiles","removeFiles","sanitizeName","sanitizePath","touchFile","uniqueDatedFilePath","uniqueFilePathFromDir","writeFromStream","writeFromStreamAndChecksum","fPath","path","normalize","replace","regExpPreventPathTraversal","name","fName","isValidFileName","FileError","HttpStatus","BAD_REQUEST","rPath","fse","pathExists","fs","access","constants","R_OK","W_OK","stat","isDirectory","posix","basename","dirname","size","writeFile","recursive","mkdir","isDir","extName","extname","EXTRA_MIMES_TYPE","has","get","m","mime","lookup","file","weakPrefix","Error","stats","statSync","mtime","getTime","etag","toString","dbFile","dbFileString","Object","keys","sort","map","k","String","join","crypto","createHash","DEFAULT_CHECKSUM_ALGORITHM","update","digest","remove","undefined","id","ino","ctime","birthtime","currentTimeStamp","utimes","srcPath","dstPath","overwrite","preserveTimestamps","atime","copy","move","filePath","alg","hash","stream","createReadStream","highWaterMark","DEFAULT_HIGH_WATER_MARK","pipeline","start","dst","createWriteStream","flags","hasRange","src","end","source","chunk","srcStream","errors","f","readdir","withFileTypes","isFile","p","parentPath","e","message","reduce","acc","directories","files","mustContainsDirs","opendir","parentDir","extension","nameWithoutExtension","count","date","formatDateISOString","Date","NOT_FOUND","NOT_ACCEPTABLE"],"mappings":";;;;;;;;;;;QAiRsBA;eAAAA;;QArPNC;eAAAA;;QAyIMC;eAAAA;;QAiCNC;eAAAA;;QAxDMC;eAAAA;;QAiFAC;eAAAA;;QAnJNC;eAAAA;;QAiKMC;eAAAA;;QAlBAC;eAAAA;;QAvJNC;eAAAA;;QAuIMC;eAAAA;;QA3INC;eAAAA;;QAQMC;eAAAA;;QA2BNC;eAAAA;;QAUAC;eAAAA;;QAzBAC;eAAAA;;QAsCMC;eAAAA;;QApFNC;eAAAA;;QAsBMC;eAAAA;;QAlBAC;eAAAA;;QASAC;eAAAA;;QA6BNC;eAAAA;;QA8EAC;eAAAA;;QAzCAC;eAAAA;;QAhGAC;eAAAA;;QAJAC;eAAAA;;QAwHAC;eAAAA;;QA6HMC;eAAAA;;QAdAC;eAAAA;;QA5ENC;eAAAA;;QAKMC;eAAAA;;;wBAjLK;gEAEX;kEACC;mEACE;wBACmD;iEACvD;iEACE;2BAEQ;2BACW;wBAC0C;uBACQ;2BAG5D;;;;;;AAEnB,SAASL,aAAaM,KAAa;IACxC,OAAOC,iBAAI,CAACC,SAAS,CAACF,OAAOG,OAAO,CAACC,kCAA0B,EAAE;AACnE;AAEO,SAASX,aAAaY,IAAY;IACvC,OAAOA,KACJF,OAAO,CAAC,gBAAgB,IAAI,4CAA4C;KACxEA,OAAO,CAAC,UAAU,IAAI,iBAAiB;KACvCA,OAAO,CAAC,SAAS,IAAI,cAAc;;AACxC;AAEO,SAASjC,cAAc8B,KAAa;IACzC,MAAMM,QAAQ1B,SAASoB;IACvB,IAAI;QACFO,IAAAA,uBAAe,EAACD;QAChB,OAAOA;IACT,EAAE,OA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,CAAC2G,cAAc,EAAE;IACjD;AACF"}
@@ -1,8 +1,4 @@
1
- /*
2
- * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
3
- * This file is part of Sync-in | The open source file sync and share solution
4
- * See the LICENSE file for licensing details
5
- */ "use strict";
1
+ "use strict";
6
2
  Object.defineProperty(exports, "__esModule", {
7
3
  value: true
8
4
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../backend/src/applications/files/utils/send-file.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport { send, SendOptions, SendResult } from '@fastify/send'\nimport { HttpStatus, StreamableFile } from '@nestjs/common'\nimport { FastifyReply, FastifyRequest } from 'fastify'\nimport { DEFAULT_HIGH_WATER_MARK } from '../constants/files'\nimport { FileError } from '../models/file-error'\nimport { fileName, isPathExists, isPathIsDir, isPathIsReadable } from './files'\n\nexport function makeContentDispositionAttachment(fileName: string) {\n const downloadName = fileName.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '')\n return `attachment; filename=\"${downloadName}\";filename*=UTF-8''${fileName}`\n}\n\nexport class SendFile {\n private fileName: string\n\n constructor(\n private readonly filePath: string,\n private readonly downloadName = '',\n private readonly sendOptions: SendOptions = {\n acceptRanges: true,\n etag: true,\n dotfiles: 'allow',\n lastModified: true,\n cacheControl: true,\n maxAge: 0,\n index: false,\n highWaterMark: DEFAULT_HIGH_WATER_MARK\n }\n ) {}\n\n async checks() {\n if (!(await isPathExists(this.filePath))) {\n throw new FileError(HttpStatus.NOT_FOUND, 'Location not found')\n }\n if (await isPathIsDir(this.filePath)) {\n throw new FileError(HttpStatus.BAD_REQUEST, 'The location is a directory')\n }\n if (!(await isPathIsReadable(this.filePath))) {\n throw new FileError(HttpStatus.METHOD_NOT_ALLOWED, 'The location is not readable')\n }\n }\n\n async stream(req: FastifyRequest, res: FastifyReply): Promise<StreamableFile> {\n // SendStream manages HEAD (no including body in response) & GET request (with body)\n // Ranges, LastModified, Etag are also handled\n // Send function uses decodeURIComponent, but filePath is already decoded: we need to encode it again before passing it.\n const encodedFilePath = encodeURIComponent(this.filePath)\n this.fileName = encodeURIComponent(this.downloadName ? this.downloadName : fileName(this.filePath))\n const sendResult: SendResult = await send(req.raw, encodedFilePath, this.sendOptions)\n // Check if the path was correctly validated\n if (sendResult.metadata['path'] === undefined) {\n throw new FileError(HttpStatus.BAD_REQUEST, 'Location not found')\n }\n // Force file to be downloaded as an attachment\n sendResult.headers['content-disposition'] = makeContentDispositionAttachment(this.fileName)\n res.headers(sendResult.headers)\n res.status(sendResult.statusCode)\n // sendStream.once('stream', () => console.log(`Sending: ${this.fileName}`))\n // sendStream.once('end', () => console.log(`Received: ${this.fileName}`))\n // sendStream.once('error', (e: Error) => console.error(`Transfer error : ${this.fileName} - ${e}`))\n return new StreamableFile(sendResult.stream)\n }\n}\n"],"names":["SendFile","makeContentDispositionAttachment","fileName","downloadName","normalize","replace","checks","isPathExists","filePath","FileError","HttpStatus","NOT_FOUND","isPathIsDir","BAD_REQUEST","isPathIsReadable","METHOD_NOT_ALLOWED","stream","req","res","encodedFilePath","encodeURIComponent","sendResult","send","raw","sendOptions","metadata","undefined","headers","status","statusCode","StreamableFile","acceptRanges","etag","dotfiles","lastModified","cacheControl","maxAge","index","highWaterMark","DEFAULT_HIGH_WATER_MARK"],"mappings":"AAAA;;;;CAIC;;;;;;;;;;;QAcYA;eAAAA;;QALGC;eAAAA;;;sBAP8B;wBACH;uBAEH;2BACd;wBAC4C;AAE/D,SAASA,iCAAiCC,QAAgB;IAC/D,MAAMC,eAAeD,SAASE,SAAS,CAAC,OAAOC,OAAO,CAAC,oBAAoB;IAC3E,OAAO,CAAC,sBAAsB,EAAEF,aAAa,mBAAmB,EAAED,UAAU;AAC9E;AAEO,IAAA,AAAMF,WAAN,MAAMA;IAkBX,MAAMM,SAAS;QACb,IAAI,CAAE,MAAM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BqB,cAA2B;QAC1CO,cAAc;QACdC,MAAM;QACNC,UAAU;QACVC,cAAc;QACdC,cAAc;QACdC,QAAQ;QACRC,OAAO;QACPC,eAAeC,8BAAuB;IACxC,CAAC,CACD;aAZiB/B,WAAAA;aACAL,eAAAA;aACAqB,cAAAA;IAUhB;AAkCL"}
1
+ {"version":3,"sources":["../../../../../backend/src/applications/files/utils/send-file.ts"],"sourcesContent":["import { send, SendOptions, SendResult } from '@fastify/send'\nimport { HttpStatus, StreamableFile } from '@nestjs/common'\nimport { FastifyReply, FastifyRequest } from 'fastify'\nimport { DEFAULT_HIGH_WATER_MARK } from '../constants/files'\nimport { FileError } from '../models/file-error'\nimport { fileName, isPathExists, isPathIsDir, isPathIsReadable } from './files'\n\nexport function makeContentDispositionAttachment(fileName: string) {\n const downloadName = fileName.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '')\n return `attachment; filename=\"${downloadName}\";filename*=UTF-8''${fileName}`\n}\n\nexport class SendFile {\n private fileName: string\n\n constructor(\n private readonly filePath: string,\n private readonly downloadName = '',\n private readonly sendOptions: SendOptions = {\n acceptRanges: true,\n etag: true,\n dotfiles: 'allow',\n lastModified: true,\n cacheControl: true,\n maxAge: 0,\n index: false,\n highWaterMark: DEFAULT_HIGH_WATER_MARK\n }\n ) {}\n\n async checks() {\n if (!(await isPathExists(this.filePath))) {\n throw new FileError(HttpStatus.NOT_FOUND, 'Location not found')\n }\n if (await isPathIsDir(this.filePath)) {\n throw new FileError(HttpStatus.BAD_REQUEST, 'The location is a directory')\n }\n if (!(await isPathIsReadable(this.filePath))) {\n throw new FileError(HttpStatus.METHOD_NOT_ALLOWED, 'The location is not readable')\n }\n }\n\n async stream(req: FastifyRequest, res: FastifyReply): Promise<StreamableFile> {\n // SendStream manages HEAD (no including body in response) & GET request (with body)\n // Ranges, LastModified, Etag are also handled\n // Send function uses decodeURIComponent, but filePath is already decoded: we need to encode it again before passing it.\n const encodedFilePath = encodeURIComponent(this.filePath)\n this.fileName = encodeURIComponent(this.downloadName ? this.downloadName : fileName(this.filePath))\n const sendResult: SendResult = await send(req.raw, encodedFilePath, this.sendOptions)\n // Check if the path was correctly validated\n if (sendResult.metadata['path'] === undefined) {\n throw new FileError(HttpStatus.BAD_REQUEST, 'Location not found')\n }\n // Force file to be downloaded as an attachment\n sendResult.headers['content-disposition'] = makeContentDispositionAttachment(this.fileName)\n res.headers(sendResult.headers)\n res.status(sendResult.statusCode)\n // sendStream.once('stream', () => console.log(`Sending: ${this.fileName}`))\n // sendStream.once('end', () => console.log(`Received: ${this.fileName}`))\n // sendStream.once('error', (e: Error) => console.error(`Transfer error : ${this.fileName} - ${e}`))\n return new StreamableFile(sendResult.stream)\n }\n}\n"],"names":["SendFile","makeContentDispositionAttachment","fileName","downloadName","normalize","replace","checks","isPathExists","filePath","FileError","HttpStatus","NOT_FOUND","isPathIsDir","BAD_REQUEST","isPathIsReadable","METHOD_NOT_ALLOWED","stream","req","res","encodedFilePath","encodeURIComponent","sendResult","send","raw","sendOptions","metadata","undefined","headers","status","statusCode","StreamableFile","acceptRanges","etag","dotfiles","lastModified","cacheControl","maxAge","index","highWaterMark","DEFAULT_HIGH_WATER_MARK"],"mappings":";;;;;;;;;;;QAYaA;eAAAA;;QALGC;eAAAA;;;sBAP8B;wBACH;uBAEH;2BACd;wBAC4C;AAE/D,SAASA,iCAAiCC,QAAgB;IAC/D,MAAMC,eAAeD,SAASE,SAAS,CAAC,OAAOC,OAAO,CAAC,oBAAoB;IAC3E,OAAO,CAAC,sBAAsB,EAAEF,aAAa,mBAAmB,EAAED,UAAU;AAC9E;AAEO,IAAA,AAAMF,WAAN,MAAMA;IAkBX,MAAMM,SAAS;QACb,IAAI,CAAE,MAAMC,IAAAA,oBAAY,EAAC,IAAI,CAACC,QAAQ,GAAI;YACxC,MAAM,IAAIC,oBAAS,CAACC,kBAAU,CAACC,SAAS,EAAE;QAC5C;QACA,IAAI,MAAMC,IAAAA,mBAAW,EAAC,IAAI,CAACJ,QAAQ,GA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,cAAAA;IAUhB;AAkCL"}
@@ -1,8 +1,4 @@
1
- /*
2
- * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
3
- * This file is part of Sync-in | The open source file sync and share solution
4
- * See the LICENSE file for licensing details
5
- */ "use strict";
1
+ "use strict";
6
2
  Object.defineProperty(exports, "__esModule", {
7
3
  value: true
8
4
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../backend/src/applications/files/utils/unzip-file.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport fs from 'node:fs'\nimport path from 'node:path'\nimport { promisify } from 'node:util'\nimport { Entry, open as openZip, Options, ZipFile } from 'yauzl'\nimport { DEFAULT_HIGH_WATER_MARK } from '../constants/files'\nimport { makeDir } from './files'\n\nconst openZipAsync: (path: string, options: Options) => Promise<ZipFile> = promisify(openZip)\n\nexport async function extractZip(filePath: string, outputDir: string): Promise<void> {\n const zipFile = await openZipAsync(filePath, { lazyEntries: true })\n\n return new Promise((resolve, reject) => {\n zipFile.readEntry()\n\n zipFile.on('entry', async (entry: Entry) => {\n try {\n // make directory destination\n const fullPath = path.join(outputDir, entry.fileName)\n if (entry.fileName.endsWith('/')) {\n await makeDir(fullPath, true)\n zipFile.readEntry()\n } else {\n // make sure parent exists\n await makeDir(path.dirname(fullPath), true)\n const openReadStream = promisify(zipFile.openReadStream.bind(zipFile))\n const readStream = await openReadStream(entry)\n const writeStream = fs.createWriteStream(fullPath, { highWaterMark: DEFAULT_HIGH_WATER_MARK })\n\n readStream.on('end', () => zipFile.readEntry())\n readStream.pipe(writeStream)\n }\n } catch (err) {\n reject(err)\n }\n })\n\n zipFile.on('end', resolve)\n zipFile.on('error', reject)\n })\n}\n"],"names":["extractZip","openZipAsync","promisify","openZip","filePath","outputDir","zipFile","lazyEntries","Promise","resolve","reject","readEntry","on","entry","fullPath","path","join","fileName","endsWith","makeDir","dirname","openReadStream","bind","readStream","writeStream","fs","createWriteStream","highWaterMark","DEFAULT_HIGH_WATER_MARK","pipe","err"],"mappings":"AAAA;;;;CAIC;;;;+BAWqBA;;;eAAAA;;;+DATP;iEACE;0BACS;uBAC+B;uBACjB;wBAChB;;;;;;AAExB,MAAMC,eAAqEC,IAAAA,mBAAS,EAACC,WAAO;AAErF,eAAeH,WAAWI,QAAgB,EAAEC,SAAiB;IAClE,MAAMC,UAAU,MAAML,aAAaG,UAAU;QAAEG,aAAa;IAAK;IAEjE,OAAO,IAAIC,QAAQ,CAACC,SAASC;QAC3BJ,QAAQK,SAAS;QAEjBL,QAAQM,EAAE,CAAC,SAAS,OAAOC;YACzB,IAAI;gBACF,6BAA6B;gBAC7B,MAAMC,WAAWC,iBAAI,CAACC,IAAI,CAACX,WAAWQ,MAAMI,QAAQ;gBACpD,IAAIJ,MAAMI,QAAQ,CAACC,QAAQ,CAAC,MAAM;oBAChC,MAAMC,IAAAA,eAAO,EAACL,UAAU;oBACxBR,QAAQK,SAAS;gBACnB,OAAO;oBACL,0BAA0B;oBAC1B,MAAMQ,IAAAA,eAAO,EAACJ,iBAAI,CAACK,OAAO,CAACN,WAAW;oBACtC,MAAMO,iBAAiBnB,IAAAA,mBAAS,EAACI,QAAQe,cAAc,CAACC,IAAI,CAAChB;oBAC7D,MAAMiB,aAAa,MAAMF,eAAeR;oBACxC,MAAMW,cAAcC,eAAE,CAACC,iBAAiB,CAACZ,UAAU;wBAAEa,eAAeC,8BAAuB;oBAAC;oBAE5FL,WAAWX,EAAE,CAAC,OAAO,IAAMN,QAAQK,SAAS;oBAC5CY,WAAWM,IAAI,CAACL;gBAClB;YACF,EAAE,OAAOM,KAAK;gBACZpB,OAAOoB;YACT;QACF;QAEAxB,QAAQM,EAAE,CAAC,OAAOH;QAClBH,QAAQM,EAAE,CAAC,SAASF;IACtB;AACF"}
1
+ {"version":3,"sources":["../../../../../backend/src/applications/files/utils/unzip-file.ts"],"sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\nimport { promisify } from 'node:util'\nimport { Entry, open as openZip, Options, ZipFile } from 'yauzl'\nimport { DEFAULT_HIGH_WATER_MARK } from '../constants/files'\nimport { makeDir } from './files'\n\nconst openZipAsync: (path: string, options: Options) => Promise<ZipFile> = promisify(openZip)\n\nexport async function extractZip(filePath: string, outputDir: string): Promise<void> {\n const zipFile = await openZipAsync(filePath, { lazyEntries: true })\n\n return new Promise((resolve, reject) => {\n zipFile.readEntry()\n\n zipFile.on('entry', async (entry: Entry) => {\n try {\n // make directory destination\n const fullPath = path.join(outputDir, entry.fileName)\n if (entry.fileName.endsWith('/')) {\n await makeDir(fullPath, true)\n zipFile.readEntry()\n } else {\n // make sure parent exists\n await makeDir(path.dirname(fullPath), true)\n const openReadStream = promisify(zipFile.openReadStream.bind(zipFile))\n const readStream = await openReadStream(entry)\n const writeStream = fs.createWriteStream(fullPath, { highWaterMark: DEFAULT_HIGH_WATER_MARK })\n\n readStream.on('end', () => zipFile.readEntry())\n readStream.pipe(writeStream)\n }\n } catch (err) {\n reject(err)\n }\n })\n\n zipFile.on('end', resolve)\n zipFile.on('error', reject)\n })\n}\n"],"names":["extractZip","openZipAsync","promisify","openZip","filePath","outputDir","zipFile","lazyEntries","Promise","resolve","reject","readEntry","on","entry","fullPath","path","join","fileName","endsWith","makeDir","dirname","openReadStream","bind","readStream","writeStream","fs","createWriteStream","highWaterMark","DEFAULT_HIGH_WATER_MARK","pipe","err"],"mappings":";;;;+BASsBA;;;eAAAA;;;+DATP;iEACE;0BACS;uBAC+B;uBACjB;wBAChB;;;;;;AAExB,MAAMC,eAAqEC,IAAAA,mBAAS,EAACC,WAAO;AAErF,eAAeH,WAAWI,QAAgB,EAAEC,SAAiB;IAClE,MAAMC,UAAU,MAAML,aAAaG,UAAU;QAAEG,aAAa;IAAK;IAEjE,OAAO,IAAIC,QAAQ,CAACC,SAASC;QAC3BJ,QAAQK,SAAS;QAEjBL,QAAQM,EAAE,CAAC,SAAS,OAAOC;YACzB,IAAI;gBACF,6BAA6B;gBAC7B,MAAMC,WAAWC,iBAAI,CAACC,IAAI,CAACX,WAAWQ,MAAMI,QAAQ;gBACpD,IAAIJ,MAAMI,QAAQ,CAACC,QAAQ,CAAC,MAAM;oBAChC,MAAMC,IAAAA,eAAO,EAACL,UAAU;oBACxBR,QAAQK,SAAS;gBACnB,OAAO;oBACL,0BAA0B;oBAC1B,MAAMQ,IAAAA,eAAO,EAACJ,iBAAI,CAACK,OAAO,CAACN,WAAW;oBACtC,MAAMO,iBAAiBnB,IAAAA,mBAAS,EAACI,QAAQe,cAAc,CAACC,IAAI,CAAChB;oBAC7D,MAAMiB,aAAa,MAAMF,eAAeR;oBACxC,MAAMW,cAAcC,eAAE,CAACC,iBAAiB,CAACZ,UAAU;wBAAEa,eAAeC,8BAAuB;oBAAC;oBAE5FL,WAAWX,EAAE,CAAC,OAAO,IAAMN,QAAQK,SAAS;oBAC5CY,WAAWM,IAAI,CAACL;gBAClB;YACF,EAAE,OAAOM,KAAK;gBACZpB,OAAOoB;YACT;QACF;QAEAxB,QAAQM,EAAE,CAAC,OAAOH;QAClBH,QAAQM,EAAE,CAAC,SAASF;IACtB;AACF"}
@@ -8,11 +8,7 @@ Object.defineProperty(exports, "regExpPrivateIP", {
8
8
  return regExpPrivateIP;
9
9
  }
10
10
  });
11
- /*
12
- * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
13
- * This file is part of Sync-in | The open source file sync and share solution
14
- * See the LICENSE file for licensing details
15
- */ const parts = [
11
+ const parts = [
16
12
  // IPv4 loopback (127.0.0.0/8)
17
13
  '127\\.(?:\\d{1,3}\\.){2}\\d{1,3}',
18
14
  // IPv4 link-local (169.254.0.0/16)
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../backend/src/applications/files/utils/url-file.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nconst parts = [\n // IPv4 loopback (127.0.0.0/8)\n '127\\\\.(?:\\\\d{1,3}\\\\.){2}\\\\d{1,3}',\n // IPv4 link-local (169.254.0.0/16)\n '169\\\\.254\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}',\n // IPv4 Carrier-grade NAT (100.64.0.0/10)\n '100\\\\.(?:6[4-9]|[7-9]\\\\d|1[01]\\\\d|12[0-7])\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}',\n // IPv4 private (10.0.0.0/8)\n '10\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}',\n // IPv4 private (192.168.0.0/16)\n '192\\\\.168\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}',\n // IPv4 private (172.16.0.0/12)\n '172\\\\.(?:1[6-9]|2\\\\d|3[0-1])\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}',\n // IPv4 & IPv6 loopback\n '::1',\n '::',\n '0.0.0.0',\n // IPv6 Unique Local Address (fc00::/7)\n 'f[cd][0-9a-f]{2}:[0-9a-f:]+',\n // IPv6 link-local (fe80::/10)\n 'fe[89ab][0-9a-f]{2}:[0-9a-f:]+'\n]\n\nexport const regExpPrivateIP = new RegExp(`^(?:${parts.join('|')})$`, 'i')\n"],"names":["regExpPrivateIP","parts","RegExp","join"],"mappings":";;;;+BA6BaA;;;eAAAA;;;AA7Bb;;;;CAIC,GAED,MAAMC,QAAQ;IACZ,8BAA8B;IAC9B;IACA,mCAAmC;IACnC;IACA,yCAAyC;IACzC;IACA,4BAA4B;IAC5B;IACA,gCAAgC;IAChC;IACA,+BAA+B;IAC/B;IACA,uBAAuB;IACvB;IACA;IACA;IACA,uCAAuC;IACvC;IACA,8BAA8B;IAC9B;CACD;AAEM,MAAMD,kBAAkB,IAAIE,OAAO,CAAC,IAAI,EAAED,MAAME,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE"}
1
+ {"version":3,"sources":["../../../../../backend/src/applications/files/utils/url-file.ts"],"sourcesContent":["const parts = [\n // IPv4 loopback (127.0.0.0/8)\n '127\\\\.(?:\\\\d{1,3}\\\\.){2}\\\\d{1,3}',\n // IPv4 link-local (169.254.0.0/16)\n '169\\\\.254\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}',\n // IPv4 Carrier-grade NAT (100.64.0.0/10)\n '100\\\\.(?:6[4-9]|[7-9]\\\\d|1[01]\\\\d|12[0-7])\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}',\n // IPv4 private (10.0.0.0/8)\n '10\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}',\n // IPv4 private (192.168.0.0/16)\n '192\\\\.168\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}',\n // IPv4 private (172.16.0.0/12)\n '172\\\\.(?:1[6-9]|2\\\\d|3[0-1])\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}',\n // IPv4 & IPv6 loopback\n '::1',\n '::',\n '0.0.0.0',\n // IPv6 Unique Local Address (fc00::/7)\n 'f[cd][0-9a-f]{2}:[0-9a-f:]+',\n // IPv6 link-local (fe80::/10)\n 'fe[89ab][0-9a-f]{2}:[0-9a-f:]+'\n]\n\nexport const regExpPrivateIP = new RegExp(`^(?:${parts.join('|')})$`, 'i')\n"],"names":["regExpPrivateIP","parts","RegExp","join"],"mappings":";;;;+BAuBaA;;;eAAAA;;;AAvBb,MAAMC,QAAQ;IACZ,8BAA8B;IAC9B;IACA,mCAAmC;IACnC;IACA,yCAAyC;IACzC;IACA,4BAA4B;IAC5B;IACA,gCAAgC;IAChC;IACA,+BAA+B;IAC/B;IACA,uBAAuB;IACvB;IACA;IACA;IACA,uCAAuC;IACvC;IACA,8BAA8B;IAC9B;CACD;AAEM,MAAMD,kBAAkB,IAAIE,OAAO,CAAC,IAAI,EAAED,MAAME,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE"}
@@ -1,8 +1,4 @@
1
- /*
2
- * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
3
- * This file is part of Sync-in | The open source file sync and share solution
4
- * See the LICENSE file for licensing details
5
- */ // cache link key = `link-uuid-${userId}-${uuid}` => ${uuid}
1
+ // cache link key = `link-uuid-${userId}-${uuid}` => ${uuid}
6
2
  "use strict";
7
3
  Object.defineProperty(exports, "__esModule", {
8
4
  value: true
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../backend/src/applications/links/constants/cache.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\n// cache link key = `link-uuid-${userId}-${uuid}` => ${uuid}\nexport const CACHE_LINK_UUID_PREFIX = 'link-uuid'\nexport const CACHE_LINK_UUID_TTL = 900 // 15 minutes\n"],"names":["CACHE_LINK_UUID_PREFIX","CACHE_LINK_UUID_TTL"],"mappings":"AAAA;;;;CAIC,GAED,4DAA4D;;;;;;;;;;;;QAC/CA;eAAAA;;QACAC;eAAAA;;;AADN,MAAMD,yBAAyB;AAC/B,MAAMC,sBAAsB,IAAI,aAAa"}
1
+ {"version":3,"sources":["../../../../../backend/src/applications/links/constants/cache.ts"],"sourcesContent":["// cache link key = `link-uuid-${userId}-${uuid}` => ${uuid}\nexport const CACHE_LINK_UUID_PREFIX = 'link-uuid'\nexport const CACHE_LINK_UUID_TTL = 900 // 15 minutes\n"],"names":["CACHE_LINK_UUID_PREFIX","CACHE_LINK_UUID_TTL"],"mappings":"AAAA,4DAA4D;;;;;;;;;;;;QAC/CA;eAAAA;;QACAC;eAAAA;;;AADN,MAAMD,yBAAyB;AAC/B,MAAMC,sBAAsB,IAAI,aAAa"}
@@ -1,8 +1,4 @@
1
- /*
2
- * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
3
- * This file is part of Sync-in | The open source file sync and share solution
4
- * See the LICENSE file for licensing details
5
- */ "use strict";
1
+ "use strict";
6
2
  Object.defineProperty(exports, "__esModule", {
7
3
  value: true
8
4
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../backend/src/applications/links/constants/links.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nexport const LINK_ERROR = {\n UNAUTHORIZED: 'unauthorized',\n DISABLED: 'disabled',\n EXCEEDED: 'exceeded',\n EXPIRED: 'expired',\n NOT_FOUND: 'not found'\n} as const\n\nexport enum LINK_TYPE {\n SPACE = 'space',\n SHARE = 'share'\n}\n"],"names":["LINK_ERROR","LINK_TYPE","UNAUTHORIZED","DISABLED","EXCEEDED","EXPIRED","NOT_FOUND"],"mappings":"AAAA;;;;CAIC;;;;;;;;;;;QAEYA;eAAAA;;QAQDC;eAAAA;;;AARL,MAAMD,aAAa;IACxBE,cAAc;IACdC,UAAU;IACVC,UAAU;IACVC,SAAS;IACTC,WAAW;AACb;AAEO,IAAA,AAAKL,mCAAAA;;;WAAAA"}
1
+ {"version":3,"sources":["../../../../../backend/src/applications/links/constants/links.ts"],"sourcesContent":["export const LINK_ERROR = {\n UNAUTHORIZED: 'unauthorized',\n DISABLED: 'disabled',\n EXCEEDED: 'exceeded',\n EXPIRED: 'expired',\n NOT_FOUND: 'not found'\n} as const\n\nexport enum LINK_TYPE {\n SPACE = 'space',\n SHARE = 'share'\n}\n"],"names":["LINK_ERROR","LINK_TYPE","UNAUTHORIZED","DISABLED","EXCEEDED","EXPIRED","NOT_FOUND"],"mappings":";;;;;;;;;;;QAAaA;eAAAA;;QAQDC;eAAAA;;;AARL,MAAMD,aAAa;IACxBE,cAAc;IACdC,UAAU;IACVC,UAAU;IACVC,SAAS;IACTC,WAAW;AACb;AAEO,IAAA,AAAKL,mCAAAA;;;WAAAA"}
@@ -1,8 +1,4 @@
1
- /*
2
- * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
3
- * This file is part of Sync-in | The open source file sync and share solution
4
- * See the LICENSE file for licensing details
5
- */ "use strict";
1
+ "use strict";
6
2
  Object.defineProperty(exports, "__esModule", {
7
3
  value: true
8
4
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../backend/src/applications/links/constants/routes.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport { APP_BASE_ROUTE } from '../../applications.constants'\n\nexport const PUBLIC_LINKS_ROUTE = {\n BASE: `${APP_BASE_ROUTE}/link`,\n LINK: 'link',\n VALIDATION: 'validation',\n ACCESS: 'access',\n DOWNLOAD: 'download',\n AUTH: 'auth'\n}\n\nexport const API_PUBLIC_LINK_VALIDATION = `${PUBLIC_LINKS_ROUTE.BASE}/${PUBLIC_LINKS_ROUTE.VALIDATION}`\nexport const API_PUBLIC_LINK_ACCESS = `${PUBLIC_LINKS_ROUTE.BASE}/${PUBLIC_LINKS_ROUTE.ACCESS}`\nexport const API_PUBLIC_LINK_DOWNLOAD = `${PUBLIC_LINKS_ROUTE.BASE}/${PUBLIC_LINKS_ROUTE.DOWNLOAD}`\nexport const API_PUBLIC_LINK_AUTH = `${PUBLIC_LINKS_ROUTE.BASE}/${PUBLIC_LINKS_ROUTE.AUTH}`\n"],"names":["API_PUBLIC_LINK_ACCESS","API_PUBLIC_LINK_AUTH","API_PUBLIC_LINK_DOWNLOAD","API_PUBLIC_LINK_VALIDATION","PUBLIC_LINKS_ROUTE","BASE","APP_BASE_ROUTE","LINK","VALIDATION","ACCESS","DOWNLOAD","AUTH"],"mappings":"AAAA;;;;CAIC;;;;;;;;;;;QAcYA;eAAAA;;QAEAC;eAAAA;;QADAC;eAAAA;;QAFAC;eAAAA;;QATAC;eAAAA;;;uCAFkB;AAExB,MAAMA,qBAAqB;IAChCC,MAAM,GAAGC,qCAAc,CAAC,KAAK,CAAC;IAC9BC,MAAM;IACNC,YAAY;IACZC,QAAQ;IACRC,UAAU;IACVC,MAAM;AACR;AAEO,MAAMR,6BAA6B,GAAGC,mBAAmBC,IAAI,CAAC,CAAC,EAAED,mBAAmBI,UAAU,EAAE;AAChG,MAAMR,yBAAyB,GAAGI,mBAAmBC,IAAI,CAAC,CAAC,EAAED,mBAAmBK,MAAM,EAAE;AACxF,MAAMP,2BAA2B,GAAGE,mBAAmBC,IAAI,CAAC,CAAC,EAAED,mBAAmBM,QAAQ,EAAE;AAC5F,MAAMT,uBAAuB,GAAGG,mBAAmBC,IAAI,CAAC,CAAC,EAAED,mBAAmBO,IAAI,EAAE"}
1
+ {"version":3,"sources":["../../../../../backend/src/applications/links/constants/routes.ts"],"sourcesContent":["import { APP_BASE_ROUTE } from '../../applications.constants'\n\nexport const PUBLIC_LINKS_ROUTE = {\n BASE: `${APP_BASE_ROUTE}/link`,\n LINK: 'link',\n VALIDATION: 'validation',\n ACCESS: 'access',\n DOWNLOAD: 'download',\n AUTH: 'auth'\n}\n\nexport const API_PUBLIC_LINK_VALIDATION = `${PUBLIC_LINKS_ROUTE.BASE}/${PUBLIC_LINKS_ROUTE.VALIDATION}`\nexport const API_PUBLIC_LINK_ACCESS = `${PUBLIC_LINKS_ROUTE.BASE}/${PUBLIC_LINKS_ROUTE.ACCESS}`\nexport const API_PUBLIC_LINK_DOWNLOAD = `${PUBLIC_LINKS_ROUTE.BASE}/${PUBLIC_LINKS_ROUTE.DOWNLOAD}`\nexport const API_PUBLIC_LINK_AUTH = `${PUBLIC_LINKS_ROUTE.BASE}/${PUBLIC_LINKS_ROUTE.AUTH}`\n"],"names":["API_PUBLIC_LINK_ACCESS","API_PUBLIC_LINK_AUTH","API_PUBLIC_LINK_DOWNLOAD","API_PUBLIC_LINK_VALIDATION","PUBLIC_LINKS_ROUTE","BASE","APP_BASE_ROUTE","LINK","VALIDATION","ACCESS","DOWNLOAD","AUTH"],"mappings":";;;;;;;;;;;QAYaA;eAAAA;;QAEAC;eAAAA;;QADAC;eAAAA;;QAFAC;eAAAA;;QATAC;eAAAA;;;uCAFkB;AAExB,MAAMA,qBAAqB;IAChCC,MAAM,GAAGC,qCAAc,CAAC,KAAK,CAAC;IAC9BC,MAAM;IACNC,YAAY;IACZC,QAAQ;IACRC,UAAU;IACVC,MAAM;AACR;AAEO,MAAMR,6BAA6B,GAAGC,mBAAmBC,IAAI,CAAC,CAAC,EAAED,mBAAmBI,UAAU,EAAE;AAChG,MAAMR,yBAAyB,GAAGI,mBAAmBC,IAAI,CAAC,CAAC,EAAED,mBAAmBK,MAAM,EAAE;AACxF,MAAMP,2BAA2B,GAAGE,mBAAmBC,IAAI,CAAC,CAAC,EAAED,mBAAmBM,QAAQ,EAAE;AAC5F,MAAMT,uBAAuB,GAAGG,mBAAmBC,IAAI,CAAC,CAAC,EAAED,mBAAmBO,IAAI,EAAE"}
@@ -1,8 +1,4 @@
1
- /*
2
- * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
3
- * This file is part of Sync-in | The open source file sync and share solution
4
- * See the LICENSE file for licensing details
5
- */ "use strict";
1
+ "use strict";
6
2
  Object.defineProperty(exports, "__esModule", {
7
3
  value: true
8
4
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../backend/src/applications/links/dto/create-or-update-link.dto.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport { Transform } from 'class-transformer'\nimport { IsBoolean, IsDate, IsOptional, IsString, MinLength } from 'class-validator'\nimport { currentDate } from '../../../common/shared'\nimport { USER_PASSWORD_MIN_LENGTH } from '../../users/constants/user'\n\nexport class CreateOrUpdateLinkDto {\n @IsOptional()\n @IsString()\n uuid?: string\n\n @IsOptional()\n @IsString()\n name?: string\n\n @IsOptional()\n @IsString()\n email?: string\n\n @IsOptional()\n @IsString()\n language?: string\n\n @IsOptional()\n @Transform(({ value }) => value || 0)\n limitAccess?: number\n\n @IsOptional()\n @Transform(({ value }) => (value ? currentDate(value) : null))\n @IsDate()\n expiresAt?: Date\n\n @IsOptional()\n @Transform(({ value }) => !!value)\n @IsBoolean()\n requireAuth?: boolean\n\n @IsOptional()\n @Transform(({ value }) => !!value)\n @IsBoolean()\n isActive?: boolean\n\n @IsOptional()\n @IsString()\n permissions?: string\n\n @IsOptional()\n @IsString()\n @MinLength(USER_PASSWORD_MIN_LENGTH)\n password?: string\n\n // used for update link from links component\n @IsOptional()\n @IsString()\n shareName?: string\n\n // used for update link from links component\n @IsOptional()\n @IsString()\n shareDescription?: string\n}\n"],"names":["CreateOrUpdateLinkDto","value","currentDate"],"mappings":"AAAA;;;;CAIC;;;;+BAOYA;;;eAAAA;;;kCALa;gCACyC;wBACvC;sBACa;;;;;;;;;;AAElC,IAAA,AAAMA,wBAAN,MAAMA;AAsDb;;;;;;;;;;;;;;;;;;;;;;;sCApCc,EAAEC,KAAK,EAAE,GAAKA,SAAS;;;;;sCAIvB,EAAEA,KAAK,EAAE,GAAMA,QAAQC,IAAAA,mBAAW,EAACD,SAAS;;;;;;sCAK5C,EAAEA,KAAK,EAAE,GAAK,CAAC,CAACA;;;;;;sCAKhB,EAAEA,KAAK,EAAE,GAAK,CAAC,CAACA"}
1
+ {"version":3,"sources":["../../../../../backend/src/applications/links/dto/create-or-update-link.dto.ts"],"sourcesContent":["import { Transform } from 'class-transformer'\nimport { IsBoolean, IsDate, IsOptional, IsString, MinLength } from 'class-validator'\nimport { currentDate } from '../../../common/shared'\nimport { USER_PASSWORD_MIN_LENGTH } from '../../users/constants/user'\n\nexport class CreateOrUpdateLinkDto {\n @IsOptional()\n @IsString()\n uuid?: string\n\n @IsOptional()\n @IsString()\n name?: string\n\n @IsOptional()\n @IsString()\n email?: string\n\n @IsOptional()\n @IsString()\n language?: string\n\n @IsOptional()\n @Transform(({ value }) => value || 0)\n limitAccess?: number\n\n @IsOptional()\n @Transform(({ value }) => (value ? currentDate(value) : null))\n @IsDate()\n expiresAt?: Date\n\n @IsOptional()\n @Transform(({ value }) => !!value)\n @IsBoolean()\n requireAuth?: boolean\n\n @IsOptional()\n @Transform(({ value }) => !!value)\n @IsBoolean()\n isActive?: boolean\n\n @IsOptional()\n @IsString()\n permissions?: string\n\n @IsOptional()\n @IsString()\n @MinLength(USER_PASSWORD_MIN_LENGTH)\n password?: string\n\n // used for update link from links component\n @IsOptional()\n @IsString()\n shareName?: string\n\n // used for update link from links component\n @IsOptional()\n @IsString()\n shareDescription?: string\n}\n"],"names":["CreateOrUpdateLinkDto","value","currentDate"],"mappings":";;;;+BAKaA;;;eAAAA;;;kCALa;gCACyC;wBACvC;sBACa;;;;;;;;;;AAElC,IAAA,AAAMA,wBAAN,MAAMA;AAsDb;;;;;;;;;;;;;;;;;;;;;;;sCApCc,EAAEC,KAAK,EAAE,GAAKA,SAAS;;;;;sCAIvB,EAAEA,KAAK,EAAE,GAAMA,QAAQC,IAAAA,mBAAW,EAACD,SAAS;;;;;;sCAK5C,EAAEA,KAAK,EAAE,GAAK,CAAC,CAACA;;;;;;sCAKhB,EAAEA,KAAK,EAAE,GAAK,CAAC,CAACA"}
@@ -1,8 +1,4 @@
1
- /*
2
- * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
3
- * This file is part of Sync-in | The open source file sync and share solution
4
- * See the LICENSE file for licensing details
5
- */ "use strict";
1
+ "use strict";
6
2
  Object.defineProperty(exports, "__esModule", {
7
3
  value: true
8
4
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../backend/src/applications/links/interfaces/link-guest.interface.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport type { ShareMembers } from '../../shares/schemas/share-members.interface'\nimport type { User } from '../../users/schemas/user.interface'\nimport type { Link } from '../schemas/link.interface'\n\nexport type LinkGuest = Link &\n Pick<User, 'language' | 'isActive' | 'currentIp' | 'lastIp' | 'currentAccess' | 'lastAccess' | 'createdAt'> &\n Pick<ShareMembers, 'permissions'>\n\nexport type LinkAsUser = Link & { user: Omit<User, 'password'> }\n"],"names":[],"mappings":"AAAA;;;;CAIC"}
1
+ {"version":3,"sources":["../../../../../backend/src/applications/links/interfaces/link-guest.interface.ts"],"names":[],"mappings":""}
@@ -1,8 +1,4 @@
1
- /*
2
- * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
3
- * This file is part of Sync-in | The open source file sync and share solution
4
- * See the LICENSE file for licensing details
5
- */ "use strict";
1
+ "use strict";
6
2
  Object.defineProperty(exports, "__esModule", {
7
3
  value: true
8
4
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../backend/src/applications/links/interfaces/link-space.interface.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport type { FileEditorProvider } from '../../../configuration/config.interfaces'\n\nexport interface SpaceLink {\n share?: {\n name: string\n alias: string\n hasParent: boolean\n isDir: boolean\n mtime: number\n mime: string\n size: number\n permissions: string\n } | null\n space?: { name: string; alias: string } | null\n owner?: { login?: string; fullName: string; avatar?: string } | null\n fileEditors?: FileEditorProvider\n}\n"],"names":[],"mappings":"AAAA;;;;CAIC"}
1
+ {"version":3,"sources":["../../../../../backend/src/applications/links/interfaces/link-space.interface.ts"],"names":[],"mappings":""}
@@ -1,8 +1,4 @@
1
- /*
2
- * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
3
- * This file is part of Sync-in | The open source file sync and share solution
4
- * See the LICENSE file for licensing details
5
- */ "use strict";
1
+ "use strict";
6
2
  Object.defineProperty(exports, "__esModule", {
7
3
  value: true
8
4
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../backend/src/applications/links/links.controller.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport { Body, Controller, Get, Param, Post, Req, Res, StreamableFile } from '@nestjs/common'\nimport { FastifyReply, FastifyRequest } from 'fastify'\nimport { AuthTokenOptional } from '../../authentication/decorators/auth-token-optional.decorator'\nimport { LoginResponseDto } from '../../authentication/dto/login-response.dto'\nimport { GetUser } from '../users/decorators/user.decorator'\nimport { UserPasswordDto } from '../users/dto/user-properties.dto'\nimport { UserModel } from '../users/models/user.model'\nimport { PUBLIC_LINKS_ROUTE } from './constants/routes'\nimport { SpaceLink } from './interfaces/link-space.interface'\nimport { LinksManager } from './services/links-manager.service'\n\n@Controller(PUBLIC_LINKS_ROUTE.BASE)\n@AuthTokenOptional()\nexport class LinksController {\n constructor(private readonly linksManager: LinksManager) {}\n\n @Get(`${PUBLIC_LINKS_ROUTE.VALIDATION}/:uuid`)\n linkValidation(\n @GetUser() user: UserModel,\n @Param('uuid') uuid: string\n ): Promise<{\n error: string | true\n ok: boolean\n link: SpaceLink\n }> {\n return this.linksManager.linkValidation(user, uuid)\n }\n\n @Get(`${PUBLIC_LINKS_ROUTE.ACCESS}/:uuid`)\n linkAccess(\n @GetUser() user: UserModel,\n @Param('uuid') uuid: string,\n @Req() req: FastifyRequest,\n @Res({ passthrough: true }) res: FastifyReply\n ): Promise<LoginResponseDto | Omit<LoginResponseDto, 'token'>> {\n return this.linksManager.linkAccess(user, uuid, req, res)\n }\n\n @Get(`${PUBLIC_LINKS_ROUTE.DOWNLOAD}/:uuid`)\n linkDownload(\n @GetUser() user: UserModel,\n @Param('uuid') uuid: string,\n @Req() req: FastifyRequest,\n @Res({ passthrough: true }) res: FastifyReply\n ): Promise<StreamableFile> {\n return this.linksManager.linkDownload(user, uuid, req, res)\n }\n\n @Post(`${PUBLIC_LINKS_ROUTE.AUTH}/:uuid`)\n linkAuthentication(\n @GetUser() user: UserModel,\n @Param('uuid') uuid: string,\n @Body() linkPasswordDto: UserPasswordDto,\n @Req() req: FastifyRequest,\n @Res({ passthrough: true }) res: FastifyReply\n ): Promise<LoginResponseDto> {\n return this.linksManager.linkAuthentication(user, uuid, linkPasswordDto, req, res)\n }\n}\n"],"names":["LinksController","linkValidation","user","uuid","linksManager","linkAccess","req","res","linkDownload","linkAuthentication","linkPasswordDto","PUBLIC_LINKS_ROUTE","VALIDATION","ACCESS","passthrough","DOWNLOAD","AUTH","BASE"],"mappings":"AAAA;;;;CAIC;;;;+BAeYA;;;eAAAA;;;wBAbgE;yBAChC;4CACX;+BAEV;mCACQ;2BACN;wBACS;qCAEN;;;;;;;;;;;;;;;AAItB,IAAA,AAAMA,kBAAN,MAAMA;IAIXC,eACE,AAAWC,IAAe,EAC1B,AAAeC,IAAY,EAK1B;QACD,OAAO,IAAI,CAACC,YAAY,CAACH,cAAc,CAACC,MAAMC;IAChD;IAGAE,WACE,AAAWH,IAAe,EAC1B,AAAeC,IAAY,EAC3B,AAAOG,GAAmB,EAC1B,AAA4BC,GAAiB,EACgB;QAC7D,OAAO,IAAI,CAACH,YAAY,CAACC,UAAU,CAACH,MAAMC,MAAMG,KAAKC;IACvD;IAGAC,aACE,AAAWN,IAAe,EAC1B,AAAeC,IAAY,EAC3B,AAAOG,GAAmB,EAC1B,AAA4BC,GAAiB,EACpB;QACzB,OAAO,IAAI,CAACH,YAAY,CAACI,YAAY,CAACN,MAAMC,MAAMG,KAAKC;IACzD;IAGAE,mBACE,AAAWP,IAAe,EAC1B,AAAeC,IAAY,EAC3B,AAAQO,eAAgC,EACxC,AAAOJ,GAAmB,EAC1B,AAA4BC,GAAiB,EAClB;QAC3B,OAAO,IAAI,CAACH,YAAY,CAACK,kBAAkB,CAACP,MAAMC,MAAMO,iBAAiBJ,KAAKC;IAChF;IA3CA,YAAY,AAAiBH,YAA0B,CAAE;aAA5BA,eAAAA;IAA6B;AA4C5D;;wBA1CUO,0BAAkB,CAACC,UAAU,CAAC,MAAM;;;;;;;;;;;wBAYpCD,0BAAkB,CAACE,MAAM,CAAC,MAAM;;;;;QAK/BC,aAAa;;;;;;;;;;;;wBAKdH,0BAAkB,CAACI,QAAQ,CAAC,MAAM;;;;;QAKjCD,aAAa;;;;;;;;;;;;yBAKbH,0BAAkB,CAACK,IAAI,CAAC,MAAM;;;;;;QAM9BF,aAAa;;;;;;;;;;;;;uDA3COG"}
1
+ {"version":3,"sources":["../../../../backend/src/applications/links/links.controller.ts"],"sourcesContent":["import { Body, Controller, Get, Param, Post, Req, Res, StreamableFile } from '@nestjs/common'\nimport { FastifyReply, FastifyRequest } from 'fastify'\nimport { AuthTokenOptional } from '../../authentication/decorators/auth-token-optional.decorator'\nimport { LoginResponseDto } from '../../authentication/dto/login-response.dto'\nimport { GetUser } from '../users/decorators/user.decorator'\nimport { UserPasswordDto } from '../users/dto/user-properties.dto'\nimport { UserModel } from '../users/models/user.model'\nimport { PUBLIC_LINKS_ROUTE } from './constants/routes'\nimport { SpaceLink } from './interfaces/link-space.interface'\nimport { LinksManager } from './services/links-manager.service'\n\n@Controller(PUBLIC_LINKS_ROUTE.BASE)\n@AuthTokenOptional()\nexport class LinksController {\n constructor(private readonly linksManager: LinksManager) {}\n\n @Get(`${PUBLIC_LINKS_ROUTE.VALIDATION}/:uuid`)\n linkValidation(\n @GetUser() user: UserModel,\n @Param('uuid') uuid: string\n ): Promise<{\n error: string | true\n ok: boolean\n link: SpaceLink\n }> {\n return this.linksManager.linkValidation(user, uuid)\n }\n\n @Get(`${PUBLIC_LINKS_ROUTE.ACCESS}/:uuid`)\n linkAccess(\n @GetUser() user: UserModel,\n @Param('uuid') uuid: string,\n @Req() req: FastifyRequest,\n @Res({ passthrough: true }) res: FastifyReply\n ): Promise<LoginResponseDto | Omit<LoginResponseDto, 'token'>> {\n return this.linksManager.linkAccess(user, uuid, req, res)\n }\n\n @Get(`${PUBLIC_LINKS_ROUTE.DOWNLOAD}/:uuid`)\n linkDownload(\n @GetUser() user: UserModel,\n @Param('uuid') uuid: string,\n @Req() req: FastifyRequest,\n @Res({ passthrough: true }) res: FastifyReply\n ): Promise<StreamableFile> {\n return this.linksManager.linkDownload(user, uuid, req, res)\n }\n\n @Post(`${PUBLIC_LINKS_ROUTE.AUTH}/:uuid`)\n linkAuthentication(\n @GetUser() user: UserModel,\n @Param('uuid') uuid: string,\n @Body() linkPasswordDto: UserPasswordDto,\n @Req() req: FastifyRequest,\n @Res({ passthrough: true }) res: FastifyReply\n ): Promise<LoginResponseDto> {\n return this.linksManager.linkAuthentication(user, uuid, linkPasswordDto, req, res)\n }\n}\n"],"names":["LinksController","linkValidation","user","uuid","linksManager","linkAccess","req","res","linkDownload","linkAuthentication","linkPasswordDto","PUBLIC_LINKS_ROUTE","VALIDATION","ACCESS","passthrough","DOWNLOAD","AUTH","BASE"],"mappings":";;;;+BAaaA;;;eAAAA;;;wBAbgE;yBAChC;4CACX;+BAEV;mCACQ;2BACN;wBACS;qCAEN;;;;;;;;;;;;;;;AAItB,IAAA,AAAMA,kBAAN,MAAMA;IAIXC,eACE,AAAWC,IAAe,EAC1B,AAAeC,IAAY,EAK1B;QACD,OAAO,IAAI,CAACC,YAAY,CAACH,cAAc,CAACC,MAAMC;IAChD;IAGAE,WACE,AAAWH,IAAe,EAC1B,AAAeC,IAAY,EAC3B,AAAOG,GAAmB,EAC1B,AAA4BC,GAAiB,EACgB;QAC7D,OAAO,IAAI,CAACH,YAAY,CAACC,UAAU,CAACH,MAAMC,MAAMG,KAAKC;IACvD;IAGAC,aACE,AAAWN,IAAe,EAC1B,AAAeC,IAAY,EAC3B,AAAOG,GAAmB,EAC1B,AAA4BC,GAAiB,EACpB;QACzB,OAAO,IAAI,CAACH,YAAY,CAACI,YAAY,CAACN,MAAMC,MAAMG,KAAKC;IACzD;IAGAE,mBACE,AAAWP,IAAe,EAC1B,AAAeC,IAAY,EAC3B,AAAQO,eAAgC,EACxC,AAAOJ,GAAmB,EAC1B,AAA4BC,GAAiB,EAClB;QAC3B,OAAO,IAAI,CAACH,YAAY,CAACK,kBAAkB,CAACP,MAAMC,MAAMO,iBAAiBJ,KAAKC;IAChF;IA3CA,YAAY,AAAiBH,YAA0B,CAAE;aAA5BA,eAAAA;IAA6B;AA4C5D;;wBA1CUO,0BAAkB,CAACC,UAAU,CAAC,MAAM;;;;;;;;;;;wBAYpCD,0BAAkB,CAACE,MAAM,CAAC,MAAM;;;;;QAK/BC,aAAa;;;;;;;;;;;;wBAKdH,0BAAkB,CAACI,QAAQ,CAAC,MAAM;;;;;QAKjCD,aAAa;;;;;;;;;;;;yBAKbH,0BAAkB,CAACK,IAAI,CAAC,MAAM;;;;;;QAM9BF,aAAa;;;;;;;;;;;;;uDA3COG"}
@@ -1,8 +1,4 @@
1
- /*
2
- * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
3
- * This file is part of Sync-in | The open source file sync and share solution
4
- * See the LICENSE file for licensing details
5
- */ "use strict";
1
+ "use strict";
6
2
  Object.defineProperty(exports, "__esModule", {
7
3
  value: true
8
4
  });