mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-01 21:44:27 +00:00
feat(ai-usage): add team and member token usage tracking and APIs
This commit is contained in:
+95
-2
@@ -416,7 +416,8 @@ export const ModelName = {
|
||||
Model: 'Model',
|
||||
Provider: 'Provider',
|
||||
Collection: 'Collection',
|
||||
ApiToken: 'ApiToken'
|
||||
ApiToken: 'ApiToken',
|
||||
AiUsage: 'AiUsage'
|
||||
} as const
|
||||
|
||||
export type ModelName = (typeof ModelName)[keyof typeof ModelName]
|
||||
@@ -432,7 +433,7 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
omit: GlobalOmitOptions
|
||||
}
|
||||
meta: {
|
||||
modelProps: "user" | "session" | "account" | "verification" | "authToken" | "team" | "sandbox" | "skill" | "teamMember" | "project" | "projectMember" | "shareLink" | "asset" | "storageKey" | "assetMetadataValue" | "assetComment" | "assetCommentAttachment" | "assetEmbedding" | "invite" | "metadataField" | "notification" | "systemSettings" | "task" | "workflowTask" | "agent" | "agentSkill" | "agentSession" | "agentSessionEntry" | "userMetadata" | "model" | "provider" | "collection" | "apiToken"
|
||||
modelProps: "user" | "session" | "account" | "verification" | "authToken" | "team" | "sandbox" | "skill" | "teamMember" | "project" | "projectMember" | "shareLink" | "asset" | "storageKey" | "assetMetadataValue" | "assetComment" | "assetCommentAttachment" | "assetEmbedding" | "invite" | "metadataField" | "notification" | "systemSettings" | "task" | "workflowTask" | "agent" | "agentSkill" | "agentSession" | "agentSessionEntry" | "userMetadata" | "model" | "provider" | "collection" | "apiToken" | "aiUsage"
|
||||
txIsolationLevel: TransactionIsolationLevel
|
||||
}
|
||||
model: {
|
||||
@@ -2878,6 +2879,80 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
}
|
||||
}
|
||||
}
|
||||
AiUsage: {
|
||||
payload: Prisma.$AiUsagePayload<ExtArgs>
|
||||
fields: Prisma.AiUsageFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.AiUsageFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AiUsagePayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.AiUsageFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AiUsagePayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.AiUsageFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AiUsagePayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.AiUsageFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AiUsagePayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.AiUsageFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AiUsagePayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.AiUsageCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AiUsagePayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.AiUsageCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
createManyAndReturn: {
|
||||
args: Prisma.AiUsageCreateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AiUsagePayload>[]
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.AiUsageDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AiUsagePayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.AiUsageUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AiUsagePayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.AiUsageDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.AiUsageUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateManyAndReturn: {
|
||||
args: Prisma.AiUsageUpdateManyAndReturnArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AiUsagePayload>[]
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.AiUsageUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$AiUsagePayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.AiUsageAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateAiUsage>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.AiUsageGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AiUsageGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.AiUsageCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AiUsageCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} & {
|
||||
other: {
|
||||
@@ -3392,6 +3467,23 @@ export const ApiTokenScalarFieldEnum = {
|
||||
export type ApiTokenScalarFieldEnum = (typeof ApiTokenScalarFieldEnum)[keyof typeof ApiTokenScalarFieldEnum]
|
||||
|
||||
|
||||
export const AiUsageScalarFieldEnum = {
|
||||
id: 'id',
|
||||
teamId: 'teamId',
|
||||
userId: 'userId',
|
||||
periodStart: 'periodStart',
|
||||
inputTokens: 'inputTokens',
|
||||
outputTokens: 'outputTokens',
|
||||
cacheReadTokens: 'cacheReadTokens',
|
||||
totalTokens: 'totalTokens',
|
||||
cost: 'cost',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type AiUsageScalarFieldEnum = (typeof AiUsageScalarFieldEnum)[keyof typeof AiUsageScalarFieldEnum]
|
||||
|
||||
|
||||
export const SortOrder = {
|
||||
asc: 'asc',
|
||||
desc: 'desc'
|
||||
@@ -3889,6 +3981,7 @@ export type GlobalOmitConfig = {
|
||||
provider?: Prisma.ProviderOmit
|
||||
collection?: Prisma.CollectionOmit
|
||||
apiToken?: Prisma.ApiTokenOmit
|
||||
aiUsage?: Prisma.AiUsageOmit
|
||||
}
|
||||
|
||||
/* Types for Logging */
|
||||
|
||||
Reference in New Issue
Block a user