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.
Files changed (284) hide show
  1. package/README.md +11 -5
  2. package/index.d.ts +1 -0
  3. package/index.js +2 -3
  4. package/lib/backend/Logger.d.ts +7 -7
  5. package/lib/backend/ProjectPath.d.ts +12 -0
  6. package/lib/backend/exceptions/DirectoryNotFound.d.ts +2 -0
  7. package/lib/backend/exceptions/FolderNotWritable.d.ts +2 -0
  8. package/lib/backend/index.d.ts +1 -1
  9. package/lib/backend/middlewares/GalleryMWs.d.ts +4 -0
  10. package/lib/backend/middlewares/PersonMWs.d.ts +1 -1
  11. package/lib/backend/middlewares/RenderingMWs.d.ts +24 -0
  12. package/lib/backend/middlewares/RequestParams.d.ts +13 -0
  13. package/lib/backend/middlewares/RequestSession.d.ts +9 -0
  14. package/lib/backend/middlewares/ServerTimingMWs.d.ts +6 -6
  15. package/lib/backend/middlewares/SharingMWs.d.ts +2 -1
  16. package/lib/backend/middlewares/VersionMWs.d.ts +1 -1
  17. package/lib/backend/middlewares/thumbnail/ThumbnailGeneratorMWs.d.ts +1 -1
  18. package/lib/backend/middlewares/user/AuthenticationMWs.d.ts +37 -0
  19. package/lib/backend/middlewares/user/OIDCAuthService.d.ts +36 -5
  20. package/lib/backend/middlewares/user/OIDCMWs.d.ts +10 -0
  21. package/lib/backend/middlewares/user/UserMWs.d.ts +1 -0
  22. package/lib/backend/middlewares/user/UserRequestConstrainsMWs.d.ts +0 -1
  23. package/lib/backend/model/DirectoryAccess.d.ts +78 -0
  24. package/lib/backend/model/EventLoopHandler.d.ts +1 -1
  25. package/lib/backend/model/FFmpeg.d.ts +47 -0
  26. package/lib/backend/model/FFmpegFactory.d.ts +11 -2
  27. package/lib/backend/model/ObjectManagers.d.ts +1 -1
  28. package/lib/backend/model/PasswordHelper.d.ts +1 -1
  29. package/lib/backend/model/SessionContext.d.ts +16 -6
  30. package/lib/backend/model/UploadManager.d.ts +6 -3
  31. package/lib/backend/model/database/CoverManager.d.ts +8 -2
  32. package/lib/backend/model/database/GalleryManager.d.ts +15 -9
  33. package/lib/backend/model/database/IndexingManager.d.ts +7 -7
  34. package/lib/backend/model/database/LocationManager.d.ts +2 -3
  35. package/lib/backend/model/database/PersonManager.d.ts +5 -3
  36. package/lib/backend/model/database/ProjectedCacheManager.d.ts +9 -8
  37. package/lib/backend/model/database/ProjectionAwareManager.d.ts +4 -4
  38. package/lib/backend/model/database/SQLConnection.d.ts +4 -2
  39. package/lib/backend/model/database/SearchManager.d.ts +23 -8
  40. package/lib/backend/model/database/SessionManager.d.ts +41 -4
  41. package/lib/backend/model/database/SharingManager.d.ts +11 -6
  42. package/lib/backend/model/database/UserManager.d.ts +8 -1
  43. package/lib/backend/model/database/enitites/DirectoryEntity.d.ts +1 -1
  44. package/lib/backend/model/database/enitites/EntityUtils.d.ts +22 -1
  45. package/lib/backend/model/database/enitites/MediaEntity.d.ts +5 -2
  46. package/lib/backend/model/database/enitites/ProjectedDirectoryCacheEntity.d.ts +2 -2
  47. package/lib/backend/model/database/enitites/SharingEntity.d.ts +11 -5
  48. package/lib/backend/model/database/enitites/UserEntity.d.ts +8 -5
  49. package/lib/backend/model/database/enitites/VideoEntity.d.ts +2 -2
  50. package/lib/backend/model/database/enitites/album/ProjectedAlbumCacheEntity.d.ts +2 -2
  51. package/lib/backend/model/database/enitites/person/ProjectedPersonCacheEntity.d.ts +1 -1
  52. package/lib/backend/model/diagnostics/ConfigDiagnostics.d.ts +31 -12
  53. package/lib/backend/model/extension/ExpressRouterWrapper.d.ts +10 -4
  54. package/lib/backend/model/extension/ExtensionApp.d.ts +2 -3
  55. package/lib/backend/model/extension/ExtensionDB.d.ts +2 -2
  56. package/lib/backend/model/extension/ExtensionEvent.d.ts +12 -1
  57. package/lib/backend/model/extension/ExtensionManager.d.ts +22 -4
  58. package/lib/backend/model/extension/ExtensionObject.d.ts +6 -3
  59. package/lib/backend/model/extension/IExtension.d.ts +35 -18
  60. package/lib/backend/model/fileaccess/DiskManager.d.ts +3 -1
  61. package/lib/backend/model/fileaccess/MetadataLoader.d.ts +17 -0
  62. package/lib/backend/model/fileaccess/TaskQue.d.ts +4 -4
  63. package/lib/backend/model/fileaccess/VideoConverterWorker.d.ts +6 -2
  64. package/lib/backend/model/fileaccess/fileprocessing/PhotoProcessing.d.ts +3 -2
  65. package/lib/backend/model/jobs/JobManager.d.ts +2 -4
  66. package/lib/backend/model/jobs/JobProgressManager.d.ts +5 -3
  67. package/lib/backend/model/jobs/JobRepository.d.ts +1 -3
  68. package/lib/backend/model/jobs/jobs/AlbumCoverFillingJob.d.ts +1 -1
  69. package/lib/backend/model/jobs/jobs/IJobListener.d.ts +2 -2
  70. package/lib/backend/model/jobs/jobs/Job.d.ts +4 -1
  71. package/lib/backend/model/messenger/EmailMessenger.d.ts +1 -1
  72. package/lib/backend/model/messenger/Messenger.d.ts +1 -2
  73. package/lib/backend/model/messenger/MessengerRepository.d.ts +1 -3
  74. package/lib/backend/routes/ErrorRouter.d.ts +1 -0
  75. package/lib/backend/routes/GalleryRouter.d.ts +8 -0
  76. package/lib/backend/routes/PublicRouter.d.ts +3 -6
  77. package/lib/backend/routes/SharingRouter.d.ts +1 -1
  78. package/lib/backend/routes/UserRouter.d.ts +1 -0
  79. package/lib/backend/server.d.ts +3 -3
  80. package/lib/common/DataStructureVersion.d.ts +1 -1
  81. package/lib/common/SearchQueryParser.d.ts +2 -2
  82. package/lib/common/SearchQueryUtils.d.ts +71 -4
  83. package/lib/common/SupportedFormats.d.ts +11 -1
  84. package/lib/common/SupportedFormats.js +13 -19
  85. package/lib/common/TextFold.d.ts +6 -0
  86. package/lib/common/UploadUtils.d.ts +4 -0
  87. package/lib/common/Utils.d.ts +23 -24
  88. package/lib/common/Utils.js +37 -97
  89. package/lib/common/config/Enums.d.ts +91 -0
  90. package/lib/common/config/Enums.js +109 -0
  91. package/lib/common/config/private/Config.d.ts +1 -1
  92. package/lib/common/config/private/PrivateConfig.d.ts +18 -39
  93. package/lib/common/config/private/WebConfig.d.ts +1 -2
  94. package/lib/common/config/private/subconfigs/ServerExtensionsConfig.d.ts +2 -3
  95. package/lib/common/config/public/ClientConfig.d.ts +51 -68
  96. package/lib/common/config/public/ClientConfig.js +774 -557
  97. package/lib/common/entities/AutoCompleteItem.d.ts +3 -3
  98. package/lib/common/entities/ContentWrapper.d.ts +21 -8
  99. package/lib/common/entities/ContentWrapper.js +286 -318
  100. package/lib/common/entities/DirectoryDTO.d.ts +7 -6
  101. package/lib/common/entities/DirectoryDTO.js +10 -5
  102. package/lib/common/entities/Error.d.ts +12 -7
  103. package/lib/common/entities/Error.js +15 -3
  104. package/lib/common/entities/MediaDTO.d.ts +13 -0
  105. package/lib/common/entities/MediaDTO.js +10 -7
  106. package/lib/common/entities/Message.d.ts +3 -3
  107. package/lib/common/entities/NotificationDTO.d.ts +2 -2
  108. package/lib/common/entities/SearchQueryDTO.d.ts +9 -1
  109. package/lib/common/entities/SearchQueryDTO.js +1 -0
  110. package/lib/common/entities/SharingDTO.d.ts +39 -5
  111. package/lib/common/entities/SortingMethods.d.ts +26 -2
  112. package/lib/common/entities/SortingMethods.js +14 -1
  113. package/lib/common/entities/UserDTO.d.ts +5 -2
  114. package/lib/common/entities/UserSettingsDTO.d.ts +3 -1
  115. package/lib/common/entities/VideoDTO.d.ts +2 -5
  116. package/lib/common/entities/album/AlbumBaseDTO.d.ts +2 -2
  117. package/lib/common/entities/extension/ExtensionListItem.d.ts +1 -1
  118. package/lib/common/entities/extension/IClientUIConfig.d.ts +19 -12
  119. package/lib/common/entities/job/JobDTO.d.ts +1 -1
  120. package/lib/common/entities/job/JobProgressDTO.d.ts +1 -1
  121. package/lib/common/entities/job/JobScheduleDTO.d.ts +5 -5
  122. package/lib/common/entities/job/JobScheduleDTO.js +9 -5
  123. package/lib/common/event/EventLimit.d.ts +1 -1
  124. package/package.json +21 -8
  125. package/REPOSITORY.md +0 -13
  126. package/events.drawio +0 -1
  127. package/events.png +0 -0
  128. package/index.js.map +0 -1
  129. package/index.ts +0 -2
  130. package/lib/backend/ProjectPath.js +0 -36
  131. package/lib/backend/model/NotifocationManager.js +0 -44
  132. package/lib/backend/model/PasswordHelper.js +0 -20
  133. package/lib/backend/model/database/enitites/PersonEntry.d.ts +0 -11
  134. package/lib/backend/model/database/enitites/PersonJunctionTable.d.ts +0 -10
  135. package/lib/backend/model/extension/ExtensionConfigTemplateLoader.js +0 -139
  136. package/lib/backend/model/extension/ExtensionConfigWrapper.js +0 -59
  137. package/lib/common/config/private/Config.js +0 -20
  138. package/lib/common/config/private/PrivateConfig.js +0 -1568
  139. package/lib/common/config/private/PrivateConfigClass.js +0 -96
  140. package/lib/common/config/private/WebConfig.js +0 -19
  141. package/lib/common/config/private/subconfigs/MessagingConfig.js +0 -134
  142. package/lib/common/config/private/subconfigs/ServerExtensionsConfig.js +0 -111
  143. package/lib/common/config/public/Config.js +0 -24
  144. package/lib/common/entities/ConentWrapper.d.ts +0 -18
  145. package/lib/common/entities/ConentWrapper.js +0 -490
  146. package/lib/frontend/app/app.component.d.ts +0 -18
  147. package/lib/frontend/app/app.module.d.ts +0 -23
  148. package/lib/frontend/app/app.routing.d.ts +0 -4
  149. package/lib/frontend/app/icon.component.d.ts +0 -7
  150. package/lib/frontend/app/model/IRenderable.d.ts +0 -17
  151. package/lib/frontend/app/model/backendtext.service.d.ts +0 -7
  152. package/lib/frontend/app/model/backendtext.service.spec.d.ts +0 -1
  153. package/lib/frontend/app/model/extension.service.d.ts +0 -5
  154. package/lib/frontend/app/model/navigation.service.d.ts +0 -12
  155. package/lib/frontend/app/model/network/autehentication.service.spec.d.ts +0 -1
  156. package/lib/frontend/app/model/network/authentication.service.d.ts +0 -22
  157. package/lib/frontend/app/model/network/helper/auth.guard.d.ts +0 -9
  158. package/lib/frontend/app/model/network/helper/csrf.interceptor.d.ts +0 -8
  159. package/lib/frontend/app/model/network/helper/error.interceptor.d.ts +0 -8
  160. package/lib/frontend/app/model/network/network.service.d.ts +0 -29
  161. package/lib/frontend/app/model/network/network.service.spec.d.ts +0 -1
  162. package/lib/frontend/app/model/network/user.service.d.ts +0 -13
  163. package/lib/frontend/app/model/network/user.service.spec.d.ts +0 -1
  164. package/lib/frontend/app/model/notification.service.d.ts +0 -28
  165. package/lib/frontend/app/model/page.helper.d.ts +0 -15
  166. package/lib/frontend/app/model/pi-title.service.d.ts +0 -15
  167. package/lib/frontend/app/model/query.service.d.ts +0 -19
  168. package/lib/frontend/app/model/seededRandom.service.d.ts +0 -7
  169. package/lib/frontend/app/model/theme.service.d.ts +0 -16
  170. package/lib/frontend/app/model/version.service.d.ts +0 -10
  171. package/lib/frontend/app/pipes/DurationPipe.d.ts +0 -4
  172. package/lib/frontend/app/pipes/FileDTOToPathPipe.d.ts +0 -5
  173. package/lib/frontend/app/pipes/FileDTOToRelativePathPipe.d.ts +0 -5
  174. package/lib/frontend/app/pipes/FileSizePipe.d.ts +0 -4
  175. package/lib/frontend/app/pipes/GPXFilesFilterPipe.d.ts +0 -5
  176. package/lib/frontend/app/pipes/MDFilesFilterPipe.d.ts +0 -6
  177. package/lib/frontend/app/pipes/ParseIntPipe.d.ts +0 -4
  178. package/lib/frontend/app/pipes/PhotoFilterPipe.d.ts +0 -6
  179. package/lib/frontend/app/pipes/SafeHTMLPipe.d.ts +0 -7
  180. package/lib/frontend/app/pipes/StringifyEnum.d.ts +0 -4
  181. package/lib/frontend/app/pipes/StringifyGridSize.d.ts +0 -5
  182. package/lib/frontend/app/pipes/StringifyRolePipe.d.ts +0 -4
  183. package/lib/frontend/app/pipes/StringifySearchQuery.d.ts +0 -8
  184. package/lib/frontend/app/pipes/StringifySearchType.d.ts +0 -5
  185. package/lib/frontend/app/pipes/StringifySortingMethod.d.ts +0 -4
  186. package/lib/frontend/app/ui/EnumTranslations.d.ts +0 -5
  187. package/lib/frontend/app/ui/admin/admin.component.d.ts +0 -36
  188. package/lib/frontend/app/ui/albums/album/album.component.d.ts +0 -26
  189. package/lib/frontend/app/ui/albums/albums.component.d.ts +0 -31
  190. package/lib/frontend/app/ui/albums/albums.service.d.ts +0 -12
  191. package/lib/frontend/app/ui/albums/saved-search-popup/saved-search-popup.component.d.ts +0 -15
  192. package/lib/frontend/app/ui/duplicates/duplicates.component.d.ts +0 -36
  193. package/lib/frontend/app/ui/duplicates/duplicates.service.d.ts +0 -9
  194. package/lib/frontend/app/ui/duplicates/photo/photo.duplicates.component.d.ts +0 -11
  195. package/lib/frontend/app/ui/faces/Person.d.ts +0 -9
  196. package/lib/frontend/app/ui/faces/face/face.component.d.ts +0 -22
  197. package/lib/frontend/app/ui/faces/faces.component.d.ts +0 -18
  198. package/lib/frontend/app/ui/faces/faces.service.d.ts +0 -14
  199. package/lib/frontend/app/ui/faces/navigator/navigator.faces.component.d.ts +0 -15
  200. package/lib/frontend/app/ui/frame/frame.component.d.ts +0 -60
  201. package/lib/frontend/app/ui/gallery/Media.d.ts +0 -15
  202. package/lib/frontend/app/ui/gallery/MediaIcon.d.ts +0 -29
  203. package/lib/frontend/app/ui/gallery/blog/blog.gallery.component.d.ts +0 -16
  204. package/lib/frontend/app/ui/gallery/blog/blog.service.d.ts +0 -85
  205. package/lib/frontend/app/ui/gallery/blog/blog.service.spec.d.ts +0 -1
  206. package/lib/frontend/app/ui/gallery/cache.gallery.service.d.ts +0 -51
  207. package/lib/frontend/app/ui/gallery/content.service.d.ts +0 -11
  208. package/lib/frontend/app/ui/gallery/contentLoader.service.d.ts +0 -37
  209. package/lib/frontend/app/ui/gallery/directories/directories.component.d.ts +0 -14
  210. package/lib/frontend/app/ui/gallery/directories/directory/directory.gallery.component.d.ts +0 -20
  211. package/lib/frontend/app/ui/gallery/filter/filter.gallery.component.d.ts +0 -32
  212. package/lib/frontend/app/ui/gallery/filter/filter.service.d.ts +0 -51
  213. package/lib/frontend/app/ui/gallery/filter/filter.service.spec.d.ts +0 -1
  214. package/lib/frontend/app/ui/gallery/fullscreen.service.d.ts +0 -7
  215. package/lib/frontend/app/ui/gallery/gallery.component.d.ts +0 -64
  216. package/lib/frontend/app/ui/gallery/gallery.component.spec.d.ts +0 -1
  217. package/lib/frontend/app/ui/gallery/gallery.service.d.ts +0 -13
  218. package/lib/frontend/app/ui/gallery/grid/GridMedia.d.ts +0 -13
  219. package/lib/frontend/app/ui/gallery/grid/GridRowBuilder.d.ts +0 -16
  220. package/lib/frontend/app/ui/gallery/grid/grid.gallery.component.d.ts +0 -88
  221. package/lib/frontend/app/ui/gallery/grid/grid.gallery.component.spec.d.ts +0 -1
  222. package/lib/frontend/app/ui/gallery/grid/photo/loading/loading.photo.grid.gallery.component.d.ts +0 -4
  223. package/lib/frontend/app/ui/gallery/grid/photo/media-button-modal/media-button-modal.component.d.ts +0 -20
  224. package/lib/frontend/app/ui/gallery/grid/photo/media-button-modal/media-button-modal.service.d.ts +0 -27
  225. package/lib/frontend/app/ui/gallery/grid/photo/photo.grid.gallery.component.d.ts +0 -53
  226. package/lib/frontend/app/ui/gallery/lightbox/controls/controls.lightbox.gallery.component.d.ts +0 -103
  227. package/lib/frontend/app/ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.d.ts +0 -51
  228. package/lib/frontend/app/ui/gallery/lightbox/lightbox.gallery.component.d.ts +0 -95
  229. package/lib/frontend/app/ui/gallery/lightbox/lightbox.gallery.component.spec.d.ts +0 -1
  230. package/lib/frontend/app/ui/gallery/lightbox/lightbox.service.d.ts +0 -45
  231. package/lib/frontend/app/ui/gallery/lightbox/media/media.lightbox.gallery.component.d.ts +0 -71
  232. package/lib/frontend/app/ui/gallery/map/MarkerFactory.d.ts +0 -12
  233. package/lib/frontend/app/ui/gallery/map/lightbox/lightbox.map.gallery.component.d.ts +0 -80
  234. package/lib/frontend/app/ui/gallery/map/map.gallery.component.d.ts +0 -36
  235. package/lib/frontend/app/ui/gallery/map/map.service.d.ts +0 -30
  236. package/lib/frontend/app/ui/gallery/navigator/navigator.gallery.component.d.ts +0 -81
  237. package/lib/frontend/app/ui/gallery/navigator/navigator.service.d.ts +0 -14
  238. package/lib/frontend/app/ui/gallery/navigator/sorting.service.d.ts +0 -38
  239. package/lib/frontend/app/ui/gallery/overlay.service.d.ts +0 -9
  240. package/lib/frontend/app/ui/gallery/photo-frame-builder/photo-frame-builder.gallery.component.d.ts +0 -40
  241. package/lib/frontend/app/ui/gallery/random-query-builder/random-query-builder.gallery.component.d.ts +0 -30
  242. package/lib/frontend/app/ui/gallery/search/AutoCompleteRenderItem.d.ts +0 -11
  243. package/lib/frontend/app/ui/gallery/search/autocomplete.service.d.ts +0 -33
  244. package/lib/frontend/app/ui/gallery/search/query-builder/query-bulder.gallery.component.d.ts +0 -22
  245. package/lib/frontend/app/ui/gallery/search/query-enrty/query-entry.search.gallery.component.d.ts +0 -43
  246. package/lib/frontend/app/ui/gallery/search/search-field/search-field.gallery.component.d.ts +0 -31
  247. package/lib/frontend/app/ui/gallery/search/search-field-base/search-field-base.gallery.component.d.ts +0 -57
  248. package/lib/frontend/app/ui/gallery/search/search-query-parser.service.d.ts +0 -7
  249. package/lib/frontend/app/ui/gallery/search/search.gallery.component.d.ts +0 -39
  250. package/lib/frontend/app/ui/gallery/share/share.gallery.component.d.ts +0 -67
  251. package/lib/frontend/app/ui/gallery/share.service.d.ts +0 -35
  252. package/lib/frontend/app/ui/gallery/thumbnailLoader.service.d.ts +0 -41
  253. package/lib/frontend/app/ui/gallery/thumbnailManager.service.d.ts +0 -46
  254. package/lib/frontend/app/ui/gallery/uploader/uploader.gallery.component.d.ts +0 -15
  255. package/lib/frontend/app/ui/gallery/uploader/uploader.service.d.ts +0 -36
  256. package/lib/frontend/app/ui/gallery/wakelock.service.d.ts +0 -19
  257. package/lib/frontend/app/ui/language/language.component.d.ts +0 -10
  258. package/lib/frontend/app/ui/login/login.component.d.ts +0 -18
  259. package/lib/frontend/app/ui/settings/extension-installer/extension-installer.component.d.ts +0 -18
  260. package/lib/frontend/app/ui/settings/extension-installer/extension-installer.service.d.ts +0 -10
  261. package/lib/frontend/app/ui/settings/gallery-statistic/gallery-statistic.component.d.ts +0 -5
  262. package/lib/frontend/app/ui/settings/scheduled-jobs.service.d.ts +0 -41
  263. package/lib/frontend/app/ui/settings/settings.service.d.ts +0 -27
  264. package/lib/frontend/app/ui/settings/sharings-list/sharings-list.component.d.ts +0 -14
  265. package/lib/frontend/app/ui/settings/template/CustomSettingsEntries.d.ts +0 -57
  266. package/lib/frontend/app/ui/settings/template/ISettingsComponent.d.ts +0 -13
  267. package/lib/frontend/app/ui/settings/template/settings-entry/settings-entry.component.d.ts +0 -118
  268. package/lib/frontend/app/ui/settings/template/settings-entry/sorting-method/sorting-method.settings-entry.component.d.ts +0 -28
  269. package/lib/frontend/app/ui/settings/template/template.component.d.ts +0 -97
  270. package/lib/frontend/app/ui/settings/users/users.component.d.ts +0 -47
  271. package/lib/frontend/app/ui/settings/users/users.service.d.ts +0 -12
  272. package/lib/frontend/app/ui/settings/workflow/button/job-button.settings.component.d.ts +0 -32
  273. package/lib/frontend/app/ui/settings/workflow/progress/job-progress.settings.component.d.ts +0 -25
  274. package/lib/frontend/app/ui/settings/workflow/workflow.component.d.ts +0 -68
  275. package/lib/frontend/app/ui/sharelogin/share-login.component.d.ts +0 -16
  276. package/lib/frontend/app/ui/utils/grid-size-icon/grid-size-icon.component.d.ts +0 -5
  277. package/lib/frontend/app/ui/utils/sorting-method-icon/sorting-method-icon.component.d.ts +0 -13
  278. package/lib/frontend/app/ui/utils/timestamp-datepicker/datepicker.component.d.ts +0 -10
  279. package/lib/frontend/app/ui/utils/timestamp-timepicker/timepicker.component.d.ts +0 -11
  280. package/lib/frontend/environments/environment.d.ts +0 -3
  281. package/lib/frontend/environments/environment.prod.d.ts +0 -3
  282. package/lib/frontend/main.d.ts +0 -21
  283. package/lib/frontend/polyfills.d.ts +0 -60
  284. package/lib/frontend/test.d.ts +0 -1
