@stoneforge/quarry 1.13.0 → 1.14.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/dist/api/quarry-api.d.ts +9 -1
- package/dist/api/quarry-api.d.ts.map +1 -1
- package/dist/api/quarry-api.js +21 -2
- package/dist/api/quarry-api.js.map +1 -1
- package/dist/api/types.d.ts +8 -1
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/types.js.map +1 -1
- package/dist/cli/commands/auto-link-helper.d.ts.map +1 -1
- package/dist/cli/commands/auto-link-helper.js +1 -0
- package/dist/cli/commands/auto-link-helper.js.map +1 -1
- package/dist/cli/commands/crud.d.ts +2 -0
- package/dist/cli/commands/crud.d.ts.map +1 -1
- package/dist/cli/commands/crud.js +100 -10
- package/dist/cli/commands/crud.js.map +1 -1
- package/dist/cli/commands/docs.js +2 -2
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/cli/commands/document.js +1 -1
- package/dist/cli/commands/document.js.map +1 -1
- package/dist/cli/commands/entity.js +1 -1
- package/dist/cli/commands/entity.js.map +1 -1
- package/dist/cli/commands/external-sync.d.ts +6 -5
- package/dist/cli/commands/external-sync.d.ts.map +1 -1
- package/dist/cli/commands/external-sync.js +1032 -180
- package/dist/cli/commands/external-sync.js.map +1 -1
- package/dist/cli/commands/library.js +1 -1
- package/dist/cli/commands/library.js.map +1 -1
- package/dist/cli/commands/message.js +2 -2
- package/dist/cli/commands/message.js.map +1 -1
- package/dist/cli/commands/serve.d.ts.map +1 -1
- package/dist/cli/commands/serve.js +2 -0
- package/dist/cli/commands/serve.js.map +1 -1
- package/dist/cli/commands/task.d.ts.map +1 -1
- package/dist/cli/commands/task.js +7 -4
- package/dist/cli/commands/task.js.map +1 -1
- package/dist/cli/commands/team.js +1 -1
- package/dist/cli/commands/team.js.map +1 -1
- package/dist/cli/commands/workflow.js +1 -1
- package/dist/cli/commands/workflow.js.map +1 -1
- package/dist/cli/utils/progress.d.ts +30 -0
- package/dist/cli/utils/progress.d.ts.map +1 -0
- package/dist/cli/utils/progress.js +47 -0
- package/dist/cli/utils/progress.js.map +1 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +6 -0
- package/dist/config/config.js.map +1 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +1 -0
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/file.d.ts.map +1 -1
- package/dist/config/file.js +10 -0
- package/dist/config/file.js.map +1 -1
- package/dist/config/merge.d.ts.map +1 -1
- package/dist/config/merge.js +7 -1
- package/dist/config/merge.js.map +1 -1
- package/dist/config/types.d.ts +7 -2
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js +3 -0
- package/dist/config/types.js.map +1 -1
- package/dist/config/validation.d.ts.map +1 -1
- package/dist/config/validation.js +13 -0
- package/dist/config/validation.js.map +1 -1
- package/dist/external-sync/adapters/document-sync-adapter.d.ts +150 -0
- package/dist/external-sync/adapters/document-sync-adapter.d.ts.map +1 -0
- package/dist/external-sync/adapters/document-sync-adapter.js +325 -0
- package/dist/external-sync/adapters/document-sync-adapter.js.map +1 -0
- package/dist/external-sync/index.d.ts +3 -0
- package/dist/external-sync/index.d.ts.map +1 -1
- package/dist/external-sync/index.js +4 -0
- package/dist/external-sync/index.js.map +1 -1
- package/dist/external-sync/provider-registry.d.ts +7 -3
- package/dist/external-sync/provider-registry.d.ts.map +1 -1
- package/dist/external-sync/provider-registry.js +20 -3
- package/dist/external-sync/provider-registry.js.map +1 -1
- package/dist/external-sync/providers/folder/folder-document-adapter.d.ts +97 -0
- package/dist/external-sync/providers/folder/folder-document-adapter.d.ts.map +1 -0
- package/dist/external-sync/providers/folder/folder-document-adapter.js +261 -0
- package/dist/external-sync/providers/folder/folder-document-adapter.js.map +1 -0
- package/dist/external-sync/providers/folder/folder-fs.d.ts +146 -0
- package/dist/external-sync/providers/folder/folder-fs.d.ts.map +1 -0
- package/dist/external-sync/providers/folder/folder-fs.js +300 -0
- package/dist/external-sync/providers/folder/folder-fs.js.map +1 -0
- package/dist/external-sync/providers/folder/folder-provider.d.ts +28 -0
- package/dist/external-sync/providers/folder/folder-provider.d.ts.map +1 -0
- package/dist/external-sync/providers/folder/folder-provider.js +87 -0
- package/dist/external-sync/providers/folder/folder-provider.js.map +1 -0
- package/dist/external-sync/providers/folder/index.d.ts +11 -0
- package/dist/external-sync/providers/folder/index.d.ts.map +1 -0
- package/dist/external-sync/providers/folder/index.js +13 -0
- package/dist/external-sync/providers/folder/index.js.map +1 -0
- package/dist/external-sync/providers/index.d.ts +4 -0
- package/dist/external-sync/providers/index.d.ts.map +1 -1
- package/dist/external-sync/providers/index.js +5 -0
- package/dist/external-sync/providers/index.js.map +1 -1
- package/dist/external-sync/providers/notion/index.d.ts +19 -0
- package/dist/external-sync/providers/notion/index.d.ts.map +1 -0
- package/dist/external-sync/providers/notion/index.js +20 -0
- package/dist/external-sync/providers/notion/index.js.map +1 -0
- package/dist/external-sync/providers/notion/notion-api.d.ts +253 -0
- package/dist/external-sync/providers/notion/notion-api.d.ts.map +1 -0
- package/dist/external-sync/providers/notion/notion-api.js +492 -0
- package/dist/external-sync/providers/notion/notion-api.js.map +1 -0
- package/dist/external-sync/providers/notion/notion-blocks.d.ts +93 -0
- package/dist/external-sync/providers/notion/notion-blocks.d.ts.map +1 -0
- package/dist/external-sync/providers/notion/notion-blocks.js +773 -0
- package/dist/external-sync/providers/notion/notion-blocks.js.map +1 -0
- package/dist/external-sync/providers/notion/notion-document-adapter.d.ts +176 -0
- package/dist/external-sync/providers/notion/notion-document-adapter.d.ts.map +1 -0
- package/dist/external-sync/providers/notion/notion-document-adapter.js +413 -0
- package/dist/external-sync/providers/notion/notion-document-adapter.js.map +1 -0
- package/dist/external-sync/providers/notion/notion-provider.d.ts +57 -0
- package/dist/external-sync/providers/notion/notion-provider.d.ts.map +1 -0
- package/dist/external-sync/providers/notion/notion-provider.js +159 -0
- package/dist/external-sync/providers/notion/notion-provider.js.map +1 -0
- package/dist/external-sync/providers/notion/notion-types.d.ts +388 -0
- package/dist/external-sync/providers/notion/notion-types.d.ts.map +1 -0
- package/dist/external-sync/providers/notion/notion-types.js +47 -0
- package/dist/external-sync/providers/notion/notion-types.js.map +1 -0
- package/dist/external-sync/sync-engine.d.ts +70 -4
- package/dist/external-sync/sync-engine.d.ts.map +1 -1
- package/dist/external-sync/sync-engine.js +436 -67
- package/dist/external-sync/sync-engine.js.map +1 -1
- package/dist/server/index.js +8 -8
- package/dist/server/index.js.map +1 -1
- package/package.json +4 -12
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Document Sync Adapter Utilities
|
|
3
|
+
*
|
|
4
|
+
* Shared field mapping logic for converting between Stoneforge documents and
|
|
5
|
+
* external document representations (e.g., Notion pages, Obsidian notes).
|
|
6
|
+
*
|
|
7
|
+
* These utilities are provider-agnostic — they handle the common conversion
|
|
8
|
+
* logic that all document sync providers need.
|
|
9
|
+
*
|
|
10
|
+
* Key functions:
|
|
11
|
+
* - documentToExternalDocumentInput: Convert a Stoneforge Document → ExternalDocumentInput for push
|
|
12
|
+
* - externalDocumentToDocumentUpdates: Convert an ExternalDocument → Partial<Document> for pull
|
|
13
|
+
* - diffDocumentUpdates: Return only changed fields between existing and updated document
|
|
14
|
+
* - computeExternalDocumentHash: Deterministic hash for change detection
|
|
15
|
+
*/
|
|
16
|
+
import { createHash } from 'crypto';
|
|
17
|
+
// ============================================================================
|
|
18
|
+
// System Categories
|
|
19
|
+
// ============================================================================
|
|
20
|
+
/**
|
|
21
|
+
* Document categories that are system-managed and should be excluded from
|
|
22
|
+
* external sync. These documents are structural (task descriptions, message
|
|
23
|
+
* content) and are synced through their parent element's sync adapter.
|
|
24
|
+
*/
|
|
25
|
+
export const SYSTEM_CATEGORIES = new Set([
|
|
26
|
+
'task-description',
|
|
27
|
+
'message-content',
|
|
28
|
+
]);
|
|
29
|
+
/**
|
|
30
|
+
* Checks whether a document category is a system category that should
|
|
31
|
+
* be excluded from document sync.
|
|
32
|
+
*/
|
|
33
|
+
export function isSystemCategory(category) {
|
|
34
|
+
return SYSTEM_CATEGORIES.has(category);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Checks whether a document should be included in external sync operations
|
|
38
|
+
* (link-all, push, pull). A document is syncable if:
|
|
39
|
+
* - It does not have a system category (task-description, message-content)
|
|
40
|
+
* - It has a non-empty title (null, undefined, or whitespace-only titles are excluded)
|
|
41
|
+
*
|
|
42
|
+
* Documents without titles are typically system-generated (messages, task descriptions)
|
|
43
|
+
* that happen to not have the system category set, or scratch documents. They all
|
|
44
|
+
* slugify to "untitled.md" and overwrite each other, so they must be excluded.
|
|
45
|
+
*/
|
|
46
|
+
export function isSyncableDocument(doc) {
|
|
47
|
+
if (isSystemCategory(doc.category))
|
|
48
|
+
return false;
|
|
49
|
+
if (!doc.title || doc.title.trim().length === 0)
|
|
50
|
+
return false;
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
// ============================================================================
|
|
54
|
+
// Content Type Mapping
|
|
55
|
+
// ============================================================================
|
|
56
|
+
/**
|
|
57
|
+
* Maps Stoneforge ContentType to external document content type.
|
|
58
|
+
*
|
|
59
|
+
* Stoneforge uses 'markdown', 'text', and 'json'.
|
|
60
|
+
* External systems use 'markdown', 'text', and 'html'.
|
|
61
|
+
* JSON content is mapped to 'text' for external systems since most
|
|
62
|
+
* document providers don't have a native JSON content type.
|
|
63
|
+
*/
|
|
64
|
+
export function mapContentTypeToExternal(contentType) {
|
|
65
|
+
switch (contentType) {
|
|
66
|
+
case 'markdown':
|
|
67
|
+
return 'markdown';
|
|
68
|
+
case 'text':
|
|
69
|
+
return 'text';
|
|
70
|
+
case 'json':
|
|
71
|
+
// JSON doesn't have a direct external equivalent; map to text
|
|
72
|
+
return 'text';
|
|
73
|
+
default:
|
|
74
|
+
return 'text';
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Maps external document content type to Stoneforge ContentType.
|
|
79
|
+
*
|
|
80
|
+
* External systems use 'markdown', 'text', and 'html'.
|
|
81
|
+
* HTML content is mapped to 'text' since Stoneforge doesn't have an HTML
|
|
82
|
+
* content type — the content is stored as-is, just categorized as text.
|
|
83
|
+
*/
|
|
84
|
+
export function mapContentTypeFromExternal(contentType) {
|
|
85
|
+
switch (contentType) {
|
|
86
|
+
case 'markdown':
|
|
87
|
+
return 'markdown';
|
|
88
|
+
case 'text':
|
|
89
|
+
return 'text';
|
|
90
|
+
case 'html':
|
|
91
|
+
// HTML doesn't have a direct Stoneforge equivalent; map to text
|
|
92
|
+
return 'text';
|
|
93
|
+
default:
|
|
94
|
+
return 'text';
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Slugifies a library name for use as a directory name.
|
|
99
|
+
* Uses the same algorithm as the folder adapter's slugify function:
|
|
100
|
+
* lowercase, replace non-alphanumeric chars with hyphens, collapse
|
|
101
|
+
* consecutive hyphens, trim leading/trailing hyphens.
|
|
102
|
+
*
|
|
103
|
+
* @param name - Library name to slugify
|
|
104
|
+
* @returns Slugified directory name
|
|
105
|
+
*/
|
|
106
|
+
function slugifyLibraryName(name) {
|
|
107
|
+
const slug = name
|
|
108
|
+
.toLowerCase()
|
|
109
|
+
.replace(/[^a-z0-9-]/g, '-')
|
|
110
|
+
.replace(/-+/g, '-')
|
|
111
|
+
.replace(/^-|-$/g, '');
|
|
112
|
+
return slug || 'untitled';
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Resolves the library path for a document by querying its parent-child
|
|
116
|
+
* dependencies. Builds a hierarchical path from the root library down
|
|
117
|
+
* to the document's immediate parent library.
|
|
118
|
+
*
|
|
119
|
+
* For example, if a document belongs to library "API Reference" which
|
|
120
|
+
* is a child of library "Documentation", the returned path would be
|
|
121
|
+
* "documentation/api-reference".
|
|
122
|
+
*
|
|
123
|
+
* Design decisions:
|
|
124
|
+
* - If a document belongs to multiple libraries, the first one found is used
|
|
125
|
+
* - Library names are slugified for directory names
|
|
126
|
+
* - If the document has no library parent, returns undefined
|
|
127
|
+
*
|
|
128
|
+
* @param api - API for querying dependencies and elements
|
|
129
|
+
* @param documentId - The document's element ID
|
|
130
|
+
* @returns The slugified library path (e.g., 'documentation/api-reference'), or undefined if not in a library
|
|
131
|
+
*/
|
|
132
|
+
export async function resolveDocumentLibraryPath(api, documentId) {
|
|
133
|
+
// Find parent-child dependencies where document is the child (blockedId)
|
|
134
|
+
const deps = await api.getDependencies(documentId, ['parent-child']);
|
|
135
|
+
if (deps.length === 0) {
|
|
136
|
+
return undefined;
|
|
137
|
+
}
|
|
138
|
+
// Find the first library parent
|
|
139
|
+
let libraryId;
|
|
140
|
+
for (const dep of deps) {
|
|
141
|
+
const parent = await api.get(dep.blockerId);
|
|
142
|
+
if (parent && parent.type === 'library') {
|
|
143
|
+
libraryId = dep.blockerId;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (!libraryId) {
|
|
148
|
+
return undefined;
|
|
149
|
+
}
|
|
150
|
+
// Walk up the library hierarchy to build the full path
|
|
151
|
+
const pathSegments = [];
|
|
152
|
+
let currentId = libraryId;
|
|
153
|
+
const visited = new Set(); // Prevent infinite loops from cycles
|
|
154
|
+
while (currentId && !visited.has(currentId)) {
|
|
155
|
+
visited.add(currentId);
|
|
156
|
+
const library = await api.get(currentId);
|
|
157
|
+
if (!library || library.type !== 'library') {
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
pathSegments.unshift(slugifyLibraryName(library.name));
|
|
161
|
+
// Find the parent library of this library
|
|
162
|
+
const parentDeps = await api.getDependencies(currentId, ['parent-child']);
|
|
163
|
+
let foundParentLibrary = false;
|
|
164
|
+
for (const dep of parentDeps) {
|
|
165
|
+
const parent = await api.get(dep.blockerId);
|
|
166
|
+
if (parent && parent.type === 'library') {
|
|
167
|
+
currentId = dep.blockerId;
|
|
168
|
+
foundParentLibrary = true;
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
if (!foundParentLibrary) {
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return pathSegments.length > 0 ? pathSegments.join('/') : undefined;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Batch-resolves library paths for multiple documents.
|
|
180
|
+
* More efficient than calling resolveDocumentLibraryPath individually
|
|
181
|
+
* since it can reuse cached library lookups.
|
|
182
|
+
*
|
|
183
|
+
* @param api - API for querying dependencies and elements
|
|
184
|
+
* @param documentIds - Array of document element IDs
|
|
185
|
+
* @returns Map from document ID to library path (undefined entries omitted)
|
|
186
|
+
*/
|
|
187
|
+
export async function resolveDocumentLibraryPaths(api, documentIds) {
|
|
188
|
+
const result = new Map();
|
|
189
|
+
for (const docId of documentIds) {
|
|
190
|
+
const libraryPath = await resolveDocumentLibraryPath(api, docId);
|
|
191
|
+
if (libraryPath) {
|
|
192
|
+
result.set(docId, libraryPath);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return result;
|
|
196
|
+
}
|
|
197
|
+
// ============================================================================
|
|
198
|
+
// Push: Stoneforge Document → External Document
|
|
199
|
+
// ============================================================================
|
|
200
|
+
/**
|
|
201
|
+
* Converts a Stoneforge Document into an ExternalDocumentInput for
|
|
202
|
+
* creating/updating a page in an external system.
|
|
203
|
+
*
|
|
204
|
+
* Handles:
|
|
205
|
+
* - Title mapping (1:1, falls back to empty string if undefined)
|
|
206
|
+
* - Content mapping (1:1)
|
|
207
|
+
* - ContentType mapping (markdown/text → markdown/text, json → text)
|
|
208
|
+
* - Optional library path for directory-based organization
|
|
209
|
+
*
|
|
210
|
+
* @param doc - The Stoneforge document to convert
|
|
211
|
+
* @param libraryPath - Optional pre-computed library path for the document
|
|
212
|
+
* @returns ExternalDocumentInput ready for the provider adapter
|
|
213
|
+
*/
|
|
214
|
+
export function documentToExternalDocumentInput(doc, libraryPath) {
|
|
215
|
+
return {
|
|
216
|
+
title: doc.title ?? '',
|
|
217
|
+
content: doc.content,
|
|
218
|
+
contentType: mapContentTypeToExternal(doc.contentType),
|
|
219
|
+
...(doc.category !== undefined && { category: doc.category }),
|
|
220
|
+
...(doc.tags !== undefined && doc.tags.length > 0 && { tags: doc.tags }),
|
|
221
|
+
...(libraryPath !== undefined && { libraryPath }),
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
// ============================================================================
|
|
225
|
+
// Pull: External Document → Stoneforge Document Updates
|
|
226
|
+
// ============================================================================
|
|
227
|
+
/**
|
|
228
|
+
* Converts an ExternalDocument into a partial Document update object for
|
|
229
|
+
* applying external changes to a local Stoneforge document.
|
|
230
|
+
*
|
|
231
|
+
* Handles:
|
|
232
|
+
* - Title mapping (1:1)
|
|
233
|
+
* - Content mapping (1:1)
|
|
234
|
+
* - ContentType mapping (markdown/text/html → markdown/text/text)
|
|
235
|
+
*
|
|
236
|
+
* If existingDoc is provided, only changed fields are returned (diff mode).
|
|
237
|
+
* If existingDoc is undefined, all mappable fields are returned (create mode).
|
|
238
|
+
*
|
|
239
|
+
* @param externalDoc - The external document to convert
|
|
240
|
+
* @param existingDoc - The existing local document (undefined for new documents)
|
|
241
|
+
* @returns Partial<Document> with only the changed fields (or all fields if no existingDoc)
|
|
242
|
+
*/
|
|
243
|
+
export function externalDocumentToDocumentUpdates(externalDoc, existingDoc) {
|
|
244
|
+
const contentType = mapContentTypeFromExternal(externalDoc.contentType);
|
|
245
|
+
const fullUpdate = {
|
|
246
|
+
title: externalDoc.title,
|
|
247
|
+
content: externalDoc.content,
|
|
248
|
+
contentType,
|
|
249
|
+
};
|
|
250
|
+
// If no existing document, return full create input
|
|
251
|
+
if (!existingDoc) {
|
|
252
|
+
return fullUpdate;
|
|
253
|
+
}
|
|
254
|
+
// Diff mode: only return changed fields
|
|
255
|
+
return diffDocumentUpdates(existingDoc, fullUpdate);
|
|
256
|
+
}
|
|
257
|
+
// ============================================================================
|
|
258
|
+
// Diff Utilities
|
|
259
|
+
// ============================================================================
|
|
260
|
+
/**
|
|
261
|
+
* Compares a full update against an existing document and returns only
|
|
262
|
+
* the fields that actually changed.
|
|
263
|
+
*
|
|
264
|
+
* This prevents unnecessary updates when pulling changes from external
|
|
265
|
+
* systems where the data hasn't actually changed.
|
|
266
|
+
*
|
|
267
|
+
* Compared fields: title, content, contentType, category, tags
|
|
268
|
+
*/
|
|
269
|
+
export function diffDocumentUpdates(existing, updates) {
|
|
270
|
+
const diff = {};
|
|
271
|
+
if (updates.title !== undefined && updates.title !== existing.title) {
|
|
272
|
+
diff.title = updates.title;
|
|
273
|
+
}
|
|
274
|
+
if (updates.content !== undefined && updates.content !== existing.content) {
|
|
275
|
+
diff.content = updates.content;
|
|
276
|
+
}
|
|
277
|
+
if (updates.contentType !== undefined &&
|
|
278
|
+
updates.contentType !== existing.contentType) {
|
|
279
|
+
diff.contentType = updates.contentType;
|
|
280
|
+
}
|
|
281
|
+
if (updates.category !== undefined &&
|
|
282
|
+
updates.category !== existing.category) {
|
|
283
|
+
diff.category = updates.category;
|
|
284
|
+
}
|
|
285
|
+
if (updates.tags !== undefined && !arraysEqual(updates.tags, existing.tags)) {
|
|
286
|
+
diff.tags = updates.tags;
|
|
287
|
+
}
|
|
288
|
+
return diff;
|
|
289
|
+
}
|
|
290
|
+
// ============================================================================
|
|
291
|
+
// Hash Computation
|
|
292
|
+
// ============================================================================
|
|
293
|
+
/**
|
|
294
|
+
* Computes a deterministic hash of an ExternalDocument for change detection.
|
|
295
|
+
*
|
|
296
|
+
* The hash is based on the document's title, content, and contentType.
|
|
297
|
+
* Used by the sync engine to detect whether an external document has
|
|
298
|
+
* changed since the last sync, avoiding unnecessary pull operations.
|
|
299
|
+
*
|
|
300
|
+
* @param doc - The external document to hash
|
|
301
|
+
* @returns A hex-encoded SHA-256 hash string
|
|
302
|
+
*/
|
|
303
|
+
export function computeExternalDocumentHash(doc) {
|
|
304
|
+
const hash = createHash('sha256');
|
|
305
|
+
hash.update(doc.title);
|
|
306
|
+
hash.update('\0'); // null byte separator to avoid collisions
|
|
307
|
+
hash.update(doc.content);
|
|
308
|
+
hash.update('\0');
|
|
309
|
+
hash.update(doc.contentType);
|
|
310
|
+
return hash.digest('hex');
|
|
311
|
+
}
|
|
312
|
+
// ============================================================================
|
|
313
|
+
// Internal Helpers
|
|
314
|
+
// ============================================================================
|
|
315
|
+
/**
|
|
316
|
+
* Compares two arrays for equality (order-independent).
|
|
317
|
+
*/
|
|
318
|
+
function arraysEqual(a, b) {
|
|
319
|
+
if (a.length !== b.length)
|
|
320
|
+
return false;
|
|
321
|
+
const sortedA = [...a].sort();
|
|
322
|
+
const sortedB = [...b].sort();
|
|
323
|
+
return sortedA.every((val, idx) => val === sortedB[idx]);
|
|
324
|
+
}
|
|
325
|
+
//# sourceMappingURL=document-sync-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-sync-adapter.js","sourceRoot":"","sources":["../../../src/external-sync/adapters/document-sync-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAYpC,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAkC,IAAI,GAAG,CAAmB;IACxF,kBAAkB;IAClB,iBAAiB;CAClB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAA0B;IACzD,OAAO,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAa;IAC9C,IAAI,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC;QAAE,OAAO,KAAK,CAAC;IACjD,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;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C,CAAC,IAAI,EAAE,CAAC;IAC9B,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9B,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -17,4 +17,7 @@ export { autoLinkTask } from './auto-link.js';
|
|
|
17
17
|
export type { AutoLinkTaskParams, AutoLinkTaskResult } from './auto-link.js';
|
|
18
18
|
export { createLinearProvider, createLinearPlaceholderProvider, } from './providers/linear/index.js';
|
|
19
19
|
export type { CreateLinearProviderOptions } from './providers/linear/index.js';
|
|
20
|
+
export { createNotionProvider, createNotionPlaceholderProvider, NotionDocumentAdapter, createNotionDocumentAdapter, extractTitleFromProperties, buildPageProperties, markdownToNotionBlocks, notionBlocksToMarkdown, NotionApiClient, NotionApiError, isNotionApiError, } from './providers/notion/index.js';
|
|
21
|
+
export type { CreateNotionProviderOptions, NotionApiClientOptions, RateLimitState as NotionRateLimitState, NotionPage, NotionBlock, NotionBlockInput, NotionRichText, NotionAnnotations, NotionProperty, NotionDatabase, NotionDatabaseProperty, NotionDatabaseSchema, NotionUpdateDatabaseInput, } from './providers/notion/index.js';
|
|
22
|
+
export { createFolderProvider, FolderDocumentAdapter, createFolderDocumentAdapter, slugify, } from './providers/folder/index.js';
|
|
20
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/external-sync/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,6BAA6B,EAC7B,gCAAgC,GACjC,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,OAAO,EACL,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,YAAY,EACZ,eAAe,EACf,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAChE,YAAY,EACV,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,oBAAoB,EACpB,+BAA+B,EAC/B,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,WAAW,EACX,WAAW,EACX,UAAU,EACV,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,GACd,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAG7E,OAAO,EACL,oBAAoB,EACpB,+BAA+B,GAChC,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/external-sync/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,6BAA6B,EAC7B,gCAAgC,GACjC,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,OAAO,EACL,cAAc,EACd,eAAe,EACf,qBAA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,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,2BAA2B,EAC3B,OAAO,GACR,MAAM,6BAA6B,CAAC"}
|
|
@@ -17,4 +17,8 @@ export { createGitHubProvider, createGitHubPlaceholderProvider, GitHubTaskAdapte
|
|
|
17
17
|
export { autoLinkTask } from './auto-link.js';
|
|
18
18
|
// Linear provider
|
|
19
19
|
export { createLinearProvider, createLinearPlaceholderProvider, } from './providers/linear/index.js';
|
|
20
|
+
// Notion provider
|
|
21
|
+
export { createNotionProvider, createNotionPlaceholderProvider, NotionDocumentAdapter, createNotionDocumentAdapter, extractTitleFromProperties, buildPageProperties, markdownToNotionBlocks, notionBlocksToMarkdown, NotionApiClient, NotionApiError, isNotionApiError, } from './providers/notion/index.js';
|
|
22
|
+
// Folder provider
|
|
23
|
+
export { createFolderProvider, FolderDocumentAdapter, createFolderDocumentAdapter, slugify, } from './providers/folder/index.js';
|
|
20
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/external-sync/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,oBAAoB;AACpB,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,6BAA6B,EAC7B,gCAAgC,GACjC,MAAM,wBAAwB,CAAC;AAGhC,oBAAoB;AACpB,OAAO,EACL,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAOhC,cAAc;AACd,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAUhE,kBAAkB;AAClB,OAAO,EACL,oBAAoB,EACpB,+BAA+B,EAC/B,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AAYrC,oBAAoB;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,kBAAkB;AAClB,OAAO,EACL,oBAAoB,EACpB,+BAA+B,GAChC,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/external-sync/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,oBAAoB;AACpB,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,6BAA6B,EAC7B,gCAAgC,GACjC,MAAM,wBAAwB,CAAC;AAGhC,oBAAoB;AACpB,OAAO,EACL,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAOhC,cAAc;AACd,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAUhE,kBAAkB;AAClB,OAAO,EACL,oBAAoB,EACpB,+BAA+B,EAC/B,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AAYrC,oBAAoB;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,kBAAkB;AAClB,OAAO,EACL,oBAAoB,EACpB,+BAA+B,GAChC,MAAM,6BAA6B,CAAC;AAGrC,kBAAkB;AAClB,OAAO,EACL,oBAAoB,EACpB,+BAA+B,EAC/B,qBAAqB,EACrB,2BAA2B,EAC3B,0BAA0B,EAC1B,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,cAAc,EACd,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AAiBrC,kBAAkB;AAClB,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,2BAA2B,EAC3B,OAAO,GACR,MAAM,6BAA6B,CAAC"}
|
|
@@ -87,8 +87,9 @@ export declare function createProviderRegistry(): ProviderRegistry;
|
|
|
87
87
|
/**
|
|
88
88
|
* Create a ProviderRegistry with default providers registered.
|
|
89
89
|
*
|
|
90
|
-
* Registers placeholder providers for GitHub and
|
|
91
|
-
*
|
|
90
|
+
* Registers placeholder providers for GitHub, Linear, and Notion by default,
|
|
91
|
+
* plus the Folder provider (which needs no authentication and is always ready).
|
|
92
|
+
* The actual provider implementations replace placeholders when configured with API keys.
|
|
92
93
|
*
|
|
93
94
|
* @returns A ProviderRegistry with default providers
|
|
94
95
|
*/
|
|
@@ -96,12 +97,15 @@ export declare function createDefaultProviderRegistry(): ProviderRegistry;
|
|
|
96
97
|
/**
|
|
97
98
|
* Create a ProviderRegistry with real configured providers.
|
|
98
99
|
*
|
|
99
|
-
* Starts with placeholder providers for all known providers (GitHub, Linear),
|
|
100
|
+
* Starts with placeholder providers for all known providers (GitHub, Linear, Notion, Folder),
|
|
100
101
|
* then replaces placeholders with real configured providers for any configs
|
|
101
102
|
* that have a token set. This ensures providers without tokens remain as
|
|
102
103
|
* placeholders (which throw descriptive errors), while configured providers
|
|
103
104
|
* are ready for actual sync operations.
|
|
104
105
|
*
|
|
106
|
+
* Note: The Folder provider is always ready (no token needed), so it is
|
|
107
|
+
* never replaced — it remains as-is from the default registry.
|
|
108
|
+
*
|
|
105
109
|
* @param providerConfigs - Array of provider configurations (from settings)
|
|
106
110
|
* @returns A ProviderRegistry with configured providers replacing placeholders
|
|
107
111
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-registry.d.ts","sourceRoot":"","sources":["../../src/external-sync/provider-registry.ts"],"names":[],"mappings":"AAAA;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AACH,wBAAgB,gCAAgC,CAC9C,eAAe,EAAE,SAAS,cAAc,EAAE,GACzC,gBAAgB,CA8ClB"}
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { createGitHubProvider, createGitHubPlaceholderProvider } from './providers/github/index.js';
|
|
19
19
|
import { createLinearProvider, createLinearPlaceholderProvider } from './providers/linear/index.js';
|
|
20
|
+
import { createNotionProvider, createNotionPlaceholderProvider } from './providers/notion/index.js';
|
|
21
|
+
import { createFolderProvider } from './providers/folder/index.js';
|
|
20
22
|
// ============================================================================
|
|
21
23
|
// ProviderRegistry
|
|
22
24
|
// ============================================================================
|
|
@@ -135,8 +137,9 @@ export function createProviderRegistry() {
|
|
|
135
137
|
/**
|
|
136
138
|
* Create a ProviderRegistry with default providers registered.
|
|
137
139
|
*
|
|
138
|
-
* Registers placeholder providers for GitHub and
|
|
139
|
-
*
|
|
140
|
+
* Registers placeholder providers for GitHub, Linear, and Notion by default,
|
|
141
|
+
* plus the Folder provider (which needs no authentication and is always ready).
|
|
142
|
+
* The actual provider implementations replace placeholders when configured with API keys.
|
|
140
143
|
*
|
|
141
144
|
* @returns A ProviderRegistry with default providers
|
|
142
145
|
*/
|
|
@@ -144,23 +147,32 @@ export function createDefaultProviderRegistry() {
|
|
|
144
147
|
const registry = new ProviderRegistry();
|
|
145
148
|
registry.register(createGitHubPlaceholderProvider());
|
|
146
149
|
registry.register(createLinearPlaceholderProvider());
|
|
150
|
+
registry.register(createNotionPlaceholderProvider());
|
|
151
|
+
registry.register(createFolderProvider());
|
|
147
152
|
return registry;
|
|
148
153
|
}
|
|
149
154
|
/**
|
|
150
155
|
* Create a ProviderRegistry with real configured providers.
|
|
151
156
|
*
|
|
152
|
-
* Starts with placeholder providers for all known providers (GitHub, Linear),
|
|
157
|
+
* Starts with placeholder providers for all known providers (GitHub, Linear, Notion, Folder),
|
|
153
158
|
* then replaces placeholders with real configured providers for any configs
|
|
154
159
|
* that have a token set. This ensures providers without tokens remain as
|
|
155
160
|
* placeholders (which throw descriptive errors), while configured providers
|
|
156
161
|
* are ready for actual sync operations.
|
|
157
162
|
*
|
|
163
|
+
* Note: The Folder provider is always ready (no token needed), so it is
|
|
164
|
+
* never replaced — it remains as-is from the default registry.
|
|
165
|
+
*
|
|
158
166
|
* @param providerConfigs - Array of provider configurations (from settings)
|
|
159
167
|
* @returns A ProviderRegistry with configured providers replacing placeholders
|
|
160
168
|
*/
|
|
161
169
|
export function createConfiguredProviderRegistry(providerConfigs) {
|
|
162
170
|
const registry = createDefaultProviderRegistry();
|
|
163
171
|
for (const config of providerConfigs) {
|
|
172
|
+
// Folder provider doesn't need a token — it's always ready
|
|
173
|
+
if (config.provider === 'folder') {
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
164
176
|
if (!config.token) {
|
|
165
177
|
continue;
|
|
166
178
|
}
|
|
@@ -180,6 +192,11 @@ export function createConfiguredProviderRegistry(providerConfigs) {
|
|
|
180
192
|
apiKey: config.token,
|
|
181
193
|
}));
|
|
182
194
|
break;
|
|
195
|
+
case 'notion':
|
|
196
|
+
registry.register(createNotionProvider({
|
|
197
|
+
token: config.token,
|
|
198
|
+
}));
|
|
199
|
+
break;
|
|
183
200
|
// Unknown providers are silently skipped — their placeholders remain
|
|
184
201
|
}
|
|
185
202
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-registry.js","sourceRoot":"","sources":["../../src/external-sync/provider-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAUH,OAAO,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"provider-registry.js","sourceRoot":"","sources":["../../src/external-sync/provider-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAUH,OAAO,EAAE,oBAAoB,EAA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97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Folder Document Sync Adapter
|
|
3
|
+
*
|
|
4
|
+
* Implements the DocumentSyncAdapter interface for local folder-based
|
|
5
|
+
* document synchronization. Maps between Stoneforge documents and
|
|
6
|
+
* markdown files with YAML frontmatter in a local directory tree.
|
|
7
|
+
*
|
|
8
|
+
* Uses folder-fs.ts for all filesystem operations (read, write, list).
|
|
9
|
+
*
|
|
10
|
+
* Conventions:
|
|
11
|
+
* - project = absolute folder path (base directory)
|
|
12
|
+
* - externalId = relative file path within the folder (e.g., 'notes/meeting.md')
|
|
13
|
+
* - URL format: file:///absolute/path/to/file.md
|
|
14
|
+
* - Filenames are generated from titles using slugification
|
|
15
|
+
*/
|
|
16
|
+
import type { DocumentSyncAdapter, ExternalDocument, ExternalDocumentInput, Timestamp } from '@stoneforge/core';
|
|
17
|
+
/**
|
|
18
|
+
* Converts a title string into a filename-safe slug.
|
|
19
|
+
*
|
|
20
|
+
* - Lowercases the string
|
|
21
|
+
* - Replaces non-alphanumeric characters (except hyphens) with hyphens
|
|
22
|
+
* - Collapses consecutive hyphens
|
|
23
|
+
* - Trims leading/trailing hyphens
|
|
24
|
+
* - Falls back to 'untitled' for empty results
|
|
25
|
+
*
|
|
26
|
+
* @param title - The document title to slugify
|
|
27
|
+
* @returns A filename-safe slug string (without extension)
|
|
28
|
+
*/
|
|
29
|
+
export declare function slugify(title: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* DocumentSyncAdapter implementation for local folder-based sync.
|
|
32
|
+
*
|
|
33
|
+
* Maps between Stoneforge ExternalDocument and markdown files with YAML
|
|
34
|
+
* frontmatter on the local filesystem.
|
|
35
|
+
*
|
|
36
|
+
* Usage:
|
|
37
|
+
* ```typescript
|
|
38
|
+
* const adapter = new FolderDocumentAdapter();
|
|
39
|
+
* const doc = await adapter.getPage('/path/to/docs', 'notes/meeting.md');
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare class FolderDocumentAdapter implements DocumentSyncAdapter {
|
|
43
|
+
/**
|
|
44
|
+
* Fetch a single document by its relative file path.
|
|
45
|
+
*
|
|
46
|
+
* @param project - Absolute path to the base directory
|
|
47
|
+
* @param externalId - Relative file path (e.g., 'notes/meeting.md')
|
|
48
|
+
* @returns The document as an ExternalDocument, or null if not found
|
|
49
|
+
*/
|
|
50
|
+
getPage(project: string, externalId: string): Promise<ExternalDocument | null>;
|
|
51
|
+
/**
|
|
52
|
+
* List documents modified since a given timestamp.
|
|
53
|
+
*
|
|
54
|
+
* Reads each file to extract title and content, returning full
|
|
55
|
+
* ExternalDocument objects.
|
|
56
|
+
*
|
|
57
|
+
* @param project - Absolute path to the base directory
|
|
58
|
+
* @param since - ISO 8601 timestamp; only files modified after this are returned
|
|
59
|
+
* @returns Array of ExternalDocument objects for modified files
|
|
60
|
+
*/
|
|
61
|
+
listPagesSince(project: string, since: Timestamp): Promise<ExternalDocument[]>;
|
|
62
|
+
/**
|
|
63
|
+
* Create a new document file in the folder.
|
|
64
|
+
*
|
|
65
|
+
* Generates a filename from the title using slugification, writes
|
|
66
|
+
* the content with frontmatter, and returns the created document.
|
|
67
|
+
*
|
|
68
|
+
* If the page has a `libraryPath`, the file is placed in the
|
|
69
|
+
* corresponding subdirectory. For example, a libraryPath of
|
|
70
|
+
* 'documentation/api' results in the file being created at
|
|
71
|
+
* 'documentation/api/my-doc.md'.
|
|
72
|
+
*
|
|
73
|
+
* @param project - Absolute path to the base directory
|
|
74
|
+
* @param page - Document input with title, content, and optional contentType
|
|
75
|
+
* @returns The created ExternalDocument
|
|
76
|
+
*/
|
|
77
|
+
createPage(project: string, page: ExternalDocumentInput): Promise<ExternalDocument>;
|
|
78
|
+
/**
|
|
79
|
+
* Update an existing document file in the folder.
|
|
80
|
+
*
|
|
81
|
+
* Reads the existing file, merges the updates (preserving existing
|
|
82
|
+
* frontmatter), and writes back. Returns the updated document.
|
|
83
|
+
*
|
|
84
|
+
* @param project - Absolute path to the base directory
|
|
85
|
+
* @param externalId - Relative file path of the existing document
|
|
86
|
+
* @param updates - Partial document input with fields to update
|
|
87
|
+
* @returns The updated ExternalDocument
|
|
88
|
+
*/
|
|
89
|
+
updatePage(project: string, externalId: string, updates: Partial<ExternalDocumentInput>): Promise<ExternalDocument>;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Creates a new FolderDocumentAdapter instance.
|
|
93
|
+
*
|
|
94
|
+
* @returns A configured FolderDocumentAdapter
|
|
95
|
+
*/
|
|
96
|
+
export declare function createFolderDocumentAdapter(): FolderDocumentAdapter;
|
|
97
|
+
//# sourceMappingURL=folder-document-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"folder-document-adapter.d.ts","sourceRoot":"","sources":["../../../../src/external-sync/providers/folder/folder-document-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,SAAS,EACV,MAAM,kBAAkB,CAAC;AAe1B;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQ7C;AAsBD;;;;;;;;;;;GAWG;AACH,qBAAa,qBAAsB,YAAW,mBAAmB;IAC/D;;;;;;OAMG;IACG,OAAO,CACX,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IA8BnC;;;;;;;;;OASG;IACG,cAAc,CAClB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAuB9B;;;;;;;;;;;;;;OAcG;IACG,UAAU,CACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,gBAAgB,CAAC;IAqC5B;;;;;;;;;;OAUG;IACG,UAAU,CACd,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,CAAC,qBAAqB,CAAC,GACtC,OAAO,CAAC,gBAAgB,CAAC;CAsC7B;AA6CD;;;;GAIG;AACH,wBAAgB,2BAA2B,IAAI,qBAAqB,CAEnE"}
|