chore: 纳入本地 Dify 1.19.0 源码及品牌与免登改动

演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
wuzilongandCursor committed 2026-11-18 13:59:25 +08:00
1 parent 60158935f4
commit 6519682885
15831 files changed
+3063428

No files matched your search

@@ -0,0 +1,57 @@
// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import { zGetSystemFeaturesLicenseResponse, zGetSystemFeaturesResponse } from './zod.gen.ts'
/**
* Get full license detail (status, expiry, workspace/seat usage)
*
* Get license status and usage detail
* Authenticated counterpart to the license *status* exposed on the public
* system-features endpoint.
*/
export const get = oc
.route({
description:
'Get license status and usage detail\nAuthenticated counterpart to the license *status* exposed on the public\nsystem-features endpoint.',
inputStructure: 'detailed',
method: 'GET',
operationId: 'getSystemFeaturesLicense',
path: '/system-features/license',
summary: 'Get full license detail (status, expiry, workspace/seat usage)',
tags: ['console'],
})
.output(zGetSystemFeaturesLicenseResponse)
export const license = {
get,
}
/**
* Get the non-sensitive bootstrap snapshot exposed before authentication
*
* Get the non-sensitive bootstrap snapshot exposed before Console or Web authentication. This is not a general feature registry.
* Authentication configuration must be available before the authentication flow can be selected.
* Authenticated license detail is served separately by SystemFeatureLicenseApi.
*/
export const get2 = oc
.route({
description:
'Get the non-sensitive bootstrap snapshot exposed before Console or Web authentication. This is not a general feature registry.\nAuthentication configuration must be available before the authentication flow can be selected.\nAuthenticated license detail is served separately by SystemFeatureLicenseApi.',
inputStructure: 'detailed',
method: 'GET',
operationId: 'getSystemFeatures',
path: '/system-features',
summary: 'Get the non-sensitive bootstrap snapshot exposed before authentication',
tags: ['console'],
})
.output(zGetSystemFeaturesResponse)
export const systemFeatures = {
get: get2,
license,
}
export const contract = {
systemFeatures,
}
@@ -0,0 +1,136 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}/console/api` | (string & {})
}
export type SystemFeatureModel = {
agent_tracing_api_collection_enabled: boolean
branding: BrandingModel
deployment_edition: DeploymentEdition
enable_app_deploy: boolean
enable_change_email: boolean
enable_collaboration_mode: boolean
enable_creators_platform: boolean
enable_email_code_login: boolean
enable_email_password_login: boolean
enable_explore_banner: boolean
enable_learn_app: boolean
enable_marketplace: boolean
enable_social_oauth_login: boolean
enable_step_by_step_tour: boolean
is_allow_register: boolean
is_email_setup: boolean
license: LicenseStatusModel
plugin_installation_permission: PluginInstallationPermissionModel
rbac_enabled: boolean
sso_enforced_for_signin: boolean
sso_enforced_for_signin_protocol: SsoProtocol | null
webapp_auth: WebAppAuthModel
}
export type ErrorResponse = {
code: string
details?: {
[key: string]: unknown
}
message: string
params?: string
status: number
}
export type LicenseModel = {
expired_at: string
license_expiry_notice_enabled: boolean
seats: LicenseLimitationModel
status: LicenseStatus
workspaces: LicenseLimitationModel
}
export type BrandingModel = {
application_title: string
enabled: boolean
favicon: string
login_page_logo: string
workspace_logo: string
}
export type DeploymentEdition = 'CLOUD' | 'COMMUNITY' | 'ENTERPRISE'
export type LicenseStatusModel = {
status: LicenseStatus
}
export type PluginInstallationPermissionModel = {
plugin_installation_scope: PluginInstallationScope
restrict_to_marketplace_only: boolean
}
export type SsoProtocol = 'oauth2' | 'oidc' | 'saml'
export type WebAppAuthModel = {
allow_email_code_login: boolean
allow_email_password_login: boolean
allow_public_access: boolean
allow_sso: boolean
enabled: boolean
sso_config: WebAppAuthSsoModel
}
export type LicenseLimitationModel = {
enabled: boolean
limit: number
size: number
}
export type LicenseStatus = 'active' | 'expired' | 'expiring' | 'inactive' | 'lost' | 'none'
export type PluginInstallationScope =
| 'all'
| 'none'
| 'official_and_specific_partners'
| 'official_only'
export type WebAppAuthSsoModel = {
protocol: SsoProtocol | null
}
export type GetSystemFeaturesData = {
body?: never
path?: never
query?: never
url: '/system-features'
}
export type GetSystemFeaturesErrors = {
default: ErrorResponse
}
export type GetSystemFeaturesError = GetSystemFeaturesErrors[keyof GetSystemFeaturesErrors]
export type GetSystemFeaturesResponses = {
200: SystemFeatureModel
}
export type GetSystemFeaturesResponse = GetSystemFeaturesResponses[keyof GetSystemFeaturesResponses]
export type GetSystemFeaturesLicenseData = {
body?: never
path?: never
query?: never
url: '/system-features/license'
}
export type GetSystemFeaturesLicenseErrors = {
default: ErrorResponse
}
export type GetSystemFeaturesLicenseError =
GetSystemFeaturesLicenseErrors[keyof GetSystemFeaturesLicenseErrors]
export type GetSystemFeaturesLicenseResponses = {
200: LicenseModel
}
export type GetSystemFeaturesLicenseResponse =
GetSystemFeaturesLicenseResponses[keyof GetSystemFeaturesLicenseResponses]
@@ -0,0 +1,172 @@
// This file is auto-generated by @hey-api/openapi-ts
import * as z from 'zod'
/**
* ErrorResponse
*
* Documented non-2xx body emitted by ``register_external_error_handlers``.
*
* ``params`` and ``details`` appear only on the errors that set them. The schema
* stays open because ``HTTPException.data`` may carry extra keys.
*/
export const zErrorResponse = z.object({
code: z.string(),
details: z.record(z.string(), z.unknown()).optional(),
message: z.string(),
params: z.string().optional(),
status: z.int(),
})
/**
* BrandingModel
*/
export const zBrandingModel = z.object({
application_title: z.string().default(''),
enabled: z.boolean().default(false),
favicon: z.string().default(''),
login_page_logo: z.string().default(''),
workspace_logo: z.string().default(''),
})
/**
* DeploymentEdition
*
* Enum representing the deployment edition of the platform.
*/
export const zDeploymentEdition = z.enum(['CLOUD', 'COMMUNITY', 'ENTERPRISE'])
/**
* SSOProtocol
*/
export const zSsoProtocol = z.enum(['oauth2', 'oidc', 'saml'])
/**
* LicenseLimitationModel
*
* - enabled: whether this limit is enforced
* - size: current usage count
* - limit: maximum allowed count; 0 means unlimited
*/
export const zLicenseLimitationModel = z.object({
enabled: z.boolean().default(false),
limit: z.int().default(0),
size: z.int().default(0),
})
/**
* LicenseStatus
*/
export const zLicenseStatus = z.enum(['active', 'expired', 'expiring', 'inactive', 'lost', 'none'])
/**
* LicenseModel
*/
export const zLicenseModel = z.object({
expired_at: z.string().default(''),
license_expiry_notice_enabled: z.boolean().default(false),
seats: zLicenseLimitationModel.default({
enabled: false,
limit: 0,
size: 0,
}),
status: zLicenseStatus.default('none'),
workspaces: zLicenseLimitationModel.default({
enabled: false,
limit: 0,
size: 0,
}),
})
/**
* LicenseStatusModel
*/
export const zLicenseStatusModel = z.object({
status: zLicenseStatus.default('none'),
})
/**
* PluginInstallationScope
*/
export const zPluginInstallationScope = z.enum([
'all',
'none',
'official_and_specific_partners',
'official_only',
])
/**
* PluginInstallationPermissionModel
*/
export const zPluginInstallationPermissionModel = z.object({
plugin_installation_scope: zPluginInstallationScope.default('all'),
restrict_to_marketplace_only: z.boolean().default(false),
})
/**
* WebAppAuthSSOModel
*/
export const zWebAppAuthSsoModel = z.object({
protocol: zSsoProtocol.nullable(),
})
/**
* WebAppAuthModel
*/
export const zWebAppAuthModel = z.object({
allow_email_code_login: z.boolean().default(false),
allow_email_password_login: z.boolean().default(false),
allow_public_access: z.boolean().default(true),
allow_sso: z.boolean().default(false),
enabled: z.boolean().default(false),
sso_config: zWebAppAuthSsoModel,
})
/**
* SystemFeatureModel
*
* Non-sensitive bootstrap snapshot exposed before Console or Web authentication.
*/
export const zSystemFeatureModel = z.object({
agent_tracing_api_collection_enabled: z.boolean(),
branding: zBrandingModel.default({
application_title: '',
enabled: false,
favicon: '',
login_page_logo: '',
workspace_logo: '',
}),
deployment_edition: zDeploymentEdition,
enable_app_deploy: z.boolean().default(false),
enable_change_email: z.boolean().default(true),
enable_collaboration_mode: z.boolean().default(true),
enable_creators_platform: z.boolean().default(false),
enable_email_code_login: z.boolean().default(false),
enable_email_password_login: z.boolean().default(true),
enable_explore_banner: z.boolean().default(false),
enable_learn_app: z.boolean().default(true),
enable_marketplace: z.boolean().default(false),
enable_social_oauth_login: z.boolean().default(false),
enable_step_by_step_tour: z.boolean().default(false),
is_allow_register: z.boolean().default(false),
is_email_setup: z.boolean().default(false),
license: zLicenseStatusModel.default({ status: 'none' }),
plugin_installation_permission: zPluginInstallationPermissionModel.default({
plugin_installation_scope: 'all',
restrict_to_marketplace_only: false,
}),
rbac_enabled: z.boolean().default(false),
sso_enforced_for_signin: z.boolean().default(false),
sso_enforced_for_signin_protocol: zSsoProtocol.nullable(),
webapp_auth: zWebAppAuthModel,
})
/**
* Success
*/
export const zGetSystemFeaturesResponse = zSystemFeatureModel
/**
* Success
*/
export const zGetSystemFeaturesLicenseResponse = zLicenseModel