@jwilleke/ngdpbase-types 5.25.0 → 5.26.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/README.md +1 -1
- package/lib/packages/ngdpbase-types/index.d.ts +4 -0
- package/lib/src/http/egressPolicy.js +61 -0
- package/lib/src/http/guardedElasticsearch.d.ts +27 -0
- package/lib/src/http/guardedElasticsearch.js +99 -0
- package/lib/src/managers/AddonsManager.d.ts +37 -1
- package/lib/src/managers/AttachmentManager.d.ts +4 -5
- package/lib/src/managers/AuthManager.d.ts +150 -32
- package/lib/src/managers/BackgroundJobManager.d.ts +22 -12
- package/lib/src/managers/BackupManager.d.ts +779 -0
- package/lib/src/managers/BackupManager.js +2042 -0
- package/lib/src/managers/BaseManager.d.ts +156 -6
- package/lib/src/managers/BaseManager.js +64 -2
- package/lib/src/managers/CommentManager.d.ts +6 -6
- package/lib/src/managers/ConsentManager.d.ts +130 -0
- package/lib/src/managers/DatabaseManager.d.ts +6 -0
- package/lib/src/managers/DatabaseManager.js +25 -15
- package/lib/src/managers/FootnoteManager.d.ts +6 -6
- package/lib/src/managers/OrganizationManager.d.ts +8 -6
- package/lib/src/managers/PageManager.d.ts +16 -0
- package/lib/src/managers/PersonManager.d.ts +8 -6
- package/lib/src/managers/RoleManager.d.ts +6 -8
- package/lib/src/providers/BaseAttachmentProvider.d.ts +4 -4
- package/lib/src/providers/BaseBackupProvider.d.ts +77 -0
- package/lib/src/providers/BaseBackupProvider.js +52 -0
- package/lib/src/providers/BasicAttachmentProvider.d.ts +4 -4
- package/lib/src/providers/FileBackupProvider.d.ts +34 -0
- package/lib/src/providers/FileBackupProvider.js +116 -0
- package/lib/src/providers/FileConsentProvider.d.ts +18 -0
- package/lib/src/providers/SqliteDatabaseProvider.d.ts +2 -2
- package/lib/src/providers/SqliteDatabaseProvider.js +12 -11
- package/lib/src/providers/attachmentFilesBackup.d.ts +5 -4
- package/lib/src/providers/databaseMigrations.js +45 -0
- package/lib/src/security/PolicyDecisionPoint.d.ts +14 -0
- package/lib/src/types/Consent.d.ts +90 -0
- package/lib/src/types/express.d.ts +6 -0
- package/lib/src/utils/addonHost.d.ts +22 -0
- package/lib/src/utils/addonHost.js +14 -1
- package/lib/src/utils/auditEventNames.generated.d.ts +20 -0
- package/lib/src/utils/auditEventNames.generated.js +20 -0
- package/lib/src/utils/backupCrypto.js +275 -0
- package/lib/src/utils/backupDocument.d.ts +36 -0
- package/lib/src/utils/backupDocument.js +99 -0
- package/lib/src/utils/browserDescription.d.ts +11 -0
- package/lib/src/utils/directoryBackup.d.ts +48 -48
- package/lib/src/utils/directoryBackup.js +291 -0
- package/lib/src/utils/instanceEnvBackup.d.ts +46 -0
- package/lib/src/utils/instanceEnvBackup.js +120 -0
- package/lib/src/utils/instanceEnvSecret.js +79 -0
- package/lib/src/utils/ipLocation.d.ts +11 -0
- package/lib/src/utils/schedule.js +171 -0
- package/lib/src/utils/secretFileMode.js +78 -0
- package/lib/src/utils/siteRestore.d.ts +13 -16
- package/lib/src/utils/siteRestore.js +33 -6
- package/lib/src/utils/treeArchive.d.ts +2 -0
- package/lib/src/utils/treeArchive.js +242 -0
- package/lib/src/utils/version.js +408 -0
- package/package.json +6 -1
- package/lib/src/utils/administrators.d.ts +0 -21
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Version Management Script for ngdpbase
|
|
4
|
+
*
|
|
5
|
+
* Helps manage semantic versioning for the project.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* node version.js - Show current version
|
|
9
|
+
* node version.js patch - Increment patch version (bug fixes)
|
|
10
|
+
* node version.js minor - Increment minor version (new features)
|
|
11
|
+
* node version.js major - Increment major version (breaking changes)
|
|
12
|
+
* node version.js set <version> - Set specific version
|
|
13
|
+
*/
|
|
14
|
+
import fs from 'fs';
|
|
15
|
+
import path from 'path';
|
|
16
|
+
import { execSync } from 'child_process';
|
|
17
|
+
import { fileURLToPath } from 'url';
|
|
18
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
19
|
+
const __dirname = path.dirname(__filename);
|
|
20
|
+
// Find project root by walking up from __dirname until we find package.json
|
|
21
|
+
function findProjectRoot() {
|
|
22
|
+
let dir = __dirname;
|
|
23
|
+
while (dir !== path.dirname(dir)) {
|
|
24
|
+
if (fs.existsSync(path.join(dir, 'package.json'))) {
|
|
25
|
+
return dir;
|
|
26
|
+
}
|
|
27
|
+
dir = path.dirname(dir);
|
|
28
|
+
}
|
|
29
|
+
throw new Error('Could not find project root (no package.json found)');
|
|
30
|
+
}
|
|
31
|
+
const PROJECT_ROOT = findProjectRoot();
|
|
32
|
+
const PACKAGE_JSON_PATH = path.join(PROJECT_ROOT, 'package.json');
|
|
33
|
+
const PACKAGE_LOCK_PATH = path.join(PROJECT_ROOT, 'package-lock.json');
|
|
34
|
+
const CHANGELOG_PATH = path.join(PROJECT_ROOT, 'CHANGELOG.md');
|
|
35
|
+
const APP_CONFIG_PATH = path.join(PROJECT_ROOT, 'config/app-default-config.json');
|
|
36
|
+
/**
|
|
37
|
+
* Read package.json
|
|
38
|
+
*
|
|
39
|
+
* @returns {PackageJson} Parsed package.json
|
|
40
|
+
*/
|
|
41
|
+
function readPackageJson() {
|
|
42
|
+
try {
|
|
43
|
+
const content = fs.readFileSync(PACKAGE_JSON_PATH, 'utf8');
|
|
44
|
+
return JSON.parse(content);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
console.error('Error reading package.json:', error.message);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Write package.json
|
|
53
|
+
*
|
|
54
|
+
* @param {PackageJson} packageData - Package data to write
|
|
55
|
+
*/
|
|
56
|
+
function writePackageJson(packageData) {
|
|
57
|
+
try {
|
|
58
|
+
const content = JSON.stringify(packageData, null, 2) + '\n';
|
|
59
|
+
fs.writeFileSync(PACKAGE_JSON_PATH, content);
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
console.error('Error writing package.json:', error.message);
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Update version in app-default-config.json
|
|
68
|
+
*
|
|
69
|
+
* @param {string} newVersion - New version string
|
|
70
|
+
*/
|
|
71
|
+
function updateAppConfig(newVersion) {
|
|
72
|
+
try {
|
|
73
|
+
const content = fs.readFileSync(APP_CONFIG_PATH, 'utf8');
|
|
74
|
+
const config = JSON.parse(content);
|
|
75
|
+
config['ngdpbase.version'] = newVersion;
|
|
76
|
+
fs.writeFileSync(APP_CONFIG_PATH, JSON.stringify(config, null, 2) + '\n');
|
|
77
|
+
console.log(`Updated app-default-config.json with version ${newVersion}`);
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
console.warn('Warning: Could not update app-default-config.json:', error.message);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Update the version fields in package-lock.json.
|
|
85
|
+
*
|
|
86
|
+
* The lockfile mirrors the project version in two places — the top-level
|
|
87
|
+
* `version` and the root package entry `packages[""].version` — and npm rewrites
|
|
88
|
+
* both on the next `npm install`. Leaving them behind meant every satellite
|
|
89
|
+
* checkout showed a two-line `package-lock.json` diff after any build, which had
|
|
90
|
+
* to be inspected and discarded by hand at every release. Keeping them in
|
|
91
|
+
* lockstep here removes the drift at the source.
|
|
92
|
+
*
|
|
93
|
+
* A parse → mutate → `JSON.stringify(…, null, 2)` round-trip is byte-identical
|
|
94
|
+
* to npm's own formatting for this lockfile, so this rewrites exactly the two
|
|
95
|
+
* version lines and nothing else. Dependency resolution is untouched: only the
|
|
96
|
+
* project's own version is edited, never any package entry.
|
|
97
|
+
*
|
|
98
|
+
* Warns rather than fails — a missing or unparseable lockfile must not abort a
|
|
99
|
+
* release, matching how a missing app-default-config.json is handled.
|
|
100
|
+
*
|
|
101
|
+
* @param {string} newVersion - New version string
|
|
102
|
+
*/
|
|
103
|
+
function updatePackageLock(newVersion) {
|
|
104
|
+
try {
|
|
105
|
+
if (!fs.existsSync(PACKAGE_LOCK_PATH)) {
|
|
106
|
+
console.warn('Warning: package-lock.json not found, skipping');
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const content = fs.readFileSync(PACKAGE_LOCK_PATH, 'utf8');
|
|
110
|
+
const lock = applyVersionToLock(JSON.parse(content), newVersion);
|
|
111
|
+
fs.writeFileSync(PACKAGE_LOCK_PATH, JSON.stringify(lock, null, 2) + '\n');
|
|
112
|
+
console.log(`Updated package-lock.json with version ${newVersion}`);
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
console.warn('Warning: Could not update package-lock.json:', error.message);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Set the project's own version in a parsed lockfile — the pure half of
|
|
120
|
+
* {@link updatePackageLock}, split out so the mapping is testable without
|
|
121
|
+
* touching the filesystem.
|
|
122
|
+
*
|
|
123
|
+
* Writes exactly two fields: the top-level `version` and the root package entry
|
|
124
|
+
* `packages[""].version`. Dependency entries are never touched — only npm may
|
|
125
|
+
* change those, and rewriting one here would corrupt resolution.
|
|
126
|
+
*
|
|
127
|
+
* @param {PackageLock} lock - Parsed lockfile (mutated in place and returned)
|
|
128
|
+
* @param {string} newVersion - New version string
|
|
129
|
+
* @returns {PackageLock} The same object, for convenient chaining
|
|
130
|
+
*/
|
|
131
|
+
export function applyVersionToLock(lock, newVersion) {
|
|
132
|
+
lock.version = newVersion;
|
|
133
|
+
// lockfileVersion 1 has no `packages` map — guard rather than assume v2/v3.
|
|
134
|
+
const rootEntry = lock.packages?.[''];
|
|
135
|
+
if (rootEntry)
|
|
136
|
+
rootEntry.version = newVersion;
|
|
137
|
+
return lock;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Parse a semantic version string
|
|
141
|
+
*
|
|
142
|
+
* @param {string} version - Version string (e.g., "1.2.3")
|
|
143
|
+
* @returns {VersionComponents} Parsed version components
|
|
144
|
+
* @throws {Error} If version format is invalid
|
|
145
|
+
*/
|
|
146
|
+
export function parseVersion(version) {
|
|
147
|
+
const match = version.match(/^(\d+)\.(\d+)\.(\d+)$/);
|
|
148
|
+
if (!match) {
|
|
149
|
+
throw new Error(`Invalid version format: ${version}`);
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
major: parseInt(match[1], 10),
|
|
153
|
+
minor: parseInt(match[2], 10),
|
|
154
|
+
patch: parseInt(match[3], 10)
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Whether `version` is `minimum` or later (both `x.y.z`). An add-on states the
|
|
159
|
+
* core release it needs this way (#1757: `ngdpbase.minVersion`).
|
|
160
|
+
*
|
|
161
|
+
* @throws {Error} If either version format is invalid
|
|
162
|
+
*/
|
|
163
|
+
export function isAtLeast(version, minimum) {
|
|
164
|
+
const v = parseVersion(version);
|
|
165
|
+
const m = parseVersion(minimum);
|
|
166
|
+
if (v.major !== m.major)
|
|
167
|
+
return v.major > m.major;
|
|
168
|
+
if (v.minor !== m.minor)
|
|
169
|
+
return v.minor > m.minor;
|
|
170
|
+
return v.patch >= m.patch;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Format version components into string
|
|
174
|
+
*
|
|
175
|
+
* @param {number} major - Major version
|
|
176
|
+
* @param {number} minor - Minor version
|
|
177
|
+
* @param {number} patch - Patch version
|
|
178
|
+
* @returns {string} Formatted version string
|
|
179
|
+
*/
|
|
180
|
+
export function formatVersion(major, minor, patch) {
|
|
181
|
+
return `${major}.${minor}.${patch}`;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Increment version based on type
|
|
185
|
+
*
|
|
186
|
+
* @param {string} currentVersion - Current version string
|
|
187
|
+
* @param {VersionIncrementType} type - Type of increment
|
|
188
|
+
* @returns {string} New version string
|
|
189
|
+
* @throws {Error} If increment type is invalid
|
|
190
|
+
*/
|
|
191
|
+
export function incrementVersion(currentVersion, type) {
|
|
192
|
+
const { major, minor, patch } = parseVersion(currentVersion);
|
|
193
|
+
switch (type) {
|
|
194
|
+
case 'patch':
|
|
195
|
+
return formatVersion(major, minor, patch + 1);
|
|
196
|
+
case 'minor':
|
|
197
|
+
return formatVersion(major, minor + 1, 0);
|
|
198
|
+
case 'major':
|
|
199
|
+
return formatVersion(major + 1, 0, 0);
|
|
200
|
+
default:
|
|
201
|
+
throw new Error(`Invalid increment type: ${String(type)}`);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Get current date in ISO format (YYYY-MM-DD)
|
|
206
|
+
*
|
|
207
|
+
* @returns {string} Current date
|
|
208
|
+
*/
|
|
209
|
+
function getCurrentDate() {
|
|
210
|
+
return new Date().toISOString().split('T')[0];
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Update CHANGELOG.md for a new release
|
|
214
|
+
*
|
|
215
|
+
* @param {string} newVersion - New version number
|
|
216
|
+
*/
|
|
217
|
+
function updateChangelogForRelease(newVersion) {
|
|
218
|
+
try {
|
|
219
|
+
let changelog = fs.readFileSync(CHANGELOG_PATH, 'utf8');
|
|
220
|
+
const newHeader = `## [${newVersion}] - ${getCurrentDate()}`;
|
|
221
|
+
if (/## \[Unreleased\]/.test(changelog)) {
|
|
222
|
+
// Replace [Unreleased] heading, preserving a fresh one above the new entry
|
|
223
|
+
const replacement = `## [Unreleased]\n\n### Planned\n\n- Future enhancements\n\n${newHeader}`;
|
|
224
|
+
changelog = changelog.replace(/## \[Unreleased\]/, replacement);
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
// No [Unreleased] section — insert new version after the header block (first ---)
|
|
228
|
+
const insertAfter = /^---\s*\n/m;
|
|
229
|
+
if (insertAfter.test(changelog)) {
|
|
230
|
+
changelog = changelog.replace(insertAfter, `---\n\n${newHeader}\n\n`);
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
// Fallback: prepend to the first ## heading
|
|
234
|
+
changelog = changelog.replace(/^(## )/m, `${newHeader}\n\n$1`);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
fs.writeFileSync(CHANGELOG_PATH, changelog);
|
|
238
|
+
console.log(`Updated CHANGELOG.md with version ${newVersion}`);
|
|
239
|
+
}
|
|
240
|
+
catch (error) {
|
|
241
|
+
console.warn('Warning: Could not update CHANGELOG.md:', error.message);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Extract the release notes for a specific version from CHANGELOG.md.
|
|
246
|
+
* Returns the content between `## [version]` and the next `## [` heading.
|
|
247
|
+
*/
|
|
248
|
+
function extractChangelogNotes(version) {
|
|
249
|
+
try {
|
|
250
|
+
const changelog = fs.readFileSync(CHANGELOG_PATH, 'utf8');
|
|
251
|
+
const escaped = version.replace(/\./g, '\\.');
|
|
252
|
+
const pattern = new RegExp(`## \\[${escaped}\\][^\\n]*\\n([\\s\\S]*?)(?=\\n## \\[|$)`);
|
|
253
|
+
const match = changelog.match(pattern);
|
|
254
|
+
if (match?.[1])
|
|
255
|
+
return match[1].trim();
|
|
256
|
+
}
|
|
257
|
+
catch {
|
|
258
|
+
// ignore — caller handles empty notes
|
|
259
|
+
}
|
|
260
|
+
return '';
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Create a git tag and push it to origin.
|
|
264
|
+
*/
|
|
265
|
+
function createGitTag(version) {
|
|
266
|
+
const tag = `v${version}`;
|
|
267
|
+
try {
|
|
268
|
+
execSync(`git tag ${tag}`, { stdio: 'inherit' });
|
|
269
|
+
execSync(`git push origin ${tag}`, { stdio: 'inherit' });
|
|
270
|
+
console.log(`✅ Git tag ${tag} created and pushed`);
|
|
271
|
+
}
|
|
272
|
+
catch (error) {
|
|
273
|
+
console.error('Error creating git tag:', error.message);
|
|
274
|
+
process.exit(1);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Create a GitHub release using the `gh` CLI.
|
|
279
|
+
* Release notes are written to a temp file to avoid shell-escaping issues.
|
|
280
|
+
*/
|
|
281
|
+
function createGitHubRelease(version, notes) {
|
|
282
|
+
const tag = `v${version}`;
|
|
283
|
+
const tmpFile = path.join(PROJECT_ROOT, '.release-notes.tmp');
|
|
284
|
+
try {
|
|
285
|
+
fs.writeFileSync(tmpFile, notes || `Release ${tag}`);
|
|
286
|
+
execSync(`gh release create ${tag} --title "${tag}" --notes-file "${tmpFile}"`, { stdio: 'inherit' });
|
|
287
|
+
fs.unlinkSync(tmpFile);
|
|
288
|
+
console.log(`✅ GitHub release ${tag} created`);
|
|
289
|
+
}
|
|
290
|
+
catch (error) {
|
|
291
|
+
console.error('Error creating GitHub release:', error.message);
|
|
292
|
+
try {
|
|
293
|
+
fs.unlinkSync(tmpFile);
|
|
294
|
+
}
|
|
295
|
+
catch { /* ignore */ }
|
|
296
|
+
process.exit(1);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Show help message
|
|
301
|
+
*/
|
|
302
|
+
function showHelp() {
|
|
303
|
+
console.log(`
|
|
304
|
+
ngdpbase Version Management
|
|
305
|
+
|
|
306
|
+
Usage:
|
|
307
|
+
node version.js - Show current version and info
|
|
308
|
+
node version.js patch - Increment patch (bug fixes: 1.2.0 → 1.2.1)
|
|
309
|
+
node version.js minor - Increment minor (new features: 1.2.0 → 1.3.0)
|
|
310
|
+
node version.js major - Increment major (breaking changes: 1.2.0 → 2.0.0)
|
|
311
|
+
node version.js set <version> - Set specific version (e.g., 1.2.3)
|
|
312
|
+
node version.js patch --tag-only - Bump + create/push git tag (no GH release)
|
|
313
|
+
node version.js minor --release - Bump + create/push tag + GitHub release
|
|
314
|
+
node version.js help - Show this help
|
|
315
|
+
|
|
316
|
+
Semantic Versioning:
|
|
317
|
+
MAJOR.MINOR.PATCH
|
|
318
|
+
- MAJOR: Incompatible API changes
|
|
319
|
+
- MINOR: Backward-compatible functionality additions
|
|
320
|
+
- PATCH: Backward-compatible bug fixes
|
|
321
|
+
`);
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Main CLI function
|
|
325
|
+
*/
|
|
326
|
+
function main() {
|
|
327
|
+
const args = process.argv.slice(2);
|
|
328
|
+
const command = args[0];
|
|
329
|
+
const doRelease = args.includes('--release');
|
|
330
|
+
const doTagOnly = args.includes('--tag-only');
|
|
331
|
+
const packageData = readPackageJson();
|
|
332
|
+
const currentVersion = packageData.version;
|
|
333
|
+
if (!command || command === 'help') {
|
|
334
|
+
if (!command) {
|
|
335
|
+
console.log(`Current version: ${currentVersion}`);
|
|
336
|
+
console.log(`Project: ${packageData.name}`);
|
|
337
|
+
console.log(`Description: ${packageData.description || 'No description'}`);
|
|
338
|
+
console.log('\nRun "node version.js help" for usage information.');
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
showHelp();
|
|
342
|
+
}
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
try {
|
|
346
|
+
let newVersion;
|
|
347
|
+
switch (command) {
|
|
348
|
+
case 'patch':
|
|
349
|
+
case 'minor':
|
|
350
|
+
case 'major':
|
|
351
|
+
newVersion = incrementVersion(currentVersion, command);
|
|
352
|
+
break;
|
|
353
|
+
case 'set':
|
|
354
|
+
newVersion = args[1];
|
|
355
|
+
if (!newVersion) {
|
|
356
|
+
console.error('Error: Please specify a version to set');
|
|
357
|
+
process.exit(1);
|
|
358
|
+
}
|
|
359
|
+
// Validate version format
|
|
360
|
+
parseVersion(newVersion);
|
|
361
|
+
break;
|
|
362
|
+
default:
|
|
363
|
+
console.error(`Error: Unknown command "${command}"`);
|
|
364
|
+
console.log('Run "node version.js help" for usage information.');
|
|
365
|
+
process.exit(1);
|
|
366
|
+
}
|
|
367
|
+
// Update package.json
|
|
368
|
+
packageData.version = newVersion;
|
|
369
|
+
writePackageJson(packageData);
|
|
370
|
+
// Update package-lock.json (its two version fields mirror package.json)
|
|
371
|
+
updatePackageLock(newVersion);
|
|
372
|
+
// Update app-default-config.json
|
|
373
|
+
updateAppConfig(newVersion);
|
|
374
|
+
// Update changelog if incrementing
|
|
375
|
+
if (['patch', 'minor', 'major'].includes(command)) {
|
|
376
|
+
updateChangelogForRelease(newVersion);
|
|
377
|
+
}
|
|
378
|
+
console.log(`Version updated: ${currentVersion} → ${newVersion}`);
|
|
379
|
+
console.log(`Type: ${command.toUpperCase()}`);
|
|
380
|
+
if (command === 'major') {
|
|
381
|
+
console.log('\n⚠️ MAJOR version bump - ensure breaking changes are documented!');
|
|
382
|
+
}
|
|
383
|
+
else if (command === 'minor') {
|
|
384
|
+
console.log('\n✨ MINOR version bump - new features added');
|
|
385
|
+
}
|
|
386
|
+
else if (command === 'patch') {
|
|
387
|
+
console.log('\n🐛 PATCH version bump - bug fixes');
|
|
388
|
+
}
|
|
389
|
+
// Tag and/or release if requested
|
|
390
|
+
if (doRelease || doTagOnly) {
|
|
391
|
+
createGitTag(newVersion);
|
|
392
|
+
}
|
|
393
|
+
if (doRelease) {
|
|
394
|
+
const notes = extractChangelogNotes(newVersion);
|
|
395
|
+
createGitHubRelease(newVersion, notes);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
catch (error) {
|
|
399
|
+
console.error('Error:', error.message);
|
|
400
|
+
process.exit(1);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
// Run main only when executed directly (ESM-safe).
|
|
404
|
+
// `require.main === module` would crash under "type": "module".
|
|
405
|
+
const argvPath = process.argv[1] ? path.resolve(process.argv[1]) : '';
|
|
406
|
+
if (argvPath === __filename) {
|
|
407
|
+
main();
|
|
408
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jwilleke/ngdpbase-types",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.26.0",
|
|
4
4
|
"description": "TypeScript types for ngdpbase add-ons, and a test kit of core's own values. A dev dependency, versioned with ngdpbase.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Jim Willeke",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"node": ">=24.15.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
+
"@elastic/elasticsearch": "^8.19.2",
|
|
34
35
|
"@jwilleke/oidc-auth-server": "0.4.0",
|
|
35
36
|
"@simplewebauthn/server": "^14.0.3",
|
|
36
37
|
"@types/express": "^5.0.5",
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"@types/multer": "^2.3.0",
|
|
41
42
|
"@types/node": "^24.19.2",
|
|
42
43
|
"better-sqlite3-multiple-ciphers": "^13.0.3",
|
|
44
|
+
"dotenv": "^18.0.8",
|
|
43
45
|
"express": "^5.3.0",
|
|
44
46
|
"express-session": "^1.19.0",
|
|
45
47
|
"fs-extra": "^11.4.1",
|
|
@@ -50,6 +52,9 @@
|
|
|
50
52
|
"minimatch": "^10.2.6",
|
|
51
53
|
"minisearch": "7.2.0",
|
|
52
54
|
"multer": "^2.4.0",
|
|
55
|
+
"rrule-temporal": "2.2.8",
|
|
56
|
+
"tar": "^7.5.22",
|
|
57
|
+
"temporal-polyfill": "1.0.6",
|
|
53
58
|
"winston": "^3.17.0"
|
|
54
59
|
}
|
|
55
60
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Who an administrator notification goes to.
|
|
3
|
-
*
|
|
4
|
-
* __An administrator is whoever holds `admin-system`__, asked per user through
|
|
5
|
-
* the policy (#1431 7b) — never a role name. Used by every report that must
|
|
6
|
-
* reach administrators and nobody else: a damaged page (#1431 step 7) and
|
|
7
|
-
* failing outbound email (#1916).
|
|
8
|
-
*
|
|
9
|
-
* An empty answer means "nobody to tell", and the caller must then log only:
|
|
10
|
-
* an empty `targetUsers` list means ALL users in NotificationManager, which
|
|
11
|
-
* would announce an operator problem to every reader.
|
|
12
|
-
*
|
|
13
|
-
* Null when the managers needed to answer are not registered (tests, a
|
|
14
|
-
* half-booted engine) — the caller treats that like "nobody to tell".
|
|
15
|
-
*/
|
|
16
|
-
type EngineLike = {
|
|
17
|
-
getManager: (name: string) => unknown;
|
|
18
|
-
} | null | undefined;
|
|
19
|
-
/** Usernames of every user who holds `admin-system`; null when it cannot be asked. */
|
|
20
|
-
export declare function administratorUsernames(engine: EngineLike): Promise<string[] | null>;
|
|
21
|
-
export {};
|