microstrategy
Advanced tools
Comparing version 0.1.13 to 0.1.14
@@ -14,5 +14,28 @@ const assert = require('assert'); | ||
_getV2Base() { | ||
return 'v2/dossiers'; | ||
} | ||
/** | ||
* Get hierarchy of a dossier, uses predecessor to v2 API | ||
* | ||
* @param {*} dossierId | ||
* @returns | ||
*/ | ||
getDossierDefinition(dossierId) { | ||
assert(dossierId, 'No dossierId provided'); | ||
return this._makeRequest(`${this._getV2Base()}/${dossierId}/definition`, false, 'GET', this.getProjectHeader()) | ||
.then(result => this.throwIfFailed(result, 200)); | ||
} | ||
/** | ||
* @deprecated Get hierarchy of a dossier, uses predecessor to v2 API | ||
* | ||
* @param {string} dossierId | ||
* @returns | ||
*/ | ||
getDossierDefinitionOld(dossierId) { | ||
assert(dossierId, 'No dossierId provided'); | ||
return this._makeRequest(`${this._getBase()}/${dossierId}/definition`, false, 'GET', this.getProjectHeader()) | ||
@@ -22,2 +45,10 @@ .then(result => this.throwIfFailed(result, 200)); | ||
/** | ||
* Execute a specific dossier and create an instance of the dossier | ||
* | ||
* @param {string} dossierId | ||
* @param {object} body (optional) | ||
* @param {boolean} asyncMode (optional) | ||
* @returns | ||
*/ | ||
createDossierInstance(dossierId, body, asyncMode) { | ||
@@ -34,14 +65,37 @@ assert(dossierId, 'No dossierId provided'); | ||
getDossierVisualization(params) { | ||
assertParam(params); | ||
assertParam(params, 'dossierId'); | ||
assertParam(params, 'instanceId'); | ||
assertParam(params, 'chapterKey'); | ||
assertParam(params, 'visualizationKey'); | ||
/** | ||
* Get the hierarchy of a specific dossier in a specific project from instance. | ||
* | ||
* @param {string} dossierId | ||
* @param {string} instanceId | ||
* @returns {Promise} resolving object representing dossier hierarchy | ||
*/ | ||
getDossierInstanceDefinition(dossierId, instanceId) { | ||
assert(dossierId, 'No dossierId provided'); | ||
assert(instanceId, 'No instanceId provided'); | ||
const endpoint = `${this._getBase()}/${params.dossierId}/instances/${params.instanceId}/chapters/${params.chapterKey}/visualizations/${params.visualizationKey}`; | ||
return this._makeRequest(endpoint, params, 'GET', this.getProjectHeader()) | ||
return this._makeRequest(`${this._getV2Base()}/${dossierId}/instances/${instanceId}/definition`, false, 'GET', this.getProjectHeader()) | ||
.then(result => this.throwIfFailed(result, 200)); | ||
} | ||
/** | ||
* Get the definition and data result of a grid/graph visuaization in a specific dossier & project. | ||
* | ||
* @param {string} dossierId | ||
* @param {string} instanceId | ||
* @param {string} chapterKey | ||
* @param {string} visualizationKey | ||
* @returns | ||
*/ | ||
getDossierVisualization(dossierId, instanceId, chapterKey, visualizationKey) { | ||
assert(dossierId, 'No dossierId provided'); | ||
assert(instanceId, 'No instanceId provided'); | ||
assert(chapterKey, 'No chapterKey provided'); | ||
assert(visualizationKey, 'No visualizationKey provided'); | ||
const endpoint = `${this._getV2Base()}/${dossierId}/instances/${instanceId}/chapters/${chapterKey}/visualizations/${visualizationKey}`; | ||
return this._makeRequest(endpoint, false, 'GET', this.getProjectHeader()) | ||
.then(result => this.throwIfFailed(result, 200)); | ||
} | ||
}; |
{ | ||
"name": "microstrategy", | ||
"version": "0.1.13", | ||
"version": "0.1.14", | ||
"description": "A node.js wrapper for the MicroStrategy REST API & Task API", | ||
@@ -5,0 +5,0 @@ "main": "./lib/mstr.js", |
@@ -25,3 +25,3 @@ # MicroStrategy REST API [![npm version](https://img.shields.io/npm/v/microstrategy.svg)][1] [![npm size](https://img.shields.io/bundlephobia/min/microstrategy.svg)][1] [![npm downloads](https://img.shields.io/npm/dt/microstrategy.svg)][1] | ||
```html | ||
<script src="https://cdn.jsdelivr.net/gh/tiagosiebler/microstrategy-api-node/dist/mstrapi.min.js" crossorigin="anonymous"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/microstrategy/dist/mstrapi.min.js" crossorigin="anonymous"></script> | ||
``` | ||
@@ -28,0 +28,0 @@ See [./webpack](./webpack) for documentation on the bundling process. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
998878
9036
0