@tinacms/graphql 0.58.2 → 0.59.4

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/resolve.d.ts CHANGED
@@ -11,10 +11,11 @@ See the License for the specific language governing permissions and
11
11
  limitations under the License.
12
12
  */
13
13
  import type { Database } from './database';
14
- export declare const resolve: ({ query, variables, database, }: {
14
+ export declare const resolve: ({ query, variables, database, silenceErrors, }: {
15
15
  query: string;
16
16
  variables: object;
17
17
  database: Database;
18
+ silenceErrors?: boolean;
18
19
  }) => Promise<import("graphql").ExecutionResult<{
19
20
  [key: string]: any;
20
21
  }, {
@@ -32,7 +32,7 @@ export declare class Resolver {
32
32
  templates?: undefined;
33
33
  references?: import("../types").ReferenceTypeWithNamespace[];
34
34
  namespace: string[];
35
- label: string;
35
+ label?: string;
36
36
  name: string;
37
37
  path: string;
38
38
  format?: "json" | "md" | "markdown" | "mdx";
@@ -49,7 +49,7 @@ export declare class Resolver {
49
49
  fields?: undefined;
50
50
  references?: import("../types").ReferenceTypeWithNamespace[];
51
51
  namespace: string[];
52
- label: string;
52
+ label?: string;
53
53
  name: string;
54
54
  path: string;
55
55
  format?: "json" | "md" | "markdown" | "mdx";
@@ -11,17 +11,36 @@ 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: TinaCloudSchemaBase;
35
+ config: {
36
+ version?: Version;
37
+ meta?: Meta;
38
+ } & TinaCloudSchemaBase;
23
39
  schema: TinaCloudSchemaEnriched;
24
- constructor(config: TinaCloudSchemaBase);
40
+ constructor(config: {
41
+ version?: Version;
42
+ meta?: Meta;
43
+ } & TinaCloudSchemaBase);
25
44
  getCollectionsByName: (collectionNames: string[]) => TinaCloudCollection<true>[];
26
45
  getAllCollectionPaths: () => string[];
27
46
  getCollection: (collectionName: string) => TinaCloudCollection<true>;
@@ -56,3 +75,4 @@ export declare class TinaSchema {
56
75
  */
57
76
  getTemplatesForCollectable: (collection: Collectable) => CollectionTemplateable;
58
77
  }
78
+ export {};
package/dist/types.d.ts CHANGED
@@ -31,7 +31,7 @@ export declare type TinaCloudCollectionBase = TinaCloudCollection<false>;
31
31
  export declare type TinaCloudCollectionEnriched = TinaCloudCollection<true>;
32
32
  declare type FormatType = 'json' | 'md' | 'markdown' | 'mdx';
33
33
  interface BaseCollection {
34
- label: string;
34
+ label?: string;
35
35
  name: string;
36
36
  path: string;
37
37
  format?: FormatType;
@@ -64,7 +64,7 @@ export declare type TinaFieldBase = TinaFieldInner<false>;
64
64
  export declare type TinaFieldEnriched = TinaFieldInner<true>;
65
65
  interface TinaField {
66
66
  name: string;
67
- label: string;
67
+ label?: string;
68
68
  description?: string;
69
69
  required?: boolean;
70
70
  list?: boolean;
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@tinacms/graphql",
3
- "version": "0.58.2",
3
+ "version": "0.59.4",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "files": [
7
+ "package.json",
7
8
  "dist"
8
9
  ],
9
10
  "license": "Apache-2.0",
@@ -44,9 +45,6 @@
44
45
  "test": "jest"
45
46
  },
46
47
  "dependencies": {
47
- "@octokit/auth-app": "^2.6.0",
48
- "@octokit/graphql": "^4.5.6",
49
- "@octokit/rest": "18.0.6",
50
48
  "body-parser": "^1.19.0",
51
49
  "cors": "^2.8.5",
52
50
  "dataloader": "^2.0.0",
@@ -62,15 +60,12 @@
62
60
  "graphql-type-json": "^0.3.2",
63
61
  "gray-matter": "^4.0.2",
64
62
  "js-yaml": "^3.14.0",
65
- "level": "^7.0.1",
66
- "levelup": "^5.1.1",
67
63
  "lodash": "^4.17.20",
68
64
  "mdast": "^3.0.0",
69
65
  "mdast-util-from-markdown": "^1.0.0",
70
66
  "mdast-util-mdx": "^1.1.0",
71
67
  "mdast-util-mdx-expression": "^1.1.0",
72
68
  "mdast-util-to-markdown": "^1.2.1",
73
- "memdown": "^6.1.1",
74
69
  "micromark-extension-mdxjs": "^1.0.0",
75
70
  "mocha": "^9.1.1",
76
71
  "normalize-path": "^3.0.0",
@@ -99,6 +94,7 @@
99
94
  "directory": "packages/tina-graphql"
100
95
  },
101
96
  "devDependencies": {
97
+ "@tinacms/datalayer": "0.0.1",
102
98
  "@tinacms/scripts": "0.50.4",
103
99
  "@types/cors": "^2.8.7",
104
100
  "@types/estree": "^0.0.50",
@@ -1,27 +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 type { Bridge } from './index';
14
- /**
15
- * This is the bridge from whatever datasource we need for I/O.
16
- * The basic example here is for the filesystem, one is needed
17
- * for Github has well.
18
- */
19
- export declare class FilesystemBridge implements Bridge {
20
- rootPath: string;
21
- constructor(rootPath: string);
22
- glob(pattern: string): Promise<string[]>;
23
- supportsBuilding(): boolean;
24
- get(filepath: string): Promise<string>;
25
- putConfig(filepath: string, data: string): Promise<void>;
26
- put(filepath: string, data: string): Promise<void>;
27
- }
@@ -1,33 +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 { Octokit } from '@octokit/rest';
14
- import { Bridge } from '.';
15
- export declare type GithubManagerInit = {
16
- rootPath: string;
17
- accessToken: string;
18
- owner: string;
19
- repo: string;
20
- ref: string;
21
- };
22
- export declare class GithubBridge implements Bridge {
23
- rootPath: string;
24
- repoConfig: Pick<GithubManagerInit, 'owner' | 'ref' | 'repo'>;
25
- appOctoKit: Octokit;
26
- constructor({ rootPath, accessToken, owner, repo, ref }: GithubManagerInit);
27
- private readDir;
28
- supportsBuilding(): boolean;
29
- glob(pattern: string): Promise<string[]>;
30
- get(filepath: string): Promise<string>;
31
- putConfig(filepath: string, data: string): Promise<void>;
32
- put(filepath: string, data: string): Promise<void>;
33
- }
@@ -1,28 +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 { Store } from '.';
14
- export declare class FilesystemStore implements Store {
15
- rootPath: string;
16
- clear(): Promise<void>;
17
- print(): Promise<void>;
18
- constructor({ rootPath }: {
19
- rootPath?: string;
20
- });
21
- query(queryStrings: string[]): Promise<object[]>;
22
- seed(): Promise<void>;
23
- get<T extends object>(filepath: string): Promise<T>;
24
- supportsSeeding(): boolean;
25
- supportsIndexing(): boolean;
26
- glob(pattern: string, callback: any): Promise<any[]>;
27
- put(filepath: string, data: object): Promise<void>;
28
- }
@@ -1,37 +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 { Octokit } from '@octokit/rest';
14
- import { Store } from '.';
15
- export declare type GithubManagerInit = {
16
- rootPath: string;
17
- accessToken: string;
18
- owner: string;
19
- repo: string;
20
- ref: string;
21
- };
22
- export declare class GithubStore implements Store {
23
- rootPath: string;
24
- repoConfig: Pick<GithubManagerInit, 'owner' | 'ref' | 'repo'>;
25
- appOctoKit: Octokit;
26
- clear(): Promise<void>;
27
- print(): Promise<void>;
28
- constructor({ rootPath, accessToken, owner, repo, ref }: GithubManagerInit);
29
- query(queryStrings: string[]): Promise<object[]>;
30
- supportsSeeding(): boolean;
31
- seed(): Promise<void>;
32
- private readDir;
33
- glob(pattern: string, callback: any): Promise<any[]>;
34
- get(filepath: string): Promise<never>;
35
- supportsIndexing(): boolean;
36
- put(filepath: string, data: object): Promise<void>;
37
- }
@@ -1,29 +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 type { Store } from './index';
14
- import { LevelDB } from 'level';
15
- export declare class LevelStore implements Store {
16
- rootPath: any;
17
- db: LevelDB;
18
- constructor(rootPath: string, useMemory?: boolean);
19
- query(queryStrings: string[], hydrator: any): Promise<any[]>;
20
- seed(filepath: string, data: object): Promise<void>;
21
- supportsSeeding(): boolean;
22
- supportsIndexing(): boolean;
23
- print(): Promise<void>;
24
- open(): Promise<void>;
25
- clear(): Promise<void>;
26
- glob(pattern: string, callback: any): Promise<any[]>;
27
- get(filepath: string): Promise<any>;
28
- put(filepath: string, data: object): Promise<void>;
29
- }
@@ -1,33 +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 type { Store } from './index';
14
- /**
15
- * This is the bridge from whatever datasource we need for I/O.
16
- * The basic example here is for the filesystem, one is needed
17
- * for Github has well.
18
- */
19
- export declare class MemoryStore implements Store {
20
- rootPath: any;
21
- db: any;
22
- private map;
23
- constructor(rootPath: string, object?: object);
24
- query(queryStrings: string[], hydrator: any): Promise<any[]>;
25
- seed(filepath: string, data: object): Promise<void>;
26
- supportsSeeding(): boolean;
27
- supportsIndexing(): boolean;
28
- print(): Promise<void>;
29
- clear(): Promise<void>;
30
- glob(pattern: string, callback: any): Promise<any[]>;
31
- get(filepath: string): Promise<any>;
32
- put(filepath: string, data: object): Promise<void>;
33
- }