Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor and move RepositoryApiClientHandler to ApiHttpMessageHandler [523912] #108

Merged
merged 11 commits into from
Jun 26, 2024
Merged
6 changes: 3 additions & 3 deletions .github/workflows/generate-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v2.5.1
uses: actions/setup-node@v4
with:
node-version: "16"

Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
private_key: ${{ secrets.LF_PULL_REQUEST_BOT_PRIVATE_KEY }}

- name: Create pull request
uses: peter-evans/create-pull-request@v4.2.3
uses: peter-evans/create-pull-request@v4
with:
token: ${{ steps.generate-token.outputs.token }}
branch: ${{ github.ref_name }}-generate-${{ env.API_VERSION }}-client
Expand Down
32 changes: 15 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,20 @@ on:

env:
API_VERSION: 'v2'
VERSION_PREFIX: '1.0.1'
VERSION_PREFIX: '1.0.2'
GITHUB_PAGES_BRANCH: 'gh-pages'

jobs:
build-n-test:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
3.1.x
6.0.x
dotnet-version: 8.0.x

- name: Restore dependencies
run: dotnet restore
Expand Down Expand Up @@ -64,7 +62,7 @@ jobs:
timeout-minutes: 10
needs: [ build-n-test ] # wait for build to finish
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
run: |
Expand All @@ -90,7 +88,7 @@ jobs:
run: doxygen ./doxygen/doxygen.conf

- name: Upload a build artifact
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v4
with:
name: documentation-artifact
path: ${{ github.workspace }}/generated_documentation/html
Expand All @@ -106,12 +104,12 @@ jobs:
if: ${{ github.run_attempt != 1 }}
needs: [ build-n-test, build-documentation ] # wait for build to finish
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

- name: Restore dependencies
run: dotnet restore
Expand Down Expand Up @@ -143,12 +141,12 @@ jobs:
if: ${{ github.run_attempt != 1 }}
needs: [ build-n-test, build-documentation ] # wait for build to finish
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

- name: Restore dependencies
run: dotnet restore
Expand Down Expand Up @@ -190,7 +188,7 @@ jobs:
- name: Print DOCUMENTATION_VERSION environment variable
run: |
echo 'Publishing documentation to ${{ env.GITHUB_PAGES_BRANCH }} for ${{ env.API_VERSION }} ${{ env.DOCUMENTATION_VERSION }}.'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ env.GITHUB_PAGES_BRANCH }}

Expand All @@ -201,13 +199,13 @@ jobs:
run: mkdir -p ./docs/${{ env.API_VERSION }}/${{ env.DOCUMENTATION_VERSION }}

- name: Download documentation build artifact
uses: actions/download-artifact@v3.0.0
uses: actions/download-artifact@v4
with:
name: documentation-artifact
path: ./docs/${{ env.API_VERSION }}/${{ env.DOCUMENTATION_VERSION }}

- name: Create a pull request
uses: peter-evans/create-pull-request@v4.2.3
uses: peter-evans/create-pull-request@v4
with:
branch: ${{ env.GITHUB_PAGES_BRANCH }}-${{ env.API_VERSION }}-${{ env.DOCUMENTATION_VERSION }}-patch
delete-branch: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/veracode-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
steps:

- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

- name: Restore dependencies
run: dotnet restore --ignore-failed-sources
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.0.2

### Chore & Maintenance

- Update version of `Laserfiche.Api.Client.Core` to `1.3.6`

## 1.0.1

### Chore & Maintenance
Expand Down
2 changes: 0 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
MIT License

