pigallery2-extension-kit 2.0.3-edge3 → 2.0.3-edge4

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/REPOSITORY.md ADDED
@@ -0,0 +1,12 @@
1
+ # Pigallery2 extension repository
2
+
3
+ The app loads this file to discover available extensions for download.
4
+ Note: pigallery2 is not responsible for the extensions that are available here.
5
+ In case of any issue, contact the extension developer.
6
+
7
+ | **Name** | **Url** | **Readme** | **Download** | |
8
+ |:----------------:|:-------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------:|---|
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
+ | 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
+ | | | | | |
12
+ | | | | | |
@@ -1,6 +1,7 @@
1
1
  import { NextFunction, Request, Response } from 'express';
2
2
  export declare class SharingMWs {
3
3
  static getSharing(req: Request, res: Response, next: NextFunction): Promise<void>;
4
+ static getSharingKey(req: Request, res: Response, next: NextFunction): Promise<void>;
4
5
  static createSharing(req: Request, res: Response, next: NextFunction): Promise<void>;
5
6
  static updateSharing(req: Request, res: Response, next: NextFunction): Promise<void>;
6
7
  static deleteSharing(req: Request, res: Response, next: NextFunction): Promise<void>;
@@ -1,13 +1,13 @@
1
1
  import { IExtensionAfterEventHandler, IExtensionBeforeEventHandler, IExtensionEvent } from './IExtension';
2
2
  export declare class ExtensionEvent<I extends unknown[], O> implements IExtensionEvent<I, O> {
3
3
  protected beforeHandlers: IExtensionBeforeEventHandler<I, O>[];
4
- protected afterHandlers: IExtensionAfterEventHandler<O>[];
4
+ protected afterHandlers: IExtensionAfterEventHandler<I, O>[];
5
5
  before(handler: IExtensionBeforeEventHandler<I, O>): void;
6
- after(handler: IExtensionAfterEventHandler<O>): void;
7
- offAfter(handler: IExtensionAfterEventHandler<O>): void;
6
+ after(handler: IExtensionAfterEventHandler<I, O>): void;
7
+ offAfter(handler: IExtensionAfterEventHandler<I, O>): void;
8
8
  offBefore(handler: IExtensionBeforeEventHandler<I, O>): void;
9
9
  triggerBefore(input: I, event: {
10
10
  stopPropagation: boolean;
11
11
  }): Promise<I | O>;
12
- triggerAfter(output: O): Promise<O>;
12
+ triggerAfter(input: I, output: O): Promise<O>;
13
13
  }
@@ -19,10 +19,17 @@ import { DirectoryScanSettings } from '../fileaccess/DiskManager';
19
19
  export declare type IExtensionBeforeEventHandler<I extends unknown[], O> = (input: I, event: {
20
20
  stopPropagation: boolean;
21
21
  }) => Promise<I | O>;
22
- export declare type IExtensionAfterEventHandler<O> = (output: O) => Promise<O>;
22
+ /**
23
+ * input: is the input the output of all before handler that was also piped to app's function
24
+ * output: is the output of the app's function or the previous after handler
25
+ */
26
+ export declare type IExtensionAfterEventHandler<I extends unknown[], O> = (data: {
27
+ input: I;
28
+ output: O;
29
+ }) => Promise<O>;
23
30
  export interface IExtensionEvent<I extends unknown[], O> {
24
31
  before: (handler: IExtensionBeforeEventHandler<I, O>) => void;
25
- after: (handler: IExtensionAfterEventHandler<O>) => void;
32
+ after: (handler: IExtensionAfterEventHandler<I, O>) => void;
26
33
  }
27
34
  /**
28
35
  * All main event callbacks in the app
@@ -116,7 +123,7 @@ export interface IExtensionDB {
116
123
  */
117
124
  setExtensionTables(tables: Function[]): Promise<void>;
118
125
  /**
119
- * Exposes all tables. You can use this if you van to have a foreign key to a built in table.
126
+ * Exposes all tables. You can use this if you van to have a foreign key to a built-in table.
120
127
  * Use with caution. This exposes the app's internal working.
121
128
  */
122
129
  _getAllTables(): Function[];
@@ -15,6 +15,7 @@ interface RendererInput {
15
15
  outPath: string;
16
16
  quality: number;
17
17
  useLanczos3: boolean;
18
+ animate: boolean;
18
19
  cut?: {
19
20
  left: number;
20
21
  top: number;
@@ -2,6 +2,12 @@ import * as express from 'express';
2
2
  export declare class SharingRouter {
3
3
  static route(app: express.Express): void;
4
4
  private static addShareLogin;
5
+ /**
6
+ * Used to check the key validity
7
+ * @param app
8
+ * @private
9
+ */
10
+ private static addGetSharingKey;
5
11
  private static addGetSharing;
6
12
  private static addCreateSharing;
7
13
  private static addUpdateSharing;
@@ -75,6 +75,7 @@ export declare class ServerThumbnailConfig extends ClientThumbnailConfig {
75
75
  quality: number;
76
76
  smartSubsample: boolean;
77
77
  personFaceMargin: number;
78
+ animateGif: boolean;
78
79
  }
79
80
  export declare class ServerGPXCompressingConfig extends ClientGPXCompressingConfig {
80
81
  onTheFly: boolean;
@@ -303,6 +303,7 @@ let ServerThumbnailConfig = class ServerThumbnailConfig extends ClientConfig_1.C
303
303
  this.quality = 80;
304
304
  this.smartSubsample = true;
305
305
  this.personFaceMargin = 0.7; // in ratio [0-1]
306
+ this.animateGif = true;
306
307
  }
307
308
  };
308
309
  tslib_1.__decorate([
@@ -348,6 +349,17 @@ tslib_1.__decorate([
348
349
  }),
349
350
  tslib_1.__metadata("design:type", Number)
350
351
  ], ServerThumbnailConfig.prototype, "personFaceMargin", void 0);
352
+ tslib_1.__decorate([
353
+ (0, common_1.ConfigProperty)({
354
+ type: 'boolean',
355
+ tags: {
356
+ name: $localize `Keep Gif animation`,
357
+ priority: ClientConfig_1.ConfigPriority.underTheHood
358
+ },
359
+ description: $localize `Converts Gif to animated webp.`
360
+ }),
361
+ tslib_1.__metadata("design:type", Object)
362
+ ], ServerThumbnailConfig.prototype, "animateGif", void 0);
351
363
  ServerThumbnailConfig = tslib_1.__decorate([
352
364
  (0, common_1.SubConfigClass)({ softReadonly: true })
353
365
  ], ServerThumbnailConfig);
@@ -79,7 +79,7 @@ export declare class ClientAlbumConfig {
79
79
  }
80
80
  export declare class ClientSharingConfig {
81
81
  enabled: boolean;
82
- passwordProtected: boolean;
82
+ passwordRequired: boolean;
83
83
  }
84
84
  export declare class ClientRandomPhotoConfig {
85
85
  enabled: boolean;
@@ -281,7 +281,7 @@ exports.ClientAlbumConfig = ClientAlbumConfig;
281
281
  let ClientSharingConfig = class ClientSharingConfig {
282
282
  constructor() {
283
283
  this.enabled = true;
284
- this.passwordProtected = true;
284
+ this.passwordRequired = false;
285
285
  }
286
286
  };
287
287
  tslib_1.__decorate([
@@ -297,13 +297,13 @@ tslib_1.__decorate([
297
297
  tslib_1.__decorate([
298
298
  (0, common_1.ConfigProperty)({
299
299
  tags: {
300
- name: $localize `Password protected`,
300
+ name: $localize `Require password`,
301
301
  priority: ConfigPriority.advanced
302
302
  },
303
- description: $localize `Enables password protected sharing links.`,
303
+ description: $localize `Requires password protected sharing links.`,
304
304
  }),
305
305
  tslib_1.__metadata("design:type", Boolean)
306
- ], ClientSharingConfig.prototype, "passwordProtected", void 0);
306
+ ], ClientSharingConfig.prototype, "passwordRequired", void 0);
307
307
  ClientSharingConfig = tslib_1.__decorate([
308
308
  (0, common_1.SubConfigClass)({ tags: { client: true }, softReadonly: true })
309
309
  ], ClientSharingConfig);
@@ -1585,7 +1585,7 @@ tslib_1.__decorate([
1585
1585
  ], ClientServiceConfig.prototype, "applicationTitle", void 0);
1586
1586
  tslib_1.__decorate([
1587
1587
  (0, common_1.ConfigProperty)({
1588
- description: $localize `If you access the page form local network its good to know the public url for creating sharing link.`,
1588
+ description: $localize `If you access the page from local network its good to know the public url for creating sharing link.`,
1589
1589
  tags: {
1590
1590
  name: $localize `Page public url`,
1591
1591
  hint: typeof window !== 'undefined' ? window?.origin : '',
@@ -182,7 +182,6 @@ class ContentWrapper {
182
182
  ContentWrapper.mapify(cw, m, isSearchResult);
183
183
  }
184
184
  else if (MediaDTO_1.MediaDTOUtils.isVideo(m)) {
185
- delete m.metadata.rating;
186
185
  delete m.metadata.caption;
187
186
  delete m.metadata.cameraData;
188
187
  delete m.metadata.faces;
@@ -7,10 +7,13 @@ export interface MediaDTO extends FileDTO {
7
7
  metadata: MediaMetadata;
8
8
  missingThumbnails?: number;
9
9
  }
10
+ export declare type RatingTypes = 0 | 1 | 2 | 3 | 4 | 5;
10
11
  export interface MediaMetadata {
11
12
  size: MediaDimension;
12
13
  creationDate: number;
13
14
  fileSize: number;
15
+ keywords?: string[];
16
+ rating?: RatingTypes;
14
17
  }
15
18
  export interface MediaDimension {
16
19
  width: number;
@@ -22,9 +22,7 @@ export interface FaceRegion {
22
22
  box?: FaceRegionBox;
23
23
  }
24
24
  export interface PhotoMetadata extends MediaMetadata {
25
- rating?: 0 | 1 | 2 | 3 | 4 | 5;
26
25
  caption?: string;
27
- keywords?: string[];
28
26
  cameraData?: CameraMetadata;
29
27
  positionData?: PositionMetaData;
30
28
  size: MediaDimension;
@@ -1,5 +1,8 @@
1
1
  import { UserDTO } from './UserDTO';
2
- export interface SharingDTO {
2
+ export interface SharingDTOKey {
3
+ sharingKey: string;
4
+ }
5
+ export interface SharingDTO extends SharingDTOKey {
3
6
  id: number;
4
7
  path: string;
5
8
  sharingKey: string;
@@ -13,5 +13,4 @@ export interface VideoMetadata extends MediaMetadata {
13
13
  duration: number;
14
14
  fileSize: number;
15
15
  fps: number;
16
- keywords?: string[];
17
16
  }
@@ -31,7 +31,7 @@ export declare class GalleryShareComponent implements OnInit, OnDestroy {
31
31
  currentDir: string;
32
32
  sharing: SharingDTO;
33
33
  contentSubscription: Subscription;
34
- readonly passwordProtection: boolean;
34
+ readonly passwordRequired: boolean;
35
35
  readonly ValidityTypes: typeof ValidityTypes;
36
36
  modalRef: BsModalRef;
37
37
  invalidSettings: string;
@@ -13,17 +13,19 @@ export declare class ShareService {
13
13
  inited: boolean;
14
14
  ReadyPR: Promise<void>;
15
15
  sharingSubject: BehaviorSubject<SharingDTO>;
16
+ sharingIsValid: BehaviorSubject<boolean>;
16
17
  currentSharing: import("rxjs").Observable<SharingDTO>;
17
18
  private resolve;
18
19
  constructor(networkService: NetworkService, router: Router);
19
20
  getUrl(share: SharingDTO): string;
20
21
  onNewUser: (user: UserDTO) => Promise<void>;
21
22
  wait(): Promise<void>;
22
- createSharing(dir: string, includeSubFolders: boolean, valid: number): Promise<SharingDTO>;
23
+ createSharing(dir: string, includeSubFolders: boolean, password: string, valid: number): Promise<SharingDTO>;
23
24
  updateSharing(dir: string, sharingId: number, includeSubFolders: boolean, password: string, valid: number): Promise<SharingDTO>;
24
25
  getSharingKey(): string;
25
26
  isSharing(): boolean;
26
27
  private getSharing;
28
+ private checkSharing;
27
29
  getSharingListForDir(dir: string): Promise<SharingDTO[]>;
28
30
  getSharingList(): Promise<SharingDTO[]>;
29
31
  deleteSharing(sharing: SharingDTO): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pigallery2-extension-kit",
3
- "version": "2.0.3-edge3",
3
+ "version": "2.0.3-edge4",
4
4
  "description": "Interfaces for developing extensions for pigallery2",
5
5
  "author": "Patrik J. Braun",
6
6
  "homepage": "https://github.com/bpatrik/pigallery2",