models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MkAppPermissionReadAccount        = "read:account"
	MkAppPermissionWriteAccount       = "write:account"
	MkAppPermissionReadBlocks         = "read:blocks"
	MkAppPermissionWriteBlocks        = "write:blocks"
	MkAppPermissionReadDrive          = "read:drive"
	MkAppPermissionWriteDrive         = "write:drive"
	MkAppPermissionReadFavorites      = "read:favorites"
	MkAppPermissionWriteFavorites     = "write:favorites"
	MkAppPermissionReadFollowing      = "read:following"
	MkAppPermissionWriteFollowing     = "write:following"
	MkAppPermissionReadMessaging      = "read:messaging"
	MkAppPermissionWriteMessaging     = "write:messaging"
	MkAppPermissionReadMutes          = "read:mutes"
	MkAppPermissionWriteMutes         = "write:mutes"
	MkAppPermissionWriteNotes         = "write:notes"
	MkAppPermissionReadNotifications  = "read:notifications"
	MkAppPermissionWriteNotifications = "write:notifications"
	MkAppPermissionReadReactions      = "read:reactions"
	MkAppPermissionWriteReactions     = "write:reactions"
	MkAppPermissionWriteVotes         = "write:votes"
	MkAppPermissionReadPages          = "read:pages"
	MkAppPermissionWritePages         = "write:pages"
	MkAppPermissionReadPageLikes      = "read:page-likes"
	MkAppPermissionWritePageLikes     = "write:page-likes"
	MkAppPermissionReadUserGroups     = "read:user-groups"
	MkAppPermissionWriteUserGroups    = "write:user-groups"
	MkAppPermissionReadChannels       = "read:channels"
	MkAppPermissionWriteChannels      = "write:channels"
	MkAppPermissionReadGallery        = "read:gallery"
	MkAppPermissionWriteGallery       = "write:gallery"
	MkAppPermissionReadGalleryLikes   = "read:gallery-likes"
	MkAppPermissionWriteGalleryLikes  = "write:gallery-likes"
)

https://github.com/misskey-dev/misskey/blob/26ae2dfc0f494c377abd878c00044049fcd2bf37/packages/backend/src/misc/api-permissions.ts#L1

Variables

Functions

This section is empty.

Types

type Account

type Account struct {
	ID             string         `json:"id"`
	Username       string         `json:"username"`
	Acct           string         `json:"acct"`
	DisplayName    string         `json:"display_name"`
	Locked         bool           `json:"locked"`
	Bot            bool           `json:"bot"`
	Discoverable   bool           `json:"discoverable"`
	Group          bool           `json:"group"`
	CreatedAt      string         `json:"created_at"`
	Note           string         `json:"note"`
	Url            string         `json:"url"`
	Avatar         string         `json:"avatar"`
	AvatarStatic   string         `json:"avatar_static"`
	Header         string         `json:"header"`
	HeaderStatic   string         `json:"header_static"`
	FollowersCount int            `json:"followers_count"`
	FollowingCount int            `json:"following_count"`
	StatusesCount  int            `json:"statuses_count"`
	LastStatusAt   *string        `json:"last_status_at"`
	Emojis         []CustomEmoji  `json:"emojis"`
	Moved          *Account       `json:"moved,omitempty"`
	Suspended      *bool          `json:"suspended,omitempty"`
	Limited        *bool          `json:"limited,omitempty"`
	Fields         []AccountField `json:"fields"`
}

type AccountField

type AccountField struct {
	Name       string  `json:"name"`
	Value      string  `json:"value"`
	VerifiedAt *string `json:"verified_at,omitempty"`
}

type Application

type Application struct {
	ID           string  `json:"id"`
	Name         string  `json:"name"`
	Website      *string `json:"website"`
	VapidKey     string  `json:"vapid_key"`
	ClientID     *string `json:"client_id"`
	ClientSecret *string `json:"client_secret"`
	RedirectUri  string  `json:"redirect_uri"`
}

type CredentialAccount

