diff --git a/package.json b/package.json index ea04c5a..4edf553 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ionic-native-mocks", - "version": "1.0.4", + "version": "2.0.0", "description": "Mocks for Ionic Native for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support", "homepage": "https://ionicframework.com/", "author": "Chris Griffith (https://aj-sofwtare.com)", @@ -39,175 +39,175 @@ "q": "1.5.0", "queue": "4.2.1", "rimraf": "2.6.1", - "rxjs": "5.1.1", + "rxjs": "5.4.0", "semver": "5.3.0", "tslint": "3.15.1", "tslint-ionic-rules": "0.0.8", "typescript": "2.3.3", - "zone.js": "^0.8.11", - "@ionic-native/action-sheet": "^3.12.1", - "@ionic-native/admob": "^3.12.1", - "@ionic-native/admob-free": "^3.12.1", - "@ionic-native/alipay": "^3.12.1", - "@ionic-native/android-fingerprint-auth": "^3.12.1", - "@ionic-native/android-full-screen": "^3.12.1", - "@ionic-native/android-permissions": "^3.12.1", - "@ionic-native/app-availability": "^3.12.1", - "@ionic-native/app-minimize": "^3.12.1", - "@ionic-native/app-preferences": "^3.12.1", - "@ionic-native/app-rate": "^3.12.1", - "@ionic-native/app-update": "^3.12.1", - "@ionic-native/app-version": "^3.12.1", - "@ionic-native/appodeal": "^3.12.1", - "@ionic-native/autostart": "^3.12.1", - "@ionic-native/background-fetch": "^3.12.1", - "@ionic-native/background-geolocation": "^3.12.1", - "@ionic-native/background-mode": "^3.12.1", - "@ionic-native/backlight": "^3.12.1", - "@ionic-native/badge": "^3.12.1", - "@ionic-native/barcode-scanner": "^3.12.1", - "@ionic-native/base64": "^3.12.1", - "@ionic-native/base64-to-gallery": "^3.12.1", - "@ionic-native/battery-status": "^3.12.1", - "@ionic-native/ble": "^3.12.1", - "@ionic-native/bluetooth-serial": "^3.12.1", - "@ionic-native/brightness": "^3.12.1", - "@ionic-native/broadcaster": "^3.12.1", - "@ionic-native/browser-tab": "^3.12.1", - "@ionic-native/calendar": "^3.12.1", - "@ionic-native/call-number": "^3.12.1", - "@ionic-native/camera": "^3.12.1", - "@ionic-native/camera-preview": "^3.12.1", - "@ionic-native/card-io": "^3.12.1", - "@ionic-native/clipboard": "^3.12.1", - "@ionic-native/code-push": "^3.12.1", - "@ionic-native/contacts": "^3.12.1", + "zone.js": "^0.8.12", + "@ionic-native/action-sheet": "^4.0.0", + "@ionic-native/admob": "^4.0.0", + "@ionic-native/admob-free": "^4.0.0", + "@ionic-native/alipay": "^4.0.0", + "@ionic-native/android-fingerprint-auth": "^4.0.0", + "@ionic-native/android-full-screen": "^4.0.0", + "@ionic-native/android-permissions": "^4.0.0", + "@ionic-native/app-availability": "^4.0.0", + "@ionic-native/app-minimize": "^4.0.0", + "@ionic-native/app-preferences": "^4.0.0", + "@ionic-native/app-rate": "^4.0.0", + "@ionic-native/app-update": "^4.0.0", + "@ionic-native/app-version": "^4.0.0", + "@ionic-native/appodeal": "^4.0.0", + "@ionic-native/autostart": "^4.0.0", + "@ionic-native/background-fetch": "^4.0.0", + "@ionic-native/background-geolocation": "^4.0.0", + "@ionic-native/background-mode": "^4.0.0", + "@ionic-native/backlight": "^4.0.0", + "@ionic-native/badge": "^4.0.0", + "@ionic-native/barcode-scanner": "^4.0.0", + "@ionic-native/base64": "^4.0.0", + "@ionic-native/base64-to-gallery": "^4.0.0", + "@ionic-native/battery-status": "^4.0.0", + "@ionic-native/ble": "^4.0.0", + "@ionic-native/bluetooth-serial": "^4.0.0", + "@ionic-native/brightness": "^4.0.0", + "@ionic-native/broadcaster": "^4.0.0", + "@ionic-native/browser-tab": "^4.0.0", + "@ionic-native/calendar": "^4.0.0", + "@ionic-native/call-number": "^4.0.0", + "@ionic-native/camera": "^4.0.0", + "@ionic-native/camera-preview": "^4.0.0", + "@ionic-native/card-io": "^4.0.0", + "@ionic-native/clipboard": "^4.0.0", + "@ionic-native/code-push": "^4.0.0", + "@ionic-native/contacts": "^4.0.0", "@ionic-native/core": "3.10.2", - "@ionic-native/couchbase-lite": "^3.12.1", - "@ionic-native/crop": "^3.12.1", - "@ionic-native/date-picker": "^3.12.1", - "@ionic-native/db-meter": "^3.12.1", - "@ionic-native/deeplinks": "^3.12.1", - "@ionic-native/device": "^3.12.1", - "@ionic-native/device-accounts": "^3.12.1", - "@ionic-native/device-feedback": "^3.12.1", - "@ionic-native/device-motion": "^3.12.1", - "@ionic-native/device-orientation": "^3.12.1", - "@ionic-native/diagnostic": "^3.12.1", - "@ionic-native/dialogs": "^3.12.1", - "@ionic-native/document-viewer": "^3.12.1", - "@ionic-native/email-composer": "^3.12.1", - "@ionic-native/estimote-beacons": "^3.12.1", - "@ionic-native/facebook": "^3.12.1", - "@ionic-native/fcm": "^3.12.1", - "@ionic-native/file": "^3.12.1", - "@ionic-native/file-chooser": "^3.12.1", - "@ionic-native/file-encryption": "^3.12.1", - "@ionic-native/file-opener": "^3.12.1", - "@ionic-native/file-path": "^3.12.1", - "@ionic-native/fingerprint-aio": "^3.12.1", - "@ionic-native/firebase": "^3.12.1", - "@ionic-native/firebase-analytics": "^3.12.1", - "@ionic-native/firebase-dynamic-links": "^3.12.1", - "@ionic-native/flashlight": "^3.12.1", - "@ionic-native/flurry-analytics": "^3.12.1", - "@ionic-native/ftp": "^3.12.1", - "@ionic-native/geofence": "^3.12.1", - "@ionic-native/geolocation": "^3.12.1", - "@ionic-native/globalization": "^3.12.1", - "@ionic-native/google-analytics": "^3.12.1", - "@ionic-native/google-maps": "^3.12.1", - "@ionic-native/google-plus": "^3.12.1", - "@ionic-native/gyroscope": "^3.12.1", - "@ionic-native/header-color": "^3.12.1", - "@ionic-native/health": "^3.12.1", - "@ionic-native/health-kit": "^3.12.1", - "@ionic-native/hotspot": "^3.12.1", - "@ionic-native/http": "^3.12.1", - "@ionic-native/httpd": "^3.12.1", - "@ionic-native/ibeacon": "^3.12.1", - "@ionic-native/image-picker": "^3.12.1", - "@ionic-native/image-resizer": "^3.12.1", - "@ionic-native/in-app-browser": "^3.12.1", - "@ionic-native/in-app-purchase": "^3.12.1", - "@ionic-native/insomnia": "^3.12.1", - "@ionic-native/instagram": "^3.12.1", - "@ionic-native/intel-security": "^3.12.1", - "@ionic-native/intercom": "^3.12.1", - "@ionic-native/is-debug": "^3.12.1", - "@ionic-native/jins-meme": "^3.12.1", - "@ionic-native/keyboard": "^3.12.1", - "@ionic-native/keychain": "^3.12.1", - "@ionic-native/launch-navigator": "^3.12.1", - "@ionic-native/launch-review": "^3.12.1", - "@ionic-native/linkedin": "^3.12.1", - "@ionic-native/local-notifications": "^3.12.1", - "@ionic-native/location-accuracy": "^3.12.1", - "@ionic-native/market": "^3.12.1", - "@ionic-native/media": "^3.12.1", - "@ionic-native/media-capture": "^3.12.1", - "@ionic-native/mixpanel": "^3.12.1", - "@ionic-native/mobile-accessibility": "^3.12.1", - "@ionic-native/music-controls": "^3.12.1", - "@ionic-native/native-audio": "^3.12.1", - "@ionic-native/native-geocoder": "^3.12.1", - "@ionic-native/native-keyboard": "^3.12.1", - "@ionic-native/native-page-transitions": "^3.12.1", - "@ionic-native/native-ringtones": "^3.12.1", - "@ionic-native/native-storage": "^3.12.1", - "@ionic-native/navigation-bar": "^3.12.1", - "@ionic-native/network": "^3.12.1", - "@ionic-native/nfc": "^3.12.1", - "@ionic-native/onesignal": "^3.12.1", - "@ionic-native/paypal": "^3.12.1", - "@ionic-native/pedometer": "^3.12.1", - "@ionic-native/phonegap-local-notification": "^3.12.1", - "@ionic-native/photo-library": "^3.12.1", - "@ionic-native/photo-viewer": "^3.12.1", - "@ionic-native/pin-dialog": "^3.12.1", - "@ionic-native/pinterest": "^3.12.1", - "@ionic-native/power-management": "^3.12.1", - "@ionic-native/printer": "^3.12.1", - "@ionic-native/push": "^3.12.1", - "@ionic-native/rollbar": "^3.12.1", - "@ionic-native/safari-view-controller": "^3.12.1", - "@ionic-native/screen-orientation": "^3.12.1", - "@ionic-native/screenshot": "^3.12.1", - "@ionic-native/secure-storage": "^3.12.1", - "@ionic-native/serial": "^3.12.1", - "@ionic-native/shake": "^3.12.1", - "@ionic-native/sim": "^3.12.1", - "@ionic-native/sms": "^3.12.1", - "@ionic-native/social-sharing": "^3.12.1", - "@ionic-native/speech-recognition": "^3.12.1", - "@ionic-native/spinner-dialog": "^3.12.1", + "@ionic-native/couchbase-lite": "^4.0.0", + "@ionic-native/crop": "^4.0.0", + "@ionic-native/date-picker": "^4.0.0", + "@ionic-native/db-meter": "^4.0.0", + "@ionic-native/deeplinks": "^4.0.0", + "@ionic-native/device": "^4.0.0", + "@ionic-native/device-accounts": "^4.0.0", + "@ionic-native/device-feedback": "^4.0.0", + "@ionic-native/device-motion": "^4.0.0", + "@ionic-native/device-orientation": "^4.0.0", + "@ionic-native/diagnostic": "^4.0.0", + "@ionic-native/dialogs": "^4.0.0", + "@ionic-native/document-viewer": "^4.0.0", + "@ionic-native/email-composer": "^4.0.0", + "@ionic-native/estimote-beacons": "^4.0.0", + "@ionic-native/facebook": "^4.0.0", + "@ionic-native/fcm": "^4.0.0", + "@ionic-native/file": "^4.0.0", + "@ionic-native/file-chooser": "^4.0.0", + "@ionic-native/file-encryption": "^4.0.0", + "@ionic-native/file-opener": "^4.0.0", + "@ionic-native/file-path": "^4.0.0", + "@ionic-native/fingerprint-aio": "^4.0.0", + "@ionic-native/firebase": "^4.0.0", + "@ionic-native/firebase-analytics": "^4.0.0", + "@ionic-native/firebase-dynamic-links": "^4.0.0", + "@ionic-native/flashlight": "^4.0.0", + "@ionic-native/flurry-analytics": "^4.0.0", + "@ionic-native/ftp": "^4.0.0", + "@ionic-native/geofence": "^4.0.0", + "@ionic-native/geolocation": "^4.0.0", + "@ionic-native/globalization": "^4.0.0", + "@ionic-native/google-analytics": "^4.0.0", + "@ionic-native/google-maps": "^4.0.0", + "@ionic-native/google-plus": "^4.0.0", + "@ionic-native/gyroscope": "^4.0.0", + "@ionic-native/header-color": "^4.0.0", + "@ionic-native/health": "^4.0.0", + "@ionic-native/health-kit": "^4.0.0", + "@ionic-native/hotspot": "^4.0.0", + "@ionic-native/http": "^4.0.0", + "@ionic-native/httpd": "^4.0.0", + "@ionic-native/ibeacon": "^4.0.0", + "@ionic-native/image-picker": "^4.0.0", + "@ionic-native/image-resizer": "^4.0.0", + "@ionic-native/in-app-browser": "^4.0.0", + "@ionic-native/in-app-purchase": "^4.0.0", + "@ionic-native/insomnia": "^4.0.0", + "@ionic-native/instagram": "^4.0.0", + "@ionic-native/intel-security": "^4.0.0", + "@ionic-native/intercom": "^4.0.0", + "@ionic-native/is-debug": "^4.0.0", + "@ionic-native/jins-meme": "^4.0.0", + "@ionic-native/keyboard": "^4.0.0", + "@ionic-native/keychain": "^4.0.0", + "@ionic-native/launch-navigator": "^4.0.0", + "@ionic-native/launch-review": "^4.0.0", + "@ionic-native/linkedin": "^4.0.0", + "@ionic-native/local-notifications": "^4.0.0", + "@ionic-native/location-accuracy": "^4.0.0", + "@ionic-native/market": "^4.0.0", + "@ionic-native/media": "^4.0.0", + "@ionic-native/media-capture": "^4.0.0", + "@ionic-native/mixpanel": "^4.0.0", + "@ionic-native/mobile-accessibility": "^4.0.0", + "@ionic-native/music-controls": "^4.0.0", + "@ionic-native/native-audio": "^4.0.0", + "@ionic-native/native-geocoder": "^4.0.0", + "@ionic-native/native-keyboard": "^4.0.0", + "@ionic-native/native-page-transitions": "^4.0.0", + "@ionic-native/native-ringtones": "^4.0.0", + "@ionic-native/native-storage": "^4.0.0", + "@ionic-native/navigation-bar": "^4.0.0", + "@ionic-native/network": "^4.0.0", + "@ionic-native/nfc": "^4.0.0", + "@ionic-native/onesignal": "^4.0.0", + "@ionic-native/paypal": "^4.0.0", + "@ionic-native/pedometer": "^4.0.0", + "@ionic-native/phonegap-local-notification": "^4.0.0", + "@ionic-native/photo-library": "^4.0.0", + "@ionic-native/photo-viewer": "^4.0.0", + "@ionic-native/pin-dialog": "^4.0.0", + "@ionic-native/pinterest": "^4.0.0", + "@ionic-native/power-management": "^4.0.0", + "@ionic-native/printer": "^4.0.0", + "@ionic-native/push": "^4.0.0", + "@ionic-native/rollbar": "^4.0.0", + "@ionic-native/safari-view-controller": "^4.0.0", + "@ionic-native/screen-orientation": "^4.0.0", + "@ionic-native/screenshot": "^4.0.0", + "@ionic-native/secure-storage": "^4.0.0", + "@ionic-native/serial": "^4.0.0", + "@ionic-native/shake": "^4.0.0", + "@ionic-native/sim": "^4.0.0", + "@ionic-native/sms": "^4.0.0", + "@ionic-native/social-sharing": "^4.0.0", + "@ionic-native/speech-recognition": "^4.0.0", + "@ionic-native/spinner-dialog": "^4.0.0", "@ionic-native/splash-screen": "^3.10.2", - "@ionic-native/sqlite": "^3.12.1", - "@ionic-native/sqlite-porter": "^3.12.1", - "@ionic-native/status-bar": "^3.12.1", - "@ionic-native/stepcounter": "^3.12.1", - "@ionic-native/streaming-media": "^3.12.1", - "@ionic-native/stripe": "^3.12.1", - "@ionic-native/taptic-engine": "^3.12.1", - "@ionic-native/text-to-speech": "^3.12.1", - "@ionic-native/themeable-browser": "^3.12.1", - "@ionic-native/three-dee-touch": "^3.12.1", - "@ionic-native/toast": "^3.12.1", - "@ionic-native/touch-id": "^3.12.1", - "@ionic-native/transfer": "^3.12.1", - "@ionic-native/twitter-connect": "^3.12.1", - "@ionic-native/unique-device-id": "^3.12.1", - "@ionic-native/user-agent": "^3.12.1", - "@ionic-native/vibration": "^3.12.1", - "@ionic-native/video-capture-plus": "^3.12.1", - "@ionic-native/video-editor": "^3.12.1", - "@ionic-native/video-player": "^3.12.1", - "@ionic-native/web-intent": "^3.12.1", - "@ionic-native/wheel-selector": "^3.12.1", - "@ionic-native/youtube-video-player": "^3.12.1", - "@ionic-native/zbar": "^3.12.1", - "@ionic-native/zeroconf": "^3.12.1", - "@ionic-native/zip": "^3.12.1" + "@ionic-native/sqlite": "^4.0.0", + "@ionic-native/sqlite-porter": "^4.0.0", + "@ionic-native/status-bar": "^4.0.0", + "@ionic-native/stepcounter": "^4.0.0", + "@ionic-native/streaming-media": "^4.0.0", + "@ionic-native/stripe": "^4.0.0", + "@ionic-native/taptic-engine": "^4.0.0", + "@ionic-native/text-to-speech": "^4.0.0", + "@ionic-native/themeable-browser": "^4.0.0", + "@ionic-native/three-dee-touch": "^4.0.0", + "@ionic-native/toast": "^4.0.0", + "@ionic-native/touch-id": "^4.0.0", + "@ionic-native/transfer": "^4.0.0", + "@ionic-native/twitter-connect": "^4.0.0", + "@ionic-native/unique-device-id": "^4.0.0", + "@ionic-native/user-agent": "^4.0.0", + "@ionic-native/vibration": "^4.0.0", + "@ionic-native/video-capture-plus": "^4.0.0", + "@ionic-native/video-editor": "^4.0.0", + "@ionic-native/video-player": "^4.0.0", + "@ionic-native/web-intent": "^4.0.0", + "@ionic-native/wheel-selector": "^4.0.0", + "@ionic-native/youtube-video-player": "^4.0.0", + "@ionic-native/zbar": "^4.0.0", + "@ionic-native/zeroconf": "^4.0.0", + "@ionic-native/zip": "^4.0.0" }, "scripts": { "start": "npm run test:watch", @@ -236,6 +236,6 @@ } }, "dependencies": { - "@ionic-native/core": "^3.12.1" + "@ionic-native/core": "^4.0.0" } } diff --git a/src/@ionic-native-mocks/plugins/admob/index.ts b/src/@ionic-native-mocks/plugins/admob-pro/index.ts similarity index 98% rename from src/@ionic-native-mocks/plugins/admob/index.ts rename to src/@ionic-native-mocks/plugins/admob-pro/index.ts index 53a7d0b..36da4ad 100644 --- a/src/@ionic-native-mocks/plugins/admob/index.ts +++ b/src/@ionic-native-mocks/plugins/admob-pro/index.ts @@ -1,4 +1,4 @@ -import { AdMob } from '@ionic-native/admob'; +import { AdMobPro } from '@ionic-native/admob-pro'; import { Observable } from 'rxjs/Observable'; import { Observer } from 'rxjs/Observer'; @@ -66,7 +66,7 @@ export interface AdExtras { color_url: string; } -export class AdMobMock extends AdMob { +export class AdMobProMock extends AdMobPro { AD_POSITION: { NO_CHANGE: number; TOP_LEFT: number; diff --git a/src/@ionic-native-mocks/plugins/alipay/index.ts b/src/@ionic-native-mocks/plugins/alipay/index.ts new file mode 100644 index 0000000..368bc75 --- /dev/null +++ b/src/@ionic-native-mocks/plugins/alipay/index.ts @@ -0,0 +1,63 @@ +import { Alipay } from '@ionic-native/alipay'; + +export interface AlipayOrder { + /** + * appId assigned by Alipay + */ + app_id: string; + /** + * Api name. + * Should be: alipay.trade.app.pay + */ + method: string; + /** + * Data format + * Default: "JSON" + */ + format?: string; + /** + * Charset + * Possible values: "UTF-8", "GBK" + * Default: "UTF-8" + */ + charset: string; + /** + * Sign method + * Default: 'RSA' + */ + sign_type: string; + /** + * Sign value. Should be got from server side. + * Default: 'RSA' + */ + sign: string; + /** + * Timestamp, formated like "yyyy-MM-dd HH:mm:ss", e.g. 2014-07-24 03:07:50 + */ + timestamp: string; + /** + * Api version. Fixed value '1.0' + */ + version: string; + /** + * Notify url. + */ + notify_url: string; + /** + * biz content. formated in json. see alipay doc for detail. + */ + biz_content: string; +} + +export class AlipayMock extends Alipay { + /** + * Open Alipay to perform App pay + * @param order { AlipayOrder } alipay options + * @returns {Promise} Returns a Promise that resolves with the success return, or rejects with an error. + */ + pay(order: AlipayOrder): Promise { + return new Promise((resolve, reject) => { + resolve(); + }); + }; +} diff --git a/src/@ionic-native-mocks/plugins/android-fingerprint-auth/index.ts b/src/@ionic-native-mocks/plugins/android-fingerprint-auth/index.ts new file mode 100644 index 0000000..b7baf39 --- /dev/null +++ b/src/@ionic-native-mocks/plugins/android-fingerprint-auth/index.ts @@ -0,0 +1,153 @@ +import { AndroidFingerprintAuth } from '@ionic-native/android-fingerprint-auth'; +export interface AFAAuthOptions { + /** + * Required + * Used as the alias for your key in the Android Key Store. + */ + clientId: string; + /** + * Used to create credential string for encrypted token and as alias to retrieve the cipher. + */ + username?: string; + /** + * Used to create credential string for encrypted token + */ + password?: string; + /** + * Required for decrypt() + * Encrypted user credentials to decrypt upon successful authentication. + */ + token?: string; + /** + * Set to true to remove the "USE BACKUP" button + */ + disableBackup?: boolean; + /** + * Change the language. (en_US or es) + */ + locale?: string; + /** + * The device max is 5 attempts. Set this parameter if you want to allow fewer than 5 attempts. + */ + maxAttempts?: number; + /** + * Require the user to authenticate with a fingerprint to authorize every use of the key. + * New fingerprint enrollment will invalidate key and require backup authenticate to + * re-enable the fingerprint authentication dialog. + */ + userAuthRequired?: boolean; + /** + * Set the title of the fingerprint authentication dialog. + */ + dialogTitle?: string; + /** + * Set the message of the fingerprint authentication dialog. + */ + dialogMessage?: string; + /** + * Set the hint displayed by the fingerprint icon on the fingerprint authentication dialog. + */ + dialogHint?: string; +} +export interface AFADecryptOptions { + /** + * Biometric authentication + */ + withFingerprint: boolean; + /** + * Authentication using backup credential activity + */ + withBackup: boolean; + /** + * FingerprintAuth.CipherMode.DECRYPT + * Decrypted password + */ + password: string; +} +export interface AFAEncryptResponse { + /** + * Biometric authentication + */ + withFingerprint: boolean; + /** + * Authentication using backup credential activity + */ + withBackup: boolean; + /** + * base64encoded string representation of user credentials + */ + token: string; +} + +export class AndroidFingerprintAuthMock extends AndroidFingerprintAuth { + ERRORS: { + BAD_PADDING_EXCEPTION: 'BAD_PADDING_EXCEPTION'; + CERTIFICATE_EXCEPTION: 'CERTIFICATE_EXCEPTION'; + FINGERPRINT_CANCELLED: 'FINGERPRINT_CANCELLED'; + FINGERPRINT_DATA_NOT_DELETED: 'FINGERPRINT_DATA_NOT_DELETED'; + FINGERPRINT_ERROR: 'FINGERPRINT_ERROR'; + FINGERPRINT_NOT_AVAILABLE: 'FINGERPRINT_NOT_AVAILABLE'; + FINGERPRINT_PERMISSION_DENIED: 'FINGERPRINT_PERMISSION_DENIED'; + FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST: 'FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST'; + ILLEGAL_BLOCK_SIZE_EXCEPTION: 'ILLEGAL_BLOCK_SIZE_EXCEPTION'; + INIT_CIPHER_FAILED: 'INIT_CIPHER_FAILED'; + INVALID_ALGORITHM_PARAMETER_EXCEPTION: 'INVALID_ALGORITHM_PARAMETER_EXCEPTION'; + IO_EXCEPTION: 'IO_EXCEPTION'; + JSON_EXCEPTION: 'JSON_EXCEPTION'; + MINIMUM_SDK: 'MINIMUM_SDK'; + MISSING_ACTION_PARAMETERS: 'MISSING_ACTION_PARAMETERS'; + MISSING_PARAMETERS: 'MISSING_PARAMETERS'; + NO_SUCH_ALGORITHM_EXCEPTION: 'NO_SUCH_ALGORITHM_EXCEPTION'; + SECURITY_EXCEPTION: 'SECURITY_EXCEPTION'; + }; + /** + * Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device. + * @param options {AFAAuthOptions} Options + * @returns {Promise} + */ + encrypt(options: AFAAuthOptions): Promise { + let reponse: AFAEncryptResponse; + return new Promise((resolve, reject) => { + resolve(reponse); + }); + }; + /** + * Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device. + * @param options {AFAAuthOptions} Options + * @returns {Promise} + */ + decrypt(options: AFAAuthOptions): Promise { + let reponse: AFADecryptOptions; + return new Promise((resolve, reject) => { + resolve(reponse); + }); + }; + /** + * Check if service is available + * @returns {Promise} Returns a Promise that resolves if fingerprint auth is available on the device + */ + isAvailable(): Promise<{ + isAvailable: boolean; + isHardwareDetected: boolean; + hasEnrolledFingerprints: boolean; + }> { + let reponse: { isAvailable: boolean, isHardwareDetected: boolean, hasEnrolledFingerprints: boolean} = { isAvailable: true, isHardwareDetected: true, hasEnrolledFingerprints: true }; + return new Promise((resolve, reject) => { + resolve(reponse); + }); + }; + /** + * Delete the cipher used for encryption and decryption by username + * @returns {Promise} Returns a Promise that resolves if the cipher was successfully deleted + */ + delete(options: { + clientId: string; + username: string; + }): Promise<{ + deleted: boolean; + }> { + return new Promise((resolve, reject) => { + resolve(true); + }); + }; +} diff --git a/src/@ionic-native-mocks/plugins/android-full-screen/index.ts b/src/@ionic-native-mocks/plugins/android-full-screen/index.ts new file mode 100644 index 0000000..b94345e --- /dev/null +++ b/src/@ionic-native-mocks/plugins/android-full-screen/index.ts @@ -0,0 +1,88 @@ +import { AndroidFullScreen } from '@ionic-native/android-full-screen'; + +export class AndroidFullScreenMock extends AndroidFullScreen { + /** + * Is this plugin supported? + * @return {Promise} + */ + isSupported(): Promise { + return new Promise((resolve, reject) => { + resolve(null); + }); + }; + + /** + * Is immersive mode supported? + * @return {Promise} + */ + isImmersiveModeSupported(): Promise { + return new Promise((resolve, reject) => { + resolve(null); + }); + }; + /** + * The width of the screen in immersive mode. + * @return {Promise} + */ + immersiveWidth(): Promise { + let response: number; + return new Promise((resolve, reject) => { + resolve(response); + }); + }; + /** + * The height of the screen in immersive mode. + * @return {Promise} + */ + immersiveHeight(): Promise { + let response: number; + return new Promise((resolve, reject) => { + resolve(response); + }); + }; + /** + * Hide system UI until user interacts. + * @return {Promise} + */ + leanMode(): Promise { + return new Promise((resolve, reject) => { + resolve(null); + }); + }; + /** + * Show system UI. + * @return {Promise} + */ + showSystemUI(): Promise { + return new Promise((resolve, reject) => { + resolve(null); + }); + }; + /** + * Extend your app underneath the status bar (Android 4.4+ only). + * @return {Promise} + */ + showUnderStatusBar(): Promise { + return new Promise((resolve, reject) => { + resolve(null); + }); + }; + /** + * Extend your app underneath the system UI (Android 4.4+ only). + * @return {Promise} + */ + showUnderSystemUI(): Promise { + return new Promise((resolve, reject) => { + resolve(null); + }); + }; + /** + * Hide system UI and keep it hidden (Android 4.4+ only). + * @return {Promise} + */ + immersiveMode(): Promise { + return new Promise((resolve, reject) => { + resolve(null); + }); + }; +} diff --git a/src/@ionic-native-mocks/plugins/android-permissions/index.ts b/src/@ionic-native-mocks/plugins/android-permissions/index.ts new file mode 100644 index 0000000..c347524 --- /dev/null +++ b/src/@ionic-native-mocks/plugins/android-permissions/index.ts @@ -0,0 +1,45 @@ +import { AndroidPermissions } from '@ionic-native/android-permissions'; + +export class AndroidPermissionsMock extends AndroidPermissions { + PERMISSION: any; + /** + * Check permission + * @param permission {string} The name of the permission + * @return {Promise} Returns a promise + */ + checkPermission(permission: string): Promise { + return new Promise((resolve, reject) => { + resolve(); + }); + }; + /** + * Request permission + * @param permission {string} The name of the permission to request + * @return {Promise} + */ + requestPermission(permission: string): Promise { + return new Promise((resolve, reject) => { + resolve(); + }); + }; + /** + * Request permissions + * @param permissions {Array} An array with permissions + * @return {Promise} Returns a promise + */ + requestPermissions(permissions: string[]): Promise { + return new Promise((resolve, reject) => { + resolve(); + }); + }; + /** + * This function still works now, will not support in the future. + * @param permission {string} The name of the permission + * @return {Promise} Returns a promise + */ + hasPermission(permission: string): Promise { + return new Promise((resolve, reject) => { + resolve(); + }); + }; +} diff --git a/src/@ionic-native-mocks/plugins/app-availability/index.ts b/src/@ionic-native-mocks/plugins/app-availability/index.ts new file mode 100644 index 0000000..9bad567 --- /dev/null +++ b/src/@ionic-native-mocks/plugins/app-availability/index.ts @@ -0,0 +1,15 @@ +import { AppAvailability } from '@ionic-native/app-availability'; + +export class AppAvailabilityMock extends AppAvailability { + /** + * Checks if an app is available on device + * @param {string} app Package name on android, or URI scheme on iOS + * @returns {Promise} + */ + check(app: string): Promise { + let response: boolean; + return new Promise((resolve, reject) => { + resolve(response); + }); + }; +} diff --git a/src/@ionic-native-mocks/plugins/app-minimize/index.ts b/src/@ionic-native-mocks/plugins/app-minimize/index.ts new file mode 100644 index 0000000..d4457da --- /dev/null +++ b/src/@ionic-native-mocks/plugins/app-minimize/index.ts @@ -0,0 +1,13 @@ +import { AppMinimize } from '@ionic-native/app-minimize'; + +export class AppMinimizeMock extends AppMinimize { + /** + * Minimizes the application + * @return {Promise} + */ + minimize(): Promise { + return new Promise((resolve, reject) => { + resolve(); + }); + }; +} diff --git a/src/@ionic-native-mocks/plugins/app-update/index.ts b/src/@ionic-native-mocks/plugins/app-update/index.ts new file mode 100644 index 0000000..ede8b15 --- /dev/null +++ b/src/@ionic-native-mocks/plugins/app-update/index.ts @@ -0,0 +1,14 @@ +import { AppUpdate } from '@ionic-native/app-update'; + +export class AppUpdateMock extends AppUpdate { + /** + * Check and update + * @param updateUrl {string} update api url + * @return {Promise} Returns a promise that resolves when something happens + */ + checkAppUpdate(updateUrl: string): Promise { + return new Promise((resolve, reject) => { + resolve(); + }); + }; +} diff --git a/src/@ionic-native-mocks/plugins/appodeal/index.ts b/src/@ionic-native-mocks/plugins/appodeal/index.ts new file mode 100644 index 0000000..16e1abe --- /dev/null +++ b/src/@ionic-native-mocks/plugins/appodeal/index.ts @@ -0,0 +1,402 @@ +import { Appodeal } from '@ionic-native/appodeal'; +import { Observable } from 'rxjs/Observable'; +import { Observer } from 'rxjs/Observer'; + +export class AppodealMock extends Appodeal { + readonly AD_TYPES: { + INTERSTITIAL: number; + SKIPPABLE_VIDEO: number; + BANNER: number; + BANNER_BOTTOM: number; + BANNER_TOP: number; + REWARDED_VIDEO: number; + NON_SKIPPABLE_VIDEO: number; + }; + /** + * initialize Appodeal SDK + * @param {string} appKey + * @param {number} adType + */ + initialize(appKey: string, adType: number): void { }; + /** + * check if SDK has been initialized + * @returns {Promise} + */ + isInitialized(): Promise { + return new Promise((resolve, reject) => { + resolve(); + }); + }; + /** + * show ad of specified type + * @param {number} adType + * @returns {Promise} + */ + show(adType: number): Promise { + return new Promise((resolve, reject) => { + resolve(); + }); + }; + /** + * show ad of specified type with placement options + * @param {number} adType + * @param {any} placement + * @returns {Promise} + */ + showWithPlacement(adType: number, placement: any): Promise { + return new Promise((resolve, reject) => { + resolve(); + }); + }; + /** + * hide ad of specified type + * @param {number} adType + */ + hide(adType: number): void { }; + /** + * confirm use of ads of specified type + * @param {number} adType + */ + confirm(adType: number): void { }; + /** + * check if ad of specified type has been loaded + * @param {number} adType + * @returns {Promise} + */ + isLoaded(adType: number): Promise { + return new Promise((resolve, reject) => { + resolve(); + }); + }; + /** + * check if ad of specified + * @param {number} adType + * @returns {Promise} + */ + isPrecache(adType: number): Promise { + return new Promise((resolve, reject) => { + resolve(); + }); + }; + /** + * + * @param {number} adType + * @param autoCache + */ + setAutoCache(adType: number, autoCache: any): void { }; + /** + * forcefully cache an ad by type + * @param {number} adType + */ + cache(adType: number): void { }; + /** + * + * @param {boolean} set + */ + setOnLoadedTriggerBoth(set: boolean): void { }; + /** + * enable or disable Smart Banners + * @param {boolean} enabled + */ + setSmartBanners(enabled: boolean): void { }; + /** + * enable or disable banner backgrounds + * @param {boolean} enabled + */ + setBannerBackground(enabled: boolean): void { }; + /** + * enable or disable banner animations + * @param {boolean} enabled + */ + setBannerAnimation(enabled: boolean): void { }; + /** + * + * @param value + */ + set728x90Banners(value: any): void { }; + /** + * enable or disable logging + * @param {boolean} logging + */ + setLogging(logging: boolean): void { }; + /** + * enable or disable testing mode + * @param {boolean} testing + */ + setTesting(testing: boolean): void { }; + /** + * reset device ID + */ + resetUUID(): void { }; + /** + * get version of Appdeal SDK + */ + getVersion(): Promise { + return new Promise((resolve, reject) => { + resolve(); + }); + }; + /** + * + * @param {string} network + * @param {number} adType + */ + disableNetwork(network?: string, adType?: number): void { }; + /** + * + * @param {string} network + * @param {number} adType + */ + disableNetworkType(network?: string, adType?: number): void { }; + /** + * disable Location permissions for Appodeal SDK + */ + disableLocationPermissionCheck(): void { }; + /** + * disable Storage permissions for Appodeal SDK + */ + disableWriteExternalStoragePermissionCheck(): void { }; + /** + * enable event listeners + * @param {boolean} enabled + */ + enableInterstitialCallbacks(enabled: boolean): void { }; + /** + * enable event listeners + * @param {boolean} enabled + */ + enableSkippableVideoCallbacks(enabled: boolean): void { }; + /** + * enable event listeners + * @param {boolean} enabled + */ + enableNonSkippableVideoCallbacks(enabled: boolean): void { }; + /** + * enable event listeners + * @param {boolean} enabled + */ + enableBannerCallbacks(enabled: boolean): void { }; + /** + * enable event listeners + * @param {boolean} enabled + */ + enableRewardedVideoCallbacks(enabled: boolean): void { }; + /** + * + * @param {string} name - name of rule + * @param {boolean} value + */ + setCustomBooleanRule(name: string, value: boolean): void { }; + /** + * + * @param {string} name - name of rule + * @param {number} value + */ + setCustomIntegerRule(name: string, value: number): void { }; + /** + * set rule with float value + * @param {string} name + * @param {number} value + */ + setCustomDoubleRule(name: string, value: number): void { }; + /** + * set rule with string value + * @param {string} name - name of rule + * @param {string} value + */ + setCustomStringRule(name: string, value: string): void { }; + /** + * set ID preference in Appodeal for current user + * @param id + */ + setUserId(id: any): void { }; + /** + * set Email preference in Appodeal for current user + * @param email + */ + setEmail(email: any): void { }; + /** + * set Birthday preference in Appodeal for current user + * @param birthday + */ + setBirthday(birthday: any): void { }; + /** + * et Age preference in Appodeal for current user + * @param age + */ + setAge(age: any): void { }; + /** + * set Gender preference in Appodeal for current user + * @param gender + */ + setGender(gender: any): void { }; + /** + * set Occupation preference in Appodeal for current user + * @param occupation + */ + setOccupation(occupation: any): void { }; + /** + * set Relation preference in Appodeal for current user + * @param relation + */ + setRelation(relation: any): void { }; + /** + * set Smoking preference in Appodeal for current user + * @param smoking + */ + setSmoking(smoking: any): void { }; + /** + * set Alcohol preference in Appodeal for current user + * @param alcohol + */ + setAlcohol(alcohol: any): void { }; + /** + * set Interests preference in Appodeal for current user + * @param interests + */ + setInterests(interests: any): void { }; + onInterstitialLoaded(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onInterstitialFailedToLoad(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onInterstitialShown(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onInterstitialClicked(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onInterstitialClosed(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onSkippableVideoLoaded(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onSkippableVideoFailedToLoad(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onSkippableVideoShown(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onSkippableVideoFinished(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onSkippableVideoClosed(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onRewardedVideoLoaded(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onRewardedVideoFailedToLoad(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onRewardedVideoShown(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onRewardedVideoFinished(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onRewardedVideoClosed(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onNonSkippableVideoLoaded(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onNonSkippableVideoFailedToLoad(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onNonSkippableVideoShown(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onNonSkippableVideoFinished(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onNonSkippableVideoClosed(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onBannerClicked(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onBannerFailedToLoad(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onBannerLoaded(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; + onBannerShown(): Observable { + return Observable.create((observer: Observer) => { + observer.next(''); + observer.complete(); + }); + }; +} diff --git a/src/@ionic-native-mocks/plugins/autostart/index.ts b/src/@ionic-native-mocks/plugins/autostart/index.ts new file mode 100644 index 0000000..44ec7c3 --- /dev/null +++ b/src/@ionic-native-mocks/plugins/autostart/index.ts @@ -0,0 +1,12 @@ +import { Autostart } from '@ionic-native/autostart'; + +export class AutostartMock extends Autostart { + /** + * Enable the automatic startup after the boot + */ + enable(): void {}; + /** + * Disable the automatic startup after the boot + */ + disable(): void {}; +}