Skip to content

Commit 80c5426

Browse files
authored
Fb/unmanaged values (#71)
* approach 1 of wip 1 * give semaphore a one-time transformation * infos are an object not an array * approach 1 wip 2 * fix makeOne repeated calling problem * make redisRead endpoint work in NO_REDIS mode * approach 1 wip 3 * better serve detection for cds >= 8.2.3 * approach 1.1 wip 4 * approach 1.1 wip 5 * redis in code is usually lower case * fix serve detection version compare * upgrade to @sap/cds 8.2.3 for serve mode detection * remote only change option * add remote only to validation * remoteOnly should not be part of messages * make redisWrapper *Object functions more resilient * better wording * better wording 2 * better wording 3 * make lint non-fixing by default and add jsdoc to lint script * clean up exports and some jsdoc * finally fix service to class links in jsdoc * jsdoc polish * jsdoc polish 2 * consistent wording * add jsdoc to dev dependencies * consistency * isValid should be determined via config, not fallback values * jsdoc modules with lower dash case * jsdoc can ignore handler collection * add npm redis link to redis wrapper * polish for Semaphore
1 parent 0acca93 commit 80c5426

25 files changed

+622
-167
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
node_modules/
22
temp/
3+
34
docs/vendor/
45
docs/_site/
6+
7+
out/

.github/workflows/main-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ jobs:
3636
node-version: 18
3737
cache: npm
3838
- run: npm ci --package-lock
39-
- run: npm run lint:ci
39+
- run: npm run lint

.github/workflows/main-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ jobs:
3636
node-version: 18
3737
cache: npm
3838
- run: npm ci --package-lock
39-
- run: npm run lint:ci
39+
- run: npm run lint

.github/workflows/publish-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
registry-url: https://registry.npmjs.org/
2323
- run: npm ci --package-lock
2424
- run: npm test
25-
- run: npm run lint:ci
25+
- run: npm run lint
2626
- run: npm publish --access public
2727
env:
2828
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ gen/
1414

1515
# test
1616
coverage
17+
18+
# jsdoc
19+
out/

.prettierignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
node_modules/
2-
package-lock.json
32
temp/
3+
package-lock.json
44

55
docs/vendor/
66
docs/_site/
7+
8+
out/

docs/usage/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ Redis don't access the same data, unless this is intended. Whenever two or more
2121
must be _initialized_ with the same configuration.
2222

2323
```javascript
24-
const { FeatureToggles } = require("@cap-js-community/feature-toggle-library");
24+
const toggles = require("@cap-js-community/feature-toggle-library");
25+
const FeatureToggles = toggles.constructor;
2526
const instance = new FeatureToggles({ uniqueName: "snowflake" });
2627
```
2728

@@ -186,8 +187,8 @@ feature toggles.
186187
```javascript
187188
const pathlib = require("path");
188189
const toggles = require("@cap-js-community/feature-toggle-library");
190+
const FeatureToggles = toggles.constructor;
189191
const FEATURES_FILEPATH = pathlib.join(__dirname, ".toggles.yml");
190-
const { FeatureToggles } = toggles;
191192
192193
// ... during application bootstrap
193194
const config = await FeatureToggles.readConfigFromFile(FEATURES_FILEPATH);

example-cap-server/http/feature-service.http

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22
GET {{base_url}}/rest/feature/state
33
Authorization: Basic system system
44

5+
### redis_read
6+
POST {{base_url}}/rest/feature/redisRead
7+
Authorization: Basic system system
8+
Content-Type: application/json
9+
10+
### redis_update | reset toggles that are not configured
11+
POST {{base_url}}/rest/feature/redisUpdate
12+
Authorization: Basic system system
13+
Content-Type: application/json
14+
15+
{
16+
"key": "/srv/memoryStatistics/logInterval",
17+
"value": null,
18+
"options": {
19+
"clearSubScopes": true,
20+
"remoteOnly": true
21+
}
22+
}
23+
524
### redis_update | fts 1
625
POST {{base_url}}/rest/feature/redisUpdate
726
Authorization: Basic system system

example-cap-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"dependencies": {
2121
"@cap-js-community/feature-toggle-library": "*",
22-
"@sap/cds": "^8.2.2",
22+
"@sap/cds": "^8.2.3",
2323
"@sap/cds-mtxs": "^1.18.3",
2424
"express": "^4.21.0"
2525
},

0 commit comments

Comments
 (0)