@@ -19,7 +19,7 @@ export function Terms (http, data) {
19
19
this . urlPath = `/taxonomies/${ this . taxonomy_uid } /terms/${ this . uid } `
20
20
21
21
/**
22
- * @description The Update terms call is used to update an existing terms .
22
+ * @description The Update terms call is used to update an existing term .
23
23
* @memberof Terms
24
24
* @func update
25
25
* @returns {Promise<Terms.Terms> } Promise for Terms instance
@@ -38,7 +38,7 @@ export function Terms (http, data) {
38
38
this . update = update ( http , 'term' )
39
39
40
40
/**
41
- * @description The Delete terms call is used to delete an existing terms .
41
+ * @description The Delete terms call is used to delete an existing term .
42
42
* @memberof Terms
43
43
* @func delete
44
44
* @returns {Promise<Terms.Terms> } Response Object.
@@ -53,7 +53,7 @@ export function Terms (http, data) {
53
53
this . delete = deleteEntity ( http )
54
54
55
55
/**
56
- * @description The Fetch terms call is used to fetch an existing terms .
56
+ * @description The Fetch terms call is used to fetch an existing term .
57
57
* @memberof Terms
58
58
* @func fetch
59
59
* @returns {Promise<Terms.Terms> } Promise for Terms instance
@@ -66,6 +66,20 @@ export function Terms (http, data) {
66
66
*
67
67
*/
68
68
this . fetch = fetch ( http , 'term' )
69
+
70
+ /**
71
+ * @description The ancestors call is used to get all the ancestor terms of an existing term.
72
+ * @memberof Terms
73
+ * @func ancestors
74
+ * @returns {Promise<Terms.Terms> } Promise for Terms instance
75
+ * @example
76
+ * import * as contentstack from '@contentstack/management'
77
+ * const client = contentstack.client()
78
+ *
79
+ * client.stack({ api_key: 'api_key'}).terms('terms_uid').ancestors()
80
+ * .then((terms) => console.log(terms))
81
+ *
82
+ */
69
83
this . ancestors = async ( params = { } ) => {
70
84
try {
71
85
const headers = {
@@ -78,6 +92,20 @@ export function Terms (http, data) {
78
92
throw err
79
93
}
80
94
}
95
+
96
+ /**
97
+ * @description The move call is used to existing term.
98
+ * @memberof Terms
99
+ * @func descendants
100
+ * @returns {Promise<Terms.Terms> } Promise for Terms instance
101
+ * @example
102
+ * import * as contentstack from '@contentstack/management'
103
+ * const client = contentstack.client()
104
+ *
105
+ * client.stack({ api_key: 'api_key'}).terms('terms_uid').descendants()
106
+ * .then((terms) => console.log(terms))
107
+ *
108
+ */
81
109
this . descendants = async ( params = { } ) => {
82
110
try {
83
111
const headers = {
@@ -90,6 +118,24 @@ export function Terms (http, data) {
90
118
throw err
91
119
}
92
120
}
121
+
122
+ /**
123
+ * @description The move call is used to update the parent uid.
124
+ * @memberof Terms
125
+ * @func anscestors
126
+ * @returns {Promise<Terms.Terms> } Promise for Terms instance
127
+ * @example
128
+ * import * as contentstack from '@contentstack/management'
129
+ * const client = contentstack.client()
130
+ *
131
+ * const term = {
132
+ * parent_uid: 'parent_uid',
133
+ * order: 2
134
+ * }
135
+ * client.stack({ api_key: 'api_key'}).terms('terms_uid').move(term)
136
+ * .then((terms) => console.log(terms))
137
+ *
138
+ */
93
139
this . move = move ( http , 'term' )
94
140
} else {
95
141
/**
@@ -128,6 +174,19 @@ export function Terms (http, data) {
128
174
*/
129
175
this . query = query ( { http : http , wrapperCollection : TermsCollection } )
130
176
}
177
+ /**
178
+ * @description The Search terms call is used to search a term.
179
+ * @memberof Terms
180
+ * @func search
181
+ * @returns {Promise<Terms.Terms> } Promise for Terms instance
182
+ * @example
183
+ * import * as contentstack from '@contentstack/management'
184
+ * const client = contentstack.client()
185
+ * const term_string = ''
186
+ * client.stack({ api_key: 'api_key'}).terms().search(term_string)
187
+ * .then(terms) => console.log(terms)
188
+ *
189
+ */
131
190
this . search = async ( term = '' , params = { } ) => {
132
191
try {
133
192
const headers = {
0 commit comments