Releases: CXuesong/WikiClientLibrary
v0.6-intX1
v0.6-int10a
Bug fix: Cannot upload any file via FilePage.UploadAsync
due to the superfluous File:
prefix passed as filename
parameter.
v0.6-int10
- 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 ofAbuseFilter
s. - Added
PageStubFromRevision
andRevisionFromJson
methods toMediaWikiHelper
class. - Improved
WikiPageStub
. AddedWikiPageStub.FromPageIds
andWikiPageStub.FromPageTitles
methods. You can fetch a sequence of filled page stubs by page ids or titles.
v0.6-int9
- Use different log scopes instead of logger objects. Thus
IWikiClientLoggable
now ownsILogger
rather thanILoggerFactory
. #14- You need to manually set
WikiClient.Logger
and/orWikiSite.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 setIncludeScopes
totrue
. - For log scope implementations for your custom
ILogger
classes, you can refer toTestOutputLogger
. - MS has an open issue about preset implementation on log scopes (aspnet/Logging#674)
- You need to manually set
- Extracted
WikiList<T>
as base class fromWikiPageGenerator<TPage>
(and thusWikiPageGenerator<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
, andWikiPage.EnumRevisions
. They are taken over by the generators.- You can use the extension methods provided in
WikiPageExtensions
to achieve the same goal.
- You can use the extension methods provided in
- 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.
- It's suggested that you explicitly set the
- Extracted general
IWikiClient
interface fromWikiClient
that can actually emit any kind ofHttpRequestMessage
(depending on the implementation).- Thus removed
WikiClientBase
class. - The
format=json
parameter is append to the request inWikiSite.GetJsonAsync
instead of inWikiClient
class. - Extracted the API response parsing logic from
WikiRequestMessage
class toIWikiResponseMessageParser
interface. The implementation for MediaWiki API response parsing isMediaWikiJsonResponseParser
.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 inWikiClient
.
- Thus removed
v0.6-int8
- Completed Flow (aka. Structured Discussions) support. #28
- Served as a separate NuGet package
CXuesong.MW.WikiClientLibrary.Flow
- Served as a separate NuGet package
- Name & namespace adjustments for Wikibase API.
- Used
AsyncEnumerableExtensions
to generateIAsyncEnumerable<T>
sequence in a more human-readable way. RemovedDelegateAsyncEnumerable
helper classes. - Removed the dependency in
WikiClientLibrary.Flow
andWikiClientLibrary.Wikibase
to internal members ofWikiClientLibrary
.
v0.6-int7
- 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
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 theWikiUploadSource
-derived instance. You may choose fromStreamUploadSource
,FileKeyUploadSource
,ExternalFileUploadSource
, andChunkedUploadSource
. - The new method does not throw
UploadException
. You need to check the returnedUploadResult.ResultCode
by yourself, and decide what to do next. - FYI, since
r378702
(MW 1.31), you will receiveOperationFailedException
withfileexists-no-change
error code if you attempt to upload the same content as latest file to a title, and settingignoreWarnings
totrue
. - See
LocalFileUploadTest1
in the unit test project for an example.
- The new
- Reduced
WikiSite.GetTokensAsync
intoWikiSite.GetTokenAsync
. ObsoletedGetTokensAsync
methods. (#23) - Moved
FormatWarning
method fromUploadResult
class toUploadWarningCollection
class.
v0.6-int5
v0.6-int4
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
andTranscludedInGenerator
. - MW API requests via
WikiSite.GetJsonAsync
will automatically attempt to re-fetch tokens onbadtoken
error. (#21)
Major interface changes
- Renamed
PageGenerator
toWikiPageGenerator
, andRecentChangesEntry
toRecentChangeItem
. IWikiClientLoggable.SetLoggerFactory
has been replaced with a R/W propertyIWikiClientLoggable.LoggerFactory
.UnauthorizedOperationException
is now a subclass ofOperationFailedException
.- Though for certain locally detected authorization failure,
UnauthorizedOperationException.ErrorCode
will benull
.
- Though for certain locally detected authorization failure,
- Added
WikiRequestMessage
class to contain query parameters.- This class (
WikiFormRequestMessage
, to be more exact) unifiesapplication/x-www-form-urlencoded
andmultipart/form-data
, while enables per request configurations in the future, and a better request-tracing experience. WikiClient.GetJsonAsync
now only acceptsWikiRequestMessage
.WikiSite.PostValuesAsync
is kept for now but is marked as obsolete. It will be removed in the next pre-release. You need to useWikiSite.GetJsonAsync
now. (See usage example.)- See the documentation of
WikiFormRequestMessage
for more information.
- This class (
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 withdotnet 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 originalUnitTestProject1.Utility.Inconclusive
method. (I'm also a fan ofNerdbank.FullDuplexStream
!)
v0.6-int3
New features
- Assume
File:
namespace by default in FilePage.UploadAsyncInternal. (#17)
API changes
- Renamed
PageExtensions
toWikiPageExtensions
. - Removed
PageGeneratorBase.ActualPagingSize
. - Use
Microsoft.Extensions.Logging
for logging; removedWikiClientLibrary.ILogger
. (#14)
Bug fix
- Fixed the letter case of key for
PagePropertyCollection.DisplayTitle
. (633852b)