style(unvired-cordova-sdk): fix style

This commit is contained in:
Srinidhi Anand Rao 2019-07-05 15:16:14 +05:30
parent afe95a6752
commit 55fb503d81

View File

@ -84,9 +84,9 @@ export enum LoginType {
* If you plan to authenticate using Unvired ID, you need to send the following parameters: * If you plan to authenticate using Unvired ID, you need to send the following parameters:
* ``` * ```
* loginParameters.username = 'USER_NAME' * loginParameters.username = 'USER_NAME'
loginParameters.password = 'password' * loginParameters.password = 'password'
loginParameters.company = 'unvired' * loginParameters.company = 'unvired'
loginParameters.loginType = LoginType.unvired * loginParameters.loginType = LoginType.unvired
* ``` * ```
*/ */
unvired = 'UNVIRED_ID', unvired = 'UNVIRED_ID',
@ -95,11 +95,11 @@ export enum LoginType {
* Example: * Example:
* If you plan to authenticate using Unvired ID, you need to send the following parameters: * If you plan to authenticate using Unvired ID, you need to send the following parameters:
* ``` * ```
loginParameters.username = 'USER_NAME' * loginParameters.username = 'USER_NAME'
loginParameters.password = 'password' * loginParameters.password = 'password'
loginParameters.company = 'unvired' * loginParameters.company = 'unvired'
loginParameters.domain = 'ADS_DOMAIN' * loginParameters.domain = 'ADS_DOMAIN'
loginParameters.loginType = LoginType.ads * loginParameters.loginType = LoginType.ads
* ``` * ```
*/ */
ads = 'ADS', ads = 'ADS',
@ -109,11 +109,11 @@ export enum LoginType {
* If you plan to authenticate using Unvired ID, you need to send the following parameters: * If you plan to authenticate using Unvired ID, you need to send the following parameters:
* ``` * ```
* loginParameters.username = 'USER_NAME' * loginParameters.username = 'USER_NAME'
loginParameters.password = 'password' * loginParameters.password = 'password'
loginParameters.company = 'unvired' * loginParameters.company = 'unvired'
loginParameters.port = 'SAP_PORT_NAME' * loginParameters.port = 'SAP_PORT_NAME'
loginParameters.domain = 'SAP_DOMAIN' * loginParameters.domain = 'SAP_DOMAIN'
loginParameters.loginType = LoginType.sap * loginParameters.loginType = LoginType.sap
* ``` * ```
*/ */
sap = 'SAP', sap = 'SAP',
@ -369,11 +369,13 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
/** /**
* Write debug logs. * Write debug logs.
* @param sourceClass * @param sourceClass Name of the class
* @param method * @param method Name of the method
* @param message * @param message The actual message
* Example: * Example:
* ```
* this.unviredSDK.logDebug("Class Name", "Method Name", "Log Message") * this.unviredSDK.logDebug("Class Name", "Method Name", "Log Message")
* ```
* would produce the log message like this * would produce the log message like this
* 01-07-2019 15:52 | DEBUG | Class Name | Method Name | Log Message * 01-07-2019 15:52 | DEBUG | Class Name | Method Name | Log Message
*/ */
@ -384,9 +386,9 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
/** /**
* Write error logs. * Write error logs.
* @param sourceClass * @param sourceClass Name of the class
* @param method * @param method Name of the method
* @param message * @param message The actual message
* Example: * Example:
* this.unviredSDK.logError("Class Name", "Method Name", "Log Message") * this.unviredSDK.logError("Class Name", "Method Name", "Log Message")
* would produce the log message like this * would produce the log message like this
@ -399,9 +401,9 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
/** /**
* Write Info logs. * Write Info logs.
* @param sourceClass * @param sourceClass Name of the class
* @param method * @param method Name of the method
* @param message * @param message The actual message
* Example: * Example:
* this.unviredSDK.logInfo("Class Name", "Method Name", "Log Message") * this.unviredSDK.logInfo("Class Name", "Method Name", "Log Message")
* would produce the log message like this * would produce the log message like this
@ -445,16 +447,16 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* This api initializes the Unvired Application. * This api initializes the Unvired Application.
* @param loginParameters Set of parameters to be passed the login() * @param loginParameters Set of parameters to be passed the login()
* For Example: * For Example:
* ``` * ```
* let loginParameters = new LoginParameters() * let loginParameters = new LoginParameters()
* loginParameters.appName = 'UNVIRED_DIGITAL_FORMS' * loginParameters.appName = 'UNVIRED_DIGITAL_FORMS'
* loginParameters.metadataPath = '../assets/metadata.json' * loginParameters.metadataPath = '../assets/metadata.json'
* loginParameters.loginType = LoginType.unvired * loginParameters.loginType = LoginType.unvired
* ``` * ```
*/ */
@Cordova() @Cordova()
login(loginParameters: LoginParameters): Promise<LoginResult> { login(loginParameters: LoginParameters): Promise<LoginResult> {
return; return;
@ -501,8 +503,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* Returns all the accounts configured on the device. * Get all the accounts configured on the device.
* TODO
*/ */
@Cordova() @Cordova()
getAllAccounts(): Promise<any> { getAllAccounts(): Promise<any> {
@ -510,7 +511,8 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Switch account
* @param account The account to switch to
*/ */
@Cordova() @Cordova()
switchAccount(account: any): Promise<any> { switchAccount(account: any): Promise<any> {
@ -518,7 +520,8 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Delete account
* @param account The account to delete
*/ */
@Cordova() @Cordova()
deleteAccount(account: any): Promise<any> { deleteAccount(account: any): Promise<any> {
@ -526,7 +529,9 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Get all InfoMessages linked to the header.
* @param headerName Name of the header. Example: CUSTOMER_HEADER
* @param lid LID of the header.
*/ */
@Cordova() @Cordova()
getInfoMessages(headerName: string, lid: string): Promise<any> { getInfoMessages(headerName: string, lid: string): Promise<any> {
@ -534,7 +539,8 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Supported for iOS, Android & Windows Platforms.
* Display framework settings.
*/ */
@Cordova() @Cordova()
showSettings(): Promise<any> { showSettings(): Promise<any> {
@ -542,7 +548,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Get User settings.
*/ */
@Cordova() @Cordova()
userSettings(): Promise<any> { userSettings(): Promise<any> {
@ -550,7 +556,8 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Update System Credential
* @param credentials The credential to update to
*/ */
@Cordova() @Cordova()
updateSystemCredentials(credentials: any): Promise<any> { updateSystemCredentials(credentials: any): Promise<any> {
@ -558,7 +565,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Get all system credentials.
*/ */
@Cordova() @Cordova()
getSystemCredentials(): Promise<any> { getSystemCredentials(): Promise<any> {
@ -566,7 +573,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Get version number of unvired-cordova-sdk.
*/ */
@Cordova() @Cordova()
getVersionNumbers(): Promise<any> { getVersionNumbers(): Promise<any> {
@ -574,7 +581,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Delete all data from the device.
*/ */
@Cordova() @Cordova()
clearData(): Promise<any> { clearData(): Promise<any> {
@ -582,7 +589,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Check whether the device has internet.
*/ */
@Cordova() @Cordova()
hasInternet(): Promise<any> { hasInternet(): Promise<any> {
@ -590,7 +597,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Get a random id to use as guid.
*/ */
@Cordova() @Cordova()
guid() { guid() {
@ -602,7 +609,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
*/ */
@Cordova() @Cordova()
pullDb(): Promise<any> { pullDb(): Promise<any> {
return return;
} }
/** /**
@ -610,7 +617,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
*/ */
@Cordova() @Cordova()
pushDb(): Promise<any> { pushDb(): Promise<any> {
return return;
} }
/** /**
@ -621,14 +628,19 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
* ``` * ```
* {'F_NAME':'TARAK','EMP_NO':'0039'} * {'F_NAME':'TARAK','EMP_NO':'0039'}
* ``` * ```
*/ */
@Cordova() @Cordova()
dbSelect(tableName: string, whereClause: string): Promise<DbResult> { dbSelect(tableName: string, whereClause: any): Promise<DbResult> {
return; return;
} }
/** /**
* TODO * Insert record into database.
* In browser platform this function always inserts or updates based on GID.
* Example - this.unviredsdk.dbInsert("CUSTOMER_HEADER",{"NAME":"TARAK","NO":"0039"....},true);
* @param tableName Name of the table.
* @param structureObject - JSON object containing name-value pairs.
* @param isHeader - is DataStructure a header or item?
*/ */
@Cordova() @Cordova()
dbInsert(tableName: string, structureObject: any, isHeader: boolean): Promise<DbResult> { dbInsert(tableName: string, structureObject: any, isHeader: boolean): Promise<DbResult> {
@ -636,10 +648,12 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * insert or update the record ( if record exists ) into database.
* @param tableName * In browser insert always inserts or updates based on gid
* @param structureObject * Example - this.unviredsdk.dbInsertOrUpdate("CUSTOMER_HEADER",{"NAME":"TARAK","NO":"0039"....},true);
* @param isHeader * @param tableName Name of the table
* @param structureObject - JSON object containing name-value pairs.
* @param isHeader - is DataStructure a header or item?
*/ */
@Cordova() @Cordova()
dbInsertOrUpdate(tableName: string, structureObject: any, isHeader: boolean): Promise<DbResult> { dbInsertOrUpdate(tableName: string, structureObject: any, isHeader: boolean): Promise<DbResult> {
@ -647,23 +661,31 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Delete records from the database.
* @param tableName * @param tableName Name of the table
* @param whereClause * @param whereClause JSON object containing name-value pairs.
* Example:
* ```
* {'F_NAME':'TARAK','EMP_NO':'0039'}
* ```
*/ */
@Cordova() @Cordova()
dbDelete(tableName: string, whereClause: string): Promise<DbResult> { dbDelete(tableName: string, whereClause: any): Promise<DbResult> {
return; return;
} }
/** /**
* TODO * Update records in database.
* @param tableName * @param tableName Name of the table
* @param updatedObject * @param updatedObject JSON object containing name-value pairs.
* @param whereClause * @param whereClause JSON object containing name-value pairs.
* Example:
* ```
* {'F_NAME':'TARAK','EMP_NO':'0039'}
* ```
*/ */
@Cordova() @Cordova()
dbUpdate(tableName: string, updatedObject: any, whereClause: string): Promise<DbResult> { dbUpdate(tableName: string, updatedObject: any, whereClause: any): Promise<DbResult> {
return; return;
} }
@ -678,8 +700,9 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Supported in iOS, Android & Windows only.
* @param savePoint * Create Savepoint
* @param savePoint Name of savepoint
*/ */
@Cordova() @Cordova()
dbCreateSavePoint(savePoint: string): Promise<DbResult> { dbCreateSavePoint(savePoint: string): Promise<DbResult> {
@ -687,8 +710,9 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Supported in iOS, Android & Windows only.
* @param savePoint * Release Savepoint
* @param savePoint Name of savepoint
*/ */
@Cordova() @Cordova()
dbReleaseSavePoint(savePoint: string): Promise<DbResult> { dbReleaseSavePoint(savePoint: string): Promise<DbResult> {
@ -696,8 +720,9 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Supported in iOS, Android & Windows only.
* @param savePoint * Rollback Savepoint
* @param savePoint Name of the savepoint
*/ */
@Cordova() @Cordova()
dbRollbackToSavePoint(savePoint: string): Promise<DbResult> { dbRollbackToSavePoint(savePoint: string): Promise<DbResult> {
@ -705,7 +730,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Begin database transaction.
*/ */
@Cordova() @Cordova()
dbBeginTransaction(): Promise<any> { dbBeginTransaction(): Promise<any> {
@ -713,7 +738,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * End database transaction.
*/ */
@Cordova() @Cordova()
dbEndTransaction(): Promise<any> { dbEndTransaction(): Promise<any> {
@ -721,7 +746,9 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Supported in Android & Windows only.
* Launch a file from a file path
* @param filePath file path
*/ */
@Cordova() @Cordova()
launchFile(filePath: string): Promise<any> { launchFile(filePath: string): Promise<any> {
@ -729,7 +756,8 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Supported in Android & Windows only.
* Write Base64 string to a file and launch.
*/ */
@Cordova() @Cordova()
launchBase64(base64string: string, fileName: string, extension: string): Promise<any> { launchBase64(base64string: string, fileName: string, extension: string): Promise<any> {
@ -737,7 +765,8 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Supported in Windows Only
* Unzip file.
*/ */
@Cordova() @Cordova()
unzip(srcPath: string, destPath: string) { unzip(srcPath: string, destPath: string) {
@ -745,7 +774,8 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Get the path for the folder where attachments are stored.
* Apps can combine this with the attachment filename to construct absolute path to an attachment file.
*/ */
@Cordova() @Cordova()
getAttachmentFolderPath(): Promise<any> { getAttachmentFolderPath(): Promise<any> {
@ -753,7 +783,13 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Copy attachment file to application folder and insert attachment item to database with updated local path.
* @param tableName Table name of attachment item.
* @param structureObject JSON object containing name-value pairs.
* Example:
* ```
* {'F_NAME':'TARAK','EMP_NO':'0039'}
* ```
*/ */
@Cordova() @Cordova()
createAttachmentItem(tableName: string, structureObject: any): Promise<any> { createAttachmentItem(tableName: string, structureObject: any): Promise<any> {
@ -761,7 +797,10 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Upload attachment item to server.
* @param tableName Table name of attachment item.
* @param structureObject JSON object containing name-value pairs.
* @param isAsync Flag which indicates whether the upload should happen in async.
*/ */
@Cordova() @Cordova()
uploadAttachment(tableName: string, structureObject: any, isAsync: boolean): Promise<any> { uploadAttachment(tableName: string, structureObject: any, isAsync: boolean): Promise<any> {
@ -769,7 +808,9 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
} }
/** /**
* TODO * Download attachment from server.
* @param tableName Table name of attachment item.
* @param structureObject JSON object containing name-value pairs.
*/ */
@Cordova() @Cordova()
downloadAttachment(tableName: string, structureObject: any): Promise<any> { downloadAttachment(tableName: string, structureObject: any): Promise<any> {
@ -789,11 +830,11 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
* @param customData This depends on the PA function. This is useful if you want to send custom data to a PA function. * @param customData This depends on the PA function. This is useful if you want to send custom data to a PA function.
* Example: You can also use this parameter to send header datastrucrture provided the data structure is formatted like this. * Example: You can also use this parameter to send header datastrucrture provided the data structure is formatted like this.
* ``` * ```
{ * {
"CATEGORY_BE": [{ * "CATEGORY_BE": [{
"CATEGORY_HEADER": {field_name : field_value,...} * "CATEGORY_HEADER": {field_name : field_value,...}
}] * }]
} * }
* ``` * ```
* @param paFunction Name of the Process Agent function to be executed. Example: PA_MOBILE_EXECUTE_SALES_ORDER. * @param paFunction Name of the Process Agent function to be executed. Example: PA_MOBILE_EXECUTE_SALES_ORDER.
* @param autoSave This defines whether to save the response to database. * @param autoSave This defines whether to save the response to database.
@ -815,17 +856,17 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
* ``` * ```
* @param customData This depends on the PA function. This is useful if you want to send custom data to a PA function. * @param customData This depends on the PA function. This is useful if you want to send custom data to a PA function.
* Example: You can also use this parameter to send header datastrucrture provided the data structure is formatted like this. * Example: You can also use this parameter to send header datastrucrture provided the data structure is formatted like this.
``` * ```
{ * {
"CATEGORY_BE": [{ * "CATEGORY_BE": [{
"CATEGORY_HEADER": {field_name : field_value,...} * "CATEGORY_HEADER": {field_name : field_value,...}
}] * }]
} * }
* ``` * ```
* @param paFunction Name of the Process Agent function to be executed. Example: PA_MOBILE_EXECUTE_SALES_ORDER. * @param paFunction Name of the Process Agent function to be executed. Example: PA_MOBILE_EXECUTE_SALES_ORDER.
* @param beName * @param beName Name of the Business Entity
* @param belid * @param belid LID of the Header datastructure
* @param bypassAttachment * @param bypassAttachment Set this flag to false if you want to upload attachments first and then make the server call.
*/ */
@Cordova() @Cordova()
syncBackground(reqype: RequestType, header: any, customData: any, paFunction: string, beName: string, belid: string, bypassAttachment: boolean): Promise<SyncResult> { syncBackground(reqype: RequestType, header: any, customData: any, paFunction: string, beName: string, belid: string, bypassAttachment: boolean): Promise<SyncResult> {
@ -835,11 +876,10 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
/** /**
* For Browser platform only. * For Browser platform only.
* Reinitialize web db. Use this api to initialize db from persisted local storage db * Reinitialize web db. Use this api to initialize db from persisted local storage db
* TODO:
*/ */
@Cordova() @Cordova()
dbReload() { dbReload() {
return return;
} }
/** /**
@ -857,9 +897,9 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
/** /**
* For Browser platform only. * For Browser platform only.
* parseRawUBJson - Parse response json returned from syncForeground api. * parseRawUBJson - Parse response json returned from syncForeground api.
* @param json JSON string * @param json JSON string
*/ */
@Cordova() @Cordova()
parseRawUBJson(json: string) { parseRawUBJson(json: string) {
return; return;
@ -927,7 +967,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
* Supported in iOS, Android & Windows only * Supported in iOS, Android & Windows only
* Checks whether a Header datastructure is in sent and is waiting for response. * Checks whether a Header datastructure is in sent and is waiting for response.
* Typically you would use before allowing the user to update the Header datastructure. * Typically you would use before allowing the user to update the Header datastructure.
* @param beLid * @param beLid LID of the Business Entity
*/ */
@Cordova() @Cordova()
isInSentItem(beLid: string): Promise<UnviredResult> { isInSentItem(beLid: string): Promise<UnviredResult> {
@ -955,7 +995,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
/** /**
* Supported in iOS, Android & Windows only * Supported in iOS, Android & Windows only
* Delete outbox entry for a Header datastructure. * Delete outbox entry for a Header datastructure.
* @param beLid * @param beLid LID of the Business Entity
*/ */
@Cordova() @Cordova()
deleteOutBoxEntry(beLid: string): Promise<any> { deleteOutBoxEntry(beLid: string): Promise<any> {