@tinacms/graphql 1.5.13 → 1.5.15

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  */
4
4
  import { BatchOp, Level } from './level';
5
- import { Collection } from '@tinacms/schema-tools';
5
+ import type { Collection } from '@tinacms/schema-tools';
6
6
  export declare enum OP {
7
7
  EQ = "eq",
8
8
  GT = "gt",
@@ -49,6 +49,9 @@ export type FilterCondition = {
49
49
  };
50
50
  type StringEscaper = <T extends string | string[]>(input: T) => T;
51
51
  export declare const DEFAULT_COLLECTION_SORT_KEY = "__filepath__";
52
+ export declare const REFS_COLLECTIONS_SORT_KEY = "__refs__";
53
+ export declare const REFS_REFERENCE_FIELD = "__tina_ref__";
54
+ export declare const REFS_PATH_FIELD = "__tina_ref_path__";
52
55
  export declare const DEFAULT_NUMERIC_LPAD = 4;
53
56
  export declare const coerceFilterChainOperands: (filterChain: (BinaryFilter | TernaryFilter)[], escapeString?: StringEscaper) => (BinaryFilter | TernaryFilter)[];
54
57
  export declare const makeFilter: ({ filterChain, }: {
@@ -71,6 +74,7 @@ export declare class FolderTreeBuilder {
71
74
  }
72
75
  export declare const makeFolderOpsForCollection: <T extends object>(folderTree: FolderTree, collection: Collection<true>, indexDefinitions: Record<string, IndexDefinition>, opType: "put" | "del", level: Level, escapeStr?: StringEscaper) => BatchOp[];
73
76
  export declare const makeIndexOpsForDocument: <T extends object>(filepath: string, collection: string | undefined, indexDefinitions: Record<string, IndexDefinition>, data: T, opType: "put" | "del", level: Level, escapeStr?: StringEscaper) => BatchOp[];
77
+ export declare const makeRefOpsForDocument: <T extends object>(filepath: string, collection: string | undefined, references: Record<string, string[]> | undefined | null, data: T, opType: "put" | "del", level: Level) => BatchOp[];
74
78
  export declare const makeStringEscaper: (regex: RegExp, replacement: string) => StringEscaper;
75
79
  export declare const stringEscaper: StringEscaper;
76
80
  export {};
@@ -72,6 +72,7 @@ export declare class Database {
72
72
  private tinaSchema;
73
73
  private contentNamespace;
74
74
  private collectionIndexDefinitions;
75
+ private collectionReferences;
75
76
  private _lookup;
76
77
  constructor(config: DatabaseArgs);
77
78
  private collectionForPath;
@@ -125,6 +126,7 @@ export declare class Database {
125
126
  getGraphQLSchemaFromBridge: () => Promise<DocumentNode>;
126
127
  getTinaSchema: (level?: Level) => Promise<Schema>;
127
128
  getSchema: (level?: Level, existingSchema?: Schema) => Promise<TinaSchema>;
129
+ getCollectionReferences: (level?: Level) => Promise<Record<string, Record<string, string[]>>>;
128
130
  getIndexDefinitions: (level?: Level) => Promise<Record<string, Record<string, IndexDefinition>>>;
129
131
  documentExists: (fullpath: unknown) => Promise<boolean>;
130
132
  query: (queryOptions: QueryOptions, hydrator: any) => Promise<{
package/dist/index.d.ts CHANGED
@@ -1,32 +1 @@
1
- import type { Schema, Collection, Template as TinaTemplate } from '@tinacms/schema-tools';
2
- import { buildDotTinaFiles } from './build';
3
- export { resolve } from './resolve';
4
- export { transformDocumentIntoPayload } from './resolver';
5
- export * from './resolver/error';
6
- export { TinaLevelClient } from './level/tinaLevel';
7
- export type { Level } from './database/level';
8
- export type { QueryOptions, OnDeleteCallback, OnPutCallback, DatabaseArgs, GitProvider, CreateDatabase, } from './database';
9
- export { Database, createDatabaseInternal, createDatabase, createLocalDatabase, } from './database';
10
- import type { Config } from '@tinacms/schema-tools';
11
- export { getChangedFiles, getSha, shaExists } from './git';
12
- export * from './auth/utils';
13
- export { sequential, assertShape } from './util';
14
- export { loadAndParseWithAliases, stringifyFile, parseFile, scanAllContent, scanContentByPaths, transformDocument, } from './database/util';
15
- export { createSchema } from './schema/createSchema';
16
- export { buildDotTinaFiles };
17
- export type DummyType = unknown;
18
- export declare const buildSchema: (config: Config, flags?: string[]) => Promise<{
19
- graphQLSchema: {
20
- kind: "Document";
21
- definitions: any;
22
- };
23
- tinaSchema: import("@tinacms/schema-tools").TinaSchema;
24
- lookup: Record<string, import("./database").LookupMapType>;
25
- fragDoc: string;
26
- queryDoc: string;
27
- }>;
28
- export type TinaSchema = Schema;
29
- export type { TinaTemplate, Schema, Collection };
30
- export { FilesystemBridge, AuditFileSystemBridge, } from './database/bridge/filesystem';
31
- export { IsomorphicBridge } from './database/bridge/isomorphic';
32
- export type { Bridge } from './database/bridge';
1
+ export * from "../src/index"