@ixon-cdk/core 1.1.0-next.9 → 1.2.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,7 +26,7 @@ module.exports = class DeployService extends ApiBaseService {
26
26
  fetchPublishable(companyId, templateId) {
27
27
  return this._fetchDescTemplateVersions(companyId, templateId).then((versions) => {
28
28
  const publishedIdx = versions.findIndex((v) => typeof v.publishedOn === 'string');
29
- return publishedIdx !== -1 ? versions.slice(0, publishedIdx) : versions;
29
+ return publishedIdx !== -1 ? versions.slice(0, publishedIdx) : versions;
30
30
  });
31
31
  }
32
32
 
@@ -55,10 +55,12 @@ module.exports = class DeployService extends ApiBaseService {
55
55
  });
56
56
  }
57
57
 
58
- publishLatestVersion(companyId, templateId) {
59
- return this.fetchPublishable(companyId, templateId).then((data) => {
58
+ publishLatestVersion(companyId, templateId, failNoUnpublished) {
59
+ return this.fetchPublishable(companyId, templateId).then(data => {
60
60
  if (!data.length) {
61
- return Promise.reject('Template has no publishable versions');
61
+ return failNoUnpublished
62
+ ? Promise.reject('Template has no publishable versions')
63
+ : Promise.resolve('Template has no publishable versions');
62
64
  }
63
65
  const latest = data.sort((v1, v2) => Number(v2.number) - Number(v1.number))[0];
64
66
  return this._publish(companyId, latest.publicId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ixon-cdk/core",
3
- "version": "1.1.0-next.9",
3
+ "version": "1.2.0-next.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "",
package/server/index.js CHANGED
@@ -104,6 +104,7 @@ module.exports = class Server {
104
104
  const queryString = params.toString();
105
105
  const openUrl = `${this._getBaseUrl()}/?${queryString}`;
106
106
  require('opener')(openUrl);
107
+ return openUrl;
107
108
  }
108
109
 
109
110
  _getBaseUrl() {