Giter Site home page Giter Site logo

go-misskey's Issues

Implement Charts

  • charts/active-users
  • charts/drive
  • charts/federation
  • charts/hashtag
  • charts/instance
  • charts/network
  • charts/notes

User:

  • charts/user/drive
  • charts/user/following
  • charts/user/notes
  • charts/user/reactions
  • charts/users

https://misskey.io/api-doc#tag/charts

Feature request: Retrieve user from token

Is your feature request related to a problem? Please describe.
I am trying to build a client for misskey in golang.
I was looking for a library for misskey and found this great library and decided to use it. However, it seems that there is no function (like /api/i) to get a user from a token.
Sorry if I just don't know it.

Describe the solution you'd like
I would like to add the ability to retrieve the user assigned to a token.

I've written a Pull Request to resolve this issue, and I'd like you to Merge it if this is not a problem.

Describe alternatives you've considered

Additional context

files.CreateFromURL() causes a crash in the client library.

Describe the bug
The CreateFromURL() function in the Drive service module is causing a crash when it is used.

๐Ÿ“ To Reproduce
Code sample:

client := misskey.NewClient("https://host","API KEY")
if file, err := client.Drive().File().CreateFromURL(&files.CreateFromURLOptions{
  URL: "https://path/to/some/image.jpg",
}); err != nil {
panic(err)
}
// do something with the file object

๐Ÿ™‚ Expected behavior
Client passes the create_from_url call to the Misskey API on the server.

โ˜น๏ธ Actual Behavior

panic: reflect: call of reflect.Value.NumField on ptr Value

goroutine 1 [running]:
reflect.flag.mustBe(...)
        /usr/local/go/src/reflect/value.go:221
reflect.Value.NumField(0x7e0240, 0xc000028080, 0x16, 0xc000046800)
        /usr/local/go/src/reflect/value.go:1369 +0xc5
github.com/yitsushi/go-misskey/core.parseMultipartFields(0x8a4a00, 0xc000028080, 0x20)
        /users/mick/.go/pkg/mod/github.com/yitsushi/[email protected]/core/multipart.go:19 +0x125
github.com/yitsushi/go-misskey/core.(*MultipartRequest).ToBody(0xc0000ca020, 0x845f96, 0x20, 0x0, 0x8a47c0, 0xc00009a180, 0xc00001c1b0, 0x23, 0x23, 0x0)
        /users/mick/.go/pkg/mod/github.com/yitsushi/[email protected]/core/multipart_request.go:38 +0x1a5
github.com/yitsushi/go-misskey.Client.sendRequest(0x83fe9c, 0x11, 0x845f96, 0x20, 0x8a4cc0, 0xc00009ad20, 0xc0000fe070, 0x8a9160, 0xc0000ca020, 0x7c3fa0, ...)
        /users/mick/.go/pkg/mod/github.com/yitsushi/[email protected]/client.go:64 +0x82
github.com/yitsushi/go-misskey.(*Client).requestHandler(0xc0001117f0, 0x8a9160, 0xc0000ca020, 0x7c3fa0, 0xc0001fc000, 0x29f01, 0xc0000ca020)
        /users/mick/.go/pkg/mod/github.com/yitsushi/[email protected]/services.go:21 +0x114
github.com/yitsushi/go-misskey/services/drive/files.(*Service).Create(0xc000111770, 0x83d9a7, 0xa, 0xc00056c3c0, 0x18, 0x0, 0xc000600000, 0x29ffa, 0x30000, 0x0, ...)
        /users/mick/.go/pkg/mod/github.com/yitsushi/[email protected]/services/drive/files/create.go:25 +0x137
github.com/yitsushi/go-misskey/services/drive/files.(*Service).CreateFromURL(0xc000111770, 0xc000111828, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /users/mick/.go/pkg/mod/github.com/yitsushi/[email protected]/services/drive/files/create_from_url.go:31 +0x17e
main.main()
        /users/mick/testbot/main.go:169 +0x3a5

๐Ÿ“Œ Additional context
n/a

Some of the request struct does not respect optional fields

Describe the bug
Some of the requests have missing omitempty annotations, because of that, the request will contain the field with default value (empty string or 0) and Misskey will handle them as requested value and not as an optional field.

๐Ÿ™‚ Expected behavior
All request structs have proper JSON annotation.

โ˜น๏ธ Actual Behavior
Some of the request structs have improper JSON annotation.

๐Ÿ“Œ Additional context
Reference: #93

Parse Data field in admin/queue/jobs response

Is your feature request related to a problem? Please describe.
The admin/queue/jobs endpoint return value depends on the requested Domain. For example Deliver has a very simple structure with only a "To" field in Data, but Inbox contains the while ActivePub Activity object.

Describe the solution you'd like
Maybe #44 gives us the ability to parse the response the right way.

Describe alternatives you've considered
I have no idea now.

Additional context
Related issue: #66

Implement Groups

  • users/groups/create
  • users/groups/delete
  • users/groups/invitations/accept
  • users/groups/invitations/reject
  • users/groups/invite
  • users/groups/joined
  • users/groups/owned
  • users/groups/pull
  • users/groups/show
  • users/groups/transfer
  • users/groups/update

https://misskey.io/api-doc#tag/groups

Support non-authenticated calls

Some of the endpoints can be called without authentication. Some of them returns with different body (not all fields are populated). For simple requests like Instance Metadata, it's can be useful to provide a way to call it without token, for example Instance aggregators.

Add CODE_OF_CONDUCT.md

This one will be tricky... Never did it before, so I have to do some extra research on the topic.

Implement Users

  • pinned-users (use User().Pinned() or something similar to fit in the service properly)
  • username/available (same)
  • users (there is no List endpoint on users, so we can use it for that)
  • users/followers
  • users/following
  • users/get-frequently-replied-users
  • users/notes
  • users/recommendation
  • users/relation
  • users/report-abuse
  • users/search-by-username-and-host
  • users/search
  • users/show

https://misskey.io/api-doc#tag/users

Add Travis test

Acceptance Criteria:

  • Travis is called on each Pull request / Commit
  • go test ./... called
  • golangci-lint run --enable-all called

Optional:

  • go test coverage reported to coveralls.

Implement Note

  • notes/conversation #54
  • notes/children #53
  • notes/create #51
  • notes/delete #51
  • notes/mentions #52
  • notes/unrenote #52
  • notes/featured #45
  • notes/renotes #45
  • notes/replies #45
  • notes/show #45
  • notes/state #45

Search:

  • notes/search-by-tag #53
  • notes/search #45

Timeline:

  • notes/global-timeline #50
  • notes/hybrid-timeline #50
  • notes/local-timeline #50
  • notes/user-list-timeline #50
  • notes/timeline #50

Polls:

  • notes/polls/recommendation #54
  • notes/polls/vote #54

Favorites:

  • notes/favorites/create #54
  • notes/favorites/delete #54

Watching:

  • notes/watching/create #54
  • notes/watching/delete #54

Reactions: (related: #14)

  • notes/reactions #45
  • notes/reactions/create #49
  • notes/reactions/delete #49

Extra:

  • promo/read #49

Documentation: https://misskey.io/api-doc#tag/notes

It will be more than one PR, most likely. This section has a ton of endpoints.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.