Skip to content

Releases: CXuesong/WikiClientLibrary

v0.6-intX1

05 Nov 09:35
Compare
Choose a tag to compare
v0.6-intX1 Pre-release
Pre-release

New features

  • Page plain-text extract (aka excerpt) support. Added WikiPage.Extract property. (e1c3805)
  • Geo coordination fetching support. Added WikiPage.PrimaryCoordination property. (e1c3805)
  • Geo-search generator support. Added GeoSearchGenerator. (9154444)

Bug fixes

  • Strip File namespace prefix for the filename parameter when uploading the file. This can cause trouble on some wikis. (7570f95)
  • Fixed bug in FilePage.OnLoadPageInfo that throws Exception when the page is missing. (3461e8f)

v0.6-int10a

31 Oct 14:49
Compare
Choose a tag to compare
v0.6-int10a Pre-release
Pre-release

Bug fix: Cannot upload any file via FilePage.UploadAsync due to the superfluous File: prefix passed as filename parameter.

v0.6-int10

31 Oct 07:03
Compare
Choose a tag to compare
v0.6-int10 Pre-release
Pre-release
  • Introduced preliminary Wikia API support. See API documentation for reference. #29
  • Removed WikiSite.CreateAsync to make it inheritance-friendly. #31
  • Added AbuseFilterList to enumerate a list of AbuseFilters.
  • Added PageStubFromRevision and RevisionFromJson methods to MediaWikiHelper class.
  • Improved WikiPageStub. Added WikiPageStub.FromPageIds and WikiPageStub.FromPageTitles methods. You can fetch a sequence of filled page stubs by page ids or titles.

v0.6-int9