type CredentialAccount struct {
	Account
	Source struct {
		Privacy             PostPrivacy    `json:"privacy"`
		Sensitive           bool           `json:"sensitive"`
		Language            string         `json:"language"`
		Note                string         `json:"note"`
		Fields              []AccountField `json:"fields"`
		FollowRequestsCount int            `json:"follow_requests_count"`
	} `json:"source"`
	Role *struct {
		Id          string `json:"id"`
		Name        string `json:"name"`
		Color       string `json:"color"`
		Position    int    `json:"position"`
		Permissions int    `json:"permissions"`
		Highlighted bool   `json:"highlighted"`
		CreatedAt   string `json:"created_at"`
		UpdatedAt   string `json:"updated_at"`
	} `json:"role,omitempty"`
}

type CustomEmoji

type CustomEmoji struct {
	Shortcode       string `json:"shortcode"`
	Url             string `json:"url"`
	StaticUrl       string `json:"static_url"`
	VisibleInPicker bool   `json:"visible_in_picker"`
	Category        string `json:"category"`
}

type Instance

type Instance struct {
	Uri              string       `json:"uri"`
	Title            string       `json:"title"`
	ShortDescription string       `json:"short_description"`
	Description      string       `json:"description"`
	Email            string       `json:"email"`
	Version          string       `json:"version"`
	Urls             InstanceUrls `json:"urls"`
	Stats            struct {
		UserCount   int `json:"user_count"`
		StatusCount int `json:"status_count"`
		DomainCount int `json:"domain_count"`
	} `json:"stats"`
	Thumbnail        string `json:"thumbnail"`
	Languages        any    `json:"languages"`
	Registrations    bool   `json:"registrations"`
	ApprovalRequired bool   `json:"approval_required"`
	InvitesEnabled   bool   `json:"invites_enabled"`
	Configuration    struct {
		Statuses struct {
			MaxCharacters            int `json:"max_characters"`
			MaxMediaAttachments      int `json:"max_media_attachments"`
			CharactersReservedPerUrl int `json:"characters_reserved_per_url"`
		} `json:"statuses"`
		MediaAttachments struct {
			SupportedMimeTypes []string `json:"supported_mime_types"`
		} `json:"media_attachments"`
	} `json:"configuration"`
	ContactAccount Account        `json:"contact_account"`
	Rules          []InstanceRule `json:"rules"`
}

type InstanceRule

type InstanceRule struct {
	ID   string `json:"id"`
	Text string `json:"text"`
}

type InstanceUrls

type InstanceUrls struct {
	StreamingApi string `json:"streaming_api"`
}

type MediaAttachment

type MediaAttachment struct {
	ID          string  `json:"id"`
	BlurHash    string  `json:"blurhash"`
	Url         string  `json:"url"`
	Type        string  `json:"type"`
	TextUrl     *string `json:"text_url"`
	RemoteUrl   string  `json:"remote_url"`
	PreviewUrl  string  `json:"preview_url"`
	Description *string `json:"description"`
	Meta        struct {
		Small struct {
			Aspect float64 `json:"aspect"`
			Width  int     `json:"width"`
			Height int     `json:"height"`
			Size   string  `json:"size"`
		} `json:"small"`
		Original struct {
			Aspect float64 `json:"aspect"`
			Width  int     `json:"width"`
			Height int     `json:"height"`
			Size   string  `json:"size"`
		} `json:"original"`
	} `json:"meta"`
}

type MkApplication

type MkApplication struct {
	ID           string   `json:"id"`
	Name         string   `json:"name"`
	CallbackUrl  string   `json:"callbackUrl"`
	Permission   []string `json:"permission"`
	Secret       string   `json:"secret"`
	IsAuthorized bool     `json:"isAuthorized"`
}

type MkEmoji

type MkEmoji struct {
	Aliases  []string `json:"aliases"`
	Name     string   `json:"name"`
	Category *string  `json:"category"`
	Url      string   `json:"url"`
}

func (MkEmoji) ToCustomEmoji

func (e MkEmoji) ToCustomEmoji() CustomEmoji

type MkFile

type MkFile struct {
	ID           string  `json:"id"`
	ThumbnailUrl string  `json:"thumbnailUrl"`
	Type         string  `json:"type"`
	Url          string  `json:"url"`
	Name         string  `json:"name"`
	IsSensitive  bool    `json:"isSensitive"`
	Size         int64   `json:"size"`
	Md5          string  `json:"md5"`
	CreatedAt    string  `json:"createdAt"`
	BlurHash     *string `json:"blurhash"`
	Properties   struct {
		Width  int `json:"width"`
		Height int `json:"height"`
	} `json:"properties"`
}

func (*MkFile) ToMediaAttachment

func (f *MkFile) ToMediaAttachment() MediaAttachment

type MkFolder

type MkFolder struct {
	Id        string  `json:"id"`
	Name      string  `json:"name"`
	CreatedAt string  `json:"createdAt"`
	ParentId  *string `json:"parentId"`
}

type MkInstance

type MkInstance struct {
	Name            string `json:"name"`
	SoftwareName    string `json:"softwareName"`
	SoftwareVersion string `json:"softwareVersion"`
	ThemeColor      string `json:"themeColor"`
	IconUrl         string `json:"iconUrl"`
	FaviconUrl      string `json:"faviconUrl"`
}

type MkMeta

type MkMeta struct {
	MaintainerName           string   `json:"maintainerName"`
	MaintainerEmail          string   `json:"maintainerEmail"`
	Version                  string   `json:"version"`
	Name                     string   `json:"name"`
	URI                      string   `json:"uri"`
	Description              string   `json:"description"`
	Langs                    []string `json:"langs"`
	TosUrl                   any      `json:"tosUrl"`
	RepositoryUrl            string   `json:"repositoryUrl"`
	FeedbackUrl              string   `json:"feedbackUrl"`
	DisableRegistration      bool     `json:"disableRegistration"`
	EmailRequiredForSignup   bool     `json:"emailRequiredForSignup"`
	EnableHCaptcha           bool     `json:"enableHcaptcha"`
	HCaptchaSiteKey          string   `json:"hcaptchaSiteKey"`
	EnableRecaptcha          bool     `json:"enableRecaptcha"`
	RecaptchaSiteKey         any      `json:"recaptchaSiteKey"`
	EnableTurnstile          bool     `json:"enableTurnstile"`
	TurnstileSiteKey         any      `json:"turnstileSiteKey"`
	SwPublicKey              string   `json:"swPublickey"`
	ThemeColor               string   `json:"themeColor"`
	MascotImageUrl           string   `json:"mascotImageUrl"`
	BannerUrl                string   `json:"bannerUrl"`
	ErrorImageUrl            string   `json:"errorImageUrl"`
	IconUrl                  string   `json:"iconUrl"`
	BackgroundImageUrl       string   `json:"backgroundImageUrl"`
	LogoImageUrl             any      `json:"logoImageUrl"`
	MaxNoteTextLength        int      `json:"maxNoteTextLength"`
	EnableEmail              bool     `json:"enableEmail"`
	EnableTwitterIntegration bool     `json:"enableTwitterIntegration"`
	EnableGithubIntegration  bool     `json:"enableGithubIntegration"`
	EnableDiscordIntegration bool     `json:"enableDiscordIntegration"`
	EnableServiceWorker      bool     `json:"enableServiceWorker"`
	TranslatorAvailable      bool     `json:"translatorAvailable"`
	Policies                 struct {
		GtlAvailable           bool `json:"gtlAvailable"`
		LtlAvailable           bool `json:"ltlAvailable"`
		CanPublicNote          bool `json:"canPublicNote"`
		CanInvite              bool `json:"canInvite"`
		CanManageCustomEmojis  bool `json:"canManageCustomEmojis"`
		DriveCapacityMb        int  `json:"driveCapacityMb"`
		PinLimit               int  `json:"pinLimit"`
		AntennaLimit           int  `json:"antennaLimit"`
		WordMuteLimit          int  `json:"wordMuteLimit"`
		WebhookLimit           int  `json:"webhookLimit"`
		ClipLimit              int  `json:"clipLimit"`
		NoteEachClipsLimit     int  `json:"noteEachClipsLimit"`
		UserListLimit          int  `json:"userListLimit"`
		UserEachUserListsLimit int  `json:"userEachUserListsLimit"`
		RateLimitFactor        int  `json:"rateLimitFactor"`
	} `json:"policies"`
	PinnedPages      []string `json:"pinnedPages"`
	PinnedClipID     any      `json:"pinnedClipId"`
	CacheRemoteFiles bool     `json:"cacheRemoteFiles"`
	RequireSetup     bool     `json:"requireSetup"`
	ProxyAccountName any      `json:"proxyAccountName"`
	Features         struct {
		Registration           bool `json:"registration"`
		EmailRequiredForSignup bool `json:"emailRequiredForSignup"`
		Elasticsearch          bool `json:"elasticsearch"`
		HCaptcha               bool `json:"hcaptcha"`
		Recaptcha              bool `json:"recaptcha"`
		Turnstile              bool `json:"turnstile"`
		ObjectStorage          bool `json:"objectStorage"`
		Twitter                bool `json:"twitter"`
		Github                 bool `json:"github"`
		Discord                bool `json:"discord"`
		ServiceWorker          bool `json:"serviceWorker"`
		MiAuth                 bool `json:"miauth"`
	} `json:"features"`
}

