@fossa-app/bridge 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.build.ps1 +8 -7
- package/.gitattributes +43 -0
- package/Bridge.slnx +8 -0
- package/Directory.Build.props +25 -0
- package/Images/Icon.png +0 -0
- package/dotnet-tools.json +1 -1
- package/gig.ps1 +2 -1
- package/package.json +1 -1
- package/src/Bridge/Bridge.fsproj +26 -0
- package/src/{Fossa.Bridge → Bridge}/Models/ApiModels.fs +6 -0
- package/src/Bridge/Services/Clients/BranchClient.fs +46 -0
- package/src/Bridge/Services/Clients/CompanyClient.fs +24 -0
- package/src/Bridge/Services/Clients/CompanyLicenseClient.fs +17 -0
- package/src/Bridge/Services/Clients/CompanySettingsClient.fs +24 -0
- package/src/Bridge/Services/Clients/DepartmentClient.fs +48 -0
- package/src/Bridge/Services/Clients/EmployeeClient.fs +71 -0
- package/src/Bridge/Services/Clients/IdentityClient.fs +11 -0
- package/src/Bridge/Services/Clients/SystemLicenseClient.fs +11 -0
- package/src/Bridge/Services/Endpoints.fs +13 -0
- package/src/Bridge/Services/IHttpTransport.fs +10 -0
- package/src/{Fossa.Bridge/bin/Release/net8.0 → Bridge/bin/Release/net10.0}/Fossa.Bridge.deps.json +4 -4
- package/src/Bridge/obj/Bridge.fsproj.nuget.dgspec.json +357 -0
- package/src/Bridge/obj/Release/Fossa.Bridge.0.1.6.nuspec +31 -0
- package/src/{Fossa.Bridge/obj/Release/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.fs → Bridge/obj/Release/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.fs} +1 -1
- package/src/{Fossa.Bridge/obj/Release/net8.0/Fossa.Bridge.AssemblyInfo.fs → Bridge/obj/Release/net10.0/Bridge.AssemblyInfo.fs} +6 -4
- package/src/Bridge/obj/Release/net10.0/Bridge.fsproj.FileListAbsolute.txt +14 -0
- package/src/Bridge/obj/Release/net10.0/Bridge.sourcelink.json +1 -0
- package/src/Bridge/obj/project.assets.json +501 -0
- package/src/Directory.Build.props +23 -0
- package/tests/{Fossa.Bridge.Tests/Fossa.Bridge.Tests.fsproj → Bridge.Tests/Bridge.Tests.fsproj} +2 -2
- package/tests/Bridge.Tests/bin/Release/net10.0/.msCoverageSourceRootsMapping_Fossa.Bridge.Tests +0 -0
- package/tests/Bridge.Tests/bin/Release/net10.0/Fossa.Bridge.Tests +0 -0
- package/tests/{Fossa.Bridge.Tests/bin/Release/net8.0 → Bridge.Tests/bin/Release/net10.0}/Fossa.Bridge.Tests.deps.json +87 -74
- package/tests/{Fossa.Bridge.Tests/bin/Release/net8.0 → Bridge.Tests/bin/Release/net10.0}/Fossa.Bridge.Tests.runtimeconfig.json +2 -2
- package/tests/Bridge.Tests/obj/Bridge.Tests.fsproj.nuget.dgspec.json +712 -0
- package/tests/{Fossa.Bridge.Tests/obj/Fossa.Bridge.Tests.fsproj.nuget.g.props → Bridge.Tests/obj/Bridge.Tests.fsproj.nuget.g.props} +2 -2
- package/tests/{Fossa.Bridge.Tests/obj/Fossa.Bridge.Tests.fsproj.nuget.g.targets → Bridge.Tests/obj/Bridge.Tests.fsproj.nuget.g.targets} +1 -1
- package/tests/{Fossa.Bridge.Tests/obj/Release/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.fs → Bridge.Tests/obj/Release/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.fs} +1 -1
- package/tests/{Fossa.Bridge.Tests/obj/Release/net8.0/Fossa.Bridge.Tests.AssemblyInfo.fs → Bridge.Tests/obj/Release/net10.0/Bridge.Tests.AssemblyInfo.fs} +4 -2
- package/tests/Bridge.Tests/obj/Release/net10.0/Bridge.Tests.fsproj.FileListAbsolute.txt +190 -0
- package/tests/Bridge.Tests/obj/Release/net10.0/Bridge.Tests.sourcelink.json +1 -0
- package/tests/Bridge.Tests/obj/Release/net10.0/apphost +0 -0
- package/tests/{Fossa.Bridge.Tests → Bridge.Tests}/obj/project.assets.json +374 -253
- package/tsconfig.json +3 -1
- package/Fossa.Bridge.slnx +0 -8
- package/src/Fossa.Bridge/Fossa.Bridge.fsproj +0 -17
- package/src/Fossa.Bridge/bin/Release/net8.0/Fossa.Bridge.fable-temp.deps.json +0 -41
- package/src/Fossa.Bridge/obj/Fossa.Bridge.fable-temp.csproj.nuget.dgspec.json +0 -83
- package/src/Fossa.Bridge/obj/Fossa.Bridge.fable-temp.csproj.nuget.g.props +0 -25
- package/src/Fossa.Bridge/obj/Fossa.Bridge.fsproj.nuget.dgspec.json +0 -86
- package/src/Fossa.Bridge/obj/Fossa.Bridge.fsproj.nuget.g.targets +0 -2
- package/src/Fossa.Bridge/obj/Release/Fossa.Bridge.0.1.4.nuspec +0 -20
- package/src/Fossa.Bridge/obj/Release/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs +0 -4
- package/src/Fossa.Bridge/obj/Release/net8.0/Fossa.Bridge.fable-temp.AssemblyInfo.cs +0 -23
- package/src/Fossa.Bridge/obj/Release/net8.0/Fossa.Bridge.fable-temp.GeneratedMSBuildEditorConfig.editorconfig +0 -17
- package/src/Fossa.Bridge/obj/Release/net8.0/Fossa.Bridge.fable-temp.csproj.FileListAbsolute.txt +0 -4
- package/src/Fossa.Bridge/obj/Release/net8.0/Fossa.Bridge.fsproj.FileListAbsolute.txt +0 -14
- package/src/Fossa.Bridge/obj/Release/net8.0/Fossa.Bridge.sourcelink.json +0 -1
- package/src/Fossa.Bridge/obj/project.assets.json +0 -230
- package/tests/Fossa.Bridge.Tests/bin/Release/net8.0/.msCoverageSourceRootsMapping_Fossa.Bridge.Tests +0 -0
- package/tests/Fossa.Bridge.Tests/bin/Release/net8.0/Fossa.Bridge.Tests +0 -0
- package/tests/Fossa.Bridge.Tests/obj/Fossa.Bridge.Tests.fsproj.nuget.dgspec.json +0 -182
- package/tests/Fossa.Bridge.Tests/obj/Release/net8.0/Fossa.Bridge.Tests.fsproj.FileListAbsolute.txt +0 -190
- package/tests/Fossa.Bridge.Tests/obj/Release/net8.0/Fossa.Bridge.Tests.sourcelink.json +0 -1
- package/tests/Fossa.Bridge.Tests/obj/Release/net8.0/apphost +0 -0
- /package/src/{Fossa.Bridge → Bridge}/Services/UrlHelpers.fs +0 -0
- /package/src/{Fossa.Bridge/bin/Release/net8.0 → Bridge/bin/Release/net10.0}/Fossa.Bridge.xml +0 -0
- /package/src/{Fossa.Bridge/obj/Fossa.Bridge.fsproj.nuget.g.props → Bridge/obj/Bridge.fsproj.nuget.g.props} +0 -0
- /package/src/{Fossa.Bridge/obj/Fossa.Bridge.fable-temp.csproj.nuget.g.targets → Bridge/obj/Bridge.fsproj.nuget.g.targets} +0 -0
- /package/src/{Fossa.Bridge/obj/Release/net8.0 → Bridge/obj/Release/net10.0}/Fossa.Bridge.xml +0 -0
- /package/src/{Fossa.Bridge/obj/Release/net8.0 → Bridge/obj/Release/net10.0}/ILLink.Substitutions.xml +0 -0
- /package/tests/{Fossa.Bridge.Tests → Bridge.Tests}/Main.fs +0 -0
- /package/tests/{Fossa.Bridge.Tests → Bridge.Tests}/UrlHelpersTests.fs +0 -0
- /package/tests/{Fossa.Bridge.Tests/bin/Release/net8.0 → Bridge.Tests/bin/Release/net10.0}/Fossa.Bridge.xml +0 -0
- /package/tests/{Fossa.Bridge.Tests/obj/Release/net8.0/Fossa.Br.E9949494.Up2Date → Bridge.Tests/obj/Release/net10.0/Bridge.T.A317E392.Up2Date} +0 -0
- /package/tests/{Fossa.Bridge.Tests/obj/Release/net8.0 → Bridge.Tests/obj/Release/net10.0}/ILLink.Substitutions.xml +0 -0
package/.build.ps1
CHANGED
|
@@ -115,7 +115,7 @@ Task RestoreTools Clean, {
|
|
|
115
115
|
|
|
116
116
|
# Synopsis: Restore NuGet packages
|
|
117
117
|
Task RestoreNuGetPackages Clean, EnsureCentralPackageVersions, {
|
|
118
|
-
$solution = Resolve-Path -Path '
|
|
118
|
+
$solution = Resolve-Path -Path 'Bridge.slnx'
|
|
119
119
|
Exec { dotnet restore $solution }
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -150,7 +150,7 @@ Task FormatXmlFiles Clean, {
|
|
|
150
150
|
|
|
151
151
|
# Synopsis: Format Fantomas
|
|
152
152
|
Task FormatFantomas Restore, {
|
|
153
|
-
$solution = Resolve-Path -Path '
|
|
153
|
+
$solution = Resolve-Path -Path 'Bridge.slnx'
|
|
154
154
|
Exec { dotnet fantomas . }
|
|
155
155
|
}
|
|
156
156
|
|
|
@@ -176,7 +176,7 @@ Task EstimateVersion Restore, {
|
|
|
176
176
|
# Synopsis: Build Project
|
|
177
177
|
Task BuildProject EstimateVersion, {
|
|
178
178
|
$state = Import-Clixml -Path ".\.trash\$Instance\state.clixml"
|
|
179
|
-
$project = Resolve-Path -Path 'src/
|
|
179
|
+
$project = Resolve-Path -Path 'src/Bridge/Bridge.fsproj'
|
|
180
180
|
$nextVersion = $state.NextVersion
|
|
181
181
|
|
|
182
182
|
Exec { dotnet build $project /v:m --configuration Release /p:version=$nextVersion }
|
|
@@ -184,13 +184,13 @@ Task BuildProject EstimateVersion, {
|
|
|
184
184
|
|
|
185
185
|
# Synopsis: Build
|
|
186
186
|
Task Build Format, BuildProject, {
|
|
187
|
-
$solution = Resolve-Path -Path '
|
|
187
|
+
$solution = Resolve-Path -Path 'Bridge.slnx'
|
|
188
188
|
Exec { dotnet build $solution --configuration Release }
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
# Synopsis: Unit Test
|
|
192
192
|
Task UnitTest Build, {
|
|
193
|
-
$project = Resolve-Path -Path 'tests/
|
|
193
|
+
$project = Resolve-Path -Path 'tests/Bridge.Tests/Bridge.Tests.fsproj'
|
|
194
194
|
Exec { dotnet run --project $project --configuration Release }
|
|
195
195
|
}
|
|
196
196
|
|
|
@@ -212,7 +212,7 @@ Task PackNuGet Build, Test, {
|
|
|
212
212
|
$state = Import-Clixml -Path ".\.trash\$Instance\state.clixml"
|
|
213
213
|
$buildArtifactsFolder = $state.BuildArtifactsFolder
|
|
214
214
|
$nextVersion = $state.NextVersion
|
|
215
|
-
$projectPath = Resolve-Path -Path 'src/
|
|
215
|
+
$projectPath = Resolve-Path -Path 'src/Bridge/Bridge.fsproj'
|
|
216
216
|
|
|
217
217
|
Exec { dotnet pack $projectPath /v:m /p:Configuration=Release /p:version=$nextVersion --output $buildArtifactsFolder }
|
|
218
218
|
|
|
@@ -231,7 +231,7 @@ Task PackNPM Build, Test, {
|
|
|
231
231
|
$distArtifactsFolder = $state.DistArtifactsFolder
|
|
232
232
|
$fableOutputArtifactsFolder = $state.FableOutputArtifactsFolder
|
|
233
233
|
$nextVersion = $state.NextVersion
|
|
234
|
-
$projectPath = Resolve-Path -Path 'src/
|
|
234
|
+
$projectPath = Resolve-Path -Path 'src/Bridge/Bridge.fsproj'
|
|
235
235
|
|
|
236
236
|
Exec { dotnet fable $projectPath --outDir $fableOutputArtifactsFolder --language typescript }
|
|
237
237
|
Exec { npm version $nextVersion --no-git-tag-version --allow-same-version }
|
|
@@ -258,6 +258,7 @@ Task PackNPM Build, Test, {
|
|
|
258
258
|
|
|
259
259
|
Exec { npm run build -- --project $tempTsConfigPath }
|
|
260
260
|
Exec { npm pack --pack-destination $buildArtifactsFolder }
|
|
261
|
+
Exec { npm version "1.0.0" --no-git-tag-version --allow-same-version }
|
|
261
262
|
|
|
262
263
|
$npmPackage = Get-ChildItem -Path $buildArtifactsFolder -Filter '*.tgz' | Select-Object -First 1
|
|
263
264
|
|
package/.gitattributes
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
###############################
|
|
2
|
+
# Git Line Endings #
|
|
3
|
+
###############################
|
|
4
|
+
|
|
5
|
+
# Set default behavior to automatically normalize line endings.
|
|
6
|
+
* text=auto
|
|
7
|
+
|
|
8
|
+
# Force batch scripts to always use CRLF line endings so that if a repo is accessed
|
|
9
|
+
# in Windows via a file share from Linux, the scripts will work.
|
|
10
|
+
*.{cmd,[cC][mM][dD]} text eol=crlf
|
|
11
|
+
*.{bat,[bB][aA][tT]} text eol=crlf
|
|
12
|
+
|
|
13
|
+
# Force bash scripts to always use LF line endings so that if a repo is accessed
|
|
14
|
+
# in Unix via a file share from Windows, the scripts will work.
|
|
15
|
+
*.sh text eol=lf
|
|
16
|
+
|
|
17
|
+
###############################
|
|
18
|
+
# Git Large File System (LFS) #
|
|
19
|
+
###############################
|
|
20
|
+
|
|
21
|
+
# Archives
|
|
22
|
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
|
23
|
+
*.br filter=lfs diff=lfs merge=lfs -text
|
|
24
|
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
|
25
|
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
|
26
|
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
|
27
|
+
|
|
28
|
+
# Documents
|
|
29
|
+
*.pdf filter=lfs diff=lfs merge=lfs -text
|
|
30
|
+
|
|
31
|
+
# Images
|
|
32
|
+
*.gif filter=lfs diff=lfs merge=lfs -text
|
|
33
|
+
*.ico filter=lfs diff=lfs merge=lfs -text
|
|
34
|
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
|
35
|
+
*.png filter=lfs diff=lfs merge=lfs -text
|
|
36
|
+
*.psd filter=lfs diff=lfs merge=lfs -text
|
|
37
|
+
*.webp filter=lfs diff=lfs merge=lfs -text
|
|
38
|
+
|
|
39
|
+
# Fonts
|
|
40
|
+
*.woff2 filter=lfs diff=lfs merge=lfs -text
|
|
41
|
+
|
|
42
|
+
# Other
|
|
43
|
+
*.exe filter=lfs diff=lfs merge=lfs -text
|
package/Bridge.slnx
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<Project>
|
|
2
|
+
<PropertyGroup Label="Build">
|
|
3
|
+
<LangVersion>latest</LangVersion>
|
|
4
|
+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
|
|
5
|
+
<AnalysisLevel>latest</AnalysisLevel>
|
|
6
|
+
<ImplicitUsings>enable</ImplicitUsings>
|
|
7
|
+
<Nullable>enable</Nullable>
|
|
8
|
+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
|
9
|
+
<RootNamespace>Fossa.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
|
10
|
+
<AssemblyName>Fossa.$(MSBuildProjectName)</AssemblyName>
|
|
11
|
+
</PropertyGroup>
|
|
12
|
+
<PropertyGroup Label="Package">
|
|
13
|
+
<Authors>Tigran TIKSN Torosyan</Authors>
|
|
14
|
+
<Company>Tigran TIKSN Torosyan</Company>
|
|
15
|
+
<Copyright>Copyright © Tigran TIKSN Torosyan. All rights Reserved</Copyright>
|
|
16
|
+
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
|
17
|
+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
|
18
|
+
<PackageProjectUrl>https://github.com/fossa-app/Bridge</PackageProjectUrl>
|
|
19
|
+
<PackageIcon>Icon.png</PackageIcon>
|
|
20
|
+
<PackageReadmeFile>README.md</PackageReadmeFile>
|
|
21
|
+
<RepositoryUrl>https://github.com/fossa-app/Bridge.git</RepositoryUrl>
|
|
22
|
+
<RepositoryType>git</RepositoryType>
|
|
23
|
+
<PackageReleaseNotes>https://github.com/fossa-app/Bridge/releases</PackageReleaseNotes>
|
|
24
|
+
</PropertyGroup>
|
|
25
|
+
</Project>
|
package/Images/Icon.png
ADDED
|
Binary file
|
package/dotnet-tools.json
CHANGED
package/gig.ps1
CHANGED
|
@@ -13,4 +13,5 @@ gig -list visualstudio, visualstudiocode, rider, fsharp, powershell, macos, inte
|
|
|
13
13
|
|
|
14
14
|
Add-Content -Path .\.gitignore -Value '# Repository Specific' -Encoding ascii
|
|
15
15
|
Add-Content -Path .\.gitignore -Value '.trash' -Encoding ascii
|
|
16
|
-
Add-Content -Path .\.gitignore -Value '.idea/' -Encoding ascii
|
|
16
|
+
Add-Content -Path .\.gitignore -Value '.idea/' -Encoding ascii
|
|
17
|
+
Add-Content -Path .\.gitignore -Value '*.fable-temp.csproj' -Encoding ascii
|
package/package.json
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
|
2
|
+
<PropertyGroup>
|
|
3
|
+
<TargetFramework>net10.0</TargetFramework>
|
|
4
|
+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
|
5
|
+
<PackageId>Fossa.Bridge</PackageId>
|
|
6
|
+
<Version>1.0.0</Version>
|
|
7
|
+
<Description>Shared Domain Models and DTOs for Fossa UI and API</Description>
|
|
8
|
+
</PropertyGroup>
|
|
9
|
+
<ItemGroup>
|
|
10
|
+
<Compile Include="Models\ApiModels.fs" />
|
|
11
|
+
<Compile Include="Services\UrlHelpers.fs" />
|
|
12
|
+
<Compile Include="Services\Endpoints.fs" />
|
|
13
|
+
<Compile Include="Services\IHttpTransport.fs" />
|
|
14
|
+
<Compile Include="Services\Clients\CompanyClient.fs" />
|
|
15
|
+
<Compile Include="Services\Clients\CompanySettingsClient.fs" />
|
|
16
|
+
<Compile Include="Services\Clients\EmployeeClient.fs" />
|
|
17
|
+
<Compile Include="Services\Clients\IdentityClient.fs" />
|
|
18
|
+
<Compile Include="Services\Clients\BranchClient.fs" />
|
|
19
|
+
<Compile Include="Services\Clients\DepartmentClient.fs" />
|
|
20
|
+
<Compile Include="Services\Clients\CompanyLicenseClient.fs" />
|
|
21
|
+
<Compile Include="Services\Clients\SystemLicenseClient.fs" />
|
|
22
|
+
</ItemGroup>
|
|
23
|
+
<ItemGroup>
|
|
24
|
+
<PackageReference Include="Fable.Core" Version="4.5.0" />
|
|
25
|
+
</ItemGroup>
|
|
26
|
+
</Project>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
namespace Fossa.Bridge.Services.Clients
|
|
2
|
+
|
|
3
|
+
open System.Threading.Tasks
|
|
4
|
+
open Fossa.Bridge.Models
|
|
5
|
+
open Fossa.Bridge.Services
|
|
6
|
+
open System
|
|
7
|
+
|
|
8
|
+
type BranchClient(transport: IHttpTransport) =
|
|
9
|
+
let buildUrl (queryParams: BranchQueryRequestModel) =
|
|
10
|
+
let mutable url = Endpoints.BasePath + "/" + Endpoints.Branches + "?"
|
|
11
|
+
|
|
12
|
+
if queryParams.Id.Count > 0 then
|
|
13
|
+
let ids = queryParams.Id |> Seq.map (fun id -> $"Id={id}") |> String.concat "&"
|
|
14
|
+
url <- url + ids + "&"
|
|
15
|
+
|
|
16
|
+
if not (String.IsNullOrEmpty(queryParams.Search)) then
|
|
17
|
+
url <- url + $"Search={Uri.EscapeDataString(queryParams.Search)}&"
|
|
18
|
+
|
|
19
|
+
if queryParams.PageNumber.HasValue then
|
|
20
|
+
url <- url + $"PageNumber={queryParams.PageNumber.Value}&"
|
|
21
|
+
|
|
22
|
+
if queryParams.PageSize.HasValue then
|
|
23
|
+
url <- url + $"PageSize={queryParams.PageSize.Value}&"
|
|
24
|
+
|
|
25
|
+
url.TrimEnd('&')
|
|
26
|
+
|
|
27
|
+
member _.GetBranchesAsync(query: BranchQueryRequestModel) : Task<PagingResponseModel<BranchRetrievalModel>> =
|
|
28
|
+
transport.GetAsync<PagingResponseModel<BranchRetrievalModel>>(buildUrl query)
|
|
29
|
+
|
|
30
|
+
member _.GetBranchAsync(id: int64) : Task<BranchRetrievalModel> =
|
|
31
|
+
transport.GetAsync<BranchRetrievalModel>(Endpoints.BasePath + "/" + Endpoints.Branches + $"/{id}")
|
|
32
|
+
|
|
33
|
+
member _.CreateBranchAsync(model: BranchModificationModel) : Task<BranchRetrievalModel> =
|
|
34
|
+
transport.PostAsync<BranchModificationModel, BranchRetrievalModel>(
|
|
35
|
+
Endpoints.BasePath + "/" + Endpoints.Branches,
|
|
36
|
+
model
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
member _.UpdateBranchAsync(id: int64, model: BranchModificationModel) : Task<BranchRetrievalModel> =
|
|
40
|
+
transport.PutAsync<BranchModificationModel, BranchRetrievalModel>(
|
|
41
|
+
Endpoints.BasePath + "/" + Endpoints.Branches + $"/{id}",
|
|
42
|
+
model
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
member _.DeleteBranchAsync(id: int64) : Task<unit> =
|
|
46
|
+
transport.DeleteAsync(Endpoints.BasePath + "/" + Endpoints.Branches + $"/{id}")
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
namespace Fossa.Bridge.Services.Clients
|
|
2
|
+
|
|
3
|
+
open System.Threading.Tasks
|
|
4
|
+
open Fossa.Bridge.Models
|
|
5
|
+
open Fossa.Bridge.Services
|
|
6
|
+
|
|
7
|
+
type CompanyClient(transport: IHttpTransport) =
|
|
8
|
+
member _.GetCompanyAsync() : Task<CompanyRetrievalModel> =
|
|
9
|
+
transport.GetAsync<CompanyRetrievalModel>(Endpoints.BasePath + "/" + Endpoints.Company)
|
|
10
|
+
|
|
11
|
+
member _.CreateCompanyAsync(model: CompanyModificationModel) : Task<CompanyRetrievalModel> =
|
|
12
|
+
transport.PostAsync<CompanyModificationModel, CompanyRetrievalModel>(
|
|
13
|
+
Endpoints.BasePath + "/" + Endpoints.Company,
|
|
14
|
+
model
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
member _.UpdateCompanyAsync(model: CompanyModificationModel) : Task<CompanyRetrievalModel> =
|
|
18
|
+
transport.PutAsync<CompanyModificationModel, CompanyRetrievalModel>(
|
|
19
|
+
Endpoints.BasePath + "/" + Endpoints.Company,
|
|
20
|
+
model
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
member _.DeleteCompanyAsync() : Task<unit> =
|
|
24
|
+
transport.DeleteAsync(Endpoints.BasePath + "/" + Endpoints.Company)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
namespace Fossa.Bridge.Services.Clients
|
|
2
|
+
|
|
3
|
+
open System.Threading.Tasks
|
|
4
|
+
open Fossa.Bridge.Models
|
|
5
|
+
open Fossa.Bridge.Services
|
|
6
|
+
|
|
7
|
+
type CompanyLicenseClient(transport: IHttpTransport) =
|
|
8
|
+
member _.GetLicenseAsync() : Task<LicenseResponseModel<CompanyEntitlementsModel>> =
|
|
9
|
+
transport.GetAsync<LicenseResponseModel<CompanyEntitlementsModel>>(
|
|
10
|
+
Endpoints.BasePath + "/" + Endpoints.CompanyLicense
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
member _.CreateLicenseAsync(model: string) : Task<LicenseResponseModel<CompanyEntitlementsModel>> =
|
|
14
|
+
transport.PostAsync<string, LicenseResponseModel<CompanyEntitlementsModel>>(
|
|
15
|
+
Endpoints.BasePath + "/" + Endpoints.CompanyLicense,
|
|
16
|
+
model
|
|
17
|
+
)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
namespace Fossa.Bridge.Services.Clients
|
|
2
|
+
|
|
3
|
+
open System.Threading.Tasks
|
|
4
|
+
open Fossa.Bridge.Models
|
|
5
|
+
open Fossa.Bridge.Services
|
|
6
|
+
|
|
7
|
+
type CompanySettingsClient(transport: IHttpTransport) =
|
|
8
|
+
member _.GetCompanySettingsAsync() : Task<CompanySettingsRetrievalModel> =
|
|
9
|
+
transport.GetAsync<CompanySettingsRetrievalModel>(Endpoints.BasePath + "/" + Endpoints.CompanySettings)
|
|
10
|
+
|
|
11
|
+
member _.CreateCompanySettingsAsync(model: CompanySettingsModificationModel) : Task<CompanySettingsRetrievalModel> =
|
|
12
|
+
transport.PostAsync<CompanySettingsModificationModel, CompanySettingsRetrievalModel>(
|
|
13
|
+
Endpoints.BasePath + "/" + Endpoints.CompanySettings,
|
|
14
|
+
model
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
member _.UpdateCompanySettingsAsync(model: CompanySettingsModificationModel) : Task<CompanySettingsRetrievalModel> =
|
|
18
|
+
transport.PutAsync<CompanySettingsModificationModel, CompanySettingsRetrievalModel>(
|
|
19
|
+
Endpoints.BasePath + "/" + Endpoints.CompanySettings,
|
|
20
|
+
model
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
member _.DeleteCompanySettingsAsync() : Task<unit> =
|
|
24
|
+
transport.DeleteAsync(Endpoints.BasePath + "/" + Endpoints.CompanySettings)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
namespace Fossa.Bridge.Services.Clients
|
|
2
|
+
|
|
3
|
+
open System.Threading.Tasks
|
|
4
|
+
open Fossa.Bridge.Models
|
|
5
|
+
open Fossa.Bridge.Services
|
|
6
|
+
open System
|
|
7
|
+
|
|
8
|
+
type DepartmentClient(transport: IHttpTransport) =
|
|
9
|
+
let buildUrl (queryParams: DepartmentQueryRequestModel) =
|
|
10
|
+
let mutable url = Endpoints.BasePath + "/" + Endpoints.Departments + "?"
|
|
11
|
+
|
|
12
|
+
if queryParams.Id.Count > 0 then
|
|
13
|
+
let ids = queryParams.Id |> Seq.map (fun id -> $"Id={id}") |> String.concat "&"
|
|
14
|
+
url <- url + ids + "&"
|
|
15
|
+
|
|
16
|
+
if not (String.IsNullOrEmpty(queryParams.Search)) then
|
|
17
|
+
url <- url + $"Search={Uri.EscapeDataString(queryParams.Search)}&"
|
|
18
|
+
|
|
19
|
+
if queryParams.PageNumber.HasValue then
|
|
20
|
+
url <- url + $"PageNumber={queryParams.PageNumber.Value}&"
|
|
21
|
+
|
|
22
|
+
if queryParams.PageSize.HasValue then
|
|
23
|
+
url <- url + $"PageSize={queryParams.PageSize.Value}&"
|
|
24
|
+
|
|
25
|
+
url.TrimEnd('&')
|
|
26
|
+
|
|
27
|
+
member _.GetDepartmentsAsync
|
|
28
|
+
(query: DepartmentQueryRequestModel)
|
|
29
|
+
: Task<PagingResponseModel<DepartmentRetrievalModel>> =
|
|
30
|
+
transport.GetAsync<PagingResponseModel<DepartmentRetrievalModel>>(buildUrl query)
|
|
31
|
+
|
|
32
|
+
member _.GetDepartmentAsync(id: int64) : Task<DepartmentRetrievalModel> =
|
|
33
|
+
transport.GetAsync<DepartmentRetrievalModel>(Endpoints.BasePath + "/" + Endpoints.Departments + $"/{id}")
|
|
34
|
+
|
|
35
|
+
member _.CreateDepartmentAsync(model: DepartmentModificationModel) : Task<DepartmentRetrievalModel> =
|
|
36
|
+
transport.PostAsync<DepartmentModificationModel, DepartmentRetrievalModel>(
|
|
37
|
+
Endpoints.BasePath + "/" + Endpoints.Departments,
|
|
38
|
+
model
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
member _.UpdateDepartmentAsync(id: int64, model: DepartmentModificationModel) : Task<DepartmentRetrievalModel> =
|
|
42
|
+
transport.PutAsync<DepartmentModificationModel, DepartmentRetrievalModel>(
|
|
43
|
+
Endpoints.BasePath + "/" + Endpoints.Departments + $"/{id}",
|
|
44
|
+
model
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
member _.DeleteDepartmentAsync(id: int64) : Task<unit> =
|
|
48
|
+
transport.DeleteAsync(Endpoints.BasePath + "/" + Endpoints.Departments + $"/{id}")
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
namespace Fossa.Bridge.Services.Clients
|
|
2
|
+
|
|
3
|
+
open System.Threading.Tasks
|
|
4
|
+
open Fossa.Bridge.Models
|
|
5
|
+
open Fossa.Bridge.Services
|
|
6
|
+
open System
|
|
7
|
+
|
|
8
|
+
type EmployeeClient(transport: IHttpTransport) =
|
|
9
|
+
let buildUrl (queryParams: EmployeeQueryRequestModel) =
|
|
10
|
+
let mutable url = Endpoints.BasePath + "/" + Endpoints.Employees + "?"
|
|
11
|
+
|
|
12
|
+
if queryParams.Id.Count > 0 then
|
|
13
|
+
let ids = queryParams.Id |> Seq.map (fun id -> $"Id={id}") |> String.concat "&"
|
|
14
|
+
url <- url + ids + "&"
|
|
15
|
+
|
|
16
|
+
if not (String.IsNullOrEmpty(queryParams.Search)) then
|
|
17
|
+
url <- url + $"Search={Uri.EscapeDataString(queryParams.Search)}&"
|
|
18
|
+
|
|
19
|
+
if queryParams.PageNumber.HasValue then
|
|
20
|
+
url <- url + $"PageNumber={queryParams.PageNumber.Value}&"
|
|
21
|
+
|
|
22
|
+
if queryParams.PageSize.HasValue then
|
|
23
|
+
url <- url + $"PageSize={queryParams.PageSize.Value}&"
|
|
24
|
+
|
|
25
|
+
if queryParams.ReportsToId.HasValue then
|
|
26
|
+
url <- url + $"ReportsToId={queryParams.ReportsToId.Value}&"
|
|
27
|
+
|
|
28
|
+
if queryParams.TopLevelOnly.HasValue then
|
|
29
|
+
url <- url + $"TopLevelOnly={queryParams.TopLevelOnly.Value}&"
|
|
30
|
+
|
|
31
|
+
url.TrimEnd('&')
|
|
32
|
+
|
|
33
|
+
let buildPagingUrl (queryParams: EmployeePagingRequestModel) =
|
|
34
|
+
let mutable url = Endpoints.BasePath + "/" + Endpoints.Employees + "?"
|
|
35
|
+
|
|
36
|
+
if not (String.IsNullOrEmpty(queryParams.Search)) then
|
|
37
|
+
url <- url + $"Search={Uri.EscapeDataString(queryParams.Search)}&"
|
|
38
|
+
|
|
39
|
+
if queryParams.PageNumber.HasValue then
|
|
40
|
+
url <- url + $"PageNumber={queryParams.PageNumber.Value}&"
|
|
41
|
+
|
|
42
|
+
if queryParams.PageSize.HasValue then
|
|
43
|
+
url <- url + $"PageSize={queryParams.PageSize.Value}&"
|
|
44
|
+
|
|
45
|
+
url.TrimEnd('&')
|
|
46
|
+
|
|
47
|
+
member _.GetEmployeesAsync(query: EmployeeQueryRequestModel) : Task<PagingResponseModel<EmployeeRetrievalModel>> =
|
|
48
|
+
transport.GetAsync<PagingResponseModel<EmployeeRetrievalModel>>(buildUrl query)
|
|
49
|
+
|
|
50
|
+
member _.GetEmployeesPagingAsync
|
|
51
|
+
(query: EmployeePagingRequestModel)
|
|
52
|
+
: Task<PagingResponseModel<EmployeeRetrievalModel>> =
|
|
53
|
+
transport.GetAsync<PagingResponseModel<EmployeeRetrievalModel>>(buildPagingUrl query)
|
|
54
|
+
|
|
55
|
+
member _.GetEmployeeAsync(id: int64) : Task<EmployeeRetrievalModel> =
|
|
56
|
+
transport.GetAsync<EmployeeRetrievalModel>(Endpoints.BasePath + "/" + Endpoints.Employee + $"/{id}")
|
|
57
|
+
|
|
58
|
+
member _.CreateEmployeeAsync(model: EmployeeModificationModel) : Task<EmployeeRetrievalModel> =
|
|
59
|
+
transport.PostAsync<EmployeeModificationModel, EmployeeRetrievalModel>(
|
|
60
|
+
Endpoints.BasePath + "/" + Endpoints.Employee,
|
|
61
|
+
model
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
member _.UpdateEmployeeAsync(id: int64, model: EmployeeModificationModel) : Task<EmployeeRetrievalModel> =
|
|
65
|
+
transport.PutAsync<EmployeeModificationModel, EmployeeRetrievalModel>(
|
|
66
|
+
Endpoints.BasePath + "/" + Endpoints.Employee + $"/{id}",
|
|
67
|
+
model
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
member _.DeleteEmployeeAsync(id: int64) : Task<unit> =
|
|
71
|
+
transport.DeleteAsync(Endpoints.BasePath + "/" + Endpoints.Employee + $"/{id}")
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
namespace Fossa.Bridge.Services.Clients
|
|
2
|
+
|
|
3
|
+
open System.Threading.Tasks
|
|
4
|
+
open Fossa.Bridge.Models
|
|
5
|
+
open Fossa.Bridge.Services
|
|
6
|
+
|
|
7
|
+
type IdentityClient(transport: IHttpTransport) =
|
|
8
|
+
member _.GetClientAsync(origin: string) : Task<IdentityClientRetrievalModel> =
|
|
9
|
+
transport.GetAsync<IdentityClientRetrievalModel>(
|
|
10
|
+
Endpoints.BasePath + "/" + Endpoints.Client + $"?origin={origin}"
|
|
11
|
+
)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
namespace Fossa.Bridge.Services.Clients
|
|
2
|
+
|
|
3
|
+
open System.Threading.Tasks
|
|
4
|
+
open Fossa.Bridge.Models
|
|
5
|
+
open Fossa.Bridge.Services
|
|
6
|
+
|
|
7
|
+
type SystemLicenseClient(transport: IHttpTransport) =
|
|
8
|
+
member _.GetLicenseAsync() : Task<LicenseResponseModel<SystemEntitlementsModel>> =
|
|
9
|
+
transport.GetAsync<LicenseResponseModel<SystemEntitlementsModel>>(
|
|
10
|
+
Endpoints.BasePath + "/" + Endpoints.SystemLicense
|
|
11
|
+
)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
namespace Fossa.Bridge.Services
|
|
2
|
+
|
|
3
|
+
module Endpoints =
|
|
4
|
+
let BasePath = "api/1.0"
|
|
5
|
+
let Client = "Identity/Client"
|
|
6
|
+
let SystemLicense = "License/System"
|
|
7
|
+
let CompanyLicense = "License/Company"
|
|
8
|
+
let Company = "Company"
|
|
9
|
+
let CompanySettings = "CompanySettings"
|
|
10
|
+
let Branches = "Branches"
|
|
11
|
+
let Departments = "Departments"
|
|
12
|
+
let Employee = "Employee"
|
|
13
|
+
let Employees = "Employees"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
namespace Fossa.Bridge.Services
|
|
2
|
+
|
|
3
|
+
open System.Threading.Tasks
|
|
4
|
+
open Fossa.Bridge.Models
|
|
5
|
+
|
|
6
|
+
type IHttpTransport =
|
|
7
|
+
abstract member GetAsync<'TResponse> : string -> Task<'TResponse>
|
|
8
|
+
abstract member PostAsync<'TRequest, 'TResponse> : string * 'TRequest -> Task<'TResponse>
|
|
9
|
+
abstract member PutAsync<'TRequest, 'TResponse> : string * 'TRequest -> Task<'TResponse>
|
|
10
|
+
abstract member DeleteAsync: string -> Task<unit>
|
package/src/{Fossa.Bridge/bin/Release/net8.0 → Bridge/bin/Release/net10.0}/Fossa.Bridge.deps.json
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"runtimeTarget": {
|
|
3
|
-
"name": ".NETCoreApp,Version=
|
|
3
|
+
"name": ".NETCoreApp,Version=v10.0",
|
|
4
4
|
"signature": ""
|
|
5
5
|
},
|
|
6
6
|
"compilationOptions": {},
|
|
7
7
|
"targets": {
|
|
8
|
-
".NETCoreApp,Version=
|
|
9
|
-
"Fossa.Bridge/0.1.
|
|
8
|
+
".NETCoreApp,Version=v10.0": {
|
|
9
|
+
"Fossa.Bridge/0.1.6": {
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"FSharp.Core": "10.0.102",
|
|
12
12
|
"Fable.Core": "4.5.0"
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
"libraries": {
|
|
78
|
-
"Fossa.Bridge/0.1.
|
|
78
|
+
"Fossa.Bridge/0.1.6": {
|
|
79
79
|
"type": "project",
|
|
80
80
|
"serviceable": false,
|
|
81
81
|
"sha512": ""
|