From 12e822b9290497f47a947995d23e54f356669979 Mon Sep 17 00:00:00 2001 From: Stephen Goldbaum <129341+stephengoldbaum@users.noreply.github.com> Date: Fri, 30 Dec 2022 13:16:38 -0500 Subject: [PATCH 1/4] Organized guides --- docs/README.md | 13 +++ docs/users-guide/Custom Attributes.md | 79 ++++++++++++++++++ docs/users-guide/README.md | 78 ++++++++++++++++++ docs/users-guide/command_line_tools.md | 106 +++++++++++++++++++++++++ docs/users-guide/editor_setup.md | 26 ++++++ docs/users-guide/installation.md | 34 ++++++++ 6 files changed, 336 insertions(+) create mode 100644 docs/README.md create mode 100644 docs/users-guide/Custom Attributes.md create mode 100644 docs/users-guide/README.md create mode 100644 docs/users-guide/command_line_tools.md create mode 100644 docs/users-guide/editor_setup.md create mode 100644 docs/users-guide/installation.md diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 000000000..acc4bfd9c --- /dev/null +++ b/docs/README.md @@ -0,0 +1,13 @@ +# Morphir Documentation +The purpose of the document is to provide a detailed explanation of how various Morphir code artefacts work. +It also documents the standard coding practices adopted for the Morphir project. +Finally, it provides a step by step walk-throughs on how various Morphir components are build. + +## Who this Guide Designed For +Morphir has different components for different users. + +1. **[Morphir User's Guide](users-guide)** - Business users who would like to learn how to use Morphir for modelling business logic. +2. **[Morphir Developer's Guide](developers-guide)** - New joiners to the Morphir project to get up to speed the various building blocks of Morphir. +3. **[Morphir Contributor's Guide](contribution-guide)** - Existing team members intending to improve their abilities on Language Design concepts. + + diff --git a/docs/users-guide/Custom Attributes.md b/docs/users-guide/Custom Attributes.md new file mode 100644 index 000000000..35f8f95fa --- /dev/null +++ b/docs/users-guide/Custom Attributes.md @@ -0,0 +1,79 @@ +# Custom attributes user guide +The contents of this document detail how to structure and load optional "sidecar" files for the purposes of adding custom attributes to Morphir types and values. Custom attributes can assign extra information to business concepts that is otherwise not included in the Morphir IR. + +**Contents:** +- [File format and naming convention](#file-format-and-naming-convention) + - [Config file](#config-file) + - [Attribute file](#attribute-file) +- [Loading and updating the attribute files](#loading-and-updating-the-attribute-files) + + + + +## File format, and naming convention +To define a custom attribute, we need at least three JSON files. + + 1. A config file named `attribute.conf.json` that lists the attribute ID's, and maps them to display names. + 2. At least one attribute file named `.json` in the `attributes`. + 3. An IR containing a type definitions + +### Config file +``` +{ + "test-id-1": { + "displayName" : "MS.Sensitivity" + , "entryPoint" : "Morphir.Attribute.Model.Sensitivity.Sensitivity" + , "ir" : "attributes/sensitivity.ir.json" + } + "test-id-2": { + ... + } +} +``` +The above example is a sample config file structure. The config file should contain key-value pairs in a JSON format, where the key is the attribute name, and the value is the attribute description. +The attribute description should include an entrypoint in the form of an [FQName](https://package.elm-lang.org/packages/finos/morphir-elm/latest/Morphir.IR.FQName) (this is the type describing your custom attribute), a display name, and a path to the IR file containing your type model + +### Attribute file +``` +{ + "Morphir.Reference.Model.Issues.Issue401:bar": { + "MNPI": false, + "PII": true + }, + "Morphir.Reference.Model.Issues.Issue401:foo": { + "MNPI": false, + "PII": false + } +} +``` +The above example is a sample attribute file structure. The attribute file should be a dictionary in a JSON format, where the keys are Morphir [FQName](https://package.elm-lang.org/packages/finos/morphir-elm/latest/Morphir.IR.FQName)s, and the values are any valid JSON object. + + +## Loading and updating the attribute files +We currently provide the following APIs. + +***GET /server/attributes/*** +Returns the a JSON file with a very similar structure to the config file, but amended with `data` fields containing the actual custom attribute values, and the `ir` field containing the actual IR instead of a path pointing to it + +``` +{ + "test-id-1": { + "displayName" : + , "entryPoint" : + , "ir" : "" + , "data" : + } + "test-id-2": { + ... + } +} +``` + +***POST /server/updateattribute/\*** +``` +{ + "nodeId" : , + "newAttribute: +} +``` +Updates the given node with the given new attribute. \ No newline at end of file diff --git a/docs/users-guide/README.md b/docs/users-guide/README.md new file mode 100644 index 000000000..58ab72d1d --- /dev/null +++ b/docs/users-guide/README.md @@ -0,0 +1,78 @@ +# Morphir Users' Guide +Morphir's core purpose is to collect and store the vital business logic of an application. To fulfull that goal, +Morphir provides tools to write business logic, visualize and interac with it, and use it to generate useful things. + +## Who this Guide Designed For +This guide is for business users, analysts, and developers who want to use Morphir to tap the potential in their business logic. + +## Content +1. [Getting Setup](#) + 1. [Installation](installation.md) + 1. [Editor Setup](editor_setup.md) + 1. [The Morphir Tools](command_line_tools.md) + 1. [Compile](command_line_tools.md#Compile) + 1. [Visualize](command_line_tools.md#Visualize) + 1. [Generate](command_line_tools.md#Generate) +
+
+ +[//]: # (1. [Quick Start]()) + +[//]: # ( 1. [Thinking in Morphir]()) + +[//]: # ( 1. [Describing the Business Domain]()) + +[//]: # ( 1. [Adding Logic]()) + +[//]: # ( 1. [Ensuring Correctness]()) + +[//]: # ( 1. [Testing]()) + +[//]: # ( 1. [Building, Executing, and Deploying]()) + +[//]: # (
) + +[//]: # (
) + +[//]: # () +[//]: # (1. [Advanced Topics](#)) + +[//]: # ( 1. [More On Writing Business Logic](#)) + +[//]: # ( 1. [What Makes a Good Model](#)) + +[//]: # ( 1. [Modelling an Application](#)) + +[//]: # ( 1. [Modelling an API](#)) + +[//]: # ( 1. [Modelling the Local State](#)) + +[//]: # ( 1. [Modelling Remote State Dependencies](#)) + +[//]: # ( 1. [Modelling Decision Tables](#)) + +[//]: # ( 1. [Modelling for Database Developers](#)) + +[//]: # ( 1. [Execution](#)) + +[//]: # ( 1. [Complete Examples](#)) + +[//]: # ( 1. [A Simple Walkthrough - The Surfing Board Model](#)) + +[//]: # ( 1. [Overview](#)) + +[//]: # ( 1. [Installing Morphir](#)) + +[//]: # ( 1. [The First Logic](#)) + +[//]: # ( 1. [Generating Code](#)) + +[//]: # ( 1. [Use Case: US LCR](#)) + +[//]: # ( 1. [Modelling LCR](#)) + +[//]: # ( 1. [Modelling Calculations](#)) + +[//]: # ( 1. [Modelling Collection Operations](#)) + +[//]: # ( 1. [Modellng Structures](#)) diff --git a/docs/users-guide/command_line_tools.md b/docs/users-guide/command_line_tools.md new file mode 100644 index 000000000..b11b69910 --- /dev/null +++ b/docs/users-guide/command_line_tools.md @@ -0,0 +1,106 @@ +# Morphir Command Line Tools + +## Compile (Elm) +Morphir revolves around the Intermediate Representation (IR), which is the data format for storing logic. +Morphir users compile their business logic into the IR using morphir's compiler tools. For Elm-authored logic, +is done through the following: + +```shell +morphir-elm make +``` + +Options include: +```shell +Usage: morphir-elm make [options] + +Translate Elm sources to Morphir IR + +Options: +-p, --project-dir Root directory of the project where morphir.json is located. (default: ".") +-o, --output Target file location where the Morphir IR will be saved. (default: "morphir-ir.json") +-t, --types-only Only include type information in the IR, no values. (default: false) +-f, --fallback-cli Full rebuild. (default: false) +-h, --help display help for command +``` + +## Visualize +Morphir contains tools to interact with, learn, and test Morphir applications. This can be invoked via: + +```shell +morphir-elm develop +``` + +Options include: +```shell +Usage: morphir-elm develop [options] + +Start up a web server and expose developer tools through a web UI + +Options: + -p, --port Port to bind the web server to. (default: "3000") + -o, --host Host to bind the web server to. (default: "0.0.0.0") + -i, --project-dir Root directory of the project where morphir.json is located. (default: ".") + -h, --help display help for command +``` + +Note that the default http://0.0.0.0:3000 sometimes needs to be replaced with http://localhost:3000 +depending on the host environment. + + +## Generate +Morphir provides tools to generate useful things from a Morphir IR. + +```shell +morphir-elm gen +``` + +Options include: +```shell +Usage: morphir-elm gen [options] + +Generate code from Morphir IR + +Options: + -i, --input Source location where the Morphir IR will be loaded from. (default: "morphir-ir.json") + -o, --output Target location where the generated code will be saved. (default: "./dist") + -t, --target Language to Generate (Scala | SpringBoot | cypher | triples | TypeScript). (default: "Scala") + -m, --modules-to-include Limit the set of modules that will be included. + -h, --help display help for command +``` + +### Generate Scala +```shell +morphir-elm gen -t Scala +``` + +Options include: +```shell + -e, --target-version Scala language version to Generate. (default: "2.11") + -c, --copy-deps Copy the dependencies used by the generated code to the output path. (default: false) +``` + +### Generate Json Schema +```shell +morphir-elm gen -t JsonSchema +``` + +Options include: +```shell + -s, --include-codecs Generate JSON codecs (default: false) + -f, --filename Filename of the generated JSON Schema. (default: "") +``` + +### Generate TypeScript +```shell +morphir-elm gen -t TypeScript +``` + +### Generate Turtle for semantic web technologies +```shell +morphir-elm gen -t semantic +``` + +### Generate Cypher for graph databases +```shell +morphir-elm gen -t cypher +``` diff --git a/docs/users-guide/editor_setup.md b/docs/users-guide/editor_setup.md new file mode 100644 index 000000000..f190d6463 --- /dev/null +++ b/docs/users-guide/editor_setup.md @@ -0,0 +1,26 @@ +# Editor Setup for Writing Business Logic +Morphir is designed to allow users to write business logic in multiple ways. That currently includes the following: + +## Active +### Elm +The [Elm programming language](https://elm-lang.org) is a simple functional programming language that has proven to be +a great match for writing business logic. Elm has first-class language support in: + * [Visual Studio Code](https://code.visualstudio.com/) - Elm support is provided via the [Elm Tooling](https://marketplace.visualstudio.com/items?itemName=Elmtooling.elm-ls-vscode) extension. + * [IntelliJ](https://www.jetbrains.com/idea/) - Elm support is provided via the [Elm Plugin](https://plugins.jetbrains.com/plugin/10268-elm). + +More information about Elm for Morphir can be found at the [FINOS morphir-elm project](https://github.com/finos/morphir-elm). + +## In Progress +### Scala +Support for Scala as an morphir authoring language is under construction at the [FINOS morphir-scala project](https://github.com/finos/morphir-scala). + +Scala supports a wide range of IDEs. + +### Bosque +Bosque is a language from Microsoft Research. More information on Bosque can be found at the [Bosque Project](https://github.com/microsoft/BosqueLanguage). + +### Cadl +Cadl is a language for describing cloud service APIs. Morphir information can be found at the [Cadl Project](https://github.com/microsoft/cadl). + +## Others +There will always be newer and better ways to write stuff. We will update this list as support for others are added. \ No newline at end of file diff --git a/docs/users-guide/installation.md b/docs/users-guide/installation.md new file mode 100644 index 000000000..acfbe71a0 --- /dev/null +++ b/docs/users-guide/installation.md @@ -0,0 +1,34 @@ +# Morphir Tools Installation and Setup +Morphir provides command line tools for executing morphir tasks. +These tools are delivered by the ```npm``` package management system. Therefore, installation +requires that ```Node.js``` and ```npm```, whose installation instructions can be found at the [npm site](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm). + +## Installation +To install morphir, run: + +```npm install -g morphir-elm``` + +## Setup +The Morphir tools required a configuration file called `morphir.json` located in the project +root directory with the following structure: + +``` +{ + "name": "My.Package", + "sourceDirectory": "src" +} +``` + +An optional section can be added to specify a subset of modules to be used by Morphir: + +``` +{ + "name": "My.Package", + "sourceDirectory": "src", + "exposedModules": [ + "Module", + "OtherModule" + ] +} +``` + From 4358710c9f35f2bc1d684b9680bc7e210cd2fb05 Mon Sep 17 00:00:00 2001 From: Stephen Goldbaum <129341+stephengoldbaum@users.noreply.github.com> Date: Fri, 30 Dec 2022 13:49:01 -0500 Subject: [PATCH 2/4] Organized guides --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e698b5aa..5238c6342 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,11 @@ Defines a standard format for storing and sharing business logic. A clear set of > _Morphir’s automated processing helps disseminate information which otherwise may not be understood or shared at all, a useful tool when brining elements of business logic to conversation outside of its immediate audience (i.e developers)._ ## FINOS Morphir Resources +### Documentation +If you want to start using Morphir, start with the [Documentation](docs/). -[Morphir Resource Centre](https://resources.finos.org/morphir/) +### Other Resources +If you're interested in learning more about the project, [Morphir Resource Centre](https://resources.finos.org/morphir/), has many links. | Episode | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | From a3386e5f1fedbdc41fdbd078384190635ae99c06 Mon Sep 17 00:00:00 2001 From: Stephen Goldbaum <129341+stephengoldbaum@users.noreply.github.com> Date: Fri, 30 Dec 2022 18:15:28 -0500 Subject: [PATCH 3/4] Organized guides - Cleaned up README.md --- README.md | 37 +++++-------------------------------- docs/media.md | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 32 deletions(-) create mode 100644 docs/media.md diff --git a/README.md b/README.md index 5238c6342..1a9bad031 100644 --- a/README.md +++ b/README.md @@ -39,30 +39,15 @@ Defines a standard format for storing and sharing business logic. A clear set of > _Morphir’s automated processing helps disseminate information which otherwise may not be understood or shared at all, a useful tool when brining elements of business logic to conversation outside of its immediate audience (i.e developers)._ -## FINOS Morphir Resources -### Documentation -If you want to start using Morphir, start with the [Documentation](docs/). - -### Other Resources -If you're interested in learning more about the project, [Morphir Resource Centre](https://resources.finos.org/morphir/), has many links. - -| Episode | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | -|
| Introduction to the Morphir Showcase | -| | What Morphir is with Stephen Goldbaum | -| | How Morphir works with Attila Mihaly | -| | Why Morphir is Important – with Colin, James & Stephen | -| | The Benefits & Use Case of Morphir with Jane, Chris & Stephen | -| | How to get involved – Closing Panel Q&A | -| | Morphir Showcase – Full Show | -# An ecosystem of innovative features +## Documentation +If you want to start using Morphir, start with the [Documentation](docs/). -Supporting the development of your business' needs in an ever-developing ecosystem based on firm standards and the integration of new languages. +## Other Resources +[List of media](docs/media.md) -Check out [Stephen Goldbaum's Morphir Examples on GitHub](https://github.com/stephengoldbaum/morphir-examples/tree/master/tutorial) -# Further reading +### Further reading | Introduction & Background | Using Morphir | Applicability | | :------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | @@ -72,18 +57,6 @@ Check out [Stephen Goldbaum's Morphir Examples on GitHub](https://github.com/ste | [What's it all about?](./docs/whats_it_about.md) | [Modeling Decision Tables](https://github.com/finos/morphir-examples/tree/master/src/Morphir/Sample/Rules) | | | [Why we use Functional Programming?](./docs/why_functional_programming.md) | [Modeling for database developers](./docs/modeling/modeling-for-database-developers.md) | -# Development setup - -Morphir is a collection of tools. Each tool is in its own repo with its own installation instructions. The main development tools, and the best place to get started, are currently in [Morphir Elm](https://github.com/finos/morphir-elm). - -## Usage example - -Morphir tools can be used to optimize a wide range of development tasks. For example, Morphir can be used to define and automated development of an entire service. The [Morphir Dapr](https://github.com/finos/morphir-dapr) project is example of this. - -Another good use of Morphir is to define shared rules than can be used across heterogeneous systems. This can be useful for initiatives like open-source Reg Tech models that are shared across firms. [Morphir LCR](https://github.com/finos/morphir-examples/tree/main/tests/Morphir/Sample/Reg/LCR) presents a good example of this. - -More Morphir examples can be found at [Morphir Examples](https://github.com/finos/morphir-examples/). - ## Roadmap List the roadmap steps; alternatively link the Confluence Wiki page where the project roadmap is published. diff --git a/docs/media.md b/docs/media.md new file mode 100644 index 000000000..3a2187ede --- /dev/null +++ b/docs/media.md @@ -0,0 +1,14 @@ +# Media About Morphir + +If you're interested in learning more about the project, [Morphir Resource Centre](https://resources.finos.org/morphir/), has many links. + +| Episode | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| | Introduction to the Morphir Showcase | +| | What Morphir is with Stephen Goldbaum | +| | How Morphir works with Attila Mihaly | +| | Why Morphir is Important – with Colin, James & Stephen | +| | The Benefits & Use Case of Morphir with Jane, Chris & Stephen | +| | How to get involved – Closing Panel Q&A | +| | Morphir Showcase – Full Show | + From d5d1f2e7249fa91f435a601a62dd754c2f93c5af Mon Sep 17 00:00:00 2001 From: James McLeod Date: Fri, 6 Jan 2023 11:15:45 +0000 Subject: [PATCH 4/4] fix mdx closing tags Signed-off-by: James McLeod --- ...-a-special-case-of-a-relational-backend.md | 36 +++++++++---------- docs/media.md | 19 +++++----- docs/users-guide/Custom Attributes.md | 36 +++++++++++-------- website/yarn.lock | 7 ---- 4 files changed, 47 insertions(+), 51 deletions(-) diff --git a/docs/decisions/0001-implement-the-spark-backend-as-a-special-case-of-a-relational-backend.md b/docs/decisions/0001-implement-the-spark-backend-as-a-special-case-of-a-relational-backend.md index 0d5cda67e..097ed19ed 100644 --- a/docs/decisions/0001-implement-the-spark-backend-as-a-special-case-of-a-relational-backend.md +++ b/docs/decisions/0001-implement-the-spark-backend-as-a-special-case-of-a-relational-backend.md @@ -6,14 +6,14 @@ Given that Apache Spark's data model is an extended relational data model and mo ## Decision Drivers -* Future potential/limitations -* Implementation effort +- Future potential/limitations +- Implementation effort ## Considered Options -* Map to Relational IR first, then to Spark IR -* Map directly to Spark IR -* Map directly to Spark IR, but implement flatten and joins as reusable functions +- Map to Relational IR first, then to Spark IR +- Map directly to Spark IR +- Map directly to Spark IR, but implement flatten and joins as reusable functions ## Decision Outcome @@ -21,13 +21,13 @@ Chosen option: "{option 1}", because {justification. e.g., only option, which me ### Positive Consequences -* {e.g., improvement of quality attribute satisfaction, follow-up decisions required, …} -* … +- {e.g., improvement of quality attribute satisfaction, follow-up decisions required, …} +- … ### Negative Consequences -* {e.g., compromising quality attribute, follow-up decisions required, …} -* … +- {e.g., compromising quality attribute, follow-up decisions required, …} +- … ## Pros and Cons of the Options @@ -39,8 +39,8 @@ graph LR B --> B2C(Spark Backend) --> C[Spark IR] ``` -* Good, because it makes the relational mapping reusable -* Bad, because the Relational IR limits the scope of Spark operations we can map to +- Good, because it makes the relational mapping reusable +- Bad, because the Relational IR limits the scope of Spark operations we can map to ### Map directly to Spark IR @@ -50,8 +50,8 @@ graph LR B2C(Spark Backend) --> C[Spark IR] ``` -* Good, because we can fully utilize Spark's capabilities to implement all possible Morphir features -* Bad, because we cannot reuse the solutions we come up with for flattening and joins +- Good, because we can fully utilize Spark's capabilities to implement all possible Morphir features +- Bad, because we cannot reuse the solutions we come up with for flattening and joins ### Map directly to Spark IR, but implement flatten and joins as reusable functions @@ -63,12 +63,10 @@ graph LR B2C -.-> J[join] ``` -* Good, because we can fully utilize Spark's capabilities to implement all possible Morphir features -* Good, because we can reuse the solutions we come up with for flattening and joins - +- Good, because we can fully utilize Spark's capabilities to implement all possible Morphir features +- Good, because we can reuse the solutions we come up with for flattening and joins ## Links -* {Link type} {Link to ADR} -* … - +- {Link type} {Link to ADR} +- … diff --git a/docs/media.md b/docs/media.md index 3a2187ede..a5d81c976 100644 --- a/docs/media.md +++ b/docs/media.md @@ -2,13 +2,12 @@ If you're interested in learning more about the project, [Morphir Resource Centre](https://resources.finos.org/morphir/), has many links. -| Episode | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | -| | Introduction to the Morphir Showcase | -| | What Morphir is with Stephen Goldbaum | -| | How Morphir works with Attila Mihaly | -| | Why Morphir is Important – with Colin, James & Stephen | -| | The Benefits & Use Case of Morphir with Jane, Chris & Stephen | -| | How to get involved – Closing Panel Q&A | -| | Morphir Showcase – Full Show | - +| Episode | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| | Introduction to the Morphir Showcase | +| | What Morphir is with Stephen Goldbaum | +| | How Morphir works with Attila Mihaly | +| | Why Morphir is Important – with Colin, James & Stephen | +| | The Benefits & Use Case of Morphir with Jane, Chris & Stephen | +| | How to get involved – Closing Panel Q&A | +| | Morphir Showcase – Full Show | diff --git a/docs/users-guide/Custom Attributes.md b/docs/users-guide/Custom Attributes.md index 35f8f95fa..722ed8009 100644 --- a/docs/users-guide/Custom Attributes.md +++ b/docs/users-guide/Custom Attributes.md @@ -1,23 +1,24 @@ # Custom attributes user guide + The contents of this document detail how to structure and load optional "sidecar" files for the purposes of adding custom attributes to Morphir types and values. Custom attributes can assign extra information to business concepts that is otherwise not included in the Morphir IR. **Contents:** + - [File format and naming convention](#file-format-and-naming-convention) - - [Config file](#config-file) - - [Attribute file](#attribute-file) + - [Config file](#config-file) + - [Attribute file](#attribute-file) - [Loading and updating the attribute files](#loading-and-updating-the-attribute-files) +## File format, and naming convention +To define a custom attribute, we need at least three JSON files. +1. A config file named `attribute.conf.json` that lists the attribute ID's, and maps them to display names. +2. At least one attribute file named `.json` in the `attributes`. +3. An IR containing a type definitions -## File format, and naming convention -To define a custom attribute, we need at least three JSON files. - - 1. A config file named `attribute.conf.json` that lists the attribute ID's, and maps them to display names. - 2. At least one attribute file named `.json` in the `attributes`. - 3. An IR containing a type definitions - ### Config file + ``` { "test-id-1": { @@ -30,10 +31,12 @@ To define a custom attribute, we need at least three JSON files. } } ``` -The above example is a sample config file structure. The config file should contain key-value pairs in a JSON format, where the key is the attribute name, and the value is the attribute description. + +The above example is a sample config file structure. The config file should contain key-value pairs in a JSON format, where the key is the attribute name, and the value is the attribute description. The attribute description should include an entrypoint in the form of an [FQName](https://package.elm-lang.org/packages/finos/morphir-elm/latest/Morphir.IR.FQName) (this is the type describing your custom attribute), a display name, and a path to the IR file containing your type model ### Attribute file + ``` { "Morphir.Reference.Model.Issues.Issue401:bar": { @@ -46,13 +49,14 @@ The attribute description should include an entrypoint in the form of an [FQName } } ``` -The above example is a sample attribute file structure. The attribute file should be a dictionary in a JSON format, where the keys are Morphir [FQName](https://package.elm-lang.org/packages/finos/morphir-elm/latest/Morphir.IR.FQName)s, and the values are any valid JSON object. +The above example is a sample attribute file structure. The attribute file should be a dictionary in a JSON format, where the keys are Morphir [FQName](https://package.elm-lang.org/packages/finos/morphir-elm/latest/Morphir.IR.FQName)s, and the values are any valid JSON object. ## Loading and updating the attribute files + We currently provide the following APIs. -***GET /server/attributes/*** +**_GET /server/attributes/_** Returns the a JSON file with a very similar structure to the config file, but amended with `data` fields containing the actual custom attribute values, and the `ir` field containing the actual IR instead of a path pointing to it ``` @@ -69,11 +73,13 @@ Returns the a JSON file with a very similar structure to the config file, but am } ``` -***POST /server/updateattribute/\*** +**_POST /server/updateattribute/\_** + ``` -{ +{ "nodeId" : , "newAttribute: } ``` -Updates the given node with the given new attribute. \ No newline at end of file + +Updates the given node with the given new attribute. diff --git a/website/yarn.lock b/website/yarn.lock index 13ec5b4fe..4140361ef 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -2567,17 +2567,10 @@ binary-extensions@^2.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== - -bluebird@^3.7.1: - version "3.7.2" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" - integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== - body-parser@1.20.1: version "1.20.1" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== - dependencies: bytes "3.1.2" content-type "~1.0.4"