@sync-in/server 1.11.0 → 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.
- package/CHANGELOG.md +37 -0
- package/LICENSE +1 -1
- package/README.md +3 -11
- package/environment/environment.dist.min.yaml +1 -1
- package/environment/environment.dist.yaml +173 -28
- package/package.json +17 -16
- package/server/app.bootstrap.js +1 -5
- package/server/app.bootstrap.js.map +1 -1
- package/server/app.constants.js +1 -5
- package/server/app.constants.js.map +1 -1
- package/server/app.e2e-spec.js +1 -5
- package/server/app.e2e-spec.js.map +1 -1
- package/server/app.functions.js +1 -5
- package/server/app.functions.js.map +1 -1
- package/server/app.module.js +1 -5
- package/server/app.module.js.map +1 -1
- package/server/app.service.js +1 -5
- package/server/app.service.js.map +1 -1
- package/server/app.service.spec.js +2 -6
- package/server/app.service.spec.js.map +1 -1
- package/server/applications/admin/admin.module.js +1 -5
- package/server/applications/admin/admin.module.js.map +1 -1
- package/server/applications/admin/constants/routes.js +1 -5
- package/server/applications/admin/constants/routes.js.map +1 -1
- package/server/applications/admin/interfaces/check-update.interfaces.js +1 -5
- package/server/applications/admin/interfaces/check-update.interfaces.js.map +1 -1
- package/server/applications/admin/services/admin-scheduler.service.js +1 -5
- package/server/applications/admin/services/admin-scheduler.service.js.map +1 -1
- package/server/applications/admin/services/admin.service.js +13 -8
- package/server/applications/admin/services/admin.service.js.map +1 -1
- package/server/applications/admin/services/admin.service.spec.js +1 -5
- package/server/applications/admin/services/admin.service.spec.js.map +1 -1
- package/server/applications/admin/utils/check-update.js +1 -5
- package/server/applications/admin/utils/check-update.js.map +1 -1
- package/server/applications/applications.config.js +1 -5
- package/server/applications/applications.config.js.map +1 -1
- package/server/applications/applications.constants.js +5 -5
- package/server/applications/applications.constants.js.map +1 -1
- package/server/applications/applications.module.js +1 -5
- package/server/applications/applications.module.js.map +1 -1
- package/server/applications/comments/comments.controller.js +1 -5
- package/server/applications/comments/comments.controller.js.map +1 -1
- package/server/applications/comments/comments.controller.spec.js +1 -5
- package/server/applications/comments/comments.controller.spec.js.map +1 -1
- package/server/applications/comments/comments.module.js +1 -5
- package/server/applications/comments/comments.module.js.map +1 -1
- package/server/applications/comments/constants/routes.js +1 -5
- package/server/applications/comments/constants/routes.js.map +1 -1
- package/server/applications/comments/dto/comment.dto.js +1 -5
- package/server/applications/comments/dto/comment.dto.js.map +1 -1
- package/server/applications/comments/interfaces/comment-recent.interface.js +1 -5
- package/server/applications/comments/interfaces/comment-recent.interface.js.map +1 -1
- package/server/applications/comments/schemas/comment.interface.js +1 -5
- package/server/applications/comments/schemas/comment.interface.js.map +1 -1
- package/server/applications/comments/schemas/comments.schema.js +1 -5
- package/server/applications/comments/schemas/comments.schema.js.map +1 -1
- package/server/applications/comments/services/comments-manager.service.js +9 -7
- package/server/applications/comments/services/comments-manager.service.js.map +1 -1
- package/server/applications/comments/services/comments-manager.service.spec.js +10 -8
- package/server/applications/comments/services/comments-manager.service.spec.js.map +1 -1
- package/server/applications/comments/services/comments-queries.service.js +1 -5
- package/server/applications/comments/services/comments-queries.service.js.map +1 -1
- package/server/applications/files/adapters/files-indexer-mysql.service.js +29 -12
- package/server/applications/files/adapters/files-indexer-mysql.service.js.map +1 -1
- package/server/applications/files/adapters/files-indexer-mysql.service.spec.js +1 -5
- package/server/applications/files/adapters/files-indexer-mysql.service.spec.js.map +1 -1
- package/server/applications/files/constants/cache.js +1 -5
- package/server/applications/files/constants/cache.js.map +1 -1
- package/server/applications/files/constants/compress.js +1 -5
- package/server/applications/files/constants/compress.js.map +1 -1
- package/server/applications/files/constants/files.js +1 -5
- package/server/applications/files/constants/files.js.map +1 -1
- package/server/applications/files/constants/indexing.js +1 -5
- package/server/applications/files/constants/indexing.js.map +1 -1
- package/server/applications/files/constants/operations.js +1 -5
- package/server/applications/files/constants/operations.js.map +1 -1
- package/server/applications/files/constants/routes.js +1 -5
- package/server/applications/files/constants/routes.js.map +1 -1
- package/server/applications/files/constants/samples.js +1 -5
- package/server/applications/files/constants/samples.js.map +1 -1
- package/server/applications/files/dto/file-operations.dto.js +1 -5
- package/server/applications/files/dto/file-operations.dto.js.map +1 -1
- package/server/applications/files/events/file-task-event.js +1 -5
- package/server/applications/files/events/file-task-event.js.map +1 -1
- package/server/applications/files/files-tasks.controller.js +1 -5
- package/server/applications/files/files-tasks.controller.js.map +1 -1
- package/server/applications/files/files-tasks.controller.spec.js +1 -5
- package/server/applications/files/files-tasks.controller.spec.js.map +1 -1
- package/server/applications/files/files.config.js +1 -5
- package/server/applications/files/files.config.js.map +1 -1
- package/server/applications/files/files.controller.js +1 -5
- package/server/applications/files/files.controller.js.map +1 -1
- package/server/applications/files/files.controller.spec.js +1 -5
- package/server/applications/files/files.controller.spec.js.map +1 -1
- package/server/applications/files/files.module.js +1 -5
- package/server/applications/files/files.module.js.map +1 -1
- package/server/applications/files/interfaces/file-db-props.interface.js +1 -5
- package/server/applications/files/interfaces/file-db-props.interface.js.map +1 -1
- package/server/applications/files/interfaces/file-lock.interface.js +1 -5
- package/server/applications/files/interfaces/file-lock.interface.js.map +1 -1
- package/server/applications/files/interfaces/file-parse-index.js +1 -5
- package/server/applications/files/interfaces/file-parse-index.js.map +1 -1
- package/server/applications/files/interfaces/file-props.interface.js +1 -5
- package/server/applications/files/interfaces/file-props.interface.js.map +1 -1
- package/server/applications/files/interfaces/file-recent-location.interface.js +1 -5
- package/server/applications/files/interfaces/file-recent-location.interface.js.map +1 -1
- package/server/applications/files/interfaces/file-space.interface.js +1 -5
- package/server/applications/files/interfaces/file-space.interface.js.map +1 -1
- package/server/applications/files/interfaces/file-tree.interface.js +1 -5
- package/server/applications/files/interfaces/file-tree.interface.js.map +1 -1
- package/server/applications/files/models/file-error.js +1 -5
- package/server/applications/files/models/file-error.js.map +1 -1
- package/server/applications/files/models/file-lock-error.js +1 -5
- package/server/applications/files/models/file-lock-error.js.map +1 -1
- package/server/applications/files/models/file-task.js +1 -5
- package/server/applications/files/models/file-task.js.map +1 -1
- package/server/applications/files/models/files-indexer.js +1 -5
- package/server/applications/files/models/files-indexer.js.map +1 -1
- package/server/applications/files/modules/collabora-online/collabora-online-environment.decorator.js +1 -5
- package/server/applications/files/modules/collabora-online/collabora-online-environment.decorator.js.map +1 -1
- package/server/applications/files/modules/collabora-online/collabora-online-manager.service.js +21 -10
- package/server/applications/files/modules/collabora-online/collabora-online-manager.service.js.map +1 -1
- package/server/applications/files/modules/collabora-online/collabora-online-manager.service.spec.js +1 -5
- package/server/applications/files/modules/collabora-online/collabora-online-manager.service.spec.js.map +1 -1
- package/server/applications/files/modules/collabora-online/collabora-online.config.js +1 -5
- package/server/applications/files/modules/collabora-online/collabora-online.config.js.map +1 -1
- package/server/applications/files/modules/collabora-online/collabora-online.constants.js +1 -5
- package/server/applications/files/modules/collabora-online/collabora-online.constants.js.map +1 -1
- package/server/applications/files/modules/collabora-online/collabora-online.controller.js +1 -5
- package/server/applications/files/modules/collabora-online/collabora-online.controller.js.map +1 -1
- package/server/applications/files/modules/collabora-online/collabora-online.controller.spec.js +1 -5
- package/server/applications/files/modules/collabora-online/collabora-online.controller.spec.js.map +1 -1
- package/server/applications/files/modules/collabora-online/collabora-online.dtos.js +1 -5
- package/server/applications/files/modules/collabora-online/collabora-online.dtos.js.map +1 -1
- package/server/applications/files/modules/collabora-online/collabora-online.guard.js +1 -5
- package/server/applications/files/modules/collabora-online/collabora-online.guard.js.map +1 -1
- package/server/applications/files/modules/collabora-online/collabora-online.guard.spec.js +1 -5
- package/server/applications/files/modules/collabora-online/collabora-online.guard.spec.js.map +1 -1
- package/server/applications/files/modules/collabora-online/collabora-online.interface.js +1 -5
- package/server/applications/files/modules/collabora-online/collabora-online.interface.js.map +1 -1
- package/server/applications/files/modules/collabora-online/collabora-online.module.js +1 -5
- package/server/applications/files/modules/collabora-online/collabora-online.module.js.map +1 -1
- package/server/applications/files/modules/collabora-online/collabora-online.routes.js +1 -5
- package/server/applications/files/modules/collabora-online/collabora-online.routes.js.map +1 -1
- package/server/applications/files/modules/collabora-online/collabora-online.strategy.js +1 -5
- package/server/applications/files/modules/collabora-online/collabora-online.strategy.js.map +1 -1
- package/server/applications/files/modules/collabora-online/collabora-online.utils.js +1 -5
- package/server/applications/files/modules/collabora-online/collabora-online.utils.js.map +1 -1
- package/server/applications/files/modules/file-editor-providers.interface.js +6 -0
- package/server/applications/files/modules/file-editor-providers.interface.js.map +1 -0
- package/server/applications/files/modules/only-office/only-office-environment.decorator.js +1 -5
- package/server/applications/files/modules/only-office/only-office-environment.decorator.js.map +1 -1
- package/server/applications/files/modules/only-office/only-office-manager.service.js +57 -19
- package/server/applications/files/modules/only-office/only-office-manager.service.js.map +1 -1
- package/server/applications/files/modules/only-office/only-office-manager.service.spec.js +1 -5
- package/server/applications/files/modules/only-office/only-office-manager.service.spec.js.map +1 -1
- package/server/applications/files/modules/only-office/only-office.config.js +1 -5
- package/server/applications/files/modules/only-office/only-office.config.js.map +1 -1
- package/server/applications/files/modules/only-office/only-office.constants.js +1 -5
- package/server/applications/files/modules/only-office/only-office.constants.js.map +1 -1
- package/server/applications/files/modules/only-office/only-office.controller.js +1 -5
- package/server/applications/files/modules/only-office/only-office.controller.js.map +1 -1
- package/server/applications/files/modules/only-office/only-office.controller.spec.js +1 -5
- package/server/applications/files/modules/only-office/only-office.controller.spec.js.map +1 -1
- package/server/applications/files/modules/only-office/only-office.dtos.js +1 -5
- package/server/applications/files/modules/only-office/only-office.dtos.js.map +1 -1
- package/server/applications/files/modules/only-office/only-office.guard.js +1 -5
- package/server/applications/files/modules/only-office/only-office.guard.js.map +1 -1
- package/server/applications/files/modules/only-office/only-office.guard.spec.js +1 -5
- package/server/applications/files/modules/only-office/only-office.guard.spec.js.map +1 -1
- package/server/applications/files/modules/only-office/only-office.interface.js +1 -5
- package/server/applications/files/modules/only-office/only-office.interface.js.map +1 -1
- package/server/applications/files/modules/only-office/only-office.module.js +1 -5
- package/server/applications/files/modules/only-office/only-office.module.js.map +1 -1
- package/server/applications/files/modules/only-office/only-office.routes.js +1 -5
- package/server/applications/files/modules/only-office/only-office.routes.js.map +1 -1
- package/server/applications/files/modules/only-office/only-office.strategy.js +1 -5
- package/server/applications/files/modules/only-office/only-office.strategy.js.map +1 -1
- package/server/applications/files/schemas/file-content.interface.js +1 -5
- package/server/applications/files/schemas/file-content.interface.js.map +1 -1
- package/server/applications/files/schemas/file-recent.interface.js +1 -5
- package/server/applications/files/schemas/file-recent.interface.js.map +1 -1
- package/server/applications/files/schemas/file.interface.js +1 -5
- package/server/applications/files/schemas/file.interface.js.map +1 -1
- package/server/applications/files/schemas/files-content.schema.js +1 -5
- package/server/applications/files/schemas/files-content.schema.js.map +1 -1
- package/server/applications/files/schemas/files-recents.schema.js +1 -5
- package/server/applications/files/schemas/files-recents.schema.js.map +1 -1
- package/server/applications/files/schemas/files.schema.js +1 -5
- package/server/applications/files/schemas/files.schema.js.map +1 -1
- package/server/applications/files/services/files-content-manager.service.js +45 -16
- package/server/applications/files/services/files-content-manager.service.js.map +1 -1
- package/server/applications/files/services/files-lock-manager.service.js +53 -18
- package/server/applications/files/services/files-lock-manager.service.js.map +1 -1
- package/server/applications/files/services/files-lock-manager.service.spec.js +1 -5
- package/server/applications/files/services/files-lock-manager.service.spec.js.map +1 -1
- package/server/applications/files/services/files-manager.service.js +77 -24
- package/server/applications/files/services/files-manager.service.js.map +1 -1
- package/server/applications/files/services/files-manager.service.spec.js +1 -5
- package/server/applications/files/services/files-manager.service.spec.js.map +1 -1
- package/server/applications/files/services/files-methods.service.js +5 -6
- package/server/applications/files/services/files-methods.service.js.map +1 -1
- package/server/applications/files/services/files-methods.service.spec.js +1 -5
- package/server/applications/files/services/files-methods.service.spec.js.map +1 -1
- package/server/applications/files/services/files-parser.service.js +13 -8
- package/server/applications/files/services/files-parser.service.js.map +1 -1
- package/server/applications/files/services/files-parser.service.spec.js +1 -5
- package/server/applications/files/services/files-parser.service.spec.js.map +1 -1
- package/server/applications/files/services/files-queries.service.js +29 -12
- package/server/applications/files/services/files-queries.service.js.map +1 -1
- package/server/applications/files/services/files-recents.service.js +1 -5
- package/server/applications/files/services/files-recents.service.js.map +1 -1
- package/server/applications/files/services/files-recents.service.spec.js +1 -5
- package/server/applications/files/services/files-recents.service.spec.js.map +1 -1
- package/server/applications/files/services/files-scheduler.service.js +77 -24
- package/server/applications/files/services/files-scheduler.service.js.map +1 -1
- package/server/applications/files/services/files-search-manager.service.js +9 -7
- package/server/applications/files/services/files-search-manager.service.js.map +1 -1
- package/server/applications/files/services/files-search-manager.service.spec.js +1 -5
- package/server/applications/files/services/files-search-manager.service.spec.js.map +1 -1
- package/server/applications/files/services/files-tasks-manager.service.js +77 -24
- package/server/applications/files/services/files-tasks-manager.service.js.map +1 -1
- package/server/applications/files/services/files-tasks-manager.service.spec.js +1 -5
- package/server/applications/files/services/files-tasks-manager.service.spec.js.map +1 -1
- package/server/applications/files/utils/doc-textify/adapters/excel.js +1 -5
- package/server/applications/files/utils/doc-textify/adapters/excel.js.map +1 -1
- package/server/applications/files/utils/doc-textify/adapters/html.js +1 -5
- package/server/applications/files/utils/doc-textify/adapters/html.js.map +1 -1
- package/server/applications/files/utils/doc-textify/adapters/open-office.js +1 -5
- package/server/applications/files/utils/doc-textify/adapters/open-office.js.map +1 -1
- package/server/applications/files/utils/doc-textify/adapters/pdf.js +1 -5
- package/server/applications/files/utils/doc-textify/adapters/pdf.js.map +1 -1
- package/server/applications/files/utils/doc-textify/adapters/power-point.js +1 -5
- package/server/applications/files/utils/doc-textify/adapters/power-point.js.map +1 -1
- package/server/applications/files/utils/doc-textify/adapters/text.js +1 -5
- package/server/applications/files/utils/doc-textify/adapters/text.js.map +1 -1
- package/server/applications/files/utils/doc-textify/adapters/word.js +1 -5
- package/server/applications/files/utils/doc-textify/adapters/word.js.map +1 -1
- package/server/applications/files/utils/doc-textify/doc-textify.js +1 -5
- package/server/applications/files/utils/doc-textify/doc-textify.js.map +1 -1
- package/server/applications/files/utils/doc-textify/interfaces/doc-textify.interfaces.js +1 -5
- package/server/applications/files/utils/doc-textify/interfaces/doc-textify.interfaces.js.map +1 -1
- package/server/applications/files/utils/doc-textify/utils/clean.js +1 -5
- package/server/applications/files/utils/doc-textify/utils/clean.js.map +1 -1
- package/server/applications/files/utils/files-search.js +1 -5
- package/server/applications/files/utils/files-search.js.map +1 -1
- package/server/applications/files/utils/files-tree.js +1 -5
- package/server/applications/files/utils/files-tree.js.map +1 -1
- package/server/applications/files/utils/files.js +1 -5
- package/server/applications/files/utils/files.js.map +1 -1
- package/server/applications/files/utils/send-file.js +1 -5
- package/server/applications/files/utils/send-file.js.map +1 -1
- package/server/applications/files/utils/unzip-file.js +1 -5
- package/server/applications/files/utils/unzip-file.js.map +1 -1
- package/server/applications/files/utils/url-file.js +1 -5
- package/server/applications/files/utils/url-file.js.map +1 -1
- package/server/applications/links/constants/cache.js +1 -5
- package/server/applications/links/constants/cache.js.map +1 -1
- package/server/applications/links/constants/links.js +1 -5
- package/server/applications/links/constants/links.js.map +1 -1
- package/server/applications/links/constants/routes.js +1 -5
- package/server/applications/links/constants/routes.js.map +1 -1
- package/server/applications/links/dto/create-or-update-link.dto.js +1 -5
- package/server/applications/links/dto/create-or-update-link.dto.js.map +1 -1
- package/server/applications/links/interfaces/link-guest.interface.js +1 -5
- package/server/applications/links/interfaces/link-guest.interface.js.map +1 -1
- package/server/applications/links/interfaces/link-space.interface.js +1 -5
- package/server/applications/links/interfaces/link-space.interface.js.map +1 -1
- package/server/applications/links/links.controller.js +1 -5
- package/server/applications/links/links.controller.js.map +1 -1
- package/server/applications/links/links.controller.spec.js +1 -5
- package/server/applications/links/links.controller.spec.js.map +1 -1
- package/server/applications/links/schemas/link.interface.js +1 -5
- package/server/applications/links/schemas/link.interface.js.map +1 -1
- package/server/applications/links/schemas/links.schema.js +1 -5
- package/server/applications/links/schemas/links.schema.js.map +1 -1
- package/server/applications/links/services/links-manager.service.js +55 -20
- package/server/applications/links/services/links-manager.service.js.map +1 -1
- package/server/applications/links/services/links-manager.service.spec.js +3 -7
- package/server/applications/links/services/links-manager.service.spec.js.map +1 -1
- package/server/applications/links/services/links-queries.service.js +1 -5
- package/server/applications/links/services/links-queries.service.js.map +1 -1
- package/server/applications/notifications/constants/notifications.js +1 -5
- package/server/applications/notifications/constants/notifications.js.map +1 -1
- package/server/applications/notifications/constants/routes.js +1 -5
- package/server/applications/notifications/constants/routes.js.map +1 -1
- package/server/applications/notifications/constants/websocket.js +1 -5
- package/server/applications/notifications/constants/websocket.js.map +1 -1
- package/server/applications/notifications/i18n/de.js +1 -9
- package/server/applications/notifications/i18n/de.js.map +1 -1
- package/server/applications/notifications/i18n/es.js +1 -5
- package/server/applications/notifications/i18n/es.js.map +1 -1
- package/server/applications/notifications/i18n/fr.js +1 -5
- package/server/applications/notifications/i18n/fr.js.map +1 -1
- package/server/applications/notifications/i18n/hi.js +1 -5
- package/server/applications/notifications/i18n/hi.js.map +1 -1
- package/server/applications/notifications/i18n/index.js +1 -5
- package/server/applications/notifications/i18n/index.js.map +1 -1
- package/server/applications/notifications/i18n/it.js +1 -5
- package/server/applications/notifications/i18n/it.js.map +1 -1
- package/server/applications/notifications/i18n/ja.js +1 -5
- package/server/applications/notifications/i18n/ja.js.map +1 -1
- package/server/applications/notifications/i18n/ko.js +1 -5
- package/server/applications/notifications/i18n/ko.js.map +1 -1
- package/server/applications/notifications/i18n/pl.js +1 -5
- package/server/applications/notifications/i18n/pl.js.map +1 -1
- package/server/applications/notifications/i18n/pt.js +1 -5
- package/server/applications/notifications/i18n/pt.js.map +1 -1
- package/server/applications/notifications/i18n/pt_br.js +1 -5
- package/server/applications/notifications/i18n/pt_br.js.map +1 -1
- package/server/applications/notifications/i18n/ru.js +1 -5
- package/server/applications/notifications/i18n/ru.js.map +1 -1
- package/server/applications/notifications/i18n/tr.js +1 -5
- package/server/applications/notifications/i18n/tr.js.map +1 -1
- package/server/applications/notifications/i18n/zh.js +1 -5
- package/server/applications/notifications/i18n/zh.js.map +1 -1
- package/server/applications/notifications/interfaces/notification-properties.interface.js +1 -5
- package/server/applications/notifications/interfaces/notification-properties.interface.js.map +1 -1
- package/server/applications/notifications/interfaces/user-mail-notification.interface.js +1 -5
- package/server/applications/notifications/interfaces/user-mail-notification.interface.js.map +1 -1
- package/server/applications/notifications/mails/models.js +1 -5
- package/server/applications/notifications/mails/models.js.map +1 -1
- package/server/applications/notifications/mails/templates.js +1 -5
- package/server/applications/notifications/mails/templates.js.map +1 -1
- package/server/applications/notifications/mails/urls.js +1 -5
- package/server/applications/notifications/mails/urls.js.map +1 -1
- package/server/applications/notifications/notifications.controller.js +1 -5
- package/server/applications/notifications/notifications.controller.js.map +1 -1
- package/server/applications/notifications/notifications.controller.spec.js +1 -5
- package/server/applications/notifications/notifications.controller.spec.js.map +1 -1
- package/server/applications/notifications/notifications.gateway.js +1 -5
- package/server/applications/notifications/notifications.gateway.js.map +1 -1
- package/server/applications/notifications/notifications.module.js +1 -5
- package/server/applications/notifications/notifications.module.js.map +1 -1
- package/server/applications/notifications/schemas/notification.interface.js +1 -5
- package/server/applications/notifications/schemas/notification.interface.js.map +1 -1
- package/server/applications/notifications/schemas/notifications.schema.js +1 -5
- package/server/applications/notifications/schemas/notifications.schema.js.map +1 -1
- package/server/applications/notifications/services/notifications-manager.service.js +25 -11
- package/server/applications/notifications/services/notifications-manager.service.js.map +1 -1
- package/server/applications/notifications/services/notifications-manager.service.spec.js +20 -11
- package/server/applications/notifications/services/notifications-manager.service.spec.js.map +1 -1
- package/server/applications/notifications/services/notifications-queries.service.js +1 -5
- package/server/applications/notifications/services/notifications-queries.service.js.map +1 -1
- package/server/applications/shares/constants/routes.js +1 -5
- package/server/applications/shares/constants/routes.js.map +1 -1
- package/server/applications/shares/constants/shares.js +1 -5
- package/server/applications/shares/constants/shares.js.map +1 -1
- package/server/applications/shares/dto/create-or-update-share.dto.js +1 -5
- package/server/applications/shares/dto/create-or-update-share.dto.js.map +1 -1
- package/server/applications/shares/interfaces/share-child.interface.js +1 -5
- package/server/applications/shares/interfaces/share-child.interface.js.map +1 -1
- package/server/applications/shares/interfaces/share-env.interface.js +1 -5
- package/server/applications/shares/interfaces/share-env.interface.js.map +1 -1
- package/server/applications/shares/interfaces/share-file.interface.js +1 -5
- package/server/applications/shares/interfaces/share-file.interface.js.map +1 -1
- package/server/applications/shares/interfaces/share-link.interface.js +1 -5
- package/server/applications/shares/interfaces/share-link.interface.js.map +1 -1
- package/server/applications/shares/interfaces/share-props.interface.js +1 -5
- package/server/applications/shares/interfaces/share-props.interface.js.map +1 -1
- package/server/applications/shares/models/share-child.model.js +1 -5
- package/server/applications/shares/models/share-child.model.js.map +1 -1
- package/server/applications/shares/schemas/share-members.interface.js +1 -5
- package/server/applications/shares/schemas/share-members.interface.js.map +1 -1
- package/server/applications/shares/schemas/share.interface.js +1 -5
- package/server/applications/shares/schemas/share.interface.js.map +1 -1
- package/server/applications/shares/schemas/shares-members.schema.js +1 -5
- package/server/applications/shares/schemas/shares-members.schema.js.map +1 -1
- package/server/applications/shares/schemas/shares.schema.js +1 -5
- package/server/applications/shares/schemas/shares.schema.js.map +1 -1
- package/server/applications/shares/services/shares-manager.service.js +214 -68
- package/server/applications/shares/services/shares-manager.service.js.map +1 -1
- package/server/applications/shares/services/shares-manager.service.spec.js +1 -5
- package/server/applications/shares/services/shares-manager.service.spec.js.map +1 -1
- package/server/applications/shares/services/shares-queries.service.js +49 -17
- package/server/applications/shares/services/shares-queries.service.js.map +1 -1
- package/server/applications/shares/shares.controller.js +1 -5
- package/server/applications/shares/shares.controller.js.map +1 -1
- package/server/applications/shares/shares.controller.spec.js +1 -5
- package/server/applications/shares/shares.controller.spec.js.map +1 -1
- package/server/applications/shares/shares.module.js +1 -5
- package/server/applications/shares/shares.module.js.map +1 -1
- package/server/applications/spaces/constants/cache.js +1 -5
- package/server/applications/spaces/constants/cache.js.map +1 -1
- package/server/applications/spaces/constants/routes.js +1 -5
- package/server/applications/spaces/constants/routes.js.map +1 -1
- package/server/applications/spaces/constants/spaces.js +1 -5
- package/server/applications/spaces/constants/spaces.js.map +1 -1
- package/server/applications/spaces/decorators/space-override-permission.decorator.js +1 -5
- package/server/applications/spaces/decorators/space-override-permission.decorator.js.map +1 -1
- package/server/applications/spaces/decorators/space-skip-guard.decorator.js +1 -5
- package/server/applications/spaces/decorators/space-skip-guard.decorator.js.map +1 -1
- package/server/applications/spaces/decorators/space-skip-permissions.decorator.js +1 -5
- package/server/applications/spaces/decorators/space-skip-permissions.decorator.js.map +1 -1
- package/server/applications/spaces/decorators/space.decorator.js +1 -5
- package/server/applications/spaces/decorators/space.decorator.js.map +1 -1
- package/server/applications/spaces/dto/create-or-update-space.dto.js +1 -5
- package/server/applications/spaces/dto/create-or-update-space.dto.js.map +1 -1
- package/server/applications/spaces/dto/delete-space.dto.js +1 -5
- package/server/applications/spaces/dto/delete-space.dto.js.map +1 -1
- package/server/applications/spaces/dto/search-space.dto.js +1 -5
- package/server/applications/spaces/dto/search-space.dto.js.map +1 -1
- package/server/applications/spaces/dto/space-roots.dto.js +1 -5
- package/server/applications/spaces/dto/space-roots.dto.js.map +1 -1
- package/server/applications/spaces/guards/space.guard.js +17 -9
- package/server/applications/spaces/guards/space.guard.js.map +1 -1
- package/server/applications/spaces/guards/space.guard.spec.js +1 -5
- package/server/applications/spaces/guards/space.guard.spec.js.map +1 -1
- package/server/applications/spaces/interfaces/space-diff.interface.js +1 -5
- package/server/applications/spaces/interfaces/space-diff.interface.js.map +1 -1
- package/server/applications/spaces/interfaces/space-files.interface.js +1 -5
- package/server/applications/spaces/interfaces/space-files.interface.js.map +1 -1
- package/server/applications/spaces/interfaces/space-request.interface.js +1 -5
- package/server/applications/spaces/interfaces/space-request.interface.js.map +1 -1
- package/server/applications/spaces/interfaces/space-trash.interface.js +1 -5
- package/server/applications/spaces/interfaces/space-trash.interface.js.map +1 -1
- package/server/applications/spaces/models/space-env.model.js +1 -5
- package/server/applications/spaces/models/space-env.model.js.map +1 -1
- package/server/applications/spaces/models/space-props.model.js +1 -5
- package/server/applications/spaces/models/space-props.model.js.map +1 -1
- package/server/applications/spaces/models/space-root-props.model.js +1 -5
- package/server/applications/spaces/models/space-root-props.model.js.map +1 -1
- package/server/applications/spaces/models/space.model.js +1 -5
- package/server/applications/spaces/models/space.model.js.map +1 -1
- package/server/applications/spaces/schemas/space-members.interface.js +1 -5
- package/server/applications/spaces/schemas/space-members.interface.js.map +1 -1
- package/server/applications/spaces/schemas/space-root.interface.js +1 -5
- package/server/applications/spaces/schemas/space-root.interface.js.map +1 -1
- package/server/applications/spaces/schemas/space.interface.js +1 -5
- package/server/applications/spaces/schemas/space.interface.js.map +1 -1
- package/server/applications/spaces/schemas/spaces-members.schema.js +1 -5
- package/server/applications/spaces/schemas/spaces-members.schema.js.map +1 -1
- package/server/applications/spaces/schemas/spaces-roots.schema.js +1 -5
- package/server/applications/spaces/schemas/spaces-roots.schema.js.map +1 -1
- package/server/applications/spaces/schemas/spaces.schema.js +1 -5
- package/server/applications/spaces/schemas/spaces.schema.js.map +1 -1
- package/server/applications/spaces/services/spaces-browser.service.js +77 -24
- package/server/applications/spaces/services/spaces-browser.service.js.map +1 -1
- package/server/applications/spaces/services/spaces-browser.service.spec.js +1 -5
- package/server/applications/spaces/services/spaces-browser.service.spec.js.map +1 -1
- package/server/applications/spaces/services/spaces-manager.service.js +193 -53
- package/server/applications/spaces/services/spaces-manager.service.js.map +1 -1
- package/server/applications/spaces/services/spaces-manager.service.spec.js +1 -5
- package/server/applications/spaces/services/spaces-manager.service.spec.js.map +1 -1
- package/server/applications/spaces/services/spaces-queries.service.js +65 -21
- package/server/applications/spaces/services/spaces-queries.service.js.map +1 -1
- package/server/applications/spaces/services/spaces-scheduler.service.js +49 -17
- package/server/applications/spaces/services/spaces-scheduler.service.js.map +1 -1
- package/server/applications/spaces/spaces.controller.js +1 -5
- package/server/applications/spaces/spaces.controller.js.map +1 -1
- package/server/applications/spaces/spaces.controller.spec.js +1 -5
- package/server/applications/spaces/spaces.controller.spec.js.map +1 -1
- package/server/applications/spaces/spaces.module.js +1 -5
- package/server/applications/spaces/spaces.module.js.map +1 -1
- package/server/applications/spaces/utils/paths.js +1 -5
- package/server/applications/spaces/utils/paths.js.map +1 -1
- package/server/applications/spaces/utils/permissions.js +1 -5
- package/server/applications/spaces/utils/permissions.js.map +1 -1
- package/server/applications/spaces/utils/routes.js +1 -5
- package/server/applications/spaces/utils/routes.js.map +1 -1
- package/server/applications/sync/constants/auth.js +1 -5
- package/server/applications/sync/constants/auth.js.map +1 -1
- package/server/applications/sync/constants/routes.js +6 -5
- package/server/applications/sync/constants/routes.js.map +1 -1
- package/server/applications/sync/constants/store.js +1 -9
- package/server/applications/sync/constants/store.js.map +1 -1
- package/server/applications/sync/constants/sync.js +2 -6
- package/server/applications/sync/constants/sync.js.map +1 -1
- package/server/applications/sync/decorators/sync-context.decorator.js +1 -5
- package/server/applications/sync/decorators/sync-context.decorator.js.map +1 -1
- package/server/applications/sync/decorators/sync-environment.decorator.js +1 -5
- package/server/applications/sync/decorators/sync-environment.decorator.js.map +1 -1
- package/server/applications/sync/dtos/sync-client-auth.dto.js +12 -8
- package/server/applications/sync/dtos/sync-client-auth.dto.js.map +1 -1
- package/server/applications/sync/dtos/sync-client-info.dto.js +49 -0
- package/server/applications/sync/dtos/sync-client-info.dto.js.map +1 -0
- package/server/applications/sync/dtos/sync-client-registration.dto.js +34 -11
- package/server/applications/sync/dtos/sync-client-registration.dto.js.map +1 -1
- package/server/applications/sync/dtos/sync-operations.dto.js +1 -5
- package/server/applications/sync/dtos/sync-operations.dto.js.map +1 -1
- package/server/applications/sync/dtos/sync-path.dto.js +1 -5
- package/server/applications/sync/dtos/sync-path.dto.js.map +1 -1
- package/server/applications/sync/dtos/sync-upload.dto.js +1 -5
- package/server/applications/sync/dtos/sync-upload.dto.js.map +1 -1
- package/server/applications/sync/interceptors/sync-diff-gzip-body.interceptor.js +1 -5
- package/server/applications/sync/interceptors/sync-diff-gzip-body.interceptor.js.map +1 -1
- package/server/applications/sync/interceptors/sync-diff-gzip-body.interceptor.spec.js +1 -5
- package/server/applications/sync/interceptors/sync-diff-gzip-body.interceptor.spec.js.map +1 -1
- package/server/applications/sync/interfaces/store-manifest.interface.js +1 -5
- package/server/applications/sync/interfaces/store-manifest.interface.js.map +1 -1
- package/server/applications/sync/interfaces/sync-client-auth.interface.js +1 -25
- package/server/applications/sync/interfaces/sync-client-auth.interface.js.map +1 -1
- package/server/applications/sync/interfaces/sync-client-paths.interface.js +1 -5
- package/server/applications/sync/interfaces/sync-client-paths.interface.js.map +1 -1
- package/server/applications/sync/interfaces/sync-client.interface.js +1 -5
- package/server/applications/sync/interfaces/sync-client.interface.js.map +1 -1
- package/server/applications/sync/interfaces/sync-diff.interface.js +1 -5
- package/server/applications/sync/interfaces/sync-diff.interface.js.map +1 -1
- package/server/applications/sync/interfaces/sync-path.interface.js +1 -5
- package/server/applications/sync/interfaces/sync-path.interface.js.map +1 -1
- package/server/applications/sync/schemas/sync-client.interface.js +1 -5
- package/server/applications/sync/schemas/sync-client.interface.js.map +1 -1
- package/server/applications/sync/schemas/sync-clients.schema.js +1 -5
- package/server/applications/sync/schemas/sync-clients.schema.js.map +1 -1
- package/server/applications/sync/schemas/sync-path.interface.js +1 -5
- package/server/applications/sync/schemas/sync-path.interface.js.map +1 -1
- package/server/applications/sync/schemas/sync-paths.schema.js +1 -5
- package/server/applications/sync/schemas/sync-paths.schema.js.map +1 -1
- package/server/applications/sync/services/sync-clients-manager.service.js +108 -44
- package/server/applications/sync/services/sync-clients-manager.service.js.map +1 -1
- package/server/applications/sync/services/sync-clients-manager.service.spec.js +14 -17
- package/server/applications/sync/services/sync-clients-manager.service.spec.js.map +1 -1
- package/server/applications/sync/services/sync-manager.service.js +29 -12
- package/server/applications/sync/services/sync-manager.service.js.map +1 -1
- package/server/applications/sync/services/sync-manager.service.spec.js +1 -5
- package/server/applications/sync/services/sync-manager.service.spec.js.map +1 -1
- package/server/applications/sync/services/sync-paths-manager.service.js +27 -17
- package/server/applications/sync/services/sync-paths-manager.service.js.map +1 -1
- package/server/applications/sync/services/sync-paths-manager.service.spec.js +11 -15
- package/server/applications/sync/services/sync-paths-manager.service.spec.js.map +1 -1
- package/server/applications/sync/services/sync-queries.service.js +1 -5
- package/server/applications/sync/services/sync-queries.service.js.map +1 -1
- package/server/applications/sync/sync.config.js +1 -5
- package/server/applications/sync/sync.config.js.map +1 -1
- package/server/applications/sync/sync.controller.js +21 -6
- package/server/applications/sync/sync.controller.js.map +1 -1
- package/server/applications/sync/sync.controller.spec.js +1 -5
- package/server/applications/sync/sync.controller.spec.js.map +1 -1
- package/server/applications/sync/sync.module.js +1 -5
- package/server/applications/sync/sync.module.js.map +1 -1
- package/server/applications/sync/utils/functions.js +1 -5
- package/server/applications/sync/utils/functions.js.map +1 -1
- package/server/applications/sync/utils/normalizedMap.js +1 -5
- package/server/applications/sync/utils/normalizedMap.js.map +1 -1
- package/server/applications/sync/utils/routes.js +1 -5
- package/server/applications/sync/utils/routes.js.map +1 -1
- package/server/applications/users/admin-users.controller.js +2 -6
- package/server/applications/users/admin-users.controller.js.map +1 -1
- package/server/applications/users/admin-users.controller.spec.js +6 -10
- package/server/applications/users/admin-users.controller.spec.js.map +1 -1
- package/server/applications/users/constants/group.js +1 -5
- package/server/applications/users/constants/group.js.map +1 -1
- package/server/applications/users/constants/member.js +1 -5
- package/server/applications/users/constants/member.js.map +1 -1
- package/server/applications/users/constants/routes.js +1 -5
- package/server/applications/users/constants/routes.js.map +1 -1
- package/server/applications/users/constants/user.js +1 -5
- package/server/applications/users/constants/user.js.map +1 -1
- package/server/applications/users/constants/websocket.js +1 -5
- package/server/applications/users/constants/websocket.js.map +1 -1
- package/server/applications/users/decorators/permissions.decorator.js +1 -5
- package/server/applications/users/decorators/permissions.decorator.js.map +1 -1
- package/server/applications/users/decorators/roles.decorator.js +1 -5
- package/server/applications/users/decorators/roles.decorator.js.map +1 -1
- package/server/applications/users/decorators/user.decorator.js +1 -5
- package/server/applications/users/decorators/user.decorator.js.map +1 -1
- package/server/applications/users/dto/create-or-update-group.dto.js +1 -5
- package/server/applications/users/dto/create-or-update-group.dto.js.map +1 -1
- package/server/applications/users/dto/create-or-update-user.dto.js +1 -5
- package/server/applications/users/dto/create-or-update-user.dto.js.map +1 -1
- package/server/applications/users/dto/delete-user.dto.js +1 -5
- package/server/applications/users/dto/delete-user.dto.js.map +1 -1
- package/server/applications/users/dto/search-members.dto.js +1 -5
- package/server/applications/users/dto/search-members.dto.js.map +1 -1
- package/server/applications/users/dto/user-properties.dto.js +1 -5
- package/server/applications/users/dto/user-properties.dto.js.map +1 -1
- package/server/applications/users/guards/permissions.guard.js +1 -5
- package/server/applications/users/guards/permissions.guard.js.map +1 -1
- package/server/applications/users/guards/permissions.guard.spec.js +1 -5
- package/server/applications/users/guards/permissions.guard.spec.js.map +1 -1
- package/server/applications/users/guards/roles.guard.js +1 -5
- package/server/applications/users/guards/roles.guard.js.map +1 -1
- package/server/applications/users/guards/roles.guard.spec.js +1 -5
- package/server/applications/users/guards/roles.guard.spec.js.map +1 -1
- package/server/applications/users/interfaces/admin-group.interface.js +1 -5
- package/server/applications/users/interfaces/admin-group.interface.js.map +1 -1
- package/server/applications/users/interfaces/admin-user.interface.js +1 -5
- package/server/applications/users/interfaces/admin-user.interface.js.map +1 -1
- package/server/applications/users/interfaces/group-browse.interface.js +1 -5
- package/server/applications/users/interfaces/group-browse.interface.js.map +1 -1
- package/server/applications/users/interfaces/group-member.js +1 -5
- package/server/applications/users/interfaces/group-member.js.map +1 -1
- package/server/applications/users/interfaces/guest-user.interface.js +1 -5
- package/server/applications/users/interfaces/guest-user.interface.js.map +1 -1
- package/server/applications/users/interfaces/member.interface.js +1 -5
- package/server/applications/users/interfaces/member.interface.js.map +1 -1
- package/server/applications/users/interfaces/owner.interface.js +1 -5
- package/server/applications/users/interfaces/owner.interface.js.map +1 -1
- package/server/applications/users/interfaces/user-secrets.interface.js +1 -5
- package/server/applications/users/interfaces/user-secrets.interface.js.map +1 -1
- package/server/applications/users/interfaces/websocket.interface.js +1 -5
- package/server/applications/users/interfaces/websocket.interface.js.map +1 -1
- package/server/applications/users/models/user.model.js +1 -5
- package/server/applications/users/models/user.model.js.map +1 -1
- package/server/applications/users/schemas/group.interface.js +1 -5
- package/server/applications/users/schemas/group.interface.js.map +1 -1
- package/server/applications/users/schemas/groups.schema.js +1 -5
- package/server/applications/users/schemas/groups.schema.js.map +1 -1
- package/server/applications/users/schemas/user-group.interface.js +1 -5
- package/server/applications/users/schemas/user-group.interface.js.map +1 -1
- package/server/applications/users/schemas/user.interface.js +1 -5
- package/server/applications/users/schemas/user.interface.js.map +1 -1
- package/server/applications/users/schemas/users-groups.schema.js +1 -5
- package/server/applications/users/schemas/users-groups.schema.js.map +1 -1
- package/server/applications/users/schemas/users-guests.schema.js +1 -5
- package/server/applications/users/schemas/users-guests.schema.js.map +1 -1
- package/server/applications/users/schemas/users.schema.js +1 -5
- package/server/applications/users/schemas/users.schema.js.map +1 -1
- package/server/applications/users/services/admin-users-manager.service.js +67 -23
- package/server/applications/users/services/admin-users-manager.service.js.map +1 -1
- package/server/applications/users/services/admin-users-manager.service.spec.js +3 -7
- package/server/applications/users/services/admin-users-manager.service.spec.js.map +1 -1
- package/server/applications/users/services/admin-users-queries.service.js +65 -21
- package/server/applications/users/services/admin-users-queries.service.js.map +1 -1
- package/server/applications/users/services/users-manager.service.js +81 -25
- package/server/applications/users/services/users-manager.service.js.map +1 -1
- package/server/applications/users/services/users-manager.service.spec.js +14 -12
- package/server/applications/users/services/users-manager.service.spec.js.map +1 -1
- package/server/applications/users/services/users-queries.service.js +49 -17
- package/server/applications/users/services/users-queries.service.js.map +1 -1
- package/server/applications/users/users.controller.js +2 -6
- package/server/applications/users/users.controller.js.map +1 -1
- package/server/applications/users/users.controller.spec.js +5 -9
- package/server/applications/users/users.controller.spec.js.map +1 -1
- package/server/applications/users/users.e2e-spec.js +3 -7
- package/server/applications/users/users.e2e-spec.js.map +1 -1
- package/server/applications/users/users.gateway.js +29 -12
- package/server/applications/users/users.gateway.js.map +1 -1
- package/server/applications/users/users.gateway.spec.js +1 -5
- package/server/applications/users/users.gateway.spec.js.map +1 -1
- package/server/applications/users/users.module.js +1 -5
- package/server/applications/users/users.module.js.map +1 -1
- package/server/applications/users/utils/avatar.js +1 -5
- package/server/applications/users/utils/avatar.js.map +1 -1
- package/server/applications/users/utils/test.js +1 -5
- package/server/applications/users/utils/test.js.map +1 -1
- package/server/applications/webdav/constants/routes.js +1 -5
- package/server/applications/webdav/constants/routes.js.map +1 -1
- package/server/applications/webdav/constants/webdav.js +1 -5
- package/server/applications/webdav/constants/webdav.js.map +1 -1
- package/server/applications/webdav/decorators/if-header.decorator.js +1 -5
- package/server/applications/webdav/decorators/if-header.decorator.js.map +1 -1
- package/server/applications/webdav/decorators/webdav-context.decorator.js +1 -5
- package/server/applications/webdav/decorators/webdav-context.decorator.js.map +1 -1
- package/server/applications/webdav/filters/webdav.filter.js +1 -5
- package/server/applications/webdav/filters/webdav.filter.js.map +1 -1
- package/server/applications/webdav/filters/webdav.filter.spec.js +1 -5
- package/server/applications/webdav/filters/webdav.filter.spec.js.map +1 -1
- package/server/applications/webdav/guards/webdav-protocol.guard.js +54 -20
- package/server/applications/webdav/guards/webdav-protocol.guard.js.map +1 -1
- package/server/applications/webdav/guards/webdav-protocol.guard.spec.js +54 -0
- package/server/applications/webdav/guards/webdav-protocol.guard.spec.js.map +1 -1
- package/server/applications/webdav/interfaces/if-header.interface.js +1 -5
- package/server/applications/webdav/interfaces/if-header.interface.js.map +1 -1
- package/server/applications/webdav/interfaces/webdav.interface.js +1 -5
- package/server/applications/webdav/interfaces/webdav.interface.js.map +1 -1
- package/server/applications/webdav/models/webdav-file.model.js +1 -5
- package/server/applications/webdav/models/webdav-file.model.js.map +1 -1
- package/server/applications/webdav/services/webdav-methods.service.js +74 -26
- package/server/applications/webdav/services/webdav-methods.service.js.map +1 -1
- package/server/applications/webdav/services/webdav-methods.service.spec.js +15 -18
- package/server/applications/webdav/services/webdav-methods.service.spec.js.map +1 -1
- package/server/applications/webdav/services/webdav-spaces.service.js +17 -9
- package/server/applications/webdav/services/webdav-spaces.service.js.map +1 -1
- package/server/applications/webdav/services/webdav-spaces.service.spec.js +1 -5
- package/server/applications/webdav/services/webdav-spaces.service.spec.js.map +1 -1
- package/server/applications/webdav/utils/bootstrap.js +1 -5
- package/server/applications/webdav/utils/bootstrap.js.map +1 -1
- package/server/applications/webdav/utils/if-header.js +1 -5
- package/server/applications/webdav/utils/if-header.js.map +1 -1
- package/server/applications/webdav/utils/routes.js +1 -5
- package/server/applications/webdav/utils/routes.js.map +1 -1
- package/server/applications/webdav/utils/webdav.js +1 -5
- package/server/applications/webdav/utils/webdav.js.map +1 -1
- package/server/applications/webdav/utils/xml.js +1 -5
- package/server/applications/webdav/utils/xml.js.map +1 -1
- package/server/applications/webdav/webdav.controller.js +1 -5
- package/server/applications/webdav/webdav.controller.js.map +1 -1
- package/server/applications/webdav/webdav.controller.spec.js +1 -5
- package/server/applications/webdav/webdav.controller.spec.js.map +1 -1
- package/server/applications/webdav/webdav.e2e-spec.js +1 -5
- package/server/applications/webdav/webdav.e2e-spec.js.map +1 -1
- package/server/applications/webdav/webdav.module.js +1 -5
- package/server/applications/webdav/webdav.module.js.map +1 -1
- package/server/authentication/auth.config.js +23 -123
- package/server/authentication/auth.config.js.map +1 -1
- package/server/authentication/auth.controller.js +27 -21
- package/server/authentication/auth.controller.js.map +1 -1
- package/server/authentication/auth.controller.spec.js +6 -10
- package/server/authentication/auth.controller.spec.js.map +1 -1
- package/server/authentication/auth.e2e-spec.js +1 -5
- package/server/authentication/auth.e2e-spec.js.map +1 -1
- package/server/authentication/auth.module.js +17 -20
- package/server/authentication/auth.module.js.map +1 -1
- package/server/authentication/{services/auth-manager.service.js → auth.service.js} +41 -18
- package/server/authentication/auth.service.js.map +1 -0
- package/server/authentication/{services/auth-manager.service.spec.js → auth.service.spec.js} +6 -10
- package/server/authentication/auth.service.spec.js.map +1 -0
- package/server/authentication/constants/auth.js +1 -5
- package/server/authentication/constants/auth.js.map +1 -1
- package/server/authentication/constants/routes.js +41 -30
- package/server/authentication/constants/routes.js.map +1 -1
- package/server/authentication/constants/scope.js +2 -5
- package/server/authentication/constants/scope.js.map +1 -1
- package/server/authentication/decorators/auth-token-optional.decorator.js +1 -5
- package/server/authentication/decorators/auth-token-optional.decorator.js.map +1 -1
- package/server/authentication/decorators/auth-token-skip.decorator.js +1 -5
- package/server/authentication/decorators/auth-token-skip.decorator.js.map +1 -1
- package/server/authentication/dto/login-response.dto.js +1 -10
- package/server/authentication/dto/login-response.dto.js.map +1 -1
- package/server/authentication/dto/token-response.dto.js +1 -5
- package/server/authentication/dto/token-response.dto.js.map +1 -1
- package/server/authentication/guards/auth-anonymous.guard.js +1 -5
- package/server/authentication/guards/auth-anonymous.guard.js.map +1 -1
- package/server/authentication/guards/auth-anonymous.guard.spec.js +1 -5
- package/server/authentication/guards/auth-anonymous.guard.spec.js.map +1 -1
- package/server/authentication/guards/auth-anonymous.strategy.js +1 -5
- package/server/authentication/guards/auth-anonymous.strategy.js.map +1 -1
- package/server/authentication/guards/auth-basic.guard.js +1 -5
- package/server/authentication/guards/auth-basic.guard.js.map +1 -1
- package/server/authentication/guards/auth-basic.guard.spec.js +13 -14
- package/server/authentication/guards/auth-basic.guard.spec.js.map +1 -1
- package/server/authentication/guards/auth-basic.strategy.js +10 -11
- package/server/authentication/guards/auth-basic.strategy.js.map +1 -1
- package/server/authentication/guards/auth-digest.guard.js +1 -5
- package/server/authentication/guards/auth-digest.guard.js.map +1 -1
- package/server/authentication/guards/auth-digest.strategy.js +1 -5
- package/server/authentication/guards/auth-digest.strategy.js.map +1 -1
- package/server/authentication/guards/auth-local.guard.js +1 -5
- package/server/authentication/guards/auth-local.guard.js.map +1 -1
- package/server/authentication/guards/auth-local.guard.spec.js +9 -13
- package/server/authentication/guards/auth-local.guard.spec.js.map +1 -1
- package/server/authentication/guards/auth-local.strategy.js +6 -10
- package/server/authentication/guards/auth-local.strategy.js.map +1 -1
- package/server/authentication/guards/auth-token-access.guard.js +1 -5
- package/server/authentication/guards/auth-token-access.guard.js.map +1 -1
- package/server/authentication/guards/auth-token-access.guard.spec.js +3 -7
- package/server/authentication/guards/auth-token-access.guard.spec.js.map +1 -1
- package/server/authentication/guards/auth-token-access.strategy.js +3 -7
- package/server/authentication/guards/auth-token-access.strategy.js.map +1 -1
- package/server/authentication/guards/auth-token-refresh.guard.js +1 -5
- package/server/authentication/guards/auth-token-refresh.guard.js.map +1 -1
- package/server/authentication/guards/auth-token-refresh.guard.spec.js +3 -7
- package/server/authentication/guards/auth-token-refresh.guard.spec.js.map +1 -1
- package/server/authentication/guards/auth-token-refresh.strategy.js +3 -7
- package/server/authentication/guards/auth-token-refresh.strategy.js.map +1 -1
- package/server/authentication/guards/implementations/http-basic.strategy.js +1 -5
- package/server/authentication/guards/implementations/http-basic.strategy.js.map +1 -1
- package/server/authentication/guards/implementations/http-digest.strategy.js +1 -5
- package/server/authentication/guards/implementations/http-digest.strategy.js.map +1 -1
- package/server/authentication/interfaces/auth-request.interface.js +1 -5
- package/server/authentication/interfaces/auth-request.interface.js.map +1 -1
- package/server/authentication/interfaces/jwt-payload.interface.js +1 -5
- package/server/authentication/interfaces/jwt-payload.interface.js.map +1 -1
- package/server/authentication/interfaces/token.interface.js +1 -5
- package/server/authentication/interfaces/token.interface.js.map +1 -1
- package/server/authentication/providers/auth-providers.constants.js +18 -0
- package/server/authentication/providers/auth-providers.constants.js.map +1 -0
- package/server/authentication/providers/auth-providers.models.js +14 -0
- package/server/authentication/providers/auth-providers.models.js.map +1 -0
- package/server/authentication/providers/auth-providers.utils.js +42 -0
- package/server/authentication/providers/auth-providers.utils.js.map +1 -0
- package/server/authentication/providers/ldap/auth-ldap.config.js +143 -0
- package/server/authentication/providers/ldap/auth-ldap.config.js.map +1 -0
- package/server/authentication/{constants/auth-ldap.js → providers/ldap/auth-ldap.constants.js} +12 -6
- package/server/authentication/providers/ldap/auth-ldap.constants.js.map +1 -0
- package/server/authentication/providers/ldap/auth-provider-ldap.service.js +506 -0
- package/server/authentication/providers/ldap/auth-provider-ldap.service.js.map +1 -0
- package/server/authentication/providers/ldap/auth-provider-ldap.service.spec.js +674 -0
- package/server/authentication/providers/ldap/auth-provider-ldap.service.spec.js.map +1 -0
- package/server/authentication/{services/auth-methods/auth-method-database.service.js → providers/mysql/auth-provider-mysql.service.js} +16 -14
- package/server/authentication/providers/mysql/auth-provider-mysql.service.js.map +1 -0
- package/server/authentication/{services/auth-methods/auth-method-database.service.spec.js → providers/mysql/auth-provider-mysql.service.spec.js} +15 -19
- package/server/authentication/providers/mysql/auth-provider-mysql.service.spec.js.map +1 -0
- package/server/authentication/providers/oidc/auth-oidc-desktop.constants.js +30 -0
- package/server/authentication/providers/oidc/auth-oidc-desktop.constants.js.map +1 -0
- package/server/authentication/providers/oidc/auth-oidc.config.js +149 -0
- package/server/authentication/providers/oidc/auth-oidc.config.js.map +1 -0
- package/server/authentication/providers/oidc/auth-oidc.constants.js +39 -0
- package/server/authentication/providers/oidc/auth-oidc.constants.js.map +1 -0
- package/server/authentication/providers/oidc/auth-oidc.controller.js +83 -0
- package/server/authentication/providers/oidc/auth-oidc.controller.js.map +1 -0
- package/server/authentication/providers/oidc/auth-oidc.interfaces.js +6 -0
- package/server/authentication/providers/oidc/auth-oidc.interfaces.js.map +1 -0
- package/server/authentication/providers/oidc/auth-provider-oidc.module.js +36 -0
- package/server/authentication/providers/oidc/auth-provider-oidc.module.js.map +1 -0
- package/server/authentication/providers/oidc/auth-provider-oidc.service.js +373 -0
- package/server/authentication/providers/oidc/auth-provider-oidc.service.js.map +1 -0
- package/server/authentication/providers/oidc/auth-provider-oidc.service.spec.js +270 -0
- package/server/authentication/providers/oidc/auth-provider-oidc.service.spec.js.map +1 -0
- package/server/authentication/{services/auth-methods/auth-method-two-fa.service.js → providers/two-fa/auth-provider-two-fa.service.js} +56 -38
- package/server/authentication/providers/two-fa/auth-provider-two-fa.service.js.map +1 -0
- 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
- package/server/authentication/providers/two-fa/auth-provider-two-fa.service.spec.js.map +1 -0
- package/server/authentication/{guards → providers/two-fa}/auth-two-fa-guard.js +10 -14
- package/server/authentication/providers/two-fa/auth-two-fa-guard.js.map +1 -0
- package/server/authentication/providers/two-fa/auth-two-fa.config.js +57 -0
- package/server/authentication/providers/two-fa/auth-two-fa.config.js.map +1 -0
- package/server/authentication/{dto/two-fa-verify.dto.js → providers/two-fa/auth-two-fa.dtos.js} +8 -6
- package/server/authentication/providers/two-fa/auth-two-fa.dtos.js.map +1 -0
- package/server/authentication/providers/two-fa/auth-two-fa.interfaces.js +6 -0
- package/server/authentication/providers/two-fa/auth-two-fa.interfaces.js.map +1 -0
- package/server/authentication/utils/crypt-secret.js +1 -5
- package/server/authentication/utils/crypt-secret.js.map +1 -1
- package/server/common/constants.js +1 -5
- package/server/common/constants.js.map +1 -1
- package/server/common/decorators.js +1 -5
- package/server/common/decorators.js.map +1 -1
- package/server/common/functions.js +25 -9
- package/server/common/functions.js.map +1 -1
- package/server/common/i18n.js +1 -5
- package/server/common/i18n.js.map +1 -1
- package/server/common/image.js +1 -5
- package/server/common/image.js.map +1 -1
- package/server/common/interfaces.js +1 -5
- package/server/common/interfaces.js.map +1 -1
- package/server/common/qrcode.js +1 -5
- package/server/common/qrcode.js.map +1 -1
- package/server/common/shared.js +6 -6
- package/server/common/shared.js.map +1 -1
- package/server/configuration/config.constants.js +1 -5
- package/server/configuration/config.constants.js.map +1 -1
- package/server/configuration/config.environment.js +2 -6
- package/server/configuration/config.environment.js.map +1 -1
- package/server/configuration/config.interfaces.js +1 -5
- package/server/configuration/config.interfaces.js.map +1 -1
- package/server/configuration/config.loader.js +1 -5
- package/server/configuration/config.loader.js.map +1 -1
- package/server/configuration/config.logger.js +4 -8
- package/server/configuration/config.logger.js.map +1 -1
- package/server/configuration/config.validation.js +7 -5
- package/server/configuration/config.validation.js.map +1 -1
- package/server/infrastructure/cache/adapters/mysql-cache.adapter.js +9 -7
- package/server/infrastructure/cache/adapters/mysql-cache.adapter.js.map +1 -1
- package/server/infrastructure/cache/adapters/redis-cache.adapter.js +1 -5
- package/server/infrastructure/cache/adapters/redis-cache.adapter.js.map +1 -1
- package/server/infrastructure/cache/cache.config.js +1 -5
- package/server/infrastructure/cache/cache.config.js.map +1 -1
- package/server/infrastructure/cache/cache.decorator.js +9 -7
- package/server/infrastructure/cache/cache.decorator.js.map +1 -1
- package/server/infrastructure/cache/cache.e2e-spec.js +1 -5
- package/server/infrastructure/cache/cache.e2e-spec.js.map +1 -1
- package/server/infrastructure/cache/cache.module.js +1 -5
- package/server/infrastructure/cache/cache.module.js.map +1 -1
- package/server/infrastructure/cache/schemas/mysql-cache.interface.js +1 -5
- package/server/infrastructure/cache/schemas/mysql-cache.interface.js.map +1 -1
- package/server/infrastructure/cache/schemas/mysql-cache.schema.js +1 -5
- package/server/infrastructure/cache/schemas/mysql-cache.schema.js.map +1 -1
- package/server/infrastructure/cache/services/cache.service.js +1 -5
- package/server/infrastructure/cache/services/cache.service.js.map +1 -1
- package/server/infrastructure/context/context.module.js +1 -5
- package/server/infrastructure/context/context.module.js.map +1 -1
- package/server/infrastructure/context/interceptors/context.interceptor.js +1 -5
- package/server/infrastructure/context/interceptors/context.interceptor.js.map +1 -1
- package/server/infrastructure/context/interceptors/context.interceptor.spec.js +2 -6
- package/server/infrastructure/context/interceptors/context.interceptor.spec.js.map +1 -1
- package/server/infrastructure/context/interfaces/context-store.interface.js +1 -5
- package/server/infrastructure/context/interfaces/context-store.interface.js.map +1 -1
- package/server/infrastructure/context/services/context-manager.service.js +1 -5
- package/server/infrastructure/context/services/context-manager.service.js.map +1 -1
- package/server/infrastructure/context/services/context-manager.service.spec.js +1 -5
- package/server/infrastructure/context/services/context-manager.service.spec.js.map +1 -1
- package/server/infrastructure/database/columns.js +1 -5
- package/server/infrastructure/database/columns.js.map +1 -1
- package/server/infrastructure/database/configuration.js +1 -5
- package/server/infrastructure/database/configuration.js.map +1 -1
- package/server/infrastructure/database/constants.js +2 -6
- package/server/infrastructure/database/constants.js.map +1 -1
- package/server/infrastructure/database/database.config.js +1 -5
- package/server/infrastructure/database/database.config.js.map +1 -1
- package/server/infrastructure/database/database.logger.js +1 -5
- package/server/infrastructure/database/database.logger.js.map +1 -1
- package/server/infrastructure/database/database.module.js +1 -5
- package/server/infrastructure/database/database.module.js.map +1 -1
- package/server/infrastructure/database/interfaces/database.interface.js +1 -5
- package/server/infrastructure/database/interfaces/database.interface.js.map +1 -1
- package/server/infrastructure/database/schema.js +1 -5
- package/server/infrastructure/database/schema.js.map +1 -1
- package/server/infrastructure/database/scripts/create-user.js +1 -5
- package/server/infrastructure/database/scripts/create-user.js.map +1 -1
- package/server/infrastructure/database/scripts/db.js +1 -5
- package/server/infrastructure/database/scripts/db.js.map +1 -1
- package/server/infrastructure/database/scripts/seed/main.js +1 -5
- package/server/infrastructure/database/scripts/seed/main.js.map +1 -1
- package/server/infrastructure/database/scripts/seed/usersgroups.js +1 -5
- package/server/infrastructure/database/scripts/seed/usersgroups.js.map +1 -1
- package/server/infrastructure/database/utils.js +1 -5
- package/server/infrastructure/database/utils.js.map +1 -1
- package/server/infrastructure/mailer/interfaces/mail.interface.js +1 -5
- package/server/infrastructure/mailer/interfaces/mail.interface.js.map +1 -1
- package/server/infrastructure/mailer/mailer.config.js +1 -5
- package/server/infrastructure/mailer/mailer.config.js.map +1 -1
- package/server/infrastructure/mailer/mailer.module.js +1 -5
- package/server/infrastructure/mailer/mailer.module.js.map +1 -1
- package/server/infrastructure/mailer/mailer.service.js +1 -5
- package/server/infrastructure/mailer/mailer.service.js.map +1 -1
- package/server/infrastructure/mailer/mailer.service.spec.js +2 -6
- package/server/infrastructure/mailer/mailer.service.spec.js.map +1 -1
- package/server/infrastructure/scheduler/scheduler.constants.js +1 -5
- package/server/infrastructure/scheduler/scheduler.constants.js.map +1 -1
- package/server/infrastructure/scheduler/scheduler.module.js +1 -5
- package/server/infrastructure/scheduler/scheduler.module.js.map +1 -1
- package/server/infrastructure/websocket/adapters/cluster.adapter.js +1 -5
- package/server/infrastructure/websocket/adapters/cluster.adapter.js.map +1 -1
- package/server/infrastructure/websocket/adapters/redis.adapter.js +1 -5
- package/server/infrastructure/websocket/adapters/redis.adapter.js.map +1 -1
- package/server/infrastructure/websocket/adapters/web-socket.adapter.js +1 -5
- package/server/infrastructure/websocket/adapters/web-socket.adapter.js.map +1 -1
- package/server/infrastructure/websocket/decorators/web-socket-user.decorator.js +1 -5
- package/server/infrastructure/websocket/decorators/web-socket-user.decorator.js.map +1 -1
- package/server/infrastructure/websocket/interfaces/auth-socket-io.interface.js +1 -5
- package/server/infrastructure/websocket/interfaces/auth-socket-io.interface.js.map +1 -1
- package/server/infrastructure/websocket/utils.js +1 -5
- package/server/infrastructure/websocket/utils.js.map +1 -1
- package/server/infrastructure/websocket/web-socket.config.js +1 -5
- package/server/infrastructure/websocket/web-socket.config.js.map +1 -1
- package/server/main.js +5 -0
- package/server/main.js.map +1 -1
- package/static/assets/pdfjs/build/pdf.mjs +724 -745
- package/static/assets/pdfjs/build/pdf.mjs.map +1 -1
- package/static/assets/pdfjs/build/pdf.sandbox.mjs +2 -2
- package/static/assets/pdfjs/build/pdf.worker.mjs +706 -193
- package/static/assets/pdfjs/build/pdf.worker.mjs.map +1 -1
- package/static/assets/pdfjs/version +1 -1
- package/static/assets/pdfjs/web/locale/dsb/viewer.ftl +5 -5
- package/static/assets/pdfjs/web/locale/en-US/viewer.ftl +1 -0
- package/static/assets/pdfjs/web/locale/fur/viewer.ftl +5 -0
- package/static/assets/pdfjs/web/locale/kk/viewer.ftl +28 -0
- package/static/assets/pdfjs/web/locale/ml/viewer.ftl +4 -0
- package/static/assets/pdfjs/web/locale/ru/viewer.ftl +3 -3
- package/static/assets/pdfjs/web/viewer.css +207 -65
- package/static/assets/pdfjs/web/viewer.html +11 -10
- package/static/assets/pdfjs/web/viewer.mjs +850 -270
- package/static/assets/pdfjs/web/viewer.mjs.map +1 -1
- package/static/assets/pdfjs/web/wasm/LICENSE_JBIG2 +196 -0
- package/static/assets/pdfjs/web/wasm/LICENSE_PDFJS_JBIG2 +13 -0
- package/static/assets/pdfjs/web/wasm/jbig2.wasm +0 -0
- package/static/chunk-22TZP6HW.js +1 -0
- package/static/{chunk-G7TLKY5X.js → chunk-27ATUHBH.js} +1 -1
- package/static/{chunk-CQOQXVYG.js → chunk-2CKLZ3FM.js} +1 -1
- package/static/{chunk-FVFOX6OP.js → chunk-2QZPX7LO.js} +1 -1
- package/static/{chunk-32AVRWC3.js → chunk-2R6IBBPZ.js} +1 -1
- package/static/{chunk-76JDXKD7.js → chunk-4FIGEBNL.js} +1 -1
- package/static/{chunk-ACCGBDUZ.js → chunk-4P3JABAP.js} +4 -4
- package/static/chunk-5CZOSAMZ.js +1 -0
- package/static/{chunk-2PDTP6N4.js → chunk-677WUBCT.js} +1 -1
- package/static/{chunk-K5VO5XTG.js → chunk-74CAHBFM.js} +1 -1
- package/static/{chunk-WTWGBCFO.js → chunk-7GWW6MJO.js} +1 -1
- package/static/{chunk-JXZOYX4N.js → chunk-A4UGPSWX.js} +1 -1
- package/static/{chunk-44D7RWET.js → chunk-AHO37FKW.js} +1 -1
- package/static/{chunk-WB2DECOA.js → chunk-AQCXMKP3.js} +1 -1
- package/static/chunk-B6PDYCRO.js +3 -0
- package/static/{chunk-JVGN5V5E.js → chunk-CU76ATCF.js} +1 -1
- package/static/{chunk-Q5K4ZUHK.js → chunk-CWYHOPOP.js} +1 -1
- package/static/{chunk-IOX3ANJR.js → chunk-E5WI5725.js} +1 -1
- package/static/{chunk-NUG54Y65.js → chunk-FC5HTKVM.js} +1 -1
- package/static/{chunk-LRK6RNPR.js → chunk-FOSM7EYI.js} +1 -1
- package/static/{chunk-B4UP2EQM.js → chunk-GAZO25PI.js} +1 -1
- package/static/{chunk-3WBCGTYW.js → chunk-GB7ABR5N.js} +1 -1
- package/static/{chunk-XFZ37WVK.js → chunk-GEHFKZQ5.js} +1 -1
- package/static/{chunk-4CQLN5HL.js → chunk-GQFMWVFD.js} +1 -1
- package/static/{chunk-YBEH442D.js → chunk-GVNTC564.js} +1 -1
- package/static/{chunk-WO6GBHBZ.js → chunk-HGL3NYP2.js} +2 -2
- package/static/{chunk-IAWRRL6J.js → chunk-HLIWPWRA.js} +1 -1
- package/static/{chunk-6LHJBXUE.js → chunk-HNYB3M4S.js} +1 -1
- package/static/{chunk-5WTIUYFF.js → chunk-HUXAUQMN.js} +1 -1
- package/static/{chunk-VBH3Y2M5.js → chunk-I2XA6PPK.js} +1 -1
- package/static/{chunk-I3XI72AV.js → chunk-ISV3BO6R.js} +1 -1
- package/static/{chunk-P7X53PEP.js → chunk-JV3AGU5B.js} +1 -1
- package/static/{chunk-ZFAXICUH.js → chunk-K25E7YGG.js} +1 -1
- package/static/{chunk-CAD3RHAY.js → chunk-K46PUTZB.js} +1 -1
- package/static/{chunk-GYFLVCFN.js → chunk-KERFLJ56.js} +1 -7
- package/static/{chunk-WSTGWBVW.js → chunk-KJD3KFF3.js} +1 -1
- package/static/{chunk-R4P4NBUL.js → chunk-KPKSI23S.js} +1 -1
- package/static/{chunk-M7IFVC5D.js → chunk-KZS7CTNR.js} +1 -1
- package/static/{chunk-P2IJCGWD.js → chunk-L5IHUVXL.js} +1 -1
- package/static/{chunk-DXESTGOH.js → chunk-L7RRX2M3.js} +1 -1
- package/static/{chunk-WE3ISL7O.js → chunk-LGWJ2WKU.js} +1 -1
- package/static/{chunk-OKI3N5AI.js → chunk-MLC7JK2H.js} +2 -2
- package/static/{chunk-NG7QWUFM.js → chunk-MOHNYW2A.js} +1 -1
- package/static/{chunk-SQYWQUL4.js → chunk-NCDUOVMW.js} +1 -1
- package/static/chunk-NGUAJIGI.js +1 -0
- package/static/{chunk-OYPJUVD6.js → chunk-NIPP6JDI.js} +1 -1
- package/static/{chunk-Y433XOAJ.js → chunk-NMTBMHUL.js} +1 -1
- package/static/chunk-O4XXMZFX.js +4 -0
- package/static/{chunk-IOP3ON2H.js → chunk-OANZITPM.js} +1 -1
- package/static/{chunk-WJFKUJJX.js → chunk-OGE4SAHU.js} +1 -1
- package/static/{chunk-7EHP6HO3.js → chunk-OI3ME22C.js} +1 -1
- package/static/{chunk-D4XDSS6P.js → chunk-Q3EGCMF5.js} +1 -1
- package/static/{chunk-TQBCGNFG.js → chunk-QF2NSHZA.js} +1 -1
- package/static/{chunk-RBBMH2FM.js → chunk-QKN6LAAA.js} +1 -1
- package/static/{chunk-J45SD6RC.js → chunk-QRFESU5O.js} +2 -2
- package/static/chunk-QVRVFYJH.js +1 -0
- package/static/{chunk-BAHNSFET.js → chunk-RFJIPIOK.js} +1 -1
- package/static/{chunk-IZ7TCHUW.js → chunk-RLL634K4.js} +1 -1
- package/static/{chunk-MOWL3ILT.js → chunk-RS2OFKWP.js} +1 -1
- package/static/{chunk-WM56LPJ3.js → chunk-RWAAC3A4.js} +1 -1
- package/static/{chunk-F3GMI6OL.js → chunk-S5Y64DDS.js} +1 -1
- package/static/{chunk-VNNLMUK7.js → chunk-SLG5KDU6.js} +1 -1
- package/static/chunk-TJ4CVFEL.js +1 -0
- package/static/{chunk-SAN35XTD.js → chunk-TWCGKSYE.js} +1 -1
- package/static/{chunk-EUKVDBBK.js → chunk-UMDRE4S7.js} +1 -1
- package/static/{chunk-YKCUUBZP.js → chunk-VRIOLRYR.js} +4 -4
- package/static/chunk-VS4O2XDP.js +1 -0
- package/static/{chunk-2MRTBCSV.js → chunk-VSBFNFOM.js} +1 -1
- package/static/{chunk-CTPKDDVI.js → chunk-WN4WXCVK.js} +1 -1
- package/static/{chunk-2AA3WMW5.js → chunk-WX7RXW7K.js} +1 -1
- package/static/{chunk-J2BUPRCZ.js → chunk-XC4POKR3.js} +2 -2
- package/static/{chunk-AXLDYLIO.js → chunk-Y4AUYQTG.js} +1 -1
- package/static/{chunk-RPHWIW7S.js → chunk-YMIXHRJQ.js} +1 -7
- package/static/{chunk-AFNUBQMD.js → chunk-ZUNKFAKP.js} +1 -1
- package/static/index.html +3 -3
- package/static/main-QN4UCOC5.js +5 -0
- package/static/{styles-PD6764CP.css → styles-46GLIE7Y.css} +1 -1
- package/server/authentication/constants/auth-ldap.js.map +0 -1
- package/server/authentication/dto/two-fa-verify.dto.js.map +0 -1
- package/server/authentication/guards/auth-two-fa-guard.js.map +0 -1
- package/server/authentication/interfaces/two-fa-setup.interface.js +0 -10
- package/server/authentication/interfaces/two-fa-setup.interface.js.map +0 -1
- package/server/authentication/models/auth-method.js +0 -18
- package/server/authentication/models/auth-method.js.map +0 -1
- package/server/authentication/services/auth-manager.service.js.map +0 -1
- package/server/authentication/services/auth-manager.service.spec.js.map +0 -1
- package/server/authentication/services/auth-methods/auth-method-database.service.js.map +0 -1
- package/server/authentication/services/auth-methods/auth-method-database.service.spec.js.map +0 -1
- package/server/authentication/services/auth-methods/auth-method-ldap.service.js +0 -326
- package/server/authentication/services/auth-methods/auth-method-ldap.service.js.map +0 -1
- package/server/authentication/services/auth-methods/auth-method-ldap.service.spec.js +0 -534
- package/server/authentication/services/auth-methods/auth-method-ldap.service.spec.js.map +0 -1
- package/server/authentication/services/auth-methods/auth-method-two-fa.service.js.map +0 -1
- package/server/authentication/services/auth-methods/auth-method-two-fa.service.spec.js.map +0 -1
- package/static/chunk-3I6NPM62.js +0 -1
- package/static/chunk-GCPX3EFC.js +0 -1
- package/static/chunk-KBUIDMCK.js +0 -1
- package/static/chunk-KY6MNZLC.js +0 -1
- package/static/chunk-MPWD4VMY.js +0 -1
- package/static/chunk-QQAF3MLL.js +0 -1
- package/static/chunk-VHZKPUWE.js +0 -4
- package/static/chunk-YWLMFOB4.js +0 -3
- package/static/main-ZXEMCBMI.js +0 -11
|
@@ -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
|
});
|
|
@@ -66,7 +62,10 @@ let FilesLockManager = class FilesLockManager {
|
|
|
66
62
|
expiration: expiration,
|
|
67
63
|
options: options
|
|
68
64
|
};
|
|
69
|
-
this.logger.verbose(
|
|
65
|
+
this.logger.verbose({
|
|
66
|
+
tag: this.create.name,
|
|
67
|
+
msg: `${key}`
|
|
68
|
+
});
|
|
70
69
|
await this.cache.set(key, lock, ttl);
|
|
71
70
|
return [
|
|
72
71
|
true,
|
|
@@ -84,7 +83,10 @@ let FilesLockManager = class FilesLockManager {
|
|
|
84
83
|
// Refresh if more than half of the TTL has passed
|
|
85
84
|
const mustRefresh = lock.expiration - (0, _shared.currentTimeStamp)() < ttl / 2;
|
|
86
85
|
if (mustRefresh) {
|
|
87
|
-
this.refreshLockTimeout(lock, ttl).catch((e)=>this.logger.error(
|
|
86
|
+
this.refreshLockTimeout(lock, ttl).catch((e)=>this.logger.error({
|
|
87
|
+
tag: this.createOrRefresh.name,
|
|
88
|
+
msg: `${e}`
|
|
89
|
+
}));
|
|
88
90
|
}
|
|
89
91
|
} else {
|
|
90
92
|
throw new _filelockerror.LockConflict(lock, 'Conflicting lock');
|
|
@@ -106,7 +108,10 @@ let FilesLockManager = class FilesLockManager {
|
|
|
106
108
|
];
|
|
107
109
|
}
|
|
108
110
|
removeLock(key) {
|
|
109
|
-
this.logger.verbose(
|
|
111
|
+
this.logger.verbose({
|
|
112
|
+
tag: this.removeLock.name,
|
|
113
|
+
msg: `${key}`
|
|
114
|
+
});
|
|
110
115
|
return this.cache.del(key);
|
|
111
116
|
}
|
|
112
117
|
async removeChildLocks(user, dbFile) {
|
|
@@ -117,11 +122,17 @@ let FilesLockManager = class FilesLockManager {
|
|
|
117
122
|
continue;
|
|
118
123
|
}
|
|
119
124
|
const conflict = `cannot remove conflicting child lock : ${dbFile.path} (${user.login}) -> ${lock.dbFilePath} (${lock.owner.login})`;
|
|
120
|
-
this.logger.debug(
|
|
125
|
+
this.logger.debug({
|
|
126
|
+
tag: this.removeChildLocks.name,
|
|
127
|
+
msg: `${conflict}`
|
|
128
|
+
});
|
|
121
129
|
throw new _filelockerror.LockConflict(lock, conflict);
|
|
122
130
|
}
|
|
123
131
|
for (const key of ownedLockKeys){
|
|
124
|
-
this.logger.verbose(
|
|
132
|
+
this.logger.verbose({
|
|
133
|
+
tag: this.removeChildLocks.name,
|
|
134
|
+
msg: `child locks: ${key}`
|
|
135
|
+
});
|
|
125
136
|
await this.removeLock(key);
|
|
126
137
|
}
|
|
127
138
|
}
|
|
@@ -154,7 +165,10 @@ let FilesLockManager = class FilesLockManager {
|
|
|
154
165
|
}
|
|
155
166
|
async refreshLockTimeout(lock, ttl) {
|
|
156
167
|
lock.expiration = (0, _shared.currentTimeStamp)() + ttl;
|
|
157
|
-
this.cache.set(lock.key, lock, ttl).catch((e)=>this.logger.error(
|
|
168
|
+
this.cache.set(lock.key, lock, ttl).catch((e)=>this.logger.error({
|
|
169
|
+
tag: this.refreshLockTimeout.name,
|
|
170
|
+
msg: `${e}`
|
|
171
|
+
}));
|
|
158
172
|
}
|
|
159
173
|
async getLockByToken(token) {
|
|
160
174
|
const key = await this.searchKeyByToken(token);
|
|
@@ -194,7 +208,10 @@ let FilesLockManager = class FilesLockManager {
|
|
|
194
208
|
continue;
|
|
195
209
|
}
|
|
196
210
|
const conflict = `conflicting parent lock : ${dbFile.path} -> ${l.dbFilePath} (${l.owner.login})`;
|
|
197
|
-
this.logger.debug(
|
|
211
|
+
this.logger.debug({
|
|
212
|
+
tag: this.checkConflicts.name,
|
|
213
|
+
msg: `${conflict}`
|
|
214
|
+
});
|
|
198
215
|
throw new _filelockerror.LockConflict(l, conflict);
|
|
199
216
|
}
|
|
200
217
|
if (depth === _webdav.DEPTH.INFINITY) {
|
|
@@ -203,7 +220,10 @@ let FilesLockManager = class FilesLockManager {
|
|
|
203
220
|
continue;
|
|
204
221
|
}
|
|
205
222
|
const conflict = `conflicting child lock : ${dbFile.path} -> ${l.dbFilePath} (${l.owner.login})`;
|
|
206
|
-
this.logger.debug(
|
|
223
|
+
this.logger.debug({
|
|
224
|
+
tag: this.checkConflicts.name,
|
|
225
|
+
msg: `${conflict}`
|
|
226
|
+
});
|
|
207
227
|
throw new _filelockerror.LockConflict(l, conflict);
|
|
208
228
|
}
|
|
209
229
|
}
|
|
@@ -213,11 +233,17 @@ let FilesLockManager = class FilesLockManager {
|
|
|
213
233
|
ignorePath: true
|
|
214
234
|
});
|
|
215
235
|
const path = dbFile.path === '.' ? '*' : `${dbFile.path}/*`;
|
|
216
|
-
this.logger.verbose(
|
|
236
|
+
this.logger.verbose({
|
|
237
|
+
tag: this.searchChildLocks.name,
|
|
238
|
+
msg: `${path} (${props})`
|
|
239
|
+
});
|
|
217
240
|
const keys = await this.searchKeysByPath(path, props);
|
|
218
241
|
if (keys.length) {
|
|
219
242
|
for (const l of (await this.cache.mget(keys)).filter(Boolean)){
|
|
220
|
-
this.logger.verbose(
|
|
243
|
+
this.logger.verbose({
|
|
244
|
+
tag: this.searchChildLocks.name,
|
|
245
|
+
msg: `-> ${l.dbFilePath} (owner: ${l.owner.login})`
|
|
246
|
+
});
|
|
221
247
|
yield l;
|
|
222
248
|
}
|
|
223
249
|
}
|
|
@@ -240,7 +266,10 @@ let FilesLockManager = class FilesLockManager {
|
|
|
240
266
|
});
|
|
241
267
|
let path = dbFile.path;
|
|
242
268
|
const parentPath = (0, _files.dirName)(path);
|
|
243
|
-
this.logger.verbose(
|
|
269
|
+
this.logger.verbose({
|
|
270
|
+
tag: this.searchParentLocks.name,
|
|
271
|
+
msg: `(including root : ${options.includeRoot}) : ${path} (${props})`
|
|
272
|
+
});
|
|
244
273
|
if (!options.includeRoot) {
|
|
245
274
|
path = (0, _files.dirName)(path);
|
|
246
275
|
}
|
|
@@ -250,7 +279,10 @@ let FilesLockManager = class FilesLockManager {
|
|
|
250
279
|
const keys = await this.searchKeysByPath(path, props, depth);
|
|
251
280
|
if (keys.length) {
|
|
252
281
|
for (const l of (await this.cache.mget(keys)).filter(Boolean)){
|
|
253
|
-
this.logger.verbose(
|
|
282
|
+
this.logger.verbose({
|
|
283
|
+
tag: this.searchParentLocks.name,
|
|
284
|
+
msg: `-> ${l.dbFilePath}`
|
|
285
|
+
});
|
|
254
286
|
yield l;
|
|
255
287
|
}
|
|
256
288
|
}
|
|
@@ -262,7 +294,10 @@ let FilesLockManager = class FilesLockManager {
|
|
|
262
294
|
if (!keys.length) {
|
|
263
295
|
return null;
|
|
264
296
|
} else if (keys.length > 1) {
|
|
265
|
-
this.logger.warn(
|
|
297
|
+
this.logger.warn({
|
|
298
|
+
tag: this.searchKeyByToken.name,
|
|
299
|
+
msg: `Several keys found for token : ${token} => ${JSON.stringify(keys)}`
|
|
300
|
+
});
|
|
266
301
|
}
|
|
267
302
|
return keys[0];
|
|
268
303
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../backend/src/applications/files/services/files-lock-manager.service.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 { Injectable, Logger } from '@nestjs/common'\nimport crypto from 'node:crypto'\n\nimport { currentTimeStamp } from '../../../common/shared'\nimport { Cache } from '../../../infrastructure/cache/services/cache.service'\nimport { UserModel } from '../../users/models/user.model'\nimport { DEPTH, LOCK_DEPTH, LOCK_PREFIX, LOCK_SCOPE } from '../../webdav/constants/webdav'\nimport { CACHE_LOCK_DEFAULT_TTL, CACHE_LOCK_PREFIX } from '../constants/cache'\nimport { FileDBProps } from '../interfaces/file-db-props.interface'\nimport { FileLock, FileLockOptions, LOCK_APP } from '../interfaces/file-lock.interface'\nimport { FileLockProps } from '../interfaces/file-props.interface'\nimport { LockConflict } from '../models/file-lock-error'\nimport { files } from '../schemas/files.schema'\nimport { dirName, fileName } from '../utils/files'\n\n@Injectable()\nexport class FilesLockManager {\n /* Philosophy\n Currently this manager only handles conflicting locks between multiple users, not between clients\n - The locks created from api\n * They do not contain a token key or a davLock property\n * They are exclusive only\n * They must have a depth of 'infinity' (all children) or '0' (root and root members)\n - The locks created from WebDAV or OnlyOffice or CollaboraOnline are stored with a token and a davLock property\n * They must have a depth of 'infinity' (all children) or '0' (root and root members)\n * They can be exclusive (WebDAV) or shared (OnlyOffice, CollaboraOnline)\n * If created with WebDAV, they are stored with a token and a davLock property\n * If created with OnlyOffice, they are stored with no token and a davLock property whose `locktoken` & `lockroot` properties are `null`\n * If created with CollaboraOnline, they are stored with token and a davLock property whose `lockroot` property is `null`\n Cache token key format = `flock|token?:${uuid}|path:${path}|ownerId?:${number}|spaceId?:${number}|...props` => FileLock\n */\n private readonly logger = new Logger(FilesLockManager.name)\n\n constructor(private readonly cache: Cache) {}\n\n async create(\n user: UserModel,\n dbFile: FileDBProps,\n app: LOCK_APP,\n depth: LOCK_DEPTH,\n options?: FileLockOptions,\n ttl?: number\n ): Promise<[boolean, FileLock]> {\n try {\n await this.checkConflicts(dbFile, depth, { app: app, lockScope: options?.lockScope })\n } catch (e) {\n if (e instanceof LockConflict) {\n return [false, e.lock]\n }\n throw new Error(e)\n }\n ttl ??= CACHE_LOCK_DEFAULT_TTL\n const key = `${CACHE_LOCK_PREFIX}|${this.genSuffixKey(dbFile, { depth: depth, token: options?.lockToken })}`\n const expiration = Math.floor(currentTimeStamp() + ttl)\n const lock: FileLock = {\n owner: user.asOwner(),\n dbFilePath: dbFile.path,\n key: key,\n app: app,\n depth: depth,\n expiration: expiration,\n options: options\n }\n this.logger.verbose(`${this.create.name} - ${key}`)\n await this.cache.set(key, lock, ttl)\n return [true, lock]\n }\n\n async createOrRefresh(user: UserModel, dbFile: FileDBProps, app: LOCK_APP, depth: LOCK_DEPTH, ttl?: number): Promise<[boolean, FileLock]> {\n // Returns: [created, lock]\n ttl ??= CACHE_LOCK_DEFAULT_TTL\n const locks = await this.getLocksByPath(dbFile)\n // Check the existing lock and refresh it if needed\n if (locks.length > 0) {\n for (const lock of locks) {\n if (lock.owner.id === user.id) {\n // Refresh if more than half of the TTL has passed\n const mustRefresh = lock.expiration - currentTimeStamp() < ttl / 2\n if (mustRefresh) {\n this.refreshLockTimeout(lock, ttl).catch((e: Error) => this.logger.error(`${this.createOrRefresh.name} - ${e}`))\n }\n } else {\n throw new LockConflict(lock, 'Conflicting lock')\n }\n }\n return [false, locks[0]]\n }\n // Create the lock\n const [ok, lock] = await this.create(user, dbFile, app, depth, null, ttl)\n if (!ok) {\n throw new LockConflict(lock, 'Conflicting lock')\n }\n return [true, lock]\n }\n\n removeLock(key: string): Promise<boolean> {\n this.logger.verbose(`${this.removeLock.name} - ${key}`)\n return this.cache.del(key)\n }\n\n async removeChildLocks(user: UserModel, dbFile: FileDBProps) {\n const ownedLockKeys: string[] = []\n for await (const lock of this.searchChildLocks(dbFile)) {\n if (user.id === lock.owner.id) {\n ownedLockKeys.push(lock.key)\n continue\n }\n const conflict = `cannot remove conflicting child lock : ${dbFile.path} (${user.login}) -> ${lock.dbFilePath} (${lock.owner.login})`\n this.logger.debug(`${this.removeChildLocks.name} - ${conflict}`)\n throw new LockConflict(lock, conflict)\n }\n for (const key of ownedLockKeys) {\n this.logger.verbose(`${this.removeChildLocks.name} - child locks: ${key}`)\n await this.removeLock(key)\n }\n }\n\n async isLockedWithToken(token: string, dbFilePath: string): Promise<FileLock> {\n // check if the url (or any of its parents) is locked by the token\n const lock = await this.getLockByToken(token)\n return lock ? (dbFilePath.startsWith(lock.dbFilePath) ? lock : null) : null\n }\n\n async browseParentChildLocks(dbFile: FileDBProps, includeRoot = true): Promise<Record<string, FileLock>> {\n // find child locks inside the path\n const childLocks: Record<string, FileLock> = includeRoot ? await this.browseLocks(dbFile) : {}\n const lengthFilter = dbFile.path === '.' ? 1 : dbFile.path.split('/').length + 1\n for await (const lock of this.searchChildLocks(dbFile)) {\n // filter child locks on length\n if (lengthFilter === lock.dbFilePath.split('/').length) {\n // !!! locks with shared scope can have the same file name, in this case we only keep the first entry\n const dbFileName = fileName(lock.dbFilePath)\n if (!(dbFileName in childLocks)) {\n childLocks[fileName(lock.dbFilePath)] = lock\n }\n }\n }\n return childLocks\n }\n\n async browseLocks(dbFile: FileDBProps): Promise<Record<string, FileLock>> {\n return Object.fromEntries((await this.getLocksByPath(dbFile)).map((l) => [fileName(l.dbFilePath), l]))\n }\n\n async refreshLockTimeout(lock: FileLock, ttl: number) {\n lock.expiration = currentTimeStamp() + ttl\n this.cache.set(lock.key, lock, ttl).catch((e: Error) => this.logger.error(`${this.refreshLockTimeout.name} - ${e}`))\n }\n\n async getLockByToken(token: string): Promise<FileLock> {\n const key = await this.searchKeyByToken(token)\n return key ? (await this.cache.get(key)) || null : null\n }\n\n async getLocksByPath(dbFile: FileDBProps): Promise<FileLock[]> {\n if (dbFile.path !== '.') {\n const props = this.genSuffixKey(dbFile, { ignorePath: true })\n const keys = await this.searchKeysByPath(dbFile.path, props)\n if (keys.length) {\n return (await this.cache.mget(keys)).filter(Boolean)\n }\n }\n return []\n }\n\n async isPathLocked(dbFile: FileDBProps): Promise<boolean> {\n if (dbFile.path !== '.') return false\n const props = this.genSuffixKey(dbFile, { ignorePath: true })\n return !!(await this.searchKeysByPath(dbFile.path, props)).length\n }\n\n async checkConflicts(\n dbFile: FileDBProps,\n depth: LOCK_DEPTH,\n options?: { userId?: number; app?: LOCK_APP; lockScope?: LOCK_SCOPE; lockTokens?: string[] }\n ): Promise<void> {\n /* Checks if a file could be modified, created, moved, or deleted\n Throws a `LockConflict` error when there are parent locks (depth: 0) or child locks (depth: infinite) that prevent modification\n Returns on the first conflict (compliant with the RFC 4918)\n */\n for await (const l of this.searchParentLocks(dbFile, { includeRoot: true, depth: DEPTH.INFINITY })) {\n if (options?.lockScope && options?.lockScope === LOCK_SCOPE.SHARED && l.options.lockScope === LOCK_SCOPE.SHARED && options?.app === l.app) {\n // Only compatible with shared locks (with the same owner and the same application)\n continue\n }\n if (options?.userId === l.owner.id && (!l.options || (options?.lockTokens?.length && options.lockTokens.indexOf(l.options.lockToken) > -1))) {\n // Owner owns this lock (no davLock if the lock was created from api)\n continue\n }\n const conflict = `conflicting parent lock : ${dbFile.path} -> ${l.dbFilePath} (${l.owner.login})`\n this.logger.debug(`${this.checkConflicts.name} - ${conflict}`)\n throw new LockConflict(l, conflict)\n }\n if (depth === DEPTH.INFINITY) {\n for await (const l of this.searchChildLocks(dbFile)) {\n if (options?.userId === l.owner.id && (!l.options || (options?.lockTokens?.length && options.lockTokens.indexOf(l.options.lockToken) > -1))) {\n // Owner owns this lock (no davLock if the lock was created from api)\n continue\n }\n const conflict = `conflicting child lock : ${dbFile.path} -> ${l.dbFilePath} (${l.owner.login})`\n this.logger.debug(`${this.checkConflicts.name} - ${conflict}`)\n throw new LockConflict(l, conflict)\n }\n }\n }\n\n async *searchChildLocks(dbFile: FileDBProps) {\n const props = this.genSuffixKey(dbFile, { ignorePath: true })\n const path = dbFile.path === '.' ? '*' : `${dbFile.path}/*`\n this.logger.verbose(`${this.searchChildLocks.name} - ${path} (${props})`)\n const keys = await this.searchKeysByPath(path, props)\n if (keys.length) {\n for (const l of (await this.cache.mget(keys)).filter(Boolean) as FileLock[]) {\n this.logger.verbose(`-> ${l.dbFilePath} (owner: ${l.owner.login})`)\n yield l\n }\n }\n }\n\n convertLockToFileLockProps(lock: FileLock): FileLockProps {\n if (!lock) return null\n return {\n owner: lock.owner,\n app: lock?.app,\n info: lock?.options?.lockInfo,\n isExclusive: lock?.options?.lockScope ? lock?.options?.lockScope === LOCK_SCOPE.EXCLUSIVE : true\n }\n }\n\n genDAVToken(): string {\n return `${LOCK_PREFIX}${crypto.randomUUID()}`\n }\n\n private async *searchParentLocks(dbFile: FileDBProps, options: { includeRoot?: boolean; depth?: LOCK_DEPTH } = {}): AsyncGenerator<FileLock> {\n const props = this.genSuffixKey(dbFile, { ignorePath: true })\n let path = dbFile.path\n const parentPath = dirName(path)\n this.logger.verbose(`${this.searchParentLocks.name} - (including root : ${options.includeRoot}) : ${path} (${props})`)\n if (!options.includeRoot) {\n path = dirName(path)\n }\n while (path !== '.') {\n // Even if the depth is \"infinite\", the path and the parent path could be locked with depth \"0\"\n const depth = options.depth && (dbFile.path === path || parentPath === path) ? null : options.depth\n const keys = await this.searchKeysByPath(path, props, depth)\n if (keys.length) {\n for (const l of (await this.cache.mget(keys)).filter(Boolean) as FileLock[]) {\n this.logger.verbose(`-> ${l.dbFilePath}`)\n yield l\n }\n }\n path = dirName(path)\n }\n }\n\n private async searchKeyByToken(token: string): Promise<string> {\n const keys = await this.cache.keys(`${CACHE_LOCK_PREFIX}|token:${token}|*`)\n if (!keys.length) {\n return null\n } else if (keys.length > 1) {\n this.logger.warn(`Several keys found for token : ${token} => ${JSON.stringify(keys)}`)\n }\n return keys[0]\n }\n\n private searchKeysByPath(path: string, props = '*', depth?: LOCK_DEPTH): Promise<string[]> {\n return this.cache.keys(`${CACHE_LOCK_PREFIX}*${depth ? `|depth:${depth}` : ''}|path:${path}|${props}`)\n }\n\n private genSuffixKey(dbFile: FileDBProps, options: { ignorePath?: boolean; depth?: LOCK_DEPTH; token?: string } = {}): string {\n // return -> `depth:infinity|path:code/sync-in|spaceId:1` | `token:xxx|depth:0|path:code/sync-in.ts|ownerId:1`\n // ignorePath -> `spaceId:1`\n const suffixes = []\n for (const k of Object.keys(dbFile)\n .filter((k) => k !== files.inTrash.name && dbFile[k] !== null)\n .sort()) {\n if (k === files.path.name) {\n if (options.ignorePath) {\n continue\n }\n suffixes.unshift(`${k}:${dbFile[k]}`)\n } else {\n suffixes.push(`${k}:${dbFile[k]}`)\n }\n }\n if (options.depth) suffixes.unshift(`depth:${options.depth}`)\n if (options.token) suffixes.unshift(`token:${options.token}`)\n return suffixes.join('|')\n }\n}\n"],"names":["FilesLockManager","create","user","dbFile","app","depth","options","ttl","checkConflicts","lockScope","e","LockConflict","lock","Error","CACHE_LOCK_DEFAULT_TTL","key","CACHE_LOCK_PREFIX","genSuffixKey","token","lockToken","expiration","Math","floor","currentTimeStamp","owner","asOwner","dbFilePath","path","logger","verbose","name","cache","set","createOrRefresh","locks","getLocksByPath","length","id","mustRefresh","refreshLockTimeout","catch","error","ok","removeLock","del","removeChildLocks","ownedLockKeys","searchChildLocks","push","conflict","login","debug","isLockedWithToken","getLockByToken","startsWith","browseParentChildLocks","includeRoot","childLocks","browseLocks","lengthFilter","split","dbFileName","fileName","Object","fromEntries","map","l","searchKeyByToken","get","props","ignorePath","keys","searchKeysByPath","mget","filter","Boolean","isPathLocked","searchParentLocks","DEPTH","INFINITY","LOCK_SCOPE","SHARED","userId","lockTokens","indexOf","convertLockToFileLockProps","info","lockInfo","isExclusive","EXCLUSIVE","genDAVToken","LOCK_PREFIX","crypto","randomUUID","parentPath","dirName","warn","JSON","stringify","suffixes","k","files","inTrash","sort","unshift","join","Logger"],"mappings":"AAAA;;;;CAIC;;;;+BAkBYA;;;eAAAA;;;wBAhBsB;mEAChB;wBAEc;8BACX;wBAEqC;uBACD;+BAI7B;6BACP;uBACY;;;;;;;;;;;;;;;AAG3B,IAAA,AAAMA,mBAAN,MAAMA;IAmBX,MAAMC,OACJC,IAAe,EACfC,MAAmB,EACnBC,GAAa,EACbC,KAAiB,EACjBC,OAAyB,EACzBC,GAAY,EACkB;QAC9B,IAAI;YACF,MAAM,IAAI,CAACC,cAAc,CAACL,QAAQE,OAAO;gBAAED,KAAKA;gBAAKK,WAAWH,SAASG;YAAU;QACrF,EAAE,OAAOC,GAAG;YACV,IAAIA,aAAaC,2BAAY,EAAE;gBAC7B,OAAO;oBAAC;oBAAOD,EAAEE,IAAI;iBAAC;YACxB;YACA,MAAM,IAAIC,MAAMH;QAClB;QACAH,QAAQO,6BAAsB;QAC9B,MAAMC,MAAM,GAAGC,wBAAiB,CAAC,CAAC,EAAE,IAAI,CAACC,YAAY,CAACd,QAAQ;YAAEE,OAAOA;YAAOa,OAAOZ,SAASa;QAAU,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QAAAA;QAhB7B;;;;;;;;;;;;;EAaA,QACiBH,SAAS,IAAI8E,cAAM,CAAC1G,iBAAiB8B,IAAI;IAEd;AAgQ9C"}
|
|
1
|
+
{"version":3,"sources":["../../../../../backend/src/applications/files/services/files-lock-manager.service.ts"],"sourcesContent":["import { Injectable, Logger } from '@nestjs/common'\nimport crypto from 'node:crypto'\n\nimport { currentTimeStamp } from '../../../common/shared'\nimport { Cache } from '../../../infrastructure/cache/services/cache.service'\nimport { UserModel } from '../../users/models/user.model'\nimport { DEPTH, LOCK_DEPTH, LOCK_PREFIX, LOCK_SCOPE } from '../../webdav/constants/webdav'\nimport { CACHE_LOCK_DEFAULT_TTL, CACHE_LOCK_PREFIX } from '../constants/cache'\nimport { FileDBProps } from '../interfaces/file-db-props.interface'\nimport { FileLock, FileLockOptions, LOCK_APP } from '../interfaces/file-lock.interface'\nimport { FileLockProps } from '../interfaces/file-props.interface'\nimport { LockConflict } from '../models/file-lock-error'\nimport { files } from '../schemas/files.schema'\nimport { dirName, fileName } from '../utils/files'\n\n@Injectable()\nexport class FilesLockManager {\n /* Philosophy\n Currently this manager only handles conflicting locks between multiple users, not between clients\n - The locks created from api\n * They do not contain a token key or a davLock property\n * They are exclusive only\n * They must have a depth of 'infinity' (all children) or '0' (root and root members)\n - The locks created from WebDAV or OnlyOffice or CollaboraOnline are stored with a token and a davLock property\n * They must have a depth of 'infinity' (all children) or '0' (root and root members)\n * They can be exclusive (WebDAV) or shared (OnlyOffice, CollaboraOnline)\n * If created with WebDAV, they are stored with a token and a davLock property\n * If created with OnlyOffice, they are stored with no token and a davLock property whose `locktoken` & `lockroot` properties are `null`\n * If created with CollaboraOnline, they are stored with token and a davLock property whose `lockroot` property is `null`\n Cache token key format = `flock|token?:${uuid}|path:${path}|ownerId?:${number}|spaceId?:${number}|...props` => FileLock\n */\n private readonly logger = new Logger(FilesLockManager.name)\n\n constructor(private readonly cache: Cache) {}\n\n async create(\n user: UserModel,\n dbFile: FileDBProps,\n app: LOCK_APP,\n depth: LOCK_DEPTH,\n options?: FileLockOptions,\n ttl?: number\n ): Promise<[boolean, FileLock]> {\n try {\n await this.checkConflicts(dbFile, depth, { app: app, lockScope: options?.lockScope })\n } catch (e) {\n if (e instanceof LockConflict) {\n return [false, e.lock]\n }\n throw new Error(e)\n }\n ttl ??= CACHE_LOCK_DEFAULT_TTL\n const key = `${CACHE_LOCK_PREFIX}|${this.genSuffixKey(dbFile, { depth: depth, token: options?.lockToken })}`\n const expiration = Math.floor(currentTimeStamp() + ttl)\n const lock: FileLock = {\n owner: user.asOwner(),\n dbFilePath: dbFile.path,\n key: key,\n app: app,\n depth: depth,\n expiration: expiration,\n options: options\n }\n this.logger.verbose({ tag: this.create.name, msg: `${key}` })\n await this.cache.set(key, lock, ttl)\n return [true, lock]\n }\n\n async createOrRefresh(user: UserModel, dbFile: FileDBProps, app: LOCK_APP, depth: LOCK_DEPTH, ttl?: number): Promise<[boolean, FileLock]> {\n // Returns: [created, lock]\n ttl ??= CACHE_LOCK_DEFAULT_TTL\n const locks = await this.getLocksByPath(dbFile)\n // Check the existing lock and refresh it if needed\n if (locks.length > 0) {\n for (const lock of locks) {\n if (lock.owner.id === user.id) {\n // Refresh if more than half of the TTL has passed\n const mustRefresh = lock.expiration - currentTimeStamp() < ttl / 2\n if (mustRefresh) {\n this.refreshLockTimeout(lock, ttl).catch((e: Error) => this.logger.error({ tag: this.createOrRefresh.name, msg: `${e}` }))\n }\n } else {\n throw new LockConflict(lock, 'Conflicting lock')\n }\n }\n return [false, locks[0]]\n }\n // Create the lock\n const [ok, lock] = await this.create(user, dbFile, app, depth, null, ttl)\n if (!ok) {\n throw new LockConflict(lock, 'Conflicting lock')\n }\n return [true, lock]\n }\n\n removeLock(key: string): Promise<boolean> {\n this.logger.verbose({ tag: this.removeLock.name, msg: `${key}` })\n return this.cache.del(key)\n }\n\n async removeChildLocks(user: UserModel, dbFile: FileDBProps) {\n const ownedLockKeys: string[] = []\n for await (const lock of this.searchChildLocks(dbFile)) {\n if (user.id === lock.owner.id) {\n ownedLockKeys.push(lock.key)\n continue\n }\n const conflict = `cannot remove conflicting child lock : ${dbFile.path} (${user.login}) -> ${lock.dbFilePath} (${lock.owner.login})`\n this.logger.debug({ tag: this.removeChildLocks.name, msg: `${conflict}` })\n throw new LockConflict(lock, conflict)\n }\n for (const key of ownedLockKeys) {\n this.logger.verbose({ tag: this.removeChildLocks.name, msg: `child locks: ${key}` })\n await this.removeLock(key)\n }\n }\n\n async isLockedWithToken(token: string, dbFilePath: string): Promise<FileLock> {\n // check if the url (or any of its parents) is locked by the token\n const lock = await this.getLockByToken(token)\n return lock ? (dbFilePath.startsWith(lock.dbFilePath) ? lock : null) : null\n }\n\n async browseParentChildLocks(dbFile: FileDBProps, includeRoot = true): Promise<Record<string, FileLock>> {\n // find child locks inside the path\n const childLocks: Record<string, FileLock> = includeRoot ? await this.browseLocks(dbFile) : {}\n const lengthFilter = dbFile.path === '.' ? 1 : dbFile.path.split('/').length + 1\n for await (const lock of this.searchChildLocks(dbFile)) {\n // filter child locks on length\n if (lengthFilter === lock.dbFilePath.split('/').length) {\n // !!! locks with shared scope can have the same file name, in this case we only keep the first entry\n const dbFileName = fileName(lock.dbFilePath)\n if (!(dbFileName in childLocks)) {\n childLocks[fileName(lock.dbFilePath)] = lock\n }\n }\n }\n return childLocks\n }\n\n async browseLocks(dbFile: FileDBProps): Promise<Record<string, FileLock>> {\n return Object.fromEntries((await this.getLocksByPath(dbFile)).map((l) => [fileName(l.dbFilePath), l]))\n }\n\n async refreshLockTimeout(lock: FileLock, ttl: number) {\n lock.expiration = currentTimeStamp() + ttl\n this.cache.set(lock.key, lock, ttl).catch((e: Error) => this.logger.error({ tag: this.refreshLockTimeout.name, msg: `${e}` }))\n }\n\n async getLockByToken(token: string): Promise<FileLock> {\n const key = await this.searchKeyByToken(token)\n return key ? (await this.cache.get(key)) || null : null\n }\n\n async getLocksByPath(dbFile: FileDBProps): Promise<FileLock[]> {\n if (dbFile.path !== '.') {\n const props = this.genSuffixKey(dbFile, { ignorePath: true })\n const keys = await this.searchKeysByPath(dbFile.path, props)\n if (keys.length) {\n return (await this.cache.mget(keys)).filter(Boolean)\n }\n }\n return []\n }\n\n async isPathLocked(dbFile: FileDBProps): Promise<boolean> {\n if (dbFile.path !== '.') return false\n const props = this.genSuffixKey(dbFile, { ignorePath: true })\n return !!(await this.searchKeysByPath(dbFile.path, props)).length\n }\n\n async checkConflicts(\n dbFile: FileDBProps,\n depth: LOCK_DEPTH,\n options?: { userId?: number; app?: LOCK_APP; lockScope?: LOCK_SCOPE; lockTokens?: string[] }\n ): Promise<void> {\n /* Checks if a file could be modified, created, moved, or deleted\n Throws a `LockConflict` error when there are parent locks (depth: 0) or child locks (depth: infinite) that prevent modification\n Returns on the first conflict (compliant with the RFC 4918)\n */\n for await (const l of this.searchParentLocks(dbFile, { includeRoot: true, depth: DEPTH.INFINITY })) {\n if (options?.lockScope && options?.lockScope === LOCK_SCOPE.SHARED && l.options.lockScope === LOCK_SCOPE.SHARED && options?.app === l.app) {\n // Only compatible with shared locks (with the same owner and the same application)\n continue\n }\n if (options?.userId === l.owner.id && (!l.options || (options?.lockTokens?.length && options.lockTokens.indexOf(l.options.lockToken) > -1))) {\n // Owner owns this lock (no davLock if the lock was created from api)\n continue\n }\n const conflict = `conflicting parent lock : ${dbFile.path} -> ${l.dbFilePath} (${l.owner.login})`\n this.logger.debug({ tag: this.checkConflicts.name, msg: `${conflict}` })\n throw new LockConflict(l, conflict)\n }\n if (depth === DEPTH.INFINITY) {\n for await (const l of this.searchChildLocks(dbFile)) {\n if (options?.userId === l.owner.id && (!l.options || (options?.lockTokens?.length && options.lockTokens.indexOf(l.options.lockToken) > -1))) {\n // Owner owns this lock (no davLock if the lock was created from api)\n continue\n }\n const conflict = `conflicting child lock : ${dbFile.path} -> ${l.dbFilePath} (${l.owner.login})`\n this.logger.debug({ tag: this.checkConflicts.name, msg: `${conflict}` })\n throw new LockConflict(l, conflict)\n }\n }\n }\n\n async *searchChildLocks(dbFile: FileDBProps) {\n const props = this.genSuffixKey(dbFile, { ignorePath: true })\n const path = dbFile.path === '.' ? '*' : `${dbFile.path}/*`\n this.logger.verbose({ tag: this.searchChildLocks.name, msg: `${path} (${props})` })\n const keys = await this.searchKeysByPath(path, props)\n if (keys.length) {\n for (const l of (await this.cache.mget(keys)).filter(Boolean) as FileLock[]) {\n this.logger.verbose({ tag: this.searchChildLocks.name, msg: `-> ${l.dbFilePath} (owner: ${l.owner.login})` })\n yield l\n }\n }\n }\n\n convertLockToFileLockProps(lock: FileLock): FileLockProps {\n if (!lock) return null\n return {\n owner: lock.owner,\n app: lock?.app,\n info: lock?.options?.lockInfo,\n isExclusive: lock?.options?.lockScope ? lock?.options?.lockScope === LOCK_SCOPE.EXCLUSIVE : true\n }\n }\n\n genDAVToken(): string {\n return `${LOCK_PREFIX}${crypto.randomUUID()}`\n }\n\n private async *searchParentLocks(dbFile: FileDBProps, options: { includeRoot?: boolean; depth?: LOCK_DEPTH } = {}): AsyncGenerator<FileLock> {\n const props = this.genSuffixKey(dbFile, { ignorePath: true })\n let path = dbFile.path\n const parentPath = dirName(path)\n this.logger.verbose({ tag: this.searchParentLocks.name, msg: `(including root : ${options.includeRoot}) : ${path} (${props})` })\n if (!options.includeRoot) {\n path = dirName(path)\n }\n while (path !== '.') {\n // Even if the depth is \"infinite\", the path and the parent path could be locked with depth \"0\"\n const depth = options.depth && (dbFile.path === path || parentPath === path) ? null : options.depth\n const keys = await this.searchKeysByPath(path, props, depth)\n if (keys.length) {\n for (const l of (await this.cache.mget(keys)).filter(Boolean) as FileLock[]) {\n this.logger.verbose({ tag: this.searchParentLocks.name, msg: `-> ${l.dbFilePath}` })\n yield l\n }\n }\n path = dirName(path)\n }\n }\n\n private async searchKeyByToken(token: string): Promise<string> {\n const keys = await this.cache.keys(`${CACHE_LOCK_PREFIX}|token:${token}|*`)\n if (!keys.length) {\n return null\n } else if (keys.length > 1) {\n this.logger.warn({ tag: this.searchKeyByToken.name, msg: `Several keys found for token : ${token} => ${JSON.stringify(keys)}` })\n }\n return keys[0]\n }\n\n private searchKeysByPath(path: string, props = '*', depth?: LOCK_DEPTH): Promise<string[]> {\n return this.cache.keys(`${CACHE_LOCK_PREFIX}*${depth ? `|depth:${depth}` : ''}|path:${path}|${props}`)\n }\n\n private genSuffixKey(dbFile: FileDBProps, options: { ignorePath?: boolean; depth?: LOCK_DEPTH; token?: string } = {}): string {\n // return -> `depth:infinity|path:code/sync-in|spaceId:1` | `token:xxx|depth:0|path:code/sync-in.ts|ownerId:1`\n // ignorePath -> `spaceId:1`\n const suffixes = []\n for (const k of Object.keys(dbFile)\n .filter((k) => k !== files.inTrash.name && dbFile[k] !== null)\n .sort()) {\n if (k === files.path.name) {\n if (options.ignorePath) {\n continue\n }\n suffixes.unshift(`${k}:${dbFile[k]}`)\n } else {\n suffixes.push(`${k}:${dbFile[k]}`)\n }\n }\n if (options.depth) suffixes.unshift(`depth:${options.depth}`)\n if (options.token) suffixes.unshift(`token:${options.token}`)\n return suffixes.join('|')\n }\n}\n"],"names":["FilesLockManager","create","user","dbFile","app","depth","options","ttl","checkConflicts","lockScope","e","LockConflict","lock","Error","CACHE_LOCK_DEFAULT_TTL","key","CACHE_LOCK_PREFIX","genSuffixKey","token","lockToken","expiration","Math","floor","currentTimeStamp","owner","asOwner","dbFilePath","path","logger","verbose","tag","name","msg","cache","set","createOrRefresh","locks","getLocksByPath","length","id","mustRefresh","refreshLockTimeout","catch","error","ok","removeLock","del","removeChildLocks","ownedLockKeys","searchChildLocks","push","conflict","login","debug","isLockedWithToken","getLockByToken","startsWith","browseParentChildLocks","includeRoot","childLocks","browseLocks","lengthFilter","split","dbFileName","fileName","Object","fromEntries","map","l","searchKeyByToken","get","props","ignorePath","keys","searchKeysByPath","mget","filter","Boolean","isPathLocked","searchParentLocks","DEPTH","INFINITY","LOCK_SCOPE","SHARED","userId","lockTokens","indexOf","convertLockToFileLockProps","info","lockInfo","isExclusive","EXCLUSIVE","genDAVToken","LOCK_PREFIX","crypto","randomUUID","parentPath","dirName","warn","JSON","stringify","suffixes","k","files","inTrash","sort","unshift","join","Logger"],"mappings":";;;;+BAgBaA;;;eAAAA;;;wBAhBsB;mEAChB;wBAEc;8BACX;wBAEqC;uBACD;+BAI7B;6BACP;uBACY;;;;;;;;;;;;;;;AAG3B,IAAA,AAAMA,mBAAN,MAAMA;IAmBX,MAAMC,OACJC,IAAe,EACfC,MAAmB,EACnBC,GAAa,EACbC,KAAiB,EACjBC,OAAyB,EACzBC,GAAY,EACkB;QAC9B,IAAI;YACF,MAAM,IAAI,CAACC,cAAc,CAACL,QAAQE,OAAO;gBAAED,KAAKA;gBAAKK,WAAWH,SAASG;YAAU;QACrF,EAAE,OAAOC,GAAG;YACV,IAAIA,aAAaC,2BAAY,EAAE;gBAC7B,OAAO;oBAAC;oBAAOD,EAAEE,IAAI;iBAAC;YACxB;YACA,MAAM,IAAIC,MAAMH;QAClB;QACAH,QAAQO,6BAAsB;QAC9B,MAAMC,MAAM,GAAGC,wBAAiB,CAAC,CAAC,EAAE,IAAI,CAACC,YAAY,CAACd,QAAQ;YAAEE,OAAOA;YAAOa,OAAOZ,SAASa;QAAU,IAAI;QAC5G,MAAMC,aAAaC,KAAKC,KAAK,CAACC,IAAAA,wBAAgB,MAAKhB;QACnD,MAAMK,OAAiB;YACrBY,OAAOtB,KAAKuB,OAAO;YACnBC,YAAYvB,OAAOwB,IAAI;YACvBZ,KAAKA;YACLX,KAAKA;YACLC,OAAOA;YACPe,YAAYA;YACZd,SAASA;QACX;QACA,IAAI,CAACsB,MAAM,CAACC,OAAO,CAAC;YAAEC,KAAK,IAAI,CAAC7B,MAAM,CAAC8B,IAAI;YAAEC,KAAK,GAAGjB,KAAK;QAAC;QAC3D,MAAM,IAAI,CAACkB,KAAK,CAACC,GAAG,CAACnB,KAAKH,MAAML;QAChC,OAAO;YAAC;YAAMK;SAAK;IACrB;IAEA,MAAMuB,gBAAgBjC,IAAe,EAAEC,MAAmB,EA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AAI;IAEd;AAgQ9C"}
|
|
@@ -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/services/files-lock-manager.service.spec.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../../../../backend/src/applications/files/services/files-lock-manager.service.spec.ts"],"sourcesContent":["import { Test, TestingModule } from '@nestjs/testing'\nimport { Cache } from '../../../infrastructure/cache/services/cache.service'\nimport { DB_TOKEN_PROVIDER } from '../../../infrastructure/database/constants'\nimport { FilesLockManager } from './files-lock-manager.service'\n\ndescribe(FilesLockManager.name, () => {\n let module: TestingModule\n let filesLockManager: FilesLockManager\n\n beforeAll(async () => {\n module = await Test.createTestingModule({\n providers: [FilesLockManager, { provide: DB_TOKEN_PROVIDER, useValue: {} }, { provide: Cache, useValue: {} }]\n }).compile()\n\n filesLockManager = module.get<FilesLockManager>(FilesLockManager)\n })\n\n afterAll(async () => {\n await module.close()\n })\n\n it('should be defined', () => {\n expect(filesLockManager).toBeDefined()\n })\n})\n"],"names":["describe","FilesLockManager","name","module","filesLockManager","beforeAll","Test","createTestingModule","providers","provide","DB_TOKEN_PROVIDER","useValue","Cache","compile","get","afterAll","close","it","expect","toBeDefined"],"mappings":";;;;yBAAoC;8BACd;2BACY;yCACD;AAEjCA,SAASC,yCAAgB,CAACC,IAAI,EAAE;IAC9B,IAAIC;IACJ,IAAIC;IAEJC,UAAU;QACRF,SAAS,MAAMG,aAAI,CAACC,mBAAmB,CAAC;YACtCC,WAAW;gBAACP,yCAAgB;gBAAE;oBAAEQ,SAASC,4BAAiB;oBAAEC,UAAU,CAAC;gBAAE;gBAAG;oBAAEF,SAASG,mBAAK;oBAAED,UAAU,CAAC;gBAAE;aAAE;QAC/G,GAAGE,OAAO;QAEVT,mBAAmBD,OAAOW,GAAG,CAAmBb,yCAAgB;IAClE;IAEAc,SAAS;QACP,MAAMZ,OAAOa,KAAK;IACpB;IAEAC,GAAG,qBAAqB;QACtBC,OAAOd,kBAAkBe,WAAW;IACtC;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
|
});
|
|
@@ -127,7 +123,10 @@ let FilesManager = class FilesManager {
|
|
|
127
123
|
} catch (e) {
|
|
128
124
|
// cleanup tmp file
|
|
129
125
|
await (0, _files1.removeFiles)(options.tmpPath);
|
|
130
|
-
this.logger.error(
|
|
126
|
+
this.logger.error({
|
|
127
|
+
tag: this.saveStream.name,
|
|
128
|
+
msg: `unable to move ${options.tmpPath} -> ${space.realPath} : ${e}`
|
|
129
|
+
});
|
|
131
130
|
throw new _fileerror.FileError(_common.HttpStatus.INTERNAL_SERVER_ERROR, 'Unable to move tmp file to dst file');
|
|
132
131
|
}
|
|
133
132
|
}
|
|
@@ -140,7 +139,10 @@ let FilesManager = class FilesManager {
|
|
|
140
139
|
try {
|
|
141
140
|
await this.filesLockManager.removeLock(fileLock.key);
|
|
142
141
|
} catch (e) {
|
|
143
|
-
this.logger.warn(
|
|
142
|
+
this.logger.warn({
|
|
143
|
+
tag: this.saveStream.name,
|
|
144
|
+
msg: `Failed to remove lock ${fileLock.key}: ${e}`
|
|
145
|
+
});
|
|
144
146
|
}
|
|
145
147
|
}
|
|
146
148
|
}
|
|
@@ -267,15 +269,24 @@ let FilesManager = class FilesManager {
|
|
|
267
269
|
async copyMove(user, srcSpace, dstSpace, isMove, overwrite = false, mkdirDstParentPath = false, dav) {
|
|
268
270
|
// checks
|
|
269
271
|
if (!(0, _permissions.canAccessToSpace)(user, dstSpace)) {
|
|
270
|
-
this.logger.warn(
|
|
272
|
+
this.logger.warn({
|
|
273
|
+
tag: this.copyMove.name,
|
|
274
|
+
msg: `is not allowed to access to this space repository : ${dstSpace.repository}`
|
|
275
|
+
});
|
|
271
276
|
throw new _fileerror.FileError(_common.HttpStatus.FORBIDDEN, 'You are not allowed to access to this repository');
|
|
272
277
|
}
|
|
273
278
|
if (!(0, _permissions.haveSpaceEnvPermissions)(dstSpace, _spaces.SPACE_OPERATION.ADD)) {
|
|
274
|
-
this.logger.warn(
|
|
279
|
+
this.logger.warn({
|
|
280
|
+
tag: this.copyMove.name,
|
|
281
|
+
msg: `is not allowed to copy/move on this space : *${dstSpace.alias}* (${dstSpace.id}) : ${dstSpace.url}`
|
|
282
|
+
});
|
|
275
283
|
throw new _fileerror.FileError(_common.HttpStatus.FORBIDDEN, 'You are not allowed to copy/move on the destination');
|
|
276
284
|
}
|
|
277
285
|
if (dstSpace.quotaIsExceeded) {
|
|
278
|
-
this.logger.warn(
|
|
286
|
+
this.logger.warn({
|
|
287
|
+
tag: this.copyMove.name,
|
|
288
|
+
msg: `quota is exceeded for *${dstSpace.alias}* (${dstSpace.id})`
|
|
289
|
+
});
|
|
279
290
|
throw new _fileerror.FileError(_common.HttpStatus.INSUFFICIENT_STORAGE, 'Quota is exceeded');
|
|
280
291
|
}
|
|
281
292
|
if (!await (0, _files1.isPathExists)(srcSpace.realPath)) {
|
|
@@ -286,7 +297,10 @@ let FilesManager = class FilesManager {
|
|
|
286
297
|
try {
|
|
287
298
|
await (0, _files1.makeDir)((0, _files1.dirName)(dstSpace.realPath), true);
|
|
288
299
|
} catch (e) {
|
|
289
|
-
this.logger.error(
|
|
300
|
+
this.logger.error({
|
|
301
|
+
tag: this.copyMove.name,
|
|
302
|
+
msg: `Cannot create parent directory for destination ${dstSpace.realPath} : ${e}`
|
|
303
|
+
});
|
|
290
304
|
throw new _fileerror.FileError(_common.HttpStatus.INTERNAL_SERVER_ERROR, 'Cannot create parent directory for destination');
|
|
291
305
|
}
|
|
292
306
|
} else {
|
|
@@ -321,7 +335,10 @@ let FilesManager = class FilesManager {
|
|
|
321
335
|
/* Skip validation when moving to the same space; for copy operations, run all checks. */ if (!isMove || isMove && srcSpace.id !== dstSpace.id) {
|
|
322
336
|
const size = isDir ? (await (0, _files1.dirSize)(srcSpace.realPath))[0] : await (0, _files1.fileSize)(srcSpace.realPath);
|
|
323
337
|
if (dstSpace.willExceedQuota(size)) {
|
|
324
|
-
this.logger.warn(
|
|
338
|
+
this.logger.warn({
|
|
339
|
+
tag: this.copyMove.name,
|
|
340
|
+
msg: `storage quota will be exceeded for *${dstSpace.alias}* (${dstSpace.id})`
|
|
341
|
+
});
|
|
325
342
|
throw new _fileerror.FileError(_common.HttpStatus.INSUFFICIENT_STORAGE, 'Storage quota will be exceeded');
|
|
326
343
|
}
|
|
327
344
|
}
|
|
@@ -407,23 +424,35 @@ let FilesManager = class FilesManager {
|
|
|
407
424
|
await (0, _files1.moveFiles)(space.realPath, trashFile, true);
|
|
408
425
|
} else {
|
|
409
426
|
// unsupported case: delete the file (this shouldn't happen)
|
|
410
|
-
this.logger.error(
|
|
427
|
+
this.logger.error({
|
|
428
|
+
tag: this.delete.name,
|
|
429
|
+
msg: `Unable to find trash path for space - *${space.alias}* (${space.id}) : delete permanently : ${space.realPath}`
|
|
430
|
+
});
|
|
411
431
|
forceDeleteInDB = true;
|
|
412
432
|
await (0, _files1.removeFiles)(space.realPath);
|
|
413
433
|
}
|
|
414
434
|
}
|
|
415
435
|
// remove locks, these locks have already been checked in the `checkConflicts` function
|
|
416
436
|
if (isDir) {
|
|
417
|
-
this.filesLockManager.removeChildLocks(user, space.dbFile).catch((e)=>this.logger.error(
|
|
437
|
+
this.filesLockManager.removeChildLocks(user, space.dbFile).catch((e)=>this.logger.error({
|
|
438
|
+
tag: this.delete.name,
|
|
439
|
+
msg: `${e}`
|
|
440
|
+
}));
|
|
418
441
|
}
|
|
419
442
|
for (const lock of (await this.filesLockManager.getLocksByPath(space.dbFile))){
|
|
420
|
-
this.filesLockManager.removeLock(lock.key).catch((e)=>this.logger.error(
|
|
443
|
+
this.filesLockManager.removeLock(lock.key).catch((e)=>this.logger.error({
|
|
444
|
+
tag: this.delete.name,
|
|
445
|
+
msg: `${e}`
|
|
446
|
+
}));
|
|
421
447
|
}
|
|
422
448
|
// delete or move to trash the files in db
|
|
423
449
|
return this.filesQueries.deleteFiles(space.dbFile, isDir, forceDeleteInDB);
|
|
424
450
|
}
|
|
425
451
|
async downloadFromUrl(user, space, url) {
|
|
426
|
-
this.logger.log(
|
|
452
|
+
this.logger.log({
|
|
453
|
+
tag: this.downloadFromUrl.name,
|
|
454
|
+
msg: `${url}`
|
|
455
|
+
});
|
|
427
456
|
// create lock
|
|
428
457
|
const rPath = await (0, _files1.uniqueFilePathFromDir)(space.realPath);
|
|
429
458
|
const dbFile = space.dbFile;
|
|
@@ -444,7 +473,10 @@ let FilesManager = class FilesManager {
|
|
|
444
473
|
} catch (e) {
|
|
445
474
|
// release lock
|
|
446
475
|
await this.filesLockManager.removeLock(fileLock.key);
|
|
447
|
-
this.logger.error(
|
|
476
|
+
this.logger.error({
|
|
477
|
+
tag: this.downloadFromUrl.name,
|
|
478
|
+
msg: `${url} : ${e}`
|
|
479
|
+
});
|
|
448
480
|
throw new _fileerror.FileError(_common.HttpStatus.BAD_REQUEST, 'Unable to download file');
|
|
449
481
|
}
|
|
450
482
|
if (_urlfile.regExpPrivateIP.test(headRes.request.socket.remoteAddress)) {
|
|
@@ -459,7 +491,10 @@ let FilesManager = class FilesManager {
|
|
|
459
491
|
space.task.props.totalSize = parseInt(headRes.headers['content-length'], 10) || null;
|
|
460
492
|
}
|
|
461
493
|
} catch (e) {
|
|
462
|
-
this.logger.debug(
|
|
494
|
+
this.logger.debug({
|
|
495
|
+
tag: this.downloadFromUrl.name,
|
|
496
|
+
msg: `content-length : ${e}`
|
|
497
|
+
});
|
|
463
498
|
}
|
|
464
499
|
_filetaskevent.FileTaskEvent.emit('startWatch', space, _operations.FILE_OPERATION.DOWNLOAD, rPath);
|
|
465
500
|
}
|
|
@@ -581,14 +616,20 @@ let FilesManager = class FilesManager {
|
|
|
581
616
|
try {
|
|
582
617
|
return (0, _image.generateThumbnail)(space.realPath, size);
|
|
583
618
|
} catch (e) {
|
|
584
|
-
this.logger.warn(
|
|
619
|
+
this.logger.warn({
|
|
620
|
+
tag: this.generateThumbnail.name,
|
|
621
|
+
msg: e
|
|
622
|
+
});
|
|
585
623
|
throw new _fileerror.FileError(_common.HttpStatus.BAD_REQUEST, 'File is not an image');
|
|
586
624
|
}
|
|
587
625
|
}
|
|
588
626
|
async lock(user, space) {
|
|
589
627
|
const rExists = await (0, _files1.isPathExists)(space.realPath);
|
|
590
628
|
if (!rExists) {
|
|
591
|
-
this.logger.warn(
|
|
629
|
+
this.logger.warn({
|
|
630
|
+
tag: this.lock.name,
|
|
631
|
+
msg: 'Lock refresh must specify an existing resource'
|
|
632
|
+
});
|
|
592
633
|
throw new _fileerror.FileError(_common.HttpStatus.BAD_REQUEST, 'Lock refresh must specify an existing resource');
|
|
593
634
|
}
|
|
594
635
|
const [_created, lock] = await this.filesLockManager.createOrRefresh(user, space.dbFile, _shared.SERVER_NAME, _webdav.DEPTH.RESOURCE, _cache.CACHE_LOCK_FILE_TTL);
|
|
@@ -596,12 +637,18 @@ let FilesManager = class FilesManager {
|
|
|
596
637
|
}
|
|
597
638
|
async unlock(user, space, forceAsFileOwner = false) {
|
|
598
639
|
if (!await (0, _files1.isPathExists)(space.realPath)) {
|
|
599
|
-
this.logger.warn(
|
|
640
|
+
this.logger.warn({
|
|
641
|
+
tag: this.unlock.name,
|
|
642
|
+
msg: `Unable to unlock: ${space.url} - resource does not exist`
|
|
643
|
+
});
|
|
600
644
|
throw new _fileerror.FileError(_common.HttpStatus.BAD_REQUEST, 'Unlock must specify an existing resource');
|
|
601
645
|
}
|
|
602
646
|
const fileLocks = await this.filesLockManager.getLocksByPath(space.dbFile);
|
|
603
647
|
if (fileLocks.length === 0) {
|
|
604
|
-
this.logger.warn(
|
|
648
|
+
this.logger.warn({
|
|
649
|
+
tag: this.unlock.name,
|
|
650
|
+
msg: `Unable to find lock: ${space.url} - resource does not exist`
|
|
651
|
+
});
|
|
605
652
|
return;
|
|
606
653
|
}
|
|
607
654
|
for (const lock of fileLocks){
|
|
@@ -616,7 +663,10 @@ let FilesManager = class FilesManager {
|
|
|
616
663
|
async unlockRequest(user, space) {
|
|
617
664
|
const fileLocks = await this.filesLockManager.getLocksByPath(space.dbFile);
|
|
618
665
|
if (fileLocks.length === 0) {
|
|
619
|
-
this.logger.warn(
|
|
666
|
+
this.logger.warn({
|
|
667
|
+
tag: this.unlockRequest.name,
|
|
668
|
+
msg: `Unable to find lock: ${space.url} - resource does not exist`
|
|
669
|
+
});
|
|
620
670
|
throw new _fileerror.FileError(_common.HttpStatus.NOT_FOUND, 'Lock not found');
|
|
621
671
|
}
|
|
622
672
|
for (const lock of fileLocks){
|
|
@@ -632,7 +682,10 @@ let FilesManager = class FilesManager {
|
|
|
632
682
|
], notification, {
|
|
633
683
|
author: user,
|
|
634
684
|
currentUrl: this.contextManager.headerOriginUrl()
|
|
635
|
-
}).catch((e)=>this.logger.error(
|
|
685
|
+
}).catch((e)=>this.logger.error({
|
|
686
|
+
tag: this.unlockRequest.name,
|
|
687
|
+
msg: `${e}`
|
|
688
|
+
}));
|
|
636
689
|
}
|
|
637
690
|
}
|
|
638
691
|
}
|