✨ feat: add new JSON schemas for Tibi configuration including fields, hooks, jobs, and permissions
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
- Introduced `field-list.schema.json`, `field-meta.schema.json`, and `field.schema.json` for field configurations. - Added `hooks.schema.json` for defining hooks in the Tibi project. - Created `image-filter.schema.json` for image processing configurations. - Implemented `job.schema.json` for job scheduling configurations. - Added `openapi.schema.json` for OpenAPI metadata generation. - Introduced `permissions.schema.json` for managing permissions in the project. - Created `project.schema.json` for overall project configuration. - Added `projections.schema.json` for defining projections in the project. - Implemented a validation script `validate-schemas.mjs` to ensure schema compliance.
This commit is contained in:
Vendored
+128
-11
@@ -90,6 +90,22 @@ declare global {
|
||||
k?: number
|
||||
topK?: number
|
||||
weights?: { [source: string]: number }
|
||||
/** Fusion strategy: "rrf" (default), "score_rrf", "score_sum", "rank_score", "hybrid" */
|
||||
strategy?: "rrf" | "score_rrf" | "score_sum" | "rank_score" | "hybrid"
|
||||
/** Score normalization: "none" (default), "minmax", "zscore" */
|
||||
normalize?: "none" | "minmax" | "zscore"
|
||||
/** Blend factor for "hybrid" strategy: 0.0 = pure rank, 1.0 = pure score */
|
||||
scoreWeight?: number
|
||||
/** Per-source overrides for fine-grained fusion tuning */
|
||||
sourceConfig?: { [source: string]: SourceFusionConfig }
|
||||
}
|
||||
|
||||
/** Per-source overrides for rank fusion */
|
||||
export interface SourceFusionConfig {
|
||||
/** Override global scoreWeight for this source */
|
||||
scoreWeight?: number
|
||||
/** Score multiplier for this source (default 1.0) */
|
||||
boost?: number
|
||||
}
|
||||
|
||||
export interface VectorConfig {
|
||||
@@ -101,6 +117,35 @@ declare global {
|
||||
chunkOverlap?: number
|
||||
}
|
||||
|
||||
export interface SearchExplainSource {
|
||||
mode?: string
|
||||
matched?: boolean
|
||||
rank?: number
|
||||
weight?: number
|
||||
score?: number
|
||||
/** Normalized score (only present when normalize is active) */
|
||||
normalizedScore?: number
|
||||
contribution?: number
|
||||
details?: SearchExplanation
|
||||
}
|
||||
|
||||
export interface SearchExplanation {
|
||||
algorithm?: string
|
||||
/** Fusion strategy used ("score_rrf", "hybrid", etc.). Omitted when default "rrf". */
|
||||
strategy?: string
|
||||
/** Normalization mode used ("minmax", "zscore"). Omitted when "none". */
|
||||
normalize?: string
|
||||
k?: number
|
||||
sources?: { [source: string]: SearchExplainSource }
|
||||
}
|
||||
|
||||
export interface SearchMeta {
|
||||
score?: number
|
||||
mode?: string
|
||||
/** Present when the request uses qExplain=1 or qExplain=true. */
|
||||
details?: SearchExplanation
|
||||
}
|
||||
|
||||
/** Search configuration for a collection */
|
||||
export interface SearchConfig {
|
||||
/** Search config name (used in query parameter qName) */
|
||||
@@ -132,6 +177,8 @@ declare global {
|
||||
vector?: VectorConfig
|
||||
/** Reciprocal rank fusion configuration */
|
||||
rrf?: RrfConfig
|
||||
/** Execute synchronously (false) or via background queue (true). Vector mode defaults to true. */
|
||||
async?: boolean
|
||||
/** Auto-regenerate enrichment data when the config changes */
|
||||
autoRegenerate?: boolean
|
||||
}
|
||||
@@ -204,15 +251,24 @@ declare global {
|
||||
|
||||
export type ChoiceValue = string | number | boolean | null
|
||||
|
||||
export type ChoiceStyle = Record<string, string | number | boolean>
|
||||
|
||||
export interface ChoiceItem {
|
||||
id?: ChoiceValue
|
||||
value?: ChoiceValue
|
||||
name?: LocalizedText
|
||||
label?: LocalizedText
|
||||
description?: LocalizedText
|
||||
badgeVariant?: "success" | "error" | "warning" | "info" | "neutral"
|
||||
chipVariant?: "success" | "error" | "warning" | "info" | "neutral"
|
||||
badgeStyle?: Record<string, string | number | boolean>
|
||||
chipStyle?: Record<string, string | number | boolean>
|
||||
/**
|
||||
* Flat inline CSS properties for badge/chip rendering.
|
||||
* Supports camelCase, kebab-case, and CSS custom properties.
|
||||
* `bg` and `text` remain aliases for `background` and `color`.
|
||||
*/
|
||||
badgeStyle?: ChoiceStyle
|
||||
/** Alias for `badgeStyle`. */
|
||||
chipStyle?: ChoiceStyle
|
||||
}
|
||||
|
||||
export type EvalStringConfig = {
|
||||
@@ -334,7 +390,9 @@ declare global {
|
||||
/** Action endpoint descriptor as returned by context.api() for _actions resources */
|
||||
export interface ActionInfo {
|
||||
name: string
|
||||
permissions?: { [role: string]: PermissionSet }
|
||||
meta?: ActionMeta
|
||||
audit?: AuditCollectionConfig
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
@@ -366,21 +424,76 @@ declare global {
|
||||
|
||||
export interface ActionExecutionMeta {
|
||||
kind?: "sync" | "sse" | string
|
||||
progress?: boolean
|
||||
cancellable?: boolean
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
export interface ActionMappedField extends Omit<
|
||||
CollectionFieldInfo,
|
||||
"name"
|
||||
> {
|
||||
/** Dot-path in action payload/result/progress. Preferred over `name` for mapped output configs. */
|
||||
source?: string
|
||||
/** Legacy fallback for path-based mappings. */
|
||||
name?: string
|
||||
}
|
||||
|
||||
export interface ActionOutputProgressMapping {
|
||||
indexField?: string
|
||||
countField?: string
|
||||
statusField?: string | string[]
|
||||
messageField?: string
|
||||
fields?: ActionMappedField[]
|
||||
}
|
||||
|
||||
export interface ActionOutputMapping {
|
||||
summary?: {
|
||||
fields?: ActionMappedField[]
|
||||
}
|
||||
details?: {
|
||||
fields?: ActionMappedField[]
|
||||
}
|
||||
progress?: ActionOutputProgressMapping
|
||||
}
|
||||
|
||||
export interface ActionOutputMeta {
|
||||
display?: "summary" | "detail" | "raw" | "download" | "none" | string
|
||||
title?: LocalizedText
|
||||
fields?: CollectionFieldInfo[]
|
||||
mapping?: ActionOutputMapping
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
export type MethodPermission = boolean | { allow: boolean; bulk?: boolean }
|
||||
export type SimpleMethodPermission = boolean | { allow: boolean }
|
||||
|
||||
export interface AllowedMethodPermission {
|
||||
allow: boolean
|
||||
bulk?: boolean
|
||||
}
|
||||
|
||||
export interface CollectionYourPermissions {
|
||||
get?: AllowedMethodPermission
|
||||
post?: AllowedMethodPermission
|
||||
put?: AllowedMethodPermission
|
||||
delete?: AllowedMethodPermission
|
||||
readonlyFields?: string[]
|
||||
hiddenFields?: string[]
|
||||
}
|
||||
|
||||
export interface ActionYourPermissions {
|
||||
get?: { allow: boolean }
|
||||
post?: { allow: boolean }
|
||||
}
|
||||
|
||||
export interface ProjectYourPermissions {
|
||||
_actions?: { [actionName: string]: ActionYourPermissions }
|
||||
[collectionName: string]:
|
||||
| CollectionYourPermissions
|
||||
| { [actionName: string]: ActionYourPermissions }
|
||||
| undefined
|
||||
}
|
||||
|
||||
export interface PermissionSet {
|
||||
methods?: {
|
||||
get?: SimpleMethodPermission
|
||||
@@ -444,7 +557,7 @@ declare global {
|
||||
users?: string[]
|
||||
configFile?: string
|
||||
api?: ApiInfo
|
||||
yourPermissions?: { [key: string]: any }
|
||||
yourPermissions?: ProjectYourPermissions
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
@@ -1095,12 +1208,19 @@ declare global {
|
||||
}
|
||||
|
||||
interface CharsetPackage {
|
||||
/**
|
||||
* decode byte-oriented input using the given encoding
|
||||
*
|
||||
* supported encodings: utf-8, iso-8859-1
|
||||
*/
|
||||
decode(input: string | Int8Array | number[], encoding: string): string
|
||||
|
||||
/**
|
||||
* convert iso8859 to utf8
|
||||
*
|
||||
* @param iso8859 iso string
|
||||
* @param iso8859 iso string or bytes
|
||||
*/
|
||||
iso8859ToUtf8(iso8859: string): string
|
||||
iso8859ToUtf8(iso8859: string | Int8Array | number[]): string
|
||||
}
|
||||
|
||||
interface ImagePackage {
|
||||
@@ -1525,10 +1645,7 @@ declare global {
|
||||
}
|
||||
|
||||
export interface HookContext
|
||||
extends GetHookData,
|
||||
GetHookGetOnlyData,
|
||||
PostHookData,
|
||||
JobData {
|
||||
extends GetHookData, GetHookGetOnlyData, PostHookData, JobData {
|
||||
request(): {
|
||||
method: string
|
||||
remoteAddr: string
|
||||
@@ -1541,7 +1658,7 @@ declare global {
|
||||
header(h: string): string
|
||||
body(): string
|
||||
/**
|
||||
* bodyBytes return []byte go slice of post body for later use pe. in iso8859ToUtf8
|
||||
* bodyBytes returns the raw request body bytes for later decoding via charset.decode
|
||||
*/
|
||||
bodyBytes(): Int8Array
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user