type MkNote

type MkNote struct {
	ID           string           `json:"id"`
	CreatedAt    string           `json:"createdAt"`
	ReplyID      *string          `json:"replyId"`
	ThreadId     *string          `json:"threadId"`
	Text         *string          `json:"text"`
	Name         *string          `json:"name"`
	Cw           *string          `json:"cw"`
	UserId       string           `json:"userId"`
	User         *MkUser          `json:"user"`
	LocalOnly    bool             `json:"localOnly"`
	Reply        *MkNote          `json:"reply"`
	ReNote       *MkNote          `json:"renote"`
	ReNoteId     *string          `json:"renoteId"`
	ReNoteCount  int              `json:"renoteCount"`
	RepliesCount int              `json:"repliesCount"`
	Reactions    map[string]int   `json:"reactions"`
	Visibility   MkNoteVisibility `json:"visibility"`
	Uri          *string          `json:"uri"`
	Url          *string          `json:"url"`
	Score        int              `json:"score"`
	FileIds      []string         `json:"fileIds"`
	Files        []MkFile         `json:"files"`
	Tags         []string         `json:"tags"`
	MyReaction   string           `json:"myReaction"`
}

func (*MkNote) ToStatus

func (n *MkNote) ToStatus(server string) Status

type MkNoteVisibility

type MkNoteVisibility = string
const (
	MkNoteVisibilityPublic MkNoteVisibility = "public"
	MkNoteVisibilityHome   MkNoteVisibility = "home"
	MkNoteVisibilityFollow MkNoteVisibility = "follow"
	MkNoteVisibilitySpecif MkNoteVisibility = "specified"
)

type MkRelation

type MkRelation struct {
	ID                             string `json:"id"`
	IsFollowing                    bool   `json:"isFollowing"`
	IsFollowed                     bool   `json:"isFollowed"`
	HasPendingFollowRequestFromYou bool   `json:"hasPendingFollowRequestFromYou"`
	HasPendingFollowRequestToYou   bool   `json:"hasPendingFollowRequestToYou"`
	IsBlocking                     bool   `json:"isBlocking"`
	IsBlocked                      bool   `json:"isBlocked"`
	IsMuted                        bool   `json:"isMuted"`
}

func (MkRelation) ToRelationship

func (r MkRelation) ToRelationship() Relationship

type MkStats