@@ -8,13 +8,22 @@ import { UIExtensionDTO } from '../../../common/entities/extension/IClientUIConf
8
8
  export declare class ExtensionManager implements IObjectManager {
9
9
  static EXTENSION_API_PATH: string;
10
10
  repository: ExtensionRepository;
11
+ /**
12
+ * The manager that serves the extension REST API.
13
+ * The app mounts the API only once (ObjectManagers creates a new manager on every reset), and this is where it goes.
14
+ */
15
+ private static active;
16
+ private static mountedApps;
11
17
  events: IExtensionEvents;
12
- extObjects: {
13
- [key: string]: ExtensionObject<unknown>;
14
- };
15
- router: express.Router;
18
+ extObjects: Record<string, ExtensionObject<unknown>>;
19
+ private serverModules;
16
20
  constructor();
17
21
  init(): Promise<void>;
22
+ /**
23
+ * Passes the request through the routers of the current extension objects.
24
+ * Every extension has its own router, so the routes of a cleaned up extension are gone with its object.
25
+ */
26
+ handleRequest(req: express.Request, res: express.Response, next: express.NextFunction): void;
18
27
  getExtensionListWithInstallStatus(): Promise<ExtensionListItem[]>;
19
28
  cleanUp(): Promise<void>;
20
29
  /**
@@ -32,6 +41,15 @@ export declare class ExtensionManager implements IObjectManager {
32
41
  * @param configKey - The key used in Config.Extensions.extensions map (typically the folder name)
33
42
  */
34
43
  deleteExtension(configKey: string): Promise<void>;
44
+ /**
45
+ * Drops the modules of the extension folder (incl. its node_modules) from the require cache.
46
+ * Native addons stay: Node can't load them twice.
47
+ */
48
+ private static clearRequireCache;
49
+ /**
50
+ * An extension folder is a single, plain folder name inside the extension folder.
51
+ */
52
+ private static isFolderName;
35
53
  getUIExtensionConfigs(): UIExtensionDTO[];
36
54
  private initEvents;
37
55
  private createUniqueExtensionObject;
@@ -2,7 +2,6 @@ import { IExtensionEvents, IExtensionObject } from './IExtension';
2
2
  import { ExtensionApp } from './ExtensionApp';
3
3
  import { ExtensionDB } from './ExtensionDB';
4
4
  import { ExpressRouterWrapper } from './ExpressRouterWrapper';
5
- import * as express from 'express';
6
5
  import { ExtensionMessengerHandler } from './ExtensionMessengerHandler';
7
6
  import { ExtensionConfig } from './ExtensionConfig';
8
7
  import { UIExtension } from './UIExtension';
@@ -19,12 +18,16 @@ export declare class ExtensionObject<C> implements IExtensionObject<C> {
19
18
  readonly RESTApi: ExpressRouterWrapper;
20
19
  readonly messengers: ExtensionMessengerHandler;
21
20
  readonly ui: UIExtension<C>;
21
+ /** The REST API routes of this extension. They go away with this object on clean up. */
22
+ readonly router: import("express-serve-static-core").Router;
23
+ private readonly eventsTracker;
22
24
  /**
23
25
  * @param extensionId - Unique ID used internally to track this extension instance (may have _1, _2 suffix if name collision occurs)
24
26
  * @param extensionName - Display name of the extension (typically from package.json)
25
27
  * @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
28
  * @param events - Extension events for hooking into gallery functionality
28
29
  */
29
- constructor(extensionId: string, extensionName: string, folder: string, extensionRouter: express.Router, events: IExtensionEvents);
30
+ /** Removes the event handlers this extension added. */
31
+ removeEventHandlers(): void;
32
+ constructor(extensionId: string, extensionName: string, folder: string, events: IExtensionEvents);
30
33
  }
@@ -6,7 +6,7 @@ import { ProjectPathClass } from '../../ProjectPath';
6
6
  import { ILogger } from '../../Logger';
7
7
  import { UserDTO, UserRoles } from '../../../common/entities/UserDTO';
8
8
  import { ParamsDictionary } from 'express-serve-static-core';
9
- import { Connection, Repository } from 'typeorm';
9
+ import { DataSource, Repository } from 'typeorm';
10
10
  import { DynamicConfig } from '../../../common/entities/DynamicConfig';
11
11
  import { MediaDTOWithThPath } from '../messenger/Messenger';
12
12
  import { PhotoMetadata } from '../../../common/entities/PhotoDTO';
@@ -14,7 +14,7 @@ import { VideoMetadata } from '../../../common/entities/VideoDTO';
14
14
  import { MediaRendererInput, SvgRendererInput } from '../fileaccess/PhotoWorker';
15
15
  import { SearchQueryDTO } from '../../../common/entities/SearchQueryDTO';
16
16
  import { CoverPhotoDTOWithID } from '../database/CoverManager';
17
- import { ParentDirectoryDTO } from '../../../common/entities/DirectoryDTO';
17
+ import { DirectoryPathDTO, ParentDirectoryDTO } from '../../../common/entities/DirectoryDTO';
18
18
  import { DirectoryScanSettings } from '../fileaccess/DiskManager';
19
19
  import { SessionContext } from '../SessionContext';
20
20
  import { IClientMediaButtonConfig, IMediaRequestBodyData } from '../../../common/entities/extension/IClientUIConfig';
@@ -50,7 +50,7 @@ export interface IExtensionEvents {
50
50
  {
51
51
  searchQuery: SearchQueryDTO;
52
52
  }
53
- ], CoverPhotoDTOWithID>;
53
+ ], CoverPhotoDTOWithID | null>;
54
54
  getCoverForDirectory: IExtensionEvent<[
55
55
  session: SessionContext,
56
56
  {
@@ -58,19 +58,19 @@ export interface IExtensionEvents {
58
58
  name: string;
59
59
  path: string;
60
60
  }
61
- ], CoverPhotoDTOWithID>;
61
+ ], CoverPhotoDTOWithID | null>;
62
62
  };
