diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..63cde2f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,59 @@ +name: CI +on: + push: + branches: + - master + - release +jobs: + split-upm: + name: split upm branch + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: split upm branch + run: | + git branch -d upm &> /dev/null || echo upm branch not found # recreate the upm branch each time + git mv "$PKG_ROOT" "src/$UPM_ROOT" + git mv "src/$UPM_ROOT" . + git mv demo/Assets demo/Sample + git mv demo/Sample $UPM_ROOT + git mv doc Docs + git mv Docs $UPM_ROOT + git mv LICENSE $UPM_ROOT + git mv README.md $UPM_ROOT + git mv SECURITY.md $UPM_ROOT + git mv CHANGELOG.md $UPM_ROOT + git mv CONTRIBUTING.md $UPM_ROOT + echo "********************** ROOT **********************" + ls + git add "$UPM_ROOT" + git config --global user.name 'github-bot' + git config --global user.email 'github-bot@users.noreply.github.com' + git commit -m "create release folder" + git subtree split -P "$UPM_ROOT" -b upm # create the upm branch + git checkout upm # checkout the branch + if [[ -d "Sample/Packages" ]]; then + git rm -rf Sample/Packages + git rm Sample/Packages.meta --ignore-unmatch + git rm Sample/packages.config + git rm Sample/packages.config.meta --ignore-unmatch + fi + if [[ -d "Properties" ]]; then + git rm -rf Properties + git rm Properties.meta --ignore-unmatch + git rm Proyecto26.RestClient.csproj + git rm Proyecto26.RestClient.csproj.meta --ignore-unmatch + git rm Proyecto26.RestClient.nuspec + git rm Proyecto26.RestClient.nuspec.meta --ignore-unmatch + git rm packages.config + git rm packages.config.meta --ignore-unmatch + fi + git commit -am "fix: src => root" + echo "********************** ROOT **********************" + ls + git push -u origin upm --force # commit the branch + env: + PKG_ROOT: src/Proyecto26.RestClient + UPM_ROOT: Release \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 106f3b1..68d69e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.6.2] - 2021-12-26 + +### Added +- Add a progress reporting callback by [@lyze237](https://github.com/lyze237) ([#153](https://github.com/proyecto26/RestClient/pull/153)). +- Add support for **PATCH** verb by [@neegool](https://github.com/neegool) ([#185](https://github.com/proyecto26/RestClient/pull/185)). +- Add solution to make network call on main thread by [@maifeeulasad](https://github.com/maifeeulasad) ([#190](https://github.com/proyecto26/RestClient/pull/190)). +- Add support for UPM package by [@benukhanov](https://github.com/benukhanov), [@tonygiang](https://github.com/tonygiang) and [@Hermesiss](https://github.com/Hermesiss) ([#198](https://github.com/proyecto26/RestClient/pull/198)). + +### Changed +- Changes to use **RetryCallback** to handle token expiration by [@fegabe](https://github.com/fegabe) ([#142](https://github.com/proyecto26/RestClient/pull/142)). + +### Fixed +- Handle HTTP NO CONTENT status code (204) to prevent null reference exceptions by [@L-Naej](https://github.com/L-Naej) and [@StevenGarberg](https://github.com/StevenGarberg) ([#188](https://github.com/proyecto26/RestClient/pull/188)). + +### Removed +- Removing Depricated APIs by [@Drazail](https://github.com/Drazail) ([#164](https://github.com/proyecto26/RestClient/pull/164)). + ## [2.6.1] - 2020-06-10 ### Fixed @@ -142,7 +159,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [...1.0.1] Missing tags for previous versions 🤷‍♂ -[Unreleased]: https://github.com/proyecto26/RestClient/compare/v2.6.1...HEAD +[Unreleased]: https://github.com/proyecto26/RestClient/compare/v2.6.2...HEAD +[2.6.2]: https://github.com/proyecto26/RestClient/compare/v2.6.1...v2.6.2 [2.6.1]: https://github.com/proyecto26/RestClient/compare/v2.6.0...v2.6.1 [2.6.0]: https://github.com/proyecto26/RestClient/compare/v2.5.9...v2.6.0 [2.5.9]: https://github.com/proyecto26/RestClient/compare/2.5.7...v2.5.9 diff --git a/README.md b/README.md index a74af79..e1451ed 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,10 @@ Do you want to see this beautiful package in action? Download the demo [here](ht ### Unity package Download and install the **.unitypackage** file of the latest release published [here](https://github.com/proyecto26/RestClient/releases). -### Nuget package +### UPM package +Make sure you had installed [C# Promise package](https://openupm.com/packages/com.rsg.promise/) or at least have it in your [openupm scope registry](https://openupm.com/). Then install **RestClient package** using this URL from **Package Manager**: `https://github.com/proyecto26/RestClient.git#upm` + +### NuGet package Other option is download this package from **NuGet** with **Visual Studio** or using the **nuget-cli**, a **[NuGet.config](https://github.com/proyecto26/RestClient/blob/master/demo/NuGet.config)** file is required at the root of your **Unity Project**, for example: ```xml diff --git a/src/.gitignore b/src/.gitignore index 940794e..1c2b85e 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -52,7 +52,6 @@ artifacts/ *_p.c *_i.h *.ilk -*.meta *.obj *.pch *.pdb @@ -73,6 +72,11 @@ artifacts/ *.svclog *.scc +# Unity3D generated meta files +*.pidb.meta +*.pdb.meta +*.mdb.meta + # Chutzpah Test files _Chutzpah* diff --git a/src/Proyecto26.RestClient/Helpers.meta b/src/Proyecto26.RestClient/Helpers.meta new file mode 100644 index 0000000..f5faebd --- /dev/null +++ b/src/Proyecto26.RestClient/Helpers.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 4ad9b2bb061b34d0cbc89846acac21e9 +folderAsset: yes +timeCreated: 1561241146 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Proyecto26.RestClient/Helpers/Common.cs b/src/Proyecto26.RestClient/Helpers/Common.cs index ee184ff..5071c3f 100644 --- a/src/Proyecto26.RestClient/Helpers/Common.cs +++ b/src/Proyecto26.RestClient/Helpers/Common.cs @@ -1,5 +1,4 @@ using System.Text; -using System.Collections; using UnityEngine; using UnityEngine.Networking; diff --git a/src/Proyecto26.RestClient/Helpers/Common.cs.meta b/src/Proyecto26.RestClient/Helpers/Common.cs.meta new file mode 100644 index 0000000..de8efa1 --- /dev/null +++ b/src/Proyecto26.RestClient/Helpers/Common.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f0596e8f6932d47d8be675b5159332af +timeCreated: 1640509104 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Proyecto26.RestClient/Helpers/ExecuteOnMainThread.cs.meta b/src/Proyecto26.RestClient/Helpers/ExecuteOnMainThread.cs.meta new file mode 100644 index 0000000..9ad1c8b --- /dev/null +++ b/src/Proyecto26.RestClient/Helpers/ExecuteOnMainThread.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 0733c8560646240fbb47f18251b65752 +timeCreated: 1640509104 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Proyecto26.RestClient/Helpers/Extensions.cs.meta b/src/Proyecto26.RestClient/Helpers/Extensions.cs.meta new file mode 100644 index 0000000..9c62bc4 --- /dev/null +++ b/src/Proyecto26.RestClient/Helpers/Extensions.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 14d6bf89020404ffcae7bb1c4e0914f5 +timeCreated: 1640509104 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Proyecto26.RestClient/Helpers/HttpBase.cs.meta b/src/Proyecto26.RestClient/Helpers/HttpBase.cs.meta new file mode 100644 index 0000000..c726dbf --- /dev/null +++ b/src/Proyecto26.RestClient/Helpers/HttpBase.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1baea21eb28d54f6798a1744231bdbf0 +timeCreated: 1640509104 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Proyecto26.RestClient/Helpers/JsonHelper.cs.meta b/src/Proyecto26.RestClient/Helpers/JsonHelper.cs.meta new file mode 100644 index 0000000..121fa2d --- /dev/null +++ b/src/Proyecto26.RestClient/Helpers/JsonHelper.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 944681adfb0c241ad8130c56271145ba +timeCreated: 1640509104 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Proyecto26.RestClient/Helpers/RequestException.cs b/src/Proyecto26.RestClient/Helpers/RequestException.cs index b3940ae..3ebf910 100644 --- a/src/Proyecto26.RestClient/Helpers/RequestException.cs +++ b/src/Proyecto26.RestClient/Helpers/RequestException.cs @@ -1,4 +1,5 @@ using System; + namespace Proyecto26 { public class RequestException : Exception diff --git a/src/Proyecto26.RestClient/Helpers/RequestException.cs.meta b/src/Proyecto26.RestClient/Helpers/RequestException.cs.meta new file mode 100644 index 0000000..9ba33b5 --- /dev/null +++ b/src/Proyecto26.RestClient/Helpers/RequestException.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1b65a702f324c421481fd11a668883be +timeCreated: 1640509104 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Proyecto26.RestClient/Helpers/RequestHelper.cs.meta b/src/Proyecto26.RestClient/Helpers/RequestHelper.cs.meta new file mode 100644 index 0000000..1329fa2 --- /dev/null +++ b/src/Proyecto26.RestClient/Helpers/RequestHelper.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: cb1ce224301264c95a75e5d9c3e515e7 +timeCreated: 1640509104 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Proyecto26.RestClient/Helpers/RequestHelperExtension.cs b/src/Proyecto26.RestClient/Helpers/RequestHelperExtension.cs index 9c0ccf8..7017a74 100644 --- a/src/Proyecto26.RestClient/Helpers/RequestHelperExtension.cs +++ b/src/Proyecto26.RestClient/Helpers/RequestHelperExtension.cs @@ -1,4 +1,5 @@ -using UnityEngine.Networking; +using System; +using UnityEngine.Networking; namespace Proyecto26 { diff --git a/src/Proyecto26.RestClient/Helpers/RequestHelperExtension.cs.meta b/src/Proyecto26.RestClient/Helpers/RequestHelperExtension.cs.meta new file mode 100644 index 0000000..3c050e2 --- /dev/null +++ b/src/Proyecto26.RestClient/Helpers/RequestHelperExtension.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: af3ec85e82c4d41be8195a8bc75d16a3 +timeCreated: 1640509104 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Proyecto26.RestClient/Helpers/ResponseHelper.cs.meta b/src/Proyecto26.RestClient/Helpers/ResponseHelper.cs.meta new file mode 100644 index 0000000..15178a4 --- /dev/null +++ b/src/Proyecto26.RestClient/Helpers/ResponseHelper.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5303a46962f674f8893edf45bf73ec2f +timeCreated: 1640509104 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Proyecto26.RestClient/Helpers/StaticCoroutine.cs.meta b/src/Proyecto26.RestClient/Helpers/StaticCoroutine.cs.meta new file mode 100644 index 0000000..ed467f3 --- /dev/null +++ b/src/Proyecto26.RestClient/Helpers/StaticCoroutine.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9753d533c86bf42d383b547c5f2e4fc4 +timeCreated: 1640509104 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Proyecto26.RestClient/RestClient.cs b/src/Proyecto26.RestClient/RestClient.cs index 37eb32f..82b0da5 100644 --- a/src/Proyecto26.RestClient/RestClient.cs +++ b/src/Proyecto26.RestClient/RestClient.cs @@ -54,10 +54,10 @@ public static void ClearDefaultParams() DefaultRequestParams.Clear(); } + private static Dictionary _defaultRequestHeaders; /// /// Default headers. /// - private static Dictionary _defaultRequestHeaders; public static Dictionary DefaultRequestHeaders { get diff --git a/src/Proyecto26.RestClient/RestClient.cs.meta b/src/Proyecto26.RestClient/RestClient.cs.meta new file mode 100644 index 0000000..6b9e540 --- /dev/null +++ b/src/Proyecto26.RestClient/RestClient.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 94707c19b4d894fe999322dd4081f0d7 +timeCreated: 1640509104 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Proyecto26.RestClient/RestClientPromise.cs.meta b/src/Proyecto26.RestClient/RestClientPromise.cs.meta new file mode 100644 index 0000000..d410693 --- /dev/null +++ b/src/Proyecto26.RestClient/RestClientPromise.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c4261a75daa114e61a6a07fae6f1bcf9 +timeCreated: 1640509104 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Proyecto26.RestClient/package.json b/src/Proyecto26.RestClient/package.json index ef4205e..58f0840 100644 --- a/src/Proyecto26.RestClient/package.json +++ b/src/Proyecto26.RestClient/package.json @@ -36,9 +36,9 @@ }, "samples": [ { - "displayName": "Demo", - "description": "Demo for RestClient", - "path": "demo" + "displayName": "Sample", + "description": "RestClient Sample", + "path": "Sample" } ] } diff --git a/src/Proyecto26.RestClient/package.json.meta b/src/Proyecto26.RestClient/package.json.meta new file mode 100644 index 0000000..e2d594b --- /dev/null +++ b/src/Proyecto26.RestClient/package.json.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 22fa438a69d374388b979a7b4688b23a +timeCreated: 1640509106 +licenseType: Free +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: