Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5a4b9a3
feat [wip]: creat find deps msg
lmscunha Dec 2, 2025
83fd818
merge with lc-setup-plugin
lmscunha Dec 2, 2025
907f7d8
test: create init test for find deps
lmscunha Dec 2, 2025
f14d191
feat [wip]: update find deps to use classical bfs algorithm
lmscunha Dec 3, 2025
f333637
feat: update find deps to sort by level then alphabetically
lmscunha Dec 3, 2025
db953fd
Merge branch 'lc-setup-plugin' into lc-add-find-deps-msg
lmscunha Dec 4, 2025
2542640
test: refactor find-deps
lmscunha Dec 4, 2025
2218884
test: add more for find:deps msg
lmscunha Dec 4, 2025
4fe7a30
feat: allow client to define rootEntity
lmscunha Dec 4, 2025
b2c6d4f
test: add two-convergent and self-ref cases
lmscunha Dec 4, 2025
e591c1a
feat: add gubu validation to find:deps
lmscunha Dec 4, 2025
d2e4e8d
test: extend edgcases for find:deps
lmscunha Dec 4, 2025
c36b31b
fix: ensure children are also sorted alphabetically
lmscunha Dec 4, 2025
e1bca45
test: add more subchild checks
lmscunha Dec 4, 2025
19b0860
refactor: update find:deps
lmscunha Dec 4, 2025
84ce80d
refactor: update find:deps
lmscunha Dec 4, 2025
9090178
Merge branch 'main' into lc-add-find-deps-msg
lmscunha Dec 5, 2025
cadcdb6
doc: update TraverseDoc with msgFindDeps description
lmscunha Dec 6, 2025
60eb0e0
refactor: update msgFindDeps comment
lmscunha Dec 6, 2025
d0a85f3
doc: udpate Readme
lmscunha Dec 6, 2025
4969a6e
refactor: update type declartion Entity -> EntityID
lmscunha Dec 9, 2025
8ef5f9f
refactor: update type declartion Relation -> ParentChildRelation
lmscunha Dec 9, 2025
fff4736
test: add more checks for find:deps
lmscunha Dec 9, 2025
0b7b0f3
refactor: only get relations from options
lmscunha Dec 9, 2025
d8bad5f
test: make 10 level use coherent entity ids names
lmscunha Dec 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 22 additions & 99 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,147 +1,70 @@
# @seneca/config
# @seneca/traverse

