diff --git a/CHANGELOG.md b/CHANGELOG.md index cc5dd0763..71b539df6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,39 @@ +# [5.9.0](https://github.com/ionic-team/ionic-native/compare/v5.8.0...v5.9.0) (2019-07-01) + + +### Bug Fixes + +* **alipay:** use correct pluginRef ([#3081](https://github.com/ionic-team/ionic-native/issues/3081)) ([92d5764](https://github.com/ionic-team/ionic-native/commit/92d5764)) +* **firebase:** add missing decorator to clearAllNotifications ([#3059](https://github.com/ionic-team/ionic-native/issues/3059)) ([2fadb6b](https://github.com/ionic-team/ionic-native/commit/2fadb6b)) +* **in-app-purchase-2:** add missing option to register function ([#3063](https://github.com/ionic-team/ionic-native/issues/3063)) ([1fc0909](https://github.com/ionic-team/ionic-native/commit/1fc0909)) + + +### Features + +* **calendar:** add deleteEventById function ([#3075](https://github.com/ionic-team/ionic-native/issues/3075)) ([5857b96](https://github.com/ionic-team/ionic-native/commit/5857b96)) +* **diagnostic:** add DENIED_ONCE introduced by diagnostic v5 ([#3071](https://github.com/ionic-team/ionic-native/issues/3071)) ([54ac2bf](https://github.com/ionic-team/ionic-native/commit/54ac2bf)) +* **sum-up:** add plugin ([#3080](https://github.com/ionic-team/ionic-native/issues/3080)) ([a4db080](https://github.com/ionic-team/ionic-native/commit/a4db080)) +* **unvired-cordova-sdk:** add plugin ([#3061](https://github.com/ionic-team/ionic-native/issues/3061)) ([9274083](https://github.com/ionic-team/ionic-native/commit/9274083)) + + + +# [5.8.0](https://github.com/ionic-team/ionic-native/compare/v5.7.0...v5.8.0) (2019-06-10) + + +### Bug Fixes + +* **music-control:** use correct input type ([#3054](https://github.com/ionic-team/ionic-native/issues/3054)) ([300d7c2](https://github.com/ionic-team/ionic-native/commit/300d7c2)) + + +### Features + +* **apple-wallet:** support plugin version 3.0 ([#3053](https://github.com/ionic-team/ionic-native/issues/3053)) ([43442ac](https://github.com/ionic-team/ionic-native/commit/43442ac)) +* **diagnostic:** add requestRemoteNotificationsAuthorization method ([#3051](https://github.com/ionic-team/ionic-native/issues/3051)) ([12f2782](https://github.com/ionic-team/ionic-native/commit/12f2782)), closes [#3050](https://github.com/ionic-team/ionic-native/issues/3050) [/github.com/dpa99c/cordova-diagnostic-plugin/blob/0fac4a59d1f246c872c05f513b09f0e9c93abb51/www/ios/diagnostic.notifications.js#L162](https://github.com//github.com/dpa99c/cordova-diagnostic-plugin/blob/0fac4a59d1f246c872c05f513b09f0e9c93abb51/www/ios/diagnostic.notifications.js/issues/L162) +* **in-app-purchase-2:** add documentation ([#3055](https://github.com/ionic-team/ionic-native/issues/3055)) ([ed80933](https://github.com/ionic-team/ionic-native/commit/ed80933)) +* **sms-retriever:** add plugin ([#3052](https://github.com/ionic-team/ionic-native/issues/3052)) ([6cbb226](https://github.com/ionic-team/ionic-native/commit/6cbb226)) + + + # [5.7.0](https://github.com/ionic-team/ionic-native/compare/v5.6.1...v5.7.0) (2019-06-03) @@ -86,18 +122,21 @@ ### Features -* updating device account wrapper with maintained fork with android 8.0 compatibility ([354af9f](https://github.com/ionic-team/ionic-native/commit/354af9f)) * **google-play-games-services:** add getPlayerScore function ([#2949](https://github.com/ionic-team/ionic-native/issues/2949)) ([767d3b3](https://github.com/ionic-team/ionic-native/commit/767d3b3)) * **in-app-purchase-2:** add manageSubscriptions() ([#2980](https://github.com/ionic-team/ionic-native/issues/2980)) ([f874185](https://github.com/ionic-team/ionic-native/commit/f874185)) * **in-app-purchase-2:** add missing property ([#2961](https://github.com/ionic-team/ionic-native/issues/2961)) ([029f82f](https://github.com/ionic-team/ionic-native/commit/029f82f)) * **nativegeocoder:** update plugin to v3.2.0 ([#2958](https://github.com/ionic-team/ionic-native/issues/2958)) ([4de49c3](https://github.com/ionic-team/ionic-native/commit/4de49c3)) * **purchases:** add new plugin for purchases ([#2940](https://github.com/ionic-team/ionic-native/issues/2940)) ([39be275](https://github.com/ionic-team/ionic-native/commit/39be275)) +* updating device account wrapper with maintained fork with android 8.0 compatibility ([354af9f](https://github.com/ionic-team/ionic-native/commit/354af9f)) # [5.3.0](https://github.com/ionic-team/ionic-native/compare/v5.2.0...v5.3.0) (2019-03-19) +* Revert "refactor(template): update Inject decorator" ([d827db2](https://github.com/ionic-team/ionic-native/commit/d827db2)) + + ### Bug Fixes * **scripts:** check for TypeDoc tags when selecting plugin class ([#2963](https://github.com/ionic-team/ionic-native/issues/2963)) ([06654af](https://github.com/ionic-team/ionic-native/commit/06654af)) @@ -113,9 +152,6 @@ * **scripts:** add docs-json script ([#2947](https://github.com/ionic-team/ionic-native/issues/2947)) ([b0dea6d](https://github.com/ionic-team/ionic-native/commit/b0dea6d)) -* Revert "refactor(template): update Inject decorator" ([d827db2](https://github.com/ionic-team/ionic-native/commit/d827db2)) - - ### BREAKING CHANGES * This reverts commit c5ae6362d7771b62ae35a6b8ddc6e866aa9964a9. @@ -199,14 +235,14 @@ ### Features -* add analytics-firebase plugin ([e374b52](https://github.com/ionic-team/ionic-native/commit/e374b52)) * **adjust:** add adjust sdk plugin ([#2872](https://github.com/ionic-team/ionic-native/issues/2872)) ([9e6705d](https://github.com/ionic-team/ionic-native/commit/9e6705d)) * **admob:** add plugin ([#2864](https://github.com/ionic-team/ionic-native/issues/2864)) ([707ce1c](https://github.com/ionic-team/ionic-native/commit/707ce1c)) * **analytics-firebase:** add plugin ([#2862](https://github.com/ionic-team/ionic-native/issues/2862)) ([5df3de7](https://github.com/ionic-team/ionic-native/commit/5df3de7)) * **audio-management:** add plugin for audio streams ([#2877](https://github.com/ionic-team/ionic-native/issues/2877)) ([34ecd29](https://github.com/ionic-team/ionic-native/commit/34ecd29)) * **baidu-push:** add plugin ([#2838](https://github.com/ionic-team/ionic-native/issues/2838)) ([c3de8df](https://github.com/ionic-team/ionic-native/commit/c3de8df)) -* **blinkid:** add plugin ([#2833](https://github.com/ionic-team/ionic-native/issues/2833)) ([8e405cc](https://github.com/ionic-team/ionic-native/commit/8e405cc)) * **firebase:** add clearAllNotifications method ([#2867](https://github.com/ionic-team/ionic-native/issues/2867)) ([7c46d8c](https://github.com/ionic-team/ionic-native/commit/7c46d8c)) +* add analytics-firebase plugin ([e374b52](https://github.com/ionic-team/ionic-native/commit/e374b52)) +* **blinkid:** add plugin ([#2833](https://github.com/ionic-team/ionic-native/issues/2833)) ([8e405cc](https://github.com/ionic-team/ionic-native/commit/8e405cc)) * **gao-de-location:** add plugin ([#2857](https://github.com/ionic-team/ionic-native/issues/2857)) ([e2b25de](https://github.com/ionic-team/ionic-native/commit/e2b25de)) * **in-app-browser:** add 'beforeload' as option ([#2863](https://github.com/ionic-team/ionic-native/issues/2863)) ([d33bcb0](https://github.com/ionic-team/ionic-native/commit/d33bcb0)) @@ -530,10 +566,6 @@ ### Bug Fixes -* build errors ([f70eaea](https://github.com/ionic-team/ionic-native/commit/f70eaea)) -* fix lint ([b36a1f9](https://github.com/ionic-team/ionic-native/commit/b36a1f9)) -* fix more lint errors ([0b3d299](https://github.com/ionic-team/ionic-native/commit/0b3d299)) -* fix rxjs 6 imports ([e0b0687](https://github.com/ionic-team/ionic-native/commit/e0b0687)) * **android-fingerprint-auth:** ensure ERRORS array is defined ([#2508](https://github.com/ionic-team/ionic-native/issues/2508)) ([714114d](https://github.com/ionic-team/ionic-native/commit/714114d)) * **background-geolocation:** watchLocationMode returns observable ([#2547](https://github.com/ionic-team/ionic-native/issues/2547)) ([3f8a6f2](https://github.com/ionic-team/ionic-native/commit/3f8a6f2)) * **calendar:** Fixes createCalendar parameter typing ([84e0aa1](https://github.com/ionic-team/ionic-native/commit/84e0aa1)) @@ -542,7 +574,6 @@ * **ibeacon:** correct Type {Region} in some params ([#2453](https://github.com/ionic-team/ionic-native/issues/2453)) ([300db62](https://github.com/ionic-team/ionic-native/commit/300db62)) * **in-app-purchase-2:** fix ready method signature ([#2043](https://github.com/ionic-team/ionic-native/issues/2043)) ([a018381](https://github.com/ionic-team/ionic-native/commit/a018381)) * **linting:** Fixing misc linting errors that typedoc complains about ([#2476](https://github.com/ionic-team/ionic-native/issues/2476)) ([d3c2859](https://github.com/ionic-team/ionic-native/commit/d3c2859)) -* fix tealium jsdoc ([f34b6e6](https://github.com/ionic-team/ionic-native/commit/f34b6e6)) * **native-geocoder:** set response type to an array ([#2505](https://github.com/ionic-team/ionic-native/issues/2505)) ([defb276](https://github.com/ionic-team/ionic-native/commit/defb276)) * **onesignal:** make params optional ([#2507](https://github.com/ionic-team/ionic-native/issues/2507)) ([e6db281](https://github.com/ionic-team/ionic-native/commit/e6db281)) * **onesignal:** update OSPermissionState interface ([#2561](https://github.com/ionic-team/ionic-native/issues/2561)) ([fc088f8](https://github.com/ionic-team/ionic-native/commit/fc088f8)) @@ -551,6 +582,11 @@ * **stripe:** fixed casing of postal code param ([#2520](https://github.com/ionic-team/ionic-native/issues/2520)) ([d6a9ed1](https://github.com/ionic-team/ionic-native/commit/d6a9ed1)) * **themeable-browser:** allow hidden and clear cache ([a4cc7f7](https://github.com/ionic-team/ionic-native/commit/a4cc7f7)) * **v5-builder:** stop transforming "declare" classes ([#2503](https://github.com/ionic-team/ionic-native/issues/2503)) ([6662234](https://github.com/ionic-team/ionic-native/commit/6662234)) +* build errors ([f70eaea](https://github.com/ionic-team/ionic-native/commit/f70eaea)) +* fix lint ([b36a1f9](https://github.com/ionic-team/ionic-native/commit/b36a1f9)) +* fix more lint errors ([0b3d299](https://github.com/ionic-team/ionic-native/commit/0b3d299)) +* fix rxjs 6 imports ([e0b0687](https://github.com/ionic-team/ionic-native/commit/e0b0687)) +* fix tealium jsdoc ([f34b6e6](https://github.com/ionic-team/ionic-native/commit/f34b6e6)) * **web-intent:** fix options param ([#2450](https://github.com/ionic-team/ionic-native/issues/2450)) ([23b760b](https://github.com/ionic-team/ionic-native/commit/23b760b)) * **web-intent:** registerBroadcastReceiver as Observable ([#2491](https://github.com/ionic-team/ionic-native/issues/2491)) ([47f7397](https://github.com/ionic-team/ionic-native/commit/47f7397)) @@ -639,9 +675,9 @@ * **one-signal:** add clearOneSignalNotifications function ([fc0338a](https://github.com/ionic-team/ionic-native/commit/fc0338a)) * **plugin:** Add google nearby plugin ([eb1bcdd](https://github.com/ionic-team/ionic-native/commit/eb1bcdd)) * **plugin:** add iOS File Picker ([571df3a](https://github.com/ionic-team/ionic-native/commit/571df3a)) +* **plugin:** add Microdoft App Center Analytics plugin ([b65946b](https://github.com/ionic-team/ionic-native/commit/b65946b)) * **plugin:** add Microdoft App Center Analytics plugin ([7a5bee9](https://github.com/ionic-team/ionic-native/commit/7a5bee9)) * **plugin:** add Microdoft App Center Analytics plugin ([84c9bfb](https://github.com/ionic-team/ionic-native/commit/84c9bfb)) -* **plugin:** add Microdoft App Center Analytics plugin ([b65946b](https://github.com/ionic-team/ionic-native/commit/b65946b)) * **plugin:** add Microsoft App Center Crashes plugin ([44e0e24](https://github.com/ionic-team/ionic-native/commit/44e0e24)) * **plugin:** add Microsoft App Center Push plugin ([cdabebd](https://github.com/ionic-team/ionic-native/commit/cdabebd)) * **plugin:** add OpenALPR plugin ([e27fbf4](https://github.com/ionic-team/ionic-native/commit/e27fbf4)) @@ -1163,8 +1199,8 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil ### Features -* **keychain:** add Keychain plugin ([#1420](https://github.com/ionic-team/ionic-native/issues/1420)) ([16dc71a](https://github.com/ionic-team/ionic-native/commit/16dc71a)) * add IonicNativePlugin base class ([#1425](https://github.com/ionic-team/ionic-native/issues/1425)) ([17366a2](https://github.com/ionic-team/ionic-native/commit/17366a2)) +* **keychain:** add Keychain plugin ([#1420](https://github.com/ionic-team/ionic-native/issues/1420)) ([16dc71a](https://github.com/ionic-team/ionic-native/commit/16dc71a)) @@ -1533,12 +1569,12 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil ### Bug Fixes -* add clearAllNotifications() ([8c021bc](https://github.com/ionic-team/ionic-native/commit/8c021bc)) * **battery-status:** add missing pluginRef ([3da0efe](https://github.com/ionic-team/ionic-native/commit/3da0efe)) * **core:** fix exception in CordovaProperty ([#998](https://github.com/ionic-team/ionic-native/issues/998)) ([cb29363](https://github.com/ionic-team/ionic-native/commit/cb29363)), closes [#992](https://github.com/ionic-team/ionic-native/issues/992) * **core:** fix plugin check ([da7a370](https://github.com/ionic-team/ionic-native/commit/da7a370)) * **googlemaps:** fix GoogleMapsLaLngBounds ([c3127d3](https://github.com/ionic-team/ionic-native/commit/c3127d3)), closes [#972](https://github.com/ionic-team/ionic-native/issues/972) * **plugin:** adds subscribe() and unsubscribe() ([94025a7](https://github.com/ionic-team/ionic-native/commit/94025a7)) +* add clearAllNotifications() ([8c021bc](https://github.com/ionic-team/ionic-native/commit/8c021bc)) ### Features @@ -1696,8 +1732,8 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil ### Bug Fixes -* add return ([3fdc4a8](https://github.com/ionic-team/ionic-native/commit/3fdc4a8)) * **card-io:** fix typo in options ([e6700a3](https://github.com/ionic-team/ionic-native/commit/e6700a3)) +* add return ([3fdc4a8](https://github.com/ionic-team/ionic-native/commit/3fdc4a8)) * **globalization:** add missing parameter to numberToString function ([1072ab1](https://github.com/ionic-team/ionic-native/commit/1072ab1)), closes [#835](https://github.com/ionic-team/ionic-native/issues/835) * **headercolor:** solve typo in usage and chore ([bab2971](https://github.com/ionic-team/ionic-native/commit/bab2971)) @@ -1950,6 +1986,7 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil ### Bug Fixes +* remove CanvasCamera plugin ([c75f898](https://github.com/ionic-team/ionic-native/commit/c75f898)) * **base64togallery:** fixes callbacks ([#513](https://github.com/ionic-team/ionic-native/issues/513)) ([1db1374](https://github.com/ionic-team/ionic-native/commit/1db1374)) * **diagnostic:** Add DENIED_ALWAYS to permissionStatus, also some code formatting ([9d573a9](https://github.com/ionic-team/ionic-native/commit/9d573a9)) * **diagnostic:** Fix diagnostic objects ([cb176aa](https://github.com/ionic-team/ionic-native/commit/cb176aa)) @@ -1963,7 +2000,6 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil * **mixpanel:** Make eventProperties optional ([#501](https://github.com/ionic-team/ionic-native/issues/501)) ([51364f8](https://github.com/ionic-team/ionic-native/commit/51364f8)) * **ng1:** fail gracefully when angular 1 promises can't be retrieved ([d135dc2](https://github.com/ionic-team/ionic-native/commit/d135dc2)) * **ng1:** grab injector from app. [#451](https://github.com/ionic-team/ionic-native/issues/451) ([2dc68a4](https://github.com/ionic-team/ionic-native/commit/2dc68a4)) -* remove CanvasCamera plugin ([c75f898](https://github.com/ionic-team/ionic-native/commit/c75f898)) * **social-sharing:** shareViaEmail now resolves/rejects when not providing optional args ([c76de34](https://github.com/ionic-team/ionic-native/commit/c76de34)) * **social-sharing:** various fixes ([#520](https://github.com/ionic-team/ionic-native/issues/520)) ([4f97164](https://github.com/ionic-team/ionic-native/commit/4f97164)) @@ -2040,11 +2076,11 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil ### Bug Fixes -* add the reject function at the expected errorIndex position in the args array ([#436](https://github.com/ionic-team/ionic-native/issues/436)) ([4e87ac7](https://github.com/ionic-team/ionic-native/commit/4e87ac7)) * **camera-preview:** changes implementation to match Cordova plugin ([#441](https://github.com/ionic-team/ionic-native/issues/441)) ([55ba65a](https://github.com/ionic-team/ionic-native/commit/55ba65a)) * **file:** fixes exclusive option ([#459](https://github.com/ionic-team/ionic-native/issues/459)) ([14e41a3](https://github.com/ionic-team/ionic-native/commit/14e41a3)) * **file:** initialize writeFile options ([#468](https://github.com/ionic-team/ionic-native/issues/468)) ([16628a4](https://github.com/ionic-team/ionic-native/commit/16628a4)) * **nativeaudio:** fix plugin reference ([2510c5f](https://github.com/ionic-team/ionic-native/commit/2510c5f)) +* add the reject function at the expected errorIndex position in the args array ([#436](https://github.com/ionic-team/ionic-native/issues/436)) ([4e87ac7](https://github.com/ionic-team/ionic-native/commit/4e87ac7)) ### Features @@ -2243,12 +2279,12 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil ### Bug Fixes -* remove unnecessary decorator ([#257](https://github.com/ionic-team/ionic-native/issues/257)) ([25fab64](https://github.com/ionic-team/ionic-native/commit/25fab64)) * **actionsheet:** add missing optional parameter for hide function ([#262](https://github.com/ionic-team/ionic-native/issues/262)) ([644e999](https://github.com/ionic-team/ionic-native/commit/644e999)) * **background-geolocation:** fix pluginref again ([b8a5133](https://github.com/ionic-team/ionic-native/commit/b8a5133)) * **geolocation:** fix plugin reference ([4f0cd24](https://github.com/ionic-team/ionic-native/commit/4f0cd24)), closes [#258](https://github.com/ionic-team/ionic-native/issues/258) * **googlemaps:** use correct methods for addGroundOverlay and addKmlOverlay ([#268](https://github.com/ionic-team/ionic-native/issues/268)) ([b8be1de](https://github.com/ionic-team/ionic-native/commit/b8be1de)) * **socialsharing:** all methods return Promises now ([e150224](https://github.com/ionic-team/ionic-native/commit/e150224)), closes [#275](https://github.com/ionic-team/ionic-native/issues/275) +* remove unnecessary decorator ([#257](https://github.com/ionic-team/ionic-native/issues/257)) ([25fab64](https://github.com/ionic-team/ionic-native/commit/25fab64)) ### Features @@ -2384,8 +2420,8 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil * **datepicker:** datepicker options are optional ([c3cfd14](https://github.com/ionic-team/ionic-native/commit/c3cfd14)) * **datepicker:** dates are Dates ([ce6adcc](https://github.com/ionic-team/ionic-native/commit/ce6adcc)) -* **datepicker:** fix plugin functionality ([91de971](https://github.com/ionic-team/ionic-native/commit/91de971)) * **datepicker:** fix plugin functionality ([1a778e7](https://github.com/ionic-team/ionic-native/commit/1a778e7)) +* **datepicker:** fix plugin functionality ([91de971](https://github.com/ionic-team/ionic-native/commit/91de971)) * **devicemotion:** combine watch and clear into one function ([d17f62d](https://github.com/ionic-team/ionic-native/commit/d17f62d)) * **geolocation:** set callback order to reverse on getCurrentPosition ([1fac387](https://github.com/ionic-team/ionic-native/commit/1fac387)) * **imagepicker:** pluginRef ([01d7972](https://github.com/ionic-team/ionic-native/commit/01d7972)) @@ -2443,18 +2479,15 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil ### Bug Fixes +* datepicker plugin, pluginref, and @Cordova wrapper ([499ead3](https://github.com/ionic-team/ionic-native/commit/499ead3)) * **calendar:** make getCalendarOptions sync ([78c5408](https://github.com/ionic-team/ionic-native/commit/78c5408)) * **geolocation:** call correct clearFunction ([9e86a40](https://github.com/ionic-team/ionic-native/commit/9e86a40)) * **plugin:** return originalMethod return value ([240f0f8](https://github.com/ionic-team/ionic-native/commit/240f0f8)) * **plugin:** use call for id based clearFunction ([c2fdf39](https://github.com/ionic-team/ionic-native/commit/c2fdf39)) -* datepicker plugin, pluginref, and @Cordova wrapper ([499ead3](https://github.com/ionic-team/ionic-native/commit/499ead3)) ### Features -* **DatePicker:** Added DatePicker ([5afa58f](https://github.com/ionic-team/ionic-native/commit/5afa58f)) -* **plugin:** add sync option to @Cordova for sync functions ([17e3827](https://github.com/ionic-team/ionic-native/commit/17e3827)) -* **plugin:** call clearFunction with original fn args ([8f27fc9](https://github.com/ionic-team/ionic-native/commit/8f27fc9)) * add app version plugin ([20cb01f](https://github.com/ionic-team/ionic-native/commit/20cb01f)) * add app version plugin ([8b78521](https://github.com/ionic-team/ionic-native/commit/8b78521)) * add apprate ([0dd4fec](https://github.com/ionic-team/ionic-native/commit/0dd4fec)) @@ -2462,6 +2495,9 @@ renamed to `FileTransfer`. Also, `TransferObject` class has been renamed to `Fil * add badge plugin ([3088df4](https://github.com/ionic-team/ionic-native/commit/3088df4)) * add clipboard plugin ([0b6cca7](https://github.com/ionic-team/ionic-native/commit/0b6cca7)) * add clipboard plugin ([fa4c266](https://github.com/ionic-team/ionic-native/commit/fa4c266)) +* **DatePicker:** Added DatePicker ([5afa58f](https://github.com/ionic-team/ionic-native/commit/5afa58f)) +* **plugin:** add sync option to @Cordova for sync functions ([17e3827](https://github.com/ionic-team/ionic-native/commit/17e3827)) +* **plugin:** call clearFunction with original fn args ([8f27fc9](https://github.com/ionic-team/ionic-native/commit/8f27fc9)) diff --git a/package-lock.json b/package-lock.json index 31373e77f..d2ceb6b59 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ionic-native", - "version": "5.7.0", + "version": "5.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2232,9 +2232,9 @@ } }, "@types/jest": { - "version": "24.0.13", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.13.tgz", - "integrity": "sha512-3m6RPnO35r7Dg+uMLj1+xfZaOgIHHHut61djNjzwExXN4/Pm9has9C6I1KMYSfz7mahDhWUOVg4HW/nZdv5Pww==", + "version": "24.0.15", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.15.tgz", + "integrity": "sha512-MU1HIvWUme74stAoc3mgAi+aMlgKOudgEvQDIm1v4RkrDudBh1T+NFp5sftpBAdXdx1J0PbdpJ+M2EsSOi1djA==", "dev": true, "requires": { "@types/jest-diff": "*" @@ -2247,9 +2247,9 @@ "dev": true }, "@types/lodash": { - "version": "4.14.134", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.134.tgz", - "integrity": "sha512-2/O0khFUCFeDlbi7sZ7ZFRCcT812fAeOLm7Ev4KbwASkZ575TDrDcY7YyaoHdTOzKcNbfiwLYZqPmoC4wadrsw==", + "version": "4.14.135", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.135.tgz", + "integrity": "sha512-Ed+tSZ9qM1oYpi5kzdsBuOzcAIn1wDW+e8TFJ50IMJMlSopGdJgKAbhHzN6h1E1OfjlGOr2JepzEWtg9NIfoNg==", "dev": true }, "@types/marked": { @@ -2265,9 +2265,9 @@ "dev": true }, "@types/node": { - "version": "10.14.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.8.tgz", - "integrity": "sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw==", + "version": "10.14.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.10.tgz", + "integrity": "sha512-V8wj+w2YMNvGuhgl/MA5fmTxgjmVHVoasfIaxMMZJV6Y8Kk+Ydpi1z2whoShDCJ2BuNVoqH/h1hrygnBxkrw/Q==", "dev": true }, "@types/rimraf": { @@ -2312,9 +2312,9 @@ } }, "@types/webpack": { - "version": "4.4.32", - "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.4.32.tgz", - "integrity": "sha512-mNARoaSJTzbiHxtZbf9NULFilu2frqD+g9Iyl9V2jPYJWXi+AC3Hz8lQWPZ5LLtgUm7iF4SDDMB/1bPrbRQgFw==", + "version": "4.4.34", + "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.4.34.tgz", + "integrity": "sha512-GnEBgjHsfO1M7DIQ0dAupSofcmDItE3Zsu3reK8SQpl/6N0rtUQxUmQzVFAS5ou/FGjsYKjXAWfItLZ0kNFTfQ==", "dev": true, "requires": { "@types/anymatch": "*", @@ -4512,9 +4512,9 @@ } }, "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", + "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==", "dev": true }, "diff-sequences": { @@ -4709,9 +4709,9 @@ "dev": true }, "elliptic": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", - "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.0.tgz", + "integrity": "sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg==", "dev": true, "requires": { "bn.js": "^4.4.0", @@ -5279,14 +5279,22 @@ "dev": true }, "fs-extra": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.0.1.tgz", - "integrity": "sha512-W+XLrggcDzlle47X/XnS7FXrXu9sDo+Ze9zpndeBxdgv88FHLm1HtmkhEwavruS6koanBjp098rUpHs65EmG7A==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "dev": true, "requires": { - "graceful-fs": "^4.1.2", + "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", "universalify": "^0.1.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.0.tgz", + "integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg==", + "dev": true + } } }, "fs-write-stream-atomic": { @@ -7273,12 +7281,6 @@ "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", "dev": true }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", - "dev": true - }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -11478,9 +11480,9 @@ "dev": true }, "node-libs-browser": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.0.tgz", - "integrity": "sha512-5MQunG/oyOaBdttrL40dA7bUfPORLRWMUJLQtMg7nluxUvk5XwnLdL9twQHFAjRx/y7mIMkLKT9++qPbbk6BZA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", + "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", "dev": true, "requires": { "assert": "^1.1.1", @@ -11493,7 +11495,7 @@ "events": "^3.0.0", "https-browserify": "^1.0.0", "os-browserify": "^0.3.0", - "path-browserify": "0.0.0", + "path-browserify": "0.0.1", "process": "^0.11.10", "punycode": "^1.2.4", "querystring-es3": "^0.2.0", @@ -11505,7 +11507,7 @@ "tty-browserify": "0.0.0", "url": "^0.11.0", "util": "^0.11.0", - "vm-browserify": "0.0.4" + "vm-browserify": "^1.0.1" }, "dependencies": { "punycode": { @@ -12045,9 +12047,9 @@ "dev": true }, "path-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", - "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", "dev": true }, "path-case": { @@ -13769,9 +13771,9 @@ }, "dependencies": { "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, "readable-stream": { @@ -13925,9 +13927,9 @@ } }, "terser": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.0.0.tgz", - "integrity": "sha512-dOapGTU0hETFl1tCo4t56FN+2jffoKyER9qBGoUFyZ6y7WLoKT0bF+lAYi6B6YsILcGF3q1C2FBh8QcKSCgkgA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.0.2.tgz", + "integrity": "sha512-IWLuJqTvx97KP3uTYkFVn93cXO+EtlzJu8TdJylq+H0VBDlPMIfQA9MBS5Vc5t3xTEUG1q0hIfHMpAP2R+gWTw==", "dev": true, "requires": { "commander": "^2.19.0", @@ -14300,9 +14302,9 @@ } }, "ts-node": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.2.0.tgz", - "integrity": "sha512-m8XQwUurkbYqXrKqr3WHCW310utRNvV5OnRVeISeea7LoCWVcdfeB/Ntl8JYWFh+WRoUAdBgESrzKochQt7sMw==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.3.0.tgz", + "integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==", "dev": true, "requires": { "arg": "^4.1.0", @@ -14310,14 +14312,6 @@ "make-error": "^1.1.1", "source-map-support": "^0.5.6", "yn": "^3.0.0" - }, - "dependencies": { - "diff": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", - "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==", - "dev": true - } } }, "tslib": { @@ -14327,9 +14321,9 @@ "dev": true }, "tslint": { - "version": "5.17.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.17.0.tgz", - "integrity": "sha512-pflx87WfVoYepTet3xLfDOLDm9Jqi61UXIKePOuca0qoAZyrGWonDG9VTbji58Fy+8gciUn8Bt7y69+KEVjc/w==", + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.18.0.tgz", + "integrity": "sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -14367,6 +14361,12 @@ "supports-color": "^5.3.0" } }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -14963,13 +14963,10 @@ } }, "vm-browserify": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", - "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", - "dev": true, - "requires": { - "indexof": "0.0.1" - } + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", + "integrity": "sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw==", + "dev": true }, "w3c-hr-time": { "version": "1.0.1", @@ -15932,9 +15929,9 @@ "dev": true }, "webpack": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.33.0.tgz", - "integrity": "sha512-ggWMb0B2QUuYso6FPZKUohOgfm+Z0sVFs8WwWuSH1IAvkWs428VDNmOlAxvHGTB9Dm/qOB/qtE5cRx5y01clxw==", + "version": "4.35.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.35.2.tgz", + "integrity": "sha512-TZAmorNymV4q66gAM/h90cEjG+N3627Q2MnkSgKlX/z3DlNVKUtqy57lz1WmZU2+FUZwzM+qm7cGaO95PyrX5A==", "dev": true, "requires": { "@webassemblyjs/ast": "1.8.5", diff --git a/package.json b/package.json index af1308a80..a393386d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ionic-native", - "version": "5.7.0", + "version": "5.9.0", "description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support", "homepage": "https://ionicframework.com/", "author": "Ionic Team (https://ionic.io)", @@ -29,18 +29,18 @@ "@angular/core": "^7.2.15", "@types/cordova": "0.0.34", "@types/fs-extra": "^7.0.0", - "@types/jest": "^24.0.13", - "@types/lodash": "^4.14.134", - "@types/node": "^10.14.8", + "@types/jest": "^24.0.15", + "@types/lodash": "^4.14.135", + "@types/node": "^10.14.10", "@types/rimraf": "^2.0.2", - "@types/webpack": "^4.4.32", + "@types/webpack": "^4.4.34", "ajv": "^6.10.0", "async-promise-queue": "^1.0.5", "conventional-changelog-cli": "^2.0.21", "cz-conventional-changelog": "^2.1.0", "dgeni": "^0.4.12", "dgeni-packages": "0.16.10", - "fs-extra": "^8.0.1", + "fs-extra": "^8.1.0", "gulp": "3.9.1", "gulp-rename": "^1.4.0", "gulp-replace": "^1.0.0", @@ -52,14 +52,14 @@ "rimraf": "^2.6.3", "rxjs": "^6.5.2", "ts-jest": "^24.0.2", - "ts-node": "^8.2.0", - "tslint": "^5.17.0", + "ts-node": "^8.3.0", + "tslint": "^5.18.0", "tslint-ionic-rules": "0.0.21", "typedoc": "^0.14.2", "typescript": "3.2.4", "uglifyjs-webpack-plugin": "^2.1.3", "unminified-webpack-plugin": "^2.0.0", - "webpack": "^4.33.0", + "webpack": "^4.35.2", "winston": "^3.2.1", "zone.js": "^0.8.29" }, diff --git a/scripts/docs-json/index.ts b/scripts/docs-json/index.ts index decb3b6c7..8af0fc98a 100644 --- a/scripts/docs-json/index.ts +++ b/scripts/docs-json/index.ts @@ -10,6 +10,7 @@ interface Plugin { platforms: string[]; usage: string; repo: string; + installVariables: string[]; cordovaPlugin: { name: string; }; @@ -56,6 +57,7 @@ function processPlugin(pluginModule): Plugin { usage, platforms: decorator.platforms, repo: decorator.repo, + installVariables: decorator.installVariables, cordovaPlugin: { name: decorator.plugin } diff --git a/scripts/tasks/publish.ts b/scripts/tasks/publish.ts index 620ff6928..898394988 100644 --- a/scripts/tasks/publish.ts +++ b/scripts/tasks/publish.ts @@ -30,7 +30,7 @@ const DIST = path.resolve(ROOT, 'dist/@ionic-native'); const PACKAGES = []; const MIN_CORE_VERSION = '^5.1.0'; -const RXJS_VERSION = '^6.5.0'; +const RXJS_VERSION = '^5.5.0 || ^6.5.0'; const PLUGIN_PEER_DEPENDENCIES = { '@ionic-native/core': MIN_CORE_VERSION, diff --git a/src/@ionic-native/plugins/alipay/index.ts b/src/@ionic-native/plugins/alipay/index.ts index fd4464bfa..5f8d24e3e 100644 --- a/src/@ionic-native/plugins/alipay/index.ts +++ b/src/@ionic-native/plugins/alipay/index.ts @@ -30,7 +30,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; @Plugin({ pluginName: 'Alipay', plugin: 'cordova-plugin-gubnoi-alipay', - pluginRef: 'Alipay', + pluginRef: 'cordova.plugins.alipay', repo: 'https://github.com/jing-zhou/cordova-plugin-alipay', install: 'ionic cordova plugin add cordova-plugin-gubnoi-alipay --variable APP_ID=your_app_id', installVariables: ['APP_ID'], diff --git a/src/@ionic-native/plugins/calendar/index.ts b/src/@ionic-native/plugins/calendar/index.ts index 7d055db3c..9186ab133 100644 --- a/src/@ionic-native/plugins/calendar/index.ts +++ b/src/@ionic-native/plugins/calendar/index.ts @@ -475,6 +475,21 @@ export class Calendar extends IonicNativePlugin { return; } + /** + * Delete an event by id. + * + * @param {string} [id] The event id + * @param {Date} [fromDate] The date where it start deleting from + * @return Returns a Promise + */ + @Cordova() + deleteEventById( + id: string, + fromDate?: Date + ): Promise { + return; + } + /** * Open the calendar at the specified date. * @param {Date} date The date you want to open the calendar on diff --git a/src/@ionic-native/plugins/couchbase-lite/index.ts b/src/@ionic-native/plugins/couchbase-lite/index.ts index fd196acea..589b378e8 100644 --- a/src/@ionic-native/plugins/couchbase-lite/index.ts +++ b/src/@ionic-native/plugins/couchbase-lite/index.ts @@ -4,7 +4,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; /** * @name Couchbase Lite * @description - * Plugin to install Couchbase Lite in your PhoneGap app on iOS or Android + * Plugin to install Couchbase Lite in your PhoneGap app on iOS or Android This Plugin is no longer supported by Couchbase. Please see our Couchbase Lite Integration * * @usage * ```typescript diff --git a/src/@ionic-native/plugins/diagnostic/index.ts b/src/@ionic-native/plugins/diagnostic/index.ts index 99d708625..acae41b6f 100644 --- a/src/@ionic-native/plugins/diagnostic/index.ts +++ b/src/@ionic-native/plugins/diagnostic/index.ts @@ -73,7 +73,11 @@ export class Diagnostic extends IonicNativePlugin { @CordovaProperty() permissionStatus: { GRANTED: string; + /** + * @deprecated cordova.plugins.diagnostic@5.0.0 uses DENIED_ONCE to unify DENIED* statuses across iOS/Android + */ DENIED: string; + DENIED_ONCE: string; NOT_REQUESTED: string; DENIED_ALWAYS: string; RESTRICTED: string; diff --git a/src/@ionic-native/plugins/firebase/index.ts b/src/@ionic-native/plugins/firebase/index.ts index 0cd280b17..c2d9f6c7c 100644 --- a/src/@ionic-native/plugins/firebase/index.ts +++ b/src/@ionic-native/plugins/firebase/index.ts @@ -343,6 +343,9 @@ export class Firebase extends IonicNativePlugin { * Clear all pending notifications from the drawer * @return {Promise} */ + @Cordova({ + platforms: ['Android'] + }) clearAllNotifications(): Promise { return; } diff --git a/src/@ionic-native/plugins/in-app-purchase-2/index.ts b/src/@ionic-native/plugins/in-app-purchase-2/index.ts index 637954722..dbc198cf4 100644 --- a/src/@ionic-native/plugins/in-app-purchase-2/index.ts +++ b/src/@ionic-native/plugins/in-app-purchase-2/index.ts @@ -761,7 +761,7 @@ export class InAppPurchase2 extends IonicNativePlugin { * @param product {IAPProductOptions} */ @Cordova({ sync: true }) - register(product: IAPProductOptions): void {} + register(product: IAPProductOptions | IAPProductOptions[]): void {} /** * diff --git a/src/@ionic-native/plugins/launch-review/index.ts b/src/@ionic-native/plugins/launch-review/index.ts index 26da7dcad..b76c48d7d 100644 --- a/src/@ionic-native/plugins/launch-review/index.ts +++ b/src/@ionic-native/plugins/launch-review/index.ts @@ -18,7 +18,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; * ... * * this.launchReview.launch() - * .then(() => console.log('Successfully launched store app'); + * .then(() => console.log('Successfully launched store app')); * * if(this.launchReview.isRatingSupported()){ * this.launchReview.rating() diff --git a/src/@ionic-native/plugins/sum-up/index.ts b/src/@ionic-native/plugins/sum-up/index.ts new file mode 100644 index 000000000..7e3e5954a --- /dev/null +++ b/src/@ionic-native/plugins/sum-up/index.ts @@ -0,0 +1,192 @@ +import { Injectable } from '@angular/core'; +import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; + +export interface SumUpResponse { + // Code to identify the message + code: number; + + // Message for readable usage + message: string; +} + +export interface SumUpLoginStatus { + // Code, to check if an error occured + code: number; + + // Booleand value whether the user is logged in or not + isLoggedIn: boolean; +} + +export interface SumUpPayment { + // Unique transaction code + transaction_code: string; + + // Card type -> like MAESTRO + card_type: string; + + // Merchant code for identification + merchant_code: string; + + // Amount of the payment + amount: number; + + // Tip amount -> default 0 + tip_amount: number; + + // Vat amount -> default 0 + vat_amount: number; + + // Currency code -> like EUR + currency: string; + + // Payment status -> successful or error + status: string; + + // Type -> Card or nfc + payment_type: string; + + // Entry mode -> Like chip or contactless + entry_mode: string; + + // Number of installments -> default 1 + installments: number; +} + +/** + * @name SumUp + * @description + * Plugin to communicate with a SumUp payment terminal + * + * @usage + * ```typescript + * import { SumUp } from '@ionic-native/sum-up'; + * + * + * constructor(private sumUp: SumUp) { } + * + * this.sumUp.login("ACCESS_TOKEN") + * .then((res: SumUpResponse) => console.log(res)) + * .catch((error: SumUpResponse) => console.error(error)); + * + * this.sumUp.auth("ACCESS_TOKEN") + * .then((res: SumUpResponse) => console.log(res)) + * .catch((error: SumUpResponse) => console.error(error)); + * + * this.sumUp.getSettings() + * .then((res: SumUpResponse) => console.log(res)) + * .catch((error: SumUpResponse) => console.error(error)); + * + * this.sumUp.logout() + * .then((res: SumUpResponse) => console.log(res)) + * .catch((error: SumUpResponse) => console.error(error)); + * + * this.sumUp.isLoggedIn() + * .then((res: SumUpLoginStatus) => console.log(res)) + * .catch((error: SumUpLoginStatus) => console.error(error)); + * + * this.sumUp.prepare() + * .then((res: SumUpResponse) => console.log(res)) + * .catch((error: SumUpResponse) => console.error(error)); + * + * this.sumUp.closeConnection() + * .then((res: SumUpResponse) => console.log(res)) + * .catch((error: SumUpResponse) => console.error(error)); + * + * this.sumUp.pay(10.0, "EUR") + * .then((res: SumUpPayment) => console.log(res)) + * .catch((error: SumUpPayment) => console.error(error)); + * + * ``` + */ +@Plugin({ + pluginName: 'SumUp', + plugin: 'cordova-sumup-plugin', + pluginRef: 'window.SumUp', + repo: 'https://github.com/mariusbackes/cordova-plugin-sumup', + install: + 'cordova plugin add cordova-sumup-plugin --variable SUMUP_API_KEY=INSERT_YOUR_KEY', + installVariables: ['SUMUP_API_KEY'], + platforms: ['Android', 'iOS'] +}) +@Injectable() +export class SumUp extends IonicNativePlugin { + /** + * Login a user with an optional access token. + * If the access token is provided and valid, the user is logged in autmatically. + * Otherwise the user has to type in the credentials + * @param accessToken {string} + * @return {Promise} Return a SumUpResponse object + */ + @Cordova() + login(accessToken?: string): Promise { + return; + } + + /** + * Authenticates the account with the given access token. Parameter accessToken is required. + * @param accessToken {string} + * @return {Promise} Return a SumUpResponse object + */ + @Cordova() + auth(accessToken: string): Promise { + return; + } + + /** + * Opens a new window with the all account settings of an logged in user. + * @return {Promise} Return a SumUpResponse object + */ + @Cordova() + getSettings(): Promise { + return; + } + + /** + * Logout a user from the account. + * @return {Promise} Return a SumUpResponse object + */ + @Cordova() + logout(): Promise { + return; + } + + /** + * Checks whether the user is logged in or not and returns an object with the field isLoggedIn which is a boolean value. + * @return {Promise} Return a SumUpResponse object + */ + @Cordova() + isLoggedIn(): Promise { + return; + } + + /** + * Prepares the terminal for a payment. Checks whether the CardReader is ready to transmit and + * if an instance of the CardReaderManager is available. + * @return {Promise} Return a SumUpResponse object + */ + @Cordova() + prepare(): Promise { + return; + } + + /** + * Tries to close the connection to the card terminal. + * @return {Promise} Return a SumUpResponse object + */ + @Cordova() + closeConnection(): Promise { + return; + } + + /** + * Opens a native SumUp window to proceed a payment. Parameter amount and currencycode are required. + * If the Payment was successful it returns an SumUpPayment object with information about the payment. + * @param amount {number} + * @param currencycode {string} + * @return {Promise} Return a SumUpResponse object + */ + @Cordova() + pay(amount: number, currencycode: string): Promise { + return; + } +}