@owlmeans/mongo-resource 0.1.7 → 0.1.9
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
CHANGED
|
@@ -79,3 +79,20 @@ Extends `Resource<T>` with:
|
|
|
79
79
|
|
|
80
80
|
- [`@owlmeans/resource`](../resource) — `Resource<T>`, `ResourceRecord`, `ResourceMaker` base
|
|
81
81
|
- [`@owlmeans/mongo`](../mongo) — MongoDB connection service required by this package
|
|
82
|
+
|
|
83
|
+
<!-- owlmeans:agent-guidance:start -->
|
|
84
|
+
## Agent guidance
|
|
85
|
+
|
|
86
|
+
This package ships embedded Claude Code skills and GitHub Copilot instructions under
|
|
87
|
+
`agent-meta/`. After installing your `@owlmeans/*` packages, run the OwlMeans
|
|
88
|
+
agent-skills installer to place them into your project's native locations
|
|
89
|
+
(`.claude/skills/` and `.github/instructions/`):
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
npx @owlmeans/agent-skills
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The embedded files are version-matched to this package release. Do not edit them
|
|
96
|
+
directly — they are regenerated on each publish. To contribute guidance edits,
|
|
97
|
+
open a PR against the source monorepo.
|
|
98
|
+
<!-- owlmeans:agent-guidance:end -->
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "How to use @owlmeans/mongo-resource — MongoDB-backed Resource implementation. Builds a typed CRUD resource on top of @owlmeans/mongo."
|
|
3
|
+
applyTo: "**/*.ts, **/*.tsx"
|
|
4
|
+
---
|
|
5
|
+
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
6
|
+
|
|
7
|
+
# @owlmeans/mongo-resource
|
|
8
|
+
|
|
9
|
+
**Layer:** Infra
|
|
10
|
+
**Install:** `"@owlmeans/mongo-resource": "^0.1.9"` in `dependencies`
|
|
11
|
+
|
|
12
|
+
## Key Exports
|
|
13
|
+
|
|
14
|
+
| Export | Description |
|
|
15
|
+
|--------|-------------|
|
|
16
|
+
| `makeMongoResource<T>(options)` | MongoDB-backed Resource factory |
|
|
17
|
+
| `MongoResource<T>` types | Resource interface |
|
|
18
|
+
| Constants | Default collection prefix |
|
|
19
|
+
| Helpers | Index creation, query helpers |
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { makeMongoResource } from '@owlmeans/mongo-resource'
|
|
25
|
+
context.registerResource(makeMongoResource<Project>({ alias: 'projects', collection: 'projects' }))
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Depends On
|
|
29
|
+
|
|
30
|
+
- `@owlmeans/mongo`, `@owlmeans/resource`, `@owlmeans/server-context`
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"package": "@owlmeans/mongo-resource",
|
|
4
|
+
"version": "0.1.9",
|
|
5
|
+
"generatedAt": "2026-06-14T13:34:06.129Z",
|
|
6
|
+
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
|
+
"entries": [
|
|
8
|
+
{
|
|
9
|
+
"kind": "skill",
|
|
10
|
+
"name": "mongo-resource",
|
|
11
|
+
"category": "package-specific",
|
|
12
|
+
"file": "skills/mongo-resource/SKILL.md",
|
|
13
|
+
"canonicalPath": ".claude/skills/mongo-resource/SKILL.md"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"kind": "instruction",
|
|
17
|
+
"name": "mongo-resource",
|
|
18
|
+
"category": "package-specific",
|
|
19
|
+
"file": "instructions/mongo-resource.instructions.md",
|
|
20
|
+
"canonicalPath": ".github/instructions/mongo-resource.instructions.md"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mongo-resource
|
|
3
|
+
description: How to use @owlmeans/mongo-resource — MongoDB-backed Resource implementation. Builds a typed CRUD resource on top of @owlmeans/mongo. Auto-invoked when defining a resource backed by MongoDB.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
7
|
+
|
|
8
|
+
# @owlmeans/mongo-resource
|
|
9
|
+
|
|
10
|
+
**Layer:** Infra
|
|
11
|
+
**Install:** `"@owlmeans/mongo-resource": "^0.1.9"` in `dependencies`
|
|
12
|
+
|
|
13
|
+
## Key Exports
|
|
14
|
+
|
|
15
|
+
| Export | Description |
|
|
16
|
+
|--------|-------------|
|
|
17
|
+
| `makeMongoResource<T>(options)` | Factory for a MongoDB-backed Resource<T> |
|
|
18
|
+
| `MongoResource<T>` types | Resource interface |
|
|
19
|
+
| Constants | Default collection prefix |
|
|
20
|
+
| Helpers | Index creation, query helpers |
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { makeMongoResource } from '@owlmeans/mongo-resource'
|
|
26
|
+
|
|
27
|
+
context.registerResource(makeMongoResource<Project>({
|
|
28
|
+
alias: 'projects',
|
|
29
|
+
collection: 'projects',
|
|
30
|
+
}))
|
|
31
|
+
|
|
32
|
+
// In a handler:
|
|
33
|
+
const projects = ctx.getResource<Resource<Project>>('projects')
|
|
34
|
+
await projects.create({ name: 'New', entityId })
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Depends On
|
|
38
|
+
|
|
39
|
+
- `@owlmeans/mongo`, `@owlmeans/resource`, `@owlmeans/server-context`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/mongo-resource",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"mongodb": "*"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@owlmeans/context": "^0.1.
|
|
30
|
-
"@owlmeans/resource": "^0.1.
|
|
31
|
-
"@owlmeans/server-context": "^0.1.
|
|
29
|
+
"@owlmeans/context": "^0.1.9",
|
|
30
|
+
"@owlmeans/resource": "^0.1.9",
|
|
31
|
+
"@owlmeans/server-context": "^0.1.9"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@owlmeans/dep-config": "workspace:*",
|
|
35
|
-
"@owlmeans/test-integration": "^0.1.
|
|
35
|
+
"@owlmeans/test-integration": "^0.1.9",
|
|
36
36
|
"@types/bun": "^1.3.0",
|
|
37
37
|
"@types/node": "^24.10.1",
|
|
38
38
|
"mongodb": "^6.9.0",
|