@@ -19,21 +19,22 @@ export default function contentstackClient ({ http }) {
1919 * @prop {string } parameters.password - password for user to login
2020 * @prop {string } parameters.tfa_token - tfa token for user to login (2FA token)
2121 * @prop {string } parameters.mfaSecret - TOTP secret key for generating 2FA token
22- * @returns {Promise }
22+ * @param {Object= } params - Optional request parameters
23+ * @returns {Promise<Object> } Promise for login response
2324 * @example
2425 * import * as contentstack from '@contentstack/management'
2526 * const client = contentstack.client()
2627 *
2728 * client.login({ email: <emailid>, password: <password> })
28- * .then(() => console.log('Logged in successfully '))
29+ * .then(() => console.log('Login successful. '))
2930 *
3031 * @example
3132 * client.login({ email: <emailid>, password: <password>, tfa_token: <tfa_token> })
32- * .then(() => console.log('Logged in successfully '))
33+ * .then(() => console.log('Login successful. '))
3334 *
3435 * @example
3536 * client.login({ email: <emailid>, password: <password>, mfaSecret: <mfa_secret> })
36- * .then(() => console.log('Logged in successfully '))
37+ * .then(() => console.log('Login successful. '))
3738 */
3839 function login ( requestBody = { } , params = { } ) {
3940 http . defaults . versioningStrategy = 'path'
@@ -59,7 +60,8 @@ export default function contentstackClient ({ http }) {
5960 * The information returned includes details of the stacks owned by and shared with the specified user account.
6061 * @memberof ContentstackClient
6162 * @func getUser
62- * @returns {Promise }
63+ * @param {Object= } params - Optional request parameters
64+ * @returns {Promise<Object> } Promise for User instance
6365 * @example
6466 * import * as contentstack from '@contentstack/management'
6567 * const client = contentstack.client()
@@ -78,10 +80,11 @@ export default function contentstackClient ({ http }) {
7880 * @description Get Stack instance. A stack is a space that stores the content of a project.
7981 * @memberof ContentstackClient
8082 * @func stack
81- * @param {String } api_key - Stack API Key
82- * @param {String } management_token - Management token for Stack.
83- * @param {String } branch_name - Branch name or alias to access specific branch. Default is master.
84- * @returns {Stack } Instance of Stack
83+ * @param {Object= } params - Stack initialization parameters
84+ * @prop {String } params.api_key - Stack API Key
85+ * @prop {String } params.management_token - Management token for Stack.
86+ * @prop {String } params.branch_uid - Branch UID or alias to access specific branch. Default is master.
87+ * @returns {Stack } Instance of Stack.
8588 *
8689 * @example
8790 * import * as contentstack from '@contentstack/management'
@@ -121,7 +124,7 @@ export default function contentstackClient ({ http }) {
121124 * @description Organization is the top-level entity in the hierarchy of Contentstack, consisting of stacks and stack resources, and users.
122125 * @memberof ContentstackClient
123126 * @func organization
124- * @param {String } uid - Organization UID.
127+ * @param {String= } uid - Organization UID. If not provided, returns organization instance for querying all organizations .
125128 * @returns {Organization } Instance of Organization.
126129 *
127130 * @example
@@ -152,7 +155,7 @@ export default function contentstackClient ({ http }) {
152155 * @memberof ContentstackClient
153156 * @param {String } authtoken - Authtoken to logout from.
154157 * @func logout
155- * @returns {Object } Response object.
158+ * @returns {Promise< Object> } Promise for response object.
156159 *
157160 * @example
158161 * import * as contentstack from '@contentstack/management'
@@ -195,19 +198,19 @@ export default function contentstackClient ({ http }) {
195198 * @memberof ContentstackClient
196199 * @func oauth
197200 * @param {Object } parameters - oauth parameters
198- * @prop {string } parameters.appId - appId of the application
199- * @prop {string } parameters.clientId - clientId of the application
200- * @prop {string } parameters.clientId - clientId of the application
201- * @prop {string } parameters.responseType - responseType
202- * @prop {string } parameters.scope - scope
203- * @prop {string } parameters.clientSecret - clientSecret of the application
204- * @returns {OAuthHandler } Instance of OAuthHandler
201+ * @prop {string= } parameters.appId - appId of the application (default: '6400aa06db64de001a31c8a9')
202+ * @prop {string= } parameters.clientId - clientId of the application (default: 'Ie0FEfTzlfAHL4xM')
203+ * @prop {string= } parameters.redirectUri - redirect URI for OAuth callback (default: 'http://localhost:8184')
204+ * @prop {string= } parameters.responseType - responseType (default: 'code')
205+ * @prop {string= } parameters.scope - scope
206+ * @prop {string= } parameters.clientSecret - clientSecret of the application
207+ * @returns {OAuthHandler } Instance of OAuthHandler.
205208 * @example
206209 * import * as contentstack from '@contentstack/management'
207210 * const client = contentstack.client()
208211 *
209212 * client.oauth({ appId: <appId>, clientId: <clientId>, redirectUri: <redirectUri>, clientSecret: <clientSecret>, responseType: <responseType>, scope: <scope> })
210- * .then(() => console.log('Logged in successfully '))
213+ * .then(() => console.log('Login successful. '))
211214 *
212215 */
213216 function oauth ( params = { } ) {
0 commit comments