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.
console.log(`Current Admin API plugin version is ${version}`);
39
39
40
-
constcurrentSettings=awaitsettings.read();
40
+
constcurrentSettings=awaitreadSettings();
41
41
console.log("Current Mocks Server settings are", currentSettings);
42
42
43
-
awaitsettings.update({
43
+
awaitupdateSettings({
44
44
mock:"user-super-admin",
45
45
delay:1000
46
46
});
@@ -52,18 +52,27 @@ example();
52
52
53
53
## Api
54
54
55
-
*`about.read()` - Returns info about the Admin API plugin, such as current version.
56
-
*`settings.read()` - Returns current Mocks Server settings.
57
-
*`settings.update(settingsObject)` - Updates Mocks Server settings. A settings object has to be provided. Read the [Mocks Server configuration docs](https://www.mocks-server.org/docs/configuration-options) for further info.
58
-
*`alerts.read()` - Returns array of current alerts.
59
-
*`alert(alertId).read()` - Returns an specific alert.
55
+
*`readAbout()` - Returns info about the Admin API plugin, such as current version.
56
+
*`readSettings()` - Returns current Mocks Server settings.
57
+
*`updateSettings(settingsObject)` - Updates Mocks Server settings. A settings object has to be provided. Read the [Mocks Server configuration docs](https://www.mocks-server.org/docs/configuration-options) for further info.
58
+
*`readAlerts()` - Returns array of current alerts.
59
+
*`readAlert(alertId)` - Returns an specific alert.
60
+
*`readMocks()` - Returns available mocks.
61
+
*`readMock(id)` - Returns data of a specific mock.
62
+
*`readRoutes()` - Returns available routes.
63
+
*`readRoute(id)` - Returns data of a specific route.
64
+
*`readRoutesVariants()` - Returns available routes variants.
65
+
*`readRouteVariant(id)` - Returns data of a specific route variant.
66
+
*`readMockCustomRoutesVariants()` - Returns current routes variants manually added to current mock.
67
+
*`addMockCustomRouteVariant(id)` - Add a route variant to current mock.
68
+
*`restoreMockRoutesVariants()` - Restore current mock original routes variants.
60
69
61
70
##### Legacy methods
62
71
63
-
*`behaviors.read()` - Returns collection of available behaviors.
64
-
*`behavior(behaviorName).read()` - Returns an specific behavior.
65
-
*`fixtures.read()` - Returns collection of available fixtures.
66
-
*`fixture(fixtureId).read()` - Returns an specific fixture.
72
+
*`readBehaviors()` - Returns collection of available behaviors.
73
+
*`readBehavior(behaviorName)` - Returns an specific behavior.
74
+
*`readFixtures()` - Returns collection of available fixtures.
75
+
*`readFixture(fixtureId)` - Returns an specific fixture.
0 commit comments