Skip to content

Commit 9442e95

Browse files
authored
Merge pull request #251 from contentstack/staging
DX | 27-01-2025 | Release
2 parents 1321565 + 545a721 commit 9442e95

20 files changed

+1612
-1226
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [v1.19.1](https://github.com/contentstack/contentstack-management-javascript/tree/v1.19.1) (2025-01-27)
4+
- Feature
5+
- Added support for get entry references
6+
- Added delay sanity testcases
7+
- Axios, webpack, form-data, qs version bump
8+
39
## [v1.19.0](https://github.com/contentstack/contentstack-management-javascript/tree/v1.19.0) (2025-01-13)
410
- Feature
511
- Release 2.0 feature

lib/stack/contentType/entry/index.js

+29
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,35 @@ export function Entry (http, data) {
352352
}
353353
}
354354

355+
/**
356+
* @description The get references request allows to get the references of an entry.
357+
* @memberof Entry
358+
* @func references
359+
* @returns {Promise<Object>} Response Object.
360+
* @example 1
361+
* client.stack({ api_key: 'api_key'}).contentType('content_type_uid').entry('uid').references()
362+
* .then((response) => console.log(response));
363+
* @example 2
364+
* client.stack({ api_key: 'api_key'}).contentType('content_type_uid').entry('uid').references({locale: 'en-us'})
365+
* .then((response) => console.log(response));
366+
*/
367+
this.references = async (param = {}) => {
368+
const headers = {}
369+
if (this.stackHeaders) {
370+
headers.headers = this.stackHeaders
371+
}
372+
try {
373+
const response = await http.get(`${this.urlPath}/references`, {...headers, params: param,})
374+
if (response.data) {
375+
return response.data
376+
} else {
377+
throw error(response)
378+
}
379+
} catch (err) {
380+
throw error(err)
381+
}
382+
}
383+
355384
} else {
356385
/**
357386
* @description The Create an entry call creates a new entry for the selected content type.

0 commit comments

Comments
 (0)