// Package wikijs is a small typed client for the WikiJS GraphQL API. package wikijs // Tag is a tag attached to a single page. type Tag struct { Tag string `json:"tag"` Title string `json:"title"` } // Page is a full page as returned by the single and singleByPath queries. type Page struct { ID int `json:"id"` Path string `json:"path"` Title string `json:"title"` Description string `json:"description"` Tags []Tag `json:"tags"` Content string `json:"content"` CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` Locale string `json:"locale"` URL string `json:"url"` } // PageListItem is a page entry as returned by the list query. type PageListItem struct { ID int `json:"id"` Path string `json:"path"` Title string `json:"title"` Description string `json:"description"` Tags []string `json:"tags"` CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` Locale string `json:"locale"` URL string `json:"url"` } // SearchHit is a single search result. type SearchHit struct { Title string `json:"title"` Description string `json:"description"` Path string `json:"path"` Locale string `json:"locale"` URL string `json:"url"` } // SearchResults is the result of a page search. type SearchResults struct { Results []SearchHit `json:"results"` Suggestions []string `json:"suggestions"` TotalHits int `json:"totalHits"` } // ListOptions filters the pages returned by [Client.ListPages]. Empty fields are // omitted from the GraphQL request. type ListOptions struct { Limit *int Locale string Tags []string } // CreatePageInput describes a new page. type CreatePageInput struct { Title string Content string Description string Path string Editor string IsPublished bool IsPrivate bool Locale string Tags []string } // UpdatePageInput describes an existing page and its new content. type UpdatePageInput struct { ID int Title string Content string Description string Path string Editor string IsPublished bool IsPrivate bool Locale string Tags []string } // AssetFolder is a folder in the WikiJS asset store. Path is the full folder // path (for example images/vacation), filled in by the client. type AssetFolder struct { ID int `json:"id"` Slug string `json:"slug"` Name string `json:"name"` Path string `json:"path"` } // Asset is a file in the WikiJS asset store. type Asset struct { ID int `json:"id"` FileName string `json:"filename"` Ext string `json:"ext"` Kind string `json:"kind"` MimeType string `json:"mime"` FileSize int `json:"fileSize"` CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` Folder *AssetFolder `json:"folder"` URL string `json:"url"` } // UploadedAsset describes the result of a successful asset upload. type UploadedAsset struct { Filename string `json:"filename"` URL string `json:"url"` } // MutationResult is the normalized WikiJS responseResult of a mutation. type MutationResult struct { Succeeded bool `json:"succeeded"` Message string `json:"message"` ErrorCode int `json:"-"` Slug string `json:"-"` }