@tinacms/graphql 1.4.6 → 1.4.8

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.
@@ -100,6 +100,7 @@ export declare const astBuilder: {
100
100
  Scalar: (type: scalarNames) => string;
101
101
  MultiCollectionDocument: string;
102
102
  CollectionDocumentUnion: string;
103
+ Folder: string;
103
104
  String: string;
104
105
  Reference: string;
105
106
  Collection: string;
@@ -2,6 +2,7 @@
2
2
 
3
3
  */
4
4
  import { BatchOp, Level } from './level';
5
+ import { Collection } from '@tinacms/schema-tools';
5
6
  export declare enum OP {
6
7
  EQ = "eq",
7
8
  GT = "gt",
@@ -57,6 +58,15 @@ export declare const makeFilterSuffixes: (filterChain: (BinaryFilter | TernaryFi
57
58
  left?: string;
58
59
  right?: string;
59
60
  } | undefined;
61
+ export declare const FOLDER_ROOT = "~";
62
+ declare type FolderTree = Record<string, Set<string>>;
63
+ export declare class FolderTreeBuilder {
64
+ _tree: FolderTree;
65
+ constructor();
66
+ get tree(): FolderTree;
67
+ update(documentPath: string, collectionPath: string): any;
68
+ }
69
+ export declare const makeFolderOpsForCollection: <T extends object>(folderTree: FolderTree, collection: Collection<true>, indexDefinitions: IndexDefinition[], opType: 'put' | 'del', level: Level, escapeStr?: StringEscaper) => BatchOp[];
60
70
  export declare const makeIndexOpsForDocument: <T extends object>(filepath: string, collection: string | undefined, indexDefinitions: IndexDefinition[], data: T, opType: 'put' | 'del', level: Level, escapeStr?: StringEscaper) => BatchOp[];
61
71
  export declare const makeStringEscaper: (regex: RegExp, replacement: string) => StringEscaper;
62
72
  export declare const stringEscaper: StringEscaper;
@@ -30,6 +30,7 @@ export declare type QueryOptions = {
30
30
  last?: number;
31
31
  after?: string;
32
32
  before?: string;
33
+ folder?: string;
33
34
  };
34
35
  export declare class Database {
35
36
  config: CreateDatabase;
@@ -93,7 +94,7 @@ export declare class Database {
93
94
  getGraphQLSchema: () => Promise<DocumentNode>;
94
95
  getGraphQLSchemaFromBridge: () => Promise<DocumentNode>;
95
96
  getTinaSchema: (level?: Level) => Promise<Schema>;
96
- getSchema: (level?: Level) => Promise<TinaSchema>;
97
+ getSchema: (level?: Level, existingSchema?: Schema) => Promise<TinaSchema>;
97
98
  getIndexDefinitions: (level?: Level) => Promise<Record<string, Record<string, IndexDefinition>>>;
98
99
  documentExists: (fullpath: unknown) => Promise<boolean>;
99
100
  query: (queryOptions: QueryOptions, hydrator: any) => Promise<{
@@ -123,12 +124,12 @@ export declare class Database {
123
124
  deleteContentByPaths: (documentPaths: string[]) => Promise<void>;
124
125
  indexContentByPaths: (documentPaths: string[]) => Promise<void>;
125
126
  delete: (filepath: string) => Promise<void>;
126
- _indexAllContent: (level: Level) => Promise<{
127
+ _indexAllContent: (level: Level, schema?: Schema) => Promise<{
127
128
  warnings: string[];
128
129
  }>;
129
130
  addToLookupMap: (lookup: LookupMapType) => Promise<void>;
130
131
  }
131
- export declare type LookupMapType = GlobalDocumentLookup | CollectionDocumentLookup | MultiCollectionDocumentLookup | MultiCollectionDocumentListLookup | CollectionDocumentListLookup | UnionDataLookup | NodeDocument;
132
+ export declare type LookupMapType = GlobalDocumentLookup | CollectionDocumentLookup | CollectionFolderLookup | MultiCollectionDocumentLookup | MultiCollectionDocumentListLookup | CollectionDocumentListLookup | UnionDataLookup | NodeDocument;
132
133
  declare type NodeDocument = {
133
134
  type: string;
134
135
  resolveType: 'nodeDocument';
@@ -143,6 +144,11 @@ declare type CollectionDocumentLookup = {
143
144
  resolveType: 'collectionDocument';
144
145
  collection: string;
145
146
  };
147
+ declare type CollectionFolderLookup = {
148
+ type: string;
149
+ resolveType: 'collectionFolder';
150
+ collection: string;
151
+ };
146
152
  declare type MultiCollectionDocumentLookup = {
147
153
  type: string;
148
154
  resolveType: 'multiCollectionDocument';