dto

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: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockTypeParagraph        = "paragraph"
	BlockTypeHeading          = "heading"
	BlockTypeBulletListItem   = "bulletListItem"
	BlockTypeNumberedListItem = "numberedListItem"
	BlockTypeCheckListItem    = "checkListItem"
	BlockTypeTable            = "table"
	BlockTypeImage            = "image"
	BlockTypeVideo            = "video"
	BlockTypeAudio            = "audio"
	BlockTypeFile             = "file"
	BlockTypeCodeBlock        = "codeBlock"
	BlockTypeColumn           = "column"
	BlockTypeColumnList       = "columnList"
)

Types de blocs BlockNote supportés

Variables

This section is empty.

Functions

func BlocksToJSON

func BlocksToJSON(blocks []Block) datatypes.JSON

BlocksToJSON convertit []Block en datatypes.JSON pour le stockage

Types

type Block

type Block struct {
	ID       string          `json:"id"`
	Type     string          `json:"type"` // paragraph, heading, bulletListItem, table, etc.
	Props    map[string]any  `json:"props"`
	Content  []InlineContent `json:"content"`
	Children []Block         `json:"children"`
}

Block représente un bloc BlockNote

func JSONToBlocks

func JSONToBlocks(data datatypes.JSON) []Block

JSONToBlocks convertit datatypes.JSON en []Block

type CommentOutput

type CommentOutput struct {
	Id        string
	UserId    string
	UserName  string
	ParentId  *string
	Content   string
	BlockId   *string
	Resolved  bool
	CreatedAt time.Time
	UpdatedAt time.Time
}

type CreateCommentInput

type CreateCommentInput struct {
	UserId     string
	DocumentId string
	ParentId   *string
	Content    string
	BlockId    *string
}

Create comment

type CreateCommentOutput

type CreateCommentOutput struct {
	CommentId string
}

type CreateDocumentInput

type CreateDocumentInput struct {
	Name     string
	UserId   string
	SpaceId  string
	Content  []Block
	ParentId *string
}

type CreateDocumentOutput

type CreateDocumentOutput struct {
	Document *domain.Document
}

type CreateVersionInput

type CreateVersionInput struct {
	UserId      string
	DocumentId  string
	Description string
}

Create version manually

type CreateVersionOutput

type CreateVersionOutput struct {
	VersionId string
	Version   int
}

type DeleteCommentInput

type DeleteCommentInput struct {
	UserId    string
	CommentId string
}

Delete comment

type DeleteDocumentInput

type DeleteDocumentInput struct {
	UserId     string
	SpaceId    string
	DocumentId *string
	Slug       *string
}

type DeleteDocumentUserPermissionInput

type DeleteDocumentUserPermissionInput struct {
	RequesterId  string
	SpaceId      string
	DocumentId   string
	TargetUserId string
}

type Document

type Document struct {
	Id       string
	Name     string
	Slug     string
	ParentId *string
	SpaceId  string
	Public   bool
	Content  []Block
	Config   DocumentConfig
	Metadata map[string]any

	CreatedAt time.Time
	UpdatedAt time.Time
}

Document représente un document dans la couche application

type DocumentConfig

type DocumentConfig struct {
	FullWidth        bool   `json:"fullWidth"`
	Icon             string `json:"icon"`
	Lock             bool   `json:"lock"`
	HeaderBackground string `json:"headerBackground"`
}

DocumentConfig représente la configuration d'un document

type GetCommentsInput

type GetCommentsInput struct {
	UserId     string
	DocumentId string
}

Get comments

type GetCommentsOutput

type GetCommentsOutput struct {
	Comments []CommentOutput
}

type GetDocumentWithSpaceInput

type GetDocumentWithSpaceInput struct {
	UserId     string
	SpaceId    string
	DocumentId *string
	Slug       *string
}

type GetDocumentWithSpaceOutput

type GetDocumentWithSpaceOutput struct {
	Document *domain.Document
}

type GetDocumentsFromSpaceInput

type GetDocumentsFromSpaceInput struct {
	SpaceId  string
	UserId   string
	ParentId *string
}

type GetDocumentsFromSpaceOutput

