@tinacms/graphql 0.57.2 → 0.59.1
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/CHANGELOG.md +39 -0
- package/dist/{primitives/ast-builder → ast-builder}/index.d.ts +0 -0
- package/dist/{primitives/build.d.ts → build.d.ts} +5 -3
- package/dist/{primitives/builder → builder}/index.d.ts +5 -11
- package/dist/{primitives/builder → builder}/static-definitions.d.ts +0 -0
- package/dist/{primitives/database/bridge.d.ts → database/bridge/filesystem.d.ts} +3 -5
- package/dist/{primitives/database → database/bridge}/github.d.ts +3 -1
- package/dist/database/bridge/index.d.ts +23 -0
- package/dist/{primitives/database → database}/index.d.ts +26 -16
- package/dist/database/store/filesystem.d.ts +28 -0
- package/dist/database/store/github.d.ts +37 -0
- package/dist/database/store/index.d.ts +74 -0
- package/dist/database/store/level.d.ts +29 -0
- package/dist/database/store/memory.d.ts +33 -0
- package/dist/database/util.d.ts +16 -0
- package/dist/index.d.ts +13 -4
- package/dist/index.js +1807 -867
- package/dist/{primitives/mdx → mdx}/index.d.ts +0 -0
- package/dist/{primitives/mdx → mdx}/parse.d.ts +0 -0
- package/dist/{primitives/mdx → mdx}/stringify.d.ts +0 -0
- package/dist/{primitives/resolve.d.ts → resolve.d.ts} +0 -0
- package/dist/{primitives/resolver → resolver}/error.d.ts +12 -0
- package/dist/{primitives/resolver → resolver}/index.d.ts +3 -34
- package/dist/{primitives/schema → schema}/index.d.ts +24 -3
- package/dist/{primitives/schema → schema}/validate.d.ts +0 -0
- package/dist/sdkBuilder/index.d.ts +1 -1
- package/dist/{primitives/spec → spec}/setup.d.ts +24 -30
- package/dist/{primitives/types.d.ts → types.d.ts} +1 -0
- package/dist/{primitives/util.d.ts → util.d.ts} +0 -0
- package/package.json +13 -8
- package/dist/primitives/index.d.ts +0 -40
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Copyright 2021 Forestry.io Holdings, Inc.
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
See the License for the specific language governing permissions and
|
|
11
|
+
limitations under the License.
|
|
12
|
+
*/
|
|
1
13
|
import { ASTNode, GraphQLError, Source, SourceLocation } from 'graphql';
|
|
2
14
|
export declare class TinaError extends Error implements GraphQLError {
|
|
3
15
|
extensions: Record<string, any>;
|
|
@@ -242,44 +242,13 @@ export declare class Resolver {
|
|
|
242
242
|
};
|
|
243
243
|
}[];
|
|
244
244
|
}>;
|
|
245
|
+
getDocumentsForCollection: (collectionName: string) => Promise<string[]>;
|
|
245
246
|
resolveCollectionConnection: ({ args, lookup, }: {
|
|
246
247
|
args: Record<string, Record<string, object>>;
|
|
247
248
|
lookup: CollectionDocumentListLookup;
|
|
248
249
|
}) => Promise<{
|
|
249
|
-
totalCount:
|
|
250
|
-
edges:
|
|
251
|
-
node: {
|
|
252
|
-
__typename: string;
|
|
253
|
-
id: string;
|
|
254
|
-
sys: {
|
|
255
|
-
basename: string;
|
|
256
|
-
filename: string;
|
|
257
|
-
extension: string;
|
|
258
|
-
path: string;
|
|
259
|
-
relativePath: string;
|
|
260
|
-
breadcrumbs: string[];
|
|
261
|
-
collection: TinaCloudCollection<true>;
|
|
262
|
-
template: string | number;
|
|
263
|
-
};
|
|
264
|
-
data: {
|
|
265
|
-
_collection: string;
|
|
266
|
-
_template: string;
|
|
267
|
-
};
|
|
268
|
-
values: {
|
|
269
|
-
_collection: string;
|
|
270
|
-
_template: string;
|
|
271
|
-
};
|
|
272
|
-
dataJSON: {
|
|
273
|
-
_collection: string;
|
|
274
|
-
_template: string;
|
|
275
|
-
};
|
|
276
|
-
form: {
|
|
277
|
-
label: string;
|
|
278
|
-
name: string;
|
|
279
|
-
fields: unknown[];
|
|
280
|
-
};
|
|
281
|
-
};
|
|
282
|
-
}[];
|
|
250
|
+
totalCount: any;
|
|
251
|
+
edges: any;
|
|
283
252
|
}>;
|
|
284
253
|
private buildFieldMutations;
|
|
285
254
|
private resolveFieldData;
|
|
@@ -11,18 +11,38 @@ See the License for the specific language governing permissions and
|
|
|
11
11
|
limitations under the License.
|
|
12
12
|
*/
|
|
13
13
|
import type { CollectionTemplateable, Collectable, TinaCloudSchemaEnriched, TinaCloudSchemaBase, Templateable, TinaCloudCollection } from '../types';
|
|
14
|
-
export declare const createSchema: ({ schema, }: {
|
|
14
|
+
export declare const createSchema: ({ schema, flags, }: {
|
|
15
15
|
schema: TinaCloudSchemaBase;
|
|
16
|
+
flags?: string[];
|
|
16
17
|
}) => Promise<TinaSchema>;
|
|
18
|
+
declare type Version = {
|
|
19
|
+
fullVersion: string;
|
|
20
|
+
major: string;
|
|
21
|
+
minor: string;
|
|
22
|
+
patch: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Metadata about how the schema was built
|
|
26
|
+
*/
|
|
27
|
+
declare type Meta = {
|
|
28
|
+
flags?: string[];
|
|
29
|
+
};
|
|
17
30
|
/**
|
|
18
31
|
* TinaSchema is responsible for allowing you to look up certain
|
|
19
32
|
* properties of the user-provided schema with ease.
|
|
20
33
|
*/
|
|
21
34
|
export declare class TinaSchema {
|
|
22
|
-
config:
|
|
35
|
+
config: {
|
|
36
|
+
version?: Version;
|
|
37
|
+
meta?: Meta;
|
|
38
|
+
} & TinaCloudSchemaBase;
|
|
23
39
|
schema: TinaCloudSchemaEnriched;
|
|
24
|
-
constructor(config:
|
|
40
|
+
constructor(config: {
|
|
41
|
+
version?: Version;
|
|
42
|
+
meta?: Meta;
|
|
43
|
+
} & TinaCloudSchemaBase);
|
|
25
44
|
getCollectionsByName: (collectionNames: string[]) => TinaCloudCollection<true>[];
|
|
45
|
+
getAllCollectionPaths: () => string[];
|
|
26
46
|
getCollection: (collectionName: string) => TinaCloudCollection<true>;
|
|
27
47
|
getCollections: () => TinaCloudCollection<true>[];
|
|
28
48
|
getGlobalTemplate: (templateName: string) => {
|
|
@@ -55,3 +75,4 @@ export declare class TinaSchema {
|
|
|
55
75
|
*/
|
|
56
76
|
getTemplatesForCollectable: (collection: Collectable) => CollectionTemplateable;
|
|
57
77
|
}
|
|
78
|
+
export {};
|
|
File without changes
|
|
@@ -10,5 +10,5 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
10
10
|
See the License for the specific language governing permissions and
|
|
11
11
|
limitations under the License.
|
|
12
12
|
*/
|
|
13
|
-
import type { TinaSchema } from '../
|
|
13
|
+
import type { TinaSchema } from '../schema';
|
|
14
14
|
export declare const buildSKD: (tinaSchema: TinaSchema) => string;
|
|
@@ -10,38 +10,32 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
10
10
|
See the License for the specific language governing permissions and
|
|
11
11
|
limitations under the License.
|
|
12
12
|
*/
|
|
13
|
-
import type { TinaCloudSchema } from '../types';
|
|
14
13
|
import { Database } from '../database';
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
private mockFileSystem;
|
|
19
|
-
constructor(rootPath: string);
|
|
20
|
-
glob(pattern: string): Promise<string[]>;
|
|
21
|
-
get(filepath: string): Promise<string>;
|
|
22
|
-
put(filepath: string, data: string): Promise<void>;
|
|
23
|
-
getMockData: () => Promise<{
|
|
24
|
-
[filepath: string]: string;
|
|
25
|
-
}>;
|
|
26
|
-
}
|
|
27
|
-
export declare const setup: (rootPath: string, schema: TinaCloudSchema<false>, updateSnapshot?: boolean) => Promise<{
|
|
14
|
+
import type { Store } from '../database/store';
|
|
15
|
+
import type { TinaCloudSchema } from '../types';
|
|
16
|
+
export declare const setup: (rootPath: string, schema: TinaCloudSchema<false>, store: Store) => Promise<{
|
|
28
17
|
database: Database;
|
|
29
|
-
schemaString: string;
|
|
30
|
-
expectedSchemaString: string;
|
|
31
|
-
}>;
|
|
32
|
-
export declare const setupFixture: (rootPath: string, schema: TinaCloudSchema<false>, fixture: string) => Promise<{
|
|
33
|
-
response: import("graphql").ExecutionResult<{
|
|
34
|
-
[key: string]: any;
|
|
35
|
-
}, {
|
|
36
|
-
[key: string]: any;
|
|
37
|
-
}>;
|
|
38
|
-
expectedReponse: string;
|
|
39
|
-
expectedReponsePath: string;
|
|
40
18
|
}>;
|
|
41
|
-
export declare const
|
|
19
|
+
export declare const print: (fixture: Fixture) => string;
|
|
20
|
+
export declare type Fixture = {
|
|
21
|
+
description?: string;
|
|
42
22
|
name: string;
|
|
43
|
-
assert: 'output'
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
23
|
+
assert: 'output';
|
|
24
|
+
message?: string;
|
|
25
|
+
expectError?: boolean;
|
|
26
|
+
} | {
|
|
27
|
+
description?: string;
|
|
28
|
+
name: string;
|
|
29
|
+
assert: 'file';
|
|
30
|
+
filename: string;
|
|
31
|
+
message?: string;
|
|
32
|
+
expectError?: boolean;
|
|
33
|
+
};
|
|
34
|
+
export declare const setupFixture: (rootPath: string, schema: TinaCloudSchema<false>, store: Store, fixture: Fixture, suffix?: string, queryName?: string, folder?: string) => Promise<{
|
|
35
|
+
responses: string[];
|
|
36
|
+
expectedResponsePaths: string[];
|
|
37
|
+
}>;
|
|
38
|
+
export declare const setupFixture2: (rootPath: string, schema: TinaCloudSchema<false>, store: Store, fixture: Fixture, suffix?: string, queryName?: string, folder?: string) => Promise<{
|
|
39
|
+
responses: string[];
|
|
40
|
+
expectedResponsePaths: string[];
|
|
47
41
|
}>;
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/graphql",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.59.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
7
|
-
"
|
|
8
|
-
"
|
|
7
|
+
"package.json",
|
|
8
|
+
"dist"
|
|
9
9
|
],
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"buildConfig": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
]
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
|
-
"types": "yarn tsc
|
|
41
|
+
"types": "yarn tsc",
|
|
42
42
|
"build": "echo \"Run `yarn build` from the root of the repository instead\"",
|
|
43
43
|
"docs": "yarn typedoc",
|
|
44
44
|
"serve": "yarn nodemon dist/server.js",
|
|
@@ -48,28 +48,30 @@
|
|
|
48
48
|
"@octokit/auth-app": "^2.6.0",
|
|
49
49
|
"@octokit/graphql": "^4.5.6",
|
|
50
50
|
"@octokit/rest": "18.0.6",
|
|
51
|
-
"@types/estree": "^0.0.50",
|
|
52
|
-
"@types/mdast": "^3.0.10",
|
|
53
|
-
"@types/node": "^16.9.1",
|
|
54
51
|
"body-parser": "^1.19.0",
|
|
55
52
|
"cors": "^2.8.5",
|
|
56
53
|
"dataloader": "^2.0.0",
|
|
57
54
|
"date-fns": "^2.21.1",
|
|
55
|
+
"encoding-down": "^7.1.0",
|
|
58
56
|
"esbuild": "^0.12.25",
|
|
59
57
|
"esbuild-jest": "^0.5.0",
|
|
60
58
|
"estree-walker": "^3.0.0",
|
|
61
59
|
"fast-glob": "^3.2.5",
|
|
60
|
+
"flat": "^5.0.2",
|
|
62
61
|
"fs-extra": "^9.0.1",
|
|
63
62
|
"graphql": "^15.3.0",
|
|
64
63
|
"graphql-type-json": "^0.3.2",
|
|
65
64
|
"gray-matter": "^4.0.2",
|
|
66
65
|
"js-yaml": "^3.14.0",
|
|
66
|
+
"level": "^7.0.1",
|
|
67
|
+
"levelup": "^5.1.1",
|
|
67
68
|
"lodash": "^4.17.20",
|
|
68
69
|
"mdast": "^3.0.0",
|
|
69
70
|
"mdast-util-from-markdown": "^1.0.0",
|
|
70
71
|
"mdast-util-mdx": "^1.1.0",
|
|
71
72
|
"mdast-util-mdx-expression": "^1.1.0",
|
|
72
73
|
"mdast-util-to-markdown": "^1.2.1",
|
|
74
|
+
"memdown": "^6.1.1",
|
|
73
75
|
"micromark-extension-mdxjs": "^1.0.0",
|
|
74
76
|
"mocha": "^9.1.1",
|
|
75
77
|
"normalize-path": "^3.0.0",
|
|
@@ -83,7 +85,6 @@
|
|
|
83
85
|
"remark-rehype": "^8.0.0",
|
|
84
86
|
"remark-slate": "^1.8.0",
|
|
85
87
|
"remark-stringify": "^8.1.1",
|
|
86
|
-
"tslib": "^1.11.1",
|
|
87
88
|
"unified": "^10.1.0",
|
|
88
89
|
"unist-util-remove-position": "^3.0.0",
|
|
89
90
|
"unist-util-visit": "^4.0.0",
|
|
@@ -101,14 +102,18 @@
|
|
|
101
102
|
"devDependencies": {
|
|
102
103
|
"@tinacms/scripts": "0.50.4",
|
|
103
104
|
"@types/cors": "^2.8.7",
|
|
105
|
+
"@types/estree": "^0.0.50",
|
|
104
106
|
"@types/express": "^4.17.8",
|
|
105
107
|
"@types/fs-extra": "^9.0.2",
|
|
106
108
|
"@types/jest": "^26.0.4",
|
|
107
109
|
"@types/js-yaml": "^3.12.5",
|
|
110
|
+
"@types/level": "^6.0.0",
|
|
108
111
|
"@types/lodash": "^4.14.161",
|
|
109
112
|
"@types/lodash.camelcase": "^4.3.6",
|
|
110
113
|
"@types/lodash.upperfirst": "^4.3.6",
|
|
111
114
|
"@types/lru-cache": "^5.1.0",
|
|
115
|
+
"@types/mdast": "^3.0.10",
|
|
116
|
+
"@types/node": "^14.17.34",
|
|
112
117
|
"@types/normalize-path": "^3.0.0",
|
|
113
118
|
"@types/ws": "^7.2.6",
|
|
114
119
|
"@types/yup": "^0.29.7",
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
Copyright 2021 Forestry.io Holdings, Inc.
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
12
|
-
*/
|
|
13
|
-
import { indexDB } from './build';
|
|
14
|
-
import { resolve } from './resolve';
|
|
15
|
-
import { createDatabase } from './database';
|
|
16
|
-
export { createDatabase, resolve, indexDB };
|
|
17
|
-
export type { TinaCloudSchema } from './types';
|
|
18
|
-
export declare const gql: ({ rootPath, query, variables, }: {
|
|
19
|
-
rootPath: string;
|
|
20
|
-
query: string;
|
|
21
|
-
variables: object;
|
|
22
|
-
}) => Promise<import("graphql").ExecutionResult<{
|
|
23
|
-
[key: string]: any;
|
|
24
|
-
}, {
|
|
25
|
-
[key: string]: any;
|
|
26
|
-
}>>;
|
|
27
|
-
export declare const githubRoute: ({ rootPath, query, variables, branch, ...githubArgs }: {
|
|
28
|
-
accessToken: string;
|
|
29
|
-
owner: string;
|
|
30
|
-
repo: string;
|
|
31
|
-
query: string;
|
|
32
|
-
variables: object;
|
|
33
|
-
rootPath?: string;
|
|
34
|
-
branch: string;
|
|
35
|
-
}) => Promise<import("graphql").ExecutionResult<{
|
|
36
|
-
[key: string]: any;
|
|
37
|
-
}, {
|
|
38
|
-
[key: string]: any;
|
|
39
|
-
}>>;
|
|
40
|
-
export declare const buildSchema: (rootPath: string) => Promise<import("graphql").GraphQLSchema>;
|