Skip to content

Commit 0694c7c

Browse files
authored
Docs/polish (#60)
* docs: slightly better wording * add content for example cap readme * example cap server content as table * another small polish * update state response
1 parent f744603 commit 0694c7c

File tree

5 files changed

+40
-6
lines changed

5 files changed

+40
-6
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ SAP BTP feature toggle library enables Node.js applications using the SAP Cloud
1717
```
1818

1919
- For CAP Feature Toggles everything is configured automatically.
20-
- The library acts as a CDS-Plugin and registers a `FeatureService`, which is used to check and update toggles.
20+
- The library acts as a CDS-Plugin and registers a `FeatureService`, which can be used to check and update toggles.
2121
- For details see [Example CAP Server](https://github.com/cap-js-community/feature-toggle-library/blob/main/example-cap-server).
2222

2323
## Getting Started (Custom Configuration)

Diff for: docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ SAP BTP feature toggle library enables Node.js applications using the SAP Cloud
1818
```
1919

2020
- For CAP Feature Toggles everything is configured automatically.
21-
- The library acts as a CDS-Plugin and registers a `FeatureService`, which is used to check and update toggles.
21+
- The library acts as a CDS-Plugin and registers a `FeatureService`, which can be used to check and update toggles.
2222
- For details see [Example CAP Server](https://github.com/cap-js-community/feature-toggle-library/blob/main/example-cap-server).
2323

2424
## Getting Started (Custom Configuration)

Diff for: docs/plugin/index.md

+26-3
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,39 @@ Get all information about the current in-memory state of all toggles.
130130
"/check/priority": {
131131
"fallbackValue": 0,
132132
"config": {
133+
"SOURCE": "FILE",
133134
"TYPE": "number",
134-
"VALIDATION": "^\\d+$",
135-
"ALLOWED_SCOPES": ["user", "tenant"]
135+
"VALIDATIONS": [
136+
{
137+
"scopes": ["user", "tenant"]
138+
},
139+
{
140+
"regex": "^\\d+$"
141+
},
142+
{
143+
"module": "$CONFIG_DIR/validators",
144+
"call": "validateTenantScope"
145+
}
146+
]
136147
}
137148
},
138149
"/memory/logInterval": {
139150
"fallbackValue": 0,
140151
"config": {
152+
"SOURCE": "FILE",
141153
"TYPE": "number",
142-
"VALIDATION": "^\\d+$"
154+
"VALIDATIONS": [
155+
{
156+
"regex": "^\\d+$"
157+
}
158+
]
159+
}
160+
},
161+
"/fts/check-service-extension": {
162+
"fallbackValue": false,
163+
"config": {
164+
"SOURCE": "AUTO",
165+
"TYPE": "boolean"
143166
}
144167
}
145168
}

Diff for: docs/usage/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const { FeatureToggles } = require("@cap-js-community/feature-toggle-library");
2525
const instance = new FeatureToggles({ uniqueName: "snowflake" });
2626
```
2727

28-
The library prepares a convenient singleton instance of FeatureToggles for out-of-the-box usage, where the Cloud
28+
The library prepares a convenient singleton instance of `FeatureToggles` for out-of-the-box usage, where the Cloud
2929
Foundry _app name_ is used as unique name. This should be sufficient for most use-cases and is the default export of
3030
the library.
3131

Diff for: example-cap-server/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Example CAP Server
22

3+
## Content
4+
5+
| Topic | Path(s) |
6+
| :--------------------------- | :----------------------------------------------------------- |
7+
| CDS-Plugin Configuration | [package.json](./package.json) |
8+
| CDS Configuration | [.cdsrc.json](./.cdsrc.json) |
9+
| Feature Toggle Configuration | [srv/feature/toggles.yaml](./srv/feature/toggles.yaml) |
10+
| Feature Service Calls | [http/feature-service.http](./http/feature-service.http) |
11+
| Check Service Calls | [http/check-service.http](./http/check-service.http) |
12+
| CAP Feature Toggle | [fts/check-service-extension](./fts/check-service-extension) |
13+
314
## CDS and local dependencies
415

516
Ideally, we would want to mount our library as a `file:` dependency in this sample project. Unfortunately CDS does not

0 commit comments

Comments
 (0)