Skip to content

Commit

Permalink
feat: Release compiled versions
Browse files Browse the repository at this point in the history
  • Loading branch information
batje committed Apr 6, 2019
1 parent 7e6b4cf commit 6e54922
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 21 deletions.
46 changes: 39 additions & 7 deletions dist/jcognos.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,7 @@ var CognosRequest = (function() {
result = response;
} else {
try {
result = response.replace(/=\\'/g, "='");
result = result.replace(/\\']/g, "']");
result = JSON.parse(result);
result = response.data;
} catch (err) {
me.log('No valid JSON returned from delete request. ' + path);
result = response;
Expand Down Expand Up @@ -1416,7 +1414,7 @@ var Cognos = (function() {
if (id) {
result = me.requester
.put('bi/v1/palettes/' + id, false, palette)
.then(function(data) {
.then(function() {
me.log('saved palette ' + id);
return id;
})
Expand All @@ -1432,7 +1430,7 @@ var Cognos = (function() {
.then(function() {
me.log('We have been reset, savePalette again');
me.resetting = false;
return me.savePalettes(id, palette);
return me.savePalette(id, palette);
})
.catch(function() {
throw err;
Expand All @@ -1441,7 +1439,7 @@ var Cognos = (function() {
} else {
result = me.requester
.post('bi/v1/palettes/my', palette, true)
.then(function(data) {
.then(function() {
me.log('saved palette');
})
.catch(function(err) {
Expand All @@ -1451,7 +1449,7 @@ var Cognos = (function() {
.then(function() {
me.log('We have been reset, savePalette again');
me.resetting = false;
return me.savePalettes(palette, id);
return me.savePalette(palette, id);
})
.catch(function() {
throw err;
Expand All @@ -1461,6 +1459,40 @@ var Cognos = (function() {

return result;
}
},
{
key: 'deletePalette',
value: function deletePalette(id) {
var me = this;
var params = {
force: 'true'
};
var result = me.requester
.delete('bi/v1/palettes/' + id, params, false)
.then(function() {
me.log('deleted palette ' + id);
return id;
})
.catch(function(err) {
me.error('CognosRequest : Error in deletePalette', err);

if (err == 'Not Found') {
throw 'Palette with id ' + id + ' is not found';
}

return me
.handleError(err)
.then(function() {
me.log('We have been reset, deletePalette again');
me.resetting = false;
return me.deletePalette(id);
})
.catch(function() {
throw err;
});
});
return result;
}
}
]);

Expand Down
46 changes: 39 additions & 7 deletions dist/jcognos.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,7 @@ var CognosRequest = (function() {
result = response;
} else {
try {
result = response.replace(/=\\'/g, "='");
result = result.replace(/\\']/g, "']");
result = JSON.parse(result);
result = response.data;
} catch (err) {
me.log('No valid JSON returned from delete request. ' + path);
result = response;
Expand Down Expand Up @@ -1408,7 +1406,7 @@ var Cognos = (function() {
if (id) {
result = me.requester
.put('bi/v1/palettes/' + id, false, palette)
.then(function(data) {
.then(function() {
me.log('saved palette ' + id);
return id;
})
Expand All @@ -1424,7 +1422,7 @@ var Cognos = (function() {
.then(function() {
me.log('We have been reset, savePalette again');
me.resetting = false;
return me.savePalettes(id, palette);
return me.savePalette(id, palette);
})
.catch(function() {
throw err;
Expand All @@ -1433,7 +1431,7 @@ var Cognos = (function() {
} else {
result = me.requester
.post('bi/v1/palettes/my', palette, true)
.then(function(data) {
.then(function() {
me.log('saved palette');
})
.catch(function(err) {
Expand All @@ -1443,7 +1441,7 @@ var Cognos = (function() {
.then(function() {
me.log('We have been reset, savePalette again');
me.resetting = false;
return me.savePalettes(palette, id);
return me.savePalette(palette, id);
})
.catch(function() {
throw err;
Expand All @@ -1453,6 +1451,40 @@ var Cognos = (function() {

return result;
}
},
{
key: 'deletePalette',
value: function deletePalette(id) {
var me = this;
var params = {
force: 'true'
};
var result = me.requester
.delete('bi/v1/palettes/' + id, params, false)
.then(function() {
me.log('deleted palette ' + id);
return id;
})
.catch(function(err) {
me.error('CognosRequest : Error in deletePalette', err);

if (err == 'Not Found') {
throw 'Palette with id ' + id + ' is not found';
}

return me
.handleError(err)
.then(function() {
me.log('We have been reset, deletePalette again');
me.resetting = false;
return me.deletePalette(id);
})
.catch(function() {
throw err;
});
});
return result;
}
}
]);

Expand Down
46 changes: 39 additions & 7 deletions dist/jcognos.js
Original file line number Diff line number Diff line change
Expand Up @@ -17050,9 +17050,7 @@
result = response;
} else {
try {
result = response.replace(/=\\'/g, "='");
result = result.replace(/\\']/g, "']");
result = JSON.parse(result);
result = response.data;
} catch (err) {
me.log('No valid JSON returned from delete request. ' + path);
result = response;
Expand Down Expand Up @@ -19501,7 +19499,7 @@
if (id) {
result = me.requester
.put('bi/v1/palettes/' + id, false, palette)
.then(function(data) {
.then(function() {
me.log('saved palette ' + id);
return id;
})
Expand All @@ -19517,7 +19515,7 @@
.then(function() {
me.log('We have been reset, savePalette again');
me.resetting = false;
return me.savePalettes(id, palette);
return me.savePalette(id, palette);
})
.catch(function() {
throw err;
Expand All @@ -19526,7 +19524,7 @@
} else {
result = me.requester
.post('bi/v1/palettes/my', palette, true)
.then(function(data) {
.then(function() {
me.log('saved palette');
})
.catch(function(err) {
Expand All @@ -19536,7 +19534,7 @@
.then(function() {
me.log('We have been reset, savePalette again');
me.resetting = false;
return me.savePalettes(palette, id);
return me.savePalette(palette, id);
})
.catch(function() {
throw err;
Expand All @@ -19546,6 +19544,40 @@

return result;
}
},
{
key: 'deletePalette',
value: function deletePalette(id) {
var me = this;
var params = {
force: 'true'
};
var result = me.requester
.delete('bi/v1/palettes/' + id, params, false)
.then(function() {
me.log('deleted palette ' + id);
return id;
})
.catch(function(err) {
me.error('CognosRequest : Error in deletePalette', err);

if (err == 'Not Found') {
throw 'Palette with id ' + id + ' is not found';
}

return me
.handleError(err)
.then(function() {
me.log('We have been reset, deletePalette again');
me.resetting = false;
return me.deletePalette(id);
})
.catch(function() {
throw err;
});
});
return result;
}
}
]);

Expand Down

0 comments on commit 6e54922

Please sign in to comment.