@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
|
});
|
|
@@ -17,9 +13,10 @@ const _common = require("@nestjs/common");
|
|
|
17
13
|
const _nodecrypto = /*#__PURE__*/ _interop_require_default(require("node:crypto"));
|
|
18
14
|
const _promises = /*#__PURE__*/ _interop_require_default(require("node:fs/promises"));
|
|
19
15
|
const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
16
|
+
const _authservice = require("../../../authentication/auth.service");
|
|
17
|
+
const _scope = require("../../../authentication/constants/scope");
|
|
18
|
+
const _authprovidersmodels = require("../../../authentication/providers/auth-providers.models");
|
|
19
|
+
const _authprovidertwofaservice = require("../../../authentication/providers/two-fa/auth-provider-two-fa.service");
|
|
23
20
|
const _functions = require("../../../common/functions");
|
|
24
21
|
const _shared = require("../../../common/shared");
|
|
25
22
|
const _configconstants = require("../../../configuration/config.constants");
|
|
@@ -49,43 +46,64 @@ function _ts_metadata(k, v) {
|
|
|
49
46
|
}
|
|
50
47
|
let SyncClientsManager = class SyncClientsManager {
|
|
51
48
|
async register(clientRegistrationDto, ip) {
|
|
52
|
-
const user = await this.
|
|
49
|
+
const user = await this.authProvider.validateUser(clientRegistrationDto.login, clientRegistrationDto.password, ip, _scope.AUTH_SCOPE.CLIENT);
|
|
53
50
|
if (!user) {
|
|
54
|
-
this.logger.warn(
|
|
51
|
+
this.logger.warn({
|
|
52
|
+
tag: this.register.name,
|
|
53
|
+
msg: `auth failed for user *${clientRegistrationDto.login}*`
|
|
54
|
+
});
|
|
55
55
|
throw new _common.HttpException('Wrong login or password', _common.HttpStatus.UNAUTHORIZED);
|
|
56
56
|
}
|
|
57
57
|
if (!user.havePermission(_user.USER_PERMISSION.DESKTOP_APP)) {
|
|
58
|
-
this.logger.warn(
|
|
58
|
+
this.logger.warn({
|
|
59
|
+
tag: this.register.name,
|
|
60
|
+
msg: `user *${user.login}* (${user.id}) does not have permission : ${_user.USER_PERMISSION.DESKTOP_APP}`
|
|
61
|
+
});
|
|
59
62
|
throw new _common.HttpException('Missing permission', _common.HttpStatus.FORBIDDEN);
|
|
60
63
|
}
|
|
61
64
|
if (_configenvironment.configuration.auth.mfa.totp.enabled && user.twoFaEnabled) {
|
|
65
|
+
// Checking TOTP code and recovery code
|
|
62
66
|
if (!clientRegistrationDto.code) {
|
|
63
|
-
this.logger.warn(
|
|
67
|
+
this.logger.warn({
|
|
68
|
+
tag: this.register.name,
|
|
69
|
+
msg: `missing two-fa code for user *${user.login}* (${user.id})`
|
|
70
|
+
});
|
|
64
71
|
throw new _common.HttpException('Missing TWO-FA code', _common.HttpStatus.UNAUTHORIZED);
|
|
65
72
|
}
|
|
66
|
-
const
|
|
67
|
-
if (!
|
|
68
|
-
this.logger.warn(
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
const authCode = this.authProvider2FA.validateTwoFactorCode(clientRegistrationDto.code, user.secrets.twoFaSecret);
|
|
74
|
+
if (!authCode.success) {
|
|
75
|
+
this.logger.warn({
|
|
76
|
+
tag: this.register.name,
|
|
77
|
+
msg: `two-fa code for *${user.login}* (${user.id}) - ${authCode.message}`
|
|
78
|
+
});
|
|
79
|
+
const authRCode = await this.authProvider2FA.validateRecoveryCode(user.id, clientRegistrationDto.code, user.secrets.recoveryCodes);
|
|
80
|
+
if (!authRCode.success) {
|
|
81
|
+
this.logger.warn({
|
|
82
|
+
tag: this.register.name,
|
|
83
|
+
msg: `two-fa recovery code for *${user.login}* (${user.id}) - ${authRCode.message}`
|
|
84
|
+
});
|
|
85
|
+
this.usersManager.updateAccesses(user, ip, false).catch((e)=>this.logger.error({
|
|
86
|
+
tag: this.register.name,
|
|
87
|
+
msg: `${e}`
|
|
88
|
+
}));
|
|
89
|
+
throw new _common.HttpException(authCode.message, _common.HttpStatus.UNAUTHORIZED);
|
|
90
|
+
}
|
|
71
91
|
}
|
|
72
92
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
};
|
|
79
|
-
} catch (e) {
|
|
80
|
-
this.logger.error(`${this.register.name} - ${e}`);
|
|
81
|
-
throw new _common.HttpException('Error during the client registration', _common.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
82
|
-
}
|
|
93
|
+
return this.getOrCreateClient(user, clientRegistrationDto.clientId, clientRegistrationDto.info, ip);
|
|
94
|
+
}
|
|
95
|
+
async registerWithAuth(clientAuthenticatedRegistrationDto, req) {
|
|
96
|
+
const clientId = clientAuthenticatedRegistrationDto.clientId || _nodecrypto.default.randomUUID();
|
|
97
|
+
return this.getOrCreateClient(req.user, clientId, clientAuthenticatedRegistrationDto.info, req.ip);
|
|
83
98
|
}
|
|
84
99
|
async unregister(user) {
|
|
85
100
|
try {
|
|
86
101
|
await this.syncQueries.deleteClient(user.id, user.clientId);
|
|
87
102
|
} catch (e) {
|
|
88
|
-
this.logger.error(
|
|
103
|
+
this.logger.error({
|
|
104
|
+
tag: this.unregister.name,
|
|
105
|
+
msg: `${e}`
|
|
106
|
+
});
|
|
89
107
|
throw new _common.HttpException('Error during the removing of client registration', _common.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
90
108
|
}
|
|
91
109
|
}
|
|
@@ -100,7 +118,10 @@ let SyncClientsManager = class SyncClientsManager {
|
|
|
100
118
|
if ((0, _shared.currentTimeStamp)() >= client.tokenExpiration) {
|
|
101
119
|
throw new _common.HttpException(_auth.CLIENT_TOKEN_EXPIRED_ERROR, _common.HttpStatus.FORBIDDEN);
|
|
102
120
|
}
|
|
103
|
-
this.syncQueries.updateClientInfo(client, client.info, ip).catch((e)=>this.logger.error(
|
|
121
|
+
this.syncQueries.updateClientInfo(client, client.info, ip).catch((e)=>this.logger.error({
|
|
122
|
+
tag: this.authenticate.name,
|
|
123
|
+
msg: `${e}`
|
|
124
|
+
}));
|
|
104
125
|
const user = await this.usersManager.fromUserId(client.ownerId);
|
|
105
126
|
if (!user) {
|
|
106
127
|
throw new _common.HttpException('User does not exist', _common.HttpStatus.FORBIDDEN);
|
|
@@ -109,13 +130,19 @@ let SyncClientsManager = class SyncClientsManager {
|
|
|
109
130
|
throw new _common.HttpException('Account suspended or not authorized', _common.HttpStatus.FORBIDDEN);
|
|
110
131
|
}
|
|
111
132
|
if (!user.havePermission(_user.USER_PERMISSION.DESKTOP_APP)) {
|
|
112
|
-
this.logger.warn(
|
|
133
|
+
this.logger.warn({
|
|
134
|
+
tag: this.authenticate.name,
|
|
135
|
+
msg: `does not have permission : ${_user.USER_PERMISSION.DESKTOP_APP}`
|
|
136
|
+
});
|
|
113
137
|
throw new _common.HttpException('Missing permission', _common.HttpStatus.FORBIDDEN);
|
|
114
138
|
}
|
|
115
139
|
// set clientId
|
|
116
140
|
user.clientId = client.id;
|
|
117
141
|
// update accesses
|
|
118
|
-
this.usersManager.updateAccesses(user, ip, true).catch((e)=>this.logger.error(
|
|
142
|
+
this.usersManager.updateAccesses(user, ip, true).catch((e)=>this.logger.error({
|
|
143
|
+
tag: this.authenticate.name,
|
|
144
|
+
msg: `${e}`
|
|
145
|
+
}));
|
|
119
146
|
let r;
|
|
120
147
|
if (authType === _auth.CLIENT_AUTH_TYPE.COOKIE) {
|
|
121
148
|
// used by the desktop app to perform the login setup using cookies
|
|
@@ -138,11 +165,17 @@ let SyncClientsManager = class SyncClientsManager {
|
|
|
138
165
|
}
|
|
139
166
|
const token = _nodecrypto.default.randomUUID();
|
|
140
167
|
const expiration = (0, _shared.currentTimeStamp)() + (0, _functions.convertHumanTimeToSeconds)(_auth.CLIENT_TOKEN_EXPIRATION_TIME);
|
|
141
|
-
this.logger.log(
|
|
168
|
+
this.logger.log({
|
|
169
|
+
tag: this.renewTokenAndExpiration.name,
|
|
170
|
+
msg: `renew token for user *${owner.login}* and client *${client.id}*`
|
|
171
|
+
});
|
|
142
172
|
try {
|
|
143
173
|
await this.syncQueries.renewClientTokenAndExpiration(client.id, token, expiration);
|
|
144
174
|
} catch (e) {
|
|
145
|
-
this.logger.error(
|
|
175
|
+
this.logger.error({
|
|
176
|
+
tag: this.renewTokenAndExpiration.name,
|
|
177
|
+
msg: `unable to renew token for user *${owner.login}* and client *${client.id}* : ${e}`
|
|
178
|
+
});
|
|
146
179
|
throw new _common.HttpException('Unable to update client token', _common.HttpStatus.BAD_REQUEST);
|
|
147
180
|
}
|
|
148
181
|
return token;
|
|
@@ -151,14 +184,17 @@ let SyncClientsManager = class SyncClientsManager {
|
|
|
151
184
|
try {
|
|
152
185
|
await this.syncQueries.deleteClient(user.id, clientId);
|
|
153
186
|
} catch (e) {
|
|
154
|
-
this.logger.error(
|
|
187
|
+
this.logger.error({
|
|
188
|
+
tag: this.deleteClient.name,
|
|
189
|
+
msg: `${e}`
|
|
190
|
+
});
|
|
155
191
|
throw new _common.HttpException('Unable to delete client', _common.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
156
192
|
}
|
|
157
193
|
}
|
|
158
194
|
async checkAppStore() {
|
|
159
195
|
let manifest = null;
|
|
160
196
|
if (_configenvironment.configuration.applications.appStore.repository === _store.APP_STORE_REPOSITORY.PUBLIC) {
|
|
161
|
-
const url = `${
|
|
197
|
+
const url = `${_shared.RELEASES_URL}/${_store.APP_STORE_MANIFEST_FILE}`;
|
|
162
198
|
try {
|
|
163
199
|
const res = await this.http.axiosRef({
|
|
164
200
|
method: _applicationsconstants.HTTP_METHOD.GET,
|
|
@@ -167,12 +203,18 @@ let SyncClientsManager = class SyncClientsManager {
|
|
|
167
203
|
manifest = res.data;
|
|
168
204
|
manifest.repository = _store.APP_STORE_REPOSITORY.PUBLIC;
|
|
169
205
|
} catch (e) {
|
|
170
|
-
this.logger.warn(
|
|
206
|
+
this.logger.warn({
|
|
207
|
+
tag: this.checkAppStore.name,
|
|
208
|
+
msg: `unable to retrieve ${url} : ${e}`
|
|
209
|
+
});
|
|
171
210
|
}
|
|
172
211
|
} else {
|
|
173
212
|
const latestFile = _nodepath.default.join(_configconstants.STATIC_PATH, _store.APP_STORE_DIRNAME, _store.APP_STORE_MANIFEST_FILE);
|
|
174
213
|
if (!await (0, _files.isPathExists)(latestFile)) {
|
|
175
|
-
this.logger.warn(
|
|
214
|
+
this.logger.warn({
|
|
215
|
+
tag: this.checkAppStore.name,
|
|
216
|
+
msg: `${latestFile} does not exist`
|
|
217
|
+
});
|
|
176
218
|
} else {
|
|
177
219
|
try {
|
|
178
220
|
manifest = JSON.parse(await _promises.default.readFile(latestFile, 'utf8'));
|
|
@@ -188,17 +230,39 @@ let SyncClientsManager = class SyncClientsManager {
|
|
|
188
230
|
}
|
|
189
231
|
}
|
|
190
232
|
} catch (e) {
|
|
191
|
-
this.logger.error(
|
|
233
|
+
this.logger.error({
|
|
234
|
+
tag: this.checkAppStore.name,
|
|
235
|
+
msg: `${latestFile} : ${e}`
|
|
236
|
+
});
|
|
192
237
|
}
|
|
193
238
|
}
|
|
194
239
|
}
|
|
195
240
|
return manifest;
|
|
196
241
|
}
|
|
197
|
-
|
|
242
|
+
async getOrCreateClient(user, clientId, clientInfo, ip) {
|
|
243
|
+
try {
|
|
244
|
+
const token = await this.syncQueries.getOrCreateClient(user.id, clientId, clientInfo, ip);
|
|
245
|
+
this.logger.log({
|
|
246
|
+
tag: this.getOrCreateClient.name,
|
|
247
|
+
msg: `client *${clientInfo.type}* was registered for user *${user.login}* (${user.id})`
|
|
248
|
+
});
|
|
249
|
+
return {
|
|
250
|
+
clientId: clientId,
|
|
251
|
+
clientToken: token
|
|
252
|
+
};
|
|
253
|
+
} catch (e) {
|
|
254
|
+
this.logger.error({
|
|
255
|
+
tag: this.getOrCreateClient.name,
|
|
256
|
+
msg: `${e}`
|
|
257
|
+
});
|
|
258
|
+
throw new _common.HttpException('Error during the client registration', _common.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
constructor(http, authManager, authProvider, authProvider2FA, usersManager, syncQueries){
|
|
198
262
|
this.http = http;
|
|
199
263
|
this.authManager = authManager;
|
|
200
|
-
this.
|
|
201
|
-
this.
|
|
264
|
+
this.authProvider = authProvider;
|
|
265
|
+
this.authProvider2FA = authProvider2FA;
|
|
202
266
|
this.usersManager = usersManager;
|
|
203
267
|
this.syncQueries = syncQueries;
|
|
204
268
|
this.logger = new _common.Logger(SyncClientsManager.name);
|
|
@@ -215,9 +279,9 @@ SyncClientsManager = _ts_decorate([
|
|
|
215
279
|
_ts_metadata("design:type", Function),
|
|
216
280
|
_ts_metadata("design:paramtypes", [
|
|
217
281
|
typeof _axios.HttpService === "undefined" ? Object : _axios.HttpService,
|
|
218
|
-
typeof
|
|
219
|
-
typeof
|
|
220
|
-
typeof
|
|
282
|
+
typeof _authservice.AuthManager === "undefined" ? Object : _authservice.AuthManager,
|
|
283
|
+
typeof _authprovidersmodels.AuthProvider === "undefined" ? Object : _authprovidersmodels.AuthProvider,
|
|
284
|
+
typeof _authprovidertwofaservice.AuthProvider2FA === "undefined" ? Object : _authprovidertwofaservice.AuthProvider2FA,
|
|
221
285
|
typeof _usersmanagerservice.UsersManager === "undefined" ? Object : _usersmanagerservice.UsersManager,
|
|
222
286
|
typeof _syncqueriesservice.SyncQueries === "undefined" ? Object : _syncqueriesservice.SyncQueries
|
|
223
287
|
])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../backend/src/applications/sync/services/sync-clients-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 { HttpService } from '@nestjs/axios'\nimport { HttpException, HttpStatus, Injectable, Logger } from '@nestjs/common'\nimport { AxiosResponse } from 'axios'\nimport { FastifyReply } from 'fastify'\nimport crypto from 'node:crypto'\nimport fs from 'node:fs/promises'\nimport path from 'node:path'\nimport { AuthMethod } from '../../../authentication/models/auth-method'\nimport { AuthManager } from '../../../authentication/services/auth-manager.service'\nimport { AuthMethod2FA } from '../../../authentication/services/auth-methods/auth-method-two-fa.service'\nimport { convertHumanTimeToSeconds } from '../../../common/functions'\nimport { currentTimeStamp } from '../../../common/shared'\nimport { STATIC_PATH } from '../../../configuration/config.constants'\nimport { configuration } from '../../../configuration/config.environment'\nimport { CacheDecorator } from '../../../infrastructure/cache/cache.decorator'\nimport { HTTP_METHOD } from '../../applications.constants'\nimport { isPathExists } from '../../files/utils/files'\nimport { USER_PERMISSION } from '../../users/constants/user'\nimport { UserModel } from '../../users/models/user.model'\nimport { UsersManager } from '../../users/services/users-manager.service'\nimport { CLIENT_AUTH_TYPE, CLIENT_TOKEN_EXPIRATION_TIME, CLIENT_TOKEN_EXPIRED_ERROR, CLIENT_TOKEN_RENEW_TIME } from '../constants/auth'\nimport { APP_STORE_DIRNAME, APP_STORE_MANIFEST_FILE, APP_STORE_REPOSITORY, APP_STORE_URL } from '../constants/store'\nimport { SYNC_CLIENT_TYPE } from '../constants/sync'\nimport type { SyncClientAuthDto } from '../dtos/sync-client-auth.dto'\nimport type { SyncClientRegistrationDto } from '../dtos/sync-client-registration.dto'\nimport { AppStoreManifest } from '../interfaces/store-manifest.interface'\nimport { ClientAuthCookieDto, ClientAuthTokenDto } from '../interfaces/sync-client-auth.interface'\nimport { SyncClientPaths } from '../interfaces/sync-client-paths.interface'\nimport { SyncClient } from '../schemas/sync-client.interface'\nimport { SyncQueries } from './sync-queries.service'\n\n@Injectable()\nexport class SyncClientsManager {\n private readonly logger = new Logger(SyncClientsManager.name)\n\n constructor(\n private readonly http: HttpService,\n private readonly authManager: AuthManager,\n private readonly authMethod: AuthMethod,\n private readonly authMethod2Fa: AuthMethod2FA,\n private readonly usersManager: UsersManager,\n private readonly syncQueries: SyncQueries\n ) {}\n\n async register(clientRegistrationDto: SyncClientRegistrationDto, ip: string): Promise<{ clientToken: string }> {\n const user: UserModel = await this.authMethod.validateUser(clientRegistrationDto.login, clientRegistrationDto.password)\n if (!user) {\n this.logger.warn(`${this.register.name} - auth failed for user *${clientRegistrationDto.login}*`)\n throw new HttpException('Wrong login or password', HttpStatus.UNAUTHORIZED)\n }\n if (!user.havePermission(USER_PERMISSION.DESKTOP_APP)) {\n this.logger.warn(`${this.register.name} - user *${user.login}* (${user.id}) does not have permission : ${USER_PERMISSION.DESKTOP_APP}`)\n throw new HttpException('Missing permission', HttpStatus.FORBIDDEN)\n }\n if (configuration.auth.mfa.totp.enabled && user.twoFaEnabled) {\n if (!clientRegistrationDto.code) {\n this.logger.warn(`${this.register.name} - missing two-fa code for user *${user.login}* (${user.id})`)\n throw new HttpException('Missing TWO-FA code', HttpStatus.UNAUTHORIZED)\n }\n const auth = this.authMethod2Fa.validateTwoFactorCode(clientRegistrationDto.code, user.secrets.twoFaSecret)\n if (!auth.success) {\n this.logger.warn(`${this.register.name} - wrong two-fa code for user *${user.login}* (${user.id})`)\n this.usersManager.updateAccesses(user, ip, false).catch((e: Error) => this.logger.error(`${this.register.name} - ${e}`))\n throw new HttpException(auth.message, HttpStatus.UNAUTHORIZED)\n }\n }\n try {\n const token = await this.syncQueries.getOrCreateClient(user.id, clientRegistrationDto.clientId, clientRegistrationDto.info, ip)\n this.logger.log(`${this.register.name} - client *${clientRegistrationDto.info.type}* was registered for user *${user.login}* (${user.id})`)\n return { clientToken: token }\n } catch (e) {\n this.logger.error(`${this.register.name} - ${e}`)\n throw new HttpException('Error during the client registration', HttpStatus.INTERNAL_SERVER_ERROR)\n }\n }\n\n async unregister(user: UserModel): Promise<void> {\n try {\n await this.syncQueries.deleteClient(user.id, user.clientId)\n } catch (e) {\n this.logger.error(`${this.unregister.name} - ${e}`)\n throw new HttpException('Error during the removing of client registration', HttpStatus.INTERNAL_SERVER_ERROR)\n }\n }\n\n async authenticate(\n authType: CLIENT_AUTH_TYPE,\n syncClientAuthDto: SyncClientAuthDto,\n ip: string,\n res: FastifyReply\n ): Promise<ClientAuthTokenDto | ClientAuthCookieDto> {\n const client = await this.syncQueries.getClient(syncClientAuthDto.clientId, null, syncClientAuthDto.token)\n if (!client) {\n throw new HttpException('Client is unknown', HttpStatus.FORBIDDEN)\n }\n if (!client.enabled) {\n throw new HttpException('Client is disabled', HttpStatus.FORBIDDEN)\n }\n if (currentTimeStamp() >= client.tokenExpiration) {\n throw new HttpException(CLIENT_TOKEN_EXPIRED_ERROR, HttpStatus.FORBIDDEN)\n }\n this.syncQueries.updateClientInfo(client, client.info, ip).catch((e: Error) => this.logger.error(`${this.authenticate.name} - ${e}`))\n const user: UserModel = await this.usersManager.fromUserId(client.ownerId)\n if (!user) {\n throw new HttpException('User does not exist', HttpStatus.FORBIDDEN)\n }\n if (!user.isActive) {\n throw new HttpException('Account suspended or not authorized', HttpStatus.FORBIDDEN)\n }\n if (!user.havePermission(USER_PERMISSION.DESKTOP_APP)) {\n this.logger.warn(`${this.register.name} - does not have permission : ${USER_PERMISSION.DESKTOP_APP}`)\n throw new HttpException('Missing permission', HttpStatus.FORBIDDEN)\n }\n // set clientId\n user.clientId = client.id\n // update accesses\n this.usersManager.updateAccesses(user, ip, true).catch((e: Error) => this.logger.error(`${this.authenticate.name} - ${e}`))\n let r: ClientAuthTokenDto | ClientAuthCookieDto\n if (authType === CLIENT_AUTH_TYPE.COOKIE) {\n // used by the desktop app to perform the login setup using cookies\n r = await this.authManager.setCookies(user, res)\n } else if (authType === CLIENT_AUTH_TYPE.TOKEN) {\n // used by the cli app and the sync core\n r = await this.authManager.getTokens(user)\n }\n // check if the client token must be updated\n r.client_token_update = await this.renewTokenAndExpiration(client, user)\n return r\n }\n\n getClients(user: UserModel): Promise<SyncClientPaths[]> {\n return this.syncQueries.getClients(user)\n }\n\n async renewTokenAndExpiration(client: SyncClient, owner: UserModel): Promise<string | undefined> {\n if (currentTimeStamp() + convertHumanTimeToSeconds(CLIENT_TOKEN_RENEW_TIME) < client.tokenExpiration) {\n // client token expiration is not close enough\n return undefined\n }\n const token = crypto.randomUUID()\n const expiration = currentTimeStamp() + convertHumanTimeToSeconds(CLIENT_TOKEN_EXPIRATION_TIME)\n this.logger.log(`${this.renewTokenAndExpiration.name} - renew token for user *${owner.login}* and client *${client.id}*`)\n try {\n await this.syncQueries.renewClientTokenAndExpiration(client.id, token, expiration)\n } catch (e) {\n this.logger.error(`${this.renewTokenAndExpiration.name} - unable to renew token for user *${owner.login}* and client *${client.id}* : ${e}`)\n throw new HttpException('Unable to update client token', HttpStatus.BAD_REQUEST)\n }\n return token\n }\n\n async deleteClient(user: UserModel, clientId: string): Promise<void> {\n try {\n await this.syncQueries.deleteClient(user.id, clientId)\n } catch (e) {\n this.logger.error(`${this.deleteClient.name} - ${e}`)\n throw new HttpException('Unable to delete client', HttpStatus.INTERNAL_SERVER_ERROR)\n }\n }\n\n @CacheDecorator(3600)\n async checkAppStore(): Promise<AppStoreManifest> {\n let manifest: AppStoreManifest = null\n if (configuration.applications.appStore.repository === APP_STORE_REPOSITORY.PUBLIC) {\n const url = `${APP_STORE_URL}/${APP_STORE_MANIFEST_FILE}`\n try {\n const res: AxiosResponse = await this.http.axiosRef({\n method: HTTP_METHOD.GET,\n url: url\n })\n manifest = res.data\n manifest.repository = APP_STORE_REPOSITORY.PUBLIC\n } catch (e) {\n this.logger.warn(`${this.checkAppStore.name} - unable to retrieve ${url} : ${e}`)\n }\n } else {\n const latestFile = path.join(STATIC_PATH, APP_STORE_DIRNAME, APP_STORE_MANIFEST_FILE)\n if (!(await isPathExists(latestFile))) {\n this.logger.warn(`${this.checkAppStore.name} - ${latestFile} does not exist`)\n } else {\n try {\n manifest = JSON.parse(await fs.readFile(latestFile, 'utf8'))\n manifest.repository = APP_STORE_REPOSITORY.LOCAL\n // rewrite urls to local repository\n for (const [os, packages] of Object.entries(manifest.platform)) {\n for (const p of packages) {\n if (p.package.toLowerCase().startsWith(SYNC_CLIENT_TYPE.DESKTOP)) {\n p.url = `${APP_STORE_DIRNAME}/${SYNC_CLIENT_TYPE.DESKTOP}/${os}/${p.package}`\n } else {\n p.url = `${APP_STORE_DIRNAME}/${SYNC_CLIENT_TYPE.CLI}/${p.package}`\n }\n }\n }\n } catch (e) {\n this.logger.error(`${this.checkAppStore.name} - ${latestFile} : ${e}`)\n }\n }\n }\n return manifest\n }\n}\n"],"names":["SyncClientsManager","register","clientRegistrationDto","ip","user","authMethod","validateUser","login","password","logger","warn","name","HttpException","HttpStatus","UNAUTHORIZED","havePermission","USER_PERMISSION","DESKTOP_APP","id","FORBIDDEN","configuration","auth","mfa","totp","enabled","twoFaEnabled","code","authMethod2Fa","validateTwoFactorCode","secrets","twoFaSecret","success","usersManager","updateAccesses","catch","e","error","message","token","syncQueries","getOrCreateClient","clientId","info","log","type","clientToken","INTERNAL_SERVER_ERROR","unregister","deleteClient","authenticate","authType","syncClientAuthDto","res","client","getClient","currentTimeStamp","tokenExpiration","CLIENT_TOKEN_EXPIRED_ERROR","updateClientInfo","fromUserId","ownerId","isActive","r","CLIENT_AUTH_TYPE","COOKIE","authManager","setCookies","TOKEN","getTokens","client_token_update","renewTokenAndExpiration","getClients","owner","convertHumanTimeToSeconds","CLIENT_TOKEN_RENEW_TIME","undefined","crypto","randomUUID","expiration","CLIENT_TOKEN_EXPIRATION_TIME","renewClientTokenAndExpiration","BAD_REQUEST","checkAppStore","manifest","applications","appStore","repository","APP_STORE_REPOSITORY","PUBLIC","url","APP_STORE_URL","APP_STORE_MANIFEST_FILE","http","axiosRef","method","HTTP_METHOD","GET","data","latestFile","path","join","STATIC_PATH","APP_STORE_DIRNAME","isPathExists","JSON","parse","fs","readFile","LOCAL","os","packages","Object","entries","platform","p","package","toLowerCase","startsWith","SYNC_CLIENT_TYPE","DESKTOP","CLI","Logger"],"mappings":"AAAA;;;;CAIC;;;;+BAkCYA;;;eAAAA;;;uBAhCe;wBACkC;mEAG3C;iEACJ;iEACE;4BACU;oCACC;wCACE;2BACY;wBACT;iCACL;mCACE;gCACC;uCACH;uBACC;sBACG;qCAEH;sBACuF;uBACpB;sBAC/D;oCAOL;;;;;;;;;;;;;;;AAGrB,IAAA,AAAMA,qBAAN,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oBACF;gBACF,EAAE,OAAOhF,GAAG;oBACV,IAAI,CAAC1B,MAAM,CAAC2B,KAAK,CAAC,GAAG,IAAI,CAAC8C,aAAa,CAACvE,IAAI,CAAC,GAAG,EAAEuF,WAAW,GAAG,EAAE/D,GAAG;gBACvE;YACF;QACF;QACA,OAAOgD;IACT;IApKA,YACE,AAAiBS,IAAiB,EAClC,AAAiB3B,WAAwB,EACzC,AAAiB5D,UAAsB,EACvC,AAAiBsB,aAA4B,EAC7C,AAAiBK,YAA0B,EAC3C,AAAiBO,WAAwB,CACzC;aANiBqD,OAAAA;aACA3B,cAAAA;aACA5D,aAAAA;aACAsB,gBAAAA;aACAK,eAAAA;aACAO,cAAAA;aARF9B,SAAS,IAAIgH,cAAM,CAACzH,mBAAmBW,IAAI;IASzD;AA8JL"}
|
|
1
|
+
{"version":3,"sources":["../../../../../backend/src/applications/sync/services/sync-clients-manager.service.ts"],"sourcesContent":["import { HttpService } from '@nestjs/axios'\nimport { HttpException, HttpStatus, Injectable, Logger } from '@nestjs/common'\nimport { AxiosResponse } from 'axios'\nimport { FastifyReply } from 'fastify'\nimport crypto from 'node:crypto'\nimport fs from 'node:fs/promises'\nimport path from 'node:path'\nimport { AuthManager } from '../../../authentication/auth.service'\nimport { AUTH_SCOPE } from '../../../authentication/constants/scope'\nimport { FastifyAuthenticatedRequest } from '../../../authentication/interfaces/auth-request.interface'\nimport { AuthProvider } from '../../../authentication/providers/auth-providers.models'\nimport { AuthProvider2FA } from '../../../authentication/providers/two-fa/auth-provider-two-fa.service'\nimport { convertHumanTimeToSeconds } from '../../../common/functions'\nimport { currentTimeStamp, RELEASES_URL } from '../../../common/shared'\nimport { STATIC_PATH } from '../../../configuration/config.constants'\nimport { configuration } from '../../../configuration/config.environment'\nimport { CacheDecorator } from '../../../infrastructure/cache/cache.decorator'\nimport { HTTP_METHOD } from '../../applications.constants'\nimport { isPathExists } from '../../files/utils/files'\nimport { USER_PERMISSION } from '../../users/constants/user'\nimport { UserModel } from '../../users/models/user.model'\nimport { UsersManager } from '../../users/services/users-manager.service'\nimport { CLIENT_AUTH_TYPE, CLIENT_TOKEN_EXPIRATION_TIME, CLIENT_TOKEN_EXPIRED_ERROR, CLIENT_TOKEN_RENEW_TIME } from '../constants/auth'\nimport { APP_STORE_DIRNAME, APP_STORE_MANIFEST_FILE, APP_STORE_REPOSITORY } from '../constants/store'\nimport { SYNC_CLIENT_TYPE } from '../constants/sync'\nimport type { SyncClientAuthDto } from '../dtos/sync-client-auth.dto'\nimport { SyncClientAuthRegistrationDto, SyncClientRegistrationDto } from '../dtos/sync-client-registration.dto'\nimport { AppStoreManifest } from '../interfaces/store-manifest.interface'\nimport { SyncClientAuthCookie, SyncClientAuthRegistration, SyncClientAuthToken } from '../interfaces/sync-client-auth.interface'\nimport { SyncClientPaths } from '../interfaces/sync-client-paths.interface'\nimport { SyncClientInfo } from '../interfaces/sync-client.interface'\nimport { SyncClient } from '../schemas/sync-client.interface'\nimport { SyncQueries } from './sync-queries.service'\n\n@Injectable()\nexport class SyncClientsManager {\n private readonly logger = new Logger(SyncClientsManager.name)\n\n constructor(\n private readonly http: HttpService,\n private readonly authManager: AuthManager,\n private readonly authProvider: AuthProvider,\n private readonly authProvider2FA: AuthProvider2FA,\n private readonly usersManager: UsersManager,\n private readonly syncQueries: SyncQueries\n ) {}\n\n async register(clientRegistrationDto: SyncClientRegistrationDto, ip: string): Promise<SyncClientAuthRegistration> {\n const user: UserModel = await this.authProvider.validateUser(clientRegistrationDto.login, clientRegistrationDto.password, ip, AUTH_SCOPE.CLIENT)\n if (!user) {\n this.logger.warn({ tag: this.register.name, msg: `auth failed for user *${clientRegistrationDto.login}*` })\n throw new HttpException('Wrong login or password', HttpStatus.UNAUTHORIZED)\n }\n if (!user.havePermission(USER_PERMISSION.DESKTOP_APP)) {\n this.logger.warn({\n tag: this.register.name,\n msg: `user *${user.login}* (${user.id}) does not have permission : ${USER_PERMISSION.DESKTOP_APP}`\n })\n throw new HttpException('Missing permission', HttpStatus.FORBIDDEN)\n }\n if (configuration.auth.mfa.totp.enabled && user.twoFaEnabled) {\n // Checking TOTP code and recovery code\n if (!clientRegistrationDto.code) {\n this.logger.warn({ tag: this.register.name, msg: `missing two-fa code for user *${user.login}* (${user.id})` })\n throw new HttpException('Missing TWO-FA code', HttpStatus.UNAUTHORIZED)\n }\n const authCode = this.authProvider2FA.validateTwoFactorCode(clientRegistrationDto.code, user.secrets.twoFaSecret)\n if (!authCode.success) {\n this.logger.warn({ tag: this.register.name, msg: `two-fa code for *${user.login}* (${user.id}) - ${authCode.message}` })\n const authRCode = await this.authProvider2FA.validateRecoveryCode(user.id, clientRegistrationDto.code, user.secrets.recoveryCodes)\n if (!authRCode.success) {\n this.logger.warn({ tag: this.register.name, msg: `two-fa recovery code for *${user.login}* (${user.id}) - ${authRCode.message}` })\n this.usersManager.updateAccesses(user, ip, false).catch((e: Error) => this.logger.error({ tag: this.register.name, msg: `${e}` }))\n throw new HttpException(authCode.message, HttpStatus.UNAUTHORIZED)\n }\n }\n }\n return this.getOrCreateClient(user, clientRegistrationDto.clientId, clientRegistrationDto.info, ip)\n }\n\n async registerWithAuth(\n clientAuthenticatedRegistrationDto: SyncClientAuthRegistrationDto,\n req: FastifyAuthenticatedRequest\n ): Promise<SyncClientAuthRegistration> {\n const clientId = clientAuthenticatedRegistrationDto.clientId || crypto.randomUUID()\n return this.getOrCreateClient(req.user, clientId, clientAuthenticatedRegistrationDto.info, req.ip)\n }\n\n async unregister(user: UserModel): Promise<void> {\n try {\n await this.syncQueries.deleteClient(user.id, user.clientId)\n } catch (e) {\n this.logger.error({ tag: this.unregister.name, msg: `${e}` })\n throw new HttpException('Error during the removing of client registration', HttpStatus.INTERNAL_SERVER_ERROR)\n }\n }\n\n async authenticate(\n authType: CLIENT_AUTH_TYPE,\n syncClientAuthDto: SyncClientAuthDto,\n ip: string,\n res: FastifyReply\n ): Promise<SyncClientAuthToken | SyncClientAuthCookie> {\n const client = await this.syncQueries.getClient(syncClientAuthDto.clientId, null, syncClientAuthDto.token)\n if (!client) {\n throw new HttpException('Client is unknown', HttpStatus.FORBIDDEN)\n }\n if (!client.enabled) {\n throw new HttpException('Client is disabled', HttpStatus.FORBIDDEN)\n }\n if (currentTimeStamp() >= client.tokenExpiration) {\n throw new HttpException(CLIENT_TOKEN_EXPIRED_ERROR, HttpStatus.FORBIDDEN)\n }\n this.syncQueries.updateClientInfo(client, client.info, ip).catch((e: Error) => this.logger.error({ tag: this.authenticate.name, msg: `${e}` }))\n const user: UserModel = await this.usersManager.fromUserId(client.ownerId)\n if (!user) {\n throw new HttpException('User does not exist', HttpStatus.FORBIDDEN)\n }\n if (!user.isActive) {\n throw new HttpException('Account suspended or not authorized', HttpStatus.FORBIDDEN)\n }\n if (!user.havePermission(USER_PERMISSION.DESKTOP_APP)) {\n this.logger.warn({ tag: this.authenticate.name, msg: `does not have permission : ${USER_PERMISSION.DESKTOP_APP}` })\n throw new HttpException('Missing permission', HttpStatus.FORBIDDEN)\n }\n // set clientId\n user.clientId = client.id\n // update accesses\n this.usersManager.updateAccesses(user, ip, true).catch((e: Error) => this.logger.error({ tag: this.authenticate.name, msg: `${e}` }))\n let r: SyncClientAuthToken | SyncClientAuthCookie\n if (authType === CLIENT_AUTH_TYPE.COOKIE) {\n // used by the desktop app to perform the login setup using cookies\n r = await this.authManager.setCookies(user, res)\n } else if (authType === CLIENT_AUTH_TYPE.TOKEN) {\n // used by the cli app and the sync core\n r = await this.authManager.getTokens(user)\n }\n // check if the client token must be updated\n r.client_token_update = await this.renewTokenAndExpiration(client, user)\n return r\n }\n\n getClients(user: UserModel): Promise<SyncClientPaths[]> {\n return this.syncQueries.getClients(user)\n }\n\n async renewTokenAndExpiration(client: SyncClient, owner: UserModel): Promise<string | undefined> {\n if (currentTimeStamp() + convertHumanTimeToSeconds(CLIENT_TOKEN_RENEW_TIME) < client.tokenExpiration) {\n // client token expiration is not close enough\n return undefined\n }\n const token = crypto.randomUUID()\n const expiration = currentTimeStamp() + convertHumanTimeToSeconds(CLIENT_TOKEN_EXPIRATION_TIME)\n this.logger.log({ tag: this.renewTokenAndExpiration.name, msg: `renew token for user *${owner.login}* and client *${client.id}*` })\n try {\n await this.syncQueries.renewClientTokenAndExpiration(client.id, token, expiration)\n } catch (e) {\n this.logger.error({\n tag: this.renewTokenAndExpiration.name,\n msg: `unable to renew token for user *${owner.login}* and client *${client.id}* : ${e}`\n })\n throw new HttpException('Unable to update client token', HttpStatus.BAD_REQUEST)\n }\n return token\n }\n\n async deleteClient(user: UserModel, clientId: string): Promise<void> {\n try {\n await this.syncQueries.deleteClient(user.id, clientId)\n } catch (e) {\n this.logger.error({ tag: this.deleteClient.name, msg: `${e}` })\n throw new HttpException('Unable to delete client', HttpStatus.INTERNAL_SERVER_ERROR)\n }\n }\n\n @CacheDecorator(3600)\n async checkAppStore(): Promise<AppStoreManifest> {\n let manifest: AppStoreManifest = null\n if (configuration.applications.appStore.repository === APP_STORE_REPOSITORY.PUBLIC) {\n const url = `${RELEASES_URL}/${APP_STORE_MANIFEST_FILE}`\n try {\n const res: AxiosResponse = await this.http.axiosRef({\n method: HTTP_METHOD.GET,\n url: url\n })\n manifest = res.data\n manifest.repository = APP_STORE_REPOSITORY.PUBLIC\n } catch (e) {\n this.logger.warn({ tag: this.checkAppStore.name, msg: `unable to retrieve ${url} : ${e}` })\n }\n } else {\n const latestFile = path.join(STATIC_PATH, APP_STORE_DIRNAME, APP_STORE_MANIFEST_FILE)\n if (!(await isPathExists(latestFile))) {\n this.logger.warn({ tag: this.checkAppStore.name, msg: `${latestFile} does not exist` })\n } else {\n try {\n manifest = JSON.parse(await fs.readFile(latestFile, 'utf8'))\n manifest.repository = APP_STORE_REPOSITORY.LOCAL\n // rewrite urls to local repository\n for (const [os, packages] of Object.entries(manifest.platform)) {\n for (const p of packages) {\n if (p.package.toLowerCase().startsWith(SYNC_CLIENT_TYPE.DESKTOP)) {\n p.url = `${APP_STORE_DIRNAME}/${SYNC_CLIENT_TYPE.DESKTOP}/${os}/${p.package}`\n } else {\n p.url = `${APP_STORE_DIRNAME}/${SYNC_CLIENT_TYPE.CLI}/${p.package}`\n }\n }\n }\n } catch (e) {\n this.logger.error({ tag: this.checkAppStore.name, msg: `${latestFile} : ${e}` })\n }\n }\n }\n return manifest\n }\n\n private async getOrCreateClient(user: UserModel, clientId: string, clientInfo: SyncClientInfo, ip: string): Promise<SyncClientAuthRegistration> {\n try {\n const token = await this.syncQueries.getOrCreateClient(user.id, clientId, clientInfo, ip)\n this.logger.log({ tag: this.getOrCreateClient.name, msg: `client *${clientInfo.type}* was registered for user *${user.login}* (${user.id})` })\n return { clientId: clientId, clientToken: token } satisfies SyncClientAuthRegistration\n } catch (e) {\n this.logger.error({ tag: this.getOrCreateClient.name, msg: `${e}` })\n throw new HttpException('Error during the client registration', HttpStatus.INTERNAL_SERVER_ERROR)\n }\n }\n}\n"],"names":["SyncClientsManager","register","clientRegistrationDto","ip","user","authProvider","validateUser","login","password","AUTH_SCOPE","CLIENT","logger","warn","tag","name","msg","HttpException","HttpStatus","UNAUTHORIZED","havePermission","USER_PERMISSION","DESKTOP_APP","id","FORBIDDEN","configuration","auth","mfa","totp","enabled","twoFaEnabled","code","authCode","authProvider2FA","validateTwoFactorCode","secrets","twoFaSecret","success","message","authRCode","validateRecoveryCode","recoveryCodes","usersManager","updateAccesses","catch","e","error","getOrCreateClient","clientId","info","registerWithAuth","clientAuthenticatedRegistrationDto","req","crypto","randomUUID","unregister","syncQueries","deleteClient","INTERNAL_SERVER_ERROR","authenticate","authType","syncClientAuthDto","res","client","getClient","token","currentTimeStamp","tokenExpiration","CLIENT_TOKEN_EXPIRED_ERROR","updateClientInfo","fromUserId","ownerId","isActive","r","CLIENT_AUTH_TYPE","COOKIE","authManager","setCookies","TOKEN","getTokens","client_token_update","renewTokenAndExpiration","getClients","owner","convertHumanTimeToSeconds","CLIENT_TOKEN_RENEW_TIME","undefined","expiration","CLIENT_TOKEN_EXPIRATION_TIME","log","renewClientTokenAndExpiration","BAD_REQUEST","checkAppStore","manifest","applications","appStore","repository","APP_STORE_REPOSITORY","PUBLIC","url","RELEASES_URL","APP_STORE_MANIFEST_FILE","http","axiosRef","method","HTTP_METHOD","GET","data","latestFile","path","join","STATIC_PATH","APP_STORE_DIRNAME","isPathExists","JSON","parse","fs","readFile","LOCAL","os","packages","Object","entries","platform","p","package","toLowerCase","startsWith","SYNC_CLIENT_TYPE","DESKTOP","CLI","clientInfo","type","clientToken","Logger"],"mappings":";;;;+BAmCaA;;;eAAAA;;;uBAnCe;wBACkC;mEAG3C;iEACJ;iEACE;6BACW;uBACD;qCAEE;0CACG;2BACU;wBACK;iCACnB;mCACE;gCACC;uCACH;uBACC;sBACG;qCAEH;sBACuF;uBACnC;sBAChD;oCAQL;;;;;;;;;;;;;;;AAGrB,IAAA,AAAMA,qBAAN,MAAMA;IAYX,MAAMC,SAASC,qBAAgD,EAAEC,EAAU,EAAuC;QAChH,MAAMC,OAAkB,MAAM,IAAI,CAACC,YAAY,CAACC,YAAY,CAACJ,sBAAsBK,KAAK,EAAEL,sBAAsBM,QAAQ,EAAEL,IAAIM,iBAAU,CAACC,MAAM;QAC/I,IAAI,CAACN,MAAM;YACT,IAAI,CAACO,MAAM,CAACC,IAAI,CAAC;gBAAEC,KAAK,IAAI,CAACZ,QAAQ,CAACa,IAAI;gBAAEC,KAAK,CAAC,sBAAsB,EAAEb,sBAAsBK,KAAK,CAAC,CAAC,CAAC;YAAC;YACzG,MAAM,IAAIS,qBAAa,CAAC,2BAA2BC,kBAAU,CAACC,YAAY;QAC5E;QACA,IAAI,CAACd,KAAKe,cAAc,CAACC,qBAAe,CAACC,WAAW,GAAG;YACrD,IAAI,CAACV,MAAM,CAACC,IAAI,CAAC;gBACfC,KAAK,IAAI,CAACZ,QAAQ,CAACa,IAAI;gBACvBC,KAAK,CAAC,MAAM,EAAEX,KAAKG,KAAK,CAAC,GAAG,EAAEH,KAAKkB,EAAE,CAAC,6BAA6B,EAAEF,qBAAe,CAACC,WAAW,EA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AG;oBAAC;gBAChF;YACF;QACF;QACA,OAAOgD;IACT;IAEA,MAAc9C,kBAAkB1C,IAAe,EAAE2C,QAAgB,EAAEmF,UAA0B,EAAE/H,EAAU,EAAuC;QAC9I,IAAI;YACF,MAAM6D,QAAQ,MAAM,IAAI,CAACT,WAAW,CAACT,iBAAiB,CAAC1C,KAAKkB,EAAE,EAAEyB,UAAUmF,YAAY/H;YACtF,IAAI,CAACQ,MAAM,CAAC6E,GAAG,CAAC;gBAAE3E,KAAK,IAAI,CAACiC,iBAAiB,CAAChC,IAAI;gBAAEC,KAAK,CAAC,QAAQ,EAAEmH,WAAWC,IAAI,CAAC,2BAA2B,EAAE/H,KAAKG,KAAK,CAAC,GAAG,EAAEH,KAAKkB,EAAE,CAAC,CAAC,CAAC;YAAC;YAC5I,OAAO;gBAAEyB,UAAUA;gBAAUqF,aAAapE;YAAM;QAClD,EAAE,OAAOpB,GAAG;YACV,IAAI,CAACjC,MAAM,CAACkC,KAAK,CAAC;gBAAEhC,KAAK,IAAI,CAACiC,iBAAiB,CAAChC,IAAI;gBAAEC,KAAK,GAAG6B,GAAG;YAAC;YAClE,MAAM,IAAI5B,qBAAa,CAAC,wCAAwCC,kBAAU,CAACwC,qBAAqB;QAClG;IACF;IA3LA,YACE,AAAiB4C,IAAiB,EAClC,AAAiB1B,WAAwB,EACzC,AAAiBtE,YAA0B,EAC3C,AAAiB2B,eAAgC,EACjD,AAAiBS,YAA0B,EAC3C,AAAiBc,WAAwB,CACzC;aANiB8C,OAAAA;aACA1B,cAAAA;aACAtE,eAAAA;aACA2B,kBAAAA;aACAS,eAAAA;aACAc,cAAAA;aARF5C,SAAS,IAAI0H,cAAM,CAACrI,mBAAmBc,IAAI;IASzD;AAqLL"}
|
|
@@ -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
|
});
|
|
@@ -11,9 +7,9 @@ const _common = require("@nestjs/common");
|
|
|
11
7
|
const _testing = require("@nestjs/testing");
|
|
12
8
|
const _nodecrypto = /*#__PURE__*/ _interop_require_default(require("node:crypto"));
|
|
13
9
|
const _promises = /*#__PURE__*/ _interop_require_default(require("node:fs/promises"));
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
10
|
+
const _authservice = require("../../../authentication/auth.service");
|
|
11
|
+
const _authprovidersmodels = require("../../../authentication/providers/auth-providers.models");
|
|
12
|
+
const _authprovidertwofaservice = require("../../../authentication/providers/two-fa/auth-provider-two-fa.service");
|
|
17
13
|
const _functions = /*#__PURE__*/ _interop_require_wildcard(require("../../../common/functions"));
|
|
18
14
|
const _shared = /*#__PURE__*/ _interop_require_wildcard(require("../../../common/shared"));
|
|
19
15
|
const _configenvironment = require("../../../configuration/config.environment");
|
|
@@ -104,7 +100,7 @@ describe(_syncclientsmanagerservice.SyncClientsManager.name, ()=>{
|
|
|
104
100
|
// Mocks
|
|
105
101
|
let http;
|
|
106
102
|
let authManager;
|
|
107
|
-
let
|
|
103
|
+
let authProvider;
|
|
108
104
|
let usersManager;
|
|
109
105
|
let syncQueries;
|
|
110
106
|
let cacheMock;
|
|
@@ -142,7 +138,7 @@ describe(_syncclientsmanagerservice.SyncClientsManager.name, ()=>{
|
|
|
142
138
|
setCookies: jest.fn(),
|
|
143
139
|
getTokens: jest.fn()
|
|
144
140
|
};
|
|
145
|
-
|
|
141
|
+
authProvider = {
|
|
146
142
|
validateUser: jest.fn()
|
|
147
143
|
};
|
|
148
144
|
usersManager = {
|
|
@@ -183,15 +179,15 @@ describe(_syncclientsmanagerservice.SyncClientsManager.name, ()=>{
|
|
|
183
179
|
useValue: usersManager
|
|
184
180
|
},
|
|
185
181
|
{
|
|
186
|
-
provide:
|
|
182
|
+
provide: _authservice.AuthManager,
|
|
187
183
|
useValue: authManager
|
|
188
184
|
},
|
|
189
185
|
{
|
|
190
|
-
provide:
|
|
191
|
-
useValue:
|
|
186
|
+
provide: _authprovidersmodels.AuthProvider,
|
|
187
|
+
useValue: authProvider
|
|
192
188
|
},
|
|
193
189
|
{
|
|
194
|
-
provide:
|
|
190
|
+
provide: _authprovidertwofaservice.AuthProvider2FA,
|
|
195
191
|
useValue: {}
|
|
196
192
|
}
|
|
197
193
|
]
|
|
@@ -252,13 +248,13 @@ describe(_syncclientsmanagerservice.SyncClientsManager.name, ()=>{
|
|
|
252
248
|
_common.HttpStatus.FORBIDDEN
|
|
253
249
|
]
|
|
254
250
|
])('should throw %s', async (_label, user, status)=>{
|
|
255
|
-
|
|
251
|
+
authProvider.validateUser.mockResolvedValue(user);
|
|
256
252
|
await expect(service.register(baseDto, '1.2.3.4')).rejects.toMatchObject({
|
|
257
253
|
status
|
|
258
254
|
});
|
|
259
255
|
});
|
|
260
256
|
it('should return client token when registration succeeds', async ()=>{
|
|
261
|
-
|
|
257
|
+
authProvider.validateUser.mockResolvedValue({
|
|
262
258
|
id: 10,
|
|
263
259
|
login: 'john',
|
|
264
260
|
havePermission: ()=>true
|
|
@@ -266,12 +262,13 @@ describe(_syncclientsmanagerservice.SyncClientsManager.name, ()=>{
|
|
|
266
262
|
syncQueries.getOrCreateClient.mockResolvedValue('token-abc');
|
|
267
263
|
const r = await service.register(baseDto, '1.2.3.4');
|
|
268
264
|
expect(r).toEqual({
|
|
265
|
+
clientId: 'client-1',
|
|
269
266
|
clientToken: 'token-abc'
|
|
270
267
|
});
|
|
271
268
|
expect(syncQueries.getOrCreateClient).toHaveBeenCalledWith(10, 'client-1', baseDto.info, '1.2.3.4');
|
|
272
269
|
});
|
|
273
270
|
it('should throw Internal Server Error when persistence fails', async ()=>{
|
|
274
|
-
|
|
271
|
+
authProvider.validateUser.mockResolvedValue({
|
|
275
272
|
id: 10,
|
|
276
273
|
login: 'john',
|
|
277
274
|
havePermission: ()=>true
|