@bsb/registry 1.0.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.
Files changed (54) hide show
  1. package/README.md +133 -0
  2. package/bsb-plugin.json +47 -0
  3. package/lib/.bsb/clients/service-bsb-registry.d.ts +1118 -0
  4. package/lib/.bsb/clients/service-bsb-registry.d.ts.map +1 -0
  5. package/lib/.bsb/clients/service-bsb-registry.js +393 -0
  6. package/lib/.bsb/clients/service-bsb-registry.js.map +1 -0
  7. package/lib/plugins/service-bsb-registry/auth.d.ts +87 -0
  8. package/lib/plugins/service-bsb-registry/auth.d.ts.map +1 -0
  9. package/lib/plugins/service-bsb-registry/auth.js +197 -0
  10. package/lib/plugins/service-bsb-registry/auth.js.map +1 -0
  11. package/lib/plugins/service-bsb-registry/db/file.d.ts +73 -0
  12. package/lib/plugins/service-bsb-registry/db/file.d.ts.map +1 -0
  13. package/lib/plugins/service-bsb-registry/db/file.js +588 -0
  14. package/lib/plugins/service-bsb-registry/db/file.js.map +1 -0
  15. package/lib/plugins/service-bsb-registry/db/index.d.ts +75 -0
  16. package/lib/plugins/service-bsb-registry/db/index.d.ts.map +1 -0
  17. package/lib/plugins/service-bsb-registry/db/index.js +24 -0
  18. package/lib/plugins/service-bsb-registry/db/index.js.map +1 -0
  19. package/lib/plugins/service-bsb-registry/index.d.ts +1228 -0
  20. package/lib/plugins/service-bsb-registry/index.d.ts.map +1 -0
  21. package/lib/plugins/service-bsb-registry/index.js +661 -0
  22. package/lib/plugins/service-bsb-registry/index.js.map +1 -0
  23. package/lib/plugins/service-bsb-registry/types.d.ts +559 -0
  24. package/lib/plugins/service-bsb-registry/types.d.ts.map +1 -0
  25. package/lib/plugins/service-bsb-registry/types.js +235 -0
  26. package/lib/plugins/service-bsb-registry/types.js.map +1 -0
  27. package/lib/plugins/service-bsb-registry-ui/http-server.d.ts +138 -0
  28. package/lib/plugins/service-bsb-registry-ui/http-server.d.ts.map +1 -0
  29. package/lib/plugins/service-bsb-registry-ui/http-server.js +1660 -0
  30. package/lib/plugins/service-bsb-registry-ui/http-server.js.map +1 -0
  31. package/lib/plugins/service-bsb-registry-ui/index.d.ts +62 -0
  32. package/lib/plugins/service-bsb-registry-ui/index.d.ts.map +1 -0
  33. package/lib/plugins/service-bsb-registry-ui/index.js +101 -0
  34. package/lib/plugins/service-bsb-registry-ui/index.js.map +1 -0
  35. package/lib/plugins/service-bsb-registry-ui/static/assets/images/apple-touch-icon.png +0 -0
  36. package/lib/plugins/service-bsb-registry-ui/static/assets/images/favicon-16x16.png +0 -0
  37. package/lib/plugins/service-bsb-registry-ui/static/assets/images/favicon-32x32.png +0 -0
  38. package/lib/plugins/service-bsb-registry-ui/static/assets/images/favicon.ico +0 -0
  39. package/lib/plugins/service-bsb-registry-ui/static/css/style.css +1849 -0
  40. package/lib/plugins/service-bsb-registry-ui/static/js/app.js +336 -0
  41. package/lib/plugins/service-bsb-registry-ui/templates/layouts/main.hbs +39 -0
  42. package/lib/plugins/service-bsb-registry-ui/templates/pages/error.hbs +13 -0
  43. package/lib/plugins/service-bsb-registry-ui/templates/pages/home.hbs +62 -0
  44. package/lib/plugins/service-bsb-registry-ui/templates/pages/not-found.hbs +13 -0
  45. package/lib/plugins/service-bsb-registry-ui/templates/pages/plugin-detail.hbs +537 -0
  46. package/lib/plugins/service-bsb-registry-ui/templates/pages/plugins.hbs +40 -0
  47. package/lib/plugins/service-bsb-registry-ui/templates/partials/pagination.hbs +41 -0
  48. package/lib/plugins/service-bsb-registry-ui/templates/partials/plugin-card.hbs +40 -0
  49. package/lib/plugins/service-bsb-registry-ui/templates/partials/search-form.hbs +31 -0
  50. package/lib/schemas/service-bsb-registry-ui.json +57 -0
  51. package/lib/schemas/service-bsb-registry-ui.plugin.json +73 -0
  52. package/lib/schemas/service-bsb-registry.json +1883 -0
  53. package/lib/schemas/service-bsb-registry.plugin.json +68 -0
  54. package/package.json +60 -0
