Skip to content

feat: refactor "libraries" category of "runtime components" section #2134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ async function handler(req, rep) {
}
```

As you can see, the Mia-Platform [CustomPluginLib](/development_suite/api-console/api-design/plugin_baas_4.md) for node.js is included by default in the template.
As you can see, the Mia-Platform [CustomPluginLib](/runtime_suite_libraries/custom-plugin-lib/apidoc.md) for node.js is included by default in the template.

:::tip
If you have an on-premise installation, you can add your custom templates to the Marketplace in order to have a uniform codebase. You can also create your template for PaaS Marketplace and request to add it by opening a [Marketplace Contribution issue](https://github.com/mia-platform/community/issues/new/choose) in Mia-Platform Community GitHub repository.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Following we will see how to create a Microservice using the [Console](/developm

:::info
The following guide is generic, so you can follow it to create any type of Microservice from template.
You can read [here](/development_suite/api-console/api-design/plugin_baas_4.md) a dedicated guide about creating from the **Node.js Template**
You can read [here](/runtime_suite_libraries/custom-plugin-lib/apidoc.md) a dedicated guide about creating from the **Node.js Template**
:::

### 1. Microservice creation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ If configured, linked decorators will be shown below the button. Please note tha

### Develop a decorator from scratch

Even though there're [several Mia-Platform libraries](/libraries/mia-service-libraries.md) that abstract the concept of decorator, providing a simple programming interface you might find yourself in the need of design your decorator from scratch.
Even though there're several Mia-Platform libraries that abstract the concept of decorator, providing a simple programming interface you might find yourself in the need of design your decorator from scratch.

In order to do so it is important to know the interface that Mia-Platform uses to send decorator requests and how does it interpret the decorator response.

Expand Down
605 changes: 0 additions & 605 deletions docs/development_suite/api-console/api-design/plugin_baas_4.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/development_suite/api-console/api-design/proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ curl --request GET

The proxy endpoints are exposed on the [API gateway](/runtime_suite/api-gateway/10_overview.md) so you can call them from your microservices making an HTTP request to the API Gateway: `http://api-gateway:8080/your-endpoint`.

You can also use the [Mia-Platform Service Libraries](/libraries/mia-service-libraries.md) that help you to get a proxy towards the API Gateway.
You can also use the [Mia-Platform Service Libraries](/runtime_suite_libraries/custom-plugin-lib/http_client.md) that help you to get a proxy towards the API Gateway.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ For further information contact your Mia Platform representative.
## Code overview

The service starts in `index.js` file.
First, the template uses the [Custom Plugin Lib](/development_suite/api-console/api-design/plugin_baas_4.md) to instantiate a service.
First, the template uses the [Custom Plugin Lib](/runtime_suite_libraries/custom-plugin-lib/apidoc.md) to instantiate a service.
Inside its callback, the `single-view-creator-lib` is initialized to deal with the complexity of the Fast Data components.

```js
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started/faqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ Yes, you can create a [microservice from a Docker Image](/development_suite/api-

### Do I have to start coding my microservice from a template?
#### Is starting from a Mia-Platform Template mandatory?
No, it's not mandatory. However, starting from a [Mia-Platform Template](/marketplace/templates/mia_templates.md) or using [Mia-Platform Service Libraries](/libraries/mia-service-libraries.md) ensures compliance with best practices.
No, it's not mandatory. However, starting from a [Mia-Platform Template](/marketplace/templates/mia_templates.md) or using Mia-Platform Service Libraries ensures compliance with best practices.

### Can I create my own templates?
#### How can I create custom templates for my microservices?
Expand All @@ -332,7 +332,7 @@ You can change endpoint visibility in the Endpoint Management section by disabli

### How can I call a proxy endpoint from my microservices?
#### What is the procedure to call a proxy endpoint from a microservice?
[Proxy endpoints](/development_suite/api-console/api-design/proxy.md) are exposed on the [API gateway](/runtime_suite/api-gateway/10_overview.md). You can call them via HTTP requests to the API Gateway: `http://api-gateway:8080/your-endpoint`. You can also use the [Mia-Platform Service Libraries](/libraries/mia-service-libraries.md) to get a proxy towards the API Gateway.
[Proxy endpoints](/development_suite/api-console/api-design/proxy.md) are exposed on the [API gateway](/runtime_suite/api-gateway/10_overview.md). You can call them via HTTP requests to the API Gateway: `http://api-gateway:8080/your-endpoint`. You can also use the [Mia-Platform Service Library](/runtime_suite_libraries/custom-plugin-lib/http_client.md) to get a proxy towards the API Gateway.

