Skip to content

Commit

Permalink
Release/next (#130)
Browse files Browse the repository at this point in the history
* Prepare new release
* Remove old docs
* Add admin API documentation, see mockoon/mockoon#1334
* Pro data sync: 
    - Add data sync documentation
    - Update terms and privacy
    - Reorder docs entries
    - Move ai assistant doc to new mockoon-cloud entry
    - Add sync quotas in user account
    - Update plans
* Update docs images
* Update contributing file
* Add doc for mockoon/mockoon#1337
* Update docs images for mockoon/mockoon#964
* update alias for faker ipv4 (#129)
* Add changelog

---------

Co-authored-by: Ankit <[email protected]>
  • Loading branch information
255kb and ajatkj authored Apr 2, 2024
1 parent 0fbc849 commit d4e0452
Show file tree
Hide file tree
Showing 491 changed files with 1,815 additions and 3,834 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion components/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const Footer: FunctionComponent<{
</li>
<li className='mb-2'>
{/* Do not use <Link>, as routes with a dot inside get rewritten without trailing slash */}
<a href='/releases/7.0.0/' className='text-reset'>
<a href='/releases/8.0.0/' className='text-reset'>
Releases
</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion components/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ const Nav: FunctionComponent = function () {
Blog
</Link>
<a
href='/releases/7.0.0/'
href='/releases/8.0.0/'
className={`dropdown-item ${
router.pathname === '/releases' ||
router.pathname === '/releases/[version]'
Expand Down
229 changes: 133 additions & 96 deletions components/plans.tsx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content/blog/introducing-mockoon-ai-assistant-pro-plans.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions content/blog/our-commitment-open-source-community.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down
27 changes: 27 additions & 0 deletions content/docs/latest/admin-api/overview.md
Original file line number Diff line number Diff line change
@@ -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)
25 changes: 25 additions & 0 deletions content/docs/latest/admin-api/server-state.md
Original file line number Diff line number Diff line change
@@ -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).
8 changes: 4 additions & 4 deletions content/docs/latest/api-endpoints/crud-routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ 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).
## 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)
![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.
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion content/docs/latest/api-endpoints/folders.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions content/docs/latest/api-endpoints/routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand All @@ -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).

Expand All @@ -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).

Expand Down
4 changes: 2 additions & 2 deletions content/docs/latest/callbacks/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions content/docs/latest/callbacks/using-callbacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 2 additions & 2 deletions content/docs/latest/data-buckets/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down
2 changes: 1 addition & 1 deletion content/docs/latest/data-buckets/using-data-buckets.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand Down
14 changes: 6 additions & 8 deletions content/docs/latest/logging-and-recording/requests-logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@ 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

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)

## 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: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

Expand Down Expand Up @@ -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"
},
Expand Down
Loading

0 comments on commit d4e0452

Please sign in to comment.