Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 105 additions & 4 deletions core-spec/v1/schemas/channel.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
$schema: https://json-schema.org/draft/2020-12/schema
title: Channel
description: >
A notification channel (e.g., HTTP webhook).
A notification channel (e.g., email or HTTP webhook).
Channels are serialized to the top-level channels/ directory.
The channel name is used as the entity identifier (no entity_id column).
type: object
required:
- name
Expand All @@ -10,19 +12,33 @@ required:
properties:
name:
type: string
description: Channel name
description: Channel name (unique, used as entity identifier)
description:
type:
- string
- "null"
description: Human-readable description
type:
type: string
description: "Channel type (e.g., channel/http)"
description: Channel type
enum:
- channel/email
- channel/http
details:
type: object
description: Channel-specific configuration
description: Channel-specific configuration (encrypted in the database)
additionalProperties: true
active:
type: boolean
description: Whether the channel is active
default: true
created_at:
type: string
description: ISO 8601 timestamp
format: date-time
serdes/meta:
type: array
description: Identity path for serialization
items:
type: object
required:
Expand All @@ -31,8 +47,93 @@ properties:
properties:
id:
type: string
description: Entity identifier (matches name)
label:
type: string
description: Slugified name
model:
type: string
const: Channel
allOf:
- if:
properties:
type: { const: channel/http }
then:
properties:
details:
type: object
required:
- url
- auth-method
properties:
url:
type: string
description: Webhook URL
format: uri
auth-method:
type: string
description: Authentication method
enum:
- none
- header
- query-param
- request-body
auth-info:
type: object
description: Authentication details (keys depend on auth-method)
additionalProperties: true
fe-form-type:
type: string
description: Frontend form type for auth display
enum:
- api-key
- bearer
- basic
- none
method:
type: string
description: HTTP method
enum:
- get
- post
- put
additionalProperties: false
- if:
properties:
type: { const: channel/email }
then:
properties:
details:
type: object
description: Email channel SMTP configuration
properties:
host:
type: string
description: SMTP server hostname
port:
type: integer
description: SMTP server port
security:
type: string
description: Connection security
enum:
- none
- ssl
- tls
- starttls
username:
type: string
description: SMTP username
password:
type: string
description: SMTP password
from-address:
type: string
description: Sender email address
from-name:
type: string
description: Sender display name
reply-to:
type: string
description: Reply-to email address
additionalProperties: true
22 changes: 19 additions & 3 deletions core-spec/v1/schemas/database.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
$schema: https://json-schema.org/draft/2020-12/schema
title: Database
description: A database connection definition.
description: >
A database connection definition. Databases are the root of the data model
hierarchy: Database → Table → Field. Serialized to databases/{name}/{name}.yaml.
type: object
required:
- name
- serdes/meta
properties:
name:
type: string
description: Database name (unique, used as entity identifier)
engine:
type: string
description: Database engine type (e.g., postgres, mysql, h2, bigquery-cloud-sdk)
description:
type:
- string
- "null"
description: Human-readable description
serdes/meta:
type: array
description: Identity path for serialization
items:
type: object
required: [id, model]
properties:
id: { type: string }
model: { type: string, const: Database }
id:
type: string
description: Entity identifier (matches name)
model:
type: string
const: Database
additionalProperties: true
83 changes: 80 additions & 3 deletions core-spec/v1/schemas/field.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,96 @@
$schema: https://json-schema.org/draft/2020-12/schema
title: Field
description: A table field (column) definition.
description: >
A table field (column) definition. Fields belong to tables and describe
individual columns. Serialized to databases/{db}/…/tables/{table}/fields/{field}.yaml.
type: object
required:
- name
- base_type
- database_type
- table_id
- serdes/meta
properties:
name:
type: string
description: Column name in the database
display_name:
type:
- string
- "null"
description: Human-readable display name
description:
type:
- string
- "null"
description: Human-readable description
base_type:
type: string
description: "Metabase base type (e.g., type/Integer, type/Text)"
effective_type:
type:
- string
- "null"
description: Effective type after coercion
database_type:
type: string
description: Native database type (e.g., INTEGER, VARCHAR)
semantic_type:
type:
- string
- "null"
description: "Semantic type (e.g., type/PK, type/FK, type/Category)"
coercion_strategy:
type:
- string
- "null"
description: Type coercion strategy
table_id:
description: Table FK [database, schema, table]
$ref: "common/id.yaml#/$defs/table_id"
fk_target_field_id:
description: FK target field [database, schema, table, field]
type:
- array
- "null"
if: { type: array }
then: { $ref: "common/id.yaml#/$defs/field_id" }
parent_id:
description: Parent field FK for nested/JSON-unfolded fields
type:
- array
- "null"
if: { type: array }
then: { $ref: "common/id.yaml#/$defs/field_id" }
active:
type: boolean
description: Whether the field is active
default: true
settings:
type:
- object
- "null"
description: Field-level settings
additionalProperties: true
dimensions:
type: array
description: Inlined Dimension entities for remapping
items:
type: object
additionalProperties: true
default: []
serdes/meta:
type: array
description: >
Identity path for serialization. Contains Database, optional Schema,
Table, and one or more Field entries (for nested fields).
items:
type: object
required: [id, model]
properties:
id: { type: string }
model: { type: string, enum: [Database, Schema, Table, Field] }
id:
type: string
model:
type: string
enum: [Database, Schema, Table, Field]
additionalProperties: true
50 changes: 46 additions & 4 deletions core-spec/v1/schemas/field_values.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,58 @@
$schema: https://json-schema.org/draft/2020-12/schema
title: FieldValues
description: Cached distinct values for a field.
description: >
Cached distinct values for a field, used for filter dropdowns and auto-complete.
Serialized alongside the parent field as {field}___fieldvalues.yaml.
type: object
required:
- values
- serdes/meta
properties:
values:
type: array
description: List of distinct field values
items: {}
human_readable_values:
type: array
description: Human-readable labels for remapped values (parallel to values array)
items: {}
default: []
has_more_values:
type: boolean
description: Whether there are more values than cached
default: false
type:
type: string
description: Type of field values cache
enum:
- full
- sandbox
hash_key:
type:
- string
- "null"
description: Hash key for sandbox-scoped field values
created_at:
type: string
description: ISO 8601 timestamp
format: date-time
last_used_at:
type:
- string
- "null"
description: ISO 8601 timestamp of last use
format: date-time
serdes/meta:
type: array
description: >
Identity path for serialization. Contains Database, optional Schema,
Table, Field, and FieldValues entries.
items:
type: object
required: [id, model]
properties:
id: { type: string }
model: { type: string, enum: [Database, Schema, Table, Field, FieldValues] }
additionalProperties: true
id:
type: string
model:
type: string
enum: [Database, Schema, Table, Field, FieldValues]
Loading
Loading