@alevnyacow/nzmt 0.0.31 → 0.0.32
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/bin/cli.js +6 -6
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -315,7 +315,7 @@ function generateService(lowerCase, upperCase, withCrud) {
|
|
|
315
315
|
// Metadata
|
|
316
316
|
|
|
317
317
|
if (withCrud) {
|
|
318
|
-
fs.writeFileSync(path.resolve(folder, `${entityName}.service.metadata.ts`), [
|
|
318
|
+
fs.writeFileSync(path.resolve(folder, `${entityName}s.service.metadata.ts`), [
|
|
319
319
|
"import { type Module, Entities } from '@alevnyacow/nzmt'",
|
|
320
320
|
"import z from 'zod'",
|
|
321
321
|
`import { ${lowerCase}StoreMetadata } from '${config?.paths?.stores?.replace('./src', '@')}/${entityName}'`,
|
|
@@ -325,8 +325,8 @@ function generateService(lowerCase, upperCase, withCrud) {
|
|
|
325
325
|
"\tschemas: {",
|
|
326
326
|
"\t\tgetSpecific: {",
|
|
327
327
|
`\t\t\tpayload: z.object({`,
|
|
328
|
-
`\t\t\tfilter: ${lowerCase}StoreMetadata.searchPayload.specific`,
|
|
329
|
-
`\t\t}),`,
|
|
328
|
+
`\t\t\t\tfilter: ${lowerCase}StoreMetadata.searchPayload.specific`,
|
|
329
|
+
`\t\t\t}),`,
|
|
330
330
|
`\t\t\tresponse: z.object({`,
|
|
331
331
|
`\t\t\t\titem: ${lowerCase}StoreMetadata.models.details.nullable()`,
|
|
332
332
|
`\t\t\t})`,
|
|
@@ -335,7 +335,7 @@ function generateService(lowerCase, upperCase, withCrud) {
|
|
|
335
335
|
`\t\t\tpayload: z.object({`,
|
|
336
336
|
`\t\t\t\tfilter: ${lowerCase}StoreMetadata.searchPayload.list,`,
|
|
337
337
|
`\t\t\t\tpagination: Entities.Pagination.schema.optional()`,
|
|
338
|
-
`\t\t\t})
|
|
338
|
+
`\t\t\t}),`,
|
|
339
339
|
`\t\t\tresponse: z.object({`,
|
|
340
340
|
`\t\t\t\titems: z.array(${lowerCase}StoreMetadata.models.list)`,
|
|
341
341
|
`\t\t\t})`,
|
|
@@ -343,7 +343,7 @@ function generateService(lowerCase, upperCase, withCrud) {
|
|
|
343
343
|
`\t\tupdateOne: {`,
|
|
344
344
|
`\t\t\tpayload: z.object({`,
|
|
345
345
|
`\t\t\t\tfilter: ${lowerCase}StoreMetadata.searchPayload.specific,`,
|
|
346
|
-
`\t\t\t\tpayload:
|
|
346
|
+
`\t\t\t\tpayload: ${lowerCase}StoreMetadata.actionsPayload.update`,
|
|
347
347
|
`\t\t\t}),`,
|
|
348
348
|
`\t\t\tresponse: z.object({})`,
|
|
349
349
|
`\t\t},`,
|
|
@@ -411,5 +411,5 @@ if (command === 'crud') {
|
|
|
411
411
|
var [lowerCase, upperCase] = camelizeVariants(entityName)
|
|
412
412
|
generateEntity(upperCase)
|
|
413
413
|
generateStores(lowerCase, upperCase)
|
|
414
|
-
generateService(
|
|
414
|
+
generateService(lowerCase, upperCase, true)
|
|
415
415
|
}
|