@alevnyacow/nzmt 0.0.30 → 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.
Files changed (2) hide show
  1. package/bin/cli.js +7 -7
  2. 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: userStoreMetadata.actionsPayload.update`,
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},`,
@@ -397,7 +397,7 @@ function generateService(lowerCase, upperCase, withCrud) {
397
397
  fs.writeFileSync(path.resolve(folder, 'index.ts'), [
398
398
  `export * from ${entityName}.service.metadata`,
399
399
  `export * from ${entityName}.service`
400
- ])
400
+ ].join('\n'))
401
401
  }
402
402
 
403
403
  if (command === 'service') {
@@ -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(entityName + 's', lowerCase, upperCase, true)
414
+ generateService(lowerCase, upperCase, true)
415
415
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alevnyacow/nzmt",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "description": "Next Zod Modules Toolkit",
5
5
  "type": "module",
6
6
  "exports": {