type MkStats struct {
	NotesCount         int `json:"notesCount"`
	UsersCount         int `json:"usersCount"`
	OriginalUsersCount int `json:"originalUsersCount"`
	OriginalNotesCount int `json:"originalNotesCount"`
	ReactionsCount     int `json:"reactionsCount"`
	Instances          int `json:"instances"`
	DriveUsageLocal    int `json:"driveUsageLocal"`
	DriveUsageRemote   int `json:"driveUsageRemote"`
}

type MkStreamMessage

type MkStreamMessage struct {
	Type string `json:"type"`
}

func (MkStreamMessage) ToStreamEvent

func (m MkStreamMessage) ToStreamEvent() StreamEvent

type MkUser

type MkUser struct {
	ID             string         `json:"id"`
	Username       string         `json:"username"`
	Name           string         `json:"name"`
	Host           *string        `json:"host,omitempty"`
	Location       *string        `json:"location"`
	Description    *string        `json:"description"`
	IsBot          bool           `json:"isBot"`
	IsLocked       bool           `json:"isLocked"`
	CreatedAt      string         `json:"createdAt,omitempty"`
	UpdatedAt      *string        `json:"updatedAt"`
	FollowersCount int            `json:"followersCount"`
	FollowingCount int            `json:"followingCount"`
	NotesCount     int            `json:"notesCount"`
	AvatarUrl      string         `json:"avatarUrl"`
	BannerUrl      string         `json:"bannerUrl"`
	Fields         []AccountField `json:"fields"`
	Instance       MkInstance     `json:"instance"`
	Mentions       []string       `json:"mentions"`
	IsMuted        bool           `json:"isMuted"`
	IsBlocked      bool           `json:"isBlocked"`
	IsBlocking     bool           `json:"isBlocking"`
	IsFollowing    bool           `json:"isFollowing"`
	IsFollowed     bool           `json:"isFollowed"`
}

func (*MkUser) ToAccount

func (u *MkUser) ToAccount(server string) (Account, error)

type NodeInfo

type NodeInfo struct {
	Version           string           `json:"version"`
	Software          NodeInfoSoftware `json:"software"`
	Protocols         []string         `json:"protocols"`
	Services          NodeInfoServices `json:"services"`
	Usage             NodeInfoUsage    `json:"usage"`
	OpenRegistrations bool             `json:"openRegistrations"`
	Metadata          any              `json:"metadata"`
}

type NodeInfoServices

type NodeInfoServices struct {
	Inbound  []string `json:"inbound"`
	Outbound []string `json:"outbound"`
}

type NodeInfoSoftware

type NodeInfoSoftware struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type NodeInfoUsage

type NodeInfoUsage struct {
	Users struct {
		Total          int `json:"total"`
		ActiveMonth    int `json:"activeMonth"`
		ActiveHalfyear int `json:"activeHalfyear"`
	} `json:"users"`
	LocalPosts int `json:"localPosts"`
}

type PostPrivacy

type PostPrivacy = string
const (
	// PostPrivacyPublic Public post
	PostPrivacyPublic PostPrivacy = "public"
	// PostPrivacyUnlisted Unlisted post
	PostPrivacyUnlisted PostPrivacy = "unlisted"
	// PostPrivacyPrivate Followers-only post
	PostPrivacyPrivate PostPrivacy = "private"
	// PostPrivacyDirect Direct post
	PostPrivacyDirect PostPrivacy = "direct"
)

type Relationship

type Relationship struct {
	ID         string `json:"id"`
	Following  bool   `json:"following"`
	FollowedBy bool   `json:"followed_by"`
	// ShowingReblogs bool     `json:"showing_reblogs"`
	Requested bool     `json:"requested"`
	Languages []string `json:"languages"`
	Blocking  bool     `json:"blocking"`
	BlockedBy bool     `json:"blocked_by"`
	Muting    bool     `json:"muting"`
	// MutingNotifications bool     `json:"muting_notifications"`
	// DomainBlocking bool   `json:"domain_blocking"`
	// Endorsed bool   `json:"endorsed"`
	// Notifying bool     `json:"notifying"`
	Note string `json:"note"`
}

