From 2d65bef95fac5f2895b81f37fff9c877432ed7bc Mon Sep 17 00:00:00 2001 From: myConsciousness Date: Thu, 9 Feb 2023 00:16:55 +0900 Subject: [PATCH 1/5] feat: fixed for the issue (#51) --- .vscode/settings.json | 1 + lib/mastodon_api.dart | 2 + lib/src/mastodon_api.dart | 15 + lib/src/service/base_service.dart | 4 +- lib/src/service/entities/oembed_metadata.dart | 32 ++ .../entities/oembed_metadata.freezed.dart | 362 ++++++++++++++++++ .../service/entities/oembed_metadata.g.dart | 61 +++ lib/src/service/oembed/oembed_service.dart | 71 ++++ 8 files changed, 546 insertions(+), 2 deletions(-) create mode 100644 lib/src/service/entities/oembed_metadata.dart create mode 100644 lib/src/service/entities/oembed_metadata.freezed.dart create mode 100644 lib/src/service/entities/oembed_metadata.g.dart create mode 100644 lib/src/service/oembed/oembed_service.dart diff --git a/.vscode/settings.json b/.vscode/settings.json index b37bbf7..3c0f320 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,6 +7,7 @@ "flac", "iframe", "Kato", + "oembed", "quicktime", "ratelimit", "Reblog", diff --git a/lib/mastodon_api.dart b/lib/mastodon_api.dart index 1aed173..1cf9947 100644 --- a/lib/mastodon_api.dart +++ b/lib/mastodon_api.dart @@ -50,6 +50,7 @@ export 'package:mastodon_api/src/service/entities/media_attachment_type.dart'; export 'package:mastodon_api/src/service/entities/notification.dart'; export 'package:mastodon_api/src/service/entities/notification_snapshot.dart'; export 'package:mastodon_api/src/service/entities/notification_type.dart'; +export 'package:mastodon_api/src/service/entities/oembed_metadata.dart'; export 'package:mastodon_api/src/service/entities/poll.dart'; export 'package:mastodon_api/src/service/entities/poll_option.dart'; export 'package:mastodon_api/src/service/entities/position_marker.dart'; @@ -75,6 +76,7 @@ export 'package:mastodon_api/src/service/entities/trends_link.dart'; export 'package:mastodon_api/src/service/entities/usage_statistics.dart'; export 'package:mastodon_api/src/service/mastodon_v1_service.dart'; export 'package:mastodon_api/src/service/mastodon_v2_service.dart'; +export 'package:mastodon_api/src/service/oembed/oembed_service.dart'; export 'package:mastodon_api/src/service/response/mastodon_request.dart'; export 'package:mastodon_api/src/service/response/mastodon_response.dart'; export 'package:mastodon_api/src/service/v1/accounts/account_default_settings_param.dart'; diff --git a/lib/src/mastodon_api.dart b/lib/src/mastodon_api.dart index 50b9a44..fe8caff 100644 --- a/lib/src/mastodon_api.dart +++ b/lib/src/mastodon_api.dart @@ -7,6 +7,7 @@ import 'core/client/client_context.dart'; import 'core/config/retry_config.dart'; import 'service/mastodon_v1_service.dart'; import 'service/mastodon_v2_service.dart'; +import 'service/oembed/oembed_service.dart'; abstract class MastodonApi { /// Returns the new instance of [MastodonApi]. @@ -28,6 +29,9 @@ abstract class MastodonApi { /// Returns the v2 service. MastodonV2Service get v2; + + /// Returns the OEmbed service. + OEmbedService get oembed; } class _MastodonApi implements MastodonApi { @@ -52,6 +56,14 @@ class _MastodonApi implements MastodonApi { timeout: timeout, retryConfig: retryConfig, ), + ), + oembed = OEmbedService( + instance: instance, + context: ClientContext( + bearerToken: bearerToken, + timeout: timeout, + retryConfig: retryConfig, + ), ); @override @@ -59,4 +71,7 @@ class _MastodonApi implements MastodonApi { @override final MastodonV2Service v2; + + @override + final OEmbedService oembed; } diff --git a/lib/src/service/base_service.dart b/lib/src/service/base_service.dart index d636e83..4515855 100644 --- a/lib/src/service/base_service.dart +++ b/lib/src/service/base_service.dart @@ -374,9 +374,9 @@ class RateLimitConverter { String _getDateTimeString(final Map input, final String key) { if (!input.containsKey(key)) { - return DateTime.fromMillisecondsSinceEpoch(0).toIso8601String(); + return DateTime.fromMillisecondsSinceEpoch(0).toLocal().toIso8601String(); } - return DateTime.parse(input[key]!).toIso8601String(); + return DateTime.parse(input[key]!).toLocal().toIso8601String(); } } diff --git a/lib/src/service/entities/oembed_metadata.dart b/lib/src/service/entities/oembed_metadata.dart new file mode 100644 index 0000000..5ee6477 --- /dev/null +++ b/lib/src/service/entities/oembed_metadata.dart @@ -0,0 +1,32 @@ +// Copyright 2022 Kato Shinya. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided the conditions. + +// ignore_for_file: invalid_annotation_target + +// 📦 Package imports: +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'oembed_metadata.freezed.dart'; +part 'oembed_metadata.g.dart'; + +@freezed +class OEmbedMetadata with _$OEmbedMetadata { + @JsonSerializable(includeIfNull: false) + const factory OEmbedMetadata({ + required String type, + required String version, + String? title, + required String authorName, + required String authorUrl, + required String providerName, + required String providerUrl, + required int cacheAge, + required String html, + required int width, + int? height, + }) = _OEmbedMetadata; + + factory OEmbedMetadata.fromJson(Map json) => + _$OEmbedMetadataFromJson(json); +} diff --git a/lib/src/service/entities/oembed_metadata.freezed.dart b/lib/src/service/entities/oembed_metadata.freezed.dart new file mode 100644 index 0000000..0491edd --- /dev/null +++ b/lib/src/service/entities/oembed_metadata.freezed.dart @@ -0,0 +1,362 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'oembed_metadata.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + +OEmbedMetadata _$OEmbedMetadataFromJson(Map json) { + return _OEmbedMetadata.fromJson(json); +} + +/// @nodoc +mixin _$OEmbedMetadata { + String get type => throw _privateConstructorUsedError; + String get version => throw _privateConstructorUsedError; + String? get title => throw _privateConstructorUsedError; + String get authorName => throw _privateConstructorUsedError; + String get authorUrl => throw _privateConstructorUsedError; + String get providerName => throw _privateConstructorUsedError; + String get providerUrl => throw _privateConstructorUsedError; + int get cacheAge => throw _privateConstructorUsedError; + String get html => throw _privateConstructorUsedError; + int get width => throw _privateConstructorUsedError; + int? get height => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $OEmbedMetadataCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $OEmbedMetadataCopyWith<$Res> { + factory $OEmbedMetadataCopyWith( + OEmbedMetadata value, $Res Function(OEmbedMetadata) then) = + _$OEmbedMetadataCopyWithImpl<$Res, OEmbedMetadata>; + @useResult + $Res call( + {String type, + String version, + String? title, + String authorName, + String authorUrl, + String providerName, + String providerUrl, + int cacheAge, + String html, + int width, + int? height}); +} + +/// @nodoc +class _$OEmbedMetadataCopyWithImpl<$Res, $Val extends OEmbedMetadata> + implements $OEmbedMetadataCopyWith<$Res> { + _$OEmbedMetadataCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? type = null, + Object? version = null, + Object? title = freezed, + Object? authorName = null, + Object? authorUrl = null, + Object? providerName = null, + Object? providerUrl = null, + Object? cacheAge = null, + Object? html = null, + Object? width = null, + Object? height = freezed, + }) { + return _then(_value.copyWith( + type: null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as String, + version: null == version + ? _value.version + : version // ignore: cast_nullable_to_non_nullable + as String, + title: freezed == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String?, + authorName: null == authorName + ? _value.authorName + : authorName // ignore: cast_nullable_to_non_nullable + as String, + authorUrl: null == authorUrl + ? _value.authorUrl + : authorUrl // ignore: cast_nullable_to_non_nullable + as String, + providerName: null == providerName + ? _value.providerName + : providerName // ignore: cast_nullable_to_non_nullable + as String, + providerUrl: null == providerUrl + ? _value.providerUrl + : providerUrl // ignore: cast_nullable_to_non_nullable + as String, + cacheAge: null == cacheAge + ? _value.cacheAge + : cacheAge // ignore: cast_nullable_to_non_nullable + as int, + html: null == html + ? _value.html + : html // ignore: cast_nullable_to_non_nullable + as String, + width: null == width + ? _value.width + : width // ignore: cast_nullable_to_non_nullable + as int, + height: freezed == height + ? _value.height + : height // ignore: cast_nullable_to_non_nullable + as int?, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_OEmbedMetadataCopyWith<$Res> + implements $OEmbedMetadataCopyWith<$Res> { + factory _$$_OEmbedMetadataCopyWith( + _$_OEmbedMetadata value, $Res Function(_$_OEmbedMetadata) then) = + __$$_OEmbedMetadataCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {String type, + String version, + String? title, + String authorName, + String authorUrl, + String providerName, + String providerUrl, + int cacheAge, + String html, + int width, + int? height}); +} + +/// @nodoc +class __$$_OEmbedMetadataCopyWithImpl<$Res> + extends _$OEmbedMetadataCopyWithImpl<$Res, _$_OEmbedMetadata> + implements _$$_OEmbedMetadataCopyWith<$Res> { + __$$_OEmbedMetadataCopyWithImpl( + _$_OEmbedMetadata _value, $Res Function(_$_OEmbedMetadata) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? type = null, + Object? version = null, + Object? title = freezed, + Object? authorName = null, + Object? authorUrl = null, + Object? providerName = null, + Object? providerUrl = null, + Object? cacheAge = null, + Object? html = null, + Object? width = null, + Object? height = freezed, + }) { + return _then(_$_OEmbedMetadata( + type: null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as String, + version: null == version + ? _value.version + : version // ignore: cast_nullable_to_non_nullable + as String, + title: freezed == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String?, + authorName: null == authorName + ? _value.authorName + : authorName // ignore: cast_nullable_to_non_nullable + as String, + authorUrl: null == authorUrl + ? _value.authorUrl + : authorUrl // ignore: cast_nullable_to_non_nullable + as String, + providerName: null == providerName + ? _value.providerName + : providerName // ignore: cast_nullable_to_non_nullable + as String, + providerUrl: null == providerUrl + ? _value.providerUrl + : providerUrl // ignore: cast_nullable_to_non_nullable + as String, + cacheAge: null == cacheAge + ? _value.cacheAge + : cacheAge // ignore: cast_nullable_to_non_nullable + as int, + html: null == html + ? _value.html + : html // ignore: cast_nullable_to_non_nullable + as String, + width: null == width + ? _value.width + : width // ignore: cast_nullable_to_non_nullable + as int, + height: freezed == height + ? _value.height + : height // ignore: cast_nullable_to_non_nullable + as int?, + )); + } +} + +/// @nodoc + +@JsonSerializable(includeIfNull: false) +class _$_OEmbedMetadata implements _OEmbedMetadata { + const _$_OEmbedMetadata( + {required this.type, + required this.version, + this.title, + required this.authorName, + required this.authorUrl, + required this.providerName, + required this.providerUrl, + required this.cacheAge, + required this.html, + required this.width, + this.height}); + + factory _$_OEmbedMetadata.fromJson(Map json) => + _$$_OEmbedMetadataFromJson(json); + + @override + final String type; + @override + final String version; + @override + final String? title; + @override + final String authorName; + @override + final String authorUrl; + @override + final String providerName; + @override + final String providerUrl; + @override + final int cacheAge; + @override + final String html; + @override + final int width; + @override + final int? height; + + @override + String toString() { + return 'OEmbedMetadata(type: $type, version: $version, title: $title, authorName: $authorName, authorUrl: $authorUrl, providerName: $providerName, providerUrl: $providerUrl, cacheAge: $cacheAge, html: $html, width: $width, height: $height)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_OEmbedMetadata && + (identical(other.type, type) || other.type == type) && + (identical(other.version, version) || other.version == version) && + (identical(other.title, title) || other.title == title) && + (identical(other.authorName, authorName) || + other.authorName == authorName) && + (identical(other.authorUrl, authorUrl) || + other.authorUrl == authorUrl) && + (identical(other.providerName, providerName) || + other.providerName == providerName) && + (identical(other.providerUrl, providerUrl) || + other.providerUrl == providerUrl) && + (identical(other.cacheAge, cacheAge) || + other.cacheAge == cacheAge) && + (identical(other.html, html) || other.html == html) && + (identical(other.width, width) || other.width == width) && + (identical(other.height, height) || other.height == height)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, type, version, title, authorName, + authorUrl, providerName, providerUrl, cacheAge, html, width, height); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_OEmbedMetadataCopyWith<_$_OEmbedMetadata> get copyWith => + __$$_OEmbedMetadataCopyWithImpl<_$_OEmbedMetadata>(this, _$identity); + + @override + Map toJson() { + return _$$_OEmbedMetadataToJson( + this, + ); + } +} + +abstract class _OEmbedMetadata implements OEmbedMetadata { + const factory _OEmbedMetadata( + {required final String type, + required final String version, + final String? title, + required final String authorName, + required final String authorUrl, + required final String providerName, + required final String providerUrl, + required final int cacheAge, + required final String html, + required final int width, + final int? height}) = _$_OEmbedMetadata; + + factory _OEmbedMetadata.fromJson(Map json) = + _$_OEmbedMetadata.fromJson; + + @override + String get type; + @override + String get version; + @override + String? get title; + @override + String get authorName; + @override + String get authorUrl; + @override + String get providerName; + @override + String get providerUrl; + @override + int get cacheAge; + @override + String get html; + @override + int get width; + @override + int? get height; + @override + @JsonKey(ignore: true) + _$$_OEmbedMetadataCopyWith<_$_OEmbedMetadata> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/src/service/entities/oembed_metadata.g.dart b/lib/src/service/entities/oembed_metadata.g.dart new file mode 100644 index 0000000..c5978dd --- /dev/null +++ b/lib/src/service/entities/oembed_metadata.g.dart @@ -0,0 +1,61 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: non_constant_identifier_names + +part of 'oembed_metadata.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$_OEmbedMetadata _$$_OEmbedMetadataFromJson(Map json) => $checkedCreate( + r'_$_OEmbedMetadata', + json, + ($checkedConvert) { + final val = _$_OEmbedMetadata( + type: $checkedConvert('type', (v) => v as String), + version: $checkedConvert('version', (v) => v as String), + title: $checkedConvert('title', (v) => v as String?), + authorName: $checkedConvert('author_name', (v) => v as String), + authorUrl: $checkedConvert('author_url', (v) => v as String), + providerName: $checkedConvert('provider_name', (v) => v as String), + providerUrl: $checkedConvert('provider_url', (v) => v as String), + cacheAge: $checkedConvert('cache_age', (v) => v as int), + html: $checkedConvert('html', (v) => v as String), + width: $checkedConvert('width', (v) => v as int), + height: $checkedConvert('height', (v) => v as int?), + ); + return val; + }, + fieldKeyMap: const { + 'authorName': 'author_name', + 'authorUrl': 'author_url', + 'providerName': 'provider_name', + 'providerUrl': 'provider_url', + 'cacheAge': 'cache_age' + }, + ); + +Map _$$_OEmbedMetadataToJson(_$_OEmbedMetadata instance) { + final val = { + 'type': instance.type, + 'version': instance.version, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('title', instance.title); + val['author_name'] = instance.authorName; + val['author_url'] = instance.authorUrl; + val['provider_name'] = instance.providerName; + val['provider_url'] = instance.providerUrl; + val['cache_age'] = instance.cacheAge; + val['html'] = instance.html; + val['width'] = instance.width; + writeNotNull('height', instance.height); + return val; +} diff --git a/lib/src/service/oembed/oembed_service.dart b/lib/src/service/oembed/oembed_service.dart new file mode 100644 index 0000000..36c6db4 --- /dev/null +++ b/lib/src/service/oembed/oembed_service.dart @@ -0,0 +1,71 @@ +// Copyright 2022 Kato Shinya. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided the conditions. + +import '../../core/client/client_context.dart'; +import '../../core/client/user_context.dart'; +import '../base_service.dart'; +import '../entities/oembed_metadata.dart'; +import '../response/mastodon_response.dart'; + +abstract class OEmbedService { + /// Returns the new instance of [OEmbedService]. + factory OEmbedService({ + required String instance, + required ClientContext context, + }) => + _OEmbedService( + instance: instance, + context: context, + ); + + /// Get OEmbed info. + /// + /// ## Parameters + /// + /// - [statusUrl]: URL of a status. + /// + /// - [maxWidth]: Width of the iframe. Defaults to 400 + /// + /// - [maxHeight]: Height of the iframe. Defaults to null. + /// + /// ## Endpoint Url + /// + /// - GET /api/oembed HTTP/1.1 + /// + /// ## Reference + /// + /// - https://docs.joinmastodon.org/methods/oembed/#get + Future> lookupOEmbedMetadata({ + required String statusUrl, + int? maxWidth, + int? maxHeight, + }); +} + +class _OEmbedService extends BaseService implements OEmbedService { + /// Returns the new instance of [_OEmbedService]. + _OEmbedService({ + required super.instance, + required super.context, + }); + + @override + Future> lookupOEmbedMetadata({ + required String statusUrl, + int? maxWidth, + int? maxHeight, + }) async => + super.transformSingleDataResponse( + await super.get( + UserContext.anonymousOnly, + '/api/oembed', + queryParameters: { + 'url': statusUrl, + 'maxwidth': maxWidth, + 'maxheight': maxHeight, + }, + ), + dataBuilder: OEmbedMetadata.fromJson, + ); +} From 223ea03199415132446c15740627ce7719754c4e Mon Sep 17 00:00:00 2001 From: myConsciousness Date: Thu, 9 Feb 2023 00:17:07 +0900 Subject: [PATCH 2/5] test: add unit tests --- .../oembed/data/lookup_oembed_metadata.json | 12 +++ .../service/oembed/oembed_service_test.dart | 84 +++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 test/src/service/oembed/data/lookup_oembed_metadata.json create mode 100644 test/src/service/oembed/oembed_service_test.dart diff --git a/test/src/service/oembed/data/lookup_oembed_metadata.json b/test/src/service/oembed/data/lookup_oembed_metadata.json new file mode 100644 index 0000000..255d9c7 --- /dev/null +++ b/test/src/service/oembed/data/lookup_oembed_metadata.json @@ -0,0 +1,12 @@ +{ + "type": "rich", + "version": "1.0", + "author_name": "Shinya Kato", + "author_url": "https://mastodon.world/@shinyakato", + "provider_name": "mastodon.world", + "provider_url": "https://mastodon.world/", + "cache_age": 86400, + "html": "\u003ciframe src=\"https://mastodon.world/@shinyakato/109804302990784885/embed\" class=\"mastodon-embed\" style=\"max-width: 100%; border: 0\" width=\"400\" allowfullscreen=\"allowfullscreen\"\u003e\u003c/iframe\u003e\u003cscript src=\"https://mastodon.world/embed.js\" async=\"async\"\u003e\u003c/script\u003e", + "width": 400, + "height": null +} diff --git a/test/src/service/oembed/oembed_service_test.dart b/test/src/service/oembed/oembed_service_test.dart new file mode 100644 index 0000000..64827ac --- /dev/null +++ b/test/src/service/oembed/oembed_service_test.dart @@ -0,0 +1,84 @@ +// Copyright 2023 Kato Shinya. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided the conditions. + +import 'package:mastodon_api/src/core/client/user_context.dart'; +import 'package:mastodon_api/src/service/entities/oembed_metadata.dart'; +import 'package:mastodon_api/src/service/entities/rate_limit.dart'; +import 'package:mastodon_api/src/service/oembed/oembed_service.dart'; +import 'package:mastodon_api/src/service/response/mastodon_response.dart'; +import 'package:test/test.dart'; + +import '../../../mocks/client_context_stubs.dart' as context; +import '../common_expectations.dart'; + +void main() { + group('.lookupFollowRequests', () { + test('normal case', () async { + final oembedService = OEmbedService( + instance: 'test', + context: context.buildGetStub( + 'test', + UserContext.anonymousOnly, + '/api/oembed', + 'test/src/service/oembed/data/lookup_oembed_metadata.json', + { + 'url': 'https://test.com', + }, + ), + ); + + final response = await oembedService.lookupOEmbedMetadata( + statusUrl: 'https://test.com', + ); + + expect(response, isA()); + expect(response.rateLimit, isA()); + expect(response.data, isA()); + }); + + test('when unauthorized', () async { + final oembedService = OEmbedService( + instance: 'test', + context: context.buildGetStub( + 'test', + UserContext.anonymousOnly, + '/api/oembed', + 'test/src/service/oembed/data/lookup_oembed_metadata.json', + { + 'url': 'https://test.com', + }, + statusCode: 401, + ), + ); + + expectUnauthorizedException( + () async => await oembedService.lookupOEmbedMetadata( + statusUrl: 'https://test.com', + ), + ); + }); + + test('when rate limit exceeded', () async { + final oembedService = OEmbedService( + instance: 'test', + context: context.buildGetStub( + 'test', + UserContext.anonymousOnly, + '/api/oembed', + 'test/src/service/oembed/data/lookup_oembed_metadata.json', + { + 'url': 'https://test.com', + }, + statusCode: 429, + ), + ); + + expectRateLimitExceededException( + () async => await oembedService.lookupOEmbedMetadata( + statusUrl: 'https://test.com', + ), + ); + }); + }); +} From 4729830b5346da6a347d489113a38ff24b5e25b0 Mon Sep 17 00:00:00 2001 From: myConsciousness Date: Thu, 9 Feb 2023 00:18:20 +0900 Subject: [PATCH 3/5] docs: add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b900819..f5cde82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - `GET /api/v1/follow_requests` - `POST /api/v1/follow_requests/:account_id/authorize` - `POST /api/v1/follow_requests/:account_id/reject` +- Added `oembed API methods`. ([#51](https://github.com/mastodon-dart/mastodon-api/issues/51)) ## v0.5.0 From 96631e0502a4b1764d8051b05f9122c54200ea5f Mon Sep 17 00:00:00 2001 From: myConsciousness Date: Thu, 9 Feb 2023 00:19:52 +0900 Subject: [PATCH 4/5] docs: add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5cde82..1e28447 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - `POST /api/v1/follow_requests/:account_id/authorize` - `POST /api/v1/follow_requests/:account_id/reject` - Added `oembed API methods`. ([#51](https://github.com/mastodon-dart/mastodon-api/issues/51)) + - `GET /api/oembed` ## v0.5.0 From b2d9e09dece072b2f2c6336f87a131bee1ded3a1 Mon Sep 17 00:00:00 2001 From: myConsciousness Date: Thu, 9 Feb 2023 00:21:06 +0900 Subject: [PATCH 5/5] fix: `Invalid or missing license headers detected` --- lib/src/service/entities/oembed_metadata.dart | 2 +- lib/src/service/oembed/oembed_service.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/service/entities/oembed_metadata.dart b/lib/src/service/entities/oembed_metadata.dart index 5ee6477..4f61182 100644 --- a/lib/src/service/entities/oembed_metadata.dart +++ b/lib/src/service/entities/oembed_metadata.dart @@ -1,4 +1,4 @@ -// Copyright 2022 Kato Shinya. All rights reserved. +// Copyright 2023 Kato Shinya. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided the conditions. diff --git a/lib/src/service/oembed/oembed_service.dart b/lib/src/service/oembed/oembed_service.dart index 36c6db4..1555ce5 100644 --- a/lib/src/service/oembed/oembed_service.dart +++ b/lib/src/service/oembed/oembed_service.dart @@ -1,4 +1,4 @@ -// Copyright 2022 Kato Shinya. All rights reserved. +// Copyright 2023 Kato Shinya. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided the conditions.