@jwilleke/ngdpbase-types 0.0.0 → 5.18.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.
Files changed (302) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +16 -2
  3. package/lib/packages/ngdpbase-types/index.d.ts +32 -0
  4. package/lib/packages/ngdpbase-types/testing.d.ts +43 -0
  5. package/lib/packages/ngdpbase-types/testing.js +53 -0
  6. package/lib/src/cache/CacheDependencies.d.ts +50 -0
  7. package/lib/src/cache/CacheDependencies.js +50 -0
  8. package/lib/src/cache/ICacheAdapter.d.ts +86 -0
  9. package/lib/src/cache/RegionCache.d.ts +171 -0
  10. package/lib/src/context/ActorContext.d.ts +48 -0
  11. package/lib/src/context/ActorContext.js +33 -0
  12. package/lib/src/context/ApiContext.d.ts +194 -0
  13. package/lib/src/context/ApiContext.js +273 -0
  14. package/lib/src/context/BaseContext.d.ts +110 -0
  15. package/lib/src/context/BaseContext.js +143 -0
  16. package/lib/src/context/JobContext.d.ts +153 -0
  17. package/lib/src/context/JobContext.js +144 -0
  18. package/lib/src/context/WikiContext.d.ts +404 -0
  19. package/lib/src/context/bootActions.d.ts +64 -0
  20. package/lib/src/context/bootActions.js +111 -0
  21. package/lib/src/converters/HtmlConverter.d.ts +70 -0
  22. package/lib/src/converters/IContentConverter.d.ts +94 -0
  23. package/lib/src/converters/JSPWikiConverter.d.ts +117 -0
  24. package/lib/src/converters/conversionWarning.d.ts +15 -0
  25. package/lib/src/converters/ncm/bridge.d.ts +22 -0
  26. package/lib/src/converters/ncm/existing.d.ts +23 -0
  27. package/lib/src/converters/ncm/fix/blocks.d.ts +89 -0
  28. package/lib/src/converters/ncm/fix/bulletMarkers.d.ts +21 -0
  29. package/lib/src/converters/ncm/fix/index.d.ts +36 -0
  30. package/lib/src/converters/ncm/fix/jspwikiBullets.d.ts +20 -0
  31. package/lib/src/converters/ncm/fix/jspwikiCodeMarkers.d.ts +38 -0
  32. package/lib/src/converters/ncm/fix/jspwikiHeadings.d.ts +25 -0
  33. package/lib/src/converters/ncm/fix/jspwikiIndent.d.ts +24 -0
  34. package/lib/src/converters/ncm/fix/jspwikiInsert.d.ts +21 -0
  35. package/lib/src/converters/ncm/fix/jspwikiItalic.d.ts +29 -0
  36. package/lib/src/converters/ncm/fix/jspwikiLinkLeftovers.d.ts +27 -0
  37. package/lib/src/converters/ncm/fix/moreInformationFooter.d.ts +25 -0
  38. package/lib/src/converters/ncm/fix/styleClosers.d.ts +25 -0
  39. package/lib/src/converters/ncm/fix/tightenLists.d.ts +30 -0
  40. package/lib/src/converters/ncm/fix/types.d.ts +33 -0
  41. package/lib/src/converters/ncm/footnotes.d.ts +39 -0
  42. package/lib/src/converters/ncm/images.d.ts +49 -0
  43. package/lib/src/converters/ncm/index.d.ts +20 -0
  44. package/lib/src/converters/ncm/links.d.ts +21 -0
  45. package/lib/src/converters/ncm/normalize.d.ts +39 -0
  46. package/lib/src/converters/ncm/placeholder.d.ts +25 -0
  47. package/lib/src/converters/ncm/tables.d.ts +36 -0
  48. package/lib/src/converters/ncm/types.d.ts +42 -0
  49. package/lib/src/http/egressPolicy.d.ts +52 -0
  50. package/lib/src/http/guardedFetch.d.ts +89 -0
  51. package/lib/src/http/guardedFetch.js +113 -0
  52. package/lib/src/http/guardedLookup.d.ts +48 -0
  53. package/lib/src/http/guardedLookup.js +73 -0
  54. package/lib/src/http/ssrf.d.ts +83 -0
  55. package/lib/src/http/ssrf.js +311 -0
  56. package/lib/src/mail/MailProvider.d.ts +36 -0
  57. package/lib/src/mail/NodemailerMailProvider.d.ts +26 -0
  58. package/lib/src/managers/AddonsManager.d.ts +691 -0
  59. package/lib/src/managers/AgentTokenManager.d.ts +269 -0
  60. package/lib/src/managers/AssetManager.d.ts +116 -0
  61. package/lib/src/managers/AttachmentManager.d.ts +1032 -0
  62. package/lib/src/managers/AuthManager.d.ts +1257 -0
  63. package/lib/src/managers/BackgroundJobManager.d.ts +434 -0
  64. package/lib/src/managers/BaseManager.d.ts +391 -0
  65. package/lib/src/managers/BaseManager.js +415 -0
  66. package/lib/src/managers/CacheManager.d.ts +159 -0
  67. package/lib/src/managers/CatalogManager.d.ts +235 -0
  68. package/lib/src/managers/CommentManager.d.ts +75 -0
  69. package/lib/src/managers/ConfigurationManager.d.ts +747 -0
  70. package/lib/src/managers/DatabaseManager.d.ts +89 -0
  71. package/lib/src/managers/DatabaseManager.js +236 -0
  72. package/lib/src/managers/EmailManager.d.ts +47 -0
  73. package/lib/src/managers/ExportManager.d.ts +129 -0
  74. package/lib/src/managers/ExportManager.js +420 -0
  75. package/lib/src/managers/FootnoteManager.d.ts +118 -0
  76. package/lib/src/managers/MediaManager.d.ts +279 -0
  77. package/lib/src/managers/MetricsManager.d.ts +89 -0
  78. package/lib/src/managers/NotificationManager.d.ts +165 -0
  79. package/lib/src/managers/OidcManager.d.ts +210 -0
  80. package/lib/src/managers/OrganizationManager.d.ts +107 -0
  81. package/lib/src/managers/PageManager.d.ts +1645 -0
  82. package/lib/src/managers/PersonManager.d.ts +48 -0
  83. package/lib/src/managers/PluginManager.d.ts +179 -0
  84. package/lib/src/managers/PluginManager.js +393 -0
  85. package/lib/src/managers/PolicyEvaluator.d.ts +213 -0
  86. package/lib/src/managers/RenderingManager.d.ts +358 -0
  87. package/lib/src/managers/RoleManager.d.ts +134 -0
  88. package/lib/src/managers/SearchManager.d.ts +402 -0
  89. package/lib/src/managers/ShareManager.d.ts +251 -0
  90. package/lib/src/managers/TemplateManager.d.ts +176 -0
  91. package/lib/src/managers/ThemeManager.d.ts +56 -0
  92. package/lib/src/managers/UserManager.d.ts +480 -0
  93. package/lib/src/managers/ValidationManager.d.ts +426 -0
  94. package/lib/src/managers/VariableManager.d.ts +145 -0
  95. package/lib/src/middleware/csrf.d.ts +3 -0
  96. package/lib/src/parsers/LinkParser.d.ts +457 -0
  97. package/lib/src/parsers/MarkupParser.d.ts +769 -0
  98. package/lib/src/parsers/context/ParseContext.d.ts +314 -0
  99. package/lib/src/parsers/data/emoji-map.d.ts +18 -0
  100. package/lib/src/parsers/dom/DOMBuilder.d.ts +210 -0
  101. package/lib/src/parsers/dom/DOMParser.d.ts +252 -0
  102. package/lib/src/parsers/dom/Tokenizer.d.ts +358 -0
  103. package/lib/src/parsers/dom/WikiDocument.d.ts +272 -0
  104. package/lib/src/parsers/dom/handlers/DOMLinkHandler.d.ts +260 -0
  105. package/lib/src/parsers/dom/handlers/DOMPluginHandler.d.ts +212 -0
  106. package/lib/src/parsers/dom/handlers/DOMVariableHandler.d.ts +171 -0
  107. package/lib/src/parsers/filters/BaseFilter.d.ts +269 -0
  108. package/lib/src/parsers/filters/FilterChain.d.ts +320 -0
  109. package/lib/src/parsers/handlers/BaseSyntaxHandler.d.ts +331 -0
  110. package/lib/src/parsers/handlers/HandlerRegistry.d.ts +225 -0
  111. package/lib/src/parsers/handlers/JSPWikiPreprocessor.d.ts +89 -0
  112. package/lib/src/parsers/handlers/LinkParserHandler.d.ts +80 -0
  113. package/lib/src/parsers/handlers/PluginSyntaxHandler.d.ts +78 -0
  114. package/lib/src/parsers/handlers/WikiFormHandler.d.ts +149 -0
  115. package/lib/src/parsers/handlers/WikiTagHandler.d.ts +125 -0
  116. package/lib/src/parsers/jspwikiTableRow.d.ts +39 -0
  117. package/lib/src/parsers/styleBlockSyntax.d.ts +14 -0
  118. package/lib/src/plugins/types.d.ts +79 -0
  119. package/lib/src/providers/AgentTokenAuthProvider.d.ts +40 -0
  120. package/lib/src/providers/AuthentikBearerAuthProvider.d.ts +75 -0
  121. package/lib/src/providers/BaseAttachmentProvider.d.ts +197 -0
  122. package/lib/src/providers/BaseAuthProvider.d.ts +220 -0
  123. package/lib/src/providers/BaseCacheProvider.d.ts +140 -0
  124. package/lib/src/providers/BaseCredentialsProvider.d.ts +84 -0
  125. package/lib/src/providers/BaseDatabaseProvider.d.ts +22 -0
  126. package/lib/src/providers/BaseDatabaseProvider.js +12 -0
  127. package/lib/src/providers/BaseLoggingProvider.d.ts +68 -0
  128. package/lib/src/providers/BaseLoggingProvider.js +37 -0
  129. package/lib/src/providers/BaseMediaProvider.d.ts +308 -0
  130. package/lib/src/providers/BasePageProvider.d.ts +337 -0
  131. package/lib/src/providers/BaseProvider.d.ts +98 -0
  132. package/lib/src/providers/BaseProvider.js +74 -0
  133. package/lib/src/providers/BaseSearchProvider.d.ts +362 -0
  134. package/lib/src/providers/BasicAttachmentProvider.d.ts +599 -0
  135. package/lib/src/providers/CloudflareAccessAuthProvider.d.ts +72 -0
  136. package/lib/src/providers/FileCredentialsProvider.d.ts +33 -0
  137. package/lib/src/providers/FileJobStateProvider.d.ts +58 -0
  138. package/lib/src/providers/FileLoggingProvider.d.ts +43 -0
  139. package/lib/src/providers/FileLoggingProvider.js +120 -0
  140. package/lib/src/providers/FileOidcAdapter.d.ts +25 -0
  141. package/lib/src/providers/FileSystemMediaProvider.d.ts +403 -0
  142. package/lib/src/providers/LunrSearchProvider.d.ts +280 -0
  143. package/lib/src/providers/MagicLinkAuthProvider.d.ts +125 -0
  144. package/lib/src/providers/NullCacheProvider.d.ts +72 -0
  145. package/lib/src/providers/OidcAuthProvider.d.ts +180 -0
  146. package/lib/src/providers/OidcBearerAuthProvider.d.ts +30 -0
  147. package/lib/src/providers/PasskeyAuthProvider.d.ts +58 -0
  148. package/lib/src/providers/PasswordAuthProvider.d.ts +20 -0
  149. package/lib/src/providers/SqliteDatabaseProvider.d.ts +55 -0
  150. package/lib/src/providers/SqliteDatabaseProvider.js +90 -0
  151. package/lib/src/providers/SqliteJobStateProvider.d.ts +41 -0
  152. package/lib/src/providers/databaseMigrations.d.ts +8 -0
  153. package/lib/src/providers/databaseMigrations.js +47 -0
  154. package/lib/src/providers/jobState.d.ts +99 -0
  155. package/lib/src/providers/lunrQueryToMiniSearch.d.ts +32 -0
  156. package/lib/src/providers/mediaFilenameDate.d.ts +22 -0
  157. package/lib/src/providers/sqliteLocation.d.ts +17 -0
  158. package/lib/src/providers/sqliteLocation.js +55 -0
  159. package/lib/src/providers/sqliteMigrations.d.ts +48 -0
  160. package/lib/src/providers/sqliteMigrations.js +72 -0
  161. package/lib/src/rendering/githubAlerts.d.ts +22 -0
  162. package/lib/src/rendering/htmlPolicy.d.ts +76 -0
  163. package/lib/src/rendering/markdownConverter.d.ts +73 -0
  164. package/lib/src/security/PolicyDecisionPoint.d.ts +245 -0
  165. package/lib/src/security/PolicyInformationPoint.d.ts +448 -0
  166. package/lib/src/security/pageActions.d.ts +40 -0
  167. package/lib/src/security/permissions.generated.d.ts +78 -0
  168. package/lib/src/types/Asset.d.ts +414 -0
  169. package/lib/src/types/Catalog.d.ts +61 -0
  170. package/lib/src/types/Comment.d.ts +11 -0
  171. package/lib/src/types/Config.d.ts +388 -0
  172. package/lib/src/types/Organization.d.ts +78 -0
  173. package/lib/src/types/OrganizationProvider.d.ts +38 -0
  174. package/lib/src/types/Page.d.ts +220 -0
  175. package/lib/src/types/Person.d.ts +56 -0
  176. package/lib/src/types/PersonProvider.d.ts +25 -0
  177. package/lib/src/types/Policy.d.ts +139 -0
  178. package/lib/src/types/Policy.js +17 -0
  179. package/lib/src/types/Provider.d.ts +810 -0
  180. package/lib/src/types/Role.d.ts +84 -0
  181. package/lib/src/types/RoleProvider.d.ts +35 -0
  182. package/lib/src/types/Schema.d.ts +425 -0
  183. package/lib/src/types/Share.d.ts +172 -0
  184. package/lib/src/types/Share.js +81 -0
  185. package/lib/src/types/User.d.ts +304 -0
  186. package/lib/src/types/Version.d.ts +189 -0
  187. package/lib/src/types/WikiEngine.d.ts +128 -0
  188. package/lib/src/types/express.d.ts +120 -0
  189. package/lib/src/types/express.js +1 -0
  190. package/lib/src/types/guards.d.ts +78 -0
  191. package/lib/src/types/heic-decode.d.ts +16 -0
  192. package/lib/src/types/index.d.ts +19 -0
  193. package/lib/src/types/linkedom.d.ts +77 -0
  194. package/lib/src/types/markdown-it-plugins.d.ts +21 -0
  195. package/lib/src/utils/DeltaStorage.d.ts +118 -0
  196. package/lib/src/utils/LocaleUtils.d.ts +105 -0
  197. package/lib/src/utils/LocaleUtils.js +294 -0
  198. package/lib/src/utils/PageNameMatcher.d.ts +98 -0
  199. package/lib/src/utils/PathPreflight.d.ts +38 -0
  200. package/lib/src/utils/PathPreflight.js +50 -0
  201. package/lib/src/utils/SectionUtils.d.ts +40 -0
  202. package/lib/src/utils/addonConfigLayer.d.ts +144 -0
  203. package/lib/src/utils/addonConfigLayer.js +382 -0
  204. package/lib/src/utils/addonDatabaseRules.d.ts +25 -0
  205. package/lib/src/utils/addonDatabaseRules.js +57 -0
  206. package/lib/src/utils/addonHost.d.ts +51 -0
  207. package/lib/src/utils/addonHost.js +72 -0
  208. package/lib/src/utils/addonInstaller.d.ts +109 -0
  209. package/lib/src/utils/addonLock.d.ts +37 -0
  210. package/lib/src/utils/addonLock.js +48 -0
  211. package/lib/src/utils/addonPageSync.d.ts +45 -0
  212. package/lib/src/utils/addonProvenance.d.ts +48 -0
  213. package/lib/src/utils/addonTarball.d.ts +41 -0
  214. package/lib/src/utils/addonsPathResolver.d.ts +76 -0
  215. package/lib/src/utils/addonsPathResolver.js +129 -0
  216. package/lib/src/utils/assetMetadataTags.d.ts +66 -0
  217. package/lib/src/utils/atomicWrite.d.ts +28 -0
  218. package/lib/src/utils/auditConfigChange.d.ts +57 -0
  219. package/lib/src/utils/auditEventNames.d.ts +50 -0
  220. package/lib/src/utils/auditEventNames.generated.d.ts +163 -0
  221. package/lib/src/utils/auditEventNames.generated.js +168 -0
  222. package/lib/src/utils/auditEventNames.js +49 -0
  223. package/lib/src/utils/auditEvents.d.ts +265 -0
  224. package/lib/src/utils/auditEvents.js +309 -0
  225. package/lib/src/utils/auditRegistry.d.ts +102 -0
  226. package/lib/src/utils/auditRegistry.js +168 -0
  227. package/lib/src/utils/bip39English.d.ts +2 -0
  228. package/lib/src/utils/configEnvKeys.d.ts +68 -0
  229. package/lib/src/utils/configFiles.d.ts +74 -0
  230. package/lib/src/utils/configFiles.js +150 -0
  231. package/lib/src/utils/delegation.d.ts +48 -0
  232. package/lib/src/utils/deriveUsername.d.ts +21 -0
  233. package/lib/src/utils/explainMediaPath.d.ts +123 -0
  234. package/lib/src/utils/formerTitles.d.ts +69 -0
  235. package/lib/src/utils/frontmatterAccess.d.ts +54 -0
  236. package/lib/src/utils/headlessAdminPassword.d.ts +55 -0
  237. package/lib/src/utils/imageTransform.d.ts +52 -0
  238. package/lib/src/utils/instanceEnvSecret.d.ts +51 -0
  239. package/lib/src/utils/jobSlots.d.ts +43 -0
  240. package/lib/src/utils/keywordNormalizer.d.ts +127 -0
  241. package/lib/src/utils/logger.d.ts +70 -0
  242. package/lib/src/utils/logger.js +106 -0
  243. package/lib/src/utils/magicLinkDeviceState.d.ts +95 -0
  244. package/lib/src/utils/managerUtils.d.ts +40 -0
  245. package/lib/src/utils/migrateLegacyPrivateAttachments.d.ts +15 -0
  246. package/lib/src/utils/orgFilename.d.ts +22 -0
  247. package/lib/src/utils/pageFeature.d.ts +27 -0
  248. package/lib/src/utils/pageFrontmatter.d.ts +21 -0
  249. package/lib/src/utils/pageNotes.d.ts +150 -0
  250. package/lib/src/utils/pageTitleRule.d.ts +37 -0
  251. package/lib/src/utils/pageToArticle.d.ts +59 -0
  252. package/lib/src/utils/pageUrl.d.ts +18 -0
  253. package/lib/src/utils/passwordChange.d.ts +12 -0
  254. package/lib/src/utils/passwordHash.d.ts +60 -0
  255. package/lib/src/utils/permissionCatalog.d.ts +52 -0
  256. package/lib/src/utils/pluginFormatters.d.ts +452 -0
  257. package/lib/src/utils/pluginFormatters.js +714 -0
  258. package/lib/src/utils/privateLinkRewrite.d.ts +42 -0
  259. package/lib/src/utils/privateStoreAccess.d.ts +57 -0
  260. package/lib/src/utils/privateStoreAccess.js +65 -0
  261. package/lib/src/utils/privateStoreCatalogs.d.ts +40 -0
  262. package/lib/src/utils/privateStoreCrypto.d.ts +127 -0
  263. package/lib/src/utils/privateStoreDoor.d.ts +181 -0
  264. package/lib/src/utils/privateStoreExport.d.ts +72 -0
  265. package/lib/src/utils/privateStoreFiles.d.ts +120 -0
  266. package/lib/src/utils/privateStoreMeta.d.ts +64 -0
  267. package/lib/src/utils/privateStoreMigrations.d.ts +37 -0
  268. package/lib/src/utils/privateStorePath.d.ts +259 -0
  269. package/lib/src/utils/privateStorePath.js +436 -0
  270. package/lib/src/utils/privateStoreTakeout.d.ts +76 -0
  271. package/lib/src/utils/privateStoreUnlock.d.ts +175 -0
  272. package/lib/src/utils/proxyClaim.d.ts +59 -0
  273. package/lib/src/utils/proxyClaim.js +30 -0
  274. package/lib/src/utils/redactPrivateNames.d.ts +21 -0
  275. package/lib/src/utils/redactPrivateNames.js +89 -0
  276. package/lib/src/utils/redactSecrets.d.ts +58 -0
  277. package/lib/src/utils/redactSecrets.js +171 -0
  278. package/lib/src/utils/renameLinkRewrite.d.ts +112 -0
  279. package/lib/src/utils/roleGrants.d.ts +35 -0
  280. package/lib/src/utils/safeRedirect.d.ts +32 -0
  281. package/lib/src/utils/schedule.d.ts +54 -0
  282. package/lib/src/utils/secretFileMode.d.ts +17 -0
  283. package/lib/src/utils/seededShippedPages.d.ts +45 -0
  284. package/lib/src/utils/sensitiveValues.d.ts +59 -0
  285. package/lib/src/utils/sensitiveValues.js +106 -0
  286. package/lib/src/utils/sessionEnd.d.ts +12 -0
  287. package/lib/src/utils/sessionGeneration.d.ts +24 -0
  288. package/lib/src/utils/sessionIdle.d.ts +41 -0
  289. package/lib/src/utils/sessionLimits.d.ts +68 -0
  290. package/lib/src/utils/shareLockbox.d.ts +64 -0
  291. package/lib/src/utils/sigstoreTrustedRoot.d.ts +33 -0
  292. package/lib/src/utils/sniffMime.d.ts +21 -0
  293. package/lib/src/utils/storeSearchIndex.d.ts +75 -0
  294. package/lib/src/utils/subjectMayDo.d.ts +21 -0
  295. package/lib/src/utils/systemCategoryRules.d.ts +30 -0
  296. package/lib/src/utils/systemCategoryRules.js +41 -0
  297. package/lib/src/utils/userCreateError.d.ts +62 -0
  298. package/lib/src/utils/username.d.ts +53 -0
  299. package/lib/src/utils/vaultUrlRewrite.d.ts +27 -0
  300. package/lib/src/utils/version.d.ts +84 -0
  301. package/lib/src/utils/videoFrame.d.ts +21 -0
  302. package/package.json +54 -3
