Files
Docwell/Server/internal/api/api.gen.go
T
tajniak81andClaude Opus 5.5 ba394b8fac Finish Phase 0: lint, codegen, contributor docs and the two remaining spikes
Repository basics:
- CONTRIBUTING.md and CODE_OF_CONDUCT.md (Contributor Covenant 2.1)
- SPDX AGPL-3.0-or-later headers on all hand-written sources, checked in CI
- golangci-lint (shared .golangci.yml), ESLint and Prettier, all run in CI

API codegen from api/openapi.yaml (npm run generate, drift fails CI):
- Go types via oapi-codegen in Server/internal/api
- a contract test that the router and the spec list the same routes
- Dart models via Phone-App/tool/generate_api.dart; the app uses them

Spike: shared Tiptap editor in a Flutter WebView (ADR-4)
- @docwell/editor-bridge builds the editor into one HTML page with a
  versioned JSON protocol; Phone-App hosts it with webview_flutter and a
  native toolbar. Integration test passes on an Android API 35 emulator.
- flutter_inappwebview dropped: its Android plugin fails on AGP 9.

Spike: Wails v3 desktop (ADR-11)
- system tray, docwell:// deep links (page and space only) with
  single-instance hand-off, and the built-in updater with a required
  ed25519 signing key. Verified on Windows.
- regenerated build assets register the scheme and drop template
  placeholders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 16:11:07 +01:00

615 lines
19 KiB
Go

