@alevnyacow/nzmt 0.3.0 → 0.3.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 (2) hide show
  1. package/README.md +35 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -128,6 +128,41 @@ const { result } = mathService.basicOperation({
128
128
 
129
129
  Desribes module metadata. Metadata is used as an argument in `methods`.
130
130
 
131
+ ### DTOs
132
+
133
+ Extracts all request and response DTOs for every method by `Metadata`.
134
+
135
+ Example:
136
+
137
+ ```ts
138
+ import { Module } from '@alevnyacow/nzmt'
139
+
140
+ const testMetadata = {
141
+ name: 'TestService',
142
+ schemas: {
143
+ testMethod: {
144
+ payload: z.object({
145
+ stringField: z.string()
146
+ }),
147
+ response: z.object({
148
+ result: z.boolean()
149
+ })
150
+ },
151
+ }
152
+ } satisfies Module.Metadata
153
+
154
+ type TestServiceDTOs = Module.DTOs<typeof testMetadata>
155
+
156
+ /**
157
+ * TestServiceDTOs:
158
+ * {
159
+ * testMethodPayload: { stringField: string }
160
+ * testMethodResponse: { result: boolean }
161
+ * }
162
+ *
163
+ */
164
+ ```
165
+
131
166
  ## <a id='controller'></a>Controller
132
167
 
133
168
  ## <a id='store'></a>Store
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alevnyacow/nzmt",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Next Zod Modules Toolkit",
5
5
  "repository": {
6
6
  "type": "git",