@@ -15,15 +15,15 @@ const model = new HDSLib.HDSModel('https://model.datasafe.dev/pack.json');
1515await model .load ();
1616```
1717
18- #### IdemDef
18+ #### ItemDef
1919
20- An ` ItemdDef ` is an object representation of the items from the data Model
20+ An ` ItemDef ` is an object representation of the items from the data Model
2121
2222``` javascript
2323// retrieve an itemDef by it's key
2424const weight = model .itemDefs .forKey (' body-weight' );
2525weight .streamId ; // => 'body-weight'
26- weight .eventTypes ; // => 'mass/kg', 'mass/lb']
26+ weight .eventTypes ; // => [ 'mass/kg', 'mass/lb']
2727```
2828
2929``` javascript
@@ -32,14 +32,14 @@ const anEvent = {
3232 streamIds: [' body-weight' , ' dummy' ],
3333 type: ' mass/kg'
3434};
35- const itemDef = model .itemsDefs .forEvent (fakeEvent );
35+ const itemDef = model .itemsDefs .forEvent (anEvent );
3636itemDef .key // => 'body-weight'
3737```
3838
3939#### Streams
4040
4141``` javascript
42- // get the list of streams to be created to store theses items
42+ // get the list of streams to be created to store these items
4343const itemKeys = [
4444 ' profile-name' ,
4545 ' profile-date-of-birth' ,
@@ -59,29 +59,29 @@ const itemKeys = [
5959 ' profile-date-of-birth' ,
6060 ' body-vulva-mucus-stretch' ,
6161 ' profile-surname'
62- ];
63- const options = {
64- preRequest: [ // optional, will be considered in the request
65- { streamId: ' profile' },
66- { streamId: ' app-test' , defaultName: ' App test' , level: ' write' }
67- ]
68- };
69- const authorizationSet = model .authorizations .forItemKeys (itemKeys, options);
70- // the following object is the result
71- const expected = [
72- { streamId: ' profile' , defaultName: ' Profile' , level: ' read' },
73- { streamId: ' app-test' , defaultName: ' App test' , level: ' write' },
74- {
75- streamId: ' body-vulva-mucus-inspect' ,
76- defaultName: ' Vulva Mucus Inspect' ,
77- level: ' read'
78- },
79- {
80- streamId: ' body-vulva-mucus-stretch' ,
81- defaultName: ' Vulva Mucus Stretch' ,
82- level: ' read'
83- }
84- ];
62+ ];
63+ const options = {
64+ preRequest: [ // optional, will be considered in the request
65+ { streamId: ' profile' },
66+ { streamId: ' app-test' , defaultName: ' App test' , level: ' write' }
67+ ]
68+ };
69+ const authorizationSet = model .authorizations .forItemKeys (itemKeys, options);
70+ // the following object is the result
71+ const expected = [
72+ { streamId: ' profile' , defaultName: ' Profile' , level: ' read' },
73+ { streamId: ' app-test' , defaultName: ' App test' , level: ' write' },
74+ {
75+ streamId: ' body-vulva-mucus-inspect' ,
76+ defaultName: ' Vulva Mucus Inspect' ,
77+ level: ' read'
78+ },
79+ {
80+ streamId: ' body-vulva-mucus-stretch' ,
81+ defaultName: ' Vulva Mucus Stretch' ,
82+ level: ' read'
83+ }
84+ ];
8585```
8686
8787
@@ -98,7 +98,7 @@ Some of the functionalities will be moved from the lib
9898
9999``` html
100100<head >
101- <script src =" ../docs/hds-lib.js" ></script >"
101+ <script src =" ../docs/hds-lib.js" ></script >
102102 <script >
103103 model = new HDSLib.HDSModel ();
104104 </script >
0 commit comments