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
Copy file name to clipboardExpand all lines: README.md
+99-14Lines changed: 99 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,30 +2,82 @@
2
2
3
3
Generic toolkit for server and web applications.
4
4
5
-
-[ ]
5
+
1. Manages global settings for the lib (servers, localization, logger)
6
+
2. Extends orginal Pryv's JS lib to fit HDS needs
7
+
3. Based on [HDS data model](https://github.com/healthdatasafe/data-model-draft?tab=readme-ov-file#hds-data-model-drafting-space) exposes methods to facilitate app development.
8
+
- load data model and exposes it as a singleton
9
+
- retrieve definitions
10
+
- provides helper for stream creation and authorizations requests
11
+
4. Provide app templates to create new applications for
12
+
- Requesting and managing consents - And collecting data
13
+
- Approving requests and sharing data
14
+
5. Other tools to facilitate app developments
6
15
7
-
## Usage
8
16
9
-
### Model
17
+
##Components
10
18
11
-
#### Load
19
+
### settings
20
+
21
+
#### settings.setServiceInfoURL(url)
22
+
Set the default service for `HDSModel` and `HDSService`
23
+
24
+
#### settings.setPreferredLocales(Array of locales)
25
+
Change the order of pereferred localization codes
26
+
27
+
### HDSService
28
+
Is an extension of `pryv.Service` which uses the default service set with `settings.setServiceInfoURL(url)``
29
+
30
+
### pryv
31
+
Patched version of [pryv's javacript library](https://github.com/pryv/lib-js) including supports for [Socket.io](https://github.com/pryv/lib-js/tree/master/components/pryv-socket.io) and [Monitors](https://github.com/pryv/lib-js/tree/master/components/pryv-monitor)
0. (Optional) You may set the defaultService info of the lib with `HDSLib.setServiceInfoURL()`.
55
+
1. Initialize model singleton once with `await HDSLib.initHDSModel()`
56
+
2. Use model from `HDSLib.model`
57
+
58
+
#### HDSModel.ItemDef
19
59
20
60
An `ItemDef` is an object representation of the items from the data Model
21
61
62
+
-**itemDef.key**: (string) a unique identifier, for example `body-weight`
63
+
-**itemDef.data**: (Object) raw data for this item from [HDS data model](https://github.com/healthdatasafe/data-model-draft?tab=readme-ov-file#hds-data-model-drafting-space)
0 commit comments