dtos

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AvailableTypesResponse

type AvailableTypesResponse struct {
	Types []TypeInfo `json:"types"`
}

Available property types

type BulkDeleteRowsRequest

type BulkDeleteRowsRequest struct {
	DatabaseId string   `path:"database_id"`
	RowIds     []string `json:"row_ids"`
}

type CreateDatabaseRequest

type CreateDatabaseRequest struct {
	SpaceId     string           `json:"space_id"`
	DocumentId  *string          `json:"document_id,omitempty"`
	Name        string           `json:"name"`
	Description string           `json:"description,omitempty"`
	Icon        string           `json:"icon,omitempty"`
	Schema      []PropertySchema `json:"schema"`
	Type        string           `json:"type,omitempty"` // "spreadsheet" or "document", defaults to "spreadsheet"
}

type CreateDatabaseResponse

type CreateDatabaseResponse struct {
	Id          string           `json:"id"`
	Name        string           `json:"name"`
	Description string           `json:"description"`
	Icon        string           `json:"icon"`
	Schema      []PropertySchema `json:"schema"`
	DefaultView string           `json:"default_view"`
	Type        string           `json:"type"`
	CreatedAt   time.Time        `json:"created_at"`
}

type CreateRowRequest

type CreateRowRequest struct {
	DatabaseId    string                 `path:"database_id"`
	Properties    map[string]interface{} `json:"properties"`
	Content       map[string]interface{} `json:"content,omitempty"`
	ShowInSidebar bool                   `json:"show_in_sidebar,omitempty"`
}

Row requests

type CreateRowResponse

type CreateRowResponse struct {
	Id         string                 `json:"id"`
	Properties map[string]interface{} `json:"properties"`
	CreatedAt  time.Time              `json:"created_at"`
}

type CreateViewRequest

type CreateViewRequest struct {
	DatabaseId string                 `path:"database_id"`
	Name       string                 `json:"name" validate:"required"`
	Type       string                 `json:"type" validate:"required,oneof=table board calendar gallery list timeline"`
	Filter     map[string]interface{} `json:"filter,omitempty"`
	Sort       []SortConfig           `json:"sort,omitempty"`
	Columns    []string               `json:"columns,omitempty"`
}

View requests

type CreateViewResponse

type CreateViewResponse struct {
	Id      string                 `json:"id"`
	Name    string                 `json:"name"`
	Type    string                 `json:"type"`
	Filter  map[string]interface{} `json:"filter,omitempty"`
	Sort    []SortConfig           `json:"sort,omitempty"`
	Columns []string               `json:"columns,omitempty"`
}

View responses

type DatabaseItem

