@powerhousedao/codegen 3.3.0-dev.15 → 3.3.0-dev.17
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.
|
@@ -7,7 +7,6 @@ force: true
|
|
|
7
7
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
8
8
|
import { type Subgraph } from "@powerhousedao/reactor-api";
|
|
9
9
|
import { addFile } from "document-drive";
|
|
10
|
-
import { DocumentNotFoundError } from "document-drive/server/error";
|
|
11
10
|
import { actions } from "../../document-models/<%- h.changeCase.param(documentType) %>/index.js";
|
|
12
11
|
import { generateId } from "document-model";
|
|
13
12
|
|
|
@@ -24,11 +23,7 @@ export const getResolvers = (subgraph: Subgraph): Record<string, any> => {
|
|
|
24
23
|
const driveId: string = args.driveId || DEFAULT_DRIVE_ID;
|
|
25
24
|
const docId: string = args.docId || "";
|
|
26
25
|
const doc = await reactor.getDocument(driveId, docId);
|
|
27
|
-
|
|
28
|
-
throw new DocumentNotFoundError(docId);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return {
|
|
26
|
+
return {
|
|
32
27
|
driveId: driveId,
|
|
33
28
|
...doc,
|
|
34
29
|
...doc.header,
|
|
@@ -40,17 +35,9 @@ export const getResolvers = (subgraph: Subgraph): Record<string, any> => {
|
|
|
40
35
|
getDocuments: async (args: any) => {
|
|
41
36
|
const driveId: string = args.driveId || DEFAULT_DRIVE_ID;
|
|
42
37
|
const docsIds = await reactor.getDocuments(driveId);
|
|
43
|
-
if (!docsIds) {
|
|
44
|
-
throw new DocumentNotFoundError(driveId);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
38
|
const docs = await Promise.all(
|
|
48
39
|
docsIds.map(async (docId) => {
|
|
49
40
|
const doc = await reactor.getDocument(driveId, docId);
|
|
50
|
-
if (!doc) {
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
41
|
return {
|
|
55
42
|
driveId: driveId,
|
|
56
43
|
...doc,
|
|
@@ -63,7 +50,7 @@ export const getResolvers = (subgraph: Subgraph): Record<string, any> => {
|
|
|
63
50
|
);
|
|
64
51
|
|
|
65
52
|
return docs.filter(
|
|
66
|
-
(doc) => doc
|
|
53
|
+
(doc) => doc.header.documentType === "<%- documentTypeId %>",
|
|
67
54
|
);
|
|
68
55
|
},
|
|
69
56
|
};
|
|
@@ -103,9 +90,6 @@ export const getResolvers = (subgraph: Subgraph): Record<string, any> => {
|
|
|
103
90
|
const driveId: string = args.driveId || DEFAULT_DRIVE_ID;
|
|
104
91
|
const docId: string = args.docId || "";
|
|
105
92
|
const doc = await reactor.getDocument(driveId, docId);
|
|
106
|
-
if (!doc) {
|
|
107
|
-
throw new DocumentNotFoundError(docId);
|
|
108
|
-
}
|
|
109
93
|
|
|
110
94
|
await reactor.addAction(
|
|
111
95
|
driveId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/codegen",
|
|
3
|
-
"version": "3.3.0-dev.
|
|
3
|
+
"version": "3.3.0-dev.17",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"kysely": "^0.28.2",
|
|
34
34
|
"kysely-pglite": "^0.6.1",
|
|
35
35
|
"prettier": "^3.4.2",
|
|
36
|
-
"@powerhousedao/config": "3.3.0-dev.
|
|
37
|
-
"document-model": "3.3.0-dev.
|
|
36
|
+
"@powerhousedao/config": "3.3.0-dev.17",
|
|
37
|
+
"document-model": "3.3.0-dev.17"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@graphql-codegen/core": "^4.0.2",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"husky": "^8.0.3",
|
|
45
45
|
"vitest": "^3.1.2",
|
|
46
46
|
"zod": "^3.24.3",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
47
|
+
"@powerhousedao/reactor-api": "3.3.0-dev.17",
|
|
48
|
+
"document-drive": "3.3.0-dev.17"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build:tsc": "tsc --build",
|