From a7bc18272fedc8db239a87751941a0f3cbbc8c3e Mon Sep 17 00:00:00 2001 From: chrishoermann <53531653+chrishoermann@users.noreply.github.com> Date: Fri, 10 Mar 2023 20:51:48 +0100 Subject: [PATCH] fixed #100, #99, #96, #90 --- packages/generator/package.json | 2 +- .../src/classes/extendedDMMFInputType.ts | 14 +-- .../src/classes/extendedDMMFSchemaArg.ts | 2 +- .../src/classes/extendedDMMFSchemaField.ts | 72 ++++++++---- .../contentWriters/writeDecimalJsLike.ts | 8 +- .../contentWriters/writeDecimalJsLikeList.ts | 4 +- .../writeIsValidDecimalInput.ts | 8 +- .../fieldWriters/writeModelDecimal.ts | 4 +- .../fieldWriters/writeSpecialType.ts | 58 ++++------ .../writeSingleFileImportStatements.ts | 2 +- packages/usage/package.json | 10 +- packages/usage/prisma/schema.prisma | 11 +- packages/usage/tests/decimal.test.ts | 4 + packages/usage/tests/implementations/xor.ts | 53 +++++++++ pnpm-lock.yaml | 108 ++++++++---------- 15 files changed, 211 insertions(+), 149 deletions(-) create mode 100644 packages/usage/tests/implementations/xor.ts diff --git a/packages/generator/package.json b/packages/generator/package.json index 1e14550b..cf94d443 100644 --- a/packages/generator/package.json +++ b/packages/generator/package.json @@ -1,6 +1,6 @@ { "name": "zod-prisma-types", - "version": "2.4.1-beta.0", + "version": "2.4.1", "description": "Generates zod schemas from Prisma models with advanced validation", "author": "Chris Hörmann", "license": "MIT", diff --git a/packages/generator/src/classes/extendedDMMFInputType.ts b/packages/generator/src/classes/extendedDMMFInputType.ts index 81c8cae2..83aba827 100644 --- a/packages/generator/src/classes/extendedDMMFInputType.ts +++ b/packages/generator/src/classes/extendedDMMFInputType.ts @@ -57,9 +57,9 @@ export class ExtendedDMMFInputType this.omitFields = this._setOmitFields(); this.imports = this._setImports(); - if (this.name === 'ProfileWhereUniqueInput') { - console.log(type); - } + // if (this.name === 'ProfileWhereUniqueInput') { + // console.log(type); + // } } /** @@ -80,11 +80,11 @@ export class ExtendedDMMFInputType (modelField) => modelField.name === field.name, ); - const hasConstraints = this.constraints.fields?.includes(field.name); + // const hasConstraints = this.constraints.fields?.includes(field.name); - if (this.name === 'ProfileWhereUniqueInput') { - console.log({ fieldname: field.name, hasConstraints }); - } + // if (this.name === 'ProfileWhereUniqueInput') { + // console.log({ fieldname: field.name, hasConstraints }); + // } // validators and omitField should only be written for create and update types. // this prevents validation in e.g. search queries in "where inputs", diff --git a/packages/generator/src/classes/extendedDMMFSchemaArg.ts b/packages/generator/src/classes/extendedDMMFSchemaArg.ts index 68fc6214..e0b26fae 100644 --- a/packages/generator/src/classes/extendedDMMFSchemaArg.ts +++ b/packages/generator/src/classes/extendedDMMFSchemaArg.ts @@ -125,7 +125,7 @@ export class ExtendedDMMFSchemaArg * @returns `true` if the arg.name matches one of `create|update|upsert|delete|data` */ rewriteArgWithNewType() { - return !!this.name.match(/create|update|upsert|delete|data/); + return /create|update|upsert|delete|data/.test(this.name); } getImports(fieldName: string) { diff --git a/packages/generator/src/classes/extendedDMMFSchemaField.ts b/packages/generator/src/classes/extendedDMMFSchemaField.ts index f88b49bb..ba07a434 100644 --- a/packages/generator/src/classes/extendedDMMFSchemaField.ts +++ b/packages/generator/src/classes/extendedDMMFSchemaField.ts @@ -1,15 +1,15 @@ import { DMMF } from '@prisma/generator-helper'; +import { ExtendedDMMFDatamodel } from './extendedDMMFDatamodel'; +import { ExtendedDMMFModel } from './extendedDMMFModel'; +import { ExtendedDMMFSchemaArg } from './extendedDMMFSchemaArg'; +import { FormattedNames } from './formattedNames'; import { FilterdPrismaAction, PRISMA_ACTION_ARG_MAP, PRISMA_ACTION_ARRAY, } from '../constants/objectMaps'; import { GeneratorConfig } from '../schemas'; -import { ExtendedDMMFDatamodel } from './extendedDMMFDatamodel'; -import { ExtendedDMMFModel } from './extendedDMMFModel'; -import { ExtendedDMMFSchemaArg } from './extendedDMMFSchemaArg'; -import { FormattedNames } from './formattedNames'; ///////////////////////////////////////////////// // REGEX @@ -24,6 +24,9 @@ const WRITE_INCLUDE_SELECT_FIELDS_REGEX = const WRITE_NO_INCLUDE_SELECT_FIELDS_REGEX = /createMany|updateMany|deleteMany/; +// const MUTEX_FIELDS_REGEX = /create|update|upsert/; +// const MUTEX_FIELDS_MANY_REGEX = /createMany|updateMany/; + ///////////////////////////////////////////////// // CLASS ///////////////////////////////////////////////// @@ -294,8 +297,8 @@ export class ExtendedDMMFSchemaField ); } - private _addIncludeToOmitUnionArray(omitUnionArray: string[]) { - if ( + private _shouldAddIncludeToOmitUnionArray() { + return ( // "include" or "select" should be added to omit union when they match the regex pattern this._setWriteSelectAndIncludeArgs() && // "include" should be added to omit union when field is of type "outputObjectType" @@ -304,24 +307,34 @@ export class ExtendedDMMFSchemaField !this.generatorConfig.addIncludeType && // "include" should be added to omit union when it has relation fields this.linkedModel?.hasRelationFields - ) { - omitUnionArray.push('"include"'); - } + ); } - private _addSelectToOmitUnionArray(omitUnionArray: string[]) { - if ( + private _shouldAddSelectToOmitUnionArray() { + return ( // "include" or "select" should be added to omit union when they match the regex pattern this._setWriteSelectAndIncludeArgs() && // "select" should be added to omit union when field is of type "outputObjectType" this._setWriteSelectField() && // "select" should be added to omit union when it is set to be omitted via generator config !this.generatorConfig.addSelectType - ) { - omitUnionArray.push('"select"'); - } + ); } + /** + * Used to determine if the field contains a union that + * should be mutually exclusive as in prismas `Without<..>` type + * used in `create`, `update` and `upsert` args. + */ + // private _shouldAddDataToOmitUnionArray() { + // return ( + // // check if the field contains `create`, `upsert`o `update` in its name + // MUTEX_FIELDS_REGEX.test(this.name) && + // // check if the field does not contains `createMany` or `updateMany` in its name + // !MUTEX_FIELDS_MANY_REGEX.test(this.name) + // ); + // } + private _getOmitFieldsUnion(omitUnionArray: string[]) { return omitUnionArray.join(' | '); } @@ -343,8 +356,17 @@ export class ExtendedDMMFSchemaField private _setCustomArgType() { const omitUnionArray: string[] = []; - this._addSelectToOmitUnionArray(omitUnionArray); - this._addIncludeToOmitUnionArray(omitUnionArray); + // if (this._shouldAddDataToOmitUnionArray()) { + // omitUnionArray.push('"data"'); + // } + + if (this._shouldAddSelectToOmitUnionArray()) { + omitUnionArray.push('"select"'); + } + + if (this._shouldAddIncludeToOmitUnionArray()) { + omitUnionArray.push('"include"'); + } if (this._shouldAddOmittedFieldsToOmitUnionArray()) { this._addOmittedFieldsToOmitUnionArray(omitUnionArray); @@ -388,6 +410,15 @@ export class ExtendedDMMFSchemaField return `${arg.name}${arg.isRequired ? '' : '?'}: `; } + /** + * Returns the union of types or a single type. + */ + private _getCustomArgsType(arg: ExtendedDMMFSchemaArg) { + return arg.hasMultipleTypes + ? this._getCustomArgsMultipleTypes(arg) + : this._getCustomArgsSingleType(arg); + } + /** * If the arg has multiple types, the type is a union of the types. */ @@ -409,15 +440,6 @@ export class ExtendedDMMFSchemaField return `z.infer`; } - /** - * Returns the union of types or a single type. - */ - private _getCustomArgsType(arg: ExtendedDMMFSchemaArg) { - return arg.hasMultipleTypes - ? this._getCustomArgsMultipleTypes(arg) - : this._getCustomArgsSingleType(arg); - } - // HELPER METHODS //--------------------------------------------------------------------- diff --git a/packages/generator/src/functions/contentWriters/writeDecimalJsLike.ts b/packages/generator/src/functions/contentWriters/writeDecimalJsLike.ts index 344d0281..8322b979 100644 --- a/packages/generator/src/functions/contentWriters/writeDecimalJsLike.ts +++ b/packages/generator/src/functions/contentWriters/writeDecimalJsLike.ts @@ -9,17 +9,13 @@ export const writeDecimalJsLike = ({ if (useMultipleFiles && !getSingleFileContent) { writeImport('{ z }', 'zod'); - writeImport('type { DecimalJsLike }', `${prismaClientPath}/runtime`); + writeImport('type { Prisma }', `${prismaClientPath}`); } writer .blankLine() .writeLine( - `export const DecimalJSLikeSchema: z.ZodType = z.object({ d: z.array(z.number()), e: z.number(), s: z.number(), toFixed: z.function().args().returns(z.string()), });`, - ) - .newLine() - .writeLine( - `export type DecimalJSLike = z.infer;`, + `export const DecimalJSLikeSchema: z.ZodType = z.object({ d: z.array(z.number()), e: z.number(), s: z.number(), toFixed: z.function().args().returns(z.string()), });`, ); if (useMultipleFiles && !getSingleFileContent) { diff --git a/packages/generator/src/functions/contentWriters/writeDecimalJsLikeList.ts b/packages/generator/src/functions/contentWriters/writeDecimalJsLikeList.ts index da06a10d..4cbab8e0 100644 --- a/packages/generator/src/functions/contentWriters/writeDecimalJsLikeList.ts +++ b/packages/generator/src/functions/contentWriters/writeDecimalJsLikeList.ts @@ -9,13 +9,13 @@ export const writeDecimalJsLikeList = ({ if (useMultipleFiles && !getSingleFileContent) { writeImport('{ z }', 'zod'); - writeImport('type { DecimalJsLike }', `${prismaClientPath}/runtime`); + writeImport('type { Prisma }', `${prismaClientPath}`); } writer .blankLine() .writeLine( - `export const DecimalJSLikeListSchema: z.ZodType = z.object({ d: z.array(z.number()), e: z.number(), s: z.number(), toFixed: z.function().args().returns(z.string()), }).array();`, + `export const DecimalJSLikeListSchema: z.ZodType = z.object({ d: z.array(z.number()), e: z.number(), s: z.number(), toFixed: z.function().args().returns(z.string()), }).array();`, ); if (useMultipleFiles && !getSingleFileContent) { diff --git a/packages/generator/src/functions/contentWriters/writeIsValidDecimalInput.ts b/packages/generator/src/functions/contentWriters/writeIsValidDecimalInput.ts index e5bc7499..47c5415c 100644 --- a/packages/generator/src/functions/contentWriters/writeIsValidDecimalInput.ts +++ b/packages/generator/src/functions/contentWriters/writeIsValidDecimalInput.ts @@ -5,10 +5,10 @@ export const writeIsValidDecimalInput = ({ dmmf, getSingleFileContent = false, }: ContentWriterOptions) => { - const { useMultipleFiles } = dmmf.generatorConfig; + const { useMultipleFiles, prismaClientPath } = dmmf.generatorConfig; if (useMultipleFiles && !getSingleFileContent) { - writeImport('type { DecimalJSLike }', `./DecimalJsLikeSchema`); + writeImport('type { Prisma }', `${prismaClientPath}`); } writer @@ -21,11 +21,11 @@ export const writeIsValidDecimalInput = ({ .withIndentationLevel(1, () => { writer .write( - `(v?: null | string | number | DecimalJSLike): v is string | number | DecimalJSLike => `, + `(v?: null | string | number | Prisma.DecimalJsLike): v is string | number | Prisma.DecimalJsLike => `, ) .inlineBlock(() => { writer - .writeLine(`if (!v) return false;`) + .writeLine(`if (v === undefined || v === null) return false;`) .writeLine(`return (`) .withIndentationLevel(3, () => { writer diff --git a/packages/generator/src/functions/fieldWriters/writeModelDecimal.ts b/packages/generator/src/functions/fieldWriters/writeModelDecimal.ts index 06229362..4590078f 100644 --- a/packages/generator/src/functions/fieldWriters/writeModelDecimal.ts +++ b/packages/generator/src/functions/fieldWriters/writeModelDecimal.ts @@ -20,11 +20,9 @@ export const writeDecimal = ({ .write(`)`) .write(`.refine((v) => isValidDecimalInput(v),`) .write( - ` { message: 'Field "${field.formattedNames.original}" must be a Decimal', `, + ` { message: "Field '${field.formattedNames.original}' must be a Decimal. Location: ['Models', '${model.formattedNames.original}']", `, ) - .write(`path: ['Models', '${model.formattedNames.original}']`) .write(` })`); - // .write(`.transform((v) => new Prism.Decimal(v))`); writeFieldAdditions({ writer, field, writeOptionalDefaults }); }; diff --git a/packages/generator/src/functions/fieldWriters/writeSpecialType.ts b/packages/generator/src/functions/fieldWriters/writeSpecialType.ts index a09335e5..cc73e6a8 100644 --- a/packages/generator/src/functions/fieldWriters/writeSpecialType.ts +++ b/packages/generator/src/functions/fieldWriters/writeSpecialType.ts @@ -41,46 +41,38 @@ export const writeSpecialType: WriteTypeFunction = ( if (inputType.isDecimalType) { if (inputType.isList) { - return ( - writer - .write(`z.union([`) - .write(`z.number().array(),`) - .write(`z.string().array(),`) - .write(`DecimalJSLikeListSchema,`) - .write(`]`) - .conditionalWrite(!!zodCustomErrors, `, ${zodCustomErrors!}`) - .write(`)`) - - .write(`.refine((v) => `) - .write( - `Array.isArray(v) && (v as any[]).every((v) => isValidDecimalInput(v)),`, - ) - .write(` { message: 'Must be a Decimal' })`) - // .write( - // `.transform(Array.isArray(v) && (v as any[]).every((v) => new Prisma.Decimal(v)))`, - // ) - .conditionalWrite(isOptional, `.optional()`) - .conditionalWrite(isNullable, `.nullable()`) - .conditionalWrite(writeComma, `,`) - ); - } - - return ( - writer + return writer .write(`z.union([`) - .write(`z.number(),`) - .write(`z.string(),`) - .write(`DecimalJSLikeSchema,`) + .write(`z.number().array(),`) + .write(`z.string().array(),`) + .write(`DecimalJSLikeListSchema,`) .write(`]`) .conditionalWrite(!!zodCustomErrors, `, ${zodCustomErrors!}`) .write(`)`) - .write(`.refine((v) => isValidDecimalInput(v),`) + + .write(`.refine((v) => `) + .write( + `Array.isArray(v) && (v as any[]).every((v) => isValidDecimalInput(v)),`, + ) .write(` { message: 'Must be a Decimal' })`) - // .write(`.transform((v) => new Prisma.Decimal(v))`) .conditionalWrite(isOptional, `.optional()`) .conditionalWrite(isNullable, `.nullable()`) - .conditionalWrite(writeComma, `,`) - ); + .conditionalWrite(writeComma, `,`); + } + + return writer + .write(`z.union([`) + .write(`z.number(),`) + .write(`z.string(),`) + .write(`DecimalJSLikeSchema,`) + .write(`]`) + .conditionalWrite(!!zodCustomErrors, `, ${zodCustomErrors!}`) + .write(`)`) + .write(`.refine((v) => isValidDecimalInput(v),`) + .write(` { message: 'Must be a Decimal' })`) + .conditionalWrite(isOptional, `.optional()`) + .conditionalWrite(isNullable, `.nullable()`) + .conditionalWrite(writeComma, `,`); } if (inputType.isJsonType) { diff --git a/packages/generator/src/functions/writeSingleFileImportStatements.ts b/packages/generator/src/functions/writeSingleFileImportStatements.ts index 7d7c803d..ec6bdd6b 100644 --- a/packages/generator/src/functions/writeSingleFileImportStatements.ts +++ b/packages/generator/src/functions/writeSingleFileImportStatements.ts @@ -18,7 +18,7 @@ export const writeSingleFileImportStatements: WriteStatements = ( if (dmmf.schema.hasJsonTypes) { writeImport(`{ Prisma }`, `${prismaClientPath}`); } else { - writeImport(`{ type Prisma }`, `${prismaClientPath}`); + writeImport(`type { Prisma }`, `${prismaClientPath}`); } if (dmmf.customImports) { diff --git a/packages/usage/package.json b/packages/usage/package.json index 07326ec2..99ec65ef 100644 --- a/packages/usage/package.json +++ b/packages/usage/package.json @@ -13,23 +13,23 @@ "author": "", "license": "ISC", "devDependencies": { - "@types/node": "^18.14.5", + "@types/node": "^18.15.0", "prisma": "^4.11.0", "typescript": "^4.9.5" }, "dependencies": { "@prisma/client": "^4.11.0", - "@trpc/client": "^10.14.0", - "@trpc/server": "^10.14.0", + "@trpc/client": "^10.15.0", + "@trpc/server": "^10.15.0", "@types/validator": "^13.7.13", "cross-fetch": "^3.1.5", "decimal.js": "^10.4.3", - "prisma-zod-generator": "^0.7.4", + "prisma-zod-generator": "^0.8.11", "ts-node": "^10.9.1", "ts-node-dev": "^2.0.0", "validator": "^13.9.0", "vitest": "^0.25.8", "zod": "^3.21.4", - "zod-prisma-types": "workspace:2.3.6" + "zod-prisma-types": "workspace:2.4.1" } } diff --git a/packages/usage/prisma/schema.prisma b/packages/usage/prisma/schema.prisma index e792e01d..eb1f5801 100644 --- a/packages/usage/prisma/schema.prisma +++ b/packages/usage/prisma/schema.prisma @@ -20,12 +20,12 @@ generator zod { provider = "ts-node-dev ../generator/src/bin.ts" // provider = "zod-prisma-types" output = "./generated/zod" // default is ./generated/zod - useMultipleFiles = true // default is false + // useMultipleFiles = true // default is false // createInputTypes = false // default is true // createModelTypes = false // default is true // addInputTypeValidation = false // default is true - addIncludeType = false // default is true - addSelectType = false // default is true + // addIncludeType = false // default is true + // addSelectType = false // default is true // validateWhereUniqueInput = true // default is false createOptionalDefaultValuesTypes = true // default is false createRelationValuesTypes = true // default is false @@ -36,6 +36,11 @@ generator zod { // prismaClientPath = "./generated/client" // optional } +generator zodPrismaGen { + provider = "prisma-zod-generator" + output = "./generated/zodPrisma" +} + // MIXED CASE ENUMS AND MODELS // ----------------------------------------------- diff --git a/packages/usage/tests/decimal.test.ts b/packages/usage/tests/decimal.test.ts index c7f3d711..1f1a88ce 100644 --- a/packages/usage/tests/decimal.test.ts +++ b/packages/usage/tests/decimal.test.ts @@ -97,6 +97,10 @@ it('should not match a string number with characters to a decimal', () => { // isValidDecimalInput // ------------------------------------ +it('should be a valid input when a 0 as number is provided to "isValidDecimalInput"', () => { + expect(isValidDecimalInput(0)).toBe(true); +}); + it('should be a valid input when a number is provided to "isValidDecimalInput"', () => { expect(isValidDecimalInput(0.123)).toBe(true); }); diff --git a/packages/usage/tests/implementations/xor.ts b/packages/usage/tests/implementations/xor.ts new file mode 100644 index 00000000..558cb213 --- /dev/null +++ b/packages/usage/tests/implementations/xor.ts @@ -0,0 +1,53 @@ +import { Prisma, PrismaClient } from '@prisma/client'; +import { z } from 'zod'; +import { + UserCreateInputSchema, + UserIncludeSchema, + UserSelectSchema, + UserUncheckedCreateInputSchema, +} from '../../prisma/generated/zod'; + +const client = new PrismaClient(); + +type Without = { [P in Exclude]?: never }; + +interface A { + a: string; + b: string; +} + +interface B { + a: string; + c: string; +} + +type C = Without; + +type UserCreateWithout = Without< + Prisma.UserCreateInput, + Prisma.UserUncheckedCreateInput +>; + +export const UserCreateArgsSchema: z.ZodType = z + .object({ + select: UserSelectSchema.optional(), + include: UserIncludeSchema.optional(), + data: z.union([UserCreateInputSchema, UserUncheckedCreateInputSchema]), + }) + .strict(); + +const union = z + .union([UserCreateInputSchema, UserUncheckedCreateInputSchema]) + .superRefine((data) => {}); + +const parsedDAta = UserCreateArgsSchema.parse({ + email: 'mail@mail.com', + name: 'name', + role: ['USER'], + enum: 'ONE', + scalarList: ['a', 'b'], +}); + +client.user.create({ + data: parsedDAta, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c856d87e..d7fa34ce 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -48,37 +48,37 @@ importers: packages/usage: specifiers: '@prisma/client': ^4.11.0 - '@trpc/client': ^10.14.0 - '@trpc/server': ^10.14.0 - '@types/node': ^18.14.5 + '@trpc/client': ^10.15.0 + '@trpc/server': ^10.15.0 + '@types/node': ^18.15.0 '@types/validator': ^13.7.13 cross-fetch: ^3.1.5 decimal.js: ^10.4.3 prisma: ^4.11.0 - prisma-zod-generator: ^0.7.4 + prisma-zod-generator: ^0.8.11 ts-node: ^10.9.1 ts-node-dev: ^2.0.0 typescript: ^4.9.5 validator: ^13.9.0 vitest: ^0.25.8 zod: ^3.21.4 - zod-prisma-types: workspace:2.3.6 + zod-prisma-types: workspace:2.4.1-beta.2 dependencies: '@prisma/client': 4.11.0_prisma@4.11.0 - '@trpc/client': 10.14.0_@trpc+server@10.14.0 - '@trpc/server': 10.14.0 + '@trpc/client': 10.15.0_@trpc+server@10.15.0 + '@trpc/server': 10.15.0 '@types/validator': 13.7.13 cross-fetch: 3.1.5 decimal.js: 10.4.3 - prisma-zod-generator: 0.7.4_prisma@4.11.0 - ts-node: 10.9.1_2cogyjchoknpkalymtikkc6nay - ts-node-dev: 2.0.0_2cogyjchoknpkalymtikkc6nay + prisma-zod-generator: 0.8.11_prisma@4.11.0 + ts-node: 10.9.1_lwgqdwokjtwlohdqtbb6s252kq + ts-node-dev: 2.0.0_lwgqdwokjtwlohdqtbb6s252kq validator: 13.9.0 vitest: 0.25.8 zod: 3.21.4 zod-prisma-types: link:../generator devDependencies: - '@types/node': 18.14.5 + '@types/node': 18.15.0 prisma: 4.11.0 typescript: 4.9.5 @@ -598,16 +598,16 @@ packages: resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} engines: {node: '>= 10'} - /@trpc/client/10.14.0_@trpc+server@10.14.0: - resolution: {integrity: sha512-fi7i+Av3ARGyWwlbuGD+ZeqF5HxomGG8hBB89dWHAc4WlBnDV6g0GQQgDaMKZqXbGt0sYeJucym6WPI6kO7HCQ==} + /@trpc/client/10.15.0_@trpc+server@10.15.0: + resolution: {integrity: sha512-Tmm3N7jibEOZTsvHRU+tWCVvUf8F9/UcKOVTGAWuyasBpnjOZ7ClZ81F9wo4cg9+9tUxUhuJns+E96/HtATpyQ==} peerDependencies: - '@trpc/server': 10.14.0 + '@trpc/server': 10.15.0 dependencies: - '@trpc/server': 10.14.0 + '@trpc/server': 10.15.0 dev: false - /@trpc/server/10.14.0: - resolution: {integrity: sha512-hNnvwkSfqpIb89CH8pTV8VkldS9qjd3ZxaCgya7CeCk6QeDajT/bRX9bPmrkEe0UQtrbbPU5h47nuMrBsN2ghQ==} + /@trpc/server/10.15.0: + resolution: {integrity: sha512-Kf+wTU5iZjjjEzqZDy+o5wc4nEZKvE0yWdF9qZa72xLu6eTJ0BS2hnwQZeCZ2pIbmQb8/6lFr5igHiY4/dy0mA==} dev: false /@tsconfig/node10/1.0.9: @@ -637,7 +637,7 @@ packages: /@types/cross-spawn/6.0.2: resolution: {integrity: sha512-KuwNhp3eza+Rhu8IFI5HUXRP0LIhqH5cAjubUvGXXthh4YYBuP2ntwEX+Cz8GJoZUHlKo247wPWOfA9LYEq4cw==} dependencies: - '@types/node': 18.14.6 + '@types/node': 18.15.0 /@types/debug/4.1.7: resolution: {integrity: sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==} @@ -659,11 +659,8 @@ packages: /@types/ms/0.7.31: resolution: {integrity: sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==} - /@types/node/18.14.5: - resolution: {integrity: sha512-CRT4tMK/DHYhw1fcCEBwME9CSaZNclxfzVMe7GsO6ULSwsttbj70wSiX6rZdIjGblu93sTJxLdhNIT85KKI7Qw==} - - /@types/node/18.14.6: - resolution: {integrity: sha512-93+VvleD3mXwlLI/xASjw0FzKcwzl3OdTCzm1LaRfqgS21gfFtK3zDXM5Op9TeeMsJVOaJ2VRDpT9q4Y3d0AvA==} + /@types/node/18.15.0: + resolution: {integrity: sha512-z6nr0TTEOBGkzLGmbypWOGnpSpSIBorEhC4L+4HeQ2iezKCi4f77kyslRwvHeNitymGQ+oFyIWGP96l/DPSV9w==} /@types/normalize-package-data/2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} @@ -911,7 +908,7 @@ packages: archiver-utils: 2.1.0 async: 3.2.4 buffer-crc32: 0.2.13 - readable-stream: 3.6.1 + readable-stream: 3.6.2 readdir-glob: 1.1.2 tar-stream: 2.2.0 zip-stream: 4.1.0 @@ -1003,7 +1000,7 @@ packages: dependencies: buffer: 5.7.1 inherits: 2.0.4 - readable-stream: 3.6.1 + readable-stream: 3.6.2 /brace-expansion/1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} @@ -1170,7 +1167,7 @@ packages: buffer-crc32: 0.2.13 crc32-stream: 4.0.2 normalize-path: 3.0.0 - readable-stream: 3.6.1 + readable-stream: 3.6.2 /concat-map/0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} @@ -1188,7 +1185,7 @@ packages: engines: {node: '>= 10'} dependencies: crc-32: 1.2.2 - readable-stream: 3.6.1 + readable-stream: 3.6.2 /create-require/1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} @@ -2996,8 +2993,8 @@ packages: engines: {node: '>=10.13.0'} hasBin: true - /prisma-zod-generator/0.7.4_prisma@4.11.0: - resolution: {integrity: sha512-84e5hO0pdKrAWDhwwekvk+x55Ujarv0Syu3yn0I7cgKPJqfy9le9tAVGilUHEd17Ee1YtV8CaqDeO6RXo0qZEw==} + /prisma-zod-generator/0.8.11_prisma@4.11.0: + resolution: {integrity: sha512-wp0+pxSJLMQhlOkfH+Y4FhFiZrrn7QEVL4aPJAoMyiW4Il0wJmipBMAfjJydKyu9tmGQp4QcAcD6vHNf9tI6ZA==} hasBin: true dependencies: '@prisma/client': 4.11.0_prisma@4.11.0 @@ -3082,8 +3079,8 @@ packages: string_decoder: 1.1.1 util-deprecate: 1.0.2 - /readable-stream/3.6.1: - resolution: {integrity: sha512-+rQmrWMYGA90yenhTYsLWAsLsqVC8osOw6PKE1HDYiO0gdPeKe/xDHNzIAIn4C91YQ6oenEhfYqqc1883qHbjQ==} + /readable-stream/3.6.2: + resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} engines: {node: '>= 6'} dependencies: inherits: 2.0.4 @@ -3178,8 +3175,8 @@ packages: fsevents: 2.3.2 dev: true - /rollup/3.18.0: - resolution: {integrity: sha512-J8C6VfEBjkvYPESMQYxKHxNOh4A5a3FlP+0BETGo34HEcE4eTlgCrO2+eWzlu2a/sHs2QUkZco+wscH7jhhgWg==} + /rollup/3.19.1: + resolution: {integrity: sha512-lAbrdN7neYCg/8WaoWn/ckzCtz+jr70GFfYdlf50OF7387HTg+wiuiqJRFYawwSPpqfqDNYqK7smY/ks2iAudg==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: @@ -3277,7 +3274,7 @@ packages: resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} dependencies: spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.12 + spdx-license-ids: 3.0.13 /spdx-exceptions/2.3.0: resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==} @@ -3286,10 +3283,10 @@ packages: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} dependencies: spdx-exceptions: 2.3.0 - spdx-license-ids: 3.0.12 + spdx-license-ids: 3.0.13 - /spdx-license-ids/3.0.12: - resolution: {integrity: sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==} + /spdx-license-ids/3.0.13: + resolution: {integrity: sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==} /streamsearch/1.1.0: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} @@ -3415,7 +3412,7 @@ packages: end-of-stream: 1.4.4 fs-constants: 1.0.0 inherits: 2.0.4 - readable-stream: 3.6.1 + readable-stream: 3.6.2 /temp-dir/1.0.0: resolution: {integrity: sha512-xZFXEGbG7SNC3itwBzI3RYjq/cEhBkx2hJuKGIUOcEULmkQExXiHat2z/qkISYsuR+IKumhEfKKbV5qXmhICFQ==} @@ -3456,13 +3453,8 @@ packages: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true - /tinybench/2.3.1: - resolution: {integrity: sha512-hGYWYBMPr7p4g5IarQE7XhlyWveh1EKhy4wUBS1LrHXCKYgvz+4/jCqgmJqZxxldesn05vccrtME2RLLZNW7iA==} - dev: false - /tinybench/2.4.0: resolution: {integrity: sha512-iyziEiyFxX4kyxSp+MtY1oCH/lvjH3PxFN8PGCDeqcZWAJ/i+9y+nL85w99PxVzrIvew/GSkSbDYtiGVa85Afg==} - dev: true /tinypool/0.3.1: resolution: {integrity: sha512-zLA1ZXlstbU2rlpA4CIeVaqvWq41MTWqLY3FfsAXgC8+f7Pk7zroaJQxDgxn1xNudKW6Kmj4808rPFShUlIRmQ==} @@ -3492,7 +3484,7 @@ packages: hasBin: true dev: false - /ts-node-dev/2.0.0_2cogyjchoknpkalymtikkc6nay: + /ts-node-dev/2.0.0_lwgqdwokjtwlohdqtbb6s252kq: resolution: {integrity: sha512-ywMrhCfH6M75yftYvrvNarLEY+SUXtUvU8/0Z6llrHQVBx12GiFk5sStF8UdfE/yfzk9IAq7O5EEbTQsxlBI8w==} engines: {node: '>=0.8.0'} hasBin: true @@ -3511,7 +3503,7 @@ packages: rimraf: 2.7.1 source-map-support: 0.5.21 tree-kill: 1.2.2 - ts-node: 10.9.1_2cogyjchoknpkalymtikkc6nay + ts-node: 10.9.1_lwgqdwokjtwlohdqtbb6s252kq tsconfig: 7.0.0 typescript: 4.9.5 transitivePeerDependencies: @@ -3520,7 +3512,7 @@ packages: - '@types/node' dev: false - /ts-node/10.9.1_2cogyjchoknpkalymtikkc6nay: + /ts-node/10.9.1_lwgqdwokjtwlohdqtbb6s252kq: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -3539,7 +3531,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.3 - '@types/node': 18.14.5 + '@types/node': 18.15.0 acorn: 8.8.2 acorn-walk: 8.2.0 arg: 4.1.3 @@ -3757,7 +3749,7 @@ packages: engines: {node: '>= 0.10'} dev: false - /vite/3.2.5_@types+node@18.14.6: + /vite/3.2.5_@types+node@18.15.0: resolution: {integrity: sha512-4mVEpXpSOgrssFZAOmGIr85wPHKvaDAcXqxVxVRZhljkJOMZi1ibLibzjLHzJvcok8BMguLc7g1W6W/GqZbLdQ==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -3782,7 +3774,7 @@ packages: terser: optional: true dependencies: - '@types/node': 18.14.6 + '@types/node': 18.15.0 esbuild: 0.15.18 postcss: 8.4.21 resolve: 1.22.1 @@ -3791,7 +3783,7 @@ packages: fsevents: 2.3.2 dev: true - /vite/4.1.4_@types+node@18.14.5: + /vite/4.1.4_@types+node@18.15.0: resolution: {integrity: sha512-3knk/HsbSTKEin43zHu7jTwYWv81f8kgAL99G5NWBcA1LKvtvcVAC4JjBH1arBunO9kQka+1oGbrMKOjk4ZrBg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -3816,11 +3808,11 @@ packages: terser: optional: true dependencies: - '@types/node': 18.14.5 + '@types/node': 18.15.0 esbuild: 0.16.17 postcss: 8.4.21 resolve: 1.22.1 - rollup: 3.18.0 + rollup: 3.19.1 optionalDependencies: fsevents: 2.3.2 dev: false @@ -3849,7 +3841,7 @@ packages: dependencies: '@types/chai': 4.3.4 '@types/chai-subset': 1.3.3 - '@types/node': 18.14.6 + '@types/node': 18.15.0 chai: 4.3.7 debug: 4.3.4 local-pkg: 0.4.3 @@ -3857,7 +3849,7 @@ packages: tinybench: 2.4.0 tinypool: 0.3.1 tinyspy: 1.1.1 - vite: 3.2.5_@types+node@18.14.6 + vite: 3.2.5_@types+node@18.15.0 transitivePeerDependencies: - less - sass @@ -3891,7 +3883,7 @@ packages: dependencies: '@types/chai': 4.3.4 '@types/chai-subset': 1.3.3 - '@types/node': 18.14.5 + '@types/node': 18.15.0 acorn: 8.8.2 acorn-walk: 8.2.0 chai: 4.3.7 @@ -3899,10 +3891,10 @@ packages: local-pkg: 0.4.3 source-map: 0.6.1 strip-literal: 1.0.1 - tinybench: 2.3.1 + tinybench: 2.4.0 tinypool: 0.3.1 tinyspy: 1.1.1 - vite: 4.1.4_@types+node@18.14.5 + vite: 4.1.4_@types+node@18.15.0 transitivePeerDependencies: - less - sass @@ -3987,7 +3979,7 @@ packages: dependencies: archiver-utils: 2.1.0 compress-commons: 4.1.1 - readable-stream: 3.6.1 + readable-stream: 3.6.2 /zod/3.21.4: resolution: {integrity: sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==}