@powerhousedao/reactor-api 1.8.0 → 1.9.0
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/CHANGELOG.md +14 -13
- package/dist/index.d.ts +0 -1
- package/dist/index.js +22295 -711
- package/dist/index.js.map +1 -1
- package/package.json +6 -10
- package/src/router.ts +8 -9
- package/tsconfig.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/reactor-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,13 +19,9 @@
|
|
|
19
19
|
"@types/pg": "^8.11.10",
|
|
20
20
|
"esbuild": "^0.24.0",
|
|
21
21
|
"graphql-tag": "^2.12.6",
|
|
22
|
-
"
|
|
23
|
-
"document-
|
|
24
|
-
"
|
|
25
|
-
},
|
|
26
|
-
"peerDependencies": {
|
|
27
|
-
"@powerhousedao/scalars": "1.11.0",
|
|
28
|
-
"document-model": "2.9.0"
|
|
22
|
+
"@powerhousedao/scalars": "1.12.0",
|
|
23
|
+
"document-drive": "1.8.0",
|
|
24
|
+
"document-model": "2.10.0"
|
|
29
25
|
},
|
|
30
26
|
"dependencies": {
|
|
31
27
|
"@apollo/server": "^4.11.0",
|
|
@@ -41,11 +37,11 @@
|
|
|
41
37
|
"nanoevents": "^9.0.0",
|
|
42
38
|
"pg": "^8.13.0",
|
|
43
39
|
"uuid": "^9.0.1",
|
|
44
|
-
"document-model-libs": "1.
|
|
40
|
+
"document-model-libs": "1.119.0"
|
|
45
41
|
},
|
|
46
42
|
"scripts": {
|
|
47
43
|
"build": "tsup",
|
|
48
|
-
"test": "vitest",
|
|
44
|
+
"test": "vitest run",
|
|
49
45
|
"lint": "eslint"
|
|
50
46
|
}
|
|
51
47
|
}
|
package/src/router.ts
CHANGED
|
@@ -10,7 +10,6 @@ import { PgDatabase } from "drizzle-orm/pg-core";
|
|
|
10
10
|
import { drizzle as drizzlePglite } from "drizzle-orm/pglite";
|
|
11
11
|
import express, { IRouter, Router } from "express";
|
|
12
12
|
import pg from "pg";
|
|
13
|
-
const { Pool } = pg;
|
|
14
13
|
import {
|
|
15
14
|
InternalListenerManager,
|
|
16
15
|
InternalListenerModule,
|
|
@@ -18,7 +17,7 @@ import {
|
|
|
18
17
|
import { driveSubgraph, systemSubgraph } from "./subgraphs";
|
|
19
18
|
import { Context, Processor } from "./types";
|
|
20
19
|
import { createSchema } from "./utils/create-schema";
|
|
21
|
-
|
|
20
|
+
const { Pool } = pg;
|
|
22
21
|
|
|
23
22
|
export class ReactorRouterManager {
|
|
24
23
|
private database: PgDatabase<any, any, any> | undefined;
|
|
@@ -44,8 +43,8 @@ export class ReactorRouterManager {
|
|
|
44
43
|
private readonly driveServer: IDocumentDriveServer,
|
|
45
44
|
private readonly client: PGlite | typeof Pool = new PGlite(),
|
|
46
45
|
private listenerManager: InternalListenerManager = new InternalListenerManager(
|
|
47
|
-
driveServer
|
|
48
|
-
)
|
|
46
|
+
driveServer,
|
|
47
|
+
),
|
|
49
48
|
) {}
|
|
50
49
|
|
|
51
50
|
async init() {
|
|
@@ -57,7 +56,7 @@ export class ReactorRouterManager {
|
|
|
57
56
|
await this.listenerManager.init();
|
|
58
57
|
const models = this.driveServer.getDocumentModels();
|
|
59
58
|
const driveModel = models.find(
|
|
60
|
-
(it) => it.documentModel.name === "DocumentDrive"
|
|
59
|
+
(it) => it.documentModel.name === "DocumentDrive",
|
|
61
60
|
);
|
|
62
61
|
if (!driveModel) {
|
|
63
62
|
throw new Error("DocumentDrive model required");
|
|
@@ -68,7 +67,7 @@ export class ReactorRouterManager {
|
|
|
68
67
|
});
|
|
69
68
|
|
|
70
69
|
this.app.use(this.path, (req, res, next) =>
|
|
71
|
-
this.reactorRouter(req, res, next)
|
|
70
|
+
this.reactorRouter(req, res, next),
|
|
72
71
|
);
|
|
73
72
|
|
|
74
73
|
await this.updateRouter();
|
|
@@ -99,7 +98,7 @@ export class ReactorRouterManager {
|
|
|
99
98
|
const schema = createSchema(
|
|
100
99
|
this.driveServer,
|
|
101
100
|
subgraphConfig.resolvers,
|
|
102
|
-
subgraphConfig.typeDefs
|
|
101
|
+
subgraphConfig.typeDefs,
|
|
103
102
|
);
|
|
104
103
|
// create apollo server
|
|
105
104
|
const server = new ApolloServer({
|
|
@@ -125,7 +124,7 @@ export class ReactorRouterManager {
|
|
|
125
124
|
// analyticStore: undefined, // TODO: add analytic store
|
|
126
125
|
...this.getAdditionalContextFields(),
|
|
127
126
|
}),
|
|
128
|
-
})
|
|
127
|
+
}),
|
|
129
128
|
);
|
|
130
129
|
}
|
|
131
130
|
|
|
@@ -137,7 +136,7 @@ export class ReactorRouterManager {
|
|
|
137
136
|
const schema = createSchema(
|
|
138
137
|
this.driveServer,
|
|
139
138
|
processor.resolvers,
|
|
140
|
-
processor.typeDefs
|
|
139
|
+
processor.typeDefs,
|
|
141
140
|
);
|
|
142
141
|
|
|
143
142
|
this.registry.unshift({
|
package/tsconfig.json
CHANGED