pigallery2-extension-kit 2.6.0-edge → 3.0.1

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.
@@ -2,4 +2,6 @@ import { NextFunction, Request, Response } from 'express';
2
2
  export declare class ExtensionMWs {
3
3
  static getExtensionList(req: Request, res: Response, next: NextFunction): Promise<void>;
4
4
  static installExtension(req: Request, res: Response, next: NextFunction): Promise<void>;
5
+ static reloadExtension(req: Request, res: Response, next: NextFunction): Promise<void>;
6
+ static deleteExtension(req: Request, res: Response, next: NextFunction): Promise<void>;
5
7
  }
@@ -9,6 +9,11 @@ export declare class ProjectedCacheManager implements IObjectManager {
9
9
  onNewDataVersion(changedDir?: ParentDirectoryDTO): Promise<void>;
10
10
  getAllProjections(): Promise<string[]>;
11
11
  cleanupNonExistingProjections(): Promise<void>;
12
+ getCacheForDirectory(connection: Connection, session: SessionContext, dir: {
13
+ id: number;
14
+ name: string;
15
+ path: string;
16
+ }): Promise<ProjectedDirectoryCacheEntity>;
12
17
  setAndGetCacheForDirectory(connection: Connection, session: SessionContext, dir: {
13
18
  id: number;
14
19
  name: string;
@@ -9,4 +9,5 @@ export declare class UserManager {
9
9
  deleteUser(id: number): Promise<UserEntity>;
10
10
  changeRole(id: number, newRole: UserRoles): Promise<UserEntity>;
11
11
  updateSettings(id: number, settings: UserSettingsDTO): Promise<UserEntity>;
12
+ getUnAuthenticatedUser(): UserDTO;
12
13
  }
@@ -2,6 +2,7 @@ import { PrivateConfigClass } from '../../../common/config/private/PrivateConfig
2
2
  import { ClientAlbumConfig, ClientFacesConfig, ClientMapConfig, ClientMetaFileConfig, ClientPhotoConfig, ClientRandomPhotoConfig, ClientSearchConfig, ClientSharingConfig } from '../../../common/config/public/ClientConfig';
3
3
  import { ServerAlbumCoverConfig, ServerDataBaseConfig, ServerJobConfig, ServerPhotoConfig, ServerVideoConfig } from '../../../common/config/private/PrivateConfig';
4
4
  export declare class ConfigDiagnostics {
5
+ private static adjustConfigWarn;
5
6
  static testAlbumsConfig(albumConfig: ClientAlbumConfig, original: PrivateConfigClass): void;
6
7
  static checkReadWritePermission(path: string): Promise<void>;
7
8
  static testDatabase(databaseConfig: ServerDataBaseConfig): Promise<void>;
@@ -1,6 +1,9 @@
1
1
  import { IExtensionConfig } from './IExtension';
2
2
  export declare class ExtensionConfig<C> implements IExtensionConfig<C> {
3
- private readonly extensionFolder;
4
- constructor(extensionFolder: string);
3
+ private readonly configKey;
4
+ /**
5
+ * @param configKey - The key used in Config.Extensions.extensions map (matches the extension's folder name)
6
+ */
7
+ constructor(configKey: string);
5
8
  getConfig(): C;
6
9
  }
@@ -6,16 +6,9 @@ import { PrivateConfigClass } from '../../../common/config/private/PrivateConfig
6
6
  */
7
7
  export declare class ExtensionConfigTemplateLoader {
8
8
  private static instance;
9
- private loaded;
10
9
  private extensionList;
11
10
  private extensionTemplates;
12
11
  static get Instance(): ExtensionConfigTemplateLoader;
13
- /**
14
- * Loads a single extension template
15
- * @param extFolder The folder name of the extension
16
- * @returns The extension template object if the extension is valid, null otherwise
17
- */
18
- private loadSingleExtensionTemplate;
19
12
  /**
20
13
  * Loads a single extension template and adds it to the config
21
14
  * @param extFolder The folder name of the extension
@@ -23,5 +16,12 @@ export declare class ExtensionConfigTemplateLoader {
23
16
  */
24
17
  loadSingleExtension(extFolder: string, config: PrivateConfigClass): void;
25
18
  loadExtensionTemplates(config: PrivateConfigClass): void;
19
+ /**
20
+ * Loads a single extension template
21
+ * @param extFolder The folder name of the extension
22
+ * @returns The extension template object if the extension is valid, null otherwise
23
+ */
24
+ private loadSingleExtensionTemplate;
25
+ private getExtensionFolders;
26
26
  private setTemplatesToConfig;
27
27
  }
@@ -5,6 +5,7 @@ const fs = require("fs");
5
5
  const path = require("path");
6
6
  const ServerExtensionsConfig_1 = require("../../../common/config/private/subconfigs/ServerExtensionsConfig");
7
7
  const ProjectPath_1 = require("../../ProjectPath");
8
+ const Utils_1 = require("../../../common/Utils");
8
9
  /**
9
10
  * This class decouples the extension management and the config.
10
11
  * It helps to solve the "chicken and the egg" which should load first:
@@ -12,7 +13,6 @@ const ProjectPath_1 = require("../../ProjectPath");
12
13
  */
13
14
  class ExtensionConfigTemplateLoader {
14
15
  constructor() {
15
- this.loaded = false;
16
16
  this.extensionList = [];
17
17
  this.extensionTemplates = [];
18
18
  }
@@ -22,36 +22,6 @@ class ExtensionConfigTemplateLoader {
22
22
  }
23
23
  return this.instance;
24
24
  }
25
- /**
26
- * Loads a single extension template
27
- * @param extFolder The folder name of the extension
28
- * @returns The extension template object if the extension is valid, null otherwise
29
- */
30
- loadSingleExtensionTemplate(extFolder) {
31
- if (!ProjectPath_1.ProjectPath.ExtensionFolder) {
32
- throw new Error('Unknown extensions folder.');
33
- }
34
- const extPath = path.join(ProjectPath_1.ProjectPath.ExtensionFolder, extFolder);
35
- const configExtPath = path.join(extPath, 'config.js');
36
- const serverExtPath = path.join(extPath, 'server.js');
37
- // if server.js is missing, it's not a valid extension
38
- if (!fs.existsSync(serverExtPath)) {
39
- return null;
40
- }
41
- let template = { folder: extFolder };
42
- if (fs.existsSync(configExtPath)) {
43
- // eslint-disable-next-line @typescript-eslint/no-var-requires
44
- const extCfg = require(configExtPath);
45
- if (typeof extCfg?.initConfig === 'function') {
46
- extCfg?.initConfig({
47
- setConfigTemplate: (templateClass) => {
48
- template = { folder: extFolder, template: templateClass };
49
- }
50
- });
51
- }
52
- }
53
- return template;
54
- }
55
25
  /**
56
26
  * Loads a single extension template and adds it to the config
57
27
  * @param extFolder The folder name of the extension
@@ -84,26 +54,62 @@ class ExtensionConfigTemplateLoader {
84
54
  if (!ProjectPath_1.ProjectPath.ExtensionFolder) {
85
55
  throw new Error('Unknown extensions folder.');
86
56
  }
57
+ if (!fs.existsSync(ProjectPath_1.ProjectPath.ExtensionFolder)) {
58
+ return;
59
+ }
60
+ const newList = this.getExtensionFolders();
61
+ const loaded = Utils_1.Utils.equalsFilter(this.extensionList, newList);
62
+ this.extensionList = newList;
87
63
  // already loaded
88
- if (!this.loaded) {
64
+ if (!loaded) {
89
65
  this.extensionTemplates = [];
90
- if (fs.existsSync(ProjectPath_1.ProjectPath.ExtensionFolder)) {
91
- this.extensionList = (fs
92
- .readdirSync(ProjectPath_1.ProjectPath.ExtensionFolder))
93
- .filter((f) => fs.statSync(path.join(ProjectPath_1.ProjectPath.ExtensionFolder, f)).isDirectory());
94
- this.extensionList.sort();
95
- for (let i = 0; i < this.extensionList.length; ++i) {
96
- const extFolder = this.extensionList[i];
97
- const template = this.loadSingleExtensionTemplate(extFolder);
98
- if (template) {
99
- this.extensionTemplates.push(template);
100
- }
66
+ for (let i = 0; i < this.extensionList.length; ++i) {
67
+ const extFolder = this.extensionList[i];
68
+ const template = this.loadSingleExtensionTemplate(extFolder);
69
+ if (template) {
70
+ this.extensionTemplates.push(template);
101
71
  }
102
72
  }
103
- this.loaded = true;
104
73
  }
105
74
  this.setTemplatesToConfig(config);
106
75
  }
76
+ /**
77
+ * Loads a single extension template
78
+ * @param extFolder The folder name of the extension
79
+ * @returns The extension template object if the extension is valid, null otherwise
80
+ */
81
+ loadSingleExtensionTemplate(extFolder) {
82
+ if (!ProjectPath_1.ProjectPath.ExtensionFolder) {
83
+ throw new Error('Unknown extensions folder.');
84
+ }
85
+ const extPath = path.join(ProjectPath_1.ProjectPath.ExtensionFolder, extFolder);
86
+ const configExtPath = path.join(extPath, 'config.js');
87
+ const serverExtPath = path.join(extPath, 'server.js');
88
+ // if server.js is missing, it's not a valid extension
89
+ if (!fs.existsSync(serverExtPath)) {
90
+ return null;
91
+ }
92
+ let template = { folder: extFolder };
93
+ if (fs.existsSync(configExtPath)) {
94
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
95
+ const extCfg = require(configExtPath);
96
+ if (typeof extCfg?.initConfig === 'function') {
97
+ extCfg?.initConfig({
98
+ setConfigTemplate: (templateClass) => {
99
+ template = { folder: extFolder, template: templateClass };
100
+ }
101
+ });
102
+ }
103
+ }
104
+ return template;
105
+ }
106
+ getExtensionFolders() {
107
+ const list = (fs
108
+ .readdirSync(ProjectPath_1.ProjectPath.ExtensionFolder))
109
+ .filter((f) => fs.statSync(path.join(ProjectPath_1.ProjectPath.ExtensionFolder, f)).isDirectory());
110
+ list.sort();
111
+ return list;
112
+ }
107
113
  setTemplatesToConfig(config) {
108
114
  if (!this.extensionTemplates) {
109
115
  return;
@@ -17,13 +17,27 @@ export declare class ExtensionManager implements IObjectManager {
17
17
  init(): Promise<void>;
18
18
  getExtensionListWithInstallStatus(): Promise<ExtensionListItem[]>;
19
19
  cleanUp(): Promise<void>;
20
+ /**
21
+ * Install an extension from the repository
22
+ * @param extensionId - The repository extension ID (not to be confused with the unique internal extensionId used in extObjects)
23
+ */
20
24
  installExtension(extensionId: string): Promise<void>;
25
+ /**
26
+ * Reload an extension by cleaning up and re-initializing it
27
+ * @param configKey - The key used in Config.Extensions.extensions map (typically the folder name)
28
+ */
29
+ reloadExtension(configKey: string): Promise<void>;
30
+ /**
31
+ * Delete an extension by cleaning up, removing its folder, and removing it from configuration
32
+ * @param configKey - The key used in Config.Extensions.extensions map (typically the folder name)
33
+ */
34
+ deleteExtension(configKey: string): Promise<void>;
21
35
  getUIExtensionConfigs(): UIExtensionDTO[];
22
36
  private initEvents;
23
37
  private createUniqueExtensionObject;
24
38
  /**
25
39
  * Initialize a single extension
26
- * @param extId The id of the extension
40
+ * @param configKey The key used in Config.Extensions.extensions map (typically the folder name)
27
41
  * @returns Promise that resolves when the extension is initialized
28
42
  */
29
43
  private initSingleExtension;
@@ -31,6 +45,7 @@ export declare class ExtensionManager implements IObjectManager {
31
45
  * Initialize all extensions
32
46
  */
33
47
  private initExtensions;
48
+ private cleanUpSingleExtension;
34
49
  private cleanUpExtensions;
35
50
  private downloadFile;
36
51
  private unzipFile;
@@ -19,5 +19,12 @@ export declare class ExtensionObject<C> implements IExtensionObject<C> {
19
19
  readonly RESTApi: ExpressRouterWrapper;
20
20
  readonly messengers: ExtensionMessengerHandler;
21
21
  readonly ui: UIExtension<C>;
22
+ /**
23
+ * @param extensionId - Unique ID used internally to track this extension instance (may have _1, _2 suffix if name collision occurs)
24
+ * @param extensionName - Display name of the extension (typically from package.json)
25
+ * @param folder - Folder name where the extension is stored (also used as config key in Config.Extensions.extensions)
26
+ * @param extensionRouter - Express router for extension REST API endpoints
27
+ * @param events - Extension events for hooking into gallery functionality
28
+ */
22
29
  constructor(extensionId: string, extensionName: string, folder: string, extensionRouter: express.Router, events: IExtensionEvents);
23
30
  }
@@ -19,6 +19,8 @@ import { DirectoryScanSettings } from '../fileaccess/DiskManager';
19
19
  import { SessionContext } from '../SessionContext';
20
20
  import { IClientMediaButtonConfig } from '../../../common/entities/extension/IClientUIConfig';
21
21
  import { MediaEntity } from '../database/enitites/MediaEntity';
22
+ import { VideoConverterInput } from '../fileaccess/VideoConverterWorker';
23
+ import { ProjectedDirectoryCacheEntity } from '../database/enitites/ProjectedDirectoryCacheEntity';
22
24
  export type IExtensionBeforeEventHandler<I extends unknown[], O> = (input: I, event: {
23
25
  stopPropagation: boolean;
24
26
  }) => Promise<I | O>;
@@ -63,6 +65,25 @@ export interface IExtensionEvents {
63
65
  * Invalidates directory covers and caches for a given directory and every parent
64
66
  */
65
67
  invalidateDirectoryCache: IExtensionEvent<[ParentDirectoryDTO], void>;
68
+ /**
69
+ * Returns the projected directory cache for a given directory
70
+ * ProjectedDirectoryCacheEntity contains information, like the number of photos, videos, etc..
71
+ */
72
+ getCacheForDirectory: IExtensionEvent<[
73
+ connection: Connection,
74
+ session: SessionContext,
75
+ dir: {
76
+ id: number;
77
+ name: string;
78
+ path: string;
79
+ }
80
+ ], ProjectedDirectoryCacheEntity>;
81
+ };
82
+ VideoConverter: {
83
+ /**
84
+ * Converts videos with ffmpeg
85
+ */
86
+ convert: IExtensionEvent<[VideoConverterInput], void>;
66
87
  };
67
88
  ImageRenderer: {
68
89
  /**
@@ -3,4 +3,6 @@ export declare class ExtensionRouter {
3
3
  static route(app: Express): void;
4
4
  private static addExtensionList;
5
5
  private static addExtensionInstall;
6
+ private static addExtensionReload;
7
+ private static addExtensionDelete;
6
8
  }
@@ -72,6 +72,7 @@ export declare class ServerUserConfig extends ClientUserConfig {
72
72
  enforcedUsers: UserConfig[];
73
73
  allowQuery: SearchQueryDTO;
74
74
  blockQuery: SearchQueryDTO;
75
+ suppressDefUserWarn: boolean;
75
76
  }
76
77
  export declare class ServerPhotoConfig extends ClientPhotoConfig {
77
78
  useLanczos3: boolean;
@@ -285,6 +285,7 @@ let ServerUserConfig = class ServerUserConfig extends ClientConfig_1.ClientUserC
285
285
  type: SearchQueryDTO_1.SearchQueryTypes.any_text,
286
286
  text: '',
287
287
  };
288
+ this.suppressDefUserWarn = false;
288
289
  }
289
290
  };
290
291
  exports.ServerUserConfig = ServerUserConfig;
@@ -328,6 +329,16 @@ tslib_1.__decorate([
328
329
  }),
329
330
  tslib_1.__metadata("design:type", Object)
330
331
  ], ServerUserConfig.prototype, "blockQuery", void 0);
332
+ tslib_1.__decorate([
333
+ (0, common_1.ConfigProperty)({
334
+ tags: {
335
+ name: $localize `Suppress default user warning`,
336
+ priority: ClientConfig_1.ConfigPriority.underTheHood
337
+ },
338
+ description: $localize `if true, the app won't show a warning for using the default user.`
339
+ }),
340
+ tslib_1.__metadata("design:type", Boolean)
341
+ ], ServerUserConfig.prototype, "suppressDefUserWarn", void 0);
331
342
  exports.ServerUserConfig = ServerUserConfig = tslib_1.__decorate([
332
343
  (0, common_1.SubConfigClass)({ softReadonly: true })
333
344
  ], ServerUserConfig);
@@ -1057,7 +1068,14 @@ tslib_1.__decorate([
1057
1068
  uiResetNeeded: { db: true },
1058
1069
  priority: ClientConfig_1.ConfigPriority.advanced
1059
1070
  },
1060
- description: $localize `If multiple cover is available sorts them by these methods and selects the first one.`,
1071
+ constraint: {
1072
+ assert: (v, c) => {
1073
+ // random should stand on its own
1074
+ return !Array.isArray(v) || v.filter((s) => s.method == SortingMethods_1.SortByTypes.Random).length == 0 || v.length == 1;
1075
+ },
1076
+ assertReason: 'Albums.Cover.Sorting config error: Random should stand on its own. You can\'t combine random with other sorting methods.',
1077
+ },
1078
+ description: $localize `If multiple cover is available sorts them by these methods and selects the first one. Using random sorting does not allow to use any other sorting method.`,
1061
1079
  }),
1062
1080
  tslib_1.__metadata("design:type", Array)
1063
1081
  ], ServerAlbumCoverConfig.prototype, "Sorting", void 0);
@@ -101,6 +101,7 @@ export declare class ClientAlbumConfig {
101
101
  export declare class ClientSharingConfig {
102
102
  enabled: boolean;
103
103
  passwordRequired: boolean;
104
+ sharingKeyLength: number;
104
105
  }
105
106
  export declare class ClientRandomPhotoConfig {
106
107
  enabled: boolean;
@@ -314,6 +314,7 @@ let ClientSharingConfig = class ClientSharingConfig {
314
314
  constructor() {
315
315
  this.enabled = true;
316
316
  this.passwordRequired = false;
317
+ this.sharingKeyLength = 8;
317
318
  }
318
319
  };
319
320
  exports.ClientSharingConfig = ClientSharingConfig;
@@ -337,6 +338,17 @@ tslib_1.__decorate([
337
338
  }),
338
339
  tslib_1.__metadata("design:type", Boolean)
339
340
  ], ClientSharingConfig.prototype, "passwordRequired", void 0);
341
+ tslib_1.__decorate([
342
+ (0, common_1.ConfigProperty)({
343
+ type: 'unsignedInt', min: 8, max: 64,
344
+ tags: {
345
+ name: $localize `Sharing key length`,
346
+ priority: ConfigPriority.underTheHood
347
+ },
348
+ description: $localize `The longer the keys are, the harder they are to guess. Changing this number won't invalidate existing sharing.`,
349
+ }),
350
+ tslib_1.__metadata("design:type", Number)
351
+ ], ClientSharingConfig.prototype, "sharingKeyLength", void 0);
340
352
  exports.ClientSharingConfig = ClientSharingConfig = tslib_1.__decorate([
341
353
  (0, common_1.SubConfigClass)({ tags: { client: true }, softReadonly: true })
342
354
  ], ClientSharingConfig);
@@ -14,6 +14,7 @@ export declare enum ErrorCodes {
14
14
  SERVER_ERROR = 36,
15
15
  USER_MANAGEMENT_DISABLED = 40,
16
16
  INPUT_ERROR = 50,
17
+ PATH_ERROR = 51,
17
18
  SETTINGS_ERROR = 60,
18
19
  TASK_ERROR = 61,
19
20
  JOB_ERROR = 62,
@@ -17,6 +17,7 @@ var ErrorCodes;
17
17
  ErrorCodes[ErrorCodes["SERVER_ERROR"] = 36] = "SERVER_ERROR";
18
18
  ErrorCodes[ErrorCodes["USER_MANAGEMENT_DISABLED"] = 40] = "USER_MANAGEMENT_DISABLED";
19
19
  ErrorCodes[ErrorCodes["INPUT_ERROR"] = 50] = "INPUT_ERROR";
20
+ ErrorCodes[ErrorCodes["PATH_ERROR"] = 51] = "PATH_ERROR";
20
21
  ErrorCodes[ErrorCodes["SETTINGS_ERROR"] = 60] = "SETTINGS_ERROR";
21
22
  ErrorCodes[ErrorCodes["TASK_ERROR"] = 61] = "TASK_ERROR";
22
23
  ErrorCodes[ErrorCodes["JOB_ERROR"] = 62] = "JOB_ERROR";
@@ -4,11 +4,16 @@ import { BsModalService } from 'ngx-bootstrap/modal';
4
4
  import { TextSearch } from '../../../../common/entities/SearchQueryDTO';
5
5
  import { AuthenticationService } from '../../model/network/authentication.service';
6
6
  import { PiTitleService } from '../../model/pi-title.service';
7
+ import { ShareService } from '../gallery/share.service';
8
+ import { NavigationService } from '../../model/navigation.service';
7
9
  export declare class AlbumsComponent implements OnInit {
8
10
  albumsService: AlbumsService;
9
11
  private modalService;
10
12
  authenticationService: AuthenticationService;
11
13
  private piTitleService;
14
+ private shareService;
15
+ private authService;
16
+ private navigation;
12
17
  container: ElementRef;
13
18
  size: number;
14
19
  savedSearch: {
@@ -16,9 +21,9 @@ export declare class AlbumsComponent implements OnInit {
16
21
  searchQuery: TextSearch;
17
22
  };
18
23
  private modalRef;
19
- constructor(albumsService: AlbumsService, modalService: BsModalService, authenticationService: AuthenticationService, piTitleService: PiTitleService);
20
- ngOnInit(): void;
24
+ constructor(albumsService: AlbumsService, modalService: BsModalService, authenticationService: AuthenticationService, piTitleService: PiTitleService, shareService: ShareService, authService: AuthenticationService, navigation: NavigationService);
21
25
  get CanCreateAlbum(): boolean;
26
+ ngOnInit(): Promise<boolean>;
22
27
  openModal(template: TemplateRef<any>): Promise<void>;
23
28
  hideModal(): void;
24
29
  saveSearch(): Promise<void>;
@@ -5,4 +5,6 @@ export declare class ExtensionInstallerService {
5
5
  constructor(networkService: NetworkService);
6
6
  getExtensions(): Promise<Array<ExtensionListItem>>;
7
7
  installExtension(extensionId: string): Promise<void>;
8
+ reloadExtension(extensionPath: string): Promise<void>;
9
+ deleteExtension(extensionPath: string): Promise<void>;
8
10
  }
@@ -1,7 +1,9 @@
1
1
  import { OnInit } from '@angular/core';
2
2
  import { ControlValueAccessor, ValidationErrors, Validator } from '@angular/forms';
3
3
  import { SortingMethod } from '../../../../../../../common/entities/SortingMethods';
4
+ import { NotificationService } from '../../../../../model/notification.service';
4
5
  export declare class SortingMethodSettingsEntryComponent implements ControlValueAccessor, Validator, OnInit {
6
+ private notificationService;
5
7
  sortingByEnum: Record<string, number | string> & {
6
8
  [k: number]: string;
7
9
  };
@@ -10,6 +12,7 @@ export declare class SortingMethodSettingsEntryComponent implements ControlValue
10
12
  key: number;
11
13
  value: string;
12
14
  }[];
15
+ constructor(notificationService: NotificationService);
13
16
  ngOnInit(): void;
14
17
  onTouched(): void;
15
18
  writeValue(obj: SortingMethod): void;
@@ -17,9 +20,9 @@ export declare class SortingMethodSettingsEntryComponent implements ControlValue
17
20
  registerOnTouched(fn: () => void): void;
18
21
  onChange(): void;
19
22
  validate(): ValidationErrors;
20
- private propagateChange;
21
- private propagateTouch;
22
23
  isBidirectional(value: number): boolean;
23
24
  setSortingBy(key: number): void;
24
25
  setSortingAscending(ascending: boolean): void;
26
+ private propagateChange;
27
+ private propagateTouch;
25
28
  }
@@ -10,6 +10,7 @@ import { UntypedFormControl } from '@angular/forms';
10
10
  import { IWebConfigClassPrivate } from 'typeconfig/src/decorators/class/IWebConfigClass';
11
11
  import { TAGS } from '../../../../../common/config/public/ClientConfig';
12
12
  import { ISettingsComponent } from './ISettingsComponent';
13
+ import { ExtensionInstallerService } from '../extension-installer/extension-installer.service';
13
14
  interface ConfigState {
14
15
  value: {
15
16
  [key: string]: RecursiveState;
@@ -45,6 +46,7 @@ export declare class TemplateComponent implements OnInit, OnChanges, OnDestroy,
45
46
  protected notification: NotificationService;
46
47
  settingsService: SettingsService;
47
48
  jobsService: ScheduledJobsService;
49
+ private extensionService;
48
50
  icon: string;
49
51
  ConfigPath: string;
50
52
  nestedConfigs: {
@@ -58,19 +60,19 @@ export declare class TemplateComponent implements OnInit, OnChanges, OnDestroy,
58
60
  error: string;
59
61
  changed: boolean;
60
62
  states: RecursiveState;
63
+ readonly ConfigStyle: typeof ConfigStyle;
61
64
  protected name: string;
65
+ protected sliceFN?: (s: IWebConfigClassPrivate<TAGS> & WebConfig) => ConfigState;
62
66
  private subscription;
63
67
  private settingsSubscription;
64
- protected sliceFN?: (s: IWebConfigClassPrivate<TAGS> & WebConfig) => ConfigState;
65
- readonly ConfigStyle: typeof ConfigStyle;
66
- constructor(authService: AuthenticationService, navigation: NavigationService, notification: NotificationService, settingsService: SettingsService, jobsService: ScheduledJobsService);
68
+ constructor(authService: AuthenticationService, navigation: NavigationService, notification: NotificationService, settingsService: SettingsService, jobsService: ScheduledJobsService, extensionService: ExtensionInstallerService);
69
+ get Name(): string;
70
+ get Changed(): boolean;
71
+ get HasAvailableSettings(): boolean;
67
72
  ngOnChanges(): void;
68
73
  ngOnInit(): void;
69
74
  ngOnDestroy(): void;
70
75
  setSliceFN(sliceFN?: (s: IWebConfigClassPrivate<TAGS> & WebConfig) => ConfigState): void;
71
- get Name(): string;
72
- get Changed(): boolean;
73
- get HasAvailableSettings(): boolean;
74
76
  onNewSettings: (s: IWebConfigClassPrivate<TAGS> & WebConfig) => void;
75
77
  onOptionChange: () => void;
76
78
  reset(): void;
@@ -81,11 +83,14 @@ export declare class TemplateComponent implements OnInit, OnChanges, OnDestroy,
81
83
  isExpandableConfig(c: ConfigState): boolean;
82
84
  isExpandableArrayConfig(c: ConfigState): boolean;
83
85
  save(): Promise<boolean>;
84
- private getSettings;
85
86
  getKeys(states: any): string[];
86
87
  getProgress(uiJob: {
87
88
  job: string;
88
89
  config?: any;
89
90
  }): JobProgressDTO;
91
+ protected isExtension(c: ConfigState): boolean;
92
+ protected removeExtension(c: ConfigState): Promise<void>;
93
+ protected reloadExtension(c: ConfigState): Promise<void>;
94
+ private getSettings;
90
95
  }
91
96
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pigallery2-extension-kit",
3
- "version": "2.6.0-edge",
3
+ "version": "3.0.1",
4
4
  "description": "Interfaces for developing extensions for pigallery2",
5
5
  "author": "Patrik J. Braun",
6
6
  "homepage": "https://github.com/bpatrik/pigallery2",