63
63
  ProjectedCacheManager: {
64
64
  /**
65
65
  * Invalidates directory covers and caches for a given directory and every parent
66
66
  */
67
- invalidateDirectoryCache: IExtensionEvent<[ParentDirectoryDTO], void>;
67
+ invalidateDirectoryCache: IExtensionEvent<[DirectoryPathDTO], void>;
68
68
  /**
69
69
  * Returns the projected directory cache for a given directory
70
70
  * ProjectedDirectoryCacheEntity contains information, like the number of photos, videos, etc..
71
71
  */
72
72
  getCacheForDirectory: IExtensionEvent<[
73
- connection: Connection,
73
+ connection: DataSource,
74
74
  session: SessionContext,
75
75
  dir: {
76
76
  id: number;
@@ -126,34 +126,50 @@ export interface IMediaRequestBody {
126
126
  data: IMediaRequestBodyData;
127
127
  media: string;
128
128
  }
129
+ type IdentifierStart = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z' | Uppercase<'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z'> | '_' | '$';
130
+ type HasUnnamedParam<P extends string> = P extends `${string}${':' | '*'}${infer Rest}` ? Rest extends `${IdentifierStart}${string}` ? HasUnnamedParam<Rest> : true : false;
131
+ /**
132
+ * A REST api path, relative to the extension base endpoint, in Express 5 (path-to-regexp 8) syntax:
133
+ * `:name` for a param, `*name` for a wildcard (its param is the array of the path segments) and `{...}` for an optional part.
134
+ * The Express 4 syntax is rejected: regex params (`:id(\\d+)`), `:id?`, unnamed wildcards (`*`) and the reserved `()[]?+!` characters.
135
+ * See https://expressjs.com/en/guide/migrating-5.html#path-syntax
136
+ * At runtime, a path that Express 5 can't parse is logged and not registered.
137
+ */
138
+ export type ExtensionRoutePath<P extends string> = P extends `${string}${'(' | ')' | '[' | ']' | '?' | '+' | '!'}${string}` ? 'Express 4 path syntax is not supported (no regex params, no ?, +, !, [ or ]); use {...} for optional parts' : HasUnnamedParam<P> extends true ? 'Every : and * needs a parameter name (e.g. *path), see the Express 5 path syntax' : P;
139
+ /**
140
+ * Checks every path of a route literal at compile time, see {@link ExtensionRoutePath}.
141
+ */
142
+ export type ExtensionRoutePaths<P extends readonly string[]> = {
143
+ readonly [K in keyof P]: ExtensionRoutePath<P[K]>;
144
+ };
129
145
  export interface IExtensionRESTRoute {
130
146
  /**
131
147
  * Looks for req.body.media for the media path and calls the callback with that media entry.
132
148
  * Sends a pigallery2 standard JSON object with payload or error message back to the client.
133
- * @param paths RESTapi path, relative to the extension base endpoint
149
+ * @param paths RESTapi paths, relative to the extension base endpoint, see {@link ExtensionRoutePath}
134
150
  * @param invalidateDirectory set to false to prevent invalidating the directory.
135
151
  * Invalidation is resource-intensive and should be avoided if media or its directory is not changed.
136
152
  * @param minRole set to null to omit auer check (ie make the endpoint public)
137
- * @param cb function callback
153
+ * @param cb function callback. `body` is `{}` if the request has no JSON body.
138
154
  * @return newly added REST api path
139
155
  */
140
- mediaJsonResponse(paths: string[], minRole: UserRoles, invalidateDirectory: boolean, cb: (params: ParamsDictionary, body: IMediaRequestBody, user: UserDTO, media: MediaEntity, repository: Repository<MediaEntity>) => Promise<unknown> | unknown): string;
156
+ mediaJsonResponse<const P extends readonly string[]>(paths: ExtensionRoutePaths<P>, minRole: UserRoles, invalidateDirectory: boolean, cb: (params: ParamsDictionary, body: IMediaRequestBody, user: UserDTO, media: MediaEntity, repository: Repository<MediaEntity>) => unknown): string;
141
157
  /**
142
158
  * Sends a pigallery2 standard JSON object with payload or error message back to the client.
143
- * @param paths RESTapi path, relative to the extension base endpoint
159
+ * @param paths RESTapi paths, relative to the extension base endpoint, see {@link ExtensionRoutePath}
144
160
  * @param minRole set to null to omit auer check (ie make the endpoint public)
145
- * @param cb function callback
161
+ * @param cb function callback. `body` is `{}` if the request has no JSON body.
146
162
  * @return newly added REST api path
147
163
  */
148
- jsonResponse(paths: string[], minRole: UserRoles, cb: (params?: ParamsDictionary, body?: any, user?: UserDTO) => Promise<unknown> | unknown): string;
164
+ jsonResponse<const P extends readonly string[]>(paths: ExtensionRoutePaths<P>, minRole: UserRoles, cb: (params?: ParamsDictionary, body?: unknown, user?: UserDTO) => unknown): string;
149
165
  /**
150
- * Exposes a standard expressjs middleware
151
- * @param paths RESTapi path, relative to the extension base endpoint
166
+ * Exposes a standard expressjs (Express 5) middleware
167
+ * @param paths RESTapi paths, relative to the extension base endpoint, see {@link ExtensionRoutePath}
152
168
  * @param minRole set to null to omit auer check (ie make the endpoint public)
153
- * @param mw expressjs middleware
169
+ * @param mw expressjs middleware. `req.body` is `undefined` if the request has no JSON body.
154
170
  * @return newly added REST api path
155
171
  */
156
- rawMiddleware(paths: string[], minRole: UserRoles, mw: (req: Request, res: Response, next: NextFunction) => void | Promise<void>): string;
172
+ rawMiddleware<const P extends readonly string[]>(paths: ExtensionRoutePaths<P>, minRole: UserRoles, mw: (req: Request, res: Response, next: NextFunction) => void | Promise<void>): string;
157
173
  }
158
174
  export interface IExtensionRESTApi {
159
175
  use: IExtensionRESTRoute;
@@ -166,7 +182,7 @@ export interface IExtensionDB {
166
182
  /**
167
183
  * Returns with a typeorm SQL connection
168
184
  */
169
- getSQLConnection(): Promise<Connection>;
185
+ getSQLConnection(): Promise<DataSource>;
170
186
  /**
171
187
  * Adds SQL tables to typeorm
172
188
  * @param tables
@@ -242,7 +258,7 @@ export interface IExtensionObject<C = void> {
242
258
  */
243
259
  ui: IUIExtension<C>;
244
260
  }
245
- export interface IUIExtension<C> {
261
+ export interface IUIExtension<_C> {
246
262
  /**
247
263
  * Adds a new button on to UI to all media (photo, video).
248
264
  * Implement the server-side click action in the serverSB function.
@@ -281,3 +297,4 @@ export interface IServerExtensionConfig<C> {
281
297
  */
282
298
  initConfig(extension: IExtensionConfigInit<C>): void;
283
299
  }
300
+ export {};
@@ -1,4 +1,4 @@
1
- import { Stats } from 'fs';
1
+ import { Stats } from 'node:fs';
2
2
  import { DirectoryPathDTO, ParentDirectoryDTO } from '../../../common/entities/DirectoryDTO';
3
3
  import { FileDTO } from '../../../common/entities/FileDTO';
4
4
  export declare class DiskManager {
@@ -11,6 +11,8 @@ export declare class DiskManager {
11
11
  name: string;
12
12
  }): string;
13
13
  static dirName(dirPath: string): string;
14
+ private static globToRegex;
15
+ static excludeFile(filename: string): boolean;
14
16
  static excludeDir(dir: {
15
17
  name: string;
16
18
  parentDirRelativeName: string;
@@ -2,6 +2,10 @@ import { PhotoMetadata } from '../../../common/entities/PhotoDTO';
2
2
  import { VideoMetadata } from '../../../common/entities/VideoDTO';
3
3
  export declare class MetadataLoader {
4
4
  private static readonly EMPTY_METADATA;
5
+ /**
6
+ * True if exifr returned nothing but errors (with mergeOutput: false it reports them in an 'errors' section).
7
+ */
8
+ private static isOnlyErrors;
5
9
  static loadVideoMetadata(fullPath: string): Promise<VideoMetadata>;
6
10
  static loadPhotoMetadata(fullPath: string): Promise<PhotoMetadata>;
7
11
  private static mapMetadata;
@@ -17,4 +21,17 @@ export declare class MetadataLoader {
17
21
  private static mapRating;
18
22
  private static mapFaces;
19
23
  private static mapExifReader;
24
+ /**
25
+ * Parse Apple MakerNote IFD to extract ContentIdentifier (tag 0x0011).
26
+ *
27
+ * Apple MakerNote format:
28
+ * - Header: "Apple iOS\0" (10 bytes) + 2-byte version
29
+ * - Byte order marker: "MM" (big-endian) or "II" (little-endian)
30
+ * - Standard TIFF IFD: 2-byte entry count, then 12-byte entries
31
+ * - Each IFD entry: tag(2) + type(2) + count(4) + value/offset(4)
32
+ *
33
+ * Tag reference: ExifTool Apple.pm by Phil Harvey
34
+ * (https://github.com/exiftool/exiftool)
35
+ */
36
+ static parseAppleMakerNoteContentId(makerNote: unknown): string | undefined;
20
37
  }
@@ -1,9 +1,9 @@
1
1
  export interface TaskQueEntry<I, O> {
2
2
  data: I;
3
3
  promise: {
4
- obj: Promise<O> | null;
5
- resolve: ((ret: O) => void) | null;
6
- reject: ((err: any) => void) | null;
4
+ obj: Promise<O>;
5
+ resolve: (ret: O) => void;
6
+ reject: (err: unknown) => void;
7
7
  };
8
8
  }
9
9
  export declare class TaskQue<I, O> {
@@ -11,7 +11,7 @@ export declare class TaskQue<I, O> {
11
11
  private processing;
12
12
  isEmpty(): boolean;
13
13
  add(input: I): TaskQueEntry<I, O>;
14
- get(): TaskQueEntry<I, O>;
14
+ get(): TaskQueEntry<I, O> | undefined;
15
15
  ready(task: TaskQueEntry<I, O>): void;
16
16
  private getSameTask;
17
17
  private putNewTask;
@@ -1,4 +1,5 @@
1
- import { FFmpegPresets, videoCodecType, videoFormatType, videoResolutionType } from '../../../common/config/private/PrivateConfig';
1
+ import { FFmpegPresets } from '../../../common/config/Enums';
2
+ import { videoCodecType, videoFormatType, videoResolutionType } from '../../../common/config/private/PrivateConfig';
2
3
  export interface VideoConverterInput {
3
4
  videoPath: string;
4
5
  input: {
@@ -17,7 +18,10 @@ export interface VideoConverterInput {
17
18
  };
18
19
  }
19
20
  export declare class VideoConverterWorker {
20
- private static ffmpeg;
21
21
  static convert(input: VideoConverterInput): Promise<void>;
22
+ /**
23
+ * ffmpeg arguments in the order fluent-ffmpeg used to build them.
24
+ */
25
+ static buildArgs(input: VideoConverterInput): string[];
22
26
  private static _convert;
23
27
  }
@@ -4,12 +4,13 @@ import { PersonEntry } from '../../database/enitites/person/PersonEntry';
4
4
  import { SVGIconConfig } from '../../../../common/config/public/ClientConfig';
5
5
  export declare class PhotoProcessing {
6
6
  private static initDone;
7
- private static taskQue;
7
+ private static taskQueInstance;
8
+ private static get taskQue();
8
9
  private static readonly CONVERTED_EXTENSION;
9
10
  static init(): void;
10
11
  static generatePersonThumbnail(person: PersonEntry): Promise<string>;
11
12
  static generateConvertedPath(mediaPath: string, size: number): string;
12
- static generatePersonThumbnailPath(mediaPath: string, faceRegion: FaceRegion, size: number): string;
13
+ static generatePersonThumbnailPath(mediaPath: string, faceRegion: FaceRegion | undefined, size: number): string;
13
14
  /**
14
15
  * Tells if the path is valid with the current config
15
16
  * @param convertedPath
@@ -14,9 +14,7 @@ export declare class JobManager implements IJobListener, IObjectManager {
14
14
  protected get JobRunning(): boolean;
15
15
  protected get JobNoParallelRunning(): boolean;
16
16
  init(): Promise<void>;
17
- getProgresses(): {
18
- [id: string]: OnTimerJobProgressDTO;
19
- };
17
+ getProgresses(): Record<string, OnTimerJobProgressDTO>;
20
18
  run<T extends Record<string, unknown>>(jobName: string, config: T, soloRun: boolean, allowParallelRun: boolean): Promise<void>;
21
19
  stop(jobName: string): void;
22
20
  onProgressUpdate: (progress: JobProgress) => void;
@@ -28,7 +26,7 @@ export declare class JobManager implements IJobListener, IObjectManager {
28
26
  * Schedules all jobs to run
29
27
  */
30
28
  runSchedules(): void;
31
- protected findJob(jobName: string): IJob;
29
+ protected findJob(jobName: string): IJob | undefined;
32
30
  /**
33
31
  * Schedules a single job to run
34
32
  */
@@ -5,10 +5,12 @@ export declare class JobProgressManager {
5
5
  private readonly dbPath;
6
6
  private timer;
7
7
  constructor();
8
- get Progresses(): {
9
- [key: string]: JobProgressDTO;
10
- };
8
+ get Progresses(): Record<string, JobProgressDTO>;
11
9
  onJobProgressUpdate(progress: JobProgressDTO): void;
10
+ /**
11
+ * Writes out a pending delayed save, so it does not fire after shutdown.
12
+ */
13
+ cleanUp(): Promise<void>;
12
14
  private loadDB;
13
15
  private saveDB;
14
16
  private delayedSave;
@@ -1,9 +1,7 @@
1
1
  import { IJob } from './jobs/IJob';
2
2
  export declare class JobRepository {
3
3
  private static instance;
4
- availableJobs: {
5
- [key: string]: IJob;
6
- };
4
+ availableJobs: Record<string, IJob>;
7
5
  static get Instance(): JobRepository;
8
6
  getAvailableJobs(): IJob[];
9
7
  register(job: IJob): void;
@@ -7,7 +7,7 @@ export declare class AlbumCoverFillingJob extends Job {
7
7
  id: number;
8
8
  name: string;
9
9
  path: string;
10
- }[];
10
+ }[] | null;
11
11
  status: 'Persons' | 'Albums' | 'Directory';
12
12
  private availableSessions;
13
13
  get LOG_TAG(): string;
@@ -2,6 +2,6 @@ import { JobProgress } from './JobProgress';
2
2
  import { IJob } from './IJob';
3
3
  import { JobProgressStates } from '../../../../common/entities/job/JobProgressDTO';
4
4
  export interface IJobListener {
5
- onJobFinished(job: IJob, state: JobProgressStates, soloRun: boolean): void;
6
- onProgressUpdate(progress: JobProgress): void;
5
+ onJobFinished(job: IJob, state: JobProgressStates, soloRun: boolean): Promise<void>;
6
+ onProgressUpdate: (progress: JobProgress) => void;
7
7
  }
@@ -5,7 +5,7 @@ import { IJobListener } from './IJobListener';
5
5
  import { DynamicConfig } from '../../../../common/entities/DynamicConfig';
6
6
  export declare abstract class Job<T extends Record<string, unknown> = Record<string, unknown>> implements IJob<T> {
7
7
  allowParallelRun: boolean;
8
- protected progress: JobProgress;
8
+ protected progress: JobProgress | null;
9
9
  protected config: T;
10
10
  protected prResolve: () => void;
11
11
  protected IsInstant: boolean;
@@ -16,6 +16,9 @@ export declare abstract class Job<T extends Record<string, unknown> = Record<str
16
16
  abstract get Supported(): boolean;
17
17
  abstract get Name(): string;
18
18
  abstract get ConfigTemplate(): DynamicConfig[];
19
+ /**
20
+ * The progress of the running job (between start() and the end of the run).
21
+ */
19
22
  get Progress(): JobProgress;
20
23
  get InProgress(): boolean;
21
24
  start(config: T, soloRun?: boolean, allowParallelRun?: boolean): Promise<void>;
@@ -14,5 +14,5 @@ export declare class EmailMessenger extends Messenger<{
14
14
  emailTo: string;
15
15
  emailSubject: string;
16
16
  emailText: string;
17
- }, media: MediaDTOWithThPath[]): Promise<any>;
17
+ }, media: MediaDTOWithThPath[]): Promise<void>;
18
18
  }
@@ -6,9 +6,8 @@ export interface MediaDTOWithThPath extends MediaDTO {
6
6
  }
7
7
  export declare abstract class Messenger<C extends Record<string, unknown> = Record<string, unknown>> {
8
8
  abstract get Name(): string;
9
- protected config: C;
10
9
  readonly ConfigTemplate: DynamicConfig[];
11
10
  private getThumbnail;
12
- send(config: C, input: string | MediaDTO[] | unknown): Promise<void>;
11
+ send(config: C, input: unknown): Promise<void>;
13
12
  protected abstract sendMedia(config: C, media: MediaDTOWithThPath[]): Promise<void>;
14
13
  }
@@ -1,9 +1,7 @@
1
1
  import { Messenger } from './Messenger';
2
2
  export declare class MessengerRepository {
3
3
  private static instance;
4
- messengers: {
5
- [key: string]: Messenger;
6
- };
4
+ messengers: Record<string, Messenger>;
7
5
  static get Instance(): MessengerRepository;
8
6
  getAll(): Messenger[];
9
7
  remove(m: {
@@ -1,6 +1,7 @@
1
1
  import { Express } from 'express';
2
2
  export declare class ErrorRouter {
3
3
  static route(app: Express): void;
4
+ private static addApiNotFound;
4
5
  private static addApiErrorHandler;
5
6
  private static addGenericHandler;
6
7
  }
@@ -1,6 +1,14 @@
1
1
  import { Express } from 'express';
2
2
  export declare class GalleryRouter {
3
3
  static route(app: Express): void;
4
+ /**
5
+ * Path of a media file route: `<apiPath>/gallery/content/<mediaPath>.<format><suffix>`.
6
+ * Express 5 (path-to-regexp 8) has no regex params, so it is a RegExp; its named groups become the params.
7
+ * As before, the format is case-insensitive and mediaPath is decoded as a whole (`%2F` is a '/').
8
+ * @param formats file extensions without the dot
9
+ * @param suffix RegExp source after the file name (e.g. '/icon')
10
+ */
11
+ private static mediaRoute;
4
12
  protected static addDirectoryList(app: Express): void;
5
13
  protected static addDirectoryZip(app: Express): void;
6
14
  protected static addGetImage(app: Express): void;
@@ -3,15 +3,12 @@ import { ServerTimeEntry } from '../middlewares/ServerTimingMWs';
3
3
  declare global {
4
4
  namespace Express {
5
5
  interface Request {
6
- locale?: string;
7
6
  localePath?: string;
8
- tpl?: Record<string, any>;
9
- timing?: {
10
- [key: string]: ServerTimeEntry;
11
- };
7
+ tpl?: Record<string, unknown>;
8
+ timing?: Record<string, ServerTimeEntry>;
12
9
  }
13
10
  interface Response {
14
- tpl?: Record<string, any>;
11
+ tpl?: Record<string, unknown>;
15
12
  }
16
13
  }
17
14
  }
@@ -7,7 +7,7 @@ export declare class SharingRouter {
7
7
  * @param app
8
8
  * @private
9
9
  */
10
- private static addGetSharingKey;
10
+ private static addGetSharingPublicInfo;
11
11
  private static addGetSharing;
12
12
  private static addCreateSharing;
13
13
  private static addUpdateSharing;
@@ -9,4 +9,5 @@ export declare class UserRouter {
9
9
  private static addListUsers;
10
10
  private static addChangeRole;
11
11
  private static addChangeSettings;
12
+ private static addUnlinkOidc;
12
13
  }
@@ -1,11 +1,11 @@
1
- import * as express from 'express';
2
- import { Server as HttpServer } from 'http';
1
+ import express from 'express';
2
+ import { Server as HttpServer } from 'node:http';
3
3
  import { Event } from '../common/event/Event';
4
4
  export declare class Server {
5
5
  onStarted: Event<void>;
6
6
  app: express.Express;
7
7
  private server;
8
- static instance: Server;
8
+ static instance: Server | null;
9
9
  static getInstance(): Server;
10
10
  constructor(listen?: boolean);
11
11
  get Server(): HttpServer;
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * This version indicates that the sql/entities/*Entity.ts files got changed and the db needs to be recreated
3
3
  */
4
- export declare const DataStructureVersion = 41;
4
+ export declare const DataStructureVersion = 47;
@@ -34,7 +34,7 @@ export declare class SearchQueryParser {
34
34
  private keywords;
35
35
  constructor(keywords?: QueryKeywords);
36
36
  static stringifyText(text: string, matchType?: TextSearchQueryMatchTypes): string;
37
- static stringifyDate(time: number): string;
37
+ static stringifyDate(time?: number): string | null;
38
38
  static humanToRegexpStr(str: string): string;
39
39
  /**
40
40
  * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
@@ -43,6 +43,6 @@ export declare class SearchQueryParser {
43
43
  */
44
44
  private static parseDate;
45
45
  parse(str: string, implicitAND?: boolean): SearchQueryDTO;
46
- stringify(query: SearchQueryDTO): string;
46
+ stringify(query: SearchQueryDTO | null | undefined): string;
47
47
  private stringifyOneEntry;
48
48
  }
@@ -1,20 +1,87 @@
1
- import { SearchQueryDTO } from './entities/SearchQueryDTO';
1
+ import { DirectorySearch, SearchQueryDTO, SearchQueryTypes } from './entities/SearchQueryDTO';
2
2
  export declare const SearchQueryUtils: {
3
3
  negate: (query: SearchQueryDTO) => SearchQueryDTO;
4
4
  sortQuery(queryIN: SearchQueryDTO): SearchQueryDTO;
5
5
  stringifyForComparison(queryIN: SearchQueryDTO): string;
6
- isQueryEmpty(query: SearchQueryDTO): boolean;
7
- stripDefault: (val: any) => any;
6
+ isQueryEmpty(query: SearchQueryDTO | null | undefined): boolean;
7
+ stripDefault: <T>(val: T) => T;
8
+ /**
9
+ * False if a part of the query has a type that this version does not know, e.g. a hand-edited or outdated search link.
10
+ */
11
+ isKnownQuery: (query: SearchQueryDTO) => boolean;
8
12
  validateSearchQuery: (query: SearchQueryDTO, what?: string) => void;
13
+ /**
14
+ * Validates a directory allow / block list.
15
+ * Every entry has to be a directory TextSearch (type: SearchQueryTypes.directory).
16
+ */
17
+ validateDirectoryList: (list: DirectorySearch[] | null | undefined, what?: string) => void;
18
+ /**
19
+ * Validates that the query is a single directory TextSearch (type: SearchQueryTypes.directory).
20
+ */
21
+ validateDirectorySearch: (d: DirectorySearch, what?: string) => void;
22
+ /**
23
+ * Normalizes a relative directory path for matching:
24
+ * '/' separators, no leading './' or '/', no trailing '/'. Root is ''.
25
+ */
26
+ normalizeDirectoryPath: (dirPath: string) => string;
27
+ /**
28
+ * The directory path as the directory searches compare it: normalized, lower case and with runs of spaces collapsed
29
+ * (the SQL search collapses them too, see SearchManager; a double space in a name is usually a typo #1309).
30
+ * @param foldAccents also removes the accents, where the SQL search ignores them (see sqlIgnoresAccents of the backend)
31
+ */
32
+ comparableDirectoryPath: (dirPath: string, foldAccents?: boolean) => string;
33
+ /**
34
+ * Matches a relative directory path against a directory search, without any DB access.
35
+ * It follows the semantic of the SQL directory search (see SearchManager):
36
+ * - exact_match: the path equals to the value
37
+ * - like (default): the path contains the value
38
+ * - globMatch: the whole path matches the glob (* matches any characters, including '/', ? matches one character)
39
+ * A trailing '/*' means the directory itself and everything below it (e.g.: 'a/*' matches 'a', 'a/b', 'a/b/c').
40
+ * Use '/?*' to match only below a directory.
41
+ * Matching is case-insensitive, and ignores the accents with foldAccents.
42
+ */
43
+ matchDirectorySearch: (dirPath: string, search: DirectorySearch, foldAccents?: boolean) => boolean;
44
+ /**
45
+ * Returns the fixed path segments at the beginning of a directory search, that every match starts with.
46
+ * E.g.: exact 'a/b' -> ['a', 'b'], glob 'a/b/*' -> ['a', 'b'], glob 'a/b*' -> ['a'].
47
+ * Returns null if the matches can be anywhere (like and negated searches).
48
+ */
49
+ getDirectorySearchAnchor: (search: DirectorySearch, foldAccents?: boolean) => string[] | null;
50
+ /**
51
+ * True if all matches of the search can be found from its path alone: exact match, or a glob that has no wildcard
52
+ * other than a trailing '/*'. For other searches, the parents of the matching directories can only be found in the DB.
53
+ */
54
+ isDirectorySearchAnchored: (search: DirectorySearch) => boolean;
55
+ /**
56
+ * Returns true if the directory is a parent of the fixed part of any entry of the list.
57
+ * These parents are known from the path alone, without DB access.
58
+ * For globs it can be true for a directory that also matches the entry itself (e.g.: 'a' for 'a/*'),
59
+ * so check if the directory is allowed first.
60
+ */
61
+ isDirectoryAnchoredParent: (dirPath: string, list: DirectorySearch[], foldAccents?: boolean) => boolean;
62
+ /**
63
+ * Returns true if the directory matches any entry of the list.
64
+ */
65
+ matchDirectoryList: (dirPath: string, list: DirectorySearch[], foldAccents?: boolean) => boolean;
66
+ /**
67
+ * Converts a directory allow / block list to a single search query.
68
+ * A directory matches the list if it matches any of its entries.
69
+ * Returns null for an empty list.
70
+ */
71
+ directoryListToQuery: (list: DirectorySearch[]) => SearchQueryDTO | null;
9
72
  URLMap: Record<string, string>;
10
73
  /**
11
74
  * Make the SearchQuery URL friendly and shorter
12
75
  * @param query
13
76
  */
14
77
  urlify: (query: SearchQueryDTO) => string;
78
+ /**
79
+ * The urlified exact match text search (e.g. for a keyword, a person or a place link)
80
+ */
81
+ urlifyExactMatch: (type: SearchQueryTypes, value: string) => string;
15
82
  /**
16
83
  * Pareses the shortened urls and returns with the original SearchQueryDTO
17
84
  * @param urlQuery
18
85
  */
19
- parseURLifiedQuery: (urlQuery: string) => SearchQueryDTO;
86
+ parseURLifiedQuery: (urlQuery: string) => SearchQueryDTO | null;
20
87
  };