merge master into v5

This commit is contained in:
Daniel 2018-09-25 20:29:32 +02:00
parent 0422521db6
commit 89a5ca7ec5
5 changed files with 400 additions and 5 deletions

View File

@ -0,0 +1,116 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface EncryptedCardData {
activationData: string;
encryptedPassData: string;
wrappedKey: string;
}
export interface CardData {
cardholderName: string;
primaryAccountNumberSuffix: string;
localizedDescription?: string;
paymentNetwork: string;
}
/**
* @name Apple Wallet
* @description
* A Cordova plugin that enables users from Add Payment Cards to their Apple Wallet.
*
* @usage
* ```typescript
* import { AppleWallet } from '@ionic-native/apple-wallet';
*
*
* constructor(private appleWallet: AppleWallet) { }
*
* ...
*
*
* this.appleWallet.available()
* .then((res) => {
* // res is a boolean value, either true or false
* console.log("Is Apple Wallet available? ", res);
* })
* .catch((message) => {
* console.error("ERROR AVAILBLE>> ", message);
* });
*
* ...
*
* let data: cardData = {
* cardholderName: 'Test User',
* primaryAccountNumberSuffix: '1234',
* localizedDescription: 'Description of payment card',
* paymentNetwork: 'VISA'
* }
*
* this.appleWallet.startAddPaymentPass(data: cardData)
* .then((res) => {
* console.log("startAddPaymentPass success response ", res);
* })
* .catch((err) => {
* console.error("startAddPaymentPass ERROR response", err);
* });
*
* ...
*
* let data: encryptedCardData = {
* activationData: 'encoded Base64 activationData from your server',
* encryptedPassData: 'encoded Base64 encryptedPassData from your server',
* wrappedKey: 'encoded Base64 wrappedKey from your server',
* }
*
* this.appleWallet.encryptedCardData(data: encryptedCardData)
* .then((res) => {
* console.log("completeAddCardToAppleWallet success response ", res);
* })
* .catch((err) => {
* console.error("completeAddCardToAppleWallet ERROR response", err);
* });
*
* ```
* @Interfaces
* EncryptedCardData
* CardData
*/
@Plugin({
pluginName: 'AppleWallet',
plugin: 'cordova-apple-wallet',
pluginRef: 'AppleWallet',
repo: 'https://github.com/tomavic/cordova-apple-wallet',
platforms: ['iOS']
})
@Injectable()
export class AppleWallet extends IonicNativePlugin {
/**
* Detects if the current device supports Apple Wallet
* @return {Promise<boolean>} Returns a promise
*/
@Cordova()
available(): Promise<boolean> {
return;
}
/**
* Simple call with the configuration data needed to instantiate a new PKAddPaymentPassViewController object.
* @param {cardData} data
* @return {Promise<any>} Returns a promise
*/
@Cordova()
startAddPaymentPass(data: CardData): Promise<any> {
return;
}
/**
* Simple call contains the card data needed to add a card to Apple Pay.
* @param {encryptedCardData} data
* @return {Promise<any>} Returns a promise
*/
@Cordova()
completeAddPaymentPass(data: EncryptedCardData): Promise<any> {
return;
}
}

View File

