matrix_api_lite 1.7.0 copy "matrix_api_lite: ^1.7.0" to clipboard
matrix_api_lite: ^1.7.0 copied to clipboard

discontinued

Dead simple data model for the matrix.org client-server API.

Matrix API Lite #

This package is a dead simple data model over the client-server specification of https://matrix.org and is mostly used as a base for a more complete Matrix SDK. It doesn't contain any logic and just provides methods for all API endpoints and json parser for all objects. It is intended to be as close to the specificaton as possible so we get a 1:1 relationship with the API. More complex logic like a sync loop or a data model for rooms should be implemented in a more complete Matrix SDK.

Usage #

A simple usage example:

import 'package:matrix_api_lite/src/matrix_api.dart';

void main() async {
  final api = MatrixApi(homeserver: Uri.parse('https://matrix.org'));
  final capabilities = await api.requestServerCapabilities();
  print(capabilities.toJson());
}

Generated code #

The files in lib/src/generated are generated by dart_openapi_codegen from matrix-spec.

To regenerate the code, follow these steps:

  1. Clone both repositories next to each other 1.1 git clone git@gitlab.com:famedly/company/frontend/dart_openapi_codegen.git 1.2 git clone git@gitlab.com:famedly/company/frontend/libraries/matrix_api_lite.git
  2. Execute the script in the dart_openapi_codegen directory:
cd dart_openapi_codegen
./scripts/matrix.sh ../matrix_api_lite/lib/src/generated
cd ..
  1. Run the build_runner in the matrix_api_lite directory:
cd matrix_api_lite
dart pub get
dart run build_runner build
  1. Check lints and tests and create a merge request
16
likes
0
pub points
55%
popularity

Publisher

verified publisherfamedly.com

Dead simple data model for the matrix.org client-server API.

Homepage
Repository (GitLab)
View/report issues

License

unknown (license)

Dependencies

enhanced_enum, http, mime

More

Packages that depend on matrix_api_lite