mirror of
https://github.com/langgenius/dify.git
synced 2026-05-29 21:27:54 +08:00
fix
This commit is contained in:
@ -16,7 +16,7 @@ from fields.file_fields import FileWithSignedUrl, RemoteFileInfo
|
||||
from graphon.file import helpers as file_helpers
|
||||
from services.file_service import FileService
|
||||
|
||||
from ..common.schema import register_schema_models
|
||||
from ..common.schema import register_response_schema_models, register_schema_models
|
||||
from . import web_ns
|
||||
from .wraps import WebApiResource
|
||||
|
||||
@ -25,7 +25,8 @@ class RemoteFileUploadPayload(BaseModel):
|
||||
url: HttpUrl = Field(description="Remote file URL")
|
||||
|
||||
|
||||
register_schema_models(web_ns, RemoteFileUploadPayload, RemoteFileInfo, FileWithSignedUrl)
|
||||
register_schema_models(web_ns, RemoteFileUploadPayload)
|
||||
register_response_schema_models(web_ns, RemoteFileInfo, FileWithSignedUrl)
|
||||
|
||||
|
||||
@web_ns.route("/remote-files/<path:url>")
|
||||
|
||||
@ -2,7 +2,7 @@ from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import field_validator
|
||||
from pydantic import ConfigDict, field_validator
|
||||
|
||||
from fields.base import ResponseModel
|
||||
from libs.helper import to_timestamp
|
||||
@ -49,6 +49,8 @@ class RemoteFileInfo(ResponseModel):
|
||||
|
||||
|
||||
class FileWithSignedUrl(ResponseModel):
|
||||
model_config = ConfigDict(json_schema_serialization_defaults_required=True)
|
||||
|
||||
id: str
|
||||
name: str
|
||||
size: int
|
||||
|
||||
@ -10,27 +10,31 @@ from services.billing_service import BillingService
|
||||
from services.enterprise.enterprise_service import EnterpriseService
|
||||
|
||||
|
||||
class SubscriptionModel(BaseModel):
|
||||
class FeatureResponseModel(BaseModel):
|
||||
model_config = ConfigDict(json_schema_serialization_defaults_required=True, protected_namespaces=())
|
||||
|
||||
|
||||
class SubscriptionModel(FeatureResponseModel):
|
||||
plan: str = CloudPlan.SANDBOX
|
||||
interval: str = ""
|
||||
|
||||
|
||||
class BillingModel(BaseModel):
|
||||
class BillingModel(FeatureResponseModel):
|
||||
enabled: bool = False
|
||||
subscription: SubscriptionModel = SubscriptionModel()
|
||||
|
||||
|
||||
class EducationModel(BaseModel):
|
||||
class EducationModel(FeatureResponseModel):
|
||||
enabled: bool = False
|
||||
activated: bool = False
|
||||
|
||||
|
||||
class LimitationModel(BaseModel):
|
||||
class LimitationModel(FeatureResponseModel):
|
||||
size: int = 0
|
||||
limit: int = 0
|
||||
|
||||
|
||||
class LicenseLimitationModel(BaseModel):
|
||||
class LicenseLimitationModel(FeatureResponseModel):
|
||||
"""
|
||||
- enabled: whether this limit is enforced
|
||||
- size: current usage count
|
||||
@ -56,7 +60,7 @@ class LicenseLimitationModel(BaseModel):
|
||||
return (self.limit - self.size) >= required
|
||||
|
||||
|
||||
class Quota(BaseModel):
|
||||
class Quota(FeatureResponseModel):
|
||||
usage: int = 0
|
||||
limit: int = 0
|
||||
reset_date: int = -1
|
||||
@ -71,13 +75,13 @@ class LicenseStatus(StrEnum):
|
||||
LOST = "lost"
|
||||
|
||||
|
||||
class LicenseModel(BaseModel):
|
||||
class LicenseModel(FeatureResponseModel):
|
||||
status: LicenseStatus = LicenseStatus.NONE
|
||||
expired_at: str = ""
|
||||
workspaces: LicenseLimitationModel = LicenseLimitationModel(enabled=False, size=0, limit=0)
|
||||
|
||||
|
||||
class BrandingModel(BaseModel):
|
||||
class BrandingModel(FeatureResponseModel):
|
||||
enabled: bool = False
|
||||
application_title: str = ""
|
||||
login_page_logo: str = ""
|
||||
@ -85,11 +89,11 @@ class BrandingModel(BaseModel):
|
||||
favicon: str = ""
|
||||
|
||||
|
||||
class WebAppAuthSSOModel(BaseModel):
|
||||
class WebAppAuthSSOModel(FeatureResponseModel):
|
||||
protocol: str = ""
|
||||
|
||||
|
||||
class WebAppAuthModel(BaseModel):
|
||||
class WebAppAuthModel(FeatureResponseModel):
|
||||
enabled: bool = False
|
||||
allow_sso: bool = False
|
||||
sso_config: WebAppAuthSSOModel = WebAppAuthSSOModel()
|
||||
@ -97,7 +101,7 @@ class WebAppAuthModel(BaseModel):
|
||||
allow_email_password_login: bool = False
|
||||
|
||||
|
||||
class KnowledgePipeline(BaseModel):
|
||||
class KnowledgePipeline(FeatureResponseModel):
|
||||
publish_enabled: bool = False
|
||||
|
||||
|
||||
@ -108,7 +112,7 @@ class PluginInstallationScope(StrEnum):
|
||||
ALL = "all"
|
||||
|
||||
|
||||
class PluginInstallationPermissionModel(BaseModel):
|
||||
class PluginInstallationPermissionModel(FeatureResponseModel):
|
||||
# Plugin installation scope – possible values:
|
||||
# none: prohibit all plugin installations
|
||||
# official_only: allow only Dify official plugins
|
||||
@ -121,7 +125,7 @@ class PluginInstallationPermissionModel(BaseModel):
|
||||
restrict_to_marketplace_only: bool = False
|
||||
|
||||
|
||||
class FeatureModel(BaseModel):
|
||||
class FeatureModel(FeatureResponseModel):
|
||||
billing: BillingModel = BillingModel()
|
||||
education: EducationModel = EducationModel()
|
||||
members: LimitationModel = LimitationModel(size=0, limit=1)
|
||||
@ -141,23 +145,21 @@ class FeatureModel(BaseModel):
|
||||
api_rate_limit: Quota = Quota(usage=0, limit=5000, reset_date=0)
|
||||
# Controls whether email delivery is allowed for HumanInput nodes.
|
||||
human_input_email_delivery_enabled: bool = False
|
||||
# pydantic configs
|
||||
model_config = ConfigDict(protected_namespaces=())
|
||||
knowledge_pipeline: KnowledgePipeline = KnowledgePipeline()
|
||||
next_credit_reset_date: int = 0
|
||||
|
||||
|
||||
class KnowledgeRateLimitModel(BaseModel):
|
||||
class KnowledgeRateLimitModel(FeatureResponseModel):
|
||||
enabled: bool = False
|
||||
limit: int = 10
|
||||
subscription_plan: str = ""
|
||||
|
||||
|
||||
class PluginManagerModel(BaseModel):
|
||||
class PluginManagerModel(FeatureResponseModel):
|
||||
enabled: bool = False
|
||||
|
||||
|
||||
class SystemFeatureModel(BaseModel):
|
||||
class SystemFeatureModel(FeatureResponseModel):
|
||||
app_dsl_version: str = ""
|
||||
sso_enforced_for_signin: bool = False
|
||||
sso_enforced_for_signin_protocol: str = ""
|
||||
|
||||
@ -5,62 +5,62 @@ export type ClientOptions = {
|
||||
}
|
||||
|
||||
export type FeatureModel = {
|
||||
annotation_quota_limit?: LimitationModel
|
||||
api_rate_limit?: Quota
|
||||
apps?: LimitationModel
|
||||
billing?: BillingModel
|
||||
can_replace_logo?: boolean
|
||||
dataset_operator_enabled?: boolean
|
||||
docs_processing?: string
|
||||
documents_upload_quota?: LimitationModel
|
||||
education?: EducationModel
|
||||
human_input_email_delivery_enabled?: boolean
|
||||
is_allow_transfer_workspace?: boolean
|
||||
knowledge_pipeline?: KnowledgePipeline
|
||||
knowledge_rate_limit?: number
|
||||
members?: LimitationModel
|
||||
model_load_balancing_enabled?: boolean
|
||||
next_credit_reset_date?: number
|
||||
trigger_event?: Quota
|
||||
vector_space?: LimitationModel
|
||||
webapp_copyright_enabled?: boolean
|
||||
workspace_members?: LicenseLimitationModel
|
||||
annotation_quota_limit: LimitationModel
|
||||
api_rate_limit: Quota
|
||||
apps: LimitationModel
|
||||
billing: BillingModel
|
||||
can_replace_logo: boolean
|
||||
dataset_operator_enabled: boolean
|
||||
docs_processing: string
|
||||
documents_upload_quota: LimitationModel
|
||||
education: EducationModel
|
||||
human_input_email_delivery_enabled: boolean
|
||||
is_allow_transfer_workspace: boolean
|
||||
knowledge_pipeline: KnowledgePipeline
|
||||
knowledge_rate_limit: number
|
||||
members: LimitationModel
|
||||
model_load_balancing_enabled: boolean
|
||||
next_credit_reset_date: number
|
||||
trigger_event: Quota
|
||||
vector_space: LimitationModel
|
||||
webapp_copyright_enabled: boolean
|
||||
workspace_members: LicenseLimitationModel
|
||||
}
|
||||
|
||||
export type LimitationModel = {
|
||||
limit?: number
|
||||
size?: number
|
||||
limit: number
|
||||
size: number
|
||||
}
|
||||
|
||||
export type Quota = {
|
||||
limit?: number
|
||||
reset_date?: number
|
||||
usage?: number
|
||||
limit: number
|
||||
reset_date: number
|
||||
usage: number
|
||||
}
|
||||
|
||||
export type BillingModel = {
|
||||
enabled?: boolean
|
||||
subscription?: SubscriptionModel
|
||||
enabled: boolean
|
||||
subscription: SubscriptionModel
|
||||
}
|
||||
|
||||
export type EducationModel = {
|
||||
activated?: boolean
|
||||
enabled?: boolean
|
||||
activated: boolean
|
||||
enabled: boolean
|
||||
}
|
||||
|
||||
export type KnowledgePipeline = {
|
||||
publish_enabled?: boolean
|
||||
publish_enabled: boolean
|
||||
}
|
||||
|
||||
export type LicenseLimitationModel = {
|
||||
enabled?: boolean
|
||||
limit?: number
|
||||
size?: number
|
||||
enabled: boolean
|
||||
limit: number
|
||||
size: number
|
||||
}
|
||||
|
||||
export type SubscriptionModel = {
|
||||
interval?: string
|
||||
plan?: string
|
||||
interval: string
|
||||
plan: string
|
||||
}
|
||||
|
||||
export type GetFeaturesData = {
|
||||
|
||||
@ -6,32 +6,32 @@ import * as z from 'zod'
|
||||
* LimitationModel
|
||||
*/
|
||||
export const zLimitationModel = z.object({
|
||||
limit: z.int().optional().default(0),
|
||||
size: z.int().optional().default(0),
|
||||
limit: z.int().default(0),
|
||||
size: z.int().default(0),
|
||||
})
|
||||
|
||||
/**
|
||||
* Quota
|
||||
*/
|
||||
export const zQuota = z.object({
|
||||
limit: z.int().optional().default(0),
|
||||
reset_date: z.int().optional().default(-1),
|
||||
usage: z.int().optional().default(0),
|
||||
limit: z.int().default(0),
|
||||
reset_date: z.int().default(-1),
|
||||
usage: z.int().default(0),
|
||||
})
|
||||
|
||||
/**
|
||||
* EducationModel
|
||||
*/
|
||||
export const zEducationModel = z.object({
|
||||
activated: z.boolean().optional().default(false),
|
||||
enabled: z.boolean().optional().default(false),
|
||||
activated: z.boolean().default(false),
|
||||
enabled: z.boolean().default(false),
|
||||
})
|
||||
|
||||
/**
|
||||
* KnowledgePipeline
|
||||
*/
|
||||
export const zKnowledgePipeline = z.object({
|
||||
publish_enabled: z.boolean().optional().default(false),
|
||||
publish_enabled: z.boolean().default(false),
|
||||
})
|
||||
|
||||
/**
|
||||
@ -42,51 +42,51 @@ export const zKnowledgePipeline = z.object({
|
||||
* - limit: maximum allowed count; 0 means unlimited
|
||||
*/
|
||||
export const zLicenseLimitationModel = z.object({
|
||||
enabled: z.boolean().optional().default(false),
|
||||
limit: z.int().optional().default(0),
|
||||
size: z.int().optional().default(0),
|
||||
enabled: z.boolean().default(false),
|
||||
limit: z.int().default(0),
|
||||
size: z.int().default(0),
|
||||
})
|
||||
|
||||
/**
|
||||
* SubscriptionModel
|
||||
*/
|
||||
export const zSubscriptionModel = z.object({
|
||||
interval: z.string().optional().default(''),
|
||||
plan: z.string().optional().default('sandbox'),
|
||||
interval: z.string().default(''),
|
||||
plan: z.string().default('sandbox'),
|
||||
})
|
||||
|
||||
/**
|
||||
* BillingModel
|
||||
*/
|
||||
export const zBillingModel = z.object({
|
||||
enabled: z.boolean().optional().default(false),
|
||||
subscription: zSubscriptionModel.optional(),
|
||||
enabled: z.boolean().default(false),
|
||||
subscription: zSubscriptionModel,
|
||||
})
|
||||
|
||||
/**
|
||||
* FeatureModel
|
||||
*/
|
||||
export const zFeatureModel = z.object({
|
||||
annotation_quota_limit: zLimitationModel.optional(),
|
||||
api_rate_limit: zQuota.optional(),
|
||||
apps: zLimitationModel.optional(),
|
||||
billing: zBillingModel.optional(),
|
||||
can_replace_logo: z.boolean().optional().default(false),
|
||||
dataset_operator_enabled: z.boolean().optional().default(false),
|
||||
docs_processing: z.string().optional().default('standard'),
|
||||
documents_upload_quota: zLimitationModel.optional(),
|
||||
education: zEducationModel.optional(),
|
||||
human_input_email_delivery_enabled: z.boolean().optional().default(false),
|
||||
is_allow_transfer_workspace: z.boolean().optional().default(true),
|
||||
knowledge_pipeline: zKnowledgePipeline.optional(),
|
||||
knowledge_rate_limit: z.int().optional().default(10),
|
||||
members: zLimitationModel.optional(),
|
||||
model_load_balancing_enabled: z.boolean().optional().default(false),
|
||||
next_credit_reset_date: z.int().optional().default(0),
|
||||
trigger_event: zQuota.optional(),
|
||||
vector_space: zLimitationModel.optional(),
|
||||
webapp_copyright_enabled: z.boolean().optional().default(false),
|
||||
workspace_members: zLicenseLimitationModel.optional(),
|
||||
annotation_quota_limit: zLimitationModel,
|
||||
api_rate_limit: zQuota,
|
||||
apps: zLimitationModel,
|
||||
billing: zBillingModel,
|
||||
can_replace_logo: z.boolean().default(false),
|
||||
dataset_operator_enabled: z.boolean().default(false),
|
||||
docs_processing: z.string().default('standard'),
|
||||
documents_upload_quota: zLimitationModel,
|
||||
education: zEducationModel,
|
||||
human_input_email_delivery_enabled: z.boolean().default(false),
|
||||
is_allow_transfer_workspace: z.boolean().default(true),
|
||||
knowledge_pipeline: zKnowledgePipeline,
|
||||
knowledge_rate_limit: z.int().default(10),
|
||||
members: zLimitationModel,
|
||||
model_load_balancing_enabled: z.boolean().default(false),
|
||||
next_credit_reset_date: z.int().default(0),
|
||||
trigger_event: zQuota,
|
||||
vector_space: zLimitationModel,
|
||||
webapp_copyright_enabled: z.boolean().default(false),
|
||||
workspace_members: zLicenseLimitationModel,
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@ -9,14 +9,14 @@ export type RemoteFileUploadPayload = {
|
||||
}
|
||||
|
||||
export type FileWithSignedUrl = {
|
||||
created_at?: number | null
|
||||
created_by?: string | null
|
||||
extension?: string | null
|
||||
created_at: number | null
|
||||
created_by: string | null
|
||||
extension: string | null
|
||||
id: string
|
||||
mime_type?: string | null
|
||||
mime_type: string | null
|
||||
name: string
|
||||
size: number
|
||||
url?: string | null
|
||||
url: string | null
|
||||
}
|
||||
|
||||
export type RemoteFileInfo = {
|
||||
|
||||
@ -13,14 +13,14 @@ export const zRemoteFileUploadPayload = z.object({
|
||||
* FileWithSignedUrl
|
||||
*/
|
||||
export const zFileWithSignedUrl = z.object({
|
||||
created_at: z.int().nullish(),
|
||||
created_by: z.string().nullish(),
|
||||
extension: z.string().nullish(),
|
||||
created_at: z.int().nullable(),
|
||||
created_by: z.string().nullable(),
|
||||
extension: z.string().nullable(),
|
||||
id: z.string(),
|
||||
mime_type: z.string().nullish(),
|
||||
mime_type: z.string().nullable(),
|
||||
name: z.string(),
|
||||
size: z.int(),
|
||||
url: z.string().nullish(),
|
||||
url: z.string().nullable(),
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@ -5,67 +5,67 @@ export type ClientOptions = {
|
||||
}
|
||||
|
||||
export type SystemFeatureModel = {
|
||||
app_dsl_version?: string
|
||||
branding?: BrandingModel
|
||||
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_marketplace?: boolean
|
||||
enable_social_oauth_login?: boolean
|
||||
enable_trial_app?: boolean
|
||||
is_allow_create_workspace?: boolean
|
||||
is_allow_register?: boolean
|
||||
is_email_setup?: boolean
|
||||
license?: LicenseModel
|
||||
max_plugin_package_size?: number
|
||||
plugin_installation_permission?: PluginInstallationPermissionModel
|
||||
plugin_manager?: PluginManagerModel
|
||||
sso_enforced_for_signin?: boolean
|
||||
sso_enforced_for_signin_protocol?: string
|
||||
trial_models?: Array<string>
|
||||
webapp_auth?: WebAppAuthModel
|
||||
app_dsl_version: string
|
||||
branding: BrandingModel
|
||||
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_marketplace: boolean
|
||||
enable_social_oauth_login: boolean
|
||||
enable_trial_app: boolean
|
||||
is_allow_create_workspace: boolean
|
||||
is_allow_register: boolean
|
||||
is_email_setup: boolean
|
||||
license: LicenseModel
|
||||
max_plugin_package_size: number
|
||||
plugin_installation_permission: PluginInstallationPermissionModel
|
||||
plugin_manager: PluginManagerModel
|
||||
sso_enforced_for_signin: boolean
|
||||
sso_enforced_for_signin_protocol: string
|
||||
trial_models: Array<string>
|
||||
webapp_auth: WebAppAuthModel
|
||||
}
|
||||
|
||||
export type BrandingModel = {
|
||||
application_title?: string
|
||||
enabled?: boolean
|
||||
favicon?: string
|
||||
login_page_logo?: string
|
||||
workspace_logo?: string
|
||||
application_title: string
|
||||
enabled: boolean
|
||||
favicon: string
|
||||
login_page_logo: string
|
||||
workspace_logo: string
|
||||
}
|
||||
|
||||
export type LicenseModel = {
|
||||
expired_at?: string
|
||||
status?: LicenseStatus
|
||||
workspaces?: LicenseLimitationModel
|
||||
expired_at: string
|
||||
status: LicenseStatus
|
||||
workspaces: LicenseLimitationModel
|
||||
}
|
||||
|
||||
export type PluginInstallationPermissionModel = {
|
||||
plugin_installation_scope?: PluginInstallationScope
|
||||
restrict_to_marketplace_only?: boolean
|
||||
plugin_installation_scope: PluginInstallationScope
|
||||
restrict_to_marketplace_only: boolean
|
||||
}
|
||||
|
||||
export type PluginManagerModel = {
|
||||
enabled?: boolean
|
||||
enabled: boolean
|
||||
}
|
||||
|
||||
export type WebAppAuthModel = {
|
||||
allow_email_code_login?: boolean
|
||||
allow_email_password_login?: boolean
|
||||
allow_sso?: boolean
|
||||
enabled?: boolean
|
||||
sso_config?: WebAppAuthSsoModel
|
||||
allow_email_code_login: boolean
|
||||
allow_email_password_login: boolean
|
||||
allow_sso: boolean
|
||||
enabled: boolean
|
||||
sso_config: WebAppAuthSsoModel
|
||||
}
|
||||
|
||||
export type LicenseStatus = 'active' | 'expired' | 'expiring' | 'inactive' | 'lost' | 'none'
|
||||
|
||||
export type LicenseLimitationModel = {
|
||||
enabled?: boolean
|
||||
limit?: number
|
||||
size?: number
|
||||
enabled: boolean
|
||||
limit: number
|
||||
size: number
|
||||
}
|
||||
|
||||
export type PluginInstallationScope
|
||||
@ -75,7 +75,7 @@ export type PluginInstallationScope
|
||||
| 'official_only'
|
||||
|
||||
export type WebAppAuthSsoModel = {
|
||||
protocol?: string
|
||||
protocol: string
|
||||
}
|
||||
|
||||
export type GetSystemFeaturesData = {
|
||||
|
||||
@ -6,18 +6,18 @@ import * as z from 'zod'
|
||||
* BrandingModel
|
||||
*/
|
||||
export const zBrandingModel = z.object({
|
||||
application_title: z.string().optional().default(''),
|
||||
enabled: z.boolean().optional().default(false),
|
||||
favicon: z.string().optional().default(''),
|
||||
login_page_logo: z.string().optional().default(''),
|
||||
workspace_logo: z.string().optional().default(''),
|
||||
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(''),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginManagerModel
|
||||
*/
|
||||
export const zPluginManagerModel = z.object({
|
||||
enabled: z.boolean().optional().default(false),
|
||||
enabled: z.boolean().default(false),
|
||||
})
|
||||
|
||||
/**
|
||||
@ -33,18 +33,18 @@ export const zLicenseStatus = z.enum(['active', 'expired', 'expiring', 'inactive
|
||||
* - limit: maximum allowed count; 0 means unlimited
|
||||
*/
|
||||
export const zLicenseLimitationModel = z.object({
|
||||
enabled: z.boolean().optional().default(false),
|
||||
limit: z.int().optional().default(0),
|
||||
size: z.int().optional().default(0),
|
||||
enabled: z.boolean().default(false),
|
||||
limit: z.int().default(0),
|
||||
size: z.int().default(0),
|
||||
})
|
||||
|
||||
/**
|
||||
* LicenseModel
|
||||
*/
|
||||
export const zLicenseModel = z.object({
|
||||
expired_at: z.string().optional().default(''),
|
||||
status: zLicenseStatus.optional(),
|
||||
workspaces: zLicenseLimitationModel.optional(),
|
||||
expired_at: z.string().default(''),
|
||||
status: zLicenseStatus,
|
||||
workspaces: zLicenseLimitationModel,
|
||||
})
|
||||
|
||||
/**
|
||||
@ -61,54 +61,54 @@ export const zPluginInstallationScope = z.enum([
|
||||
* PluginInstallationPermissionModel
|
||||
*/
|
||||
export const zPluginInstallationPermissionModel = z.object({
|
||||
plugin_installation_scope: zPluginInstallationScope.optional(),
|
||||
restrict_to_marketplace_only: z.boolean().optional().default(false),
|
||||
plugin_installation_scope: zPluginInstallationScope,
|
||||
restrict_to_marketplace_only: z.boolean().default(false),
|
||||
})
|
||||
|
||||
/**
|
||||
* WebAppAuthSSOModel
|
||||
*/
|
||||
export const zWebAppAuthSsoModel = z.object({
|
||||
protocol: z.string().optional().default(''),
|
||||
protocol: z.string().default(''),
|
||||
})
|
||||
|
||||
/**
|
||||
* WebAppAuthModel
|
||||
*/
|
||||
export const zWebAppAuthModel = z.object({
|
||||
allow_email_code_login: z.boolean().optional().default(false),
|
||||
allow_email_password_login: z.boolean().optional().default(false),
|
||||
allow_sso: z.boolean().optional().default(false),
|
||||
enabled: z.boolean().optional().default(false),
|
||||
sso_config: zWebAppAuthSsoModel.optional(),
|
||||
allow_email_code_login: z.boolean().default(false),
|
||||
allow_email_password_login: z.boolean().default(false),
|
||||
allow_sso: z.boolean().default(false),
|
||||
enabled: z.boolean().default(false),
|
||||
sso_config: zWebAppAuthSsoModel,
|
||||
})
|
||||
|
||||
/**
|
||||
* SystemFeatureModel
|
||||
*/
|
||||
export const zSystemFeatureModel = z.object({
|
||||
app_dsl_version: z.string().optional().default(''),
|
||||
branding: zBrandingModel.optional(),
|
||||
enable_change_email: z.boolean().optional().default(true),
|
||||
enable_collaboration_mode: z.boolean().optional().default(true),
|
||||
enable_creators_platform: z.boolean().optional().default(false),
|
||||
enable_email_code_login: z.boolean().optional().default(false),
|
||||
enable_email_password_login: z.boolean().optional().default(true),
|
||||
enable_explore_banner: z.boolean().optional().default(false),
|
||||
enable_marketplace: z.boolean().optional().default(false),
|
||||
enable_social_oauth_login: z.boolean().optional().default(false),
|
||||
enable_trial_app: z.boolean().optional().default(false),
|
||||
is_allow_create_workspace: z.boolean().optional().default(false),
|
||||
is_allow_register: z.boolean().optional().default(false),
|
||||
is_email_setup: z.boolean().optional().default(false),
|
||||
license: zLicenseModel.optional(),
|
||||
max_plugin_package_size: z.int().optional().default(15728640),
|
||||
plugin_installation_permission: zPluginInstallationPermissionModel.optional(),
|
||||
plugin_manager: zPluginManagerModel.optional(),
|
||||
sso_enforced_for_signin: z.boolean().optional().default(false),
|
||||
sso_enforced_for_signin_protocol: z.string().optional().default(''),
|
||||
trial_models: z.array(z.string()).optional().default([]),
|
||||
webapp_auth: zWebAppAuthModel.optional(),
|
||||
app_dsl_version: z.string().default(''),
|
||||
branding: zBrandingModel,
|
||||
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_marketplace: z.boolean().default(false),
|
||||
enable_social_oauth_login: z.boolean().default(false),
|
||||
enable_trial_app: z.boolean().default(false),
|
||||
is_allow_create_workspace: z.boolean().default(false),
|
||||
is_allow_register: z.boolean().default(false),
|
||||
is_email_setup: z.boolean().default(false),
|
||||
license: zLicenseModel,
|
||||
max_plugin_package_size: z.int().default(15728640),
|
||||
plugin_installation_permission: zPluginInstallationPermissionModel,
|
||||
plugin_manager: zPluginManagerModel,
|
||||
sso_enforced_for_signin: z.boolean().default(false),
|
||||
sso_enforced_for_signin_protocol: z.string().default(''),
|
||||
trial_models: z.array(z.string()).default([]),
|
||||
webapp_auth: zWebAppAuthModel,
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@ -27,11 +27,11 @@ export type BooleanResultResponse = {
|
||||
}
|
||||
|
||||
export type BrandingModel = {
|
||||
application_title?: string
|
||||
enabled?: boolean
|
||||
favicon?: string
|
||||
login_page_logo?: string
|
||||
workspace_logo?: string
|
||||
application_title: string
|
||||
enabled: boolean
|
||||
favicon: string
|
||||
login_page_logo: string
|
||||
workspace_logo: string
|
||||
}
|
||||
|
||||
export type ChatMessagePayload = {
|
||||
@ -101,14 +101,14 @@ export type FileResponse = {
|
||||
}
|
||||
|
||||
export type FileWithSignedUrl = {
|
||||
created_at?: number | null
|
||||
created_by?: string | null
|
||||
extension?: string | null
|
||||
created_at: number | null
|
||||
created_by: string | null
|
||||
extension: string | null
|
||||
id: string
|
||||
mime_type?: string | null
|
||||
mime_type: string | null
|
||||
name: string
|
||||
size: number
|
||||
url?: string | null
|
||||
url: string | null
|
||||
}
|
||||
|
||||
export type ForgotPasswordCheckPayload = {
|
||||
@ -129,15 +129,15 @@ export type ForgotPasswordSendPayload = {
|
||||
}
|
||||
|
||||
export type LicenseLimitationModel = {
|
||||
enabled?: boolean
|
||||
limit?: number
|
||||
size?: number
|
||||
enabled: boolean
|
||||
limit: number
|
||||
size: number
|
||||
}
|
||||
|
||||
export type LicenseModel = {
|
||||
expired_at?: string
|
||||
status?: LicenseStatus
|
||||
workspaces?: LicenseLimitationModel
|
||||
expired_at: string
|
||||
status: LicenseStatus
|
||||
workspaces: LicenseLimitationModel
|
||||
}
|
||||
|
||||
export type LicenseStatus = 'active' | 'expired' | 'expiring' | 'inactive' | 'lost' | 'none'
|
||||
@ -168,8 +168,8 @@ export type MessageMoreLikeThisQuery = {
|
||||
}
|
||||
|
||||
export type PluginInstallationPermissionModel = {
|
||||
plugin_installation_scope?: PluginInstallationScope
|
||||
restrict_to_marketplace_only?: boolean
|
||||
plugin_installation_scope: PluginInstallationScope
|
||||
restrict_to_marketplace_only: boolean
|
||||
}
|
||||
|
||||
export type PluginInstallationScope
|
||||
@ -179,7 +179,7 @@ export type PluginInstallationScope
|
||||
| 'official_only'
|
||||
|
||||
export type PluginManagerModel = {
|
||||
enabled?: boolean
|
||||
enabled: boolean
|
||||
}
|
||||
|
||||
export type RemoteFileInfo = {
|
||||
@ -218,28 +218,28 @@ export type SuggestedQuestionsResponse = {
|
||||
}
|
||||
|
||||
export type SystemFeatureModel = {
|
||||
app_dsl_version?: string
|
||||
branding?: BrandingModel
|
||||
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_marketplace?: boolean
|
||||
enable_social_oauth_login?: boolean
|
||||
enable_trial_app?: boolean
|
||||
is_allow_create_workspace?: boolean
|
||||
is_allow_register?: boolean
|
||||
is_email_setup?: boolean
|
||||
license?: LicenseModel
|
||||
max_plugin_package_size?: number
|
||||
plugin_installation_permission?: PluginInstallationPermissionModel
|
||||
plugin_manager?: PluginManagerModel
|
||||
sso_enforced_for_signin?: boolean
|
||||
sso_enforced_for_signin_protocol?: string
|
||||
trial_models?: Array<string>
|
||||
webapp_auth?: WebAppAuthModel
|
||||
app_dsl_version: string
|
||||
branding: BrandingModel
|
||||
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_marketplace: boolean
|
||||
enable_social_oauth_login: boolean
|
||||
enable_trial_app: boolean
|
||||
is_allow_create_workspace: boolean
|
||||
is_allow_register: boolean
|
||||
is_email_setup: boolean
|
||||
license: LicenseModel
|
||||
max_plugin_package_size: number
|
||||
plugin_installation_permission: PluginInstallationPermissionModel
|
||||
plugin_manager: PluginManagerModel
|
||||
sso_enforced_for_signin: boolean
|
||||
sso_enforced_for_signin_protocol: string
|
||||
trial_models: Array<string>
|
||||
webapp_auth: WebAppAuthModel
|
||||
}
|
||||
|
||||
export type TextToAudioPayload = {
|
||||
@ -256,15 +256,15 @@ export type VerificationTokenResponse = {
|
||||
}
|
||||
|
||||
export type WebAppAuthModel = {
|
||||
allow_email_code_login?: boolean
|
||||
allow_email_password_login?: boolean
|
||||
allow_sso?: boolean
|
||||
enabled?: boolean
|
||||
sso_config?: WebAppAuthSsoModel
|
||||
allow_email_code_login: boolean
|
||||
allow_email_password_login: boolean
|
||||
allow_sso: boolean
|
||||
enabled: boolean
|
||||
sso_config: WebAppAuthSsoModel
|
||||
}
|
||||
|
||||
export type WebAppAuthSsoModel = {
|
||||
protocol?: string
|
||||
protocol: string
|
||||
}
|
||||
|
||||
export type WorkflowRunPayload = {
|
||||
|
||||
@ -43,11 +43,11 @@ export const zBooleanResultResponse = z.object({
|
||||
* BrandingModel
|
||||
*/
|
||||
export const zBrandingModel = z.object({
|
||||
application_title: z.string().optional().default(''),
|
||||
enabled: z.boolean().optional().default(false),
|
||||
favicon: z.string().optional().default(''),
|
||||
login_page_logo: z.string().optional().default(''),
|
||||
workspace_logo: z.string().optional().default(''),
|
||||
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(''),
|
||||
})
|
||||
|
||||
/**
|
||||
@ -136,14 +136,14 @@ export const zFileResponse = z.object({
|
||||
* FileWithSignedUrl
|
||||
*/
|
||||
export const zFileWithSignedUrl = z.object({
|
||||
created_at: z.int().nullish(),
|
||||
created_by: z.string().nullish(),
|
||||
extension: z.string().nullish(),
|
||||
created_at: z.int().nullable(),
|
||||
created_by: z.string().nullable(),
|
||||
extension: z.string().nullable(),
|
||||
id: z.string(),
|
||||
mime_type: z.string().nullish(),
|
||||
mime_type: z.string().nullable(),
|
||||
name: z.string(),
|
||||
size: z.int(),
|
||||
url: z.string().nullish(),
|
||||
url: z.string().nullable(),
|
||||
})
|
||||
|
||||
/**
|
||||
@ -180,9 +180,9 @@ export const zForgotPasswordSendPayload = z.object({
|
||||
* - limit: maximum allowed count; 0 means unlimited
|
||||
*/
|
||||
export const zLicenseLimitationModel = z.object({
|
||||
enabled: z.boolean().optional().default(false),
|
||||
limit: z.int().optional().default(0),
|
||||
size: z.int().optional().default(0),
|
||||
enabled: z.boolean().default(false),
|
||||
limit: z.int().default(0),
|
||||
size: z.int().default(0),
|
||||
})
|
||||
|
||||
/**
|
||||
@ -194,9 +194,9 @@ export const zLicenseStatus = z.enum(['active', 'expired', 'expiring', 'inactive
|
||||
* LicenseModel
|
||||
*/
|
||||
export const zLicenseModel = z.object({
|
||||
expired_at: z.string().optional().default(''),
|
||||
status: zLicenseStatus.optional(),
|
||||
workspaces: zLicenseLimitationModel.optional(),
|
||||
expired_at: z.string().default(''),
|
||||
status: zLicenseStatus,
|
||||
workspaces: zLicenseLimitationModel,
|
||||
})
|
||||
|
||||
/**
|
||||
@ -253,15 +253,15 @@ export const zPluginInstallationScope = z.enum([
|
||||
* PluginInstallationPermissionModel
|
||||
*/
|
||||
export const zPluginInstallationPermissionModel = z.object({
|
||||
plugin_installation_scope: zPluginInstallationScope.optional(),
|
||||
restrict_to_marketplace_only: z.boolean().optional().default(false),
|
||||
plugin_installation_scope: zPluginInstallationScope,
|
||||
restrict_to_marketplace_only: z.boolean().default(false),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginManagerModel
|
||||
*/
|
||||
export const zPluginManagerModel = z.object({
|
||||
enabled: z.boolean().optional().default(false),
|
||||
enabled: z.boolean().default(false),
|
||||
})
|
||||
|
||||
/**
|
||||
@ -346,46 +346,46 @@ export const zVerificationTokenResponse = z.object({
|
||||
* WebAppAuthSSOModel
|
||||
*/
|
||||
export const zWebAppAuthSsoModel = z.object({
|
||||
protocol: z.string().optional().default(''),
|
||||
protocol: z.string().default(''),
|
||||
})
|
||||
|
||||
/**
|
||||
* WebAppAuthModel
|
||||
*/
|
||||
export const zWebAppAuthModel = z.object({
|
||||
allow_email_code_login: z.boolean().optional().default(false),
|
||||
allow_email_password_login: z.boolean().optional().default(false),
|
||||
allow_sso: z.boolean().optional().default(false),
|
||||
enabled: z.boolean().optional().default(false),
|
||||
sso_config: zWebAppAuthSsoModel.optional(),
|
||||
allow_email_code_login: z.boolean().default(false),
|
||||
allow_email_password_login: z.boolean().default(false),
|
||||
allow_sso: z.boolean().default(false),
|
||||
enabled: z.boolean().default(false),
|
||||
sso_config: zWebAppAuthSsoModel,
|
||||
})
|
||||
|
||||
/**
|
||||
* SystemFeatureModel
|
||||
*/
|
||||
export const zSystemFeatureModel = z.object({
|
||||
app_dsl_version: z.string().optional().default(''),
|
||||
branding: zBrandingModel.optional(),
|
||||
enable_change_email: z.boolean().optional().default(true),
|
||||
enable_collaboration_mode: z.boolean().optional().default(true),
|
||||
enable_creators_platform: z.boolean().optional().default(false),
|
||||
enable_email_code_login: z.boolean().optional().default(false),
|
||||
enable_email_password_login: z.boolean().optional().default(true),
|
||||
enable_explore_banner: z.boolean().optional().default(false),
|
||||
enable_marketplace: z.boolean().optional().default(false),
|
||||
enable_social_oauth_login: z.boolean().optional().default(false),
|
||||
enable_trial_app: z.boolean().optional().default(false),
|
||||
is_allow_create_workspace: z.boolean().optional().default(false),
|
||||
is_allow_register: z.boolean().optional().default(false),
|
||||
is_email_setup: z.boolean().optional().default(false),
|
||||
license: zLicenseModel.optional(),
|
||||
max_plugin_package_size: z.int().optional().default(15728640),
|
||||
plugin_installation_permission: zPluginInstallationPermissionModel.optional(),
|
||||
plugin_manager: zPluginManagerModel.optional(),
|
||||
sso_enforced_for_signin: z.boolean().optional().default(false),
|
||||
sso_enforced_for_signin_protocol: z.string().optional().default(''),
|
||||
trial_models: z.array(z.string()).optional().default([]),
|
||||
webapp_auth: zWebAppAuthModel.optional(),
|
||||
app_dsl_version: z.string().default(''),
|
||||
branding: zBrandingModel,
|
||||
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_marketplace: z.boolean().default(false),
|
||||
enable_social_oauth_login: z.boolean().default(false),
|
||||
enable_trial_app: z.boolean().default(false),
|
||||
is_allow_create_workspace: z.boolean().default(false),
|
||||
is_allow_register: z.boolean().default(false),
|
||||
is_email_setup: z.boolean().default(false),
|
||||
license: zLicenseModel,
|
||||
max_plugin_package_size: z.int().default(15728640),
|
||||
plugin_installation_permission: zPluginInstallationPermissionModel,
|
||||
plugin_manager: zPluginManagerModel,
|
||||
sso_enforced_for_signin: z.boolean().default(false),
|
||||
sso_enforced_for_signin_protocol: z.string().default(''),
|
||||
trial_models: z.array(z.string()).default([]),
|
||||
webapp_auth: zWebAppAuthModel,
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user