mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-24 11:36:52 +00:00
Merge pull request #157 from shumaiOne/refactor-video-accurate-seek
feat(video): add frame-accurate video player, SMPTE timecodes, and format switcher
This commit is contained in:
@@ -395,6 +395,8 @@ describe('NotificationService', () => {
|
||||
duration: 10,
|
||||
bitRate: 1000,
|
||||
frameRate: 24,
|
||||
totalFrames: 240,
|
||||
startTimecode: '00:00:00:00',
|
||||
hasAudio: false,
|
||||
format: {},
|
||||
},
|
||||
|
||||
@@ -234,6 +234,7 @@ describe('TranscodeService', () => {
|
||||
originalHeight: 1080,
|
||||
bitRate: 1000,
|
||||
frameRate: 30,
|
||||
totalFrames: 300,
|
||||
hasAudio: true,
|
||||
mimeType: 'video/mp4',
|
||||
})
|
||||
|
||||
@@ -18,6 +18,8 @@ export interface MediaMetadata {
|
||||
duration: number
|
||||
bitRate: number
|
||||
frameRate: number
|
||||
totalFrames: number
|
||||
startTimecode?: string
|
||||
hasAudio: boolean
|
||||
videoCodec?: string
|
||||
audioCodec?: string
|
||||
@@ -90,15 +92,48 @@ export class TranscodeService {
|
||||
throw new Error('No video stream found')
|
||||
}
|
||||
|
||||
const frameRateParts = videoStream.r_frame_rate.split('/')
|
||||
const frameRate = parseFloat(frameRateParts[0]) / parseFloat(frameRateParts[1])
|
||||
let fps = 0
|
||||
if (videoStream.avg_frame_rate) {
|
||||
const parts = videoStream.avg_frame_rate.split('/')
|
||||
if (parts.length === 2) {
|
||||
const num = parseFloat(parts[0])
|
||||
const den = parseFloat(parts[1])
|
||||
if (den > 0) {
|
||||
fps = num / den
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fps === 0 && videoStream.r_frame_rate) {
|
||||
const parts = videoStream.r_frame_rate.split('/')
|
||||
if (parts.length === 2) {
|
||||
const num = parseFloat(parts[0])
|
||||
const den = parseFloat(parts[1])
|
||||
if (den > 0) {
|
||||
fps = num / den
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const duration = parseFloat(info.format.duration)
|
||||
let totalFrames = 0
|
||||
if (videoStream.nb_frames) {
|
||||
totalFrames = parseInt(videoStream.nb_frames, 10)
|
||||
}
|
||||
|
||||
if (!totalFrames && fps > 0 && !isNaN(duration)) {
|
||||
totalFrames = Math.round(duration * fps)
|
||||
}
|
||||
const startTimecode = videoStream.tags?.timecode || info.format?.tags?.timecode
|
||||
|
||||
return {
|
||||
originalWidth: videoStream.width,
|
||||
originalHeight: videoStream.height,
|
||||
duration: parseFloat(info.format.duration),
|
||||
duration,
|
||||
bitRate: parseFloat(info.format.bit_rate),
|
||||
frameRate,
|
||||
frameRate: fps || 30,
|
||||
totalFrames: totalFrames || 0,
|
||||
startTimecode,
|
||||
hasAudio: !!audioStream,
|
||||
videoCodec: this.resolveCodecName(videoStream),
|
||||
audioCodec: audioStream ? this.resolveCodecName(audioStream) : undefined,
|
||||
@@ -128,6 +163,8 @@ export class TranscodeService {
|
||||
duration: 0,
|
||||
bitRate: 0,
|
||||
frameRate: 0,
|
||||
totalFrames: 0,
|
||||
startTimecode: undefined,
|
||||
hasAudio: false,
|
||||
mimeType: metadata.format || '',
|
||||
}
|
||||
@@ -142,11 +179,36 @@ export class TranscodeService {
|
||||
|
||||
const args = ['-i', params.inputFile, '-filter_complex', filterComplex, '-map', '[vout]']
|
||||
|
||||
if (params.frameRate) {
|
||||
let calculatedFps: number
|
||||
if (typeof params.frameRate === 'number') {
|
||||
calculatedFps = params.frameRate
|
||||
} else {
|
||||
const parts = params.frameRate.split('/')
|
||||
if (parts.length === 2) {
|
||||
calculatedFps = parseFloat(parts[0]) / parseFloat(parts[1])
|
||||
} else {
|
||||
calculatedFps = parseFloat(params.frameRate)
|
||||
}
|
||||
}
|
||||
if (Number.isFinite(calculatedFps) && calculatedFps > 0) {
|
||||
const roundedFps = Math.max(1, Math.round(calculatedFps))
|
||||
args.push(
|
||||
'-r',
|
||||
calculatedFps.toString(),
|
||||
'-g',
|
||||
roundedFps.toString(),
|
||||
'-force_key_frames',
|
||||
'expr:gte(t,n_forced*1)',
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (!params.disableAudio) {
|
||||
args.push('-map', '0:a?')
|
||||
}
|
||||
|
||||
args.push('-c:v', 'libx264', '-preset', 'fast', '-crf', '23')
|
||||
args.push('-c:v', 'libx264', '-preset', 'fast', '-crf', '26')
|
||||
|
||||
if (!params.disableAudio) {
|
||||
args.push('-c:a', 'aac', '-b:a', '128k')
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
-- Update assets where media->'metadata' is not null, but 'totalFrames' or 'startTimecode' is missing
|
||||
UPDATE "assets"
|
||||
SET "media" = jsonb_set(
|
||||
"media",
|
||||
'{metadata}',
|
||||
coalesce("media"->'metadata', '{}'::jsonb) || jsonb_build_object(
|
||||
'totalFrames', ROUND(COALESCE(("media"->'metadata'->>'duration')::numeric, ("media"->>'duration')::numeric, 0) * COALESCE(("media"->'metadata'->>'frameRate')::numeric, 30)),
|
||||
'startTimecode', COALESCE("media"->'metadata'->>'startTimecode', '00:00:00:00')
|
||||
)
|
||||
)
|
||||
WHERE "media" IS NOT NULL
|
||||
AND "media"->'metadata' IS NOT NULL
|
||||
AND ("media"->'metadata'->'totalFrames' IS NULL OR "media"->'metadata'->'startTimecode' IS NULL);
|
||||
+38
-37
@@ -1,11 +1,12 @@
|
||||
|
||||
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
|
||||
/* eslint-disable */
|
||||
// biome-ignore-all lint: generated file
|
||||
// @ts-nocheck
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* This file should be your main import to use Prisma-related types and utilities in a browser.
|
||||
* This file should be your main import to use Prisma-related types and utilities in a browser.
|
||||
* Use it to get access to models, enums, and input types.
|
||||
*
|
||||
*
|
||||
* This file does not contain a `PrismaClient` class, nor several other helpers that are intended as server-side only.
|
||||
* See `client.ts` for the standard, server-side entry point.
|
||||
*
|
||||
@@ -15,169 +16,169 @@
|
||||
import * as Prisma from './internal/prismaNamespaceBrowser.ts'
|
||||
export { Prisma }
|
||||
export * as $Enums from './enums.ts'
|
||||
export * from './enums.ts'
|
||||
export * from './enums.ts';
|
||||
/**
|
||||
* Model User
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type User = Prisma.UserModel
|
||||
/**
|
||||
* Model Session
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Session = Prisma.SessionModel
|
||||
/**
|
||||
* Model Account
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Account = Prisma.AccountModel
|
||||
/**
|
||||
* Model Verification
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Verification = Prisma.VerificationModel
|
||||
/**
|
||||
* Model AuthToken
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type AuthToken = Prisma.AuthTokenModel
|
||||
/**
|
||||
* Model Team
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Team = Prisma.TeamModel
|
||||
/**
|
||||
* Model Sandbox
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Sandbox = Prisma.SandboxModel
|
||||
/**
|
||||
* Model Skill
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Skill = Prisma.SkillModel
|
||||
/**
|
||||
* Model TeamMember
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type TeamMember = Prisma.TeamMemberModel
|
||||
/**
|
||||
* Model Project
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Project = Prisma.ProjectModel
|
||||
/**
|
||||
* Model ProjectMember
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type ProjectMember = Prisma.ProjectMemberModel
|
||||
/**
|
||||
* Model ShareLink
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type ShareLink = Prisma.ShareLinkModel
|
||||
/**
|
||||
* Model Asset
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Asset = Prisma.AssetModel
|
||||
/**
|
||||
* Model StorageKey
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type StorageKey = Prisma.StorageKeyModel
|
||||
/**
|
||||
* Model AssetMetadataValue
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type AssetMetadataValue = Prisma.AssetMetadataValueModel
|
||||
/**
|
||||
* Model AssetComment
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type AssetComment = Prisma.AssetCommentModel
|
||||
/**
|
||||
* Model AssetCommentAttachment
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type AssetCommentAttachment = Prisma.AssetCommentAttachmentModel
|
||||
/**
|
||||
* Model AssetEmbedding
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type AssetEmbedding = Prisma.AssetEmbeddingModel
|
||||
/**
|
||||
* Model Invite
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Invite = Prisma.InviteModel
|
||||
/**
|
||||
* Model MetadataField
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type MetadataField = Prisma.MetadataFieldModel
|
||||
/**
|
||||
* Model Notification
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Notification = Prisma.NotificationModel
|
||||
/**
|
||||
* Model SystemSettings
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type SystemSettings = Prisma.SystemSettingsModel
|
||||
/**
|
||||
* Model Task
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Task = Prisma.TaskModel
|
||||
/**
|
||||
* Model WorkflowTask
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type WorkflowTask = Prisma.WorkflowTaskModel
|
||||
/**
|
||||
* Model Agent
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Agent = Prisma.AgentModel
|
||||
/**
|
||||
* Model AgentSkill
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type AgentSkill = Prisma.AgentSkillModel
|
||||
/**
|
||||
* Model AgentSession
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type AgentSession = Prisma.AgentSessionModel
|
||||
/**
|
||||
* Model AgentSessionEntry
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type AgentSessionEntry = Prisma.AgentSessionEntryModel
|
||||
/**
|
||||
* Model UserMetadata
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type UserMetadata = Prisma.UserMetadataModel
|
||||
/**
|
||||
* Model Model
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Model = Prisma.ModelModel
|
||||
/**
|
||||
* Model Provider
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Provider = Prisma.ProviderModel
|
||||
/**
|
||||
* Model Collection
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Collection = Prisma.CollectionModel
|
||||
/**
|
||||
* Model ApiToken
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type ApiToken = Prisma.ApiTokenModel
|
||||
|
||||
+43
-46
@@ -1,7 +1,8 @@
|
||||
|
||||
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
|
||||
/* eslint-disable */
|
||||
// biome-ignore-all lint: generated file
|
||||
// @ts-nocheck
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types.
|
||||
* If you're looking for something you can import in the client-side of your application, please refer to the `browser.ts` file instead.
|
||||
@@ -14,16 +15,16 @@ import * as path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url))
|
||||
|
||||
import * as runtime from '@prisma/client/runtime/client'
|
||||
import * as $Enums from './enums.ts'
|
||||
import * as $Class from './internal/class.ts'
|
||||
import * as Prisma from './internal/prismaNamespace.ts'
|
||||
import * as runtime from "@prisma/client/runtime/client"
|
||||
import * as $Enums from "./enums.ts"
|
||||
import * as $Class from "./internal/class.ts"
|
||||
import * as Prisma from "./internal/prismaNamespace.ts"
|
||||
|
||||
export * as $Enums from './enums.ts'
|
||||
export * from './enums.ts'
|
||||
export * from "./enums.ts"
|
||||
/**
|
||||
* ## Prisma Client
|
||||
*
|
||||
*
|
||||
* Type-safe database client for TypeScript
|
||||
* @example
|
||||
* ```
|
||||
@@ -33,179 +34,175 @@ export * from './enums.ts'
|
||||
* // Fetch zero or more Users
|
||||
* const users = await prisma.user.findMany()
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* Read more in our [docs](https://pris.ly/d/client).
|
||||
*/
|
||||
export const PrismaClient = $Class.getPrismaClientClass()
|
||||
export type PrismaClient<
|
||||
LogOpts extends Prisma.LogLevel = never,
|
||||
OmitOpts extends Prisma.PrismaClientOptions['omit'] = Prisma.PrismaClientOptions['omit'],
|
||||
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs,
|
||||
> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs>
|
||||
export type PrismaClient<LogOpts extends Prisma.LogLevel = never, OmitOpts extends Prisma.PrismaClientOptions["omit"] = Prisma.PrismaClientOptions["omit"], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs>
|
||||
export { Prisma }
|
||||
|
||||
/**
|
||||
* Model User
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type User = Prisma.UserModel
|
||||
/**
|
||||
* Model Session
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Session = Prisma.SessionModel
|
||||
/**
|
||||
* Model Account
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Account = Prisma.AccountModel
|
||||
/**
|
||||
* Model Verification
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Verification = Prisma.VerificationModel
|
||||
/**
|
||||
* Model AuthToken
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type AuthToken = Prisma.AuthTokenModel
|
||||
/**
|
||||
* Model Team
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Team = Prisma.TeamModel
|
||||
/**
|
||||
* Model Sandbox
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Sandbox = Prisma.SandboxModel
|
||||
/**
|
||||
* Model Skill
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Skill = Prisma.SkillModel
|
||||
/**
|
||||
* Model TeamMember
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type TeamMember = Prisma.TeamMemberModel
|
||||
/**
|
||||
* Model Project
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Project = Prisma.ProjectModel
|
||||
/**
|
||||
* Model ProjectMember
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type ProjectMember = Prisma.ProjectMemberModel
|
||||
/**
|
||||
* Model ShareLink
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type ShareLink = Prisma.ShareLinkModel
|
||||
/**
|
||||
* Model Asset
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Asset = Prisma.AssetModel
|
||||
/**
|
||||
* Model StorageKey
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type StorageKey = Prisma.StorageKeyModel
|
||||
/**
|
||||
* Model AssetMetadataValue
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type AssetMetadataValue = Prisma.AssetMetadataValueModel
|
||||
/**
|
||||
* Model AssetComment
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type AssetComment = Prisma.AssetCommentModel
|
||||
/**
|
||||
* Model AssetCommentAttachment
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type AssetCommentAttachment = Prisma.AssetCommentAttachmentModel
|
||||
/**
|
||||
* Model AssetEmbedding
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type AssetEmbedding = Prisma.AssetEmbeddingModel
|
||||
/**
|
||||
* Model Invite
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Invite = Prisma.InviteModel
|
||||
/**
|
||||
* Model MetadataField
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type MetadataField = Prisma.MetadataFieldModel
|
||||
/**
|
||||
* Model Notification
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Notification = Prisma.NotificationModel
|
||||
/**
|
||||
* Model SystemSettings
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type SystemSettings = Prisma.SystemSettingsModel
|
||||
/**
|
||||
* Model Task
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Task = Prisma.TaskModel
|
||||
/**
|
||||
* Model WorkflowTask
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type WorkflowTask = Prisma.WorkflowTaskModel
|
||||
/**
|
||||
* Model Agent
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Agent = Prisma.AgentModel
|
||||
/**
|
||||
* Model AgentSkill
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type AgentSkill = Prisma.AgentSkillModel
|
||||
/**
|
||||
* Model AgentSession
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type AgentSession = Prisma.AgentSessionModel
|
||||
/**
|
||||
* Model AgentSessionEntry
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type AgentSessionEntry = Prisma.AgentSessionEntryModel
|
||||
/**
|
||||
* Model UserMetadata
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type UserMetadata = Prisma.UserMetadataModel
|
||||
/**
|
||||
* Model Model
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Model = Prisma.ModelModel
|
||||
/**
|
||||
* Model Provider
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Provider = Prisma.ProviderModel
|
||||
/**
|
||||
* Model Collection
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type Collection = Prisma.CollectionModel
|
||||
/**
|
||||
* Model ApiToken
|
||||
*
|
||||
*
|
||||
*/
|
||||
export type ApiToken = Prisma.ApiTokenModel
|
||||
|
||||
+98
-288
@@ -1,16 +1,18 @@
|
||||
|
||||
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
|
||||
/* eslint-disable */
|
||||
// biome-ignore-all lint: generated file
|
||||
// @ts-nocheck
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* This file exports various common sort, input & filter types that are not directly linked to a particular model.
|
||||
*
|
||||
* 🟢 You can import this file directly.
|
||||
*/
|
||||
|
||||
import type * as runtime from '@prisma/client/runtime/client'
|
||||
import * as $Enums from './enums.ts'
|
||||
import type * as Prisma from './internal/prismaNamespace.ts'
|
||||
import type * as runtime from "@prisma/client/runtime/client"
|
||||
import * as $Enums from "./enums.ts"
|
||||
import type * as Prisma from "./internal/prismaNamespace.ts"
|
||||
|
||||
|
||||
export type StringFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
@@ -55,20 +57,14 @@ export type StringNullableFilter<$PrismaModel = never> = {
|
||||
}
|
||||
|
||||
export type JsonNullableFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<
|
||||
Required<JsonNullableFilterBase<$PrismaModel>>,
|
||||
Exclude<keyof Required<JsonNullableFilterBase<$PrismaModel>>, 'path'>
|
||||
>,
|
||||
Required<JsonNullableFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<JsonNullableFilterBase<$PrismaModel>>, 'path'>>
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<JsonNullableFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonNullableFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<JsonNullableFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<JsonNullableFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type JsonNullableFilterBase<$PrismaModel = never> = {
|
||||
equals?:
|
||||
| runtime.InputJsonValue
|
||||
| Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
| Prisma.JsonNullValueFilter
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string[]
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
@@ -155,20 +151,14 @@ export type StringNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
}
|
||||
|
||||
export type JsonNullableWithAggregatesFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<
|
||||
Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>,
|
||||
Exclude<keyof Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, 'path'>
|
||||
>,
|
||||
Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, 'path'>>
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type JsonNullableWithAggregatesFilterBase<$PrismaModel = never> = {
|
||||
equals?:
|
||||
| runtime.InputJsonValue
|
||||
| Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
| Prisma.JsonNullValueFilter
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string[]
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
@@ -271,9 +261,7 @@ export type EnumProjectMemberRoleWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.ProjectMemberRole | Prisma.EnumProjectMemberRoleFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.ProjectMemberRole[] | Prisma.ListEnumProjectMemberRoleFieldRefInput<$PrismaModel>
|
||||
notIn?: $Enums.ProjectMemberRole[] | Prisma.ListEnumProjectMemberRoleFieldRefInput<$PrismaModel>
|
||||
not?:
|
||||
| Prisma.NestedEnumProjectMemberRoleWithAggregatesFilter<$PrismaModel>
|
||||
| $Enums.ProjectMemberRole
|
||||
not?: Prisma.NestedEnumProjectMemberRoleWithAggregatesFilter<$PrismaModel> | $Enums.ProjectMemberRole
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumProjectMemberRoleFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumProjectMemberRoleFilter<$PrismaModel>
|
||||
@@ -351,9 +339,7 @@ export type EnumStorageKeyStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.StorageKeyStatus | Prisma.EnumStorageKeyStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.StorageKeyStatus[] | Prisma.ListEnumStorageKeyStatusFieldRefInput<$PrismaModel>
|
||||
notIn?: $Enums.StorageKeyStatus[] | Prisma.ListEnumStorageKeyStatusFieldRefInput<$PrismaModel>
|
||||
not?:
|
||||
| Prisma.NestedEnumStorageKeyStatusWithAggregatesFilter<$PrismaModel>
|
||||
| $Enums.StorageKeyStatus
|
||||
not?: Prisma.NestedEnumStorageKeyStatusWithAggregatesFilter<$PrismaModel> | $Enums.StorageKeyStatus
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumStorageKeyStatusFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumStorageKeyStatusFilter<$PrismaModel>
|
||||
@@ -410,51 +396,24 @@ export type EnumInviteRoleNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.InviteRole | Prisma.EnumInviteRoleFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.InviteRole[] | Prisma.ListEnumInviteRoleFieldRefInput<$PrismaModel> | null
|
||||
notIn?: $Enums.InviteRole[] | Prisma.ListEnumInviteRoleFieldRefInput<$PrismaModel> | null
|
||||
not?:
|
||||
| Prisma.NestedEnumInviteRoleNullableWithAggregatesFilter<$PrismaModel>
|
||||
| $Enums.InviteRole
|
||||
| null
|
||||
not?: Prisma.NestedEnumInviteRoleNullableWithAggregatesFilter<$PrismaModel> | $Enums.InviteRole | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumInviteRoleNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumInviteRoleNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumMetadataFieldScopeNullableFilter<$PrismaModel = never> = {
|
||||
equals?:
|
||||
| $Enums.MetadataFieldScope
|
||||
| Prisma.EnumMetadataFieldScopeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
in?:
|
||||
| $Enums.MetadataFieldScope[]
|
||||
| Prisma.ListEnumMetadataFieldScopeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
notIn?:
|
||||
| $Enums.MetadataFieldScope[]
|
||||
| Prisma.ListEnumMetadataFieldScopeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
not?:
|
||||
| Prisma.NestedEnumMetadataFieldScopeNullableFilter<$PrismaModel>
|
||||
| $Enums.MetadataFieldScope
|
||||
| null
|
||||
equals?: $Enums.MetadataFieldScope | Prisma.EnumMetadataFieldScopeFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.MetadataFieldScope[] | Prisma.ListEnumMetadataFieldScopeFieldRefInput<$PrismaModel> | null
|
||||
notIn?: $Enums.MetadataFieldScope[] | Prisma.ListEnumMetadataFieldScopeFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedEnumMetadataFieldScopeNullableFilter<$PrismaModel> | $Enums.MetadataFieldScope | null
|
||||
}
|
||||
|
||||
export type EnumMetadataFieldScopeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?:
|
||||
| $Enums.MetadataFieldScope
|
||||
| Prisma.EnumMetadataFieldScopeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
in?:
|
||||
| $Enums.MetadataFieldScope[]
|
||||
| Prisma.ListEnumMetadataFieldScopeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
notIn?:
|
||||
| $Enums.MetadataFieldScope[]
|
||||
| Prisma.ListEnumMetadataFieldScopeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
not?:
|
||||
| Prisma.NestedEnumMetadataFieldScopeNullableWithAggregatesFilter<$PrismaModel>
|
||||
| $Enums.MetadataFieldScope
|
||||
| null
|
||||
equals?: $Enums.MetadataFieldScope | Prisma.EnumMetadataFieldScopeFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.MetadataFieldScope[] | Prisma.ListEnumMetadataFieldScopeFieldRefInput<$PrismaModel> | null
|
||||
notIn?: $Enums.MetadataFieldScope[] | Prisma.ListEnumMetadataFieldScopeFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedEnumMetadataFieldScopeNullableWithAggregatesFilter<$PrismaModel> | $Enums.MetadataFieldScope | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumMetadataFieldScopeNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumMetadataFieldScopeNullableFilter<$PrismaModel>
|
||||
@@ -463,27 +422,15 @@ export type EnumMetadataFieldScopeNullableWithAggregatesFilter<$PrismaModel = ne
|
||||
export type EnumNotificationTypeNullableFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.NotificationType | Prisma.EnumNotificationTypeFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.NotificationType[] | Prisma.ListEnumNotificationTypeFieldRefInput<$PrismaModel> | null
|
||||
notIn?:
|
||||
| $Enums.NotificationType[]
|
||||
| Prisma.ListEnumNotificationTypeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
not?:
|
||||
| Prisma.NestedEnumNotificationTypeNullableFilter<$PrismaModel>
|
||||
| $Enums.NotificationType
|
||||
| null
|
||||
notIn?: $Enums.NotificationType[] | Prisma.ListEnumNotificationTypeFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedEnumNotificationTypeNullableFilter<$PrismaModel> | $Enums.NotificationType | null
|
||||
}
|
||||
|
||||
export type EnumNotificationTypeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.NotificationType | Prisma.EnumNotificationTypeFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.NotificationType[] | Prisma.ListEnumNotificationTypeFieldRefInput<$PrismaModel> | null
|
||||
notIn?:
|
||||
| $Enums.NotificationType[]
|
||||
| Prisma.ListEnumNotificationTypeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
not?:
|
||||
| Prisma.NestedEnumNotificationTypeNullableWithAggregatesFilter<$PrismaModel>
|
||||
| $Enums.NotificationType
|
||||
| null
|
||||
notIn?: $Enums.NotificationType[] | Prisma.ListEnumNotificationTypeFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedEnumNotificationTypeNullableWithAggregatesFilter<$PrismaModel> | $Enums.NotificationType | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumNotificationTypeNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumNotificationTypeNullableFilter<$PrismaModel>
|
||||
@@ -565,33 +512,15 @@ export type UuidFilter<$PrismaModel = never> = {
|
||||
export type EnumWorkflowTaskTypeNullableFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.WorkflowTaskType | Prisma.EnumWorkflowTaskTypeFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.WorkflowTaskType[] | Prisma.ListEnumWorkflowTaskTypeFieldRefInput<$PrismaModel> | null
|
||||
notIn?:
|
||||
| $Enums.WorkflowTaskType[]
|
||||
| Prisma.ListEnumWorkflowTaskTypeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
not?:
|
||||
| Prisma.NestedEnumWorkflowTaskTypeNullableFilter<$PrismaModel>
|
||||
| $Enums.WorkflowTaskType
|
||||
| null
|
||||
notIn?: $Enums.WorkflowTaskType[] | Prisma.ListEnumWorkflowTaskTypeFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedEnumWorkflowTaskTypeNullableFilter<$PrismaModel> | $Enums.WorkflowTaskType | null
|
||||
}
|
||||
|
||||
export type EnumWorkflowTaskStatusNullableFilter<$PrismaModel = never> = {
|
||||
equals?:
|
||||
| $Enums.WorkflowTaskStatus
|
||||
| Prisma.EnumWorkflowTaskStatusFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
in?:
|
||||
| $Enums.WorkflowTaskStatus[]
|
||||
| Prisma.ListEnumWorkflowTaskStatusFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
notIn?:
|
||||
| $Enums.WorkflowTaskStatus[]
|
||||
| Prisma.ListEnumWorkflowTaskStatusFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
not?:
|
||||
| Prisma.NestedEnumWorkflowTaskStatusNullableFilter<$PrismaModel>
|
||||
| $Enums.WorkflowTaskStatus
|
||||
| null
|
||||
equals?: $Enums.WorkflowTaskStatus | Prisma.EnumWorkflowTaskStatusFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.WorkflowTaskStatus[] | Prisma.ListEnumWorkflowTaskStatusFieldRefInput<$PrismaModel> | null
|
||||
notIn?: $Enums.WorkflowTaskStatus[] | Prisma.ListEnumWorkflowTaskStatusFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedEnumWorkflowTaskStatusNullableFilter<$PrismaModel> | $Enums.WorkflowTaskStatus | null
|
||||
}
|
||||
|
||||
export type UuidWithAggregatesFilter<$PrismaModel = never> = {
|
||||
@@ -612,36 +541,18 @@ export type UuidWithAggregatesFilter<$PrismaModel = never> = {
|
||||
export type EnumWorkflowTaskTypeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.WorkflowTaskType | Prisma.EnumWorkflowTaskTypeFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.WorkflowTaskType[] | Prisma.ListEnumWorkflowTaskTypeFieldRefInput<$PrismaModel> | null
|
||||
notIn?:
|
||||
| $Enums.WorkflowTaskType[]
|
||||
| Prisma.ListEnumWorkflowTaskTypeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
not?:
|
||||
| Prisma.NestedEnumWorkflowTaskTypeNullableWithAggregatesFilter<$PrismaModel>
|
||||
| $Enums.WorkflowTaskType
|
||||
| null
|
||||
notIn?: $Enums.WorkflowTaskType[] | Prisma.ListEnumWorkflowTaskTypeFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedEnumWorkflowTaskTypeNullableWithAggregatesFilter<$PrismaModel> | $Enums.WorkflowTaskType | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumWorkflowTaskTypeNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumWorkflowTaskTypeNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumWorkflowTaskStatusNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?:
|
||||
| $Enums.WorkflowTaskStatus
|
||||
| Prisma.EnumWorkflowTaskStatusFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
in?:
|
||||
| $Enums.WorkflowTaskStatus[]
|
||||
| Prisma.ListEnumWorkflowTaskStatusFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
notIn?:
|
||||
| $Enums.WorkflowTaskStatus[]
|
||||
| Prisma.ListEnumWorkflowTaskStatusFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
not?:
|
||||
| Prisma.NestedEnumWorkflowTaskStatusNullableWithAggregatesFilter<$PrismaModel>
|
||||
| $Enums.WorkflowTaskStatus
|
||||
| null
|
||||
equals?: $Enums.WorkflowTaskStatus | Prisma.EnumWorkflowTaskStatusFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.WorkflowTaskStatus[] | Prisma.ListEnumWorkflowTaskStatusFieldRefInput<$PrismaModel> | null
|
||||
notIn?: $Enums.WorkflowTaskStatus[] | Prisma.ListEnumWorkflowTaskStatusFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedEnumWorkflowTaskStatusNullableWithAggregatesFilter<$PrismaModel> | $Enums.WorkflowTaskStatus | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumWorkflowTaskStatusNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumWorkflowTaskStatusNullableFilter<$PrismaModel>
|
||||
@@ -655,20 +566,14 @@ export type EnumAgentTypeFilter<$PrismaModel = never> = {
|
||||
}
|
||||
|
||||
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'>>
|
||||
| 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
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string[]
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
@@ -695,20 +600,14 @@ export type EnumAgentTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
}
|
||||
|
||||
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'>>
|
||||
| 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
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string[]
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
@@ -853,20 +752,14 @@ export type NestedIntNullableFilter<$PrismaModel = never> = {
|
||||
}
|
||||
|
||||
export type NestedJsonNullableFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<
|
||||
Required<NestedJsonNullableFilterBase<$PrismaModel>>,
|
||||
Exclude<keyof Required<NestedJsonNullableFilterBase<$PrismaModel>>, 'path'>
|
||||
>,
|
||||
Required<NestedJsonNullableFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<NestedJsonNullableFilterBase<$PrismaModel>>, 'path'>>
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<NestedJsonNullableFilterBase<$PrismaModel>>, Exclude<keyof Required<NestedJsonNullableFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<NestedJsonNullableFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<NestedJsonNullableFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type NestedJsonNullableFilterBase<$PrismaModel = never> = {
|
||||
equals?:
|
||||
| runtime.InputJsonValue
|
||||
| Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
| Prisma.JsonNullValueFilter
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string[]
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
@@ -966,9 +859,7 @@ export type NestedEnumProjectMemberRoleWithAggregatesFilter<$PrismaModel = never
|
||||
equals?: $Enums.ProjectMemberRole | Prisma.EnumProjectMemberRoleFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.ProjectMemberRole[] | Prisma.ListEnumProjectMemberRoleFieldRefInput<$PrismaModel>
|
||||
notIn?: $Enums.ProjectMemberRole[] | Prisma.ListEnumProjectMemberRoleFieldRefInput<$PrismaModel>
|
||||
not?:
|
||||
| Prisma.NestedEnumProjectMemberRoleWithAggregatesFilter<$PrismaModel>
|
||||
| $Enums.ProjectMemberRole
|
||||
not?: Prisma.NestedEnumProjectMemberRoleWithAggregatesFilter<$PrismaModel> | $Enums.ProjectMemberRole
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumProjectMemberRoleFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumProjectMemberRoleFilter<$PrismaModel>
|
||||
@@ -1046,9 +937,7 @@ export type NestedEnumStorageKeyStatusWithAggregatesFilter<$PrismaModel = never>
|
||||
equals?: $Enums.StorageKeyStatus | Prisma.EnumStorageKeyStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.StorageKeyStatus[] | Prisma.ListEnumStorageKeyStatusFieldRefInput<$PrismaModel>
|
||||
notIn?: $Enums.StorageKeyStatus[] | Prisma.ListEnumStorageKeyStatusFieldRefInput<$PrismaModel>
|
||||
not?:
|
||||
| Prisma.NestedEnumStorageKeyStatusWithAggregatesFilter<$PrismaModel>
|
||||
| $Enums.StorageKeyStatus
|
||||
not?: Prisma.NestedEnumStorageKeyStatusWithAggregatesFilter<$PrismaModel> | $Enums.StorageKeyStatus
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumStorageKeyStatusFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumStorageKeyStatusFilter<$PrismaModel>
|
||||
@@ -1105,51 +994,24 @@ export type NestedEnumInviteRoleNullableWithAggregatesFilter<$PrismaModel = neve
|
||||
equals?: $Enums.InviteRole | Prisma.EnumInviteRoleFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.InviteRole[] | Prisma.ListEnumInviteRoleFieldRefInput<$PrismaModel> | null
|
||||
notIn?: $Enums.InviteRole[] | Prisma.ListEnumInviteRoleFieldRefInput<$PrismaModel> | null
|
||||
not?:
|
||||
| Prisma.NestedEnumInviteRoleNullableWithAggregatesFilter<$PrismaModel>
|
||||
| $Enums.InviteRole
|
||||
| null
|
||||
not?: Prisma.NestedEnumInviteRoleNullableWithAggregatesFilter<$PrismaModel> | $Enums.InviteRole | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumInviteRoleNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumInviteRoleNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumMetadataFieldScopeNullableFilter<$PrismaModel = never> = {
|
||||
equals?:
|
||||
| $Enums.MetadataFieldScope
|
||||
| Prisma.EnumMetadataFieldScopeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
in?:
|
||||
| $Enums.MetadataFieldScope[]
|
||||
| Prisma.ListEnumMetadataFieldScopeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
notIn?:
|
||||
| $Enums.MetadataFieldScope[]
|
||||
| Prisma.ListEnumMetadataFieldScopeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
not?:
|
||||
| Prisma.NestedEnumMetadataFieldScopeNullableFilter<$PrismaModel>
|
||||
| $Enums.MetadataFieldScope
|
||||
| null
|
||||
equals?: $Enums.MetadataFieldScope | Prisma.EnumMetadataFieldScopeFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.MetadataFieldScope[] | Prisma.ListEnumMetadataFieldScopeFieldRefInput<$PrismaModel> | null
|
||||
notIn?: $Enums.MetadataFieldScope[] | Prisma.ListEnumMetadataFieldScopeFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedEnumMetadataFieldScopeNullableFilter<$PrismaModel> | $Enums.MetadataFieldScope | null
|
||||
}
|
||||
|
||||
export type NestedEnumMetadataFieldScopeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?:
|
||||
| $Enums.MetadataFieldScope
|
||||
| Prisma.EnumMetadataFieldScopeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
in?:
|
||||
| $Enums.MetadataFieldScope[]
|
||||
| Prisma.ListEnumMetadataFieldScopeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
notIn?:
|
||||
| $Enums.MetadataFieldScope[]
|
||||
| Prisma.ListEnumMetadataFieldScopeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
not?:
|
||||
| Prisma.NestedEnumMetadataFieldScopeNullableWithAggregatesFilter<$PrismaModel>
|
||||
| $Enums.MetadataFieldScope
|
||||
| null
|
||||
equals?: $Enums.MetadataFieldScope | Prisma.EnumMetadataFieldScopeFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.MetadataFieldScope[] | Prisma.ListEnumMetadataFieldScopeFieldRefInput<$PrismaModel> | null
|
||||
notIn?: $Enums.MetadataFieldScope[] | Prisma.ListEnumMetadataFieldScopeFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedEnumMetadataFieldScopeNullableWithAggregatesFilter<$PrismaModel> | $Enums.MetadataFieldScope | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumMetadataFieldScopeNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumMetadataFieldScopeNullableFilter<$PrismaModel>
|
||||
@@ -1158,27 +1020,15 @@ export type NestedEnumMetadataFieldScopeNullableWithAggregatesFilter<$PrismaMode
|
||||
export type NestedEnumNotificationTypeNullableFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.NotificationType | Prisma.EnumNotificationTypeFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.NotificationType[] | Prisma.ListEnumNotificationTypeFieldRefInput<$PrismaModel> | null
|
||||
notIn?:
|
||||
| $Enums.NotificationType[]
|
||||
| Prisma.ListEnumNotificationTypeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
not?:
|
||||
| Prisma.NestedEnumNotificationTypeNullableFilter<$PrismaModel>
|
||||
| $Enums.NotificationType
|
||||
| null
|
||||
notIn?: $Enums.NotificationType[] | Prisma.ListEnumNotificationTypeFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedEnumNotificationTypeNullableFilter<$PrismaModel> | $Enums.NotificationType | null
|
||||
}
|
||||
|
||||
export type NestedEnumNotificationTypeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.NotificationType | Prisma.EnumNotificationTypeFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.NotificationType[] | Prisma.ListEnumNotificationTypeFieldRefInput<$PrismaModel> | null
|
||||
notIn?:
|
||||
| $Enums.NotificationType[]
|
||||
| Prisma.ListEnumNotificationTypeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
not?:
|
||||
| Prisma.NestedEnumNotificationTypeNullableWithAggregatesFilter<$PrismaModel>
|
||||
| $Enums.NotificationType
|
||||
| null
|
||||
notIn?: $Enums.NotificationType[] | Prisma.ListEnumNotificationTypeFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedEnumNotificationTypeNullableWithAggregatesFilter<$PrismaModel> | $Enums.NotificationType | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumNotificationTypeNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumNotificationTypeNullableFilter<$PrismaModel>
|
||||
@@ -1248,33 +1098,15 @@ export type NestedUuidFilter<$PrismaModel = never> = {
|
||||
export type NestedEnumWorkflowTaskTypeNullableFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.WorkflowTaskType | Prisma.EnumWorkflowTaskTypeFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.WorkflowTaskType[] | Prisma.ListEnumWorkflowTaskTypeFieldRefInput<$PrismaModel> | null
|
||||
notIn?:
|
||||
| $Enums.WorkflowTaskType[]
|
||||
| Prisma.ListEnumWorkflowTaskTypeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
not?:
|
||||
| Prisma.NestedEnumWorkflowTaskTypeNullableFilter<$PrismaModel>
|
||||
| $Enums.WorkflowTaskType
|
||||
| null
|
||||
notIn?: $Enums.WorkflowTaskType[] | Prisma.ListEnumWorkflowTaskTypeFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedEnumWorkflowTaskTypeNullableFilter<$PrismaModel> | $Enums.WorkflowTaskType | null
|
||||
}
|
||||
|
||||
export type NestedEnumWorkflowTaskStatusNullableFilter<$PrismaModel = never> = {
|
||||
equals?:
|
||||
| $Enums.WorkflowTaskStatus
|
||||
| Prisma.EnumWorkflowTaskStatusFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
in?:
|
||||
| $Enums.WorkflowTaskStatus[]
|
||||
| Prisma.ListEnumWorkflowTaskStatusFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
notIn?:
|
||||
| $Enums.WorkflowTaskStatus[]
|
||||
| Prisma.ListEnumWorkflowTaskStatusFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
not?:
|
||||
| Prisma.NestedEnumWorkflowTaskStatusNullableFilter<$PrismaModel>
|
||||
| $Enums.WorkflowTaskStatus
|
||||
| null
|
||||
equals?: $Enums.WorkflowTaskStatus | Prisma.EnumWorkflowTaskStatusFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.WorkflowTaskStatus[] | Prisma.ListEnumWorkflowTaskStatusFieldRefInput<$PrismaModel> | null
|
||||
notIn?: $Enums.WorkflowTaskStatus[] | Prisma.ListEnumWorkflowTaskStatusFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedEnumWorkflowTaskStatusNullableFilter<$PrismaModel> | $Enums.WorkflowTaskStatus | null
|
||||
}
|
||||
|
||||
export type NestedUuidWithAggregatesFilter<$PrismaModel = never> = {
|
||||
@@ -1294,36 +1126,18 @@ export type NestedUuidWithAggregatesFilter<$PrismaModel = never> = {
|
||||
export type NestedEnumWorkflowTaskTypeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.WorkflowTaskType | Prisma.EnumWorkflowTaskTypeFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.WorkflowTaskType[] | Prisma.ListEnumWorkflowTaskTypeFieldRefInput<$PrismaModel> | null
|
||||
notIn?:
|
||||
| $Enums.WorkflowTaskType[]
|
||||
| Prisma.ListEnumWorkflowTaskTypeFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
not?:
|
||||
| Prisma.NestedEnumWorkflowTaskTypeNullableWithAggregatesFilter<$PrismaModel>
|
||||
| $Enums.WorkflowTaskType
|
||||
| null
|
||||
notIn?: $Enums.WorkflowTaskType[] | Prisma.ListEnumWorkflowTaskTypeFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedEnumWorkflowTaskTypeNullableWithAggregatesFilter<$PrismaModel> | $Enums.WorkflowTaskType | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumWorkflowTaskTypeNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumWorkflowTaskTypeNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumWorkflowTaskStatusNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?:
|
||||
| $Enums.WorkflowTaskStatus
|
||||
| Prisma.EnumWorkflowTaskStatusFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
in?:
|
||||
| $Enums.WorkflowTaskStatus[]
|
||||
| Prisma.ListEnumWorkflowTaskStatusFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
notIn?:
|
||||
| $Enums.WorkflowTaskStatus[]
|
||||
| Prisma.ListEnumWorkflowTaskStatusFieldRefInput<$PrismaModel>
|
||||
| null
|
||||
not?:
|
||||
| Prisma.NestedEnumWorkflowTaskStatusNullableWithAggregatesFilter<$PrismaModel>
|
||||
| $Enums.WorkflowTaskStatus
|
||||
| null
|
||||
equals?: $Enums.WorkflowTaskStatus | Prisma.EnumWorkflowTaskStatusFieldRefInput<$PrismaModel> | null
|
||||
in?: $Enums.WorkflowTaskStatus[] | Prisma.ListEnumWorkflowTaskStatusFieldRefInput<$PrismaModel> | null
|
||||
notIn?: $Enums.WorkflowTaskStatus[] | Prisma.ListEnumWorkflowTaskStatusFieldRefInput<$PrismaModel> | null
|
||||
not?: Prisma.NestedEnumWorkflowTaskStatusNullableWithAggregatesFilter<$PrismaModel> | $Enums.WorkflowTaskStatus | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumWorkflowTaskStatusNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumWorkflowTaskStatusNullableFilter<$PrismaModel>
|
||||
@@ -1347,20 +1161,14 @@ export type NestedEnumAgentTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
}
|
||||
|
||||
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'>>
|
||||
| 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
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string[]
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
@@ -1375,3 +1183,5 @@ export type NestedJsonFilterBase<$PrismaModel = never> = {
|
||||
gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
}
|
||||
|
||||
|
||||
|
||||
+35
-20
@@ -1,20 +1,22 @@
|
||||
|
||||
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
|
||||
/* eslint-disable */
|
||||
// biome-ignore-all lint: generated file
|
||||
// @ts-nocheck
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* This file exports all enum related types from the schema.
|
||||
*
|
||||
* 🟢 You can import this file directly.
|
||||
*/
|
||||
* This file exports all enum related types from the schema.
|
||||
*
|
||||
* 🟢 You can import this file directly.
|
||||
*/
|
||||
|
||||
export const UserType = {
|
||||
human: 'human',
|
||||
agent: 'agent',
|
||||
agent: 'agent'
|
||||
} as const
|
||||
|
||||
export type UserType = (typeof UserType)[keyof typeof UserType]
|
||||
|
||||
|
||||
export const AssetType = {
|
||||
folder: 'folder',
|
||||
file: 'file',
|
||||
@@ -23,44 +25,49 @@ export const AssetType = {
|
||||
attachment: 'attachment',
|
||||
version_stack: 'version_stack',
|
||||
share_root: 'share_root',
|
||||
symlink: 'symlink',
|
||||
symlink: 'symlink'
|
||||
} as const
|
||||
|
||||
export type AssetType = (typeof AssetType)[keyof typeof AssetType]
|
||||
|
||||
|
||||
export const AssetStatus = {
|
||||
uploading: 'uploading',
|
||||
uploaded: 'uploaded',
|
||||
processing: 'processing',
|
||||
processed: 'processed',
|
||||
trashed: 'trashed',
|
||||
pending_purge: 'pending_purge',
|
||||
pending_purge: 'pending_purge'
|
||||
} as const
|
||||
|
||||
export type AssetStatus = (typeof AssetStatus)[keyof typeof AssetStatus]
|
||||
|
||||
|
||||
export const StorageKeyStatus = {
|
||||
active: 'active',
|
||||
purging: 'purging',
|
||||
purging: 'purging'
|
||||
} as const
|
||||
|
||||
export type StorageKeyStatus = (typeof StorageKeyStatus)[keyof typeof StorageKeyStatus]
|
||||
|
||||
|
||||
export const InviteRole = {
|
||||
editor: 'editor',
|
||||
reviewer: 'reviewer',
|
||||
reviewer: 'reviewer'
|
||||
} as const
|
||||
|
||||
export type InviteRole = (typeof InviteRole)[keyof typeof InviteRole]
|
||||
|
||||
|
||||
export const MetadataFieldScope = {
|
||||
SYSTEM: 'SYSTEM',
|
||||
TEAM: 'TEAM',
|
||||
PROJECT: 'PROJECT',
|
||||
PROJECT: 'PROJECT'
|
||||
} as const
|
||||
|
||||
export type MetadataFieldScope = (typeof MetadataFieldScope)[keyof typeof MetadataFieldScope]
|
||||
|
||||
|
||||
export const NotificationType = {
|
||||
comment_created: 'comment_created',
|
||||
reply_created: 'reply_created',
|
||||
@@ -68,73 +75,81 @@ export const NotificationType = {
|
||||
successful_file_uploaded: 'successful_file_uploaded',
|
||||
metadata_field_updated_status: 'metadata_field_updated_status',
|
||||
new_user_join_team: 'new_user_join_team',
|
||||
new_user_join_project: 'new_user_join_project',
|
||||
new_user_join_project: 'new_user_join_project'
|
||||
} as const
|
||||
|
||||
export type NotificationType = (typeof NotificationType)[keyof typeof NotificationType]
|
||||
|
||||
|
||||
export const ProjectMemberRole = {
|
||||
owner: 'owner',
|
||||
editor: 'editor',
|
||||
reviewer: 'reviewer',
|
||||
reviewer: 'reviewer'
|
||||
} as const
|
||||
|
||||
export type ProjectMemberRole = (typeof ProjectMemberRole)[keyof typeof ProjectMemberRole]
|
||||
|
||||
|
||||
export const TaskType = {
|
||||
upload: 'upload',
|
||||
upload: 'upload'
|
||||
} as const
|
||||
|
||||
export type TaskType = (typeof TaskType)[keyof typeof TaskType]
|
||||
|
||||
|
||||
export const TaskStatus = {
|
||||
pending: 'pending',
|
||||
uploading: 'uploading',
|
||||
completed: 'completed',
|
||||
failed: 'failed',
|
||||
failed: 'failed'
|
||||
} as const
|
||||
|
||||
export type TaskStatus = (typeof TaskStatus)[keyof typeof TaskStatus]
|
||||
|
||||
|
||||
export const TeamMemberRole = {
|
||||
owner: 'owner',
|
||||
editor: 'editor',
|
||||
reviewer: 'reviewer',
|
||||
reviewer: 'reviewer'
|
||||
} as const
|
||||
|
||||
export type TeamMemberRole = (typeof TeamMemberRole)[keyof typeof TeamMemberRole]
|
||||
|
||||
|
||||
export const TeamMemberScope = {
|
||||
team: 'team',
|
||||
project: 'project',
|
||||
project: 'project'
|
||||
} as const
|
||||
|
||||
export type TeamMemberScope = (typeof TeamMemberScope)[keyof typeof TeamMemberScope]
|
||||
|
||||
|
||||
export const WorkflowTaskType = {
|
||||
transcode: 'transcode',
|
||||
ai_metadata_autofill: 'ai_metadata_autofill',
|
||||
chat: 'chat',
|
||||
ai_embedding: 'ai_embedding',
|
||||
query_embedding_for_search: 'query_embedding_for_search',
|
||||
agent_tool_call: 'agent_tool_call',
|
||||
agent_tool_call: 'agent_tool_call'
|
||||
} as const
|
||||
|
||||
export type WorkflowTaskType = (typeof WorkflowTaskType)[keyof typeof WorkflowTaskType]
|
||||
|
||||
|
||||
export const WorkflowTaskStatus = {
|
||||
pending: 'pending',
|
||||
processing: 'processing',
|
||||
completed: 'completed',
|
||||
failed: 'failed',
|
||||
failed: 'failed'
|
||||
} as const
|
||||
|
||||
export type WorkflowTaskStatus = (typeof WorkflowTaskStatus)[keyof typeof WorkflowTaskStatus]
|
||||
|
||||
|
||||
export const AgentType = {
|
||||
chat: 'chat',
|
||||
autofill: 'autofill',
|
||||
embedding: 'embedding',
|
||||
embedding: 'embedding'
|
||||
} as const
|
||||
|
||||
export type AgentType = (typeof AgentType)[keyof typeof AgentType]
|
||||
|
||||
+285
-326
File diff suppressed because one or more lines are too long
+372
-400
File diff suppressed because it is too large
Load Diff
+117
-102
@@ -1,7 +1,8 @@
|
||||
|
||||
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
|
||||
/* eslint-disable */
|
||||
// biome-ignore-all lint: generated file
|
||||
// @ts-nocheck
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* WARNING: This is an internal file that is subject to change!
|
||||
*
|
||||
@@ -14,17 +15,18 @@
|
||||
* model files in the `model` directory!
|
||||
*/
|
||||
|
||||
import * as runtime from '@prisma/client/runtime/index-browser'
|
||||
import * as runtime from "@prisma/client/runtime/index-browser"
|
||||
|
||||
export type * from '../models.ts'
|
||||
export type * from './prismaNamespace.ts'
|
||||
|
||||
export const Decimal = runtime.Decimal
|
||||
|
||||
|
||||
export const NullTypes = {
|
||||
DbNull: runtime.NullTypes.DbNull as new (secret: never) => typeof runtime.DbNull,
|
||||
JsonNull: runtime.NullTypes.JsonNull as new (secret: never) => typeof runtime.JsonNull,
|
||||
AnyNull: runtime.NullTypes.AnyNull as new (secret: never) => typeof runtime.AnyNull,
|
||||
DbNull: runtime.NullTypes.DbNull as (new (secret: never) => typeof runtime.DbNull),
|
||||
JsonNull: runtime.NullTypes.JsonNull as (new (secret: never) => typeof runtime.JsonNull),
|
||||
AnyNull: runtime.NullTypes.AnyNull as (new (secret: never) => typeof runtime.AnyNull),
|
||||
}
|
||||
/**
|
||||
* Helper for filtering JSON entries that have `null` on the database (empty on the db)
|
||||
@@ -47,6 +49,7 @@ export const JsonNull = runtime.JsonNull
|
||||
*/
|
||||
export const AnyNull = runtime.AnyNull
|
||||
|
||||
|
||||
export const ModelName = {
|
||||
User: 'User',
|
||||
Session: 'Session',
|
||||
@@ -80,7 +83,7 @@ export const ModelName = {
|
||||
Model: 'Model',
|
||||
Provider: 'Provider',
|
||||
Collection: 'Collection',
|
||||
ApiToken: 'ApiToken',
|
||||
ApiToken: 'ApiToken'
|
||||
} as const
|
||||
|
||||
export type ModelName = (typeof ModelName)[keyof typeof ModelName]
|
||||
@@ -93,11 +96,11 @@ export const TransactionIsolationLevel = runtime.makeStrictEnum({
|
||||
ReadUncommitted: 'ReadUncommitted',
|
||||
ReadCommitted: 'ReadCommitted',
|
||||
RepeatableRead: 'RepeatableRead',
|
||||
Serializable: 'Serializable',
|
||||
Serializable: 'Serializable'
|
||||
} as const)
|
||||
|
||||
export type TransactionIsolationLevel =
|
||||
(typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel]
|
||||
export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel]
|
||||
|
||||
|
||||
export const UserScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -110,11 +113,12 @@ export const UserScalarFieldEnum = {
|
||||
agentSettings: 'agentSettings',
|
||||
guestEmail: 'guestEmail',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum]
|
||||
|
||||
|
||||
export const SessionScalarFieldEnum = {
|
||||
id: 'id',
|
||||
expiresAt: 'expiresAt',
|
||||
@@ -123,11 +127,11 @@ export const SessionScalarFieldEnum = {
|
||||
updatedAt: 'updatedAt',
|
||||
ipAddress: 'ipAddress',
|
||||
userAgent: 'userAgent',
|
||||
userId: 'userId',
|
||||
userId: 'userId'
|
||||
} as const
|
||||
|
||||
export type SessionScalarFieldEnum =
|
||||
(typeof SessionScalarFieldEnum)[keyof typeof SessionScalarFieldEnum]
|
||||
export type SessionScalarFieldEnum = (typeof SessionScalarFieldEnum)[keyof typeof SessionScalarFieldEnum]
|
||||
|
||||
|
||||
export const AccountScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -142,11 +146,11 @@ export const AccountScalarFieldEnum = {
|
||||
scope: 'scope',
|
||||
password: 'password',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type AccountScalarFieldEnum =
|
||||
(typeof AccountScalarFieldEnum)[keyof typeof AccountScalarFieldEnum]
|
||||
export type AccountScalarFieldEnum = (typeof AccountScalarFieldEnum)[keyof typeof AccountScalarFieldEnum]
|
||||
|
||||
|
||||
export const VerificationScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -154,11 +158,11 @@ export const VerificationScalarFieldEnum = {
|
||||
value: 'value',
|
||||
expiresAt: 'expiresAt',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type VerificationScalarFieldEnum =
|
||||
(typeof VerificationScalarFieldEnum)[keyof typeof VerificationScalarFieldEnum]
|
||||
export type VerificationScalarFieldEnum = (typeof VerificationScalarFieldEnum)[keyof typeof VerificationScalarFieldEnum]
|
||||
|
||||
|
||||
export const AuthTokenScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -166,11 +170,11 @@ export const AuthTokenScalarFieldEnum = {
|
||||
refreshToken: 'refreshToken',
|
||||
accessTokenExpiresAt: 'accessTokenExpiresAt',
|
||||
refreshTokenExpiresAt: 'refreshTokenExpiresAt',
|
||||
userId: 'userId',
|
||||
userId: 'userId'
|
||||
} as const
|
||||
|
||||
export type AuthTokenScalarFieldEnum =
|
||||
(typeof AuthTokenScalarFieldEnum)[keyof typeof AuthTokenScalarFieldEnum]
|
||||
export type AuthTokenScalarFieldEnum = (typeof AuthTokenScalarFieldEnum)[keyof typeof AuthTokenScalarFieldEnum]
|
||||
|
||||
|
||||
export const TeamScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -178,22 +182,23 @@ export const TeamScalarFieldEnum = {
|
||||
settings: 'settings',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
rootFolderId: 'rootFolderId',
|
||||
rootFolderId: 'rootFolderId'
|
||||
} as const
|
||||
|
||||
export type TeamScalarFieldEnum = (typeof TeamScalarFieldEnum)[keyof typeof TeamScalarFieldEnum]
|
||||
|
||||
|
||||
export const SandboxScalarFieldEnum = {
|
||||
id: 'id',
|
||||
allowedDomains: 'allowedDomains',
|
||||
pendingDomains: 'pendingDomains',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
teamId: 'teamId',
|
||||
teamId: 'teamId'
|
||||
} as const
|
||||
|
||||
export type SandboxScalarFieldEnum =
|
||||
(typeof SandboxScalarFieldEnum)[keyof typeof SandboxScalarFieldEnum]
|
||||
export type SandboxScalarFieldEnum = (typeof SandboxScalarFieldEnum)[keyof typeof SandboxScalarFieldEnum]
|
||||
|
||||
|
||||
export const SkillScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -204,22 +209,23 @@ export const SkillScalarFieldEnum = {
|
||||
hash: 'hash',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
teamId: 'teamId',
|
||||
teamId: 'teamId'
|
||||
} as const
|
||||
|
||||
export type SkillScalarFieldEnum = (typeof SkillScalarFieldEnum)[keyof typeof SkillScalarFieldEnum]
|
||||
|
||||
|
||||
export const TeamMemberScalarFieldEnum = {
|
||||
id: 'id',
|
||||
role: 'role',
|
||||
scope: 'scope',
|
||||
teamId: 'teamId',
|
||||
userId: 'userId',
|
||||
lastReadNotificationId: 'lastReadNotificationId',
|
||||
lastReadNotificationId: 'lastReadNotificationId'
|
||||
} as const
|
||||
|
||||
export type TeamMemberScalarFieldEnum =
|
||||
(typeof TeamMemberScalarFieldEnum)[keyof typeof TeamMemberScalarFieldEnum]
|
||||
export type TeamMemberScalarFieldEnum = (typeof TeamMemberScalarFieldEnum)[keyof typeof TeamMemberScalarFieldEnum]
|
||||
|
||||
|
||||
export const ProjectScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -231,21 +237,21 @@ export const ProjectScalarFieldEnum = {
|
||||
updatedAt: 'updatedAt',
|
||||
teamId: 'teamId',
|
||||
rootFolderId: 'rootFolderId',
|
||||
shareRootId: 'shareRootId',
|
||||
shareRootId: 'shareRootId'
|
||||
} as const
|
||||
|
||||
export type ProjectScalarFieldEnum =
|
||||
(typeof ProjectScalarFieldEnum)[keyof typeof ProjectScalarFieldEnum]
|
||||
export type ProjectScalarFieldEnum = (typeof ProjectScalarFieldEnum)[keyof typeof ProjectScalarFieldEnum]
|
||||
|
||||
|
||||
export const ProjectMemberScalarFieldEnum = {
|
||||
id: 'id',
|
||||
role: 'role',
|
||||
projectId: 'projectId',
|
||||
teamMemberId: 'teamMemberId',
|
||||
teamMemberId: 'teamMemberId'
|
||||
} as const
|
||||
|
||||
export type ProjectMemberScalarFieldEnum =
|
||||
(typeof ProjectMemberScalarFieldEnum)[keyof typeof ProjectMemberScalarFieldEnum]
|
||||
export type ProjectMemberScalarFieldEnum = (typeof ProjectMemberScalarFieldEnum)[keyof typeof ProjectMemberScalarFieldEnum]
|
||||
|
||||
|
||||
export const ShareLinkScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -260,11 +266,11 @@ export const ShareLinkScalarFieldEnum = {
|
||||
updatedAt: 'updatedAt',
|
||||
projectId: 'projectId',
|
||||
rootFolderId: 'rootFolderId',
|
||||
creatorId: 'creatorId',
|
||||
creatorId: 'creatorId'
|
||||
} as const
|
||||
|
||||
export type ShareLinkScalarFieldEnum =
|
||||
(typeof ShareLinkScalarFieldEnum)[keyof typeof ShareLinkScalarFieldEnum]
|
||||
export type ShareLinkScalarFieldEnum = (typeof ShareLinkScalarFieldEnum)[keyof typeof ShareLinkScalarFieldEnum]
|
||||
|
||||
|
||||
export const AssetScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -287,21 +293,22 @@ export const AssetScalarFieldEnum = {
|
||||
storageKeyId: 'storageKeyId',
|
||||
creatorId: 'creatorId',
|
||||
taskId: 'taskId',
|
||||
projectId: 'projectId',
|
||||
projectId: 'projectId'
|
||||
} as const
|
||||
|
||||
export type AssetScalarFieldEnum = (typeof AssetScalarFieldEnum)[keyof typeof AssetScalarFieldEnum]
|
||||
|
||||
|
||||
export const StorageKeyScalarFieldEnum = {
|
||||
id: 'id',
|
||||
key: 'key',
|
||||
status: 'status',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type StorageKeyScalarFieldEnum =
|
||||
(typeof StorageKeyScalarFieldEnum)[keyof typeof StorageKeyScalarFieldEnum]
|
||||
export type StorageKeyScalarFieldEnum = (typeof StorageKeyScalarFieldEnum)[keyof typeof StorageKeyScalarFieldEnum]
|
||||
|
||||
|
||||
export const AssetMetadataValueScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -311,11 +318,11 @@ export const AssetMetadataValueScalarFieldEnum = {
|
||||
numberValue: 'numberValue',
|
||||
booleanValue: 'booleanValue',
|
||||
jsonValue: 'jsonValue',
|
||||
dateValue: 'dateValue',
|
||||
dateValue: 'dateValue'
|
||||
} as const
|
||||
|
||||
export type AssetMetadataValueScalarFieldEnum =
|
||||
(typeof AssetMetadataValueScalarFieldEnum)[keyof typeof AssetMetadataValueScalarFieldEnum]
|
||||
export type AssetMetadataValueScalarFieldEnum = (typeof AssetMetadataValueScalarFieldEnum)[keyof typeof AssetMetadataValueScalarFieldEnum]
|
||||
|
||||
|
||||
export const AssetCommentScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -327,22 +334,22 @@ export const AssetCommentScalarFieldEnum = {
|
||||
updatedAt: 'updatedAt',
|
||||
assetId: 'assetId',
|
||||
creatorId: 'creatorId',
|
||||
replyToId: 'replyToId',
|
||||
replyToId: 'replyToId'
|
||||
} as const
|
||||
|
||||
export type AssetCommentScalarFieldEnum =
|
||||
(typeof AssetCommentScalarFieldEnum)[keyof typeof AssetCommentScalarFieldEnum]
|
||||
export type AssetCommentScalarFieldEnum = (typeof AssetCommentScalarFieldEnum)[keyof typeof AssetCommentScalarFieldEnum]
|
||||
|
||||
|
||||
export const AssetCommentAttachmentScalarFieldEnum = {
|
||||
id: 'id',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
commentId: 'commentId',
|
||||
assetId: 'assetId',
|
||||
assetId: 'assetId'
|
||||
} as const
|
||||
|
||||
export type AssetCommentAttachmentScalarFieldEnum =
|
||||
(typeof AssetCommentAttachmentScalarFieldEnum)[keyof typeof AssetCommentAttachmentScalarFieldEnum]
|
||||
export type AssetCommentAttachmentScalarFieldEnum = (typeof AssetCommentAttachmentScalarFieldEnum)[keyof typeof AssetCommentAttachmentScalarFieldEnum]
|
||||
|
||||
|
||||
export const AssetEmbeddingScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -350,11 +357,11 @@ export const AssetEmbeddingScalarFieldEnum = {
|
||||
endTime: 'endTime',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
assetId: 'assetId',
|
||||
assetId: 'assetId'
|
||||
} as const
|
||||
|
||||
export type AssetEmbeddingScalarFieldEnum =
|
||||
(typeof AssetEmbeddingScalarFieldEnum)[keyof typeof AssetEmbeddingScalarFieldEnum]
|
||||
export type AssetEmbeddingScalarFieldEnum = (typeof AssetEmbeddingScalarFieldEnum)[keyof typeof AssetEmbeddingScalarFieldEnum]
|
||||
|
||||
|
||||
export const InviteScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -365,11 +372,11 @@ export const InviteScalarFieldEnum = {
|
||||
updatedAt: 'updatedAt',
|
||||
teamId: 'teamId',
|
||||
projectId: 'projectId',
|
||||
inviterId: 'inviterId',
|
||||
inviterId: 'inviterId'
|
||||
} as const
|
||||
|
||||
export type InviteScalarFieldEnum =
|
||||
(typeof InviteScalarFieldEnum)[keyof typeof InviteScalarFieldEnum]
|
||||
export type InviteScalarFieldEnum = (typeof InviteScalarFieldEnum)[keyof typeof InviteScalarFieldEnum]
|
||||
|
||||
|
||||
export const MetadataFieldScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -380,11 +387,11 @@ export const MetadataFieldScalarFieldEnum = {
|
||||
aiAutofill: 'aiAutofill',
|
||||
description: 'description',
|
||||
teamId: 'teamId',
|
||||
projectId: 'projectId',
|
||||
projectId: 'projectId'
|
||||
} as const
|
||||
|
||||
export type MetadataFieldScalarFieldEnum =
|
||||
(typeof MetadataFieldScalarFieldEnum)[keyof typeof MetadataFieldScalarFieldEnum]
|
||||
export type MetadataFieldScalarFieldEnum = (typeof MetadataFieldScalarFieldEnum)[keyof typeof MetadataFieldScalarFieldEnum]
|
||||
|
||||
|
||||
export const NotificationScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -396,22 +403,22 @@ export const NotificationScalarFieldEnum = {
|
||||
creatorId: 'creatorId',
|
||||
assetId: 'assetId',
|
||||
taskId: 'taskId',
|
||||
userId: 'userId',
|
||||
userId: 'userId'
|
||||
} as const
|
||||
|
||||
export type NotificationScalarFieldEnum =
|
||||
(typeof NotificationScalarFieldEnum)[keyof typeof NotificationScalarFieldEnum]
|
||||
export type NotificationScalarFieldEnum = (typeof NotificationScalarFieldEnum)[keyof typeof NotificationScalarFieldEnum]
|
||||
|
||||
|
||||
export const SystemSettingsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
key: 'key',
|
||||
value: 'value',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type SystemSettingsScalarFieldEnum =
|
||||
(typeof SystemSettingsScalarFieldEnum)[keyof typeof SystemSettingsScalarFieldEnum]
|
||||
export type SystemSettingsScalarFieldEnum = (typeof SystemSettingsScalarFieldEnum)[keyof typeof SystemSettingsScalarFieldEnum]
|
||||
|
||||
|
||||
export const TaskScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -422,11 +429,12 @@ export const TaskScalarFieldEnum = {
|
||||
uploaded: 'uploaded',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
creatorId: 'creatorId',
|
||||
creatorId: 'creatorId'
|
||||
} as const
|
||||
|
||||
export type TaskScalarFieldEnum = (typeof TaskScalarFieldEnum)[keyof typeof TaskScalarFieldEnum]
|
||||
|
||||
|
||||
export const WorkflowTaskScalarFieldEnum = {
|
||||
id: 'id',
|
||||
uid: 'uid',
|
||||
@@ -442,11 +450,11 @@ export const WorkflowTaskScalarFieldEnum = {
|
||||
outputTokens: 'outputTokens',
|
||||
model: 'model',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type WorkflowTaskScalarFieldEnum =
|
||||
(typeof WorkflowTaskScalarFieldEnum)[keyof typeof WorkflowTaskScalarFieldEnum]
|
||||
export type WorkflowTaskScalarFieldEnum = (typeof WorkflowTaskScalarFieldEnum)[keyof typeof WorkflowTaskScalarFieldEnum]
|
||||
|
||||
|
||||
export const AgentScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -458,21 +466,22 @@ export const AgentScalarFieldEnum = {
|
||||
teamId: 'teamId',
|
||||
config: 'config',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type AgentScalarFieldEnum = (typeof AgentScalarFieldEnum)[keyof typeof AgentScalarFieldEnum]
|
||||
|
||||
|
||||
export const AgentSkillScalarFieldEnum = {
|
||||
id: 'id',
|
||||
agentId: 'agentId',
|
||||
skillId: 'skillId',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type AgentSkillScalarFieldEnum =
|
||||
(typeof AgentSkillScalarFieldEnum)[keyof typeof AgentSkillScalarFieldEnum]
|
||||
export type AgentSkillScalarFieldEnum = (typeof AgentSkillScalarFieldEnum)[keyof typeof AgentSkillScalarFieldEnum]
|
||||
|
||||
|
||||
export const AgentSessionScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -483,20 +492,20 @@ export const AgentSessionScalarFieldEnum = {
|
||||
assetId: 'assetId',
|
||||
userCommentId: 'userCommentId',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type AgentSessionScalarFieldEnum =
|
||||
(typeof AgentSessionScalarFieldEnum)[keyof typeof AgentSessionScalarFieldEnum]
|
||||
export type AgentSessionScalarFieldEnum = (typeof AgentSessionScalarFieldEnum)[keyof typeof AgentSessionScalarFieldEnum]
|
||||
|
||||
|
||||
export const AgentSessionEntryScalarFieldEnum = {
|
||||
id: 'id',
|
||||
sessionId: 'sessionId',
|
||||
entry: 'entry',
|
||||
entry: 'entry'
|
||||
} as const
|
||||
|
||||
export type AgentSessionEntryScalarFieldEnum =
|
||||
(typeof AgentSessionEntryScalarFieldEnum)[keyof typeof AgentSessionEntryScalarFieldEnum]
|
||||
export type AgentSessionEntryScalarFieldEnum = (typeof AgentSessionEntryScalarFieldEnum)[keyof typeof AgentSessionEntryScalarFieldEnum]
|
||||
|
||||
|
||||
export const UserMetadataScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -505,11 +514,11 @@ export const UserMetadataScalarFieldEnum = {
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
userId: 'userId',
|
||||
teamId: 'teamId',
|
||||
teamId: 'teamId'
|
||||
} as const
|
||||
|
||||
export type UserMetadataScalarFieldEnum =
|
||||
(typeof UserMetadataScalarFieldEnum)[keyof typeof UserMetadataScalarFieldEnum]
|
||||
export type UserMetadataScalarFieldEnum = (typeof UserMetadataScalarFieldEnum)[keyof typeof UserMetadataScalarFieldEnum]
|
||||
|
||||
|
||||
export const ModelScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -518,11 +527,12 @@ export const ModelScalarFieldEnum = {
|
||||
config: 'config',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
providerId: 'providerId',
|
||||
providerId: 'providerId'
|
||||
} as const
|
||||
|
||||
export type ModelScalarFieldEnum = (typeof ModelScalarFieldEnum)[keyof typeof ModelScalarFieldEnum]
|
||||
|
||||
|
||||
export const ProviderScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
@@ -530,11 +540,11 @@ export const ProviderScalarFieldEnum = {
|
||||
config: 'config',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
teamId: 'teamId',
|
||||
teamId: 'teamId'
|
||||
} as const
|
||||
|
||||
export type ProviderScalarFieldEnum =
|
||||
(typeof ProviderScalarFieldEnum)[keyof typeof ProviderScalarFieldEnum]
|
||||
export type ProviderScalarFieldEnum = (typeof ProviderScalarFieldEnum)[keyof typeof ProviderScalarFieldEnum]
|
||||
|
||||
|
||||
export const CollectionScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -543,11 +553,11 @@ export const CollectionScalarFieldEnum = {
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
projectId: 'projectId',
|
||||
creatorId: 'creatorId',
|
||||
creatorId: 'creatorId'
|
||||
} as const
|
||||
|
||||
export type CollectionScalarFieldEnum =
|
||||
(typeof CollectionScalarFieldEnum)[keyof typeof CollectionScalarFieldEnum]
|
||||
export type CollectionScalarFieldEnum = (typeof CollectionScalarFieldEnum)[keyof typeof CollectionScalarFieldEnum]
|
||||
|
||||
|
||||
export const ApiTokenScalarFieldEnum = {
|
||||
id: 'id',
|
||||
@@ -555,51 +565,56 @@ export const ApiTokenScalarFieldEnum = {
|
||||
name: 'name',
|
||||
userId: 'userId',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type ApiTokenScalarFieldEnum =
|
||||
(typeof ApiTokenScalarFieldEnum)[keyof typeof ApiTokenScalarFieldEnum]
|
||||
export type ApiTokenScalarFieldEnum = (typeof ApiTokenScalarFieldEnum)[keyof typeof ApiTokenScalarFieldEnum]
|
||||
|
||||
|
||||
export const SortOrder = {
|
||||
asc: 'asc',
|
||||
desc: 'desc',
|
||||
desc: 'desc'
|
||||
} as const
|
||||
|
||||
export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]
|
||||
|
||||
|
||||
export const NullableJsonNullValueInput = {
|
||||
DbNull: DbNull,
|
||||
JsonNull: JsonNull,
|
||||
JsonNull: JsonNull
|
||||
} as const
|
||||
|
||||
export type NullableJsonNullValueInput =
|
||||
(typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput]
|
||||
export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput]
|
||||
|
||||
|
||||
export const JsonNullValueInput = {
|
||||
JsonNull: JsonNull,
|
||||
JsonNull: JsonNull
|
||||
} as const
|
||||
|
||||
export type JsonNullValueInput = (typeof JsonNullValueInput)[keyof typeof JsonNullValueInput]
|
||||
|
||||
|
||||
export const QueryMode = {
|
||||
default: 'default',
|
||||
insensitive: 'insensitive',
|
||||
insensitive: 'insensitive'
|
||||
} as const
|
||||
|
||||
export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode]
|
||||
|
||||
|
||||
export const JsonNullValueFilter = {
|
||||
DbNull: DbNull,
|
||||
JsonNull: JsonNull,
|
||||
AnyNull: AnyNull,
|
||||
AnyNull: AnyNull
|
||||
} as const
|
||||
|
||||
export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter]
|
||||
|
||||
|
||||
export const NullsOrder = {
|
||||
first: 'first',
|
||||
last: 'last',
|
||||
last: 'last'
|
||||
} as const
|
||||
|
||||
export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder]
|
||||
|
||||
|
||||
+3
-2
@@ -1,7 +1,8 @@
|
||||
|
||||
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
|
||||
/* eslint-disable */
|
||||
// biome-ignore-all lint: generated file
|
||||
// @ts-nocheck
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* This is a barrel export file for all models and their related types.
|
||||
*
|
||||
@@ -40,4 +41,4 @@ export type * from './models/Model.ts'
|
||||
export type * from './models/Provider.ts'
|
||||
export type * from './models/Collection.ts'
|
||||
export type * from './models/ApiToken.ts'
|
||||
export type * from './commonInputTypes.ts'
|
||||
export type * from './commonInputTypes.ts'
|
||||
+322
-596
File diff suppressed because it is too large
Load Diff
+427
-946
File diff suppressed because it is too large
Load Diff
+372
-903
File diff suppressed because it is too large
Load Diff
+260
-572
File diff suppressed because it is too large
Load Diff
+278
-635
File diff suppressed because it is too large
Load Diff
+260
-536
File diff suppressed because it is too large
Load Diff
+772
-1892
File diff suppressed because it is too large
Load Diff
+457
-1076
File diff suppressed because it is too large
Load Diff
+321
-770
File diff suppressed because it is too large
Load Diff
+268
-564
File diff suppressed because it is too large
Load Diff
+310
-641
File diff suppressed because it is too large
Load Diff
+262
-549
File diff suppressed because it is too large
Load Diff
+320
-678
File diff suppressed because it is too large
Load Diff
+333
-722
File diff suppressed because it is too large
Load Diff
+350
-772
File diff suppressed because it is too large
Load Diff
+304
-591
File diff suppressed because it is too large
Load Diff
+463
-1255
File diff suppressed because it is too large
Load Diff
+471
-1110
File diff suppressed because it is too large
Load Diff
+271
-642
File diff suppressed because it is too large
Load Diff
+323
-679
File diff suppressed because it is too large
Load Diff
+244
-475
File diff suppressed because it is too large
Load Diff
+277
-531
File diff suppressed because it is too large
Load Diff
+393
-809
File diff suppressed because it is too large
Load Diff
+321
-601
File diff suppressed because it is too large
Load Diff
+239
-494
File diff suppressed because it is too large
Load Diff
+235
-453
File diff suppressed because it is too large
Load Diff
+317
-653
File diff suppressed because it is too large
Load Diff
+424
-1040
File diff suppressed because it is too large
Load Diff
+320
-777
File diff suppressed because it is too large
Load Diff
+540
-1334
File diff suppressed because it is too large
Load Diff
+324
-689
File diff suppressed because it is too large
Load Diff
+233
-448
File diff suppressed because it is too large
Load Diff
+341
-609
File diff suppressed because it is too large
Load Diff
Generated
+64
-64
@@ -1,4 +1,4 @@
|
||||
import * as Prisma from './internal/prismaNamespace'
|
||||
import * as Prisma from './internal/prismaNamespace';
|
||||
declare global {
|
||||
namespace PrismaJson {
|
||||
// This namespace will always be empty. Definitions should be done by
|
||||
@@ -12,21 +12,21 @@ declare global {
|
||||
|
||||
/** A filter to be used against nullable List types. */
|
||||
export type NullableListFilter<T> = {
|
||||
equals?: T | T[] | null
|
||||
has?: T | null
|
||||
hasEvery?: T[]
|
||||
hasSome?: T[]
|
||||
isEmpty?: boolean
|
||||
}
|
||||
equals?: T | T[] | null;
|
||||
has?: T | null;
|
||||
hasEvery?: T[];
|
||||
hasSome?: T[];
|
||||
isEmpty?: boolean;
|
||||
};
|
||||
|
||||
/** A type to determine how to update a json field */
|
||||
export type UpdateInput<T> = T extends object ? { [P in keyof T]?: UpdateInput<T[P]> } : T
|
||||
export type UpdateInput<T> = T extends object ? { [P in keyof T]?: UpdateInput<T[P]> } : T;
|
||||
|
||||
/** A type to determine how to update a json[] field */
|
||||
export type UpdateManyInput<T> = T | T[] | { set?: T[]; push?: T | T[] }
|
||||
export type UpdateManyInput<T> = T | T[] | { set?: T[]; push?: T | T[] };
|
||||
|
||||
/** A type to determine how to create a json[] input */
|
||||
export type CreateManyInput<T> = T | T[] | { set?: T[] }
|
||||
export type CreateManyInput<T> = T | T[] | { set?: T[] };
|
||||
|
||||
/**
|
||||
* A typed version of NestedStringFilter, allowing narrowing of string types to
|
||||
@@ -35,11 +35,11 @@ export type CreateManyInput<T> = T | T[] | { set?: T[] }
|
||||
export type TypedNestedStringFilter<S extends string> =
|
||||
//@ts-ignore - When Prisma.StringFilter is not present, this type is not used
|
||||
Prisma.StringFilter & {
|
||||
equals?: S
|
||||
in?: S[]
|
||||
notIn?: S[]
|
||||
not?: TypedNestedStringFilter<S> | S
|
||||
}
|
||||
equals?: S;
|
||||
in?: S[];
|
||||
notIn?: S[];
|
||||
not?: TypedNestedStringFilter<S> | S;
|
||||
};
|
||||
|
||||
/**
|
||||
* A typed version of StringFilter, allowing narrowing of string types to discriminated
|
||||
@@ -48,11 +48,11 @@ export type TypedNestedStringFilter<S extends string> =
|
||||
export type TypedStringFilter<S extends string> =
|
||||
//@ts-ignore - When Prisma.StringFilter is not present, this type is not used
|
||||
Prisma.StringFilter & {
|
||||
equals?: S
|
||||
in?: S[]
|
||||
notIn?: S[]
|
||||
not?: TypedNestedStringFilter<S> | S
|
||||
}
|
||||
equals?: S;
|
||||
in?: S[];
|
||||
notIn?: S[];
|
||||
not?: TypedNestedStringFilter<S> | S;
|
||||
};
|
||||
|
||||
/**
|
||||
* A typed version of NestedStringNullableFilter, allowing narrowing of string types to
|
||||
@@ -61,11 +61,11 @@ export type TypedStringFilter<S extends string> =
|
||||
export type TypedNestedStringNullableFilter<S extends string> =
|
||||
//@ts-ignore - When Prisma.StringNullableFilter is not present, this type is not used
|
||||
Prisma.StringNullableFilter & {
|
||||
equals?: S | null
|
||||
in?: S[] | null
|
||||
notIn?: S[] | null
|
||||
not?: TypedNestedStringNullableFilter<S> | S | null
|
||||
}
|
||||
equals?: S | null;
|
||||
in?: S[] | null;
|
||||
notIn?: S[] | null;
|
||||
not?: TypedNestedStringNullableFilter<S> | S | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* A typed version of StringNullableFilter, allowing narrowing of string types to
|
||||
@@ -74,11 +74,11 @@ export type TypedNestedStringNullableFilter<S extends string> =
|
||||
export type TypedStringNullableFilter<S extends string> =
|
||||
//@ts-ignore - When Prisma.StringNullableFilter is not present, this type is not used
|
||||
Prisma.StringNullableFilter & {
|
||||
equals?: S | null
|
||||
in?: S[] | null
|
||||
notIn?: S[] | null
|
||||
not?: TypedNestedStringNullableFilter<S> | S | null
|
||||
}
|
||||
equals?: S | null;
|
||||
in?: S[] | null;
|
||||
notIn?: S[] | null;
|
||||
not?: TypedNestedStringNullableFilter<S> | S | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* A typed version of NestedStringWithAggregatesFilter, allowing narrowing of string types
|
||||
@@ -87,11 +87,11 @@ export type TypedStringNullableFilter<S extends string> =
|
||||
export type TypedNestedStringWithAggregatesFilter<S extends string> =
|
||||
//@ts-ignore - When Prisma.NestedStringWithAggregatesFilter is not present, this type is not used
|
||||
Prisma.NestedStringWithAggregatesFilter & {
|
||||
equals?: S
|
||||
in?: S[]
|
||||
notIn?: S[]
|
||||
not?: TypedNestedStringWithAggregatesFilter<S> | S
|
||||
}
|
||||
equals?: S;
|
||||
in?: S[];
|
||||
notIn?: S[];
|
||||
not?: TypedNestedStringWithAggregatesFilter<S> | S;
|
||||
};
|
||||
|
||||
/**
|
||||
* A typed version of StringWithAggregatesFilter, allowing narrowing of string types to
|
||||
@@ -100,11 +100,11 @@ export type TypedNestedStringWithAggregatesFilter<S extends string> =
|
||||
export type TypedStringWithAggregatesFilter<S extends string> =
|
||||
//@ts-ignore - When Prisma.StringWithAggregatesFilter is not present, this type is not used
|
||||
Prisma.StringWithAggregatesFilter & {
|
||||
equals?: S
|
||||
in?: S[]
|
||||
notIn?: S[]
|
||||
not?: TypedNestedStringWithAggregatesFilter<S> | S
|
||||
}
|
||||
equals?: S;
|
||||
in?: S[];
|
||||
notIn?: S[];
|
||||
not?: TypedNestedStringWithAggregatesFilter<S> | S;
|
||||
};
|
||||
|
||||
/**
|
||||
* A typed version of NestedStringNullableWithAggregatesFilter, allowing narrowing of
|
||||
@@ -113,11 +113,11 @@ export type TypedStringWithAggregatesFilter<S extends string> =
|
||||
export type TypedNestedStringNullableWithAggregatesFilter<S extends string> =
|
||||
//@ts-ignore - When Prisma.NestedStringNullableWithAggregatesFilter is not present, this type is not used
|
||||
Prisma.NestedStringNullableWithAggregatesFilter & {
|
||||
equals?: S | null
|
||||
in?: S[] | null
|
||||
notIn?: S[] | null
|
||||
not?: TypedNestedStringNullableWithAggregatesFilter<S> | S | null
|
||||
}
|
||||
equals?: S | null;
|
||||
in?: S[] | null;
|
||||
notIn?: S[] | null;
|
||||
not?: TypedNestedStringNullableWithAggregatesFilter<S> | S | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* A typed version of StringNullableWithAggregatesFilter, allowing narrowing of string
|
||||
@@ -126,11 +126,11 @@ export type TypedNestedStringNullableWithAggregatesFilter<S extends string> =
|
||||
export type TypedStringNullableWithAggregatesFilter<S extends string> =
|
||||
//@ts-ignore - When Prisma.StringNullableWithAggregatesFilter is not present, this type is not used
|
||||
Prisma.StringNullableWithAggregatesFilter & {
|
||||
equals?: S | null
|
||||
in?: S[] | null
|
||||
notIn?: S[] | null
|
||||
not?: TypedNestedStringNullableWithAggregatesFilter<S> | S | null
|
||||
}
|
||||
equals?: S | null;
|
||||
in?: S[] | null;
|
||||
notIn?: S[] | null;
|
||||
not?: TypedNestedStringNullableWithAggregatesFilter<S> | S | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* A typed version of StringFieldUpdateOperationsInput, allowing narrowing of string types
|
||||
@@ -139,8 +139,8 @@ export type TypedStringNullableWithAggregatesFilter<S extends string> =
|
||||
export type TypedStringFieldUpdateOperationsInput<S extends string> =
|
||||
//@ts-ignore - When Prisma.StringFieldUpdateOperationsInput is not present, this type is not used
|
||||
Prisma.StringFieldUpdateOperationsInput & {
|
||||
set?: S
|
||||
}
|
||||
set?: S;
|
||||
};
|
||||
|
||||
/**
|
||||
* A typed version of NullableStringFieldUpdateOperationsInput, allowing narrowing of
|
||||
@@ -149,8 +149,8 @@ export type TypedStringFieldUpdateOperationsInput<S extends string> =
|
||||
export type TypedNullableStringFieldUpdateOperationsInput<S extends string> =
|
||||
//@ts-ignore - When Prisma.NullableStringFieldUpdateOperationsInput is not present, this type is not used
|
||||
Prisma.NullableStringFieldUpdateOperationsInput & {
|
||||
set?: S | null
|
||||
}
|
||||
set?: S | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* A typed version of StringNullableListFilter, allowing narrowing of string types to
|
||||
@@ -159,25 +159,25 @@ export type TypedNullableStringFieldUpdateOperationsInput<S extends string> =
|
||||
export type TypedStringNullableListFilter<S extends string> =
|
||||
//@ts-ignore - When Prisma.StringNullableListFilter is not present, this type is not used
|
||||
Prisma.StringNullableListFilter & {
|
||||
equals?: S[] | null
|
||||
has?: S | null
|
||||
hasEvery?: S[]
|
||||
hasSome?: S[]
|
||||
}
|
||||
equals?: S[] | null;
|
||||
has?: S | null;
|
||||
hasEvery?: S[];
|
||||
hasSome?: S[];
|
||||
};
|
||||
|
||||
/**
|
||||
* A typed version of the input type to update a string[] field, allowing narrowing of
|
||||
* string types to discriminated unions.
|
||||
*/
|
||||
export type UpdateStringArrayInput<S extends string> = {
|
||||
set?: S[]
|
||||
push?: S | S[]
|
||||
}
|
||||
set?: S[];
|
||||
push?: S | S[];
|
||||
};
|
||||
|
||||
/**
|
||||
* A typed version of the input type to create a string[] field, allowing narrowing of
|
||||
* string types to discriminated unions.
|
||||
*/
|
||||
export type CreateStringArrayInput<S extends string> = {
|
||||
set?: S[]
|
||||
}
|
||||
set?: S[];
|
||||
};
|
||||
@@ -106,6 +106,8 @@ declare global {
|
||||
duration: number
|
||||
bitRate: number
|
||||
frameRate: number
|
||||
totalFrames: number
|
||||
startTimecode: string
|
||||
videoCodec?: string
|
||||
audioCodec?: string
|
||||
audioChannels?: number
|
||||
@@ -124,7 +126,6 @@ declare global {
|
||||
export interface MediaInfo {
|
||||
duration: number
|
||||
filesize: number
|
||||
fps: number
|
||||
frames: number
|
||||
imageTranscodes: ImageTranscode[]
|
||||
videoTranscodes: VideoTranscode[]
|
||||
|
||||
@@ -47,6 +47,8 @@ export const mediaMetadataSchema = z.object({
|
||||
originalWidth: z.number().optional(),
|
||||
originalHeight: z.number().optional(),
|
||||
frameRate: z.number().optional(),
|
||||
totalFrames: z.number().optional(),
|
||||
startTimecode: z.string().optional(),
|
||||
})
|
||||
export type MediaMetadata = z.infer<typeof mediaMetadataSchema>
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ describe('Transcode Activities', () => {
|
||||
duration: 10,
|
||||
bitRate: 1000,
|
||||
frameRate: 30,
|
||||
totalFrames: 300,
|
||||
hasAudio: true,
|
||||
videoCodec: 'Advanced Video Coding',
|
||||
audioCodec: 'MPEG-4 Audio',
|
||||
@@ -121,6 +122,7 @@ describe('Transcode Activities', () => {
|
||||
duration: 0,
|
||||
bitRate: 0,
|
||||
frameRate: 0,
|
||||
totalFrames: 0,
|
||||
hasAudio: false,
|
||||
mimeType: 'image/png',
|
||||
})
|
||||
|
||||
@@ -61,7 +61,6 @@ export async function getMediaInfoActivity(params: {
|
||||
const mediaInfo: PrismaJson.MediaInfo = {
|
||||
duration: 0,
|
||||
filesize: 0,
|
||||
fps: 0,
|
||||
frames: 0,
|
||||
imageTranscodes: [],
|
||||
videoTranscodes: [],
|
||||
@@ -84,13 +83,15 @@ export async function getMediaInfoActivity(params: {
|
||||
if (isVideo) {
|
||||
const info = await transcodeService.getVideoInfo(params.filePath)
|
||||
mediaInfo.duration = info.duration
|
||||
mediaInfo.fps = info.frameRate
|
||||
mediaInfo.frames = info.totalFrames
|
||||
mediaInfo.metadata = {
|
||||
originalWidth: info.originalWidth,
|
||||
originalHeight: info.originalHeight,
|
||||
duration: info.duration,
|
||||
bitRate: info.bitRate,
|
||||
frameRate: info.frameRate,
|
||||
totalFrames: info.totalFrames,
|
||||
startTimecode: info.startTimecode || '00:00:00:00',
|
||||
hasAudio: info.hasAudio,
|
||||
videoCodec: info.videoCodec,
|
||||
audioCodec: info.audioCodec,
|
||||
@@ -122,6 +123,8 @@ export async function getMediaInfoActivity(params: {
|
||||
duration: 0,
|
||||
bitRate: 0,
|
||||
frameRate: 0,
|
||||
totalFrames: 0,
|
||||
startTimecode: '00:00:00:00',
|
||||
hasAudio: false,
|
||||
format: {},
|
||||
}
|
||||
@@ -172,7 +175,7 @@ export async function transcodeVideoActivity(
|
||||
const outputFile = path.join(tmpDir, `video-${params.videoSpec.height}p.mp4`)
|
||||
|
||||
try {
|
||||
let targetFps: number | string = 0
|
||||
let targetFps: number | string = params.originalFps || 30
|
||||
let disableAudio = false
|
||||
|
||||
if (params.videoSpec.resolution === '180p') {
|
||||
|
||||
@@ -101,7 +101,17 @@ describe('Transcode Workflow', () => {
|
||||
|
||||
mockActivities.getMediaInfoActivity.mockResolvedValue({
|
||||
mimeType: 'video/mp4',
|
||||
metadata: { originalWidth: 1920, originalHeight: 1080, duration: 10, frameRate: 30 },
|
||||
metadata: {
|
||||
originalWidth: 1920,
|
||||
originalHeight: 1080,
|
||||
duration: 10,
|
||||
frameRate: 30,
|
||||
totalFrames: 300,
|
||||
startTimecode: '00:00:00:00',
|
||||
bitRate: 1000,
|
||||
hasAudio: false,
|
||||
format: {},
|
||||
},
|
||||
videoTranscodes: [],
|
||||
imageTranscodes: [],
|
||||
})
|
||||
@@ -181,7 +191,17 @@ describe('Transcode Workflow', () => {
|
||||
|
||||
mockActivities.getMediaInfoActivity.mockResolvedValue({
|
||||
mimeType: 'image/jpeg',
|
||||
metadata: { originalWidth: 1000, originalHeight: 1000 },
|
||||
metadata: {
|
||||
originalWidth: 1000,
|
||||
originalHeight: 1000,
|
||||
duration: 0,
|
||||
frameRate: 0,
|
||||
totalFrames: 0,
|
||||
startTimecode: '00:00:00:00',
|
||||
bitRate: 0,
|
||||
hasAudio: false,
|
||||
format: {},
|
||||
},
|
||||
videoTranscodes: [],
|
||||
imageTranscodes: [],
|
||||
})
|
||||
|
||||
@@ -17,8 +17,9 @@ import Markdown from 'react-markdown'
|
||||
import { Avatar, AvatarFallback, AvatarImage } from '../ui/avatar'
|
||||
import { DrawAnnotation } from '../ui/icons'
|
||||
import { Skeleton } from '../ui/skeleton'
|
||||
import { formatTimestamp } from '../viewers/utils'
|
||||
import { formatTimecode } from '../viewers/utils'
|
||||
import { m } from '@/ui/paraglide/messages.js'
|
||||
import { useUiStore } from '@/ui/stores/ui'
|
||||
|
||||
interface MessageCardProps {
|
||||
teamId?: string
|
||||
@@ -32,6 +33,7 @@ interface MessageCardProps {
|
||||
isSelected?: boolean
|
||||
onSelect?: () => void
|
||||
frameRate?: number
|
||||
startTimecode?: string
|
||||
rootParentId?: string
|
||||
}
|
||||
|
||||
@@ -55,6 +57,7 @@ export const MessageCard: React.FC<MessageCardProps> = ({
|
||||
isSelected,
|
||||
onSelect,
|
||||
frameRate,
|
||||
startTimecode,
|
||||
}) => {
|
||||
const message = initialMessage
|
||||
const hasDrawInfo =
|
||||
@@ -66,6 +69,13 @@ export const MessageCard: React.FC<MessageCardProps> = ({
|
||||
|
||||
const [isLogsOpen, setIsLogsOpen] = React.useState(false)
|
||||
|
||||
const { videoTimeDisplayMode } = useUiStore()
|
||||
const displayTime = React.useMemo(() => {
|
||||
if (message.second === null || message.second === undefined || !frameRate) return ''
|
||||
const frameIndex = Math.round(message.second * frameRate)
|
||||
return formatTimecode(frameIndex, frameRate, videoTimeDisplayMode, startTimecode)
|
||||
}, [message.second, frameRate, videoTimeDisplayMode, startTimecode])
|
||||
|
||||
const { data: me } = useQuery({
|
||||
queryKey: ['teams', teamId, 'me'],
|
||||
queryFn: async () => {
|
||||
@@ -171,7 +181,7 @@ export const MessageCard: React.FC<MessageCardProps> = ({
|
||||
<div className="flow-root mt-1">
|
||||
{message.second !== null && message.second !== undefined && frameRate && (
|
||||
<div className="float-left select-none bg-blue-100 dark:bg-blue-900/40 text-blue-600 dark:text-blue-300 px-2.5 py-1 mt-[2px] mr-2 rounded-sm text-xs leading-none font-mono font-bold flex items-center gap-1">
|
||||
{formatTimestamp(message.second, frameRate)}
|
||||
{displayTime}
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
@@ -27,7 +27,8 @@ import { Button } from '../ui/button'
|
||||
import { DrawAnnotation } from '../ui/icons'
|
||||
import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover'
|
||||
import { ProgressCircle } from '../ui/progress-circle'
|
||||
import { formatTimestamp } from '../viewers/utils'
|
||||
import { formatTimecode } from '../viewers/utils'
|
||||
import { useUiStore } from '@/ui/stores/ui'
|
||||
|
||||
type UploadingFile = {
|
||||
id: string // A unique ID for the file, e.g., timestamp + name
|
||||
@@ -54,6 +55,7 @@ interface ChatInputProps {
|
||||
disableMentions?: boolean
|
||||
currentTime?: number
|
||||
frameRate?: number
|
||||
startTimecode?: string
|
||||
onTyping?: () => void
|
||||
}
|
||||
|
||||
@@ -84,6 +86,7 @@ export const ChatInput = React.forwardRef<HTMLDivElement, ChatInputProps>(
|
||||
disableMentions = false,
|
||||
currentTime,
|
||||
frameRate,
|
||||
startTimecode,
|
||||
onTyping,
|
||||
},
|
||||
ref,
|
||||
@@ -92,6 +95,13 @@ export const ChatInput = React.forwardRef<HTMLDivElement, ChatInputProps>(
|
||||
const [viewingFile, setViewingFile] = useState<File | null>(null)
|
||||
const [isTimestampEnabled, setIsTimestampEnabled] = useState(true)
|
||||
|
||||
const { videoTimeDisplayMode } = useUiStore()
|
||||
const displayTime = React.useMemo(() => {
|
||||
if (currentTime === undefined || !frameRate) return ''
|
||||
const frameIndex = Math.round(currentTime * frameRate)
|
||||
return formatTimecode(frameIndex, frameRate, videoTimeDisplayMode, startTimecode)
|
||||
}, [currentTime, frameRate, videoTimeDisplayMode, startTimecode])
|
||||
|
||||
const { teamId, ensureTeamIdForProject } = useTeamContextStore()
|
||||
const { members: storeMembers, loading: membersLoading, fetchMembers } = useMemberStore()
|
||||
|
||||
@@ -123,6 +133,16 @@ export const ChatInput = React.forwardRef<HTMLDivElement, ChatInputProps>(
|
||||
const [collapsedSections, setCollapsedSections] = useState({ bots: false, users: false })
|
||||
const [hasContent, setHasContent] = useState(false)
|
||||
|
||||
const paddingLeftClass = React.useMemo(() => {
|
||||
if (!isTimestampEnabled || currentTime === undefined || !frameRate || hasContent) {
|
||||
return ''
|
||||
}
|
||||
if (videoTimeDisplayMode === 'timecode') {
|
||||
return 'pl-[120px]'
|
||||
}
|
||||
return 'pl-[85px]'
|
||||
}, [isTimestampEnabled, currentTime, frameRate, hasContent, videoTimeDisplayMode])
|
||||
|
||||
const editorRef = useRef<HTMLDivElement>(null)
|
||||
const fileInputRef = useRef<HTMLInputElement>(null)
|
||||
const mentionRangeRef = useRef<Range | null>(null)
|
||||
@@ -645,7 +665,7 @@ export const ChatInput = React.forwardRef<HTMLDivElement, ChatInputProps>(
|
||||
}}
|
||||
className="float-left select-none bg-blue-100 dark:bg-blue-900/40 text-blue-600 dark:text-blue-300 px-2.5 py-0.5 mt-3 mr-2 rounded-sm text-xs font-mono font-bold flex items-center gap-1 cursor-text"
|
||||
>
|
||||
{formatTimestamp(currentTime, frameRate)}
|
||||
{displayTime}
|
||||
</div>
|
||||
)}
|
||||
<div
|
||||
@@ -655,7 +675,7 @@ export const ChatInput = React.forwardRef<HTMLDivElement, ChatInputProps>(
|
||||
onInput={handleInput}
|
||||
onKeyDown={handleKeyDown}
|
||||
data-placeholder={replyingTo ? 'Reply...' : 'Message...'}
|
||||
className={`bg-transparent border-none focus:ring-0 resize-none min-h-[40px] leading-relaxed py-2 focus:outline-none block ${isTimestampEnabled && currentTime !== undefined && frameRate !== undefined && !hasContent ? 'pl-[120px]' : ''}`}
|
||||
className={`bg-transparent border-none focus:ring-0 resize-none min-h-[40px] leading-relaxed py-2 focus:outline-none block ${paddingLeftClass}`}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -359,6 +359,11 @@ export function FileViewerRightSidebar({
|
||||
? file?.media?.metadata?.frameRate || 30
|
||||
: undefined
|
||||
}
|
||||
startTimecode={
|
||||
file?.mediaType?.startsWith('video/')
|
||||
? file?.media?.metadata?.startTimecode
|
||||
: undefined
|
||||
}
|
||||
isSelected={selectedCommentId === comment.id}
|
||||
onSelect={() => {
|
||||
onCommentSelect?.(comment)
|
||||
@@ -380,6 +385,11 @@ export function FileViewerRightSidebar({
|
||||
? file?.media?.metadata?.frameRate || 30
|
||||
: undefined
|
||||
}
|
||||
startTimecode={
|
||||
file?.mediaType?.startsWith('video/')
|
||||
? file?.media?.metadata?.startTimecode
|
||||
: undefined
|
||||
}
|
||||
isSelected={selectedCommentId === reply.id}
|
||||
onSelect={() => {
|
||||
onCommentSelect?.(reply)
|
||||
@@ -413,6 +423,11 @@ export function FileViewerRightSidebar({
|
||||
? file?.media?.metadata?.frameRate || 30
|
||||
: undefined
|
||||
}
|
||||
startTimecode={
|
||||
file?.mediaType?.startsWith('video/')
|
||||
? file?.media?.metadata?.startTimecode
|
||||
: undefined
|
||||
}
|
||||
onTyping={onTyping}
|
||||
/>
|
||||
</GuestIdentityPopup>
|
||||
|
||||
@@ -15,17 +15,19 @@ const formatTime = (seconds: number): string => {
|
||||
}
|
||||
|
||||
interface ProgressBarProps {
|
||||
duration: number
|
||||
currentTime: number
|
||||
totalFrames: number
|
||||
currentFrame: number
|
||||
fps: number
|
||||
previewUrl?: string
|
||||
onSeek: (time: number) => void
|
||||
onSeek: (frame: number) => void
|
||||
buffered?: number
|
||||
metadata?: MediaMetadata
|
||||
}
|
||||
|
||||
const ProgressBar: React.FC<ProgressBarProps> = ({
|
||||
duration,
|
||||
currentTime,
|
||||
totalFrames,
|
||||
currentFrame,
|
||||
fps,
|
||||
previewUrl,
|
||||
onSeek,
|
||||
buffered = 0,
|
||||
@@ -68,16 +70,17 @@ const ProgressBar: React.FC<ProgressBarProps> = ({
|
||||
setHoverPosition(percentage)
|
||||
setIsHovering(true)
|
||||
|
||||
if (previewVideoRef.current && duration) {
|
||||
const seekTime = percentage * duration
|
||||
// Use fastSeek if available for smoother scrubbing, otherwise currentTime
|
||||
if (previewVideoRef.current && totalFrames) {
|
||||
const targetFrame = percentage * totalFrames
|
||||
const frameDuration = 1 / fps
|
||||
const seekTime = targetFrame * frameDuration + frameDuration / 2
|
||||
const vid = previewVideoRef.current
|
||||
if (Number.isFinite(seekTime)) {
|
||||
vid.currentTime = seekTime
|
||||
}
|
||||
}
|
||||
},
|
||||
[duration, isDragging],
|
||||
[totalFrames, fps, isDragging],
|
||||
)
|
||||
|
||||
const handleMouseLeave = () => {
|
||||
@@ -94,7 +97,7 @@ const ProgressBar: React.FC<ProgressBarProps> = ({
|
||||
const percentage = getPercentageFromEvent(e.clientX)
|
||||
setHoverPosition(percentage)
|
||||
setIsHovering(true)
|
||||
onSeekRef.current(percentage * duration)
|
||||
onSeekRef.current(percentage * totalFrames)
|
||||
}
|
||||
|
||||
const handleTouchStart = (e: React.TouchEvent<HTMLDivElement>) => {
|
||||
@@ -102,7 +105,7 @@ const ProgressBar: React.FC<ProgressBarProps> = ({
|
||||
const percentage = getPercentageFromEvent(e.touches[0].clientX)
|
||||
setHoverPosition(percentage)
|
||||
setIsHovering(true)
|
||||
onSeekRef.current(percentage * duration)
|
||||
onSeekRef.current(percentage * totalFrames)
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
@@ -113,15 +116,17 @@ const ProgressBar: React.FC<ProgressBarProps> = ({
|
||||
setHoverPosition(percentage)
|
||||
setIsHovering(true)
|
||||
|
||||
if (previewVideoRef.current && duration) {
|
||||
const seekTime = percentage * duration
|
||||
if (previewVideoRef.current && totalFrames) {
|
||||
const targetFrame = percentage * totalFrames
|
||||
const frameDuration = 1 / fps
|
||||
const seekTime = targetFrame * frameDuration + frameDuration / 2
|
||||
const vid = previewVideoRef.current
|
||||
if (Number.isFinite(seekTime)) {
|
||||
vid.currentTime = seekTime
|
||||
}
|
||||
}
|
||||
|
||||
onSeekRef.current(percentage * duration)
|
||||
onSeekRef.current(percentage * totalFrames)
|
||||
}
|
||||
|
||||
const handleWindowMouseUp = (e: MouseEvent) => {
|
||||
@@ -143,7 +148,7 @@ const ProgressBar: React.FC<ProgressBarProps> = ({
|
||||
}
|
||||
|
||||
const percentage = getPercentageFromEvent(e.clientX)
|
||||
onSeekRef.current(percentage * duration)
|
||||
onSeekRef.current(percentage * totalFrames)
|
||||
}
|
||||
|
||||
const handleWindowTouchMove = (e: TouchEvent) => {
|
||||
@@ -152,15 +157,17 @@ const ProgressBar: React.FC<ProgressBarProps> = ({
|
||||
setHoverPosition(percentage)
|
||||
setIsHovering(true)
|
||||
|
||||
if (previewVideoRef.current && duration) {
|
||||
const seekTime = percentage * duration
|
||||
if (previewVideoRef.current && totalFrames) {
|
||||
const targetFrame = percentage * totalFrames
|
||||
const frameDuration = 1 / fps
|
||||
const seekTime = targetFrame * frameDuration + frameDuration / 2
|
||||
const vid = previewVideoRef.current
|
||||
if (Number.isFinite(seekTime)) {
|
||||
vid.currentTime = seekTime
|
||||
}
|
||||
}
|
||||
|
||||
onSeekRef.current(percentage * duration)
|
||||
onSeekRef.current(percentage * totalFrames)
|
||||
}
|
||||
|
||||
const handleWindowTouchEnd = (e: TouchEvent) => {
|
||||
@@ -186,7 +193,7 @@ const ProgressBar: React.FC<ProgressBarProps> = ({
|
||||
|
||||
if (clientX !== null) {
|
||||
const percentage = getPercentageFromEvent(clientX)
|
||||
onSeekRef.current(percentage * duration)
|
||||
onSeekRef.current(percentage * totalFrames)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,21 +208,17 @@ const ProgressBar: React.FC<ProgressBarProps> = ({
|
||||
window.removeEventListener('touchmove', handleWindowTouchMove)
|
||||
window.removeEventListener('touchend', handleWindowTouchEnd)
|
||||
}
|
||||
}, [isDragging, duration, getPercentageFromEvent])
|
||||
}, [isDragging, totalFrames, fps, getPercentageFromEvent])
|
||||
|
||||
const progressPercent =
|
||||
isDragging && hoverPosition !== null
|
||||
? hoverPosition * 100
|
||||
: duration > 0
|
||||
? (currentTime / duration) * 100
|
||||
: totalFrames > 0
|
||||
? (currentFrame / totalFrames) * 100
|
||||
: 0
|
||||
const hoverPercent = hoverPosition !== null ? hoverPosition * 100 : 0
|
||||
|
||||
// Calculate preview tooltip position
|
||||
// Logic: Interpolate translation based on position to keep preview fully visible
|
||||
// 0% -> translateX(0%) (Left aligned)
|
||||
// 50% -> translateX(-50%) (Center aligned)
|
||||
// 100% -> translateX(-100%) (Right aligned)
|
||||
const getTooltipStyle = () => {
|
||||
if (hoverPosition === null) return {}
|
||||
return {
|
||||
@@ -271,7 +274,7 @@ const ProgressBar: React.FC<ProgressBarProps> = ({
|
||||
/>
|
||||
|
||||
{/* Hover Preview Tooltip */}
|
||||
{isHovering && duration > 0 && (
|
||||
{isHovering && totalFrames > 0 && (
|
||||
<div
|
||||
className="pointer-events-none absolute bottom-full z-50 mb-3 flex w-max flex-col"
|
||||
style={getTooltipStyle()}
|
||||
@@ -289,7 +292,7 @@ const ProgressBar: React.FC<ProgressBarProps> = ({
|
||||
}}
|
||||
/>
|
||||
<div className="absolute bottom-0 w-full bg-popover/80 py-0.5 text-center text-xs font-medium text-popover-foreground">
|
||||
{formatTime(hoverPosition! * duration)}
|
||||
{formatTime((hoverPosition! * totalFrames) / fps)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,281 @@
|
||||
import React, { useState, useEffect, useRef, useCallback } from 'react'
|
||||
import { calculateFrameCenterTime } from './utils'
|
||||
|
||||
export interface UseFramePlayerResult {
|
||||
currentFrame: number
|
||||
setCurrentFrame: React.Dispatch<React.SetStateAction<number>>
|
||||
seekToFrame: (targetFrame: number) => Promise<void>
|
||||
isSeeking: React.RefObject<boolean>
|
||||
}
|
||||
|
||||
interface HtmlVideoElementWithCallback {
|
||||
requestVideoFrameCallback?: (
|
||||
callback: (now: DOMHighResTimeStamp, metadata: { mediaTime: number }) => void,
|
||||
) => number
|
||||
cancelVideoFrameCallback?: (id: number) => void
|
||||
}
|
||||
|
||||
export function useFramePlayer(
|
||||
videoRef: React.RefObject<HTMLVideoElement | null>,
|
||||
frameRate: number,
|
||||
totalFrames: number,
|
||||
): UseFramePlayerResult {
|
||||
const [currentFrame, setCurrentFrame] = useState<number>(0)
|
||||
const isSeekingRef = useRef<boolean>(false)
|
||||
const isPlayingRef = useRef<boolean>(false)
|
||||
const pendingSeekFrameRef = useRef<number | null>(null)
|
||||
const currentFrameRef = useRef<number>(currentFrame)
|
||||
currentFrameRef.current = currentFrame
|
||||
|
||||
// Track playing state of the HTML video element
|
||||
useEffect(() => {
|
||||
const video = videoRef.current
|
||||
if (!video) return
|
||||
|
||||
const handlePlay = () => {
|
||||
isPlayingRef.current = true
|
||||
}
|
||||
const handlePause = () => {
|
||||
isPlayingRef.current = false
|
||||
}
|
||||
|
||||
video.addEventListener('play', handlePlay)
|
||||
video.addEventListener('pause', handlePause)
|
||||
|
||||
// Initial check
|
||||
isPlayingRef.current = !video.paused
|
||||
|
||||
return () => {
|
||||
video.removeEventListener('play', handlePlay)
|
||||
video.removeEventListener('pause', handlePause)
|
||||
}
|
||||
}, [videoRef.current])
|
||||
|
||||
// Continuous frame updating loop during active playback
|
||||
useEffect(() => {
|
||||
const video = videoRef.current
|
||||
if (!video) return
|
||||
|
||||
let rVfcId: number | null = null
|
||||
let rafId: number | null = null
|
||||
let active = true
|
||||
|
||||
const updateFrameLoop = () => {
|
||||
if (!active) return
|
||||
|
||||
if (video.paused || video.ended) {
|
||||
return
|
||||
}
|
||||
|
||||
const videoWithCallback = video as unknown as HtmlVideoElementWithCallback
|
||||
if (videoWithCallback.requestVideoFrameCallback) {
|
||||
rVfcId = videoWithCallback.requestVideoFrameCallback(
|
||||
(_now: DOMHighResTimeStamp, metadata: { mediaTime: number }) => {
|
||||
const frame = Math.round(metadata.mediaTime * frameRate)
|
||||
const clamped = Math.max(0, Math.min(frame, totalFrames - 1))
|
||||
setCurrentFrame(clamped)
|
||||
// Continue the loop
|
||||
updateFrameLoop()
|
||||
},
|
||||
)
|
||||
} else {
|
||||
// Fallback for browsers without requestVideoFrameCallback
|
||||
const frame = Math.round(video.currentTime * frameRate)
|
||||
const clamped = Math.max(0, Math.min(frame, totalFrames - 1))
|
||||
setCurrentFrame(clamped)
|
||||
rafId = requestAnimationFrame(updateFrameLoop)
|
||||
}
|
||||
}
|
||||
|
||||
const handlePlay = () => {
|
||||
updateFrameLoop()
|
||||
}
|
||||
|
||||
const handlePause = () => {
|
||||
if (rVfcId !== null) {
|
||||
const videoWithCallback = video as unknown as HtmlVideoElementWithCallback
|
||||
if (videoWithCallback.cancelVideoFrameCallback) {
|
||||
try {
|
||||
videoWithCallback.cancelVideoFrameCallback(rVfcId)
|
||||
} catch {
|
||||
// Ignore error during cancellation
|
||||
}
|
||||
}
|
||||
rVfcId = null
|
||||
}
|
||||
if (rafId !== null) {
|
||||
cancelAnimationFrame(rafId)
|
||||
rafId = null
|
||||
}
|
||||
|
||||
// Synchronize frame on pause
|
||||
const frame = Math.round(video.currentTime * frameRate)
|
||||
const clamped = Math.max(0, Math.min(frame, totalFrames - 1))
|
||||
setCurrentFrame(clamped)
|
||||
}
|
||||
|
||||
video.addEventListener('play', handlePlay)
|
||||
video.addEventListener('pause', handlePause)
|
||||
|
||||
// If it's already playing when this effect runs
|
||||
if (!video.paused) {
|
||||
updateFrameLoop()
|
||||
}
|
||||
|
||||
return () => {
|
||||
active = false
|
||||
video.removeEventListener('play', handlePlay)
|
||||
video.removeEventListener('pause', handlePause)
|
||||
if (rVfcId !== null) {
|
||||
const videoWithCallback = video as unknown as HtmlVideoElementWithCallback
|
||||
if (videoWithCallback.cancelVideoFrameCallback) {
|
||||
try {
|
||||
videoWithCallback.cancelVideoFrameCallback(rVfcId)
|
||||
} catch {
|
||||
// Ignore error during cancellation
|
||||
}
|
||||
}
|
||||
}
|
||||
if (rafId !== null) {
|
||||
cancelAnimationFrame(rafId)
|
||||
}
|
||||
}
|
||||
}, [videoRef.current, frameRate, totalFrames])
|
||||
|
||||
const seekToFrame = useCallback(
|
||||
async (targetFrame: number) => {
|
||||
const video = videoRef.current
|
||||
if (!video) return
|
||||
|
||||
const roundedFrame = Math.round(targetFrame)
|
||||
const clampedFrame = Math.max(0, Math.min(roundedFrame, totalFrames - 1))
|
||||
|
||||
// If a seek is already active, queue this target and update UI state optimistically
|
||||
if (isSeekingRef.current) {
|
||||
pendingSeekFrameRef.current = clampedFrame
|
||||
setCurrentFrame(clampedFrame)
|
||||
return
|
||||
}
|
||||
|
||||
isSeekingRef.current = true
|
||||
setCurrentFrame(clampedFrame) // Optimistic update for active seek
|
||||
|
||||
const performSeek = async (frameToSeek: number) => {
|
||||
const safeTargetTime = calculateFrameCenterTime(frameToSeek, frameRate)
|
||||
const wasPlaying = !video.paused
|
||||
|
||||
video.currentTime = safeTargetTime
|
||||
|
||||
// Wait for native seek to complete (with a 500ms fallback timeout to prevent hanging)
|
||||
await new Promise<void>((resolve) => {
|
||||
let timeoutId: ReturnType<typeof setTimeout> | null = null
|
||||
const onSeeked = () => {
|
||||
if (timeoutId) clearTimeout(timeoutId)
|
||||
video.removeEventListener('seeked', onSeeked)
|
||||
resolve()
|
||||
}
|
||||
video.addEventListener('seeked', onSeeked)
|
||||
timeoutId = setTimeout(() => {
|
||||
video.removeEventListener('seeked', onSeeked)
|
||||
resolve()
|
||||
}, 500)
|
||||
})
|
||||
|
||||
// Pause only if we started paused and the user hasn't pressed play in the meantime
|
||||
if (!wasPlaying && !isPlayingRef.current) {
|
||||
video.pause()
|
||||
}
|
||||
|
||||
// Seek complete: update frame immediately using Math.floor (accounts for half-frame offset)
|
||||
const actualFrame = Math.floor(video.currentTime * frameRate)
|
||||
const finalFrame = Math.max(0, Math.min(actualFrame, totalFrames - 1))
|
||||
setCurrentFrame(finalFrame)
|
||||
|
||||
// Verify with requestVideoFrameCallback in the background (non-blocking)
|
||||
const videoWithCallback = video as unknown as HtmlVideoElementWithCallback
|
||||
if (videoWithCallback.requestVideoFrameCallback) {
|
||||
videoWithCallback.requestVideoFrameCallback((_now, metadata) => {
|
||||
const compositorFrame = Math.round(metadata.mediaTime * frameRate)
|
||||
const verifiedFrame = Math.max(0, Math.min(compositorFrame, totalFrames - 1))
|
||||
setCurrentFrame(verifiedFrame)
|
||||
})
|
||||
}
|
||||
|
||||
// Process next seek in the queue if any came in during the seek
|
||||
if (pendingSeekFrameRef.current !== null) {
|
||||
const nextFrame = pendingSeekFrameRef.current
|
||||
pendingSeekFrameRef.current = null
|
||||
await performSeek(nextFrame)
|
||||
} else {
|
||||
isSeekingRef.current = false
|
||||
}
|
||||
}
|
||||
|
||||
await performSeek(clampedFrame)
|
||||
},
|
||||
[videoRef, frameRate, totalFrames],
|
||||
)
|
||||
|
||||
// Keyboard Shortcuts Keydown Listener
|
||||
useEffect(() => {
|
||||
const handleKeyDown = (e: KeyboardEvent) => {
|
||||
const target = e.target as HTMLElement
|
||||
if (
|
||||
target instanceof HTMLInputElement ||
|
||||
target instanceof HTMLTextAreaElement ||
|
||||
target.isContentEditable
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
if (e.key === 'ArrowRight') {
|
||||
e.preventDefault()
|
||||
const delta = e.shiftKey ? 10 : 1
|
||||
seekToFrame(currentFrameRef.current + delta)
|
||||
} else if (e.key === 'ArrowLeft') {
|
||||
e.preventDefault()
|
||||
const delta = e.shiftKey ? 10 : 1
|
||||
seekToFrame(currentFrameRef.current - delta)
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('keydown', handleKeyDown)
|
||||
return () => {
|
||||
window.removeEventListener('keydown', handleKeyDown)
|
||||
}
|
||||
}, [seekToFrame])
|
||||
|
||||
// Listen to external seeks (like comment clicks or VideoJS timeline clicks)
|
||||
useEffect(() => {
|
||||
const video = videoRef.current
|
||||
if (!video) return
|
||||
|
||||
const handleExternalSeeked = () => {
|
||||
// Only sync if this seek was not triggered internally by seekToFrame
|
||||
if (!isSeekingRef.current) {
|
||||
const actualFrame = Math.round(video.currentTime * frameRate)
|
||||
const finalFrame = Math.max(0, Math.min(actualFrame, totalFrames - 1))
|
||||
setCurrentFrame(finalFrame)
|
||||
|
||||
// Nudge to safe frame center to guarantee correct browser decoding
|
||||
const safeCenterTime = calculateFrameCenterTime(finalFrame, frameRate)
|
||||
const frameDuration = 1 / frameRate
|
||||
if (Math.abs(video.currentTime - safeCenterTime) > frameDuration / 4) {
|
||||
video.currentTime = safeCenterTime
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
video.addEventListener('seeked', handleExternalSeeked)
|
||||
return () => {
|
||||
video.removeEventListener('seeked', handleExternalSeeked)
|
||||
}
|
||||
}, [videoRef.current, frameRate, totalFrames])
|
||||
|
||||
return {
|
||||
currentFrame,
|
||||
setCurrentFrame,
|
||||
seekToFrame,
|
||||
isSeeking: isSeekingRef,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { formatTimecode, calculateFrameCenterTime } from './utils'
|
||||
|
||||
describe('formatTimecode tests', () => {
|
||||
describe('non-drop-frame calculations', () => {
|
||||
it('formats non-drop-frame correctly at 25 fps', () => {
|
||||
// 2999 frames at 25 fps => 00:01:59:24
|
||||
expect(formatTimecode(2999, 25, 'timecode')).toBe('00:01:59:24')
|
||||
// 3000 frames at 25 fps => 00:02:00:00
|
||||
expect(formatTimecode(3000, 25, 'timecode')).toBe('00:02:00:00')
|
||||
// 15000 frames at 25 fps => 00:10:00:00
|
||||
expect(formatTimecode(15000, 25, 'timecode')).toBe('00:10:00:00')
|
||||
// 900000 frames at 25 fps => 10:00:00:00
|
||||
expect(formatTimecode(900000, 25, 'timecode')).toBe('10:00:00:00')
|
||||
})
|
||||
})
|
||||
|
||||
describe('drop-frame calculations', () => {
|
||||
it('formats drop-frame correctly at 29.97 fps', () => {
|
||||
// 3597 frames at 29.97 fps => 00:01:59;29
|
||||
expect(formatTimecode(3597, 29.97, 'timecode')).toBe('00:01:59;29')
|
||||
// 17982 frames at 29.97 fps => 00:10:00;00
|
||||
expect(formatTimecode(17982, 29.97, 'timecode')).toBe('00:10:00;00')
|
||||
// 1078920 frames at 29.97 fps => 10:00:00;00
|
||||
expect(formatTimecode(1078920, 29.97, 'timecode')).toBe('10:00:00;00')
|
||||
})
|
||||
|
||||
it('formats drop-frame correctly at 59.94 fps', () => {
|
||||
// 3597 * 2 + 1 = 7195 frames at 59.94 fps => 00:01:59;59
|
||||
expect(formatTimecode(7195, 59.94, 'timecode')).toBe('00:01:59;59')
|
||||
// 17982 * 2 = 35964 frames at 59.94 fps => 00:10:00;00
|
||||
expect(formatTimecode(35964, 59.94, 'timecode')).toBe('00:10:00;00')
|
||||
// 1078920 * 2 = 2157840 frames at 59.94 fps => 10:00:00;00
|
||||
expect(formatTimecode(2157840, 59.94, 'timecode')).toBe('10:00:00;00')
|
||||
})
|
||||
})
|
||||
|
||||
describe('starting timecode offsets', () => {
|
||||
it('offsets timecode correctly based on startTimecode string', () => {
|
||||
// 0 frames at 29.97 fps with start '01:00:00:00' => 01:00:00:00
|
||||
expect(formatTimecode(0, 29.97, 'timecode', '01:00:00:00')).toBe('01:00:00:00')
|
||||
// 0 frames at 29.97 fps with start '01:00:00;00' => 01:00:00;00
|
||||
expect(formatTimecode(0, 29.97, 'timecode', '01:00:00;00')).toBe('01:00:00;00')
|
||||
// 30 frames at 30 fps with start '01:00:00:00' => 01:00:01:00
|
||||
expect(formatTimecode(30, 30, 'timecode', '01:00:00:00')).toBe('01:00:01:00')
|
||||
})
|
||||
})
|
||||
|
||||
describe('other display modes', () => {
|
||||
it('formats as frames index', () => {
|
||||
expect(formatTimecode(150, 30, 'frames')).toBe('150 fr')
|
||||
})
|
||||
|
||||
it('formats as standard MM:SS time', () => {
|
||||
expect(formatTimecode(150, 30, 'standard')).toBe('00:05')
|
||||
})
|
||||
})
|
||||
|
||||
describe('calculateFrameCenterTime tests', () => {
|
||||
it('calculates frame center time correctly', () => {
|
||||
// frame 0 at 30 fps => 0 * 1/30 + 1/60 = 1/60 = 0.0166666...
|
||||
expect(calculateFrameCenterTime(0, 30)).toBeCloseTo(0.0166666, 5)
|
||||
// frame 251 at 30 fps => 251 * 1/30 + 1/60 = 251.5 / 30 = 8.3833333...
|
||||
expect(calculateFrameCenterTime(251, 30)).toBeCloseTo(8.3833333, 5)
|
||||
// frame rate 0 returns 0
|
||||
expect(calculateFrameCenterTime(10, 0)).toBe(0)
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -2,25 +2,95 @@ export const formatTime = (seconds: number): string => {
|
||||
if (isNaN(seconds)) return '00:00'
|
||||
const date = new Date(seconds * 1000)
|
||||
const hh = date.getUTCHours()
|
||||
const mm = date.getUTCMinutes()
|
||||
const mm = date.getUTCMinutes().toString().padStart(2, '0')
|
||||
const ss = date.getUTCSeconds().toString().padStart(2, '0')
|
||||
if (hh) {
|
||||
return `${hh}:${mm.toString().padStart(2, '0')}:${ss}`
|
||||
return `${hh}:${mm}:${ss}`
|
||||
}
|
||||
return `${mm}:${ss}`
|
||||
}
|
||||
|
||||
export const formatTimecode = (
|
||||
frameIndex: number,
|
||||
frameRate: number,
|
||||
mode: 'standard' | 'frames' | 'timecode',
|
||||
startTimecode?: string | null,
|
||||
): string => {
|
||||
if (mode === 'frames') {
|
||||
return `${frameIndex} fr`
|
||||
}
|
||||
|
||||
if (mode === 'standard') {
|
||||
return formatTime(frameIndex / frameRate)
|
||||
}
|
||||
|
||||
// Determine if drop-frame should be used (standard for NTSC 29.97 and 59.94)
|
||||
const frameRateRound = Math.round(frameRate)
|
||||
const isFractional = frameRate !== frameRateRound
|
||||
let dropFrame = false
|
||||
if (isFractional && (frameRateRound === 30 || frameRateRound === 60)) {
|
||||
dropFrame = true
|
||||
}
|
||||
|
||||
// Parse start timecode if provided
|
||||
let startFrameCount = 0
|
||||
if (startTimecode) {
|
||||
const parts = startTimecode.match(/^([012]\d):(\d\d):(\d\d)(:|;|\.)(\d+)$/)
|
||||
if (parts) {
|
||||
const hours = parseInt(parts[1], 10)
|
||||
const minutes = parseInt(parts[2], 10)
|
||||
const seconds = parseInt(parts[3], 10)
|
||||
const frames = parseInt(parts[5], 10)
|
||||
|
||||
// Timecode string format overrides the default dropFrame setting
|
||||
dropFrame = parts[4] !== ':'
|
||||
|
||||
// Calculate frame count from timecode
|
||||
startFrameCount = (hours * 3600 + minutes * 60 + seconds) * frameRateRound + frames
|
||||
if (dropFrame) {
|
||||
const totalMinutes = hours * 60 + minutes
|
||||
const df = frameRate < 30 ? 2 : 4
|
||||
startFrameCount -= df * (totalMinutes - Math.floor(totalMinutes / 10))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate absolute frame count
|
||||
let fc = frameIndex + startFrameCount
|
||||
|
||||
// Convert frame count to timecode using the exact smpte-timecode formula
|
||||
if (dropFrame) {
|
||||
const df = frameRate < 30 ? 2 : 4
|
||||
const d = Math.floor(fc / ((17982 * df) / 2))
|
||||
let m = fc % ((17982 * df) / 2)
|
||||
if (m < df) {
|
||||
m = m + df
|
||||
}
|
||||
fc += 9 * df * d + df * Math.floor((m - df) / ((1798 * df) / 2))
|
||||
}
|
||||
|
||||
const frames = fc % frameRateRound
|
||||
const seconds = Math.floor(fc / frameRateRound) % 60
|
||||
const minutes = Math.floor(fc / (frameRateRound * 60)) % 60
|
||||
const hours = Math.floor(fc / (frameRateRound * 3600)) % 24
|
||||
|
||||
const separator = dropFrame ? ';' : ':'
|
||||
return `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}${separator}${frames.toString().padStart(2, '0')}`
|
||||
}
|
||||
|
||||
export const formatTimestamp = (seconds: number, fps: number): string => {
|
||||
if (isNaN(seconds)) return '00:00:00:00'
|
||||
const hh = Math.floor(seconds / 3600)
|
||||
const mm = Math.floor((seconds % 3600) / 60)
|
||||
const ss = Math.floor(seconds % 60)
|
||||
const ff = Math.floor((seconds % 1) * fps)
|
||||
|
||||
return `${hh.toString().padStart(2, '0')}:${mm.toString().padStart(2, '0')}:${ss.toString().padStart(2, '0')}:${ff.toString().padStart(2, '0')}`
|
||||
const frameIndex = Math.round(seconds * fps)
|
||||
return formatTimecode(frameIndex, fps, 'timecode')
|
||||
}
|
||||
|
||||
export const formatFrame = (seconds: number, fps: number): number => {
|
||||
if (isNaN(seconds) || !fps) return 0
|
||||
return Math.floor(seconds * fps)
|
||||
}
|
||||
|
||||
export const calculateFrameCenterTime = (frameIndex: number, frameRate: number): number => {
|
||||
if (!frameRate) return 0
|
||||
const frameDuration = 1 / frameRate
|
||||
return frameIndex * frameDuration + frameDuration / 2
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import type { AssetInfo, VideoTranscode } from '@shumai/dtos'
|
||||
import { cn } from '@/ui/lib/utils'
|
||||
import {
|
||||
Check,
|
||||
ChevronDown,
|
||||
Download,
|
||||
Maximize,
|
||||
Minimize,
|
||||
@@ -25,7 +27,9 @@ import {
|
||||
} from '../ui/dropdown-menu'
|
||||
import { Slider } from '../ui/slider'
|
||||
import ProgressBar from './progress-bar'
|
||||
import { formatFrame, formatTime } from './utils'
|
||||
import { formatTimecode } from './utils'
|
||||
import { useFramePlayer } from './use-frame-player'
|
||||
import { useUiStore } from '@/ui/stores/ui'
|
||||
|
||||
import type { Annotation } from '@/ui/types'
|
||||
import DrawingCanvas from '../drawing-canvas'
|
||||
@@ -68,15 +72,18 @@ interface ControlBarProps {
|
||||
resolutions: DisplayTranscode[]
|
||||
togglePlay: () => void
|
||||
toggleLoop: () => void
|
||||
handleSeek: (time: number) => void
|
||||
toggleMute: () => void
|
||||
handleVolumeChange: (newVolume: number) => void
|
||||
setState: React.Dispatch<React.SetStateAction<PlayerState>>
|
||||
changePlaybackRate: (rate: number) => void
|
||||
changeResolution: (res: DisplayTranscode) => void
|
||||
handleDownload: (url: string, resolution: string) => void
|
||||
toggleFullScreen: () => void
|
||||
onZoomChange: (zoom: number) => void
|
||||
// Frame-accurate props
|
||||
frameRate: number
|
||||
totalFrames: number
|
||||
currentFrame: number
|
||||
seekToFrame: (frame: number) => Promise<void>
|
||||
}
|
||||
|
||||
const ControlBar: React.FC<ControlBarProps> = ({
|
||||
@@ -88,15 +95,17 @@ const ControlBar: React.FC<ControlBarProps> = ({
|
||||
resolutions,
|
||||
togglePlay,
|
||||
toggleLoop,
|
||||
handleSeek,
|
||||
toggleMute,
|
||||
handleVolumeChange,
|
||||
setState,
|
||||
changePlaybackRate,
|
||||
changeResolution,
|
||||
handleDownload,
|
||||
toggleFullScreen,
|
||||
onZoomChange,
|
||||
frameRate,
|
||||
totalFrames,
|
||||
currentFrame,
|
||||
seekToFrame,
|
||||
}) => {
|
||||
if (!data.media?.metadata) {
|
||||
return null
|
||||
@@ -104,6 +113,15 @@ const ControlBar: React.FC<ControlBarProps> = ({
|
||||
|
||||
const previewResolutions = resolutions.filter((r) => !r.isRaw)
|
||||
|
||||
const { videoTimeDisplayMode, setVideoTimeDisplayMode } = useUiStore()
|
||||
|
||||
const startTimecode = data.media?.metadata?.startTimecode
|
||||
const displayTotalFrames = Math.max(0, totalFrames - 1)
|
||||
const displayString =
|
||||
videoTimeDisplayMode === 'frames'
|
||||
? `${currentFrame} / ${displayTotalFrames} fr`
|
||||
: `${formatTimecode(currentFrame, frameRate, videoTimeDisplayMode, startTimecode)} / ${formatTimecode(displayTotalFrames, frameRate, videoTimeDisplayMode, startTimecode)}`
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
@@ -119,14 +137,15 @@ const ControlBar: React.FC<ControlBarProps> = ({
|
||||
{/* Progress Bar */}
|
||||
<div className="mb-4 px-1">
|
||||
<ProgressBar
|
||||
duration={state.duration}
|
||||
currentTime={state.currentTime}
|
||||
totalFrames={totalFrames}
|
||||
currentFrame={currentFrame}
|
||||
fps={frameRate}
|
||||
buffered={buffered}
|
||||
previewUrl={data.media.videoPreview?.url}
|
||||
onSeek={handleSeek}
|
||||
onSeek={seekToFrame}
|
||||
metadata={{
|
||||
...data.media.metadata,
|
||||
frameRate: data.media.metadata.frameRate || 30,
|
||||
frameRate: frameRate,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
@@ -180,17 +199,47 @@ const ControlBar: React.FC<ControlBarProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className="min-w-[100px] cursor-pointer text-sm font-medium tabular-nums hover:text-primary"
|
||||
onClick={() => setState((p) => ({ ...p, showFrames: !p.showFrames }))}
|
||||
title="Click to toggle Time/Frames"
|
||||
>
|
||||
{state.showFrames
|
||||
? `${formatFrame(state.currentTime, data.media.metadata.frameRate ?? 30)} / ${formatFrame(state.duration, data.media.metadata.frameRate ?? 30)}`
|
||||
: `${formatTime(state.currentTime)} / ${formatTime(state.duration)}`}
|
||||
<span className="ml-1 text-xs text-muted-foreground">
|
||||
{state.showFrames ? 'fr' : ''}
|
||||
</span>
|
||||
<div className="flex items-center gap-1 text-sm font-medium tabular-nums select-none min-w-[100px]">
|
||||
<span className="text-muted-foreground font-mono">{displayString}</span>
|
||||
<DropdownMenu modal={false}>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<button className="h-6 w-6 inline-flex items-center justify-center rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer focus:outline-none">
|
||||
<ChevronDown className="h-3.5 w-3.5" />
|
||||
</button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="start" className="w-40 z-30">
|
||||
<DropdownMenuLabel className="text-[10px] font-bold text-muted-foreground uppercase tracking-wider">
|
||||
Format
|
||||
</DropdownMenuLabel>
|
||||
<DropdownMenuItem
|
||||
onClick={() => setVideoTimeDisplayMode('standard')}
|
||||
className="flex items-center justify-between cursor-pointer text-xs"
|
||||
>
|
||||
<span>Standard Time</span>
|
||||
{videoTimeDisplayMode === 'standard' && (
|
||||
<Check className="h-3.5 w-3.5 text-primary" />
|
||||
)}
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem
|
||||
onClick={() => setVideoTimeDisplayMode('frames')}
|
||||
className="flex items-center justify-between cursor-pointer text-xs"
|
||||
>
|
||||
<span>Frames</span>
|
||||
{videoTimeDisplayMode === 'frames' && (
|
||||
<Check className="h-3.5 w-3.5 text-primary" />
|
||||
)}
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem
|
||||
onClick={() => setVideoTimeDisplayMode('timecode')}
|
||||
className="flex items-center justify-between cursor-pointer text-xs"
|
||||
>
|
||||
<span>Timecode</span>
|
||||
{videoTimeDisplayMode === 'timecode' && (
|
||||
<Check className="h-3.5 w-3.5 text-primary" />
|
||||
)}
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -323,6 +372,7 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
|
||||
const controlsTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null)
|
||||
|
||||
const [videoHtmlEl, setVideoHtmlEl] = useState<HTMLVideoElement | undefined>(undefined)
|
||||
const videoRef = useRef<HTMLVideoElement | null>(null)
|
||||
const [zoom, setZoom] = useState(1)
|
||||
const [containerSize, setContainerSize] = useState({ width: 0, height: 0 })
|
||||
|
||||
@@ -369,6 +419,13 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
|
||||
}
|
||||
}, [containerSize.width, containerSize.height, data.media?.metadata])
|
||||
|
||||
// Cleanup ref when player is disposed
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
videoRef.current = null
|
||||
}
|
||||
}, [])
|
||||
|
||||
if (!data.media?.original?.downloadUrl || !data.media.metadata) {
|
||||
return (
|
||||
<div className="flex h-full w-full items-center justify-center">
|
||||
@@ -446,6 +503,32 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
|
||||
|
||||
const [buffered, setBuffered] = useState(0)
|
||||
const [isControlsVisible, setIsControlsVisible] = useState(true)
|
||||
const [isPlayerReady, setIsPlayerReady] = useState(false)
|
||||
const lastProcessedStartTimeRef = useRef<number | null>(null)
|
||||
|
||||
// Frame-accurate hook and derived state
|
||||
const metadata = data.media.metadata
|
||||
const frameRate = metadata.frameRate || 30
|
||||
const totalFrames = metadata.totalFrames || 0
|
||||
const { currentFrame, seekToFrame } = useFramePlayer(videoRef, frameRate, totalFrames)
|
||||
|
||||
const currentTime = currentFrame / frameRate
|
||||
const duration = totalFrames / frameRate
|
||||
const progress = duration > 0 ? (currentTime / duration) * 100 : 0
|
||||
|
||||
const controlBarState: PlayerState = {
|
||||
...state,
|
||||
currentTime,
|
||||
duration,
|
||||
progress,
|
||||
}
|
||||
|
||||
// Trigger time update event reactively
|
||||
useEffect(() => {
|
||||
if (onTimeUpdate) {
|
||||
onTimeUpdate(currentFrame / frameRate)
|
||||
}
|
||||
}, [currentFrame, frameRate, onTimeUpdate])
|
||||
|
||||
// Initialize Video.js
|
||||
useEffect(() => {
|
||||
@@ -481,12 +564,16 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
|
||||
const htmlVid = videoElement.querySelector('video')
|
||||
if (htmlVid) {
|
||||
setVideoHtmlEl(htmlVid)
|
||||
videoRef.current = htmlVid
|
||||
} else {
|
||||
// Fallback: try player.tech().el()
|
||||
// Wait for ready?
|
||||
player.ready(() => {
|
||||
const techEl = player.tech({ iWillNotUseThisInPlugins: true })?.el() as HTMLVideoElement
|
||||
if (techEl) setVideoHtmlEl(techEl)
|
||||
if (techEl) {
|
||||
setVideoHtmlEl(techEl)
|
||||
videoRef.current = techEl
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -499,32 +586,19 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
|
||||
onPause?.()
|
||||
})
|
||||
player.on('ended', () => setState((p) => ({ ...p, isPlaying: false })))
|
||||
player.on('loadedmetadata', () => {
|
||||
setIsPlayerReady(true)
|
||||
})
|
||||
player.on('loadstart', () => {
|
||||
setIsPlayerReady(false)
|
||||
})
|
||||
|
||||
player.on('timeupdate', () => {
|
||||
const current = player.currentTime() || 0
|
||||
const duration = player.duration() || data.media?.metadata?.duration || 0
|
||||
const playerDuration = player.duration() || data.media?.metadata?.duration || 0
|
||||
|
||||
const bufferedEnd = player.bufferedEnd()
|
||||
if (duration > 0) {
|
||||
setBuffered((bufferedEnd / duration) * 100)
|
||||
}
|
||||
|
||||
// Only update state here if the player is paused.
|
||||
// When playing, requestAnimationFrame handles smooth updates.
|
||||
if (player.paused()) {
|
||||
setState((prev) => {
|
||||
if (prev.currentTime === current) return prev
|
||||
return {
|
||||
...prev,
|
||||
currentTime: current,
|
||||
duration: duration || prev.duration,
|
||||
progress: duration > 0 ? (current / duration) * 100 : 0,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (onTimeUpdate) {
|
||||
onTimeUpdate(current)
|
||||
if (playerDuration > 0) {
|
||||
setBuffered((bufferedEnd / playerDuration) * 100)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -552,68 +626,28 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
|
||||
// Set initial state
|
||||
player.volume(state.volume)
|
||||
|
||||
// Seek to startTime if provided
|
||||
if (startTime && startTime > 0) {
|
||||
player.ready(() => {
|
||||
player.currentTime(startTime)
|
||||
})
|
||||
}
|
||||
|
||||
// 4. Cleanup
|
||||
return () => {
|
||||
if (player && !player.isDisposed()) {
|
||||
player.dispose()
|
||||
playerRef.current = null
|
||||
videoRef.current = null
|
||||
}
|
||||
}
|
||||
}, [data])
|
||||
|
||||
// Handle changes to startTime (e.g., clicking different chunks in search results)
|
||||
useEffect(() => {
|
||||
const player = playerRef.current
|
||||
if (player && startTime !== undefined && startTime !== null && startTime > 0) {
|
||||
// Only seek if the difference is significant (e.g., > 1s) to avoid jumping due to small precision differences
|
||||
const current = player.currentTime() || 0
|
||||
if (Math.abs(current - startTime) > 1) {
|
||||
player.currentTime(startTime)
|
||||
if (!isPlayerReady) return
|
||||
|
||||
if (startTime !== undefined && startTime !== null && startTime > 0) {
|
||||
if (startTime !== lastProcessedStartTimeRef.current) {
|
||||
lastProcessedStartTimeRef.current = startTime
|
||||
const targetFrame = Math.round(startTime * frameRate)
|
||||
seekToFrame(targetFrame)
|
||||
}
|
||||
}
|
||||
}, [startTime, playerRef])
|
||||
|
||||
// Smooth progress updates using requestAnimationFrame when playing
|
||||
useEffect(() => {
|
||||
let animationFrameId: number
|
||||
|
||||
const updateProgress = () => {
|
||||
const player = playerRef.current
|
||||
if (player && !player.paused()) {
|
||||
const current = player.currentTime() || 0
|
||||
const duration = player.duration() || data.media?.metadata?.duration || 0
|
||||
|
||||
setState((prev) => {
|
||||
if (prev.currentTime === current) return prev
|
||||
return {
|
||||
...prev,
|
||||
currentTime: current,
|
||||
duration: duration || prev.duration,
|
||||
progress: duration > 0 ? (current / duration) * 100 : 0,
|
||||
}
|
||||
})
|
||||
|
||||
animationFrameId = requestAnimationFrame(updateProgress)
|
||||
}
|
||||
}
|
||||
|
||||
if (state.isPlaying) {
|
||||
animationFrameId = requestAnimationFrame(updateProgress)
|
||||
}
|
||||
|
||||
return () => {
|
||||
if (animationFrameId) {
|
||||
cancelAnimationFrame(animationFrameId)
|
||||
}
|
||||
}
|
||||
}, [state.isPlaying, playerRef, data.media?.metadata?.duration])
|
||||
}, [startTime, frameRate, seekToFrame, isPlayerReady])
|
||||
|
||||
const handleMouseMove = useCallback(() => {
|
||||
// Always show controls on movement
|
||||
@@ -689,13 +723,6 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
|
||||
setState((prev) => ({ ...prev, isLooping: newLoop }))
|
||||
}
|
||||
|
||||
const handleSeek = (time: number) => {
|
||||
const player = playerRef.current
|
||||
if (!player) return
|
||||
player.currentTime(time)
|
||||
setState((prev) => ({ ...prev, currentTime: time }))
|
||||
}
|
||||
|
||||
const handleVolumeChange = (newVolume: number) => {
|
||||
// Optimistic update to prevent slider jumping and ensure immediate UI feedback
|
||||
setState((prev) => ({
|
||||
@@ -745,7 +772,7 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
|
||||
if (!player) return
|
||||
|
||||
const wasPlaying = !player.paused()
|
||||
const currentTime = player.currentTime()
|
||||
const currentT = player.currentTime()
|
||||
|
||||
setState((prev) => ({
|
||||
...prev,
|
||||
@@ -756,7 +783,7 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
|
||||
player.src({ type: 'video/mp4', src: res.url })
|
||||
|
||||
player.one('loadedmetadata', () => {
|
||||
player.currentTime(currentTime)
|
||||
player.currentTime(currentT)
|
||||
if (wasPlaying) {
|
||||
const playPromise = player.play()
|
||||
if (playPromise !== undefined) {
|
||||
@@ -871,7 +898,7 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
|
||||
</div>
|
||||
|
||||
<ControlBar
|
||||
state={state}
|
||||
state={controlBarState}
|
||||
zoom={zoom}
|
||||
isControlsVisible={isControlsVisible}
|
||||
buffered={buffered}
|
||||
@@ -879,15 +906,17 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
|
||||
resolutions={resolutions}
|
||||
togglePlay={togglePlay}
|
||||
toggleLoop={toggleLoop}
|
||||
handleSeek={handleSeek}
|
||||
toggleMute={toggleMute}
|
||||
handleVolumeChange={handleVolumeChange}
|
||||
setState={setState}
|
||||
changePlaybackRate={changePlaybackRate}
|
||||
changeResolution={changeResolution}
|
||||
handleDownload={handleDownload}
|
||||
toggleFullScreen={toggleFullScreen}
|
||||
onZoomChange={setZoom}
|
||||
frameRate={frameRate}
|
||||
totalFrames={totalFrames}
|
||||
currentFrame={currentFrame}
|
||||
seekToFrame={seekToFrame}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -22,6 +22,9 @@ interface UiState {
|
||||
|
||||
viewModes: { [projectId: string]: 'card' | 'list' }
|
||||
setViewMode: (projectId: string, mode: 'card' | 'list') => void
|
||||
|
||||
videoTimeDisplayMode: 'standard' | 'frames' | 'timecode'
|
||||
setVideoTimeDisplayMode: (mode: 'standard' | 'frames' | 'timecode') => void
|
||||
}
|
||||
|
||||
export const useUiStore = create<UiState>()(
|
||||
@@ -56,6 +59,9 @@ export const useUiStore = create<UiState>()(
|
||||
set((state) => ({
|
||||
viewModes: { ...state.viewModes, [projectId]: mode },
|
||||
})),
|
||||
|
||||
videoTimeDisplayMode: 'standard',
|
||||
setVideoTimeDisplayMode: (mode) => set({ videoTimeDisplayMode: mode }),
|
||||
}),
|
||||
{
|
||||
name: 'ui-storage',
|
||||
|
||||
Reference in New Issue
Block a user