@tinacms/graphql 1.0.5 → 1.2.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.
@@ -0,0 +1,26 @@
1
+ /**
2
+
3
+ */
4
+ import { ManyLevelGuest } from 'many-level';
5
+ export declare class TinaLevelClient extends ManyLevelGuest<string, Record<string, any>> {
6
+ private _connected;
7
+ openConnection(): void;
8
+ }
9
+ export interface Bridge {
10
+ rootPath: string;
11
+ glob(pattern: string, extension: string): Promise<string[]>;
12
+ get(filepath: string): Promise<string>;
13
+ put(filepath: string, data: string): Promise<void>;
14
+ delete(filepath: string): Promise<void>;
15
+ /**
16
+ * Whether this bridge supports the ability to build the schema.
17
+ */
18
+ supportsBuilding(): boolean;
19
+ putConfig(filepath: string, data: string): Promise<void>;
20
+ /**
21
+ * Optionally, the bridge can perform
22
+ * operations in a separate path.
23
+ */
24
+ outputPath?: string;
25
+ addOutputPath?(outputPath: string): void;
26
+ }
@@ -1,18 +1,6 @@
1
1
  /**
2
2
 
3
- Copyright 2021 Forestry.io Holdings, Inc.
4
3
 
5
- Licensed under the Apache License, Version 2.0 (the "License");
6
- you may not use this file except in compliance with the License.
7
- You may obtain a copy of the License at
8
-
9
- http://www.apache.org/licenses/LICENSE-2.0
10
-
11
- Unless required by applicable law or agreed to in writing, software
12
- distributed under the License is distributed on an "AS IS" BASIS,
13
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- See the License for the specific language governing permissions and
15
- limitations under the License.
16
4
 
17
5
  */
18
6
  import { parseMDX, stringifyMDX } from '@tinacms/mdx';
@@ -1,18 +1,6 @@
1
1
  /**
2
2
 
3
- Copyright 2021 Forestry.io Holdings, Inc.
4
3
 
5
- Licensed under the Apache License, Version 2.0 (the "License");
6
- you may not use this file except in compliance with the License.
7
- You may obtain a copy of the License at
8
-
9
- http://www.apache.org/licenses/LICENSE-2.0
10
-
11
- Unless required by applicable law or agreed to in writing, software
12
- distributed under the License is distributed on an "AS IS" BASIS,
13
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- See the License for the specific language governing permissions and
15
- limitations under the License.
16
4
 
17
5
  */
18
6
  import type { RichTypeInner } from '@tinacms/schema-tools';
@@ -1,18 +1,6 @@
1
1
  /**
2
2
 
3
- Copyright 2021 Forestry.io Holdings, Inc.
4
3
 
5
- Licensed under the Apache License, Version 2.0 (the "License");
6
- you may not use this file except in compliance with the License.
7
- You may obtain a copy of the License at
8
-
9
- http://www.apache.org/licenses/LICENSE-2.0
10
-
11
- Unless required by applicable law or agreed to in writing, software
12
- distributed under the License is distributed on an "AS IS" BASIS,
13
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- See the License for the specific language governing permissions and
15
- limitations under the License.
16
4
 
17
5
  */
18
6
  import type { GraphQLConfig } from '../types';
package/dist/resolve.d.ts CHANGED
@@ -1,14 +1,5 @@
1
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.
2
+
12
3
  */
13
4
  import type { GraphQLConfig } from './types';
14
5
  import type { Database } from './database';
@@ -1,14 +1,5 @@
1
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.
2
+
12
3
  */
13
4
  import { ASTNode, GraphQLError, Source, SourceLocation } from 'graphql';
