@stryke/prisma-trpc-generator 0.11.7 → 0.11.9

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.
@@ -11031,7 +11031,7 @@ ${this.generateExportSchemaStatement(`${lowerCaseFirst(name)}`, `z.enum(${JSON.s
11031
11031
  result.push(this.wrapWithZodValidators("z.literal(true)", field));
11032
11032
  } else if (inputType.type === "Bytes") {
11033
11033
  result.push(this.wrapWithZodValidators("z.instanceof(Buffer)", field));
11034
- } else {
11034
+ } else if (!inputType.type.endsWith("FieldRefInput")) {
11035
11035
  const isEnum = inputType.location === "enumTypes";
11036
11036
  if (inputType.namespace === "prisma" || isEnum) {
11037
11037
  if (inputType.type !== this.name && typeof inputType.type === "string") {
@@ -11085,8 +11085,7 @@ ${this.generateExportSchemaStatement(`${lowerCaseFirst(name)}`, `z.enum(${JSON.s
11085
11085
  const schema = inputType.type === this.name ? objectSchemaLine : isEnum ? enumSchemaLine : objectSchemaLine;
11086
11086
  const arr = inputType.isList ? ".array()" : "";
11087
11087
  const opt = !field.isRequired ? ".optional()" : "";
11088
- const nullable = field.inputTypes.some((inputType2) => inputType2?.type === "Null") ? ".nullable()" : "";
11089
- return inputsLength === 1 ? ` ${field.name}: z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}${nullable}` : `z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}${nullable}`;
11088
+ return inputsLength === 1 ? ` ${field.name}: z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}` : `z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}`;
11090
11089
  }
11091
11090
  generateFieldValidators(zodStringWithMainType, field) {
11092
11091
  const { isRequired, isNullable } = field;
@@ -11696,7 +11695,7 @@ function generateModelCountOutputTypeArgsInputObjectTypes(modelCountOutputTypes)
11696
11695
  for (const modelCountOutputType of modelCountOutputTypes) {
11697
11696
  const { name: modelCountOutputTypeName } = modelCountOutputType;
11698
11697
  const modelCountOutputTypeArgsInputObjectType = {
11699
- name: `${modelCountOutputTypeName}CountArgs`,
11698
+ name: `${modelCountOutputTypeName}DefaultArgs`,
11700
11699
  constraints: {
11701
11700
  maxNumFields: null,
11702
11701
  minNumFields: null
package/dist/generator.js CHANGED
@@ -11036,7 +11036,7 @@ ${this.generateExportSchemaStatement(`${lowerCaseFirst(name)}`, `z.enum(${JSON.s
11036
11036
  result.push(this.wrapWithZodValidators("z.literal(true)", field));
11037
11037
  } else if (inputType.type === "Bytes") {
11038
11038
  result.push(this.wrapWithZodValidators("z.instanceof(Buffer)", field));
11039
- } else {
11039
+ } else if (!inputType.type.endsWith("FieldRefInput")) {
11040
11040
  const isEnum = inputType.location === "enumTypes";
11041
11041
  if (inputType.namespace === "prisma" || isEnum) {
11042
11042
  if (inputType.type !== this.name && typeof inputType.type === "string") {
@@ -11090,8 +11090,7 @@ ${this.generateExportSchemaStatement(`${lowerCaseFirst(name)}`, `z.enum(${JSON.s
11090
11090
  const schema = inputType.type === this.name ? objectSchemaLine : isEnum ? enumSchemaLine : objectSchemaLine;
11091
11091
  const arr = inputType.isList ? ".array()" : "";
11092
11092
  const opt = !field.isRequired ? ".optional()" : "";
11093
- const nullable = field.inputTypes.some((inputType2) => inputType2?.type === "Null") ? ".nullable()" : "";
11094
- return inputsLength === 1 ? ` ${field.name}: z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}${nullable}` : `z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}${nullable}`;
11093
+ return inputsLength === 1 ? ` ${field.name}: z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}` : `z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}`;
11095
11094
  }
11096
11095
  generateFieldValidators(zodStringWithMainType, field) {
11097
11096
  const { isRequired, isNullable } = field;
@@ -11701,7 +11700,7 @@ function generateModelCountOutputTypeArgsInputObjectTypes(modelCountOutputTypes)
11701
11700
  for (const modelCountOutputType of modelCountOutputTypes) {
11702
11701
  const { name: modelCountOutputTypeName } = modelCountOutputType;
11703
11702
  const modelCountOutputTypeArgsInputObjectType = {
11704
- name: `${modelCountOutputTypeName}CountArgs`,
11703
+ name: `${modelCountOutputTypeName}DefaultArgs`,
11705
11704
  constraints: {
11706
11705
  maxNumFields: null,
11707
11706
  minNumFields: null
package/dist/index.cjs CHANGED
@@ -11027,7 +11027,7 @@ ${this.generateExportSchemaStatement(`${lowerCaseFirst(name)}`, `z.enum(${JSON.s
11027
11027
  result.push(this.wrapWithZodValidators("z.literal(true)", field));
11028
11028
  } else if (inputType.type === "Bytes") {
11029
11029
  result.push(this.wrapWithZodValidators("z.instanceof(Buffer)", field));
11030
- } else {
11030
+ } else if (!inputType.type.endsWith("FieldRefInput")) {
11031
11031
  const isEnum = inputType.location === "enumTypes";
11032
11032
  if (inputType.namespace === "prisma" || isEnum) {
11033
11033
  if (inputType.type !== this.name && typeof inputType.type === "string") {
@@ -11081,8 +11081,7 @@ ${this.generateExportSchemaStatement(`${lowerCaseFirst(name)}`, `z.enum(${JSON.s
11081
11081
  const schema = inputType.type === this.name ? objectSchemaLine : isEnum ? enumSchemaLine : objectSchemaLine;
11082
11082
  const arr = inputType.isList ? ".array()" : "";
11083
11083
  const opt = !field.isRequired ? ".optional()" : "";
11084
- const nullable = field.inputTypes.some((inputType2) => inputType2?.type === "Null") ? ".nullable()" : "";
11085
- return inputsLength === 1 ? ` ${field.name}: z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}${nullable}` : `z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}${nullable}`;
11084
+ return inputsLength === 1 ? ` ${field.name}: z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}` : `z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}`;
11086
11085
  }
11087
11086
  generateFieldValidators(zodStringWithMainType, field) {
11088
11087
  const { isRequired, isNullable } = field;
@@ -11692,7 +11691,7 @@ function generateModelCountOutputTypeArgsInputObjectTypes(modelCountOutputTypes)
11692
11691
  for (const modelCountOutputType of modelCountOutputTypes) {
11693
11692
  const { name: modelCountOutputTypeName } = modelCountOutputType;
11694
11693
  const modelCountOutputTypeArgsInputObjectType = {
11695
- name: `${modelCountOutputTypeName}CountArgs`,
11694
+ name: `${modelCountOutputTypeName}DefaultArgs`,
11696
11695
  constraints: {
11697
11696
  maxNumFields: null,
11698
11697
  minNumFields: null
package/dist/index.js CHANGED
@@ -11032,7 +11032,7 @@ ${this.generateExportSchemaStatement(`${lowerCaseFirst(name)}`, `z.enum(${JSON.s
11032
11032
  result.push(this.wrapWithZodValidators("z.literal(true)", field));
11033
11033
  } else if (inputType.type === "Bytes") {
11034
11034
  result.push(this.wrapWithZodValidators("z.instanceof(Buffer)", field));
11035
- } else {
11035
+ } else if (!inputType.type.endsWith("FieldRefInput")) {
11036
11036
  const isEnum = inputType.location === "enumTypes";
11037
11037
  if (inputType.namespace === "prisma" || isEnum) {
11038
11038
  if (inputType.type !== this.name && typeof inputType.type === "string") {
@@ -11086,8 +11086,7 @@ ${this.generateExportSchemaStatement(`${lowerCaseFirst(name)}`, `z.enum(${JSON.s
11086
11086
  const schema = inputType.type === this.name ? objectSchemaLine : isEnum ? enumSchemaLine : objectSchemaLine;
11087
11087
  const arr = inputType.isList ? ".array()" : "";
11088
11088
  const opt = !field.isRequired ? ".optional()" : "";
11089
- const nullable = field.inputTypes.some((inputType2) => inputType2?.type === "Null") ? ".nullable()" : "";
11090
- return inputsLength === 1 ? ` ${field.name}: z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}${nullable}` : `z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}${nullable}`;
11089
+ return inputsLength === 1 ? ` ${field.name}: z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}` : `z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}`;
11091
11090
  }
11092
11091
  generateFieldValidators(zodStringWithMainType, field) {
11093
11092
  const { isRequired, isNullable } = field;
@@ -11697,7 +11696,7 @@ function generateModelCountOutputTypeArgsInputObjectTypes(modelCountOutputTypes)
11697
11696
  for (const modelCountOutputType of modelCountOutputTypes) {
11698
11697
  const { name: modelCountOutputTypeName } = modelCountOutputType;
11699
11698
  const modelCountOutputTypeArgsInputObjectType = {
11700
- name: `${modelCountOutputTypeName}CountArgs`,
11699
+ name: `${modelCountOutputTypeName}DefaultArgs`,
11701
11700
  constraints: {
11702
11701
  maxNumFields: null,
11703
11702
  minNumFields: null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/prisma-trpc-generator",
3
- "version": "0.11.7",
3
+ "version": "0.11.9",
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": {