21 Oct 09:29
Compare
Choose a tag to compare
v0.6-int9 Pre-release
Pre-release
  • Use different log scopes instead of logger objects. Thus IWikiClientLoggable now owns ILogger rather than ILoggerFactory. #14
    • You need to manually set WikiClient.Logger and/or WikiSite.Logger property, and it's done.
    • To see the scope information, you need to use a logger that supports log scopes. For ConsoleLogger, you need to set IncludeScopes to true.
    • For log scope implementations for your custom ILogger classes, you can refer to TestOutputLogger.
    • MS has an open issue about preset implementation on log scopes (aspnet/Logging#674)
  • Extracted WikiList<T> as base class from WikiPageGenerator<TPage> (and thus WikiPageGenerator<TItem, TPage>) class. You can choose to enumerate either in the form of list (WikiList<T>.EnumItems) or the page generator (WikiPageGenerator<TPage>.EnumPages). #30
  • Obsoleted WikiPage.EnumLinks, WikiPage.EnumTransclusions, and WikiPage.EnumRevisions. They are taken over by the generators.
    • You can use the extension methods provided in WikiPageExtensions to achieve the same goal.
  • The generator classes will NOT use the maximum allowed pagination size (500 for user; 5000 for bots). Now they have a default pagination size of 10, same as MediaWiki API default value.
    • It's suggested that you explicitly set the PaginationSize value before enumerating the items.
  • Extracted general IWikiClient interface from WikiClient that can actually emit any kind of HttpRequestMessage (depending on the implementation).
    • Thus removed WikiClientBase class.
    • The format=json parameter is append to the request in WikiSite.GetJsonAsync instead of in WikiClient class.
    • Extracted the API response parsing logic from WikiRequestMessage class to IWikiResponseMessageParser interface. The implementation for MediaWiki API response parsing is MediaWikiJsonResponseParser. MediaWikiFormRequestMessage is now a simple container for key-value pairs.
    • IWikiResponseMessageParser takes the responsibility of checking HTTP status code, and deciding whether to retry the request or throw an Exception. This is previously carried out in WikiClient.

v0.6-int8

14 Oct 14:42
Compare
Choose a tag to compare
v0.6-int8 Pre-release
Pre-release
  • Completed Flow (aka. Structured Discussions) support. #28
    • Served as a separate NuGet package CXuesong.MW.WikiClientLibrary.Flow
  • Name & namespace adjustments for Wikibase API.
  • Used AsyncEnumerableExtensions to generate IAsyncEnumerable<T> sequence in a more human-readable way. Removed DelegateAsyncEnumerable helper classes.
  • Removed the dependency in WikiClientLibrary.Flow and WikiClientLibrary.Wikibase to internal members of WikiClientLibrary.

v0.6-int7

09 Oct 12:56
Compare
Choose a tag to compare
v0.6-int7 Pre-release
Pre-release
  • Signed assemblies. They are strongly-named assemblies now.

New features

Introduce preliminary Wikibase API. (#24) It's released in a separate package CXuesong.WikiClientLibrary.Wikibase. See WikibaseTests.cs in unit tests for usage reference.

Currently it supports basic entity querying and editing. If you are deleting the entities… Well, why not delete the page?

Limitation: Current WbQuantity is limited to the precision of double (rather than arbitrary precision). Using this structure with entity claims might cause precision loss.

v0.6-int6

28 Sep 13:14
Compare
Choose a tag to compare
v0.6-int6 Pre-release
Pre-release

New features

  • Chunked uploading support for MW 1.19+ (#22)
  • UploadResult.Warnings is now a collection with some commonly-used properties to help you determine the situation.
  • Added UploadResult.FileRevision property. You can check the basic information of the uploaded file now.
  • Added some properties to FileRevision class.

Major API changes

  • New instance methods for FilePage.UploadAsync. The original static methods are obsoleted.
    • The new UploadAsync accepts one of the WikiUploadSource-derived instance. You may choose from StreamUploadSource, FileKeyUploadSource, ExternalFileUploadSource, and ChunkedUploadSource.
    • The new method does not throw UploadException. You need to check the returned UploadResult.ResultCode by yourself, and decide what to do next.
    • FYI, since r378702(MW 1.31), you will receive OperationFailedException with fileexists-no-change error code if you attempt to upload the same content as latest file to a title, and setting ignoreWarnings to true.
    • See LocalFileUploadTest1 in the unit test project for an example.
  • Reduced WikiSite.GetTokensAsync into WikiSite.GetTokenAsync. Obsoleted GetTokensAsync methods. (#23)
  • Moved FormatWarning method from UploadResult class to UploadWarningCollection class.

v0.6-int5

24 Sep 18:17
Compare
Choose a tag to compare
v0.6-int5 Pre-release
Pre-release

Bug fix

  • Need to invalidate "csrf" token aside from "edit" etc. on MW1.24+. (5538fed)

v0.6-int4

24 Sep 16:32
Compare
Choose a tag to compare
v0.6-int4 Pre-release
Pre-release

This version has a bug that is fixed in the next pre-release. This version of NuGet package has been unlisted.

If you have any questions or suggestions, feel free to open an issue :-)

New features

  • Added two page generators: BacklinksGenerator and TranscludedInGenerator.
  • MW API requests via WikiSite.GetJsonAsync will automatically attempt to re-fetch tokens on badtoken error. (#21)

Major interface changes

  • Renamed PageGenerator to WikiPageGenerator, and RecentChangesEntry to RecentChangeItem.
  • IWikiClientLoggable.SetLoggerFactory has been replaced with a R/W property IWikiClientLoggable.LoggerFactory.
  • UnauthorizedOperationException is now a subclass of OperationFailedException.
    • Though for certain locally detected authorization failure, UnauthorizedOperationException.ErrorCode will be null.
  • Added WikiRequestMessage class to contain query parameters.
    • This class (WikiFormRequestMessage, to be more exact) unifies application/x-www-form-urlencoded and multipart/form-data, while enables per request configurations in the future, and a better request-tracing experience.
    • WikiClient.GetJsonAsync now only accepts WikiRequestMessage. WikiSite.PostValuesAsync is kept for now but is marked as obsolete. It will be removed in the next pre-release. You need to use WikiSite.GetJsonAsync now. (See usage example.)
    • See the documentation of WikiFormRequestMessage for more information.

Bug fix

  • Fixed incorrect logic for getting patrol token for MW [1.17, 1.20).
  • Fixed some incorrect logging emissions.

Other changes

  • Re-implemented WikiSite.GetToken(s)Async. Still the code might need more simplifications.

Unit tests

  • Use MSTest adapter for xUnit. Now you can execute unit tests with VS.
  • Added xUnit console runner dotnet-xunit. Now you can execute unit tests with dotnet xunit command.
  • Now the unit test is net452/netcoreapp2.0 multi-targeted.
  • Thanks to AArnott, again. Now I have XUnit.SkippableFact to take over the original UnitTestProject1.Utility.Inconclusive method. (I'm also a fan of Nerdbank.FullDuplexStream!)

v0.6-int3

11 Sep 14:59
Compare
Choose a tag to compare
v0.6-int3 Pre-release
Pre-release

New features

  • Assume File: namespace by default in FilePage.UploadAsyncInternal. (#17)

API changes

  • Renamed PageExtensions to WikiPageExtensions.
  • Removed PageGeneratorBase.ActualPagingSize.
  • Use Microsoft.Extensions.Logging for logging; removed WikiClientLibrary.ILogger. (#14)

Bug fix

  • Fixed the letter case of key for PagePropertyCollection.DisplayTitle. (633852b)