Skip to content

Commit 3360cce

Browse files
committed
Fixed the other modules jsdoc
1 parent 94a0449 commit 3360cce

File tree

13 files changed

+135
-103
lines changed

13 files changed

+135
-103
lines changed

lib/organization/teams/index.js

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,16 @@ export function Teams (http, data) {
1818
this.urlPath = `/organizations/${this.organizationUid}/teams/${this.uid}`
1919

2020
/**
21-
* @description The update call on team will allow to update details of team.
21+
* @description The update call allows you to update details of a team.
2222
* @memberof Teams
2323
* @func update
24-
* @returns {Promise<Teams.Teams>} Response Object.
24+
* @async
25+
* @param {Object} updateData - Team update data.
26+
* @prop {string} updateData.name - Team name.
27+
* @prop {Array<Object>} updateData.users - Array of user objects with email property.
28+
* @prop {string} updateData.organizationRole - Organization role UID.
29+
* @prop {Array} updateData.stackRoleMapping - Stack role mappings.
30+
* @returns {Promise<Object>} Response Object.
2531
* @example
2632
* import * as contentstack from '@contentstack/management'
2733
* const client = contentstack.client()
@@ -35,7 +41,7 @@ export function Teams (http, data) {
3541
* organizationRole: 'blt09e5dfced326aaea',
3642
* stackRoleMapping: []
3743
* }
38-
* client.organization(s'organizationUid').teams('teamUid').update(updateData)
44+
* client.organization('organizationUid').teams('teamUid').update(updateData)
3945
* .then((response) => console.log(response))
4046
*
4147
*/
@@ -51,10 +57,10 @@ export function Teams (http, data) {
5157
}
5258

5359
/**
54-
* @description The delete call on team will delete the existing team.
60+
* @description The delete call deletes an existing team.
5561
* @memberof Teams
5662
* @func delete
57-
* @returns {Promise<Teams.Teams>} Response Object.
63+
* @returns {Promise<Object>} Response Object.
5864
* @example
5965
* import * as contentstack from '@contentstack/management'
6066
* const client = contentstack.client()
@@ -65,10 +71,10 @@ export function Teams (http, data) {
6571
this.delete = deleteEntity(http)
6672

6773
/**
68-
* @description The fetch call on team will delete the existing team.
74+
* @description The fetch call fetches the existing team details.
6975
* @memberof Teams
7076
* @func fetch
71-
* @returns {Promise<Teams.Teams>} Response Object.
77+
* @returns {Promise<Teams>} Promise for Teams instance
7278
* @example
7379
* import * as contentstack from '@contentstack/management'
7480
* const client = contentstack.client()
@@ -79,10 +85,10 @@ export function Teams (http, data) {
7985
this.fetch = fetch(http, 'team')
8086

8187
/**
82-
* @description The users call on team will get users details.
88+
* @description The teamUsers call returns a TeamUsers instance for managing team users.
8389
* @memberof Teams
84-
* @func users
85-
* @returns {Promise<Teams.Teams>} Response Object.
90+
* @func teamUsers
91+
* @returns {TeamUsers} Instance of TeamUsers.
8692
* @example
8793
* import * as contentstack from '@contentstack/management'
8894
* const client = contentstack.client()
@@ -100,10 +106,10 @@ export function Teams (http, data) {
100106
}
101107

102108
/**
103-
* @description The stackRoleMappings call on team will get the stack role Mapping.
109+
* @description The stackRoleMappings call returns a StackRoleMappings instance for managing stack role mappings.
104110
* @memberof Teams
105-
* @func users
106-
* @returns {Promise<Teams.Teams>} Response Object.
111+
* @func stackRoleMappings
112+
* @returns {StackRoleMappings} Instance of StackRoleMappings.
107113
* @example
108114
* import * as contentstack from '@contentstack/management'
109115
* const client = contentstack.client()
@@ -121,10 +127,10 @@ export function Teams (http, data) {
121127
}
122128
} else {
123129
/**
124-
* @description The fetch call on team will delete the existing team.
130+
* @description The create call creates a new team.
125131
* @memberof Teams
126132
* @func create
127-
* @returns {Promise<Teams.Teams>} Response Object.
133+
* @returns {Promise<Teams>} Promise for Teams instance
128134
* @example
129135
* import * as contentstack from '@contentstack/management'
130136
* const client = contentstack.client()
@@ -142,10 +148,10 @@ export function Teams (http, data) {
142148
this.create = create({ http })
143149

144150
/**
145-
* @description The fetchAll on team will allow to fetch details of all teams.
151+
* @description The fetchAll call allows you to fetch details of all teams.
146152
* @memberof Teams
147153
* @func fetchAll
148-
* @returns {Promise<Teams.Teams>} Response Object.
154+
* @returns {Promise<ContentstackCollection>} Promise for ContentstackCollection instance.
149155
* @example
150156
* import * as contentstack from '@contentstack/management'
151157
* const client = contentstack.client()

lib/organization/teams/stackRoleMappings/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ export function StackRoleMappings (http, data) {
1717
* @description The update stackRoleMappings call is used to update the roles.
1818
* @memberof StackRoleMappings
1919
* @func update
20-
* @returns {Promise<StackRoleMappings.StackRoleMappings>} Response Object.
20+
* @param {Object} updateData - The data to update stack role mappings
21+
* @returns {Promise<Object>} Response Object.
2122
* @example
2223
* import * as contentstack from '@contentstack/management'
2324
* const client = contentstack.client()
@@ -45,7 +46,7 @@ export function StackRoleMappings (http, data) {
4546
* @description The delete stackRoleMappings call is used to delete the roles.
4647
* @memberof StackRoleMappings
4748
* @func delete
48-
* @returns {Promise<StackRoleMappings.StackRoleMappings>} Response Object.
49+
* @returns {Promise<Object>} Response Object.
4950
* @example
5051
* import * as contentstack from '@contentstack/management'
5152
* const client = contentstack.client()
@@ -60,13 +61,13 @@ export function StackRoleMappings (http, data) {
6061
* @description The add stackRoleMappings call is used to add the roles.
6162
* @memberof StackRoleMappings
6263
* @func add
63-
* @returns {Promise<StackRoleMappings.StackRoleMappings>} Response Object.
64+
* @returns {Promise<Object>} Response Object.
6465
* @example
6566
* import * as contentstack from '@contentstack/management'
6667
* const client = contentstack.client()
6768
*
6869
* const addRole = {
69-
* 'stackApiKey: 'stackApiKey',
70+
* 'stackApiKey': 'stackApiKey',
7071
* 'roles': [
7172
* 'role_uid'
7273
* ]
@@ -89,12 +90,12 @@ export function StackRoleMappings (http, data) {
8990
* @description The fetchAll stackRoleMappings call is used to fetchAll the roles.
9091
* @memberof StackRoleMappings
9192
* @func fetchAll
92-
* @returns {Promise<StackRoleMappings.StackRoleMappings>} Response Object.
93+
* @returns {Promise<Object>} Response Object.
9394
* @example
9495
* import * as contentstack from '@contentstack/management'
9596
* const client = contentstack.client()
9697
*
97-
* client.organization('organizationUid').teams('teamUid').stackRoleMappings().fetchAll
98+
* client.organization('organizationUid').teams('teamUid').stackRoleMappings().fetchAll()
9899
* .then((response) => console.log(response))
99100
*/
100101
this.fetchAll = async () => {

lib/organization/teams/teamUsers/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function TeamUsers (http, data) {
1616
* @description The Remove teamUser call is used to remove an existing user of that team.
1717
* @memberof TeamUsers
1818
* @func remove
19-
* @returns {Promise<TeamUsers.TeamUsers>} Response Object.
19+
* @returns {Promise<Object>} Response Object.
2020
* @example
2121
* import * as contentstack from '@contentstack/management'
2222
* const client = contentstack.client()
@@ -33,7 +33,7 @@ export function TeamUsers (http, data) {
3333
* @description The Add teamUser call is used to add a user to the team.
3434
* @memberof TeamUsers
3535
* @func add
36-
* @returns {Promise<TeamUsers.TeamUsers>} Promise for TeamUsers instance
36+
* @returns {Promise<Object>} Response Object.
3737
* @example
3838
* import * as contentstack from '@contentstack/management'
3939
* const client = contentstack.client()
@@ -47,10 +47,10 @@ export function TeamUsers (http, data) {
4747
this.add = create({ http })
4848

4949
/**
50-
* @description The fetchAll on teamUser will allow to fetch details of all teamUsers.
50+
* @description The fetchAll call allows you to fetch details of all team users.
5151
* @memberof TeamUsers
5252
* @func fetchAll
53-
* @returns {ContentstackCollection} Instance of ContentstackCollection.
53+
* @returns {Promise<ContentstackCollection>} Promise for ContentstackCollection instance.
5454
* @example
5555
* import * as contentstack from '@contentstack/management'
5656
* const client = contentstack.client()

lib/query/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ export default function Query (http, urlPath, param, stackHeaders = null, wrappe
1919
}
2020
/**
2121
* @description This method will fetch content of query on specified module.
22-
* @returns {ContentstackCollection} Result collection of content of specified module.
22+
* @async
23+
* @returns {Promise<ContentstackCollection>} Promise for ContentstackCollection instance.
2324
* @example All Stack
2425
* import * as contentstack from '@contentstack/management'
2526
* const client = contentstack.client()
@@ -52,7 +53,8 @@ export default function Query (http, urlPath, param, stackHeaders = null, wrappe
5253
}
5354
/**
5455
* @description This method will fetch count of content for query on specified module.
55-
* @returns {Object} Result is Object of content of specified module.
56+
* @async
57+
* @returns {Promise<Object>} Promise for count result.
5658
* @example All Stack
5759
* import * as contentstack from '@contentstack/management'
5860
* const client = contentstack.client()
@@ -86,7 +88,8 @@ export default function Query (http, urlPath, param, stackHeaders = null, wrappe
8688
}
8789
/**
8890
* @description This method will fetch content of query on specified module.
89-
* @returns {ContentstackCollection} Result content of specified module.
91+
* @async
92+
* @returns {Promise<ContentstackCollection>} Promise for ContentstackCollection instance.
9093
* @example Stack
9194
* import * as contentstack from '@contentstack/management'
9295
* const client = contentstack.client()

lib/stack/asset/folders/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function Folder (http, data = {}) {
2525
* @description The Update Folder call lets you update the name and description of an existing Folder.
2626
* @memberof Folder
2727
* @func update
28-
* @returns {Promise<Folder.Folder>} Promise for Folder instance
28+
* @returns {Promise<Folder>} Promise for Folder instance
2929
* @example
3030
* import * as contentstack from '@contentstack/management'
3131
* const client = contentstack.client()
@@ -41,10 +41,10 @@ export function Folder (http, data = {}) {
4141
this.update = update(http, 'asset')
4242

4343
/**
44-
* @description The Delete folder call will delete an existing folder from the stack.
44+
* @description The Delete folder call deletes an existing folder from the stack.
4545
* @memberof Folder
4646
* @func delete
47-
* @returns {Object} Response Object.
47+
* @returns {Promise<Object>} Response Object.
4848
* @example
4949
* import * as contentstack from '@contentstack/management'
5050
* const client = contentstack.client()
@@ -55,10 +55,10 @@ export function Folder (http, data = {}) {
5555
this.delete = deleteEntity(http)
5656

5757
/**
58-
* @description The fetch an asset call returns comprehensive information about a specific version of an asset of a stack.
58+
* @description The fetch folder call returns comprehensive information about a specific folder.
5959
* @memberof Folder
6060
* @func fetch
61-
* @returns {Promise<Folder.Folder>} Promise for Folder instance
61+
* @returns {Promise<Folder>} Promise for Folder instance
6262
* @example
6363
* import * as contentstack from '@contentstack/management'
6464
* const client = contentstack.client()
@@ -70,15 +70,15 @@ export function Folder (http, data = {}) {
7070
this.fetch = fetch(http, 'asset')
7171
} else {
7272
/**
73-
* @description The Create a folder into the assets.
73+
* @description The Create a folder call creates a new folder in the assets.
7474
* @memberof Folder
7575
* @func create
76-
* @returns {Promise<Folder.Folder>} Promise for Folder instance
76+
* @returns {Promise<Folder>} Promise for Folder instance
7777
*
7878
* @example
7979
* import * as contentstack from '@contentstack/management'
8080
* const client = contentstack.client()
81-
* const asset = {name: 'My New contentType'}
81+
* const asset = {name: 'My New Folder'}
8282
* client.stack().asset().folder().create({ asset })
8383
* .then((folder) => console.log(folder))
8484
*/

lib/stack/asset/index.js

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function Asset (http, data = {}) {
3131
* @description The Update Asset call lets you update the name and description of an existing Asset.
3232
* @memberof Asset
3333
* @func update
34-
* @returns {Promise<Asset.Asset>} Promise for Asset instance
34+
* @returns {Promise<Asset>} Promise for Asset instance
3535
* @example
3636
* import * as contentstack from '@contentstack/management'
3737
* const client = contentstack.client()
@@ -48,10 +48,10 @@ export function Asset (http, data = {}) {
4848
this.update = update(http, 'asset')
4949

5050
/**
51-
* @description The Delete asset call will delete an existing asset from the stack.
51+
* @description The Delete asset call deletes an existing asset from the stack.
5252
* @memberof Asset
5353
* @func delete
54-
* @returns {Object} Response Object.
54+
* @returns {Promise<Object>} Response Object.
5555
* @example
5656
* import * as contentstack from '@contentstack/management'
5757
* const client = contentstack.client()
@@ -65,7 +65,7 @@ export function Asset (http, data = {}) {
6565
* @description The fetch an asset call returns comprehensive information about a specific version of an asset of a stack.
6666
* @memberof Asset
6767
* @func fetch
68-
* @returns {Promise<Asset.Asset>} Promise for Asset instance
68+
* @returns {Promise<Asset>} Promise for Asset instance
6969
* @example
7070
* import * as contentstack from '@contentstack/management'
7171
* const client = contentstack.client()
@@ -80,7 +80,8 @@ export function Asset (http, data = {}) {
8080
* @description The Replace asset call will replace an existing asset with another file on the stack.
8181
* @memberof Asset
8282
* @func replace
83-
* @returns {Promise<Asset.Asset>} Promise for Asset instance
83+
* @async
84+
* @returns {Promise<Asset>} Promise for Asset instance
8485
* @example
8586
* import * as contentstack from '@contentstack/management'
8687
* const client = contentstack.client()
@@ -130,7 +131,7 @@ export function Asset (http, data = {}) {
130131
this.publish = publish(http, 'asset')
131132

132133
/**
133-
* @description The Replace asset call will replace an existing asset with another file on the stack.
134+
* @description The Unpublish an asset call is used to unpublish a specific version of an asset from the desired environment either immediately or at a later date/time.
134135
* @memberof Asset
135136
* @func unpublish
136137
* @returns {Promise<Object>} Response Object.
@@ -156,8 +157,9 @@ export function Asset (http, data = {}) {
156157
/**
157158
* @description The References function will get all the references for the asset.
158159
* @memberof Asset
159-
* @func references
160-
* @returns {Promise<Array>} Array of references.
160+
* @func getReferences
161+
* @async
162+
* @returns {Promise<Object>} Promise for references data.
161163
* @param {Object} param - Query parameters
162164
* @example
163165
* client.stack({ api_key: 'api_key'}).asset('uid').getReferences({ include_publish_details: true })
@@ -183,10 +185,10 @@ export function Asset (http, data = {}) {
183185
}
184186
} else {
185187
/**
186-
* @description The Folder allows to fetch and create folders in assets.
188+
* @description The Folder method allows you to fetch and create folders in assets.
187189
* @memberof Asset
188190
* @func folder
189-
* @returns {Promise<Folder.Folder>} Promise for Entry instance
191+
* @returns {Folder} Instance of Folder.
190192
*
191193
* @example
192194
* import * as contentstack from '@contentstack/management'
@@ -207,7 +209,8 @@ export function Asset (http, data = {}) {
207209
* @description The Create an asset call creates a new asset.
208210
* @memberof Asset
209211
* @func create
210-
* @returns {Promise<Asset.Asset>} Promise for Asset instance
212+
* @async
213+
* @returns {Promise<Asset>} Promise for Asset instance
211214
*
212215
* @example
213216
* import * as contentstack from '@contentstack/management'
@@ -235,12 +238,12 @@ export function Asset (http, data = {}) {
235238
}
236239
}
237240
/**
238-
* @description The Query on Asset will allow to fetch details of all or specific Asset.
241+
* @description The Query on Asset will allow you to fetch details of all or specific Assets.
239242
* @memberof Asset
240243
* @param {Object} params - URI parameters
241244
* @prop {Object} params.query - Queries that you can use to fetch filtered results.
242245
* @func query
243-
* @returns {Array<Asset>} Array of Asset.
246+
* @returns {Object} Query builder object with find(), count(), and findOne() methods.
244247
*
245248
* @example
246249
* import * as contentstack from '@contentstack/management'
@@ -255,7 +258,8 @@ export function Asset (http, data = {}) {
255258
* @description The Download function will get downloadable file in specified format.
256259
* @memberof Asset
257260
* @func download
258-
* @returns {Array<AssetResponse>} Array of Asset.
261+
* @async
262+
* @returns {Promise<Object>} Promise for download response.
259263
* @param {*} param.url The url for the asset to download
260264
* @param {*} param.responseType Optional parameter to specify the response type.
261265
* @example

0 commit comments

Comments
 (0)