vmelnalksnis / paperlessdotnet Goto Github PK
View Code? Open in Web Editor NEW.NET Paperless API client
License: Apache License 2.0
.NET Paperless API client
License: Apache License 2.0
Is your feature request related to a problem? Please describe.
Paperless API behavior has changed across versions, and also changes based on configuration (see PAPERLESS_TIME_ZONE
).
Describe the solution you'd like
All integration tests are run against multiple combinations of versions and configurations.
Describe alternatives you've considered
Additional context
I could not find how to do this in XUnit without a ton of code duplication, most likely will have to move to NUnit. With NUnit I've already done something similiar, see https://github.com/VMelnalksnis/Gnomeshade/blob/master/tests/Gnomeshade.WebApi.Tests.Integration/Fixtures/WebserverTests.cs and https://github.com/VMelnalksnis/Gnomeshade/blob/master/tests/Gnomeshade.WebApi.Tests.Integration.PostgreSQL/WebserverSetup.cs
Is your feature request related to a problem? Please describe.
Somewhere along the line, Paperless-ngx added support for custom fields. Unless I'm missing something (usually the case), this feature is not currently supported by PaperlessDotNet.
Describe the solution you'd like
It should be possible to specify custom fields and values at document creation time, to read custom fields from documents that have been retrieved, and to retrieve an instance's current set of custom fields.
Describe alternatives you've considered
There is no apparent workaround or alternative solution.
Additional context
N/A
Describe the bug
API request appears to fail due to a timestamp parsing error.
To Reproduce
Steps to reproduce the behavior:
var baseAddress = new Uri("http://paperless_host");
var token = "your-token-here";
var assemblyName = typeof(IPaperlessClient).Assembly.GetName();
var assemblyShortName = assemblyName.Name ?? assemblyName.FullName.Split(',').First();
ProductInfoHeaderValue userAgent = new(assemblyShortName, assemblyName.Version?.ToString());
var client = new HttpClient
{
BaseAddress = baseAddress
};
client.DefaultRequestHeaders.UserAgent.Add(userAgent);
#if NET6_0_OR_GREATER
client.DefaultRequestHeaders.Add("Accept", $"{MediaTypeNames.Application.Json}; version=2");
#else
client.DefaultRequestHeaders.Add("Accept", "application/json; version=2");
#endif
client.DefaultRequestHeaders.Authorization = new("Token", token);
var dtz = DateTimeZoneProviders.Tzdb;
var so = new PaperlessJsonSerializerOptions(dtz);
var cc = new CorrespondentClient(client, so);
var dc = new DocumentClient(client, so);
var pc = new PaperlessClient(cc, dc);
var docs = pc.Documents.GetAll();
await foreach(var doc in docs)
{
Console.WriteLine(doc.OriginalFileName);
}
System.Text.Json.JsonException: 'Cannot convert value to NodaTime.Instant'
Inner Exception
UnparsableValueException: The value string does not match a quoted string in the pattern. Value being parsed: '2023-12-18T00:00:00^-08:00'. (^ indicates error position.)
Expected behavior
A list of documents in the Paperless-ngx instance should be displayed
Screenshots
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
The README discusses usage outside of ASP.NET Core, and refers to "the configuration", which is a link to ServiceCollectionExtensions.cs in the VMelnalksnis.PaperlessDotNet.DependencyInjection package. It's not clear how this information should be used.
Describe the solution you'd like
A sample project in the form of a console app would be ideal, since this strips away any unnecessary layers that could obscure proper usage.
Describe alternatives you've considered
If not a sample project, perhaps some additional language could be added to the README that provides a little more information about the intended setup.
Additional context
None
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
Create
method in the DocumentClient
that configures the delay in msAdditional context
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.