Skip to content

Commit fd0f7d4

Browse files
authored
Merge pull request #48 from contentstack/CS-33521
add: getPublishes and getReleases support
2 parents 9021f00 + 932ba95 commit fd0f7d4

File tree

3 files changed

+36
-19
lines changed

3 files changed

+36
-19
lines changed

package-lock.json

Lines changed: 8 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentstack/app-sdk",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
44
"types": "dist/src/index.d.ts",
55
"description": "This SDK helps connect to the development server of the Contentstack and sync the data.",
66
"main": "dist/index.js",
@@ -56,7 +56,7 @@
5656
"webpack-dev-server": "^4.7.3"
5757
},
5858
"dependencies": {
59-
"loader-utils": "^3.2.0",
59+
"loader-utils": "^3.2.1",
6060
"post-robot": "8.0.29",
6161
"wolfy87-eventemitter": "5.2.4"
6262
},

src/stack/index.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,32 @@ class Stack {
107107
return this._connection.sendToParent('stackQuery', options).then(onData).catch(onError);
108108
}
109109

110+
/**
111+
* This API allows you to retrieve details of releases of a stack using the {@link https://www.contentstack.com/docs/developers/apis/content-management-api/#get-all-releases| Releases API} requests. This method returns a Promise object.
112+
* @param {Object} query Query for the GET call
113+
* @param {Object} params Optional parameters for the GET call
114+
* @return {Object} A Promise object which will be resolved with details of the releases.
115+
*/
116+
getReleases(query = {}, params = {}) {
117+
const optionParams: { [key: string]: any } = params;
118+
optionParams.query = query;
119+
const options = { params: optionParams, action: 'getReleases' };
120+
return this._connection.sendToParent('stackQuery', options).then(onData).catch(onError);
121+
}
122+
123+
/**
124+
* This API allows you to retrieve details of publish queue of a stack using the {@link https://www.contentstack.com/docs/developers/apis/content-management-api/#get-publish-queue| Publish Queue API} requests. This method returns a Promise object.
125+
* @param {Object} query Query for the GET call
126+
* @param {Object} params Optional parameters for the GET call
127+
* @return {Object} A Promise object which will be resolved with details of the publish queue.
128+
*/
129+
getPublishes(query = {}, params = {}) {
130+
const optionParams: { [key: string]: any } = params;
131+
optionParams.query = query;
132+
const options = { params: optionParams, action: 'getPublishes' };
133+
return this._connection.sendToParent('stackQuery', options).then(onData).catch(onError);
134+
}
135+
110136
/**
111137
* This API allows you to retrive a locale of a stack using the {@link https://www.contentstack.com/docs/apis/content-management-api/#get-a-language| Language API} requests. Method returns a Promise object.
112138
* @param {string} code Code of the desired locale

0 commit comments

Comments
 (0)