@jwilleke/ngdpbase-types 0.0.0 → 5.19.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 +427 -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 +188 -0
- package/lib/src/managers/DatabaseManager.js +590 -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/sqliteBackup.d.ts +128 -0
- package/lib/src/providers/sqliteBackup.js +365 -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 +169 -0
- package/lib/src/utils/auditEventNames.generated.js +174 -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,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared parsing/discovery for the `ngdpbase.managers.addons-manager.addons-path`
|
|
3
|
+
* config value.
|
|
4
|
+
*
|
|
5
|
+
* #924: `AddonsManager` (real runtime discovery) and `ConfigurationManager`
|
|
6
|
+
* (the #672 boot-time "does this enabled addon exist" safety check) used to
|
|
7
|
+
* each carry their own copy of this logic. They drifted: `AddonsManager` was
|
|
8
|
+
* updated for #673's `node_modules:<glob>` packaged-addon syntax, but the
|
|
9
|
+
* validator's copy was not, so it resolved a `node_modules:` entry as a
|
|
10
|
+
* literal (non-existent) directory and treated every packaged addon as
|
|
11
|
+
* "unknown" — crashing boot the moment one was enabled. Consolidating the
|
|
12
|
+
* parsing/matching into one module removes the class of bug, not just this
|
|
13
|
+
* instance of it.
|
|
14
|
+
*/
|
|
15
|
+
import * as fs from 'fs';
|
|
16
|
+
import * as path from 'path';
|
|
17
|
+
import { minimatch } from 'minimatch';
|
|
18
|
+
/** Prefix marking an addons-path entry as an npm-package glob rather than a directory. */
|
|
19
|
+
export const NPM_ADDON_PREFIX = 'node_modules:';
|
|
20
|
+
/**
|
|
21
|
+
* Coerce the raw config value (string or string[]) and split it into
|
|
22
|
+
* filesystem directory entries vs. `node_modules:<glob>` npm patterns.
|
|
23
|
+
*/
|
|
24
|
+
export function splitAddonsPath(raw) {
|
|
25
|
+
const entries = Array.isArray(raw) ? raw.map(String) : [String(raw)];
|
|
26
|
+
return {
|
|
27
|
+
directories: entries.filter(p => !p.startsWith(NPM_ADDON_PREFIX)),
|
|
28
|
+
npmPatterns: entries
|
|
29
|
+
.filter(p => p.startsWith(NPM_ADDON_PREFIX))
|
|
30
|
+
.map(p => p.slice(NPM_ADDON_PREFIX.length).trim())
|
|
31
|
+
.filter(Boolean)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/** The config key naming the add-ons to install (#1830). */
|
|
35
|
+
export const ADDONS_INSTALL_KEY = 'ngdpbase.addons.install';
|
|
36
|
+
/**
|
|
37
|
+
* Where installed add-ons live (#1830): `<data>/addons`, one folder per slug.
|
|
38
|
+
* Only a folder the lock file names, for a slug still in the install map, is
|
|
39
|
+
* an add-on (see `addonLock.ts`); anything else there is never loaded.
|
|
40
|
+
*/
|
|
41
|
+
export function installedAddonsDir(dataFolder, cwd = process.cwd()) {
|
|
42
|
+
return path.resolve(cwd, dataFolder, 'addons');
|
|
43
|
+
}
|
|
44
|
+
/** The slugs `ngdpbase.addons.install` names, from a merged or shipped+custom view. */
|
|
45
|
+
export function configuredInstallSlugs(config) {
|
|
46
|
+
const map = config[ADDONS_INSTALL_KEY];
|
|
47
|
+
return map && typeof map === 'object' && !Array.isArray(map) ? Object.keys(map) : [];
|
|
48
|
+
}
|
|
49
|
+
/** Locate the `node_modules` directory to search for packaged addons (resolved from cwd). */
|
|
50
|
+
export function findNodeModulesDir(cwd = process.cwd()) {
|
|
51
|
+
const nm = path.resolve(cwd, 'node_modules');
|
|
52
|
+
return fs.existsSync(nm) && fs.statSync(nm).isDirectory() ? nm : null;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Expand a `@scope/glob` (or bare `glob`) npm pattern to matching package
|
|
56
|
+
* directories under `nmRoot`.
|
|
57
|
+
*/
|
|
58
|
+
export function matchNpmPackageDirs(nmRoot, pattern) {
|
|
59
|
+
let baseDir = nmRoot;
|
|
60
|
+
let nameGlob = pattern;
|
|
61
|
+
if (pattern.startsWith('@')) {
|
|
62
|
+
const slash = pattern.indexOf('/');
|
|
63
|
+
const scope = slash > 0 ? pattern.slice(0, slash) : pattern;
|
|
64
|
+
nameGlob = slash > 0 ? pattern.slice(slash + 1) : '*';
|
|
65
|
+
baseDir = path.join(nmRoot, scope);
|
|
66
|
+
}
|
|
67
|
+
if (!fs.existsSync(baseDir))
|
|
68
|
+
return [];
|
|
69
|
+
const out = [];
|
|
70
|
+
for (const entry of fs.readdirSync(baseDir, { withFileTypes: true })) {
|
|
71
|
+
if (entry.isDirectory() && !entry.name.startsWith('.') && minimatch(entry.name, nameGlob)) {
|
|
72
|
+
out.push(path.join(baseDir, entry.name));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return out;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Best-effort addon identity for a packaged (npm) addon directory, derived
|
|
79
|
+
* from its package-directory name alone — no module import, matching the
|
|
80
|
+
* same boot-time-speed, no-module-loading design already accepted for the
|
|
81
|
+
* directory-scan case (see `ConfigurationManager.assertConfiguredAddonsExist`).
|
|
82
|
+
*
|
|
83
|
+
* Follows the documented packaged-addon naming convention
|
|
84
|
+
* (`@scope/<slug>-addon`, see docs/platform/deployment/addon-packaged.md):
|
|
85
|
+
* strips a trailing `-addon` suffix if present, else returns the folder name
|
|
86
|
+
* as-is.
|
|
87
|
+
*
|
|
88
|
+
* Caveat (same class as the existing directory-name heuristic): the addon's
|
|
89
|
+
* *real* identity is whatever its module exports as `name` at runtime. A
|
|
90
|
+
* package that doesn't follow the `-addon` naming convention, or whose
|
|
91
|
+
* module exports a different `name`, won't be matched precisely here — this
|
|
92
|
+
* is a validation-time approximation, not the source of truth.
|
|
93
|
+
*/
|
|
94
|
+
export function deriveAddonSlugFromPackageDirName(dirName) {
|
|
95
|
+
const suffix = '-addon';
|
|
96
|
+
return dirName.endsWith(suffix) ? dirName.slice(0, -suffix.length) : dirName;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Canonical identity for an addon directory (#927), resolved the SAME
|
|
100
|
+
* import-free way in every layer (discovery, `isEnabled`, the boot-time
|
|
101
|
+
* validator) so the four historical identities (folder name, module `name`,
|
|
102
|
+
* config key, manifest slug) can no longer drift:
|
|
103
|
+
*
|
|
104
|
+
* canonicalId = package.json `ngdpbase.slug` ?? deriveAddonSlugFromPackageDirName(folder)
|
|
105
|
+
*
|
|
106
|
+
* Reads `package.json` statically — never imports the module — which is what
|
|
107
|
+
* lets the boot validator compute the exact id the runtime will register
|
|
108
|
+
* under, instead of guessing. The module's exported `name` is a display
|
|
109
|
+
* label validated against this at load time, not a source of identity.
|
|
110
|
+
*/
|
|
111
|
+
export function resolveAddonSlug(addonDir, source) {
|
|
112
|
+
const dirName = path.basename(addonDir);
|
|
113
|
+
const pkgPath = path.join(addonDir, 'package.json');
|
|
114
|
+
try {
|
|
115
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
116
|
+
const slug = pkg?.ngdpbase?.slug;
|
|
117
|
+
if (typeof slug === 'string' && slug.trim())
|
|
118
|
+
return slug.trim();
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
/* no/invalid package.json — fall back to the folder-derived id */
|
|
122
|
+
}
|
|
123
|
+
// Fallback when no slug is declared. npm packages follow the
|
|
124
|
+
// `@scope/<slug>-addon` publishing convention, so strip the conventional
|
|
125
|
+
// trailing `-addon`. A plain directory (bundled/drop-in) addon's folder
|
|
126
|
+
// name IS its identity verbatim — an addon may legitimately be named
|
|
127
|
+
// `something-addon` on disk — so never strip there.
|
|
128
|
+
return source === 'npm' ? deriveAddonSlugFromPackageDirName(dirName) : dirName;
|
|
129
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file assetMetadataTags.ts
|
|
3
|
+
* @description Shared ExifTool tag mapping for asset metadata edits (#866, #999).
|
|
4
|
+
*
|
|
5
|
+
* Extracted from `BaseMediaProvider` so attachments (#999) and media items use
|
|
6
|
+
* one implementation rather than two that drift. The mapping encodes decisions
|
|
7
|
+
* made in #866 that are easy to get subtly wrong a second time:
|
|
8
|
+
*
|
|
9
|
+
* - **Keywords only.** ExifTool's MWG logic already mirrors `Keywords` to
|
|
10
|
+
* XMP-dc `Subject`; writing both doubles every entry in the list.
|
|
11
|
+
* - **Description twice, deliberately.** The read path resolves
|
|
12
|
+
* `Description ?? ImageDescription`, so both are written to keep a round-trip
|
|
13
|
+
* stable regardless of which one a given file already carries.
|
|
14
|
+
* - **Date tag depends on container.** Images take `DateTimeOriginal`; video
|
|
15
|
+
* and audio take QuickTime `CreateDate` (#750). Writing the wrong one
|
|
16
|
+
* silently fails to change the capture date the reader displays.
|
|
17
|
+
*
|
|
18
|
+
* Pure — no I/O — so the mapping is unit-testable without ExifTool present.
|
|
19
|
+
*/
|
|
20
|
+
import type { AssetMetadataPatch } from '../types/Asset.js';
|
|
21
|
+
/**
|
|
22
|
+
* Normalize a user-supplied timestamp to ExifTool's `YYYY:MM:DD HH:MM:SS`
|
|
23
|
+
* write format.
|
|
24
|
+
*
|
|
25
|
+
* Accepts `YYYY-MM-DD HH:MM[:SS]` and ISO-8601 `YYYY-MM-DDTHH:MM[:SS]`; a
|
|
26
|
+
* date-only value gets `00:00:00`.
|
|
27
|
+
*
|
|
28
|
+
* Rejects out-of-range parts rather than letting `Date` roll them over — a
|
|
29
|
+
* typo'd `2026-02-31` would otherwise be silently written as 3 March, which is
|
|
30
|
+
* worse than an error because the user believes the date they typed.
|
|
31
|
+
*
|
|
32
|
+
* @param input - User-supplied timestamp
|
|
33
|
+
* @returns ExifTool-format timestamp
|
|
34
|
+
* @throws Error on any other shape, or on out-of-range date parts
|
|
35
|
+
*/
|
|
36
|
+
export declare function normalizeExifDate(input: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Map an `AssetMetadataPatch` onto the ExifTool tags to write for a file of the
|
|
39
|
+
* given MIME type.
|
|
40
|
+
*
|
|
41
|
+
* Only fields present on the patch produce tags, so a partial edit never
|
|
42
|
+
* clears a field the caller did not mention. An explicit `null` DOES clear —
|
|
43
|
+
* that is how a user removes a value, and it is distinct from omission.
|
|
44
|
+
*
|
|
45
|
+
* @param patch - Fields the caller wants changed
|
|
46
|
+
* @param mimeType - The file's MIME type, which selects the date tag
|
|
47
|
+
* @returns ExifTool tag object, empty when the patch changes nothing
|
|
48
|
+
* @throws Error if `dateTimeOriginal` is present, non-null and unparseable
|
|
49
|
+
*/
|
|
50
|
+
export declare function buildMetadataWriteTags(patch: AssetMetadataPatch, mimeType: string): Record<string, unknown>;
|
|
51
|
+
/**
|
|
52
|
+
* Whether a MIME type can carry embedded metadata ExifTool can write (#999).
|
|
53
|
+
*
|
|
54
|
+
* Attachments are not curated media — a page can carry a `.zip`, a `.csv`, a
|
|
55
|
+
* `.json`. Writing EXIF to those either fails or corrupts them, so the caller
|
|
56
|
+
* must know when to persist the edit as sidecar metadata only rather than
|
|
57
|
+
* attempting a file write.
|
|
58
|
+
*
|
|
59
|
+
* Conservative allowlist rather than a denylist: an unrecognised type is
|
|
60
|
+
* treated as unwritable. Getting that wrong the safe way costs a sidecar-only
|
|
61
|
+
* edit; getting it wrong the other way damages a user's file.
|
|
62
|
+
*
|
|
63
|
+
* @param mimeType - The attachment's MIME type
|
|
64
|
+
* @returns Whether an embedded write should be attempted
|
|
65
|
+
*/
|
|
66
|
+
export declare function supportsEmbeddedMetadata(mimeType: string): boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Write `data` to `filePath` so that the path is never observed partially
|
|
3
|
+
* written.
|
|
4
|
+
*
|
|
5
|
+
* The temp file carries the pid and a per-process counter so two writers — or
|
|
6
|
+
* two processes sharing a volume — cannot collide on it and corrupt each
|
|
7
|
+
* other's staging file.
|
|
8
|
+
*
|
|
9
|
+
* @param filePath - final destination
|
|
10
|
+
* @param data - contents to write
|
|
11
|
+
* @param encoding - defaults to utf8
|
|
12
|
+
* @param options.fsync - also flush to the device. Off by default; see the file
|
|
13
|
+
* header for why, and for the measured cost.
|
|
14
|
+
* @param options.mode - permission bits for the file, e.g. `0o600` for a file
|
|
15
|
+
* holding secrets (#1524, #1560). Set on the temp file before any data is
|
|
16
|
+
* written, so the secret is never on disk with wider permissions; the rename
|
|
17
|
+
* keeps them. Absent: the process default, as before.
|
|
18
|
+
* @param options.exclusive - create only: refuse (EEXIST) when `filePath`
|
|
19
|
+
* already exists, instead of replacing it (#1625). The finished temp file is
|
|
20
|
+
* published with a hard link, which fails atomically if the name is taken,
|
|
21
|
+
* so a crash mid-write never leaves a truncated file under the real name.
|
|
22
|
+
*/
|
|
23
|
+
export declare function writeFileAtomic(filePath: string, data: string | Buffer, encoding?: BufferEncoding, options?: {
|
|
24
|
+
fsync?: boolean;
|
|
25
|
+
mode?: number;
|
|
26
|
+
exclusive?: boolean;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
export default writeFileAtomic;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Administrative configuration changes as audit events (#1150).
|
|
3
|
+
*
|
|
4
|
+
* `auditRegistry` marked `admin-system` as `exempt: 'not-implemented'`, so no
|
|
5
|
+
* configuration change was audited anywhere. An administrator could change any
|
|
6
|
+
* setting on the instance — whether HTML is sanitised, the login throttle
|
|
7
|
+
* thresholds, the outbound egress ranges, the session cookie flags, whether
|
|
8
|
+
* auditing runs at all — and the log held no record, while faithfully
|
|
9
|
+
* recording that somebody viewed a page.
|
|
10
|
+
*
|
|
11
|
+
* See D19 of docs/security-posture.md, which needs this: the security posture
|
|
12
|
+
* is edited from a web form, so a change to it must leave a trace.
|
|
13
|
+
*/
|
|
14
|
+
import type { AuditEvent } from './auditEvents.js';
|
|
15
|
+
import type { ActorAttribution } from '../context/ActorContext.js';
|
|
16
|
+
/**
|
|
17
|
+
* Is this key one the operator has declared secret?
|
|
18
|
+
*
|
|
19
|
+
* The list is `ngdpbase.config.sensitive-values` (its `secret` entries), the same one that masks values on
|
|
20
|
+
* `/admin/configuration` and drives log redaction. It is operator-editable
|
|
21
|
+
* configuration, so it can contain anything: non-string entries are ignored
|
|
22
|
+
* rather than throwing, because a malformed list must not stop a config change
|
|
23
|
+
* from being recorded.
|
|
24
|
+
*/
|
|
25
|
+
export declare function isSecretKey(key: string, secretKeys: unknown): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Render a configuration value for the record.
|
|
28
|
+
*
|
|
29
|
+
* Primitives are kept as they are, so a reader filtering on `after: true` gets
|
|
30
|
+
* what they expect. Anything else becomes JSON, truncated past
|
|
31
|
+
* {@link MAX_VALUE_CHARS} with an explicit marker — a truncated value that does
|
|
32
|
+
* not say it was truncated is worse than no value at all.
|
|
33
|
+
*/
|
|
34
|
+
export declare function describeConfigValue(value: unknown): unknown;
|
|
35
|
+
export interface ConfigChangeInput {
|
|
36
|
+
key: string;
|
|
37
|
+
before: unknown;
|
|
38
|
+
after: unknown;
|
|
39
|
+
/** Who made the change — from the context the write was handed (#1179), never guessed. */
|
|
40
|
+
actor: ActorAttribution;
|
|
41
|
+
/** Whether the key is named in `ngdpbase.config.sensitive-values` (its `secret` entries). */
|
|
42
|
+
secret: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Build the audit event for a configuration change.
|
|
46
|
+
*
|
|
47
|
+
* A secret key records __that it changed and neither value__. An entry naming
|
|
48
|
+
* a key alongside its before and after values would reintroduce the disclosure
|
|
49
|
+
* `ngdpbase.config.sensitive-values` (its `secret` entries) exists to prevent, by a different route and
|
|
50
|
+
* into a file with a longer retention than the logs it already guards.
|
|
51
|
+
*
|
|
52
|
+
* Severity is uniform. Grading a security-relevant key higher would need a
|
|
53
|
+
* list of which keys those are, and inventing one here — ahead of the posture
|
|
54
|
+
* ingredient list in D15 — would be a second, drifting definition of the same
|
|
55
|
+
* thing.
|
|
56
|
+
*/
|
|
57
|
+
export declare function buildConfigChangeAuditEvent(input: ConfigChangeInput): AuditEvent;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every audit event name, in code (#1201, #1638, epic #1208).
|
|
3
|
+
*
|
|
4
|
+
* Configuration declares the names (`ngdpbase.audit.events`). Core's names are
|
|
5
|
+
* generated from `config/app-default-config.json` into
|
|
6
|
+
* `auditEventNames.generated.ts` by `npm run generate:permissions`, and
|
|
7
|
+
* `npm run lint:permissions` fails when that file is stale, so there is one
|
|
8
|
+
* declaration and no hand-kept list. `AuditEvent.eventType` is typed, so a
|
|
9
|
+
* core emitter cannot compile with a name configuration does not declare; a
|
|
10
|
+
* rename is one edit in configuration plus a regeneration, and the compiler
|
|
11
|
+
* finds every call site.
|
|
12
|
+
*
|
|
13
|
+
* An addon declares its own events in its `config/default-config.json`; they
|
|
14
|
+
* reach the registry through the configuration merge while the addon is
|
|
15
|
+
* enabled (addonConfigLayer.ts). The generated union cannot name them, and
|
|
16
|
+
* widening it to `string` would let a core typo compile again. So an addon
|
|
17
|
+
* names its event through {@link addonAuditEventName}, which brands a checked
|
|
18
|
+
* string, and `recordAuditEvent` refuses — throws — a branded name the merged
|
|
19
|
+
* registry does not declare. Core typing stays exactly as strict as before.
|
|
20
|
+
*
|
|
21
|
+
* Convention: `{target}-{action}`, hyphens only, URL-safe, sharing the slug of
|
|
22
|
+
* the permission whose action it records (`page-read` authorizes; `page-read`
|
|
23
|
+
* records). The containing map says which is meant.
|
|
24
|
+
*/
|
|
25
|
+
import { AUDIT_EVENT, AUDIT_EVENT_NAME_PATTERN, type AuditEventName } from './auditEventNames.generated.js';
|
|
26
|
+
export { AUDIT_EVENT, AUDIT_EVENT_NAME_PATTERN, type AuditEventName };
|
|
27
|
+
/** Every core name, sorted, for tests and tooling. */
|
|
28
|
+
export declare function auditEventNames(): AuditEventName[];
|
|
29
|
+
/** Is this one of the names core declares (and so one the generated union admits)? */
|
|
30
|
+
export declare function isCoreAuditEventName(name: string): name is AuditEventName;
|
|
31
|
+
declare const addonAuditEventBrand: unique symbol;
|
|
32
|
+
/**
|
|
33
|
+
* An audit event name an addon declares (#1638). A string literal is not one:
|
|
34
|
+
* the only way to get one is {@link addonAuditEventName}, so the brand marks a
|
|
35
|
+
* name that went through the check, and a core typo still fails to compile.
|
|
36
|
+
*/
|
|
37
|
+
export type AddonAuditEventName = string & {
|
|
38
|
+
readonly [addonAuditEventBrand]: true;
|
|
39
|
+
};
|
|
40
|
+
/** What `recordAuditEvent` accepts: a core name, or an addon's checked name. */
|
|
41
|
+
export type RecordableAuditEventName = AuditEventName | AddonAuditEventName;
|
|
42
|
+
/**
|
|
43
|
+
* Name an addon's audit event. Throws on a name outside `{target}-{action}`.
|
|
44
|
+
*
|
|
45
|
+
* Whether the name is declared is checked when the event is recorded, not
|
|
46
|
+
* here: the registry is bound when AuditManager initialises, which may be
|
|
47
|
+
* after the addon module loads. `lint:audit` reads the literal passed here as
|
|
48
|
+
* the addon's emitter, so pass a string literal.
|
|
49
|
+
*/
|
|
50
|
+
export declare function addonAuditEventName(name: string): AddonAuditEventName;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/** The `{target}-{action}` convention: target first, hyphens only (#1201). */
|
|
2
|
+
export declare const AUDIT_EVENT_NAME_PATTERN: RegExp;
|
|
3
|
+
/** Every audit event core declares, keyed by the name upper-cased with underscores. */
|
|
4
|
+
export declare const AUDIT_EVENT: {
|
|
5
|
+
/** An add-on named in ngdpbase.addons.install installed into the data folder: package, version, sha512 and the repository its provenance names; recorded before it is written, which cannot proceed without it (#1830) */
|
|
6
|
+
readonly ADDON_INSTALL: "addon-install";
|
|
7
|
+
/** An installed add-on moved to another version by an administrator's Update: who, and from which version to which (#1830; the Update action is not built yet) */
|
|
8
|
+
readonly ADDON_UPDATE: "addon-update";
|
|
9
|
+
/** An add-on refused or set aside by a check: its sha512, provenance, tarball contents, package.json, the lock file, or a changed installed folder (#1830) */
|
|
10
|
+
readonly ADDON_VERIFY_FAILED: "addon-verify-failed";
|
|
11
|
+
/** Admin dashboard read; not recorded, read volume */
|
|
12
|
+
readonly ADMIN_READ: "admin-read";
|
|
13
|
+
/** File deleted; destruction */
|
|
14
|
+
readonly ASSET_DELETE: "asset-delete";
|
|
15
|
+
/** Attachment metadata edited; EXIF/IPTC and catalog fields change provenance */
|
|
16
|
+
readonly ASSET_EDIT: "asset-edit";
|
|
17
|
+
/** Attachment read; not recorded, read volume */
|
|
18
|
+
readonly ASSET_READ: "asset-read";
|
|
19
|
+
/** File uploaded */
|
|
20
|
+
readonly ASSET_UPLOAD: "asset-upload";
|
|
21
|
+
/** Hash chain restarted, with the reason; the marker is the action and cannot half-complete */
|
|
22
|
+
readonly AUDIT_CHAIN_RESTART: "audit-chain-restart";
|
|
23
|
+
/** The audit trail exported to a file; who took a copy, in what format, with what filter */
|
|
24
|
+
readonly AUDIT_EXPORT: "audit-export";
|
|
25
|
+
/** Sign-in failed */
|
|
26
|
+
readonly AUTHENTICATION_FAILED: "authentication-failed";
|
|
27
|
+
/** User signed out */
|
|
28
|
+
readonly AUTHENTICATION_LOGOUT: "authentication-logout";
|
|
29
|
+
/** Sign-in succeeded */
|
|
30
|
+
readonly AUTHENTICATION_SUCCESS: "authentication-success";
|
|
31
|
+
/** Access granted; emitter exists, nothing in production calls it */
|
|
32
|
+
readonly AUTHORIZATION_ALLOW: "authorization-allow";
|
|
33
|
+
/** Access denied */
|
|
34
|
+
readonly AUTHORIZATION_DENY: "authorization-deny";
|
|
35
|
+
/** A full backup written; where it went and who asked */
|
|
36
|
+
readonly BACKUP_CREATE: "backup-create";
|
|
37
|
+
/** A restore of a backup's databases started from Admin → Backup: which backup and who asked; recorded before the fresh backup and the staging, which cannot proceed without it (#1723) */
|
|
38
|
+
readonly BACKUP_RESTORE: "backup-restore";
|
|
39
|
+
/** A staged database restore cancelled before the restart applied it: which backup, who staged it and who cancelled; recorded first, which cannot proceed without it (#1723) */
|
|
40
|
+
readonly BACKUP_RESTORE_CANCEL: "backup-restore-cancel";
|
|
41
|
+
/** A staged database restore replaced by another before the restart applied it: which backup replaced which, and who asked; recorded first, which cannot proceed without it (#1723) */
|
|
42
|
+
readonly BACKUP_RESTORE_REPLACE: "backup-restore-replace";
|
|
43
|
+
/** Comment added to a page — user content written on someone's behalf, the page-edit class (#1232) */
|
|
44
|
+
readonly COMMENT_CREATE: "comment-create";
|
|
45
|
+
/** Comment marked deleted; who removed it and whose it was (#1232) */
|
|
46
|
+
readonly COMMENT_DELETE: "comment-delete";
|
|
47
|
+
/** Configuration changed by an administrator; standard so a broken audit configuration can still be repaired from the UI */
|
|
48
|
+
readonly CONFIG_CHANGE: "config-change";
|
|
49
|
+
/** Every custom configuration value discarded; recorded before the reset, which cannot proceed without it */
|
|
50
|
+
readonly CONFIG_RESET: "config-reset";
|
|
51
|
+
/** A page's footnote list changed — action add, import, transfer, update or delete; page content written on someone's behalf (#1233) */
|
|
52
|
+
readonly FOOTNOTE_EDIT: "footnote-edit";
|
|
53
|
+
/** A background job finished successfully */
|
|
54
|
+
readonly JOB_COMPLETED: "job-completed";
|
|
55
|
+
/** A background job failed */
|
|
56
|
+
readonly JOB_FAILED: "job-failed";
|
|
57
|
+
/** A scheduled run stopped by shutdown and handed to the next start, which resumes it */
|
|
58
|
+
readonly JOB_INTERRUPTED: "job-interrupted";
|
|
59
|
+
/** An administrator retried a scheduled run now instead of at its retry time */
|
|
60
|
+
readonly JOB_RETRY: "job-retry";
|
|
61
|
+
/** A scheduled job's rule changed; its slots are counted again from then */
|
|
62
|
+
readonly JOB_SCHEDULE_CHANGE: "job-schedule-change";
|
|
63
|
+
/** Scheduled slots a job passed over, by its catch-up or overlap rule */
|
|
64
|
+
readonly JOB_SKIPPED: "job-skipped";
|
|
65
|
+
/** A background job started, and who asked for it */
|
|
66
|
+
readonly JOB_STARTED: "job-started";
|
|
67
|
+
/** A manager changed state: degraded, disabled, failed or recovered */
|
|
68
|
+
readonly MANAGER_STATE_CHANGE: "manager-state-change";
|
|
69
|
+
/** OpenID Connect: an app's sign-in request was allowed and a code issued (#1575) */
|
|
70
|
+
readonly OIDCAUTHORIZE_ALLOW: "oidcauthorize-allow";
|
|
71
|
+
/** OpenID Connect: an app's sign-in request was refused (denied consent, sign-in required, bad request) */
|
|
72
|
+
readonly OIDCAUTHORIZE_DENY: "oidcauthorize-deny";
|
|
73
|
+
/** OpenID Connect: an app's grant and every token under it were revoked */
|
|
74
|
+
readonly OIDCGRANT_REVOKE: "oidcgrant-revoke";
|
|
75
|
+
/** OpenID Connect: the provider failed while handling a request */
|
|
76
|
+
readonly OIDCSERVER_ERROR: "oidcserver-error";
|
|
77
|
+
/** OpenID Connect: the token endpoint refused an app's request */
|
|
78
|
+
readonly OIDCTOKEN_ERROR: "oidctoken-error";
|
|
79
|
+
/** OpenID Connect: tokens issued to an app, with the grant type that earned them */
|
|
80
|
+
readonly OIDCTOKEN_ISSUE: "oidctoken-issue";
|
|
81
|
+
/** OpenID Connect: a used code or refresh token was presented again; its grant was revoked (possible replay) */
|
|
82
|
+
readonly OIDCTOKEN_REUSE: "oidctoken-reuse";
|
|
83
|
+
/** OpenID Connect: an access or refresh token was destroyed */
|
|
84
|
+
readonly OIDCTOKEN_REVOKE: "oidctoken-revoke";
|
|
85
|
+
/** OpenID Connect: UserInfo refused a request (bad, expired or revoked token, unknown account) */
|
|
86
|
+
readonly OIDCUSERINFO_ERROR: "oidcuserinfo-error";
|
|
87
|
+
/** Page created */
|
|
88
|
+
readonly PAGE_CREATE: "page-create";
|
|
89
|
+
/** Page deleted; destruction, so the record must outlive the page */
|
|
90
|
+
readonly PAGE_DELETE: "page-delete";
|
|
91
|
+
/** Page edited */
|
|
92
|
+
readonly PAGE_EDIT: "page-edit";
|
|
93
|
+
/** Page exported to a file; bulk extraction of content, gated on read until a bulk surface exists */
|
|
94
|
+
readonly PAGE_EXPORT: "page-export";
|
|
95
|
+
/** Inbound links rewritten after a rename */
|
|
96
|
+
readonly PAGE_LINK_REWRITE: "page-link-rewrite";
|
|
97
|
+
/** Page edited through the admin raw editor */
|
|
98
|
+
readonly PAGE_RAW_EDIT: "page-raw-edit";
|
|
99
|
+
/** Page read; off by default so a general-purpose deployment does not drown its log in reads. On, a records-style deployment gets who looked at what (#1129) */
|
|
100
|
+
readonly PAGE_READ: "page-read";
|
|
101
|
+
/** Page renamed */
|
|
102
|
+
readonly PAGE_RENAME: "page-rename";
|
|
103
|
+
/** Security policy evaluated; emitter exists, nothing in production calls it */
|
|
104
|
+
readonly POLICY_EVALUATE: "policy-evaluate";
|
|
105
|
+
/** Security posture at startup, compared against the previous start */
|
|
106
|
+
readonly POSTURE_RECORDED: "posture-recorded";
|
|
107
|
+
/** Proxy grant made: someone may act for the person named in user; actor is who made it (#1762) */
|
|
108
|
+
readonly PROXY_GRANT: "proxy-grant";
|
|
109
|
+
/** Proxy grant ended: revoked, or the account closed; user is the person represented, actor who ended it (#1762) */
|
|
110
|
+
readonly PROXY_REVOKE: "proxy-revoke";
|
|
111
|
+
/** A signed-in session started or stopped acting for someone under a proxy grant, or opens their private store: chosen, switched-back, ended because the grant no longer allows it (grant-ended, proxy-access-off), or vault-opened; user is the person represented, actor the person signed in (#1762) */
|
|
112
|
+
readonly PROXY_SWITCH: "proxy-switch";
|
|
113
|
+
/** Step-up: a re-authentication failed (wrong password, another person's passkey, throttled) */
|
|
114
|
+
readonly REAUTH_FAILURE: "reauth-failure";
|
|
115
|
+
/** Step-up: an action asked for a fresh sign-in (#1525) — or refused a delegated credential that cannot give one */
|
|
116
|
+
readonly REAUTH_PROMPT: "reauth-prompt";
|
|
117
|
+
/** Step-up: the person re-authenticated, with the factor used */
|
|
118
|
+
readonly REAUTH_SUCCESS: "reauth-success";
|
|
119
|
+
/** Page search; not recorded, read volume */
|
|
120
|
+
readonly SEARCH_PAGE: "search-page";
|
|
121
|
+
/** People searched for; enumerating people is disclosive in a way searching pages is not. Off by default as read volume */
|
|
122
|
+
readonly SEARCH_USER: "search-user";
|
|
123
|
+
/** A masked configuration value shown to an administrator; the key is recorded, never the value */
|
|
124
|
+
readonly SECRET_REVEAL: "secret-reveal";
|
|
125
|
+
/** Security violation detected; the kind is in metadata.securityEventType */
|
|
126
|
+
readonly SECURITY_EVENT: "security-event";
|
|
127
|
+
/** Anonymous sessions cleared */
|
|
128
|
+
readonly SESSION_CLEAR_ANONYMOUS: "session-clear-anonymous";
|
|
129
|
+
/** Session revoked by an administrator */
|
|
130
|
+
readonly SESSION_REVOKE: "session-revoke";
|
|
131
|
+
/** Share link used; batched counts for keyword links, one record per page or file opened through a vault link (#1388) */
|
|
132
|
+
readonly SHARE_ACCESS: "share-access";
|
|
133
|
+
/** Share link created; mints an anonymous-access credential, the same shape as token-mint */
|
|
134
|
+
readonly SHARE_CREATE: "share-create";
|
|
135
|
+
/** Share link's lifetime extended by its issuer, by up to 24 hours (#1388) */
|
|
136
|
+
readonly SHARE_EXTEND: "share-extend";
|
|
137
|
+
/** Share link revoked; pairs with token-revoke */
|
|
138
|
+
readonly SHARE_REVOKE: "share-revoke";
|
|
139
|
+
/** A user's private store copy created at its door (#1414) — with key material when sealed; never the words or a key in the record */
|
|
140
|
+
readonly STORE_CREATE: "store-create";
|
|
141
|
+
/** A takeout imported into its owner's private store; a bulk write — who, which store, pages and files written or skipped */
|
|
142
|
+
readonly STORE_IMPORT: "store-import";
|
|
143
|
+
/** A whole private store downloaded by its owner, DECRYPTED; who took it, which store, and how much left */
|
|
144
|
+
readonly STORE_TAKEOUT: "store-takeout";
|
|
145
|
+
/** Instance shut down cleanly; its absence before the next start is the signal */
|
|
146
|
+
readonly SYSTEM_SHUTDOWN: "system-shutdown";
|
|
147
|
+
/** Instance started; reports whether the previous run ended cleanly */
|
|
148
|
+
readonly SYSTEM_START: "system-start";
|
|
149
|
+
/** Agent token's expiry moved later by its owner; carries the old and new expiry (#1734) */
|
|
150
|
+
readonly TOKEN_EXTEND: "token-extend";
|
|
151
|
+
/** Agent token minted; a credential nobody knows exists is the worst case */
|
|
152
|
+
readonly TOKEN_MINT: "token-mint";
|
|
153
|
+
/** Agent token revoked */
|
|
154
|
+
readonly TOKEN_REVOKE: "token-revoke";
|
|
155
|
+
/** Account created; by an administrator, by self-registration, or provisioned by an identity provider */
|
|
156
|
+
readonly USER_CREATE: "user-create";
|
|
157
|
+
/** Account deleted; destruction of an identity and its attribution, recorded before the delete */
|
|
158
|
+
readonly USER_DELETE: "user-delete";
|
|
159
|
+
/** Account changed in a way that alters what it may do or who holds it: roles, password, active, external, email, profile lock. Preference edits are not recorded */
|
|
160
|
+
readonly USER_EDIT: "user-edit";
|
|
161
|
+
/** User profile read; not recorded, read volume */
|
|
162
|
+
readonly USER_READ: "user-read";
|
|
163
|
+
/** Not an action: read from a proxy grant at the vault door; the grant itself is recorded as proxy-grant */
|
|
164
|
+
readonly VAULT_PROXY: "vault-proxy";
|
|
165
|
+
/** A vault page's leftovers moved into its vault (#1842): its shared-pool files (moved, or copied where other public pages use them) and its footnotes and comments from the public folders. Names the owner, vault and page uuid and the counts, never a title or file name. Run by the vault's owner, or for a vault that isn't sealed by someone holding admin-system */
|
|
166
|
+
readonly VAULT_REPAIR: "vault-repair";
|
|
167
|
+
};
|
|
168
|
+
/** A name core code may emit. */
|
|
169
|
+
export type AuditEventName = (typeof AUDIT_EVENT)[keyof typeof AUDIT_EVENT];
|