mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-25 16:38:44 +00:00
feat(sharelink): add sharelink watermark support (#270)
* feat(sharelink): add sharelink watermark support
* fix(sharelink): harden watermark feature against races, crashes, and tenant leaks
Addresses review findings on the sharelink watermark feature:
- fix(watermark): read back sharelink via transaction client so the
updateShareLinkWatermark response reflects the just-committed state
(global-client reads on a pooled connection miss uncommitted changes)
- fix(watermark): use prisma upsert on the config hash instead of
find-then-create to avoid P2002 races on concurrent enables
- fix(watermark): resolve nested symlinks when walking the share tree and
batch the walk level-by-level instead of one query per node
- fix(watermark): keep watermark tasks in flight from being purged by
orphan-config GC (avoids FK violations in completing activities)
- fix(transcode): re-transcode stale 'processing' watermark rows instead
of silently skipping (crash recovery); downscale embedded block images;
use pino structured logging; drop unused any casts
- fix(api): scope watermark-template list/create to the caller's teams,
reject teamless template creation, and make teamless templates
read-only; validate watermark config required when enabling (400);
map sharelink-not-found to 404
- fix(api): resolve symlink target ids once in public share children
endpoint instead of twice per item
- refactor(db): dedicated WatermarkFileStatus enum (migration included)
- test: activity unit tests (init crash recovery, image + video transcode
paths), concurrent upsert, nested-symlink resolution, API scoping and
validation, e2e video watermark path
* refactor(transcode): move sharp usage out of watermark activity into transcodeService
The transcode package does not declare sharp as a dependency (only
@shumai/core does), so importing it directly in the watermark activity
broke CI typecheck for the transcode package.
- add transcodeService.renderSvgToPng, downscaleImageToPng and
compositeOverlayToWebpFile encapsulating the sharp logic
- watermark activity now calls these methods instead of importing sharp
- activity tests mock the new methods (no sharp/real fixture needed)
- add unit tests for the new transcodeService helpers
* feat(watermark): restrict watermark transcode to existing image and video transcodes
* refactor(transcode): reuse transcodeVideo in watermark activity
* refactor(watermark): use Bun.hash instead of node crypto for watermark config hash
* refactor(watermark): move computeWatermarkConfigHash from dtos to core watermark-hash module
* refactor(api): delegate watermark DB queries from public-share route to watermarkService
* refactor(share): replace dynamic watermarkService import with static import
* feat(watermark): add waitForWatermarkFileActivity for in-flight watermark transcoding tasks
* refactor(asset): replace dynamic watermarkService import with static import
* test(watermark): harden purgeOrphanWatermarkConfigs coverage
Replace the single happy-path GC test with a dedicated suite covering:
- orphan config with proxies: purged, watermarkFiles removed, all four
proxy keys deleted from S3 while the original key is preserved
- config still referenced by a share link is not purged
- config with pending/processing transcode_watermark tasks is not purged
(in-flight guard), but completed tasks do not block purging
- pending tasks of other types (transcode_video) do not protect a config
- an S3 delete failure is non-fatal: remaining keys still deleted and the
config is still purged
- mixed run: only the orphan config is purged while a referenced one
survives (exact count assertion)
* feat(webui): add sharelink watermark editor and sidebar controls
* style(webui): enlarge watermark editor dialog and allocate 2/3 width to preview column
* fix(webui): override sm:max-w-lg in DialogContent to allow full 1400px width
* fix(webui): stop block click propagation and remove preview mode toggles
* fix(webui): store watermark block size as fraction of canvas width
The editor stored block.size in pixels (slider 10-120px, preview
fontSize: `${block.size}px`) while the SVG generator
(generateWatermarkSvg) interprets size as a fraction (0..1) of canvas
width. A 36px block therefore rendered as a ~36x-canvas glyph covering
the entire image.
- Keep backend fraction semantics (canvasWidth * size) so watermarks
scale proportionally with output resolution across proxies
- Editor: defaults (text 5%, image 15%), slider ranges (1-12% / 2-50%)
and number input now work in percent, storing a fraction
- Preview: scales blocks by the measured canvas width so WYSIWYG
- DTO schema: size constrained to (0..1) to enforce the contract
- Update DTO/editor tests to fraction sizes
* feat(webui): add single-row aspect ratio selector and 5 predefined background colors to watermark editor preview
* feat(webui): update aspect ratio to multi-toggle group and enable dot-grid pattern for all background colors
* fix(webui): update background swatches to distinct colors and share PRESET_BACKGROUND_OPTIONS array
* fix(webui): hide redundant absolute close button on watermark editor dialog header
* fix(transcode): skip raw video transcode when generating watermark proxies
The raw marker entry (isRaw: true) in videoTranscodes points at the
original source file and is only used to offer the 'Original' playback
option. It is not a transcoded proxy, so watermarking it produced a
redundant full-resolution transcode (the most expensive pass) plus an
unneeded S3 upload.
Skip entries with isRaw: true in transcodeWatermarkMediaActivity, and
cover the behavior with a unit regression test plus an e2e assertion
that exactly one watermark proxy is produced for a video asset.
* feat(webui): replace watermark image asset ID with 1MB file uploader
* fix(webui): correct watermark editor preview block sizing
The preview canvas width was measured in a useEffect([open]) that ran
before the Radix Dialog had mounted its content, so canvasRef.current was
still null, canvasWidthPx stayed 0, and every block silently fell back to
the hardcoded 640px width (block.size * (canvasWidthPx || 640)). A 100%
size therefore rendered at ~640px on an ~876px canvas (~72%), making the
preview smaller than the real watermarked output for both image and text
blocks.
- Measure the canvas via a ref callback (fires exactly when the node
mounts, regardless of dialog mount timing) and keep a ResizeObserver
attached for aspect-ratio/window changes.
- Use clientWidth (padding-box width) instead of getBoundingClientRect(),
which includes the dialog's zoom-in-95 animation transform.
- Drop max-w-full/max-h-full on the preview <img> so logos scale up to
the block size like the backend SVG rendering does, instead of being
capped at their natural pixel size.
* fix(webui): keep watermark editor preview aspect ratio and restore config scroll
- Compute the preview canvas size with a JS contain-fit (ResizeObserver on the
frame) instead of relying on CSS aspect-ratio + w-full/max-h-full, which
broke the selected ratio on wide-and-short (or tall-and-narrow) windows.
- Add min-h-0 to the config ScrollArea so it shrinks to the column's remaining
height instead of growing to its content height, restoring the scroll range.
* fix(webui): remove toast notification on template load
* fix(share): serve per-file watermark proxies in public share APIs
Stop gating watermark replacement on the share-link-wide watermarkStatus.
Public share endpoints now resolve each asset's own completed watermark
proxy and:
- replace videoTranscodes/imageTranscodes with the watermarked entries
when the watermark file is completed;
- empty those arrays when no completed proxy exists yet (still
transcoding or failed) so original, unwatermarked media is never
exposed while a newly added file is being processed;
- leave non-video/image media (pdf, audio, ...) untouched, since they
never receive watermark transcodes.
This removes the previous behavior where adding a file to a ready
watermark share flipped the whole share link to processing and served
original media for every file until the new transcode finished.
Adds API tests for detail/children endpoints (ready, in-flight, pdf, and
watermark-disabled cases) and a workflow E2E test for adding an asset to
an already-ready watermark sharelink.
This commit is contained in:
@@ -351,7 +351,8 @@ const route = new Hono<{ Variables: { user: User } }>()
|
||||
contentType,
|
||||
)
|
||||
|
||||
return c.json({ key })
|
||||
const url = await s3Service.presign(process.env.S3_BUCKET || 'shumai', key, 'GET')
|
||||
return c.json({ key, url })
|
||||
})
|
||||
.post('/files/download-links', zValidator('json', getDownloadLinksRequestSchema), async (c) => {
|
||||
const user = c.get('user')
|
||||
|
||||
@@ -19,6 +19,7 @@ import publicShareRoute from './public-share'
|
||||
import s3Route from './s3'
|
||||
import shareRoute from './share'
|
||||
import skillRoute from './skill'
|
||||
import watermarkTemplateRoute from './watermark-template'
|
||||
import teamRoute from './team'
|
||||
import uploadRoute, { localUploadRoute } from './upload'
|
||||
import versionStackRoute from './versionStack'
|
||||
@@ -60,6 +61,7 @@ const apiRoute = new Hono<{ Variables: { user: User } }>()
|
||||
.route('/', uploadRoute)
|
||||
.route('/', shareRoute)
|
||||
.route('/', skillRoute)
|
||||
.route('/', watermarkTemplateRoute)
|
||||
|
||||
app.route('/files', s3Route)
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import type { Context } from 'hono'
|
||||
import { zValidator } from '@hono/zod-validator'
|
||||
import { shareService } from '@shumai/core/src/share/share'
|
||||
import { assetService } from '@shumai/core/src/asset/asset'
|
||||
import { watermarkService } from '@shumai/core/src/watermark/watermark'
|
||||
import { paginationParamsSchema } from '@shumai/dtos'
|
||||
import { z } from 'zod'
|
||||
import { metadataService } from '@shumai/core/src/metadata/metadata'
|
||||
@@ -19,6 +20,65 @@ import {
|
||||
ShareLinkExpiredError,
|
||||
ShareLinkPasswordInvalidError,
|
||||
} from '@shumai/core/src/share/errors'
|
||||
import { s3Service } from '@shumai/core/src/s3/s3'
|
||||
import type { AssetInfo } from '@shumai/dtos'
|
||||
|
||||
/**
|
||||
* Replaces the served media entries with the watermarked proxy entries produced
|
||||
* by the watermark transcode activity. When no completed watermark proxy exists
|
||||
* yet (still transcoding, or failed), the video/image transcode slots are emptied
|
||||
* so original, unwatermarked proxies are never exposed on the public share.
|
||||
*
|
||||
* Only video/image assets are subject to watermark protection; other media types
|
||||
* (pdf, audio, ...) never receive watermark transcodes and pass through untouched.
|
||||
* `original`, `thumbnail` and `videoPreview` are intentionally left untouched here.
|
||||
* S3 GET URLs are generated for all watermarked proxies.
|
||||
*/
|
||||
async function applyWatermarkToAssetMedia(
|
||||
asset: AssetInfo,
|
||||
watermarkMedia: PrismaJson.MediaInfo | null,
|
||||
): Promise<AssetInfo> {
|
||||
if (!asset.media) return asset
|
||||
if (asset.proxyType !== 'video' && asset.proxyType !== 'image') return asset
|
||||
|
||||
const updatedMedia = { ...asset.media }
|
||||
const bucket = process.env.S3_BUCKET || 'shumai'
|
||||
|
||||
updatedMedia.videoTranscodes =
|
||||
watermarkMedia?.videoTranscodes && watermarkMedia.videoTranscodes.length > 0
|
||||
? await Promise.all(
|
||||
watermarkMedia.videoTranscodes.map(async (vt) => ({
|
||||
id: vt.key ?? '',
|
||||
url: vt.key ? await s3Service.presign(bucket, vt.key, 'GET') : '',
|
||||
key: vt.key ?? '',
|
||||
width: vt.width ?? 0,
|
||||
height: vt.height ?? 0,
|
||||
size: 0,
|
||||
isRaw: false,
|
||||
})),
|
||||
)
|
||||
: []
|
||||
|
||||
updatedMedia.imageTranscodes =
|
||||
watermarkMedia?.imageTranscodes && watermarkMedia.imageTranscodes.length > 0
|
||||
? await Promise.all(
|
||||
watermarkMedia.imageTranscodes.map(async (it) => ({
|
||||
id: it.key ?? '',
|
||||
url: it.key ? await s3Service.presign(bucket, it.key, 'GET') : '',
|
||||
key: it.key ?? '',
|
||||
width: it.width ?? 0,
|
||||
height: it.height ?? 0,
|
||||
size: 0,
|
||||
isRaw: false,
|
||||
})),
|
||||
)
|
||||
: []
|
||||
|
||||
return {
|
||||
...asset,
|
||||
media: updatedMedia,
|
||||
}
|
||||
}
|
||||
|
||||
const app = new Hono()
|
||||
|
||||
@@ -129,6 +189,24 @@ const route = app
|
||||
order,
|
||||
})
|
||||
|
||||
if (shareLink.watermarkConfigId && res.data.length > 0) {
|
||||
// Resolve symlink targets once and reuse for the media lookup, so each
|
||||
// item costs a single query instead of two.
|
||||
const targetIds = await Promise.all(
|
||||
res.data.map((item) => assetService.resolveTargetAssetId(item.id)),
|
||||
)
|
||||
const wfMap = await watermarkService.getCompletedWatermarkMediaMap(
|
||||
targetIds,
|
||||
shareLink.watermarkConfigId,
|
||||
)
|
||||
|
||||
res.data = await Promise.all(
|
||||
res.data.map(async (item, index) =>
|
||||
applyWatermarkToAssetMedia(item, wfMap.get(targetIds[index]) ?? null),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
return c.json(res)
|
||||
} catch (err) {
|
||||
return handlePublicShareError(c, err)
|
||||
@@ -140,9 +218,24 @@ const route = app
|
||||
const password = c.req.header('x-share-password')
|
||||
|
||||
try {
|
||||
await shareService.verifyPublicAccess(fileId, password)
|
||||
const shareLink = await shareService.verifyPublicAccess(fileId, password)
|
||||
|
||||
let asset = await assetService.getAsset({ assetId: fileId })
|
||||
|
||||
// Only video/image assets are subject to watermark protection; skip the
|
||||
// watermark lookup entirely for other media types (pdf, audio, ...).
|
||||
if (
|
||||
shareLink.watermarkConfigId &&
|
||||
(asset.proxyType === 'video' || asset.proxyType === 'image')
|
||||
) {
|
||||
const targetAssetId = await assetService.resolveTargetAssetId(fileId)
|
||||
const wfMap = await watermarkService.getCompletedWatermarkMediaMap(
|
||||
[targetAssetId],
|
||||
shareLink.watermarkConfigId,
|
||||
)
|
||||
asset = await applyWatermarkToAssetMedia(asset, wfMap.get(targetAssetId) ?? null)
|
||||
}
|
||||
|
||||
const asset = await assetService.getAsset({ assetId: fileId })
|
||||
return c.json(asset)
|
||||
} catch (err) {
|
||||
return handlePublicShareError(c, err)
|
||||
|
||||
@@ -9,6 +9,8 @@ import { authzService, Permission, ResourceType } from '@shumai/core/src/authz/a
|
||||
import { ShareLinkPasswordInvalidError, ShareLinkExpiredError } from '@shumai/core/src/share/errors'
|
||||
|
||||
import { auditLogService } from '@shumai/core/src/auditLog/auditLog'
|
||||
import { watermarkService } from '@shumai/core/src/watermark/watermark'
|
||||
import { s3Service } from '@shumai/core/src/s3/s3'
|
||||
|
||||
vi.mock('./middleware/auth', () => ({
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
@@ -47,6 +49,36 @@ vi.mock('@shumai/core/src/project/project', () => ({
|
||||
},
|
||||
}))
|
||||
|
||||
function watermarkMediaInfo(overrides: Partial<PrismaJson.MediaInfo> = {}): PrismaJson.MediaInfo {
|
||||
return {
|
||||
duration: 1,
|
||||
filesize: 100,
|
||||
frames: 30,
|
||||
proxyType: 'video',
|
||||
imageTranscodes: [],
|
||||
videoTranscodes: [],
|
||||
finishedAt: new Date().toISOString(),
|
||||
metadata: {
|
||||
originalHeight: 360,
|
||||
originalWidth: 640,
|
||||
hasAudio: false,
|
||||
duration: 1,
|
||||
bitRate: 0,
|
||||
frameRate: 30,
|
||||
totalFrames: 30,
|
||||
startTimecode: '00:00:00:00',
|
||||
format: {},
|
||||
},
|
||||
original: {
|
||||
key: 'files/orig.mp4',
|
||||
downloadUrl: 'u',
|
||||
filesizeInBytes: 100,
|
||||
codec: '',
|
||||
},
|
||||
...overrides,
|
||||
}
|
||||
}
|
||||
|
||||
describe('Share API', () => {
|
||||
const app = new Hono()
|
||||
.route('/', publicShareRoute)
|
||||
@@ -180,6 +212,294 @@ describe('Share API', () => {
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
test('applies per-file watermark proxies when watermark enabled', async () => {
|
||||
vi.spyOn(shareService, 'verifyPublicAccess').mockResolvedValue({
|
||||
id: 'share1',
|
||||
name: 'My Share',
|
||||
isDisabled: false,
|
||||
rootFolderId: 'folder1',
|
||||
projectId: 'project1',
|
||||
password: null,
|
||||
expireAt: null,
|
||||
watermarkConfigId: 'cfg1',
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any)
|
||||
vi.spyOn(assetService, 'listChildren').mockResolvedValue({
|
||||
data: [
|
||||
{
|
||||
id: 'video-ready',
|
||||
name: 'a.mp4',
|
||||
sizeByte: 1,
|
||||
fileCount: 0,
|
||||
type: 'file',
|
||||
status: 'processed',
|
||||
proxyType: 'video',
|
||||
media: {
|
||||
proxyType: 'video',
|
||||
videoTranscodes: [
|
||||
{
|
||||
id: 'orig',
|
||||
url: 'u',
|
||||
key: 'files/orig.mp4',
|
||||
width: 640,
|
||||
height: 360,
|
||||
size: 1,
|
||||
isRaw: false,
|
||||
},
|
||||
],
|
||||
imageTranscodes: [],
|
||||
original: { downloadUrl: 'u', key: 'files/orig.mp4' },
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'video-pending',
|
||||
name: 'b.mp4',
|
||||
sizeByte: 1,
|
||||
fileCount: 0,
|
||||
type: 'file',
|
||||
status: 'processed',
|
||||
proxyType: 'video',
|
||||
media: {
|
||||
proxyType: 'video',
|
||||
videoTranscodes: [
|
||||
{
|
||||
id: 'orig',
|
||||
url: 'u',
|
||||
key: 'files/orig.mp4',
|
||||
width: 640,
|
||||
height: 360,
|
||||
size: 1,
|
||||
isRaw: false,
|
||||
},
|
||||
],
|
||||
imageTranscodes: [],
|
||||
original: { downloadUrl: 'u', key: 'files/orig.mp4' },
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'doc',
|
||||
name: 'c.pdf',
|
||||
sizeByte: 1,
|
||||
fileCount: 0,
|
||||
type: 'file',
|
||||
status: 'processed',
|
||||
proxyType: 'pdf',
|
||||
media: {
|
||||
proxyType: 'pdf',
|
||||
pdfTranscode: { url: 'u', key: 'files/doc.pdf' },
|
||||
videoTranscodes: [],
|
||||
imageTranscodes: [],
|
||||
original: { downloadUrl: 'u', key: 'files/doc.pdf' },
|
||||
},
|
||||
},
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
] as any,
|
||||
pageInfo: { total: 3, cursor: undefined },
|
||||
})
|
||||
vi.spyOn(assetService, 'resolveTargetAssetId').mockImplementation(async (id) => id)
|
||||
vi.spyOn(s3Service, 'presign').mockResolvedValue('http://s3/presigned')
|
||||
vi.spyOn(watermarkService, 'getCompletedWatermarkMediaMap').mockResolvedValue(
|
||||
new Map([
|
||||
[
|
||||
'video-ready',
|
||||
watermarkMediaInfo({
|
||||
videoTranscodes: [{ key: 'files/wm-a.mp4', width: 640, height: 360 }],
|
||||
}),
|
||||
],
|
||||
]),
|
||||
)
|
||||
|
||||
const res = await app.request('/shares/share1/folders/folder1/children?assetType=file', {
|
||||
method: 'GET',
|
||||
headers: { 'x-share-password': 'pass' },
|
||||
})
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
const body = await res.json()
|
||||
// Ready item → watermarked proxy
|
||||
expect(body.data[0].media.videoTranscodes).toEqual([
|
||||
{
|
||||
id: 'files/wm-a.mp4',
|
||||
url: 'http://s3/presigned',
|
||||
key: 'files/wm-a.mp4',
|
||||
width: 640,
|
||||
height: 360,
|
||||
size: 0,
|
||||
isRaw: false,
|
||||
},
|
||||
])
|
||||
// Pending item → original transcodes emptied
|
||||
expect(body.data[1].media.videoTranscodes).toEqual([])
|
||||
expect(body.data[1].media.imageTranscodes).toEqual([])
|
||||
// Non-media item → untouched
|
||||
expect(body.data[2].media.pdfTranscode).toEqual({ url: 'u', key: 'files/doc.pdf' })
|
||||
})
|
||||
})
|
||||
|
||||
describe('GET /shares/:shareId/files/:fileId', () => {
|
||||
const shareLinkWithWatermark = {
|
||||
id: 'share1',
|
||||
name: 'My Share',
|
||||
isDisabled: false,
|
||||
rootFolderId: 'folder1',
|
||||
projectId: 'project1',
|
||||
password: null,
|
||||
expireAt: null,
|
||||
watermarkConfigId: 'cfg1',
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any
|
||||
|
||||
const videoAsset = {
|
||||
id: 'file1',
|
||||
name: 'video.mp4',
|
||||
sizeByte: 1024,
|
||||
fileCount: 0,
|
||||
type: 'file',
|
||||
status: 'processed',
|
||||
proxyType: 'video',
|
||||
media: {
|
||||
proxyType: 'video',
|
||||
videoTranscodes: [
|
||||
{
|
||||
id: 'orig-360p',
|
||||
url: 'http://s3/original-360p',
|
||||
key: 'files/original-360p.mp4',
|
||||
width: 640,
|
||||
height: 360,
|
||||
size: 100,
|
||||
isRaw: false,
|
||||
},
|
||||
],
|
||||
imageTranscodes: [],
|
||||
original: { downloadUrl: 'http://s3/original', key: 'files/original.mp4' },
|
||||
},
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any
|
||||
|
||||
beforeEach(() => {
|
||||
vi.spyOn(assetService, 'getAsset').mockResolvedValue(videoAsset)
|
||||
vi.spyOn(assetService, 'resolveTargetAssetId').mockResolvedValue('file1')
|
||||
vi.spyOn(s3Service, 'presign').mockResolvedValue('http://s3/presigned')
|
||||
})
|
||||
|
||||
test('serves watermarked transcodes when watermark enabled and completed', async () => {
|
||||
vi.spyOn(shareService, 'verifyPublicAccess').mockResolvedValue(shareLinkWithWatermark)
|
||||
vi.spyOn(watermarkService, 'getCompletedWatermarkMediaMap').mockResolvedValue(
|
||||
new Map([
|
||||
[
|
||||
'file1',
|
||||
watermarkMediaInfo({
|
||||
videoTranscodes: [{ key: 'files/watermarked-360p.mp4', width: 640, height: 360 }],
|
||||
}),
|
||||
],
|
||||
]),
|
||||
)
|
||||
|
||||
const res = await app.request('/shares/share1/files/file1', {
|
||||
method: 'GET',
|
||||
headers: { 'x-share-password': 'pass' },
|
||||
})
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
const body = await res.json()
|
||||
expect(body.media.videoTranscodes).toEqual([
|
||||
{
|
||||
id: 'files/watermarked-360p.mp4',
|
||||
url: 'http://s3/presigned',
|
||||
key: 'files/watermarked-360p.mp4',
|
||||
width: 640,
|
||||
height: 360,
|
||||
size: 0,
|
||||
isRaw: false,
|
||||
},
|
||||
])
|
||||
expect(body.media.imageTranscodes).toEqual([])
|
||||
})
|
||||
|
||||
test('serves empty transcode arrays while watermark transcoding is in flight', async () => {
|
||||
vi.spyOn(shareService, 'verifyPublicAccess').mockResolvedValue(shareLinkWithWatermark)
|
||||
vi.spyOn(watermarkService, 'getCompletedWatermarkMediaMap').mockResolvedValue(new Map())
|
||||
|
||||
const res = await app.request('/shares/share1/files/file1', {
|
||||
method: 'GET',
|
||||
headers: { 'x-share-password': 'pass' },
|
||||
})
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
const body = await res.json()
|
||||
expect(body.media.videoTranscodes).toEqual([])
|
||||
expect(body.media.imageTranscodes).toEqual([])
|
||||
})
|
||||
|
||||
test('leaves non-video/image media untouched when watermark enabled', async () => {
|
||||
vi.spyOn(shareService, 'verifyPublicAccess').mockResolvedValue(shareLinkWithWatermark)
|
||||
vi.spyOn(assetService, 'getAsset').mockResolvedValue({
|
||||
id: 'file1',
|
||||
name: 'doc.pdf',
|
||||
sizeByte: 1024,
|
||||
fileCount: 0,
|
||||
type: 'file',
|
||||
status: 'processed',
|
||||
proxyType: 'pdf',
|
||||
media: {
|
||||
proxyType: 'pdf',
|
||||
pdfTranscode: { url: 'http://s3/doc', key: 'files/doc.pdf' },
|
||||
videoTranscodes: [],
|
||||
imageTranscodes: [],
|
||||
original: { downloadUrl: 'http://s3/doc-original', key: 'files/doc.pdf' },
|
||||
},
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any)
|
||||
const resolveSpy = vi.spyOn(assetService, 'resolveTargetAssetId')
|
||||
const wfSpy = vi.spyOn(watermarkService, 'getCompletedWatermarkMediaMap')
|
||||
|
||||
const res = await app.request('/shares/share1/files/file1', {
|
||||
method: 'GET',
|
||||
headers: { 'x-share-password': 'pass' },
|
||||
})
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
const body = await res.json()
|
||||
expect(body.media.pdfTranscode).toEqual({ url: 'http://s3/doc', key: 'files/doc.pdf' })
|
||||
expect(resolveSpy).not.toHaveBeenCalled()
|
||||
expect(wfSpy).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
test('serves original media unchanged when watermark disabled', async () => {
|
||||
vi.spyOn(shareService, 'verifyPublicAccess').mockResolvedValue({
|
||||
id: 'share1',
|
||||
name: 'My Share',
|
||||
isDisabled: false,
|
||||
rootFolderId: 'folder1',
|
||||
projectId: 'project1',
|
||||
password: null,
|
||||
expireAt: null,
|
||||
watermarkConfigId: null,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any)
|
||||
const wfSpy = vi.spyOn(watermarkService, 'getCompletedWatermarkMediaMap')
|
||||
|
||||
const res = await app.request('/shares/share1/files/file1', {
|
||||
method: 'GET',
|
||||
headers: { 'x-share-password': 'pass' },
|
||||
})
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
const body = await res.json()
|
||||
expect(body.media.videoTranscodes).toEqual([
|
||||
{
|
||||
id: 'orig-360p',
|
||||
url: 'http://s3/original-360p',
|
||||
key: 'files/original-360p.mp4',
|
||||
width: 640,
|
||||
height: 360,
|
||||
size: 100,
|
||||
isRaw: false,
|
||||
},
|
||||
])
|
||||
expect(wfSpy).not.toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
|
||||
// Protected Routes
|
||||
@@ -326,4 +646,101 @@ describe('Share API', () => {
|
||||
expect(shareService.addAssetToShare).toHaveBeenCalledWith('share1', { assetIds: ['asset1'] })
|
||||
})
|
||||
})
|
||||
|
||||
describe('Watermark API', () => {
|
||||
test('PUT /shares/:shareId/watermark success', async () => {
|
||||
const { watermarkService } = await import('@shumai/core/src/watermark/watermark')
|
||||
vi.spyOn(watermarkService, 'updateShareLinkWatermark').mockResolvedValue({
|
||||
id: 'share1',
|
||||
name: 'test-share',
|
||||
isDisabled: false,
|
||||
rootFolderId: 'root1',
|
||||
projectId: 'project1',
|
||||
isExpired: false,
|
||||
hasPassword: false,
|
||||
watermarkStatus: 'processing',
|
||||
watermarkConfigId: 'cfg1',
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
})
|
||||
|
||||
const res = await app.request('/shares/share1/watermark', {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
enabled: true,
|
||||
config: {
|
||||
blocks: [
|
||||
{
|
||||
id: 'b1',
|
||||
type: 'text',
|
||||
x: 0.5,
|
||||
y: 0.5,
|
||||
opacity: 0.5,
|
||||
rotation: 0,
|
||||
text: 'TEST',
|
||||
size: 0.1,
|
||||
color: '#FFF',
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
})
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
const body = await res.json()
|
||||
expect(body.watermarkStatus).toBe('processing')
|
||||
})
|
||||
|
||||
test('PUT /shares/:shareId/watermark conflict 409', async () => {
|
||||
const { watermarkService } = await import('@shumai/core/src/watermark/watermark')
|
||||
const { ShareLinkWatermarkProcessingError } = await import('@shumai/core/src/share/errors')
|
||||
vi.spyOn(watermarkService, 'updateShareLinkWatermark').mockRejectedValue(
|
||||
new ShareLinkWatermarkProcessingError(),
|
||||
)
|
||||
|
||||
const res = await app.request('/shares/share1/watermark', {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ enabled: false }),
|
||||
})
|
||||
|
||||
expect(res.status).toBe(409)
|
||||
const body = await res.json()
|
||||
expect(body.error).toBe('Watermark transcoding is currently in progress')
|
||||
})
|
||||
|
||||
test('PUT /shares/:shareId/watermark without config when enabled returns 400', async () => {
|
||||
const res = await app.request('/shares/share1/watermark', {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ enabled: true }),
|
||||
})
|
||||
|
||||
expect(res.status).toBe(400)
|
||||
})
|
||||
|
||||
test('GET /shares/:shareId/watermark success', async () => {
|
||||
const { watermarkService } = await import('@shumai/core/src/watermark/watermark')
|
||||
vi.spyOn(watermarkService, 'getShareLinkWatermark').mockResolvedValue({
|
||||
watermarkStatus: 'ready',
|
||||
watermarkConfig: {
|
||||
id: 'cfg1',
|
||||
config: { blocks: [] },
|
||||
hash: 'h1',
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
},
|
||||
})
|
||||
|
||||
const res = await app.request('/shares/share1/watermark', {
|
||||
method: 'GET',
|
||||
})
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
const body = await res.json()
|
||||
expect(body.watermarkStatus).toBe('ready')
|
||||
expect(body.watermarkConfig.hash).toBe('h1')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -8,10 +8,16 @@ import {
|
||||
updateShareLinkRequestSchema,
|
||||
listShareLinksRequestSchema,
|
||||
addAssetToShareRequestSchema,
|
||||
updateShareLinkWatermarkRequestSchema,
|
||||
AuditAction,
|
||||
} from '@shumai/dtos'
|
||||
import type { Prisma } from '@shumai/db'
|
||||
import { auditLogService } from '@shumai/core/src/auditLog/auditLog'
|
||||
import { watermarkService } from '@shumai/core/src/watermark/watermark'
|
||||
import {
|
||||
ShareLinkNotFoundError,
|
||||
ShareLinkWatermarkProcessingError,
|
||||
} from '@shumai/core/src/share/errors'
|
||||
|
||||
type User = Prisma.UserGetPayload<Record<string, never>>
|
||||
|
||||
@@ -183,5 +189,52 @@ const route = new Hono<{ Variables: { user: User } }>()
|
||||
await shareService.removeAssetFromShare(shareId, assetId)
|
||||
return c.body(null, 204)
|
||||
})
|
||||
.put(
|
||||
'/shares/:shareId/watermark',
|
||||
zValidator('json', updateShareLinkWatermarkRequestSchema),
|
||||
async (c) => {
|
||||
const shareId = c.req.param('shareId')
|
||||
const user = c.get('user')
|
||||
const req = c.req.valid('json')
|
||||
|
||||
await authzService.hasPermission({
|
||||
user,
|
||||
permission: Permission.Edit,
|
||||
type: ResourceType.Share,
|
||||
id: shareId,
|
||||
})
|
||||
|
||||
try {
|
||||
const updated = await watermarkService.updateShareLinkWatermark(
|
||||
shareId,
|
||||
req.enabled,
|
||||
req.config,
|
||||
)
|
||||
return c.json(updated)
|
||||
} catch (err) {
|
||||
if (err instanceof ShareLinkWatermarkProcessingError) {
|
||||
return c.json({ error: err.message }, 409)
|
||||
}
|
||||
if (err instanceof ShareLinkNotFoundError) {
|
||||
return c.json({ error: err.message }, 404)
|
||||
}
|
||||
throw err
|
||||
}
|
||||
},
|
||||
)
|
||||
.get('/shares/:shareId/watermark', async (c) => {
|
||||
const shareId = c.req.param('shareId')
|
||||
const user = c.get('user')
|
||||
|
||||
await authzService.hasPermission({
|
||||
user,
|
||||
permission: Permission.Read,
|
||||
type: ResourceType.Share,
|
||||
id: shareId,
|
||||
})
|
||||
|
||||
const res = await watermarkService.getShareLinkWatermark(shareId)
|
||||
return c.json(res)
|
||||
})
|
||||
|
||||
export default route
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
import { describe, expect, test, vi, beforeEach } from 'vitest'
|
||||
import { Hono } from 'hono'
|
||||
import watermarkTemplateRoute from './watermark-template'
|
||||
import { authMiddleware } from './middleware/auth'
|
||||
import { authzService } from '@shumai/core/src/authz/authz'
|
||||
import { watermarkService } from '@shumai/core/src/watermark/watermark'
|
||||
import { teamService } from '@shumai/core/src/team/team'
|
||||
|
||||
vi.mock('./middleware/auth', () => ({
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
authMiddleware: async (c: any, next: any) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
c.set('user', { id: 'user1', name: 'Test User' } as any)
|
||||
await next()
|
||||
},
|
||||
}))
|
||||
|
||||
vi.mock('@shumai/core/src/authz/authz', () => ({
|
||||
authzService: {
|
||||
hasPermission: vi.fn().mockResolvedValue(undefined),
|
||||
},
|
||||
Permission: {
|
||||
Read: 'Read',
|
||||
Edit: 'Edit',
|
||||
Admin: 'Admin',
|
||||
},
|
||||
ResourceType: {
|
||||
Team: 'team',
|
||||
},
|
||||
}))
|
||||
|
||||
describe('Watermark Template API', () => {
|
||||
const app = new Hono().use('*', authMiddleware).route('/', watermarkTemplateRoute)
|
||||
|
||||
beforeEach(() => {
|
||||
vi.restoreAllMocks()
|
||||
vi.mocked(authzService.hasPermission).mockResolvedValue(undefined)
|
||||
})
|
||||
|
||||
test('GET /watermark-templates', async () => {
|
||||
vi.spyOn(watermarkService, 'listTemplates').mockResolvedValue([
|
||||
{
|
||||
id: 'tpl1',
|
||||
name: 'Preset 1',
|
||||
config: { blocks: [] },
|
||||
teamId: 't1',
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
},
|
||||
])
|
||||
|
||||
const res = await app.request('/watermark-templates?teamId=t1', {
|
||||
method: 'GET',
|
||||
})
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
const body = await res.json()
|
||||
expect(body).toHaveLength(1)
|
||||
expect(body[0].name).toBe('Preset 1')
|
||||
})
|
||||
|
||||
test("GET /watermark-templates without teamId scopes to the caller's teams", async () => {
|
||||
vi.spyOn(teamService, 'getUserTeams').mockResolvedValue({
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
data: [{ id: 't1', name: 'My Team' }] as any,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
pageInfo: {} as any,
|
||||
})
|
||||
vi.spyOn(watermarkService, 'listTemplates').mockResolvedValue([])
|
||||
|
||||
const res = await app.request('/watermark-templates', {
|
||||
method: 'GET',
|
||||
})
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
expect(watermarkService.listTemplates).toHaveBeenCalledWith(['t1'])
|
||||
})
|
||||
|
||||
test('POST /watermark-templates', async () => {
|
||||
vi.spyOn(teamService, 'getUserTeams').mockResolvedValue({
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
data: [{ id: 't1', name: 'My Team' }] as any,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
pageInfo: {} as any,
|
||||
})
|
||||
vi.spyOn(watermarkService, 'createTemplate').mockResolvedValue({
|
||||
id: 'tpl1',
|
||||
name: 'New Preset',
|
||||
config: { blocks: [] },
|
||||
teamId: 't1',
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
})
|
||||
|
||||
const res = await app.request('/watermark-templates', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
name: 'New Preset',
|
||||
config: { blocks: [] },
|
||||
}),
|
||||
})
|
||||
|
||||
expect(res.status).toBe(201)
|
||||
const body = await res.json()
|
||||
expect(body.name).toBe('New Preset')
|
||||
})
|
||||
|
||||
test('DELETE /watermark-templates/:templateId', async () => {
|
||||
vi.spyOn(watermarkService, 'getTemplate').mockResolvedValue({
|
||||
id: 'tpl1',
|
||||
name: 'New Preset',
|
||||
config: { blocks: [] },
|
||||
teamId: 't1',
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
})
|
||||
vi.spyOn(watermarkService, 'deleteTemplate').mockResolvedValue(undefined)
|
||||
|
||||
const res = await app.request('/watermark-templates/tpl1', {
|
||||
method: 'DELETE',
|
||||
})
|
||||
|
||||
expect(res.status).toBe(204)
|
||||
expect(watermarkService.deleteTemplate).toHaveBeenCalledWith('tpl1')
|
||||
})
|
||||
|
||||
test('DELETE /watermark-templates/:templateId on a teamless template returns 403', async () => {
|
||||
vi.spyOn(watermarkService, 'getTemplate').mockResolvedValue({
|
||||
id: 'tpl-global',
|
||||
name: 'Platform Preset',
|
||||
config: { blocks: [] },
|
||||
teamId: null,
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
})
|
||||
vi.spyOn(watermarkService, 'deleteTemplate').mockResolvedValue(undefined)
|
||||
|
||||
const res = await app.request('/watermark-templates/tpl-global', {
|
||||
method: 'DELETE',
|
||||
})
|
||||
|
||||
expect(res.status).toBe(403)
|
||||
expect(watermarkService.deleteTemplate).not.toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,145 @@
|
||||
import { Hono } from 'hono'
|
||||
import { zValidator } from '@hono/zod-validator'
|
||||
import { authzService, Permission, ResourceType } from '@shumai/core/src/authz/authz'
|
||||
import { teamService } from '@shumai/core/src/team/team'
|
||||
import { watermarkService } from '@shumai/core/src/watermark/watermark'
|
||||
import {
|
||||
createWatermarkTemplateRequestSchema,
|
||||
updateWatermarkTemplateRequestSchema,
|
||||
} from '@shumai/dtos'
|
||||
import { z } from 'zod'
|
||||
import type { Prisma } from '@shumai/db'
|
||||
|
||||
type User = Prisma.UserGetPayload<Record<string, never>>
|
||||
|
||||
const listTemplatesQuerySchema = z.object({
|
||||
teamId: z.string().optional(),
|
||||
})
|
||||
|
||||
const route = new Hono<{ Variables: { user: User } }>()
|
||||
.get('/watermark-templates', zValidator('query', listTemplatesQuerySchema), async (c) => {
|
||||
const user = c.get('user')
|
||||
const { teamId } = c.req.valid('query')
|
||||
|
||||
let teamIds: string[]
|
||||
if (teamId) {
|
||||
await authzService.hasPermission({
|
||||
user,
|
||||
permission: Permission.Read,
|
||||
type: ResourceType.Team,
|
||||
id: teamId,
|
||||
})
|
||||
teamIds = [teamId]
|
||||
} else {
|
||||
// No teamId: scope to the caller's own teams so templates are never
|
||||
// leaked across tenants.
|
||||
const userTeams = await teamService.getUserTeams({
|
||||
userId: user.id,
|
||||
pagination: { first: 20 },
|
||||
})
|
||||
teamIds = userTeams.data.map((t) => t.id)
|
||||
}
|
||||
|
||||
const templates = await watermarkService.listTemplates(teamIds)
|
||||
return c.json(templates)
|
||||
})
|
||||
.get('/watermark-templates/:templateId', async (c) => {
|
||||
const templateId = c.req.param('templateId')
|
||||
const template = await watermarkService.getTemplate(templateId)
|
||||
|
||||
if (template.teamId) {
|
||||
const user = c.get('user')
|
||||
await authzService.hasPermission({
|
||||
user,
|
||||
permission: Permission.Read,
|
||||
type: ResourceType.Team,
|
||||
id: template.teamId,
|
||||
})
|
||||
}
|
||||
// Teamless templates are shared platform defaults: readable by any
|
||||
// authenticated user, but not writable (enforced on PUT/DELETE).
|
||||
|
||||
return c.json(template)
|
||||
})
|
||||
.post(
|
||||
'/watermark-templates',
|
||||
zValidator('json', createWatermarkTemplateRequestSchema),
|
||||
async (c) => {
|
||||
const user = c.get('user')
|
||||
const req = c.req.valid('json')
|
||||
|
||||
let teamId: string | null
|
||||
if (req.teamId) {
|
||||
await authzService.hasPermission({
|
||||
user,
|
||||
permission: Permission.Edit,
|
||||
type: ResourceType.Team,
|
||||
id: req.teamId,
|
||||
})
|
||||
teamId = req.teamId
|
||||
} else {
|
||||
const userTeams = await teamService.getUserTeams({
|
||||
userId: user.id,
|
||||
pagination: { first: 20 },
|
||||
})
|
||||
teamId = userTeams.data[0]?.id || null
|
||||
if (!teamId) {
|
||||
return c.json({ error: 'A team is required to create a watermark template' }, 400)
|
||||
}
|
||||
await authzService.hasPermission({
|
||||
user,
|
||||
permission: Permission.Edit,
|
||||
type: ResourceType.Team,
|
||||
id: teamId,
|
||||
})
|
||||
}
|
||||
|
||||
const template = await watermarkService.createTemplate(teamId, req.name, req.config)
|
||||
return c.json(template, 201)
|
||||
},
|
||||
)
|
||||
.put(
|
||||
'/watermark-templates/:templateId',
|
||||
zValidator('json', updateWatermarkTemplateRequestSchema),
|
||||
async (c) => {
|
||||
const templateId = c.req.param('templateId')
|
||||
const user = c.get('user')
|
||||
const req = c.req.valid('json')
|
||||
|
||||
const existing = await watermarkService.getTemplate(templateId)
|
||||
if (existing.teamId) {
|
||||
await authzService.hasPermission({
|
||||
user,
|
||||
permission: Permission.Edit,
|
||||
type: ResourceType.Team,
|
||||
id: existing.teamId,
|
||||
})
|
||||
} else {
|
||||
return c.json({ error: 'Platform templates are read-only' }, 403)
|
||||
}
|
||||
|
||||
const updated = await watermarkService.updateTemplate(templateId, req.name, req.config)
|
||||
return c.json(updated)
|
||||
},
|
||||
)
|
||||
.delete('/watermark-templates/:templateId', async (c) => {
|
||||
const templateId = c.req.param('templateId')
|
||||
const user = c.get('user')
|
||||
|
||||
const existing = await watermarkService.getTemplate(templateId)
|
||||
if (existing.teamId) {
|
||||
await authzService.hasPermission({
|
||||
user,
|
||||
permission: Permission.Edit,
|
||||
type: ResourceType.Team,
|
||||
id: existing.teamId,
|
||||
})
|
||||
} else {
|
||||
return c.json({ error: 'Platform templates are read-only' }, 403)
|
||||
}
|
||||
|
||||
await watermarkService.deleteTemplate(templateId)
|
||||
return c.body(null, 204)
|
||||
})
|
||||
|
||||
export default route
|
||||
@@ -22,6 +22,7 @@ import { HTTPException } from 'hono/http-exception'
|
||||
import { logger } from '@shumai/core/src/logger'
|
||||
import { PaginatedData, paginateQuery, PaginationParams } from '@shumai/core/src/pagination'
|
||||
import { s3Service } from '@shumai/core/src/s3/s3'
|
||||
import { watermarkService } from '@shumai/core/src/watermark/watermark'
|
||||
import { generateKeyBetween } from 'jittered-fractional-indexing'
|
||||
import { getAvatarUrl } from '@shumai/core/src/user/avatar'
|
||||
|
||||
@@ -1104,6 +1105,7 @@ export class AssetService {
|
||||
await this.expireTrashedAssets()
|
||||
await this.purgePendingAssets()
|
||||
await this.purgeUnreferencedStorageKeys()
|
||||
await watermarkService.purgeOrphanWatermarkConfigs()
|
||||
} catch (e: unknown) {
|
||||
console.error('Error in asset cleanup job:', e)
|
||||
}
|
||||
|
||||
@@ -23,3 +23,4 @@ export * from './hyrumtoken'
|
||||
export * from './pagination'
|
||||
export * from './chat/chat'
|
||||
export * from './ai-usage/ai-usage'
|
||||
export * from './watermark/watermark'
|
||||
|
||||
@@ -29,3 +29,11 @@ export class ShareLinkPasswordInvalidError extends Error {
|
||||
Object.setPrototypeOf(this, ShareLinkPasswordInvalidError.prototype)
|
||||
}
|
||||
}
|
||||
|
||||
export class ShareLinkWatermarkProcessingError extends Error {
|
||||
constructor(message = 'Watermark transcoding is currently in progress') {
|
||||
super(message)
|
||||
this.name = 'ShareLinkWatermarkProcessingError'
|
||||
Object.setPrototypeOf(this, ShareLinkWatermarkProcessingError.prototype)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,11 @@ import {
|
||||
UpdateShareLinkRequest,
|
||||
ListShareLinksRequest,
|
||||
AddAssetToShareRequest,
|
||||
WatermarkConfigSpec,
|
||||
} from '@shumai/dtos'
|
||||
import { PaginatedData, paginateQuery } from '@shumai/core/src/pagination'
|
||||
import { getAvatarUrl } from '@shumai/core/src/user/avatar'
|
||||
import { watermarkService } from '@shumai/core/src/watermark/watermark'
|
||||
import {
|
||||
ShareLinkNotFoundError,
|
||||
ShareLinkDisabledError,
|
||||
@@ -144,13 +146,16 @@ export class ShareService {
|
||||
)
|
||||
}
|
||||
|
||||
async getShareLink(shareLinkId: string): Promise<ShareLinkInfo> {
|
||||
const shareLink = await prisma.shareLink.findUnique({
|
||||
async getShareLink(
|
||||
shareLinkId: string,
|
||||
client: Prisma.TransactionClient | typeof prisma = prisma,
|
||||
): Promise<ShareLinkInfo> {
|
||||
const shareLink = await client.shareLink.findUnique({
|
||||
where: { id: shareLinkId },
|
||||
include: { creator: true },
|
||||
})
|
||||
if (!shareLink) throw new ShareLinkNotFoundError('Share link not found')
|
||||
return await this.toShareLinkInfo(shareLink)
|
||||
return await this.toShareLinkInfo(shareLink, client)
|
||||
}
|
||||
|
||||
async addAssetToShare(shareLinkId: string, req: AddAssetToShareRequest): Promise<number> {
|
||||
@@ -202,6 +207,17 @@ export class ShareService {
|
||||
})
|
||||
})
|
||||
|
||||
if (shareLink.watermarkConfigId) {
|
||||
await prisma.shareLink.update({
|
||||
where: { id: shareLinkId },
|
||||
data: { watermarkStatus: 'processing' },
|
||||
})
|
||||
await watermarkService.triggerWatermarkTranscodeForShareLink(
|
||||
shareLinkId,
|
||||
shareLink.watermarkConfigId,
|
||||
)
|
||||
}
|
||||
|
||||
return idsToAdd.length
|
||||
}
|
||||
|
||||
@@ -297,10 +313,18 @@ export class ShareService {
|
||||
return shareLink
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
private async toShareLinkInfo(l: any): Promise<ShareLinkInfo> {
|
||||
private async toShareLinkInfo(
|
||||
l: Prisma.ShareLinkGetPayload<{ include: { creator: true } }>,
|
||||
client: Prisma.TransactionClient | typeof prisma = prisma,
|
||||
): Promise<ShareLinkInfo> {
|
||||
const isExpired = l.expireAt ? new Date(l.expireAt) < new Date() : false
|
||||
const avatarUrl = l.creator ? await getAvatarUrl(l.creator.image) : undefined
|
||||
let watermarkConfig: Prisma.WatermarkConfigGetPayload<Record<string, never>> | null = null
|
||||
if (l.watermarkConfigId) {
|
||||
watermarkConfig = await client.watermarkConfig.findUnique({
|
||||
where: { id: l.watermarkConfigId },
|
||||
})
|
||||
}
|
||||
return {
|
||||
id: l.id,
|
||||
name: l.name,
|
||||
@@ -308,12 +332,23 @@ export class ShareService {
|
||||
isDisabled: l.isDisabled,
|
||||
hasPassword: !!l.password,
|
||||
password: l.password,
|
||||
defaultSortOrder: l.defaultSortOrder,
|
||||
viewMode: l.viewMode,
|
||||
defaultSortOrder: l.defaultSortOrder ?? undefined,
|
||||
viewMode: l.viewMode ?? undefined,
|
||||
fieldVisibility: l.fieldVisibility as Record<string, boolean> | undefined,
|
||||
rootFolderId: l.rootFolderId,
|
||||
projectId: l.projectId,
|
||||
isExpired,
|
||||
watermarkConfigId: l.watermarkConfigId,
|
||||
watermarkStatus: l.watermarkStatus || 'disabled',
|
||||
watermarkConfig: watermarkConfig
|
||||
? {
|
||||
id: watermarkConfig.id,
|
||||
config: await watermarkService.enrichWatermarkConfigWithPresignedUrls(
|
||||
watermarkConfig.config as WatermarkConfigSpec,
|
||||
),
|
||||
hash: watermarkConfig.hash,
|
||||
}
|
||||
: null,
|
||||
createdAt: l.createdAt.toISOString(),
|
||||
updatedAt: l.updatedAt.toISOString(),
|
||||
creator: l.creator ? { id: l.creator.id, name: l.creator.name, image: avatarUrl } : null,
|
||||
|
||||
@@ -28,6 +28,7 @@ vi.mock('sharp', () => {
|
||||
toColorspace: vi.fn().mockReturnThis(),
|
||||
webp: vi.fn().mockReturnThis(),
|
||||
composite: vi.fn().mockReturnThis(),
|
||||
png: vi.fn().mockReturnThis(),
|
||||
toBuffer: vi.fn().mockResolvedValue(Buffer.from('fake-webp-buffer')),
|
||||
toFile: vi.fn().mockImplementation(async (filePath: string) => {
|
||||
fs.writeFileSync(filePath, 'fake-webp-data')
|
||||
@@ -763,5 +764,55 @@ describe('TranscodeService', () => {
|
||||
const stat = fs.statSync(pdfFile)
|
||||
expect(stat.size).toBeGreaterThan(0)
|
||||
})
|
||||
|
||||
describe('watermark overlay helpers', () => {
|
||||
it('renderSvgToPng should rasterize the SVG to a PNG buffer', async () => {
|
||||
const svg = '<svg xmlns="http://www.w3.org/2000/svg"><text>WM</text></svg>'
|
||||
const result = await transcodeService.renderSvgToPng(svg)
|
||||
expect(Buffer.isBuffer(result)).toBe(true)
|
||||
// sharp was invoked with the SVG bytes
|
||||
expect(sharp).toHaveBeenCalledWith(Buffer.from(svg))
|
||||
})
|
||||
|
||||
it('downscaleImageToPng should resize, normalize to PNG and return dimensions', async () => {
|
||||
const result = await transcodeService.downscaleImageToPng(Buffer.from('raw-image'), 1024)
|
||||
expect(result.buffer).toBeDefined()
|
||||
expect(result.width).toBe(800)
|
||||
expect(result.height).toBe(600)
|
||||
// resize limited to the max dimension without enlargement
|
||||
const resizeCall = vi.mocked(sharp().resize).mock.calls[0] as unknown[]
|
||||
expect(resizeCall[0]).toBe(1024)
|
||||
expect(resizeCall[1]).toBe(1024)
|
||||
expect(resizeCall[2]).toEqual({
|
||||
fit: 'inside',
|
||||
withoutEnlargement: true,
|
||||
})
|
||||
expect(vi.mocked(sharp().png)).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('compositeOverlayToWebpFile should composite the overlay and write a webp file', async () => {
|
||||
const inputPath = path.join(tempDir, 'input.png')
|
||||
const outputPath = path.join(tempDir, 'output.webp')
|
||||
fs.writeFileSync(inputPath, 'fake-input')
|
||||
|
||||
await transcodeService.compositeOverlayToWebpFile(
|
||||
inputPath,
|
||||
Buffer.from('overlay-png'),
|
||||
outputPath,
|
||||
1920,
|
||||
1080,
|
||||
)
|
||||
|
||||
expect(fs.existsSync(outputPath)).toBe(true)
|
||||
expect(vi.mocked(sharp().resize)).toHaveBeenCalledWith(1920, 1080, {
|
||||
fit: 'inside',
|
||||
})
|
||||
expect(vi.mocked(sharp().composite)).toHaveBeenCalledWith([
|
||||
{ input: Buffer.from('overlay-png') },
|
||||
])
|
||||
expect(vi.mocked(sharp().webp)).toHaveBeenCalledWith({ quality: 90 })
|
||||
expect(vi.mocked(sharp().toFile)).toHaveBeenCalledWith(outputPath)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -110,6 +110,7 @@ export interface TranscodeVideoParams {
|
||||
height: number
|
||||
frameRate?: number | string
|
||||
disableAudio?: boolean
|
||||
overlayFile?: string
|
||||
}
|
||||
|
||||
export interface ExtractVideoFramesParams {
|
||||
@@ -339,13 +340,22 @@ export class TranscodeService {
|
||||
}
|
||||
|
||||
async transcodeVideo(params: TranscodeVideoParams): Promise<void> {
|
||||
let filterComplex = `[0:v]scale=w=${params.width}:h=${params.height}:force_original_aspect_ratio=decrease,scale=w='trunc(iw/2)*2':h='trunc(ih/2)*2'`
|
||||
let filterComplex: string
|
||||
const args: string[] = ['-i', params.inputFile]
|
||||
|
||||
if (params.overlayFile) {
|
||||
args.push('-i', params.overlayFile)
|
||||
filterComplex = `[0:v]scale=${params.width}:${params.height}[vscaled];[vscaled][1:v]overlay=0:0`
|
||||
} else {
|
||||
filterComplex = `[0:v]scale=w=${params.width}:h=${params.height}:force_original_aspect_ratio=decrease,scale=w='trunc(iw/2)*2':h='trunc(ih/2)*2'`
|
||||
}
|
||||
|
||||
if (params.frameRate) {
|
||||
filterComplex += `,fps=${params.frameRate}`
|
||||
}
|
||||
filterComplex += '[vout]'
|
||||
|
||||
const args = ['-i', params.inputFile, '-filter_complex', filterComplex, '-map', '[vout]']
|
||||
args.push('-filter_complex', filterComplex, '-map', '[vout]')
|
||||
|
||||
if (params.frameRate) {
|
||||
let calculatedFps: number
|
||||
@@ -1148,6 +1158,55 @@ export class TranscodeService {
|
||||
this.removeDir(tmpDir)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders an SVG string to a PNG buffer. Used by the watermark workflow to
|
||||
* rasterize the overlay before compositing it onto images or feeding it to
|
||||
* ffmpeg for video overlays.
|
||||
*/
|
||||
async renderSvgToPng(svgString: string): Promise<Buffer> {
|
||||
return sharp(Buffer.from(svgString)).png().toBuffer()
|
||||
}
|
||||
|
||||
/**
|
||||
* Downscales an image buffer to a bounded size and normalizes it to PNG.
|
||||
* Used for watermark block images embedded into the SVG overlay, so large
|
||||
* logo assets don't balloon the SVG/base64 payload.
|
||||
*/
|
||||
async downscaleImageToPng(
|
||||
buffer: Buffer,
|
||||
maxDimension: number,
|
||||
): Promise<{ buffer: Buffer; width: number; height: number }> {
|
||||
const processed = await sharp(buffer, { limitInputPixels: false })
|
||||
.resize(maxDimension, maxDimension, { fit: 'inside', withoutEnlargement: true })
|
||||
.png()
|
||||
.toBuffer()
|
||||
const meta = await sharp(processed).metadata()
|
||||
return {
|
||||
buffer: processed,
|
||||
width: meta.width || 100,
|
||||
height: meta.height || 100,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Composites an overlay PNG onto an image file and writes a WebP file.
|
||||
* Used by the watermark workflow to produce watermarked image proxies.
|
||||
*/
|
||||
async compositeOverlayToWebpFile(
|
||||
inputPath: string,
|
||||
overlayPngBuffer: Buffer,
|
||||
outputPath: string,
|
||||
width: number,
|
||||
height: number,
|
||||
): Promise<void> {
|
||||
await sharp(inputPath, { limitInputPixels: false })
|
||||
.toColorspace('srgb')
|
||||
.resize(width, height, { fit: 'inside' })
|
||||
.composite([{ input: overlayPngBuffer }])
|
||||
.webp({ quality: 90 })
|
||||
.toFile(outputPath)
|
||||
}
|
||||
}
|
||||
|
||||
function renderAnnotationsToSvg(
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import type { WatermarkConfigSpec } from '@shumai/dtos'
|
||||
|
||||
export function computeWatermarkConfigHash(config: WatermarkConfigSpec): string {
|
||||
const blockStrings = config.blocks.map((block) => {
|
||||
if (block.type === 'text') {
|
||||
return `text|x:${block.x.toFixed(4)}|y:${block.y.toFixed(4)}|op:${block.opacity.toFixed(2)}|rot:${block.rotation.toFixed(2)}|sz:${block.size.toFixed(4)}|col:${block.color.toLowerCase()}|txt:${block.text}`
|
||||
} else {
|
||||
return `image|x:${block.x.toFixed(4)}|y:${block.y.toFixed(4)}|op:${block.opacity.toFixed(2)}|rot:${block.rotation.toFixed(2)}|sz:${block.size.toFixed(4)}|img:${block.imageAssetKey}`
|
||||
}
|
||||
})
|
||||
blockStrings.sort()
|
||||
const str = blockStrings.join(';')
|
||||
return Bun.hash(str).toString(16)
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
import type { WatermarkConfigSpec } from '@shumai/dtos'
|
||||
|
||||
export interface RenderBlockImageData {
|
||||
imageAssetKey: string
|
||||
base64Data: string
|
||||
mimeType: string
|
||||
width: number
|
||||
height: number
|
||||
}
|
||||
|
||||
function escapeXml(unsafe: string): string {
|
||||
return unsafe
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''')
|
||||
}
|
||||
|
||||
export function generateWatermarkSvg(
|
||||
config: WatermarkConfigSpec,
|
||||
canvasWidth: number,
|
||||
canvasHeight: number,
|
||||
blockImagesMap: Map<string, RenderBlockImageData> = new Map(),
|
||||
): string {
|
||||
const elements: string[] = []
|
||||
|
||||
for (const block of config.blocks) {
|
||||
const cx = canvasWidth * block.x
|
||||
const cy = canvasHeight * block.y
|
||||
const opacity = Math.max(0, Math.min(1, block.opacity))
|
||||
const rotation = block.rotation || 0
|
||||
|
||||
if (block.type === 'text') {
|
||||
// block.size is a FRACTION of the canvas width (0..1), so the watermark
|
||||
// scales proportionally with the output resolution. The editor must store
|
||||
// size as a fraction too (it converts from its %/px UI controls).
|
||||
const fontSize = Math.max(1, Math.round(canvasWidth * block.size))
|
||||
const textContent = escapeXml(block.text || '')
|
||||
const fill = escapeXml(block.color || '#FFFFFF')
|
||||
|
||||
elements.push(
|
||||
`<text x="${cx}" y="${cy}" text-anchor="middle" dominant-baseline="central" font-family="sans-serif" font-size="${fontSize}" font-weight="bold" fill="${fill}" opacity="${opacity}" transform="rotate(${rotation}, ${cx}, ${cy})">${textContent}</text>`,
|
||||
)
|
||||
} else if (block.type === 'image') {
|
||||
const imageData = blockImagesMap.get(block.imageAssetKey)
|
||||
if (!imageData) continue
|
||||
|
||||
// Fraction of canvas width, same as the text blocks above.
|
||||
const targetWidth = Math.max(1, Math.round(canvasWidth * block.size))
|
||||
const aspectRatio = imageData.height > 0 ? imageData.width / imageData.height : 1
|
||||
const targetHeight = Math.max(1, Math.round(targetWidth / aspectRatio))
|
||||
|
||||
const x = cx - targetWidth / 2
|
||||
const y = cy - targetHeight / 2
|
||||
|
||||
elements.push(
|
||||
`<image x="${x}" y="${y}" width="${targetWidth}" height="${targetHeight}" href="data:${imageData.mimeType};base64,${imageData.base64Data}" opacity="${opacity}" transform="rotate(${rotation}, ${cx}, ${cy})"/>`,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return `<svg xmlns="http://www.w3.org/2000/svg" width="${canvasWidth}" height="${canvasHeight}">${elements.join(
|
||||
'\n',
|
||||
)}</svg>`
|
||||
}
|
||||
@@ -0,0 +1,543 @@
|
||||
import { prisma } from '@shumai/db'
|
||||
import { setupTestDbHooks } from '@shumai/db/test'
|
||||
import { watermarkService } from '@shumai/core/src/watermark/watermark'
|
||||
import { generateWatermarkSvg } from '@shumai/core/src/watermark/watermark-svg'
|
||||
import { shareService } from '@shumai/core/src/share/share'
|
||||
import { teamService } from '@shumai/core/src/team/team'
|
||||
import { s3Service } from '@shumai/core/src/s3/s3'
|
||||
import { computeWatermarkConfigHash } from '@shumai/core/src/watermark/watermark-hash'
|
||||
import type { WatermarkConfigSpec } from '@shumai/dtos'
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
|
||||
describe('WatermarkService', () => {
|
||||
setupTestDbHooks()
|
||||
|
||||
const sampleConfig: WatermarkConfigSpec = {
|
||||
blocks: [
|
||||
{
|
||||
id: 'block-1',
|
||||
type: 'text',
|
||||
x: 0.5,
|
||||
y: 0.5,
|
||||
opacity: 0.8,
|
||||
rotation: -30,
|
||||
text: 'CONFIDENTIAL',
|
||||
size: 0.2,
|
||||
color: '#FF0000',
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
it('should compute deterministic hash ignoring block id and block order', () => {
|
||||
const config1: WatermarkConfigSpec = {
|
||||
blocks: [
|
||||
{
|
||||
id: 'b1',
|
||||
type: 'text',
|
||||
x: 0.5,
|
||||
y: 0.5,
|
||||
opacity: 0.5,
|
||||
rotation: 0,
|
||||
text: 'A',
|
||||
size: 0.1,
|
||||
color: '#FFFFFF',
|
||||
},
|
||||
{
|
||||
id: 'b2',
|
||||
type: 'text',
|
||||
x: 0.1,
|
||||
y: 0.1,
|
||||
opacity: 0.9,
|
||||
rotation: 15,
|
||||
text: 'B',
|
||||
size: 0.2,
|
||||
color: '#000000',
|
||||
},
|
||||
],
|
||||
}
|
||||
const config2: WatermarkConfigSpec = {
|
||||
blocks: [
|
||||
{
|
||||
id: 'other-id-2',
|
||||
type: 'text',
|
||||
x: 0.1,
|
||||
y: 0.1,
|
||||
opacity: 0.9,
|
||||
rotation: 15,
|
||||
text: 'B',
|
||||
size: 0.2,
|
||||
color: '#000000',
|
||||
},
|
||||
{
|
||||
id: 'other-id-1',
|
||||
type: 'text',
|
||||
x: 0.5,
|
||||
y: 0.5,
|
||||
opacity: 0.5,
|
||||
rotation: 0,
|
||||
text: 'A',
|
||||
size: 0.1,
|
||||
color: '#FFFFFF',
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
const hash1 = computeWatermarkConfigHash(config1)
|
||||
const hash2 = computeWatermarkConfigHash(config2)
|
||||
expect(hash1).toBe(hash2)
|
||||
})
|
||||
|
||||
it('should generate SVG overlay XML', () => {
|
||||
const svg = generateWatermarkSvg(sampleConfig, 1000, 500)
|
||||
expect(svg).toContain('<svg')
|
||||
expect(svg).toContain('CONFIDENTIAL')
|
||||
expect(svg).toContain('fill="#FF0000"')
|
||||
})
|
||||
|
||||
it('should upsert watermark config by hash', async () => {
|
||||
const config1 = await watermarkService.upsertConfig(sampleConfig)
|
||||
expect(config1.id).toBeDefined()
|
||||
|
||||
const config2 = await watermarkService.upsertConfig(sampleConfig)
|
||||
expect(config2.id).toBe(config1.id)
|
||||
})
|
||||
|
||||
it('should not race when upserting the same config concurrently', async () => {
|
||||
const results = await Promise.all(
|
||||
Array.from({ length: 10 }, () => watermarkService.upsertConfig(sampleConfig)),
|
||||
)
|
||||
const ids = new Set(results.map((r) => r.id))
|
||||
expect(ids.size).toBe(1)
|
||||
})
|
||||
|
||||
it('should manage watermark templates (CRUD)', async () => {
|
||||
const user = await prisma.user.create({
|
||||
data: { name: 'Test User', email: 'test-wm-tpl@example.com' },
|
||||
})
|
||||
const team = await teamService.createTeam(user, { name: 'Watermark Team' })
|
||||
|
||||
const created = await watermarkService.createTemplate(team.id, 'Draft Preset', sampleConfig)
|
||||
expect(created.id).toBeDefined()
|
||||
expect(created.name).toBe('Draft Preset')
|
||||
|
||||
const list = await watermarkService.listTemplates(team.id)
|
||||
expect(list.length).toBe(1)
|
||||
|
||||
const updated = await watermarkService.updateTemplate(created.id, 'Final Preset')
|
||||
expect(updated.name).toBe('Final Preset')
|
||||
|
||||
const fetched = await watermarkService.getTemplate(created.id)
|
||||
expect(fetched.name).toBe('Final Preset')
|
||||
|
||||
await watermarkService.deleteTemplate(created.id)
|
||||
const emptyList = await watermarkService.listTemplates(team.id)
|
||||
expect(emptyList.length).toBe(0)
|
||||
})
|
||||
|
||||
it('should update sharelink watermark and dispatch transcode tasks', async () => {
|
||||
const user = await prisma.user.create({
|
||||
data: { name: 'Share User', email: 'share-wm@example.com' },
|
||||
})
|
||||
const team = await teamService.createTeam(user, { name: 'Share Team' })
|
||||
|
||||
const projectFolder = await prisma.asset.create({
|
||||
data: { name: 'root', type: 'root', status: 'processed' },
|
||||
})
|
||||
const project = await prisma.project.create({
|
||||
data: { name: 'Test Project', teamId: team.id, rootFolderId: projectFolder.id },
|
||||
})
|
||||
|
||||
const shareLink = await shareService.createShareLink(project.id, { name: 'My Share' }, user.id)
|
||||
|
||||
// Add a file asset to project and share link
|
||||
const asset = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'sample.mp4',
|
||||
type: 'file',
|
||||
mediaType: 'video/mp4',
|
||||
status: 'processed',
|
||||
projectId: project.id,
|
||||
},
|
||||
})
|
||||
await shareService.addAssetToShare(shareLink.id, { assetIds: [asset.id] })
|
||||
|
||||
// Update sharelink watermark -> enable
|
||||
const updated = await watermarkService.updateShareLinkWatermark(
|
||||
shareLink.id,
|
||||
true,
|
||||
sampleConfig,
|
||||
)
|
||||
expect(updated.watermarkStatus).toBe('processing')
|
||||
expect(updated.watermarkConfigId).toBeDefined()
|
||||
|
||||
// Verify WorkflowTask was created
|
||||
const tasks = await prisma.workflowTask.findMany({
|
||||
where: { assetId: asset.id, type: 'transcode_watermark' },
|
||||
})
|
||||
expect(tasks.length).toBeGreaterThan(0)
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
expect((tasks[0].payload as any)?.watermark?.watermarkConfigId).toBe(updated.watermarkConfigId)
|
||||
|
||||
// Attempting update while status is processing should throw conflict error
|
||||
await expect(
|
||||
watermarkService.updateShareLinkWatermark(shareLink.id, true, sampleConfig),
|
||||
).rejects.toThrow('Watermark transcoding is currently in progress')
|
||||
|
||||
// Simulate completion of transcoding
|
||||
await prisma.shareLink.update({
|
||||
where: { id: shareLink.id },
|
||||
data: { watermarkStatus: 'ready' },
|
||||
})
|
||||
|
||||
// Disable watermark after ready
|
||||
const disabled = await watermarkService.updateShareLinkWatermark(shareLink.id, false)
|
||||
expect(disabled.watermarkStatus).toBe('disabled')
|
||||
expect(disabled.watermarkConfigId).toBeNull()
|
||||
})
|
||||
|
||||
it('should resolve media assets including nested symlinks in shared folders', async () => {
|
||||
const user = await prisma.user.create({
|
||||
data: { name: 'Nested User', email: 'nested-wm@example.com' },
|
||||
})
|
||||
const team = await teamService.createTeam(user, { name: 'Nested Team' })
|
||||
|
||||
const projectFolder = await prisma.asset.create({
|
||||
data: { name: 'root', type: 'root', status: 'processed' },
|
||||
})
|
||||
const project = await prisma.project.create({
|
||||
data: { name: 'Nested Project', teamId: team.id, rootFolderId: projectFolder.id },
|
||||
})
|
||||
|
||||
const shareLink = await shareService.createShareLink(
|
||||
project.id,
|
||||
{ name: 'Nested Share' },
|
||||
user.id,
|
||||
)
|
||||
|
||||
// Shared folder -> inner folder -> symlink -> media file
|
||||
const sharedFolder = await prisma.asset.create({
|
||||
data: { name: 'shared', type: 'folder', status: 'processed', projectId: project.id },
|
||||
})
|
||||
const innerFolder = await prisma.asset.create({
|
||||
data: { name: 'inner', type: 'folder', status: 'processed', projectId: project.id },
|
||||
})
|
||||
const mediaFile = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'clip.mp4',
|
||||
type: 'file',
|
||||
mediaType: 'video/mp4',
|
||||
status: 'processed',
|
||||
projectId: project.id,
|
||||
parentId: innerFolder.id,
|
||||
},
|
||||
})
|
||||
// symlink inside the shared folder points at the inner folder
|
||||
await prisma.asset.create({
|
||||
data: {
|
||||
name: 'inner-link',
|
||||
type: 'symlink',
|
||||
status: 'processed',
|
||||
projectId: project.id,
|
||||
parentId: sharedFolder.id,
|
||||
targetId: innerFolder.id,
|
||||
},
|
||||
})
|
||||
// root symlink for the share points at the shared folder
|
||||
await prisma.asset.create({
|
||||
data: {
|
||||
name: 'shared-link',
|
||||
type: 'symlink',
|
||||
status: 'processed',
|
||||
projectId: project.id,
|
||||
parentId: shareLink.rootFolderId,
|
||||
targetId: sharedFolder.id,
|
||||
},
|
||||
})
|
||||
|
||||
const mediaIds = await watermarkService.getMediaAssetIdsInShareLink(shareLink.rootFolderId)
|
||||
expect(mediaIds).toContain(mediaFile.id)
|
||||
})
|
||||
|
||||
describe('purgeOrphanWatermarkConfigs', () => {
|
||||
const bucket = 'shumai-gc-test-bucket'
|
||||
|
||||
beforeEach(() => {
|
||||
vi.restoreAllMocks()
|
||||
process.env.S3_BUCKET = bucket
|
||||
})
|
||||
|
||||
// Media with every proxy slot the GC should delete from S3 (plus an
|
||||
// `original` key that must survive).
|
||||
function proxyMedia(): PrismaJson.MediaInfo {
|
||||
return {
|
||||
duration: 0,
|
||||
filesize: 100,
|
||||
frames: 0,
|
||||
proxyType: 'video',
|
||||
videoTranscodes: [
|
||||
{ key: 'files/gc/wm.mp4', width: 1920, height: 1080, resolution: '1080p' },
|
||||
],
|
||||
imageTranscodes: [
|
||||
{ key: 'files/gc/wm.webp', width: 1280, height: 720, quality: 90, format: 'webp' },
|
||||
],
|
||||
videoPreview: { key: 'files/gc/preview.mp4', width: 1280, height: 720 },
|
||||
thumbnail: {
|
||||
key: 'files/gc/thumb.webp',
|
||||
width: 320,
|
||||
height: 180,
|
||||
quality: 90,
|
||||
format: 'webp',
|
||||
},
|
||||
finishedAt: new Date().toISOString(),
|
||||
metadata: null,
|
||||
original: { key: 'files/gc/original.mp4', downloadUrl: '', filesizeInBytes: 0, codec: '' },
|
||||
}
|
||||
}
|
||||
|
||||
async function seedProject() {
|
||||
const team = await prisma.team.create({ data: { name: 'GC Team' } })
|
||||
const projectFolder = await prisma.asset.create({
|
||||
data: { name: 'root', type: 'root', status: 'processed' },
|
||||
})
|
||||
return prisma.project.create({
|
||||
data: { name: 'GC Project', teamId: team.id, rootFolderId: projectFolder.id },
|
||||
})
|
||||
}
|
||||
|
||||
async function seedConfigWithWatermarkFile(config: WatermarkConfigSpec = sampleConfig) {
|
||||
const asset = await prisma.asset.create({
|
||||
data: { name: 'gc-asset.mp4', type: 'file', mediaType: 'video/mp4', status: 'processed' },
|
||||
})
|
||||
const wmConfig = await watermarkService.upsertConfig(config)
|
||||
const watermarkFile = await prisma.watermarkFile.create({
|
||||
data: {
|
||||
assetId: asset.id,
|
||||
watermarkConfigId: wmConfig.id,
|
||||
status: 'completed',
|
||||
media: proxyMedia(),
|
||||
},
|
||||
})
|
||||
return { asset, config: wmConfig, watermarkFile }
|
||||
}
|
||||
|
||||
async function seedWatermarkTask(
|
||||
assetId: string,
|
||||
projectId: string,
|
||||
configId: string,
|
||||
status: 'pending' | 'processing' | 'completed',
|
||||
type: 'transcode_watermark' | 'transcode_video' = 'transcode_watermark',
|
||||
) {
|
||||
return prisma.workflowTask.create({
|
||||
data: {
|
||||
assetId,
|
||||
projectId,
|
||||
type,
|
||||
status,
|
||||
payload: {
|
||||
projectId,
|
||||
watermark: { watermarkConfigId: configId },
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
it('should purge an orphan config, delete its S3 proxies and keep the original key', async () => {
|
||||
const { config, watermarkFile } = await seedConfigWithWatermarkFile()
|
||||
const deleteSpy = vi.spyOn(s3Service, 'deleteObject').mockResolvedValue(0)
|
||||
|
||||
const purgedCount = await watermarkService.purgeOrphanWatermarkConfigs()
|
||||
|
||||
expect(purgedCount).toBe(1)
|
||||
expect(await prisma.watermarkConfig.findUnique({ where: { id: config.id } })).toBeNull()
|
||||
expect(await prisma.watermarkFile.findUnique({ where: { id: watermarkFile.id } })).toBeNull()
|
||||
|
||||
// All proxy slots deleted, but the original file is never touched
|
||||
for (const key of [
|
||||
'files/gc/wm.mp4',
|
||||
'files/gc/wm.webp',
|
||||
'files/gc/preview.mp4',
|
||||
'files/gc/thumb.webp',
|
||||
]) {
|
||||
expect(deleteSpy).toHaveBeenCalledWith(bucket, key)
|
||||
}
|
||||
expect(deleteSpy).not.toHaveBeenCalledWith(bucket, 'files/gc/original.mp4')
|
||||
expect(deleteSpy).toHaveBeenCalledTimes(4)
|
||||
})
|
||||
|
||||
it('should NOT purge a config still referenced by a share link', async () => {
|
||||
const { config } = await seedConfigWithWatermarkFile()
|
||||
const project = await seedProject()
|
||||
const shareFolder = await prisma.asset.create({
|
||||
data: { name: 'share-folder', type: 'share', status: 'processed', projectId: project.id },
|
||||
})
|
||||
await prisma.shareLink.create({
|
||||
data: {
|
||||
name: 'GC Share',
|
||||
projectId: project.id,
|
||||
rootFolderId: shareFolder.id,
|
||||
watermarkConfigId: config.id,
|
||||
},
|
||||
})
|
||||
const deleteSpy = vi.spyOn(s3Service, 'deleteObject').mockResolvedValue(0)
|
||||
|
||||
const purgedCount = await watermarkService.purgeOrphanWatermarkConfigs()
|
||||
|
||||
expect(purgedCount).toBe(0)
|
||||
expect(await prisma.watermarkConfig.findUnique({ where: { id: config.id } })).not.toBeNull()
|
||||
expect(deleteSpy).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it.each(['pending', 'processing'] as const)(
|
||||
'should NOT purge a config with an in-flight %s watermark task',
|
||||
async (status) => {
|
||||
const { asset, config } = await seedConfigWithWatermarkFile()
|
||||
const project = await seedProject()
|
||||
await seedWatermarkTask(asset.id, project.id, config.id, status)
|
||||
const deleteSpy = vi.spyOn(s3Service, 'deleteObject').mockResolvedValue(0)
|
||||
|
||||
const purgedCount = await watermarkService.purgeOrphanWatermarkConfigs()
|
||||
|
||||
expect(purgedCount).toBe(0)
|
||||
expect(await prisma.watermarkConfig.findUnique({ where: { id: config.id } })).not.toBeNull()
|
||||
expect(deleteSpy).not.toHaveBeenCalled()
|
||||
},
|
||||
)
|
||||
|
||||
it('should purge a config once its watermark tasks are all completed', async () => {
|
||||
const { asset, config } = await seedConfigWithWatermarkFile()
|
||||
const project = await seedProject()
|
||||
await seedWatermarkTask(asset.id, project.id, config.id, 'completed')
|
||||
vi.spyOn(s3Service, 'deleteObject').mockResolvedValue(0)
|
||||
|
||||
const purgedCount = await watermarkService.purgeOrphanWatermarkConfigs()
|
||||
|
||||
expect(purgedCount).toBe(1)
|
||||
expect(await prisma.watermarkConfig.findUnique({ where: { id: config.id } })).toBeNull()
|
||||
})
|
||||
|
||||
it('should ignore pending tasks of other types when deciding to purge', async () => {
|
||||
const { asset, config } = await seedConfigWithWatermarkFile()
|
||||
const project = await seedProject()
|
||||
// A pending transcode_video task must not protect the watermark config
|
||||
await seedWatermarkTask(asset.id, project.id, config.id, 'pending', 'transcode_video')
|
||||
vi.spyOn(s3Service, 'deleteObject').mockResolvedValue(0)
|
||||
|
||||
const purgedCount = await watermarkService.purgeOrphanWatermarkConfigs()
|
||||
|
||||
expect(purgedCount).toBe(1)
|
||||
expect(await prisma.watermarkConfig.findUnique({ where: { id: config.id } })).toBeNull()
|
||||
})
|
||||
|
||||
it('should keep purging other configs and S3 keys when one S3 delete fails', async () => {
|
||||
const { config } = await seedConfigWithWatermarkFile()
|
||||
const deleteSpy = vi
|
||||
.spyOn(s3Service, 'deleteObject')
|
||||
.mockRejectedValueOnce(new Error('s3 down'))
|
||||
.mockResolvedValue(0)
|
||||
|
||||
const purgedCount = await watermarkService.purgeOrphanWatermarkConfigs()
|
||||
|
||||
expect(purgedCount).toBe(1)
|
||||
expect(await prisma.watermarkConfig.findUnique({ where: { id: config.id } })).toBeNull()
|
||||
// All 4 proxy keys were attempted even though the first one failed
|
||||
expect(deleteSpy).toHaveBeenCalledTimes(4)
|
||||
})
|
||||
|
||||
it('should purge only the orphan config when another config is still referenced', async () => {
|
||||
const otherConfig: WatermarkConfigSpec = {
|
||||
blocks: [
|
||||
{
|
||||
id: 'other-block',
|
||||
type: 'text',
|
||||
x: 0.3,
|
||||
y: 0.3,
|
||||
opacity: 0.4,
|
||||
rotation: 10,
|
||||
text: 'OTHER TEAM',
|
||||
size: 0.1,
|
||||
color: '#00FF00',
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
const orphan = await seedConfigWithWatermarkFile()
|
||||
const referenced = await seedConfigWithWatermarkFile(otherConfig)
|
||||
|
||||
const project = await seedProject()
|
||||
const shareFolder = await prisma.asset.create({
|
||||
data: { name: 'share-folder', type: 'share', status: 'processed', projectId: project.id },
|
||||
})
|
||||
await prisma.shareLink.create({
|
||||
data: {
|
||||
name: 'GC Share',
|
||||
projectId: project.id,
|
||||
rootFolderId: shareFolder.id,
|
||||
watermarkConfigId: referenced.config.id,
|
||||
},
|
||||
})
|
||||
vi.spyOn(s3Service, 'deleteObject').mockResolvedValue(0)
|
||||
|
||||
const purgedCount = await watermarkService.purgeOrphanWatermarkConfigs()
|
||||
|
||||
expect(purgedCount).toBe(1)
|
||||
expect(
|
||||
await prisma.watermarkConfig.findUnique({ where: { id: orphan.config.id } }),
|
||||
).toBeNull()
|
||||
expect(
|
||||
await prisma.watermarkConfig.findUnique({ where: { id: referenced.config.id } }),
|
||||
).not.toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
it('should fetch completed watermark media map for asset IDs', async () => {
|
||||
const config = await watermarkService.upsertConfig(sampleConfig)
|
||||
const asset1 = await prisma.asset.create({
|
||||
data: { name: 'asset1.png', type: 'file', status: 'processed' },
|
||||
})
|
||||
const asset2 = await prisma.asset.create({
|
||||
data: { name: 'asset2.png', type: 'file', status: 'processed' },
|
||||
})
|
||||
|
||||
const sampleMedia: PrismaJson.MediaInfo = {
|
||||
duration: 0,
|
||||
filesize: 100,
|
||||
frames: 0,
|
||||
proxyType: 'image',
|
||||
imageTranscodes: [
|
||||
{ key: 'watermarked.webp', width: 100, height: 100, quality: 90, format: 'webp' },
|
||||
],
|
||||
videoTranscodes: [],
|
||||
finishedAt: new Date().toISOString(),
|
||||
metadata: null,
|
||||
original: null,
|
||||
}
|
||||
|
||||
await prisma.watermarkFile.create({
|
||||
data: {
|
||||
assetId: asset1.id,
|
||||
watermarkConfigId: config.id,
|
||||
status: 'completed',
|
||||
media: sampleMedia,
|
||||
},
|
||||
})
|
||||
|
||||
// asset2 has pending status
|
||||
await prisma.watermarkFile.create({
|
||||
data: {
|
||||
assetId: asset2.id,
|
||||
watermarkConfigId: config.id,
|
||||
status: 'pending',
|
||||
},
|
||||
})
|
||||
|
||||
const map = await watermarkService.getCompletedWatermarkMediaMap(
|
||||
[asset1.id, asset2.id],
|
||||
config.id,
|
||||
)
|
||||
|
||||
expect(map.size).toBe(1)
|
||||
expect(map.get(asset1.id)).toBeDefined()
|
||||
expect(map.get(asset1.id)?.imageTranscodes[0].key).toBe('watermarked.webp')
|
||||
expect(map.get(asset2.id)).toBeUndefined()
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,584 @@
|
||||
import {
|
||||
prisma,
|
||||
WorkflowTaskStatus,
|
||||
WorkflowTaskType,
|
||||
WatermarkStatus,
|
||||
WatermarkFileStatus,
|
||||
WatermarkConfig,
|
||||
WatermarkTemplate,
|
||||
} from '@shumai/db'
|
||||
import type { Prisma } from '@shumai/db'
|
||||
import '@shumai/db/src/prisma-json-types'
|
||||
import {
|
||||
WatermarkConfigSpec,
|
||||
WatermarkConfigInfo,
|
||||
WatermarkTemplateInfo,
|
||||
ShareLinkInfo,
|
||||
} from '@shumai/dtos'
|
||||
import { computeWatermarkConfigHash } from '@shumai/core/src/watermark/watermark-hash'
|
||||
import { s3Service } from '@shumai/core/src/s3/s3'
|
||||
import {
|
||||
ShareLinkNotFoundError,
|
||||
ShareLinkWatermarkProcessingError,
|
||||
} from '@shumai/core/src/share/errors'
|
||||
import { shareService } from '@shumai/core/src/share/share'
|
||||
import { logger } from '@shumai/core/src/logger'
|
||||
|
||||
// Union of the global client and interactive-transaction client, which share the
|
||||
// same delegate shapes for the models used by this service.
|
||||
type WatermarkDbClient = Prisma.TransactionClient | typeof prisma
|
||||
|
||||
export class WatermarkService {
|
||||
constructor(private readonly prismaClient: typeof prisma = prisma) {}
|
||||
|
||||
async upsertConfig(config: WatermarkConfigSpec) {
|
||||
return this.upsertConfigWithClient(this.prismaClient, config)
|
||||
}
|
||||
|
||||
private async upsertConfigWithClient(client: WatermarkDbClient, config: WatermarkConfigSpec) {
|
||||
const hash = computeWatermarkConfigHash(config)
|
||||
// Upsert keyed on the unique hash so concurrent enables of the same config
|
||||
// cannot race into a unique-constraint violation.
|
||||
return client.watermarkConfig.upsert({
|
||||
where: { hash },
|
||||
update: {},
|
||||
create: {
|
||||
hash,
|
||||
config: config as PrismaJson.WatermarkConfigSpec,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Watermark Template CRUD
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
async createTemplate(
|
||||
teamId: string | null,
|
||||
name: string,
|
||||
config: WatermarkConfigSpec,
|
||||
): Promise<WatermarkTemplateInfo> {
|
||||
const tpl = await this.prismaClient.watermarkTemplate.create({
|
||||
data: {
|
||||
name,
|
||||
config: config as PrismaJson.WatermarkConfigSpec,
|
||||
teamId,
|
||||
},
|
||||
})
|
||||
return await this.toWatermarkTemplateInfo(tpl)
|
||||
}
|
||||
|
||||
async updateTemplate(
|
||||
templateId: string,
|
||||
name?: string,
|
||||
config?: WatermarkConfigSpec,
|
||||
): Promise<WatermarkTemplateInfo> {
|
||||
const existing = await this.prismaClient.watermarkTemplate.findUnique({
|
||||
where: { id: templateId },
|
||||
})
|
||||
if (!existing) {
|
||||
throw new Error('Watermark template not found')
|
||||
}
|
||||
|
||||
const tpl = await this.prismaClient.watermarkTemplate.update({
|
||||
where: { id: templateId },
|
||||
data: {
|
||||
name: name ?? undefined,
|
||||
config: config ? (config as PrismaJson.WatermarkConfigSpec) : undefined,
|
||||
},
|
||||
})
|
||||
return await this.toWatermarkTemplateInfo(tpl)
|
||||
}
|
||||
|
||||
async deleteTemplate(templateId: string): Promise<void> {
|
||||
const existing = await this.prismaClient.watermarkTemplate.findUnique({
|
||||
where: { id: templateId },
|
||||
})
|
||||
if (!existing) {
|
||||
throw new Error('Watermark template not found')
|
||||
}
|
||||
await this.prismaClient.watermarkTemplate.delete({
|
||||
where: { id: templateId },
|
||||
})
|
||||
}
|
||||
|
||||
async listTemplates(teamIds?: string | string[] | null): Promise<WatermarkTemplateInfo[]> {
|
||||
const where = teamIds
|
||||
? Array.isArray(teamIds)
|
||||
? { teamId: { in: teamIds } }
|
||||
: { teamId: teamIds }
|
||||
: undefined
|
||||
const tpls = await this.prismaClient.watermarkTemplate.findMany({
|
||||
where,
|
||||
// ULIDs are time-sortable; ordering by id desc is the project convention
|
||||
orderBy: { id: 'desc' },
|
||||
})
|
||||
return await Promise.all(tpls.map((t) => this.toWatermarkTemplateInfo(t)))
|
||||
}
|
||||
|
||||
async getTemplate(templateId: string): Promise<WatermarkTemplateInfo> {
|
||||
const tpl = await this.prismaClient.watermarkTemplate.findUnique({
|
||||
where: { id: templateId },
|
||||
})
|
||||
if (!tpl) {
|
||||
throw new Error('Watermark template not found')
|
||||
}
|
||||
return await this.toWatermarkTemplateInfo(tpl)
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// ShareLink Watermark Management
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
async updateShareLinkWatermark(
|
||||
shareLinkId: string,
|
||||
enabled: boolean,
|
||||
config?: WatermarkConfigSpec,
|
||||
): Promise<ShareLinkInfo> {
|
||||
return await this.prismaClient.$transaction(async (tx) => {
|
||||
// Lock the sharelink record SELECT FOR UPDATE
|
||||
const lockedRows = await tx.$queryRaw<
|
||||
{
|
||||
id: string
|
||||
watermarkStatus: WatermarkStatus
|
||||
watermarkConfigId: string | null
|
||||
}[]
|
||||
>`SELECT id, watermark_status AS "watermarkStatus", watermark_config_id AS "watermarkConfigId" FROM share_links WHERE id = ${shareLinkId} FOR UPDATE`
|
||||
|
||||
if (lockedRows.length === 0) {
|
||||
throw new ShareLinkNotFoundError('Share link not found')
|
||||
}
|
||||
|
||||
const currentStatus = lockedRows[0].watermarkStatus
|
||||
|
||||
if (currentStatus === WatermarkStatus.processing) {
|
||||
throw new ShareLinkWatermarkProcessingError(
|
||||
'Watermark transcoding is currently in progress',
|
||||
)
|
||||
}
|
||||
|
||||
if (!enabled) {
|
||||
await tx.shareLink.update({
|
||||
where: { id: shareLinkId },
|
||||
data: {
|
||||
watermarkConfigId: null,
|
||||
watermarkStatus: WatermarkStatus.disabled,
|
||||
},
|
||||
})
|
||||
// Read back through the transaction client: the global client runs on a
|
||||
// different pooled connection and cannot see uncommitted changes.
|
||||
return await shareService.getShareLink(shareLinkId, tx)
|
||||
}
|
||||
|
||||
if (!config || !config.blocks || config.blocks.length === 0) {
|
||||
throw new Error('Watermark configuration is required when enabling watermark')
|
||||
}
|
||||
|
||||
// Upsert watermark config based on hash
|
||||
const watermarkConfig = await this.upsertConfigWithClient(tx, config)
|
||||
|
||||
await tx.shareLink.update({
|
||||
where: { id: shareLinkId },
|
||||
data: {
|
||||
watermarkConfigId: watermarkConfig.id,
|
||||
watermarkStatus: WatermarkStatus.processing,
|
||||
},
|
||||
})
|
||||
|
||||
// Dispatch transcode tasks for all video/image assets in the sharelink
|
||||
await this.triggerWatermarkTranscodeForShareLink(shareLinkId, watermarkConfig.id, tx)
|
||||
|
||||
return await shareService.getShareLink(shareLinkId, tx)
|
||||
})
|
||||
}
|
||||
|
||||
async getShareLinkWatermark(shareLinkId: string): Promise<{
|
||||
watermarkStatus: WatermarkStatus
|
||||
watermarkConfig: WatermarkConfigInfo | null
|
||||
}> {
|
||||
const shareLink = await this.prismaClient.shareLink.findUnique({
|
||||
where: { id: shareLinkId },
|
||||
include: { watermarkConfig: true },
|
||||
})
|
||||
|
||||
if (!shareLink) {
|
||||
throw new ShareLinkNotFoundError('Share link not found')
|
||||
}
|
||||
|
||||
return {
|
||||
watermarkStatus: shareLink.watermarkStatus,
|
||||
watermarkConfig: shareLink.watermarkConfig
|
||||
? await this.toWatermarkConfigInfo(shareLink.watermarkConfig)
|
||||
: null,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds all media file asset IDs (videos and images) contained in the sharelink,
|
||||
* including files within symlinked folders, and enqueues transcode workflow tasks.
|
||||
*/
|
||||
async triggerWatermarkTranscodeForShareLink(
|
||||
shareLinkId: string,
|
||||
watermarkConfigId: string,
|
||||
txClient?: WatermarkDbClient,
|
||||
): Promise<number> {
|
||||
const client = txClient || this.prismaClient
|
||||
const shareLink = await client.shareLink.findUnique({
|
||||
where: { id: shareLinkId },
|
||||
})
|
||||
if (!shareLink) return 0
|
||||
|
||||
const targetMediaAssets = await this.getMediaAssetIdsInShareLink(shareLink.rootFolderId, client)
|
||||
|
||||
if (targetMediaAssets.length === 0) {
|
||||
// If no media assets in sharelink, mark sharelink watermark as ready immediately
|
||||
await client.shareLink.update({
|
||||
where: { id: shareLinkId },
|
||||
data: { watermarkStatus: WatermarkStatus.ready },
|
||||
})
|
||||
return 0
|
||||
}
|
||||
|
||||
let dispatchedCount = 0
|
||||
for (const assetId of targetMediaAssets) {
|
||||
// Deliberately one create() per task: the @shumai/db client extension that
|
||||
// submits tasks to the workflow engine only hooks `workflowTask.create`,
|
||||
// not `createMany`.
|
||||
await client.workflowTask.create({
|
||||
data: {
|
||||
assetId,
|
||||
type: WorkflowTaskType.transcode_watermark,
|
||||
status: WorkflowTaskStatus.pending,
|
||||
projectId: shareLink.projectId,
|
||||
payload: {
|
||||
projectId: shareLink.projectId,
|
||||
watermark: {
|
||||
watermarkConfigId,
|
||||
shareLinkId,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
dispatchedCount++
|
||||
}
|
||||
|
||||
return dispatchedCount
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively resolves real media file asset IDs (video and image) under a sharelink root folder.
|
||||
* Walks the tree level-by-level (batched queries) and follows symlinks at any depth.
|
||||
*/
|
||||
async getMediaAssetIdsInShareLink(
|
||||
rootFolderId: string,
|
||||
txClient?: WatermarkDbClient,
|
||||
): Promise<string[]> {
|
||||
const client = txClient || this.prismaClient
|
||||
|
||||
// Fetch symlinks directly under root folder; these point to the shared targets
|
||||
const symlinks = await client.asset.findMany({
|
||||
where: {
|
||||
parentId: rootFolderId,
|
||||
type: 'symlink',
|
||||
isDeleted: false,
|
||||
},
|
||||
select: { targetId: true },
|
||||
})
|
||||
|
||||
const queue = symlinks.map((s) => s.targetId).filter((id): id is string => !!id)
|
||||
|
||||
if (queue.length === 0) return []
|
||||
|
||||
const mediaAssetIds: string[] = []
|
||||
const visited = new Set<string>()
|
||||
|
||||
while (queue.length > 0) {
|
||||
const frontier = queue.splice(0)
|
||||
const assets = await client.asset.findMany({
|
||||
where: { id: { in: frontier } },
|
||||
select: {
|
||||
id: true,
|
||||
type: true,
|
||||
mediaType: true,
|
||||
media: true,
|
||||
isDeleted: true,
|
||||
targetId: true,
|
||||
},
|
||||
})
|
||||
|
||||
const folderIds: string[] = []
|
||||
const next: string[] = []
|
||||
|
||||
for (const asset of assets) {
|
||||
if (visited.has(asset.id)) continue
|
||||
visited.add(asset.id)
|
||||
if (asset.isDeleted) continue
|
||||
|
||||
if (asset.type === 'file') {
|
||||
const mediaInfo = asset.media as PrismaJson.MediaInfo | null
|
||||
const proxyType = mediaInfo?.proxyType
|
||||
const isVideo = proxyType === 'video' || asset.mediaType?.startsWith('video/')
|
||||
const isImage = proxyType === 'image' || asset.mediaType?.startsWith('image/')
|
||||
|
||||
if (isVideo || isImage) {
|
||||
mediaAssetIds.push(asset.id)
|
||||
}
|
||||
} else if (asset.type === 'folder') {
|
||||
folderIds.push(asset.id)
|
||||
} else if (asset.type === 'symlink' && asset.targetId) {
|
||||
// Resolve nested symlinks (e.g. folders that contain their own symlinks)
|
||||
next.push(asset.targetId)
|
||||
}
|
||||
}
|
||||
|
||||
if (folderIds.length > 0) {
|
||||
const children = await client.asset.findMany({
|
||||
where: { parentId: { in: folderIds }, isDeleted: false },
|
||||
select: { id: true },
|
||||
})
|
||||
next.push(...children.map((c) => c.id))
|
||||
}
|
||||
|
||||
queue.push(...next)
|
||||
}
|
||||
|
||||
return mediaAssetIds
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if all required media assets in a sharelink have completed watermark transcodes.
|
||||
* If all are completed, sets ShareLink.watermarkStatus to 'ready'.
|
||||
* If any failed, sets ShareLink.watermarkStatus to 'failed'.
|
||||
*/
|
||||
async checkAndUpdateShareLinkStatus(shareLinkId: string): Promise<WatermarkStatus> {
|
||||
const shareLink = await this.prismaClient.shareLink.findUnique({
|
||||
where: { id: shareLinkId },
|
||||
})
|
||||
if (!shareLink || !shareLink.watermarkConfigId) {
|
||||
return WatermarkStatus.disabled
|
||||
}
|
||||
|
||||
const watermarkConfigId = shareLink.watermarkConfigId
|
||||
const mediaAssetIds = await this.getMediaAssetIdsInShareLink(shareLink.rootFolderId)
|
||||
|
||||
if (mediaAssetIds.length === 0) {
|
||||
await this.prismaClient.shareLink.update({
|
||||
where: { id: shareLinkId },
|
||||
data: { watermarkStatus: WatermarkStatus.ready },
|
||||
})
|
||||
return WatermarkStatus.ready
|
||||
}
|
||||
|
||||
const watermarkFiles = await this.prismaClient.watermarkFile.findMany({
|
||||
where: {
|
||||
assetId: { in: mediaAssetIds },
|
||||
watermarkConfigId,
|
||||
},
|
||||
})
|
||||
|
||||
const statusMap = new Map(watermarkFiles.map((wf) => [wf.assetId, wf.status]))
|
||||
|
||||
let allCompleted = true
|
||||
let anyFailed = false
|
||||
|
||||
for (const assetId of mediaAssetIds) {
|
||||
const status = statusMap.get(assetId)
|
||||
if (status === WatermarkFileStatus.failed) {
|
||||
anyFailed = true
|
||||
allCompleted = false
|
||||
break
|
||||
}
|
||||
if (status !== WatermarkFileStatus.completed) {
|
||||
allCompleted = false
|
||||
}
|
||||
}
|
||||
|
||||
let newStatus: WatermarkStatus
|
||||
if (anyFailed) {
|
||||
newStatus = WatermarkStatus.failed
|
||||
} else if (allCompleted) {
|
||||
newStatus = WatermarkStatus.ready
|
||||
} else {
|
||||
newStatus = WatermarkStatus.processing
|
||||
}
|
||||
|
||||
if (newStatus !== shareLink.watermarkStatus) {
|
||||
await this.prismaClient.shareLink.update({
|
||||
where: { id: shareLinkId },
|
||||
data: { watermarkStatus: newStatus },
|
||||
})
|
||||
}
|
||||
|
||||
return newStatus
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Background Async Garbage Collection
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Background task to prune orphan WatermarkConfig records and delete their storage files.
|
||||
* Runs as part of background cleanup.
|
||||
*/
|
||||
async purgeOrphanWatermarkConfigs(): Promise<number> {
|
||||
const bucket = process.env.S3_BUCKET || 'shumai'
|
||||
|
||||
// 1. Find orphan configs with 0 sharelinks attached and no in-flight watermark
|
||||
// tasks, using FOR UPDATE SKIP LOCKED. Configs with pending/processing tasks
|
||||
// must not be purged, or the running activities would fail with FK violations.
|
||||
const orphanConfigs = await this.prismaClient.$queryRaw<{ id: string }[]>`
|
||||
SELECT wc.id FROM watermark_configs wc
|
||||
WHERE NOT EXISTS (SELECT 1 FROM share_links sl WHERE sl.watermark_config_id = wc.id)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM workflow_tasks wt
|
||||
WHERE wt.type = 'transcode_watermark'
|
||||
AND wt.status IN ('pending', 'processing')
|
||||
AND wt.payload->'watermark'->>'watermarkConfigId' = wc.id
|
||||
)
|
||||
LIMIT 20
|
||||
FOR UPDATE SKIP LOCKED
|
||||
`
|
||||
|
||||
if (orphanConfigs.length === 0) return 0
|
||||
|
||||
let purgedCount = 0
|
||||
|
||||
for (const config of orphanConfigs) {
|
||||
try {
|
||||
// Fetch all watermark files for this config
|
||||
const watermarkFiles = await this.prismaClient.watermarkFile.findMany({
|
||||
where: { watermarkConfigId: config.id },
|
||||
})
|
||||
|
||||
// Delete proxy files from S3
|
||||
for (const wf of watermarkFiles) {
|
||||
const media = wf.media
|
||||
if (media) {
|
||||
const keysToDelete: string[] = []
|
||||
if (Array.isArray(media.videoTranscodes)) {
|
||||
for (const vt of media.videoTranscodes) {
|
||||
if (vt.key) keysToDelete.push(vt.key)
|
||||
}
|
||||
}
|
||||
if (Array.isArray(media.imageTranscodes)) {
|
||||
for (const it of media.imageTranscodes) {
|
||||
if (it.key) keysToDelete.push(it.key)
|
||||
}
|
||||
}
|
||||
if (media.videoPreview?.key) keysToDelete.push(media.videoPreview.key)
|
||||
if (media.thumbnail?.key) keysToDelete.push(media.thumbnail.key)
|
||||
|
||||
for (const key of keysToDelete) {
|
||||
try {
|
||||
await s3Service.deleteObject(bucket, key)
|
||||
} catch (s3Err) {
|
||||
logger.warn({ key, err: s3Err }, 'Failed to delete watermark proxy file from S3')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Delete WatermarkFiles and WatermarkConfig in DB
|
||||
await this.prismaClient.$transaction(async (tx) => {
|
||||
await tx.watermarkFile.deleteMany({
|
||||
where: { watermarkConfigId: config.id },
|
||||
})
|
||||
await tx.watermarkConfig.delete({
|
||||
where: { id: config.id },
|
||||
})
|
||||
})
|
||||
|
||||
purgedCount++
|
||||
logger.info({ configId: config.id }, 'Purged orphan watermark config and proxy files')
|
||||
} catch (err) {
|
||||
logger.error({ configId: config.id, err }, 'Failed to purge orphan watermark config')
|
||||
}
|
||||
}
|
||||
|
||||
return purgedCount
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches completed watermark media entries for a list of asset IDs under a specific watermark config.
|
||||
* Returns a map of assetId -> PrismaJson.MediaInfo.
|
||||
*/
|
||||
async getCompletedWatermarkMediaMap(
|
||||
assetIds: string[],
|
||||
watermarkConfigId: string,
|
||||
): Promise<Map<string, PrismaJson.MediaInfo>> {
|
||||
if (assetIds.length === 0) return new Map()
|
||||
|
||||
const watermarkFiles = await prisma.watermarkFile.findMany({
|
||||
where: {
|
||||
assetId: { in: assetIds },
|
||||
watermarkConfigId,
|
||||
status: 'completed',
|
||||
},
|
||||
})
|
||||
|
||||
const map = new Map<string, PrismaJson.MediaInfo>()
|
||||
for (const wf of watermarkFiles) {
|
||||
if (wf.media) {
|
||||
map.set(wf.assetId, wf.media as PrismaJson.MediaInfo)
|
||||
}
|
||||
}
|
||||
return map
|
||||
}
|
||||
|
||||
/**
|
||||
* Enriches image blocks in a watermark config with accessible presigned URLs for WebUI rendering.
|
||||
*/
|
||||
async enrichWatermarkConfigWithPresignedUrls(
|
||||
config: WatermarkConfigSpec,
|
||||
): Promise<WatermarkConfigSpec> {
|
||||
if (!config || !config.blocks || config.blocks.length === 0) return config
|
||||
const bucket = process.env.S3_BUCKET || 'shumai'
|
||||
const enrichedBlocks = await Promise.all(
|
||||
config.blocks.map(async (block) => {
|
||||
if (block.type === 'image' && block.imageAssetKey) {
|
||||
try {
|
||||
const url = await s3Service.presign(bucket, block.imageAssetKey, 'GET')
|
||||
return { ...block, imageAssetUrl: url }
|
||||
} catch (err) {
|
||||
logger.warn({ key: block.imageAssetKey, err }, 'Failed to presign watermark image key')
|
||||
}
|
||||
}
|
||||
return block
|
||||
}),
|
||||
)
|
||||
return { ...config, blocks: enrichedBlocks }
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// DTO Mappers
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
private async toWatermarkTemplateInfo(t: WatermarkTemplate): Promise<WatermarkTemplateInfo> {
|
||||
const config = await this.enrichWatermarkConfigWithPresignedUrls(
|
||||
t.config as WatermarkConfigSpec,
|
||||
)
|
||||
return {
|
||||
id: t.id,
|
||||
name: t.name,
|
||||
config,
|
||||
teamId: t.teamId,
|
||||
createdAt: t.createdAt.toISOString(),
|
||||
updatedAt: t.updatedAt.toISOString(),
|
||||
}
|
||||
}
|
||||
|
||||
private async toWatermarkConfigInfo(c: WatermarkConfig): Promise<WatermarkConfigInfo> {
|
||||
const config = await this.enrichWatermarkConfigWithPresignedUrls(
|
||||
c.config as WatermarkConfigSpec,
|
||||
)
|
||||
return {
|
||||
id: c.id,
|
||||
config,
|
||||
hash: c.hash,
|
||||
createdAt: c.createdAt.toISOString(),
|
||||
updatedAt: c.updatedAt.toISOString(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const watermarkService = new WatermarkService()
|
||||
@@ -0,0 +1,69 @@
|
||||
-- CreateEnum
|
||||
CREATE TYPE "WatermarkStatus" AS ENUM ('disabled', 'processing', 'ready', 'failed');
|
||||
|
||||
-- AlterEnum
|
||||
ALTER TYPE "WorkflowTaskType" ADD VALUE 'transcode_watermark';
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "share_links" ADD COLUMN "watermark_config_id" TEXT,
|
||||
ADD COLUMN "watermark_status" "WatermarkStatus" NOT NULL DEFAULT 'disabled';
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "watermark_configs" (
|
||||
"id" TEXT NOT NULL,
|
||||
"config" JSONB NOT NULL,
|
||||
"hash" TEXT NOT NULL,
|
||||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "watermark_configs_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "watermark_templates" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"config" JSONB NOT NULL,
|
||||
"team_id" TEXT,
|
||||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "watermark_templates_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "watermark_files" (
|
||||
"id" TEXT NOT NULL,
|
||||
"asset_id" TEXT NOT NULL,
|
||||
"watermark_config_id" TEXT NOT NULL,
|
||||
"media" JSONB,
|
||||
"status" "WorkflowTaskStatus" NOT NULL DEFAULT 'pending',
|
||||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "watermark_files_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "watermark_configs_hash_key" ON "watermark_configs"("hash");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "watermark_templates_team_id_idx" ON "watermark_templates"("team_id");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "watermark_files_watermark_config_id_idx" ON "watermark_files"("watermark_config_id");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "watermark_files_asset_id_watermark_config_id_key" ON "watermark_files"("asset_id", "watermark_config_id");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "share_links" ADD CONSTRAINT "share_links_watermark_config_id_fkey" FOREIGN KEY ("watermark_config_id") REFERENCES "watermark_configs"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "watermark_templates" ADD CONSTRAINT "watermark_templates_team_id_fkey" FOREIGN KEY ("team_id") REFERENCES "teams"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "watermark_files" ADD CONSTRAINT "watermark_files_asset_id_fkey" FOREIGN KEY ("asset_id") REFERENCES "assets"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "watermark_files" ADD CONSTRAINT "watermark_files_watermark_config_id_fkey" FOREIGN KEY ("watermark_config_id") REFERENCES "watermark_configs"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -0,0 +1,7 @@
|
||||
-- CreateEnum
|
||||
CREATE TYPE "WatermarkFileStatus" AS ENUM ('pending', 'processing', 'completed', 'failed');
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "watermark_files" ALTER COLUMN "status" DROP DEFAULT;
|
||||
ALTER TABLE "watermark_files" ALTER COLUMN "status" TYPE "WatermarkFileStatus" USING ("status"::text::"WatermarkFileStatus");
|
||||
ALTER TABLE "watermark_files" ALTER COLUMN "status" SET DEFAULT 'pending';
|
||||
@@ -106,6 +106,7 @@ enum WorkflowTaskType {
|
||||
transcode_pdf_pages
|
||||
transcode_screenshot
|
||||
transcode_image_annotation
|
||||
transcode_watermark
|
||||
ai_metadata_autofill
|
||||
chat
|
||||
ai_embedding
|
||||
@@ -120,6 +121,20 @@ enum WorkflowTaskStatus {
|
||||
failed
|
||||
}
|
||||
|
||||
enum WatermarkStatus {
|
||||
disabled
|
||||
processing
|
||||
ready
|
||||
failed
|
||||
}
|
||||
|
||||
enum WatermarkFileStatus {
|
||||
pending
|
||||
processing
|
||||
completed
|
||||
failed
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Models
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -241,6 +256,7 @@ model Team {
|
||||
agents Agent[] @relation("TeamToAgent")
|
||||
aiUsages AiUsage[] @relation("TeamToAiUsage")
|
||||
auditLogs AuditLog[] @relation("TeamToAuditLog")
|
||||
watermarkTemplates WatermarkTemplate[] @relation("TeamToWatermarkTemplate")
|
||||
|
||||
@@map("teams")
|
||||
}
|
||||
@@ -367,9 +383,59 @@ model ShareLink {
|
||||
creatorId String? @map("creator_id")
|
||||
creator User? @relation("UserToShareLink", fields: [creatorId], references: [id])
|
||||
|
||||
watermarkConfigId String? @map("watermark_config_id")
|
||||
watermarkStatus WatermarkStatus @default(disabled) @map("watermark_status")
|
||||
watermarkConfig WatermarkConfig? @relation(fields: [watermarkConfigId], references: [id], onDelete: SetNull)
|
||||
|
||||
@@map("share_links")
|
||||
}
|
||||
|
||||
model WatermarkConfig {
|
||||
id String @id @default(ulid())
|
||||
/// [WatermarkConfigSpec]
|
||||
config Json
|
||||
hash String @unique
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
shareLinks ShareLink[]
|
||||
watermarkFiles WatermarkFile[]
|
||||
|
||||
@@map("watermark_configs")
|
||||
}
|
||||
|
||||
model WatermarkTemplate {
|
||||
id String @id @default(ulid())
|
||||
name String
|
||||
/// [WatermarkConfigSpec]
|
||||
config Json
|
||||
teamId String? @map("team_id")
|
||||
team Team? @relation("TeamToWatermarkTemplate", fields: [teamId], references: [id], onDelete: Cascade)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
@@index([teamId])
|
||||
@@map("watermark_templates")
|
||||
}
|
||||
|
||||
model WatermarkFile {
|
||||
id String @id @default(ulid())
|
||||
assetId String @map("asset_id")
|
||||
watermarkConfigId String @map("watermark_config_id")
|
||||
/// [MediaInfo]
|
||||
media Json?
|
||||
status WatermarkFileStatus @default(pending)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
asset Asset @relation("AssetToWatermarkFile", fields: [assetId], references: [id], onDelete: Cascade)
|
||||
watermarkConfig WatermarkConfig @relation(fields: [watermarkConfigId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([assetId, watermarkConfigId])
|
||||
@@index([watermarkConfigId])
|
||||
@@map("watermark_files")
|
||||
}
|
||||
|
||||
model Asset {
|
||||
id String @id @default(ulid())
|
||||
name String @default("")
|
||||
@@ -421,6 +487,7 @@ model Asset {
|
||||
projectShareRoot Project? @relation("ProjectToShareRoot")
|
||||
shareLinkRootFolder ShareLink? @relation("ShareLinkToRootFolder")
|
||||
agentSessions AgentSession[] @relation("AssetToAgentSession")
|
||||
watermarkFiles WatermarkFile[] @relation("AssetToWatermarkFile")
|
||||
|
||||
@@map("assets")
|
||||
@@index([type])
|
||||
|
||||
+15
@@ -77,6 +77,21 @@ export type ProjectMember = Prisma.ProjectMemberModel
|
||||
*
|
||||
*/
|
||||
export type ShareLink = Prisma.ShareLinkModel
|
||||
/**
|
||||
* Model WatermarkConfig
|
||||
*
|
||||
*/
|
||||
export type WatermarkConfig = Prisma.WatermarkConfigModel
|
||||
/**
|
||||
* Model WatermarkTemplate
|
||||
*
|
||||
*/
|
||||
export type WatermarkTemplate = Prisma.WatermarkTemplateModel
|
||||
/**
|
||||
* Model WatermarkFile
|
||||
*
|
||||
*/
|
||||
export type WatermarkFile = Prisma.WatermarkFileModel
|
||||
/**
|
||||
* Model Asset
|
||||
*
|
||||
|
||||
+15
@@ -101,6 +101,21 @@ export type ProjectMember = Prisma.ProjectMemberModel
|
||||
*
|
||||
*/
|
||||
export type ShareLink = Prisma.ShareLinkModel
|
||||
/**
|
||||
* Model WatermarkConfig
|
||||
*
|
||||
*/
|
||||
export type WatermarkConfig = Prisma.WatermarkConfigModel
|
||||
/**
|
||||
* Model WatermarkTemplate
|
||||
*
|
||||
*/
|
||||
export type WatermarkTemplate = Prisma.WatermarkTemplateModel
|
||||
/**
|
||||
* Model WatermarkFile
|
||||
*
|
||||
*/
|
||||
export type WatermarkFile = Prisma.WatermarkFileModel
|
||||
/**
|
||||
* Model Asset
|
||||
*
|
||||
|
||||
+143
-75
@@ -267,6 +267,91 @@ export type EnumProjectMemberRoleWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedEnumProjectMemberRoleFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumWatermarkStatusFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.WatermarkStatus | Prisma.EnumWatermarkStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.WatermarkStatus[] | Prisma.ListEnumWatermarkStatusFieldRefInput<$PrismaModel>
|
||||
notIn?: $Enums.WatermarkStatus[] | Prisma.ListEnumWatermarkStatusFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedEnumWatermarkStatusFilter<$PrismaModel> | $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type EnumWatermarkStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.WatermarkStatus | Prisma.EnumWatermarkStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.WatermarkStatus[] | Prisma.ListEnumWatermarkStatusFieldRefInput<$PrismaModel>
|
||||
notIn?: $Enums.WatermarkStatus[] | Prisma.ListEnumWatermarkStatusFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedEnumWatermarkStatusWithAggregatesFilter<$PrismaModel> | $Enums.WatermarkStatus
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumWatermarkStatusFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumWatermarkStatusFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type JsonFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<JsonFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<JsonFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<JsonFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type JsonFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string[]
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
}
|
||||
|
||||
export type JsonWithAggregatesFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<JsonWithAggregatesFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonWithAggregatesFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<JsonWithAggregatesFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<JsonWithAggregatesFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type JsonWithAggregatesFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string[]
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedJsonFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedJsonFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumWatermarkFileStatusFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.WatermarkFileStatus | Prisma.EnumWatermarkFileStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.WatermarkFileStatus[] | Prisma.ListEnumWatermarkFileStatusFieldRefInput<$PrismaModel>
|
||||
notIn?: $Enums.WatermarkFileStatus[] | Prisma.ListEnumWatermarkFileStatusFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedEnumWatermarkFileStatusFilter<$PrismaModel> | $Enums.WatermarkFileStatus
|
||||
}
|
||||
|
||||
export type EnumWatermarkFileStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.WatermarkFileStatus | Prisma.EnumWatermarkFileStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.WatermarkFileStatus[] | Prisma.ListEnumWatermarkFileStatusFieldRefInput<$PrismaModel>
|
||||
notIn?: $Enums.WatermarkFileStatus[] | Prisma.ListEnumWatermarkFileStatusFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedEnumWatermarkFileStatusWithAggregatesFilter<$PrismaModel> | $Enums.WatermarkFileStatus
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumWatermarkFileStatusFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumWatermarkFileStatusFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumAssetTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.AssetType | Prisma.EnumAssetTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.AssetType[] | Prisma.ListEnumAssetTypeFieldRefInput<$PrismaModel>
|
||||
@@ -592,30 +677,6 @@ export type EnumAgentTypeFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedEnumAgentTypeFilter<$PrismaModel> | $Enums.AgentType
|
||||
}
|
||||
|
||||
export type JsonFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<JsonFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<JsonFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<JsonFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type JsonFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string[]
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
}
|
||||
|
||||
export type EnumAgentTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.AgentType | Prisma.EnumAgentTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.AgentType[] | Prisma.ListEnumAgentTypeFieldRefInput<$PrismaModel>
|
||||
@@ -626,33 +687,6 @@ export type EnumAgentTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedEnumAgentTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type JsonWithAggregatesFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<JsonWithAggregatesFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonWithAggregatesFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<JsonWithAggregatesFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<JsonWithAggregatesFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type JsonWithAggregatesFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string[]
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedJsonFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedJsonFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumAgentSessionTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.AgentSessionType | Prisma.EnumAgentSessionTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.AgentSessionType[] | Prisma.ListEnumAgentSessionTypeFieldRefInput<$PrismaModel>
|
||||
@@ -936,6 +970,64 @@ export type NestedEnumProjectMemberRoleWithAggregatesFilter<$PrismaModel = never
|
||||
_max?: Prisma.NestedEnumProjectMemberRoleFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumWatermarkStatusFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.WatermarkStatus | Prisma.EnumWatermarkStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.WatermarkStatus[] | Prisma.ListEnumWatermarkStatusFieldRefInput<$PrismaModel>
|
||||
notIn?: $Enums.WatermarkStatus[] | Prisma.ListEnumWatermarkStatusFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedEnumWatermarkStatusFilter<$PrismaModel> | $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type NestedEnumWatermarkStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.WatermarkStatus | Prisma.EnumWatermarkStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.WatermarkStatus[] | Prisma.ListEnumWatermarkStatusFieldRefInput<$PrismaModel>
|
||||
notIn?: $Enums.WatermarkStatus[] | Prisma.ListEnumWatermarkStatusFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedEnumWatermarkStatusWithAggregatesFilter<$PrismaModel> | $Enums.WatermarkStatus
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumWatermarkStatusFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumWatermarkStatusFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedJsonFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<NestedJsonFilterBase<$PrismaModel>>, Exclude<keyof Required<NestedJsonFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<NestedJsonFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<NestedJsonFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type NestedJsonFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string[]
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
}
|
||||
|
||||
export type NestedEnumWatermarkFileStatusFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.WatermarkFileStatus | Prisma.EnumWatermarkFileStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.WatermarkFileStatus[] | Prisma.ListEnumWatermarkFileStatusFieldRefInput<$PrismaModel>
|
||||
notIn?: $Enums.WatermarkFileStatus[] | Prisma.ListEnumWatermarkFileStatusFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedEnumWatermarkFileStatusFilter<$PrismaModel> | $Enums.WatermarkFileStatus
|
||||
}
|
||||
|
||||
export type NestedEnumWatermarkFileStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.WatermarkFileStatus | Prisma.EnumWatermarkFileStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.WatermarkFileStatus[] | Prisma.ListEnumWatermarkFileStatusFieldRefInput<$PrismaModel>
|
||||
notIn?: $Enums.WatermarkFileStatus[] | Prisma.ListEnumWatermarkFileStatusFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedEnumWatermarkFileStatusWithAggregatesFilter<$PrismaModel> | $Enums.WatermarkFileStatus
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumWatermarkFileStatusFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumWatermarkFileStatusFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumAssetTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.AssetType | Prisma.EnumAssetTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.AssetType[] | Prisma.ListEnumAssetTypeFieldRefInput<$PrismaModel>
|
||||
@@ -1258,30 +1350,6 @@ export type NestedEnumAgentTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedEnumAgentTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedJsonFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<NestedJsonFilterBase<$PrismaModel>>, Exclude<keyof Required<NestedJsonFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<NestedJsonFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<NestedJsonFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type NestedJsonFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string[]
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
}
|
||||
|
||||
export type NestedEnumAgentSessionTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.AgentSessionType | Prisma.EnumAgentSessionTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.AgentSessionType[] | Prisma.ListEnumAgentSessionTypeFieldRefInput<$PrismaModel>
|
||||
|
||||
+21
@@ -132,6 +132,7 @@ export const WorkflowTaskType = {
|
||||
transcode_pdf_pages: 'transcode_pdf_pages',
|
||||
transcode_screenshot: 'transcode_screenshot',
|
||||
transcode_image_annotation: 'transcode_image_annotation',
|
||||
transcode_watermark: 'transcode_watermark',
|
||||
ai_metadata_autofill: 'ai_metadata_autofill',
|
||||
chat: 'chat',
|
||||
ai_embedding: 'ai_embedding',
|
||||
@@ -152,6 +153,26 @@ export const WorkflowTaskStatus = {
|
||||
export type WorkflowTaskStatus = (typeof WorkflowTaskStatus)[keyof typeof WorkflowTaskStatus]
|
||||
|
||||
|
||||
export const WatermarkStatus = {
|
||||
disabled: 'disabled',
|
||||
processing: 'processing',
|
||||
ready: 'ready',
|
||||
failed: 'failed'
|
||||
} as const
|
||||
|
||||
export type WatermarkStatus = (typeof WatermarkStatus)[keyof typeof WatermarkStatus]
|
||||
|
||||
|
||||
export const WatermarkFileStatus = {
|
||||
pending: 'pending',
|
||||
processing: 'processing',
|
||||
completed: 'completed',
|
||||
failed: 'failed'
|
||||
} as const
|
||||
|
||||
export type WatermarkFileStatus = (typeof WatermarkFileStatus)[keyof typeof WatermarkFileStatus]
|
||||
|
||||
|
||||
export const AgentType = {
|
||||
chat: 'chat',
|
||||
autofill: 'autofill',
|
||||
|
||||
+34
-4
File diff suppressed because one or more lines are too long
+296
-2
@@ -396,6 +396,9 @@ export const ModelName = {
|
||||
Project: 'Project',
|
||||
ProjectMember: 'ProjectMember',
|
||||
ShareLink: 'ShareLink',
|
||||
WatermarkConfig: 'WatermarkConfig',
|
||||
WatermarkTemplate: 'WatermarkTemplate',
|
||||
WatermarkFile: 'WatermarkFile',
|
||||
Asset: 'Asset',
|
||||
StorageKey: 'StorageKey',
|
||||
AssetMetadataValue: 'AssetMetadataValue',
|
||||
@@ -434,7 +437,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" | "asset" | "storageKey" | "assetMetadataValue" | "assetComment" | "assetCommentAttachment" | "assetEmbedding" | "invite" | "metadataField" | "notification" | "systemSettings" | "task" | "workflowTask" | "agent" | "agentSkill" | "agentSession" | "agentSessionEntry" | "userMetadata" | "model" | "provider" | "collection" | "apiToken" | "aiUsage" | "auditLog"
|
||||
modelProps: "user" | "session" | "account" | "verification" | "authToken" | "team" | "sandbox" | "skill" | "teamMember" | "project" | "projectMember" | "shareLink" | "watermarkConfig" | "watermarkTemplate" | "watermarkFile" | "asset" | "storageKey" | "assetMetadataValue" | "assetComment" | "assetCommentAttachment" | "assetEmbedding" | "invite" | "metadataField" | "notification" | "systemSettings" | "task" | "workflowTask" | "agent" | "agentSkill" | "agentSession" | "agentSessionEntry" | "userMetadata" | "model" | "provider" | "collection" | "apiToken" | "aiUsage" | "auditLog"
|
||||
txIsolationLevel: TransactionIsolationLevel
|
||||
}
|
||||
model: {
|
||||
@@ -1326,6 +1329,228 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
}
|
||||
}
|
||||
}
|
||||
WatermarkConfig: {
|
||||
payload: Prisma.$WatermarkConfigPayload<ExtArgs>
|
||||
fields: Prisma.WatermarkConfigFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.WatermarkConfigFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkConfigPayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.WatermarkConfigFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkConfigPayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.WatermarkConfigFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkConfigPayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.WatermarkConfigFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkConfigPayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.WatermarkConfigFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkConfigPayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.WatermarkConfigCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkConfigPayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.WatermarkConfigCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
createManyAndReturn: {
|
||||
args: Prisma.WatermarkConfigCreateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkConfigPayload>[]
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.WatermarkConfigDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkConfigPayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.WatermarkConfigUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkConfigPayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.WatermarkConfigDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.WatermarkConfigUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateManyAndReturn: {
|
||||
args: Prisma.WatermarkConfigUpdateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkConfigPayload>[]
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.WatermarkConfigUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkConfigPayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.WatermarkConfigAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateWatermarkConfig>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.WatermarkConfigGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.WatermarkConfigGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.WatermarkConfigCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.WatermarkConfigCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
WatermarkTemplate: {
|
||||
payload: Prisma.$WatermarkTemplatePayload<ExtArgs>
|
||||
fields: Prisma.WatermarkTemplateFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.WatermarkTemplateFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkTemplatePayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.WatermarkTemplateFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkTemplatePayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.WatermarkTemplateFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkTemplatePayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.WatermarkTemplateFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkTemplatePayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.WatermarkTemplateFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkTemplatePayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.WatermarkTemplateCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkTemplatePayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.WatermarkTemplateCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
createManyAndReturn: {
|
||||
args: Prisma.WatermarkTemplateCreateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkTemplatePayload>[]
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.WatermarkTemplateDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkTemplatePayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.WatermarkTemplateUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkTemplatePayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.WatermarkTemplateDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.WatermarkTemplateUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateManyAndReturn: {
|
||||
args: Prisma.WatermarkTemplateUpdateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkTemplatePayload>[]
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.WatermarkTemplateUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkTemplatePayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.WatermarkTemplateAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateWatermarkTemplate>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.WatermarkTemplateGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.WatermarkTemplateGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.WatermarkTemplateCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.WatermarkTemplateCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
WatermarkFile: {
|
||||
payload: Prisma.$WatermarkFilePayload<ExtArgs>
|
||||
fields: Prisma.WatermarkFileFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.WatermarkFileFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkFilePayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.WatermarkFileFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkFilePayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.WatermarkFileFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkFilePayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.WatermarkFileFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkFilePayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.WatermarkFileFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkFilePayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.WatermarkFileCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkFilePayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.WatermarkFileCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
createManyAndReturn: {
|
||||
args: Prisma.WatermarkFileCreateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkFilePayload>[]
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.WatermarkFileDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkFilePayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.WatermarkFileUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkFilePayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.WatermarkFileDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.WatermarkFileUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateManyAndReturn: {
|
||||
args: Prisma.WatermarkFileUpdateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkFilePayload>[]
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.WatermarkFileUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$WatermarkFilePayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.WatermarkFileAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateWatermarkFile>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.WatermarkFileGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.WatermarkFileGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.WatermarkFileCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.WatermarkFileCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
Asset: {
|
||||
payload: Prisma.$AssetPayload<ExtArgs>
|
||||
fields: Prisma.AssetFieldRefs
|
||||
@@ -3232,12 +3457,50 @@ export const ShareLinkScalarFieldEnum = {
|
||||
updatedAt: 'updatedAt',
|
||||
projectId: 'projectId',
|
||||
rootFolderId: 'rootFolderId',
|
||||
creatorId: 'creatorId'
|
||||
creatorId: 'creatorId',
|
||||
watermarkConfigId: 'watermarkConfigId',
|
||||
watermarkStatus: 'watermarkStatus'
|
||||
} as const
|
||||
|
||||
export type ShareLinkScalarFieldEnum = (typeof ShareLinkScalarFieldEnum)[keyof typeof ShareLinkScalarFieldEnum]
|
||||
|
||||
|
||||
export const WatermarkConfigScalarFieldEnum = {
|
||||
id: 'id',
|
||||
config: 'config',
|
||||
hash: 'hash',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type WatermarkConfigScalarFieldEnum = (typeof WatermarkConfigScalarFieldEnum)[keyof typeof WatermarkConfigScalarFieldEnum]
|
||||
|
||||
|
||||
export const WatermarkTemplateScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
config: 'config',
|
||||
teamId: 'teamId',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type WatermarkTemplateScalarFieldEnum = (typeof WatermarkTemplateScalarFieldEnum)[keyof typeof WatermarkTemplateScalarFieldEnum]
|
||||
|
||||
|
||||
export const WatermarkFileScalarFieldEnum = {
|
||||
id: 'id',
|
||||
assetId: 'assetId',
|
||||
watermarkConfigId: 'watermarkConfigId',
|
||||
media: 'media',
|
||||
status: 'status',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type WatermarkFileScalarFieldEnum = (typeof WatermarkFileScalarFieldEnum)[keyof typeof WatermarkFileScalarFieldEnum]
|
||||
|
||||
|
||||
export const AssetScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
@@ -3736,6 +3999,34 @@ export type ListEnumProjectMemberRoleFieldRefInput<$PrismaModel> = FieldRefInput
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'WatermarkStatus'
|
||||
*/
|
||||
export type EnumWatermarkStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'WatermarkStatus'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'WatermarkStatus[]'
|
||||
*/
|
||||
export type ListEnumWatermarkStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'WatermarkStatus[]'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'WatermarkFileStatus'
|
||||
*/
|
||||
export type EnumWatermarkFileStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'WatermarkFileStatus'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'WatermarkFileStatus[]'
|
||||
*/
|
||||
export type ListEnumWatermarkFileStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'WatermarkFileStatus[]'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'AssetType'
|
||||
*/
|
||||
@@ -4067,6 +4358,9 @@ export type GlobalOmitConfig = {
|
||||
project?: Prisma.ProjectOmit
|
||||
projectMember?: Prisma.ProjectMemberOmit
|
||||
shareLink?: Prisma.ShareLinkOmit
|
||||
watermarkConfig?: Prisma.WatermarkConfigOmit
|
||||
watermarkTemplate?: Prisma.WatermarkTemplateOmit
|
||||
watermarkFile?: Prisma.WatermarkFileOmit
|
||||
asset?: Prisma.AssetOmit
|
||||
storageKey?: Prisma.StorageKeyOmit
|
||||
assetMetadataValue?: Prisma.AssetMetadataValueOmit
|
||||
|
||||
@@ -63,6 +63,9 @@ export const ModelName = {
|
||||
Project: 'Project',
|
||||
ProjectMember: 'ProjectMember',
|
||||
ShareLink: 'ShareLink',
|
||||
WatermarkConfig: 'WatermarkConfig',
|
||||
WatermarkTemplate: 'WatermarkTemplate',
|
||||
WatermarkFile: 'WatermarkFile',
|
||||
Asset: 'Asset',
|
||||
StorageKey: 'StorageKey',
|
||||
AssetMetadataValue: 'AssetMetadataValue',
|
||||
@@ -269,12 +272,50 @@ export const ShareLinkScalarFieldEnum = {
|
||||
updatedAt: 'updatedAt',
|
||||
projectId: 'projectId',
|
||||
rootFolderId: 'rootFolderId',
|
||||
creatorId: 'creatorId'
|
||||
creatorId: 'creatorId',
|
||||
watermarkConfigId: 'watermarkConfigId',
|
||||
watermarkStatus: 'watermarkStatus'
|
||||
} as const
|
||||
|
||||
export type ShareLinkScalarFieldEnum = (typeof ShareLinkScalarFieldEnum)[keyof typeof ShareLinkScalarFieldEnum]
|
||||
|
||||
|
||||
export const WatermarkConfigScalarFieldEnum = {
|
||||
id: 'id',
|
||||
config: 'config',
|
||||
hash: 'hash',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type WatermarkConfigScalarFieldEnum = (typeof WatermarkConfigScalarFieldEnum)[keyof typeof WatermarkConfigScalarFieldEnum]
|
||||
|
||||
|
||||
export const WatermarkTemplateScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
config: 'config',
|
||||
teamId: 'teamId',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type WatermarkTemplateScalarFieldEnum = (typeof WatermarkTemplateScalarFieldEnum)[keyof typeof WatermarkTemplateScalarFieldEnum]
|
||||
|
||||
|
||||
export const WatermarkFileScalarFieldEnum = {
|
||||
id: 'id',
|
||||
assetId: 'assetId',
|
||||
watermarkConfigId: 'watermarkConfigId',
|
||||
media: 'media',
|
||||
status: 'status',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type WatermarkFileScalarFieldEnum = (typeof WatermarkFileScalarFieldEnum)[keyof typeof WatermarkFileScalarFieldEnum]
|
||||
|
||||
|
||||
export const AssetScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
|
||||
+3
@@ -20,6 +20,9 @@ export type * from './models/TeamMember.ts'
|
||||
export type * from './models/Project.ts'
|
||||
export type * from './models/ProjectMember.ts'
|
||||
export type * from './models/ShareLink.ts'
|
||||
export type * from './models/WatermarkConfig.ts'
|
||||
export type * from './models/WatermarkTemplate.ts'
|
||||
export type * from './models/WatermarkFile.ts'
|
||||
export type * from './models/Asset.ts'
|
||||
export type * from './models/StorageKey.ts'
|
||||
export type * from './models/AssetMetadataValue.ts'
|
||||
|
||||
+294
@@ -368,6 +368,7 @@ export type AssetWhereInput = {
|
||||
projectShareRoot?: Prisma.XOR<Prisma.ProjectNullableScalarRelationFilter, Prisma.ProjectWhereInput> | null
|
||||
shareLinkRootFolder?: Prisma.XOR<Prisma.ShareLinkNullableScalarRelationFilter, Prisma.ShareLinkWhereInput> | null
|
||||
agentSessions?: Prisma.AgentSessionListRelationFilter
|
||||
watermarkFiles?: Prisma.WatermarkFileListRelationFilter
|
||||
}
|
||||
|
||||
export type AssetOrderByWithRelationInput = {
|
||||
@@ -411,6 +412,7 @@ export type AssetOrderByWithRelationInput = {
|
||||
projectShareRoot?: Prisma.ProjectOrderByWithRelationInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkOrderByWithRelationInput
|
||||
agentSessions?: Prisma.AgentSessionOrderByRelationAggregateInput
|
||||
watermarkFiles?: Prisma.WatermarkFileOrderByRelationAggregateInput
|
||||
}
|
||||
|
||||
export type AssetWhereUniqueInput = Prisma.AtLeast<{
|
||||
@@ -458,6 +460,7 @@ export type AssetWhereUniqueInput = Prisma.AtLeast<{
|
||||
projectShareRoot?: Prisma.XOR<Prisma.ProjectNullableScalarRelationFilter, Prisma.ProjectWhereInput> | null
|
||||
shareLinkRootFolder?: Prisma.XOR<Prisma.ShareLinkNullableScalarRelationFilter, Prisma.ShareLinkWhereInput> | null
|
||||
agentSessions?: Prisma.AgentSessionListRelationFilter
|
||||
watermarkFiles?: Prisma.WatermarkFileListRelationFilter
|
||||
}, "id" | "parentIdTargetId">
|
||||
|
||||
export type AssetOrderByWithAggregationInput = {
|
||||
@@ -553,6 +556,7 @@ export type AssetCreateInput = {
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateInput = {
|
||||
@@ -590,6 +594,7 @@ export type AssetUncheckedCreateInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUpdateInput = {
|
||||
@@ -627,6 +632,7 @@ export type AssetUpdateInput = {
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateInput = {
|
||||
@@ -664,6 +670,7 @@ export type AssetUncheckedUpdateInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateManyInput = {
|
||||
@@ -987,6 +994,20 @@ export type AssetUpdateOneRequiredWithoutShareLinkRootFolderNestedInput = {
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.AssetUpdateToOneWithWhereWithoutShareLinkRootFolderInput, Prisma.AssetUpdateWithoutShareLinkRootFolderInput>, Prisma.AssetUncheckedUpdateWithoutShareLinkRootFolderInput>
|
||||
}
|
||||
|
||||
export type AssetCreateNestedOneWithoutWatermarkFilesInput = {
|
||||
create?: Prisma.XOR<Prisma.AssetCreateWithoutWatermarkFilesInput, Prisma.AssetUncheckedCreateWithoutWatermarkFilesInput>
|
||||
connectOrCreate?: Prisma.AssetCreateOrConnectWithoutWatermarkFilesInput
|
||||
connect?: Prisma.AssetWhereUniqueInput
|
||||
}
|
||||
|
||||
export type AssetUpdateOneRequiredWithoutWatermarkFilesNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.AssetCreateWithoutWatermarkFilesInput, Prisma.AssetUncheckedCreateWithoutWatermarkFilesInput>
|
||||
connectOrCreate?: Prisma.AssetCreateOrConnectWithoutWatermarkFilesInput
|
||||
upsert?: Prisma.AssetUpsertWithoutWatermarkFilesInput
|
||||
connect?: Prisma.AssetWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.AssetUpdateToOneWithWhereWithoutWatermarkFilesInput, Prisma.AssetUpdateWithoutWatermarkFilesInput>, Prisma.AssetUncheckedUpdateWithoutWatermarkFilesInput>
|
||||
}
|
||||
|
||||
export type AssetCreatenameNgramInput = {
|
||||
set: string[]
|
||||
}
|
||||
@@ -1342,6 +1363,7 @@ export type AssetCreateWithoutCreatorInput = {
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutCreatorInput = {
|
||||
@@ -1378,6 +1400,7 @@ export type AssetUncheckedCreateWithoutCreatorInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutCreatorInput = {
|
||||
@@ -1468,6 +1491,7 @@ export type AssetCreateWithoutTeamRootFolderInput = {
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutTeamRootFolderInput = {
|
||||
@@ -1504,6 +1528,7 @@ export type AssetUncheckedCreateWithoutTeamRootFolderInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutTeamRootFolderInput = {
|
||||
@@ -1556,6 +1581,7 @@ export type AssetUpdateWithoutTeamRootFolderInput = {
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutTeamRootFolderInput = {
|
||||
@@ -1592,6 +1618,7 @@ export type AssetUncheckedUpdateWithoutTeamRootFolderInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateWithoutProjectRootFolderInput = {
|
||||
@@ -1628,6 +1655,7 @@ export type AssetCreateWithoutProjectRootFolderInput = {
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutProjectRootFolderInput = {
|
||||
@@ -1664,6 +1692,7 @@ export type AssetUncheckedCreateWithoutProjectRootFolderInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutProjectRootFolderInput = {
|
||||
@@ -1705,6 +1734,7 @@ export type AssetCreateWithoutProjectShareRootInput = {
|
||||
projectRootFolder?: Prisma.ProjectCreateNestedOneWithoutRootFolderInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutProjectShareRootInput = {
|
||||
@@ -1741,6 +1771,7 @@ export type AssetUncheckedCreateWithoutProjectShareRootInput = {
|
||||
projectRootFolder?: Prisma.ProjectUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutProjectShareRootInput = {
|
||||
@@ -1782,6 +1813,7 @@ export type AssetCreateWithoutProjectInput = {
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutProjectInput = {
|
||||
@@ -1818,6 +1850,7 @@ export type AssetUncheckedCreateWithoutProjectInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutProjectInput = {
|
||||
@@ -1875,6 +1908,7 @@ export type AssetUpdateWithoutProjectRootFolderInput = {
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutProjectRootFolderInput = {
|
||||
@@ -1911,6 +1945,7 @@ export type AssetUncheckedUpdateWithoutProjectRootFolderInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUpsertWithoutProjectShareRootInput = {
|
||||
@@ -1958,6 +1993,7 @@ export type AssetUpdateWithoutProjectShareRootInput = {
|
||||
projectRootFolder?: Prisma.ProjectUpdateOneWithoutRootFolderNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutProjectShareRootInput = {
|
||||
@@ -1994,6 +2030,7 @@ export type AssetUncheckedUpdateWithoutProjectShareRootInput = {
|
||||
projectRootFolder?: Prisma.ProjectUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUpsertWithWhereUniqueWithoutProjectInput = {
|
||||
@@ -2046,6 +2083,7 @@ export type AssetCreateWithoutShareLinkRootFolderInput = {
|
||||
projectRootFolder?: Prisma.ProjectCreateNestedOneWithoutRootFolderInput
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutShareLinkRootFolderInput = {
|
||||
@@ -2082,6 +2120,7 @@ export type AssetUncheckedCreateWithoutShareLinkRootFolderInput = {
|
||||
projectRootFolder?: Prisma.ProjectUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutShareLinkRootFolderInput = {
|
||||
@@ -2134,6 +2173,7 @@ export type AssetUpdateWithoutShareLinkRootFolderInput = {
|
||||
projectRootFolder?: Prisma.ProjectUpdateOneWithoutRootFolderNestedInput
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutShareLinkRootFolderInput = {
|
||||
@@ -2170,6 +2210,171 @@ export type AssetUncheckedUpdateWithoutShareLinkRootFolderInput = {
|
||||
projectRootFolder?: Prisma.ProjectUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateWithoutWatermarkFilesInput = {
|
||||
id?: string
|
||||
name?: string
|
||||
nameNgram?: Prisma.AssetCreatenameNgramInput | string[]
|
||||
type: $Enums.AssetType
|
||||
mediaType?: string | null
|
||||
fileCount?: number
|
||||
sizeByte?: bigint | number
|
||||
status: $Enums.AssetStatus
|
||||
transcodeTaskId?: string | null
|
||||
media?:PrismaJson.MediaInfo | Prisma.NullableJsonNullValueInput
|
||||
autofillContext?: string | null
|
||||
isDeleted?: boolean
|
||||
deletedAt?: Date | string | null
|
||||
sortIndex?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
parent?: Prisma.AssetCreateNestedOneWithoutChildrenInput
|
||||
children?: Prisma.AssetCreateNestedManyWithoutParentInput
|
||||
target?: Prisma.AssetCreateNestedOneWithoutSymlinksInput
|
||||
symlinks?: Prisma.AssetCreateNestedManyWithoutTargetInput
|
||||
storageKey?: Prisma.StorageKeyCreateNestedOneWithoutAssetsInput
|
||||
metadataValues?: Prisma.AssetMetadataValueCreateNestedManyWithoutAssetInput
|
||||
creator?: Prisma.UserCreateNestedOneWithoutAssetsInput
|
||||
task?: Prisma.TaskCreateNestedOneWithoutAssetsInput
|
||||
project?: Prisma.ProjectCreateNestedOneWithoutAssetsInput
|
||||
comments?: Prisma.AssetCommentCreateNestedManyWithoutAssetInput
|
||||
commentAttachments?: Prisma.AssetCommentAttachmentCreateNestedManyWithoutAssetInput
|
||||
notifications?: Prisma.NotificationCreateNestedManyWithoutAssetInput
|
||||
embeddings?: Prisma.AssetEmbeddingCreateNestedManyWithoutAssetInput
|
||||
teamRootFolder?: Prisma.TeamCreateNestedOneWithoutRootFolderInput
|
||||
projectRootFolder?: Prisma.ProjectCreateNestedOneWithoutRootFolderInput
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutWatermarkFilesInput = {
|
||||
id?: string
|
||||
name?: string
|
||||
nameNgram?: Prisma.AssetCreatenameNgramInput | string[]
|
||||
type: $Enums.AssetType
|
||||
mediaType?: string | null
|
||||
fileCount?: number
|
||||
sizeByte?: bigint | number
|
||||
status: $Enums.AssetStatus
|
||||
transcodeTaskId?: string | null
|
||||
media?:PrismaJson.MediaInfo | Prisma.NullableJsonNullValueInput
|
||||
autofillContext?: string | null
|
||||
isDeleted?: boolean
|
||||
deletedAt?: Date | string | null
|
||||
sortIndex?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
parentId?: string | null
|
||||
targetId?: string | null
|
||||
storageKeyId?: string | null
|
||||
creatorId?: string | null
|
||||
taskId?: string | null
|
||||
projectId?: string | null
|
||||
children?: Prisma.AssetUncheckedCreateNestedManyWithoutParentInput
|
||||
symlinks?: Prisma.AssetUncheckedCreateNestedManyWithoutTargetInput
|
||||
metadataValues?: Prisma.AssetMetadataValueUncheckedCreateNestedManyWithoutAssetInput
|
||||
comments?: Prisma.AssetCommentUncheckedCreateNestedManyWithoutAssetInput
|
||||
commentAttachments?: Prisma.AssetCommentAttachmentUncheckedCreateNestedManyWithoutAssetInput
|
||||
notifications?: Prisma.NotificationUncheckedCreateNestedManyWithoutAssetInput
|
||||
embeddings?: Prisma.AssetEmbeddingUncheckedCreateNestedManyWithoutAssetInput
|
||||
teamRootFolder?: Prisma.TeamUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
projectRootFolder?: Prisma.ProjectUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutWatermarkFilesInput = {
|
||||
where: Prisma.AssetWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.AssetCreateWithoutWatermarkFilesInput, Prisma.AssetUncheckedCreateWithoutWatermarkFilesInput>
|
||||
}
|
||||
|
||||
export type AssetUpsertWithoutWatermarkFilesInput = {
|
||||
update: Prisma.XOR<Prisma.AssetUpdateWithoutWatermarkFilesInput, Prisma.AssetUncheckedUpdateWithoutWatermarkFilesInput>
|
||||
create: Prisma.XOR<Prisma.AssetCreateWithoutWatermarkFilesInput, Prisma.AssetUncheckedCreateWithoutWatermarkFilesInput>
|
||||
where?: Prisma.AssetWhereInput
|
||||
}
|
||||
|
||||
export type AssetUpdateToOneWithWhereWithoutWatermarkFilesInput = {
|
||||
where?: Prisma.AssetWhereInput
|
||||
data: Prisma.XOR<Prisma.AssetUpdateWithoutWatermarkFilesInput, Prisma.AssetUncheckedUpdateWithoutWatermarkFilesInput>
|
||||
}
|
||||
|
||||
export type AssetUpdateWithoutWatermarkFilesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
nameNgram?: Prisma.AssetUpdatenameNgramInput | string[]
|
||||
type?: Prisma.EnumAssetTypeFieldUpdateOperationsInput | $Enums.AssetType
|
||||
mediaType?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
fileCount?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
sizeByte?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
status?: Prisma.EnumAssetStatusFieldUpdateOperationsInput | $Enums.AssetStatus
|
||||
transcodeTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
media?:PrismaJson.MediaInfo | Prisma.NullableJsonNullValueInput
|
||||
autofillContext?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
isDeleted?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
sortIndex?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
parent?: Prisma.AssetUpdateOneWithoutChildrenNestedInput
|
||||
children?: Prisma.AssetUpdateManyWithoutParentNestedInput
|
||||
target?: Prisma.AssetUpdateOneWithoutSymlinksNestedInput
|
||||
symlinks?: Prisma.AssetUpdateManyWithoutTargetNestedInput
|
||||
storageKey?: Prisma.StorageKeyUpdateOneWithoutAssetsNestedInput
|
||||
metadataValues?: Prisma.AssetMetadataValueUpdateManyWithoutAssetNestedInput
|
||||
creator?: Prisma.UserUpdateOneWithoutAssetsNestedInput
|
||||
task?: Prisma.TaskUpdateOneWithoutAssetsNestedInput
|
||||
project?: Prisma.ProjectUpdateOneWithoutAssetsNestedInput
|
||||
comments?: Prisma.AssetCommentUpdateManyWithoutAssetNestedInput
|
||||
commentAttachments?: Prisma.AssetCommentAttachmentUpdateManyWithoutAssetNestedInput
|
||||
notifications?: Prisma.NotificationUpdateManyWithoutAssetNestedInput
|
||||
embeddings?: Prisma.AssetEmbeddingUpdateManyWithoutAssetNestedInput
|
||||
teamRootFolder?: Prisma.TeamUpdateOneWithoutRootFolderNestedInput
|
||||
projectRootFolder?: Prisma.ProjectUpdateOneWithoutRootFolderNestedInput
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutWatermarkFilesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
nameNgram?: Prisma.AssetUpdatenameNgramInput | string[]
|
||||
type?: Prisma.EnumAssetTypeFieldUpdateOperationsInput | $Enums.AssetType
|
||||
mediaType?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
fileCount?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
sizeByte?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
status?: Prisma.EnumAssetStatusFieldUpdateOperationsInput | $Enums.AssetStatus
|
||||
transcodeTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
media?:PrismaJson.MediaInfo | Prisma.NullableJsonNullValueInput
|
||||
autofillContext?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
isDeleted?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
sortIndex?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
parentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
targetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
storageKeyId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
projectId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
children?: Prisma.AssetUncheckedUpdateManyWithoutParentNestedInput
|
||||
symlinks?: Prisma.AssetUncheckedUpdateManyWithoutTargetNestedInput
|
||||
metadataValues?: Prisma.AssetMetadataValueUncheckedUpdateManyWithoutAssetNestedInput
|
||||
comments?: Prisma.AssetCommentUncheckedUpdateManyWithoutAssetNestedInput
|
||||
commentAttachments?: Prisma.AssetCommentAttachmentUncheckedUpdateManyWithoutAssetNestedInput
|
||||
notifications?: Prisma.NotificationUncheckedUpdateManyWithoutAssetNestedInput
|
||||
embeddings?: Prisma.AssetEmbeddingUncheckedUpdateManyWithoutAssetNestedInput
|
||||
teamRootFolder?: Prisma.TeamUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
projectRootFolder?: Prisma.ProjectUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateWithoutChildrenInput = {
|
||||
@@ -2206,6 +2411,7 @@ export type AssetCreateWithoutChildrenInput = {
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutChildrenInput = {
|
||||
@@ -2242,6 +2448,7 @@ export type AssetUncheckedCreateWithoutChildrenInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutChildrenInput = {
|
||||
@@ -2283,6 +2490,7 @@ export type AssetCreateWithoutParentInput = {
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutParentInput = {
|
||||
@@ -2319,6 +2527,7 @@ export type AssetUncheckedCreateWithoutParentInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutParentInput = {
|
||||
@@ -2365,6 +2574,7 @@ export type AssetCreateWithoutSymlinksInput = {
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutSymlinksInput = {
|
||||
@@ -2401,6 +2611,7 @@ export type AssetUncheckedCreateWithoutSymlinksInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutSymlinksInput = {
|
||||
@@ -2442,6 +2653,7 @@ export type AssetCreateWithoutTargetInput = {
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutTargetInput = {
|
||||
@@ -2478,6 +2690,7 @@ export type AssetUncheckedCreateWithoutTargetInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutTargetInput = {
|
||||
@@ -2535,6 +2748,7 @@ export type AssetUpdateWithoutChildrenInput = {
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutChildrenInput = {
|
||||
@@ -2571,6 +2785,7 @@ export type AssetUncheckedUpdateWithoutChildrenInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUpsertWithWhereUniqueWithoutParentInput = {
|
||||
@@ -2634,6 +2849,7 @@ export type AssetUpdateWithoutSymlinksInput = {
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutSymlinksInput = {
|
||||
@@ -2670,6 +2886,7 @@ export type AssetUncheckedUpdateWithoutSymlinksInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUpsertWithWhereUniqueWithoutTargetInput = {
|
||||
@@ -2722,6 +2939,7 @@ export type AssetCreateWithoutStorageKeyInput = {
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutStorageKeyInput = {
|
||||
@@ -2758,6 +2976,7 @@ export type AssetUncheckedCreateWithoutStorageKeyInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutStorageKeyInput = {
|
||||
@@ -2820,6 +3039,7 @@ export type AssetCreateWithoutMetadataValuesInput = {
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutMetadataValuesInput = {
|
||||
@@ -2856,6 +3076,7 @@ export type AssetUncheckedCreateWithoutMetadataValuesInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutMetadataValuesInput = {
|
||||
@@ -2908,6 +3129,7 @@ export type AssetUpdateWithoutMetadataValuesInput = {
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutMetadataValuesInput = {
|
||||
@@ -2944,6 +3166,7 @@ export type AssetUncheckedUpdateWithoutMetadataValuesInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateWithoutCommentsInput = {
|
||||
@@ -2980,6 +3203,7 @@ export type AssetCreateWithoutCommentsInput = {
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutCommentsInput = {
|
||||
@@ -3016,6 +3240,7 @@ export type AssetUncheckedCreateWithoutCommentsInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutCommentsInput = {
|
||||
@@ -3068,6 +3293,7 @@ export type AssetUpdateWithoutCommentsInput = {
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutCommentsInput = {
|
||||
@@ -3104,6 +3330,7 @@ export type AssetUncheckedUpdateWithoutCommentsInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateWithoutCommentAttachmentsInput = {
|
||||
@@ -3140,6 +3367,7 @@ export type AssetCreateWithoutCommentAttachmentsInput = {
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutCommentAttachmentsInput = {
|
||||
@@ -3176,6 +3404,7 @@ export type AssetUncheckedCreateWithoutCommentAttachmentsInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutCommentAttachmentsInput = {
|
||||
@@ -3228,6 +3457,7 @@ export type AssetUpdateWithoutCommentAttachmentsInput = {
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutCommentAttachmentsInput = {
|
||||
@@ -3264,6 +3494,7 @@ export type AssetUncheckedUpdateWithoutCommentAttachmentsInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateWithoutEmbeddingsInput = {
|
||||
@@ -3300,6 +3531,7 @@ export type AssetCreateWithoutEmbeddingsInput = {
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutEmbeddingsInput = {
|
||||
@@ -3336,6 +3568,7 @@ export type AssetUncheckedCreateWithoutEmbeddingsInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutEmbeddingsInput = {
|
||||
@@ -3388,6 +3621,7 @@ export type AssetUpdateWithoutEmbeddingsInput = {
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutEmbeddingsInput = {
|
||||
@@ -3424,6 +3658,7 @@ export type AssetUncheckedUpdateWithoutEmbeddingsInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateWithoutNotificationsInput = {
|
||||
@@ -3460,6 +3695,7 @@ export type AssetCreateWithoutNotificationsInput = {
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutNotificationsInput = {
|
||||
@@ -3496,6 +3732,7 @@ export type AssetUncheckedCreateWithoutNotificationsInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutNotificationsInput = {
|
||||
@@ -3548,6 +3785,7 @@ export type AssetUpdateWithoutNotificationsInput = {
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutNotificationsInput = {
|
||||
@@ -3584,6 +3822,7 @@ export type AssetUncheckedUpdateWithoutNotificationsInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateWithoutTaskInput = {
|
||||
@@ -3620,6 +3859,7 @@ export type AssetCreateWithoutTaskInput = {
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutTaskInput = {
|
||||
@@ -3656,6 +3896,7 @@ export type AssetUncheckedCreateWithoutTaskInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedCreateNestedManyWithoutAssetInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutTaskInput = {
|
||||
@@ -3718,6 +3959,7 @@ export type AssetCreateWithoutAgentSessionsInput = {
|
||||
projectRootFolder?: Prisma.ProjectCreateNestedOneWithoutRootFolderInput
|
||||
projectShareRoot?: Prisma.ProjectCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkCreateNestedOneWithoutRootFolderInput
|
||||
watermarkFiles?: Prisma.WatermarkFileCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedCreateWithoutAgentSessionsInput = {
|
||||
@@ -3754,6 +3996,7 @@ export type AssetUncheckedCreateWithoutAgentSessionsInput = {
|
||||
projectRootFolder?: Prisma.ProjectUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
projectShareRoot?: Prisma.ProjectUncheckedCreateNestedOneWithoutShareRootInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedCreateNestedOneWithoutRootFolderInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedCreateNestedManyWithoutAssetInput
|
||||
}
|
||||
|
||||
export type AssetCreateOrConnectWithoutAgentSessionsInput = {
|
||||
@@ -3806,6 +4049,7 @@ export type AssetUpdateWithoutAgentSessionsInput = {
|
||||
projectRootFolder?: Prisma.ProjectUpdateOneWithoutRootFolderNestedInput
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutAgentSessionsInput = {
|
||||
@@ -3842,6 +4086,7 @@ export type AssetUncheckedUpdateWithoutAgentSessionsInput = {
|
||||
projectRootFolder?: Prisma.ProjectUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetCreateManyCreatorInput = {
|
||||
@@ -3902,6 +4147,7 @@ export type AssetUpdateWithoutCreatorInput = {
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutCreatorInput = {
|
||||
@@ -3938,6 +4184,7 @@ export type AssetUncheckedUpdateWithoutCreatorInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateManyWithoutCreatorInput = {
|
||||
@@ -4022,6 +4269,7 @@ export type AssetUpdateWithoutProjectInput = {
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutProjectInput = {
|
||||
@@ -4058,6 +4306,7 @@ export type AssetUncheckedUpdateWithoutProjectInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateManyWithoutProjectInput = {
|
||||
@@ -4166,6 +4415,7 @@ export type AssetUpdateWithoutParentInput = {
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutParentInput = {
|
||||
@@ -4202,6 +4452,7 @@ export type AssetUncheckedUpdateWithoutParentInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateManyWithoutParentInput = {
|
||||
@@ -4262,6 +4513,7 @@ export type AssetUpdateWithoutTargetInput = {
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutTargetInput = {
|
||||
@@ -4298,6 +4550,7 @@ export type AssetUncheckedUpdateWithoutTargetInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateManyWithoutTargetInput = {
|
||||
@@ -4382,6 +4635,7 @@ export type AssetUpdateWithoutStorageKeyInput = {
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutStorageKeyInput = {
|
||||
@@ -4418,6 +4672,7 @@ export type AssetUncheckedUpdateWithoutStorageKeyInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateManyWithoutStorageKeyInput = {
|
||||
@@ -4502,6 +4757,7 @@ export type AssetUpdateWithoutTaskInput = {
|
||||
projectShareRoot?: Prisma.ProjectUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateWithoutTaskInput = {
|
||||
@@ -4538,6 +4794,7 @@ export type AssetUncheckedUpdateWithoutTaskInput = {
|
||||
projectShareRoot?: Prisma.ProjectUncheckedUpdateOneWithoutShareRootNestedInput
|
||||
shareLinkRootFolder?: Prisma.ShareLinkUncheckedUpdateOneWithoutRootFolderNestedInput
|
||||
agentSessions?: Prisma.AgentSessionUncheckedUpdateManyWithoutAssetNestedInput
|
||||
watermarkFiles?: Prisma.WatermarkFileUncheckedUpdateManyWithoutAssetNestedInput
|
||||
}
|
||||
|
||||
export type AssetUncheckedUpdateManyWithoutTaskInput = {
|
||||
@@ -4578,6 +4835,7 @@ export type AssetCountOutputType = {
|
||||
notifications: number
|
||||
embeddings: number
|
||||
agentSessions: number
|
||||
watermarkFiles: number
|
||||
}
|
||||
|
||||
export type AssetCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
@@ -4589,6 +4847,7 @@ export type AssetCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.
|
||||
notifications?: boolean | AssetCountOutputTypeCountNotificationsArgs
|
||||
embeddings?: boolean | AssetCountOutputTypeCountEmbeddingsArgs
|
||||
agentSessions?: boolean | AssetCountOutputTypeCountAgentSessionsArgs
|
||||
watermarkFiles?: boolean | AssetCountOutputTypeCountWatermarkFilesArgs
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4657,6 +4916,13 @@ export type AssetCountOutputTypeCountAgentSessionsArgs<ExtArgs extends runtime.T
|
||||
where?: Prisma.AgentSessionWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* AssetCountOutputType without action
|
||||
*/
|
||||
export type AssetCountOutputTypeCountWatermarkFilesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.WatermarkFileWhereInput
|
||||
}
|
||||
|
||||
|
||||
export type AssetSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
@@ -4699,6 +4965,7 @@ export type AssetSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs =
|
||||
projectShareRoot?: boolean | Prisma.Asset$projectShareRootArgs<ExtArgs>
|
||||
shareLinkRootFolder?: boolean | Prisma.Asset$shareLinkRootFolderArgs<ExtArgs>
|
||||
agentSessions?: boolean | Prisma.Asset$agentSessionsArgs<ExtArgs>
|
||||
watermarkFiles?: boolean | Prisma.Asset$watermarkFilesArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.AssetCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["asset"]>
|
||||
|
||||
@@ -4809,6 +5076,7 @@ export type AssetInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs =
|
||||
projectShareRoot?: boolean | Prisma.Asset$projectShareRootArgs<ExtArgs>
|
||||
shareLinkRootFolder?: boolean | Prisma.Asset$shareLinkRootFolderArgs<ExtArgs>
|
||||
agentSessions?: boolean | Prisma.Asset$agentSessionsArgs<ExtArgs>
|
||||
watermarkFiles?: boolean | Prisma.Asset$watermarkFilesArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.AssetCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
export type AssetIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
@@ -4849,6 +5117,7 @@ export type $AssetPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
projectShareRoot: Prisma.$ProjectPayload<ExtArgs> | null
|
||||
shareLinkRootFolder: Prisma.$ShareLinkPayload<ExtArgs> | null
|
||||
agentSessions: Prisma.$AgentSessionPayload<ExtArgs>[]
|
||||
watermarkFiles: Prisma.$WatermarkFilePayload<ExtArgs>[]
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
@@ -5288,6 +5557,7 @@ export interface Prisma__AssetClient<T, Null = never, ExtArgs extends runtime.Ty
|
||||
projectShareRoot<T extends Prisma.Asset$projectShareRootArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Asset$projectShareRootArgs<ExtArgs>>): Prisma.Prisma__ProjectClient<runtime.Types.Result.GetResult<Prisma.$ProjectPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
shareLinkRootFolder<T extends Prisma.Asset$shareLinkRootFolderArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Asset$shareLinkRootFolderArgs<ExtArgs>>): Prisma.Prisma__ShareLinkClient<runtime.Types.Result.GetResult<Prisma.$ShareLinkPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
agentSessions<T extends Prisma.Asset$agentSessionsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Asset$agentSessionsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AgentSessionPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
watermarkFiles<T extends Prisma.Asset$watermarkFilesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Asset$watermarkFilesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$WatermarkFilePayload<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.
|
||||
@@ -6121,6 +6391,30 @@ export type Asset$agentSessionsArgs<ExtArgs extends runtime.Types.Extensions.Int
|
||||
distinct?: Prisma.AgentSessionScalarFieldEnum | Prisma.AgentSessionScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Asset.watermarkFiles
|
||||
*/
|
||||
export type Asset$watermarkFilesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the WatermarkFile
|
||||
*/
|
||||
select?: Prisma.WatermarkFileSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the WatermarkFile
|
||||
*/
|
||||
omit?: Prisma.WatermarkFileOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.WatermarkFileInclude<ExtArgs> | null
|
||||
where?: Prisma.WatermarkFileWhereInput
|
||||
orderBy?: Prisma.WatermarkFileOrderByWithRelationInput | Prisma.WatermarkFileOrderByWithRelationInput[]
|
||||
cursor?: Prisma.WatermarkFileWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.WatermarkFileScalarFieldEnum | Prisma.WatermarkFileScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Asset without action
|
||||
*/
|
||||
|
||||
+294
-1
@@ -39,6 +39,8 @@ export type ShareLinkMinAggregateOutputType = {
|
||||
projectId: string | null
|
||||
rootFolderId: string | null
|
||||
creatorId: string | null
|
||||
watermarkConfigId: string | null
|
||||
watermarkStatus: $Enums.WatermarkStatus | null
|
||||
}
|
||||
|
||||
export type ShareLinkMaxAggregateOutputType = {
|
||||
@@ -54,6 +56,8 @@ export type ShareLinkMaxAggregateOutputType = {
|
||||
projectId: string | null
|
||||
rootFolderId: string | null
|
||||
creatorId: string | null
|
||||
watermarkConfigId: string | null
|
||||
watermarkStatus: $Enums.WatermarkStatus | null
|
||||
}
|
||||
|
||||
export type ShareLinkCountAggregateOutputType = {
|
||||
@@ -70,6 +74,8 @@ export type ShareLinkCountAggregateOutputType = {
|
||||
projectId: number
|
||||
rootFolderId: number
|
||||
creatorId: number
|
||||
watermarkConfigId: number
|
||||
watermarkStatus: number
|
||||
_all: number
|
||||
}
|
||||
|
||||
@@ -87,6 +93,8 @@ export type ShareLinkMinAggregateInputType = {
|
||||
projectId?: true
|
||||
rootFolderId?: true
|
||||
creatorId?: true
|
||||
watermarkConfigId?: true
|
||||
watermarkStatus?: true
|
||||
}
|
||||
|
||||
export type ShareLinkMaxAggregateInputType = {
|
||||
@@ -102,6 +110,8 @@ export type ShareLinkMaxAggregateInputType = {
|
||||
projectId?: true
|
||||
rootFolderId?: true
|
||||
creatorId?: true
|
||||
watermarkConfigId?: true
|
||||
watermarkStatus?: true
|
||||
}
|
||||
|
||||
export type ShareLinkCountAggregateInputType = {
|
||||
@@ -118,6 +128,8 @@ export type ShareLinkCountAggregateInputType = {
|
||||
projectId?: true
|
||||
rootFolderId?: true
|
||||
creatorId?: true
|
||||
watermarkConfigId?: true
|
||||
watermarkStatus?: true
|
||||
_all?: true
|
||||
}
|
||||
|
||||
@@ -207,6 +219,8 @@ export type ShareLinkGroupByOutputType = {
|
||||
projectId: string
|
||||
rootFolderId: string
|
||||
creatorId: string | null
|
||||
watermarkConfigId: string | null
|
||||
watermarkStatus: $Enums.WatermarkStatus
|
||||
_count: ShareLinkCountAggregateOutputType | null
|
||||
_min: ShareLinkMinAggregateOutputType | null
|
||||
_max: ShareLinkMaxAggregateOutputType | null
|
||||
@@ -244,9 +258,12 @@ export type ShareLinkWhereInput = {
|
||||
projectId?: Prisma.StringFilter<"ShareLink"> | string
|
||||
rootFolderId?: Prisma.StringFilter<"ShareLink"> | string
|
||||
creatorId?: Prisma.StringNullableFilter<"ShareLink"> | string | null
|
||||
watermarkConfigId?: Prisma.StringNullableFilter<"ShareLink"> | string | null
|
||||
watermarkStatus?: Prisma.EnumWatermarkStatusFilter<"ShareLink"> | $Enums.WatermarkStatus
|
||||
project?: Prisma.XOR<Prisma.ProjectScalarRelationFilter, Prisma.ProjectWhereInput>
|
||||
rootFolder?: Prisma.XOR<Prisma.AssetScalarRelationFilter, Prisma.AssetWhereInput>
|
||||
creator?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
|
||||
watermarkConfig?: Prisma.XOR<Prisma.WatermarkConfigNullableScalarRelationFilter, Prisma.WatermarkConfigWhereInput> | null
|
||||
}
|
||||
|
||||
export type ShareLinkOrderByWithRelationInput = {
|
||||
@@ -263,9 +280,12 @@ export type ShareLinkOrderByWithRelationInput = {
|
||||
projectId?: Prisma.SortOrder
|
||||
rootFolderId?: Prisma.SortOrder
|
||||
creatorId?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
watermarkConfigId?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
watermarkStatus?: Prisma.SortOrder
|
||||
project?: Prisma.ProjectOrderByWithRelationInput
|
||||
rootFolder?: Prisma.AssetOrderByWithRelationInput
|
||||
creator?: Prisma.UserOrderByWithRelationInput
|
||||
watermarkConfig?: Prisma.WatermarkConfigOrderByWithRelationInput
|
||||
}
|
||||
|
||||
export type ShareLinkWhereUniqueInput = Prisma.AtLeast<{
|
||||
@@ -285,9 +305,12 @@ export type ShareLinkWhereUniqueInput = Prisma.AtLeast<{
|
||||
updatedAt?: Prisma.DateTimeFilter<"ShareLink"> | Date | string
|
||||
projectId?: Prisma.StringFilter<"ShareLink"> | string
|
||||
creatorId?: Prisma.StringNullableFilter<"ShareLink"> | string | null
|
||||
watermarkConfigId?: Prisma.StringNullableFilter<"ShareLink"> | string | null
|
||||
watermarkStatus?: Prisma.EnumWatermarkStatusFilter<"ShareLink"> | $Enums.WatermarkStatus
|
||||
project?: Prisma.XOR<Prisma.ProjectScalarRelationFilter, Prisma.ProjectWhereInput>
|
||||
rootFolder?: Prisma.XOR<Prisma.AssetScalarRelationFilter, Prisma.AssetWhereInput>
|
||||
creator?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
|
||||
watermarkConfig?: Prisma.XOR<Prisma.WatermarkConfigNullableScalarRelationFilter, Prisma.WatermarkConfigWhereInput> | null
|
||||
}, "id" | "rootFolderId">
|
||||
|
||||
export type ShareLinkOrderByWithAggregationInput = {
|
||||
@@ -304,6 +327,8 @@ export type ShareLinkOrderByWithAggregationInput = {
|
||||
projectId?: Prisma.SortOrder
|
||||
rootFolderId?: Prisma.SortOrder
|
||||
creatorId?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
watermarkConfigId?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
watermarkStatus?: Prisma.SortOrder
|
||||
_count?: Prisma.ShareLinkCountOrderByAggregateInput
|
||||
_max?: Prisma.ShareLinkMaxOrderByAggregateInput
|
||||
_min?: Prisma.ShareLinkMinOrderByAggregateInput
|
||||
@@ -326,6 +351,8 @@ export type ShareLinkScalarWhereWithAggregatesInput = {
|
||||
projectId?: Prisma.StringWithAggregatesFilter<"ShareLink"> | string
|
||||
rootFolderId?: Prisma.StringWithAggregatesFilter<"ShareLink"> | string
|
||||
creatorId?: Prisma.StringNullableWithAggregatesFilter<"ShareLink"> | string | null
|
||||
watermarkConfigId?: Prisma.StringNullableWithAggregatesFilter<"ShareLink"> | string | null
|
||||
watermarkStatus?: Prisma.EnumWatermarkStatusWithAggregatesFilter<"ShareLink"> | $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkCreateInput = {
|
||||
@@ -339,9 +366,11 @@ export type ShareLinkCreateInput = {
|
||||
fieldVisibility?:PrismaJson.ShareLinkFieldVisibility | Prisma.NullableJsonNullValueInput
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
watermarkStatus?: $Enums.WatermarkStatus
|
||||
project: Prisma.ProjectCreateNestedOneWithoutShareLinksInput
|
||||
rootFolder: Prisma.AssetCreateNestedOneWithoutShareLinkRootFolderInput
|
||||
creator?: Prisma.UserCreateNestedOneWithoutShareLinksInput
|
||||
watermarkConfig?: Prisma.WatermarkConfigCreateNestedOneWithoutShareLinksInput
|
||||
}
|
||||
|
||||
export type ShareLinkUncheckedCreateInput = {
|
||||
@@ -358,6 +387,8 @@ export type ShareLinkUncheckedCreateInput = {
|
||||
projectId: string
|
||||
rootFolderId: string
|
||||
creatorId?: string | null
|
||||
watermarkConfigId?: string | null
|
||||
watermarkStatus?: $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkUpdateInput = {
|
||||
@@ -371,9 +402,11 @@ export type ShareLinkUpdateInput = {
|
||||
fieldVisibility?:PrismaJson.ShareLinkFieldVisibility | Prisma.NullableJsonNullValueInput
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
watermarkStatus?: Prisma.EnumWatermarkStatusFieldUpdateOperationsInput | $Enums.WatermarkStatus
|
||||
project?: Prisma.ProjectUpdateOneRequiredWithoutShareLinksNestedInput
|
||||
rootFolder?: Prisma.AssetUpdateOneRequiredWithoutShareLinkRootFolderNestedInput
|
||||
creator?: Prisma.UserUpdateOneWithoutShareLinksNestedInput
|
||||
watermarkConfig?: Prisma.WatermarkConfigUpdateOneWithoutShareLinksNestedInput
|
||||
}
|
||||
|
||||
export type ShareLinkUncheckedUpdateInput = {
|
||||
@@ -390,6 +423,8 @@ export type ShareLinkUncheckedUpdateInput = {
|
||||
projectId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
rootFolderId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
watermarkConfigId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
watermarkStatus?: Prisma.EnumWatermarkStatusFieldUpdateOperationsInput | $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkCreateManyInput = {
|
||||
@@ -406,6 +441,8 @@ export type ShareLinkCreateManyInput = {
|
||||
projectId: string
|
||||
rootFolderId: string
|
||||
creatorId?: string | null
|
||||
watermarkConfigId?: string | null
|
||||
watermarkStatus?: $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkUpdateManyMutationInput = {
|
||||
@@ -419,6 +456,7 @@ export type ShareLinkUpdateManyMutationInput = {
|
||||
fieldVisibility?:PrismaJson.ShareLinkFieldVisibility | Prisma.NullableJsonNullValueInput
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
watermarkStatus?: Prisma.EnumWatermarkStatusFieldUpdateOperationsInput | $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkUncheckedUpdateManyInput = {
|
||||
@@ -435,6 +473,8 @@ export type ShareLinkUncheckedUpdateManyInput = {
|
||||
projectId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
rootFolderId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
watermarkConfigId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
watermarkStatus?: Prisma.EnumWatermarkStatusFieldUpdateOperationsInput | $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkListRelationFilter = {
|
||||
@@ -461,6 +501,8 @@ export type ShareLinkCountOrderByAggregateInput = {
|
||||
projectId?: Prisma.SortOrder
|
||||
rootFolderId?: Prisma.SortOrder
|
||||
creatorId?: Prisma.SortOrder
|
||||
watermarkConfigId?: Prisma.SortOrder
|
||||
watermarkStatus?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type ShareLinkMaxOrderByAggregateInput = {
|
||||
@@ -476,6 +518,8 @@ export type ShareLinkMaxOrderByAggregateInput = {
|
||||
projectId?: Prisma.SortOrder
|
||||
rootFolderId?: Prisma.SortOrder
|
||||
creatorId?: Prisma.SortOrder
|
||||
watermarkConfigId?: Prisma.SortOrder
|
||||
watermarkStatus?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type ShareLinkMinOrderByAggregateInput = {
|
||||
@@ -491,6 +535,8 @@ export type ShareLinkMinOrderByAggregateInput = {
|
||||
projectId?: Prisma.SortOrder
|
||||
rootFolderId?: Prisma.SortOrder
|
||||
creatorId?: Prisma.SortOrder
|
||||
watermarkConfigId?: Prisma.SortOrder
|
||||
watermarkStatus?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type ShareLinkNullableScalarRelationFilter = {
|
||||
@@ -582,6 +628,52 @@ export type ShareLinkUncheckedUpdateManyWithoutProjectNestedInput = {
|
||||
deleteMany?: Prisma.ShareLinkScalarWhereInput | Prisma.ShareLinkScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type EnumWatermarkStatusFieldUpdateOperationsInput = {
|
||||
set?: $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkCreateNestedManyWithoutWatermarkConfigInput = {
|
||||
create?: Prisma.XOR<Prisma.ShareLinkCreateWithoutWatermarkConfigInput, Prisma.ShareLinkUncheckedCreateWithoutWatermarkConfigInput> | Prisma.ShareLinkCreateWithoutWatermarkConfigInput[] | Prisma.ShareLinkUncheckedCreateWithoutWatermarkConfigInput[]
|
||||
connectOrCreate?: Prisma.ShareLinkCreateOrConnectWithoutWatermarkConfigInput | Prisma.ShareLinkCreateOrConnectWithoutWatermarkConfigInput[]
|
||||
createMany?: Prisma.ShareLinkCreateManyWatermarkConfigInputEnvelope
|
||||
connect?: Prisma.ShareLinkWhereUniqueInput | Prisma.ShareLinkWhereUniqueInput[]
|
||||
}
|
||||
|
||||
export type ShareLinkUncheckedCreateNestedManyWithoutWatermarkConfigInput = {
|
||||
create?: Prisma.XOR<Prisma.ShareLinkCreateWithoutWatermarkConfigInput, Prisma.ShareLinkUncheckedCreateWithoutWatermarkConfigInput> | Prisma.ShareLinkCreateWithoutWatermarkConfigInput[] | Prisma.ShareLinkUncheckedCreateWithoutWatermarkConfigInput[]
|
||||
connectOrCreate?: Prisma.ShareLinkCreateOrConnectWithoutWatermarkConfigInput | Prisma.ShareLinkCreateOrConnectWithoutWatermarkConfigInput[]
|
||||
createMany?: Prisma.ShareLinkCreateManyWatermarkConfigInputEnvelope
|
||||
connect?: Prisma.ShareLinkWhereUniqueInput | Prisma.ShareLinkWhereUniqueInput[]
|
||||
}
|
||||
|
||||
export type ShareLinkUpdateManyWithoutWatermarkConfigNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.ShareLinkCreateWithoutWatermarkConfigInput, Prisma.ShareLinkUncheckedCreateWithoutWatermarkConfigInput> | Prisma.ShareLinkCreateWithoutWatermarkConfigInput[] | Prisma.ShareLinkUncheckedCreateWithoutWatermarkConfigInput[]
|
||||
connectOrCreate?: Prisma.ShareLinkCreateOrConnectWithoutWatermarkConfigInput | Prisma.ShareLinkCreateOrConnectWithoutWatermarkConfigInput[]
|
||||
upsert?: Prisma.ShareLinkUpsertWithWhereUniqueWithoutWatermarkConfigInput | Prisma.ShareLinkUpsertWithWhereUniqueWithoutWatermarkConfigInput[]
|
||||
createMany?: Prisma.ShareLinkCreateManyWatermarkConfigInputEnvelope
|
||||
set?: Prisma.ShareLinkWhereUniqueInput | Prisma.ShareLinkWhereUniqueInput[]
|
||||
disconnect?: Prisma.ShareLinkWhereUniqueInput | Prisma.ShareLinkWhereUniqueInput[]
|
||||
delete?: Prisma.ShareLinkWhereUniqueInput | Prisma.ShareLinkWhereUniqueInput[]
|
||||
connect?: Prisma.ShareLinkWhereUniqueInput | Prisma.ShareLinkWhereUniqueInput[]
|
||||
update?: Prisma.ShareLinkUpdateWithWhereUniqueWithoutWatermarkConfigInput | Prisma.ShareLinkUpdateWithWhereUniqueWithoutWatermarkConfigInput[]
|
||||
updateMany?: Prisma.ShareLinkUpdateManyWithWhereWithoutWatermarkConfigInput | Prisma.ShareLinkUpdateManyWithWhereWithoutWatermarkConfigInput[]
|
||||
deleteMany?: Prisma.ShareLinkScalarWhereInput | Prisma.ShareLinkScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type ShareLinkUncheckedUpdateManyWithoutWatermarkConfigNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.ShareLinkCreateWithoutWatermarkConfigInput, Prisma.ShareLinkUncheckedCreateWithoutWatermarkConfigInput> | Prisma.ShareLinkCreateWithoutWatermarkConfigInput[] | Prisma.ShareLinkUncheckedCreateWithoutWatermarkConfigInput[]
|
||||
connectOrCreate?: Prisma.ShareLinkCreateOrConnectWithoutWatermarkConfigInput | Prisma.ShareLinkCreateOrConnectWithoutWatermarkConfigInput[]
|
||||
upsert?: Prisma.ShareLinkUpsertWithWhereUniqueWithoutWatermarkConfigInput | Prisma.ShareLinkUpsertWithWhereUniqueWithoutWatermarkConfigInput[]
|
||||
createMany?: Prisma.ShareLinkCreateManyWatermarkConfigInputEnvelope
|
||||
set?: Prisma.ShareLinkWhereUniqueInput | Prisma.ShareLinkWhereUniqueInput[]
|
||||
disconnect?: Prisma.ShareLinkWhereUniqueInput | Prisma.ShareLinkWhereUniqueInput[]
|
||||
delete?: Prisma.ShareLinkWhereUniqueInput | Prisma.ShareLinkWhereUniqueInput[]
|
||||
connect?: Prisma.ShareLinkWhereUniqueInput | Prisma.ShareLinkWhereUniqueInput[]
|
||||
update?: Prisma.ShareLinkUpdateWithWhereUniqueWithoutWatermarkConfigInput | Prisma.ShareLinkUpdateWithWhereUniqueWithoutWatermarkConfigInput[]
|
||||
updateMany?: Prisma.ShareLinkUpdateManyWithWhereWithoutWatermarkConfigInput | Prisma.ShareLinkUpdateManyWithWhereWithoutWatermarkConfigInput[]
|
||||
deleteMany?: Prisma.ShareLinkScalarWhereInput | Prisma.ShareLinkScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type ShareLinkCreateNestedOneWithoutRootFolderInput = {
|
||||
create?: Prisma.XOR<Prisma.ShareLinkCreateWithoutRootFolderInput, Prisma.ShareLinkUncheckedCreateWithoutRootFolderInput>
|
||||
connectOrCreate?: Prisma.ShareLinkCreateOrConnectWithoutRootFolderInput
|
||||
@@ -625,8 +717,10 @@ export type ShareLinkCreateWithoutCreatorInput = {
|
||||
fieldVisibility?:PrismaJson.ShareLinkFieldVisibility | Prisma.NullableJsonNullValueInput
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
watermarkStatus?: $Enums.WatermarkStatus
|
||||
project: Prisma.ProjectCreateNestedOneWithoutShareLinksInput
|
||||
rootFolder: Prisma.AssetCreateNestedOneWithoutShareLinkRootFolderInput
|
||||
watermarkConfig?: Prisma.WatermarkConfigCreateNestedOneWithoutShareLinksInput
|
||||
}
|
||||
|
||||
export type ShareLinkUncheckedCreateWithoutCreatorInput = {
|
||||
@@ -642,6 +736,8 @@ export type ShareLinkUncheckedCreateWithoutCreatorInput = {
|
||||
updatedAt?: Date | string
|
||||
projectId: string
|
||||
rootFolderId: string
|
||||
watermarkConfigId?: string | null
|
||||
watermarkStatus?: $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkCreateOrConnectWithoutCreatorInput = {
|
||||
@@ -687,6 +783,8 @@ export type ShareLinkScalarWhereInput = {
|
||||
projectId?: Prisma.StringFilter<"ShareLink"> | string
|
||||
rootFolderId?: Prisma.StringFilter<"ShareLink"> | string
|
||||
creatorId?: Prisma.StringNullableFilter<"ShareLink"> | string | null
|
||||
watermarkConfigId?: Prisma.StringNullableFilter<"ShareLink"> | string | null
|
||||
watermarkStatus?: Prisma.EnumWatermarkStatusFilter<"ShareLink"> | $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkCreateWithoutProjectInput = {
|
||||
@@ -700,8 +798,10 @@ export type ShareLinkCreateWithoutProjectInput = {
|
||||
fieldVisibility?:PrismaJson.ShareLinkFieldVisibility | Prisma.NullableJsonNullValueInput
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
watermarkStatus?: $Enums.WatermarkStatus
|
||||
rootFolder: Prisma.AssetCreateNestedOneWithoutShareLinkRootFolderInput
|
||||
creator?: Prisma.UserCreateNestedOneWithoutShareLinksInput
|
||||
watermarkConfig?: Prisma.WatermarkConfigCreateNestedOneWithoutShareLinksInput
|
||||
}
|
||||
|
||||
export type ShareLinkUncheckedCreateWithoutProjectInput = {
|
||||
@@ -717,6 +817,8 @@ export type ShareLinkUncheckedCreateWithoutProjectInput = {
|
||||
updatedAt?: Date | string
|
||||
rootFolderId: string
|
||||
creatorId?: string | null
|
||||
watermarkConfigId?: string | null
|
||||
watermarkStatus?: $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkCreateOrConnectWithoutProjectInput = {
|
||||
@@ -745,6 +847,66 @@ export type ShareLinkUpdateManyWithWhereWithoutProjectInput = {
|
||||
data: Prisma.XOR<Prisma.ShareLinkUpdateManyMutationInput, Prisma.ShareLinkUncheckedUpdateManyWithoutProjectInput>
|
||||
}
|
||||
|
||||
export type ShareLinkCreateWithoutWatermarkConfigInput = {
|
||||
id?: string
|
||||
name: string
|
||||
expireAt?: Date | string | null
|
||||
password?: string | null
|
||||
isDisabled?: boolean
|
||||
defaultSortOrder?: string | null
|
||||
viewMode?: string | null
|
||||
fieldVisibility?:PrismaJson.ShareLinkFieldVisibility | Prisma.NullableJsonNullValueInput
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
watermarkStatus?: $Enums.WatermarkStatus
|
||||
project: Prisma.ProjectCreateNestedOneWithoutShareLinksInput
|
||||
rootFolder: Prisma.AssetCreateNestedOneWithoutShareLinkRootFolderInput
|
||||
creator?: Prisma.UserCreateNestedOneWithoutShareLinksInput
|
||||
}
|
||||
|
||||
export type ShareLinkUncheckedCreateWithoutWatermarkConfigInput = {
|
||||
id?: string
|
||||
name: string
|
||||
expireAt?: Date | string | null
|
||||
password?: string | null
|
||||
isDisabled?: boolean
|
||||
defaultSortOrder?: string | null
|
||||
viewMode?: string | null
|
||||
fieldVisibility?:PrismaJson.ShareLinkFieldVisibility | Prisma.NullableJsonNullValueInput
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
projectId: string
|
||||
rootFolderId: string
|
||||
creatorId?: string | null
|
||||
watermarkStatus?: $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkCreateOrConnectWithoutWatermarkConfigInput = {
|
||||
where: Prisma.ShareLinkWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.ShareLinkCreateWithoutWatermarkConfigInput, Prisma.ShareLinkUncheckedCreateWithoutWatermarkConfigInput>
|
||||
}
|
||||
|
||||
export type ShareLinkCreateManyWatermarkConfigInputEnvelope = {
|
||||
data: Prisma.ShareLinkCreateManyWatermarkConfigInput | Prisma.ShareLinkCreateManyWatermarkConfigInput[]
|
||||
skipDuplicates?: boolean
|
||||
}
|
||||
|
||||
export type ShareLinkUpsertWithWhereUniqueWithoutWatermarkConfigInput = {
|
||||
where: Prisma.ShareLinkWhereUniqueInput
|
||||
update: Prisma.XOR<Prisma.ShareLinkUpdateWithoutWatermarkConfigInput, Prisma.ShareLinkUncheckedUpdateWithoutWatermarkConfigInput>
|
||||
create: Prisma.XOR<Prisma.ShareLinkCreateWithoutWatermarkConfigInput, Prisma.ShareLinkUncheckedCreateWithoutWatermarkConfigInput>
|
||||
}
|
||||
|
||||
export type ShareLinkUpdateWithWhereUniqueWithoutWatermarkConfigInput = {
|
||||
where: Prisma.ShareLinkWhereUniqueInput
|
||||
data: Prisma.XOR<Prisma.ShareLinkUpdateWithoutWatermarkConfigInput, Prisma.ShareLinkUncheckedUpdateWithoutWatermarkConfigInput>
|
||||
}
|
||||
|
||||
export type ShareLinkUpdateManyWithWhereWithoutWatermarkConfigInput = {
|
||||
where: Prisma.ShareLinkScalarWhereInput
|
||||
data: Prisma.XOR<Prisma.ShareLinkUpdateManyMutationInput, Prisma.ShareLinkUncheckedUpdateManyWithoutWatermarkConfigInput>
|
||||
}
|
||||
|
||||
export type ShareLinkCreateWithoutRootFolderInput = {
|
||||
id?: string
|
||||
name: string
|
||||
@@ -756,8 +918,10 @@ export type ShareLinkCreateWithoutRootFolderInput = {
|
||||
fieldVisibility?:PrismaJson.ShareLinkFieldVisibility | Prisma.NullableJsonNullValueInput
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
watermarkStatus?: $Enums.WatermarkStatus
|
||||
project: Prisma.ProjectCreateNestedOneWithoutShareLinksInput
|
||||
creator?: Prisma.UserCreateNestedOneWithoutShareLinksInput
|
||||
watermarkConfig?: Prisma.WatermarkConfigCreateNestedOneWithoutShareLinksInput
|
||||
}
|
||||
|
||||
export type ShareLinkUncheckedCreateWithoutRootFolderInput = {
|
||||
@@ -773,6 +937,8 @@ export type ShareLinkUncheckedCreateWithoutRootFolderInput = {
|
||||
updatedAt?: Date | string
|
||||
projectId: string
|
||||
creatorId?: string | null
|
||||
watermarkConfigId?: string | null
|
||||
watermarkStatus?: $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkCreateOrConnectWithoutRootFolderInput = {
|
||||
@@ -802,8 +968,10 @@ export type ShareLinkUpdateWithoutRootFolderInput = {
|
||||
fieldVisibility?:PrismaJson.ShareLinkFieldVisibility | Prisma.NullableJsonNullValueInput
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
watermarkStatus?: Prisma.EnumWatermarkStatusFieldUpdateOperationsInput | $Enums.WatermarkStatus
|
||||
project?: Prisma.ProjectUpdateOneRequiredWithoutShareLinksNestedInput
|
||||
creator?: Prisma.UserUpdateOneWithoutShareLinksNestedInput
|
||||
watermarkConfig?: Prisma.WatermarkConfigUpdateOneWithoutShareLinksNestedInput
|
||||
}
|
||||
|
||||
export type ShareLinkUncheckedUpdateWithoutRootFolderInput = {
|
||||
@@ -819,6 +987,8 @@ export type ShareLinkUncheckedUpdateWithoutRootFolderInput = {
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
projectId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
watermarkConfigId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
watermarkStatus?: Prisma.EnumWatermarkStatusFieldUpdateOperationsInput | $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkCreateManyCreatorInput = {
|
||||
@@ -834,6 +1004,8 @@ export type ShareLinkCreateManyCreatorInput = {
|
||||
updatedAt?: Date | string
|
||||
projectId: string
|
||||
rootFolderId: string
|
||||
watermarkConfigId?: string | null
|
||||
watermarkStatus?: $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkUpdateWithoutCreatorInput = {
|
||||
@@ -847,8 +1019,10 @@ export type ShareLinkUpdateWithoutCreatorInput = {
|
||||
fieldVisibility?:PrismaJson.ShareLinkFieldVisibility | Prisma.NullableJsonNullValueInput
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
watermarkStatus?: Prisma.EnumWatermarkStatusFieldUpdateOperationsInput | $Enums.WatermarkStatus
|
||||
project?: Prisma.ProjectUpdateOneRequiredWithoutShareLinksNestedInput
|
||||
rootFolder?: Prisma.AssetUpdateOneRequiredWithoutShareLinkRootFolderNestedInput
|
||||
watermarkConfig?: Prisma.WatermarkConfigUpdateOneWithoutShareLinksNestedInput
|
||||
}
|
||||
|
||||
export type ShareLinkUncheckedUpdateWithoutCreatorInput = {
|
||||
@@ -864,6 +1038,8 @@ export type ShareLinkUncheckedUpdateWithoutCreatorInput = {
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
projectId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
rootFolderId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
watermarkConfigId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
watermarkStatus?: Prisma.EnumWatermarkStatusFieldUpdateOperationsInput | $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkUncheckedUpdateManyWithoutCreatorInput = {
|
||||
@@ -879,6 +1055,8 @@ export type ShareLinkUncheckedUpdateManyWithoutCreatorInput = {
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
projectId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
rootFolderId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
watermarkConfigId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
watermarkStatus?: Prisma.EnumWatermarkStatusFieldUpdateOperationsInput | $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkCreateManyProjectInput = {
|
||||
@@ -894,6 +1072,8 @@ export type ShareLinkCreateManyProjectInput = {
|
||||
updatedAt?: Date | string
|
||||
rootFolderId: string
|
||||
creatorId?: string | null
|
||||
watermarkConfigId?: string | null
|
||||
watermarkStatus?: $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkUpdateWithoutProjectInput = {
|
||||
@@ -907,8 +1087,10 @@ export type ShareLinkUpdateWithoutProjectInput = {
|
||||
fieldVisibility?:PrismaJson.ShareLinkFieldVisibility | Prisma.NullableJsonNullValueInput
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
watermarkStatus?: Prisma.EnumWatermarkStatusFieldUpdateOperationsInput | $Enums.WatermarkStatus
|
||||
rootFolder?: Prisma.AssetUpdateOneRequiredWithoutShareLinkRootFolderNestedInput
|
||||
creator?: Prisma.UserUpdateOneWithoutShareLinksNestedInput
|
||||
watermarkConfig?: Prisma.WatermarkConfigUpdateOneWithoutShareLinksNestedInput
|
||||
}
|
||||
|
||||
export type ShareLinkUncheckedUpdateWithoutProjectInput = {
|
||||
@@ -924,6 +1106,8 @@ export type ShareLinkUncheckedUpdateWithoutProjectInput = {
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
rootFolderId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
watermarkConfigId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
watermarkStatus?: Prisma.EnumWatermarkStatusFieldUpdateOperationsInput | $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkUncheckedUpdateManyWithoutProjectInput = {
|
||||
@@ -939,6 +1123,76 @@ export type ShareLinkUncheckedUpdateManyWithoutProjectInput = {
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
rootFolderId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
watermarkConfigId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
watermarkStatus?: Prisma.EnumWatermarkStatusFieldUpdateOperationsInput | $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkCreateManyWatermarkConfigInput = {
|
||||
id?: string
|
||||
name: string
|
||||
expireAt?: Date | string | null
|
||||
password?: string | null
|
||||
isDisabled?: boolean
|
||||
defaultSortOrder?: string | null
|
||||
viewMode?: string | null
|
||||
fieldVisibility?:PrismaJson.ShareLinkFieldVisibility | Prisma.NullableJsonNullValueInput
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
projectId: string
|
||||
rootFolderId: string
|
||||
creatorId?: string | null
|
||||
watermarkStatus?: $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkUpdateWithoutWatermarkConfigInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
expireAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
password?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
isDisabled?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
defaultSortOrder?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
viewMode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
fieldVisibility?:PrismaJson.ShareLinkFieldVisibility | Prisma.NullableJsonNullValueInput
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
watermarkStatus?: Prisma.EnumWatermarkStatusFieldUpdateOperationsInput | $Enums.WatermarkStatus
|
||||
project?: Prisma.ProjectUpdateOneRequiredWithoutShareLinksNestedInput
|
||||
rootFolder?: Prisma.AssetUpdateOneRequiredWithoutShareLinkRootFolderNestedInput
|
||||
creator?: Prisma.UserUpdateOneWithoutShareLinksNestedInput
|
||||
}
|
||||
|
||||
export type ShareLinkUncheckedUpdateWithoutWatermarkConfigInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
expireAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
password?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
isDisabled?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
defaultSortOrder?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
viewMode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
fieldVisibility?:PrismaJson.ShareLinkFieldVisibility | Prisma.NullableJsonNullValueInput
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
projectId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
rootFolderId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
watermarkStatus?: Prisma.EnumWatermarkStatusFieldUpdateOperationsInput | $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
export type ShareLinkUncheckedUpdateManyWithoutWatermarkConfigInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
expireAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
password?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
isDisabled?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
defaultSortOrder?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
viewMode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
fieldVisibility?:PrismaJson.ShareLinkFieldVisibility | Prisma.NullableJsonNullValueInput
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
projectId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
rootFolderId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
watermarkStatus?: Prisma.EnumWatermarkStatusFieldUpdateOperationsInput | $Enums.WatermarkStatus
|
||||
}
|
||||
|
||||
|
||||
@@ -957,9 +1211,12 @@ export type ShareLinkSelect<ExtArgs extends runtime.Types.Extensions.InternalArg
|
||||
projectId?: boolean
|
||||
rootFolderId?: boolean
|
||||
creatorId?: boolean
|
||||
watermarkConfigId?: boolean
|
||||
watermarkStatus?: boolean
|
||||
project?: boolean | Prisma.ProjectDefaultArgs<ExtArgs>
|
||||
rootFolder?: boolean | Prisma.AssetDefaultArgs<ExtArgs>
|
||||
creator?: boolean | Prisma.ShareLink$creatorArgs<ExtArgs>
|
||||
watermarkConfig?: boolean | Prisma.ShareLink$watermarkConfigArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["shareLink"]>
|
||||
|
||||
export type ShareLinkSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
@@ -976,9 +1233,12 @@ export type ShareLinkSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Ext
|
||||
projectId?: boolean
|
||||
rootFolderId?: boolean
|
||||
creatorId?: boolean
|
||||
watermarkConfigId?: boolean
|
||||
watermarkStatus?: boolean
|
||||
project?: boolean | Prisma.ProjectDefaultArgs<ExtArgs>
|
||||
rootFolder?: boolean | Prisma.AssetDefaultArgs<ExtArgs>
|
||||
creator?: boolean | Prisma.ShareLink$creatorArgs<ExtArgs>
|
||||
watermarkConfig?: boolean | Prisma.ShareLink$watermarkConfigArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["shareLink"]>
|
||||
|
||||
export type ShareLinkSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
@@ -995,9 +1255,12 @@ export type ShareLinkSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Ext
|
||||
projectId?: boolean
|
||||
rootFolderId?: boolean
|
||||
creatorId?: boolean
|
||||
watermarkConfigId?: boolean
|
||||
watermarkStatus?: boolean
|
||||
project?: boolean | Prisma.ProjectDefaultArgs<ExtArgs>
|
||||
rootFolder?: boolean | Prisma.AssetDefaultArgs<ExtArgs>
|
||||
creator?: boolean | Prisma.ShareLink$creatorArgs<ExtArgs>
|
||||
watermarkConfig?: boolean | Prisma.ShareLink$watermarkConfigArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["shareLink"]>
|
||||
|
||||
export type ShareLinkSelectScalar = {
|
||||
@@ -1014,23 +1277,28 @@ export type ShareLinkSelectScalar = {
|
||||
projectId?: boolean
|
||||
rootFolderId?: boolean
|
||||
creatorId?: boolean
|
||||
watermarkConfigId?: boolean
|
||||
watermarkStatus?: boolean
|
||||
}
|
||||
|
||||
export type ShareLinkOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "expireAt" | "password" | "isDisabled" | "defaultSortOrder" | "viewMode" | "fieldVisibility" | "createdAt" | "updatedAt" | "projectId" | "rootFolderId" | "creatorId", ExtArgs["result"]["shareLink"]>
|
||||
export type ShareLinkOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "expireAt" | "password" | "isDisabled" | "defaultSortOrder" | "viewMode" | "fieldVisibility" | "createdAt" | "updatedAt" | "projectId" | "rootFolderId" | "creatorId" | "watermarkConfigId" | "watermarkStatus", ExtArgs["result"]["shareLink"]>
|
||||
export type ShareLinkInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
project?: boolean | Prisma.ProjectDefaultArgs<ExtArgs>
|
||||
rootFolder?: boolean | Prisma.AssetDefaultArgs<ExtArgs>
|
||||
creator?: boolean | Prisma.ShareLink$creatorArgs<ExtArgs>
|
||||
watermarkConfig?: boolean | Prisma.ShareLink$watermarkConfigArgs<ExtArgs>
|
||||
}
|
||||
export type ShareLinkIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
project?: boolean | Prisma.ProjectDefaultArgs<ExtArgs>
|
||||
rootFolder?: boolean | Prisma.AssetDefaultArgs<ExtArgs>
|
||||
creator?: boolean | Prisma.ShareLink$creatorArgs<ExtArgs>
|
||||
watermarkConfig?: boolean | Prisma.ShareLink$watermarkConfigArgs<ExtArgs>
|
||||
}
|
||||
export type ShareLinkIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
project?: boolean | Prisma.ProjectDefaultArgs<ExtArgs>
|
||||
rootFolder?: boolean | Prisma.AssetDefaultArgs<ExtArgs>
|
||||
creator?: boolean | Prisma.ShareLink$creatorArgs<ExtArgs>
|
||||
watermarkConfig?: boolean | Prisma.ShareLink$watermarkConfigArgs<ExtArgs>
|
||||
}
|
||||
|
||||
export type $ShareLinkPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
@@ -1039,6 +1307,7 @@ export type $ShareLinkPayload<ExtArgs extends runtime.Types.Extensions.InternalA
|
||||
project: Prisma.$ProjectPayload<ExtArgs>
|
||||
rootFolder: Prisma.$AssetPayload<ExtArgs>
|
||||
creator: Prisma.$UserPayload<ExtArgs> | null
|
||||
watermarkConfig: Prisma.$WatermarkConfigPayload<ExtArgs> | null
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
@@ -1057,6 +1326,8 @@ export type $ShareLinkPayload<ExtArgs extends runtime.Types.Extensions.InternalA
|
||||
projectId: string
|
||||
rootFolderId: string
|
||||
creatorId: string | null
|
||||
watermarkConfigId: string | null
|
||||
watermarkStatus: $Enums.WatermarkStatus
|
||||
}, ExtArgs["result"]["shareLink"]>
|
||||
composites: {}
|
||||
}
|
||||
@@ -1454,6 +1725,7 @@ export interface Prisma__ShareLinkClient<T, Null = never, ExtArgs extends runtim
|
||||
project<T extends Prisma.ProjectDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ProjectDefaultArgs<ExtArgs>>): Prisma.Prisma__ProjectClient<runtime.Types.Result.GetResult<Prisma.$ProjectPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
rootFolder<T extends Prisma.AssetDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AssetDefaultArgs<ExtArgs>>): Prisma.Prisma__AssetClient<runtime.Types.Result.GetResult<Prisma.$AssetPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
creator<T extends Prisma.ShareLink$creatorArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ShareLink$creatorArgs<ExtArgs>>): Prisma.Prisma__UserClient<runtime.Types.Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
watermarkConfig<T extends Prisma.ShareLink$watermarkConfigArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ShareLink$watermarkConfigArgs<ExtArgs>>): Prisma.Prisma__WatermarkConfigClient<runtime.Types.Result.GetResult<Prisma.$WatermarkConfigPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
@@ -1496,6 +1768,8 @@ export interface ShareLinkFieldRefs {
|
||||
readonly projectId: Prisma.FieldRef<"ShareLink", 'String'>
|
||||
readonly rootFolderId: Prisma.FieldRef<"ShareLink", 'String'>
|
||||
readonly creatorId: Prisma.FieldRef<"ShareLink", 'String'>
|
||||
readonly watermarkConfigId: Prisma.FieldRef<"ShareLink", 'String'>
|
||||
readonly watermarkStatus: Prisma.FieldRef<"ShareLink", 'WatermarkStatus'>
|
||||
}
|
||||
|
||||
|
||||
@@ -1915,6 +2189,25 @@ export type ShareLink$creatorArgs<ExtArgs extends runtime.Types.Extensions.Inter
|
||||
where?: Prisma.UserWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* ShareLink.watermarkConfig
|
||||
*/
|
||||
export type ShareLink$watermarkConfigArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the WatermarkConfig
|
||||
*/
|
||||
select?: Prisma.WatermarkConfigSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the WatermarkConfig
|
||||
*/
|
||||
omit?: Prisma.WatermarkConfigOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.WatermarkConfigInclude<ExtArgs> | null
|
||||
where?: Prisma.WatermarkConfigWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* ShareLink without action
|
||||
*/
|
||||
|
||||
+212
@@ -201,6 +201,7 @@ export type TeamWhereInput = {
|
||||
agents?: Prisma.AgentListRelationFilter
|
||||
aiUsages?: Prisma.AiUsageListRelationFilter
|
||||
auditLogs?: Prisma.AuditLogListRelationFilter
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateListRelationFilter
|
||||
}
|
||||
|
||||
export type TeamOrderByWithRelationInput = {
|
||||
@@ -223,6 +224,7 @@ export type TeamOrderByWithRelationInput = {
|
||||
agents?: Prisma.AgentOrderByRelationAggregateInput
|
||||
aiUsages?: Prisma.AiUsageOrderByRelationAggregateInput
|
||||
auditLogs?: Prisma.AuditLogOrderByRelationAggregateInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateOrderByRelationAggregateInput
|
||||
}
|
||||
|
||||
export type TeamWhereUniqueInput = Prisma.AtLeast<{
|
||||
@@ -248,6 +250,7 @@ export type TeamWhereUniqueInput = Prisma.AtLeast<{
|
||||
agents?: Prisma.AgentListRelationFilter
|
||||
aiUsages?: Prisma.AiUsageListRelationFilter
|
||||
auditLogs?: Prisma.AuditLogListRelationFilter
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateListRelationFilter
|
||||
}, "id" | "rootFolderId">
|
||||
|
||||
export type TeamOrderByWithAggregationInput = {
|
||||
@@ -293,6 +296,7 @@ export type TeamCreateInput = {
|
||||
agents?: Prisma.AgentCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedCreateInput = {
|
||||
@@ -314,6 +318,7 @@ export type TeamUncheckedCreateInput = {
|
||||
agents?: Prisma.AgentUncheckedCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamUpdateInput = {
|
||||
@@ -335,6 +340,7 @@ export type TeamUpdateInput = {
|
||||
agents?: Prisma.AgentUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedUpdateInput = {
|
||||
@@ -356,6 +362,7 @@ export type TeamUncheckedUpdateInput = {
|
||||
agents?: Prisma.AgentUncheckedUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamCreateManyInput = {
|
||||
@@ -475,6 +482,22 @@ export type TeamUpdateOneRequiredWithoutProjectsNestedInput = {
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.TeamUpdateToOneWithWhereWithoutProjectsInput, Prisma.TeamUpdateWithoutProjectsInput>, Prisma.TeamUncheckedUpdateWithoutProjectsInput>
|
||||
}
|
||||
|
||||
export type TeamCreateNestedOneWithoutWatermarkTemplatesInput = {
|
||||
create?: Prisma.XOR<Prisma.TeamCreateWithoutWatermarkTemplatesInput, Prisma.TeamUncheckedCreateWithoutWatermarkTemplatesInput>
|
||||
connectOrCreate?: Prisma.TeamCreateOrConnectWithoutWatermarkTemplatesInput
|
||||
connect?: Prisma.TeamWhereUniqueInput
|
||||
}
|
||||
|
||||
export type TeamUpdateOneWithoutWatermarkTemplatesNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.TeamCreateWithoutWatermarkTemplatesInput, Prisma.TeamUncheckedCreateWithoutWatermarkTemplatesInput>
|
||||
connectOrCreate?: Prisma.TeamCreateOrConnectWithoutWatermarkTemplatesInput
|
||||
upsert?: Prisma.TeamUpsertWithoutWatermarkTemplatesInput
|
||||
disconnect?: Prisma.TeamWhereInput | boolean
|
||||
delete?: Prisma.TeamWhereInput | boolean
|
||||
connect?: Prisma.TeamWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.TeamUpdateToOneWithWhereWithoutWatermarkTemplatesInput, Prisma.TeamUpdateWithoutWatermarkTemplatesInput>, Prisma.TeamUncheckedUpdateWithoutWatermarkTemplatesInput>
|
||||
}
|
||||
|
||||
export type TeamCreateNestedOneWithoutRootFolderInput = {
|
||||
create?: Prisma.XOR<Prisma.TeamCreateWithoutRootFolderInput, Prisma.TeamUncheckedCreateWithoutRootFolderInput>
|
||||
connectOrCreate?: Prisma.TeamCreateOrConnectWithoutRootFolderInput
|
||||
@@ -639,6 +662,7 @@ export type TeamCreateWithoutSandboxInput = {
|
||||
agents?: Prisma.AgentCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedCreateWithoutSandboxInput = {
|
||||
@@ -659,6 +683,7 @@ export type TeamUncheckedCreateWithoutSandboxInput = {
|
||||
agents?: Prisma.AgentUncheckedCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamCreateOrConnectWithoutSandboxInput = {
|
||||
@@ -695,6 +720,7 @@ export type TeamUpdateWithoutSandboxInput = {
|
||||
agents?: Prisma.AgentUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedUpdateWithoutSandboxInput = {
|
||||
@@ -715,6 +741,7 @@ export type TeamUncheckedUpdateWithoutSandboxInput = {
|
||||
agents?: Prisma.AgentUncheckedUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamCreateWithoutSkillsInput = {
|
||||
@@ -735,6 +762,7 @@ export type TeamCreateWithoutSkillsInput = {
|
||||
agents?: Prisma.AgentCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedCreateWithoutSkillsInput = {
|
||||
@@ -755,6 +783,7 @@ export type TeamUncheckedCreateWithoutSkillsInput = {
|
||||
agents?: Prisma.AgentUncheckedCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamCreateOrConnectWithoutSkillsInput = {
|
||||
@@ -791,6 +820,7 @@ export type TeamUpdateWithoutSkillsInput = {
|
||||
agents?: Prisma.AgentUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedUpdateWithoutSkillsInput = {
|
||||
@@ -811,6 +841,7 @@ export type TeamUncheckedUpdateWithoutSkillsInput = {
|
||||
agents?: Prisma.AgentUncheckedUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamCreateWithoutMembersInput = {
|
||||
@@ -831,6 +862,7 @@ export type TeamCreateWithoutMembersInput = {
|
||||
agents?: Prisma.AgentCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedCreateWithoutMembersInput = {
|
||||
@@ -851,6 +883,7 @@ export type TeamUncheckedCreateWithoutMembersInput = {
|
||||
agents?: Prisma.AgentUncheckedCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamCreateOrConnectWithoutMembersInput = {
|
||||
@@ -887,6 +920,7 @@ export type TeamUpdateWithoutMembersInput = {
|
||||
agents?: Prisma.AgentUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedUpdateWithoutMembersInput = {
|
||||
@@ -907,6 +941,7 @@ export type TeamUncheckedUpdateWithoutMembersInput = {
|
||||
agents?: Prisma.AgentUncheckedUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamCreateWithoutProjectsInput = {
|
||||
@@ -927,6 +962,7 @@ export type TeamCreateWithoutProjectsInput = {
|
||||
agents?: Prisma.AgentCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedCreateWithoutProjectsInput = {
|
||||
@@ -947,6 +983,7 @@ export type TeamUncheckedCreateWithoutProjectsInput = {
|
||||
agents?: Prisma.AgentUncheckedCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamCreateOrConnectWithoutProjectsInput = {
|
||||
@@ -983,6 +1020,7 @@ export type TeamUpdateWithoutProjectsInput = {
|
||||
agents?: Prisma.AgentUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedUpdateWithoutProjectsInput = {
|
||||
@@ -1003,6 +1041,107 @@ export type TeamUncheckedUpdateWithoutProjectsInput = {
|
||||
agents?: Prisma.AgentUncheckedUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamCreateWithoutWatermarkTemplatesInput = {
|
||||
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
|
||||
sandbox?: Prisma.SandboxCreateNestedOneWithoutTeamInput
|
||||
agents?: Prisma.AgentCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedCreateWithoutWatermarkTemplatesInput = {
|
||||
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
|
||||
sandbox?: Prisma.SandboxUncheckedCreateNestedOneWithoutTeamInput
|
||||
agents?: Prisma.AgentUncheckedCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamCreateOrConnectWithoutWatermarkTemplatesInput = {
|
||||
where: Prisma.TeamWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.TeamCreateWithoutWatermarkTemplatesInput, Prisma.TeamUncheckedCreateWithoutWatermarkTemplatesInput>
|
||||
}
|
||||
|
||||
export type TeamUpsertWithoutWatermarkTemplatesInput = {
|
||||
update: Prisma.XOR<Prisma.TeamUpdateWithoutWatermarkTemplatesInput, Prisma.TeamUncheckedUpdateWithoutWatermarkTemplatesInput>
|
||||
create: Prisma.XOR<Prisma.TeamCreateWithoutWatermarkTemplatesInput, Prisma.TeamUncheckedCreateWithoutWatermarkTemplatesInput>
|
||||
where?: Prisma.TeamWhereInput
|
||||
}
|
||||
|
||||
export type TeamUpdateToOneWithWhereWithoutWatermarkTemplatesInput = {
|
||||
where?: Prisma.TeamWhereInput
|
||||
data: Prisma.XOR<Prisma.TeamUpdateWithoutWatermarkTemplatesInput, Prisma.TeamUncheckedUpdateWithoutWatermarkTemplatesInput>
|
||||
}
|
||||
|
||||
export type TeamUpdateWithoutWatermarkTemplatesInput = {
|
||||
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
|
||||
sandbox?: Prisma.SandboxUpdateOneWithoutTeamNestedInput
|
||||
agents?: Prisma.AgentUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedUpdateWithoutWatermarkTemplatesInput = {
|
||||
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
|
||||
sandbox?: Prisma.SandboxUncheckedUpdateOneWithoutTeamNestedInput
|
||||
agents?: Prisma.AgentUncheckedUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamCreateWithoutRootFolderInput = {
|
||||
@@ -1023,6 +1162,7 @@ export type TeamCreateWithoutRootFolderInput = {
|
||||
agents?: Prisma.AgentCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedCreateWithoutRootFolderInput = {
|
||||
@@ -1043,6 +1183,7 @@ export type TeamUncheckedCreateWithoutRootFolderInput = {
|
||||
agents?: Prisma.AgentUncheckedCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamCreateOrConnectWithoutRootFolderInput = {
|
||||
@@ -1079,6 +1220,7 @@ export type TeamUpdateWithoutRootFolderInput = {
|
||||
agents?: Prisma.AgentUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedUpdateWithoutRootFolderInput = {
|
||||
@@ -1099,6 +1241,7 @@ export type TeamUncheckedUpdateWithoutRootFolderInput = {
|
||||
agents?: Prisma.AgentUncheckedUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamCreateWithoutInvitesInput = {
|
||||
@@ -1119,6 +1262,7 @@ export type TeamCreateWithoutInvitesInput = {
|
||||
agents?: Prisma.AgentCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedCreateWithoutInvitesInput = {
|
||||
@@ -1139,6 +1283,7 @@ export type TeamUncheckedCreateWithoutInvitesInput = {
|
||||
agents?: Prisma.AgentUncheckedCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamCreateOrConnectWithoutInvitesInput = {
|
||||
@@ -1175,6 +1320,7 @@ export type TeamUpdateWithoutInvitesInput = {
|
||||
agents?: Prisma.AgentUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedUpdateWithoutInvitesInput = {
|
||||
@@ -1195,6 +1341,7 @@ export type TeamUncheckedUpdateWithoutInvitesInput = {
|
||||
agents?: Prisma.AgentUncheckedUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamCreateWithoutMetadataFieldsInput = {
|
||||
@@ -1215,6 +1362,7 @@ export type TeamCreateWithoutMetadataFieldsInput = {
|
||||
agents?: Prisma.AgentCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedCreateWithoutMetadataFieldsInput = {
|
||||
@@ -1235,6 +1383,7 @@ export type TeamUncheckedCreateWithoutMetadataFieldsInput = {
|
||||
agents?: Prisma.AgentUncheckedCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamCreateOrConnectWithoutMetadataFieldsInput = {
|
||||
@@ -1271,6 +1420,7 @@ export type TeamUpdateWithoutMetadataFieldsInput = {
|
||||
agents?: Prisma.AgentUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedUpdateWithoutMetadataFieldsInput = {
|
||||
@@ -1291,6 +1441,7 @@ export type TeamUncheckedUpdateWithoutMetadataFieldsInput = {
|
||||
agents?: Prisma.AgentUncheckedUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamCreateWithoutNotificationsInput = {
|
||||
@@ -1311,6 +1462,7 @@ export type TeamCreateWithoutNotificationsInput = {
|
||||
agents?: Prisma.AgentCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedCreateWithoutNotificationsInput = {
|
||||
@@ -1331,6 +1483,7 @@ export type TeamUncheckedCreateWithoutNotificationsInput = {
|
||||
agents?: Prisma.AgentUncheckedCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamCreateOrConnectWithoutNotificationsInput = {
|
||||
@@ -1367,6 +1520,7 @@ export type TeamUpdateWithoutNotificationsInput = {
|
||||
agents?: Prisma.AgentUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedUpdateWithoutNotificationsInput = {
|
||||
@@ -1387,6 +1541,7 @@ export type TeamUncheckedUpdateWithoutNotificationsInput = {
|
||||
agents?: Prisma.AgentUncheckedUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamCreateWithoutAgentsInput = {
|
||||
@@ -1407,6 +1562,7 @@ export type TeamCreateWithoutAgentsInput = {
|
||||
sandbox?: Prisma.SandboxCreateNestedOneWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedCreateWithoutAgentsInput = {
|
||||
@@ -1427,6 +1583,7 @@ export type TeamUncheckedCreateWithoutAgentsInput = {
|
||||
sandbox?: Prisma.SandboxUncheckedCreateNestedOneWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamCreateOrConnectWithoutAgentsInput = {
|
||||
@@ -1463,6 +1620,7 @@ export type TeamUpdateWithoutAgentsInput = {
|
||||
sandbox?: Prisma.SandboxUpdateOneWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedUpdateWithoutAgentsInput = {
|
||||
@@ -1483,6 +1641,7 @@ export type TeamUncheckedUpdateWithoutAgentsInput = {
|
||||
sandbox?: Prisma.SandboxUncheckedUpdateOneWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamCreateWithoutUserMetadataInput = {
|
||||
@@ -1503,6 +1662,7 @@ export type TeamCreateWithoutUserMetadataInput = {
|
||||
agents?: Prisma.AgentCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedCreateWithoutUserMetadataInput = {
|
||||
@@ -1523,6 +1683,7 @@ export type TeamUncheckedCreateWithoutUserMetadataInput = {
|
||||
agents?: Prisma.AgentUncheckedCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamCreateOrConnectWithoutUserMetadataInput = {
|
||||
@@ -1559,6 +1720,7 @@ export type TeamUpdateWithoutUserMetadataInput = {
|
||||
agents?: Prisma.AgentUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedUpdateWithoutUserMetadataInput = {
|
||||
@@ -1579,6 +1741,7 @@ export type TeamUncheckedUpdateWithoutUserMetadataInput = {
|
||||
agents?: Prisma.AgentUncheckedUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamCreateWithoutProvidersInput = {
|
||||
@@ -1599,6 +1762,7 @@ export type TeamCreateWithoutProvidersInput = {
|
||||
agents?: Prisma.AgentCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedCreateWithoutProvidersInput = {
|
||||
@@ -1619,6 +1783,7 @@ export type TeamUncheckedCreateWithoutProvidersInput = {
|
||||
agents?: Prisma.AgentUncheckedCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamCreateOrConnectWithoutProvidersInput = {
|
||||
@@ -1655,6 +1820,7 @@ export type TeamUpdateWithoutProvidersInput = {
|
||||
agents?: Prisma.AgentUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedUpdateWithoutProvidersInput = {
|
||||
@@ -1675,6 +1841,7 @@ export type TeamUncheckedUpdateWithoutProvidersInput = {
|
||||
agents?: Prisma.AgentUncheckedUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamCreateWithoutAiUsagesInput = {
|
||||
@@ -1695,6 +1862,7 @@ export type TeamCreateWithoutAiUsagesInput = {
|
||||
sandbox?: Prisma.SandboxCreateNestedOneWithoutTeamInput
|
||||
agents?: Prisma.AgentCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedCreateWithoutAiUsagesInput = {
|
||||
@@ -1715,6 +1883,7 @@ export type TeamUncheckedCreateWithoutAiUsagesInput = {
|
||||
sandbox?: Prisma.SandboxUncheckedCreateNestedOneWithoutTeamInput
|
||||
agents?: Prisma.AgentUncheckedCreateNestedManyWithoutTeamInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamCreateOrConnectWithoutAiUsagesInput = {
|
||||
@@ -1751,6 +1920,7 @@ export type TeamUpdateWithoutAiUsagesInput = {
|
||||
sandbox?: Prisma.SandboxUpdateOneWithoutTeamNestedInput
|
||||
agents?: Prisma.AgentUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedUpdateWithoutAiUsagesInput = {
|
||||
@@ -1771,6 +1941,7 @@ export type TeamUncheckedUpdateWithoutAiUsagesInput = {
|
||||
sandbox?: Prisma.SandboxUncheckedUpdateOneWithoutTeamNestedInput
|
||||
agents?: Prisma.AgentUncheckedUpdateManyWithoutTeamNestedInput
|
||||
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamCreateWithoutAuditLogsInput = {
|
||||
@@ -1791,6 +1962,7 @@ export type TeamCreateWithoutAuditLogsInput = {
|
||||
sandbox?: Prisma.SandboxCreateNestedOneWithoutTeamInput
|
||||
agents?: Prisma.AgentCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedCreateWithoutAuditLogsInput = {
|
||||
@@ -1811,6 +1983,7 @@ export type TeamUncheckedCreateWithoutAuditLogsInput = {
|
||||
sandbox?: Prisma.SandboxUncheckedCreateNestedOneWithoutTeamInput
|
||||
agents?: Prisma.AgentUncheckedCreateNestedManyWithoutTeamInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedCreateNestedManyWithoutTeamInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
|
||||
}
|
||||
|
||||
export type TeamCreateOrConnectWithoutAuditLogsInput = {
|
||||
@@ -1847,6 +2020,7 @@ export type TeamUpdateWithoutAuditLogsInput = {
|
||||
sandbox?: Prisma.SandboxUpdateOneWithoutTeamNestedInput
|
||||
agents?: Prisma.AgentUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
export type TeamUncheckedUpdateWithoutAuditLogsInput = {
|
||||
@@ -1867,6 +2041,7 @@ export type TeamUncheckedUpdateWithoutAuditLogsInput = {
|
||||
sandbox?: Prisma.SandboxUncheckedUpdateOneWithoutTeamNestedInput
|
||||
agents?: Prisma.AgentUncheckedUpdateManyWithoutTeamNestedInput
|
||||
aiUsages?: Prisma.AiUsageUncheckedUpdateManyWithoutTeamNestedInput
|
||||
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
|
||||
}
|
||||
|
||||
|
||||
@@ -1886,6 +2061,7 @@ export type TeamCountOutputType = {
|
||||
agents: number
|
||||
aiUsages: number
|
||||
auditLogs: number
|
||||
watermarkTemplates: number
|
||||
}
|
||||
|
||||
export type TeamCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
@@ -1900,6 +2076,7 @@ export type TeamCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.I
|
||||
agents?: boolean | TeamCountOutputTypeCountAgentsArgs
|
||||
aiUsages?: boolean | TeamCountOutputTypeCountAiUsagesArgs
|
||||
auditLogs?: boolean | TeamCountOutputTypeCountAuditLogsArgs
|
||||
watermarkTemplates?: boolean | TeamCountOutputTypeCountWatermarkTemplatesArgs
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1989,6 +2166,13 @@ export type TeamCountOutputTypeCountAuditLogsArgs<ExtArgs extends runtime.Types.
|
||||
where?: Prisma.AuditLogWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* TeamCountOutputType without action
|
||||
*/
|
||||
export type TeamCountOutputTypeCountWatermarkTemplatesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.WatermarkTemplateWhereInput
|
||||
}
|
||||
|
||||
|
||||
export type TeamSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
@@ -2010,6 +2194,7 @@ export type TeamSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = r
|
||||
agents?: boolean | Prisma.Team$agentsArgs<ExtArgs>
|
||||
aiUsages?: boolean | Prisma.Team$aiUsagesArgs<ExtArgs>
|
||||
auditLogs?: boolean | Prisma.Team$auditLogsArgs<ExtArgs>
|
||||
watermarkTemplates?: boolean | Prisma.Team$watermarkTemplatesArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.TeamCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["team"]>
|
||||
|
||||
@@ -2057,6 +2242,7 @@ export type TeamInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs =
|
||||
agents?: boolean | Prisma.Team$agentsArgs<ExtArgs>
|
||||
aiUsages?: boolean | Prisma.Team$aiUsagesArgs<ExtArgs>
|
||||
auditLogs?: boolean | Prisma.Team$auditLogsArgs<ExtArgs>
|
||||
watermarkTemplates?: boolean | Prisma.Team$watermarkTemplatesArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.TeamCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
export type TeamIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
@@ -2082,6 +2268,7 @@ export type $TeamPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs =
|
||||
agents: Prisma.$AgentPayload<ExtArgs>[]
|
||||
aiUsages: Prisma.$AiUsagePayload<ExtArgs>[]
|
||||
auditLogs: Prisma.$AuditLogPayload<ExtArgs>[]
|
||||
watermarkTemplates: Prisma.$WatermarkTemplatePayload<ExtArgs>[]
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
@@ -2500,6 +2687,7 @@ export interface Prisma__TeamClient<T, Null = never, ExtArgs extends runtime.Typ
|
||||
agents<T extends Prisma.Team$agentsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Team$agentsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AgentPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
aiUsages<T extends Prisma.Team$aiUsagesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Team$aiUsagesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AiUsagePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
auditLogs<T extends Prisma.Team$auditLogsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Team$auditLogsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AuditLogPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
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>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
@@ -3237,6 +3425,30 @@ export type Team$auditLogsArgs<ExtArgs extends runtime.Types.Extensions.Internal
|
||||
distinct?: Prisma.AuditLogScalarFieldEnum | Prisma.AuditLogScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Team.watermarkTemplates
|
||||
*/
|
||||
export type Team$watermarkTemplatesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the WatermarkTemplate
|
||||
*/
|
||||
select?: Prisma.WatermarkTemplateSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the WatermarkTemplate
|
||||
*/
|
||||
omit?: Prisma.WatermarkTemplateOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.WatermarkTemplateInclude<ExtArgs> | null
|
||||
where?: Prisma.WatermarkTemplateWhereInput
|
||||
orderBy?: Prisma.WatermarkTemplateOrderByWithRelationInput | Prisma.WatermarkTemplateOrderByWithRelationInput[]
|
||||
cursor?: Prisma.WatermarkTemplateWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.WatermarkTemplateScalarFieldEnum | Prisma.WatermarkTemplateScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Team without action
|
||||
*/
|
||||
|
||||
+1447
File diff suppressed because it is too large
Load Diff
+1556
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -134,7 +134,7 @@ declare global {
|
||||
proxyType?: 'image' | 'video' | 'audio' | 'pdf'
|
||||
imageTranscodes: ImageTranscode[]
|
||||
videoTranscodes: VideoTranscode[]
|
||||
videoPreview: VideoTranscode
|
||||
videoPreview?: VideoTranscode
|
||||
pdfTranscode?: PdfTranscode
|
||||
sprite?: SpriteInfo
|
||||
poster?: PosterInfo
|
||||
@@ -277,6 +277,7 @@ declare global {
|
||||
screenshot?: ScreenshotSpec
|
||||
imageAnnotation?: ImageAnnotationSpec
|
||||
pdfPages?: PdfPagesSpec
|
||||
watermark?: WatermarkTaskPayload
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -322,5 +323,43 @@ declare global {
|
||||
// ----------------------------------------------------------------------
|
||||
export type SkillEnvironmentVariable = import('@shumai/dtos').SkillEnvironmentVariable
|
||||
export type SkillConfig = import('@shumai/dtos').SkillConfig
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Watermark Config
|
||||
// ----------------------------------------------------------------------
|
||||
export interface WatermarkBlockText {
|
||||
id: string
|
||||
type: 'text'
|
||||
x: number
|
||||
y: number
|
||||
opacity: number
|
||||
rotation: number
|
||||
text: string
|
||||
size: number
|
||||
color: string
|
||||
}
|
||||
|
||||
export interface WatermarkBlockImage {
|
||||
id: string
|
||||
type: 'image'
|
||||
x: number
|
||||
y: number
|
||||
opacity: number
|
||||
rotation: number
|
||||
imageAssetKey: string
|
||||
imageAssetUrl?: string
|
||||
size: number
|
||||
}
|
||||
|
||||
export type WatermarkBlock = WatermarkBlockText | WatermarkBlockImage
|
||||
|
||||
export interface WatermarkConfigSpec {
|
||||
blocks: WatermarkBlock[]
|
||||
}
|
||||
|
||||
export interface WatermarkTaskPayload {
|
||||
watermarkConfigId: string
|
||||
shareLinkId?: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,3 +20,4 @@ export * from './user-metadata'
|
||||
export * from './versionStack'
|
||||
export * from './chat'
|
||||
export * from './auditLog'
|
||||
export * from './watermark'
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { z } from 'zod'
|
||||
import { paginationParamsSchema } from './pagination'
|
||||
import type { WatermarkConfigSpec } from './watermark'
|
||||
|
||||
export interface ShareLinkInfo {
|
||||
id: string
|
||||
@@ -14,6 +15,13 @@ export interface ShareLinkInfo {
|
||||
rootFolderId: string
|
||||
projectId: string
|
||||
isExpired: boolean
|
||||
watermarkConfigId?: string | null
|
||||
watermarkStatus?: 'disabled' | 'processing' | 'ready' | 'failed'
|
||||
watermarkConfig?: {
|
||||
id: string
|
||||
config: WatermarkConfigSpec
|
||||
hash: string
|
||||
} | null
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
creator?: { id: string; name: string; image?: string | null } | null
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export const watermarkBlockTextSchema = z.object({
|
||||
id: z.string(),
|
||||
type: z.literal('text'),
|
||||
x: z.number().min(0).max(1),
|
||||
y: z.number().min(0).max(1),
|
||||
opacity: z.number().min(0).max(1),
|
||||
rotation: z.number().min(-180).max(180),
|
||||
text: z.string(),
|
||||
// size is a FRACTION (0..1) of the canvas width, so the watermark scales
|
||||
// proportionally with the output resolution.
|
||||
size: z.number().positive().max(1),
|
||||
color: z.string(),
|
||||
})
|
||||
|
||||
export type WatermarkBlockText = z.infer<typeof watermarkBlockTextSchema>
|
||||
|
||||
export const watermarkBlockImageSchema = z.object({
|
||||
id: z.string(),
|
||||
type: z.literal('image'),
|
||||
x: z.number().min(0).max(1),
|
||||
y: z.number().min(0).max(1),
|
||||
opacity: z.number().min(0).max(1),
|
||||
rotation: z.number().min(-180).max(180),
|
||||
imageAssetKey: z.string().min(1),
|
||||
imageAssetUrl: z.string().optional(),
|
||||
// size is a FRACTION (0..1) of the canvas width, same as text blocks.
|
||||
size: z.number().positive().max(1),
|
||||
})
|
||||
|
||||
export type WatermarkBlockImage = z.infer<typeof watermarkBlockImageSchema>
|
||||
|
||||
export const watermarkBlockSchema = z.discriminatedUnion('type', [
|
||||
watermarkBlockTextSchema,
|
||||
watermarkBlockImageSchema,
|
||||
])
|
||||
|
||||
export type WatermarkBlock = z.infer<typeof watermarkBlockSchema>
|
||||
|
||||
export const watermarkConfigSpecSchema = z.object({
|
||||
blocks: z.array(watermarkBlockSchema),
|
||||
})
|
||||
|
||||
export type WatermarkConfigSpec = z.infer<typeof watermarkConfigSpecSchema>
|
||||
|
||||
export interface WatermarkConfigInfo {
|
||||
id: string
|
||||
config: WatermarkConfigSpec
|
||||
hash: string
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
}
|
||||
|
||||
export interface WatermarkTemplateInfo {
|
||||
id: string
|
||||
name: string
|
||||
config: WatermarkConfigSpec
|
||||
teamId?: string | null
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
}
|
||||
|
||||
export const createWatermarkTemplateRequestSchema = z.object({
|
||||
name: z.string().min(1),
|
||||
teamId: z.string().optional(),
|
||||
config: watermarkConfigSpecSchema,
|
||||
})
|
||||
|
||||
export type CreateWatermarkTemplateRequest = z.infer<typeof createWatermarkTemplateRequestSchema>
|
||||
|
||||
export const updateWatermarkTemplateRequestSchema = z.object({
|
||||
name: z.string().min(1).optional(),
|
||||
config: watermarkConfigSpecSchema.optional(),
|
||||
})
|
||||
|
||||
export type UpdateWatermarkTemplateRequest = z.infer<typeof updateWatermarkTemplateRequestSchema>
|
||||
|
||||
export const updateShareLinkWatermarkRequestSchema = z
|
||||
.object({
|
||||
enabled: z.boolean(),
|
||||
config: watermarkConfigSpecSchema.optional(),
|
||||
})
|
||||
.superRefine((val, ctx) => {
|
||||
if (val.enabled && (!val.config || val.config.blocks.length === 0)) {
|
||||
ctx.addIssue({
|
||||
code: 'custom',
|
||||
path: ['config'],
|
||||
message: 'Watermark configuration is required when enabling watermark',
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
export type UpdateShareLinkWatermarkRequest = z.infer<typeof updateShareLinkWatermarkRequestSchema>
|
||||
@@ -0,0 +1,467 @@
|
||||
import { describe, it, expect, beforeAll, afterAll, vi } from 'vitest'
|
||||
import { prisma, WatermarkFileStatus } from '@shumai/db'
|
||||
import { setupTestDbHooks } from '@shumai/db/test'
|
||||
import { workflowService, TaskQueueTranscode } from '@shumai/workflow-core'
|
||||
import { initTranscodeWorkflows } from '@shumai/transcode'
|
||||
import { watermarkService } from '@shumai/core/src/watermark/watermark'
|
||||
import { shareService } from '@shumai/core/src/share/share'
|
||||
import { s3Service } from '@shumai/core/src/s3/s3'
|
||||
import { fileURLToPath } from 'url'
|
||||
import * as path from 'path'
|
||||
import * as fs from 'fs'
|
||||
import type { WatermarkConfigSpec } from '@shumai/dtos'
|
||||
|
||||
const currentDir = path.dirname(fileURLToPath(import.meta.url))
|
||||
const transcodeWorkflowsPath = path.resolve(currentDir, '../../../apps/transcode/src/workflows.ts')
|
||||
const fixturesDir = path.resolve(currentDir, '../fixtures')
|
||||
|
||||
describe.each(['local', 'temporal'] as const)(
|
||||
'Workflow E2E - transcodeWatermarkWorkflow (executor: %s)',
|
||||
(mode) => {
|
||||
setupTestDbHooks()
|
||||
|
||||
let transcodeWorkerPromise: Promise<void> | null = null
|
||||
|
||||
beforeAll(async () => {
|
||||
process.env.S3_BUCKET = 'shumai-e2e-test-bucket-watermark'
|
||||
|
||||
workflowService.setExecutorType(mode)
|
||||
initTranscodeWorkflows()
|
||||
|
||||
if (mode === 'temporal') {
|
||||
console.log('Starting background worker for watermark Temporal E2E tests...')
|
||||
transcodeWorkerPromise = workflowService.startWorkers(TaskQueueTranscode, {
|
||||
workflowsPath: transcodeWorkflowsPath,
|
||||
})
|
||||
await new Promise((resolve) => setTimeout(resolve, 2000))
|
||||
} else {
|
||||
console.log('Starting local workflow service polling...')
|
||||
workflowService.start()
|
||||
}
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
if (mode === 'temporal') {
|
||||
console.log('Shutting down Temporal workers...')
|
||||
await workflowService.shutdownWorkers()
|
||||
await Promise.all([transcodeWorkerPromise].filter(Boolean))
|
||||
}
|
||||
workflowService.close()
|
||||
vi.restoreAllMocks()
|
||||
try {
|
||||
await s3Service.deletePrefix('shumai-e2e-test-bucket-watermark', '')
|
||||
} catch (err) {
|
||||
console.error('Failed to clean up E2E storage folder:', err)
|
||||
}
|
||||
})
|
||||
|
||||
it('should generate watermark proxy for an image asset and update sharelink status to ready', async () => {
|
||||
// 1. Seed Database
|
||||
const team = await prisma.team.create({
|
||||
data: { name: 'E2E Watermark Team' },
|
||||
})
|
||||
const projectFolder = await prisma.asset.create({
|
||||
data: { name: 'root', type: 'root', status: 'processed' },
|
||||
})
|
||||
const project = await prisma.project.create({
|
||||
data: { name: 'E2E Watermark Project', teamId: team.id, rootFolderId: projectFolder.id },
|
||||
})
|
||||
|
||||
const storageKey = await prisma.storageKey.create({
|
||||
data: { key: 'files/e2e-watermark-asset/original.png' },
|
||||
})
|
||||
|
||||
const sampleImagePath = path.join(fixturesDir, 'sample.png')
|
||||
let sampleBuffer: Buffer
|
||||
if (fs.existsSync(sampleImagePath)) {
|
||||
sampleBuffer = fs.readFileSync(sampleImagePath)
|
||||
} else {
|
||||
// Minimal 1x1 PNG fallback if fixture is missing
|
||||
sampleBuffer = Buffer.from(
|
||||
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==',
|
||||
'base64',
|
||||
)
|
||||
}
|
||||
|
||||
await s3Service.putObject(
|
||||
'shumai-e2e-test-bucket-watermark',
|
||||
storageKey.key,
|
||||
sampleBuffer,
|
||||
sampleBuffer.length,
|
||||
'image/png',
|
||||
)
|
||||
|
||||
const asset = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'sample.png',
|
||||
type: 'file',
|
||||
mediaType: 'image/png',
|
||||
status: 'processed',
|
||||
projectId: project.id,
|
||||
storageKeyId: storageKey.id,
|
||||
media: {
|
||||
duration: 0,
|
||||
filesize: sampleBuffer.length,
|
||||
frames: 0,
|
||||
proxyType: 'image',
|
||||
imageTranscodes: [
|
||||
{ key: storageKey.key, width: 100, height: 100, quality: 90, format: 'webp' },
|
||||
],
|
||||
videoTranscodes: [],
|
||||
videoPreview: { width: 100, height: 100 },
|
||||
finishedAt: new Date().toISOString(),
|
||||
metadata: {
|
||||
originalWidth: 100,
|
||||
originalHeight: 100,
|
||||
duration: 0,
|
||||
bitRate: 0,
|
||||
frameRate: 0,
|
||||
totalFrames: 0,
|
||||
startTimecode: '00:00:00:00',
|
||||
hasAudio: false,
|
||||
format: {},
|
||||
},
|
||||
original: {
|
||||
key: storageKey.key,
|
||||
downloadUrl: '',
|
||||
filesizeInBytes: sampleBuffer.length,
|
||||
codec: '',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
const shareLink = await shareService.createShareLink(project.id, {
|
||||
name: 'Public Watermarked Share',
|
||||
})
|
||||
await shareService.addAssetToShare(shareLink.id, { assetIds: [asset.id] })
|
||||
|
||||
const watermarkConfig: WatermarkConfigSpec = {
|
||||
blocks: [
|
||||
{
|
||||
id: 'b1',
|
||||
type: 'text',
|
||||
x: 0.5,
|
||||
y: 0.5,
|
||||
opacity: 0.5,
|
||||
rotation: 0,
|
||||
text: 'CONFIDENTIAL E2E',
|
||||
size: 0.2,
|
||||
color: '#FF0000',
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
// 2. Enable Watermark on Sharelink
|
||||
const updatedShare = await watermarkService.updateShareLinkWatermark(
|
||||
shareLink.id,
|
||||
true,
|
||||
watermarkConfig,
|
||||
)
|
||||
expect(updatedShare.watermarkStatus).toBe('processing')
|
||||
|
||||
// 3. Poll for WorkflowTask completion & ShareLink status 'ready'
|
||||
let finalShare = await shareService.getShareLink(shareLink.id)
|
||||
const startTime = Date.now()
|
||||
while (finalShare.watermarkStatus === 'processing' && Date.now() - startTime < 15000) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 500))
|
||||
finalShare = await shareService.getShareLink(shareLink.id)
|
||||
}
|
||||
|
||||
expect(finalShare.watermarkStatus).toBe('ready')
|
||||
|
||||
// Verify WatermarkFile record was created and completed
|
||||
const watermarkFile = await prisma.watermarkFile.findUnique({
|
||||
where: {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
assetId_watermarkConfigId: {
|
||||
assetId: asset.id,
|
||||
watermarkConfigId: updatedShare.watermarkConfigId!,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
expect(watermarkFile).toBeDefined()
|
||||
expect(watermarkFile?.status).toBe(WatermarkFileStatus.completed)
|
||||
expect(watermarkFile?.media).toBeDefined()
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
expect((watermarkFile?.media as any)?.imageTranscodes?.length).toBeGreaterThan(0)
|
||||
})
|
||||
|
||||
it('should generate watermark proxy for a video asset and update sharelink status to ready', async () => {
|
||||
// 1. Seed Database
|
||||
const team = await prisma.team.create({
|
||||
data: { name: 'E2E Watermark Video Team' },
|
||||
})
|
||||
const projectFolder = await prisma.asset.create({
|
||||
data: { name: 'root', type: 'root', status: 'processed' },
|
||||
})
|
||||
const project = await prisma.project.create({
|
||||
data: {
|
||||
name: 'E2E Watermark Video Project',
|
||||
teamId: team.id,
|
||||
rootFolderId: projectFolder.id,
|
||||
},
|
||||
})
|
||||
|
||||
const storageKey = await prisma.storageKey.create({
|
||||
data: { key: 'files/e2e-watermark-video/original.mp4' },
|
||||
})
|
||||
|
||||
const videoPath = path.join(fixturesDir, 'small.mp4')
|
||||
const videoBuffer = fs.readFileSync(videoPath)
|
||||
await s3Service.putObject(
|
||||
'shumai-e2e-test-bucket-watermark',
|
||||
storageKey.key,
|
||||
videoBuffer,
|
||||
videoBuffer.length,
|
||||
'video/mp4',
|
||||
)
|
||||
|
||||
const asset = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'small.mp4',
|
||||
type: 'file',
|
||||
mediaType: 'video/mp4',
|
||||
status: 'processed',
|
||||
projectId: project.id,
|
||||
storageKeyId: storageKey.id,
|
||||
media: {
|
||||
duration: 1,
|
||||
filesize: videoBuffer.length,
|
||||
frames: 30,
|
||||
proxyType: 'video',
|
||||
imageTranscodes: [],
|
||||
videoTranscodes: [
|
||||
{ key: storageKey.key, width: 640, height: 360, resolution: '360p' },
|
||||
// Raw marker entry (as produced by transcodeVideoWorkflow) — must
|
||||
// not be watermarked.
|
||||
{ key: storageKey.key, width: 640, height: 360, isRaw: true },
|
||||
],
|
||||
videoPreview: { width: 640, height: 360 },
|
||||
finishedAt: new Date().toISOString(),
|
||||
metadata: {
|
||||
originalWidth: 640,
|
||||
originalHeight: 360,
|
||||
duration: 1,
|
||||
bitRate: 0,
|
||||
frameRate: 30,
|
||||
totalFrames: 30,
|
||||
startTimecode: '00:00:00:00',
|
||||
hasAudio: false,
|
||||
format: {},
|
||||
},
|
||||
original: {
|
||||
key: storageKey.key,
|
||||
downloadUrl: '',
|
||||
filesizeInBytes: videoBuffer.length,
|
||||
codec: '',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
const shareLink = await shareService.createShareLink(project.id, {
|
||||
name: 'Public Watermarked Video Share',
|
||||
})
|
||||
await shareService.addAssetToShare(shareLink.id, { assetIds: [asset.id] })
|
||||
|
||||
const watermarkConfig: WatermarkConfigSpec = {
|
||||
blocks: [
|
||||
{
|
||||
id: 'b1',
|
||||
type: 'text',
|
||||
x: 0.5,
|
||||
y: 0.5,
|
||||
opacity: 0.5,
|
||||
rotation: 0,
|
||||
text: 'CONFIDENTIAL VIDEO',
|
||||
size: 0.2,
|
||||
color: '#FF0000',
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
// 2. Enable Watermark on Sharelink
|
||||
const updatedShare = await watermarkService.updateShareLinkWatermark(
|
||||
shareLink.id,
|
||||
true,
|
||||
watermarkConfig,
|
||||
)
|
||||
expect(updatedShare.watermarkStatus).toBe('processing')
|
||||
|
||||
// 3. Poll for WorkflowTask completion & ShareLink status 'ready'
|
||||
let finalShare = await shareService.getShareLink(shareLink.id)
|
||||
const startTime = Date.now()
|
||||
while (finalShare.watermarkStatus === 'processing' && Date.now() - startTime < 30000) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 500))
|
||||
finalShare = await shareService.getShareLink(shareLink.id)
|
||||
}
|
||||
|
||||
expect(finalShare.watermarkStatus).toBe('ready')
|
||||
|
||||
const watermarkFile = await prisma.watermarkFile.findUnique({
|
||||
where: {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
assetId_watermarkConfigId: {
|
||||
assetId: asset.id,
|
||||
watermarkConfigId: updatedShare.watermarkConfigId!,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
expect(watermarkFile).toBeDefined()
|
||||
expect(watermarkFile?.status).toBe(WatermarkFileStatus.completed)
|
||||
expect(watermarkFile?.media).toBeDefined()
|
||||
// Only the transcoded proxy should be watermarked — the raw marker entry
|
||||
// (isRaw: true) must be skipped, so exactly one watermark proxy is produced.
|
||||
const mediaInfo = watermarkFile?.media as PrismaJson.MediaInfo | null
|
||||
expect(mediaInfo?.videoTranscodes?.length).toBe(1)
|
||||
expect(mediaInfo?.videoTranscodes?.[0].resolution).toBe('360p')
|
||||
})
|
||||
|
||||
it('should watermark a newly added asset after the sharelink is already ready', async () => {
|
||||
// 1. Seed Database
|
||||
const team = await prisma.team.create({
|
||||
data: { name: 'E2E Watermark Team' },
|
||||
})
|
||||
const projectFolder = await prisma.asset.create({
|
||||
data: { name: 'root', type: 'root', status: 'processed' },
|
||||
})
|
||||
const project = await prisma.project.create({
|
||||
data: { name: 'E2E Watermark Project', teamId: team.id, rootFolderId: projectFolder.id },
|
||||
})
|
||||
|
||||
const readSampleImage = (): Buffer => {
|
||||
const sampleImagePath = path.join(fixturesDir, 'sample.png')
|
||||
if (fs.existsSync(sampleImagePath)) {
|
||||
return fs.readFileSync(sampleImagePath)
|
||||
}
|
||||
// Minimal 1x1 PNG fallback if fixture is missing
|
||||
return Buffer.from(
|
||||
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==',
|
||||
'base64',
|
||||
)
|
||||
}
|
||||
|
||||
const createImageAsset = async (key: string, name: string) => {
|
||||
const buffer = readSampleImage()
|
||||
const storageKey = await prisma.storageKey.create({ data: { key } })
|
||||
await s3Service.putObject(
|
||||
'shumai-e2e-test-bucket-watermark',
|
||||
key,
|
||||
buffer,
|
||||
buffer.length,
|
||||
'image/png',
|
||||
)
|
||||
return await prisma.asset.create({
|
||||
data: {
|
||||
name,
|
||||
type: 'file',
|
||||
mediaType: 'image/png',
|
||||
status: 'processed',
|
||||
projectId: project.id,
|
||||
storageKeyId: storageKey.id,
|
||||
media: {
|
||||
duration: 0,
|
||||
filesize: buffer.length,
|
||||
frames: 0,
|
||||
proxyType: 'image',
|
||||
imageTranscodes: [{ key, width: 100, height: 100, quality: 90, format: 'webp' }],
|
||||
videoTranscodes: [],
|
||||
videoPreview: { width: 100, height: 100 },
|
||||
finishedAt: new Date().toISOString(),
|
||||
metadata: {
|
||||
originalWidth: 100,
|
||||
originalHeight: 100,
|
||||
duration: 0,
|
||||
bitRate: 0,
|
||||
frameRate: 0,
|
||||
totalFrames: 0,
|
||||
startTimecode: '00:00:00:00',
|
||||
hasAudio: false,
|
||||
format: {},
|
||||
},
|
||||
original: {
|
||||
key,
|
||||
downloadUrl: '',
|
||||
filesizeInBytes: buffer.length,
|
||||
codec: '',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
const assetA = await createImageAsset('files/e2e-add-after-ready/a.png', 'a.png')
|
||||
const shareLink = await shareService.createShareLink(project.id, {
|
||||
name: 'Public Watermarked Share',
|
||||
})
|
||||
await shareService.addAssetToShare(shareLink.id, { assetIds: [assetA.id] })
|
||||
|
||||
const watermarkConfig: WatermarkConfigSpec = {
|
||||
blocks: [
|
||||
{
|
||||
id: 'b1',
|
||||
type: 'text',
|
||||
x: 0.5,
|
||||
y: 0.5,
|
||||
opacity: 0.5,
|
||||
rotation: 0,
|
||||
text: 'CONFIDENTIAL E2E',
|
||||
size: 0.2,
|
||||
color: '#FF0000',
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
// 2. Enable Watermark on Sharelink and wait for initial 'ready'
|
||||
const updatedShare = await watermarkService.updateShareLinkWatermark(
|
||||
shareLink.id,
|
||||
true,
|
||||
watermarkConfig,
|
||||
)
|
||||
expect(updatedShare.watermarkStatus).toBe('processing')
|
||||
|
||||
let share = await shareService.getShareLink(shareLink.id)
|
||||
let startTime = Date.now()
|
||||
while (share.watermarkStatus === 'processing' && Date.now() - startTime < 30000) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 500))
|
||||
share = await shareService.getShareLink(shareLink.id)
|
||||
}
|
||||
expect(share.watermarkStatus).toBe('ready')
|
||||
expect(share.watermarkConfigId).toBe(updatedShare.watermarkConfigId)
|
||||
|
||||
// 3. Add a NEW asset to the ready sharelink
|
||||
const assetB = await createImageAsset('files/e2e-add-after-ready/b.png', 'b.png')
|
||||
await shareService.addAssetToShare(shareLink.id, { assetIds: [assetB.id] })
|
||||
|
||||
// 4. Status flips back to 'processing' while the new asset is transcoded
|
||||
share = await shareService.getShareLink(shareLink.id)
|
||||
expect(share.watermarkStatus).toBe('processing')
|
||||
|
||||
// 5. Poll until the sharelink is 'ready' again
|
||||
startTime = Date.now()
|
||||
while (share.watermarkStatus === 'processing' && Date.now() - startTime < 30000) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 500))
|
||||
share = await shareService.getShareLink(shareLink.id)
|
||||
}
|
||||
expect(share.watermarkStatus).toBe('ready')
|
||||
|
||||
// 6. Both assets now have completed watermark files
|
||||
for (const asset of [assetA, assetB]) {
|
||||
const wf = await prisma.watermarkFile.findUnique({
|
||||
where: {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
assetId_watermarkConfigId: {
|
||||
assetId: asset.id,
|
||||
watermarkConfigId: updatedShare.watermarkConfigId!,
|
||||
},
|
||||
},
|
||||
})
|
||||
expect(wf).toBeDefined()
|
||||
expect(wf?.status).toBe(WatermarkFileStatus.completed)
|
||||
}
|
||||
})
|
||||
},
|
||||
)
|
||||
@@ -0,0 +1,464 @@
|
||||
import { prisma, WatermarkFileStatus } from '@shumai/db'
|
||||
import '@shumai/db/src/prisma-json-types'
|
||||
import { setupTestDbHooks } from '@shumai/db/test'
|
||||
import { s3Service } from '@shumai/core/src/s3/s3'
|
||||
import { transcodeService } from '@shumai/core/src/transcode/transcode'
|
||||
import {
|
||||
initWatermarkFileActivity,
|
||||
waitForWatermarkFileActivity,
|
||||
transcodeWatermarkMediaActivity,
|
||||
completeWatermarkFileActivity,
|
||||
} from './watermark'
|
||||
import * as fs from 'fs'
|
||||
import * as path from 'path'
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
|
||||
vi.mock('child_process', () => ({
|
||||
execFile: vi.fn(
|
||||
(_cmd: string, args: string[], cb: (err: unknown, stdout: string, stderr: string) => void) => {
|
||||
const outFile = args[args.length - 1]
|
||||
if (outFile && typeof outFile === 'string') {
|
||||
try {
|
||||
fs.writeFileSync(outFile, 'fake-transcoded-output')
|
||||
} catch {
|
||||
// ignore directory creation errors in mock
|
||||
}
|
||||
}
|
||||
cb(null, '', '')
|
||||
},
|
||||
),
|
||||
}))
|
||||
|
||||
vi.mock('@shumai/core/src/s3/s3', () => ({
|
||||
s3Service: {
|
||||
getObject: vi.fn(),
|
||||
putObject: vi.fn(),
|
||||
presign: vi.fn(),
|
||||
downloadToFile: vi.fn().mockImplementation(async (_b, _k, dest) => {
|
||||
fs.writeFileSync(dest, 'fake-raw')
|
||||
}),
|
||||
downloadMediaToTmp: vi.fn().mockImplementation(async () => ({
|
||||
filePath: '/tmp/raw-file',
|
||||
tmpDir: '/tmp',
|
||||
})),
|
||||
deleteObject: vi.fn(),
|
||||
},
|
||||
}))
|
||||
|
||||
vi.mock('@shumai/core/src/transcode/transcode', () => ({
|
||||
transcodeService: {
|
||||
getVideoInfo: vi.fn(),
|
||||
getImageInfo: vi.fn(),
|
||||
createTempDir: vi.fn().mockReturnValue('/tmp'),
|
||||
removeDir: vi.fn(),
|
||||
renderSvgToPng: vi.fn().mockResolvedValue(Buffer.from('fake-overlay-png')),
|
||||
downscaleImageToPng: vi.fn().mockResolvedValue({
|
||||
buffer: Buffer.from('fake-block-png'),
|
||||
width: 32,
|
||||
height: 32,
|
||||
}),
|
||||
compositeOverlayToWebpFile: vi.fn().mockImplementation(async (_in, _overlay, out) => {
|
||||
fs.writeFileSync(out, 'fake-webp')
|
||||
}),
|
||||
transcodeVideo: vi.fn().mockImplementation(async (params) => {
|
||||
fs.writeFileSync(params.outputFile, 'fake-mp4')
|
||||
}),
|
||||
},
|
||||
}))
|
||||
|
||||
describe('Watermark Activities', () => {
|
||||
setupTestDbHooks()
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks()
|
||||
})
|
||||
|
||||
describe('initWatermarkFileActivity', () => {
|
||||
async function seedAssetAndConfig() {
|
||||
const asset = await prisma.asset.create({
|
||||
data: { name: 'wm-target.png', type: 'file', status: 'processed' },
|
||||
})
|
||||
const config = await prisma.watermarkConfig.create({
|
||||
data: {
|
||||
hash: 'init-hash-' + Math.random(),
|
||||
config: { blocks: [] },
|
||||
},
|
||||
})
|
||||
return { asset, config }
|
||||
}
|
||||
|
||||
it('creates a processing row when none exists', async () => {
|
||||
const { asset, config } = await seedAssetAndConfig()
|
||||
const res = await initWatermarkFileActivity({
|
||||
assetId: asset.id,
|
||||
watermarkConfigId: config.id,
|
||||
})
|
||||
expect(res.action).toBe('created')
|
||||
const row = await prisma.watermarkFile.findUnique({
|
||||
where: {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
assetId_watermarkConfigId: {
|
||||
assetId: asset.id,
|
||||
watermarkConfigId: config.id,
|
||||
},
|
||||
},
|
||||
})
|
||||
expect(row?.status).toBe(WatermarkFileStatus.processing)
|
||||
})
|
||||
|
||||
it('returns completed action when a completed watermark file exists', async () => {
|
||||
const { asset, config } = await seedAssetAndConfig()
|
||||
await prisma.watermarkFile.create({
|
||||
data: {
|
||||
assetId: asset.id,
|
||||
watermarkConfigId: config.id,
|
||||
status: WatermarkFileStatus.completed,
|
||||
},
|
||||
})
|
||||
const res = await initWatermarkFileActivity({
|
||||
assetId: asset.id,
|
||||
watermarkConfigId: config.id,
|
||||
})
|
||||
expect(res.action).toBe('completed')
|
||||
})
|
||||
|
||||
it('returns processing action when a processing row exists', async () => {
|
||||
const { asset, config } = await seedAssetAndConfig()
|
||||
await prisma.watermarkFile.create({
|
||||
data: {
|
||||
assetId: asset.id,
|
||||
watermarkConfigId: config.id,
|
||||
status: WatermarkFileStatus.processing,
|
||||
},
|
||||
})
|
||||
const res = await initWatermarkFileActivity({
|
||||
assetId: asset.id,
|
||||
watermarkConfigId: config.id,
|
||||
})
|
||||
expect(res.action).toBe('processing')
|
||||
})
|
||||
|
||||
it('returns failed action when a failed row exists', async () => {
|
||||
const { asset, config } = await seedAssetAndConfig()
|
||||
await prisma.watermarkFile.create({
|
||||
data: {
|
||||
assetId: asset.id,
|
||||
watermarkConfigId: config.id,
|
||||
status: WatermarkFileStatus.failed,
|
||||
},
|
||||
})
|
||||
const res = await initWatermarkFileActivity({
|
||||
assetId: asset.id,
|
||||
watermarkConfigId: config.id,
|
||||
})
|
||||
expect(res.action).toBe('failed')
|
||||
})
|
||||
|
||||
it('waits for watermark file completion in waitForWatermarkFileActivity', async () => {
|
||||
const { asset, config } = await seedAssetAndConfig()
|
||||
const wf = await prisma.watermarkFile.create({
|
||||
data: {
|
||||
assetId: asset.id,
|
||||
watermarkConfigId: config.id,
|
||||
status: WatermarkFileStatus.processing,
|
||||
},
|
||||
})
|
||||
|
||||
setTimeout(async () => {
|
||||
await prisma.watermarkFile.update({
|
||||
where: { id: wf.id },
|
||||
data: { status: WatermarkFileStatus.completed },
|
||||
})
|
||||
}, 50)
|
||||
|
||||
const res = await waitForWatermarkFileActivity({
|
||||
assetId: asset.id,
|
||||
watermarkConfigId: config.id,
|
||||
})
|
||||
expect(res.status).toBe(WatermarkFileStatus.completed)
|
||||
})
|
||||
})
|
||||
|
||||
describe('transcodeWatermarkMediaActivity', () => {
|
||||
const bucket = process.env.S3_BUCKET || 'shumai'
|
||||
|
||||
async function seedAsset(name: string, mediaType: string, key: string, proxyType: string) {
|
||||
const storageKey = await prisma.storageKey.create({ data: { key } })
|
||||
return prisma.asset.create({
|
||||
data: {
|
||||
name,
|
||||
type: 'file',
|
||||
mediaType,
|
||||
status: 'processed',
|
||||
storageKeyId: storageKey.id,
|
||||
media: {
|
||||
duration: 0,
|
||||
filesize: 0,
|
||||
frames: 0,
|
||||
proxyType,
|
||||
videoTranscodes: [{ key, width: 100, height: 100, resolution: '100p' }],
|
||||
imageTranscodes: [{ key, width: 100, height: 100, quality: 90, format: 'webp' }],
|
||||
videoPreview: { width: 100, height: 100 },
|
||||
finishedAt: new Date().toISOString(),
|
||||
metadata: {
|
||||
originalWidth: 100,
|
||||
originalHeight: 100,
|
||||
duration: 0,
|
||||
bitRate: 0,
|
||||
frameRate: 0,
|
||||
totalFrames: 0,
|
||||
startTimecode: '00:00:00:00',
|
||||
hasAudio: false,
|
||||
format: {},
|
||||
},
|
||||
original: {
|
||||
key,
|
||||
downloadUrl: '',
|
||||
filesizeInBytes: 0,
|
||||
codec: '',
|
||||
},
|
||||
} as PrismaJson.MediaInfo,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
async function seedConfig() {
|
||||
return prisma.watermarkConfig.create({
|
||||
data: {
|
||||
config: {
|
||||
blocks: [
|
||||
{
|
||||
id: 'b1',
|
||||
type: 'text',
|
||||
x: 0.5,
|
||||
y: 0.5,
|
||||
opacity: 0.5,
|
||||
rotation: 0,
|
||||
text: 'TEST WM',
|
||||
size: 0.2,
|
||||
color: '#FF0000',
|
||||
},
|
||||
],
|
||||
},
|
||||
hash: 'test-hash-' + Math.random(),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
it('produces a watermarked webp proxy for an image asset', async () => {
|
||||
const assetKey = 'files/e2e-wm/test.png'
|
||||
const asset = await seedAsset('test.png', 'image/png', assetKey, 'image')
|
||||
const config = await seedConfig()
|
||||
|
||||
vi.mocked(transcodeService.getImageInfo).mockResolvedValue({
|
||||
originalWidth: 100,
|
||||
originalHeight: 100,
|
||||
duration: 0,
|
||||
bitRate: 0,
|
||||
frameRate: 0,
|
||||
totalFrames: 0,
|
||||
hasAudio: false,
|
||||
mimeType: 'image/png',
|
||||
})
|
||||
vi.mocked(s3Service.putObject).mockResolvedValue(undefined as never)
|
||||
|
||||
// compositeOverlayToWebpFile is mocked, but the activity stats the output
|
||||
// file afterwards, so pre-create it at the expected path.
|
||||
const outFileName = `test-watermark-${config.id}-100x100.webp`
|
||||
const outFilePath = path.join('/tmp', outFileName)
|
||||
fs.writeFileSync(outFilePath, Buffer.from('fake webp'))
|
||||
|
||||
const media = await transcodeWatermarkMediaActivity({
|
||||
assetId: asset.id,
|
||||
watermarkConfigId: config.id,
|
||||
})
|
||||
|
||||
expect(media.proxyType).toBe('image')
|
||||
expect(media.imageTranscodes?.length).toBeGreaterThan(0)
|
||||
expect(media.imageTranscodes?.[0].key).toContain('watermark-')
|
||||
expect(transcodeService.renderSvgToPng).toHaveBeenCalled()
|
||||
expect(transcodeService.compositeOverlayToWebpFile).toHaveBeenCalledWith(
|
||||
expect.stringContaining('test.png'),
|
||||
Buffer.from('fake-overlay-png'),
|
||||
outFilePath,
|
||||
100,
|
||||
100,
|
||||
)
|
||||
expect(s3Service.putObject).toHaveBeenCalledWith(
|
||||
bucket,
|
||||
expect.stringContaining('watermark-'),
|
||||
expect.anything(),
|
||||
expect.any(Number),
|
||||
'image/webp',
|
||||
)
|
||||
|
||||
fs.rmSync(outFilePath, { force: true })
|
||||
})
|
||||
|
||||
it('skips the raw (isRaw) video transcode when generating watermark proxies', async () => {
|
||||
const assetKey = 'files/e2e-wm/raw-video.mp4'
|
||||
const asset = await seedAsset('raw-video.mp4', 'video/mp4', assetKey, 'video')
|
||||
const config = await seedConfig()
|
||||
|
||||
// Simulate the media state produced by transcodeVideoWorkflow: a
|
||||
// transcoded proxy plus a raw marker entry pointing at the original file.
|
||||
await prisma.asset.update({
|
||||
where: { id: asset.id },
|
||||
data: {
|
||||
media: {
|
||||
...(asset.media as PrismaJson.MediaInfo),
|
||||
videoTranscodes: [
|
||||
{ key: assetKey, width: 100, height: 100, resolution: '100p' },
|
||||
{ key: assetKey, width: 1920, height: 1080, isRaw: true },
|
||||
],
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vi.mocked(transcodeService.getVideoInfo).mockResolvedValue({
|
||||
originalWidth: 1920,
|
||||
originalHeight: 1080,
|
||||
duration: 10,
|
||||
bitRate: 1000,
|
||||
frameRate: 30,
|
||||
totalFrames: 300,
|
||||
startTimecode: '00:00:00:00',
|
||||
hasAudio: true,
|
||||
mimeType: 'video/mp4',
|
||||
})
|
||||
vi.mocked(s3Service.putObject).mockResolvedValue(undefined as never)
|
||||
|
||||
// The ffmpeg execFile call is mocked, but the activity stats the output
|
||||
// file afterwards, so pre-create both expected output paths.
|
||||
const stem = 'raw-video'
|
||||
const configId = config.id
|
||||
const proxyOutFilePath = path.join('/tmp', `${stem}-watermark-${configId}-100p.mp4`)
|
||||
const rawOutFilePath = path.join('/tmp', `${stem}-watermark-${configId}-1080p.mp4`)
|
||||
fs.writeFileSync(proxyOutFilePath, Buffer.from('fake mp4'))
|
||||
fs.writeFileSync(rawOutFilePath, Buffer.from('fake mp4'))
|
||||
|
||||
try {
|
||||
const media = await transcodeWatermarkMediaActivity({
|
||||
assetId: asset.id,
|
||||
watermarkConfigId: config.id,
|
||||
})
|
||||
|
||||
expect(media.proxyType).toBe('video')
|
||||
// Only the transcoded proxy should be watermarked, never the raw original.
|
||||
expect(transcodeService.transcodeVideo).toHaveBeenCalledTimes(1)
|
||||
expect(media.videoTranscodes).toHaveLength(1)
|
||||
expect(media.videoTranscodes?.[0].resolution).toBe('100p')
|
||||
expect(media.videoTranscodes?.[0].key).toContain('watermark-')
|
||||
} finally {
|
||||
fs.rmSync(proxyOutFilePath, { force: true })
|
||||
fs.rmSync(rawOutFilePath, { force: true })
|
||||
}
|
||||
})
|
||||
|
||||
it('produces a watermarked mp4 proxy for a video asset (ffmpeg path)', async () => {
|
||||
const assetKey = 'files/e2e-wm/video.mp4'
|
||||
const asset = await seedAsset('video.mp4', 'video/mp4', assetKey, 'video')
|
||||
const config = await seedConfig()
|
||||
|
||||
vi.mocked(transcodeService.getVideoInfo).mockResolvedValue({
|
||||
originalWidth: 1920,
|
||||
originalHeight: 1080,
|
||||
duration: 10,
|
||||
bitRate: 1000,
|
||||
frameRate: 30,
|
||||
totalFrames: 300,
|
||||
startTimecode: '00:00:00:00',
|
||||
hasAudio: true,
|
||||
mimeType: 'video/mp4',
|
||||
})
|
||||
vi.mocked(s3Service.putObject).mockResolvedValue(undefined as never)
|
||||
|
||||
// The ffmpeg execFile call is mocked, but the activity stats the output
|
||||
// file afterwards, so pre-create it at the expected path.
|
||||
const stem = 'video'
|
||||
const configId = config.id
|
||||
const outFilePath = path.join('/tmp', `${stem}-watermark-${configId}-100p.mp4`)
|
||||
fs.writeFileSync(outFilePath, Buffer.from('fake mp4'))
|
||||
|
||||
const media = await transcodeWatermarkMediaActivity({
|
||||
assetId: asset.id,
|
||||
watermarkConfigId: config.id,
|
||||
})
|
||||
|
||||
expect(media.proxyType).toBe('video')
|
||||
expect(media.videoTranscodes?.length).toBeGreaterThan(0)
|
||||
expect(media.videoTranscodes?.[0].key).toContain('watermark-')
|
||||
expect(s3Service.putObject).toHaveBeenCalledWith(
|
||||
bucket,
|
||||
expect.stringContaining('watermark-'),
|
||||
expect.anything(),
|
||||
expect.any(Number),
|
||||
'video/mp4',
|
||||
)
|
||||
|
||||
fs.rmSync(outFilePath, { force: true })
|
||||
})
|
||||
})
|
||||
|
||||
describe('completeWatermarkFileActivity', () => {
|
||||
it('upserts a completed watermark file with media', async () => {
|
||||
const asset = await prisma.asset.create({
|
||||
data: { name: 'wm-complete.png', type: 'file', status: 'processed' },
|
||||
})
|
||||
const config = await prisma.watermarkConfig.create({
|
||||
data: {
|
||||
hash: 'complete-hash-' + Math.random(),
|
||||
config: { blocks: [] },
|
||||
},
|
||||
})
|
||||
const media: PrismaJson.MediaInfo = {
|
||||
duration: 0,
|
||||
filesize: 0,
|
||||
frames: 0,
|
||||
proxyType: 'image',
|
||||
imageTranscodes: [
|
||||
{ key: 'files/x/out.webp', width: 100, height: 100, quality: 90, format: 'webp' },
|
||||
],
|
||||
videoTranscodes: [],
|
||||
videoPreview: { width: 100, height: 100 },
|
||||
finishedAt: new Date().toISOString(),
|
||||
metadata: {
|
||||
originalWidth: 100,
|
||||
originalHeight: 100,
|
||||
duration: 0,
|
||||
bitRate: 0,
|
||||
frameRate: 0,
|
||||
totalFrames: 0,
|
||||
startTimecode: '00:00:00:00',
|
||||
hasAudio: false,
|
||||
format: {},
|
||||
},
|
||||
original: {
|
||||
key: 'files/x/original.png',
|
||||
downloadUrl: '',
|
||||
filesizeInBytes: 0,
|
||||
codec: '',
|
||||
},
|
||||
}
|
||||
|
||||
await completeWatermarkFileActivity({
|
||||
assetId: asset.id,
|
||||
watermarkConfigId: config.id,
|
||||
mediaInfo: media,
|
||||
status: WatermarkFileStatus.completed,
|
||||
})
|
||||
|
||||
const row = await prisma.watermarkFile.findUnique({
|
||||
where: {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
assetId_watermarkConfigId: {
|
||||
assetId: asset.id,
|
||||
watermarkConfigId: config.id,
|
||||
},
|
||||
},
|
||||
})
|
||||
expect(row?.status).toBe(WatermarkFileStatus.completed)
|
||||
expect(row?.media).toBeDefined()
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,400 @@
|
||||
import { prisma, WatermarkFileStatus } from '@shumai/db'
|
||||
import '@shumai/db/src/prisma-json-types'
|
||||
import { s3Service } from '@shumai/core/src/s3/s3'
|
||||
import { transcodeService } from '@shumai/core/src/transcode/transcode'
|
||||
import {
|
||||
generateWatermarkSvg,
|
||||
RenderBlockImageData,
|
||||
} from '@shumai/core/src/watermark/watermark-svg'
|
||||
import { watermarkService } from '@shumai/core/src/watermark/watermark'
|
||||
import { logger } from '@shumai/core/src/logger'
|
||||
import { stemFromKey } from '@shumai/core/src/utils/filename'
|
||||
import { ApplicationFailure } from '@temporalio/activity'
|
||||
import * as path from 'path'
|
||||
import * as fs from 'fs'
|
||||
import { ulid } from 'ulid'
|
||||
import type { WatermarkConfigSpec, WatermarkBlockImage } from '@shumai/dtos'
|
||||
|
||||
// Max dimension for watermark block images embedded into the SVG overlay.
|
||||
// Bounding this keeps the SVG (and its base64 payload) small for large logos.
|
||||
const MAX_BLOCK_IMAGE_DIMENSION = 1024
|
||||
|
||||
export interface InitWatermarkFileParams {
|
||||
assetId: string
|
||||
watermarkConfigId: string
|
||||
}
|
||||
|
||||
export type InitWatermarkFileAction = 'created' | 'completed' | 'processing' | 'failed'
|
||||
|
||||
export interface InitWatermarkFileResult {
|
||||
action: InitWatermarkFileAction
|
||||
media?: PrismaJson.MediaInfo | null
|
||||
}
|
||||
|
||||
export async function initWatermarkFileActivity(
|
||||
params: InitWatermarkFileParams,
|
||||
): Promise<InitWatermarkFileResult> {
|
||||
return await prisma.$transaction(async (tx) => {
|
||||
const rows = await tx.$queryRaw<
|
||||
Array<{
|
||||
id: string
|
||||
status: WatermarkFileStatus
|
||||
media: PrismaJson.MediaInfo | null
|
||||
}>
|
||||
>`
|
||||
SELECT id, status, media
|
||||
FROM watermark_files
|
||||
WHERE asset_id = ${params.assetId}
|
||||
AND watermark_config_id = ${params.watermarkConfigId}
|
||||
FOR UPDATE
|
||||
`
|
||||
|
||||
if (rows.length > 0) {
|
||||
const existing = rows[0]
|
||||
if (existing.status === WatermarkFileStatus.completed) {
|
||||
return { action: 'completed', media: existing.media }
|
||||
}
|
||||
if (existing.status === WatermarkFileStatus.failed) {
|
||||
return { action: 'failed' }
|
||||
}
|
||||
return { action: 'processing' }
|
||||
}
|
||||
|
||||
await tx.watermarkFile.create({
|
||||
data: {
|
||||
assetId: params.assetId,
|
||||
watermarkConfigId: params.watermarkConfigId,
|
||||
status: WatermarkFileStatus.processing,
|
||||
},
|
||||
})
|
||||
|
||||
return { action: 'created' }
|
||||
})
|
||||
}
|
||||
|
||||
export interface WaitForWatermarkFileParams {
|
||||
assetId: string
|
||||
watermarkConfigId: string
|
||||
}
|
||||
|
||||
export interface WaitForWatermarkFileResult {
|
||||
status: WatermarkFileStatus
|
||||
media?: PrismaJson.MediaInfo | null
|
||||
}
|
||||
|
||||
export async function waitForWatermarkFileActivity(
|
||||
params: WaitForWatermarkFileParams,
|
||||
): Promise<WaitForWatermarkFileResult> {
|
||||
const pollIntervalMs = 1000
|
||||
const maxWaitMs = 600000 // 10 minutes timeout
|
||||
|
||||
const startTime = Date.now()
|
||||
|
||||
while (Date.now() - startTime < maxWaitMs) {
|
||||
const wf = await prisma.watermarkFile.findUnique({
|
||||
where: {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
assetId_watermarkConfigId: {
|
||||
assetId: params.assetId,
|
||||
watermarkConfigId: params.watermarkConfigId,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
if (wf && wf.status !== WatermarkFileStatus.processing) {
|
||||
return { status: wf.status, media: wf.media }
|
||||
}
|
||||
|
||||
await new Promise((resolve) => setTimeout(resolve, pollIntervalMs))
|
||||
}
|
||||
|
||||
return { status: WatermarkFileStatus.failed }
|
||||
}
|
||||
|
||||
export interface TranscodeWatermarkMediaParams {
|
||||
assetId: string
|
||||
watermarkConfigId: string
|
||||
}
|
||||
|
||||
export async function transcodeWatermarkMediaActivity(
|
||||
params: TranscodeWatermarkMediaParams,
|
||||
): Promise<PrismaJson.MediaInfo> {
|
||||
const bucket = process.env.S3_BUCKET || 'shumai'
|
||||
|
||||
const watermarkConfigRecord = await prisma.watermarkConfig.findUnique({
|
||||
where: { id: params.watermarkConfigId },
|
||||
})
|
||||
if (!watermarkConfigRecord) {
|
||||
throw ApplicationFailure.create({
|
||||
message: `Watermark config not found: ${params.watermarkConfigId}`,
|
||||
nonRetryable: true,
|
||||
})
|
||||
}
|
||||
|
||||
const asset = await prisma.asset.findUnique({
|
||||
where: { id: params.assetId },
|
||||
include: { storageKey: true },
|
||||
})
|
||||
|
||||
if (!asset || !asset.storageKey?.key) {
|
||||
throw ApplicationFailure.create({
|
||||
message: `Asset or storage key not found: ${params.assetId}`,
|
||||
nonRetryable: true,
|
||||
})
|
||||
}
|
||||
|
||||
// The config column is declared as PrismaJson.WatermarkConfigSpec, which is
|
||||
// structurally identical to the DTO type, so no cast is required.
|
||||
const config: WatermarkConfigSpec = watermarkConfigRecord.config
|
||||
const assetKey = asset.storageKey.key
|
||||
const stem = stemFromKey(assetKey)
|
||||
|
||||
const tmpDir = transcodeService.createTempDir('watermark-')
|
||||
const rawFilePath = path.join(tmpDir, path.basename(assetKey))
|
||||
|
||||
try {
|
||||
await s3Service.downloadToFile(bucket, assetKey, rawFilePath)
|
||||
|
||||
const isVideo =
|
||||
asset.mediaType?.startsWith('video/') ||
|
||||
(asset.media as PrismaJson.MediaInfo | null)?.proxyType === 'video'
|
||||
const isImage =
|
||||
asset.mediaType?.startsWith('image/') ||
|
||||
(asset.media as PrismaJson.MediaInfo | null)?.proxyType === 'image'
|
||||
|
||||
let originalWidth = 1920
|
||||
let originalHeight = 1080
|
||||
let duration = 0
|
||||
let frameRate = 30
|
||||
let totalFrames = 0
|
||||
let startTimecode = '00:00:00:00'
|
||||
let hasAudio = false
|
||||
|
||||
if (isVideo) {
|
||||
const info = await transcodeService.getVideoInfo(rawFilePath)
|
||||
originalWidth = info.originalWidth
|
||||
originalHeight = info.originalHeight
|
||||
duration = info.duration
|
||||
frameRate = info.frameRate
|
||||
totalFrames = info.totalFrames
|
||||
startTimecode = info.startTimecode || '00:00:00:00'
|
||||
hasAudio = info.hasAudio
|
||||
} else if (isImage) {
|
||||
const info = await transcodeService.getImageInfo(rawFilePath)
|
||||
originalWidth = info.originalWidth
|
||||
originalHeight = info.originalHeight
|
||||
} else {
|
||||
throw ApplicationFailure.create({
|
||||
message: `Asset ${params.assetId} is neither video nor image`,
|
||||
nonRetryable: true,
|
||||
})
|
||||
}
|
||||
|
||||
// Process image blocks if any
|
||||
const blockImagesMap = new Map<string, RenderBlockImageData>()
|
||||
const imageBlocks = (config.blocks || []).filter(
|
||||
(b) => b.type === 'image',
|
||||
) as WatermarkBlockImage[]
|
||||
|
||||
for (const imgBlock of imageBlocks) {
|
||||
if (!imgBlock.imageAssetKey) continue
|
||||
try {
|
||||
const imgTmpPath = path.join(tmpDir, `block-${ulid()}`)
|
||||
await s3Service.downloadToFile(bucket, imgBlock.imageAssetKey, imgTmpPath)
|
||||
const buffer = fs.readFileSync(imgTmpPath)
|
||||
// Downscale to a bounded size and normalize to PNG so large logo assets
|
||||
// don't balloon the SVG/base64 payload.
|
||||
const processed = await transcodeService.downscaleImageToPng(
|
||||
buffer,
|
||||
MAX_BLOCK_IMAGE_DIMENSION,
|
||||
)
|
||||
blockImagesMap.set(imgBlock.imageAssetKey, {
|
||||
imageAssetKey: imgBlock.imageAssetKey,
|
||||
base64Data: processed.buffer.toString('base64'),
|
||||
mimeType: 'image/png',
|
||||
width: processed.width,
|
||||
height: processed.height,
|
||||
})
|
||||
} catch (err) {
|
||||
logger.warn(
|
||||
{ imageAssetKey: imgBlock.imageAssetKey, err },
|
||||
'Failed to load watermark block image',
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const originalMedia = asset.media as PrismaJson.MediaInfo | null
|
||||
|
||||
const mediaInfo: PrismaJson.MediaInfo = {
|
||||
duration,
|
||||
filesize: 0,
|
||||
frames: totalFrames,
|
||||
proxyType: isVideo ? 'video' : 'image',
|
||||
imageTranscodes: [],
|
||||
videoTranscodes: [],
|
||||
finishedAt: new Date().toISOString(),
|
||||
metadata: {
|
||||
originalWidth,
|
||||
originalHeight,
|
||||
duration,
|
||||
bitRate: 0,
|
||||
frameRate,
|
||||
totalFrames,
|
||||
startTimecode,
|
||||
hasAudio,
|
||||
format: {},
|
||||
},
|
||||
original: {
|
||||
key: assetKey,
|
||||
downloadUrl: '',
|
||||
filesizeInBytes: 0,
|
||||
codec: '',
|
||||
},
|
||||
}
|
||||
|
||||
if (isImage) {
|
||||
const originalTranscodes = originalMedia?.imageTranscodes || []
|
||||
let totalSize = 0
|
||||
|
||||
for (let i = 0; i < originalTranscodes.length; i++) {
|
||||
const it = originalTranscodes[i]
|
||||
const targetWidth = it.width || originalWidth
|
||||
const targetHeight = it.height || originalHeight
|
||||
|
||||
const svgString = generateWatermarkSvg(config, targetWidth, targetHeight, blockImagesMap)
|
||||
const overlayPngBuffer = await transcodeService.renderSvgToPng(svgString)
|
||||
|
||||
const outFileName = `${stem}-watermark-${params.watermarkConfigId}-${targetWidth}x${targetHeight}.webp`
|
||||
const outFilePath = path.join(tmpDir, outFileName)
|
||||
|
||||
await transcodeService.compositeOverlayToWebpFile(
|
||||
rawFilePath,
|
||||
overlayPngBuffer,
|
||||
outFilePath,
|
||||
targetWidth,
|
||||
targetHeight,
|
||||
)
|
||||
|
||||
const stat = fs.statSync(outFilePath)
|
||||
totalSize += stat.size
|
||||
const outputKey = path.posix.join(path.posix.dirname(assetKey), outFileName)
|
||||
|
||||
await s3Service.putObject(
|
||||
bucket,
|
||||
outputKey,
|
||||
Bun.file(outFilePath).stream(),
|
||||
stat.size,
|
||||
'image/webp',
|
||||
)
|
||||
|
||||
mediaInfo.imageTranscodes.push({
|
||||
key: outputKey,
|
||||
width: targetWidth,
|
||||
height: targetHeight,
|
||||
quality: it.quality ?? 90,
|
||||
format: it.format ?? 'webp',
|
||||
})
|
||||
}
|
||||
mediaInfo.filesize = totalSize
|
||||
} else if (isVideo) {
|
||||
const originalTranscodes = originalMedia?.videoTranscodes || []
|
||||
let totalSize = 0
|
||||
|
||||
for (let i = 0; i < originalTranscodes.length; i++) {
|
||||
const vt = originalTranscodes[i]
|
||||
// Skip the raw marker entry (points at the original file) — it is not a
|
||||
// transcoded proxy, so there is nothing to watermark (and transcoding
|
||||
// the original at full resolution would be needlessly expensive).
|
||||
if (vt.isRaw) continue
|
||||
const targetWidth = vt.width || originalWidth
|
||||
const targetHeight = vt.height || originalHeight
|
||||
const resolution = vt.resolution || `${targetHeight}p`
|
||||
|
||||
const svgString = generateWatermarkSvg(config, targetWidth, targetHeight, blockImagesMap)
|
||||
const overlayPngBuffer = await transcodeService.renderSvgToPng(svgString)
|
||||
|
||||
const overlayPngPath = path.join(tmpDir, `watermarkOverlay-${i}.png`)
|
||||
fs.writeFileSync(overlayPngPath, overlayPngBuffer)
|
||||
|
||||
const outFileName = `${stem}-watermark-${params.watermarkConfigId}-${resolution}.mp4`
|
||||
const outFilePath = path.join(tmpDir, outFileName)
|
||||
|
||||
await transcodeService.transcodeVideo({
|
||||
inputFile: rawFilePath,
|
||||
outputFile: outFilePath,
|
||||
width: targetWidth,
|
||||
height: targetHeight,
|
||||
disableAudio: !hasAudio,
|
||||
overlayFile: overlayPngPath,
|
||||
})
|
||||
|
||||
const stat = fs.statSync(outFilePath)
|
||||
totalSize += stat.size
|
||||
const outputKey = path.posix.join(path.posix.dirname(assetKey), outFileName)
|
||||
|
||||
await s3Service.putObject(
|
||||
bucket,
|
||||
outputKey,
|
||||
Bun.file(outFilePath).stream(),
|
||||
stat.size,
|
||||
'video/mp4',
|
||||
)
|
||||
|
||||
mediaInfo.videoTranscodes.push({
|
||||
key: outputKey,
|
||||
width: targetWidth,
|
||||
height: targetHeight,
|
||||
resolution,
|
||||
})
|
||||
}
|
||||
mediaInfo.filesize = totalSize
|
||||
}
|
||||
|
||||
return mediaInfo
|
||||
} catch (err) {
|
||||
logger.error({ assetId: params.assetId, err }, 'Failed to generate watermark proxy')
|
||||
throw ApplicationFailure.create({
|
||||
message: `Failed to generate watermark proxy: ${err instanceof Error ? err.message : String(err)}`,
|
||||
nonRetryable: true,
|
||||
cause: err instanceof Error ? err : undefined,
|
||||
})
|
||||
} finally {
|
||||
transcodeService.removeDir(tmpDir)
|
||||
}
|
||||
}
|
||||
|
||||
export interface CompleteWatermarkFileParams {
|
||||
assetId: string
|
||||
watermarkConfigId: string
|
||||
mediaInfo?: PrismaJson.MediaInfo | null
|
||||
status: WatermarkFileStatus
|
||||
shareLinkId?: string | null
|
||||
}
|
||||
|
||||
export async function completeWatermarkFileActivity(
|
||||
params: CompleteWatermarkFileParams,
|
||||
): Promise<void> {
|
||||
await prisma.watermarkFile.upsert({
|
||||
where: {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
assetId_watermarkConfigId: {
|
||||
assetId: params.assetId,
|
||||
watermarkConfigId: params.watermarkConfigId,
|
||||
},
|
||||
},
|
||||
create: {
|
||||
assetId: params.assetId,
|
||||
watermarkConfigId: params.watermarkConfigId,
|
||||
media: params.mediaInfo ?? undefined,
|
||||
status: params.status,
|
||||
},
|
||||
update: {
|
||||
media: params.mediaInfo ?? undefined,
|
||||
status: params.status,
|
||||
},
|
||||
})
|
||||
|
||||
if (params.shareLinkId) {
|
||||
await watermarkService.checkAndUpdateShareLinkStatus(params.shareLinkId)
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,14 @@
|
||||
import { WorkflowTaskType } from '@shumai/db'
|
||||
import { registerActivities, registerWorkflow } from '@shumai/workflow-core'
|
||||
import * as transcodeActivities from './activities/transcode'
|
||||
import * as watermarkActivities from './activities/watermark'
|
||||
import { transcodeVideoWorkflow } from './workflows/transcode-video'
|
||||
import { transcodeImageWorkflow } from './workflows/transcode-image'
|
||||
import { transcodePdfWorkflow } from './workflows/transcode-pdf'
|
||||
import { renderPdfPagesWorkflow } from './workflows/render-pdf-pages'
|
||||
import { takeVideoScreenshotsWorkflow } from './workflows/take-video-screenshots'
|
||||
import { overlayImageAnnotationWorkflow } from './workflows/overlay-image-annotation'
|
||||
import { transcodeWatermarkWorkflow } from './workflows/transcode-watermark'
|
||||
import { transcodeMedia } from './workflows/transcode'
|
||||
|
||||
export function initTranscodeWorkflows() {
|
||||
@@ -17,9 +19,13 @@ export function initTranscodeWorkflows() {
|
||||
registerWorkflow(WorkflowTaskType.transcode_pdf_pages, renderPdfPagesWorkflow)
|
||||
registerWorkflow(WorkflowTaskType.transcode_screenshot, takeVideoScreenshotsWorkflow)
|
||||
registerWorkflow(WorkflowTaskType.transcode_image_annotation, overlayImageAnnotationWorkflow)
|
||||
registerWorkflow(WorkflowTaskType.transcode_watermark, transcodeWatermarkWorkflow)
|
||||
registerActivities(transcodeActivities)
|
||||
registerActivities(watermarkActivities)
|
||||
}
|
||||
|
||||
export * from './transcoder'
|
||||
export * from './workflows/transcode'
|
||||
export * from './workflows/transcode-watermark'
|
||||
export * from './activities/transcode'
|
||||
export * from './activities/watermark'
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
import type { WorkflowTask } from '@shumai/db'
|
||||
import '@shumai/db/src/prisma-json-types'
|
||||
import { executeActivity, getActivities } from '@shumai/workflow-core'
|
||||
import { ApplicationFailure } from '@temporalio/workflow'
|
||||
import { getWorkerQueueAndStartTask, completeTask, failTask } from './common'
|
||||
|
||||
export async function transcodeWatermarkWorkflow(task: WorkflowTask): Promise<void> {
|
||||
let workerQueue = ''
|
||||
const watermarkConfigId = task.payload?.watermark?.watermarkConfigId
|
||||
const shareLinkId = task.payload?.watermark?.shareLinkId
|
||||
|
||||
if (!watermarkConfigId) {
|
||||
throw ApplicationFailure.create({
|
||||
message: 'watermarkConfigId is required in task payload',
|
||||
nonRetryable: true,
|
||||
})
|
||||
}
|
||||
|
||||
try {
|
||||
workerQueue = await getWorkerQueueAndStartTask(task)
|
||||
|
||||
const {
|
||||
initWatermarkFileActivity,
|
||||
waitForWatermarkFileActivity,
|
||||
transcodeWatermarkMediaActivity,
|
||||
completeWatermarkFileActivity,
|
||||
} = getActivities()
|
||||
|
||||
const initResult = await executeActivity(workerQueue, initWatermarkFileActivity, {
|
||||
assetId: task.assetId,
|
||||
watermarkConfigId,
|
||||
})
|
||||
|
||||
if (initResult.action === 'completed') {
|
||||
if (shareLinkId) {
|
||||
await executeActivity(workerQueue, completeWatermarkFileActivity, {
|
||||
assetId: task.assetId,
|
||||
watermarkConfigId,
|
||||
status: 'completed',
|
||||
shareLinkId,
|
||||
})
|
||||
}
|
||||
await completeTask(workerQueue, task.id)
|
||||
return
|
||||
}
|
||||
|
||||
if (initResult.action === 'failed') {
|
||||
throw ApplicationFailure.create({
|
||||
message: 'Watermark file generation failed in another task',
|
||||
nonRetryable: true,
|
||||
})
|
||||
}
|
||||
|
||||
if (initResult.action === 'processing') {
|
||||
const waitResult = await executeActivity(workerQueue, waitForWatermarkFileActivity, {
|
||||
assetId: task.assetId,
|
||||
watermarkConfigId,
|
||||
})
|
||||
|
||||
if (waitResult.status === 'completed') {
|
||||
if (shareLinkId) {
|
||||
await executeActivity(workerQueue, completeWatermarkFileActivity, {
|
||||
assetId: task.assetId,
|
||||
watermarkConfigId,
|
||||
status: 'completed',
|
||||
shareLinkId,
|
||||
})
|
||||
}
|
||||
await completeTask(workerQueue, task.id)
|
||||
return
|
||||
}
|
||||
|
||||
throw ApplicationFailure.create({
|
||||
message: 'Watermark file generation failed in in-flight task',
|
||||
nonRetryable: true,
|
||||
})
|
||||
}
|
||||
|
||||
const mediaInfo = await executeActivity(workerQueue, transcodeWatermarkMediaActivity, {
|
||||
assetId: task.assetId,
|
||||
watermarkConfigId,
|
||||
})
|
||||
|
||||
await executeActivity(workerQueue, completeWatermarkFileActivity, {
|
||||
assetId: task.assetId,
|
||||
watermarkConfigId,
|
||||
mediaInfo,
|
||||
status: 'completed',
|
||||
shareLinkId,
|
||||
})
|
||||
|
||||
await completeTask(workerQueue, task.id)
|
||||
} catch (err) {
|
||||
if (workerQueue && watermarkConfigId) {
|
||||
const { completeWatermarkFileActivity } = getActivities()
|
||||
try {
|
||||
await executeActivity(workerQueue, completeWatermarkFileActivity, {
|
||||
assetId: task.assetId,
|
||||
watermarkConfigId,
|
||||
status: 'failed',
|
||||
shareLinkId,
|
||||
})
|
||||
} catch (e) {
|
||||
console.error('Failed to update watermark file status to failed:', e)
|
||||
}
|
||||
}
|
||||
await failTask(workerQueue, task.id, err)
|
||||
throw err
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import { transcodePdfWorkflow } from './transcode-pdf'
|
||||
import { renderPdfPagesWorkflow } from './render-pdf-pages'
|
||||
import { takeVideoScreenshotsWorkflow } from './take-video-screenshots'
|
||||
import { overlayImageAnnotationWorkflow } from './overlay-image-annotation'
|
||||
import { transcodeWatermarkWorkflow } from './transcode-watermark'
|
||||
|
||||
/**
|
||||
* @deprecated Legacy monolithic transcode workflow. Prefer using focused workflows:
|
||||
@@ -13,6 +14,9 @@ import { overlayImageAnnotationWorkflow } from './overlay-image-annotation'
|
||||
*/
|
||||
export async function transcodeMedia(task: WorkflowTask): Promise<void> {
|
||||
const payload = task.payload
|
||||
if (payload?.watermark || task.type === 'transcode_watermark') {
|
||||
return transcodeWatermarkWorkflow(task)
|
||||
}
|
||||
if (payload?.pdfPages) {
|
||||
return renderPdfPagesWorkflow(task)
|
||||
}
|
||||
@@ -42,5 +46,6 @@ export * from './transcode-pdf'
|
||||
export * from './render-pdf-pages'
|
||||
export * from './take-video-screenshots'
|
||||
export * from './overlay-image-annotation'
|
||||
export * from './transcode-watermark'
|
||||
export * from './common'
|
||||
export * from './transcode-utils'
|
||||
|
||||
@@ -1,28 +1,8 @@
|
||||
import { ShareLinkInfo, UpdateShareLinkRequest } from '@shumai/dtos'
|
||||
import { type FieldInfo as MetadataFieldInfo } from '@shumai/dtos'
|
||||
import { m } from '@/ui/paraglide/messages.js'
|
||||
import { client } from '@/ui/api/client'
|
||||
import { DateTimePicker } from '@/ui/components/datetime-picker'
|
||||
import { Button } from '@/ui/components/ui/button'
|
||||
import { Input } from '@/ui/components/ui/input'
|
||||
import { Label } from '@/ui/components/ui/label'
|
||||
import { Switch } from '@/ui/components/ui/switch'
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
import {
|
||||
ChevronRight,
|
||||
Copy,
|
||||
ExternalLink,
|
||||
Shield,
|
||||
Palette,
|
||||
ListFilter,
|
||||
SortAsc,
|
||||
LayoutGrid,
|
||||
List,
|
||||
ArrowDownUp,
|
||||
} from 'lucide-react'
|
||||
import React, { useState } from 'react'
|
||||
import { toast } from 'sonner'
|
||||
import { copyToClipboard as copyTextToClipboard } from '@/ui/lib/clipboard'
|
||||
import { DateTimePicker } from '@/ui/components/datetime-picker'
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
@@ -30,6 +10,31 @@ import {
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/ui/components/ui/select'
|
||||
import { Switch } from '@/ui/components/ui/switch'
|
||||
import { WatermarkEditorDialog } from '@/ui/components/watermark-editor-dialog'
|
||||
import { copyToClipboard as copyTextToClipboard } from '@/ui/lib/clipboard'
|
||||
import { m } from '@/ui/paraglide/messages.js'
|
||||
import {
|
||||
ShareLinkInfo,
|
||||
UpdateShareLinkRequest,
|
||||
type FieldInfo as MetadataFieldInfo,
|
||||
} from '@shumai/dtos'
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
import {
|
||||
ArrowDownUp,
|
||||
ChevronRight,
|
||||
Copy,
|
||||
ExternalLink,
|
||||
LayoutGrid,
|
||||
List,
|
||||
ListFilter,
|
||||
Loader2,
|
||||
Palette,
|
||||
Shield,
|
||||
SortAsc,
|
||||
} from 'lucide-react'
|
||||
import React, { useState } from 'react'
|
||||
import { toast } from 'sonner'
|
||||
|
||||
interface ShareSettingsSidebarProps {
|
||||
shareLink: ShareLinkInfo
|
||||
@@ -51,6 +56,7 @@ export function ShareSettingsSidebar({
|
||||
const [expireAt, setExpireAt] = useState<Date | undefined>(
|
||||
shareLink.expireAt ? new Date(shareLink.expireAt) : undefined,
|
||||
)
|
||||
const [isWatermarkEditorOpen, setIsWatermarkEditorOpen] = useState(false)
|
||||
|
||||
React.useEffect(() => {
|
||||
setPassword(shareLink.password || '')
|
||||
@@ -58,6 +64,47 @@ export function ShareSettingsSidebar({
|
||||
const [isPasswordEnabled, setIsPasswordEnabled] = useState(shareLink.hasPassword)
|
||||
const [isExpireEnabled, setIsExpireEnabled] = useState(!!shareLink.expireAt)
|
||||
|
||||
const { data: watermarkInfo, refetch: refetchWatermark } = useQuery({
|
||||
queryKey: ['share-watermark', shareLink.id],
|
||||
queryFn: async () => {
|
||||
const res = await client.api.shares[':shareId'].watermark.$get({
|
||||
param: { shareId: shareLink.id },
|
||||
})
|
||||
if (!res.ok) return null
|
||||
return await res.json()
|
||||
},
|
||||
refetchInterval: (query) => {
|
||||
const status = query.state.data?.watermarkStatus || shareLink.watermarkStatus
|
||||
return status === 'processing' ? 3000 : false
|
||||
},
|
||||
})
|
||||
|
||||
const $updateWatermark = client.api.shares[':shareId'].watermark.$put
|
||||
const { mutate: disableWatermark } = useMutation({
|
||||
mutationFn: async () => {
|
||||
const res = await $updateWatermark({
|
||||
param: { shareId: shareLink.id },
|
||||
json: { enabled: false },
|
||||
})
|
||||
if (!res.ok) throw new Error(m.failed_update())
|
||||
return await res.json()
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['shares', shareLink.projectId] })
|
||||
queryClient.invalidateQueries({ queryKey: ['share', shareLink.id] })
|
||||
queryClient.invalidateQueries({ queryKey: ['share-watermark', shareLink.id] })
|
||||
toast.success(m.watermark_disabled_msg())
|
||||
},
|
||||
})
|
||||
|
||||
const watermarkStatus =
|
||||
watermarkInfo?.watermarkStatus ??
|
||||
shareLink.watermarkStatus ??
|
||||
(shareLink.watermarkConfigId ? 'ready' : 'disabled')
|
||||
const watermarkConfig =
|
||||
watermarkInfo?.watermarkConfig?.config ?? shareLink.watermarkConfig?.config ?? null
|
||||
const isWatermarkEnabled = watermarkConfig !== null && watermarkStatus !== 'disabled'
|
||||
|
||||
const { data: fields } = useQuery({
|
||||
queryKey: ['fields', shareLink.projectId],
|
||||
queryFn: async () => {
|
||||
@@ -193,6 +240,41 @@ export function ShareSettingsSidebar({
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="space-y-2 pt-2 border-t border-border/50">
|
||||
<div className="flex items-center justify-between">
|
||||
<Label className="text-xs">{m.watermark()}</Label>
|
||||
<Switch
|
||||
checked={isWatermarkEnabled}
|
||||
disabled={watermarkStatus === 'processing'}
|
||||
onCheckedChange={(checked) => {
|
||||
if (!checked) {
|
||||
disableWatermark()
|
||||
} else {
|
||||
setIsWatermarkEditorOpen(true)
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{isWatermarkEnabled && watermarkStatus === 'processing' && (
|
||||
<div className="flex items-center gap-2 text-xs text-amber-600 dark:text-amber-400 font-medium py-1 animate-pulse">
|
||||
<Loader2 className="h-3.5 w-3.5 animate-spin" />
|
||||
<span>{m.watermark_transcoding_processing()}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isWatermarkEnabled && watermarkStatus !== 'processing' && (
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="w-full text-xs gap-1.5 mt-1"
|
||||
onClick={() => setIsWatermarkEditorOpen(true)}
|
||||
>
|
||||
{m.edit_watermark()}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</SidebarAccordionItem>
|
||||
<SidebarAccordionItem title={m.appearance()} icon={<Palette className="h-4 w-4" />}>
|
||||
@@ -310,6 +392,18 @@ export function ShareSettingsSidebar({
|
||||
{m.copy_link()}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<WatermarkEditorDialog
|
||||
open={isWatermarkEditorOpen}
|
||||
onOpenChange={setIsWatermarkEditorOpen}
|
||||
initialConfig={watermarkConfig}
|
||||
shareId={shareLink.id}
|
||||
onSaveSuccess={() => {
|
||||
refetchWatermark()
|
||||
queryClient.invalidateQueries({ queryKey: ['share', shareLink.id] })
|
||||
queryClient.invalidateQueries({ queryKey: ['shares', shareLink.projectId] })
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,116 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import {
|
||||
watermarkConfigSpecSchema,
|
||||
watermarkBlockTextSchema,
|
||||
watermarkBlockImageSchema,
|
||||
WatermarkBlock,
|
||||
} from '@shumai/dtos'
|
||||
|
||||
describe('Watermark Config DTO and Logic', () => {
|
||||
it('validates a correct text block', () => {
|
||||
const block = {
|
||||
id: 'block-1',
|
||||
type: 'text',
|
||||
x: 0.5,
|
||||
y: 0.5,
|
||||
opacity: 0.8,
|
||||
rotation: -30,
|
||||
text: 'CONFIDENTIAL',
|
||||
size: 0.05,
|
||||
color: '#FF0000',
|
||||
}
|
||||
const result = watermarkBlockTextSchema.safeParse(block)
|
||||
expect(result.success).toBe(true)
|
||||
})
|
||||
|
||||
it('validates a correct image block', () => {
|
||||
const block = {
|
||||
id: 'block-2',
|
||||
type: 'image',
|
||||
x: 0.2,
|
||||
y: 0.8,
|
||||
opacity: 0.5,
|
||||
rotation: 0,
|
||||
imageAssetKey: 'asset-logo-123',
|
||||
size: 0.15,
|
||||
}
|
||||
const result = watermarkBlockImageSchema.safeParse(block)
|
||||
expect(result.success).toBe(true)
|
||||
})
|
||||
|
||||
it('validates watermarkConfigSpecSchema with mixed text and image blocks', () => {
|
||||
const config = {
|
||||
blocks: [
|
||||
{
|
||||
id: 'block-1',
|
||||
type: 'text' as const,
|
||||
x: 0.5,
|
||||
y: 0.5,
|
||||
opacity: 0.8,
|
||||
rotation: -30,
|
||||
text: 'CONFIDENTIAL',
|
||||
size: 0.05,
|
||||
color: '#FF0000',
|
||||
},
|
||||
{
|
||||
id: 'block-2',
|
||||
type: 'image' as const,
|
||||
x: 0.2,
|
||||
y: 0.8,
|
||||
opacity: 0.5,
|
||||
rotation: 0,
|
||||
imageAssetKey: 'asset-logo-123',
|
||||
size: 0.15,
|
||||
},
|
||||
],
|
||||
}
|
||||
const result = watermarkConfigSpecSchema.safeParse(config)
|
||||
expect(result.success).toBe(true)
|
||||
})
|
||||
|
||||
it('correctly navigates prev/next index in block selector logic', () => {
|
||||
const blocks: WatermarkBlock[] = [
|
||||
{
|
||||
id: 'b1',
|
||||
type: 'text',
|
||||
x: 0.5,
|
||||
y: 0.5,
|
||||
opacity: 0.5,
|
||||
rotation: 0,
|
||||
text: 'B1',
|
||||
size: 0.08,
|
||||
color: '#000000',
|
||||
},
|
||||
{
|
||||
id: 'b2',
|
||||
type: 'text',
|
||||
x: 0.5,
|
||||
y: 0.5,
|
||||
opacity: 0.5,
|
||||
rotation: 0,
|
||||
text: 'B2',
|
||||
size: 0.08,
|
||||
color: '#000000',
|
||||
},
|
||||
{
|
||||
id: 'b3',
|
||||
type: 'text',
|
||||
x: 0.5,
|
||||
y: 0.5,
|
||||
opacity: 0.5,
|
||||
rotation: 0,
|
||||
text: 'B3',
|
||||
size: 0.08,
|
||||
color: '#000000',
|
||||
},
|
||||
]
|
||||
|
||||
const getNextIndex = (current: number, total: number) => (current + 1) % total
|
||||
const getPrevIndex = (current: number, total: number) => (current - 1 + total) % total
|
||||
|
||||
expect(getNextIndex(0, blocks.length)).toBe(1)
|
||||
expect(getNextIndex(2, blocks.length)).toBe(0)
|
||||
expect(getPrevIndex(0, blocks.length)).toBe(2)
|
||||
expect(getPrevIndex(1, blocks.length)).toBe(0)
|
||||
})
|
||||
})
|
||||
@@ -917,5 +917,53 @@
|
||||
"no_audit_logs": "No audit logs found",
|
||||
"search_item_id": "Search Item ID...",
|
||||
"select_actions": "Select Actions",
|
||||
"select_users": "Select Users"
|
||||
"select_users": "Select Users",
|
||||
"watermark": "Watermark",
|
||||
"watermark_enabled": "Enable Watermark",
|
||||
"watermark_transcoding_processing": "Transcoding watermark media...",
|
||||
"edit_watermark": "Edit Watermark",
|
||||
"watermark_editor": "Watermark Editor",
|
||||
"watermark_templates": "Templates",
|
||||
"load_template": "Load Template",
|
||||
"save_as_template": "Save as Template...",
|
||||
"create_new_template": "Create New Template",
|
||||
"overwrite_existing_template": "Overwrite Existing Template",
|
||||
"select_template_to_overwrite": "Select template to overwrite",
|
||||
"delete_template": "Delete Template",
|
||||
"add_text_block": "Add Text Block",
|
||||
"add_image_block": "Add Image Block",
|
||||
"text_content": "Text Content",
|
||||
"font_size": "Font Size",
|
||||
"image_size": "Image Size",
|
||||
"color": "Color",
|
||||
"opacity": "Opacity",
|
||||
"rotation": "Rotation",
|
||||
"position_x": "Position X (%)",
|
||||
"position_y": "Position Y (%)",
|
||||
"image_asset_id": "Image Asset ID",
|
||||
"image_asset_key": "Image Asset",
|
||||
"file_exceeds_1mb_limit": "File size exceeds the 1MB limit",
|
||||
"upload_watermark_image": "Upload Watermark Image",
|
||||
"upload_watermark_image_hint": "Drag and drop, or browse. Max 1MB.",
|
||||
"save_watermark": "Save Watermark",
|
||||
"template_name": "Template Name",
|
||||
"enter_template_name": "Enter template name...",
|
||||
"no_templates_found": "No saved templates",
|
||||
"template_saved": "Template saved successfully",
|
||||
"template_updated": "Template updated successfully",
|
||||
"template_deleted": "Template deleted successfully",
|
||||
"watermark_updated": "Watermark updated successfully",
|
||||
"watermark_disabled_msg": "Watermark disabled",
|
||||
"no_watermark_blocks": "No watermark blocks added yet",
|
||||
"select_block_to_edit": "Select a block to edit its properties",
|
||||
"aspect_ratio": "Aspect Ratio",
|
||||
"aspect_16_9": "16:9 Widescreen",
|
||||
"aspect_9_16": "9:16 Vertical",
|
||||
"aspect_4_3": "4:3 Standard",
|
||||
"aspect_3_4": "3:4 Portrait",
|
||||
"aspect_1_1": "1:1 Square",
|
||||
"preview_backdrop": "Preview Background",
|
||||
"dark_grid": "Dark Grid",
|
||||
"light_grid": "Light Grid",
|
||||
"sample_backdrop": "Sample Media"
|
||||
}
|
||||
|
||||
@@ -917,5 +917,53 @@
|
||||
"no_audit_logs": "未找到审计日志",
|
||||
"search_item_id": "搜索条目 ID...",
|
||||
"select_actions": "选择操作",
|
||||
"select_users": "选择用户"
|
||||
"select_users": "选择用户",
|
||||
"watermark": "水印",
|
||||
"watermark_enabled": "启用水印",
|
||||
"watermark_transcoding_processing": "水印媒体转码处理中...",
|
||||
"edit_watermark": "编辑水印",
|
||||
"watermark_editor": "水印编辑器",
|
||||
"watermark_templates": "水印模板",
|
||||
"load_template": "加载模板",
|
||||
"save_as_template": "保存为模板...",
|
||||
"create_new_template": "创建新模板",
|
||||
"overwrite_existing_template": "覆盖现有模板",
|
||||
"select_template_to_overwrite": "选择要覆盖的模板",
|
||||
"delete_template": "删除模板",
|
||||
"add_text_block": "添加文本块",
|
||||
"add_image_block": "添加图片块",
|
||||
"text_content": "文本内容",
|
||||
"font_size": "字体大小",
|
||||
"image_size": "图片大小",
|
||||
"color": "颜色",
|
||||
"opacity": "透明度",
|
||||
"rotation": "旋转角度",
|
||||
"position_x": "水平位置 (%)",
|
||||
"position_y": "垂直位置 (%)",
|
||||
"image_asset_id": "图片资源 ID",
|
||||
"image_asset_key": "图片资源",
|
||||
"file_exceeds_1mb_limit": "文件大小不能超过 1MB",
|
||||
"upload_watermark_image": "上传水印图片",
|
||||
"upload_watermark_image_hint": "拖放或浏览文件。最大 1MB。",
|
||||
"save_watermark": "保存水印",
|
||||
"template_name": "模板名称",
|
||||
"enter_template_name": "请输入模板名称...",
|
||||
"no_templates_found": "没有保存的模板",
|
||||
"template_saved": "模板保存成功",
|
||||
"template_updated": "模板更新成功",
|
||||
"template_deleted": "模板删除成功",
|
||||
"watermark_updated": "水印更新成功",
|
||||
"watermark_disabled_msg": "水印已禁用",
|
||||
"no_watermark_blocks": "尚未添加水印块",
|
||||
"select_block_to_edit": "选择一个水印块以编辑其属性",
|
||||
"aspect_ratio": "宽高比",
|
||||
"aspect_16_9": "16:9 横屏",
|
||||
"aspect_9_16": "9:16 竖屏",
|
||||
"aspect_4_3": "4:3 标准",
|
||||
"aspect_3_4": "3:4 肖像",
|
||||
"aspect_1_1": "1:1 正方形",
|
||||
"preview_backdrop": "预览背景",
|
||||
"dark_grid": "深色网格",
|
||||
"light_grid": "浅色网格",
|
||||
"sample_backdrop": "示例媒体"
|
||||
}
|
||||
|
||||
+48
@@ -863,4 +863,52 @@ export * from "./no_audit_logs.js";
|
||||
export * from "./search_item_id.js";
|
||||
export * from "./select_actions.js";
|
||||
export * from "./select_users.js";
|
||||
export * from "./watermark.js";
|
||||
export * from "./watermark_enabled.js";
|
||||
export * from "./watermark_transcoding_processing.js";
|
||||
export * from "./edit_watermark.js";
|
||||
export * from "./watermark_editor.js";
|
||||
export * from "./watermark_templates.js";
|
||||
export * from "./load_template.js";
|
||||
export * from "./save_as_template.js";
|
||||
export * from "./create_new_template.js";
|
||||
export * from "./overwrite_existing_template.js";
|
||||
export * from "./select_template_to_overwrite.js";
|
||||
export * from "./delete_template.js";
|
||||
export * from "./add_text_block.js";
|
||||
export * from "./add_image_block.js";
|
||||
export * from "./text_content.js";
|
||||
export * from "./font_size.js";
|
||||
export * from "./image_size.js";
|
||||
export * from "./color.js";
|
||||
export * from "./opacity.js";
|
||||
export * from "./rotation.js";
|
||||
export * from "./position_x.js";
|
||||
export * from "./position_y.js";
|
||||
export * from "./image_asset_id.js";
|
||||
export * from "./image_asset_key.js";
|
||||
export * from "./file_exceeds_1mb_limit.js";
|
||||
export * from "./upload_watermark_image.js";
|
||||
export * from "./upload_watermark_image_hint.js";
|
||||
export * from "./save_watermark.js";
|
||||
export * from "./template_name.js";
|
||||
export * from "./enter_template_name.js";
|
||||
export * from "./no_templates_found.js";
|
||||
export * from "./template_saved.js";
|
||||
export * from "./template_updated.js";
|
||||
export * from "./template_deleted.js";
|
||||
export * from "./watermark_updated.js";
|
||||
export * from "./watermark_disabled_msg.js";
|
||||
export * from "./no_watermark_blocks.js";
|
||||
export * from "./select_block_to_edit.js";
|
||||
export * from "./aspect_ratio.js";
|
||||
export * from "./aspect_16_9.js";
|
||||
export * from "./aspect_9_16.js";
|
||||
export * from "./aspect_4_3.js";
|
||||
export * from "./aspect_3_4.js";
|
||||
export * from "./aspect_1_1.js";
|
||||
export * from "./preview_backdrop.js";
|
||||
export * from "./dark_grid.js";
|
||||
export * from "./light_grid.js";
|
||||
export * from "./sample_backdrop.js";
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
|
||||
+49
-1
@@ -864,4 +864,52 @@ export * from './timestamp.js'
|
||||
export * from './no_audit_logs.js'
|
||||
export * from './search_item_id.js'
|
||||
export * from './select_actions.js'
|
||||
export * from './select_users.js'
|
||||
export * from './select_users.js'
|
||||
export * from './watermark.js'
|
||||
export * from './watermark_enabled.js'
|
||||
export * from './watermark_transcoding_processing.js'
|
||||
export * from './edit_watermark.js'
|
||||
export * from './watermark_editor.js'
|
||||
export * from './watermark_templates.js'
|
||||
export * from './load_template.js'
|
||||
export * from './save_as_template.js'
|
||||
export * from './create_new_template.js'
|
||||
export * from './overwrite_existing_template.js'
|
||||
export * from './select_template_to_overwrite.js'
|
||||
export * from './delete_template.js'
|
||||
export * from './add_text_block.js'
|
||||
export * from './add_image_block.js'
|
||||
export * from './text_content.js'
|
||||
export * from './font_size.js'
|
||||
export * from './image_size.js'
|
||||
export * from './color.js'
|
||||
export * from './opacity.js'
|
||||
export * from './rotation.js'
|
||||
export * from './position_x.js'
|
||||
export * from './position_y.js'
|
||||
export * from './image_asset_id.js'
|
||||
export * from './image_asset_key.js'
|
||||
export * from './file_exceeds_1mb_limit.js'
|
||||
export * from './upload_watermark_image.js'
|
||||
export * from './upload_watermark_image_hint.js'
|
||||
export * from './save_watermark.js'
|
||||
export * from './template_name.js'
|
||||
export * from './enter_template_name.js'
|
||||
export * from './no_templates_found.js'
|
||||
export * from './template_saved.js'
|
||||
export * from './template_updated.js'
|
||||
export * from './template_deleted.js'
|
||||
export * from './watermark_updated.js'
|
||||
export * from './watermark_disabled_msg.js'
|
||||
export * from './no_watermark_blocks.js'
|
||||
export * from './select_block_to_edit.js'
|
||||
export * from './aspect_ratio.js'
|
||||
export * from './aspect_16_9.js'
|
||||
export * from './aspect_9_16.js'
|
||||
export * from './aspect_4_3.js'
|
||||
export * from './aspect_3_4.js'
|
||||
export * from './aspect_1_1.js'
|
||||
export * from './preview_backdrop.js'
|
||||
export * from './dark_grid.js'
|
||||
export * from './light_grid.js'
|
||||
export * from './sample_backdrop.js'
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Add Image Block" |
|
||||
*
|
||||
* @param {Add_Image_BlockInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const add_image_block: ((inputs?: Add_Image_BlockInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Add_Image_BlockInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Add_Image_BlockInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Add_Image_BlockInputs */
|
||||
|
||||
const en_add_image_block = /** @type {(inputs: Add_Image_BlockInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Add Image Block`)
|
||||
};
|
||||
|
||||
const zh_add_image_block = /** @type {(inputs: Add_Image_BlockInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`添加图片块`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Add Image Block" |
|
||||
*
|
||||
* @param {Add_Image_BlockInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const add_image_block = /** @type {((inputs?: Add_Image_BlockInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Add_Image_BlockInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_add_image_block(inputs)
|
||||
return zh_add_image_block(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Add Text Block" |
|
||||
*
|
||||
* @param {Add_Text_BlockInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const add_text_block: ((inputs?: Add_Text_BlockInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Add_Text_BlockInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Add_Text_BlockInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Add_Text_BlockInputs */
|
||||
|
||||
const en_add_text_block = /** @type {(inputs: Add_Text_BlockInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Add Text Block`)
|
||||
};
|
||||
|
||||
const zh_add_text_block = /** @type {(inputs: Add_Text_BlockInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`添加文本块`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Add Text Block" |
|
||||
*
|
||||
* @param {Add_Text_BlockInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const add_text_block = /** @type {((inputs?: Add_Text_BlockInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Add_Text_BlockInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_add_text_block(inputs)
|
||||
return zh_add_text_block(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "16:9 Widescreen" |
|
||||
*
|
||||
* @param {Aspect_16_9Inputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const aspect_16_9: ((inputs?: Aspect_16_9Inputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Aspect_16_9Inputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Aspect_16_9Inputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Aspect_16_9Inputs */
|
||||
|
||||
const en_aspect_16_9 = /** @type {(inputs: Aspect_16_9Inputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`16:9 Widescreen`)
|
||||
};
|
||||
|
||||
const zh_aspect_16_9 = /** @type {(inputs: Aspect_16_9Inputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`16:9 横屏`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "16:9 Widescreen" |
|
||||
*
|
||||
* @param {Aspect_16_9Inputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const aspect_16_9 = /** @type {((inputs?: Aspect_16_9Inputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Aspect_16_9Inputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_aspect_16_9(inputs)
|
||||
return zh_aspect_16_9(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "1:1 Square" |
|
||||
*
|
||||
* @param {Aspect_1_1Inputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const aspect_1_1: ((inputs?: Aspect_1_1Inputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Aspect_1_1Inputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Aspect_1_1Inputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Aspect_1_1Inputs */
|
||||
|
||||
const en_aspect_1_1 = /** @type {(inputs: Aspect_1_1Inputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`1:1 Square`)
|
||||
};
|
||||
|
||||
const zh_aspect_1_1 = /** @type {(inputs: Aspect_1_1Inputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`1:1 正方形`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "1:1 Square" |
|
||||
*
|
||||
* @param {Aspect_1_1Inputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const aspect_1_1 = /** @type {((inputs?: Aspect_1_1Inputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Aspect_1_1Inputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_aspect_1_1(inputs)
|
||||
return zh_aspect_1_1(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "3:4 Portrait" |
|
||||
*
|
||||
* @param {Aspect_3_4Inputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const aspect_3_4: ((inputs?: Aspect_3_4Inputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Aspect_3_4Inputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Aspect_3_4Inputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Aspect_3_4Inputs */
|
||||
|
||||
const en_aspect_3_4 = /** @type {(inputs: Aspect_3_4Inputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`3:4 Portrait`)
|
||||
};
|
||||
|
||||
const zh_aspect_3_4 = /** @type {(inputs: Aspect_3_4Inputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`3:4 肖像`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "3:4 Portrait" |
|
||||
*
|
||||
* @param {Aspect_3_4Inputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const aspect_3_4 = /** @type {((inputs?: Aspect_3_4Inputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Aspect_3_4Inputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_aspect_3_4(inputs)
|
||||
return zh_aspect_3_4(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "4:3 Standard" |
|
||||
*
|
||||
* @param {Aspect_4_3Inputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const aspect_4_3: ((inputs?: Aspect_4_3Inputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Aspect_4_3Inputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Aspect_4_3Inputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Aspect_4_3Inputs */
|
||||
|
||||
const en_aspect_4_3 = /** @type {(inputs: Aspect_4_3Inputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`4:3 Standard`)
|
||||
};
|
||||
|
||||
const zh_aspect_4_3 = /** @type {(inputs: Aspect_4_3Inputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`4:3 标准`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "4:3 Standard" |
|
||||
*
|
||||
* @param {Aspect_4_3Inputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const aspect_4_3 = /** @type {((inputs?: Aspect_4_3Inputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Aspect_4_3Inputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_aspect_4_3(inputs)
|
||||
return zh_aspect_4_3(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "9:16 Vertical" |
|
||||
*
|
||||
* @param {Aspect_9_16Inputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const aspect_9_16: ((inputs?: Aspect_9_16Inputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Aspect_9_16Inputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Aspect_9_16Inputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Aspect_9_16Inputs */
|
||||
|
||||
const en_aspect_9_16 = /** @type {(inputs: Aspect_9_16Inputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`9:16 Vertical`)
|
||||
};
|
||||
|
||||
const zh_aspect_9_16 = /** @type {(inputs: Aspect_9_16Inputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`9:16 竖屏`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "9:16 Vertical" |
|
||||
*
|
||||
* @param {Aspect_9_16Inputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const aspect_9_16 = /** @type {((inputs?: Aspect_9_16Inputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Aspect_9_16Inputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_aspect_9_16(inputs)
|
||||
return zh_aspect_9_16(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Aspect Ratio" |
|
||||
*
|
||||
* @param {Aspect_RatioInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const aspect_ratio: ((inputs?: Aspect_RatioInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Aspect_RatioInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Aspect_RatioInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Aspect_RatioInputs */
|
||||
|
||||
const en_aspect_ratio = /** @type {(inputs: Aspect_RatioInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Aspect Ratio`)
|
||||
};
|
||||
|
||||
const zh_aspect_ratio = /** @type {(inputs: Aspect_RatioInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`宽高比`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Aspect Ratio" |
|
||||
*
|
||||
* @param {Aspect_RatioInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const aspect_ratio = /** @type {((inputs?: Aspect_RatioInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Aspect_RatioInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_aspect_ratio(inputs)
|
||||
return zh_aspect_ratio(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Color" |
|
||||
*
|
||||
* @param {ColorInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const color: ((inputs?: ColorInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<ColorInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type ColorInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} ColorInputs */
|
||||
|
||||
const en_color = /** @type {(inputs: ColorInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Color`)
|
||||
};
|
||||
|
||||
const zh_color = /** @type {(inputs: ColorInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`颜色`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Color" |
|
||||
*
|
||||
* @param {ColorInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const color = /** @type {((inputs?: ColorInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<ColorInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_color(inputs)
|
||||
return zh_color(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Create New Template" |
|
||||
*
|
||||
* @param {Create_New_TemplateInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const create_new_template: ((inputs?: Create_New_TemplateInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Create_New_TemplateInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Create_New_TemplateInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Create_New_TemplateInputs */
|
||||
|
||||
const en_create_new_template = /** @type {(inputs: Create_New_TemplateInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Create New Template`)
|
||||
};
|
||||
|
||||
const zh_create_new_template = /** @type {(inputs: Create_New_TemplateInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`创建新模板`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Create New Template" |
|
||||
*
|
||||
* @param {Create_New_TemplateInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const create_new_template = /** @type {((inputs?: Create_New_TemplateInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Create_New_TemplateInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_create_new_template(inputs)
|
||||
return zh_create_new_template(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Dark Grid" |
|
||||
*
|
||||
* @param {Dark_GridInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const dark_grid: ((inputs?: Dark_GridInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Dark_GridInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Dark_GridInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Dark_GridInputs */
|
||||
|
||||
const en_dark_grid = /** @type {(inputs: Dark_GridInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Dark Grid`)
|
||||
};
|
||||
|
||||
const zh_dark_grid = /** @type {(inputs: Dark_GridInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`深色网格`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Dark Grid" |
|
||||
*
|
||||
* @param {Dark_GridInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const dark_grid = /** @type {((inputs?: Dark_GridInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Dark_GridInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_dark_grid(inputs)
|
||||
return zh_dark_grid(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Delete Template" |
|
||||
*
|
||||
* @param {Delete_TemplateInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const delete_template: ((inputs?: Delete_TemplateInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Delete_TemplateInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Delete_TemplateInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Delete_TemplateInputs */
|
||||
|
||||
const en_delete_template = /** @type {(inputs: Delete_TemplateInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Delete Template`)
|
||||
};
|
||||
|
||||
const zh_delete_template = /** @type {(inputs: Delete_TemplateInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`删除模板`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Delete Template" |
|
||||
*
|
||||
* @param {Delete_TemplateInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const delete_template = /** @type {((inputs?: Delete_TemplateInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Delete_TemplateInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_delete_template(inputs)
|
||||
return zh_delete_template(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Edit Watermark" |
|
||||
*
|
||||
* @param {Edit_WatermarkInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const edit_watermark: ((inputs?: Edit_WatermarkInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Edit_WatermarkInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Edit_WatermarkInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Edit_WatermarkInputs */
|
||||
|
||||
const en_edit_watermark = /** @type {(inputs: Edit_WatermarkInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Edit Watermark`)
|
||||
};
|
||||
|
||||
const zh_edit_watermark = /** @type {(inputs: Edit_WatermarkInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`编辑水印`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Edit Watermark" |
|
||||
*
|
||||
* @param {Edit_WatermarkInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const edit_watermark = /** @type {((inputs?: Edit_WatermarkInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Edit_WatermarkInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_edit_watermark(inputs)
|
||||
return zh_edit_watermark(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Enter template name..." |
|
||||
*
|
||||
* @param {Enter_Template_NameInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const enter_template_name: ((inputs?: Enter_Template_NameInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Enter_Template_NameInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Enter_Template_NameInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Enter_Template_NameInputs */
|
||||
|
||||
const en_enter_template_name = /** @type {(inputs: Enter_Template_NameInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Enter template name...`)
|
||||
};
|
||||
|
||||
const zh_enter_template_name = /** @type {(inputs: Enter_Template_NameInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`请输入模板名称...`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Enter template name..." |
|
||||
*
|
||||
* @param {Enter_Template_NameInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const enter_template_name = /** @type {((inputs?: Enter_Template_NameInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Enter_Template_NameInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_enter_template_name(inputs)
|
||||
return zh_enter_template_name(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "File size exceeds the 1MB limit" |
|
||||
*
|
||||
* @param {File_Exceeds_1mb_LimitInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const file_exceeds_1mb_limit: ((inputs?: File_Exceeds_1mb_LimitInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<File_Exceeds_1mb_LimitInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type File_Exceeds_1mb_LimitInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} File_Exceeds_1mb_LimitInputs */
|
||||
|
||||
const en_file_exceeds_1mb_limit = /** @type {(inputs: File_Exceeds_1mb_LimitInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`File size exceeds the 1MB limit`)
|
||||
};
|
||||
|
||||
const zh_file_exceeds_1mb_limit = /** @type {(inputs: File_Exceeds_1mb_LimitInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`文件大小不能超过 1MB`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "File size exceeds the 1MB limit" |
|
||||
*
|
||||
* @param {File_Exceeds_1mb_LimitInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const file_exceeds_1mb_limit = /** @type {((inputs?: File_Exceeds_1mb_LimitInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<File_Exceeds_1mb_LimitInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_file_exceeds_1mb_limit(inputs)
|
||||
return zh_file_exceeds_1mb_limit(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Font Size" |
|
||||
*
|
||||
* @param {Font_SizeInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const font_size: ((inputs?: Font_SizeInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Font_SizeInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Font_SizeInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Font_SizeInputs */
|
||||
|
||||
const en_font_size = /** @type {(inputs: Font_SizeInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Font Size`)
|
||||
};
|
||||
|
||||
const zh_font_size = /** @type {(inputs: Font_SizeInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`字体大小`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Font Size" |
|
||||
*
|
||||
* @param {Font_SizeInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const font_size = /** @type {((inputs?: Font_SizeInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Font_SizeInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_font_size(inputs)
|
||||
return zh_font_size(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Image Asset ID" |
|
||||
*
|
||||
* @param {Image_Asset_IdInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const image_asset_id: ((inputs?: Image_Asset_IdInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Image_Asset_IdInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Image_Asset_IdInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Image_Asset_IdInputs */
|
||||
|
||||
const en_image_asset_id = /** @type {(inputs: Image_Asset_IdInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Image Asset ID`)
|
||||
};
|
||||
|
||||
const zh_image_asset_id = /** @type {(inputs: Image_Asset_IdInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`图片资源 ID`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Image Asset ID" |
|
||||
*
|
||||
* @param {Image_Asset_IdInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const image_asset_id = /** @type {((inputs?: Image_Asset_IdInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Image_Asset_IdInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_image_asset_id(inputs)
|
||||
return zh_image_asset_id(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Image Asset" |
|
||||
*
|
||||
* @param {Image_Asset_KeyInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const image_asset_key: ((inputs?: Image_Asset_KeyInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Image_Asset_KeyInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Image_Asset_KeyInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Image_Asset_KeyInputs */
|
||||
|
||||
const en_image_asset_key = /** @type {(inputs: Image_Asset_KeyInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Image Asset`)
|
||||
};
|
||||
|
||||
const zh_image_asset_key = /** @type {(inputs: Image_Asset_KeyInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`图片资源`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Image Asset" |
|
||||
*
|
||||
* @param {Image_Asset_KeyInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const image_asset_key = /** @type {((inputs?: Image_Asset_KeyInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Image_Asset_KeyInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_image_asset_key(inputs)
|
||||
return zh_image_asset_key(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Image Size" |
|
||||
*
|
||||
* @param {Image_SizeInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const image_size: ((inputs?: Image_SizeInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Image_SizeInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Image_SizeInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Image_SizeInputs */
|
||||
|
||||
const en_image_size = /** @type {(inputs: Image_SizeInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Image Size`)
|
||||
};
|
||||
|
||||
const zh_image_size = /** @type {(inputs: Image_SizeInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`图片大小`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Image Size" |
|
||||
*
|
||||
* @param {Image_SizeInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const image_size = /** @type {((inputs?: Image_SizeInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Image_SizeInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_image_size(inputs)
|
||||
return zh_image_size(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Light Grid" |
|
||||
*
|
||||
* @param {Light_GridInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const light_grid: ((inputs?: Light_GridInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Light_GridInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Light_GridInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Light_GridInputs */
|
||||
|
||||
const en_light_grid = /** @type {(inputs: Light_GridInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Light Grid`)
|
||||
};
|
||||
|
||||
const zh_light_grid = /** @type {(inputs: Light_GridInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`浅色网格`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Light Grid" |
|
||||
*
|
||||
* @param {Light_GridInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const light_grid = /** @type {((inputs?: Light_GridInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Light_GridInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_light_grid(inputs)
|
||||
return zh_light_grid(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Load Template" |
|
||||
*
|
||||
* @param {Load_TemplateInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const load_template: ((inputs?: Load_TemplateInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Load_TemplateInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Load_TemplateInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Load_TemplateInputs */
|
||||
|
||||
const en_load_template = /** @type {(inputs: Load_TemplateInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Load Template`)
|
||||
};
|
||||
|
||||
const zh_load_template = /** @type {(inputs: Load_TemplateInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`加载模板`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Load Template" |
|
||||
*
|
||||
* @param {Load_TemplateInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const load_template = /** @type {((inputs?: Load_TemplateInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Load_TemplateInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_load_template(inputs)
|
||||
return zh_load_template(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "No saved templates" |
|
||||
*
|
||||
* @param {No_Templates_FoundInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const no_templates_found: ((inputs?: No_Templates_FoundInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<No_Templates_FoundInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type No_Templates_FoundInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} No_Templates_FoundInputs */
|
||||
|
||||
const en_no_templates_found = /** @type {(inputs: No_Templates_FoundInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`No saved templates`)
|
||||
};
|
||||
|
||||
const zh_no_templates_found = /** @type {(inputs: No_Templates_FoundInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`没有保存的模板`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "No saved templates" |
|
||||
*
|
||||
* @param {No_Templates_FoundInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const no_templates_found = /** @type {((inputs?: No_Templates_FoundInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<No_Templates_FoundInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_no_templates_found(inputs)
|
||||
return zh_no_templates_found(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "No watermark blocks added yet" |
|
||||
*
|
||||
* @param {No_Watermark_BlocksInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const no_watermark_blocks: ((inputs?: No_Watermark_BlocksInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<No_Watermark_BlocksInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type No_Watermark_BlocksInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} No_Watermark_BlocksInputs */
|
||||
|
||||
const en_no_watermark_blocks = /** @type {(inputs: No_Watermark_BlocksInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`No watermark blocks added yet`)
|
||||
};
|
||||
|
||||
const zh_no_watermark_blocks = /** @type {(inputs: No_Watermark_BlocksInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`尚未添加水印块`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "No watermark blocks added yet" |
|
||||
*
|
||||
* @param {No_Watermark_BlocksInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const no_watermark_blocks = /** @type {((inputs?: No_Watermark_BlocksInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<No_Watermark_BlocksInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_no_watermark_blocks(inputs)
|
||||
return zh_no_watermark_blocks(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Opacity" |
|
||||
*
|
||||
* @param {OpacityInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const opacity: ((inputs?: OpacityInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<OpacityInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type OpacityInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} OpacityInputs */
|
||||
|
||||
const en_opacity = /** @type {(inputs: OpacityInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Opacity`)
|
||||
};
|
||||
|
||||
const zh_opacity = /** @type {(inputs: OpacityInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`透明度`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Opacity" |
|
||||
*
|
||||
* @param {OpacityInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const opacity = /** @type {((inputs?: OpacityInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<OpacityInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_opacity(inputs)
|
||||
return zh_opacity(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Overwrite Existing Template" |
|
||||
*
|
||||
* @param {Overwrite_Existing_TemplateInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const overwrite_existing_template: ((inputs?: Overwrite_Existing_TemplateInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Overwrite_Existing_TemplateInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Overwrite_Existing_TemplateInputs = {};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user