@tinacms/graphql 0.56.1 → 0.58.0
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 +35 -0
- package/dist/{primitives/ast-builder → ast-builder}/index.d.ts +40 -1
- package/dist/build.d.ts +18 -0
- package/dist/{primitives/builder → builder}/index.d.ts +23 -2
- 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 +4 -23
- package/dist/database/bridge/index.d.ts +23 -0
- package/dist/{primitives/database → database}/index.d.ts +26 -16
- package/dist/{cache/lru.d.ts → database/store/filesystem.d.ts} +16 -14
- 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 -7
- package/dist/index.js +2055 -852
- 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 +1 -0
- package/dist/schema/validate.d.ts +14 -0
- package/dist/{primitives/build.d.ts → sdkBuilder/index.d.ts} +2 -4
- package/dist/{primitives/spec → spec}/setup.d.ts +24 -30
- package/dist/{primitives/types.d.ts → types.d.ts} +2 -1
- package/dist/{primitives/util.d.ts → util.d.ts} +0 -0
- package/package.json +14 -18
- package/dist/cache/s3.d.ts +0 -31
- package/dist/primitives/index.d.ts +0 -42
|
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;
|
|
@@ -23,6 +23,7 @@ export declare class TinaSchema {
|
|
|
23
23
|
schema: TinaCloudSchemaEnriched;
|
|
24
24
|
constructor(config: TinaCloudSchemaBase);
|
|
25
25
|
getCollectionsByName: (collectionNames: string[]) => TinaCloudCollection<true>[];
|
|
26
|
+
getAllCollectionPaths: () => string[];
|
|
26
27
|
getCollection: (collectionName: string) => TinaCloudCollection<true>;
|
|
27
28
|
getCollections: () => TinaCloudCollection<true>[];
|
|
28
29
|
getGlobalTemplate: (templateName: string) => {
|
|
@@ -0,0 +1,14 @@
|
|
|
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 type { TinaCloudSchemaBase } from '../types';
|
|
14
|
+
export declare const validateSchema: (schema: TinaCloudSchemaBase) => Promise<TinaCloudSchemaBase>;
|
|
@@ -10,7 +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
|
-
|
|
14
|
-
|
|
15
|
-
config: any;
|
|
16
|
-
}) => Promise<void>;
|
|
13
|
+
import type { TinaSchema } from '../schema';
|
|
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
|
}>;
|
|
@@ -215,7 +215,7 @@ export declare type TinaCloudTemplateEnriched = GlobalTemplate<true>;
|
|
|
215
215
|
/**
|
|
216
216
|
* Templates allow you to define an object as polymorphic
|
|
217
217
|
*/
|
|
218
|
-
declare type Template<WithNamespace extends boolean> = WithNamespace extends true ? {
|
|
218
|
+
export declare type Template<WithNamespace extends boolean> = WithNamespace extends true ? {
|
|
219
219
|
label: string;
|
|
220
220
|
name: string;
|
|
221
221
|
fields: TinaFieldInner<WithNamespace>[];
|
|
@@ -245,6 +245,7 @@ export declare type Collectable = {
|
|
|
245
245
|
references?: ReferenceType<true>[];
|
|
246
246
|
};
|
|
247
247
|
export declare type Templateable = {
|
|
248
|
+
name: string;
|
|
248
249
|
namespace: string[];
|
|
249
250
|
fields: TinaFieldEnriched[];
|
|
250
251
|
ui?: object;
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/graphql",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
7
|
-
"dist"
|
|
8
|
-
"src/fixtures/**/*"
|
|
7
|
+
"dist"
|
|
9
8
|
],
|
|
10
9
|
"license": "Apache-2.0",
|
|
11
10
|
"buildConfig": {
|
|
@@ -38,9 +37,8 @@
|
|
|
38
37
|
]
|
|
39
38
|
},
|
|
40
39
|
"scripts": {
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"types": "yarn tsc --project ./tsconfig.real.json",
|
|
40
|
+
"types": "yarn tsc",
|
|
41
|
+
"build": "echo \"Run `yarn build` from the root of the repository instead\"",
|
|
44
42
|
"docs": "yarn typedoc",
|
|
45
43
|
"serve": "yarn nodemon dist/server.js",
|
|
46
44
|
"test": "jest"
|
|
@@ -49,31 +47,30 @@
|
|
|
49
47
|
"@octokit/auth-app": "^2.6.0",
|
|
50
48
|
"@octokit/graphql": "^4.5.6",
|
|
51
49
|
"@octokit/rest": "18.0.6",
|
|
52
|
-
"@types/aws-sdk": "^2.7.0",
|
|
53
|
-
"@types/estree": "^0.0.50",
|
|
54
|
-
"@types/mdast": "^3.0.10",
|
|
55
|
-
"@types/node": "^16.9.1",
|
|
56
|
-
"aws-sdk": "^2.930.0",
|
|
57
50
|
"body-parser": "^1.19.0",
|
|
58
51
|
"cors": "^2.8.5",
|
|
59
52
|
"dataloader": "^2.0.0",
|
|
60
53
|
"date-fns": "^2.21.1",
|
|
54
|
+
"encoding-down": "^7.1.0",
|
|
61
55
|
"esbuild": "^0.12.25",
|
|
62
56
|
"esbuild-jest": "^0.5.0",
|
|
63
57
|
"estree-walker": "^3.0.0",
|
|
64
58
|
"fast-glob": "^3.2.5",
|
|
59
|
+
"flat": "^5.0.2",
|
|
65
60
|
"fs-extra": "^9.0.1",
|
|
66
61
|
"graphql": "^15.3.0",
|
|
67
62
|
"graphql-type-json": "^0.3.2",
|
|
68
63
|
"gray-matter": "^4.0.2",
|
|
69
64
|
"js-yaml": "^3.14.0",
|
|
65
|
+
"level": "^7.0.1",
|
|
66
|
+
"levelup": "^5.1.1",
|
|
70
67
|
"lodash": "^4.17.20",
|
|
71
|
-
"lru-cache": "^6.0.0",
|
|
72
68
|
"mdast": "^3.0.0",
|
|
73
69
|
"mdast-util-from-markdown": "^1.0.0",
|
|
74
70
|
"mdast-util-mdx": "^1.1.0",
|
|
75
71
|
"mdast-util-mdx-expression": "^1.1.0",
|
|
76
72
|
"mdast-util-to-markdown": "^1.2.1",
|
|
73
|
+
"memdown": "^6.1.1",
|
|
77
74
|
"micromark-extension-mdxjs": "^1.0.0",
|
|
78
75
|
"mocha": "^9.1.1",
|
|
79
76
|
"normalize-path": "^3.0.0",
|
|
@@ -87,7 +84,6 @@
|
|
|
87
84
|
"remark-rehype": "^8.0.0",
|
|
88
85
|
"remark-slate": "^1.8.0",
|
|
89
86
|
"remark-stringify": "^8.1.1",
|
|
90
|
-
"tslib": "^1.11.1",
|
|
91
87
|
"unified": "^10.1.0",
|
|
92
88
|
"unist-util-remove-position": "^3.0.0",
|
|
93
89
|
"unist-util-visit": "^4.0.0",
|
|
@@ -103,28 +99,28 @@
|
|
|
103
99
|
"directory": "packages/tina-graphql"
|
|
104
100
|
},
|
|
105
101
|
"devDependencies": {
|
|
106
|
-
"@
|
|
107
|
-
"@tinacms/scripts": "0.50.3",
|
|
102
|
+
"@tinacms/scripts": "0.50.4",
|
|
108
103
|
"@types/cors": "^2.8.7",
|
|
104
|
+
"@types/estree": "^0.0.50",
|
|
109
105
|
"@types/express": "^4.17.8",
|
|
110
106
|
"@types/fs-extra": "^9.0.2",
|
|
111
107
|
"@types/jest": "^26.0.4",
|
|
112
108
|
"@types/js-yaml": "^3.12.5",
|
|
109
|
+
"@types/level": "^6.0.0",
|
|
113
110
|
"@types/lodash": "^4.14.161",
|
|
114
111
|
"@types/lodash.camelcase": "^4.3.6",
|
|
115
112
|
"@types/lodash.upperfirst": "^4.3.6",
|
|
116
113
|
"@types/lru-cache": "^5.1.0",
|
|
114
|
+
"@types/mdast": "^3.0.10",
|
|
115
|
+
"@types/node": "^14.17.34",
|
|
117
116
|
"@types/normalize-path": "^3.0.0",
|
|
118
117
|
"@types/ws": "^7.2.6",
|
|
119
118
|
"@types/yup": "^0.29.7",
|
|
120
|
-
"graphql-tools": "^6.2.1",
|
|
121
119
|
"jest": "27.0.6",
|
|
122
120
|
"jest-diff": "27.0.6",
|
|
123
121
|
"jest-file-snapshot": "^0.5.0",
|
|
124
122
|
"jest-matcher-utils": "27.0.6",
|
|
125
123
|
"nodemon": "^2.0.4",
|
|
126
|
-
"ts-jest": "27.0.3",
|
|
127
|
-
"tsup": "4.12.5",
|
|
128
124
|
"typescript": "^4.3.5"
|
|
129
125
|
}
|
|
130
126
|
}
|
package/dist/cache/s3.d.ts
DELETED
|
@@ -1,31 +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 { S3 } from 'aws-sdk';
|
|
14
|
-
export declare const clearCacheWith: (cache: S3) => ({ owner, repo, ref, path, }: {
|
|
15
|
-
owner: string;
|
|
16
|
-
repo: string;
|
|
17
|
-
ref: string;
|
|
18
|
-
path?: string;
|
|
19
|
-
}) => Promise<void>;
|
|
20
|
-
export declare const s3CacheWith: (cache: S3) => {
|
|
21
|
-
get: (keyName: string, setter: () => Promise<any>) => Promise<any>;
|
|
22
|
-
};
|
|
23
|
-
export declare const clearCache: ({ owner, repo, ref, path, }: {
|
|
24
|
-
owner: string;
|
|
25
|
-
repo: string;
|
|
26
|
-
ref: string;
|
|
27
|
-
path?: string;
|
|
28
|
-
}) => Promise<void>;
|
|
29
|
-
export declare const s3Cache: {
|
|
30
|
-
get: (keyName: string, setter: () => Promise<any>) => Promise<any>;
|
|
31
|
-
};
|
|
@@ -1,42 +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 { simpleCache } from '../cache/lru';
|
|
16
|
-
import { createDatabase } from './database';
|
|
17
|
-
export { createDatabase, resolve, indexDB };
|
|
18
|
-
export type { TinaCloudSchema } from './types';
|
|
19
|
-
export declare const gql: ({ rootPath, query, variables, }: {
|
|
20
|
-
rootPath: string;
|
|
21
|
-
query: string;
|
|
22
|
-
variables: object;
|
|
23
|
-
}) => Promise<import("graphql").ExecutionResult<{
|
|
24
|
-
[key: string]: any;
|
|
25
|
-
}, {
|
|
26
|
-
[key: string]: any;
|
|
27
|
-
}>>;
|
|
28
|
-
export declare const githubRoute: ({ rootPath, query, variables, cacheType, branch, ...githubArgs }: {
|
|
29
|
-
accessToken: string;
|
|
30
|
-
owner: string;
|
|
31
|
-
repo: string;
|
|
32
|
-
query: string;
|
|
33
|
-
variables: object;
|
|
34
|
-
rootPath?: string;
|
|
35
|
-
branch: string;
|
|
36
|
-
cacheType?: typeof simpleCache;
|
|
37
|
-
}) => Promise<import("graphql").ExecutionResult<{
|
|
38
|
-
[key: string]: any;
|
|
39
|
-
}, {
|
|
40
|
-
[key: string]: any;
|
|
41
|
-
}>>;
|
|
42
|
-
export declare const buildSchema: (rootPath: string) => Promise<import("graphql").GraphQLSchema>;
|