type ScheduledStatus

type ScheduledStatus struct {
	ID          string    `json:"id"`
	ScheduledAt time.Time `json:"scheduled_at"`
	Params      struct {
		Text          string           `json:"text"`
		Poll          *string          `json:"poll"`
		MediaIDs      any              `json:"media_ids"` // []string | string | null
		Sensitive     *bool            `json:"sensitive"`
		SpoilerText   *string          `json:"spoiler_text"`
		Visibility    StatusVisibility `json:"visibility"`
		InReplyToID   *int             `json:"in_reply_to_id"` // ID of the Status that will be replied to.
		Language      *string          `json:"language"`
		ApplicationID int              `json:"application_id"`
		ScheduledAt   any              `json:"scheduled_at"`
		Idempotency   *string          `json:"idempotency"`
		WithRateLimit bool             `json:"with_rate_limit"`
	} `json:"params"`
	MediaAttachments []MediaAttachment `json:"media_attachments"`
}

type Status

type Status struct {
	ID                 string            `json:"id"`
	Uri                string            `json:"uri"`
	Url                string            `json:"url"`
	Visibility         StatusVisibility  `json:"visibility"`
	Tags               []StatusTag       `json:"tags"`
	CreatedAt          string            `json:"created_at"`
	EditedAt           *string           `json:"edited_at"`
	Content            string            `json:"content"`
	MediaAttachments   []MediaAttachment `json:"media_attachments"`
	Card               *struct{}         `json:"card"`
	Emojis             []struct{}        `json:"emojis"`
	Account            Account           `json:"account"`
	Sensitive          bool              `json:"sensitive"`
	SpoilerText        string            `json:"spoiler_text"`
	Bookmarked         bool              `json:"bookmarked"`
	Favourited         bool              `json:"favourited"`
	FavouritesCount    int               `json:"favourites_count"`
	InReplyToAccountId *string           `json:"in_reply_to_account_id"`
	InReplyToID        *string           `json:"in_reply_to_id"`
	Language           *string           `json:"language"`
	Mentions           []StatusMention   `json:"mentions"`
	Muted              bool              `json:"muted"`
	Poll               *struct{}         `json:"poll"`
	ReBlog             *Status           `json:"reblog"`
	ReBlogged          bool              `json:"reblogged"`
	ReBlogsCount       int               `json:"reblogs_count"`
	RepliesCount       int               `json:"replies_count"`
}

type StatusMention

type StatusMention struct {
	Id       string `json:"id"`
	Username string `json:"username"`
	Url      string `json:"url"`
	Acct     string `json:"acct"`
}

type StatusTag

type StatusTag struct {
	Name string `json:"name"`
	Url  string `json:"url"`
}

type StatusVisibility

type StatusVisibility string
const (
	// StatusVisibilityPublic Visible to everyone, shown in public timelines.
	StatusVisibilityPublic StatusVisibility = "public"
	// StatusVisibilityUnlisted Visible to public, but not included in public timelines.
	StatusVisibilityUnlisted StatusVisibility = "unlisted"
	// StatusVisibilityPrivate Visible to followers only, and to any mentioned users.
	StatusVisibilityPrivate StatusVisibility = "private"
	// StatusVisibilityDirect Visible only to mentioned users.
	StatusVisibilityDirect StatusVisibility = "direct"
)

type StreamEvent

type StreamEvent struct {
	Event string `json:"event"`
}

type Tag

type Tag struct {
	Name    string `json:"name"`
	Url     string `json:"url"`
	History []struct {
		Day      string `json:"day"`
		Uses     string `json:"uses"`
		Accounts string `json:"accounts"`
	} `json:"history"`
	Following bool `json:"following,omitempty"`
}

type TimelinePublicType

type TimelinePublicType = string
const (
	TimelinePublicTypeLocal  TimelinePublicType = "local"
	TimelinePublicTypeRemote TimelinePublicType = "remote"
)

Jump to

Keyboard shortcuts

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