### Install and Start Development Server Source: https://context7.com/mwpo79/documentation/llms.txt Installs project dependencies using yarn and starts a local development server for hot-reloading. This command is used for local development and testing changes. ```bash # Install dependencies yarn install # Start development server on http://localhost:3000 yarn start # The site will automatically reload when you save changes # Search functionality is disabled in local development ``` -------------------------------- ### Download and Install miactl Binary (Linux/macOS) Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-11.x.x/cli/miactl/20_setup.md Installs the miactl CLI by downloading the binary using curl or wget. Requires permissions to move the file to /usr/local/bin. May require sudo. ```shell curl -fsSL https://github.com/mia-platform/miactl/releases/download/v0.8.0/miactl-linux-amd64 -o /tmp/miactl ``` ```shell wget -q https://github.com/mia-platform/miactl/releases/download/v0.8.0/miactl-linux-amd64 -O /tmp/miactl ``` ```shell sha256sum /tmp/miactl ``` ```shell chmod +x /tmp/miactl mv /tmp/miactl /usr/local/bin ``` ```shell sudo mv /tmp/miactl /usr/local/bin ``` -------------------------------- ### Install miactl via Go (Linux/macOS) Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-11.x.x/cli/miactl/20_setup.md Installs the miactl CLI using Go. Requires Go version >= 1.13 and the $GOPATH environment variable to be set. ```shell go install github.com/mia-platform/miactl/cmd/miactl@v0.8.0 ``` ```shell go get -u github.com/mia-platform/miactl/cmd/miactl@0.8.0 ``` -------------------------------- ### Install miactl via Homebrew (Linux/macOS) Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-11.x.x/cli/miactl/20_setup.md Installs the miactl CLI using the Homebrew package manager. Ensure Homebrew is installed on your system. ```shell brew install mia-platform/tap/miactl ``` -------------------------------- ### Download and install miactl binary using wget Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-10.x.x/cli/miactl/20_setup.md Downloads the miactl binary for Linux AMD64 using wget. This method is an alternative to curl for downloading the executable. The downloaded file requires further steps for installation. ```sh wget -q https://github.com/mia-platform/miactl/releases/download/v0.4.0/miactl-linux-amd64 -O /tmp/miactl ``` -------------------------------- ### Install miactl via Go Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-10.x.x/cli/miactl/20_setup.md Installs the miactl CLI using the Go programming language. Requires Go version 1.13 or higher and the GOPATH environment variable to be set. Provides two command options. ```go go install github.com/mia-platform/miactl@0.4.0 ``` ```go go get -u github.com/mia-platform/miactl@0.4.0 ``` -------------------------------- ### Install miactl using Go (Linux/macOS) Source: https://github.com/mwpo79/documentation/blob/main/docs/cli/miactl/20_setup.md Installs the miactl CLI tool using the Go programming language. Requires Go version >= 1.13 and the $GOPATH environment variable to be set. Installs the tool to the Go bin path. ```go go install github.com/mia-platform/miactl/cmd/miactl@v0.11.0 ``` ```go go get -u github.com/mia-platform/miactl/cmd/miactl@0.11.0 ``` -------------------------------- ### Install Dependencies and Start CRUD Service Source: https://github.com/mwpo79/documentation/blob/main/docs/marketplace/handbooks/crud-oss-usage.mdx These commands are used to install the necessary Node.js dependencies for the CRUD Service and then start the service using your custom configuration from the .env file. Ensure you have Node.js and npm installed, and use 'nvm use' if managing Node.js versions with nvm. ```bash nvm use # <-- only if you use nvm npm i npm run start:local ``` -------------------------------- ### Install mlp CLI using Homebrew Source: https://github.com/mwpo79/documentation/blob/main/docs/runtime_suite_tools/mlp/20_setup.md Installs the Mia-Platform CLI (mlp) using the Homebrew package manager. This is a convenient way to get the tool on macOS and Linux systems. ```sh brew install mia-platform/tap/mlp ``` -------------------------------- ### Install Flow Manager Client with npm Source: https://github.com/mwpo79/documentation/blob/main/docs/runtime_suite_libraries/flow-manager-client/setup.md Installs the Flow Manager client library using npm. This is a prerequisite for using the client in your Node.js project. Ensure you have Node.js and npm installed. ```shell npm i --save @mia-platform/flow-manager-client ``` -------------------------------- ### Example CRUD GET Request (cURL, Node, JavaScript, Java) Source: https://github.com/mwpo79/documentation/blob/main/docs/console/project-configuration/documentation-portal.md Demonstrates example request formats for a CRUD GET operation, including cURL, Node.js, JavaScript, and Java. These examples are useful for understanding how to interact with the API and can be copied directly for testing. ```curl curl -X GET "http://localhost:8080/plates?id=1&name=plate1&description=A%20beautiful%20plate&price=10.0" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_SECRET_TOKEN" ``` ```javascript const fetch = require('node-fetch'); const apiUrl = 'http://localhost:8080/plates'; const secretToken = 'YOUR_SECRET_TOKEN'; async function getPlates() { try { const response = await fetch(apiUrl, { method: 'GET', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${secretToken}` }, // Query parameters can be added here if the API supports them via body or URL construction }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const data = await response.json(); console.log('Plates:', data); } catch (error) { console.error('Error fetching plates:', error); } } getPlates(); ``` ```javascript fetch('http://localhost:8080/plates', { method: 'GET', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_SECRET_TOKEN' } }) .then(response => { if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return response.json(); }) .then(data => { console.log('Plates:', data); }) .catch(error => { console.error('Error fetching plates:', error); }); ``` ```java import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.io.IOException; public class PlateApiClient { public static void main(String[] args) { HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("http://localhost:8080/plates?id=1&name=plate1&description=A%20beautiful%20plate&price=10.0")) .header("Content-Type", "application/json") .header("Authorization", "Bearer YOUR_SECRET_TOKEN") .GET() .build(); try { HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println("Status Code: " + response.statusCode()); System.out.println("Response Body: " + response.body()); } catch (IOException | InterruptedException e) { e.printStackTrace(); } } } ``` -------------------------------- ### Mia-Platform Console Installation Chart Configuration Source: https://github.com/mwpo79/documentation/blob/main/docs/infrastructure/self-hosted/installation-chart/90-installation-chart-example.md This YAML configuration defines settings for a Mia-Platform console installation. It includes parameters for image pull secrets, service URLs, authentication provider configurations for GitLab, GitHub, Okta, and Microsoft, as well as database and file storage settings. Placeholders like `` need to be replaced with actual values. ```yaml nameOverride: "" # optional fullnameOverride: "" # optional mia-console: imageCredentials: name: "" # array of image pull secret to pull Console services username: "" # username of the user which download the image from the container registry password: "" # password of the user which download the image from the container registry email: "" # email of the user which download the image from the container registry configurations: consoleUrl: "" cmsUrl: "" marketplaceSyncFilters: "" # optional: use one or more of this values separated by a comma: template plugin example application. It is suggested to use at least plugin, to have the plugin automatically updated in marketplace repositoryHostname: "" # the docker registry host used for all the docker images in the projects authProviders: # this is the placeholder to use if your auth provider is gitlab - name: "" # name of the provider type: "gitlab" label: "Login" # label of the login button baseUrl: "" # base url of the gitlab instance clientId: "" clientSecret: "" authPath: "/oauth/authorize" tokenPath: "/oauth/token" userInfoPath: "/api/v4/user" userSettingsURL: "/-/profile" # url to get user settings skipRefreshProviderTokenOnMiaTokenRefresh: true # optional: skip the refresh of the provider token when the console one is expired # this is the placeholder to use if your auth provider is github - name: "" # name of the provider type: "github" baseUrl: "" # base url of the github instance apiBaseUrl: # api base url clientId: "" clientSecret: "" cmsClientId: "" # The app id with redirect to cms cmsClientSecret: "" # The app secret with redirect to cms authPath: "/oauth/authorize" tokenPath: "/oauth/token" userInfoUrl: "/user" userSettingsURL: "/settings/profile" # url to get user settings skipRefreshProviderTokenOnMiaTokenRefresh: true # optional: skip the refresh of the provider token when the console one is expired # this is the placeholder to use if your auth provider is okta - name: "" # name of the provider type: "okta" label: "Login" # label of the login button baseUrl: "" # base url of okta clientId: "" clientSecret: "" authPath: "/oauth2/v1/authorize" tokenPath: "/oauth2/v1/token" userInfoPath: "/oauth2/v1/userinfo" userSettingsURL: "/enduser/settings" logoutUrlPath: "/oauth2/v1/logout" skipRefreshProviderTokenOnMiaTokenRefresh: true # optional: skip the refresh of the provider token when the console one is expired # this is the placeholder to use if your auth provider is microsoft - name: "" # name of the provider type: "microsoft" baseUrl: "" # base url of microsoft instance clientId: "" clientSecret: "" authPath: "/authorize" tokenPath: "/token" userInfoUrl: "https://graph.microsoft.com/oidc/userinfo" userSettingsURL: "https://account.microsoft.com/profile/" logoutUrlPath: "/logout" skipRefreshProviderTokenOnMiaTokenRefresh: true # optional: skip the refresh of the provider token when the console one is expired redisHost: "" # optional: default is "redis.default.svc.cluster.local:6379". If installed with this chart, set it to "redis:6379" mongodbUrl: "" # url for the mongodb connection for the console filesStorageType: "mongodb" filesBucketName: "" # gridFS collection name multitinenantNamespace: "" miaPlatformDefaultCompanyId: "mia-platform" # the ID of the default Mia-Platform company serviceAccountAuthProvider: rsaPrivateKeyId: "PRIVATE KEY ID" rsaPrivateKeyPass: "PRIVATE KEY PASSPHRASE" clientIdSalt: "CLIENT SALT" rsaPrivateKeyBase64: | "BASE64_PrivateKey" userAccountAuthProvider: tokenPassphrase: "" # An HMAC string of 128 bytes for authentication purpose ``` -------------------------------- ### Download and install miactl binary using curl Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-10.x.x/cli/miactl/20_setup.md Downloads the miactl binary for Linux AMD64 using curl. After downloading, the file needs to be made executable and moved to a directory in the system's PATH. ```sh curl -fsSL https://github.com/mia-platform/miactl/releases/download/v0.4.0/miactl-linux-amd64 -o /tmp/miactl ``` -------------------------------- ### Install miactl using Homebrew (Linux/macOS) Source: https://github.com/mwpo79/documentation/blob/main/docs/cli/miactl/20_setup.md Installs the miactl CLI tool using Homebrew. Requires Homebrew to be installed on the system. No specific inputs or outputs are detailed, but it modifies the system's installed packages. ```shell brew install mia-platform/tap/miactl ``` -------------------------------- ### Docker Setup for Local Testing Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-11.x.x/runtime_suite_libraries/flow-manager-client/setup.md Commands to set up a local testing environment using Docker. This includes creating a Docker network, pulling Kafka and Zookeeper images, running them, and then clearing the Docker environment. Requires Docker to be installed and running. ```shell docker network create app --driver bridge ``` ```shell docker pull bitnami/zookeeper docker pull bitnami/kafka ``` ```shell docker run -d --rm --name zookeeper --network=app -e ALLOW_ANONYMOUS_LOGIN=yes -p 2180:2181 bitnami/zookeeper docker run --rm \ --network app \ --name=kafka \ -e KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181 \ -e KAFKA_CFG_ADVERTISED_LISTENERS='PLAINTEXT://127.0.0.1:9092,INTERNAL://localhost:9093' \ -e KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP='PLAINTEXT:PLAINTEXT,INTERNAL:PLAINTEXT' \ -e KAFKA_CFG_LISTENERS='PLAINTEXT://0.0.0.0:9092,INTERNAL://0.0.0.0:9093' \ -e KAFKA_INTER_BROKER_LISTENER_NAME='INTERNAL' \ -e ALLOW_PLAINTEXT_LISTENER=yes \ -p 2181:2181 \ -p 443:9092 \ -p 9092:9092 \ -p 9093:9093 \ bitnami/kafka ``` ```shell docker kill zookeeper docker network rm app ``` -------------------------------- ### Gitlab CI mlp Usage Example Source: https://github.com/mwpo79/documentation/blob/main/docs/runtime_suite_tools/mlp/20_setup.md Provides an example script section for a Gitlab CI configuration file demonstrating how to use the `mlp` tool for generating, interpolating, and deploying resources. It highlights the use of environment variables and specific `mlp` commands. ```yaml script: - mkdir OUTPUT_DIR - mlp generate -c config-file.yaml -e FIRST_PREFIX -e SECOND_PREFIX -o OUTPUT_DIR - mlp interpolate -f SOURCE_PATH -e FIRST_PREFIX -e SECOND_PREFIX -o OUTPUT_DIR - mlp deploy --server KUBERNETES_URL --certificate-authority /path/to/kubernetes/ca.pem --token KUBERNETES_TOKEN -f OUTPUT_DIR -n KUBERNETES_NAMESPACE --deploy-type DEPLOY_TYPE --force-deploy-when-no-semver=FORCE_DEPLOY_WHEN_NO_SEMVER ``` -------------------------------- ### Get mlp Go module Source: https://github.com/mwpo79/documentation/blob/main/docs/runtime_suite_tools/mlp/20_setup.md Retrieves the Mia-Platform CLI (mlp) Go module using `go get`. This is useful for Go projects that might interact with or depend on mlp functionalities. ```go go get -u github.com/mia-platform/mlp ``` -------------------------------- ### Make miactl executable and move to PATH Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-10.x.x/cli/miactl/20_setup.md Makes the downloaded miactl binary executable and moves it to /usr/local/bin, making it accessible system-wide. This is a crucial step after downloading the binary. ```sh chmod +x /tmp/miactl ``` ```sh mv /tmp/miactl /usr/local/bin ``` -------------------------------- ### Example: Forward GET to /login-site to demo-login-site Source: https://github.com/mwpo79/documentation/blob/main/docs/development_suite/api-console/advanced-section/api-gateway/how-to.md This example demonstrates forwarding GET requests to '/login-site' to the 'demo-login-site' service, regardless of client-key presence or user authorization. ```nginx "~^(secreted|unsecreted)-(0|1)-GET-/login-site" "demo-login-site"; ``` -------------------------------- ### State Adapter Initialization Example Source: https://github.com/mwpo79/documentation/blob/main/docs/microfrontend-composer/back-kit/60_components/510_state_adapter.md This JSON configuration illustrates a practical example of setting up the State Adapter. It defines an `initKey` and a `configMap` with multiple key-event mappings for handling different states. ```json { "tag": "bk-state-adapter", "properties": { "initKey": "key_0", "configMap": { "key_1": "loading-data", "key_2": "add-new" } } } ``` -------------------------------- ### Get Categories API Response Example Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-10.x.x/runtime_suite/pharma-e-commerce-backend/usage.md Example JSON response for the GET /categories endpoint, which retrieves product categories and subcategories for a specified address and provider. The language can be configured via an environment variable. ```json [ { "id": 1, "name": "Category 1", "subcategories": [] }, { "id": 2, "name": "Category 2", "subcategories": [ { "id": 1, "name": "Subcategory 1" } ] }, { "id": 3, "name": "Category 3", "subcategories": [ { "id": 1, "name": "Subcategory 1" }, { "id": 2, "name": "Subcategory 2" } ] } ] ``` -------------------------------- ### Create Miactl Contexts Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-10.x.x/cli/miactl/40_examples.md Demonstrates how to set up different types of contexts for interacting with Mia Platform Console. This includes contexts for companies, projects on cloud instances, and self-hosted instances, with options for custom certificate authorities. ```bash miactl context set paas-company --company-id ``` ```bash miactl context set paas-project --company-id --project-id ``` ```bash miactl context set example-console --endpoint https://example.com ``` ```bash miactl context set example-private --endpoint https://console.private --ca-cert /path/to/custom/private/ca.crt ``` -------------------------------- ### GET /providers Response Example Source: https://github.com/mwpo79/documentation/blob/main/docs/runtime_suite/pharma-e-commerce-backend/30_usage.md Example JSON response for the GET /providers endpoint, listing active pharmaceutical e-commerce providers available at a given location. This response structure indicates the names of the providers. ```json { "providers": [ "pharmaPrime" ] } ``` -------------------------------- ### Run lc39 using CLI Source: https://github.com/mwpo79/documentation/blob/main/docs/runtime_suite_libraries/lc39/main-entrypoint.md This snippet demonstrates how to execute the lc39 CLI tool to start a service. It specifies the main entrypoint file and an environment file for configuration. ```sh lc39 ./index.js --env-path .env ``` -------------------------------- ### GET /calendar/ with _q parameter for date filtering Source: https://github.com/mwpo79/documentation/blob/main/docs/runtime_suite/appointment-manager/30_usage.md This code snippet illustrates using the `_q` query parameter to filter calendar events by date range. It shows examples of different JSON structures that can be passed within `_q` to specify start and end dates, offering more complex filtering options. ```HTTP GET /calendar/?_q={"startDate": "2022-10-01T00:00:00Z", "endDate": "endDate=2022-11-01T00:00:00Z"} ``` ```HTTP GET /calendar/?_q={"and": [{"startDate": "2022-10-01T00:00:00Z"}, {"endDate": "endDate=2022-11-01T00:00:00Z"}]} ``` ```HTTP GET /calendar/?_q={"and": [{"startDate": {"eq": "2022-10-01T00:00:00Z"}}, {"endDate": {"eq": "endDate=2022-11-01T00:00:00Z"}}]} ``` -------------------------------- ### GET /calendar/count Request Examples Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-10.x.x/runtime_suite/appointment-manager/usage.md Examples demonstrating how to use the GET /calendar/count endpoint with different methods for specifying the date period. It supports direct startDate and endDate query parameters, or these can be embedded within the `_q` query parameter. ```http GET /calendar/?startDate=2022-10-01T00:00:00Z&endDate=2022-11-01T00:00:00Z ``` ```http GET /calendar/?_q={"startDate": "2022-10-01T00:00:00Z", "endDate": "endDate=2022-11-01T00:00:00Z"} ``` ```http GET /calendar/?_q={"and": [{"startDate": "2022-10-01T00:00:00Z"}, {"endDate": "endDate=2022-11-01T00:00:00Z"}]} ``` ```http GET /calendar/?_q={"and": [{"startDate": {"eq": "2022-10-01T00:00:00Z"}}, {"endDate": {"eq": "endDate=2022-11-01T00:00:00Z"}}]} ``` -------------------------------- ### YAML Configuration for mia-console Installation Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-11.x.x/self_hosted/installation-chart/90_installation_chart_example.md This YAML snippet outlines the configuration parameters for deploying the mia-console using a Helm chart. It includes settings for image pull secrets, authentication providers (GitLab, GitHub, Okta, Microsoft), database URLs, JWT signing keys, and default resource allocations for various microservices. Ensure all placeholder values (e.g., , ) are replaced with actual credentials and endpoints. ```yaml nameOverride: "" # optional fullnameOverride: "" # optional mia-console: imagePullSecrets: - name: "" # array of image pull secret to pull Console services configurations: consoleUrl: "" cmsUrl: "" marketplaceSyncFilters: "" # optional: use one or more of this values separated by a comma: template plugin example application. It is suggested to use at least plugin, to have the plugin automatically updated in marketplace repositoryHostname: "" # the docker registry host used for all the docker images in the projects authProviders: # this is the placeholder to use if your auth provider is gitlab - name: "" # name of the provider type: "gitlab" label: "Login" # label of the login button baseUrl: "" # base url of the gitlab instance clientId: "" clientSecret: "" authPath: "/oauth/authorize" tokenPath: "/oauth/token" userInfoPath: "/api/v4/user" userSettingsURL: "/-/profile" # url to get user settings skipRefreshProviderTokenOnMiaTokenRefresh: true # optional: skip the refresh of the provider token when the console one is expired # this is the placeholder to use if your auth provider is github - name: "" # name of the provider type: "github" baseUrl: "" # base url of the github instance apiBaseUrl: # api base url clientId: "" clientSecret: "" cmsClientId: "" # The app id with redirect to cms cmsClientSecret: "" # The app secret with redirect to cms authPath: "/oauth/authorize" tokenPath: "/oauth/token" userInfoUrl: "/user" userSettingsURL: "/settings/profile" # url to get user settings skipRefreshProviderTokenOnMiaTokenRefresh: true # optional: skip the refresh of the provider token when the console one is expired # this is the placeholder to use if your auth provider is okta - name: "" # name of the provider type: "okta" label: "Login" # label of the login button baseUrl: "" # base url of okta clientId: "" clientSecret: "" authPath: "/oauth2/v1/authorize" tokenPath: "/oauth2/v1/token" userInfoPath: "/oauth2/v1/userinfo" userSettingsURL: "/enduser/settings" logoutUrlPath: "/oauth2/v1/logout" skipRefreshProviderTokenOnMiaTokenRefresh: true # optional: skip the refresh of the provider token when the console one is expired # this is the placeholder to use if your auth provider is microsoft - name: "" # name of the provider type: "microsoft" baseUrl: "" # base url of microsoft instance clientId: "" clientSecret: "" authPath: "/authorize" tokenPath: "/token" userInfoUrl: "https://graph.microsoft.com/oidc/userinfo" userSettingsURL: "https://account.microsoft.com/profile/" logoutUrlPath: "/logout" skipRefreshProviderTokenOnMiaTokenRefresh: true # optional: skip the refresh of the provider token when the console one is expired redisHost: "" # optional: default is "redis.default.svc.cluster.local:6379". If installed with this chart, set it to "redis:6379" jwtTokenSignKey: "" # A JWT signing key, HMAC of 512 bytes tokenPassphrase: "" # An HMAC string of 128 bytes for authentication purpose mongodbUrl: "" # url for the mongodb connection for the console filesStorageType: "mongodb" filesBucketName: "" # gridFS collection name multitinenantNamespace: "" serviceAccountAuthProvider: rsaPrivateKeyId: "PRIVATE KEY ID" rsaPrivateKeyPass: "PRIVATE KEY PASSPHRASE" clientIdSalt: "CLIENT SALT" rsaPrivateKeyBase64: | "BASE64_PrivateKey" servicesImagePullSecrets: - "" # array of image pull secret to pull your custom services defaultCoreResources: apiGateway: memoryLimitMin: "5Mi" memoryLimitMax: "25Mi" microserviceGateway: memoryLimitMin: "50Mi" memoryLimitMax: "300Mi" crudService: memoryLimitMin: "70Mi" memoryLimitMax: "250Mi" authorizationService: memoryLimitMin: "20Mi" memoryLimitMax: "80Mi" crudEncryption: # ../../runtime_suite/crud-service/encryption_configuration ``` -------------------------------- ### Deploy Miactl Project Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-10.x.x/cli/miactl/40_examples.md Illustrates how to trigger a deployment pipeline for a project. Examples cover basic deployment, specifying project ID if not in context, and customizing deployment with revision tags and disabling semantic versioning. ```bash miactl deploy development ``` ```bash miactl deploy development --project-id ``` ```bash miactl deploy development --no-semver --revision tags/v1.0.0 ``` -------------------------------- ### Get Files List with Pagination (Example) Source: https://github.com/mwpo79/documentation/blob/main/docs/runtime_suite/files-service/usage.mdx This example demonstrates how to retrieve a list of file metadata using the GET /files/ endpoint. It supports pagination via `limit` and `page` query parameters, and filtering by date using `dateFrom`. This API is available from v2.7.0. ```http GET /files/?limit=10&page=1 GET /files/?dateFrom=2023-01-01 ``` -------------------------------- ### Example Deploy Configuration JSON Source: https://github.com/mwpo79/documentation/blob/main/docs/development_suite/company/project-templates.md This JSON object shows the configuration for deploy-related settings in a project template. It includes options for the runner tool, project structure (default or kustomize), and whether to use MIA prefix for environment variables. ```json { "runnerTool": "mlp", "projectStructure": "default", "useMiaPrefixEnvs": false } ``` -------------------------------- ### Get Active Users Response Example Source: https://github.com/mwpo79/documentation/blob/main/docs/runtime_suite/auth0-client/50_usage.md Provides an example JSON response for the `GET /users/active` endpoint, which lists active users across all clients with their Auth0 IDs. This format is useful for integrating with systems that need a quick overview of currently logged-in users. ```json [ { "userId": "auth0|02d90d472bd9d017ef000001" }, { "userId": "auth0|02d90d472bd9d017ef000002" }, ... ] ``` -------------------------------- ### Example: Forwarding GET Requests for User Avatars Source: https://github.com/mwpo79/documentation/blob/main/docs/development_suite/api-console/advanced-section/api-gateway/how-to.md An example demonstrating how to forward GET requests for user avatars. It captures the username from the URI and constructs the target URL for the user's avatar. This is a specific use case of the general proxyBackofficeUrl mapping. ```nginx "~^GET-/files/images/avatar/(?[\w]+)/$" "/user/$username/avatar/" ``` -------------------------------- ### Initialize and Use Flow Manager Client - JavaScript Source: https://github.com/mwpo79/documentation/blob/main/docs/runtime_suite_libraries/flow-manager-client/overview.md Demonstrates how to initialize the Flow Manager client using a builder pattern, configure commands and events, and then start, use, and stop the client. Includes examples of handling commands and emitting events. ```javascript const { FMClientBuilder } = require('@mia-platform/flow-manager-client') const client = new FMClientBuilder(pinoLogger, kafkaConfig) .configureCommandsExecutor(commandsTopic, consumerConf, partitionsConsumedConcurrently) .configureEventsEmitter(eventsTopic, producerConf) .build() // define which action should be exected when the specified command is received client.onCommand( 'COMMAND', async (sagaId, metadata, emitEvent) => { /* do something*/ }, async (sagaId, error, commit) => { /* do something else */ await commit() // execute in case the message should be skipped } ) await client.start() await client.emit('EVENT', sagaId, metadata) await client.stop() ``` -------------------------------- ### Example Node.js Request for GET Operation Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-10.x.x/development_suite/api-portal/api-documentations.md This snippet provides an example of how to make a GET API request using Node.js. It utilizes a common HTTP client library to send the request and handle the response. This is helpful for developers integrating the API into Node.js applications. ```javascript const axios = require('axios'); const getPlates = async () => { try { const response = await axios.get('https://api.example.com/plates', { params: { id: 1, name: 'SamplePlate' }, headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN' } }); console.log(response.data); } catch (error) { console.error('Error fetching plates:', error); } }; getPlates(); ``` -------------------------------- ### GET /categories Response Example Source: https://github.com/mwpo79/documentation/blob/main/docs/runtime_suite/pharma-e-commerce-backend/30_usage.md Example JSON response for the GET /categories endpoint, illustrating the structure of product categories and their associated subcategories for a specific provider and location. Each category includes an ID, name, and a list of subcategories, each with its own ID and name. ```json [ { "id": 1, "name": "Category 1", "subcategories": [] }, { "id": 2, "name": "Category 2", "subcategories": [ { "id": 1, "name": "Subcategory 1" } ] }, { "id": 3, "name": "Category 3", "subcategories": [ { "id": 1, "name": "Subcategory 1" }, { "id": 2, "name": "Subcategory 2" } ] } ] ``` -------------------------------- ### Initialize xUnit Test Project and Add Dependencies Source: https://github.com/mwpo79/documentation/blob/main/docs/console/tutorials/configure-marketplace-components/create-a-custom-microservice.mdx This snippet demonstrates initializing a new xUnit test project within the BrewUpApiTemplate solution and adding essential NuGet packages for testing and mocking. It also includes adding a project reference to the main API. ```bash cd src/ dotnet new xunit -o Tests dotnet sln BrewUpApiTemplate.sln add Tests/Tests.csproj cd Tests/ dotnet add package Microsoft.AspNetCore.Mvc.Testing --version 6.0.13 dotnet add package Moq --version 4.18.4 dotnet add package Moq.Contrib.HttpClient --version 1.4.0 dotnet add reference ../BrewUpApiTemplate/BrewUpApiTemplate.csproj ``` -------------------------------- ### Install kubelogin CLI Tool Source: https://github.com/mwpo79/documentation/blob/main/docs/infrastructure/paas/tools/runtime.md Instructions for installing the `kubelogin` CLI tool, a prerequisite for configuring `kubectl` to connect to Kubernetes clusters. Supports installation via Homebrew, Krew, and Chocolatey. ```bash # Homebrew (macOS and Linux) brew install int128/kubelogin/kubelogin # Krew (macOS, Linux, Windows and ARM) kubectl krew install oidc-login # Chocolatey (Windows) choco install kubelogin ``` -------------------------------- ### Example cURL Request for GET Operation Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-10.x.x/development_suite/api-portal/api-documentations.md This snippet shows an example of a cURL request that can be used to test a GET API endpoint. It demonstrates how to construct the request, including any necessary parameters or authentication headers. This is useful for quickly verifying API functionality outside of a programming environment. ```shell curl -X GET "https://api.example.com/plates?id=1&name=SamplePlate" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Launch Integration Test (POST /tests/ Request Example) Source: https://github.com/mwpo79/documentation/blob/main/docs/runtime_suite/integration-test-service/30_usage.md This example demonstrates the structure of a multipart request to launch a single integration test. It requires 'tagName', 'testId', and a 'collection' file, with optional 'environment' and 'assets' files. Additional fields can be passed as environment variables. ```http POST /tests/ HTTP/1.1 Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="tagName" v1.0.0 ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="testId" my-test-123 ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="collection"; filename="collection.json" Content-Type: application/json { "collection": { "name": "My Collection", "item": [] } } ------WebKitFormBoundary7MA4YWxkTrZu0gW-- ``` -------------------------------- ### GET /{id} Response Body Schema Example (JSON) Source: https://github.com/mwpo79/documentation/blob/main/docs/runtime_suite/form-service-backend/40_submit_urls.md Example of the JSON response body for the GET /{id} route, illustrating the structure for retrieved form data, validity status, and draft availability. This schema is used when fetching submitted form data by its unique identifier. ```json { "data": { "property1": "value1", "property2": "value2", "...": "..." }, "isValid": true, "hasDraft": false } ``` -------------------------------- ### Create xUnit Test Project and Add Dependencies Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-10.x.x/tutorial/node_ms/node_ms_tutorial.mdx This section details the commands to create a new xUnit test project within the solution, add required testing and mocking libraries, and establish a project reference to the main API project. ```bash cd src/ dotnet new xunit -o Tests dotnet sln BrewUpApiTemplate.sln add Tests/Tests.csproj cd Tests/ dotnet add package Microsoft.AspNetCore.Mvc.Testing --version 6.0.13 dotnet add package Moq --version 4.18.4 dotnet add package Moq.Contrib.HttpClient --version 1.4.0 dotnet add reference ../BrewUpApiTemplate/BrewUpApiTemplate.csproj ``` -------------------------------- ### GET /endpoint Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-10.x.x/runtime_suite_libraries/custom-plugin-lib/apidoc.md Example of adding a raw custom plugin for a GET request to '/endpoint' with a defined schema for request body, query string, parameters, and headers. ```APIDOC ## GET /endpoint ### Description This endpoint accepts GET requests and processes them according to a predefined schema that includes validation for the request body, query string, path parameters, and headers. ### Method GET ### Endpoint /endpoint ### Parameters #### Query Parameters - **name** (string) - Optional - Name parameter. - **excitement** (integer) - Optional - Excitement level parameter. #### Path Parameters - **par1** (string) - Required - Path parameter 1. - **par2** (number) - Required - Path parameter 2. #### Headers - **x-foo** (string) - Required - Custom header 'x-foo'. #### Request Body - **someKey** (string) - Optional - A string value. - **someOtherKey** (number) - Optional - A numeric value. ### Request Example ```json { "someKey": "example", "someOtherKey": 123 } ``` ### Response #### Success Response (200) - **message** (string) - A success message. #### Response Example ```json { "message": "Endpoint processed successfully" } ``` ``` -------------------------------- ### Configure Start Script in package.json Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-11.x.x/development_suite/api-console/api-design/plugin_baas_4.md JSON snippet showing how to configure the 'start' script in package.json to run the fastify server with the service entrypoint. ```json //... "scripts": { // ... "start": "fastify start src/index.js", //... } ``` -------------------------------- ### Install Kafka HealthChecker using npm Source: https://github.com/mwpo79/documentation/blob/main/docs/runtime_suite_libraries/kafka-healthchecker/30_setup.md Installs the Kafka HealthChecker library as a project dependency using npm. This is the initial step to integrate the library into your project. ```bash npm i --save @mia-platform/kafka-healthchecker ``` -------------------------------- ### Service Configuration Example (JSON) Source: https://github.com/mwpo79/documentation/blob/main/docs/fast_data/configuration/projection_storer.md An example JSON snippet demonstrating the structure of service settings, including system of records, soft delete enablement, and data source adapter configuration. ```json { "settings": { "systemOfRecords": "inventory", "enableSoftDelete": true, "dataSourceAdapter": { "type": "debezium" }, "castFunctions": { "mapToAddressType": "/app/extensions/mapToAddressType.kts" } } } ``` -------------------------------- ### Example Project Configuration JSON Source: https://github.com/mwpo79/documentation/blob/main/docs/console/company-configuration/project-default-configuration.mdx Demonstrates a typical JSON structure for project configuration, including environment details, host settings, environment variables, deployment providers, and cluster context variables for secure communication. ```json [ { "label": "Development", "envId": "development", "envPrefix": "development", "isProduction": false, "hosts": [ { "host": "%projectId%.test.mia-platform.eu", "scheme": "https" }, { "host": "cms.%projectId%.test.mia-platform.eu", "isBackoffice": true } ], "environmentsVariables": { "providerId": "my-vault", "type": "vault" }, "deploy": { "providerId": "my-jenkins", "type": "jenkins" }, "cluster": { "clusterId": "human-readable-id-of-the-cluster", "namespace": "%projectId%-development", "kubeContextVariables": { "KUBE_URL": "KUBE_DEV_URL", "KUBE_TOKEN": "KUBE_DEV_TOKEN", "KUBE_CA_PEM": "KUBE_DEV_CA_PEM" } } } ] ``` -------------------------------- ### Nexi Status Endpoint Request Example Source: https://github.com/mwpo79/documentation/blob/main/docs/runtime_suite/payment-gateway-manager/29_nexi.md Example of a GET request to the /status endpoint to retrieve the current status of a payment. It requires the 'paymentId' as a query parameter. ```http GET /v3/nexi/status?paymentId=payment_abcde12345 HTTP/1.1 Host: example.com ``` -------------------------------- ### Start ASN Agent in Background (if needed) Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-11.x.x/fast_data/connectors/debezium_cdc.md This command is used to start the ASN capture process as a background job. It's a fallback mechanism if the initial 'start' command for the ASN agent doesn't result in it running, ensuring the capture process is active. ```shell db2 "VALUES ASNCDC.ASNCDCSERVICES('start','asncdc');" /database/config/db2inst1/sqllib/bin/asncap capture_schema=asncdc capture_server=$DB_NAME & ``` -------------------------------- ### Service Configuration Example (JSON) Source: https://github.com/mwpo79/documentation/blob/main/docs/runtime_suite/authentication-service/20_configuration.mdx An example JSON structure for configuring the service, detailing application-specific settings, provider integrations (like GitLab, GitHub, Okta), and authorization parameters. This configuration is essential for setting up authentication flows and user management. ```json { "apps": { "APP_ID": { "providers": { "PROVIDER_ID": { "type": "gitlab|github|okta|microsoft|bitbucket|keycloak|generic", "clientId": "the-idp-client-id", "clientSecret": "the-idp-client-secret", "authUrl": "auth_url", "tokenUrl": "token_url", "userInfoUrl": "user_info_url", "baseUrl": "base_url", "scope": ["custom_scope"], "order": 10, "userSettingsURL": "settings-url" } }, "authorizeStateRequired": true, "redirectUrl": "https://test.com/redirect", "realm": "realm1", "isWebsiteApp": true, "defaultGroups": ["users"], "issuer": "issuer1" } } } ``` -------------------------------- ### Pipeline Configuration Example (JSON) Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-10.x.x/development_suite/company/create.mdx A basic example of how to configure CI/CD pipelines for a project, specifying the type of pipeline to be used. ```json { "type": "gitlab-ci" } ``` -------------------------------- ### Nexi Check Endpoint Request Example Source: https://github.com/mwpo79/documentation/blob/main/docs/runtime_suite/payment-gateway-manager/29_nexi.md Example of a GET request to the /check endpoint to retrieve payment status and trigger a notification. It requires the 'paymentId' as a query parameter. ```http GET /v3/nexi/check?paymentId=payment_abcde12345 HTTP/1.1 Host: example.com ``` -------------------------------- ### Go Logging Library Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-11.x.x/getting-started/guidelines/guidelines-for-logs.md Points to the 'glogger' library for Go services, offering a streamlined approach to implementing logging according to Mia-Platform's guidelines. ```go // For Go services, you can use [glogger](https://github.com/mia-platform/glogger). ``` -------------------------------- ### Get Teleconsultation Data Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-10.x.x/runtime_suite/teleconsultation-service-backend/overview.md Returns all the data needed to instantiate a teleconsultation UI to start the call. ```APIDOC ## GET /teleconsultation/:teleconsultationId ### Description Retrieves all necessary data to initialize the teleconsultation UI and start a call. ### Method GET ### Endpoint /teleconsultation/:teleconsultationId ### Parameters #### Path Parameters - **teleconsultationId** (string) - Required - The ID of the teleconsultation for which to retrieve data. ### Response #### Success Response (200 OK) - **teleconsultationId** (string) - The unique identifier for the teleconsultation. - **companyId** (string) - The ID of the company. - **userId** (string) - The ID of the user who initiated the teleconsultation. - **startDate** (string) - The start date and time of the teleconsultation. - **endDate** (string) - The end date and time of the teleconsultation. - **participants** (array) - An array of participant objects. - **userId** (string) - The ID of the participant. - **role** (string) - The role of the participant. - **bandyerRoomData** (object) - Data related to the Bandyer room. - **roomId** (string) - The ID of the Bandyer room. - **token** (string) - The authentication token for the Bandyer room. - **bandyerUrl** (string) - The URL to join the Bandyer call. #### Response Example ```json { "teleconsultationId": "tele_abc123xyz", "companyId": "your_company_id", "userId": "user_id_123", "startDate": "2023-10-27T10:00:00Z", "endDate": "2023-10-27T11:00:00Z", "participants": [ { "userId": "user_id_123", "role": "organizer" }, { "userId": "user_id_456", "role": "attendee" } ], "bandyerRoomData": { "roomId": "room_xyz789abc", "token": "generated_bandyer_token", "bandyerUrl": "https://your.bandyer.com/join?room=room_xyz789abc&token=generated_bandyer_token" } } ``` ``` -------------------------------- ### Build and Serve Production Site Source: https://context7.com/mwpo79/documentation/llms.txt Builds a static site for production deployment with CSS minification. It also provides a command to serve the production build locally for testing. ```bash # Build production bundle with CSS minification yarn build # Redirects are built automatically during the build process # Output directory: ./build # Serve production build locally on http://localhost:3000 yarn serve # Note: Server restart required to see changes in serve mode ``` -------------------------------- ### Example: GET /fhir/Patient/{id} Request Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-10.x.x/runtime_suite/proxy-google-fhir/overview.md This snippet demonstrates how to retrieve a specific Patient resource by its ID using a GET request. It includes the curl command and the target URL. ```bash curl --request GET \ --url https://mia-care-demo.test.mia-platform.eu/fhir/Patient/ce7384fe-22f7-4721-a1fa-2b7a671544ce ``` -------------------------------- ### CRUD Persistency Manager Get API Call Source: https://github.com/mwpo79/documentation/blob/main/versioned_docs/version-10.x.x/runtime_suite/flow-manager-service/configuration.md Example of a GET request to the CRUD service for retrieving saga information. It specifies the endpoint and includes the sagaId as a query parameter. ```http GET - http://my-crud-service:80/?sagaId=EXAMPLE_123456_SAGA ```