@alevnyacow/nzmt 0.27.3 → 0.27.5
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 +10 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -105,8 +105,8 @@ Schema: Server Action → Service → Store → DB
|
|
|
105
105
|
```tsx
|
|
106
106
|
'use server'
|
|
107
107
|
|
|
108
|
-
import { fromDI } from
|
|
109
|
-
import type { UserService } from
|
|
108
|
+
import { fromDI } from '@/server/di'
|
|
109
|
+
import type { UserService } from '@/server/services/user'
|
|
110
110
|
|
|
111
111
|
export default async function Page() {
|
|
112
112
|
/**
|
|
@@ -217,6 +217,14 @@ foo = this.methods('foo', async ({ str }) => {
|
|
|
217
217
|
// ..service class implementation
|
|
218
218
|
```
|
|
219
219
|
|
|
220
|
+
### Usage
|
|
221
|
+
|
|
222
|
+
Service methods can be used like a usual method of signature `(data: Request) => Promise<Response>`. E.g.
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
const { num } = await someMethod.foo({ str: '25' })
|
|
226
|
+
```
|
|
227
|
+
|
|
220
228
|
## Controllers
|
|
221
229
|
|
|
222
230
|
Same idea, but metadata uses optional `query`, optional `body`, and `response`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alevnyacow/nzmt",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.5",
|
|
4
4
|
"description": "Next Zod Modules Toolkit",
|
|
5
5
|
"keywords": ["next", "full-stack", "server", "backend", "cli", "scaffolding", "zod", "rest", "contract programming", "contract-first", "react-query", "ddd", "domain-driven"],
|
|
6
6
|
"repository": {
|