@sola-air-ui/relay 1.0.0 → 1.0.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/README.md +43 -0
- package/package.json +36 -29
- package/src/cli.js +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# @sola-air-ui/relay
|
|
2
|
+
|
|
3
|
+
A local data proxy for [Sola AIR](https://sola-air.dev)'s `createData`/`$data` primitive — keeps database credentials on your own machine (or server) instead of shipping them to the browser, and streams live query results to Sola components over a local connection.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @sola-air-ui/relay
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Run
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx sola-relay --db postgres://user:pass@localhost:5432/mydb
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
By default this starts a local relay process that Sola's `createData()` calls connect to for real-time data sync — your Postgres/MySQL credentials never leave the process running the relay.
|
|
18
|
+
|
|
19
|
+
## Supported data sources
|
|
20
|
+
|
|
21
|
+
- **PostgreSQL** (via `pg`)
|
|
22
|
+
- **MySQL** (via `mysql2`)
|
|
23
|
+
- Live updates pushed to connected clients over WebSocket (`ws`)
|
|
24
|
+
|
|
25
|
+
## Usage from a component
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<script>
|
|
29
|
+
let customers = $data('postgres-primary:customers', { sync: 'realtime' });
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<Table rows={customers} />
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`postgres-primary` refers to the connection alias configured when you start the relay — see `sola-relay --help` for connection/alias options.
|
|
36
|
+
|
|
37
|
+
## Security note
|
|
38
|
+
|
|
39
|
+
The relay is designed to run somewhere trusted (your dev machine, or a backend service you control) — never expose its port directly to the public internet without your own auth layer in front of it.
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
MIT — see the [repo root](https://github.com/rbm3267/sola-air) for the full license and [changelog](https://github.com/rbm3267/sola-air/blob/main/CHANGELOG.md).
|
package/package.json
CHANGED
|
@@ -1,29 +1,36 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@sola-air-ui/relay",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Sola Relay — local data proxy that keeps credentials on-device and streams live data to Sola components",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"sola-relay": "
|
|
8
|
-
},
|
|
9
|
-
"main": "./src/index.js",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": "./src/index.js"
|
|
12
|
-
},
|
|
13
|
-
"keywords": [
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@sola-air-ui/relay",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Sola Relay — local data proxy that keeps credentials on-device and streams live data to Sola components",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"sola-relay": "src/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./src/index.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./src/index.js"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"sola",
|
|
15
|
+
"relay",
|
|
16
|
+
"data",
|
|
17
|
+
"postgres",
|
|
18
|
+
"local-first",
|
|
19
|
+
"proxy"
|
|
20
|
+
],
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"homepage": "https://sola-air.dev",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/rbm3267/sola-air.git"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"pg": "^8.11.0",
|
|
29
|
+
"mysql2": "^3.6.0",
|
|
30
|
+
"ws": "^8.14.0"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public",
|
|
34
|
+
"registry": "https://registry.npmjs.org/"
|
|
35
|
+
}
|
|
36
|
+
}
|
package/src/cli.js
CHANGED