GithubHelp home page GithubHelp logo

awaitlink / rvk Goto Github PK

View Code? Open in Web Editor NEW
23.0 4.0 8.0 521 KB

:package: A set of crates for easy access to the VK (VKontakte) API

Home Page: https://docs.rs/rvk

License: MIT License

Rust 100.00%
vk vk-api vk-sdk api rust-crate methods objects rust async await

rvk's People

Contributors

0xaae avatar acceptthevoid avatar awaitlink avatar dependabot-preview[bot] avatar humb1t avatar iaiao avatar prostomarkeloff avatar thedeax-lab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rvk's Issues

Update to VK API v5.92

  • 5.87 (current)

  • 5.88 (no changes needed)
  • 5.89 (new is_closed and can_access_closed fields in user object)
  • 5.90 (no changes needed)
  • 5.92 (changes to message, wall post, video, market item objects)

Convert `snake_case` to `mixedCase` at compile time instead of runtime

The rvk_methods crate currently uses macros to "generate" functions for all methods. The issue is that in order to convert snake_case names into mixedCase names expected by the VK API, a static HashMap is initialized for each category at runtime.

This is not ideal, as it should be possible to generate everything at compile time by using proc macros and/or build.rs.

https://github.com/u32i64/rvk/blob/64aa7bac9e95f833f0c5ba30633cf2a29c22f14d/rvk_methods/src/lib.rs#L18-L60

Error to get extra field

e.extra =>

field `extra` of struct `rvk::error::APIError` is private```



let value : Value = from_value(e).unwrap();



```mismatched types
expected enum `serde_json::Value`, found struct `rvk::error::APIError````

Allow using a custom API client in `rvk_methods`

Summary

Allow using a custom API client in rvk_methods instead of just rvk::APIClient.

Suggested solution

This will likely involve creating a trait that has the necessary function, call_method, and implementing that trait for rvk::APIClient.

Avoiding rvk_methods depending on rvk

A possible solution for this may be to add a new crate like rvk_traits for this purpose (and also move the Params type alias there, although it might be unnecessary and should rather be entirely removed).

Additionally, rvk_methods::supported_api_client would need to be removed.

Both rvk_methods and rvk would depend on rvk_traits (the former—to use it, the latter—to implement the trait).

Unresolved questions

  • Is the rvk_traits name good enough or should a better one be used (e.g. rvk_core)?
  • Name of the trait.

Captcha error в APIError

У меня есть одна просьба, можете ли вы вывести результат ошибки через функцию to_json в тип Value? Или же как то выдать ссылку на саму каптчу? Могу предложить Pull Request если нужно указать поправку

Messages may not contain "id" field

Example: GetById result where forwarded message have no "id" field

Object({
        "count": Number(1),
        "items": Array([
                Object({
                        "attachments": Array([]),
                        "conversation_message_id": Number(3),
                        "date": Number(1234567890),
                        "from_id": Number(-123456789),
                        "fwd_messages": Array([
                                Object({
                                        "attachments": Array([]),
                                        "conversation_message_id": Number(1),
                                        "date": Number(1234567890),
                                        "from_id": Number(123456789),
                                        "text": String("Бюджетное paзвитие вашей гpуппы, без замоpoженныx. Пpайc - https://vk.com/id123456789")
                                })
                        ]),
                        "id": Number(1234567),
                        "important": Bool(false),
                        "is_hidden": Bool(false),
                        "out": Number(0),
                        "peer_id": Number(-123456789),
                        "random_id": Number(0),
                        "text": String("")
                })
        ])
})

Error:

Could not get message from message id: Serialization/Deserialization error: missing field `id`

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.