@maykonpaulo/maestro-provider-mongodb 1.0.0 → 1.0.1-next.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/README.md +21 -0
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @maykonpaulo/maestro-provider-mongodb
|
|
2
2
|
|
|
3
|
+
> 📖 **[Guia completo — criar o admin de qualquer sistema com o Maestro](https://github.com/maykonpaulo/maestro/blob/main/docs/guia-criar-admin.md)** — passo a passo, do zero ao admin no ar, para qualquer banco.
|
|
4
|
+
|
|
3
5
|
A MongoDB provider for [`@maykonpaulo/maestro-core`](https://www.npmjs.com/package/@maykonpaulo/maestro-core) — the first **document/schema-less family** provider, per [ADR 0007 — Universal Provider Strategy](../../docs/adr/0007-universal-provider-strategy.md). It implements all three of the core's provider contracts against a real MongoDB database:
|
|
4
6
|
|
|
5
7
|
- `IntrospectionProvider` — discovers collections and infers each one's shape by **sampling** documents (there is no fixed schema to read). Every entity is reported with `schemaless: true`.
|
|
@@ -84,3 +86,22 @@ Tests run against a **real, ephemeral MongoDB server** started per test run via
|
|
|
84
86
|
[`mongodb-memory-server`](https://github.com/typegoose/mongodb-memory-server) (downloads a real `mongod`
|
|
85
87
|
binary once, then runs fully offline/in-process) — no Docker, no shared external database. See
|
|
86
88
|
`tests/mongo-provider.test.ts`.
|
|
89
|
+
|
|
90
|
+
## Turnkey admin (point at your database, get a UI)
|
|
91
|
+
|
|
92
|
+
This provider plugs straight into the Maestro turnkey layer: install
|
|
93
|
+
[`@maykonpaulo/maestro-server`](../server) and
|
|
94
|
+
[`@maykonpaulo/maestro-admin`](../admin), point them at your database and get a
|
|
95
|
+
full governed admin (list/CRUD/RBAC/audit + a metadata-driven UI) with no
|
|
96
|
+
per-entity code.
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
import { createMongoProvider } from '@maykonpaulo/maestro-provider-mongodb';
|
|
100
|
+
import { createMaestroServer, createIntrospectedEngine } from '@maykonpaulo/maestro-server';
|
|
101
|
+
|
|
102
|
+
const provider = createMongoProvider({ uri: 'mongodb://localhost:27017', database: 'app' });
|
|
103
|
+
const engine = await createIntrospectedEngine({ provider, access: 'full' });
|
|
104
|
+
await createMaestroServer({ engine }).listen(3000);
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
See the [Turnkey admin guide](../../docs/turnkey-admin.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maykonpaulo/maestro-provider-mongodb",
|
|
3
|
-
"version": "1.0.0",
|
|
3
|
+
"version": "1.0.1-next.0",
|
|
4
4
|
"description": "MongoDB provider for @maykonpaulo/maestro-core — schema-inferred introspection (sampling), real CRUD, and missing-collection creation, per ADR 0007 (the first document/schema-less family provider).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"mongodb": "^6.0.0 || ^7.0.0",
|
|
24
|
-
"@maykonpaulo/maestro-core": "0.7.0"
|
|
24
|
+
"@maykonpaulo/maestro-core": "0.7.1-next.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "^22.0.0",
|
|
@@ -31,8 +31,14 @@
|
|
|
31
31
|
"tsup": "^8.0.0",
|
|
32
32
|
"typescript": "^5.6.0",
|
|
33
33
|
"vitest": "^2.0.0",
|
|
34
|
-
"@maykonpaulo/maestro-core": "0.7.0"
|
|
34
|
+
"@maykonpaulo/maestro-core": "0.7.1-next.0"
|
|
35
35
|
},
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://github.com/maykonpaulo/maestro.git",
|
|
39
|
+
"directory": "packages/provider-mongodb"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://github.com/maykonpaulo/maestro#readme",
|
|
36
42
|
"scripts": {
|
|
37
43
|
"build": "tsup",
|
|
38
44
|
"test": "vitest run",
|