| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- // 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
- }
- // 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:"-"`
- }
|