@powerhousedao/reactor-api 2.5.0-dev.29 → 2.5.0-dev.30
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/README.md +96 -0
- package/package.json +5 -5
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @powerhousedao/reactor-api
|
|
2
|
+
|
|
3
|
+
A powerful API server implementation for the Powerhouse ecosystem that provides GraphQL capabilities, document processing, and package management.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🚀 Express-based API server with GraphQL support
|
|
8
|
+
- 📦 Flexible package management system
|
|
9
|
+
- 🔄 Document processing and event handling
|
|
10
|
+
- 🔐 Authentication and authorization support
|
|
11
|
+
- 📊 Analytics integration
|
|
12
|
+
- 🗄️ Database management with PostgreSQL support
|
|
13
|
+
- 🔌 Extensible subgraph system
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @powerhousedao/reactor-api
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { startAPI } from '@powerhousedao/reactor-api';
|
|
25
|
+
|
|
26
|
+
const api = await startAPI(reactor, {
|
|
27
|
+
port: 3000,
|
|
28
|
+
dbPath: './data',
|
|
29
|
+
auth: {
|
|
30
|
+
enabled: true,
|
|
31
|
+
admins: ['0x...'],
|
|
32
|
+
users: ['0x...'],
|
|
33
|
+
guests: ['0x...']
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Core Components
|
|
39
|
+
|
|
40
|
+
### API Server
|
|
41
|
+
The API server provides a robust Express-based implementation with GraphQL support, authentication middleware, and HTTPS capabilities.
|
|
42
|
+
|
|
43
|
+
### Package Manager
|
|
44
|
+
Manages document models, subgraphs, and processors through a flexible loading system that supports multiple package sources.
|
|
45
|
+
|
|
46
|
+
### GraphQL Manager
|
|
47
|
+
Handles GraphQL operations, subgraph management, and schema composition using Apollo Server.
|
|
48
|
+
|
|
49
|
+
### Processor Manager
|
|
50
|
+
Manages document processors and their lifecycle, including registration and event handling.
|
|
51
|
+
|
|
52
|
+
## Configuration
|
|
53
|
+
|
|
54
|
+
The API can be configured with the following options:
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
type Options = {
|
|
58
|
+
express?: Express;
|
|
59
|
+
port?: number;
|
|
60
|
+
dbPath: string;
|
|
61
|
+
client?: PGlite | Pool;
|
|
62
|
+
configFile?: string;
|
|
63
|
+
packages?: string[];
|
|
64
|
+
auth?: {
|
|
65
|
+
enabled: boolean;
|
|
66
|
+
guests: string[];
|
|
67
|
+
users: string[];
|
|
68
|
+
admins: string[];
|
|
69
|
+
};
|
|
70
|
+
https?: {
|
|
71
|
+
keyPath: string;
|
|
72
|
+
certPath: string;
|
|
73
|
+
} | boolean;
|
|
74
|
+
packageLoader?: IPackageLoader;
|
|
75
|
+
};
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Development
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Install dependencies
|
|
82
|
+
npm install
|
|
83
|
+
|
|
84
|
+
# Build the package
|
|
85
|
+
npm run build
|
|
86
|
+
|
|
87
|
+
# Run tests
|
|
88
|
+
npm test
|
|
89
|
+
|
|
90
|
+
# Run linter
|
|
91
|
+
npm run lint
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
|
|
96
|
+
AGPL-3.0-only - See [LICENSE](LICENSE) for details.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/reactor-api",
|
|
3
|
-
"version": "2.5.0-dev.
|
|
3
|
+
"version": "2.5.0-dev.30",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -68,10 +68,10 @@
|
|
|
68
68
|
"uuid": "^9.0.1",
|
|
69
69
|
"wildcard-match": "^5.1.3",
|
|
70
70
|
"zod": "^3.24.3",
|
|
71
|
-
"@powerhousedao/config": "2.5.0-dev.
|
|
72
|
-
"
|
|
73
|
-
"document-model": "2.5.0-dev.
|
|
74
|
-
"
|
|
71
|
+
"@powerhousedao/config": "2.5.0-dev.30",
|
|
72
|
+
"@renown/sdk": "2.5.0-dev.30",
|
|
73
|
+
"document-model": "2.5.0-dev.30",
|
|
74
|
+
"document-drive": "2.5.0-dev.30"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
77
|
"build": "tsc --build",
|