UNPKG

cordova-plugin-mas-core

Version:
126 lines (102 loc) 6.78 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Source: MASPlugin.js</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Source: MASPlugin.js</h1> <section> <article> <pre class="prettyprint source linenums"><code>/* * Copyright (c) 2016 CA, Inc. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ var MASPluginMAS = require("./MASPluginMAS"), MASPluginUser = require("./MASPluginUser"), MASPluginGroup = require("./MASPluginGroup"), MASPluginDevice = require("./MASPluginDevice"), MASPluginApplication = require("./MASPluginApplication"), MASPluginAuthProviders = require("./MASPluginAuthProviders"), MASPluginMultipartForm = require("./MASPluginMultipartForm"); var MASPluginConstants = require("./MASPluginConstants"); var MASPluginSecurityConfiguration = require("./MASPluginSecurityConfiguration"); /** * @class MASPlugin * @hideconstructor * @classdesc The parent MASFoundation factory class to get objects of MAS Core classes. * @example * &lt;caption>To get instance of {@link MASPluginMAS} : An interface that is mapped to MAS Model of Native and controls MAS Process Lifecycle&lt;/caption> var MAS = new MASPlugin.MAS(); * @example * &lt;caption>To get instance of {@link MASPluginUser} : An interface that is mapped to MASUser Model of Native and controls MASUser Lifecycle&lt;/caption> MASPlugin.MASUser.currentUser(successHandler(theUser),errorHandler(error)); //The theUser provided in the successHandler is the final populated user received after login. * @example * &lt;caption>To get instance of {@link MASPluginDevice} : An interface that is mapped to MASDevice Model of Native and controls MASDevice Lifecycle&lt;/caption> var MASDevice = new MASPlugin.MASDevice(); * @example * &lt;caption>To get instance of {@link MASPluginApplication} : An interface that is mapped to MASApplication Model of Native and controls MASApplication Lifecycle&lt;/caption> var MASApplication = new MASPlugin.MASApplication(); * @example * &lt;caption>To get instance of {@link MASPluginAuthProviders} : An interface that is mapped to MASAuthenticationProviders Model of Native&lt;/caption> var MASAuthenticationProviders = new MASPlugin.MASAuthenticationProviders(); * @example * &lt;caption>To get instance of {@link MASPluginSecurityConfiguration} : An interface that is mapped to MASSecurityConfiguration Model of Native&lt;/caption> var MASSecurityConfiguration = new MASPlugin.MASSecurityConfiguration(); * @example * &lt;caption>To get instance of {@link MASPluginMultipartForm} : An interface that is mapped to MASMultipartForm Model of Native&lt;/caption> var MASMultipartForm = new MASPlugin.MASPluginMultipartForm(); */ var MASPlugin = { MASGrantFlow: MASPluginConstants.MASGrantFlow, MASRequestResponseType: MASPluginConstants.MASRequestResponseType, MASAuthenticationStatus: MASPluginApplication.MASAuthenticationStatus, MAS: MASPluginMAS, MASUser: MASPluginUser, MASGroup: MASPluginGroup, MASDevice: MASPluginDevice, MASApplication: MASPluginApplication, MASAuthenticationProviders: MASPluginAuthProviders, MASSecurityConfiguration: MASPluginSecurityConfiguration, MASSecuritySSLPinningMode: MASPluginConstants.MASSecuritySSLPinningMode, MASMultipartForm: MASPluginMultipartForm }; /** * A user defined success callback function. The contract of the function is out of scope for Mobile SDK, but the object passed to that function by Mobile SDK will conform to a structure based on operation type. * @callback successCallbackFunction * @param {Object} result The result object can take any form. It can be an object, or a plain string, a boolean or a number based on the API. * &lt;br>As an example for HTTP GET calls it will be :&lt;br>{&lt;br>&amp;nbsp;&amp;nbsp;"MASResponseInfoBodyInfoKey": "&amp;lt;The response content&amp;gt;", * &lt;br>&amp;nbsp;&amp;nbsp;"MASResponseInfoHeaderInfoKey":{&lt;br>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"&amp;lt;header name&amp;gt;": "&amp;lt;Header value&amp;gt;"&lt;br>&amp;nbsp;&amp;nbsp;}&lt;br>}&lt;br> * For other operations, it can be a string returning SUCCESS or TRUE or any other type&lt;br> Developer may check for existance of result object to define success in such case and must not rely on the exact response format. * To know about specific result for each API see {@link http://mas.ca.com/docs/cordova/latest/guides} */ /** * A user defined error callback function. The contract of the function is out of scope for Mobile SDK, but the object passed to that function by Mobile SDK will conform to a strict structure. * @callback errorCallbackFunction * @param {Object} error A Json Object with below structure &lt;br>{&lt;br>&amp;nbsp;&amp;nbsp;"errorCode": &amp;lt;The error code. For ex. 3003123&amp;gt;,&lt;br>&amp;nbsp;&amp;nbsp;"errorMessage": "&amp;lt;The error message&amp;gt;"&lt;br>&amp;nbsp;&amp;nbsp;"errorInfo":"&amp;lt;The Error Info&amp;gt;"&lt;br>}&lt;br> */ module.exports = MASPlugin;</code></pre> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="MASPlugin.html">MASPlugin</a></li><li><a href="MASPluginApplication.html">MASPluginApplication</a></li><li><a href="MASPluginAuthProviders.html">MASPluginAuthProviders</a></li><li><a href="MASPluginConstants.html">MASPluginConstants</a></li><li><a href="MASPluginDevice.html">MASPluginDevice</a></li><li><a href="MASPluginMAS.html">MASPluginMAS</a></li><li><a href="MASPluginMultipartForm.html">MASPluginMultipartForm</a></li><li><a href="MASPluginSecurityConfiguration.html">MASPluginSecurityConfiguration</a></li><li><a href="MASPluginUser.html">MASPluginUser</a></li><li><a href="MASPluginUtils.html">MASPluginUtils</a></li></ul><h3><a href="global.html">Global</a></h3> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Tue Feb 18 2020 21:13:36 GMT+0530 (India Standard Time) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>