@stryke/prisma-trpc-generator 0.11.7 → 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.
- package/dist/generator.cjs +2 -3
- package/dist/generator.js +2 -3
- package/dist/index.cjs +2 -3
- package/dist/index.js +2 -3
- package/package.json +1 -1
package/dist/generator.cjs
CHANGED
|
@@ -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
|
-
|
|
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;
|
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
|
-
|
|
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;
|
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
|
-
|
|
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;
|
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
|
-
|
|
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;
|