@powerhousedao/codegen 3.3.0-dev.6 → 3.3.0-dev.8

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.
@@ -28,7 +28,7 @@ export const getResolvers = (subgraph: Subgraph): Record<string, any> => {
28
28
  ...doc,
29
29
  state: doc.state.global,
30
30
  stateJSON: doc.state.global,
31
- revision: doc.revision.global,
31
+ revision: doc.header.revision["global"] ?? 0,
32
32
  };
33
33
  },
34
34
  getDocuments: async (args: any) => {
@@ -42,13 +42,13 @@ export const getResolvers = (subgraph: Subgraph): Record<string, any> => {
42
42
  ...doc,
43
43
  state: doc.state.global,
44
44
  stateJSON: doc.state.global,
45
- revision: doc.revision.global,
45
+ revision: doc.header.revision["global"] ?? 0,
46
46
  };
47
47
  }),
48
48
  );
49
49
 
50
50
  return docs.filter(
51
- (doc) => doc.documentType === "<%- documentTypeId %>",
51
+ (doc) => doc.header.documentType === "<%- documentTypeId %>",
52
52
  );
53
53
  },
54
54
  };
@@ -95,7 +95,7 @@ export const getResolvers = (subgraph: Subgraph): Record<string, any> => {
95
95
  actions.<%- h.changeCase.camel(op.name) %>({...args.input})
96
96
  );
97
97
 
98
- return doc.revision.global + 1;
98
+ return (doc.header.revision["global"] ?? 0) + 1;
99
99
  },
100
100
 
101
101
  <%_ })}); %>
@@ -94,13 +94,14 @@ export function DriveExplorer({
94
94
  const node = await addDocument(
95
95
  driveId,
96
96
  fileName,
97
- documentModel.documentModel.id
97
+ documentModel.documentModel.id,
98
+ selectedNodeId,
98
99
  );
99
100
 
100
101
  selectedDocumentModel.current = null;
101
102
  setActiveDocumentId(node.id);
102
103
  },
103
- [addDocument, driveId]
104
+ [addDocument, driveId, selectedNodeId]
104
105
  );
105
106
 
106
107
  const onSelectDocumentModel = useCallback(
@@ -61,14 +61,18 @@ export const EditorContainer: React.FC<EditorContainerProps> = (props) => {
61
61
  user,
62
62
  });
63
63
 
64
- const timelineItems = useTimelineItems(documentId, document?.created, driveId);
64
+ const timelineItems = useTimelineItems(
65
+ documentId,
66
+ document?.header.createdAtUtcIso,
67
+ driveId,
68
+ );
65
69
 
66
70
  const onExport = useCallback(async () => {
67
71
  if (document) {
68
72
  const ext = documentModelModule.documentModel.extension;
69
73
  await exportDocument(document, title, ext);
70
74
  }
71
- }, [document?.revision.global, document?.revision.local]);
75
+ }, [document?.header.revision.global, document?.header.revision.local]);
72
76
 
73
77
  const loadingContent = (
74
78
  <div className="flex-1 flex justify-center items-center h-full">
@@ -54,7 +54,7 @@ export function BaseEditor(props: IProps) {
54
54
  style={{ height: "100%" }}
55
55
  >
56
56
  <DriveExplorer
57
- driveId={props.document.id}
57
+ driveId={props.document.header.id}
58
58
  nodes={props.document.state.global.nodes}
59
59
  onAddFolder={onAddFolder}
60
60
  onDeleteNode={onDeleteNode}
@@ -41,16 +41,7 @@ export class <%= pascalName %>Subgraph extends Subgraph {
41
41
  example: "test"
42
42
  }
43
43
 
44
- async onSetup() {
45
- await this.createOperationalTables();
46
- }
47
-
48
- async createOperationalTables() {
49
- await this.operationalStore.schema.createTableIfNotExists("example", (table) => {
50
- table.string("id").primary();
51
- table.string("name");
52
- });
53
- }
44
+ async onSetup() {}
54
45
 
55
46
  async onDisconnect() {}
56
47
  <% } %>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/codegen",
3
- "version": "3.3.0-dev.6",
3
+ "version": "3.3.0-dev.8",
4
4
  "license": "AGPL-3.0-only",
5
5
  "private": false,
6
6
  "type": "module",
@@ -34,8 +34,8 @@
34
34
  "kysely-pglite": "^0.6.1",
35
35
  "prettier": "^3.4.2",
36
36
  "sucrase": "^3.35.0",
37
- "document-model": "3.3.0-dev.6",
38
- "@powerhousedao/config": "3.3.0-dev.6"
37
+ "@powerhousedao/config": "3.3.0-dev.8",
38
+ "document-model": "3.3.0-dev.8"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@graphql-codegen/core": "^4.0.2",
@@ -45,8 +45,8 @@
45
45
  "husky": "^8.0.3",
46
46
  "vitest": "^3.1.2",
47
47
  "zod": "^3.24.3",
48
- "@powerhousedao/reactor-api": "3.3.0-dev.6",
49
- "document-drive": "3.3.0-dev.6"
48
+ "document-drive": "3.3.0-dev.8",
49
+ "@powerhousedao/reactor-api": "3.3.0-dev.8"
50
50
  },
51
51
  "scripts": {
52
52
  "build:tsc": "tsc --build",