@kinloom/cli 0.0.0-stage → 0.1.1
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/dist/cli.d.ts +13 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +444 -0
- package/dist/cli.js.map +1 -0
- package/dist/client.d.ts +110 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +277 -0
- package/dist/client.js.map +1 -0
- package/dist/commands/dataFiles.d.ts +26 -0
- package/dist/commands/dataFiles.d.ts.map +1 -0
- package/dist/commands/dataFiles.js +136 -0
- package/dist/commands/dataFiles.js.map +1 -0
- package/dist/commands/exportYaml.d.ts +22 -0
- package/dist/commands/exportYaml.d.ts.map +1 -0
- package/dist/commands/exportYaml.js +106 -0
- package/dist/commands/exportYaml.js.map +1 -0
- package/dist/commands/init.d.ts +14 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +251 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/reconcile.d.ts +17 -0
- package/dist/commands/reconcile.d.ts.map +1 -0
- package/dist/commands/reconcile.js +92 -0
- package/dist/commands/reconcile.js.map +1 -0
- package/dist/commands/seed.d.ts +27 -0
- package/dist/commands/seed.d.ts.map +1 -0
- package/dist/commands/seed.js +274 -0
- package/dist/commands/seed.js.map +1 -0
- package/dist/commands/sliceGedcom.d.ts +22 -0
- package/dist/commands/sliceGedcom.d.ts.map +1 -0
- package/dist/commands/sliceGedcom.js +63 -0
- package/dist/commands/sliceGedcom.js.map +1 -0
- package/dist/commands/submitBatch.d.ts +21 -0
- package/dist/commands/submitBatch.d.ts.map +1 -0
- package/dist/commands/submitBatch.js +140 -0
- package/dist/commands/submitBatch.js.map +1 -0
- package/dist/commands/uploadMedia.d.ts +23 -0
- package/dist/commands/uploadMedia.d.ts.map +1 -0
- package/dist/commands/uploadMedia.js +176 -0
- package/dist/commands/uploadMedia.js.map +1 -0
- package/dist/errors.d.ts +31 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +74 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/package.json +37 -4
- package/README.md +0 -3
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { type CliExitCode } from './errors.js';
|
|
3
|
+
export interface CliIo {
|
|
4
|
+
stdout(line: string): void;
|
|
5
|
+
stderr(line: string): void;
|
|
6
|
+
}
|
|
7
|
+
export interface RunCliOptions {
|
|
8
|
+
io?: CliIo;
|
|
9
|
+
fetchImpl?: typeof fetch;
|
|
10
|
+
}
|
|
11
|
+
export declare const ROOT_HELP = "Usage: kinloom <command> [options]\n\nCommands:\n init Scaffold a thin private family archive repository\n slice-gedcom Slice a combined GEDCOM export into deterministic YAML files\n seed Load local YAML + config and submit an idempotent seed batch\n submit-batch Validate and submit a typed BatchSubmission JSON/YAML file\n export-yaml Export deterministic YAML snapshot with ETag/304 support\n upload-media Validate and upload a media scan or recording via multipart POST\n reconcile Compare cached GET /api/bundle against full compileArchive\n\nGlobal options:\n -h, --help Show help for kinloom or a specific command\n\nEnvironment variables:\n KINLOOM_TOKEN Bearer token used when --token is omitted\n\nExit codes:\n 0 Success\n 1 Runtime, HTTP, or reconciliation drift error\n 2 CLI usage or boundary validation error\n 3 Optimistic concurrency conflict (HTTP 409)";
|
|
12
|
+
export declare function runCli(argv: readonly string[], options?: RunCliOptions): Promise<CliExitCode>;
|
|
13
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAYA,OAAO,EAOL,KAAK,WAAW,EACjB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,KAAK;IACpB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,CAAC,EAAE,KAAK,CAAC;IACX,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B;AAWD,eAAO,MAAM,SAAS,m6BAqB0B,CAAC;AA8GjD,wBAAsB,MAAM,CAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,WAAW,CAAC,CAoVtB"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { realpathSync } from 'node:fs';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { parseArgs } from 'node:util';
|
|
5
|
+
import { BuildModeSchema } from '@kinloom/core';
|
|
6
|
+
import { runExportYamlCommand } from './commands/exportYaml.js';
|
|
7
|
+
import { runInitCommand } from './commands/init.js';
|
|
8
|
+
import { runReconcileCommand } from './commands/reconcile.js';
|
|
9
|
+
import { runSeedCommand } from './commands/seed.js';
|
|
10
|
+
import { runSliceGedcomCommand } from './commands/sliceGedcom.js';
|
|
11
|
+
import { runSubmitBatchCommand } from './commands/submitBatch.js';
|
|
12
|
+
import { runUploadMediaCommand } from './commands/uploadMedia.js';
|
|
13
|
+
import { CliValidationError, EXIT_ERROR, EXIT_OK, EXIT_USAGE, KinloomApiError, formatConflictDetails, } from './errors.js';
|
|
14
|
+
const DEFAULT_IO = {
|
|
15
|
+
stdout: (line) => {
|
|
16
|
+
process.stdout.write(`${line}\n`);
|
|
17
|
+
},
|
|
18
|
+
stderr: (line) => {
|
|
19
|
+
process.stderr.write(`${line}\n`);
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export const ROOT_HELP = `Usage: kinloom <command> [options]
|
|
23
|
+
|
|
24
|
+
Commands:
|
|
25
|
+
init Scaffold a thin private family archive repository
|
|
26
|
+
slice-gedcom Slice a combined GEDCOM export into deterministic YAML files
|
|
27
|
+
seed Load local YAML + config and submit an idempotent seed batch
|
|
28
|
+
submit-batch Validate and submit a typed BatchSubmission JSON/YAML file
|
|
29
|
+
export-yaml Export deterministic YAML snapshot with ETag/304 support
|
|
30
|
+
upload-media Validate and upload a media scan or recording via multipart POST
|
|
31
|
+
reconcile Compare cached GET /api/bundle against full compileArchive
|
|
32
|
+
|
|
33
|
+
Global options:
|
|
34
|
+
-h, --help Show help for kinloom or a specific command
|
|
35
|
+
|
|
36
|
+
Environment variables:
|
|
37
|
+
KINLOOM_TOKEN Bearer token used when --token is omitted
|
|
38
|
+
|
|
39
|
+
Exit codes:
|
|
40
|
+
0 Success
|
|
41
|
+
1 Runtime, HTTP, or reconciliation drift error
|
|
42
|
+
2 CLI usage or boundary validation error
|
|
43
|
+
3 Optimistic concurrency conflict (HTTP 409)`;
|
|
44
|
+
const COMMAND_HELP = {
|
|
45
|
+
init: `Usage: kinloom init <dir> --family <name> --title <title> [options]
|
|
46
|
+
|
|
47
|
+
Options:
|
|
48
|
+
--family <name> Primary family surname or lineage name (required)
|
|
49
|
+
--title <title> Display title for the archive site (required)
|
|
50
|
+
--accent <hex> 6-digit hex theme accent color (default: #7A4612)
|
|
51
|
+
--force Overwrite existing files
|
|
52
|
+
-h, --help Show this help message`,
|
|
53
|
+
'slice-gedcom': `Usage: kinloom slice-gedcom --input <file.ged> --out <data-dir> --root <xref-or-name> [options]
|
|
54
|
+
|
|
55
|
+
Options:
|
|
56
|
+
--input <path> Source GEDCOM file path (required)
|
|
57
|
+
--out <dir> Output directory for YAML files (required)
|
|
58
|
+
--root <xref-or-name> Root individual xref (@I1@) or full name (required)
|
|
59
|
+
--surname <name> Ancestor surname filter (repeatable or comma-separated)
|
|
60
|
+
--branch <id> Branch identifier stamped on output people
|
|
61
|
+
--include-upstream-spouses Expand ancestors of married-in spouses
|
|
62
|
+
--no-ancestor-siblings Exclude sibling sets of direct ancestors
|
|
63
|
+
--no-descendant-spouses Exclude spouses of descendants
|
|
64
|
+
--no-normalize-maiden Keep original GEDCOM surnames instead of maiden primary
|
|
65
|
+
--reference-year <year> Reference year for 100-year living cutoff
|
|
66
|
+
-h, --help Show this help message`,
|
|
67
|
+
seed: `Usage: kinloom seed --data <data-dir> --config <kinloom.config.yaml> --site <url> [options]
|
|
68
|
+
|
|
69
|
+
Options:
|
|
70
|
+
--data <dir> Directory containing people.yaml, events.yaml, etc. (required)
|
|
71
|
+
--config <path> Path to kinloom.config.yaml (required)
|
|
72
|
+
--site <url> Target Kinloom server URL (required unless --dry-run)
|
|
73
|
+
--token <secret> Bearer token (defaults to KINLOOM_TOKEN)
|
|
74
|
+
--batch-id <id> Explicit batch identifier (default: content-hashed)
|
|
75
|
+
--summary <text> Revision summary for the seed batch
|
|
76
|
+
--dry-run Validate YAML, run compileArchive locally, and skip HTTP
|
|
77
|
+
-h, --help Show this help message`,
|
|
78
|
+
'submit-batch': `Usage: kinloom submit-batch --file <patch_spec.json|yaml> --site <url> [options]
|
|
79
|
+
|
|
80
|
+
Options:
|
|
81
|
+
--file <path> BatchSubmission JSON or YAML file (or first positional arg)
|
|
82
|
+
--site <url> Target Kinloom server URL (required unless --dry-run)
|
|
83
|
+
--token <secret> Bearer token (defaults to KINLOOM_TOKEN)
|
|
84
|
+
--dry-run Validate envelope and per-entity payloads without HTTP
|
|
85
|
+
-h, --help Show this help message`,
|
|
86
|
+
'export-yaml': `Usage: kinloom export-yaml --site <url> --out <data-dir> [options]
|
|
87
|
+
|
|
88
|
+
Options:
|
|
89
|
+
--site <url> Target Kinloom server URL (required)
|
|
90
|
+
--out <dir> Output directory for deterministic YAML files (required)
|
|
91
|
+
--token <secret> Bearer token (defaults to KINLOOM_TOKEN)
|
|
92
|
+
--state-file <path> Revision state file (default: <out>/.last-backup-revision)
|
|
93
|
+
-h, --help Show this help message`,
|
|
94
|
+
'upload-media': `Usage: kinloom upload-media --file <path> --metadata <json|@file> --summary <text> --site <url> [options]
|
|
95
|
+
|
|
96
|
+
Options:
|
|
97
|
+
--file <path> Local media file to upload (required)
|
|
98
|
+
--metadata <json> Media metadata JSON string or @file path (required)
|
|
99
|
+
--summary <text> Edit summary (minimum 3 characters, required)
|
|
100
|
+
--site <url> Target Kinloom server URL (required unless --dry-run)
|
|
101
|
+
--token <secret> Bearer token (defaults to KINLOOM_TOKEN)
|
|
102
|
+
--mime <type> Override detected MIME type
|
|
103
|
+
--allow-audio-video Allow MP4/WebM/MP3/M4A/OGG/WAV uploads
|
|
104
|
+
--max-bytes <n> Override maximum allowed file size in bytes
|
|
105
|
+
--dry-run Validate file and metadata locally without HTTP
|
|
106
|
+
-h, --help Show this help message`,
|
|
107
|
+
reconcile: `Usage: kinloom reconcile --site <url> --config <kinloom.config.yaml> [options]
|
|
108
|
+
|
|
109
|
+
Options:
|
|
110
|
+
--site <url> Target Kinloom server URL (required)
|
|
111
|
+
--config <path> Path to kinloom.config.yaml (required)
|
|
112
|
+
--token <secret> Bearer token (defaults to KINLOOM_TOKEN)
|
|
113
|
+
--mode <mode> Override build mode ('private' or 'public')
|
|
114
|
+
-h, --help Show this help message`,
|
|
115
|
+
};
|
|
116
|
+
function requireStringFlag(value, flagName) {
|
|
117
|
+
if (!value || !value.trim()) {
|
|
118
|
+
throw new CliValidationError(`Missing required option \`${flagName}\`.`);
|
|
119
|
+
}
|
|
120
|
+
return value.trim();
|
|
121
|
+
}
|
|
122
|
+
function parseOptionalPositiveInt(value, flagName) {
|
|
123
|
+
if (value === undefined) {
|
|
124
|
+
return undefined;
|
|
125
|
+
}
|
|
126
|
+
const parsed = Number.parseInt(value, 10);
|
|
127
|
+
if (!Number.isInteger(parsed) || parsed <= 0 || String(parsed) !== value.trim()) {
|
|
128
|
+
throw new CliValidationError(`Option \`${flagName}\` must be a positive integer.`);
|
|
129
|
+
}
|
|
130
|
+
return parsed;
|
|
131
|
+
}
|
|
132
|
+
function safeParseArgs(config) {
|
|
133
|
+
try {
|
|
134
|
+
return parseArgs(config);
|
|
135
|
+
}
|
|
136
|
+
catch (err) {
|
|
137
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
138
|
+
throw new CliValidationError(message);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
export async function runCli(argv, options) {
|
|
142
|
+
const io = options?.io ?? DEFAULT_IO;
|
|
143
|
+
const fetchImpl = options?.fetchImpl;
|
|
144
|
+
if (argv.length === 0 || argv[0] === '-h' || argv[0] === '--help' || argv[0] === 'help') {
|
|
145
|
+
const sub = argv[0] === 'help' ? argv[1] : undefined;
|
|
146
|
+
if (sub && COMMAND_HELP[sub]) {
|
|
147
|
+
io.stdout(COMMAND_HELP[sub]);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
io.stdout(ROOT_HELP);
|
|
151
|
+
}
|
|
152
|
+
return EXIT_OK;
|
|
153
|
+
}
|
|
154
|
+
const [command, ...rest] = argv;
|
|
155
|
+
if (rest.includes('-h') || rest.includes('--help')) {
|
|
156
|
+
const help = COMMAND_HELP[command];
|
|
157
|
+
if (!help) {
|
|
158
|
+
io.stderr(`Unknown command '${command}'. Run \`kinloom --help\` for available commands.`);
|
|
159
|
+
return EXIT_USAGE;
|
|
160
|
+
}
|
|
161
|
+
io.stdout(help);
|
|
162
|
+
return EXIT_OK;
|
|
163
|
+
}
|
|
164
|
+
try {
|
|
165
|
+
switch (command) {
|
|
166
|
+
case 'init': {
|
|
167
|
+
const { values, positionals } = safeParseArgs({
|
|
168
|
+
args: rest,
|
|
169
|
+
allowPositionals: true,
|
|
170
|
+
options: {
|
|
171
|
+
family: { type: 'string' },
|
|
172
|
+
title: { type: 'string' },
|
|
173
|
+
accent: { type: 'string' },
|
|
174
|
+
force: { type: 'boolean', default: false },
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
const targetDir = positionals[0];
|
|
178
|
+
if (!targetDir) {
|
|
179
|
+
throw new CliValidationError('Missing required positional argument `<dir>`.');
|
|
180
|
+
}
|
|
181
|
+
const result = await runInitCommand({
|
|
182
|
+
targetDir,
|
|
183
|
+
family: requireStringFlag(values.family, '--family'),
|
|
184
|
+
title: requireStringFlag(values.title, '--title'),
|
|
185
|
+
accent: values.accent,
|
|
186
|
+
force: values.force,
|
|
187
|
+
});
|
|
188
|
+
io.stdout(`Initialized Kinloom archive at ${result.targetDir} (${result.created.length} created, ${result.skipped.length} skipped).`);
|
|
189
|
+
return EXIT_OK;
|
|
190
|
+
}
|
|
191
|
+
case 'slice-gedcom': {
|
|
192
|
+
const { values } = safeParseArgs({
|
|
193
|
+
args: rest,
|
|
194
|
+
allowPositionals: false,
|
|
195
|
+
options: {
|
|
196
|
+
input: { type: 'string' },
|
|
197
|
+
out: { type: 'string' },
|
|
198
|
+
root: { type: 'string' },
|
|
199
|
+
surname: { type: 'string', multiple: true },
|
|
200
|
+
branch: { type: 'string' },
|
|
201
|
+
'include-upstream-spouses': { type: 'boolean', default: false },
|
|
202
|
+
'no-ancestor-siblings': { type: 'boolean', default: false },
|
|
203
|
+
'no-descendant-spouses': { type: 'boolean', default: false },
|
|
204
|
+
'no-normalize-maiden': { type: 'boolean', default: false },
|
|
205
|
+
'reference-year': { type: 'string' },
|
|
206
|
+
},
|
|
207
|
+
});
|
|
208
|
+
const result = await runSliceGedcomCommand({
|
|
209
|
+
inputPath: requireStringFlag(values.input, '--input'),
|
|
210
|
+
outDir: requireStringFlag(values.out, '--out'),
|
|
211
|
+
root: requireStringFlag(values.root, '--root'),
|
|
212
|
+
surnames: values.surname,
|
|
213
|
+
branchId: values.branch,
|
|
214
|
+
includeUpstreamSpouses: values['include-upstream-spouses'],
|
|
215
|
+
includeAncestorSiblings: !values['no-ancestor-siblings'],
|
|
216
|
+
includeDescendantSpouses: !values['no-descendant-spouses'],
|
|
217
|
+
normalizeMaidenNames: !values['no-normalize-maiden'],
|
|
218
|
+
referenceYear: parseOptionalPositiveInt(values['reference-year'], '--reference-year'),
|
|
219
|
+
});
|
|
220
|
+
io.stdout(`Sliced GEDCOM from ${result.rootXref} into ${result.outDir}: ${result.stats.totalPeople} people, ${result.stats.totalEvents} events, ${result.stats.totalPlaces} places, ${result.stats.totalSources} sources, ${result.stats.totalKinshipEdges} kinship edges.`);
|
|
221
|
+
if (result.anomalies.length > 0) {
|
|
222
|
+
io.stderr(`Anomalies (${result.anomalies.length}): ${result.anomalies.join('; ')}`);
|
|
223
|
+
}
|
|
224
|
+
return EXIT_OK;
|
|
225
|
+
}
|
|
226
|
+
case 'seed': {
|
|
227
|
+
const { values } = safeParseArgs({
|
|
228
|
+
args: rest,
|
|
229
|
+
allowPositionals: false,
|
|
230
|
+
options: {
|
|
231
|
+
data: { type: 'string' },
|
|
232
|
+
config: { type: 'string' },
|
|
233
|
+
site: { type: 'string' },
|
|
234
|
+
token: { type: 'string' },
|
|
235
|
+
'batch-id': { type: 'string' },
|
|
236
|
+
summary: { type: 'string' },
|
|
237
|
+
'chunk-size': { type: 'string' },
|
|
238
|
+
'dry-run': { type: 'boolean', default: false },
|
|
239
|
+
},
|
|
240
|
+
});
|
|
241
|
+
const dryRun = Boolean(values['dry-run']);
|
|
242
|
+
const siteUrl = dryRun
|
|
243
|
+
? values.site?.trim() || 'http://localhost'
|
|
244
|
+
: requireStringFlag(values.site, '--site');
|
|
245
|
+
const result = await runSeedCommand({
|
|
246
|
+
dataDir: requireStringFlag(values.data, '--data'),
|
|
247
|
+
configPath: requireStringFlag(values.config, '--config'),
|
|
248
|
+
siteUrl,
|
|
249
|
+
token: values.token,
|
|
250
|
+
dryRun,
|
|
251
|
+
batchId: values['batch-id'],
|
|
252
|
+
summary: values.summary,
|
|
253
|
+
chunkSize: parseOptionalPositiveInt(values['chunk-size'], '--chunk-size'),
|
|
254
|
+
fetchImpl,
|
|
255
|
+
});
|
|
256
|
+
if (result.dryRun) {
|
|
257
|
+
io.stdout(`Dry-run OK for batch ${result.batchId}: ${result.createdCount} entities ready (precompiled ${result.precompiledCounts.people} people, ${result.precompiledCounts.events} events, ${result.precompiledCounts.places} places).`);
|
|
258
|
+
}
|
|
259
|
+
else if (!result.response) {
|
|
260
|
+
io.stdout(`Seed up to date (${result.unchangedCount} unchanged, 0 created, 0 updated).`);
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
io.stdout(`Seeded batch ${result.batchId}: ${result.createdCount} created, ${result.updatedCount} updated, ${result.unchangedCount} unchanged (head r${result.response.head_revision_id}, etag ${result.response.etag}).`);
|
|
264
|
+
}
|
|
265
|
+
return EXIT_OK;
|
|
266
|
+
}
|
|
267
|
+
case 'submit-batch': {
|
|
268
|
+
const { values, positionals } = safeParseArgs({
|
|
269
|
+
args: rest,
|
|
270
|
+
allowPositionals: true,
|
|
271
|
+
options: {
|
|
272
|
+
file: { type: 'string' },
|
|
273
|
+
site: { type: 'string' },
|
|
274
|
+
token: { type: 'string' },
|
|
275
|
+
'dry-run': { type: 'boolean', default: false },
|
|
276
|
+
},
|
|
277
|
+
});
|
|
278
|
+
const dryRun = Boolean(values['dry-run']);
|
|
279
|
+
const filePath = values.file ?? positionals[0];
|
|
280
|
+
const siteUrl = dryRun
|
|
281
|
+
? values.site?.trim() || 'http://localhost'
|
|
282
|
+
: requireStringFlag(values.site, '--site');
|
|
283
|
+
const result = await runSubmitBatchCommand({
|
|
284
|
+
filePath: requireStringFlag(filePath, '--file'),
|
|
285
|
+
siteUrl,
|
|
286
|
+
token: values.token,
|
|
287
|
+
dryRun,
|
|
288
|
+
fetchImpl,
|
|
289
|
+
});
|
|
290
|
+
if (result.dryRun || !result.response) {
|
|
291
|
+
io.stdout(`Dry-run OK: batch ${result.batchId} (${result.patchCount} patch(es)) passed validation.`);
|
|
292
|
+
return EXIT_OK;
|
|
293
|
+
}
|
|
294
|
+
const revIds = result.response.revisions.map((r) => r.revision_id);
|
|
295
|
+
const revRange = revIds.length === 0
|
|
296
|
+
? 'none'
|
|
297
|
+
: revIds.length === 1
|
|
298
|
+
? `r${revIds[0]}`
|
|
299
|
+
: `r${Math.min(...revIds)}..r${Math.max(...revIds)}`;
|
|
300
|
+
io.stdout(`Committed batch ${result.response.batch_id}: ${revIds.length} revision(s) (${revRange}), head r${result.response.head_revision_id}, etag ${result.response.etag}.`);
|
|
301
|
+
return EXIT_OK;
|
|
302
|
+
}
|
|
303
|
+
case 'export-yaml': {
|
|
304
|
+
const { values } = safeParseArgs({
|
|
305
|
+
args: rest,
|
|
306
|
+
allowPositionals: false,
|
|
307
|
+
options: {
|
|
308
|
+
site: { type: 'string' },
|
|
309
|
+
out: { type: 'string' },
|
|
310
|
+
token: { type: 'string' },
|
|
311
|
+
'state-file': { type: 'string' },
|
|
312
|
+
},
|
|
313
|
+
});
|
|
314
|
+
const result = await runExportYamlCommand({
|
|
315
|
+
siteUrl: requireStringFlag(values.site, '--site'),
|
|
316
|
+
outDir: requireStringFlag(values.out, '--out'),
|
|
317
|
+
token: values.token,
|
|
318
|
+
stateFile: values['state-file'],
|
|
319
|
+
fetchImpl,
|
|
320
|
+
});
|
|
321
|
+
if (result.status === 'not_modified') {
|
|
322
|
+
io.stdout(`Not modified (304) at revision ${result.revisionId !== null ? `r${result.revisionId}` : 'unknown'}.`);
|
|
323
|
+
return EXIT_OK;
|
|
324
|
+
}
|
|
325
|
+
io.stdout(`Exported ${result.writtenFiles.length} YAML file(s) at r${result.revisionId} via ${result.source} (state: ${result.stateFile}).`);
|
|
326
|
+
return EXIT_OK;
|
|
327
|
+
}
|
|
328
|
+
case 'upload-media': {
|
|
329
|
+
const { values } = safeParseArgs({
|
|
330
|
+
args: rest,
|
|
331
|
+
allowPositionals: false,
|
|
332
|
+
options: {
|
|
333
|
+
file: { type: 'string' },
|
|
334
|
+
metadata: { type: 'string' },
|
|
335
|
+
summary: { type: 'string' },
|
|
336
|
+
site: { type: 'string' },
|
|
337
|
+
token: { type: 'string' },
|
|
338
|
+
mime: { type: 'string' },
|
|
339
|
+
'allow-audio-video': { type: 'boolean', default: false },
|
|
340
|
+
'max-bytes': { type: 'string' },
|
|
341
|
+
'dry-run': { type: 'boolean', default: false },
|
|
342
|
+
},
|
|
343
|
+
});
|
|
344
|
+
const dryRun = Boolean(values['dry-run']);
|
|
345
|
+
const siteUrl = dryRun
|
|
346
|
+
? values.site?.trim() || 'http://localhost'
|
|
347
|
+
: requireStringFlag(values.site, '--site');
|
|
348
|
+
const result = await runUploadMediaCommand({
|
|
349
|
+
filePath: requireStringFlag(values.file, '--file'),
|
|
350
|
+
metadataInput: requireStringFlag(values.metadata, '--metadata'),
|
|
351
|
+
summary: requireStringFlag(values.summary, '--summary'),
|
|
352
|
+
siteUrl,
|
|
353
|
+
token: values.token,
|
|
354
|
+
mimeType: values.mime,
|
|
355
|
+
allowAudioVideo: values['allow-audio-video'],
|
|
356
|
+
maxUploadBytes: parseOptionalPositiveInt(values['max-bytes'], '--max-bytes'),
|
|
357
|
+
dryRun,
|
|
358
|
+
fetchImpl,
|
|
359
|
+
});
|
|
360
|
+
if (result.dryRun || !result.response) {
|
|
361
|
+
io.stdout(`Dry-run OK: ${result.fileName} (${result.mimeType}, ${result.sizeBytes} bytes) passed media guards.`);
|
|
362
|
+
return EXIT_OK;
|
|
363
|
+
}
|
|
364
|
+
io.stdout(`Uploaded ${result.response.media.id} -> ${result.response.url} (r${result.response.revision.revision_id}, etag ${result.response.etag}).`);
|
|
365
|
+
return EXIT_OK;
|
|
366
|
+
}
|
|
367
|
+
case 'reconcile': {
|
|
368
|
+
const { values } = safeParseArgs({
|
|
369
|
+
args: rest,
|
|
370
|
+
allowPositionals: false,
|
|
371
|
+
options: {
|
|
372
|
+
site: { type: 'string' },
|
|
373
|
+
config: { type: 'string' },
|
|
374
|
+
token: { type: 'string' },
|
|
375
|
+
mode: { type: 'string' },
|
|
376
|
+
},
|
|
377
|
+
});
|
|
378
|
+
let mode;
|
|
379
|
+
if (values.mode !== undefined) {
|
|
380
|
+
const parsedMode = BuildModeSchema.safeParse(values.mode);
|
|
381
|
+
if (!parsedMode.success) {
|
|
382
|
+
throw new CliValidationError(`Invalid \`--mode\` '${values.mode}'. Expected 'private' or 'public'.`);
|
|
383
|
+
}
|
|
384
|
+
mode = parsedMode.data;
|
|
385
|
+
}
|
|
386
|
+
const result = await runReconcileCommand({
|
|
387
|
+
siteUrl: requireStringFlag(values.site, '--site'),
|
|
388
|
+
configPath: requireStringFlag(values.config, '--config'),
|
|
389
|
+
token: values.token,
|
|
390
|
+
mode,
|
|
391
|
+
fetchImpl,
|
|
392
|
+
});
|
|
393
|
+
if (result.inSync) {
|
|
394
|
+
io.stdout(`Reconcile OK: cached bundle matches full compileArchive at r${result.headRevisionId} (${result.mode} mode).`);
|
|
395
|
+
return EXIT_OK;
|
|
396
|
+
}
|
|
397
|
+
io.stderr(`Reconcile DRIFT detected (head r${result.headRevisionId}, cached ${result.cachedRevisionId !== null ? `r${result.cachedRevisionId}` : 'none'}): ${result.drifts.length} difference(s).`);
|
|
398
|
+
for (const drift of result.drifts.slice(0, 20)) {
|
|
399
|
+
io.stderr(` [${drift.kind}] ${drift.path}: cached=${JSON.stringify(drift.before)} recompiled=${JSON.stringify(drift.after)}`);
|
|
400
|
+
}
|
|
401
|
+
return EXIT_ERROR;
|
|
402
|
+
}
|
|
403
|
+
default:
|
|
404
|
+
io.stderr(`Unknown command '${command}'. Run \`kinloom --help\` for available commands.`);
|
|
405
|
+
return EXIT_USAGE;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
catch (err) {
|
|
409
|
+
if (err instanceof CliValidationError) {
|
|
410
|
+
io.stderr(`Validation error: ${err.message}`);
|
|
411
|
+
for (const issue of err.issues) {
|
|
412
|
+
io.stderr(` - ${issue}`);
|
|
413
|
+
}
|
|
414
|
+
return err.exitCode;
|
|
415
|
+
}
|
|
416
|
+
if (err instanceof KinloomApiError) {
|
|
417
|
+
io.stderr(`API error (${err.status} ${err.code}): ${err.message}`);
|
|
418
|
+
if (err.conflict) {
|
|
419
|
+
io.stderr(formatConflictDetails(err.conflict));
|
|
420
|
+
}
|
|
421
|
+
return err.exitCode;
|
|
422
|
+
}
|
|
423
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
424
|
+
io.stderr(`Error: ${message}`);
|
|
425
|
+
return EXIT_ERROR;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
function isExecutedDirectly() {
|
|
429
|
+
const entryArg = process.argv[1];
|
|
430
|
+
if (!entryArg) {
|
|
431
|
+
return false;
|
|
432
|
+
}
|
|
433
|
+
try {
|
|
434
|
+
return realpathSync(fileURLToPath(import.meta.url)) === realpathSync(entryArg);
|
|
435
|
+
}
|
|
436
|
+
catch {
|
|
437
|
+
return fileURLToPath(import.meta.url) === entryArg;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
if (isExecutedDirectly()) {
|
|
441
|
+
const exitCode = await runCli(process.argv.slice(2));
|
|
442
|
+
process.exitCode = exitCode;
|
|
443
|
+
}
|
|
444
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAwB,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACl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a,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,YAAY,CAAC,QAAQ,CAAC,CAAC;IACjF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC;IACrD,CAAC;AACH,CAAC;AAED,IAAI,kBAAkB,EAAE,EAAE,CAAC;IACzB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC9B,CAAC"}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { type ArchiveBundle, type ArchiveRawSnapshot, type BatchSubmission, type MediaItem, type RevisionRecord } from '@kinloom/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export interface KinloomApiClientOptions {
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
token?: string;
|
|
6
|
+
fetchImpl?: typeof fetch;
|
|
7
|
+
userAgent?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const SubmitBatchResponseSchema: z.ZodObject<{
|
|
10
|
+
batch_id: z.ZodString;
|
|
11
|
+
revisions: z.ZodArray<z.ZodObject<{
|
|
12
|
+
revision_id: z.ZodNumber;
|
|
13
|
+
batch_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
14
|
+
entity_type: z.ZodEnum<{
|
|
15
|
+
event: "event";
|
|
16
|
+
kinship_edge: "kinship_edge";
|
|
17
|
+
media: "media";
|
|
18
|
+
narrative: "narrative";
|
|
19
|
+
person: "person";
|
|
20
|
+
place: "place";
|
|
21
|
+
source: "source";
|
|
22
|
+
}>;
|
|
23
|
+
entity_id: z.ZodString;
|
|
24
|
+
parent_revision_id: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
25
|
+
action: z.ZodEnum<{
|
|
26
|
+
create: "create";
|
|
27
|
+
delete: "delete";
|
|
28
|
+
restore: "restore";
|
|
29
|
+
revert: "revert";
|
|
30
|
+
update: "update";
|
|
31
|
+
}>;
|
|
32
|
+
reverted_revision_id: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
33
|
+
author_id: z.ZodString;
|
|
34
|
+
author_name: z.ZodString;
|
|
35
|
+
author_type: z.ZodEnum<{
|
|
36
|
+
agent: "agent";
|
|
37
|
+
human: "human";
|
|
38
|
+
system_seed: "system_seed";
|
|
39
|
+
}>;
|
|
40
|
+
summary: z.ZodString;
|
|
41
|
+
has_primary_source: z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<0>, z.ZodLiteral<1>]>, z.ZodTransform<boolean, 0 | 1 | boolean>>;
|
|
42
|
+
before_json: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
43
|
+
after_json: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
44
|
+
created_at: z.ZodString;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
head_revision_id: z.ZodNumber;
|
|
47
|
+
etag: z.ZodString;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export type SubmitBatchResponse = z.infer<typeof SubmitBatchResponseSchema>;
|
|
50
|
+
export type ExportYamlResult = {
|
|
51
|
+
status: 'not_modified';
|
|
52
|
+
etag: string | null;
|
|
53
|
+
} | {
|
|
54
|
+
status: 'ok';
|
|
55
|
+
head_revision_id: number;
|
|
56
|
+
exported_at: string;
|
|
57
|
+
etag: string | null;
|
|
58
|
+
files: Record<string, string>;
|
|
59
|
+
};
|
|
60
|
+
export type ExportSnapshotResult = {
|
|
61
|
+
status: 'not_modified';
|
|
62
|
+
etag: string | null;
|
|
63
|
+
} | {
|
|
64
|
+
status: 'ok';
|
|
65
|
+
snapshot: ArchiveRawSnapshot;
|
|
66
|
+
etag: string | null;
|
|
67
|
+
};
|
|
68
|
+
export type GetBundleResult = {
|
|
69
|
+
status: 'not_modified';
|
|
70
|
+
etag: string | null;
|
|
71
|
+
} | {
|
|
72
|
+
status: 'ok';
|
|
73
|
+
bundle: ArchiveBundle;
|
|
74
|
+
etag: string | null;
|
|
75
|
+
};
|
|
76
|
+
export type UploadMediaResponse = {
|
|
77
|
+
media: MediaItem;
|
|
78
|
+
url: string;
|
|
79
|
+
revision: RevisionRecord;
|
|
80
|
+
etag: string;
|
|
81
|
+
};
|
|
82
|
+
export interface UploadMediaRequest {
|
|
83
|
+
fileBytes: Uint8Array;
|
|
84
|
+
fileName: string;
|
|
85
|
+
mimeType: string;
|
|
86
|
+
metadata: Record<string, unknown>;
|
|
87
|
+
summary: string;
|
|
88
|
+
}
|
|
89
|
+
export declare class KinloomApiClient {
|
|
90
|
+
readonly baseUrl: string;
|
|
91
|
+
private readonly token?;
|
|
92
|
+
private readonly fetchImpl;
|
|
93
|
+
private readonly userAgent;
|
|
94
|
+
constructor(options: KinloomApiClientOptions);
|
|
95
|
+
private buildHeaders;
|
|
96
|
+
submitBatch(batch: BatchSubmission): Promise<SubmitBatchResponse>;
|
|
97
|
+
exportYaml(options?: {
|
|
98
|
+
ifNoneMatch?: string;
|
|
99
|
+
}): Promise<ExportYamlResult>;
|
|
100
|
+
exportSnapshot(options?: {
|
|
101
|
+
ifNoneMatch?: string;
|
|
102
|
+
}): Promise<ExportSnapshotResult>;
|
|
103
|
+
getBundle(options?: {
|
|
104
|
+
ifNoneMatch?: string;
|
|
105
|
+
}): Promise<GetBundleResult>;
|
|
106
|
+
uploadMedia(request: UploadMediaRequest): Promise<UploadMediaResponse>;
|
|
107
|
+
}
|
|
108
|
+
export declare function resolveAuthToken(explicitToken?: string): string | undefined;
|
|
109
|
+
export {};
|
|
110
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,aAAa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