@tinacms/graphql 0.59.2 → 0.59.6

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";
@@ -53,10 +53,10 @@ export declare class TinaSchema {
53
53
  namespace: string[];
54
54
  };
55
55
  getCollectionByFullPath: (filepath: string) => Promise<TinaCloudCollection<true>>;
56
- getCollectionAndTemplateByFullPath: (filepath: string, templateName?: string) => Promise<{
56
+ getCollectionAndTemplateByFullPath: (filepath: string, templateName?: string) => {
57
57
  collection: TinaCloudCollection<true>;
58
58
  template: Templateable;
59
- }>;
59
+ };
60
60
  getTemplateForData: ({ data, collection, }: {
61
61
  data?: unknown;
62
62
  collection: Collectable;
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;
@@ -144,6 +144,7 @@ export declare type ObjectType<WithNamespace extends boolean> = ObjectTemplates<
144
144
  declare type ObjectTemplates<WithNamespace extends boolean> = WithNamespace extends true ? ObjectTemplatesWithNamespace<WithNamespace> : ObjectTemplatesInner<WithNamespace>;
145
145
  interface ObjectTemplatesInner<WithNamespace extends boolean> extends TinaField {
146
146
  type: 'object';
147
+ required?: false;
147
148
  /**
148
149
  * templates can either be an array of Tina templates or a reference to
149
150
  * global template definition.
@@ -157,6 +158,7 @@ interface ObjectTemplatesInner<WithNamespace extends boolean> extends TinaField
157
158
  }
158
159
  interface ObjectTemplatesWithNamespace<WithNamespace extends boolean> extends TinaField {
159
160
  type: 'object';
161
+ required?: false;
160
162
  /**
161
163
  * templates can either be an array of Tina templates or a reference to
162
164
  * global template definition.
@@ -172,6 +174,7 @@ interface ObjectTemplatesWithNamespace<WithNamespace extends boolean> extends Ti
172
174
  declare type ObjectFields<WithNamespace extends boolean> = WithNamespace extends true ? InnerObjectFieldsWithNamespace<WithNamespace> : InnerObjectFields<WithNamespace>;
173
175
  interface InnerObjectFields<WithNamespace extends boolean> extends TinaField {
174
176
  type: 'object';
177
+ required?: false;
175
178
  /**
176
179
  * fields can either be an array of Tina fields, or a reference to the fields
177
180
  * of a global template definition.
@@ -183,6 +186,7 @@ interface InnerObjectFields<WithNamespace extends boolean> extends TinaField {
183
186
  }
184
187
  interface InnerObjectFieldsWithNamespace<WithNamespace extends boolean> extends TinaField {
185
188
  type: 'object';
189
+ required?: false;
186
190
  /**
187
191
  * fields can either be an array of Tina fields, or a reference to the fields
188
192
  * of a global template definition.
@@ -235,6 +239,7 @@ export declare type CollectionTemplateableUnion = {
235
239
  export declare type CollectionTemplateableObject = {
236
240
  namespace: string[];
237
241
  type: 'object';
242
+ required?: false;
238
243
  template: Templateable;
239
244
  };
240
245
  export declare type CollectionTemplateable = CollectionTemplateableUnion | CollectionTemplateableObject;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/graphql",
3
- "version": "0.59.2",
3
+ "version": "0.59.6",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "files": [
@@ -45,9 +45,6 @@
45
45
  "test": "jest"
46
46
  },
47
47
  "dependencies": {
48
- "@octokit/auth-app": "^2.6.0",
49
- "@octokit/graphql": "^4.5.6",
50
- "@octokit/rest": "18.0.6",
51
48
  "body-parser": "^1.19.0",
52
49
  "cors": "^2.8.5",
53
50
  "dataloader": "^2.0.0",
@@ -63,15 +60,12 @@
63
60
  "graphql-type-json": "^0.3.2",
64
61
  "gray-matter": "^4.0.2",
65
62
  "js-yaml": "^3.14.0",
66
- "level": "^7.0.1",
67
- "levelup": "^5.1.1",
68
63
  "lodash": "^4.17.20",
69
64
  "mdast": "^3.0.0",
70
65
  "mdast-util-from-markdown": "^1.0.0",
71
66
  "mdast-util-mdx": "^1.1.0",
72
67
  "mdast-util-mdx-expression": "^1.1.0",
73
68
  "mdast-util-to-markdown": "^1.2.1",
74
- "memdown": "^6.1.1",
75
69
  "micromark-extension-mdxjs": "^1.0.0",
76
70
  "mocha": "^9.1.1",
77
71
  "normalize-path": "^3.0.0",
@@ -100,7 +94,8 @@
100
94
  "directory": "packages/tina-graphql"
101
95
  },
102
96
  "devDependencies": {
103
- "@tinacms/scripts": "0.50.4",
97
+ "@tinacms/datalayer": "0.0.2",
98
+ "@tinacms/scripts": "0.50.5",
104
99
  "@types/cors": "^2.8.7",
105
100
  "@types/estree": "^0.0.50",
106
101
  "@types/express": "^4.17.8",
@@ -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
- }