pigallery2-extension-kit 3.5.2 → 3.7.0-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 +11 -5
- package/index.d.ts +1 -0
- package/index.js +2 -3
- package/lib/backend/Logger.d.ts +7 -7
- package/lib/backend/ProjectPath.d.ts +12 -0
- package/lib/backend/exceptions/DirectoryNotFound.d.ts +2 -0
- package/lib/backend/exceptions/FolderNotWritable.d.ts +2 -0
- package/lib/backend/index.d.ts +1 -1
- package/lib/backend/middlewares/GalleryMWs.d.ts +4 -0
- package/lib/backend/middlewares/PersonMWs.d.ts +1 -1
- package/lib/backend/middlewares/RenderingMWs.d.ts +24 -0
- package/lib/backend/middlewares/RequestParams.d.ts +13 -0
- package/lib/backend/middlewares/RequestSession.d.ts +9 -0
- package/lib/backend/middlewares/ServerTimingMWs.d.ts +6 -6
- package/lib/backend/middlewares/SharingMWs.d.ts +2 -1
- package/lib/backend/middlewares/VersionMWs.d.ts +1 -1
- package/lib/backend/middlewares/thumbnail/ThumbnailGeneratorMWs.d.ts +1 -1
- package/lib/backend/middlewares/user/AuthenticationMWs.d.ts +37 -0
- package/lib/backend/middlewares/user/OIDCAuthService.d.ts +36 -5
- package/lib/backend/middlewares/user/OIDCMWs.d.ts +10 -0
- package/lib/backend/middlewares/user/UserMWs.d.ts +1 -0
- package/lib/backend/middlewares/user/UserRequestConstrainsMWs.d.ts +0 -1
- package/lib/backend/model/DirectoryAccess.d.ts +78 -0
- package/lib/backend/model/EventLoopHandler.d.ts +1 -1
- package/lib/backend/model/FFmpeg.d.ts +47 -0
- package/lib/backend/model/FFmpegFactory.d.ts +11 -2
- package/lib/backend/model/ObjectManagers.d.ts +1 -1
- package/lib/backend/model/PasswordHelper.d.ts +1 -1
- package/lib/backend/model/SessionContext.d.ts +16 -6
- package/lib/backend/model/UploadManager.d.ts +6 -3
- package/lib/backend/model/database/CoverManager.d.ts +8 -2
- package/lib/backend/model/database/GalleryManager.d.ts +15 -9
- package/lib/backend/model/database/IndexingManager.d.ts +7 -7
- package/lib/backend/model/database/LocationManager.d.ts +2 -3
- package/lib/backend/model/database/PersonManager.d.ts +5 -3
- package/lib/backend/model/database/ProjectedCacheManager.d.ts +9 -8
- package/lib/backend/model/database/ProjectionAwareManager.d.ts +4 -4
- package/lib/backend/model/database/SQLConnection.d.ts +4 -2
- package/lib/backend/model/database/SearchManager.d.ts +23 -8
- package/lib/backend/model/database/SessionManager.d.ts +41 -4
- package/lib/backend/model/database/SharingManager.d.ts +11 -6
- package/lib/backend/model/database/UserManager.d.ts +8 -1
- package/lib/backend/model/database/enitites/DirectoryEntity.d.ts +1 -1
- package/lib/backend/model/database/enitites/EntityUtils.d.ts +22 -1
- package/lib/backend/model/database/enitites/MediaEntity.d.ts +5 -2
- package/lib/backend/model/database/enitites/ProjectedDirectoryCacheEntity.d.ts +2 -2
- package/lib/backend/model/database/enitites/SharingEntity.d.ts +11 -5
- package/lib/backend/model/database/enitites/UserEntity.d.ts +8 -5
- package/lib/backend/model/database/enitites/VideoEntity.d.ts +2 -2
- package/lib/backend/model/database/enitites/album/ProjectedAlbumCacheEntity.d.ts +2 -2
- package/lib/backend/model/database/enitites/person/ProjectedPersonCacheEntity.d.ts +1 -1
- package/lib/backend/model/diagnostics/ConfigDiagnostics.d.ts +31 -12
- package/lib/backend/model/extension/ExpressRouterWrapper.d.ts +10 -4
- package/lib/backend/model/extension/ExtensionApp.d.ts +2 -3
- package/lib/backend/model/extension/ExtensionDB.d.ts +2 -2
- package/lib/backend/model/extension/ExtensionEvent.d.ts +12 -1
- package/lib/backend/model/extension/ExtensionManager.d.ts +22 -4
- package/lib/backend/model/extension/ExtensionObject.d.ts +6 -3
- package/lib/backend/model/extension/IExtension.d.ts +35 -18
- package/lib/backend/model/fileaccess/DiskManager.d.ts +3 -1
- package/lib/backend/model/fileaccess/MetadataLoader.d.ts +17 -0
- package/lib/backend/model/fileaccess/TaskQue.d.ts +4 -4
- package/lib/backend/model/fileaccess/VideoConverterWorker.d.ts +6 -2
- package/lib/backend/model/fileaccess/fileprocessing/PhotoProcessing.d.ts +3 -2
- package/lib/backend/model/jobs/JobManager.d.ts +2 -4
- package/lib/backend/model/jobs/JobProgressManager.d.ts +5 -3
- package/lib/backend/model/jobs/JobRepository.d.ts +1 -3
- package/lib/backend/model/jobs/jobs/AlbumCoverFillingJob.d.ts +1 -1
- package/lib/backend/model/jobs/jobs/IJobListener.d.ts +2 -2
- package/lib/backend/model/jobs/jobs/Job.d.ts +4 -1
- package/lib/backend/model/messenger/EmailMessenger.d.ts +1 -1
- package/lib/backend/model/messenger/Messenger.d.ts +1 -2
- package/lib/backend/model/messenger/MessengerRepository.d.ts +1 -3
- package/lib/backend/routes/ErrorRouter.d.ts +1 -0
- package/lib/backend/routes/GalleryRouter.d.ts +8 -0
- package/lib/backend/routes/PublicRouter.d.ts +3 -6
- package/lib/backend/routes/SharingRouter.d.ts +1 -1
- package/lib/backend/routes/UserRouter.d.ts +1 -0
- package/lib/backend/server.d.ts +3 -3
- package/lib/common/DataStructureVersion.d.ts +1 -1
- package/lib/common/SearchQueryParser.d.ts +2 -2
- package/lib/common/SearchQueryUtils.d.ts +71 -4
- package/lib/common/SupportedFormats.d.ts +11 -1
- package/lib/common/SupportedFormats.js +13 -19
- package/lib/common/TextFold.d.ts +6 -0
- package/lib/common/UploadUtils.d.ts +4 -0
- package/lib/common/Utils.d.ts +23 -24
- package/lib/common/Utils.js +37 -97
- package/lib/common/config/Enums.d.ts +91 -0
- package/lib/common/config/Enums.js +109 -0
- package/lib/common/config/private/Config.d.ts +1 -1
- package/lib/common/config/private/PrivateConfig.d.ts +18 -39
- package/lib/common/config/private/WebConfig.d.ts +1 -2
- package/lib/common/config/private/subconfigs/ServerExtensionsConfig.d.ts +2 -3
- package/lib/common/config/public/ClientConfig.d.ts +51 -68
- package/lib/common/config/public/ClientConfig.js +774 -557
- package/lib/common/entities/AutoCompleteItem.d.ts +3 -3
- package/lib/common/entities/ContentWrapper.d.ts +21 -8
- package/lib/common/entities/ContentWrapper.js +286 -318
- package/lib/common/entities/DirectoryDTO.d.ts +7 -6
- package/lib/common/entities/DirectoryDTO.js +10 -5
- package/lib/common/entities/Error.d.ts +12 -7
- package/lib/common/entities/Error.js +15 -3
- package/lib/common/entities/MediaDTO.d.ts +13 -0
- package/lib/common/entities/MediaDTO.js +10 -7
- package/lib/common/entities/Message.d.ts +3 -3
- package/lib/common/entities/NotificationDTO.d.ts +2 -2
- package/lib/common/entities/SearchQueryDTO.d.ts +9 -1
- package/lib/common/entities/SearchQueryDTO.js +1 -0
- package/lib/common/entities/SharingDTO.d.ts +39 -5
- package/lib/common/entities/SortingMethods.d.ts +26 -2
- package/lib/common/entities/SortingMethods.js +14 -1
- package/lib/common/entities/UserDTO.d.ts +5 -2
- package/lib/common/entities/UserSettingsDTO.d.ts +3 -1
- package/lib/common/entities/VideoDTO.d.ts +2 -5
- package/lib/common/entities/album/AlbumBaseDTO.d.ts +2 -2
- package/lib/common/entities/extension/ExtensionListItem.d.ts +1 -1
- package/lib/common/entities/extension/IClientUIConfig.d.ts +19 -12
- package/lib/common/entities/job/JobDTO.d.ts +1 -1
- package/lib/common/entities/job/JobProgressDTO.d.ts +1 -1
- package/lib/common/entities/job/JobScheduleDTO.d.ts +5 -5
- package/lib/common/entities/job/JobScheduleDTO.js +9 -5
- package/lib/common/event/EventLimit.d.ts +1 -1
- package/package.json +21 -8
- package/REPOSITORY.md +0 -13
- package/events.drawio +0 -1
- package/events.png +0 -0
- package/index.js.map +0 -1
- package/index.ts +0 -2
- package/lib/backend/ProjectPath.js +0 -36
- package/lib/backend/model/NotifocationManager.js +0 -44
- package/lib/backend/model/PasswordHelper.js +0 -20
- package/lib/backend/model/database/enitites/PersonEntry.d.ts +0 -11
- package/lib/backend/model/database/enitites/PersonJunctionTable.d.ts +0 -10
- package/lib/backend/model/extension/ExtensionConfigTemplateLoader.js +0 -139
- package/lib/backend/model/extension/ExtensionConfigWrapper.js +0 -59
- package/lib/common/config/private/Config.js +0 -20
- package/lib/common/config/private/PrivateConfig.js +0 -1568
- package/lib/common/config/private/PrivateConfigClass.js +0 -96
- package/lib/common/config/private/WebConfig.js +0 -19
- package/lib/common/config/private/subconfigs/MessagingConfig.js +0 -134
- package/lib/common/config/private/subconfigs/ServerExtensionsConfig.js +0 -111
- package/lib/common/config/public/Config.js +0 -24
- package/lib/common/entities/ConentWrapper.d.ts +0 -18
- package/lib/common/entities/ConentWrapper.js +0 -490
- package/lib/frontend/app/app.component.d.ts +0 -18
- package/lib/frontend/app/app.module.d.ts +0 -23
- package/lib/frontend/app/app.routing.d.ts +0 -4
- package/lib/frontend/app/icon.component.d.ts +0 -7
- package/lib/frontend/app/model/IRenderable.d.ts +0 -17
- package/lib/frontend/app/model/backendtext.service.d.ts +0 -7
- package/lib/frontend/app/model/backendtext.service.spec.d.ts +0 -1
- package/lib/frontend/app/model/extension.service.d.ts +0 -5
- package/lib/frontend/app/model/navigation.service.d.ts +0 -12
- package/lib/frontend/app/model/network/autehentication.service.spec.d.ts +0 -1
- package/lib/frontend/app/model/network/authentication.service.d.ts +0 -22
- package/lib/frontend/app/model/network/helper/auth.guard.d.ts +0 -9
- package/lib/frontend/app/model/network/helper/csrf.interceptor.d.ts +0 -8
- package/lib/frontend/app/model/network/helper/error.interceptor.d.ts +0 -8
- package/lib/frontend/app/model/network/network.service.d.ts +0 -29
- package/lib/frontend/app/model/network/network.service.spec.d.ts +0 -1
- package/lib/frontend/app/model/network/user.service.d.ts +0 -13
- package/lib/frontend/app/model/network/user.service.spec.d.ts +0 -1
- package/lib/frontend/app/model/notification.service.d.ts +0 -28
- package/lib/frontend/app/model/page.helper.d.ts +0 -15
- package/lib/frontend/app/model/pi-title.service.d.ts +0 -15
- package/lib/frontend/app/model/query.service.d.ts +0 -19
- package/lib/frontend/app/model/seededRandom.service.d.ts +0 -7
- package/lib/frontend/app/model/theme.service.d.ts +0 -16
- package/lib/frontend/app/model/version.service.d.ts +0 -10
- package/lib/frontend/app/pipes/DurationPipe.d.ts +0 -4
- package/lib/frontend/app/pipes/FileDTOToPathPipe.d.ts +0 -5
- package/lib/frontend/app/pipes/FileDTOToRelativePathPipe.d.ts +0 -5
- package/lib/frontend/app/pipes/FileSizePipe.d.ts +0 -4
- package/lib/frontend/app/pipes/GPXFilesFilterPipe.d.ts +0 -5
- package/lib/frontend/app/pipes/MDFilesFilterPipe.d.ts +0 -6
- package/lib/frontend/app/pipes/ParseIntPipe.d.ts +0 -4
- package/lib/frontend/app/pipes/PhotoFilterPipe.d.ts +0 -6
- package/lib/frontend/app/pipes/SafeHTMLPipe.d.ts +0 -7
- package/lib/frontend/app/pipes/StringifyEnum.d.ts +0 -4
- package/lib/frontend/app/pipes/StringifyGridSize.d.ts +0 -5
- package/lib/frontend/app/pipes/StringifyRolePipe.d.ts +0 -4
- package/lib/frontend/app/pipes/StringifySearchQuery.d.ts +0 -8
- package/lib/frontend/app/pipes/StringifySearchType.d.ts +0 -5
- package/lib/frontend/app/pipes/StringifySortingMethod.d.ts +0 -4
- package/lib/frontend/app/ui/EnumTranslations.d.ts +0 -5
- package/lib/frontend/app/ui/admin/admin.component.d.ts +0 -36
- package/lib/frontend/app/ui/albums/album/album.component.d.ts +0 -26
- package/lib/frontend/app/ui/albums/albums.component.d.ts +0 -31
- package/lib/frontend/app/ui/albums/albums.service.d.ts +0 -12
- package/lib/frontend/app/ui/albums/saved-search-popup/saved-search-popup.component.d.ts +0 -15
- package/lib/frontend/app/ui/duplicates/duplicates.component.d.ts +0 -36
- package/lib/frontend/app/ui/duplicates/duplicates.service.d.ts +0 -9
- package/lib/frontend/app/ui/duplicates/photo/photo.duplicates.component.d.ts +0 -11
- package/lib/frontend/app/ui/faces/Person.d.ts +0 -9
- package/lib/frontend/app/ui/faces/face/face.component.d.ts +0 -22
- package/lib/frontend/app/ui/faces/faces.component.d.ts +0 -18
- package/lib/frontend/app/ui/faces/faces.service.d.ts +0 -14
- package/lib/frontend/app/ui/faces/navigator/navigator.faces.component.d.ts +0 -15
- package/lib/frontend/app/ui/frame/frame.component.d.ts +0 -60
- package/lib/frontend/app/ui/gallery/Media.d.ts +0 -15
- package/lib/frontend/app/ui/gallery/MediaIcon.d.ts +0 -29
- package/lib/frontend/app/ui/gallery/blog/blog.gallery.component.d.ts +0 -16
- package/lib/frontend/app/ui/gallery/blog/blog.service.d.ts +0 -85
- package/lib/frontend/app/ui/gallery/blog/blog.service.spec.d.ts +0 -1
- package/lib/frontend/app/ui/gallery/cache.gallery.service.d.ts +0 -51
- package/lib/frontend/app/ui/gallery/content.service.d.ts +0 -11
- package/lib/frontend/app/ui/gallery/contentLoader.service.d.ts +0 -37
- package/lib/frontend/app/ui/gallery/directories/directories.component.d.ts +0 -14
- package/lib/frontend/app/ui/gallery/directories/directory/directory.gallery.component.d.ts +0 -20
- package/lib/frontend/app/ui/gallery/filter/filter.gallery.component.d.ts +0 -32
- package/lib/frontend/app/ui/gallery/filter/filter.service.d.ts +0 -51
- package/lib/frontend/app/ui/gallery/filter/filter.service.spec.d.ts +0 -1
- package/lib/frontend/app/ui/gallery/fullscreen.service.d.ts +0 -7
- package/lib/frontend/app/ui/gallery/gallery.component.d.ts +0 -64
- package/lib/frontend/app/ui/gallery/gallery.component.spec.d.ts +0 -1
- package/lib/frontend/app/ui/gallery/gallery.service.d.ts +0 -13
- package/lib/frontend/app/ui/gallery/grid/GridMedia.d.ts +0 -13
- package/lib/frontend/app/ui/gallery/grid/GridRowBuilder.d.ts +0 -16
- package/lib/frontend/app/ui/gallery/grid/grid.gallery.component.d.ts +0 -88
- package/lib/frontend/app/ui/gallery/grid/grid.gallery.component.spec.d.ts +0 -1
- package/lib/frontend/app/ui/gallery/grid/photo/loading/loading.photo.grid.gallery.component.d.ts +0 -4
- package/lib/frontend/app/ui/gallery/grid/photo/media-button-modal/media-button-modal.component.d.ts +0 -20
- package/lib/frontend/app/ui/gallery/grid/photo/media-button-modal/media-button-modal.service.d.ts +0 -27
- package/lib/frontend/app/ui/gallery/grid/photo/photo.grid.gallery.component.d.ts +0 -53
- package/lib/frontend/app/ui/gallery/lightbox/controls/controls.lightbox.gallery.component.d.ts +0 -103
- package/lib/frontend/app/ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.d.ts +0 -51
- package/lib/frontend/app/ui/gallery/lightbox/lightbox.gallery.component.d.ts +0 -95
- package/lib/frontend/app/ui/gallery/lightbox/lightbox.gallery.component.spec.d.ts +0 -1
- package/lib/frontend/app/ui/gallery/lightbox/lightbox.service.d.ts +0 -45
- package/lib/frontend/app/ui/gallery/lightbox/media/media.lightbox.gallery.component.d.ts +0 -71
- package/lib/frontend/app/ui/gallery/map/MarkerFactory.d.ts +0 -12
- package/lib/frontend/app/ui/gallery/map/lightbox/lightbox.map.gallery.component.d.ts +0 -80
- package/lib/frontend/app/ui/gallery/map/map.gallery.component.d.ts +0 -36
- package/lib/frontend/app/ui/gallery/map/map.service.d.ts +0 -30
- package/lib/frontend/app/ui/gallery/navigator/navigator.gallery.component.d.ts +0 -81
- package/lib/frontend/app/ui/gallery/navigator/navigator.service.d.ts +0 -14
- package/lib/frontend/app/ui/gallery/navigator/sorting.service.d.ts +0 -38
- package/lib/frontend/app/ui/gallery/overlay.service.d.ts +0 -9
- package/lib/frontend/app/ui/gallery/photo-frame-builder/photo-frame-builder.gallery.component.d.ts +0 -40
- package/lib/frontend/app/ui/gallery/random-query-builder/random-query-builder.gallery.component.d.ts +0 -30
- package/lib/frontend/app/ui/gallery/search/AutoCompleteRenderItem.d.ts +0 -11
- package/lib/frontend/app/ui/gallery/search/autocomplete.service.d.ts +0 -33
- package/lib/frontend/app/ui/gallery/search/query-builder/query-bulder.gallery.component.d.ts +0 -22
- package/lib/frontend/app/ui/gallery/search/query-enrty/query-entry.search.gallery.component.d.ts +0 -43
- package/lib/frontend/app/ui/gallery/search/search-field/search-field.gallery.component.d.ts +0 -31
- package/lib/frontend/app/ui/gallery/search/search-field-base/search-field-base.gallery.component.d.ts +0 -57
- package/lib/frontend/app/ui/gallery/search/search-query-parser.service.d.ts +0 -7
- package/lib/frontend/app/ui/gallery/search/search.gallery.component.d.ts +0 -39
- package/lib/frontend/app/ui/gallery/share/share.gallery.component.d.ts +0 -67
- package/lib/frontend/app/ui/gallery/share.service.d.ts +0 -35
- package/lib/frontend/app/ui/gallery/thumbnailLoader.service.d.ts +0 -41
- package/lib/frontend/app/ui/gallery/thumbnailManager.service.d.ts +0 -46
- package/lib/frontend/app/ui/gallery/uploader/uploader.gallery.component.d.ts +0 -15
- package/lib/frontend/app/ui/gallery/uploader/uploader.service.d.ts +0 -36
- package/lib/frontend/app/ui/gallery/wakelock.service.d.ts +0 -19
- package/lib/frontend/app/ui/language/language.component.d.ts +0 -10
- package/lib/frontend/app/ui/login/login.component.d.ts +0 -18
- package/lib/frontend/app/ui/settings/extension-installer/extension-installer.component.d.ts +0 -18
- package/lib/frontend/app/ui/settings/extension-installer/extension-installer.service.d.ts +0 -10
- package/lib/frontend/app/ui/settings/gallery-statistic/gallery-statistic.component.d.ts +0 -5
- package/lib/frontend/app/ui/settings/scheduled-jobs.service.d.ts +0 -41
- package/lib/frontend/app/ui/settings/settings.service.d.ts +0 -27
- package/lib/frontend/app/ui/settings/sharings-list/sharings-list.component.d.ts +0 -14
- package/lib/frontend/app/ui/settings/template/CustomSettingsEntries.d.ts +0 -57
- package/lib/frontend/app/ui/settings/template/ISettingsComponent.d.ts +0 -13
- package/lib/frontend/app/ui/settings/template/settings-entry/settings-entry.component.d.ts +0 -118
- package/lib/frontend/app/ui/settings/template/settings-entry/sorting-method/sorting-method.settings-entry.component.d.ts +0 -28
- package/lib/frontend/app/ui/settings/template/template.component.d.ts +0 -97
- package/lib/frontend/app/ui/settings/users/users.component.d.ts +0 -47
- package/lib/frontend/app/ui/settings/users/users.service.d.ts +0 -12
- package/lib/frontend/app/ui/settings/workflow/button/job-button.settings.component.d.ts +0 -32
- package/lib/frontend/app/ui/settings/workflow/progress/job-progress.settings.component.d.ts +0 -25
- package/lib/frontend/app/ui/settings/workflow/workflow.component.d.ts +0 -68
- package/lib/frontend/app/ui/sharelogin/share-login.component.d.ts +0 -16
- package/lib/frontend/app/ui/utils/grid-size-icon/grid-size-icon.component.d.ts +0 -5
- package/lib/frontend/app/ui/utils/sorting-method-icon/sorting-method-icon.component.d.ts +0 -13
- package/lib/frontend/app/ui/utils/timestamp-datepicker/datepicker.component.d.ts +0 -10
- package/lib/frontend/app/ui/utils/timestamp-timepicker/timepicker.component.d.ts +0 -11
- package/lib/frontend/environments/environment.d.ts +0 -3
- package/lib/frontend/environments/environment.prod.d.ts +0 -3
- package/lib/frontend/main.d.ts +0 -21
- package/lib/frontend/polyfills.d.ts +0 -60
- package/lib/frontend/test.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
# PiGallery2 Extension
|
|
2
|
-
|
|
3
|
-
This folder contains the core of the extension system.
|
|
4
|
-
|
|
5
|
-
For extension development and usage, please see the [documentation](https://bpatrik.github.io/pigallery2/development/extensions/).
|
|
1
|
+
# PiGallery2 Extension
|
|
2
|
+
|
|
3
|
+
This folder contains the core of the extension system.
|
|
4
|
+
|
|
5
|
+
For extension development and usage, please see the [documentation](https://bpatrik.github.io/pigallery2/development/extensions/).
|
|
6
|
+
|
|
7
|
+
## The `pigallery2-extension-kit` package
|
|
8
|
+
|
|
9
|
+
`npm run build-extension-interface` builds the package content here (`lib/`, `index.js`, `index.d.ts`).
|
|
10
|
+
CI publishes it to npm with the app's version (see "Releasing" in the [contribution guide](../docs/development/contributing.md)),
|
|
11
|
+
so the `version` in this `package.json` is not maintained by hand.
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IServerExtension, IExtensionObject } from './lib/backend/model/extension/IExtension';
|
package/index.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/lib/backend/Logger.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ErrorCodes } from '../common/entities/Error';
|
|
2
|
-
export type LoggerArgs =
|
|
2
|
+
export type LoggerArgs = unknown;
|
|
3
3
|
export type LoggerFunction = (...args: LoggerArgs[]) => void;
|
|
4
4
|
export interface ILogger {
|
|
5
5
|
silly: LoggerFunction;
|
|
@@ -11,12 +11,12 @@ export interface ILogger {
|
|
|
11
11
|
}
|
|
12
12
|
export declare const createLoggerWrapper: (TAG: string) => ILogger;
|
|
13
13
|
export declare class Logger {
|
|
14
|
-
static silly(...args: LoggerArgs[]): void;
|
|
15
|
-
static debug(...args: LoggerArgs[]): void;
|
|
16
|
-
static verbose(...args: LoggerArgs[]): void;
|
|
17
|
-
static info(...args: LoggerArgs[]): void;
|
|
18
|
-
static warn(...args: LoggerArgs[]): void;
|
|
19
|
-
static error(...args: LoggerArgs[]): void;
|
|
14
|
+
static silly(this: void, ...args: LoggerArgs[]): void;
|
|
15
|
+
static debug(this: void, ...args: LoggerArgs[]): void;
|
|
16
|
+
static verbose(this: void, ...args: LoggerArgs[]): void;
|
|
17
|
+
static info(this: void, ...args: LoggerArgs[]): void;
|
|
18
|
+
static warn(this: void, ...args: LoggerArgs[]): void;
|
|
19
|
+
static error(this: void, ...args: LoggerArgs[]): void;
|
|
20
20
|
static logLevelForError(e: ErrorCodes): LoggerFunction;
|
|
21
21
|
private static log;
|
|
22
22
|
}
|
|
@@ -13,6 +13,18 @@ export declare class ProjectPathClass {
|
|
|
13
13
|
normalizeRelative(pathStr: string): string;
|
|
14
14
|
getAbsolutePath(pathStr: string): string;
|
|
15
15
|
getRelativePathToImages(pathStr: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Checks if pathStr (absolute or relative to ImageFolder) stays inside ImageFolder.
|
|
18
|
+
* Pure string check, no disk access.
|
|
19
|
+
*/
|
|
20
|
+
isInsideImageFolder(pathStr: string): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Resolves a path from a request (relative to ImageFolder, even with a leading '/') to an absolute path.
|
|
23
|
+
* Returns null if it would point outside of ImageFolder. Pure string check, no disk access.
|
|
24
|
+
* Use it wherever a request path reaches the disk: the check sits next to the use,
|
|
25
|
+
* so it also holds for callers that skip AuthenticationMWs.normalizePathParam (and CodeQL can see it).
|
|
26
|
+
*/
|
|
27
|
+
resolveInImageFolder(relativePath: string): string | null;
|
|
16
28
|
reset(): void;
|
|
17
29
|
}
|
|
18
30
|
export declare const ProjectPath: ProjectPathClass;
|
package/lib/backend/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import 'reflect-metadata';
|
|
@@ -7,6 +7,10 @@ export declare class GalleryMWs {
|
|
|
7
7
|
static parseSearchQuery(req: Request, res: Response, next: NextFunction): void;
|
|
8
8
|
static listDirectory(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
9
9
|
static zipDirectory(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* The zip of a folder (the navbar's exact directory query) is named after the folder, other searches are SearchResults.zip.
|
|
12
|
+
*/
|
|
13
|
+
private static zipName;
|
|
10
14
|
static cleanUpGalleryResults(req: Request, res: Response, next: NextFunction): void;
|
|
11
15
|
static loadFile(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
12
16
|
static loadBestFitVideo(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
@@ -3,5 +3,5 @@ export declare class PersonMWs {
|
|
|
3
3
|
static updatePerson(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
4
4
|
static getPerson(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
5
5
|
static listPersons(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
6
|
-
static cleanUpPersonResults(req: Request, res: Response, next: NextFunction):
|
|
6
|
+
static cleanUpPersonResults(req: Request, res: Response, next: NextFunction): void;
|
|
7
7
|
}
|
|
@@ -4,9 +4,33 @@ export declare class RenderingMWs {
|
|
|
4
4
|
static renderSessionUser(req: Request, res: Response, next: NextFunction): void;
|
|
5
5
|
static renderSharing(req: Request, res: Response, next: NextFunction): void;
|
|
6
6
|
static renderSharingList(req: Request, res: Response, next: NextFunction): void;
|
|
7
|
+
/**
|
|
8
|
+
* For media that rarely changes under the same URL (photos, thumbnails, previews).
|
|
9
|
+
* Cached for a day only: a photo can be replaced in the folder, a thumbnail regenerated with other settings.
|
|
10
|
+
* private: these are behind authentication, so shared caches (proxies, CDNs) must not store them.
|
|
11
|
+
*/
|
|
7
12
|
static renderFile(req: Request, res: Response, next: NextFunction): void;
|
|
13
|
+
/**
|
|
14
|
+
* For files that can change under the same URL (e.g. bestFit switches to the transcoded video once it is ready).
|
|
15
|
+
* The browser revalidates them with the ETag.
|
|
16
|
+
*/
|
|
17
|
+
static renderFileNoCache(req: Request, res: Response, next: NextFunction): void;
|
|
18
|
+
/**
|
|
19
|
+
* For responses that differ on every request (e.g. random photo).
|
|
20
|
+
*/
|
|
21
|
+
static renderFileNoStore(req: Request, res: Response, next: NextFunction): void;
|
|
22
|
+
private static sendFile;
|
|
8
23
|
static renderOK(req: Request, res: Response): void;
|
|
9
24
|
static renderConfig(req: Request, res: Response): Promise<void>;
|
|
25
|
+
static notFound(req: Request, res: Response, next: NextFunction): void;
|
|
10
26
|
static renderError(err: Error, req: Request, res: Response, next: NextFunction): void;
|
|
27
|
+
/**
|
|
28
|
+
* An http-errors error of the client (status 4xx), raised by express or its middlewares.
|
|
29
|
+
*/
|
|
30
|
+
static isClientHttpError(err: unknown): err is Error & {
|
|
31
|
+
status: number;
|
|
32
|
+
headers?: Record<string, string>;
|
|
33
|
+
};
|
|
34
|
+
private static httpStatus;
|
|
11
35
|
protected static renderMessage<T>(res: Response, content: T): void;
|
|
12
36
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Request } from 'express';
|
|
2
|
+
export declare class RequestParams {
|
|
3
|
+
/**
|
|
4
|
+
* Reads a path param as a string.
|
|
5
|
+
* Express 5 gives a wildcard param (`/*name`) as the array of its decoded segments.
|
|
6
|
+
* They are joined back with '/', so `a%2Fb/c` reads as `a/b/c`, as in Express 4.
|
|
7
|
+
*/
|
|
8
|
+
static get(req: Request, name: string): string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Reads a path param that the route always has (see get()).
|
|
11
|
+
*/
|
|
12
|
+
static getRequired(req: Request, name: string): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Request } from 'express';
|
|
2
|
+
import { SessionContext } from '../model/SessionContext';
|
|
3
|
+
export declare class RequestSession {
|
|
4
|
+
/**
|
|
5
|
+
* The context of the logged-in session.
|
|
6
|
+
* AuthenticationMWs.authenticate sets it, so a route that authenticates always has it.
|
|
7
|
+
*/
|
|
8
|
+
static getContext(req: Request): SessionContext;
|
|
9
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { NextFunction, Request, Response } from 'express';
|
|
2
2
|
export declare class ServerTimeEntry {
|
|
3
3
|
name: string;
|
|
4
|
-
startHR
|
|
5
|
-
endTime: number;
|
|
4
|
+
startHR?: [number, number];
|
|
5
|
+
endTime: number | null;
|
|
6
6
|
constructor(name: string);
|
|
7
7
|
start(): void;
|
|
8
|
-
end():
|
|
8
|
+
end(): number;
|
|
9
9
|
}
|
|
10
|
-
export declare const FunctionTime: (id: string, name: string) => (target: unknown, propertyName: string, descriptor: TypedPropertyDescriptor<(...args:
|
|
11
|
-
export declare const ServerTime: (id: string, name: string) => (
|
|
10
|
+
export declare const FunctionTime: (id: string, name: string) => <A extends unknown[], R>(target: unknown, propertyName: string, descriptor: TypedPropertyDescriptor<(...args: A) => R>) => void;
|
|
11
|
+
export declare const ServerTime: (id: string, name: string) => <T extends (req: Request, res: Response, next: NextFunction) => void | Promise<void>>(target: unknown, propertyName: string, descriptor: TypedPropertyDescriptor<T>) => void;
|
|
12
12
|
export declare class ServerTimingMWs {
|
|
13
13
|
/**
|
|
14
14
|
* Add server timing
|
|
15
15
|
*/
|
|
16
|
-
static addServerTiming(req: Request, res: Response, next: NextFunction):
|
|
16
|
+
static addServerTiming(req: Request, res: Response, next: NextFunction): void;
|
|
17
17
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { NextFunction, Request, Response } from 'express';
|
|
2
2
|
export declare class SharingMWs {
|
|
3
|
+
private static exactDirectoryQuery;
|
|
3
4
|
static getSharing(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
4
|
-
static
|
|
5
|
+
static getSharingPublicInfo(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
5
6
|
static createSharing(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
6
7
|
static updateSharing(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
7
8
|
static deleteSharing(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
@@ -3,7 +3,7 @@ export declare class VersionMWs {
|
|
|
3
3
|
/**
|
|
4
4
|
* This version data is mainly used to trigger page reload on the client side
|
|
5
5
|
*/
|
|
6
|
-
static injectAppVersion(req: Request, res: Response, next: NextFunction):
|
|
6
|
+
static injectAppVersion(req: Request, res: Response, next: NextFunction): void;
|
|
7
7
|
/**
|
|
8
8
|
* This version data is mainly used on the client side to invalidate the cache
|
|
9
9
|
*/
|
|
@@ -2,7 +2,7 @@ import { NextFunction, Request, Response } from 'express';
|
|
|
2
2
|
import { ThumbnailSourceType } from '../../model/fileaccess/PhotoWorker';
|
|
3
3
|
export declare class ThumbnailGeneratorMWs {
|
|
4
4
|
private static ThumbnailMapEntries;
|
|
5
|
-
static addThumbnailInformation(req: Request, res: Response, next: NextFunction):
|
|
5
|
+
static addThumbnailInformation(req: Request, res: Response, next: NextFunction): void;
|
|
6
6
|
static addThumbnailInfoForPersons(req: Request, res: Response, next: NextFunction): void;
|
|
7
7
|
static generatePersonThumbnail(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
8
8
|
static generateThumbnailFactory(sourceType: ThumbnailSourceType): (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
@@ -5,11 +5,48 @@ export declare class AuthenticationMWs {
|
|
|
5
5
|
static authenticate(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
6
6
|
static normalizePathParam(paramName: string): (req: Request, res: Response, next: NextFunction) => void;
|
|
7
7
|
static authoriseMetaFiles(paramName: string): (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Authorises the directory against the directory allow and block lists of the session (see DirectoryAccess).
|
|
10
|
+
* Not available directories get the same error as not existing ones, so it can't be used to find out if a directory exists.
|
|
11
|
+
* It sets req.directoryAccess for the next middlewares.
|
|
12
|
+
*/
|
|
13
|
+
static authoriseDirectory(paramName: string): (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* The response for not existing and not available directories. They need to be the same:
|
|
16
|
+
* GalleryMWs.listDirectory answers not existing directories with the same status and error.
|
|
17
|
+
*/
|
|
18
|
+
private static directoryNotFound;
|
|
8
19
|
static authoriseMedia(paramName: string): (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
9
20
|
static authorise(role: UserRoles): (req: Request, res: Response, next: NextFunction) => void;
|
|
10
21
|
static shareLogin(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
11
22
|
static inverseAuthenticate(req: Request, res: Response, next: NextFunction): void;
|
|
12
23
|
static login(req: Request, res: Response, next: NextFunction): Promise<void | Response>;
|
|
24
|
+
static oidcLogin(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Starts the session again from the current DB row of its user,
|
|
27
|
+
* so changing the own user (e.g.: the password) does not end the session. Use it after user changes.
|
|
28
|
+
*/
|
|
29
|
+
static refreshSession(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
13
30
|
static logout(req: Request, res: Response, next: NextFunction): void;
|
|
31
|
+
/**
|
|
32
|
+
* Logs in the user (or sharing guest) for this session.
|
|
33
|
+
* Only "remember me" sessions survive closing the browser.
|
|
34
|
+
*/
|
|
35
|
+
private static startSession;
|
|
36
|
+
/**
|
|
37
|
+
* The session is stored in the cookie. It ends if it timed out or its user or sharing got deleted or changed
|
|
38
|
+
* (see SessionManager.getSessionStamp).
|
|
39
|
+
* Returns false if there is no session (anymore).
|
|
40
|
+
*/
|
|
41
|
+
private static restoreSession;
|
|
42
|
+
/**
|
|
43
|
+
* Sessions expire after Server.sessionTimeout of inactivity.
|
|
44
|
+
*/
|
|
45
|
+
private static extendSession;
|
|
46
|
+
/**
|
|
47
|
+
* Returns true if the prebuilt queries of the context got lost (e.g.: during session serialization)
|
|
48
|
+
*/
|
|
49
|
+
private static isContextBroken;
|
|
50
|
+
private static getSharingKey;
|
|
14
51
|
private static getSharingUser;
|
|
15
52
|
}
|
|
@@ -1,7 +1,38 @@
|
|
|
1
|
-
import { Request
|
|
1
|
+
import { Request } from 'express';
|
|
2
|
+
import { UserDTO } from '../../../common/entities/UserDTO';
|
|
2
3
|
export declare class OIDCAuthService {
|
|
3
|
-
private static
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
private static configurationPromise;
|
|
5
|
+
/**
|
|
6
|
+
* Step 1 of the OIDC authorization code flow: the URL of the authentication request at the provider.
|
|
7
|
+
* The provider sends the authentication response back to Users.oidc.redirectUri.
|
|
8
|
+
*/
|
|
9
|
+
static getAuthenticationRequestUrl(req: Request): Promise<string>;
|
|
10
|
+
/**
|
|
11
|
+
* Step 2 of the OIDC authorization code flow: validates the authentication response,
|
|
12
|
+
* exchanges its code for the tokens and returns with the user of their claims.
|
|
13
|
+
*/
|
|
14
|
+
static getUserFromAuthenticationResponse(req: Request): Promise<UserDTO>;
|
|
15
|
+
private static findUser;
|
|
16
|
+
/**
|
|
17
|
+
* Strict security: the app user is bound to the provider account (issuer + subject).
|
|
18
|
+
* Name matching is only used to link a not yet linked user with a limited role.
|
|
19
|
+
*/
|
|
20
|
+
private static findStrictUser;
|
|
21
|
+
private static createUser;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the ID token claims. Some providers only return
|
|
24
|
+
* some claims (e.g.: preferred_username, email) from the userinfo endpoint,
|
|
25
|
+
* so if any of the required ones is missing, they are filled from there.
|
|
26
|
+
* ID token claims always take precedence.
|
|
27
|
+
*/
|
|
28
|
+
private static getClaims;
|
|
29
|
+
/**
|
|
30
|
+
* The provider's discovery document URL. Like with openid-client 5, the issuer URL setting
|
|
31
|
+
* may also be the discovery document URL itself.
|
|
32
|
+
* The discovery document doesn't have to repeat the issuer URL setting character by character
|
|
33
|
+
* (e.g.: a missing trailing slash). The ID tokens are still checked against the issuer it names.
|
|
34
|
+
*/
|
|
35
|
+
private static getDiscoveryUrl;
|
|
36
|
+
private static discover;
|
|
37
|
+
private static getConfiguration;
|
|
7
38
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NextFunction, Request, Response } from 'express';
|
|
2
|
+
export declare class OIDCMWs {
|
|
3
|
+
static isEnabled(req: Request, res: Response, next: NextFunction): void;
|
|
4
|
+
/**
|
|
5
|
+
* Sends the authentication request to the OIDC provider.
|
|
6
|
+
* Its response arrives at the redirectUri (see AuthenticationMWs.oidcLogin).
|
|
7
|
+
*/
|
|
8
|
+
static redirectToProvider(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
9
|
+
static redirectToApp(req: Request, res: Response): void;
|
|
10
|
+
}
|
|
@@ -4,5 +4,6 @@ export declare class UserMWs {
|
|
|
4
4
|
static deleteUser(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
5
5
|
static changeRole(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
6
6
|
static updateSettings(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
7
|
+
static unlinkOidc(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
7
8
|
static listUsers(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
8
9
|
}
|
|
@@ -2,5 +2,4 @@ import { NextFunction, Request, Response } from 'express';
|
|
|
2
2
|
export declare class UserRequestConstrainsMWs {
|
|
3
3
|
static forceSelfRequest(req: Request, res: Response, next: NextFunction): void;
|
|
4
4
|
static notSelfRequest(req: Request, res: Response, next: NextFunction): void;
|
|
5
|
-
static notSelfRequestOr2Admins(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
6
5
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Brackets, WhereExpressionBuilder } from 'typeorm';
|
|
2
|
+
import type { SessionContext } from './SessionContext';
|
|
3
|
+
import { DirectoryCacheDTO, SubDirectoryDTO } from '../../common/entities/DirectoryDTO';
|
|
4
|
+
import { DirectorySearch } from '../../common/entities/SearchQueryDTO';
|
|
5
|
+
export declare enum DirectoryAccessTypes {
|
|
6
|
+
none = 0,// not available, behaves as if it would not exist
|
|
7
|
+
parent = 1,// can be opened to navigate to available directories, but its own content is hidden
|
|
8
|
+
available = 2
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Directory filter prebuilt for the two directory aliases used in the queries
|
|
12
|
+
*/
|
|
13
|
+
export interface DirectoryFilter {
|
|
14
|
+
directory: Brackets;
|
|
15
|
+
directories: Brackets;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Decides which directories a session can open, based on the directory allow and block lists.
|
|
19
|
+
* It lives in SessionContext.directoryAccess.
|
|
20
|
+
* - A blocked directory is never available.
|
|
21
|
+
* - A directory matching all allow lists is available.
|
|
22
|
+
* - Users can open the parents of the available directories (their content is hidden).
|
|
23
|
+
* These parents are found from the path for anchored searches (exact path, 'path/*'), otherwise from the DB.
|
|
24
|
+
* - Sharing users can't open parents.
|
|
25
|
+
* - Sharing without directory query: only directories with visible photos are available,
|
|
26
|
+
* directories with visible photos below them are parents.
|
|
27
|
+
*/
|
|
28
|
+
export declare class DirectoryAccess {
|
|
29
|
+
allowLists?: DirectorySearch[][];
|
|
30
|
+
blockList?: DirectorySearch[];
|
|
31
|
+
byPhotos?: boolean;
|
|
32
|
+
allowQuery?: DirectoryFilter;
|
|
33
|
+
notBlockedQuery?: DirectoryFilter;
|
|
34
|
+
private readonly context;
|
|
35
|
+
constructor(context: SessionContext, init?: Partial<Pick<DirectoryAccess, 'allowLists' | 'blockList' | 'byPhotos' | 'allowQuery' | 'notBlockedQuery'>>);
|
|
36
|
+
get isSharing(): boolean;
|
|
37
|
+
isBlocked(dirPath: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* True if the directory matches all allow lists (does not check the block list)
|
|
40
|
+
*/
|
|
41
|
+
isAllowed(dirPath: string): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Media and metafiles of a directory are only shown if it is available.
|
|
44
|
+
*/
|
|
45
|
+
isAvailable(dirPath: string): Promise<boolean>;
|
|
46
|
+
getAccess(dirPath: string): Promise<DirectoryAccessTypes>;
|
|
47
|
+
/**
|
|
48
|
+
* Which parents (root is the first) the session can open.
|
|
49
|
+
* The directory itself is accessible, so all its parents lead to an available directory.
|
|
50
|
+
*/
|
|
51
|
+
getAvailableParents(dirPath: string): boolean[];
|
|
52
|
+
/**
|
|
53
|
+
* Directories in search results and autocomplete need to be available (not just parents)
|
|
54
|
+
*/
|
|
55
|
+
isListedInSearch(cache: DirectoryCacheDTO | undefined): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Applies the directory allow/block list on a directory query.
|
|
58
|
+
* Parents are not added, those need to be filtered by the caller (see isListedInSearch).
|
|
59
|
+
*/
|
|
60
|
+
filterDirectoryQuery(qb: WhereExpressionBuilder, alias: keyof DirectoryFilter): void;
|
|
61
|
+
/**
|
|
62
|
+
* Filters the subdirectories of a listed directory. The caches of the subdirectories need to be filled.
|
|
63
|
+
*/
|
|
64
|
+
filterSubDirectories<T extends SubDirectoryDTO>(parent: {
|
|
65
|
+
path: string;
|
|
66
|
+
name: string;
|
|
67
|
+
}, subDirs: T[]): Promise<T[]>;
|
|
68
|
+
private isAnchoredParent;
|
|
69
|
+
/**
|
|
70
|
+
* Parents of like, negated and non-trailing glob searches can only be found from the DB
|
|
71
|
+
*/
|
|
72
|
+
private needsDBForParents;
|
|
73
|
+
private getAccessByPhotos;
|
|
74
|
+
/**
|
|
75
|
+
* Returns the available (allowed and not blocked) directories below the given directory
|
|
76
|
+
*/
|
|
77
|
+
private getAvailableDirectoriesBelow;
|
|
78
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The part of `ffprobe -print_format json -show_format -show_streams` that the app reads.
|
|
3
|
+
* ffprobe prints most numbers as strings.
|
|
4
|
+
*/
|
|
5
|
+
export interface FfprobeStream {
|
|
6
|
+
codec_type?: string;
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
duration?: string;
|
|
10
|
+
bit_rate?: string;
|
|
11
|
+
avg_frame_rate?: string;
|
|
12
|
+
side_data_list?: {
|
|
13
|
+
side_data_type?: string;
|
|
14
|
+
rotation?: number;
|
|
15
|
+
}[];
|
|
16
|
+
tags?: Record<string, string>;
|
|
17
|
+
}
|
|
18
|
+
export interface FfprobeFormat {
|
|
19
|
+
duration?: string;
|
|
20
|
+
bit_rate?: string;
|
|
21
|
+
tags?: Record<string, string>;
|
|
22
|
+
}
|
|
23
|
+
export interface FfprobeData {
|
|
24
|
+
streams: FfprobeStream[];
|
|
25
|
+
format: FfprobeFormat;
|
|
26
|
+
}
|
|
27
|
+
export interface FFmpegRunOptions {
|
|
28
|
+
/** Called with every line ffmpeg writes to stderr (ffmpeg writes all its output there). */
|
|
29
|
+
onStderrLine?: (line: string) => void;
|
|
30
|
+
/** Called with the full command line before ffmpeg starts. */
|
|
31
|
+
onStart?: (cmd: string) => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Thin wrapper over the ffmpeg and ffprobe executables.
|
|
35
|
+
*/
|
|
36
|
+
export declare class FFmpeg {
|
|
37
|
+
/** stderr lines kept for the error message of a failed run */
|
|
38
|
+
private static readonly ERROR_LINES;
|
|
39
|
+
static probe(file: string): Promise<FfprobeData>;
|
|
40
|
+
static run(args: string[], options?: FFmpegRunOptions): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Splits each `'-option value'` (exactly two words) into two arguments, so config values like
|
|
43
|
+
* `'-movflags +faststart'` work (fluent-ffmpeg did the same).
|
|
44
|
+
*/
|
|
45
|
+
static splitOptions(options?: string[]): string[];
|
|
46
|
+
private static spawn;
|
|
47
|
+
}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
export interface FFmpegPaths {
|
|
2
|
+
ffmpeg: string;
|
|
3
|
+
ffprobe: string;
|
|
4
|
+
}
|
|
2
5
|
export declare class FFmpegFactory {
|
|
3
|
-
static
|
|
6
|
+
private static paths;
|
|
7
|
+
/**
|
|
8
|
+
* Paths of the ffmpeg and ffprobe executables.
|
|
9
|
+
* Prefers the optional ffmpeg-static/ffprobe-static packages, then FFMPEG_PATH/FFPROBE_PATH, then the PATH.
|
|
10
|
+
*/
|
|
11
|
+
static getPaths(): FFmpegPaths;
|
|
12
|
+
private static requirePath;
|
|
4
13
|
}
|
|
@@ -39,7 +39,7 @@ export declare class ObjectManagers {
|
|
|
39
39
|
static isReady(): boolean;
|
|
40
40
|
init(): Promise<void>;
|
|
41
41
|
private initManagers;
|
|
42
|
-
onDataChange(changedDir?: DirectoryPathDTO): Promise<void>;
|
|
42
|
+
onDataChange(changedDir?: DirectoryPathDTO | null): Promise<void>;
|
|
43
43
|
get VersionManager(): VersionManager;
|
|
44
44
|
set VersionManager(value: VersionManager);
|
|
45
45
|
get LocationManager(): LocationManager;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare class PasswordHelper {
|
|
2
2
|
static cryptPassword(password: string): string;
|
|
3
|
-
static comparePassword(password: string, encryptedPassword: string): boolean;
|
|
3
|
+
static comparePassword(password: string | null | undefined, encryptedPassword: string | null | undefined): boolean;
|
|
4
4
|
}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import { Brackets } from 'typeorm';
|
|
2
2
|
import { UserDTO } from '../../common/entities/UserDTO';
|
|
3
|
-
import { SearchQueryDTO } from '../../common/entities/SearchQueryDTO';
|
|
3
|
+
import { DirectorySearch, SearchQueryDTO } from '../../common/entities/SearchQueryDTO';
|
|
4
|
+
import { DirectoryAccess } from './DirectoryAccess';
|
|
4
5
|
export declare class SessionContext {
|
|
5
6
|
user: ContextUser;
|
|
6
7
|
projectionQuery?: Brackets;
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
hasDirectoryProjection?: boolean;
|
|
9
|
+
directoryAccess: DirectoryAccess;
|
|
9
10
|
}
|
|
10
|
-
export interface
|
|
11
|
+
export interface SessionUser extends UserDTO {
|
|
11
12
|
overrideAllowBlockList?: boolean;
|
|
12
|
-
allowQuery?: SearchQueryDTO;
|
|
13
|
-
blockQuery?: SearchQueryDTO;
|
|
13
|
+
allowQuery?: SearchQueryDTO | null;
|
|
14
|
+
blockQuery?: SearchQueryDTO | null;
|
|
15
|
+
allowDirectoryList?: DirectorySearch[] | null;
|
|
16
|
+
blockDirectoryList?: DirectorySearch[] | null;
|
|
17
|
+
sharingDirectoryQuery?: DirectorySearch | null;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The user of a built session context (see SessionManager.buildContext): its projection key is always set.
|
|
21
|
+
*/
|
|
22
|
+
export interface ContextUser extends SessionUser {
|
|
23
|
+
projectionKey: string;
|
|
14
24
|
}
|
|
@@ -2,8 +2,11 @@ export interface UploadError {
|
|
|
2
2
|
filename: string;
|
|
3
3
|
error: string;
|
|
4
4
|
}
|
|
5
|
+
export type UploadedFile = Express.Multer.File & {
|
|
6
|
+
tooLarge?: boolean;
|
|
7
|
+
};
|
|
5
8
|
export declare class UploadManager {
|
|
6
|
-
saveFiles(directory: string, files:
|
|
7
|
-
saveFile(directory: string, file:
|
|
8
|
-
private
|
|
9
|
+
saveFiles(directory: string, files: UploadedFile[]): Promise<UploadError[]>;
|
|
10
|
+
saveFile(directory: string, file: UploadedFile): Promise<void>;
|
|
11
|
+
private static assertDirectoryExists;
|
|
9
12
|
}
|
|
@@ -6,10 +6,16 @@ export interface CoverPhotoDTOWithID extends CoverPhotoDTO {
|
|
|
6
6
|
}
|
|
7
7
|
export declare class CoverManager {
|
|
8
8
|
private static DIRECTORY_SELECT;
|
|
9
|
+
/**
|
|
10
|
+
* Applies the configured cover sorting and adds media.id as a tie-breaker,
|
|
11
|
+
* so equally ranked media (e.g.: no rating) resolve to the same cover on every DB.
|
|
12
|
+
* Without it, MySQL may return tied rows in any order.
|
|
13
|
+
*/
|
|
14
|
+
private static setCoverSorting;
|
|
9
15
|
resetCovers(): Promise<void>;
|
|
10
16
|
getCoverForAlbum(session: SessionContext, album: {
|
|
11
17
|
searchQuery: SearchQueryDTO;
|
|
12
|
-
}): Promise<CoverPhotoDTOWithID>;
|
|
18
|
+
}): Promise<CoverPhotoDTOWithID | null>;
|
|
13
19
|
getPartialDirsWithoutCovers(projectionKeys?: string[]): Promise<{
|
|
14
20
|
id: number;
|
|
15
21
|
name: string;
|
|
@@ -19,5 +25,5 @@ export declare class CoverManager {
|
|
|
19
25
|
id: number;
|
|
20
26
|
name: string;
|
|
21
27
|
path: string;
|
|
22
|
-
}): Promise<CoverPhotoDTOWithID>;
|
|
28
|
+
}): Promise<CoverPhotoDTOWithID | null>;
|
|
23
29
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ParentDirectoryDTO, SubDirectoryDTO } from '../../../common/entities/DirectoryDTO';
|
|
2
2
|
import { DirectoryEntity } from './enitites/DirectoryEntity';
|
|
3
|
-
import {
|
|
3
|
+
import { DataSource } from 'typeorm';
|
|
4
4
|
import { MediaEntity } from './enitites/MediaEntity';
|
|
5
5
|
import { DuplicatesDTO } from '../../../common/entities/DuplicatesDTO';
|
|
6
6
|
import { SessionContext } from '../SessionContext';
|
|
@@ -9,7 +9,10 @@ export declare class GalleryManager {
|
|
|
9
9
|
name: string;
|
|
10
10
|
parent: string;
|
|
11
11
|
};
|
|
12
|
-
listDirectory(session: SessionContext, relativeDirectoryName: string, knownLastModified?: number, knownLastScanned?: number
|
|
12
|
+
listDirectory(session: SessionContext, relativeDirectoryName: string, knownLastModified?: number, knownLastScanned?: number, options?: {
|
|
13
|
+
allowIndexing?: boolean;
|
|
14
|
+
withMetaFiles?: boolean;
|
|
15
|
+
}): Promise<ParentDirectoryDTO | null>;
|
|
13
16
|
countDirectories(): Promise<number>;
|
|
14
17
|
countMediaSize(): Promise<number>;
|
|
15
18
|
countPhotos(): Promise<number>;
|
|
@@ -18,18 +21,21 @@ export declare class GalleryManager {
|
|
|
18
21
|
/**
|
|
19
22
|
* Returns with the directories only, does not include media or metafiles
|
|
20
23
|
*/
|
|
21
|
-
selectDirStructure(relativeDirectoryName: string): Promise<DirectoryEntity>;
|
|
24
|
+
selectDirStructure(relativeDirectoryName: string): Promise<DirectoryEntity | null>;
|
|
22
25
|
/**
|
|
23
26
|
* Sets cover for the directory and caches it in the DB
|
|
24
27
|
*/
|
|
25
|
-
fillCacheForSubDir(connection:
|
|
26
|
-
getMedia(session: SessionContext, mediaPath: string): Promise<MediaEntity>;
|
|
28
|
+
fillCacheForSubDir(connection: DataSource, session: SessionContext, dir: SubDirectoryDTO): Promise<void>;
|
|
29
|
+
getMedia(session: SessionContext, mediaPath: string): Promise<MediaEntity | null>;
|
|
27
30
|
authoriseMedia(session: SessionContext, mediaPath: string): Promise<boolean>;
|
|
31
|
+
/**
|
|
32
|
+
* Metafiles belong to their directory: they are available if the directory is available (see DirectoryAccess).
|
|
33
|
+
*/
|
|
28
34
|
authoriseMetaFile(session: SessionContext, p: string): Promise<boolean>;
|
|
29
|
-
protected getDirIdAndTime(connection:
|
|
35
|
+
protected getDirIdAndTime(connection: DataSource, name: string, path: string): Promise<{
|
|
30
36
|
id: number;
|
|
31
|
-
lastScanned
|
|
37
|
+
lastScanned?: number | null;
|
|
32
38
|
lastModified: number;
|
|
33
|
-
}>;
|
|
34
|
-
protected getParentDirFromId(connection:
|
|
39
|
+
} | null>;
|
|
40
|
+
protected getParentDirFromId(connection: DataSource, session: SessionContext, partialDirId: number, withMetaFiles?: boolean): Promise<ParentDirectoryDTO>;
|
|
35
41
|
}
|