Compare commits

...

9 Commits

Author SHA1 Message Date
Ibby Hadeed
0a8146b76c 4.4.2 2017-11-15 08:52:51 -05:00
Ibby Hadeed
2d60db9d3b chore(): update changelog 2017-11-13 16:21:09 -05:00
Ibby Hadeed
3378d7a398 4.4.1 2017-11-13 16:12:23 -05:00
Ibby Hadeed
61defd480c chore(): revert back to angular 4.4.4 2017-11-13 16:11:45 -05:00
Ibby Hadeed
4e28295486 Hide function/interface properly 2017-11-09 18:13:29 -05:00
Ibby Hadeed
dee32c921c Fix build issue 2017-11-09 18:09:40 -05:00
Ibby Hadeed
2475c57e00 Update 2017-11-09 16:19:48 -05:00
Ibby Hadeed
79b522f832 chore(): update changelog 2017-11-09 16:18:09 -05:00
Ibby Hadeed
ccb2e55435 4.4.0 2017-11-09 16:18:01 -05:00
5 changed files with 5692 additions and 10759 deletions

View File

@@ -1,5 +1,21 @@
<a name="4.4.1"></a>
## [4.4.1](https://github.com/ionic-team/ionic-native/compare/v4.4.0...v4.4.1) (2017-11-13)
<a name="4.4.0"></a>
# [4.4.0](https://github.com/ionic-team/ionic-native/compare/v4.3.3...v4.4.0) (2017-11-09)
### Features
* **google-maps:** accept own properties for `addMarker()` and others ([#2093](https://github.com/ionic-team/ionic-native/issues/2093)) ([196be02](https://github.com/ionic-team/ionic-native/commit/196be02))
* **http:** add support for new methods ([#2054](https://github.com/ionic-team/ionic-native/issues/2054)) ([d96d3ee](https://github.com/ionic-team/ionic-native/commit/d96d3ee))
<a name="4.3.3"></a>
## [4.3.3](https://github.com/ionic-team/ionic-native/compare/4.3.2...v4.3.3) (2017-11-01)
## [4.3.3](https://github.com/ionic-team/ionic-native/compare/v4.3.2...v4.3.3) (2017-11-01)
### Bug Fixes
@@ -8,6 +24,11 @@
<a name="4.3.2"></a>
## [4.3.2](https://github.com/ionic-team/ionic-native/compare/4.3.2...v4.3.2) (2017-10-18)
<a name="4.3.2"></a>
## [4.3.2](https://github.com/ionic-team/ionic-native/compare/4.3.1...4.3.2) (2017-10-17)
@@ -24,17 +45,7 @@
<a name="4.3.1"></a>
## [4.3.1](https://github.com/ionic-team/ionic-native/compare/v4.3.1...4.3.1) (2017-10-06)
### Features
* **pro:** Add support for Ionic Pro by incorporating cordova-plugin-ionic ([465d551](https://github.com/ionic-team/ionic-native/commit/465d551))
<a name="4.3.1"></a>
## [4.3.1](https://github.com/ionic-team/ionic-native/compare/v4.3.0...v4.3.1) (2017-10-06)
## [4.3.1](https://github.com/ionic-team/ionic-native/compare/v4.3.0...4.3.1) (2017-10-06)
### Bug Fixes
@@ -46,6 +57,7 @@
### Features
* **pro:** Add support for Ionic Pro by incorporating cordova-plugin-ionic ([465d551](https://github.com/ionic-team/ionic-native/commit/465d551))
* **regula-document-reader:** separate initialization and scanning, add android ([#2013](https://github.com/ionic-team/ionic-native/issues/2013)) ([2179699](https://github.com/ionic-team/ionic-native/commit/2179699))
@@ -58,7 +70,6 @@
* **google-maps:** convert JS classes to Ionic Native ([#1956](https://github.com/ionic-team/ionic-native/issues/1956)) ([57af5c5](https://github.com/ionic-team/ionic-native/commit/57af5c5))
* **google-maps:** fix icons property of MarkerClusterOptions ([#1937](https://github.com/ionic-team/ionic-native/issues/1937)) ([8004790](https://github.com/ionic-team/ionic-native/commit/8004790))
* **google-maps:** fix issue when creating new instance of BaseArrayClass ([#1931](https://github.com/ionic-team/ionic-native/issues/1931)) ([957396b](https://github.com/ionic-team/ionic-native/commit/957396b))
* **google-maps:** the zoom option is missing in the GoogleMapOptions class ([#1948](https://github.com/ionic-team/ionic-native/issues/1948)) ([ef898ef](https://github.com/ionic-team/ionic-native/commit/ef898ef))
* **http:** fix plugin ref ([#1934](https://github.com/ionic-team/ionic-native/issues/1934)) ([3a1034e](https://github.com/ionic-team/ionic-native/commit/3a1034e))
* **launch-navigator:** fix navigate method ([#1940](https://github.com/ionic-team/ionic-native/issues/1940)) ([a150d4d](https://github.com/ionic-team/ionic-native/commit/a150d4d))
@@ -83,6 +94,16 @@
<a name="4.2.1"></a>
## [4.2.1](https://github.com/ionic-team/ionic-native/compare/v4.2.0...v4.2.1) (2017-08-29)
### Bug Fixes
* **google-maps:** fix issue when creating new instance of BaseArrayClass ([#1931](https://github.com/ionic-team/ionic-native/issues/1931)) ([957396b](https://github.com/ionic-team/ionic-native/commit/957396b))
<a name="4.2.0"></a>
# [4.2.0](https://github.com/ionic-team/ionic-native/compare/v4.1.0...v4.2.0) (2017-08-26)
@@ -1832,13 +1853,13 @@ The whole implementation has changed now. You must update your code.
* **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](https://github.com/Cordova) wrapper ([499ead3](https://github.com/ionic-team/ionic-native/commit/499ead3))
* 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](https://github.com/Cordova) for sync functions ([17e3827](https://github.com/ionic-team/ionic-native/commit/17e3827))
* **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))

16279
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,21 +1,21 @@
{
"name": "ionic-native",
"version": "4.3.3",
"version": "4.4.2",
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
"homepage": "https://ionicframework.com/",
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
"license": "MIT",
"devDependencies": {
"@angular/compiler": "5.0.0",
"@angular/compiler-cli": "5.0.0",
"@angular/core": "5.0.0",
"@angular/compiler": "4.4.4",
"@angular/compiler-cli": "4.4.4",
"@angular/core": "4.4.4",
"@types/cordova": "0.0.34",
"@types/jasmine": "^2.5.51",
"@types/node": "^8.0.47",
"@types/jasmine": "^2.6.3",
"@types/node": "^8.0.50",
"canonical-path": "0.0.2",
"child-process-promise": "2.2.1",
"conventional-changelog-cli": "1.3.1",
"cpr": "2.0.2",
"conventional-changelog-cli": "1.3.4",
"cpr": "2.0.0",
"cz-conventional-changelog": "2.0.0",
"decamelize": "1.2.0",
"dgeni": "0.4.7",

View File

@@ -105,17 +105,6 @@ export interface CordovaCheckOptions {
observable?: boolean;
}
export interface CordovaFiniteObservableOptions extends CordovaOptions {
/**
* Function that gets a result returned from plugin's success callback, and decides whether it is last value and observable should complete.
*/
resultFinalPredicate?: (result: any) => boolean;
/**
* Function that gets called after resultFinalPredicate, and removes service data that indicates end of stream from the result.
*/
resultTransform?: (result: any) => any;
}
/**
* @private
*/
@@ -167,7 +156,6 @@ export function CordovaCheck(opts: CordovaCheckOptions = {}) {
};
}
/**
* @private
*
@@ -323,39 +311,3 @@ export function CordovaFunctionOverride(opts: any = {}) {
};
}
/**
* @private
*
* Wraps method that returns an observable that can be completed. Provided opts.resultFinalPredicate dictates when the observable completes.
*
*/
export function CordovaFiniteObservable(opts: CordovaFiniteObservableOptions = {}) {
if (opts.observable === false) {
throw new Error('CordovaFiniteObservable decorator can only be used on methods that returns observable. Please provide correct option.');
}
opts.observable = true;
return (target: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>) => {
return {
value: function(...args: any[]) {
let wrappedObservable: Observable<any> = wrap(this, methodName, opts).apply(this, args);
return new Observable<any>((observer) => {
let wrappedSubscription = wrappedObservable.subscribe({
next: (x) => {
observer.next(opts.resultTransform ? opts.resultTransform(x) : x);
if (opts.resultFinalPredicate && opts.resultFinalPredicate(x)) {
observer.complete();
}
},
error: (err) => { observer.error(err); },
complete: () => { observer.complete(); }
});
return () => {
wrappedSubscription.unsubscribe();
};
});
},
enumerable: true
};
};
}

View File

@@ -1,7 +1,54 @@
import { Plugin, Cordova, CordovaFiniteObservable, IonicNativePlugin } from '@ionic-native/core';
import { Plugin, Cordova, IonicNativePlugin, CordovaOptions, wrap } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
import { Injectable } from '@angular/core';
/**
* @hidden
*/
export interface CordovaFiniteObservableOptions extends CordovaOptions {
/**
* Function that gets a result returned from plugin's success callback, and decides whether it is last value and observable should complete.
*/
resultFinalPredicate?: string;
/**
* Function that gets called after resultFinalPredicate, and removes service data that indicates end of stream from the result.
*/
resultTransform?: string;
}
/**
* @hidden
*
* Wraps method that returns an observable that can be completed. Provided opts.resultFinalPredicate dictates when the observable completes.
*/
export function CordovaFiniteObservable(opts: CordovaFiniteObservableOptions = {}) {
opts.observable = true;
return (target: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>) => {
return {
value: function(...args: any[]) {
const wrappedObservable: Observable<any> = wrap(this, methodName, opts).apply(this, args);
return new Observable<any>((observer: Observer<any>) => {
const wrappedSubscription = wrappedObservable.subscribe({
next: (x: any) => {
observer.next(opts.resultTransform ? x[opts.resultTransform] : x);
if (opts.resultFinalPredicate && x[opts.resultFinalPredicate]) {
observer.complete();
}
},
error: (err: any) => { observer.error(err); },
complete: () => { observer.complete(); }
});
return () => {
wrappedSubscription.unsubscribe();
};
});
},
enumerable: true
};
};
}
/**
* @name Photo Library
* @description
@@ -58,8 +105,8 @@ export class PhotoLibrary extends IonicNativePlugin {
*/
@CordovaFiniteObservable({
callbackOrder: 'reverse',
resultFinalPredicate: (result: { isLastChunk: boolean }) => { return result.isLastChunk; },
resultTransform: (result: { library: LibraryItem[] }) => { return result.library; },
resultFinalPredicate: 'isLastChunk',
resultTransform: 'library'
})
getLibrary(options?: GetLibraryOptions): Observable<LibraryItem[]> { return; }
@@ -69,7 +116,7 @@ export class PhotoLibrary extends IonicNativePlugin {
* @return { Promise<void>} Returns a promise that resolves when permissions are granted, and fails when not.
*/
@Cordova({
callbackOrder: 'reverse',
callbackOrder: 'reverse'
})
requestAuthorization(options?: RequestAuthorizationOptions): Promise<void> { return; }
@@ -78,7 +125,7 @@ export class PhotoLibrary extends IonicNativePlugin {
* @return {Promise<AlbumItem[]>} Resolves to list of albums.
*/
@Cordova({
callbackOrder: 'reverse',
callbackOrder: 'reverse'
})
getAlbums(): Promise<AlbumItem[]> { return; }