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.
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-provider` packages, such as [`@data-provider/react`](https://github.com/data-provider/react).
46
+
Exported properties `about`, `settings`, `mocks`, `mocksModel`, `routes`, `routesModel`, `routesVariants`and `routesVariantsModel` 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-provider` packages, such as [`@data-provider/react`](https://github.com/data-provider/react).
47
47
48
48
## Api
49
49
50
50
*`about.read()` - Returns info about `mocks-server/plugin-admin-api`, such as current version.
51
51
*`settings.read()` - Returns current `mocks-server` settings.
52
52
*`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.
53
+
*`alerts.read()` - Returns collection of current alerts.
54
+
*`alert(id).read()` - Returns a specific alert.
55
+
*`alertsModel.queries.byId(id).read()` - Returns a specific alert.
56
+
*`mocks.read()` - Returns collection of available mocks.
57
+
*`mock(mockId).read()` - Returns a specific mock.
58
+
*`mocksModel.queries.byId(mockId).read()` - Returns a specific mock.
59
+
*`routes.read()` - Returns collection of available routes.
60
+
*`route(id).read()` - Returns a specific route.
61
+
*`routes.queries.byId(id).read()` - Returns an specific route.
62
+
*`routesVariants.read()` - Returns collection of available routes variants.
63
+
*`routeVariant(id).read()` - Returns a specific route variant.
64
+
*`routesVariants.queries.byId(id).read()` - Returns an specific route variant.
65
+
*`customRouteVariants.read()` - Returns collection of current custom route variants.
66
+
*`customRouteVariants.create(id)` - Sets a specific route variant to be used by current mock.
67
+
*`customRouteVariants.delete()` - Restore routes variants to those defined in current mock.
68
+
69
+
### Legacy methods
70
+
Next methods correspond to Mocks Server legacy methods
71
+
53
72
*`behaviors.read()` - Returns collection of available behaviors.
54
-
*`behavior(behaviorName).read()` - Returns an specific behavior.
55
-
*`behaviorsModel.queries.byName(behaviorName).read()` - Returns an specific behavior.
73
+
*`behavior(behaviorName).read()` - Returns a specific behavior.
74
+
*`behaviorsModel.queries.byName(behaviorName).read()` - Returns a specific behavior.
56
75
*`fixtures.read()` - Returns collection of available fixtures.
57
-
*`fixture(id).read()` - Returns an specific fixture.
58
-
*`fixturesModel.queries.byId(id).read()` - Returns an specific fixture.
59
-
*`alerts.read()` - Returns collection of current alerts.
60
-
*`alert(id).read()` - Returns an specific alert.
61
-
*`alertsModel.queries.byId(id).read()` - Returns an specific alert.
76
+
*`fixture(id).read()` - Returns a specific fixture.
77
+
*`fixturesModel.queries.byId(id).read()` - Returns a specific fixture.
62
78
63
79
## Configuration
64
80
@@ -94,7 +110,7 @@ Please read the [contributing guidelines](.github/CONTRIBUTING.md) and [code of
0 commit comments