@tinacms/graphql 0.60.5 → 0.60.8
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 +32 -0
- package/dist/ast-builder/index.d.ts +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +573 -212
- package/dist/mdx/parse.d.ts +5 -4
- package/dist/mdx/stringify.d.ts +4 -3
- package/dist/resolve.d.ts +2 -1
- package/dist/resolver/error.d.ts +30 -1
- package/dist/resolver/media-utils.d.ts +30 -0
- package/package.json +4 -6
package/dist/mdx/parse.d.ts
CHANGED
|
@@ -16,8 +16,9 @@ limitations under the License.
|
|
|
16
16
|
|
|
17
17
|
*/
|
|
18
18
|
import type { Content } from 'mdast';
|
|
19
|
-
import type { RichTypeInner } from '../types';
|
|
20
|
-
|
|
19
|
+
import type { GraphQLConfig, RichTypeInner } from '../types';
|
|
20
|
+
import type { TinaCloudSchemaEnriched } from '@tinacms/schema-tools';
|
|
21
|
+
export declare const parseMDX: (value: string, field: RichTypeInner, graphQLconfig: GraphQLConfig, schema: TinaCloudSchemaEnriched) => {
|
|
21
22
|
type: string;
|
|
22
23
|
children: any;
|
|
23
24
|
};
|
|
@@ -70,7 +71,7 @@ export declare const parseMDX: (value: string, field: RichTypeInner) => {
|
|
|
70
71
|
* 2. We don't need to do any client-side parsing. Since TinaMarkdown and the slate editor work with the same
|
|
71
72
|
* format we can just allow Tina to do it's thing and update the form valuse with no additional work.
|
|
72
73
|
*/
|
|
73
|
-
export declare const parseMDXInner: (tree: any, field: RichTypeInner) => {
|
|
74
|
+
export declare const parseMDXInner: (tree: any, field: RichTypeInner, graphQLconfig: GraphQLConfig, schema: TinaCloudSchemaEnriched) => {
|
|
74
75
|
type: string;
|
|
75
76
|
children: any;
|
|
76
77
|
};
|
|
@@ -226,5 +227,5 @@ export declare const plateElements: {
|
|
|
226
227
|
MARK_UNDERLINE: string;
|
|
227
228
|
};
|
|
228
229
|
export declare const defaultNodeTypes: NodeTypes;
|
|
229
|
-
export default function remarkToSlate(node: MdxAstNode): any;
|
|
230
|
+
export default function remarkToSlate(node: MdxAstNode, graphQLconfig: GraphQLConfig, schema: TinaCloudSchemaEnriched): any;
|
|
230
231
|
export {};
|
package/dist/mdx/stringify.d.ts
CHANGED
|
@@ -15,10 +15,11 @@ See the License for the specific language governing permissions and
|
|
|
15
15
|
limitations under the License.
|
|
16
16
|
|
|
17
17
|
*/
|
|
18
|
-
import type { RichTypeInner } from '../types';
|
|
18
|
+
import type { GraphQLConfig, RichTypeInner } from '../types';
|
|
19
|
+
import type { TinaCloudSchemaEnriched } from '@tinacms/schema-tools';
|
|
19
20
|
import { plateElements } from './parse';
|
|
20
21
|
import type { Content } from 'mdast';
|
|
21
|
-
export declare const stringifyMDX: (value: unknown, field: RichTypeInner) => string;
|
|
22
|
+
export declare const stringifyMDX: (value: unknown, field: RichTypeInner, graphQLconfig: GraphQLConfig, schema: TinaCloudSchemaEnriched) => string;
|
|
22
23
|
export declare const stringify: (node: {
|
|
23
24
|
type: typeof plateElements;
|
|
24
|
-
}, field: RichTypeInner) => Content;
|
|
25
|
+
}, field: RichTypeInner, graphQLconfig: GraphQLConfig, schema: TinaCloudSchemaEnriched) => Content;
|
package/dist/resolve.d.ts
CHANGED
|
@@ -12,12 +12,13 @@ limitations under the License.
|
|
|
12
12
|
*/
|
|
13
13
|
import type { Database } from './database';
|
|
14
14
|
import type { GraphQLConfig } from './types';
|
|
15
|
-
export declare const resolve: ({ config, query, variables, database, silenceErrors, }: {
|
|
15
|
+
export declare const resolve: ({ config, query, variables, database, silenceErrors, verbose, }: {
|
|
16
16
|
config?: GraphQLConfig;
|
|
17
17
|
query: string;
|
|
18
18
|
variables: object;
|
|
19
19
|
database: Database;
|
|
20
20
|
silenceErrors?: boolean;
|
|
21
|
+
verbose?: boolean;
|
|
21
22
|
}) => Promise<import("graphql").ExecutionResult<{
|
|
22
23
|
[key: string]: any;
|
|
23
24
|
}, {
|
package/dist/resolver/error.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ See the License for the specific language governing permissions and
|
|
|
11
11
|
limitations under the License.
|
|
12
12
|
*/
|
|
13
13
|
import { ASTNode, GraphQLError, Source, SourceLocation } from 'graphql';
|
|
14
|
-
export declare class
|
|
14
|
+
export declare class TinaGraphQLError extends Error implements GraphQLError {
|
|
15
15
|
extensions: Record<string, any>;
|
|
16
16
|
readonly name: string;
|
|
17
17
|
readonly locations: ReadonlyArray<SourceLocation> | undefined;
|
|
@@ -23,3 +23,32 @@ export declare class TinaError extends Error implements GraphQLError {
|
|
|
23
23
|
[key: string]: any;
|
|
24
24
|
constructor(message: string, extensions?: Record<string, any>);
|
|
25
25
|
}
|
|
26
|
+
export declare type TypeFetchErrorArgs = {
|
|
27
|
+
stack?: string;
|
|
28
|
+
file?: string;
|
|
29
|
+
originalError: Error;
|
|
30
|
+
collection?: string;
|
|
31
|
+
};
|
|
32
|
+
export declare class TinaFetchError extends Error {
|
|
33
|
+
stack?: string;
|
|
34
|
+
collection?: string;
|
|
35
|
+
file?: string;
|
|
36
|
+
originalError: Error;
|
|
37
|
+
constructor(message: string, args: TypeFetchErrorArgs);
|
|
38
|
+
}
|
|
39
|
+
export declare class TinaQueryError extends TinaFetchError {
|
|
40
|
+
stack?: string;
|
|
41
|
+
collection?: string;
|
|
42
|
+
file?: string;
|
|
43
|
+
originalError: Error;
|
|
44
|
+
constructor(args: TypeFetchErrorArgs);
|
|
45
|
+
}
|
|
46
|
+
export declare class TinaParseDocumentError extends TinaFetchError {
|
|
47
|
+
stack?: string;
|
|
48
|
+
collection?: string;
|
|
49
|
+
file?: string;
|
|
50
|
+
originalError: Error;
|
|
51
|
+
constructor(args: TypeFetchErrorArgs);
|
|
52
|
+
toString(): string;
|
|
53
|
+
}
|
|
54
|
+
export declare const handleFetchErrorError: (e: unknown, verbose: any) => never;
|
|
@@ -0,0 +1,30 @@
|
|
|
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 { GraphQLConfig } from '../types';
|
|
14
|
+
import type { TinaCloudSchemaEnriched } from '@tinacms/schema-tools';
|
|
15
|
+
/**
|
|
16
|
+
* Strips away the Tina Cloud Asset URL from an `image` value
|
|
17
|
+
*
|
|
18
|
+
* @param {string} value
|
|
19
|
+
* @param {GraphQLConfig} config
|
|
20
|
+
* @returns {string}
|
|
21
|
+
*/
|
|
22
|
+
export declare const resolveMediaCloudToRelative: (value: string, config: GraphQLConfig, schema: TinaCloudSchemaEnriched) => string;
|
|
23
|
+
/**
|
|
24
|
+
* Adds Tina Cloud Asset URL to an `image` value
|
|
25
|
+
*
|
|
26
|
+
* @param {string} value
|
|
27
|
+
* @param {GraphQLConfig} config
|
|
28
|
+
* @returns {string}
|
|
29
|
+
*/
|
|
30
|
+
export declare const resolveMediaRelativeToCloud: (value: string, config: GraphQLConfig, schema: TinaCloudSchemaEnriched) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/graphql",
|
|
3
|
-
"version": "0.60.
|
|
3
|
+
"version": "0.60.8",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@graphql-tools/relay-operation-optimizer": "^6.4.1",
|
|
50
50
|
"@tinacms/datalayer": "0.1.1",
|
|
51
|
+
"@tinacms/schema-tools": "0.0.5",
|
|
51
52
|
"body-parser": "^1.19.0",
|
|
52
53
|
"cors": "^2.8.5",
|
|
53
54
|
"dataloader": "^2.0.0",
|
|
@@ -98,8 +99,8 @@
|
|
|
98
99
|
},
|
|
99
100
|
"devDependencies": {
|
|
100
101
|
"@tinacms/datalayer": "0.1.1",
|
|
101
|
-
"@tinacms/schema-tools": "0.0.
|
|
102
|
-
"@tinacms/scripts": "0.50.
|
|
102
|
+
"@tinacms/schema-tools": "0.0.5",
|
|
103
|
+
"@tinacms/scripts": "0.50.8",
|
|
103
104
|
"@types/cors": "^2.8.7",
|
|
104
105
|
"@types/estree": "^0.0.50",
|
|
105
106
|
"@types/express": "^4.17.8",
|
|
@@ -121,8 +122,5 @@
|
|
|
121
122
|
"jest-matcher-utils": "27.0.6",
|
|
122
123
|
"nodemon": "^2.0.4",
|
|
123
124
|
"typescript": "^4.3.5"
|
|
124
|
-
},
|
|
125
|
-
"peerDependencies": {
|
|
126
|
-
"@tinacms/schema-tools": "*"
|
|
127
125
|
}
|
|
128
126
|
}
|