type DatabaseItem struct {
	Id          string    `json:"id"`
	DocumentId  *string   `json:"document_id,omitempty"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Icon        string    `json:"icon"`
	Type        string    `json:"type"`
	RowCount    int64     `json:"row_count"`
	CreatedBy   string    `json:"created_by"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

type DatabasePermissionItem

type DatabasePermissionItem struct {
	Id        string  `json:"id"`
	UserId    *string `json:"user_id,omitempty"`
	Username  *string `json:"username,omitempty"`
	GroupId   *string `json:"group_id,omitempty"`
	GroupName *string `json:"group_name,omitempty"`
	Role      string  `json:"role"`
}

Permission item

type DeleteDatabasePermissionRequest

type DeleteDatabasePermissionRequest struct {
	DatabaseId string  `path:"database_id"`
	UserId     *string `query:"user_id"`
	GroupId    *string `query:"group_id"`
}

Delete permission request

type DeleteDatabasePermissionResponse

type DeleteDatabasePermissionResponse struct {
	Success bool `json:"success"`
}

type DeleteDatabaseRequest

type DeleteDatabaseRequest struct {
	DatabaseId string `path:"database_id"`
}

type DeleteRowRequest

type DeleteRowRequest struct {
	DatabaseId string `path:"database_id"`
	RowId      string `path:"row_id"`
}

type DeleteViewRequest

type DeleteViewRequest struct {
	DatabaseId string `path:"database_id"`
	ViewId     string `path:"view_id"`
}

type EmptyRequest

type EmptyRequest struct{}

type FilterConfig

type FilterConfig struct {
	And []FilterRule `json:"and,omitempty"`
	Or  []FilterRule `json:"or,omitempty"`
}

type FilterRule

type FilterRule struct {
	Property  string      `json:"property"`
	Condition string      `json:"condition"` // eq, neq, gt, lt, gte, lte, contains, is_empty, is_not_empty
	Value     interface{} `json:"value,omitempty"`
}

Filter rule for querying rows

type GetDatabaseRequest

type GetDatabaseRequest struct {
	DatabaseId string `path:"database_id"`
}

type GetDatabaseResponse

type GetDatabaseResponse struct {
	Id          string           `json:"id"`
	SpaceId     string           `json:"space_id"`
	DocumentId  *string          `json:"document_id,omitempty"`
	Name        string           `json:"name"`
	Description string           `json:"description"`
	Icon        string           `json:"icon"`
	Schema      []PropertySchema `json:"schema"`
	Views       []ViewConfig     `json:"views"`
	DefaultView string           `json:"default_view"`
	Type        string           `json:"type"`
	CreatedBy   string           `json:"created_by"`
	CreatedAt   time.Time        `json:"created_at"`
	UpdatedAt   time.Time        `json:"updated_at"`
}

type GetRowRequest

type GetRowRequest struct {
	DatabaseId string `path:"database_id"`
	RowId      string `path:"row_id"`
}

type GetRowResponse

type GetRowResponse struct {
	Id            string                 `json:"id"`
	DatabaseId    string                 `json:"database_id"`
	Properties    map[string]interface{} `json:"properties"`
	Content       map[string]interface{} `json:"content,omitempty"`
	ShowInSidebar bool                   `json:"show_in_sidebar"`
	CreatedBy     string                 `json:"created_by"`
	CreatedByUser *UserInfo              `json:"created_by_user,omitempty"`
	UpdatedBy     string                 `json:"updated_by,omitempty"`
	UpdatedByUser *UserInfo              `json:"updated_by_user,omitempty"`
	CreatedAt     time.Time              `json:"created_at"`
	UpdatedAt     time.Time              `json:"updated_at"`
}

type ListDatabasePermissionsRequest

type ListDatabasePermissionsRequest struct {
	DatabaseId string `path:"database_id"`
}

List permissions request/response

type ListDatabasePermissionsResponse

type ListDatabasePermissionsResponse struct {
	Permissions []DatabasePermissionItem `json:"permissions"`
}

type ListDatabasesRequest

type ListDatabasesRequest struct {
	SpaceId string `query:"space_id"`
}

type ListDatabasesResponse

type ListDatabasesResponse struct {
	Databases []DatabaseItem `json:"databases"`
}

type ListRowsRequest

type ListRowsRequest struct {
	DatabaseId string `path:"database_id"`
	ViewId     string `query:"view_id"`
	Limit      int    `query:"limit"`
	Offset     int    `query:"offset"`
}

type ListRowsResponse

type ListRowsResponse struct {
	Rows       []RowItem `json:"rows"`
	TotalCount int64     `json:"total_count"`
}

type MessageResponse

type MessageResponse struct {
	Message string `json:"message"`
}

type MoveDatabaseRequest

type MoveDatabaseRequest struct {
	DatabaseId string  `path:"database_id"`
	DocumentId *string `json:"document_id"`
}

Move database

type MoveDatabaseResponse

type MoveDatabaseResponse struct {
	Id         string  `json:"id"`
	DocumentId *string `json:"document_id,omitempty"`
}

type PropertySchema

type PropertySchema struct {
	Id      string                 `json:"id"`
	Name    string                 `json:"name"`
	Type    string                 `json:"type"`
	Options map[string]interface{} `json:"options,omitempty"`
}

type RowItem

type RowItem struct {
	Id            string                 `json:"id"`
	Properties    map[string]interface{} `json:"properties"`
	Content       map[string]interface{} `json:"content,omitempty"`
	ShowInSidebar bool                   `json:"show_in_sidebar"`
	CreatedBy     string                 `json:"created_by"`
	CreatedByUser *UserInfo              `json:"created_by_user,omitempty"`
	UpdatedBy     string                 `json:"updated_by,omitempty"`
	UpdatedByUser *UserInfo              `json:"updated_by_user,omitempty"`
	CreatedAt     time.Time              `json:"created_at"`
	UpdatedAt     time.Time              `json:"updated_at"`
}

type SearchDatabaseResultItem

type SearchDatabaseResultItem struct {
	Id          string    `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Icon        string    `json:"icon,omitempty"`
	Type        string    `json:"type"`
	SpaceId     string    `json:"space_id"`
	SpaceName   string    `json:"space_name"`
	UpdatedAt   time.Time `json:"updated_at"`
}

type SearchDatabasesRequest

type SearchDatabasesRequest struct {
	Query   string  `query:"q"`
	SpaceId *string `query:"space_id"`
	Limit   int     `query:"limit"`
}

Search

type SearchDatabasesResponse

type SearchDatabasesResponse struct {
	Results []SearchDatabaseResultItem `json:"results"`
}

type SortConfig

type SortConfig struct {
	PropertyId string `json:"property_id"`
	Direction  string `json:"direction"`
}

type TypeInfo

type TypeInfo struct {
	Type        string `json:"type"`
	Description string `json:"description"`
}

type UpdateDatabaseRequest

type UpdateDatabaseRequest struct {
	DatabaseId  string            `path:"database_id"`
	Name        *string           `json:"name,omitempty"`
	Description *string           `json:"description,omitempty"`
	Icon        *string           `json:"icon,omitempty"`
	Schema      *[]PropertySchema `json:"schema,omitempty"`
	DefaultView *string           `json:"default_view,omitempty"`
}

type UpdateRowRequest

type UpdateRowRequest struct {
	DatabaseId    string                 `path:"database_id"`
	RowId         string                 `path:"row_id"`
	Properties    map[string]interface{} `json:"properties,omitempty"`
	Content       map[string]interface{} `json:"content,omitempty"`
	ShowInSidebar *bool                  `json:"show_in_sidebar,omitempty"`
}

type UpdateViewRequest

type UpdateViewRequest struct {
	DatabaseId    string                 `path:"database_id"`
	ViewId        string                 `path:"view_id"`
	Name          *string                `json:"name,omitempty"`
	Type          *string                `json:"type,omitempty"`
	Filter        map[string]interface{} `json:"filter,omitempty"`
	Sort          []SortConfig           `json:"sort,omitempty"`
	Columns       []string               `json:"columns,omitempty"`
	HiddenColumns []string               `json:"hidden_columns,omitempty"`
	GroupBy       *string                `json:"group_by,omitempty"`
}

type UpsertDatabasePermissionRequest

type UpsertDatabasePermissionRequest struct {
	DatabaseId string  `path:"database_id"`
	UserId     *string `json:"user_id,omitempty"`
	GroupId    *string `json:"group_id,omitempty"`
	Role       string  `json:"role"`
}

Upsert permission request

type UpsertDatabasePermissionResponse

type UpsertDatabasePermissionResponse struct {
	Success bool `json:"success"`
}

type UserInfo

type UserInfo struct {
	Id        string `json:"id"`
	Username  string `json:"username"`
	AvatarUrl string `json:"avatar_url,omitempty"`
}

UserInfo contains basic user information for display

type ViewConfig

type ViewConfig struct {
	Id            string                 `json:"id"`
	Name          string                 `json:"name"`
	Type          string                 `json:"type"`
	Filter        map[string]interface{} `json:"filter,omitempty"`
	Sort          []SortConfig           `json:"sort,omitempty"`
	Columns       []string               `json:"columns,omitempty"`
	HiddenColumns []string               `json:"hidden_columns,omitempty"`
	GroupBy       string                 `json:"group_by,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL