From d7afb7b11cacdc529d578ff77f117e7d55963ee7 Mon Sep 17 00:00:00 2001 From: ymc9 <104139426+ymc9@users.noreply.github.com> Date: Thu, 25 Apr 2024 00:01:58 +0800 Subject: [PATCH] update to v2 --- components/Todo.tsx | 4 +- lib/hooks/__model_meta.ts | 776 +++++----- lib/hooks/account.ts | 724 +++------ lib/hooks/list.ts | 708 +++------ lib/hooks/space-user.ts | 740 +++------ lib/hooks/space.ts | 716 +++------ lib/hooks/todo.ts | 708 +++------ lib/hooks/user.ts | 708 +++------ package-lock.json | 2034 ++++--------------------- package.json | 12 +- pages/space/[slug]/[listId]/index.tsx | 5 +- pages/space/[slug]/index.tsx | 4 +- prisma/schema.prisma | 153 +- schema.zmodel | 110 +- 14 files changed, 1928 insertions(+), 5474 deletions(-) diff --git a/components/Todo.tsx b/components/Todo.tsx index d5327e6..1d56aa0 100644 --- a/components/Todo.tsx +++ b/components/Todo.tsx @@ -11,8 +11,8 @@ type Props = { }; export default function TodoComponent({ value, optimistic }: Props) { - const { mutate: updateTodo } = useUpdateTodo(undefined, true, true); // optimistic - const { mutate: deleteTodo } = useDeleteTodo(undefined, true, true); // optimistic + const { mutate: updateTodo } = useUpdateTodo({ optimisticUpdate: true }); + const { mutate: deleteTodo } = useDeleteTodo({ optimisticUpdate: true }); const onDelete = () => { deleteTodo({ where: { id: value.id } }); diff --git a/lib/hooks/__model_meta.ts b/lib/hooks/__model_meta.ts index 0ffe615..0568d46 100644 --- a/lib/hooks/__model_meta.ts +++ b/lib/hooks/__model_meta.ts @@ -1,410 +1,394 @@ /* eslint-disable */ const metadata = { - fields: { + models: { space: { - id: { - name: 'id', - type: 'String', - isId: true, - attributes: [{ name: '@default', args: [] }], - }, - createdAt: { - name: 'createdAt', - type: 'DateTime', - attributes: [{ name: '@default', args: [] }], - }, - updatedAt: { - name: 'updatedAt', - type: 'DateTime', - attributes: [{ name: '@updatedAt', args: [] }], - }, - name: { - name: 'name', - type: 'String', - }, - slug: { - name: 'slug', - type: 'String', - }, - members: { - name: 'members', - type: 'SpaceUser', - isDataModel: true, - isArray: true, - backLink: 'space', - }, - lists: { - name: 'lists', - type: 'List', - isDataModel: true, - isArray: true, - backLink: 'space', - }, - }, + name: 'Space', fields: { + id: { + name: "id", + type: "String", + isId: true, + attributes: [{ "name": "@default", "args": [] }], + }, createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ "name": "@default", "args": [] }], + }, updatedAt: { + name: "updatedAt", + type: "DateTime", + attributes: [{ "name": "@updatedAt", "args": [] }], + }, name: { + name: "name", + type: "String", + }, slug: { + name: "slug", + type: "String", + }, members: { + name: "members", + type: "SpaceUser", + isDataModel: true, + isArray: true, + backLink: 'space', + }, lists: { + name: "lists", + type: "List", + isDataModel: true, + isArray: true, + backLink: 'space', + }, + } + , uniqueConstraints: { + id: { + name: "id", + fields: ["id"] + }, slug: { + name: "slug", + fields: ["slug"] + }, + } + , + } + , spaceUser: { - id: { - name: 'id', - type: 'String', - isId: true, - attributes: [{ name: '@default', args: [] }], - }, - createdAt: { - name: 'createdAt', - type: 'DateTime', - attributes: [{ name: '@default', args: [] }], - }, - updatedAt: { - name: 'updatedAt', - type: 'DateTime', - attributes: [{ name: '@updatedAt', args: [] }], - }, - space: { - name: 'space', - type: 'Space', - isDataModel: true, - backLink: 'members', - isRelationOwner: true, - foreignKeyMapping: { id: 'spaceId' }, - }, - spaceId: { - name: 'spaceId', - type: 'String', - isForeignKey: true, - }, - user: { - name: 'user', - type: 'User', - isDataModel: true, - backLink: 'spaces', - isRelationOwner: true, - foreignKeyMapping: { id: 'userId' }, - }, - userId: { - name: 'userId', - type: 'String', - isForeignKey: true, - }, - role: { - name: 'role', - type: 'SpaceUserRole', - }, - }, + name: 'SpaceUser', fields: { + id: { + name: "id", + type: "String", + isId: true, + attributes: [{ "name": "@default", "args": [] }], + }, createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ "name": "@default", "args": [] }], + }, updatedAt: { + name: "updatedAt", + type: "DateTime", + attributes: [{ "name": "@updatedAt", "args": [] }], + }, space: { + name: "space", + type: "Space", + isDataModel: true, + backLink: 'members', + isRelationOwner: true, + foreignKeyMapping: { "id": "spaceId" }, + }, spaceId: { + name: "spaceId", + type: "String", + isForeignKey: true, + relationField: 'space', + }, user: { + name: "user", + type: "User", + isDataModel: true, + backLink: 'spaces', + isRelationOwner: true, + foreignKeyMapping: { "id": "userId" }, + }, userId: { + name: "userId", + type: "String", + isForeignKey: true, + relationField: 'user', + }, role: { + name: "role", + type: "SpaceUserRole", + }, + } + , uniqueConstraints: { + id: { + name: "id", + fields: ["id"] + }, userId_spaceId: { + name: "userId_spaceId", + fields: ["userId", "spaceId"] + }, + } + , + } + , user: { - id: { - name: 'id', - type: 'String', - isId: true, - attributes: [{ name: '@default', args: [] }], - }, - createdAt: { - name: 'createdAt', - type: 'DateTime', - attributes: [{ name: '@default', args: [] }], - }, - updatedAt: { - name: 'updatedAt', - type: 'DateTime', - attributes: [{ name: '@updatedAt', args: [] }], - }, - email: { - name: 'email', - type: 'String', - }, - emailVerified: { - name: 'emailVerified', - type: 'DateTime', - isOptional: true, - }, - password: { - name: 'password', - type: 'String', - isOptional: true, - }, - name: { - name: 'name', - type: 'String', - isOptional: true, - }, - spaces: { - name: 'spaces', - type: 'SpaceUser', - isDataModel: true, - isArray: true, - backLink: 'user', - }, - image: { - name: 'image', - type: 'String', - isOptional: true, - }, - lists: { - name: 'lists', - type: 'List', - isDataModel: true, - isArray: true, - backLink: 'owner', - }, - todos: { - name: 'todos', - type: 'Todo', - isDataModel: true, - isArray: true, - backLink: 'owner', - }, - accounts: { - name: 'accounts', - type: 'Account', - isDataModel: true, - isArray: true, - backLink: 'user', - }, - }, + name: 'User', fields: { + id: { + name: "id", + type: "String", + isId: true, + attributes: [{ "name": "@default", "args": [] }], + }, createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ "name": "@default", "args": [] }], + }, updatedAt: { + name: "updatedAt", + type: "DateTime", + attributes: [{ "name": "@updatedAt", "args": [] }], + }, email: { + name: "email", + type: "String", + }, emailVerified: { + name: "emailVerified", + type: "DateTime", + isOptional: true, + }, password: { + name: "password", + type: "String", + isOptional: true, + }, name: { + name: "name", + type: "String", + isOptional: true, + }, spaces: { + name: "spaces", + type: "SpaceUser", + isDataModel: true, + isArray: true, + backLink: 'user', + }, image: { + name: "image", + type: "String", + isOptional: true, + }, lists: { + name: "lists", + type: "List", + isDataModel: true, + isArray: true, + backLink: 'owner', + }, todos: { + name: "todos", + type: "Todo", + isDataModel: true, + isArray: true, + backLink: 'owner', + }, accounts: { + name: "accounts", + type: "Account", + isDataModel: true, + isArray: true, + backLink: 'user', + }, + } + , uniqueConstraints: { + id: { + name: "id", + fields: ["id"] + }, email: { + name: "email", + fields: ["email"] + }, + } + , + } + , list: { - id: { - name: 'id', - type: 'String', - isId: true, - attributes: [{ name: '@default', args: [] }], - }, - createdAt: { - name: 'createdAt', - type: 'DateTime', - attributes: [{ name: '@default', args: [] }], - }, - updatedAt: { - name: 'updatedAt', - type: 'DateTime', - attributes: [{ name: '@updatedAt', args: [] }], - }, - space: { - name: 'space', - type: 'Space', - isDataModel: true, - backLink: 'lists', - isRelationOwner: true, - foreignKeyMapping: { id: 'spaceId' }, - }, - spaceId: { - name: 'spaceId', - type: 'String', - isForeignKey: true, - }, - owner: { - name: 'owner', - type: 'User', - isDataModel: true, - backLink: 'lists', - isRelationOwner: true, - foreignKeyMapping: { id: 'ownerId' }, - }, - ownerId: { - name: 'ownerId', - type: 'String', - isForeignKey: true, - }, - title: { - name: 'title', - type: 'String', - }, - private: { - name: 'private', - type: 'Boolean', - attributes: [{ name: '@default', args: [{ value: false }] }], - }, - todos: { - name: 'todos', - type: 'Todo', - isDataModel: true, - isArray: true, - backLink: 'list', - }, - }, + name: 'List', fields: { + id: { + name: "id", + type: "String", + isId: true, + attributes: [{ "name": "@default", "args": [] }], + }, createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ "name": "@default", "args": [] }], + }, updatedAt: { + name: "updatedAt", + type: "DateTime", + attributes: [{ "name": "@updatedAt", "args": [] }], + }, space: { + name: "space", + type: "Space", + isDataModel: true, + backLink: 'lists', + isRelationOwner: true, + foreignKeyMapping: { "id": "spaceId" }, + }, spaceId: { + name: "spaceId", + type: "String", + isForeignKey: true, + relationField: 'space', + }, owner: { + name: "owner", + type: "User", + isDataModel: true, + backLink: 'lists', + isRelationOwner: true, + foreignKeyMapping: { "id": "ownerId" }, + }, ownerId: { + name: "ownerId", + type: "String", + attributes: [{ "name": "@default", "args": [] }], + isForeignKey: true, + relationField: 'owner', + defaultValueProvider: $default$List$ownerId, + }, title: { + name: "title", + type: "String", + }, private: { + name: "private", + type: "Boolean", + attributes: [{ "name": "@default", "args": [{ "value": false }] }], + }, todos: { + name: "todos", + type: "Todo", + isDataModel: true, + isArray: true, + backLink: 'list', + }, + } + , uniqueConstraints: { + id: { + name: "id", + fields: ["id"] + }, + } + , + } + , todo: { - id: { - name: 'id', - type: 'String', - isId: true, - attributes: [{ name: '@default', args: [] }], - }, - createdAt: { - name: 'createdAt', - type: 'DateTime', - attributes: [{ name: '@default', args: [] }], - }, - updatedAt: { - name: 'updatedAt', - type: 'DateTime', - attributes: [{ name: '@updatedAt', args: [] }], - }, - owner: { - name: 'owner', - type: 'User', - isDataModel: true, - backLink: 'todos', - isRelationOwner: true, - foreignKeyMapping: { id: 'ownerId' }, - }, - ownerId: { - name: 'ownerId', - type: 'String', - isForeignKey: true, - }, - list: { - name: 'list', - type: 'List', - isDataModel: true, - backLink: 'todos', - isRelationOwner: true, - foreignKeyMapping: { id: 'listId' }, - }, - listId: { - name: 'listId', - type: 'String', - isForeignKey: true, - }, - title: { - name: 'title', - type: 'String', - }, - completedAt: { - name: 'completedAt', - type: 'DateTime', - isOptional: true, - }, - }, + name: 'Todo', fields: { + id: { + name: "id", + type: "String", + isId: true, + attributes: [{ "name": "@default", "args": [] }], + }, createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ "name": "@default", "args": [] }], + }, updatedAt: { + name: "updatedAt", + type: "DateTime", + attributes: [{ "name": "@updatedAt", "args": [] }], + }, owner: { + name: "owner", + type: "User", + isDataModel: true, + backLink: 'todos', + isRelationOwner: true, + foreignKeyMapping: { "id": "ownerId" }, + }, ownerId: { + name: "ownerId", + type: "String", + attributes: [{ "name": "@default", "args": [] }], + isForeignKey: true, + relationField: 'owner', + defaultValueProvider: $default$Todo$ownerId, + }, list: { + name: "list", + type: "List", + isDataModel: true, + backLink: 'todos', + isRelationOwner: true, + foreignKeyMapping: { "id": "listId" }, + }, listId: { + name: "listId", + type: "String", + isForeignKey: true, + relationField: 'list', + }, title: { + name: "title", + type: "String", + }, completedAt: { + name: "completedAt", + type: "DateTime", + isOptional: true, + }, + } + , uniqueConstraints: { + id: { + name: "id", + fields: ["id"] + }, + } + , + } + , account: { - id: { - name: 'id', - type: 'String', - isId: true, - attributes: [{ name: '@default', args: [] }], - }, - userId: { - name: 'userId', - type: 'String', - isForeignKey: true, - }, - type: { - name: 'type', - type: 'String', - }, - provider: { - name: 'provider', - type: 'String', - }, - providerAccountId: { - name: 'providerAccountId', - type: 'String', - }, - refresh_token: { - name: 'refresh_token', - type: 'String', - isOptional: true, - }, - refresh_token_expires_in: { - name: 'refresh_token_expires_in', - type: 'Int', - isOptional: true, - }, - access_token: { - name: 'access_token', - type: 'String', - isOptional: true, - }, - expires_at: { - name: 'expires_at', - type: 'Int', - isOptional: true, - }, - token_type: { - name: 'token_type', - type: 'String', - isOptional: true, - }, - scope: { - name: 'scope', - type: 'String', - isOptional: true, - }, - id_token: { - name: 'id_token', - type: 'String', - isOptional: true, - }, - session_state: { - name: 'session_state', - type: 'String', - isOptional: true, - }, - user: { - name: 'user', - type: 'User', - isDataModel: true, - backLink: 'accounts', - isRelationOwner: true, - foreignKeyMapping: { id: 'userId' }, - }, - }, - }, - uniqueConstraints: { - space: { - id: { - name: 'id', - fields: ['id'], - }, - slug: { - name: 'slug', - fields: ['slug'], - }, - }, - spaceUser: { - id: { - name: 'id', - fields: ['id'], - }, - userId_spaceId: { - name: 'userId_spaceId', - fields: ['userId', 'spaceId'], - }, - }, - user: { - id: { - name: 'id', - fields: ['id'], - }, - email: { - name: 'email', - fields: ['email'], - }, - }, - list: { - id: { - name: 'id', - fields: ['id'], - }, - }, - todo: { - id: { - name: 'id', - fields: ['id'], - }, - }, - account: { - id: { - name: 'id', - fields: ['id'], - }, - provider_providerAccountId: { - name: 'provider_providerAccountId', - fields: ['provider', 'providerAccountId'], - }, - }, - }, + name: 'Account', fields: { + id: { + name: "id", + type: "String", + isId: true, + attributes: [{ "name": "@default", "args": [] }], + }, userId: { + name: "userId", + type: "String", + isForeignKey: true, + relationField: 'user', + }, type: { + name: "type", + type: "String", + }, provider: { + name: "provider", + type: "String", + }, providerAccountId: { + name: "providerAccountId", + type: "String", + }, refresh_token: { + name: "refresh_token", + type: "String", + isOptional: true, + }, refresh_token_expires_in: { + name: "refresh_token_expires_in", + type: "Int", + isOptional: true, + }, access_token: { + name: "access_token", + type: "String", + isOptional: true, + }, expires_at: { + name: "expires_at", + type: "Int", + isOptional: true, + }, token_type: { + name: "token_type", + type: "String", + isOptional: true, + }, scope: { + name: "scope", + type: "String", + isOptional: true, + }, id_token: { + name: "id_token", + type: "String", + isOptional: true, + }, session_state: { + name: "session_state", + type: "String", + isOptional: true, + }, user: { + name: "user", + type: "User", + isDataModel: true, + backLink: 'accounts', + isRelationOwner: true, + foreignKeyMapping: { "id": "userId" }, + }, + } + , uniqueConstraints: { + id: { + name: "id", + fields: ["id"] + }, provider_providerAccountId: { + name: "provider_providerAccountId", + fields: ["provider", "providerAccountId"] + }, + } + , + } + , + } + , deleteCascade: { space: ['SpaceUser', 'List'], user: ['SpaceUser', 'List', 'Todo', 'Account'], list: ['Todo'], - }, - authModel: 'User', + } + , + authModel: 'User' }; +function $default$List$ownerId(user: any): unknown { + return user?.id; +} + +function $default$Todo$ownerId(user: any): unknown { + return user?.id; +} export default metadata; diff --git a/lib/hooks/account.ts b/lib/hooks/account.ts index 812bebb..ca5f321 100644 --- a/lib/hooks/account.ts +++ b/lib/hooks/account.ts @@ -1,666 +1,322 @@ /* eslint-disable */ -import type { Prisma, Account } from '@prisma/client'; +import type { Prisma, Account } from ".zenstack/models"; import type { UseMutationOptions, UseQueryOptions, UseInfiniteQueryOptions, InfiniteData } from '@tanstack/react-query'; import { getHooksContext } from '@zenstackhq/tanstack-query/runtime-v5/react'; import { useModelQuery, useInfiniteModelQuery, useModelMutation } from '@zenstackhq/tanstack-query/runtime-v5/react'; -import type { PickEnumerable, CheckSelect, QueryError } from '@zenstackhq/tanstack-query/runtime-v5'; +import type { PickEnumerable, CheckSelect, QueryError, ExtraQueryOptions, ExtraMutationOptions } from '@zenstackhq/tanstack-query/runtime-v5'; import metadata from './__model_meta'; type DefaultError = QueryError; import { useSuspenseModelQuery, useSuspenseInfiniteModelQuery } from '@zenstackhq/tanstack-query/runtime-v5/react'; import type { UseSuspenseQueryOptions, UseSuspenseInfiniteQueryOptions } from '@tanstack/react-query'; -export function useCreateAccount( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useCreateAccount(options?: Omit<(UseMutationOptions<(Account | undefined), DefaultError, Prisma.AccountCreateArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Account', - 'POST', - `${endpoint}/account/create`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Account', 'POST', `${endpoint}/account/create`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useCreateManyAccount( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useCreateManyAccount(options?: Omit<(UseMutationOptions & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Account', - 'POST', - `${endpoint}/account/createMany`, - metadata, - options, - fetch, - invalidateQueries, - false, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Account', 'POST', `${endpoint}/account/createMany`, metadata, options, fetch, false) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - Prisma.BatchPayload, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as Prisma.BatchPayload; + return (await _mutation.mutateAsync( + args, + options as any + )) as Prisma.BatchPayload; }, }; return mutation; } -export function useFindManyAccount< - TArgs extends Prisma.AccountFindManyArgs, - TQueryFnData = Array & { $optimistic?: boolean }>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useFindManyAccount & { $optimistic?: boolean }>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'Account', - `${endpoint}/account/findMany`, - args, - options, - fetch, - optimisticUpdate, - ); + return useModelQuery('Account', `${endpoint}/account/findMany`, args, options, fetch); } -export function useInfiniteFindManyAccount< - TArgs extends Prisma.AccountFindManyArgs, - TQueryFnData = Array>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit>, 'queryKey'>, -) { +export function useInfiniteFindManyAccount>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: Omit>, 'queryKey'>) { options = options ?? { initialPageParam: undefined, getNextPageParam: () => null }; const { endpoint, fetch } = getHooksContext(); - return useInfiniteModelQuery( - 'Account', - `${endpoint}/account/findMany`, - args, - options, - fetch, - ); + return useInfiniteModelQuery('Account', `${endpoint}/account/findMany`, args, options, fetch); } -export function useSuspenseFindManyAccount< - TArgs extends Prisma.AccountFindManyArgs, - TQueryFnData = Array & { $optimistic?: boolean }>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useSuspenseFindManyAccount & { $optimistic?: boolean }>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'Account', - `${endpoint}/account/findMany`, - args, - options, - fetch, - optimisticUpdate, - ); + return useSuspenseModelQuery('Account', `${endpoint}/account/findMany`, args, options, fetch); } -export function useSuspenseInfiniteFindManyAccount< - TArgs extends Prisma.AccountFindManyArgs, - TQueryFnData = Array>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit>, 'queryKey'>, -) { +export function useSuspenseInfiniteFindManyAccount>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: Omit>, 'queryKey'>) { options = options ?? { initialPageParam: undefined, getNextPageParam: () => null }; const { endpoint, fetch } = getHooksContext(); - return useSuspenseInfiniteModelQuery( - 'Account', - `${endpoint}/account/findMany`, - args, - options, - fetch, - ); + return useSuspenseInfiniteModelQuery('Account', `${endpoint}/account/findMany`, args, options, fetch); } -export function useFindUniqueAccount< - TArgs extends Prisma.AccountFindUniqueArgs, - TQueryFnData = Prisma.AccountGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useFindUniqueAccount & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'Account', - `${endpoint}/account/findUnique`, - args, - options, - fetch, - optimisticUpdate, - ); + return useModelQuery('Account', `${endpoint}/account/findUnique`, args, options, fetch); } -export function useSuspenseFindUniqueAccount< - TArgs extends Prisma.AccountFindUniqueArgs, - TQueryFnData = Prisma.AccountGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useSuspenseFindUniqueAccount & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'Account', - `${endpoint}/account/findUnique`, - args, - options, - fetch, - optimisticUpdate, - ); + return useSuspenseModelQuery('Account', `${endpoint}/account/findUnique`, args, options, fetch); } -export function useFindFirstAccount< - TArgs extends Prisma.AccountFindFirstArgs, - TQueryFnData = Prisma.AccountGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useFindFirstAccount & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'Account', - `${endpoint}/account/findFirst`, - args, - options, - fetch, - optimisticUpdate, - ); + return useModelQuery('Account', `${endpoint}/account/findFirst`, args, options, fetch); } -export function useSuspenseFindFirstAccount< - TArgs extends Prisma.AccountFindFirstArgs, - TQueryFnData = Prisma.AccountGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useSuspenseFindFirstAccount & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'Account', - `${endpoint}/account/findFirst`, - args, - options, - fetch, - optimisticUpdate, - ); + return useSuspenseModelQuery('Account', `${endpoint}/account/findFirst`, args, options, fetch); } -export function useUpdateAccount( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useUpdateAccount(options?: Omit<(UseMutationOptions<(Account | undefined), DefaultError, Prisma.AccountUpdateArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Account', - 'PUT', - `${endpoint}/account/update`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Account', 'PUT', `${endpoint}/account/update`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useUpdateManyAccount( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useUpdateManyAccount(options?: Omit<(UseMutationOptions & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Account', - 'PUT', - `${endpoint}/account/updateMany`, - metadata, - options, - fetch, - invalidateQueries, - false, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Account', 'PUT', `${endpoint}/account/updateMany`, metadata, options, fetch, false) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - Prisma.BatchPayload, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as Prisma.BatchPayload; + return (await _mutation.mutateAsync( + args, + options as any + )) as Prisma.BatchPayload; }, }; return mutation; } -export function useUpsertAccount( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useUpsertAccount(options?: Omit<(UseMutationOptions<(Account | undefined), DefaultError, Prisma.AccountUpsertArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Account', - 'POST', - `${endpoint}/account/upsert`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Account', 'POST', `${endpoint}/account/upsert`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useDeleteAccount( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useDeleteAccount(options?: Omit<(UseMutationOptions<(Account | undefined), DefaultError, Prisma.AccountDeleteArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Account', - 'DELETE', - `${endpoint}/account/delete`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Account', 'DELETE', `${endpoint}/account/delete`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useDeleteManyAccount( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useDeleteManyAccount(options?: Omit<(UseMutationOptions & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Account', - 'DELETE', - `${endpoint}/account/deleteMany`, - metadata, - options, - fetch, - invalidateQueries, - false, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Account', 'DELETE', `${endpoint}/account/deleteMany`, metadata, options, fetch, false) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - Prisma.BatchPayload, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as Prisma.BatchPayload; + return (await _mutation.mutateAsync( + args, + options as any + )) as Prisma.BatchPayload; }, }; return mutation; } -export function useAggregateAccount< - TArgs extends Prisma.AccountAggregateArgs, - TQueryFnData = Prisma.GetAccountAggregateType, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useAggregateAccount, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useModelQuery('Account', `${endpoint}/account/aggregate`, args, options, fetch); } -export function useSuspenseAggregateAccount< - TArgs extends Prisma.AccountAggregateArgs, - TQueryFnData = Prisma.GetAccountAggregateType, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useSuspenseAggregateAccount, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'Account', - `${endpoint}/account/aggregate`, - args, - options, - fetch, - ); + return useSuspenseModelQuery('Account', `${endpoint}/account/aggregate`, args, options, fetch); } -export function useGroupByAccount< - TArgs extends Prisma.AccountGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: Prisma.AccountGroupByArgs['orderBy'] } - : { orderBy?: Prisma.AccountGroupByArgs['orderBy'] }, - OrderFields extends Prisma.ExcludeUnderscoreKeys>>, - ByFields extends Prisma.MaybeTupleToUnion, - ByValid extends Prisma.Has, - HavingFields extends Prisma.GetHavingFields, - HavingValid extends Prisma.Has, - ByEmpty extends TArgs['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 - ? 'orderBy' extends Prisma.Keys - ? 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 - ? 'orderBy' extends Prisma.Keys - ? 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], - TQueryFnData = {} extends InputErrors - ? Array< - PickEnumerable & { - [P in keyof TArgs & keyof Prisma.AccountGroupByOutputType]: P extends '_count' - ? TArgs[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType; - } - > - : InputErrors, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset< - TArgs, - Prisma.SubsetIntersection & InputErrors - >, - options?: Omit, 'queryKey'>, -) { +export function useGroupByAccount>, Prisma.Extends<'take', Prisma.Keys>>, OrderByArg extends Prisma.True extends HasSelectOrTake ? { orderBy: Prisma.AccountGroupByArgs['orderBy'] } : { orderBy?: Prisma.AccountGroupByArgs['orderBy'] }, OrderFields extends Prisma.ExcludeUnderscoreKeys>>, ByFields extends Prisma.MaybeTupleToUnion, ByValid extends Prisma.Has, HavingFields extends Prisma.GetHavingFields, HavingValid extends Prisma.Has, ByEmpty extends TArgs['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 + ? 'orderBy' extends Prisma.Keys + ? 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 + ? 'orderBy' extends Prisma.Keys + ? 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], TQueryFnData = {} extends InputErrors ? + Array & + { + [P in ((keyof TArgs) & (keyof Prisma.AccountGroupByOutputType))]: P extends '_count' + ? TArgs[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > : InputErrors, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset & InputErrors>, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useModelQuery('Account', `${endpoint}/account/groupBy`, args, options, fetch); } -export function useSuspenseGroupByAccount< - TArgs extends Prisma.AccountGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: Prisma.AccountGroupByArgs['orderBy'] } - : { orderBy?: Prisma.AccountGroupByArgs['orderBy'] }, - OrderFields extends Prisma.ExcludeUnderscoreKeys>>, - ByFields extends Prisma.MaybeTupleToUnion, - ByValid extends Prisma.Has, - HavingFields extends Prisma.GetHavingFields, - HavingValid extends Prisma.Has, - ByEmpty extends TArgs['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 - ? 'orderBy' extends Prisma.Keys - ? 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 - ? 'orderBy' extends Prisma.Keys - ? 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], - TQueryFnData = {} extends InputErrors - ? Array< - PickEnumerable & { - [P in keyof TArgs & keyof Prisma.AccountGroupByOutputType]: P extends '_count' - ? TArgs[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType; - } - > - : InputErrors, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset< - TArgs, - Prisma.SubsetIntersection & InputErrors - >, - options?: Omit, 'queryKey'>, -) { +export function useSuspenseGroupByAccount>, Prisma.Extends<'take', Prisma.Keys>>, OrderByArg extends Prisma.True extends HasSelectOrTake ? { orderBy: Prisma.AccountGroupByArgs['orderBy'] } : { orderBy?: Prisma.AccountGroupByArgs['orderBy'] }, OrderFields extends Prisma.ExcludeUnderscoreKeys>>, ByFields extends Prisma.MaybeTupleToUnion, ByValid extends Prisma.Has, HavingFields extends Prisma.GetHavingFields, HavingValid extends Prisma.Has, ByEmpty extends TArgs['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 + ? 'orderBy' extends Prisma.Keys + ? 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 + ? 'orderBy' extends Prisma.Keys + ? 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], TQueryFnData = {} extends InputErrors ? + Array & + { + [P in ((keyof TArgs) & (keyof Prisma.AccountGroupByOutputType))]: P extends '_count' + ? TArgs[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > : InputErrors, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset & InputErrors>, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'Account', - `${endpoint}/account/groupBy`, - args, - options, - fetch, - ); + return useSuspenseModelQuery('Account', `${endpoint}/account/groupBy`, args, options, fetch); } -export function useCountAccount< - TArgs extends Prisma.AccountCountArgs, - TQueryFnData = TArgs extends { select: any } - ? TArgs['select'] extends true - ? number - : Prisma.GetScalarType - : number, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useCountAccount : number, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useModelQuery('Account', `${endpoint}/account/count`, args, options, fetch); } -export function useSuspenseCountAccount< - TArgs extends Prisma.AccountCountArgs, - TQueryFnData = TArgs extends { select: any } - ? TArgs['select'] extends true - ? number - : Prisma.GetScalarType - : number, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useSuspenseCountAccount : number, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'Account', - `${endpoint}/account/count`, - args, - options, - fetch, - ); + return useSuspenseModelQuery('Account', `${endpoint}/account/count`, args, options, fetch); } diff --git a/lib/hooks/list.ts b/lib/hooks/list.ts index bb5cbf7..f31094f 100644 --- a/lib/hooks/list.ts +++ b/lib/hooks/list.ts @@ -1,654 +1,322 @@ /* eslint-disable */ -import type { Prisma, List } from '@prisma/client'; +import type { Prisma, List } from ".zenstack/models"; import type { UseMutationOptions, UseQueryOptions, UseInfiniteQueryOptions, InfiniteData } from '@tanstack/react-query'; import { getHooksContext } from '@zenstackhq/tanstack-query/runtime-v5/react'; import { useModelQuery, useInfiniteModelQuery, useModelMutation } from '@zenstackhq/tanstack-query/runtime-v5/react'; -import type { PickEnumerable, CheckSelect, QueryError } from '@zenstackhq/tanstack-query/runtime-v5'; +import type { PickEnumerable, CheckSelect, QueryError, ExtraQueryOptions, ExtraMutationOptions } from '@zenstackhq/tanstack-query/runtime-v5'; import metadata from './__model_meta'; type DefaultError = QueryError; import { useSuspenseModelQuery, useSuspenseInfiniteModelQuery } from '@zenstackhq/tanstack-query/runtime-v5/react'; import type { UseSuspenseQueryOptions, UseSuspenseInfiniteQueryOptions } from '@tanstack/react-query'; -export function useCreateList( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useCreateList(options?: Omit<(UseMutationOptions<(List | undefined), DefaultError, Prisma.ListCreateArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'List', - 'POST', - `${endpoint}/list/create`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('List', 'POST', `${endpoint}/list/create`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useCreateManyList( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useCreateManyList(options?: Omit<(UseMutationOptions & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'List', - 'POST', - `${endpoint}/list/createMany`, - metadata, - options, - fetch, - invalidateQueries, - false, - optimisticUpdate, - ); + const _mutation = + useModelMutation('List', 'POST', `${endpoint}/list/createMany`, metadata, options, fetch, false) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - Prisma.BatchPayload, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as Prisma.BatchPayload; + return (await _mutation.mutateAsync( + args, + options as any + )) as Prisma.BatchPayload; }, }; return mutation; } -export function useFindManyList< - TArgs extends Prisma.ListFindManyArgs, - TQueryFnData = Array & { $optimistic?: boolean }>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useFindManyList & { $optimistic?: boolean }>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'List', - `${endpoint}/list/findMany`, - args, - options, - fetch, - optimisticUpdate, - ); + return useModelQuery('List', `${endpoint}/list/findMany`, args, options, fetch); } -export function useInfiniteFindManyList< - TArgs extends Prisma.ListFindManyArgs, - TQueryFnData = Array>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit>, 'queryKey'>, -) { +export function useInfiniteFindManyList>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: Omit>, 'queryKey'>) { options = options ?? { initialPageParam: undefined, getNextPageParam: () => null }; const { endpoint, fetch } = getHooksContext(); - return useInfiniteModelQuery( - 'List', - `${endpoint}/list/findMany`, - args, - options, - fetch, - ); + return useInfiniteModelQuery('List', `${endpoint}/list/findMany`, args, options, fetch); } -export function useSuspenseFindManyList< - TArgs extends Prisma.ListFindManyArgs, - TQueryFnData = Array & { $optimistic?: boolean }>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useSuspenseFindManyList & { $optimistic?: boolean }>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'List', - `${endpoint}/list/findMany`, - args, - options, - fetch, - optimisticUpdate, - ); + return useSuspenseModelQuery('List', `${endpoint}/list/findMany`, args, options, fetch); } -export function useSuspenseInfiniteFindManyList< - TArgs extends Prisma.ListFindManyArgs, - TQueryFnData = Array>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit>, 'queryKey'>, -) { +export function useSuspenseInfiniteFindManyList>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: Omit>, 'queryKey'>) { options = options ?? { initialPageParam: undefined, getNextPageParam: () => null }; const { endpoint, fetch } = getHooksContext(); - return useSuspenseInfiniteModelQuery( - 'List', - `${endpoint}/list/findMany`, - args, - options, - fetch, - ); + return useSuspenseInfiniteModelQuery('List', `${endpoint}/list/findMany`, args, options, fetch); } -export function useFindUniqueList< - TArgs extends Prisma.ListFindUniqueArgs, - TQueryFnData = Prisma.ListGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useFindUniqueList & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'List', - `${endpoint}/list/findUnique`, - args, - options, - fetch, - optimisticUpdate, - ); + return useModelQuery('List', `${endpoint}/list/findUnique`, args, options, fetch); } -export function useSuspenseFindUniqueList< - TArgs extends Prisma.ListFindUniqueArgs, - TQueryFnData = Prisma.ListGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useSuspenseFindUniqueList & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'List', - `${endpoint}/list/findUnique`, - args, - options, - fetch, - optimisticUpdate, - ); + return useSuspenseModelQuery('List', `${endpoint}/list/findUnique`, args, options, fetch); } -export function useFindFirstList< - TArgs extends Prisma.ListFindFirstArgs, - TQueryFnData = Prisma.ListGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useFindFirstList & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'List', - `${endpoint}/list/findFirst`, - args, - options, - fetch, - optimisticUpdate, - ); + return useModelQuery('List', `${endpoint}/list/findFirst`, args, options, fetch); } -export function useSuspenseFindFirstList< - TArgs extends Prisma.ListFindFirstArgs, - TQueryFnData = Prisma.ListGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useSuspenseFindFirstList & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'List', - `${endpoint}/list/findFirst`, - args, - options, - fetch, - optimisticUpdate, - ); + return useSuspenseModelQuery('List', `${endpoint}/list/findFirst`, args, options, fetch); } -export function useUpdateList( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useUpdateList(options?: Omit<(UseMutationOptions<(List | undefined), DefaultError, Prisma.ListUpdateArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'List', - 'PUT', - `${endpoint}/list/update`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('List', 'PUT', `${endpoint}/list/update`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useUpdateManyList( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useUpdateManyList(options?: Omit<(UseMutationOptions & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'List', - 'PUT', - `${endpoint}/list/updateMany`, - metadata, - options, - fetch, - invalidateQueries, - false, - optimisticUpdate, - ); + const _mutation = + useModelMutation('List', 'PUT', `${endpoint}/list/updateMany`, metadata, options, fetch, false) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - Prisma.BatchPayload, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as Prisma.BatchPayload; + return (await _mutation.mutateAsync( + args, + options as any + )) as Prisma.BatchPayload; }, }; return mutation; } -export function useUpsertList( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useUpsertList(options?: Omit<(UseMutationOptions<(List | undefined), DefaultError, Prisma.ListUpsertArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'List', - 'POST', - `${endpoint}/list/upsert`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('List', 'POST', `${endpoint}/list/upsert`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useDeleteList( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useDeleteList(options?: Omit<(UseMutationOptions<(List | undefined), DefaultError, Prisma.ListDeleteArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'List', - 'DELETE', - `${endpoint}/list/delete`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('List', 'DELETE', `${endpoint}/list/delete`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useDeleteManyList( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useDeleteManyList(options?: Omit<(UseMutationOptions & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'List', - 'DELETE', - `${endpoint}/list/deleteMany`, - metadata, - options, - fetch, - invalidateQueries, - false, - optimisticUpdate, - ); + const _mutation = + useModelMutation('List', 'DELETE', `${endpoint}/list/deleteMany`, metadata, options, fetch, false) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - Prisma.BatchPayload, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as Prisma.BatchPayload; + return (await _mutation.mutateAsync( + args, + options as any + )) as Prisma.BatchPayload; }, }; return mutation; } -export function useAggregateList< - TArgs extends Prisma.ListAggregateArgs, - TQueryFnData = Prisma.GetListAggregateType, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useAggregateList, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useModelQuery('List', `${endpoint}/list/aggregate`, args, options, fetch); } -export function useSuspenseAggregateList< - TArgs extends Prisma.ListAggregateArgs, - TQueryFnData = Prisma.GetListAggregateType, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useSuspenseAggregateList, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'List', - `${endpoint}/list/aggregate`, - args, - options, - fetch, - ); + return useSuspenseModelQuery('List', `${endpoint}/list/aggregate`, args, options, fetch); } -export function useGroupByList< - TArgs extends Prisma.ListGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: Prisma.ListGroupByArgs['orderBy'] } - : { orderBy?: Prisma.ListGroupByArgs['orderBy'] }, - OrderFields extends Prisma.ExcludeUnderscoreKeys>>, - ByFields extends Prisma.MaybeTupleToUnion, - ByValid extends Prisma.Has, - HavingFields extends Prisma.GetHavingFields, - HavingValid extends Prisma.Has, - ByEmpty extends TArgs['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 - ? 'orderBy' extends Prisma.Keys - ? 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 - ? 'orderBy' extends Prisma.Keys - ? 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], - TQueryFnData = {} extends InputErrors - ? Array< - PickEnumerable & { - [P in keyof TArgs & keyof Prisma.ListGroupByOutputType]: P extends '_count' - ? TArgs[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType; - } - > - : InputErrors, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset< - TArgs, - Prisma.SubsetIntersection & InputErrors - >, - options?: Omit, 'queryKey'>, -) { +export function useGroupByList>, Prisma.Extends<'take', Prisma.Keys>>, OrderByArg extends Prisma.True extends HasSelectOrTake ? { orderBy: Prisma.ListGroupByArgs['orderBy'] } : { orderBy?: Prisma.ListGroupByArgs['orderBy'] }, OrderFields extends Prisma.ExcludeUnderscoreKeys>>, ByFields extends Prisma.MaybeTupleToUnion, ByValid extends Prisma.Has, HavingFields extends Prisma.GetHavingFields, HavingValid extends Prisma.Has, ByEmpty extends TArgs['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 + ? 'orderBy' extends Prisma.Keys + ? 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 + ? 'orderBy' extends Prisma.Keys + ? 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], TQueryFnData = {} extends InputErrors ? + Array & + { + [P in ((keyof TArgs) & (keyof Prisma.ListGroupByOutputType))]: P extends '_count' + ? TArgs[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > : InputErrors, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset & InputErrors>, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useModelQuery('List', `${endpoint}/list/groupBy`, args, options, fetch); } -export function useSuspenseGroupByList< - TArgs extends Prisma.ListGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: Prisma.ListGroupByArgs['orderBy'] } - : { orderBy?: Prisma.ListGroupByArgs['orderBy'] }, - OrderFields extends Prisma.ExcludeUnderscoreKeys>>, - ByFields extends Prisma.MaybeTupleToUnion, - ByValid extends Prisma.Has, - HavingFields extends Prisma.GetHavingFields, - HavingValid extends Prisma.Has, - ByEmpty extends TArgs['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 - ? 'orderBy' extends Prisma.Keys - ? 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 - ? 'orderBy' extends Prisma.Keys - ? 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], - TQueryFnData = {} extends InputErrors - ? Array< - PickEnumerable & { - [P in keyof TArgs & keyof Prisma.ListGroupByOutputType]: P extends '_count' - ? TArgs[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType; - } - > - : InputErrors, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset< - TArgs, - Prisma.SubsetIntersection & InputErrors - >, - options?: Omit, 'queryKey'>, -) { +export function useSuspenseGroupByList>, Prisma.Extends<'take', Prisma.Keys>>, OrderByArg extends Prisma.True extends HasSelectOrTake ? { orderBy: Prisma.ListGroupByArgs['orderBy'] } : { orderBy?: Prisma.ListGroupByArgs['orderBy'] }, OrderFields extends Prisma.ExcludeUnderscoreKeys>>, ByFields extends Prisma.MaybeTupleToUnion, ByValid extends Prisma.Has, HavingFields extends Prisma.GetHavingFields, HavingValid extends Prisma.Has, ByEmpty extends TArgs['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 + ? 'orderBy' extends Prisma.Keys + ? 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 + ? 'orderBy' extends Prisma.Keys + ? 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], TQueryFnData = {} extends InputErrors ? + Array & + { + [P in ((keyof TArgs) & (keyof Prisma.ListGroupByOutputType))]: P extends '_count' + ? TArgs[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > : InputErrors, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset & InputErrors>, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useSuspenseModelQuery('List', `${endpoint}/list/groupBy`, args, options, fetch); } -export function useCountList< - TArgs extends Prisma.ListCountArgs, - TQueryFnData = TArgs extends { select: any } - ? TArgs['select'] extends true - ? number - : Prisma.GetScalarType - : number, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useCountList : number, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useModelQuery('List', `${endpoint}/list/count`, args, options, fetch); } -export function useSuspenseCountList< - TArgs extends Prisma.ListCountArgs, - TQueryFnData = TArgs extends { select: any } - ? TArgs['select'] extends true - ? number - : Prisma.GetScalarType - : number, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useSuspenseCountList : number, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useSuspenseModelQuery('List', `${endpoint}/list/count`, args, options, fetch); } diff --git a/lib/hooks/space-user.ts b/lib/hooks/space-user.ts index dc5170d..24787bd 100644 --- a/lib/hooks/space-user.ts +++ b/lib/hooks/space-user.ts @@ -1,678 +1,322 @@ /* eslint-disable */ -import type { Prisma, SpaceUser } from '@prisma/client'; +import type { Prisma, SpaceUser } from ".zenstack/models"; import type { UseMutationOptions, UseQueryOptions, UseInfiniteQueryOptions, InfiniteData } from '@tanstack/react-query'; import { getHooksContext } from '@zenstackhq/tanstack-query/runtime-v5/react'; import { useModelQuery, useInfiniteModelQuery, useModelMutation } from '@zenstackhq/tanstack-query/runtime-v5/react'; -import type { PickEnumerable, CheckSelect, QueryError } from '@zenstackhq/tanstack-query/runtime-v5'; +import type { PickEnumerable, CheckSelect, QueryError, ExtraQueryOptions, ExtraMutationOptions } from '@zenstackhq/tanstack-query/runtime-v5'; import metadata from './__model_meta'; type DefaultError = QueryError; import { useSuspenseModelQuery, useSuspenseInfiniteModelQuery } from '@zenstackhq/tanstack-query/runtime-v5/react'; import type { UseSuspenseQueryOptions, UseSuspenseInfiniteQueryOptions } from '@tanstack/react-query'; -export function useCreateSpaceUser( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useCreateSpaceUser(options?: Omit<(UseMutationOptions<(SpaceUser | undefined), DefaultError, Prisma.SpaceUserCreateArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'SpaceUser', - 'POST', - `${endpoint}/spaceUser/create`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('SpaceUser', 'POST', `${endpoint}/spaceUser/create`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useCreateManySpaceUser( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useCreateManySpaceUser(options?: Omit<(UseMutationOptions & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'SpaceUser', - 'POST', - `${endpoint}/spaceUser/createMany`, - metadata, - options, - fetch, - invalidateQueries, - false, - optimisticUpdate, - ); + const _mutation = + useModelMutation('SpaceUser', 'POST', `${endpoint}/spaceUser/createMany`, metadata, options, fetch, false) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - Prisma.BatchPayload, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as Prisma.BatchPayload; + return (await _mutation.mutateAsync( + args, + options as any + )) as Prisma.BatchPayload; }, }; return mutation; } -export function useFindManySpaceUser< - TArgs extends Prisma.SpaceUserFindManyArgs, - TQueryFnData = Array & { $optimistic?: boolean }>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useFindManySpaceUser & { $optimistic?: boolean }>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'SpaceUser', - `${endpoint}/spaceUser/findMany`, - args, - options, - fetch, - optimisticUpdate, - ); + return useModelQuery('SpaceUser', `${endpoint}/spaceUser/findMany`, args, options, fetch); } -export function useInfiniteFindManySpaceUser< - TArgs extends Prisma.SpaceUserFindManyArgs, - TQueryFnData = Array>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit>, 'queryKey'>, -) { +export function useInfiniteFindManySpaceUser>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: Omit>, 'queryKey'>) { options = options ?? { initialPageParam: undefined, getNextPageParam: () => null }; const { endpoint, fetch } = getHooksContext(); - return useInfiniteModelQuery( - 'SpaceUser', - `${endpoint}/spaceUser/findMany`, - args, - options, - fetch, - ); + return useInfiniteModelQuery('SpaceUser', `${endpoint}/spaceUser/findMany`, args, options, fetch); } -export function useSuspenseFindManySpaceUser< - TArgs extends Prisma.SpaceUserFindManyArgs, - TQueryFnData = Array & { $optimistic?: boolean }>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useSuspenseFindManySpaceUser & { $optimistic?: boolean }>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'SpaceUser', - `${endpoint}/spaceUser/findMany`, - args, - options, - fetch, - optimisticUpdate, - ); + return useSuspenseModelQuery('SpaceUser', `${endpoint}/spaceUser/findMany`, args, options, fetch); } -export function useSuspenseInfiniteFindManySpaceUser< - TArgs extends Prisma.SpaceUserFindManyArgs, - TQueryFnData = Array>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit>, 'queryKey'>, -) { +export function useSuspenseInfiniteFindManySpaceUser>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: Omit>, 'queryKey'>) { options = options ?? { initialPageParam: undefined, getNextPageParam: () => null }; const { endpoint, fetch } = getHooksContext(); - return useSuspenseInfiniteModelQuery( - 'SpaceUser', - `${endpoint}/spaceUser/findMany`, - args, - options, - fetch, - ); + return useSuspenseInfiniteModelQuery('SpaceUser', `${endpoint}/spaceUser/findMany`, args, options, fetch); } -export function useFindUniqueSpaceUser< - TArgs extends Prisma.SpaceUserFindUniqueArgs, - TQueryFnData = Prisma.SpaceUserGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useFindUniqueSpaceUser & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'SpaceUser', - `${endpoint}/spaceUser/findUnique`, - args, - options, - fetch, - optimisticUpdate, - ); + return useModelQuery('SpaceUser', `${endpoint}/spaceUser/findUnique`, args, options, fetch); } -export function useSuspenseFindUniqueSpaceUser< - TArgs extends Prisma.SpaceUserFindUniqueArgs, - TQueryFnData = Prisma.SpaceUserGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useSuspenseFindUniqueSpaceUser & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'SpaceUser', - `${endpoint}/spaceUser/findUnique`, - args, - options, - fetch, - optimisticUpdate, - ); + return useSuspenseModelQuery('SpaceUser', `${endpoint}/spaceUser/findUnique`, args, options, fetch); } -export function useFindFirstSpaceUser< - TArgs extends Prisma.SpaceUserFindFirstArgs, - TQueryFnData = Prisma.SpaceUserGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useFindFirstSpaceUser & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'SpaceUser', - `${endpoint}/spaceUser/findFirst`, - args, - options, - fetch, - optimisticUpdate, - ); + return useModelQuery('SpaceUser', `${endpoint}/spaceUser/findFirst`, args, options, fetch); } -export function useSuspenseFindFirstSpaceUser< - TArgs extends Prisma.SpaceUserFindFirstArgs, - TQueryFnData = Prisma.SpaceUserGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useSuspenseFindFirstSpaceUser & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'SpaceUser', - `${endpoint}/spaceUser/findFirst`, - args, - options, - fetch, - optimisticUpdate, - ); + return useSuspenseModelQuery('SpaceUser', `${endpoint}/spaceUser/findFirst`, args, options, fetch); } -export function useUpdateSpaceUser( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useUpdateSpaceUser(options?: Omit<(UseMutationOptions<(SpaceUser | undefined), DefaultError, Prisma.SpaceUserUpdateArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'SpaceUser', - 'PUT', - `${endpoint}/spaceUser/update`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('SpaceUser', 'PUT', `${endpoint}/spaceUser/update`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useUpdateManySpaceUser( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useUpdateManySpaceUser(options?: Omit<(UseMutationOptions & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'SpaceUser', - 'PUT', - `${endpoint}/spaceUser/updateMany`, - metadata, - options, - fetch, - invalidateQueries, - false, - optimisticUpdate, - ); + const _mutation = + useModelMutation('SpaceUser', 'PUT', `${endpoint}/spaceUser/updateMany`, metadata, options, fetch, false) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - Prisma.BatchPayload, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as Prisma.BatchPayload; + return (await _mutation.mutateAsync( + args, + options as any + )) as Prisma.BatchPayload; }, }; return mutation; } -export function useUpsertSpaceUser( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useUpsertSpaceUser(options?: Omit<(UseMutationOptions<(SpaceUser | undefined), DefaultError, Prisma.SpaceUserUpsertArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'SpaceUser', - 'POST', - `${endpoint}/spaceUser/upsert`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('SpaceUser', 'POST', `${endpoint}/spaceUser/upsert`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useDeleteSpaceUser( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useDeleteSpaceUser(options?: Omit<(UseMutationOptions<(SpaceUser | undefined), DefaultError, Prisma.SpaceUserDeleteArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'SpaceUser', - 'DELETE', - `${endpoint}/spaceUser/delete`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('SpaceUser', 'DELETE', `${endpoint}/spaceUser/delete`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useDeleteManySpaceUser( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useDeleteManySpaceUser(options?: Omit<(UseMutationOptions & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'SpaceUser', - 'DELETE', - `${endpoint}/spaceUser/deleteMany`, - metadata, - options, - fetch, - invalidateQueries, - false, - optimisticUpdate, - ); + const _mutation = + useModelMutation('SpaceUser', 'DELETE', `${endpoint}/spaceUser/deleteMany`, metadata, options, fetch, false) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - Prisma.BatchPayload, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as Prisma.BatchPayload; + return (await _mutation.mutateAsync( + args, + options as any + )) as Prisma.BatchPayload; }, }; return mutation; } -export function useAggregateSpaceUser< - TArgs extends Prisma.SpaceUserAggregateArgs, - TQueryFnData = Prisma.GetSpaceUserAggregateType, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useAggregateSpaceUser, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'SpaceUser', - `${endpoint}/spaceUser/aggregate`, - args, - options, - fetch, - ); + return useModelQuery('SpaceUser', `${endpoint}/spaceUser/aggregate`, args, options, fetch); } -export function useSuspenseAggregateSpaceUser< - TArgs extends Prisma.SpaceUserAggregateArgs, - TQueryFnData = Prisma.GetSpaceUserAggregateType, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useSuspenseAggregateSpaceUser, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'SpaceUser', - `${endpoint}/spaceUser/aggregate`, - args, - options, - fetch, - ); + return useSuspenseModelQuery('SpaceUser', `${endpoint}/spaceUser/aggregate`, args, options, fetch); } -export function useGroupBySpaceUser< - TArgs extends Prisma.SpaceUserGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: Prisma.SpaceUserGroupByArgs['orderBy'] } - : { orderBy?: Prisma.SpaceUserGroupByArgs['orderBy'] }, - OrderFields extends Prisma.ExcludeUnderscoreKeys>>, - ByFields extends Prisma.MaybeTupleToUnion, - ByValid extends Prisma.Has, - HavingFields extends Prisma.GetHavingFields, - HavingValid extends Prisma.Has, - ByEmpty extends TArgs['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 - ? 'orderBy' extends Prisma.Keys - ? 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 - ? 'orderBy' extends Prisma.Keys - ? 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], - TQueryFnData = {} extends InputErrors - ? Array< - PickEnumerable & { - [P in keyof TArgs & keyof Prisma.SpaceUserGroupByOutputType]: P extends '_count' - ? TArgs[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType; - } - > - : InputErrors, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset< - TArgs, - Prisma.SubsetIntersection & InputErrors - >, - options?: Omit, 'queryKey'>, -) { +export function useGroupBySpaceUser>, Prisma.Extends<'take', Prisma.Keys>>, OrderByArg extends Prisma.True extends HasSelectOrTake ? { orderBy: Prisma.SpaceUserGroupByArgs['orderBy'] } : { orderBy?: Prisma.SpaceUserGroupByArgs['orderBy'] }, OrderFields extends Prisma.ExcludeUnderscoreKeys>>, ByFields extends Prisma.MaybeTupleToUnion, ByValid extends Prisma.Has, HavingFields extends Prisma.GetHavingFields, HavingValid extends Prisma.Has, ByEmpty extends TArgs['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 + ? 'orderBy' extends Prisma.Keys + ? 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 + ? 'orderBy' extends Prisma.Keys + ? 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], TQueryFnData = {} extends InputErrors ? + Array & + { + [P in ((keyof TArgs) & (keyof Prisma.SpaceUserGroupByOutputType))]: P extends '_count' + ? TArgs[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > : InputErrors, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset & InputErrors>, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'SpaceUser', - `${endpoint}/spaceUser/groupBy`, - args, - options, - fetch, - ); + return useModelQuery('SpaceUser', `${endpoint}/spaceUser/groupBy`, args, options, fetch); } -export function useSuspenseGroupBySpaceUser< - TArgs extends Prisma.SpaceUserGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: Prisma.SpaceUserGroupByArgs['orderBy'] } - : { orderBy?: Prisma.SpaceUserGroupByArgs['orderBy'] }, - OrderFields extends Prisma.ExcludeUnderscoreKeys>>, - ByFields extends Prisma.MaybeTupleToUnion, - ByValid extends Prisma.Has, - HavingFields extends Prisma.GetHavingFields, - HavingValid extends Prisma.Has, - ByEmpty extends TArgs['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 - ? 'orderBy' extends Prisma.Keys - ? 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 - ? 'orderBy' extends Prisma.Keys - ? 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], - TQueryFnData = {} extends InputErrors - ? Array< - PickEnumerable & { - [P in keyof TArgs & keyof Prisma.SpaceUserGroupByOutputType]: P extends '_count' - ? TArgs[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType; - } - > - : InputErrors, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset< - TArgs, - Prisma.SubsetIntersection & InputErrors - >, - options?: Omit, 'queryKey'>, -) { +export function useSuspenseGroupBySpaceUser>, Prisma.Extends<'take', Prisma.Keys>>, OrderByArg extends Prisma.True extends HasSelectOrTake ? { orderBy: Prisma.SpaceUserGroupByArgs['orderBy'] } : { orderBy?: Prisma.SpaceUserGroupByArgs['orderBy'] }, OrderFields extends Prisma.ExcludeUnderscoreKeys>>, ByFields extends Prisma.MaybeTupleToUnion, ByValid extends Prisma.Has, HavingFields extends Prisma.GetHavingFields, HavingValid extends Prisma.Has, ByEmpty extends TArgs['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 + ? 'orderBy' extends Prisma.Keys + ? 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 + ? 'orderBy' extends Prisma.Keys + ? 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], TQueryFnData = {} extends InputErrors ? + Array & + { + [P in ((keyof TArgs) & (keyof Prisma.SpaceUserGroupByOutputType))]: P extends '_count' + ? TArgs[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > : InputErrors, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset & InputErrors>, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'SpaceUser', - `${endpoint}/spaceUser/groupBy`, - args, - options, - fetch, - ); + return useSuspenseModelQuery('SpaceUser', `${endpoint}/spaceUser/groupBy`, args, options, fetch); } -export function useCountSpaceUser< - TArgs extends Prisma.SpaceUserCountArgs, - TQueryFnData = TArgs extends { select: any } - ? TArgs['select'] extends true - ? number - : Prisma.GetScalarType - : number, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useCountSpaceUser : number, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useModelQuery('SpaceUser', `${endpoint}/spaceUser/count`, args, options, fetch); } -export function useSuspenseCountSpaceUser< - TArgs extends Prisma.SpaceUserCountArgs, - TQueryFnData = TArgs extends { select: any } - ? TArgs['select'] extends true - ? number - : Prisma.GetScalarType - : number, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useSuspenseCountSpaceUser : number, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'SpaceUser', - `${endpoint}/spaceUser/count`, - args, - options, - fetch, - ); + return useSuspenseModelQuery('SpaceUser', `${endpoint}/spaceUser/count`, args, options, fetch); } diff --git a/lib/hooks/space.ts b/lib/hooks/space.ts index 7d16b36..43ff824 100644 --- a/lib/hooks/space.ts +++ b/lib/hooks/space.ts @@ -1,660 +1,322 @@ /* eslint-disable */ -import type { Prisma, Space } from '@prisma/client'; +import type { Prisma, Space } from ".zenstack/models"; import type { UseMutationOptions, UseQueryOptions, UseInfiniteQueryOptions, InfiniteData } from '@tanstack/react-query'; import { getHooksContext } from '@zenstackhq/tanstack-query/runtime-v5/react'; import { useModelQuery, useInfiniteModelQuery, useModelMutation } from '@zenstackhq/tanstack-query/runtime-v5/react'; -import type { PickEnumerable, CheckSelect, QueryError } from '@zenstackhq/tanstack-query/runtime-v5'; +import type { PickEnumerable, CheckSelect, QueryError, ExtraQueryOptions, ExtraMutationOptions } from '@zenstackhq/tanstack-query/runtime-v5'; import metadata from './__model_meta'; type DefaultError = QueryError; import { useSuspenseModelQuery, useSuspenseInfiniteModelQuery } from '@zenstackhq/tanstack-query/runtime-v5/react'; import type { UseSuspenseQueryOptions, UseSuspenseInfiniteQueryOptions } from '@tanstack/react-query'; -export function useCreateSpace( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useCreateSpace(options?: Omit<(UseMutationOptions<(Space | undefined), DefaultError, Prisma.SpaceCreateArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Space', - 'POST', - `${endpoint}/space/create`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Space', 'POST', `${endpoint}/space/create`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useCreateManySpace( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useCreateManySpace(options?: Omit<(UseMutationOptions & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Space', - 'POST', - `${endpoint}/space/createMany`, - metadata, - options, - fetch, - invalidateQueries, - false, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Space', 'POST', `${endpoint}/space/createMany`, metadata, options, fetch, false) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - Prisma.BatchPayload, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as Prisma.BatchPayload; + return (await _mutation.mutateAsync( + args, + options as any + )) as Prisma.BatchPayload; }, }; return mutation; } -export function useFindManySpace< - TArgs extends Prisma.SpaceFindManyArgs, - TQueryFnData = Array & { $optimistic?: boolean }>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useFindManySpace & { $optimistic?: boolean }>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'Space', - `${endpoint}/space/findMany`, - args, - options, - fetch, - optimisticUpdate, - ); + return useModelQuery('Space', `${endpoint}/space/findMany`, args, options, fetch); } -export function useInfiniteFindManySpace< - TArgs extends Prisma.SpaceFindManyArgs, - TQueryFnData = Array>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit>, 'queryKey'>, -) { +export function useInfiniteFindManySpace>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: Omit>, 'queryKey'>) { options = options ?? { initialPageParam: undefined, getNextPageParam: () => null }; const { endpoint, fetch } = getHooksContext(); - return useInfiniteModelQuery( - 'Space', - `${endpoint}/space/findMany`, - args, - options, - fetch, - ); + return useInfiniteModelQuery('Space', `${endpoint}/space/findMany`, args, options, fetch); } -export function useSuspenseFindManySpace< - TArgs extends Prisma.SpaceFindManyArgs, - TQueryFnData = Array & { $optimistic?: boolean }>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useSuspenseFindManySpace & { $optimistic?: boolean }>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'Space', - `${endpoint}/space/findMany`, - args, - options, - fetch, - optimisticUpdate, - ); + return useSuspenseModelQuery('Space', `${endpoint}/space/findMany`, args, options, fetch); } -export function useSuspenseInfiniteFindManySpace< - TArgs extends Prisma.SpaceFindManyArgs, - TQueryFnData = Array>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit>, 'queryKey'>, -) { +export function useSuspenseInfiniteFindManySpace>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: Omit>, 'queryKey'>) { options = options ?? { initialPageParam: undefined, getNextPageParam: () => null }; const { endpoint, fetch } = getHooksContext(); - return useSuspenseInfiniteModelQuery( - 'Space', - `${endpoint}/space/findMany`, - args, - options, - fetch, - ); + return useSuspenseInfiniteModelQuery('Space', `${endpoint}/space/findMany`, args, options, fetch); } -export function useFindUniqueSpace< - TArgs extends Prisma.SpaceFindUniqueArgs, - TQueryFnData = Prisma.SpaceGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useFindUniqueSpace & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'Space', - `${endpoint}/space/findUnique`, - args, - options, - fetch, - optimisticUpdate, - ); + return useModelQuery('Space', `${endpoint}/space/findUnique`, args, options, fetch); } -export function useSuspenseFindUniqueSpace< - TArgs extends Prisma.SpaceFindUniqueArgs, - TQueryFnData = Prisma.SpaceGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useSuspenseFindUniqueSpace & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'Space', - `${endpoint}/space/findUnique`, - args, - options, - fetch, - optimisticUpdate, - ); + return useSuspenseModelQuery('Space', `${endpoint}/space/findUnique`, args, options, fetch); } -export function useFindFirstSpace< - TArgs extends Prisma.SpaceFindFirstArgs, - TQueryFnData = Prisma.SpaceGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useFindFirstSpace & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'Space', - `${endpoint}/space/findFirst`, - args, - options, - fetch, - optimisticUpdate, - ); + return useModelQuery('Space', `${endpoint}/space/findFirst`, args, options, fetch); } -export function useSuspenseFindFirstSpace< - TArgs extends Prisma.SpaceFindFirstArgs, - TQueryFnData = Prisma.SpaceGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useSuspenseFindFirstSpace & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'Space', - `${endpoint}/space/findFirst`, - args, - options, - fetch, - optimisticUpdate, - ); + return useSuspenseModelQuery('Space', `${endpoint}/space/findFirst`, args, options, fetch); } -export function useUpdateSpace( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useUpdateSpace(options?: Omit<(UseMutationOptions<(Space | undefined), DefaultError, Prisma.SpaceUpdateArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Space', - 'PUT', - `${endpoint}/space/update`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Space', 'PUT', `${endpoint}/space/update`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useUpdateManySpace( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useUpdateManySpace(options?: Omit<(UseMutationOptions & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Space', - 'PUT', - `${endpoint}/space/updateMany`, - metadata, - options, - fetch, - invalidateQueries, - false, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Space', 'PUT', `${endpoint}/space/updateMany`, metadata, options, fetch, false) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - Prisma.BatchPayload, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as Prisma.BatchPayload; + return (await _mutation.mutateAsync( + args, + options as any + )) as Prisma.BatchPayload; }, }; return mutation; } -export function useUpsertSpace( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useUpsertSpace(options?: Omit<(UseMutationOptions<(Space | undefined), DefaultError, Prisma.SpaceUpsertArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Space', - 'POST', - `${endpoint}/space/upsert`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Space', 'POST', `${endpoint}/space/upsert`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useDeleteSpace( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useDeleteSpace(options?: Omit<(UseMutationOptions<(Space | undefined), DefaultError, Prisma.SpaceDeleteArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Space', - 'DELETE', - `${endpoint}/space/delete`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Space', 'DELETE', `${endpoint}/space/delete`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useDeleteManySpace( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useDeleteManySpace(options?: Omit<(UseMutationOptions & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Space', - 'DELETE', - `${endpoint}/space/deleteMany`, - metadata, - options, - fetch, - invalidateQueries, - false, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Space', 'DELETE', `${endpoint}/space/deleteMany`, metadata, options, fetch, false) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - Prisma.BatchPayload, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as Prisma.BatchPayload; + return (await _mutation.mutateAsync( + args, + options as any + )) as Prisma.BatchPayload; }, }; return mutation; } -export function useAggregateSpace< - TArgs extends Prisma.SpaceAggregateArgs, - TQueryFnData = Prisma.GetSpaceAggregateType, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useAggregateSpace, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useModelQuery('Space', `${endpoint}/space/aggregate`, args, options, fetch); } -export function useSuspenseAggregateSpace< - TArgs extends Prisma.SpaceAggregateArgs, - TQueryFnData = Prisma.GetSpaceAggregateType, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useSuspenseAggregateSpace, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'Space', - `${endpoint}/space/aggregate`, - args, - options, - fetch, - ); + return useSuspenseModelQuery('Space', `${endpoint}/space/aggregate`, args, options, fetch); } -export function useGroupBySpace< - TArgs extends Prisma.SpaceGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: Prisma.SpaceGroupByArgs['orderBy'] } - : { orderBy?: Prisma.SpaceGroupByArgs['orderBy'] }, - OrderFields extends Prisma.ExcludeUnderscoreKeys>>, - ByFields extends Prisma.MaybeTupleToUnion, - ByValid extends Prisma.Has, - HavingFields extends Prisma.GetHavingFields, - HavingValid extends Prisma.Has, - ByEmpty extends TArgs['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 - ? 'orderBy' extends Prisma.Keys - ? 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 - ? 'orderBy' extends Prisma.Keys - ? 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], - TQueryFnData = {} extends InputErrors - ? Array< - PickEnumerable & { - [P in keyof TArgs & keyof Prisma.SpaceGroupByOutputType]: P extends '_count' - ? TArgs[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType; - } - > - : InputErrors, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset< - TArgs, - Prisma.SubsetIntersection & InputErrors - >, - options?: Omit, 'queryKey'>, -) { +export function useGroupBySpace>, Prisma.Extends<'take', Prisma.Keys>>, OrderByArg extends Prisma.True extends HasSelectOrTake ? { orderBy: Prisma.SpaceGroupByArgs['orderBy'] } : { orderBy?: Prisma.SpaceGroupByArgs['orderBy'] }, OrderFields extends Prisma.ExcludeUnderscoreKeys>>, ByFields extends Prisma.MaybeTupleToUnion, ByValid extends Prisma.Has, HavingFields extends Prisma.GetHavingFields, HavingValid extends Prisma.Has, ByEmpty extends TArgs['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 + ? 'orderBy' extends Prisma.Keys + ? 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 + ? 'orderBy' extends Prisma.Keys + ? 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], TQueryFnData = {} extends InputErrors ? + Array & + { + [P in ((keyof TArgs) & (keyof Prisma.SpaceGroupByOutputType))]: P extends '_count' + ? TArgs[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > : InputErrors, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset & InputErrors>, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useModelQuery('Space', `${endpoint}/space/groupBy`, args, options, fetch); } -export function useSuspenseGroupBySpace< - TArgs extends Prisma.SpaceGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: Prisma.SpaceGroupByArgs['orderBy'] } - : { orderBy?: Prisma.SpaceGroupByArgs['orderBy'] }, - OrderFields extends Prisma.ExcludeUnderscoreKeys>>, - ByFields extends Prisma.MaybeTupleToUnion, - ByValid extends Prisma.Has, - HavingFields extends Prisma.GetHavingFields, - HavingValid extends Prisma.Has, - ByEmpty extends TArgs['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 - ? 'orderBy' extends Prisma.Keys - ? 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 - ? 'orderBy' extends Prisma.Keys - ? 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], - TQueryFnData = {} extends InputErrors - ? Array< - PickEnumerable & { - [P in keyof TArgs & keyof Prisma.SpaceGroupByOutputType]: P extends '_count' - ? TArgs[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType; - } - > - : InputErrors, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset< - TArgs, - Prisma.SubsetIntersection & InputErrors - >, - options?: Omit, 'queryKey'>, -) { +export function useSuspenseGroupBySpace>, Prisma.Extends<'take', Prisma.Keys>>, OrderByArg extends Prisma.True extends HasSelectOrTake ? { orderBy: Prisma.SpaceGroupByArgs['orderBy'] } : { orderBy?: Prisma.SpaceGroupByArgs['orderBy'] }, OrderFields extends Prisma.ExcludeUnderscoreKeys>>, ByFields extends Prisma.MaybeTupleToUnion, ByValid extends Prisma.Has, HavingFields extends Prisma.GetHavingFields, HavingValid extends Prisma.Has, ByEmpty extends TArgs['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 + ? 'orderBy' extends Prisma.Keys + ? 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 + ? 'orderBy' extends Prisma.Keys + ? 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], TQueryFnData = {} extends InputErrors ? + Array & + { + [P in ((keyof TArgs) & (keyof Prisma.SpaceGroupByOutputType))]: P extends '_count' + ? TArgs[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > : InputErrors, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset & InputErrors>, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'Space', - `${endpoint}/space/groupBy`, - args, - options, - fetch, - ); + return useSuspenseModelQuery('Space', `${endpoint}/space/groupBy`, args, options, fetch); } -export function useCountSpace< - TArgs extends Prisma.SpaceCountArgs, - TQueryFnData = TArgs extends { select: any } - ? TArgs['select'] extends true - ? number - : Prisma.GetScalarType - : number, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useCountSpace : number, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useModelQuery('Space', `${endpoint}/space/count`, args, options, fetch); } -export function useSuspenseCountSpace< - TArgs extends Prisma.SpaceCountArgs, - TQueryFnData = TArgs extends { select: any } - ? TArgs['select'] extends true - ? number - : Prisma.GetScalarType - : number, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useSuspenseCountSpace : number, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useSuspenseModelQuery('Space', `${endpoint}/space/count`, args, options, fetch); } diff --git a/lib/hooks/todo.ts b/lib/hooks/todo.ts index 47ea303..89daf42 100644 --- a/lib/hooks/todo.ts +++ b/lib/hooks/todo.ts @@ -1,654 +1,322 @@ /* eslint-disable */ -import type { Prisma, Todo } from '@prisma/client'; +import type { Prisma, Todo } from ".zenstack/models"; import type { UseMutationOptions, UseQueryOptions, UseInfiniteQueryOptions, InfiniteData } from '@tanstack/react-query'; import { getHooksContext } from '@zenstackhq/tanstack-query/runtime-v5/react'; import { useModelQuery, useInfiniteModelQuery, useModelMutation } from '@zenstackhq/tanstack-query/runtime-v5/react'; -import type { PickEnumerable, CheckSelect, QueryError } from '@zenstackhq/tanstack-query/runtime-v5'; +import type { PickEnumerable, CheckSelect, QueryError, ExtraQueryOptions, ExtraMutationOptions } from '@zenstackhq/tanstack-query/runtime-v5'; import metadata from './__model_meta'; type DefaultError = QueryError; import { useSuspenseModelQuery, useSuspenseInfiniteModelQuery } from '@zenstackhq/tanstack-query/runtime-v5/react'; import type { UseSuspenseQueryOptions, UseSuspenseInfiniteQueryOptions } from '@tanstack/react-query'; -export function useCreateTodo( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useCreateTodo(options?: Omit<(UseMutationOptions<(Todo | undefined), DefaultError, Prisma.TodoCreateArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Todo', - 'POST', - `${endpoint}/todo/create`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Todo', 'POST', `${endpoint}/todo/create`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useCreateManyTodo( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useCreateManyTodo(options?: Omit<(UseMutationOptions & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Todo', - 'POST', - `${endpoint}/todo/createMany`, - metadata, - options, - fetch, - invalidateQueries, - false, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Todo', 'POST', `${endpoint}/todo/createMany`, metadata, options, fetch, false) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - Prisma.BatchPayload, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as Prisma.BatchPayload; + return (await _mutation.mutateAsync( + args, + options as any + )) as Prisma.BatchPayload; }, }; return mutation; } -export function useFindManyTodo< - TArgs extends Prisma.TodoFindManyArgs, - TQueryFnData = Array & { $optimistic?: boolean }>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useFindManyTodo & { $optimistic?: boolean }>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'Todo', - `${endpoint}/todo/findMany`, - args, - options, - fetch, - optimisticUpdate, - ); + return useModelQuery('Todo', `${endpoint}/todo/findMany`, args, options, fetch); } -export function useInfiniteFindManyTodo< - TArgs extends Prisma.TodoFindManyArgs, - TQueryFnData = Array>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit>, 'queryKey'>, -) { +export function useInfiniteFindManyTodo>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: Omit>, 'queryKey'>) { options = options ?? { initialPageParam: undefined, getNextPageParam: () => null }; const { endpoint, fetch } = getHooksContext(); - return useInfiniteModelQuery( - 'Todo', - `${endpoint}/todo/findMany`, - args, - options, - fetch, - ); + return useInfiniteModelQuery('Todo', `${endpoint}/todo/findMany`, args, options, fetch); } -export function useSuspenseFindManyTodo< - TArgs extends Prisma.TodoFindManyArgs, - TQueryFnData = Array & { $optimistic?: boolean }>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useSuspenseFindManyTodo & { $optimistic?: boolean }>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'Todo', - `${endpoint}/todo/findMany`, - args, - options, - fetch, - optimisticUpdate, - ); + return useSuspenseModelQuery('Todo', `${endpoint}/todo/findMany`, args, options, fetch); } -export function useSuspenseInfiniteFindManyTodo< - TArgs extends Prisma.TodoFindManyArgs, - TQueryFnData = Array>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit>, 'queryKey'>, -) { +export function useSuspenseInfiniteFindManyTodo>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: Omit>, 'queryKey'>) { options = options ?? { initialPageParam: undefined, getNextPageParam: () => null }; const { endpoint, fetch } = getHooksContext(); - return useSuspenseInfiniteModelQuery( - 'Todo', - `${endpoint}/todo/findMany`, - args, - options, - fetch, - ); + return useSuspenseInfiniteModelQuery('Todo', `${endpoint}/todo/findMany`, args, options, fetch); } -export function useFindUniqueTodo< - TArgs extends Prisma.TodoFindUniqueArgs, - TQueryFnData = Prisma.TodoGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useFindUniqueTodo & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'Todo', - `${endpoint}/todo/findUnique`, - args, - options, - fetch, - optimisticUpdate, - ); + return useModelQuery('Todo', `${endpoint}/todo/findUnique`, args, options, fetch); } -export function useSuspenseFindUniqueTodo< - TArgs extends Prisma.TodoFindUniqueArgs, - TQueryFnData = Prisma.TodoGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useSuspenseFindUniqueTodo & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'Todo', - `${endpoint}/todo/findUnique`, - args, - options, - fetch, - optimisticUpdate, - ); + return useSuspenseModelQuery('Todo', `${endpoint}/todo/findUnique`, args, options, fetch); } -export function useFindFirstTodo< - TArgs extends Prisma.TodoFindFirstArgs, - TQueryFnData = Prisma.TodoGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useFindFirstTodo & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'Todo', - `${endpoint}/todo/findFirst`, - args, - options, - fetch, - optimisticUpdate, - ); + return useModelQuery('Todo', `${endpoint}/todo/findFirst`, args, options, fetch); } -export function useSuspenseFindFirstTodo< - TArgs extends Prisma.TodoFindFirstArgs, - TQueryFnData = Prisma.TodoGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useSuspenseFindFirstTodo & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'Todo', - `${endpoint}/todo/findFirst`, - args, - options, - fetch, - optimisticUpdate, - ); + return useSuspenseModelQuery('Todo', `${endpoint}/todo/findFirst`, args, options, fetch); } -export function useUpdateTodo( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useUpdateTodo(options?: Omit<(UseMutationOptions<(Todo | undefined), DefaultError, Prisma.TodoUpdateArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Todo', - 'PUT', - `${endpoint}/todo/update`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Todo', 'PUT', `${endpoint}/todo/update`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useUpdateManyTodo( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useUpdateManyTodo(options?: Omit<(UseMutationOptions & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Todo', - 'PUT', - `${endpoint}/todo/updateMany`, - metadata, - options, - fetch, - invalidateQueries, - false, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Todo', 'PUT', `${endpoint}/todo/updateMany`, metadata, options, fetch, false) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - Prisma.BatchPayload, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as Prisma.BatchPayload; + return (await _mutation.mutateAsync( + args, + options as any + )) as Prisma.BatchPayload; }, }; return mutation; } -export function useUpsertTodo( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useUpsertTodo(options?: Omit<(UseMutationOptions<(Todo | undefined), DefaultError, Prisma.TodoUpsertArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Todo', - 'POST', - `${endpoint}/todo/upsert`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Todo', 'POST', `${endpoint}/todo/upsert`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useDeleteTodo( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useDeleteTodo(options?: Omit<(UseMutationOptions<(Todo | undefined), DefaultError, Prisma.TodoDeleteArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Todo', - 'DELETE', - `${endpoint}/todo/delete`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Todo', 'DELETE', `${endpoint}/todo/delete`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useDeleteManyTodo( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useDeleteManyTodo(options?: Omit<(UseMutationOptions & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'Todo', - 'DELETE', - `${endpoint}/todo/deleteMany`, - metadata, - options, - fetch, - invalidateQueries, - false, - optimisticUpdate, - ); + const _mutation = + useModelMutation('Todo', 'DELETE', `${endpoint}/todo/deleteMany`, metadata, options, fetch, false) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - Prisma.BatchPayload, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as Prisma.BatchPayload; + return (await _mutation.mutateAsync( + args, + options as any + )) as Prisma.BatchPayload; }, }; return mutation; } -export function useAggregateTodo< - TArgs extends Prisma.TodoAggregateArgs, - TQueryFnData = Prisma.GetTodoAggregateType, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useAggregateTodo, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useModelQuery('Todo', `${endpoint}/todo/aggregate`, args, options, fetch); } -export function useSuspenseAggregateTodo< - TArgs extends Prisma.TodoAggregateArgs, - TQueryFnData = Prisma.GetTodoAggregateType, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useSuspenseAggregateTodo, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'Todo', - `${endpoint}/todo/aggregate`, - args, - options, - fetch, - ); + return useSuspenseModelQuery('Todo', `${endpoint}/todo/aggregate`, args, options, fetch); } -export function useGroupByTodo< - TArgs extends Prisma.TodoGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: Prisma.TodoGroupByArgs['orderBy'] } - : { orderBy?: Prisma.TodoGroupByArgs['orderBy'] }, - OrderFields extends Prisma.ExcludeUnderscoreKeys>>, - ByFields extends Prisma.MaybeTupleToUnion, - ByValid extends Prisma.Has, - HavingFields extends Prisma.GetHavingFields, - HavingValid extends Prisma.Has, - ByEmpty extends TArgs['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 - ? 'orderBy' extends Prisma.Keys - ? 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 - ? 'orderBy' extends Prisma.Keys - ? 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], - TQueryFnData = {} extends InputErrors - ? Array< - PickEnumerable & { - [P in keyof TArgs & keyof Prisma.TodoGroupByOutputType]: P extends '_count' - ? TArgs[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType; - } - > - : InputErrors, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset< - TArgs, - Prisma.SubsetIntersection & InputErrors - >, - options?: Omit, 'queryKey'>, -) { +export function useGroupByTodo>, Prisma.Extends<'take', Prisma.Keys>>, OrderByArg extends Prisma.True extends HasSelectOrTake ? { orderBy: Prisma.TodoGroupByArgs['orderBy'] } : { orderBy?: Prisma.TodoGroupByArgs['orderBy'] }, OrderFields extends Prisma.ExcludeUnderscoreKeys>>, ByFields extends Prisma.MaybeTupleToUnion, ByValid extends Prisma.Has, HavingFields extends Prisma.GetHavingFields, HavingValid extends Prisma.Has, ByEmpty extends TArgs['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 + ? 'orderBy' extends Prisma.Keys + ? 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 + ? 'orderBy' extends Prisma.Keys + ? 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], TQueryFnData = {} extends InputErrors ? + Array & + { + [P in ((keyof TArgs) & (keyof Prisma.TodoGroupByOutputType))]: P extends '_count' + ? TArgs[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > : InputErrors, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset & InputErrors>, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useModelQuery('Todo', `${endpoint}/todo/groupBy`, args, options, fetch); } -export function useSuspenseGroupByTodo< - TArgs extends Prisma.TodoGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: Prisma.TodoGroupByArgs['orderBy'] } - : { orderBy?: Prisma.TodoGroupByArgs['orderBy'] }, - OrderFields extends Prisma.ExcludeUnderscoreKeys>>, - ByFields extends Prisma.MaybeTupleToUnion, - ByValid extends Prisma.Has, - HavingFields extends Prisma.GetHavingFields, - HavingValid extends Prisma.Has, - ByEmpty extends TArgs['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 - ? 'orderBy' extends Prisma.Keys - ? 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 - ? 'orderBy' extends Prisma.Keys - ? 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], - TQueryFnData = {} extends InputErrors - ? Array< - PickEnumerable & { - [P in keyof TArgs & keyof Prisma.TodoGroupByOutputType]: P extends '_count' - ? TArgs[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType; - } - > - : InputErrors, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset< - TArgs, - Prisma.SubsetIntersection & InputErrors - >, - options?: Omit, 'queryKey'>, -) { +export function useSuspenseGroupByTodo>, Prisma.Extends<'take', Prisma.Keys>>, OrderByArg extends Prisma.True extends HasSelectOrTake ? { orderBy: Prisma.TodoGroupByArgs['orderBy'] } : { orderBy?: Prisma.TodoGroupByArgs['orderBy'] }, OrderFields extends Prisma.ExcludeUnderscoreKeys>>, ByFields extends Prisma.MaybeTupleToUnion, ByValid extends Prisma.Has, HavingFields extends Prisma.GetHavingFields, HavingValid extends Prisma.Has, ByEmpty extends TArgs['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 + ? 'orderBy' extends Prisma.Keys + ? 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 + ? 'orderBy' extends Prisma.Keys + ? 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], TQueryFnData = {} extends InputErrors ? + Array & + { + [P in ((keyof TArgs) & (keyof Prisma.TodoGroupByOutputType))]: P extends '_count' + ? TArgs[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > : InputErrors, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset & InputErrors>, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useSuspenseModelQuery('Todo', `${endpoint}/todo/groupBy`, args, options, fetch); } -export function useCountTodo< - TArgs extends Prisma.TodoCountArgs, - TQueryFnData = TArgs extends { select: any } - ? TArgs['select'] extends true - ? number - : Prisma.GetScalarType - : number, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useCountTodo : number, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useModelQuery('Todo', `${endpoint}/todo/count`, args, options, fetch); } -export function useSuspenseCountTodo< - TArgs extends Prisma.TodoCountArgs, - TQueryFnData = TArgs extends { select: any } - ? TArgs['select'] extends true - ? number - : Prisma.GetScalarType - : number, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useSuspenseCountTodo : number, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useSuspenseModelQuery('Todo', `${endpoint}/todo/count`, args, options, fetch); } diff --git a/lib/hooks/user.ts b/lib/hooks/user.ts index 62b4480..bc5b794 100644 --- a/lib/hooks/user.ts +++ b/lib/hooks/user.ts @@ -1,654 +1,322 @@ /* eslint-disable */ -import type { Prisma, User } from '@prisma/client'; +import type { Prisma, User } from ".zenstack/models"; import type { UseMutationOptions, UseQueryOptions, UseInfiniteQueryOptions, InfiniteData } from '@tanstack/react-query'; import { getHooksContext } from '@zenstackhq/tanstack-query/runtime-v5/react'; import { useModelQuery, useInfiniteModelQuery, useModelMutation } from '@zenstackhq/tanstack-query/runtime-v5/react'; -import type { PickEnumerable, CheckSelect, QueryError } from '@zenstackhq/tanstack-query/runtime-v5'; +import type { PickEnumerable, CheckSelect, QueryError, ExtraQueryOptions, ExtraMutationOptions } from '@zenstackhq/tanstack-query/runtime-v5'; import metadata from './__model_meta'; type DefaultError = QueryError; import { useSuspenseModelQuery, useSuspenseInfiniteModelQuery } from '@zenstackhq/tanstack-query/runtime-v5/react'; import type { UseSuspenseQueryOptions, UseSuspenseInfiniteQueryOptions } from '@tanstack/react-query'; -export function useCreateUser( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useCreateUser(options?: Omit<(UseMutationOptions<(User | undefined), DefaultError, Prisma.UserCreateArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'User', - 'POST', - `${endpoint}/user/create`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('User', 'POST', `${endpoint}/user/create`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useCreateManyUser( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useCreateManyUser(options?: Omit<(UseMutationOptions & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'User', - 'POST', - `${endpoint}/user/createMany`, - metadata, - options, - fetch, - invalidateQueries, - false, - optimisticUpdate, - ); + const _mutation = + useModelMutation('User', 'POST', `${endpoint}/user/createMany`, metadata, options, fetch, false) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - Prisma.BatchPayload, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as Prisma.BatchPayload; + return (await _mutation.mutateAsync( + args, + options as any + )) as Prisma.BatchPayload; }, }; return mutation; } -export function useFindManyUser< - TArgs extends Prisma.UserFindManyArgs, - TQueryFnData = Array & { $optimistic?: boolean }>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useFindManyUser & { $optimistic?: boolean }>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'User', - `${endpoint}/user/findMany`, - args, - options, - fetch, - optimisticUpdate, - ); + return useModelQuery('User', `${endpoint}/user/findMany`, args, options, fetch); } -export function useInfiniteFindManyUser< - TArgs extends Prisma.UserFindManyArgs, - TQueryFnData = Array>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit>, 'queryKey'>, -) { +export function useInfiniteFindManyUser>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: Omit>, 'queryKey'>) { options = options ?? { initialPageParam: undefined, getNextPageParam: () => null }; const { endpoint, fetch } = getHooksContext(); - return useInfiniteModelQuery( - 'User', - `${endpoint}/user/findMany`, - args, - options, - fetch, - ); + return useInfiniteModelQuery('User', `${endpoint}/user/findMany`, args, options, fetch); } -export function useSuspenseFindManyUser< - TArgs extends Prisma.UserFindManyArgs, - TQueryFnData = Array & { $optimistic?: boolean }>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useSuspenseFindManyUser & { $optimistic?: boolean }>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'User', - `${endpoint}/user/findMany`, - args, - options, - fetch, - optimisticUpdate, - ); + return useSuspenseModelQuery('User', `${endpoint}/user/findMany`, args, options, fetch); } -export function useSuspenseInfiniteFindManyUser< - TArgs extends Prisma.UserFindManyArgs, - TQueryFnData = Array>, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit>, 'queryKey'>, -) { +export function useSuspenseInfiniteFindManyUser>, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: Omit>, 'queryKey'>) { options = options ?? { initialPageParam: undefined, getNextPageParam: () => null }; const { endpoint, fetch } = getHooksContext(); - return useSuspenseInfiniteModelQuery( - 'User', - `${endpoint}/user/findMany`, - args, - options, - fetch, - ); + return useSuspenseInfiniteModelQuery('User', `${endpoint}/user/findMany`, args, options, fetch); } -export function useFindUniqueUser< - TArgs extends Prisma.UserFindUniqueArgs, - TQueryFnData = Prisma.UserGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useFindUniqueUser & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'User', - `${endpoint}/user/findUnique`, - args, - options, - fetch, - optimisticUpdate, - ); + return useModelQuery('User', `${endpoint}/user/findUnique`, args, options, fetch); } -export function useSuspenseFindUniqueUser< - TArgs extends Prisma.UserFindUniqueArgs, - TQueryFnData = Prisma.UserGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useSuspenseFindUniqueUser & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'User', - `${endpoint}/user/findUnique`, - args, - options, - fetch, - optimisticUpdate, - ); + return useSuspenseModelQuery('User', `${endpoint}/user/findUnique`, args, options, fetch); } -export function useFindFirstUser< - TArgs extends Prisma.UserFindFirstArgs, - TQueryFnData = Prisma.UserGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useFindFirstUser & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useModelQuery( - 'User', - `${endpoint}/user/findFirst`, - args, - options, - fetch, - optimisticUpdate, - ); + return useModelQuery('User', `${endpoint}/user/findFirst`, args, options, fetch); } -export function useSuspenseFindFirstUser< - TArgs extends Prisma.UserFindFirstArgs, - TQueryFnData = Prisma.UserGetPayload & { $optimistic?: boolean }, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, - optimisticUpdate: boolean = true, -) { +export function useSuspenseFindFirstUser & { $optimistic?: boolean }, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'User', - `${endpoint}/user/findFirst`, - args, - options, - fetch, - optimisticUpdate, - ); + return useSuspenseModelQuery('User', `${endpoint}/user/findFirst`, args, options, fetch); } -export function useUpdateUser( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useUpdateUser(options?: Omit<(UseMutationOptions<(User | undefined), DefaultError, Prisma.UserUpdateArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'User', - 'PUT', - `${endpoint}/user/update`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('User', 'PUT', `${endpoint}/user/update`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useUpdateManyUser( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useUpdateManyUser(options?: Omit<(UseMutationOptions & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'User', - 'PUT', - `${endpoint}/user/updateMany`, - metadata, - options, - fetch, - invalidateQueries, - false, - optimisticUpdate, - ); + const _mutation = + useModelMutation('User', 'PUT', `${endpoint}/user/updateMany`, metadata, options, fetch, false) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - Prisma.BatchPayload, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as Prisma.BatchPayload; + return (await _mutation.mutateAsync( + args, + options as any + )) as Prisma.BatchPayload; }, }; return mutation; } -export function useUpsertUser( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useUpsertUser(options?: Omit<(UseMutationOptions<(User | undefined), DefaultError, Prisma.UserUpsertArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'User', - 'POST', - `${endpoint}/user/upsert`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('User', 'POST', `${endpoint}/user/upsert`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useDeleteUser( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useDeleteUser(options?: Omit<(UseMutationOptions<(User | undefined), DefaultError, Prisma.UserDeleteArgs> & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'User', - 'DELETE', - `${endpoint}/user/delete`, - metadata, - options, - fetch, - invalidateQueries, - true, - optimisticUpdate, - ); + const _mutation = + useModelMutation('User', 'DELETE', `${endpoint}/user/delete`, metadata, options, fetch, true) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - CheckSelect> | undefined, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions<(CheckSelect> | undefined), DefaultError, Prisma.SelectSubset> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as - | CheckSelect> - | undefined; + return (await _mutation.mutateAsync( + args, + options as any + )) as (CheckSelect> | undefined); }, }; return mutation; } -export function useDeleteManyUser( - options?: Omit, 'mutationFn'>, - invalidateQueries: boolean = true, - optimisticUpdate: boolean = false, -) { +export function useDeleteManyUser(options?: Omit<(UseMutationOptions & ExtraMutationOptions), 'mutationFn'>) { const { endpoint, fetch } = getHooksContext(); - const _mutation = useModelMutation( - 'User', - 'DELETE', - `${endpoint}/user/deleteMany`, - metadata, - options, - fetch, - invalidateQueries, - false, - optimisticUpdate, - ); + const _mutation = + useModelMutation('User', 'DELETE', `${endpoint}/user/deleteMany`, metadata, options, fetch, false) + ; const mutation = { ..._mutation, mutateAsync: async ( args: Prisma.SelectSubset, - options?: Omit< - UseMutationOptions< - Prisma.BatchPayload, - DefaultError, - Prisma.SelectSubset - >, - 'mutationFn' - >, + options?: Omit<(UseMutationOptions> & ExtraMutationOptions), 'mutationFn'> ) => { - return (await _mutation.mutateAsync(args, options as any)) as Prisma.BatchPayload; + return (await _mutation.mutateAsync( + args, + options as any + )) as Prisma.BatchPayload; }, }; return mutation; } -export function useAggregateUser< - TArgs extends Prisma.UserAggregateArgs, - TQueryFnData = Prisma.GetUserAggregateType, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useAggregateUser, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useModelQuery('User', `${endpoint}/user/aggregate`, args, options, fetch); } -export function useSuspenseAggregateUser< - TArgs extends Prisma.UserAggregateArgs, - TQueryFnData = Prisma.GetUserAggregateType, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useSuspenseAggregateUser, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); - return useSuspenseModelQuery( - 'User', - `${endpoint}/user/aggregate`, - args, - options, - fetch, - ); + return useSuspenseModelQuery('User', `${endpoint}/user/aggregate`, args, options, fetch); } -export function useGroupByUser< - TArgs extends Prisma.UserGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: Prisma.UserGroupByArgs['orderBy'] } - : { orderBy?: Prisma.UserGroupByArgs['orderBy'] }, - OrderFields extends Prisma.ExcludeUnderscoreKeys>>, - ByFields extends Prisma.MaybeTupleToUnion, - ByValid extends Prisma.Has, - HavingFields extends Prisma.GetHavingFields, - HavingValid extends Prisma.Has, - ByEmpty extends TArgs['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 - ? 'orderBy' extends Prisma.Keys - ? 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 - ? 'orderBy' extends Prisma.Keys - ? 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], - TQueryFnData = {} extends InputErrors - ? Array< - PickEnumerable & { - [P in keyof TArgs & keyof Prisma.UserGroupByOutputType]: P extends '_count' - ? TArgs[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType; - } - > - : InputErrors, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset< - TArgs, - Prisma.SubsetIntersection & InputErrors - >, - options?: Omit, 'queryKey'>, -) { +export function useGroupByUser>, Prisma.Extends<'take', Prisma.Keys>>, OrderByArg extends Prisma.True extends HasSelectOrTake ? { orderBy: Prisma.UserGroupByArgs['orderBy'] } : { orderBy?: Prisma.UserGroupByArgs['orderBy'] }, OrderFields extends Prisma.ExcludeUnderscoreKeys>>, ByFields extends Prisma.MaybeTupleToUnion, ByValid extends Prisma.Has, HavingFields extends Prisma.GetHavingFields, HavingValid extends Prisma.Has, ByEmpty extends TArgs['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 + ? 'orderBy' extends Prisma.Keys + ? 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 + ? 'orderBy' extends Prisma.Keys + ? 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], TQueryFnData = {} extends InputErrors ? + Array & + { + [P in ((keyof TArgs) & (keyof Prisma.UserGroupByOutputType))]: P extends '_count' + ? TArgs[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > : InputErrors, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset & InputErrors>, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useModelQuery('User', `${endpoint}/user/groupBy`, args, options, fetch); } -export function useSuspenseGroupByUser< - TArgs extends Prisma.UserGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: Prisma.UserGroupByArgs['orderBy'] } - : { orderBy?: Prisma.UserGroupByArgs['orderBy'] }, - OrderFields extends Prisma.ExcludeUnderscoreKeys>>, - ByFields extends Prisma.MaybeTupleToUnion, - ByValid extends Prisma.Has, - HavingFields extends Prisma.GetHavingFields, - HavingValid extends Prisma.Has, - ByEmpty extends TArgs['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 - ? 'orderBy' extends Prisma.Keys - ? 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 - ? 'orderBy' extends Prisma.Keys - ? 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], - TQueryFnData = {} extends InputErrors - ? Array< - PickEnumerable & { - [P in keyof TArgs & keyof Prisma.UserGroupByOutputType]: P extends '_count' - ? TArgs[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType; - } - > - : InputErrors, - TData = TQueryFnData, - TError = DefaultError, ->( - args: Prisma.SelectSubset< - TArgs, - Prisma.SubsetIntersection & InputErrors - >, - options?: Omit, 'queryKey'>, -) { +export function useSuspenseGroupByUser>, Prisma.Extends<'take', Prisma.Keys>>, OrderByArg extends Prisma.True extends HasSelectOrTake ? { orderBy: Prisma.UserGroupByArgs['orderBy'] } : { orderBy?: Prisma.UserGroupByArgs['orderBy'] }, OrderFields extends Prisma.ExcludeUnderscoreKeys>>, ByFields extends Prisma.MaybeTupleToUnion, ByValid extends Prisma.Has, HavingFields extends Prisma.GetHavingFields, HavingValid extends Prisma.Has, ByEmpty extends TArgs['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 + ? 'orderBy' extends Prisma.Keys + ? 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 + ? 'orderBy' extends Prisma.Keys + ? 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], TQueryFnData = {} extends InputErrors ? + Array & + { + [P in ((keyof TArgs) & (keyof Prisma.UserGroupByOutputType))]: P extends '_count' + ? TArgs[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > : InputErrors, TData = TQueryFnData, TError = DefaultError>(args: Prisma.SelectSubset & InputErrors>, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useSuspenseModelQuery('User', `${endpoint}/user/groupBy`, args, options, fetch); } -export function useCountUser< - TArgs extends Prisma.UserCountArgs, - TQueryFnData = TArgs extends { select: any } - ? TArgs['select'] extends true - ? number - : Prisma.GetScalarType - : number, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useCountUser : number, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useModelQuery('User', `${endpoint}/user/count`, args, options, fetch); } -export function useSuspenseCountUser< - TArgs extends Prisma.UserCountArgs, - TQueryFnData = TArgs extends { select: any } - ? TArgs['select'] extends true - ? number - : Prisma.GetScalarType - : number, - TData = TQueryFnData, - TError = DefaultError, ->( - args?: Prisma.SelectSubset, - options?: Omit, 'queryKey'>, -) { +export function useSuspenseCountUser : number, TData = TQueryFnData, TError = DefaultError>(args?: Prisma.SelectSubset, options?: (Omit, 'queryKey'> & ExtraQueryOptions)) { const { endpoint, fetch } = getHooksContext(); return useSuspenseModelQuery('User', `${endpoint}/user/count`, args, options, fetch); } diff --git a/package-lock.json b/package-lock.json index 568fbdb..40a7261 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,12 +10,12 @@ "dependencies": { "@heroicons/react": "^2.0.12", "@next-auth/prisma-adapter": "^1.0.5", - "@prisma/client": "^4.9.0", + "@prisma/client": "^5.0.0", "@tanstack/react-query": "^5.8.4", "@tanstack/react-query-devtools": "^5.8.3", - "@zenstackhq/runtime": "^1.12.4", - "@zenstackhq/server": "^1.12.4", - "@zenstackhq/tanstack-query": "^1.12.4", + "@zenstackhq/runtime": "^2.0.0", + "@zenstackhq/server": "^2.0.0", + "@zenstackhq/tanstack-query": "^2.0.0", "babel-plugin-superjson-next": "^0.4.5", "bcryptjs": "^2.4.3", "daisyui": "^4.0.7", @@ -42,10 +42,10 @@ "eslint-config-next": "12.3.1", "lower-case-first": "^2.0.2", "postcss": "^8.4.16", - "prisma": "^4.9.0", + "prisma": "^5.0.0", "tailwindcss": "^3.1.8", "typescript": "^5.3.2", - "zenstack": "^1.12.4" + "zenstack": "^2.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -69,24 +69,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@antfu/ni": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@antfu/ni/-/ni-0.21.4.tgz", - "integrity": "sha512-O0Uv9LbLDSoEg26fnMDdDRiPwFJnQSoD4WnrflDwKCJm8Cx/0mV4cGxwBLXan5mGIrpK4Dd7vizf4rQm0QCEAA==", - "bin": { - "na": "bin/na.mjs", - "nci": "bin/nci.mjs", - "ni": "bin/ni.mjs", - "nlx": "bin/nlx.mjs", - "nr": "bin/nr.mjs", - "nu": "bin/nu.mjs", - "nun": "bin/nun.mjs" - } - }, "node_modules/@babel/code-frame": { "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "dev": true, "dependencies": { "@babel/highlight": "^7.10.4" } @@ -122,6 +109,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", + "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.5", "chalk": "^2.0.0", @@ -135,6 +123,7 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -146,6 +135,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -159,6 +149,7 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, "dependencies": { "color-name": "1.1.3" } @@ -166,12 +157,14 @@ "node_modules/@babel/highlight/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true }, "node_modules/@babel/highlight/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, "engines": { "node": ">=0.8.0" } @@ -180,6 +173,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, "engines": { "node": ">=4" } @@ -188,6 +182,7 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -612,6 +607,8 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.4.1.tgz", "integrity": "sha512-O2yRJce1GOc6PAy3QxFM4NzFiWzvScDC1/5ihYBL6BUEVdq0XMWN01sppE+H6bBXbaFYipjwFLEWLg5PaSOThA==", + "optional": true, + "peer": true, "engines": { "node": ">=8.0.0" } @@ -675,15 +672,12 @@ } }, "node_modules/@prisma/client": { - "version": "4.16.2", - "resolved": "https://registry.npmjs.org/@prisma/client/-/client-4.16.2.tgz", - "integrity": "sha512-qCoEyxv1ZrQ4bKy39GnylE8Zq31IRmm8bNhNbZx7bF2cU5aiCCnSa93J2imF88MBjn7J9eUQneNxUQVJdl/rPQ==", + "version": "5.12.1", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.12.1.tgz", + "integrity": "sha512-6/JnizEdlSBxDIdiLbrBdMW5NqDxOmhXAJaNXiPpgzAPr/nLZResT6MMpbOHLo5yAbQ1Vv5UU8PTPRzb0WIxdA==", "hasInstallScript": true, - "dependencies": { - "@prisma/engines-version": "4.16.1-1.4bc8b6e1b66cb932731fb1bdbbc550d1e010de81" - }, "engines": { - "node": ">=14.17" + "node": ">=16.13" }, "peerDependencies": { "prisma": "*" @@ -695,221 +689,72 @@ } }, "node_modules/@prisma/debug": { - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.12.1.tgz", - "integrity": "sha512-kd/wNsR0klrv79o1ITsbWxYyh4QWuBidvxsXSParPsYSu0ircUmNk3q4ojsgNc3/81b0ozg76iastOG43tbf8A==" + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.7.0.tgz", + "integrity": "sha512-tZ+MOjWlVvz1kOEhNYMa4QUGURY+kgOUBqLHYIV8jmCsMuvA1tWcn7qtIMLzYWCbDcQT4ZS8xDgK0R2gl6/0wA==" }, "node_modules/@prisma/engines": { - "version": "4.16.2", - "resolved": "https://dolphin-app-nyvr5.ondigitalocean.app/@prisma/engines/-/engines-4.16.2.tgz", - "integrity": "sha512-vx1nxVvN4QeT/cepQce68deh/Turxy5Mr+4L4zClFuK1GlxN3+ivxfuv+ej/gvidWn1cE1uAhW7ALLNlYbRUAw==", - "hasInstallScript": true + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.7.0.tgz", + "integrity": "sha512-TkOMgMm60n5YgEKPn9erIvFX2/QuWnl3GBo6yTRyZKk5O5KQertXiNnrYgSLy0SpsKmhovEPQb+D4l0SzyE7XA==", + "hasInstallScript": true, + "dependencies": { + "@prisma/debug": "5.7.0", + "@prisma/engines-version": "5.7.0-41.79fb5193cf0a8fdbef536e4b4a159cad677ab1b9", + "@prisma/fetch-engine": "5.7.0", + "@prisma/get-platform": "5.7.0" + } }, "node_modules/@prisma/engines-version": { - "version": "4.16.1-1.4bc8b6e1b66cb932731fb1bdbbc550d1e010de81", - "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.16.1-1.4bc8b6e1b66cb932731fb1bdbbc550d1e010de81.tgz", - "integrity": "sha512-q617EUWfRIDTriWADZ4YiWRZXCa/WuhNgLTVd+HqWLffjMSPzyM5uOWoauX91wvQClSKZU4pzI4JJLQ9Kl62Qg==" + "version": "5.7.0-41.79fb5193cf0a8fdbef536e4b4a159cad677ab1b9", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.7.0-41.79fb5193cf0a8fdbef536e4b4a159cad677ab1b9.tgz", + "integrity": "sha512-V6tgRVi62jRwTm0Hglky3Scwjr/AKFBFtS+MdbsBr7UOuiu1TKLPc6xfPiyEN1+bYqjEtjxwGsHgahcJsd1rNg==" }, "node_modules/@prisma/fetch-engine": { - "version": "4.16.2", - "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-4.16.2.tgz", - "integrity": "sha512-lnCnHcOaNn0kw8qTJbVcNhyfIf5Lus2GFXbj3qpkdKEIB9xLgqkkuTP+35q1xFaqwQ0vy4HFpdRUpFP7njE15g==", - "dependencies": { - "@prisma/debug": "4.16.2", - "@prisma/get-platform": "4.16.2", - "execa": "5.1.1", - "find-cache-dir": "3.3.2", - "fs-extra": "11.1.1", - "hasha": "5.2.2", - "http-proxy-agent": "7.0.0", - "https-proxy-agent": "7.0.0", - "kleur": "4.1.5", - "node-fetch": "2.6.11", - "p-filter": "2.1.0", - "p-map": "4.0.0", - "p-retry": "4.6.2", - "progress": "2.0.3", - "rimraf": "3.0.2", - "temp-dir": "2.0.0", - "tempy": "1.0.1" - } - }, - "node_modules/@prisma/fetch-engine/node_modules/@prisma/debug": { - "version": "4.16.2", - "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-4.16.2.tgz", - "integrity": "sha512-7L7WbG0qNNZYgLpsVB8rCHCXEyHFyIycRlRDNwkVfjQmACC2OW6AWCYCbfdjQhkF/t7+S3njj8wAWAocSs+Brw==", - "dependencies": { - "@types/debug": "4.1.8", - "debug": "4.3.4", - "strip-ansi": "6.0.1" + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.7.0.tgz", + "integrity": "sha512-zIn/qmO+N/3FYe7/L9o+yZseIU8ivh4NdPKSkQRIHfg2QVTVMnbhGoTcecbxfVubeTp+DjcbjS0H9fCuM4W04w==", + "dependencies": { + "@prisma/debug": "5.7.0", + "@prisma/engines-version": "5.7.0-41.79fb5193cf0a8fdbef536e4b4a159cad677ab1b9", + "@prisma/get-platform": "5.7.0" } }, "node_modules/@prisma/generator-helper": { - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/@prisma/generator-helper/-/generator-helper-5.12.1.tgz", - "integrity": "sha512-TlaI4J6jDKO06P68ve5czz1SionzI5ciUIw2tWFO4FM4qPID5+7nrxTVlecFTUD7Nc+IaO1hYT1YBOPKLiUncQ==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@prisma/generator-helper/-/generator-helper-5.7.0.tgz", + "integrity": "sha512-Fn4hJHKGJ49+E8sxpfslRauB3Goa3RAENJ/W25NMR754B9KxvmbCJyE3MT/lIZxML2nGgIdXYUtoDHZHnRaKDw==", "dependencies": { - "@prisma/debug": "5.12.1" + "@prisma/debug": "5.7.0" } }, "node_modules/@prisma/get-platform": { - "version": "4.16.2", - "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-4.16.2.tgz", - "integrity": "sha512-fnDey1/iSefHJRMB+w243BhWENf+paRouPMdCqIVqu8dYkR1NqhldblsSUC4Zr2sKS7Ta2sK4OLdt9IH+PZTfw==", - "dependencies": { - "@prisma/debug": "4.16.2", - "escape-string-regexp": "4.0.0", - "execa": "5.1.1", - "fs-jetpack": "5.1.0", - "kleur": "4.1.5", - "replace-string": "3.1.0", - "strip-ansi": "6.0.1", - "tempy": "1.0.1", - "terminal-link": "2.1.1", - "ts-pattern": "4.3.0" - } - }, - "node_modules/@prisma/get-platform/node_modules/@prisma/debug": { - "version": "4.16.2", - "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-4.16.2.tgz", - "integrity": "sha512-7L7WbG0qNNZYgLpsVB8rCHCXEyHFyIycRlRDNwkVfjQmACC2OW6AWCYCbfdjQhkF/t7+S3njj8wAWAocSs+Brw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.7.0.tgz", + "integrity": "sha512-ZeV/Op4bZsWXuw5Tg05WwRI8BlKiRFhsixPcAM+5BKYSiUZiMKIi713tfT3drBq8+T0E1arNZgYSA9QYcglWNA==", "dependencies": { - "@types/debug": "4.1.8", - "debug": "4.3.4", - "strip-ansi": "6.0.1" + "@prisma/debug": "5.7.0" } }, "node_modules/@prisma/internals": { - "version": "4.16.2", - "resolved": "https://registry.npmjs.org/@prisma/internals/-/internals-4.16.2.tgz", - "integrity": "sha512-/3OiSADA3RRgsaeEE+MDsBgL6oAMwddSheXn6wtYGUnjERAV/BmF5bMMLnTykesQqwZ1s8HrISrJ0Vf6cjOxMg==", - "dependencies": { - "@antfu/ni": "0.21.4", - "@opentelemetry/api": "1.4.1", - "@prisma/debug": "4.16.2", - "@prisma/engines": "4.16.2", - "@prisma/fetch-engine": "4.16.2", - "@prisma/generator-helper": "4.16.2", - "@prisma/get-platform": "4.16.2", - "@prisma/prisma-fmt-wasm": "4.16.1-1.4bc8b6e1b66cb932731fb1bdbbc550d1e010de81", - "archiver": "5.3.1", - "arg": "5.0.2", - "checkpoint-client": "1.1.24", - "cli-truncate": "2.1.0", - "dotenv": "16.0.3", - "escape-string-regexp": "4.0.0", - "execa": "5.1.1", - "find-up": "5.0.0", - "fp-ts": "2.16.0", - "fs-extra": "11.1.1", - "fs-jetpack": "5.1.0", - "global-dirs": "3.0.1", - "globby": "11.1.0", - "indent-string": "4.0.0", - "is-windows": "1.0.2", - "is-wsl": "2.2.0", - "kleur": "4.1.5", - "new-github-issue-url": "0.2.1", - "node-fetch": "2.6.11", - "npm-packlist": "5.1.3", - "open": "7.4.2", - "p-map": "4.0.0", - "prompts": "2.4.2", - "read-pkg-up": "7.0.1", - "replace-string": "3.1.0", - "resolve": "1.22.2", - "string-width": "4.2.3", - "strip-ansi": "6.0.1", - "strip-indent": "3.0.0", - "temp-dir": "2.0.0", - "temp-write": "4.0.0", - "tempy": "1.0.1", - "terminal-link": "2.1.1", - "tmp": "0.2.1", - "ts-pattern": "4.3.0" - } - }, - "node_modules/@prisma/internals-v5": { - "name": "@prisma/internals", - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/@prisma/internals/-/internals-5.12.1.tgz", - "integrity": "sha512-g6j9KebTSPVfGs3s9V6ImaDiTGBSAwVlde98wmvTFJzineVTclrCbmYmqnZKtPE9PLKUJXPsQVIDL/P9/dENbw==", - "dependencies": { - "@prisma/debug": "5.12.1", - "@prisma/engines": "5.12.1", - "@prisma/fetch-engine": "5.12.1", - "@prisma/generator-helper": "5.12.1", - "@prisma/get-platform": "5.12.1", - "@prisma/prisma-schema-wasm": "5.12.0-21.473ed3124229e22d881cb7addf559799debae1ab", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@prisma/internals/-/internals-5.7.0.tgz", + "integrity": "sha512-O9x47W1DECAyvNjYUx6oZHmTX10emKuBgsFHZemUbkIcJdCsp3X8Cy2JMJ5z3hqkRX6a6omMamFsWjuTARoaSw==", + "dependencies": { + "@prisma/debug": "5.7.0", + "@prisma/engines": "5.7.0", + "@prisma/fetch-engine": "5.7.0", + "@prisma/generator-helper": "5.7.0", + "@prisma/get-platform": "5.7.0", + "@prisma/prisma-schema-wasm": "5.7.0-41.79fb5193cf0a8fdbef536e4b4a159cad677ab1b9", "arg": "5.0.2", "prompts": "2.4.2" } }, - "node_modules/@prisma/internals-v5/node_modules/@prisma/engines": { - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.12.1.tgz", - "integrity": "sha512-HQDdglLw2bZR/TXD2Y+YfDMvi5Q8H+acbswqOsWyq9pPjBLYJ6gzM+ptlTU/AV6tl0XSZLU1/7F4qaWa8bqpJA==", - "hasInstallScript": true, - "dependencies": { - "@prisma/debug": "5.12.1", - "@prisma/engines-version": "5.12.0-21.473ed3124229e22d881cb7addf559799debae1ab", - "@prisma/fetch-engine": "5.12.1", - "@prisma/get-platform": "5.12.1" - } - }, - "node_modules/@prisma/internals-v5/node_modules/@prisma/engines-version": { - "version": "5.12.0-21.473ed3124229e22d881cb7addf559799debae1ab", - "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.12.0-21.473ed3124229e22d881cb7addf559799debae1ab.tgz", - "integrity": "sha512-6yvO8s80Tym61aB4QNtYZfWVmE3pwqe807jEtzm8C5VDe7nw8O1FGX3TXUaXmWV0fQTIAfRbeL2Gwrndabp/0g==" - }, - "node_modules/@prisma/internals-v5/node_modules/@prisma/fetch-engine": { - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.12.1.tgz", - "integrity": "sha512-qSs3KcX1HKcea1A+hlJVK/ljj0PNIUHDxAayGMvgJBqmaN32P9tCidlKz1EGv6WoRFICYnk3Dd/YFLBwnFIozA==", - "dependencies": { - "@prisma/debug": "5.12.1", - "@prisma/engines-version": "5.12.0-21.473ed3124229e22d881cb7addf559799debae1ab", - "@prisma/get-platform": "5.12.1" - } - }, - "node_modules/@prisma/internals-v5/node_modules/@prisma/get-platform": { - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.12.1.tgz", - "integrity": "sha512-pgIR+pSvhYHiUcqXVEZS31NrFOTENC9yFUdEAcx7cdQBoZPmHVjtjN4Ss6NzVDMYPrKJJ51U14EhEoeuBlMioQ==", - "dependencies": { - "@prisma/debug": "5.12.1" - } - }, - "node_modules/@prisma/internals/node_modules/@prisma/debug": { - "version": "4.16.2", - "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-4.16.2.tgz", - "integrity": "sha512-7L7WbG0qNNZYgLpsVB8rCHCXEyHFyIycRlRDNwkVfjQmACC2OW6AWCYCbfdjQhkF/t7+S3njj8wAWAocSs+Brw==", - "dependencies": { - "@types/debug": "4.1.8", - "debug": "4.3.4", - "strip-ansi": "6.0.1" - } - }, - "node_modules/@prisma/internals/node_modules/@prisma/generator-helper": { - "version": "4.16.2", - "resolved": "https://registry.npmjs.org/@prisma/generator-helper/-/generator-helper-4.16.2.tgz", - "integrity": "sha512-bMOH7y73Ui7gpQrioFeavMQA+Tf8ksaVf8Nhs9rQNzuSg8SSV6E9baczob0L5KGZTSgYoqnrRxuo03kVJYrnIg==", - "dependencies": { - "@prisma/debug": "4.16.2", - "@types/cross-spawn": "6.0.2", - "cross-spawn": "7.0.3", - "kleur": "4.1.5" - } - }, - "node_modules/@prisma/prisma-fmt-wasm": { - "version": "4.16.1-1.4bc8b6e1b66cb932731fb1bdbbc550d1e010de81", - "resolved": "https://registry.npmjs.org/@prisma/prisma-fmt-wasm/-/prisma-fmt-wasm-4.16.1-1.4bc8b6e1b66cb932731fb1bdbbc550d1e010de81.tgz", - "integrity": "sha512-g090+dEH7wrdCw359+8J9+TGH84qK28V/dxwINjhhNCtju9lej99z9w/AVsJP9UhhcCPS4psYz4iu8d53uxVpA==" - }, "node_modules/@prisma/prisma-schema-wasm": { - "version": "5.12.0-21.473ed3124229e22d881cb7addf559799debae1ab", - "resolved": "https://registry.npmjs.org/@prisma/prisma-schema-wasm/-/prisma-schema-wasm-5.12.0-21.473ed3124229e22d881cb7addf559799debae1ab.tgz", - "integrity": "sha512-93HT3McC6z6a+2mmHLZVjLz0M0YR4t0CZcsq4HnU0aMWwC9CottwDZvABIPacWqPSXb+5ZnTVybgpZ+Cj1i0rA==" + "version": "5.7.0-41.79fb5193cf0a8fdbef536e4b4a159cad677ab1b9", + "resolved": "https://registry.npmjs.org/@prisma/prisma-schema-wasm/-/prisma-schema-wasm-5.7.0-41.79fb5193cf0a8fdbef536e4b4a159cad677ab1b9.tgz", + "integrity": "sha512-w+HdQtux0dJDEn6BG3fgNn+fXErXiekj9n//uHRAgrmZghockJkhnikOmG8aSXjTb1Tu5DrGasBX+rYX6rHT1w==" }, "node_modules/@rushstack/eslint-patch": { "version": "1.3.2", @@ -1027,23 +872,8 @@ "node_modules/@types/bcryptjs": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/@types/bcryptjs/-/bcryptjs-2.4.2.tgz", - "integrity": "sha512-LiMQ6EOPob/4yUL66SZzu6Yh77cbzJFYll+ZfaPiPPFswtIlA/Fs1MzdKYA7JApHU49zQTbJGX3PDmCpIdDBRQ==" - }, - "node_modules/@types/cross-spawn": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@types/cross-spawn/-/cross-spawn-6.0.2.tgz", - "integrity": "sha512-KuwNhp3eza+Rhu8IFI5HUXRP0LIhqH5cAjubUvGXXthh4YYBuP2ntwEX+Cz8GJoZUHlKo247wPWOfA9LYEq4cw==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/debug": { - "version": "4.1.8", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.8.tgz", - "integrity": "sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ==", - "dependencies": { - "@types/ms": "*" - } + "integrity": "sha512-LiMQ6EOPob/4yUL66SZzu6Yh77cbzJFYll+ZfaPiPPFswtIlA/Fs1MzdKYA7JApHU49zQTbJGX3PDmCpIdDBRQ==", + "dev": true }, "node_modules/@types/json-schema": { "version": "7.0.15", @@ -1057,20 +887,11 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, - "node_modules/@types/ms": { - "version": "0.7.34", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", - "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" - }, "node_modules/@types/node": { "version": "14.18.53", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.53.tgz", - "integrity": "sha512-soGmOpVBUq+gaBMwom1M+krC/NNbWlosh4AtGA03SyWNDiqSKtwp7OulO1M6+mg8YkHMvJ/y0AkCeO8d1hNb7A==" - }, - "node_modules/@types/normalize-package-data": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", - "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==" + "integrity": "sha512-soGmOpVBUq+gaBMwom1M+krC/NNbWlosh4AtGA03SyWNDiqSKtwp7OulO1M6+mg8YkHMvJ/y0AkCeO8d1hNb7A==", + "dev": true }, "node_modules/@types/prop-types": { "version": "15.7.5", @@ -1098,11 +919,6 @@ "@types/react": "*" } }, - "node_modules/@types/retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==" - }, "node_modules/@types/scheduler": { "version": "0.16.3", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.3.tgz", @@ -1326,27 +1142,27 @@ } }, "node_modules/@zenstackhq/language": { - "version": "1.12.4", - "resolved": "https://registry.npmjs.org/@zenstackhq/language/-/language-1.12.4.tgz", - "integrity": "sha512-WKhmT/57lVFJk6Ry0nK78+QWglZ2HxHiXFMK7ueiGgSAzExDK01AONVz/1NxpF3ogSmK7BBqdh4oFtyAq+LUwQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@zenstackhq/language/-/language-2.0.0.tgz", + "integrity": "sha512-zNdpzlXUzRQ4EA2Noj7aZcnjAOVSEBeZbYk+ie6UhxkUlj/Gm/IjN9I5VlFOqQXAUp5k5S1R2QM2+KR8zyE8nw==", "dependencies": { "langium": "1.3.1" } }, "node_modules/@zenstackhq/runtime": { - "version": "1.12.4", - "resolved": "https://registry.npmjs.org/@zenstackhq/runtime/-/runtime-1.12.4.tgz", - "integrity": "sha512-jkF+/bDud5z/Q1bWJGIfWjLmH30Yru8Ip4G4sfG3B7SZZvGpRWYmUTV3LDqlbs62FwWwZO5HjLkHyAPIHexq8Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@zenstackhq/runtime/-/runtime-2.0.0.tgz", + "integrity": "sha512-v8Sjvu9zGySfA9xVdD2/H/sbxp2EAEWRT9ZyzGqpjpOZk+QMjQER5RcdfLNipyjLitq7hBuF2iQ1NE9nh0kgQA==", "dependencies": { - "@types/bcryptjs": "^2.4.2", "bcryptjs": "^2.4.3", "buffer": "^6.0.3", "change-case": "^4.1.2", - "colors": "1.4.0", "decimal.js": "^10.4.2", "deepcopy": "^2.1.0", + "deepmerge": "^4.3.1", "lower-case-first": "^2.0.2", "pluralize": "^8.0.0", + "safe-json-stringify": "^1.2.0", "semver": "^7.5.2", "superjson": "^1.11.0", "tiny-invariant": "^1.3.1", @@ -1355,6 +1171,9 @@ "uuid": "^9.0.0", "zod": "^3.22.4", "zod-validation-error": "^1.5.0" + }, + "peerDependencies": { + "@prisma/client": "5.0.0 - 5.12.x" } }, "node_modules/@zenstackhq/runtime/node_modules/uuid": { @@ -1370,33 +1189,33 @@ } }, "node_modules/@zenstackhq/sdk": { - "version": "1.12.4", - "resolved": "https://registry.npmjs.org/@zenstackhq/sdk/-/sdk-1.12.4.tgz", - "integrity": "sha512-syqdy0v+kmyoMcnRpaapc2GL/3nmdzgNlmqxVH/GAmHN8GNvEvMHsse8mUUz46vIvbkUxE7QkM1ohcIcCk/WsA==", - "dependencies": { - "@prisma/generator-helper": "^5.0.0", - "@prisma/internals": "^4.16.0", - "@prisma/internals-v5": "npm:@prisma/internals@^5.0.0", - "@zenstackhq/language": "1.12.4", - "@zenstackhq/runtime": "1.12.4", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@zenstackhq/sdk/-/sdk-2.0.0.tgz", + "integrity": "sha512-J84ZSJtZgOHmDxbhRncjR3fIe9JhiJa9YqwIg3ZacjFSyCEjPlkDQdwauoXUW0Fk4/ufW0T3lOgCpJ5Z20tckQ==", + "dependencies": { + "@prisma/generator-helper": "5.7.0", + "@prisma/internals": "5.7.0", + "@zenstackhq/language": "2.0.0", + "@zenstackhq/runtime": "2.0.0", + "langium": "1.3.1", "lower-case-first": "^2.0.2", - "prettier": "^2.8.3 || 3.x", "semver": "^7.5.2", "ts-morph": "^16.0.0", + "ts-pattern": "^4.3.0", "upper-case-first": "^2.0.2" } }, "node_modules/@zenstackhq/server": { - "version": "1.12.4", - "resolved": "https://registry.npmjs.org/@zenstackhq/server/-/server-1.12.4.tgz", - "integrity": "sha512-BxrvQRpwZZjiYC8hrSmDO+Oi53mx2NdX5z9TQeJGhSimHOlsRMtUclafmb6sC9weUYlKfae56GsPrs989Dr6hA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@zenstackhq/server/-/server-2.0.0.tgz", + "integrity": "sha512-lGDgsnwoIrcIV94hsW/uFZUaDF9q9ORYSjGHv20Y7AF3HKdIWYZqZddz6nDTqHwmwYYtQsIrnDWscMYpDFsEww==", "dependencies": { - "@zenstackhq/runtime": "1.12.4", + "@zenstackhq/runtime": "2.0.0", "change-case": "^4.1.2", "lower-case-first": "^2.0.2", "superjson": "^1.11.0", "tiny-invariant": "^1.3.1", - "ts-japi": "^1.8.0", + "ts-japi": "^1.10.1", "upper-case-first": "^2.0.2", "url-pattern": "^1.0.3", "zod": "^3.22.4", @@ -1404,13 +1223,12 @@ } }, "node_modules/@zenstackhq/tanstack-query": { - "version": "1.12.4", - "resolved": "https://registry.npmjs.org/@zenstackhq/tanstack-query/-/tanstack-query-1.12.4.tgz", - "integrity": "sha512-URnvAtlBKuMhEjYv/V0zgI2wTKp+ZDYueADQNpg1Zfde6pWvF8vhA3Xb3cfauxJJFjcfVrhKMzruX8QL3e+IEA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@zenstackhq/tanstack-query/-/tanstack-query-2.0.0.tgz", + "integrity": "sha512-pSp+5n34vZAT1r1NPaIdW7ttmv4ZGZit5W1926yZyEB1aZwvgjhXJTmNgaD0i7EDJmLY5iemIj1R2dSpuByzwg==", "dependencies": { - "@prisma/generator-helper": "^5.0.0", - "@zenstackhq/runtime": "1.12.4", - "@zenstackhq/sdk": "1.12.4", + "@zenstackhq/runtime": "2.0.0", + "@zenstackhq/sdk": "2.0.0", "change-case": "^4.1.2", "cross-fetch": "^4.0.0", "decimal.js": "^10.4.2", @@ -1418,6 +1236,7 @@ "semver": "^7.5.2", "superjson": "^1.11.0", "ts-morph": "^16.0.0", + "ts-pattern": "^4.3.0", "upper-case-first": "^2.0.2" } }, @@ -1442,29 +1261,6 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/agent-base": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", - "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", - "dependencies": { - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -1490,35 +1286,11 @@ "node": ">=6" } }, - "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dependencies": { - "type-fest": "^0.21.3" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ansi-escapes/node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, "engines": { "node": ">=8" } @@ -1527,6 +1299,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -1556,75 +1329,6 @@ "node": ">= 8" } }, - "node_modules/archiver": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/archiver/-/archiver-5.3.1.tgz", - "integrity": "sha512-8KyabkmbYrH+9ibcTScQ1xCJC/CGcugdVIwB+53f5sZziXgwUh3iXlAlANMxcZyDEfTHMe6+Z5FofV8nopXP7w==", - "dependencies": { - "archiver-utils": "^2.1.0", - "async": "^3.2.3", - "buffer-crc32": "^0.2.1", - "readable-stream": "^3.6.0", - "readdir-glob": "^1.0.0", - "tar-stream": "^2.2.0", - "zip-stream": "^4.1.0" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/archiver-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-2.1.0.tgz", - "integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==", - "dependencies": { - "glob": "^7.1.4", - "graceful-fs": "^4.2.0", - "lazystream": "^1.0.0", - "lodash.defaults": "^4.2.0", - "lodash.difference": "^4.5.0", - "lodash.flatten": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.union": "^4.6.0", - "normalize-path": "^3.0.0", - "readable-stream": "^2.0.0" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/archiver-utils/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" - }, - "node_modules/archiver-utils/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/archiver-utils/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/archiver-utils/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/arg": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", @@ -1684,6 +1388,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, "engines": { "node": ">=8" } @@ -1767,15 +1472,11 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true, "engines": { "node": ">=8" } }, - "node_modules/async": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", - "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==" - }, "node_modules/async-exit-hook": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/async-exit-hook/-/async-exit-hook-2.0.1.tgz", @@ -1907,6 +1608,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -1917,6 +1619,7 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, "funding": [ { "type": "github", @@ -1940,6 +1643,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2011,14 +1715,6 @@ "ieee754": "^1.2.1" } }, - "node_modules/buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", - "engines": { - "node": "*" - } - }, "node_modules/busboy": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", @@ -2133,28 +1829,6 @@ "tslib": "^2.0.3" } }, - "node_modules/checkpoint-client": { - "version": "1.1.24", - "resolved": "https://registry.npmjs.org/checkpoint-client/-/checkpoint-client-1.1.24.tgz", - "integrity": "sha512-nIOlLhDS7MKs4tUzS3LCm+sE1NgTCVnVrXlD0RRxaoEkkLu8LIWSUNiNWai6a+LK5unLzTyZeTCYX1Smqy0YoA==", - "dependencies": { - "ci-info": "3.8.0", - "env-paths": "2.2.1", - "fast-write-atomic": "0.2.1", - "make-dir": "3.1.0", - "ms": "2.1.3", - "node-fetch": "2.6.11", - "uuid": "9.0.0" - } - }, - "node_modules/checkpoint-client/node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/chevrotain": { "version": "10.4.2", "resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-10.4.2.tgz", @@ -2206,28 +1880,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/ci-info": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", - "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "engines": { - "node": ">=8" - } - }, - "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "engines": { - "node": ">=6" - } - }, "node_modules/cli-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", @@ -2252,21 +1904,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/cli-truncate": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", - "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", - "dependencies": { - "slice-ansi": "^3.0.0", - "string-width": "^4.2.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/client-only": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", @@ -2298,6 +1935,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -2308,12 +1946,14 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true, "engines": { "node": ">=0.1.90" } @@ -2327,29 +1967,11 @@ "node": ">= 6" } }, - "node_modules/commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==" - }, - "node_modules/compress-commons": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-4.1.2.tgz", - "integrity": "sha512-D3uMHtGc/fcO1Gt1/L7i1e33VOvD4A9hfQLP+6ewd+BvG/gQ84Yh4oftEhAdjSMgBgwGL+jsppT7JYNpo6MHHg==", - "dependencies": { - "buffer-crc32": "^0.2.13", - "crc32-stream": "^4.0.2", - "normalize-path": "^3.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">= 10" - } - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, "node_modules/config-chain": { "version": "1.1.13", @@ -2402,30 +2024,8 @@ "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" - }, - "node_modules/crc-32": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", - "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", - "bin": { - "crc32": "bin/crc32.njs" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/crc32-stream": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-4.0.3.tgz", - "integrity": "sha512-NT7w2JVU7DFroFdYkeq8cywxrgjPHWkdX1wjpRQXPX5Asews3tA+Ght6lddQO5Mkumffp3X7GEqku3epj2toIw==", - "dependencies": { - "crc-32": "^1.2.0", - "readable-stream": "^3.4.0" - }, - "engines": { - "node": ">= 10" - } + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true }, "node_modules/cross-fetch": { "version": "4.0.0", @@ -2458,6 +2058,7 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -2467,14 +2068,6 @@ "node": ">= 8" } }, - "node_modules/crypto-random-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", - "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", - "engines": { - "node": ">=8" - } - }, "node_modules/css-selector-tokenizer": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.8.0.tgz", @@ -2537,6 +2130,7 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -2552,7 +2146,8 @@ "node_modules/debug/node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/decimal.js": { "version": "10.4.3", @@ -2597,6 +2192,14 @@ "type-detect": "^4.0.8" } }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/defaults": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", @@ -2625,27 +2228,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/del": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/del/-/del-6.1.1.tgz", - "integrity": "sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg==", - "dependencies": { - "globby": "^11.0.1", - "graceful-fs": "^4.2.4", - "is-glob": "^4.0.1", - "is-path-cwd": "^2.2.0", - "is-path-inside": "^3.0.2", - "p-map": "^4.0.0", - "rimraf": "^3.0.2", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/dequal": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", @@ -2665,6 +2247,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, "dependencies": { "path-type": "^4.0.0" }, @@ -2699,14 +2282,6 @@ "tslib": "^2.0.3" } }, - "node_modules/dotenv": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", - "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", - "engines": { - "node": ">=12" - } - }, "node_modules/electron-to-chromium": { "version": "1.4.466", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.466.tgz", @@ -2734,14 +2309,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dependencies": { - "once": "^1.4.0" - } - }, "node_modules/enquirer": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", @@ -2754,22 +2321,6 @@ "node": ">=8.6" } }, - "node_modules/env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "engines": { - "node": ">=6" - } - }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, "node_modules/es-abstract": { "version": "1.22.1", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz", @@ -2876,6 +2427,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, "engines": { "node": ">=10" }, @@ -3455,28 +3007,6 @@ "node": ">=0.10.0" } }, - "node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -3510,11 +3040,6 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, - "node_modules/fast-write-atomic": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fast-write-atomic/-/fast-write-atomic-0.2.1.tgz", - "integrity": "sha512-WvJe06IfNYlr+6cO3uQkdKdy3Cb1LlCJSF8zRs2eT8yuhdbSlR9nIt+TgQ92RUxiRrQm+/S7RARnMfCs5iuAjw==" - }, "node_modules/fastparse": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.2.tgz", @@ -3564,37 +3089,6 @@ "node": ">=8" } }, - "node_modules/find-cache-dir": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", - "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", - "dependencies": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/avajs/find-cache-dir?sponsor=1" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -3652,11 +3146,6 @@ "node": ">=0.4.x" } }, - "node_modules/fp-ts": { - "version": "2.16.0", - "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-2.16.0.tgz", - "integrity": "sha512-bLq+KgbiXdTEoT1zcARrWEpa5z6A/8b7PcDW7Gef3NSisQ+VS7ll2Xbf1E+xsgik0rWub/8u0qP/iTTjj+PhxQ==" - }, "node_modules/fraction.js": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.2.0.tgz", @@ -3716,55 +3205,11 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, - "node_modules/fs-extra": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", - "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, - "node_modules/fs-jetpack": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/fs-jetpack/-/fs-jetpack-5.1.0.tgz", - "integrity": "sha512-Xn4fDhLydXkuzepZVsr02jakLlmoARPy+YWIclo4kh0GyNGUHnTqeH/w/qIsVn50dFxtp8otPL2t/HcPJBbxUA==", - "dependencies": { - "minimatch": "^5.1.0" - } - }, - "node_modules/fs-jetpack/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/fs-jetpack/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true }, "node_modules/fsevents": { "version": "2.3.2", @@ -3783,7 +3228,8 @@ "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, "node_modules/function.prototype.name": { "version": "1.1.5", @@ -3869,17 +3315,6 @@ "node": ">=14.18" } }, - "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/get-symbol-description": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", @@ -3900,6 +3335,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -3931,20 +3367,6 @@ "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==" }, - "node_modules/global-dirs": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", - "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", - "dependencies": { - "ini": "2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/globals": { "version": "13.20.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", @@ -3979,6 +3401,7 @@ "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -3998,6 +3421,7 @@ "version": "5.2.4", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, "engines": { "node": ">= 4" } @@ -4029,6 +3453,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -4049,6 +3474,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { "node": ">=8" } @@ -4104,29 +3530,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/hasha": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", - "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", - "dependencies": { - "is-stream": "^2.0.0", - "type-fest": "^0.8.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/hasha/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "engines": { - "node": ">=8" - } - }, "node_modules/header-case": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", @@ -4153,43 +3556,6 @@ "react-is": "^16.7.0" } }, - "node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" - }, - "node_modules/http-proxy-agent": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz", - "integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==", - "dependencies": { - "agent-base": "^7.1.0", - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/https-proxy-agent": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.0.tgz", - "integrity": "sha512-0euwPCRyAPSgGdzD1IVN9nJYHtBhJwb6XPfbpQcYbPCwrBidX6GzxmchnaF4sfF/jPb74Ojx5g4yTg3sixlyPw==", - "dependencies": { - "agent-base": "^7.0.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "engines": { - "node": ">=10.17.0" - } - }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -4218,36 +3584,6 @@ "node": ">= 4" } }, - "node_modules/ignore-walk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-5.0.1.tgz", - "integrity": "sha512-yemi4pMf51WKT7khInJqAvsIGzoqYXblnsz0ql8tM+yi1EKYTY1evX4NAbJrLL/Aanr2HyZeluqU+Oi7MGHokw==", - "dependencies": { - "minimatch": "^5.0.1" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/ignore-walk/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/ignore-walk/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -4273,18 +3609,11 @@ "node": ">=0.8.19" } }, - "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "engines": { - "node": ">=8" - } - }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -4293,15 +3622,8 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ini": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", - "engines": { - "node": ">=10" - } + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "node_modules/internal-slot": { "version": "1.0.5", @@ -4347,11 +3669,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" - }, "node_modules/is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", @@ -4408,6 +3725,7 @@ "version": "2.13.0", "resolved": "https://preview.registry.zenstack.dev/is-core-module/-/is-core-module-2.13.0.tgz", "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "dev": true, "dependencies": { "has": "^1.0.3" }, @@ -4430,20 +3748,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "bin": { - "is-docker": "cli.js" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -4456,6 +3760,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, "engines": { "node": ">=8" } @@ -4515,22 +3820,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-path-cwd": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", - "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", - "engines": { - "node": ">=6" - } - }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "engines": { - "node": ">=8" - } - }, "node_modules/is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -4575,6 +3864,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, "engines": { "node": ">=8" }, @@ -4662,25 +3952,6 @@ "url": "https://github.com/sponsors/mesqueeb" } }, - "node_modules/is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "dependencies": { - "is-docker": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", @@ -4690,7 +3961,8 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true }, "node_modules/jiti": { "version": "1.19.1", @@ -4727,11 +3999,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" - }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -4756,17 +4023,6 @@ "json5": "lib/cli.js" } }, - "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, "node_modules/jsx-ast-utils": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.4.tgz", @@ -4783,9 +4039,9 @@ } }, "node_modules/kleur": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", - "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", "engines": { "node": ">=6" } @@ -4853,49 +4109,6 @@ "language-subtag-registry": "~0.3.2" } }, - "node_modules/lazystream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", - "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", - "dependencies": { - "readable-stream": "^2.0.5" - }, - "engines": { - "node": ">= 0.6.3" - } - }, - "node_modules/lazystream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" - }, - "node_modules/lazystream/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/lazystream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/lazystream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -4921,47 +4134,14 @@ "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "node_modules/lodash.defaults": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", - "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==" - }, - "node_modules/lodash.difference": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", - "integrity": "sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA==" - }, - "node_modules/lodash.flatten": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==" - }, - "node_modules/lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -4974,11 +4154,6 @@ "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", "dev": true }, - "node_modules/lodash.union": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", - "integrity": "sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw==" - }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -5047,33 +4222,6 @@ "node": ">=10" } }, - "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" - }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -5098,6 +4246,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, "engines": { "node": ">=6" } @@ -5114,18 +4263,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/min-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", - "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", - "engines": { - "node": ">=4" - } - }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -5201,7 +4343,8 @@ "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true }, "node_modules/mz": { "version": "2.7.0", @@ -5237,14 +4380,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "node_modules/new-github-issue-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/new-github-issue-url/-/new-github-issue-url-0.2.1.tgz", - "integrity": "sha512-md4cGoxuT4T4d/HDOXbrUHkTKrp/vp+m3aOA7XXVYwNsUNMK49g3SQicTSeV5GIz/5QVGAeYRAOlyp9OvlgsYA==", - "engines": { - "node": ">=10" - } - }, "node_modules/next": { "version": "14.0.3", "resolved": "https://registry.npmjs.org/next/-/next-14.0.3.tgz", @@ -5326,54 +4461,17 @@ "tslib": "^2.0.3" } }, - "node_modules/node-fetch": { - "version": "2.6.11", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz", - "integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/node-releases": { "version": "2.0.13", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", "dev": true }, - "node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "node_modules/normalize-package-data/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "bin": { - "semver": "bin/semver" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -5387,90 +4485,6 @@ "node": ">=0.10.0" } }, - "node_modules/npm-bundled": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-2.0.1.tgz", - "integrity": "sha512-gZLxXdjEzE/+mOstGDqR6b0EkhJ+kM6fxM6vUuckuctuVPh80Q6pw/rSZj9s4Gex9GxWtIicO1pc8DB9KZWudw==", - "dependencies": { - "npm-normalize-package-bin": "^2.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/npm-normalize-package-bin": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz", - "integrity": "sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==", - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/npm-packlist": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.1.3.tgz", - "integrity": "sha512-263/0NGrn32YFYi4J533qzrQ/krmmrWwhKkzwTuM4f/07ug51odoaNjUexxO4vxlzURHcmYMH1QjvHjsNDKLVg==", - "dependencies": { - "glob": "^8.0.1", - "ignore-walk": "^5.0.1", - "npm-bundled": "^2.0.0", - "npm-normalize-package-bin": "^2.0.0" - }, - "bin": { - "npm-packlist": "bin/index.js" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/npm-packlist/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/npm-packlist/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/npm-packlist/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dependencies": { - "path-key": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/oauth": { "version": "0.9.15", "resolved": "https://registry.npmjs.org/oauth/-/oauth-0.9.15.tgz", @@ -5602,6 +4616,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, "dependencies": { "wrappy": "1" } @@ -5610,6 +4625,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, "dependencies": { "mimic-fn": "^2.1.0" }, @@ -5620,21 +4636,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/open": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", - "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", - "dependencies": { - "is-docker": "^2.0.0", - "is-wsl": "^2.1.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/openid-client": { "version": "5.4.3", "resolved": "https://registry.npmjs.org/openid-client/-/openid-client-5.4.3.tgz", @@ -5689,25 +4690,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-filter": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-2.1.0.tgz", - "integrity": "sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==", - "dependencies": { - "p-map": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-filter/node_modules/p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "engines": { - "node": ">=6" - } - }, "node_modules/p-is-promise": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", @@ -5717,68 +4699,6 @@ "node": ">=8" } }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "dependencies": { - "aggregate-error": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-retry": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz", - "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==", - "dependencies": { - "@types/retry": "0.12.0", - "retry": "^0.13.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "engines": { - "node": ">=6" - } - }, "node_modules/param-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", @@ -5800,23 +4720,6 @@ "node": ">=6" } }, - "node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/pascal-case": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", @@ -5840,18 +4743,11 @@ "tslib": "^2.0.3" } }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "engines": { - "node": ">=8" - } - }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -5860,6 +4756,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, "engines": { "node": ">=8" } @@ -5867,12 +4764,14 @@ "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, "engines": { "node": ">=8" } @@ -5911,65 +4810,6 @@ "node": ">= 6" } }, - "node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/pkg-dir/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/pluralize": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", @@ -6124,20 +4964,6 @@ "node": ">= 0.8.0" } }, - "node_modules/prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, "node_modules/pretty-format": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-3.8.0.tgz", @@ -6159,31 +4985,77 @@ } }, "node_modules/prisma": { - "version": "4.16.2", - "resolved": "https://registry.npmjs.org/prisma/-/prisma-4.16.2.tgz", - "integrity": "sha512-SYCsBvDf0/7XSJyf2cHTLjLeTLVXYfqp7pG5eEVafFLeT0u/hLFz/9W196nDRGUOo1JfPatAEb+uEnTQImQC1g==", + "version": "5.12.1", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.12.1.tgz", + "integrity": "sha512-SkMnb6wyIxTv9ACqiHBI2u9gD6y98qXRoCoLEnZsF6yee5Qg828G+ARrESN+lQHdw4maSZFFSBPPDpvSiVTo0Q==", "devOptional": true, "hasInstallScript": true, "dependencies": { - "@prisma/engines": "4.16.2" + "@prisma/engines": "5.12.1" }, "bin": { - "prisma": "build/index.js", - "prisma2": "build/index.js" + "prisma": "build/index.js" }, "engines": { - "node": ">=14.17" + "node": ">=16.13" + } + }, + "node_modules/prisma/node_modules/@prisma/debug": { + "version": "5.12.1", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.12.1.tgz", + "integrity": "sha512-kd/wNsR0klrv79o1ITsbWxYyh4QWuBidvxsXSParPsYSu0ircUmNk3q4ojsgNc3/81b0ozg76iastOG43tbf8A==", + "devOptional": true + }, + "node_modules/prisma/node_modules/@prisma/engines": { + "version": "5.12.1", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.12.1.tgz", + "integrity": "sha512-HQDdglLw2bZR/TXD2Y+YfDMvi5Q8H+acbswqOsWyq9pPjBLYJ6gzM+ptlTU/AV6tl0XSZLU1/7F4qaWa8bqpJA==", + "devOptional": true, + "hasInstallScript": true, + "dependencies": { + "@prisma/debug": "5.12.1", + "@prisma/engines-version": "5.12.0-21.473ed3124229e22d881cb7addf559799debae1ab", + "@prisma/fetch-engine": "5.12.1", + "@prisma/get-platform": "5.12.1" + } + }, + "node_modules/prisma/node_modules/@prisma/engines-version": { + "version": "5.12.0-21.473ed3124229e22d881cb7addf559799debae1ab", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.12.0-21.473ed3124229e22d881cb7addf559799debae1ab.tgz", + "integrity": "sha512-6yvO8s80Tym61aB4QNtYZfWVmE3pwqe807jEtzm8C5VDe7nw8O1FGX3TXUaXmWV0fQTIAfRbeL2Gwrndabp/0g==", + "devOptional": true + }, + "node_modules/prisma/node_modules/@prisma/fetch-engine": { + "version": "5.12.1", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.12.1.tgz", + "integrity": "sha512-qSs3KcX1HKcea1A+hlJVK/ljj0PNIUHDxAayGMvgJBqmaN32P9tCidlKz1EGv6WoRFICYnk3Dd/YFLBwnFIozA==", + "devOptional": true, + "dependencies": { + "@prisma/debug": "5.12.1", + "@prisma/engines-version": "5.12.0-21.473ed3124229e22d881cb7addf559799debae1ab", + "@prisma/get-platform": "5.12.1" + } + }, + "node_modules/prisma/node_modules/@prisma/get-platform": { + "version": "5.12.1", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.12.1.tgz", + "integrity": "sha512-pgIR+pSvhYHiUcqXVEZS31NrFOTENC9yFUdEAcx7cdQBoZPmHVjtjN4Ss6NzVDMYPrKJJ51U14EhEoeuBlMioQ==", + "devOptional": true, + "dependencies": { + "@prisma/debug": "5.12.1" } }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true }, "node_modules/progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, "engines": { "node": ">=0.4.0" } @@ -6213,18 +5085,10 @@ "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", "dependencies": { "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/prompts/node_modules/kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "sisteransi": "^1.0.5" + }, "engines": { - "node": ">=6" + "node": ">= 6" } }, "node_modules/prop-types": { @@ -6351,104 +5215,11 @@ "pify": "^2.3.0" } }, - "node_modules/read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "dependencies": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", - "dependencies": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/read-pkg-up/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/read-pkg-up/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/read-pkg-up/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/read-pkg-up/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/read-pkg-up/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "engines": { - "node": ">=8" - } - }, - "node_modules/read-pkg/node_modules/type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "engines": { - "node": ">=8" - } - }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -6458,33 +5229,6 @@ "node": ">= 6" } }, - "node_modules/readdir-glob": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/readdir-glob/-/readdir-glob-1.1.3.tgz", - "integrity": "sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==", - "dependencies": { - "minimatch": "^5.1.0" - } - }, - "node_modules/readdir-glob/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/readdir-glob/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -6560,17 +5304,6 @@ "node": ">=8" } }, - "node_modules/replace-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/replace-string/-/replace-string-3.1.0.tgz", - "integrity": "sha512-yPpxc4ZR2makceA9hy/jHNqc7QVkd4Je/N0WRHm6bs3PtivPuPynxE5ejU/mp5EhnCv8+uZL7vhz8rkluSlx+Q==", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", @@ -6584,6 +5317,7 @@ "version": "1.22.2", "resolved": "https://dolphin-app-nyvr5.ondigitalocean.app/resolve/-/resolve-1.22.2.tgz", "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "dev": true, "dependencies": { "is-core-module": "^2.11.0", "path-parse": "^1.0.7", @@ -6618,14 +5352,6 @@ "node": ">=8" } }, - "node_modules/retry": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", - "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", - "engines": { - "node": ">= 4" - } - }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -6639,6 +5365,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, "dependencies": { "glob": "^7.1.3" }, @@ -6693,6 +5420,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, "funding": [ { "type": "github", @@ -6708,6 +5436,11 @@ } ] }, + "node_modules/safe-json-stringify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz", + "integrity": "sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==" + }, "node_modules/safe-regex-test": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", @@ -6758,6 +5491,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -6769,6 +5503,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, "engines": { "node": ">=8" } @@ -6790,7 +5525,8 @@ "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true }, "node_modules/sisteransi": { "version": "1.0.5", @@ -6801,6 +5537,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, "engines": { "node": ">=8" } @@ -6811,19 +5548,6 @@ "integrity": "sha512-UHYzVpz9Xn8b+jikYSD6bqvf754xL2uBUzDFwiU6NcdZeifPr6UfgU43xpkPu67VMS88+TI2PSI7Eohgqf2fKA==", "dev": true }, - "node_modules/slice-ansi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", - "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/snake-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", @@ -6841,34 +5565,6 @@ "node": ">=0.10.0" } }, - "node_modules/spdx-correct": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", - "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-exceptions": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", - "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==" - }, - "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-license-ids": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", - "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==" - }, "node_modules/speedometer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/speedometer/-/speedometer-1.0.0.tgz", @@ -6893,6 +5589,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, "dependencies": { "safe-buffer": "~5.2.0" } @@ -6901,6 +5598,7 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -6913,7 +5611,8 @@ "node_modules/string-width/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, "node_modules/string.prototype.matchall": { "version": "4.0.8", @@ -6983,6 +5682,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -7008,25 +5708,6 @@ "node": ">=0.10.0" } }, - "node_modules/strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "engines": { - "node": ">=6" - } - }, - "node_modules/strip-indent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", - "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", - "dependencies": { - "min-indent": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -7118,6 +5799,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -7125,22 +5807,11 @@ "node": ">=8" } }, - "node_modules/supports-hyperlinks": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz", - "integrity": "sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA==", - "dependencies": { - "has-flag": "^4.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -7290,105 +5961,6 @@ } } }, - "node_modules/tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "dependencies": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/temp-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", - "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/temp-write": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/temp-write/-/temp-write-4.0.0.tgz", - "integrity": "sha512-HIeWmj77uOOHb0QX7siN3OtwV3CTntquin6TNVg6SHOqCP3hYKmox90eeFOGaY1MqJ9WYDDjkyZrW6qS5AWpbw==", - "dependencies": { - "graceful-fs": "^4.1.15", - "is-stream": "^2.0.0", - "make-dir": "^3.0.0", - "temp-dir": "^1.0.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/temp-write/node_modules/temp-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz", - "integrity": "sha512-xZFXEGbG7SNC3itwBzI3RYjq/cEhBkx2hJuKGIUOcEULmkQExXiHat2z/qkISYsuR+IKumhEfKKbV5qXmhICFQ==", - "engines": { - "node": ">=4" - } - }, - "node_modules/temp-write/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "bin": { - "uuid": "bin/uuid" - } - }, - "node_modules/tempy": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tempy/-/tempy-1.0.1.tgz", - "integrity": "sha512-biM9brNqxSc04Ee71hzFbryD11nX7VPhQQY32AdDmjFvodsRFz/3ufeoTZ6uYkRFfGo188tENcASNs3vTdsM0w==", - "dependencies": { - "del": "^6.0.0", - "is-stream": "^2.0.0", - "temp-dir": "^2.0.0", - "type-fest": "^0.16.0", - "unique-string": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/tempy/node_modules/type-fest": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.16.0.tgz", - "integrity": "sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/terminal-link": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", - "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", - "dependencies": { - "ansi-escapes": "^4.2.1", - "supports-hyperlinks": "^2.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -7467,17 +6039,6 @@ "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==" }, - "node_modules/tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "dependencies": { - "rimraf": "^3.0.0" - }, - "engines": { - "node": ">=8.17.0" - } - }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -7717,24 +6278,11 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/unique-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", - "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", - "dependencies": { - "crypto-random-string": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "engines": { - "node": ">= 10.0.0" - } + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true }, "node_modules/update-browserslist-db": { "version": "1.0.11", @@ -7802,7 +6350,8 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true }, "node_modules/uuid": { "version": "8.3.2", @@ -7818,15 +6367,6 @@ "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", "dev": true }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, "node_modules/vscode-jsonrpc": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", @@ -7963,6 +6503,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -8011,7 +6552,8 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true }, "node_modules/xtend": { "version": "4.0.2", @@ -8036,28 +6578,17 @@ "node": ">= 14" } }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/zenstack": { - "version": "1.12.4", - "resolved": "https://registry.npmjs.org/zenstack/-/zenstack-1.12.4.tgz", - "integrity": "sha512-r1QaiGixzJFk42nbcQ92dC7a6aKG4+9CW98fF4iJexAb4zI82oL0Yus7HNlhKPDBQbD/dFFsdgPwT2FeeavzYA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/zenstack/-/zenstack-2.0.0.tgz", + "integrity": "sha512-4QzRGLtzM/SPR00Kk3BwpWLXHBWOu5YMI8cN6Ygu0PhBOxsC5Dibq62+9mqFASGv72zMAF056utmIIIMW/wxpg==", "dev": true, "hasInstallScript": true, "dependencies": { "@paralleldrive/cuid2": "^2.2.0", - "@prisma/generator-helper": "^5.0.0", - "@zenstackhq/language": "1.12.4", - "@zenstackhq/sdk": "1.12.4", + "@types/node": "^20.12.7", + "@zenstackhq/language": "2.0.0", + "@zenstackhq/sdk": "2.0.0", "async-exit-hook": "^2.0.1", "change-case": "^4.1.2", "colors": "1.4.0", @@ -8090,7 +6621,19 @@ "zenstack": "bin/cli" }, "engines": { - "vscode": "^1.56.0" + "vscode": "^1.63.0" + }, + "peerDependencies": { + "prisma": "5.0.0 - 5.12.x" + } + }, + "node_modules/zenstack/node_modules/@types/node": { + "version": "20.12.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", + "integrity": "sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" } }, "node_modules/zenstack/node_modules/commander": { @@ -8115,39 +6658,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/zip-stream": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-4.1.1.tgz", - "integrity": "sha512-9qv4rlDiopXg4E69k+vMHjNN63YFMe9sZMrdlvKnCjlCRWeCBswPPMPUfx+ipsAWq1LXHe70RcbaHdJJpS6hyQ==", - "dependencies": { - "archiver-utils": "^3.0.4", - "compress-commons": "^4.1.2", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/zip-stream/node_modules/archiver-utils": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-3.0.4.tgz", - "integrity": "sha512-KVgf4XQVrTjhyWmx6cte4RxonPLR9onExufI1jhvw/MQ4BB6IsZD5gT8Lq+u/+pRkWna/6JoHpiQioaqFP5Rzw==", - "dependencies": { - "glob": "^7.2.3", - "graceful-fs": "^4.2.0", - "lazystream": "^1.0.0", - "lodash.defaults": "^4.2.0", - "lodash.difference": "^4.5.0", - "lodash.flatten": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.union": "^4.6.0", - "normalize-path": "^3.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">= 10" - } - }, "node_modules/zod": { "version": "3.23.0", "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.0.tgz", diff --git a/package.json b/package.json index 9b26f47..8ac2859 100644 --- a/package.json +++ b/package.json @@ -21,12 +21,12 @@ "dependencies": { "@heroicons/react": "^2.0.12", "@next-auth/prisma-adapter": "^1.0.5", - "@prisma/client": "^4.9.0", + "@prisma/client": "^5.0.0", "@tanstack/react-query": "^5.8.4", "@tanstack/react-query-devtools": "^5.8.3", - "@zenstackhq/runtime": "^1.12.4", - "@zenstackhq/server": "^1.12.4", - "@zenstackhq/tanstack-query": "^1.12.4", + "@zenstackhq/runtime": "^2.0.0", + "@zenstackhq/server": "^2.0.0", + "@zenstackhq/tanstack-query": "^2.0.0", "babel-plugin-superjson-next": "^0.4.5", "bcryptjs": "^2.4.3", "daisyui": "^4.0.7", @@ -53,9 +53,9 @@ "eslint-config-next": "12.3.1", "lower-case-first": "^2.0.2", "postcss": "^8.4.16", - "prisma": "^4.9.0", + "prisma": "^5.0.0", "tailwindcss": "^3.1.8", "typescript": "^5.3.2", - "zenstack": "^1.12.4" + "zenstack": "^2.0.0" } } diff --git a/pages/space/[slug]/[listId]/index.tsx b/pages/space/[slug]/[listId]/index.tsx index 4ae1632..6713a61 100644 --- a/pages/space/[slug]/[listId]/index.tsx +++ b/pages/space/[slug]/[listId]/index.tsx @@ -1,5 +1,4 @@ import { PlusIcon } from '@heroicons/react/24/outline'; -import { useCurrentUser } from '@lib/context'; import { useCreateTodo, useFindManyTodo } from '@lib/hooks'; import { List, Space } from '@prisma/client'; import BreadCrumb from 'components/BreadCrumb'; @@ -15,9 +14,8 @@ type Props = { }; export default function TodoList(props: Props) { - const user = useCurrentUser(); const [title, setTitle] = useState(''); - const { mutate: createTodo } = useCreateTodo(undefined, true, true); // optimistic + const { mutate: createTodo } = useCreateTodo({ optimisticUpdate: true }); const { data } = useFindManyTodo({ where: { listId: props.list.id }, @@ -37,7 +35,6 @@ export default function TodoList(props: Props) { createTodo({ data: { title, - owner: { connect: { id: user!.id } }, list: { connect: { id: props.list.id } }, }, }); diff --git a/pages/space/[slug]/index.tsx b/pages/space/[slug]/index.tsx index 3c77f0b..92e50cf 100644 --- a/pages/space/[slug]/index.tsx +++ b/pages/space/[slug]/index.tsx @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { SpaceContext, UserContext } from '@lib/context'; +import { SpaceContext } from '@lib/context'; import { useCreateList, useFindManyList } from '@lib/hooks'; import { List, Space, User } from '@prisma/client'; import BreadCrumb from 'components/BreadCrumb'; @@ -14,7 +14,6 @@ import { toast } from 'react-toastify'; import { getEnhancedPrisma } from 'server/enhanced-db'; function CreateDialog() { - const user = useContext(UserContext); const space = useContext(SpaceContext); const [modalOpen, setModalOpen] = useState(false); @@ -34,7 +33,6 @@ function CreateDialog() { title, private: _private, space: { connect: { id: space!.id } }, - owner: { connect: { id: user!.id } }, }, }); } catch (err: any) { diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 0adad92..593bc2e 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -4,18 +4,17 @@ ////////////////////////////////////////////////////////////////////////////////////////////// datasource db { - provider = "postgresql" - url = env("DATABASE_URL") + provider = "postgresql" + url = env("DATABASE_URL") } generator js { - provider = "prisma-client-js" - previewFeatures = ["extendedWhereUnique","fieldReference"] + provider = "prisma-client-js" } enum SpaceUserRole { - USER - ADMIN + USER + ADMIN } /// @@deny('all', auth() == null) @@ -23,53 +22,53 @@ enum SpaceUserRole { /// @@allow('read', members?[user == auth()]) /// @@allow('update,delete', members?[user == auth() && role == ADMIN]) model Space { - id String @id() @default(uuid()) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt() - /// @length(4, 50) - name String - /// @regex('^[0-9a-zA-Z]{4,16}$') - slug String @unique() - members SpaceUser[] - lists List[] + id String @id() @default(uuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt() + /// @length(4, 50) + name String + /// @regex('^[0-9a-zA-Z]{4,16}$') + slug String @unique() + members SpaceUser[] + lists List[] } /// @@deny('all', auth() == null) /// @@allow('create,update,delete', space.members?[user == auth() && role == ADMIN]) /// @@allow('read', space.members?[user == auth()]) model SpaceUser { - id String @id() @default(uuid()) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt() - space Space @relation(fields: [spaceId], references: [id], onDelete: Cascade) - spaceId String - user User @relation(fields: [userId], references: [id], onDelete: Cascade) - userId String - role SpaceUserRole + id String @id() @default(uuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt() + space Space @relation(fields: [spaceId], references: [id], onDelete: Cascade) + spaceId String + user User @relation(fields: [userId], references: [id], onDelete: Cascade) + userId String + role SpaceUserRole - @@unique([userId, spaceId]) + @@unique([userId, spaceId]) } /// @@allow('create', true) /// @@allow('read', spaces?[space.members?[user == auth()]]) /// @@allow('all', auth() == this) model User { - id String @id() @default(uuid()) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt() - /// @email - email String @unique() - emailVerified DateTime? - /// @password - /// @omit - password String? - name String? - spaces SpaceUser[] - /// @url - image String? - lists List[] - todos Todo[] - accounts Account[] + id String @id() @default(uuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt() + /// @email + email String @unique() + emailVerified DateTime? + /// @password + /// @omit + password String? + name String? + spaces SpaceUser[] + /// @url + image String? + lists List[] + todos Todo[] + accounts Account[] } /// @@deny('all', auth() == null) @@ -78,17 +77,17 @@ model User { /// @@allow('update', owner == auth() && space.members?[user == auth()] && future().owner == owner) /// @@allow('delete', owner == auth()) model List { - id String @id() @default(uuid()) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt() - space Space @relation(fields: [spaceId], references: [id], onDelete: Cascade) - spaceId String - owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade) - ownerId String - /// @length(1, 100) - title String - private Boolean @default(false) - todos Todo[] + id String @id() @default(uuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt() + space Space @relation(fields: [spaceId], references: [id], onDelete: Cascade) + spaceId String + owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade) + ownerId String + /// @length(1, 100) + title String + private Boolean @default(false) + todos Todo[] } /// @@deny('all', auth() == null) @@ -96,33 +95,33 @@ model List { /// @@allow('all', list.space.members?[user == auth()] && !list.private) /// @@deny('update', future().owner != owner) model Todo { - id String @id() @default(uuid()) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt() - owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade) - ownerId String - list List @relation(fields: [listId], references: [id], onDelete: Cascade) - listId String - /// @length(1, 100) - title String - completedAt DateTime? + id String @id() @default(uuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt() + owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade) + ownerId String + list List @relation(fields: [listId], references: [id], onDelete: Cascade) + listId String + /// @length(1, 100) + title String + completedAt DateTime? } model Account { - id String @id() @default(uuid()) - userId String - type String - provider String - providerAccountId String - refresh_token String? - refresh_token_expires_in Int? - access_token String? - expires_at Int? - token_type String? - scope String? - id_token String? - session_state String? - user User @relation(fields: [userId], references: [id], onDelete: Cascade) + id String @id() @default(uuid()) + userId String + type String + provider String + providerAccountId String + refresh_token String? + refresh_token_expires_in Int? + access_token String? + expires_at Int? + token_type String? + scope String? + id_token String? + session_state String? + user User @relation(fields: [userId], references: [id], onDelete: Cascade) - @@unique([provider, providerAccountId]) -} \ No newline at end of file + @@unique([provider, providerAccountId]) +} diff --git a/schema.zmodel b/schema.zmodel index 9459f64..540b538 100644 --- a/schema.zmodel +++ b/schema.zmodel @@ -33,13 +33,13 @@ enum SpaceUserRole { * Model for a space in which users can collaborate on Lists and Todos */ model Space { - id String @id @default(uuid()) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - name String @length(4, 50) - slug String @unique @regex('^[0-9a-zA-Z]{4,16}$') - members SpaceUser[] - lists List[] + id String @id @default(uuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + name String @length(4, 50) + slug String @unique @regex('^[0-9a-zA-Z]{4,16}$') + members SpaceUser[] + lists List[] // require login @@deny('all', auth() == null) @@ -58,14 +58,14 @@ model Space { * Model representing membership of a user in a space */ model SpaceUser { - id String @id @default(uuid()) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - space Space @relation(fields: [spaceId], references: [id], onDelete: Cascade) - spaceId String - user User @relation(fields: [userId], references: [id], onDelete: Cascade) - userId String - role SpaceUserRole + id String @id @default(uuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + space Space @relation(fields: [spaceId], references: [id], onDelete: Cascade) + spaceId String + user User @relation(fields: [userId], references: [id], onDelete: Cascade) + userId String + role SpaceUserRole @@unique([userId, spaceId]) // require login @@ -82,20 +82,20 @@ model SpaceUser { * Model for a user */ model User { - id String @id @default(uuid()) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - email String @unique @email + id String @id @default(uuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + email String @unique @email emailVerified DateTime? - password String? @password @omit - name String? - spaces SpaceUser[] - image String? @url - lists List[] - todos Todo[] + password String? @password @omit + name String? + spaces SpaceUser[] + image String? @url + lists List[] + todos Todo[] // next-auth - accounts Account[] + accounts Account[] // can be created by anyone, even not logged in @@allow('create', true) @@ -111,16 +111,16 @@ model User { * Model for a Todo list */ model List { - id String @id @default(uuid()) + id String @id @default(uuid()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt - space Space @relation(fields: [spaceId], references: [id], onDelete: Cascade) - spaceId String - owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade) - ownerId String - title String @length(1, 100) - private Boolean @default(false) - todos Todo[] + space Space @relation(fields: [spaceId], references: [id], onDelete: Cascade) + spaceId String + owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade) + ownerId String @default(auth().id) + title String @length(1, 100) + private Boolean @default(false) + todos Todo[] // require login @@deny('all', auth() == null) @@ -143,14 +143,14 @@ model List { * Model for a single Todo */ model Todo { - id String @id @default(uuid()) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade) - ownerId String - list List @relation(fields: [listId], references: [id], onDelete: Cascade) - listId String - title String @length(1, 100) + id String @id @default(uuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade) + ownerId String @default(auth().id) + list List @relation(fields: [listId], references: [id], onDelete: Cascade) + listId String + title String @length(1, 100) completedAt DateTime? // require login @@ -166,19 +166,19 @@ model Todo { // next-auth model Account { - id String @id @default(uuid()) - userId String - type String - provider String - providerAccountId String - refresh_token String? + id String @id @default(uuid()) + userId String + type String + provider String + providerAccountId String + refresh_token String? refresh_token_expires_in Int? - access_token String? - expires_at Int? - token_type String? - scope String? - id_token String? - session_state String? - user User @relation(fields: [userId], references: [id], onDelete: Cascade) + access_token String? + expires_at Int? + token_type String? + scope String? + id_token String? + session_state String? + user User @relation(fields: [userId], references: [id], onDelete: Cascade) @@unique([provider, providerAccountId]) } \ No newline at end of file