type GetDocumentsFromSpaceOutput struct {
	Documents []domain.Document
}

type GetPublicDocumentInput

type GetPublicDocumentInput struct {
	SpaceId    string
	DocumentId *string
	Slug       *string
}

type GetPublicDocumentOutput

type GetPublicDocumentOutput struct {
	Document *domain.Document
}

type GetTrashInput

type GetTrashInput struct {
	UserId  string
	SpaceId string
}

type GetTrashOutput

type GetTrashOutput struct {
	Documents []domain.Document
}

type GetVersionInput

type GetVersionInput struct {
	UserId    string
	VersionId string
}

Get version

type GetVersionOutput

type GetVersionOutput struct {
	Id          string
	Version     int
	DocumentId  string
	Name        string
	Content     []Block
	Config      DocumentConfig
	Description string
	UserId      string
	UserName    string
	CreatedAt   time.Time
}

type InlineContent

type InlineContent struct {
	Type   string          `json:"type"` // "text", "link"
	Text   string          `json:"text,omitempty"`
	Href   string          `json:"href,omitempty"`
	Styles map[string]bool `json:"styles"`
}

InlineContent représente le contenu inline (texte, liens, etc.)

type ListDocumentPermissionsInput

type ListDocumentPermissionsInput struct {
	RequesterId string
	SpaceId     string
	DocumentId  string
}

type ListDocumentPermissionsOutput

type ListDocumentPermissionsOutput struct {
	Permissions []domain.Permission
}

type ListVersionsInput

type ListVersionsInput struct {
	UserId     string
	SpaceId    string
	DocumentId string
	Limit      int
	Offset     int
}

List versions

type ListVersionsOutput

type ListVersionsOutput struct {
	Versions   []VersionItem
	TotalCount int64
}

type MoveDocumentInput

type MoveDocumentInput struct {
	UserId      string
	SpaceId     string
	DocumentId  string
	NewParentId *string
}

type MoveDocumentOutput

type MoveDocumentOutput struct {
	Document *domain.Document
}

type ReorderDocumentsInput

type ReorderDocumentsInput struct {
	UserId  string
	SpaceId string
	Items   []ReorderItem
}

type ReorderItem

type ReorderItem struct {
	Id       string
	Position int
}

type ResolveCommentInput

type ResolveCommentInput struct {
	UserId    string
	CommentId string
	Resolved  bool
}

Resolve comment

type RestoreDocumentInput

type RestoreDocumentInput struct {
	UserId     string
	SpaceId    string
	DocumentId string
}

type RestoreVersionInput

type RestoreVersionInput struct {
	UserId    string
	VersionId string
}

Restore version

type SearchInput

type SearchInput struct {
	UserId  string
	Query   string
	SpaceId *string
	Limit   int
}

type SearchOutput

type SearchOutput struct {
	Results []SearchResultItem
}

type SearchResultItem

type SearchResultItem struct {
	Id        string
	Name      string
	Slug      string
	SpaceId   string
	SpaceName string
	Icon      string
	UpdatedAt time.Time
}

type SetPublicInput

type SetPublicInput struct {
	UserId     string
	SpaceId    string
	DocumentId string
	Public     bool
}

type UpdateCommentInput

type UpdateCommentInput struct {
	UserId    string
	CommentId string
	Content   string
}

Update comment

type UpdateDocumentInput

type UpdateDocumentInput struct {
	UserId     string
	SpaceId    string
	DocumentId string
	Name       *string
	Content    *[]Block
	ParentId   *string
	Config     *domain.DocumentConfig
	Metadata   *domain.JSONB
}

type UpdateDocumentOutput

type UpdateDocumentOutput struct {
	Document *domain.Document
}

type UpsertDocumentUserPermissionInput

type UpsertDocumentUserPermissionInput struct {
	RequesterId  string
	SpaceId      string
	DocumentId   string
	TargetUserId string
	Role         domain.PermissionRole
}

type VersionItem

type VersionItem struct {
	Id          string
	Version     int
	Name        string
	Description string
	UserId      string
	UserName    string
	CreatedAt   time.Time
}

Jump to

Keyboard shortcuts

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