@tinacms/graphql 1.4.14 → 1.4.16
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/dist/database/datalayer.d.ts +1 -1
- package/dist/database/index.d.ts +3 -4
- package/dist/database/util.d.ts +17 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.es.js +579 -486
- package/dist/index.js +586 -490
- package/dist/resolver/index.d.ts +28 -2
- package/dist/schema/validate.d.ts +1 -1
- package/package.json +4 -4
|
@@ -70,7 +70,7 @@ export declare class FolderTreeBuilder {
|
|
|
70
70
|
update(documentPath: string, collectionPath: string): any;
|
|
71
71
|
}
|
|
72
72
|
export declare const makeFolderOpsForCollection: <T extends object>(folderTree: FolderTree, collection: Collection<true>, indexDefinitions: IndexDefinition[], opType: 'put' | 'del', level: Level, escapeStr?: StringEscaper) => BatchOp[];
|
|
73
|
-
export declare const makeIndexOpsForDocument: <T extends object>(filepath: string, collection: string | undefined, indexDefinitions:
|
|
73
|
+
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[];
|
|
74
74
|
export declare const makeStringEscaper: (regex: RegExp, replacement: string) => StringEscaper;
|
|
75
75
|
export declare const stringEscaper: StringEscaper;
|
|
76
76
|
export {};
|
package/dist/database/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DocumentNode } from 'graphql';
|
|
2
|
-
import type { CollectionTemplateable, Schema,
|
|
2
|
+
import type { Collection, CollectionTemplateable, Schema, TinaSchema } from '@tinacms/schema-tools';
|
|
3
3
|
import type { Bridge } from './bridge';
|
|
4
4
|
import { BinaryFilter, IndexDefinition, TernaryFilter } from './datalayer';
|
|
5
5
|
import { Level } from './level';
|
|
@@ -47,7 +47,6 @@ export declare class Database {
|
|
|
47
47
|
constructor(config: CreateDatabase);
|
|
48
48
|
private collectionForPath;
|
|
49
49
|
private getGeneratedFolder;
|
|
50
|
-
private partitionPathsByCollection;
|
|
51
50
|
private updateDatabaseVersion;
|
|
52
51
|
private getDatabaseVersion;
|
|
53
52
|
private initLevel;
|
|
@@ -58,7 +57,7 @@ export declare class Database {
|
|
|
58
57
|
put: (filepath: string, data: {
|
|
59
58
|
[key: string]: unknown;
|
|
60
59
|
}, collectionName?: string) => Promise<boolean>;
|
|
61
|
-
getTemplateDetailsForFile(collection:
|
|
60
|
+
getTemplateDetailsForFile(collection: Collection<true>, data: {
|
|
62
61
|
[key: string]: unknown;
|
|
63
62
|
}): Promise<{
|
|
64
63
|
template: {
|
|
@@ -84,7 +83,7 @@ export declare class Database {
|
|
|
84
83
|
}>;
|
|
85
84
|
stringifyFile: (filepath: string, payload: {
|
|
86
85
|
[key: string]: unknown;
|
|
87
|
-
}, collection:
|
|
86
|
+
}, collection: Collection<true>) => Promise<string>;
|
|
88
87
|
/**
|
|
89
88
|
* Clears the internal cache of the tinaSchema and the lookup file. This allows the state to be reset
|
|
90
89
|
*/
|
package/dist/database/util.d.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
*/
|
|
4
4
|
import * as yup from 'yup';
|
|
5
|
-
import { normalizePath } from '@tinacms/schema-tools';
|
|
5
|
+
import { Collection, CollectionTemplateable, normalizePath, TinaSchema } from '@tinacms/schema-tools';
|
|
6
|
+
import { Bridge } from './bridge';
|
|
6
7
|
export { normalizePath };
|
|
7
8
|
export declare const stringifyFile: (content: object, format: FormatType | string, keepTemplateKey: boolean, markdownParseConfig?: {
|
|
8
9
|
frontmatterFormat?: 'toml' | 'yaml' | 'json';
|
|
@@ -15,3 +16,18 @@ export declare const parseFile: <T extends object>(content: string, format: Form
|
|
|
15
16
|
export declare type FormatType = 'json' | 'md' | 'mdx' | 'markdown';
|
|
16
17
|
export declare const atob: (b64Encoded: string) => string;
|
|
17
18
|
export declare const btoa: (string: string) => string;
|
|
19
|
+
export declare const scanAllContent: (tinaSchema: TinaSchema, bridge: Bridge, callback: (collection: Collection<true>, contentPaths: string[]) => Promise<void>) => Promise<string[]>;
|
|
20
|
+
export declare const scanContentByPaths: (tinaSchema: TinaSchema, documentPaths: string[], callback: (collection: Collection<true> | undefined, documentPaths: string[]) => Promise<void>) => Promise<void>;
|
|
21
|
+
export declare const partitionPathsByCollection: (tinaSchema: TinaSchema, documentPaths: string[]) => Promise<{
|
|
22
|
+
pathsByCollection: Record<string, string[]>;
|
|
23
|
+
nonCollectionPaths: string[];
|
|
24
|
+
collections: Record<string, Collection<true>>;
|
|
25
|
+
}>;
|
|
26
|
+
/** TODO help needed with name of this function **/
|
|
27
|
+
export declare const transformDocument: <T extends object>(filepath: string, contentObject: any, tinaSchema: TinaSchema) => T;
|
|
28
|
+
export declare function hasOwnProperty<X extends {}, Y extends PropertyKey>(obj: X, prop: Y): obj is X & Record<Y, unknown>;
|
|
29
|
+
export declare const getTemplateForFile: (templateInfo: CollectionTemplateable, data: {
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
}) => import("@tinacms/schema-tools").Template<true>;
|
|
32
|
+
/** TODO help needed with name of this function **/
|
|
33
|
+
export declare const loadAndParseWithAliases: (bridge: Bridge, filepath: string, collection?: Collection<true>, templateInfo?: CollectionTemplateable) => Promise<object>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { Schema, Collection, Template as TinaTemplate } from '@tinacms/schema-tools';
|
|
2
2
|
import { buildDotTinaFiles } from './build';
|
|
3
3
|
export { resolve } from './resolve';
|
|
4
|
+
export { transformDocumentIntoPayload } from './resolver';
|
|
4
5
|
export * from './resolver/error';
|
|
5
6
|
export { createDatabase } from './database';
|
|
6
7
|
export { TinaLevelClient } from './level/tinaLevel';
|
|
7
8
|
export type { QueryOptions, Database, OnDeleteCallback, OnPutCallback, CreateDatabase, } from './database';
|
|
8
9
|
import type { Config } from '@tinacms/schema-tools';
|
|
9
10
|
export { sequential, assertShape } from './util';
|
|
10
|
-
export { stringifyFile, parseFile } from './database/util';
|
|
11
|
+
export { loadAndParseWithAliases, stringifyFile, parseFile, scanAllContent, scanContentByPaths, transformDocument, } from './database/util';
|
|
11
12
|
export { createSchema } from './schema/createSchema';
|
|
12
13
|
export { buildDotTinaFiles };
|
|
13
14
|
export declare type DummyType = unknown;
|