BREAKING CHANGE: For Developers: The HTTP API has now been updated to version v2, with a lot of adjustments made, such as changing to Restful API style, request type, request body, response body, etc. data structure, adding error response codes. You can refer to #735 or https://artalk.js.org/http-api Please update all your existing clients to adapt to the new v2 server. The new base path is `/api/v2/`. The UI package's HTTP client has been implemented to auto-generate based on `Swagger.json`, and there have been a lot of adjustments to the `artalk.ctx.getApi()` related code. In addition, the HTTP API no longer enforces checks on the header's `Origin` and `Referer` (to implement strict isolation of different sites) but still maintains the original CORS origin check.
For General Users: Now all administrators have the same level of authority (there is no longer super admin authority), the function of assigning sub-administrators with independent scope authority to individual sites has been removed, which can simplify the HTTP server maintenance and implementation. Upgrading only requires updating the client and server application at the same time, and there are no additional operations.
* refactor(api): refactor HTTP API to version 2
* refactor: remove forced site_origin check
* refactor: update http client
* fix
* add more api description and error code
* reduce nestings in response structures
* separate unread
* refactor(api/comments): get comments
* refactor: frontend api module
* chore: remove vite temporary file
* chore: restore swagger file
* update
* 移除为管理员分配站点名的站点隔离功能,简化实现
* refactor pagesAllFetch
* fix ci
* remove useless codes
* limiter protected paths
* add test for version endpoint
* rename handler code files
* code file separate
* fix some bug of interacting with backend
* add fetch error class for handling
* fix and rename
* refactor: checker support both `Promise` and callback fn
* fix new checker captcha iframe url
* rename and add swagger id field
* replace tab with spaces in go comment
* chore: refine
* complete the validate tag for request fields and enable `--defaultRequired`
90% of the request fields of our API are required,100% of response fields in our API are required.
Each field add validate:"required" is easy to miss.
* replace original api client with auto-generated codes
* artalk pkg apply new api client
* artalk-sidebar pkg apply new api client
* fix issues
* fix sidebar locale conf and refactor user login
* fix and refactor captcha and limiter
* fix ui testing
* add script to build http client by swagger.json
BREAKING CHANGE: The following top-level functions exported by the 'artalk' npm package have been deprecated: `Artalk.update`, `Artalk.reload`, and `Artalk.destroy`. These methods now require invocation on an instance created by either `Artalk.init` or `new Artalk`. Please utilize instance-level methods instead, such as `artalkInstance.update`. For more information, refer to [the documentation](https://artalk.js.org/guide/frontend/import-framework.html). The update was implemented to enable the concurrent creation of multiple instances, adapting to situations where Vue components are simultaneously referenced across various pages. Initially, only a singular instance was permitted to mitigate memory leak concerns. However, this proved limiting for scenarios involving the caching of multiple component instances through 'keep-alive.' To better suit intricate SPA application needs, the choice was made to permit the creation of multiple independent instances. It's crucial to remember to manually invoke the `artalk.destroy` method when releasing components to avoid memory leaks (Issue #660).
* feat(gravatar): add `gravatar.params` config option
BREAKING CHANGE: The `gravatar.default` config option has been removed. Please use `gravatar.params` instead. The default value for `gravatar.params` is now `"d=mp&s=240"`.
Signed-off-by: qwqcode <qwqcode@gmail.com>
* add docs and fix sidebar
Signed-off-by: qwqcode <qwqcode@gmail.com>
---------
Signed-off-by: qwqcode <qwqcode@gmail.com>