diff --git a/front-end/user-app/src/app/app-routing.module.ts b/front-end/user-app/src/app/app-routing.module.ts
index f4735c4..c762a3f 100644
--- a/front-end/user-app/src/app/app-routing.module.ts
+++ b/front-end/user-app/src/app/app-routing.module.ts
@@ -26,6 +26,28 @@ const routes: Routes = [
path: 'dashboard',
component: DashboardComponent,
canActivate: [AuthGuard],
+ },
+ {
+ path: '',
+ component: UserListComponent,
+ },
+ {
+ path: 'about-us',
+ component: AboutUsComponent,
+ },
+ {
+ path: 'contact',
+ component: ContactComponent,
+ },
+ {
+ path: 'user-detail',
+ component: UserDetailComponent,
+ canActivate: [AuthGuard],
+ },
+ {
+ path: 'create-user',
+ component: CreateUserComponent,
+ canActivate: [AuthGuard],
}
];
diff --git a/front-end/user-app/src/app/guards/auth.guard.ts b/front-end/user-app/src/app/guards/auth.guard.ts
index 092a104..5acee85 100644
--- a/front-end/user-app/src/app/guards/auth.guard.ts
+++ b/front-end/user-app/src/app/guards/auth.guard.ts
@@ -14,6 +14,12 @@ import { Router } from '@angular/router';
export class AuthGuard implements CanActivate {
constructor(private authService: AuthService, private router: Router){}
canActivate(): boolean {
- return true;
+ let isAuthenticated = this.authService.isAuthenticated();
+ if (isAuthenticated) {
+ return true;
+ } else {
+ this.authService.logout();
+ return false;
+ }
}
}
diff --git a/front-end/user-app/src/app/interceptors/auth.interceptor.ts b/front-end/user-app/src/app/interceptors/auth.interceptor.ts
index 8d72b76..fb985b2 100644
--- a/front-end/user-app/src/app/interceptors/auth.interceptor.ts
+++ b/front-end/user-app/src/app/interceptors/auth.interceptor.ts
@@ -26,7 +26,15 @@ export class AuthInterceptor implements HttpInterceptor {
}
//copy paste the code here
-
+ if (this.authService.isAuthenticated()) {
+ request = request.clone({
+ setHeaders: {
+ Authorization: `Bearer ${this.authService.getAuthToken()}`
+ }
+ });
+ } else {
+ this.authService.logout();
+ }
return next.handle(request).pipe(
catchError((error) => {
diff --git a/front-end/user-app/src/app/pages/dashboard/dashboard.component.html b/front-end/user-app/src/app/pages/dashboard/dashboard.component.html
index d920124..d3c47d8 100644
--- a/front-end/user-app/src/app/pages/dashboard/dashboard.component.html
+++ b/front-end/user-app/src/app/pages/dashboard/dashboard.component.html
@@ -1,3 +1,24 @@
-
-
You are logged into dashboard
-
+
+
+
+
+ Welcome Page
+
+
+
+
+ You are logged into the dashboard
+ Welcome
+
+
+
+
+
+
diff --git a/front-end/user-app/src/app/pages/login/login.component.html b/front-end/user-app/src/app/pages/login/login.component.html
index 3b6092e..e1d1cdc 100644
--- a/front-end/user-app/src/app/pages/login/login.component.html
+++ b/front-end/user-app/src/app/pages/login/login.component.html
@@ -8,7 +8,7 @@ Welcome to Address Book
diff --git a/front-end/user-app/src/app/pages/login/login.component.ts b/front-end/user-app/src/app/pages/login/login.component.ts
index 07d0496..be2d312 100644
--- a/front-end/user-app/src/app/pages/login/login.component.ts
+++ b/front-end/user-app/src/app/pages/login/login.component.ts
@@ -16,11 +16,25 @@ export class LoginComponent {
password: formBuilder.control('', [Validators.required]),
});
}
-
async onSubmit(){
if(this.loginForm.valid){
+ await this.authService.login(this.loginForm.value)
+ .then(
+ (response:any)=>{
+ if(response){
+ localStorage.setItem('jwt', response.Authorization);
+ this.authService.setLogedInUser();
+ this.router.navigateByUrl('/dashboard');
+ }else{
+ alert("Invalid email id password");
+ }
+ },(error)=>{
+ console.log(error);
+ }
+ );
}
}
+
}
diff --git a/front-end/user-app/src/app/pages/sign-up/sign-up.component.html b/front-end/user-app/src/app/pages/sign-up/sign-up.component.html
index cf4b8f9..ba9338b 100644
--- a/front-end/user-app/src/app/pages/sign-up/sign-up.component.html
+++ b/front-end/user-app/src/app/pages/sign-up/sign-up.component.html
@@ -7,11 +7,11 @@ SignUp to Address Book
diff --git a/front-end/user-app/src/app/services/auth.service.ts b/front-end/user-app/src/app/services/auth.service.ts
index c6d18b4..6185f6a 100644
--- a/front-end/user-app/src/app/services/auth.service.ts
+++ b/front-end/user-app/src/app/services/auth.service.ts
@@ -40,6 +40,7 @@ export class AuthService {
}
async login(data: any){
+ return await this.http.post(this.baseUrl+'/auth/login',data).toPromise()
}
logout() {
@@ -67,6 +68,7 @@ export class AuthService {
let decodedToken:any = jwt_decode(token);
console.log(decodedToken);
// Set the loged in user data.
+ this.loggedInUser['firstName']=decodedToken?.firstName;
this.loggedInUser['emailId'] = decodedToken?.userEmailId;
this.loggedInUser['id']= decodedToken.userId;
} else{
diff --git a/tempCodeRunnerFile b/tempCodeRunnerFile
new file mode 100755
index 0000000..fd0e89c
Binary files /dev/null and b/tempCodeRunnerFile differ
diff --git a/uc-controller-user/controller-user/prisma/migrations/20230922050352_init/migration.sql b/uc-controller-user/controller-user/prisma/migrations/20230922050352_init/migration.sql
new file mode 100644
index 0000000..e674b5a
--- /dev/null
+++ b/uc-controller-user/controller-user/prisma/migrations/20230922050352_init/migration.sql
@@ -0,0 +1,35 @@
+-- CreateEnum
+CREATE TYPE "Role" AS ENUM ('CLIENT', 'ADMIN', 'ROOT');
+
+-- CreateTable
+CREATE TABLE "user" (
+ "id" SERIAL NOT NULL,
+ "first_name" TEXT NOT NULL,
+ "email_id" TEXT NOT NULL,
+ "last_name" TEXT NOT NULL,
+ "password" TEXT NOT NULL,
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+
+ CONSTRAINT "user_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "contact" (
+ "id" SERIAL NOT NULL,
+ "name" TEXT NOT NULL,
+ "email_id" TEXT NOT NULL,
+ "street" TEXT NOT NULL,
+ "city" TEXT NOT NULL,
+ "zipcode" INTEGER NOT NULL,
+ "company_name" TEXT NOT NULL,
+ "phone_number" TEXT NOT NULL,
+ "userId" INTEGER NOT NULL,
+
+ CONSTRAINT "contact_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateIndex
+CREATE UNIQUE INDEX "user_email_id_key" ON "user"("email_id");
+
+-- AddForeignKey
+ALTER TABLE "contact" ADD CONSTRAINT "contact_userId_fkey" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
diff --git a/uc-controller-user/controller-user/prisma/migrations/migration_lock.toml b/uc-controller-user/controller-user/prisma/migrations/migration_lock.toml
new file mode 100644
index 0000000..fbffa92
--- /dev/null
+++ b/uc-controller-user/controller-user/prisma/migrations/migration_lock.toml
@@ -0,0 +1,3 @@
+# Please do not edit this file manually
+# It should be added in your version-control system (i.e. Git)
+provider = "postgresql"
\ No newline at end of file
diff --git a/uc-controller-user/controller-user/prisma/prismaAuthUserClient/index-browser.js b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/index-browser.js
new file mode 100644
index 0000000..8ba5c1d
--- /dev/null
+++ b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/index-browser.js
@@ -0,0 +1,158 @@
+
+Object.defineProperty(exports, "__esModule", { value: true });
+
+const {
+ Decimal,
+ objectEnumValues,
+ makeStrictEnum,
+ Public,
+} = require('./runtime/index-browser')
+
+
+const Prisma = {}
+
+exports.Prisma = Prisma
+
+/**
+ * Prisma Client JS version: 4.16.2
+ * Query Engine version: 4bc8b6e1b66cb932731fb1bdbbc550d1e010de81
+ */
+Prisma.prismaVersion = {
+ client: "4.16.2",
+ engine: "4bc8b6e1b66cb932731fb1bdbbc550d1e010de81"
+}
+
+Prisma.PrismaClientKnownRequestError = () => {
+ throw new Error(`PrismaClientKnownRequestError is unable to be run in the browser.
+In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`,
+)};
+Prisma.PrismaClientUnknownRequestError = () => {
+ throw new Error(`PrismaClientUnknownRequestError is unable to be run in the browser.
+In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`,
+)}
+Prisma.PrismaClientRustPanicError = () => {
+ throw new Error(`PrismaClientRustPanicError is unable to be run in the browser.
+In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`,
+)}
+Prisma.PrismaClientInitializationError = () => {
+ throw new Error(`PrismaClientInitializationError is unable to be run in the browser.
+In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`,
+)}
+Prisma.PrismaClientValidationError = () => {
+ throw new Error(`PrismaClientValidationError is unable to be run in the browser.
+In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`,
+)}
+Prisma.NotFoundError = () => {
+ throw new Error(`NotFoundError is unable to be run in the browser.
+In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`,
+)}
+Prisma.Decimal = Decimal
+
+/**
+ * Re-export of sql-template-tag
+ */
+Prisma.sql = () => {
+ throw new Error(`sqltag is unable to be run in the browser.
+In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`,
+)}
+Prisma.empty = () => {
+ throw new Error(`empty is unable to be run in the browser.
+In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`,
+)}
+Prisma.join = () => {
+ throw new Error(`join is unable to be run in the browser.
+In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`,
+)}
+Prisma.raw = () => {
+ throw new Error(`raw is unable to be run in the browser.
+In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`,
+)}
+Prisma.validator = Public.validator
+
+/**
+* Extensions
+*/
+Prisma.getExtensionContext = () => {
+ throw new Error(`Extensions.getExtensionContext is unable to be run in the browser.
+In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`,
+)}
+Prisma.defineExtension = () => {
+ throw new Error(`Extensions.defineExtension is unable to be run in the browser.
+In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`,
+)}
+
+/**
+ * Shorthand utilities for JSON filtering
+ */
+Prisma.DbNull = objectEnumValues.instances.DbNull
+Prisma.JsonNull = objectEnumValues.instances.JsonNull
+Prisma.AnyNull = objectEnumValues.instances.AnyNull
+
+Prisma.NullTypes = {
+ DbNull: objectEnumValues.classes.DbNull,
+ JsonNull: objectEnumValues.classes.JsonNull,
+ AnyNull: objectEnumValues.classes.AnyNull
+}
+
+/**
+ * Enums
+ */
+
+exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
+ ReadUncommitted: 'ReadUncommitted',
+ ReadCommitted: 'ReadCommitted',
+ RepeatableRead: 'RepeatableRead',
+ Serializable: 'Serializable'
+});
+
+exports.Prisma.UserScalarFieldEnum = {
+ id: 'id',
+ firstName: 'firstName',
+ emailId: 'emailId',
+ lastName: 'lastName',
+ password: 'password',
+ createdAt: 'createdAt'
+};
+
+exports.Prisma.ContactScalarFieldEnum = {
+ id: 'id',
+ name: 'name',
+ emailId: 'emailId',
+ street: 'street',
+ city: 'city',
+ zipcode: 'zipcode',
+ companyName: 'companyName',
+ phoneNumber: 'phoneNumber',
+ userId: 'userId'
+};
+
+exports.Prisma.SortOrder = {
+ asc: 'asc',
+ desc: 'desc'
+};
+
+exports.Prisma.QueryMode = {
+ default: 'default',
+ insensitive: 'insensitive'
+};
+
+
+exports.Prisma.ModelName = {
+ User: 'User',
+ Contact: 'Contact'
+};
+
+/**
+ * Create the Client
+ */
+class PrismaClient {
+ constructor() {
+ throw new Error(
+ `PrismaClient is unable to be run in the browser.
+In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`,
+ )
+ }
+}
+exports.PrismaClient = PrismaClient
+
+Object.assign(exports, Prisma)
diff --git a/uc-controller-user/controller-user/prisma/prismaAuthUserClient/index.d.ts b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/index.d.ts
new file mode 100644
index 0000000..ac4ae67
--- /dev/null
+++ b/uc-controller-user/controller-user/prisma/prismaAuthUserClient/index.d.ts
@@ -0,0 +1,3884 @@
+
+/**
+ * Client
+**/
+
+import * as runtime from './runtime/library';
+import $Types = runtime.Types // general types
+import $Public = runtime.Types.Public
+import $Utils = runtime.Types.Utils
+import $Extensions = runtime.Types.Extensions
+
+export type PrismaPromise = $Public.PrismaPromise
+
+
+export type UserPayload = {
+ name: "User"
+ objects: {
+ contacts: ContactPayload[]
+ }
+ scalars: $Extensions.GetResult<{
+ id: number
+ firstName: string
+ emailId: string
+ lastName: string
+ password: string
+ createdAt: Date
+ }, ExtArgs["result"]["user"]>
+ composites: {}
+}
+
+/**
+ * Model User
+ *
+ */
+export type User = runtime.Types.DefaultSelection
+export type ContactPayload = {
+ name: "Contact"
+ objects: {
+ user: UserPayload
+ }
+ scalars: $Extensions.GetResult<{
+ id: number
+ name: string
+ emailId: string
+ street: string
+ city: string
+ zipcode: number
+ companyName: string
+ phoneNumber: string
+ userId: number
+ }, ExtArgs["result"]["contact"]>
+ composites: {}
+}
+
+/**
+ * Model Contact
+ *
+ */
+export type Contact = runtime.Types.DefaultSelection
+
+/**
+ * ## Prisma Client ʲˢ
+ *
+ * Type-safe database client for TypeScript & Node.js
+ * @example
+ * ```
+ * const prisma = new PrismaClient()
+ * // Fetch zero or more Users
+ * const users = await prisma.user.findMany()
+ * ```
+ *
+ *
+ * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client).
+ */
+export class PrismaClient<
+ T extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions,
+ U = 'log' extends keyof T ? T['log'] extends Array ? Prisma.GetEvents : never : never,
+ GlobalReject extends Prisma.RejectOnNotFound | Prisma.RejectPerOperation | false | undefined = 'rejectOnNotFound' extends keyof T
+ ? T['rejectOnNotFound']
+ : false,
+ ExtArgs extends $Extensions.Args = $Extensions.DefaultArgs
+> {
+ [K: symbol]: { types: Prisma.TypeMap['other'] }
+
+ /**
+ * ## Prisma Client ʲˢ
+ *
+ * Type-safe database client for TypeScript & Node.js
+ * @example
+ * ```
+ * const prisma = new PrismaClient()
+ * // Fetch zero or more Users
+ * const users = await prisma.user.findMany()
+ * ```
+ *
+ *
+ * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client).
+ */
+
+ constructor(optionsArg ?: Prisma.Subset);
+ $on(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : V extends 'beforeExit' ? () => Promise : Prisma.LogEvent) => void): void;
+
+ /**
+ * Connect with the database
+ */
+ $connect(): Promise;
+
+ /**
+ * Disconnect from the database
+ */
+ $disconnect(): Promise;
+
+ /**
+ * Add a middleware
+ * @deprecated since 4.16.0. For new code, prefer client extensions instead.
+ * @see https://pris.ly/d/extensions
+ */
+ $use(cb: Prisma.Middleware): void
+
+/**
+ * Executes a prepared raw query and returns the number of affected rows.
+ * @example
+ * ```
+ * const result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`
+ * ```
+ *
+ * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
+ */
+ $executeRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise;
+
+ /**
+ * Executes a raw query and returns the number of affected rows.
+ * Susceptible to SQL injections, see documentation.
+ * @example
+ * ```
+ * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com')
+ * ```
+ *
+ * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
+ */
+ $executeRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise;
+
+ /**
+ * Performs a prepared raw query and returns the `SELECT` data.
+ * @example
+ * ```
+ * const result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`
+ * ```
+ *
+ * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
+ */
+ $queryRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise;
+
+ /**
+ * Performs a raw query and returns the `SELECT` data.
+ * Susceptible to SQL injections, see documentation.
+ * @example
+ * ```
+ * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com')
+ * ```
+ *
+ * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
+ */
+ $queryRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise;
+
+ /**
+ * Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole.
+ * @example
+ * ```
+ * const [george, bob, alice] = await prisma.$transaction([
+ * prisma.user.create({ data: { name: 'George' } }),
+ * prisma.user.create({ data: { name: 'Bob' } }),
+ * prisma.user.create({ data: { name: 'Alice' } }),
+ * ])
+ * ```
+ *
+ * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client/transactions).
+ */
+ $transaction[]>(arg: [...P], options?: { isolationLevel?: Prisma.TransactionIsolationLevel }): Promise>
+
+ $transaction(fn: (prisma: Omit) => Promise, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): Promise
+
+
+ $extends: $Extensions.ExtendsHook<'extends', Prisma.TypeMapCb, ExtArgs>
+
+ /**
+ * `prisma.user`: Exposes CRUD operations for the **User** model.
+ * Example usage:
+ * ```ts
+ * // Fetch zero or more Users
+ * const users = await prisma.user.findMany()
+ * ```
+ */
+ get user(): Prisma.UserDelegate;
+
+ /**
+ * `prisma.contact`: Exposes CRUD operations for the **Contact** model.
+ * Example usage:
+ * ```ts
+ * // Fetch zero or more Contacts
+ * const contacts = await prisma.contact.findMany()
+ * ```
+ */
+ get contact(): Prisma.ContactDelegate;
+}
+
+export namespace Prisma {
+ export import DMMF = runtime.DMMF
+
+ export type PrismaPromise = $Public.PrismaPromise
+
+ /**
+ * Validator
+ */
+ export import validator = runtime.Public.validator
+
+ /**
+ * Prisma Errors
+ */
+ export import PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError
+ export import PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError
+ export import PrismaClientRustPanicError = runtime.PrismaClientRustPanicError
+ export import PrismaClientInitializationError = runtime.PrismaClientInitializationError
+ export import PrismaClientValidationError = runtime.PrismaClientValidationError
+ export import NotFoundError = runtime.NotFoundError
+
+ /**
+ * Re-export of sql-template-tag
+ */
+ export import sql = runtime.sqltag
+ export import empty = runtime.empty
+ export import join = runtime.join
+ export import raw = runtime.raw
+ export import Sql = runtime.Sql
+
+ /**
+ * Decimal.js
+ */
+ export import Decimal = runtime.Decimal
+
+ export type DecimalJsLike = runtime.DecimalJsLike
+
+ /**
+ * Metrics
+ */
+ export type Metrics = runtime.Metrics
+ export type Metric = runtime.Metric
+ export type MetricHistogram = runtime.MetricHistogram
+ export type MetricHistogramBucket = runtime.MetricHistogramBucket
+
+ /**
+ * Extensions
+ */
+ export type Extension = $Extensions.UserArgs
+ export import getExtensionContext = runtime.Extensions.getExtensionContext
+ export type Args = $Public.Args
+ export type Payload = $Public.Payload
+ export type Result = $Public.Result
+ export type Exact = $Public.Exact
+
+ /**
+ * Prisma Client JS version: 4.16.2
+ * Query Engine version: 4bc8b6e1b66cb932731fb1bdbbc550d1e010de81
+ */
+ export type PrismaVersion = {
+ client: string
+ }
+
+ export const prismaVersion: PrismaVersion
+
+ /**
+ * Utility Types
+ */
+
+ /**
+ * From https://github.com/sindresorhus/type-fest/
+ * Matches a JSON object.
+ * This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from.
+ */
+ export type JsonObject = {[Key in string]?: JsonValue}
+
+ /**
+ * From https://github.com/sindresorhus/type-fest/
+ * Matches a JSON array.
+ */
+ export interface JsonArray extends Array {}
+
+ /**
+ * From https://github.com/sindresorhus/type-fest/
+ * Matches any valid JSON value.
+ */
+ export type JsonValue = string | number | boolean | JsonObject | JsonArray | null
+
+ /**
+ * Matches a JSON object.
+ * Unlike `JsonObject`, this type allows undefined and read-only properties.
+ */
+ export type InputJsonObject = {readonly [Key in string]?: InputJsonValue | null}
+
+ /**
+ * Matches a JSON array.
+ * Unlike `JsonArray`, readonly arrays are assignable to this type.
+ */
+ export interface InputJsonArray extends ReadonlyArray {}
+
+ /**
+ * Matches any valid value that can be used as an input for operations like
+ * create and update as the value of a JSON field. Unlike `JsonValue`, this
+ * type allows read-only arrays and read-only object properties and disallows
+ * `null` at the top level.
+ *
+ * `null` cannot be used as the value of a JSON field because its meaning
+ * would be ambiguous. Use `Prisma.JsonNull` to store the JSON null value or
+ * `Prisma.DbNull` to clear the JSON value and set the field to the database
+ * NULL value instead.
+ *
+ * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-by-null-values
+ */
+ export type InputJsonValue = string | number | boolean | InputJsonObject | InputJsonArray
+
+ /**
+ * Types of the values used to represent different kinds of `null` values when working with JSON fields.
+ *
+ * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
+ */
+ namespace NullTypes {
+ /**
+ * Type of `Prisma.DbNull`.
+ *
+ * You cannot use other instances of this class. Please use the `Prisma.DbNull` value.
+ *
+ * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
+ */
+ class DbNull {
+ private DbNull: never
+ private constructor()
+ }
+
+ /**
+ * Type of `Prisma.JsonNull`.
+ *
+ * You cannot use other instances of this class. Please use the `Prisma.JsonNull` value.
+ *
+ * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
+ */
+ class JsonNull {
+ private JsonNull: never
+ private constructor()
+ }
+
+ /**
+ * Type of `Prisma.AnyNull`.
+ *
+ * You cannot use other instances of this class. Please use the `Prisma.AnyNull` value.
+ *
+ * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
+ */
+ class AnyNull {
+ private AnyNull: never
+ private constructor()
+ }
+ }
+
+ /**
+ * Helper for filtering JSON entries that have `null` on the database (empty on the db)
+ *
+ * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
+ */
+ export const DbNull: NullTypes.DbNull
+
+ /**
+ * Helper for filtering JSON entries that have JSON `null` values (not empty on the db)
+ *
+ * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
+ */
+ export const JsonNull: NullTypes.JsonNull
+
+ /**
+ * Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull`
+ *
+ * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
+ */
+ export const AnyNull: NullTypes.AnyNull
+
+ type SelectAndInclude = {
+ select: any
+ include: any
+ }
+ type HasSelect = {
+ select: any
+ }
+ type HasInclude = {
+ include: any
+ }
+ type CheckSelect = T extends SelectAndInclude
+ ? 'Please either choose `select` or `include`'
+ : T extends HasSelect
+ ? U
+ : T extends HasInclude
+ ? U
+ : S
+
+ /**
+ * Get the type of the value, that the Promise holds.
+ */
+ export type PromiseType> = T extends PromiseLike ? U : T;
+
+ /**
+ * Get the return type of a function which returns a Promise.
+ */
+ export type PromiseReturnType Promise> = PromiseType>
+
+ /**
+ * From T, pick a set of properties whose keys are in the union K
+ */
+ type Prisma__Pick = {
+ [P in K]: T[P];
+ };
+
+
+ export type Enumerable = T | Array;
+
+ export type RequiredKeys = {
+ [K in keyof T]-?: {} extends Prisma__Pick ? never : K
+ }[keyof T]
+
+ export type TruthyKeys = keyof {
+ [K in keyof T as T[K] extends false | undefined | null ? never : K]: K
+ }
+
+ export type TrueKeys = TruthyKeys>>
+
+ /**
+ * Subset
+ * @desc From `T` pick properties that exist in `U`. Simple version of Intersection
+ */
+ export type Subset = {
+ [key in keyof T]: key extends keyof U ? T[key] : never;
+ };
+
+ /**
+ * SelectSubset
+ * @desc From `T` pick properties that exist in `U`. Simple version of Intersection.
+ * Additionally, it validates, if both select and include are present. If the case, it errors.
+ */
+ export type SelectSubset = {
+ [key in keyof T]: key extends keyof U ? T[key] : never
+ } &
+ (T extends SelectAndInclude
+ ? 'Please either choose `select` or `include`.'
+ : {})
+
+ /**
+ * Subset + Intersection
+ * @desc From `T` pick properties that exist in `U` and intersect `K`
+ */
+ export type SubsetIntersection = {
+ [key in keyof T]: key extends keyof U ? T[key] : never
+ } &
+ K
+
+ type Without = { [P in Exclude]?: never };
+
+ /**
+ * XOR is needed to have a real mutually exclusive union type
+ * https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types
+ */
+ type XOR =
+ T extends object ?
+ U extends object ?
+ (Without & U) | (Without & T)
+ : U : T
+
+
+ /**
+ * Is T a Record?
+ */
+ type IsObject = T extends Array
+ ? False
+ : T extends Date
+ ? False
+ : T extends Uint8Array
+ ? False
+ : T extends BigInt
+ ? False
+ : T extends object
+ ? True
+ : False
+
+
+ /**
+ * If it's T[], return T
+ */
+ export type UnEnumerate = T extends Array ? U : T
+
+ /**
+ * From ts-toolbelt
+ */
+
+ type __Either = Omit &
+ {
+ // Merge all but K
+ [P in K]: Prisma__Pick // With K possibilities
+ }[K]
+
+ type EitherStrict = Strict<__Either>
+
+ type EitherLoose = ComputeRaw<__Either>
+
+ type _Either<
+ O extends object,
+ K extends Key,
+ strict extends Boolean
+ > = {
+ 1: EitherStrict
+ 0: EitherLoose
+ }[strict]
+
+ type Either<
+ O extends object,
+ K extends Key,
+ strict extends Boolean = 1
+ > = O extends unknown ? _Either : never
+
+ export type Union = any
+
+ type PatchUndefined = {
+ [K in keyof O]: O[K] extends undefined ? At : O[K]
+ } & {}
+
+ /** Helper Types for "Merge" **/
+ export type IntersectOf = (
+ U extends unknown ? (k: U) => void : never
+ ) extends (k: infer I) => void
+ ? I
+ : never
+
+ export type Overwrite = {
+ [K in keyof O]: K extends keyof O1 ? O1[K] : O[K];
+ } & {};
+
+ type _Merge = IntersectOf;
+ }>>;
+
+ type Key = string | number | symbol;
+ type AtBasic = K extends keyof O ? O[K] : never;
+ type AtStrict = O[K & keyof O];
+ type AtLoose = O extends unknown ? AtStrict : never;
+ export type At = {
+ 1: AtStrict;
+ 0: AtLoose;
+ }[strict];
+
+ export type ComputeRaw = A extends Function ? A : {
+ [K in keyof A]: A[K];
+ } & {};
+
+ export type OptionalFlat = {
+ [K in keyof O]?: O[K];
+ } & {};
+
+ type _Record = {
+ [P in K]: T;
+ };
+
+ // cause typescript not to expand types and preserve names
+ type NoExpand = T extends unknown ? T : never;
+
+ // this type assumes the passed object is entirely optional
+ type AtLeast = NoExpand<
+ O extends unknown
+ ? | (K extends keyof O ? { [P in K]: O[P] } & O : O)
+ | {[P in keyof O as P extends K ? K : never]-?: O[P]} & O
+ : never>;
+
+ type _Strict = U extends unknown ? U & OptionalFlat<_Record, keyof U>, never>> : never;
+
+ export type Strict = ComputeRaw<_Strict>;
+ /** End Helper Types for "Merge" **/
+
+ export type Merge = ComputeRaw<_Merge>>;
+
+ /**
+ A [[Boolean]]
+ */
+ export type Boolean = True | False
+
+ // /**
+ // 1
+ // */
+ export type True = 1
+
+ /**
+ 0
+ */
+ export type False = 0
+
+ export type Not = {
+ 0: 1
+ 1: 0
+ }[B]
+
+ export type Extends = [A1] extends [never]
+ ? 0 // anything `never` is false
+ : A1 extends A2
+ ? 1
+ : 0
+
+ export type Has = Not<
+ Extends, U1>
+ >
+
+ export type Or = {
+ 0: {
+ 0: 0
+ 1: 1
+ }
+ 1: {
+ 0: 1
+ 1: 1
+ }
+ }[B1][B2]
+
+ export type Keys = U extends unknown ? keyof U : never
+
+ type Cast = A extends B ? A : B;
+
+ export const type: unique symbol;
+
+
+
+ /**
+ * Used by group by
+ */
+
+ export type GetScalarType = O extends object ? {
+ [P in keyof T]: P extends keyof O
+ ? O[P]
+ : never
+ } : never
+
+ type FieldPaths<
+ T,
+ U = Omit
+ > = IsObject extends True ? U : T
+
+ type GetHavingFields = {
+ [K in keyof T]: Or<
+ Or, Extends<'AND', K>>,
+ Extends<'NOT', K>
+ > extends True
+ ? // infer is only needed to not hit TS limit
+ // based on the brilliant idea of Pierre-Antoine Mills
+ // https://github.com/microsoft/TypeScript/issues/30188#issuecomment-478938437
+ T[K] extends infer TK
+ ? GetHavingFields extends object ? Merge> : never>
+ : never
+ : {} extends FieldPaths
+ ? never
+ : K
+ }[keyof T]
+
+ /**
+ * Convert tuple to union
+ */
+ type _TupleToUnion = T extends (infer E)[] ? E : never
+ type TupleToUnion = _TupleToUnion
+ type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T
+
+ /**
+ * Like `Pick`, but with an array
+ */
+ type PickArray> = Prisma__Pick>
+
+ /**
+ * Exclude all keys with underscores
+ */
+ type ExcludeUnderscoreKeys = T extends `_${string}` ? never : T
+
+
+ export type FieldRef = runtime.FieldRef
+
+ type FieldRefInputType = Model extends never ? never : FieldRef
+
+
+ export const ModelName: {
+ User: 'User',
+ Contact: 'Contact'
+ };
+
+ export type ModelName = (typeof ModelName)[keyof typeof ModelName]
+
+
+ export type Datasources = {
+ db?: Datasource
+ }
+
+
+ interface TypeMapCb extends $Utils.Fn<{extArgs: $Extensions.Args}, $Utils.Record> {
+ returns: Prisma.TypeMap
+ }
+
+ export type TypeMap = {
+ meta: {
+ modelProps: 'user' | 'contact'
+ txIsolationLevel: Prisma.TransactionIsolationLevel
+ },
+ model: {
+ User: {
+ payload: UserPayload
+ operations: {
+ findUnique: {
+ args: Prisma.UserFindUniqueArgs,
+ result: $Utils.PayloadToResult | null
+ }
+ findUniqueOrThrow: {
+ args: Prisma.UserFindUniqueOrThrowArgs,
+ result: $Utils.PayloadToResult
+ }
+ findFirst: {
+ args: Prisma.UserFindFirstArgs,
+ result: $Utils.PayloadToResult | null
+ }
+ findFirstOrThrow: {
+ args: Prisma.UserFindFirstOrThrowArgs,
+ result: $Utils.PayloadToResult
+ }
+ findMany: {
+ args: Prisma.UserFindManyArgs,
+ result: $Utils.PayloadToResult[]
+ }
+ create: {
+ args: Prisma.UserCreateArgs,
+ result: $Utils.PayloadToResult
+ }
+ createMany: {
+ args: Prisma.UserCreateManyArgs,
+ result: Prisma.BatchPayload
+ }
+ delete: {
+ args: Prisma.UserDeleteArgs,
+ result: $Utils.PayloadToResult
+ }
+ update: {
+ args: Prisma.UserUpdateArgs,
+ result: $Utils.PayloadToResult
+ }
+ deleteMany: {
+ args: Prisma.UserDeleteManyArgs,
+ result: Prisma.BatchPayload
+ }
+ updateMany: {
+ args: Prisma.UserUpdateManyArgs,
+ result: Prisma.BatchPayload
+ }
+ upsert: {
+ args: Prisma.UserUpsertArgs,
+ result: $Utils.PayloadToResult
+ }
+ aggregate: {
+ args: Prisma.UserAggregateArgs,
+ result: $Utils.Optional
+ }
+ groupBy: {
+ args: Prisma.UserGroupByArgs,
+ result: $Utils.Optional[]
+ }
+ count: {
+ args: Prisma.UserCountArgs,
+ result: $Utils.Optional | number
+ }
+ }
+ }
+ Contact: {
+ payload: ContactPayload
+ operations: {
+ findUnique: {
+ args: Prisma.ContactFindUniqueArgs,
+ result: $Utils.PayloadToResult | null
+ }
+ findUniqueOrThrow: {
+ args: Prisma.ContactFindUniqueOrThrowArgs,
+ result: $Utils.PayloadToResult
+ }
+ findFirst: {
+ args: Prisma.ContactFindFirstArgs,
+ result: $Utils.PayloadToResult | null
+ }
+ findFirstOrThrow: {
+ args: Prisma.ContactFindFirstOrThrowArgs,
+ result: $Utils.PayloadToResult
+ }
+ findMany: {
+ args: Prisma.ContactFindManyArgs,
+ result: $Utils.PayloadToResult[]
+ }
+ create: {
+ args: Prisma.ContactCreateArgs,
+ result: $Utils.PayloadToResult
+ }
+ createMany: {
+ args: Prisma.ContactCreateManyArgs,
+ result: Prisma.BatchPayload
+ }
+ delete: {
+ args: Prisma.ContactDeleteArgs,
+ result: $Utils.PayloadToResult
+ }
+ update: {
+ args: Prisma.ContactUpdateArgs,
+ result: $Utils.PayloadToResult
+ }
+ deleteMany: {
+ args: Prisma.ContactDeleteManyArgs,
+ result: Prisma.BatchPayload
+ }
+ updateMany: {
+ args: Prisma.ContactUpdateManyArgs,
+ result: Prisma.BatchPayload
+ }
+ upsert: {
+ args: Prisma.ContactUpsertArgs,
+ result: $Utils.PayloadToResult
+ }
+ aggregate: {
+ args: Prisma.ContactAggregateArgs,
+ result: $Utils.Optional
+ }
+ groupBy: {
+ args: Prisma.ContactGroupByArgs,
+ result: $Utils.Optional[]
+ }
+ count: {
+ args: Prisma.ContactCountArgs,
+ result: $Utils.Optional | number
+ }
+ }
+ }
+ }
+ } & {
+ other: {
+ payload: any
+ operations: {
+ $executeRawUnsafe: {
+ args: [query: string, ...values: any[]],
+ result: any
+ }
+ $executeRaw: {
+ args: [query: TemplateStringsArray | Prisma.Sql, ...values: any[]],
+ result: any
+ }
+ $queryRawUnsafe: {
+ args: [query: string, ...values: any[]],
+ result: any
+ }
+ $queryRaw: {
+ args: [query: TemplateStringsArray | Prisma.Sql, ...values: any[]],
+ result: any
+ }
+ }
+ }
+ }
+ export const defineExtension: $Extensions.ExtendsHook<'define', Prisma.TypeMapCb, $Extensions.DefaultArgs>
+ export type DefaultPrismaClient = PrismaClient
+ export type RejectOnNotFound = boolean | ((error: Error) => Error)
+ export type RejectPerModel = { [P in ModelName]?: RejectOnNotFound }
+ export type RejectPerOperation = { [P in "findUnique" | "findFirst"]?: RejectPerModel | RejectOnNotFound }
+ type IsReject = T extends true ? True : T extends (err: Error) => Error ? True : False
+ export type HasReject<
+ GlobalRejectSettings extends Prisma.PrismaClientOptions['rejectOnNotFound'],
+ LocalRejectSettings,
+ Action extends PrismaAction,
+ Model extends ModelName
+ > = LocalRejectSettings extends RejectOnNotFound
+ ? IsReject
+ : GlobalRejectSettings extends RejectPerOperation
+ ? Action extends keyof GlobalRejectSettings
+ ? GlobalRejectSettings[Action] extends RejectOnNotFound
+ ? IsReject
+ : GlobalRejectSettings[Action] extends RejectPerModel
+ ? Model extends keyof GlobalRejectSettings[Action]
+ ? IsReject
+ : False
+ : False
+ : False
+ : IsReject
+ export type ErrorFormat = 'pretty' | 'colorless' | 'minimal'
+
+ export interface PrismaClientOptions {
+ /**
+ * Configure findUnique/findFirst to throw an error if the query returns null.
+ * @deprecated since 4.0.0. Use `findUniqueOrThrow`/`findFirstOrThrow` methods instead.
+ * @example
+ * ```
+ * // Reject on both findUnique/findFirst
+ * rejectOnNotFound: true
+ * // Reject only on findFirst with a custom error
+ * rejectOnNotFound: { findFirst: (err) => new Error("Custom Error")}
+ * // Reject on user.findUnique with a custom error
+ * rejectOnNotFound: { findUnique: {User: (err) => new Error("User not found")}}
+ * ```
+ */
+ rejectOnNotFound?: RejectOnNotFound | RejectPerOperation
+ /**
+ * Overwrites the datasource url from your schema.prisma file
+ */
+ datasources?: Datasources
+
+ /**
+ * @default "colorless"
+ */
+ errorFormat?: ErrorFormat
+
+ /**
+ * @example
+ * ```
+ * // Defaults to stdout
+ * log: ['query', 'info', 'warn', 'error']
+ *
+ * // Emit as events
+ * log: [
+ * { emit: 'stdout', level: 'query' },
+ * { emit: 'stdout', level: 'info' },
+ * { emit: 'stdout', level: 'warn' }
+ * { emit: 'stdout', level: 'error' }
+ * ]
+ * ```
+ * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option).
+ */
+ log?: Array
+ }
+
+ /* Types for Logging */
+ export type LogLevel = 'info' | 'query' | 'warn' | 'error'
+ export type LogDefinition = {
+ level: LogLevel
+ emit: 'stdout' | 'event'
+ }
+
+ export type GetLogType = T extends LogDefinition ? T['emit'] extends 'event' ? T['level'] : never : never
+ export type GetEvents = T extends Array ?
+ GetLogType | GetLogType | GetLogType | GetLogType
+ : never
+
+ export type QueryEvent = {
+ timestamp: Date
+ query: string
+ params: string
+ duration: number
+ target: string
+ }
+
+ export type LogEvent = {
+ timestamp: Date
+ message: string
+ target: string
+ }
+ /* End Types for Logging */
+
+
+ export type PrismaAction =
+ | 'findUnique'
+ | 'findMany'
+ | 'findFirst'
+ | 'create'
+ | 'createMany'
+ | 'update'
+ | 'updateMany'
+ | 'upsert'
+ | 'delete'
+ | 'deleteMany'
+ | 'executeRaw'
+ | 'queryRaw'
+ | 'aggregate'
+ | 'count'
+ | 'runCommandRaw'
+ | 'findRaw'
+
+ /**
+ * These options are being passed into the middleware as "params"
+ */
+ export type MiddlewareParams = {
+ model?: ModelName
+ action: PrismaAction
+ args: any
+ dataPath: string[]
+ runInTransaction: boolean
+ }
+
+ /**
+ * The `T` type makes sure, that the `return proceed` is not forgotten in the middleware implementation
+ */
+ export type Middleware = (
+ params: MiddlewareParams,
+ next: (params: MiddlewareParams) => Promise,
+ ) => Promise
+
+ // tested in getLogLevel.test.ts
+ export function getLogLevel(log: Array): LogLevel | undefined;
+
+ /**
+ * `PrismaClient` proxy available in interactive transactions.
+ */
+ export type TransactionClient = Omit
+
+ export type Datasource = {
+ url?: string
+ }
+
+ /**
+ * Count Types
+ */
+
+
+ /**
+ * Count Type UserCountOutputType
+ */
+
+
+ export type UserCountOutputType = {
+ contacts: number
+ }
+
+ export type UserCountOutputTypeSelect = {
+ contacts?: boolean | UserCountOutputTypeCountContactsArgs
+ }
+
+ // Custom InputTypes
+
+ /**
+ * UserCountOutputType without action
+ */
+ export type UserCountOutputTypeArgs = {
+ /**
+ * Select specific fields to fetch from the UserCountOutputType
+ */
+ select?: UserCountOutputTypeSelect | null
+ }
+
+
+ /**
+ * UserCountOutputType without action
+ */
+ export type UserCountOutputTypeCountContactsArgs = {
+ where?: ContactWhereInput
+ }
+
+
+
+ /**
+ * Models
+ */
+
+ /**
+ * Model User
+ */
+
+
+ export type AggregateUser = {
+ _count: UserCountAggregateOutputType | null
+ _avg: UserAvgAggregateOutputType | null
+ _sum: UserSumAggregateOutputType | null
+ _min: UserMinAggregateOutputType | null
+ _max: UserMaxAggregateOutputType | null
+ }
+
+ export type UserAvgAggregateOutputType = {
+ id: number | null
+ }
+
+ export type UserSumAggregateOutputType = {
+ id: number | null
+ }
+
+ export type UserMinAggregateOutputType = {
+ id: number | null
+ firstName: string | null
+ emailId: string | null
+ lastName: string | null
+ password: string | null
+ createdAt: Date | null
+ }
+
+ export type UserMaxAggregateOutputType = {
+ id: number | null
+ firstName: string | null
+ emailId: string | null
+ lastName: string | null
+ password: string | null
+ createdAt: Date | null
+ }
+
+ export type UserCountAggregateOutputType = {
+ id: number
+ firstName: number
+ emailId: number
+ lastName: number
+ password: number
+ createdAt: number
+ _all: number
+ }
+
+
+ export type UserAvgAggregateInputType = {
+ id?: true
+ }
+
+ export type UserSumAggregateInputType = {
+ id?: true
+ }
+
+ export type UserMinAggregateInputType = {
+ id?: true
+ firstName?: true
+ emailId?: true
+ lastName?: true
+ password?: true
+ createdAt?: true
+ }
+
+ export type UserMaxAggregateInputType = {
+ id?: true
+ firstName?: true
+ emailId?: true
+ lastName?: true
+ password?: true
+ createdAt?: true
+ }
+
+ export type UserCountAggregateInputType = {
+ id?: true
+ firstName?: true
+ emailId?: true
+ lastName?: true
+ password?: true
+ createdAt?: true
+ _all?: true
+ }
+
+ export type UserAggregateArgs = {
+ /**
+ * Filter which User to aggregate.
+ */
+ where?: UserWhereInput
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
+ *
+ * Determine the order of Users to fetch.
+ */
+ orderBy?: Enumerable
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
+ *
+ * Sets the start position
+ */
+ cursor?: UserWhereUniqueInput
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
+ *
+ * Take `±n` Users from the position of the cursor.
+ */
+ take?: number
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
+ *
+ * Skip the first `n` Users.
+ */
+ skip?: number
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
+ *
+ * Count returned Users
+ **/
+ _count?: true | UserCountAggregateInputType
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
+ *
+ * Select which fields to average
+ **/
+ _avg?: UserAvgAggregateInputType
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
+ *
+ * Select which fields to sum
+ **/
+ _sum?: UserSumAggregateInputType
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
+ *
+ * Select which fields to find the minimum value
+ **/
+ _min?: UserMinAggregateInputType
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
+ *
+ * Select which fields to find the maximum value
+ **/
+ _max?: UserMaxAggregateInputType
+ }
+
+ export type GetUserAggregateType = {
+ [P in keyof T & keyof AggregateUser]: P extends '_count' | 'count'
+ ? T[P] extends true
+ ? number
+ : GetScalarType
+ : GetScalarType
+ }
+
+
+
+
+ export type UserGroupByArgs = {
+ where?: UserWhereInput
+ orderBy?: Enumerable
+ by: UserScalarFieldEnum[]
+ having?: UserScalarWhereWithAggregatesInput
+ take?: number
+ skip?: number
+ _count?: UserCountAggregateInputType | true
+ _avg?: UserAvgAggregateInputType
+ _sum?: UserSumAggregateInputType
+ _min?: UserMinAggregateInputType
+ _max?: UserMaxAggregateInputType
+ }
+
+
+ export type UserGroupByOutputType = {
+ id: number
+ firstName: string
+ emailId: string
+ lastName: string
+ password: string
+ createdAt: Date
+ _count: UserCountAggregateOutputType | null
+ _avg: UserAvgAggregateOutputType | null
+ _sum: UserSumAggregateOutputType | null
+ _min: UserMinAggregateOutputType | null
+ _max: UserMaxAggregateOutputType | null
+ }
+
+ type GetUserGroupByPayload = Prisma.PrismaPromise<
+ Array<
+ PickArray &
+ {
+ [P in ((keyof T) & (keyof UserGroupByOutputType))]: P extends '_count'
+ ? T[P] extends boolean
+ ? number
+ : GetScalarType
+ : GetScalarType
+ }
+ >
+ >
+
+
+ export type UserSelect = $Extensions.GetSelect<{
+ id?: boolean
+ firstName?: boolean
+ emailId?: boolean
+ lastName?: boolean
+ password?: boolean
+ createdAt?: boolean
+ contacts?: boolean | User$contactsArgs
+ _count?: boolean | UserCountOutputTypeArgs
+ }, ExtArgs["result"]["user"]>
+
+ export type UserSelectScalar = {
+ id?: boolean
+ firstName?: boolean
+ emailId?: boolean
+ lastName?: boolean
+ password?: boolean
+ createdAt?: boolean
+ }
+
+ export type UserInclude = {
+ contacts?: boolean | User$contactsArgs
+ _count?: boolean | UserCountOutputTypeArgs
+ }
+
+
+ type UserGetPayload = $Types.GetResult
+
+ type UserCountArgs =
+ Omit & {
+ select?: UserCountAggregateInputType | true
+ }
+
+ export interface UserDelegate {
+ [K: symbol]: { types: Prisma.TypeMap['model']['User'], meta: { name: 'User' } }
+ /**
+ * Find zero or one User that matches the filter.
+ * @param {UserFindUniqueArgs} args - Arguments to find a User
+ * @example
+ * // Get one User
+ * const user = await prisma.user.findUnique({
+ * where: {
+ * // ... provide filter here
+ * }
+ * })
+ **/
+ findUnique, LocalRejectSettings = T["rejectOnNotFound"] extends RejectOnNotFound ? T['rejectOnNotFound'] : undefined>(
+ args: SelectSubset>
+ ): HasReject extends True ? Prisma__UserClient<$Types.GetResult, T, 'findUnique', never>, never, ExtArgs> : Prisma__UserClient<$Types.GetResult, T, 'findUnique', never> | null, null, ExtArgs>
+
+ /**
+ * Find one User that matches the filter or throw an error with `error.code='P2025'`
+ * if no matches were found.
+ * @param {UserFindUniqueOrThrowArgs} args - Arguments to find a User
+ * @example
+ * // Get one User
+ * const user = await prisma.user.findUniqueOrThrow({
+ * where: {
+ * // ... provide filter here
+ * }
+ * })
+ **/
+ findUniqueOrThrow>(
+ args?: SelectSubset>
+ ): Prisma__UserClient<$Types.GetResult, T, 'findUniqueOrThrow', never>, never, ExtArgs>
+
+ /**
+ * Find the first User that matches the filter.
+ * Note, that providing `undefined` is treated as the value not being there.
+ * Read more here: https://pris.ly/d/null-undefined
+ * @param {UserFindFirstArgs} args - Arguments to find a User
+ * @example
+ * // Get one User
+ * const user = await prisma.user.findFirst({
+ * where: {
+ * // ... provide filter here
+ * }
+ * })
+ **/
+ findFirst, LocalRejectSettings = T["rejectOnNotFound"] extends RejectOnNotFound ? T['rejectOnNotFound'] : undefined>(
+ args?: SelectSubset>
+ ): HasReject extends True ? Prisma__UserClient<$Types.GetResult, T, 'findFirst', never>, never, ExtArgs> : Prisma__UserClient<$Types.GetResult, T, 'findFirst', never> | null, null, ExtArgs>
+
+ /**
+ * Find the first User that matches the filter or
+ * throw `NotFoundError` if no matches were found.
+ * Note, that providing `undefined` is treated as the value not being there.
+ * Read more here: https://pris.ly/d/null-undefined
+ * @param {UserFindFirstOrThrowArgs} args - Arguments to find a User
+ * @example
+ * // Get one User
+ * const user = await prisma.user.findFirstOrThrow({
+ * where: {
+ * // ... provide filter here
+ * }
+ * })
+ **/
+ findFirstOrThrow>(
+ args?: SelectSubset>
+ ): Prisma__UserClient<$Types.GetResult, T, 'findFirstOrThrow', never>, never, ExtArgs>
+
+ /**
+ * Find zero or more Users that matches the filter.
+ * Note, that providing `undefined` is treated as the value not being there.
+ * Read more here: https://pris.ly/d/null-undefined
+ * @param {UserFindManyArgs=} args - Arguments to filter and select certain fields only.
+ * @example
+ * // Get all Users
+ * const users = await prisma.user.findMany()
+ *
+ * // Get first 10 Users
+ * const users = await prisma.user.findMany({ take: 10 })
+ *
+ * // Only select the `id`
+ * const userWithIdOnly = await prisma.user.findMany({ select: { id: true } })
+ *
+ **/
+ findMany