Skip to content

Commit

Permalink
feat(pro): support corova-plugin-ionic v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuiste committed Oct 12, 2017
1 parent 773722b commit 975f08b
Showing 1 changed file with 29 additions and 26 deletions.
55 changes: 29 additions & 26 deletions src/@ionic-native/plugins/pro/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, CordovaInstance, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';

/**
* Information about the currently running app
Expand All @@ -21,6 +22,15 @@ export interface DeployInfo {
binary_version: string;
}

/**
* Object for manually configuring deploy
*/
export interface DeployConfig {
appId?: string;
host?: string;
channel?: string;
}

/**
* @hidden
*/
Expand All @@ -30,68 +40,61 @@ export class ProDeploy {

/**
* Re-initialize Deploy plugin with a new App ID and host. Not used in most cases.
* @param appId An Ionic Pro app ID
* @param host An Ionic Pro live update API
* @param config A valid Deploy config object
*/
@CordovaInstance()
init(appId: string, host: string): Promise<any> { return; }

@CordovaInstance()
debug(): Promise<any> { return; }

@CordovaInstance()
clearDebug(): Promise<any> { return; }
init(config: DeployConfig): Promise<any> { return; }

/**
* Check a channel for an available update
* @param appId An Ionic Pro app ID
* @param channelName An Ionic Pro channel name
* @return {Promise<string>} Resolves with 'true' or 'false', or rejects with an error.
*/
@CordovaInstance()
check(appId: string, channelName: string): Promise<any> { return; }
@CordovaInstance({
observable: true
})
check(): Promise<string> { return; }

/**
* Download an available version
* @param appId An Ionic Pro app ID
* @return {Observable<any>} Updates with percent completion, or errors with a message.
*/
@CordovaInstance()
download(appId: string): Promise<any> { return; }
@CordovaInstance({
observable: true
})
download(): Observable<any> { return; }

/**
* Unzip the latest downloaded version
* @param appId An Ionic Pro app ID
* @return {Observable<any>} Updates with percent completion, or errors with a message.
*/
@CordovaInstance()
extract(appId: string): Promise<any> { return; }
extract(): Observable<any> { return; }

/**
* Reload app with the deployed version
* @param appId An Ionic Pro app ID
*/
@CordovaInstance()
redirect(appId: string): Promise<any> { return; }
redirect(): Promise<any> { return; }

/**
* Get info about the version running on the device
* @param appId An Ionic Pro app ID
* @return {Promise<DeployInfo>} Information about the current version running on the app.
*/
@CordovaInstance()
info(appId: string): Promise<DeployInfo> { return; }
info(): Promise<DeployInfo> { return; }

/**
* List versions stored on the device
* @param appId An Ionic Pro app ID
*/
@CordovaInstance()
getVersions(appId: string): Promise<any> { return; }
getVersions(): Promise<any> { return; }

/**
* Delete a version stored on the device by UUID
* @param appId An Ionic Pro app ID
* @param version A version UUID
*/
@CordovaInstance()
deleteVersion(appId: string, version: string): Promise<any> { return; }
deleteVersion(version: string): Promise<any> { return; }
}

/**
Expand Down

0 comments on commit 975f08b

Please sign in to comment.