mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-08 04:36:13 +08:00
feat(server): converge legacy compatibility (#15426)
#### PR Dependency Tree * **PR #15426** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added workspace BYOK profiles with provider/model catalogs, capability validation, connection probing, credential rotation, reordering, and secure local leases. * Added Copilot route options, selectable targets, managed tiers, explicit profile/model overrides, and improved streaming with tool callbacks and abort support. * Added Copilot availability controls to prevent access when the feature is disabled. * **Changes** * Simplified Copilot configuration and removed legacy provider-specific settings. * Removed obsolete model, token-cost, transcript strategy, and provider metadata fields from public responses. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -347,17 +347,6 @@ type BlobUploadedPart {
|
||||
partNumber: Int!
|
||||
}
|
||||
|
||||
enum ByokKeyStorage {
|
||||
local
|
||||
server
|
||||
}
|
||||
|
||||
enum ByokKeyTestStatus {
|
||||
failed
|
||||
passed
|
||||
untested
|
||||
}
|
||||
|
||||
enum ByokProvider {
|
||||
anthropic
|
||||
fal
|
||||
@@ -553,12 +542,12 @@ type Copilot {
|
||||
contexts(contextId: String, sessionId: String): [CopilotContext!]!
|
||||
histories(docId: String, options: QueryChatHistoriesInput): [CopilotHistories!]! @deprecated(reason: "use `chats` instead")
|
||||
|
||||
"""List available models for a prompt, with human-readable names"""
|
||||
models(promptName: String!): CopilotModelsType!
|
||||
|
||||
"""Get the quota of the user in the workspace"""
|
||||
quota: CopilotQuota!
|
||||
|
||||
"""List native built-in route choices for a prompt"""
|
||||
routeOptions(promptName: String!): CopilotRouteOptions
|
||||
|
||||
"""Get the session by id"""
|
||||
session(sessionId: String!): CopilotSessionType!
|
||||
|
||||
@@ -664,16 +653,11 @@ type CopilotHistories {
|
||||
createdAt: DateTime!
|
||||
docId: String
|
||||
messages: [ChatMessage!]!
|
||||
model: String!
|
||||
optionalModels: [String!]!
|
||||
parentSessionId: String
|
||||
pinned: Boolean!
|
||||
promptName: String!
|
||||
sessionId: String!
|
||||
title: String
|
||||
|
||||
"""The number of tokens used in the session"""
|
||||
tokens: Int!
|
||||
updatedAt: DateTime!
|
||||
workspaceId: String!
|
||||
}
|
||||
@@ -691,17 +675,6 @@ type CopilotMessageNotFoundDataType {
|
||||
messageId: String!
|
||||
}
|
||||
|
||||
type CopilotModelType {
|
||||
id: String!
|
||||
name: String!
|
||||
}
|
||||
|
||||
type CopilotModelsType {
|
||||
defaultModel: String!
|
||||
optionalModels: [CopilotModelType!]!
|
||||
proModels: [CopilotModelType!]!
|
||||
}
|
||||
|
||||
type CopilotPromptNotFoundDataType {
|
||||
name: String!
|
||||
}
|
||||
@@ -722,11 +695,22 @@ type CopilotQuota {
|
||||
used: SafeInt!
|
||||
}
|
||||
|
||||
type CopilotRouteOptions {
|
||||
choices: [CopilotRouteTarget!]!
|
||||
defaultTargetId: String
|
||||
routeId: String!
|
||||
}
|
||||
|
||||
type CopilotRouteTarget {
|
||||
available: Boolean!
|
||||
displayName: String!
|
||||
id: String!
|
||||
minimumTier: String!
|
||||
}
|
||||
|
||||
type CopilotSessionType {
|
||||
docId: String
|
||||
id: ID!
|
||||
model: String!
|
||||
optionalModels: [String!]!
|
||||
parentSessionId: ID
|
||||
pinned: Boolean!
|
||||
promptName: String!
|
||||
@@ -821,13 +805,12 @@ input CreateWorkspaceByokLocalLeaseInput {
|
||||
}
|
||||
|
||||
input CreateWorkspaceByokLocalLeaseProviderInput {
|
||||
apiKey: String!
|
||||
credential: String!
|
||||
definition: WorkspaceByokProfileDefinitionInput!
|
||||
description: String
|
||||
enabled: Boolean
|
||||
endpoint: String
|
||||
enabled: Boolean!
|
||||
name: String!
|
||||
provider: ByokProvider!
|
||||
sortOrder: SafeInt
|
||||
}
|
||||
|
||||
type CreateWorkspaceByokLocalLeaseResultType {
|
||||
@@ -835,6 +818,16 @@ type CreateWorkspaceByokLocalLeaseResultType {
|
||||
leaseId: String!
|
||||
}
|
||||
|
||||
input CreateWorkspaceByokProfileInput {
|
||||
credential: String!
|
||||
definition: WorkspaceByokProfileDefinitionInput!
|
||||
description: String
|
||||
enabled: Boolean!
|
||||
name: String!
|
||||
provider: ByokProvider!
|
||||
workspaceId: String!
|
||||
}
|
||||
|
||||
type CredentialsRequirementType {
|
||||
password: PasswordLimitsType!
|
||||
}
|
||||
@@ -1644,7 +1637,6 @@ type Mutation {
|
||||
|
||||
"""Cleanup sessions"""
|
||||
cleanupCopilotSession(options: DeleteSessionInput!): [String!]!
|
||||
clearWorkspaceByokConfigs(provider: ByokProvider, workspaceId: String!): Boolean!
|
||||
completeBlobUpload(key: String!, parts: [BlobUploadPartInput!], uploadId: String, workspaceId: String!): String!
|
||||
createBlobUpload(key: String!, mime: String!, size: Int!, workspaceId: String!): BlobUploadInit!
|
||||
|
||||
@@ -1680,6 +1672,7 @@ type Mutation {
|
||||
"""Create a new workspace"""
|
||||
createWorkspace(init: Upload): WorkspaceType!
|
||||
createWorkspaceByokLocalLease(input: CreateWorkspaceByokLocalLeaseInput!): CreateWorkspaceByokLocalLeaseResultType!
|
||||
createWorkspaceByokProfile(input: CreateWorkspaceByokProfileInput!): WorkspaceByokProfileType!
|
||||
deactivateLicense(workspaceId: String!): Boolean!
|
||||
deleteAccount: DeleteAccount!
|
||||
deleteAuthSigningKey(id: String!): [AuthSigningKeyType!]!
|
||||
@@ -1694,7 +1687,7 @@ type Mutation {
|
||||
"""Delete a user account"""
|
||||
deleteUser(id: String!): DeleteAccount!
|
||||
deleteWorkspace(id: String!): Boolean!
|
||||
deleteWorkspaceByokConfig(id: ID!, workspaceId: String!): Boolean!
|
||||
deleteWorkspaceByokProfile(profileId: ID!, workspaceId: String!): Boolean!
|
||||
|
||||
"""Reenable an banned user"""
|
||||
enableUser(id: String!): UserType!
|
||||
@@ -1717,6 +1710,8 @@ type Mutation {
|
||||
"""mention user in a doc"""
|
||||
mentionUser(input: MentionInput!): ID!
|
||||
previewLicense(license: Upload!): AdminLicensePreview!
|
||||
probeWorkspaceByokDraft(input: ProbeWorkspaceByokDraftInput!): WorkspaceByokProbeResultType!
|
||||
probeWorkspaceByokProfile(input: ProbeWorkspaceByokProfileInput!): WorkspaceByokProbeResultType!
|
||||
publishDoc(docId: String!, mode: PublicDocMode = Page, workspaceId: String!): DocType!
|
||||
|
||||
"""queue workspace doc embedding"""
|
||||
@@ -1750,7 +1745,8 @@ type Mutation {
|
||||
|
||||
"""Remove workspace embedding files"""
|
||||
removeWorkspaceEmbeddingFiles(fileId: String!, workspaceId: String!): Boolean!
|
||||
reorderWorkspaceByokConfigs(input: ReorderWorkspaceByokConfigsInput!): [WorkspaceByokKeyConfigType!]!
|
||||
reorderWorkspaceByokProfiles(input: ReorderWorkspaceByokProfilesInput!): [WorkspaceByokProfileType!]!
|
||||
replaceWorkspaceByokProfile(input: ReplaceWorkspaceByokProfileInput!): WorkspaceByokProfileType!
|
||||
|
||||
"""Request to apply the subscription in advance"""
|
||||
requestApplySubscription(transactionId: String!): [SubscriptionType!]!
|
||||
@@ -1767,6 +1763,7 @@ type Mutation {
|
||||
revokePublicDoc(docId: String!, workspaceId: String!): DocType!
|
||||
rotateAuthSigningKey(expectedActiveKeyId: String!): [AuthSigningKeyType!]!
|
||||
rotateMcpCredential(expirationDays: Int! = 90, id: ID!, workspaceId: String!): RevealedMcpCredentialType!
|
||||
rotateWorkspaceByokCredential(input: RotateWorkspaceByokCredentialInput!): WorkspaceByokProfileType!
|
||||
sendChangeEmail(callbackUrl: String!): Boolean!
|
||||
sendChangePasswordEmail(callbackUrl: String!, email: String @deprecated(reason: "fetched from signed in user")): Boolean!
|
||||
sendSetPasswordEmail(callbackUrl: String!, email: String @deprecated(reason: "fetched from signed in user")): Boolean!
|
||||
@@ -1776,7 +1773,6 @@ type Mutation {
|
||||
setBlob(blob: Upload!, workspaceId: String!): String!
|
||||
settleTranscriptTask(taskId: String!, workspaceId: String!): TranscriptionResultType
|
||||
submitTranscriptTask(blob: Upload, blobId: String!, blobs: [Upload!], input: SubmitAudioTranscriptionInput, workspaceId: String!): TranscriptionResultType
|
||||
testWorkspaceByokConfig(input: TestWorkspaceByokConfigInput!): TestWorkspaceByokConfigResultType!
|
||||
unlinkCalendarAccount(accountId: String!): Boolean!
|
||||
|
||||
"""update app configuration"""
|
||||
@@ -1817,7 +1813,6 @@ type Mutation {
|
||||
|
||||
"""Upload a comment attachment and return the access url"""
|
||||
uploadCommentAttachment(attachment: Upload!, docId: String!, workspaceId: String!): String!
|
||||
upsertWorkspaceByokConfig(input: UpsertWorkspaceByokConfigInput!): WorkspaceByokKeyConfigType!
|
||||
verifyEmail(token: String!): Boolean!
|
||||
}
|
||||
|
||||
@@ -2004,6 +1999,22 @@ enum Permission {
|
||||
Owner
|
||||
}
|
||||
|
||||
input ProbeWorkspaceByokDraftInput {
|
||||
checks: [WorkspaceByokProbeCheckInput!]!
|
||||
credential: String
|
||||
definition: WorkspaceByokProfileDefinitionInput!
|
||||
expectedRevision: SafeInt
|
||||
profileId: ID
|
||||
provider: ByokProvider!
|
||||
workspaceId: String!
|
||||
}
|
||||
|
||||
input ProbeWorkspaceByokProfileInput {
|
||||
checks: [WorkspaceByokProbeCheckInput!]!
|
||||
profileId: ID!
|
||||
workspaceId: String!
|
||||
}
|
||||
|
||||
"""The mode which the public doc default in"""
|
||||
enum PublicDocMode {
|
||||
Edgeless
|
||||
@@ -2143,9 +2154,19 @@ input RemoveContextFileInput {
|
||||
fileId: String!
|
||||
}
|
||||
|
||||
input ReorderWorkspaceByokConfigsInput {
|
||||
ids: [ID!]!
|
||||
storage: ByokKeyStorage!
|
||||
input ReorderWorkspaceByokProfilesInput {
|
||||
profiles: [WorkspaceByokProfileOrderInput!]!
|
||||
workspaceId: String!
|
||||
}
|
||||
|
||||
input ReplaceWorkspaceByokProfileInput {
|
||||
credential: String
|
||||
definition: WorkspaceByokProfileDefinitionInput!
|
||||
description: String
|
||||
enabled: Boolean!
|
||||
expectedRevision: SafeInt!
|
||||
name: String!
|
||||
profileId: ID!
|
||||
workspaceId: String!
|
||||
}
|
||||
|
||||
@@ -2199,6 +2220,13 @@ input RevokeDocUserRoleInput {
|
||||
workspaceId: String!
|
||||
}
|
||||
|
||||
input RotateWorkspaceByokCredentialInput {
|
||||
credential: String!
|
||||
expectedRevision: SafeInt!
|
||||
profileId: ID!
|
||||
workspaceId: String!
|
||||
}
|
||||
|
||||
type RuntimeConfigNotFoundDataType {
|
||||
key: String!
|
||||
}
|
||||
@@ -2386,7 +2414,6 @@ input SubmitAudioTranscriptionInput {
|
||||
quality: TranscriptionQualityInput
|
||||
sliceManifest: [AudioSliceManifestItemInput!]
|
||||
sourceAudio: TranscriptionSourceAudioInput
|
||||
strategy: String
|
||||
}
|
||||
|
||||
type SubscriptionAlreadyExistsDataType {
|
||||
@@ -2473,21 +2500,6 @@ enum SubscriptionVariant {
|
||||
Onetime
|
||||
}
|
||||
|
||||
input TestWorkspaceByokConfigInput {
|
||||
apiKey: String
|
||||
configId: ID
|
||||
endpoint: String
|
||||
provider: ByokProvider!
|
||||
storage: ByokKeyStorage!
|
||||
workspaceId: String!
|
||||
}
|
||||
|
||||
type TestWorkspaceByokConfigResultType {
|
||||
message: String
|
||||
ok: Boolean!
|
||||
status: ByokKeyTestStatus!
|
||||
}
|
||||
|
||||
enum TimeBucket {
|
||||
Day
|
||||
Hour
|
||||
@@ -2503,11 +2515,6 @@ type TimeWindow {
|
||||
to: DateTime!
|
||||
}
|
||||
|
||||
type TranscriptProviderMetaType {
|
||||
model: String
|
||||
provider: String
|
||||
}
|
||||
|
||||
type TranscriptionItemType {
|
||||
end: String!
|
||||
speaker: String!
|
||||
@@ -2530,12 +2537,10 @@ type TranscriptionResultType {
|
||||
id: ID!
|
||||
normalizedSegments: [NormalizedTranscriptSegmentType!]
|
||||
normalizedTranscript: String
|
||||
providerMeta: TranscriptProviderMetaType
|
||||
quality: TranscriptionQualityType
|
||||
sliceManifest: [AudioSliceManifestItemType!]
|
||||
sourceAudio: TranscriptionSourceAudioType
|
||||
status: AiJobStatus!
|
||||
strategy: String
|
||||
summary: String
|
||||
summaryJson: MeetingSummaryV2Type
|
||||
title: String
|
||||
@@ -2650,19 +2655,6 @@ input UpdateWorkspaceInput {
|
||||
"""The `Upload` scalar type represents a file upload."""
|
||||
scalar Upload
|
||||
|
||||
input UpsertWorkspaceByokConfigInput {
|
||||
apiKey: String
|
||||
description: String
|
||||
enabled: Boolean
|
||||
endpoint: String
|
||||
id: ID
|
||||
name: String!
|
||||
provider: ByokProvider!
|
||||
sortOrder: SafeInt
|
||||
storage: ByokKeyStorage!
|
||||
workspaceId: String!
|
||||
}
|
||||
|
||||
type UserImportFailedType {
|
||||
email: String!
|
||||
error: String!
|
||||
@@ -2760,45 +2752,128 @@ type VersionRejectedDataType {
|
||||
version: String!
|
||||
}
|
||||
|
||||
type WorkspaceByokCapabilityWarningType {
|
||||
featureKind: String!
|
||||
reason: String!
|
||||
requiredProviders: [ByokProvider!]!
|
||||
input WorkspaceByokCapabilityInput {
|
||||
attachmentKinds: [String!]!
|
||||
attachmentSources: [String!]!
|
||||
features: [String!]!
|
||||
input: [String!]!
|
||||
output: [String!]!
|
||||
}
|
||||
|
||||
type WorkspaceByokKeyConfigType {
|
||||
capabilities: [String!]!
|
||||
configured: Boolean!
|
||||
description: String
|
||||
disabledReason: String
|
||||
enabled: Boolean!
|
||||
endpoint: String
|
||||
endpointEditable: Boolean!
|
||||
id: ID!
|
||||
lastError: String
|
||||
lastErrorAt: DateTime
|
||||
lastTestError: String
|
||||
lastTestedAt: DateTime
|
||||
lastUsedAt: DateTime
|
||||
name: String!
|
||||
type WorkspaceByokCapabilityType {
|
||||
attachmentKinds: [String!]!
|
||||
attachmentSources: [String!]!
|
||||
features: [String!]!
|
||||
input: [String!]!
|
||||
output: [String!]!
|
||||
}
|
||||
|
||||
type WorkspaceByokCatalogModelType {
|
||||
capabilities: [WorkspaceByokCapabilityType!]!
|
||||
displayName: String!
|
||||
modelId: String!
|
||||
recommended: Boolean!
|
||||
}
|
||||
|
||||
type WorkspaceByokCatalogProviderType {
|
||||
models: [WorkspaceByokCatalogModelType!]!
|
||||
provider: ByokProvider!
|
||||
}
|
||||
|
||||
type WorkspaceByokCatalogType {
|
||||
providers: [WorkspaceByokCatalogProviderType!]!
|
||||
version: String!
|
||||
}
|
||||
|
||||
input WorkspaceByokEndpointInput {
|
||||
kind: String!
|
||||
url: String
|
||||
}
|
||||
|
||||
type WorkspaceByokEndpointType {
|
||||
kind: String!
|
||||
url: String
|
||||
}
|
||||
|
||||
input WorkspaceByokModelDeclarationInput {
|
||||
capabilities: [WorkspaceByokCapabilityInput!]!
|
||||
enabled: Boolean!
|
||||
modelId: String!
|
||||
}
|
||||
|
||||
type WorkspaceByokModelDeclarationType {
|
||||
capabilities: [WorkspaceByokCapabilityType!]!
|
||||
enabled: Boolean!
|
||||
modelId: String!
|
||||
}
|
||||
|
||||
type WorkspaceByokModelProbeCheckType {
|
||||
operation: String!
|
||||
status: WorkspaceByokProbeStatusType!
|
||||
}
|
||||
|
||||
type WorkspaceByokModelProbeType {
|
||||
checks: [WorkspaceByokModelProbeCheckType!]!
|
||||
modelId: String!
|
||||
}
|
||||
|
||||
input WorkspaceByokProbeCheckInput {
|
||||
modelId: String!
|
||||
operation: String!
|
||||
}
|
||||
|
||||
type WorkspaceByokProbeResultType {
|
||||
connection: WorkspaceByokProbeStatusType!
|
||||
definitionFingerprint: String!
|
||||
models: [WorkspaceByokModelProbeType!]!
|
||||
stale: Boolean!
|
||||
}
|
||||
|
||||
type WorkspaceByokProbeStatusType {
|
||||
errorKind: String
|
||||
kind: String!
|
||||
testedAt: DateTime
|
||||
}
|
||||
|
||||
input WorkspaceByokProfileDefinitionInput {
|
||||
endpoint: WorkspaceByokEndpointInput!
|
||||
models: [WorkspaceByokModelDeclarationInput!]!
|
||||
version: SafeInt!
|
||||
}
|
||||
|
||||
type WorkspaceByokProfileDefinitionType {
|
||||
endpoint: WorkspaceByokEndpointType!
|
||||
models: [WorkspaceByokModelDeclarationType!]!
|
||||
version: SafeInt!
|
||||
}
|
||||
|
||||
input WorkspaceByokProfileOrderInput {
|
||||
expectedRevision: SafeInt!
|
||||
profileId: ID!
|
||||
}
|
||||
|
||||
type WorkspaceByokProfileType {
|
||||
definition: WorkspaceByokProfileDefinitionType!
|
||||
description: String
|
||||
enabled: Boolean!
|
||||
name: String!
|
||||
profileId: ID!
|
||||
provider: ByokProvider!
|
||||
revision: SafeInt!
|
||||
sortOrder: SafeInt!
|
||||
storage: ByokKeyStorage!
|
||||
testStatus: ByokKeyTestStatus!
|
||||
validation: WorkspaceByokValidationType
|
||||
workspaceId: String!
|
||||
}
|
||||
|
||||
type WorkspaceByokSettingsType {
|
||||
allowedProviders: [ByokProvider!]!
|
||||
catalog: WorkspaceByokCatalogType!
|
||||
customEndpointSupported: Boolean!
|
||||
entitled: Boolean!
|
||||
entitlementRequired: [String!]!
|
||||
hasAiPlan: Boolean!
|
||||
keys: [WorkspaceByokKeyConfigType!]!
|
||||
localEntitled: Boolean!
|
||||
localStorageSupported: Boolean!
|
||||
privateEndpointSupported: Boolean!
|
||||
profiles: [WorkspaceByokProfileType!]!
|
||||
serverEntitled: Boolean!
|
||||
warnings: [WorkspaceByokCapabilityWarningType!]!
|
||||
workspaceId: String!
|
||||
}
|
||||
|
||||
@@ -2808,6 +2883,13 @@ type WorkspaceByokUsagePointType {
|
||||
totalTokens: SafeInt!
|
||||
}
|
||||
|
||||
type WorkspaceByokValidationType {
|
||||
connection: WorkspaceByokProbeStatusType!
|
||||
credentialGeneration: SafeInt!
|
||||
definitionFingerprint: String!
|
||||
models: [WorkspaceByokModelProbeType!]!
|
||||
}
|
||||
|
||||
input WorkspaceCalendarItemInput {
|
||||
colorOverride: String
|
||||
sortOrder: Int
|
||||
|
||||
Reference in New Issue
Block a user