diff --git a/docs/connectors/morningstar.md b/docs/connectors/morningstar.md index eaa1208..800abc1 100644 --- a/docs/connectors/morningstar.md +++ b/docs/connectors/morningstar.md @@ -49,6 +49,8 @@ types. ### Available Connectors -* [RNANews](morningstar/rna-news/regulatory-news-announcements.md) +* [Goal Analysis](morningstar/goal-analysis.md) +* [RNANews](morningstar/regulatory-news-announcements.md) +* [Risk Score](morningstar/risk-score.md) * [TimeSeries](morningstar/time-series/time-series.md) * [XRay](morningstar/x-ray.md) diff --git a/docs/connectors/morningstar/goal-analysis.md b/docs/connectors/morningstar/goal-analysis.md new file mode 100644 index 0000000..aca348c --- /dev/null +++ b/docs/connectors/morningstar/goal-analysis.md @@ -0,0 +1,45 @@ +Goal Analysis Connector +======================= + +The Morningstar Goal Analysis service calculates the probabilities of an +investor meeting their financial goals based on assumptions about markets and +the assets in a portfolio. + + + +How to use Goal Analysis +------------------------ + +The Goal Analysis Connector provides an easy way to create an analysis to +specific scenarios. The options give control over insights displayed in charts +and dashboards. + +In order to fetch the analysis, you can request for example: + +```js +const goalAnalysisConnector = MC.GoalAnalysisConnector({ + postman: { + environmentJSON: postmanJSON + }, + annualInvestment: 4800, + assetClassWeights: [ + 0.1, 0, 0, 0, 0, 0, 0, 0, 0.08, 0.03, 0, 0, 0.17, + 0.05, 0, 0, 0, 0.13, 0.28, 0, 0, 0, 0.11, 0, 0 + ], + currentSavings: 20000, + includeDetailedInvestmentGrowthGraph: true, + requestProbability: 90, + target: 9000, + timeHorizon: 5 +}); +``` + +For more details, see [Morningstar's Goal Analysis API]. + + + + + + + +[Morningstar's Goal Analysis API]: https://developer.morningstar.com/direct-web-services/documentation/api-reference/portfolio-analysis-apacemea/goal-analysis diff --git a/docs/connectors/morningstar/rna-news/regulatory-news-announcements.md b/docs/connectors/morningstar/regulatory-news-announcements.md similarity index 100% rename from docs/connectors/morningstar/rna-news/regulatory-news-announcements.md rename to docs/connectors/morningstar/regulatory-news-announcements.md diff --git a/docs/connectors/morningstar/risk-score/risk-score.md b/docs/connectors/morningstar/risk-score.md similarity index 100% rename from docs/connectors/morningstar/risk-score/risk-score.md rename to docs/connectors/morningstar/risk-score.md diff --git a/docs/connectors/morningstar/x-ray.md b/docs/connectors/morningstar/x-ray.md index bca3a2a..3f3d262 100644 --- a/docs/connectors/morningstar/x-ray.md +++ b/docs/connectors/morningstar/x-ray.md @@ -17,7 +17,7 @@ You can use the X-Ray Connector to fetch portfolio data points, holding data points, or benchmark data points. Depending on the request additional breakdown columns might be added to the table. -In order to fetch a benchmark, you can for example +In order to fetch a benchmark, you can request for example: ```js const xRayConnector = MC.XRayConnector({ diff --git a/src/CLI/Library/APIServer.ts b/src/CLI/Library/APIServer.ts index 9e281e7..74a6cc4 100644 --- a/src/CLI/Library/APIServer.ts +++ b/src/CLI/Library/APIServer.ts @@ -131,51 +131,6 @@ const STATIC_PATH = Path.join(__dirname, '..', 'Static'); * */ -/** - * Creates or retrieves an option with the given name path. - * - * @param tree - * Tree root to walk on. - * - * @param nodePath - * Node path to retrieve. - * - * @return - * Created or retrieved option. - */ -function treeNode ( - tree: Options, - nodePath: string -): Option { - let node: Option = { - doclet: {}, - meta: { - fullname: '', - name: '' - }, - children: tree - }; - - let currentName = ''; - - for (const name of nodePath.split('.')) { - currentName = (currentName ? `${currentName}.${name}` : name); - node = node.children[name] = ( - node.children[name] || - { - doclet: {}, - meta: { - fullname: currentName, - name - }, - children: {} - } - ); - } - - return node; -} - function escape ( text: string @@ -234,7 +189,7 @@ async function getOption ( if (node) { option.doclet.description = - await Marked.parse(jsdoc2Markdown(node.description)); + await Marked.parse(jsdoc2Markdown(escape(node.description))); if (node.deprecated) { option.doclet.deprecated = `${node.deprecated.toFixed(2)}.0`; @@ -246,7 +201,7 @@ async function getOption ( (option.doclet as Record).default = node.doclet.default.join(','); } else { - option.doclet.defaultvalue = escape(node.doclet.default.join(',')); + option.doclet.defaultvalue = node.doclet.default.join(','); } } } @@ -265,11 +220,11 @@ async function getOption ( root.meta.hasChildren = true; childOption = treeNode(root.children, child.name); childOption.doclet.description = - await Marked.parse(jsdoc2Markdown(child.description)); + await Marked.parse(jsdoc2Markdown(escape(child.description))); if (child.doclet.type) { childOption.doclet.type = { - name: child.doclet.type.map(escape) + name: child.doclet.type }; } @@ -319,33 +274,6 @@ function jsdoc2Markdown (text: string): string { } -async function toNav ( - item: Database.Item -): Promise