@ -13,11 +13,15 @@ export interface SiriShortcutOptions extends SiriShortcut {
isEligibleForPrediction?: boolean;
}
export interface ActivatedShortcutOptions {
clear?: boolean;
}
/**
* @beta
* @name Siri Shortcuts
* @description
* This plugin only works when your app is built with XCode 10 Beta. Shortcuts will only appear on iOS-versions >= 12.0
* This plugin only works when your app is built with XCode 10. Shortcuts will only appear on iOS-versions >= 12.0
*
* This plugin enables the use of Siri shortcuts in Cordova. Siri Shortcuts enable the user to perform certain actions by adding them to Siri.
* After you have donated a shortcut to Siri, it will appear in the settings menu, after which the user is able to add the action. You can check
@ -71,6 +75,7 @@ export interface SiriShortcutOptions extends SiriShortcut {
* @interfaces
* SiriShortcut
* SiriShortcutOptions
* ActivatedShortcutOptions
*/
@Plugin({
pluginName: 'SiriShortcuts',
@ -134,10 +139,12 @@ export class SiriShortcuts extends IonicNativePlugin {
/**
* Get the current clicked user activity, and return `null` if none
* @param {ActivatedShortcutOptions|null} options Options to specify for getting the shortcut
* @param {boolean} options.clear Clear the currently activated shortcut, defaults to true
* @return Promise<SiriShortcut|null>
*/
@Cordova()
getActivatedShortcut(): Promise<SiriShortcut | null> {
getActivatedShortcut(options?: ActivatedShortcutOptions): Promise<SiriShortcut | null> {
return;
}
}

View File

@ -0,0 +1,137 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Sqlite Db Copy
* @description
* This plugin does something
*
* @usage
* ```typescript
* import { SqliteDbCopy } from '@ionic-native/sqlite-db-copy';
*
*
* constructor(private sqliteDbCopy: SqliteDbCopy) { }
*
* ...
*
*
* this.sqliteDbCopy.copy('sample.db', 0)
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* ```
*/
@Plugin({
pluginName: 'cordova-plugin-dbcopy',
plugin: 'cordova-plugin-dbcopy',
pluginRef: 'window.plugins.sqlDB',
repo: 'https://github.com/an-rahulpandey/cordova-plugin-dbcopy',
platforms: ['Android', 'iOS']
})
@Injectable()
export class SqliteDbCopy extends IonicNativePlugin {
/**
* Copy database from www directory to device SQLite DB location
* (for ios only, use 0 for Android)
* location = 0; // (Disable iCloud Backup) If set will copy the database to Library/LocalDatabase. The database will not be synced by the iCloud Backup.
* or
* location = 1; // If set will copy the database to Library folder instead of Documents folder.
* or
* location = 2; // It will copy the database in the default SQLite Database directory. This is the default location for database
* @param dbname {string} Database file name available in www diretory with extension.The plugin will look for and copy the file according to the filename provided here. And the same file name should be used while opening the database via SQLitePlugin
* @param location {number} Location where to copy the database for app (only applicable for ios).For Android pass 0.
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova({
successIndex: 2,
errorIndex: 3
})
copy(dbname: string, location: number): Promise<any> {
return;
}
/**
* Check if database is available at external storage. Useful when trying to copying the database from device sdcard.
* @param dbname {string} Name of the database file which is available on external or intenral storage
* @param source {string} Full native path for the folder in which db file is present. The "/" must be added at the end of path. For.eg. /sdcard/mydb/. Should not include dbname.
* @return {Promise<any>}
*/
@Cordova({
successIndex: 2,
errorIndex: 3
})
checkDbOnStorage(dbname: string, source: string): Promise<any> {
return;
}
/**
* Copy database which is available on the device external/internal storage to app default db location
* (for ios only, use 0 for Android)
* location = 0; // (Disable iCloud Backup) If set will copy the database to Library/LocalDatabase. The database will not be synced by the iCloud Backup.
* or
* location = 1; // If set will copy the database to Library folder instead of Documents folder.
* or
* location = 2; // It will copy the database in the default SQLite Database directory. This is the default location for database
* @param dbname {string} Is the name of the database you want to copy. The plugin will look for and copy the file according to the filename provided here. And the same file name should be used while opening the database via SQLitePlugin
* @param location {number} Location where to copy the database for app (only applicable for ios). For Android pass 0.
* @param source {string} Source File location like /sdcard/mydb/db.db. Please provide a valid existing location and the dbname should be present in the path.
* @param deleteolddb {boolean} A boolean value if set to true, will delete the existing db from the local app database folder before copying the new db. Please provide proper boolean value true or false;
* @return {Promise<any>}
*/
@Cordova({
successIndex: 4,
errorIndex: 5
})
copyDbFromStorage(
dbname: string,
location: number,
source: string,
deleteolddb: boolean
): Promise<any> {
return;
}
/**
* Copy the app database to external/internal storage on the device.
* (for ios only, use 0 for Android)
* location = 0; //It will copy the database from Library/LocalDatabase location.
* or
* location = 1; // It will copy the database from Library folder instead.
* or
* location = 2; // It will copy the database from the default SQLite Database directory. This is the default location for database
* @param dbname {string} Is the name of the database you want to copy. The plugin will look for and copy the file according to the filename provided here. And the same file name should be used while opening the database via SQLitePlugin.
* @param location {number} Location where to copy the database for app (only applicable for ios). For Android pass 0.
* @param destination {string} Destination File location like /sdcard/mydb/ Please provide a valid existing location and "/" should be present at the end of the path. Do not append db name in the path.
* @param overwrite {boolean} If set to true, then will replace the file at the destination. Otherwise will throw an error, if destination file already exists.
* @return {Promise<any>}
*/
@Cordova({
successIndex: 4,
errorIndex: 5
})
copyDbToStorage(
dbname: string,
location: number,
destination: string,
overwrite: boolean
): Promise<any> {
return;
}
/**
* This method allows you to remove the database from the apps default database storage location.
* (for ios only, use 0 for Android)
* location = 0; // (Disable iCloud Backup) If set will copy the database to Library/LocalDatabase. The database will not be synced by the iCloud Backup.
* or
* location = 1; // If set will copy the database to Library folder instead of Documents folder.
* or
* location = 2; // It will copy the database in the default SQLite Database directory. This is the default location for database
* @param dbname {string} Is the name of the database you want to remove. If the database file is having any extension, please provide that also.
* @param location {number} Location where to copy the database for app (only applicable for ios).For Android pass 0.
* @return {Promise<any>}
*/
@Cordova({
successIndex: 2,
errorIndex: 3
})
remove(dbname: string, location: number): Promise<any> {
return;
}
}

View File

@ -33,7 +33,6 @@ import { Injectable } from '@angular/core';
})
@Injectable()
export class TapticEngine extends IonicNativePlugin {
/**
* Use selection feedback generators to indicate a change in selection.
* @returns {Promise<any>} Returns a promise that resolves on success and rejects on error
@ -46,7 +45,7 @@ export class TapticEngine extends IonicNativePlugin {
/**
* Use this to indicate success/failure/warning to the user.
* @param options {Object} should be of the type { type: 'success' } (or 'warning'/'error')
* @param options.type {string}
* @param {'success' | 'warning' | 'error'} options.type
* @returns {Promise<any>} Returns a promise that resolves on success and rejects on error
*/
@Cordova()
@ -57,7 +56,7 @@ export class TapticEngine extends IonicNativePlugin {
/**
* Use this to indicate success/failure/warning to the user.
* @param options {Object} should be of the type { style: 'light' } (or 'medium'/'heavy')
* @param options.type {string}
* @param {'light' | 'medium' | 'heavy'} options.type
* @returns {Promise<any>} Returns a promise that resolves on success and rejects on error
*/
@Cordova()
@ -65,4 +64,30 @@ export class TapticEngine extends IonicNativePlugin {
return;
}
/**
* Tell the taptic engine that a gesture for a selection change is starting.
* @returns {Promise<any>}
*/
@Cordova()
gestureSelectionStart(): Promise<any> {
return;
}
/**
* Tell the taptic engine that a selection changed during a gesture.
* @returns {Promise<any>}
*/
@Cordova()
gestureSelectionChanged(): Promise<any> {
return;
}
/**
* Tell the taptic engine we are done with a gesture. This needs to be called lest resources are not properly recycled.
* @returns {Promise<any>}
*/
@Cordova()
gestureSelectionEnd(): Promise<any> {
return;
}
}

View File

@ -0,0 +1,110 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
export interface Response {
status: number;
body: string;
headers: { [key: string]: string};
}
export interface Request {
requestId: string;
body: string;
headers: string;
method: 'POST' | 'GET' | 'PUT' | 'PATCH' | 'DELETE';
path: string;
query: string;
}
/**
* @name Web Server
* @description
* This plugin allows you to start a local dynamic content web server for android and iOS devices.
*
* @usage
* ```typescript
* import { WebServer } from '@ionic-native/web-server';
*
*
* constructor(private webServer: WebServer) { }
*
* ...
*
* this.webServer.onRequest().subscribe(data => {
* console.log(data);
* const res: Response = {
* status: 200,
* body: '',
* headers: {
* 'Content-Type': 'text/html'
* }
* };
*
* this.webServer.sendResponse(data.requestId, res)
* .catch((error: any) => console.error(error));
* });
*
* this.webServer.start(80)
* .catch((error: any) => console.error(error));
*
* ```
*
* @interfaces
* Response
* Request
*/
@Plugin({
pluginName: 'WebServer',
plugin: 'cordova-plugin-webserver',
pluginRef: 'window.webserver',
repo: 'https://github.com/bykof/cordova-plugin-webserver.git',
platforms: ['Android', 'iOS']
})
@Injectable()
export class WebServer extends IonicNativePlugin {
/**
* This method will start your webserver.
* @param port {number} Port number (default to 8080)
*/
@Cordova({
callbackOrder: 'reverse',
})
start(port?: number): Promise<any> {
return;
}
/**
* This method will stop your webserver.
*/
@Cordova()
stop(): Promise<any> {
return;
}
/**
* This method returns an observable that streams HTTP requests to an observer.
* @return {Observable<Request>} Returns an observable to resolve as a Request object
*/
@Cordova({
callbackOrder: 'reverse',
observable: true,
clearFunction: 'stop'
})
onRequest(): Observable<Request> {
return;
}
/**
* This method sends a response to a request.
* @param requestId {string} Request ID to respond to
* @param responseObject {Response} Response object
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova()
sendResponse(requestId: string, responseObject: Response): Promise<any> {
return;
}
}