@interactive-inc/docs-client 1.0.13 → 1.0.14
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 +97 -96
- package/build/index.js +1 -11
- package/build/models.d.ts +10 -11
- package/build/models.js +1 -5
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { zDocFileMd, zDocFileUnknown, zDocClientConfig, zDocFilePath, zDocFileIndexSchemaField, zDocSchemaFieldText, zDocSchemaFieldNumber, zDocSchemaFieldBoolean, zDocSchemaFieldRelation, zDocSchemaFieldSelectText, zDocSchemaFieldSelectNumber, zDocSchemaFieldMultiText, zDocSchemaFieldMultiNumber, zDocSchemaFieldMultiRelation, zDocSchemaFieldMultiSelectText, zDocSchemaFieldMultiSelectNumber, zDocRelation, zDocRelationFile, zDocMetaFieldRelation, zDocMetaFieldMultiRelation, zDocMetaFieldText, zDocMetaFieldNumber, zDocMetaFieldBoolean, zDocMetaFieldMultiText, zDocMetaFieldMultiNumber,
|
|
2
|
+
import { zDocFileMd, zDocFileUnknown, zDocClientConfig, zDocFilePath, zDocFileIndexSchemaField, zDocSchemaFieldText, zDocSchemaFieldNumber, zDocSchemaFieldBoolean, zDocSchemaFieldRelation, zDocSchemaFieldSelectText, zDocSchemaFieldSelectNumber, zDocSchemaFieldMultiText, zDocSchemaFieldMultiNumber, zDocSchemaFieldMultiRelation, zDocSchemaFieldMultiSelectText, zDocSchemaFieldMultiSelectNumber, zDocRelation, zDocRelationFile, zDocMetaFieldRelation, zDocMetaFieldMultiRelation, zDocMetaFieldText, zDocMetaFieldNumber, zDocMetaFieldBoolean, zDocMetaFieldMultiText, zDocMetaFieldMultiNumber, zDocRelationField, zDocMetaField, zDocMetaFieldSelectText, zDocMetaFieldSelectNumber, zDocMetaFieldMultiSelectText, zDocMetaFieldMultiSelectNumber, zDocMetaFieldTypeText, zDocMetaFieldTypeNumber, zDocMetaFieldTypeBoolean, zDocMetaFieldTypeSelectText, zDocMetaFieldTypeSelectNumber, zDocMetaFieldTypeRelation, zDocMetaFieldType, zDocFileIndex } from './models.js';
|
|
3
3
|
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';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -142,7 +142,7 @@ declare class DocFileSystem {
|
|
|
142
142
|
/**
|
|
143
143
|
* Meta
|
|
144
144
|
*/
|
|
145
|
-
declare class DocFileMdMetaValue<T extends
|
|
145
|
+
declare class DocFileMdMetaValue<T extends DocCustomSchema> {
|
|
146
146
|
readonly value: SchemaToValueType<T>;
|
|
147
147
|
readonly customSchema: T;
|
|
148
148
|
constructor(value: SchemaToValueType<T>, customSchema: T);
|
|
@@ -160,7 +160,6 @@ declare class DocFileMdMetaValue<T extends DocCustomSchemaGenerics> {
|
|
|
160
160
|
boolean(key: keyof T): DocMetaFieldBoolean;
|
|
161
161
|
multiText(key: keyof T): DocMetaFieldMultiText;
|
|
162
162
|
multiNumber(key: keyof T): DocMetaFieldMultiNumber;
|
|
163
|
-
multiBoolean(key: keyof T): DocMetaFieldMultiBoolean;
|
|
164
163
|
hasKey(key: keyof T): boolean;
|
|
165
164
|
toJson(): SchemaToValueType<T>;
|
|
166
165
|
toYaml(): string;
|
|
@@ -169,17 +168,17 @@ declare class DocFileMdMetaValue<T extends DocCustomSchemaGenerics> {
|
|
|
169
168
|
/**
|
|
170
169
|
* Generate from Markdown text
|
|
171
170
|
*/
|
|
172
|
-
static fromYamlText<T extends
|
|
173
|
-
static empty<T extends
|
|
171
|
+
static fromYamlText<T extends DocCustomSchema>(yamlText: string, customSchema: T): DocFileMdMetaValue<T>;
|
|
172
|
+
static empty<T extends DocCustomSchema>(customSchema: T): DocFileMdMetaValue<T>;
|
|
174
173
|
}
|
|
175
174
|
|
|
176
175
|
/**
|
|
177
176
|
* File: Markdown > Content
|
|
178
177
|
*/
|
|
179
|
-
declare class DocFileMdContentValue<T extends
|
|
180
|
-
readonly value:
|
|
178
|
+
declare class DocFileMdContentValue<T extends DocCustomSchema> {
|
|
179
|
+
readonly value: DocFileMdContent<T>;
|
|
181
180
|
private readonly customSchema;
|
|
182
|
-
constructor(value:
|
|
181
|
+
constructor(value: DocFileMdContent<T>, customSchema: T);
|
|
183
182
|
/**
|
|
184
183
|
* Content body (does not include frontMatter)
|
|
185
184
|
*/
|
|
@@ -211,7 +210,7 @@ declare class DocFileMdContentValue<T extends DocCustomSchemaGenerics> {
|
|
|
211
210
|
/**
|
|
212
211
|
* Update FrontMatter
|
|
213
212
|
*/
|
|
214
|
-
withMeta<U extends
|
|
213
|
+
withMeta<U extends DocCustomSchema>(meta: DocFileMdMetaValue<U>): DocFileMdContentValue<U>;
|
|
215
214
|
/**
|
|
216
215
|
* Update specific property of FrontMatter
|
|
217
216
|
*/
|
|
@@ -219,7 +218,7 @@ declare class DocFileMdContentValue<T extends DocCustomSchemaGenerics> {
|
|
|
219
218
|
/**
|
|
220
219
|
* Generate from Markdown text
|
|
221
220
|
*/
|
|
222
|
-
static fromMarkdown<T extends
|
|
221
|
+
static fromMarkdown<T extends DocCustomSchema>(markdown: string, customSchema: T): DocFileMdContentValue<T>;
|
|
223
222
|
/**
|
|
224
223
|
* Generate complete Markdown text
|
|
225
224
|
*/
|
|
@@ -231,20 +230,20 @@ declare class DocFileMdContentValue<T extends DocCustomSchemaGenerics> {
|
|
|
231
230
|
/**
|
|
232
231
|
* Generate empty content
|
|
233
232
|
*/
|
|
234
|
-
static empty<T extends
|
|
233
|
+
static empty<T extends DocCustomSchema = DocCustomSchema>(title: string, customSchema: T): DocFileMdContentValue<T>;
|
|
235
234
|
/**
|
|
236
235
|
* Output in JSON format
|
|
237
236
|
*/
|
|
238
|
-
toJson():
|
|
237
|
+
toJson(): DocFileMdContent<T>;
|
|
239
238
|
}
|
|
240
239
|
|
|
241
240
|
/**
|
|
242
241
|
* Markdown file entity
|
|
243
242
|
*/
|
|
244
|
-
declare class DocFileMdEntity<T extends
|
|
245
|
-
readonly value:
|
|
243
|
+
declare class DocFileMdEntity<T extends DocCustomSchema> {
|
|
244
|
+
readonly value: DocFileMd<T>;
|
|
246
245
|
private readonly customSchema;
|
|
247
|
-
constructor(value:
|
|
246
|
+
constructor(value: DocFileMd<T>, customSchema: T);
|
|
248
247
|
/**
|
|
249
248
|
* Content
|
|
250
249
|
*/
|
|
@@ -270,7 +269,7 @@ declare class DocFileMdEntity<T extends DocCustomSchemaGenerics> {
|
|
|
270
269
|
toJson(): z.infer<typeof zDocFileMd>;
|
|
271
270
|
}
|
|
272
271
|
|
|
273
|
-
type Props$8<T extends
|
|
272
|
+
type Props$8<T extends DocCustomSchema> = {
|
|
274
273
|
path: string;
|
|
275
274
|
fileSystem: DocFileSystem;
|
|
276
275
|
pathSystem: DocPathSystem;
|
|
@@ -280,7 +279,7 @@ type Props$8<T extends DocCustomSchemaGenerics> = {
|
|
|
280
279
|
/**
|
|
281
280
|
* File reference
|
|
282
281
|
*/
|
|
283
|
-
declare class DocFileMdReference<T extends
|
|
282
|
+
declare class DocFileMdReference<T extends DocCustomSchema> {
|
|
284
283
|
private readonly props;
|
|
285
284
|
private readonly pathSystem;
|
|
286
285
|
private readonly customSchema;
|
|
@@ -348,7 +347,7 @@ declare class DocFileMdReference<T extends DocCustomSchemaGenerics> {
|
|
|
348
347
|
/**
|
|
349
348
|
* Get relation based on schema
|
|
350
349
|
*/
|
|
351
|
-
relation<U extends
|
|
350
|
+
relation<U extends DocCustomSchema = DocCustomSchema>(key: RelationKeys<T>, targetSchema?: U): Promise<DocFileMdReference<U> | Error | null>;
|
|
352
351
|
/**
|
|
353
352
|
* Get index.md in the same directory
|
|
354
353
|
*/
|
|
@@ -356,7 +355,7 @@ declare class DocFileMdReference<T extends DocCustomSchemaGenerics> {
|
|
|
356
355
|
/**
|
|
357
356
|
* Get multiple relations based on schema
|
|
358
357
|
*/
|
|
359
|
-
relations<U extends
|
|
358
|
+
relations<U extends DocCustomSchema = DocCustomSchema>(key: MultiRelationKeys<T>, customSchema?: U): Promise<DocFileMdReference<U>[]>;
|
|
360
359
|
/**
|
|
361
360
|
* File: Markdown > FrontMatter
|
|
362
361
|
*/
|
|
@@ -411,8 +410,8 @@ declare class DocFileUnknownReference {
|
|
|
411
410
|
get directoryPath(): string;
|
|
412
411
|
get fileFullPath(): string;
|
|
413
412
|
get durectoryPath(): string;
|
|
414
|
-
directory<T extends
|
|
415
|
-
directory(): DocDirectoryReference<
|
|
413
|
+
directory<T extends DocCustomSchema>(customSchema: T): DocDirectoryReference<T>;
|
|
414
|
+
directory(): DocDirectoryReference<DocCustomSchema>;
|
|
416
415
|
read(): Promise<Error | DocFileUnknownEntity>;
|
|
417
416
|
/**
|
|
418
417
|
* Read file content
|
|
@@ -525,7 +524,6 @@ type DocMetaFieldSelectNumber = z.infer<typeof zDocMetaFieldSelectNumber>;
|
|
|
525
524
|
type DocMetaFieldRelation = z.infer<typeof zDocMetaFieldRelation>;
|
|
526
525
|
type DocMetaFieldMultiText = z.infer<typeof zDocMetaFieldMultiText>;
|
|
527
526
|
type DocMetaFieldMultiNumber = z.infer<typeof zDocMetaFieldMultiNumber>;
|
|
528
|
-
type DocMetaFieldMultiBoolean = z.infer<typeof zDocMetaFieldMultiBoolean>;
|
|
529
527
|
type DocMetaFieldMultiSelectText = z.infer<typeof zDocMetaFieldMultiSelectText>;
|
|
530
528
|
type DocMetaFieldMultiSelectNumber = z.infer<typeof zDocMetaFieldMultiSelectNumber>;
|
|
531
529
|
type DocMetaFieldMultiRelation = z.infer<typeof zDocMetaFieldMultiRelation>;
|
|
@@ -591,7 +589,7 @@ type DocFileIndexSchemaField = z.infer<typeof zDocFileIndexSchemaField>;
|
|
|
591
589
|
/**
|
|
592
590
|
* Schema definition type
|
|
593
591
|
*/
|
|
594
|
-
type
|
|
592
|
+
type DocFileIndexSchema<T extends RecordKey> = Record<T, DocFileIndexSchemaField>;
|
|
595
593
|
/**
|
|
596
594
|
* Schema field to override
|
|
597
595
|
* ex: { xxx: { type: "text", required: true } }
|
|
@@ -604,7 +602,7 @@ type DocFieldTypeLiteral = "text" | "number" | "boolean" | "relation" | "multi-t
|
|
|
604
602
|
/**
|
|
605
603
|
* Minimal schema definition type
|
|
606
604
|
*/
|
|
607
|
-
type
|
|
605
|
+
type DocCustomSchema<T extends RecordKey = RecordKey> = Record<T, DocCustomSchemaField>;
|
|
608
606
|
/**
|
|
609
607
|
* Union type for relation fields
|
|
610
608
|
*/
|
|
@@ -637,11 +635,11 @@ type DocTreeNode = DocTreeFileNode | DocTreeDirectoryNode;
|
|
|
637
635
|
/**
|
|
638
636
|
* Index file type
|
|
639
637
|
*/
|
|
640
|
-
type
|
|
638
|
+
type DocFileIndex<T extends DocCustomSchema = DocCustomSchema> = {
|
|
641
639
|
type: "index";
|
|
642
640
|
path: DocFilePath;
|
|
643
641
|
isArchived: boolean;
|
|
644
|
-
content:
|
|
642
|
+
content: DocFileIndexContent<T>;
|
|
645
643
|
};
|
|
646
644
|
/**
|
|
647
645
|
* Type to check if two types are equal
|
|
@@ -650,23 +648,23 @@ type Equals<T, U> = (<G>() => G extends T ? 1 : 2) extends <G>() => G extends U
|
|
|
650
648
|
/**
|
|
651
649
|
* Extract relation field keys from schema
|
|
652
650
|
*/
|
|
653
|
-
type RelationKeys<T extends
|
|
651
|
+
type RelationKeys<T extends DocCustomSchema> = {
|
|
654
652
|
[K in keyof T]: T[K]["type"] extends "relation" ? K : never;
|
|
655
653
|
}[keyof T];
|
|
656
654
|
/**
|
|
657
655
|
* Extract multi-relation field keys from schema
|
|
658
656
|
*/
|
|
659
|
-
type MultiRelationKeys<T extends
|
|
657
|
+
type MultiRelationKeys<T extends DocCustomSchema> = {
|
|
660
658
|
[K in keyof T]: T[K]["type"] extends "multi-relation" ? K : never;
|
|
661
659
|
}[keyof T];
|
|
662
660
|
/**
|
|
663
661
|
* Markdown file type (excluding index.md)
|
|
664
662
|
*/
|
|
665
|
-
type
|
|
663
|
+
type DocFileMd<T extends DocCustomSchema> = {
|
|
666
664
|
type: "markdown";
|
|
667
665
|
path: DocFilePath;
|
|
668
666
|
isArchived: boolean;
|
|
669
|
-
content:
|
|
667
|
+
content: DocFileMdContent<T>;
|
|
670
668
|
};
|
|
671
669
|
/**
|
|
672
670
|
* Other file type (non-markdown)
|
|
@@ -675,18 +673,21 @@ type DocFileUnknown = z.infer<typeof zDocFileUnknown>;
|
|
|
675
673
|
/**
|
|
676
674
|
* File union type (index.md, regular md, other)
|
|
677
675
|
*/
|
|
678
|
-
type
|
|
679
|
-
type
|
|
680
|
-
type
|
|
681
|
-
type
|
|
682
|
-
|
|
676
|
+
type DocFile<T extends DocCustomSchema = DocCustomSchema> = DocFileIndex<T> | DocFileMd<T> | DocFileUnknown;
|
|
677
|
+
type DocDirectoryFile<T extends DocCustomSchema = DocCustomSchema> = DocFileMd<T> | DocFileUnknown;
|
|
678
|
+
type DocFileIndexAny = z.infer<typeof zDocFileIndex>;
|
|
679
|
+
type DocFileMdAny = z.infer<typeof zDocFileMd>;
|
|
680
|
+
/**
|
|
681
|
+
* DocFile<DocCustomSchema<RecordKey>>
|
|
682
|
+
*/
|
|
683
|
+
type DocFileAny = DocFileIndexAny | DocFileMdAny | DocFileUnknown;
|
|
683
684
|
/**
|
|
684
685
|
* Directory FrontMatter type
|
|
685
686
|
*/
|
|
686
|
-
type
|
|
687
|
+
type DocFileIndexMeta<T extends DocCustomSchema = DocCustomSchema> = {
|
|
687
688
|
type: "index-meta";
|
|
688
689
|
icon: string | null;
|
|
689
|
-
schema:
|
|
690
|
+
schema: DocFileIndexSchema<keyof T>;
|
|
690
691
|
};
|
|
691
692
|
/**
|
|
692
693
|
* Relation options type
|
|
@@ -722,11 +723,11 @@ type DetectFileType<T extends string> = IsIndexMd<T> extends true ? "index" : En
|
|
|
722
723
|
/**
|
|
723
724
|
* Map file type to reference class
|
|
724
725
|
*/
|
|
725
|
-
type
|
|
726
|
+
type FileTypeToReference<FileType extends string, Schema extends DocCustomSchema> = FileType extends "index" ? DocFileIndexReference<Schema> : FileType extends "markdown" ? DocFileMdReference<Schema> : DocFileUnknownReference;
|
|
726
727
|
/**
|
|
727
728
|
* Infer reference type from path
|
|
728
729
|
*/
|
|
729
|
-
type InferReference<Path extends string, Schema extends
|
|
730
|
+
type InferReference<Path extends string, Schema extends DocCustomSchema> = FileTypeToReference<DetectFileType<Path>, Schema>;
|
|
730
731
|
/**
|
|
731
732
|
* File path information type
|
|
732
733
|
*/
|
|
@@ -734,7 +735,7 @@ type DocFilePath = z.infer<typeof zDocFilePath>;
|
|
|
734
735
|
/**
|
|
735
736
|
* Markdown content information type
|
|
736
737
|
*/
|
|
737
|
-
type
|
|
738
|
+
type DocFileMdContent<T extends DocCustomSchema = DocCustomSchema> = {
|
|
738
739
|
type: "markdown-content";
|
|
739
740
|
body: string;
|
|
740
741
|
title: string;
|
|
@@ -744,20 +745,20 @@ type DocFileMdContentGenerics<T extends DocCustomSchemaGenerics = DocCustomSchem
|
|
|
744
745
|
/**
|
|
745
746
|
* Index file content information type
|
|
746
747
|
*/
|
|
747
|
-
type
|
|
748
|
+
type DocFileIndexContent<T extends DocCustomSchema = DocCustomSchema> = {
|
|
748
749
|
type: "markdown-index";
|
|
749
750
|
body: string;
|
|
750
751
|
title: string;
|
|
751
752
|
description: string;
|
|
752
|
-
meta:
|
|
753
|
+
meta: DocFileIndexMeta<T>;
|
|
753
754
|
};
|
|
754
755
|
/**
|
|
755
756
|
* Directory response type (re-export from server package)
|
|
756
757
|
*/
|
|
757
|
-
type
|
|
758
|
+
type DocDirectory<T extends DocCustomSchema> = {
|
|
758
759
|
cwd: string;
|
|
759
|
-
indexFile:
|
|
760
|
-
files:
|
|
760
|
+
indexFile: DocFileIndex<T>;
|
|
761
|
+
files: DocFile<T>[];
|
|
761
762
|
relations: DocRelation[];
|
|
762
763
|
};
|
|
763
764
|
type RecordKey = PropertyKey;
|
|
@@ -779,7 +780,7 @@ type FieldValueType<Type, Required> = Required extends true ? BaseFieldValueType
|
|
|
779
780
|
/**
|
|
780
781
|
* Extract required field keys
|
|
781
782
|
*/
|
|
782
|
-
type RequiredKeys<T extends
|
|
783
|
+
type RequiredKeys<T extends DocCustomSchema> = {
|
|
783
784
|
[K in keyof T]: T[K] extends {
|
|
784
785
|
required: true;
|
|
785
786
|
} ? K : never;
|
|
@@ -787,7 +788,7 @@ type RequiredKeys<T extends DocCustomSchemaGenerics> = {
|
|
|
787
788
|
/**
|
|
788
789
|
* Extract optional field keys
|
|
789
790
|
*/
|
|
790
|
-
type OptionalKeys<T extends
|
|
791
|
+
type OptionalKeys<T extends DocCustomSchema> = {
|
|
791
792
|
[K in keyof T]: T[K] extends {
|
|
792
793
|
required: true;
|
|
793
794
|
} ? never : K;
|
|
@@ -795,20 +796,20 @@ type OptionalKeys<T extends DocCustomSchemaGenerics> = {
|
|
|
795
796
|
/**
|
|
796
797
|
* Generate expected value type from schema (considering required)
|
|
797
798
|
*/
|
|
798
|
-
type SchemaToValueType<T extends
|
|
799
|
+
type SchemaToValueType<T extends DocCustomSchema> = {
|
|
799
800
|
[K in RequiredKeys<T>]: BaseFieldValueType<ExtractFieldType<T[K]>>;
|
|
800
801
|
} & {
|
|
801
|
-
[K in OptionalKeys<T>]
|
|
802
|
+
[K in OptionalKeys<T>]: BaseFieldValueType<ExtractFieldType<T[K]>> | null;
|
|
802
803
|
};
|
|
803
804
|
/**
|
|
804
805
|
* Helper type for type-safe property access
|
|
805
806
|
*/
|
|
806
|
-
type GetValueType<T extends
|
|
807
|
-
type GetIndexFieldType<Schema extends
|
|
807
|
+
type GetValueType<T extends DocCustomSchema, K extends keyof T> = K extends RequiredKeys<T> ? BaseFieldValueType<ExtractFieldType<T[K]>> : BaseFieldValueType<ExtractFieldType<T[K]>> | undefined | null;
|
|
808
|
+
type GetIndexFieldType<Schema extends DocFileIndexSchema<RecordKey>, K extends keyof Schema> = Schema[K] extends DocFileIndexSchemaField ? Schema[K] : never;
|
|
808
809
|
/**
|
|
809
810
|
* Infers DocFileMd type from the result of defineSchema
|
|
810
811
|
*/
|
|
811
|
-
type InferDocFileMd<T> = T extends
|
|
812
|
+
type InferDocFileMd<T> = T extends DocCustomSchema ? DocFileMd<T> : never;
|
|
812
813
|
|
|
813
814
|
/**
|
|
814
815
|
* Relation file
|
|
@@ -1200,10 +1201,10 @@ declare class DocSchemaFieldMultiNumberValue<T extends RecordKey> {
|
|
|
1200
1201
|
/**
|
|
1201
1202
|
* Type-safe schema value object
|
|
1202
1203
|
*/
|
|
1203
|
-
declare class DocFileIndexSchemaValue<T extends
|
|
1204
|
-
readonly value:
|
|
1204
|
+
declare class DocFileIndexSchemaValue<T extends DocCustomSchema> {
|
|
1205
|
+
readonly value: DocFileIndexSchema<keyof T>;
|
|
1205
1206
|
readonly customSchema: T;
|
|
1206
|
-
constructor(value:
|
|
1207
|
+
constructor(value: DocFileIndexSchema<keyof T>, customSchema: T);
|
|
1207
1208
|
/**
|
|
1208
1209
|
* Get list of field names
|
|
1209
1210
|
* Automatically type-safe when using Zod schema
|
|
@@ -1216,7 +1217,7 @@ declare class DocFileIndexSchemaValue<T extends DocCustomSchemaGenerics> {
|
|
|
1216
1217
|
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;
|
|
1217
1218
|
relation<K extends keyof T>(key: K): DocSchemaFieldRelationValue<K>;
|
|
1218
1219
|
multiRelation<K extends keyof T>(key: K): DocSchemaFieldMultiRelationValue<K>;
|
|
1219
|
-
toJson():
|
|
1220
|
+
toJson(): DocFileIndexSchema<keyof T>;
|
|
1220
1221
|
/**
|
|
1221
1222
|
* Create empty schema entity
|
|
1222
1223
|
* biome-ignore lint/complexity/noBannedTypes: {} as DocCustomSchema
|
|
@@ -1227,12 +1228,12 @@ declare class DocFileIndexSchemaValue<T extends DocCustomSchemaGenerics> {
|
|
|
1227
1228
|
/**
|
|
1228
1229
|
* File: index.md > content > FrontMatter
|
|
1229
1230
|
*/
|
|
1230
|
-
declare class DocFileIndexMetaValue<T extends
|
|
1231
|
-
readonly value:
|
|
1231
|
+
declare class DocFileIndexMetaValue<T extends DocCustomSchema> {
|
|
1232
|
+
readonly value: DocFileIndexMeta<T>;
|
|
1232
1233
|
readonly customSchema: T;
|
|
1233
1234
|
private readonly config;
|
|
1234
1235
|
private readonly additionalProperties;
|
|
1235
|
-
constructor(value:
|
|
1236
|
+
constructor(value: DocFileIndexMeta<T>, customSchema: T, config: DocClientConfig, additionalProperties?: Record<string, unknown>);
|
|
1236
1237
|
/**
|
|
1237
1238
|
* Get icon
|
|
1238
1239
|
*/
|
|
@@ -1252,16 +1253,16 @@ declare class DocFileIndexMetaValue<T extends DocCustomSchemaGenerics> {
|
|
|
1252
1253
|
/**
|
|
1253
1254
|
* Update schema field
|
|
1254
1255
|
*/
|
|
1255
|
-
withSchema(value:
|
|
1256
|
+
withSchema(value: DocFileIndexSchema<keyof T>): DocFileIndexMetaValue<T>;
|
|
1256
1257
|
/**
|
|
1257
1258
|
* Return a new instance with an unknown schema
|
|
1258
1259
|
* Allows accepting Record<string, unknown> schemas from external sources
|
|
1259
1260
|
*/
|
|
1260
|
-
withUnknownSchema(draft: Record<string, unknown>): DocFileIndexMetaValue<
|
|
1261
|
+
withUnknownSchema(draft: Record<string, unknown>): DocFileIndexMetaValue<DocCustomSchema>;
|
|
1261
1262
|
/**
|
|
1262
1263
|
* Output in JSON format
|
|
1263
1264
|
*/
|
|
1264
|
-
toJson():
|
|
1265
|
+
toJson(): DocFileIndexMeta<T>;
|
|
1265
1266
|
/**
|
|
1266
1267
|
* Output in YAML format
|
|
1267
1268
|
*/
|
|
@@ -1269,15 +1270,15 @@ declare class DocFileIndexMetaValue<T extends DocCustomSchemaGenerics> {
|
|
|
1269
1270
|
/**
|
|
1270
1271
|
* Generate from Markdown text (can process incomplete data)
|
|
1271
1272
|
*/
|
|
1272
|
-
static from<T extends
|
|
1273
|
+
static from<T extends DocCustomSchema>(markdownText: string, customSchema: T, config: DocClientConfig): DocFileIndexMetaValue<T>;
|
|
1273
1274
|
/**
|
|
1274
1275
|
* Generate directly from data (can process incomplete data)
|
|
1275
1276
|
*/
|
|
1276
|
-
static fromRecord<T extends
|
|
1277
|
+
static fromRecord<T extends DocCustomSchema>(record: Record<string, unknown>, customSchema: T, config: DocClientConfig): DocFileIndexMetaValue<T>;
|
|
1277
1278
|
/**
|
|
1278
1279
|
* Generate empty FrontMatter
|
|
1279
1280
|
*/
|
|
1280
|
-
static empty<T extends
|
|
1281
|
+
static empty<T extends DocCustomSchema>(customSchema: T, config: DocClientConfig): DocFileIndexMetaValue<T>;
|
|
1281
1282
|
/**
|
|
1282
1283
|
* Extract icon
|
|
1283
1284
|
*/
|
|
@@ -1290,17 +1291,17 @@ declare class DocFileIndexMetaValue<T extends DocCustomSchemaGenerics> {
|
|
|
1290
1291
|
* Normalize entire schema
|
|
1291
1292
|
*/
|
|
1292
1293
|
private static normalizeSchema;
|
|
1293
|
-
static emptySchema<T extends
|
|
1294
|
+
static emptySchema<T extends DocCustomSchema>(customSchema: T): DocFileIndexSchema<keyof T>;
|
|
1294
1295
|
}
|
|
1295
1296
|
|
|
1296
1297
|
/**
|
|
1297
1298
|
* File: index.md > content
|
|
1298
1299
|
*/
|
|
1299
|
-
declare class DocFileIndexContentValue<T extends
|
|
1300
|
-
readonly value:
|
|
1300
|
+
declare class DocFileIndexContentValue<T extends DocCustomSchema> {
|
|
1301
|
+
readonly value: DocFileIndexContent<T>;
|
|
1301
1302
|
private readonly customSchema;
|
|
1302
1303
|
private readonly config;
|
|
1303
|
-
constructor(value:
|
|
1304
|
+
constructor(value: DocFileIndexContent<T>, customSchema: T, config: DocClientConfig);
|
|
1304
1305
|
/**
|
|
1305
1306
|
* Content body (does not include frontMatter)
|
|
1306
1307
|
*/
|
|
@@ -1328,7 +1329,7 @@ declare class DocFileIndexContentValue<T extends DocCustomSchemaGenerics> {
|
|
|
1328
1329
|
/**
|
|
1329
1330
|
* Generate from Markdown text
|
|
1330
1331
|
*/
|
|
1331
|
-
static fromMarkdown<T extends
|
|
1332
|
+
static fromMarkdown<T extends DocCustomSchema>(markdown: string, customSchema: T, config: DocClientConfig): DocFileIndexContentValue<T>;
|
|
1332
1333
|
/**
|
|
1333
1334
|
* Generate complete Markdown text
|
|
1334
1335
|
*/
|
|
@@ -1340,11 +1341,11 @@ declare class DocFileIndexContentValue<T extends DocCustomSchemaGenerics> {
|
|
|
1340
1341
|
/**
|
|
1341
1342
|
* Update FrontMatter
|
|
1342
1343
|
*/
|
|
1343
|
-
withMeta(meta:
|
|
1344
|
+
withMeta(meta: DocFileIndexMeta<T>): DocFileIndexContentValue<T>;
|
|
1344
1345
|
/**
|
|
1345
1346
|
* Generate default index.md content
|
|
1346
1347
|
*/
|
|
1347
|
-
static empty<T extends
|
|
1348
|
+
static empty<T extends DocCustomSchema = DocCustomSchema>(directoryName: string, customSchema: T, config: DocClientConfig): DocFileIndexContentValue<T>;
|
|
1348
1349
|
/**
|
|
1349
1350
|
* Generate complete text combining FrontMatter and body
|
|
1350
1351
|
*/
|
|
@@ -1352,17 +1353,17 @@ declare class DocFileIndexContentValue<T extends DocCustomSchemaGenerics> {
|
|
|
1352
1353
|
/**
|
|
1353
1354
|
* Output in JSON format
|
|
1354
1355
|
*/
|
|
1355
|
-
toJson():
|
|
1356
|
+
toJson(): DocFileIndexContent<T>;
|
|
1356
1357
|
}
|
|
1357
1358
|
|
|
1358
1359
|
/**
|
|
1359
1360
|
* Document directory entity
|
|
1360
1361
|
*/
|
|
1361
|
-
declare class DocFileIndexEntity<T extends
|
|
1362
|
-
readonly value:
|
|
1362
|
+
declare class DocFileIndexEntity<T extends DocCustomSchema> {
|
|
1363
|
+
readonly value: DocFileIndex<T>;
|
|
1363
1364
|
private readonly customSchema;
|
|
1364
1365
|
private readonly config;
|
|
1365
|
-
constructor(value:
|
|
1366
|
+
constructor(value: DocFileIndex<T>, customSchema: T, config?: DocClientConfig);
|
|
1366
1367
|
/**
|
|
1367
1368
|
* Content
|
|
1368
1369
|
*/
|
|
@@ -1385,7 +1386,7 @@ declare class DocFileIndexEntity<T extends DocCustomSchemaGenerics> {
|
|
|
1385
1386
|
toJson(): z.infer<typeof zDocFileIndex>;
|
|
1386
1387
|
}
|
|
1387
1388
|
|
|
1388
|
-
type Props$5<T extends
|
|
1389
|
+
type Props$5<T extends DocCustomSchema> = {
|
|
1389
1390
|
customSchema: T;
|
|
1390
1391
|
path: string;
|
|
1391
1392
|
fileSystem: DocFileSystem;
|
|
@@ -1395,7 +1396,7 @@ type Props$5<T extends DocCustomSchemaGenerics> = {
|
|
|
1395
1396
|
/**
|
|
1396
1397
|
* File reference class
|
|
1397
1398
|
*/
|
|
1398
|
-
declare class DocFileIndexReference<T extends
|
|
1399
|
+
declare class DocFileIndexReference<T extends DocCustomSchema> {
|
|
1399
1400
|
private readonly props;
|
|
1400
1401
|
private readonly pathSystem;
|
|
1401
1402
|
private readonly customSchema;
|
|
@@ -1406,7 +1407,7 @@ declare class DocFileIndexReference<T extends DocCustomSchemaGenerics> {
|
|
|
1406
1407
|
get fileFullPath(): string;
|
|
1407
1408
|
get durectoryPath(): string;
|
|
1408
1409
|
read(): Promise<DocFileIndexEntity<T> | Error>;
|
|
1409
|
-
readSchemaValue(): Promise<
|
|
1410
|
+
readSchemaValue(): Promise<DocFileIndexSchema<RecordKey>>;
|
|
1410
1411
|
/**
|
|
1411
1412
|
* Read file content
|
|
1412
1413
|
*/
|
|
@@ -1459,12 +1460,12 @@ declare class DocFileIndexReference<T extends DocCustomSchemaGenerics> {
|
|
|
1459
1460
|
restore(archiveDirectoryName?: string): Promise<DocFileIndexReference<T>>;
|
|
1460
1461
|
}
|
|
1461
1462
|
|
|
1462
|
-
type DocFileDirectoryReference<T extends
|
|
1463
|
+
type DocFileDirectoryReference<T extends DocCustomSchema> = DocFileMdReference<T> | DocFileUnknownReference;
|
|
1463
1464
|
|
|
1464
|
-
type DocFileEntity<T extends
|
|
1465
|
-
type DocFileDirectoryEntity<T extends
|
|
1465
|
+
type DocFileEntity<T extends DocCustomSchema> = DocFileMdEntity<T> | DocFileIndexEntity<T> | DocFileUnknownEntity;
|
|
1466
|
+
type DocFileDirectoryEntity<T extends DocCustomSchema> = DocFileMdEntity<T> | DocFileUnknownEntity;
|
|
1466
1467
|
|
|
1467
|
-
type Props$4<T extends
|
|
1468
|
+
type Props$4<T extends DocCustomSchema> = {
|
|
1468
1469
|
customSchema: T;
|
|
1469
1470
|
path: string;
|
|
1470
1471
|
indexFileName: string;
|
|
@@ -1476,7 +1477,7 @@ type Props$4<T extends DocCustomSchemaGenerics> = {
|
|
|
1476
1477
|
/**
|
|
1477
1478
|
* Directory reference
|
|
1478
1479
|
*/
|
|
1479
|
-
declare class DocDirectoryReference<T extends
|
|
1480
|
+
declare class DocDirectoryReference<T extends DocCustomSchema> {
|
|
1480
1481
|
private readonly props;
|
|
1481
1482
|
private readonly pathSystem;
|
|
1482
1483
|
private readonly customSchema;
|
|
@@ -1512,7 +1513,7 @@ declare class DocDirectoryReference<T extends DocCustomSchemaGenerics> {
|
|
|
1512
1513
|
* Get single subdirectory reference
|
|
1513
1514
|
*/
|
|
1514
1515
|
directory(directoryName: string): DocDirectoryReference<T>;
|
|
1515
|
-
directory<S extends
|
|
1516
|
+
directory<S extends DocCustomSchema>(directoryName: string, customSchema: S): DocDirectoryReference<S>;
|
|
1516
1517
|
indexFile(): DocFileIndexReference<T>;
|
|
1517
1518
|
readIndexFile(): Promise<DocFileIndexEntity<T> | Error>;
|
|
1518
1519
|
writeFile(entity: DocFileIndexEntity<T> | DocFileMdEntity<T> | DocFileUnknownEntity): Promise<Error | null>;
|
|
@@ -1701,14 +1702,14 @@ declare class DocClient {
|
|
|
1701
1702
|
readonly config: DocClientConfig;
|
|
1702
1703
|
constructor(props: Props);
|
|
1703
1704
|
basePath(): string;
|
|
1704
|
-
file<Path extends string>(relativePath: Path): InferReference<Path,
|
|
1705
|
-
file<Path extends string, T extends
|
|
1706
|
-
mdFile(relativePath: string): DocFileMdReference<
|
|
1707
|
-
mdFile<T extends
|
|
1708
|
-
indexFile(relativePath: string): DocFileIndexReference<
|
|
1709
|
-
indexFile<T extends
|
|
1710
|
-
directory(relativePath: string): DocDirectoryReference<
|
|
1711
|
-
directory<T extends
|
|
1705
|
+
file<Path extends string>(relativePath: Path): InferReference<Path, DocCustomSchema>;
|
|
1706
|
+
file<Path extends string, T extends DocCustomSchema>(relativePath: Path, customSchema: T): InferReference<Path, T>;
|
|
1707
|
+
mdFile(relativePath: string): DocFileMdReference<DocCustomSchema>;
|
|
1708
|
+
mdFile<T extends DocCustomSchema>(relativePath: string, customSchema: T): DocFileMdReference<T>;
|
|
1709
|
+
indexFile(relativePath: string): DocFileIndexReference<DocCustomSchema>;
|
|
1710
|
+
indexFile<T extends DocCustomSchema>(relativePath: string, customSchema: T): DocFileIndexReference<T>;
|
|
1711
|
+
directory(relativePath: string): DocDirectoryReference<DocCustomSchema>;
|
|
1712
|
+
directory<T extends DocCustomSchema>(relativePath: string, customSchema: T): DocDirectoryReference<T>;
|
|
1712
1713
|
fileTree(directoryPath?: string): Promise<DocTreeNode[]>;
|
|
1713
1714
|
directoryTree(directoryPath?: string): Promise<DocTreeDirectoryNode[]>;
|
|
1714
1715
|
}
|
|
@@ -1834,7 +1835,7 @@ declare class DocPathSystemMock extends DocPathSystem {
|
|
|
1834
1835
|
* .selectText("priority", false)
|
|
1835
1836
|
* .build()
|
|
1836
1837
|
*/
|
|
1837
|
-
declare class DocSchemaBuilder<T extends
|
|
1838
|
+
declare class DocSchemaBuilder<T extends DocCustomSchema> {
|
|
1838
1839
|
private schema;
|
|
1839
1840
|
constructor(schema?: T);
|
|
1840
1841
|
text<K extends string>(key: K, required: boolean): DocSchemaBuilder<T & Record<K, {
|
|
@@ -1917,7 +1918,7 @@ declare const defaultTestConfig: {
|
|
|
1917
1918
|
*
|
|
1918
1919
|
* type MyDoc = InferDocFileMd<typeof mySchema>
|
|
1919
1920
|
*/
|
|
1920
|
-
declare function defineSchema<T extends
|
|
1921
|
+
declare function defineSchema<T extends DocCustomSchema>(schema: T): T;
|
|
1921
1922
|
/**
|
|
1922
1923
|
* Helper functions for field definitions
|
|
1923
1924
|
* Use when finer control is needed
|
|
@@ -2162,4 +2163,4 @@ declare class DocRelationFieldValue {
|
|
|
2162
2163
|
}): DocRelationFieldValue;
|
|
2163
2164
|
}
|
|
2164
2165
|
|
|
2165
|
-
export { type BaseFieldValueType, type DetectFileType, DocClient, type DocClientConfig, 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
|
|
2166
|
+
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, DocFileMdMetaValue, DocFileMdReference, type DocFilePath, DocFilePathValue, DocFileRelationReference, DocFileSystem, DocFileSystemMock, 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, DocSchemaBuilder, 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, assertType, defaultTestConfig, defineSchema, docCustomSchemaField, expectType, zDocClientConfig, zDocFileIndex, zDocFileIndexSchemaField, zDocFileMd, zDocFilePath, zDocFileUnknown, zDocMetaField, zDocMetaFieldBoolean, 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 };
|
package/build/index.js
CHANGED
|
@@ -136,7 +136,6 @@ var zDocMetaFieldSelectNumber = z.number().nullable();
|
|
|
136
136
|
var zDocMetaFieldRelation = z.string().nullable();
|
|
137
137
|
var zDocMetaFieldMultiText = z.string().array();
|
|
138
138
|
var zDocMetaFieldMultiNumber = z.number().array();
|
|
139
|
-
var zDocMetaFieldMultiBoolean = z.boolean().array();
|
|
140
139
|
var zDocMetaFieldMultiSelectText = z.string().array();
|
|
141
140
|
var zDocMetaFieldMultiSelectNumber = z.number().array();
|
|
142
141
|
var zDocMetaFieldMultiRelation = z.string().array();
|
|
@@ -149,11 +148,9 @@ var zDocMetaField = z.union([
|
|
|
149
148
|
zDocMetaFieldRelation,
|
|
150
149
|
zDocMetaFieldMultiText,
|
|
151
150
|
zDocMetaFieldMultiNumber,
|
|
152
|
-
zDocMetaFieldMultiBoolean,
|
|
153
151
|
zDocMetaFieldMultiSelectText,
|
|
154
152
|
zDocMetaFieldMultiSelectNumber,
|
|
155
|
-
zDocMetaFieldMultiRelation
|
|
156
|
-
z.null()
|
|
153
|
+
zDocMetaFieldMultiRelation
|
|
157
154
|
]);
|
|
158
155
|
var zDocFileMdMeta = z.record(z.string(), zDocMetaField);
|
|
159
156
|
var zDocFileMdMetaInput = z.record(
|
|
@@ -1315,12 +1312,6 @@ var DocFileMdMetaValue = class _DocFileMdMetaValue {
|
|
|
1315
1312
|
}
|
|
1316
1313
|
return zDocMetaFieldMultiNumber.parse(this.value[key]);
|
|
1317
1314
|
}
|
|
1318
|
-
multiBoolean(key) {
|
|
1319
|
-
if (this.hasKey(key) === false) {
|
|
1320
|
-
return [];
|
|
1321
|
-
}
|
|
1322
|
-
return zDocMetaFieldMultiBoolean.parse(this.value[key]);
|
|
1323
|
-
}
|
|
1324
1315
|
hasKey(key) {
|
|
1325
1316
|
const schemaField = this.schemaField(key);
|
|
1326
1317
|
const hasKey = key in this.value;
|
|
@@ -6363,7 +6354,6 @@ export {
|
|
|
6363
6354
|
zDocFileUnknown,
|
|
6364
6355
|
zDocMetaField,
|
|
6365
6356
|
zDocMetaFieldBoolean,
|
|
6366
|
-
zDocMetaFieldMultiBoolean,
|
|
6367
6357
|
zDocMetaFieldMultiNumber,
|
|
6368
6358
|
zDocMetaFieldMultiRelation,
|
|
6369
6359
|
zDocMetaFieldMultiSelectNumber,
|
package/build/models.d.ts
CHANGED
|
@@ -224,20 +224,19 @@ declare const zDocMetaFieldSelectNumber: z.ZodNullable<z.ZodNumber>;
|
|
|
224
224
|
declare const zDocMetaFieldRelation: z.ZodNullable<z.ZodString>;
|
|
225
225
|
declare const zDocMetaFieldMultiText: z.ZodArray<z.ZodString>;
|
|
226
226
|
declare const zDocMetaFieldMultiNumber: z.ZodArray<z.ZodNumber>;
|
|
227
|
-
declare const zDocMetaFieldMultiBoolean: z.ZodArray<z.ZodBoolean>;
|
|
228
227
|
declare const zDocMetaFieldMultiSelectText: z.ZodArray<z.ZodString>;
|
|
229
228
|
declare const zDocMetaFieldMultiSelectNumber: z.ZodArray<z.ZodNumber>;
|
|
230
229
|
declare const zDocMetaFieldMultiRelation: z.ZodArray<z.ZodString>;
|
|
231
|
-
declare const zDocMetaField: z.ZodUnion<readonly [z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodBoolean>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.
|
|
230
|
+
declare const zDocMetaField: z.ZodUnion<readonly [z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodBoolean>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>]>;
|
|
232
231
|
/**
|
|
233
232
|
* FrontMatter schema (internal use - only nullable)
|
|
234
233
|
*/
|
|
235
|
-
declare const zDocFileMdMeta: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodBoolean>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.
|
|
234
|
+
declare const zDocFileMdMeta: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodBoolean>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>]>>;
|
|
236
235
|
/**
|
|
237
236
|
* FrontMatter input schema (allows undefined for external APIs)
|
|
238
237
|
* Transforms undefined to null for internal consistency
|
|
239
238
|
*/
|
|
240
|
-
declare const zDocFileMdMetaInput: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<readonly [z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodBoolean>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.
|
|
239
|
+
declare const zDocFileMdMetaInput: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<readonly [z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodBoolean>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>]>, z.ZodUndefined]>>;
|
|
241
240
|
/**
|
|
242
241
|
* Schema definition
|
|
243
242
|
* Mapping of field names to schema fields
|
|
@@ -708,7 +707,7 @@ declare const zDocFileMdContent: z.ZodObject<{
|
|
|
708
707
|
body: z.ZodString;
|
|
709
708
|
title: z.ZodString;
|
|
710
709
|
description: z.ZodString;
|
|
711
|
-
meta: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodBoolean>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.
|
|
710
|
+
meta: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodBoolean>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>]>>;
|
|
712
711
|
}, z.core.$strip>;
|
|
713
712
|
/**
|
|
714
713
|
* Markdown content input (allows undefined in meta) - for external APIs
|
|
@@ -718,7 +717,7 @@ declare const zDocFileMdContentInput: z.ZodObject<{
|
|
|
718
717
|
body: z.ZodString;
|
|
719
718
|
title: z.ZodString;
|
|
720
719
|
description: z.ZodString;
|
|
721
|
-
meta: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<readonly [z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodBoolean>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.
|
|
720
|
+
meta: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<readonly [z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodBoolean>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>]>, z.ZodUndefined]>>;
|
|
722
721
|
}, z.core.$strip>;
|
|
723
722
|
/**
|
|
724
723
|
* Markdown content information (for index files)
|
|
@@ -933,7 +932,7 @@ declare const zDocFileMd: z.ZodObject<{
|
|
|
933
932
|
body: z.ZodString;
|
|
934
933
|
title: z.ZodString;
|
|
935
934
|
description: z.ZodString;
|
|
936
|
-
meta: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodBoolean>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.
|
|
935
|
+
meta: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodBoolean>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>]>>;
|
|
937
936
|
}, z.core.$strip>;
|
|
938
937
|
isArchived: z.ZodBoolean;
|
|
939
938
|
}, z.core.$strip>;
|
|
@@ -953,7 +952,7 @@ declare const zDocFileMdInput: z.ZodObject<{
|
|
|
953
952
|
body: z.ZodString;
|
|
954
953
|
title: z.ZodString;
|
|
955
954
|
description: z.ZodString;
|
|
956
|
-
meta: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<readonly [z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodBoolean>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.
|
|
955
|
+
meta: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<readonly [z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodBoolean>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>]>, z.ZodUndefined]>>;
|
|
957
956
|
}, z.core.$strip>;
|
|
958
957
|
isArchived: z.ZodBoolean;
|
|
959
958
|
}, z.core.$strip>;
|
|
@@ -1065,7 +1064,7 @@ declare const zDocFile: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1065
1064
|
body: z.ZodString;
|
|
1066
1065
|
title: z.ZodString;
|
|
1067
1066
|
description: z.ZodString;
|
|
1068
|
-
meta: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodBoolean>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.
|
|
1067
|
+
meta: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodBoolean>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>]>>;
|
|
1069
1068
|
}, z.core.$strip>;
|
|
1070
1069
|
isArchived: z.ZodBoolean;
|
|
1071
1070
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1093,7 +1092,7 @@ declare const zDocFileDirectory: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1093
1092
|
body: z.ZodString;
|
|
1094
1093
|
title: z.ZodString;
|
|
1095
1094
|
description: z.ZodString;
|
|
1096
|
-
meta: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodBoolean>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.
|
|
1095
|
+
meta: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodBoolean>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodNullable<z.ZodNumber>, z.ZodNullable<z.ZodString>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>]>>;
|
|
1097
1096
|
}, z.core.$strip>;
|
|
1098
1097
|
isArchived: z.ZodBoolean;
|
|
1099
1098
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1144,4 +1143,4 @@ declare const zDocClientConfig: z.ZodObject<{
|
|
|
1144
1143
|
directoryExcludes: z.ZodArray<z.ZodString>;
|
|
1145
1144
|
}, z.core.$strip>;
|
|
1146
1145
|
|
|
1147
|
-
export { zDocClientConfig, zDocCustomSchema, zDocCustomSchemaField, zDocCustomSchemaFieldBoolean, zDocCustomSchemaFieldMultiNumber, zDocCustomSchemaFieldMultiRelation, zDocCustomSchemaFieldMultiSelectNumber, zDocCustomSchemaFieldMultiSelectText, zDocCustomSchemaFieldMultiText, zDocCustomSchemaFieldNumber, zDocCustomSchemaFieldRelation, zDocCustomSchemaFieldSelectNumber, zDocCustomSchemaFieldSelectText, zDocCustomSchemaFieldText, zDocFile, zDocFileDirectory, zDocFileIndex, zDocFileIndexContent, zDocFileIndexMeta, zDocFileIndexMetaInput, zDocFileIndexSchema, zDocFileIndexSchemaField, zDocFileIndexSchemaInput, zDocFileMd, zDocFileMdContent, zDocFileMdContentInput, zDocFileMdInput, zDocFileMdMeta, zDocFileMdMetaInput, zDocFilePath, zDocFileUnknown, zDocMetaField, zDocMetaFieldBoolean,
|
|
1146
|
+
export { zDocClientConfig, zDocCustomSchema, zDocCustomSchemaField, zDocCustomSchemaFieldBoolean, zDocCustomSchemaFieldMultiNumber, zDocCustomSchemaFieldMultiRelation, zDocCustomSchemaFieldMultiSelectNumber, zDocCustomSchemaFieldMultiSelectText, zDocCustomSchemaFieldMultiText, zDocCustomSchemaFieldNumber, zDocCustomSchemaFieldRelation, zDocCustomSchemaFieldSelectNumber, zDocCustomSchemaFieldSelectText, zDocCustomSchemaFieldText, zDocFile, zDocFileDirectory, zDocFileIndex, zDocFileIndexContent, zDocFileIndexMeta, zDocFileIndexMetaInput, zDocFileIndexSchema, zDocFileIndexSchemaField, zDocFileIndexSchemaInput, zDocFileMd, zDocFileMdContent, zDocFileMdContentInput, zDocFileMdInput, zDocFileMdMeta, zDocFileMdMetaInput, zDocFilePath, zDocFileUnknown, zDocMetaField, zDocMetaFieldBoolean, zDocMetaFieldMultiNumber, zDocMetaFieldMultiRelation, zDocMetaFieldMultiSelectNumber, zDocMetaFieldMultiSelectText, zDocMetaFieldMultiText, zDocMetaFieldNumber, zDocMetaFieldRelation, zDocMetaFieldSelectNumber, zDocMetaFieldSelectText, zDocMetaFieldText, zDocMetaFieldType, zDocMetaFieldTypeBoolean, zDocMetaFieldTypeMultiNumber, zDocMetaFieldTypeMultiRelation, zDocMetaFieldTypeMultiSelectNumber, zDocMetaFieldTypeMultiSelectText, zDocMetaFieldTypeMultiText, zDocMetaFieldTypeNumber, zDocMetaFieldTypeRelation, zDocMetaFieldTypeSelectNumber, zDocMetaFieldTypeSelectText, zDocMetaFieldTypeText, zDocRelation, zDocRelationField, zDocRelationFile, zDocSchemaFieldBoolean, zDocSchemaFieldMultiNumber, zDocSchemaFieldMultiRelation, zDocSchemaFieldMultiSelectNumber, zDocSchemaFieldMultiSelectText, zDocSchemaFieldMultiText, zDocSchemaFieldNumber, zDocSchemaFieldRelation, zDocSchemaFieldSelectNumber, zDocSchemaFieldSelectText, zDocSchemaFieldText, zDocTreeDirectoryNode, zDocTreeFileNode, zDocTreeNode };
|
package/build/models.js
CHANGED
|
@@ -136,7 +136,6 @@ var zDocMetaFieldSelectNumber = z.number().nullable();
|
|
|
136
136
|
var zDocMetaFieldRelation = z.string().nullable();
|
|
137
137
|
var zDocMetaFieldMultiText = z.string().array();
|
|
138
138
|
var zDocMetaFieldMultiNumber = z.number().array();
|
|
139
|
-
var zDocMetaFieldMultiBoolean = z.boolean().array();
|
|
140
139
|
var zDocMetaFieldMultiSelectText = z.string().array();
|
|
141
140
|
var zDocMetaFieldMultiSelectNumber = z.number().array();
|
|
142
141
|
var zDocMetaFieldMultiRelation = z.string().array();
|
|
@@ -149,11 +148,9 @@ var zDocMetaField = z.union([
|
|
|
149
148
|
zDocMetaFieldRelation,
|
|
150
149
|
zDocMetaFieldMultiText,
|
|
151
150
|
zDocMetaFieldMultiNumber,
|
|
152
|
-
zDocMetaFieldMultiBoolean,
|
|
153
151
|
zDocMetaFieldMultiSelectText,
|
|
154
152
|
zDocMetaFieldMultiSelectNumber,
|
|
155
|
-
zDocMetaFieldMultiRelation
|
|
156
|
-
z.null()
|
|
153
|
+
zDocMetaFieldMultiRelation
|
|
157
154
|
]);
|
|
158
155
|
var zDocFileMdMeta = z.record(z.string(), zDocMetaField);
|
|
159
156
|
var zDocFileMdMetaInput = z.record(
|
|
@@ -359,7 +356,6 @@ export {
|
|
|
359
356
|
zDocFileUnknown,
|
|
360
357
|
zDocMetaField,
|
|
361
358
|
zDocMetaFieldBoolean,
|
|
362
|
-
zDocMetaFieldMultiBoolean,
|
|
363
359
|
zDocMetaFieldMultiNumber,
|
|
364
360
|
zDocMetaFieldMultiRelation,
|
|
365
361
|
zDocMetaFieldMultiSelectNumber,
|