:::tip
Check out the [Mia service Node.js Library documentation](https://github.com/mia-platform/custom-plugin-lib/blob/master/docs/http_client.md) to learn how to call platform services with a proxy object.
Expand Down
82 changes: 0 additions & 82 deletions docs/libraries/create-new-library.md

This file was deleted.

19 changes: 0 additions & 19 deletions docs/libraries/mia-service-libraries.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/marketplace/templates/mia_templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sidebar_label: Mia-Platform Templates
---
A **Template** is a base repository from which you can start to create a new Microservice.

Usually they depend on specific [Mia Service libraries](/libraries/mia-service-libraries.md).
Usually they depend on specific Mia Service libraries.

Mia-Platforms currently supports the following examples:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ In addition (`from Form Service Backend v1.1.1`), you can add the following opti

- **options**, of type *object*, to save an additional `JSON` of options to further customize the visualization of a submitted form in the Form Visualizer. The available options can be found in the [form.io documentation](https://help.form.io/developers/form-renderer#form-renderer-options).

The options can be updated for example updated with a [POST decorator](../../development_suite/api-console/api-design/plugin_baas_4#pre-and-post-decorators) after the submission of a new form.
The options can be updated for example updated with a [POST decorator](/runtime_suite_libraries/custom-plugin-lib/decorators.md) after the submission of a new form.

:::caution

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The Mia-Platform [Microfrontend Composer](../../microfrontend-composer/overview)

:::info

This array is designed to store IDs computed from another assignment property. For instance, it can be used to assign a questionnaire to users of a specific cluster (such as users in the same company or department). You can use a [PRE decorator](../../development_suite/api-console/api-design/plugin_baas_4#pre-and-post-decorators) to manipulate a `POST` or a `PATCH` of an assignment and update the `automaticAssignments` array accordingly.
This array is designed to store IDs computed from another assignment property. For instance, it can be used to assign a questionnaire to users of a specific cluster (such as users in the same company or department). You can use a [PRE decorator](/runtime_suite_libraries/custom-plugin-lib/decorators.md) to manipulate a `POST` or a `PATCH` of an assignment and update the `automaticAssignments` array accordingly.

:::

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
id: kafka2rest
id: overview
title: Kafka2Rest Kotlin Library
sidebar_label: Kafka2Rest
---
Expand Down Expand Up @@ -59,14 +59,14 @@ First of all you need to initialize Kafka2Rest with:

#### Config Parameters

|Parameter|Meaning|
|---|---|
|maxIntervalBetweenPolls|The maximum time (Duration) interval between two consecutive poll. When this timeout is exceeded the method `isRunning()` returns false.|
|topicList|The list of topic to subscribe to.|
|pollTimeout|The time (Duration) spent waiting in poll if data is not available in the buffer. If 0, returns immediately with any records that are available currently in the buffer, else returns empty. Must not be negative.|
|onExceptionTopic|(Optional) Defines a topic where messages causing unhandled processor exceptions will be stored. Kafka2Rest will enrich the message headers with two properties `retryNumber` and `errors`.|
|retriesLimit||
|sleepPeriod||
| Parameter | Meaning |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| maxIntervalBetweenPolls | The maximum time (Duration) interval between two consecutive poll. When this timeout is exceeded the method `isRunning()` returns false. |
| topicList | The list of topic to subscribe to. |
| pollTimeout | The time (Duration) spent waiting in poll if data is not available in the buffer. If 0, returns immediately with any records that are available currently in the buffer, else returns empty. Must not be negative. |
| onExceptionTopic | (Optional) Defines a topic where messages causing unhandled processor exceptions will be stored. Kafka2Rest will enrich the message headers with two properties `retryNumber` and `errors`. |
| retriesLimit | |
| sleepPeriod | |

#### Code Sample

Expand Down
4 changes: 4 additions & 0 deletions docs/runtime_suite_libraries/kafka2rest/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Kafka2Rest",
"position": 10
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
id: rest2kafka
id: overview
title: Rest2Kafka Kotlin Library
sidebar_label: Rest2Kafka
---
Expand Down
4 changes: 4 additions & 0 deletions docs/runtime_suite_libraries/rest2kafka/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Rest2Kafka",
"position": 10
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ and you will pass to it the following parameters:
- `handler`: `helloHandler`, function that contains the actual behavior. It must respect the same interface defined in the documentation of the handlers of fastify.
- `schema`: `helloSchema` , definition of the request and response data schema. The format is the one accepted by fastify.

A more detailed description on how to use our `custom-plugin-lib` to define the behavior of your microservice in response to an HTTP request can be found in [its related section](../../development_suite/api-console/api-design/plugin_baas_4/) of Mia-Platform documentation.
A more detailed description on how to use our `custom-plugin-lib` to define the behavior of your microservice in response to an HTTP request can be found in [its related section](/runtime_suite_libraries/custom-plugin-lib/apidoc.md) of Mia-Platform documentation.

In order to proceed, you need to define a handler, a schema and pass them as parameters to this function.
Below, you can see how the _index.js_ file will look like after having defined all the parameters required by `service.addRawCustomPlugin` function:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ and you will pass to it the following parameters:
- `handler`: `helloHandler`, function that contains the actual behavior. It must respect the same interface defined in the documentation of the handlers of fastify.
- `schema`: `helloSchema` , definition of the request and response data schema. The format is the one accepted by fastify.

A more detailed description on how to use our `custom-plugin-lib` to define the behavior of your microservice in response to an HTTP request can be found in [its related section](../../development_suite/api-console/api-design/plugin_baas_4/) of Mia-Platform documentation.
A more detailed description on how to use our `custom-plugin-lib` to define the behavior of your microservice in response to an HTTP request can be found in [its related section](/runtime_suite_libraries/custom-plugin-lib/apidoc.md) of Mia-Platform documentation.

In order to proceed, you need to define a handler, a schema and pass them as parameters to this function.
Below, you can see how the _index.js_ file will look like after having defined all the parameters required by `service.addRawCustomPlugin` function:
Expand Down
41 changes: 3 additions & 38 deletions sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -1806,50 +1806,15 @@
]
},
{
"label": "Libraries",
"type": "category",
"collapsed": true,
"items": [
{
"collapsed": true,
"items": [
{
"id": "libraries/overview_service_libraries",
"type": "doc"
},
{
"id": "development_suite/api-console/api-design/plugin_baas_4",
"type": "doc"
},
{
"id": "libraries/create-new-library",
"type": "doc"
}
],
"label": "Microservices",
"type": "category"
},
{
"collapsed": true,
"items": [
{
"id": "libraries/kafka2rest",
"type": "doc"
},
{
"id": "libraries/rest2kafka",
"type": "doc"
}
],
"label": "Kafka",
"type": "category"
},

{
"type": "autogenerated",
"dirName": "runtime_suite_libraries"
}
],
"label": "Libraries",
"type": "category"
]
},
{
"label": "Tools",
Expand Down