@interactive-inc/docs-client 1.1.0 → 1.1.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/build/{doc-file-system-BQAOBIO-.d.ts → doc-file-system-DEmPPJPE.d.ts} +10 -142
- package/build/doc-file-system.interface-C5vpYrOL.d.ts +135 -0
- package/build/file-system-json.d.ts +5 -6
- package/build/file-system-json.js +18 -299
- package/build/file-system-mock.d.ts +28 -8
- package/build/file-system-mock.js +47 -435
- package/build/file-system-node.d.ts +16 -0
- package/build/file-system-node.js +544 -0
- package/build/file-system-octokit.d.ts +8 -15
- package/build/file-system-octokit.js +17 -304
- package/build/file-system.d.ts +10 -8
- package/build/file-system.js +157 -171
- package/build/index.d.ts +25 -34
- package/build/index.js +74 -214
- package/build/models.js +4 -75
- package/package.json +5 -4
- package/tmp/docs-studio/files/a.md +9 -0
- package/tmp/docs-studio/pages/delete-document.md +7 -0
- package/tmp/docs-studio/pages/document-editor.md +9 -0
- package/tmp/docs-studio/pages/edit-document-content.md +7 -0
- package/tmp/docs-studio/pages/index.md +14 -0
package/build/file-system.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as fs from 'fs/promises';
|
|
2
|
+
|
|
1
3
|
// lib/modules/path-system/doc-path-system.ts
|
|
2
4
|
var DocPathSystem = class {
|
|
3
5
|
separator = "/";
|
|
@@ -118,9 +120,149 @@ var DocPathSystem = class {
|
|
|
118
120
|
}
|
|
119
121
|
};
|
|
120
122
|
|
|
121
|
-
// lib/modules/file-system/doc-file-system
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
// lib/modules/file-system/doc-file-system.ts
|
|
124
|
+
var DocFileSystem = class {
|
|
125
|
+
reader;
|
|
126
|
+
writer;
|
|
127
|
+
basePath;
|
|
128
|
+
pathSystem;
|
|
129
|
+
constructor(props) {
|
|
130
|
+
this.basePath = props.basePath;
|
|
131
|
+
this.pathSystem = props.pathSystem ?? new DocPathSystem();
|
|
132
|
+
this.reader = props.reader;
|
|
133
|
+
this.writer = props.writer;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Read file content at the specified path
|
|
137
|
+
*/
|
|
138
|
+
async readFile(relativePath) {
|
|
139
|
+
return this.reader.readFile(relativePath);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Write content to file at the specified path (creates directory if needed)
|
|
143
|
+
*/
|
|
144
|
+
async writeFile(relativePath, content) {
|
|
145
|
+
return this.writer.writeFile(relativePath, content);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Delete file at the specified path
|
|
149
|
+
*/
|
|
150
|
+
async deleteFile(relativePath) {
|
|
151
|
+
return this.writer.deleteFile(relativePath);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Get file name from path
|
|
155
|
+
*/
|
|
156
|
+
readFileName(relativePath) {
|
|
157
|
+
return this.reader.readFileName(relativePath);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Get file extension from path
|
|
161
|
+
*/
|
|
162
|
+
readFileExtension(relativePath) {
|
|
163
|
+
return this.reader.readFileExtension(relativePath);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Get directory path where the file exists
|
|
167
|
+
*/
|
|
168
|
+
readFileDirectory(relativePath) {
|
|
169
|
+
return this.reader.readFileDirectory(relativePath);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Get list of entries in directory
|
|
173
|
+
*/
|
|
174
|
+
async readDirectoryFileNames(relativePath = "") {
|
|
175
|
+
return this.reader.readDirectoryFileNames(relativePath);
|
|
176
|
+
}
|
|
177
|
+
async readDirectoryFilePaths(relativePath) {
|
|
178
|
+
return this.reader.readDirectoryFilePaths(relativePath);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Check if path is a directory
|
|
182
|
+
*/
|
|
183
|
+
async isDirectory(relativePath) {
|
|
184
|
+
return this.reader.isDirectory(relativePath);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Check if path is a file
|
|
188
|
+
*/
|
|
189
|
+
async isFile(relativePath) {
|
|
190
|
+
return this.reader.isFile(relativePath);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Check if file or directory exists
|
|
194
|
+
*/
|
|
195
|
+
async exists(relativePath) {
|
|
196
|
+
return this.reader.exists(relativePath);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Check if directory exists
|
|
200
|
+
*/
|
|
201
|
+
async directoryExists(relativePath) {
|
|
202
|
+
return this.reader.directoryExists(relativePath);
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Check if file exists
|
|
206
|
+
*/
|
|
207
|
+
async fileExists(relativePath) {
|
|
208
|
+
return this.reader.fileExists(relativePath);
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Get base path
|
|
212
|
+
*/
|
|
213
|
+
getBasePath() {
|
|
214
|
+
return this.reader.getBasePath();
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Convert relative path to absolute path
|
|
218
|
+
*/
|
|
219
|
+
resolve(relativePath) {
|
|
220
|
+
return this.reader.resolve(relativePath);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Create directory
|
|
224
|
+
*/
|
|
225
|
+
async createEmptyDirectory(relativePath) {
|
|
226
|
+
return this.writer.createEmptyDirectory(relativePath);
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Get file size in bytes
|
|
230
|
+
*/
|
|
231
|
+
async getFileSize(relativePath) {
|
|
232
|
+
return this.reader.getFileSize(relativePath);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Create directory if it doesn't exist
|
|
236
|
+
*/
|
|
237
|
+
async createDirectory(relativePath) {
|
|
238
|
+
return this.writer.createDirectory(relativePath);
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Copy file
|
|
242
|
+
*/
|
|
243
|
+
async copyFile(sourcePath, destinationPath) {
|
|
244
|
+
return this.writer.copyFile(sourcePath, destinationPath);
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Move file
|
|
248
|
+
*/
|
|
249
|
+
async moveFile(sourcePath, destinationPath) {
|
|
250
|
+
return this.writer.moveFile(sourcePath, destinationPath);
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Get file last modified time
|
|
254
|
+
*/
|
|
255
|
+
async getFileUpdatedTime(relativePath) {
|
|
256
|
+
return this.reader.getFileUpdatedTime(relativePath);
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Get file creation time
|
|
260
|
+
*/
|
|
261
|
+
async getFileCreatedTime(relativePath) {
|
|
262
|
+
return this.reader.getFileCreatedTime(relativePath);
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
var DocFileSystemNodeRead = class {
|
|
124
266
|
basePath;
|
|
125
267
|
pathSystem;
|
|
126
268
|
constructor(props) {
|
|
@@ -257,7 +399,7 @@ var DocFileSystemRead = class {
|
|
|
257
399
|
/**
|
|
258
400
|
* Get file last modified time
|
|
259
401
|
*/
|
|
260
|
-
async
|
|
402
|
+
async getFileUpdatedTime(relativePath) {
|
|
261
403
|
try {
|
|
262
404
|
const fullPath = this.pathSystem.join(this.basePath, relativePath);
|
|
263
405
|
const stats = await fs.stat(fullPath);
|
|
@@ -279,10 +421,7 @@ var DocFileSystemRead = class {
|
|
|
279
421
|
}
|
|
280
422
|
}
|
|
281
423
|
};
|
|
282
|
-
|
|
283
|
-
// lib/modules/file-system/doc-file-system-write.ts
|
|
284
|
-
import * as fs2 from "fs/promises";
|
|
285
|
-
var DocFileSystemWrite = class {
|
|
424
|
+
var DocFileSystemNodeWrite = class {
|
|
286
425
|
basePath;
|
|
287
426
|
pathSystem;
|
|
288
427
|
reader;
|
|
@@ -298,8 +437,8 @@ var DocFileSystemWrite = class {
|
|
|
298
437
|
try {
|
|
299
438
|
const fullPath = this.pathSystem.join(this.basePath, relativePath);
|
|
300
439
|
const dirPath = this.pathSystem.dirname(fullPath);
|
|
301
|
-
await
|
|
302
|
-
await
|
|
440
|
+
await fs.mkdir(dirPath, { recursive: true });
|
|
441
|
+
await fs.writeFile(fullPath, content, "utf-8");
|
|
303
442
|
return null;
|
|
304
443
|
} catch (error) {
|
|
305
444
|
return error instanceof Error ? error : new Error(`Failed to write file at ${relativePath}`);
|
|
@@ -311,7 +450,7 @@ var DocFileSystemWrite = class {
|
|
|
311
450
|
async deleteFile(relativePath) {
|
|
312
451
|
try {
|
|
313
452
|
const fullPath = this.pathSystem.join(this.basePath, relativePath);
|
|
314
|
-
await
|
|
453
|
+
await fs.unlink(fullPath);
|
|
315
454
|
return null;
|
|
316
455
|
} catch (error) {
|
|
317
456
|
return new Error(`Failed to delete file at ${relativePath}: ${error}`);
|
|
@@ -320,10 +459,10 @@ var DocFileSystemWrite = class {
|
|
|
320
459
|
/**
|
|
321
460
|
* Create directory
|
|
322
461
|
*/
|
|
323
|
-
async
|
|
462
|
+
async createEmptyDirectory(relativePath) {
|
|
324
463
|
try {
|
|
325
464
|
const fullPath = this.pathSystem.join(this.basePath, relativePath);
|
|
326
|
-
await
|
|
465
|
+
await fs.mkdir(fullPath, { recursive: true });
|
|
327
466
|
return null;
|
|
328
467
|
} catch (error) {
|
|
329
468
|
return error instanceof Error ? error : new Error(`Failed to create directory at ${relativePath}`);
|
|
@@ -332,7 +471,7 @@ var DocFileSystemWrite = class {
|
|
|
332
471
|
/**
|
|
333
472
|
* Create directory if it doesn't exist
|
|
334
473
|
*/
|
|
335
|
-
async
|
|
474
|
+
async createDirectory(relativePath) {
|
|
336
475
|
try {
|
|
337
476
|
if (this.reader) {
|
|
338
477
|
const exists = await this.reader.exists(relativePath);
|
|
@@ -340,7 +479,7 @@ var DocFileSystemWrite = class {
|
|
|
340
479
|
return null;
|
|
341
480
|
}
|
|
342
481
|
}
|
|
343
|
-
const result = await this.
|
|
482
|
+
const result = await this.createEmptyDirectory(relativePath);
|
|
344
483
|
if (result instanceof Error) {
|
|
345
484
|
return result;
|
|
346
485
|
}
|
|
@@ -356,7 +495,7 @@ var DocFileSystemWrite = class {
|
|
|
356
495
|
try {
|
|
357
496
|
const sourceFullPath = this.pathSystem.join(this.basePath, sourcePath);
|
|
358
497
|
const destFullPath = this.pathSystem.join(this.basePath, destinationPath);
|
|
359
|
-
await
|
|
498
|
+
await fs.copyFile(sourceFullPath, destFullPath);
|
|
360
499
|
return null;
|
|
361
500
|
} catch (error) {
|
|
362
501
|
return error instanceof Error ? error : new Error(
|
|
@@ -371,7 +510,7 @@ var DocFileSystemWrite = class {
|
|
|
371
510
|
try {
|
|
372
511
|
const sourceFullPath = this.pathSystem.join(this.basePath, sourcePath);
|
|
373
512
|
const destFullPath = this.pathSystem.join(this.basePath, destinationPath);
|
|
374
|
-
await
|
|
513
|
+
await fs.rename(sourceFullPath, destFullPath);
|
|
375
514
|
return null;
|
|
376
515
|
} catch (error) {
|
|
377
516
|
return error instanceof Error ? error : new Error(
|
|
@@ -381,157 +520,4 @@ var DocFileSystemWrite = class {
|
|
|
381
520
|
}
|
|
382
521
|
};
|
|
383
522
|
|
|
384
|
-
|
|
385
|
-
var DocFileSystem = class {
|
|
386
|
-
reader;
|
|
387
|
-
writer;
|
|
388
|
-
basePath;
|
|
389
|
-
pathSystem;
|
|
390
|
-
constructor(props) {
|
|
391
|
-
this.basePath = props.basePath;
|
|
392
|
-
this.pathSystem = props.pathSystem ?? new DocPathSystem();
|
|
393
|
-
this.reader = props.reader ?? new DocFileSystemRead({
|
|
394
|
-
basePath: this.basePath,
|
|
395
|
-
pathSystem: this.pathSystem
|
|
396
|
-
});
|
|
397
|
-
this.writer = props.writer ?? new DocFileSystemWrite({
|
|
398
|
-
basePath: this.basePath,
|
|
399
|
-
pathSystem: this.pathSystem,
|
|
400
|
-
reader: this.reader
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
/**
|
|
404
|
-
* Read file content at the specified path
|
|
405
|
-
*/
|
|
406
|
-
async readFile(relativePath) {
|
|
407
|
-
return this.reader.readFile(relativePath);
|
|
408
|
-
}
|
|
409
|
-
/**
|
|
410
|
-
* Write content to file at the specified path (creates directory if needed)
|
|
411
|
-
*/
|
|
412
|
-
async writeFile(relativePath, content) {
|
|
413
|
-
return this.writer.writeFile(relativePath, content);
|
|
414
|
-
}
|
|
415
|
-
/**
|
|
416
|
-
* Delete file at the specified path
|
|
417
|
-
*/
|
|
418
|
-
async deleteFile(relativePath) {
|
|
419
|
-
return this.writer.deleteFile(relativePath);
|
|
420
|
-
}
|
|
421
|
-
/**
|
|
422
|
-
* Get file name from path
|
|
423
|
-
*/
|
|
424
|
-
readFileName(relativePath) {
|
|
425
|
-
return this.reader.readFileName(relativePath);
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* Get file extension from path
|
|
429
|
-
*/
|
|
430
|
-
readFileExtension(relativePath) {
|
|
431
|
-
return this.reader.readFileExtension(relativePath);
|
|
432
|
-
}
|
|
433
|
-
/**
|
|
434
|
-
* Get directory path where the file exists
|
|
435
|
-
*/
|
|
436
|
-
readFileDirectory(relativePath) {
|
|
437
|
-
return this.reader.readFileDirectory(relativePath);
|
|
438
|
-
}
|
|
439
|
-
/**
|
|
440
|
-
* Get list of entries in directory
|
|
441
|
-
*/
|
|
442
|
-
async readDirectoryFileNames(relativePath = "") {
|
|
443
|
-
return this.reader.readDirectoryFileNames(relativePath);
|
|
444
|
-
}
|
|
445
|
-
async readDirectoryFilePaths(relativePath) {
|
|
446
|
-
return this.reader.readDirectoryFilePaths(relativePath);
|
|
447
|
-
}
|
|
448
|
-
/**
|
|
449
|
-
* Check if path is a directory
|
|
450
|
-
*/
|
|
451
|
-
async isDirectory(relativePath) {
|
|
452
|
-
return this.reader.isDirectory(relativePath);
|
|
453
|
-
}
|
|
454
|
-
/**
|
|
455
|
-
* Check if path is a file
|
|
456
|
-
*/
|
|
457
|
-
async isFile(relativePath) {
|
|
458
|
-
return this.reader.isFile(relativePath);
|
|
459
|
-
}
|
|
460
|
-
/**
|
|
461
|
-
* Check if file or directory exists
|
|
462
|
-
*/
|
|
463
|
-
async exists(relativePath) {
|
|
464
|
-
return this.reader.exists(relativePath);
|
|
465
|
-
}
|
|
466
|
-
/**
|
|
467
|
-
* Check if directory exists
|
|
468
|
-
*/
|
|
469
|
-
async directoryExists(relativePath) {
|
|
470
|
-
return this.reader.directoryExists(relativePath);
|
|
471
|
-
}
|
|
472
|
-
/**
|
|
473
|
-
* Check if file exists
|
|
474
|
-
*/
|
|
475
|
-
async fileExists(relativePath) {
|
|
476
|
-
return this.reader.fileExists(relativePath);
|
|
477
|
-
}
|
|
478
|
-
/**
|
|
479
|
-
* Get base path
|
|
480
|
-
*/
|
|
481
|
-
getBasePath() {
|
|
482
|
-
return this.reader.getBasePath();
|
|
483
|
-
}
|
|
484
|
-
/**
|
|
485
|
-
* Convert relative path to absolute path
|
|
486
|
-
*/
|
|
487
|
-
resolve(relativePath) {
|
|
488
|
-
return this.reader.resolve(relativePath);
|
|
489
|
-
}
|
|
490
|
-
/**
|
|
491
|
-
* Create directory
|
|
492
|
-
*/
|
|
493
|
-
async createDirectory(relativePath) {
|
|
494
|
-
return this.writer.createDirectory(relativePath);
|
|
495
|
-
}
|
|
496
|
-
/**
|
|
497
|
-
* Get file size in bytes
|
|
498
|
-
*/
|
|
499
|
-
async getFileSize(relativePath) {
|
|
500
|
-
return this.reader.getFileSize(relativePath);
|
|
501
|
-
}
|
|
502
|
-
/**
|
|
503
|
-
* Create directory if it doesn't exist
|
|
504
|
-
*/
|
|
505
|
-
async ensureDirectoryExists(relativePath) {
|
|
506
|
-
return this.writer.ensureDirectoryExists(relativePath);
|
|
507
|
-
}
|
|
508
|
-
/**
|
|
509
|
-
* Copy file
|
|
510
|
-
*/
|
|
511
|
-
async copyFile(sourcePath, destinationPath) {
|
|
512
|
-
return this.writer.copyFile(sourcePath, destinationPath);
|
|
513
|
-
}
|
|
514
|
-
/**
|
|
515
|
-
* Move file
|
|
516
|
-
*/
|
|
517
|
-
async moveFile(sourcePath, destinationPath) {
|
|
518
|
-
return this.writer.moveFile(sourcePath, destinationPath);
|
|
519
|
-
}
|
|
520
|
-
/**
|
|
521
|
-
* Get file last modified time
|
|
522
|
-
*/
|
|
523
|
-
async getFileModifiedTime(relativePath) {
|
|
524
|
-
return this.reader.getFileModifiedTime(relativePath);
|
|
525
|
-
}
|
|
526
|
-
/**
|
|
527
|
-
* Get file creation time
|
|
528
|
-
*/
|
|
529
|
-
async getFileCreatedTime(relativePath) {
|
|
530
|
-
return this.reader.getFileCreatedTime(relativePath);
|
|
531
|
-
}
|
|
532
|
-
};
|
|
533
|
-
export {
|
|
534
|
-
DocFileSystem,
|
|
535
|
-
DocFileSystemRead,
|
|
536
|
-
DocFileSystemWrite
|
|
537
|
-
};
|
|
523
|
+
export { DocFileSystem, DocFileSystemNodeRead as DocFileSystemRead, DocFileSystemNodeWrite as DocFileSystemWrite };
|
package/build/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { D as
|
|
1
|
+
import { D as DocFileSystemInterface, a as DocPathSystem } from './doc-file-system.interface-C5vpYrOL.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { zDocFileMd, zDocFileUnknown, zDocClientConfig, zDocFilePath, zDocFileIndexSchemaField, zDocSchemaFieldText, zDocSchemaFieldNumber, zDocSchemaFieldBoolean, zDocSchemaFieldRelation, zDocSchemaFieldSelectText, zDocSchemaFieldSelectNumber, zDocSchemaFieldMultiText, zDocSchemaFieldMultiNumber, zDocSchemaFieldMultiRelation, zDocSchemaFieldMultiSelectText, zDocSchemaFieldMultiSelectNumber, zDocFileIndex, zDocRelation, zDocRelationFile, zDocMetaFieldRelation, zDocMetaFieldMultiRelation, zDocMetaFieldText, zDocMetaFieldNumber, zDocMetaFieldBoolean, zDocMetaFieldMultiText, zDocMetaFieldMultiNumber, zDocRelationField, zDocMetaField, zDocMetaFieldSelectText, zDocMetaFieldSelectNumber, zDocMetaFieldMultiSelectText, zDocMetaFieldMultiSelectNumber, zDocMetaFieldTypeText, zDocMetaFieldTypeNumber, zDocMetaFieldTypeBoolean, zDocMetaFieldTypeSelectText, zDocMetaFieldTypeSelectNumber, zDocMetaFieldTypeRelation, zDocMetaFieldType } from './models.js';
|
|
4
|
-
export { zDocCustomSchema, zDocCustomSchemaField, zDocCustomSchemaFieldBoolean, zDocCustomSchemaFieldMultiNumber, zDocCustomSchemaFieldMultiRelation, zDocCustomSchemaFieldMultiSelectNumber, zDocCustomSchemaFieldMultiSelectText, zDocCustomSchemaFieldMultiText, zDocCustomSchemaFieldNumber, zDocCustomSchemaFieldRelation, zDocCustomSchemaFieldSelectNumber, zDocCustomSchemaFieldSelectText, zDocCustomSchemaFieldText, zDocFile, zDocFileDirectory, zDocFileIndexContent, zDocFileIndexMeta, zDocFileIndexMetaInput, zDocFileIndexSchema, zDocFileIndexSchemaInput, zDocFileMdContent, zDocFileMdContentInput, zDocFileMdInput, zDocFileMdMeta, zDocFileMdMetaInput, zDocMetaFieldTypeMultiNumber, zDocMetaFieldTypeMultiRelation, zDocMetaFieldTypeMultiSelectNumber, zDocMetaFieldTypeMultiSelectText, zDocMetaFieldTypeMultiText, zDocTreeDirectoryNode, zDocTreeFileNode, zDocTreeNode } from './models.js';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* Single boolean type schema field
|
|
@@ -358,19 +357,9 @@ declare class DocFileIndexMetaValue<T extends DocCustomSchema> {
|
|
|
358
357
|
* Generate empty FrontMatter
|
|
359
358
|
*/
|
|
360
359
|
static empty<T extends DocCustomSchema>(customSchema: T, config: DocClientConfig): DocFileIndexMetaValue<T>;
|
|
361
|
-
|
|
362
|
-
* Extract icon
|
|
363
|
-
*/
|
|
360
|
+
static emptySchema<T extends DocCustomSchema>(customSchema: T): DocFileIndexSchema<keyof T>;
|
|
364
361
|
private static extractIcon;
|
|
365
|
-
/**
|
|
366
|
-
* Extract schema part
|
|
367
|
-
*/
|
|
368
362
|
private static extractSchema;
|
|
369
|
-
/**
|
|
370
|
-
* Normalize entire schema
|
|
371
|
-
*/
|
|
372
|
-
private static normalizeSchema;
|
|
373
|
-
static emptySchema<T extends DocCustomSchema>(customSchema: T): DocFileIndexSchema<keyof T>;
|
|
374
363
|
}
|
|
375
364
|
|
|
376
365
|
/**
|
|
@@ -489,14 +478,11 @@ declare class DocRelationFileValue {
|
|
|
489
478
|
* Convert to JSON format
|
|
490
479
|
*/
|
|
491
480
|
toJson(): DocRelationFile;
|
|
492
|
-
/**
|
|
493
|
-
* Extract file name from file path (without extension)
|
|
494
|
-
*/
|
|
495
|
-
private static extractFileName;
|
|
496
481
|
/**
|
|
497
482
|
* Create from file path and title
|
|
498
483
|
*/
|
|
499
484
|
static from(filePath: string, title: string | null): DocRelationFileValue;
|
|
485
|
+
private static extractFileName;
|
|
500
486
|
}
|
|
501
487
|
|
|
502
488
|
/**
|
|
@@ -533,7 +519,7 @@ declare class DocRelationValue {
|
|
|
533
519
|
|
|
534
520
|
type Props$8 = {
|
|
535
521
|
filePath: string;
|
|
536
|
-
fileSystem:
|
|
522
|
+
fileSystem: DocFileSystemInterface;
|
|
537
523
|
pathSystem: DocPathSystem;
|
|
538
524
|
};
|
|
539
525
|
/**
|
|
@@ -543,7 +529,7 @@ declare class DocFileRelationReference {
|
|
|
543
529
|
private readonly props;
|
|
544
530
|
private readonly pathSystem;
|
|
545
531
|
constructor(props: Props$8);
|
|
546
|
-
get fileSystem():
|
|
532
|
+
get fileSystem(): DocFileSystemInterface;
|
|
547
533
|
get basePath(): string;
|
|
548
534
|
/**
|
|
549
535
|
* Relation path
|
|
@@ -583,7 +569,7 @@ declare class DocFileRelationReference {
|
|
|
583
569
|
type Props$7<T extends DocCustomSchema> = {
|
|
584
570
|
customSchema: T;
|
|
585
571
|
path: string;
|
|
586
|
-
fileSystem:
|
|
572
|
+
fileSystem: DocFileSystemInterface;
|
|
587
573
|
pathSystem: DocPathSystem;
|
|
588
574
|
config: DocClientConfig;
|
|
589
575
|
};
|
|
@@ -595,7 +581,7 @@ declare class DocFileIndexReference<T extends DocCustomSchema> {
|
|
|
595
581
|
private readonly pathSystem;
|
|
596
582
|
private readonly customSchema;
|
|
597
583
|
constructor(props: Props$7<T>);
|
|
598
|
-
get fileSystem():
|
|
584
|
+
get fileSystem(): DocFileSystemInterface;
|
|
599
585
|
get basePath(): string;
|
|
600
586
|
get filePath(): string;
|
|
601
587
|
get fileFullPath(): string;
|
|
@@ -678,7 +664,6 @@ declare class DocFileMdMetaValue<T extends DocCustomSchema> {
|
|
|
678
664
|
hasKey(key: keyof T): boolean;
|
|
679
665
|
toJson(): SchemaToValueType<T>;
|
|
680
666
|
toYaml(): string;
|
|
681
|
-
private validateValue;
|
|
682
667
|
private getValueField;
|
|
683
668
|
/**
|
|
684
669
|
* Generate from Markdown text
|
|
@@ -819,7 +804,7 @@ type DocFileDirectoryEntity<T extends DocCustomSchema> = DocFileMdEntity<T> | Do
|
|
|
819
804
|
|
|
820
805
|
type Props$6<T extends DocCustomSchema> = {
|
|
821
806
|
path: string;
|
|
822
|
-
fileSystem:
|
|
807
|
+
fileSystem: DocFileSystemInterface;
|
|
823
808
|
pathSystem: DocPathSystem;
|
|
824
809
|
customSchema: T;
|
|
825
810
|
config: DocClientConfig;
|
|
@@ -832,7 +817,7 @@ declare class DocFileUnknownReference<T extends DocCustomSchema> {
|
|
|
832
817
|
private readonly pathSystem;
|
|
833
818
|
private readonly customSchema;
|
|
834
819
|
constructor(props: Props$6<T>);
|
|
835
|
-
get fileSystem():
|
|
820
|
+
get fileSystem(): DocFileSystemInterface;
|
|
836
821
|
get basePath(): string;
|
|
837
822
|
get path(): string;
|
|
838
823
|
get directoryPath(): string;
|
|
@@ -904,7 +889,7 @@ type Props$5<T extends DocCustomSchema> = {
|
|
|
904
889
|
path: string;
|
|
905
890
|
indexFileName: string;
|
|
906
891
|
archiveDirectoryName: string;
|
|
907
|
-
fileSystem:
|
|
892
|
+
fileSystem: DocFileSystemInterface;
|
|
908
893
|
pathSystem: DocPathSystem;
|
|
909
894
|
config: DocClientConfig;
|
|
910
895
|
};
|
|
@@ -916,7 +901,7 @@ declare class DocDirectoryReference<T extends DocCustomSchema> {
|
|
|
916
901
|
private readonly pathSystem;
|
|
917
902
|
private readonly customSchema;
|
|
918
903
|
constructor(props: Props$5<T>);
|
|
919
|
-
get fileSystem():
|
|
904
|
+
get fileSystem(): DocFileSystemInterface;
|
|
920
905
|
get basePath(): string;
|
|
921
906
|
get config(): DocClientConfig;
|
|
922
907
|
get path(): string;
|
|
@@ -973,7 +958,7 @@ declare class DocDirectoryReference<T extends DocCustomSchema> {
|
|
|
973
958
|
|
|
974
959
|
type Props$4<T extends DocCustomSchema> = {
|
|
975
960
|
path: string;
|
|
976
|
-
fileSystem:
|
|
961
|
+
fileSystem: DocFileSystemInterface;
|
|
977
962
|
pathSystem: DocPathSystem;
|
|
978
963
|
customSchema: T;
|
|
979
964
|
config: DocClientConfig;
|
|
@@ -986,7 +971,7 @@ declare class DocFileMdReference<T extends DocCustomSchema> {
|
|
|
986
971
|
private readonly pathSystem;
|
|
987
972
|
private readonly customSchema;
|
|
988
973
|
constructor(props: Props$4<T>);
|
|
989
|
-
get fileSystem():
|
|
974
|
+
get fileSystem(): DocFileSystemInterface;
|
|
990
975
|
get basePath(): string;
|
|
991
976
|
get path(): string;
|
|
992
977
|
get fullPath(): string;
|
|
@@ -1482,7 +1467,7 @@ declare class DocTreeDirectoryNodeValue {
|
|
|
1482
1467
|
}
|
|
1483
1468
|
|
|
1484
1469
|
type Props$1 = {
|
|
1485
|
-
fileSystem:
|
|
1470
|
+
fileSystem: DocFileSystemInterface;
|
|
1486
1471
|
pathSystem: DocPathSystem;
|
|
1487
1472
|
indexFileName: string;
|
|
1488
1473
|
archiveDirectoryName: string;
|
|
@@ -1570,7 +1555,7 @@ declare class DocMarkdownSystem {
|
|
|
1570
1555
|
}
|
|
1571
1556
|
|
|
1572
1557
|
type Props = {
|
|
1573
|
-
fileSystem:
|
|
1558
|
+
fileSystem: DocFileSystemInterface;
|
|
1574
1559
|
pathSystem?: DocPathSystem;
|
|
1575
1560
|
markdownSystem?: DocMarkdownSystem;
|
|
1576
1561
|
fileTreeSystem?: DocFileTreeSystem;
|
|
@@ -1580,7 +1565,7 @@ type Props = {
|
|
|
1580
1565
|
config?: DocClientConfig;
|
|
1581
1566
|
};
|
|
1582
1567
|
declare class DocClient {
|
|
1583
|
-
readonly fileSystem:
|
|
1568
|
+
readonly fileSystem: DocFileSystemInterface;
|
|
1584
1569
|
readonly pathSystem: DocPathSystem;
|
|
1585
1570
|
readonly markdownSystem: DocMarkdownSystem;
|
|
1586
1571
|
readonly fileTreeSystem: DocFileTreeSystem;
|
|
@@ -1671,13 +1656,19 @@ declare const docCustomSchemaField: {
|
|
|
1671
1656
|
type: "boolean";
|
|
1672
1657
|
required: boolean;
|
|
1673
1658
|
};
|
|
1674
|
-
readonly relation: (required: boolean) => {
|
|
1659
|
+
readonly relation: (required: boolean, path: string) => {
|
|
1675
1660
|
type: "relation";
|
|
1676
1661
|
required: boolean;
|
|
1662
|
+
title: null;
|
|
1663
|
+
description: null;
|
|
1664
|
+
path: string;
|
|
1677
1665
|
};
|
|
1678
|
-
readonly multiRelation: (required: boolean) => {
|
|
1666
|
+
readonly multiRelation: (required: boolean, path: string) => {
|
|
1679
1667
|
type: "multi-relation";
|
|
1680
1668
|
required: boolean;
|
|
1669
|
+
title: null;
|
|
1670
|
+
description: null;
|
|
1671
|
+
path: string;
|
|
1681
1672
|
};
|
|
1682
1673
|
readonly selectText: (required: boolean) => {
|
|
1683
1674
|
type: "select-text";
|
|
@@ -1898,4 +1889,4 @@ declare class DocRelationFieldValue {
|
|
|
1898
1889
|
}): DocRelationFieldValue;
|
|
1899
1890
|
}
|
|
1900
1891
|
|
|
1901
|
-
export { type BaseFieldValueType, type DetectFileType, DocClient, type DocClientConfig, type DocCustomSchema, type DocCustomSchemaField, type DocCustomSchemaFieldBoolean, type DocCustomSchemaFieldMultiNumber, type DocCustomSchemaFieldMultiRelation, type DocCustomSchemaFieldMultiSelectNumber, type DocCustomSchemaFieldMultiSelectText, type DocCustomSchemaFieldMultiText, type DocCustomSchemaFieldNumber, type DocCustomSchemaFieldRelation, type DocCustomSchemaFieldSelectNumber, type DocCustomSchemaFieldSelectText, type DocCustomSchemaFieldText, DocCustomSchemaFieldValue, type DocDirectory, type DocDirectoryFile, DocDirectoryPathValue, DocDirectoryReference, type DocFieldTypeLiteral, type DocFile, type DocFileAny, type DocFileEntity, type DocFileIndex, type DocFileIndexAny, type DocFileIndexContent, DocFileIndexContentValue, DocFileIndexEntity, type DocFileIndexMeta, DocFileIndexMetaValue, DocFileIndexReference, type DocFileIndexSchema, type DocFileIndexSchemaField, DocFileIndexSchemaValue, type DocFileMd, type DocFileMdAny, type DocFileMdContent, DocFileMdContentValue, DocFileMdEntity, type DocFileMdMeta, type DocFileMdMetaAny, DocFileMdMetaValue, DocFileMdReference, type DocFilePath, DocFilePathValue, DocFileRelationReference, DocFileTreeSystem, type DocFileUnknown, DocFileUnknownEntity, DocFileUnknownReference, DocMarkdownSystem, type DocMetaField, type DocMetaFieldBoolean, type DocMetaFieldMultiNumber, type DocMetaFieldMultiRelation, type DocMetaFieldMultiSelectNumber, type DocMetaFieldMultiSelectText, type DocMetaFieldMultiText, type DocMetaFieldNumber, type DocMetaFieldRelation, type DocMetaFieldSelectNumber, type DocMetaFieldSelectText, type DocMetaFieldText, type DocMetaFieldType, type DocMetaFieldTypeBoolean, type DocMetaFieldTypeNumber, type DocMetaFieldTypeRelation, type DocMetaFieldTypeSelectNumber, type DocMetaFieldTypeSelectText, type DocMetaFieldTypeText, DocPathSystem, DocPathSystemMock, type DocRelation, type DocRelationField, DocRelationFieldValue, type DocRelationFile, DocRelationFileValue, DocRelationValue, type DocSchemaFieldBoolean, type DocSchemaFieldMultiNumber, type DocSchemaFieldMultiRelation, type DocSchemaFieldMultiSelectNumber, type DocSchemaFieldMultiSelectText, type DocSchemaFieldMultiText, type DocSchemaFieldNumber, type DocSchemaFieldRelation, type DocSchemaFieldSelectNumber, type DocSchemaFieldSelectText, type DocSchemaFieldText, type DocSchemaRelationFieldUnion, type DocTreeDirectoryNode, DocTreeDirectoryNodeValue, type DocTreeFileNode, DocTreeFileNodeValue, type DocTreeNode, type DocTreeNodeValue, type Equals, type ExtractFieldType, type ExtractRequired, type FieldValueType, type GetIndexFieldType, type GetValueType, type InferDocFileMd, type InferReference, type MultiRelationKeys, type OptionalKeys, type RecordKey, type RelationKeys, type RequiredKeys, type SchemaToValueType, type UpdateFunction, assertType, defaultTestConfig, defineSchema, docCustomSchemaField, expectType
|
|
1892
|
+
export { type BaseFieldValueType, type DetectFileType, DocClient, type DocClientConfig, type DocCustomSchema, type DocCustomSchemaField, type DocCustomSchemaFieldBoolean, type DocCustomSchemaFieldMultiNumber, type DocCustomSchemaFieldMultiRelation, type DocCustomSchemaFieldMultiSelectNumber, type DocCustomSchemaFieldMultiSelectText, type DocCustomSchemaFieldMultiText, type DocCustomSchemaFieldNumber, type DocCustomSchemaFieldRelation, type DocCustomSchemaFieldSelectNumber, type DocCustomSchemaFieldSelectText, type DocCustomSchemaFieldText, DocCustomSchemaFieldValue, type DocDirectory, type DocDirectoryFile, DocDirectoryPathValue, DocDirectoryReference, type DocFieldTypeLiteral, type DocFile, type DocFileAny, type DocFileEntity, type DocFileIndex, type DocFileIndexAny, type DocFileIndexContent, DocFileIndexContentValue, DocFileIndexEntity, type DocFileIndexMeta, DocFileIndexMetaValue, DocFileIndexReference, type DocFileIndexSchema, type DocFileIndexSchemaField, DocFileIndexSchemaValue, type DocFileMd, type DocFileMdAny, type DocFileMdContent, DocFileMdContentValue, DocFileMdEntity, type DocFileMdMeta, type DocFileMdMetaAny, DocFileMdMetaValue, DocFileMdReference, type DocFilePath, DocFilePathValue, DocFileRelationReference, DocFileTreeSystem, type DocFileUnknown, DocFileUnknownEntity, DocFileUnknownReference, DocMarkdownSystem, type DocMetaField, type DocMetaFieldBoolean, type DocMetaFieldMultiNumber, type DocMetaFieldMultiRelation, type DocMetaFieldMultiSelectNumber, type DocMetaFieldMultiSelectText, type DocMetaFieldMultiText, type DocMetaFieldNumber, type DocMetaFieldRelation, type DocMetaFieldSelectNumber, type DocMetaFieldSelectText, type DocMetaFieldText, type DocMetaFieldType, type DocMetaFieldTypeBoolean, type DocMetaFieldTypeNumber, type DocMetaFieldTypeRelation, type DocMetaFieldTypeSelectNumber, type DocMetaFieldTypeSelectText, type DocMetaFieldTypeText, DocPathSystem, DocPathSystemMock, type DocRelation, type DocRelationField, DocRelationFieldValue, type DocRelationFile, DocRelationFileValue, DocRelationValue, type DocSchemaFieldBoolean, type DocSchemaFieldMultiNumber, type DocSchemaFieldMultiRelation, type DocSchemaFieldMultiSelectNumber, type DocSchemaFieldMultiSelectText, type DocSchemaFieldMultiText, type DocSchemaFieldNumber, type DocSchemaFieldRelation, type DocSchemaFieldSelectNumber, type DocSchemaFieldSelectText, type DocSchemaFieldText, type DocSchemaRelationFieldUnion, type DocTreeDirectoryNode, DocTreeDirectoryNodeValue, type DocTreeFileNode, DocTreeFileNodeValue, type DocTreeNode, type DocTreeNodeValue, type Equals, type ExtractFieldType, type ExtractRequired, type FieldValueType, type GetIndexFieldType, type GetValueType, type InferDocFileMd, type InferReference, type MultiRelationKeys, type OptionalKeys, type RecordKey, type RelationKeys, type RequiredKeys, type SchemaToValueType, type UpdateFunction, assertType, defaultTestConfig, defineSchema, docCustomSchemaField, expectType };
|