> _Seneca Config_ is a plugin for [Seneca](http://senecajs.org)
> _Seneca Traverse_ is a plugin for [Seneca](http://senecajs.org)

Live configuration plugin for the Seneca framework.
Data Traverse plugin for the Seneca framework.

Unlike static configuration, this plugin lets you store keyed
configuration in your deployed persistent storage so that you can
change it on the live system. This is useful for things like currency
exchange rates, feature flags, A/B testing etc.


[![npm version](https://img.shields.io/npm/v/@seneca/config.svg)](https://npmjs.com/package/@seneca/config)
[![build](https://github.com/senecajs/SenecaConfig/actions/workflows/build.yml/badge.svg)](https://github.com/senecajs/SenecaConfig/actions/workflows/build.yml)
[![Coverage Status](https://coveralls.io/repos/github/senecajs/SenecaConfig/badge.svg?branch=main)](https://coveralls.io/github/senecajs/SenecaConfig?branch=main)
[![Known Vulnerabilities](https://snyk.io/test/github/senecajs/SenecaConfig/badge.svg)](https://snyk.io/test/github/senecajs/SenecaConfig)
[![npm version](https://img.shields.io/npm/v/@seneca/traverse.svg)](https://npmjs.com/package/@seneca/traverse)
[![build](https://github.com/senecajs/SenecaTraverse/actions/workflows/build.yml/badge.svg)](https://github.com/senecajs/SenecaTraverse/actions/workflows/build.yml)
[![Coverage Status](https://coveralls.io/repos/github/senecajs/SenecaTraverse/badge.svg?branch=main)](https://coveralls.io/github/senecajs/SenecaTraverse?branch=main)
[![Known Vulnerabilities](https://snyk.io/test/github/senecajs/SenecaTraverse/badge.svg)](https://snyk.io/test/github/senecajs/SenecaTraverse)
[![DeepScan grade](https://deepscan.io/api/teams/5016/projects/26547/branches/846930/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=5016&pid=26547&bid=846930)
[![Maintainability](https://api.codeclimate.com/v1/badges/3e5e5c11a17dbfbdd894/maintainability)](https://codeclimate.com/github/senecajs/SenecaConfig/maintainability)
[![Maintainability](https://api.codeclimate.com/v1/badges/3e5e5c11a17dbfbdd894/maintainability)](https://codeclimate.com/github/senecajs/SenecaTraverse/maintainability)

| ![Voxgig](https://www.voxgig.com/res/img/vgt01r.png) | This open source module is sponsored and supported by [Voxgig](https://www.voxgig.com). |
| ---------------------------------------------------- | --------------------------------------------------------------------------------------- |

## Install

```sh
$ npm install @seneca/Config
$ npm install @seneca/traverse
```

## Quick Example

```js
seneca.use('Config', {})

const initRes = await seneca.post('sys:config,init:val,key:a,val:1')
// === { ok: true, key: 'a', val: 1, entry: { key: 'a', val: 1 } }

const getRes = await seneca.post('sys:config,get:val,key:a')
// === { ok: true, key: 'a', val: 1, entry: { key: 'a', val: 1 } }

const setRes = await seneca.post('sys:config,set:val,key:a,val:2')
// === { ok: true, key: 'a', val: 1, entry: { key: 'a', val: 2 } }
seneca.use('Traverse', {})

const depsRes = await seneca.post('sys:traverse,find:deps')
// === { ok: true, deps: [['foo/bar0,foo/bar1'],...] }
```

## More Examples

Review the [unit tests](test/Config.test.ts) for more examples.


Review the [unit tests](test/Traverse.test.ts) for more examples.

<!--START:options-->


## Options

* `debug` : boolean
* `numparts` : number
* `canon` : object
* `init$` : boolean

- `debug` : boolean
- `rootEntity` : string
- `relations` : { parental: array }

<!--END:options-->

<!--START:action-list-->


## Action Patterns

* [sys:config,get:val](#-sysconfiggetval-)
* [sys:config,init:val](#-sysconfiginitval-)
* [sys:config,list:val](#-sysconfiglistval-)
* [sys:config,map:val](#-sysconfigmapval-)
* [sys:config,set:val](#-sysconfigsetval-)

- [sys:traverse,find:deps](#-systraversefinddeps-)

<!--END:action-list-->

<!--START:action-desc-->


## Action Descriptions

### &laquo; `sys:config,get:val` &raquo;

Get a config value by key.


#### Parameters


* __key__ : _string_


----------
### &laquo; `sys:config,init:val` &raquo;

Initialise a config value by key (must not exist).


#### Parameters


* __key__ : _string_
* __existing__ : _boolean_ (optional, default: `false`)


----------
### &laquo; `sys:config,list:val` &raquo;

List config values by query.


#### Parameters


* __q__ : _object_ (optional, default: `{}`)


----------
### &laquo; `sys:config,map:val` &raquo;

Get a map of config values by key prefix (dot separated).


#### Parameters


* __prefix__ : _string_


----------
### &laquo; `sys:config,set:val` &raquo;

Set a config value by key (must exist).
### &laquo; `sys:traverse,find:deps` &raquo;

Returns a sorted list of entity pairs starting from a given entity.

#### Parameters

- **rootEntity** : _string_ (optional, default: 'sys/user')
- **relations** : _object_ (optional, default : { parental: [] })

* __key__ : _string_


----------

---

<!--END:action-desc-->

Expand Down
Loading