pigallery2-extension-kit 2.0.1-edge → 2.0.3-edge
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/README.md +108 -2
- package/events.drawio +1 -0
- package/events.png +0 -0
- package/index.js +0 -3
- package/index.js.map +1 -1
- package/index.ts +1 -1
- package/lib/backend/model/NotifocationManager.js +44 -0
- package/lib/backend/model/PasswordHelper.js +20 -0
- package/lib/backend/model/extension/ExtensionDecorator.d.ts +6 -0
- package/lib/{src/backend → backend}/model/extension/ExtensionEvent.d.ts +1 -1
- package/lib/{src/backend → backend}/model/extension/IExtension.d.ts +29 -9
- package/lib/common/BackendTexts.js +14 -0
- package/lib/common/SupportedFormats.js +45 -0
- package/lib/common/Utils.js +284 -0
- package/lib/common/config/private/Config.js +97 -0
- package/lib/common/config/private/MessagingConfig.js +134 -0
- package/lib/common/config/private/PrivateConfig.js +1411 -0
- package/lib/common/config/private/WebConfig.js +19 -0
- package/lib/common/config/public/ClientConfig.js +1819 -0
- package/lib/common/config/public/Config.js +24 -0
- package/lib/common/entities/AutoCompleteItem.js +13 -0
- package/lib/common/entities/ConentWrapper.js +479 -0
- package/lib/common/entities/DirectoryDTO.js +51 -0
- package/lib/common/entities/DuplicatesDTO.js +2 -0
- package/lib/common/entities/DynamicConfig.js +2 -0
- package/lib/common/entities/Error.js +45 -0
- package/lib/common/entities/FileDTO.js +2 -0
- package/lib/common/entities/GridSizes.js +11 -0
- package/lib/common/entities/LoginCredential.js +11 -0
- package/lib/common/entities/MDFileDTO.js +2 -0
- package/lib/common/entities/MediaDTO.js +53 -0
- package/lib/common/entities/MediaPickDTO.js +2 -0
- package/lib/common/entities/Message.js +12 -0
- package/lib/common/entities/NotificationDTO.js +9 -0
- package/lib/common/entities/PasswordChangeRequest.js +12 -0
- package/lib/common/entities/PersonDTO.js +2 -0
- package/lib/common/entities/PhotoDTO.js +2 -0
- package/lib/common/entities/SearchQueryDTO.js +130 -0
- package/lib/common/entities/SearchResultDTO.js +2 -0
- package/lib/common/entities/SharingDTO.js +2 -0
- package/lib/common/entities/SortingMethods.js +41 -0
- package/lib/common/entities/UserDTO.js +46 -0
- package/lib/common/entities/UserModificationRequest.js +9 -0
- package/lib/common/entities/VideoDTO.js +2 -0
- package/lib/common/entities/album/AlbumBaseDTO.js +2 -0
- package/lib/common/entities/album/SavedSearchDTO.js +2 -0
- package/lib/common/entities/job/JobDTO.js +29 -0
- package/lib/common/entities/job/JobProgressDTO.js +12 -0
- package/lib/common/entities/job/JobScheduleDTO.js +53 -0
- package/lib/common/entities/settings/IndexingDTO.js +2 -0
- package/lib/common/entities/settings/StatisticDTO.js +2 -0
- package/package.json +1 -1
- package/lib/extension/index.d.ts +0 -1
- package/lib/src/backend/model/extension/ExtensionDecorator.d.ts +0 -6
- package/lib/test.d.ts +0 -1
- package/lib/test2.d.ts +0 -1
- /package/lib/{src/backend → backend}/Logger.d.ts +0 -0
- /package/lib/{src/backend → backend}/ProjectPath.d.ts +0 -0
- /package/lib/{src/backend → backend}/exceptions/LocationLookupException.d.ts +0 -0
- /package/lib/{src/backend → backend}/index.d.ts +0 -0
- /package/lib/{src/backend → backend}/middlewares/AlbumMWs.d.ts +0 -0
- /package/lib/{src/backend → backend}/middlewares/GalleryMWs.d.ts +0 -0
- /package/lib/{src/backend → backend}/middlewares/MetaFileMWs.d.ts +0 -0
- /package/lib/{src/backend → backend}/middlewares/NotificationMWs.d.ts +0 -0
- /package/lib/{src/backend → backend}/middlewares/PersonMWs.d.ts +0 -0
- /package/lib/{src/backend → backend}/middlewares/RenderingMWs.d.ts +0 -0
- /package/lib/{src/backend → backend}/middlewares/ServerTimingMWs.d.ts +0 -0
- /package/lib/{src/backend → backend}/middlewares/SharingMWs.d.ts +0 -0
- /package/lib/{src/backend → backend}/middlewares/VersionMWs.d.ts +0 -0
- /package/lib/{src/backend → backend}/middlewares/admin/AdminMWs.d.ts +0 -0
- /package/lib/{src/backend → backend}/middlewares/admin/SettingsMWs.d.ts +0 -0
- /package/lib/{src/backend → backend}/middlewares/thumbnail/PhotoConverterMWs.d.ts +0 -0
- /package/lib/{src/backend → backend}/middlewares/thumbnail/ThumbnailGeneratorMWs.d.ts +0 -0
- /package/lib/{src/backend → backend}/middlewares/user/AuthenticationMWs.d.ts +0 -0
- /package/lib/{src/backend → backend}/middlewares/user/UserMWs.d.ts +0 -0
- /package/lib/{src/backend → backend}/middlewares/user/UserRequestConstrainsMWs.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/EventLoopHandler.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/FFmpegFactory.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/Localizations.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/NotifocationManager.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/ObjectManagers.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/PasswordHelper.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/AlbumManager.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/CoverManager.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/GalleryManager.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/IObjectManager.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/IndexingManager.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/LocationManager.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/PersonManager.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/SQLConnection.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/SearchManager.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/SharingManager.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/UserManager.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/VersionManager.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/enitites/DirectoryEntity.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/enitites/EntityUtils.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/enitites/FileEntity.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/enitites/MDFileEntity.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/enitites/MediaEntity.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/enitites/PersonEntry.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/enitites/PersonJunctionTable.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/enitites/PhotoEntity.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/enitites/SharingEntity.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/enitites/UserEntity.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/enitites/VersionEntity.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/enitites/VideoEntity.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/enitites/album/AlbumBaseEntity.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/database/enitites/album/SavedSearchEntity.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/diagnostics/ConfigDiagnostics.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/extension/ExpressRouterWrapper.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/extension/ExtensionApp.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/extension/ExtensionConfigWrapper.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/extension/ExtensionDB.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/extension/ExtensionManager.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/extension/ExtensionMessengerHandler.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/extension/ExtensionObject.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/fileaccess/DiskManager.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/fileaccess/MetadataLoader.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/fileaccess/PhotoWorker.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/fileaccess/TaskExecuter.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/fileaccess/TaskQue.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/fileaccess/VideoConverterWorker.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/fileaccess/fileprocessing/GPXProcessing.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/fileaccess/fileprocessing/PhotoProcessing.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/fileaccess/fileprocessing/VideoProcessing.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/JobManager.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/JobProgressManager.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/JobRepository.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/jobs/AlbumCoverFillingJob.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/jobs/AlbumCoverResetJob.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/jobs/AlbumResetJob.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/jobs/FileJob.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/jobs/GPXCompressionJob.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/jobs/GPXCompressionResetJob.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/jobs/GalleryResetJob.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/jobs/IJob.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/jobs/IJobListener.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/jobs/IndexingJob.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/jobs/Job.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/jobs/JobProgress.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/jobs/PhotoConvertingJob.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/jobs/TempFolderCleaningJob.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/jobs/ThumbnailGenerationJob.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/jobs/TopPickSendJob.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/jobs/jobs/VideoConvertingJob.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/messenger/EmailMessenger.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/messenger/ExtensionMessenger.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/messenger/Messenger.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/messenger/MessengerRepository.d.ts +0 -0
- /package/lib/{src/backend → backend}/model/messenger/StdoutMessenger.d.ts +0 -0
- /package/lib/{src/backend → backend}/routes/AlbumRouter.d.ts +0 -0
- /package/lib/{src/backend → backend}/routes/ErrorRouter.d.ts +0 -0
- /package/lib/{src/backend → backend}/routes/GalleryRouter.d.ts +0 -0
- /package/lib/{src/backend → backend}/routes/LoggerRouter.d.ts +0 -0
- /package/lib/{src/backend → backend}/routes/NotificationRouter.d.ts +0 -0
- /package/lib/{src/backend → backend}/routes/PersonRouter.d.ts +0 -0
- /package/lib/{src/backend → backend}/routes/PublicRouter.d.ts +0 -0
- /package/lib/{src/backend → backend}/routes/Router.d.ts +0 -0
- /package/lib/{src/backend → backend}/routes/SharingRouter.d.ts +0 -0
- /package/lib/{src/backend → backend}/routes/UserRouter.d.ts +0 -0
- /package/lib/{src/backend → backend}/routes/admin/AdminRouter.d.ts +0 -0
- /package/lib/{src/backend → backend}/routes/admin/SettingsRouter.d.ts +0 -0
- /package/lib/{src/backend → backend}/server.d.ts +0 -0
- /package/lib/{src/common → common}/BackendTexts.d.ts +0 -0
- /package/lib/{src/common → common}/CookieNames.d.ts +0 -0
- /package/lib/{src/common → common}/CustomHeaders.d.ts +0 -0
- /package/lib/{src/common → common}/DataStructureVersion.d.ts +0 -0
- /package/lib/{src/common → common}/PG2ConfMap.d.ts +0 -0
- /package/lib/{src/common → common}/QueryParams.d.ts +0 -0
- /package/lib/{src/common → common}/SearchQueryParser.d.ts +0 -0
- /package/lib/{src/common → common}/SupportedFormats.d.ts +0 -0
- /package/lib/{src/common → common}/Utils.d.ts +0 -0
- /package/lib/{src/common → common}/config/private/Config.d.ts +0 -0
- /package/lib/{src/common → common}/config/private/MessagingConfig.d.ts +0 -0
- /package/lib/{src/common → common}/config/private/PrivateConfig.d.ts +0 -0
- /package/lib/{src/common → common}/config/private/WebConfig.d.ts +0 -0
- /package/lib/{src/common → common}/config/public/ClientConfig.d.ts +0 -0
- /package/lib/{src/common → common}/config/public/Config.d.ts +0 -0
- /package/lib/{src/common → common}/entities/AutoCompleteItem.d.ts +0 -0
- /package/lib/{src/common → common}/entities/ConentWrapper.d.ts +0 -0
- /package/lib/{src/common → common}/entities/DirectoryDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/DuplicatesDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/DynamicConfig.d.ts +0 -0
- /package/lib/{src/common → common}/entities/Error.d.ts +0 -0
- /package/lib/{src/common → common}/entities/FileDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/GridSizes.d.ts +0 -0
- /package/lib/{src/common → common}/entities/LoginCredential.d.ts +0 -0
- /package/lib/{src/common → common}/entities/MDFileDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/MediaDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/MediaPickDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/Message.d.ts +0 -0
- /package/lib/{src/common → common}/entities/NotificationDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/PasswordChangeRequest.d.ts +0 -0
- /package/lib/{src/common → common}/entities/PersonDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/PhotoDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/SearchQueryDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/SearchResultDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/SharingDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/SortingMethods.d.ts +0 -0
- /package/lib/{src/common → common}/entities/UserDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/UserModificationRequest.d.ts +0 -0
- /package/lib/{src/common → common}/entities/VideoDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/album/AlbumBaseDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/album/SavedSearchDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/job/JobDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/job/JobProgressDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/job/JobScheduleDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/settings/IndexingDTO.d.ts +0 -0
- /package/lib/{src/common → common}/entities/settings/StatisticDTO.d.ts +0 -0
- /package/lib/{src/common → common}/event/Event.d.ts +0 -0
- /package/lib/{src/common → common}/event/Event2Args.d.ts +0 -0
- /package/lib/{src/common → common}/event/EventLimit.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/app.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/app.module.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/app.routing.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/icon.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/IRenderable.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/backendtext.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/backendtext.service.spec.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/navigation.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/network/autehentication.service.spec.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/network/authentication.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/network/helper/auth.guard.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/network/helper/csrf.interceptor.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/network/helper/error.interceptor.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/network/network.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/network/network.service.spec.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/network/user.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/network/user.service.spec.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/notification.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/page.helper.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/pi-title.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/query.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/seededRandom.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/theme.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/model/version.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/pipes/DurationPipe.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/pipes/FileDTOToPathPipe.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/pipes/FileDTOToRelativePathPipe.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/pipes/FileSizePipe.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/pipes/GPXFilesFilterPipe.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/pipes/MDFilesFilterPipe.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/pipes/ParseIntPipe.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/pipes/PhotoFilterPipe.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/pipes/SafeHTMLPipe.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/pipes/StringifyEnum.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/pipes/StringifyGridSize.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/pipes/StringifyRolePipe.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/pipes/StringifySearchQuery.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/pipes/StringifySearchType.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/pipes/StringifySortingMethod.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/EnumTranslations.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/admin/admin.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/albums/album/album.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/albums/albums.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/albums/albums.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/albums/saved-search-popup/saved-search-popup.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/duplicates/duplicates.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/duplicates/duplicates.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/duplicates/photo/photo.duplicates.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/faces/Person.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/faces/face/face.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/faces/faces.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/faces/faces.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/frame/frame.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/Media.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/MediaIcon.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/blog/blog.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/blog/blog.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/cache.gallery.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/content.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/contentLoader.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/directories/directories.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/directories/directory/directory.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/filter/filter.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/filter/filter.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/fullscreen.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/grid/GridMedia.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/grid/GridRowBuilder.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/grid/grid.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/grid/grid.gallery.component.spec.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/grid/photo/loading/loading.photo.grid.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/grid/photo/photo.grid.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/lightbox/controls/controls.lightbox.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/lightbox/lightbox.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/lightbox/lightbox.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/lightbox/media/media.lightbox.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/map/MarkerFactory.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/map/lightbox/lightbox.map.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/map/map.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/map/map.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/navigator/navigator.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/navigator/navigator.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/navigator/sorting.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/overlay.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/random-query-builder/random-query-builder.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/search/AutoCompleteRenderItem.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/search/autocomplete.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/search/query-builder/query-bulder.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/search/query-enrty/query-entry.search.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/search/search-field/search-field.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/search/search-field-base/search-field-base.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/search/search-query-parser.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/search/search.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/share/share.gallery.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/share.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/thumbnailLoader.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/gallery/thumbnailManager.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/language/language.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/login/login.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/settings/gallery-statistic/gallery-statistic.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/settings/scheduled-jobs.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/settings/settings.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/settings/sharings-list/sharings-list.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/settings/template/CustomSettingsEntries.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/settings/template/ISettingsComponent.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/settings/template/settings-entry/settings-entry.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/settings/template/settings-entry/sorting-method/sorting-method.settings-entry.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/settings/template/template.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/settings/users/users.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/settings/users/users.service.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/settings/workflow/button/job-button.settings.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/settings/workflow/progress/job-progress.settings.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/settings/workflow/workflow.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/sharelogin/share-login.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/utils/grid-size-icon/grid-size-icon.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/utils/sorting-method-icon/sorting-method-icon.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/utils/timestamp-datepicker/datepicker.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/app/ui/utils/timestamp-timepicker/timepicker.component.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/environments/environment.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/environments/environment.prod.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/main.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/polyfills.d.ts +0 -0
- /package/lib/{src/frontend → frontend}/test.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,3 +1,109 @@
|
|
|
1
|
-
#
|
|
1
|
+
# pigallery2 Extension
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
See feature issue for more information: [#743](https://github.com/bpatrik/pigallery2/issues/743).
|
|
4
|
+
|
|
5
|
+
See sample extension at https://github.com/bpatrik/pigallery2-sample-extension.
|
|
6
|
+
|
|
7
|
+
# Extension Usage
|
|
8
|
+
|
|
9
|
+
Extension folder can be set through config. For the docker-ised version,
|
|
10
|
+
they live under the `config/extension` folder in their own subdirectory.
|
|
11
|
+
|
|
12
|
+
# Extension development
|
|
13
|
+
|
|
14
|
+
## Minimal setup
|
|
15
|
+
|
|
16
|
+
You need at least a `server.js` in your extension folder that exports a `init(ext) {}` function.
|
|
17
|
+
|
|
18
|
+
## Recommended setup
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
<path to the extension fodler>/myextension/package.js <- this is optional. You can add extra npm packages here
|
|
22
|
+
<path to the extension fodler>/myextension/server.js <- this is needed
|
|
23
|
+
```
|
|
24
|
+
Where `<path to the extension fodler>` is what you set in the config and `myextension` is the name of your extension.
|
|
25
|
+
Note: you do not need to add your `node_modules` folder. The app will call `npm intall` when initializing your extension.
|
|
26
|
+
## Extension environment
|
|
27
|
+
|
|
28
|
+
The app runs the extension the following way:
|
|
29
|
+
* It reads all extensions in `<path to the extension fodler>/**` folder
|
|
30
|
+
* Checks if `package.js` is present. If yes installs the packages
|
|
31
|
+
* Checks if `server.js` is present. If yes, calls the `init` function.
|
|
32
|
+
|
|
33
|
+
### Init and cleanup lifecycle
|
|
34
|
+
There is also a `cleanUp` function that you can implement in your extension.
|
|
35
|
+
The app can call your `init` and `cleanUp` functions any time.
|
|
36
|
+
Always calls the `init` first then `cleanUp` later.
|
|
37
|
+
Main use-case: `init` is called on app startup. `cleanUp` and `init` called later when there is a new config change.
|
|
38
|
+
|
|
39
|
+
## Extension interface
|
|
40
|
+
|
|
41
|
+
The app calls the `init` and `cleanUp` function with a `IExtensionObject` object.
|
|
42
|
+
See https://github.com/bpatrik/pigallery2/blob/master/src/backend/model/extension/IExtension.ts for details.
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
`IExtensionObject` exposes lifecycle events, configs, RestAPis with some limitation.
|
|
46
|
+
Changes made during the these public apis you do not need to clean up in the `cleanUp` function.
|
|
47
|
+
App also exposes private `_app` object to provide access to low level API. Any changes made here needs clean up.
|
|
48
|
+
|
|
49
|
+
## server.js
|
|
50
|
+
|
|
51
|
+
See sample server.js at https://github.com/bpatrik/pigallery2-sample-extension.
|
|
52
|
+
|
|
53
|
+
It is recommended to do the development in `ts`, so creating a `server.ts`.
|
|
54
|
+
Note: You need to manually transpile your `server.ts` file to `server.js` as the app does not do that for you.
|
|
55
|
+
This doc assumes you do the development in `ts`.
|
|
56
|
+
|
|
57
|
+
### server.ts
|
|
58
|
+
|
|
59
|
+
You can import package from both the main app package.json and from your extension package.json.
|
|
60
|
+
To import packages from the main app, you import as usual.
|
|
61
|
+
For packages from the extension, you always need to write relative path. i.e.: prefix with `./node_modules`
|
|
62
|
+
```ts
|
|
63
|
+
// Including dev-kit interfaces. It is not necessary, only helps development with types.
|
|
64
|
+
// You need to prefix them with ./node_modules
|
|
65
|
+
import {IExtensionObject} from './node_modules/pigallery2-extension-kit';
|
|
66
|
+
|
|
67
|
+
// Including prod extension packages. You need to prefix them with ./node_modules
|
|
68
|
+
// lodash does not have types
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
70
|
+
// @ts-ignore
|
|
71
|
+
import * as _ from './node_modules/lodash';
|
|
72
|
+
|
|
73
|
+
// Importing packages that are available in the main app (listed in the packages.json in pigallery2)
|
|
74
|
+
import {Column, Entity, Index, PrimaryGeneratedColumn} from 'typeorm';
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
#### pigallery2 extension dev-kit
|
|
79
|
+
|
|
80
|
+
It is recommended to use the `pigallery2-extension-kit` node package.
|
|
81
|
+
`npm install pigallery2-extension-kit --save` to your extension.
|
|
82
|
+
|
|
83
|
+
`pigallery2-extension-kit` contains the type definitions and enums for the app.
|
|
84
|
+
This node package is basically includes the all definitions of the app and exports the `IExtensionObject` that the `init` function receives.
|
|
85
|
+
|
|
86
|
+
You can then `import {IExtensionObject} from './node_modules/pigallery2-extension-kit';`
|
|
87
|
+
|
|
88
|
+
See https://github.com/bpatrik/pigallery2/blob/master/src/backend/model/extension/IExtension.ts to understand what contains `IExtensionObject`.
|
|
89
|
+
|
|
90
|
+
NOTE: this is not needed to create an extension it only helps your IDE and your development. These type definitions are removed when you compile `ts` to `js`.
|
|
91
|
+
|
|
92
|
+
#### `init` function
|
|
93
|
+
|
|
94
|
+
You need to implement the `init` function for a working extension:
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
|
|
98
|
+
export const init = async (extension: IExtensionObject<void>): Promise<void> => {
|
|
99
|
+
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
#### pigallery2 lifecycle `events`
|
|
104
|
+
|
|
105
|
+
Tha app exposes multiple interfaces for the extensions to interact with the main app. `events` are one of the main interfaces.
|
|
106
|
+
Here are their flow:
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+

|
package/events.drawio
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<mxfile host="app.diagrams.net" modified="2023-11-25T15:41:12.760Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36" etag="2TdW26wLRN6yi1qc34DG" version="20.2.7" type="device"><diagram id="9mL0kDflCIzzHydUxYXW" name="Page-1">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</diagram></mxfile>
|
package/events.png
ADDED
|
Binary file
|
package/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IServerExtension = void 0;
|
|
4
|
-
var IExtension_1 = require("./lib/src/backend/model/extension/IExtension");
|
|
5
|
-
Object.defineProperty(exports, "IServerExtension", { enumerable: true, get: function () { return IExtension_1.IServerExtension; } });
|
|
6
3
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
|
package/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {IServerExtension} from './lib/
|
|
1
|
+
export {IServerExtension,IExtensionObject} from './lib/backend/model/extension/IExtension';
|
|
2
2
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationManager = void 0;
|
|
4
|
+
const NotificationDTO_1 = require("../../common/entities/NotificationDTO");
|
|
5
|
+
class NotificationManager {
|
|
6
|
+
static { this.notifications = []; }
|
|
7
|
+
static { this.HasNotification = [
|
|
8
|
+
{
|
|
9
|
+
type: NotificationDTO_1.NotificationType.info,
|
|
10
|
+
message: 'There are unhandled server notification. Login as Administrator to handle them.',
|
|
11
|
+
},
|
|
12
|
+
]; }
|
|
13
|
+
static error(message, details, req) {
|
|
14
|
+
const noti = {
|
|
15
|
+
type: NotificationDTO_1.NotificationType.error,
|
|
16
|
+
message,
|
|
17
|
+
details,
|
|
18
|
+
};
|
|
19
|
+
if (req) {
|
|
20
|
+
noti.request = {
|
|
21
|
+
method: req.method,
|
|
22
|
+
url: req.url,
|
|
23
|
+
statusCode: req.statusCode,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
NotificationManager.notifications.push(noti);
|
|
27
|
+
}
|
|
28
|
+
static warning(message, details, req) {
|
|
29
|
+
const noti = {
|
|
30
|
+
type: NotificationDTO_1.NotificationType.warning,
|
|
31
|
+
message,
|
|
32
|
+
details,
|
|
33
|
+
};
|
|
34
|
+
if (req) {
|
|
35
|
+
noti.request = {
|
|
36
|
+
method: req.method,
|
|
37
|
+
url: req.url,
|
|
38
|
+
statusCode: req.statusCode,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
NotificationManager.notifications.push(noti);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.NotificationManager = NotificationManager;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PasswordHelper = void 0;
|
|
4
|
+
const bcrypt = require("bcrypt");
|
|
5
|
+
class PasswordHelper {
|
|
6
|
+
static cryptPassword(password) {
|
|
7
|
+
const salt = bcrypt.genSaltSync(9);
|
|
8
|
+
return bcrypt.hashSync(password, salt);
|
|
9
|
+
}
|
|
10
|
+
static comparePassword(password, encryptedPassword) {
|
|
11
|
+
try {
|
|
12
|
+
return bcrypt.compareSync(password, encryptedPassword);
|
|
13
|
+
// eslint-disable-next-line no-empty
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.PasswordHelper = PasswordHelper;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IExtensionEvent, IExtensionEvents } from './IExtension';
|
|
2
|
+
export declare class ExtensionDecoratorObject {
|
|
3
|
+
static events: IExtensionEvents;
|
|
4
|
+
static init(events: IExtensionEvents): void;
|
|
5
|
+
}
|
|
6
|
+
export declare const ExtensionDecorator: <I extends unknown[], O>(fn: (ee: IExtensionEvents) => IExtensionEvent<I, O>) => (target: unknown, propertyName: string, descriptor: TypedPropertyDescriptor<(...args: I) => Promise<O>>) => TypedPropertyDescriptor<(...args: I) => Promise<O>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IExtensionAfterEventHandler, IExtensionBeforeEventHandler, IExtensionEvent } from './IExtension';
|
|
2
|
-
export declare class ExtensionEvent<I, O> implements IExtensionEvent<I, O> {
|
|
2
|
+
export declare class ExtensionEvent<I extends unknown[], O> implements IExtensionEvent<I, O> {
|
|
3
3
|
protected beforeHandlers: IExtensionBeforeEventHandler<I, O>[];
|
|
4
4
|
protected afterHandlers: IExtensionAfterEventHandler<O>[];
|
|
5
5
|
before(handler: IExtensionBeforeEventHandler<I, O>): void;
|
|
@@ -9,7 +9,14 @@ import { ParamsDictionary } from 'express-serve-static-core';
|
|
|
9
9
|
import { Connection } from 'typeorm';
|
|
10
10
|
import { DynamicConfig } from '../../../common/entities/DynamicConfig';
|
|
11
11
|
import { MediaDTOWithThPath } from '../messenger/Messenger';
|
|
12
|
-
|
|
12
|
+
import { PhotoMetadata } from '../../../common/entities/PhotoDTO';
|
|
13
|
+
import { VideoMetadata } from '../../../common/entities/VideoDTO';
|
|
14
|
+
import { MediaRendererInput, SvgRendererInput } from '../fileaccess/PhotoWorker';
|
|
15
|
+
import { SearchQueryDTO } from '../../../common/entities/SearchQueryDTO';
|
|
16
|
+
import { CoverPhotoDTOWithID } from '../database/CoverManager';
|
|
17
|
+
import { ParentDirectoryDTO } from '../../../common/entities/DirectoryDTO';
|
|
18
|
+
import { DirectoryScanSettings } from '../fileaccess/DiskManager';
|
|
19
|
+
export declare type IExtensionBeforeEventHandler<I extends unknown[], O> = (input: {
|
|
13
20
|
inputs: I;
|
|
14
21
|
}, event: {
|
|
15
22
|
stopPropagation: boolean;
|
|
@@ -17,7 +24,7 @@ export declare type IExtensionBeforeEventHandler<I, O> = (input: {
|
|
|
17
24
|
inputs: I;
|
|
18
25
|
} | O>;
|
|
19
26
|
export declare type IExtensionAfterEventHandler<O> = (output: O) => Promise<O>;
|
|
20
|
-
export interface IExtensionEvent<I, O> {
|
|
27
|
+
export interface IExtensionEvent<I extends unknown[], O> {
|
|
21
28
|
before: (handler: IExtensionBeforeEventHandler<I, O>) => void;
|
|
22
29
|
after: (handler: IExtensionAfterEventHandler<O>) => void;
|
|
23
30
|
}
|
|
@@ -30,32 +37,45 @@ export interface IExtensionEvents {
|
|
|
30
37
|
* Events for Directory and Album covers
|
|
31
38
|
*/
|
|
32
39
|
CoverManager: {
|
|
33
|
-
getCoverForAlbum: IExtensionEvent<
|
|
34
|
-
|
|
40
|
+
getCoverForAlbum: IExtensionEvent<[
|
|
41
|
+
{
|
|
42
|
+
searchQuery: SearchQueryDTO;
|
|
43
|
+
}
|
|
44
|
+
], CoverPhotoDTOWithID>;
|
|
45
|
+
getCoverForDirectory: IExtensionEvent<[
|
|
46
|
+
{
|
|
47
|
+
id: number;
|
|
48
|
+
name: string;
|
|
49
|
+
path: string;
|
|
50
|
+
}
|
|
51
|
+
], CoverPhotoDTOWithID>;
|
|
35
52
|
/**
|
|
36
53
|
* Invalidates directory covers for a given directory and every parent
|
|
37
54
|
*/
|
|
38
|
-
invalidateDirectoryCovers: IExtensionEvent<
|
|
55
|
+
invalidateDirectoryCovers: IExtensionEvent<[ParentDirectoryDTO], void>;
|
|
39
56
|
};
|
|
40
57
|
ImageRenderer: {
|
|
41
58
|
/**
|
|
42
59
|
* Renders a thumbnail or photo
|
|
43
60
|
*/
|
|
44
|
-
render: IExtensionEvent<
|
|
61
|
+
render: IExtensionEvent<[MediaRendererInput | SvgRendererInput], void>;
|
|
45
62
|
};
|
|
46
63
|
/**
|
|
47
64
|
* Reads exif, iptc, etc.. metadata for photos/videos
|
|
48
65
|
*/
|
|
49
66
|
MetadataLoader: {
|
|
50
|
-
loadVideoMetadata: IExtensionEvent<
|
|
51
|
-
loadPhotoMetadata: IExtensionEvent<
|
|
67
|
+
loadVideoMetadata: IExtensionEvent<[string], VideoMetadata>;
|
|
68
|
+
loadPhotoMetadata: IExtensionEvent<[string], PhotoMetadata>;
|
|
52
69
|
};
|
|
53
70
|
/**
|
|
54
71
|
* Scans the storage for a given directory and returns the list of child directories,
|
|
55
72
|
* photos, videos and metafiles
|
|
56
73
|
*/
|
|
57
74
|
DiskManager: {
|
|
58
|
-
scanDirectory: IExtensionEvent<
|
|
75
|
+
scanDirectory: IExtensionEvent<[
|
|
76
|
+
string,
|
|
77
|
+
DirectoryScanSettings
|
|
78
|
+
], ParentDirectoryDTO>;
|
|
59
79
|
};
|
|
60
80
|
};
|
|
61
81
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.backendTexts = void 0;
|
|
4
|
+
// keep the numbering sparse to support later addition
|
|
5
|
+
exports.backendTexts = {
|
|
6
|
+
indexedFilesOnly: { name: 10, description: 12 },
|
|
7
|
+
sizeToGenerate: { name: 20, description: 22 },
|
|
8
|
+
indexChangesOnly: { name: 30, description: 32 },
|
|
9
|
+
mediaPick: { name: 40, description: 42 },
|
|
10
|
+
emailTo: { name: 70, description: 72 },
|
|
11
|
+
emailSubject: { name: 90, description: 92 },
|
|
12
|
+
emailText: { name: 100, description: 102 },
|
|
13
|
+
messenger: { name: 110, description: 112 }
|
|
14
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SupportedFormats = void 0;
|
|
4
|
+
let Config;
|
|
5
|
+
if (typeof window !== 'undefined') {
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
7
|
+
Config = require('./config/public/Config').Config;
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
11
|
+
Config = require('./config/private/Config').Config;
|
|
12
|
+
}
|
|
13
|
+
exports.SupportedFormats = {
|
|
14
|
+
Photos: Config.Media.Photo.supportedFormats,
|
|
15
|
+
// Browser supported video formats
|
|
16
|
+
// Read more: https://www.w3schools.com/html/html5_video.asp
|
|
17
|
+
Videos: Config.Media.Video.supportedFormats,
|
|
18
|
+
MetaFiles: Config.MetaFile.supportedFormats,
|
|
19
|
+
// These formats need to be transcoded (with the build-in ffmpeg support)
|
|
20
|
+
TranscodeNeed: {
|
|
21
|
+
// based on libvips, all supported formats for sharp: https://github.com/libvips/libvips
|
|
22
|
+
Photos: [],
|
|
23
|
+
Videos: Config.Media.Video.supportedFormatsWithTranscoding,
|
|
24
|
+
},
|
|
25
|
+
// --------------------------------------------
|
|
26
|
+
// Below this, it is autogenerated, DO NOT EDIT
|
|
27
|
+
WithDots: {
|
|
28
|
+
Photos: [],
|
|
29
|
+
Videos: [],
|
|
30
|
+
MetaFiles: [],
|
|
31
|
+
TranscodeNeed: {
|
|
32
|
+
Photos: [],
|
|
33
|
+
Videos: [],
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
exports.SupportedFormats.Photos = exports.SupportedFormats.Photos.concat(exports.SupportedFormats.TranscodeNeed.Photos);
|
|
38
|
+
exports.SupportedFormats.Videos = exports.SupportedFormats.Videos.concat(exports.SupportedFormats.TranscodeNeed.Videos);
|
|
39
|
+
exports.SupportedFormats.WithDots.Photos = exports.SupportedFormats.Photos.map((f) => '.' + f);
|
|
40
|
+
exports.SupportedFormats.WithDots.Videos = exports.SupportedFormats.Videos.map((f) => '.' + f);
|
|
41
|
+
exports.SupportedFormats.WithDots.MetaFiles = exports.SupportedFormats.MetaFiles.map((f) => '.' + f);
|
|
42
|
+
exports.SupportedFormats.WithDots.TranscodeNeed.Photos =
|
|
43
|
+
exports.SupportedFormats.TranscodeNeed.Photos.map((f) => '.' + f);
|
|
44
|
+
exports.SupportedFormats.WithDots.TranscodeNeed.Videos =
|
|
45
|
+
exports.SupportedFormats.TranscodeNeed.Videos.map((f) => '.' + f);
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LRU = exports.Utils = void 0;
|
|
4
|
+
class Utils {
|
|
5
|
+
static GUID() {
|
|
6
|
+
const s4 = () => Math.floor((1 + Math.random()) * 0x10000)
|
|
7
|
+
.toString(16)
|
|
8
|
+
.substring(1);
|
|
9
|
+
return s4() + s4() + '-' + s4() + s4();
|
|
10
|
+
}
|
|
11
|
+
static chunkArrays(arr, chunkSize) {
|
|
12
|
+
const R = [];
|
|
13
|
+
for (let i = 0; i < arr.length; i += chunkSize) {
|
|
14
|
+
R.push(arr.slice(i, i + chunkSize));
|
|
15
|
+
}
|
|
16
|
+
return R;
|
|
17
|
+
}
|
|
18
|
+
static wait(time) {
|
|
19
|
+
return new Promise((resolve) => {
|
|
20
|
+
setTimeout(resolve, time);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
static removeNullOrEmptyObj(obj) {
|
|
24
|
+
if (typeof obj !== 'object' || obj == null) {
|
|
25
|
+
return obj;
|
|
26
|
+
}
|
|
27
|
+
const keys = Object.keys(obj);
|
|
28
|
+
for (const key of keys) {
|
|
29
|
+
if (obj[key] !== null && typeof obj[key] === 'object') {
|
|
30
|
+
if (Utils.removeNullOrEmptyObj(obj[key])) {
|
|
31
|
+
if (Object.keys(obj[key]).length === 0) {
|
|
32
|
+
delete obj[key];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else if (obj[key] === null) {
|
|
37
|
+
delete obj[key];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return obj;
|
|
41
|
+
}
|
|
42
|
+
static clone(object) {
|
|
43
|
+
return JSON.parse(JSON.stringify(object));
|
|
44
|
+
}
|
|
45
|
+
static shallowClone(object) {
|
|
46
|
+
const c = {};
|
|
47
|
+
for (const e of Object.entries(object)) {
|
|
48
|
+
c[e[0]] = e[1];
|
|
49
|
+
}
|
|
50
|
+
return c;
|
|
51
|
+
}
|
|
52
|
+
static zeroPrefix(value, length) {
|
|
53
|
+
const ret = '00000' + value;
|
|
54
|
+
return ret.substr(ret.length - length);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Checks if the two input (let them be objects or arrays or just primitives) are equal
|
|
58
|
+
*/
|
|
59
|
+
static equalsFilter(object, filter, skipProp = []) {
|
|
60
|
+
if (typeof filter !== 'object' || filter == null) {
|
|
61
|
+
return object === filter;
|
|
62
|
+
}
|
|
63
|
+
if (!object) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
if (Array.isArray(object) && object.length !== filter.length) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
const keys = Object.keys(filter);
|
|
70
|
+
for (const key of keys) {
|
|
71
|
+
if (skipProp.includes(key)) {
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
if (typeof filter[key] === 'object') {
|
|
75
|
+
if (Utils.equalsFilter(object[key], filter[key], skipProp) === false) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else if (object[key] !== filter[key]) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
static toIsoString(d) {
|
|
86
|
+
if (!(d instanceof Date)) {
|
|
87
|
+
d = new Date(d);
|
|
88
|
+
}
|
|
89
|
+
return d.getUTCFullYear() + '-' + d.getUTCMonth() + '-' + d.getUTCDate();
|
|
90
|
+
}
|
|
91
|
+
static makeUTCMidnight(d) {
|
|
92
|
+
if (!(d instanceof Date)) {
|
|
93
|
+
d = new Date(d);
|
|
94
|
+
}
|
|
95
|
+
d.setUTCHours(0);
|
|
96
|
+
d.setUTCMinutes(0);
|
|
97
|
+
d.setUTCSeconds(0);
|
|
98
|
+
d.setUTCMilliseconds(0);
|
|
99
|
+
return d;
|
|
100
|
+
}
|
|
101
|
+
static renderDataSize(size) {
|
|
102
|
+
const postFixes = ['B', 'KB', 'MB', 'GB', 'TB'];
|
|
103
|
+
let index = 0;
|
|
104
|
+
while (size > 1000 && index < postFixes.length - 1) {
|
|
105
|
+
size /= 1000;
|
|
106
|
+
index++;
|
|
107
|
+
}
|
|
108
|
+
return size.toFixed(2) + postFixes[index];
|
|
109
|
+
}
|
|
110
|
+
static getUnique(arr) {
|
|
111
|
+
return arr.filter((value, index, arr) => arr.indexOf(value) === index);
|
|
112
|
+
}
|
|
113
|
+
static createRange(from, to) {
|
|
114
|
+
const arr = new Array(to - from + 1);
|
|
115
|
+
let c = to - from + 1;
|
|
116
|
+
while (c--) {
|
|
117
|
+
arr[c] = to--;
|
|
118
|
+
}
|
|
119
|
+
return arr;
|
|
120
|
+
}
|
|
121
|
+
static canonizePath(path) {
|
|
122
|
+
return path
|
|
123
|
+
.replace(new RegExp('\\\\', 'g'), '/')
|
|
124
|
+
.replace(new RegExp('/+', 'g'), '/');
|
|
125
|
+
}
|
|
126
|
+
static concatUrls(...args) {
|
|
127
|
+
let url = '';
|
|
128
|
+
for (const item of args) {
|
|
129
|
+
if (item === '' || typeof item === 'undefined') {
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
const part = item.replace(new RegExp('\\\\', 'g'), '/');
|
|
133
|
+
if (part === '/' || part === './') {
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
url += part + '/';
|
|
137
|
+
}
|
|
138
|
+
url = url.replace(/(https?:\/\/)|(\/){2,}/g, '$1$2');
|
|
139
|
+
if (url.trim() === '') {
|
|
140
|
+
url = './';
|
|
141
|
+
}
|
|
142
|
+
return url.substring(0, url.length - 1);
|
|
143
|
+
}
|
|
144
|
+
static updateKeys(targetObject, sourceObject) {
|
|
145
|
+
Object.keys(sourceObject).forEach((key) => {
|
|
146
|
+
if (typeof targetObject[key] === 'undefined') {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
if (typeof targetObject[key] === 'object') {
|
|
150
|
+
Utils.updateKeys(targetObject[key], sourceObject[key]);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
targetObject[key] = sourceObject[key];
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
static setKeys(targetObject, sourceObject) {
|
|
158
|
+
Object.keys(sourceObject).forEach((key) => {
|
|
159
|
+
if (typeof targetObject[key] === 'object') {
|
|
160
|
+
Utils.setKeys(targetObject[key], sourceObject[key]);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
targetObject[key] = sourceObject[key];
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
static setKeysForced(targetObject, sourceObject) {
|
|
168
|
+
Object.keys(sourceObject).forEach((key) => {
|
|
169
|
+
if (typeof sourceObject[key] === 'object') {
|
|
170
|
+
if (typeof targetObject[key] === 'undefined') {
|
|
171
|
+
targetObject[key] = {};
|
|
172
|
+
}
|
|
173
|
+
Utils.setKeysForced(targetObject[key], sourceObject[key]);
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
targetObject[key] = sourceObject[key];
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
static isValidEnumInt(EnumType, value) {
|
|
181
|
+
return typeof EnumType[value] === 'string';
|
|
182
|
+
}
|
|
183
|
+
static enumToArray(EnumType) {
|
|
184
|
+
const arr = [];
|
|
185
|
+
for (const enumMember in EnumType) {
|
|
186
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
187
|
+
if (!EnumType.hasOwnProperty(enumMember)) {
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
const key = parseInt(enumMember, 10);
|
|
191
|
+
if (key >= 0) {
|
|
192
|
+
arr.push({ key, value: EnumType[enumMember] });
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return arr;
|
|
196
|
+
}
|
|
197
|
+
static findClosest(num, arr) {
|
|
198
|
+
let curr = arr[0];
|
|
199
|
+
let diff = Math.abs(num - curr);
|
|
200
|
+
arr.forEach((value) => {
|
|
201
|
+
const newDiff = Math.abs(num - value);
|
|
202
|
+
if (newDiff < diff) {
|
|
203
|
+
diff = newDiff;
|
|
204
|
+
curr = value;
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
return curr;
|
|
208
|
+
}
|
|
209
|
+
static findClosestinSorted(num, arr) {
|
|
210
|
+
let curr = arr[0];
|
|
211
|
+
let diff = Math.abs(num - curr);
|
|
212
|
+
for (const item of arr) {
|
|
213
|
+
const newDiff = Math.abs(num - item);
|
|
214
|
+
if (newDiff > diff) {
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
diff = newDiff;
|
|
218
|
+
curr = item;
|
|
219
|
+
}
|
|
220
|
+
return curr;
|
|
221
|
+
}
|
|
222
|
+
static isUInt32(value, max = 4294967295) {
|
|
223
|
+
value = parseInt('' + value, 10);
|
|
224
|
+
return !isNaN(value) && value >= 0 && value <= max;
|
|
225
|
+
}
|
|
226
|
+
static isInt32(value) {
|
|
227
|
+
value = parseFloat('' + value);
|
|
228
|
+
return !isNaN(value) && value >= -2147483648 && value <= 2147483647;
|
|
229
|
+
}
|
|
230
|
+
static isFloat32(value) {
|
|
231
|
+
const E = Math.pow(10, 38);
|
|
232
|
+
const nE = Math.pow(10, -38);
|
|
233
|
+
return (!isNaN(value) &&
|
|
234
|
+
((value >= -3.402823466 * E && value <= -1.175494351 * nE) ||
|
|
235
|
+
(value <= 3.402823466 * E && value >= 1.175494351 * nE)));
|
|
236
|
+
}
|
|
237
|
+
static getAnyX(num, arr, start = 0) {
|
|
238
|
+
if (num <= 0 || num > arr.length || start >= arr.length) {
|
|
239
|
+
return [];
|
|
240
|
+
}
|
|
241
|
+
if (num <= 1) {
|
|
242
|
+
return arr.slice(start).map((e) => [e]);
|
|
243
|
+
}
|
|
244
|
+
if (num === arr.length - start) {
|
|
245
|
+
return [arr.slice(start)];
|
|
246
|
+
}
|
|
247
|
+
const ret = [];
|
|
248
|
+
for (let i = start; i < arr.length; ++i) {
|
|
249
|
+
Utils.getAnyX(num - 1, arr, i + 1).forEach((a) => {
|
|
250
|
+
a.push(arr[i]);
|
|
251
|
+
ret.push(a);
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
return ret;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
exports.Utils = Utils;
|
|
258
|
+
class LRU {
|
|
259
|
+
constructor(size) {
|
|
260
|
+
this.size = size;
|
|
261
|
+
this.data = {};
|
|
262
|
+
}
|
|
263
|
+
set(key, value) {
|
|
264
|
+
this.data[key] = { usage: Date.now(), value };
|
|
265
|
+
if (Object.keys(this.data).length > this.size) {
|
|
266
|
+
let oldestK = key;
|
|
267
|
+
let oldest = this.data[oldestK].usage;
|
|
268
|
+
for (const k in this.data) {
|
|
269
|
+
if (this.data[k].usage < oldest) {
|
|
270
|
+
oldestK = k;
|
|
271
|
+
oldest = this.data[oldestK].usage;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
delete this.data[oldestK];
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
get(key) {
|
|
278
|
+
if (!this.data[key]) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
return this.data[key].value;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
exports.LRU = LRU;
|