Go to file
Karthikeyan S af5445aa79
Merge pull request #149 from famedly/release/v1.17.3
build: Update changelog and readme for 1.7.3
2024-01-09 17:25:25 +05:30
.github chore: add general and publish ci 2023-10-04 15:38:39 +05:30
example refactor: mostly use dart_openapi_codegen 2021-06-25 12:40:03 +02:00
lib fix: Fixed fake_matrix_api.dart signedOneTimeKeys upload 2023-06-22 18:05:04 +02:00
test refactor: Changed Map<String, dynamic> to Map<String, Object?> 2023-06-09 15:04:28 +02:00
.gitignore fix: Fixed dysfunctional key-verification (Emoji+manual) 2022-08-26 09:48:11 +02:00
.gitlab-ci.yml chore: Remove tags for CI test stage 2023-06-12 15:42:51 +02:00
CHANGELOG.md build: Update changelog and readme for 1.7.3 2024-01-09 12:53:44 +01:00
CONTRIBUTING.md fix: Typo and wellknown parsing 2021-03-01 11:38:53 +01:00
LICENSE docs: Update license to MIT 2021-01-08 13:14:03 +01:00
README.md build: Update changelog and readme for 1.7.3 2024-01-09 12:53:44 +01:00
analysis_options.yaml chore: strict casts 2022-08-20 17:26:16 +02:00
pubspec.yaml build: Update changelog and readme for 1.7.3 2024-01-09 12:53:44 +01:00

README.md

Deprecation Notice:

This package will soon be merged with the Matrix Dart SDK and from there be available as a library, not a stand alone package anymore. We hope that this will save us some overhead when maintaining the code. If you rely on this package as stand alone and importing the whole Matrix Dart SDK just to use this library is not an option for you, please open an issue here: https://github.com/famedly/dart_matrix_api_lite/issues

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@github.com:famedly/dart_openapi_codegen.git 1.2 git clone git@github.com:famedly/dart_matrix_api_lite.git
  2. Execute the script in the dart_openapi_codegen directory:
cd dart_openapi_codegen
./scripts/matrix.sh ../dart_matrix_api_lite/lib/src/generated
cd ..
  1. Run the build_runner in the matrix_api_lite directory:
cd dart_matrix_api_lite
dart pub get
dart run build_runner build
  1. Check lints and tests and create a merge request