@alevnyacow/nzmt 0.10.0 → 0.10.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.
- package/bin/cli.js +13 -5
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -778,7 +778,15 @@ function generateService(lowerCase, upperCase) {
|
|
|
778
778
|
"",
|
|
779
779
|
`export const ${lowerCase}ServiceMetadata = {`,
|
|
780
780
|
`\tname: '${upperCase}Service',`,
|
|
781
|
-
proxiedStore ?
|
|
781
|
+
proxiedStore ? [
|
|
782
|
+
`\tschemas: {`,
|
|
783
|
+
`\t\tgetList: ${proxiedStore.substring(0, 1).toLowerCase() + proxiedStore.substring(1)}Schemas.list,`,
|
|
784
|
+
`\t\tgetDetails: ${proxiedStore.substring(0, 1).toLowerCase() + proxiedStore.substring(1)}Schemas.details,`,
|
|
785
|
+
`\t\tcreate: ${proxiedStore.substring(0, 1).toLowerCase() + proxiedStore.substring(1)}Schemas.create,`,
|
|
786
|
+
`\t\tupdate: ${proxiedStore.substring(0, 1).toLowerCase() + proxiedStore.substring(1)}Schemas.updateOne,`,
|
|
787
|
+
`\t\tdelete: ${proxiedStore.substring(0, 1).toLowerCase() + proxiedStore.substring(1)}Schemas.deleteOne,`,
|
|
788
|
+
`\t}`,
|
|
789
|
+
].join('\n') : "\tschemas: {}",
|
|
782
790
|
"} satisfies Module.Metadata",
|
|
783
791
|
"",
|
|
784
792
|
`export type ${upperCase}ServiceDTOs = Module.DTOs<typeof ${lowerCase}ServiceMetadata>`
|
|
@@ -802,11 +810,11 @@ function generateService(lowerCase, upperCase) {
|
|
|
802
810
|
...injections.map(x => `\t\t@inject('${x}' satisfies DITokens) private readonly ${x.charAt(0).toLowerCase() + x.slice(1)}: ${x},`),
|
|
803
811
|
`\t) {}`,
|
|
804
812
|
``,
|
|
805
|
-
proxiedStore ? `\tgetList = this.methods('
|
|
806
|
-
proxiedStore ? `\tgetDetails = this.methods('
|
|
813
|
+
proxiedStore ? `\tgetList = this.methods('getList', this.${proxiedStore.charAt(0).toLowerCase() + proxiedStore.slice(1)}.list)` : undefined,
|
|
814
|
+
proxiedStore ? `\tgetDetails = this.methods('getDetails', this.${proxiedStore.charAt(0).toLowerCase() + proxiedStore.slice(1)}.details)` : undefined,
|
|
807
815
|
proxiedStore ? `\tcreate = this.methods('create', this.${proxiedStore.charAt(0).toLowerCase() + proxiedStore.slice(1)}.create)` : undefined,
|
|
808
|
-
proxiedStore ? `\tupdate = this.methods('
|
|
809
|
-
proxiedStore ? `\tdelete = this.methods('
|
|
816
|
+
proxiedStore ? `\tupdate = this.methods('update', this.${proxiedStore.charAt(0).toLowerCase() + proxiedStore.slice(1)}.updateOne)` : undefined,
|
|
817
|
+
proxiedStore ? `\tdelete = this.methods('delete', this.${proxiedStore.charAt(0).toLowerCase() + proxiedStore.slice(1)}.deleteOne)` : undefined,
|
|
810
818
|
"}"
|
|
811
819
|
].filter(x => typeof x === 'string').join('\n'))
|
|
812
820
|
|