pigallery2-extension-kit 3.0.1 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -106
- package/REPOSITORY.md +2 -1
- package/lib/backend/Logger.d.ts +1 -1
- package/lib/backend/ProjectPath.js +1 -1
- package/lib/backend/exceptions/FileAlreadyExists.d.ts +4 -0
- package/lib/backend/middlewares/UploadMWs.d.ts +4 -0
- package/lib/backend/middlewares/VersionMWs.d.ts +4 -0
- package/lib/backend/middlewares/user/OIDCAuthService.d.ts +7 -0
- package/lib/backend/model/ObjectManagers.d.ts +6 -2
- package/lib/backend/model/UploadManager.d.ts +9 -0
- package/lib/backend/model/database/AlbumManager.d.ts +1 -1
- package/lib/backend/model/database/CoverManager.d.ts +1 -1
- package/lib/backend/model/database/IObjectManager.d.ts +2 -2
- package/lib/backend/model/database/IndexingManager.d.ts +1 -0
- package/lib/backend/model/database/PersonManager.d.ts +1 -1
- package/lib/backend/model/database/ProjectedCacheManager.d.ts +4 -0
- package/lib/backend/model/database/SearchManager.d.ts +1 -1
- package/lib/backend/model/extension/ExtensionRepository.d.ts +1 -0
- package/lib/backend/model/fileaccess/DiskManager.d.ts +2 -1
- package/lib/backend/model/jobs/JobManager.d.ts +1 -1
- package/lib/backend/model/jobs/jobs/AlbumCoverFillingJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/AlbumCoverResetJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/AlbumResetJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/FileJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/GPXCompressionJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/GPXCompressionResetJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/GalleryResetJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/IndexingJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/Job.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/JobProgress.d.ts +2 -1
- package/lib/backend/model/jobs/jobs/PhotoConvertingJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/TempFolderCleaningJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/TopPickSendJob.d.ts +1 -0
- package/lib/backend/model/jobs/jobs/VideoConvertingJob.d.ts +1 -0
- package/lib/backend/routes/OIDCRouter.d.ts +7 -0
- package/lib/backend/routes/UploadRouter.d.ts +5 -0
- package/lib/common/CustomHeaders.d.ts +1 -0
- package/lib/common/DataStructureVersion.d.ts +1 -1
- package/lib/common/PG2ConfMap.d.ts +1 -0
- package/lib/common/QueryParams.d.ts +19 -1
- package/lib/common/SearchQueryParser.d.ts +11 -10
- package/lib/common/SearchQueryUtils.d.ts +13 -2
- package/lib/common/Utils.d.ts +7 -5
- package/lib/common/Utils.js +55 -19
- package/lib/common/config/private/Config.js +1 -0
- package/lib/common/config/private/PrivateConfig.d.ts +16 -1
- package/lib/common/config/private/PrivateConfig.js +161 -5
- package/lib/common/config/private/PrivateConfigClass.d.ts +2 -0
- package/lib/common/config/private/PrivateConfigClass.js +7 -0
- package/lib/common/config/public/ClientConfig.d.ts +34 -6
- package/lib/common/config/public/ClientConfig.js +239 -31
- package/lib/common/entities/AutoCompleteItem.d.ts +3 -3
- package/lib/common/entities/AutoCompleteItem.js +3 -3
- package/lib/common/entities/ContentWrapper.d.ts +38 -10
- package/lib/common/entities/ContentWrapper.js +171 -62
- package/lib/common/entities/Error.d.ts +2 -1
- package/lib/common/entities/Error.js +1 -0
- package/lib/common/entities/MediaDTO.d.ts +1 -0
- package/lib/common/entities/MediaDTO.js +6 -1
- package/lib/common/entities/SearchQueryDTO.d.ts +24 -41
- package/lib/common/entities/SearchQueryDTO.js +10 -19
- package/lib/common/entities/SortingMethods.d.ts +8 -0
- package/lib/common/entities/SortingMethods.js +10 -1
- package/lib/frontend/app/model/network/network.service.d.ts +4 -1
- package/lib/frontend/app/model/page.helper.d.ts +3 -2
- package/lib/frontend/app/model/query.service.d.ts +1 -1
- package/lib/frontend/app/model/version.service.d.ts +5 -1
- package/lib/frontend/app/ui/faces/faces.component.d.ts +1 -1
- package/lib/frontend/app/ui/faces/faces.service.d.ts +4 -0
- package/lib/frontend/app/ui/faces/navigator/navigator.faces.component.d.ts +15 -0
- package/lib/frontend/app/ui/frame/frame.component.d.ts +7 -2
- package/lib/frontend/app/ui/gallery/blog/blog.service.d.ts +1 -0
- package/lib/frontend/app/ui/gallery/cache.gallery.service.d.ts +5 -7
- package/lib/frontend/app/ui/gallery/contentLoader.service.d.ts +14 -11
- package/lib/frontend/app/ui/gallery/gallery.component.d.ts +12 -4
- package/lib/frontend/app/ui/gallery/gallery.service.d.ts +13 -0
- package/lib/frontend/app/ui/gallery/grid/grid.gallery.component.d.ts +4 -1
- package/lib/frontend/app/ui/gallery/lightbox/controls/controls.lightbox.gallery.component.d.ts +13 -20
- package/lib/frontend/app/ui/gallery/lightbox/lightbox.gallery.component.d.ts +1 -2
- package/lib/frontend/app/ui/gallery/lightbox/lightbox.service.d.ts +43 -4
- package/lib/frontend/app/ui/gallery/lightbox/media/media.lightbox.gallery.component.d.ts +5 -2
- package/lib/frontend/app/ui/gallery/map/lightbox/lightbox.map.gallery.component.d.ts +18 -12
- package/lib/frontend/app/ui/gallery/map/map.gallery.component.d.ts +5 -1
- package/lib/frontend/app/ui/gallery/navigator/navigator.service.d.ts +1 -0
- package/lib/frontend/app/ui/gallery/overlay.service.d.ts +2 -2
- package/lib/frontend/app/ui/gallery/photo-frame-builder/photo-frame-builder.gallery.component.d.ts +40 -0
- package/lib/frontend/app/ui/gallery/search/autocomplete.service.d.ts +1 -1
- package/lib/frontend/app/ui/gallery/search/query-enrty/query-entry.search.gallery.component.d.ts +2 -1
- package/lib/frontend/app/ui/gallery/search/search-query-parser.service.d.ts +0 -2
- package/lib/frontend/app/ui/gallery/thumbnailManager.service.d.ts +1 -1
- package/lib/frontend/app/ui/gallery/uploader/uploader.gallery.component.d.ts +15 -0
- package/lib/frontend/app/ui/gallery/uploader/uploader.service.d.ts +36 -0
- package/lib/frontend/app/ui/login/login.component.d.ts +3 -0
- package/lib/frontend/app/ui/settings/template/template.component.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,108 +1,5 @@
|
|
|
1
|
-
#
|
|
1
|
+
# PiGallery2 Extension
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This folder contains the core of the extension system.
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
25
|
-
Where `<path to the extension fodler>` is what you set in the config and `myextension` is the name of your extension.
|
|
26
|
-
Note: you do not need to add your `node_modules` folder. The app will call `npm install` when initializing your extension.
|
|
27
|
-
|
|
28
|
-
## Extension environment
|
|
29
|
-
|
|
30
|
-
The app runs the extension the following way:
|
|
31
|
-
|
|
32
|
-
- It reads all extensions in `<path to the extension fodler>/**` folder
|
|
33
|
-
- Checks if `package.js` is present. If yes installs the packages
|
|
34
|
-
- Checks if `server.js` is present. If yes, calls the `init` function.
|
|
35
|
-
|
|
36
|
-
### Init and cleanup lifecycle
|
|
37
|
-
|
|
38
|
-
There is also a `cleanUp` function that you can implement in your extension.
|
|
39
|
-
The app can call your `init` and `cleanUp` functions any time.
|
|
40
|
-
Always calls the `init` first then `cleanUp` later.
|
|
41
|
-
Main use-case: `init` is called on app startup. `cleanUp` and `init` called later when there is a new config change.
|
|
42
|
-
|
|
43
|
-
## Extension interface
|
|
44
|
-
|
|
45
|
-
The app calls the `init` and `cleanUp` function with a `IExtensionObject` object.
|
|
46
|
-
See https://github.com/bpatrik/pigallery2/blob/master/src/backend/model/extension/IExtension.ts for details.
|
|
47
|
-
|
|
48
|
-
`IExtensionObject` exposes lifecycle events, configs, RestAPis with some limitation.
|
|
49
|
-
Changes made during the these public apis you do not need to clean up in the `cleanUp` function.
|
|
50
|
-
App also exposes private `_app` object to provide access to low level API. Any changes made here needs clean up.
|
|
51
|
-
|
|
52
|
-
## server.js
|
|
53
|
-
|
|
54
|
-
See sample server.js at https://github.com/bpatrik/pigallery2-sample-extension.
|
|
55
|
-
|
|
56
|
-
It is recommended to do the development in `ts`, so creating a `server.ts`.
|
|
57
|
-
Note: You need to manually transpile your `server.ts` file to `server.js` as the app does not do that for you.
|
|
58
|
-
This doc assumes you do the development in `ts`.
|
|
59
|
-
|
|
60
|
-
### server.ts
|
|
61
|
-
|
|
62
|
-
You can import package from both the main app package.json and from your extension package.json.
|
|
63
|
-
To import packages from the main app, you import as usual.
|
|
64
|
-
For packages from the extension, you always need to write relative path. i.e.: prefix with `./node_modules`
|
|
65
|
-
|
|
66
|
-
```ts
|
|
67
|
-
// Including dev-kit interfaces. It is not necessary, only helps development with types.
|
|
68
|
-
// You need to prefix them with ./node_modules
|
|
69
|
-
import { IExtensionObject } from "./node_modules/pigallery2-extension-kit";
|
|
70
|
-
|
|
71
|
-
// Including prod extension packages. You need to prefix them with ./node_modules
|
|
72
|
-
// lodash does not have types
|
|
73
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
74
|
-
// @ts-ignore
|
|
75
|
-
import * as _ from "./node_modules/lodash";
|
|
76
|
-
|
|
77
|
-
// Importing packages that are available in the main app (listed in the packages.json in pigallery2)
|
|
78
|
-
import { Column, Entity, Index, PrimaryGeneratedColumn } from "typeorm";
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
#### pigallery2 extension dev-kit
|
|
82
|
-
|
|
83
|
-
It is recommended to use the `pigallery2-extension-kit` node package.
|
|
84
|
-
`npm install pigallery2-extension-kit --save` to your extension.
|
|
85
|
-
|
|
86
|
-
`pigallery2-extension-kit` contains the type definitions and enums for the app.
|
|
87
|
-
This node package is basically includes the all definitions of the app and exports the `IExtensionObject` that the `init` function receives.
|
|
88
|
-
|
|
89
|
-
You can then `import {IExtensionObject} from './node_modules/pigallery2-extension-kit';`
|
|
90
|
-
|
|
91
|
-
See https://github.com/bpatrik/pigallery2/blob/master/src/backend/model/extension/IExtension.ts to understand what contains `IExtensionObject`.
|
|
92
|
-
|
|
93
|
-
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`.
|
|
94
|
-
|
|
95
|
-
#### `init` function
|
|
96
|
-
|
|
97
|
-
You need to implement the `init` function for a working extension:
|
|
98
|
-
|
|
99
|
-
```ts
|
|
100
|
-
export const init = async (extension: IExtensionObject<void>): Promise<void> => {};
|
|
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
|
-

|
|
5
|
+
For extension development and usage, please see the [documentation](https://bpatrik.github.io/pigallery2/development/extensions/).
|
package/REPOSITORY.md
CHANGED
|
@@ -8,5 +8,6 @@ In case of any issue, contact the extension developer.
|
|
|
8
8
|
|:----------------:|:-------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------:|---|
|
|
9
9
|
| Sample extension | [pigallery2-sample-extension](https://github.com/bpatrik/pigallery2-sample-extension) | [REAMDE.md](https://raw.githubusercontent.com/bpatrik/pigallery2-sample-extension/main/README.md) | [main.zip](https://github.com/bpatrik/pigallery2-sample-extension/archive/refs/heads/main.zip) | |
|
|
10
10
|
| DigiKam Connector for Pigallery2 | [pigallery2-extension-digikam-connector](https://github.com/mblythe86/pigallery2-extension-digikam-connector) | [README.md](https://raw.githubusercontent.com/mblythe86/pigallery2-extension-digikam-connector/main/README.md) | [main.zip](https://github.com/mblythe86/pigallery2-extension-digikam-connector/archive/refs/heads/main.zip) | |
|
|
11
|
-
|
|
|
11
|
+
| Grid Rating Overlay | [pigallery2-grid-rating-extension](https://github.com/Berschi/pigallery2-grid-rating-extension) | [README.md](https://raw.githubusercontent.com/Berschi/pigallery2-grid-rating-extension/refs/heads/main/README.md) | [main.zip](https://github.com/Berschi/pigallery2-grid-rating-extension/archive/refs/heads/main.zip) | |
|
|
12
|
+
| Trash | [pigallery2-trash-extension](https://github.com/pepa65/pigallery2-trash-extension) | [README.md](https://raw.githubusercontent.com/pepa65/pigallery2-trash-extension/refs/heads/main/README.md) | [main.zip](https://github.com/pepa65/pigallery2-trash-extension/archive/refs/heads/main.zip) | |
|
|
12
13
|
| | | | | |
|
package/lib/backend/Logger.d.ts
CHANGED
|
@@ -17,6 +17,6 @@ export declare class Logger {
|
|
|
17
17
|
static info(...args: LoggerArgs[]): void;
|
|
18
18
|
static warn(...args: LoggerArgs[]): void;
|
|
19
19
|
static error(...args: LoggerArgs[]): void;
|
|
20
|
-
private static log;
|
|
21
20
|
static logLevelForError(e: ErrorCodes): LoggerFunction;
|
|
21
|
+
private static log;
|
|
22
22
|
}
|
|
@@ -26,7 +26,7 @@ class ProjectPathClass {
|
|
|
26
26
|
this.FacesFolder = path.join(this.TempFolder, 'f');
|
|
27
27
|
this.DBFolder = this.getAbsolutePath(this.cfg.Database.dbFolder);
|
|
28
28
|
this.ExtensionFolder = this.getAbsolutePath(this.cfg.Extensions.folder);
|
|
29
|
-
// create thumbnail folder if not exist
|
|
29
|
+
// create the thumbnail folder if it does not exist
|
|
30
30
|
if (!fs.existsSync(this.TempFolder)) {
|
|
31
31
|
fs.mkdirSync(this.TempFolder);
|
|
32
32
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { NextFunction, Request, Response } from 'express';
|
|
2
2
|
export declare class VersionMWs {
|
|
3
|
+
/**
|
|
4
|
+
* This version data is mainly used to trigger page reload on the client side
|
|
5
|
+
*/
|
|
6
|
+
static injectAppVersion(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
3
7
|
/**
|
|
4
8
|
* This version data is mainly used on the client side to invalidate the cache
|
|
5
9
|
*/
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Request, Response } from 'express';
|
|
2
|
+
export declare class OIDCAuthService {
|
|
3
|
+
private static clientPromise;
|
|
4
|
+
static login(req: Request, res: Response): Promise<void>;
|
|
5
|
+
static callback(req: Request, res: Response): Promise<void>;
|
|
6
|
+
private static getClient;
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LocationManager } from './database/LocationManager';
|
|
2
2
|
import { JobManager } from './jobs/JobManager';
|
|
3
|
-
import {
|
|
3
|
+
import { DirectoryPathDTO } from '../../common/entities/DirectoryDTO';
|
|
4
4
|
import { GalleryManager } from './database/GalleryManager';
|
|
5
5
|
import { UserManager } from './database/UserManager';
|
|
6
6
|
import { IndexingManager } from './database/IndexingManager';
|
|
@@ -13,6 +13,7 @@ import { SharingManager } from './database/SharingManager';
|
|
|
13
13
|
import { ExtensionManager } from './extension/ExtensionManager';
|
|
14
14
|
import { ProjectedCacheManager } from './database/ProjectedCacheManager';
|
|
15
15
|
import { SessionManager } from './database/SessionManager';
|
|
16
|
+
import { UploadManager } from './UploadManager';
|
|
16
17
|
export declare class ObjectManagers {
|
|
17
18
|
private static instance;
|
|
18
19
|
private readonly managers;
|
|
@@ -29,6 +30,7 @@ export declare class ObjectManagers {
|
|
|
29
30
|
private albumManager;
|
|
30
31
|
private extensionManager;
|
|
31
32
|
private projectedCacheManager;
|
|
33
|
+
private uploadManager;
|
|
32
34
|
private sessionManager;
|
|
33
35
|
private initDone;
|
|
34
36
|
constructor();
|
|
@@ -37,7 +39,7 @@ export declare class ObjectManagers {
|
|
|
37
39
|
static isReady(): boolean;
|
|
38
40
|
init(): Promise<void>;
|
|
39
41
|
private initManagers;
|
|
40
|
-
onDataChange(changedDir?:
|
|
42
|
+
onDataChange(changedDir?: DirectoryPathDTO): Promise<void>;
|
|
41
43
|
get VersionManager(): VersionManager;
|
|
42
44
|
set VersionManager(value: VersionManager);
|
|
43
45
|
get LocationManager(): LocationManager;
|
|
@@ -58,6 +60,8 @@ export declare class ObjectManagers {
|
|
|
58
60
|
set SearchManager(value: SearchManager);
|
|
59
61
|
get SharingManager(): SharingManager;
|
|
60
62
|
set SharingManager(value: SharingManager);
|
|
63
|
+
get UploadManager(): UploadManager;
|
|
64
|
+
set UploadManager(value: UploadManager);
|
|
61
65
|
get JobManager(): JobManager;
|
|
62
66
|
set JobManager(value: JobManager);
|
|
63
67
|
get ExtensionManager(): ExtensionManager;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface UploadError {
|
|
2
|
+
filename: string;
|
|
3
|
+
error: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class UploadManager {
|
|
6
|
+
saveFiles(directory: string, files: Express.Multer.File[]): Promise<UploadError[]>;
|
|
7
|
+
saveFile(directory: string, file: Express.Multer.File): Promise<void>;
|
|
8
|
+
private isSupportedExtension;
|
|
9
|
+
}
|
|
@@ -6,8 +6,8 @@ export declare class AlbumManager extends ProjectionAwareManager<AlbumBaseEntity
|
|
|
6
6
|
addIfNotExistSavedSearch(name: string, searchQuery: SearchQueryDTO, lockedAlbum: boolean): Promise<void>;
|
|
7
7
|
addSavedSearch(name: string, searchQuery: SearchQueryDTO, lockedAlbum?: boolean): Promise<void>;
|
|
8
8
|
deleteAlbum(id: number): Promise<void>;
|
|
9
|
+
deleteAll(): Promise<void>;
|
|
9
10
|
protected loadEntities(session: SessionContext): Promise<AlbumBaseEntity[]>;
|
|
10
11
|
protected invalidateDBCache(): Promise<void>;
|
|
11
|
-
deleteAll(): Promise<void>;
|
|
12
12
|
private updateAlbums;
|
|
13
13
|
}
|
|
@@ -10,7 +10,7 @@ export declare class CoverManager {
|
|
|
10
10
|
getCoverForAlbum(session: SessionContext, album: {
|
|
11
11
|
searchQuery: SearchQueryDTO;
|
|
12
12
|
}): Promise<CoverPhotoDTOWithID>;
|
|
13
|
-
getPartialDirsWithoutCovers(): Promise<{
|
|
13
|
+
getPartialDirsWithoutCovers(projectionKeys?: string[]): Promise<{
|
|
14
14
|
id: number;
|
|
15
15
|
name: string;
|
|
16
16
|
path: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DirectoryPathDTO } from '../../../common/entities/DirectoryDTO';
|
|
2
2
|
export interface IObjectManager {
|
|
3
|
-
onNewDataVersion?: (changedDir?:
|
|
3
|
+
onNewDataVersion?: (changedDir?: DirectoryPathDTO) => Promise<void>;
|
|
4
4
|
cleanUp?: () => Promise<void>;
|
|
5
5
|
init?: () => Promise<void>;
|
|
6
6
|
}
|
|
@@ -4,7 +4,7 @@ import { ParentDirectoryDTO } from '../../../common/entities/DirectoryDTO';
|
|
|
4
4
|
import { SessionContext } from '../SessionContext';
|
|
5
5
|
import { ProjectionAwareManager } from './ProjectionAwareManager';
|
|
6
6
|
export declare class PersonManager extends ProjectionAwareManager<PersonEntry> {
|
|
7
|
-
updatePerson(name: string, partialPerson: PersonDTO): Promise<
|
|
7
|
+
updatePerson(name: string, partialPerson: PersonDTO): Promise<void>;
|
|
8
8
|
/**
|
|
9
9
|
* Used for statistic
|
|
10
10
|
*/
|
|
@@ -7,6 +7,9 @@ import { SessionContext } from '../SessionContext';
|
|
|
7
7
|
export declare class ProjectedCacheManager implements IObjectManager {
|
|
8
8
|
init(): Promise<void>;
|
|
9
9
|
onNewDataVersion(changedDir?: ParentDirectoryDTO): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Includes all possible projection keys, including the default one and sharing keys too.
|
|
12
|
+
*/
|
|
10
13
|
getAllProjections(): Promise<string[]>;
|
|
11
14
|
cleanupNonExistingProjections(): Promise<void>;
|
|
12
15
|
getCacheForDirectory(connection: Connection, session: SessionContext, dir: {
|
|
@@ -20,6 +23,7 @@ export declare class ProjectedCacheManager implements IObjectManager {
|
|
|
20
23
|
path: string;
|
|
21
24
|
}): Promise<ProjectedDirectoryCacheEntity>;
|
|
22
25
|
setAndGetCacheForAlbum(connection: Connection, session: SessionContext, album: {
|
|
26
|
+
name: string;
|
|
23
27
|
id: number;
|
|
24
28
|
searchQuery: any;
|
|
25
29
|
}): Promise<ProjectedAlbumCacheEntity>;
|
|
@@ -10,7 +10,7 @@ export declare class SearchManager {
|
|
|
10
10
|
private queryIdBase;
|
|
11
11
|
static setSorting<T>(query: SelectQueryBuilder<T>, sortings: SortingMethod[]): SelectQueryBuilder<T>;
|
|
12
12
|
private static autoCompleteItemsUnique;
|
|
13
|
-
autocomplete(session: SessionContext,
|
|
13
|
+
autocomplete(session: SessionContext, value: string, type: SearchQueryTypes): Promise<AutoCompleteItem[]>;
|
|
14
14
|
search(session: SessionContext, queryIN: SearchQueryDTO): Promise<SearchResultDTO>;
|
|
15
15
|
getNMedia(session: SessionContext, query: SearchQueryDTO, sortings: SortingMethod[], take: number, photoOnly?: boolean): Promise<PhotoEntity[]>;
|
|
16
16
|
getCount(session: SessionContext, query: SearchQueryDTO): Promise<number>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Stats } from 'fs';
|
|
2
|
-
import { ParentDirectoryDTO } from '../../../common/entities/DirectoryDTO';
|
|
2
|
+
import { DirectoryPathDTO, ParentDirectoryDTO } from '../../../common/entities/DirectoryDTO';
|
|
3
3
|
import { FileDTO } from '../../../common/entities/FileDTO';
|
|
4
4
|
export declare class DiskManager {
|
|
5
5
|
static calcLastModified(stat: Stats): number;
|
|
6
|
+
static getDTOFromPath(relativeDirectoryName: string): DirectoryPathDTO;
|
|
6
7
|
static normalizeDirPath(dirPath: string): string;
|
|
7
8
|
static pathFromRelativeDirName(relativeDirectoryName: string): string;
|
|
8
9
|
static pathFromParent(parent: {
|
|
@@ -11,9 +11,9 @@ export declare class JobManager implements IJobListener, IObjectManager {
|
|
|
11
11
|
timer: NodeJS.Timeout;
|
|
12
12
|
}[];
|
|
13
13
|
protected progressManager: JobProgressManager;
|
|
14
|
-
init(): Promise<void>;
|
|
15
14
|
protected get JobRunning(): boolean;
|
|
16
15
|
protected get JobNoParallelRunning(): boolean;
|
|
16
|
+
init(): Promise<void>;
|
|
17
17
|
getProgresses(): {
|
|
18
18
|
[id: string]: OnTimerJobProgressDTO;
|
|
19
19
|
};
|
|
@@ -10,6 +10,7 @@ export declare class AlbumCoverFillingJob extends Job {
|
|
|
10
10
|
}[];
|
|
11
11
|
status: 'Persons' | 'Albums' | 'Directory';
|
|
12
12
|
private availableSessions;
|
|
13
|
+
get LOG_TAG(): string;
|
|
13
14
|
get Supported(): boolean;
|
|
14
15
|
protected init(): Promise<void>;
|
|
15
16
|
protected step(): Promise<boolean>;
|
|
@@ -4,6 +4,7 @@ export declare class AlbumCoverRestJob extends Job {
|
|
|
4
4
|
readonly Name: string;
|
|
5
5
|
readonly ConfigTemplate: DynamicConfig[];
|
|
6
6
|
protected readonly IsInstant = true;
|
|
7
|
+
get LOG_TAG(): string;
|
|
7
8
|
get Supported(): boolean;
|
|
8
9
|
protected init(): Promise<void>;
|
|
9
10
|
protected step(): Promise<boolean>;
|
|
@@ -4,6 +4,7 @@ export declare class AlbumRestJob extends Job {
|
|
|
4
4
|
readonly Name: string;
|
|
5
5
|
readonly ConfigTemplate: DynamicConfig[];
|
|
6
6
|
protected readonly IsInstant = true;
|
|
7
|
+
get LOG_TAG(): string;
|
|
7
8
|
get Supported(): boolean;
|
|
8
9
|
protected init(): Promise<void>;
|
|
9
10
|
protected step(): Promise<boolean>;
|
|
@@ -20,6 +20,7 @@ export declare abstract class FileJob<S extends {
|
|
|
20
20
|
initiated: boolean;
|
|
21
21
|
};
|
|
22
22
|
protected constructor(scanFilter: DirectoryScanSettings);
|
|
23
|
+
get LOG_TAG(): string;
|
|
23
24
|
protected init(): Promise<void>;
|
|
24
25
|
protected filterMediaFiles(files: FileDTO[]): Promise<FileDTO[]>;
|
|
25
26
|
protected filterMetaFiles(files: FileDTO[]): Promise<FileDTO[]>;
|
|
@@ -3,6 +3,7 @@ import { FileDTO } from '../../../../common/entities/FileDTO';
|
|
|
3
3
|
export declare class GPXCompressionJob extends FileJob {
|
|
4
4
|
readonly Name: string;
|
|
5
5
|
constructor();
|
|
6
|
+
get LOG_TAG(): string;
|
|
6
7
|
protected filterMetaFiles(files: FileDTO[]): Promise<FileDTO[]>;
|
|
7
8
|
get Supported(): boolean;
|
|
8
9
|
protected shouldProcess(fPath: string): Promise<boolean>;
|
|
@@ -4,6 +4,7 @@ export declare class GalleryRestJob extends Job {
|
|
|
4
4
|
readonly Name: string;
|
|
5
5
|
readonly ConfigTemplate: DynamicConfig[];
|
|
6
6
|
protected readonly IsInstant = true;
|
|
7
|
+
get LOG_TAG(): string;
|
|
7
8
|
get Supported(): boolean;
|
|
8
9
|
protected init(): Promise<void>;
|
|
9
10
|
protected step(): Promise<boolean>;
|
|
@@ -8,6 +8,7 @@ export declare class IndexingJob<S extends {
|
|
|
8
8
|
readonly Name: string;
|
|
9
9
|
directoriesToIndex: string[];
|
|
10
10
|
readonly ConfigTemplate: DynamicConfig[];
|
|
11
|
+
get LOG_TAG(): string;
|
|
11
12
|
get Supported(): boolean;
|
|
12
13
|
protected init(): Promise<void>;
|
|
13
14
|
protected step(): Promise<boolean>;
|
|
@@ -12,6 +12,7 @@ export declare abstract class Job<T extends Record<string, unknown> = Record<str
|
|
|
12
12
|
private jobListener;
|
|
13
13
|
private soloRun;
|
|
14
14
|
set JobListener(value: IJobListener);
|
|
15
|
+
get LOG_TAG(): string;
|
|
15
16
|
abstract get Supported(): boolean;
|
|
16
17
|
abstract get Name(): string;
|
|
17
18
|
abstract get ConfigTemplate(): DynamicConfig[];
|
|
@@ -2,12 +2,13 @@ import { JobProgressDTO, JobProgressLogDTO, JobProgressStates } from '../../../.
|
|
|
2
2
|
export declare class JobProgress {
|
|
3
3
|
readonly jobName: string;
|
|
4
4
|
readonly HashName: string;
|
|
5
|
+
readonly LOG_TAG: string;
|
|
5
6
|
private steps;
|
|
6
7
|
private state;
|
|
7
8
|
private time;
|
|
8
9
|
private logCounter;
|
|
9
10
|
private logs;
|
|
10
|
-
constructor(jobName: string, HashName: string);
|
|
11
|
+
constructor(jobName: string, HashName: string, LOG_TAG: string);
|
|
11
12
|
set OnChange(val: (progress: JobProgress) => void);
|
|
12
13
|
get Skipped(): number;
|
|
13
14
|
set Skipped(value: number);
|
|
@@ -7,6 +7,7 @@ export declare class TempFolderCleaningJob extends Job {
|
|
|
7
7
|
directoryQueue: string[];
|
|
8
8
|
private tempRootCleaned;
|
|
9
9
|
protected init(): Promise<void>;
|
|
10
|
+
get LOG_TAG(): string;
|
|
10
11
|
protected isValidFile(filePath: string): Promise<boolean>;
|
|
11
12
|
protected isValidDirectory(filePath: string): Promise<boolean>;
|
|
12
13
|
protected readDir(dirPath: string): Promise<string[]>;
|
|
@@ -2,6 +2,7 @@ import { FileJob } from './FileJob';
|
|
|
2
2
|
export declare class VideoConvertingJob extends FileJob {
|
|
3
3
|
readonly Name: string;
|
|
4
4
|
constructor();
|
|
5
|
+
get LOG_TAG(): string;
|
|
5
6
|
get Supported(): boolean;
|
|
6
7
|
protected shouldProcess(mPath: string): Promise<boolean>;
|
|
7
8
|
protected processFile(mPath: string): Promise<void>;
|
|
@@ -13,12 +13,30 @@ export declare const QueryParams: {
|
|
|
13
13
|
type: string;
|
|
14
14
|
query: string;
|
|
15
15
|
};
|
|
16
|
+
map: {
|
|
17
|
+
show: string;
|
|
18
|
+
};
|
|
16
19
|
photo: string;
|
|
17
|
-
playback: string;
|
|
18
20
|
sharingKey_query: string;
|
|
19
21
|
sharingKey_params: string;
|
|
20
22
|
directory: string;
|
|
21
23
|
knownLastModified: string;
|
|
22
24
|
knownLastScanned: string;
|
|
25
|
+
lightbox: {
|
|
26
|
+
playback: string;
|
|
27
|
+
captionAlwaysOn: string;
|
|
28
|
+
controllersDimmed: string;
|
|
29
|
+
facesAlwaysOn: string;
|
|
30
|
+
loopVideos: string;
|
|
31
|
+
loopSlideshow: string;
|
|
32
|
+
slideshowSpeed: string;
|
|
33
|
+
titles: {
|
|
34
|
+
topLeftTitle: string;
|
|
35
|
+
topLeftSubTitle: string;
|
|
36
|
+
bottomLeftTitle: string;
|
|
37
|
+
bottomLeftSubTitle: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
autoPollInterval: string;
|
|
23
41
|
};
|
|
24
42
|
};
|
|
@@ -13,18 +13,14 @@ export interface QueryKeywords {
|
|
|
13
13
|
landscape: string;
|
|
14
14
|
orientation: string;
|
|
15
15
|
kmFrom: string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
minRating: string;
|
|
20
|
-
maxPersonCount: string;
|
|
21
|
-
minPersonCount: string;
|
|
16
|
+
resolution: string;
|
|
17
|
+
rating: string;
|
|
18
|
+
personCount: string;
|
|
22
19
|
NSomeOf: string;
|
|
23
20
|
someOf: string;
|
|
24
21
|
or: string;
|
|
25
22
|
and: string;
|
|
26
|
-
|
|
27
|
-
to: string;
|
|
23
|
+
date: string;
|
|
28
24
|
any_text: string;
|
|
29
25
|
caption: string;
|
|
30
26
|
directory: string;
|
|
@@ -39,9 +35,14 @@ export declare class SearchQueryParser {
|
|
|
39
35
|
constructor(keywords?: QueryKeywords);
|
|
40
36
|
static stringifyText(text: string, matchType?: TextSearchQueryMatchTypes): string;
|
|
41
37
|
static stringifyDate(time: number): string;
|
|
42
|
-
private static parseDate;
|
|
43
38
|
static humanToRegexpStr(str: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
|
|
41
|
+
* @param text
|
|
42
|
+
* @private
|
|
43
|
+
*/
|
|
44
|
+
private static parseDate;
|
|
44
45
|
parse(str: string, implicitAND?: boolean): SearchQueryDTO;
|
|
45
46
|
stringify(query: SearchQueryDTO): string;
|
|
46
|
-
private
|
|
47
|
+
private stringifyOneEntry;
|
|
47
48
|
}
|
|
@@ -4,6 +4,17 @@ export declare const SearchQueryUtils: {
|
|
|
4
4
|
sortQuery(queryIN: SearchQueryDTO): SearchQueryDTO;
|
|
5
5
|
stringifyForComparison(queryIN: SearchQueryDTO): string;
|
|
6
6
|
isQueryEmpty(query: SearchQueryDTO): boolean;
|
|
7
|
-
|
|
8
|
-
validateSearchQuery(query: SearchQueryDTO, what?: string)
|
|
7
|
+
stripDefault: (val: any) => any;
|
|
8
|
+
validateSearchQuery: (query: SearchQueryDTO, what?: string) => void;
|
|
9
|
+
URLMap: Record<string, string>;
|
|
10
|
+
/**
|
|
11
|
+
* Make the SearchQuery URL friendly and shorter
|
|
12
|
+
* @param query
|
|
13
|
+
*/
|
|
14
|
+
urlify: (query: SearchQueryDTO) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Pareses the shortened urls and returns with the original SearchQueryDTO
|
|
17
|
+
* @param urlQuery
|
|
18
|
+
*/
|
|
19
|
+
parseURLifiedQuery: (urlQuery: string) => SearchQueryDTO;
|
|
9
20
|
};
|
package/lib/common/Utils.d.ts
CHANGED
|
@@ -34,11 +34,6 @@ export declare class Utils {
|
|
|
34
34
|
static updateKeys(targetObject: any, sourceObject: any): void;
|
|
35
35
|
static setKeys(targetObject: any, sourceObject: any): void;
|
|
36
36
|
static setKeysForced(targetObject: any, sourceObject: any): void;
|
|
37
|
-
static isValidEnumInt(EnumType: any, value: number): boolean;
|
|
38
|
-
static enumToArray(EnumType: any): {
|
|
39
|
-
key: number;
|
|
40
|
-
value: string;
|
|
41
|
-
}[];
|
|
42
37
|
static findClosest(num: number, arr: number[]): number;
|
|
43
38
|
static findClosestinSorted(num: number, arr: number[]): number;
|
|
44
39
|
static asciiToUTF8(text: string): string;
|
|
@@ -49,6 +44,13 @@ export declare class Utils {
|
|
|
49
44
|
static getAnyX(num: number, arr: any[], start?: number): any[][];
|
|
50
45
|
static xmpExifGpsCoordinateToDecimalDegrees(text: string): number;
|
|
51
46
|
static sortableFilename(filename: string): string;
|
|
47
|
+
static enumToArray(EnumType: any): {
|
|
48
|
+
key: number;
|
|
49
|
+
value: string;
|
|
50
|
+
}[];
|
|
51
|
+
static isValidEnumInt(EnumType: any, value: number): boolean;
|
|
52
|
+
static parseEnumArray<T extends Record<string, number>>(param: string | string[], enumType: T): number[];
|
|
53
|
+
static serializeEnumNames(values: number[], enumType: Record<number, string>): string;
|
|
52
54
|
}
|
|
53
55
|
export declare class LRU<V> {
|
|
54
56
|
readonly size: number;
|