@stryke/prisma-trpc-generator 0.11.6 → 0.11.8

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.length > 1 && field.inputTypes[1]?.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;
@@ -11528,7 +11527,7 @@ function generateModelIncludeInputObjectTypes(models, isGenerateSelect) {
11528
11527
  },
11529
11528
  {
11530
11529
  isList: false,
11531
- type: isList ? `${type}FindManyArgs` : `${type}Args`,
11530
+ type: isList ? `${type}FindManyArgs` : `${type}DefaultArgs`,
11532
11531
  location: "inputObjectTypes",
11533
11532
  namespace: "prisma"
11534
11533
  }
@@ -11629,7 +11628,7 @@ function generateModelArgsInputObjectTypes(models, isGenerateSelect, isGenerateI
11629
11628
  fields.push(includeField);
11630
11629
  }
11631
11630
  const modelArgsInputObjectType = {
11632
- name: `${modelName}Args`,
11631
+ name: `${modelName}DefaultArgs`,
11633
11632
  constraints: {
11634
11633
  maxNumFields: null,
11635
11634
  minNumFields: null
@@ -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}Args`,
11698
+ name: `${modelCountOutputTypeName}CountArgs`,
11700
11699
  constraints: {
11701
11700
  maxNumFields: null,
11702
11701
  minNumFields: null
@@ -11745,7 +11744,7 @@ function generateModelSelectInputObjectTypes(models) {
11745
11744
  if (isRelationField) {
11746
11745
  const schemaArgInputType = {
11747
11746
  isList: false,
11748
- type: isList ? `${type}FindManyArgs` : `${type}Args`,
11747
+ type: isList ? `${type}FindManyArgs` : `${type}DefaultArgs`,
11749
11748
  location: "inputObjectTypes",
11750
11749
  namespace: "prisma"
11751
11750
  };
@@ -11768,7 +11767,7 @@ function generateModelSelectInputObjectTypes(models) {
11768
11767
  },
11769
11768
  {
11770
11769
  isList: false,
11771
- type: `${modelName}CountOutputTypeArgs`,
11770
+ type: `${modelName}CountOutputTypeDefaultArgs`,
11772
11771
  location: "inputObjectTypes",
11773
11772
  namespace: "prisma"
11774
11773
  }
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.length > 1 && field.inputTypes[1]?.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;
@@ -11533,7 +11532,7 @@ function generateModelIncludeInputObjectTypes(models, isGenerateSelect) {
11533
11532
  },
11534
11533
  {
11535
11534
  isList: false,
11536
- type: isList ? `${type}FindManyArgs` : `${type}Args`,
11535
+ type: isList ? `${type}FindManyArgs` : `${type}DefaultArgs`,
11537
11536
  location: "inputObjectTypes",
11538
11537
  namespace: "prisma"
11539
11538
  }
@@ -11634,7 +11633,7 @@ function generateModelArgsInputObjectTypes(models, isGenerateSelect, isGenerateI
11634
11633
  fields.push(includeField);
11635
11634
  }
11636
11635
  const modelArgsInputObjectType = {
11637
- name: `${modelName}Args`,
11636
+ name: `${modelName}DefaultArgs`,
11638
11637
  constraints: {
11639
11638
  maxNumFields: null,
11640
11639
  minNumFields: null
@@ -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}Args`,
11703
+ name: `${modelCountOutputTypeName}CountArgs`,
11705
11704
  constraints: {
11706
11705
  maxNumFields: null,
11707
11706
  minNumFields: null
@@ -11750,7 +11749,7 @@ function generateModelSelectInputObjectTypes(models) {
11750
11749
  if (isRelationField) {
11751
11750
  const schemaArgInputType = {
11752
11751
  isList: false,
11753
- type: isList ? `${type}FindManyArgs` : `${type}Args`,
11752
+ type: isList ? `${type}FindManyArgs` : `${type}DefaultArgs`,
11754
11753
  location: "inputObjectTypes",
11755
11754
  namespace: "prisma"
11756
11755
  };
@@ -11773,7 +11772,7 @@ function generateModelSelectInputObjectTypes(models) {
11773
11772
  },
11774
11773
  {
11775
11774
  isList: false,
11776
- type: `${modelName}CountOutputTypeArgs`,
11775
+ type: `${modelName}CountOutputTypeDefaultArgs`,
11777
11776
  location: "inputObjectTypes",
11778
11777
  namespace: "prisma"
11779
11778
  }
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.length > 1 && field.inputTypes[1]?.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;
@@ -11524,7 +11523,7 @@ function generateModelIncludeInputObjectTypes(models, isGenerateSelect) {
11524
11523
  },
11525
11524
  {
11526
11525
  isList: false,
11527
- type: isList ? `${type}FindManyArgs` : `${type}Args`,
11526
+ type: isList ? `${type}FindManyArgs` : `${type}DefaultArgs`,
11528
11527
  location: "inputObjectTypes",
11529
11528
  namespace: "prisma"
11530
11529
  }
@@ -11625,7 +11624,7 @@ function generateModelArgsInputObjectTypes(models, isGenerateSelect, isGenerateI
11625
11624
  fields.push(includeField);
11626
11625
  }
11627
11626
  const modelArgsInputObjectType = {
11628
- name: `${modelName}Args`,
11627
+ name: `${modelName}DefaultArgs`,
11629
11628
  constraints: {
11630
11629
  maxNumFields: null,
11631
11630
  minNumFields: null
@@ -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}Args`,
11694
+ name: `${modelCountOutputTypeName}CountArgs`,
11696
11695
  constraints: {
11697
11696
  maxNumFields: null,
11698
11697
  minNumFields: null
@@ -11741,7 +11740,7 @@ function generateModelSelectInputObjectTypes(models) {
11741
11740
  if (isRelationField) {
11742
11741
  const schemaArgInputType = {
11743
11742
  isList: false,
11744
- type: isList ? `${type}FindManyArgs` : `${type}Args`,
11743
+ type: isList ? `${type}FindManyArgs` : `${type}DefaultArgs`,
11745
11744
  location: "inputObjectTypes",
11746
11745
  namespace: "prisma"
11747
11746
  };
@@ -11764,7 +11763,7 @@ function generateModelSelectInputObjectTypes(models) {
11764
11763
  },
11765
11764
  {
11766
11765
  isList: false,
11767
- type: `${modelName}CountOutputTypeArgs`,
11766
+ type: `${modelName}CountOutputTypeDefaultArgs`,
11768
11767
  location: "inputObjectTypes",
11769
11768
  namespace: "prisma"
11770
11769
  }
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.length > 1 && field.inputTypes[1]?.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;
@@ -11529,7 +11528,7 @@ function generateModelIncludeInputObjectTypes(models, isGenerateSelect) {
11529
11528
  },
11530
11529
  {
11531
11530
  isList: false,
11532
- type: isList ? `${type}FindManyArgs` : `${type}Args`,
11531
+ type: isList ? `${type}FindManyArgs` : `${type}DefaultArgs`,
11533
11532
  location: "inputObjectTypes",
11534
11533
  namespace: "prisma"
11535
11534
  }
@@ -11630,7 +11629,7 @@ function generateModelArgsInputObjectTypes(models, isGenerateSelect, isGenerateI
11630
11629
  fields.push(includeField);
11631
11630
  }
11632
11631
  const modelArgsInputObjectType = {
11633
- name: `${modelName}Args`,
11632
+ name: `${modelName}DefaultArgs`,
11634
11633
  constraints: {
11635
11634
  maxNumFields: null,
11636
11635
  minNumFields: null
@@ -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}Args`,
11699
+ name: `${modelCountOutputTypeName}CountArgs`,
11701
11700
  constraints: {
11702
11701
  maxNumFields: null,
11703
11702
  minNumFields: null
@@ -11746,7 +11745,7 @@ function generateModelSelectInputObjectTypes(models) {
11746
11745
  if (isRelationField) {
11747
11746
  const schemaArgInputType = {
11748
11747
  isList: false,
11749
- type: isList ? `${type}FindManyArgs` : `${type}Args`,
11748
+ type: isList ? `${type}FindManyArgs` : `${type}DefaultArgs`,
11750
11749
  location: "inputObjectTypes",
11751
11750
  namespace: "prisma"
11752
11751
  };
@@ -11769,7 +11768,7 @@ function generateModelSelectInputObjectTypes(models) {
11769
11768
  },
11770
11769
  {
11771
11770
  isList: false,
11772
- type: `${modelName}CountOutputTypeArgs`,
11771
+ type: `${modelName}CountOutputTypeDefaultArgs`,
11773
11772
  location: "inputObjectTypes",
11774
11773
  namespace: "prisma"
11775
11774
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/prisma-trpc-generator",
3
- "version": "0.11.6",
3
+ "version": "0.11.8",
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": {