@powerhousedao/reactor-api 1.29.16-dev.1 → 1.29.17-dev.1
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.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/src/graphql/analytics/index.d.ts.map +1 -0
- package/dist/src/{subgraphs → graphql}/analytics/index.js +1 -1
- package/dist/src/graphql/auth/env/getters.d.ts.map +1 -0
- package/dist/src/graphql/auth/env/index.d.ts.map +1 -0
- package/dist/src/graphql/auth/index.d.ts +11 -0
- package/dist/src/graphql/auth/index.d.ts.map +1 -0
- package/dist/src/{subgraphs → graphql}/auth/index.js +2 -2
- package/dist/src/{subgraphs → graphql}/auth/types.d.ts +1 -1
- package/dist/src/graphql/auth/types.d.ts.map +1 -0
- package/dist/src/{subgraphs → graphql}/auth/utils/helpers.d.ts +1 -1
- package/dist/src/graphql/auth/utils/helpers.d.ts.map +1 -0
- package/dist/src/{subgraphs → graphql}/auth/utils/helpers.js +1 -1
- package/dist/src/{subgraphs → graphql}/auth/utils/session.d.ts +1 -1
- package/dist/src/graphql/auth/utils/session.d.ts.map +1 -0
- package/dist/src/graphql/auth/utils/user.d.ts.map +1 -0
- package/dist/src/{subgraphs → graphql}/base/index.d.ts +3 -3
- package/dist/src/graphql/base/index.d.ts.map +1 -0
- package/dist/src/{subgraphs → graphql}/base/index.js +2 -2
- package/dist/src/{subgraphs → graphql}/drive/index.d.ts +2 -2
- package/dist/src/graphql/drive/index.d.ts.map +1 -0
- package/dist/src/{subgraphs → graphql}/drive/index.js +1 -1
- package/dist/src/graphql/drive/temp-hack-rwa-type-defs.d.ts.map +1 -0
- package/dist/src/{subgraphs/manager.d.ts → graphql/graphql-manager.d.ts} +2 -2
- package/dist/src/graphql/graphql-manager.d.ts.map +1 -0
- package/dist/src/{subgraphs/manager.js → graphql/graphql-manager.js} +9 -2
- package/dist/src/graphql/index.d.ts.map +1 -0
- package/dist/src/graphql/playground.d.ts +2 -0
- package/dist/src/graphql/playground.d.ts.map +1 -0
- package/dist/src/graphql/playground.js +73 -0
- package/dist/src/graphql/system/env/getters.d.ts.map +1 -0
- package/dist/src/graphql/system/env/index.d.ts.map +1 -0
- package/dist/src/{subgraphs → graphql}/system/index.d.ts +1 -1
- package/dist/src/graphql/system/index.d.ts.map +1 -0
- package/dist/src/{subgraphs → graphql}/system/index.js +2 -2
- package/dist/src/{subgraphs → graphql}/system/types.d.ts +1 -1
- package/dist/src/graphql/system/types.d.ts.map +1 -0
- package/dist/src/{subgraphs → graphql}/types.d.ts +2 -2
- package/dist/src/{subgraphs → graphql}/types.d.ts.map +1 -1
- package/dist/src/package-manager.d.ts +10 -11
- package/dist/src/package-manager.d.ts.map +1 -1
- package/dist/src/package-manager.js +20 -24
- package/dist/src/processor-manager.d.ts +40 -0
- package/dist/src/processor-manager.d.ts.map +1 -0
- package/dist/src/processor-manager.js +65 -0
- package/dist/src/server.d.ts.map +1 -1
- package/dist/src/server.js +93 -38
- package/dist/src/sync/utils.d.ts +2 -2
- package/dist/src/sync/utils.d.ts.map +1 -1
- package/dist/src/types.d.ts +19 -3
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/create-schema.d.ts +1 -1
- package/dist/src/utils/create-schema.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -3
- package/dist/src/subgraphs/analytics/index.d.ts.map +0 -1
- package/dist/src/subgraphs/auth/env/getters.d.ts.map +0 -1
- package/dist/src/subgraphs/auth/env/index.d.ts.map +0 -1
- package/dist/src/subgraphs/auth/index.d.ts +0 -11
- package/dist/src/subgraphs/auth/index.d.ts.map +0 -1
- package/dist/src/subgraphs/auth/types.d.ts.map +0 -1
- package/dist/src/subgraphs/auth/utils/helpers.d.ts.map +0 -1
- package/dist/src/subgraphs/auth/utils/session.d.ts.map +0 -1
- package/dist/src/subgraphs/auth/utils/user.d.ts.map +0 -1
- package/dist/src/subgraphs/base/index.d.ts.map +0 -1
- package/dist/src/subgraphs/drive/index.d.ts.map +0 -1
- package/dist/src/subgraphs/drive/temp-hack-rwa-type-defs.d.ts.map +0 -1
- package/dist/src/subgraphs/index.d.ts.map +0 -1
- package/dist/src/subgraphs/manager.d.ts.map +0 -1
- package/dist/src/subgraphs/system/env/getters.d.ts.map +0 -1
- package/dist/src/subgraphs/system/env/index.d.ts.map +0 -1
- package/dist/src/subgraphs/system/index.d.ts.map +0 -1
- package/dist/src/subgraphs/system/types.d.ts.map +0 -1
- /package/dist/src/{subgraphs → graphql}/analytics/index.d.ts +0 -0
- /package/dist/src/{subgraphs → graphql}/auth/env/getters.d.ts +0 -0
- /package/dist/src/{subgraphs → graphql}/auth/env/getters.js +0 -0
- /package/dist/src/{subgraphs → graphql}/auth/env/index.d.ts +0 -0
- /package/dist/src/{subgraphs → graphql}/auth/env/index.js +0 -0
- /package/dist/src/{subgraphs → graphql}/auth/types.js +0 -0
- /package/dist/src/{subgraphs → graphql}/auth/utils/session.js +0 -0
- /package/dist/src/{subgraphs → graphql}/auth/utils/user.d.ts +0 -0
- /package/dist/src/{subgraphs → graphql}/auth/utils/user.js +0 -0
- /package/dist/src/{subgraphs → graphql}/drive/temp-hack-rwa-type-defs.d.ts +0 -0
- /package/dist/src/{subgraphs → graphql}/drive/temp-hack-rwa-type-defs.js +0 -0
- /package/dist/src/{subgraphs → graphql}/index.d.ts +0 -0
- /package/dist/src/{subgraphs → graphql}/index.js +0 -0
- /package/dist/src/{subgraphs → graphql}/system/env/getters.d.ts +0 -0
- /package/dist/src/{subgraphs → graphql}/system/env/getters.js +0 -0
- /package/dist/src/{subgraphs → graphql}/system/env/index.d.ts +0 -0
- /package/dist/src/{subgraphs → graphql}/system/env/index.js +0 -0
- /package/dist/src/{subgraphs → graphql}/system/types.js +0 -0
- /package/dist/src/{subgraphs → graphql}/types.js +0 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { InternalTransmitter } from "document-drive/server/listener/transmitter/internal";
|
|
2
|
+
import { generateId } from "document-model";
|
|
3
|
+
export class ProcessorManager {
|
|
4
|
+
listeners;
|
|
5
|
+
drive;
|
|
6
|
+
operationalStore;
|
|
7
|
+
analyticsStore;
|
|
8
|
+
idToFactory = new Map();
|
|
9
|
+
identifierToListeners = new Map();
|
|
10
|
+
constructor(listeners, drive, operationalStore, analyticsStore) {
|
|
11
|
+
this.listeners = listeners;
|
|
12
|
+
this.drive = drive;
|
|
13
|
+
this.operationalStore = operationalStore;
|
|
14
|
+
this.analyticsStore = analyticsStore;
|
|
15
|
+
//
|
|
16
|
+
}
|
|
17
|
+
async registerFactory(identifier, factory) {
|
|
18
|
+
this.idToFactory.set(identifier, factory);
|
|
19
|
+
// iterate over all drives and register the factory
|
|
20
|
+
const driveIds = await this.drive.getDrives();
|
|
21
|
+
for (const driveId of driveIds) {
|
|
22
|
+
await this.registerDrive(driveId);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async unregisterFactory(identifier) {
|
|
26
|
+
// remove all listeners for this identifier
|
|
27
|
+
const listeners = this.identifierToListeners.get(identifier) ?? [];
|
|
28
|
+
for (const listener of listeners) {
|
|
29
|
+
this.listeners.removeListener(listener.driveId, listener.listenerId);
|
|
30
|
+
if (listener.transmitter?.disconnect) {
|
|
31
|
+
await listener.transmitter.disconnect();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
this.identifierToListeners.set(identifier, []);
|
|
35
|
+
}
|
|
36
|
+
async registerDrive(driveId) {
|
|
37
|
+
const module = {
|
|
38
|
+
operationalStore: this.operationalStore,
|
|
39
|
+
analyticsStore: this.analyticsStore,
|
|
40
|
+
};
|
|
41
|
+
// iterate over all factories and create listeners
|
|
42
|
+
await Promise.all(Object.entries(this.idToFactory).map(([identifier, factory]) => {
|
|
43
|
+
let listeners = this.identifierToListeners.get(identifier) ?? [];
|
|
44
|
+
if (!listeners) {
|
|
45
|
+
listeners = [];
|
|
46
|
+
this.identifierToListeners.set(identifier, listeners);
|
|
47
|
+
}
|
|
48
|
+
const processors = factory(driveId, module);
|
|
49
|
+
for (const { filter, processor } of processors) {
|
|
50
|
+
const id = generateId();
|
|
51
|
+
const listener = {
|
|
52
|
+
driveId,
|
|
53
|
+
listenerId: id,
|
|
54
|
+
block: false,
|
|
55
|
+
system: false,
|
|
56
|
+
filter,
|
|
57
|
+
callInfo: undefined,
|
|
58
|
+
transmitter: new InternalTransmitter(this.drive, processor),
|
|
59
|
+
};
|
|
60
|
+
this.listeners.setListener(driveId, listener);
|
|
61
|
+
listeners.push(listener);
|
|
62
|
+
}
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
}
|
package/dist/src/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAOnD,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAgB,EAAE,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AAMhD,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EAAoB,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAGxD,KAAK,OAAO,GAAG;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,IAAI,GAAG,SAAS,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EACF;QACE,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;KAClB,GACD,OAAO,GACP,SAAS,CAAC;CACf,CAAC;AAmKF,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,GAAG,CAAC,CAoDd"}
|
package/dist/src/server.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { GraphQLManager } from "#graphql/graphql-manager.js";
|
|
2
|
+
import { renderGraphqlPlayground } from "#graphql/playground.js";
|
|
3
|
+
import { getUniqueDocumentModels, PackagesManager, } from "#package-manager.js";
|
|
4
|
+
import { ProcessorManager } from "#processor-manager.js";
|
|
3
5
|
import { KnexAnalyticsStore, KnexQueryExecutor, } from "@powerhousedao/analytics-engine-knex";
|
|
4
6
|
import devcert from "devcert";
|
|
5
7
|
import express from "express";
|
|
@@ -8,14 +10,36 @@ import https from "node:https";
|
|
|
8
10
|
import path from "node:path";
|
|
9
11
|
import { getDbClient } from "./utils/db.js";
|
|
10
12
|
const DEFAULT_PORT = 4000;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Sets up the Express app with necessary routes
|
|
15
|
+
*/
|
|
16
|
+
function setupGraphQlExplorer(app) {
|
|
17
|
+
app.get("/explorer/:endpoint?", (req, res) => {
|
|
18
|
+
res.setHeader("Content-Type", "text/html");
|
|
19
|
+
const basePath = process.env.BASE_PATH === "/" ? "" : process.env.BASE_PATH || "";
|
|
20
|
+
const endpoint = `${basePath}${req.params.endpoint !== undefined ? `/${req.params.endpoint}` : "/graphql"}`;
|
|
21
|
+
const { query } = req.query;
|
|
22
|
+
if (query && typeof query !== "string") {
|
|
23
|
+
throw new Error("Invalid query");
|
|
24
|
+
}
|
|
25
|
+
res.send(renderGraphqlPlayground(endpoint, query));
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Initializes the database and analytics store
|
|
30
|
+
*/
|
|
31
|
+
function initializeDatabaseAndAnalytics(dbPath) {
|
|
32
|
+
const db = getDbClient(dbPath);
|
|
15
33
|
const analyticsStore = new KnexAnalyticsStore({
|
|
16
34
|
executor: new KnexQueryExecutor(),
|
|
17
35
|
knex: db,
|
|
18
36
|
});
|
|
37
|
+
return { db, analyticsStore };
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Initializes the package manager and returns the result
|
|
41
|
+
*/
|
|
42
|
+
async function initializePackageManager(options) {
|
|
19
43
|
const pkgManager = new PackagesManager(options.configFile
|
|
20
44
|
? {
|
|
21
45
|
configFile: options.configFile,
|
|
@@ -23,55 +47,58 @@ export async function startAPI(reactor, options) {
|
|
|
23
47
|
: {
|
|
24
48
|
packages: options.packages ?? [],
|
|
25
49
|
});
|
|
26
|
-
const result = await pkgManager.init();
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
50
|
+
const result = (await pkgManager.init());
|
|
51
|
+
return { pkgManager, result };
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Sets up the subgraph manager and registers subgraphs
|
|
55
|
+
*/
|
|
56
|
+
async function setupGraphQLManager(app, reactor, db, analyticsStore, result) {
|
|
57
|
+
const graphqlManager = new GraphQLManager("/", app, reactor, db, analyticsStore);
|
|
58
|
+
await graphqlManager.init();
|
|
59
|
+
if (result.subgraphs) {
|
|
60
|
+
for (const [supergraph, subgraphs] of result.subgraphs.entries()) {
|
|
36
61
|
for (const subgraph of subgraphs) {
|
|
37
|
-
|
|
62
|
+
graphqlManager.registerSubgraph(subgraph, supergraph);
|
|
38
63
|
}
|
|
39
64
|
}
|
|
40
65
|
}
|
|
66
|
+
return graphqlManager;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Sets up event listeners for package manager changes
|
|
70
|
+
*/
|
|
71
|
+
function setupEventListeners(pkgManager, reactor, graphqlManager, processorManager) {
|
|
41
72
|
pkgManager.onDocumentModelsChange((documentModels) => {
|
|
42
73
|
const uniqueModels = getUniqueDocumentModels(Object.values(documentModels).flat());
|
|
43
74
|
reactor.setDocumentModelModules(uniqueModels);
|
|
44
|
-
|
|
75
|
+
graphqlManager.updateRouter();
|
|
45
76
|
});
|
|
46
77
|
pkgManager.onSubgraphsChange((packagedSubgraphs) => {
|
|
47
78
|
for (const [supergraph, subgraphs] of packagedSubgraphs) {
|
|
48
79
|
for (const subgraph of subgraphs) {
|
|
49
|
-
|
|
80
|
+
graphqlManager.registerSubgraph(subgraph, supergraph);
|
|
50
81
|
}
|
|
51
82
|
}
|
|
52
83
|
});
|
|
53
|
-
pkgManager.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
reactor.listeners
|
|
61
|
-
.setListener(listener.driveId, listener)
|
|
62
|
-
.catch((error) => {
|
|
63
|
-
console.error(`Failed to set listener ${listener.listenerId} for drive ${listener.driveId}:`, error);
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
});
|
|
84
|
+
pkgManager.onProcessorsChange(async (processors) => {
|
|
85
|
+
for (const [packageName, factory] of processors) {
|
|
86
|
+
await processorManager.unregisterFactory(packageName);
|
|
87
|
+
await processorManager.registerFactory(packageName, factory);
|
|
88
|
+
}
|
|
67
89
|
});
|
|
68
|
-
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Starts the server (HTTP or HTTPS)
|
|
93
|
+
*/
|
|
94
|
+
async function startServer(app, port, httpsOptions) {
|
|
95
|
+
if (httpsOptions) {
|
|
69
96
|
const currentDir = process.cwd();
|
|
70
97
|
let server;
|
|
71
|
-
if (typeof
|
|
98
|
+
if (typeof httpsOptions === "object") {
|
|
72
99
|
server = https.createServer({
|
|
73
|
-
key: fs.readFileSync(path.join(currentDir,
|
|
74
|
-
cert: fs.readFileSync(path.join(currentDir,
|
|
100
|
+
key: fs.readFileSync(path.join(currentDir, httpsOptions.keyPath)),
|
|
101
|
+
cert: fs.readFileSync(path.join(currentDir, httpsOptions.certPath)),
|
|
75
102
|
}, app);
|
|
76
103
|
}
|
|
77
104
|
else {
|
|
@@ -92,5 +119,33 @@ export async function startAPI(reactor, options) {
|
|
|
92
119
|
else {
|
|
93
120
|
app.listen(port);
|
|
94
121
|
}
|
|
95
|
-
|
|
122
|
+
}
|
|
123
|
+
export async function startAPI(reactor, options) {
|
|
124
|
+
const port = options.port ?? DEFAULT_PORT;
|
|
125
|
+
const app = options.express ?? express();
|
|
126
|
+
// Set up Express app with routes
|
|
127
|
+
setupGraphQlExplorer(app);
|
|
128
|
+
// Initialize database and analytics store
|
|
129
|
+
const { db, analyticsStore } = initializeDatabaseAndAnalytics(options.dbPath);
|
|
130
|
+
// Initialize package manager
|
|
131
|
+
const { pkgManager, result } = await initializePackageManager(options);
|
|
132
|
+
const documentModels = result.documentModels ?? [];
|
|
133
|
+
// initialize processors
|
|
134
|
+
const processorManager = new ProcessorManager(reactor.listeners, reactor, db, analyticsStore);
|
|
135
|
+
const packageToProcessorFactory = result.processors ?? new Map();
|
|
136
|
+
for (const [packageName, factory] of packageToProcessorFactory) {
|
|
137
|
+
processorManager.registerFactory(packageName, factory);
|
|
138
|
+
}
|
|
139
|
+
// Set document model modules
|
|
140
|
+
reactor.setDocumentModelModules(getUniqueDocumentModels([
|
|
141
|
+
...reactor.getDocumentModelModules(),
|
|
142
|
+
...documentModels,
|
|
143
|
+
]));
|
|
144
|
+
// Set up subgraph manager
|
|
145
|
+
const graphqlManager = await setupGraphQLManager(app, reactor, db, analyticsStore, result);
|
|
146
|
+
// Set up event listeners
|
|
147
|
+
setupEventListeners(pkgManager, reactor, graphqlManager, processorManager);
|
|
148
|
+
// Start the server
|
|
149
|
+
await startServer(app, port, options.https);
|
|
150
|
+
return { app, graphqlManager, processorManager };
|
|
96
151
|
}
|
package/dist/src/sync/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IDocumentDriveServer, ListenerRevision, StrandUpdate } from "document-drive";
|
|
2
|
-
import { Operation, OperationScope } from "document-model";
|
|
1
|
+
import { type IDocumentDriveServer, type ListenerRevision, type StrandUpdate } from "document-drive";
|
|
2
|
+
import { type Operation, type OperationScope } from "document-model";
|
|
3
3
|
export type InternalStrandUpdate = {
|
|
4
4
|
operations: Operation[];
|
|
5
5
|
documentId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/sync/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/sync/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EAErB,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrE,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,cAAc,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAGF,eAAO,MAAM,iBAAiB,GAC5B,SAAS,oBAAoB,EAC7B,QAAQ,oBAAoB,KAC3B,OAAO,CAAC,gBAAgB,CAkC1B,CAAC;AAGF,eAAO,MAAM,kBAAkB,GAC7B,SAAS,oBAAoB,EAC7B,SAAS,MAAM,EACf,YAAY,MAAM,EAClB,WAAW,gBAAgB,EAAE,KAC5B,OAAO,CAAC,OAAO,CAKjB,CAAC;AAGF,eAAO,MAAM,iBAAiB,GAC5B,SAAS,oBAAoB,EAC7B,SAAS,MAAM,EACf,YAAY,MAAM,EAClB,OAAO,MAAM,GAAG,SAAS,KACxB,OAAO,CAAC,YAAY,EAAE,CAKxB,CAAC"}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { IProcessorManager } from "#processor-manager.js";
|
|
2
|
+
import { IAnalyticsStore } from "@powerhousedao/analytics-engine-core";
|
|
3
|
+
import { IReceiver, ListenerFilter } from "document-drive";
|
|
4
|
+
import { type Express } from "express";
|
|
5
|
+
import { type GraphQLManager } from "./graphql/graphql-manager.js";
|
|
6
|
+
import { Db } from "./utils/db.js";
|
|
3
7
|
export type { Db } from "./utils/db.js";
|
|
4
8
|
export type API = {
|
|
5
9
|
app: Express;
|
|
6
|
-
|
|
10
|
+
graphqlManager: GraphQLManager;
|
|
11
|
+
processorManager: IProcessorManager;
|
|
7
12
|
};
|
|
13
|
+
export interface IProcessor extends IReceiver {
|
|
14
|
+
}
|
|
15
|
+
export type ProcessorRecord = {
|
|
16
|
+
processor: IProcessor;
|
|
17
|
+
filter: ListenerFilter;
|
|
18
|
+
};
|
|
19
|
+
export type ReactorModule = {
|
|
20
|
+
analyticsStore: IAnalyticsStore;
|
|
21
|
+
operationalStore: Db;
|
|
22
|
+
};
|
|
23
|
+
export type ProcessorFactory = (driveId: string, module: ReactorModule) => ProcessorRecord[];
|
|
8
24
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAEnC,YAAY,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,MAAM,GAAG,GAAG;IAChB,GAAG,EAAE,OAAO,CAAC;IACb,cAAc,EAAE,cAAc,CAAC;IAC/B,gBAAgB,EAAE,iBAAiB,CAAC;CACrC,CAAC;AAEF,MAAM,WAAW,UAAW,SAAQ,SAAS;CAE5C;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,UAAU,CAAC;IACtB,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,cAAc,EAAE,eAAe,CAAC;IAChC,gBAAgB,EAAE,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAC7B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,aAAa,KAClB,eAAe,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Context } from "#
|
|
1
|
+
import { type Context } from "#graphql/types.js";
|
|
2
2
|
import { type GraphQLResolverMap } from "@apollo/subgraph/dist/schema-helper/resolverMap.js";
|
|
3
3
|
import { type IDocumentDriveServer } from "document-drive";
|
|
4
4
|
import { type DocumentNode } from "graphql";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-schema.d.ts","sourceRoot":"","sources":["../../../src/utils/create-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"create-schema.d.ts","sourceRoot":"","sources":["../../../src/utils/create-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAG7F,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,eAAO,MAAM,YAAY,GACvB,qBAAqB,oBAAoB,EACzC,WAAW,kBAAkB,CAAC,OAAO,CAAC,EACtC,UAAU,YAAY,oCAavB,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,qBAAqB,oBAAoB,EACzC,UAAU,YAAY,iBA2IvB,CAAC"}
|