14
5
  export declare class TinaGraphQLError extends Error implements GraphQLError {
@@ -1,17 +1,8 @@
1
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.
2
+
12
3
  */
13
4
  import type { ReferenceTypeInner, TinaFieldInner } from '@tinacms/schema-tools';
14
- import type { FilterCondition } from '@tinacms/datalayer';
5
+ import { FilterCondition } from '../database/datalayer';
15
6
  export declare type ReferenceResolver = (filter: Record<string, object>, fieldDefinition: ReferenceTypeInner) => Promise<{
16
7
  edges: {
17
8
  node: any;
@@ -1,14 +1,5 @@
1
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.
2
+
12
3
  */
13
4
  import { Database } from '../database';
14
5
  import type { Collectable, ReferenceTypeWithNamespace, TinaCloudCollection, TinaFieldInner, TinaSchema } from '@tinacms/schema-tools';
@@ -168,7 +159,7 @@ export declare class Resolver {
168
159
  __typename: string;
169
160
  id: string;
170
161
  }>;
171
- resolveDocument: ({ args, collection: collectionName, isMutation, isCreation, isDeletion, isAddPendingDocument, isCollectionSpecific, }: {
162
+ resolveDocument: ({ args, collection: collectionName, isMutation, isCreation, isDeletion, isAddPendingDocument, isCollectionSpecific, isUpdateName, }: {
172
163
  args: unknown;
173
164
  collection?: string;
174
165
  isMutation: boolean;
@@ -176,6 +167,7 @@ export declare class Resolver {
176
167
  isDeletion?: boolean;
177
168
  isAddPendingDocument?: boolean;
178
169
  isCollectionSpecific?: boolean;
170
+ isUpdateName?: boolean;
179
171
  }) => Promise<{
180
172
  _sys: {
181
173
  title: any;
@@ -1,14 +1,5 @@
1
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.
2
+
12
3
  */
13
4
  import type { GraphQLConfig } from '../types';
14
5
  import type { TinaCloudSchemaEnriched } from '@tinacms/schema-tools';
@@ -1,14 +1,5 @@
1
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.
2
+
12
3
  */
13
4
  import { TinaSchema, TinaCloudSchemaBase } from '@tinacms/schema-tools';
14
5
  export declare const createSchema: ({ schema, flags, }: {
@@ -1,14 +1,5 @@
1
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.
2
+
12
3
  */
13
4
  import { TinaCloudSchemaBase } from '@tinacms/schema-tools';
14
5
  export declare const validateSchema: (schema: TinaCloudSchemaBase) => Promise<TinaCloudSchemaBase>;
@@ -1,14 +1,5 @@
1
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.
2
+
12
3
  */
13
4
  import type { TinaSchema } from '@tinacms/schema-tools';
14
5
  export declare const buildSKD: (tinaSchema: TinaSchema) => string;
@@ -1,19 +1,10 @@
1
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.
2
+
12
3
  */
13
- import type { Store } from '@tinacms/datalayer';
14
4
  import type { TinaCloudSchema } from '@tinacms/schema-tools';
15
5
  import { Database } from '../database';
16
- export declare const setup: (rootPath: string, schema: TinaCloudSchema<false>, store: Store) => Promise<{
6
+ import { Level } from '../database/level';
7
+ export declare const setup: (rootPath: string, schema: TinaCloudSchema<false>, level: Level) => Promise<{
17
8
  database: Database;
18
9
  }>;
19
10
  export declare const print: (fixture: Fixture) => string;
@@ -31,11 +22,11 @@ export declare type Fixture = {
31
22
  message?: string;
32
23
  expectError?: boolean;
33
24
  };
34
- export declare const setupFixture: (rootPath: string, schema: TinaCloudSchema<false>, store: Store, fixture: Fixture, suffix?: string, queryName?: string, folder?: string) => Promise<{
25
+ export declare const setupFixture: (rootPath: string, schema: TinaCloudSchema<false>, level: Level, fixture: Fixture, suffix?: string, queryName?: string, folder?: string) => Promise<{
35
26
  responses: string[];
36
27
  expectedResponsePaths: string[];
37
28
  }>;
38
- export declare const setupFixture2: (rootPath: string, schema: TinaCloudSchema<false>, store: Store, fixture: Fixture, suffix?: string, queryName?: string, folder?: string) => Promise<{
29
+ export declare const setupFixture2: (rootPath: string, schema: TinaCloudSchema<false>, level: Level, fixture: Fixture, suffix?: string, queryName?: string, folder?: string) => Promise<{
39
30
  responses: string[];
40
31
  expectedResponsePaths: string[];
41
32
  }>;
package/dist/types.d.ts CHANGED
@@ -1,14 +1,5 @@
1
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.
2
+
12
3
  */
13
4
  export declare type GraphQLConfig = {
14
5
  useRelativeMedia: true;
package/dist/util.d.ts CHANGED
@@ -1,14 +1,5 @@
1
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.
2
+
12
3
  */
13
4
  import * as yup from 'yup';
14
5
  /**
package/package.json CHANGED
@@ -1,13 +1,18 @@
1
1
  {
2
2
  "name": "@tinacms/graphql",
3
- "version": "1.0.5",
3
+ "version": "1.2.0",
4
4
  "main": "dist/index.js",
5
+ "module": "dist/index.es.js",
5
6
  "typings": "dist/index.d.ts",
6
7
  "files": [
7
8
  "package.json",
8
9
  "dist"
9
10
  ],
10
- "license": "Apache-2.0",
11
+ "exports": {
12
+ "import": "./dist/index.es.js",
13
+ "require": "./dist/index.js"
14
+ },
15
+ "license": "SEE LICENSE IN LICENSE",
11
16
  "buildConfig": {
12
17
  "entryPoints": [
13
18
  {
@@ -20,9 +25,9 @@
20
25
  "dependencies": {
21
26
  "@graphql-tools/relay-operation-optimizer": "^6.4.1",
22
27
  "@iarna/toml": "^2.2.5",
23
- "@tinacms/datalayer": "1.0.0",
24
- "@tinacms/mdx": "1.1.0",
25
- "@tinacms/schema-tools": "1.2.0",
28
+ "@tinacms/mdx": "1.2.0",
29
+ "@tinacms/schema-tools": "1.3.0",
30
+ "abstract-level": "^1.0.3",
26
31
  "body-parser": "^1.19.0",
27
32
  "cors": "^2.8.5",
28
33
  "dataloader": "^2.0.0",
@@ -34,12 +39,16 @@
34
39
  "fast-glob": "^3.2.5",
35
40
  "flat": "^5.0.2",
36
41
  "fs-extra": "^9.0.1",
42
+ "glob-parent": "^6.0.2",
37
43
  "graphql": "15.8.0",
38
44
  "graphql-type-json": "^0.3.2",
39
45
  "gray-matter": "^4.0.2",
46
+ "isomorphic-git": "^1.21.0",
40
47
  "js-yaml": "^3.14.1",
48
+ "jsonpath-plus": "^6.0.1",
41
49
  "leveldown": "^6.1.0",
42
50
  "lodash": "^4.17.20",
51
+ "many-level": "^2.0.0",
43
52
  "mdast": "^3.0.0",
44
53
  "mdast-util-from-markdown": "^1.0.0",
45
54
  "mdast-util-mdx": "^1.1.0",
@@ -48,6 +57,7 @@
48
57
  "micromark-extension-mdxjs": "^1.0.0",
49
58
  "normalize-path": "^3.0.0",
50
59
  "prettier": "^2.2.1",
60
+ "readable-stream": "^4.3.0",
51
61
  "rehype-format": "^3.1.0",
52
62
  "rehype-stringify": "^8.0.0",
53
63
  "remark": "^13.0.0",
@@ -72,9 +82,8 @@
72
82
  "directory": "packages/tina-graphql"
73
83
  },
74
84
  "devDependencies": {
75
- "@tinacms/datalayer": "1.0.0",
76
- "@tinacms/schema-tools": "1.2.0",
77
- "@tinacms/scripts": "1.0.1",
85
+ "@tinacms/schema-tools": "1.3.0",
86
+ "@tinacms/scripts": "1.0.2",
78
87
  "@types/cors": "^2.8.7",
79
88
  "@types/estree": "^0.0.50",
80
89
  "@types/express": "^4.17.8",
@@ -94,6 +103,7 @@
94
103
  "jest-diff": "27.0.6",
95
104
  "jest-file-snapshot": "^0.5.0",
96
105
  "jest-matcher-utils": "27.0.6",
106
+ "memory-level": "^1.0.0",
97
107
  "nodemon": "2.0.19",
98
108
  "typescript": "4.3.5"
99
109
  },