Skip to content

Commit 922f08b

Browse files
committed
Fixed JSDoc String
1 parent 3360cce commit 922f08b

File tree

13 files changed

+216
-174
lines changed

13 files changed

+216
-174
lines changed

lib/stack/contentType/entry/index.js

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@ export function Entry (http, data) {
3434
this.urlPath = `/content_types/${this.content_type_uid}/entries/${this.uid}`
3535

3636
/**
37-
* @description The Create an entry call creates a new entry for the selected content type.
37+
* @description The Update an entry call updates an existing entry for the selected content type.
3838
* @memberof Entry
3939
* @func update
40-
* @param locale - Locale code to localized entry
41-
* @returns {Promise<Entry.Entry>} Promise for Entry instance
40+
* @param {Object=} param - Optional parameters.
41+
* @prop {string=} param.locale - Locale code for localized entry.
42+
* @returns {Promise<Entry>} Promise for Entry instance
4243
* @example
4344
* import * as contentstack from '@contentstack/management'
4445
* const client = contentstack.client()
@@ -99,7 +100,7 @@ export function Entry (http, data) {
99100
* @description The Delete an entry call is used to delete a specific entry from a content type.
100101
* @memberof Entry
101102
* @func delete
102-
* @returns {Object} Response Object.
103+
* @returns {Promise<Object>} Response Object.
103104
* @example
104105
* import * as contentstack from '@contentstack/management'
105106
* const client = contentstack.client()
@@ -113,11 +114,12 @@ export function Entry (http, data) {
113114
* @description The fetch Entry call fetches Entry details.
114115
* @memberof Entry
115116
* @func fetch
116-
* @param {Int} version Enter the version number of the entry that you want to retrieve. However, to retrieve a specific version of an entry, you need to keep the environment parameter blank.
117-
* @param {Int} locale Enter the code of the language of which the entries need to be included. Only the entries published in this locale will be displayed.
118-
* @param {Int} include_workflow Enter 'true' to include the workflow details of the entry.
119-
* @param {Int} include_publish_details Enter 'true' to include the publish details of the entry.
120-
* @returns {Promise<Entry.Entry>} Promise for Entry instance
117+
* @param {Object=} param - Query parameters.
118+
* @prop {Number=} param.version - Enter the version number of the entry that you want to retrieve. However, to retrieve a specific version of an entry, you need to keep the environment parameter blank.
119+
* @prop {String=} param.locale - Enter the code of the language of which the entries need to be included. Only the entries published in this locale will be displayed.
120+
* @prop {Boolean=} param.include_workflow - Enter 'true' to include the workflow details of the entry.
121+
* @prop {Boolean=} param.include_publish_details - Enter 'true' to include the publish details of the entry.
122+
* @returns {Promise<Entry>} Promise for Entry instance
121123
* @example
122124
* import * as contentstack from '@contentstack/management'
123125
* const client = contentstack.client()
@@ -129,7 +131,7 @@ export function Entry (http, data) {
129131
this.fetch = fetch(http, 'entry')
130132

131133
/**
132-
* @description The Publish an asset call is used to publish a specific version of an asset on the desired environment either immediately or at a later date/time.
134+
* @description The Publish an entry call is used to publish a specific version of an entry on the desired environment either immediately or at a later date/time.
133135
* @memberof Entry
134136
* @func publish
135137
* @returns {Promise<Object>} Response Object.
@@ -153,7 +155,7 @@ export function Entry (http, data) {
153155
this.publish = publish(http, 'entry')
154156

155157
/**
156-
* @description The Replace asset call will replace an existing asset with another file on the stack.
158+
* @description The Unpublish an entry call is used to unpublish a specific version of an entry from the desired environment either immediately or at a later date/time.
157159
* @memberof Entry
158160
* @func unpublish
159161
* @returns {Promise<Object>} Response Object.
@@ -180,6 +182,7 @@ export function Entry (http, data) {
180182
* @description This multipurpose request allows you to either send a publish request or accept/reject a received publish request.
181183
* @memberof Entry
182184
* @func publishRequest
185+
* @async
183186
* @returns {Promise<Object>} Response Object.
184187
* @param {Object} publishing_rule Details for the publish request
185188
* @param {String} locale Enter the code of the locale that the entry belongs to.
@@ -226,6 +229,7 @@ export function Entry (http, data) {
226229
* @description The Set Entry Workflow Stage request allows you to either set a particular workflow stage of an entry or update the workflow stage details of an entry.
227230
* @memberof Entry
228231
* @func setWorkflowStage
232+
* @async
229233
* @returns {Promise<Object>} Response Object.
230234
* @param {Object} publishing_rule Details for the publish request
231235
* @param {String} locale Enter the code of the locale that the entry belongs to.
@@ -277,17 +281,17 @@ export function Entry (http, data) {
277281
}
278282

279283
/**
280-
* @description The variants requestan entry call is used to fetch a specific entry with variants from a content type.
284+
* @description The variants call returns a Variants instance for managing variants of an entry.
281285
* @memberof Entry
282286
* @func variants
283-
* @returns {Promise<Object>} Response Object.
284-
* @param {Object} publishing_rule Details for the publish request
285-
* @param {String} locale Enter the code of the locale that the entry belongs to.
287+
* @param {String=} uid - Variant UID. If not provided, returns Variants instance for querying all variants.
288+
* @returns {Variants} Instance of Variants.
286289
* @example
287290
* import * as contentstack from '@contentstack/management'
288291
* const client = contentstack.client()
289-
* client.stack({ api_key: 'api_key'}).contentType('content_type_uid').entry('uid').variants('uid').fetch()
290-
* .then((response) => console.log(response.notice));
292+
* const variants = client.stack({ api_key: 'api_key'}).contentType('content_type_uid').entry('uid').variants('uid')
293+
* variants.fetch()
294+
* .then((response) => console.log(response));
291295
*/
292296
this.variants = (uid = null) => {
293297
const data = { stackHeaders: this.stackHeaders }
@@ -300,10 +304,13 @@ export function Entry (http, data) {
300304
}
301305

302306
/**
303-
* @description The includeVariants an entry call is used to fetch a specific base entry with variants from a content type.
304-
* @memberof Variants
307+
* @description The includeVariants call is used to fetch a specific base entry with variants from a content type.
308+
* @memberof Entry
305309
* @func includeVariants
306-
* @returns {Object} Response Object.
310+
* @async
311+
* @param {string|boolean} include_variant - Whether to include variants.
312+
* @param {string=} variants_uid - Optional variant UID.
313+
* @returns {Promise<Object>} Response Object.
307314
* @example
308315
* import * as contentstack from '@contentstack/management'
309316
* const client = contentstack.client()
@@ -338,9 +345,10 @@ export function Entry (http, data) {
338345
}
339346

340347
/**
341-
* @description The get locales request allows to get the languages of an entry.
348+
* @description The get locales request allows you to get the languages of an entry.
342349
* @memberof Entry
343350
* @func locales
351+
* @async
344352
* @returns {Promise<Object>} Response Object.
345353
* client.stack({ api_key: 'api_key'}).contentType('content_type_uid').entry('uid').locales()
346354
* .then((response) => console.log(response));
@@ -363,9 +371,10 @@ export function Entry (http, data) {
363371
}
364372

365373
/**
366-
* @description The get references request allows to get the references of an entry.
374+
* @description The get references request allows you to get the references of an entry.
367375
* @memberof Entry
368376
* @func references
377+
* @async
369378
* @returns {Promise<Object>} Response Object.
370379
* @example 1
371380
* client.stack({ api_key: 'api_key'}).contentType('content_type_uid').entry('uid').references()
@@ -395,17 +404,17 @@ export function Entry (http, data) {
395404
* @description The Create an entry call creates a new entry for the selected content type.
396405
* @memberof Entry
397406
* @func create
398-
* @returns {Promise<Entry.Entry>} Promise for Entry instance
407+
* @returns {Promise<Entry>} Promise for Entry instance
399408
*
400409
* @example
401410
* import * as contentstack from '@contentstack/management'
402411
* const client = contentstack.client()
403-
* const entry = {
412+
* const entry = {
404413
* title: 'Sample Entry',
405414
* url: '/sampleEntry',
406415
* file: 'asset_uid', // for single asset pass asset uid to entry asset field value
407-
* multiple_file = ['asset_uid_1', 'asset_uid_2'], // for multiple asset pass array of asset uid to entry asset field values
408-
* reference: reference.uid, // for single reference pass reference uid to entry reference field value
416+
* multiple_file: ['asset_uid_1', 'asset_uid_2'], // for multiple asset pass array of asset uid to entry asset field values
417+
* reference: 'reference_uid', // for single reference pass reference uid to entry reference field value
409418
* multiple_reference: ['reference_uid_1', 'reference_uid_2'], // for multiple reference pass array of reference uid to entry reference field values
410419
* multiple_content_type_reference: [{_content_type_uid: 'content_type_uid_1', uid: 'reference_uid_1'}, {_content_type_uid: 'content_type_uid_2', uid: 'reference_uid_2'}] // for multiple reference pass array of reference uid to entry reference field values
411420
* }
@@ -415,14 +424,14 @@ export function Entry (http, data) {
415424
this.create = create({ http: http })
416425

417426
/**
418-
* @description The Query on Entry will allow to fetch details of all or specific Entry
427+
* @description The Query on Entry will allow you to fetch details of all or specific Entries.
419428
* @memberof Entry
420429
* @func query
421-
* @param {Int} locale Enter the code of the language of which the entries need to be included. Only the entries published in this locale will be displayed.
422-
* @param {Int} include_workflow Enter 'true' to include the workflow details of the entry.
423-
* @param {Int} include_publish_details Enter 'true' to include the publish details of the entry.
430+
* @param {String} locale Enter the code of the language of which the entries need to be included. Only the entries published in this locale will be displayed.
431+
* @param {Boolean} include_workflow Enter 'true' to include the workflow details of the entry.
432+
* @param {Boolean} include_publish_details Enter 'true' to include the publish details of the entry.
424433
* @param {Object} query Queries that you can use to fetch filtered results.
425-
* @returns {Array<Entry>} Array of Entry.
434+
* @returns {Object} Query builder object with find(), count(), and findOne() methods.
426435
*
427436
* @example
428437
* import * as contentstack from '@contentstack/management'
@@ -438,10 +447,12 @@ export function Entry (http, data) {
438447
* @description The Import Entry calls given below help you to import entries by uploading JSON files.
439448
* @memberof Entry
440449
* @func import
441-
* @param {String} entry Select the JSON file of the entry that you wish to import.
442-
* @param {String} locale Enter the code of the language to import the entry of that particular language.
443-
* @param {Boolean} overwrite Select 'true' to replace an existing entry with the imported entry file.
444-
*
450+
* @async
451+
* @param {Object} data - Import data object.
452+
* @prop {string} data.entry - Path to the JSON file of the entry that you wish to import.
453+
* @prop {string=} data.locale - Enter the code of the language to import the entry of that particular language.
454+
* @prop {boolean=} data.overwrite - Select 'true' to replace an existing entry with the imported entry file.
455+
* @returns {Promise<Entry.Entry>} Promise for Entry instance
445456
* @example
446457
* import * as contentstack from '@contentstack/management'
447458
* const client = contentstack.client()

lib/stack/contentType/entry/variants/index.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
from '../../../../entity'
88
import error from '../../../../core/contentstackError'
99
/**
10-
* An variants is the actual piece of content created using one of the defined content types. Read more about <a href='https://www.contentstack.com/docs/guide/content-management'>Entries</a>.
10+
* Variants allow you to create variant versions of entries within a content type. Read more about <a href='https://www.contentstack.com/docs/developers/create-content-types/manage-variants'>Variants</a>.
1111
* @namespace Variants
1212
*/
1313
export function Variants (http, data) {
@@ -16,10 +16,10 @@ export function Variants (http, data) {
1616
if (data && data.variants_uid) {
1717
this.urlPath += `/${this.variants_uid}`
1818
/**
19-
* @description The Create an variants call creates a new variants for the selected content type.
19+
* @description The Update a variant call updates an existing variant for the selected content type.
2020
* @memberof Variants
2121
* @func update
22-
* @returns {Promise<Variants.Variants>} Promise for Variants instance
22+
* @returns {Promise<Object>} Response Object.
2323
* @example
2424
* import * as contentstack from '@contentstack/management'
2525
* const client = contentstack.client()
@@ -58,10 +58,10 @@ export function Variants (http, data) {
5858
}
5959

6060
/**
61-
* @description The Delete an variants call is used to delete a specific variants from a content type.
61+
* @description The Delete a variant call is used to delete a specific variant from a content type.
6262
* @memberof Variants
6363
* @func delete
64-
* @returns {Object} Response Object.
64+
* @returns {Promise<Object>} Response Object.
6565
* @example
6666
* import * as contentstack from '@contentstack/management'
6767
* const client = contentstack.client()
@@ -75,7 +75,7 @@ export function Variants (http, data) {
7575
* @description The fetch Variants call fetches Variants details.
7676
* @memberof Variants
7777
* @func fetch
78-
* @returns {Promise<Variants.Variants>} Promise for Variants instance
78+
* @returns {Promise<Variants>} Promise for Variants instance
7979
* @example
8080
* import * as contentstack from '@contentstack/management'
8181
* const client = contentstack.client()
@@ -87,10 +87,10 @@ export function Variants (http, data) {
8787
this.fetch = fetch(http, 'variants')
8888

8989
/**
90-
* @description The version Variants call fetches Variants version details.
90+
* @description The versions call fetches variant version details.
9191
* @memberof Variants
9292
* @func versions
93-
* @returns {Promise<Variants.Variants>} Promise for Variants instance
93+
* @returns {Promise<Object>} Promise for variant versions data
9494
* @example
9595
* import * as contentstack from '@contentstack/management'
9696
* const client = contentstack.client()
@@ -117,19 +117,20 @@ export function Variants (http, data) {
117117
}
118118
} else {
119119
/**
120-
* @description The Query on Variants will allow to fetch details of all or specific Variants
120+
* @description The Query on Variants will allow you to fetch details of all or specific Variants.
121121
* @memberof Variants
122122
* @func query
123-
* @param {Int} locale Enter the code of the language of which the entries need to be included. Only the entries published in this locale will be displayed.
124-
* @param {Object} query Queries that you can use to fetch filtered results.
125-
* @returns {Array<Variants>} Array of Variants.
123+
* @param {Object} params - Query parameters
124+
* @prop {Int} params.locale Enter the code of the language of which the variants need to be included.
125+
* @prop {Object} params.query Queries that you can use to fetch filtered results.
126+
* @returns {Object} Query builder object with find(), count(), and findOne() methods.
126127
*
127128
* @example
128129
* import * as contentstack from '@contentstack/management'
129130
* const client = contentstack.client()
130131
*
131132
* client.stack().contentType('content_type_uid').entry('entry_uid').variants().query({ query: { title: 'Variants title' } }).find()
132-
* .then((entries) => console.log(entries))
133+
* .then((variants) => console.log(variants))
133134
*/
134135
this.query = query({ http: http, wrapperCollection: VariantsCollection })
135136
}

lib/stack/environment/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function Environment (http, data = {}) {
1616
* @description The Update Environment call lets you update the name and description of an existing Environment.
1717
* @memberof Environment
1818
* @func update
19-
* @returns {Promise<Environment.Environment>} Promise for Environment instance
19+
* @returns {Promise<Environment>} Promise for Environment instance
2020
* @example
2121
* import * as contentstack from '@contentstack/management'
2222
* const client = contentstack.client()
@@ -36,7 +36,7 @@ export function Environment (http, data = {}) {
3636
* @description The Delete Environment call is used to delete an existing Environment permanently from your Stack.
3737
* @memberof Environment
3838
* @func delete
39-
* @returns {Object} Response Object.
39+
* @returns {Promise<Object>} Response Object.
4040
* @example
4141
* import * as contentstack from '@contentstack/management'
4242
* const client = contentstack.client()
@@ -50,7 +50,7 @@ export function Environment (http, data = {}) {
5050
* @description The fetch Environment call fetches Environment details.
5151
* @memberof Environment
5252
* @func fetch
53-
* @returns {Promise<Environment.Environment>} Promise for Environment instance
53+
* @returns {Promise<Environment>} Promise for Environment instance
5454
* @example
5555
* import * as contentstack from '@contentstack/management'
5656
* const client = contentstack.client()
@@ -65,7 +65,7 @@ export function Environment (http, data = {}) {
6565
* @description The Create a Environment call creates a new environment in a particular stack of your Contentstack account.
6666
* @memberof Environment
6767
* @func create
68-
* @returns {Promise<Environment.Environment>} Promise for Environment instance
68+
* @returns {Promise<Environment>} Promise for Environment instance
6969
*
7070
* @example
7171
* import * as contentstack from '@contentstack/management'
@@ -91,10 +91,10 @@ export function Environment (http, data = {}) {
9191
this.create = create({ http: http })
9292

9393
/**
94-
* @description The Query on Environment will allow to fetch details of all or specific Environment.
94+
* @description The Query on Environment will allow you to fetch details of all or specific Environments.
9595
* @memberof Environment
9696
* @func query
97-
* @returns {ContentstackCollection} Instance of ContentstackCollection.
97+
* @returns {Object} Query builder object with find(), count(), and findOne() methods.
9898
*
9999
* @example
100100
* import * as contentstack from '@contentstack/management'

0 commit comments

Comments
 (0)