Compare commits

...
29 Commits
Author SHA1 Message Date
yiling 4b62c31f29 Release v0.4.0 2026-08-28 20:40:33 +08:00
Yiling-J 2208d4e0e0 fix(webui): align mobile comment cards and thread vertical indicator (#361) 2026-08-28 20:26:26 +08:00
Yiling-J df7f4c3c2d Update README_CN with project management details
Added information about project management and media handling in Shumai.
2026-08-28 20:25:46 +08:00
Yiling-J 12323e1416 Enhance README with project management and media details
Added information about project management features and media processing in Shumai.
2026-08-28 20:23:38 +08:00
yiling 2edc5e1071 fix(e2e): enable ryuk container reaper for app e2e tests 2026-08-28 16:22:29 +08:00
Yiling-J 2162ed9ebe fix(webui): fix breadcrumb file dropdown trigger stretching and alignment (#360) 2026-08-28 16:07:27 +08:00
Yiling-J 6acebb73ec feat(webui): add mobile friendly file detail and public share view (#359)
* feat(webui): add mobile friendly file detail and public share view

* fix(webui): address review feedback for mobile file detail and public share view

* fix(webui): use dynamic viewport and flex column layout for mobile file viewer

* fix(webui): support iOS WebKit video fullscreen and guard requestFullscreen

* fix(webui): compact page indicator and layout in mobile PDF control bar
2026-08-28 15:11:33 +08:00
EICCIO Advisors 7a1d6c0ab5 docs: add SECURITY.md with a private disclosure path (#357)
The project has no security policy, so a researcher with a finding today has
only a public issue or Discord, both of which disclose before a fix exists.

Routes reports to GitHub private vulnerability reporting. Names deployment
manifests as in scope, since the documented quickstart is what most operators
actually run. Adds operator guidance for the three things a self-hoster owns:
the session secret, not publishing the database port, and treating the agent
as a code-execution surface.

Response timelines are left for the maintainer to set.
2026-08-28 09:21:21 +08:00
Yiling-J d16e31c0e5 feat(webui): add simplified mobile-friendly layout for file and share lists (#356)
* feat(webui): add simplified mobile-friendly layout for file and share lists

* refactor(webui): switch mobile file list layout to 1-column grid

* feat(webui): show foldertree by default in child sidebar and add close button

* feat(webui): add collapsible section headers and fix folder card full-width on mobile

* feat(webui): improve mobile breadcrumb bar with middle truncation and dual ellipsis

* fix(webui): unify breadcrumb DOM structure across desktop and mobile

* fix(webui): remove unused breadcrumbs variable in BreadcrumbNav

* fix(webui): complete and confirm file uploads on mobile and handle errors properly

* fix(webui): remove active scale animation on mobile FAB to stabilize dropdown menu anchor

* refactor(webui): use PresignedUrl type from dtos for uploadFiles and eliminate any cast

* fix(webui): scope folder card max width to desktop with responsive md:max-w-[340px]
2026-08-27 20:44:08 +08:00
Yiling-J d9a8b6a191 feat(webui): truncate long file names with 100ms hover tooltip (#355) 2026-08-27 10:54:35 +08:00
yiling 5ec4cd7fcd docs: update documentation link in README and README_CN 2026-08-26 21:44:50 +08:00
Yiling-J a7925e3c79 fix(share): hide and soft-delete symlinks when target assets are trashed (#354) 2026-08-26 21:04:38 +08:00
Yiling-J 472b420620 fix(transcode): apply team hardware acceleration and source bitrate capping to watermark transcoding (#353) 2026-08-26 17:00:11 +08:00
Yiling-J 8f55ba1d37 feat(transcode): add hardware-accelerated video transcoding support (#352)
* feat(transcode): add hardware-accelerated video transcoding support

* feat(transcode): use encoder quality modes and source-capped maxrate for video transcode

* fix(transcode): scale max bitrate for downsampled preview framerates

* fix(transcode): propagate videoBitRate in getMediaInfoActivity and update auto description
2026-08-26 16:28:14 +08:00
yiling 7b1428bf51 Release v0.3.11 2026-08-25 22:05:47 +08:00
yiling d5b3b1868e fix(webui): reload video player and reset state when switching videos in viewer 2026-08-25 21:52:15 +08:00
yiling 49f3fc0be5 fix(webui): restore full width bottom bar spanning across carousel in file viewer 2026-08-25 21:27:20 +08:00
Yiling-J 59e641ccb3 fix(webui): prevent left carousel remounting and scroll jump on file selection (#351) 2026-08-25 21:01:51 +08:00
Yiling-J 1d9268b224 feat(project): add recent viewed files section to project folder tree (#348)
* feat(project): add recent viewed files section to project folder tree

* feat(webui): disable toolbar buttons and context menu in recents page

* test(core): optimize recents cap test execution time

* feat(webui): show hint text in recents page top toolbar

* feat(webui): rename recents section to Recently Viewed

* refactor(core): consolidate recents methods into AssetService

* fix(api): forward pagination parameters in folder children endpoint (#349)

* fix(project-recents): scope views and disable recents mutations

* fix(api): allow recent views in demo mode

* fix(api): limit demo recent view exception to post
2026-08-25 18:51:24 +08:00
Yiling-J 470a4bd6f7 feat(auth): add admin password reset CLI command and reset password web UI (#347)
* feat(auth): add admin password reset CLI command and reset password web UI

* fix(auth): invalidate previous reset tokens and use AsyncLocalStorage for link capture
2026-08-25 14:35:33 +08:00
yiling 8801d59b2e docs: symlink CLAUDE.md to AGENTS.md 2026-08-25 09:50:54 +08:00
yiling 6a20e06982 Release v0.3.10 2026-08-23 21:19:45 +08:00
Yiling-J b17abce2c2 fix(kanban): improve drag-drop to column bottom, remove empty drop line, and fix timeline alignment (#346) 2026-08-23 21:11:33 +08:00
Yiling-J f67e334016 feat(kanban): update task status permissions, reporter defaults, and participant access (#345)
* feat(kanban): allow editors to change task status and default reporter to creator

* fix(kanban): hide create task button for reviewers and eliminate duplicate error toast
2026-08-23 20:38:56 +08:00
yiling c1de66520e update readme image 2026-08-23 16:53:44 +08:00
Yiling-J 37e086d822 fix(webui): sidebar selection styling, kanban active state, pointer cursors, and owner dashboard (#344)
* fix(webui): update sidebar selection styling, kanban active state, and pointer cursors

* feat(webui): move dashboard to left sidebar and prevent mount animation

* fix(e2e): update create-project test to click Home button in sidebar
2026-08-23 16:39:56 +08:00
Yiling-J d21f8ca8de fix(kanban): use true thumbnail and poster for task asset previews (#343) 2026-08-23 14:36:46 +08:00
Yiling-J 6af4e7c2ec feat(kanban): resolve latest version for linked version stack assets and update demo login text (#342) 2026-08-23 11:19:48 +08:00
Yiling-J 1f2bdc8c9e feat(agentic kanban): phase 1 not-agentic kanban board (#330)
* feat(kanban): implement AI-native kanban database models, services, and REST APIs

* feat(webui): implement team kanban board and task management

* style(webui): increase kanban dialog widths and form container

* fix(webui): ensure kanban dialogs override sm:max-w-lg base class

* style(webui): set edit task dialog max width to 5xl

* chore: untrack kanban plan markdown files

* feat(webui): update kanban page layout to 2 columns and refine task activity UI

* fix(webui): constrain kanban column and board heights for vertical scrolling

* feat(kanban): unify task status transition into updateTask API and allow unconstrained human task transitions

* fix(webui): add optimistic updates to kanban drag-and-drop to eliminate flash

* refactor(webui): remove client-side search box from kanban header

* feat(kanban): redesign task dialog comments area and add attachment support

* refactor(webui): remove top status action bar from task info dialog

* fix(webui): narrow query cache predicate and add defensive guards for kanban drag optimistic update

* feat(kanban): add drag-and-drop task reordering with fractional indexing (#331)

* feat(kanban): add drag-and-drop task reordering with fractional indexing

* fix(kanban): improve card drop zones, snap indicators, and column highlight

* fix(kanban): enable card droppables only during active drag

* fix(kanban): refine hover styles and drop indicators for column boundaries

* fix(kanban): unify bottom drop indicator and fix top indicator clipping

* fix(kanban): ensure full column highlight and full coverage drop target

* minor change

* feat(kanban): allow agent tasks free drag-and-drop and enforce status change permissions (#332)

* refactor(kanban): rename task_type_agentic translation keys to task_type_agent

* feat(kanban): refactor task type enum to isAgentTask boolean (#333)

* refactor(kanban): remove phase 2 agent execution logic and streamline phase 1 kanban

* feat(kanban): add notifications and audit logging for kanban (#334)

* feat(kanban): redesign config area layout and add parent tasks multi-selector (#335)

* feat(webui): redesign kanban task dialog config area

* feat(kanban): simplify task dependencies with parent tasks multi-selector

* refactor(kanban): remove unused links routes and legacy dependency methods

* feat(kanban): connect assets and kanban tasks with many-to-many relationship (#336)

* feat(kanban): connect assets and kanban tasks with many-to-many relationship

* feat(kanban): improve asset picker layout, infinite scrolling, and breadcrumb icon styling

* fix(kanban): ensure asset picker scrollarea is scrollable with min-h-0 and shrink-0 flex styling

* fix(kanban): hide recently deleted in folder tree picker and adjust header padding

* fix(kanban): use lucide files icon instead of paperclip for linked assets

* feat(kanban): improve task deletion, goal sidebar interaction, and card styling (#337)

* feat(kanban): improve task deletion, goal sidebar interaction, and card styling

* feat(kanban): move agent task badge after priority and update to orange style

* feat(kanban): add status Compare-And-Swap (CAS) to prevent drag-and-drop race conditions (#338)

* feat(kanban): add status Compare-And-Swap (CAS) to prevent drag-and-drop race conditions

* style(kanban): rotate kanban icon 180 degrees in sidebar and top nav

* style(kanban): remove rotate-180 from SquareKanban icons

* feat(kanban): add unassigned goal record and fix all tasks count (#339)

* feat(kanban): add unassigned goal record and fix all tasks count

* feat(kanban): toggle task count with three-dot action button on goal card hover

* fix(ci): pin bun version to 1.3.14 across CI and Docker (#340)

* fix(webui): truncate goal name to max 2 lines in kanban sidebar (#341)
2026-08-23 10:28:56 +08:00
543 changed files with 47707 additions and 979 deletions
+8 -8
View File
@@ -22,9 +22,9 @@ jobs:
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
bun-version: 1.3.14
- name: Install dependencies
run: bun install
@@ -76,9 +76,9 @@ jobs:
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
bun-version: 1.3.14
- name: Install dependencies
run: bun install
@@ -118,9 +118,9 @@ jobs:
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
bun-version: 1.3.14
- name: Install dependencies
run: bun install
@@ -152,9 +152,9 @@ jobs:
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
bun-version: 1.3.14
- name: Install dependencies
run: bun install
+1 -1
View File
@@ -36,7 +36,7 @@ jobs:
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
bun-version: 1.3.14
- name: Setup Node.js
uses: actions/setup-node@v6
+1
View File
@@ -11,6 +11,7 @@ data/
*.db
*.diff
*.orig
code_quality.md
.agents
# Playwright
Symlink
+1
View File
@@ -0,0 +1 @@
AGENTS.md
+7 -2
View File
@@ -1,6 +1,6 @@
#syntax=docker/dockerfile:1.7-labs
# Stage 1: Builder
FROM oven/bun:1 AS builder
FROM oven/bun:1.3.14 AS builder
WORKDIR /app
@@ -25,7 +25,7 @@ RUN bun run build.ts
RUN bun run scripts/extract-runtime-deps.ts
# Stage 2: Runner
FROM oven/bun:1 AS runner
FROM oven/bun:1.3.14 AS runner
# Install ffmpeg/ffprobe
COPY --from=mwader/static-ffmpeg:8.1 /ffmpeg /usr/local/bin/
@@ -80,6 +80,11 @@ USER root
COPY scripts/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Expose "bun index.js" as "shumai" CLI command (and alias "shuami")
RUN printf '#!/bin/sh\nexec bun /app/index.js "$@"\n' > /usr/local/bin/shumai \
&& chmod +x /usr/local/bin/shumai \
&& ln -s /usr/local/bin/shumai /usr/local/bin/shuami
ENTRYPOINT ["docker-entrypoint.sh"]
# Default command: run migrations and start API server
+7 -1
View File
@@ -9,7 +9,7 @@
</p>
<p align="center">
<a target="_blank" href="https://shumai.one/">Website</a> | <a target="_blank" href="https://docs.shumai.one/introduction">Docs</a> | <a target="_blank" href="https://staging.shumai.one">Demo</a> | <a target="_blank" href="https://discord.gg/sUzhujK6DD">Discord</a> | <a target="_blank" href="README_CN.md">中文</a>
<a target="_blank" href="https://shumai.one/">Website</a> | <a target="_blank" href="https://docs.shumai.one/getting-started/overview">Docs</a> | <a target="_blank" href="https://staging.shumai.one">Demo</a> | <a target="_blank" href="https://discord.gg/sUzhujK6DD">Discord</a> | <a target="_blank" href="README_CN.md">中文</a>
</p>
![Shumai App Screenshot](docs/screenshot.webp)
@@ -45,6 +45,12 @@ Here is a short demo video showing what the Shumai agent can do:
https://github.com/user-attachments/assets/1186067a-72c0-41b9-836f-987438f2332a
Shumai also brings project management into the creative workflow. A built-in Kanban board helps teams organize tasks, track progress, and collaborate in one place.
The ultimate goal is an **agentic Kanban**, where agents and team members can work together on tasks. This is still a **work in progress**: you can already create tasks for AI agents, but agents cannot act on those tasks yet.
<img width="2880" height="2160" alt="localhost_3000_teams_01M0HQR3EEBS0B46K4FK39X2C8_kanban(1080p-2) (1)" src="https://github.com/user-attachments/assets/cd0648d0-c69a-4398-958b-8d15a33378b0" />
> [!NOTE]
+8 -1
View File
@@ -9,7 +9,7 @@
</p>
<p align="center">
<a target="_blank" href="https://shumai.one/">官方网站</a> | <a target="_blank" href="https://docs.shumai.one/introduction">文档</a> | <a target="_blank" href="https://staging.shumai.one">在线演示</a> | <a target="_blank" href="README.md">English</a>
<a target="_blank" href="https://shumai.one/">官方网站</a> | <a target="_blank" href="https://docs.shumai.one/getting-started/overview">文档</a> | <a target="_blank" href="https://staging.shumai.one">在线演示</a> | <a target="_blank" href="README.md">English</a>
</p>
</p>
@@ -44,6 +44,13 @@ Shumai 是一个开源的 Frame.io 替代方案,专为创意团队打造,让
https://github.com/user-attachments/assets/1186067a-72c0-41b9-836f-987438f2332a
Shumai 也将项目管理融入了创意工作流程。 内置的看板可以帮助团队整理任务以及跟踪进度。
最终目标是打造一个 Agentic看板,让 Agent 和团队成员能够围绕同一个目标协同工作。目前这一功能仍在开发中: 你已经可以在看板中为 Agent 创建任务,但 Agent 目前还无法自动执行这些任务。
<img width="2880" height="2160" alt="localhost_3000_teams_01M0HQR3EEBS0B46K4FK39X2C8_kanban(1080p-2) (1)" src="https://github.com/user-attachments/assets/29ff1db1-2d65-4e3c-b467-754b777b406f" />
> [!NOTE]
> **媒体处理与存储机制:** 上传媒体文件后,Shumai 始终会保留并存储原始文件。请注意,系统中显示的文件大小为原始文件的大小,不包含转码后生成的代理文件大小。无论图片还是视频,都会额外生成一张 300p 的 WebP 封面图,作为文件列表中的预览图。此外:
>
+58
View File
@@ -0,0 +1,58 @@
# Security Policy
## Reporting a Vulnerability
Please report security vulnerabilities **privately**. Do not open a public issue,
pull request or Discord message for a suspected vulnerability, as that discloses it
to everyone before a fix exists.
Use **[GitHub private vulnerability reporting](https://github.com/shumaiOne/shumai/security/advisories/new)**
(the "Report a vulnerability" button on the Security tab). If that is unavailable,
contact the maintainer directly rather than in a public channel.
Please include:
- What the issue is, and the impact you believe it has
- The version or commit you tested (`git rev-parse HEAD`, or the image digest)
- Steps to reproduce, ideally minimal
- Your deployment shape: storage backend, whether the agent feature is enabled,
and whether the instance is internet-reachable
## Supported Versions
Shumai is pre-1.0 and moves quickly. Security fixes are made against the **latest
release**. Users are encouraged to track releases rather than pin indefinitely.
## Scope
**In scope** — the application, its API, the shipped Docker images, and the
deployment manifests under `docker-compose/`.
Deployment manifests are explicitly in scope. A default that is unsafe when
followed as documented is a real finding, because the documented quickstart is what
most operators actually run.
**Out of scope**
- Vulnerabilities in third-party dependencies, unless Shumai's use of them is what
creates the exposure. Report those upstream.
- Findings that require an already-compromised host or database.
- Configurations that deviate from the documented deployment.
## Operator guidance
Shumai is self-hosted, so several controls belong to the operator rather than to the
project:
- **Set `BETTER_AUTH_SECRET` per deployment.** It signs sessions and, in local
storage mode, upload URLs. Never reuse a value from documentation or an example.
- **Do not expose the instance to the public internet without a reverse proxy**
terminating TLS and applying your own access policy.
- **Do not publish the database port.** Set a real database password.
- **Treat the agent feature as a code-execution surface.** If you enable it, run it
where a compromise is survivable, and review the sandbox network policy.
## Disclosure
Please allow a reasonable period for a fix before public disclosure. The maintainer
will acknowledge reports and keep reporters informed of progress.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/agent-app",
"version": "0.3.9",
"version": "0.4.0",
"private": true,
"type": "module",
"bin": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/cli",
"version": "0.3.9",
"version": "0.4.0",
"private": true,
"type": "module",
"bin": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/transcode-app",
"version": "0.3.9",
"version": "0.4.0",
"private": true,
"type": "module",
"bin": {
+3
View File
@@ -56,6 +56,8 @@ apps/web/e2e/
|---|---|
| Sign up as the first user and become the team owner | `tests/auth/signup.spec.ts` |
| Log in with existing credentials | `tests/auth/login.spec.ts` |
| Show error when accessing reset-password page without token | `tests/auth/reset-password.spec.ts` |
| Reset password with valid token and allow logging in with new password | `tests/auth/reset-password.spec.ts` |
### team
| Test | File |
@@ -91,6 +93,7 @@ apps/web/e2e/
| Owner saves a search result as a collection | `tests/project/save-search-collection.spec.ts` |
| Image share with watermark + download disabled: no download buttons on public list/detail pages, watermarked proxy served, download-url rejected | `tests/project/share-watermark-no-download.spec.ts` |
| Video share with watermark + download disabled: no download buttons on public list/detail pages, watermarked proxy served, download-url rejected | `tests/project/share-watermark-no-download.spec.ts` |
| Owner views a file and it appears in recents | `tests/project/recents.spec.ts` |
### file
| Test | File |
+6 -5
View File
@@ -7,15 +7,16 @@ interface CreateShareResponse {
}
/**
* Locates a file/folder card by its name. File names are rendered as
* `EditableText` inputs (not text nodes), so `getByText` does not match them.
* The returned locator points at the card wrapper div (right-clickable to open
* the card context menu).
* Locates a file/folder card by its name. Matches both read-only text nodes
* and active EditableText inputs. The returned locator points at the card
* wrapper div (right-clickable to open the card context menu).
*/
export function fileCard(page: Page, name: string): Locator {
return page
.locator('div.group')
.filter({ has: page.locator(`input[value="${name}"]`) })
.filter({
has: page.locator(`input[value="${name}"]`).or(page.getByText(name, { exact: true })),
})
.first()
}
+4 -1
View File
@@ -32,4 +32,7 @@ async function start() {
await import('../src/index.ts')
}
start().catch(console.error)
start().catch((err) => {
console.error('Failed to start E2E server:', err)
process.exit(1)
})
@@ -0,0 +1,63 @@
import { expect, test } from '../../fixtures'
import { apiSignup, E2E_PASSWORD, uniqueEmail } from '../../helpers/auth'
import { loginViaUi } from '../../helpers/ui'
test('should show error when accessing reset-password page without token', async ({ page }) => {
await page.goto('/reset-password')
await expect(page.getByText('Invalid or missing reset token.')).toBeVisible()
await expect(page.getByRole('button', { name: 'Go to Login' })).toBeVisible()
})
test('should reset password with valid token and allow logging in with new password', async ({
page,
request,
prisma,
}) => {
const email = uniqueEmail('reset-pw')
const oldPassword = E2E_PASSWORD
const newPassword = 'newSecretPassword123'
// 1. Seed user
await apiSignup(request, email, oldPassword)
// 2. Request password reset via API
const resetRes = await request.post('/api/auth/request-password-reset', {
data: {
email,
redirectTo: '/reset-password',
},
})
expect(resetRes.ok()).toBe(true)
// Retrieve the generated verification token from DB
const verification = await prisma.verification.findFirst({
where: {
identifier: { startsWith: 'reset-password:' },
},
orderBy: { createdAt: 'desc' },
})
expect(verification).not.toBeNull()
const token = verification!.identifier.replace('reset-password:', '')
// 3. Open reset password page with token
await page.goto(`/reset-password?token=${token}`)
// 4. Fill in new password and confirmation
await page.locator('input#password').fill(newPassword)
await page.locator('input#confirmPassword').fill(newPassword)
// 5. Submit form
await page.getByRole('button', { name: 'Reset Password' }).click()
// 6. Verify success state
await expect(page.getByText('Password reset successfully!')).toBeVisible()
// 7. Click Go to Login
await page.getByRole('button', { name: 'Go to Login' }).click()
await expect(page).toHaveURL('/login')
// 8. Log in with the new password
await loginViaUi(page, email, newPassword)
await expect(page).toHaveURL(/\/teams\/[^/]+/)
await expect(page.getByRole('heading', { name: 'Projects' })).toBeVisible()
})
@@ -40,8 +40,8 @@ test('owner should create a project with a cover image', async ({ owner, prisma
await expect(page).toHaveURL(/\/projects\/[^/]+/)
await expect(page.locator(`text=${projectName}`).first()).toBeVisible()
// Back on the dashboard the new project card is visible with its cover
await page.click('button[aria-label="Dashboard"]')
// Back on the home page the new project card is visible with its cover
await page.click('button[aria-label="Home"]')
await expect(page).toHaveURL(/\/teams\/[^/]+/)
await expect(page.locator(`img[alt="${projectName}"]`)).toBeVisible()
@@ -0,0 +1,35 @@
import { expect, test } from '../../fixtures'
import { fileCard } from '../../helpers/files'
test('owner views a file and it appears in recents', async ({ file }) => {
const { page, projectId, fileName, fileId } = file
// Open the file details page to record view
await page.goto(`/projects/${projectId}/files/${fileId}`)
await expect(page.getByText(fileName).first()).toBeVisible()
// Navigate to Recents page via sidebar or direct URL
await page.goto(`/projects/${projectId}`)
await page.getByText('Recently Viewed').first().click()
await expect(page).toHaveURL(new RegExp(`/projects/${projectId}/recents`))
// The viewed file should be visible in recents
const card = fileCard(page, fileName)
await expect(card).toBeVisible()
// Toolbar should show hint text instead of action buttons
await expect(
page.getByText('This page displays the 100 most recent files you viewed in this project.'),
).toBeVisible()
await expect(page.getByRole('button', { name: 'Field' })).not.toBeVisible()
await expect(page.getByRole('button', { name: 'Search' })).not.toBeVisible()
await expect(page.getByText('AGENTS.md')).not.toBeVisible()
// Right-clicking the file should NOT show the context menu
await card.click({ button: 'right' })
await expect(page.getByRole('menuitem', { name: 'Delete' })).not.toBeVisible()
await expect(page.getByRole('menuitem', { name: 'Download' })).not.toBeVisible()
// The per-item overflow menu must also be unavailable on the read-only Recents page.
await expect(card.getByRole('button')).toHaveCount(0)
})
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/web-app",
"version": "0.3.9",
"version": "0.4.0",
"private": true,
"type": "module",
"dependencies": {
+25
View File
@@ -13,12 +13,37 @@ import { initTranscodeWorkflows } from '@shumai/transcode'
import { workflowService } from '@shumai/workflow-core'
import { handleDaemonCommands } from '@shumai/core/src/utils/daemon'
import { authService } from '@shumai/core/src/auth/auth'
if (process.argv.includes('--check')) {
console.log('✅ Web app evaluated successfully!')
process.exit(0)
}
const cliArgs = process.argv.slice(2)
const resetCmdIndex = cliArgs.findIndex(
(arg) => arg === 'reset-password' || arg === 'reset-passowrd',
)
if (resetCmdIndex !== -1) {
const email = cliArgs[resetCmdIndex + 1]
if (!email || email.startsWith('-')) {
console.error('Error: Please provide a valid email address.')
console.error('Usage: shumai reset-password <email>')
process.exit(1)
}
try {
const link = await authService.generatePasswordResetLink(email)
console.log(link)
process.exit(0)
} catch (err: unknown) {
const message = err instanceof Error ? err.message : 'Unknown error'
console.error(`Error: ${message}`)
process.exit(1)
}
}
async function run() {
// Initialize workflows and activities for local executor mode
initAgentWorkflows()
-49
View File
@@ -1,49 +0,0 @@
# Code Quality Review: Quota Usage Dashboard
## Context
The change moves quota usage monitoring from the settings rule-card dialog to an owner-only dashboard section, adds collapsible rule/record display, and adds an audited manual record reset operation.
## Review
### Correctness
- The reset service validates team ownership, scope mode, membership, role filters, and selected-member membership.
- Reset and first-use record creation are serialized with a quota-rule row lock.
- Reset starts a new window at the current time and clears consumption.
- API and service tests cover shared records, member records, invalid targets, cross-team access, request validation, and audit logging.
- The application E2E test covers the settings/dashboard flow and verifies the persisted reset.
### Readability and architecture
- Business logic remains in `QuotaService`; the API only validates, authorizes, invokes the service, and maps the audit action.
- The dashboard owns usage presentation, while quota formatting metadata is shared between dashboard and settings.
- The removed usage dialog and obsolete translation messages are not referenced after the refactor.
### Security
- The reset endpoint retains owner-level team authorization.
- Request input is validated with Zod.
- SQL uses Prisma tagged-template parameters and does not interpolate raw user input.
### Performance
- Usage records are queried only after a rule is expanded.
- Expanded rules refresh every ten seconds, matching the previous usage dialog behavior.
- Quota rules retain the existing bounded list endpoint and descending ID ordering.
## Verification
- `bun run lint` passed.
- `bun run format` passed.
- `bun run typecheck` passed.
- `bun run test` passed: 124 files, 1190 tests.
- Quota API/core tests passed: 2 files, 30 tests.
- Quota application E2E passed.
- WebUI harness E2E passed: 9 tests.
- Workflow E2E passed: 14 files, 58 tests.
- `git diff --check` passed.
## Verdict
Approve. No critical or required findings remain.
+5 -1
View File
@@ -52,7 +52,11 @@
},
{
"group": "Team Settings",
"pages": ["using-shumai/transcode-settings", "using-shumai/quotas-settings"]
"pages": [
"using-shumai/transcode-settings",
"using-shumai/quotas-settings",
"using-shumai/password-reset"
]
},
{
"group": "Configuration",
Binary file not shown.

Before

Width:  |  Height:  |  Size: 309 KiB

After

Width:  |  Height:  |  Size: 131 KiB

+60
View File
@@ -0,0 +1,60 @@
---
title: Password Reset
description: How administrators generate secure password reset links for team members.
---
Because Shumai does not require an external email delivery service (SMTP) to be configured for standard self-hosted deployments, password resets are initiated securely by an administrator using the Shumai CLI.
---
## Overview
When a user forgets their password, an administrator can generate a one-time password reset link directly from the command line.
- **Link Expiration**: The generated password reset link is valid for **1 hour** (`3600 seconds`).
- **One-Time Use**: Once used, the token is permanently invalidated.
- **Session Revocation**: When a user resets their password, all existing active sessions for that account are automatically revoked across all devices.
- **Latest Link Validity**: Generating a new reset link for a user immediately supersedes any previously generated pending links.
---
## Generating a Password Reset Link
### Running on Local Host / Server
Run the `reset-password` subcommand from your Shumai installation directory:
```bash
shumai reset-password <user-email>
```
_(Alternatively, `bun apps/web/src/index.ts reset-password <user-email>`)_
**Example Output:**
```text
http://localhost:3000/reset-password?token=bb3xg4uO3cwN0FQv4cgUK6Hh
```
### Running inside Docker
If Shumai is running inside a Docker container, execute the command using `docker exec`:
```bash
docker exec -it <container-name-or-id> shumai reset-password <user-email>
```
> [!TIP]
> Both `shumai` and the common alias `shuami` (e.g. `shuami reset-password <user-email>`) are supported.
> [!NOTE]
> For remote servers or production deployments, ensure `BETTER_AUTH_URL` is set in your environment (e.g., `BETTER_AUTH_URL=https://shumai.example.com`) so the CLI generates the reset link with your public domain instead of `localhost`.
---
## Member Reset Experience
1. The administrator sends the generated URL to the team member via their preferred secure communication channel.
2. The user opens the link in their browser.
3. The user inputs their **New Password** and **Confirm Password** (minimum 3 characters).
4. Upon clicking **Reset Password**, the password is securely updated, all previous active sessions are invalidated, and the user is redirected to `/login` to sign in.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "shumai",
"version": "0.3.9",
"version": "0.4.0",
"private": true,
"type": "module",
"repository": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/agent",
"version": "0.3.9",
"version": "0.4.0",
"private": true,
"type": "module",
"main": "./src/index.ts",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/api",
"version": "0.3.9",
"version": "0.4.0",
"private": true,
"type": "module",
"main": "./src/index.ts",
+40
View File
@@ -188,6 +188,46 @@ describe('folder api', () => {
type: ResourceType.Asset,
id: 'test-id',
})
expect(assetService.listChildren).toHaveBeenCalledWith({
assetId: 'test-id',
assetType: 'folder',
})
})
it('GET /folders/:folderId/children forwards pagination parameters', async () => {
vi.mocked(assetService.listChildren).mockResolvedValue({
data: [
{
id: 'child-id-2',
name: 'child-folder-2',
sizeByte: 0,
fileCount: 0,
type: 'folder',
status: 'active',
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
},
],
pageInfo: { total: 30, cursor: 'cursorNextToken' },
})
const app = new Hono().use('*', authMiddleware).route('/', folderRoute)
const res = await app.request(
'/folders/test-id/children?assetType=folder&first=20&after=cursorToken123&prefix=sub',
)
expect(res.status).toBe(200)
const json = await res.json()
expect(json.data).toHaveLength(1)
expect(json.pageInfo.cursor).toBe('cursorNextToken')
expect(assetService.listChildren).toHaveBeenCalledWith({
assetId: 'test-id',
assetType: 'folder',
first: 20,
after: 'cursorToken123',
prefix: 'sub',
})
})
it('DELETE /folders', async () => {
+1 -5
View File
@@ -120,12 +120,8 @@ const route = new Hono<{ Variables: { user: User } }>()
})
const resp = await assetService.listChildren({
...req,
assetId: folderId,
assetType: req.assetType,
projectId: req.projectId,
showDeleted: req.showDeleted,
sort: req.sort,
order: req.order,
})
return c.json(resp)
})
+2
View File
@@ -25,6 +25,7 @@ import quotaRoute from './quota'
import teamRoute from './team'
import uploadRoute, { localUploadRoute } from './upload'
import versionStackRoute from './versionStack'
import kanbanRoute from './kanban'
type User = Prisma.UserGetPayload<Record<string, never>>
@@ -67,6 +68,7 @@ const apiRoute = new Hono<{ Variables: { user: User } }>()
.route('/', mcpRoute)
.route('/', watermarkTemplateRoute)
.route('/', quotaRoute)
.route('/', kanbanRoute)
app.route('/files', s3Route)
+130
View File
@@ -0,0 +1,130 @@
import { zValidator } from '@hono/zod-validator'
import { Hono } from 'hono'
import { kanbanService } from '@shumai/core/src/kanban/kanban'
import { notificationService } from '@shumai/core/src/notification/notification'
import { auditLogService } from '@shumai/core/src/auditLog/auditLog'
import {
authzService,
Permission,
ResourceType,
resolveEffectiveRole,
} from '@shumai/core/src/authz/authz'
import { createKanbanCommentSchema, postAttachmentRequestSchema, AuditAction } from '@shumai/dtos'
import type { Prisma } from '@shumai/db'
type User = Prisma.UserGetPayload<Record<string, never>>
const route = new Hono<{ Variables: { user: User } }>()
.post(
'/teams/:teamId/kanban/attachments',
zValidator('json', postAttachmentRequestSchema),
async (c) => {
const { teamId } = c.req.param()
const req = c.req.valid('json')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.Team,
id: teamId,
})
const attachment = await kanbanService.createAttachment(teamId, req)
return c.json(attachment)
},
)
.post(
'/teams/:teamId/kanban/tasks/:taskId/comments',
zValidator('json', createKanbanCommentSchema),
async (c) => {
const { teamId, taskId } = c.req.param()
const req = c.req.valid('json')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.KanbanTask,
id: taskId,
})
const comment = await kanbanService.addComment(taskId, user.id, req.body, req.attachments)
const task = await kanbanService.getTask(taskId)
await auditLogService.logAction({
action: AuditAction.kanban_comment_create,
teamId,
userId: user.id,
projectId: task.projectId ?? undefined,
itemId: comment.id,
})
notificationService.notifyKanbanTaskEvent({
type: 'kanban_task_comment_created',
teamId,
projectId: task.projectId,
creatorId: user.id,
kanbanTaskId: taskId,
stakeholderIds: [task.creator?.id, task.assignee?.id, task.reporter?.id],
commentMessage: req.body,
})
return c.json(comment)
},
)
.get('/teams/:teamId/kanban/tasks/:taskId/comments', async (c) => {
const { taskId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.KanbanTask,
id: taskId,
})
const comments = await kanbanService.listComments(taskId)
return c.json({ data: comments })
})
.delete('/teams/:teamId/kanban/tasks/:taskId/comments/:commentId', async (c) => {
const { teamId, taskId, commentId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.KanbanTask,
id: taskId,
})
const userRole = await resolveEffectiveRole(teamId, undefined, user.id)
const task = await kanbanService.getTask(taskId)
await kanbanService.deleteComment(taskId, commentId, user.id, userRole)
await auditLogService.logAction({
action: AuditAction.kanban_comment_delete,
teamId,
userId: user.id,
projectId: task.projectId ?? undefined,
itemId: commentId,
})
return c.json({ success: true })
})
.get('/teams/:teamId/kanban/tasks/:taskId/events', async (c) => {
const { taskId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.KanbanTask,
id: taskId,
})
const events = await kanbanService.listEvents(taskId)
return c.json({ data: events })
})
export default route
+131
View File
@@ -0,0 +1,131 @@
import { zValidator } from '@hono/zod-validator'
import { Hono } from 'hono'
import { kanbanService } from '@shumai/core/src/kanban/kanban'
import { auditLogService } from '@shumai/core/src/auditLog/auditLog'
import {
authzService,
Permission,
ResourceType,
resolveEffectiveRole,
} from '@shumai/core/src/authz/authz'
import {
createKanbanGoalSchema,
updateKanbanGoalSchema,
listKanbanGoalsRequestSchema,
AuditAction,
} from '@shumai/dtos'
import type { Prisma } from '@shumai/db'
type User = Prisma.UserGetPayload<Record<string, never>>
const route = new Hono<{ Variables: { user: User } }>()
.post('/teams/:teamId/kanban/goals', zValidator('json', createKanbanGoalSchema), async (c) => {
const { teamId } = c.req.param()
const req = c.req.valid('json')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Admin,
type: ResourceType.Team,
id: teamId,
})
const role = await resolveEffectiveRole(teamId, undefined, user.id)
const goal = await kanbanService.createGoal(teamId, req, user.id, role)
await auditLogService.logAction({
action: AuditAction.kanban_goal_create,
teamId,
userId: user.id,
itemId: goal.id,
})
return c.json(goal)
})
.get(
'/teams/:teamId/kanban/goals',
zValidator('query', listKanbanGoalsRequestSchema),
async (c) => {
const { teamId } = c.req.param()
const req = c.req.valid('query')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.Team,
id: teamId,
})
const goals = await kanbanService.listGoals(teamId, req)
return c.json({ data: goals })
},
)
.get('/teams/:teamId/kanban/goals/:goalId', async (c) => {
const { goalId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.KanbanGoal,
id: goalId,
})
const goal = await kanbanService.getGoal(goalId)
return c.json(goal)
})
.patch(
'/teams/:teamId/kanban/goals/:goalId',
zValidator('json', updateKanbanGoalSchema),
async (c) => {
const { teamId, goalId } = c.req.param()
const req = c.req.valid('json')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Admin,
type: ResourceType.KanbanGoal,
id: goalId,
})
const role = await resolveEffectiveRole(teamId, undefined, user.id)
const goal = await kanbanService.updateGoal(goalId, req, role)
await auditLogService.logAction({
action: AuditAction.kanban_goal_update,
teamId,
userId: user.id,
itemId: goalId,
})
return c.json(goal)
},
)
.delete('/teams/:teamId/kanban/goals/:goalId', async (c) => {
const { teamId, goalId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Admin,
type: ResourceType.KanbanGoal,
id: goalId,
})
const role = await resolveEffectiveRole(teamId, undefined, user.id)
await kanbanService.deleteGoal(goalId, role)
await auditLogService.logAction({
action: AuditAction.kanban_goal_delete,
teamId,
userId: user.id,
itemId: goalId,
})
return c.json({ ok: true })
})
export default route
+14
View File
@@ -0,0 +1,14 @@
import { Hono } from 'hono'
import type { Prisma } from '@shumai/db'
import goalsRoute from './goals'
import tasksRoute from './tasks'
import commentsRoute from './comments'
type User = Prisma.UserGetPayload<Record<string, never>>
const kanbanRoute = new Hono<{ Variables: { user: User } }>()
.route('/', goalsRoute)
.route('/', tasksRoute)
.route('/', commentsRoute)
export default kanbanRoute
+689
View File
@@ -0,0 +1,689 @@
import { describe, it, expect, vi, beforeEach } from 'vitest'
import { Hono, type Context, type Next } from 'hono'
import { kanbanService } from '@shumai/core/src/kanban/kanban'
import { auditLogService } from '@shumai/core/src/auditLog/auditLog'
import { notificationService } from '@shumai/core/src/notification/notification'
import { KanbanTaskStatus, KanbanTaskPriority } from '@shumai/db/enums'
import kanbanRoute from './index'
vi.mock('@shumai/core/src/authz/authz', () => ({
authzService: {
hasPermission: vi.fn().mockResolvedValue(undefined),
},
resolveEffectiveRole: vi.fn().mockResolvedValue('owner'),
Permission: {
Read: 'Read',
Edit: 'Edit',
Admin: 'Admin',
},
ResourceType: {
Team: 'team',
Project: 'project',
KanbanGoal: 'kanbanGoal',
KanbanTask: 'kanbanTask',
},
}))
vi.mock('@shumai/core/src/auditLog/auditLog', () => ({
auditLogService: {
logAction: vi.fn().mockResolvedValue({}),
},
}))
vi.mock('@shumai/core/src/notification/notification', () => ({
notificationService: {
notifyKanbanTaskEvent: vi.fn().mockResolvedValue(undefined),
create: vi.fn().mockResolvedValue(undefined),
},
}))
describe('Kanban API Routes', () => {
const teamId = 'team-1'
const taskId = 'task-1'
const goalId = 'goal-1'
const authMiddleware = async (c: Context, next: Next) => {
c.set('user', { id: 'user-1', name: 'Test User' })
await next()
}
let app: Hono
beforeEach(() => {
vi.clearAllMocks()
vi.mocked(auditLogService.logAction).mockResolvedValue({} as any) // eslint-disable-line @typescript-eslint/no-explicit-any
vi.mocked(notificationService.notifyKanbanTaskEvent).mockResolvedValue(undefined as any) // eslint-disable-line @typescript-eslint/no-explicit-any
app = new Hono()
app.use('*', authMiddleware)
app.route('/', kanbanRoute)
})
// --------------------------------------------------------------------------
// Goals Endpoints
// --------------------------------------------------------------------------
describe('Goals Endpoints', () => {
it('POST /teams/:teamId/kanban/goals', async () => {
const mockCreate = vi.spyOn(kanbanService, 'createGoal').mockResolvedValue({
id: goalId,
title: 'New Goal',
description: 'Goal description',
teamId,
creatorId: 'user-1',
taskCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const res = await app.request(`/teams/${teamId}/kanban/goals`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ title: 'New Goal', description: 'Goal description' }),
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.id).toBe(goalId)
expect(mockCreate).toHaveBeenCalledWith(
teamId,
{ title: 'New Goal', description: 'Goal description' },
'user-1',
'owner',
)
})
it('GET /teams/:teamId/kanban/goals', async () => {
const mockList = vi.spyOn(kanbanService, 'listGoals').mockResolvedValue([
{
id: goalId,
title: 'Goal 1',
teamId,
creatorId: 'user-1',
taskCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
},
])
const res = await app.request(`/teams/${teamId}/kanban/goals`)
expect(res.status).toBe(200)
const json = await res.json()
expect(json.data).toHaveLength(1)
expect(mockList).toHaveBeenCalledWith(teamId, expect.any(Object))
})
it('PATCH /teams/:teamId/kanban/goals/:goalId', async () => {
const mockUpdate = vi.spyOn(kanbanService, 'updateGoal').mockResolvedValue({
id: goalId,
title: 'Updated Goal',
teamId,
creatorId: 'user-1',
taskCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const res = await app.request(`/teams/${teamId}/kanban/goals/${goalId}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ title: 'Updated Goal' }),
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.title).toBe('Updated Goal')
expect(mockUpdate).toHaveBeenCalledWith(goalId, { title: 'Updated Goal' }, 'owner')
})
it('DELETE /teams/:teamId/kanban/goals/:goalId', async () => {
const mockDelete = vi.spyOn(kanbanService, 'deleteGoal').mockResolvedValue(undefined)
const res = await app.request(`/teams/${teamId}/kanban/goals/${goalId}`, {
method: 'DELETE',
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.ok).toBe(true)
expect(mockDelete).toHaveBeenCalledWith(goalId, 'owner')
})
})
// --------------------------------------------------------------------------
// Tasks Endpoints
// --------------------------------------------------------------------------
describe('Tasks Endpoints', () => {
it('POST /teams/:teamId/kanban/tasks', async () => {
const mockCreate = vi.spyOn(kanbanService, 'createTask').mockResolvedValue({
id: taskId,
title: 'New Task',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.MEDIUM,
teamId,
creator: { id: 'user-1', name: 'User 1' },
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const res = await app.request(`/teams/${teamId}/kanban/tasks`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ title: 'New Task', isAgentTask: false }),
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.id).toBe(taskId)
expect(mockCreate).toHaveBeenCalledWith(teamId, expect.any(Object), 'user-1', 'owner')
})
it('GET /teams/:teamId/kanban/tasks (with isAgentTask and goal filters)', async () => {
const mockList = vi.spyOn(kanbanService, 'listTasks').mockResolvedValue({
data: [
{
id: taskId,
title: 'Task 1',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.MEDIUM,
teamId,
creator: { id: 'user-1', name: 'User 1' },
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
},
],
pageInfo: { total: 1 },
})
const res = await app.request(
`/teams/${teamId}/kanban/tasks?isAgentTask=false&status=READY&goalId=goal-1`,
)
expect(res.status).toBe(200)
const json = await res.json()
expect(json.data).toHaveLength(1)
expect(mockList).toHaveBeenCalledWith(
teamId,
expect.objectContaining({
isAgentTask: false,
status: 'READY',
goalId: 'goal-1',
}),
)
})
it('GET /teams/:teamId/kanban/tasks/:taskId', async () => {
const mockGet = vi.spyOn(kanbanService, 'getTask').mockResolvedValue({
id: taskId,
title: 'Task 1',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.MEDIUM,
teamId,
creator: { id: 'user-1', name: 'User 1' },
dependencies: [],
dependents: [],
assets: [],
comments: [],
events: [],
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}`)
expect(res.status).toBe(200)
const json = await res.json()
expect(json.id).toBe(taskId)
expect(mockGet).toHaveBeenCalledWith(taskId)
})
it('PATCH /teams/:teamId/kanban/tasks/:taskId', async () => {
vi.spyOn(kanbanService, 'getTask').mockResolvedValue({
id: taskId,
title: 'Old Task Title',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.MEDIUM,
teamId,
creator: { id: 'user-1', name: 'User 1' },
dependencies: [],
dependents: [],
assets: [],
comments: [],
events: [],
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const mockUpdate = vi.spyOn(kanbanService, 'updateTask').mockResolvedValue({
id: taskId,
title: 'Updated Task Title',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.HIGH,
teamId,
creator: { id: 'user-1', name: 'User 1' },
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ priority: 'HIGH', status: 'DONE', reason: 'All done' }),
})
expect(res.status).toBe(200)
expect(mockUpdate).toHaveBeenCalledWith(
taskId,
{ priority: 'HIGH', status: 'DONE', reason: 'All done' },
'user-1',
'owner',
)
})
it('PATCH /teams/:teamId/kanban/tasks/:taskId with beforeIndex and afterIndex', async () => {
vi.spyOn(kanbanService, 'getTask').mockResolvedValue({
id: taskId,
title: 'Task 1',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.MEDIUM,
sortIndex: 'a0V',
teamId,
creator: { id: 'user-1', name: 'User 1' },
dependencies: [],
dependents: [],
assets: [],
comments: [],
events: [],
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const mockUpdate = vi.spyOn(kanbanService, 'updateTask').mockResolvedValue({
id: taskId,
title: 'Task 1',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.MEDIUM,
sortIndex: 'a0V',
teamId,
creator: { id: 'user-1', name: 'User 1' },
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ status: 'READY', beforeIndex: 'a1', afterIndex: 'a0' }),
})
expect(res.status).toBe(200)
expect(mockUpdate).toHaveBeenCalledWith(
taskId,
{ status: 'READY', beforeIndex: 'a1', afterIndex: 'a0' },
'user-1',
'owner',
)
})
it('PATCH /teams/:teamId/kanban/tasks/:taskId with fromStatus for CAS', async () => {
vi.spyOn(kanbanService, 'getTask').mockResolvedValue({
id: taskId,
title: 'Task 1',
isAgentTask: false,
status: KanbanTaskStatus.TODO,
priority: KanbanTaskPriority.MEDIUM,
teamId,
creator: { id: 'user-1', name: 'User 1' },
dependencies: [],
dependents: [],
assets: [],
comments: [],
events: [],
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const mockUpdate = vi.spyOn(kanbanService, 'updateTask').mockResolvedValue({
id: taskId,
title: 'Task 1',
isAgentTask: false,
status: KanbanTaskStatus.IN_PROGRESS,
priority: KanbanTaskPriority.MEDIUM,
teamId,
creator: { id: 'user-1', name: 'User 1' },
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ fromStatus: 'TODO', status: 'IN_PROGRESS' }),
})
expect(res.status).toBe(200)
expect(mockUpdate).toHaveBeenCalledWith(
taskId,
{ fromStatus: 'TODO', status: 'IN_PROGRESS' },
'user-1',
'owner',
)
})
it('DELETE /teams/:teamId/kanban/tasks/:taskId', async () => {
vi.spyOn(kanbanService, 'getTask').mockResolvedValue({
id: taskId,
title: 'Task to delete',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.MEDIUM,
teamId,
creator: { id: 'user-1', name: 'User 1' },
dependencies: [],
dependents: [],
assets: [],
comments: [],
events: [],
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const mockDelete = vi.spyOn(kanbanService, 'deleteTask').mockResolvedValue({
id: taskId,
title: 'Task to delete',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.MEDIUM,
teamId,
creator: { id: 'user-1', name: 'User 1' },
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}`, {
method: 'DELETE',
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.success).toBe(true)
expect(mockDelete).toHaveBeenCalledWith(taskId, 'user-1', 'owner')
})
it('GET /teams/:teamId/kanban/tasks/:taskId/assets', async () => {
const mockListTaskAssets = vi.spyOn(kanbanService, 'listTaskAssets').mockResolvedValue([
{
id: 'asset-1',
name: 'Video.mp4',
type: 'file',
proxyType: 'video',
thumbnailUrl: 'http://example.com/thumb.jpg',
path: '/Project/Video.mp4',
creator: { id: 'user-1', name: 'User 1' },
createdAt: new Date().toISOString(),
},
])
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}/assets`)
expect(res.status).toBe(200)
const json = await res.json()
expect(json).toHaveLength(1)
expect(json[0].name).toBe('Video.mp4')
expect(mockListTaskAssets).toHaveBeenCalledWith(taskId)
})
it('POST /teams/:teamId/kanban/tasks/:taskId/assets', async () => {
const mockLinkAssets = vi.spyOn(kanbanService, 'linkAssets').mockResolvedValue(undefined)
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}/assets`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ assetIds: ['asset-1', 'asset-2'] }),
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.success).toBe(true)
expect(mockLinkAssets).toHaveBeenCalledWith(teamId, taskId, ['asset-1', 'asset-2'])
})
it('DELETE /teams/:teamId/kanban/tasks/:taskId/assets/:assetId', async () => {
const mockUnlinkAsset = vi.spyOn(kanbanService, 'unlinkAsset').mockResolvedValue(undefined)
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}/assets/asset-1`, {
method: 'DELETE',
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.success).toBe(true)
expect(mockUnlinkAsset).toHaveBeenCalledWith(teamId, taskId, 'asset-1')
})
it('GET /teams/:teamId/kanban/assets/:assetId/tasks', async () => {
const mockListTasksForAsset = vi.spyOn(kanbanService, 'listTasksForAsset').mockResolvedValue([
{
id: taskId,
title: 'Task linked to asset',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.MEDIUM,
teamId,
creator: { id: 'user-1', name: 'User 1' },
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 1,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
},
])
const res = await app.request(`/teams/${teamId}/kanban/assets/asset-1/tasks`)
expect(res.status).toBe(200)
const json = await res.json()
expect(json.total).toBe(1)
expect(json.data).toHaveLength(1)
expect(mockListTasksForAsset).toHaveBeenCalledWith(teamId, 'asset-1')
})
it('POST /teams/:teamId/kanban/assets/:assetId/tasks', async () => {
const mockLinkAsset = vi.spyOn(kanbanService, 'linkAsset').mockResolvedValue(undefined)
const res = await app.request(`/teams/${teamId}/kanban/assets/asset-1/tasks`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ taskId }),
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.success).toBe(true)
expect(mockLinkAsset).toHaveBeenCalledWith(teamId, taskId, 'asset-1')
})
it('DELETE /teams/:teamId/kanban/assets/:assetId/tasks/:taskId', async () => {
const mockUnlinkAsset = vi.spyOn(kanbanService, 'unlinkAsset').mockResolvedValue(undefined)
const res = await app.request(`/teams/${teamId}/kanban/assets/asset-1/tasks/${taskId}`, {
method: 'DELETE',
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.success).toBe(true)
expect(mockUnlinkAsset).toHaveBeenCalledWith(teamId, taskId, 'asset-1')
})
})
// --------------------------------------------------------------------------
// Comments, Attachments & Events
// --------------------------------------------------------------------------
describe('Comments, Attachments and Events Endpoints', () => {
it('POST /teams/:teamId/kanban/attachments', async () => {
const mockAttachment = vi.spyOn(kanbanService, 'createAttachment').mockResolvedValue({
id: 'att-1',
name: 'test.png',
key: 'kanban/attachments/test.png',
sizeByte: 1024,
uploadUrl: 'http://s3/upload',
proxyType: 'image',
})
const res = await app.request(`/teams/${teamId}/kanban/attachments`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ fileName: 'test.png', size: 1024, contentType: 'image/png' }),
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.id).toBe('att-1')
expect(mockAttachment).toHaveBeenCalledWith(teamId, {
fileName: 'test.png',
size: 1024,
contentType: 'image/png',
})
})
it('POST /teams/:teamId/kanban/tasks/:taskId/comments', async () => {
const mockAdd = vi.spyOn(kanbanService, 'addComment').mockResolvedValue({
id: 'c-1',
taskId,
author: { id: 'user-1', name: 'User 1' },
body: 'Here is a note',
attachments: [],
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}/comments`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
body: 'Here is a note',
attachments: [
{
id: 'att-1',
name: 'test.png',
key: 'key-1',
sizeByte: 1024,
proxyType: 'image',
},
],
}),
})
expect(res.status).toBe(200)
expect(mockAdd).toHaveBeenCalledWith(taskId, 'user-1', 'Here is a note', [
{
id: 'att-1',
name: 'test.png',
key: 'key-1',
sizeByte: 1024,
proxyType: 'image',
},
])
})
it('DELETE /teams/:teamId/kanban/tasks/:taskId/comments/:commentId', async () => {
const mockDelete = vi.spyOn(kanbanService, 'deleteComment').mockResolvedValue()
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}/comments/c-1`, {
method: 'DELETE',
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.success).toBe(true)
expect(mockDelete).toHaveBeenCalledWith(taskId, 'c-1', 'user-1', 'owner')
})
it('GET /teams/:teamId/kanban/tasks/:taskId/comments', async () => {
const mockList = vi.spyOn(kanbanService, 'listComments').mockResolvedValue([
{
id: 'c-1',
taskId,
author: { id: 'user-1', name: 'User 1' },
body: 'Note',
attachments: [],
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
},
])
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}/comments`)
expect(res.status).toBe(200)
const json = await res.json()
expect(json.data).toHaveLength(1)
expect(mockList).toHaveBeenCalledWith(taskId)
})
it('GET /teams/:teamId/kanban/tasks/:taskId/events', async () => {
const mockEvents = vi.spyOn(kanbanService, 'listEvents').mockResolvedValue([
{
id: 'e-1',
taskId,
actor: { id: 'user-1', name: 'User 1' },
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type: 'CREATED' as any,
createdAt: new Date().toISOString(),
},
])
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}/events`)
expect(res.status).toBe(200)
const json = await res.json()
expect(json.data).toHaveLength(1)
expect(mockEvents).toHaveBeenCalledWith(taskId)
})
})
})
+331
View File
@@ -0,0 +1,331 @@
import { zValidator } from '@hono/zod-validator'
import { Hono } from 'hono'
import { kanbanService } from '@shumai/core/src/kanban/kanban'
import { notificationService } from '@shumai/core/src/notification/notification'
import { auditLogService } from '@shumai/core/src/auditLog/auditLog'
import {
authzService,
Permission,
ResourceType,
resolveEffectiveRole,
} from '@shumai/core/src/authz/authz'
import {
createKanbanTaskSchema,
updateKanbanTaskSchema,
listKanbanTasksRequestSchema,
linkTaskAssetsSchema,
linkAssetToTaskSchema,
AuditAction,
} from '@shumai/dtos'
import type { Prisma } from '@shumai/db'
import { HTTPException } from 'hono/http-exception'
type User = Prisma.UserGetPayload<Record<string, never>>
const route = new Hono<{ Variables: { user: User } }>()
.post('/teams/:teamId/kanban/tasks', zValidator('json', createKanbanTaskSchema), async (c) => {
const { teamId } = c.req.param()
const req = c.req.valid('json')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.Team,
id: teamId,
})
const role = await resolveEffectiveRole(teamId, undefined, user.id)
if (!role) {
throw new HTTPException(403, { message: 'User is not a member of the team' })
}
const task = await kanbanService.createTask(teamId, req, user.id, role)
await auditLogService.logAction({
action: AuditAction.kanban_task_create,
teamId,
userId: user.id,
projectId: task.projectId ?? undefined,
itemId: task.id,
})
if (req.assigneeId && req.assigneeId !== user.id) {
notificationService.notifyKanbanTaskEvent({
type: 'kanban_task_assigned',
teamId,
projectId: task.projectId,
creatorId: user.id,
kanbanTaskId: task.id,
targetUserId: req.assigneeId,
})
}
if (req.reporterId && req.reporterId !== user.id && req.reporterId !== req.assigneeId) {
notificationService.notifyKanbanTaskEvent({
type: 'kanban_task_created',
teamId,
projectId: task.projectId,
creatorId: user.id,
kanbanTaskId: task.id,
targetUserId: req.reporterId,
})
}
return c.json(task)
})
.get(
'/teams/:teamId/kanban/tasks',
zValidator('query', listKanbanTasksRequestSchema),
async (c) => {
const { teamId } = c.req.param()
const req = c.req.valid('query')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.Team,
id: teamId,
})
const result = await kanbanService.listTasks(teamId, req)
return c.json(result)
},
)
.get('/teams/:teamId/kanban/tasks/:taskId', async (c) => {
const { taskId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.KanbanTask,
id: taskId,
})
const task = await kanbanService.getTask(taskId)
return c.json(task)
})
.patch(
'/teams/:teamId/kanban/tasks/:taskId',
zValidator('json', updateKanbanTaskSchema),
async (c) => {
const { teamId, taskId } = c.req.param()
const req = c.req.valid('json')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Edit,
type: ResourceType.KanbanTask,
id: taskId,
})
const existing = await kanbanService.getTask(taskId)
const role = await resolveEffectiveRole(teamId, existing.projectId ?? undefined, user.id)
const task = await kanbanService.updateTask(taskId, req, user.id, role)
const hasMeaningfulChanges =
req.title !== undefined ||
req.description !== undefined ||
req.priority !== undefined ||
req.startDate !== undefined ||
req.dueDate !== undefined ||
req.goalId !== undefined ||
req.assigneeId !== undefined ||
req.reporterId !== undefined ||
req.targetFolderId !== undefined ||
(req.status !== undefined && req.status !== existing.status)
if (hasMeaningfulChanges) {
await auditLogService.logAction({
action: AuditAction.kanban_task_update,
teamId,
userId: user.id,
projectId: task.projectId ?? undefined,
itemId: task.id,
})
}
if (req.status !== undefined && req.status !== existing.status) {
notificationService.notifyKanbanTaskEvent({
type: 'kanban_task_status_updated',
teamId,
projectId: task.projectId,
creatorId: user.id,
kanbanTaskId: task.id,
stakeholderIds: [task.creator?.id, task.assignee?.id, task.reporter?.id],
})
}
if (
req.assigneeId !== undefined &&
req.assigneeId !== existing.assignee?.id &&
req.assigneeId !== null &&
req.assigneeId !== user.id
) {
notificationService.notifyKanbanTaskEvent({
type: 'kanban_task_assigned',
teamId,
projectId: task.projectId,
creatorId: user.id,
kanbanTaskId: task.id,
targetUserId: req.assigneeId,
})
}
const hasOtherDetailsChanged =
req.title !== undefined ||
req.description !== undefined ||
req.priority !== undefined ||
req.startDate !== undefined ||
req.dueDate !== undefined ||
req.goalId !== undefined ||
req.reporterId !== undefined ||
req.targetFolderId !== undefined
if (hasOtherDetailsChanged && req.status === undefined) {
notificationService.notifyKanbanTaskEvent({
type: 'kanban_task_updated',
teamId,
projectId: task.projectId,
creatorId: user.id,
kanbanTaskId: task.id,
stakeholderIds: [task.creator?.id, task.assignee?.id, task.reporter?.id],
})
}
return c.json(task)
},
)
.delete('/teams/:teamId/kanban/tasks/:taskId', async (c) => {
const { teamId, taskId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Edit,
type: ResourceType.KanbanTask,
id: taskId,
})
const existing = await kanbanService.getTask(taskId)
const role = await resolveEffectiveRole(teamId, existing.projectId ?? undefined, user.id)
notificationService.notifyKanbanTaskEvent({
type: 'kanban_task_deleted',
teamId,
projectId: existing.projectId,
creatorId: user.id,
kanbanTaskId: taskId,
stakeholderIds: [existing.creator?.id, existing.assignee?.id, existing.reporter?.id],
})
await auditLogService.logAction({
action: AuditAction.kanban_task_delete,
teamId,
userId: user.id,
projectId: existing.projectId ?? undefined,
itemId: taskId,
})
await kanbanService.deleteTask(taskId, user.id, role)
return c.json({ success: true })
})
.get('/teams/:teamId/kanban/tasks/:taskId/assets', async (c) => {
const { taskId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.KanbanTask,
id: taskId,
})
const assets = await kanbanService.listTaskAssets(taskId)
return c.json(assets)
})
.post(
'/teams/:teamId/kanban/tasks/:taskId/assets',
zValidator('json', linkTaskAssetsSchema),
async (c) => {
const { teamId, taskId } = c.req.param()
const req = c.req.valid('json')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Edit,
type: ResourceType.KanbanTask,
id: taskId,
})
await kanbanService.linkAssets(teamId, taskId, req.assetIds)
return c.json({ success: true })
},
)
.delete('/teams/:teamId/kanban/tasks/:taskId/assets/:assetId', async (c) => {
const { teamId, taskId, assetId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Edit,
type: ResourceType.KanbanTask,
id: taskId,
})
await kanbanService.unlinkAsset(teamId, taskId, assetId)
return c.json({ success: true })
})
.get('/teams/:teamId/kanban/assets/:assetId/tasks', async (c) => {
const { teamId, assetId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.Team,
id: teamId,
})
const tasks = await kanbanService.listTasksForAsset(teamId, assetId)
return c.json({ data: tasks, total: tasks.length })
})
.post(
'/teams/:teamId/kanban/assets/:assetId/tasks',
zValidator('json', linkAssetToTaskSchema),
async (c) => {
const { teamId, assetId } = c.req.param()
const req = c.req.valid('json')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Edit,
type: ResourceType.KanbanTask,
id: req.taskId,
})
await kanbanService.linkAsset(teamId, req.taskId, assetId)
return c.json({ success: true })
},
)
.delete('/teams/:teamId/kanban/assets/:assetId/tasks/:taskId', async (c) => {
const { teamId, assetId, taskId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Edit,
type: ResourceType.KanbanTask,
id: taskId,
})
await kanbanService.unlinkAsset(teamId, taskId, assetId)
return c.json({ success: true })
})
export default route
+12
View File
@@ -31,6 +31,7 @@ describe('authMiddleware', () => {
.get('/test', (c) => c.text('ok'))
.post('/test', (c) => c.text('ok'))
.post('/test/search', (c) => c.text('ok'))
.post('/test/recents/view', (c) => c.text('ok'))
beforeEach(() => {
vi.resetAllMocks()
@@ -81,6 +82,17 @@ describe('authMiddleware', () => {
expect(await res.json()).toEqual({ error: 'System is in read-only mode' })
})
it('allows POST /recents/view for reviewer', async () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
vi.mocked(auth.api.getSession).mockResolvedValue({ user: { id: 'user1' } } as any)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
vi.mocked(userService.getUserById).mockResolvedValue({ id: 'user1' } as any)
vi.mocked(teamService.hasWritableRoleInAnyTeam).mockResolvedValue(false)
const res = await app.request('/test/recents/view', { method: 'POST' })
expect(res.status).toBe(200)
})
it('allows POST /search for reviewer', async () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
vi.mocked(auth.api.getSession).mockResolvedValue({ user: { id: 'user1' } } as any)
+3 -1
View File
@@ -36,7 +36,9 @@ export const authMiddleware = createMiddleware<{
if (process.env.SHUMAI_DEMO_MODE === '1') {
const method = c.req.method.toUpperCase()
const path = c.req.path
if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method) && !path.endsWith('/search')) {
const isAllowedDemoWrite =
method === 'POST' && (path.endsWith('/search') || path.endsWith('/recents/view'))
if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method) && !isAllowedDemoWrite) {
const hasWritable = await teamService.hasWritableRoleInAnyTeam(user.id)
if (!hasWritable) {
+2
View File
@@ -150,6 +150,8 @@ describe('notification api', () => {
yourUploads: true,
otherUploads: false,
statusUpdates: true,
kanbanTasks: true,
kanbanComments: true,
},
)
})
+43
View File
@@ -35,6 +35,7 @@ vi.mock('@shumai/core/src/project/project', () => ({
},
}))
vi.mock('@shumai/core/src/asset/asset')
vi.mock('@shumai/core/src/auditLog/auditLog', () => ({
auditLogService: {
logAction: vi.fn().mockResolvedValue({}),
@@ -410,4 +411,46 @@ describe('project api', () => {
})
expect(projectService.getUserProjects).toHaveBeenCalledWith('user1', 10)
})
it('GET /projects/:projectId/recents', async () => {
vi.mocked(assetService.listRecents).mockResolvedValue({
data: [{ id: 'file1', name: 'video.mp4', type: 'file' }] as any, // eslint-disable-line @typescript-eslint/no-explicit-any
pageInfo: { total: 1 },
})
const res = await app.request('/projects/p1/recents?first=20')
expect(res.status).toBe(200)
const json = await res.json()
expect(json.data).toHaveLength(1)
expect(json.data[0].id).toBe('file1')
expect(authzService.hasPermission).toHaveBeenCalledWith({
user: expect.anything(),
permission: Permission.Read,
type: ResourceType.Project,
id: 'p1',
})
expect(assetService.listRecents).toHaveBeenCalledWith('user1', 'p1', { first: 20 })
})
it('POST /projects/:projectId/recents/view', async () => {
vi.mocked(assetService.recordRecentView).mockResolvedValue(undefined)
const res = await app.request('/projects/p1/recents/view', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ assetId: 'file1' }),
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.success).toBe(true)
expect(authzService.hasPermission).toHaveBeenCalledWith({
user: expect.anything(),
permission: Permission.Read,
type: ResourceType.Project,
id: 'p1',
})
expect(assetService.recordRecentView).toHaveBeenCalledWith('user1', 'p1', 'file1')
})
})
+36
View File
@@ -11,6 +11,8 @@ import {
recentlyDeletedRequestSchema,
updateProjectMemberRoleRequestSchema,
addProjectMemberRequestSchema,
listRecentsRequestSchema,
recordRecentViewRequestSchema,
} from '@shumai/dtos'
import { listMembersQuerySchema, paginationParamsSchema, AuditAction } from '@shumai/dtos'
import type { Prisma } from '@shumai/db'
@@ -118,6 +120,40 @@ const route = new Hono<{ Variables: { user: User } }>()
return c.json(resp)
},
)
.get('/projects/:projectId/recents', zValidator('query', listRecentsRequestSchema), async (c) => {
const projectId = c.req.param('projectId')
const user = c.get('user')
const req = c.req.valid('query')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.Project,
id: projectId,
})
const resp = await assetService.listRecents(user.id, projectId, req)
return c.json(resp)
})
.post(
'/projects/:projectId/recents/view',
zValidator('json', recordRecentViewRequestSchema),
async (c) => {
const projectId = c.req.param('projectId')
const user = c.get('user')
const req = c.req.valid('json')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.Project,
id: projectId,
})
await assetService.recordRecentView(user.id, projectId, req.assetId)
return c.json({ success: true })
},
)
.post('/projects/:projectId/empty-trash', async (c) => {
const projectId = c.req.param('projectId')
const user = c.get('user')
+15
View File
@@ -245,6 +245,21 @@ describe('team api', () => {
expect(mockUpdateSettings).toHaveBeenCalledWith('t1', 'transcode.videoStrategy', 'all')
})
it('PATCH /teams/:teamId/settings updates transcode.hardwareAcceleration', async () => {
mockUpdateSettings.mockResolvedValue({ transcode: { hardwareAcceleration: 'auto' } })
const res = await app.request('/teams/t1/settings', {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ key: 'transcode.hardwareAcceleration', value: 'auto' }),
})
expect(res.status).toBe(200)
const data = await res.json()
expect(data.transcode.hardwareAcceleration).toBe('auto')
expect(mockUpdateSettings).toHaveBeenCalledWith('t1', 'transcode.hardwareAcceleration', 'auto')
})
it('GET /teams/:teamId/user-metadata returns all metadata for the user in the team', async () => {
mockListUserMetadata.mockResolvedValue([
{ key: 'key1', value: 'value1' },
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/core",
"version": "0.3.9",
"version": "0.4.0",
"private": true,
"type": "module",
"main": "./src/index.ts",
+129 -1
View File
@@ -1998,7 +1998,7 @@ describe('AssetService', () => {
expect(await prisma.asset.findUnique({ where: { id: folderA.id } })).toBeNull()
const remainingChildren = await prisma.asset.count({ where: { parentId: folderA.id } })
expect(remainingChildren).toBe(0)
})
}, 20000)
it('should delete the entire directory prefix for assets with complex keys (e.g., files/ULID/raw)', async () => {
const { project } = await setupBasicAssets()
@@ -3575,5 +3575,133 @@ describe('AssetService — natural sort by name', () => {
})
expect(updatedFile.name).toBe('renamed.png')
})
it('cascades soft-delete and restoration to symlinks and updates parent fileCount', async () => {
const team = await prisma.team.create({ data: { name: 'Test Team ' + Date.now() } })
const project = await prisma.project.create({
data: { name: 'Test Project', teamId: team.id },
})
const rootFolder = await prisma.asset.create({
data: {
name: 'Root',
type: AssetType.folder,
projectId: project.id,
status: AssetStatus.uploaded,
},
})
const shareRoot = await prisma.asset.create({
data: {
name: 'Share Root',
type: AssetType.share_root,
projectId: project.id,
status: AssetStatus.uploaded,
fileCount: 0,
},
})
const file = await prisma.asset.create({
data: {
name: 'test-file.txt',
type: AssetType.file,
parentId: rootFolder.id,
projectId: project.id,
status: AssetStatus.uploaded,
},
})
await prisma.asset.update({
where: { id: rootFolder.id },
data: { fileCount: 1 },
})
const symlink = await prisma.asset.create({
data: {
name: file.name,
type: AssetType.symlink,
parentId: shareRoot.id,
targetId: file.id,
projectId: project.id,
status: AssetStatus.uploaded,
},
})
await prisma.asset.update({
where: { id: shareRoot.id },
data: { fileCount: 1 },
})
// Soft delete the file
await assetService.deleteAssets([file.id])
const deletedSymlink = await prisma.asset.findUnique({ where: { id: symlink.id } })
expect(deletedSymlink?.isDeleted).toBe(true)
expect(deletedSymlink?.status).toBe(AssetStatus.trashed)
const updatedShareRoot = await prisma.asset.findUnique({ where: { id: shareRoot.id } })
expect(updatedShareRoot?.fileCount).toBe(0)
// Restore the file
await assetService.restoreAssets([file.id])
const restoredSymlink = await prisma.asset.findUnique({ where: { id: symlink.id } })
expect(restoredSymlink?.isDeleted).toBe(false)
expect(restoredSymlink?.status).toBe(AssetStatus.processed)
const restoredShareRoot = await prisma.asset.findUnique({ where: { id: shareRoot.id } })
expect(restoredShareRoot?.fileCount).toBe(1)
})
it('cascades permanent purge to symlinks when emptying trash', async () => {
const team = await prisma.team.create({ data: { name: 'Test Team ' + Date.now() } })
const project = await prisma.project.create({
data: { name: 'Test Project', teamId: team.id },
})
const rootFolder = await prisma.asset.create({
data: {
name: 'Root',
type: AssetType.folder,
projectId: project.id,
status: AssetStatus.uploaded,
},
})
const shareRoot = await prisma.asset.create({
data: {
name: 'Share Root',
type: AssetType.share_root,
projectId: project.id,
status: AssetStatus.uploaded,
fileCount: 0,
},
})
const file = await prisma.asset.create({
data: {
name: 'file-to-purge.txt',
type: AssetType.file,
parentId: rootFolder.id,
projectId: project.id,
status: AssetStatus.uploaded,
},
})
const symlink = await prisma.asset.create({
data: {
name: file.name,
type: AssetType.symlink,
parentId: shareRoot.id,
targetId: file.id,
projectId: project.id,
status: AssetStatus.uploaded,
},
})
// Soft delete then empty trash
await assetService.deleteAssets([file.id])
await assetService.emptyTrash(project.id)
const purgedFile = await prisma.asset.findUnique({ where: { id: file.id } })
expect(purgedFile).toBeNull()
const purgedSymlink = await prisma.asset.findUnique({ where: { id: symlink.id } })
expect(purgedSymlink).toBeNull()
})
})
})
+235 -27
View File
@@ -16,6 +16,7 @@ import {
UpdateAssetNameRequest,
UpdateAssetOrderRequest,
AssetUserInfo,
ListRecentsRequest,
} from '@shumai/dtos'
import { type Asset, AssetStatus, AssetType, Prisma, type StorageKey } from '@shumai/db'
import { HTTPException } from 'hono/http-exception'
@@ -29,25 +30,27 @@ import { getAvatarUrl } from '@shumai/core/src/user/avatar'
import { getAgentRequiredLevel, getRoleLevel } from '@shumai/core/src/agent/permissions'
import { resolveEffectiveRole } from '@shumai/core/src/authz/authz'
type AssetWithIncludes = Prisma.AssetGetPayload<{
include: {
creator: true
metadataValues: true
storageKey: true
target: {
include: {
creator: true
metadataValues: true
storageKey: true
children: {
include: { creator: true; metadataValues: true; storageKey: true }
}
}
}
children: {
include: { creator: true; metadataValues: true; storageKey: true }
}
}
export const assetInclude = {
creator: true,
metadataValues: true,
storageKey: true,
target: {
include: {
creator: true,
metadataValues: true,
storageKey: true,
children: {
include: { creator: true, metadataValues: true, storageKey: true },
},
},
},
children: {
include: { creator: true, metadataValues: true, storageKey: true },
},
} as const
export type AssetWithIncludes = Prisma.AssetGetPayload<{
include: typeof assetInclude
}>
type CommentWithIncludes = Prisma.AssetCommentGetPayload<{
@@ -629,10 +632,7 @@ export class AssetService {
projectId: req.projectId,
isDeleted: true,
deletedAt: { gte: thirtyDaysAgo },
OR: [
{ type: { in: typesToQuery } },
{ type: AssetType.symlink, target: { type: { in: typesToQuery } } },
],
type: { in: typesToQuery },
}
} else {
if (!req.assetId) {
@@ -651,7 +651,7 @@ export class AssetService {
isDeleted: false,
OR: [
{ type: { in: typesToQuery } },
{ type: AssetType.symlink, target: { type: { in: typesToQuery } } },
{ type: AssetType.symlink, target: { isDeleted: false, type: { in: typesToQuery } } },
],
}
}
@@ -1100,6 +1100,39 @@ export class AssetService {
})
}
const allDeletedIds = [a.id, ...descendantIds]
const symlinks = await tx.asset.findMany({
where: {
targetId: { in: allDeletedIds },
isDeleted: false,
type: AssetType.symlink,
},
})
if (symlinks.length > 0) {
await tx.asset.updateMany({
where: { id: { in: symlinks.map((s) => s.id) } },
data: {
isDeleted: true,
status: AssetStatus.trashed,
deletedAt: new Date(),
},
})
const parentCounts = new Map<string, number>()
for (const s of symlinks) {
if (s.parentId) {
parentCounts.set(s.parentId, (parentCounts.get(s.parentId) || 0) + 1)
}
}
for (const [parentId, count] of parentCounts.entries()) {
await tx.asset.update({
where: { id: parentId },
data: { fileCount: { decrement: count } },
})
}
}
await tx.asset.update({
where: { id: a.id },
data: {
@@ -1123,9 +1156,16 @@ export class AssetService {
UNION ALL
SELECT a.id FROM assets a
INNER JOIN descendant d ON a.parent_id = d.id
),
all_purging_targets AS (
SELECT id FROM descendant
),
all_affected_symlinks AS (
SELECT s.id FROM assets s
WHERE s.type = 'symlink' AND s.target_id IN (SELECT id FROM all_purging_targets)
)
UPDATE assets SET status = 'pending_purge', updated_at = NOW()
WHERE id IN (SELECT id FROM descendant);
WHERE id IN (SELECT id FROM all_purging_targets) OR id IN (SELECT id FROM all_affected_symlinks);
`
}
@@ -1311,6 +1351,39 @@ export class AssetService {
})
}
const allRestoredIds = [a.id, ...descendantIds]
const symlinks = await tx.asset.findMany({
where: {
targetId: { in: allRestoredIds },
isDeleted: true,
type: AssetType.symlink,
},
})
if (symlinks.length > 0) {
await tx.asset.updateMany({
where: { id: { in: symlinks.map((s) => s.id) } },
data: {
isDeleted: false,
status: AssetStatus.processed,
deletedAt: null,
},
})
const parentCounts = new Map<string, number>()
for (const s of symlinks) {
if (s.parentId) {
parentCounts.set(s.parentId, (parentCounts.get(s.parentId) || 0) + 1)
}
}
for (const [parentId, count] of parentCounts.entries()) {
await tx.asset.update({
where: { id: parentId },
data: { fileCount: { increment: count } },
})
}
}
await tx.asset.update({
where: { id: a.id },
data: {
@@ -1623,7 +1696,7 @@ export class AssetService {
return { data: infos, pageInfo }
}
private async toAssetInfos(assets: AssetWithIncludes[]): Promise<AssetInfo[]> {
async toAssetInfos(assets: AssetWithIncludes[]): Promise<AssetInfo[]> {
const stackIds = new Set<string>()
for (const a of assets) {
@@ -2131,7 +2204,7 @@ export class AssetService {
)
}
private async toPreviewInfo(asset: Asset | AssetWithIncludes): Promise<PreviewInfo | null> {
async toPreviewInfo(asset: Asset | AssetWithIncludes): Promise<PreviewInfo | null> {
if (!asset.media) return null
const proxyType = (asset.media?.proxyType || null) as 'image' | 'video' | 'audio' | 'pdf' | null
@@ -2360,6 +2433,141 @@ export class AssetService {
return results
}
/**
* Record a file view by user in project.
* If the asset is a child file in a version stack, resolves to the version stack.
* Enforces a maximum cap of 100 recent file items per (userId, projectId).
*/
async recordRecentView(userId: string, projectId: string, assetId: string): Promise<void> {
const asset = await this.prismaClient.asset.findFirst({
where: { id: assetId, projectId },
select: {
id: true,
type: true,
parentId: true,
isDeleted: true,
target: { select: { type: true, projectId: true, isDeleted: true } },
},
})
if (!asset || asset.isDeleted) return
const isFileAsset =
asset.type === AssetType.file ||
asset.type === AssetType.version_stack ||
(asset.type === AssetType.symlink &&
asset.target !== null &&
(asset.target.type === AssetType.file || asset.target.type === AssetType.version_stack) &&
asset.target.projectId === projectId &&
!asset.target.isDeleted)
if (!isFileAsset) return
let targetAssetId = asset.id
// If it's a file inside a version stack, record the version stack instead
if (asset.type === AssetType.file && asset.parentId) {
const parent = await this.prismaClient.asset.findFirst({
where: { id: asset.parentId, projectId, type: AssetType.version_stack, isDeleted: false },
select: { id: true },
})
if (parent) {
targetAssetId = parent.id
}
}
const now = new Date()
// Upsert into recent_file_items
await this.prismaClient.recentFileItem.upsert({
where: {
userIdProjectIdAssetId: {
userId,
projectId,
assetId: targetAssetId,
},
},
update: {
viewedAt: now,
},
create: {
userId,
projectId,
assetId: targetAssetId,
viewedAt: now,
},
})
// Prune if more than 100 items for this (userId, projectId)
const count = await this.prismaClient.recentFileItem.count({
where: { userId, projectId },
})
if (count > 100) {
const itemsToKeep = await this.prismaClient.recentFileItem.findMany({
where: { userId, projectId },
orderBy: [{ viewedAt: 'desc' }, { id: 'desc' }],
take: 100,
select: { id: true },
})
const keepIds = itemsToKeep.map((item) => item.id)
await this.prismaClient.recentFileItem.deleteMany({
where: {
userId,
projectId,
id: { notIn: keepIds },
},
})
}
}
/**
* List recent files for user in project, paginated up to 100 total items.
*/
async listRecents(
userId: string,
projectId: string,
req: ListRecentsRequest,
): Promise<PaginatedData<AssetInfo[]>> {
const where = {
userId,
projectId,
asset: {
isDeleted: false,
projectId,
},
}
return paginateQuery(
async (skip, take) => {
if (skip >= 100) return []
const effectiveTake = Math.min(take, 100 - skip)
if (effectiveTake <= 0) return []
const recents = await this.prismaClient.recentFileItem.findMany({
where,
orderBy: [{ viewedAt: 'desc' }, { id: 'desc' }],
skip,
take: effectiveTake,
include: {
asset: {
include: assetInclude,
},
},
})
const assets = recents.map((r) => r.asset).filter((a): a is AssetWithIncludes => !!a)
return await this.toAssetInfos(assets)
},
async () => {
const total = await this.prismaClient.recentFileItem.count({ where })
return Math.min(total, 100)
},
req,
)
}
}
export const assetService = new AssetService()
+278
View File
@@ -0,0 +1,278 @@
import { describe, it, expect } from 'vitest'
import { prisma, AssetType, AssetStatus } from '@shumai/db'
import { setupTestDbHooks } from '@shumai/db/test'
import { assetService } from './asset'
import { projectService } from '../project/project'
describe('AssetService - Recently Viewed', () => {
setupTestDbHooks()
async function setupProject() {
const user1 = await prisma.user.create({
data: { name: 'User 1', email: 'user1@example.com' },
})
const user2 = await prisma.user.create({
data: { name: 'User 2', email: 'user2@example.com' },
})
const team = await prisma.team.create({
data: {
name: 'Test Team',
settings: {
transcode: { videoStrategy: 'best_match' },
},
sandbox: { create: {} },
},
})
await prisma.teamMember.create({
data: {
teamId: team.id,
userId: user1.id,
role: 'owner',
scope: 'team',
},
})
await prisma.teamMember.create({
data: {
teamId: team.id,
userId: user2.id,
role: 'editor',
scope: 'team',
},
})
const project = await projectService.createProject(user1, {
name: 'Test Project',
teamId: team.id,
})
return { user1, user2, team, project }
}
it('records recent file view and returns it in descending order', async () => {
const { user1, project } = await setupProject()
const file1 = await prisma.asset.create({
data: {
name: 'file1.mp4',
type: AssetType.file,
status: 'processed',
projectId: project.id,
parentId: project.rootFolder!,
},
})
const file2 = await prisma.asset.create({
data: {
name: 'file2.mp4',
type: AssetType.file,
status: 'processed',
projectId: project.id,
parentId: project.rootFolder!,
},
})
await assetService.recordRecentView(user1.id, project.id, file1.id)
await assetService.recordRecentView(user1.id, project.id, file2.id)
const list = await assetService.listRecents(user1.id, project.id, {})
expect(list.data.length).toBe(2)
expect(list.data[0].id).toBe(file2.id)
expect(list.data[1].id).toBe(file1.id)
expect(list.pageInfo.total).toBe(2)
})
it('updates viewedAt when viewing the same file again', async () => {
const { user1, project } = await setupProject()
const file1 = await prisma.asset.create({
data: {
name: 'file1.mp4',
type: AssetType.file,
status: 'processed',
projectId: project.id,
parentId: project.rootFolder!,
},
})
const file2 = await prisma.asset.create({
data: {
name: 'file2.mp4',
type: AssetType.file,
status: 'processed',
projectId: project.id,
parentId: project.rootFolder!,
},
})
await assetService.recordRecentView(user1.id, project.id, file1.id)
await assetService.recordRecentView(user1.id, project.id, file2.id)
// View file1 again
await assetService.recordRecentView(user1.id, project.id, file1.id)
const list = await assetService.listRecents(user1.id, project.id, {})
expect(list.data.length).toBe(2)
expect(list.data[0].id).toBe(file1.id)
expect(list.data[1].id).toBe(file2.id)
})
it('records version stack when viewing a child version file', async () => {
const { user1, project } = await setupProject()
const stack = await prisma.asset.create({
data: {
name: 'version_stack',
type: AssetType.version_stack,
status: 'processed',
projectId: project.id,
parentId: project.rootFolder!,
},
})
const version1 = await prisma.asset.create({
data: {
name: 'v1.mp4',
type: AssetType.file,
status: 'processed',
projectId: project.id,
parentId: stack.id,
},
})
await assetService.recordRecentView(user1.id, project.id, version1.id)
const list = await assetService.listRecents(user1.id, project.id, {})
expect(list.data.length).toBe(1)
expect(list.data[0].id).toBe(stack.id)
expect(list.data[0].type).toBe(AssetType.version_stack)
})
it('isolates recents per user', async () => {
const { user1, user2, project } = await setupProject()
const file1 = await prisma.asset.create({
data: {
name: 'file1.mp4',
type: AssetType.file,
status: 'processed',
projectId: project.id,
parentId: project.rootFolder!,
},
})
await assetService.recordRecentView(user1.id, project.id, file1.id)
const user1List = await assetService.listRecents(user1.id, project.id, {})
const user2List = await assetService.listRecents(user2.id, project.id, {})
expect(user1List.data.length).toBe(1)
expect(user2List.data.length).toBe(0)
})
it('does not record assets from another project', async () => {
const { user1, team, project } = await setupProject()
const otherProject = await projectService.createProject(user1, {
name: 'Other Project',
teamId: team.id,
})
const foreignFile = await prisma.asset.create({
data: {
name: 'foreign-file.mp4',
type: AssetType.file,
status: AssetStatus.processed,
projectId: otherProject.id,
parentId: otherProject.rootFolder!,
},
})
await assetService.recordRecentView(user1.id, project.id, foreignFile.id)
const list = await assetService.listRecents(user1.id, project.id, {})
expect(list.data).toHaveLength(0)
})
it('does not record non-file assets', async () => {
const { user1, project } = await setupProject()
const folder = await prisma.asset.create({
data: {
name: 'folder',
type: AssetType.folder,
status: AssetStatus.processed,
projectId: project.id,
parentId: project.rootFolder!,
},
})
await assetService.recordRecentView(user1.id, project.id, folder.id)
const list = await assetService.listRecents(user1.id, project.id, {})
expect(list.data).toHaveLength(0)
})
it('does not return soft-deleted files in recents', async () => {
const { user1, project } = await setupProject()
const file1 = await prisma.asset.create({
data: {
name: 'file1.mp4',
type: AssetType.file,
status: 'processed',
projectId: project.id,
parentId: project.rootFolder!,
},
})
await assetService.recordRecentView(user1.id, project.id, file1.id)
// Soft delete file1
await prisma.asset.update({
where: { id: file1.id },
data: { isDeleted: true, status: 'trashed' },
})
const list = await assetService.listRecents(user1.id, project.id, {})
expect(list.data.length).toBe(0)
})
it('caps recents at 100 items per user/project', async () => {
const { user1, project } = await setupProject()
// Batch create 105 assets
const assetsData = Array.from({ length: 105 }, (_, i) => ({
name: `file_${i}.mp4`,
type: AssetType.file,
status: AssetStatus.processed,
projectId: project.id,
parentId: project.rootFolder!,
}))
await prisma.asset.createMany({ data: assetsData })
const allAssets = await prisma.asset.findMany({
where: { projectId: project.id, parentId: project.rootFolder! },
orderBy: { id: 'asc' },
})
// Seed 100 items in recentFileItem
const baseDate = new Date('2026-01-01T00:00:00Z')
await prisma.recentFileItem.createMany({
data: allAssets.slice(0, 100).map((a, i) => ({
userId: user1.id,
projectId: project.id,
assetId: a.id,
viewedAt: new Date(baseDate.getTime() + i * 1000),
})),
})
// Now record view for the 101st asset to trigger pruning
const newAsset = allAssets[100]
await assetService.recordRecentView(user1.id, project.id, newAsset.id)
const count = await prisma.recentFileItem.count({
where: { userId: user1.id, projectId: project.id },
})
expect(count).toBe(100)
const list = await assetService.listRecents(user1.id, project.id, { first: 100 })
expect(list.data.length).toBe(100)
// The most recently viewed file should be newAsset
expect(list.data[0].id).toBe(newAsset.id)
// The oldest file (allAssets[0]) should have been pruned
expect(list.data.some((d) => d.id === allAssets[0].id)).toBe(false)
}, 15000)
})
@@ -84,4 +84,36 @@ describe('AuditLogService', () => {
expect(result).toBeNull()
})
it('records kanban actions accurately', async () => {
const user = await prisma.user.create({
data: { name: 'Kanban User', email: 'kanban_user@example.com', password: 'password' },
})
const team = await prisma.team.create({
data: { name: 'Kanban Audit Team' },
})
await auditLogService.logAction({
action: AuditAction.kanban_task_create,
teamId: team.id,
userId: user.id,
itemId: 'task-123',
})
await auditLogService.logAction({
action: AuditAction.kanban_goal_create,
teamId: team.id,
userId: user.id,
itemId: 'goal-123',
})
const result = await auditLogService.listAuditLogs({
teamId: team.id,
actions: [AuditAction.kanban_task_create, AuditAction.kanban_goal_create],
})
expect(result.total).toBe(2)
expect(result.nodes.map((n) => n.action)).toContain(AuditAction.kanban_task_create)
expect(result.nodes.map((n) => n.action)).toContain(AuditAction.kanban_goal_create)
})
})
+212 -1
View File
@@ -1,7 +1,7 @@
import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest'
import { prisma } from '@shumai/db'
import { setupTestDbHooks } from '@shumai/db/test'
import { auth } from './auth'
import { auth, authService } from './auth'
import { userMetadataService } from '../user-metadata/user-metadata'
import { teamService } from '@shumai/core/src/team/team'
@@ -93,3 +93,214 @@ describe('Auth Signup Locale Hook', () => {
}
})
})
describe('AuthService Password Reset', () => {
setupTestDbHooks()
beforeEach(() => {
vi.spyOn(teamService, 'getSignupInfo').mockResolvedValue({
initialized: false,
demoMode: false,
userCount: 1,
})
})
it('should throw error when generating reset link for non-existent user', async () => {
await expect(authService.generatePasswordResetLink('nonexistent@example.com')).rejects.toThrow(
'User with email "nonexistent@example.com" not found',
)
})
it('should generate a valid reset link and invalidate previous pending tokens', async () => {
const email = `reset-user-${Date.now()}@example.com`
const signUpRes = await auth.api.signUpEmail({
headers: new Headers(),
body: {
email,
password: 'initialPassword123',
name: 'Reset User',
},
})
const userId = signUpRes.user.id
const firstLink = await authService.generatePasswordResetLink(email)
expect(firstLink).toContain('/reset-password?token=')
const firstToken = new URL(firstLink).searchParams.get('token')!
expect(firstToken).toBeTruthy()
// Check that verification record exists with identifier: reset-password:<token> and value: userId
const firstVerification = await prisma.verification.findFirst({
where: { identifier: `reset-password:${firstToken}` },
})
expect(firstVerification).not.toBeNull()
expect(firstVerification?.value).toBe(userId)
// Generating a second link should produce a new token and invalidate the first token
const secondLink = await authService.generatePasswordResetLink(email)
const secondToken = new URL(secondLink).searchParams.get('token')!
expect(secondToken).not.toBe(firstToken)
const newVerification = await prisma.verification.findFirst({
where: { identifier: `reset-password:${secondToken}` },
})
expect(newVerification).not.toBeNull()
expect(newVerification?.value).toBe(userId)
// The first token's verification record must have been deleted
const oldVerification = await prisma.verification.findFirst({
where: { identifier: `reset-password:${firstToken}` },
})
expect(oldVerification).toBeNull()
// First token must fail to reset password
await expect(
authService.resetPassword(firstToken, 'newPasswordFromFirstToken'),
).rejects.toThrow()
// Second token must succeed
const resetRes = await authService.resetPassword(secondToken, 'newPasswordFromSecondToken')
expect(resetRes.success).toBe(true)
})
it('should reset password with valid token and revoke active sessions', async () => {
const email = `reset-valid-${Date.now()}@example.com`
const signUpRes = await auth.api.signUpEmail({
headers: new Headers(),
body: {
email,
password: 'oldPassword123',
name: 'Valid Reset User',
},
})
const userId = signUpRes.user.id
// Create an active session
await prisma.session.create({
data: {
userId,
token: `session-${Date.now()}`,
expiresAt: new Date(Date.now() + 86400 * 1000),
},
})
const activeSessionsBefore = await prisma.session.findMany({
where: { userId },
})
expect(activeSessionsBefore.length).toBeGreaterThan(0)
// Generate reset link
const link = await authService.generatePasswordResetLink(email)
const token = new URL(link).searchParams.get('token')!
// Reset password
const result = await authService.resetPassword(token, 'newPassword456')
expect(result.success).toBe(true)
// Verify active sessions are revoked
const activeSessionsAfter = await prisma.session.findMany({
where: { userId },
})
expect(activeSessionsAfter.length).toBe(0)
// Verify token was deleted
const usedToken = await prisma.verification.findFirst({
where: { identifier: `reset-password:${token}` },
})
expect(usedToken).toBeNull()
// Verify user password was updated to new password
const account = await prisma.account.findFirst({
where: { userId, providerId: 'credential' },
})
expect(account).toBeDefined()
expect(account?.password).toBeTruthy()
const { verifyPassword } = await import('better-auth/crypto')
const isNewValid = await verifyPassword({
hash: account!.password!,
password: 'newPassword456',
})
expect(isNewValid).toBe(true)
const isOldValid = await verifyPassword({
hash: account!.password!,
password: 'oldPassword123',
})
expect(isOldValid).toBe(false)
})
it('should reject expired or invalid token', async () => {
const email = `reset-expired-${Date.now()}@example.com`
const user = await prisma.user.create({
data: {
email,
name: 'Expired User',
},
})
// Create expired token fixture with identifier: reset-password:<token> and value: userId
const token = 'expired-token-123'
await prisma.verification.create({
data: {
identifier: `reset-password:${token}`,
value: user.id,
expiresAt: new Date(Date.now() - 1000), // Expired 1 second ago
},
})
await expect(authService.resetPassword(token, 'newPassword123')).rejects.toThrow()
// Non-existent token
await expect(
authService.resetPassword('non-existent-token', 'newPassword123'),
).rejects.toThrow()
})
it('should handle concurrent link generation for different users without crosstalk', async () => {
const emailA = `concurrent-a-${Date.now()}@example.com`
const emailB = `concurrent-b-${Date.now()}@example.com`
const [resA, resB] = await Promise.all([
auth.api.signUpEmail({
headers: new Headers(),
body: { email: emailA, password: 'passwordA123', name: 'User A' },
}),
auth.api.signUpEmail({
headers: new Headers(),
body: { email: emailB, password: 'passwordB123', name: 'User B' },
}),
])
const [linkA, linkB] = await Promise.all([
authService.generatePasswordResetLink(emailA),
authService.generatePasswordResetLink(emailB),
])
const tokenA = new URL(linkA).searchParams.get('token')!
const tokenB = new URL(linkB).searchParams.get('token')!
expect(tokenA).toBeTruthy()
expect(tokenB).toBeTruthy()
expect(tokenA).not.toBe(tokenB)
const verificationA = await prisma.verification.findFirst({
where: { identifier: `reset-password:${tokenA}` },
})
const verificationB = await prisma.verification.findFirst({
where: { identifier: `reset-password:${tokenB}` },
})
expect(verificationA?.value).toBe(resA.user.id)
expect(verificationB?.value).toBe(resB.user.id)
// Reset both passwords concurrently
const [resetResA, resetResB] = await Promise.all([
authService.resetPassword(tokenA, 'newPasswordA123'),
authService.resetPassword(tokenB, 'newPasswordB123'),
])
expect(resetResA.success).toBe(true)
expect(resetResB.success).toBe(true)
})
})
+96
View File
@@ -1,3 +1,4 @@
import { AsyncLocalStorage } from 'node:async_hooks'
import { betterAuth } from 'better-auth'
import { prismaAdapter } from 'better-auth/adapters/prisma'
import { prisma } from '@shumai/db'
@@ -6,6 +7,13 @@ import { inviteService } from '@shumai/core/src/invite/invite'
import { createAuthMiddleware } from 'better-auth/api'
import { userMetadataService } from '@shumai/core/src/user-metadata/user-metadata'
interface GeneratedResetLink {
url: string
token: string
}
const resetLinkStorage = new AsyncLocalStorage<GeneratedResetLink>()
export const auth = betterAuth({
database: prismaAdapter(prisma, {
provider: 'postgresql',
@@ -13,6 +21,15 @@ export const auth = betterAuth({
emailAndPassword: {
enabled: true,
minPasswordLength: 3,
revokeSessionsOnPasswordReset: true,
resetPasswordTokenExpiresIn: 3600,
sendResetPassword: async ({ url, token }) => {
const store = resetLinkStorage.getStore()
if (store) {
store.url = url
store.token = token
}
},
},
secret: process.env.BETTER_AUTH_SECRET,
// eslint-disable-next-line @typescript-eslint/naming-convention
@@ -122,3 +139,82 @@ export const auth = betterAuth({
}),
},
})
export class AuthService {
constructor(private readonly prismaClient: typeof prisma = prisma) {}
async generatePasswordResetLink(email: string): Promise<string> {
const user = await this.prismaClient.user.findUnique({
where: { email },
})
if (!user) {
throw new Error(`User with email "${email}" not found`)
}
const context: GeneratedResetLink = { url: '', token: '' }
await resetLinkStorage.run(context, async () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const res = await (auth.api.requestPasswordReset as any)({
headers: new Headers(),
body: {
email,
redirectTo: '/reset-password',
},
})
if (res?.error) {
throw new Error(res.error.message || 'Failed to generate reset link')
}
})
if (context.token) {
// Invalidate any other pending reset tokens for this user
await this.prismaClient.verification.deleteMany({
where: {
value: user.id,
identifier: {
startsWith: 'reset-password:',
not: `reset-password:${context.token}`,
},
},
})
const rawBaseUrl =
process.env.BETTER_AUTH_URL ||
`http://localhost:${process.env.SHUMAI_SERVER_PORT || '3000'}`
const baseUrl = rawBaseUrl.replace(/\/$/, '')
return `${baseUrl}/reset-password?token=${context.token}`
}
throw new Error('Failed to generate reset link')
}
async resetPassword(token: string, newPassword: string): Promise<{ success: boolean }> {
if (!token || !token.trim()) {
throw new Error('Token is required')
}
if (!newPassword || newPassword.length < 3) {
throw new Error('Password must be at least 3 characters')
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const res = await (auth.api.resetPassword as any)({
headers: new Headers(),
body: {
token,
newPassword,
password: newPassword,
},
})
if (res?.error) {
throw new Error(res.error.message || 'Failed to reset password')
}
return { success: true }
}
}
export const authService = new AuthService()
+93
View File
@@ -502,5 +502,98 @@ describe('AuthzService', () => {
}),
).rejects.toThrow('User has only project scope')
})
it('allows project-scoped and reviewer participants to edit team-level Kanban tasks', async () => {
const creator = await prisma.user.create({
data: { name: 'Owner User', email: 'owner-kanban@example.com', password: 'pass' },
})
const projectScopedUser = await prisma.user.create({
data: { name: 'Proj Member', email: 'proj-kanban@example.com', password: 'pass' },
})
const reviewerUser = await prisma.user.create({
data: { name: 'Reviewer User', email: 'rev-kanban@example.com', password: 'pass' },
})
const unassignedUser = await prisma.user.create({
data: { name: 'Unassigned User', email: 'unassigned-kanban@example.com', password: 'pass' },
})
const team = await prisma.team.create({ data: { name: 'Kanban Team' } })
const project = await prisma.project.create({ data: { name: 'Project K', teamId: team.id } })
await prisma.teamMember.create({
data: { teamId: team.id, userId: creator.id, role: 'owner', scope: 'team' },
})
const tmProj = await prisma.teamMember.create({
data: { teamId: team.id, userId: projectScopedUser.id, role: 'reviewer', scope: 'project' },
})
await prisma.projectMember.create({
data: { projectId: project.id, teamMemberId: tmProj.id, role: 'editor' },
})
await prisma.teamMember.create({
data: { teamId: team.id, userId: reviewerUser.id, role: 'reviewer', scope: 'team' },
})
await prisma.teamMember.create({
data: { teamId: team.id, userId: unassignedUser.id, role: 'reviewer', scope: 'project' },
})
// Team-level task (no projectId)
const teamTask = await prisma.kanbanTask.create({
data: {
teamId: team.id,
title: 'Team Task for Project Member',
creatorId: creator.id,
reporterId: creator.id,
assigneeId: projectScopedUser.id,
},
})
// 1. Project-scoped assignee on team task CAN edit
await expect(
authzService.hasPermission({
type: ResourceType.KanbanTask,
id: teamTask.id,
user: projectScopedUser,
permission: Permission.Edit,
}),
).resolves.toBeUndefined()
// 2. Reviewer who is reporter CAN edit
const reviewerReportedTask = await prisma.kanbanTask.create({
data: {
teamId: team.id,
title: 'Task Reported by Reviewer',
creatorId: creator.id,
reporterId: reviewerUser.id,
},
})
await expect(
authzService.hasPermission({
type: ResourceType.KanbanTask,
id: reviewerReportedTask.id,
user: reviewerUser,
permission: Permission.Edit,
}),
).resolves.toBeUndefined()
// 3. Unassigned project-scoped user CANNOT edit team task
await expect(
authzService.hasPermission({
type: ResourceType.KanbanTask,
id: teamTask.id,
user: unassignedUser,
permission: Permission.Edit,
}),
).rejects.toThrow('User has only project scope')
// 4. Unassigned reviewer CANNOT edit team task
await expect(
authzService.hasPermission({
type: ResourceType.KanbanTask,
id: teamTask.id,
user: reviewerUser,
permission: Permission.Edit,
}),
).rejects.toThrow('Permission denied')
})
})
})
+54 -1
View File
@@ -25,6 +25,8 @@ export enum ResourceType {
Comment = 'comment',
AgentSession = 'agentSession',
QuotaRule = 'quotaRule',
KanbanGoal = 'kanbanGoal',
KanbanTask = 'kanbanTask',
}
export interface AuthzRequest {
@@ -93,7 +95,18 @@ export class AuthzService {
// (project override -> team role for team-scoped members -> restricted).
const role = await resolveEffectiveRole(teamId, projectId, req.user.id)
if (role) {
return this.checkRole(role, req.permission)
try {
return this.checkRole(role, req.permission)
} catch (err) {
// If role check failed (e.g. reviewer requesting Permission.Edit on a KanbanTask where they are assignee/reporter/creator), allow it.
if (req.type === ResourceType.KanbanTask && req.permission === Permission.Edit) {
const isParticipant = await this.isKanbanTaskParticipant(req.id, req.user.id)
if (isParticipant) {
return
}
}
throw err
}
}
// No effective role: either not a team member, or a project-scoped member
@@ -108,6 +121,19 @@ export class AuthzService {
})
if (!member) throw new HTTPException(403, { message: 'User is not a member of the team' })
// If this is a KanbanTask and user is a team member, check if they are the assignee, reporter, or creator
if (req.type === ResourceType.KanbanTask) {
if (req.permission === Permission.Read) {
return
}
if (req.permission === Permission.Edit) {
const isParticipant = await this.isKanbanTaskParticipant(req.id, req.user.id)
if (isParticipant) {
return
}
}
}
// Project-scoped member on a team-level resource (no project context):
// allow Read (e.g. listing), deny Edit/Admin.
if (!projectId && req.permission === Permission.Read) {
@@ -116,6 +142,15 @@ export class AuthzService {
throw new HTTPException(403, { message: 'User has only project scope' })
}
private async isKanbanTaskParticipant(taskId: string, userId: string): Promise<boolean> {
const task = await prisma.kanbanTask.findUnique({
where: { id: taskId },
select: { creatorId: true, reporterId: true, assigneeId: true },
})
if (!task) return false
return task.creatorId === userId || task.reporterId === userId || task.assigneeId === userId
}
private async resolveContext(
type: ResourceType,
id: string,
@@ -269,6 +304,24 @@ export class AuthzService {
return { teamId: rule.teamId }
}
case ResourceType.KanbanGoal: {
const goal = await prisma.kanbanGoal.findUnique({
where: { id },
select: { teamId: true },
})
if (!goal) throw new HTTPException(404, { message: 'Kanban goal not found' })
return { teamId: goal.teamId }
}
case ResourceType.KanbanTask: {
const task = await prisma.kanbanTask.findUnique({
where: { id },
select: { teamId: true, projectId: true },
})
if (!task) throw new HTTPException(404, { message: 'Kanban task not found' })
return { teamId: task.teamId, projectId: task.projectId ?? undefined }
}
default:
throw new HTTPException(403, { message: `Unsupported resource type: ${type}` })
}
+1
View File
@@ -27,3 +27,4 @@ export * from './watermark/watermark'
export * from './gotenberg/gotenberg'
export * from './mcp/mcp-service'
export * from './quota/quota-service'
export * from './kanban/kanban'
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -419,7 +419,14 @@ describe('NotificationService', () => {
const info = await svc['toNotificationInfo'](
await prisma.notification.findUniqueOrThrow({
where: { id: n.id },
include: { creator: true, team: true, project: true, asset: true, user: true },
include: {
creator: true,
team: true,
project: true,
asset: true,
user: true,
kanbanTask: true,
},
}),
null,
)
@@ -430,4 +437,103 @@ describe('NotificationService', () => {
expect(info.asset?.originalWidth).toBe(1280)
expect(info.asset?.originalHeight).toBe(720)
})
it('notifyKanbanTaskEvent broadcasts to stakeholders excluding actor and parses mentions', async () => {
const tm = await prisma.team.create({ data: { name: 'Team Kanban' } })
const u1 = await prisma.user.create({
data: { name: 'Actor', email: `actor-${Date.now()}@example.com`, password: 'p' },
})
const u2 = await prisma.user.create({
data: { name: 'Assignee', email: `assignee-${Date.now()}@example.com`, password: 'p' },
})
const u3 = await prisma.user.create({
data: { name: 'Mentioned', email: `mentioned-${Date.now()}@example.com`, password: 'p' },
})
const task = await prisma.kanbanTask.create({
data: {
teamId: tm.id,
creatorId: u1.id,
title: 'Important task',
},
})
const svc = notificationService
await svc.notifyKanbanTaskEvent({
type: NotificationType.kanban_task_comment_created,
teamId: tm.id,
creatorId: u1.id,
kanbanTaskId: task.id,
stakeholderIds: [u1.id, u2.id],
commentMessage: `Hey <@${u3.id}> please check this`,
})
const notifications = await prisma.notification.findMany({
where: { kanbanTaskId: task.id },
orderBy: { id: 'asc' },
})
// u1 is actor, should not get notification.
// u2 is stakeholder, gets kanban_task_comment_created.
// u3 is mentioned, gets mention.
expect(notifications).toHaveLength(2)
const commentNotif = notifications.find(
(n) => n.type === NotificationType.kanban_task_comment_created,
)
expect(commentNotif?.userId).toBe(u2.id)
const mentionNotif = notifications.find((n) => n.type === NotificationType.mention)
expect(mentionNotif?.userId).toBe(u3.id)
})
it('filters kanban notifications based on user preferences', async () => {
const tm = await prisma.team.create({ data: { name: 'Team Settings' } })
const u1 = await prisma.user.create({
data: { name: 'U1', email: `u1-set-${Date.now()}@example.com`, password: 'p' },
})
await prisma.teamMember.create({
data: { teamId: tm.id, userId: u1.id, role: 'owner' },
})
const task = await prisma.kanbanTask.create({
data: { teamId: tm.id, creatorId: u1.id, title: 'Task' },
})
await prisma.notification.create({
data: {
teamId: tm.id,
type: NotificationType.kanban_task_created,
userId: u1.id,
kanbanTaskId: task.id,
},
})
await prisma.notification.create({
data: {
teamId: tm.id,
type: NotificationType.kanban_task_comment_created,
userId: u1.id,
kanbanTaskId: task.id,
},
})
const svc = notificationService
// By default both are enabled
const listDefault = await svc.list(tm.id, u1.id, {})
expect(listDefault.data).toHaveLength(2)
// Disable kanbanTasks
await userMetadataService.upsertMetadata(u1.id, tm.id, 'notification_settings', {
comments: true,
replies: true,
mentions: true,
yourUploads: false,
otherUploads: true,
statusUpdates: true,
kanbanTasks: false,
kanbanComments: true,
})
const listWithoutTasks = await svc.list(tm.id, u1.id, {})
expect(listWithoutTasks.data).toHaveLength(1)
expect(listWithoutTasks.data[0].type).toBe(NotificationType.kanban_task_comment_created)
})
})
+130 -7
View File
@@ -15,6 +15,74 @@ import { userMetadataService } from '@shumai/core/src/user-metadata/user-metadat
const mentionRegex = /<@([^>]+)>/g
export class NotificationService {
async notifyKanbanTaskEvent(params: {
type: NotificationType
teamId: string
projectId?: string | null
creatorId: string
kanbanTaskId?: string
stakeholderIds?: (string | null | undefined)[]
targetUserId?: string
commentMessage?: string
}) {
const recipients = new Set<string>()
if (params.targetUserId) {
recipients.add(params.targetUserId)
}
if (params.stakeholderIds) {
for (const id of params.stakeholderIds) {
if (id) recipients.add(id)
}
}
recipients.delete(params.creatorId)
const promises: Promise<void>[] = []
for (const recipientId of recipients) {
promises.push(
this.createAsync({
type: params.type,
teamId: params.teamId,
projectId: params.projectId ?? undefined,
creatorId: params.creatorId,
kanbanTaskId: params.kanbanTaskId,
userId: recipientId,
}),
)
}
if (params.commentMessage) {
const matches = [...params.commentMessage.matchAll(mentionRegex)]
const mentionedIds = new Set<string>()
for (const match of matches) {
if (match.length > 1) {
const userId = match[1]
if (mentionedIds.has(userId)) {
continue
}
mentionedIds.add(userId)
if (params.creatorId === userId) {
continue
}
promises.push(
this.createAsync({
type: NotificationType.mention,
teamId: params.teamId,
projectId: params.projectId ?? undefined,
creatorId: params.creatorId,
kanbanTaskId: params.kanbanTaskId,
userId: userId,
}),
)
}
}
}
await Promise.all(promises)
}
async create(req: CreateNotificationRequest) {
// Note: Do not await this, we fire and forget similarly to Go
this.createAsync(req).catch((err) => {
@@ -36,6 +104,16 @@ export class NotificationService {
}
}
// Resolve ProjectID from KanbanTaskId if missing
if (!projectId && req.kanbanTaskId) {
const task = await prisma.kanbanTask.findUnique({
where: { id: req.kanbanTaskId },
})
if (task?.projectId) {
projectId = task.projectId
}
}
// Check project notification settings
if (projectId) {
const project = await prisma.project.findUnique({
@@ -57,6 +135,7 @@ export class NotificationService {
creatorId: req.creatorId,
assetId: req.assetId,
taskId: req.taskId,
kanbanTaskId: req.kanbanTaskId,
userId: targetUserId,
},
})
@@ -71,7 +150,8 @@ export class NotificationService {
// 2. Handle Mentions for Comment/Reply types
if (
(req.type === NotificationType.comment_created ||
req.type === NotificationType.reply_created) &&
req.type === NotificationType.reply_created ||
req.type === NotificationType.kanban_task_comment_created) &&
req.commentMessage
) {
const matches = [...req.commentMessage.matchAll(mentionRegex)]
@@ -128,23 +208,25 @@ export class NotificationService {
yourUploads: false,
otherUploads: true,
statusUpdates: true,
kanbanTasks: true,
kanbanComments: true,
}
const typeConditions: Prisma.NotificationWhereInput[] = []
// 1. Comments
if (settings.comments) {
if (settings.comments ?? true) {
typeConditions.push({ type: NotificationType.comment_created, userId: null })
}
// 2. Replies
if (settings.replies) {
if (settings.replies ?? true) {
typeConditions.push({ type: NotificationType.reply_created, userId: userId })
typeConditions.push({ type: NotificationType.reply_created, userId: null })
}
// 3. Mentions
if (settings.mentions) {
if (settings.mentions ?? true) {
typeConditions.push({ type: NotificationType.mention, userId: userId })
}
@@ -161,11 +243,35 @@ export class NotificationService {
}
// 5. Status Updates
if (settings.statusUpdates) {
if (settings.statusUpdates ?? true) {
typeConditions.push({ type: NotificationType.metadata_field_updated_status })
}
// 6. Always include team/project join notifications
// 6. Kanban Tasks
if (settings.kanbanTasks ?? true) {
typeConditions.push({
type: {
in: [
NotificationType.kanban_task_created,
NotificationType.kanban_task_assigned,
NotificationType.kanban_task_status_updated,
NotificationType.kanban_task_updated,
NotificationType.kanban_task_deleted,
],
},
userId: userId,
})
}
// 7. Kanban Comments
if (settings.kanbanComments ?? true) {
typeConditions.push({
type: NotificationType.kanban_task_comment_created,
userId: userId,
})
}
// 8. Always include team/project join notifications
typeConditions.push({ type: NotificationType.new_user_join_team })
typeConditions.push({ type: NotificationType.new_user_join_project })
@@ -193,6 +299,7 @@ export class NotificationService {
{
OR: [
{ type: NotificationType.mention }, // Always allow mentions (targeted)
{ userId: userId }, // Direct targeted notifications (e.g. assigned, stakeholder)
{ projectId: { in: projectFilter } }, // Only show notifications for projects user is member of
],
},
@@ -270,6 +377,7 @@ export class NotificationService {
project: true,
asset: true,
user: true,
kanbanTask: true,
},
})
@@ -329,7 +437,14 @@ export class NotificationService {
private async toNotificationInfo(
n: Prisma.NotificationGetPayload<{
include: { creator: true; team: true; project: true; asset: true; user: true }
include: {
creator: true
team: true
project: true
asset: true
user: true
kanbanTask: true
}
}>,
lastRead: Prisma.NotificationGetPayload<Record<string, never>> | null,
): Promise<NotificationInfo> {
@@ -368,6 +483,14 @@ export class NotificationService {
}
}
if (n.kanbanTask) {
info.kanbanTask = {
id: n.kanbanTask.id,
title: n.kanbanTask.title,
status: n.kanbanTask.status,
}
}
if (n.asset) {
const a = n.asset
let previewUrl = ''
+157
View File
@@ -335,4 +335,161 @@ describe('ShareService', () => {
const item = list.data.find((l) => l.id === shareLink.id)
expect(item?.creator?.image).toBe('http://s3/avatars/user123-presigned.png')
})
it('hides soft-deleted files from share link and restores them upon file restoration', async () => {
const project = await prisma.project.findUniqueOrThrow({ where: { id: projectId } })
const file = await prisma.asset.create({
data: {
name: 'shared-doc.pdf',
type: AssetType.file,
status: 'processed',
projectId,
parentId: project.rootFolderId,
},
})
const shareLink = await shareService.createShareLink(projectId, {
name: 'Doc Share',
})
await shareService.addAssetToShare(shareLink.id, {
assetIds: [file.id],
})
// Verify initial state: 1 file in share link
const initialChildren = await assetService.listChildren({
assetId: shareLink.rootFolderId,
assetType: 'file',
})
expect(initialChildren.data).toHaveLength(1)
expect(initialChildren.data[0].name).toBe('shared-doc.pdf')
const initialShareRoot = await prisma.asset.findUnique({
where: { id: shareLink.rootFolderId },
})
expect(initialShareRoot?.fileCount).toBe(1)
const symlink = await prisma.asset.findFirst({
where: { targetId: file.id, parentId: shareLink.rootFolderId },
})
expect(symlink).toBeDefined()
await expect(shareService.verifyPublicAccess(file.id)).resolves.toBeDefined()
await expect(shareService.verifyPublicAccess(symlink!.id)).resolves.toBeDefined()
// 1. Soft-delete the file (move to trash)
await assetService.deleteAssets([file.id])
// Verify: file should disappear from share link children
const afterDeleteChildren = await assetService.listChildren({
assetId: shareLink.rootFolderId,
assetType: 'file',
})
expect(afterDeleteChildren.data).toHaveLength(0)
// Verify: share root fileCount should be decremented to 0
const afterDeleteShareRoot = await prisma.asset.findUnique({
where: { id: shareLink.rootFolderId },
})
expect(afterDeleteShareRoot?.fileCount).toBe(0)
// Verify: public access is rejected
await expect(shareService.verifyPublicAccess(file.id)).rejects.toThrow()
await expect(shareService.verifyPublicAccess(symlink!.id)).rejects.toThrow()
// Verify: project's recently-deleted view does NOT list symlinks
const recentlyDeleted = await assetService.listChildren({
projectId,
showDeleted: true,
assetType: 'file',
})
expect(recentlyDeleted.data).toHaveLength(1)
expect(recentlyDeleted.data[0].id).toBe(file.id)
// 2. Restore the file from trash
await assetService.restoreAssets([file.id])
// Verify: file reappears in share link children
const afterRestoreChildren = await assetService.listChildren({
assetId: shareLink.rootFolderId,
assetType: 'file',
})
expect(afterRestoreChildren.data).toHaveLength(1)
expect(afterRestoreChildren.data[0].name).toBe('shared-doc.pdf')
// Verify: share root fileCount is restored to 1
const afterRestoreShareRoot = await prisma.asset.findUnique({
where: { id: shareLink.rootFolderId },
})
expect(afterRestoreShareRoot?.fileCount).toBe(1)
// Verify: public access works again
await expect(shareService.verifyPublicAccess(file.id)).resolves.toBeDefined()
await expect(shareService.verifyPublicAccess(symlink!.id)).resolves.toBeDefined()
})
it('hides soft-deleted folders from share link and restores them upon folder restoration', async () => {
const project = await prisma.project.findUniqueOrThrow({ where: { id: projectId } })
const folder = await prisma.asset.create({
data: {
name: 'Shared Folder',
type: AssetType.folder,
status: 'processed',
projectId,
parentId: project.rootFolderId,
},
})
const childFile = await prisma.asset.create({
data: {
name: 'inner-file.txt',
type: AssetType.file,
status: 'processed',
projectId,
parentId: folder.id,
},
})
const shareLink = await shareService.createShareLink(projectId, {
name: 'Folder Share',
})
await shareService.addAssetToShare(shareLink.id, {
assetIds: [folder.id],
})
// Initial check: folder is in share link
const initialChildren = await assetService.listChildren({
assetId: shareLink.rootFolderId,
assetType: 'folder',
})
expect(initialChildren.data).toHaveLength(1)
expect(initialChildren.data[0].name).toBe('Shared Folder')
await expect(shareService.verifyPublicAccess(childFile.id)).resolves.toBeDefined()
// 1. Soft-delete the folder
await assetService.deleteAssets([folder.id])
// Verify: folder disappears from share link
const afterDeleteChildren = await assetService.listChildren({
assetId: shareLink.rootFolderId,
assetType: 'folder',
})
expect(afterDeleteChildren.data).toHaveLength(0)
// Verify: access to child file inside folder is rejected
await expect(shareService.verifyPublicAccess(childFile.id)).rejects.toThrow()
// 2. Restore the folder
await assetService.restoreAssets([folder.id])
// Verify: folder reappears in share link
const afterRestoreChildren = await assetService.listChildren({
assetId: shareLink.rootFolderId,
assetType: 'folder',
})
expect(afterRestoreChildren.data).toHaveLength(1)
expect(afterRestoreChildren.data[0].name).toBe('Shared Folder')
// Verify: access to child file inside folder is restored
await expect(shareService.verifyPublicAccess(childFile.id)).resolves.toBeDefined()
})
})
+4 -2
View File
@@ -260,16 +260,17 @@ export class ShareService {
WITH RECURSIVE
-- Trace ancestors in the real asset tree
real_ancestors AS (
SELECT id, parent_id, type::text FROM assets WHERE id = ${assetId}
SELECT id, parent_id, type::text FROM assets WHERE id = ${assetId} AND is_deleted = false
UNION ALL
SELECT a.id, a.parent_id, a.type::text FROM assets a
INNER JOIN real_ancestors ra ON ra.parent_id = a.id
WHERE a.is_deleted = false
),
-- Find all symlinks pointing to any of these real ancestors
found_symlinks AS (
SELECT s.id, s.parent_id, s.type::text FROM assets s
INNER JOIN real_ancestors ra ON s.target_id = ra.id
WHERE s.type = 'symlink'
WHERE s.type = 'symlink' AND s.is_deleted = false
),
-- Combine: start with either real ancestors that are 'share' type, or symlinks that lead to 'share' type
search_starts AS (
@@ -283,6 +284,7 @@ export class ShareService {
UNION ALL
SELECT a.id, a.parent_id, a.type::text FROM assets a
INNER JOIN share_trace st ON st.parent_id = a.id
WHERE a.is_deleted = false
)
SELECT id as "shareRootId" FROM share_trace WHERE type = 'share' LIMIT 1;
`
+2 -1
View File
@@ -371,11 +371,12 @@ describe('TeamService', () => {
expect(newSettings).toEqual({ theme: 'dark', semanticSearchEnabled: false })
await teamService.updateSettings(team.id, 'transcode.videoStrategy', 'all')
await teamService.updateSettings(team.id, 'transcode.hardwareAcceleration', 'auto')
const finalSettings = await teamService.getSettings(team.id)
expect(finalSettings).toEqual({
theme: 'dark',
transcode: { videoStrategy: 'all' },
transcode: { videoStrategy: 'all', hardwareAcceleration: 'auto' },
semanticSearchEnabled: false,
})
})
+7 -1
View File
@@ -31,7 +31,7 @@ export class TeamService {
data: {
name: 'Default Team',
settings: {
transcode: { videoStrategy: 'best_match' },
transcode: { videoStrategy: 'best_match', hardwareAcceleration: 'off' },
},
sandbox: { create: {} },
},
@@ -318,6 +318,12 @@ export class TeamService {
}
settings.transcode.videoStrategy = value
delete settings['transcode.videoStrategy']
} else if (key === 'transcode.hardwareAcceleration') {
if (!settings.transcode) {
settings.transcode = {}
}
settings.transcode.hardwareAcceleration = value
delete settings['transcode.hardwareAcceleration']
} else {
settings[key] = value
}
+626 -1
View File
@@ -1,5 +1,13 @@
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'
import { transcodeService, calculatePreviewDimensions } from './transcode'
import {
transcodeService,
calculatePreviewDimensions,
getPlatformEncoderCandidates,
getDefaultBitrate,
getDefaultBitrateBps,
calculateMaxBitrate,
H264_ENCODER_CONFIGS,
} from './transcode'
import { s3Service } from '@shumai/core/src/s3/s3'
import * as path from 'path'
import * as child_process from 'child_process'
@@ -109,6 +117,118 @@ describe('TranscodeService', () => {
)
})
it('should extract videoBitRate from stream bit_rate or tags or fallback correctly', async () => {
/* eslint-disable @typescript-eslint/naming-convention */
// 1. Direct video stream bit_rate
const output1 = JSON.stringify({
format: { duration: '10', bit_rate: '2000000' },
streams: [
{ codec_type: 'video', width: 1920, height: 1080, bit_rate: '1800000' },
{ codec_type: 'audio', bit_rate: '128000' },
],
})
vi.mocked(execFile).mockImplementation(
(
_cmd: unknown,
_args: unknown,
callback: unknown,
): ReturnType<typeof child_process.execFile> => {
const cb = callback as (
err: Error | null,
result: { stdout: string; stderr: string },
) => void
if (typeof cb === 'function') {
cb(null, { stdout: output1, stderr: '' })
}
return {} as ReturnType<typeof child_process.execFile>
},
)
const info1 = await transcodeService.getVideoInfo('test1.mp4')
expect(info1.videoBitRate).toBe(1800000)
// 2. Stream BPS tag
const output2 = JSON.stringify({
format: { duration: '10', bit_rate: '2000000' },
streams: [
{ codec_type: 'video', width: 1920, height: 1080, tags: { BPS: '1500000' } },
{ codec_type: 'audio', bit_rate: '128000' },
],
})
vi.mocked(execFile).mockImplementation(
(
_cmd: unknown,
_args: unknown,
callback: unknown,
): ReturnType<typeof child_process.execFile> => {
const cb = callback as (
err: Error | null,
result: { stdout: string; stderr: string },
) => void
if (typeof cb === 'function') {
cb(null, { stdout: output2, stderr: '' })
}
return {} as ReturnType<typeof child_process.execFile>
},
)
const info2 = await transcodeService.getVideoInfo('test2.mp4')
expect(info2.videoBitRate).toBe(1500000)
// 3. Stream NUMBER_OF_BYTES tag
const output3 = JSON.stringify({
format: { duration: '10', bit_rate: '2000000' },
streams: [
{ codec_type: 'video', width: 1920, height: 1080, tags: { NUMBER_OF_BYTES: '1000000' } },
{ codec_type: 'audio', bit_rate: '128000' },
],
})
vi.mocked(execFile).mockImplementation(
(
_cmd: unknown,
_args: unknown,
callback: unknown,
): ReturnType<typeof child_process.execFile> => {
const cb = callback as (
err: Error | null,
result: { stdout: string; stderr: string },
) => void
if (typeof cb === 'function') {
cb(null, { stdout: output3, stderr: '' })
}
return {} as ReturnType<typeof child_process.execFile>
},
)
const info3 = await transcodeService.getVideoInfo('test3.mp4')
expect(info3.videoBitRate).toBe(800000) // (1,000,000 * 8) / 10 = 800,000
// 4. Fallback totalBitrate - audioBitrate
const output4 = JSON.stringify({
format: { duration: '10', bit_rate: '1000000' },
streams: [
{ codec_type: 'video', width: 1920, height: 1080 },
{ codec_type: 'audio', bit_rate: '128000' },
],
})
/* eslint-enable @typescript-eslint/naming-convention */
vi.mocked(execFile).mockImplementation(
(
_cmd: unknown,
_args: unknown,
callback: unknown,
): ReturnType<typeof child_process.execFile> => {
const cb = callback as (
err: Error | null,
result: { stdout: string; stderr: string },
) => void
if (typeof cb === 'function') {
cb(null, { stdout: output4, stderr: '' })
}
return {} as ReturnType<typeof child_process.execFile>
},
)
const info4 = await transcodeService.getVideoInfo('test4.mp4')
expect(info4.videoBitRate).toBe(872000) // 1,000,000 - 128,000 = 872,000
})
it('should get image info using sharp', async () => {
const mockMetadata = {
width: 800,
@@ -897,4 +1017,509 @@ describe('TranscodeService', () => {
})
})
})
describe('Hardware Acceleration & Encoder Resolution', () => {
beforeEach(() => {
transcodeService.clearEncodersCache()
})
afterEach(() => {
vi.restoreAllMocks()
})
it('should return platform candidates correctly', () => {
expect(getPlatformEncoderCandidates('darwin')).toEqual([
'h264_videotoolbox',
'h264_nvenc',
'h264_qsv',
'h264_amf',
])
expect(getPlatformEncoderCandidates('win32')).toEqual(['h264_nvenc', 'h264_qsv', 'h264_amf'])
expect(getPlatformEncoderCandidates('linux')).toEqual(['h264_nvenc', 'h264_qsv', 'h264_amf'])
})
it('should calculate default bitrates by resolution height and width correctly', () => {
expect(getDefaultBitrateBps(2160, 3840)).toBe(12_000_000)
expect(getDefaultBitrate(2160, 3840)).toBe('12000k')
expect(getDefaultBitrate(1080, 1920)).toBe('4500k')
expect(getDefaultBitrate(720, 1280)).toBe('2500k')
expect(getDefaultBitrate(540, 960)).toBe('1200k')
expect(getDefaultBitrate(360, 640)).toBe('800k')
expect(getDefaultBitrate(180, 320)).toBe('100k')
expect(getDefaultBitrate(100, 100)).toBe('100k')
})
it('calculateMaxBitrate should cap bitrate based on sourceVideoBitrate, ceiling, and targetFps', () => {
// Default without source bitrate
expect(calculateMaxBitrate(720, 1280)).toEqual({
maxrate: '2500k',
bufsize: '5000k',
})
// With low source bitrate (600k * 1.2 = 720k)
expect(calculateMaxBitrate(720, 1280, 600_000)).toEqual({
maxrate: '720k',
bufsize: '1440k',
})
// With high source bitrate (3000k * 1.2 = 3600k, capped at 2500k)
expect(calculateMaxBitrate(720, 1280, 3_000_000)).toEqual({
maxrate: '2500k',
bufsize: '5000k',
})
// With downsampled targetFps (180p preview @ 0.78 fps: 100k * (0.78/24) = 3.25k -> capped at min 50k)
expect(calculateMaxBitrate(180, 320, 600_000, 0.78)).toEqual({
maxrate: '50k',
bufsize: '100k',
})
// With downsampled targetFps string (180p preview @ 24 fps)
expect(calculateMaxBitrate(180, 320, 600_000, 24)).toEqual({
maxrate: '100k',
bufsize: '200k',
})
// With extremely low source bitrate without targetFps (50k * 1.2 = 60k, minimum floor 100k)
expect(calculateMaxBitrate(720, 1280, 50_000)).toEqual({
maxrate: '100k',
bufsize: '200k',
})
})
it('selectH264Encoder should return libx264 when hardwareAcceleration is off', async () => {
const encoder = await transcodeService.selectH264Encoder('off')
expect(encoder).toEqual(H264_ENCODER_CONFIGS.libx264)
expect(child_process.execFile).not.toHaveBeenCalledWith(
'ffmpeg',
['-encoders'],
expect.any(Function),
)
})
it('selectH264Encoder should select h264_videotoolbox on darwin when available', async () => {
const mockEncodersOutput = `
V....D libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
V....D h264_videotoolbox VideoToolbox H.264 Encoder
`
vi.mocked(execFile).mockImplementation(
(
_cmd: unknown,
args: unknown,
callback: unknown,
): ReturnType<typeof child_process.execFile> => {
const cb = callback as (
err: Error | null,
result: { stdout: string; stderr: string },
) => void
const argsArr = args as string[] | undefined
if (argsArr && argsArr[0] === '-encoders') {
cb(null, { stdout: mockEncodersOutput, stderr: '' })
} else if (typeof cb === 'function') {
cb(null, { stdout: '', stderr: '' })
}
return {} as ReturnType<typeof child_process.execFile>
},
)
const encoder = await transcodeService.selectH264Encoder('auto', 'darwin')
expect(encoder.name).toBe('h264_videotoolbox')
expect(encoder.presetArgs).toEqual(['-q:v', '74'])
})
it('selectH264Encoder should select h264_nvenc on linux when available', async () => {
const mockEncodersOutput = `
V....D libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
V....D h264_nvenc NVIDIA NVENC H.264 encoder
V....D h264_qsv Intel Quick Sync Video H.264
`
vi.mocked(execFile).mockImplementation(
(
_cmd: unknown,
args: unknown,
callback: unknown,
): ReturnType<typeof child_process.execFile> => {
const cb = callback as (
err: Error | null,
result: { stdout: string; stderr: string },
) => void
const argsArr = args as string[] | undefined
if (argsArr && argsArr[0] === '-encoders') {
cb(null, { stdout: mockEncodersOutput, stderr: '' })
} else if (typeof cb === 'function') {
cb(null, { stdout: '', stderr: '' })
}
return {} as ReturnType<typeof child_process.execFile>
},
)
const encoder = await transcodeService.selectH264Encoder('auto', 'linux')
expect(encoder.name).toBe('h264_nvenc')
expect(encoder.presetArgs).toEqual([
'-preset',
'p4',
'-rc:v',
'vbr',
'-cq:v',
'26',
'-b:v',
'0',
])
})
it('selectH264Encoder should select h264_qsv on linux when nvenc is not available', async () => {
const mockEncodersOutput = `
V....D libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
V....D h264_qsv Intel Quick Sync Video H.264
`
vi.mocked(execFile).mockImplementation(
(
_cmd: unknown,
args: unknown,
callback: unknown,
): ReturnType<typeof child_process.execFile> => {
const cb = callback as (
err: Error | null,
result: { stdout: string; stderr: string },
) => void
const argsArr = args as string[] | undefined
if (argsArr && argsArr[0] === '-encoders') {
cb(null, { stdout: mockEncodersOutput, stderr: '' })
} else if (typeof cb === 'function') {
cb(null, { stdout: '', stderr: '' })
}
return {} as ReturnType<typeof child_process.execFile>
},
)
const encoder = await transcodeService.selectH264Encoder('auto', 'linux')
expect(encoder.name).toBe('h264_qsv')
expect(encoder.presetArgs).toEqual(['-preset', 'fast', '-global_quality', '26'])
})
it('selectH264Encoder should select h264_amf on win32 when available', async () => {
const mockEncodersOutput = `
V....D libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
V....D h264_amf AMD AMF H.264 Encoder
`
vi.mocked(execFile).mockImplementation(
(
_cmd: unknown,
args: unknown,
callback: unknown,
): ReturnType<typeof child_process.execFile> => {
const cb = callback as (
err: Error | null,
result: { stdout: string; stderr: string },
) => void
const argsArr = args as string[] | undefined
if (argsArr && argsArr[0] === '-encoders') {
cb(null, { stdout: mockEncodersOutput, stderr: '' })
} else if (typeof cb === 'function') {
cb(null, { stdout: '', stderr: '' })
}
return {} as ReturnType<typeof child_process.execFile>
},
)
const encoder = await transcodeService.selectH264Encoder('auto', 'win32')
expect(encoder.name).toBe('h264_amf')
expect(encoder.presetArgs).toEqual([
'-quality',
'balanced',
'-rc',
'qvbr',
'-qvbr_quality_level',
'26',
])
})
it('selectH264Encoder should fallback to libx264 when no hw encoder is in ffmpeg build', async () => {
const mockEncodersOutput = `
V....D libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
`
vi.mocked(execFile).mockImplementation(
(
_cmd: unknown,
args: unknown,
callback: unknown,
): ReturnType<typeof child_process.execFile> => {
const cb = callback as (
err: Error | null,
result: { stdout: string; stderr: string },
) => void
const argsArr = args as string[] | undefined
if (argsArr && argsArr[0] === '-encoders') {
cb(null, { stdout: mockEncodersOutput, stderr: '' })
} else if (typeof cb === 'function') {
cb(null, { stdout: '', stderr: '' })
}
return {} as ReturnType<typeof child_process.execFile>
},
)
const encoder = await transcodeService.selectH264Encoder('auto', 'linux')
expect(encoder.name).toBe('libx264')
expect(encoder.presetArgs).toEqual(['-preset', 'fast', '-crf', '26'])
})
it('transcodeVideo with hardwareAcceleration off should use libx264, preset fast, crf 26, maxrate, and yuv420p', async () => {
vi.mocked(execFile).mockImplementation(
(
_cmd: unknown,
_args: unknown,
callback: unknown,
): ReturnType<typeof child_process.execFile> => {
const cb = callback as (
err: Error | null,
result: { stdout: string; stderr: string },
) => void
if (typeof cb === 'function') {
cb(null, { stdout: '', stderr: '' })
}
return {} as ReturnType<typeof child_process.execFile>
},
)
const outputFile = path.join(tempDir, 'out_off.mp4')
await transcodeService.transcodeVideo({
inputFile: 'input.mp4',
outputFile,
width: 1280,
height: 720,
hardwareAcceleration: 'off',
sourceVideoBitrate: 600_000,
})
expect(child_process.execFile).toHaveBeenCalledWith(
'ffmpeg',
expect.arrayContaining([
'-c:v',
'libx264',
'-preset',
'fast',
'-crf',
'26',
'-maxrate',
'720k',
'-bufsize',
'1440k',
'-pix_fmt',
'yuv420p',
]),
expect.any(Function),
)
})
it('transcodeVideo with hardwareAcceleration auto and videotoolbox should use -q:v 74 and -maxrate', async () => {
vi.spyOn(transcodeService, 'selectH264Encoder').mockResolvedValue(
H264_ENCODER_CONFIGS.h264_videotoolbox,
)
vi.mocked(execFile).mockImplementation(
(
_cmd: unknown,
_args: unknown,
callback: unknown,
): ReturnType<typeof child_process.execFile> => {
const cb = callback as (
err: Error | null,
result: { stdout: string; stderr: string },
) => void
if (typeof cb === 'function') {
cb(null, { stdout: '', stderr: '' })
}
return {} as ReturnType<typeof child_process.execFile>
},
)
const outputFile = path.join(tempDir, 'out_vt.mp4')
await transcodeService.transcodeVideo({
inputFile: 'input.mp4',
outputFile,
width: 1280,
height: 720,
hardwareAcceleration: 'auto',
sourceVideoBitrate: 600_000,
})
expect(child_process.execFile).toHaveBeenCalledWith(
'ffmpeg',
expect.arrayContaining([
'-c:v',
'h264_videotoolbox',
'-q:v',
'74',
'-maxrate',
'720k',
'-bufsize',
'1440k',
'-pix_fmt',
'yuv420p',
]),
expect.any(Function),
)
})
it('transcodeVideo with hardwareAcceleration auto and nvenc should use -preset p4, -rc:v vbr, -cq:v 26, -b:v 0, and -maxrate', async () => {
vi.spyOn(transcodeService, 'selectH264Encoder').mockResolvedValue(
H264_ENCODER_CONFIGS.h264_nvenc,
)
vi.mocked(execFile).mockImplementation(
(
_cmd: unknown,
_args: unknown,
callback: unknown,
): ReturnType<typeof child_process.execFile> => {
const cb = callback as (
err: Error | null,
result: { stdout: string; stderr: string },
) => void
if (typeof cb === 'function') {
cb(null, { stdout: '', stderr: '' })
}
return {} as ReturnType<typeof child_process.execFile>
},
)
const outputFile = path.join(tempDir, 'out_nvenc.mp4')
await transcodeService.transcodeVideo({
inputFile: 'input.mp4',
outputFile,
width: 1920,
height: 1080,
hardwareAcceleration: 'auto',
sourceVideoBitrate: 1_000_000,
})
expect(child_process.execFile).toHaveBeenCalledWith(
'ffmpeg',
expect.arrayContaining([
'-c:v',
'h264_nvenc',
'-preset',
'p4',
'-rc:v',
'vbr',
'-cq:v',
'26',
'-b:v',
'0',
'-maxrate',
'1200k',
'-bufsize',
'2400k',
'-pix_fmt',
'yuv420p',
]),
expect.any(Function),
)
})
it('transcodeVideo with hardwareAcceleration auto and amf should use -quality balanced, -rc qvbr, -qvbr_quality_level 26, and -maxrate', async () => {
vi.spyOn(transcodeService, 'selectH264Encoder').mockResolvedValue(
H264_ENCODER_CONFIGS.h264_amf,
)
vi.mocked(execFile).mockImplementation(
(
_cmd: unknown,
_args: unknown,
callback: unknown,
): ReturnType<typeof child_process.execFile> => {
const cb = callback as (
err: Error | null,
result: { stdout: string; stderr: string },
) => void
if (typeof cb === 'function') {
cb(null, { stdout: '', stderr: '' })
}
return {} as ReturnType<typeof child_process.execFile>
},
)
const outputFile = path.join(tempDir, 'out_amf.mp4')
await transcodeService.transcodeVideo({
inputFile: 'input.mp4',
outputFile,
width: 1280,
height: 720,
hardwareAcceleration: 'auto',
sourceVideoBitrate: 600_000,
})
expect(child_process.execFile).toHaveBeenCalledWith(
'ffmpeg',
expect.arrayContaining([
'-c:v',
'h264_amf',
'-quality',
'balanced',
'-rc',
'qvbr',
'-qvbr_quality_level',
'26',
'-maxrate',
'720k',
'-bufsize',
'1440k',
'-pix_fmt',
'yuv420p',
]),
expect.any(Function),
)
})
it('transcodeVideo with explicit videoBitrate should use -b:v directly', async () => {
vi.mocked(execFile).mockImplementation(
(
_cmd: unknown,
_args: unknown,
callback: unknown,
): ReturnType<typeof child_process.execFile> => {
const cb = callback as (
err: Error | null,
result: { stdout: string; stderr: string },
) => void
if (typeof cb === 'function') {
cb(null, { stdout: '', stderr: '' })
}
return {} as ReturnType<typeof child_process.execFile>
},
)
const outputFile = path.join(tempDir, 'out_explicit.mp4')
await transcodeService.transcodeVideo({
inputFile: 'input.mp4',
outputFile,
width: 1280,
height: 720,
hardwareAcceleration: 'off',
videoBitrate: '1500k',
})
expect(child_process.execFile).toHaveBeenCalledWith(
'ffmpeg',
expect.arrayContaining([
'-c:v',
'libx264',
'-preset',
'fast',
'-crf',
'26',
'-b:v',
'1500k',
'-pix_fmt',
'yuv420p',
]),
expect.any(Function),
)
expect(child_process.execFile).not.toHaveBeenCalledWith(
'ffmpeg',
expect.arrayContaining(['-maxrate']),
expect.any(Function),
)
})
})
})
+201 -1
View File
@@ -91,6 +91,7 @@ export interface MediaMetadata {
originalHeight: number
duration: number
bitRate: number
videoBitRate?: number
frameRate: number
totalFrames: number
startTimecode?: string
@@ -111,6 +112,113 @@ export interface TranscodeVideoParams {
frameRate?: number | string
disableAudio?: boolean
overlayFile?: string
hardwareAcceleration?: 'off' | 'auto'
videoBitrate?: string
sourceVideoBitrate?: number
}
export interface EncoderConfig {
name: string
presetArgs: string[]
}
export const H264_ENCODER_CONFIGS: Record<string, EncoderConfig> = {
h264_nvenc: {
name: 'h264_nvenc',
presetArgs: ['-preset', 'p4', '-rc:v', 'vbr', '-cq:v', '26', '-b:v', '0'],
},
h264_qsv: {
name: 'h264_qsv',
presetArgs: ['-preset', 'fast', '-global_quality', '26'],
},
h264_amf: {
name: 'h264_amf',
presetArgs: ['-quality', 'balanced', '-rc', 'qvbr', '-qvbr_quality_level', '26'],
},
h264_videotoolbox: {
name: 'h264_videotoolbox',
presetArgs: ['-q:v', '74'],
},
libx264: {
name: 'libx264',
presetArgs: ['-preset', 'fast', '-crf', '26'],
},
}
export function getPlatformEncoderCandidates(
platform: NodeJS.Platform = process.platform,
): string[] {
switch (platform) {
case 'darwin':
return ['h264_videotoolbox', 'h264_nvenc', 'h264_qsv', 'h264_amf']
case 'win32':
return ['h264_nvenc', 'h264_qsv', 'h264_amf']
case 'linux':
default:
return ['h264_nvenc', 'h264_qsv', 'h264_amf']
}
}
export function getDefaultBitrateBps(height: number, width?: number): number {
const longSide = Math.max(width || 0, height)
const shortSide = Math.min(width || height, height)
const effectiveHeight = shortSide > 0 ? shortSide : height
if (effectiveHeight >= 2160 || longSide >= 3840) return 12_000_000
if (effectiveHeight >= 1080 || longSide >= 1920) return 4_500_000
if (effectiveHeight >= 720 || longSide >= 1280) return 2_500_000
if (effectiveHeight >= 540 || longSide >= 960) return 1_200_000
if (effectiveHeight >= 360 || longSide >= 640) return 800_000
return 100_000
}
export function getDefaultBitrate(height: number, width?: number): string {
const bps = getDefaultBitrateBps(height, width)
return `${Math.round(bps / 1000)}k`
}
export function calculateMaxBitrate(
targetHeight: number,
targetWidth?: number,
sourceVideoBitrate?: number,
targetFps?: number | string,
): { maxrate: string; bufsize: string } {
let configuredMaxBps = getDefaultBitrateBps(targetHeight, targetWidth)
// If frame rate is downsampled (e.g. 180p preview with < 24 fps), scale the bitrate ceiling proportionally
if (targetFps) {
let parsedFps: number | undefined
if (typeof targetFps === 'number') {
parsedFps = targetFps
} else {
const parts = targetFps.split('/')
if (parts.length === 2) {
parsedFps = parseFloat(parts[0]) / parseFloat(parts[1])
} else {
parsedFps = parseFloat(targetFps)
}
}
if (Number.isFinite(parsedFps) && parsedFps > 0 && parsedFps < 24) {
const fpsRatio = Math.max(0.1, parsedFps / 24)
configuredMaxBps = Math.max(50_000, Math.round(configuredMaxBps * fpsRatio))
}
}
let effectiveMaxBps =
sourceVideoBitrate && sourceVideoBitrate > 0
? Math.min(configuredMaxBps, Math.round(sourceVideoBitrate * 1.2))
: configuredMaxBps
const minFloor = targetFps ? 50_000 : 100_000
effectiveMaxBps = Math.max(minFloor, effectiveMaxBps)
const maxrateKbps = Math.max(50, Math.round(effectiveMaxBps / 1000))
const bufsizeKbps = maxrateKbps * 2
return {
maxrate: `${maxrateKbps}k`,
bufsize: `${bufsizeKbps}k`,
}
}
export interface ExtractVideoFramesParams {
@@ -295,11 +403,38 @@ export class TranscodeService {
}
const startTimecode = videoStream.tags?.timecode || info.format?.tags?.timecode
let videoBitRate: number | undefined
if (videoStream.bit_rate && parseInt(videoStream.bit_rate, 10) > 0) {
videoBitRate = parseInt(videoStream.bit_rate, 10)
} else {
const bpsTag = videoStream.tags?.BPS || videoStream.tags?.['BPS-eng']
if (bpsTag && parseInt(bpsTag, 10) > 0) {
videoBitRate = parseInt(bpsTag, 10)
} else {
const bytesTag =
videoStream.tags?.NUMBER_OF_BYTES || videoStream.tags?.['NUMBER_OF_BYTES-eng']
if (bytesTag && duration > 0) {
videoBitRate = Math.round((parseInt(bytesTag, 10) * 8) / duration)
} else {
const totalBitrate = parseFloat(info.format.bit_rate)
if (Number.isFinite(totalBitrate) && totalBitrate > 0) {
const audioBitrate = audioStream?.bit_rate
? parseFloat(audioStream.bit_rate)
: audioStream
? 128_000
: 0
videoBitRate = Math.max(100_000, Math.round(totalBitrate - audioBitrate))
}
}
}
}
return {
originalWidth: videoStream.width,
originalHeight: videoStream.height,
duration,
bitRate: parseFloat(info.format.bit_rate),
videoBitRate,
frameRate: fps || 30,
totalFrames: totalFrames || 0,
startTimecode,
@@ -373,6 +508,53 @@ export class TranscodeService {
}
}
private availableEncodersCache: Set<string> | null = null
clearEncodersCache(): void {
this.availableEncodersCache = null
}
async getAvailableEncoders(): Promise<Set<string>> {
if (this.availableEncodersCache) {
return this.availableEncodersCache
}
try {
const { stdout } = await execFileAsync('ffmpeg', ['-encoders'])
const encoders = new Set<string>()
const lines = stdout.split('\n')
for (const line of lines) {
const match = line.match(/^\s*[A-Z.]{6}\s+([a-zA-Z0-9_-]+)/)
if (match) {
encoders.add(match[1])
}
}
this.availableEncodersCache = encoders
return encoders
} catch (err) {
console.warn('Failed to probe ffmpeg encoders:', err)
return new Set<string>()
}
}
async selectH264Encoder(
hardwareAcceleration?: 'off' | 'auto',
platform: NodeJS.Platform = process.platform,
): Promise<EncoderConfig> {
if (hardwareAcceleration !== 'auto') {
return H264_ENCODER_CONFIGS.libx264
}
const available = await this.getAvailableEncoders()
const candidates = getPlatformEncoderCandidates(platform)
for (const enc of candidates) {
if (available.has(enc) && H264_ENCODER_CONFIGS[enc]) {
return H264_ENCODER_CONFIGS[enc]
}
}
return H264_ENCODER_CONFIGS.libx264
}
async transcodeVideo(params: TranscodeVideoParams): Promise<void> {
let filterComplex: string
const args: string[] = ['-i', params.inputFile]
@@ -420,7 +602,25 @@ export class TranscodeService {
args.push('-map', '0:a?')
}
args.push('-c:v', 'libx264', '-preset', 'fast', '-crf', '26')
const encoder = await this.selectH264Encoder(params.hardwareAcceleration)
args.push('-c:v', encoder.name)
if (encoder.presetArgs.length > 0) {
args.push(...encoder.presetArgs)
}
if (params.videoBitrate) {
args.push('-b:v', params.videoBitrate)
} else {
const { maxrate, bufsize } = calculateMaxBitrate(
params.height,
params.width,
params.sourceVideoBitrate,
params.frameRate,
)
args.push('-maxrate', maxrate, '-bufsize', bufsize)
}
args.push('-pix_fmt', 'yuv420p')
if (!params.disableAudio) {
args.push('-c:a', 'aac', '-b:a', '128k')
+1
View File
@@ -190,6 +190,7 @@ describe('UploadService', () => {
projectId: projectId,
transcode: {
videoStrategy: 'best_match',
hardwareAcceleration: 'off',
sprite: true,
poster: true,
},
+2
View File
@@ -303,9 +303,11 @@ export class UploadService {
const settings = team.settings as PrismaJson.Settings | null
if (isVideo) {
const strategy = settings?.transcode?.videoStrategy || 'best_match'
const hardwareAcceleration = settings?.transcode?.hardwareAcceleration || 'off'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
await new VideoTranscoder(tx as any, asset.id, team.id, projectId)
.setStrategy(strategy)
.setHardwareAcceleration(hardwareAcceleration)
.withSprite()
.withPoster()
.submit()
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/db",
"version": "0.3.9",
"version": "0.4.0",
"private": true,
"type": "module",
"main": "./src/index.ts",
@@ -0,0 +1,164 @@
-- CreateEnum
CREATE TYPE "KanbanTaskStatus" AS ENUM ('TODO', 'READY', 'IN_PROGRESS', 'BLOCKED', 'IN_REVIEW', 'DONE', 'CANCELLED');
-- CreateEnum
CREATE TYPE "KanbanTaskPriority" AS ENUM ('LOW', 'MEDIUM', 'HIGH', 'URGENT');
-- CreateEnum
CREATE TYPE "KanbanTaskEventType" AS ENUM ('CREATED', 'STATUS_CHANGED', 'ASSIGNED', 'UNASSIGNED', 'COMMENTED', 'CHANGES_REQUESTED', 'BLOCKED', 'UNBLOCKED', 'PRIORITY_CHANGED', 'GOAL_CHANGED', 'DEPENDENCY_ADDED', 'DEPENDENCY_REMOVED', 'CANCELLED');
-- CreateTable
CREATE TABLE "kanban_goals" (
"id" TEXT NOT NULL,
"title" TEXT NOT NULL,
"description" TEXT,
"team_id" TEXT NOT NULL,
"creator_id" TEXT,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
CONSTRAINT "kanban_goals_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "kanban_tasks" (
"id" TEXT NOT NULL,
"title" TEXT NOT NULL,
"description" TEXT,
"is_agent_task" BOOLEAN NOT NULL DEFAULT false,
"status" "KanbanTaskStatus" NOT NULL DEFAULT 'TODO',
"priority" "KanbanTaskPriority" NOT NULL DEFAULT 'MEDIUM',
"start_date" TIMESTAMP(3),
"due_date" TIMESTAMP(3),
"started_at" TIMESTAMP(3),
"completed_at" TIMESTAMP(3),
"goal_id" TEXT,
"team_id" TEXT NOT NULL,
"project_id" TEXT,
"creator_id" TEXT NOT NULL,
"reporter_id" TEXT,
"assignee_id" TEXT,
"target_folder_id" TEXT,
"sort_index" TEXT,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
CONSTRAINT "kanban_tasks_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "kanban_task_links" (
"parent_id" TEXT NOT NULL,
"child_id" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "kanban_task_links_pkey" PRIMARY KEY ("parent_id","child_id")
);
-- CreateTable
CREATE TABLE "kanban_task_comments" (
"id" TEXT NOT NULL,
"task_id" TEXT NOT NULL,
"author_id" TEXT NOT NULL,
"body" TEXT NOT NULL,
"attachments" JSONB,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
CONSTRAINT "kanban_task_comments_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "kanban_task_events" (
"id" TEXT NOT NULL,
"task_id" TEXT NOT NULL,
"actor_id" TEXT,
"type" "KanbanTaskEventType" NOT NULL,
"from_status" "KanbanTaskStatus",
"to_status" "KanbanTaskStatus",
"data" JSONB,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "kanban_task_events_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE INDEX "kanban_goals_team_id_idx" ON "kanban_goals"("team_id");
-- CreateIndex
CREATE INDEX "kanban_tasks_team_id_status_idx" ON "kanban_tasks"("team_id", "status");
-- CreateIndex
CREATE INDEX "kanban_tasks_team_id_status_sort_index_idx" ON "kanban_tasks"("team_id", "status", "sort_index");
-- CreateIndex
CREATE INDEX "kanban_tasks_team_id_is_agent_task_status_idx" ON "kanban_tasks"("team_id", "is_agent_task", "status");
-- CreateIndex
CREATE INDEX "kanban_tasks_team_id_goal_id_status_idx" ON "kanban_tasks"("team_id", "goal_id", "status");
-- CreateIndex
CREATE INDEX "kanban_tasks_team_id_assignee_id_status_idx" ON "kanban_tasks"("team_id", "assignee_id", "status");
-- CreateIndex
CREATE INDEX "kanban_tasks_project_id_status_idx" ON "kanban_tasks"("project_id", "status");
-- CreateIndex
CREATE INDEX "kanban_tasks_sort_index_idx" ON "kanban_tasks"("sort_index");
-- CreateIndex
CREATE INDEX "kanban_task_links_child_id_idx" ON "kanban_task_links"("child_id");
-- CreateIndex
CREATE INDEX "kanban_task_comments_task_id_created_at_idx" ON "kanban_task_comments"("task_id", "created_at");
-- CreateIndex
CREATE INDEX "kanban_task_events_task_id_created_at_idx" ON "kanban_task_events"("task_id", "created_at");
-- CreateIndex
CREATE INDEX "kanban_task_events_actor_id_created_at_idx" ON "kanban_task_events"("actor_id", "created_at");
-- AddForeignKey
ALTER TABLE "kanban_goals" ADD CONSTRAINT "kanban_goals_team_id_fkey" FOREIGN KEY ("team_id") REFERENCES "teams"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_goals" ADD CONSTRAINT "kanban_goals_creator_id_fkey" FOREIGN KEY ("creator_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_goal_id_fkey" FOREIGN KEY ("goal_id") REFERENCES "kanban_goals"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_team_id_fkey" FOREIGN KEY ("team_id") REFERENCES "teams"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_project_id_fkey" FOREIGN KEY ("project_id") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_creator_id_fkey" FOREIGN KEY ("creator_id") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_reporter_id_fkey" FOREIGN KEY ("reporter_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_assignee_id_fkey" FOREIGN KEY ("assignee_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_target_folder_id_fkey" FOREIGN KEY ("target_folder_id") REFERENCES "assets"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_task_links" ADD CONSTRAINT "kanban_task_links_parent_id_fkey" FOREIGN KEY ("parent_id") REFERENCES "kanban_tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_task_links" ADD CONSTRAINT "kanban_task_links_child_id_fkey" FOREIGN KEY ("child_id") REFERENCES "kanban_tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_task_comments" ADD CONSTRAINT "kanban_task_comments_task_id_fkey" FOREIGN KEY ("task_id") REFERENCES "kanban_tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_task_comments" ADD CONSTRAINT "kanban_task_comments_author_id_fkey" FOREIGN KEY ("author_id") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_task_events" ADD CONSTRAINT "kanban_task_events_task_id_fkey" FOREIGN KEY ("task_id") REFERENCES "kanban_tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_task_events" ADD CONSTRAINT "kanban_task_events_actor_id_fkey" FOREIGN KEY ("actor_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -0,0 +1,26 @@
-- AlterEnum
-- This migration adds more than one value to an enum.
-- With PostgreSQL versions 11 and earlier, this is not possible
-- in a single migration. This can be worked around by creating
-- multiple migrations, each migration adding only one value to
-- the enum.
ALTER TYPE "NotificationType" ADD VALUE 'kanban_task_created';
ALTER TYPE "NotificationType" ADD VALUE 'kanban_task_assigned';
ALTER TYPE "NotificationType" ADD VALUE 'kanban_task_status_updated';
ALTER TYPE "NotificationType" ADD VALUE 'kanban_task_updated';
ALTER TYPE "NotificationType" ADD VALUE 'kanban_task_deleted';
ALTER TYPE "NotificationType" ADD VALUE 'kanban_task_comment_created';
-- AlterEnum
ALTER TYPE "WorkflowTaskType" ADD VALUE 'kanban_agent_run';
-- AlterTable
ALTER TABLE "notifications" ADD COLUMN "kanban_task_id" TEXT;
-- CreateIndex
CREATE INDEX "notifications_kanban_task_id_idx" ON "notifications"("kanban_task_id");
-- AddForeignKey
ALTER TABLE "notifications" ADD CONSTRAINT "notifications_kanban_task_id_fkey" FOREIGN KEY ("kanban_task_id") REFERENCES "kanban_tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,10 @@
-- AlterTable: Change sort_index column collation to "C" on kanban_tasks
ALTER TABLE "kanban_tasks" ALTER COLUMN "sort_index" TYPE TEXT COLLATE "C";
-- Recreate index on sort_index with "C" collation
DROP INDEX IF EXISTS "kanban_tasks_sort_index_idx";
CREATE INDEX "kanban_tasks_sort_index_idx" ON "kanban_tasks" ("sort_index" COLLATE "C");
-- Recreate compound index with "C" collation
DROP INDEX IF EXISTS "kanban_tasks_team_id_status_sort_index_idx";
CREATE INDEX "kanban_tasks_team_id_status_sort_index_idx" ON "kanban_tasks" ("team_id", "status", "sort_index" COLLATE "C");
@@ -0,0 +1,17 @@
-- CreateTable
CREATE TABLE "kanban_task_assets" (
"task_id" TEXT NOT NULL,
"asset_id" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "kanban_task_assets_pkey" PRIMARY KEY ("task_id","asset_id")
);
-- CreateIndex
CREATE INDEX "kanban_task_assets_asset_id_idx" ON "kanban_task_assets"("asset_id");
-- AddForeignKey
ALTER TABLE "kanban_task_assets" ADD CONSTRAINT "kanban_task_assets_task_id_fkey" FOREIGN KEY ("task_id") REFERENCES "kanban_tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_task_assets" ADD CONSTRAINT "kanban_task_assets_asset_id_fkey" FOREIGN KEY ("asset_id") REFERENCES "assets"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,28 @@
/*
Warnings:
- The values [CANCELLED] on the enum `KanbanTaskEventType` will be removed. If these variants are still used in the database, this will fail.
- The values [CANCELLED] on the enum `KanbanTaskStatus` will be removed. If these variants are still used in the database, this will fail.
*/
-- AlterEnum
BEGIN;
CREATE TYPE "KanbanTaskEventType_new" AS ENUM ('CREATED', 'STATUS_CHANGED', 'ASSIGNED', 'UNASSIGNED', 'COMMENTED', 'CHANGES_REQUESTED', 'BLOCKED', 'UNBLOCKED', 'PRIORITY_CHANGED', 'GOAL_CHANGED', 'DEPENDENCY_ADDED', 'DEPENDENCY_REMOVED');
ALTER TABLE "kanban_task_events" ALTER COLUMN "type" TYPE "KanbanTaskEventType_new" USING ("type"::text::"KanbanTaskEventType_new");
ALTER TYPE "KanbanTaskEventType" RENAME TO "KanbanTaskEventType_old";
ALTER TYPE "KanbanTaskEventType_new" RENAME TO "KanbanTaskEventType";
DROP TYPE "public"."KanbanTaskEventType_old";
COMMIT;
-- AlterEnum
BEGIN;
CREATE TYPE "KanbanTaskStatus_new" AS ENUM ('TODO', 'READY', 'IN_PROGRESS', 'BLOCKED', 'IN_REVIEW', 'DONE');
ALTER TABLE "public"."kanban_tasks" ALTER COLUMN "status" DROP DEFAULT;
ALTER TABLE "kanban_tasks" ALTER COLUMN "status" TYPE "KanbanTaskStatus_new" USING ("status"::text::"KanbanTaskStatus_new");
ALTER TABLE "kanban_task_events" ALTER COLUMN "from_status" TYPE "KanbanTaskStatus_new" USING ("from_status"::text::"KanbanTaskStatus_new");
ALTER TABLE "kanban_task_events" ALTER COLUMN "to_status" TYPE "KanbanTaskStatus_new" USING ("to_status"::text::"KanbanTaskStatus_new");
ALTER TYPE "KanbanTaskStatus" RENAME TO "KanbanTaskStatus_old";
ALTER TYPE "KanbanTaskStatus_new" RENAME TO "KanbanTaskStatus";
DROP TYPE "public"."KanbanTaskStatus_old";
ALTER TABLE "kanban_tasks" ALTER COLUMN "status" SET DEFAULT 'TODO';
COMMIT;
@@ -0,0 +1,28 @@
-- CreateTable
CREATE TABLE "recent_file_items" (
"id" TEXT NOT NULL,
"user_id" TEXT NOT NULL,
"project_id" TEXT NOT NULL,
"asset_id" TEXT NOT NULL,
"viewed_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "recent_file_items_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE INDEX "recent_file_items_user_id_project_id_viewed_at_idx" ON "recent_file_items"("user_id", "project_id", "viewed_at" DESC);
-- CreateIndex
CREATE INDEX "recent_file_items_asset_id_idx" ON "recent_file_items"("asset_id");
-- CreateIndex
CREATE UNIQUE INDEX "recent_file_items_user_id_project_id_asset_id_key" ON "recent_file_items"("user_id", "project_id", "asset_id");
-- AddForeignKey
ALTER TABLE "recent_file_items" ADD CONSTRAINT "recent_file_items_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "recent_file_items" ADD CONSTRAINT "recent_file_items_project_id_fkey" FOREIGN KEY ("project_id") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "recent_file_items" ADD CONSTRAINT "recent_file_items_asset_id_fkey" FOREIGN KEY ("asset_id") REFERENCES "assets"("id") ON DELETE CASCADE ON UPDATE CASCADE;
+207
View File
@@ -68,6 +68,12 @@ enum NotificationType {
metadata_field_updated_status
new_user_join_team
new_user_join_project
kanban_task_created
kanban_task_assigned
kanban_task_status_updated
kanban_task_updated
kanban_task_deleted
kanban_task_comment_created
}
enum ProjectMemberRole {
@@ -112,6 +118,7 @@ enum WorkflowTaskType {
ai_embedding
query_embedding_for_search
agent_tool_call
kanban_agent_run
}
enum WorkflowTaskStatus {
@@ -156,6 +163,37 @@ enum QuotaResourceType {
agent_tool_call_count
}
enum KanbanTaskStatus {
TODO
READY
IN_PROGRESS
BLOCKED
IN_REVIEW
DONE
}
enum KanbanTaskPriority {
LOW
MEDIUM
HIGH
URGENT
}
enum KanbanTaskEventType {
CREATED
STATUS_CHANGED
ASSIGNED
UNASSIGNED
COMMENTED
CHANGES_REQUESTED
BLOCKED
UNBLOCKED
PRIORITY_CHANGED
GOAL_CHANGED
DEPENDENCY_ADDED
DEPENDENCY_REMOVED
}
// ----------------------------------------------------------------------
// Models
// ----------------------------------------------------------------------
@@ -194,6 +232,13 @@ model User {
aiUsages AiUsage[] @relation("UserToAiUsage")
auditLogs AuditLog[] @relation("UserToAuditLog")
quotaRecords QuotaRecord[] @relation("UserToQuotaRecord")
kanbanTasksCreated KanbanTask[] @relation("KanbanTaskCreator")
kanbanTasksReported KanbanTask[] @relation("KanbanTaskReporter")
kanbanTasksAssigned KanbanTask[] @relation("KanbanTaskAssignee")
kanbanGoalsCreated KanbanGoal[] @relation("UserToKanbanGoal")
kanbanTaskComments KanbanTaskComment[]
kanbanTaskEvents KanbanTaskEvent[]
recentFiles RecentFileItem[]
@@map("users")
}
@@ -282,6 +327,8 @@ model Team {
watermarkTemplates WatermarkTemplate[] @relation("TeamToWatermarkTemplate")
quotaRules QuotaRule[] @relation("TeamToQuotaRule")
quotaRecords QuotaRecord[] @relation("TeamToQuotaRecord")
kanbanGoals KanbanGoal[] @relation("TeamToKanbanGoal")
kanbanTasks KanbanTask[] @relation("TeamToKanbanTask")
@@map("teams")
}
@@ -367,6 +414,8 @@ model Project {
shareLinks ShareLink[] @relation("ProjectToShareLink")
collections Collection[] @relation("ProjectToCollection")
auditLogs AuditLog[] @relation("ProjectToAuditLog")
kanbanTasks KanbanTask[] @relation("ProjectToKanbanTask")
recentFiles RecentFileItem[]
@@map("projects")
@@index([createdAt])
@@ -515,6 +564,9 @@ model Asset {
agentSessions AgentSession[] @relation("AssetToAgentSession")
watermarkFiles WatermarkFile[] @relation("AssetToWatermarkFile")
agentMd AssetAgentMd? @relation("AssetToAgentMd")
kanbanTargetTasks KanbanTask[] @relation("KanbanTaskTargetFolder")
kanbanTasks KanbanTaskAsset[]
recentFiles RecentFileItem[]
@@map("assets")
@@index([type])
@@ -691,11 +743,15 @@ model Notification {
taskId String? @map("task_id")
task Task? @relation("TaskToNotification", fields: [taskId], references: [id])
kanbanTaskId String? @map("kanban_task_id")
kanbanTask KanbanTask? @relation("KanbanTaskToNotification", fields: [kanbanTaskId], references: [id], onDelete: Cascade)
userId String? @map("user_id")
user User? @relation("UserToNotification", fields: [userId], references: [id])
readByMembers TeamMember? @relation("TeamMemberToLastReadNotification")
@@index([kanbanTaskId])
@@map("notifications")
}
@@ -1087,4 +1143,155 @@ model QuotaRecord {
@@map("quota_records")
}
model KanbanGoal {
id String @id @default(ulid())
title String
description String? @db.Text
teamId String @map("team_id")
team Team @relation("TeamToKanbanGoal", fields: [teamId], references: [id], onDelete: Cascade)
creatorId String? @map("creator_id")
creator User? @relation("UserToKanbanGoal", fields: [creatorId], references: [id], onDelete: SetNull)
tasks KanbanTask[]
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
@@index([teamId])
@@map("kanban_goals")
}
model KanbanTask {
id String @id @default(ulid())
title String
description String? @db.Text
isAgentTask Boolean @default(false) @map("is_agent_task")
status KanbanTaskStatus @default(TODO)
priority KanbanTaskPriority @default(MEDIUM)
startDate DateTime? @map("start_date")
dueDate DateTime? @map("due_date")
startedAt DateTime? @map("started_at")
completedAt DateTime? @map("completed_at")
goalId String? @map("goal_id")
goal KanbanGoal? @relation(fields: [goalId], references: [id], onDelete: SetNull)
teamId String @map("team_id")
team Team @relation("TeamToKanbanTask", fields: [teamId], references: [id], onDelete: Cascade)
projectId String? @map("project_id")
project Project? @relation("ProjectToKanbanTask", fields: [projectId], references: [id], onDelete: Cascade)
creatorId String @map("creator_id")
creator User @relation("KanbanTaskCreator", fields: [creatorId], references: [id])
reporterId String? @map("reporter_id")
reporter User? @relation("KanbanTaskReporter", fields: [reporterId], references: [id])
assigneeId String? @map("assignee_id")
assignee User? @relation("KanbanTaskAssignee", fields: [assigneeId], references: [id])
targetFolderId String? @map("target_folder_id")
targetFolder Asset? @relation("KanbanTaskTargetFolder", fields: [targetFolderId], references: [id], onDelete: SetNull)
dependencies KanbanTaskLink[] @relation("ChildLinks")
dependents KanbanTaskLink[] @relation("ParentLinks")
assets KanbanTaskAsset[]
comments KanbanTaskComment[]
events KanbanTaskEvent[]
notifications Notification[] @relation("KanbanTaskToNotification")
sortIndex String? @map("sort_index")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
@@index([teamId, status])
@@index([teamId, status, sortIndex])
@@index([teamId, isAgentTask, status])
@@index([teamId, goalId, status])
@@index([teamId, assigneeId, status])
@@index([projectId, status])
@@index([sortIndex])
@@map("kanban_tasks")
}
model KanbanTaskLink {
parentId String @map("parent_id")
childId String @map("child_id")
parent KanbanTask @relation("ParentLinks", fields: [parentId], references: [id], onDelete: Cascade)
child KanbanTask @relation("ChildLinks", fields: [childId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now()) @map("created_at")
@@id([parentId, childId])
@@index([childId])
@@map("kanban_task_links")
}
model KanbanTaskAsset {
taskId String @map("task_id")
assetId String @map("asset_id")
task KanbanTask @relation(fields: [taskId], references: [id], onDelete: Cascade)
asset Asset @relation(fields: [assetId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now()) @map("created_at")
@@id([taskId, assetId])
@@index([assetId])
@@map("kanban_task_assets")
}
model KanbanTaskComment {
id String @id @default(ulid())
taskId String @map("task_id")
task KanbanTask @relation(fields: [taskId], references: [id], onDelete: Cascade)
authorId String @map("author_id")
author User @relation(fields: [authorId], references: [id])
body String @db.Text
/// [KanbanCommentAttachmentList]
attachments Json?
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
@@index([taskId, createdAt])
@@map("kanban_task_comments")
}
model KanbanTaskEvent {
id String @id @default(ulid())
taskId String @map("task_id")
task KanbanTask @relation(fields: [taskId], references: [id], onDelete: Cascade)
actorId String? @map("actor_id")
actor User? @relation(fields: [actorId], references: [id])
type KanbanTaskEventType
fromStatus KanbanTaskStatus? @map("from_status")
toStatus KanbanTaskStatus? @map("to_status")
/// [KanbanEventPayload]
data Json?
createdAt DateTime @default(now()) @map("created_at")
@@index([taskId, createdAt])
@@index([actorId, createdAt])
@@map("kanban_task_events")
}
model RecentFileItem {
id String @id @default(ulid())
userId String @map("user_id")
projectId String @map("project_id")
assetId String @map("asset_id")
viewedAt DateTime @default(now()) @map("viewed_at")
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
asset Asset @relation(fields: [assetId], references: [id], onDelete: Cascade)
@@unique([userId, projectId, assetId], name: "userIdProjectIdAssetId")
@@index([userId, projectId, viewedAt(sort: Desc)])
@@index([assetId])
@@map("recent_file_items")
}
+35
View File
@@ -237,3 +237,38 @@ export type QuotaRule = Prisma.QuotaRuleModel
*
*/
export type QuotaRecord = Prisma.QuotaRecordModel
/**
* Model KanbanGoal
*
*/
export type KanbanGoal = Prisma.KanbanGoalModel
/**
* Model KanbanTask
*
*/
export type KanbanTask = Prisma.KanbanTaskModel
/**
* Model KanbanTaskLink
*
*/
export type KanbanTaskLink = Prisma.KanbanTaskLinkModel
/**
* Model KanbanTaskAsset
*
*/
export type KanbanTaskAsset = Prisma.KanbanTaskAssetModel
/**
* Model KanbanTaskComment
*
*/
export type KanbanTaskComment = Prisma.KanbanTaskCommentModel
/**
* Model KanbanTaskEvent
*
*/
export type KanbanTaskEvent = Prisma.KanbanTaskEventModel
/**
* Model RecentFileItem
*
*/
export type RecentFileItem = Prisma.RecentFileItemModel
+35
View File
@@ -261,3 +261,38 @@ export type QuotaRule = Prisma.QuotaRuleModel
*
*/
export type QuotaRecord = Prisma.QuotaRecordModel
/**
* Model KanbanGoal
*
*/
export type KanbanGoal = Prisma.KanbanGoalModel
/**
* Model KanbanTask
*
*/
export type KanbanTask = Prisma.KanbanTaskModel
/**
* Model KanbanTaskLink
*
*/
export type KanbanTaskLink = Prisma.KanbanTaskLinkModel
/**
* Model KanbanTaskAsset
*
*/
export type KanbanTaskAsset = Prisma.KanbanTaskAssetModel
/**
* Model KanbanTaskComment
*
*/
export type KanbanTaskComment = Prisma.KanbanTaskCommentModel
/**
* Model KanbanTaskEvent
*
*/
export type KanbanTaskEvent = Prisma.KanbanTaskEventModel
/**
* Model RecentFileItem
*
*/
export type RecentFileItem = Prisma.RecentFileItemModel
+136
View File
@@ -816,6 +816,74 @@ export type EnumQuotaPeriodWithAggregatesFilter<$PrismaModel = never> = {
_max?: Prisma.NestedEnumQuotaPeriodFilter<$PrismaModel>
}
export type EnumKanbanTaskStatusFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskStatus | Prisma.EnumKanbanTaskStatusFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskStatusFilter<$PrismaModel> | $Enums.KanbanTaskStatus
}
export type EnumKanbanTaskPriorityFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskPriority | Prisma.EnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskPriority[] | Prisma.ListEnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskPriority[] | Prisma.ListEnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskPriorityFilter<$PrismaModel> | $Enums.KanbanTaskPriority
}
export type EnumKanbanTaskStatusWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskStatus | Prisma.EnumKanbanTaskStatusFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskStatusWithAggregatesFilter<$PrismaModel> | $Enums.KanbanTaskStatus
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumKanbanTaskStatusFilter<$PrismaModel>
_max?: Prisma.NestedEnumKanbanTaskStatusFilter<$PrismaModel>
}
export type EnumKanbanTaskPriorityWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskPriority | Prisma.EnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskPriority[] | Prisma.ListEnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskPriority[] | Prisma.ListEnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskPriorityWithAggregatesFilter<$PrismaModel> | $Enums.KanbanTaskPriority
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumKanbanTaskPriorityFilter<$PrismaModel>
_max?: Prisma.NestedEnumKanbanTaskPriorityFilter<$PrismaModel>
}
export type EnumKanbanTaskEventTypeFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskEventType | Prisma.EnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskEventType[] | Prisma.ListEnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskEventType[] | Prisma.ListEnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskEventTypeFilter<$PrismaModel> | $Enums.KanbanTaskEventType
}
export type EnumKanbanTaskStatusNullableFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskStatus | Prisma.EnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
in?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
notIn?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
not?: Prisma.NestedEnumKanbanTaskStatusNullableFilter<$PrismaModel> | $Enums.KanbanTaskStatus | null
}
export type EnumKanbanTaskEventTypeWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskEventType | Prisma.EnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskEventType[] | Prisma.ListEnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskEventType[] | Prisma.ListEnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskEventTypeWithAggregatesFilter<$PrismaModel> | $Enums.KanbanTaskEventType
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumKanbanTaskEventTypeFilter<$PrismaModel>
_max?: Prisma.NestedEnumKanbanTaskEventTypeFilter<$PrismaModel>
}
export type EnumKanbanTaskStatusNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskStatus | Prisma.EnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
in?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
notIn?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
not?: Prisma.NestedEnumKanbanTaskStatusNullableWithAggregatesFilter<$PrismaModel> | $Enums.KanbanTaskStatus | null
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
_min?: Prisma.NestedEnumKanbanTaskStatusNullableFilter<$PrismaModel>
_max?: Prisma.NestedEnumKanbanTaskStatusNullableFilter<$PrismaModel>
}
export type NestedStringFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
@@ -1553,4 +1621,72 @@ export type NestedEnumQuotaPeriodWithAggregatesFilter<$PrismaModel = never> = {
_max?: Prisma.NestedEnumQuotaPeriodFilter<$PrismaModel>
}
export type NestedEnumKanbanTaskStatusFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskStatus | Prisma.EnumKanbanTaskStatusFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskStatusFilter<$PrismaModel> | $Enums.KanbanTaskStatus
}
export type NestedEnumKanbanTaskPriorityFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskPriority | Prisma.EnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskPriority[] | Prisma.ListEnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskPriority[] | Prisma.ListEnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskPriorityFilter<$PrismaModel> | $Enums.KanbanTaskPriority
}
export type NestedEnumKanbanTaskStatusWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskStatus | Prisma.EnumKanbanTaskStatusFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskStatusWithAggregatesFilter<$PrismaModel> | $Enums.KanbanTaskStatus
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumKanbanTaskStatusFilter<$PrismaModel>
_max?: Prisma.NestedEnumKanbanTaskStatusFilter<$PrismaModel>
}
export type NestedEnumKanbanTaskPriorityWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskPriority | Prisma.EnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskPriority[] | Prisma.ListEnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskPriority[] | Prisma.ListEnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskPriorityWithAggregatesFilter<$PrismaModel> | $Enums.KanbanTaskPriority
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumKanbanTaskPriorityFilter<$PrismaModel>
_max?: Prisma.NestedEnumKanbanTaskPriorityFilter<$PrismaModel>
}
export type NestedEnumKanbanTaskEventTypeFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskEventType | Prisma.EnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskEventType[] | Prisma.ListEnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskEventType[] | Prisma.ListEnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskEventTypeFilter<$PrismaModel> | $Enums.KanbanTaskEventType
}
export type NestedEnumKanbanTaskStatusNullableFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskStatus | Prisma.EnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
in?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
notIn?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
not?: Prisma.NestedEnumKanbanTaskStatusNullableFilter<$PrismaModel> | $Enums.KanbanTaskStatus | null
}
export type NestedEnumKanbanTaskEventTypeWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskEventType | Prisma.EnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskEventType[] | Prisma.ListEnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskEventType[] | Prisma.ListEnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskEventTypeWithAggregatesFilter<$PrismaModel> | $Enums.KanbanTaskEventType
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumKanbanTaskEventTypeFilter<$PrismaModel>
_max?: Prisma.NestedEnumKanbanTaskEventTypeFilter<$PrismaModel>
}
export type NestedEnumKanbanTaskStatusNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskStatus | Prisma.EnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
in?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
notIn?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
not?: Prisma.NestedEnumKanbanTaskStatusNullableWithAggregatesFilter<$PrismaModel> | $Enums.KanbanTaskStatus | null
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
_min?: Prisma.NestedEnumKanbanTaskStatusNullableFilter<$PrismaModel>
_max?: Prisma.NestedEnumKanbanTaskStatusNullableFilter<$PrismaModel>
}
+49 -2
View File
@@ -75,7 +75,13 @@ export const NotificationType = {
successful_file_uploaded: 'successful_file_uploaded',
metadata_field_updated_status: 'metadata_field_updated_status',
new_user_join_team: 'new_user_join_team',
new_user_join_project: 'new_user_join_project'
new_user_join_project: 'new_user_join_project',
kanban_task_created: 'kanban_task_created',
kanban_task_assigned: 'kanban_task_assigned',
kanban_task_status_updated: 'kanban_task_status_updated',
kanban_task_updated: 'kanban_task_updated',
kanban_task_deleted: 'kanban_task_deleted',
kanban_task_comment_created: 'kanban_task_comment_created'
} as const
export type NotificationType = (typeof NotificationType)[keyof typeof NotificationType]
@@ -137,7 +143,8 @@ export const WorkflowTaskType = {
chat: 'chat',
ai_embedding: 'ai_embedding',
query_embedding_for_search: 'query_embedding_for_search',
agent_tool_call: 'agent_tool_call'
agent_tool_call: 'agent_tool_call',
kanban_agent_run: 'kanban_agent_run'
} as const
export type WorkflowTaskType = (typeof WorkflowTaskType)[keyof typeof WorkflowTaskType]
@@ -203,6 +210,46 @@ export const QuotaResourceType = {
export type QuotaResourceType = (typeof QuotaResourceType)[keyof typeof QuotaResourceType]
export const KanbanTaskStatus = {
TODO: 'TODO',
READY: 'READY',
IN_PROGRESS: 'IN_PROGRESS',
BLOCKED: 'BLOCKED',
IN_REVIEW: 'IN_REVIEW',
DONE: 'DONE'
} as const
export type KanbanTaskStatus = (typeof KanbanTaskStatus)[keyof typeof KanbanTaskStatus]
export const KanbanTaskPriority = {
LOW: 'LOW',
MEDIUM: 'MEDIUM',
HIGH: 'HIGH',
URGENT: 'URGENT'
} as const
export type KanbanTaskPriority = (typeof KanbanTaskPriority)[keyof typeof KanbanTaskPriority]
export const KanbanTaskEventType = {
CREATED: 'CREATED',
STATUS_CHANGED: 'STATUS_CHANGED',
ASSIGNED: 'ASSIGNED',
UNASSIGNED: 'UNASSIGNED',
COMMENTED: 'COMMENTED',
CHANGES_REQUESTED: 'CHANGES_REQUESTED',
BLOCKED: 'BLOCKED',
UNBLOCKED: 'UNBLOCKED',
PRIORITY_CHANGED: 'PRIORITY_CHANGED',
GOAL_CHANGED: 'GOAL_CHANGED',
DEPENDENCY_ADDED: 'DEPENDENCY_ADDED',
DEPENDENCY_REMOVED: 'DEPENDENCY_REMOVED'
} as const
export type KanbanTaskEventType = (typeof KanbanTaskEventType)[keyof typeof KanbanTaskEventType]
export const AgentType = {
chat: 'chat',
autofill: 'autofill',
File diff suppressed because one or more lines are too long
+672 -2
View File
@@ -427,7 +427,14 @@ export const ModelName = {
AiUsage: 'AiUsage',
AuditLog: 'AuditLog',
QuotaRule: 'QuotaRule',
QuotaRecord: 'QuotaRecord'
QuotaRecord: 'QuotaRecord',
KanbanGoal: 'KanbanGoal',
KanbanTask: 'KanbanTask',
KanbanTaskLink: 'KanbanTaskLink',
KanbanTaskAsset: 'KanbanTaskAsset',
KanbanTaskComment: 'KanbanTaskComment',
KanbanTaskEvent: 'KanbanTaskEvent',
RecentFileItem: 'RecentFileItem'
} as const
export type ModelName = (typeof ModelName)[keyof typeof ModelName]
@@ -443,7 +450,7 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
omit: GlobalOmitOptions
}
meta: {
modelProps: "user" | "session" | "account" | "verification" | "authToken" | "team" | "sandbox" | "skill" | "teamMember" | "project" | "projectMember" | "shareLink" | "watermarkConfig" | "watermarkTemplate" | "watermarkFile" | "asset" | "storageKey" | "assetMetadataValue" | "assetAgentMd" | "assetComment" | "assetCommentAttachment" | "assetEmbedding" | "invite" | "metadataField" | "notification" | "systemSettings" | "task" | "workflowTask" | "agent" | "agentSkill" | "mcpServer" | "agentMcpServer" | "mcpServerCredential" | "agentSession" | "agentSessionEntry" | "userMetadata" | "model" | "provider" | "collection" | "apiToken" | "aiUsage" | "auditLog" | "quotaRule" | "quotaRecord"
modelProps: "user" | "session" | "account" | "verification" | "authToken" | "team" | "sandbox" | "skill" | "teamMember" | "project" | "projectMember" | "shareLink" | "watermarkConfig" | "watermarkTemplate" | "watermarkFile" | "asset" | "storageKey" | "assetMetadataValue" | "assetAgentMd" | "assetComment" | "assetCommentAttachment" | "assetEmbedding" | "invite" | "metadataField" | "notification" | "systemSettings" | "task" | "workflowTask" | "agent" | "agentSkill" | "mcpServer" | "agentMcpServer" | "mcpServerCredential" | "agentSession" | "agentSessionEntry" | "userMetadata" | "model" | "provider" | "collection" | "apiToken" | "aiUsage" | "auditLog" | "quotaRule" | "quotaRecord" | "kanbanGoal" | "kanbanTask" | "kanbanTaskLink" | "kanbanTaskAsset" | "kanbanTaskComment" | "kanbanTaskEvent" | "recentFileItem"
txIsolationLevel: TransactionIsolationLevel
}
model: {
@@ -3703,6 +3710,524 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
}
}
}
KanbanGoal: {
payload: Prisma.$KanbanGoalPayload<ExtArgs>
fields: Prisma.KanbanGoalFieldRefs
operations: {
findUnique: {
args: Prisma.KanbanGoalFindUniqueArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload> | null
}
findUniqueOrThrow: {
args: Prisma.KanbanGoalFindUniqueOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload>
}
findFirst: {
args: Prisma.KanbanGoalFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload> | null
}
findFirstOrThrow: {
args: Prisma.KanbanGoalFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload>
}
findMany: {
args: Prisma.KanbanGoalFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload>[]
}
create: {
args: Prisma.KanbanGoalCreateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload>
}
createMany: {
args: Prisma.KanbanGoalCreateManyArgs<ExtArgs>
result: BatchPayload
}
createManyAndReturn: {
args: Prisma.KanbanGoalCreateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload>[]
}
delete: {
args: Prisma.KanbanGoalDeleteArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload>
}
update: {
args: Prisma.KanbanGoalUpdateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload>
}
deleteMany: {
args: Prisma.KanbanGoalDeleteManyArgs<ExtArgs>
result: BatchPayload
}
updateMany: {
args: Prisma.KanbanGoalUpdateManyArgs<ExtArgs>
result: BatchPayload
}
updateManyAndReturn: {
args: Prisma.KanbanGoalUpdateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload>[]
}
upsert: {
args: Prisma.KanbanGoalUpsertArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload>
}
aggregate: {
args: Prisma.KanbanGoalAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateKanbanGoal>
}
groupBy: {
args: Prisma.KanbanGoalGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanGoalGroupByOutputType>[]
}
count: {
args: Prisma.KanbanGoalCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanGoalCountAggregateOutputType> | number
}
}
}
KanbanTask: {
payload: Prisma.$KanbanTaskPayload<ExtArgs>
fields: Prisma.KanbanTaskFieldRefs
operations: {
findUnique: {
args: Prisma.KanbanTaskFindUniqueArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload> | null
}
findUniqueOrThrow: {
args: Prisma.KanbanTaskFindUniqueOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload>
}
findFirst: {
args: Prisma.KanbanTaskFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload> | null
}
findFirstOrThrow: {
args: Prisma.KanbanTaskFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload>
}
findMany: {
args: Prisma.KanbanTaskFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload>[]
}
create: {
args: Prisma.KanbanTaskCreateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload>
}
createMany: {
args: Prisma.KanbanTaskCreateManyArgs<ExtArgs>
result: BatchPayload
}
createManyAndReturn: {
args: Prisma.KanbanTaskCreateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload>[]
}
delete: {
args: Prisma.KanbanTaskDeleteArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload>
}
update: {
args: Prisma.KanbanTaskUpdateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload>
}
deleteMany: {
args: Prisma.KanbanTaskDeleteManyArgs<ExtArgs>
result: BatchPayload
}
updateMany: {
args: Prisma.KanbanTaskUpdateManyArgs<ExtArgs>
result: BatchPayload
}
updateManyAndReturn: {
args: Prisma.KanbanTaskUpdateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload>[]
}
upsert: {
args: Prisma.KanbanTaskUpsertArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload>
}
aggregate: {
args: Prisma.KanbanTaskAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateKanbanTask>
}
groupBy: {
args: Prisma.KanbanTaskGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskGroupByOutputType>[]
}
count: {
args: Prisma.KanbanTaskCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskCountAggregateOutputType> | number
}
}
}
KanbanTaskLink: {
payload: Prisma.$KanbanTaskLinkPayload<ExtArgs>
fields: Prisma.KanbanTaskLinkFieldRefs
operations: {
findUnique: {
args: Prisma.KanbanTaskLinkFindUniqueArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload> | null
}
findUniqueOrThrow: {
args: Prisma.KanbanTaskLinkFindUniqueOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload>
}
findFirst: {
args: Prisma.KanbanTaskLinkFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload> | null
}
findFirstOrThrow: {
args: Prisma.KanbanTaskLinkFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload>
}
findMany: {
args: Prisma.KanbanTaskLinkFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload>[]
}
create: {
args: Prisma.KanbanTaskLinkCreateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload>
}
createMany: {
args: Prisma.KanbanTaskLinkCreateManyArgs<ExtArgs>
result: BatchPayload
}
createManyAndReturn: {
args: Prisma.KanbanTaskLinkCreateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload>[]
}
delete: {
args: Prisma.KanbanTaskLinkDeleteArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload>
}
update: {
args: Prisma.KanbanTaskLinkUpdateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload>
}
deleteMany: {
args: Prisma.KanbanTaskLinkDeleteManyArgs<ExtArgs>
result: BatchPayload
}
updateMany: {
args: Prisma.KanbanTaskLinkUpdateManyArgs<ExtArgs>
result: BatchPayload
}
updateManyAndReturn: {
args: Prisma.KanbanTaskLinkUpdateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload>[]
}
upsert: {
args: Prisma.KanbanTaskLinkUpsertArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload>
}
aggregate: {
args: Prisma.KanbanTaskLinkAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateKanbanTaskLink>
}
groupBy: {
args: Prisma.KanbanTaskLinkGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskLinkGroupByOutputType>[]
}
count: {
args: Prisma.KanbanTaskLinkCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskLinkCountAggregateOutputType> | number
}
}
}
KanbanTaskAsset: {
payload: Prisma.$KanbanTaskAssetPayload<ExtArgs>
fields: Prisma.KanbanTaskAssetFieldRefs
operations: {
findUnique: {
args: Prisma.KanbanTaskAssetFindUniqueArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload> | null
}
findUniqueOrThrow: {
args: Prisma.KanbanTaskAssetFindUniqueOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload>
}
findFirst: {
args: Prisma.KanbanTaskAssetFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload> | null
}
findFirstOrThrow: {
args: Prisma.KanbanTaskAssetFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload>
}
findMany: {
args: Prisma.KanbanTaskAssetFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload>[]
}
create: {
args: Prisma.KanbanTaskAssetCreateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload>
}
createMany: {
args: Prisma.KanbanTaskAssetCreateManyArgs<ExtArgs>
result: BatchPayload
}
createManyAndReturn: {
args: Prisma.KanbanTaskAssetCreateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload>[]
}
delete: {
args: Prisma.KanbanTaskAssetDeleteArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload>
}
update: {
args: Prisma.KanbanTaskAssetUpdateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload>
}
deleteMany: {
args: Prisma.KanbanTaskAssetDeleteManyArgs<ExtArgs>
result: BatchPayload
}
updateMany: {
args: Prisma.KanbanTaskAssetUpdateManyArgs<ExtArgs>
result: BatchPayload
}
updateManyAndReturn: {
args: Prisma.KanbanTaskAssetUpdateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload>[]
}
upsert: {
args: Prisma.KanbanTaskAssetUpsertArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload>
}
aggregate: {
args: Prisma.KanbanTaskAssetAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateKanbanTaskAsset>
}
groupBy: {
args: Prisma.KanbanTaskAssetGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskAssetGroupByOutputType>[]
}
count: {
args: Prisma.KanbanTaskAssetCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskAssetCountAggregateOutputType> | number
}
}
}
KanbanTaskComment: {
payload: Prisma.$KanbanTaskCommentPayload<ExtArgs>
fields: Prisma.KanbanTaskCommentFieldRefs
operations: {
findUnique: {
args: Prisma.KanbanTaskCommentFindUniqueArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload> | null
}
findUniqueOrThrow: {
args: Prisma.KanbanTaskCommentFindUniqueOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload>
}
findFirst: {
args: Prisma.KanbanTaskCommentFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload> | null
}
findFirstOrThrow: {
args: Prisma.KanbanTaskCommentFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload>
}
findMany: {
args: Prisma.KanbanTaskCommentFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload>[]
}
create: {
args: Prisma.KanbanTaskCommentCreateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload>
}
createMany: {
args: Prisma.KanbanTaskCommentCreateManyArgs<ExtArgs>
result: BatchPayload
}
createManyAndReturn: {
args: Prisma.KanbanTaskCommentCreateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload>[]
}
delete: {
args: Prisma.KanbanTaskCommentDeleteArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload>
}
update: {
args: Prisma.KanbanTaskCommentUpdateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload>
}
deleteMany: {
args: Prisma.KanbanTaskCommentDeleteManyArgs<ExtArgs>
result: BatchPayload
}
updateMany: {
args: Prisma.KanbanTaskCommentUpdateManyArgs<ExtArgs>
result: BatchPayload
}
updateManyAndReturn: {
args: Prisma.KanbanTaskCommentUpdateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload>[]
}
upsert: {
args: Prisma.KanbanTaskCommentUpsertArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload>
}
aggregate: {
args: Prisma.KanbanTaskCommentAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateKanbanTaskComment>
}
groupBy: {
args: Prisma.KanbanTaskCommentGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskCommentGroupByOutputType>[]
}
count: {
args: Prisma.KanbanTaskCommentCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskCommentCountAggregateOutputType> | number
}
}
}
KanbanTaskEvent: {
payload: Prisma.$KanbanTaskEventPayload<ExtArgs>
fields: Prisma.KanbanTaskEventFieldRefs
operations: {
findUnique: {
args: Prisma.KanbanTaskEventFindUniqueArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload> | null
}
findUniqueOrThrow: {
args: Prisma.KanbanTaskEventFindUniqueOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload>
}
findFirst: {
args: Prisma.KanbanTaskEventFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload> | null
}
findFirstOrThrow: {
args: Prisma.KanbanTaskEventFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload>
}
findMany: {
args: Prisma.KanbanTaskEventFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload>[]
}
create: {
args: Prisma.KanbanTaskEventCreateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload>
}
createMany: {
args: Prisma.KanbanTaskEventCreateManyArgs<ExtArgs>
result: BatchPayload
}
createManyAndReturn: {
args: Prisma.KanbanTaskEventCreateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload>[]
}
delete: {
args: Prisma.KanbanTaskEventDeleteArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload>
}
update: {
args: Prisma.KanbanTaskEventUpdateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload>
}
deleteMany: {
args: Prisma.KanbanTaskEventDeleteManyArgs<ExtArgs>
result: BatchPayload
}
updateMany: {
args: Prisma.KanbanTaskEventUpdateManyArgs<ExtArgs>
result: BatchPayload
}
updateManyAndReturn: {
args: Prisma.KanbanTaskEventUpdateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload>[]
}
upsert: {
args: Prisma.KanbanTaskEventUpsertArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload>
}
aggregate: {
args: Prisma.KanbanTaskEventAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateKanbanTaskEvent>
}
groupBy: {
args: Prisma.KanbanTaskEventGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskEventGroupByOutputType>[]
}
count: {
args: Prisma.KanbanTaskEventCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskEventCountAggregateOutputType> | number
}
}
}
RecentFileItem: {
payload: Prisma.$RecentFileItemPayload<ExtArgs>
fields: Prisma.RecentFileItemFieldRefs
operations: {
findUnique: {
args: Prisma.RecentFileItemFindUniqueArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$RecentFileItemPayload> | null
}
findUniqueOrThrow: {
args: Prisma.RecentFileItemFindUniqueOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$RecentFileItemPayload>
}
findFirst: {
args: Prisma.RecentFileItemFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$RecentFileItemPayload> | null
}
findFirstOrThrow: {
args: Prisma.RecentFileItemFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$RecentFileItemPayload>
}
findMany: {
args: Prisma.RecentFileItemFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$RecentFileItemPayload>[]
}
create: {
args: Prisma.RecentFileItemCreateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$RecentFileItemPayload>
}
createMany: {
args: Prisma.RecentFileItemCreateManyArgs<ExtArgs>
result: BatchPayload
}
createManyAndReturn: {
args: Prisma.RecentFileItemCreateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$RecentFileItemPayload>[]
}
delete: {
args: Prisma.RecentFileItemDeleteArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$RecentFileItemPayload>
}
update: {
args: Prisma.RecentFileItemUpdateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$RecentFileItemPayload>
}
deleteMany: {
args: Prisma.RecentFileItemDeleteManyArgs<ExtArgs>
result: BatchPayload
}
updateMany: {
args: Prisma.RecentFileItemUpdateManyArgs<ExtArgs>
result: BatchPayload
}
updateManyAndReturn: {
args: Prisma.RecentFileItemUpdateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$RecentFileItemPayload>[]
}
upsert: {
args: Prisma.RecentFileItemUpsertArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$RecentFileItemPayload>
}
aggregate: {
args: Prisma.RecentFileItemAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateRecentFileItem>
}
groupBy: {
args: Prisma.RecentFileItemGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.RecentFileItemGroupByOutputType>[]
}
count: {
args: Prisma.RecentFileItemCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.RecentFileItemCountAggregateOutputType> | number
}
}
}
}
} & {
other: {
@@ -4095,6 +4620,7 @@ export const NotificationScalarFieldEnum = {
creatorId: 'creatorId',
assetId: 'assetId',
taskId: 'taskId',
kanbanTaskId: 'kanbanTaskId',
userId: 'userId'
} as const
@@ -4383,6 +4909,101 @@ export const QuotaRecordScalarFieldEnum = {
export type QuotaRecordScalarFieldEnum = (typeof QuotaRecordScalarFieldEnum)[keyof typeof QuotaRecordScalarFieldEnum]
export const KanbanGoalScalarFieldEnum = {
id: 'id',
title: 'title',
description: 'description',
teamId: 'teamId',
creatorId: 'creatorId',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type KanbanGoalScalarFieldEnum = (typeof KanbanGoalScalarFieldEnum)[keyof typeof KanbanGoalScalarFieldEnum]
export const KanbanTaskScalarFieldEnum = {
id: 'id',
title: 'title',
description: 'description',
isAgentTask: 'isAgentTask',
status: 'status',
priority: 'priority',
startDate: 'startDate',
dueDate: 'dueDate',
startedAt: 'startedAt',
completedAt: 'completedAt',
goalId: 'goalId',
teamId: 'teamId',
projectId: 'projectId',
creatorId: 'creatorId',
reporterId: 'reporterId',
assigneeId: 'assigneeId',
targetFolderId: 'targetFolderId',
sortIndex: 'sortIndex',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type KanbanTaskScalarFieldEnum = (typeof KanbanTaskScalarFieldEnum)[keyof typeof KanbanTaskScalarFieldEnum]
export const KanbanTaskLinkScalarFieldEnum = {
parentId: 'parentId',
childId: 'childId',
createdAt: 'createdAt'
} as const
export type KanbanTaskLinkScalarFieldEnum = (typeof KanbanTaskLinkScalarFieldEnum)[keyof typeof KanbanTaskLinkScalarFieldEnum]
export const KanbanTaskAssetScalarFieldEnum = {
taskId: 'taskId',
assetId: 'assetId',
createdAt: 'createdAt'
} as const
export type KanbanTaskAssetScalarFieldEnum = (typeof KanbanTaskAssetScalarFieldEnum)[keyof typeof KanbanTaskAssetScalarFieldEnum]
export const KanbanTaskCommentScalarFieldEnum = {
id: 'id',
taskId: 'taskId',
authorId: 'authorId',
body: 'body',
attachments: 'attachments',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type KanbanTaskCommentScalarFieldEnum = (typeof KanbanTaskCommentScalarFieldEnum)[keyof typeof KanbanTaskCommentScalarFieldEnum]
export const KanbanTaskEventScalarFieldEnum = {
id: 'id',
taskId: 'taskId',
actorId: 'actorId',
type: 'type',
fromStatus: 'fromStatus',
toStatus: 'toStatus',
data: 'data',
createdAt: 'createdAt'
} as const
export type KanbanTaskEventScalarFieldEnum = (typeof KanbanTaskEventScalarFieldEnum)[keyof typeof KanbanTaskEventScalarFieldEnum]
export const RecentFileItemScalarFieldEnum = {
id: 'id',
userId: 'userId',
projectId: 'projectId',
assetId: 'assetId',
viewedAt: 'viewedAt'
} as const
export type RecentFileItemScalarFieldEnum = (typeof RecentFileItemScalarFieldEnum)[keyof typeof RecentFileItemScalarFieldEnum]
export const SortOrder = {
asc: 'asc',
desc: 'desc'
@@ -4835,6 +5456,48 @@ export type EnumQuotaPeriodFieldRefInput<$PrismaModel> = FieldRefInputType<$Pris
export type ListEnumQuotaPeriodFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'QuotaPeriod[]'>
/**
* Reference to a field of type 'KanbanTaskStatus'
*/
export type EnumKanbanTaskStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'KanbanTaskStatus'>
/**
* Reference to a field of type 'KanbanTaskStatus[]'
*/
export type ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'KanbanTaskStatus[]'>
/**
* Reference to a field of type 'KanbanTaskPriority'
*/
export type EnumKanbanTaskPriorityFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'KanbanTaskPriority'>
/**
* Reference to a field of type 'KanbanTaskPriority[]'
*/
export type ListEnumKanbanTaskPriorityFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'KanbanTaskPriority[]'>
/**
* Reference to a field of type 'KanbanTaskEventType'
*/
export type EnumKanbanTaskEventTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'KanbanTaskEventType'>
/**
* Reference to a field of type 'KanbanTaskEventType[]'
*/
export type ListEnumKanbanTaskEventTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'KanbanTaskEventType[]'>
/**
* Batch Payload for updateMany & deleteMany & createMany
*/
@@ -4989,6 +5652,13 @@ export type GlobalOmitConfig = {
auditLog?: Prisma.AuditLogOmit
quotaRule?: Prisma.QuotaRuleOmit
quotaRecord?: Prisma.QuotaRecordOmit
kanbanGoal?: Prisma.KanbanGoalOmit
kanbanTask?: Prisma.KanbanTaskOmit
kanbanTaskLink?: Prisma.KanbanTaskLinkOmit
kanbanTaskAsset?: Prisma.KanbanTaskAssetOmit
kanbanTaskComment?: Prisma.KanbanTaskCommentOmit
kanbanTaskEvent?: Prisma.KanbanTaskEventOmit
recentFileItem?: Prisma.RecentFileItemOmit
}
/* Types for Logging */
@@ -94,7 +94,14 @@ export const ModelName = {
AiUsage: 'AiUsage',
AuditLog: 'AuditLog',
QuotaRule: 'QuotaRule',
QuotaRecord: 'QuotaRecord'
QuotaRecord: 'QuotaRecord',
KanbanGoal: 'KanbanGoal',
KanbanTask: 'KanbanTask',
KanbanTaskLink: 'KanbanTaskLink',
KanbanTaskAsset: 'KanbanTaskAsset',
KanbanTaskComment: 'KanbanTaskComment',
KanbanTaskEvent: 'KanbanTaskEvent',
RecentFileItem: 'RecentFileItem'
} as const
export type ModelName = (typeof ModelName)[keyof typeof ModelName]
@@ -466,6 +473,7 @@ export const NotificationScalarFieldEnum = {
creatorId: 'creatorId',
assetId: 'assetId',
taskId: 'taskId',
kanbanTaskId: 'kanbanTaskId',
userId: 'userId'
} as const
@@ -754,6 +762,101 @@ export const QuotaRecordScalarFieldEnum = {
export type QuotaRecordScalarFieldEnum = (typeof QuotaRecordScalarFieldEnum)[keyof typeof QuotaRecordScalarFieldEnum]
export const KanbanGoalScalarFieldEnum = {
id: 'id',
title: 'title',
description: 'description',
teamId: 'teamId',
creatorId: 'creatorId',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type KanbanGoalScalarFieldEnum = (typeof KanbanGoalScalarFieldEnum)[keyof typeof KanbanGoalScalarFieldEnum]
export const KanbanTaskScalarFieldEnum = {
id: 'id',
title: 'title',
description: 'description',
isAgentTask: 'isAgentTask',
status: 'status',
priority: 'priority',
startDate: 'startDate',
dueDate: 'dueDate',
startedAt: 'startedAt',
completedAt: 'completedAt',
goalId: 'goalId',
teamId: 'teamId',
projectId: 'projectId',
creatorId: 'creatorId',
reporterId: 'reporterId',
assigneeId: 'assigneeId',
targetFolderId: 'targetFolderId',
sortIndex: 'sortIndex',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type KanbanTaskScalarFieldEnum = (typeof KanbanTaskScalarFieldEnum)[keyof typeof KanbanTaskScalarFieldEnum]
export const KanbanTaskLinkScalarFieldEnum = {
parentId: 'parentId',
childId: 'childId',
createdAt: 'createdAt'
} as const
export type KanbanTaskLinkScalarFieldEnum = (typeof KanbanTaskLinkScalarFieldEnum)[keyof typeof KanbanTaskLinkScalarFieldEnum]
export const KanbanTaskAssetScalarFieldEnum = {
taskId: 'taskId',
assetId: 'assetId',
createdAt: 'createdAt'
} as const
export type KanbanTaskAssetScalarFieldEnum = (typeof KanbanTaskAssetScalarFieldEnum)[keyof typeof KanbanTaskAssetScalarFieldEnum]
export const KanbanTaskCommentScalarFieldEnum = {
id: 'id',
taskId: 'taskId',
authorId: 'authorId',
body: 'body',
attachments: 'attachments',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type KanbanTaskCommentScalarFieldEnum = (typeof KanbanTaskCommentScalarFieldEnum)[keyof typeof KanbanTaskCommentScalarFieldEnum]
export const KanbanTaskEventScalarFieldEnum = {
id: 'id',
taskId: 'taskId',
actorId: 'actorId',
type: 'type',
fromStatus: 'fromStatus',
toStatus: 'toStatus',
data: 'data',
createdAt: 'createdAt'
} as const
export type KanbanTaskEventScalarFieldEnum = (typeof KanbanTaskEventScalarFieldEnum)[keyof typeof KanbanTaskEventScalarFieldEnum]
export const RecentFileItemScalarFieldEnum = {
id: 'id',
userId: 'userId',
projectId: 'projectId',
assetId: 'assetId',
viewedAt: 'viewedAt'
} as const
export type RecentFileItemScalarFieldEnum = (typeof RecentFileItemScalarFieldEnum)[keyof typeof RecentFileItemScalarFieldEnum]
export const SortOrder = {
asc: 'asc',
desc: 'desc'
+7
View File
@@ -52,4 +52,11 @@ export type * from './models/AiUsage.ts'
export type * from './models/AuditLog.ts'
export type * from './models/QuotaRule.ts'
export type * from './models/QuotaRecord.ts'
export type * from './models/KanbanGoal.ts'
export type * from './models/KanbanTask.ts'
export type * from './models/KanbanTaskLink.ts'
export type * from './models/KanbanTaskAsset.ts'
export type * from './models/KanbanTaskComment.ts'
export type * from './models/KanbanTaskEvent.ts'
export type * from './models/RecentFileItem.ts'
export type * from './commonInputTypes.ts'
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+249 -1
View File
@@ -36,6 +36,7 @@ export type NotificationMinAggregateOutputType = {
creatorId: string | null
assetId: string | null
taskId: string | null
kanbanTaskId: string | null
userId: string | null
}
@@ -49,6 +50,7 @@ export type NotificationMaxAggregateOutputType = {
creatorId: string | null
assetId: string | null
taskId: string | null
kanbanTaskId: string | null
userId: string | null
}
@@ -62,6 +64,7 @@ export type NotificationCountAggregateOutputType = {
creatorId: number
assetId: number
taskId: number
kanbanTaskId: number
userId: number
_all: number
}
@@ -77,6 +80,7 @@ export type NotificationMinAggregateInputType = {
creatorId?: true
assetId?: true
taskId?: true
kanbanTaskId?: true
userId?: true
}
@@ -90,6 +94,7 @@ export type NotificationMaxAggregateInputType = {
creatorId?: true
assetId?: true
taskId?: true
kanbanTaskId?: true
userId?: true
}
@@ -103,6 +108,7 @@ export type NotificationCountAggregateInputType = {
creatorId?: true
assetId?: true
taskId?: true
kanbanTaskId?: true
userId?: true
_all?: true
}
@@ -189,6 +195,7 @@ export type NotificationGroupByOutputType = {
creatorId: string | null
assetId: string | null
taskId: string | null
kanbanTaskId: string | null
userId: string | null
_count: NotificationCountAggregateOutputType | null
_min: NotificationMinAggregateOutputType | null
@@ -223,12 +230,14 @@ export type NotificationWhereInput = {
creatorId?: Prisma.StringNullableFilter<"Notification"> | string | null
assetId?: Prisma.StringNullableFilter<"Notification"> | string | null
taskId?: Prisma.StringNullableFilter<"Notification"> | string | null
kanbanTaskId?: Prisma.StringNullableFilter<"Notification"> | string | null
userId?: Prisma.StringNullableFilter<"Notification"> | string | null
team?: Prisma.XOR<Prisma.TeamScalarRelationFilter, Prisma.TeamWhereInput>
project?: Prisma.XOR<Prisma.ProjectNullableScalarRelationFilter, Prisma.ProjectWhereInput> | null
creator?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
asset?: Prisma.XOR<Prisma.AssetNullableScalarRelationFilter, Prisma.AssetWhereInput> | null
task?: Prisma.XOR<Prisma.TaskNullableScalarRelationFilter, Prisma.TaskWhereInput> | null
kanbanTask?: Prisma.XOR<Prisma.KanbanTaskNullableScalarRelationFilter, Prisma.KanbanTaskWhereInput> | null
user?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
readByMembers?: Prisma.XOR<Prisma.TeamMemberNullableScalarRelationFilter, Prisma.TeamMemberWhereInput> | null
}
@@ -243,12 +252,14 @@ export type NotificationOrderByWithRelationInput = {
creatorId?: Prisma.SortOrderInput | Prisma.SortOrder
assetId?: Prisma.SortOrderInput | Prisma.SortOrder
taskId?: Prisma.SortOrderInput | Prisma.SortOrder
kanbanTaskId?: Prisma.SortOrderInput | Prisma.SortOrder
userId?: Prisma.SortOrderInput | Prisma.SortOrder
team?: Prisma.TeamOrderByWithRelationInput
project?: Prisma.ProjectOrderByWithRelationInput
creator?: Prisma.UserOrderByWithRelationInput
asset?: Prisma.AssetOrderByWithRelationInput
task?: Prisma.TaskOrderByWithRelationInput
kanbanTask?: Prisma.KanbanTaskOrderByWithRelationInput
user?: Prisma.UserOrderByWithRelationInput
readByMembers?: Prisma.TeamMemberOrderByWithRelationInput
}
@@ -266,12 +277,14 @@ export type NotificationWhereUniqueInput = Prisma.AtLeast<{
creatorId?: Prisma.StringNullableFilter<"Notification"> | string | null
assetId?: Prisma.StringNullableFilter<"Notification"> | string | null
taskId?: Prisma.StringNullableFilter<"Notification"> | string | null
kanbanTaskId?: Prisma.StringNullableFilter<"Notification"> | string | null
userId?: Prisma.StringNullableFilter<"Notification"> | string | null
team?: Prisma.XOR<Prisma.TeamScalarRelationFilter, Prisma.TeamWhereInput>
project?: Prisma.XOR<Prisma.ProjectNullableScalarRelationFilter, Prisma.ProjectWhereInput> | null
creator?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
asset?: Prisma.XOR<Prisma.AssetNullableScalarRelationFilter, Prisma.AssetWhereInput> | null
task?: Prisma.XOR<Prisma.TaskNullableScalarRelationFilter, Prisma.TaskWhereInput> | null
kanbanTask?: Prisma.XOR<Prisma.KanbanTaskNullableScalarRelationFilter, Prisma.KanbanTaskWhereInput> | null
user?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
readByMembers?: Prisma.XOR<Prisma.TeamMemberNullableScalarRelationFilter, Prisma.TeamMemberWhereInput> | null
}, "id">
@@ -286,6 +299,7 @@ export type NotificationOrderByWithAggregationInput = {
creatorId?: Prisma.SortOrderInput | Prisma.SortOrder
assetId?: Prisma.SortOrderInput | Prisma.SortOrder
taskId?: Prisma.SortOrderInput | Prisma.SortOrder
kanbanTaskId?: Prisma.SortOrderInput | Prisma.SortOrder
userId?: Prisma.SortOrderInput | Prisma.SortOrder
_count?: Prisma.NotificationCountOrderByAggregateInput
_max?: Prisma.NotificationMaxOrderByAggregateInput
@@ -305,6 +319,7 @@ export type NotificationScalarWhereWithAggregatesInput = {
creatorId?: Prisma.StringNullableWithAggregatesFilter<"Notification"> | string | null
assetId?: Prisma.StringNullableWithAggregatesFilter<"Notification"> | string | null
taskId?: Prisma.StringNullableWithAggregatesFilter<"Notification"> | string | null
kanbanTaskId?: Prisma.StringNullableWithAggregatesFilter<"Notification"> | string | null
userId?: Prisma.StringNullableWithAggregatesFilter<"Notification"> | string | null
}
@@ -318,6 +333,7 @@ export type NotificationCreateInput = {
creator?: Prisma.UserCreateNestedOneWithoutCreatedNotificationsInput
asset?: Prisma.AssetCreateNestedOneWithoutNotificationsInput
task?: Prisma.TaskCreateNestedOneWithoutNotificationsInput
kanbanTask?: Prisma.KanbanTaskCreateNestedOneWithoutNotificationsInput
user?: Prisma.UserCreateNestedOneWithoutNotificationsInput
readByMembers?: Prisma.TeamMemberCreateNestedOneWithoutLastReadNotificationInput
}
@@ -332,6 +348,7 @@ export type NotificationUncheckedCreateInput = {
creatorId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
readByMembers?: Prisma.TeamMemberUncheckedCreateNestedOneWithoutLastReadNotificationInput
}
@@ -346,6 +363,7 @@ export type NotificationUpdateInput = {
creator?: Prisma.UserUpdateOneWithoutCreatedNotificationsNestedInput
asset?: Prisma.AssetUpdateOneWithoutNotificationsNestedInput
task?: Prisma.TaskUpdateOneWithoutNotificationsNestedInput
kanbanTask?: Prisma.KanbanTaskUpdateOneWithoutNotificationsNestedInput
user?: Prisma.UserUpdateOneWithoutNotificationsNestedInput
readByMembers?: Prisma.TeamMemberUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -360,6 +378,7 @@ export type NotificationUncheckedUpdateInput = {
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
readByMembers?: Prisma.TeamMemberUncheckedUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -374,6 +393,7 @@ export type NotificationCreateManyInput = {
creatorId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
}
@@ -394,6 +414,7 @@ export type NotificationUncheckedUpdateManyInput = {
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
@@ -422,6 +443,7 @@ export type NotificationCountOrderByAggregateInput = {
creatorId?: Prisma.SortOrder
assetId?: Prisma.SortOrder
taskId?: Prisma.SortOrder
kanbanTaskId?: Prisma.SortOrder
userId?: Prisma.SortOrder
}
@@ -435,6 +457,7 @@ export type NotificationMaxOrderByAggregateInput = {
creatorId?: Prisma.SortOrder
assetId?: Prisma.SortOrder
taskId?: Prisma.SortOrder
kanbanTaskId?: Prisma.SortOrder
userId?: Prisma.SortOrder
}
@@ -448,6 +471,7 @@ export type NotificationMinOrderByAggregateInput = {
creatorId?: Prisma.SortOrder
assetId?: Prisma.SortOrder
taskId?: Prisma.SortOrder
kanbanTaskId?: Prisma.SortOrder
userId?: Prisma.SortOrder
}
@@ -723,6 +747,48 @@ export type NotificationUncheckedUpdateManyWithoutTaskNestedInput = {
deleteMany?: Prisma.NotificationScalarWhereInput | Prisma.NotificationScalarWhereInput[]
}
export type NotificationCreateNestedManyWithoutKanbanTaskInput = {
create?: Prisma.XOR<Prisma.NotificationCreateWithoutKanbanTaskInput, Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput> | Prisma.NotificationCreateWithoutKanbanTaskInput[] | Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput[]
connectOrCreate?: Prisma.NotificationCreateOrConnectWithoutKanbanTaskInput | Prisma.NotificationCreateOrConnectWithoutKanbanTaskInput[]
createMany?: Prisma.NotificationCreateManyKanbanTaskInputEnvelope
connect?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
}
export type NotificationUncheckedCreateNestedManyWithoutKanbanTaskInput = {
create?: Prisma.XOR<Prisma.NotificationCreateWithoutKanbanTaskInput, Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput> | Prisma.NotificationCreateWithoutKanbanTaskInput[] | Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput[]
connectOrCreate?: Prisma.NotificationCreateOrConnectWithoutKanbanTaskInput | Prisma.NotificationCreateOrConnectWithoutKanbanTaskInput[]
createMany?: Prisma.NotificationCreateManyKanbanTaskInputEnvelope
connect?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
}
export type NotificationUpdateManyWithoutKanbanTaskNestedInput = {
create?: Prisma.XOR<Prisma.NotificationCreateWithoutKanbanTaskInput, Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput> | Prisma.NotificationCreateWithoutKanbanTaskInput[] | Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput[]
connectOrCreate?: Prisma.NotificationCreateOrConnectWithoutKanbanTaskInput | Prisma.NotificationCreateOrConnectWithoutKanbanTaskInput[]
upsert?: Prisma.NotificationUpsertWithWhereUniqueWithoutKanbanTaskInput | Prisma.NotificationUpsertWithWhereUniqueWithoutKanbanTaskInput[]
createMany?: Prisma.NotificationCreateManyKanbanTaskInputEnvelope
set?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
disconnect?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
delete?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
connect?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
update?: Prisma.NotificationUpdateWithWhereUniqueWithoutKanbanTaskInput | Prisma.NotificationUpdateWithWhereUniqueWithoutKanbanTaskInput[]
updateMany?: Prisma.NotificationUpdateManyWithWhereWithoutKanbanTaskInput | Prisma.NotificationUpdateManyWithWhereWithoutKanbanTaskInput[]
deleteMany?: Prisma.NotificationScalarWhereInput | Prisma.NotificationScalarWhereInput[]
}
export type NotificationUncheckedUpdateManyWithoutKanbanTaskNestedInput = {
create?: Prisma.XOR<Prisma.NotificationCreateWithoutKanbanTaskInput, Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput> | Prisma.NotificationCreateWithoutKanbanTaskInput[] | Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput[]
connectOrCreate?: Prisma.NotificationCreateOrConnectWithoutKanbanTaskInput | Prisma.NotificationCreateOrConnectWithoutKanbanTaskInput[]
upsert?: Prisma.NotificationUpsertWithWhereUniqueWithoutKanbanTaskInput | Prisma.NotificationUpsertWithWhereUniqueWithoutKanbanTaskInput[]
createMany?: Prisma.NotificationCreateManyKanbanTaskInputEnvelope
set?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
disconnect?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
delete?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
connect?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
update?: Prisma.NotificationUpdateWithWhereUniqueWithoutKanbanTaskInput | Prisma.NotificationUpdateWithWhereUniqueWithoutKanbanTaskInput[]
updateMany?: Prisma.NotificationUpdateManyWithWhereWithoutKanbanTaskInput | Prisma.NotificationUpdateManyWithWhereWithoutKanbanTaskInput[]
deleteMany?: Prisma.NotificationScalarWhereInput | Prisma.NotificationScalarWhereInput[]
}
export type NotificationCreateWithoutCreatorInput = {
id?: string
type?: $Enums.NotificationType | null
@@ -732,6 +798,7 @@ export type NotificationCreateWithoutCreatorInput = {
project?: Prisma.ProjectCreateNestedOneWithoutNotificationsInput
asset?: Prisma.AssetCreateNestedOneWithoutNotificationsInput
task?: Prisma.TaskCreateNestedOneWithoutNotificationsInput
kanbanTask?: Prisma.KanbanTaskCreateNestedOneWithoutNotificationsInput
user?: Prisma.UserCreateNestedOneWithoutNotificationsInput
readByMembers?: Prisma.TeamMemberCreateNestedOneWithoutLastReadNotificationInput
}
@@ -745,6 +812,7 @@ export type NotificationUncheckedCreateWithoutCreatorInput = {
projectId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
readByMembers?: Prisma.TeamMemberUncheckedCreateNestedOneWithoutLastReadNotificationInput
}
@@ -769,6 +837,7 @@ export type NotificationCreateWithoutUserInput = {
creator?: Prisma.UserCreateNestedOneWithoutCreatedNotificationsInput
asset?: Prisma.AssetCreateNestedOneWithoutNotificationsInput
task?: Prisma.TaskCreateNestedOneWithoutNotificationsInput
kanbanTask?: Prisma.KanbanTaskCreateNestedOneWithoutNotificationsInput
readByMembers?: Prisma.TeamMemberCreateNestedOneWithoutLastReadNotificationInput
}
@@ -782,6 +851,7 @@ export type NotificationUncheckedCreateWithoutUserInput = {
creatorId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
readByMembers?: Prisma.TeamMemberUncheckedCreateNestedOneWithoutLastReadNotificationInput
}
@@ -824,6 +894,7 @@ export type NotificationScalarWhereInput = {
creatorId?: Prisma.StringNullableFilter<"Notification"> | string | null
assetId?: Prisma.StringNullableFilter<"Notification"> | string | null
taskId?: Prisma.StringNullableFilter<"Notification"> | string | null
kanbanTaskId?: Prisma.StringNullableFilter<"Notification"> | string | null
userId?: Prisma.StringNullableFilter<"Notification"> | string | null
}
@@ -852,6 +923,7 @@ export type NotificationCreateWithoutTeamInput = {
creator?: Prisma.UserCreateNestedOneWithoutCreatedNotificationsInput
asset?: Prisma.AssetCreateNestedOneWithoutNotificationsInput
task?: Prisma.TaskCreateNestedOneWithoutNotificationsInput
kanbanTask?: Prisma.KanbanTaskCreateNestedOneWithoutNotificationsInput
user?: Prisma.UserCreateNestedOneWithoutNotificationsInput
readByMembers?: Prisma.TeamMemberCreateNestedOneWithoutLastReadNotificationInput
}
@@ -865,6 +937,7 @@ export type NotificationUncheckedCreateWithoutTeamInput = {
creatorId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
readByMembers?: Prisma.TeamMemberUncheckedCreateNestedOneWithoutLastReadNotificationInput
}
@@ -905,6 +978,7 @@ export type NotificationCreateWithoutReadByMembersInput = {
creator?: Prisma.UserCreateNestedOneWithoutCreatedNotificationsInput
asset?: Prisma.AssetCreateNestedOneWithoutNotificationsInput
task?: Prisma.TaskCreateNestedOneWithoutNotificationsInput
kanbanTask?: Prisma.KanbanTaskCreateNestedOneWithoutNotificationsInput
user?: Prisma.UserCreateNestedOneWithoutNotificationsInput
}
@@ -918,6 +992,7 @@ export type NotificationUncheckedCreateWithoutReadByMembersInput = {
creatorId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
}
@@ -947,6 +1022,7 @@ export type NotificationUpdateWithoutReadByMembersInput = {
creator?: Prisma.UserUpdateOneWithoutCreatedNotificationsNestedInput
asset?: Prisma.AssetUpdateOneWithoutNotificationsNestedInput
task?: Prisma.TaskUpdateOneWithoutNotificationsNestedInput
kanbanTask?: Prisma.KanbanTaskUpdateOneWithoutNotificationsNestedInput
user?: Prisma.UserUpdateOneWithoutNotificationsNestedInput
}
@@ -960,6 +1036,7 @@ export type NotificationUncheckedUpdateWithoutReadByMembersInput = {
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
@@ -972,6 +1049,7 @@ export type NotificationCreateWithoutProjectInput = {
creator?: Prisma.UserCreateNestedOneWithoutCreatedNotificationsInput
asset?: Prisma.AssetCreateNestedOneWithoutNotificationsInput
task?: Prisma.TaskCreateNestedOneWithoutNotificationsInput
kanbanTask?: Prisma.KanbanTaskCreateNestedOneWithoutNotificationsInput
user?: Prisma.UserCreateNestedOneWithoutNotificationsInput
readByMembers?: Prisma.TeamMemberCreateNestedOneWithoutLastReadNotificationInput
}
@@ -985,6 +1063,7 @@ export type NotificationUncheckedCreateWithoutProjectInput = {
creatorId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
readByMembers?: Prisma.TeamMemberUncheckedCreateNestedOneWithoutLastReadNotificationInput
}
@@ -1024,6 +1103,7 @@ export type NotificationCreateWithoutAssetInput = {
project?: Prisma.ProjectCreateNestedOneWithoutNotificationsInput
creator?: Prisma.UserCreateNestedOneWithoutCreatedNotificationsInput
task?: Prisma.TaskCreateNestedOneWithoutNotificationsInput
kanbanTask?: Prisma.KanbanTaskCreateNestedOneWithoutNotificationsInput
user?: Prisma.UserCreateNestedOneWithoutNotificationsInput
readByMembers?: Prisma.TeamMemberCreateNestedOneWithoutLastReadNotificationInput
}
@@ -1037,6 +1117,7 @@ export type NotificationUncheckedCreateWithoutAssetInput = {
projectId?: string | null
creatorId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
readByMembers?: Prisma.TeamMemberUncheckedCreateNestedOneWithoutLastReadNotificationInput
}
@@ -1076,6 +1157,7 @@ export type NotificationCreateWithoutTaskInput = {
project?: Prisma.ProjectCreateNestedOneWithoutNotificationsInput
creator?: Prisma.UserCreateNestedOneWithoutCreatedNotificationsInput
asset?: Prisma.AssetCreateNestedOneWithoutNotificationsInput
kanbanTask?: Prisma.KanbanTaskCreateNestedOneWithoutNotificationsInput
user?: Prisma.UserCreateNestedOneWithoutNotificationsInput
readByMembers?: Prisma.TeamMemberCreateNestedOneWithoutLastReadNotificationInput
}
@@ -1089,6 +1171,7 @@ export type NotificationUncheckedCreateWithoutTaskInput = {
projectId?: string | null
creatorId?: string | null
assetId?: string | null
kanbanTaskId?: string | null
userId?: string | null
readByMembers?: Prisma.TeamMemberUncheckedCreateNestedOneWithoutLastReadNotificationInput
}
@@ -1119,6 +1202,60 @@ export type NotificationUpdateManyWithWhereWithoutTaskInput = {
data: Prisma.XOR<Prisma.NotificationUpdateManyMutationInput, Prisma.NotificationUncheckedUpdateManyWithoutTaskInput>
}
export type NotificationCreateWithoutKanbanTaskInput = {
id?: string
type?: $Enums.NotificationType | null
createdAt?: Date | string
updatedAt?: Date | string
team: Prisma.TeamCreateNestedOneWithoutNotificationsInput
project?: Prisma.ProjectCreateNestedOneWithoutNotificationsInput
creator?: Prisma.UserCreateNestedOneWithoutCreatedNotificationsInput
asset?: Prisma.AssetCreateNestedOneWithoutNotificationsInput
task?: Prisma.TaskCreateNestedOneWithoutNotificationsInput
user?: Prisma.UserCreateNestedOneWithoutNotificationsInput
readByMembers?: Prisma.TeamMemberCreateNestedOneWithoutLastReadNotificationInput
}
export type NotificationUncheckedCreateWithoutKanbanTaskInput = {
id?: string
type?: $Enums.NotificationType | null
createdAt?: Date | string
updatedAt?: Date | string
teamId: string
projectId?: string | null
creatorId?: string | null
assetId?: string | null
taskId?: string | null
userId?: string | null
readByMembers?: Prisma.TeamMemberUncheckedCreateNestedOneWithoutLastReadNotificationInput
}
export type NotificationCreateOrConnectWithoutKanbanTaskInput = {
where: Prisma.NotificationWhereUniqueInput
create: Prisma.XOR<Prisma.NotificationCreateWithoutKanbanTaskInput, Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput>
}
export type NotificationCreateManyKanbanTaskInputEnvelope = {
data: Prisma.NotificationCreateManyKanbanTaskInput | Prisma.NotificationCreateManyKanbanTaskInput[]
skipDuplicates?: boolean
}
export type NotificationUpsertWithWhereUniqueWithoutKanbanTaskInput = {
where: Prisma.NotificationWhereUniqueInput
update: Prisma.XOR<Prisma.NotificationUpdateWithoutKanbanTaskInput, Prisma.NotificationUncheckedUpdateWithoutKanbanTaskInput>
create: Prisma.XOR<Prisma.NotificationCreateWithoutKanbanTaskInput, Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput>
}
export type NotificationUpdateWithWhereUniqueWithoutKanbanTaskInput = {
where: Prisma.NotificationWhereUniqueInput
data: Prisma.XOR<Prisma.NotificationUpdateWithoutKanbanTaskInput, Prisma.NotificationUncheckedUpdateWithoutKanbanTaskInput>
}
export type NotificationUpdateManyWithWhereWithoutKanbanTaskInput = {
where: Prisma.NotificationScalarWhereInput
data: Prisma.XOR<Prisma.NotificationUpdateManyMutationInput, Prisma.NotificationUncheckedUpdateManyWithoutKanbanTaskInput>
}
export type NotificationCreateManyCreatorInput = {
id?: string
type?: $Enums.NotificationType | null
@@ -1128,6 +1265,7 @@ export type NotificationCreateManyCreatorInput = {
projectId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
}
@@ -1141,6 +1279,7 @@ export type NotificationCreateManyUserInput = {
creatorId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
}
export type NotificationUpdateWithoutCreatorInput = {
@@ -1152,6 +1291,7 @@ export type NotificationUpdateWithoutCreatorInput = {
project?: Prisma.ProjectUpdateOneWithoutNotificationsNestedInput
asset?: Prisma.AssetUpdateOneWithoutNotificationsNestedInput
task?: Prisma.TaskUpdateOneWithoutNotificationsNestedInput
kanbanTask?: Prisma.KanbanTaskUpdateOneWithoutNotificationsNestedInput
user?: Prisma.UserUpdateOneWithoutNotificationsNestedInput
readByMembers?: Prisma.TeamMemberUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1165,6 +1305,7 @@ export type NotificationUncheckedUpdateWithoutCreatorInput = {
projectId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
readByMembers?: Prisma.TeamMemberUncheckedUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1178,6 +1319,7 @@ export type NotificationUncheckedUpdateManyWithoutCreatorInput = {
projectId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
@@ -1191,6 +1333,7 @@ export type NotificationUpdateWithoutUserInput = {
creator?: Prisma.UserUpdateOneWithoutCreatedNotificationsNestedInput
asset?: Prisma.AssetUpdateOneWithoutNotificationsNestedInput
task?: Prisma.TaskUpdateOneWithoutNotificationsNestedInput
kanbanTask?: Prisma.KanbanTaskUpdateOneWithoutNotificationsNestedInput
readByMembers?: Prisma.TeamMemberUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1204,6 +1347,7 @@ export type NotificationUncheckedUpdateWithoutUserInput = {
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
readByMembers?: Prisma.TeamMemberUncheckedUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1217,6 +1361,7 @@ export type NotificationUncheckedUpdateManyWithoutUserInput = {
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
export type NotificationCreateManyTeamInput = {
@@ -1228,6 +1373,7 @@ export type NotificationCreateManyTeamInput = {
creatorId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
}
@@ -1240,6 +1386,7 @@ export type NotificationUpdateWithoutTeamInput = {
creator?: Prisma.UserUpdateOneWithoutCreatedNotificationsNestedInput
asset?: Prisma.AssetUpdateOneWithoutNotificationsNestedInput
task?: Prisma.TaskUpdateOneWithoutNotificationsNestedInput
kanbanTask?: Prisma.KanbanTaskUpdateOneWithoutNotificationsNestedInput
user?: Prisma.UserUpdateOneWithoutNotificationsNestedInput
readByMembers?: Prisma.TeamMemberUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1253,6 +1400,7 @@ export type NotificationUncheckedUpdateWithoutTeamInput = {
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
readByMembers?: Prisma.TeamMemberUncheckedUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1266,6 +1414,7 @@ export type NotificationUncheckedUpdateManyWithoutTeamInput = {
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
@@ -1278,6 +1427,7 @@ export type NotificationCreateManyProjectInput = {
creatorId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
}
@@ -1290,6 +1440,7 @@ export type NotificationUpdateWithoutProjectInput = {
creator?: Prisma.UserUpdateOneWithoutCreatedNotificationsNestedInput
asset?: Prisma.AssetUpdateOneWithoutNotificationsNestedInput
task?: Prisma.TaskUpdateOneWithoutNotificationsNestedInput
kanbanTask?: Prisma.KanbanTaskUpdateOneWithoutNotificationsNestedInput
user?: Prisma.UserUpdateOneWithoutNotificationsNestedInput
readByMembers?: Prisma.TeamMemberUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1303,6 +1454,7 @@ export type NotificationUncheckedUpdateWithoutProjectInput = {
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
readByMembers?: Prisma.TeamMemberUncheckedUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1316,6 +1468,7 @@ export type NotificationUncheckedUpdateManyWithoutProjectInput = {
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
@@ -1328,6 +1481,7 @@ export type NotificationCreateManyAssetInput = {
projectId?: string | null
creatorId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
}
@@ -1340,6 +1494,7 @@ export type NotificationUpdateWithoutAssetInput = {
project?: Prisma.ProjectUpdateOneWithoutNotificationsNestedInput
creator?: Prisma.UserUpdateOneWithoutCreatedNotificationsNestedInput
task?: Prisma.TaskUpdateOneWithoutNotificationsNestedInput
kanbanTask?: Prisma.KanbanTaskUpdateOneWithoutNotificationsNestedInput
user?: Prisma.UserUpdateOneWithoutNotificationsNestedInput
readByMembers?: Prisma.TeamMemberUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1353,6 +1508,7 @@ export type NotificationUncheckedUpdateWithoutAssetInput = {
projectId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
readByMembers?: Prisma.TeamMemberUncheckedUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1366,6 +1522,7 @@ export type NotificationUncheckedUpdateManyWithoutAssetInput = {
projectId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
@@ -1378,6 +1535,7 @@ export type NotificationCreateManyTaskInput = {
projectId?: string | null
creatorId?: string | null
assetId?: string | null
kanbanTaskId?: string | null
userId?: string | null
}
@@ -1390,6 +1548,7 @@ export type NotificationUpdateWithoutTaskInput = {
project?: Prisma.ProjectUpdateOneWithoutNotificationsNestedInput
creator?: Prisma.UserUpdateOneWithoutCreatedNotificationsNestedInput
asset?: Prisma.AssetUpdateOneWithoutNotificationsNestedInput
kanbanTask?: Prisma.KanbanTaskUpdateOneWithoutNotificationsNestedInput
user?: Prisma.UserUpdateOneWithoutNotificationsNestedInput
readByMembers?: Prisma.TeamMemberUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1403,6 +1562,7 @@ export type NotificationUncheckedUpdateWithoutTaskInput = {
projectId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
readByMembers?: Prisma.TeamMemberUncheckedUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1416,6 +1576,61 @@ export type NotificationUncheckedUpdateManyWithoutTaskInput = {
projectId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
export type NotificationCreateManyKanbanTaskInput = {
id?: string
type?: $Enums.NotificationType | null
createdAt?: Date | string
updatedAt?: Date | string
teamId: string
projectId?: string | null
creatorId?: string | null
assetId?: string | null
taskId?: string | null
userId?: string | null
}
export type NotificationUpdateWithoutKanbanTaskInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
type?: Prisma.NullableEnumNotificationTypeFieldUpdateOperationsInput | $Enums.NotificationType | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
team?: Prisma.TeamUpdateOneRequiredWithoutNotificationsNestedInput
project?: Prisma.ProjectUpdateOneWithoutNotificationsNestedInput
creator?: Prisma.UserUpdateOneWithoutCreatedNotificationsNestedInput
asset?: Prisma.AssetUpdateOneWithoutNotificationsNestedInput
task?: Prisma.TaskUpdateOneWithoutNotificationsNestedInput
user?: Prisma.UserUpdateOneWithoutNotificationsNestedInput
readByMembers?: Prisma.TeamMemberUpdateOneWithoutLastReadNotificationNestedInput
}
export type NotificationUncheckedUpdateWithoutKanbanTaskInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
type?: Prisma.NullableEnumNotificationTypeFieldUpdateOperationsInput | $Enums.NotificationType | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
teamId?: Prisma.StringFieldUpdateOperationsInput | string
projectId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
readByMembers?: Prisma.TeamMemberUncheckedUpdateOneWithoutLastReadNotificationNestedInput
}
export type NotificationUncheckedUpdateManyWithoutKanbanTaskInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
type?: Prisma.NullableEnumNotificationTypeFieldUpdateOperationsInput | $Enums.NotificationType | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
teamId?: Prisma.StringFieldUpdateOperationsInput | string
projectId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
@@ -1431,12 +1646,14 @@ export type NotificationSelect<ExtArgs extends runtime.Types.Extensions.Internal
creatorId?: boolean
assetId?: boolean
taskId?: boolean
kanbanTaskId?: boolean
userId?: boolean
team?: boolean | Prisma.TeamDefaultArgs<ExtArgs>
project?: boolean | Prisma.Notification$projectArgs<ExtArgs>
creator?: boolean | Prisma.Notification$creatorArgs<ExtArgs>
asset?: boolean | Prisma.Notification$assetArgs<ExtArgs>
task?: boolean | Prisma.Notification$taskArgs<ExtArgs>
kanbanTask?: boolean | Prisma.Notification$kanbanTaskArgs<ExtArgs>
user?: boolean | Prisma.Notification$userArgs<ExtArgs>
readByMembers?: boolean | Prisma.Notification$readByMembersArgs<ExtArgs>
}, ExtArgs["result"]["notification"]>
@@ -1451,12 +1668,14 @@ export type NotificationSelectCreateManyAndReturn<ExtArgs extends runtime.Types.
creatorId?: boolean
assetId?: boolean
taskId?: boolean
kanbanTaskId?: boolean
userId?: boolean
team?: boolean | Prisma.TeamDefaultArgs<ExtArgs>
project?: boolean | Prisma.Notification$projectArgs<ExtArgs>
creator?: boolean | Prisma.Notification$creatorArgs<ExtArgs>
asset?: boolean | Prisma.Notification$assetArgs<ExtArgs>
task?: boolean | Prisma.Notification$taskArgs<ExtArgs>
kanbanTask?: boolean | Prisma.Notification$kanbanTaskArgs<ExtArgs>
user?: boolean | Prisma.Notification$userArgs<ExtArgs>
}, ExtArgs["result"]["notification"]>
@@ -1470,12 +1689,14 @@ export type NotificationSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.
creatorId?: boolean
assetId?: boolean
taskId?: boolean
kanbanTaskId?: boolean
userId?: boolean
team?: boolean | Prisma.TeamDefaultArgs<ExtArgs>
project?: boolean | Prisma.Notification$projectArgs<ExtArgs>
creator?: boolean | Prisma.Notification$creatorArgs<ExtArgs>
asset?: boolean | Prisma.Notification$assetArgs<ExtArgs>
task?: boolean | Prisma.Notification$taskArgs<ExtArgs>
kanbanTask?: boolean | Prisma.Notification$kanbanTaskArgs<ExtArgs>
user?: boolean | Prisma.Notification$userArgs<ExtArgs>
}, ExtArgs["result"]["notification"]>
@@ -1489,16 +1710,18 @@ export type NotificationSelectScalar = {
creatorId?: boolean
assetId?: boolean
taskId?: boolean
kanbanTaskId?: boolean
userId?: boolean
}
export type NotificationOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "type" | "createdAt" | "updatedAt" | "teamId" | "projectId" | "creatorId" | "assetId" | "taskId" | "userId", ExtArgs["result"]["notification"]>
export type NotificationOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "type" | "createdAt" | "updatedAt" | "teamId" | "projectId" | "creatorId" | "assetId" | "taskId" | "kanbanTaskId" | "userId", ExtArgs["result"]["notification"]>
export type NotificationInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
team?: boolean | Prisma.TeamDefaultArgs<ExtArgs>
project?: boolean | Prisma.Notification$projectArgs<ExtArgs>
creator?: boolean | Prisma.Notification$creatorArgs<ExtArgs>
asset?: boolean | Prisma.Notification$assetArgs<ExtArgs>
task?: boolean | Prisma.Notification$taskArgs<ExtArgs>
kanbanTask?: boolean | Prisma.Notification$kanbanTaskArgs<ExtArgs>
user?: boolean | Prisma.Notification$userArgs<ExtArgs>
readByMembers?: boolean | Prisma.Notification$readByMembersArgs<ExtArgs>
}
@@ -1508,6 +1731,7 @@ export type NotificationIncludeCreateManyAndReturn<ExtArgs extends runtime.Types
creator?: boolean | Prisma.Notification$creatorArgs<ExtArgs>
asset?: boolean | Prisma.Notification$assetArgs<ExtArgs>
task?: boolean | Prisma.Notification$taskArgs<ExtArgs>
kanbanTask?: boolean | Prisma.Notification$kanbanTaskArgs<ExtArgs>
user?: boolean | Prisma.Notification$userArgs<ExtArgs>
}
export type NotificationIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
@@ -1516,6 +1740,7 @@ export type NotificationIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types
creator?: boolean | Prisma.Notification$creatorArgs<ExtArgs>
asset?: boolean | Prisma.Notification$assetArgs<ExtArgs>
task?: boolean | Prisma.Notification$taskArgs<ExtArgs>
kanbanTask?: boolean | Prisma.Notification$kanbanTaskArgs<ExtArgs>
user?: boolean | Prisma.Notification$userArgs<ExtArgs>
}
@@ -1527,6 +1752,7 @@ export type $NotificationPayload<ExtArgs extends runtime.Types.Extensions.Intern
creator: Prisma.$UserPayload<ExtArgs> | null
asset: Prisma.$AssetPayload<ExtArgs> | null
task: Prisma.$TaskPayload<ExtArgs> | null
kanbanTask: Prisma.$KanbanTaskPayload<ExtArgs> | null
user: Prisma.$UserPayload<ExtArgs> | null
readByMembers: Prisma.$TeamMemberPayload<ExtArgs> | null
}
@@ -1540,6 +1766,7 @@ export type $NotificationPayload<ExtArgs extends runtime.Types.Extensions.Intern
creatorId: string | null
assetId: string | null
taskId: string | null
kanbanTaskId: string | null
userId: string | null
}, ExtArgs["result"]["notification"]>
composites: {}
@@ -1940,6 +2167,7 @@ export interface Prisma__NotificationClient<T, Null = never, ExtArgs extends run
creator<T extends Prisma.Notification$creatorArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Notification$creatorArgs<ExtArgs>>): Prisma.Prisma__UserClient<runtime.Types.Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
asset<T extends Prisma.Notification$assetArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Notification$assetArgs<ExtArgs>>): Prisma.Prisma__AssetClient<runtime.Types.Result.GetResult<Prisma.$AssetPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
task<T extends Prisma.Notification$taskArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Notification$taskArgs<ExtArgs>>): Prisma.Prisma__TaskClient<runtime.Types.Result.GetResult<Prisma.$TaskPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
kanbanTask<T extends Prisma.Notification$kanbanTaskArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Notification$kanbanTaskArgs<ExtArgs>>): Prisma.Prisma__KanbanTaskClient<runtime.Types.Result.GetResult<Prisma.$KanbanTaskPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
user<T extends Prisma.Notification$userArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Notification$userArgs<ExtArgs>>): Prisma.Prisma__UserClient<runtime.Types.Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
readByMembers<T extends Prisma.Notification$readByMembersArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Notification$readByMembersArgs<ExtArgs>>): Prisma.Prisma__TeamMemberClient<runtime.Types.Result.GetResult<Prisma.$TeamMemberPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
/**
@@ -1980,6 +2208,7 @@ export interface NotificationFieldRefs {
readonly creatorId: Prisma.FieldRef<"Notification", 'String'>
readonly assetId: Prisma.FieldRef<"Notification", 'String'>
readonly taskId: Prisma.FieldRef<"Notification", 'String'>
readonly kanbanTaskId: Prisma.FieldRef<"Notification", 'String'>
readonly userId: Prisma.FieldRef<"Notification", 'String'>
}
@@ -2457,6 +2686,25 @@ export type Notification$taskArgs<ExtArgs extends runtime.Types.Extensions.Inter
where?: Prisma.TaskWhereInput
}
/**
* Notification.kanbanTask
*/
export type Notification$kanbanTaskArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the KanbanTask
*/
select?: Prisma.KanbanTaskSelect<ExtArgs> | null
/**
* Omit specific fields from the KanbanTask
*/
omit?: Prisma.KanbanTaskOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.KanbanTaskInclude<ExtArgs> | null
where?: Prisma.KanbanTaskWhereInput
}
/**
* Notification.user
*/
+414
View File
@@ -231,6 +231,8 @@ export type ProjectWhereInput = {
shareLinks?: Prisma.ShareLinkListRelationFilter
collections?: Prisma.CollectionListRelationFilter
auditLogs?: Prisma.AuditLogListRelationFilter
kanbanTasks?: Prisma.KanbanTaskListRelationFilter
recentFiles?: Prisma.RecentFileItemListRelationFilter
}
export type ProjectOrderByWithRelationInput = {
@@ -255,6 +257,8 @@ export type ProjectOrderByWithRelationInput = {
shareLinks?: Prisma.ShareLinkOrderByRelationAggregateInput
collections?: Prisma.CollectionOrderByRelationAggregateInput
auditLogs?: Prisma.AuditLogOrderByRelationAggregateInput
kanbanTasks?: Prisma.KanbanTaskOrderByRelationAggregateInput
recentFiles?: Prisma.RecentFileItemOrderByRelationAggregateInput
}
export type ProjectWhereUniqueInput = Prisma.AtLeast<{
@@ -282,6 +286,8 @@ export type ProjectWhereUniqueInput = Prisma.AtLeast<{
shareLinks?: Prisma.ShareLinkListRelationFilter
collections?: Prisma.CollectionListRelationFilter
auditLogs?: Prisma.AuditLogListRelationFilter
kanbanTasks?: Prisma.KanbanTaskListRelationFilter
recentFiles?: Prisma.RecentFileItemListRelationFilter
}, "id" | "rootFolderId" | "shareRootId">
export type ProjectOrderByWithAggregationInput = {
@@ -335,6 +341,8 @@ export type ProjectCreateInput = {
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateInput = {
@@ -356,6 +364,8 @@ export type ProjectUncheckedCreateInput = {
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectUpdateInput = {
@@ -377,6 +387,8 @@ export type ProjectUpdateInput = {
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateInput = {
@@ -398,6 +410,8 @@ export type ProjectUncheckedUpdateInput = {
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateManyInput = {
@@ -721,6 +735,36 @@ export type ProjectUpdateOneWithoutAuditLogsNestedInput = {
update?: Prisma.XOR<Prisma.XOR<Prisma.ProjectUpdateToOneWithWhereWithoutAuditLogsInput, Prisma.ProjectUpdateWithoutAuditLogsInput>, Prisma.ProjectUncheckedUpdateWithoutAuditLogsInput>
}
export type ProjectCreateNestedOneWithoutKanbanTasksInput = {
create?: Prisma.XOR<Prisma.ProjectCreateWithoutKanbanTasksInput, Prisma.ProjectUncheckedCreateWithoutKanbanTasksInput>
connectOrCreate?: Prisma.ProjectCreateOrConnectWithoutKanbanTasksInput
connect?: Prisma.ProjectWhereUniqueInput
}
export type ProjectUpdateOneWithoutKanbanTasksNestedInput = {
create?: Prisma.XOR<Prisma.ProjectCreateWithoutKanbanTasksInput, Prisma.ProjectUncheckedCreateWithoutKanbanTasksInput>
connectOrCreate?: Prisma.ProjectCreateOrConnectWithoutKanbanTasksInput
upsert?: Prisma.ProjectUpsertWithoutKanbanTasksInput
disconnect?: Prisma.ProjectWhereInput | boolean
delete?: Prisma.ProjectWhereInput | boolean
connect?: Prisma.ProjectWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.ProjectUpdateToOneWithWhereWithoutKanbanTasksInput, Prisma.ProjectUpdateWithoutKanbanTasksInput>, Prisma.ProjectUncheckedUpdateWithoutKanbanTasksInput>
}
export type ProjectCreateNestedOneWithoutRecentFilesInput = {
create?: Prisma.XOR<Prisma.ProjectCreateWithoutRecentFilesInput, Prisma.ProjectUncheckedCreateWithoutRecentFilesInput>
connectOrCreate?: Prisma.ProjectCreateOrConnectWithoutRecentFilesInput
connect?: Prisma.ProjectWhereUniqueInput
}
export type ProjectUpdateOneRequiredWithoutRecentFilesNestedInput = {
create?: Prisma.XOR<Prisma.ProjectCreateWithoutRecentFilesInput, Prisma.ProjectUncheckedCreateWithoutRecentFilesInput>
connectOrCreate?: Prisma.ProjectCreateOrConnectWithoutRecentFilesInput
upsert?: Prisma.ProjectUpsertWithoutRecentFilesInput
connect?: Prisma.ProjectWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.ProjectUpdateToOneWithWhereWithoutRecentFilesInput, Prisma.ProjectUpdateWithoutRecentFilesInput>, Prisma.ProjectUncheckedUpdateWithoutRecentFilesInput>
}
export type ProjectCreateWithoutTeamInput = {
id?: string
name: string
@@ -739,6 +783,8 @@ export type ProjectCreateWithoutTeamInput = {
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutTeamInput = {
@@ -759,6 +805,8 @@ export type ProjectUncheckedCreateWithoutTeamInput = {
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutTeamInput = {
@@ -821,6 +869,8 @@ export type ProjectCreateWithoutMembersInput = {
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutMembersInput = {
@@ -841,6 +891,8 @@ export type ProjectUncheckedCreateWithoutMembersInput = {
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutMembersInput = {
@@ -877,6 +929,8 @@ export type ProjectUpdateWithoutMembersInput = {
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutMembersInput = {
@@ -897,6 +951,8 @@ export type ProjectUncheckedUpdateWithoutMembersInput = {
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateWithoutShareLinksInput = {
@@ -917,6 +973,8 @@ export type ProjectCreateWithoutShareLinksInput = {
notifications?: Prisma.NotificationCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutShareLinksInput = {
@@ -937,6 +995,8 @@ export type ProjectUncheckedCreateWithoutShareLinksInput = {
notifications?: Prisma.NotificationUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutShareLinksInput = {
@@ -973,6 +1033,8 @@ export type ProjectUpdateWithoutShareLinksInput = {
notifications?: Prisma.NotificationUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutShareLinksInput = {
@@ -993,6 +1055,8 @@ export type ProjectUncheckedUpdateWithoutShareLinksInput = {
notifications?: Prisma.NotificationUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateWithoutAssetsInput = {
@@ -1013,6 +1077,8 @@ export type ProjectCreateWithoutAssetsInput = {
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutAssetsInput = {
@@ -1033,6 +1099,8 @@ export type ProjectUncheckedCreateWithoutAssetsInput = {
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutAssetsInput = {
@@ -1058,6 +1126,8 @@ export type ProjectCreateWithoutRootFolderInput = {
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutRootFolderInput = {
@@ -1078,6 +1148,8 @@ export type ProjectUncheckedCreateWithoutRootFolderInput = {
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutRootFolderInput = {
@@ -1103,6 +1175,8 @@ export type ProjectCreateWithoutShareRootInput = {
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutShareRootInput = {
@@ -1123,6 +1197,8 @@ export type ProjectUncheckedCreateWithoutShareRootInput = {
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutShareRootInput = {
@@ -1159,6 +1235,8 @@ export type ProjectUpdateWithoutAssetsInput = {
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutAssetsInput = {
@@ -1179,6 +1257,8 @@ export type ProjectUncheckedUpdateWithoutAssetsInput = {
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectUpsertWithoutRootFolderInput = {
@@ -1210,6 +1290,8 @@ export type ProjectUpdateWithoutRootFolderInput = {
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutRootFolderInput = {
@@ -1230,6 +1312,8 @@ export type ProjectUncheckedUpdateWithoutRootFolderInput = {
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectUpsertWithoutShareRootInput = {
@@ -1261,6 +1345,8 @@ export type ProjectUpdateWithoutShareRootInput = {
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutShareRootInput = {
@@ -1281,6 +1367,8 @@ export type ProjectUncheckedUpdateWithoutShareRootInput = {
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateWithoutInvitesInput = {
@@ -1301,6 +1389,8 @@ export type ProjectCreateWithoutInvitesInput = {
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutInvitesInput = {
@@ -1321,6 +1411,8 @@ export type ProjectUncheckedCreateWithoutInvitesInput = {
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutInvitesInput = {
@@ -1357,6 +1449,8 @@ export type ProjectUpdateWithoutInvitesInput = {
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutInvitesInput = {
@@ -1377,6 +1471,8 @@ export type ProjectUncheckedUpdateWithoutInvitesInput = {
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateWithoutMetadataFieldsInput = {
@@ -1397,6 +1493,8 @@ export type ProjectCreateWithoutMetadataFieldsInput = {
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutMetadataFieldsInput = {
@@ -1417,6 +1515,8 @@ export type ProjectUncheckedCreateWithoutMetadataFieldsInput = {
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutMetadataFieldsInput = {
@@ -1453,6 +1553,8 @@ export type ProjectUpdateWithoutMetadataFieldsInput = {
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutMetadataFieldsInput = {
@@ -1473,6 +1575,8 @@ export type ProjectUncheckedUpdateWithoutMetadataFieldsInput = {
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateWithoutNotificationsInput = {
@@ -1493,6 +1597,8 @@ export type ProjectCreateWithoutNotificationsInput = {
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutNotificationsInput = {
@@ -1513,6 +1619,8 @@ export type ProjectUncheckedCreateWithoutNotificationsInput = {
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutNotificationsInput = {
@@ -1549,6 +1657,8 @@ export type ProjectUpdateWithoutNotificationsInput = {
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutNotificationsInput = {
@@ -1569,6 +1679,8 @@ export type ProjectUncheckedUpdateWithoutNotificationsInput = {
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateWithoutCollectionsInput = {
@@ -1589,6 +1701,8 @@ export type ProjectCreateWithoutCollectionsInput = {
notifications?: Prisma.NotificationCreateNestedManyWithoutProjectInput
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutCollectionsInput = {
@@ -1609,6 +1723,8 @@ export type ProjectUncheckedCreateWithoutCollectionsInput = {
notifications?: Prisma.NotificationUncheckedCreateNestedManyWithoutProjectInput
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutCollectionsInput = {
@@ -1645,6 +1761,8 @@ export type ProjectUpdateWithoutCollectionsInput = {
notifications?: Prisma.NotificationUpdateManyWithoutProjectNestedInput
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutCollectionsInput = {
@@ -1665,6 +1783,8 @@ export type ProjectUncheckedUpdateWithoutCollectionsInput = {
notifications?: Prisma.NotificationUncheckedUpdateManyWithoutProjectNestedInput
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateWithoutAuditLogsInput = {
@@ -1685,6 +1805,8 @@ export type ProjectCreateWithoutAuditLogsInput = {
notifications?: Prisma.NotificationCreateNestedManyWithoutProjectInput
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutAuditLogsInput = {
@@ -1705,6 +1827,8 @@ export type ProjectUncheckedCreateWithoutAuditLogsInput = {
notifications?: Prisma.NotificationUncheckedCreateNestedManyWithoutProjectInput
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutAuditLogsInput = {
@@ -1741,6 +1865,8 @@ export type ProjectUpdateWithoutAuditLogsInput = {
notifications?: Prisma.NotificationUpdateManyWithoutProjectNestedInput
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutAuditLogsInput = {
@@ -1761,6 +1887,216 @@ export type ProjectUncheckedUpdateWithoutAuditLogsInput = {
notifications?: Prisma.NotificationUncheckedUpdateManyWithoutProjectNestedInput
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateWithoutKanbanTasksInput = {
id?: string
name: string
coverImageKey?: string | null
metadataOverrides?:PrismaJson.MetadataOverrides | Prisma.NullableJsonNullValueInput
enableNotification?: boolean
createdAt?: Date | string
updatedAt?: Date | string
team: Prisma.TeamCreateNestedOneWithoutProjectsInput
rootFolder?: Prisma.AssetCreateNestedOneWithoutProjectRootFolderInput
shareRoot?: Prisma.AssetCreateNestedOneWithoutProjectShareRootInput
members?: Prisma.ProjectMemberCreateNestedManyWithoutProjectInput
assets?: Prisma.AssetCreateNestedManyWithoutProjectInput
metadataFields?: Prisma.MetadataFieldCreateNestedManyWithoutProjectInput
invites?: Prisma.InviteCreateNestedManyWithoutProjectInput
notifications?: Prisma.NotificationCreateNestedManyWithoutProjectInput
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutKanbanTasksInput = {
id?: string
name: string
coverImageKey?: string | null
metadataOverrides?:PrismaJson.MetadataOverrides | Prisma.NullableJsonNullValueInput
enableNotification?: boolean
createdAt?: Date | string
updatedAt?: Date | string
teamId: string
rootFolderId?: string | null
shareRootId?: string | null
members?: Prisma.ProjectMemberUncheckedCreateNestedManyWithoutProjectInput
assets?: Prisma.AssetUncheckedCreateNestedManyWithoutProjectInput
metadataFields?: Prisma.MetadataFieldUncheckedCreateNestedManyWithoutProjectInput
invites?: Prisma.InviteUncheckedCreateNestedManyWithoutProjectInput
notifications?: Prisma.NotificationUncheckedCreateNestedManyWithoutProjectInput
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
recentFiles?: Prisma.RecentFileItemUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutKanbanTasksInput = {
where: Prisma.ProjectWhereUniqueInput
create: Prisma.XOR<Prisma.ProjectCreateWithoutKanbanTasksInput, Prisma.ProjectUncheckedCreateWithoutKanbanTasksInput>
}
export type ProjectUpsertWithoutKanbanTasksInput = {
update: Prisma.XOR<Prisma.ProjectUpdateWithoutKanbanTasksInput, Prisma.ProjectUncheckedUpdateWithoutKanbanTasksInput>
create: Prisma.XOR<Prisma.ProjectCreateWithoutKanbanTasksInput, Prisma.ProjectUncheckedCreateWithoutKanbanTasksInput>
where?: Prisma.ProjectWhereInput
}
export type ProjectUpdateToOneWithWhereWithoutKanbanTasksInput = {
where?: Prisma.ProjectWhereInput
data: Prisma.XOR<Prisma.ProjectUpdateWithoutKanbanTasksInput, Prisma.ProjectUncheckedUpdateWithoutKanbanTasksInput>
}
export type ProjectUpdateWithoutKanbanTasksInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string
coverImageKey?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
metadataOverrides?:PrismaJson.MetadataOverrides | Prisma.NullableJsonNullValueInput
enableNotification?: Prisma.BoolFieldUpdateOperationsInput | boolean
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
team?: Prisma.TeamUpdateOneRequiredWithoutProjectsNestedInput
rootFolder?: Prisma.AssetUpdateOneWithoutProjectRootFolderNestedInput
shareRoot?: Prisma.AssetUpdateOneWithoutProjectShareRootNestedInput
members?: Prisma.ProjectMemberUpdateManyWithoutProjectNestedInput
assets?: Prisma.AssetUpdateManyWithoutProjectNestedInput
metadataFields?: Prisma.MetadataFieldUpdateManyWithoutProjectNestedInput
invites?: Prisma.InviteUpdateManyWithoutProjectNestedInput
notifications?: Prisma.NotificationUpdateManyWithoutProjectNestedInput
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutKanbanTasksInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string
coverImageKey?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
metadataOverrides?:PrismaJson.MetadataOverrides | Prisma.NullableJsonNullValueInput
enableNotification?: Prisma.BoolFieldUpdateOperationsInput | boolean
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
teamId?: Prisma.StringFieldUpdateOperationsInput | string
rootFolderId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
shareRootId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
members?: Prisma.ProjectMemberUncheckedUpdateManyWithoutProjectNestedInput
assets?: Prisma.AssetUncheckedUpdateManyWithoutProjectNestedInput
metadataFields?: Prisma.MetadataFieldUncheckedUpdateManyWithoutProjectNestedInput
invites?: Prisma.InviteUncheckedUpdateManyWithoutProjectNestedInput
notifications?: Prisma.NotificationUncheckedUpdateManyWithoutProjectNestedInput
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateWithoutRecentFilesInput = {
id?: string
name: string
coverImageKey?: string | null
metadataOverrides?:PrismaJson.MetadataOverrides | Prisma.NullableJsonNullValueInput
enableNotification?: boolean
createdAt?: Date | string
updatedAt?: Date | string
team: Prisma.TeamCreateNestedOneWithoutProjectsInput
rootFolder?: Prisma.AssetCreateNestedOneWithoutProjectRootFolderInput
shareRoot?: Prisma.AssetCreateNestedOneWithoutProjectShareRootInput
members?: Prisma.ProjectMemberCreateNestedManyWithoutProjectInput
assets?: Prisma.AssetCreateNestedManyWithoutProjectInput
metadataFields?: Prisma.MetadataFieldCreateNestedManyWithoutProjectInput
invites?: Prisma.InviteCreateNestedManyWithoutProjectInput
notifications?: Prisma.NotificationCreateNestedManyWithoutProjectInput
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutRecentFilesInput = {
id?: string
name: string
coverImageKey?: string | null
metadataOverrides?:PrismaJson.MetadataOverrides | Prisma.NullableJsonNullValueInput
enableNotification?: boolean
createdAt?: Date | string
updatedAt?: Date | string
teamId: string
rootFolderId?: string | null
shareRootId?: string | null
members?: Prisma.ProjectMemberUncheckedCreateNestedManyWithoutProjectInput
assets?: Prisma.AssetUncheckedCreateNestedManyWithoutProjectInput
metadataFields?: Prisma.MetadataFieldUncheckedCreateNestedManyWithoutProjectInput
invites?: Prisma.InviteUncheckedCreateNestedManyWithoutProjectInput
notifications?: Prisma.NotificationUncheckedCreateNestedManyWithoutProjectInput
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutRecentFilesInput = {
where: Prisma.ProjectWhereUniqueInput
create: Prisma.XOR<Prisma.ProjectCreateWithoutRecentFilesInput, Prisma.ProjectUncheckedCreateWithoutRecentFilesInput>
}
export type ProjectUpsertWithoutRecentFilesInput = {
update: Prisma.XOR<Prisma.ProjectUpdateWithoutRecentFilesInput, Prisma.ProjectUncheckedUpdateWithoutRecentFilesInput>
create: Prisma.XOR<Prisma.ProjectCreateWithoutRecentFilesInput, Prisma.ProjectUncheckedCreateWithoutRecentFilesInput>
where?: Prisma.ProjectWhereInput
}
export type ProjectUpdateToOneWithWhereWithoutRecentFilesInput = {
where?: Prisma.ProjectWhereInput
data: Prisma.XOR<Prisma.ProjectUpdateWithoutRecentFilesInput, Prisma.ProjectUncheckedUpdateWithoutRecentFilesInput>
}
export type ProjectUpdateWithoutRecentFilesInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string
coverImageKey?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
metadataOverrides?:PrismaJson.MetadataOverrides | Prisma.NullableJsonNullValueInput
enableNotification?: Prisma.BoolFieldUpdateOperationsInput | boolean
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
team?: Prisma.TeamUpdateOneRequiredWithoutProjectsNestedInput
rootFolder?: Prisma.AssetUpdateOneWithoutProjectRootFolderNestedInput
shareRoot?: Prisma.AssetUpdateOneWithoutProjectShareRootNestedInput
members?: Prisma.ProjectMemberUpdateManyWithoutProjectNestedInput
assets?: Prisma.AssetUpdateManyWithoutProjectNestedInput
metadataFields?: Prisma.MetadataFieldUpdateManyWithoutProjectNestedInput
invites?: Prisma.InviteUpdateManyWithoutProjectNestedInput
notifications?: Prisma.NotificationUpdateManyWithoutProjectNestedInput
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutRecentFilesInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string
coverImageKey?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
metadataOverrides?:PrismaJson.MetadataOverrides | Prisma.NullableJsonNullValueInput
enableNotification?: Prisma.BoolFieldUpdateOperationsInput | boolean
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
teamId?: Prisma.StringFieldUpdateOperationsInput | string
rootFolderId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
shareRootId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
members?: Prisma.ProjectMemberUncheckedUpdateManyWithoutProjectNestedInput
assets?: Prisma.AssetUncheckedUpdateManyWithoutProjectNestedInput
metadataFields?: Prisma.MetadataFieldUncheckedUpdateManyWithoutProjectNestedInput
invites?: Prisma.InviteUncheckedUpdateManyWithoutProjectNestedInput
notifications?: Prisma.NotificationUncheckedUpdateManyWithoutProjectNestedInput
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateManyTeamInput = {
@@ -1793,6 +2129,8 @@ export type ProjectUpdateWithoutTeamInput = {
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutTeamInput = {
@@ -1813,6 +2151,8 @@ export type ProjectUncheckedUpdateWithoutTeamInput = {
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
recentFiles?: Prisma.RecentFileItemUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateManyWithoutTeamInput = {
@@ -1841,6 +2181,8 @@ export type ProjectCountOutputType = {
shareLinks: number
collections: number
auditLogs: number
kanbanTasks: number
recentFiles: number
}
export type ProjectCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
@@ -1852,6 +2194,8 @@ export type ProjectCountOutputTypeSelect<ExtArgs extends runtime.Types.Extension
shareLinks?: boolean | ProjectCountOutputTypeCountShareLinksArgs
collections?: boolean | ProjectCountOutputTypeCountCollectionsArgs
auditLogs?: boolean | ProjectCountOutputTypeCountAuditLogsArgs
kanbanTasks?: boolean | ProjectCountOutputTypeCountKanbanTasksArgs
recentFiles?: boolean | ProjectCountOutputTypeCountRecentFilesArgs
}
/**
@@ -1920,6 +2264,20 @@ export type ProjectCountOutputTypeCountAuditLogsArgs<ExtArgs extends runtime.Typ
where?: Prisma.AuditLogWhereInput
}
/**
* ProjectCountOutputType without action
*/
export type ProjectCountOutputTypeCountKanbanTasksArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.KanbanTaskWhereInput
}
/**
* ProjectCountOutputType without action
*/
export type ProjectCountOutputTypeCountRecentFilesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.RecentFileItemWhereInput
}
export type ProjectSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean
@@ -1943,6 +2301,8 @@ export type ProjectSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs
shareLinks?: boolean | Prisma.Project$shareLinksArgs<ExtArgs>
collections?: boolean | Prisma.Project$collectionsArgs<ExtArgs>
auditLogs?: boolean | Prisma.Project$auditLogsArgs<ExtArgs>
kanbanTasks?: boolean | Prisma.Project$kanbanTasksArgs<ExtArgs>
recentFiles?: boolean | Prisma.Project$recentFilesArgs<ExtArgs>
_count?: boolean | Prisma.ProjectCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["project"]>
@@ -2004,6 +2364,8 @@ export type ProjectInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs
shareLinks?: boolean | Prisma.Project$shareLinksArgs<ExtArgs>
collections?: boolean | Prisma.Project$collectionsArgs<ExtArgs>
auditLogs?: boolean | Prisma.Project$auditLogsArgs<ExtArgs>
kanbanTasks?: boolean | Prisma.Project$kanbanTasksArgs<ExtArgs>
recentFiles?: boolean | Prisma.Project$recentFilesArgs<ExtArgs>
_count?: boolean | Prisma.ProjectCountOutputTypeDefaultArgs<ExtArgs>
}
export type ProjectIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
@@ -2031,6 +2393,8 @@ export type $ProjectPayload<ExtArgs extends runtime.Types.Extensions.InternalArg
shareLinks: Prisma.$ShareLinkPayload<ExtArgs>[]
collections: Prisma.$CollectionPayload<ExtArgs>[]
auditLogs: Prisma.$AuditLogPayload<ExtArgs>[]
kanbanTasks: Prisma.$KanbanTaskPayload<ExtArgs>[]
recentFiles: Prisma.$RecentFileItemPayload<ExtArgs>[]
}
scalars: runtime.Types.Extensions.GetPayloadResult<{
id: string
@@ -2451,6 +2815,8 @@ export interface Prisma__ProjectClient<T, Null = never, ExtArgs extends runtime.
shareLinks<T extends Prisma.Project$shareLinksArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Project$shareLinksArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ShareLinkPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
collections<T extends Prisma.Project$collectionsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Project$collectionsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$CollectionPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
auditLogs<T extends Prisma.Project$auditLogsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Project$auditLogsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AuditLogPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
kanbanTasks<T extends Prisma.Project$kanbanTasksArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Project$kanbanTasksArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$KanbanTaskPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
recentFiles<T extends Prisma.Project$recentFilesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Project$recentFilesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$RecentFileItemPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
@@ -3120,6 +3486,54 @@ export type Project$auditLogsArgs<ExtArgs extends runtime.Types.Extensions.Inter
distinct?: Prisma.AuditLogScalarFieldEnum | Prisma.AuditLogScalarFieldEnum[]
}
/**
* Project.kanbanTasks
*/
export type Project$kanbanTasksArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the KanbanTask
*/
select?: Prisma.KanbanTaskSelect<ExtArgs> | null
/**
* Omit specific fields from the KanbanTask
*/
omit?: Prisma.KanbanTaskOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.KanbanTaskInclude<ExtArgs> | null
where?: Prisma.KanbanTaskWhereInput
orderBy?: Prisma.KanbanTaskOrderByWithRelationInput | Prisma.KanbanTaskOrderByWithRelationInput[]
cursor?: Prisma.KanbanTaskWhereUniqueInput
take?: number
skip?: number
distinct?: Prisma.KanbanTaskScalarFieldEnum | Prisma.KanbanTaskScalarFieldEnum[]
}
/**
* Project.recentFiles
*/
export type Project$recentFilesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the RecentFileItem
*/
select?: Prisma.RecentFileItemSelect<ExtArgs> | null
/**
* Omit specific fields from the RecentFileItem
*/
omit?: Prisma.RecentFileItemOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.RecentFileItemInclude<ExtArgs> | null
where?: Prisma.RecentFileItemWhereInput
orderBy?: Prisma.RecentFileItemOrderByWithRelationInput | Prisma.RecentFileItemOrderByWithRelationInput[]
cursor?: Prisma.RecentFileItemWhereUniqueInput
take?: number
skip?: number
distinct?: Prisma.RecentFileItemScalarFieldEnum | Prisma.RecentFileItemScalarFieldEnum[]
}
/**
* Project without action
*/
File diff suppressed because it is too large Load Diff
+492
View File
@@ -205,6 +205,8 @@ export type TeamWhereInput = {
watermarkTemplates?: Prisma.WatermarkTemplateListRelationFilter
quotaRules?: Prisma.QuotaRuleListRelationFilter
quotaRecords?: Prisma.QuotaRecordListRelationFilter
kanbanGoals?: Prisma.KanbanGoalListRelationFilter
kanbanTasks?: Prisma.KanbanTaskListRelationFilter
}
export type TeamOrderByWithRelationInput = {
@@ -231,6 +233,8 @@ export type TeamOrderByWithRelationInput = {
watermarkTemplates?: Prisma.WatermarkTemplateOrderByRelationAggregateInput
quotaRules?: Prisma.QuotaRuleOrderByRelationAggregateInput
quotaRecords?: Prisma.QuotaRecordOrderByRelationAggregateInput
kanbanGoals?: Prisma.KanbanGoalOrderByRelationAggregateInput
kanbanTasks?: Prisma.KanbanTaskOrderByRelationAggregateInput
}
export type TeamWhereUniqueInput = Prisma.AtLeast<{
@@ -260,6 +264,8 @@ export type TeamWhereUniqueInput = Prisma.AtLeast<{
watermarkTemplates?: Prisma.WatermarkTemplateListRelationFilter
quotaRules?: Prisma.QuotaRuleListRelationFilter
quotaRecords?: Prisma.QuotaRecordListRelationFilter
kanbanGoals?: Prisma.KanbanGoalListRelationFilter
kanbanTasks?: Prisma.KanbanTaskListRelationFilter
}, "id" | "rootFolderId">
export type TeamOrderByWithAggregationInput = {
@@ -309,6 +315,8 @@ export type TeamCreateInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateInput = {
@@ -334,6 +342,8 @@ export type TeamUncheckedCreateInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamUpdateInput = {
@@ -359,6 +369,8 @@ export type TeamUpdateInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateInput = {
@@ -384,6 +396,8 @@ export type TeamUncheckedUpdateInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateManyInput = {
@@ -707,6 +721,34 @@ export type TeamUpdateOneRequiredWithoutQuotaRecordsNestedInput = {
update?: Prisma.XOR<Prisma.XOR<Prisma.TeamUpdateToOneWithWhereWithoutQuotaRecordsInput, Prisma.TeamUpdateWithoutQuotaRecordsInput>, Prisma.TeamUncheckedUpdateWithoutQuotaRecordsInput>
}
export type TeamCreateNestedOneWithoutKanbanGoalsInput = {
create?: Prisma.XOR<Prisma.TeamCreateWithoutKanbanGoalsInput, Prisma.TeamUncheckedCreateWithoutKanbanGoalsInput>
connectOrCreate?: Prisma.TeamCreateOrConnectWithoutKanbanGoalsInput
connect?: Prisma.TeamWhereUniqueInput
}
export type TeamUpdateOneRequiredWithoutKanbanGoalsNestedInput = {
create?: Prisma.XOR<Prisma.TeamCreateWithoutKanbanGoalsInput, Prisma.TeamUncheckedCreateWithoutKanbanGoalsInput>
connectOrCreate?: Prisma.TeamCreateOrConnectWithoutKanbanGoalsInput
upsert?: Prisma.TeamUpsertWithoutKanbanGoalsInput
connect?: Prisma.TeamWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.TeamUpdateToOneWithWhereWithoutKanbanGoalsInput, Prisma.TeamUpdateWithoutKanbanGoalsInput>, Prisma.TeamUncheckedUpdateWithoutKanbanGoalsInput>
}
export type TeamCreateNestedOneWithoutKanbanTasksInput = {
create?: Prisma.XOR<Prisma.TeamCreateWithoutKanbanTasksInput, Prisma.TeamUncheckedCreateWithoutKanbanTasksInput>
connectOrCreate?: Prisma.TeamCreateOrConnectWithoutKanbanTasksInput
connect?: Prisma.TeamWhereUniqueInput
}
export type TeamUpdateOneRequiredWithoutKanbanTasksNestedInput = {
create?: Prisma.XOR<Prisma.TeamCreateWithoutKanbanTasksInput, Prisma.TeamUncheckedCreateWithoutKanbanTasksInput>
connectOrCreate?: Prisma.TeamCreateOrConnectWithoutKanbanTasksInput
upsert?: Prisma.TeamUpsertWithoutKanbanTasksInput
connect?: Prisma.TeamWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.TeamUpdateToOneWithWhereWithoutKanbanTasksInput, Prisma.TeamUpdateWithoutKanbanTasksInput>, Prisma.TeamUncheckedUpdateWithoutKanbanTasksInput>
}
export type TeamCreateWithoutSandboxInput = {
id?: string
name: string
@@ -729,6 +771,8 @@ export type TeamCreateWithoutSandboxInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutSandboxInput = {
@@ -753,6 +797,8 @@ export type TeamUncheckedCreateWithoutSandboxInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutSandboxInput = {
@@ -793,6 +839,8 @@ export type TeamUpdateWithoutSandboxInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutSandboxInput = {
@@ -817,6 +865,8 @@ export type TeamUncheckedUpdateWithoutSandboxInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutSkillsInput = {
@@ -841,6 +891,8 @@ export type TeamCreateWithoutSkillsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutSkillsInput = {
@@ -865,6 +917,8 @@ export type TeamUncheckedCreateWithoutSkillsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutSkillsInput = {
@@ -905,6 +959,8 @@ export type TeamUpdateWithoutSkillsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutSkillsInput = {
@@ -929,6 +985,8 @@ export type TeamUncheckedUpdateWithoutSkillsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutMembersInput = {
@@ -953,6 +1011,8 @@ export type TeamCreateWithoutMembersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutMembersInput = {
@@ -977,6 +1037,8 @@ export type TeamUncheckedCreateWithoutMembersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutMembersInput = {
@@ -1017,6 +1079,8 @@ export type TeamUpdateWithoutMembersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutMembersInput = {
@@ -1041,6 +1105,8 @@ export type TeamUncheckedUpdateWithoutMembersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutProjectsInput = {
@@ -1065,6 +1131,8 @@ export type TeamCreateWithoutProjectsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutProjectsInput = {
@@ -1089,6 +1157,8 @@ export type TeamUncheckedCreateWithoutProjectsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutProjectsInput = {
@@ -1129,6 +1199,8 @@ export type TeamUpdateWithoutProjectsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutProjectsInput = {
@@ -1153,6 +1225,8 @@ export type TeamUncheckedUpdateWithoutProjectsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutWatermarkTemplatesInput = {
@@ -1177,6 +1251,8 @@ export type TeamCreateWithoutWatermarkTemplatesInput = {
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutWatermarkTemplatesInput = {
@@ -1201,6 +1277,8 @@ export type TeamUncheckedCreateWithoutWatermarkTemplatesInput = {
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutWatermarkTemplatesInput = {
@@ -1241,6 +1319,8 @@ export type TeamUpdateWithoutWatermarkTemplatesInput = {
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutWatermarkTemplatesInput = {
@@ -1265,6 +1345,8 @@ export type TeamUncheckedUpdateWithoutWatermarkTemplatesInput = {
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutRootFolderInput = {
@@ -1289,6 +1371,8 @@ export type TeamCreateWithoutRootFolderInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutRootFolderInput = {
@@ -1313,6 +1397,8 @@ export type TeamUncheckedCreateWithoutRootFolderInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutRootFolderInput = {
@@ -1353,6 +1439,8 @@ export type TeamUpdateWithoutRootFolderInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutRootFolderInput = {
@@ -1377,6 +1465,8 @@ export type TeamUncheckedUpdateWithoutRootFolderInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutInvitesInput = {
@@ -1401,6 +1491,8 @@ export type TeamCreateWithoutInvitesInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutInvitesInput = {
@@ -1425,6 +1517,8 @@ export type TeamUncheckedCreateWithoutInvitesInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutInvitesInput = {
@@ -1465,6 +1559,8 @@ export type TeamUpdateWithoutInvitesInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutInvitesInput = {
@@ -1489,6 +1585,8 @@ export type TeamUncheckedUpdateWithoutInvitesInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutMetadataFieldsInput = {
@@ -1513,6 +1611,8 @@ export type TeamCreateWithoutMetadataFieldsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutMetadataFieldsInput = {
@@ -1537,6 +1637,8 @@ export type TeamUncheckedCreateWithoutMetadataFieldsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutMetadataFieldsInput = {
@@ -1577,6 +1679,8 @@ export type TeamUpdateWithoutMetadataFieldsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutMetadataFieldsInput = {
@@ -1601,6 +1705,8 @@ export type TeamUncheckedUpdateWithoutMetadataFieldsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutNotificationsInput = {
@@ -1625,6 +1731,8 @@ export type TeamCreateWithoutNotificationsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutNotificationsInput = {
@@ -1649,6 +1757,8 @@ export type TeamUncheckedCreateWithoutNotificationsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutNotificationsInput = {
@@ -1689,6 +1799,8 @@ export type TeamUpdateWithoutNotificationsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutNotificationsInput = {
@@ -1713,6 +1825,8 @@ export type TeamUncheckedUpdateWithoutNotificationsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutAgentsInput = {
@@ -1737,6 +1851,8 @@ export type TeamCreateWithoutAgentsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutAgentsInput = {
@@ -1761,6 +1877,8 @@ export type TeamUncheckedCreateWithoutAgentsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutAgentsInput = {
@@ -1801,6 +1919,8 @@ export type TeamUpdateWithoutAgentsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutAgentsInput = {
@@ -1825,6 +1945,8 @@ export type TeamUncheckedUpdateWithoutAgentsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutMcpServersInput = {
@@ -1849,6 +1971,8 @@ export type TeamCreateWithoutMcpServersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutMcpServersInput = {
@@ -1873,6 +1997,8 @@ export type TeamUncheckedCreateWithoutMcpServersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutMcpServersInput = {
@@ -1913,6 +2039,8 @@ export type TeamUpdateWithoutMcpServersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutMcpServersInput = {
@@ -1937,6 +2065,8 @@ export type TeamUncheckedUpdateWithoutMcpServersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutUserMetadataInput = {
@@ -1961,6 +2091,8 @@ export type TeamCreateWithoutUserMetadataInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutUserMetadataInput = {
@@ -1985,6 +2117,8 @@ export type TeamUncheckedCreateWithoutUserMetadataInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutUserMetadataInput = {
@@ -2025,6 +2159,8 @@ export type TeamUpdateWithoutUserMetadataInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutUserMetadataInput = {
@@ -2049,6 +2185,8 @@ export type TeamUncheckedUpdateWithoutUserMetadataInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutProvidersInput = {
@@ -2073,6 +2211,8 @@ export type TeamCreateWithoutProvidersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutProvidersInput = {
@@ -2097,6 +2237,8 @@ export type TeamUncheckedCreateWithoutProvidersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutProvidersInput = {
@@ -2137,6 +2279,8 @@ export type TeamUpdateWithoutProvidersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutProvidersInput = {
@@ -2161,6 +2305,8 @@ export type TeamUncheckedUpdateWithoutProvidersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutAiUsagesInput = {
@@ -2185,6 +2331,8 @@ export type TeamCreateWithoutAiUsagesInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutAiUsagesInput = {
@@ -2209,6 +2357,8 @@ export type TeamUncheckedCreateWithoutAiUsagesInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutAiUsagesInput = {
@@ -2249,6 +2399,8 @@ export type TeamUpdateWithoutAiUsagesInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutAiUsagesInput = {
@@ -2273,6 +2425,8 @@ export type TeamUncheckedUpdateWithoutAiUsagesInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutAuditLogsInput = {
@@ -2297,6 +2451,8 @@ export type TeamCreateWithoutAuditLogsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutAuditLogsInput = {
@@ -2321,6 +2477,8 @@ export type TeamUncheckedCreateWithoutAuditLogsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutAuditLogsInput = {
@@ -2361,6 +2519,8 @@ export type TeamUpdateWithoutAuditLogsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutAuditLogsInput = {
@@ -2385,6 +2545,8 @@ export type TeamUncheckedUpdateWithoutAuditLogsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutQuotaRulesInput = {
@@ -2409,6 +2571,8 @@ export type TeamCreateWithoutQuotaRulesInput = {
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutQuotaRulesInput = {
@@ -2433,6 +2597,8 @@ export type TeamUncheckedCreateWithoutQuotaRulesInput = {
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutQuotaRulesInput = {
@@ -2473,6 +2639,8 @@ export type TeamUpdateWithoutQuotaRulesInput = {
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutQuotaRulesInput = {
@@ -2497,6 +2665,8 @@ export type TeamUncheckedUpdateWithoutQuotaRulesInput = {
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutQuotaRecordsInput = {
@@ -2521,6 +2691,8 @@ export type TeamCreateWithoutQuotaRecordsInput = {
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutQuotaRecordsInput = {
@@ -2545,6 +2717,8 @@ export type TeamUncheckedCreateWithoutQuotaRecordsInput = {
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutQuotaRecordsInput = {
@@ -2585,6 +2759,8 @@ export type TeamUpdateWithoutQuotaRecordsInput = {
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutQuotaRecordsInput = {
@@ -2609,6 +2785,248 @@ export type TeamUncheckedUpdateWithoutQuotaRecordsInput = {
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutKanbanGoalsInput = {
id?: string
name: string
settings?:PrismaJson.Settings | Prisma.NullableJsonNullValueInput
createdAt?: Date | string
updatedAt?: Date | string
rootFolder?: Prisma.AssetCreateNestedOneWithoutTeamRootFolderInput
members?: Prisma.TeamMemberCreateNestedManyWithoutTeamInput
projects?: Prisma.ProjectCreateNestedManyWithoutTeamInput
metadataFields?: Prisma.MetadataFieldCreateNestedManyWithoutTeamInput
invites?: Prisma.InviteCreateNestedManyWithoutTeamInput
notifications?: Prisma.NotificationCreateNestedManyWithoutTeamInput
userMetadata?: Prisma.UserMetadataCreateNestedManyWithoutTeamInput
providers?: Prisma.ProviderCreateNestedManyWithoutTeamInput
skills?: Prisma.SkillCreateNestedManyWithoutTeamInput
mcpServers?: Prisma.McpServerCreateNestedManyWithoutTeamInput
sandbox?: Prisma.SandboxCreateNestedOneWithoutTeamInput
agents?: Prisma.AgentCreateNestedManyWithoutTeamInput
aiUsages?: Prisma.AiUsageCreateNestedManyWithoutTeamInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutKanbanGoalsInput = {
id?: string
name: string
settings?:PrismaJson.Settings | Prisma.NullableJsonNullValueInput
createdAt?: Date | string
updatedAt?: Date | string
rootFolderId?: string | null
members?: Prisma.TeamMemberUncheckedCreateNestedManyWithoutTeamInput
projects?: Prisma.ProjectUncheckedCreateNestedManyWithoutTeamInput
metadataFields?: Prisma.MetadataFieldUncheckedCreateNestedManyWithoutTeamInput
invites?: Prisma.InviteUncheckedCreateNestedManyWithoutTeamInput
notifications?: Prisma.NotificationUncheckedCreateNestedManyWithoutTeamInput
userMetadata?: Prisma.UserMetadataUncheckedCreateNestedManyWithoutTeamInput
providers?: Prisma.ProviderUncheckedCreateNestedManyWithoutTeamInput
skills?: Prisma.SkillUncheckedCreateNestedManyWithoutTeamInput
mcpServers?: Prisma.McpServerUncheckedCreateNestedManyWithoutTeamInput
sandbox?: Prisma.SandboxUncheckedCreateNestedOneWithoutTeamInput
agents?: Prisma.AgentUncheckedCreateNestedManyWithoutTeamInput
aiUsages?: Prisma.AiUsageUncheckedCreateNestedManyWithoutTeamInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutKanbanGoalsInput = {
where: Prisma.TeamWhereUniqueInput
create: Prisma.XOR<Prisma.TeamCreateWithoutKanbanGoalsInput, Prisma.TeamUncheckedCreateWithoutKanbanGoalsInput>
}
export type TeamUpsertWithoutKanbanGoalsInput = {
update: Prisma.XOR<Prisma.TeamUpdateWithoutKanbanGoalsInput, Prisma.TeamUncheckedUpdateWithoutKanbanGoalsInput>
create: Prisma.XOR<Prisma.TeamCreateWithoutKanbanGoalsInput, Prisma.TeamUncheckedCreateWithoutKanbanGoalsInput>
where?: Prisma.TeamWhereInput
}
export type TeamUpdateToOneWithWhereWithoutKanbanGoalsInput = {
where?: Prisma.TeamWhereInput
data: Prisma.XOR<Prisma.TeamUpdateWithoutKanbanGoalsInput, Prisma.TeamUncheckedUpdateWithoutKanbanGoalsInput>
}
export type TeamUpdateWithoutKanbanGoalsInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string
settings?:PrismaJson.Settings | Prisma.NullableJsonNullValueInput
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
rootFolder?: Prisma.AssetUpdateOneWithoutTeamRootFolderNestedInput
members?: Prisma.TeamMemberUpdateManyWithoutTeamNestedInput
projects?: Prisma.ProjectUpdateManyWithoutTeamNestedInput
metadataFields?: Prisma.MetadataFieldUpdateManyWithoutTeamNestedInput
invites?: Prisma.InviteUpdateManyWithoutTeamNestedInput
notifications?: Prisma.NotificationUpdateManyWithoutTeamNestedInput
userMetadata?: Prisma.UserMetadataUpdateManyWithoutTeamNestedInput
providers?: Prisma.ProviderUpdateManyWithoutTeamNestedInput
skills?: Prisma.SkillUpdateManyWithoutTeamNestedInput
mcpServers?: Prisma.McpServerUpdateManyWithoutTeamNestedInput
sandbox?: Prisma.SandboxUpdateOneWithoutTeamNestedInput
agents?: Prisma.AgentUpdateManyWithoutTeamNestedInput
aiUsages?: Prisma.AiUsageUpdateManyWithoutTeamNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutKanbanGoalsInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string
settings?:PrismaJson.Settings | Prisma.NullableJsonNullValueInput
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
rootFolderId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
members?: Prisma.TeamMemberUncheckedUpdateManyWithoutTeamNestedInput
projects?: Prisma.ProjectUncheckedUpdateManyWithoutTeamNestedInput
metadataFields?: Prisma.MetadataFieldUncheckedUpdateManyWithoutTeamNestedInput
invites?: Prisma.InviteUncheckedUpdateManyWithoutTeamNestedInput
notifications?: Prisma.NotificationUncheckedUpdateManyWithoutTeamNestedInput
userMetadata?: Prisma.UserMetadataUncheckedUpdateManyWithoutTeamNestedInput
providers?: Prisma.ProviderUncheckedUpdateManyWithoutTeamNestedInput
skills?: Prisma.SkillUncheckedUpdateManyWithoutTeamNestedInput
mcpServers?: Prisma.McpServerUncheckedUpdateManyWithoutTeamNestedInput
sandbox?: Prisma.SandboxUncheckedUpdateOneWithoutTeamNestedInput
agents?: Prisma.AgentUncheckedUpdateManyWithoutTeamNestedInput
aiUsages?: Prisma.AiUsageUncheckedUpdateManyWithoutTeamNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutKanbanTasksInput = {
id?: string
name: string
settings?:PrismaJson.Settings | Prisma.NullableJsonNullValueInput
createdAt?: Date | string
updatedAt?: Date | string
rootFolder?: Prisma.AssetCreateNestedOneWithoutTeamRootFolderInput
members?: Prisma.TeamMemberCreateNestedManyWithoutTeamInput
projects?: Prisma.ProjectCreateNestedManyWithoutTeamInput
metadataFields?: Prisma.MetadataFieldCreateNestedManyWithoutTeamInput
invites?: Prisma.InviteCreateNestedManyWithoutTeamInput
notifications?: Prisma.NotificationCreateNestedManyWithoutTeamInput
userMetadata?: Prisma.UserMetadataCreateNestedManyWithoutTeamInput
providers?: Prisma.ProviderCreateNestedManyWithoutTeamInput
skills?: Prisma.SkillCreateNestedManyWithoutTeamInput
mcpServers?: Prisma.McpServerCreateNestedManyWithoutTeamInput
sandbox?: Prisma.SandboxCreateNestedOneWithoutTeamInput
agents?: Prisma.AgentCreateNestedManyWithoutTeamInput
aiUsages?: Prisma.AiUsageCreateNestedManyWithoutTeamInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutKanbanTasksInput = {
id?: string
name: string
settings?:PrismaJson.Settings | Prisma.NullableJsonNullValueInput
createdAt?: Date | string
updatedAt?: Date | string
rootFolderId?: string | null
members?: Prisma.TeamMemberUncheckedCreateNestedManyWithoutTeamInput
projects?: Prisma.ProjectUncheckedCreateNestedManyWithoutTeamInput
metadataFields?: Prisma.MetadataFieldUncheckedCreateNestedManyWithoutTeamInput
invites?: Prisma.InviteUncheckedCreateNestedManyWithoutTeamInput
notifications?: Prisma.NotificationUncheckedCreateNestedManyWithoutTeamInput
userMetadata?: Prisma.UserMetadataUncheckedCreateNestedManyWithoutTeamInput
providers?: Prisma.ProviderUncheckedCreateNestedManyWithoutTeamInput
skills?: Prisma.SkillUncheckedCreateNestedManyWithoutTeamInput
mcpServers?: Prisma.McpServerUncheckedCreateNestedManyWithoutTeamInput
sandbox?: Prisma.SandboxUncheckedCreateNestedOneWithoutTeamInput
agents?: Prisma.AgentUncheckedCreateNestedManyWithoutTeamInput
aiUsages?: Prisma.AiUsageUncheckedCreateNestedManyWithoutTeamInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutKanbanTasksInput = {
where: Prisma.TeamWhereUniqueInput
create: Prisma.XOR<Prisma.TeamCreateWithoutKanbanTasksInput, Prisma.TeamUncheckedCreateWithoutKanbanTasksInput>
}
export type TeamUpsertWithoutKanbanTasksInput = {
update: Prisma.XOR<Prisma.TeamUpdateWithoutKanbanTasksInput, Prisma.TeamUncheckedUpdateWithoutKanbanTasksInput>
create: Prisma.XOR<Prisma.TeamCreateWithoutKanbanTasksInput, Prisma.TeamUncheckedCreateWithoutKanbanTasksInput>
where?: Prisma.TeamWhereInput
}
export type TeamUpdateToOneWithWhereWithoutKanbanTasksInput = {
where?: Prisma.TeamWhereInput
data: Prisma.XOR<Prisma.TeamUpdateWithoutKanbanTasksInput, Prisma.TeamUncheckedUpdateWithoutKanbanTasksInput>
}
export type TeamUpdateWithoutKanbanTasksInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string
settings?:PrismaJson.Settings | Prisma.NullableJsonNullValueInput
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
rootFolder?: Prisma.AssetUpdateOneWithoutTeamRootFolderNestedInput
members?: Prisma.TeamMemberUpdateManyWithoutTeamNestedInput
projects?: Prisma.ProjectUpdateManyWithoutTeamNestedInput
metadataFields?: Prisma.MetadataFieldUpdateManyWithoutTeamNestedInput
invites?: Prisma.InviteUpdateManyWithoutTeamNestedInput
notifications?: Prisma.NotificationUpdateManyWithoutTeamNestedInput
userMetadata?: Prisma.UserMetadataUpdateManyWithoutTeamNestedInput
providers?: Prisma.ProviderUpdateManyWithoutTeamNestedInput
skills?: Prisma.SkillUpdateManyWithoutTeamNestedInput
mcpServers?: Prisma.McpServerUpdateManyWithoutTeamNestedInput
sandbox?: Prisma.SandboxUpdateOneWithoutTeamNestedInput
agents?: Prisma.AgentUpdateManyWithoutTeamNestedInput
aiUsages?: Prisma.AiUsageUpdateManyWithoutTeamNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutKanbanTasksInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string
settings?:PrismaJson.Settings | Prisma.NullableJsonNullValueInput
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
rootFolderId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
members?: Prisma.TeamMemberUncheckedUpdateManyWithoutTeamNestedInput
projects?: Prisma.ProjectUncheckedUpdateManyWithoutTeamNestedInput
metadataFields?: Prisma.MetadataFieldUncheckedUpdateManyWithoutTeamNestedInput
invites?: Prisma.InviteUncheckedUpdateManyWithoutTeamNestedInput
notifications?: Prisma.NotificationUncheckedUpdateManyWithoutTeamNestedInput
userMetadata?: Prisma.UserMetadataUncheckedUpdateManyWithoutTeamNestedInput
providers?: Prisma.ProviderUncheckedUpdateManyWithoutTeamNestedInput
skills?: Prisma.SkillUncheckedUpdateManyWithoutTeamNestedInput
mcpServers?: Prisma.McpServerUncheckedUpdateManyWithoutTeamNestedInput
sandbox?: Prisma.SandboxUncheckedUpdateOneWithoutTeamNestedInput
agents?: Prisma.AgentUncheckedUpdateManyWithoutTeamNestedInput
aiUsages?: Prisma.AiUsageUncheckedUpdateManyWithoutTeamNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
}
@@ -2632,6 +3050,8 @@ export type TeamCountOutputType = {
watermarkTemplates: number
quotaRules: number
quotaRecords: number
kanbanGoals: number
kanbanTasks: number
}
export type TeamCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
@@ -2650,6 +3070,8 @@ export type TeamCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.I
watermarkTemplates?: boolean | TeamCountOutputTypeCountWatermarkTemplatesArgs
quotaRules?: boolean | TeamCountOutputTypeCountQuotaRulesArgs
quotaRecords?: boolean | TeamCountOutputTypeCountQuotaRecordsArgs
kanbanGoals?: boolean | TeamCountOutputTypeCountKanbanGoalsArgs
kanbanTasks?: boolean | TeamCountOutputTypeCountKanbanTasksArgs
}
/**
@@ -2767,6 +3189,20 @@ export type TeamCountOutputTypeCountQuotaRecordsArgs<ExtArgs extends runtime.Typ
where?: Prisma.QuotaRecordWhereInput
}
/**
* TeamCountOutputType without action
*/
export type TeamCountOutputTypeCountKanbanGoalsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.KanbanGoalWhereInput
}
/**
* TeamCountOutputType without action
*/
export type TeamCountOutputTypeCountKanbanTasksArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.KanbanTaskWhereInput
}
export type TeamSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean
@@ -2792,6 +3228,8 @@ export type TeamSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = r
watermarkTemplates?: boolean | Prisma.Team$watermarkTemplatesArgs<ExtArgs>
quotaRules?: boolean | Prisma.Team$quotaRulesArgs<ExtArgs>
quotaRecords?: boolean | Prisma.Team$quotaRecordsArgs<ExtArgs>
kanbanGoals?: boolean | Prisma.Team$kanbanGoalsArgs<ExtArgs>
kanbanTasks?: boolean | Prisma.Team$kanbanTasksArgs<ExtArgs>
_count?: boolean | Prisma.TeamCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["team"]>
@@ -2843,6 +3281,8 @@ export type TeamInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs =
watermarkTemplates?: boolean | Prisma.Team$watermarkTemplatesArgs<ExtArgs>
quotaRules?: boolean | Prisma.Team$quotaRulesArgs<ExtArgs>
quotaRecords?: boolean | Prisma.Team$quotaRecordsArgs<ExtArgs>
kanbanGoals?: boolean | Prisma.Team$kanbanGoalsArgs<ExtArgs>
kanbanTasks?: boolean | Prisma.Team$kanbanTasksArgs<ExtArgs>
_count?: boolean | Prisma.TeamCountOutputTypeDefaultArgs<ExtArgs>
}
export type TeamIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
@@ -2872,6 +3312,8 @@ export type $TeamPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs =
watermarkTemplates: Prisma.$WatermarkTemplatePayload<ExtArgs>[]
quotaRules: Prisma.$QuotaRulePayload<ExtArgs>[]
quotaRecords: Prisma.$QuotaRecordPayload<ExtArgs>[]
kanbanGoals: Prisma.$KanbanGoalPayload<ExtArgs>[]
kanbanTasks: Prisma.$KanbanTaskPayload<ExtArgs>[]
}
scalars: runtime.Types.Extensions.GetPayloadResult<{
id: string
@@ -3294,6 +3736,8 @@ export interface Prisma__TeamClient<T, Null = never, ExtArgs extends runtime.Typ
watermarkTemplates<T extends Prisma.Team$watermarkTemplatesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Team$watermarkTemplatesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$WatermarkTemplatePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
quotaRules<T extends Prisma.Team$quotaRulesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Team$quotaRulesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$QuotaRulePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
quotaRecords<T extends Prisma.Team$quotaRecordsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Team$quotaRecordsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$QuotaRecordPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
kanbanGoals<T extends Prisma.Team$kanbanGoalsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Team$kanbanGoalsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$KanbanGoalPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
kanbanTasks<T extends Prisma.Team$kanbanTasksArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Team$kanbanTasksArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$KanbanTaskPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
@@ -4127,6 +4571,54 @@ export type Team$quotaRecordsArgs<ExtArgs extends runtime.Types.Extensions.Inter
distinct?: Prisma.QuotaRecordScalarFieldEnum | Prisma.QuotaRecordScalarFieldEnum[]
}
/**
* Team.kanbanGoals
*/
export type Team$kanbanGoalsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the KanbanGoal
*/
select?: Prisma.KanbanGoalSelect<ExtArgs> | null
/**
* Omit specific fields from the KanbanGoal
*/
omit?: Prisma.KanbanGoalOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.KanbanGoalInclude<ExtArgs> | null
where?: Prisma.KanbanGoalWhereInput
orderBy?: Prisma.KanbanGoalOrderByWithRelationInput | Prisma.KanbanGoalOrderByWithRelationInput[]
cursor?: Prisma.KanbanGoalWhereUniqueInput
take?: number
skip?: number
distinct?: Prisma.KanbanGoalScalarFieldEnum | Prisma.KanbanGoalScalarFieldEnum[]
}
/**
* Team.kanbanTasks
*/
export type Team$kanbanTasksArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the KanbanTask
*/
select?: Prisma.KanbanTaskSelect<ExtArgs> | null
/**
* Omit specific fields from the KanbanTask
*/
omit?: Prisma.KanbanTaskOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.KanbanTaskInclude<ExtArgs> | null
where?: Prisma.KanbanTaskWhereInput
orderBy?: Prisma.KanbanTaskOrderByWithRelationInput | Prisma.KanbanTaskOrderByWithRelationInput[]
cursor?: Prisma.KanbanTaskWhereUniqueInput
take?: number
skip?: number
distinct?: Prisma.KanbanTaskScalarFieldEnum | Prisma.KanbanTaskScalarFieldEnum[]
}
/**
* Team without action
*/
File diff suppressed because it is too large Load Diff
+35
View File
@@ -46,6 +46,7 @@ declare global {
// Team Settings
// ----------------------------------------------------------------------
export type VideoTranscodeStrategy = 'best_match' | 'all'
export type HardwareAcceleration = 'off' | 'auto'
// ----------------------------------------------------------------------
// Collection Filter
@@ -54,6 +55,7 @@ declare global {
export interface TranscodeSettings {
videoStrategy: VideoTranscodeStrategy
hardwareAcceleration?: HardwareAcceleration
}
export interface Settings {
@@ -103,6 +105,7 @@ declare global {
hasAudio: boolean
duration: number
bitRate: number
videoBitRate?: number
frameRate: number
totalFrames: number
startTimecode: string
@@ -290,6 +293,7 @@ declare global {
export interface TaskSpec {
videoStrategy?: VideoTranscodeStrategy
hardwareAcceleration?: HardwareAcceleration
thumbnail?: boolean
sprite?: boolean
poster?: boolean
@@ -431,5 +435,36 @@ declare global {
// ----------------------------------------------------------------------
export type QuotaResourceData = Record<string, unknown>
export type QuotaUserIds = string[]
// ----------------------------------------------------------------------
// Kanban Types
// ----------------------------------------------------------------------
export type KanbanBlockReasonKind = 'NEEDS_INPUT' | 'CAPABILITY' | 'DEPENDENCY' | 'TRANSIENT'
export interface KanbanAssetSummary {
id: string
type?: string
name?: string
description?: string
}
export interface KanbanEventPayload {
summary?: string
blockReason?: string
blockKind?: KanbanBlockReasonKind
assets?: KanbanAssetSummary[]
reason?: string
[key: string]: unknown
}
export interface KanbanCommentAttachment {
id: string
name: string
key: string
sizeByte: number
contentType?: string | null
proxyType?: 'image' | 'video' | 'audio' | 'pdf' | null
}
export type KanbanCommentAttachmentList = KanbanCommentAttachment[]
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/dtos",
"version": "0.3.9",
"version": "0.4.0",
"private": true,
"type": "module",
"main": "./src/index.ts",
+10
View File
@@ -53,6 +53,16 @@ export enum AuditAction {
quota_policy_create = 'quota_policy_create',
quota_policy_update = 'quota_policy_update',
quota_policy_delete = 'quota_policy_delete',
kanban_goal_create = 'kanban_goal_create',
kanban_goal_update = 'kanban_goal_update',
kanban_goal_delete = 'kanban_goal_delete',
kanban_task_create = 'kanban_task_create',
kanban_task_update = 'kanban_task_update',
kanban_task_delete = 'kanban_task_delete',
kanban_comment_create = 'kanban_comment_create',
kanban_comment_delete = 'kanban_comment_delete',
kanban_dependency_add = 'kanban_dependency_add',
kanban_dependency_remove = 'kanban_dependency_remove',
}
export const auditLogSchema = z.object({
+2
View File
@@ -23,3 +23,5 @@ export * from './chat'
export * from './auditLog'
export * from './watermark'
export * from './quota'
export * from './kanban'
export * from './recents'
+62
View File
@@ -0,0 +1,62 @@
import { z } from 'zod'
import { kanbanUserInfoSchema } from './event'
export const kanbanAttachmentPayloadSchema = z.object({
id: z.string(),
name: z.string(),
key: z.string(),
sizeByte: z.number(),
contentType: z.string().nullable().optional(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
})
export type KanbanAttachmentPayload = z.infer<typeof kanbanAttachmentPayloadSchema>
export const kanbanAttachmentInfoSchema = z.object({
id: z.string(),
name: z.string(),
sizeByte: z.number(),
contentType: z.string().nullable().optional(),
url: z.string(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
})
export type KanbanAttachmentInfo = z.infer<typeof kanbanAttachmentInfoSchema>
export const postKanbanAttachmentResponseSchema = z.object({
id: z.string(),
name: z.string(),
key: z.string(),
sizeByte: z.number(),
contentType: z.string().nullable().optional(),
uploadUrl: z.string(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
})
export type PostKanbanAttachmentResponse = z.infer<typeof postKanbanAttachmentResponseSchema>
export const createKanbanCommentSchema = z
.object({
body: z.string().default(''),
attachments: z.array(kanbanAttachmentPayloadSchema).optional(),
})
.refine(
(data) => data.body.trim().length > 0 || (data.attachments && data.attachments.length > 0),
{
message: 'Comment body or attachments required',
},
)
export type CreateKanbanCommentRequest = z.infer<typeof createKanbanCommentSchema>
export const kanbanCommentInfoSchema = z.object({
id: z.string(),
taskId: z.string(),
author: kanbanUserInfoSchema,
body: z.string(),
attachments: z.array(kanbanAttachmentInfoSchema).default([]),
createdAt: z.union([z.string(), z.date()]),
updatedAt: z.union([z.string(), z.date()]),
})
export type KanbanCommentInfo = z.infer<typeof kanbanCommentInfoSchema>
export const listKanbanCommentsResponseSchema = z.object({
data: z.array(kanbanCommentInfoSchema),
})
export type ListKanbanCommentsResponse = z.infer<typeof listKanbanCommentsResponseSchema>
+46
View File
@@ -0,0 +1,46 @@
import { z } from 'zod'
import { KanbanTaskEventType, KanbanTaskStatus } from '@shumai/db/enums'
export const kanbanUserInfoSchema = z.object({
id: z.string(),
name: z.string(),
image: z.string().optional(),
})
export type KanbanUserInfo = z.infer<typeof kanbanUserInfoSchema>
export const kanbanEventPayloadSchema = z
.object({
summary: z.string().optional(),
blockReason: z.string().optional(),
blockKind: z.string().optional(),
reason: z.string().optional(),
assets: z
.array(
z.object({
id: z.string(),
type: z.string().optional(),
name: z.string().optional(),
description: z.string().optional(),
}),
)
.optional(),
})
.passthrough()
export type KanbanEventPayload = z.infer<typeof kanbanEventPayloadSchema>
export const kanbanEventInfoSchema = z.object({
id: z.string(),
taskId: z.string(),
actor: kanbanUserInfoSchema.nullable().optional(),
type: z.nativeEnum(KanbanTaskEventType),
fromStatus: z.nativeEnum(KanbanTaskStatus).nullable().optional(),
toStatus: z.nativeEnum(KanbanTaskStatus).nullable().optional(),
data: kanbanEventPayloadSchema.nullable().optional(),
createdAt: z.union([z.string(), z.date()]),
})
export type KanbanEventInfo = z.infer<typeof kanbanEventInfoSchema>
export const listKanbanEventsResponseSchema = z.object({
data: z.array(kanbanEventInfoSchema),
})
export type ListKanbanEventsResponse = z.infer<typeof listKanbanEventsResponseSchema>
+37
View File
@@ -0,0 +1,37 @@
import { z } from 'zod'
export const UNASSIGNED_GOAL_ID = 'unassigned'
export const createKanbanGoalSchema = z.object({
title: z.string().min(1),
description: z.string().optional(),
})
export type CreateKanbanGoalRequest = z.infer<typeof createKanbanGoalSchema>
export const updateKanbanGoalSchema = z.object({
title: z.string().min(1).optional(),
description: z.string().nullable().optional(),
})
export type UpdateKanbanGoalRequest = z.infer<typeof updateKanbanGoalSchema>
export const kanbanGoalInfoSchema = z.object({
id: z.string(),
title: z.string(),
description: z.string().nullable().optional(),
teamId: z.string(),
creatorId: z.string().nullable().optional(),
taskCount: z.number().optional(),
createdAt: z.union([z.string(), z.date()]),
updatedAt: z.union([z.string(), z.date()]),
})
export type KanbanGoalInfo = z.infer<typeof kanbanGoalInfoSchema>
export const listKanbanGoalsRequestSchema = z.object({
// Filter or search params can be added here
})
export type ListKanbanGoalsRequest = z.infer<typeof listKanbanGoalsRequestSchema>
export const listKanbanGoalsResponseSchema = z.object({
data: z.array(kanbanGoalInfoSchema),
})
export type ListKanbanGoalsResponse = z.infer<typeof listKanbanGoalsResponseSchema>
+4
View File
@@ -0,0 +1,4 @@
export * from './goal'
export * from './comment'
export * from './event'
export * from './task'
+164
View File
@@ -0,0 +1,164 @@
import { z } from 'zod'
import { KanbanTaskStatus, KanbanTaskPriority, KanbanTaskEventType } from '@shumai/db/enums'
import { paginationPageInfoSchema, paginationParamsSchema } from '../pagination'
import { kanbanUserInfoSchema, kanbanEventInfoSchema } from './event'
import { kanbanCommentInfoSchema } from './comment'
export { KanbanTaskStatus, KanbanTaskPriority, KanbanTaskEventType }
export const createKanbanTaskSchema = z.object({
title: z.string().min(1),
description: z.string().optional(),
isAgentTask: z.boolean().optional(),
priority: z.nativeEnum(KanbanTaskPriority).optional(),
startDate: z.union([z.string(), z.date()]).optional(),
dueDate: z.union([z.string(), z.date()]).optional(),
goalId: z.string().optional(),
projectId: z.string().optional(),
reporterId: z.string().optional(),
assigneeId: z.string().optional(),
targetFolderId: z.string().optional(),
parentIds: z.array(z.string()).optional(),
assetIds: z.array(z.string()).optional(),
})
export type CreateKanbanTaskRequest = z.infer<typeof createKanbanTaskSchema>
export const updateKanbanTaskSchema = z.object({
fromStatus: z.nativeEnum(KanbanTaskStatus).optional(),
title: z.string().min(1).optional(),
description: z.string().nullable().optional(),
status: z.nativeEnum(KanbanTaskStatus).optional(),
reason: z.string().optional(),
priority: z.nativeEnum(KanbanTaskPriority).optional(),
startDate: z.union([z.string(), z.date()]).nullable().optional(),
dueDate: z.union([z.string(), z.date()]).nullable().optional(),
goalId: z.string().nullable().optional(),
projectId: z.string().nullable().optional(),
reporterId: z.string().nullable().optional(),
assigneeId: z.string().nullable().optional(),
targetFolderId: z.string().nullable().optional(),
beforeIndex: z.string().optional(),
afterIndex: z.string().optional(),
parentIds: z.array(z.string()).optional(),
assetIds: z.array(z.string()).optional(),
})
export type UpdateKanbanTaskRequest = z.infer<typeof updateKanbanTaskSchema>
export const listKanbanTasksRequestSchema = z
.object({
status: z.nativeEnum(KanbanTaskStatus).optional(),
isAgentTask: z
.union([z.boolean(), z.string()])
.transform((v) => v === true || v === 'true')
.optional(),
goalId: z.string().optional(),
projectId: z.string().optional(),
priority: z.nativeEnum(KanbanTaskPriority).optional(),
assigneeId: z.string().optional(),
reporterId: z.string().optional(),
})
.merge(paginationParamsSchema)
export type ListKanbanTasksRequest = z.infer<typeof listKanbanTasksRequestSchema>
export const kanbanStatusEventInfoSchema = z.object({
id: z.string(),
type: z.nativeEnum(KanbanTaskEventType),
actor: kanbanUserInfoSchema.nullable().optional(),
summary: z.string().optional(),
blockReason: z.string().optional(),
blockKind: z.string().optional(),
reason: z.string().optional(),
createdAt: z.union([z.string(), z.date()]),
})
export type KanbanStatusEventInfo = z.infer<typeof kanbanStatusEventInfoSchema>
export const kanbanTaskGoalSummarySchema = z.object({
id: z.string(),
title: z.string(),
})
export type KanbanTaskGoalSummary = z.infer<typeof kanbanTaskGoalSummarySchema>
export const kanbanTaskSummarySchema = z.object({
id: z.string(),
title: z.string(),
isAgentTask: z.boolean(),
status: z.nativeEnum(KanbanTaskStatus),
priority: z.nativeEnum(KanbanTaskPriority),
sortIndex: z.string().nullable().optional(),
})
export type KanbanTaskSummary = z.infer<typeof kanbanTaskSummarySchema>
export const kanbanTaskAssetInfoSchema = z.object({
id: z.string(),
name: z.string(),
type: z.string(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
thumbnailUrl: z.string().nullable().optional(),
path: z.string(),
creator: kanbanUserInfoSchema.nullable().optional(),
sizeByte: z.number().optional(),
fileCount: z.number().optional(),
projectId: z.string().nullable().optional(),
createdAt: z.union([z.string(), z.date()]),
})
export type KanbanTaskAssetInfo = z.infer<typeof kanbanTaskAssetInfoSchema>
export const kanbanTaskInfoSchema = z.object({
id: z.string(),
title: z.string(),
description: z.string().nullable().optional(),
isAgentTask: z.boolean(),
status: z.nativeEnum(KanbanTaskStatus),
priority: z.nativeEnum(KanbanTaskPriority),
startDate: z.union([z.string(), z.date()]).nullable().optional(),
dueDate: z.union([z.string(), z.date()]).nullable().optional(),
startedAt: z.union([z.string(), z.date()]).nullable().optional(),
completedAt: z.union([z.string(), z.date()]).nullable().optional(),
teamId: z.string(),
projectId: z.string().nullable().optional(),
sortIndex: z.string().nullable().optional(),
creator: kanbanUserInfoSchema,
reporter: kanbanUserInfoSchema.nullable().optional(),
assignee: kanbanUserInfoSchema.nullable().optional(),
goal: kanbanTaskGoalSummarySchema.nullable().optional(),
targetFolderId: z.string().nullable().optional(),
latestStatusEvent: kanbanStatusEventInfoSchema.nullable().optional(),
commentCount: z.number().default(0),
dependencyCount: z.number().default(0),
dependentCount: z.number().default(0),
assetCount: z.number().default(0),
createdAt: z.union([z.string(), z.date()]),
updatedAt: z.union([z.string(), z.date()]),
})
export type KanbanTaskInfo = z.infer<typeof kanbanTaskInfoSchema>
export const kanbanTaskDetailSchema = kanbanTaskInfoSchema.extend({
dependencies: z.array(kanbanTaskSummarySchema),
dependents: z.array(kanbanTaskSummarySchema),
assets: z.array(kanbanTaskAssetInfoSchema),
comments: z.array(kanbanCommentInfoSchema),
events: z.array(kanbanEventInfoSchema),
})
export type KanbanTaskDetail = z.infer<typeof kanbanTaskDetailSchema>
export const listKanbanTasksResponseSchema = z.object({
data: z.array(kanbanTaskInfoSchema),
pageInfo: paginationPageInfoSchema,
})
export type ListKanbanTasksResponse = z.infer<typeof listKanbanTasksResponseSchema>
export const linkAssetToTaskSchema = z.object({
taskId: z.string(),
})
export type LinkAssetToTaskRequest = z.infer<typeof linkAssetToTaskSchema>
export const linkTaskAssetsSchema = z.object({
assetIds: z.array(z.string()),
})
export type LinkTaskAssetsRequest = z.infer<typeof linkTaskAssetsSchema>
export const listAssetTasksResponseSchema = z.object({
data: z.array(kanbanTaskInfoSchema),
total: z.number(),
})
export type ListAssetTasksResponse = z.infer<typeof listAssetTasksResponseSchema>
+12
View File
@@ -28,6 +28,14 @@ export const assetPreviewSchema = z.object({
export type AssetPreview = z.infer<typeof assetPreviewSchema>
export const kanbanTaskPreviewSchema = z.object({
id: z.string().optional(),
title: z.string().optional(),
status: z.string().optional(),
})
export type KanbanTaskPreview = z.infer<typeof kanbanTaskPreviewSchema>
export const notificationInfoSchema = z.object({
id: z.string().optional(),
creator: teamUserInfoSchema.optional(),
@@ -35,6 +43,7 @@ export const notificationInfoSchema = z.object({
team: entityInfoSchema.optional(),
project: entityInfoSchema.optional(),
asset: assetPreviewSchema.optional(),
kanbanTask: kanbanTaskPreviewSchema.optional(),
user: teamUserInfoSchema.optional(),
createdAt: z.string().optional(),
isRead: z.boolean().optional(),
@@ -67,6 +76,7 @@ export interface CreateNotificationRequest {
creatorId?: string
assetId?: string
taskId?: string
kanbanTaskId?: string
userId?: string
commentMessage?: string // For parsing mentions
}
@@ -84,6 +94,8 @@ export const notificationSettingsSchema = z.object({
yourUploads: z.boolean().default(false),
otherUploads: z.boolean().default(true),
statusUpdates: z.boolean().default(true),
kanbanTasks: z.boolean().default(true),
kanbanComments: z.boolean().default(true),
})
export type NotificationSettings = z.infer<typeof notificationSettingsSchema>

Some files were not shown because too many files have changed in this diff Show More