@tinacms/graphql 0.0.0-d69e892-20241003042309 → 0.0.0-d7c5ec1-20250219020924

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,12 +14,13 @@ export declare const createResolver: (args: ResolverConfig) => Resolver;
14
14
  export declare const transformDocumentIntoPayload: (fullPath: string, rawData: {
15
15
  _collection: any;
16
16
  _template: any;
17
- }, tinaSchema: TinaSchema, config?: GraphQLConfig, isAudit?: boolean) => Promise<{
17
+ }, tinaSchema: TinaSchema, config?: GraphQLConfig, isAudit?: boolean, hasReferences?: boolean) => Promise<{
18
18
  _sys: {
19
19
  title: any;
20
20
  basename: string;
21
21
  filename: string;
22
22
  extension: string;
23
+ hasReferences: boolean;
23
24
  path: string;
24
25
  relativePath: string;
25
26
  breadcrumbs: string[];
@@ -117,6 +118,7 @@ export declare class Resolver {
117
118
  basename: string;
118
119
  filename: string;
119
120
  extension: string;
121
+ hasReferences: boolean;
120
122
  path: string;
121
123
  relativePath: string;
122
124
  breadcrumbs: string[];
@@ -140,12 +142,16 @@ export declare class Resolver {
140
142
  name: any;
141
143
  path: any;
142
144
  }>;
143
- getDocument: (fullPath: unknown) => Promise<{
145
+ getDocument: (fullPath: unknown, opts?: {
146
+ collection?: Collection<true>;
147
+ checkReferences?: boolean;
148
+ }) => Promise<{
144
149
  _sys: {
145
150
  title: any;
146
151
  basename: string;
147
152
  filename: string;
148
153
  extension: string;
154
+ hasReferences: boolean;
149
155
  path: string;
150
156
  relativePath: string;
151
157
  breadcrumbs: string[];
@@ -184,6 +190,7 @@ export declare class Resolver {
184
190
  basename: string;
185
191
  filename: string;
186
192
  extension: string;
193
+ hasReferences: boolean;
187
194
  path: string;
188
195
  relativePath: string;
189
196
  breadcrumbs: string[];
@@ -215,6 +222,7 @@ export declare class Resolver {
215
222
  basename: string;
216
223
  filename: string;
217
224
  extension: string;
225
+ hasReferences: boolean;
218
226
  path: string;
219
227
  relativePath: string;
220
228
  breadcrumbs: string[];
@@ -255,6 +263,7 @@ export declare class Resolver {
255
263
  basename: string;
256
264
  filename: string;
257
265
  extension: string;
266
+ hasReferences: boolean;
258
267
  path: string;
259
268
  relativePath: string;
260
269
  breadcrumbs: string[];
@@ -285,6 +294,7 @@ export declare class Resolver {
285
294
  basename: string;
286
295
  filename: string;
287
296
  extension: string;
297
+ hasReferences: boolean;
288
298
  path: string;
289
299
  relativePath: string;
290
300
  breadcrumbs: string[];
@@ -325,6 +335,20 @@ export declare class Resolver {
325
335
  endCursor: string;
326
336
  };
327
337
  }>;
338
+ /**
339
+ * Checks if a document has references to it
340
+ * @param id The id of the document to check for references
341
+ * @param c The collection to check for references
342
+ * @returns true if the document has references, false otherwise
343
+ */
344
+ private hasReferences;
345
+ /**
346
+ * Finds references to a document
347
+ * @param id the id of the document to find references to
348
+ * @param c the collection to find references in
349
+ * @returns references to the document in the form of a map of collection names to a list of fields that reference the document
350
+ */
351
+ private findReferences;
328
352
  private buildFieldMutations;
329
353
  /**
330
354
  * A mutation looks nearly identical between updateDocument:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/graphql",
3
- "version": "0.0.0-d69e892-20241003042309",
3
+ "version": "0.0.0-d7c5ec1-20250219020924",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "typings": "dist/index.d.ts",
@@ -26,26 +26,26 @@
26
26
  "@iarna/toml": "^2.2.5",
27
27
  "abstract-level": "^1.0.4",
28
28
  "date-fns": "^2.30.0",
29
- "fast-glob": "^3.3.2",
30
- "fs-extra": "^11.2.0",
29
+ "fast-glob": "^3.3.3",
30
+ "fs-extra": "^11.3.0",
31
31
  "glob-parent": "^6.0.2",
32
32
  "graphql": "15.8.0",
33
33
  "gray-matter": "^4.0.3",
34
- "isomorphic-git": "^1.27.1",
34
+ "isomorphic-git": "^1.29.0",
35
35
  "js-sha1": "^0.6.0",
36
36
  "js-yaml": "^3.14.1",
37
- "jsonpath-plus": "^6.0.1",
37
+ "jsonpath-plus": "10.1.0",
38
38
  "lodash.clonedeep": "^4.5.0",
39
39
  "lodash.set": "^4.3.2",
40
40
  "lodash.uniqby": "^4.7.0",
41
41
  "many-level": "^2.0.0",
42
42
  "micromatch": "4.0.8",
43
43
  "normalize-path": "^3.0.0",
44
- "readable-stream": "^4.5.2",
44
+ "readable-stream": "^4.7.0",
45
45
  "scmp": "^2.1.0",
46
46
  "yup": "^0.32.11",
47
- "@tinacms/schema-tools": "0.0.0-d69e892-20241003042309",
48
- "@tinacms/mdx": "0.0.0-d69e892-20241003042309"
47
+ "@tinacms/mdx": "0.0.0-d7c5ec1-20250219020924",
48
+ "@tinacms/schema-tools": "0.0.0-d7c5ec1-20250219020924"
49
49
  },
50
50
  "publishConfig": {
51
51
  "registry": "https://registry.npmjs.org"
@@ -59,33 +59,32 @@
59
59
  "@types/estree": "^0.0.50",
60
60
  "@types/express": "^4.17.21",
61
61
  "@types/fs-extra": "^9.0.13",
62
- "@types/jest": "^26.0.24",
63
62
  "@types/js-yaml": "^3.12.10",
64
63
  "@types/lodash.camelcase": "^4.3.9",
65
64
  "@types/lodash.upperfirst": "^4.3.9",
66
65
  "@types/lru-cache": "^5.1.1",
67
66
  "@types/mdast": "^3.0.15",
68
67
  "@types/micromatch": "^4.0.9",
69
- "@types/node": "^22.7.4",
68
+ "@types/node": "^22.13.1",
70
69
  "@types/normalize-path": "^3.0.2",
71
70
  "@types/ws": "^7.4.7",
72
71
  "@types/yup": "^0.29.14",
73
- "jest": "^29.7.0",
74
- "jest-diff": "^29.7.0",
75
72
  "jest-file-snapshot": "^0.5.0",
76
- "jest-matcher-utils": "^29.7.0",
77
73
  "memory-level": "^1.0.0",
78
74
  "nodemon": "3.1.4",
79
- "typescript": "^5.6.2",
80
- "@tinacms/schema-tools": "0.0.0-d69e892-20241003042309",
81
- "@tinacms/scripts": "1.2.3"
75
+ "typescript": "^5.7.3",
76
+ "vite": "^4.5.9",
77
+ "vitest": "^0.32.4",
78
+ "zod": "^3.24.2",
79
+ "@tinacms/schema-tools": "0.0.0-d7c5ec1-20250219020924",
80
+ "@tinacms/scripts": "0.0.0-d7c5ec1-20250219020924"
82
81
  },
83
82
  "scripts": {
84
83
  "types": "pnpm tsc",
85
84
  "build": "tinacms-scripts build",
86
85
  "docs": "pnpm typedoc",
87
86
  "serve": "pnpm nodemon dist/server.js",
88
- "test": "jest",
89
- "test-watch": "jest --watch"
87
+ "test": "vitest run",
88
+ "test-watch": "vitest"
90
89
  }
91
90
  }