Skip to content

Commit 4d59238

Browse files
authored
Merge pull request #1 from panxl6/master
feat: supporting 2024-04 version.
2 parents 5ecfe4e + 74e667b commit 4d59238

File tree

92 files changed

+7722
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+7722
-1
lines changed

.github/workflows/publish.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: .NET Build, Test, and Publish Nuget Package
2+
3+
on:
4+
release:
5+
types: [ created ]
6+
env:
7+
VERSION: 1.0.0
8+
9+
defaults:
10+
run:
11+
working-directory: src
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set Version Variable
19+
if: ${{ github.ref_type == 'tag' }}
20+
env:
21+
TAG: ${{ github.ref_name }}
22+
run: echo "VERSION=${TAG#v}" >> $GITHUB_ENV
23+
- name: Setup .NET
24+
uses: actions/setup-dotnet@v2
25+
with:
26+
dotnet-version: 7.0.x
27+
- name: Restore dependencies
28+
run: dotnet restore
29+
- name: Build
30+
run: dotnet build --no-restore /p:Version=$VERSION
31+
- name: Test
32+
run: dotnet test --no-build --verbosity normal
33+
- name: pack nuget packages
34+
run: dotnet pack --output nupkgs --no-restore --no-build /p:PackageVersion=$VERSION
35+
- name: upload nuget package
36+
run: dotnet nuget push nupkgs/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.idea/
2+
.vs/
3+
src/AfterShipTracking/Test/
4+
src/AfterShipTracking/AfterShipTracking/bin/
5+
src/AfterShipTracking/AfterShipTracking/obj/
6+
Tracking.sln.DotSettings.user
7+
.DS_Store
8+
.config/

LICENSE.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2024 AfterShip
2+
3+
Permission is hereby granted, free of charge, to any person
4+
obtaining a copy of this software and associated documentation
5+
files (the "Software"), to deal in the Software without
6+
restriction, including without limitation the rights to use,
7+
copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the
9+
Software is furnished to do so, subject to the following
10+
conditions:
11+
12+
The above copyright notice and this permission notice shall be
13+
included in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 382 additions & 1 deletion
Large diffs are not rendered by default.

icon.png

