diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 015cfa48..037f94fc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,7 +66,7 @@ Documentation links can be directly generated using `docs:section_name/topic_nam ### Documentation screenshots Documentation screenshots can be automatically generated using the [monorepo](https://github.com/mockoon/mockoon). -Run the following commands: `npm run build:desktop:ci` then `npm run documentation:desktop`. +Run the following commands: `npm run build:desktop:ci` then `npm run package:desktop:test:win` and `npm run documentation:desktop`. Packaging the desktop app is necessary to be able to run the automated tests and generate the screenshots. New screenshots will be created in `./packages/desktop/tmp/docs`. They can be copied in this repository's `/public/images/docs/latest` folder. Generating the documentation screenshots requires the Firebase emulator and API to run locally and the app to be authenticated with a fake paid account (in order to generate screenshots for Pro features). diff --git a/components/footer.tsx b/components/footer.tsx index 8471d8c9..fefcea8c 100644 --- a/components/footer.tsx +++ b/components/footer.tsx @@ -136,7 +136,7 @@ const Footer: FunctionComponent<{
  • {/* Do not use , as routes with a dot inside get rewritten without trailing slash */} - + Releases
  • diff --git a/components/nav.tsx b/components/nav.tsx index ace3fe07..5c25a895 100644 --- a/components/nav.tsx +++ b/components/nav.tsx @@ -261,7 +261,7 @@ const Nav: FunctionComponent = function () { Blog = if (planId === 'TEAM' || planId === 'ENTERPRISE') { setConfigurePlan(planId); - setSeats(1); + setSeats(pricing[planId].minSeats); return; } @@ -243,10 +248,15 @@ const Plans: FunctionComponent<{ showFree: boolean; showTagline: boolean }> = onChange={(event) => { const newSeats = parseInt(event.target.value); - if (isNaN(newSeats) || newSeats < 1) { - setSeats(1); + if ( + isNaN(newSeats) || + newSeats < 1 || + newSeats < pricing[configurePlan].minSeats + ) { + setSeats(pricing[configurePlan].minSeats); return; } + if (newSeats > pricing[configurePlan].maxSeats) { setSeats(pricing[configurePlan].maxSeats); return; @@ -315,16 +325,6 @@ const Plans: FunctionComponent<{ showFree: boolean; showTagline: boolean }> =

    -
    -
    - -
    - -

    - 10 free templates -

    -
    -
    @@ -381,24 +381,20 @@ const Plans: FunctionComponent<{ showFree: boolean; showTagline: boolean }> = features

    -
    -
    - -
    -

    - Support our work on the open-source tools -

    -

    +

    - 📃 Access to dozens of pro{' '} - templates + 🪄 {pricing.SOLO.templatesQuota}{' '} + + AI-generated templates + {' '} + per month

    @@ -407,11 +403,15 @@ const Plans: FunctionComponent<{ showFree: boolean; showTagline: boolean }> =

    - 🪄 {pricing.SOLO.templatesQuota}{' '} - - AI-generated templates + ☁️{' '} + + Synchronize {pricing.SOLO.syncQuota} API mocks {' '} - per month + accross your devices


    @@ -422,17 +422,32 @@ const Plans: FunctionComponent<{ showFree: boolean; showTagline: boolean }> =

    Community support

    -
    - - - Coming soon + +
    +
    +
    +
    + +
    + +

    + Support our work on the open-source tools +

    +
    +
    +
    + + + Coming + soon + - -
    -
    -

    - ☁️ Sync your API mocks accross your devices -

    +
    +
    +

    + ☁️ Deploy your API mocks in the cloud (Q4 2024) +

    +
    @@ -481,32 +496,15 @@ const Plans: FunctionComponent<{ showFree: boolean; showTagline: boolean }> = features

    -
    -
    - -
    -

    - Support our work on the open-source tools -

    -

    -
    -
    - -
    -

    - 📃 Access to dozens of pro{' '} - templates -

    -
    -

    +

    🪄 {pricing.TEAM.templatesQuota}{' '} AI-generated templates @@ -514,35 +512,59 @@ const Plans: FunctionComponent<{ showFree: boolean; showTagline: boolean }> = per month per seat

    -

    - Priority support1 + ☁️{' '} + + Synchronize {pricing.TEAM.syncQuota} API mocks + accross your team + {' '} + and collaborate in real-time


    +
    -

    Organizations up to 10 seats

    +

    Organizations up to {pricing.TEAM.maxSeats} seats

    -
    - - - Coming soon + +
    +
    +
    +
    + +
    + +

    + Support our work on the open-source tools +

    +
    +
    +
    + + + Coming + soon + - -
    -
    -

    - ☁️ Sync your API mocks accross your team -

    +
    +
    +

    + ☁️ Deploy your API mocks in the cloud (Q4 2024) +

    +
    @@ -593,24 +615,20 @@ const Plans: FunctionComponent<{ showFree: boolean; showTagline: boolean }> = features

    -
    -
    - -
    -

    - Support our work on the open-source tools -

    -

    +

    - 📃 Access to dozens of pro{' '} - templates + 🪄 {pricing.ENTERPRISE.templatesQuota}{' '} + + AI-generated templates + {' '} + per month per seat

    @@ -619,11 +637,16 @@ const Plans: FunctionComponent<{ showFree: boolean; showTagline: boolean }> =

    - 🪄 {pricing.ENTERPRISE.templatesQuota}{' '} - - AI-generated templates + ☁️{' '} + + Synchronize {pricing.ENTERPRISE.syncQuota} API mocks + accross your team {' '} - per month per seat + and collaborate in real-time


    @@ -660,20 +683,34 @@ const Plans: FunctionComponent<{ showFree: boolean; showTagline: boolean }> = -

    Unlimited seats

    +

    Unlimited seats (minimum 3)

    -
    - - - Coming soon +
    +
    +
    +
    + +
    + +

    + Support our work on the open-source tools +

    +
    +
    +
    + + + Coming + soon + - -
    -
    -

    - ☁️ Sync your API mocks accross your team -

    +
    +
    +

    + ☁️ Deploy your API mocks in the cloud (Q4 2024) +

    +
    diff --git a/content/blog/introducing-mockoon-ai-assistant-pro-plans.md b/content/blog/introducing-mockoon-ai-assistant-pro-plans.md index ce615e7c..3544e967 100644 --- a/content/blog/introducing-mockoon-ai-assistant-pro-plans.md +++ b/content/blog/introducing-mockoon-ai-assistant-pro-plans.md @@ -35,7 +35,7 @@ Behind the scenes, our AI assistant leverages OpenAI's Chat GPT. We have fine-tu ## 💬 Priority support and welcome training -By subscribing to Mockoon Pro's **Team** and **Enterprise** plans, you also benefit from our priority support with a dedicated support channel where we promptly address any questions or concerns you may have. This advanced support ensures that your API development and testing workflows remain uninterrupted. +By subscribing to Mockoon Pro's **Enterprise** plan, you also benefit from our priority support with a dedicated support channel where we promptly address any questions or concerns you may have. This advanced support ensures that your API development and testing workflows remain uninterrupted. In addition to priority support, our **Enterprise** plan includes comprehensive welcome training. We understand that transitioning to a new platform can sometimes be daunting. It is why we offer personalized onboarding to help your team quickly get up to speed with Mockoon. This training covers all the ins and outs of our tools, guiding your team through its advanced features and best practices. By providing this training, we want to ensure a smooth and successful integration of Mockoon into your API development processes. diff --git a/content/blog/our-commitment-open-source-community.md b/content/blog/our-commitment-open-source-community.md index 47d14dae..aab74961 100644 --- a/content/blog/our-commitment-open-source-community.md +++ b/content/blog/our-commitment-open-source-community.md @@ -26,7 +26,7 @@ I am committed to ensuring that Mockoon remains a **healthy and sustainable open Every project starts with some code published on a repository. For Mockoon, this was more than six years ago. -![#sub#Mockoon's first commit!](/images/blog/commitment-open-source-community/mockoon-first-commit.png) +![#sub#Mockoon's first commit!{280x73}](/images/blog/commitment-open-source-community/mockoon-first-commit.png) Innocent enough, it can soon lead to a long list of feature requests, pull requests, bug reports, and documentation to maintain. It means that people are interested in the project. However, the more the project grows, the more time and effort are required to maintain it. A blessing and a curse at the same time. @@ -89,7 +89,7 @@ The answer is yes. Existing Mockoon applications are not going anywhere, and the A great example is the cloud synchronization feature that will be visible in the main menu but separated from the local API mocks you can create like before. Nothing will change for you if you don't want to use the cloud. -![#sub#Mockoon's (future) main menu with the cloud environments list](/images/blog/commitment-open-source-community/cloud-sync-menu-preview.png) +![#sub#Mockoon's (future) main menu with the cloud environments list{200x231}](/images/blog/commitment-open-source-community/cloud-sync-menu-preview.png) The SaaS and the sale of custom services are already helping finance the project a little. It's not enough to cover the costs, but it's a start. It gives me a lot of hope for the future. diff --git a/content/docs/latest/admin-api/overview.md b/content/docs/latest/admin-api/overview.md new file mode 100644 index 00000000..72af8094 --- /dev/null +++ b/content/docs/latest/admin-api/overview.md @@ -0,0 +1,27 @@ +--- +title: Overview +meta: + title: Admin API overview + description: Learn how to use the admin API exposed by Mockoon to manage your environments, routes, and responses +order: 800 +--- + +# Admin API overview + +--- + +Each running mock server **exposes an admin API** that allows you to manage your environment. This API can be used to automate the management of your mock server, especially in a remote environment, without having to restart the application. + +## Admin API base endpoint + +The admin API **base endpoint** is the same as the mock server URL with the `/mockoon-admin` path appended. + +For example, if your mock server is running on `http://localhost:3000`, the admin API base endpoint will be `http://localhost:3000/mockoon-admin`. + +> 💡 The [API prefix](docs:server-configuration/port-prefix) is not applied to the admin API base endpoint. If your API endpoints are accessible on `http://localhost:3000/myprefix/{endpoint}`, the admin API base endpoint will still be `http://localhost:3000/mockoon-admin`. + +## Admin API capabilities + +Currently, the admin API allows you to: + +- [purge the state of a running environment](docs:admin-api/server-state) diff --git a/content/docs/latest/admin-api/server-state.md b/content/docs/latest/admin-api/server-state.md new file mode 100644 index 00000000..cff6742e --- /dev/null +++ b/content/docs/latest/admin-api/server-state.md @@ -0,0 +1,25 @@ +--- +title: Server state +meta: + title: Server state + description: Learn how to purge the state of a running environment using the admin API, resetting the request count and regenerating the data buckets +order: 801 +--- + +# Server state endpoint `/mockoon-admin/state` + +--- + +The `/mockoon-admin/state` endpoint currently allows you to purge the state of a running environment. + +### Purging the state of a running environment + +To purge the state of a running environment is done by calling one of the following endpoints: + +- `PURGE /mockoon-admin/state`. +- `POST /mockoon-admin/state/purge`. + +**Effects:** + +- Resets the [request counter](docs:route-responses/dynamic-rules#1-target) to 1 for each route. +- Regenerates the data buckets for the environment. The data buckets containing request helpers will be [generated again during the next request](docs:data-buckets/overview#data-buckets-generation). diff --git a/content/docs/latest/api-endpoints/crud-routes.md b/content/docs/latest/api-endpoints/crud-routes.md index e5743828..143415df 100644 --- a/content/docs/latest/api-endpoints/crud-routes.md +++ b/content/docs/latest/api-endpoints/crud-routes.md @@ -18,11 +18,11 @@ A CRUD endpoint will automatically create a series of routes during runtime, all To create a CRUD route, click on the "CRUD route" entry in the add route menu: -![Add a new CRUD route{390x304}](docs-img:add-crud-route.png) +![Add a new CRUD route{440x304}](docs-img:add-crud-route.png) Then, set its path, usually a [resource name](/articles/api-guide-rest-api-components/#resource-url-request): -![Set the CRUD route path{1264x176}](docs-img:set-crud-route-path.png) +![Set the CRUD route path{1484x176}](docs-img:set-crud-route-path.png) > Your path can be more complex, and contains parameters or multiple sections. Remember that this will be the "prefix" of the different endpoints (see below). @@ -30,7 +30,7 @@ Then, set its path, usually a [resource name](/articles/api-guide-rest-api-compo After creating a CRUD endpoint, you need to link it to a data bucket: -![Link a data bucket to a CRUD route{1264x334}](docs-img:link-data-bucket-crud-route.png) +![Link a data bucket to a CRUD route{1484x334}](docs-img:link-data-bucket-crud-route.png) > Head over to our [data buckets](docs:data-buckets/overview) documentation to learn how to create a new data bucket. @@ -80,7 +80,7 @@ Mockoon will automatically translate a CRUD endpoint to multiple routes allowing By default, CRUD endpoints will use the `id` property to identify objects in an array in all the routes manipulating a single resource (e.g. GET `/resource/:id`). However, you can change this property to anything you want, like `uuid`, `custom_id`, etc: -![Customize the CRUD id property{1264x334}](docs-img:customize-crud-id-property-key.png) +![Customize the CRUD id property{1484x334}](docs-img:customize-crud-id-property-key.png) ## Overriding a route diff --git a/content/docs/latest/api-endpoints/folders.md b/content/docs/latest/api-endpoints/folders.md index 5e4691e2..bc7c80f9 100644 --- a/content/docs/latest/api-endpoints/folders.md +++ b/content/docs/latest/api-endpoints/folders.md @@ -14,7 +14,7 @@ order: 230 You can organize your routes into folders and sub-folders: -![routes organized in folders and sub-folders{799x518}](docs-img:routes-nested-folder.png) +![routes organized in folders and sub-folders{849x518}](docs-img:routes-nested-folder.png) This new feature allows you to better organize your routes and make your APIs more readable and easier to navigate, with a clearer hierarchy. You can drag and drop to move or reorganize your routes and folders. diff --git a/content/docs/latest/api-endpoints/routing.md b/content/docs/latest/api-endpoints/routing.md index 5580080f..6b73a5f1 100644 --- a/content/docs/latest/api-endpoints/routing.md +++ b/content/docs/latest/api-endpoints/routing.md @@ -16,11 +16,11 @@ In order to prefix all your mock API routes, Open the **Environment Settings** by clicking on the tab at the top of the window: -![click on the settings tab{871x160}](docs-img:open-environment-settings.png) +![click on the settings tab{921x160}](docs-img:open-environment-settings.png) Then, fill the **API prefix** input at the top of the **environment Settings**: -![fill the prefix input{993x298}](docs-img:environment-prefix.png) +![fill the prefix input{1128x298}](docs-img:environment-prefix.png) The prefix will appear under your environment name in the environments list. All your environment's routes will now be prefixed and available at the following address `http://localhost:port/myprefix/myroute` instead of `http://localhost:port/myroute`. @@ -45,7 +45,7 @@ Routes support certain patterns and a subset of regular expressions. Here are so - `/ab+cd` will match `abcd`, `abbcd`, `abbbcd`, and so on. - `/ab(cd)?e` will match `/abe` and `/abcde`. -![route pattern{995x74}](docs-img:route-patterns.png) +![route pattern{1123x74}](docs-img:route-patterns.png) For a complete overview of the patterns available, please refer to Express' [route paths documentation](https://expressjs.com/en/guide/routing.html#route-paths). @@ -56,7 +56,7 @@ For a complete overview of the patterns available, please refer to Express' [rou Route parameters can be defined in routes by using a colon `:`. The name of a parameter can only contains the following characters `A-Za-z0-9_`. -![route parameter{995x74}](docs-img:route-params.png) +![route parameter{1123x74}](docs-img:route-params.png) For a complete overview on how to use and declare route parameters, please refer to Express' [route parameters documentation](https://expressjs.com/en/guide/routing.html#route-parameters). diff --git a/content/docs/latest/callbacks/overview.md b/content/docs/latest/callbacks/overview.md index b477cc57..a26a8bc0 100644 --- a/content/docs/latest/callbacks/overview.md +++ b/content/docs/latest/callbacks/overview.md @@ -20,11 +20,11 @@ Callbacks are fully configurable and are created at the environment level, like To create a new callback, open the **Callbacks** options by clicking on the tab at the top of the window: -![click on the callbacks tab at the top{955x160}](docs-img:open-callbacks-view.png) +![click on the callbacks tab at the top{1005x160}](docs-img:open-callbacks-view.png) Add a new callback by clicking on the "plus" button: -![Add a new callback by clicking on the plus button{1264x578}](docs-img:add-callback.png) +![Add a new callback by clicking on the plus button{1484x578}](docs-img:add-callback.png) ## Configure a callback diff --git a/content/docs/latest/callbacks/using-callbacks.md b/content/docs/latest/callbacks/using-callbacks.md index 53a28fc5..d461e6fb 100644 --- a/content/docs/latest/callbacks/using-callbacks.md +++ b/content/docs/latest/callbacks/using-callbacks.md @@ -16,10 +16,10 @@ After [creating callbacks](docs:callbacks/overview), you can link them in your r To link a callback to a route response, choose "Callbacks" in the route response menu: -![click on the callbacks tab in the route response menu{1004x174}](docs-img:open-route-response-callbacks.png) +![click on the callbacks tab in the route response menu{1174x174}](docs-img:open-route-response-callbacks.png) Then, click on the "plus" button to add a new callback, and select the callback you want to link: -![click on the plus button to add a new callback{977x234}](docs-img:link-callback-response.png) +![click on the plus button to add a new callback{1147x234}](docs-img:link-callback-response.png) > 💡 You can **delay a callback execution** by adding a delay in milliseconds in the "Callback latency" field. diff --git a/content/docs/latest/data-buckets/overview.md b/content/docs/latest/data-buckets/overview.md index 54a3193d..5ef648fe 100644 --- a/content/docs/latest/data-buckets/overview.md +++ b/content/docs/latest/data-buckets/overview.md @@ -20,11 +20,11 @@ The data buckets are defined at the **environment level** and are **generated wh To create a new data bucket, open the **Data** options by clicking on the tab at the top of the window: -![Open data bucket view{745x160}](docs-img:open-data-view.png) +![Open data bucket view{795x160}](docs-img:open-data-view.png) Add a new data bucket by clicking on the "plus" button: -![Add a data bucket{1264x578}](docs-img:add-data-bucket.png) +![Add a data bucket{1484x578}](docs-img:add-data-bucket.png) You can change the data bucket title and content on the right part of the screen. Mockoon will automatically attribute a new **unique ID** to your data bucket. You can use this ID to reference the data using the [`data` helpers](docs:data-buckets/using-data-buckets#using-data-helpers). To retrieve a bucket's unique ID, look in the footer under the data bucket content or right-click on a bucket name in the list and click on "Copy ID to clipboard". diff --git a/content/docs/latest/data-buckets/using-data-buckets.md b/content/docs/latest/data-buckets/using-data-buckets.md index ef7020da..083b9845 100644 --- a/content/docs/latest/data-buckets/using-data-buckets.md +++ b/content/docs/latest/data-buckets/using-data-buckets.md @@ -34,4 +34,4 @@ A data bucket can also be directly linked to a route response. Linking a data bu To link a data bucket to a route response, choose "Data" in the body selector and select your data bucket. -![Using data bucket in a route response{1002x464}](docs-img:link-data-bucket-response.png) +![Using data bucket in a route response{1172x464}](docs-img:link-data-bucket-response.png) diff --git a/content/docs/latest/logging-and-recording/auto-mocking-and-recording.md b/content/docs/latest/logging-and-recording/auto-mocking-and-recording.md index 61b0e836..43098d17 100644 --- a/content/docs/latest/logging-and-recording/auto-mocking-and-recording.md +++ b/content/docs/latest/logging-and-recording/auto-mocking-and-recording.md @@ -3,7 +3,7 @@ title: Auto-mocking and recording meta: title: Automatic API mock creation description: Learn how to automatically mock your API endpoints manually or by recording all the entering requests made to an existing API -order: 710 +order: 701 --- # Automatically create mock routes @@ -16,17 +16,17 @@ You can automatically create mock routes from HTTP transactions (request/respons Mockoon offers the possibility to automatically create mocks for entering requests. Click on the "plus" icon on a record to create a route containing the same information (headers, body, etc.): -![create a route from a log{1214x633}](docs-img:logs-auto-mocking.png) +![create a route from a log{1384x633}](docs-img:logs-auto-mocking.png) ## Record your API calls Mockoon can also automatically create mock API endpoints every time a request is logged. To activate this feature, click on the "Record" button at the top of the logs view: -![click on the record button{1214x633}](docs-img:logs-start-recording.png) +![click on the record button{1384x633}](docs-img:logs-start-recording.png) You can record in multiple environments at the same time. A red blinking recording icon will appear next to the environment name to indicate that the recording is active: -![recording icon{964x433}](docs-img:logs-recording-in-progress.png) +![recording icon{1184x433}](docs-img:logs-recording-in-progress.png) The recording will only create a route once, based on the path and HTTP method. diff --git a/content/docs/latest/logging-and-recording/requests-logging.md b/content/docs/latest/logging-and-recording/requests-logging.md index 5650ec92..ec2ee5b5 100644 --- a/content/docs/latest/logging-and-recording/requests-logging.md +++ b/content/docs/latest/logging-and-recording/requests-logging.md @@ -14,7 +14,7 @@ order: 700 For easier debugging, Mockoon records all entering requests and all the corresponding outgoing responses for each of your mock API. To access an environment's log, click on the "Logs" tab at the top of the window: -![click the logs tab{913x160}](docs-img:open-logs.png) +![click the logs tab{963x160}](docs-img:open-logs.png) ## Logs content @@ -22,13 +22,13 @@ The list shows all intercepted requests and how Mockoon answered to them. Please note that all requests are intercepted, even the `/favicon` request made by the browser. Each record contains the entering request and the outgoing response information. This includes the complete list of headers, route params, query params, and body in raw format. -![view the request{1214x633}](docs-img:logs-request.png) +![view the request{1384x633}](docs-img:logs-request.png) -![view the response{1214x633}](docs-img:logs-response.png) +![view the response{1384x633}](docs-img:logs-response.png) The interface is showing truncated bodies for both the request and the response (the truncation length can be adjusted in the settings). You can still view them in full in a separated editor by clicking on **View full body in editor**: -![click on view full body in editor link{1214x633}](docs-img:logs-view-body.png) +![click on view full body in editor link{1384x633}](docs-img:logs-view-body.png) ![body content is showed in a modal{860x696}](docs-img:logs-view-body-modal.png) @@ -36,7 +36,7 @@ The interface is showing truncated bodies for both the request and the response You can also easily see if a request has been caught by Mockoon (record shows a green tick) or has been passed to another URL if the [proxy mode](docs:server-configuration/proxy-mode) is activated (record shows a shield icon): -![view logs metadata{1214x633}](docs-img:logs-metadata.png) +![view logs metadata{1384x633}](docs-img:logs-metadata.png) ## File logging @@ -87,9 +87,7 @@ When using this option, logs will contain the full transaction (request and resp }, "response": { "body": "{}", - "headers": [ - { "key": "content-type", "value": "application/json; charset=utf-8" } - ], + "headers": [{ "key": "content-type", "value": "application/json; charset=utf-8" }], "statusCode": 200, "statusMessage": "OK" }, diff --git a/content/docs/latest/mockoon-cloud/data-synchronization-team-collaboration.md b/content/docs/latest/mockoon-cloud/data-synchronization-team-collaboration.md new file mode 100644 index 00000000..916812cd --- /dev/null +++ b/content/docs/latest/mockoon-cloud/data-synchronization-team-collaboration.md @@ -0,0 +1,118 @@ +--- +title: Data synchronization and team collaboration +meta: + title: Data synchronization and team collaboration + description: Learn how to use Mockoon Pro to synchronize your data across your team and collaborate on your mock API projects +order: 901 +--- + +# Data synchronization and team collaborationPRO + +--- + +[Mockoon Pro](/pro/) allows you to **synchronize your mock APIs in the cloud**, share them with your team, and **collaborate in real time**. This feature is available in the desktop application and is part of the Mockoon Pro paid plans. Read on to learn how to use it and the different features it offers. + +## Cloud vs local environments + +The **local environment** is the default environment in Mockoon. It is [stored on your local machine](docs:mockoon-data-files/data-storage-location) and not synchronized with the cloud. + +**Cloud environments** are stored on our servers, and a local copy is kept on each client's machine. You can easily **create a cloud copy** of your local environment or **convert an existing cloud environment** back to a local environment. + +![Cloud and local environments menus{200x231}](/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/cloud-sync-menu.png) + +## Managing your cloud environments + +### Create a cloud environment + +There are multiple ways to **create a cloud environment**. You can use the context menu in the local environments list to create a cloud environment from a local one using "Duplicate to the cloud" or create a new cloud environment from scratch using "New cloud environment" from the cloud environments menu. + +![context menus to create cloud environments{569x492}](/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/create-cloud-environment.png) + +The new cloud environment will be created and synchronized with the cloud, together with a local copy. It will be available on all your devices (solo plan) and for all your team members (team/enterprise plans) once they connect to the cloud. + +### Remove an environment from the cloud + +You can **remove an environment** from the cloud using the context menu in the cloud environments list and selecting "Convert to local" or "Delete from cloud": + +![context menu to convert a cloud environment to local{533x277}](/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/convert-cloud-to-local.png) + +After converting an environment to local, it will be **permanently removed from the cloud** and **converted to a local environment** on all your devices (solo plan) and for all your team members (team/enterprise plans). + +## Team collaboration and conflict handling + +This feature is designed to allow multiple users (Team and Enterprise plans) to work on the same environment at the same time. The application will handle conflicts on a **last-write-wins** basis, but many changes can be made simultaneously without conflicts, for example: + +- Editing different properties of the same entity (route, response, etc.). +- Adding the same kind of entity (route, response, etc.) or reordering them. +- Deleting different entities. + +However, some parts of the environment definition cannot be edited simultaneously and are considered as a single entity that cannot be merged and will be synchronized as a whole. Here are some examples: + +- The environment's or route response's headers list. +- The route response's rules or callbacks list. +- The various editors content (inline body, data bucket, callback, etc.). + +## Offline editing + +Mockoon's synchronization and collaboration features are primarily designed to work while being **online**. Offline editing works to some extent, but it is **not recommended to simultaneously edit** the same environment while being offline. + +When you are offline, a warning is shown in the cloud environments list: + +![#sub#Warning shown when the application is offline{391x209}](/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/offline-editing-warning.png) + +When you modify an environment while being offline and go back online, three scenarios can happen: + +- **You made local changes**, but **the cloud version was not modified**: your local changes will be automatically **pushed** to the cloud. +- **You did not make local changes**, but **the cloud version was modified**: the cloud version will be pulled automatically to your local environment. +- **You made local changes**, and **the cloud version was modified**: you will be prompted to **choose** between **keeping** your local changes or **discarding** them. + +![#sub#Dialog shown when the application detected a conflict{504x241}](/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/offline-conflict-warning.png) + +> ⚠️ If multiple users edit the same environment while offline, **only one version of the environment will be kept** and the others will be discarded. + +## Disconnection reasons + +If you are disconnected from the cloud, the application will display a warning in the cloud environments list in the form of a orange or red cloud icon. Hovering over the icon will display the reason for the disconnection (e.g. incompatible version, etc.). You can also click on the icon to try to reconnect: + +![#sub#Tooltip showing a regular disconnection{287x219}](/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/offline-reason-disconnected.png) + +![#sub#Tooltip showing a disconnection due to an incompatible version{288x221}](/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/offline-reason-incompatible-version.png) + +## Major versions migrations + +Future major versions of Mockoon may introduce **breaking changes to the data model** of your environments. When this happens, the **first device (or user) to connect to the cloud storage will trigger the migration process**. The migration will update the data model of the cloud environments to the new version. Once the migration is complete, older versions of Mockoon will no longer be able to synchronize with your cloud space and will have to be updated. + +Here are the steps to follow to migrate your environments to a new major version when working in a team: + +1. **Coordinate** with your team to ensure that all users are aware of the upcoming migration. +2. **Update** Mockoon desktop on one device to the new major version. This will trigger the migration process in you cloud space. +3. **Update** Mockoon desktop on all other devices. + +> ⚠️ We strongly recommend that major updates installations are **coordinated** across your team to avoid any disruption. + +## Plans quotas and limits + +The data synchronization feature is available in the Solo and Team/Enterprise plans. The feature's behaviors are similar in all plans, but some **quotas and limits apply**. Here are the main ones: + +- **Solo plan**: + - 5 environments synchronized. + - 5MB per environment. +- **Team plan**: + - 10 environments synchronized. + - 10MB per environment. +- **Enterprise plan**: + - 20 environments synchronized. + - 15MB per environment. + +For all users (Solo, Team, and Enterprise), the environments can be synchronized across an unlimited number of devices with a limit of 2 simultaneous devices per user. + +These quotas and limits are subject to change. Please refer to this documentation for the latest information. + +## Current limitations + +The data synchronization feature is still in its early stages and has some **limitations**: + +- The "presence" indicator is not yet implemented. You will be able to see how many users are currently connected to the cloud space, but you won't be able to see who is editing the environment and what they are editing. +- External files linked to the environment are not synchronized (e.g. environment's certificates or files used in the "File" response body type). +- The CLI and serverless package do not support access to cloud environments yet. +- Team and Enterprise plans are currently not offering a personal cloud space for each user. All environments are shared across the team. diff --git a/content/docs/v4.0.0/api-endpoints/templates-and-ai-assistant.md b/content/docs/latest/mockoon-cloud/templates-and-ai-assistant.md similarity index 89% rename from content/docs/v4.0.0/api-endpoints/templates-and-ai-assistant.md rename to content/docs/latest/mockoon-cloud/templates-and-ai-assistant.md index 7f11e125..a2314070 100644 --- a/content/docs/v4.0.0/api-endpoints/templates-and-ai-assistant.md +++ b/content/docs/latest/mockoon-cloud/templates-and-ai-assistant.md @@ -3,11 +3,10 @@ title: Templates and AI assistant meta: title: Mockoon templates and AI assistant documentation description: All you need to know about Mockoon's mock API ready to use JSON templates and AI assistant to generate your own dynamic and realistic templates. -order: 710 -proBadge: true +order: 900 --- -# Templates and AI assistant +# Templates and AI assistantPRO --- @@ -23,7 +22,7 @@ The pre-generated templates can be found in the desktop application. To use a template in your routes, click on the "From template" entry in the route creation menu to open the templates dialog: -![modal with templates list{390x304}](docs-img:pre-generated-templates-modal.png) +![modal with templates list{440x304}](docs-img:pre-generated-templates-modal.png) Then, select the template you want to use and either copy-paste its content manually or click on one of the two buttons to create a new **GET endpoint** or a **CRUD endpoint with a data bucket**. @@ -31,7 +30,7 @@ Then, select the template you want to use and either copy-paste its content manu The "GET route" button will create a new HTTP GET route and copy the template content as the body. The "CRUD + data" button will create a new CRUD endpoint with a linked data bucket and copy the template content as the data bucket content. -> Some templates are offered for free, while most of them require a subscription to [Mockoon Pro](/pro/). The templates part of the Pro plans are marked with a small yellow corner. +> Starting with version 8.0.0 all the pre-generated templates are available for **free**. ## Use the AI assistant to generate realistic data @@ -56,7 +55,7 @@ Several options are available to fine-tune the generated templates: - **JSON**: the generated template will be a valid JSON object. - **array**: the generated template root level will be a JSON array (usually used with the **JSON** option). -- **templating**: the generated template will contain Handlebars [templating helpers](docs:templating/overview) (e.g. `{{faker 'name.firstName'}}`). Please note that disabling this option usually results in longer templates. +- **templating**: the generated template will contain Handlebars [templating helpers](docs:templating/overview) (e.g. `{{faker 'person.firstName'}}`). Please note that disabling this option usually results in longer templates. ![prompt options buttons{860x801}](docs-img:ai-assistant-template-generate-options.png) @@ -66,4 +65,4 @@ If you want more freedom when generating templates (using a different data forma ### AI assistant quota -Each use of the AI assistant will count as one credit towards your monthly quota. You can check your quota in your [account page](https://mockoon.com/account/info/). +Each use of the AI assistant will count as one credit towards your monthly quota. You can check your quota in your [account page](/account/subscription/). diff --git a/content/docs/latest/mockoon-data-files/data-storage-location.md b/content/docs/latest/mockoon-data-files/data-storage-location.md index 35d95152..94f3bcca 100644 --- a/content/docs/latest/mockoon-data-files/data-storage-location.md +++ b/content/docs/latest/mockoon-data-files/data-storage-location.md @@ -3,7 +3,7 @@ title: Data storage location meta: title: Data storage location description: Learn where Mockoon's data storage files and application settings are located and how to move them to other folders -order: 900 +order: 1100 --- # Data storage location @@ -16,13 +16,13 @@ Since [v1.16.0](https://github.com/mockoon/mockoon/releases/tag/v1.16.0), Mockoo You can locate the folder in which the API data are stored by right-clicking on each environment and selecting **"Show data file in explorer/finder"**: -![click on show in folder in the context menu{490x309}](docs-img:environment-show-in-folder.png) +![click on show in folder in the context menu{515x346}](docs-img:environment-show-in-folder.png) ## Moving the files You can move the data files to another folder by right-clicking on an environment and selecting **"Move data file to folder"**: -![click on Move data file to folder in folder in the context menu{490x340}](docs-img:environment-move-to-folder.png) +![click on Move data file to folder in folder in the context menu{515x377}](docs-img:environment-move-to-folder.png) > Please note that the environment file will be copied to the new folder, and the original file will **not** be deleted. If you want to delete the original file, you will have to do it manually. diff --git a/content/docs/latest/mockoon-data-files/environment-clipboard-copy.md b/content/docs/latest/mockoon-data-files/environment-clipboard-copy.md index 850e843c..3c6e68ce 100644 --- a/content/docs/latest/mockoon-data-files/environment-clipboard-copy.md +++ b/content/docs/latest/mockoon-data-files/environment-clipboard-copy.md @@ -3,7 +3,7 @@ title: Copy data to the clipboard meta: title: Copy data to the clipboard description: Learn how to easily share your Mockoon's mock API JSON definitions with your team by copying them to the clipboard and importing them in the application -order: 920 +order: 1120 --- # Copy data to the clipboard @@ -14,7 +14,7 @@ order: 920 To copy a specific environment or route's JSON data to the clipboard, right-click on the environment or route and select **Copy to clipboard (JSON)**: -![Right click on an environment and click on Copy to clipboard (JSON){690x328}](docs-img:export-clipboard-env.png) +![Right click on an environment and click on Copy to clipboard (JSON){715x365}](docs-img:export-clipboard-env.png) The resulting JSON can be saved in a file and directly opened in the desktop app or used with the CLI. diff --git a/content/docs/latest/mockoon-data-files/settings-and-logs.md b/content/docs/latest/mockoon-data-files/settings-and-logs.md index 4dc4b640..3442a4e2 100644 --- a/content/docs/latest/mockoon-data-files/settings-and-logs.md +++ b/content/docs/latest/mockoon-data-files/settings-and-logs.md @@ -3,7 +3,7 @@ title: Settings and logs meta: title: Settings and logs description: Learn where Mockoon's desktop application settings and log files are located for each operating system -order: 930 +order: 1130 --- # Settings and logs diff --git a/content/docs/latest/mockoon-data-files/sharing-mock-api-files.md b/content/docs/latest/mockoon-data-files/sharing-mock-api-files.md index 75d1cb43..7ccd9a9f 100644 --- a/content/docs/latest/mockoon-data-files/sharing-mock-api-files.md +++ b/content/docs/latest/mockoon-data-files/sharing-mock-api-files.md @@ -3,7 +3,7 @@ title: Sharing your mock API files meta: title: Sharing your mock API files description: Learn how to easily share your mock API files with other mockoon users, or use them with the CLI, and setup a git repository -order: 910 +order: 1110 --- # Sharing your mock API files @@ -16,7 +16,7 @@ order: 910 Each file can be easily shared with other Mockoon's users, "as-is". After [locating your environment file](docs:mockoon-data-files/data-storage-location#locating-the-files), you can share it with your coworkers by using Git for example. You coworkers can then save the file in any folder and open it directly using the "Open environment" button: -![open an environment{449x235}](docs-img:open-environment.png) +![open an environment{639x299}](docs-img:open-environment.png) ### Use a Git-tracked folder diff --git a/content/docs/latest/openapi/import-export-openapi-format.md b/content/docs/latest/openapi/import-export-openapi-format.md index ab3b4e37..e8ef62b9 100644 --- a/content/docs/latest/openapi/import-export-openapi-format.md +++ b/content/docs/latest/openapi/import-export-openapi-format.md @@ -3,7 +3,7 @@ title: Import/export in OpenAPI format meta: title: Import/export in OpenAPI format description: Learn how to easily import and export or share with your team your mock API servers and routes using the OpenAPI specification -order: 800 +order: 1000 --- # Import/export in OpenAPI format diff --git a/content/docs/latest/openapi/openapi-specification-compatibility.md b/content/docs/latest/openapi/openapi-specification-compatibility.md index 34121e93..78815bf0 100644 --- a/content/docs/latest/openapi/openapi-specification-compatibility.md +++ b/content/docs/latest/openapi/openapi-specification-compatibility.md @@ -3,7 +3,7 @@ title: OpenAPI specification compatibility meta: title: OpenAPI specification compatibility description: Learn more about Mockoon compatibility with the OpenAPI specification and how to easily share your API definitions with your team -order: 810 +order: 1010 --- # OpenAPI specification compatibility diff --git a/content/docs/latest/response-configuration/file-serving.md b/content/docs/latest/response-configuration/file-serving.md index 4f09517c..5fcae71b 100644 --- a/content/docs/latest/response-configuration/file-serving.md +++ b/content/docs/latest/response-configuration/file-serving.md @@ -16,7 +16,7 @@ Besides using the body editor, Mockoon allows you to serve different files for e To serve a file, you must provide a path in the file input field: -![fill the file input field{987x354}](docs-img:file-path.png) +![fill the file input field{1157x354}](docs-img:file-path.png) > When a file path is provided, the body editor content will be ignored. @@ -24,7 +24,7 @@ To serve a file, you must provide a path in the file input field: You can either provide an absolute path like `/home/username/file.json` or a relative path. Starting with [v1.16.0](https://github.com/mockoon/mockoon/releases/tag/v1.16.0), relative paths are resolved from the environment's file location. You can check the environment's file location by right-clicking on an environment en select "Show in folder" in the contextual menu: -![show in folder menu entry{490x309}](docs-img:environment-show-in-folder.png) +![show in folder menu entry{515x315}](docs-img:environment-show-in-folder.png) > Prior to v1.16.0, relative file paths were resolved from the application executable. This is also supported by the CLI since its version [1.2.0](https://github.com/mockoon/cli/releases/tag/v1.2.0). @@ -42,7 +42,7 @@ Templating can be disabled both for the body editor and the file content. Please > > Parsing the templating helpers inside big files can be a very intensive task (CPU and memory intensive). All the files in different formats than the one mentioned above will be streamed to improve performances. > If you need to send big files in one of the above formats but don't need to parse the templating, you can disable it in the route response settings. It will stream the file instead of parsing it and improve the performance. -> ![disable templating in route response{1066x181}](docs-img:route-response-disable-templating.png) +> ![disable templating in route response{1236x181}](docs-img:route-response-disable-templating.png) ### File input templating @@ -52,7 +52,7 @@ Templating is also supported directly in the **file input field**. It allows to By default, Mockoon will return an error in the body when a file is not found. It will still keep the status code you set up on your route response. You can instead choose to automatically return a 404 by activating an option in the route response settings: -![tick the 404 fallback checkbox{1066x231}](docs-img:enable-404-fallback.png) +![tick the 404 fallback checkbox{1236x231}](docs-img:enable-404-fallback.png) This option will also fall back to use the content present in the body editor. diff --git a/content/docs/latest/response-configuration/response-body.md b/content/docs/latest/response-configuration/response-body.md index 31c1c66a..49f03db1 100644 --- a/content/docs/latest/response-configuration/response-body.md +++ b/content/docs/latest/response-configuration/response-body.md @@ -14,13 +14,13 @@ Each [route response](docs:route-responses/multiple-responses) can serve a diffe You can choose each option using the body selector: -![body type toggle buttons{1264x547}](docs-img:body-type-toggle.png) +![body type toggle buttons{1484x547}](docs-img:body-type-toggle.png) ## Body editor (inline) You can use the body editor to directly create your response content. It supports all the [templating helpers](docs:templating/overview). -![inline body editor{1169x800}](docs-img:inline-body-editor.png) +![inline body editor{1254x800}](docs-img:inline-body-editor.png) > Mockoon will save the content of the inline body editor directly in your [data file](docs:mockoon-data-files/data-storage-location). > Using an external file could improve the performance for large content. @@ -29,7 +29,7 @@ You can use the body editor to directly create your response content. It support You can also choose to serve an external file, using the second option: -![external file linking input{1169x800}](docs-img:body-file-serving.png) +![external file linking input{1254x800}](docs-img:body-file-serving.png) Please refer to the [file serving documentation](docs:response-configuration/file-serving) for more information. @@ -37,6 +37,6 @@ Please refer to the [file serving documentation](docs:response-configuration/fil You can finally choose to serve the content of a data bucket using the third option: -![data bucket linking select menu{1169x800}](docs-img:body-data-bucket.png) +![data bucket linking select menu{1254x800}](docs-img:body-data-bucket.png) Please refer to the [data bucket documentation](docs:data-buckets/overview) for more information. diff --git a/content/docs/latest/response-configuration/response-headers.md b/content/docs/latest/response-configuration/response-headers.md index 50df4da0..bd3eed2d 100644 --- a/content/docs/latest/response-configuration/response-headers.md +++ b/content/docs/latest/response-configuration/response-headers.md @@ -16,11 +16,11 @@ In Mockoon you can easily define **response headers** for **each route** but als To add response headers like `Content-Type` to your route, go to the route's **Headers tab** and fill the name and value fields: -![Complete route response header form{997x204}](docs-img:fill-route-header-form.png) +![Complete route response header form{1167x204}](docs-img:fill-route-header-form.png) You can add one or more headers by clicking on the "Add header" button at the bottom of the list: -![Add route response header{977x234}](docs-img:add-route-header.png) +![Add route response header{1147x234}](docs-img:add-route-header.png) ## Environment level response headers @@ -28,8 +28,8 @@ You can also add response headers at the environment level. Headers defined in a Open the **Environment Headers** by clicking on the tab at the top of the window: -![click on the headers tab{746x160}](docs-img:open-environment-headers.png) +![click on the headers tab{796x160}](docs-img:open-environment-headers.png) And add one or more headers by clicking on the "Add header" button at the bottom of the list: -![Add environment header{1177x137}](docs-img:add-environment-header.png) +![Add environment header{1347x137}](docs-img:add-environment-header.png) diff --git a/content/docs/latest/route-responses/dynamic-rules.md b/content/docs/latest/route-responses/dynamic-rules.md index 745676d0..a0eee4d4 100644 --- a/content/docs/latest/route-responses/dynamic-rules.md +++ b/content/docs/latest/route-responses/dynamic-rules.md @@ -20,7 +20,7 @@ You can define an unlimited number of rules for each route. At each request, Moc To add a new rule to a response, go to the route response's **Rules tab**, click on "Add rule" and fill the fields: -![Click on add and fill the fields{987x304}](docs-img:add-route-response-rule.png) +![Click on add and fill the fields{1157x304}](docs-img:add-route-response-rule.png) ### Reordering rules @@ -40,7 +40,7 @@ You can temporarily disable the rules and serve the default response only. To ac Inside a route response, rules are interpreted by default with the OR logical operator. When you have more than one rule in a route response, you can easily switch the operator applied when interpreting the rules, by clicking on the `OR|AND` buttons at the left of the rules: -![Choose the rule operator OR AND{982x214}](docs-img:route-response-rules-operator.png) +![Choose the rule operator OR AND{1152x214}](docs-img:route-response-rules-operator.png) Rules have four parts: @@ -52,35 +52,37 @@ Rules have four parts: ### 1. Target -![Rule target{1007x204}](docs-img:route-response-rules-target.png) +![Rule target{1177x204}](docs-img:route-response-rules-target.png) In the dropdown menu you can choose between: -- the **body** value (full raw content or one of its properties if request's `Content-Type` is either `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`, `application/xml`, `application/soap+xml` or `text/xml`). -- the value of a **query string field**. -- the value of a **header**. -- the value of a **cookie**. -- the value of a **route parameter**. -- the value of a **global variable**. +- the **request body** value (full raw content or one of its properties if request's `Content-Type` is either `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`, `application/xml`, `application/soap+xml` or `text/xml`). +- the value of a **query parameter**. +- the value of a **request header**. +- the value of a **request cookie**. +- the value of a [**route parameter**](docs:api-endpoints/routing#route-parameters). +- the value of a [**global variable**](docs:variables/global-variables). +- the value of a [**data bucket content**](docs:data-buckets/overview). - the **request number** index starting at 1. ### 2. Property name or path -![Rule property{1007x204}](docs-img:route-response-rules-property.png) +![Rule property{1177x204}](docs-img:route-response-rules-property.png) Depending on the **target**, the way to access properties may be different: -- **body**: +- **request body**: - keep empty to match against the full raw body content. - use a path to access one of its properties. Two syntaxes are supported, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. Fetching object properties is compatible with request's bodies of `Content-Type` `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`, `application/xml`, `application/soap+xml` or `text/xml`. _Please note that XML bodies are parsed using [xml-js](https://www.npmjs.com/package/xml-js) package. Refer to this [page](docs:response-configuration/xml-support) or the package documentation for more information on how the XML is parsed and how to fetch specific properties._ _Please also note that `multipart/form-data` only supports fields. Uploaded files will be ignored._ -- **query string**: either provide a property name like `filter` or a path if the query string field is an object `filter.primary`. +- **query parameter**: either provide a property name like `filter` or a path if the query parameter is an object `filter.primary`. - **headers**: a header name like `Accept` or `Content-Type`. - **cookies**: the cookie name like `Session-id`. -- **route param**: a route param name without the colon (":"), `:userId` becoming `userId`. -- **global variable**: a [global variable](docs:variables/global-variables) name like `myVar`. You can use a path to access one of its properties if the variable is storing arrays or objects. Two syntaxes are supported, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. Examples: `myVar.property.subProperty`, `myVar.property.0.subProperty` or `$.myVar.property`. +- **route parameter**: a route parameter name without the colon (":"), `:userId` becoming `userId`. +- **global variable**: a [global variable](docs:variables/global-variables) name like `myVar`. You can use a path to access one of its properties if the variable is storing arrays or objects. Two syntaxes are supported, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `myVar.key\.with\.dot`. Examples: `myVar.property.subProperty`, `myVar.property.0.subProperty` or `$.myVar.property`. +- **data bucket content**: a [data bucket](docs:data-buckets/overview) name like `myData`. You can use a path to access one of its properties if the bucket is storing arrays or objects. Two syntaxes are supported, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `myData.key\.with\.dot`. Examples: `myData.property.subProperty`, `myData.property.0.subProperty` or `$.myData.property`. - **request number**: _nothing has to be provided here for the request number_. For **body** and **query string**, if the property is an array, Mockoon will automatically check in the array if at least one item matches the value. @@ -89,11 +91,11 @@ For **body** and **query string**, if the property is an array, Mockoon will aut You can invert the **comparison operator** (**!** equals, **!** regex match, etc.) by toggling on the exclamation mark button: -![Rule comparison operator{1007x204}](docs-img:route-response-rules-invert-operator.png) +![Rule comparison operator{1177x204}](docs-img:route-response-rules-invert-operator.png) ### 4. Comparison operator -![Rule comparison operator{1007x204}](docs-img:route-response-rules-comparison-operator.png) +![Rule comparison operator{1177x204}](docs-img:route-response-rules-comparison-operator.png) Multiple comparison operators are available in each rule: @@ -104,7 +106,7 @@ Multiple comparison operators are available in each rule: ### 5. Value -![Rule value{1007x204}](docs-img:route-response-rules-value.png) +![Rule value{1177x204}](docs-img:route-response-rules-value.png) Depending on the comparison operator chosen, **equals** or **regex match**, you can either set a simple text value like "expected value" or any kind of regex. To use a regex, you must write it without the leading and trailing slashes. @@ -114,4 +116,4 @@ You can also test for empty values with the following regex: `^$|\s+`. The **request number** supports simple entries like `1` or `2` but also regexes, allowing you to return a different response for the first 3 calls `^[1-3]$` or failing on odd request indexes `[13579]$`. -> 💡 The response rule values also support templating helpers to create dynamic rules. See the [templating helpers](docs:templating/overview) documentation for more information. +> 💡 The **response rule values also support templating helpers** to create dynamic rules. See the [templating helpers](docs:templating/overview) documentation for more information. diff --git a/content/docs/latest/route-responses/global-routes-with-rules.md b/content/docs/latest/route-responses/global-routes-with-rules.md index d48fa9b9..a946f34a 100644 --- a/content/docs/latest/route-responses/global-routes-with-rules.md +++ b/content/docs/latest/route-responses/global-routes-with-rules.md @@ -18,7 +18,7 @@ Three parts are required to create a global route: To create a global route, you first need to create a new HTTP route that will match all the endpoints you want to protect. To do so, create a new route and select "All methods" in the method dropdown: -![wildcard route on all methods{599x318}](docs-img:create-wildcard-route.png) +![wildcard route on all methods{649x318}](docs-img:create-wildcard-route.png) In this example, the wildcard route is placed above the `GET /users` route, which is important as it will be [evaluated first](docs:api-endpoints/routing#routes-order) and catch all the requests. You can create it first or move it up in the routes list with a drag and drop. @@ -30,11 +30,11 @@ In this example, the wildcard route is placed above the `GET /users` route, whic The second step is to create one or more responses with rules. For example, you can create a response checking that the request contains an `Authorization` header and returning a `401` error if's not present. To follow this example, use the existing response or create a new one and set the status code to `401`: -![create response with status code 401{1006x261}](docs-img:response-status-code-401.png) +![create response with status code 401{1176x261}](docs-img:response-status-code-401.png) Add a new rule to this response by clicking on the "add rule" button and selecting the "Header" rule type. Then, set the rule to check that the `Authorization` header is null as we want to return a `401` error if it is not present: -![create rule to check that the Authorization header is null{987x304}](docs-img:response-rule-header-null.png) +![create rule to check that the Authorization header is null{1157x304}](docs-img:response-rule-header-null.png) > 💡 You can create more responses with associated rules to verify more criteria on the request and serve different responses accordingly (errors, etc.). @@ -42,7 +42,7 @@ Add a new rule to this response by clicking on the "add rule" button and selecti Once your route is created and your responses customized, activate the fallback mode by clicking on the "fallback" icon next to the response list: -![Activate fallback mode{1264x174}](docs-img:activate-fallback-mode.png) +![Activate fallback mode{1289x174}](docs-img:activate-fallback-mode.png) This will automatically pass the request to the next route when none of the [responses' rules](docs:route-responses/dynamic-rules) match. diff --git a/content/docs/latest/route-responses/multiple-responses.md b/content/docs/latest/route-responses/multiple-responses.md index a47ff054..7cf87c5d 100644 --- a/content/docs/latest/route-responses/multiple-responses.md +++ b/content/docs/latest/route-responses/multiple-responses.md @@ -16,7 +16,7 @@ For each route, multiple responses can be defined (status, body, and headers) an To **add** a new response to your route, click on the "plus" icon next to the responses list: -![Click on the icon to add a new response{987x164}](docs-img:add-route-response.png) +![Click on the icon to add a new response{1157x164}](docs-img:add-route-response.png) You can also **duplicate** an existing route response by clicking on the "copy" icon on the right: @@ -28,7 +28,7 @@ Everything will be copied to the new response: documentation, file/body, headers Route responses order define the order in which the [rules are interpreted](docs:route-responses/dynamic-rules). You can easily change the default response by reordering the responses menu with a drag and drop: -![Reorder route responses{968x214}](docs-img:reorder-responses.png) +![Reorder route responses{1138x214}](docs-img:reorder-responses.png) ## Default route response diff --git a/content/docs/latest/server-configuration/cors.md b/content/docs/latest/server-configuration/cors.md index 6c243937..f97611c2 100644 --- a/content/docs/latest/server-configuration/cors.md +++ b/content/docs/latest/server-configuration/cors.md @@ -18,11 +18,11 @@ For your application to work, you can make Mockoon automatically answer to these Open the **Environment Settings** by clicking on the tab at the top of the window: -![click on the settings tab{1148x160}](docs-img:open-environment-settings.png) +![click on the settings tab{1198x160}](docs-img:open-environment-settings.png) Enable the **Automatically handle OPTIONS pre-flight requests ** by ticking the checkbox: -![tick the CORS checkbox{1048x509}](docs-img:enable-cors.png) +![tick the CORS checkbox{1098x509}](docs-img:enable-cors.png) You need to restart the environment for the change to take effect. @@ -42,12 +42,12 @@ You can also add the same CORS headers to all routes of a mock API with one clic Open the **Environment Headers** by clicking on the tab at the top of the window: -![click on the headers tab{1264x160}](docs-img:open-environment-headers.png) +![click on the headers tab{1484x160}](docs-img:open-environment-headers.png) Then, click on the **Add CORS headers** link: -![Click on the add CORS headers link{1264x137}](docs-img:add-cors-headers.png) +![Click on the add CORS headers link{1484x137}](docs-img:add-cors-headers.png) The above headers will be automatically added to your list of headers: -![view cors headers in the list{1264x237}](docs-img:view-cors-headers.png) +![view cors headers in the list{1484x237}](docs-img:view-cors-headers.png) diff --git a/content/docs/latest/server-configuration/listening-hostname.md b/content/docs/latest/server-configuration/listening-hostname.md index c7042e8c..7077d07d 100644 --- a/content/docs/latest/server-configuration/listening-hostname.md +++ b/content/docs/latest/server-configuration/listening-hostname.md @@ -14,11 +14,11 @@ By default, Mockoon's mock APIs will listen to all available network adapters on To configure each environment to listen on a specific hostname, open the **Environment Settings** by clicking on the tab at the top of the window: -![click on the settings tab{1148x160}](docs-img:open-environment-settings.png) +![click on the settings tab{1198x160}](docs-img:open-environment-settings.png) Add a **custom hostname** in the input field: -![field to set a custom hostname{1264x213}](docs-img:custom-hostname-setting.png) +![field to set a custom hostname{1484x213}](docs-img:custom-hostname-setting.png) > ⚠️ You may need to restart your environment for the change to take effect. diff --git a/content/docs/latest/server-configuration/port-prefix.md b/content/docs/latest/server-configuration/port-prefix.md index 36025d2e..60fe8449 100644 --- a/content/docs/latest/server-configuration/port-prefix.md +++ b/content/docs/latest/server-configuration/port-prefix.md @@ -14,12 +14,12 @@ By default, Mockoon's new environments will listen on port `3000` and will have You can change the **port number** and the **API prefix** in the **Environment Settings** by clicking on the tab at the top of the window: -![click on the settings tab{871x160}](docs-img:open-environment-settings.png) +![click on the settings tab{921x160}](docs-img:open-environment-settings.png) Then, change the port number and/or the API prefix in the corresponding input fields: -![field to set a custom port{583x298}](docs-img:environment-custom-port.png) +![field to set a custom port{661x298}](docs-img:environment-custom-port.png) -![field to set a custom prefix{993x298}](docs-img:environment-custom-prefix.png) +![field to set a custom prefix{1128x298}](docs-img:environment-custom-prefix.png) > 💡 The API prefix can contain multiple sections (e.g. `/api/v1/`) and will be applied to all your routes. diff --git a/content/docs/latest/server-configuration/proxy-mode.md b/content/docs/latest/server-configuration/proxy-mode.md index 46175ff2..69508e5d 100644 --- a/content/docs/latest/server-configuration/proxy-mode.md +++ b/content/docs/latest/server-configuration/proxy-mode.md @@ -16,11 +16,11 @@ Mockoon supports partial mocking of an API endpoints by forwarding the requests To activate the proxy mode, open the **Environment Proxy** options by clicking on the tab at the top of the window: -![click on proxy tab{998x160}](docs-img:open-proxy-options.png) +![click on proxy tab{1048x160}](docs-img:open-proxy-options.png) Enable the proxy mode by checking the box and enter the server URL to which you want to forward the calls. A small shield icon should appear on the right of your environment name indicating that the proxy mode has been enabled: -![tick the Proxy checkbox{1264x277}](docs-img:enable-proxy.png) +![tick the Proxy checkbox{1484x277}](docs-img:enable-proxy.png) From now on, all routes that have been defined in Mockoon will be intercepted, and any other request not matching any route path will be forwarded to the server URL you entered in the proxy mode setting. @@ -28,12 +28,12 @@ From now on, all routes that have been defined in Mockoon will be intercepted, a By default, the API prefix will be part of the path called on the proxied API. You can disable this behavior by ticking the "Remove prefix" checkbox: -![tick the Proxy no prefix forward checkbox{696x320}](docs-img:proxy-no-forward.png) +![tick the Proxy no prefix forward checkbox{746x320}](docs-img:proxy-no-forward.png) ## Proxy headers Proxy specific headers can also be added, both to the forwarded request and the response received from the target API. -![add proxy headers by filling the keys and values{1264x379}](docs-img:proxy-headers.png) +![add proxy headers by filling the keys and values{1484x379}](docs-img:proxy-headers.png) > **Proxy request headers** will be automatically added to the request sent to the proxied server, while **proxy response headers** are added to the response received from the proxied server. diff --git a/content/docs/latest/server-configuration/serving-over-tls.md b/content/docs/latest/server-configuration/serving-over-tls.md index 52fcf79e..830f7098 100644 --- a/content/docs/latest/server-configuration/serving-over-tls.md +++ b/content/docs/latest/server-configuration/serving-over-tls.md @@ -16,11 +16,11 @@ Mockoon supports serving your mock API over TLS with a self-signed certificate b You can activate the TLSoption for each environment independently. Open the **Environment Settings** by clicking on the tab at the top of the window: -![click on the settings tab{1148x160}](docs-img:open-environment-settings.png) +![click on the settings tab{1198x160}](docs-img:open-environment-settings.png) Enable the **TLS option** by ticking the checkbox. The option was successfully activated if a yellow lock is displayed next to the environment name. -![tick the TLS checkbox{804x343}](docs-img:enable-tls.png) +![tick the TLS checkbox{854x343}](docs-img:enable-tls.png) > You may need to restart your environment for the change to take effect. @@ -32,7 +32,7 @@ Please note that Mockoon is using a self-signed certificate to serve your enviro You can also provide your certificate in both PKCS12 or PEM formats by filling out the input fields with the path to the file(s). -![add certificate path{1264x612}](docs-img:enable-tls-custom-certificate.png) +![add certificate path{1484x612}](docs-img:enable-tls-custom-certificate.png) Mockoon also supports passphrase-protected keys and custom-trusted CA certificates. As Mockoon is using Node.js' `tls`, you can refer to the [`tls.createSecureContext()` documentation](https://nodejs.org/dist/latest-v16.x/docs/api/tls.html#tlscreatesecurecontextoptions) for a full description of the available options. diff --git a/content/docs/latest/templating/mockoon-helpers.md b/content/docs/latest/templating/mockoon-helpers.md index 9918077a..a82cc6fc 100644 --- a/content/docs/latest/templating/mockoon-helpers.md +++ b/content/docs/latest/templating/mockoon-helpers.md @@ -1250,7 +1250,7 @@ Return a random GUID. Alias of `faker 'string.uuid'`. ## ipv4 -Return a random IP v4. Alias of `faker 'internet.ip'`. +Return a random IP v4. Alias of `faker 'internet.ipv4'`. **Examples:** diff --git a/content/docs/latest/templating/overview.md b/content/docs/latest/templating/overview.md index 42b7e3bf..74c89eb9 100644 --- a/content/docs/latest/templating/overview.md +++ b/content/docs/latest/templating/overview.md @@ -74,7 +74,7 @@ Here is an example of what you can do with this templating system: } ``` -![body editor content{963x551}](docs-img:body-templating.png) +![body editor content{1133x551}](docs-img:body-templating.png) The above template produces the following body with this request: @@ -171,11 +171,11 @@ Templating can be disabled for the body and file content in each route response First, open the **Route response settings**: -![click on route response fourth settings tab{1004x174}](docs-img:open-route-response-settings.png) +![click on route response fourth settings tab{1174x174}](docs-img:open-route-response-settings.png) Then, disable the templating by checking the box: -![check the disable templating box{1046x181}](docs-img:disable-route-response-templating.png) +![check the disable templating box{1216x181}](docs-img:disable-route-response-templating.png) ### File input templating @@ -187,7 +187,7 @@ If you have a set of files named `./file1.json` and `./file2.json`, a route para If you call this route with `/myroute/1`, `./file1.json` will be sent. -![add a templating helper in the file path{977x184}](docs-img:file-path-templating.png) +![add a templating helper in the file path{1147x184}](docs-img:file-path-templating.png) > For more information about absolute and relative file paths, please refer to our [file serving](docs:response-configuration/file-serving#absolute-or-relative-paths) documentation. @@ -195,8 +195,8 @@ If you call this route with `/myroute/1`, `./file1.json` will be sent. Templating helpers can also be used in the **headers values** both in route headers and environment headers: -![add a templating helper in the header value{1004x244}](docs-img:headers-templating.png) +![add a templating helper in the header value{1174x244}](docs-img:headers-templating.png) Finally, templating helpers can be used in the response **rule values** to create dynamic rules: -![screenshot showing a response rule with a template helper in the value field{997x164}](docs-img:template-helper-response-rule-value.png) +![screenshot showing a response rule with a template helper in the value field{1167x164}](docs-img:template-helper-response-rule-value.png) diff --git a/content/docs/v4.0.0/api-endpoints/crud-routes.md b/content/docs/v4.0.0/api-endpoints/crud-routes.md deleted file mode 100644 index 143b9767..00000000 --- a/content/docs/v4.0.0/api-endpoints/crud-routes.md +++ /dev/null @@ -1,134 +0,0 @@ ---- -title: CRUD routes -meta: - title: Mockoon CRUD routes documentation - description: All you need to know about Mockoon's mock API CRUD routes creation, behavior, data bucket operations and data manipulation. -order: 710 ---- - -# CRUD routes - ---- - -## Overview - -Where Mockoon routes are independent and stateless, CRUD routes can generate multiple endpoints to perform CRUD operations (Create, Read, Update, Delete) on [data buckets](docs:data-buckets/overview). Data buckets are generated when the server start, their state persisting between calls. It makes them the perfect tool to simulate small databases. - -A CRUD endpoint will automatically create a series of routes during runtime, allowing you to perform actions on your data bucket. A typical example is an array of resources (users, invoices, etc.) you can update through a PUT request and see the result in a subsequent GET request. - -To create a CRUD route, click on the "CRUD route" entry in the add route menu: - -![Add a new CRUD route{390x304}](docs-img:add-crud-route.png) - -Then, set its path, usually a [resource name](/articles/api-guide-rest-api-components/#resource-url-request): - -![Set the CRUD route path{1264x176}](docs-img:set-crud-route-path.png) - -> Your path can be more complex, and contains parameters or multiple sections. Remember that this will be the "prefix" of the different endpoints (see below). - -## Data bucket link - -After creating a CRUD endpoint, you need to link it to a data bucket: - -![Link a data bucket to a CRUD route{1264x334}](docs-img:link-data-bucket-crud-route.png) - -> Head over to our [data buckets](docs:data-buckets/overview) documentation to learn how to create a new data bucket. - -### Supported content - -The CRUD route will work with any content stored in your data bucket: valid JSON in the form of an array of objects, an object, a primitive, etc., or any non-valid JSON. The route behaviors will vary depending on the content stored in the bucket (see table below). - -### Resetting the data bucket content - -The data bucket content is generated when the server starts, and its state persists between calls. However, its state will not be saved in the [data file](docs:mockoon-data-files/data-storage-location), and you can reset it to its initial state by restarting the mock API. - -## CRUD route differences - -When creating a CRUD route, you may notice some differences in the interface, namely: - -- The route HTTP method cannot be set and will be handled automatically. -- The status code cannot be changed and will be set automatically while performing operations. -- A fixed and default route response is automatically created and **must** be linked to a data bucket in order to perform CRUD operations. - -Latency and custom headers can still be added. However, an `application/json` `Content-Type` will be forced when appropriate. - -Also, CRUD routes are still compatible with creating [multiple responses and rules](docs:route-responses/multiple-responses). The major difference is that the default route response cannot be set and will always be the first one linked to the data bucket. This response cannot be deleted nor reordered. Aside from these differences everything else still applies. - -## List of routes and operations - -Mockoon will automatically translate a CRUD endpoint to multiple routes allowing for a wide range of behaviors. The system is very flexible and allows for any content, storing and updating primitives to simulate a flag or environment variable system, updating and sorting an array of objects, etc. - -| | | Array of objects | Array of primitives (`id` parameter is acting like an index) | Object, primitive or non-valid JSON | -| ---------- | ---------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------ | ----------------------------------------- | -| **GET** | `/resources` | Returns the entire array \* | Returns the entire array \* | Returns the content | -| **GET** | `/resources/:id` | Returns an object by its `id` property | Returns an item by its index | Returns the content | -| **POST** | `/resources` | Inserts a new object in the array (autogenerate the `id` (UUID) if not provided) | Inserts a new item in the array | Overwrites the content | -| **PUT** | `/resources` | Replaces the whole data bucket content | Replaces the whole data bucket content | Overwrites the content | -| **PUT** | `/resources/:id` | Performs a full object update by its `id` (replace) | Replaces the item at index | Overwrites the content | -| **PATCH** | `/resources` | Concatenates the arrays | Concatenates the arrays | Overwrites the content (merge if objects) | -| **PATCH** | `/resources/:id` | Performs a partial object update by its `id` (merge) | Replaces the item at index | Overwrites the content (merge if objects) | -| **DELETE** | `/resources` | Deletes the data bucket content | Deletes the data bucket content | Deletes the content | -| **DELETE** | `/resources/:id` | Deletes an object by its `id` | Deletes an item at index | Deletes the content | - -\* Supports [sorting and pagination](#sorting-and-pagination-on-the-main-get-route) - -> ⚠️ _Note:_ You can expect the above results assuming that you are sending the same type of content that the one stored in the data bucket (array ↔ array, object ↔ object, etc.). However, the system is very permissive, and you may push any content in an array, ending up with mixted type contents or replacing content with data of a different type. - -## Customizing the "id" property - -By default, CRUD endpoints will use the `id` property to identify objects in an array in all the routes manipulating a single resource (e.g. GET `/resource/:id`). However, you can change this property to anything you want, like `uuid`, `custom_id`, etc: - -![Customize the CRUD id property{1264x334}](docs-img:customize-crud-id-property-key.png) - -## Overriding a route - -You can easily override a CRUD operation route by declaring a regular HTTP route and putting it above the CRUD route (see [routes order](docs:api-endpoints/routing#routes-order)). This route will intercept the request allowing you to serve custom content for this operation. - -## Sorting and pagination on the main GET route - -The main `GET /path` route supports **sorting** and **pagination** when working with an **array**. - -### Sorting - -To sort an array, you can use the `sort` and `order` query parameters. You can sort by any property in the objects (strings or numbers) and order by either ascending or descending order: - -``` -GET /path?sort=name&order=desc -``` - -Sorting is also working on arrays of primitives (strings, numbers, etc.), in which case, the presence of the `sort` parameter is enough: - -``` -GET /path?sort&order=asc -``` - -### Pagination - -To paginate an array, you can use the `page` and `limit` query parameters. If you omit the `limit` parameter, it will default to 10 per page. If you omit the `page` parameter, it will show you the first x items. - -Examples: - -- second set of 25 items: - - ``` - GET /path?page=2&limit=25 - ``` - -- first 50 items: - - ``` - GET /path?limit=50 - ``` - -- second set of 10 items: - ``` - GET /path?page=2 - ``` - -Pagination will be applied after sorting, both can be cumulated: - -``` -GET /path?sort=name&page=2&limit=25 -``` - -> When using pagination, a `X-Total-Count` header will be present in the response with the total number of items. diff --git a/content/docs/v4.0.0/api-endpoints/folders.md b/content/docs/v4.0.0/api-endpoints/folders.md deleted file mode 100644 index c46182f2..00000000 --- a/content/docs/v4.0.0/api-endpoints/folders.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Folders -meta: - title: Mockoon folders documentation - description: Everything about Mockoon API endpoint folder and sub-folders organization, reordering, auto repair and route precedence -order: 720 ---- - -# Folders - ---- - -## Organize your endpoints - -You can organize your routes into folders and sub-folders: - -![routes organized in folders and sub-folders{799x522}](docs-img:routes-nested-folder.png) - -This new feature allows you to better organize your routes and make your APIs more readable and easier to navigate, with a clearer hierarchy. -You can drag and drop to move or reorganize your routes and folders. - -## Routes order - -The server will create the endpoints in the same order they appear in the list, should they be inside folders or not. See the [routing](docs:api-endpoints/routing#routes-order) documentation for more information. - -## Repairing the data file - -If Mockoon's [data file](docs:mockoon-data-files/data-storage-location) has broken references due to improper manipulation of the JSON, such as missing routes or nonexistent folders, it will automatically be repaired upon loading. -If a route or folder does not exist, it will be automatically removed. On the other hand, unlisted routes and folders will be added back to the root level. diff --git a/content/docs/v4.0.0/api-endpoints/routing.md b/content/docs/v4.0.0/api-endpoints/routing.md deleted file mode 100644 index b950e8ba..00000000 --- a/content/docs/v4.0.0/api-endpoints/routing.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: Routing -meta: - title: Mockoon routing documentation - description: Everything about Mockoon mock API paths creation, API prefix, route parameters, query strings, wildcards and more -order: 700 ---- - -# Routing - ---- - -## API prefix - -In order to prefix all your mock API routes, - -Open the **Environment Settings** by clicking on the tab at the top of the window: - -![click on the settings tab{767x160}](docs-img:open-environment-settings.png) - -Then, fill the **API prefix** input at the top of the **environment Settings**: - -![fill the prefix input{995x298}](docs-img:environment-prefix.png) - -The prefix will appear under your environment name in the environments list. All your environment's routes will now be prefixed and available at the following address `http://localhost:port/myprefix/myroute` instead of `http://localhost:port/myroute`. - -You need to restart the environment for the change to take effect. - -## API routes - -Mockoon uses Express to run the mock servers. In general, most of the Express' documentation applies. Please refer to the [routing documentation](https://expressjs.com/en/guide/routing.html) for more information and examples on the following topics. - -### Routes order - -Routes are declared in the server in the order displayed in the application (inside folders or not). It means that a the first ones takes precedence over the following ones. - -One consequence is that a route parameter will capture any value at the specific URL segment. For example, `/users/:id` will intercept `/users/search`. The more specific "search" route should be declared first. You can always reorder routes by dragging and dropping them. - -### Route patterns - -Routes support certain patterns. Here are some examples of the available ones: - -- `/ab?cd` will match `/acd` and `/abcd`. -- `/ab+cd` will match `abcd`, `abbcd`, `abbbcd`, and so on. - -![route pattern{956x74}](docs-img:route-patterns.png) - -For a complete overview of the patterns available, please refer to Express' [route paths documentation](https://expressjs.com/en/guide/routing.html#route-paths). - -### Route parameters - -Route parameters can be defined in routes by using a colon `:`. The name of a parameter can only contains the following characters `A-Za-z0-9_`. - -![route parameter{956x74}](docs-img:route-params.png) - -For a complete overview on how to use and declare route parameters, please refer to Express' [route parameters documentation](https://expressjs.com/en/guide/routing.html#route-parameters). - -You can also retrieve the route parameters by using the `{{urlParam 'paramName'}}` [templating helper](docs:templating/mockoon-request-helpers#urlparam). - -> To use a colon `:` in your route path as a normal character, you can escape it by either using double backslashes `\\` or square brackets `[]`: -> `/part1[:]part2` > `/part1\\:part2` - -### Query parameters - -Routes **must** be declared without query parameters as they are not part of the route path. They can only be added to the request when calling an endpoint. - -Query parameters can be retrieved by using the `{{queryParam 'paramName'}}` [templating helper](docs:templating/mockoon-request-helpers#queryparam). - -#### Query parameters arrays and objects - -Mockoon is using [qs](https://www.npmjs.com/package/qs) to parse the query string in a object usable in our templating or rules systems. It supports both arrays and objects. -To pass arrays and objects in the query string of a request, you must use the following syntax: - -- for objects: `?param1=test&obj[prop1]=value`. -- for arrays: `?param1=test&array[]=value1&array[]=value2` or `?param1=test&array[0]=value1&array[1]=value2` or `?param1=test&array=value1,value2`. diff --git a/content/docs/v4.0.0/cors.md b/content/docs/v4.0.0/cors.md deleted file mode 100644 index 860c5129..00000000 --- a/content/docs/v4.0.0/cors.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: CORS -meta: - title: Automatic handling of CORS preflight OPTIONS requests - description: Front-end application and your JSON mock API are not on the same domain? Handle preflight OPTIONS requests automatically with Mockoon -order: 110 ---- - -# CORS - ---- - -## Automatic handling of CORS preflight requests - -When creating mock APIs, chances are the front-end application and the mocked API won’t be on the **same domain**, thus triggering browsers OPTIONS [preflight requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS). - -For your application to work, you can make Mockoon automatically answer to these OPTIONS requests: - -Open the **Environment Settings** by clicking on the tab at the top of the window: - -![click on the settings tab{1034x160}](docs-img:open-environment-settings.png) - -Enable the **Automatically handle OPTIONS pre-flight requests ** by ticking the checkbox: - -![tick the CORS checkbox{1061x537}](docs-img:enable-cors.png) - -You need to restart the environment for the change to take effect. - -Mockoon will now automatically answer with a 200 HTTP status code to all preflight OPTIONS requests. The following headers will also be added to the response: - -```http -Access-Control-Allow-Origin: * -Access-Control-Allow-Methods: GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS -Access-Control-Allow-Headers: Content-Type, Origin, Accept,Authorization,Content-Length, X-Requested-With -``` - -Please note that Mockoon won’t send any CORS header on routes with the OPTIONS method (i.e. `OPTIONS /my-route`). - -## Add CORS headers to the environment headers - -You can also add the same CORS headers to all routes of a mock API with one click. - -Open the **Environment Headers** by clicking on the tab at the top of the window: - -![click on the headers tab{1264x160}](docs-img:open-environment-headers.png) - -Then, click on the **Add CORS headers** link: - -![Click on the add CORS headers link{1264x137}](docs-img:add-cors-headers.png) - -The above headers will be automatically added to your list of headers: - -![view cors headers in the list{1264x233}](docs-img:view-cors-headers.png) diff --git a/content/docs/v4.0.0/data-buckets/overview.md b/content/docs/v4.0.0/data-buckets/overview.md deleted file mode 100644 index 9f67fa6c..00000000 --- a/content/docs/v4.0.0/data-buckets/overview.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: Overview -meta: - title: Data buckets overview - description: Learn what are Mockoon's data buckets, how they work, what type of content is supported and how to create one -order: 950 ---- - -# Data buckets overview - ---- - -## What are data buckets? - -In Mockoon, a data bucket is a **key value store** where you can create reusable content or data for your routes. - -The data buckets are defined at the **environment level** and are **generated when the server starts**. It means that their state **persists between each call** ([see below](#data-buckets-generation)). - -## Create a data bucket - -To create a new data bucket, open the **Data** options by clicking on the tab at the top of the window: - -![Open data bucket view{742x160}](docs-img:open-data-view.png) - -Add a new data bucket by clicking on the "plus" button: - -![Add a data bucket{1264x578}](docs-img:add-data-bucket.png) - -You can change the data bucket title and content on the right part of the screen. -Mockoon will automatically attribute a new **unique ID** to your data bucket. You can use this ID to reference the data using the [`data` helpers](docs:data-buckets/using-data-buckets#using-data-helpers). To retrieve a bucket's unique ID, look in the footer under the data bucket content or right-click on a bucket name in the list and click on "Copy ID to clipboard". - -## Content of a data bucket - -Data buckets can contain any text content. They also support all of Mockoon's [templating helpers](docs:templating/overview) including the [`data` and `dataRaw` helpers](docs:data-buckets/using-data-buckets#using-data-helpers). - -Mockoon will always try to parse the data bucket's content from JSON to allow you to reference only part of it using the `data` helpers and an object path. - -## Combining data buckets - -You can easily combine your data bucket contents by referencing other data buckets using the `dataRaw` helper: - -```json -//data bucket content -{ - "data": { - "id": "{{ dataRaw 'other-data-bucket-content' }}" - } -} -``` - -> ⚠️ However, data buckets are generated in the order they are defined in the environment. As a consequence, you cannot reference a data bucket that is defined **after** the current one. - -## Data buckets generation - -Data buckets are generated when the server starts in the order they are defined in the environment. Their state persist during all mock API calls. To regenerate a data bucket's content, restart the mock server. - -If a data bucket contains [request helpers](docs:templating/mockoon-request-helpers), Mockoon will generate the bucket content only after the first call made to a route using this data bucket (by referencing it directly or using a data helper). It allows you to create bucket "configuration" routes that you can call programmatically with the content you want to reuse in your bucket using the request helpers (`body`, `queryParams`, etc.). diff --git a/content/docs/v4.0.0/data-buckets/using-data-buckets.md b/content/docs/v4.0.0/data-buckets/using-data-buckets.md deleted file mode 100644 index b5a700b8..00000000 --- a/content/docs/v4.0.0/data-buckets/using-data-buckets.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: Using data buckets -meta: - title: Using data buckets - description: Learn how to use Mockoon's data buckets, using the two data and dataRaw helpers, or by directly linking the bucket to a route response -order: 951 ---- - -# Using data buckets - ---- - -After [creating data buckets](docs:data-buckets/overview), you can use them through the `data` templating helpers or by directly referencing them in a route response. - -## Using data helpers - -Two helpers are available: [`data`](docs:templating/mockoon-helpers#data) and [`dataRaw`](docs:templating/mockoon-helpers#dataraw). They work in a similar way to the [`body`](docs:templating/mockoon-request-helpers#body) and [`bodyRaw`](docs:templating/mockoon-request-helpers#bodyraw) helpers. - -They can be used [anywhere templating helpers are supported](docs:templating/overview): body editor, files, headers keys and values, etc., and allow you to partially reuse your data bucket content and compose dynamic responses body easily. - -Both helpers support retrieving the data bucket by its unique ID or name. It also allows you to retrieve only part of the data bucket using an optional object path: - -```handlebars -{{data 'ID_or_name' 'object.path'}} -``` - -> Retrieving data at a specific object path requires that the data bucket content is a valid JSON. - -Head over to the [data helpers' documentation](docs:templating/mockoon-helpers#data) to see more examples. - -## Referencing in a route response - -A data buckets can also be directly linked to a route response. Linking a data bucket will serve the generated data bucket content "as-is". - -To link a data bucket to a route response, choose "Data" in the body selector and select your data bucket. - -![Using data bucket in a route response{1002x464}](docs-img:link-data-bucket-response.png) diff --git a/content/docs/v4.0.0/listening-hostname.md b/content/docs/v4.0.0/listening-hostname.md deleted file mode 100644 index c071e7b9..00000000 --- a/content/docs/v4.0.0/listening-hostname.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: Listening hostname/adapter -meta: - title: Listening hostname or adapter - description: Learn how you can customize the hostname or network adapter your mock API will listen to in the desktop application or the CLI -order: 120 ---- - -# Listening hostname/adapter - ---- - -By default, Mockoon's mock APIs will listen to all available network adapters on IPv4 and IPv6, often described as `0.0.0.0` and `::`. Your mock server will be available on all your adapters, such as `localhost`, `127.0.0.1`, your local IPv4 address(es) `192.168.x.x`, `::1`, etc. - -To configure each environment to listen on a specific hostname, open the **Environment Settings** by clicking on the tab at the top of the window: - -![click on the settings tab{1034x160}](docs-img:open-environment-settings.png) - -Add a **custom hostname** in the input field: - -![field to set a custom hostname{1264x213}](docs-img:custom-hostname-setting.png) - -> You may need to restart your environment for the change to take effect. - -> When using the CLI, you can choose a specific adapter to listen to (e.g. `192.168.1.1`) by using the `--hostname` flag with the [`start` command](https://github.com/mockoon/mockoon/tree/main/packages/cli#mockoon-cli-start). diff --git a/content/docs/v4.0.0/mockoon-data-files/import-export-mockoon-format.md b/content/docs/v4.0.0/mockoon-data-files/import-export-mockoon-format.md deleted file mode 100644 index 8fd89a82..00000000 --- a/content/docs/v4.0.0/mockoon-data-files/import-export-mockoon-format.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: Legacy export files -meta: - title: Legacy export files - description: Learn how to run your mock API server using deprecated legacy Mockoon export files, both supported by the desktop application and the CLI -order: 1140 ---- - -# Legacy export files - ---- - -## Pre v1.16.0 export format - -Before [v1.16.0](https://github.com/mockoon/mockoon/releases/tag/v1.16.0), exporting data in Mockoon's format was necessary to share your mocks with other users and to run them with the [CLI](/cli/). Since this update, both the desktop application and the CLI can use or load Mockoon's environments files directly without exporting them ([Learn more](docs:mockoon-data-files/sharing-mock-api-files)). - -Export files looked like regular environment files, wrapped in Mockoon's specific format: - -```json -{ - "source": "mockoon:1.17.0", - "data": [ - { - "type": "environment", - "item": { - "uuid": "", - "lastMigration": 19, - "name": "Exported environment", - ... - } - } - ] -} -``` - -## v1.18.0 deprecation - -In [v1.18.0](https://github.com/mockoon/mockoon/releases/tag/v1.18.0), the options to import/export in Mockoon's format have been removed from the application. You won't be able to export your environments in this format anymore. - -However, both the CLI and the desktop application can load these legacy export files. - -When opening an old export file, Mockoon will ask for confirmation before opening it. Upon confirmation, the export file will be migrated to the new format automatically: - -![prompt before opening legacy export file{560x276}](docs-img:legacy-export-file-open-prompt.png) diff --git a/content/docs/v4.0.0/mockoon-data-files/sharing-mock-api-files.md b/content/docs/v4.0.0/mockoon-data-files/sharing-mock-api-files.md deleted file mode 100644 index 171e381a..00000000 --- a/content/docs/v4.0.0/mockoon-data-files/sharing-mock-api-files.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: Sharing your mock API files -meta: - title: Sharing your mock API files - description: Learn how to easily share your mock API files with other mockoon users, or use them with the CLI, and setup a git repository -order: 1110 ---- - -# Sharing your mock API files - ---- - -> 🆕 Be among the first to experience our new cloud offering with **data synchronization** capabilities by [signing up for our waiting list](/pro/). - -### Sharing a mock API - -Each file can be easily shared with other Mockoon's users, "as-is". Since [v1.16.0](https://github.com/mockoon/mockoon/releases/tag/v1.16.0), there is no need to export in Mockoon's format on one computer and re-import on another one (see [legacy export file](docs:mockoon-data-files/import-export-mockoon-format)). -After [locating your environment file](docs:mockoon-data-files/data-storage-location#locating-the-files), you can share it with your coworkers by using Git for example. You coworkers can then save the file in any folder and open it directly using the "Open environment" button: - -![open an environment{449x235}](docs-img:open-environment.png) - -### Use a Git-tracked folder - -You can save your environment data files in a Git-tracked folder to make sharing easier. By default, an environment file JSON content is saved pretty-printed to allow comparing changes between two commits. -You can disable pretty printing in the settings: - -![disable pretty printing{860x812}](docs-img:storage-pretty-printing.png) - -### Use a mock API with the CLI - -The CLI is directly [compatible with environment files](https://github.com/mockoon/cli#use-your-mocks-in-the-cli). After locating your environment file, you run them with the CLI using the following command: `mockoon-cli start -d ./path-to-file/environment-data-file.json`. diff --git a/content/docs/v4.0.0/proxy-mode.md b/content/docs/v4.0.0/proxy-mode.md deleted file mode 100644 index 29c41f58..00000000 --- a/content/docs/v4.0.0/proxy-mode.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: Partial mocking with proxy mode -meta: - title: Partial API mocking with proxy mode - description: Learn how to create a mock REST API to intercept traffic and proxy requests to another JSON REST server with Mockoon -order: 80 ---- - -# Proxy mode - ---- - -## Partially mock APIs using the proxy mode - -Mockoon supports partial mocking of an API endpoints by forwarding the requests that does not match a declared route to the URL of your choice. - -To activate the proxy mode, open the **Environment Proxy** options by clicking on the tab at the top of the window: - -![click on proxy tab{887x160}](docs-img:open-proxy-options.png) - -Enable the proxy mode by checking the box and enter the server URL to which you want to forward the calls. A small shield icon should appear on the right of your environment name indicating that the proxy mode has been enabled: - -![tick the Proxy checkbox{1264x274}](docs-img:enable-proxy.png) - -From now on, all routes that have been defined in Mockoon will be intercepted, and any other request not matching any route path will be forwarded to the server URL you entered in the proxy mode setting. - -## Disable API prefix forwarding - -By default, the API prefix will be part of the path called on the proxied API. You can disable this behavior by ticking the "Remove prefix" checkbox: - -![tick the Proxy no prefix forward checkbox{699x306}](docs-img:proxy-no-forward.png) - -## Proxy headers - -Proxy specific headers can also be added, both to the forwarded request and the response received from the target API. - -![add proxy headers by filling the keys and values{1264x360}](docs-img:proxy-headers.png) - -> **Proxy request headers** will be automatically added to the request sent to the proxied server, while **proxy response headers** are added to the response received from the proxied server. diff --git a/content/docs/v4.0.0/response-body/file-serving.md b/content/docs/v4.0.0/response-body/file-serving.md deleted file mode 100644 index d081e993..00000000 --- a/content/docs/v4.0.0/response-body/file-serving.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: File serving -meta: - title: Mockoon file serving documentation - description: Serve files as body for your mock API, use the templating system and set relative or absolute paths for easier sharing. -order: 810 ---- - -# File serving - ---- - -Besides using the body editor, Mockoon allows you to serve different files for each route. File serving should be the preferred method when you want to send lots of data. - -## Using files - -To serve a file, you must provide a path in the file input field: - -![fill the file input field{987x354}](docs-img:file-path.png) - -> When a file path is provided, the body editor content will be ignored. - -## Absolute or relative paths - -You can either provide an absolute path like `/home/username/file.json` or a relative path. Starting with [v1.16.0](https://github.com/mockoon/mockoon/releases/tag/v1.16.0), relative paths are resolved from the environment's file location. You can check the environment's file location by right-clicking on an environment en select "Show in folder" in the contextual menu: - -![show in folder menu entry{455x312}](docs-img:environment-show-in-folder.png) - -> Prior to v1.16.0, relative file paths were resolved from the application executable. This is also supported by the CLI since its version [1.2.0](https://github.com/mockoon/cli/releases/tag/v1.2.0). - -## Templating - -[Templating](docs:templating/overview) is available in both the file content and the file input field. - -### File content templating - -As for the body editor, templating will be parsed inside files for a limited set of MIME types (`application/json`, `text/html`, `text/css`, `text/csv`, `application/javascript`, `application/typescript`, `text/plain`, `application/xhtml+xml`, `application/xml`). You can use all the available templating helpers to generate dynamic mock data. - -Templating can be disabled both for the body editor and the file content. Please refer to the [templating documentation](docs:templating/overview#disable-body-and-file-templating) for more information. - -> **⚡ A note on performances** -> -> Parsing the templating helpers inside big files can be a very intensive task (CPU and memory intensive). All the files in different formats than the one mentioned above will be streamed to improve performances. -> If you need to send big files in one of the above formats but don't need to parse the templating, you can disable it in the route response settings. It will stream the file instead of parsing it and improve the performance. -> ![disable templating in route response{1066x181}](docs-img:route-response-disable-templating.png) - -### File input templating - -Templating is also supported directly in the **file input field**. It allows to dynamically generate the file path using helpers. Please refer to the [templating documentation](docs:templating/overview#file-input-templating) for more information. - -## 404 fallback - -By default, Mockoon will return an error in the body when a file is not found. It will still keep the status code you set up on your route response. You can instead choose to automatically return a 404 by activating an option in the route response settings: - -![tick the 404 fallback checkbox{1066x231}](docs-img:enable-404-fallback.png) - -This option will also fall back to use the content present in the body editor. diff --git a/content/docs/v4.0.0/response-body/overview.md b/content/docs/v4.0.0/response-body/overview.md deleted file mode 100644 index 04cb3bd6..00000000 --- a/content/docs/v4.0.0/response-body/overview.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: Overview -meta: - title: Response body overview - description: Learn how to serve different type of bodies with Mockoon, how to use files or databucket to serve realistic dynamic responses -order: 800 ---- - -# Response body overview - ---- - -Each [route response](docs:route-responses/multiple-responses) can serve a different body content. You have three possibilities to add a body content to your response: the inline body editor, an external file, or the content of a data bucket. - -You can choose each option using the body selector: - -![body type toggle buttons{1264x541}](docs-img:body-type-toggle.png) - -## Body editor (inline) - -You can use the body editor to directly create your response content. It supports all the [templating helpers](docs:templating/overview). - -![inline body editor{1021x806}](docs-img:inline-body-editor.png) - -> Mockoon will save the content of the inline body editor directly in your [data file](docs:mockoon-data-files/data-storage-location). -> Using an external file could improve the performance for large content. - -## External file - -You can also choose to serve an external file, using the second option: - -![external file linking input{1021x806}](docs-img:body-file-serving.png) - -Please refer to the [file serving documentation](docs:response-body/file-serving) for more information. - -## Data bucket - -You can finally choose to serve the content of a data bucket using the third option: - -![data bucket linking select menu{1021x806}](docs-img:body-data-bucket.png) - -Please refer to the [data bucket documentation](docs:data-buckets/overview) for more information. diff --git a/content/docs/v4.0.0/route-responses/dynamic-rules.md b/content/docs/v4.0.0/route-responses/dynamic-rules.md deleted file mode 100644 index da645fb8..00000000 --- a/content/docs/v4.0.0/route-responses/dynamic-rules.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: Responses rules -meta: - title: Server different responses based on rules - description: Learn how to define multiple route responses for each route and triggered them with rules based on the entering request parameters. -order: 910 ---- - -# Adding response rules - ---- - -After creating [multiple responses](docs:route-responses/multiple-responses) for each route, you can create more complex scenarios and serve the responses depending on the fulfillment of rules. - -## Defining rules - -You can define an unlimited number of rules for each route. At each request, Mockoon will assert each response's rules and serve the response which contains the first matching rule(s). The rules are interpreted in the order they are declared: `[rule OR|AND rule] OR [rule OR|AND rule]`, the brackets symbolizing each route response. - -![Rules interpretation order{455x395}](/images/docs/shared/dynamic-rules-schema.png) - -To add a new rule to a response, go to the route response's **Rules tab**, click on "Add rule" and fill the fields: - -![Click on add and fill the fields{987x311}](docs-img:add-route-response-rule.png) - -### Reordering rules - -By default, rules are interpreted in the order you added them. You can change their interpretation order by drag and dropping them: - -![Drag and drop rules to reorder them{977x323}](docs-img:route-response-rule-reorder.png) - -### Disabling rules - -You can temporarily disable the rules and serve the default response only. To activate this option, click on the "rules" icon next to the response list: - -![Disable rules{979x244}](docs-img:disable-rules.png) - -> When this option is active, the default response will be always served and all the rules defined on this route will be ignored. Also, this option cannot be selected in addition to the random or sequential responses. - -### Rules logical operator - -Inside a route response, rules are interpreted by default with the OR logical operator. When you have more than one rule in a route response, you can easily switch the operator applied when interpreting the rules, by clicking on the `OR|AND` buttons at the left of the rules: - -![Choose the rule operator OR AND{982x221}](docs-img:route-response-rules-operator.png) - -Rules have four parts: - -- a **target** -- a **property name or path** -- an **invert operator** toggle -- a comparison **operator** -- a **value** - -### 1. Target - -![Rule target{1007x211}](docs-img:route-response-rules-target.png) - -In the dropdown menu you can choose between: - -- the **body** value (full raw content or one of its properties if request's `Content-Type` is either `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`, `application/xml`, `application/soap+xml` or `text/xml`). -- the value of a **header**. -- the value of a **cookie**. -- the value of a **route parameter**. -- the value of a **query string field**. -- the **request number** index starting at 1. - -### 2. Property name or path - -![Rule property{1007x211}](docs-img:route-response-rules-property.png) - -Depending on the **target**, the way to access properties may be different: - -- **body**: - - keep empty to match against the full raw body content. - - use a path to access one of its properties. The syntax is based on the [object-path library](https://www.npmjs.com/package/object-path) like `users.0.name`. This is compatible with request's bodies of `Content-Type` `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`, `application/xml`, `application/soap+xml` or `text/xml`. Properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. - _Please note that XML bodies are parsed using [xml-js](https://www.npmjs.com/package/xml-js) package. Refer to this [page](docs:xml-support) or the package documentation for more information on how the XML is parsed and how to fetch specific properties._ - _Please also note that `multipart/form-data` only supports fields. Uploaded files will be ignored._ -- **headers**: a header name like `Accept` or `Content-Type`. -- **cookies**: the cookie name like `Session-id`. -- **route param**: a route param name without the colon (":"), `:userId` becoming `userId`. -- **query string**: either provide a property name like `filter` or a path if the query string field is an object `filter.primary`. -- **request number**: _nothing has to be provided here for the request number_. - -For body and query string, if the property is an array, Mockoon will automatically check in the array if at least one item matches the value. - -### 3. Invert operator - -You can invert the **comparison operator** (**!** equals, **!** regex match, etc.) by toggling on the exclamation mark button: - -![Rule comparison operator{1007x211}](docs-img:route-response-rules-invert-operator.png) - -### 4. Comparison operator - -![Rule comparison operator{1007x211}](docs-img:route-response-rules-comparison-operator.png) - -Multiple comparison operators are available in each rule: - -- **equals**: asserts that the targeted property is equal to the **value**. -- **regex match**: asserts that the targeted property matches the regex **value**. -- **null**: asserts that the targeted property is null or absent (for **headers** or **cookies**). -- **empty array**: asserts that the targeted property is an empty array. - -### 5. Value - -![Rule value{1007x211}](docs-img:route-response-rules-value.png) - -Depending on the comparison operator chosen, **equals** or **regex match**, you can either set a simple text value like "expected value" or any kind of regex. To use a regex, you must write it without the leading and trailing slashes. - -Regex examples: -`primary|secondary`, `^user1-9`, `UTF-.*`. -You can also test for empty values with the following regex: `^$|\s+`. - -The **request number** supports simple entries like `1` or `2` but also regexes, allowing you to return a different response for the first 3 calls `^[1-3]$` or failing on odd request indexes `[13579]$`. diff --git a/content/docs/v4.0.0/route-responses/multiple-responses.md b/content/docs/v4.0.0/route-responses/multiple-responses.md deleted file mode 100644 index e90d5b0e..00000000 --- a/content/docs/v4.0.0/route-responses/multiple-responses.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: Multiple route responses -meta: - title: Define multiple responses for each route - description: Multiple responses can be defined for each route with different body, headers and status. Learn how to create them and randomize them. -order: 900 ---- - -# Multiple responses - ---- - -For each route, multiple responses can be defined (status, body, and headers) and [triggered using a set of rules](docs:route-responses/dynamic-rules). There is always at least one response when you create a new route. You can modify it and add more responses but you can never delete the last route response. - -## Adding or duplicating a response - -To **add** a new response to your route, click on the "plus" icon next to the responses list: - -![Click on the icon to add a new response{987x164}](docs-img:add-route-response.png) - -You can also **duplicate** an existing route response by clicking on the "copy" icon on the right: - -![Click on the copy icon to duplicate a response{985x195}](docs-img:duplicate-route-response.png) - -Everything will be copied to the new response: documentation, file/body, headers and rules. - -## Route responses precedence - -Route responses order define the order in which the [rules are interpreted](docs:route-responses/dynamic-rules). You can easily change the default response by reordering the responses menu with a drag and drop: - -![Reorder route responses{968x221}](docs-img:reorder-responses.png) - -## Default route response - -Without rules or when a request does not match the one you defined, the default response will always be the one marked with the blue flag. You can easily change the default response by clicking on the grey flags in the menu: - -![Define a new default route response{1002x216}](docs-img:change-route-responses-default.png) - -## Random route response - -Mockoon can serve the route responses randomly (200, 500, 404) to simulate an unpredictable behavior. - -To activate this option, click on the "shuffle" icon next to the response list: - -![Random route responses{1001x174}](docs-img:random-route-responses.png) - -> When this option is active, the default response and all the rules defined on this route will be ignored. Also, this option cannot be selected in addition to the sequential responses option below. - -## Sequential route response - -Mockoon can serve the route responses sequentially (200 → 500 → 404). Mockoon will serve all the responses one after the other and restart at the beginning. The sequence is reset when restarting the server. - -To activate this option, click on the "repeat" icon next to the response list: - -![Sequential route responses{990x174}](docs-img:sequential-route-responses.png) - -> When this option is active, the default response and all the rules defined on this route will be ignored. Also, this option cannot be selected in addition to the random responses option above. diff --git a/content/docs/v4.0.0/templating/fakerjs-helpers.md b/content/docs/v4.0.0/templating/fakerjs-helpers.md deleted file mode 100644 index 84f50c60..00000000 --- a/content/docs/v4.0.0/templating/fakerjs-helpers.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: Faker.js helpers -meta: - title: Create dynamic responses with templating Faker.js helpers - description: Create realistic mock data for your mock API servers with Mockoon's templating system including Faker.js -order: 1040 ---- - -# Faker.js helpers - ---- - -Mockoon implements [Faker.js v7.6.0](https://fakerjs.dev/) library by wrapping most of the available helpers. -Faker.js offers lots of helpers: `address.zipCode`, `address.city`, `address.cityPrefix`, `name.firstName`, `name.lastName`, `datatype.number`, `datatype.float`, `internet.avatar`, `internet.email`, etc. Please have a look at [Faker.js documentation](https://fakerjs.dev/) to learn how to use them. - -## Usage - -All Faker.js helpers must be used with the following syntax: `{{faker 'namespace.method'}}`. -**Examples:** - -```js -{{faker 'address.zipCode'}} -{{faker 'address.city'}} -{{faker 'address.cityPrefix'}} -{{faker 'name.firstName'}} -... -``` - -Faker.js methods may use two different ways of passing parameters: ordered arguments or options objects. Wrapped in Handlebars helpers, this may result in two different ways of using them: - -```js -// named parameters -{{faker 'datatype.number' min=0 max=25}} - -// ordered arguments (here count=25) -{{faker 'random.alphaNumeric' 25}} -``` - -## Set Faker.js' locale and seed - -Faker.js locale and seed can be defined in the settings: - -![fakerjs settings{860x812}](docs-img:settings-faker.png) - -> 📝**A note on Faker.js seeding** -> By providing a seed value, you can generate repeatable **sequences** of fake data. Using seeding will not always generate the same value but rather a predictable sequence. diff --git a/content/docs/v4.0.0/templating/mockoon-helpers.md b/content/docs/v4.0.0/templating/mockoon-helpers.md deleted file mode 100644 index 818d3525..00000000 --- a/content/docs/v4.0.0/templating/mockoon-helpers.md +++ /dev/null @@ -1,1183 +0,0 @@ ---- -title: Helpers -meta: - title: Create dynamic responses with templating helpers - description: "Create dynamic fake data for your mock server with Mockoon's templating helpers. All formats are supported: JSON, CSV, HTML, etc." -order: 1010 ---- - -# Mockoon templating helpers - ---- - -In addition to Handlebars' built-in helpers, Mockoon offers the following helpers: - -| Block helpers | Data buckets | Arrays | -| ------------------- | --------------------- | ------------------- | -| [`repeat`](#repeat) | [`data`](#data) | [`array`](#array) | -| [`switch`](#switch) | [`dataRaw`](#dataraw) | [`oneOf`](#oneof) | -| | | [`someOf`](#someof) | -| | | [`join`](#join) | -| | | [`slice`](#slice) | -| | | [`len`](#len) | -| | | | - -| Math | | Variables | -| ----------------------- | --------------------- | ------------------- | -| [`add`](#add) | [`eq`](#eq) | [`setVar`](#setvar) | -| [`subtract`](#subtract) | [`gt`](#gt) | [`getVar`](#getvar) | -| [`multiply`](#multiply) | [`gte`](#gte) | | -| [`divide`](#divide) | [`lt`](#lt) | | -| [`modulo`](#modulo) | [`lte`](#lte) | | -| [`ceil`](#ceil) | [`toFixed`](#tofixed) | | -| [`floor`](#floor) | [`round`](#round) | | - -| Strings | | Dates | Misc | -| ------------------------- | ----------------------- | --------------------------------- | ------------------------------- | -| [`includes`](#includes) | [`concat`](#concat) | [`now`](#now) | [`newline`](#newline) | -| [`substr`](#substr) | [`indexOf`](#indexof) | [`dateTimeShift`](#datetimeshift) | [`base64`](#base64) | -| [`lowercase`](#lowercase) | [`parseInt`](#parseint) | [`date`](#date) | [`base64Decode`](#base64decode) | -| [`uppercase`](#uppercase) | [`padStart`](#padstart) | [`time`](#time) | [`objectId`](#objectid) | -| [`split`](#split) | [`padEnd`](#padend) | [`dateFormat`](#dateformat) | | -| [`stringify`](#stringify) | | | | - -| [Faker.js](docs:templating/fakerjs-helpers) aliases | | | -| --------------------------------------------------- | ----------------------------- | ----------------------- | -| [`int`](#int) | [`street`](#street) | [`hexColor`](#hexcolor) | -| [`float`](#float) | [`city`](#city) | [`guid`](#guid) | -| [`boolean`](#boolean) | [`country`](#country) | [`ipv4`](#ipv4) | -| [`title`](#title) | [`countryCode`](#countrycode) | [`ipv6`](#ipv6) | -| [`firstName`](#firstname) | [`zipcode`](#zipcode) | [`lorem`](#lorem) | -| [`lastName`](#lastname) | [`postcode`](#postcode) | | -| [`company`](#company) | [`lat`](#lat) | | -| [`domain`](#domain) | [`long`](#long) | | -| [`tld`](#tld) | [`phone`](#phone) | | -| [`email`](#email) | [`color`](#color) | | - -## `repeat` - -Repeat the block content a random number of times if two arguments are provided, or a fixed amount of time if only one argument is provided. Set the `comma` parameter to `false` (default to `true`) to prevent the insertion of new lines and commas by the helper. - -| Parameters/arguments | Type | Description | -| -------------------- | ------- | ------------------ | -| [0] | number | Minimum items | -| 1 | number | Maximum items | -| [comma=true] | boolean | Add trailing comma | - -**Examples** - -```handlebars -{{#repeat 5 10 comma=true}}test{{/repeat}} - - -``` - -## `switch` - -Select some content depending on a variable. Behaves like a regular switch. - -| Arguments (ordered) | Type | Description | -| ------------------- | ---- | ------------------------------------------------ | -| 0 | any | Value against which the switch matches the cases | - -**Examples** - -```handlebars -{{#switch (urlParam 'id')}} - {{#case '1'}}"John"{{/case}} - {{#case '2'}}"Jack"{{/case}} - {{#default}}"Peter"{{/default}} -{{/switch}} -``` - -## `data` - -Get the **stringified** value at a given `path` from a [data bucket](docs:data-buckets/overview) selected by **ID or name**. This helper is designed to retrieve data to be served in a response. To reuse the retrieved data with other helpers (`each`, `if`, etc.), use the [`dataRaw` helper](#dataraw) below. - -- The `path` takes the following form `key.0.key.5.key` and is based on the [**object-path** library](https://www.npmjs.com/package/object-path). Properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. - Please note that a value can be retrieved at the path if the data bucket contains valid JSON. -- Full objects or arrays can be retrieved by the helper and will be stringified. -- The full data bucket content can be fetched when the `path` is omitted (`{{data 'ID'}}`). - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | -------------------------------- | -| 0 | string | ID or name of the daa bucket | -| 1 | string | Path to the data bucket property | - -**Examples** - -```handlebars -{{data 'abcd'}} -{{data 'abcd' 'path.to.property'}} -{{data 'abcd' 'deep.property\.with\.dot'}} -``` - -## `dataRaw` - -Get the **raw** value (array, object, etc.) at a given `path` from a [data bucket](docs:data-buckets/overview) selected by **ID or name**. This "raw" helper is designed to work with other helpers (`each`, `if`, etc.). To directly use the retrieved data in the response, use [data buckets direct linking](docs:data-buckets/using-data-buckets#referencing-in-a-route-response) or the [`data` helper](#data) above. - -- The `path` takes the following form `key.0.key.5.key` and is based on the [**object-path** library](https://www.npmjs.com/package/object-path). Properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. - Please note that a value can be retrieved at the path if the data bucket contains valid JSON. -- Primitives and data structures can be retrieved by the helper and reused in other helpers (see example below). -- The full data bucket content (array, object, etc.) can be fetched when the `path` is omitted (`{{dataRaw 'ID'}}`). - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | -------------------------------- | -| 0 | string | ID or name of the daa bucket | -| 1 | string | Path to the data bucket property | - -**Examples** - -```handlebars -{{dataRaw 'abcd'}} -{{dataRaw 'abcd' 'path.to.property'}} -{{dataRaw 'abcd' 'deep.property\.with\.dot'}} - -{{#each (dataRaw 'path.to.array.property')}} - value -{{/each}} - -{{#if (dataRaw 'path.to.boolean.property')}} - value -{{/if}} -``` - -## `array` - -Create an array from the given items. This helper is mostly used with the following helpers: `oneOf`, `someOf`. - -| Arguments (ordered) | Type | Description | -| ------------------- | ---- | -------------------------------- | -| 0..n | any | Value used to populate the array | - -**Examples** - -```handlebars -{{array 'item1' 'item2' 'item3'}} -``` - -## `oneOf` - -Select a random item in the array passed in parameters. `oneOf` will return the actual value in the array. Set the `stringify` parameter to `true` (default to `false`) to get a JSON stringified result. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------- | -------------------- | -| 0 | any[] | Array of values | -| [1 = false] | boolean | Stringify the result | - -**Examples** - -```handlebars -{{oneOf (array 'item1' 'item2' 'item3')}} -result: item2 -``` - -## `someOf` - -Return a random number of items from the array passed in parameters, concatenated as a string. Use it with triple curly braces to get a JSON representation. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------- | ----------------------- | -| 0 | any[] | Array of values | -| 1 | number | Minimum number of items | -| 2 | number | Maximum number of items | -| [3 = false] | boolean | Get result as an array | - -**Examples** - -```handlebars -{{someOf (array 'item1' 'item2' 'item3') 1 2}} -result: item1,item2 - - -{{{someOf (array 'item1' 'item2' 'item3') x y true}}} -result: item1,item2 -``` - -## `join` - -Return a new string by concatenating all the elements in an array. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | --------------- | -| 0 | [] | Array of values | -| 1 | string | Separator | - -**Examples** - -```handlebars -{{join (array 'item1' 'item2' 'item3') '#'}} -result: item1#item2#item3 -``` - -## `slice` - -Return a copy of a portion of an array from start to end indexes (not included). - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | --------------- | -| 0 | [] | Array of values | -| 1 | number | Start index | -| 2 | number | End index | - -**Examples** - -```handlebars -{{slice (array 'item1' 'item2' 'item3') 0 2}} -result: ['item1', 'item2'] -``` - -## `len` - -Return an array or string length. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------------ | --------------- | -| 0 | [] \| string | Array or string | - -**Examples** - -```handlebars -{{len (array 'item1' 'item2' 'item3')}} -result: 3 - -{{len 'hello'}} -result: 5 -``` - -## `add` - -Add the numbers passed as parameters to each others. Unrecognized strings passed as arguments will be ignored. - -| Arguments (ordered) | Type | Description | -| ------------------- | ----- | -------------------------------------------------------- | -| 0..n | any[] | Value of the operandes (can process numbers and strings) | - -**Examples** - -```handlebars -{{add 1 1}} -result: '2' - -{{add '1' '1'}} -result: '2' - -{{add '1' 'foo' 1}} -result: '2' -``` - -## `subtract` - -Subtract the numbers passed as parameters to the first parameter. Unrecognized strings passed as arguments will be ignored. - -| Arguments (ordered) | Type | Description | -| ------------------- | ----- | -------------------------------------------------------- | -| 0..n | any[] | Value of the operandes (can process numbers and strings) | - -**Examples** - -```handlebars -{{subtract 2 1}} -result: '1' - -{{subtract '2' '1'}} -result: '1' - -{{subtract '2' 'foo' 1}} -result: '1' -``` - -## `multiply` - -Multiply the numbers passed as parameters to each others. Unrecognized strings passed as arguments will be ignored. -| Arguments (ordered) | Type | Description | -| ------------------- | ----- | -------------------------------------------------------- | -| 0..n | any[] | Value of the operandes (can process numbers and strings) | - -**Examples** - -```handlebars -{{multiply 2 3}} -result: '6' - -{{multiply '2' '3'}} -result: '6' - -{{multiply '2' 'foo' 3}} -result: '6' -``` - -## `divide` - -Divide the first parameter by the other numbers passed as parameters. Unrecognized strings passed as arguments will be ignored. - -| Arguments (ordered) | Type | Description | -| ------------------- | ----- | -------------------------------------------------------- | -| 0..n | any[] | Value of the operandes (can process numbers and strings) | - -**Examples** - -```handlebars -{{divide 4 2}} -result: '2' - -{{divide '4' '2'}} -result: '2' - -{{divide '4' 'foo' 2}} -result: '2' -``` - -## `modulo` - -Compute the modulo of the first parameter by the second. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ---------------------------------------------- | -| 0 | number | First value (can process numbers and strings) | -| 1 | number | Second value (can process numbers and strings) | - -**Examples** - -```handlebars -{{modulo 5 4}} -result: '1' - -{{modulo '5' '4'}} -result: '1' - -{{modulo '5' 'foo' 4}} -result: '1' -``` - -## `ceil` - -Ceil the value of the number passed as parameter. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ----------------------------------------------- | -| 0 | number | Value to ceil (can process numbers and strings) | - -**Examples** - -```handlebars -{{ceil 1.5}} -result: '2' - -{{ceil '1.5'}} -result: '2' -``` - -## `floor` - -Floor the value of the number passed as parameter. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ------------------------------------------------ | -| 0 | number | Value to floor (can process numbers and strings) | - -**Examples** - -```handlebars -{{floor 2.5}} -result: '2' - -{{floor '2.5'}} -result: '2' -``` - -## `eq` - -Verify if two numbers are equal. Returns a boolean. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ------------- | -| 0 | number | First number | -| 1 | number | Second number | - -**Examples** - -```handlebars -{{#if (eq 55 55}} - true -{{/if}} -Result: true -``` - -## `gt` - -Verify if the first number is greater than the second number. Returns a boolean. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ------------- | -| 0 | number | First number | -| 1 | number | Second number | - -**Examples** - -```handlebars -{{#if (gt 56 55)}} - true -{{/if}} -Result: true -``` - -## `gte` - -Verify if the first number is greater than or equal to the second number. Returns a boolean. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ------------- | -| 0 | number | First number | -| 1 | number | Second number | - -**Examples** - -```handlebars -{{#if (gte 55 55)}} - true -{{/if}} -Result: true -``` - -## `lt` - -Verify if the first number is lower than the second number. Returns a boolean. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ------------- | -| 0 | number | First number | -| 1 | number | Second number | - -**Examples** - -```handlebars -{{#if (lt 55 56)}} - true -{{/if}} -Result: true -``` - -## `lte` - -Verify if the first number is lower than or equal to the second number. Returns a boolean. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ------------- | -| 0 | number | First number | -| 1 | number | Second number | - -**Examples** - -```handlebars -{{#if (lte 55 55)}} - true -{{/if}} -Result: true -``` - -## `toFixed` - -Format a number using fixed-point notation. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ---------------- | -| 0 | number | A number | -| 1 | number | Number of digits | - -**Examples** - -```handlebars -{{toFixed 1.11111 2}} -Result: 1.11 -``` - -## `round` - -Return the value of a number rounded to the nearest integer. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ----------------- | -| 0 | number | A number to round | - -**Examples** - -```handlebars -{{round 0.499}} -Result: 0 -``` - -## `newline` - -Add a newline `\n`. - -**Examples** - -```handlebars -{{newline}} -``` - -## `base64` - -Encode the parameter as base64. This can be used as an inline helper or block helper (see examples below). - -| Arguments (ordered) | Type | Description | -| ------------------- | ---- | ------------------------------------------------------ | -| [0] | any | Value to encode (optional when used as a block helper) | - -**Examples** - -```handlebars -{{base64 'test'}} - -{{#base64}} - firstname,lastname,countryCode - {{#repeat 10}} - {{faker 'name.firstName'}},{{faker 'name.lastName'}},{{faker - 'address.countryCode' - }} - {{/repeat}} -{{/base64}} -``` - -## `base64Decode` - -Decode a base64 string. This can be used as an inline helper or block helper (see examples below). - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | -------------------------------------------------------------- | -| [0] | string | Base64 string to decode (optional when used as a block helper) | - -**Examples** - -```handlebars -{{base64Decode 'YWJjZA=='}} - -{{#base64Decode}} - {{body 'base64content'}} -{{/base64Decode}} -``` - -## `objectId` - -Create a valid ObjectId. It can generates the ObjectId based on the specified time (in seconds) or from a 12 byte string that will act as a seed. Syntax is based on [bson-objectid package](https://www.npmjs.com/package/bson-objectid). - -| Arguments (ordered) | Type | Description | -| ------------------- | ---------------- | ----------- | -| 0 | string \| number | Seed | - -**Examples** - -```handlebars -{{objectId 1414093117}} -{{objectId '54495ad94c934721ede76d90'}} -``` - -## `setVar` - -Set a variable to be used later in the template. The value can be the result of another helper. To use it elsewhere in the template, refer to the variable with its name prefixed with an `@`: `{{@varname}}`. The variable can also be used as a helper parameter: `{{#repeat @varname}}...{{/repeat}}`. -Variables declared in a block helper will be scoped to the block and unavailable outside. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | -------------- | -| 0 | string | Variable name | -| 1 | any | Variable value | - -**Examples** - -```handlebars -{{setVar 'varname' 'value'}} -{{setVar 'varname' (body 'id')}} - -usage: -{{@varname}} -{{#repeat @varname}}...{{/repeat}} - -declare a variable in a block helper: -{{#repeat 5}} - {{setVar 'random' (oneOf (array '1' '2' '3'))}} - {{@random}} -{{/repeat}} - -{{setVar 'myArray' (array '1' '2' '3')}} -{{#each @myArray}} - {{setVar 'eachIndex' @index}} - {{@eachIndex}} -{{/repeat}} -``` - -## `getVar` - -Dynamically get a variable set with [`setVar`](#setvar). - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ------------- | -| 0 | string | Variable name | - -**Examples** - -```handlebars -{{setVar 'varname' 'value'}} - -{{getVar 'varname'}} -{{getVar (concat 'var' 'name')}} -{{getVar (body 'property')}} -``` - -## `includes` - -Search whether a string can be found in another string and returns the appropriate boolean. - -| Arguments (ordered) | Type | Description | -| ------------------- | ---- | ------------------- | -| 0 | any | Data to search into | -| 1 | any | Data to search | - -**Examples** - -```handlebars -{{includes 'Some data' 'data'}} - -result: true -``` - -## `substr` - -Return a portion of a string starting at the specified index and extending for a given number of characters afterwards. - -| Arguments (ordered) | Type | Description | -| ------------------- | ---- | -------------- | -| 0 | any | Starting index | -| [1 = max length] | any | Length | - -**Examples** - -```handlebars -{{substr 'Some data' 5 4}} - -result: 'data' -``` - -## `lowercase` - -Return the first string parameter lowercased. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ------------------- | -| 0 | string | String to lowercase | - -**Examples** - -```handlebars -{{lowercase 'ABCD'}} - -result: 'abcd' -``` - -## `uppercase` - -Return the first string parameter uppercased. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ------------------- | -| 0 | string | String to uppercase | - -**Examples** - -```handlebars -{{uppercase 'abcd'}} - -result: 'ABCD' -``` - -## `split` - -Split a string and return an array containing the multiples substrings. This helper can be used within handlebars' iterative helpers such as `each`. (Default separator is " ") - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ------------- | -| 0 | string | Data to split | -| 1 | string | Separator | - -**Examples** - -```handlebars -{{#each (split '1 2 3 4')}} - item{{this}}, -{{/each}} -result: item1,item2,item3,item4 - -{{#each (split 'This is my string.')}} - {{this}}, -{{/each}} -result: This,is,my,string, -``` - -## `stringify` - -Return objects and arrays as a formatted JSON string indented with two spaces. - -| Arguments (ordered) | Type | Description | -| ------------------- | ---- | --------------- | -| 0 | any | Object or array | - -**Examples** - -Considering an entering body: - -```json -{ - "prop1": "123", - "prop2": { - "data": "test" - } -} -``` - -```handlebars -{{{stringify (bodyRaw 'prop2')}}} -``` - -```json -{ - "data": "test" -} -``` - -## `concat` - -Concatenate multiple strings/numbers together. This helper can concatenate results from other helpers, or be used as a parameter of another helper (see examples below). - -| Arguments (ordered) | Type | Description | -| ------------------- | ---- | --------------------- | -| 0..n | any | Values to concatenate | - -**Examples** - -```handlebars -{{concat 'value1' 2 'value3'}} -{{concat @index (body 'id') 'value3'}} -{{#repeat (concat 1 2 3)}}...{{/repeat}} -``` - -## `indexOf` - -Return the index of the searched 'data' inside the string. A last parameter (number) can be passed to start the search at a specific index. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | --------------------- | -| 0 | any | Data to search into | -| 1 | any | Data to search | -| [2 = 0] | number | Search starting index | - -**Examples** - -```handlebars -{{indexOf 'Some data' 'data' 0}} - -result: 5 -``` - -## `parseInt` - -Parse a number from a string. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | --------------- | -| 0 | string | String to parse | - -## `padStart` - -Pads a string with a given string (repeated, if needed) until the resulting string reaches the given length. The padding is applied from the start of the string. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | --------------------------------------------- | -| 0 | string | String to pad | -| 1 | number | pad length | -| [2 = ' '] | string | Padding character(s) (default to blank space) | - -```handlebars -{{padStart '5' 5 '0'}} - -result: 00005 -``` - -## `padEnd` - -Pads a string with a given string (repeated, if needed) until the resulting string reaches the given length. The padding is applied from the end of the string. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | --------------------------------------------- | -| 0 | string | String to pad | -| 1 | number | pad length | -| [2 = ' '] | string | Padding character(s) (default to blank space) | - -**Examples** - -```handlebars -{{padEnd '5' 5 '0'}} - -result: 50000 -``` - -## `now` - -Display the current time in the chosen format. Format syntax is based on [date-fns package (v2)](https://date-fns.org/v2.11.1/docs/format) and is optional (default to ISO string). - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ----------- | -| 0 | string | Date format | - -**Examples** - -```handlebars -{{now 'YYYY-MM-DD'}} -``` - -## `dateTimeShift` - -Shift a date by adding the number of `years`, `months`, etc. passed as parameters. The `date` and `format` parameters are optional. The helper will return the current date and time as an ISO string if omitted (`yyyy-MM-ddTHH:mm:ss.SSSxxx`). - -| Parameters (named) | Type | Description | -| --------------------------------------- | ------ | -------------------------- | -| date | string | Date to shift | -| [format = 'yyyy-MM-ddTHH:mm:ss.SSSxxx'] | string | Format of the shifted date | -| [years = 0] | number | Years to shift | -| [months = 0] | number | Months to shift | -| [days = 0] | number | Days to shift | -| [hours = 0] | number | Hours to shift | -| [minutes = 0] | number | Minutes to shift | -| [seconds = 0] | number | Seconds to shift | - -**Examples** - -```handlebars -{{dateTimeShift - date='2021-01-01' - format='yyyy-MM-dd HH:mm:ss' - years=1 - months=1 - days=1 - hours=1 - minutes=1 - seconds=1 -}} -``` - -## `date` - -Return a random formatted date (using [date-fns package format](https://date-fns.org/docs/format)) between a minimum and a maximum. Uses `faker 'date.between'` to generate the random date. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ------------- | -| 0 | string | Starting date | -| 1 | string | Ending date | -| 2 | string | Date format | - -**Examples** - -```handlebars -{{date '2020-11-20' '2020-11-25' "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"}} -``` - -## `time` - -Return a random formatted time (using [date-fns package format](https://date-fns.org/docs/format)) between a minimum and a maximum. Uses `faker 'date.between'` to generate the random time. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ------------- | -| 0 | number | Starting time | -| 1 | number | Ending time | -| 2 | string | Time format | - -**Examples** - -```handlebars -{{time '09:00' '10:00' 'HH:mm'}} -``` - -## `dateFormat` - -Return a formatted date (using [date-fns package format](https://date-fns.org/docs/format)). - -| Arguments (ordered) | Type | Description | -| ------------------- | -------------- | -------------- | -| 0 | string \| Date | Date to format | -| 1 | string | Output format | - -**Examples** - -```handlebars -{{dateFormat '2021-01-01' 'yyyy'}} -{{dateFormat (faker 'date.recent') 'yyyy'}} -``` - -## `int` - -Return a random integer. Alias of `faker 'datatype.number`. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ----------- | -| 0 | number | Minimum | -| 1 | number | Maximum | - -**Examples** - -```handlebars -{{int 0 100}} -``` - -## `float` - -Return a random float. Alias of `faker 'datatype.number` with precision = 10. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ----------- | -| 0 | number | Minimum | -| 1 | number | Maximum | - -**Examples** - -```handlebars -{{float 0 100}} -``` - -## `boolean` - -Return a random boolean. Alias of `faker 'datatype.boolean'`. - -**Examples** - -```handlebars -{{boolean}} -``` - -## `title` - -Return a random title. Alias of `faker 'name.title'`. - -**Examples:** - -```handlebars -{{title}} -``` - -## `firstName` - -Return a random first name. Alias of `faker 'name.firstName'`. - -**Examples:** - -```handlebars -{{firstName}} -``` - -## `lastName` - -Return a random last name. Alias of `faker 'name.lastName'`. - -**Examples:** - -```handlebars -{{lastName}} -``` - -## `company` - -Return a random company name. Alias of `faker 'company.companyName'`. - -**Examples:** - -```handlebars -{{company}} -``` - -## `domain` - -Return a random domain name. Alias of `faker 'internet.domainName'`. - -**Examples:** - -```handlebars -{{domain}} -``` - -## `tld` - -Return a random top level domain. Alias of `faker 'internet.domainSuffix'`. - -**Examples:** - -```handlebars -{{tld}} -``` - -## `email` - -Return a random email address. Alias of `faker 'internet.email'`. - -**Examples:** - -```handlebars -{{email}} -``` - -## `street` - -Return a random address. Alias of `faker 'address.streetAddress'`. - -**Examples:** - -```handlebars -{{street}} -``` - -## `city` - -Return a random city name. Alias of `faker 'address.city'`. - -**Examples:** - -```handlebars -{{city}} -``` - -## `country` - -Return a random country name. Alias of `faker 'address.country'`. - -**Examples:** - -```handlebars -{{country}} -``` - -## `countryCode` - -Return a random country code. Alias of `faker 'address.countryCode'`. - -**Examples:** - -```handlebars -{{countryCode}} -``` - -## `zipcode` - -Return a random zip code. Alias of `faker 'address.zipCode'`. - -**Examples:** - -```handlebars -{{zipcode}} -``` - -## `postcode` - -Return a random zip code. Alias of `faker 'address.zipCode'`. - -**Examples:** - -```handlebars -{{postcode}} -``` - -## `lat` - -Return a random latitude. Alias of `faker 'address.latitude'`. - -**Examples:** - -```handlebars -{{lat}} -``` - -## `long` - -Return a random longitude. Alias of `faker 'address.longitude'`. - -**Examples:** - -```handlebars -{{long}} -``` - -## `phone` - -Return a random phone number. Alias of `faker 'phone.phoneNumber'`. - -**Examples:** - -```handlebars -{{phone}} -``` - -## `color` - -Return a random color. Alias of `faker 'commerce.color'`. - -**Examples:** - -```handlebars -{{color}} -``` - -## `hexColor` - -Return a random hexadecimal color code. - -**Examples:** - -```handlebars -{{hexColor}} -``` - -## `guid` - -Return a random GUID. Alias of `faker 'datatype.uuid'`. - -**Examples:** - -```handlebars -{{guid}} -``` - -## `ipv4` - -Return a random IP v4. Alias of `faker 'internet.ip'`. - -**Examples:** - -```handlebars -{{ipv4}} -``` - -## `ipv6` - -Return a random IP v6. Alias of `faker 'internet.ipv6'`. - -**Examples:** - -```handlebars -{{ipv6}} -``` - -## `lorem` - -Return random lorem ipsum text. Alias of `faker 'lorem.sentence'`. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | --------------- | -| 0 | number | Number of words | - -**Examples:** - -```handlebars -{{lorem 50}} -``` diff --git a/content/docs/v4.0.0/templating/mockoon-request-helpers.md b/content/docs/v4.0.0/templating/mockoon-request-helpers.md deleted file mode 100644 index 512dfb07..00000000 --- a/content/docs/v4.0.0/templating/mockoon-request-helpers.md +++ /dev/null @@ -1,227 +0,0 @@ ---- -title: Request helpers -meta: - title: Create dynamic responses with templating request helpers - description: "Create dynamic fake mock data for your mock environments with Mockoon's templating request helpers. All formats are supported: JSON, CSV, HTML, etc." -order: 1020 ---- - -# Templating request helpers - ---- - -Mockoon offers the following helpers which can return information relative to the entering request: - -- [`body`](#body) -- [`bodyRaw`](#bodyraw) -- [`queryParam`](#queryparam) -- [`queryParamRaw`](#queryparamraw) -- [`urlParam`](#urlparam) -- [`cookie`](#cookie) -- [`header`](#header) -- [`hostname`](#hostname) -- [`ip`](#ip) -- [`method`](#method) -- [`baseUrl`](#baseurl) - -## `body` - -Get the value at a given `path` from the request body if the entering `Content-Type` is set to `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`, `application/xml`, `application/soap+xml` or `text/xml`. This helper is designed to retrieve data to be served in a response. To reuse the retrieved data with other helpers (`each`, `if`, etc.), use the [`bodyRaw` helper](#bodyraw) below. - -- The `path` takes the following form `key.0.key.5.key` and is based on the [**object-path** library](https://www.npmjs.com/package/object-path). Properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. - Please note that XML bodies are parsed using [xml-js](https://www.npmjs.com/package/xml-js) package. Refer to this [page](docs:xml-support) or the package documentation for more information on how the XML is parsed and how to fetch specific properties. - Please also note that `multipart/form-data` only supports fields. Uploaded files will be ignored. -- Full objects or arrays can be retrieved by the helper. -- The full request's raw body can also be fetched when the `path` is omitted (`{{body}}`) independently from the request's `Content-Type`. -- If no value is present at the requested `path`, the default value will be used. -- A third parameter (boolean) can be set to true to returns a stringified value even if it's a primitive. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------- | -------------------------------------- | -| 0 | string | Path to the body property | -| 1 | string | Default value if property is not found | -| 2 | boolean | Stringify primitive values | - -**Examples** - -```handlebars -{{body}} -{{body 'path.to.property'}} -{{body 'deep.property\.with\.dot'}} -{{body 'path' 'default value'}} -{{body 'path' 'default value' true}} -``` - -## `bodyRaw` - -Get the **raw** value at a given `path` from the request body if the entering `Content-Type` is set to `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`, `application/xml`, `application/soap+xml` or `text/xml`. This "raw" helper is designed to work with other helpers (`each`, `if`, etc.). To directly use the retrieved data in the response, use the [`body` helper](#body) above. - -- The `path` takes the following form `key.0.key.5.key` and is based on the [**object-path** library](https://www.npmjs.com/package/object-path). Properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. - Please note that XML bodies are parsed using [xml-js](https://www.npmjs.com/package/xml-js) package. Refer to this [page](docs:xml-support) or the package documentation for more information on how the XML is parsed and how to fetch specific properties. - Please also note that `multipart/form-data` only supports fields. Uploaded files will be ignored. -- Full objects or arrays can be retrieved by the helper. -- The full request's raw body can also be fetched when the `path` is omitted (`{{bodyRaw}}`) independently from the request's `Content-Type`. -- If no value is present at the requested `path`, the default value will be used. -- This helper allows the use of `body` within handlebars' helpers such as `{{#each}}` and `{{#if}}`. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | -------------------------------------- | -| 0 | string | Path to the body property | -| 1 | string | Default value if property is not found | - -**Examples** - -```handlebars -{{bodyRaw}} -{{bodyRaw 'path.to.property'}} -{{bodyRaw 'deep.property\.with\.dot'}} -{{bodyRaw 'path' 'default value'}} - -{{#each (bodyRaw 'path.to.array.property' 'default value')}} - value -{{/each}} - -{{#if (bodyRaw 'path.to.boolean.property' 'default value')}} - value -{{/if}} -``` - -## `queryParam` - -Get the value at a given `path` from the request's query string. Complex query strings with arrays and objects are supported. This helper is designed to retrieve data to be served in a response. To reuse the retrieved data with other helpers (`each`, `if`, etc.), use the [`queryParamRaw` helper](#queryparamraw) below. - -- The `path` takes the following form `key.0.key.5.key`. The syntax is based on [NPM **object-path** package](https://www.npmjs.com/package/object-path). -- Full objects or arrays can be retrieved by the helper. -- The full query string object can also be fetched when the `path` is omitted (`{{queryParam}}`). It will be stringified and can be used in a JSON body for example. -- If there is no value at the requested `path`, the default value will be used. -- A third parameter (boolean) can be set to true to returns a stringified value even if it's a primitive. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------- | -------------------------------------- | -| 0 | string | Path to the query param property | -| 1 | string | Default value if property is not found | -| 2 | boolean | Stringify primitive values | - -**Examples** - -```handlebars -{{queryParam}} -{{queryParam 'path.to.property'}} -{{queryParam 'path' 'default value'}} -{{queryParam 'path' 'default value' true}} -``` - -## `queryParamRaw` - -Get the **raw** value at a given `path` from the request's query string. Complex query strings with arrays and objects are supported. This "raw" helper is designed to work with other helpers (`each`, `if`, etc.). To directly use the retrieved data in the response, use the [`queryParam` helper](#queryparam) above. - -- The `path` takes the following form `key.0.key.5.key`. The syntax is based on [NPM **object-path** package](https://www.npmjs.com/package/object-path). -- Full objects or arrays can be retrieved by the helper. -- The full query string object can also be fetched when the `path` is omitted (`{{queryParamRaw}}`). -- If there is no value at the requested `path`, the default value will be used. -- This helper allows the use of `queryParam` within handlebars' helpers such as `{{#each}}` and `{{#if}}`. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | -------------------------------------- | -| 0 | string | Path to the query param property | -| 1 | string | Default value if property is not found | - -**Examples** - -```handlebars -{{queryParamRaw}} -{{queryParamRaw 'path.to.property'}} -{{queryParamRaw 'path' 'default value'}} - -{{#each (queryParamRaw 'path.to.array.query' 'default value')}} - value -{{/each}} - -{{#if (queryParamRaw 'path.to.boolean.query' 'default value')}} - value -{{/if}} -``` - -## `urlParam` - -Get a named parameter from the route `/:paramName1/:paramName2`. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | -------------------- | -| 0 | string | Route parameter name | - -**Examples** - -```handlebars -{{urlParam 'paramName1'}} -``` - -## `cookie` - -Get the content of a cookie or returns a default value if the cookie is not present. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ------------------------------------ | -| 0 | string | Cookie name | -| 1 | string | Default value if cookie is not found | - -**Examples** - -```handlebars -{{cookie 'cookie_name' 'default value'}} -``` - -## `header` - -Get content from any request header or returns a default value if header is not present. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ------------------------------------ | -| 0 | string | Header name | -| 1 | string | Default value if header is not found | - -**Examples** - -```handlebars -{{header 'Header-Name' 'default value'}} -``` - -## `hostname` - -Returns the request hostname. - -**Examples** - -```handlebars -{{hostname}} -``` - -## `ip` - -Returns the request IP address. - -**Examples** - -```handlebars -{{ip}} -``` - -## `method` - -Returns the request method (GET, PUT, POST, etc.). - -**Examples** - -```handlebars -{{method}} -``` - -## `baseUrl` - -Returns the base URL of the request: protocol, host, port and API prefix. - -**Examples** - -```handlebars -{{baseUrl}} -``` diff --git a/content/docs/v4.0.0/templating/mockoon-response-helpers.md b/content/docs/v4.0.0/templating/mockoon-response-helpers.md deleted file mode 100644 index d386495c..00000000 --- a/content/docs/v4.0.0/templating/mockoon-response-helpers.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Response helpers -meta: - title: Dynamically customize the response with with templating helpers - description: "Dynamically customize your mock environments response with Mockoon's templating response helpers. All formats are supported: JSON, CSV, HTML, etc." -order: 1030 ---- - -# Templating response helpers - ---- - -Mockoon offers the following helpers which can customize the outgoing response: - -- [`status`](#status) - -## `status` - -Set the response status code. This helper does not return any content. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | --------------------------- | -| 0 | number | Valid status code (100-999) | - -**Examples** - -```handlebars -{{status 404}} -``` diff --git a/content/docs/v4.0.0/templating/overview.md b/content/docs/v4.0.0/templating/overview.md deleted file mode 100644 index 0f7a3fa5..00000000 --- a/content/docs/v4.0.0/templating/overview.md +++ /dev/null @@ -1,196 +0,0 @@ ---- -title: Overview -meta: - title: Create dynamic responses with templating - description: Create dynamic JSON responses for your mock API server with Mockoon's templating system including Faker.js -order: 1000 ---- - -# Templating overview - ---- - -Mockoon implements [Handlebars](https://handlebarsjs.com/), [Faker.js v7.6.0](https://fakerjs.dev/), and a set of custom helpers to create dynamic responses. This templating system is supported in the response's **body**, **headers**, **file content**, and **file path**. You will find below a global overview of how and where you can use helpers. You can also check the [available helpers](#available-helpers) on specific documentation pages. - -## Helpers - -### Handlebars syntax - -All the helpers must be used according to Handlebars' syntax, for example: `{{helperName param1 param2}}`. Some helpers accepting options objects can be used with Handlebars' object params: `{{faker 'date.month' abbr=false}}`. - -Please note that a space always follows the helper name and separates each and all params like in `oneOf *space* (array *space* 'item1' *space* 'item2')`. -Also, parenthesis serves to prioritize a helper over another but not to symbolize a function call. Helpers do not require parenthesis in order to work. - -All Handlebars helpers are available (`if`, `each`, etc.). For more information, please have a look at [Handlebars' documentation](https://handlebarsjs.com/). - -### Special characters escaping - -Handlebars will escape special characters (& < > " ' \` =) by default. If you want to avoid this behavior, you can use the triple curly braces syntax:`{{{helperName}}}`. - -### Available helpers - -Besides Handlebars built-in helpers, Mockoon offers many of them: - -- [custom helpers](docs:templating/mockoon-helpers) -- [request helpers](docs:templating/mockoon-request-helpers) -- [response helpers](docs:templating/mockoon-response-helpers) -- [Faker.js library helpers](docs:templating/fakerjs-helpers) - -## Usages - -### Body and file content templating - -Templating will work in the body editor without consideration for the Content-Type that has been defined. It will also work with files content for a limited set of MIME types (`application/json`, `text/html`, `text/css`, `text/csv`, `application/javascript`, `application/typescript`, `text/plain`, `application/xhtml+xml`, `application/xml`). - -Here is an example of what you can do with this templating system: - - -```handlebars -{ - "userId": "{{urlParam 'id'}}", - "name": "{{queryParam 'name' 'John'}}", - "lang": "{{{header 'Accept-Language' 'en'}}}", - "elementTitle": "{{body 'elements.0.title' 'default'}}", - "ip": "{{ip}}", - "method": "{{method}}", - "hostname": "{{hostname}}", - "friends": [ - {{#repeat 2}} - { - "id": {{@index}}, - "name": "{{faker 'name.firstName'}} {{faker 'name.lastName'}}" - } - {{/repeat}} - ], - "oneItem": "{{oneOf (array 'item1' 'item2' 'item3')}}", - "someItemsAsString": "{{someOf (array 'item1' 'item2' 'item3') 1 2}}", - "someItemsAsArray": {{{someOf (array 'item1' 'item2' 'item3') 1 2 true}}}, - "userName": - {{#switch (urlParam 'id')}} - {{#case '1'}}"John"{{/case}} - {{#case '2'}}"Jack"{{/case}} - {{#default}}"Peter"{{/default}} - {{/switch}} -} -``` - -![body editor content{963x543}](docs-img:body-templating.png) - -The above template produces the following body with this request: - -```http -GET /user/123456?name=john -Accept-Language: fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7 - -{ - "element": [ - {"title": "My title"} - ] -} -``` - -Response: - -```json -{ - "userId": "5", - "name": "john", - "lang": "fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7", - "elementTitle": "My title", - "ip": "::1", - "method": "GET", - "hostname": "localhost", - "friends": [ - { - "id": 0, - "name": "Stephen Bradbury" - }, - { - "id": 1, - "name": "Warren Caffey" - } - ], - "oneItem": "item1", - "someItemsAsString": "item2", - "someItemsAsArray": ["item2", "item3"], - "userName": "John" -} -``` - -This system is flexible enough to generate a lot of different contents like CSV files: - -```handlebars -firstname,lastname,countryCode -{{#repeat 10}} - {{faker 'name.firstName'}},{{faker 'name.lastName'}},{{faker 'address.countryCode'}} -{{/repeat}} -``` - -Response: - -```csv -firstname,lastname,countryCode -Max,Magby,AZ -Stan,Muldoon,HM -Drew,Rebelo,CY -Cory,Neal,BG -Grace,Whitson,CY -Haydee,Backer,ET -Erik,Friedrich,MX -Stephen,Paquette,PH -Neida,Durrett,PN -Vaughn,Neal,MO -``` - -#### Base64 encoding - -By using the `base64` helper, you can encode parts or entirety of the response by enclosing the content in a block helper. -Inline helper: - -```handlebars -{{base64 'test'}} -{{base64 (body 'path.to.property')}} -``` - -Block helper: - -```csv -{{# base64}} -firstname,lastname,countryCode -{{# repeat 10 }} -{{ faker 'name.firstName' }},{{ faker 'name.lastName' }},{{ faker 'address.countryCode' }} -{{/ repeat}} -{{/ base64}} -``` - -#### Disable body and file templating - -Templating can be disabled for the body and file content in each route response separately. Thus, no helper will be interpreted by the templating engine. - -First, open the **Route response settings**: - -![click on route response fourth settings tab{1004x168}](docs-img:open-route-response-settings.png) - -Then, disable the templating by checking the box: - -![check the disable templating box{1046x181}](docs-img:disable-route-response-templating.png) - -### File input templating - -Templating is also supported in the **file input field**. It allows to dynamically serve files depending on the request parameters, like `urlParam` or any other helper. Example: - -If you have a set of files named `./file1.json` and `./file2.json`, a route param can be declared (`/myroute/:id`) and retrieved with the `urlParam` helper in the file input: - -`c:/.../file{{urlParam 'id'}}.json`. - -If you call this route with `/myroute/1`, `./file1.json` will be sent. - -![add a templating helper in the file path{977x184}](docs-img:file-path-templating.png) - -> For more information about absolute and relative file paths, please refer to our [file serving](docs:response-body/file-serving#absolute-or-relative-paths) documentation. - -### Headers templating - -Finally, templating helpers are also supported in the **headers values** both in route headers and environment headers: - -![add a templating helper in the header value{1004x238}](docs-img:headers-templating.png) diff --git a/content/docs/v4.0.0/xml-support.md b/content/docs/v4.0.0/xml-support.md deleted file mode 100644 index c1b4ac2c..00000000 --- a/content/docs/v4.0.0/xml-support.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: XML support -meta: - title: XML support for entering requests - description: Create realistic mock APIs and generate fake data with Mockoon's templating and rules system supporting the XML format -order: 130 ---- - -# XML support - ---- - -When sending a request containing a valid XML body and an `application/xml` or `text/xml` `Content-Type`, Mockoon will parse the XML and allow you to create [body response rules](docs:route-responses/dynamic-rules) or use the [`body` and `bodyRaw` templating helpers](docs:templating/mockoon-request-helpers#body). Mockoon uses the [**xml-js** NPM package](https://www.npmjs.com/package/xml-js) to convert the entering XML. Please note that the **xml-js** package converts XML into JSON in a particular way, as shown below: - -Entering XML body: - -```xml - - -John -Doe - -``` - -JSON equivalent (compacted): - -```json -{ - "_declaration": { - "_attributes": { - "version": "1.0", - "encoding": "utf-8" - } - }, - "user": { - "_attributes": { - "userID": "123" - }, - "firstname": { - "_text": "John" - }, - "lastname": { - "_text": "Doe" - } - } -} -``` - -> Please refer to [xml-js documentation](https://www.npmjs.com/package/xml-js) for more detail on how the XML is parsed. diff --git a/content/docs/v4.1.0/about.md b/content/docs/v4.1.0/about.md deleted file mode 100644 index f69ba4f7..00000000 --- a/content/docs/v4.1.0/about.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: About the documentation -meta: - title: Learn about Mockoon's documentation - description: Discover Mockoon's features and options, explore advanced topics and learn how to create fast and free mock API JSON servers. -order: 10 ---- - -# About the documentation - ---- - -This documentation covers Mockoon's most used features and options to help you create the best mock APIs. These topics apply to the [desktop application](/download/), [CLI](/cli/), and [serverless package](/serverless/) which supports the same features. -We maintain a documentation for the five latest desktop versions. Head over to our [releases section](/releases/) for more details about the changes in each version. - -If you find a mistake in the documentation, you can open an issue on the [website's repository](https://github.com/mockoon/mockoon.com). - -## CLI documentation - -You will find the [CLI documentation](https://github.com/mockoon/mockoon/blob/main/packages/cli/README.md) in its dedicated readme file on the repository. It covers the CLI's specific features, like the available flags or how to use the Docker file. - -## Serverless documentation - -You will find the [serverless package documentation](https://github.com/mockoon/mockoon/blob/main/packages/serverless/README.md) in its dedicated readme file on the repository. It covers the package usage instructions and specific features. diff --git a/content/docs/v4.1.0/api-endpoints/templates-and-ai-assistant.md b/content/docs/v4.1.0/api-endpoints/templates-and-ai-assistant.md deleted file mode 100644 index 7f11e125..00000000 --- a/content/docs/v4.1.0/api-endpoints/templates-and-ai-assistant.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: Templates and AI assistant -meta: - title: Mockoon templates and AI assistant documentation - description: All you need to know about Mockoon's mock API ready to use JSON templates and AI assistant to generate your own dynamic and realistic templates. -order: 710 -proBadge: true ---- - -# Templates and AI assistant - ---- - -## Overview - -Mockoon **templates** are pieces of JSON, often with [templating helpers](docs:templating/overview), that can be used in Mockoon to quickly prototype your mock APIs. They can be used in your [HTTP route's](docs:api-endpoints/routing#api-routes) body or as [data bucket](docs:data-buckets/overview) content to create realistic and dynamic data. - -Two types of templates are available: **pre-generated** and **AI-generated**. - -## Use the pre-generated templates - -The pre-generated templates can be found in the desktop application. - -To use a template in your routes, click on the "From template" entry in the route creation menu to open the templates dialog: - -![modal with templates list{390x304}](docs-img:pre-generated-templates-modal.png) - -Then, select the template you want to use and either copy-paste its content manually or click on one of the two buttons to create a new **GET endpoint** or a **CRUD endpoint with a data bucket**. - -![create get route from template{860x801}](docs-img:templates-create-get-route.png) - -The "GET route" button will create a new HTTP GET route and copy the template content as the body. The "CRUD + data" button will create a new CRUD endpoint with a linked data bucket and copy the template content as the data bucket content. - -> Some templates are offered for free, while most of them require a subscription to [Mockoon Pro](/pro/). The templates part of the Pro plans are marked with a small yellow corner. - -## Use the AI assistant to generate realistic data - -You can also use our AI assistant to generate realistic mock data for your various endpoints by providing a custom prompt. This feature is available in the desktop application and is part of the [Mockoon Pro](/pro/) plans. - -To generate a new template, click the "From template" button in the route creation menu (see above), and select the "Generate" tab: - -![AI assistant generate tab{860x801}](docs-img:ai-assistant-generate-template-tab.png) - -Then, write a prompt (e.g. "list of users") and click the "Generate" button. - -![AI assistant generate button click{860x801}](docs-img:ai-assistant-generate-button.png) - -Finally, you can copy-paste the generated template manually or click on one of the two buttons to create a new **GET endpoint** or a **CRUD endpoint with a data bucket**. - -![create get route from template{860x801}](docs-img:templates-generate-get-route.png) - -### Writing prompts - -Mockoon AI assistant wraps your prompt with various instructions to help you generate the most relevant template for your needs. It has been optimized for the JSON format but can also generate templates in XML, CSV, etc. -Several options are available to fine-tune the generated templates: - -- **JSON**: the generated template will be a valid JSON object. -- **array**: the generated template root level will be a JSON array (usually used with the **JSON** option). -- **templating**: the generated template will contain Handlebars [templating helpers](docs:templating/overview) (e.g. `{{faker 'name.firstName'}}`). Please note that disabling this option usually results in longer templates. - -![prompt options buttons{860x801}](docs-img:ai-assistant-template-generate-options.png) - -You will obtain best results with shorter prompts: "list of users", "JSON configuration for library X", etc. - -If you want more freedom when generating templates (using a different data format, etc.), you can disable the various options. Our system will still manage your prompt to increase the relevance of the generated template. - -### AI assistant quota - -Each use of the AI assistant will count as one credit towards your monthly quota. You can check your quota in your [account page](https://mockoon.com/account/info/). diff --git a/content/docs/v4.1.0/gui-cheat-sheet.md b/content/docs/v4.1.0/gui-cheat-sheet.md deleted file mode 100644 index 3ceed543..00000000 --- a/content/docs/v4.1.0/gui-cheat-sheet.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: Mockoon GUI cheat sheet -meta: - title: Mockoon GUI cheat sheet - description: Have a doubt? Not sure how to navigate Mockoon's UI? This cheat sheet listing Mockoon\'s major features is for you! -order: 20 ---- - -# Mockoon GUI cheat sheet - ---- - -Are you discovering Mockoon's GUI or forgot what this button is used for? These cheat sheets are for you! - -> The GUI cheat sheet is also available in PDF version
     Download - -## Main endpoints view - -The **main view** (below) contains your environments (or mock API) list, the environment's endpoints, and the currently selected endpoint and [response](docs:route-responses/multiple-responses). It's the view where you will spend the most time. - -![Mockoon routes view{1200x637}](/images/docs/shared/cheat-sheet/routes-view.png) - -The endpoint's responses configuration (below) lets you manage each endpoint responses list and each response parameter: serving a [file](docs:response-body/file-serving), a [body](docs:response-body/overview#body-editor-inline), or a [data bucket](docs:data-buckets/overview), with [rules](docs:route-responses/dynamic-rules) or not, etc. - -![Mockoon responses view{1200x661}](/images/docs/shared/cheat-sheet/responses-view.png) - -At the top of the window, you can access other environment related views: the **environment's headers**, the **data buckets**, the **requests logs**, the **environment's proxy** parameters, and the **environment's settings**. - -## Data buckets view - -The [**data buckets**](docs:data-buckets/overview) view let you create and modify key-value stores that can be [linked to route responses](docs:data-buckets/using-data-buckets#referencing-in-a-route-response) or used with the [`data` helper](docs:data-buckets/using-data-buckets#using-data-helpers). They are persisting between calls and can be regenerated by restarting the server. - -![Mockoon data buckets view{1200x753}](/images/docs/shared/cheat-sheet/databuckets-view.png) - -## Environment's requests logs view - -The **request logging** view is especially useful to debug the entering calls and how Mockoon responded to them. For each, you will find the usual information: path, headers, body, etc. -You can also see if the call has been caught or forwarded through the [proxy](docs:proxy-mode) (if enabled) and [automatically mock](docs:logging-and-recording/auto-mocking-and-recording) entering requests that were not caught. -Each environment (or mock API) has its own entering requests recording. - -![Mockoon logs view{1200x753}](/images/docs/shared/cheat-sheet/logs-view.png) - -## Environment's proxy parameters view - -This view allows you to [enable the proxy mode](docs:proxy-mode) and modify its behavior: removing the API prefix, adding specific headers to the proxied server request or response, etc. - -![Mockoon proxy view{1200x551}](/images/docs/shared/cheat-sheet/proxy-view.png) - -## Environment's settings view - -This view is the place where you can set up global settings for each environment. Changing the environment name, port, or API prefix, [enabling HTTPS and using a custom certificate](docs:serving-over-tls), [handling OPTIONS pre-flight requests automatically](docs:cors), etc. - -![Mockoon settings view{1200x645}](/images/docs/shared/cheat-sheet/settings-view.png) diff --git a/content/docs/v4.1.0/logging-and-recording/auto-mocking-and-recording.md b/content/docs/v4.1.0/logging-and-recording/auto-mocking-and-recording.md deleted file mode 100644 index 58762248..00000000 --- a/content/docs/v4.1.0/logging-and-recording/auto-mocking-and-recording.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: Auto-mocking and recording -meta: - title: Automatic API mock creation - description: Learn how to automatically mock your API endpoints manually or by recording entering requests -order: 851 ---- - -# Automatically create mock routes - ---- - -You can automatically create mock routes from HTTP transactions (request/response). This is especially useful when used in pair with the [proxy mode](docs:proxy-mode) to create a mock API from an existing API. - -## Manually create a mock from a request - -Mockoon offers the possibility to automatically create mocks for entering requests. Click on the "plus" icon on a record to create a route containing the same information (headers, body, etc.): - -![create a route from a log{1214x632}](docs-img:logs-auto-mocking.png) - -## Record your API calls - -Mockoon can also automatically create mock API endpoints every time a request is logged. To activate this feature, click on the "Record" button at the top of the logs view: - -![click on the record button{1214x632}](docs-img:logs-start-recording.png) - -You can record in multiple environments at the same time. A red blinking recording icon will appear next to the environment name to indicate that the recording is active: - -![recording icon{964x432}](docs-img:logs-recording-in-progress.png) - -The recording will only create a route once, based on the path and HTTP method. - -> The recording mode works best with the [proxy mode](docs:proxy-mode) enabled and intercepting all the entering requests. diff --git a/content/docs/v4.1.0/logging-and-recording/requests-logging.md b/content/docs/v4.1.0/logging-and-recording/requests-logging.md deleted file mode 100644 index 563befc4..00000000 --- a/content/docs/v4.1.0/logging-and-recording/requests-logging.md +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: Requests logging -meta: - title: Mock API requests logging - description: Learn how to access requests and responses logs or record your REST API servers calls for easier debugging -order: 850 ---- - -# Requests logging - ---- - -## Accessing the logs - -For easier debugging, Mockoon records all entering requests and all the corresponding outgoing responses for each of your mock API. To access an environment's log, click on the "Logs" tab at the top of the window: - -![click the logs tab{801x160}](docs-img:open-logs.png) - -## Logs content - -The list shows all intercepted requests and how Mockoon answered to them. -Please note that all requests are intercepted, even the `/favicon` request made by the browser. -Each record contains the entering request and the outgoing response information. This includes the complete list of headers, route params, query params, and body in raw format. - -![view the request{1214x632}](docs-img:logs-request.png) - -![view the response{1214x632}](docs-img:logs-response.png) - -The interface is showing truncated bodies for both the request and the response (the truncation length can be adjusted in the settings). You can still view them in full in a separated editor by clicking on **View full body in editor**: - -![click on view full body in editor link{1214x632}](docs-img:logs-view-body.png) - -![body content is showed in a modal{860x696}](docs-img:logs-view-body-modal.png) - -## Logs metadata - -You can also easily see if a request has been caught by Mockoon (record shows a green tick) or has been passed to another URL if the [proxy mode](docs:proxy-mode) is activated (record shows a shield icon): - -![view logs metadata{1214x632}](docs-img:logs-metadata.png) - -## File logging - -Mockoon records all transactions in the [logs file](docs:mockoon-data-files/settings-and-logs#application-logs) in JSON format: - -```json -{ - "app": "mockoon-server", - "level": "info", - "message": "Transaction recorded", - "timestamp": "2023-06-29T09:40:01.772Z" - "environmentName": "Demo API", - "environmentUUID": "6a5ccd5b-fd28-471a-bbdc-cbbd7ea54157", - "requestMethod": "GET", - "requestPath": "/test", - "requestProxied": false, - "responseStatus": 200, -} -``` - -You can also enable full transaction logging in the application settings by checking the "Log the full transactions" checkbox in the settings dialog. - -When using this option, logs will contain the full transaction (request and response) with the same information you can see in the desktop application "Logs" tab: - -```json -{ - "app": "mockoon-server", - "level": "info", - "message": "Transaction recorded", - "timestamp": "2023-06-29T09:02:09.801Z", - "environmentName": "Demo API", - "environmentUUID": "d682bfab-52aa-4ec5-a3a5-853e6d3950cc", - "requestMethod": "GET", - "requestPath": "/test", - "requestProxied": false, - "responseStatus": 200, - "transaction": { - "proxied": false, - "request": { - "body": "{}", - "headers": [{ "key": "accept", "value": "*/*" }], - "method": "GET", - "params": [], - "query": "", - "queryParams": {}, - "route": "/test", - "urlPath": "/test" - }, - "response": { - "body": "{}", - "headers": [ - { "key": "content-type", "value": "application/json; charset=utf-8" } - ], - "statusCode": 200, - "statusMessage": "OK" - }, - "routeResponseUUID": "173e37f8-7edd-4ca4-9244-32ca14eeb158", - "routeUUID": "03a3f8de-7a4e-4dd1-a008-719e6165207c" - } -} -``` - -> ⚠️ Enabling this option will generate a lot of logs and can quickly fill up your disk space. Use it with caution. - -> 🔏 Our logging system will automatically anonymize any credentials present in the `Authorization` or `Proxy-Authorization` headers. diff --git a/content/docs/v4.1.0/mockoon-data-files/data-storage-location.md b/content/docs/v4.1.0/mockoon-data-files/data-storage-location.md deleted file mode 100644 index 98b1b034..00000000 --- a/content/docs/v4.1.0/mockoon-data-files/data-storage-location.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: Data storage location -meta: - title: Data storage location - description: Learn where Mockoon's data storage files and application settings are located and how to move them to other folders -order: 1100 ---- - -# Data storage location - ---- - -## Locating the files - -Since [v1.16.0](https://github.com/mockoon/mockoon/releases/tag/v1.16.0), Mockoon is storing each mock API's data in a separate file. - -You can locate the folder in which the API data are stored by right-clicking on each environment and selecting **"Show data file in explorer/finder"**: - -![click on show in folder in the context menu{455x312}](docs-img:environment-show-in-folder.png) - -## Moving the files - -You can move the data files to another folder by right-clicking on an environment and selecting **"Move data file to folder"**: - -![click on Move data file to folder in folder in the context menu{455x344}](docs-img:environment-move-to-folder.png) - -> Please note that the environment file will be copied to the new folder, and the original file will **not** be deleted. If you want to delete the original file, you will have to do it manually. - -## Old system - -Before version 1.16.0, all of your environments were stored in the same `environments.json` file in the **application data folder**. The file was located in your operating system's user folder: - -- Windows: `c:/Users/xxx/AppData/Roaming/mockoon/storage` -- Linux: `~/.config/mockoon/storage` -- macOS: `~/Library/Application Support/mockoon/storage` - -When updating to version 1.16.0, Mockoon automatically migrated the old `environments.json` file (see below) and split it into as many files as you had environments. These files were created in the same `storage` folder with incremental names: `environment-0.json`, `environment-1.json`, etc. - -![one file vs multiple files after the migration{600x252}](/images/docs/shared/storage-migration.png) diff --git a/content/docs/v4.1.0/mockoon-data-files/environment-clipboard-copy.md b/content/docs/v4.1.0/mockoon-data-files/environment-clipboard-copy.md deleted file mode 100644 index 58c4dc4e..00000000 --- a/content/docs/v4.1.0/mockoon-data-files/environment-clipboard-copy.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: Copy data to the clipboard -meta: - title: Copy data to the clipboard - description: Learn how to easily share your Mockoon's mock API JSON definitions with your team by copying them to the clipboard and importing them in the application -order: 1120 ---- - -# Copy data to the clipboard - ---- - -## Copy an environment or a route JSON to the clipboard - -To copy a specific environment or route's JSON data to the clipboard, right-click on the environment or route and select **Copy to clipboard (JSON)**: - -![Right click on an environment and click on Copy to clipboard (JSON){655x331}](docs-img:export-clipboard-env.png) - -The resulting JSON can be saved in a file and directly opened in the desktop app or used with the CLI. - -## Create a new environment from clipboard's data - -To create a new environment from data present in the clipboard, open the **File** menu and select **New environment from clipboard**: - -![Create new environment from clipboard{802x289}](/images/docs/shared/new-environment-from-clipboard.png) - -You will be prompted to choose a save location for your new environment. - -## Create a new route from clipboard's data - -To create a new route from data present in the clipboard, open the **Routes** menu and select **Add route from clipboard**: - -![Create new route from clipboard{802x289}](/images/docs/shared/new-environment-from-clipboard.png) - -The new route will be added to your active environment's routes. diff --git a/content/docs/v4.1.0/mockoon-data-files/import-export-mockoon-format.md b/content/docs/v4.1.0/mockoon-data-files/import-export-mockoon-format.md deleted file mode 100644 index 8fd89a82..00000000 --- a/content/docs/v4.1.0/mockoon-data-files/import-export-mockoon-format.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: Legacy export files -meta: - title: Legacy export files - description: Learn how to run your mock API server using deprecated legacy Mockoon export files, both supported by the desktop application and the CLI -order: 1140 ---- - -# Legacy export files - ---- - -## Pre v1.16.0 export format - -Before [v1.16.0](https://github.com/mockoon/mockoon/releases/tag/v1.16.0), exporting data in Mockoon's format was necessary to share your mocks with other users and to run them with the [CLI](/cli/). Since this update, both the desktop application and the CLI can use or load Mockoon's environments files directly without exporting them ([Learn more](docs:mockoon-data-files/sharing-mock-api-files)). - -Export files looked like regular environment files, wrapped in Mockoon's specific format: - -```json -{ - "source": "mockoon:1.17.0", - "data": [ - { - "type": "environment", - "item": { - "uuid": "", - "lastMigration": 19, - "name": "Exported environment", - ... - } - } - ] -} -``` - -## v1.18.0 deprecation - -In [v1.18.0](https://github.com/mockoon/mockoon/releases/tag/v1.18.0), the options to import/export in Mockoon's format have been removed from the application. You won't be able to export your environments in this format anymore. - -However, both the CLI and the desktop application can load these legacy export files. - -When opening an old export file, Mockoon will ask for confirmation before opening it. Upon confirmation, the export file will be migrated to the new format automatically: - -![prompt before opening legacy export file{560x276}](docs-img:legacy-export-file-open-prompt.png) diff --git a/content/docs/v4.1.0/mockoon-data-files/settings-and-logs.md b/content/docs/v4.1.0/mockoon-data-files/settings-and-logs.md deleted file mode 100644 index 5ea8ad04..00000000 --- a/content/docs/v4.1.0/mockoon-data-files/settings-and-logs.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: Settings and logs -meta: - title: Settings and logs - description: Learn where Mockoon's desktop application settings and log files are located for each operating system -order: 1140 ---- - -# Settings and logs - ---- - -Depending on your operating system, Mockoon's settings and log files are located in different folders. - -## Application settings - -Mockoon's settings are always stored in your operating system's user folder: - -- Windows: `c:/Users/{username}/AppData/Roaming/mockoon/storage` -- Windows Portable: `{PORTABLE_EXECUTABLE_DIR}/mockoon-data/storage` -- Linux: `~/.config/mockoon/storage` -- Linux Snap: `~/snap/mockoon/common` -- macOS: `~/Library/Application Support/mockoon/storage` - -## Application logs - -Mockoon's logs are located in the following folders: - -- Windows: `c:/Users/{username}/AppData/Roaming/mockoon/logs/app.log` -- Windows Portable: `{PORTABLE_EXECUTABLE_DIR}/mockoon-data/logs/app.log` -- Linux: `~/.config/mockoon/logs/app.log` -- Linux Snap: `~/snap/mockoon/common/logs/app.log` -- macOS: `~/Library/Logs/Mockoon/app.log` diff --git a/content/docs/v4.1.0/openapi/import-export-openapi-format.md b/content/docs/v4.1.0/openapi/import-export-openapi-format.md deleted file mode 100644 index 55534df8..00000000 --- a/content/docs/v4.1.0/openapi/import-export-openapi-format.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Import/export in OpenAPI format -meta: - title: Import/export in OpenAPI format - description: Learn how to easily import and export or share with your team your mock API servers and routes using the OpenAPI specification -order: 1050 ---- - -# Import/export in OpenAPI format - ---- - -Mockoon supports imports in both OpenAPI v2 (Swagger) and v3 formats. Environments can be exported to OpenAPI version 3. - -### Import environment from an OpenAPI v2 or v3 JSON/YAML file - -To import an environment from a file, open the **Import/export** menu, select **Swagger/OpenAPI** and then **Import Swagger v2/OpenAPI v3 (JSON or YAML)**: - -![Click on Import Swagger v2/OpenAPI v3 (JSON or YAML){812x267}](/images/docs/shared/import-openapi.png) - -### Export an environment to an OpenAPI v3 JSON file - -To export an environment to a JSON file, open the **Import/export** menu, select **Swagger/OpenAPI** and then **Export current environment to OpenAPI v3 (JSON)**: - -![Click on Export current environment to OpenAPI v3 (JSON){812x267}](/images/docs/shared/export-openapi.png) - -### Compatibility - -Compatibility between the OpenAPI specification and Mockoon's features is only partial and detailed in the [next article](docs:openapi/openapi-specification-compatibility). diff --git a/content/docs/v4.1.0/openapi/openapi-specification-compatibility.md b/content/docs/v4.1.0/openapi/openapi-specification-compatibility.md deleted file mode 100644 index 4afe8171..00000000 --- a/content/docs/v4.1.0/openapi/openapi-specification-compatibility.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: OpenAPI specification compatibility -meta: - title: OpenAPI specification compatibility - description: Learn more about Mockoon compatibility with the OpenAPI specification and how to easily share your API definitions with your team -order: 1051 ---- - -# OpenAPI specification compatibility - ---- - -Importing an OpenAPI specification file in Mockoon can be a good starting point to create a mock from your API definition. And exporting your mock to an OpenAPI specification file is also a way to start an API definition. However, there is currently no equivalent between all the OpenAPI specifications and Mockoon's features: - -- Some of Mockoon's features will be lost when exporting to an OpenAPI specification because they have no equivalent in the specification. It is the case for the [rules system](docs:route-responses/dynamic-rules). -- Some features are not yet exported to an OpenAPI specification: bodies created in Mockoon are not converted to OpenAPI schemas or body examples. -- when importing an OpenAPI specification file, not all properties have equivalents in Mockoon, or some may not be implemented yet. See below for the list of imported information. - -Importing from or exporting to an OpenAPI specification file is a good starting point but not a way to share your mock APIs created with Mockoon. For sharing, we recommend that you directly [share Mockoon's data files](docs:mockoon-data-files/sharing-mock-api-files). -Also, if you want to run your mock API with the [CLI](/cli/), you must use [Mockoon's data files directly](/tutorials/run-mock-api-anywhere-cli/), or you may lose part of your mock's behavior. - -### Supported information - -OpenAPI import and export currently support the following API information: - -- API title. -- Server URL, port, base path (prefix) and protocol. -- Routes paths (including route parameters translated to `/:param`), methods, responses with status code (200, etc.), headers, and descriptions. - -_Import only_: sample responses and JSON bodies are created from OpenAPI schemas and examples during import. diff --git a/content/docs/v4.1.0/response-headers.md b/content/docs/v4.1.0/response-headers.md deleted file mode 100644 index 6099b15e..00000000 --- a/content/docs/v4.1.0/response-headers.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: Headers -meta: - title: Define route and environment response headers - description: Mockoon can handle response headers at both environment and route levels for your mock server, learn how -order: 40 ---- - -# Headers - ---- - -In Mockoon you can easily define **response headers** for **each route** but also at the **environment level**. Response headers defined on a route will **override** those defined in an environment. - -## Route level response headers - -To add response headers like `Content-Type` to your route, go to the route's **Headers tab** and fill the name and value fields: - -![Complete route response header form{997x204}](docs-img:fill-route-header-form.png) - -You can add one or more headers by clicking on the "Add header" button at the bottom of the list: - -![Add route response header{977x234}](docs-img:add-route-header.png) - -## Environment level response headers - -You can also add response headers at the environment level. Headers defined in an environment will be overridden if they are redefined on a route. To define an environment response header: - -Open the **Environment Headers** by clicking on the tab at the top of the window: - -![click on the headers tab{746x160}](docs-img:open-environment-headers.png) - -And add one or more headers by clicking on the "Add header" button at the bottom of the list: - -![Add environment header{1177x137}](docs-img:add-environment-header.png) diff --git a/content/docs/v4.1.0/serving-over-tls.md b/content/docs/v4.1.0/serving-over-tls.md deleted file mode 100644 index bb071d7d..00000000 --- a/content/docs/v4.1.0/serving-over-tls.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: TLS -meta: - title: Serve a mock API over TLS - description: Need to mock a secured REST API server? Mockoon can also do this by serving over TLS with a self-signed certificate -order: 100 ---- - -# TLS - ---- - -Mockoon supports serving your mock API over TLS with a self-signed certificate by default. You can also provide your certificate and trusted CA certificates. - -## Activate the TLS option - -You can activate the TLSoption for each environment independently. Open the **Environment Settings** by clicking on the tab at the top of the window: - -![click on the settings tab{1034x160}](docs-img:open-environment-settings.png) - -Enable the **TLS option** by ticking the checkbox. The option was successfully activated if a yellow lock is displayed next to the environment name. - -![tick the TLS checkbox{807x343}](docs-img:enable-tls.png) - -> You may need to restart your environment for the change to take effect. - -Your mock API will now be available on `https://localhost:port` instead of `http://localhost:port`. - -Please note that Mockoon is using a self-signed certificate to serve your environment over TLS. - -## Provide your own certificate - -You can also provide your certificate in both PKCS12 or PEM formats by filling out the input fields with the path to the file(s). - -![add certificate path{1264x590}](docs-img:enable-tls-custom-certificate.png) - -Mockoon also supports passphrase-protected keys and custom-trusted CA certificates. As Mockoon is using Node.js' `tls`, you can refer to the [`tls.createSecureContext()` documentation](https://nodejs.org/dist/latest-v16.x/docs/api/tls.html#tlscreatesecurecontextoptions) for a full description of the available options. - -> All the path fields support both absolute and relative paths. Relative paths are resolved from the environment's file location. diff --git a/content/docs/v4.1.0/templating/fakerjs-helpers.md b/content/docs/v4.1.0/templating/fakerjs-helpers.md deleted file mode 100644 index 84f50c60..00000000 --- a/content/docs/v4.1.0/templating/fakerjs-helpers.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: Faker.js helpers -meta: - title: Create dynamic responses with templating Faker.js helpers - description: Create realistic mock data for your mock API servers with Mockoon's templating system including Faker.js -order: 1040 ---- - -# Faker.js helpers - ---- - -Mockoon implements [Faker.js v7.6.0](https://fakerjs.dev/) library by wrapping most of the available helpers. -Faker.js offers lots of helpers: `address.zipCode`, `address.city`, `address.cityPrefix`, `name.firstName`, `name.lastName`, `datatype.number`, `datatype.float`, `internet.avatar`, `internet.email`, etc. Please have a look at [Faker.js documentation](https://fakerjs.dev/) to learn how to use them. - -## Usage - -All Faker.js helpers must be used with the following syntax: `{{faker 'namespace.method'}}`. -**Examples:** - -```js -{{faker 'address.zipCode'}} -{{faker 'address.city'}} -{{faker 'address.cityPrefix'}} -{{faker 'name.firstName'}} -... -``` - -Faker.js methods may use two different ways of passing parameters: ordered arguments or options objects. Wrapped in Handlebars helpers, this may result in two different ways of using them: - -```js -// named parameters -{{faker 'datatype.number' min=0 max=25}} - -// ordered arguments (here count=25) -{{faker 'random.alphaNumeric' 25}} -``` - -## Set Faker.js' locale and seed - -Faker.js locale and seed can be defined in the settings: - -![fakerjs settings{860x812}](docs-img:settings-faker.png) - -> 📝**A note on Faker.js seeding** -> By providing a seed value, you can generate repeatable **sequences** of fake data. Using seeding will not always generate the same value but rather a predictable sequence. diff --git a/content/docs/v4.0.0/about.md b/content/docs/v7.0.0/about.md similarity index 90% rename from content/docs/v4.0.0/about.md rename to content/docs/v7.0.0/about.md index f69ba4f7..709d663f 100644 --- a/content/docs/v4.0.0/about.md +++ b/content/docs/v7.0.0/about.md @@ -22,3 +22,5 @@ You will find the [CLI documentation](https://github.com/mockoon/mockoon/blob/ma ## Serverless documentation You will find the [serverless package documentation](https://github.com/mockoon/mockoon/blob/main/packages/serverless/README.md) in its dedicated readme file on the repository. It covers the package usage instructions and specific features. + +> 🎓 Discover our official online course designed to help you get started with API mocking and API design. Coming soon! [Learn more](/course/) diff --git a/content/docs/v4.1.0/api-endpoints/crud-routes.md b/content/docs/v7.0.0/api-endpoints/crud-routes.md similarity index 70% rename from content/docs/v4.1.0/api-endpoints/crud-routes.md rename to content/docs/v7.0.0/api-endpoints/crud-routes.md index 143b9767..e5743828 100644 --- a/content/docs/v4.1.0/api-endpoints/crud-routes.md +++ b/content/docs/v7.0.0/api-endpoints/crud-routes.md @@ -3,7 +3,7 @@ title: CRUD routes meta: title: Mockoon CRUD routes documentation description: All you need to know about Mockoon's mock API CRUD routes creation, behavior, data bucket operations and data manipulation. -order: 710 +order: 210 --- # CRUD routes @@ -38,6 +38,8 @@ After creating a CRUD endpoint, you need to link it to a data bucket: The CRUD route will work with any content stored in your data bucket: valid JSON in the form of an array of objects, an object, a primitive, etc., or any non-valid JSON. The route behaviors will vary depending on the content stored in the bucket (see table below). +> 🛠️ Use our [JSON validator](/tools/json-validator/) to check if your content is valid JSON. + ### Resetting the data bucket content The data bucket content is generated when the server starts, and its state persists between calls. However, its state will not be saved in the [data file](docs:mockoon-data-files/data-storage-location), and you can reset it to its initial state by restarting the mock API. @@ -70,9 +72,9 @@ Mockoon will automatically translate a CRUD endpoint to multiple routes allowing | **DELETE** | `/resources` | Deletes the data bucket content | Deletes the data bucket content | Deletes the content | | **DELETE** | `/resources/:id` | Deletes an object by its `id` | Deletes an item at index | Deletes the content | -\* Supports [sorting and pagination](#sorting-and-pagination-on-the-main-get-route) +\* Supports [filtering, sorting and pagination](#filtering-sorting-and-pagination-on-the-main-get-route) -> ⚠️ _Note:_ You can expect the above results assuming that you are sending the same type of content that the one stored in the data bucket (array ↔ array, object ↔ object, etc.). However, the system is very permissive, and you may push any content in an array, ending up with mixted type contents or replacing content with data of a different type. +> ⚠️ _Note:_ You can expect the above results assuming that you are sending the same type of content as the one stored in the data bucket (array ↔ array, object ↔ object, etc.). However, the system is very permissive, and you may push any content in an array, ending up with mixed type contents or replacing content with data of a different type. ## Customizing the "id" property @@ -84,9 +86,68 @@ By default, CRUD endpoints will use the `id` property to identify objects in an You can easily override a CRUD operation route by declaring a regular HTTP route and putting it above the CRUD route (see [routes order](docs:api-endpoints/routing#routes-order)). This route will intercept the request allowing you to serve custom content for this operation. -## Sorting and pagination on the main GET route +## Filtering, sorting and pagination on the main GET route + +The main `GET /path` route supports **filtering**, **sorting** and **pagination** when working with an **array**. + +### Filtering + +To filter an array, you can use query parameters in the form `[property]_[operator]`. For instance, if you want to filter an array of objects by their `status` property, you can use: + +``` +GET /path?status_eq=success +``` + +Currently, the following operators are supported: + +| Operator | Description | Example | +| -------- | --------------------------------------------- | ------------------- | +| `eq` | Filters by equality | `status_eq=success` | +| `ne` | Filters by inequality | `status_ne=error` | +| `gt` | Filters by greater | `price_gt=10` | +| `gte` | Filters by greater or equal | `price_gte=10` | +| `lt` | Filters by lower | `price_lt=10` | +| `lte` | Filters by lower or equal | `price_lte=10` | +| `like` | Filters by partial match \* | `name_like=ohn do` | +| `start` | Filters properties that start with a value \* | `name_start=john` | +| `end` | Filters properties that end with a value \* | `name_end=doe` | -The main `GET /path` route supports **sorting** and **pagination** when working with an **array**. +\* Case insensitive + +Filters work on every primitive value (strings, numbers, booleans, etc.), so you can filter by `true` or `false` values, or even `null` values: + +``` +GET /path?is_active_eq=true +``` + +It also works on arrays of primitives, in which case using `_[operator]` is enough: + +``` +GET /path?_gte=10 +``` + +Moreover, nesting is supported: + +``` +GET /path?user.email_end=@example.com +``` + +The `like`, `start` and `end` operators support regex patterns: + +``` +GET /path?user.name_like=^john +GET /path?user.id_like=^(123|456|789)$ +``` + +#### Searching + +To search an array, you can use the `search` query parameter. Search is a special kind of filter that will look for a partial match in any values (with nesting) in the array. For instance, if you want to search for `john` in an array of users, you can use: + +``` +GET /path?search=john +``` + +> Searching also works on arrays of primitives (strings, numbers, etc.) ### Sorting @@ -125,10 +186,15 @@ Examples: GET /path?page=2 ``` -Pagination will be applied after sorting, both can be cumulated: +Filtering, sorting and pagination can work together and are applied in the order: filtering / searching, sorting, pagination. ``` -GET /path?sort=name&page=2&limit=25 +GET /path?search=j&email_end=@example.com&sort=name&page=2&limit=25 ``` -> When using pagination, a `X-Total-Count` header will be present in the response with the total number of items. +### Meta data + +When using CRUD endpoints, you can access meta data about the data bucket content through response headers: + +- `X-Total-Count`: total number of items in the bucket +- `X-Filtered-Count`: number of items after filtering (not taking into account pagination) diff --git a/content/docs/v4.1.0/api-endpoints/folders.md b/content/docs/v7.0.0/api-endpoints/folders.md similarity index 94% rename from content/docs/v4.1.0/api-endpoints/folders.md rename to content/docs/v7.0.0/api-endpoints/folders.md index c46182f2..5e4691e2 100644 --- a/content/docs/v4.1.0/api-endpoints/folders.md +++ b/content/docs/v7.0.0/api-endpoints/folders.md @@ -3,7 +3,7 @@ title: Folders meta: title: Mockoon folders documentation description: Everything about Mockoon API endpoint folder and sub-folders organization, reordering, auto repair and route precedence -order: 720 +order: 230 --- # Folders @@ -14,7 +14,7 @@ order: 720 You can organize your routes into folders and sub-folders: -![routes organized in folders and sub-folders{799x522}](docs-img:routes-nested-folder.png) +![routes organized in folders and sub-folders{799x518}](docs-img:routes-nested-folder.png) This new feature allows you to better organize your routes and make your APIs more readable and easier to navigate, with a clearer hierarchy. You can drag and drop to move or reorganize your routes and folders. diff --git a/content/docs/v4.1.0/api-endpoints/routing.md b/content/docs/v7.0.0/api-endpoints/routing.md similarity index 75% rename from content/docs/v4.1.0/api-endpoints/routing.md rename to content/docs/v7.0.0/api-endpoints/routing.md index b950e8ba..5580080f 100644 --- a/content/docs/v4.1.0/api-endpoints/routing.md +++ b/content/docs/v7.0.0/api-endpoints/routing.md @@ -3,7 +3,7 @@ title: Routing meta: title: Mockoon routing documentation description: Everything about Mockoon mock API paths creation, API prefix, route parameters, query strings, wildcards and more -order: 700 +order: 200 --- # Routing @@ -16,11 +16,11 @@ In order to prefix all your mock API routes, Open the **Environment Settings** by clicking on the tab at the top of the window: -![click on the settings tab{767x160}](docs-img:open-environment-settings.png) +![click on the settings tab{871x160}](docs-img:open-environment-settings.png) Then, fill the **API prefix** input at the top of the **environment Settings**: -![fill the prefix input{995x298}](docs-img:environment-prefix.png) +![fill the prefix input{993x298}](docs-img:environment-prefix.png) The prefix will appear under your environment name in the environments list. All your environment's routes will now be prefixed and available at the following address `http://localhost:port/myprefix/myroute` instead of `http://localhost:port/myroute`. @@ -32,26 +32,31 @@ Mockoon uses Express to run the mock servers. In general, most of the Express' d ### Routes order -Routes are declared in the server in the order displayed in the application (inside folders or not). It means that a the first ones takes precedence over the following ones. +Routes are declared in the server in the order displayed in the application (inside folders or not). This means that the first ones take precedence over the following ones. -One consequence is that a route parameter will capture any value at the specific URL segment. For example, `/users/:id` will intercept `/users/search`. The more specific "search" route should be declared first. You can always reorder routes by dragging and dropping them. +One consequence is that a route parameter will capture any value at the specific URL segment. For example, `/users/:id` or `/users/*` will intercept `/users/search`. The more specific "search" route should be declared first. You can always reorder routes by dragging and dropping them. -### Route patterns +### Route patterns and regexes -Routes support certain patterns. Here are some examples of the available ones: +Routes support certain patterns and a subset of regular expressions. Here are some examples of the available ones: +- `/path/*` will match `/path/anything`. - `/ab?cd` will match `/acd` and `/abcd`. - `/ab+cd` will match `abcd`, `abbcd`, `abbbcd`, and so on. +- `/ab(cd)?e` will match `/abe` and `/abcde`. -![route pattern{956x74}](docs-img:route-patterns.png) +![route pattern{995x74}](docs-img:route-patterns.png) For a complete overview of the patterns available, please refer to Express' [route paths documentation](https://expressjs.com/en/guide/routing.html#route-paths). +> To use parentheses in your path as a normal character, you can escape them by either using a backslashe `\` or square brackets `[]`: +> `/part1[(]part2[)]` > `/part1\(part2\)` + ### Route parameters Route parameters can be defined in routes by using a colon `:`. The name of a parameter can only contains the following characters `A-Za-z0-9_`. -![route parameter{956x74}](docs-img:route-params.png) +![route parameter{995x74}](docs-img:route-params.png) For a complete overview on how to use and declare route parameters, please refer to Express' [route parameters documentation](https://expressjs.com/en/guide/routing.html#route-parameters). diff --git a/content/docs/latest/api-endpoints/templates-and-ai-assistant.md b/content/docs/v7.0.0/api-endpoints/templates-and-ai-assistant.md similarity index 100% rename from content/docs/latest/api-endpoints/templates-and-ai-assistant.md rename to content/docs/v7.0.0/api-endpoints/templates-and-ai-assistant.md diff --git a/content/docs/v7.0.0/callbacks/overview.md b/content/docs/v7.0.0/callbacks/overview.md new file mode 100644 index 00000000..b477cc57 --- /dev/null +++ b/content/docs/v7.0.0/callbacks/overview.md @@ -0,0 +1,36 @@ +--- +title: Overview +meta: + title: Callbacks overview + description: Learn how to create callbacks in Mockoon to call webhooks or microservices and how to trigger them from your route responses +order: 650 +--- + +# Callbacks overview + +--- + +## What are callbacks? + +Callbacks are a way to **make one or more HTTP calls** after an entering request reaches your route. This is useful to **call other APIs or micro-services or to trigger a webhook**. + +Callbacks are fully configurable and are created at the environment level, like the [data buckets](docs:data-buckets/overview). + +## Create a callback + +To create a new callback, open the **Callbacks** options by clicking on the tab at the top of the window: + +![click on the callbacks tab at the top{955x160}](docs-img:open-callbacks-view.png) + +Add a new callback by clicking on the "plus" button: + +![Add a new callback by clicking on the plus button{1264x578}](docs-img:add-callback.png) + +## Configure a callback + +The callback configuration interface is very similar to the route response interface. You can configure the callback's **name**, **description**, **method**, **URL**, **body**, and **headers**: + +- **URL**: the URL to call. Supports [templating helpers](docs:templating/overview). +- **Method**: the HTTP method to use for the call. Only some methods support a body (`POST`, `PUT`, and `PATCH`). +- **Body**: the body to send with the call. You can serve an inline body, a file, or the content of a [data bucket](docs:data-buckets/overview). They support templating too. Please refer to the [response body](docs:response-configuration/response-body) documentation for more details. +- **Headers**: the headers to send with the call. They support our [templating helpers](docs:templating/overview). diff --git a/content/docs/v7.0.0/callbacks/using-callbacks.md b/content/docs/v7.0.0/callbacks/using-callbacks.md new file mode 100644 index 00000000..53a28fc5 --- /dev/null +++ b/content/docs/v7.0.0/callbacks/using-callbacks.md @@ -0,0 +1,25 @@ +--- +title: Using callbacks +meta: + title: Using callbacks + description: Learn how to use Mockoon's callbacks, link them to your route responses and delay their execution +order: 651 +--- + +# Using callbacks + +--- + +After [creating callbacks](docs:callbacks/overview), you can link them in your route responses and delay their execution. + +## Link a callback to a route response + +To link a callback to a route response, choose "Callbacks" in the route response menu: + +![click on the callbacks tab in the route response menu{1004x174}](docs-img:open-route-response-callbacks.png) + +Then, click on the "plus" button to add a new callback, and select the callback you want to link: + +![click on the plus button to add a new callback{977x234}](docs-img:link-callback-response.png) + +> 💡 You can **delay a callback execution** by adding a delay in milliseconds in the "Callback latency" field. diff --git a/content/docs/v4.1.0/data-buckets/overview.md b/content/docs/v7.0.0/data-buckets/overview.md similarity index 70% rename from content/docs/v4.1.0/data-buckets/overview.md rename to content/docs/v7.0.0/data-buckets/overview.md index 9f67fa6c..54a3193d 100644 --- a/content/docs/v4.1.0/data-buckets/overview.md +++ b/content/docs/v7.0.0/data-buckets/overview.md @@ -3,7 +3,7 @@ title: Overview meta: title: Data buckets overview description: Learn what are Mockoon's data buckets, how they work, what type of content is supported and how to create one -order: 950 +order: 600 --- # Data buckets overview @@ -20,7 +20,7 @@ The data buckets are defined at the **environment level** and are **generated wh To create a new data bucket, open the **Data** options by clicking on the tab at the top of the window: -![Open data bucket view{742x160}](docs-img:open-data-view.png) +![Open data bucket view{745x160}](docs-img:open-data-view.png) Add a new data bucket by clicking on the "plus" button: @@ -48,10 +48,10 @@ You can easily combine your data bucket contents by referencing other data bucke } ``` -> ⚠️ However, data buckets are generated in the order they are defined in the environment. As a consequence, you cannot reference a data bucket that is defined **after** the current one. +> ⚠️ Data buckets are generated in the order they are defined in the environment. As a consequence, you cannot reference a data bucket that is defined **after** the current one. You can easily reorder your data buckets by dragging and dropping them in the list. ## Data buckets generation -Data buckets are generated when the server starts in the order they are defined in the environment. Their state persist during all mock API calls. To regenerate a data bucket's content, restart the mock server. +Data buckets are generated when the **server starts** in the order they are defined in the environment. Their state persist during all mock API calls. To regenerate a data bucket's content, restart the mock server. -If a data bucket contains [request helpers](docs:templating/mockoon-request-helpers), Mockoon will generate the bucket content only after the first call made to a route using this data bucket (by referencing it directly or using a data helper). It allows you to create bucket "configuration" routes that you can call programmatically with the content you want to reuse in your bucket using the request helpers (`body`, `queryParams`, etc.). +If a data bucket contains [request helpers](docs:templating/mockoon-request-helpers), Mockoon will generate the bucket content only **after the first call** made to a route using this data bucket (by referencing it directly or using a data helper). It allows you to create bucket "configuration" routes that you can call programmatically with the content you want to reuse in your bucket using the request helpers (`body`, `queryParams`, etc.). diff --git a/content/docs/v4.1.0/data-buckets/using-data-buckets.md b/content/docs/v7.0.0/data-buckets/using-data-buckets.md similarity index 91% rename from content/docs/v4.1.0/data-buckets/using-data-buckets.md rename to content/docs/v7.0.0/data-buckets/using-data-buckets.md index b5a700b8..ef7020da 100644 --- a/content/docs/v4.1.0/data-buckets/using-data-buckets.md +++ b/content/docs/v7.0.0/data-buckets/using-data-buckets.md @@ -3,7 +3,7 @@ title: Using data buckets meta: title: Using data buckets description: Learn how to use Mockoon's data buckets, using the two data and dataRaw helpers, or by directly linking the bucket to a route response -order: 951 +order: 610 --- # Using data buckets @@ -30,7 +30,7 @@ Head over to the [data helpers' documentation](docs:templating/mockoon-helpers#d ## Referencing in a route response -A data buckets can also be directly linked to a route response. Linking a data bucket will serve the generated data bucket content "as-is". +A data bucket can also be directly linked to a route response. Linking a data bucket will serve the generated data bucket content "as-is". To link a data bucket to a route response, choose "Data" in the body selector and select your data bucket. diff --git a/content/docs/v4.0.0/gui-cheat-sheet.md b/content/docs/v7.0.0/gui-cheat-sheet.md similarity index 76% rename from content/docs/v4.0.0/gui-cheat-sheet.md rename to content/docs/v7.0.0/gui-cheat-sheet.md index 3ceed543..9fac9be4 100644 --- a/content/docs/v4.0.0/gui-cheat-sheet.md +++ b/content/docs/v7.0.0/gui-cheat-sheet.md @@ -20,7 +20,7 @@ The **main view** (below) contains your environments (or mock API) list, the env ![Mockoon routes view{1200x637}](/images/docs/shared/cheat-sheet/routes-view.png) -The endpoint's responses configuration (below) lets you manage each endpoint responses list and each response parameter: serving a [file](docs:response-body/file-serving), a [body](docs:response-body/overview#body-editor-inline), or a [data bucket](docs:data-buckets/overview), with [rules](docs:route-responses/dynamic-rules) or not, etc. +The endpoint's responses configuration (below) lets you manage each endpoint responses list and each response parameter: serving a [file](docs:response-configuration/file-serving), a [body](docs:response-configuration/response-body#body-editor-inline), or a [data bucket](docs:data-buckets/overview), with [rules](docs:route-responses/dynamic-rules) or not, etc. ![Mockoon responses view{1200x661}](/images/docs/shared/cheat-sheet/responses-view.png) @@ -35,19 +35,19 @@ The [**data buckets**](docs:data-buckets/overview) view let you create and modif ## Environment's requests logs view The **request logging** view is especially useful to debug the entering calls and how Mockoon responded to them. For each, you will find the usual information: path, headers, body, etc. -You can also see if the call has been caught or forwarded through the [proxy](docs:proxy-mode) (if enabled) and [automatically mock](docs:logging-and-recording/auto-mocking-and-recording) entering requests that were not caught. +You can also see if the call has been caught or forwarded through the [proxy](docs:server-configuration/proxy-mode) (if enabled) and [automatically mock](docs:logging-and-recording/auto-mocking-and-recording) entering requests that were not caught. Each environment (or mock API) has its own entering requests recording. ![Mockoon logs view{1200x753}](/images/docs/shared/cheat-sheet/logs-view.png) ## Environment's proxy parameters view -This view allows you to [enable the proxy mode](docs:proxy-mode) and modify its behavior: removing the API prefix, adding specific headers to the proxied server request or response, etc. +This view allows you to [enable the proxy mode](docs:server-configuration/proxy-mode) and modify its behavior: removing the API prefix, adding specific headers to the proxied server request or response, etc. ![Mockoon proxy view{1200x551}](/images/docs/shared/cheat-sheet/proxy-view.png) ## Environment's settings view -This view is the place where you can set up global settings for each environment. Changing the environment name, port, or API prefix, [enabling HTTPS and using a custom certificate](docs:serving-over-tls), [handling OPTIONS pre-flight requests automatically](docs:cors), etc. +This view is the place where you can set up global settings for each environment. Changing the environment name, port, or API prefix, [enabling HTTPS and using a custom certificate](docs:server-configuration/serving-over-tls), [handling OPTIONS pre-flight requests automatically](docs:server-configuration/cors), etc. ![Mockoon settings view{1200x645}](/images/docs/shared/cheat-sheet/settings-view.png) diff --git a/content/docs/v4.0.0/logging-and-recording/auto-mocking-and-recording.md b/content/docs/v7.0.0/logging-and-recording/auto-mocking-and-recording.md similarity index 66% rename from content/docs/v4.0.0/logging-and-recording/auto-mocking-and-recording.md rename to content/docs/v7.0.0/logging-and-recording/auto-mocking-and-recording.md index 58762248..61b0e836 100644 --- a/content/docs/v4.0.0/logging-and-recording/auto-mocking-and-recording.md +++ b/content/docs/v7.0.0/logging-and-recording/auto-mocking-and-recording.md @@ -2,32 +2,32 @@ title: Auto-mocking and recording meta: title: Automatic API mock creation - description: Learn how to automatically mock your API endpoints manually or by recording entering requests -order: 851 + description: Learn how to automatically mock your API endpoints manually or by recording all the entering requests made to an existing API +order: 710 --- # Automatically create mock routes --- -You can automatically create mock routes from HTTP transactions (request/response). This is especially useful when used in pair with the [proxy mode](docs:proxy-mode) to create a mock API from an existing API. +You can automatically create mock routes from HTTP transactions (request/response). This is especially useful when used in pair with the [proxy mode](docs:server-configuration/proxy-mode) to create a mock API from an existing API. ## Manually create a mock from a request Mockoon offers the possibility to automatically create mocks for entering requests. Click on the "plus" icon on a record to create a route containing the same information (headers, body, etc.): -![create a route from a log{1214x632}](docs-img:logs-auto-mocking.png) +![create a route from a log{1214x633}](docs-img:logs-auto-mocking.png) ## Record your API calls Mockoon can also automatically create mock API endpoints every time a request is logged. To activate this feature, click on the "Record" button at the top of the logs view: -![click on the record button{1214x632}](docs-img:logs-start-recording.png) +![click on the record button{1214x633}](docs-img:logs-start-recording.png) You can record in multiple environments at the same time. A red blinking recording icon will appear next to the environment name to indicate that the recording is active: -![recording icon{964x432}](docs-img:logs-recording-in-progress.png) +![recording icon{964x433}](docs-img:logs-recording-in-progress.png) The recording will only create a route once, based on the path and HTTP method. -> The recording mode works best with the [proxy mode](docs:proxy-mode) enabled and intercepting all the entering requests. +> The recording mode works best with the [proxy mode](docs:server-configuration/proxy-mode) enabled and intercepting all the entering requests. diff --git a/content/docs/v4.0.0/logging-and-recording/requests-logging.md b/content/docs/v7.0.0/logging-and-recording/requests-logging.md similarity index 89% rename from content/docs/v4.0.0/logging-and-recording/requests-logging.md rename to content/docs/v7.0.0/logging-and-recording/requests-logging.md index 563befc4..5650ec92 100644 --- a/content/docs/v4.0.0/logging-and-recording/requests-logging.md +++ b/content/docs/v7.0.0/logging-and-recording/requests-logging.md @@ -3,7 +3,7 @@ title: Requests logging meta: title: Mock API requests logging description: Learn how to access requests and responses logs or record your REST API servers calls for easier debugging -order: 850 +order: 700 --- # Requests logging @@ -14,7 +14,7 @@ order: 850 For easier debugging, Mockoon records all entering requests and all the corresponding outgoing responses for each of your mock API. To access an environment's log, click on the "Logs" tab at the top of the window: -![click the logs tab{801x160}](docs-img:open-logs.png) +![click the logs tab{913x160}](docs-img:open-logs.png) ## Logs content @@ -22,21 +22,21 @@ The list shows all intercepted requests and how Mockoon answered to them. Please note that all requests are intercepted, even the `/favicon` request made by the browser. Each record contains the entering request and the outgoing response information. This includes the complete list of headers, route params, query params, and body in raw format. -![view the request{1214x632}](docs-img:logs-request.png) +![view the request{1214x633}](docs-img:logs-request.png) -![view the response{1214x632}](docs-img:logs-response.png) +![view the response{1214x633}](docs-img:logs-response.png) The interface is showing truncated bodies for both the request and the response (the truncation length can be adjusted in the settings). You can still view them in full in a separated editor by clicking on **View full body in editor**: -![click on view full body in editor link{1214x632}](docs-img:logs-view-body.png) +![click on view full body in editor link{1214x633}](docs-img:logs-view-body.png) ![body content is showed in a modal{860x696}](docs-img:logs-view-body-modal.png) ## Logs metadata -You can also easily see if a request has been caught by Mockoon (record shows a green tick) or has been passed to another URL if the [proxy mode](docs:proxy-mode) is activated (record shows a shield icon): +You can also easily see if a request has been caught by Mockoon (record shows a green tick) or has been passed to another URL if the [proxy mode](docs:server-configuration/proxy-mode) is activated (record shows a shield icon): -![view logs metadata{1214x632}](docs-img:logs-metadata.png) +![view logs metadata{1214x633}](docs-img:logs-metadata.png) ## File logging diff --git a/content/docs/v4.0.0/mockoon-data-files/data-storage-location.md b/content/docs/v7.0.0/mockoon-data-files/data-storage-location.md similarity index 69% rename from content/docs/v4.0.0/mockoon-data-files/data-storage-location.md rename to content/docs/v7.0.0/mockoon-data-files/data-storage-location.md index 98b1b034..35d95152 100644 --- a/content/docs/v4.0.0/mockoon-data-files/data-storage-location.md +++ b/content/docs/v7.0.0/mockoon-data-files/data-storage-location.md @@ -3,7 +3,7 @@ title: Data storage location meta: title: Data storage location description: Learn where Mockoon's data storage files and application settings are located and how to move them to other folders -order: 1100 +order: 900 --- # Data storage location @@ -16,17 +16,23 @@ Since [v1.16.0](https://github.com/mockoon/mockoon/releases/tag/v1.16.0), Mockoo You can locate the folder in which the API data are stored by right-clicking on each environment and selecting **"Show data file in explorer/finder"**: -![click on show in folder in the context menu{455x312}](docs-img:environment-show-in-folder.png) +![click on show in folder in the context menu{490x309}](docs-img:environment-show-in-folder.png) ## Moving the files You can move the data files to another folder by right-clicking on an environment and selecting **"Move data file to folder"**: -![click on Move data file to folder in folder in the context menu{455x344}](docs-img:environment-move-to-folder.png) +![click on Move data file to folder in folder in the context menu{490x340}](docs-img:environment-move-to-folder.png) > Please note that the environment file will be copied to the new folder, and the original file will **not** be deleted. If you want to delete the original file, you will have to do it manually. -## Old system +## Enabling data file watching + +Mockoon can monitor data files' external changes and automatically reload the interface with the new information. This is particularly useful when you are editing the data files with an external editor or pulling changes from a git repository. You can activate this option in the settings: + +![enable file monitoring in the settings{860x812}](docs-img:enable-file-watching.png) + +## Old system (pre v1.16.0) Before version 1.16.0, all of your environments were stored in the same `environments.json` file in the **application data folder**. The file was located in your operating system's user folder: @@ -37,3 +43,5 @@ Before version 1.16.0, all of your environments were stored in the same `environ When updating to version 1.16.0, Mockoon automatically migrated the old `environments.json` file (see below) and split it into as many files as you had environments. These files were created in the same `storage` folder with incremental names: `environment-0.json`, `environment-1.json`, etc. ![one file vs multiple files after the migration{600x252}](/images/docs/shared/storage-migration.png) + +> ⚠️ The automatic migration was dropped in [version 5.0.0](/releases/5.0.0/). If you are updating from v1.15.0, please first update to any version between v1.16.0 and v4.1.0, then to v5.0.0. diff --git a/content/docs/v4.0.0/mockoon-data-files/environment-clipboard-copy.md b/content/docs/v7.0.0/mockoon-data-files/environment-clipboard-copy.md similarity index 95% rename from content/docs/v4.0.0/mockoon-data-files/environment-clipboard-copy.md rename to content/docs/v7.0.0/mockoon-data-files/environment-clipboard-copy.md index 58c4dc4e..850e843c 100644 --- a/content/docs/v4.0.0/mockoon-data-files/environment-clipboard-copy.md +++ b/content/docs/v7.0.0/mockoon-data-files/environment-clipboard-copy.md @@ -3,7 +3,7 @@ title: Copy data to the clipboard meta: title: Copy data to the clipboard description: Learn how to easily share your Mockoon's mock API JSON definitions with your team by copying them to the clipboard and importing them in the application -order: 1120 +order: 920 --- # Copy data to the clipboard @@ -14,7 +14,7 @@ order: 1120 To copy a specific environment or route's JSON data to the clipboard, right-click on the environment or route and select **Copy to clipboard (JSON)**: -![Right click on an environment and click on Copy to clipboard (JSON){655x331}](docs-img:export-clipboard-env.png) +![Right click on an environment and click on Copy to clipboard (JSON){690x328}](docs-img:export-clipboard-env.png) The resulting JSON can be saved in a file and directly opened in the desktop app or used with the CLI. diff --git a/content/docs/v4.0.0/mockoon-data-files/settings-and-logs.md b/content/docs/v7.0.0/mockoon-data-files/settings-and-logs.md similarity index 98% rename from content/docs/v4.0.0/mockoon-data-files/settings-and-logs.md rename to content/docs/v7.0.0/mockoon-data-files/settings-and-logs.md index 5ea8ad04..4dc4b640 100644 --- a/content/docs/v4.0.0/mockoon-data-files/settings-and-logs.md +++ b/content/docs/v7.0.0/mockoon-data-files/settings-and-logs.md @@ -3,7 +3,7 @@ title: Settings and logs meta: title: Settings and logs description: Learn where Mockoon's desktop application settings and log files are located for each operating system -order: 1140 +order: 930 --- # Settings and logs diff --git a/content/docs/v4.1.0/mockoon-data-files/sharing-mock-api-files.md b/content/docs/v7.0.0/mockoon-data-files/sharing-mock-api-files.md similarity index 69% rename from content/docs/v4.1.0/mockoon-data-files/sharing-mock-api-files.md rename to content/docs/v7.0.0/mockoon-data-files/sharing-mock-api-files.md index 171e381a..75d1cb43 100644 --- a/content/docs/v4.1.0/mockoon-data-files/sharing-mock-api-files.md +++ b/content/docs/v7.0.0/mockoon-data-files/sharing-mock-api-files.md @@ -3,7 +3,7 @@ title: Sharing your mock API files meta: title: Sharing your mock API files description: Learn how to easily share your mock API files with other mockoon users, or use them with the CLI, and setup a git repository -order: 1110 +order: 910 --- # Sharing your mock API files @@ -14,8 +14,7 @@ order: 1110 ### Sharing a mock API -Each file can be easily shared with other Mockoon's users, "as-is". Since [v1.16.0](https://github.com/mockoon/mockoon/releases/tag/v1.16.0), there is no need to export in Mockoon's format on one computer and re-import on another one (see [legacy export file](docs:mockoon-data-files/import-export-mockoon-format)). -After [locating your environment file](docs:mockoon-data-files/data-storage-location#locating-the-files), you can share it with your coworkers by using Git for example. You coworkers can then save the file in any folder and open it directly using the "Open environment" button: +Each file can be easily shared with other Mockoon's users, "as-is". After [locating your environment file](docs:mockoon-data-files/data-storage-location#locating-the-files), you can share it with your coworkers by using Git for example. You coworkers can then save the file in any folder and open it directly using the "Open environment" button: ![open an environment{449x235}](docs-img:open-environment.png) diff --git a/content/docs/v4.0.0/openapi/import-export-openapi-format.md b/content/docs/v7.0.0/openapi/import-export-openapi-format.md similarity index 99% rename from content/docs/v4.0.0/openapi/import-export-openapi-format.md rename to content/docs/v7.0.0/openapi/import-export-openapi-format.md index 55534df8..ab3b4e37 100644 --- a/content/docs/v4.0.0/openapi/import-export-openapi-format.md +++ b/content/docs/v7.0.0/openapi/import-export-openapi-format.md @@ -3,7 +3,7 @@ title: Import/export in OpenAPI format meta: title: Import/export in OpenAPI format description: Learn how to easily import and export or share with your team your mock API servers and routes using the OpenAPI specification -order: 1050 +order: 800 --- # Import/export in OpenAPI format diff --git a/content/docs/v4.0.0/openapi/openapi-specification-compatibility.md b/content/docs/v7.0.0/openapi/openapi-specification-compatibility.md similarity index 99% rename from content/docs/v4.0.0/openapi/openapi-specification-compatibility.md rename to content/docs/v7.0.0/openapi/openapi-specification-compatibility.md index 4afe8171..34121e93 100644 --- a/content/docs/v4.0.0/openapi/openapi-specification-compatibility.md +++ b/content/docs/v7.0.0/openapi/openapi-specification-compatibility.md @@ -3,7 +3,7 @@ title: OpenAPI specification compatibility meta: title: OpenAPI specification compatibility description: Learn more about Mockoon compatibility with the OpenAPI specification and how to easily share your API definitions with your team -order: 1051 +order: 810 --- # OpenAPI specification compatibility diff --git a/content/docs/v4.1.0/response-body/file-serving.md b/content/docs/v7.0.0/response-configuration/file-serving.md similarity index 79% rename from content/docs/v4.1.0/response-body/file-serving.md rename to content/docs/v7.0.0/response-configuration/file-serving.md index d081e993..4f09517c 100644 --- a/content/docs/v4.1.0/response-body/file-serving.md +++ b/content/docs/v7.0.0/response-configuration/file-serving.md @@ -3,7 +3,7 @@ title: File serving meta: title: Mockoon file serving documentation description: Serve files as body for your mock API, use the templating system and set relative or absolute paths for easier sharing. -order: 810 +order: 420 --- # File serving @@ -24,7 +24,7 @@ To serve a file, you must provide a path in the file input field: You can either provide an absolute path like `/home/username/file.json` or a relative path. Starting with [v1.16.0](https://github.com/mockoon/mockoon/releases/tag/v1.16.0), relative paths are resolved from the environment's file location. You can check the environment's file location by right-clicking on an environment en select "Show in folder" in the contextual menu: -![show in folder menu entry{455x312}](docs-img:environment-show-in-folder.png) +![show in folder menu entry{490x309}](docs-img:environment-show-in-folder.png) > Prior to v1.16.0, relative file paths were resolved from the application executable. This is also supported by the CLI since its version [1.2.0](https://github.com/mockoon/cli/releases/tag/v1.2.0). @@ -55,3 +55,11 @@ By default, Mockoon will return an error in the body when a file is not found. I ![tick the 404 fallback checkbox{1066x231}](docs-img:enable-404-fallback.png) This option will also fall back to use the content present in the body editor. + +## Serving a range of bytes from a file + +Mockoon supports the `Range` header for files that are not parsed by the templating engine or when the templating is disabled on the response (see [above](#file-content-templating)). + +To use this feature, you must provide a `Range` header in your request. The header value must be in the form `bytes=start-end` where `start` and `end` are the byte positions of the file you want to return. For example, `bytes=0-100` will return the first 100 bytes of the file. + +The server will answer with a `206 Partial Content` status code and the `Content-Range` header containing the range of bytes returned. If the range is invalid, the server will answer with a `416 Range Not Satisfiable` status code. diff --git a/content/docs/v4.1.0/response-body/overview.md b/content/docs/v7.0.0/response-configuration/response-body.md similarity index 72% rename from content/docs/v4.1.0/response-body/overview.md rename to content/docs/v7.0.0/response-configuration/response-body.md index 04cb3bd6..31c1c66a 100644 --- a/content/docs/v4.1.0/response-body/overview.md +++ b/content/docs/v7.0.0/response-configuration/response-body.md @@ -1,12 +1,12 @@ --- -title: Overview +title: Body meta: - title: Response body overview + title: Response body description: Learn how to serve different type of bodies with Mockoon, how to use files or databucket to serve realistic dynamic responses -order: 800 +order: 400 --- -# Response body overview +# Response body --- @@ -14,13 +14,13 @@ Each [route response](docs:route-responses/multiple-responses) can serve a diffe You can choose each option using the body selector: -![body type toggle buttons{1264x541}](docs-img:body-type-toggle.png) +![body type toggle buttons{1264x547}](docs-img:body-type-toggle.png) ## Body editor (inline) You can use the body editor to directly create your response content. It supports all the [templating helpers](docs:templating/overview). -![inline body editor{1021x806}](docs-img:inline-body-editor.png) +![inline body editor{1169x800}](docs-img:inline-body-editor.png) > Mockoon will save the content of the inline body editor directly in your [data file](docs:mockoon-data-files/data-storage-location). > Using an external file could improve the performance for large content. @@ -29,14 +29,14 @@ You can use the body editor to directly create your response content. It support You can also choose to serve an external file, using the second option: -![external file linking input{1021x806}](docs-img:body-file-serving.png) +![external file linking input{1169x800}](docs-img:body-file-serving.png) -Please refer to the [file serving documentation](docs:response-body/file-serving) for more information. +Please refer to the [file serving documentation](docs:response-configuration/file-serving) for more information. ## Data bucket You can finally choose to serve the content of a data bucket using the third option: -![data bucket linking select menu{1021x806}](docs-img:body-data-bucket.png) +![data bucket linking select menu{1169x800}](docs-img:body-data-bucket.png) Please refer to the [data bucket documentation](docs:data-buckets/overview) for more information. diff --git a/content/docs/v4.0.0/response-headers.md b/content/docs/v7.0.0/response-configuration/response-headers.md similarity index 99% rename from content/docs/v4.0.0/response-headers.md rename to content/docs/v7.0.0/response-configuration/response-headers.md index 6099b15e..50df4da0 100644 --- a/content/docs/v4.0.0/response-headers.md +++ b/content/docs/v7.0.0/response-configuration/response-headers.md @@ -3,7 +3,7 @@ title: Headers meta: title: Define route and environment response headers description: Mockoon can handle response headers at both environment and route levels for your mock server, learn how -order: 40 +order: 410 --- # Headers diff --git a/content/docs/v4.1.0/xml-support.md b/content/docs/v7.0.0/response-configuration/xml-support.md similarity index 77% rename from content/docs/v4.1.0/xml-support.md rename to content/docs/v7.0.0/response-configuration/xml-support.md index c1b4ac2c..964babb9 100644 --- a/content/docs/v4.1.0/xml-support.md +++ b/content/docs/v7.0.0/response-configuration/xml-support.md @@ -3,7 +3,7 @@ title: XML support meta: title: XML support for entering requests description: Create realistic mock APIs and generate fake data with Mockoon's templating and rules system supporting the XML format -order: 130 +order: 430 --- # XML support @@ -46,4 +46,6 @@ JSON equivalent (compacted): } ``` -> Please refer to [xml-js documentation](https://www.npmjs.com/package/xml-js) for more detail on how the XML is parsed. +> 📘 Please refer to [xml-js documentation](https://www.npmjs.com/package/xml-js) for more detail on how the XML is parsed. + +> 🛠️ Use our [XML to JSON converter](/tools/xml-to-json/) to get a preview of how Mockoon will convert your XML to JSON. You can also use our [XML validator](/tools/xml-validator/) to make sure your XML is valid. diff --git a/content/docs/v4.1.0/route-responses/dynamic-rules.md b/content/docs/v7.0.0/route-responses/dynamic-rules.md similarity index 70% rename from content/docs/v4.1.0/route-responses/dynamic-rules.md rename to content/docs/v7.0.0/route-responses/dynamic-rules.md index 323ba746..745676d0 100644 --- a/content/docs/v4.1.0/route-responses/dynamic-rules.md +++ b/content/docs/v7.0.0/route-responses/dynamic-rules.md @@ -3,7 +3,7 @@ title: Responses rules meta: title: Server different responses based on rules description: Learn how to define multiple route responses for each route and triggered them with rules based on the entering request parameters. -order: 910 +order: 310 --- # Adding response rules @@ -20,19 +20,19 @@ You can define an unlimited number of rules for each route. At each request, Moc To add a new rule to a response, go to the route response's **Rules tab**, click on "Add rule" and fill the fields: -![Click on add and fill the fields{987x311}](docs-img:add-route-response-rule.png) +![Click on add and fill the fields{987x304}](docs-img:add-route-response-rule.png) ### Reordering rules By default, rules are interpreted in the order you added them. You can change their interpretation order by drag and dropping them: -![Drag and drop rules to reorder them{977x323}](docs-img:route-response-rule-reorder.png) +![Drag and drop rules to reorder them{1195x326}](docs-img:route-response-rule-reorder.png) ### Disabling rules You can temporarily disable the rules and serve the default response only. To activate this option, click on the "rules" icon next to the response list: -![Disable rules{1010x244}](docs-img:disable-rules.png) +![Disable rules{1220x244}](docs-img:disable-rules.png) > When this option is active, the default response will be always served and all the rules defined on this route will be ignored. Also, this option cannot be selected in addition to the random or sequential responses. @@ -40,7 +40,7 @@ You can temporarily disable the rules and serve the default response only. To ac Inside a route response, rules are interpreted by default with the OR logical operator. When you have more than one rule in a route response, you can easily switch the operator applied when interpreting the rules, by clicking on the `OR|AND` buttons at the left of the rules: -![Choose the rule operator OR AND{982x221}](docs-img:route-response-rules-operator.png) +![Choose the rule operator OR AND{982x214}](docs-img:route-response-rules-operator.png) Rules have four parts: @@ -52,45 +52,48 @@ Rules have four parts: ### 1. Target -![Rule target{1007x211}](docs-img:route-response-rules-target.png) +![Rule target{1007x204}](docs-img:route-response-rules-target.png) In the dropdown menu you can choose between: - the **body** value (full raw content or one of its properties if request's `Content-Type` is either `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`, `application/xml`, `application/soap+xml` or `text/xml`). +- the value of a **query string field**. - the value of a **header**. - the value of a **cookie**. - the value of a **route parameter**. -- the value of a **query string field**. +- the value of a **global variable**. - the **request number** index starting at 1. ### 2. Property name or path -![Rule property{1007x211}](docs-img:route-response-rules-property.png) +![Rule property{1007x204}](docs-img:route-response-rules-property.png) Depending on the **target**, the way to access properties may be different: - **body**: - keep empty to match against the full raw body content. - - use a path to access one of its properties. The syntax is based on the [object-path library](https://www.npmjs.com/package/object-path) like `users.0.name`. This is compatible with request's bodies of `Content-Type` `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`, `application/xml`, `application/soap+xml` or `text/xml`. Properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. - _Please note that XML bodies are parsed using [xml-js](https://www.npmjs.com/package/xml-js) package. Refer to this [page](docs:xml-support) or the package documentation for more information on how the XML is parsed and how to fetch specific properties._ + - use a path to access one of its properties. Two syntaxes are supported, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. + Fetching object properties is compatible with request's bodies of `Content-Type` `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`, `application/xml`, `application/soap+xml` or `text/xml`. + _Please note that XML bodies are parsed using [xml-js](https://www.npmjs.com/package/xml-js) package. Refer to this [page](docs:response-configuration/xml-support) or the package documentation for more information on how the XML is parsed and how to fetch specific properties._ _Please also note that `multipart/form-data` only supports fields. Uploaded files will be ignored._ +- **query string**: either provide a property name like `filter` or a path if the query string field is an object `filter.primary`. - **headers**: a header name like `Accept` or `Content-Type`. - **cookies**: the cookie name like `Session-id`. - **route param**: a route param name without the colon (":"), `:userId` becoming `userId`. -- **query string**: either provide a property name like `filter` or a path if the query string field is an object `filter.primary`. +- **global variable**: a [global variable](docs:variables/global-variables) name like `myVar`. You can use a path to access one of its properties if the variable is storing arrays or objects. Two syntaxes are supported, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. Examples: `myVar.property.subProperty`, `myVar.property.0.subProperty` or `$.myVar.property`. - **request number**: _nothing has to be provided here for the request number_. -For body and query string, if the property is an array, Mockoon will automatically check in the array if at least one item matches the value. +For **body** and **query string**, if the property is an array, Mockoon will automatically check in the array if at least one item matches the value. ### 3. Invert operator You can invert the **comparison operator** (**!** equals, **!** regex match, etc.) by toggling on the exclamation mark button: -![Rule comparison operator{1007x211}](docs-img:route-response-rules-invert-operator.png) +![Rule comparison operator{1007x204}](docs-img:route-response-rules-invert-operator.png) ### 4. Comparison operator -![Rule comparison operator{1007x211}](docs-img:route-response-rules-comparison-operator.png) +![Rule comparison operator{1007x204}](docs-img:route-response-rules-comparison-operator.png) Multiple comparison operators are available in each rule: @@ -101,7 +104,7 @@ Multiple comparison operators are available in each rule: ### 5. Value -![Rule value{1007x211}](docs-img:route-response-rules-value.png) +![Rule value{1007x204}](docs-img:route-response-rules-value.png) Depending on the comparison operator chosen, **equals** or **regex match**, you can either set a simple text value like "expected value" or any kind of regex. To use a regex, you must write it without the leading and trailing slashes. diff --git a/content/docs/v7.0.0/route-responses/global-routes-with-rules.md b/content/docs/v7.0.0/route-responses/global-routes-with-rules.md new file mode 100644 index 00000000..d48fa9b9 --- /dev/null +++ b/content/docs/v7.0.0/route-responses/global-routes-with-rules.md @@ -0,0 +1,49 @@ +--- +title: Global routes with rules +meta: + title: Define global routes with reusable responses and rules + description: Learn how to define global routes with responses and rules to protect your endpoints. Create reusable responses and rules and apply them to all your routes. +order: 320 +--- + +# Global routes with rules + +--- + +If you want to serve the same responses based on the same rules for all or part of your endpoints, you can create global routes using the **fallback mode** and a **wildcard path**. This is useful if you want to protect all your endpoints by checking if an `Authorization` header is present or if you want to verify that all your requests contain a specific property in their body. + +Three parts are required to create a global route: + +## 1. Create a wildcard route + +To create a global route, you first need to create a new HTTP route that will match all the endpoints you want to protect. To do so, create a new route and select "All methods" in the method dropdown: + +![wildcard route on all methods{599x318}](docs-img:create-wildcard-route.png) + +In this example, the wildcard route is placed above the `GET /users` route, which is important as it will be [evaluated first](docs:api-endpoints/routing#routes-order) and catch all the requests. You can create it first or move it up in the routes list with a drag and drop. + +> 💡 You can also create a wildcard route that only matches a specific method, like `GET` or `POST`, instead of "All methods", if you want to protect all your `POST` endpoints, for example. +> Finally, you can create a wildcard route that matches all the endpoints starting with a specific path, like `/users/*` instead of `/*`. You can use this method to protect all your `/users/something` endpoints but not the `/users` one. + +## 2. Create your global responses and rules + +The second step is to create one or more responses with rules. For example, you can create a response checking that the request contains an `Authorization` header and returning a `401` error if's not present. +To follow this example, use the existing response or create a new one and set the status code to `401`: + +![create response with status code 401{1006x261}](docs-img:response-status-code-401.png) + +Add a new rule to this response by clicking on the "add rule" button and selecting the "Header" rule type. Then, set the rule to check that the `Authorization` header is null as we want to return a `401` error if it is not present: + +![create rule to check that the Authorization header is null{987x304}](docs-img:response-rule-header-null.png) + +> 💡 You can create more responses with associated rules to verify more criteria on the request and serve different responses accordingly (errors, etc.). + +## 3. Activate the fallback mode + +Once your route is created and your responses customized, activate the fallback mode by clicking on the "fallback" icon next to the response list: + +![Activate fallback mode{1264x174}](docs-img:activate-fallback-mode.png) + +This will automatically pass the request to the next route when none of the [responses' rules](docs:route-responses/dynamic-rules) match. + +> 📘 Learn more about the [fallback mode](docs:route-responses/multiple-responses#fallback-mode) in our documentation. diff --git a/content/docs/v4.1.0/route-responses/multiple-responses.md b/content/docs/v7.0.0/route-responses/multiple-responses.md similarity index 75% rename from content/docs/v4.1.0/route-responses/multiple-responses.md rename to content/docs/v7.0.0/route-responses/multiple-responses.md index 6674bd18..a47ff054 100644 --- a/content/docs/v4.1.0/route-responses/multiple-responses.md +++ b/content/docs/v7.0.0/route-responses/multiple-responses.md @@ -3,7 +3,7 @@ title: Multiple route responses meta: title: Define multiple responses for each route description: Multiple responses can be defined for each route with different body, headers and status. Learn how to create them and randomize them. -order: 900 +order: 300 --- # Multiple responses @@ -20,7 +20,7 @@ To **add** a new response to your route, click on the "plus" icon next to the re You can also **duplicate** an existing route response by clicking on the "copy" icon on the right: -![Click on the copy icon to duplicate a response{985x195}](docs-img:duplicate-route-response.png) +![Click on the copy icon to duplicate a response{1185x195}](docs-img:duplicate-route-response.png) Everything will be copied to the new response: documentation, file/body, headers and rules. @@ -28,13 +28,13 @@ Everything will be copied to the new response: documentation, file/body, headers Route responses order define the order in which the [rules are interpreted](docs:route-responses/dynamic-rules). You can easily change the default response by reordering the responses menu with a drag and drop: -![Reorder route responses{968x221}](docs-img:reorder-responses.png) +![Reorder route responses{968x214}](docs-img:reorder-responses.png) ## Default route response Without rules or when a request does not match the one you defined, the default response will always be the one marked with the blue flag. You can easily change the default response by clicking on the grey flags in the menu: -![Define a new default route response{1033x216}](docs-img:change-route-responses-default.png) +![Define a new default route response{1183x216}](docs-img:change-route-responses-default.png) ## Random route response @@ -42,7 +42,7 @@ Mockoon can serve the route responses randomly (200, 500, 404) to simulate an un To activate this option, click on the "shuffle" icon next to the response list: -![Random route responses{1032x174}](docs-img:random-route-responses.png) +![Random route responses{1232x174}](docs-img:random-route-responses.png) > ⚠️ When this option is active, the [default response](#default-route-response) and all the rules defined on this route will be ignored. Also, this option cannot be selected in addition to the sequential responses option below. @@ -52,23 +52,25 @@ Mockoon can serve the route responses sequentially (200 → 500 → 404). Mockoo To activate this option, click on the "repeat" icon next to the response list: -![Sequential route responses{1021x174}](docs-img:sequential-route-responses.png) +![Sequential route responses{1221x174}](docs-img:sequential-route-responses.png) > ⚠️ When this option is active, the [default response](#default-route-response) and all the rules defined on this route will be ignored. Also, this option cannot be selected in addition to the random responses option above. ## Fallback mode -When the **fallback mode** is enabled, Mockoon will automatically pass the request to the proxy (or the next route, see below) when none of the responses' rules match. +When the **fallback mode** is enabled, Mockoon will automatically pass the request to the proxy (or the next route, see below) when none of the [responses' rules](docs:route-responses/dynamic-rules) match. To activate this option, click on the "fallback" icon next to the response list: -![fallback mode responses{979x174}](docs-img:fallback-mode-responses.png) +![fallback mode responses{1199x174}](docs-img:fallback-mode-responses.png) -Behind the scene, the server will automatically jump to the next route and, ultimately, the proxied server. It allows to create more complex setups where a wildcard or parameterized route's rules would not match, but the next route would catch the call (according to the [order of the routes](docs:api-endpoints/routing#routes-order)): +Behind the scene, the server will automatically jump to the next route in the [order](docs:api-endpoints/routing#routes-order) they were declared and, ultimately, to the proxied server. It allows to create complex setups where a wildcard or parameterized route contains rules to protect the access to other routes: ``` -GET /users/:id --> no rule matches -GET /users --> served +GET /users/* --> Authorization header required +GET /users/:id --> No rules ``` +> 💡 Header over to our ["Global routes with rules"](docs:route-responses/global-routes-with-rules) documentation section to learn more about this feature. + > ⚠️ When this option is active, the [default response](#default-route-response) will be ignored. Also, this option cannot be selected in addition to the other response options above and could result in a 404 if the proxy is not enabled. diff --git a/content/docs/v4.1.0/cors.md b/content/docs/v7.0.0/server-configuration/cors.md similarity index 90% rename from content/docs/v4.1.0/cors.md rename to content/docs/v7.0.0/server-configuration/cors.md index 860c5129..6c243937 100644 --- a/content/docs/v4.1.0/cors.md +++ b/content/docs/v7.0.0/server-configuration/cors.md @@ -3,7 +3,7 @@ title: CORS meta: title: Automatic handling of CORS preflight OPTIONS requests description: Front-end application and your JSON mock API are not on the same domain? Handle preflight OPTIONS requests automatically with Mockoon -order: 110 +order: 130 --- # CORS @@ -18,11 +18,11 @@ For your application to work, you can make Mockoon automatically answer to these Open the **Environment Settings** by clicking on the tab at the top of the window: -![click on the settings tab{1034x160}](docs-img:open-environment-settings.png) +![click on the settings tab{1148x160}](docs-img:open-environment-settings.png) Enable the **Automatically handle OPTIONS pre-flight requests ** by ticking the checkbox: -![tick the CORS checkbox{1061x537}](docs-img:enable-cors.png) +![tick the CORS checkbox{1048x509}](docs-img:enable-cors.png) You need to restart the environment for the change to take effect. @@ -50,4 +50,4 @@ Then, click on the **Add CORS headers** link: The above headers will be automatically added to your list of headers: -![view cors headers in the list{1264x233}](docs-img:view-cors-headers.png) +![view cors headers in the list{1264x237}](docs-img:view-cors-headers.png) diff --git a/content/docs/v4.1.0/listening-hostname.md b/content/docs/v7.0.0/server-configuration/listening-hostname.md similarity index 68% rename from content/docs/v4.1.0/listening-hostname.md rename to content/docs/v7.0.0/server-configuration/listening-hostname.md index c071e7b9..c7042e8c 100644 --- a/content/docs/v4.1.0/listening-hostname.md +++ b/content/docs/v7.0.0/server-configuration/listening-hostname.md @@ -3,7 +3,7 @@ title: Listening hostname/adapter meta: title: Listening hostname or adapter description: Learn how you can customize the hostname or network adapter your mock API will listen to in the desktop application or the CLI -order: 120 +order: 140 --- # Listening hostname/adapter @@ -14,12 +14,12 @@ By default, Mockoon's mock APIs will listen to all available network adapters on To configure each environment to listen on a specific hostname, open the **Environment Settings** by clicking on the tab at the top of the window: -![click on the settings tab{1034x160}](docs-img:open-environment-settings.png) +![click on the settings tab{1148x160}](docs-img:open-environment-settings.png) Add a **custom hostname** in the input field: ![field to set a custom hostname{1264x213}](docs-img:custom-hostname-setting.png) -> You may need to restart your environment for the change to take effect. +> ⚠️ You may need to restart your environment for the change to take effect. -> When using the CLI, you can choose a specific adapter to listen to (e.g. `192.168.1.1`) by using the `--hostname` flag with the [`start` command](https://github.com/mockoon/mockoon/tree/main/packages/cli#mockoon-cli-start). +> 💡 When using the CLI, you can choose a specific adapter to listen to (e.g. `192.168.1.1`) by using the `--hostname` flag with the [`start` command](https://github.com/mockoon/mockoon/tree/main/packages/cli#mockoon-cli-start). diff --git a/content/docs/v7.0.0/server-configuration/port-prefix.md b/content/docs/v7.0.0/server-configuration/port-prefix.md new file mode 100644 index 00000000..36025d2e --- /dev/null +++ b/content/docs/v7.0.0/server-configuration/port-prefix.md @@ -0,0 +1,25 @@ +--- +title: Port and prefix +meta: + title: Change port and API prefix + description: Learn how you can customize the localhost port and API prefix of your mock server. +order: 100 +--- + +# Port and prefix + +--- + +By default, Mockoon's new environments will listen on port `3000` and will have **no API prefix**. If you have multiple environments already opened, Mockoon will automatically increment the port number for each new environment. + +You can change the **port number** and the **API prefix** in the **Environment Settings** by clicking on the tab at the top of the window: + +![click on the settings tab{871x160}](docs-img:open-environment-settings.png) + +Then, change the port number and/or the API prefix in the corresponding input fields: + +![field to set a custom port{583x298}](docs-img:environment-custom-port.png) + +![field to set a custom prefix{993x298}](docs-img:environment-custom-prefix.png) + +> 💡 The API prefix can contain multiple sections (e.g. `/api/v1/`) and will be applied to all your routes. diff --git a/content/docs/v4.1.0/proxy-mode.md b/content/docs/v7.0.0/server-configuration/proxy-mode.md similarity index 85% rename from content/docs/v4.1.0/proxy-mode.md rename to content/docs/v7.0.0/server-configuration/proxy-mode.md index 29c41f58..46175ff2 100644 --- a/content/docs/v4.1.0/proxy-mode.md +++ b/content/docs/v7.0.0/server-configuration/proxy-mode.md @@ -3,7 +3,7 @@ title: Partial mocking with proxy mode meta: title: Partial API mocking with proxy mode description: Learn how to create a mock REST API to intercept traffic and proxy requests to another JSON REST server with Mockoon -order: 80 +order: 110 --- # Proxy mode @@ -16,11 +16,11 @@ Mockoon supports partial mocking of an API endpoints by forwarding the requests To activate the proxy mode, open the **Environment Proxy** options by clicking on the tab at the top of the window: -![click on proxy tab{887x160}](docs-img:open-proxy-options.png) +![click on proxy tab{998x160}](docs-img:open-proxy-options.png) Enable the proxy mode by checking the box and enter the server URL to which you want to forward the calls. A small shield icon should appear on the right of your environment name indicating that the proxy mode has been enabled: -![tick the Proxy checkbox{1264x274}](docs-img:enable-proxy.png) +![tick the Proxy checkbox{1264x277}](docs-img:enable-proxy.png) From now on, all routes that have been defined in Mockoon will be intercepted, and any other request not matching any route path will be forwarded to the server URL you entered in the proxy mode setting. @@ -28,12 +28,12 @@ From now on, all routes that have been defined in Mockoon will be intercepted, a By default, the API prefix will be part of the path called on the proxied API. You can disable this behavior by ticking the "Remove prefix" checkbox: -![tick the Proxy no prefix forward checkbox{699x306}](docs-img:proxy-no-forward.png) +![tick the Proxy no prefix forward checkbox{696x320}](docs-img:proxy-no-forward.png) ## Proxy headers Proxy specific headers can also be added, both to the forwarded request and the response received from the target API. -![add proxy headers by filling the keys and values{1264x360}](docs-img:proxy-headers.png) +![add proxy headers by filling the keys and values{1264x379}](docs-img:proxy-headers.png) > **Proxy request headers** will be automatically added to the request sent to the proxied server, while **proxy response headers** are added to the response received from the proxied server. diff --git a/content/docs/v4.0.0/serving-over-tls.md b/content/docs/v7.0.0/server-configuration/serving-over-tls.md similarity index 89% rename from content/docs/v4.0.0/serving-over-tls.md rename to content/docs/v7.0.0/server-configuration/serving-over-tls.md index bb071d7d..52fcf79e 100644 --- a/content/docs/v4.0.0/serving-over-tls.md +++ b/content/docs/v7.0.0/server-configuration/serving-over-tls.md @@ -3,7 +3,7 @@ title: TLS meta: title: Serve a mock API over TLS description: Need to mock a secured REST API server? Mockoon can also do this by serving over TLS with a self-signed certificate -order: 100 +order: 120 --- # TLS @@ -16,11 +16,11 @@ Mockoon supports serving your mock API over TLS with a self-signed certificate b You can activate the TLSoption for each environment independently. Open the **Environment Settings** by clicking on the tab at the top of the window: -![click on the settings tab{1034x160}](docs-img:open-environment-settings.png) +![click on the settings tab{1148x160}](docs-img:open-environment-settings.png) Enable the **TLS option** by ticking the checkbox. The option was successfully activated if a yellow lock is displayed next to the environment name. -![tick the TLS checkbox{807x343}](docs-img:enable-tls.png) +![tick the TLS checkbox{804x343}](docs-img:enable-tls.png) > You may need to restart your environment for the change to take effect. @@ -32,7 +32,7 @@ Please note that Mockoon is using a self-signed certificate to serve your enviro You can also provide your certificate in both PKCS12 or PEM formats by filling out the input fields with the path to the file(s). -![add certificate path{1264x590}](docs-img:enable-tls-custom-certificate.png) +![add certificate path{1264x612}](docs-img:enable-tls-custom-certificate.png) Mockoon also supports passphrase-protected keys and custom-trusted CA certificates. As Mockoon is using Node.js' `tls`, you can refer to the [`tls.createSecureContext()` documentation](https://nodejs.org/dist/latest-v16.x/docs/api/tls.html#tlscreatesecurecontextoptions) for a full description of the available options. diff --git a/content/docs/v7.0.0/templating/fakerjs-helpers.md b/content/docs/v7.0.0/templating/fakerjs-helpers.md new file mode 100644 index 00000000..0c6785d4 --- /dev/null +++ b/content/docs/v7.0.0/templating/fakerjs-helpers.md @@ -0,0 +1,64 @@ +--- +title: Faker.js helpers +meta: + title: Create dynamic responses with templating Faker.js helpers + description: Create realistic mock data for your mock API servers with Mockoon's templating system including Faker.js +order: 504 +--- + +# Faker.js helpers + +--- + +Mockoon implements [Faker.js v8.1.0](https://fakerjs.dev/) library by wrapping most of the available helpers. +Faker.js offers lots of helpers: `location.zipCode`, `location.city`, `location.count`, `person.firstName`, `person.lastName`, `number.int`, `number.float`, `internet.avatar`, `internet.email`, etc. Please have a look at [Faker.js documentation](https://fakerjs.dev/) to learn how to use them. + +## Usage + +All Faker.js helpers must be used with the following syntax: `{{faker 'namespace.method'}}`. +**Examples:** + +```js +{{faker 'location.zipCode'}} +{{faker 'location.city'}} +{{faker 'location.county'}} +{{faker 'person.firstName'}} +... +``` + +Faker.js methods may use two different ways of passing parameters: **ordered arguments** or **option object** (with eventually a depth > 1). Wrapped in a Handlebars helper, this may result in different syntaxes: + +- **Ordered arguments**: `{{faker 'namespace.method' arg1 arg2 arg3}}` + +```handlebars +{{faker 'number.int' 100}} + +{{faker 'string.alphanumeric' 25}} +``` + +- **Option object** with **named parameters**: `{{faker 'namespace.method' arg1='value1' arg2='value2'}}` will be translated to an option object `{ arg1: 'value1', arg2: 'value2' }` + +```handlebars +{{faker 'number.int' min=10 max=100}} +{{faker 'string.alphanumeric' casing='mixed' length=50}} +``` + +- **Option object** with **named parameters** and **depth > 1**: `{{faker 'namespace.method' '{arg1: "value1", arg2: { prop1: "value2"}}'}}` will be translated to a complex option object `{ arg1: 'value1', arg2: { prop1: 'value2' } }`. Be sure to **escape** the single or double quotes inside your option string accordingly. + +```handlebars +{{faker 'number.int' '{min: 10, max: 100}'}} +{{faker 'string.alphanumeric' '{casing: "lower", length: { min: 1, max: 3}}'}} +``` + +> 📘 Please check Faker.js documentation to know which syntax to use for each helper. + +## Set Faker.js' locale and seed + +Faker.js locale and seed can be defined in the application settings: + +![fakerjs settings{860x812}](docs-img:settings-faker.png) + +The locale and seed can also be set when running your mock using the [CLI's flags](https://github.com/mockoon/mockoon/blob/main/packages/cli/README.md#fakerjs-options) or the [serverless package options](https://github.com/mockoon/mockoon/blob/main/packages/serverless/README.md#options). + +> 📝**A note on Faker.js seeding** +> By providing a seed value, you can generate repeatable **sequences** of fake data. Using seeding will not always generate the same value but rather a predictable sequence. diff --git a/content/docs/v4.1.0/templating/mockoon-helpers.md b/content/docs/v7.0.0/templating/mockoon-helpers.md similarity index 80% rename from content/docs/v4.1.0/templating/mockoon-helpers.md rename to content/docs/v7.0.0/templating/mockoon-helpers.md index 6f540073..9918077a 100644 --- a/content/docs/v4.1.0/templating/mockoon-helpers.md +++ b/content/docs/v7.0.0/templating/mockoon-helpers.md @@ -1,9 +1,9 @@ --- -title: Helpers +title: Custom helpers meta: title: Create dynamic responses with templating helpers description: "Create dynamic fake data for your mock server with Mockoon's templating helpers. All formats are supported: JSON, CSV, HTML, etc." -order: 1010 +order: 501 --- # Mockoon templating helpers @@ -27,24 +27,25 @@ In addition to Handlebars' built-in helpers, Mockoon offers the following helper | [`len`](#len) | | | [`filter`](#filter) | | -| Math | | Variables | -| ----------------------- | --------------------- | ------------------- | -| [`add`](#add) | [`eq`](#eq) | [`setVar`](#setvar) | -| [`subtract`](#subtract) | [`gt`](#gt) | [`getVar`](#getvar) | -| [`multiply`](#multiply) | [`gte`](#gte) | | -| [`divide`](#divide) | [`lt`](#lt) | | -| [`modulo`](#modulo) | [`lte`](#lte) | | -| [`ceil`](#ceil) | [`toFixed`](#tofixed) | | -| [`floor`](#floor) | [`round`](#round) | | +| Math | | +| ----------------------- | --------------------- | +| [`add`](#add) | [`eq`](#eq) | +| [`subtract`](#subtract) | [`gt`](#gt) | +| [`multiply`](#multiply) | [`gte`](#gte) | +| [`divide`](#divide) | [`lt`](#lt) | +| [`modulo`](#modulo) | [`lte`](#lte) | +| [`ceil`](#ceil) | [`toFixed`](#tofixed) | +| [`floor`](#floor) | [`round`](#round) | | Strings | | Dates | Misc | -| ------------------------- |-------------------------| --------------------------------- | ------------------------------- | +| ------------------------- | ----------------------- | --------------------------------- | ------------------------------- | | [`includes`](#includes) | [`concat`](#concat) | [`now`](#now) | [`newline`](#newline) | | [`substr`](#substr) | [`indexOf`](#indexof) | [`dateTimeShift`](#datetimeshift) | [`base64`](#base64) | | [`lowercase`](#lowercase) | [`parseInt`](#parseint) | [`date`](#date) | [`base64Decode`](#base64decode) | | [`uppercase`](#uppercase) | [`padStart`](#padstart) | [`time`](#time) | [`objectId`](#objectid) | | [`split`](#split) | [`padEnd`](#padend) | [`dateFormat`](#dateformat) | | | [`stringify`](#stringify) | [`eq`](#eq) | | | +| [`jsonParse`](#jsonparse) | | | | | [Faker.js](docs:templating/fakerjs-helpers) aliases | | | | --------------------------------------------------- | ----------------------------- | ----------------------- | @@ -59,7 +60,7 @@ In addition to Handlebars' built-in helpers, Mockoon offers the following helper | [`tld`](#tld) | [`phone`](#phone) | | | [`email`](#email) | [`color`](#color) | | -## `repeat` +## repeat Repeat the block content a random number of times if two arguments are provided, or a fixed amount of time if only one argument is provided. Set the `comma` parameter to `false` (default to `true`) to prevent the insertion of new lines and commas by the helper. @@ -83,7 +84,7 @@ test, test --> ``` -## `switch` +## switch Select some content depending on a variable. Behaves like a regular switch. @@ -101,59 +102,69 @@ Select some content depending on a variable. Behaves like a regular switch. {{/switch}} ``` -## `data` +## data Get the **stringified** value at a given `path` from a [data bucket](docs:data-buckets/overview) selected by **ID or name**. This helper is designed to retrieve data to be served in a response. To reuse the retrieved data with other helpers (`each`, `if`, etc.), use the [`dataRaw` helper](#dataraw) below. -- The `path` takes the following form `key.0.key.5.key` and is based on the [**object-path** library](https://www.npmjs.com/package/object-path). Properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. +- The `path` supports two syntaxes, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. Please note that a value can be retrieved at the path if the data bucket contains valid JSON. - Full objects or arrays can be retrieved by the helper and will be stringified. - The full data bucket content can be fetched when the `path` is omitted (`{{data 'ID'}}`). | Arguments (ordered) | Type | Description | | ------------------- | ------ | -------------------------------- | -| 0 | string | ID or name of the daa bucket | +| 0 | string | ID or name of the data bucket | | 1 | string | Path to the data bucket property | **Examples** ```handlebars -{{data 'abcd'}} -{{data 'abcd' 'path.to.property'}} -{{data 'abcd' 'deep.property\.with\.dot'}} +{{data 'bucketNameOrId'}} + + +{{data 'bucketNameOrId' 'path.to.property'}} +{{data 'bucketNameOrId' 'deep.property\.with\.dot'}} + + +{{data 'bucketNameOrId' '$.array.[*].property'}} ``` -## `dataRaw` +## dataRaw Get the **raw** value (array, object, etc.) at a given `path` from a [data bucket](docs:data-buckets/overview) selected by **ID or name**. This "raw" helper is designed to work with other helpers (`each`, `if`, etc.). To directly use the retrieved data in the response, use [data buckets direct linking](docs:data-buckets/using-data-buckets#referencing-in-a-route-response) or the [`data` helper](#data) above. -- The `path` takes the following form `key.0.key.5.key` and is based on the [**object-path** library](https://www.npmjs.com/package/object-path). Properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. +- The `path` supports two syntaxes, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. Please note that a value can be retrieved at the path if the data bucket contains valid JSON. - Primitives and data structures can be retrieved by the helper and reused in other helpers (see example below). - The full data bucket content (array, object, etc.) can be fetched when the `path` is omitted (`{{dataRaw 'ID'}}`). | Arguments (ordered) | Type | Description | | ------------------- | ------ | -------------------------------- | -| 0 | string | ID or name of the daa bucket | +| 0 | string | ID or name of the data bucket | | 1 | string | Path to the data bucket property | **Examples** ```handlebars -{{dataRaw 'abcd'}} -{{dataRaw 'abcd' 'path.to.property'}} -{{dataRaw 'abcd' 'deep.property\.with\.dot'}} +{{dataRaw 'bucketNameOrId'}} + + +{{dataRaw 'bucketNameOrId' 'path.to.property'}} +{{dataRaw 'bucketNameOrId' 'deep.property\.with\.dot'}} + + +{{dataRaw 'bucketNameOrId' '$.array.[*].property'}} -{{#each (dataRaw 'path.to.array.property')}} +{{#each (dataRaw 'bucketNameOrId' 'path.to.array.property')}} value {{/each}} -{{#if (dataRaw 'path.to.boolean.property')}} +{{#if (dataRaw 'bucketNameOrId' 'path.to.boolean.property')}} value {{/if}} ``` -## `array` +## array Create an array from the given items. This helper is mostly used with the following helpers: `oneOf`, `someOf`. @@ -167,7 +178,7 @@ Create an array from the given items. This helper is mostly used with the follow {{array 'item1' 'item2' 'item3'}} ``` -## `oneOf` +## oneOf Select a random item in the array passed in parameters. `oneOf` will return the actual value in the array. Set the `stringify` parameter to `true` (default to `false`) to get a JSON stringified result. @@ -183,16 +194,16 @@ Select a random item in the array passed in parameters. `oneOf` will return the result: item2 ``` -## `someOf` +## someOf -Return a random number of items from the array passed in parameters, concatenated as a string. Use it with triple curly braces to get a JSON representation. +Return an array containing a random number of items from the array passed in parameters, eventually stringified. Use it with triple curly braces to get a non-escaped JSON representation. | Arguments (ordered) | Type | Description | | ------------------- | ------- | ----------------------- | | 0 | any[] | Array of values | | 1 | number | Minimum number of items | | 2 | number | Maximum number of items | -| [3 = false] | boolean | Get result as an array | +| [3 = false] | boolean | Stringify the result | **Examples** @@ -200,12 +211,12 @@ Return a random number of items from the array passed in parameters, concatenate {{someOf (array 'item1' 'item2' 'item3') 1 2}} result: item1,item2 - + {{{someOf (array 'item1' 'item2' 'item3') x y true}}} -result: item1,item2 +result: ["item1","item2"] ``` -## `join` +## join Return a new string by concatenating all the elements in an array. @@ -221,7 +232,7 @@ Return a new string by concatenating all the elements in an array. result: item1#item2#item3 ``` -## `slice` +## slice Return a copy of a portion of an array from start to end indexes (not included). @@ -238,7 +249,7 @@ Return a copy of a portion of an array from start to end indexes (not included). result: ['item1', 'item2'] ``` -## `len` +## len Return an array or string length. @@ -256,7 +267,7 @@ result: 3 result: 5 ``` -## `filter` +## filter Return a filtered array. This helper can be used with data buckets, use the [dataRaw](#dataraw) for that. @@ -304,43 +315,26 @@ results: items that fit to (a1 AND a2 AND (x1 OR x2) ) OR (b1 AND b2 AND b3) result: 1,3 -{{filter - (array 'item1' 'item2' 'item3' 'item4' 'item3') - 'item1' - 'item2' - 'item3' -}} +{{filter (array 'item1' 'item2' 'item3' 'item4' 'item3') 'item1' 'item2' 'item3'}} result: item1,item2,item3,item3 {{filter (dataRaw 'Users') (object type='item1')}} -{{filter - (dataRaw 'Users') - (object type='item1') - (object type='item2') - (object type='item3') -}} +{{filter (dataRaw 'Users') (object type='item1') (object type='item2') (object type='item3')}} {{filter (dataRaw 'Users') (object type='item1' category='some-category')}} -{{filter - (dataRaw 'Users') - (array (object type='item1') (object category='some-category')) -}} +{{filter (dataRaw 'Users') (array (object type='item1') (object category='some-category'))}} -{{filter - (array 'item1' 'item2' (object type='type1') (object type='type2')) - 'item1' - (object type='type2') -}} +{{filter (array 'item1' 'item2' (object type='type1') (object type='type2')) 'item1' (object type='type2')}} ``` -## `object` +## object Return an object that can be used in other helpers. @@ -367,7 +361,7 @@ result: {type: [1,2,3]} result: {type: [1,3]} ``` -## `add` +## add Add the numbers passed as parameters to each others. Unrecognized strings passed as arguments will be ignored. @@ -388,7 +382,7 @@ result: '2' result: '2' ``` -## `subtract` +## subtract Subtract the numbers passed as parameters to the first parameter. Unrecognized strings passed as arguments will be ignored. @@ -409,7 +403,7 @@ result: '1' result: '1' ``` -## `multiply` +## multiply Multiply the numbers passed as parameters to each others. Unrecognized strings passed as arguments will be ignored. @@ -430,7 +424,7 @@ result: '6' result: '6' ``` -## `divide` +## divide Divide the first parameter by the other numbers passed as parameters. Unrecognized strings passed as arguments will be ignored. @@ -451,7 +445,7 @@ result: '2' result: '2' ``` -## `modulo` +## modulo Compute the modulo of the first parameter by the second. @@ -473,7 +467,7 @@ result: '1' result: '1' ``` -## `ceil` +## ceil Ceil the value of the number passed as parameter. @@ -491,7 +485,7 @@ result: '2' result: '2' ``` -## `floor` +## floor Floor the value of the number passed as parameter. @@ -509,38 +503,38 @@ result: '2' result: '2' ``` -## `eq` +## eq Verify if two numbers or strings are equal. Returns a boolean. -Returns false if type of the value not equals. +Returns false if type of the value not equals. | Arguments (ordered) | Type | Description | -| ------------------- |------------------|-------------------------| +| ------------------- | ---------------- | ----------------------- | | 0 | string \| number | First number or string | | 1 | string \| number | Second number or string | **Examples** ```handlebars -{{#if (eq 55 55) }} +{{#if (eq 55 55)}} true {{/if}} Result: true -{{#if (eq 55 '55') }} - true +{{#if (eq 55 '55')}} + true {{else}} - false + false {{/if}} Result: false -{{#if (eq "x1" "x1") }} - true +{{#if (eq 'x1' 'x1')}} + true {{/if}} Result: true ``` -## `gt` +## gt Verify if the first number is greater than the second number. Returns a boolean. @@ -558,7 +552,7 @@ Verify if the first number is greater than the second number. Returns a boolean. Result: true ``` -## `gte` +## gte Verify if the first number is greater than or equal to the second number. Returns a boolean. @@ -576,7 +570,7 @@ Verify if the first number is greater than or equal to the second number. Return Result: true ``` -## `lt` +## lt Verify if the first number is lower than the second number. Returns a boolean. @@ -594,7 +588,7 @@ Verify if the first number is lower than the second number. Returns a boolean. Result: true ``` -## `lte` +## lte Verify if the first number is lower than or equal to the second number. Returns a boolean. @@ -612,7 +606,7 @@ Verify if the first number is lower than or equal to the second number. Returns Result: true ``` -## `toFixed` +## toFixed Format a number using fixed-point notation. @@ -628,7 +622,7 @@ Format a number using fixed-point notation. Result: 1.11 ``` -## `round` +## round Return the value of a number rounded to the nearest integer. @@ -643,7 +637,7 @@ Return the value of a number rounded to the nearest integer. Result: 0 ``` -## `newline` +## newline Add a newline `\n`. @@ -653,7 +647,7 @@ Add a newline `\n`. {{newline}} ``` -## `base64` +## base64 Encode the parameter as base64. This can be used as an inline helper or block helper (see examples below). @@ -669,14 +663,14 @@ Encode the parameter as base64. This can be used as an inline helper or block he {{#base64}} firstname,lastname,countryCode {{#repeat 10}} - {{faker 'name.firstName'}},{{faker 'name.lastName'}},{{faker - 'address.countryCode' - }} + {{faker 'person.firstName'}},{{faker 'person.lastName'}},{{faker 'address.countryCode'}} {{/repeat}} {{/base64}} ``` -## `base64Decode` +> 🛠️ Use our online [base64 encoder/decoder](/tools/base64-encode-decode/) to get a preview of the encoded content and validate a base64 string. + +## base64Decode Decode a base64 string. This can be used as an inline helper or block helper (see examples below). @@ -694,7 +688,9 @@ Decode a base64 string. This can be used as an inline helper or block helper (se {{/base64Decode}} ``` -## `objectId` +> 🛠️ Use our online [base64 encoder/decoder](/tools/base64-encode-decode/) to get a preview of the encoded content and validate a base64 string. + +## objectId Create a valid ObjectId. It can generates the ObjectId based on the specified time (in seconds) or from a 12 byte string that will act as a seed. Syntax is based on [bson-objectid package](https://www.npmjs.com/package/bson-objectid). @@ -709,58 +705,7 @@ Create a valid ObjectId. It can generates the ObjectId based on the specified ti {{objectId '54495ad94c934721ede76d90'}} ``` -## `setVar` - -Set a variable to be used later in the template. The value can be the result of another helper. To use it elsewhere in the template, refer to the variable with its name prefixed with an `@`: `{{@varname}}`. The variable can also be used as a helper parameter: `{{#repeat @varname}}...{{/repeat}}`. -Variables declared in a block helper will be scoped to the block and unavailable outside. - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | -------------- | -| 0 | string | Variable name | -| 1 | any | Variable value | - -**Examples** - -```handlebars -{{setVar 'varname' 'value'}} -{{setVar 'varname' (body 'id')}} - -usage: -{{@varname}} -{{#repeat @varname}}...{{/repeat}} - -declare a variable in a block helper: -{{#repeat 5}} - {{setVar 'random' (oneOf (array '1' '2' '3'))}} - {{@random}} -{{/repeat}} - -{{setVar 'myArray' (array '1' '2' '3')}} -{{#each @myArray}} - {{setVar 'eachIndex' @index}} - {{@eachIndex}} -{{/repeat}} -``` - -## `getVar` - -Dynamically get a variable set with [`setVar`](#setvar). - -| Arguments (ordered) | Type | Description | -| ------------------- | ------ | ------------- | -| 0 | string | Variable name | - -**Examples** - -```handlebars -{{setVar 'varname' 'value'}} - -{{getVar 'varname'}} -{{getVar (concat 'var' 'name')}} -{{getVar (body 'property')}} -``` - -## `includes` +## includes Search whether a string can be found in another string and returns the appropriate boolean. @@ -777,7 +722,7 @@ Search whether a string can be found in another string and returns the appropria result: true ``` -## `substr` +## substr Return a portion of a string starting at the specified index and extending for a given number of characters afterwards. @@ -794,7 +739,7 @@ Return a portion of a string starting at the specified index and extending for a result: 'data' ``` -## `lowercase` +## lowercase Return the first string parameter lowercased. @@ -810,7 +755,7 @@ Return the first string parameter lowercased. result: 'abcd' ``` -## `uppercase` +## uppercase Return the first string parameter uppercased. @@ -826,7 +771,7 @@ Return the first string parameter uppercased. result: 'ABCD' ``` -## `split` +## split Split a string and return an array containing the multiples substrings. This helper can be used within handlebars' iterative helpers such as `each`. (Default separator is " ") @@ -849,9 +794,9 @@ result: item1,item2,item3,item4 result: This,is,my,string, ``` -## `stringify` +## stringify -Return objects and arrays as a formatted JSON string indented with two spaces. +Return objects and arrays as a formatted JSON string indented with two spaces. This helper requires to be used with triple curly braces (`{{{stringify ...}}}`) to avoid escaping of the JSON string by Handlebars. | Arguments (ordered) | Type | Description | | ------------------- | ---- | --------------- | @@ -880,7 +825,37 @@ Considering an entering body: } ``` -## `concat` +## jsonParse + +Parse a valid JSON string. The result can be used with other helpers like `each`, `if`, `oneOf`, `lookup`, etc. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | -------------------------- | +| 0 | string | Valid JSON string to parse | + +**Examples** + +```handlebars +{{#if (jsonParse 'true')}} + value +{{/if}} + +{{#if (eq (jsonParse '25') 25)}} + value +{{/if}} + +{{oneOf (jsonParse '[5, 56, 98]')}} +result: 5 or 56 or 98 + +{{lookup (jsonParse '{"data":"test"}') 'data'}} +result: test + + +{{lookup (jsonParse (queryParam 'json')) 'data'}} +result: test +``` + +## concat Concatenate multiple strings/numbers together. This helper can concatenate results from other helpers, or be used as a parameter of another helper (see examples below). @@ -896,7 +871,7 @@ Concatenate multiple strings/numbers together. This helper can concatenate resul {{#repeat (concat 1 2 3)}}...{{/repeat}} ``` -## `indexOf` +## indexOf Return the index of the searched 'data' inside the string. A last parameter (number) can be passed to start the search at a specific index. @@ -914,7 +889,7 @@ Return the index of the searched 'data' inside the string. A last parameter (num result: 5 ``` -## `parseInt` +## parseInt Parse a number from a string. @@ -922,7 +897,7 @@ Parse a number from a string. | ------------------- | ------ | --------------- | | 0 | string | String to parse | -## `padStart` +## padStart Pads a string with a given string (repeated, if needed) until the resulting string reaches the given length. The padding is applied from the start of the string. @@ -938,7 +913,7 @@ Pads a string with a given string (repeated, if needed) until the resulting stri result: 00005 ``` -## `padEnd` +## padEnd Pads a string with a given string (repeated, if needed) until the resulting string reaches the given length. The padding is applied from the end of the string. @@ -956,9 +931,9 @@ Pads a string with a given string (repeated, if needed) until the resulting stri result: 50000 ``` -## `now` +## now -Display the current time in the chosen format. Format syntax is based on [date-fns package (v2)](https://date-fns.org/v2.11.1/docs/format) and is optional (default to ISO string). +Display the current time in the chosen format. Format syntax is based on [date-fns v2 package format function](https://date-fns.org/v2.30.0/docs/format) and is optional (default to ISO string). | Arguments (ordered) | Type | Description | | ------------------- | ------ | ----------- | @@ -970,9 +945,9 @@ Display the current time in the chosen format. Format syntax is based on [date-f {{now 'YYYY-MM-DD'}} ``` -## `dateTimeShift` +## dateTimeShift -Shift a date by adding the number of `years`, `months`, etc. passed as parameters. The `date` and `format` parameters are optional. The helper will return the current date and time as an ISO string if omitted (`yyyy-MM-ddTHH:mm:ss.SSSxxx`). +Shift a date by adding the number of `years`, `months`, etc. passed as parameters. The `date` and `format` parameters are optional. The helper will return the current date and time as an ISO string if omitted (`yyyy-MM-ddTHH:mm:ss.SSSxxx`). The formatting uses [date-fns v2 package format function](https://date-fns.org/v2.30.0/docs/format). | Parameters (named) | Type | Description | | --------------------------------------- | ------ | -------------------------- | @@ -988,21 +963,12 @@ Shift a date by adding the number of `years`, `months`, etc. passed as parameter **Examples** ```handlebars -{{dateTimeShift - date='2021-01-01' - format='yyyy-MM-dd HH:mm:ss' - years=1 - months=1 - days=1 - hours=1 - minutes=1 - seconds=1 -}} +{{dateTimeShift date='2021-01-01' format='yyyy-MM-dd HH:mm:ss' years=1 months=1 days=1 hours=1 minutes=1 seconds=1}} ``` -## `date` +## date -Return a random formatted date (using [date-fns package format](https://date-fns.org/docs/format)) between a minimum and a maximum. Uses `faker 'date.between'` to generate the random date. +Return a random formatted date (using [date-fns v2 package format function](https://date-fns.org/v2.30.0/docs/format)) between a minimum and a maximum. Uses `faker 'date.between'` to generate the random date. | Arguments (ordered) | Type | Description | | ------------------- | ------ | ------------- | @@ -1016,9 +982,9 @@ Return a random formatted date (using [date-fns package format](https://date-fns {{date '2020-11-20' '2020-11-25' "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"}} ``` -## `time` +## time -Return a random formatted time (using [date-fns package format](https://date-fns.org/docs/format)) between a minimum and a maximum. Uses `faker 'date.between'` to generate the random time. +Return a random formatted time (using [date-fns v2 package format function](https://date-fns.org/v2.30.0/docs/format)) between a minimum and a maximum. Uses `faker 'date.between'` to generate the random time. | Arguments (ordered) | Type | Description | | ------------------- | ------ | ------------- | @@ -1032,9 +998,9 @@ Return a random formatted time (using [date-fns package format](https://date-fns {{time '09:00' '10:00' 'HH:mm'}} ``` -## `dateFormat` +## dateFormat -Return a formatted date (using [date-fns package format](https://date-fns.org/docs/format)). +Return a formatted date (using [date-fns v2 package format function](https://date-fns.org/v2.30.0/docs/format)). | Arguments (ordered) | Type | Description | | ------------------- | -------------- | -------------- | @@ -1048,9 +1014,9 @@ Return a formatted date (using [date-fns package format](https://date-fns.org/do {{dateFormat (faker 'date.recent') 'yyyy'}} ``` -## `int` +## int -Return a random integer. Alias of `faker 'datatype.number`. +Return a random integer. Alias of `faker 'number.int`. | Arguments (ordered) | Type | Description | | ------------------- | ------ | ----------- | @@ -1063,9 +1029,9 @@ Return a random integer. Alias of `faker 'datatype.number`. {{int 0 100}} ``` -## `float` +## float -Return a random float. Alias of `faker 'datatype.number` with precision = 10. +Return a random float. Alias of `faker 'number.float` with precision = 10. | Arguments (ordered) | Type | Description | | ------------------- | ------ | ----------- | @@ -1078,7 +1044,7 @@ Return a random float. Alias of `faker 'datatype.number` with precision = 10. {{float 0 100}} ``` -## `boolean` +## boolean Return a random boolean. Alias of `faker 'datatype.boolean'`. @@ -1088,19 +1054,23 @@ Return a random boolean. Alias of `faker 'datatype.boolean'`. {{boolean}} ``` -## `title` +## title -Return a random title. Alias of `faker 'name.title'`. +Return a random title. Alias of `faker 'name.prefix'`. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ----------- | +| 0 | string | Sex | **Examples:** ```handlebars -{{title}} +{{title 'male'}} ``` -## `firstName` +## firstName -Return a random first name. Alias of `faker 'name.firstName'`. +Return a random first name. Alias of `faker 'person.firstName'`. **Examples:** @@ -1108,9 +1078,9 @@ Return a random first name. Alias of `faker 'name.firstName'`. {{firstName}} ``` -## `lastName` +## lastName -Return a random last name. Alias of `faker 'name.lastName'`. +Return a random last name. Alias of `faker 'person.lastName'`. **Examples:** @@ -1118,7 +1088,7 @@ Return a random last name. Alias of `faker 'name.lastName'`. {{lastName}} ``` -## `company` +## company Return a random company name. Alias of `faker 'company.companyName'`. @@ -1128,7 +1098,7 @@ Return a random company name. Alias of `faker 'company.companyName'`. {{company}} ``` -## `domain` +## domain Return a random domain name. Alias of `faker 'internet.domainName'`. @@ -1138,7 +1108,7 @@ Return a random domain name. Alias of `faker 'internet.domainName'`. {{domain}} ``` -## `tld` +## tld Return a random top level domain. Alias of `faker 'internet.domainSuffix'`. @@ -1148,7 +1118,7 @@ Return a random top level domain. Alias of `faker 'internet.domainSuffix'`. {{tld}} ``` -## `email` +## email Return a random email address. Alias of `faker 'internet.email'`. @@ -1158,9 +1128,9 @@ Return a random email address. Alias of `faker 'internet.email'`. {{email}} ``` -## `street` +## street -Return a random address. Alias of `faker 'address.streetAddress'`. +Return a random address. Alias of `faker 'location.streetAddress'`. **Examples:** @@ -1168,9 +1138,9 @@ Return a random address. Alias of `faker 'address.streetAddress'`. {{street}} ``` -## `city` +## city -Return a random city name. Alias of `faker 'address.city'`. +Return a random city name. Alias of `faker 'location.city'`. **Examples:** @@ -1178,9 +1148,9 @@ Return a random city name. Alias of `faker 'address.city'`. {{city}} ``` -## `country` +## country -Return a random country name. Alias of `faker 'address.country'`. +Return a random country name. Alias of `faker 'location.country'`. **Examples:** @@ -1188,9 +1158,9 @@ Return a random country name. Alias of `faker 'address.country'`. {{country}} ``` -## `countryCode` +## countryCode -Return a random country code. Alias of `faker 'address.countryCode'`. +Return a random country code. Alias of `faker 'location.countryCode'`. **Examples:** @@ -1198,9 +1168,9 @@ Return a random country code. Alias of `faker 'address.countryCode'`. {{countryCode}} ``` -## `zipcode` +## zipcode -Return a random zip code. Alias of `faker 'address.zipCode'`. +Return a random zip code. Alias of `faker 'location.zipCode'`. **Examples:** @@ -1208,9 +1178,9 @@ Return a random zip code. Alias of `faker 'address.zipCode'`. {{zipcode}} ``` -## `postcode` +## postcode -Return a random zip code. Alias of `faker 'address.zipCode'`. +Return a random zip code. Alias of `faker 'location.zipCode'`. **Examples:** @@ -1218,9 +1188,9 @@ Return a random zip code. Alias of `faker 'address.zipCode'`. {{postcode}} ``` -## `lat` +## lat -Return a random latitude. Alias of `faker 'address.latitude'`. +Return a random latitude. Alias of `faker 'location.latitude'`. **Examples:** @@ -1228,9 +1198,9 @@ Return a random latitude. Alias of `faker 'address.latitude'`. {{lat}} ``` -## `long` +## long -Return a random longitude. Alias of `faker 'address.longitude'`. +Return a random longitude. Alias of `faker 'location.longitude'`. **Examples:** @@ -1238,9 +1208,9 @@ Return a random longitude. Alias of `faker 'address.longitude'`. {{long}} ``` -## `phone` +## phone -Return a random phone number. Alias of `faker 'phone.phoneNumber'`. +Return a random phone number. Alias of `faker 'phone.number'`. **Examples:** @@ -1248,9 +1218,9 @@ Return a random phone number. Alias of `faker 'phone.phoneNumber'`. {{phone}} ``` -## `color` +## color -Return a random color. Alias of `faker 'commerce.color'`. +Return a random color. Alias of `faker 'color.human'`. **Examples:** @@ -1258,7 +1228,7 @@ Return a random color. Alias of `faker 'commerce.color'`. {{color}} ``` -## `hexColor` +## hexColor Return a random hexadecimal color code. @@ -1268,9 +1238,9 @@ Return a random hexadecimal color code. {{hexColor}} ``` -## `guid` +## guid -Return a random GUID. Alias of `faker 'datatype.uuid'`. +Return a random GUID. Alias of `faker 'string.uuid'`. **Examples:** @@ -1278,7 +1248,7 @@ Return a random GUID. Alias of `faker 'datatype.uuid'`. {{guid}} ``` -## `ipv4` +## ipv4 Return a random IP v4. Alias of `faker 'internet.ip'`. @@ -1288,7 +1258,7 @@ Return a random IP v4. Alias of `faker 'internet.ip'`. {{ipv4}} ``` -## `ipv6` +## ipv6 Return a random IP v6. Alias of `faker 'internet.ipv6'`. @@ -1298,7 +1268,7 @@ Return a random IP v6. Alias of `faker 'internet.ipv6'`. {{ipv6}} ``` -## `lorem` +## lorem Return random lorem ipsum text. Alias of `faker 'lorem.sentence'`. diff --git a/content/docs/v4.1.0/templating/mockoon-request-helpers.md b/content/docs/v7.0.0/templating/mockoon-request-helpers.md similarity index 80% rename from content/docs/v4.1.0/templating/mockoon-request-helpers.md rename to content/docs/v7.0.0/templating/mockoon-request-helpers.md index d29161da..1e435077 100644 --- a/content/docs/v4.1.0/templating/mockoon-request-helpers.md +++ b/content/docs/v7.0.0/templating/mockoon-request-helpers.md @@ -3,7 +3,7 @@ title: Request helpers meta: title: Create dynamic responses with templating request helpers description: "Create dynamic fake mock data for your mock environments with Mockoon's templating request helpers. All formats are supported: JSON, CSV, HTML, etc." -order: 1020 +order: 502 --- # Templating request helpers @@ -24,12 +24,12 @@ Mockoon offers the following helpers which can return information relative to th - [`method`](#method) - [`baseUrl`](#baseurl) -## `body` +## body Get the value at a given `path` from the request body if the entering `Content-Type` is set to `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`, `application/xml`, `application/soap+xml` or `text/xml`. This helper is designed to retrieve data to be served in a response. To reuse the retrieved data with other helpers (`each`, `if`, etc.), use the [`bodyRaw` helper](#bodyraw) below. -- The `path` takes the following form `key.0.key.5.key` and is based on the [**object-path** library](https://www.npmjs.com/package/object-path). Properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. - Please note that XML bodies are parsed using [xml-js](https://www.npmjs.com/package/xml-js) package. Refer to this [page](docs:xml-support) or the package documentation for more information on how the XML is parsed and how to fetch specific properties. +- The `path` supports two syntaxes, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. + Please note that XML bodies are parsed using [xml-js](https://www.npmjs.com/package/xml-js) package. Refer to this [page](docs:response-configuration/xml-support) or the package documentation for more information on how the XML is parsed and how to fetch specific properties. Please also note that `multipart/form-data` only supports fields. Uploaded files will be ignored. - Full objects or arrays can be retrieved by the helper. - The full request's raw body can also be fetched when the `path` is omitted (`{{body}}`) independently from the request's `Content-Type`. @@ -46,18 +46,24 @@ Get the value at a given `path` from the request body if the entering `Content-T ```handlebars {{body}} + + {{body 'path.to.property'}} {{body 'deep.property\.with\.dot'}} + + +{{body '$.array.[*].property'}} + {{body 'path' 'default value'}} {{body 'path' 'default value' true}} ``` -## `bodyRaw` +## bodyRaw Get the **raw** value at a given `path` from the request body if the entering `Content-Type` is set to `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`, `application/xml`, `application/soap+xml` or `text/xml`. This "raw" helper is designed to work with other helpers (`each`, `if`, etc.). To directly use the retrieved data in the response, use the [`body` helper](#body) above. -- The `path` takes the following form `key.0.key.5.key` and is based on the [**object-path** library](https://www.npmjs.com/package/object-path). Properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. - Please note that XML bodies are parsed using [xml-js](https://www.npmjs.com/package/xml-js) package. Refer to this [page](docs:xml-support) or the package documentation for more information on how the XML is parsed and how to fetch specific properties. +- The `path` supports two syntaxes, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. + Please note that XML bodies are parsed using [xml-js](https://www.npmjs.com/package/xml-js) package. Refer to this [page](docs:response-configuration/xml-support) or the package documentation for more information on how the XML is parsed and how to fetch specific properties. Please also note that `multipart/form-data` only supports fields. Uploaded files will be ignored. - Full objects or arrays can be retrieved by the helper. - The full request's raw body can also be fetched when the `path` is omitted (`{{bodyRaw}}`) independently from the request's `Content-Type`. @@ -73,8 +79,14 @@ Get the **raw** value at a given `path` from the request body if the entering `C ```handlebars {{bodyRaw}} + + {{bodyRaw 'path.to.property'}} {{bodyRaw 'deep.property\.with\.dot'}} + + +{{bodyRaw '$.array.[*].property'}} + {{bodyRaw 'path' 'default value'}} {{#each (bodyRaw 'path.to.array.property' 'default value')}} @@ -86,11 +98,11 @@ Get the **raw** value at a given `path` from the request body if the entering `C {{/if}} ``` -## `queryParam` +## queryParam Get the value at a given `path` from the request's query string. Complex query strings with arrays and objects are supported. This helper is designed to retrieve data to be served in a response. To reuse the retrieved data with other helpers (`each`, `if`, etc.), use the [`queryParamRaw` helper](#queryparamraw) below. -- The `path` takes the following form `key.0.key.5.key`. The syntax is based on [NPM **object-path** package](https://www.npmjs.com/package/object-path). Properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. +- The `path` supports two syntaxes, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. - Full objects or arrays can be retrieved by the helper. - The full query string object can also be fetched when the `path` is omitted (`{{queryParam}}`). It will be stringified and can be used in a JSON body for example. - If there is no value at the requested `path`, the default value will be used. @@ -106,17 +118,23 @@ Get the value at a given `path` from the request's query string. Complex query s ```handlebars {{queryParam}} + + {{queryParam 'path.to.property'}} {{queryParam 'deep.property\.with\.dot'}} + + +{{queryParam '$.array.[*].property'}} + {{queryParam 'path' 'default value'}} {{queryParam 'path' 'default value' true}} ``` -## `queryParamRaw` +## queryParamRaw Get the **raw** value at a given `path` from the request's query string. Complex query strings with arrays and objects are supported. This "raw" helper is designed to work with other helpers (`each`, `if`, etc.). To directly use the retrieved data in the response, use the [`queryParam` helper](#queryparam) above. -- The `path` takes the following form `key.0.key.5.key`. The syntax is based on [NPM **object-path** package](https://www.npmjs.com/package/object-path). Properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. +- The `path` supports two syntaxes, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. - Full objects or arrays can be retrieved by the helper. - The full query string object can also be fetched when the `path` is omitted (`{{queryParamRaw}}`). - If there is no value at the requested `path`, the default value will be used. @@ -131,8 +149,14 @@ Get the **raw** value at a given `path` from the request's query string. Complex ```handlebars {{queryParamRaw}} + + {{queryParamRaw 'path.to.property'}} {{queryParamRaw 'deep.property\.with\.dot'}} + + +{{queryParamRaw '$.array.[*].property'}} + {{queryParamRaw 'path' 'default value'}} {{#each (queryParamRaw 'path.to.array.query' 'default value')}} @@ -144,7 +168,7 @@ Get the **raw** value at a given `path` from the request's query string. Complex {{/if}} ``` -## `urlParam` +## urlParam Get a named parameter from the route `/:paramName1/:paramName2`. @@ -158,7 +182,7 @@ Get a named parameter from the route `/:paramName1/:paramName2`. {{urlParam 'paramName1'}} ``` -## `cookie` +## cookie Get the content of a cookie or returns a default value if the cookie is not present. @@ -173,7 +197,7 @@ Get the content of a cookie or returns a default value if the cookie is not pres {{cookie 'cookie_name' 'default value'}} ``` -## `header` +## header Get content from any request header or returns a default value if header is not present. @@ -188,7 +212,7 @@ Get content from any request header or returns a default value if header is not {{header 'Header-Name' 'default value'}} ``` -## `hostname` +## hostname Returns the request hostname. @@ -198,7 +222,7 @@ Returns the request hostname. {{hostname}} ``` -## `ip` +## ip Returns the request IP address. @@ -208,7 +232,7 @@ Returns the request IP address. {{ip}} ``` -## `method` +## method Returns the request method (GET, PUT, POST, etc.). @@ -218,7 +242,7 @@ Returns the request method (GET, PUT, POST, etc.). {{method}} ``` -## `baseUrl` +## baseUrl Returns the base URL of the request: protocol, host, port and API prefix. diff --git a/content/docs/v4.1.0/templating/mockoon-response-helpers.md b/content/docs/v7.0.0/templating/mockoon-response-helpers.md similarity index 87% rename from content/docs/v4.1.0/templating/mockoon-response-helpers.md rename to content/docs/v7.0.0/templating/mockoon-response-helpers.md index d386495c..99a908ff 100644 --- a/content/docs/v4.1.0/templating/mockoon-response-helpers.md +++ b/content/docs/v7.0.0/templating/mockoon-response-helpers.md @@ -1,9 +1,9 @@ --- title: Response helpers meta: - title: Dynamically customize the response with with templating helpers + title: Dynamically customize your response with templating helpers description: "Dynamically customize your mock environments response with Mockoon's templating response helpers. All formats are supported: JSON, CSV, HTML, etc." -order: 1030 +order: 503 --- # Templating response helpers @@ -14,7 +14,7 @@ Mockoon offers the following helpers which can customize the outgoing response: - [`status`](#status) -## `status` +## status Set the response status code. This helper does not return any content. diff --git a/content/docs/v7.0.0/templating/mockoon-variables-helpers.md b/content/docs/v7.0.0/templating/mockoon-variables-helpers.md new file mode 100644 index 00000000..25e89933 --- /dev/null +++ b/content/docs/v7.0.0/templating/mockoon-variables-helpers.md @@ -0,0 +1,149 @@ +--- +title: Variables helpers +meta: + title: Dynamically customize your responses with variables templating helpers + description: "Dynamically customize your mock environments response with Mockoon's templating variables helpers. All formats are supported: JSON, CSV, HTML, etc." +order: 503 +--- + +# Templating variables helpers + +--- + +Mockoon offers the following helpers which can help you set **local or global variables**, and **access environment variables** in your templates: + +- [`setVar`](#setvar) +- [`getVar`](#getvar) +- [`setGlobalVar`](#setglobalvar) +- [`getGlobalVar`](#getglobalvar) +- [`getEnvVar`](#getenvvar) + +## setVar + +Set a variable to be used later in the template. The value can be the result of another helper. To use it elsewhere in the template, refer to the variable with its name prefixed with an `@`: `{{@varname}}`. The variable can also be used as a helper parameter: `{{#repeat @varname}}...{{/repeat}}`. +Variables declared in a block helper will be scoped to the block and unavailable outside. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | -------------- | +| 0 | string | Variable name | +| 1 | any | Variable value | + +**Examples** + +```handlebars +{{setVar 'varname' 'value'}} +{{setVar 'varname' (body 'id')}} + +usage: +{{@varname}} +{{#repeat @varname}}...{{/repeat}} + +declare a variable in a block helper: +{{#repeat 5}} + {{setVar 'random' (oneOf (array '1' '2' '3'))}} + {{@random}} +{{/repeat}} + +{{setVar 'myArray' (array '1' '2' '3')}} +{{#each @myArray}} + {{setVar 'eachIndex' @index}} + {{@eachIndex}} +{{/repeat}} +``` + +## getVar + +Dynamically get a variable set with [`setVar`](#setvar). + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ------------- | +| 0 | string | Variable name | + +**Examples** + +```handlebars +{{setVar 'varname' 'value'}} + +{{getVar 'varname'}} +{{getVar (concat 'var' 'name')}} +{{getVar (body 'property')}} +``` + +## setGlobalVar + +Set a global variable to be used anywhere templating is supported (body, headers, etc.). Global variables are available on all the routes of an environment and they are reset when the environment is restarted. + +- The variable name and values can be dynamically created using other helpers. +- The variable can store any kind of data (arrays, objects, string, etc.). +- To get the value of a global variable, use the [`{{getGlobalVar 'varName'}}` helper below](#getglobalvar). + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | -------------- | +| 0 | string | Variable name | +| 1 | any | Variable value | + +**Examples** + +```handlebars +{{setGlobalVar 'varName' 'value'}} +{{setGlobalVar 'varName' (bodyRaw 'id')}} +{{setGlobalVar (queryParam 'param1') (bodyRaw 'id')}} +``` + +## getGlobalVar + +Get a global variable's value set with [`setGlobalVar`](#setglobalvar). Global variables are available on all the routes of an environment and they are reset when the environment is restarted. + +- The variable name and path can be dynamically created using other helpers. +- The `path` supports two syntaxes, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. + Please note that a value can be retrieved at the path if the variable contains valid JSON. +- Primitives and data structures can be retrieved by the helper and reused in other helpers (see example below). +- The full variable content (array, object, etc.) can be fetched when the `path` is omitted (`{{getGlobalVar 'varname'}}`). + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | -------------------------- | +| 0 | string | Variable name | +| 1 | string | Path to the value property | + +**Examples** + +```handlebars +{{getGlobalVar 'varname'}} +{{getGlobalVar (bodyRaw 'property')}} +{{getGlobalVar (urlParam 'id')}} + + +{{getGlobalVar 'varName' 'path.to.property'}} +{{getGlobalVar 'varName' 'deep.property\.with\.dot'}} + + +{{getGlobalVar 'varName' '$.array.[*].property'}} + +{{#repeat (getGlobalVar 'varname')}}...{{/repeat}} + +{{#each (getGlobalVar 'varName')}}...{{/each}} + + +{{{stringify (getGlobalVar 'varName')}}} +``` + +## getEnvVar + +Get an environment variable. If the environment variable is not set, the default value will be used. + +By default, only environment variables with the `MOCKOON_` prefix are available. Learn more in the [environment variables documentation](docs:variables/environment-variables). + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ------------------------- | +| 0 | string | Environment variable name | +| 1 | any | Default value | + +**Examples** + +```handlebars +{{setVar 'varname' 'value'}} + +{{getEnvVar 'VARIABLE_NAME' 'default value'}} +{{getEnvVar 'VARIABLE_NAME'}} +{{getEnvVar (body 'property')}} +``` diff --git a/content/docs/v4.1.0/templating/overview.md b/content/docs/v7.0.0/templating/overview.md similarity index 80% rename from content/docs/v4.1.0/templating/overview.md rename to content/docs/v7.0.0/templating/overview.md index b1349f11..42b7e3bf 100644 --- a/content/docs/v4.1.0/templating/overview.md +++ b/content/docs/v7.0.0/templating/overview.md @@ -3,14 +3,14 @@ title: Overview meta: title: Create dynamic responses with templating description: Create dynamic JSON responses for your mock API server with Mockoon's templating system including Faker.js -order: 1000 +order: 500 --- # Templating overview --- -Mockoon implements [Handlebars](https://handlebarsjs.com/), [Faker.js v7.6.0](https://fakerjs.dev/), and a set of custom helpers to create dynamic responses. This templating system is supported in the response's **body**, **headers**, **file content**, and **file path**. You will find below a global overview of how and where you can use helpers. You can also check the [available helpers](#available-helpers) on specific documentation pages. +Mockoon implements [Handlebars](https://handlebarsjs.com/), [Faker.js v8.1.0](https://fakerjs.dev/), and a set of custom helpers to create dynamic responses. This templating system is supported in the [**data buckets**](#content-of-a-data-bucket), [**response's body**](#body-and-file-content-templating), [**header values**](#headers-and-rule-values), [**file content**](#body-and-file-content-templating), [**file path**](#file-input-templating) and [**rule values**](#headers-and-rule-values). You will find below a global overview of how and where you can use helpers. You can also check the [available helpers](#available-helpers) on specific documentation pages. ## Helpers @@ -58,7 +58,7 @@ Here is an example of what you can do with this templating system: {{#repeat 2}} { "id": {{@index}}, - "name": "{{faker 'name.firstName'}} {{faker 'name.lastName'}}" + "name": "{{faker 'person.firstName'}} {{faker 'person.lastName'}}" } {{/repeat}} ], @@ -74,7 +74,7 @@ Here is an example of what you can do with this templating system: } ``` -![body editor content{963x543}](docs-img:body-templating.png) +![body editor content{963x551}](docs-img:body-templating.png) The above template produces the following body with this request: @@ -122,9 +122,7 @@ This system is flexible enough to generate a lot of different contents like CSV ```handlebars firstname,lastname,countryCode {{#repeat 10}} - {{faker 'name.firstName'}},{{faker 'name.lastName'}},{{faker - 'address.countryCode' - }} + {{faker 'person.firstName'}},{{faker 'person.lastName'}},{{faker 'location.countryCode'}} {{/repeat}} ``` @@ -160,18 +158,20 @@ Block helper: {{# base64}} firstname,lastname,countryCode {{# repeat 10 }} -{{ faker 'name.firstName' }},{{ faker 'name.lastName' }},{{ faker 'address.countryCode' }} +{{ faker 'person.firstName' }},{{ faker 'person.lastName' }},{{ faker 'location.countryCode' }} {{/ repeat}} {{/ base64}} ``` +> 🛠️ Use our online [base64 encoder/decoder](/tools/base64-encode-decode/) to get a preview of the encoded content and validate a base64 string. + #### Disable body and file templating Templating can be disabled for the body and file content in each route response separately. Thus, no helper will be interpreted by the templating engine. First, open the **Route response settings**: -![click on route response fourth settings tab{1004x168}](docs-img:open-route-response-settings.png) +![click on route response fourth settings tab{1004x174}](docs-img:open-route-response-settings.png) Then, disable the templating by checking the box: @@ -189,14 +189,14 @@ If you call this route with `/myroute/1`, `./file1.json` will be sent. ![add a templating helper in the file path{977x184}](docs-img:file-path-templating.png) -> For more information about absolute and relative file paths, please refer to our [file serving](docs:response-body/file-serving#absolute-or-relative-paths) documentation. +> For more information about absolute and relative file paths, please refer to our [file serving](docs:response-configuration/file-serving#absolute-or-relative-paths) documentation. ### Headers and rule values Templating helpers can also be used in the **headers values** both in route headers and environment headers: -![add a templating helper in the header value{1004x238}](docs-img:headers-templating.png) +![add a templating helper in the header value{1004x244}](docs-img:headers-templating.png) Finally, templating helpers can be used in the response **rule values** to create dynamic rules: -![screenshot showing a response rule with a template helper in the value field{997x171}](docs-img:template-helper-response-rule-value.png) +![screenshot showing a response rule with a template helper in the value field{997x164}](docs-img:template-helper-response-rule-value.png) diff --git a/content/docs/v7.0.0/variables/environment-variables.md b/content/docs/v7.0.0/variables/environment-variables.md new file mode 100644 index 00000000..2f7b8a24 --- /dev/null +++ b/content/docs/v7.0.0/variables/environment-variables.md @@ -0,0 +1,38 @@ +--- +title: Environment variables +meta: + title: How to access environment variables + description: Avoid exposing your API keys and certificates by accessing environment variables in your mock server routes +order: 552 +--- + +# Environment variables + +--- + +Mockoon offers the possibility to access **environment variables** in your templates using the [`getEnvVar`](docs:templating/mockoon-variables-helpers#getenvvar) helper. This allows you to avoid exposing your API keys and certificates in your mock server configuration. + +## Environment variables support + +Environment variables are accessible [everywhere templating helpers are supported](docs:templating/overview). + +## Default prefix + +By default, only the environment variables prefixed with `MOCKOON_` are available, for example, `MOCKOON_MY_VARIABLE`. You can access the variable in your templates using the `getEnvVar` helper with or without the prefix: + +```handlebars +{{getEnvVar 'MOCKOON_MY_VARIABLE'}} +{{getEnvVar 'MY_VARIABLE'}} +``` + +> 📘 [Helper documentation](docs:templating/mockoon-variables-helpers#getglobalvar). + +## Changing or removing the prefix + +You can change the prefix or remove it entirely in the application settings: + +![application settings modal with the prefix input highlighted{860x812}](docs-img:settings-environment-variables-prefix.png) + +Removing the prefix will make **all the environment variables** accessible in your templates. + +> 💡 Both the [CLI](https://github.com/mockoon/mockoon/blob/main/packages/cli/README.md#customize-the-environment-variables-prefix) and the [serverless library](https://github.com/mockoon/mockoon/blob/main/packages/serverless/README.md#options) have specific options to customize the prefix. diff --git a/content/docs/v7.0.0/variables/global-variables.md b/content/docs/v7.0.0/variables/global-variables.md new file mode 100644 index 00000000..8552c335 --- /dev/null +++ b/content/docs/v7.0.0/variables/global-variables.md @@ -0,0 +1,70 @@ +--- +title: Global variables +meta: + title: How to use global variables + description: Simulate and mock complex API workflows by sharing data between your mock server routes using global variables +order: 551 +--- + +# Global variables + +--- + +Mockoon offers the possibility to **share data** between your routes using **global variables**. These variables can be set and accessed using the [`setGlobalVar`](docs:templating/mockoon-variables-helpers#setglobalvar) and [`getGlobalVar`](docs:templating/mockoon-variables-helpers#getglobalvar) helpers at runtime. + +## Global variables scope + +Global variables are **shared** between **all routes** of an environment. Their values are **reset** when the environment is **stopped or restarted**. + +> ⚠️These variables are **not shared between environments**. + +## Global variables support + +Global variables are available [everywhere templating helpers are supported](docs:templating/overview). However, it makes most sense to use them in the **response body**. + +> 💡 While you can use global variables in data buckets, keep in mind that bucket content will be [generated when the server starts](docs:data-buckets/overview#data-buckets-generation), when global variables are not yet set. + +## Usage + +To set and access global variables, two templating helpers are available. + +### Set a global variable + +To set a global variable, use the `setGlobalVar` helper. This helper takes two arguments: the variable name and its value. You can **dynamically set the parameters** using other helpers. + +Some examples: + +```handlebars +{{setGlobalVar 'varName' 'value'}} +{{setGlobalVar 'varName' (bodyRaw 'id')}} +{{setGlobalVar (queryParam 'param1') (bodyRaw 'id')}} +``` + +> 📘 [Helper documentation](docs:templating/mockoon-variables-helpers#setglobalvar). + +### Get a global variable + +To get a global variable, use the `getGlobalVar` helper. This helper takes two arguments: the variable name and an optional path. You can **dynamically set the parameters** using other helpers and use the fetched data in other helpers. +Some examples: + +```handlebars +{{getGlobalVar 'varname'}} +{{getGlobalVar (bodyRaw 'property')}} +{{getGlobalVar (urlParam 'id')}} + + +{{getGlobalVar 'varName' 'path.to.property'}} +{{getGlobalVar 'varName' 'deep.property\.with\.dot'}} + + +{{getGlobalVar 'varName' '$.array.[*].property'}} + +{{#repeat (getGlobalVar 'varname')}}...{{/repeat}} + +{{#each (getGlobalVar 'varName')}}...{{/each}} + + +{{{stringify (getGlobalVar 'varName')}}} +``` + +> 📘 [Helper documentation](docs:templating/mockoon-variables-helpers#getglobalvar). diff --git a/content/docs/v7.0.0/variables/local-variables.md b/content/docs/v7.0.0/variables/local-variables.md new file mode 100644 index 00000000..8ab4d193 --- /dev/null +++ b/content/docs/v7.0.0/variables/local-variables.md @@ -0,0 +1,58 @@ +--- +title: Local variables +meta: + title: How to use local template scoped variables + description: Simulate and mock complex API workflows by saving data in your templates using local template scoped variables +order: 550 +--- + +# Local (template-scoped) variables + +--- + +Using the [`setVar`](docs:templating/mockoon-variables-helpers#setvar) and [`getVar`](docs:templating/mockoon-variables-helpers#getvar) helpers you can create **template-scoped (or local) variables** to save some intermediate data in your templates and avoid repeating the same logic multiple times. + +## Local variables scope + +Unlike [global variables](docs:variables/global-variables) which are **shared** between **all routes** of an environment, local variables are **scoped to the template** they are used in. Their values are **regenerated** each time the template is **re-evaluated**. + +> ⚠️These variables are **not shared between routes or responses**. + +## Local variables support + +Local variables are available [everywhere templating helpers are supported](docs:templating/overview). + +## Usage + +To set and access local variables, two templating helpers are available. + +### Set a local variable + +To set a variable, use the `setVar` helper. This helper takes two arguments: the variable name and its value. You can **dynamically set the parameters** using other helpers. + +Some examples: + +```handlebars +{{setVar 'varname' 'value'}} +{{setVar 'varname' (body 'id')}} +``` + +> 📘 [Helper documentation](docs:templating/mockoon-variables-helpers#setvar). + +### Get a local variable + +To get a global variable, use the `getVar` helper or refer to the variable with its name prefixed with an `@`. The helper takes two arguments: the variable name and an optional path. You can **dynamically set the parameters** using other helpers and use the fetched data in other helpers. + +Some examples: + +```handlebars +# Set a variable +{{setVar 'varname' 'value'}} + +# Get a variable +{{@varname}} +{{getVar 'varname'}} +{{getVar (body 'property')}} +``` + +> 📘 [Helper documentation](docs:templating/mockoon-variables-helpers#getvar). diff --git a/content/releases/3.1.0.md b/content/releases/3.1.0.md index 1ae523e6..a200b3b7 100644 --- a/content/releases/3.1.0.md +++ b/content/releases/3.1.0.md @@ -27,7 +27,7 @@ We are happy to announce that Mockoon Pro plans are now available. The first fea ![animation showing a prompt being entered and realistic JSON being generated{766x605}](/images/releases/3.1.0/ai-generated-mock-api-endpoint.gif) -The Pro plan is available for solo developers and teams. The Team and Enterprise tiers also include priority support and a welcome training. +The Pro plan is available for solo developers and teams. The Enterprise tier also includes priority support and a welcome training. Subscribing to the Pro plan is also a good way to **support this open-source project** and contribute to its sustainability. diff --git a/content/releases/8.0.0.md b/content/releases/8.0.0.md new file mode 100644 index 00000000..16c9930e --- /dev/null +++ b/content/releases/8.0.0.md @@ -0,0 +1,89 @@ +--- +meta: + title: Mockoon release v8.0.0 + description: Discover Mockoon applications new v8.0.0 release with data synchronization and real-time collaboration, support for data buckets in response rules and a new API admin endpoint. +date: '2024-04-02' +--- + +Welcome to this new major release of Mockoon. We are thrilled to announce the **availability of the data synchronization and real-time collaboration** features after months of development. + +This release also includes support for data buckets in response rules, a new admin API endpoint to manage your running mock servers, and several bug fixes and improvements. Read on to learn more about this release. + +--- + +## Our sponsors + +[![GitHub](https://mockoon.com/images/sponsors/github.png)](https://github.blog/2023-04-12-github-accelerator-our-first-cohort-and-whats-next/) +[![Localazy](https://mockoon.com/images/sponsors/localazy.png)](https://localazy.com/register?ref=a9CiDC61gOac-azO) +[![Peakcrypto](https://mockoon.com/images/sponsors/peakcrypto.png)](https://www.peakcrypto.com/) + +Mockoon is an open-source project built by volunteer maintainers. If you like our application, please consider sponsoring us and join all the [Sponsors and Backers](https://github.com/mockoon/mockoon/blob/main/backers.md) who helped this project over time! + +[![sponsor button](https://mockoon.com/images/sponsor-btn-250.png?)](https://github.com/sponsors/mockoon) + +--- + +## Data synchronization and team collaboration + +We are really excited to announce the availability of the **data synchronization and real-time collaboration features** in the Mockoon desktop application as part of our Mockoon Pro offer. This feature allows you to synchronize your environments data across multiple devices if you are a solo developer or share it with your team members and collaborate in real time. + +Nothing changed in the application interface except for the new "Cloud" section in the main menu. This is where you can create cloud environments and start collaborating. For the rest, the application behaves the same way as before, with your local environments staying local. + +![cloud section in the main menu{200x231}](/images/releases/8.0.0/cloud-sync-menu.png) + +We have written a [dedicated documentation page](https://mockoon.com/docs/latest/mockoon-cloud/data-synchronization-team-collaboration/) that gathers most of the information you need about this feature. + +We spent a lot of time developing this feature and are very proud of the result. We hope you will enjoy using it as much as we enjoyed developing it. We are looking forward to your feedback and suggestions to make it even better! + +## Pre-generated templates are now free + +We decided to make the pre-generated templates available for free to all users. It means you can now use the pre-generated templates without subscribing to the Mockoon Pro offer. + +![pre-generated templates in the new environment modal{550x499}](/images/releases/8.0.0/pre-generated-templates.png) + +## Support for data buckets in response rules + +Mockoon now **supports data buckets targets in the response rules**. This allows you to serve specific responses based on a data bucket content. + +To access the data bucket content, you can use the object-path or JSONPath syntaxes: `$.dataBucketNameOrId.path.to.value`. Read more about this feature in the [documentation](https://mockoon.com/docs/latest/route-responses/dynamic-rules/#1-target). + +![data buckets choice in the rule target menu{1102x155}](/images/releases/8.0.0/data-buckets-response-rules.png) + +(Issue [#1337](https://github.com/mockoon/mockoon/issues/1337)) + +## API admin endpoint and purging the state + +Each running mock server now exposes an **admin API** that allows you to manage your environment. + +The first feature we added to this API is the ability to **purge the state of a running mock server**. Calling `PURGE /mockoon-admin/state` or `POST /mockoon-admin/state/purge` on your running API will reset the state of the data buckets and reset the requests counter. + +This can be used to automate the management of your mock server, especially in a remote environment, without having to restart the application. + +Read more about this feature in the [documentation](https://mockoon.com/docs/latest/admin-api/overview/). + +(Issue [#1334](https://github.com/mockoon/mockoon/issues/1334)) + +## New external files menu + +We added a new menu next to the external file path input that allows you to quickly **view the file in the explorer/finder** or **open it in your default editor**: + +![dropdown menu next to the external file input{793x193}](/images/releases/8.0.0/external-files-menu-view-open-explorer.png) + +(Issue [#964](https://github.com/mockoon/mockoon/issues/964)) + +## Fixes + +- We moved the execution of the callbacks after the response template generation to allow the callback's own templates to access the global variables. (Issue [#1300](https://github.com/mockoon/mockoon/issues/1300)) +- The `{{ipv4}}` helper is now correctly returning only IPv4 addresses instead of a mix of IPv4 and IPv6. (Issue [#1332](https://github.com/mockoon/mockoon/issues/1332)) + +## Chores + +We updated the libraries and applications dependencies to their latest versions to fix some reported vulnerabilities. + +### Thank you + +A big thank you to the following people who helped to make Mockoon better: + +- [@ajatkj](https://github.com/ajatkj): ipv4 helper fix. (Issue [#1332](https://github.com/mockoon/mockoon/issues/1332)) +- [@Drogonov](https://github.com/Drogonov): external files menu. (Issue [#964](https://github.com/mockoon/mockoon/issues/964)) +- [@Jerantony](https://github.com/Jerantony): data buckets support in response rules. (Issue [#1337](https://github.com/mockoon/mockoon/issues/1337)) diff --git a/firebase.json b/firebase.json index afd2899f..9585f3a9 100644 --- a/firebase.json +++ b/firebase.json @@ -28,7 +28,7 @@ }, { "source": "/releases{,/}", - "destination": "/releases/7.0.0/", + "destination": "/releases/8.0.0/", "type": 302 }, { @@ -196,6 +196,11 @@ "destination": "/docs/latest/variables/global-variables/", "type": 301 }, + { + "source": "/docs/latest/api-endpoints/templates-and-ai-assistant/", + "destination": "/docs/latest/mockoon-cloud/templates-and-ai-assistant/", + "type": 301 + }, { "source": "/tutorials/angular-mocking/", "destination": "/tutorials/angular-api-call-and-mocking/", diff --git a/models/user.model.ts b/models/user.model.ts index 37d93741..02e2405b 100644 --- a/models/user.model.ts +++ b/models/user.model.ts @@ -24,9 +24,12 @@ export type User = { plan: Plans; teamId: string; teamRole: TeamRoles; - cloudSyncQuota: number; + cloudSyncItemsQuota: number; + cloudSyncItemsQuotaUsed: number; + cloudSyncSizeQuota: number; templatesQuota: number; templatesQuotaUsed: number; + nextQuotaResetOn: number; subscription: { provider: 'stripe' | 'paddle'; renewOn: number; diff --git a/pages/about.tsx b/pages/about.tsx index ec3e0f39..baa96b20 100644 --- a/pages/about.tsx +++ b/pages/about.tsx @@ -101,7 +101,7 @@ const About: FunctionComponent<{

    Mockoon is now used by thousands of developers and companies around the world and has been{' '} - downloaded more than 500k times. + downloaded more than 600k times.

    @@ -166,7 +166,8 @@ const About: FunctionComponent<{

    You can also support us by subscribing to our{' '} Pro plans and enjoy a whole new level of - capabilities: AI-powered API mocks generation, + capabilities: AI-powered API mocks generation,{' '} + data synchronization and real-time collaboration, enterprise-grade support, and more to come!

    diff --git a/pages/account/subscription.tsx b/pages/account/subscription.tsx index 70c4af9e..b849f530 100644 --- a/pages/account/subscription.tsx +++ b/pages/account/subscription.tsx @@ -9,6 +9,7 @@ import PaddleScript from '../../components/paddle'; import Spinner from '../../components/spinner'; import { frequencyNames, planNames } from '../../constants/plans'; import Layout from '../../layout/layout'; +import { Plans } from '../../models/user.model'; import { useAuth } from '../../utils/auth'; import { useCurrentSubscriptionLinks, @@ -251,34 +252,90 @@ const AccountSubscription: FunctionComponent = function () {

    Quotas

    -
    -
    -

    - AI generated mocks used ( - {userData?.templatesQuotaUsed}/ - {userData?.templatesQuota}) -

    +
    +
    +
    +
    +

    + AI generated mocks used ( + {userData?.templatesQuotaUsed}/ + {userData?.templatesQuota}) +

    + + Resets monthly - Next reset on{' '} + {new Date( + userData?.nextQuotaResetOn * 1000 + ).toDateString()} + +
    +
    +
    +
    = + userData?.templatesQuota + ? 'bg-warning' + : '' + }`} + role='progressbar' + aria-valuenow={userData?.templatesQuotaUsed} + aria-valuemin={0} + aria-valuemax={userData?.templatesQuota} + style={{ + width: + (userData?.templatesQuotaUsed * 100) / + userData?.templatesQuota + + '%' + }} + >
    +
    +
    +
    -
    -
    -
    = - userData?.templatesQuota - ? 'bg-warning' - : '' - }`} - role='progressbar' - aria-valuenow={userData?.templatesQuotaUsed} - aria-valuemin={0} - aria-valuemax={userData?.templatesQuota} - style={{ - width: - (userData?.templatesQuotaUsed * 100) / - userData?.templatesQuota + - '%' - }} - >
    +
    +
    +
    +

    + Cloud environments ( + {userData?.cloudSyncItemsQuotaUsed}/ + {userData?.cloudSyncItemsQuota}) +

    + + {(userData?.plan === Plans.TEAM || + userData?.plan === Plans.ENTERPRISE) && + 'Quota shared with your team - '} + Maximum of{' '} + {userData?.cloudSyncSizeQuota / 1000000}MB per + environment + +
    +
    +
    +
    = + userData?.cloudSyncItemsQuota + ? 'bg-warning' + : '' + }`} + role='progressbar' + aria-valuenow={ + userData?.cloudSyncItemsQuotaUsed + } + aria-valuemin={0} + aria-valuemax={ + userData?.cloudSyncItemsQuota + } + style={{ + width: + (userData?.cloudSyncItemsQuotaUsed * + 100) / + userData?.cloudSyncItemsQuota + + '%' + }} + >
    +
    +
    diff --git a/pages/ai-powered-api-mocking.tsx b/pages/ai-powered-api-mocking.tsx index a40a8041..0340b34d 100644 --- a/pages/ai-powered-api-mocking.tsx +++ b/pages/ai-powered-api-mocking.tsx @@ -27,9 +27,8 @@ const AIPoweredMocking = function () {
    Alter the logos in any way, or combine them with any other + logos, symbols, or icons
    diff --git a/pages/docs/[...slug].tsx b/pages/docs/[...slug].tsx index 190436c8..03765e10 100644 --- a/pages/docs/[...slug].tsx +++ b/pages/docs/[...slug].tsx @@ -255,6 +255,11 @@ export default function Docs(props: { key={`category${menuItemIndex}`} > {menuItem.title} + {menuItem.categoryName.includes('mockoon-cloud') && ( + + Pro + + )} ), itemsHtml diff --git a/pages/faq.tsx b/pages/faq.tsx index f2eec272..d549a8a6 100644 --- a/pages/faq.tsx +++ b/pages/faq.tsx @@ -120,6 +120,9 @@ const Faq: FunctionComponent = function () {

    No, you don't need an internet connection to use Mockoon. Everything runs locally. +
    + However, an internet connection is required to use our{' '} + cloud services.

    @@ -271,6 +274,7 @@ const Faq: FunctionComponent = function () {

    Yes, we have Pro plans that offers additional features like AI-powered API mocks generation, + data synchronization and real-time collaboration, enterprise-grade support, and more!

    diff --git a/pages/features.tsx b/pages/features.tsx index 003f69a6..6c1aeaf7 100644 --- a/pages/features.tsx +++ b/pages/features.tsx @@ -47,7 +47,7 @@ const features: CardData[] = [ 'Use our read-to-use templates and AI assistant to quickly prototype your mock APIs', links: [ { - src: '/templates/', + src: '/ai-powered-api-mocking/', text: 'Learn more →' } ] @@ -68,6 +68,18 @@ const features: CardData[] = [ } ] }, + { + title: 'Cloud synchronization', + topTag: 'PRO', + topTagClasses: 'text-bg-warning', + description: 'Synchronize your mock APIs across all your devices.', + links: [ + { + src: '/docs/latest/mockoon-cloud/data-synchronization-team-collaboration/', + text: 'Documentation →' + } + ] + }, { title: 'CORS', description: @@ -89,6 +101,18 @@ const features: CardData[] = [ } ] }, + { + title: 'Real-time collaboration', + topTag: 'PRO', + topTagClasses: 'text-bg-warning', + description: 'Collaborate with your team in real-time on your mock APIs.', + links: [ + { + src: '/docs/latest/mockoon-cloud/data-synchronization-team-collaboration/', + text: 'Documentation →' + } + ] + }, { title: 'Response headers', description: diff --git a/pages/privacy.tsx b/pages/privacy.tsx index 3f5c7007..ecd22da8 100644 --- a/pages/privacy.tsx +++ b/pages/privacy.tsx @@ -11,7 +11,7 @@ const Privacy: FunctionComponent = function () { description='Mockoon is the fastest and easiest way to create mock API servers. Our tools are privacy and regulated-industry friendly' /> - +
    @@ -24,8 +24,8 @@ const Privacy: FunctionComponent = function () { application, and other sites or services we own and operate.

    - This policy is effective as of 1 July 2021 and was last updated - on 1 July 2021. + This policy is effective as of July 1st, 2021 and was last + updated on April 2nd, 2024.

    1. Information We Collect

    @@ -37,13 +37,14 @@ const Privacy: FunctionComponent = function () {

    2. Log Data

    - When you visit our website or use our application, our servers + When you visit our website or use our applications, our servers may automatically log the standard data provided by your web - browser. It may include your device's Internet Protocol (IP) - address, your browser type and version, the pages you visit, the - time and date of your visit, the time spent on each page, other - details about your visit, and technical details that occur in - conjunction with any errors you may encounter. + browser or network devices. It may include your device's + Internet Protocol (IP) address, your browser type and version, + the pages you visit, the time and date of your visit, the time + spent on each page, other details about your visit, and + technical details that occur in conjunction with any errors you + may encounter.

    Please be aware that while this information may not be @@ -54,8 +55,8 @@ const Privacy: FunctionComponent = function () { 3. Collection and Use of Information

    - We may collect personal information from you when you do any of - the following on our website: + We may collect anonymous information when you do any of the + following:

    • @@ -65,11 +66,30 @@ const Privacy: FunctionComponent = function () { information neither do we use cookies or any other tracking technology.
    • +
    • + Use our desktop application: in addition to the + above-mentioned log data, we collect anonymous usage + statistics. We do not collect any personal information neither + do we use cookies or any other tracking technology. +
    • +
    +

    + We may collect personal information from you when you do any of + the following on our website: +

    +
      +
    • + When you sign up for an account: profile information, + including your email and password. +
    • +
    • + When you purchase a service: billing details, payment + information such as name, address and credit card information. +
    • Contact us via email, social media, or on any similar technologies.
    • -
    • When you mention us on social media.
    • When you subscribe to our newsletter.

    @@ -191,22 +211,14 @@ const Privacy: FunctionComponent = function () { have the right to contact a regulatory body or data protection authority in relation to your complaint.

    -

    9. Use of Cookies

    -

    - We use “cookies” to collect information about you and your - activity across our site. A cookie is a small piece of data that - our website stores on your computer, and accesses each time you - visit, so we can understand how you use our site. This helps us - serve you content based on preferences you have specified. -

    -

    10 Limits of Our Policy

    +

    9. Limits of Our Policy

    Our website may link to external sites that are not operated by us. Please be aware that we have no control over the content and policies of those sites, and cannot accept responsibility or liability for their respective privacy practices.

    -

    11. Changes to This Policy

    +

    10. Changes to This Policy

    At our discretion, we may change our privacy policy to reflect updates to our business processes, current acceptable practices, @@ -219,7 +231,7 @@ const Privacy: FunctionComponent = function () { opportunity to opt in to or opt out of, as applicable, any new uses of your personal information.

    -

    12. Contact Us

    +

    11. Contact Us

    For any questions or concerns regarding your privacy, you may contact us using the following details:{' '} diff --git a/pages/pro.tsx b/pages/pro.tsx index f78ab07e..462c5746 100644 --- a/pages/pro.tsx +++ b/pages/pro.tsx @@ -20,7 +20,7 @@ const faq: AccordionData = [ { title: 'When will the "coming soon" services be available?', content: - 'We don\'t have a release date yet, but we would like to make the data synchronization for solo developers available in Q2 of this year. There is no ETA yet for the team synchronization.

    Subscribe to the product updates below to be notified of new releases.' + 'We can only provide an approximate availability period. You can subscribe to the product updates below to be notified of new releases.' }, { title: 'Can I give feedback or join a beta test?', @@ -38,9 +38,9 @@ const faq: AccordionData = [ "Community support is the free support channel for Mockoon users. It is available on our GitHub repository or Discord server." }, { - title: 'What is the "priority support" (Team and Enterprise plan)?', + title: 'What is the "priority support" (Enterprise plan)?', content: - 'We will provide a priority support channel for your team by email or through the platform of your choice (Slack, etc.). Our priority support service is provided during regular business hours and working days in Luxembourg (9 am to 5 pm, Monday to Friday, Luxembourg time (CET/CEST), excluding public holidays). Please refer to the terms of service for more information.' + 'We will provide a priority support channel for your team by email or through the platform of your choice (Slack, etc.). Our priority support service is provided during regular business hours and working days (9 am to 5 pm CET/CEST, Monday to Friday). Please refer to the terms of service for more information.' }, { title: 'What is the "welcome online training" (Enterprise plan)?', @@ -75,7 +75,12 @@ const faq: AccordionData = [ { title: 'Do you offer discounts for schools, bootcamps or students?', content: - 'We offer a discount for education purposes by providing educational institutions with a discount on the Solo plan. Do not hesitate to contact us to become a partner.' + 'We provide educational institutions with free Solo plans for all their students. Do not hesitate to contact us to become a partner.' + }, + { + title: 'Do you have a discount for startups?', + content: + 'We offer substantial discounts for startups and bootstrapped entrepreneurs who did not raise funds. Do not hesitate to contact us to learn about the conditions and benefits of the program.' }, { title: 'How can I cancel my subscription?', diff --git a/pages/public-roadmap.tsx b/pages/public-roadmap.tsx index 6d9f52c2..0b144d3d 100644 --- a/pages/public-roadmap.tsx +++ b/pages/public-roadmap.tsx @@ -36,6 +36,16 @@ const faq: AccordionData = [ const tasks = { released: [ + { + link: '/docs/latest/mockoon-cloud/data-synchronization-team-collaboration/', + title: 'Real-time collaboration for teams', + pro: true + }, + { + link: '/docs/latest/mockoon-cloud/data-synchronization-team-collaboration/', + title: 'Data synchronization for solo developers', + pro: true + }, { link: '/docs/latest/variables/environment-variables/', title: 'Environment variables support in templating', @@ -97,21 +107,16 @@ const tasks = { target: '_blank' }, { - link: '/pro/', - title: 'Data synchronization for solo developers', - pro: true + link: '/course/', + title: 'Official online course', + pro: true, + target: null } ], comingSoon: [ { link: '/pro/', - title: 'Real-time collaboration for teams', - pro: true, - target: null - }, - { - link: '/course/', - title: 'Official online course', + title: 'API deployments in the cloud', pro: true, target: null } diff --git a/pages/sponsor-us.tsx b/pages/sponsor-us.tsx index 131e9461..5f18e7bb 100644 --- a/pages/sponsor-us.tsx +++ b/pages/sponsor-us.tsx @@ -38,7 +38,7 @@ const SponsorUs: FunctionComponent = function () {

    Entirely free, Mockoon saves time for{' '} thousands of people around the world every day - and recently crossed 500k downloads! + and recently crossed 600k downloads!

    Reaching this level of satisfaction requires a{' '} @@ -86,7 +86,8 @@ const SponsorUs: FunctionComponent = function () {

    You can also support us by subscribing to our{' '} Pro plans and enjoy a whole new level of - capabilities: AI-powered API mocks generation, enterprise-grade + capabilities: AI-powered API mocks generation, data + synchronization and real-time collaboration, enterprise-grade support, and more to come!

    diff --git a/pages/templates.tsx b/pages/templates.tsx index 1b255925..067d9efe 100644 --- a/pages/templates.tsx +++ b/pages/templates.tsx @@ -6,7 +6,7 @@ import Meta from '../components/meta'; import SidebarBanner from '../components/sidebar-banner'; import Layout from '../layout/layout'; import { Template } from '../models/templates.model'; -import { getFreeTemplates } from '../utils/utils'; +import { getTemplates } from '../utils/utils'; const meta = { title: "Mockoon's templates", @@ -15,7 +15,7 @@ const meta = { }; export async function getStaticProps() { - const templates = await getFreeTemplates(); + const templates = await getTemplates(); return { props: { @@ -73,9 +73,8 @@ const Templates: FunctionComponent<{ @@ -119,7 +118,16 @@ const Templates: FunctionComponent<{ CRUD endpoint {' '} - with a data bucket. + with a data bucket.
    + Learn more in our{' '} + + documentation + + .

    - +

    @@ -38,6 +38,11 @@ const Terms: FunctionComponent = function () { https://mockoon.com/account/info/ +
    + Cloud services status page:{' '} + + https://mockoon.com/status/ +

    By accepting this Agreement, you represent and warrant that you @@ -379,19 +384,103 @@ const Terms: FunctionComponent = function () { Service does not relieve you of the obligation to pay any outstanding fees accrued prior to the termination or cessation.

    -

    11. Usage quotas

    + +

    + 11. Description of the cloud Services +

    +

    a. AI assistant

    +

    + The AI assistant is a feature available to all our customers of + our Pro plans. Its usage is subject to the quotas specified in + the plan details and visible in your account. You can access the + AI assistant from the desktop application. +

    +

    + We do not guarantee the accuracy, reliability, or completeness + of the AI assistant's responses. The AI assistant is not a + substitute for professional advice, and you should not rely on + it as the sole basis for making decisions. You are solely + responsible for verifying the accuracy and relevance of the + information provided by the AI assistant. +

    +

    + We do not make any representation or warranty regarding the + availability, performance, or functionality of the AI assistant. + The AI assistant may be subject to downtime, errors, or + interruptions, and we do not guarantee that it will be available + at all times. We will make commercially reasonable efforts to + ensure the availability and performance of the AI assistant, and + inform you of any planned maintenance or downtime through our + Service status page. +

    +

    + b. Data synchronization and real-time collaboration +

    +

    +

    + The data synchronization and real-time collaboration feature + ("Synchronization Feature") is available to all our customers of + our Pro plans. It is subject to the quotas specified in the plan + details and visible in your{' '} + + account management interface + + . +

    +

    + We do not make any representation or warranty regarding the + availability, performance, or functionality of the + Synchronization Feature. The Synchronization Feature may be + subject to downtime, errors, or interruptions, and we do not + guarantee that it will be available at all times. We will make + commercially reasonable efforts to ensure the availability and + performance of the Synchronization Feature, and inform you of + any planned maintenance or downtime through our Service status + page. +

    +

    + Aside from the above-mentioned quotas, the Synchronization + Feature is subject to some technical limitations and monitoring, + including but not limited to the maximum number of devices that + can be synchronized from the same IP address, the maximum number + of concurrent requests to our servers or the volume of data that + can be transmitted over a certain period of time. These + limitations are designed to ensure fair usage of our + infrastructure and to prevent abuse or excessive load on our + systems. We reserve the right to modify or adjust the technical + limitations of the Synchronization Feature at any time. We + further reserve the right to suspend or terminate your access to + the Synchronization Feature if we determine that your usage is + unreasonable or causing an undue burden on our infrastructure. +

    +

    + While we take reasonable measures to ensure the durability and + integrity of the data synchronized through the Synchronization + Feature, it is not a backup service. We do not guarantee the + retention or availability of your data. You are solely + responsible for maintaining backups of your data and ensuring + that you have the necessary copies of your data in the event of + loss or corruption. +

    +

    + 12. Usage quotas and limitations +

    Our Service may include certain usage quotas, such as storage, deployments, or AI assistant invocations, depending on the plan you have subscribed to. These usage quotas are provided to ensure fair usage of our services and to maintain the optimal - performance of our infrastructure. + performance of our infrastructure. They are visible in your{' '} + + account management interface + + .

    - The usage quotas allocated to your account will reset at the - beginning of each billing cycle. Unused quotas from the previous - billing cycle will not be carried over to the next billing - cycle. + The usage quotas allocated monthly to your account will reset at + the beginning of each billing cycle. Unused quotas from the + previous billing cycle will not be carried over to the next + billing cycle.

    The usage quotas assigned to your account are personal and @@ -401,42 +490,31 @@ const Terms: FunctionComponent = function () {

    We reserve the right to modify or adjust the usage quotas at any - time, subject to providing you with reasonable advance notice. - Such modifications or adjustments may be communicated through - written notice, email notifications, or by posting the updated - quotas within our Service. + time, subject to providing you with reasonable advance notice if + such modifications or adjustments are likely to have a material + adverse effect on the availability, performance, or + functionality of the Service. Such modifications or adjustments + may be communicated through written notice, email notifications, + or by posting the updated quotas within our Service.

    -

    12. Priority support services

    +

    13. Priority support services

    Support services are available for customers subscribed to the - Pro and Enterprise plans of our Service. These plans include - access to our support team for assistance with technical issues, - inquiries, and general product-related questions. + Enterprise plan of our Service. This plan includes access to our + support team for assistance with technical issues, inquiries, + and general product-related questions.

    Support services are provided during regular business hours and - working days in Luxembourg, unless otherwise specified in the - plan details or separately agreed upon in writing. Our business - hours are from{' '} - - 9 am to 5 pm, Monday to Friday, Luxembourg time (CET/CEST), - excluding public holidays in Luxembourg - - . + working days in the CET/CEST timezone, unless otherwise + specified in the plan details or separately agreed upon in + writing. Our business hours are from{' '} + 9 am to 5 pm CET/CEST, Monday to Friday.

    - The initial response time for support inquiries is as follows: + The initial response time for support inquiries is of{' '} + one business day.

    -
      -
    • - One business day for customers on the - Enterprise plan. -
    • -
    • - Two business days for customers on the Pro - plan. -
    • -

    The support services encompass assistance and guidance regarding the functionality, features, and usage of our Service. Our @@ -484,7 +562,7 @@ const Terms: FunctionComponent = function () { communicated to you through written notice or by posting updated information within our Service.

    -

    13. Welcome training

    +

    14. Welcome training

    As part of our Enterprise plan, we offer a one hour online video call training session per company, per year. This training @@ -496,7 +574,7 @@ const Terms: FunctionComponent = function () { After subscribing, a representative from our Company will reach out to you to coordinate the training session.

    -

    14. Term and termination

    +

    15. Term and termination

    The term of this Agreement shall begin upon your acceptance of these terms of service and shall automatically renew for the @@ -534,7 +612,7 @@ const Terms: FunctionComponent = function () { clauses relating to intellectual property rights, limitation of liability, indemnification, and dispute resolution.

    -

    15. Disclaimer

    +

    16. Disclaimer

    THE SERVICES AND SUPPORT SERVICES ARE PROVIDED "AS IS" AND THE COMPANY DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, @@ -546,7 +624,7 @@ const Terms: FunctionComponent = function () { DELIVERABLES.

    - 16. Limit of Liability and Waiver of Consequential Damages. + 17. Limit of Liability and Waiver of Consequential Damages.

    TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, EXCEPT FOR @@ -573,7 +651,7 @@ const Terms: FunctionComponent = function () { THE PARTIES HAVE RELIED ON THESE LIMITATIONS IN DETERMINING WHETHER TO ENTER THIS AGREEMENT.

    -

    17. Miscellaneous

    +

    18. Miscellaneous

    This Agreement, including its terms and conditions, may be updated or modified by us from time to time. Any updates or @@ -616,7 +694,7 @@ const Terms: FunctionComponent = function () { communications, or understandings, whether written or oral, relating to such subject matter.

    -

    18. Governing law

    +

    19. Governing law

    This Agreement and any dispute arising out of or in connection with this Agreement shall be governed by and construed in @@ -630,7 +708,7 @@ const Terms: FunctionComponent = function () { venue of such courts and waive any objections to the exercise of personal jurisdiction over you by such courts.

    -

    19. Binding agreement

    +

    20. Binding agreement

    This Agreement constitutes a binding contract between you and us. You may not assign or transfer any rights or obligations diff --git a/public/images/docs/latest/api-endpoints/crud-routes/add-crud-route.png b/public/images/docs/latest/api-endpoints/crud-routes/add-crud-route.png index fba625d9..c85d9f7e 100644 Binary files a/public/images/docs/latest/api-endpoints/crud-routes/add-crud-route.png and b/public/images/docs/latest/api-endpoints/crud-routes/add-crud-route.png differ diff --git a/public/images/docs/latest/api-endpoints/crud-routes/customize-crud-id-property-key.png b/public/images/docs/latest/api-endpoints/crud-routes/customize-crud-id-property-key.png index 01a4cf82..46b0a2d4 100644 Binary files a/public/images/docs/latest/api-endpoints/crud-routes/customize-crud-id-property-key.png and b/public/images/docs/latest/api-endpoints/crud-routes/customize-crud-id-property-key.png differ diff --git a/public/images/docs/latest/api-endpoints/crud-routes/link-data-bucket-crud-route.png b/public/images/docs/latest/api-endpoints/crud-routes/link-data-bucket-crud-route.png index d0ea32c6..34060fad 100644 Binary files a/public/images/docs/latest/api-endpoints/crud-routes/link-data-bucket-crud-route.png and b/public/images/docs/latest/api-endpoints/crud-routes/link-data-bucket-crud-route.png differ diff --git a/public/images/docs/latest/api-endpoints/crud-routes/set-crud-route-path.png b/public/images/docs/latest/api-endpoints/crud-routes/set-crud-route-path.png index 20976b26..0a16b162 100644 Binary files a/public/images/docs/latest/api-endpoints/crud-routes/set-crud-route-path.png and b/public/images/docs/latest/api-endpoints/crud-routes/set-crud-route-path.png differ diff --git a/public/images/docs/latest/api-endpoints/folders/routes-nested-folder.png b/public/images/docs/latest/api-endpoints/folders/routes-nested-folder.png index 94947823..3f157587 100644 Binary files a/public/images/docs/latest/api-endpoints/folders/routes-nested-folder.png and b/public/images/docs/latest/api-endpoints/folders/routes-nested-folder.png differ diff --git a/public/images/docs/latest/api-endpoints/routing/environment-prefix.png b/public/images/docs/latest/api-endpoints/routing/environment-prefix.png index aab6a86e..b7abb2ec 100644 Binary files a/public/images/docs/latest/api-endpoints/routing/environment-prefix.png and b/public/images/docs/latest/api-endpoints/routing/environment-prefix.png differ diff --git a/public/images/docs/latest/api-endpoints/routing/open-environment-settings.png b/public/images/docs/latest/api-endpoints/routing/open-environment-settings.png index 02579395..fa69f2cc 100644 Binary files a/public/images/docs/latest/api-endpoints/routing/open-environment-settings.png and b/public/images/docs/latest/api-endpoints/routing/open-environment-settings.png differ diff --git a/public/images/docs/latest/api-endpoints/routing/route-params.png b/public/images/docs/latest/api-endpoints/routing/route-params.png index a65e9764..29f28a24 100644 Binary files a/public/images/docs/latest/api-endpoints/routing/route-params.png and b/public/images/docs/latest/api-endpoints/routing/route-params.png differ diff --git a/public/images/docs/latest/api-endpoints/routing/route-patterns.png b/public/images/docs/latest/api-endpoints/routing/route-patterns.png index eba19886..8049470a 100644 Binary files a/public/images/docs/latest/api-endpoints/routing/route-patterns.png and b/public/images/docs/latest/api-endpoints/routing/route-patterns.png differ diff --git a/public/images/docs/latest/callbacks/overview/add-callback.png b/public/images/docs/latest/callbacks/overview/add-callback.png index 6b953206..21d913b7 100644 Binary files a/public/images/docs/latest/callbacks/overview/add-callback.png and b/public/images/docs/latest/callbacks/overview/add-callback.png differ diff --git a/public/images/docs/latest/callbacks/overview/open-callbacks-view.png b/public/images/docs/latest/callbacks/overview/open-callbacks-view.png index a2fdd515..5ce7cc38 100644 Binary files a/public/images/docs/latest/callbacks/overview/open-callbacks-view.png and b/public/images/docs/latest/callbacks/overview/open-callbacks-view.png differ diff --git a/public/images/docs/latest/callbacks/using-callbacks/link-callback-response.png b/public/images/docs/latest/callbacks/using-callbacks/link-callback-response.png index 22895c20..4342a9ab 100644 Binary files a/public/images/docs/latest/callbacks/using-callbacks/link-callback-response.png and b/public/images/docs/latest/callbacks/using-callbacks/link-callback-response.png differ diff --git a/public/images/docs/latest/callbacks/using-callbacks/open-route-response-callbacks.png b/public/images/docs/latest/callbacks/using-callbacks/open-route-response-callbacks.png index d5d87821..ceac6ab9 100644 Binary files a/public/images/docs/latest/callbacks/using-callbacks/open-route-response-callbacks.png and b/public/images/docs/latest/callbacks/using-callbacks/open-route-response-callbacks.png differ diff --git a/public/images/docs/latest/data-buckets/overview/add-data-bucket.png b/public/images/docs/latest/data-buckets/overview/add-data-bucket.png index 60943d11..82ecba67 100644 Binary files a/public/images/docs/latest/data-buckets/overview/add-data-bucket.png and b/public/images/docs/latest/data-buckets/overview/add-data-bucket.png differ diff --git a/public/images/docs/latest/data-buckets/overview/open-data-view.png b/public/images/docs/latest/data-buckets/overview/open-data-view.png index 37d04ff9..b46466fa 100644 Binary files a/public/images/docs/latest/data-buckets/overview/open-data-view.png and b/public/images/docs/latest/data-buckets/overview/open-data-view.png differ diff --git a/public/images/docs/latest/data-buckets/using-data-buckets/link-data-bucket-response.png b/public/images/docs/latest/data-buckets/using-data-buckets/link-data-bucket-response.png index fb3da42c..5843ea37 100644 Binary files a/public/images/docs/latest/data-buckets/using-data-buckets/link-data-bucket-response.png and b/public/images/docs/latest/data-buckets/using-data-buckets/link-data-bucket-response.png differ diff --git a/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png b/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png index 28259b56..7058dd9d 100644 Binary files a/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png and b/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png differ diff --git a/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png b/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png index d963fef7..b6b05f1f 100644 Binary files a/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png and b/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png differ diff --git a/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png b/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png index e0d9e370..263e63f4 100644 Binary files a/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png and b/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png differ diff --git a/public/images/docs/latest/logging-and-recording/requests-logging/logs-metadata.png b/public/images/docs/latest/logging-and-recording/requests-logging/logs-metadata.png index 02631db8..6f5d29f1 100644 Binary files a/public/images/docs/latest/logging-and-recording/requests-logging/logs-metadata.png and b/public/images/docs/latest/logging-and-recording/requests-logging/logs-metadata.png differ diff --git a/public/images/docs/latest/logging-and-recording/requests-logging/logs-request.png b/public/images/docs/latest/logging-and-recording/requests-logging/logs-request.png index 18916184..49a6ccbe 100644 Binary files a/public/images/docs/latest/logging-and-recording/requests-logging/logs-request.png and b/public/images/docs/latest/logging-and-recording/requests-logging/logs-request.png differ diff --git a/public/images/docs/latest/logging-and-recording/requests-logging/logs-response.png b/public/images/docs/latest/logging-and-recording/requests-logging/logs-response.png index 886d321f..472f06b6 100644 Binary files a/public/images/docs/latest/logging-and-recording/requests-logging/logs-response.png and b/public/images/docs/latest/logging-and-recording/requests-logging/logs-response.png differ diff --git a/public/images/docs/latest/logging-and-recording/requests-logging/logs-view-body-modal.png b/public/images/docs/latest/logging-and-recording/requests-logging/logs-view-body-modal.png index 17d88919..b2ad4fbb 100644 Binary files a/public/images/docs/latest/logging-and-recording/requests-logging/logs-view-body-modal.png and b/public/images/docs/latest/logging-and-recording/requests-logging/logs-view-body-modal.png differ diff --git a/public/images/docs/latest/logging-and-recording/requests-logging/logs-view-body.png b/public/images/docs/latest/logging-and-recording/requests-logging/logs-view-body.png index 275d735a..f13bff63 100644 Binary files a/public/images/docs/latest/logging-and-recording/requests-logging/logs-view-body.png and b/public/images/docs/latest/logging-and-recording/requests-logging/logs-view-body.png differ diff --git a/public/images/docs/latest/logging-and-recording/requests-logging/open-logs.png b/public/images/docs/latest/logging-and-recording/requests-logging/open-logs.png index fd531e3e..abbcf844 100644 Binary files a/public/images/docs/latest/logging-and-recording/requests-logging/open-logs.png and b/public/images/docs/latest/logging-and-recording/requests-logging/open-logs.png differ diff --git a/public/images/docs/latest/mockoon-cloud/templates-and-ai-assistant/ai-assistant-generate-button.png b/public/images/docs/latest/mockoon-cloud/templates-and-ai-assistant/ai-assistant-generate-button.png new file mode 100644 index 00000000..581abc5d Binary files /dev/null and b/public/images/docs/latest/mockoon-cloud/templates-and-ai-assistant/ai-assistant-generate-button.png differ diff --git a/public/images/docs/latest/mockoon-cloud/templates-and-ai-assistant/ai-assistant-generate-template-tab.png b/public/images/docs/latest/mockoon-cloud/templates-and-ai-assistant/ai-assistant-generate-template-tab.png new file mode 100644 index 00000000..60a1ee64 Binary files /dev/null and b/public/images/docs/latest/mockoon-cloud/templates-and-ai-assistant/ai-assistant-generate-template-tab.png differ diff --git a/public/images/docs/latest/mockoon-cloud/templates-and-ai-assistant/ai-assistant-template-generate-options.png b/public/images/docs/latest/mockoon-cloud/templates-and-ai-assistant/ai-assistant-template-generate-options.png new file mode 100644 index 00000000..61da7be5 Binary files /dev/null and b/public/images/docs/latest/mockoon-cloud/templates-and-ai-assistant/ai-assistant-template-generate-options.png differ diff --git a/public/images/docs/latest/mockoon-cloud/templates-and-ai-assistant/pre-generated-templates-modal.png b/public/images/docs/latest/mockoon-cloud/templates-and-ai-assistant/pre-generated-templates-modal.png new file mode 100644 index 00000000..f0039c83 Binary files /dev/null and b/public/images/docs/latest/mockoon-cloud/templates-and-ai-assistant/pre-generated-templates-modal.png differ diff --git a/public/images/docs/latest/mockoon-cloud/templates-and-ai-assistant/templates-create-get-route.png b/public/images/docs/latest/mockoon-cloud/templates-and-ai-assistant/templates-create-get-route.png new file mode 100644 index 00000000..18a4e513 Binary files /dev/null and b/public/images/docs/latest/mockoon-cloud/templates-and-ai-assistant/templates-create-get-route.png differ diff --git a/public/images/docs/latest/mockoon-cloud/templates-and-ai-assistant/templates-generate-get-route.png b/public/images/docs/latest/mockoon-cloud/templates-and-ai-assistant/templates-generate-get-route.png new file mode 100644 index 00000000..a48cd5ed Binary files /dev/null and b/public/images/docs/latest/mockoon-cloud/templates-and-ai-assistant/templates-generate-get-route.png differ diff --git a/public/images/docs/latest/mockoon-data-files/data-storage-location/enable-file-watching.png b/public/images/docs/latest/mockoon-data-files/data-storage-location/enable-file-watching.png index 97b45835..8930248d 100644 Binary files a/public/images/docs/latest/mockoon-data-files/data-storage-location/enable-file-watching.png and b/public/images/docs/latest/mockoon-data-files/data-storage-location/enable-file-watching.png differ diff --git a/public/images/docs/latest/mockoon-data-files/data-storage-location/environment-move-to-folder.png b/public/images/docs/latest/mockoon-data-files/data-storage-location/environment-move-to-folder.png index 7d6237ba..1b504ddb 100644 Binary files a/public/images/docs/latest/mockoon-data-files/data-storage-location/environment-move-to-folder.png and b/public/images/docs/latest/mockoon-data-files/data-storage-location/environment-move-to-folder.png differ diff --git a/public/images/docs/latest/mockoon-data-files/data-storage-location/environment-show-in-folder.png b/public/images/docs/latest/mockoon-data-files/data-storage-location/environment-show-in-folder.png index 1b223c0b..5bd3d4d1 100644 Binary files a/public/images/docs/latest/mockoon-data-files/data-storage-location/environment-show-in-folder.png and b/public/images/docs/latest/mockoon-data-files/data-storage-location/environment-show-in-folder.png differ diff --git a/public/images/docs/latest/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png b/public/images/docs/latest/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png index 4383cf42..32586853 100644 Binary files a/public/images/docs/latest/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png and b/public/images/docs/latest/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png differ diff --git a/public/images/docs/latest/mockoon-data-files/sharing-mock-api-files/open-environment.png b/public/images/docs/latest/mockoon-data-files/sharing-mock-api-files/open-environment.png index 2922c48d..57e6fd5d 100644 Binary files a/public/images/docs/latest/mockoon-data-files/sharing-mock-api-files/open-environment.png and b/public/images/docs/latest/mockoon-data-files/sharing-mock-api-files/open-environment.png differ diff --git a/public/images/docs/latest/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png b/public/images/docs/latest/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png index d1a5b3b0..d3445c68 100644 Binary files a/public/images/docs/latest/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png and b/public/images/docs/latest/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png differ diff --git a/public/images/docs/latest/response-configuration/file-serving/enable-404-fallback.png b/public/images/docs/latest/response-configuration/file-serving/enable-404-fallback.png index 7234506a..f934a4dc 100644 Binary files a/public/images/docs/latest/response-configuration/file-serving/enable-404-fallback.png and b/public/images/docs/latest/response-configuration/file-serving/enable-404-fallback.png differ diff --git a/public/images/docs/latest/response-configuration/file-serving/environment-show-in-folder.png b/public/images/docs/latest/response-configuration/file-serving/environment-show-in-folder.png index 6859aae8..907d7009 100644 Binary files a/public/images/docs/latest/response-configuration/file-serving/environment-show-in-folder.png and b/public/images/docs/latest/response-configuration/file-serving/environment-show-in-folder.png differ diff --git a/public/images/docs/latest/response-configuration/file-serving/file-path.png b/public/images/docs/latest/response-configuration/file-serving/file-path.png index c310f816..eebb36e7 100644 Binary files a/public/images/docs/latest/response-configuration/file-serving/file-path.png and b/public/images/docs/latest/response-configuration/file-serving/file-path.png differ diff --git a/public/images/docs/latest/response-configuration/file-serving/route-response-disable-templating.png b/public/images/docs/latest/response-configuration/file-serving/route-response-disable-templating.png index d68e9aa8..bfdbab41 100644 Binary files a/public/images/docs/latest/response-configuration/file-serving/route-response-disable-templating.png and b/public/images/docs/latest/response-configuration/file-serving/route-response-disable-templating.png differ diff --git a/public/images/docs/latest/response-configuration/response-body/body-data-bucket.png b/public/images/docs/latest/response-configuration/response-body/body-data-bucket.png index d70510ab..44a6204d 100644 Binary files a/public/images/docs/latest/response-configuration/response-body/body-data-bucket.png and b/public/images/docs/latest/response-configuration/response-body/body-data-bucket.png differ diff --git a/public/images/docs/latest/response-configuration/response-body/body-file-serving.png b/public/images/docs/latest/response-configuration/response-body/body-file-serving.png index 6e72efdc..01dcf0e4 100644 Binary files a/public/images/docs/latest/response-configuration/response-body/body-file-serving.png and b/public/images/docs/latest/response-configuration/response-body/body-file-serving.png differ diff --git a/public/images/docs/latest/response-configuration/response-body/body-type-toggle.png b/public/images/docs/latest/response-configuration/response-body/body-type-toggle.png index 3953e701..e7b07006 100644 Binary files a/public/images/docs/latest/response-configuration/response-body/body-type-toggle.png and b/public/images/docs/latest/response-configuration/response-body/body-type-toggle.png differ diff --git a/public/images/docs/latest/response-configuration/response-body/inline-body-editor.png b/public/images/docs/latest/response-configuration/response-body/inline-body-editor.png index 46e557f1..c6b91431 100644 Binary files a/public/images/docs/latest/response-configuration/response-body/inline-body-editor.png and b/public/images/docs/latest/response-configuration/response-body/inline-body-editor.png differ diff --git a/public/images/docs/latest/response-configuration/response-headers/add-environment-header.png b/public/images/docs/latest/response-configuration/response-headers/add-environment-header.png index a391e718..d5856a9f 100644 Binary files a/public/images/docs/latest/response-configuration/response-headers/add-environment-header.png and b/public/images/docs/latest/response-configuration/response-headers/add-environment-header.png differ diff --git a/public/images/docs/latest/response-configuration/response-headers/add-route-header.png b/public/images/docs/latest/response-configuration/response-headers/add-route-header.png index 9d470f1c..d817f346 100644 Binary files a/public/images/docs/latest/response-configuration/response-headers/add-route-header.png and b/public/images/docs/latest/response-configuration/response-headers/add-route-header.png differ diff --git a/public/images/docs/latest/response-configuration/response-headers/fill-route-header-form.png b/public/images/docs/latest/response-configuration/response-headers/fill-route-header-form.png index 59cf95e0..882dcb4c 100644 Binary files a/public/images/docs/latest/response-configuration/response-headers/fill-route-header-form.png and b/public/images/docs/latest/response-configuration/response-headers/fill-route-header-form.png differ diff --git a/public/images/docs/latest/response-configuration/response-headers/open-environment-headers.png b/public/images/docs/latest/response-configuration/response-headers/open-environment-headers.png index 176d3113..427d9702 100644 Binary files a/public/images/docs/latest/response-configuration/response-headers/open-environment-headers.png and b/public/images/docs/latest/response-configuration/response-headers/open-environment-headers.png differ diff --git a/public/images/docs/latest/route-responses/dynamic-rules/add-route-response-rule.png b/public/images/docs/latest/route-responses/dynamic-rules/add-route-response-rule.png index c8b79fc9..5948c1a6 100644 Binary files a/public/images/docs/latest/route-responses/dynamic-rules/add-route-response-rule.png and b/public/images/docs/latest/route-responses/dynamic-rules/add-route-response-rule.png differ diff --git a/public/images/docs/latest/route-responses/dynamic-rules/disable-rules.png b/public/images/docs/latest/route-responses/dynamic-rules/disable-rules.png index 4ddaf2bd..da03d8d8 100644 Binary files a/public/images/docs/latest/route-responses/dynamic-rules/disable-rules.png and b/public/images/docs/latest/route-responses/dynamic-rules/disable-rules.png differ diff --git a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rule-reorder.png b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rule-reorder.png index bf3883cb..fb615361 100644 Binary files a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rule-reorder.png and b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rule-reorder.png differ diff --git a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-comparison-operator.png b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-comparison-operator.png index 414aa5e8..38bb68fc 100644 Binary files a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-comparison-operator.png and b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-comparison-operator.png differ diff --git a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-invert-operator.png b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-invert-operator.png index 7f5d4b8e..08b5cb8a 100644 Binary files a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-invert-operator.png and b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-invert-operator.png differ diff --git a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-operator.png b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-operator.png index 5590cd48..76c68fdc 100644 Binary files a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-operator.png and b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-operator.png differ diff --git a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-property.png b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-property.png index 8189896b..3875e6fa 100644 Binary files a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-property.png and b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-property.png differ diff --git a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-target.png b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-target.png index 4cdabbb1..941f21a7 100644 Binary files a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-target.png and b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-target.png differ diff --git a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-value.png b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-value.png index 8b0b1efb..e6ba3258 100644 Binary files a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-value.png and b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-value.png differ diff --git a/public/images/docs/latest/route-responses/global-routes-with-rules/activate-fallback-mode.png b/public/images/docs/latest/route-responses/global-routes-with-rules/activate-fallback-mode.png index ab28b6bd..5c874e19 100644 Binary files a/public/images/docs/latest/route-responses/global-routes-with-rules/activate-fallback-mode.png and b/public/images/docs/latest/route-responses/global-routes-with-rules/activate-fallback-mode.png differ diff --git a/public/images/docs/latest/route-responses/global-routes-with-rules/create-wildcard-route.png b/public/images/docs/latest/route-responses/global-routes-with-rules/create-wildcard-route.png index 26cb0335..cf51d4e7 100644 Binary files a/public/images/docs/latest/route-responses/global-routes-with-rules/create-wildcard-route.png and b/public/images/docs/latest/route-responses/global-routes-with-rules/create-wildcard-route.png differ diff --git a/public/images/docs/latest/route-responses/global-routes-with-rules/response-rule-header-null.png b/public/images/docs/latest/route-responses/global-routes-with-rules/response-rule-header-null.png index a1e36ebb..9407bc08 100644 Binary files a/public/images/docs/latest/route-responses/global-routes-with-rules/response-rule-header-null.png and b/public/images/docs/latest/route-responses/global-routes-with-rules/response-rule-header-null.png differ diff --git a/public/images/docs/latest/route-responses/global-routes-with-rules/response-status-code-401.png b/public/images/docs/latest/route-responses/global-routes-with-rules/response-status-code-401.png index 1373019a..89d28245 100644 Binary files a/public/images/docs/latest/route-responses/global-routes-with-rules/response-status-code-401.png and b/public/images/docs/latest/route-responses/global-routes-with-rules/response-status-code-401.png differ diff --git a/public/images/docs/latest/route-responses/multiple-responses/add-route-response.png b/public/images/docs/latest/route-responses/multiple-responses/add-route-response.png index dfd798c0..6239b761 100644 Binary files a/public/images/docs/latest/route-responses/multiple-responses/add-route-response.png and b/public/images/docs/latest/route-responses/multiple-responses/add-route-response.png differ diff --git a/public/images/docs/latest/route-responses/multiple-responses/change-route-responses-default.png b/public/images/docs/latest/route-responses/multiple-responses/change-route-responses-default.png index b879eee1..641551fe 100644 Binary files a/public/images/docs/latest/route-responses/multiple-responses/change-route-responses-default.png and b/public/images/docs/latest/route-responses/multiple-responses/change-route-responses-default.png differ diff --git a/public/images/docs/latest/route-responses/multiple-responses/duplicate-route-response.png b/public/images/docs/latest/route-responses/multiple-responses/duplicate-route-response.png index e6620281..9c5bbb91 100644 Binary files a/public/images/docs/latest/route-responses/multiple-responses/duplicate-route-response.png and b/public/images/docs/latest/route-responses/multiple-responses/duplicate-route-response.png differ diff --git a/public/images/docs/latest/route-responses/multiple-responses/fallback-mode-responses.png b/public/images/docs/latest/route-responses/multiple-responses/fallback-mode-responses.png index 22cb0c22..5eee800e 100644 Binary files a/public/images/docs/latest/route-responses/multiple-responses/fallback-mode-responses.png and b/public/images/docs/latest/route-responses/multiple-responses/fallback-mode-responses.png differ diff --git a/public/images/docs/latest/route-responses/multiple-responses/random-route-responses.png b/public/images/docs/latest/route-responses/multiple-responses/random-route-responses.png index 707e8177..8c8599a6 100644 Binary files a/public/images/docs/latest/route-responses/multiple-responses/random-route-responses.png and b/public/images/docs/latest/route-responses/multiple-responses/random-route-responses.png differ diff --git a/public/images/docs/latest/route-responses/multiple-responses/reorder-responses.png b/public/images/docs/latest/route-responses/multiple-responses/reorder-responses.png index 963f9163..16415979 100644 Binary files a/public/images/docs/latest/route-responses/multiple-responses/reorder-responses.png and b/public/images/docs/latest/route-responses/multiple-responses/reorder-responses.png differ diff --git a/public/images/docs/latest/route-responses/multiple-responses/sequential-route-responses.png b/public/images/docs/latest/route-responses/multiple-responses/sequential-route-responses.png index 42ca38d3..b0715c68 100644 Binary files a/public/images/docs/latest/route-responses/multiple-responses/sequential-route-responses.png and b/public/images/docs/latest/route-responses/multiple-responses/sequential-route-responses.png differ diff --git a/public/images/docs/latest/server-configuration/cors/add-cors-headers.png b/public/images/docs/latest/server-configuration/cors/add-cors-headers.png index 9c9ead61..13c25c1f 100644 Binary files a/public/images/docs/latest/server-configuration/cors/add-cors-headers.png and b/public/images/docs/latest/server-configuration/cors/add-cors-headers.png differ diff --git a/public/images/docs/latest/server-configuration/cors/enable-cors.png b/public/images/docs/latest/server-configuration/cors/enable-cors.png index 0e60bbfa..eb515827 100644 Binary files a/public/images/docs/latest/server-configuration/cors/enable-cors.png and b/public/images/docs/latest/server-configuration/cors/enable-cors.png differ diff --git a/public/images/docs/latest/server-configuration/cors/open-environment-headers.png b/public/images/docs/latest/server-configuration/cors/open-environment-headers.png index 736e4278..5d2d8f59 100644 Binary files a/public/images/docs/latest/server-configuration/cors/open-environment-headers.png and b/public/images/docs/latest/server-configuration/cors/open-environment-headers.png differ diff --git a/public/images/docs/latest/server-configuration/cors/open-environment-settings.png b/public/images/docs/latest/server-configuration/cors/open-environment-settings.png index ad46c624..22e8b87a 100644 Binary files a/public/images/docs/latest/server-configuration/cors/open-environment-settings.png and b/public/images/docs/latest/server-configuration/cors/open-environment-settings.png differ diff --git a/public/images/docs/latest/server-configuration/cors/view-cors-headers.png b/public/images/docs/latest/server-configuration/cors/view-cors-headers.png index c2520a74..7132dbcd 100644 Binary files a/public/images/docs/latest/server-configuration/cors/view-cors-headers.png and b/public/images/docs/latest/server-configuration/cors/view-cors-headers.png differ diff --git a/public/images/docs/latest/server-configuration/listening-hostname/custom-hostname-setting.png b/public/images/docs/latest/server-configuration/listening-hostname/custom-hostname-setting.png index 14a4d07e..668f0b4b 100644 Binary files a/public/images/docs/latest/server-configuration/listening-hostname/custom-hostname-setting.png and b/public/images/docs/latest/server-configuration/listening-hostname/custom-hostname-setting.png differ diff --git a/public/images/docs/latest/server-configuration/listening-hostname/open-environment-settings.png b/public/images/docs/latest/server-configuration/listening-hostname/open-environment-settings.png index 19b0f2f0..99b2329b 100644 Binary files a/public/images/docs/latest/server-configuration/listening-hostname/open-environment-settings.png and b/public/images/docs/latest/server-configuration/listening-hostname/open-environment-settings.png differ diff --git a/public/images/docs/latest/server-configuration/port-prefix/environment-custom-port.png b/public/images/docs/latest/server-configuration/port-prefix/environment-custom-port.png index 1518157f..1ab2b910 100644 Binary files a/public/images/docs/latest/server-configuration/port-prefix/environment-custom-port.png and b/public/images/docs/latest/server-configuration/port-prefix/environment-custom-port.png differ diff --git a/public/images/docs/latest/server-configuration/port-prefix/environment-custom-prefix.png b/public/images/docs/latest/server-configuration/port-prefix/environment-custom-prefix.png index aab6a86e..b7abb2ec 100644 Binary files a/public/images/docs/latest/server-configuration/port-prefix/environment-custom-prefix.png and b/public/images/docs/latest/server-configuration/port-prefix/environment-custom-prefix.png differ diff --git a/public/images/docs/latest/server-configuration/port-prefix/open-environment-settings.png b/public/images/docs/latest/server-configuration/port-prefix/open-environment-settings.png index 02579395..fa69f2cc 100644 Binary files a/public/images/docs/latest/server-configuration/port-prefix/open-environment-settings.png and b/public/images/docs/latest/server-configuration/port-prefix/open-environment-settings.png differ diff --git a/public/images/docs/latest/server-configuration/proxy-mode/enable-proxy.png b/public/images/docs/latest/server-configuration/proxy-mode/enable-proxy.png index 759595c3..2b281487 100644 Binary files a/public/images/docs/latest/server-configuration/proxy-mode/enable-proxy.png and b/public/images/docs/latest/server-configuration/proxy-mode/enable-proxy.png differ diff --git a/public/images/docs/latest/server-configuration/proxy-mode/open-proxy-options.png b/public/images/docs/latest/server-configuration/proxy-mode/open-proxy-options.png index 0e64dc02..d7067370 100644 Binary files a/public/images/docs/latest/server-configuration/proxy-mode/open-proxy-options.png and b/public/images/docs/latest/server-configuration/proxy-mode/open-proxy-options.png differ diff --git a/public/images/docs/latest/server-configuration/proxy-mode/proxy-headers.png b/public/images/docs/latest/server-configuration/proxy-mode/proxy-headers.png index 49485957..cd35f5ad 100644 Binary files a/public/images/docs/latest/server-configuration/proxy-mode/proxy-headers.png and b/public/images/docs/latest/server-configuration/proxy-mode/proxy-headers.png differ diff --git a/public/images/docs/latest/server-configuration/proxy-mode/proxy-no-forward.png b/public/images/docs/latest/server-configuration/proxy-mode/proxy-no-forward.png index 0e2a1063..024ac8c1 100644 Binary files a/public/images/docs/latest/server-configuration/proxy-mode/proxy-no-forward.png and b/public/images/docs/latest/server-configuration/proxy-mode/proxy-no-forward.png differ diff --git a/public/images/docs/latest/server-configuration/serving-over-tls/enable-tls-custom-certificate.png b/public/images/docs/latest/server-configuration/serving-over-tls/enable-tls-custom-certificate.png index 4ef61787..66803cb8 100644 Binary files a/public/images/docs/latest/server-configuration/serving-over-tls/enable-tls-custom-certificate.png and b/public/images/docs/latest/server-configuration/serving-over-tls/enable-tls-custom-certificate.png differ diff --git a/public/images/docs/latest/server-configuration/serving-over-tls/enable-tls.png b/public/images/docs/latest/server-configuration/serving-over-tls/enable-tls.png index 97c1a399..863f17be 100644 Binary files a/public/images/docs/latest/server-configuration/serving-over-tls/enable-tls.png and b/public/images/docs/latest/server-configuration/serving-over-tls/enable-tls.png differ diff --git a/public/images/docs/latest/server-configuration/serving-over-tls/open-environment-settings.png b/public/images/docs/latest/server-configuration/serving-over-tls/open-environment-settings.png index db5cb01a..0086dbe4 100644 Binary files a/public/images/docs/latest/server-configuration/serving-over-tls/open-environment-settings.png and b/public/images/docs/latest/server-configuration/serving-over-tls/open-environment-settings.png differ diff --git a/public/images/docs/latest/templating/fakerjs-helpers/settings-faker.png b/public/images/docs/latest/templating/fakerjs-helpers/settings-faker.png index 3b0944c0..d82ce2a7 100644 Binary files a/public/images/docs/latest/templating/fakerjs-helpers/settings-faker.png and b/public/images/docs/latest/templating/fakerjs-helpers/settings-faker.png differ diff --git a/public/images/docs/latest/templating/overview/body-templating.png b/public/images/docs/latest/templating/overview/body-templating.png index 3f0fcc44..835da5eb 100644 Binary files a/public/images/docs/latest/templating/overview/body-templating.png and b/public/images/docs/latest/templating/overview/body-templating.png differ diff --git a/public/images/docs/latest/templating/overview/disable-route-response-templating.png b/public/images/docs/latest/templating/overview/disable-route-response-templating.png index 81b5d8bf..55999f94 100644 Binary files a/public/images/docs/latest/templating/overview/disable-route-response-templating.png and b/public/images/docs/latest/templating/overview/disable-route-response-templating.png differ diff --git a/public/images/docs/latest/templating/overview/file-path-templating.png b/public/images/docs/latest/templating/overview/file-path-templating.png index dc26f9ae..d6a5dfe1 100644 Binary files a/public/images/docs/latest/templating/overview/file-path-templating.png and b/public/images/docs/latest/templating/overview/file-path-templating.png differ diff --git a/public/images/docs/latest/templating/overview/headers-templating.png b/public/images/docs/latest/templating/overview/headers-templating.png index e15c2be2..bd4da45b 100644 Binary files a/public/images/docs/latest/templating/overview/headers-templating.png and b/public/images/docs/latest/templating/overview/headers-templating.png differ diff --git a/public/images/docs/latest/templating/overview/open-route-response-settings.png b/public/images/docs/latest/templating/overview/open-route-response-settings.png index 47111591..63708e97 100644 Binary files a/public/images/docs/latest/templating/overview/open-route-response-settings.png and b/public/images/docs/latest/templating/overview/open-route-response-settings.png differ diff --git a/public/images/docs/latest/templating/overview/template-helper-response-rule-value.png b/public/images/docs/latest/templating/overview/template-helper-response-rule-value.png index 6da086ef..16cb1f96 100644 Binary files a/public/images/docs/latest/templating/overview/template-helper-response-rule-value.png and b/public/images/docs/latest/templating/overview/template-helper-response-rule-value.png differ diff --git a/public/images/docs/latest/variables/environment-variables/settings-environment-variables-prefix.png b/public/images/docs/latest/variables/environment-variables/settings-environment-variables-prefix.png index 692df0b7..131194f3 100644 Binary files a/public/images/docs/latest/variables/environment-variables/settings-environment-variables-prefix.png and b/public/images/docs/latest/variables/environment-variables/settings-environment-variables-prefix.png differ diff --git a/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/cloud-sync-menu.png b/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/cloud-sync-menu.png new file mode 100644 index 00000000..3e19218a Binary files /dev/null and b/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/cloud-sync-menu.png differ diff --git a/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/convert-cloud-to-local.png b/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/convert-cloud-to-local.png new file mode 100644 index 00000000..b1c43559 Binary files /dev/null and b/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/convert-cloud-to-local.png differ diff --git a/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/create-cloud-environment.png b/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/create-cloud-environment.png new file mode 100644 index 00000000..9b0fcade Binary files /dev/null and b/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/create-cloud-environment.png differ diff --git a/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/offline-conflict-warning.png b/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/offline-conflict-warning.png new file mode 100644 index 00000000..e553795d Binary files /dev/null and b/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/offline-conflict-warning.png differ diff --git a/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/offline-editing-warning.png b/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/offline-editing-warning.png new file mode 100644 index 00000000..098d1cdc Binary files /dev/null and b/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/offline-editing-warning.png differ diff --git a/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/offline-reason-disconnected.png b/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/offline-reason-disconnected.png new file mode 100644 index 00000000..9d6bd3b6 Binary files /dev/null and b/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/offline-reason-disconnected.png differ diff --git a/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/offline-reason-incompatible-version.png b/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/offline-reason-incompatible-version.png new file mode 100644 index 00000000..0e031925 Binary files /dev/null and b/public/images/docs/static/mockoon-cloud/data-synchronization-team-collaboration/offline-reason-incompatible-version.png differ diff --git a/public/images/docs/v4.0.0/api-endpoints/crud-routes/add-crud-route.png b/public/images/docs/v4.0.0/api-endpoints/crud-routes/add-crud-route.png deleted file mode 100644 index 758a80bc..00000000 Binary files a/public/images/docs/v4.0.0/api-endpoints/crud-routes/add-crud-route.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/api-endpoints/crud-routes/customize-crud-id-property-key.png b/public/images/docs/v4.0.0/api-endpoints/crud-routes/customize-crud-id-property-key.png deleted file mode 100644 index 5a56707d..00000000 Binary files a/public/images/docs/v4.0.0/api-endpoints/crud-routes/customize-crud-id-property-key.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/api-endpoints/crud-routes/link-data-bucket-crud-route.png b/public/images/docs/v4.0.0/api-endpoints/crud-routes/link-data-bucket-crud-route.png deleted file mode 100644 index 0a66c98b..00000000 Binary files a/public/images/docs/v4.0.0/api-endpoints/crud-routes/link-data-bucket-crud-route.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/api-endpoints/crud-routes/set-crud-route-path.png b/public/images/docs/v4.0.0/api-endpoints/crud-routes/set-crud-route-path.png deleted file mode 100644 index 85e2c0b3..00000000 Binary files a/public/images/docs/v4.0.0/api-endpoints/crud-routes/set-crud-route-path.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/api-endpoints/folders/routes-nested-folder.png b/public/images/docs/v4.0.0/api-endpoints/folders/routes-nested-folder.png deleted file mode 100644 index bf997fae..00000000 Binary files a/public/images/docs/v4.0.0/api-endpoints/folders/routes-nested-folder.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/api-endpoints/routing/environment-prefix.png b/public/images/docs/v4.0.0/api-endpoints/routing/environment-prefix.png deleted file mode 100644 index 54081aba..00000000 Binary files a/public/images/docs/v4.0.0/api-endpoints/routing/environment-prefix.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/api-endpoints/routing/open-environment-settings.png b/public/images/docs/v4.0.0/api-endpoints/routing/open-environment-settings.png deleted file mode 100644 index 669ef81f..00000000 Binary files a/public/images/docs/v4.0.0/api-endpoints/routing/open-environment-settings.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/api-endpoints/routing/route-params.png b/public/images/docs/v4.0.0/api-endpoints/routing/route-params.png deleted file mode 100644 index 2f76f074..00000000 Binary files a/public/images/docs/v4.0.0/api-endpoints/routing/route-params.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/api-endpoints/routing/route-patterns.png b/public/images/docs/v4.0.0/api-endpoints/routing/route-patterns.png deleted file mode 100644 index e6c15d6b..00000000 Binary files a/public/images/docs/v4.0.0/api-endpoints/routing/route-patterns.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-button.png b/public/images/docs/v4.0.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-button.png deleted file mode 100644 index 5c2c4c48..00000000 Binary files a/public/images/docs/v4.0.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-button.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-template-tab.png b/public/images/docs/v4.0.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-template-tab.png deleted file mode 100644 index 2db23eeb..00000000 Binary files a/public/images/docs/v4.0.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-template-tab.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/api-endpoints/templates-and-ai-assistant/ai-assistant-template-generate-options.png b/public/images/docs/v4.0.0/api-endpoints/templates-and-ai-assistant/ai-assistant-template-generate-options.png deleted file mode 100644 index fa5cb628..00000000 Binary files a/public/images/docs/v4.0.0/api-endpoints/templates-and-ai-assistant/ai-assistant-template-generate-options.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/api-endpoints/templates-and-ai-assistant/pre-generated-templates-modal.png b/public/images/docs/v4.0.0/api-endpoints/templates-and-ai-assistant/pre-generated-templates-modal.png deleted file mode 100644 index a7be07c5..00000000 Binary files a/public/images/docs/v4.0.0/api-endpoints/templates-and-ai-assistant/pre-generated-templates-modal.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/api-endpoints/templates-and-ai-assistant/templates-create-get-route.png b/public/images/docs/v4.0.0/api-endpoints/templates-and-ai-assistant/templates-create-get-route.png deleted file mode 100644 index 4dd83815..00000000 Binary files a/public/images/docs/v4.0.0/api-endpoints/templates-and-ai-assistant/templates-create-get-route.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/api-endpoints/templates-and-ai-assistant/templates-generate-get-route.png b/public/images/docs/v4.0.0/api-endpoints/templates-and-ai-assistant/templates-generate-get-route.png deleted file mode 100644 index d5882091..00000000 Binary files a/public/images/docs/v4.0.0/api-endpoints/templates-and-ai-assistant/templates-generate-get-route.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/cors/add-cors-headers.png b/public/images/docs/v4.0.0/cors/add-cors-headers.png deleted file mode 100644 index 774bec95..00000000 Binary files a/public/images/docs/v4.0.0/cors/add-cors-headers.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/cors/enable-cors.png b/public/images/docs/v4.0.0/cors/enable-cors.png deleted file mode 100644 index c14720c9..00000000 Binary files a/public/images/docs/v4.0.0/cors/enable-cors.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/cors/open-environment-headers.png b/public/images/docs/v4.0.0/cors/open-environment-headers.png deleted file mode 100644 index ff441761..00000000 Binary files a/public/images/docs/v4.0.0/cors/open-environment-headers.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/cors/open-environment-settings.png b/public/images/docs/v4.0.0/cors/open-environment-settings.png deleted file mode 100644 index c4cb0045..00000000 Binary files a/public/images/docs/v4.0.0/cors/open-environment-settings.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/cors/view-cors-headers.png b/public/images/docs/v4.0.0/cors/view-cors-headers.png deleted file mode 100644 index 5f45fec9..00000000 Binary files a/public/images/docs/v4.0.0/cors/view-cors-headers.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/data-buckets/overview/add-data-bucket.png b/public/images/docs/v4.0.0/data-buckets/overview/add-data-bucket.png deleted file mode 100644 index 59f63bbf..00000000 Binary files a/public/images/docs/v4.0.0/data-buckets/overview/add-data-bucket.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/data-buckets/overview/open-data-view.png b/public/images/docs/v4.0.0/data-buckets/overview/open-data-view.png deleted file mode 100644 index 25cecbc0..00000000 Binary files a/public/images/docs/v4.0.0/data-buckets/overview/open-data-view.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/data-buckets/using-data-buckets/link-data-bucket-response.png b/public/images/docs/v4.0.0/data-buckets/using-data-buckets/link-data-bucket-response.png deleted file mode 100644 index 86891251..00000000 Binary files a/public/images/docs/v4.0.0/data-buckets/using-data-buckets/link-data-bucket-response.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/listening-hostname/custom-hostname-setting.png b/public/images/docs/v4.0.0/listening-hostname/custom-hostname-setting.png deleted file mode 100644 index d5f058be..00000000 Binary files a/public/images/docs/v4.0.0/listening-hostname/custom-hostname-setting.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/listening-hostname/open-environment-settings.png b/public/images/docs/v4.0.0/listening-hostname/open-environment-settings.png deleted file mode 100644 index 23d09331..00000000 Binary files a/public/images/docs/v4.0.0/listening-hostname/open-environment-settings.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png b/public/images/docs/v4.0.0/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png deleted file mode 100644 index a6ff4cb2..00000000 Binary files a/public/images/docs/v4.0.0/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png b/public/images/docs/v4.0.0/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png deleted file mode 100644 index c5047f4b..00000000 Binary files a/public/images/docs/v4.0.0/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png b/public/images/docs/v4.0.0/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png deleted file mode 100644 index 46fec48f..00000000 Binary files a/public/images/docs/v4.0.0/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/logging-and-recording/requests-logging/logs-metadata.png b/public/images/docs/v4.0.0/logging-and-recording/requests-logging/logs-metadata.png deleted file mode 100644 index 81a6b260..00000000 Binary files a/public/images/docs/v4.0.0/logging-and-recording/requests-logging/logs-metadata.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/logging-and-recording/requests-logging/logs-request.png b/public/images/docs/v4.0.0/logging-and-recording/requests-logging/logs-request.png deleted file mode 100644 index 3a102eb5..00000000 Binary files a/public/images/docs/v4.0.0/logging-and-recording/requests-logging/logs-request.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/logging-and-recording/requests-logging/logs-response.png b/public/images/docs/v4.0.0/logging-and-recording/requests-logging/logs-response.png deleted file mode 100644 index 6e5a184d..00000000 Binary files a/public/images/docs/v4.0.0/logging-and-recording/requests-logging/logs-response.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/logging-and-recording/requests-logging/logs-view-body-modal.png b/public/images/docs/v4.0.0/logging-and-recording/requests-logging/logs-view-body-modal.png deleted file mode 100644 index 570cb600..00000000 Binary files a/public/images/docs/v4.0.0/logging-and-recording/requests-logging/logs-view-body-modal.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/logging-and-recording/requests-logging/logs-view-body.png b/public/images/docs/v4.0.0/logging-and-recording/requests-logging/logs-view-body.png deleted file mode 100644 index 050e8f4d..00000000 Binary files a/public/images/docs/v4.0.0/logging-and-recording/requests-logging/logs-view-body.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/logging-and-recording/requests-logging/open-logs.png b/public/images/docs/v4.0.0/logging-and-recording/requests-logging/open-logs.png deleted file mode 100644 index 7eb8773b..00000000 Binary files a/public/images/docs/v4.0.0/logging-and-recording/requests-logging/open-logs.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/mockoon-data-files/data-storage-location/environment-move-to-folder.png b/public/images/docs/v4.0.0/mockoon-data-files/data-storage-location/environment-move-to-folder.png deleted file mode 100644 index 0e5b7112..00000000 Binary files a/public/images/docs/v4.0.0/mockoon-data-files/data-storage-location/environment-move-to-folder.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/mockoon-data-files/data-storage-location/environment-show-in-folder.png b/public/images/docs/v4.0.0/mockoon-data-files/data-storage-location/environment-show-in-folder.png deleted file mode 100644 index a32b79e8..00000000 Binary files a/public/images/docs/v4.0.0/mockoon-data-files/data-storage-location/environment-show-in-folder.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png b/public/images/docs/v4.0.0/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png deleted file mode 100644 index 76db0c71..00000000 Binary files a/public/images/docs/v4.0.0/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/mockoon-data-files/import-export-mockoon-format/legacy-export-file-open-prompt.png b/public/images/docs/v4.0.0/mockoon-data-files/import-export-mockoon-format/legacy-export-file-open-prompt.png deleted file mode 100644 index 977919fc..00000000 Binary files a/public/images/docs/v4.0.0/mockoon-data-files/import-export-mockoon-format/legacy-export-file-open-prompt.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/mockoon-data-files/sharing-mock-api-files/open-environment.png b/public/images/docs/v4.0.0/mockoon-data-files/sharing-mock-api-files/open-environment.png deleted file mode 100644 index d0650e5a..00000000 Binary files a/public/images/docs/v4.0.0/mockoon-data-files/sharing-mock-api-files/open-environment.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png b/public/images/docs/v4.0.0/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png deleted file mode 100644 index c02ba9d1..00000000 Binary files a/public/images/docs/v4.0.0/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/proxy-mode/enable-proxy.png b/public/images/docs/v4.0.0/proxy-mode/enable-proxy.png deleted file mode 100644 index 4de2c612..00000000 Binary files a/public/images/docs/v4.0.0/proxy-mode/enable-proxy.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/proxy-mode/open-proxy-options.png b/public/images/docs/v4.0.0/proxy-mode/open-proxy-options.png deleted file mode 100644 index aa85da17..00000000 Binary files a/public/images/docs/v4.0.0/proxy-mode/open-proxy-options.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/proxy-mode/proxy-headers.png b/public/images/docs/v4.0.0/proxy-mode/proxy-headers.png deleted file mode 100644 index 601e0085..00000000 Binary files a/public/images/docs/v4.0.0/proxy-mode/proxy-headers.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/proxy-mode/proxy-no-forward.png b/public/images/docs/v4.0.0/proxy-mode/proxy-no-forward.png deleted file mode 100644 index 9cbaf711..00000000 Binary files a/public/images/docs/v4.0.0/proxy-mode/proxy-no-forward.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/response-body/file-serving/enable-404-fallback.png b/public/images/docs/v4.0.0/response-body/file-serving/enable-404-fallback.png deleted file mode 100644 index 8e554d71..00000000 Binary files a/public/images/docs/v4.0.0/response-body/file-serving/enable-404-fallback.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/response-body/file-serving/environment-show-in-folder.png b/public/images/docs/v4.0.0/response-body/file-serving/environment-show-in-folder.png deleted file mode 100644 index a3e56dcc..00000000 Binary files a/public/images/docs/v4.0.0/response-body/file-serving/environment-show-in-folder.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/response-body/file-serving/file-path.png b/public/images/docs/v4.0.0/response-body/file-serving/file-path.png deleted file mode 100644 index 8c255e18..00000000 Binary files a/public/images/docs/v4.0.0/response-body/file-serving/file-path.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/response-body/file-serving/route-response-disable-templating.png b/public/images/docs/v4.0.0/response-body/file-serving/route-response-disable-templating.png deleted file mode 100644 index 590dde04..00000000 Binary files a/public/images/docs/v4.0.0/response-body/file-serving/route-response-disable-templating.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/response-body/overview/body-data-bucket.png b/public/images/docs/v4.0.0/response-body/overview/body-data-bucket.png deleted file mode 100644 index 48f412e0..00000000 Binary files a/public/images/docs/v4.0.0/response-body/overview/body-data-bucket.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/response-body/overview/body-file-serving.png b/public/images/docs/v4.0.0/response-body/overview/body-file-serving.png deleted file mode 100644 index aaf7e228..00000000 Binary files a/public/images/docs/v4.0.0/response-body/overview/body-file-serving.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/response-body/overview/body-type-toggle.png b/public/images/docs/v4.0.0/response-body/overview/body-type-toggle.png deleted file mode 100644 index ebd73d5c..00000000 Binary files a/public/images/docs/v4.0.0/response-body/overview/body-type-toggle.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/response-body/overview/inline-body-editor.png b/public/images/docs/v4.0.0/response-body/overview/inline-body-editor.png deleted file mode 100644 index a05a81fa..00000000 Binary files a/public/images/docs/v4.0.0/response-body/overview/inline-body-editor.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/response-headers/add-environment-header.png b/public/images/docs/v4.0.0/response-headers/add-environment-header.png deleted file mode 100644 index 09899ecb..00000000 Binary files a/public/images/docs/v4.0.0/response-headers/add-environment-header.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/response-headers/add-route-header.png b/public/images/docs/v4.0.0/response-headers/add-route-header.png deleted file mode 100644 index a31d3c2b..00000000 Binary files a/public/images/docs/v4.0.0/response-headers/add-route-header.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/response-headers/fill-route-header-form.png b/public/images/docs/v4.0.0/response-headers/fill-route-header-form.png deleted file mode 100644 index 9ae6c8d5..00000000 Binary files a/public/images/docs/v4.0.0/response-headers/fill-route-header-form.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/response-headers/open-environment-headers.png b/public/images/docs/v4.0.0/response-headers/open-environment-headers.png deleted file mode 100644 index 49bf6f5a..00000000 Binary files a/public/images/docs/v4.0.0/response-headers/open-environment-headers.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/route-responses/dynamic-rules/add-route-response-rule.png b/public/images/docs/v4.0.0/route-responses/dynamic-rules/add-route-response-rule.png deleted file mode 100644 index 6d015b5c..00000000 Binary files a/public/images/docs/v4.0.0/route-responses/dynamic-rules/add-route-response-rule.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/route-responses/dynamic-rules/disable-rules.png b/public/images/docs/v4.0.0/route-responses/dynamic-rules/disable-rules.png deleted file mode 100644 index 1a5246c1..00000000 Binary files a/public/images/docs/v4.0.0/route-responses/dynamic-rules/disable-rules.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rule-reorder.png b/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rule-reorder.png deleted file mode 100644 index 9729dcc8..00000000 Binary files a/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rule-reorder.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rules-comparison-operator.png b/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rules-comparison-operator.png deleted file mode 100644 index de4a61dd..00000000 Binary files a/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rules-comparison-operator.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rules-invert-operator.png b/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rules-invert-operator.png deleted file mode 100644 index 0164054c..00000000 Binary files a/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rules-invert-operator.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rules-operator.png b/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rules-operator.png deleted file mode 100644 index 518bdcee..00000000 Binary files a/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rules-operator.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rules-property.png b/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rules-property.png deleted file mode 100644 index 3a6a2325..00000000 Binary files a/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rules-property.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rules-target.png b/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rules-target.png deleted file mode 100644 index de8811e5..00000000 Binary files a/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rules-target.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rules-value.png b/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rules-value.png deleted file mode 100644 index c3ffc087..00000000 Binary files a/public/images/docs/v4.0.0/route-responses/dynamic-rules/route-response-rules-value.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/route-responses/multiple-responses/add-route-response.png b/public/images/docs/v4.0.0/route-responses/multiple-responses/add-route-response.png deleted file mode 100644 index a29dffe6..00000000 Binary files a/public/images/docs/v4.0.0/route-responses/multiple-responses/add-route-response.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/route-responses/multiple-responses/change-route-responses-default.png b/public/images/docs/v4.0.0/route-responses/multiple-responses/change-route-responses-default.png deleted file mode 100644 index fb275148..00000000 Binary files a/public/images/docs/v4.0.0/route-responses/multiple-responses/change-route-responses-default.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/route-responses/multiple-responses/duplicate-route-response.png b/public/images/docs/v4.0.0/route-responses/multiple-responses/duplicate-route-response.png deleted file mode 100644 index 19752280..00000000 Binary files a/public/images/docs/v4.0.0/route-responses/multiple-responses/duplicate-route-response.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/route-responses/multiple-responses/random-route-responses.png b/public/images/docs/v4.0.0/route-responses/multiple-responses/random-route-responses.png deleted file mode 100644 index 7142c570..00000000 Binary files a/public/images/docs/v4.0.0/route-responses/multiple-responses/random-route-responses.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/route-responses/multiple-responses/reorder-responses.png b/public/images/docs/v4.0.0/route-responses/multiple-responses/reorder-responses.png deleted file mode 100644 index af75694d..00000000 Binary files a/public/images/docs/v4.0.0/route-responses/multiple-responses/reorder-responses.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/route-responses/multiple-responses/sequential-route-responses.png b/public/images/docs/v4.0.0/route-responses/multiple-responses/sequential-route-responses.png deleted file mode 100644 index 4b077e05..00000000 Binary files a/public/images/docs/v4.0.0/route-responses/multiple-responses/sequential-route-responses.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/serving-over-tls/enable-tls-custom-certificate.png b/public/images/docs/v4.0.0/serving-over-tls/enable-tls-custom-certificate.png deleted file mode 100644 index e4061343..00000000 Binary files a/public/images/docs/v4.0.0/serving-over-tls/enable-tls-custom-certificate.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/serving-over-tls/enable-tls.png b/public/images/docs/v4.0.0/serving-over-tls/enable-tls.png deleted file mode 100644 index f69f60a0..00000000 Binary files a/public/images/docs/v4.0.0/serving-over-tls/enable-tls.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/serving-over-tls/open-environment-settings.png b/public/images/docs/v4.0.0/serving-over-tls/open-environment-settings.png deleted file mode 100644 index 4eeb1c04..00000000 Binary files a/public/images/docs/v4.0.0/serving-over-tls/open-environment-settings.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/templating/fakerjs-helpers/settings-faker.png b/public/images/docs/v4.0.0/templating/fakerjs-helpers/settings-faker.png deleted file mode 100644 index aa6efd21..00000000 Binary files a/public/images/docs/v4.0.0/templating/fakerjs-helpers/settings-faker.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/templating/overview/body-templating.png b/public/images/docs/v4.0.0/templating/overview/body-templating.png deleted file mode 100644 index c94fee59..00000000 Binary files a/public/images/docs/v4.0.0/templating/overview/body-templating.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/templating/overview/disable-route-response-templating.png b/public/images/docs/v4.0.0/templating/overview/disable-route-response-templating.png deleted file mode 100644 index 81581c91..00000000 Binary files a/public/images/docs/v4.0.0/templating/overview/disable-route-response-templating.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/templating/overview/file-path-templating.png b/public/images/docs/v4.0.0/templating/overview/file-path-templating.png deleted file mode 100644 index f131066a..00000000 Binary files a/public/images/docs/v4.0.0/templating/overview/file-path-templating.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/templating/overview/headers-templating.png b/public/images/docs/v4.0.0/templating/overview/headers-templating.png deleted file mode 100644 index 1fd87a7f..00000000 Binary files a/public/images/docs/v4.0.0/templating/overview/headers-templating.png and /dev/null differ diff --git a/public/images/docs/v4.0.0/templating/overview/open-route-response-settings.png b/public/images/docs/v4.0.0/templating/overview/open-route-response-settings.png deleted file mode 100644 index 2a109b4a..00000000 Binary files a/public/images/docs/v4.0.0/templating/overview/open-route-response-settings.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/api-endpoints/crud-routes/add-crud-route.png b/public/images/docs/v4.1.0/api-endpoints/crud-routes/add-crud-route.png deleted file mode 100644 index f3889efa..00000000 Binary files a/public/images/docs/v4.1.0/api-endpoints/crud-routes/add-crud-route.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/api-endpoints/crud-routes/customize-crud-id-property-key.png b/public/images/docs/v4.1.0/api-endpoints/crud-routes/customize-crud-id-property-key.png deleted file mode 100644 index 3b8a0a63..00000000 Binary files a/public/images/docs/v4.1.0/api-endpoints/crud-routes/customize-crud-id-property-key.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/api-endpoints/crud-routes/link-data-bucket-crud-route.png b/public/images/docs/v4.1.0/api-endpoints/crud-routes/link-data-bucket-crud-route.png deleted file mode 100644 index 46abece3..00000000 Binary files a/public/images/docs/v4.1.0/api-endpoints/crud-routes/link-data-bucket-crud-route.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/api-endpoints/crud-routes/set-crud-route-path.png b/public/images/docs/v4.1.0/api-endpoints/crud-routes/set-crud-route-path.png deleted file mode 100644 index 5ec05c28..00000000 Binary files a/public/images/docs/v4.1.0/api-endpoints/crud-routes/set-crud-route-path.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/api-endpoints/folders/routes-nested-folder.png b/public/images/docs/v4.1.0/api-endpoints/folders/routes-nested-folder.png deleted file mode 100644 index bf997fae..00000000 Binary files a/public/images/docs/v4.1.0/api-endpoints/folders/routes-nested-folder.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/api-endpoints/routing/environment-prefix.png b/public/images/docs/v4.1.0/api-endpoints/routing/environment-prefix.png deleted file mode 100644 index 54081aba..00000000 Binary files a/public/images/docs/v4.1.0/api-endpoints/routing/environment-prefix.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/api-endpoints/routing/open-environment-settings.png b/public/images/docs/v4.1.0/api-endpoints/routing/open-environment-settings.png deleted file mode 100644 index 669ef81f..00000000 Binary files a/public/images/docs/v4.1.0/api-endpoints/routing/open-environment-settings.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/api-endpoints/routing/route-params.png b/public/images/docs/v4.1.0/api-endpoints/routing/route-params.png deleted file mode 100644 index 2f76f074..00000000 Binary files a/public/images/docs/v4.1.0/api-endpoints/routing/route-params.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/api-endpoints/routing/route-patterns.png b/public/images/docs/v4.1.0/api-endpoints/routing/route-patterns.png deleted file mode 100644 index e6c15d6b..00000000 Binary files a/public/images/docs/v4.1.0/api-endpoints/routing/route-patterns.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-button.png b/public/images/docs/v4.1.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-button.png deleted file mode 100644 index f421009d..00000000 Binary files a/public/images/docs/v4.1.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-button.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-template-tab.png b/public/images/docs/v4.1.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-template-tab.png deleted file mode 100644 index 78f2e0f5..00000000 Binary files a/public/images/docs/v4.1.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-template-tab.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/api-endpoints/templates-and-ai-assistant/ai-assistant-template-generate-options.png b/public/images/docs/v4.1.0/api-endpoints/templates-and-ai-assistant/ai-assistant-template-generate-options.png deleted file mode 100644 index c53c560c..00000000 Binary files a/public/images/docs/v4.1.0/api-endpoints/templates-and-ai-assistant/ai-assistant-template-generate-options.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/api-endpoints/templates-and-ai-assistant/pre-generated-templates-modal.png b/public/images/docs/v4.1.0/api-endpoints/templates-and-ai-assistant/pre-generated-templates-modal.png deleted file mode 100644 index b59a6923..00000000 Binary files a/public/images/docs/v4.1.0/api-endpoints/templates-and-ai-assistant/pre-generated-templates-modal.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/api-endpoints/templates-and-ai-assistant/templates-create-get-route.png b/public/images/docs/v4.1.0/api-endpoints/templates-and-ai-assistant/templates-create-get-route.png deleted file mode 100644 index 4dd83815..00000000 Binary files a/public/images/docs/v4.1.0/api-endpoints/templates-and-ai-assistant/templates-create-get-route.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/api-endpoints/templates-and-ai-assistant/templates-generate-get-route.png b/public/images/docs/v4.1.0/api-endpoints/templates-and-ai-assistant/templates-generate-get-route.png deleted file mode 100644 index 2b96a789..00000000 Binary files a/public/images/docs/v4.1.0/api-endpoints/templates-and-ai-assistant/templates-generate-get-route.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/cors/add-cors-headers.png b/public/images/docs/v4.1.0/cors/add-cors-headers.png deleted file mode 100644 index 700f8b0e..00000000 Binary files a/public/images/docs/v4.1.0/cors/add-cors-headers.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/cors/enable-cors.png b/public/images/docs/v4.1.0/cors/enable-cors.png deleted file mode 100644 index e652fd85..00000000 Binary files a/public/images/docs/v4.1.0/cors/enable-cors.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/cors/open-environment-headers.png b/public/images/docs/v4.1.0/cors/open-environment-headers.png deleted file mode 100644 index a306858b..00000000 Binary files a/public/images/docs/v4.1.0/cors/open-environment-headers.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/cors/open-environment-settings.png b/public/images/docs/v4.1.0/cors/open-environment-settings.png deleted file mode 100644 index 829f2b4a..00000000 Binary files a/public/images/docs/v4.1.0/cors/open-environment-settings.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/cors/view-cors-headers.png b/public/images/docs/v4.1.0/cors/view-cors-headers.png deleted file mode 100644 index 6b4fb754..00000000 Binary files a/public/images/docs/v4.1.0/cors/view-cors-headers.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/data-buckets/overview/add-data-bucket.png b/public/images/docs/v4.1.0/data-buckets/overview/add-data-bucket.png deleted file mode 100644 index 20728f14..00000000 Binary files a/public/images/docs/v4.1.0/data-buckets/overview/add-data-bucket.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/data-buckets/overview/open-data-view.png b/public/images/docs/v4.1.0/data-buckets/overview/open-data-view.png deleted file mode 100644 index ff0ffe33..00000000 Binary files a/public/images/docs/v4.1.0/data-buckets/overview/open-data-view.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/data-buckets/using-data-buckets/link-data-bucket-response.png b/public/images/docs/v4.1.0/data-buckets/using-data-buckets/link-data-bucket-response.png deleted file mode 100644 index 6dd3cb26..00000000 Binary files a/public/images/docs/v4.1.0/data-buckets/using-data-buckets/link-data-bucket-response.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/listening-hostname/custom-hostname-setting.png b/public/images/docs/v4.1.0/listening-hostname/custom-hostname-setting.png deleted file mode 100644 index 59ae4a85..00000000 Binary files a/public/images/docs/v4.1.0/listening-hostname/custom-hostname-setting.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/listening-hostname/open-environment-settings.png b/public/images/docs/v4.1.0/listening-hostname/open-environment-settings.png deleted file mode 100644 index 8b1d518a..00000000 Binary files a/public/images/docs/v4.1.0/listening-hostname/open-environment-settings.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png b/public/images/docs/v4.1.0/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png deleted file mode 100644 index 0ee2cca2..00000000 Binary files a/public/images/docs/v4.1.0/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png b/public/images/docs/v4.1.0/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png deleted file mode 100644 index 1b9119d7..00000000 Binary files a/public/images/docs/v4.1.0/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png b/public/images/docs/v4.1.0/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png deleted file mode 100644 index be7a1ce8..00000000 Binary files a/public/images/docs/v4.1.0/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/logging-and-recording/requests-logging/logs-metadata.png b/public/images/docs/v4.1.0/logging-and-recording/requests-logging/logs-metadata.png deleted file mode 100644 index 77776f61..00000000 Binary files a/public/images/docs/v4.1.0/logging-and-recording/requests-logging/logs-metadata.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/logging-and-recording/requests-logging/logs-request.png b/public/images/docs/v4.1.0/logging-and-recording/requests-logging/logs-request.png deleted file mode 100644 index de845e06..00000000 Binary files a/public/images/docs/v4.1.0/logging-and-recording/requests-logging/logs-request.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/logging-and-recording/requests-logging/logs-response.png b/public/images/docs/v4.1.0/logging-and-recording/requests-logging/logs-response.png deleted file mode 100644 index ec920ec4..00000000 Binary files a/public/images/docs/v4.1.0/logging-and-recording/requests-logging/logs-response.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/logging-and-recording/requests-logging/logs-view-body-modal.png b/public/images/docs/v4.1.0/logging-and-recording/requests-logging/logs-view-body-modal.png deleted file mode 100644 index 570cb600..00000000 Binary files a/public/images/docs/v4.1.0/logging-and-recording/requests-logging/logs-view-body-modal.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/logging-and-recording/requests-logging/logs-view-body.png b/public/images/docs/v4.1.0/logging-and-recording/requests-logging/logs-view-body.png deleted file mode 100644 index 94c87a2b..00000000 Binary files a/public/images/docs/v4.1.0/logging-and-recording/requests-logging/logs-view-body.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/logging-and-recording/requests-logging/open-logs.png b/public/images/docs/v4.1.0/logging-and-recording/requests-logging/open-logs.png deleted file mode 100644 index 7eb8773b..00000000 Binary files a/public/images/docs/v4.1.0/logging-and-recording/requests-logging/open-logs.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/mockoon-data-files/data-storage-location/environment-move-to-folder.png b/public/images/docs/v4.1.0/mockoon-data-files/data-storage-location/environment-move-to-folder.png deleted file mode 100644 index 0e5b7112..00000000 Binary files a/public/images/docs/v4.1.0/mockoon-data-files/data-storage-location/environment-move-to-folder.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/mockoon-data-files/data-storage-location/environment-show-in-folder.png b/public/images/docs/v4.1.0/mockoon-data-files/data-storage-location/environment-show-in-folder.png deleted file mode 100644 index a32b79e8..00000000 Binary files a/public/images/docs/v4.1.0/mockoon-data-files/data-storage-location/environment-show-in-folder.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png b/public/images/docs/v4.1.0/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png deleted file mode 100644 index 4668007f..00000000 Binary files a/public/images/docs/v4.1.0/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/mockoon-data-files/import-export-mockoon-format/legacy-export-file-open-prompt.png b/public/images/docs/v4.1.0/mockoon-data-files/import-export-mockoon-format/legacy-export-file-open-prompt.png deleted file mode 100644 index 977919fc..00000000 Binary files a/public/images/docs/v4.1.0/mockoon-data-files/import-export-mockoon-format/legacy-export-file-open-prompt.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/mockoon-data-files/sharing-mock-api-files/open-environment.png b/public/images/docs/v4.1.0/mockoon-data-files/sharing-mock-api-files/open-environment.png deleted file mode 100644 index d0650e5a..00000000 Binary files a/public/images/docs/v4.1.0/mockoon-data-files/sharing-mock-api-files/open-environment.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png b/public/images/docs/v4.1.0/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png deleted file mode 100644 index dc6fc1eb..00000000 Binary files a/public/images/docs/v4.1.0/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/proxy-mode/enable-proxy.png b/public/images/docs/v4.1.0/proxy-mode/enable-proxy.png deleted file mode 100644 index 4de2c612..00000000 Binary files a/public/images/docs/v4.1.0/proxy-mode/enable-proxy.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/proxy-mode/open-proxy-options.png b/public/images/docs/v4.1.0/proxy-mode/open-proxy-options.png deleted file mode 100644 index aa85da17..00000000 Binary files a/public/images/docs/v4.1.0/proxy-mode/open-proxy-options.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/proxy-mode/proxy-headers.png b/public/images/docs/v4.1.0/proxy-mode/proxy-headers.png deleted file mode 100644 index 601e0085..00000000 Binary files a/public/images/docs/v4.1.0/proxy-mode/proxy-headers.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/proxy-mode/proxy-no-forward.png b/public/images/docs/v4.1.0/proxy-mode/proxy-no-forward.png deleted file mode 100644 index 9cbaf711..00000000 Binary files a/public/images/docs/v4.1.0/proxy-mode/proxy-no-forward.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/response-body/file-serving/enable-404-fallback.png b/public/images/docs/v4.1.0/response-body/file-serving/enable-404-fallback.png deleted file mode 100644 index 947b9c53..00000000 Binary files a/public/images/docs/v4.1.0/response-body/file-serving/enable-404-fallback.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/response-body/file-serving/environment-show-in-folder.png b/public/images/docs/v4.1.0/response-body/file-serving/environment-show-in-folder.png deleted file mode 100644 index a3e56dcc..00000000 Binary files a/public/images/docs/v4.1.0/response-body/file-serving/environment-show-in-folder.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/response-body/file-serving/file-path.png b/public/images/docs/v4.1.0/response-body/file-serving/file-path.png deleted file mode 100644 index 8c255e18..00000000 Binary files a/public/images/docs/v4.1.0/response-body/file-serving/file-path.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/response-body/file-serving/route-response-disable-templating.png b/public/images/docs/v4.1.0/response-body/file-serving/route-response-disable-templating.png deleted file mode 100644 index 745d9132..00000000 Binary files a/public/images/docs/v4.1.0/response-body/file-serving/route-response-disable-templating.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/response-body/overview/body-data-bucket.png b/public/images/docs/v4.1.0/response-body/overview/body-data-bucket.png deleted file mode 100644 index cbb5755a..00000000 Binary files a/public/images/docs/v4.1.0/response-body/overview/body-data-bucket.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/response-body/overview/body-file-serving.png b/public/images/docs/v4.1.0/response-body/overview/body-file-serving.png deleted file mode 100644 index 578fffca..00000000 Binary files a/public/images/docs/v4.1.0/response-body/overview/body-file-serving.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/response-body/overview/body-type-toggle.png b/public/images/docs/v4.1.0/response-body/overview/body-type-toggle.png deleted file mode 100644 index acb8a49a..00000000 Binary files a/public/images/docs/v4.1.0/response-body/overview/body-type-toggle.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/response-body/overview/inline-body-editor.png b/public/images/docs/v4.1.0/response-body/overview/inline-body-editor.png deleted file mode 100644 index 66bea675..00000000 Binary files a/public/images/docs/v4.1.0/response-body/overview/inline-body-editor.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/response-headers/add-environment-header.png b/public/images/docs/v4.1.0/response-headers/add-environment-header.png deleted file mode 100644 index 09899ecb..00000000 Binary files a/public/images/docs/v4.1.0/response-headers/add-environment-header.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/response-headers/add-route-header.png b/public/images/docs/v4.1.0/response-headers/add-route-header.png deleted file mode 100644 index facf934f..00000000 Binary files a/public/images/docs/v4.1.0/response-headers/add-route-header.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/response-headers/fill-route-header-form.png b/public/images/docs/v4.1.0/response-headers/fill-route-header-form.png deleted file mode 100644 index 00d4f6fb..00000000 Binary files a/public/images/docs/v4.1.0/response-headers/fill-route-header-form.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/response-headers/open-environment-headers.png b/public/images/docs/v4.1.0/response-headers/open-environment-headers.png deleted file mode 100644 index 49bf6f5a..00000000 Binary files a/public/images/docs/v4.1.0/response-headers/open-environment-headers.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/route-responses/dynamic-rules/add-route-response-rule.png b/public/images/docs/v4.1.0/route-responses/dynamic-rules/add-route-response-rule.png deleted file mode 100644 index 13f136d5..00000000 Binary files a/public/images/docs/v4.1.0/route-responses/dynamic-rules/add-route-response-rule.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/route-responses/dynamic-rules/disable-rules.png b/public/images/docs/v4.1.0/route-responses/dynamic-rules/disable-rules.png deleted file mode 100644 index bcda13a6..00000000 Binary files a/public/images/docs/v4.1.0/route-responses/dynamic-rules/disable-rules.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rule-reorder.png b/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rule-reorder.png deleted file mode 100644 index 145eb298..00000000 Binary files a/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rule-reorder.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rules-comparison-operator.png b/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rules-comparison-operator.png deleted file mode 100644 index 37397252..00000000 Binary files a/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rules-comparison-operator.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rules-invert-operator.png b/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rules-invert-operator.png deleted file mode 100644 index b5326686..00000000 Binary files a/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rules-invert-operator.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rules-operator.png b/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rules-operator.png deleted file mode 100644 index 85080e5f..00000000 Binary files a/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rules-operator.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rules-property.png b/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rules-property.png deleted file mode 100644 index 9be71f36..00000000 Binary files a/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rules-property.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rules-target.png b/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rules-target.png deleted file mode 100644 index 433915aa..00000000 Binary files a/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rules-target.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rules-value.png b/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rules-value.png deleted file mode 100644 index bdf10b39..00000000 Binary files a/public/images/docs/v4.1.0/route-responses/dynamic-rules/route-response-rules-value.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/route-responses/multiple-responses/add-route-response.png b/public/images/docs/v4.1.0/route-responses/multiple-responses/add-route-response.png deleted file mode 100644 index a050804d..00000000 Binary files a/public/images/docs/v4.1.0/route-responses/multiple-responses/add-route-response.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/route-responses/multiple-responses/change-route-responses-default.png b/public/images/docs/v4.1.0/route-responses/multiple-responses/change-route-responses-default.png deleted file mode 100644 index 8a7834f5..00000000 Binary files a/public/images/docs/v4.1.0/route-responses/multiple-responses/change-route-responses-default.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/route-responses/multiple-responses/duplicate-route-response.png b/public/images/docs/v4.1.0/route-responses/multiple-responses/duplicate-route-response.png deleted file mode 100644 index 9d759bf4..00000000 Binary files a/public/images/docs/v4.1.0/route-responses/multiple-responses/duplicate-route-response.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/route-responses/multiple-responses/fallback-mode-responses.png b/public/images/docs/v4.1.0/route-responses/multiple-responses/fallback-mode-responses.png deleted file mode 100644 index d0ee2398..00000000 Binary files a/public/images/docs/v4.1.0/route-responses/multiple-responses/fallback-mode-responses.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/route-responses/multiple-responses/random-route-responses.png b/public/images/docs/v4.1.0/route-responses/multiple-responses/random-route-responses.png deleted file mode 100644 index 5a108c1b..00000000 Binary files a/public/images/docs/v4.1.0/route-responses/multiple-responses/random-route-responses.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/route-responses/multiple-responses/reorder-responses.png b/public/images/docs/v4.1.0/route-responses/multiple-responses/reorder-responses.png deleted file mode 100644 index 3013becc..00000000 Binary files a/public/images/docs/v4.1.0/route-responses/multiple-responses/reorder-responses.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/route-responses/multiple-responses/sequential-route-responses.png b/public/images/docs/v4.1.0/route-responses/multiple-responses/sequential-route-responses.png deleted file mode 100644 index 54b61a1f..00000000 Binary files a/public/images/docs/v4.1.0/route-responses/multiple-responses/sequential-route-responses.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/serving-over-tls/enable-tls-custom-certificate.png b/public/images/docs/v4.1.0/serving-over-tls/enable-tls-custom-certificate.png deleted file mode 100644 index f48c00b0..00000000 Binary files a/public/images/docs/v4.1.0/serving-over-tls/enable-tls-custom-certificate.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/serving-over-tls/enable-tls.png b/public/images/docs/v4.1.0/serving-over-tls/enable-tls.png deleted file mode 100644 index a5a954d6..00000000 Binary files a/public/images/docs/v4.1.0/serving-over-tls/enable-tls.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/serving-over-tls/open-environment-settings.png b/public/images/docs/v4.1.0/serving-over-tls/open-environment-settings.png deleted file mode 100644 index 627a8494..00000000 Binary files a/public/images/docs/v4.1.0/serving-over-tls/open-environment-settings.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/templating/fakerjs-helpers/settings-faker.png b/public/images/docs/v4.1.0/templating/fakerjs-helpers/settings-faker.png deleted file mode 100644 index 495f3223..00000000 Binary files a/public/images/docs/v4.1.0/templating/fakerjs-helpers/settings-faker.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/templating/overview/body-templating.png b/public/images/docs/v4.1.0/templating/overview/body-templating.png deleted file mode 100644 index c94fee59..00000000 Binary files a/public/images/docs/v4.1.0/templating/overview/body-templating.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/templating/overview/disable-route-response-templating.png b/public/images/docs/v4.1.0/templating/overview/disable-route-response-templating.png deleted file mode 100644 index 712ed0ba..00000000 Binary files a/public/images/docs/v4.1.0/templating/overview/disable-route-response-templating.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/templating/overview/file-path-templating.png b/public/images/docs/v4.1.0/templating/overview/file-path-templating.png deleted file mode 100644 index f131066a..00000000 Binary files a/public/images/docs/v4.1.0/templating/overview/file-path-templating.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/templating/overview/headers-templating.png b/public/images/docs/v4.1.0/templating/overview/headers-templating.png deleted file mode 100644 index b23c0fe6..00000000 Binary files a/public/images/docs/v4.1.0/templating/overview/headers-templating.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/templating/overview/open-route-response-settings.png b/public/images/docs/v4.1.0/templating/overview/open-route-response-settings.png deleted file mode 100644 index 80592dc6..00000000 Binary files a/public/images/docs/v4.1.0/templating/overview/open-route-response-settings.png and /dev/null differ diff --git a/public/images/docs/v4.1.0/templating/overview/template-helper-response-rule-value.png b/public/images/docs/v4.1.0/templating/overview/template-helper-response-rule-value.png deleted file mode 100644 index 333422c0..00000000 Binary files a/public/images/docs/v4.1.0/templating/overview/template-helper-response-rule-value.png and /dev/null differ diff --git a/public/images/docs/v7.0.0/api-endpoints/crud-routes/add-crud-route.png b/public/images/docs/v7.0.0/api-endpoints/crud-routes/add-crud-route.png new file mode 100644 index 00000000..fba625d9 Binary files /dev/null and b/public/images/docs/v7.0.0/api-endpoints/crud-routes/add-crud-route.png differ diff --git a/public/images/docs/v7.0.0/api-endpoints/crud-routes/customize-crud-id-property-key.png b/public/images/docs/v7.0.0/api-endpoints/crud-routes/customize-crud-id-property-key.png new file mode 100644 index 00000000..01a4cf82 Binary files /dev/null and b/public/images/docs/v7.0.0/api-endpoints/crud-routes/customize-crud-id-property-key.png differ diff --git a/public/images/docs/v7.0.0/api-endpoints/crud-routes/link-data-bucket-crud-route.png b/public/images/docs/v7.0.0/api-endpoints/crud-routes/link-data-bucket-crud-route.png new file mode 100644 index 00000000..d0ea32c6 Binary files /dev/null and b/public/images/docs/v7.0.0/api-endpoints/crud-routes/link-data-bucket-crud-route.png differ diff --git a/public/images/docs/v7.0.0/api-endpoints/crud-routes/set-crud-route-path.png b/public/images/docs/v7.0.0/api-endpoints/crud-routes/set-crud-route-path.png new file mode 100644 index 00000000..20976b26 Binary files /dev/null and b/public/images/docs/v7.0.0/api-endpoints/crud-routes/set-crud-route-path.png differ diff --git a/public/images/docs/v7.0.0/api-endpoints/folders/routes-nested-folder.png b/public/images/docs/v7.0.0/api-endpoints/folders/routes-nested-folder.png new file mode 100644 index 00000000..94947823 Binary files /dev/null and b/public/images/docs/v7.0.0/api-endpoints/folders/routes-nested-folder.png differ diff --git a/public/images/docs/v7.0.0/api-endpoints/routing/environment-prefix.png b/public/images/docs/v7.0.0/api-endpoints/routing/environment-prefix.png new file mode 100644 index 00000000..aab6a86e Binary files /dev/null and b/public/images/docs/v7.0.0/api-endpoints/routing/environment-prefix.png differ diff --git a/public/images/docs/v7.0.0/api-endpoints/routing/open-environment-settings.png b/public/images/docs/v7.0.0/api-endpoints/routing/open-environment-settings.png new file mode 100644 index 00000000..02579395 Binary files /dev/null and b/public/images/docs/v7.0.0/api-endpoints/routing/open-environment-settings.png differ diff --git a/public/images/docs/v7.0.0/api-endpoints/routing/route-params.png b/public/images/docs/v7.0.0/api-endpoints/routing/route-params.png new file mode 100644 index 00000000..a65e9764 Binary files /dev/null and b/public/images/docs/v7.0.0/api-endpoints/routing/route-params.png differ diff --git a/public/images/docs/v7.0.0/api-endpoints/routing/route-patterns.png b/public/images/docs/v7.0.0/api-endpoints/routing/route-patterns.png new file mode 100644 index 00000000..eba19886 Binary files /dev/null and b/public/images/docs/v7.0.0/api-endpoints/routing/route-patterns.png differ diff --git a/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-button.png b/public/images/docs/v7.0.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-button.png similarity index 100% rename from public/images/docs/latest/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-button.png rename to public/images/docs/v7.0.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-button.png diff --git a/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-template-tab.png b/public/images/docs/v7.0.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-template-tab.png similarity index 100% rename from public/images/docs/latest/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-template-tab.png rename to public/images/docs/v7.0.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-template-tab.png diff --git a/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/ai-assistant-template-generate-options.png b/public/images/docs/v7.0.0/api-endpoints/templates-and-ai-assistant/ai-assistant-template-generate-options.png similarity index 100% rename from public/images/docs/latest/api-endpoints/templates-and-ai-assistant/ai-assistant-template-generate-options.png rename to public/images/docs/v7.0.0/api-endpoints/templates-and-ai-assistant/ai-assistant-template-generate-options.png diff --git a/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/pre-generated-templates-modal.png b/public/images/docs/v7.0.0/api-endpoints/templates-and-ai-assistant/pre-generated-templates-modal.png similarity index 100% rename from public/images/docs/latest/api-endpoints/templates-and-ai-assistant/pre-generated-templates-modal.png rename to public/images/docs/v7.0.0/api-endpoints/templates-and-ai-assistant/pre-generated-templates-modal.png diff --git a/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/templates-create-get-route.png b/public/images/docs/v7.0.0/api-endpoints/templates-and-ai-assistant/templates-create-get-route.png similarity index 100% rename from public/images/docs/latest/api-endpoints/templates-and-ai-assistant/templates-create-get-route.png rename to public/images/docs/v7.0.0/api-endpoints/templates-and-ai-assistant/templates-create-get-route.png diff --git a/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/templates-generate-get-route.png b/public/images/docs/v7.0.0/api-endpoints/templates-and-ai-assistant/templates-generate-get-route.png similarity index 100% rename from public/images/docs/latest/api-endpoints/templates-and-ai-assistant/templates-generate-get-route.png rename to public/images/docs/v7.0.0/api-endpoints/templates-and-ai-assistant/templates-generate-get-route.png diff --git a/public/images/docs/v7.0.0/callbacks/overview/add-callback.png b/public/images/docs/v7.0.0/callbacks/overview/add-callback.png new file mode 100644 index 00000000..6b953206 Binary files /dev/null and b/public/images/docs/v7.0.0/callbacks/overview/add-callback.png differ diff --git a/public/images/docs/v7.0.0/callbacks/overview/open-callbacks-view.png b/public/images/docs/v7.0.0/callbacks/overview/open-callbacks-view.png new file mode 100644 index 00000000..a2fdd515 Binary files /dev/null and b/public/images/docs/v7.0.0/callbacks/overview/open-callbacks-view.png differ diff --git a/public/images/docs/v7.0.0/callbacks/using-callbacks/link-callback-response.png b/public/images/docs/v7.0.0/callbacks/using-callbacks/link-callback-response.png new file mode 100644 index 00000000..22895c20 Binary files /dev/null and b/public/images/docs/v7.0.0/callbacks/using-callbacks/link-callback-response.png differ diff --git a/public/images/docs/v7.0.0/callbacks/using-callbacks/open-route-response-callbacks.png b/public/images/docs/v7.0.0/callbacks/using-callbacks/open-route-response-callbacks.png new file mode 100644 index 00000000..d5d87821 Binary files /dev/null and b/public/images/docs/v7.0.0/callbacks/using-callbacks/open-route-response-callbacks.png differ diff --git a/public/images/docs/v7.0.0/data-buckets/overview/add-data-bucket.png b/public/images/docs/v7.0.0/data-buckets/overview/add-data-bucket.png new file mode 100644 index 00000000..60943d11 Binary files /dev/null and b/public/images/docs/v7.0.0/data-buckets/overview/add-data-bucket.png differ diff --git a/public/images/docs/v7.0.0/data-buckets/overview/open-data-view.png b/public/images/docs/v7.0.0/data-buckets/overview/open-data-view.png new file mode 100644 index 00000000..37d04ff9 Binary files /dev/null and b/public/images/docs/v7.0.0/data-buckets/overview/open-data-view.png differ diff --git a/public/images/docs/v7.0.0/data-buckets/using-data-buckets/link-data-bucket-response.png b/public/images/docs/v7.0.0/data-buckets/using-data-buckets/link-data-bucket-response.png new file mode 100644 index 00000000..fb3da42c Binary files /dev/null and b/public/images/docs/v7.0.0/data-buckets/using-data-buckets/link-data-bucket-response.png differ diff --git a/public/images/docs/v7.0.0/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png b/public/images/docs/v7.0.0/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png new file mode 100644 index 00000000..28259b56 Binary files /dev/null and b/public/images/docs/v7.0.0/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png differ diff --git a/public/images/docs/v7.0.0/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png b/public/images/docs/v7.0.0/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png new file mode 100644 index 00000000..d963fef7 Binary files /dev/null and b/public/images/docs/v7.0.0/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png differ diff --git a/public/images/docs/v7.0.0/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png b/public/images/docs/v7.0.0/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png new file mode 100644 index 00000000..e0d9e370 Binary files /dev/null and b/public/images/docs/v7.0.0/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png differ diff --git a/public/images/docs/v7.0.0/logging-and-recording/requests-logging/logs-metadata.png b/public/images/docs/v7.0.0/logging-and-recording/requests-logging/logs-metadata.png new file mode 100644 index 00000000..02631db8 Binary files /dev/null and b/public/images/docs/v7.0.0/logging-and-recording/requests-logging/logs-metadata.png differ diff --git a/public/images/docs/v7.0.0/logging-and-recording/requests-logging/logs-request.png b/public/images/docs/v7.0.0/logging-and-recording/requests-logging/logs-request.png new file mode 100644 index 00000000..18916184 Binary files /dev/null and b/public/images/docs/v7.0.0/logging-and-recording/requests-logging/logs-request.png differ diff --git a/public/images/docs/v7.0.0/logging-and-recording/requests-logging/logs-response.png b/public/images/docs/v7.0.0/logging-and-recording/requests-logging/logs-response.png new file mode 100644 index 00000000..886d321f Binary files /dev/null and b/public/images/docs/v7.0.0/logging-and-recording/requests-logging/logs-response.png differ diff --git a/public/images/docs/v7.0.0/logging-and-recording/requests-logging/logs-view-body-modal.png b/public/images/docs/v7.0.0/logging-and-recording/requests-logging/logs-view-body-modal.png new file mode 100644 index 00000000..17d88919 Binary files /dev/null and b/public/images/docs/v7.0.0/logging-and-recording/requests-logging/logs-view-body-modal.png differ diff --git a/public/images/docs/v7.0.0/logging-and-recording/requests-logging/logs-view-body.png b/public/images/docs/v7.0.0/logging-and-recording/requests-logging/logs-view-body.png new file mode 100644 index 00000000..275d735a Binary files /dev/null and b/public/images/docs/v7.0.0/logging-and-recording/requests-logging/logs-view-body.png differ diff --git a/public/images/docs/v7.0.0/logging-and-recording/requests-logging/open-logs.png b/public/images/docs/v7.0.0/logging-and-recording/requests-logging/open-logs.png new file mode 100644 index 00000000..fd531e3e Binary files /dev/null and b/public/images/docs/v7.0.0/logging-and-recording/requests-logging/open-logs.png differ diff --git a/public/images/docs/v7.0.0/mockoon-data-files/data-storage-location/enable-file-watching.png b/public/images/docs/v7.0.0/mockoon-data-files/data-storage-location/enable-file-watching.png new file mode 100644 index 00000000..97b45835 Binary files /dev/null and b/public/images/docs/v7.0.0/mockoon-data-files/data-storage-location/enable-file-watching.png differ diff --git a/public/images/docs/v7.0.0/mockoon-data-files/data-storage-location/environment-move-to-folder.png b/public/images/docs/v7.0.0/mockoon-data-files/data-storage-location/environment-move-to-folder.png new file mode 100644 index 00000000..7d6237ba Binary files /dev/null and b/public/images/docs/v7.0.0/mockoon-data-files/data-storage-location/environment-move-to-folder.png differ diff --git a/public/images/docs/v7.0.0/mockoon-data-files/data-storage-location/environment-show-in-folder.png b/public/images/docs/v7.0.0/mockoon-data-files/data-storage-location/environment-show-in-folder.png new file mode 100644 index 00000000..1b223c0b Binary files /dev/null and b/public/images/docs/v7.0.0/mockoon-data-files/data-storage-location/environment-show-in-folder.png differ diff --git a/public/images/docs/v7.0.0/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png b/public/images/docs/v7.0.0/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png new file mode 100644 index 00000000..4383cf42 Binary files /dev/null and b/public/images/docs/v7.0.0/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png differ diff --git a/public/images/docs/v7.0.0/mockoon-data-files/sharing-mock-api-files/open-environment.png b/public/images/docs/v7.0.0/mockoon-data-files/sharing-mock-api-files/open-environment.png new file mode 100644 index 00000000..2922c48d Binary files /dev/null and b/public/images/docs/v7.0.0/mockoon-data-files/sharing-mock-api-files/open-environment.png differ diff --git a/public/images/docs/v7.0.0/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png b/public/images/docs/v7.0.0/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png new file mode 100644 index 00000000..d1a5b3b0 Binary files /dev/null and b/public/images/docs/v7.0.0/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png differ diff --git a/public/images/docs/v7.0.0/response-configuration/file-serving/enable-404-fallback.png b/public/images/docs/v7.0.0/response-configuration/file-serving/enable-404-fallback.png new file mode 100644 index 00000000..7234506a Binary files /dev/null and b/public/images/docs/v7.0.0/response-configuration/file-serving/enable-404-fallback.png differ diff --git a/public/images/docs/v7.0.0/response-configuration/file-serving/environment-show-in-folder.png b/public/images/docs/v7.0.0/response-configuration/file-serving/environment-show-in-folder.png new file mode 100644 index 00000000..6859aae8 Binary files /dev/null and b/public/images/docs/v7.0.0/response-configuration/file-serving/environment-show-in-folder.png differ diff --git a/public/images/docs/v7.0.0/response-configuration/file-serving/file-path.png b/public/images/docs/v7.0.0/response-configuration/file-serving/file-path.png new file mode 100644 index 00000000..c310f816 Binary files /dev/null and b/public/images/docs/v7.0.0/response-configuration/file-serving/file-path.png differ diff --git a/public/images/docs/v7.0.0/response-configuration/file-serving/route-response-disable-templating.png b/public/images/docs/v7.0.0/response-configuration/file-serving/route-response-disable-templating.png new file mode 100644 index 00000000..d68e9aa8 Binary files /dev/null and b/public/images/docs/v7.0.0/response-configuration/file-serving/route-response-disable-templating.png differ diff --git a/public/images/docs/v7.0.0/response-configuration/response-body/body-data-bucket.png b/public/images/docs/v7.0.0/response-configuration/response-body/body-data-bucket.png new file mode 100644 index 00000000..d70510ab Binary files /dev/null and b/public/images/docs/v7.0.0/response-configuration/response-body/body-data-bucket.png differ diff --git a/public/images/docs/v7.0.0/response-configuration/response-body/body-file-serving.png b/public/images/docs/v7.0.0/response-configuration/response-body/body-file-serving.png new file mode 100644 index 00000000..6e72efdc Binary files /dev/null and b/public/images/docs/v7.0.0/response-configuration/response-body/body-file-serving.png differ diff --git a/public/images/docs/v7.0.0/response-configuration/response-body/body-type-toggle.png b/public/images/docs/v7.0.0/response-configuration/response-body/body-type-toggle.png new file mode 100644 index 00000000..3953e701 Binary files /dev/null and b/public/images/docs/v7.0.0/response-configuration/response-body/body-type-toggle.png differ diff --git a/public/images/docs/v7.0.0/response-configuration/response-body/inline-body-editor.png b/public/images/docs/v7.0.0/response-configuration/response-body/inline-body-editor.png new file mode 100644 index 00000000..46e557f1 Binary files /dev/null and b/public/images/docs/v7.0.0/response-configuration/response-body/inline-body-editor.png differ diff --git a/public/images/docs/v7.0.0/response-configuration/response-headers/add-environment-header.png b/public/images/docs/v7.0.0/response-configuration/response-headers/add-environment-header.png new file mode 100644 index 00000000..a391e718 Binary files /dev/null and b/public/images/docs/v7.0.0/response-configuration/response-headers/add-environment-header.png differ diff --git a/public/images/docs/v7.0.0/response-configuration/response-headers/add-route-header.png b/public/images/docs/v7.0.0/response-configuration/response-headers/add-route-header.png new file mode 100644 index 00000000..9d470f1c Binary files /dev/null and b/public/images/docs/v7.0.0/response-configuration/response-headers/add-route-header.png differ diff --git a/public/images/docs/v7.0.0/response-configuration/response-headers/fill-route-header-form.png b/public/images/docs/v7.0.0/response-configuration/response-headers/fill-route-header-form.png new file mode 100644 index 00000000..59cf95e0 Binary files /dev/null and b/public/images/docs/v7.0.0/response-configuration/response-headers/fill-route-header-form.png differ diff --git a/public/images/docs/v7.0.0/response-configuration/response-headers/open-environment-headers.png b/public/images/docs/v7.0.0/response-configuration/response-headers/open-environment-headers.png new file mode 100644 index 00000000..176d3113 Binary files /dev/null and b/public/images/docs/v7.0.0/response-configuration/response-headers/open-environment-headers.png differ diff --git a/public/images/docs/v7.0.0/route-responses/dynamic-rules/add-route-response-rule.png b/public/images/docs/v7.0.0/route-responses/dynamic-rules/add-route-response-rule.png new file mode 100644 index 00000000..c8b79fc9 Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/dynamic-rules/add-route-response-rule.png differ diff --git a/public/images/docs/v7.0.0/route-responses/dynamic-rules/disable-rules.png b/public/images/docs/v7.0.0/route-responses/dynamic-rules/disable-rules.png new file mode 100644 index 00000000..4ddaf2bd Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/dynamic-rules/disable-rules.png differ diff --git a/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rule-reorder.png b/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rule-reorder.png new file mode 100644 index 00000000..bf3883cb Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rule-reorder.png differ diff --git a/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rules-comparison-operator.png b/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rules-comparison-operator.png new file mode 100644 index 00000000..414aa5e8 Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rules-comparison-operator.png differ diff --git a/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rules-invert-operator.png b/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rules-invert-operator.png new file mode 100644 index 00000000..7f5d4b8e Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rules-invert-operator.png differ diff --git a/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rules-operator.png b/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rules-operator.png new file mode 100644 index 00000000..5590cd48 Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rules-operator.png differ diff --git a/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rules-property.png b/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rules-property.png new file mode 100644 index 00000000..8189896b Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rules-property.png differ diff --git a/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rules-target.png b/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rules-target.png new file mode 100644 index 00000000..4cdabbb1 Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rules-target.png differ diff --git a/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rules-value.png b/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rules-value.png new file mode 100644 index 00000000..8b0b1efb Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/dynamic-rules/route-response-rules-value.png differ diff --git a/public/images/docs/v7.0.0/route-responses/global-routes-with-rules/activate-fallback-mode.png b/public/images/docs/v7.0.0/route-responses/global-routes-with-rules/activate-fallback-mode.png new file mode 100644 index 00000000..ab28b6bd Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/global-routes-with-rules/activate-fallback-mode.png differ diff --git a/public/images/docs/v7.0.0/route-responses/global-routes-with-rules/create-wildcard-route.png b/public/images/docs/v7.0.0/route-responses/global-routes-with-rules/create-wildcard-route.png new file mode 100644 index 00000000..26cb0335 Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/global-routes-with-rules/create-wildcard-route.png differ diff --git a/public/images/docs/v7.0.0/route-responses/global-routes-with-rules/response-rule-header-null.png b/public/images/docs/v7.0.0/route-responses/global-routes-with-rules/response-rule-header-null.png new file mode 100644 index 00000000..a1e36ebb Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/global-routes-with-rules/response-rule-header-null.png differ diff --git a/public/images/docs/v7.0.0/route-responses/global-routes-with-rules/response-status-code-401.png b/public/images/docs/v7.0.0/route-responses/global-routes-with-rules/response-status-code-401.png new file mode 100644 index 00000000..1373019a Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/global-routes-with-rules/response-status-code-401.png differ diff --git a/public/images/docs/v7.0.0/route-responses/multiple-responses/add-route-response.png b/public/images/docs/v7.0.0/route-responses/multiple-responses/add-route-response.png new file mode 100644 index 00000000..dfd798c0 Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/multiple-responses/add-route-response.png differ diff --git a/public/images/docs/v7.0.0/route-responses/multiple-responses/change-route-responses-default.png b/public/images/docs/v7.0.0/route-responses/multiple-responses/change-route-responses-default.png new file mode 100644 index 00000000..b879eee1 Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/multiple-responses/change-route-responses-default.png differ diff --git a/public/images/docs/v7.0.0/route-responses/multiple-responses/duplicate-route-response.png b/public/images/docs/v7.0.0/route-responses/multiple-responses/duplicate-route-response.png new file mode 100644 index 00000000..e6620281 Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/multiple-responses/duplicate-route-response.png differ diff --git a/public/images/docs/v7.0.0/route-responses/multiple-responses/fallback-mode-responses.png b/public/images/docs/v7.0.0/route-responses/multiple-responses/fallback-mode-responses.png new file mode 100644 index 00000000..22cb0c22 Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/multiple-responses/fallback-mode-responses.png differ diff --git a/public/images/docs/v7.0.0/route-responses/multiple-responses/random-route-responses.png b/public/images/docs/v7.0.0/route-responses/multiple-responses/random-route-responses.png new file mode 100644 index 00000000..707e8177 Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/multiple-responses/random-route-responses.png differ diff --git a/public/images/docs/v7.0.0/route-responses/multiple-responses/reorder-responses.png b/public/images/docs/v7.0.0/route-responses/multiple-responses/reorder-responses.png new file mode 100644 index 00000000..963f9163 Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/multiple-responses/reorder-responses.png differ diff --git a/public/images/docs/v7.0.0/route-responses/multiple-responses/sequential-route-responses.png b/public/images/docs/v7.0.0/route-responses/multiple-responses/sequential-route-responses.png new file mode 100644 index 00000000..42ca38d3 Binary files /dev/null and b/public/images/docs/v7.0.0/route-responses/multiple-responses/sequential-route-responses.png differ diff --git a/public/images/docs/v7.0.0/server-configuration/cors/add-cors-headers.png b/public/images/docs/v7.0.0/server-configuration/cors/add-cors-headers.png new file mode 100644 index 00000000..9c9ead61 Binary files /dev/null and b/public/images/docs/v7.0.0/server-configuration/cors/add-cors-headers.png differ diff --git a/public/images/docs/v7.0.0/server-configuration/cors/enable-cors.png b/public/images/docs/v7.0.0/server-configuration/cors/enable-cors.png new file mode 100644 index 00000000..0e60bbfa Binary files /dev/null and b/public/images/docs/v7.0.0/server-configuration/cors/enable-cors.png differ diff --git a/public/images/docs/v7.0.0/server-configuration/cors/open-environment-headers.png b/public/images/docs/v7.0.0/server-configuration/cors/open-environment-headers.png new file mode 100644 index 00000000..736e4278 Binary files /dev/null and b/public/images/docs/v7.0.0/server-configuration/cors/open-environment-headers.png differ diff --git a/public/images/docs/v7.0.0/server-configuration/cors/open-environment-settings.png b/public/images/docs/v7.0.0/server-configuration/cors/open-environment-settings.png new file mode 100644 index 00000000..ad46c624 Binary files /dev/null and b/public/images/docs/v7.0.0/server-configuration/cors/open-environment-settings.png differ diff --git a/public/images/docs/v7.0.0/server-configuration/cors/view-cors-headers.png b/public/images/docs/v7.0.0/server-configuration/cors/view-cors-headers.png new file mode 100644 index 00000000..c2520a74 Binary files /dev/null and b/public/images/docs/v7.0.0/server-configuration/cors/view-cors-headers.png differ diff --git a/public/images/docs/v7.0.0/server-configuration/listening-hostname/custom-hostname-setting.png b/public/images/docs/v7.0.0/server-configuration/listening-hostname/custom-hostname-setting.png new file mode 100644 index 00000000..14a4d07e Binary files /dev/null and b/public/images/docs/v7.0.0/server-configuration/listening-hostname/custom-hostname-setting.png differ diff --git a/public/images/docs/v7.0.0/server-configuration/listening-hostname/open-environment-settings.png b/public/images/docs/v7.0.0/server-configuration/listening-hostname/open-environment-settings.png new file mode 100644 index 00000000..19b0f2f0 Binary files /dev/null and b/public/images/docs/v7.0.0/server-configuration/listening-hostname/open-environment-settings.png differ diff --git a/public/images/docs/v7.0.0/server-configuration/port-prefix/environment-custom-port.png b/public/images/docs/v7.0.0/server-configuration/port-prefix/environment-custom-port.png new file mode 100644 index 00000000..1518157f Binary files /dev/null and b/public/images/docs/v7.0.0/server-configuration/port-prefix/environment-custom-port.png differ diff --git a/public/images/docs/v7.0.0/server-configuration/port-prefix/environment-custom-prefix.png b/public/images/docs/v7.0.0/server-configuration/port-prefix/environment-custom-prefix.png new file mode 100644 index 00000000..aab6a86e Binary files /dev/null and b/public/images/docs/v7.0.0/server-configuration/port-prefix/environment-custom-prefix.png differ diff --git a/public/images/docs/v7.0.0/server-configuration/port-prefix/open-environment-settings.png b/public/images/docs/v7.0.0/server-configuration/port-prefix/open-environment-settings.png new file mode 100644 index 00000000..02579395 Binary files /dev/null and b/public/images/docs/v7.0.0/server-configuration/port-prefix/open-environment-settings.png differ diff --git a/public/images/docs/v7.0.0/server-configuration/proxy-mode/enable-proxy.png b/public/images/docs/v7.0.0/server-configuration/proxy-mode/enable-proxy.png new file mode 100644 index 00000000..759595c3 Binary files /dev/null and b/public/images/docs/v7.0.0/server-configuration/proxy-mode/enable-proxy.png differ diff --git a/public/images/docs/v7.0.0/server-configuration/proxy-mode/open-proxy-options.png b/public/images/docs/v7.0.0/server-configuration/proxy-mode/open-proxy-options.png new file mode 100644 index 00000000..0e64dc02 Binary files /dev/null and b/public/images/docs/v7.0.0/server-configuration/proxy-mode/open-proxy-options.png differ diff --git a/public/images/docs/v7.0.0/server-configuration/proxy-mode/proxy-headers.png b/public/images/docs/v7.0.0/server-configuration/proxy-mode/proxy-headers.png new file mode 100644 index 00000000..49485957 Binary files /dev/null and b/public/images/docs/v7.0.0/server-configuration/proxy-mode/proxy-headers.png differ diff --git a/public/images/docs/v7.0.0/server-configuration/proxy-mode/proxy-no-forward.png b/public/images/docs/v7.0.0/server-configuration/proxy-mode/proxy-no-forward.png new file mode 100644 index 00000000..0e2a1063 Binary files /dev/null and b/public/images/docs/v7.0.0/server-configuration/proxy-mode/proxy-no-forward.png differ diff --git a/public/images/docs/v7.0.0/server-configuration/serving-over-tls/enable-tls-custom-certificate.png b/public/images/docs/v7.0.0/server-configuration/serving-over-tls/enable-tls-custom-certificate.png new file mode 100644 index 00000000..4ef61787 Binary files /dev/null and b/public/images/docs/v7.0.0/server-configuration/serving-over-tls/enable-tls-custom-certificate.png differ diff --git a/public/images/docs/v7.0.0/server-configuration/serving-over-tls/enable-tls.png b/public/images/docs/v7.0.0/server-configuration/serving-over-tls/enable-tls.png new file mode 100644 index 00000000..97c1a399 Binary files /dev/null and b/public/images/docs/v7.0.0/server-configuration/serving-over-tls/enable-tls.png differ diff --git a/public/images/docs/v7.0.0/server-configuration/serving-over-tls/open-environment-settings.png b/public/images/docs/v7.0.0/server-configuration/serving-over-tls/open-environment-settings.png new file mode 100644 index 00000000..db5cb01a Binary files /dev/null and b/public/images/docs/v7.0.0/server-configuration/serving-over-tls/open-environment-settings.png differ diff --git a/public/images/docs/v7.0.0/templating/fakerjs-helpers/settings-faker.png b/public/images/docs/v7.0.0/templating/fakerjs-helpers/settings-faker.png new file mode 100644 index 00000000..3b0944c0 Binary files /dev/null and b/public/images/docs/v7.0.0/templating/fakerjs-helpers/settings-faker.png differ diff --git a/public/images/docs/v7.0.0/templating/overview/body-templating.png b/public/images/docs/v7.0.0/templating/overview/body-templating.png new file mode 100644 index 00000000..3f0fcc44 Binary files /dev/null and b/public/images/docs/v7.0.0/templating/overview/body-templating.png differ diff --git a/public/images/docs/v7.0.0/templating/overview/disable-route-response-templating.png b/public/images/docs/v7.0.0/templating/overview/disable-route-response-templating.png new file mode 100644 index 00000000..81b5d8bf Binary files /dev/null and b/public/images/docs/v7.0.0/templating/overview/disable-route-response-templating.png differ diff --git a/public/images/docs/v7.0.0/templating/overview/file-path-templating.png b/public/images/docs/v7.0.0/templating/overview/file-path-templating.png new file mode 100644 index 00000000..dc26f9ae Binary files /dev/null and b/public/images/docs/v7.0.0/templating/overview/file-path-templating.png differ diff --git a/public/images/docs/v7.0.0/templating/overview/headers-templating.png b/public/images/docs/v7.0.0/templating/overview/headers-templating.png new file mode 100644 index 00000000..e15c2be2 Binary files /dev/null and b/public/images/docs/v7.0.0/templating/overview/headers-templating.png differ diff --git a/public/images/docs/v7.0.0/templating/overview/open-route-response-settings.png b/public/images/docs/v7.0.0/templating/overview/open-route-response-settings.png new file mode 100644 index 00000000..47111591 Binary files /dev/null and b/public/images/docs/v7.0.0/templating/overview/open-route-response-settings.png differ diff --git a/public/images/docs/v7.0.0/templating/overview/template-helper-response-rule-value.png b/public/images/docs/v7.0.0/templating/overview/template-helper-response-rule-value.png new file mode 100644 index 00000000..6da086ef Binary files /dev/null and b/public/images/docs/v7.0.0/templating/overview/template-helper-response-rule-value.png differ diff --git a/public/images/docs/v7.0.0/variables/environment-variables/settings-environment-variables-prefix.png b/public/images/docs/v7.0.0/variables/environment-variables/settings-environment-variables-prefix.png new file mode 100644 index 00000000..692df0b7 Binary files /dev/null and b/public/images/docs/v7.0.0/variables/environment-variables/settings-environment-variables-prefix.png differ diff --git a/public/images/releases/8.0.0/cloud-sync-menu.png b/public/images/releases/8.0.0/cloud-sync-menu.png new file mode 100644 index 00000000..3e19218a Binary files /dev/null and b/public/images/releases/8.0.0/cloud-sync-menu.png differ diff --git a/public/images/releases/8.0.0/data-buckets-response-rules.png b/public/images/releases/8.0.0/data-buckets-response-rules.png new file mode 100644 index 00000000..da7c0526 Binary files /dev/null and b/public/images/releases/8.0.0/data-buckets-response-rules.png differ diff --git a/public/images/releases/8.0.0/external-files-menu-view-open-explorer.png b/public/images/releases/8.0.0/external-files-menu-view-open-explorer.png new file mode 100644 index 00000000..f50f1066 Binary files /dev/null and b/public/images/releases/8.0.0/external-files-menu-view-open-explorer.png differ diff --git a/public/images/releases/8.0.0/pre-generated-templates.png b/public/images/releases/8.0.0/pre-generated-templates.png new file mode 100644 index 00000000..b105f46e Binary files /dev/null and b/public/images/releases/8.0.0/pre-generated-templates.png differ diff --git a/utils/queries.tsx b/utils/queries.tsx index a0981b55..d99a7065 100644 --- a/utils/queries.tsx +++ b/utils/queries.tsx @@ -143,7 +143,8 @@ const useCurrentSubscriptionLinks = (user: User) => { auth.isAuth && !!user && user.plan !== Plans.FREE && - user.subscription?.provider !== null, + user.subscription !== undefined && + user.subscription.provider !== null, queryFn: async () => { const token = await auth.getIdToken(); diff --git a/utils/utils.ts b/utils/utils.ts index 452c267f..2ac4ee17 100644 --- a/utils/utils.ts +++ b/utils/utils.ts @@ -6,8 +6,8 @@ export const sortByOrder = (firstTopic, secondTopic) => firstTopic.order > secondTopic.order ? 1 : secondTopic.order > firstTopic.order - ? -1 - : 0; + ? -1 + : 0; export const sortPathBySemver = (a: string, b: string) => { const aPathparts = a.split('/'); @@ -25,8 +25,8 @@ export const orderArticles = (articles: ArticleList) => { firstArticle.data.order > secondArticle.data.order ? 1 : secondArticle.data.order > firstArticle.data.order - ? -1 - : 0 + ? -1 + : 0 ); }; @@ -37,16 +37,16 @@ export const getDesktopLatestVersion = async () => { return data.tag; }; -export const getFreeTemplates = async () => { +export const getTemplates = async () => { const listResponse = await fetch( - `${process.env.NEXT_PUBLIC_BACKEND_URL}/templates/free` + `${process.env.NEXT_PUBLIC_BACKEND_URL}/templates` ); const templatesList: TemplateLight[] = await listResponse.json(); const templatesResponses = await Promise.all( templatesList.map((templateEntry) => { return fetch( - `${process.env.NEXT_PUBLIC_BACKEND_URL}/templates/free/${templateEntry.id}` + `${process.env.NEXT_PUBLIC_BACKEND_URL}/templates/${templateEntry.id}` ); }) );