File tree Expand file tree Collapse file tree 8 files changed +1756
-886
lines changed
Expand file tree Collapse file tree 8 files changed +1756
-886
lines changed Load Diff Large diffs are not rendered by default.
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ class ContentstackDemo {
2424 */
2525 getEntries ( contentTypeUid ) {
2626 contentTypeUid = contentTypeUid || 'source'
27- return this . Stack . ContentType ( contentTypeUid ) . Query ( ) . includeReference ( 'secondary_section.reference.reference' ) . find ( )
27+ return this . Stack . ContentType ( "source" ) . Query ( ) . includeSchema ( ) . IncludeReferenceContentTypeUID ( ) . find ( )
2828 }
2929
3030 /**
@@ -61,11 +61,6 @@ class ContentstackDemo {
6161 return this . Stack . getContentType ( uid )
6262 }
6363
64-
65-
66-
67-
68-
6964 /**
7065 * fetchEntry
7166 * @description : fetchEntry is used to get the specified uid entry
Original file line number Diff line number Diff line change 11{
22 "name" : " contentstack" ,
3- "version" : " 3.6 .0" ,
3+ "version" : " 3.7 .0" ,
44 "description" : " Contentstack Javascript SDK" ,
55 "homepage" : " https://www.contentstack.com/" ,
66 "author" : {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import Query from './query';
66 * @class
77 Assets
88* @summary Creates an instance of `Assets`.
9- * @description Retrieves the asset based on the specified UID
9+ * @description Retrieves all assets of a stack by default. To retrieve a single asset, specify its UID.
1010* @param {String } uid - uid of asset you want to retrieve
1111* @example
1212* let data = Stack.Assets('bltsomething123').toJSON().fetch()
@@ -16,6 +16,14 @@ import Query from './query';
1616* }, function(error) {
1717* // error function
1818* })
19+ * @example
20+ * let data = Stack.Assets().toJSON().find()
21+ * data
22+ * .then(function(result) {
23+ * // ‘result’ will display all assets present in stack
24+ * }, function(error) {
25+ * // error function
26+ * })
1927* @returns {Assets }
2028* @instance
2129*/
Original file line number Diff line number Diff line change @@ -193,6 +193,29 @@ export default class Entry {
193193 return this ;
194194 }
195195
196+ /**
197+ * @method includeReferenceContentTypeUid
198+ * @memberOf Entry
199+ * @description This method also includes the content type UIDs of the referenced entries returned in the response.
200+ * @example Stack.ContentType("contentType_uid").Entry("entry_uid").includeReferenceContentTypeUID().fetch()
201+ * @example
202+ * Query = Stack.ContentType("contentType_uid").Entry("entry_uid").includeReferenceContentTypeUID().fetch()
203+ * Query
204+ * .toJSON()
205+ * .then(function (result) {
206+ * let value = result.get(field_uid)
207+ * },function (error) {
208+ * // error function
209+ * })
210+ * @returns {Entry }
211+ * @instance
212+ */
213+ includeReferenceContentTypeUID ( ) {
214+ this . _query [ 'include_reference_content_type_uid' ] = true ;
215+ return this ;
216+ }
217+
218+
196219 /**
197220 * @method includeContentType
198221 * @memberOf Entry
Original file line number Diff line number Diff line change @@ -497,6 +497,28 @@ export default class Query extends Entry {
497497 }
498498 }
499499
500+ /**
501+ * @method includeReferenceContentTypeUid
502+ * @memberOf Query
503+ * @description This method also includes the content type UIDs of the referenced entries returned in the response.
504+ * @example Stack.ContentType("contentType_uid").Query().includeReferenceContentTypeUID().find()
505+ * @example
506+ * let blogQuery = Stack.ContentType("contentType_uid").Query();
507+ * let data = blogQuery.includeReferenceContentTypeUID().find()
508+ * data.then(function(result) {
509+ * // ‘result’ contains a list of entries in which content type UIDs is present.
510+ * },function (error) {
511+ * // error function
512+ * })
513+ * @returns {Query }
514+ * @instance
515+ */
516+ includeReferenceContentTypeUID ( ) {
517+ this . _query [ 'include_reference_content_type_uid' ] = true ;
518+ return this ;
519+ }
520+
521+
500522 /**
501523 * @method includeCount
502524 * @memberOf Query
@@ -530,7 +552,6 @@ export default class Query extends Entry {
530552 * @returns {Query }
531553 * @instance
532554 */
533-
534555 addParam ( key , value ) {
535556 if ( key && value && typeof key === 'string' && typeof value === 'string' ) {
536557 this . _query [ key ] = value ;
@@ -595,7 +616,7 @@ export default class Query extends Entry {
595616 * })
596617 * @returns {Query }
597618 * @instance
598- */
619+ */
599620 search ( value ) {
600621 if ( value && typeof value === 'string' ) {
601622 this . _query [ 'typeahead' ] = value ;
@@ -663,6 +684,7 @@ export default class Query extends Entry {
663684 query : this . _query
664685 }
665686 } ;
687+
666688 return Utils . sendRequest ( this ) ;
667689 }
668690
You can’t perform that action at this time.
0 commit comments