diff --git a/.gitignore b/.gitignore index c58f4c2..b132e14 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ example/config.dart .idea +.keystore.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a41198..12225db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.2.9 + +* update verification response + ## 1.2.8 * Fix code generation for `Asset` class. diff --git a/example/pubspec.lock b/example/pubspec.lock index f94978d..014b4c1 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -53,10 +53,10 @@ packages: dependency: transitive description: name: crypto - sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27 url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" dart_jsonwebtoken: dependency: transitive description: @@ -77,18 +77,18 @@ packages: dependency: transitive description: name: dio - sha256: e17f6b3097b8c51b72c74c9f071a605c47bcc8893839bd66732457a5ebe73714 + sha256: "5598aa796bbf4699afd5c67c0f5f6e2ed542afc956884b9cd58c306966efc260" url: "https://pub.dev" source: hosted - version: "5.5.0+1" + version: "5.7.0" dio_web_adapter: dependency: transitive description: name: dio_web_adapter - sha256: "36c5b2d79eb17cdae41e974b7a8284fec631651d2a6f39a8a2ff22327e90aeac" + sha256: "33259a9276d6cea88774a0000cfae0d861003497755969c92faa223108620dc8" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "2.0.0" ed25519_edwards: dependency: "direct main" description: @@ -133,10 +133,10 @@ packages: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "40f592dd352890c3b60fec1b68e786cefb9603e05ff303dbc4dda49b304ecdf4" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.0" intl: dependency: transitive description: @@ -175,7 +175,7 @@ packages: path: ".." relative: true source: path - version: "1.2.7" + version: "1.2.8" path: dependency: transitive description: @@ -260,10 +260,10 @@ packages: dependency: transitive description: name: uuid - sha256: "83d37c7ad7aaf9aa8e275490669535c8080377cfa7a7004c24dfac53afffaa90" + sha256: f33d6bb662f0e4f79dcd7ada2e6170f3b3a2530c28fc41f49a411ddedd576a77 url: "https://pub.dev" source: hosted - version: "4.4.2" + version: "4.5.0" very_good_analysis: dependency: "direct dev" description: @@ -272,6 +272,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.1.0" + web: + dependency: transitive + description: + name: web + sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062 + url: "https://pub.dev" + source: hosted + version: "1.0.0" x25519: dependency: transitive description: diff --git a/lib/src/vo/account.dart b/lib/src/vo/account.dart index c7dec42..40a8463 100644 --- a/lib/src/vo/account.dart +++ b/lib/src/vo/account.dart @@ -37,6 +37,7 @@ class Account with EquatableMixin { required this.tipKeyBase64, this.fullName, this.avatarUrl, + this.membership, }); factory Account.fromJson(Map json) => diff --git a/lib/src/vo/account.g.dart b/lib/src/vo/account.g.dart index 488eeb4..ab38274 100644 --- a/lib/src/vo/account.g.dart +++ b/lib/src/vo/account.g.dart @@ -38,9 +38,10 @@ Account _$AccountFromJson(Map json) => Account( tipKeyBase64: json['tip_key_base64'] as String, fullName: json['full_name'] as String?, avatarUrl: json['avatar_url'] as String?, - )..membership = json['membership'] == null - ? null - : Membership.fromJson(json['membership'] as Map); + membership: json['membership'] == null + ? null + : Membership.fromJson(json['membership'] as Map), + ); Map _$AccountToJson(Account instance) => { 'user_id': instance.userId, diff --git a/lib/src/vo/verification_response.dart b/lib/src/vo/verification_response.dart index c39128d..53a4a53 100644 --- a/lib/src/vo/verification_response.dart +++ b/lib/src/vo/verification_response.dart @@ -10,7 +10,8 @@ class VerificationResponse extends Equatable { required this.id, this.hasEmergencyContact = false, this.contactId, - this.deactivatedAt, + this.deactivationEffectiveAt, + this.deactivationRequestedAt, }); factory VerificationResponse.fromJson(Map json) => @@ -28,8 +29,10 @@ class VerificationResponse extends Equatable { @JsonKey(name: 'contact_id') final String? contactId; - @JsonKey(name: 'deactivated_at') - final String? deactivatedAt; + @JsonKey(name: 'deactivation_requested_at') + final DateTime? deactivationRequestedAt; + @JsonKey(name: 'deactivation_effective_at') + final DateTime? deactivationEffectiveAt; @override List get props => [ @@ -37,7 +40,8 @@ class VerificationResponse extends Equatable { id, hasEmergencyContact, contactId, - deactivatedAt, + deactivationRequestedAt, + deactivationEffectiveAt, ]; Map toJson() => _$VerificationResponseToJson(this); diff --git a/lib/src/vo/verification_response.g.dart b/lib/src/vo/verification_response.g.dart index 8f31edb..c02bf09 100644 --- a/lib/src/vo/verification_response.g.dart +++ b/lib/src/vo/verification_response.g.dart @@ -13,7 +13,12 @@ VerificationResponse _$VerificationResponseFromJson( id: json['id'] as String, hasEmergencyContact: json['has_emergency_contact'] as bool? ?? false, contactId: json['contact_id'] as String?, - deactivatedAt: json['deactivated_at'] as String?, + deactivationEffectiveAt: json['deactivation_effective_at'] == null + ? null + : DateTime.parse(json['deactivation_effective_at'] as String), + deactivationRequestedAt: json['deactivation_requested_at'] == null + ? null + : DateTime.parse(json['deactivation_requested_at'] as String), ); Map _$VerificationResponseToJson( @@ -23,5 +28,8 @@ Map _$VerificationResponseToJson( 'id': instance.id, 'has_emergency_contact': instance.hasEmergencyContact, 'contact_id': instance.contactId, - 'deactivated_at': instance.deactivatedAt, + 'deactivation_requested_at': + instance.deactivationRequestedAt?.toIso8601String(), + 'deactivation_effective_at': + instance.deactivationEffectiveAt?.toIso8601String(), }; diff --git a/pubspec.yaml b/pubspec.yaml index 84b8e38..eba218b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: mixin_bot_sdk_dart description: Mixin Messenger API for Dart/Flutter, build decentrialized applications on Mixin -version: 1.2.8 +version: 1.2.9 homepage: https://github.com/MixinNetwork/mixin_bot_sdk_dart environment: @@ -29,8 +29,7 @@ dependencies: edwards25519: ^1.0.4 dev_dependencies: - test: ^1.17.9 + test: ^1.25.8 very_good_analysis: ">=5.1.0 <7.0.0" - # pedantic: ^1.11.0 - build_runner: any - json_serializable: ^6.1.4 + build_runner: ^2.4.9 + json_serializable: ^6.8.0 diff --git a/test/config.dart b/test/config.dart index 2e5b0e4..08dc72e 100644 --- a/test/config.dart +++ b/test/config.dart @@ -1,10 +1,17 @@ // Get APP data from https://developers.mixin.one/dashboard +import 'dart:convert'; +import 'dart:io'; + import 'package:mixin_bot_sdk_dart/mixin_bot_sdk_dart.dart'; -const uid = '23cec735-ffb8-435d-8c2c-e352c98a8b59'; -const sid = '63f600c8-7247-4a02-8a71-1546c3a2abdb'; -final private = Key.froHex( - 'da34117b06b3d186d9f3455717b67861b5340f283c613f75ccb39092485b722bc9db931e3cea42c34f5d33afa306ed2f0b24446779a4e3347cdead21e0216480'); +final _keystore = () { + final content = File('.keystore.json').readAsStringSync(); + return json.decode(content) as Map; +}(); + +final uid = _keystore['app_id'] as String; +final sid = _keystore['session_id'] as String; +final private = Key.fromHexSeed(_keystore['session_private_key'] as String); final uids = ['773e5e77-4107-45c2-b648-8fc722ed77f5'];