@interactive-inc/docs-client 0.0.11 → 0.0.13

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/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { zDocClientConfig, zDocCustomSchemaField, zDocFilePath, zDocMetaFieldRelation, zDocMetaFieldMultiRelation, zDocMetaFieldText, zDocMetaFieldNumber, zDocMetaFieldBoolean, zDocMetaFieldMultiText, zDocMetaFieldMultiNumber, zDocMetaFieldMultiBoolean, zDocFileUnknown, zDocFileIndexSchemaField, zDocSchemaFieldText, zDocSchemaFieldNumber, zDocSchemaFieldBoolean, zDocSchemaFieldRelation, zDocSchemaFieldSelectText, zDocSchemaFieldSelectNumber, zDocSchemaFieldMultiText, zDocSchemaFieldMultiNumber, zDocSchemaFieldMultiRelation, zDocSchemaFieldMultiSelectText, zDocSchemaFieldMultiSelectNumber, zDocRelation, zDocRelationFile, zDocMetaField, zDocMetaFieldSelectText, zDocMetaFieldSelectNumber, zDocMetaFieldMultiSelectText, zDocMetaFieldMultiSelectNumber, zDocMetaFieldTypeText, zDocMetaFieldTypeNumber, zDocMetaFieldTypeBoolean, zDocMetaFieldTypeSelectText, zDocMetaFieldTypeSelectNumber, zDocMetaFieldTypeRelation, zDocMetaFieldType, zDocCustomSchemaFieldText, zDocCustomSchemaFieldNumber, zDocCustomSchemaFieldBoolean, zDocCustomSchemaFieldRelation, zDocCustomSchemaFieldSelectText, zDocCustomSchemaFieldSelectNumber, zDocCustomSchemaFieldMultiText, zDocCustomSchemaFieldMultiNumber, zDocCustomSchemaFieldMultiRelation, zDocCustomSchemaFieldMultiSelectText, zDocCustomSchemaFieldMultiSelectNumber, zDocRelationField } from './models.js';
3
- export { zDocCustomSchema, zDocFile, zDocFileIndex, zDocFileIndexContent, zDocFileIndexMeta, zDocFileIndexSchema, zDocFileMd, zDocFileMdContent, zDocFileMdMeta, zDocMetaFieldTypeMultiNumber, zDocMetaFieldTypeMultiRelation, zDocMetaFieldTypeMultiSelectNumber, zDocMetaFieldTypeMultiSelectText, zDocMetaFieldTypeMultiText, zDocTreeDirectoryNode, zDocTreeFileNode, zDocTreeNode } from './models.js';
3
+ export { zDocCustomSchema, zDocFile, zDocFileIndex, zDocFileIndexContent, zDocFileIndexMeta, zDocFileIndexMetaInput, zDocFileIndexSchema, zDocFileIndexSchemaInput, zDocFileMd, zDocFileMdContent, zDocFileMdContentInput, zDocFileMdInput, zDocFileMdMeta, zDocFileMdMetaInput, zDocMetaFieldTypeMultiNumber, zDocMetaFieldTypeMultiRelation, zDocMetaFieldTypeMultiSelectNumber, zDocMetaFieldTypeMultiSelectText, zDocMetaFieldTypeMultiText, zDocTreeDirectoryNode, zDocTreeFileNode, zDocTreeNode } from './models.js';
4
4
 
5
5
  /**
6
6
  * Path operations system
@@ -142,7 +142,7 @@ declare class DocFileSystem {
142
142
  /**
143
143
  * Single boolean type schema field
144
144
  */
