@powerhousedao/reactor-api 1.20.0 → 1.20.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/reactor-api",
3
- "version": "1.20.0",
3
+ "version": "1.20.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "esbuild": "^0.24.0",
25
25
  "graphql-tag": "^2.12.6",
26
26
  "@powerhousedao/scalars": "1.22.0",
27
- "document-drive": "1.17.0",
27
+ "document-drive": "1.17.2",
28
28
  "document-model": "2.19.0"
29
29
  },
30
30
  "dependencies": {
@@ -34,6 +34,7 @@
34
34
  "@powerhousedao/analytics-engine-core": "^0.3.2",
35
35
  "@powerhousedao/analytics-engine-knex": "^0.4.0",
36
36
  "body-parser": "^1.20.3",
37
+ "change-case": "^5.4.4",
37
38
  "cors": "^2.8.5",
38
39
  "dotenv": "^16.4.5",
39
40
  "drizzle-kit": "^0.25.0",
@@ -51,7 +52,7 @@
51
52
  "uuid": "^9.0.1",
52
53
  "wildcard-match": "^5.1.3",
53
54
  "zod": "^3.24.1",
54
- "document-model-libs": "1.131.0"
55
+ "document-model-libs": "1.131.2"
55
56
  },
56
57
  "scripts": {
57
58
  "build": "tsup",
@@ -1,4 +1,5 @@
1
1
  import { GraphQLResolverMap } from "@apollo/subgraph/dist/schema-helper";
2
+ import { pascalCase } from "change-case";
2
3
  import {
3
4
  generateUUID,
4
5
  ListenerRevision,
@@ -212,6 +213,9 @@ export class DriveSubgraph extends Subgraph {
212
213
  );
213
214
  const globalState = document.state.global;
214
215
  if (!globalState) throw new Error("Document not found");
216
+ const typeName = pascalCase(
217
+ (dm?.documentModel.name || "").replaceAll("/", " "),
218
+ );
215
219
  const response = {
216
220
  ...document,
217
221
  id,
@@ -225,7 +229,7 @@ export class DriveSubgraph extends Subgraph {
225
229
  : JSON.stringify(op.input),
226
230
  })),
227
231
  initialState: document.initialState.state.global,
228
- __typename: dm?.documentModel.name,
232
+ __typename: typeName,
229
233
  };
230
234
  return response;
231
235
  },
@@ -1,8 +1,9 @@
1
1
  import { buildSubgraphSchema } from "@apollo/subgraph";
2
- import { IDocumentDriveServer } from "document-drive";
3
2
  import { GraphQLResolverMap } from "@apollo/subgraph/dist/schema-helper";
4
3
  import { typeDefs as scalarsTypeDefs } from "@powerhousedao/scalars";
5
- import { DocumentNode, parse } from "graphql";
4
+ import { pascalCase } from "change-case";
5
+ import { IDocumentDriveServer } from "document-drive";
6
+ import { DocumentNode } from "graphql";
6
7
  import gql from "graphql-tag";
7
8
  import { Context } from "src/subgraphs";
8
9
 
@@ -25,7 +26,7 @@ export const getDocumentModelTypeDefs = (
25
26
  const documentModels = documentDriveServer.getDocumentModels();
26
27
  let dmSchema = "";
27
28
  documentModels.forEach(({ documentModel }) => {
28
- const dmSchemaName = documentModel.name.replaceAll(" ", "");
29
+ const dmSchemaName = pascalCase(documentModel.name.replaceAll("/", " "));
29
30
  let tmpDmSchema = `
30
31
  ${documentModel.specifications
31
32
  .map((specification) =>