Copyright (c) 2022 Laserfiche

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Expand Down
5 changes: 5 additions & 0 deletions Laserfiche.Repository.Api.Client.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{820A4706-DE2D-4F9E-8760-AD027DC8304A}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
CHANGELOG.md = CHANGELOG.md
CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
LICENSE = LICENSE
MIGRATION_GUIDE.md = MIGRATION_GUIDE.md
README.md = README.md
EndProjectSection
EndProject
Global
Expand Down
4 changes: 4 additions & 0 deletions src/Clients/AttributesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ partial interface IAttributesClient
/// </summary>
partial class AttributesClient
{
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

public async Task ListAttributesForEachAsync(Func<AttributeCollectionResponse, Task<bool>> callback, ListAttributesParameters parameters, int? maxPageSize = null, CancellationToken cancellationToken = default)
{
// Initial request
Expand All @@ -61,5 +63,7 @@ public async Task<AttributeCollectionResponse> ListAttributesNextLinkAsync(strin
{
return await GetNextLinkAsync(_httpClient, nextLink, MergeMaxSizeIntoPrefer(maxPageSize, null), ListAttributesSendAsync, cancellationToken).ConfigureAwait(false);
}

#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
}
}
6 changes: 5 additions & 1 deletion src/Clients/BaseClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ namespace Laserfiche.Repository.Api.Client
/// </summary>
public abstract class BaseClient
{
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

protected void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings)
{
settings.MaxDepth = 128;
Expand Down Expand Up @@ -76,7 +78,7 @@ private string ConvertToString(object value, CultureInfo cultureInfo)
if (name != null)
{
var field = IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name);
if (field != null &&
if (field != null &&
CustomAttributeExtensions.GetCustomAttribute(field, typeof(EnumMemberAttribute)) is EnumMemberAttribute attribute)
{
return attribute.Value ?? name;
Expand All @@ -103,5 +105,7 @@ private string ConvertToString(object value, CultureInfo cultureInfo)
var result = Convert.ToString(value, cultureInfo);
return result ?? "";
}

#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
}
}
4 changes: 4 additions & 0 deletions src/Clients/EntriesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ partial interface IEntriesClient
/// </summary>
partial class EntriesClient
{
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

public async Task<Entry> GetEntryAsync(string uriString, CancellationToken cancellationToken = default)
{
using (var request = new HttpRequestMessage())
Expand Down Expand Up @@ -217,5 +219,7 @@ public async Task<TagCollectionResponse> ListTagsNextLinkAsync(string nextLink,
{
return await GetNextLinkAsync(_httpClient, nextLink, MergeMaxSizeIntoPrefer(maxPageSize, null), ListTagsSendAsync, cancellationToken).ConfigureAwait(false);
}

#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
}
}
4 changes: 2 additions & 2 deletions src/Clients/Extensions/ApiExceptionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Laserfiche.
// Copyright (c) Laserfiche.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using Laserfiche.Api.Client;
using Newtonsoft.Json;
Expand All @@ -24,4 +24,4 @@ internal static ApiException Create(int statusCode, IReadOnlyDictionary<string,
return ApiException.Create(statusCode, headers, innerException);
}
}
}
}
5 changes: 5 additions & 0 deletions src/Clients/FieldDefinitionsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ partial interface IFieldDefinitionsClient
/// </summary>
partial class FieldDefinitionsClient
{
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

public async Task ListFieldDefinitionsForEachAsync(Func<FieldDefinitionCollectionResponse, Task<bool>> callback, ListFieldDefinitionsParameters parameters, int? maxPageSize = null, CancellationToken cancellationToken = default)
{
// Initial request
Expand All @@ -62,5 +64,8 @@ public async Task<FieldDefinitionCollectionResponse> ListFieldDefinitionsNextLin
{
return await GetNextLinkAsync(_httpClient, nextLink, MergeMaxSizeIntoPrefer(maxPageSize, null), ListFieldDefinitionsSendAsync, cancellationToken).ConfigureAwait(false);
}


#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
}
}
5 changes: 5 additions & 0 deletions src/Clients/LinkDefinitionsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ partial interface ILinkDefinitionsClient
/// </summary>
partial class LinkDefinitionsClient
{
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

public async Task ListLinkDefinitionsForEachAsync(Func<LinkDefinitionCollectionResponse, Task<bool>> callback, ListLinkDefinitionsParameters parameters, int? maxPageSize = null, CancellationToken cancellationToken = default)
{
// Initial request
Expand All @@ -62,5 +64,8 @@ public async Task<LinkDefinitionCollectionResponse> ListLinkDefinitionsNextLinkA
{
return await GetNextLinkAsync(_httpClient, nextLink, MergeMaxSizeIntoPrefer(maxPageSize, null), ListLinkDefinitionsSendAsync, cancellationToken).ConfigureAwait(false);
}


#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
}
}
5 changes: 4 additions & 1 deletion src/Clients/SearchesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License. See LICENSE in the project root for license information.
using Laserfiche.Api.Client;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

Expand Down Expand Up @@ -71,6 +70,8 @@ partial interface ISearchesClient
/// </summary>
partial class SearchesClient
{
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

public async Task ListSearchResultsForEachAsync(Func<EntryCollectionResponse, Task<bool>> callback, ListSearchResultsParameters parameters, int? maxPageSize = null, CancellationToken cancellationToken = default)
{
// Initial request
Expand Down Expand Up @@ -106,5 +107,7 @@ public async Task<SearchContextHitCollectionResponse> ListSearchContextHitsNextL
{
return await GetNextLinkAsync(_httpClient, nextLink, MergeMaxSizeIntoPrefer(maxPageSize, null), ListSearchContextHitsSendAsync, cancellationToken).ConfigureAwait(false);
}

#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
}
}
4 changes: 4 additions & 0 deletions src/Clients/TagDefinitionsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ partial interface ITagDefinitionsClient
/// </summary>
partial class TagDefinitionsClient
{
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

public async Task ListTagDefinitionsForEachAsync(Func<TagDefinitionCollectionResponse, Task<bool>> callback, ListTagDefinitionsParameters parameters, int? maxPageSize = null, CancellationToken cancellationToken = default)
{
// Initial request
Expand All @@ -61,5 +63,7 @@ public async Task<TagDefinitionCollectionResponse> ListTagDefinitionsNextLinkAsy
{
return await GetNextLinkAsync(_httpClient, nextLink, MergeMaxSizeIntoPrefer(maxPageSize, null), ListTagDefinitionsSendAsync, cancellationToken).ConfigureAwait(false);
}

#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
}
}
4 changes: 4 additions & 0 deletions src/Clients/TemplateDefinitionsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ partial interface ITemplateDefinitionsClient
/// </summary>
partial class TemplateDefinitionsClient
{
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

public async Task ListTemplateDefinitionsForEachAsync(Func<TemplateDefinitionCollectionResponse, Task<bool>> callback, ListTemplateDefinitionsParameters parameters, int? maxPageSize = null, CancellationToken cancellationToken = default)
{
// Initial request
Expand Down Expand Up @@ -149,5 +151,7 @@ public async Task<TemplateFieldDefinitionCollectionResponse> ListTemplateFieldDe
{
return await GetNextLinkAsync(_httpClient, nextLink, MergeMaxSizeIntoPrefer(maxPageSize, null), ListTemplateFieldDefinitionsByTemplateIdSendAsync, cancellationToken).ConfigureAwait(false);
}

#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
}
}
4 changes: 2 additions & 2 deletions src/Laserfiche.Repository.Api.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<Authors>Laserfiche</Authors>
<Description>The .NET Laserfiche Repository API client library for accessing the v2 Laserfiche Repository APIs.</Description>
<Copyright>Copyright 2023 Laserfiche</Copyright>
Expand All @@ -22,7 +22,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Laserfiche.Api.Client.Core" Version="1.3.4" />
<PackageReference Include="Laserfiche.Api.Client.Core" Version="1.3.6" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading