@tinacms/graphql 0.57.2 → 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.
Files changed (31) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/{primitives/ast-builder → ast-builder}/index.d.ts +0 -0
  3. package/dist/{primitives/build.d.ts → build.d.ts} +5 -3
  4. package/dist/{primitives/builder → builder}/index.d.ts +5 -11
  5. package/dist/{primitives/builder → builder}/static-definitions.d.ts +0 -0
  6. package/dist/{primitives/database/bridge.d.ts → database/bridge/filesystem.d.ts} +3 -5
  7. package/dist/{primitives/database → database/bridge}/github.d.ts +3 -1
  8. package/dist/database/bridge/index.d.ts +23 -0
  9. package/dist/{primitives/database → database}/index.d.ts +26 -16
  10. package/dist/database/store/filesystem.d.ts +28 -0
  11. package/dist/database/store/github.d.ts +37 -0
  12. package/dist/database/store/index.d.ts +74 -0
  13. package/dist/database/store/level.d.ts +29 -0
  14. package/dist/database/store/memory.d.ts +33 -0
  15. package/dist/database/util.d.ts +16 -0
  16. package/dist/index.d.ts +13 -4
  17. package/dist/index.js +1472 -694
  18. package/dist/{primitives/mdx → mdx}/index.d.ts +0 -0
  19. package/dist/{primitives/mdx → mdx}/parse.d.ts +0 -0
  20. package/dist/{primitives/mdx → mdx}/stringify.d.ts +0 -0
  21. package/dist/{primitives/resolve.d.ts → resolve.d.ts} +0 -0
  22. package/dist/{primitives/resolver → resolver}/error.d.ts +12 -0
  23. package/dist/{primitives/resolver → resolver}/index.d.ts +3 -34
  24. package/dist/{primitives/schema → schema}/index.d.ts +1 -0
  25. package/dist/{primitives/schema → schema}/validate.d.ts +0 -0
  26. package/dist/sdkBuilder/index.d.ts +1 -1
  27. package/dist/{primitives/spec → spec}/setup.d.ts +24 -30
  28. package/dist/{primitives/types.d.ts → types.d.ts} +1 -0
  29. package/dist/{primitives/util.d.ts → util.d.ts} +0 -0
  30. package/package.json +12 -8
  31. package/dist/primitives/index.d.ts +0 -40
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: number;
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) => {
File without changes
@@ -10,5 +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
- import type { TinaSchema } from '../primitives/schema';
13
+ import type { TinaSchema } from '../schema';
14
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 { Bridge } from '../database/bridge';
16
- export declare class InMemoryBridge implements Bridge {
17
- rootPath: string;
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 setupFixture2: (rootPath: string, schema: TinaCloudSchema<false>, fixture: {
19
+ export declare const print: (fixture: Fixture) => string;
20
+ export declare type Fixture = {
21
+ description?: string;
42
22
  name: string;
43
- assert: 'output' | 'file';
44
- }) => Promise<{
45
- response: string;
46
- expectedResponsePath: string;
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
  }>;
@@ -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.57.2",
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,7 +37,7 @@
38
37
  ]
39
38
  },
40
39
  "scripts": {
41
- "types": "yarn tsc --project ./tsconfig.real.json",
40
+ "types": "yarn tsc",
42
41
  "build": "echo \"Run `yarn build` from the root of the repository instead\"",
43
42
  "docs": "yarn typedoc",
44
43
  "serve": "yarn nodemon dist/server.js",
@@ -48,28 +47,30 @@
48
47
  "@octokit/auth-app": "^2.6.0",
49
48
  "@octokit/graphql": "^4.5.6",
50
49
  "@octokit/rest": "18.0.6",
51
- "@types/estree": "^0.0.50",
52
- "@types/mdast": "^3.0.10",
53
- "@types/node": "^16.9.1",
54
50
  "body-parser": "^1.19.0",
55
51
  "cors": "^2.8.5",
56
52
  "dataloader": "^2.0.0",
57
53
  "date-fns": "^2.21.1",
54
+ "encoding-down": "^7.1.0",
58
55
  "esbuild": "^0.12.25",
59
56
  "esbuild-jest": "^0.5.0",
60
57
  "estree-walker": "^3.0.0",
61
58
  "fast-glob": "^3.2.5",
59
+ "flat": "^5.0.2",
62
60
  "fs-extra": "^9.0.1",
63
61
  "graphql": "^15.3.0",
64
62
  "graphql-type-json": "^0.3.2",
65
63
  "gray-matter": "^4.0.2",
66
64
  "js-yaml": "^3.14.0",
65
+ "level": "^7.0.1",
66
+ "levelup": "^5.1.1",
67
67
  "lodash": "^4.17.20",
68
68
  "mdast": "^3.0.0",
69
69
  "mdast-util-from-markdown": "^1.0.0",
70
70
  "mdast-util-mdx": "^1.1.0",
71
71
  "mdast-util-mdx-expression": "^1.1.0",
72
72
  "mdast-util-to-markdown": "^1.2.1",
73
+ "memdown": "^6.1.1",
73
74
  "micromark-extension-mdxjs": "^1.0.0",
74
75
  "mocha": "^9.1.1",
75
76
  "normalize-path": "^3.0.0",
@@ -83,7 +84,6 @@
83
84
  "remark-rehype": "^8.0.0",
84
85
  "remark-slate": "^1.8.0",
85
86
  "remark-stringify": "^8.1.1",
86
- "tslib": "^1.11.1",
87
87
  "unified": "^10.1.0",
88
88
  "unist-util-remove-position": "^3.0.0",
89
89
  "unist-util-visit": "^4.0.0",
@@ -101,14 +101,18 @@
101
101
  "devDependencies": {
102
102
  "@tinacms/scripts": "0.50.4",
103
103
  "@types/cors": "^2.8.7",
104
+ "@types/estree": "^0.0.50",
104
105
  "@types/express": "^4.17.8",
105
106
  "@types/fs-extra": "^9.0.2",
106
107
  "@types/jest": "^26.0.4",
107
108
  "@types/js-yaml": "^3.12.5",
109
+ "@types/level": "^6.0.0",
108
110
  "@types/lodash": "^4.14.161",
109
111
  "@types/lodash.camelcase": "^4.3.6",
110
112
  "@types/lodash.upperfirst": "^4.3.6",
111
113
  "@types/lru-cache": "^5.1.0",
114
+ "@types/mdast": "^3.0.10",
115
+ "@types/node": "^14.17.34",
112
116
  "@types/normalize-path": "^3.0.0",
113
117
  "@types/ws": "^7.2.6",
114
118
  "@types/yup": "^0.29.7",
@@ -1,40 +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 { createDatabase } from './database';
16
- export { createDatabase, resolve, indexDB };
17
- export type { TinaCloudSchema } from './types';
18
- export declare const gql: ({ rootPath, query, variables, }: {
19
- rootPath: string;
20
- query: string;
21
- variables: object;
22
- }) => Promise<import("graphql").ExecutionResult<{
23
- [key: string]: any;
24
- }, {
25
- [key: string]: any;
26
- }>>;
27
- export declare const githubRoute: ({ rootPath, query, variables, branch, ...githubArgs }: {
28
- accessToken: string;
29
- owner: string;
30
- repo: string;
31
- query: string;
32
- variables: object;
33
- rootPath?: string;
34
- branch: string;
35
- }) => Promise<import("graphql").ExecutionResult<{
36
- [key: string]: any;
37
- }, {
38
- [key: string]: any;
39
- }>>;
40
- export declare const buildSchema: (rootPath: string) => Promise<import("graphql").GraphQLSchema>;