You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 28, 2022. It is now read-only.
# Mocks-server administration api client built with @data-provider
9
9
10
10
This package contains methods for administrating the mocks-server _(through the [@mocks-server/plugin-admin-api](https://github.com/mocks-server/plugin-admin-api) RESTful API)_.
11
11
12
-
Built using [@data-provider](https://github.com/data-provider), it can be used in Node.js, browsers, and is also compatible with @data-provider connectors, such as [@data-provider/connector-react](https://github.com/data-provider/connector-react), so can be easily integrated with frameworks.
12
+
Built using [@data-provider](https://github.com/data-provider), it can be used in Node.js, browsers, and it is also compatible with other @data-provider packages, such as [@data-provider/react](https://github.com/data-provider/react), so can be easily integrated with frameworks.
13
+
14
+
## Installation
15
+
16
+
```bash
17
+
npm i --save redux @data-provider/core @data-provider/axios @mocks-server/admin-api-client-data-provider
18
+
```
13
19
14
20
## Usage with promises
15
21
16
22
All methods described in the [Api](#api) (expect the `config` method) return Promises when executed:
Exported properties `about`, `settings`, `behaviors`, `behaviorsModel`, `fixtures` and `fixturesModel` are [@data-provider/axios](https://github.com/data-provider/axios) providers, so can be used to define @data-provider Selectors. Methods can also be connected to frameworks using @data-providerconnectors, such as [@data-provider/connector-react](https://github.com/data-provider/connector-react).
46
+
Exported properties `about`, `settings`, `behaviors`, `behaviorsModel`, `fixtures` and `fixturesModel` are [@data-provider/axios](https://github.com/data-provider/axios) providers, so can be used to define @data-provider Selectors. Methods can also be connected to frameworks using another @data-providerpackages, such as [@data-provider/react](https://github.com/data-provider/react).
*`settings.update(settingsObject)` - Updates @mocks-server settings. A settings object has to be provided. Read the [@mocks-server configuration documentation](https://www.mocks-server.org/docs/configuration-options) for further info.
47
53
*`behaviors.read()` - Returns collection of available behaviors.
48
54
*`behavior(behaviorName).read()` - Returns an specific behavior.
49
-
*`behaviorsModel.byName(behaviorName).read()` - Returns an specific behavior.
55
+
*`behaviorsModel.queries.byName(behaviorName).read()` - Returns an specific behavior.
50
56
*`fixtures.read()` - Returns collection of available fixtures.
51
57
*`fixture(fixtureId).read()` - Returns an specific fixture.
52
-
*`fixturesModel.byId(fixtureId).read()` - Returns an specific fixture.
58
+
*`fixturesModel.queries.byId(fixtureId).read()` - Returns an specific fixture.
53
59
54
60
## Configuration
55
61
@@ -58,7 +64,7 @@ By default, the client is configured to request to http://localhost:3100/admin,
58
64
You can change both the base url of the "@mocks-server", and the base api path of the "@mocks-server/plugin-admin-api" using the `config` method:
0 commit comments