You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @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.
38
38
* @memberof Entry
39
39
* @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
42
43
* @example
43
44
* import * as contentstack from '@contentstack/management'
44
45
* const client = contentstack.client()
@@ -99,7 +100,7 @@ export function Entry (http, data) {
99
100
* @description The Delete an entry call is used to delete a specific entry from a content type.
100
101
* @memberof Entry
101
102
* @func delete
102
-
* @returns {Object} Response Object.
103
+
* @returns {Promise<Object>} Response Object.
103
104
* @example
104
105
* import * as contentstack from '@contentstack/management'
105
106
* const client = contentstack.client()
@@ -113,11 +114,12 @@ export function Entry (http, data) {
113
114
* @description The fetch Entry call fetches Entry details.
114
115
* @memberof Entry
115
116
* @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
121
123
* @example
122
124
* import * as contentstack from '@contentstack/management'
123
125
* const client = contentstack.client()
@@ -129,7 +131,7 @@ export function Entry (http, data) {
129
131
this.fetch=fetch(http,'entry')
130
132
131
133
/**
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.
133
135
* @memberof Entry
134
136
* @func publish
135
137
* @returns {Promise<Object>} Response Object.
@@ -153,7 +155,7 @@ export function Entry (http, data) {
153
155
this.publish=publish(http,'entry')
154
156
155
157
/**
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.
157
159
* @memberof Entry
158
160
* @func unpublish
159
161
* @returns {Promise<Object>} Response Object.
@@ -180,6 +182,7 @@ export function Entry (http, data) {
180
182
* @description This multipurpose request allows you to either send a publish request or accept/reject a received publish request.
181
183
* @memberof Entry
182
184
* @func publishRequest
185
+
* @async
183
186
* @returns {Promise<Object>} Response Object.
184
187
* @param {Object} publishing_rule Details for the publish request
185
188
* @param {String} locale Enter the code of the locale that the entry belongs to.
@@ -226,6 +229,7 @@ export function Entry (http, data) {
226
229
* @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.
227
230
* @memberof Entry
228
231
* @func setWorkflowStage
232
+
* @async
229
233
* @returns {Promise<Object>} Response Object.
230
234
* @param {Object} publishing_rule Details for the publish request
231
235
* @param {String} locale Enter the code of the locale that the entry belongs to.
@@ -277,17 +281,17 @@ export function Entry (http, data) {
277
281
}
278
282
279
283
/**
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.
281
285
* @memberof Entry
282
286
* @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.
286
289
* @example
287
290
* import * as contentstack from '@contentstack/management'
@@ -395,17 +404,17 @@ export function Entry (http, data) {
395
404
* @description The Create an entry call creates a new entry for the selected content type.
396
405
* @memberof Entry
397
406
* @func create
398
-
* @returns {Promise<Entry.Entry>} Promise for Entry instance
407
+
* @returns {Promise<Entry>} Promise for Entry instance
399
408
*
400
409
* @example
401
410
* import * as contentstack from '@contentstack/management'
402
411
* const client = contentstack.client()
403
-
* const entry = {
412
+
* const entry = {
404
413
* title: 'Sample Entry',
405
414
* url: '/sampleEntry',
406
415
* 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
409
418
* multiple_reference: ['reference_uid_1', 'reference_uid_2'], // for multiple reference pass array of reference uid to entry reference field values
410
419
* 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
411
420
* }
@@ -415,14 +424,14 @@ export function Entry (http, data) {
415
424
this.create=create({http: http})
416
425
417
426
/**
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.
419
428
* @memberof Entry
420
429
* @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.
424
433
* @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.
426
435
*
427
436
* @example
428
437
* import * as contentstack from '@contentstack/management'
@@ -438,10 +447,12 @@ export function Entry (http, data) {
438
447
* @description The Import Entry calls given below help you to import entries by uploading JSON files.
439
448
* @memberof Entry
440
449
* @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
445
456
* @example
446
457
* import * as contentstack from '@contentstack/management'
* 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>.
11
11
* @namespace Variants
12
12
*/
13
13
exportfunctionVariants(http,data){
@@ -16,10 +16,10 @@ export function Variants (http, data) {
16
16
if(data&&data.variants_uid){
17
17
this.urlPath+=`/${this.variants_uid}`
18
18
/**
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.
20
20
* @memberof Variants
21
21
* @func update
22
-
* @returns {Promise<Variants.Variants>} Promise for Variants instance
22
+
* @returns {Promise<Object>} Response Object.
23
23
* @example
24
24
* import * as contentstack from '@contentstack/management'
25
25
* const client = contentstack.client()
@@ -58,10 +58,10 @@ export function Variants (http, data) {
58
58
}
59
59
60
60
/**
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.
62
62
* @memberof Variants
63
63
* @func delete
64
-
* @returns {Object} Response Object.
64
+
* @returns {Promise<Object>} Response Object.
65
65
* @example
66
66
* import * as contentstack from '@contentstack/management'
67
67
* const client = contentstack.client()
@@ -75,7 +75,7 @@ export function Variants (http, data) {
75
75
* @description The fetch Variants call fetches Variants details.
76
76
* @memberof Variants
77
77
* @func fetch
78
-
* @returns {Promise<Variants.Variants>} Promise for Variants instance
78
+
* @returns {Promise<Variants>} Promise for Variants instance
79
79
* @example
80
80
* import * as contentstack from '@contentstack/management'
81
81
* const client = contentstack.client()
@@ -87,10 +87,10 @@ export function Variants (http, data) {
87
87
this.fetch=fetch(http,'variants')
88
88
89
89
/**
90
-
* @description The version Variants call fetches Variants version details.
90
+
* @description The versions call fetches variant version details.
91
91
* @memberof Variants
92
92
* @func versions
93
-
* @returns {Promise<Variants.Variants>} Promise for Variants instance
93
+
* @returns {Promise<Object>} Promise for variant versions data
94
94
* @example
95
95
* import * as contentstack from '@contentstack/management'
96
96
* const client = contentstack.client()
@@ -117,19 +117,20 @@ export function Variants (http, data) {
117
117
}
118
118
}else{
119
119
/**
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.
121
121
* @memberof Variants
122
122
* @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.
126
127
*
127
128
* @example
128
129
* import * as contentstack from '@contentstack/management'
0 commit comments