@@ -0,0 +1,225 @@
1
+ /**
2
+ * HandlerRegistry - Advanced handler registration and management system
3
+ *
4
+ * Provides sophisticated handler registration with priority management,
5
+ * conflict detection, dependency resolution, and dynamic loading capabilities.
6
+ *
7
+ * Related Issue: #56 - Handler Registration and Priority System
8
+ * Epic: #41 - Implement JSPWikiMarkupParser for Complete Enhancement Support
9
+ */
10
+ import BaseSyntaxHandler from './BaseSyntaxHandler.js';
11
+ import type { DependencySpec } from './BaseSyntaxHandler.js';
12
+ export type { DependencySpec };
13
+ /**
14
+ * Handler registry configuration
15
+ */
16
+ export interface RegistryConfig {
17
+ maxHandlers: number;
18
+ allowDuplicatePriorities: boolean;
19
+ enableDependencyResolution: boolean;
20
+ enableConflictDetection: boolean;
21
+ defaultTimeout: number;
22
+ }
23
+ /**
24
+ * Handler registry statistics
25
+ */
26
+ export interface RegistryStats {
27
+ registeredHandlers: number;
28
+ activeHandlers: number;
29
+ totalExecutions: number;
30
+ totalErrors: number;
31
+ lastRegistration: Date | null;
32
+ lastUnregistration: Date | null;
33
+ }
34
+ /**
35
+ * Handler registration options
36
+ */
37
+ export interface RegistrationOptions {
38
+ forceRegister?: boolean;
39
+ [key: string]: unknown;
40
+ }
41
+ /**
42
+ * Initialization context for handlers
43
+ */
44
+ export interface HandlerInitContext {
45
+ engine: WikiEngine | undefined;
46
+ handlerRegistry: HandlerRegistry;
47
+ registrationOptions: RegistrationOptions;
48
+ }
49
+ /**
50
+ * WikiEngine minimal interface (until fully typed)
51
+ */
52
+ export interface WikiEngine {
53
+ getManager(name: string): unknown;
54
+ }
55
+ /**
56
+ * Dependency validation error
57
+ */
58
+ export interface DependencyValidationError {
59
+ handlerId: string;
60
+ dependencyType: 'handler' | 'manager';
61
+ dependencyName: string;
62
+ error: string;
63
+ }
64
+ /**
65
+ * Exported registry state
66
+ */
67
+ export interface ExportedRegistryState {
68
+ config: RegistryConfig;
69
+ stats: RegistryStats;
70
+ handlers: unknown[];
71
+ dependencies: Record<string, string[]>;
72
+ }
73
+ /**
74
+ * Registry information summary
75
+ */
76
+ export interface RegistryInfo {
77
+ handlerCount: number;
78
+ activeHandlerCount: number;
79
+ config: RegistryConfig;
80
+ stats: RegistryStats;
81
+ }
82
+ /**
83
+ * Extended registry statistics with handler details
84
+ */
85
+ export interface ExtendedRegistryStats {
86
+ registry: RegistryStats & {
87
+ enabledHandlers: number;
88
+ disabledHandlers: number;
89
+ totalHandlers: number;
90
+ };
91
+ handlers: Record<string, unknown>;
92
+ config: RegistryConfig;
93
+ }
94
+ /**
95
+ * HandlerRegistry - Advanced handler registration and management system
96
+ */
97
+ declare class HandlerRegistry {
98
+ private engine;
99
+ private handlers;
100
+ private handlersByPriority;
101
+ private handlersByPattern;
102
+ private dependencyGraph;
103
+ private config;
104
+ private stats;
105
+ constructor(engine?: WikiEngine | null);
106
+ /**
107
+ * Register a syntax handler with full validation and conflict detection
108
+ * @param handler - Handler to register
109
+ * @param options - Registration options
110
+ * @returns True if registration successful
111
+ */
112
+ registerHandler(handler: BaseSyntaxHandler, options?: RegistrationOptions): Promise<boolean>;
113
+ /**
114
+ * Unregister a syntax handler
115
+ * @param handlerId - ID of handler to unregister
116
+ * @returns True if unregistration successful
117
+ */
118
+ unregisterHandler(handlerId: string): Promise<boolean>;
119
+ /**
120
+ * Validate handler before registration
121
+ * @param handler - Handler to validate
122
+ */
123
+ private validateHandler;
124
+ /**
125
+ * Detect conflicts with existing handlers
126
+ * @param newHandler - New handler to check
127
+ * @returns Array of conflicting handlers
128
+ */
129
+ private detectConflicts;
130
+ /**
131
+ * Check if two handlers conflict
132
+ * @param handler1 - First handler
133
+ * @param handler2 - Second handler
134
+ * @returns True if handlers conflict
135
+ */
136
+ private handlersConflict;
137
+ /**
138
+ * Rebuild the priority-sorted handler list
139
+ */
140
+ private rebuildPriorityList;
141
+ /**
142
+ * Update dependency graph when handler is registered
143
+ * @param handler - Handler being registered
144
+ */
145
+ private updateDependencyGraph;
146
+ /**
147
+ * Get handlers that depend on the specified handler
148
+ * @param handlerId - Handler ID
149
+ * @returns Dependent handlers
150
+ */
151
+ private getDependentHandlers;
152
+ /**
153
+ * Get handler by ID
154
+ * @param handlerId - Handler ID
155
+ * @returns Handler or null if not found
156
+ */
157
+ getHandler(handlerId: string): BaseSyntaxHandler | null;
158
+ /**
159
+ * Get all handlers sorted by priority
160
+ * @param enabledOnly - Only return enabled handlers
161
+ * @returns Handlers sorted by priority
162
+ */
163
+ getHandlersByPriority(enabledOnly?: boolean): BaseSyntaxHandler[];
164
+ /**
165
+ * Get handlers by pattern
166
+ * @param pattern - Pattern to match
167
+ * @returns Matching handlers
168
+ */
169
+ getHandlersByPattern(pattern: string | RegExp): BaseSyntaxHandler[];
170
+ /**
171
+ * Enable handler by ID
172
+ * @param handlerId - Handler ID
173
+ * @returns True if successful
174
+ */
175
+ enableHandler(handlerId: string): boolean;
176
+ /**
177
+ * Disable handler by ID
178
+ * @param handlerId - Handler ID
179
+ * @returns True if successful
180
+ */
181
+ disableHandler(handlerId: string): boolean;
182
+ /**
183
+ * Get registry statistics
184
+ * @returns Registry statistics
185
+ */
186
+ getStats(): ExtendedRegistryStats;
187
+ /**
188
+ * Reset all handler statistics
189
+ */
190
+ resetStats(): void;
191
+ /**
192
+ * Resolve handler execution order considering dependencies
193
+ * @returns Handlers in dependency-resolved order
194
+ */
195
+ resolveExecutionOrder(): BaseSyntaxHandler[];
196
+ /**
197
+ * Validate all handler dependencies
198
+ * @returns Array of dependency validation errors
199
+ */
200
+ validateDependencies(): DependencyValidationError[];
201
+ /**
202
+ * Clear all handlers
203
+ */
204
+ clearAll(): Promise<void>;
205
+ /**
206
+ * Export registry state for persistence
207
+ * @returns Serializable registry state
208
+ */
209
+ exportState(): ExportedRegistryState;
210
+ /**
211
+ * Get registry information
212
+ * @returns Registry information
213
+ */
214
+ getInfo(): RegistryInfo;
215
+ }
216
+ /**
217
+ * Custom error class for handler registration errors
218
+ */
219
+ export declare class HandlerRegistrationError extends Error {
220
+ readonly code: string;
221
+ readonly context: Record<string, unknown>;
222
+ constructor(message: string, code: string, context?: Record<string, unknown>);
223
+ }
224
+ export { HandlerRegistry };
225
+ export default HandlerRegistry;
@@ -0,0 +1,89 @@
1
+ import BaseSyntaxHandler, { ParseContext, HandlerMetadata } from './BaseSyntaxHandler.js';
2
+ /**
3
+ * Wiki engine interface
4
+ */
5
+ interface WikiEngine {
6
+ getManager(name: string): unknown;
7
+ }
8
+ /**
9
+ * JSPWikiPreprocessor - Processes JSPWiki syntax BEFORE markdown
10
+ *
11
+ * This handler runs in Phase 1 (Preprocessing) to:
12
+ * 1. Parse nested %%.../%% style blocks
13
+ * 2. Convert JSPWiki table syntax (|| header ||, | cell |) to HTML
14
+ * 3. Apply style classes to tables
15
+ *
16
+ * This matches JSPWiki's architecture where pre-blocking happens in the parser
17
+ * before any other transformations (like markdown).
18
+ *
19
+ * Related to: #41 - JSPWiki Table Styles Implementation
20
+ */
21
+ declare class JSPWikiPreprocessor extends BaseSyntaxHandler {
22
+ handlerId: string;
23
+ private phase;
24
+ private tableClasses;
25
+ constructor(_engine?: WikiEngine | null);
26
+ /**
27
+ * Process content: find and parse all %%.../%% blocks with nested support
28
+ */
29
+ process(content: string, _context: ParseContext): Promise<string>;
30
+ /**
31
+ * Parse nested %%.../%% blocks
32
+ * JSPWiki syntax allows nesting like:
33
+ * %%zebra-table
34
+ * %%sortable
35
+ * || Header ||
36
+ * | Cell |
37
+ * /%
38
+ * /%
39
+ */
40
+ private parseStyleBlocks;
41
+ /**
42
+ * Extract a %%.../%% block starting at startIndex
43
+ * Returns { content, endIndex } or null if no matching /% found
44
+ */
45
+ private extractBlock;
46
+ /**
47
+ * Check if a class name is table-related
48
+ * Also handles custom color syntax: zebra-HEXCOLOR (e.g., zebra-ffe0e0)
49
+ */
50
+ private isTableClass;
51
+ /**
52
+ * Calculate contrast color (black or white) for a given background color
53
+ * Uses WCAG relative luminance formula
54
+ * @param hexColor - 6-digit hex color (without #)
55
+ * @returns '#000000' or '#ffffff'
56
+ */
57
+ private getContrastColor;
58
+ /**
59
+ * Extract custom styles from class names
60
+ * Returns { classes: string, styles: string }
61
+ */
62
+ private extractCustomStyles;
63
+ /**
64
+ * Parse JSPWiki table syntax and convert to HTML
65
+ * Handles both header rows (|| cell ||) and data rows (| cell |)
66
+ *
67
+ * @param content - Table markup
68
+ * @param className - CSS classes to apply (space-separated, can be empty)
69
+ */
70
+ private parseTable;
71
+ /**
72
+ * Escape HTML special characters, preserving placeholder spans
73
+ * that were inserted by extractJSPWikiSyntax (Phase 1).
74
+ *
75
+ * NOTE: intentionally NOT replaced with pluginFormatters.escapeHtml — the
76
+ * shared helper is a simple character mapper, but this method must first
77
+ * protect <span data-jspwiki-placeholder> tokens from being entity-encoded.
78
+ * The two implementations serve different contexts.
79
+ */
80
+ private escapeHtml;
81
+ /**
82
+ * Get handler metadata
83
+ */
84
+ getMetadata(): HandlerMetadata & {
85
+ name: string;
86
+ phase: number;
87
+ };
88
+ }
89
+ export default JSPWikiPreprocessor;
@@ -0,0 +1,80 @@
1
+ import BaseSyntaxHandler, { InitializationContext, ParseContext } from './BaseSyntaxHandler.js';
2
+ /**
3
+ * Wiki engine interface
4
+ */
5
+ interface WikiEngine {
6
+ getManager(name: string): unknown;
7
+ }
8
+ /**
9
+ * LinkParserHandler - Unified link processing handler using LinkParser
10
+ *
11
+ * This handler integrates the comprehensive LinkParser into the MarkupParser
12
+ * handler architecture, providing centralized processing for all link types:
13
+ * - Internal wiki links: [PageName], [Display|Target]
14
+ * - External links: [Display|http://example.com]
15
+ * - InterWiki links: [Display|Wikipedia:Article]
16
+ * - Email links: [Display|mailto:user@example.com]
17
+ * - Anchor links: [Display|#section]
18
+ * - Links with attributes: [Display|Target|class="custom" target="_blank"]
19
+ *
20
+ * Replaces the fragmented WikiLinkHandler and InterWikiLinkHandler approach
21
+ * with a unified, security-focused, and comprehensive solution.
22
+ *
23
+ * Related Issue: #75 - Create LinkParser.js for centralized link parsing
24
+ * Epic: #41 - Implement JSPWikiMarkupParser for Complete Enhancement Support
25
+ */
26
+ declare class LinkParserHandler extends BaseSyntaxHandler {
27
+ handlerId: string;
28
+ private engine;
29
+ private linkParser;
30
+ initialized: boolean;
31
+ private localStats;
32
+ private matchEnglishPlurals;
33
+ private matchCamelCase;
34
+ constructor(engine?: WikiEngine | null);
35
+ /**
36
+ * Initialize handler with LinkParser configuration
37
+ * @param context - Initialization context
38
+ */
39
+ protected onInitialize(context: InitializationContext): Promise<void>;
40
+ /**
41
+ * Initialize LinkParser with current page names and configuration
42
+ */
43
+ private initializeLinkParser;
44
+ /**
45
+ * Load InterWiki site configuration for LinkParser
46
+ */
47
+ private loadInterWikiConfiguration;
48
+ /**
49
+ * Load default InterWiki sites
50
+ */
51
+ private loadDefaultInterWikiSites;
52
+ /**
53
+ * Process content using LinkParser
54
+ * @param content - Content to process
55
+ * @param context - Parse context
56
+ * @returns Content with links processed
57
+ */
58
+ process(content: string, context: ParseContext): Promise<string>;
59
+ /**
60
+ * Handle method - not used since we override process() entirely
61
+ * @param _match - Match information
62
+ * @param _context - Parse context
63
+ * @returns Processed match
64
+ */
65
+ handle(_match: RegExpMatchArray, _context: ParseContext): Promise<string>;
66
+ /**
67
+ * Refresh page names cache (called when pages are added/removed)
68
+ */
69
+ refreshPageNames(): Promise<void>;
70
+ /**
71
+ * Get handler information including LinkParser statistics
72
+ * @returns Handler information
73
+ */
74
+ getInfo(): Record<string, unknown>;
75
+ /**
76
+ * Handler-specific shutdown cleanup
77
+ */
78
+ protected onShutdown(): Promise<void>;
79
+ }
80
+ export default LinkParserHandler;
@@ -0,0 +1,78 @@
1
+ import BaseSyntaxHandler, { InitializationContext, ParseContext } from './BaseSyntaxHandler.js';
2
+ /**
3
+ * Wiki engine interface
4
+ */
5
+ interface WikiEngine {
6
+ getManager(name: string): unknown;
7
+ }
8
+ /**
9
+ * PluginSyntaxHandler - Enhanced plugin syntax processing
10
+ *
11
+ * Handles JSPWiki-style plugin syntax: [{PluginName param=value}]
12
+ * with advanced parameter parsing and validation.
13
+ *
14
+ * Related Issue: #58 - Enhanced Plugin Syntax Handler
15
+ * Depends On: #56 - Handler Registration and Priority System
16
+ */
17
+ declare class PluginSyntaxHandler extends BaseSyntaxHandler {
18
+ handlerId: string;
19
+ private engine;
20
+ private config;
21
+ constructor(engine?: WikiEngine | null);
22
+ /**
23
+ * Initialize handler with configuration
24
+ * @param context - Initialization context
25
+ */
26
+ protected onInitialize(context: InitializationContext): Promise<void>;
27
+ /**
28
+ * Process content by finding and executing all plugin instances
29
+ * Supports both simple [{Plugin}] and body syntax [{Plugin}]content[/{Plugin}]
30
+ * @param content - Content to process
31
+ * @param context - Parse context
32
+ * @returns Content with plugins executed
33
+ */
34
+ process(content: string, context: ParseContext): Promise<string>;
35
+ /**
36
+ * Process body-style plugins: [{Plugin}]content[/{Plugin}]
37
+ * @param content - Content to process
38
+ * @param context - Parse context
39
+ * @returns Content with body plugins processed
40
+ */
41
+ private processBodyPlugins;
42
+ /**
43
+ * Handle a specific plugin match
44
+ * @param matchInfo - Plugin match information
45
+ * @param context - Parse context
46
+ * @returns Plugin output HTML
47
+ */
48
+ private handlePlugin;
49
+ /**
50
+ * Validate plugin parameters
51
+ * @param pluginName - Plugin name
52
+ * @param parameters - Plugin parameters
53
+ * @returns Validation result
54
+ */
55
+ private validatePluginParameters;
56
+ /**
57
+ * Enhanced parameter parsing with support for complex formats
58
+ * @param paramString - Parameter string to parse
59
+ * @returns Parsed parameters
60
+ */
61
+ private parsePluginParameters;
62
+ /**
63
+ * Get supported plugin patterns for this handler
64
+ * @returns Array of supported patterns
65
+ */
66
+ getSupportedPatterns(): string[];
67
+ /**
68
+ * Get link graph from RenderingManager
69
+ * @returns Link graph object
70
+ */
71
+ private getLinkGraph;
72
+ /**
73
+ * Get handler information for debugging
74
+ * @returns Handler information
75
+ */
76
+ getInfo(): Record<string, unknown>;
77
+ }
78
+ export default PluginSyntaxHandler;
@@ -0,0 +1,149 @@
1
+ import BaseSyntaxHandler, { InitializationContext, ParseContext } from './BaseSyntaxHandler.js';
2
+ /**
3
+ * Form validation result
4
+ */
5
+ interface FormValidationResult {
6
+ isValid: boolean;
7
+ errors: string[];
8
+ sanitizedData: Record<string, unknown>;
9
+ }
10
+ /**
11
+ * Wiki engine interface
12
+ */
13
+ interface WikiEngine {
14
+ getManager(name: string): unknown;
15
+ }
16
+ /**
17
+ * Extended parse context for the form handler. After #629 Pass 2, the
18
+ * setMetadata/getMetadata methods are available on the real ParseContext.
19
+ */
20
+ type FormParseContext = ParseContext;
21
+ /**
22
+ * WikiFormHandler - Interactive form generation within wiki pages
23
+ *
24
+ * Supports JSPWiki form syntax:
25
+ * - [{FormOpen action='SaveData' method='POST'}] - Form opening
26
+ * - [{FormInput name='field' type='text' value='default'}] - Input fields
27
+ * - [{FormSelect name='choice' options='A,B,C'}] - Select boxes
28
+ * - [{FormTextarea name='comment' rows='5'}] - Text areas
29
+ * - [{FormButton type='submit' value='Save'}] - Form buttons
30
+ * - [{FormClose}] - Form closing
31
+ *
32
+ * Related Issue: #60 - WikiForm Handler (FormOpen, FormInput, FormClose)
33
+ * Epic: #41 - Implement JSPWikiMarkupParser for Complete Enhancement Support
34
+ */
35
+ declare class WikiFormHandler extends BaseSyntaxHandler {
36
+ handlerId: string;
37
+ private config;
38
+ private activeForms;
39
+ private formCounter;
40
+ constructor(_engine?: WikiEngine | null);
41
+ /**
42
+ * Initialize handler with configuration
43
+ * @param context - Initialization context
44
+ */
45
+ protected onInitialize(context: InitializationContext): Promise<void>;
46
+ /**
47
+ * Process content by finding and executing all form elements
48
+ * @param content - Content to process
49
+ * @param context - Parse context
50
+ * @returns Content with forms processed
51
+ */
52
+ process(content: string, context: ParseContext): Promise<string>;
53
+ /**
54
+ * Handle a specific form element
55
+ * @param matchInfo - Form element match information
56
+ * @param context - Parse context
57
+ * @returns Form element HTML
58
+ */
59
+ private handleElement;
60
+ /**
61
+ * Parse form parameters from string
62
+ */
63
+ private parseFormParameters;
64
+ /**
65
+ * Handle FormOpen element
66
+ * @param params - Form parameters
67
+ * @param context - Parse context
68
+ * @returns Form opening HTML
69
+ */
70
+ private handleFormOpen;
71
+ /**
72
+ * Handle FormInput element
73
+ * @param params - Input parameters
74
+ * @returns Input field HTML
75
+ */
76
+ private handleFormInput;
77
+ /**
78
+ * Handle FormSelect element
79
+ * @param params - Select parameters
80
+ * @returns Select field HTML
81
+ */
82
+ private handleFormSelect;
83
+ /**
84
+ * Handle FormTextarea element
85
+ * @param params - Textarea parameters
86
+ * @returns Textarea HTML
87
+ */
88
+ private handleFormTextarea;
89
+ /**
90
+ * Handle FormButton element
91
+ * @param params - Button parameters
92
+ * @returns Button HTML
93
+ */
94
+ private handleFormButton;
95
+ /**
96
+ * Handle FormClose element
97
+ * @param params - Close parameters (usually empty)
98
+ * @returns Form closing HTML
99
+ */
100
+ private handleFormClose;
101
+ /**
102
+ * Generate CSRF token for form security
103
+ * @param context - Parse context
104
+ * @returns CSRF token
105
+ */
106
+ private generateCSRFToken;
107
+ /**
108
+ * Validate form submission (for future form processing endpoint)
109
+ * @param formData - Submitted form data
110
+ * @param csrfToken - CSRF token from form
111
+ * @param context - Parse context
112
+ * @returns Validation result
113
+ */
114
+ validateFormSubmission(formData: Record<string, string>, csrfToken: string, context: FormParseContext): FormValidationResult;
115
+ /**
116
+ * Sanitize form data to prevent XSS
117
+ * @param formData - Raw form data
118
+ * @returns Sanitized form data
119
+ */
120
+ private sanitizeFormData;
121
+ /**
122
+ * Escape HTML characters to prevent XSS
123
+ * @param text - Text to escape
124
+ * @returns Escaped text
125
+ */
126
+ private escapeHtml;
127
+ /**
128
+ * Capitalize first letter of string
129
+ * @param str - String to capitalize
130
+ * @returns Capitalized string
131
+ */
132
+ private capitalize;
133
+ /**
134
+ * Get supported form patterns
135
+ * @returns Array of supported patterns
136
+ */
137
+ getSupportedPatterns(): string[];
138
+ /**
139
+ * Get supported input types
140
+ * @returns Array of supported input types
141
+ */
142
+ getSupportedInputTypes(): string[];
143
+ /**
144
+ * Get handler information for debugging and documentation
145
+ * @returns Handler information
146
+ */
147
+ getInfo(): Record<string, unknown>;
148
+ }
149
+ export default WikiFormHandler;