@moxn/kb-migrate 0.2.0 → 0.2.2

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/client.js CHANGED
@@ -117,7 +117,10 @@ export class MoxnClient {
117
117
  let offset = 0;
118
118
  const limit = 100;
119
119
  while (true) {
120
- const params = new URLSearchParams({ limit: String(limit), offset: String(offset) });
120
+ const params = new URLSearchParams({
121
+ limit: String(limit),
122
+ offset: String(offset),
123
+ });
121
124
  if (pathPrefix) {
122
125
  params.set('path', pathPrefix);
123
126
  }
package/dist/export.js CHANGED
@@ -117,7 +117,10 @@ function buildMarkdown(doc, mediaMap, mdFilePath) {
117
117
  // ──────────────────────────────────────────────
118
118
  function getMediaTarget(block, options) {
119
119
  if (block.blockType === 'image') {
120
- return { targetDir: options.imageDir, fallbackExt: mimeToExt(block.mimeType || 'image/png') };
120
+ return {
121
+ targetDir: options.imageDir,
122
+ fallbackExt: mimeToExt(block.mimeType || 'image/png'),
123
+ };
121
124
  }
122
125
  else if (block.blockType === 'document') {
123
126
  return {
@@ -137,9 +140,9 @@ export async function runExport(outputDir, options) {
137
140
  const startTime = Date.now();
138
141
  const client = new MoxnClient(options);
139
142
  // List documents
140
- console.log('Fetching document list...');
143
+ console.error('Fetching document list...');
141
144
  const documents = await client.listDocuments(options.basePath || undefined);
142
- console.log(`Found ${documents.length} documents`);
145
+ console.error(`Found ${documents.length} documents`);
143
146
  if (documents.length === 0) {
144
147
  return {
145
148
  timestamp: new Date().toISOString(),
@@ -174,7 +177,7 @@ export async function runExport(outputDir, options) {
174
177
  for (const docItem of documents) {
175
178
  const docStart = Date.now();
176
179
  const mediaFiles = [];
177
- console.log(`Processing: ${docItem.path}`);
180
+ console.error(`Processing: ${docItem.path}`);
178
181
  try {
179
182
  const doc = await client.getDocument(docItem.id);
180
183
  const mdRelativePath = docPathToFilePath(doc.path);
@@ -205,7 +208,7 @@ export async function runExport(outputDir, options) {
205
208
  }
206
209
  catch (err) {
207
210
  const msg = err instanceof Error ? err.message : String(err);
208
- console.log(` \u2717 Download failed: ${filename}: ${msg}`);
211
+ console.error(` \u2717 Download failed: ${filename}: ${msg}`);
209
212
  }
210
213
  }
211
214
  }
@@ -220,7 +223,7 @@ export async function runExport(outputDir, options) {
220
223
  fs.mkdirSync(path.dirname(mdFullPath), { recursive: true });
221
224
  fs.writeFileSync(mdFullPath, markdown, 'utf-8');
222
225
  }
223
- console.log(` \u2713 ${mdRelativePath} (${doc.sections.length} sections, ${mediaFiles.length} media)`);
226
+ console.error(` \u2713 ${mdRelativePath} (${doc.sections.length} sections, ${mediaFiles.length} media)`);
224
227
  results.push({
225
228
  documentId: doc.id,
226
229
  documentPath: doc.path,
@@ -233,7 +236,7 @@ export async function runExport(outputDir, options) {
233
236
  }
234
237
  catch (error) {
235
238
  const message = error instanceof Error ? error.message : String(error);
236
- console.log(` \u2717 Failed: ${message}`);
239
+ console.error(` \u2717 Failed: ${message}`);
237
240
  results.push({
238
241
  documentId: docItem.id,
239
242
  documentPath: docItem.path,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moxn/kb-migrate",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Migration tool for importing documents into Moxn Knowledge Base from local files, Notion, Google Docs, and more",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",