145
- declare class DocSchemaFieldBooleanSingleValue<T extends RecordKey> {
145
+ declare class DocSchemaFieldBooleanValue<T extends RecordKey> {
146
146
  readonly key: T;
147
147
  readonly value: DocSchemaFieldBoolean;
148
148
  constructor(key: T, value: DocSchemaFieldBoolean);
@@ -159,8 +159,8 @@ declare class DocSchemaFieldBooleanSingleValue<T extends RecordKey> {
159
159
  * Validate value type
160
160
  */
161
161
  validate(value: unknown): boolean;
162
- static empty(key: RecordKey): DocSchemaFieldBooleanSingleValue<RecordKey>;
163
- static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldBooleanSingleValue<RecordKey>;
162
+ static empty(key: RecordKey): DocSchemaFieldBooleanValue<RecordKey>;
163
+ static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldBooleanValue<RecordKey>;
164
164
  }
165
165
 
166
166
  /**
@@ -168,8 +168,8 @@ declare class DocSchemaFieldBooleanSingleValue<T extends RecordKey> {
168
168
  */
169
169
  declare class DocSchemaFieldMultiNumberValue<T extends RecordKey> {
170
170
  readonly key: T;
171
- readonly value: DocFieldMultiNumber;
172
- constructor(key: T, value: DocFieldMultiNumber);
171
+ readonly value: DocSchemaFieldMultiNumber;
172
+ constructor(key: T, value: DocSchemaFieldMultiNumber);
173
173
  get type(): "multi-number";
174
174
  get required(): boolean;
175
175
  get title(): string;
@@ -192,8 +192,8 @@ declare class DocSchemaFieldMultiNumberValue<T extends RecordKey> {
192
192
  */
193
193
  declare class DocSchemaFieldMultiRelationValue<T extends RecordKey> {
194
194
  readonly key: T;
195
- readonly value: DocFieldMultiRelation;
196
- constructor(key: T, value: DocFieldMultiRelation);
195
+ readonly value: DocSchemaFieldMultiRelation;
196
+ constructor(key: T, value: DocSchemaFieldMultiRelation);
197
197
  get type(): "multi-relation";
198
198
  get required(): boolean;
199
199
  get title(): string;
@@ -269,8 +269,8 @@ declare class DocSchemaFieldMultiSelectTextValue<T extends RecordKey> {
269
269
  */
270
270
  declare class DocSchemaFieldMultiTextValue<T extends RecordKey> {
271
271
  readonly key: T;
272
- readonly value: DocFieldMultiText;
273
- constructor(key: T, value: DocFieldMultiText);
272
+ readonly value: DocSchemaFieldMultiText;
273
+ constructor(key: T, value: DocSchemaFieldMultiText);
274
274
  get type(): "multi-text";
275
275
  get required(): boolean;
276
276
  get title(): string;
@@ -291,7 +291,7 @@ declare class DocSchemaFieldMultiTextValue<T extends RecordKey> {
291
291
  /**
292
292
  * Single number type schema field
293
293
  */
294
- declare class DocSchemaFieldNumberSingleValue<T extends RecordKey> {
294
+ declare class DocSchemaFieldNumberValue<T extends RecordKey> {
295
295
  readonly key: T;
296
296
  readonly value: DocSchemaFieldNumber;
297
297
  constructor(key: T, value: DocSchemaFieldNumber);
@@ -308,14 +308,14 @@ declare class DocSchemaFieldNumberSingleValue<T extends RecordKey> {
308
308
  * Validate value type
309
309
  */
310
310
  validate(value: unknown): boolean;
311
- static empty(key: RecordKey): DocSchemaFieldNumberSingleValue<RecordKey>;
312
- static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldNumberSingleValue<RecordKey>;
311
+ static empty(key: RecordKey): DocSchemaFieldNumberValue<RecordKey>;
312
+ static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldNumberValue<RecordKey>;
313
313
  }
314
314
 
315
315
  /**
316
316
  * Single relation type schema field
317
317
  */
318
- declare class DocSchemaFieldRelationSingleValue<T extends RecordKey> {
318
+ declare class DocSchemaFieldRelationValue<T extends RecordKey> {
319
319
  readonly key: T;
320
320
  readonly value: DocSchemaFieldRelation;
321
321
  constructor(key: T, value: DocSchemaFieldRelation);
@@ -333,14 +333,14 @@ declare class DocSchemaFieldRelationSingleValue<T extends RecordKey> {
333
333
  * Validate value type
334
334
  */
335
335
  validate(value: unknown): boolean;
336
- static empty(key: RecordKey): DocSchemaFieldRelationSingleValue<RecordKey>;
337
- static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldRelationSingleValue<RecordKey>;
336
+ static empty(key: RecordKey): DocSchemaFieldRelationValue<RecordKey>;
337
+ static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldRelationValue<RecordKey>;
338
338
  }
339
339
 
340
340
  /**
341
341
  * Single select number type schema field
342
342
  */
343
- declare class DocSchemaFieldSelectNumberSingleValue<T extends RecordKey> {
343
+ declare class DocSchemaFieldSelectNumberValue<T extends RecordKey> {
344
344
  readonly key: T;
345
345
  readonly value: DocSchemaFieldSelectNumber;
346
346
  constructor(key: T, value: DocSchemaFieldSelectNumber);
@@ -359,14 +359,14 @@ declare class DocSchemaFieldSelectNumberSingleValue<T extends RecordKey> {
359
359
  */
360
360
  validate(value: unknown): boolean;
361
361
  toJson(): DocFileIndexSchemaField;
362
- static empty<T extends RecordKey>(key: T): DocSchemaFieldSelectNumberSingleValue<T>;
363
- static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldSelectNumberSingleValue<RecordKey>;
362
+ static empty<T extends RecordKey>(key: T): DocSchemaFieldSelectNumberValue<T>;
363
+ static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldSelectNumberValue<RecordKey>;
364
364
  }
365
365
 
366
366
  /**
367
367
  * Single select text type schema field
368
368
  */
369
- declare class DocSchemaFieldSelectTextSingleValue<T extends RecordKey> {
369
+ declare class DocSchemaFieldSelectTextValue<T extends RecordKey> {
370
370
  readonly key: T;
371
371
  readonly value: DocSchemaFieldSelectText;
372
372
  constructor(key: T, value: DocSchemaFieldSelectText);
@@ -385,14 +385,14 @@ declare class DocSchemaFieldSelectTextSingleValue<T extends RecordKey> {
385
385
  * Validate value type
386
386
  */
387
387
  validate(value: unknown): boolean;
388
- static empty<T extends RecordKey>(key: T): DocSchemaFieldSelectTextSingleValue<T>;
389
- static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldSelectTextSingleValue<RecordKey>;
388
+ static empty<T extends RecordKey>(key: T): DocSchemaFieldSelectTextValue<T>;
389
+ static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldSelectTextValue<RecordKey>;
390
390
  }
391
391
 
392
392
  /**
393
393
  * Single text type schema field
394
394
  */
395
- declare class DocSchemaFieldTextSingleValue<T extends RecordKey> {
395
+ declare class DocSchemaFieldTextValue<T extends RecordKey> {
396
396
  readonly key: T;
397
397
  readonly value: DocSchemaFieldText;
398
398
  constructor(key: T, value: DocSchemaFieldText);
@@ -409,8 +409,8 @@ declare class DocSchemaFieldTextSingleValue<T extends RecordKey> {
409
409
  * Validate value type
410
410
  */
411
411
  validate(value: unknown): boolean;
412
- static empty(key: RecordKey): DocSchemaFieldTextSingleValue<RecordKey>;
413
- static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldTextSingleValue<RecordKey>;
412
+ static empty(key: RecordKey): DocSchemaFieldTextValue<RecordKey>;
413
+ static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldTextValue<RecordKey>;
414
414
  }
415
415
 
416
416
  /**
@@ -428,11 +428,11 @@ type DocSchemaFieldBoolean = z.infer<typeof zDocSchemaFieldBoolean>;
428
428
  /**
429
429
  * Multi-text field type
430
430
  */
431
- type DocFieldMultiText = z.infer<typeof zDocSchemaFieldMultiText>;
431
+ type DocSchemaFieldMultiText = z.infer<typeof zDocSchemaFieldMultiText>;
432
432
  /**
433
433
  * Multi-number field type
434
434
  */
435
- type DocFieldMultiNumber = z.infer<typeof zDocSchemaFieldMultiNumber>;
435
+ type DocSchemaFieldMultiNumber = z.infer<typeof zDocSchemaFieldMultiNumber>;
436
436
  /**
437
437
  * Relation field type
438
438
  */
@@ -440,7 +440,7 @@ type DocSchemaFieldRelation = z.infer<typeof zDocSchemaFieldRelation>;
440
440
  /**
441
441
  * Multi-relation field type
442
442
  */
443
- type DocFieldMultiRelation = z.infer<typeof zDocSchemaFieldMultiRelation>;
443
+ type DocSchemaFieldMultiRelation = z.infer<typeof zDocSchemaFieldMultiRelation>;
444
444
  /**
445
445
  * Select text field type
446
446
  */
@@ -512,7 +512,7 @@ type DocCustomSchema<T extends RecordKey = RecordKey> = Record<T, DocCustomSchem
512
512
  /**
513
513
  * Union type for relation fields
514
514
  */
515
- type DocSchemaRelationFieldUnion = DocSchemaFieldRelation | DocFieldMultiRelation;
515
+ type DocSchemaRelationFieldUnion = DocSchemaFieldRelation | DocSchemaFieldMultiRelation;
516
516
  /**
517
517
  * File node type (for files only)
518
518
  */
@@ -538,10 +538,6 @@ type DocTreeDirectoryNode = {
538
538
  * Unified tree node type
539
539
  */
540
540
  type DocTreeNode = DocTreeFileNode | DocTreeDirectoryNode;
541
- /**
542
- * Alias for backward compatibility
543
- */
544
- type DocFileNode = DocTreeNode;
545
541
  /**
546
542
  * Index file type
547
543
  */
@@ -551,9 +547,6 @@ type DocFileIndex<T extends DocCustomSchema> = {
551
547
  isArchived: boolean;
552
548
  content: DocFileIndexContent<T>;
553
549
  };
554
- /**
555
- * Test helper types
556
- */
557
550
  /**
558
551
  * Type to check if two types are equal
559
552
  */
@@ -611,17 +604,6 @@ type DocRelationField = z.infer<typeof zDocRelationField>;
611
604
  * File path information type
612
605
  */
613
606
  type DocFilePath = z.infer<typeof zDocFilePath>;
614
- type DocSchemaFieldTypeText = z.infer<typeof zDocSchemaFieldText>;
615
- type DocSchemaFieldTypeNumber = z.infer<typeof zDocSchemaFieldNumber>;
616
- type DocSchemaFieldTypeBoolean = z.infer<typeof zDocSchemaFieldBoolean>;
617
- type DocSchemaFieldTypeMultiText = z.infer<typeof zDocSchemaFieldMultiText>;
618
- type DocSchemaFieldTypeMultiNumber = z.infer<typeof zDocSchemaFieldMultiNumber>;
619
- type DocSchemaFieldTypeRelation = z.infer<typeof zDocSchemaFieldRelation>;
620
- type DocSchemaFieldTypeMultiRelation = z.infer<typeof zDocSchemaFieldMultiRelation>;
621
- type DocSchemaFieldTypeSelectText = z.infer<typeof zDocSchemaFieldSelectText>;
622
- type DocSchemaFieldTypeSelectNumber = z.infer<typeof zDocSchemaFieldSelectNumber>;
623
- type DocSchemaFieldTypeMultiSelectText = z.infer<typeof zDocSchemaFieldMultiSelectText>;
624
- type DocSchemaFieldTypeMultiSelectNumber = z.infer<typeof zDocSchemaFieldMultiSelectNumber>;
625
607
  /**
626
608
  * Markdown content information type
627
609
  */
@@ -656,10 +638,6 @@ type RecordKey = string | number | symbol;
656
638
  * DocClient configuration
657
639
  */
658
640
  type DocClientConfig = z.infer<typeof zDocClientConfig>;
659
- /**
660
- * DocClient configuration input (all properties optional)
661
- */
662
- type DocClientConfigInput = z.input<typeof zDocClientConfig>;
663
641
  /**
664
642
  * Type definitions for DocFileMdMetaValue
665
643
  */
@@ -708,7 +686,7 @@ type ExtractIndexFieldType<T> = T extends {
708
686
  type GetIndexFieldType<Schema extends DocFileIndexSchema<RecordKey>, K extends keyof Schema> = Schema[K] extends DocFileIndexSchemaField ? Schema[K] : never;
709
687
  type GetIndexFieldValueType<Schema extends DocFileIndexSchema<RecordKey>, K extends keyof Schema> = Schema[K] extends {
710
688
  type: infer Type;
711
- } ? Type extends "text" ? DocSchemaFieldTextSingleValue<K> : Type extends "number" ? DocSchemaFieldNumberSingleValue<K> : Type extends "boolean" ? DocSchemaFieldBooleanSingleValue<K> : Type extends "relation" ? DocSchemaFieldRelationSingleValue<K> : Type extends "select-text" ? DocSchemaFieldSelectTextSingleValue<K> : Type extends "select-number" ? DocSchemaFieldSelectNumberSingleValue<K> : Type extends "multi-text" ? DocSchemaFieldMultiTextValue<K> : Type extends "multi-number" ? DocSchemaFieldMultiNumberValue<K> : Type extends "multi-relation" ? DocSchemaFieldMultiRelationValue<K> : Type extends "multi-select-text" ? DocSchemaFieldMultiSelectTextValue<K> : Type extends "multi-select-number" ? DocSchemaFieldMultiSelectNumberValue<K> : never : never;
689
+ } ? Type extends "text" ? DocSchemaFieldTextValue<K> : Type extends "number" ? DocSchemaFieldNumberValue<K> : Type extends "boolean" ? DocSchemaFieldBooleanValue<K> : Type extends "relation" ? DocSchemaFieldRelationValue<K> : Type extends "select-text" ? DocSchemaFieldSelectTextValue<K> : Type extends "select-number" ? DocSchemaFieldSelectNumberValue<K> : Type extends "multi-text" ? DocSchemaFieldMultiTextValue<K> : Type extends "multi-number" ? DocSchemaFieldMultiNumberValue<K> : Type extends "multi-relation" ? DocSchemaFieldMultiRelationValue<K> : Type extends "multi-select-text" ? DocSchemaFieldMultiSelectTextValue<K> : Type extends "multi-select-number" ? DocSchemaFieldMultiSelectNumberValue<K> : never : never;
712
690
 
713
691
  /**
714
692
  * Relation file
@@ -839,15 +817,15 @@ declare class DocFileIndexSchemaValue<T extends DocCustomSchema> {
839
817
  * Get field with specified field name
840
818
  * Returns type-safe specific field Value object
841
819
  */
842
- field<K extends keyof T>(key: K): T[K]["type"] extends infer Type ? Type extends "text" ? DocSchemaFieldTextSingleValue<K> : Type extends "number" ? DocSchemaFieldNumberSingleValue<K> : Type extends "boolean" ? DocSchemaFieldBooleanSingleValue<K> : Type extends "relation" ? DocSchemaFieldRelationSingleValue<K> : Type extends "select-text" ? DocSchemaFieldSelectTextSingleValue<K> : Type extends "select-number" ? DocSchemaFieldSelectNumberSingleValue<K> : Type extends "multi-text" ? DocSchemaFieldMultiTextValue<K> : Type extends "multi-number" ? DocSchemaFieldMultiNumberValue<K> : Type extends "multi-relation" ? DocSchemaFieldMultiRelationValue<K> : Type extends "multi-select-text" ? DocSchemaFieldMultiSelectTextValue<K> : Type extends "multi-select-number" ? DocSchemaFieldMultiSelectNumberValue<K> : never : never;
843
- relation<K extends keyof T>(key: K): DocSchemaFieldRelationSingleValue<K>;
820
+ field<K extends keyof T>(key: K): T[K]["type"] extends infer Type ? Type extends "text" ? DocSchemaFieldTextValue<K> : Type extends "number" ? DocSchemaFieldNumberValue<K> : Type extends "boolean" ? DocSchemaFieldBooleanValue<K> : Type extends "relation" ? DocSchemaFieldRelationValue<K> : Type extends "select-text" ? DocSchemaFieldSelectTextValue<K> : Type extends "select-number" ? DocSchemaFieldSelectNumberValue<K> : Type extends "multi-text" ? DocSchemaFieldMultiTextValue<K> : Type extends "multi-number" ? DocSchemaFieldMultiNumberValue<K> : Type extends "multi-relation" ? DocSchemaFieldMultiRelationValue<K> : Type extends "multi-select-text" ? DocSchemaFieldMultiSelectTextValue<K> : Type extends "multi-select-number" ? DocSchemaFieldMultiSelectNumberValue<K> : never : never;
821
+ relation<K extends keyof T>(key: K): DocSchemaFieldRelationValue<K>;
844
822
  multiRelation<K extends keyof T>(key: K): DocSchemaFieldMultiRelationValue<K>;
845
823
  /**
846
824
  * Get all fields
847
825
  * Note: For type safety, it's recommended to use field() method individually
848
826
  */
849
827
  get fields(): DocFileIndexSchema<keyof T>[keyof T][];
850
- get relationFields(): (DocSchemaFieldRelationSingleValue<string> | DocSchemaFieldMultiRelationValue<string>)[];
828
+ get relationFields(): (DocSchemaFieldRelationValue<string> | DocSchemaFieldMultiRelationValue<string>)[];
851
829
  toJson(): DocFileIndexSchema<keyof T>;
852
830
  /**
853
831
  * Create empty schema entity
@@ -1656,144 +1634,84 @@ declare class DocClient {
1656
1634
  }
1657
1635
 
1658
1636
  /**
1659
- * Value object for file path information
1660
- */
1661
- declare class DocFilePathValue {
1662
- readonly value: DocFilePath;
1663
- private readonly pathSystem;
1664
- constructor(value: DocFilePath, pathSystem: DocPathSystem);
1665
- /**
1666
- * File name without extension
1667
- */
1668
- get name(): string;
1669
- /**
1670
- * File path (relative path)
1671
- */
1672
- get path(): string;
1673
- /**
1674
- * File name with extension
1675
- */
1676
- get nameWithExtension(): string;
1677
- /**
1678
- * Full path (absolute path)
1679
- */
1680
- get fullPath(): string;
1681
- /**
1682
- * Directory path
1683
- */
1684
- get directoryPath(): string;
1685
- /**
1686
- * Extension
1687
- */
1688
- get extension(): string;
1689
- /**
1690
- * Whether the file is archived
1691
- */
1692
- get isArchived(): boolean;
1693
- /**
1694
- * Create instance from relative path (DI support)
1695
- */
1696
- static fromPathWithSystem(filePath: string, pathSystem: DocPathSystem, basePath?: string): DocFilePathValue;
1697
- /**
1698
- * Export as JSON format
1699
- */
1700
- toJson(): DocFilePath;
1701
- }
1702
-
1703
- type Value = {
1704
- path: string;
1705
- name: string;
1706
- fullPath: string;
1707
- };
1708
- /**
1709
- * Value object representing a directory path
1710
- */
1711
- declare class DocDirectoryPathValue {
1712
- private readonly value;
1713
- private readonly pathSystem;
1714
- constructor(value: Value, pathSystem: DocPathSystem);
1715
- /**
1716
- * Relative directory path
1717
- */
1718
- get path(): string;
1719
- /**
1720
- * Directory name
1721
- */
1722
- get name(): string;
1723
- /**
1724
- * Get parent directory path
1725
- */
1726
- get parent(): DocDirectoryPathValue | null;
1727
- /**
1728
- * Parent directory path
1729
- */
1730
- get parentPath(): string;
1731
- /**
1732
- * Depth (number of directory levels)
1733
- */
1734
- get depth(): number;
1735
- /**
1736
- * Path segments (array of directories)
1737
- */
1738
- get segments(): string[];
1739
- /**
1740
- * Relative path from root (without leading slash)
1741
- */
1742
- get normalizedPath(): string;
1743
- /**
1744
- * Whether this is an archive directory (directory name is "_")
1745
- */
1746
- get isArchived(): boolean;
1637
+ * In-memory file system for testing
1638
+ */
1639
+ declare class DocFileSystemDebug extends DocFileSystem {
1640
+ private files;
1641
+ private readonly _pathSystem;
1642
+ constructor(props: {
1643
+ basePath: string;
1644
+ pathSystem: DocPathSystem;
1645
+ });
1646
+ /**
1647
+ * PathSystem accessor (for testing)
1648
+ */
1649
+ getPathSystem(): DocPathSystem;
1650
+ /**
1651
+ * Factory method for testing
1652
+ */
1653
+ static createWithFiles(props: {
1654
+ basePath?: string;
1655
+ fileContents?: Record<string, string>;
1656
+ }): DocFileSystemDebug;
1657
+ readFile(filePath: string): Promise<string | null>;
1658
+ writeFile(filePath: string, content: string): Promise<void>;
1659
+ deleteFile(filePath: string): Promise<Error | null>;
1660
+ exists(filePath: string): Promise<boolean>;
1661
+ copyFile(source: string, destination: string): Promise<void>;
1662
+ moveFile(source: string, destination: string): Promise<void>;
1663
+ readDirectory(directoryPath: string): Promise<string[]>;
1664
+ readDirectoryRecursive(directoryPath: string): Promise<string[]>;
1665
+ readDirectoryFilePaths(directoryPath: string): Promise<string[]>;
1666
+ createDirectory(_directoryPath: string): Promise<void>;
1667
+ deleteDirectory(directoryPath: string): Promise<void>;
1668
+ getFileSize(filePath: string): Promise<number>;
1669
+ getFileModifiedTime(filePath: string): Promise<Date>;
1670
+ getFileCreatedTime(filePath: string): Promise<Date>;
1671
+ isDirectory(relativePath: string): Promise<boolean>;
1672
+ isFile(relativePath: string): Promise<boolean>;
1747
1673
  /**
1748
- * Whether this is a hidden directory
1674
+ * Get list of entries in directory
1749
1675
  */
1750
- get isHidden(): boolean;
1676
+ readDirectoryFileNames(directoryPath?: string): Promise<string[]>;
1751
1677
  /**
1752
- * Whether this is the root directory
1678
+ * Check if directory exists
1753
1679
  */
1754
- get isRoot(): boolean;
1680
+ directoryExists(relativePath: string): Promise<boolean>;
1755
1681
  /**
1756
- * Absolute path
1682
+ * Check if file exists
1757
1683
  */
1758
- get fullPath(): string;
1684
+ fileExists(relativePath: string): Promise<boolean>;
1759
1685
  /**
1760
- * Get index file path
1686
+ * Create directory if it doesn't exist
1761
1687
  */
1762
- get indexFile(): DocFilePathValue;
1688
+ ensureDirectoryExists(_relativePath: string): Promise<void>;
1763
1689
  /**
1764
- * Create file path
1690
+ * Clear all files
1765
1691
  */
1766
- file(fileName: string): DocFilePathValue;
1692
+ clear(): void;
1767
1693
  /**
1768
- * Create subdirectory path
1694
+ * Check file existence (for testing)
1769
1695
  */
1770
- subdirectory(dirName: string): DocDirectoryPathValue;
1696
+ hasFile(filePath: string): boolean;
1771
1697
  /**
1772
- * Create instance from relative path (DI support)
1698
+ * Get file content (sync version, for testing)
1773
1699
  */
1774
- static fromPathWithSystem(dirPath: string, basePath: string, pathSystem: DocPathSystem): DocDirectoryPathValue;
1700
+ getFileContent(filePath: string): string | undefined;
1775
1701
  /**
1776
- * Export as JSON format
1702
+ * Get all file paths (for testing)
1777
1703
  */
1778
- toJson(): Value;
1704
+ getAllFilePaths(): string[];
1779
1705
  /**
1780
- * Check if paths are equal
1706
+ * Get file count (for testing)
1781
1707
  */
1782
- equals(other: DocDirectoryPathValue): boolean;
1708
+ getFileCount(): number;
1783
1709
  /**
1784
- * Check if specified directory is a descendant of this directory
1710
+ * Setup test data
1785
1711
  */
1786
- contains(other: DocDirectoryPathValue): boolean;
1712
+ setupTestFiles(files: Record<string, string>): void;
1787
1713
  }
1788
1714
 
1789
- /**
1790
- * Multiple value type fields (multi-* types)
1791
- */
1792
- type DocSchemaFieldMultipleTypes<T extends RecordKey> = DocSchemaFieldMultiTextValue<T> | DocSchemaFieldMultiNumberValue<T> | DocSchemaFieldMultiSelectTextValue<T> | DocSchemaFieldMultiSelectNumberValue<T> | DocSchemaFieldMultiRelationValue<T>;
1793
- /**
1794
- * Single value type fields
1795
- */
1796
- type DocSchemaFieldSingleTypes<T extends RecordKey> = DocSchemaFieldTextSingleValue<T> | DocSchemaFieldNumberSingleValue<T> | DocSchemaFieldBooleanSingleValue<T> | DocSchemaFieldSelectTextSingleValue<T> | DocSchemaFieldSelectNumberSingleValue<T> | DocSchemaFieldRelationSingleValue<T>;
1797
- type DocSchemaFieldValue<T extends RecordKey> = DocSchemaFieldSingleTypes<T> | DocSchemaFieldMultipleTypes<T>;
1715
+ type DocFileEntity<T extends DocCustomSchema> = DocFileMdEntity<T> | DocFileIndexEntity<T> | DocFileUnknownEntity;
1798
1716
 
1799
- export { type BaseFieldValueType, DocClient, type DocClientConfig, type DocClientConfigInput, 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, type DocDirectory, DocDirectoryPathValue, DocDirectoryReference, type DocFieldMultiNumber, type DocFieldMultiRelation, type DocFieldMultiText, type DocFile, type DocFileIndex, type DocFileIndexContent, DocFileIndexContentValue, DocFileIndexEntity, type DocFileIndexMeta, DocFileIndexMetaValue, DocFileIndexReference, type DocFileIndexSchema, type DocFileIndexSchemaField, DocFileIndexSchemaValue, type DocFileMd, type DocFileMdContent, DocFileMdContentValue, DocFileMdEntity, type DocFileMdMeta, DocFileMdMetaValue, DocFileMdReference, type DocFileNode, type DocFilePath, DocFilePathValue, DocFileRelationReference, DocFileSystem, type DocFileUnknown, DocFileUnknownEntity, DocFileUnknownReference, DocMarkdownSystem, type DocMetaField, type DocMetaFieldBoolean, type DocMetaFieldMultiBoolean, 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, type DocRelation, type DocRelationField, type DocRelationFile, DocRelationFileValue, DocRelationValue, type DocSchemaFieldBoolean, DocSchemaFieldBooleanSingleValue, type DocSchemaFieldMultiSelectNumber, type DocSchemaFieldMultiSelectText, type DocSchemaFieldNumber, DocSchemaFieldMultiNumberValue as DocSchemaFieldNumberMultipleValue, DocSchemaFieldNumberSingleValue, type DocSchemaFieldRelation, DocSchemaFieldMultiRelationValue as DocSchemaFieldRelationMultipleValue, DocSchemaFieldRelationSingleValue, type DocSchemaFieldSelectNumber, DocSchemaFieldMultiSelectNumberValue as DocSchemaFieldSelectNumberMultipleValue, DocSchemaFieldSelectNumberSingleValue, type DocSchemaFieldSelectText, DocSchemaFieldMultiSelectTextValue as DocSchemaFieldSelectTextMultipleValue, DocSchemaFieldSelectTextSingleValue, type DocSchemaFieldText, DocSchemaFieldMultiTextValue as DocSchemaFieldTextMultipleValue, DocSchemaFieldTextSingleValue, type DocSchemaFieldTypeBoolean, type DocSchemaFieldTypeMultiNumber, type DocSchemaFieldTypeMultiRelation, type DocSchemaFieldTypeMultiSelectNumber, type DocSchemaFieldTypeMultiSelectText, type DocSchemaFieldTypeMultiText, type DocSchemaFieldTypeNumber, type DocSchemaFieldTypeRelation, type DocSchemaFieldTypeSelectNumber, type DocSchemaFieldTypeSelectText, type DocSchemaFieldTypeText, type DocSchemaFieldValue, type DocSchemaRelationFieldUnion, type DocTreeDirectoryNode, DocTreeDirectoryNodeValue, type DocTreeFileNode, DocTreeFileNodeValue, type DocTreeNode, type Equals, type ExtractFieldType, type ExtractIndexFieldType, type ExtractRequired, type FieldValueType, DocFileTreeSystem as FileTreeSystem, type GetIndexFieldType, type GetIndexFieldValueType, type GetValueType, type MultiRelationKeys, type OptionalKeys, type RecordKey, type RelationKeys, type RequiredKeys, type SchemaToValueType, zDocClientConfig, zDocCustomSchemaField, zDocCustomSchemaFieldBoolean, zDocCustomSchemaFieldMultiNumber, zDocCustomSchemaFieldMultiRelation, zDocCustomSchemaFieldMultiSelectNumber, zDocCustomSchemaFieldMultiSelectText, zDocCustomSchemaFieldMultiText, zDocCustomSchemaFieldNumber, zDocCustomSchemaFieldRelation, zDocCustomSchemaFieldSelectNumber, zDocCustomSchemaFieldSelectText, zDocCustomSchemaFieldText, zDocFileIndexSchemaField, zDocFilePath, zDocFileUnknown, zDocMetaField, zDocMetaFieldBoolean, zDocMetaFieldMultiBoolean, zDocMetaFieldMultiNumber, zDocMetaFieldMultiRelation, zDocMetaFieldMultiSelectNumber, zDocMetaFieldMultiSelectText, zDocMetaFieldMultiText, zDocMetaFieldNumber, zDocMetaFieldRelation, zDocMetaFieldSelectNumber, zDocMetaFieldSelectText, zDocMetaFieldText, zDocMetaFieldType, zDocMetaFieldTypeBoolean, zDocMetaFieldTypeNumber, zDocMetaFieldTypeRelation, zDocMetaFieldTypeSelectNumber, zDocMetaFieldTypeSelectText, zDocMetaFieldTypeText, zDocRelation, zDocRelationField, zDocRelationFile, zDocSchemaFieldBoolean, zDocSchemaFieldMultiNumber, zDocSchemaFieldMultiRelation, zDocSchemaFieldMultiSelectNumber, zDocSchemaFieldMultiSelectText, zDocSchemaFieldMultiText, zDocSchemaFieldNumber, zDocSchemaFieldRelation, zDocSchemaFieldSelectNumber, zDocSchemaFieldSelectText, zDocSchemaFieldText };
1717
+ export { type BaseFieldValueType, 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, type DocDirectory, DocDirectoryReference, type DocFile, type DocFileEntity, type DocFileIndex, type DocFileIndexContent, DocFileIndexEntity, type DocFileIndexMeta, DocFileIndexReference, type DocFileIndexSchema, type DocFileIndexSchemaField, type DocFileMd, type DocFileMdContent, DocFileMdEntity, type DocFileMdMeta, DocFileMdReference, type DocFilePath, DocFileRelationReference, DocFileSystem, DocFileSystemDebug, type DocFileUnknown, DocFileUnknownEntity, DocFileUnknownReference, DocMarkdownSystem, type DocMetaField, type DocMetaFieldBoolean, type DocMetaFieldMultiBoolean, 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, type DocRelation, type DocRelationField, type DocRelationFile, 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, type DocTreeFileNode, type DocTreeNode, type Equals, type ExtractFieldType, type ExtractIndexFieldType, type ExtractRequired, type FieldValueType, DocFileTreeSystem as FileTreeSystem, type GetIndexFieldType, type GetIndexFieldValueType, type GetValueType, type MultiRelationKeys, type OptionalKeys, type RecordKey, type RelationKeys, type RequiredKeys, type SchemaToValueType, zDocClientConfig, zDocCustomSchemaField, zDocCustomSchemaFieldBoolean, zDocCustomSchemaFieldMultiNumber, zDocCustomSchemaFieldMultiRelation, zDocCustomSchemaFieldMultiSelectNumber, zDocCustomSchemaFieldMultiSelectText, zDocCustomSchemaFieldMultiText, zDocCustomSchemaFieldNumber, zDocCustomSchemaFieldRelation, zDocCustomSchemaFieldSelectNumber, zDocCustomSchemaFieldSelectText, zDocCustomSchemaFieldText, zDocFileIndexSchemaField, zDocFilePath, zDocFileUnknown, zDocMetaField, zDocMetaFieldBoolean, zDocMetaFieldMultiBoolean, zDocMetaFieldMultiNumber, zDocMetaFieldMultiRelation, zDocMetaFieldMultiSelectNumber, zDocMetaFieldMultiSelectText, zDocMetaFieldMultiText, zDocMetaFieldNumber, zDocMetaFieldRelation, zDocMetaFieldSelectNumber, zDocMetaFieldSelectText, zDocMetaFieldText, zDocMetaFieldType, zDocMetaFieldTypeBoolean, zDocMetaFieldTypeNumber, zDocMetaFieldTypeRelation, zDocMetaFieldTypeSelectNumber, zDocMetaFieldTypeSelectText, zDocMetaFieldTypeText, zDocRelation, zDocRelationField, zDocRelationFile, zDocSchemaFieldBoolean, zDocSchemaFieldMultiNumber, zDocSchemaFieldMultiRelation, zDocSchemaFieldMultiSelectNumber, zDocSchemaFieldMultiSelectText, zDocSchemaFieldMultiText, zDocSchemaFieldNumber, zDocSchemaFieldRelation, zDocSchemaFieldSelectNumber, zDocSchemaFieldSelectText, zDocSchemaFieldText };