package/README.md ADDED
@@ -0,0 +1,133 @@
1
+ # BSB Registry
2
+
3
+ Multi-language plugin registry for the BSB framework. Publish, discover, and install plugins across Node.js, C#, Go, Java, and Python.
4
+
5
+ ## Architecture
6
+
7
+ The registry is two BSB plugins in one package (`@bsb/registry`):
8
+
9
+ | Plugin | Role |
10
+ |--------|------|
11
+ | **service-bsb-registry** | Core storage and business logic (event-driven, no HTTP) |
12
+ | **service-bsb-registry-ui** | Web UI + REST API on a single HTTP port (content negotiation) |
13
+
14
+ The UI plugin communicates with the core via BSB events -- they can run in the same process (`events-default`) or across services (`events-rabbitmq`).
15
+
16
+ ## Quick Start
17
+
18
+ ```bash
19
+ npm install
20
+ npm run build
21
+ npm run dev # starts with sec-config.minimal.yaml (file storage, no auth)
22
+ ```
23
+
24
+ Web UI: http://localhost:3200
25
+
26
+ ## Docker Packaging For BSB
27
+
28
+ This project includes `Dockerfile` to build and package the registry as a BSB plugin repository artifact.
29
+
30
+ - Build image from repo root:
31
+ ```bash
32
+ docker build -f plugins/nodejs/bsb-registry/Dockerfile -t betterweb/bsb-registry-plugin:1.0.1 .
33
+ ```
34
+ - Packaged output inside image:
35
+ - `/mnt/plugins/@bsb/registry/<version>/`
36
+ - `/mnt/plugins/@bsb/registry/latest/`
37
+
38
+ Use this output with BSB runtime images (`betterweb/service-base:9.0.0` or `betterweb/service-base:9`) by mounting/copying into `BSB_PLUGIN_DIR` (default `/mnt/plugins`).
39
+
40
+ ## Configuration
41
+
42
+ All configuration lives in `sec-config.yaml`:
43
+
44
+ ```yaml
45
+ service-bsb-registry:
46
+ database:
47
+ type: file # 'file' or 'postgres'
48
+ path: ./.temp/data # file storage directory
49
+ auth:
50
+ requireAuth: true # require token for publish/delete
51
+
52
+ service-bsb-registry-ui:
53
+ port: 3200 # single port for UI + API
54
+ host: 0.0.0.0
55
+ pageSize: 20 # plugins per page
56
+ uploadDir: ./.temp/registry-images
57
+ badgesFile: ./BADGES.json
58
+ maxImageUploadMb: 5
59
+ ```
60
+
61
+ See `sec-config.minimal.yaml`, `sec-config.yaml`, and `sec-config.production.yaml` for example configurations.
62
+
63
+ ## Publishing Plugins
64
+
65
+ From your plugin project:
66
+
67
+ ```bash
68
+ npm run build # generates bsb-plugin.json + schemas
69
+ npx bsb client publish # publishes all plugins in the package
70
+ ```
71
+
72
+ The CLI reads `bsb-plugin.json` and publishes each plugin entry with its event schemas, config schema, and documentation.
73
+
74
+ ### Organization
75
+
76
+ Add `bsb.orgId` to your `package.json` to publish under an organization:
77
+
78
+ ```json
79
+ {
80
+ "bsb": {
81
+ "orgId": "mycompany"
82
+ }
83
+ }
84
+ ```
85
+
86
+ | `bsb.orgId` | Plugin ID | Install command |
87
+ |---|---|---|
88
+ | _(not set)_ | `_/service-my-plugin` | `npx bsb client install service-my-plugin` |
89
+ | `mycompany` | `mycompany/service-my-plugin` | `npx bsb client install mycompany/service-my-plugin` |
90
+
91
+ ## Installing Plugins
92
+
93
+ ```bash
94
+ npx bsb client list # list available plugins
95
+ npx bsb client search todo # search by keyword
96
+ npx bsb client install myorg/service-demo-todo
97
+ ```
98
+
99
+ Installed schemas go to `src/.bsb/schemas/` and generated typed clients to `src/.bsb/clients/`.
100
+
101
+ ## API Tokens
102
+
103
+ Tokens are stored in a JSON file (default `./.temp/api-tokens.json`):
104
+
105
+ ```json
106
+ {
107
+ "tokens": [
108
+ {
109
+ "name": "admin",
110
+ "token": "bsb_abc123...",
111
+ "createdAt": "2026-02-13T00:00:00Z",
112
+ "permissions": ["read", "write", "admin"]
113
+ }
114
+ ]
115
+ }
116
+ ```
117
+
118
+ Generate a token:
119
+
120
+ ```bash
121
+ node -e "console.log('bsb_' + require('crypto').randomBytes(32).toString('hex'))"
122
+ ```
123
+
124
+ ## Documentation
125
+
126
+ Detailed documentation for each plugin:
127
+
128
+ - [service-bsb-registry](docs/service-bsb-registry.md) -- Core registry (events, storage, auth)
129
+ - [service-bsb-registry-ui](docs/service-bsb-registry-ui.md) -- Web UI and REST API
130
+
131
+ ## License
132
+
133
+ AGPL-3.0-only OR Commercial
@@ -0,0 +1,47 @@
1
+ {
2
+ "nodejs": [
3
+ {
4
+ "id": "service-bsb-registry-ui",
5
+ "name": "BSB Registry UI & API",
6
+ "basePath": "./",
7
+ "description": "Web UI and REST API for browsing, searching, and publishing BSB plugins (content negotiation: HTML or JSON)",
8
+ "tags": [
9
+ "registry",
10
+ "ui",
11
+ "api",
12
+ "web",
13
+ "rest",
14
+ "handlebars",
15
+ "server-side-rendering",
16
+ "content-negotiation",
17
+ "publishing"
18
+ ],
19
+ "documentation": [
20
+ "./docs/service-bsb-registry-ui.md"
21
+ ],
22
+ "pluginPath": "src/plugins/service-bsb-registry-ui/",
23
+ "image": "../../../docs/public/assets/images/bsb-logo.png"
24
+ },
25
+ {
26
+ "id": "service-bsb-registry",
27
+ "name": "BSB Registry Core",
28
+ "basePath": "./",
29
+ "description": "Event-driven plugin registry core for multi-language BSB plugin storage and discovery",
30
+ "tags": [
31
+ "registry",
32
+ "plugin",
33
+ "marketplace",
34
+ "discovery",
35
+ "publishing",
36
+ "events",
37
+ "storage"
38
+ ],
39
+ "documentation": [
40
+ "./docs/service-bsb-registry.md",
41
+ "./docs/bsb-registry-db-file.md"
42
+ ],
43
+ "pluginPath": "src/plugins/service-bsb-registry/",
44
+ "image": "../../../docs/public/assets/images/bsb-logo.png"
45
+ }
46
+ ]
47
+ }