Files
portal/src/lib/generated/prisma/models/ApiKey.ts
T
NeilClack 55a29b9c1a feat: wire GHL webhook to Resend email templates
- Replace raw Resend text emails with sendMail using Resend templates
- automated-user-registration template: firstName, tempPassword,
  verifyUrl, loginUrl
- license-key-delivery template: firstName, license_key
- Remove requestPasswordReset call (temp password is the one-time
  credential; verification link handles email confirmation)
- Add .catch() to Better Auth email callbacks to prevent unhandled
  rejections from missing templates crashing the server
2026-07-08 15:01:08 -05:00

1345 lines
39 KiB
TypeScript

/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck
/*
* This file exports the `ApiKey` model and its related types.
*
* 🟢 You can import this file directly.
*/
import type * as runtime from '@prisma/client/runtime/client';
import type * as $Enums from '../enums.ts';
import type * as Prisma from '../internal/prismaNamespace.ts';
/**
* Model ApiKey
*
*/
export type ApiKeyModel = runtime.Types.Result.DefaultSelection<Prisma.$ApiKeyPayload>;
export type AggregateApiKey = {
_count: ApiKeyCountAggregateOutputType | null;
_min: ApiKeyMinAggregateOutputType | null;
_max: ApiKeyMaxAggregateOutputType | null;
};
export type ApiKeyMinAggregateOutputType = {
id: string | null;
keyPrefix: string | null;
keyHash: string | null;
createdAt: Date | null;
expiresAt: Date | null;
revokedAt: Date | null;
};
export type ApiKeyMaxAggregateOutputType = {
id: string | null;
keyPrefix: string | null;
keyHash: string | null;
createdAt: Date | null;
expiresAt: Date | null;
revokedAt: Date | null;
};
export type ApiKeyCountAggregateOutputType = {
id: number;
keyPrefix: number;
keyHash: number;
createdAt: number;
expiresAt: number;
revokedAt: number;
_all: number;
};
export type ApiKeyMinAggregateInputType = {
id?: true;
keyPrefix?: true;
keyHash?: true;
createdAt?: true;
expiresAt?: true;
revokedAt?: true;
};
export type ApiKeyMaxAggregateInputType = {
id?: true;
keyPrefix?: true;
keyHash?: true;
createdAt?: true;
expiresAt?: true;
revokedAt?: true;
};
export type ApiKeyCountAggregateInputType = {
id?: true;
keyPrefix?: true;
keyHash?: true;
createdAt?: true;
expiresAt?: true;
revokedAt?: true;
_all?: true;
};
export type ApiKeyAggregateArgs<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = {
/**
* Filter which ApiKey to aggregate.
*/
where?: Prisma.ApiKeyWhereInput;
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
*
* Determine the order of ApiKeys to fetch.
*/
orderBy?: Prisma.ApiKeyOrderByWithRelationInput | Prisma.ApiKeyOrderByWithRelationInput[];
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
*
* Sets the start position
*/
cursor?: Prisma.ApiKeyWhereUniqueInput;
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
*
* Take `±n` ApiKeys 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` ApiKeys.
*/
skip?: number;
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Count returned ApiKeys
**/
_count?: true | ApiKeyCountAggregateInputType;
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to find the minimum value
**/
_min?: ApiKeyMinAggregateInputType;
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to find the maximum value
**/
_max?: ApiKeyMaxAggregateInputType;
};
export type GetApiKeyAggregateType<T extends ApiKeyAggregateArgs> = {
[P in keyof T & keyof AggregateApiKey]: P extends '_count' | 'count'
? T[P] extends true
? number
: Prisma.GetScalarType<T[P], AggregateApiKey[P]>
: Prisma.GetScalarType<T[P], AggregateApiKey[P]>;
};
export type ApiKeyGroupByArgs<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = {
where?: Prisma.ApiKeyWhereInput;
orderBy?: Prisma.ApiKeyOrderByWithAggregationInput | Prisma.ApiKeyOrderByWithAggregationInput[];
by: Prisma.ApiKeyScalarFieldEnum[] | Prisma.ApiKeyScalarFieldEnum;
having?: Prisma.ApiKeyScalarWhereWithAggregatesInput;
take?: number;
skip?: number;
_count?: ApiKeyCountAggregateInputType | true;
_min?: ApiKeyMinAggregateInputType;
_max?: ApiKeyMaxAggregateInputType;
};
export type ApiKeyGroupByOutputType = {
id: string;
keyPrefix: string;
keyHash: string;
createdAt: Date;
expiresAt: Date | null;
revokedAt: Date | null;
_count: ApiKeyCountAggregateOutputType | null;
_min: ApiKeyMinAggregateOutputType | null;
_max: ApiKeyMaxAggregateOutputType | null;
};
export type GetApiKeyGroupByPayload<T extends ApiKeyGroupByArgs> = Prisma.PrismaPromise<
Array<
Prisma.PickEnumerable<ApiKeyGroupByOutputType, T['by']> & {
[P in keyof T & keyof ApiKeyGroupByOutputType]: P extends '_count'
? T[P] extends boolean
? number
: Prisma.GetScalarType<T[P], ApiKeyGroupByOutputType[P]>
: Prisma.GetScalarType<T[P], ApiKeyGroupByOutputType[P]>;
}
>
>;
export type ApiKeyWhereInput = {
AND?: Prisma.ApiKeyWhereInput | Prisma.ApiKeyWhereInput[];
OR?: Prisma.ApiKeyWhereInput[];
NOT?: Prisma.ApiKeyWhereInput | Prisma.ApiKeyWhereInput[];
id?: Prisma.StringFilter<'ApiKey'> | string;
keyPrefix?: Prisma.StringFilter<'ApiKey'> | string;
keyHash?: Prisma.StringFilter<'ApiKey'> | string;
createdAt?: Prisma.DateTimeFilter<'ApiKey'> | Date | string;
expiresAt?: Prisma.DateTimeNullableFilter<'ApiKey'> | Date | string | null;
revokedAt?: Prisma.DateTimeNullableFilter<'ApiKey'> | Date | string | null;
};
export type ApiKeyOrderByWithRelationInput = {
id?: Prisma.SortOrder;
keyPrefix?: Prisma.SortOrder;
keyHash?: Prisma.SortOrder;
createdAt?: Prisma.SortOrder;
expiresAt?: Prisma.SortOrderInput | Prisma.SortOrder;
revokedAt?: Prisma.SortOrderInput | Prisma.SortOrder;
};
export type ApiKeyWhereUniqueInput = Prisma.AtLeast<
{
id?: string;
keyHash?: string;
AND?: Prisma.ApiKeyWhereInput | Prisma.ApiKeyWhereInput[];
OR?: Prisma.ApiKeyWhereInput[];
NOT?: Prisma.ApiKeyWhereInput | Prisma.ApiKeyWhereInput[];
keyPrefix?: Prisma.StringFilter<'ApiKey'> | string;
createdAt?: Prisma.DateTimeFilter<'ApiKey'> | Date | string;
expiresAt?: Prisma.DateTimeNullableFilter<'ApiKey'> | Date | string | null;
revokedAt?: Prisma.DateTimeNullableFilter<'ApiKey'> | Date | string | null;
},
'id' | 'keyHash'
>;
export type ApiKeyOrderByWithAggregationInput = {
id?: Prisma.SortOrder;
keyPrefix?: Prisma.SortOrder;
keyHash?: Prisma.SortOrder;
createdAt?: Prisma.SortOrder;
expiresAt?: Prisma.SortOrderInput | Prisma.SortOrder;
revokedAt?: Prisma.SortOrderInput | Prisma.SortOrder;
_count?: Prisma.ApiKeyCountOrderByAggregateInput;
_max?: Prisma.ApiKeyMaxOrderByAggregateInput;
_min?: Prisma.ApiKeyMinOrderByAggregateInput;
};
export type ApiKeyScalarWhereWithAggregatesInput = {
AND?: Prisma.ApiKeyScalarWhereWithAggregatesInput | Prisma.ApiKeyScalarWhereWithAggregatesInput[];
OR?: Prisma.ApiKeyScalarWhereWithAggregatesInput[];
NOT?: Prisma.ApiKeyScalarWhereWithAggregatesInput | Prisma.ApiKeyScalarWhereWithAggregatesInput[];
id?: Prisma.StringWithAggregatesFilter<'ApiKey'> | string;
keyPrefix?: Prisma.StringWithAggregatesFilter<'ApiKey'> | string;
keyHash?: Prisma.StringWithAggregatesFilter<'ApiKey'> | string;
createdAt?: Prisma.DateTimeWithAggregatesFilter<'ApiKey'> | Date | string;
expiresAt?: Prisma.DateTimeNullableWithAggregatesFilter<'ApiKey'> | Date | string | null;
revokedAt?: Prisma.DateTimeNullableWithAggregatesFilter<'ApiKey'> | Date | string | null;
};
export type ApiKeyCreateInput = {
id?: string;
keyPrefix: string;
keyHash: string;
createdAt?: Date | string;
expiresAt?: Date | string | null;
revokedAt?: Date | string | null;
};
export type ApiKeyUncheckedCreateInput = {
id?: string;
keyPrefix: string;
keyHash: string;
createdAt?: Date | string;
expiresAt?: Date | string | null;
revokedAt?: Date | string | null;
};
export type ApiKeyUpdateInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string;
keyPrefix?: Prisma.StringFieldUpdateOperationsInput | string;
keyHash?: Prisma.StringFieldUpdateOperationsInput | string;
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
expiresAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
revokedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
};
export type ApiKeyUncheckedUpdateInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string;
keyPrefix?: Prisma.StringFieldUpdateOperationsInput | string;
keyHash?: Prisma.StringFieldUpdateOperationsInput | string;
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
expiresAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
revokedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
};
export type ApiKeyCreateManyInput = {
id?: string;
keyPrefix: string;
keyHash: string;
createdAt?: Date | string;
expiresAt?: Date | string | null;
revokedAt?: Date | string | null;
};
export type ApiKeyUpdateManyMutationInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string;
keyPrefix?: Prisma.StringFieldUpdateOperationsInput | string;
keyHash?: Prisma.StringFieldUpdateOperationsInput | string;
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
expiresAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
revokedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
};
export type ApiKeyUncheckedUpdateManyInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string;
keyPrefix?: Prisma.StringFieldUpdateOperationsInput | string;
keyHash?: Prisma.StringFieldUpdateOperationsInput | string;
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
expiresAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
revokedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
};
export type ApiKeyCountOrderByAggregateInput = {
id?: Prisma.SortOrder;
keyPrefix?: Prisma.SortOrder;
keyHash?: Prisma.SortOrder;
createdAt?: Prisma.SortOrder;
expiresAt?: Prisma.SortOrder;
revokedAt?: Prisma.SortOrder;
};
export type ApiKeyMaxOrderByAggregateInput = {
id?: Prisma.SortOrder;
keyPrefix?: Prisma.SortOrder;
keyHash?: Prisma.SortOrder;
createdAt?: Prisma.SortOrder;
expiresAt?: Prisma.SortOrder;
revokedAt?: Prisma.SortOrder;
};
export type ApiKeyMinOrderByAggregateInput = {
id?: Prisma.SortOrder;
keyPrefix?: Prisma.SortOrder;
keyHash?: Prisma.SortOrder;
createdAt?: Prisma.SortOrder;
expiresAt?: Prisma.SortOrder;
revokedAt?: Prisma.SortOrder;
};
export type ApiKeySelect<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = runtime.Types.Extensions.GetSelect<
{
id?: boolean;
keyPrefix?: boolean;
keyHash?: boolean;
createdAt?: boolean;
expiresAt?: boolean;
revokedAt?: boolean;
},
ExtArgs['result']['apiKey']
>;
export type ApiKeySelectCreateManyAndReturn<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = runtime.Types.Extensions.GetSelect<
{
id?: boolean;
keyPrefix?: boolean;
keyHash?: boolean;
createdAt?: boolean;
expiresAt?: boolean;
revokedAt?: boolean;
},
ExtArgs['result']['apiKey']
>;
export type ApiKeySelectUpdateManyAndReturn<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = runtime.Types.Extensions.GetSelect<
{
id?: boolean;
keyPrefix?: boolean;
keyHash?: boolean;
createdAt?: boolean;
expiresAt?: boolean;
revokedAt?: boolean;
},
ExtArgs['result']['apiKey']
>;
export type ApiKeySelectScalar = {
id?: boolean;
keyPrefix?: boolean;
keyHash?: boolean;
createdAt?: boolean;
expiresAt?: boolean;
revokedAt?: boolean;
};
export type ApiKeyOmit<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = runtime.Types.Extensions.GetOmit<
'id' | 'keyPrefix' | 'keyHash' | 'createdAt' | 'expiresAt' | 'revokedAt',
ExtArgs['result']['apiKey']
>;
export type $ApiKeyPayload<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = {
name: 'ApiKey';
objects: {};
scalars: runtime.Types.Extensions.GetPayloadResult<
{
id: string;
keyPrefix: string;
keyHash: string;
createdAt: Date;
expiresAt: Date | null;
revokedAt: Date | null;
},
ExtArgs['result']['apiKey']
>;
composites: {};
};
export type ApiKeyGetPayload<S extends boolean | null | undefined | ApiKeyDefaultArgs> =
runtime.Types.Result.GetResult<Prisma.$ApiKeyPayload, S>;
export type ApiKeyCountArgs<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = Omit<ApiKeyFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
select?: ApiKeyCountAggregateInputType | true;
};
export interface ApiKeyDelegate<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs,
GlobalOmitOptions = {}
> {
[K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['ApiKey']; meta: { name: 'ApiKey' } };
/**
* Find zero or one ApiKey that matches the filter.
* @param {ApiKeyFindUniqueArgs} args - Arguments to find a ApiKey
* @example
* // Get one ApiKey
* const apiKey = await prisma.apiKey.findUnique({
* where: {
* // ... provide filter here
* }
* })
*/
findUnique<T extends ApiKeyFindUniqueArgs>(
args: Prisma.SelectSubset<T, ApiKeyFindUniqueArgs<ExtArgs>>
): Prisma.Prisma__ApiKeyClient<
runtime.Types.Result.GetResult<
Prisma.$ApiKeyPayload<ExtArgs>,
T,
'findUnique',
GlobalOmitOptions
> | null,
null,
ExtArgs,
GlobalOmitOptions
>;
/**
* Find one ApiKey that matches the filter or throw an error with `error.code='P2025'`
* if no matches were found.
* @param {ApiKeyFindUniqueOrThrowArgs} args - Arguments to find a ApiKey
* @example
* // Get one ApiKey
* const apiKey = await prisma.apiKey.findUniqueOrThrow({
* where: {
* // ... provide filter here
* }
* })
*/
findUniqueOrThrow<T extends ApiKeyFindUniqueOrThrowArgs>(
args: Prisma.SelectSubset<T, ApiKeyFindUniqueOrThrowArgs<ExtArgs>>
): Prisma.Prisma__ApiKeyClient<
runtime.Types.Result.GetResult<
Prisma.$ApiKeyPayload<ExtArgs>,
T,
'findUniqueOrThrow',
GlobalOmitOptions
>,
never,
ExtArgs,
GlobalOmitOptions
>;
/**
* Find the first ApiKey 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 {ApiKeyFindFirstArgs} args - Arguments to find a ApiKey
* @example
* // Get one ApiKey
* const apiKey = await prisma.apiKey.findFirst({
* where: {
* // ... provide filter here
* }
* })
*/
findFirst<T extends ApiKeyFindFirstArgs>(
args?: Prisma.SelectSubset<T, ApiKeyFindFirstArgs<ExtArgs>>
): Prisma.Prisma__ApiKeyClient<
runtime.Types.Result.GetResult<
Prisma.$ApiKeyPayload<ExtArgs>,
T,
'findFirst',
GlobalOmitOptions
> | null,
null,
ExtArgs,
GlobalOmitOptions
>;
/**
* Find the first ApiKey that matches the filter or
* throw `PrismaKnownClientError` with `P2025` code 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 {ApiKeyFindFirstOrThrowArgs} args - Arguments to find a ApiKey
* @example
* // Get one ApiKey
* const apiKey = await prisma.apiKey.findFirstOrThrow({
* where: {
* // ... provide filter here
* }
* })
*/
findFirstOrThrow<T extends ApiKeyFindFirstOrThrowArgs>(
args?: Prisma.SelectSubset<T, ApiKeyFindFirstOrThrowArgs<ExtArgs>>
): Prisma.Prisma__ApiKeyClient<
runtime.Types.Result.GetResult<
Prisma.$ApiKeyPayload<ExtArgs>,
T,
'findFirstOrThrow',
GlobalOmitOptions
>,
never,
ExtArgs,
GlobalOmitOptions
>;
/**
* Find zero or more ApiKeys 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 {ApiKeyFindManyArgs} args - Arguments to filter and select certain fields only.
* @example
* // Get all ApiKeys
* const apiKeys = await prisma.apiKey.findMany()
*
* // Get first 10 ApiKeys
* const apiKeys = await prisma.apiKey.findMany({ take: 10 })
*
* // Only select the `id`
* const apiKeyWithIdOnly = await prisma.apiKey.findMany({ select: { id: true } })
*
*/
findMany<T extends ApiKeyFindManyArgs>(
args?: Prisma.SelectSubset<T, ApiKeyFindManyArgs<ExtArgs>>
): Prisma.PrismaPromise<
runtime.Types.Result.GetResult<Prisma.$ApiKeyPayload<ExtArgs>, T, 'findMany', GlobalOmitOptions>
>;
/**
* Create a ApiKey.
* @param {ApiKeyCreateArgs} args - Arguments to create a ApiKey.
* @example
* // Create one ApiKey
* const ApiKey = await prisma.apiKey.create({
* data: {
* // ... data to create a ApiKey
* }
* })
*
*/
create<T extends ApiKeyCreateArgs>(
args: Prisma.SelectSubset<T, ApiKeyCreateArgs<ExtArgs>>
): Prisma.Prisma__ApiKeyClient<
runtime.Types.Result.GetResult<Prisma.$ApiKeyPayload<ExtArgs>, T, 'create', GlobalOmitOptions>,
never,
ExtArgs,
GlobalOmitOptions
>;
/**
* Create many ApiKeys.
* @param {ApiKeyCreateManyArgs} args - Arguments to create many ApiKeys.
* @example
* // Create many ApiKeys
* const apiKey = await prisma.apiKey.createMany({
* data: [
* // ... provide data here
* ]
* })
*
*/
createMany<T extends ApiKeyCreateManyArgs>(
args?: Prisma.SelectSubset<T, ApiKeyCreateManyArgs<ExtArgs>>
): Prisma.PrismaPromise<Prisma.BatchPayload>;
/**
* Create many ApiKeys and returns the data saved in the database.
* @param {ApiKeyCreateManyAndReturnArgs} args - Arguments to create many ApiKeys.
* @example
* // Create many ApiKeys
* const apiKey = await prisma.apiKey.createManyAndReturn({
* data: [
* // ... provide data here
* ]
* })
*
* // Create many ApiKeys and only return the `id`
* const apiKeyWithIdOnly = await prisma.apiKey.createManyAndReturn({
* select: { id: true },
* data: [
* // ... provide data here
* ]
* })
* Note, that providing `undefined` is treated as the value not being there.
* Read more here: https://pris.ly/d/null-undefined
*
*/
createManyAndReturn<T extends ApiKeyCreateManyAndReturnArgs>(
args?: Prisma.SelectSubset<T, ApiKeyCreateManyAndReturnArgs<ExtArgs>>
): Prisma.PrismaPromise<
runtime.Types.Result.GetResult<
Prisma.$ApiKeyPayload<ExtArgs>,
T,
'createManyAndReturn',
GlobalOmitOptions
>
>;
/**
* Delete a ApiKey.
* @param {ApiKeyDeleteArgs} args - Arguments to delete one ApiKey.
* @example
* // Delete one ApiKey
* const ApiKey = await prisma.apiKey.delete({
* where: {
* // ... filter to delete one ApiKey
* }
* })
*
*/
delete<T extends ApiKeyDeleteArgs>(
args: Prisma.SelectSubset<T, ApiKeyDeleteArgs<ExtArgs>>
): Prisma.Prisma__ApiKeyClient<
runtime.Types.Result.GetResult<Prisma.$ApiKeyPayload<ExtArgs>, T, 'delete', GlobalOmitOptions>,
never,
ExtArgs,
GlobalOmitOptions
>;
/**
* Update one ApiKey.
* @param {ApiKeyUpdateArgs} args - Arguments to update one ApiKey.
* @example
* // Update one ApiKey
* const apiKey = await prisma.apiKey.update({
* where: {
* // ... provide filter here
* },
* data: {
* // ... provide data here
* }
* })
*
*/
update<T extends ApiKeyUpdateArgs>(
args: Prisma.SelectSubset<T, ApiKeyUpdateArgs<ExtArgs>>
): Prisma.Prisma__ApiKeyClient<
runtime.Types.Result.GetResult<Prisma.$ApiKeyPayload<ExtArgs>, T, 'update', GlobalOmitOptions>,
never,
ExtArgs,
GlobalOmitOptions
>;
/**
* Delete zero or more ApiKeys.
* @param {ApiKeyDeleteManyArgs} args - Arguments to filter ApiKeys to delete.
* @example
* // Delete a few ApiKeys
* const { count } = await prisma.apiKey.deleteMany({
* where: {
* // ... provide filter here
* }
* })
*
*/
deleteMany<T extends ApiKeyDeleteManyArgs>(
args?: Prisma.SelectSubset<T, ApiKeyDeleteManyArgs<ExtArgs>>
): Prisma.PrismaPromise<Prisma.BatchPayload>;
/**
* Update zero or more ApiKeys.
* Note, that providing `undefined` is treated as the value not being there.
* Read more here: https://pris.ly/d/null-undefined
* @param {ApiKeyUpdateManyArgs} args - Arguments to update one or more rows.
* @example
* // Update many ApiKeys
* const apiKey = await prisma.apiKey.updateMany({
* where: {
* // ... provide filter here
* },
* data: {
* // ... provide data here
* }
* })
*
*/
updateMany<T extends ApiKeyUpdateManyArgs>(
args: Prisma.SelectSubset<T, ApiKeyUpdateManyArgs<ExtArgs>>
): Prisma.PrismaPromise<Prisma.BatchPayload>;
/**
* Update zero or more ApiKeys and returns the data updated in the database.
* @param {ApiKeyUpdateManyAndReturnArgs} args - Arguments to update many ApiKeys.
* @example
* // Update many ApiKeys
* const apiKey = await prisma.apiKey.updateManyAndReturn({
* where: {
* // ... provide filter here
* },
* data: [
* // ... provide data here
* ]
* })
*
* // Update zero or more ApiKeys and only return the `id`
* const apiKeyWithIdOnly = await prisma.apiKey.updateManyAndReturn({
* select: { id: true },
* where: {
* // ... provide filter here
* },
* data: [
* // ... provide data here
* ]
* })
* Note, that providing `undefined` is treated as the value not being there.
* Read more here: https://pris.ly/d/null-undefined
*
*/
updateManyAndReturn<T extends ApiKeyUpdateManyAndReturnArgs>(
args: Prisma.SelectSubset<T, ApiKeyUpdateManyAndReturnArgs<ExtArgs>>
): Prisma.PrismaPromise<
runtime.Types.Result.GetResult<
Prisma.$ApiKeyPayload<ExtArgs>,
T,
'updateManyAndReturn',
GlobalOmitOptions
>
>;
/**
* Create or update one ApiKey.
* @param {ApiKeyUpsertArgs} args - Arguments to update or create a ApiKey.
* @example
* // Update or create a ApiKey
* const apiKey = await prisma.apiKey.upsert({
* create: {
* // ... data to create a ApiKey
* },
* update: {
* // ... in case it already exists, update
* },
* where: {
* // ... the filter for the ApiKey we want to update
* }
* })
*/
upsert<T extends ApiKeyUpsertArgs>(
args: Prisma.SelectSubset<T, ApiKeyUpsertArgs<ExtArgs>>
): Prisma.Prisma__ApiKeyClient<
runtime.Types.Result.GetResult<Prisma.$ApiKeyPayload<ExtArgs>, T, 'upsert', GlobalOmitOptions>,
never,
ExtArgs,
GlobalOmitOptions
>;
/**
* Count the number of ApiKeys.
* Note, that providing `undefined` is treated as the value not being there.
* Read more here: https://pris.ly/d/null-undefined
* @param {ApiKeyCountArgs} args - Arguments to filter ApiKeys to count.
* @example
* // Count the number of ApiKeys
* const count = await prisma.apiKey.count({
* where: {
* // ... the filter for the ApiKeys we want to count
* }
* })
**/
count<T extends ApiKeyCountArgs>(
args?: Prisma.Subset<T, ApiKeyCountArgs>
): Prisma.PrismaPromise<
T extends runtime.Types.Utils.Record<'select', any>
? T['select'] extends true
? number
: Prisma.GetScalarType<T['select'], ApiKeyCountAggregateOutputType>
: number
>;
/**
* Allows you to perform aggregations operations on a ApiKey.
* Note, that providing `undefined` is treated as the value not being there.
* Read more here: https://pris.ly/d/null-undefined
* @param {ApiKeyAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
* @example
* // Ordered by age ascending
* // Where email contains prisma.io
* // Limited to the 10 users
* const aggregations = await prisma.user.aggregate({
* _avg: {
* age: true,
* },
* where: {
* email: {
* contains: "prisma.io",
* },
* },
* orderBy: {
* age: "asc",
* },
* take: 10,
* })
**/
aggregate<T extends ApiKeyAggregateArgs>(
args: Prisma.Subset<T, ApiKeyAggregateArgs>
): Prisma.PrismaPromise<GetApiKeyAggregateType<T>>;
/**
* Group by ApiKey.
* Note, that providing `undefined` is treated as the value not being there.
* Read more here: https://pris.ly/d/null-undefined
* @param {ApiKeyGroupByArgs} args - Group by arguments.
* @example
* // Group by city, order by createdAt, get count
* const result = await prisma.user.groupBy({
* by: ['city', 'createdAt'],
* orderBy: {
* createdAt: true
* },
* _count: {
* _all: true
* },
* })
*
**/
groupBy<
T extends ApiKeyGroupByArgs,
HasSelectOrTake extends Prisma.Or<
Prisma.Extends<'skip', Prisma.Keys<T>>,
Prisma.Extends<'take', Prisma.Keys<T>>
>,
OrderByArg extends Prisma.True extends HasSelectOrTake
? { orderBy: ApiKeyGroupByArgs['orderBy'] }
: { orderBy?: ApiKeyGroupByArgs['orderBy'] },
OrderFields extends Prisma.ExcludeUnderscoreKeys<
Prisma.Keys<Prisma.MaybeTupleToUnion<T['orderBy']>>
>,
ByFields extends Prisma.MaybeTupleToUnion<T['by']>,
ByValid extends Prisma.Has<ByFields, OrderFields>,
HavingFields extends Prisma.GetHavingFields<T['having']>,
HavingValid extends Prisma.Has<ByFields, HavingFields>,
ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False,
InputErrors extends ByEmpty extends Prisma.True
? `Error: "by" must not be empty.`
: HavingValid extends Prisma.False
? {
[P in HavingFields]: P extends ByFields
? never
: P extends string
? `Error: Field "${P}" used in "having" needs to be provided in "by".`
: [Error, 'Field ', P, ` in "having" needs to be provided in "by"`];
}[HavingFields]
: 'take' extends Prisma.Keys<T>
? 'orderBy' extends Prisma.Keys<T>
? ByValid extends Prisma.True
? {}
: {
[P in OrderFields]: P extends ByFields
? never
: `Error: Field "${P}" in "orderBy" needs to be provided in "by"`;
}[OrderFields]
: 'Error: If you provide "take", you also need to provide "orderBy"'
: 'skip' extends Prisma.Keys<T>
? 'orderBy' extends Prisma.Keys<T>
? ByValid extends Prisma.True
? {}
: {
[P in OrderFields]: P extends ByFields
? never
: `Error: Field "${P}" in "orderBy" needs to be provided in "by"`;
}[OrderFields]
: 'Error: If you provide "skip", you also need to provide "orderBy"'
: ByValid extends Prisma.True
? {}
: {
[P in OrderFields]: P extends ByFields
? never
: `Error: Field "${P}" in "orderBy" needs to be provided in "by"`;
}[OrderFields]
>(
args: Prisma.SubsetIntersection<T, ApiKeyGroupByArgs, OrderByArg> & InputErrors
): {} extends InputErrors ? GetApiKeyGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>;
/**
* Fields of the ApiKey model
*/
readonly fields: ApiKeyFieldRefs;
}
/**
* The delegate class that acts as a "Promise-like" for ApiKey.
* Why is this prefixed with `Prisma__`?
* Because we want to prevent naming conflicts as mentioned in
* https://github.com/prisma/prisma-client-js/issues/707
*/
export interface Prisma__ApiKeyClient<
T,
Null = never,
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs,
GlobalOmitOptions = {}
> extends Prisma.PrismaPromise<T> {
readonly [Symbol.toStringTag]: 'PrismaPromise';
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<TResult1 = T, TResult2 = never>(
onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null,
onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null
): runtime.Types.Utils.JsPromise<TResult1 | TResult2>;
/**
* Attaches a callback for only the rejection of the Promise.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of the callback.
*/
catch<TResult = never>(
onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null
): runtime.Types.Utils.JsPromise<T | TResult>;
/**
* Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
* resolved value cannot be modified from the callback.
* @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
* @returns A Promise for the completion of the callback.
*/
finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise<T>;
}
/**
* Fields of the ApiKey model
*/
export interface ApiKeyFieldRefs {
readonly id: Prisma.FieldRef<'ApiKey', 'String'>;
readonly keyPrefix: Prisma.FieldRef<'ApiKey', 'String'>;
readonly keyHash: Prisma.FieldRef<'ApiKey', 'String'>;
readonly createdAt: Prisma.FieldRef<'ApiKey', 'DateTime'>;
readonly expiresAt: Prisma.FieldRef<'ApiKey', 'DateTime'>;
readonly revokedAt: Prisma.FieldRef<'ApiKey', 'DateTime'>;
}
// Custom InputTypes
/**
* ApiKey findUnique
*/
export type ApiKeyFindUniqueArgs<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = {
/**
* Select specific fields to fetch from the ApiKey
*/
select?: Prisma.ApiKeySelect<ExtArgs> | null;
/**
* Omit specific fields from the ApiKey
*/
omit?: Prisma.ApiKeyOmit<ExtArgs> | null;
/**
* Filter, which ApiKey to fetch.
*/
where: Prisma.ApiKeyWhereUniqueInput;
};
/**
* ApiKey findUniqueOrThrow
*/
export type ApiKeyFindUniqueOrThrowArgs<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = {
/**
* Select specific fields to fetch from the ApiKey
*/
select?: Prisma.ApiKeySelect<ExtArgs> | null;
/**
* Omit specific fields from the ApiKey
*/
omit?: Prisma.ApiKeyOmit<ExtArgs> | null;
/**
* Filter, which ApiKey to fetch.
*/
where: Prisma.ApiKeyWhereUniqueInput;
};
/**
* ApiKey findFirst
*/
export type ApiKeyFindFirstArgs<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = {
/**
* Select specific fields to fetch from the ApiKey
*/
select?: Prisma.ApiKeySelect<ExtArgs> | null;
/**
* Omit specific fields from the ApiKey
*/
omit?: Prisma.ApiKeyOmit<ExtArgs> | null;
/**
* Filter, which ApiKey to fetch.
*/
where?: Prisma.ApiKeyWhereInput;
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
*
* Determine the order of ApiKeys to fetch.
*/
orderBy?: Prisma.ApiKeyOrderByWithRelationInput | Prisma.ApiKeyOrderByWithRelationInput[];
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
*
* Sets the position for searching for ApiKeys.
*/
cursor?: Prisma.ApiKeyWhereUniqueInput;
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
*
* Take `±n` ApiKeys 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` ApiKeys.
*/
skip?: number;
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
*
* Filter by unique combinations of ApiKeys.
*/
distinct?: Prisma.ApiKeyScalarFieldEnum | Prisma.ApiKeyScalarFieldEnum[];
};
/**
* ApiKey findFirstOrThrow
*/
export type ApiKeyFindFirstOrThrowArgs<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = {
/**
* Select specific fields to fetch from the ApiKey
*/
select?: Prisma.ApiKeySelect<ExtArgs> | null;
/**
* Omit specific fields from the ApiKey
*/
omit?: Prisma.ApiKeyOmit<ExtArgs> | null;
/**
* Filter, which ApiKey to fetch.
*/
where?: Prisma.ApiKeyWhereInput;
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
*
* Determine the order of ApiKeys to fetch.
*/
orderBy?: Prisma.ApiKeyOrderByWithRelationInput | Prisma.ApiKeyOrderByWithRelationInput[];
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
*
* Sets the position for searching for ApiKeys.
*/
cursor?: Prisma.ApiKeyWhereUniqueInput;
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
*
* Take `±n` ApiKeys 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` ApiKeys.
*/
skip?: number;
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
*
* Filter by unique combinations of ApiKeys.
*/
distinct?: Prisma.ApiKeyScalarFieldEnum | Prisma.ApiKeyScalarFieldEnum[];
};
/**
* ApiKey findMany
*/
export type ApiKeyFindManyArgs<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = {
/**
* Select specific fields to fetch from the ApiKey
*/
select?: Prisma.ApiKeySelect<ExtArgs> | null;
/**
* Omit specific fields from the ApiKey
*/
omit?: Prisma.ApiKeyOmit<ExtArgs> | null;
/**
* Filter, which ApiKeys to fetch.
*/
where?: Prisma.ApiKeyWhereInput;
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
*
* Determine the order of ApiKeys to fetch.
*/
orderBy?: Prisma.ApiKeyOrderByWithRelationInput | Prisma.ApiKeyOrderByWithRelationInput[];
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
*
* Sets the position for listing ApiKeys.
*/
cursor?: Prisma.ApiKeyWhereUniqueInput;
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
*
* Take `±n` ApiKeys 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` ApiKeys.
*/
skip?: number;
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
*
* Filter by unique combinations of ApiKeys.
*/
distinct?: Prisma.ApiKeyScalarFieldEnum | Prisma.ApiKeyScalarFieldEnum[];
};
/**
* ApiKey create
*/
export type ApiKeyCreateArgs<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = {
/**
* Select specific fields to fetch from the ApiKey
*/
select?: Prisma.ApiKeySelect<ExtArgs> | null;
/**
* Omit specific fields from the ApiKey
*/
omit?: Prisma.ApiKeyOmit<ExtArgs> | null;
/**
* The data needed to create a ApiKey.
*/
data: Prisma.XOR<Prisma.ApiKeyCreateInput, Prisma.ApiKeyUncheckedCreateInput>;
};
/**
* ApiKey createMany
*/
export type ApiKeyCreateManyArgs<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = {
/**
* The data used to create many ApiKeys.
*/
data: Prisma.ApiKeyCreateManyInput | Prisma.ApiKeyCreateManyInput[];
skipDuplicates?: boolean;
};
/**
* ApiKey createManyAndReturn
*/
export type ApiKeyCreateManyAndReturnArgs<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = {
/**
* Select specific fields to fetch from the ApiKey
*/
select?: Prisma.ApiKeySelectCreateManyAndReturn<ExtArgs> | null;
/**
* Omit specific fields from the ApiKey
*/
omit?: Prisma.ApiKeyOmit<ExtArgs> | null;
/**
* The data used to create many ApiKeys.
*/
data: Prisma.ApiKeyCreateManyInput | Prisma.ApiKeyCreateManyInput[];
skipDuplicates?: boolean;
};
/**
* ApiKey update
*/
export type ApiKeyUpdateArgs<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = {
/**
* Select specific fields to fetch from the ApiKey
*/
select?: Prisma.ApiKeySelect<ExtArgs> | null;
/**
* Omit specific fields from the ApiKey
*/
omit?: Prisma.ApiKeyOmit<ExtArgs> | null;
/**
* The data needed to update a ApiKey.
*/
data: Prisma.XOR<Prisma.ApiKeyUpdateInput, Prisma.ApiKeyUncheckedUpdateInput>;
/**
* Choose, which ApiKey to update.
*/
where: Prisma.ApiKeyWhereUniqueInput;
};
/**
* ApiKey updateMany
*/
export type ApiKeyUpdateManyArgs<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = {
/**
* The data used to update ApiKeys.
*/
data: Prisma.XOR<Prisma.ApiKeyUpdateManyMutationInput, Prisma.ApiKeyUncheckedUpdateManyInput>;
/**
* Filter which ApiKeys to update
*/
where?: Prisma.ApiKeyWhereInput;
/**
* Limit how many ApiKeys to update.
*/
limit?: number;
};
/**
* ApiKey updateManyAndReturn
*/
export type ApiKeyUpdateManyAndReturnArgs<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = {
/**
* Select specific fields to fetch from the ApiKey
*/
select?: Prisma.ApiKeySelectUpdateManyAndReturn<ExtArgs> | null;
/**
* Omit specific fields from the ApiKey
*/
omit?: Prisma.ApiKeyOmit<ExtArgs> | null;
/**
* The data used to update ApiKeys.
*/
data: Prisma.XOR<Prisma.ApiKeyUpdateManyMutationInput, Prisma.ApiKeyUncheckedUpdateManyInput>;
/**
* Filter which ApiKeys to update
*/
where?: Prisma.ApiKeyWhereInput;
/**
* Limit how many ApiKeys to update.
*/
limit?: number;
};
/**
* ApiKey upsert
*/
export type ApiKeyUpsertArgs<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = {
/**
* Select specific fields to fetch from the ApiKey
*/
select?: Prisma.ApiKeySelect<ExtArgs> | null;
/**
* Omit specific fields from the ApiKey
*/
omit?: Prisma.ApiKeyOmit<ExtArgs> | null;
/**
* The filter to search for the ApiKey to update in case it exists.
*/
where: Prisma.ApiKeyWhereUniqueInput;
/**
* In case the ApiKey found by the `where` argument doesn't exist, create a new ApiKey with this data.
*/
create: Prisma.XOR<Prisma.ApiKeyCreateInput, Prisma.ApiKeyUncheckedCreateInput>;
/**
* In case the ApiKey was found with the provided `where` argument, update it with this data.
*/
update: Prisma.XOR<Prisma.ApiKeyUpdateInput, Prisma.ApiKeyUncheckedUpdateInput>;
};
/**
* ApiKey delete
*/
export type ApiKeyDeleteArgs<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = {
/**
* Select specific fields to fetch from the ApiKey
*/
select?: Prisma.ApiKeySelect<ExtArgs> | null;
/**
* Omit specific fields from the ApiKey
*/
omit?: Prisma.ApiKeyOmit<ExtArgs> | null;
/**
* Filter which ApiKey to delete.
*/
where: Prisma.ApiKeyWhereUniqueInput;
};
/**
* ApiKey deleteMany
*/
export type ApiKeyDeleteManyArgs<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = {
/**
* Filter which ApiKeys to delete
*/
where?: Prisma.ApiKeyWhereInput;
/**
* Limit how many ApiKeys to delete.
*/
limit?: number;
};
/**
* ApiKey without action
*/
export type ApiKeyDefaultArgs<
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> = {
/**
* Select specific fields to fetch from the ApiKey
*/
select?: Prisma.ApiKeySelect<ExtArgs> | null;
/**
* Omit specific fields from the ApiKey
*/
omit?: Prisma.ApiKeyOmit<ExtArgs> | null;
};