@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.
- package/LICENSE +201 -0
- package/README.md +16 -2
- package/lib/packages/ngdpbase-types/index.d.ts +32 -0
- package/lib/packages/ngdpbase-types/testing.d.ts +43 -0
- package/lib/packages/ngdpbase-types/testing.js +53 -0
- package/lib/src/cache/CacheDependencies.d.ts +50 -0
- package/lib/src/cache/CacheDependencies.js +50 -0
- package/lib/src/cache/ICacheAdapter.d.ts +86 -0
- package/lib/src/cache/RegionCache.d.ts +171 -0
- package/lib/src/context/ActorContext.d.ts +48 -0
- package/lib/src/context/ActorContext.js +33 -0
- package/lib/src/context/ApiContext.d.ts +194 -0
- package/lib/src/context/ApiContext.js +273 -0
- package/lib/src/context/BaseContext.d.ts +110 -0
- package/lib/src/context/BaseContext.js +143 -0
- package/lib/src/context/JobContext.d.ts +153 -0
- package/lib/src/context/JobContext.js +144 -0
- package/lib/src/context/WikiContext.d.ts +404 -0
- package/lib/src/context/bootActions.d.ts +64 -0
- package/lib/src/context/bootActions.js +111 -0
- package/lib/src/converters/HtmlConverter.d.ts +70 -0
- package/lib/src/converters/IContentConverter.d.ts +94 -0
- package/lib/src/converters/JSPWikiConverter.d.ts +117 -0
- package/lib/src/converters/conversionWarning.d.ts +15 -0
- package/lib/src/converters/ncm/bridge.d.ts +22 -0
- package/lib/src/converters/ncm/existing.d.ts +23 -0
- package/lib/src/converters/ncm/fix/blocks.d.ts +89 -0
- package/lib/src/converters/ncm/fix/bulletMarkers.d.ts +21 -0
- package/lib/src/converters/ncm/fix/index.d.ts +36 -0
- package/lib/src/converters/ncm/fix/jspwikiBullets.d.ts +20 -0
- package/lib/src/converters/ncm/fix/jspwikiCodeMarkers.d.ts +38 -0
- package/lib/src/converters/ncm/fix/jspwikiHeadings.d.ts +25 -0
- package/lib/src/converters/ncm/fix/jspwikiIndent.d.ts +24 -0
- package/lib/src/converters/ncm/fix/jspwikiInsert.d.ts +21 -0
- package/lib/src/converters/ncm/fix/jspwikiItalic.d.ts +29 -0
- package/lib/src/converters/ncm/fix/jspwikiLinkLeftovers.d.ts +27 -0
- package/lib/src/converters/ncm/fix/moreInformationFooter.d.ts +25 -0
- package/lib/src/converters/ncm/fix/styleClosers.d.ts +25 -0
- package/lib/src/converters/ncm/fix/tightenLists.d.ts +30 -0
- package/lib/src/converters/ncm/fix/types.d.ts +33 -0
- package/lib/src/converters/ncm/footnotes.d.ts +39 -0
- package/lib/src/converters/ncm/images.d.ts +49 -0
- package/lib/src/converters/ncm/index.d.ts +20 -0
- package/lib/src/converters/ncm/links.d.ts +21 -0
- package/lib/src/converters/ncm/normalize.d.ts +39 -0
- package/lib/src/converters/ncm/placeholder.d.ts +25 -0
- package/lib/src/converters/ncm/tables.d.ts +36 -0
- package/lib/src/converters/ncm/types.d.ts +42 -0
- package/lib/src/http/egressPolicy.d.ts +52 -0
- package/lib/src/http/guardedFetch.d.ts +89 -0
- package/lib/src/http/guardedFetch.js +113 -0
- package/lib/src/http/guardedLookup.d.ts +48 -0
- package/lib/src/http/guardedLookup.js +73 -0
- package/lib/src/http/ssrf.d.ts +83 -0
- package/lib/src/http/ssrf.js +311 -0
- package/lib/src/mail/MailProvider.d.ts +36 -0
- package/lib/src/mail/NodemailerMailProvider.d.ts +26 -0
- package/lib/src/managers/AddonsManager.d.ts +691 -0
- package/lib/src/managers/AgentTokenManager.d.ts +269 -0
- package/lib/src/managers/AssetManager.d.ts +116 -0
- package/lib/src/managers/AttachmentManager.d.ts +1032 -0
- package/lib/src/managers/AuthManager.d.ts +1257 -0
- package/lib/src/managers/BackgroundJobManager.d.ts +434 -0
- package/lib/src/managers/BaseManager.d.ts +391 -0
- package/lib/src/managers/BaseManager.js +415 -0
- package/lib/src/managers/CacheManager.d.ts +159 -0
- package/lib/src/managers/CatalogManager.d.ts +235 -0
- package/lib/src/managers/CommentManager.d.ts +75 -0
- package/lib/src/managers/ConfigurationManager.d.ts +747 -0
- package/lib/src/managers/DatabaseManager.d.ts +89 -0
- package/lib/src/managers/DatabaseManager.js +236 -0
- package/lib/src/managers/EmailManager.d.ts +47 -0
- package/lib/src/managers/ExportManager.d.ts +129 -0
- package/lib/src/managers/ExportManager.js +420 -0
- package/lib/src/managers/FootnoteManager.d.ts +118 -0
- package/lib/src/managers/MediaManager.d.ts +279 -0
- package/lib/src/managers/MetricsManager.d.ts +89 -0
- package/lib/src/managers/NotificationManager.d.ts +165 -0
- package/lib/src/managers/OidcManager.d.ts +210 -0
- package/lib/src/managers/OrganizationManager.d.ts +107 -0
- package/lib/src/managers/PageManager.d.ts +1645 -0
- package/lib/src/managers/PersonManager.d.ts +48 -0
- package/lib/src/managers/PluginManager.d.ts +179 -0
- package/lib/src/managers/PluginManager.js +393 -0
- package/lib/src/managers/PolicyEvaluator.d.ts +213 -0
- package/lib/src/managers/RenderingManager.d.ts +358 -0
- package/lib/src/managers/RoleManager.d.ts +134 -0
- package/lib/src/managers/SearchManager.d.ts +402 -0
- package/lib/src/managers/ShareManager.d.ts +251 -0
- package/lib/src/managers/TemplateManager.d.ts +176 -0
- package/lib/src/managers/ThemeManager.d.ts +56 -0
- package/lib/src/managers/UserManager.d.ts +480 -0
- package/lib/src/managers/ValidationManager.d.ts +426 -0
- package/lib/src/managers/VariableManager.d.ts +145 -0
- package/lib/src/middleware/csrf.d.ts +3 -0
- package/lib/src/parsers/LinkParser.d.ts +457 -0
- package/lib/src/parsers/MarkupParser.d.ts +769 -0
- package/lib/src/parsers/context/ParseContext.d.ts +314 -0
- package/lib/src/parsers/data/emoji-map.d.ts +18 -0
- package/lib/src/parsers/dom/DOMBuilder.d.ts +210 -0
- package/lib/src/parsers/dom/DOMParser.d.ts +252 -0
- package/lib/src/parsers/dom/Tokenizer.d.ts +358 -0
- package/lib/src/parsers/dom/WikiDocument.d.ts +272 -0
- package/lib/src/parsers/dom/handlers/DOMLinkHandler.d.ts +260 -0
- package/lib/src/parsers/dom/handlers/DOMPluginHandler.d.ts +212 -0
- package/lib/src/parsers/dom/handlers/DOMVariableHandler.d.ts +171 -0
- package/lib/src/parsers/filters/BaseFilter.d.ts +269 -0
- package/lib/src/parsers/filters/FilterChain.d.ts +320 -0
- package/lib/src/parsers/handlers/BaseSyntaxHandler.d.ts +331 -0
- package/lib/src/parsers/handlers/HandlerRegistry.d.ts +225 -0
- package/lib/src/parsers/handlers/JSPWikiPreprocessor.d.ts +89 -0
- package/lib/src/parsers/handlers/LinkParserHandler.d.ts +80 -0
- package/lib/src/parsers/handlers/PluginSyntaxHandler.d.ts +78 -0
- package/lib/src/parsers/handlers/WikiFormHandler.d.ts +149 -0
- package/lib/src/parsers/handlers/WikiTagHandler.d.ts +125 -0
- package/lib/src/parsers/jspwikiTableRow.d.ts +39 -0
- package/lib/src/parsers/styleBlockSyntax.d.ts +14 -0
- package/lib/src/plugins/types.d.ts +79 -0
- package/lib/src/providers/AgentTokenAuthProvider.d.ts +40 -0
- package/lib/src/providers/AuthentikBearerAuthProvider.d.ts +75 -0
- package/lib/src/providers/BaseAttachmentProvider.d.ts +197 -0
- package/lib/src/providers/BaseAuthProvider.d.ts +220 -0
- package/lib/src/providers/BaseCacheProvider.d.ts +140 -0
- package/lib/src/providers/BaseCredentialsProvider.d.ts +84 -0
- package/lib/src/providers/BaseDatabaseProvider.d.ts +22 -0
- package/lib/src/providers/BaseDatabaseProvider.js +12 -0
- package/lib/src/providers/BaseLoggingProvider.d.ts +68 -0
- package/lib/src/providers/BaseLoggingProvider.js +37 -0
- package/lib/src/providers/BaseMediaProvider.d.ts +308 -0
- package/lib/src/providers/BasePageProvider.d.ts +337 -0
- package/lib/src/providers/BaseProvider.d.ts +98 -0
- package/lib/src/providers/BaseProvider.js +74 -0
- package/lib/src/providers/BaseSearchProvider.d.ts +362 -0
- package/lib/src/providers/BasicAttachmentProvider.d.ts +599 -0
- package/lib/src/providers/CloudflareAccessAuthProvider.d.ts +72 -0
- package/lib/src/providers/FileCredentialsProvider.d.ts +33 -0
- package/lib/src/providers/FileJobStateProvider.d.ts +58 -0
- package/lib/src/providers/FileLoggingProvider.d.ts +43 -0
- package/lib/src/providers/FileLoggingProvider.js +120 -0
- package/lib/src/providers/FileOidcAdapter.d.ts +25 -0
- package/lib/src/providers/FileSystemMediaProvider.d.ts +403 -0
- package/lib/src/providers/LunrSearchProvider.d.ts +280 -0
- package/lib/src/providers/MagicLinkAuthProvider.d.ts +125 -0
- package/lib/src/providers/NullCacheProvider.d.ts +72 -0
- package/lib/src/providers/OidcAuthProvider.d.ts +180 -0
- package/lib/src/providers/OidcBearerAuthProvider.d.ts +30 -0
- package/lib/src/providers/PasskeyAuthProvider.d.ts +58 -0
- package/lib/src/providers/PasswordAuthProvider.d.ts +20 -0
- package/lib/src/providers/SqliteDatabaseProvider.d.ts +55 -0
- package/lib/src/providers/SqliteDatabaseProvider.js +90 -0
- package/lib/src/providers/SqliteJobStateProvider.d.ts +41 -0
- package/lib/src/providers/databaseMigrations.d.ts +8 -0
- package/lib/src/providers/databaseMigrations.js +47 -0
- package/lib/src/providers/jobState.d.ts +99 -0
- package/lib/src/providers/lunrQueryToMiniSearch.d.ts +32 -0
- package/lib/src/providers/mediaFilenameDate.d.ts +22 -0
- package/lib/src/providers/sqliteLocation.d.ts +17 -0
- package/lib/src/providers/sqliteLocation.js +55 -0
- package/lib/src/providers/sqliteMigrations.d.ts +48 -0
- package/lib/src/providers/sqliteMigrations.js +72 -0
- package/lib/src/rendering/githubAlerts.d.ts +22 -0
- package/lib/src/rendering/htmlPolicy.d.ts +76 -0
- package/lib/src/rendering/markdownConverter.d.ts +73 -0
- package/lib/src/security/PolicyDecisionPoint.d.ts +245 -0
- package/lib/src/security/PolicyInformationPoint.d.ts +448 -0
- package/lib/src/security/pageActions.d.ts +40 -0
- package/lib/src/security/permissions.generated.d.ts +78 -0
- package/lib/src/types/Asset.d.ts +414 -0
- package/lib/src/types/Catalog.d.ts +61 -0
- package/lib/src/types/Comment.d.ts +11 -0
- package/lib/src/types/Config.d.ts +388 -0
- package/lib/src/types/Organization.d.ts +78 -0
- package/lib/src/types/OrganizationProvider.d.ts +38 -0
- package/lib/src/types/Page.d.ts +220 -0
- package/lib/src/types/Person.d.ts +56 -0
- package/lib/src/types/PersonProvider.d.ts +25 -0
- package/lib/src/types/Policy.d.ts +139 -0
- package/lib/src/types/Policy.js +17 -0
- package/lib/src/types/Provider.d.ts +810 -0
- package/lib/src/types/Role.d.ts +84 -0
- package/lib/src/types/RoleProvider.d.ts +35 -0
- package/lib/src/types/Schema.d.ts +425 -0
- package/lib/src/types/Share.d.ts +172 -0
- package/lib/src/types/Share.js +81 -0
- package/lib/src/types/User.d.ts +304 -0
- package/lib/src/types/Version.d.ts +189 -0
- package/lib/src/types/WikiEngine.d.ts +128 -0
- package/lib/src/types/express.d.ts +120 -0
- package/lib/src/types/express.js +1 -0
- package/lib/src/types/guards.d.ts +78 -0
- package/lib/src/types/heic-decode.d.ts +16 -0
- package/lib/src/types/index.d.ts +19 -0
- package/lib/src/types/linkedom.d.ts +77 -0
- package/lib/src/types/markdown-it-plugins.d.ts +21 -0
- package/lib/src/utils/DeltaStorage.d.ts +118 -0
- package/lib/src/utils/LocaleUtils.d.ts +105 -0
- package/lib/src/utils/LocaleUtils.js +294 -0
- package/lib/src/utils/PageNameMatcher.d.ts +98 -0
- package/lib/src/utils/PathPreflight.d.ts +38 -0
- package/lib/src/utils/PathPreflight.js +50 -0
- package/lib/src/utils/SectionUtils.d.ts +40 -0
- package/lib/src/utils/addonConfigLayer.d.ts +144 -0
- package/lib/src/utils/addonConfigLayer.js +382 -0
- package/lib/src/utils/addonDatabaseRules.d.ts +25 -0
- package/lib/src/utils/addonDatabaseRules.js +57 -0
- package/lib/src/utils/addonHost.d.ts +51 -0
- package/lib/src/utils/addonHost.js +72 -0
- package/lib/src/utils/addonInstaller.d.ts +109 -0
- package/lib/src/utils/addonLock.d.ts +37 -0
- package/lib/src/utils/addonLock.js +48 -0
- package/lib/src/utils/addonPageSync.d.ts +45 -0
- package/lib/src/utils/addonProvenance.d.ts +48 -0
- package/lib/src/utils/addonTarball.d.ts +41 -0
- package/lib/src/utils/addonsPathResolver.d.ts +76 -0
- package/lib/src/utils/addonsPathResolver.js +129 -0
- package/lib/src/utils/assetMetadataTags.d.ts +66 -0
- package/lib/src/utils/atomicWrite.d.ts +28 -0
- package/lib/src/utils/auditConfigChange.d.ts +57 -0
- package/lib/src/utils/auditEventNames.d.ts +50 -0
- package/lib/src/utils/auditEventNames.generated.d.ts +163 -0
- package/lib/src/utils/auditEventNames.generated.js +168 -0
- package/lib/src/utils/auditEventNames.js +49 -0
- package/lib/src/utils/auditEvents.d.ts +265 -0
- package/lib/src/utils/auditEvents.js +309 -0
- package/lib/src/utils/auditRegistry.d.ts +102 -0
- package/lib/src/utils/auditRegistry.js +168 -0
- package/lib/src/utils/bip39English.d.ts +2 -0
- package/lib/src/utils/configEnvKeys.d.ts +68 -0
- package/lib/src/utils/configFiles.d.ts +74 -0
- package/lib/src/utils/configFiles.js +150 -0
- package/lib/src/utils/delegation.d.ts +48 -0
- package/lib/src/utils/deriveUsername.d.ts +21 -0
- package/lib/src/utils/explainMediaPath.d.ts +123 -0
- package/lib/src/utils/formerTitles.d.ts +69 -0
- package/lib/src/utils/frontmatterAccess.d.ts +54 -0
- package/lib/src/utils/headlessAdminPassword.d.ts +55 -0
- package/lib/src/utils/imageTransform.d.ts +52 -0
- package/lib/src/utils/instanceEnvSecret.d.ts +51 -0
- package/lib/src/utils/jobSlots.d.ts +43 -0
- package/lib/src/utils/keywordNormalizer.d.ts +127 -0
- package/lib/src/utils/logger.d.ts +70 -0
- package/lib/src/utils/logger.js +106 -0
- package/lib/src/utils/magicLinkDeviceState.d.ts +95 -0
- package/lib/src/utils/managerUtils.d.ts +40 -0
- package/lib/src/utils/migrateLegacyPrivateAttachments.d.ts +15 -0
- package/lib/src/utils/orgFilename.d.ts +22 -0
- package/lib/src/utils/pageFeature.d.ts +27 -0
- package/lib/src/utils/pageFrontmatter.d.ts +21 -0
- package/lib/src/utils/pageNotes.d.ts +150 -0
- package/lib/src/utils/pageTitleRule.d.ts +37 -0
- package/lib/src/utils/pageToArticle.d.ts +59 -0
- package/lib/src/utils/pageUrl.d.ts +18 -0
- package/lib/src/utils/passwordChange.d.ts +12 -0
- package/lib/src/utils/passwordHash.d.ts +60 -0
- package/lib/src/utils/permissionCatalog.d.ts +52 -0
- package/lib/src/utils/pluginFormatters.d.ts +452 -0
- package/lib/src/utils/pluginFormatters.js +714 -0
- package/lib/src/utils/privateLinkRewrite.d.ts +42 -0
- package/lib/src/utils/privateStoreAccess.d.ts +57 -0
- package/lib/src/utils/privateStoreAccess.js +65 -0
- package/lib/src/utils/privateStoreCatalogs.d.ts +40 -0
- package/lib/src/utils/privateStoreCrypto.d.ts +127 -0
- package/lib/src/utils/privateStoreDoor.d.ts +181 -0
- package/lib/src/utils/privateStoreExport.d.ts +72 -0
- package/lib/src/utils/privateStoreFiles.d.ts +120 -0
- package/lib/src/utils/privateStoreMeta.d.ts +64 -0
- package/lib/src/utils/privateStoreMigrations.d.ts +37 -0
- package/lib/src/utils/privateStorePath.d.ts +259 -0
- package/lib/src/utils/privateStorePath.js +436 -0
- package/lib/src/utils/privateStoreTakeout.d.ts +76 -0
- package/lib/src/utils/privateStoreUnlock.d.ts +175 -0
- package/lib/src/utils/proxyClaim.d.ts +59 -0
- package/lib/src/utils/proxyClaim.js +30 -0
- package/lib/src/utils/redactPrivateNames.d.ts +21 -0
- package/lib/src/utils/redactPrivateNames.js +89 -0
- package/lib/src/utils/redactSecrets.d.ts +58 -0
- package/lib/src/utils/redactSecrets.js +171 -0
- package/lib/src/utils/renameLinkRewrite.d.ts +112 -0
- package/lib/src/utils/roleGrants.d.ts +35 -0
- package/lib/src/utils/safeRedirect.d.ts +32 -0
- package/lib/src/utils/schedule.d.ts +54 -0
- package/lib/src/utils/secretFileMode.d.ts +17 -0
- package/lib/src/utils/seededShippedPages.d.ts +45 -0
- package/lib/src/utils/sensitiveValues.d.ts +59 -0
- package/lib/src/utils/sensitiveValues.js +106 -0
- package/lib/src/utils/sessionEnd.d.ts +12 -0
- package/lib/src/utils/sessionGeneration.d.ts +24 -0
- package/lib/src/utils/sessionIdle.d.ts +41 -0
- package/lib/src/utils/sessionLimits.d.ts +68 -0
- package/lib/src/utils/shareLockbox.d.ts +64 -0
- package/lib/src/utils/sigstoreTrustedRoot.d.ts +33 -0
- package/lib/src/utils/sniffMime.d.ts +21 -0
- package/lib/src/utils/storeSearchIndex.d.ts +75 -0
- package/lib/src/utils/subjectMayDo.d.ts +21 -0
- package/lib/src/utils/systemCategoryRules.d.ts +30 -0
- package/lib/src/utils/systemCategoryRules.js +41 -0
- package/lib/src/utils/userCreateError.d.ts +62 -0
- package/lib/src/utils/username.d.ts +53 -0
- package/lib/src/utils/vaultUrlRewrite.d.ts +27 -0
- package/lib/src/utils/version.d.ts +84 -0
- package/lib/src/utils/videoFrame.d.ts +21 -0
- package/package.json +54 -3
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page type definitions for ngdpbase
|
|
3
|
+
*
|
|
4
|
+
* This module defines the core types for wiki pages, including frontmatter
|
|
5
|
+
* metadata, page content, and page information structures used throughout
|
|
6
|
+
* the application.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Page frontmatter metadata
|
|
10
|
+
*
|
|
11
|
+
* Metadata stored in YAML frontmatter at the top of each markdown file.
|
|
12
|
+
* All pages must have at minimum: title, uuid, and lastModified.
|
|
13
|
+
*/
|
|
14
|
+
export interface PageFrontmatter {
|
|
15
|
+
/** Page title (required) */
|
|
16
|
+
title: string;
|
|
17
|
+
/** Unique identifier (UUID v4) */
|
|
18
|
+
uuid: string;
|
|
19
|
+
/** Last modification timestamp (ISO 8601 format) */
|
|
20
|
+
lastModified: string;
|
|
21
|
+
/**
|
|
22
|
+
* Page creation timestamp (ISO 8601 format).
|
|
23
|
+
*
|
|
24
|
+
* Set ONCE on first save and preserved by every subsequent save —
|
|
25
|
+
* `FileSystemProvider.savePage()` carries it forward from the on-disk
|
|
26
|
+
* frontmatter so updates never overwrite it. Optional in the type
|
|
27
|
+
* because pre-#754 pages were written without it; the migration
|
|
28
|
+
* script `scripts/migrate-page-created.ts` backfills existing pages
|
|
29
|
+
* from v1-manifest `dateCreated` → file mtime → `lastModified`.
|
|
30
|
+
*/
|
|
31
|
+
created?: string;
|
|
32
|
+
/** System-defined category (optional) */
|
|
33
|
+
'system-category'?: string;
|
|
34
|
+
/** User-defined category (optional) */
|
|
35
|
+
category?: string;
|
|
36
|
+
/** User-defined keywords/tags */
|
|
37
|
+
'user-keywords'?: string[];
|
|
38
|
+
/** Machine/automation keywords (#869 bucket model): AI classification and
|
|
39
|
+
* provenance marks (e.g. 'capture'). Operator-curated vocabulary. */
|
|
40
|
+
'system-keywords'?: string[];
|
|
41
|
+
/** URL slug for pretty URLs */
|
|
42
|
+
slug?: string;
|
|
43
|
+
/** Page author (user ID or 'system') */
|
|
44
|
+
author?: string;
|
|
45
|
+
/** Last editor (user ID or 'system') */
|
|
46
|
+
editor?: string;
|
|
47
|
+
/** Whether a system/documentation page has been user-modified */
|
|
48
|
+
'user-modified'?: boolean;
|
|
49
|
+
/** Page template to use for rendering */
|
|
50
|
+
template?: string;
|
|
51
|
+
/** Whether page is published/visible */
|
|
52
|
+
published?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Editorial lifecycle state (#893, Slice 1 of #869): 'draft' | 'review' |
|
|
55
|
+
* 'published'. Absent means 'published'. Replaces the lifecycle terms that
|
|
56
|
+
* previously lived in user-keywords / system-keywords; the page door
|
|
57
|
+
* migrates them here on save.
|
|
58
|
+
*/
|
|
59
|
+
status?: string;
|
|
60
|
+
/** Parent page UUID for hierarchical structure */
|
|
61
|
+
parent?: string;
|
|
62
|
+
/** Sort order for navigation */
|
|
63
|
+
order?: number;
|
|
64
|
+
/** Name of the add-on that originally seeded this page, if any */
|
|
65
|
+
addon?: string;
|
|
66
|
+
/**
|
|
67
|
+
* #946 — name of the agent token that CREATED this page, if any.
|
|
68
|
+
* Immutable: a durable fact about the page's origin, never overwritten by a
|
|
69
|
+
* later edit. Server-owned; stripped from caller-supplied frontmatter.
|
|
70
|
+
*/
|
|
71
|
+
'created-via-token'?: string;
|
|
72
|
+
/**
|
|
73
|
+
* #946 — name of the agent token used for the MOST RECENT revision.
|
|
74
|
+
* Cleared when a human writes, so it always answers "is this currently
|
|
75
|
+
* agent-maintained?" rather than "was it ever". Pairs with `editor`, as
|
|
76
|
+
* `created-via-token` pairs with `author`. Server-owned.
|
|
77
|
+
*/
|
|
78
|
+
'via-token'?: string;
|
|
79
|
+
/** Roles or usernames allowed to view this page (front matter access control) */
|
|
80
|
+
audience?: string[];
|
|
81
|
+
/**
|
|
82
|
+
* The boolean setting this page belongs to (#1677). While that setting is
|
|
83
|
+
* not `true` the page reads as not found and is left out of listings — a
|
|
84
|
+
* help page for a feature that is off. See `src/utils/pageFeature.ts`.
|
|
85
|
+
*/
|
|
86
|
+
'requires-setting'?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Whether the page is private — accessible only to the page creator and admins.
|
|
89
|
+
*
|
|
90
|
+
* Peer of `audience` and `author-lock`; canonical signal for PolicyInformationPoint's tier-0
|
|
91
|
+
* private check. When true, all other per-page rules (audience, access, author-lock)
|
|
92
|
+
* are bypassed and the page is stored in a separate per-creator location.
|
|
93
|
+
*
|
|
94
|
+
* #639: top-level field added in Slice C; user-keywords back-compat scan dropped
|
|
95
|
+
* in Slice E (v3.7.0). All datasets migrated; this field is the only source of truth.
|
|
96
|
+
*/
|
|
97
|
+
private?: boolean;
|
|
98
|
+
/** Per-action principal lists — overrides audience for the named action */
|
|
99
|
+
access?: {
|
|
100
|
+
view?: string[];
|
|
101
|
+
edit?: string[];
|
|
102
|
+
delete?: string[];
|
|
103
|
+
[key: string]: string[] | undefined;
|
|
104
|
+
};
|
|
105
|
+
/** Additional custom metadata */
|
|
106
|
+
[key: string]: unknown;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Complete wiki page object
|
|
110
|
+
*
|
|
111
|
+
* Represents a full page with content and metadata. This is the primary
|
|
112
|
+
* data structure returned by PageProvider.getPage().
|
|
113
|
+
*/
|
|
114
|
+
export interface WikiPage {
|
|
115
|
+
/** Page title */
|
|
116
|
+
title: string;
|
|
117
|
+
/** Unique identifier (UUID v4) */
|
|
118
|
+
uuid: string;
|
|
119
|
+
/** Markdown content (without frontmatter) */
|
|
120
|
+
content: string;
|
|
121
|
+
/** Frontmatter metadata */
|
|
122
|
+
metadata: PageFrontmatter;
|
|
123
|
+
/** Absolute file path to the page file */
|
|
124
|
+
filePath: string;
|
|
125
|
+
/** Location type (pages or required-pages) */
|
|
126
|
+
location?: 'pages' | 'required-pages';
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Minimal page information for listings
|
|
130
|
+
*
|
|
131
|
+
* Used in page indexes, search results, and navigation where full content
|
|
132
|
+
* is not needed. This is stored in page-index.json.
|
|
133
|
+
*/
|
|
134
|
+
export interface PageInfo {
|
|
135
|
+
/** Page title */
|
|
136
|
+
title: string;
|
|
137
|
+
/** Unique identifier (UUID v4) */
|
|
138
|
+
uuid: string;
|
|
139
|
+
/** Absolute file path to the page file */
|
|
140
|
+
filePath: string;
|
|
141
|
+
/** Frontmatter metadata */
|
|
142
|
+
metadata: PageFrontmatter;
|
|
143
|
+
/** Location type */
|
|
144
|
+
location?: 'pages' | 'required-pages';
|
|
145
|
+
/** Last modification timestamp (from metadata) */
|
|
146
|
+
lastModified?: string;
|
|
147
|
+
/** Creation timestamp (from metadata, #754) */
|
|
148
|
+
created?: string;
|
|
149
|
+
/** Page author (from metadata) */
|
|
150
|
+
author?: string;
|
|
151
|
+
/** Last editor (from metadata) */
|
|
152
|
+
editor?: string;
|
|
153
|
+
/** Category (from metadata) */
|
|
154
|
+
category?: string;
|
|
155
|
+
/** URL slug (from metadata) */
|
|
156
|
+
slug?: string;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Page save options
|
|
160
|
+
*
|
|
161
|
+
* Options passed when saving a page to control versioning, author tracking,
|
|
162
|
+
* and other save behaviors.
|
|
163
|
+
*/
|
|
164
|
+
export interface PageSaveOptions {
|
|
165
|
+
/** User ID performing the save */
|
|
166
|
+
author?: string;
|
|
167
|
+
/** Change type (create, update, minor, major) */
|
|
168
|
+
changeType?: 'create' | 'update' | 'minor' | 'major';
|
|
169
|
+
/** Commit message/change description */
|
|
170
|
+
message?: string;
|
|
171
|
+
/** Whether to create a version entry */
|
|
172
|
+
createVersion?: boolean;
|
|
173
|
+
/** Additional metadata to merge */
|
|
174
|
+
additionalMetadata?: Partial<PageFrontmatter>;
|
|
175
|
+
/** Preserve lastModified from metadata instead of setting to now (for import/migration use) */
|
|
176
|
+
preserveLastModified?: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* The private name the page is at now, when this save moves it into
|
|
179
|
+
* another of its owner's vaults (#1505). The page, its history and its
|
|
180
|
+
* index entry go with it. Only a save that says so changes a page's vault;
|
|
181
|
+
* one that names another vault without it is refused.
|
|
182
|
+
*/
|
|
183
|
+
moveFrom?: string;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Page search result
|
|
187
|
+
*
|
|
188
|
+
* Extended page info with search relevance scoring and highlighting.
|
|
189
|
+
*/
|
|
190
|
+
export interface PageSearchResult extends PageInfo {
|
|
191
|
+
/** Search relevance score (0-1) */
|
|
192
|
+
score: number;
|
|
193
|
+
/** Highlighted snippets from content */
|
|
194
|
+
highlights?: string[];
|
|
195
|
+
/** Matched keywords */
|
|
196
|
+
matchedKeywords?: string[];
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Page list options
|
|
200
|
+
*
|
|
201
|
+
* Options for filtering and sorting page lists.
|
|
202
|
+
*/
|
|
203
|
+
export interface PageListOptions {
|
|
204
|
+
/** Filter by category */
|
|
205
|
+
category?: string;
|
|
206
|
+
/** Filter by author */
|
|
207
|
+
author?: string;
|
|
208
|
+
/** Filter by keywords (AND logic) */
|
|
209
|
+
keywords?: string[];
|
|
210
|
+
/** Sort field */
|
|
211
|
+
sortBy?: 'title' | 'lastModified' | 'author' | 'category';
|
|
212
|
+
/** Sort order */
|
|
213
|
+
sortOrder?: 'asc' | 'desc';
|
|
214
|
+
/** Pagination: number of results per page */
|
|
215
|
+
limit?: number;
|
|
216
|
+
/** Pagination: page offset (0-based) */
|
|
217
|
+
offset?: number;
|
|
218
|
+
/** Include required-pages in results */
|
|
219
|
+
includeRequired?: boolean;
|
|
220
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema.org Person type (#617)
|
|
3
|
+
*
|
|
4
|
+
* Canonical core record for a person. Stored as one JSON file per person
|
|
5
|
+
* under `ngdpbase.application.persons.storagedir`. Filename is `<uuid>.json`
|
|
6
|
+
* (where the uuid matches the v4 segment of `@id`).
|
|
7
|
+
*
|
|
8
|
+
* `@id` uses the urn:uuid:<v4> form because persons typically lack a
|
|
9
|
+
* canonical web URL. `identifier` matches `User.username` so existing auth
|
|
10
|
+
* records link cleanly to a Person.
|
|
11
|
+
*
|
|
12
|
+
* No embedded role-records — those live in the future person-contacts
|
|
13
|
+
* addon (#602) and are folded in at JSON-LD export time.
|
|
14
|
+
*
|
|
15
|
+
* @see https://schema.org/Person
|
|
16
|
+
*/
|
|
17
|
+
import type { PostalAddress, ContactPoint } from './Organization.js';
|
|
18
|
+
/**
|
|
19
|
+
* Canonical Person record.
|
|
20
|
+
*
|
|
21
|
+
* Required: `@context`, `@type`, `@id`, `identifier`.
|
|
22
|
+
* Optional fields mirror schema.org Person.
|
|
23
|
+
*/
|
|
24
|
+
export interface Person {
|
|
25
|
+
'@context': 'https://schema.org';
|
|
26
|
+
'@type': 'Person';
|
|
27
|
+
/** urn:uuid:<v4> */
|
|
28
|
+
'@id': string;
|
|
29
|
+
/** Matches User.username so auth records link to this Person */
|
|
30
|
+
identifier: string;
|
|
31
|
+
/** Display name */
|
|
32
|
+
name?: string;
|
|
33
|
+
/** Given name (first name) */
|
|
34
|
+
givenName?: string;
|
|
35
|
+
/** Family name (last name) */
|
|
36
|
+
familyName?: string;
|
|
37
|
+
/** Email address */
|
|
38
|
+
email?: string;
|
|
39
|
+
/** Postal address */
|
|
40
|
+
address?: PostalAddress;
|
|
41
|
+
/** Contact points (work phone, mobile, etc.) */
|
|
42
|
+
contactPoint?: ContactPoint[];
|
|
43
|
+
/** ISO language tags this person knows */
|
|
44
|
+
knowsLanguage?: string[];
|
|
45
|
+
/** Profile/avatar image URL */
|
|
46
|
+
image?: string;
|
|
47
|
+
/** Other URLs that identify this person (LinkedIn, GitHub, etc.) */
|
|
48
|
+
sameAs?: string[];
|
|
49
|
+
/** Allow extension fields (additionalProperty, etc.) */
|
|
50
|
+
[key: string]: unknown;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Patch shape for update operations.
|
|
54
|
+
* `@context`/`@type` are immutable; `@id` and `identifier` cannot be changed via update.
|
|
55
|
+
*/
|
|
56
|
+
export type PersonUpdate = Partial<Omit<Person, '@context' | '@type' | '@id' | 'identifier'>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage seam for Person records (#617)
|
|
3
|
+
*
|
|
4
|
+
* File system is the v1 default. Future providers (LDAP, external directory)
|
|
5
|
+
* implement the same interface and register without touching PersonManager.
|
|
6
|
+
*/
|
|
7
|
+
import type { BaseProvider } from './Provider.js';
|
|
8
|
+
import type { Person, PersonUpdate } from './Person.js';
|
|
9
|
+
export interface PersonProvider extends BaseProvider {
|
|
10
|
+
/** Return all persons the provider can see. */
|
|
11
|
+
list(): Promise<Person[]>;
|
|
12
|
+
/** Look up a person by `@id` (urn:uuid:<v4>). */
|
|
13
|
+
getById(id: string): Promise<Person | null>;
|
|
14
|
+
/**
|
|
15
|
+
* Look up a person by `identifier` — typically the matching User.username.
|
|
16
|
+
* Returns null if no Person carries that identifier.
|
|
17
|
+
*/
|
|
18
|
+
getByIdentifier(identifier: string): Promise<Person | null>;
|
|
19
|
+
/** Persist a new Person. Returns the stored record. */
|
|
20
|
+
create(person: Person): Promise<Person>;
|
|
21
|
+
/** Apply a partial update by `@id`. Returns the updated record, or null if not found. */
|
|
22
|
+
update(id: string, patch: PersonUpdate): Promise<Person | null>;
|
|
23
|
+
/** Delete by `@id`. Returns true if a record was removed. */
|
|
24
|
+
delete(id: string): Promise<boolean>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Access policy shapes — declared once (#1431).
|
|
3
|
+
*
|
|
4
|
+
* A policy grants actions to subjects on resources. It is written in
|
|
5
|
+
* `ngdpbase.access.policies` and read through `ConfigurationManager`; nothing
|
|
6
|
+
* else grants.
|
|
7
|
+
*
|
|
8
|
+
* These were declared four times before this file: `PolicyManager` had its own
|
|
9
|
+
* `Policy`, `PolicyEvaluator` had `Policy`, `PolicySubject` and
|
|
10
|
+
* `PolicyResource`, `types/Share.ts` had `ShareResource` for the same
|
|
11
|
+
* `{ type, pattern }` pair, and `types/express.d.ts` re-declared that pair
|
|
12
|
+
* again because a `.d.ts` may not import a `.ts`. Four copies of one shape is
|
|
13
|
+
* how a field gets added to one and missed in the others.
|
|
14
|
+
*/
|
|
15
|
+
/** Who a policy grants to. `role` is the only type the evaluator matches today. */
|
|
16
|
+
export interface PolicySubject {
|
|
17
|
+
/** `role`, and in future `user` or `group`. */
|
|
18
|
+
type: string;
|
|
19
|
+
value: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* What a policy covers.
|
|
23
|
+
*
|
|
24
|
+
* `type` names the kind of thing — `page`, `media`, `asset`. `pattern` is
|
|
25
|
+
* matched against the resource's id; `*` is everything of that type.
|
|
26
|
+
*/
|
|
27
|
+
export interface PolicyResource {
|
|
28
|
+
type: string;
|
|
29
|
+
pattern: string;
|
|
30
|
+
}
|
|
31
|
+
/** One entry of `ngdpbase.access.policies`. */
|
|
32
|
+
export interface Policy {
|
|
33
|
+
id: string;
|
|
34
|
+
name?: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
/** Lower runs first, so a higher-priority deny lands last and wins. */
|
|
37
|
+
priority?: number;
|
|
38
|
+
/**
|
|
39
|
+
* `allow` or `deny`. Typed as a string because the value comes from
|
|
40
|
+
* configuration, where an operator can write anything; the evaluator treats
|
|
41
|
+
* everything that is not `deny` as an allow.
|
|
42
|
+
*/
|
|
43
|
+
effect?: string;
|
|
44
|
+
subjects?: PolicySubject[];
|
|
45
|
+
resources?: PolicyResource[];
|
|
46
|
+
actions?: string[];
|
|
47
|
+
[key: string]: unknown;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The thing a decision is about.
|
|
51
|
+
*
|
|
52
|
+
* Deliberately NOT a page name. The policies have always modelled resources as
|
|
53
|
+
* `{ type, pattern }` — `ShareResource` says so in as many words: "Resource
|
|
54
|
+
* type the evaluator knows: page, media, …" — while the call that asked for a
|
|
55
|
+
* decision flattened it to a page name, which is why assets, media and
|
|
56
|
+
* attachments each grew their own path.
|
|
57
|
+
*
|
|
58
|
+
* Deliberately not the domain object either. A decision takes a REFERENCE, so
|
|
59
|
+
* the PDP answers without loading anything — including when the answer is a
|
|
60
|
+
* flat no. An `AssetRecord` or a page's frontmatter is an ATTRIBUTE source: a
|
|
61
|
+
* PIP supplies it, and only when a policy actually depends on it. Passing the
|
|
62
|
+
* record would make every caller load it first, teach the PDP about each
|
|
63
|
+
* domain type in turn, and need a signature per type.
|
|
64
|
+
*/
|
|
65
|
+
export interface DecisionResource {
|
|
66
|
+
/**
|
|
67
|
+
* The kind of thing. This is the __permission target__ — the left half of
|
|
68
|
+
* every permission name: `page`, `asset`, `user`, `admin`, `comment`,
|
|
69
|
+
* `profile`, `search`, `share`, `store`, `token`. One vocabulary, declared
|
|
70
|
+
* once, rather than a second taxonomy beside the registry.
|
|
71
|
+
*
|
|
72
|
+
* Two inconsistencies to settle as resources start being used (#1431):
|
|
73
|
+
* shipped policies name only `page`, even on grants like `token-mint` and
|
|
74
|
+
* `user-edit`, so the clause is decorative for nine targets; and shares use
|
|
75
|
+
* `media` (`types/Share.ts`) where the permissions use `asset`.
|
|
76
|
+
*/
|
|
77
|
+
type: string;
|
|
78
|
+
/**
|
|
79
|
+
* Which one. A page's name or uuid; an asset's id.
|
|
80
|
+
*
|
|
81
|
+
* An asset is identified by `id` AND `providerId` (`types/Asset.ts`), so a
|
|
82
|
+
* reference to one must be provider-qualified or it is ambiguous.
|
|
83
|
+
*/
|
|
84
|
+
id: string;
|
|
85
|
+
}
|
|
86
|
+
/** What is being asked of the PDP. No resource means a capability question. */
|
|
87
|
+
export interface DecisionRequest {
|
|
88
|
+
action: string;
|
|
89
|
+
resource?: DecisionResource;
|
|
90
|
+
/**
|
|
91
|
+
* What the PIP knows about the resource beyond its reference, for the
|
|
92
|
+
* policy resource types that match on it (#1504): a page's
|
|
93
|
+
* `system-category`. The PDP passes it through; it never loads it.
|
|
94
|
+
*/
|
|
95
|
+
attributes?: Record<string, unknown>;
|
|
96
|
+
/**
|
|
97
|
+
* Whether a share's `resources` cover the thing being asked about.
|
|
98
|
+
*
|
|
99
|
+
* Supplied by the PEP because the answer depends on attributes the PDP does
|
|
100
|
+
* not hold — a page share is matched against the page's keywords, for
|
|
101
|
+
* instance. The PDP owns the RULE (a share must cover the resource); the
|
|
102
|
+
* caller supplies the match, which is the PIP half.
|
|
103
|
+
*/
|
|
104
|
+
resourceCoverage?: (shareResources: readonly PolicyResource[]) => boolean;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* What the PDP answers.
|
|
108
|
+
*
|
|
109
|
+
* `reason` is for the log and the audit record. A PEP enforces `permit` and
|
|
110
|
+
* chooses 401 vs 403 from whether the caller is authenticated — it must not
|
|
111
|
+
* branch on the reason, or the reason becomes an interface. The one exception
|
|
112
|
+
* is {@link STEP_UP_REASON}, read only by `ApiContext.enforceDeny` (#1431): the one
|
|
113
|
+
* refusal that offers a way forward (a fresh sign-in).
|
|
114
|
+
*/
|
|
115
|
+
export interface Decision {
|
|
116
|
+
permit: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Whether any policy spoke to this question at all.
|
|
119
|
+
*
|
|
120
|
+
* XACML's NotApplicable. Both outcomes refuse when `permit` is false, but
|
|
121
|
+
* they are different facts: a policy that said no is `policy_deny`, while
|
|
122
|
+
* no policy speaking is `default_deny`, and the audit trail must tell an
|
|
123
|
+
* assessor which one happened. Kept three-state for that, even though the
|
|
124
|
+
* page door no longer has a tier below this one to fall through to — the
|
|
125
|
+
* page-ACL markup tier it once fed was removed in #1431 step 7a.
|
|
126
|
+
*
|
|
127
|
+
* `permit` is always false when this is false — nothing has said yes.
|
|
128
|
+
*/
|
|
129
|
+
applicable: boolean;
|
|
130
|
+
reason: string;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The reason a deny carries when the subject holds the permission but its
|
|
134
|
+
* sign-in is not fresh enough to act (#1635). Declared once: the PDP writes it
|
|
135
|
+
* and `ApiContext.enforceDeny` reads it to ask for a fresh sign-in.
|
|
136
|
+
*/
|
|
137
|
+
export declare const STEP_UP_REASON = "step-up";
|
|
138
|
+
/** True when `pattern` covers `id` for a resource of that type. `*` is everything. */
|
|
139
|
+
export declare function resourceMatches(pattern: string, id: string): boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* The reason a deny carries when the subject holds the permission but its
|
|
4
|
+
* sign-in is not fresh enough to act (#1635). Declared once: the PDP writes it
|
|
5
|
+
* and `ApiContext.enforceDeny` reads it to ask for a fresh sign-in.
|
|
6
|
+
*/
|
|
7
|
+
export const STEP_UP_REASON = 'step-up';
|
|
8
|
+
/** True when `pattern` covers `id` for a resource of that type. `*` is everything. */
|
|
9
|
+
export function resourceMatches(pattern, id) {
|
|
10
|
+
if (pattern === '*')
|
|
11
|
+
return true;
|
|
12
|
+
if (pattern === id)
|
|
13
|
+
return true;
|
|
14
|
+
if (pattern.endsWith('*'))
|
|
15
|
+
return id.startsWith(pattern.slice(0, -1));
|
|
16
|
+
return false;
|
|
17
|
+
}
|