// Package api provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.1 DO NOT EDIT.
package api
import (
openapi_types "github.com/oapi-codegen/runtime/types"
)
// Defines values for Role.
const (
RoleAdmin Role = "admin"
RoleSuperadmin Role = "superadmin"
RoleUser Role = "user"
)
// Valid indicates whether the value is a known member of the Role enum.
func (e Role) Valid() bool {
switch e {
case RoleAdmin:
return true
case RoleSuperadmin:
return true
case RoleUser:
return true
default:
return false
}
}
// Defines values for SpaceDefaultRole.
const (
SpaceDefaultRoleCommenter SpaceDefaultRole = "commenter"
SpaceDefaultRoleEditor SpaceDefaultRole = "editor"
SpaceDefaultRoleViewer SpaceDefaultRole = "viewer"
)
// Valid indicates whether the value is a known member of the SpaceDefaultRole enum.
func (e SpaceDefaultRole) Valid() bool {
switch e {
case SpaceDefaultRoleCommenter:
return true
case SpaceDefaultRoleEditor:
return true
case SpaceDefaultRoleViewer:
return true
default:
return false
}
}
// Defines values for SpaceRole.
const (
SpaceRoleAdmin SpaceRole = "admin"
SpaceRoleCommenter SpaceRole = "commenter"
SpaceRoleEditor SpaceRole = "editor"
SpaceRoleViewer SpaceRole = "viewer"
)
// Valid indicates whether the value is a known member of the SpaceRole enum.
func (e SpaceRole) Valid() bool {
switch e {
case SpaceRoleAdmin:
return true
case SpaceRoleCommenter:
return true
case SpaceRoleEditor:
return true
case SpaceRoleViewer:
return true
default:
return false
}
}
// Defines values for SpaceVisibility.
const (
Open SpaceVisibility = "open"
Private SpaceVisibility = "private"
)
// Valid indicates whether the value is a known member of the SpaceVisibility enum.
func (e SpaceVisibility) Valid() bool {
switch e {
case Open:
return true
case Private:
return true
default:
return false
}
}
// Defines values for StatusStatus.
const (
Ok StatusStatus = "ok"
Unavailable StatusStatus = "unavailable"
)
// Valid indicates whether the value is a known member of the StatusStatus enum.
func (e StatusStatus) Valid() bool {
switch e {
case Ok:
return true
case Unavailable:
return true
default:
return false
}
}
// Defines values for UpdateUserRequestStatus.
const (
UpdateUserRequestStatusActive UpdateUserRequestStatus = "active"
UpdateUserRequestStatusDisabled UpdateUserRequestStatus = "disabled"
UpdateUserRequestStatusInvited UpdateUserRequestStatus = "invited"
)
// Valid indicates whether the value is a known member of the UpdateUserRequestStatus enum.
func (e UpdateUserRequestStatus) Valid() bool {
switch e {
case UpdateUserRequestStatusActive:
return true
case UpdateUserRequestStatusDisabled:
return true
case UpdateUserRequestStatusInvited:
return true
default:
return false
}
}
// Defines values for UserStatus.
const (
UserStatusActive UserStatus = "active"
UserStatusDisabled UserStatus = "disabled"
UserStatusInvited UserStatus = "invited"
)
// Valid indicates whether the value is a known member of the UserStatus enum.
func (e UserStatus) Valid() bool {
switch e {
case UserStatusActive:
return true
case UserStatusDisabled:
return true
case UserStatusInvited:
return true
default:
return false
}
}
// Defines values for WorkspaceRole.
const (
WorkspaceRoleAdmin WorkspaceRole = "admin"
WorkspaceRoleGuest WorkspaceRole = "guest"
WorkspaceRoleMember WorkspaceRole = "member"
WorkspaceRoleOwner WorkspaceRole = "owner"
)
// Valid indicates whether the value is a known member of the WorkspaceRole enum.
func (e WorkspaceRole) Valid() bool {
switch e {
case WorkspaceRoleAdmin:
return true
case WorkspaceRoleGuest:
return true
case WorkspaceRoleMember:
return true
case WorkspaceRoleOwner:
return true
default:
return false
}
}
// AuthMethods defines model for AuthMethods.
type AuthMethods struct {
Mfa bool `json:"mfa"`
Oauth2 []string `json:"oauth2"`
Otp bool `json:"otp"`
Password bool `json:"password"`
Signup bool `json:"signup"`
}
// CreateUserRequest defines model for CreateUserRequest.
type CreateUserRequest struct {
Email openapi_types.Email `json:"email"`
Name string `json:"name"`
// Organization Superadmins only; admins always create in their own
Organization *string `json:"organization,omitempty"`
Password string `json:"password"`
// Role Instance role. admin manages their own organization; superadmin manages everything.
Role *Role `json:"role,omitempty"`
}
// EmailRequest defines model for EmailRequest.
type EmailRequest struct {
Email openapi_types.Email `json:"email"`
}
// Error defines model for Error.
type Error struct {
// Error invalid_json, validation, invalid_credentials, mfa_required, unauthorized, forbidden, account_disabled, signup_disabled, domain_not_allowed, invalid_token, invalid, not_found, conflict, internal
Error string `json:"error"`
Fields *map[string]string `json:"fields,omitempty"`
// Message Human-readable explanation
Message *string `json:"message,omitempty"`
MfaId *string `json:"mfaId,omitempty"`
}
// LoginRequest defines model for LoginRequest.
type LoginRequest struct {
Email openapi_types.Email `json:"email"`
MfaId *string `json:"mfaId,omitempty"`
Password string `json:"password"`
}
// NameRequest defines model for NameRequest.
type NameRequest struct {
Name string `json:"name"`
}
// Organization defines model for Organization.
type Organization struct {
Created string `json:"created"`
Id string `json:"id"`
Members int `json:"members"`
Name string `json:"name"`
Workspaces int `json:"workspaces"`
}
// Page defines model for Page.
type Page struct {
// Ancestors Root first
Ancestors []PageRef `json:"ancestors"`
Created string `json:"created"`
// DeletedAt When the page itself was trashed; empty otherwise
DeletedAt string `json:"deletedAt"`
Icon string `json:"icon"`
Id string `json:"id"`
// InTrash The page or one of its ancestors is in the trash
InTrash bool `json:"inTrash"`
Parent string `json:"parent"`
Role SpaceRole `json:"role"`
Space string `json:"space"`
Title string `json:"title"`
Updated string `json:"updated"`
Workspace string `json:"workspace"`
}
// PageContent defines model for PageContent.
type PageContent struct {
// Content Tiptap JSON with type "doc"; null for a page that was never edited
Content *map[string]interface{} `json:"content"`
Updated string `json:"updated"`
}
// PageNode defines model for PageNode.
type PageNode struct {
Icon string `json:"icon"`
Id string `json:"id"`
// Parent Parent page id; empty at the top level
Parent string `json:"parent"`
// Position Fractional sort key among siblings
Position string `json:"position"`
Title string `json:"title"`
Updated string `json:"updated"`
}
// PageRef defines model for PageRef.
type PageRef struct {
Icon string `json:"icon"`
Id string `json:"id"`
Title string `json:"title"`
}
// PageVersion defines model for PageVersion.
type PageVersion struct {
// Author Name (or email) of the last person who edited before it was taken
Author string `json:"author"`
Created string `json:"created"`
Id string `json:"id"`
Label string `json:"label"`
}
// Role Instance role. admin manages their own organization; superadmin manages everything.
type Role string
// Session defines model for Session.
type Session struct {
Token string `json:"token"`
User User `json:"user"`
}
// SignupRequest defines model for SignupRequest.
type SignupRequest struct {
Email openapi_types.Email `json:"email"`
Name string `json:"name"`
Password string `json:"password"`
}
// Space defines model for Space.
type Space struct {
Created string `json:"created"`
// DefaultRole Role that workspace members (not guests) get in an open space without an explicit role.
DefaultRole SpaceDefaultRole `json:"defaultRole"`
Description string `json:"description"`
Icon string `json:"icon"`
Id string `json:"id"`
Name string `json:"name"`
Role SpaceRole `json:"role"`
Slug string `json:"slug"`
// Visibility open - every workspace member gets the default role; private - explicit members only.
Visibility SpaceVisibility `json:"visibility"`
Workspace string `json:"workspace"`
}
// SpaceDefaultRole Role that workspace members (not guests) get in an open space without an explicit role.
type SpaceDefaultRole string
// SpaceMember defines model for SpaceMember.
type SpaceMember struct {
Role SpaceRole `json:"role"`
User struct {
Email string `json:"email"`
Id string `json:"id"`
Name string `json:"name"`
} `json:"user"`
}
// SpaceRole defines model for SpaceRole.
type SpaceRole string
// SpaceVisibility open - every workspace member gets the default role; private - explicit members only.
type SpaceVisibility string
// Status defines model for Status.
type Status struct {
Db *string `json:"db,omitempty"`
Status StatusStatus `json:"status"`
}
// StatusStatus defines model for Status.Status.
type StatusStatus string
// TrashedPage defines model for TrashedPage.
type TrashedPage struct {
DeletedAt string `json:"deletedAt"`
Icon string `json:"icon"`
Id string `json:"id"`
Title string `json:"title"`
}
// UpdateUserRequest defines model for UpdateUserRequest.
type UpdateUserRequest struct {
Email *openapi_types.Email `json:"email,omitempty"`
Name *string `json:"name,omitempty"`
// Organization Superadmins only; empty string detaches
Organization *string `json:"organization,omitempty"`
Password *string `json:"password,omitempty"`
// Role Instance role. admin manages their own organization; superadmin manages everything.
Role *Role `json:"role,omitempty"`
Status *UpdateUserRequestStatus `json:"status,omitempty"`
Verified *bool `json:"verified,omitempty"`
}
// UpdateUserRequestStatus defines model for UpdateUserRequest.Status.
type UpdateUserRequestStatus string
// User defines model for User.
type User struct {
Avatar string `json:"avatar"`
Created string `json:"created"`
Email openapi_types.Email `json:"email"`
Id string `json:"id"`
Locale string `json:"locale"`
Name string `json:"name"`
// Organization Organization id
Organization string `json:"organization"`
OrganizationName string `json:"organizationName"`
// Role Instance role. admin manages their own organization; superadmin manages everything.
Role Role `json:"role"`
Status UserStatus `json:"status"`
Theme string `json:"theme"`
Verified bool `json:"verified"`
}
// UserStatus defines model for User.Status.
type UserStatus string
// UserList defines model for UserList.
type UserList struct {
Items []User `json:"items"`
Page int `json:"page"`
PerPage int `json:"perPage"`
TotalItems int `json:"totalItems"`
}
// Version defines model for Version.
type Version struct {
Name string `json:"name"`
Version string `json:"version"`
}
// Workspace defines model for Workspace.
type Workspace struct {
Created string `json:"created"`
Id string `json:"id"`
Name string `json:"name"`
Organization string `json:"organization"`
OrganizationName string `json:"organizationName"`
Role WorkspaceRole `json:"role"`
Slug string `json:"slug"`
}
// WorkspaceMember defines model for WorkspaceMember.
type WorkspaceMember struct {
Role WorkspaceRole `json:"role"`
User struct {
Email string `json:"email"`
Id string `json:"id"`
Name string `json:"name"`
} `json:"user"`
}
// WorkspaceRole defines model for WorkspaceRole.
type WorkspaceRole string
// LoginWithOtpJSONBody defines parameters for LoginWithOtp.
type LoginWithOtpJSONBody struct {
Code string `json:"code"`
MfaId *string `json:"mfaId,omitempty"`
OtpId string `json:"otpId"`
}
// ConfirmPasswordResetJSONBody defines parameters for ConfirmPasswordReset.
type ConfirmPasswordResetJSONBody struct {
Password string `json:"password"`
Token string `json:"token"`
}
// ConfirmVerificationJSONBody defines parameters for ConfirmVerification.
type ConfirmVerificationJSONBody struct {
Token string `json:"token"`
}
// DeletePageParams defines parameters for DeletePage.
type DeletePageParams struct {
Permanent *bool `form:"permanent,omitempty" json:"permanent,omitempty"`
}
// UpdatePageJSONBody defines parameters for UpdatePage.
type UpdatePageJSONBody struct {
Icon *string `json:"icon,omitempty"`
Title *string `json:"title,omitempty"`
}
// SavePageContentJSONBody defines parameters for SavePageContent.
type SavePageContentJSONBody struct {
// Content Tiptap JSON with type "doc"
Content map[string]interface{} `json:"content"`
}
// MovePageJSONBody defines parameters for MovePage.
type MovePageJSONBody struct {
// Index Position among the new parent's other children
Index int `json:"index"`
// Parent New parent page id; empty for the top level
Parent *string `json:"parent,omitempty"`
}
// UpdateSpaceJSONBody defines parameters for UpdateSpace.
type UpdateSpaceJSONBody struct {
// DefaultRole Role that workspace members (not guests) get in an open space without an explicit role.
DefaultRole *SpaceDefaultRole `json:"defaultRole,omitempty"`
Description *string `json:"description,omitempty"`
Icon *string `json:"icon,omitempty"`
Name *string `json:"name,omitempty"`
// Visibility open - every workspace member gets the default role; private - explicit members only.
Visibility *SpaceVisibility `json:"visibility,omitempty"`
}
// SetSpaceMemberJSONBody defines parameters for SetSpaceMember.
type SetSpaceMemberJSONBody struct {
Email openapi_types.Email `json:"email"`
Role SpaceRole `json:"role"`
}
// CreatePageJSONBody defines parameters for CreatePage.
type CreatePageJSONBody struct {
// Index Position among the parent's children; missing appends
Index *int `json:"index,omitempty"`
// Parent Parent page id; empty or missing for the top level
Parent *string `json:"parent,omitempty"`
Title *string `json:"title,omitempty"`
}
// ListUsersParams defines parameters for ListUsers.
type ListUsersParams struct {
Page *int `form:"page,omitempty" json:"page,omitempty"`
PerPage *int `form:"perPage,omitempty" json:"perPage,omitempty"`
// Q Search in email and name
Q *string `form:"q,omitempty" json:"q,omitempty"`
// Organization Superadmin only: an organization id, or 'none'
Organization *string `form:"organization,omitempty" json:"organization,omitempty"`
}
// CreateWorkspaceJSONBody defines parameters for CreateWorkspace.
type CreateWorkspaceJSONBody struct {
Name string `json:"name"`
Organization *string `json:"organization,omitempty"`
}
// SetWorkspaceMemberJSONBody defines parameters for SetWorkspaceMember.
type SetWorkspaceMemberJSONBody struct {
Email openapi_types.Email `json:"email"`
Role WorkspaceRole `json:"role"`
}
// CreateSpaceJSONBody defines parameters for CreateSpace.
type CreateSpaceJSONBody struct {
Description *string `json:"description,omitempty"`
Icon *string `json:"icon,omitempty"`
Name string `json:"name"`
// Visibility open - every workspace member gets the default role; private - explicit members only.
Visibility *SpaceVisibility `json:"visibility,omitempty"`
}
// LoginJSONRequestBody defines body for Login for application/json ContentType.
type LoginJSONRequestBody = LoginRequest
// LoginWithOtpJSONRequestBody defines body for LoginWithOtp for application/json ContentType.
type LoginWithOtpJSONRequestBody LoginWithOtpJSONBody
// RequestOtpJSONRequestBody defines body for RequestOtp for application/json ContentType.
type RequestOtpJSONRequestBody = EmailRequest
// ConfirmPasswordResetJSONRequestBody defines body for ConfirmPasswordReset for application/json ContentType.
type ConfirmPasswordResetJSONRequestBody ConfirmPasswordResetJSONBody
// RequestPasswordResetJSONRequestBody defines body for RequestPasswordReset for application/json ContentType.
type RequestPasswordResetJSONRequestBody = EmailRequest
// SignupJSONRequestBody defines body for Signup for application/json ContentType.
type SignupJSONRequestBody = SignupRequest
// ConfirmVerificationJSONRequestBody defines body for ConfirmVerification for application/json ContentType.
type ConfirmVerificationJSONRequestBody ConfirmVerificationJSONBody
// RequestVerificationJSONRequestBody defines body for RequestVerification for application/json ContentType.
type RequestVerificationJSONRequestBody = EmailRequest
// CreateOrgJSONRequestBody defines body for CreateOrg for application/json ContentType.
type CreateOrgJSONRequestBody = NameRequest
// RenameOrgJSONRequestBody defines body for RenameOrg for application/json ContentType.
type RenameOrgJSONRequestBody = NameRequest
// UpdatePageJSONRequestBody defines body for UpdatePage for application/json ContentType.
type UpdatePageJSONRequestBody UpdatePageJSONBody
// SavePageContentJSONRequestBody defines body for SavePageContent for application/json ContentType.
type SavePageContentJSONRequestBody SavePageContentJSONBody
// MovePageJSONRequestBody defines body for MovePage for application/json ContentType.
type MovePageJSONRequestBody MovePageJSONBody
// UpdateSpaceJSONRequestBody defines body for UpdateSpace for application/json ContentType.
type UpdateSpaceJSONRequestBody UpdateSpaceJSONBody
// SetSpaceMemberJSONRequestBody defines body for SetSpaceMember for application/json ContentType.
type SetSpaceMemberJSONRequestBody SetSpaceMemberJSONBody
// CreatePageJSONRequestBody defines body for CreatePage for application/json ContentType.
type CreatePageJSONRequestBody CreatePageJSONBody
// CreateUserJSONRequestBody defines body for CreateUser for application/json ContentType.
type CreateUserJSONRequestBody = CreateUserRequest
// UpdateUserJSONRequestBody defines body for UpdateUser for application/json ContentType.
type UpdateUserJSONRequestBody = UpdateUserRequest
// CreateWorkspaceJSONRequestBody defines body for CreateWorkspace for application/json ContentType.
type CreateWorkspaceJSONRequestBody CreateWorkspaceJSONBody
// RenameWorkspaceJSONRequestBody defines body for RenameWorkspace for application/json ContentType.
type RenameWorkspaceJSONRequestBody = NameRequest
// SetWorkspaceMemberJSONRequestBody defines body for SetWorkspaceMember for application/json ContentType.
type SetWorkspaceMemberJSONRequestBody SetWorkspaceMemberJSONBody
// CreateSpaceJSONRequestBody defines body for CreateSpace for application/json ContentType.
type CreateSpaceJSONRequestBody CreateSpaceJSONBody