@stryke/prisma-trpc-generator 0.11.4 → 0.11.6

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.
@@ -8099,7 +8099,7 @@ function generateProcedure(sourceFile, name, typeName, modelName, opType, baseOp
8099
8099
  sourceFile.addStatements(
8100
8100
  /* ts */
8101
8101
  `${config.showModelNameInProcedure ? name : nameWithoutModel}: ${getProcedureName(config)}
8102
- ${config.withZod ? `.input(${typeName})` : ""}.${getProcedureTypeByOpName(baseOpType)}(async ({ ctx, input }) => {
8102
+ ${config.withZod ? `.input(${lowerCaseFirst(typeName)})` : ""}.${getProcedureTypeByOpName(baseOpType)}(async ({ ctx, input }) => {
8103
8103
  const ${name} = await ctx.prisma.${lowerCaseFirst(modelName)}.${opType.replace("One", "")}(${input});
8104
8104
  return ${name};
8105
8105
  }),`
@@ -11013,7 +11013,7 @@ ${this.generateExportSchemaStatement(`${lowerCaseFirst(name)}`, `z.enum(${JSON.s
11013
11013
  if (lines.length === 0) {
11014
11014
  return [];
11015
11015
  }
11016
- let alternatives = lines.slice(0, 1).reduce((result, inputType) => {
11016
+ let alternatives = lines.reduce((result, inputType) => {
11017
11017
  if (inputType.type === "String") {
11018
11018
  result.push(this.wrapWithZodValidators("z.string()", field));
11019
11019
  } else if (inputType.type === "Int" || inputType.type === "Float" || inputType.type === "Decimal") {
package/dist/generator.js CHANGED
@@ -8104,7 +8104,7 @@ function generateProcedure(sourceFile, name, typeName, modelName, opType, baseOp
8104
8104
  sourceFile.addStatements(
8105
8105
  /* ts */
8106
8106
  `${config.showModelNameInProcedure ? name : nameWithoutModel}: ${getProcedureName(config)}
8107
- ${config.withZod ? `.input(${typeName})` : ""}.${getProcedureTypeByOpName(baseOpType)}(async ({ ctx, input }) => {
8107
+ ${config.withZod ? `.input(${lowerCaseFirst(typeName)})` : ""}.${getProcedureTypeByOpName(baseOpType)}(async ({ ctx, input }) => {
8108
8108
  const ${name} = await ctx.prisma.${lowerCaseFirst(modelName)}.${opType.replace("One", "")}(${input});
8109
8109
  return ${name};
8110
8110
  }),`
@@ -11018,7 +11018,7 @@ ${this.generateExportSchemaStatement(`${lowerCaseFirst(name)}`, `z.enum(${JSON.s
11018
11018
  if (lines.length === 0) {
11019
11019
  return [];
11020
11020
  }
11021
- let alternatives = lines.slice(0, 1).reduce((result, inputType) => {
11021
+ let alternatives = lines.reduce((result, inputType) => {
11022
11022
  if (inputType.type === "String") {
11023
11023
  result.push(this.wrapWithZodValidators("z.string()", field));
11024
11024
  } else if (inputType.type === "Int" || inputType.type === "Float" || inputType.type === "Decimal") {
package/dist/index.cjs CHANGED
@@ -8095,7 +8095,7 @@ function generateProcedure(sourceFile, name, typeName, modelName, opType, baseOp
8095
8095
  sourceFile.addStatements(
8096
8096
  /* ts */
8097
8097
  `${config.showModelNameInProcedure ? name : nameWithoutModel}: ${getProcedureName(config)}
8098
- ${config.withZod ? `.input(${typeName})` : ""}.${getProcedureTypeByOpName(baseOpType)}(async ({ ctx, input }) => {
8098
+ ${config.withZod ? `.input(${lowerCaseFirst(typeName)})` : ""}.${getProcedureTypeByOpName(baseOpType)}(async ({ ctx, input }) => {
8099
8099
  const ${name} = await ctx.prisma.${lowerCaseFirst(modelName)}.${opType.replace("One", "")}(${input});
8100
8100
  return ${name};
8101
8101
  }),`
@@ -11009,7 +11009,7 @@ ${this.generateExportSchemaStatement(`${lowerCaseFirst(name)}`, `z.enum(${JSON.s
11009
11009
  if (lines.length === 0) {
11010
11010
  return [];
11011
11011
  }
11012
- let alternatives = lines.slice(0, 1).reduce((result, inputType) => {
11012
+ let alternatives = lines.reduce((result, inputType) => {
11013
11013
  if (inputType.type === "String") {
11014
11014
  result.push(this.wrapWithZodValidators("z.string()", field));
11015
11015
  } else if (inputType.type === "Int" || inputType.type === "Float" || inputType.type === "Decimal") {
package/dist/index.js CHANGED
@@ -8100,7 +8100,7 @@ function generateProcedure(sourceFile, name, typeName, modelName, opType, baseOp
8100
8100
  sourceFile.addStatements(
8101
8101
  /* ts */
8102
8102
  `${config.showModelNameInProcedure ? name : nameWithoutModel}: ${getProcedureName(config)}
8103
- ${config.withZod ? `.input(${typeName})` : ""}.${getProcedureTypeByOpName(baseOpType)}(async ({ ctx, input }) => {
8103
+ ${config.withZod ? `.input(${lowerCaseFirst(typeName)})` : ""}.${getProcedureTypeByOpName(baseOpType)}(async ({ ctx, input }) => {
8104
8104
  const ${name} = await ctx.prisma.${lowerCaseFirst(modelName)}.${opType.replace("One", "")}(${input});
8105
8105
  return ${name};
8106
8106
  }),`
@@ -11014,7 +11014,7 @@ ${this.generateExportSchemaStatement(`${lowerCaseFirst(name)}`, `z.enum(${JSON.s
11014
11014
  if (lines.length === 0) {
11015
11015
  return [];
11016
11016
  }
11017
- let alternatives = lines.slice(0, 1).reduce((result, inputType) => {
11017
+ let alternatives = lines.reduce((result, inputType) => {
11018
11018
  if (inputType.type === "String") {
11019
11019
  result.push(this.wrapWithZodValidators("z.string()", field));
11020
11020
  } else if (inputType.type === "Int" || inputType.type === "Float" || inputType.type === "Decimal") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/prisma-trpc-generator",
3
- "version": "0.11.4",
3
+ "version": "0.11.6",
4
4
  "type": "module",
5
5
  "description": "A fork of the prisma-trpc-generator code to work in ESM with Prisma v6.",
6
6
  "repository": {