8.28 KB
Loading
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 25.0.1706.9
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AfterShipTracking", "AfterShipTracking\AfterShipTracking.csproj", "{D3099A91-E005-4291-88AD-D7A3B85DDC1D}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{D3099A91-E005-4291-88AD-D7A3B85DDC1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{D3099A91-E005-4291-88AD-D7A3B85DDC1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{D3099A91-E005-4291-88AD-D7A3B85DDC1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{D3099A91-E005-4291-88AD-D7A3B85DDC1D}.Release|Any CPU.Build.0 = Release|Any CPU
18+
{D2C22390-8325-4493-B940-F89BD8BA19EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19+
{D2C22390-8325-4493-B940-F89BD8BA19EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
20+
{D2C22390-8325-4493-B940-F89BD8BA19EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{D2C22390-8325-4493-B940-F89BD8BA19EA}.Release|Any CPU.Build.0 = Release|Any CPU
22+
EndGlobalSection
23+
GlobalSection(SolutionProperties) = preSolution
24+
HideSolutionNode = FALSE
25+
EndGlobalSection
26+
GlobalSection(ExtensibilityGlobals) = postSolution
27+
SolutionGuid = {5C216FDA-5980-4A44-A348-7C9B82282CE4}
28+
EndGlobalSection
29+
EndGlobal
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/*
2+
* This code was auto generated by AfterShip SDK Generator.
3+
* Do not edit the class manually.
4+
*/
5+
namespace AfterShipTracking
6+
{
7+
/// <summary>
8+
/// Tracking adapter for legacy object convert to new model object
9+
/// </summary>
10+
public class GetNotificationByTrackingIdAdapter
11+
: IAdapter<Notification, GetNotificationByTrackingIdResponse>
12+
{
13+
public Notification Adapt(GetNotificationByTrackingIdResponse source)
14+
{
15+
return source.Notification;
16+
}
17+
}
18+
19+
/// <summary>
20+
/// Tracking adapter for legacy object convert to new model object
21+
/// </summary>
22+
public class AddNotificationByTrackingIdAdapter
23+
: IAdapter<Notification, AddNotificationByTrackingIdResponse>
24+
{
25+
public Notification Adapt(AddNotificationByTrackingIdResponse source)
26+
{
27+
return source.Notification;
28+
}
29+
}
30+
31+
/// <summary>
32+
/// Tracking adapter for legacy object convert to new model object
33+
/// </summary>
34+
public class DeleteNotificationByTrackingIdAdapter
35+
: IAdapter<Notification, DeleteNotificationByTrackingIdResponse>
36+
{
37+
public Notification Adapt(DeleteNotificationByTrackingIdResponse source)
38+
{
39+
return source.Notification;
40+
}
41+
}
42+
43+
/// <summary>
44+
/// Tracking adapter for legacy object convert to new model object
45+
/// </summary>
46+
public class GetNotificationBySlugTrackingNumberAdapter
47+
: IAdapter<Notification, GetNotificationBySlugTrackingNumberResponse>
48+
{
49+
public Notification Adapt(GetNotificationBySlugTrackingNumberResponse source)
50+
{
51+
return source.Notification;
52+
}
53+
}
54+
55+
/// <summary>
56+
/// Tracking adapter for legacy object convert to new model object
57+
/// </summary>
58+
public class AddNotificationBySlugTrackingNumberAdapter
59+
: IAdapter<Notification, AddNotificationBySlugTrackingNumberResponse>
60+
{
61+
public Notification Adapt(AddNotificationBySlugTrackingNumberResponse source)
62+
{
63+
return source.Notification;
64+
}
65+
}
66+
67+
/// <summary>
68+
/// Tracking adapter for legacy object convert to new model object
69+
/// </summary>
70+
public class DeleteNotificationBySlugTrackingNumberAdapter
71+
: IAdapter<Notification, DeleteNotificationBySlugTrackingNumberResponse>
72+
{
73+
public Notification Adapt(DeleteNotificationBySlugTrackingNumberResponse source)
74+
{
75+
return source.Notification;
76+
}
77+
}
78+
}
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
/*
2+
* This code was auto generated by AfterShip SDK Generator.
3+
* Do not edit the class manually.
4+
*/
5+
namespace AfterShipTracking
6+
{
7+
/// <summary>
8+
/// Tracking adapter for legacy object convert to new model object
9+
/// </summary>
10+
public class CreateTrackingAdapter : IAdapter<Tracking, CreateTrackingResponse>
11+
{
12+
public Tracking Adapt(CreateTrackingResponse source)
13+
{
14+
return source.Tracking;
15+
}
16+
}
17+
18+
/// <summary>
19+
/// Tracking adapter for legacy object convert to new model object
20+
/// </summary>
21+
public class RetrackTrackingByIdAdapter
22+
: IAdapter<PartialUpdateTracking, RetrackTrackingByIdResponse>
23+
{
24+
public PartialUpdateTracking Adapt(RetrackTrackingByIdResponse source)
25+
{
26+
return source.Tracking;
27+
}
28+
}
29+
30+
/// <summary>
31+
/// Tracking adapter for legacy object convert to new model object
32+
/// </summary>
33+
public class MarkTrackingCompletedBySlugTrackingNumberAdapter
34+
: IAdapter<Tracking, MarkTrackingCompletedBySlugTrackingNumberResponse>
35+
{
36+
public Tracking Adapt(MarkTrackingCompletedBySlugTrackingNumberResponse source)
37+
{
38+
return source.Tracking;
39+
}
40+
}
41+
42+
/// <summary>
43+
/// Tracking list data adapter for legacy object convert to new model object
44+
/// </summary>
45+
public class GetTrackingsAdapter
46+
: IAdapter<GetTrackingsResponseTrackingListData, GetTrackingsResponse>
47+
{
48+
public GetTrackingsResponseTrackingListData Adapt(GetTrackingsResponse source)
49+
{
50+
GetTrackingsResponseTrackingListData data = new GetTrackingsResponseTrackingListData();
51+
data.Trackings = source.Trackings;
52+
data.Pagination = new PaginationPage(source.Page, source.Limit, source.Count);
53+
return data;
54+
}
55+
}
56+
57+
/// <summary>
58+
/// Tracking adapter for legacy object convert to new model object
59+
/// </summary>
60+
public class GetTrackingByIdAdapter : IAdapter<Tracking, GetTrackingByIdResponse>
61+
{
62+
public Tracking Adapt(GetTrackingByIdResponse source)
63+
{
64+
return source.Tracking;
65+
}
66+
}
67+
68+
/// <summary>
69+
/// Tracking adapter for legacy object convert to new model object
70+
/// </summary>
71+
public class UpdateTrackingByIdAdapter : IAdapter<Tracking, UpdateTrackingByIdResponse>
72+
{
73+
public Tracking Adapt(UpdateTrackingByIdResponse source)
74+
{
75+
return source.Tracking;
76+
}
77+
}
78+
79+
/// <summary>
80+
/// Tracking adapter for legacy object convert to new model object
81+
/// </summary>
82+
public class DeleteTrackingByIdAdapter
83+
: IAdapter<PartialDeleteTracking, DeleteTrackingByIdResponse>
84+
{
85+
public PartialDeleteTracking Adapt(DeleteTrackingByIdResponse source)
86+
{
87+
return source.Tracking;
88+
}
89+
}
90+
91+
/// <summary>
92+
/// Tracking adapter for legacy object convert to new model object
93+
/// </summary>
94+
public class GetTrackingBySlugTrackingNumberAdapter
95+
: IAdapter<Tracking, GetTrackingBySlugTrackingNumberResponse>
96+
{
97+
public Tracking Adapt(GetTrackingBySlugTrackingNumberResponse source)
98+
{
99+
return source.Tracking;
100+
}
101+
}
102+
103+
/// <summary>
104+
/// Tracking adapter for legacy object convert to new model object
105+
/// </summary>
106+
public class UpdateTrackingBySlugTrackingNumberAdapter
107+
: IAdapter<Tracking, UpdateTrackingBySlugTrackingNumberResponse>
108+
{
109+
public Tracking Adapt(UpdateTrackingBySlugTrackingNumberResponse source)
110+
{
111+
return source.Tracking;
112+
}
113+
}
114+
115+
/// <summary>
116+
/// Tracking adapter for legacy object convert to new model object
117+
/// </summary>
118+
public class MarkTrackingCompletedByIdAdapter
119+
: IAdapter<Tracking, MarkTrackingCompletedByIdResponse>
120+
{
121+
public Tracking Adapt(MarkTrackingCompletedByIdResponse source)
122+
{
123+
return source.Tracking;
124+
}
125+
}
126+
127+
/// <summary>
128+
/// Tracking adapter for legacy object convert to new model object
129+
/// </summary>
130+
public class DeleteTrackingBySlugTrackingNumberAdapter
131+
: IAdapter<PartialDeleteTracking, DeleteTrackingBySlugTrackingNumberResponse>
132+
{
133+
public PartialDeleteTracking Adapt(DeleteTrackingBySlugTrackingNumberResponse source)
134+
{
135+
return source.Tracking;
136+
}
137+
}
138+
139+
/// <summary>
140+
/// Tracking adapter for legacy object convert to new model object
141+
/// </summary>
142+
public class RetrackTrackingBySlugTrackingNumberAdapter
143+
: IAdapter<PartialUpdateTracking, RetrackTrackingBySlugTrackingNumberResponse>
144+
{
145+
public PartialUpdateTracking Adapt(RetrackTrackingBySlugTrackingNumberResponse source)
146+
{
147+
return source.Tracking;
148+
}
149+
}
150+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup Label="NuGet">
4+
<TargetFramework>net6.0</TargetFramework>
5+
<OutputPath>bin/Release</OutputPath>
6+
<Nullable>enable</Nullable>
7+
<IsPackable>true</IsPackable>
8+
<PackageId>AfterShipTracking</PackageId>
9+
<Description>The official AfterShip Tracking .net API library</Description>
10+
<Copyright>Copyright © AfterShip</Copyright>
11+
<AssemblyTitle>AfterShipTracking</AssemblyTitle>
12+
<NeutralLanguage>en-US</NeutralLanguage>
13+
<VersionPrefix>7.0.0</VersionPrefix>
14+
<VersionSuffix>
15+
</VersionSuffix>
16+
<Authors>AfterShip</Authors>
17+
<NoWarn>CS1587;CS1591;CS1570;CS1573;CS1572;CS8618;CS8603;CS8625;CS8604;CS8765</NoWarn>
18+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
19+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
20+
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
21+
<AssemblyName>AfterShipTracking</AssemblyName>
22+
<PackageTags>aftership;tracking;track;fedex;ups;usps;dhl;shipping;fulfillment;couriers;carriers</PackageTags>
23+
<PackageProjectUrl>https://www.aftership.com</PackageProjectUrl>
24+
<RepositoryUrl>https://github.com/aftership/tracking-sdk-net</RepositoryUrl>
25+
<RepositoryType>git</RepositoryType>
26+
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
27+
<PackageReadmeFile>README.md</PackageReadmeFile>
28+
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
29+
<PackageIcon>icon.png</PackageIcon>
30+
</PropertyGroup>
31+
32+
<ItemGroup>
33+
<None Include="../../../README.md" Pack="true" PackagePath="\" />
34+
<None Include="../../../icon.png" Pack="true" PackagePath="\" />
35+
<None Include="../../../LICENSE.txt" Pack="true" PackagePath="\" />
36+
</ItemGroup>
37+
38+
<ItemGroup>
39+
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.0.1" />
40+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
41+
<PackageReference Include="NUnit" Version="4.1.0" />
42+
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
43+
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.0.1" />
44+
</ItemGroup>
45+
46+
<ItemGroup>
47+
<Folder Include="Adapter\" />
48+
<Folder Include="Adapter\" />
49+
<Folder Include="Exception\" />
50+
<Folder Include="Models\" />
51+
<Folder Include="Properties\" />
52+
<Folder Include="Public\" />
53+
<Folder Include="RestAPI\" />
54+
</ItemGroup>
55+
</Project>

0 commit comments

Comments
 (0)