@tinacms/graphql 1.4.39 → 1.5.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.
@@ -14,7 +14,7 @@ export declare class TinaGraphQLError extends Error implements GraphQLError {
14
14
  [key: string]: any;
15
15
  constructor(message: string, extensions?: Record<string, any>);
16
16
  }
17
- export declare type TypeFetchErrorArgs = {
17
+ export type TypeFetchErrorArgs = {
18
18
  stack?: string;
19
19
  file?: string;
20
20
  includeAuditMessage?: boolean;
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import type { ReferenceType, TinaField } from '@tinacms/schema-tools';
5
5
  import { FilterCondition } from '../database/datalayer';
6
- export declare type ReferenceResolver = (filter: Record<string, object>, fieldDefinition: ReferenceType) => Promise<{
6
+ export type ReferenceResolver = (filter: Record<string, object>, fieldDefinition: ReferenceType) => Promise<{
7
7
  edges: {
8
8
  node: any;
9
9
  }[];
@@ -12,8 +12,8 @@ interface ResolverConfig {
12
12
  }
13
13
  export declare const createResolver: (args: ResolverConfig) => Resolver;
14
14
  export declare const transformDocumentIntoPayload: (fullPath: string, rawData: {
15
- _collection;
16
- _template;
15
+ _collection: any;
16
+ _template: any;
17
17
  }, tinaSchema: TinaSchema, config?: GraphQLConfig, isAudit?: boolean) => Promise<{
18
18
  _sys: {
19
19
  title: any;
@@ -63,10 +63,10 @@ export declare class Resolver {
63
63
  }[];
64
64
  }[];
65
65
  format?: "json" | "md" | "markdown" | "mdx" | "yaml" | "yml" | "toml";
66
- ui?: import("@tinacms/schema-tools").UICollection<any, any, any>;
66
+ ui?: import("@tinacms/schema-tools").UICollection;
67
67
  defaultItem?: import("@tinacms/schema-tools").DefaultItem<Record<string, any>>;
68
- frontmatterFormat?: "json" | "yaml" | "toml";
69
- frontmatterDelimiters?: string | [string, string];
68
+ frontmatterFormat?: "yaml" | "toml" | "json";
69
+ frontmatterDelimiters?: [string, string] | string;
70
70
  match?: {
71
71
  include?: string;
72
72
  exclude?: string;
@@ -91,10 +91,10 @@ export declare class Resolver {
91
91
  }[];
92
92
  }[];
93
93
  format?: "json" | "md" | "markdown" | "mdx" | "yaml" | "yml" | "toml";
94
- ui?: import("@tinacms/schema-tools").UICollection<any, any, any>;
94
+ ui?: import("@tinacms/schema-tools").UICollection;
95
95
  defaultItem?: import("@tinacms/schema-tools").DefaultItem<Record<string, any>>;
96
- frontmatterFormat?: "json" | "yaml" | "toml";
97
- frontmatterDelimiters?: string | [string, string];
96
+ frontmatterFormat?: "yaml" | "toml" | "json";
97
+ frontmatterDelimiters?: [string, string] | string;
98
98
  match?: {
99
99
  include?: string;
100
100
  exclude?: string;
@@ -170,6 +170,8 @@ export declare class Resolver {
170
170
  [key: string]: unknown;
171
171
  } | {
172
172
  [key: string]: unknown;
173
+ }[] | {
174
+ _template: string;
173
175
  }[]>;
174
176
  createResolveDocument: ({ collection, realPath, args, isAddPendingDocument, }: {
175
177
  collection: Collection<true>;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
 
3
3
  */
4
- import { Schema, Collection } from '@tinacms/schema-tools';
4
+ import { type Schema, type Collection } from '@tinacms/schema-tools';
5
5
  export declare const validateSchema: (schema: Schema) => Promise<{
6
6
  collections: Collection<true>[];
7
7
  config: import("@tinacms/schema-tools").Config<undefined, undefined, undefined, undefined, undefined>;
@@ -8,7 +8,7 @@ export declare const setup: (rootPath: string, schema: Schema, level: Level) =>
8
8
  database: Database;
9
9
  }>;
10
10
  export declare const print: (fixture: Fixture) => string;
11
- export declare type Fixture = {
11
+ export type Fixture = {
12
12
  description?: string;
13
13
  name: string;
14
14
  assert: 'output';
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
 
3
3
  */
4
- export declare type GraphQLConfig = {
4
+ export type GraphQLConfig = {
5
5
  useRelativeMedia: true;
6
6
  } | {
7
7
  useRelativeMedia: false;
package/dist/util.d.ts CHANGED
@@ -12,8 +12,10 @@ import * as yup from 'yup';
12
12
  * })
13
13
  * ```
14
14
  */
15
- export declare const sequential: <A, B>(items: A[], callback: (args: A, idx: number) => Promise<B>) => Promise<B[]>;
15
+ export declare const sequential: <A, B>(items: A[] | undefined, callback: (args: A, idx: number) => Promise<B>) => Promise<B[]>;
16
16
  export declare function assertShape<T>(value: unknown, yupSchema: (args: typeof yup) => yup.AnySchema, errorMessage?: string): asserts value is T;
17
17
  export declare const atob: (b64Encoded: string) => string;
18
18
  export declare const btoa: (string: string) => string;
19
19
  export declare const lastItem: (arr: (number | string)[]) => string | number;
20
+ export declare const get: (obj: any, path: any, defaultValue?: any) => any;
21
+ export declare const flattenDeep: (arr: any) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/graphql",
3
- "version": "1.4.39",
3
+ "version": "1.5.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "typings": "dist/index.d.ts",
@@ -24,26 +24,28 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@iarna/toml": "^2.2.5",
27
- "abstract-level": "^1.0.3",
28
- "date-fns": "^2.21.1",
29
- "fast-glob": "^3.2.5",
30
- "fs-extra": "^9.0.1",
27
+ "abstract-level": "^1.0.4",
28
+ "date-fns": "^2.30.0",
29
+ "fast-glob": "^3.3.2",
30
+ "fs-extra": "^9.1.0",
31
31
  "glob-parent": "^6.0.2",
32
32
  "graphql": "15.8.0",
33
- "gray-matter": "^4.0.2",
34
- "isomorphic-git": "^1.21.0",
33
+ "gray-matter": "^4.0.3",
34
+ "isomorphic-git": "^1.27.1",
35
35
  "js-sha1": "^0.6.0",
36
36
  "js-yaml": "^3.14.1",
37
37
  "jsonpath-plus": "^6.0.1",
38
- "lodash": "^4.17.20",
38
+ "lodash.clonedeep": "^4.5.0",
39
+ "lodash.set": "^4.3.2",
40
+ "lodash.uniqby": "^4.7.0",
39
41
  "many-level": "^2.0.0",
40
42
  "micromatch": "4.0.5",
41
43
  "normalize-path": "^3.0.0",
42
- "readable-stream": "^4.3.0",
44
+ "readable-stream": "^4.5.2",
43
45
  "scmp": "^2.1.0",
44
- "yup": "^0.32.9",
45
- "@tinacms/mdx": "1.3.29",
46
- "@tinacms/schema-tools": "1.5.0"
46
+ "yup": "^0.32.11",
47
+ "@tinacms/mdx": "1.4.0",
48
+ "@tinacms/schema-tools": "1.6.0"
47
49
  },
48
50
  "publishConfig": {
49
51
  "registry": "https://registry.npmjs.org"
@@ -53,31 +55,30 @@
53
55
  "directory": "packages/tina-graphql"
54
56
  },
55
57
  "devDependencies": {
56
- "@types/cors": "^2.8.7",
58
+ "@types/cors": "^2.8.17",
57
59
  "@types/estree": "^0.0.50",
58
- "@types/express": "^4.17.8",
59
- "@types/fs-extra": "^9.0.2",
60
- "@types/jest": "^26.0.4",
61
- "@types/js-yaml": "^3.12.5",
62
- "@types/lodash": "^4.14.161",
63
- "@types/lodash.camelcase": "^4.3.6",
64
- "@types/lodash.upperfirst": "^4.3.6",
65
- "@types/lru-cache": "^5.1.0",
66
- "@types/mdast": "^3.0.10",
67
- "@types/micromatch": "^4.0.2",
68
- "@types/node": "^14.17.34",
69
- "@types/normalize-path": "^3.0.0",
70
- "@types/ws": "^7.2.6",
71
- "@types/yup": "^0.29.7",
72
- "jest": "^29.5.0",
73
- "jest-diff": "^29.5.0",
60
+ "@types/express": "^4.17.21",
61
+ "@types/fs-extra": "^9.0.13",
62
+ "@types/jest": "^26.0.24",
63
+ "@types/js-yaml": "^3.12.10",
64
+ "@types/lodash.camelcase": "^4.3.9",
65
+ "@types/lodash.upperfirst": "^4.3.9",
66
+ "@types/lru-cache": "^5.1.1",
67
+ "@types/mdast": "^3.0.15",
68
+ "@types/micromatch": "^4.0.9",
69
+ "@types/node": "^14.18.63",
70
+ "@types/normalize-path": "^3.0.2",
71
+ "@types/ws": "^7.4.7",
72
+ "@types/yup": "^0.29.14",
73
+ "jest": "^29.7.0",
74
+ "jest-diff": "^29.7.0",
74
75
  "jest-file-snapshot": "^0.5.0",
75
- "jest-matcher-utils": "^29.5.0",
76
+ "jest-matcher-utils": "^29.7.0",
76
77
  "memory-level": "^1.0.0",
77
78
  "nodemon": "2.0.19",
78
- "typescript": "4.6.4",
79
- "@tinacms/schema-tools": "1.5.0",
80
- "@tinacms/scripts": "1.1.6"
79
+ "typescript": "^5.5.4",
80
+ "@tinacms/schema-tools": "1.6.0",
81
+ "@tinacms/scripts": "1.2.0"
81
82
  },
82
83
  "scripts": {
83
84
  "types": "pnpm tsc",