@tinacms/graphql 0.0.0-ecea7ac-20241011043815 → 0.0.0-ed38135-20250102012919
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/index.js +563 -36
- package/dist/index.mjs +560 -37
- package/dist/resolver/index.d.ts +26 -2
- package/package.json +8 -8
package/dist/resolver/index.d.ts
CHANGED
|
@@ -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
|
|
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-
|
|
3
|
+
"version": "0.0.0-ed38135-20250102012919",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"isomorphic-git": "^1.27.1",
|
|
35
35
|
"js-sha1": "^0.6.0",
|
|
36
36
|
"js-yaml": "^3.14.1",
|
|
37
|
-
"jsonpath-plus": "
|
|
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",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"readable-stream": "^4.5.2",
|
|
45
45
|
"scmp": "^2.1.0",
|
|
46
46
|
"yup": "^0.32.11",
|
|
47
|
-
"@tinacms/
|
|
48
|
-
"@tinacms/
|
|
47
|
+
"@tinacms/schema-tools": "1.6.9",
|
|
48
|
+
"@tinacms/mdx": "0.0.0-ed38135-20250102012919"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"registry": "https://registry.npmjs.org"
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@types/lru-cache": "^5.1.1",
|
|
67
67
|
"@types/mdast": "^3.0.15",
|
|
68
68
|
"@types/micromatch": "^4.0.9",
|
|
69
|
-
"@types/node": "^22.
|
|
69
|
+
"@types/node": "^22.9.0",
|
|
70
70
|
"@types/normalize-path": "^3.0.2",
|
|
71
71
|
"@types/ws": "^7.4.7",
|
|
72
72
|
"@types/yup": "^0.29.14",
|
|
@@ -76,9 +76,9 @@
|
|
|
76
76
|
"jest-matcher-utils": "^29.7.0",
|
|
77
77
|
"memory-level": "^1.0.0",
|
|
78
78
|
"nodemon": "3.1.4",
|
|
79
|
-
"typescript": "^5.6.
|
|
80
|
-
"@tinacms/schema-tools": "
|
|
81
|
-
"@tinacms/scripts": "
|
|
79
|
+
"typescript": "^5.6.3",
|
|
80
|
+
"@tinacms/schema-tools": "1.6.9",
|
|
81
|
+
"@tinacms/scripts": "1.3.1"
|
|
82
82
|
},
|
|
83
83
|
"scripts": {
|
|
84
84
|
"types": "pnpm tsc",
|