lamp-core-lst 2025.11.1-3.basic
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +34 -0
- package/LICENSE.md +29 -0
- package/MANUAL.md +26 -0
- package/README.md +126 -0
- package/cli.js +2 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.js +311 -0
- package/dist/model/Activity.d.ts +81 -0
- package/dist/model/Activity.js +30 -0
- package/dist/model/ActivityEvent.d.ts +51 -0
- package/dist/model/ActivityEvent.js +21 -0
- package/dist/model/ActivitySpec.d.ts +38 -0
- package/dist/model/ActivitySpec.js +12 -0
- package/dist/model/Credential.d.ts +21 -0
- package/dist/model/Credential.js +12 -0
- package/dist/model/DynamicAttachment.d.ts +34 -0
- package/dist/model/DynamicAttachment.js +12 -0
- package/dist/model/Participant.d.ts +30 -0
- package/dist/model/Participant.js +12 -0
- package/dist/model/Researcher.d.ts +27 -0
- package/dist/model/Researcher.js +12 -0
- package/dist/model/ResearcherSettings.d.ts +57 -0
- package/dist/model/ResearcherSettings.js +12 -0
- package/dist/model/Sensor.d.ts +22 -0
- package/dist/model/Sensor.js +12 -0
- package/dist/model/SensorEvent.d.ts +18 -0
- package/dist/model/SensorEvent.js +12 -0
- package/dist/model/SensorSpec.d.ts +13 -0
- package/dist/model/SensorSpec.js +12 -0
- package/dist/model/Study.d.ts +24 -0
- package/dist/model/Study.js +12 -0
- package/dist/model/Type.d.ts +56 -0
- package/dist/model/Type.js +30 -0
- package/dist/model/index.d.ts +12 -0
- package/dist/model/index.js +24 -0
- package/dist/service/API.service.d.ts +12 -0
- package/dist/service/API.service.js +82 -0
- package/dist/service/Activity.service.d.ts +101 -0
- package/dist/service/Activity.service.js +756 -0
- package/dist/service/ActivityEvent.service.d.ts +46 -0
- package/dist/service/ActivityEvent.service.js +303 -0
- package/dist/service/ActivitySpec.service.d.ts +31 -0
- package/dist/service/ActivitySpec.service.js +173 -0
- package/dist/service/Credential.service.d.ts +38 -0
- package/dist/service/Credential.service.js +319 -0
- package/dist/service/Demo.d.ts +14 -0
- package/dist/service/Demo.js +24 -0
- package/dist/service/Fetch.d.ts +30 -0
- package/dist/service/Fetch.js +245 -0
- package/dist/service/Participant.service.d.ts +42 -0
- package/dist/service/Participant.service.js +312 -0
- package/dist/service/Researcher.service.d.ts +34 -0
- package/dist/service/Researcher.service.js +252 -0
- package/dist/service/ResearcherSettings.service.d.ts +16 -0
- package/dist/service/ResearcherSettings.service.js +114 -0
- package/dist/service/Sensor.service.d.ts +47 -0
- package/dist/service/Sensor.service.js +372 -0
- package/dist/service/SensorEvent.service.d.ts +44 -0
- package/dist/service/SensorEvent.service.js +302 -0
- package/dist/service/SensorSpec.service.d.ts +31 -0
- package/dist/service/SensorSpec.service.js +171 -0
- package/dist/service/Study.service.d.ts +42 -0
- package/dist/service/Study.service.js +286 -0
- package/dist/service/Type.service.d.ts +48 -0
- package/dist/service/Type.service.js +352 -0
- package/dist/service/index.d.ts +13 -0
- package/dist/service/index.js +25 -0
- package/docs/APIApi.md +82 -0
- package/docs/AccessCitation.md +11 -0
- package/docs/Activity.md +13 -0
- package/docs/ActivityApi.md +356 -0
- package/docs/ActivityEvent.md +13 -0
- package/docs/ActivityEventApi.md +251 -0
- package/docs/ActivitySpec.md +14 -0
- package/docs/ActivitySpecApi.md +222 -0
- package/docs/Credential.md +12 -0
- package/docs/CredentialApi.md +175 -0
- package/docs/Document.md +9 -0
- package/docs/DurationInterval.md +11 -0
- package/docs/DurationIntervalLegacy.md +10 -0
- package/docs/DynamicAttachment.md +14 -0
- package/docs/Error.md +8 -0
- package/docs/Metadata.md +8 -0
- package/docs/Participant.md +14 -0
- package/docs/ParticipantApi.md +312 -0
- package/docs/Researcher.md +12 -0
- package/docs/ResearcherApi.md +223 -0
- package/docs/Sensor.md +12 -0
- package/docs/SensorApi.md +356 -0
- package/docs/SensorEvent.md +11 -0
- package/docs/SensorEventApi.md +250 -0
- package/docs/SensorSpec.md +10 -0
- package/docs/SensorSpecApi.md +222 -0
- package/docs/Study.md +11 -0
- package/docs/StudyApi.md +268 -0
- package/docs/TemporalSlice.md +13 -0
- package/docs/TypeApi.md +274 -0
- package/package.json +44 -0
- package/src/index.ts +256 -0
- package/src/model/Activity.ts +93 -0
- package/src/model/ActivityEvent.ts +63 -0
- package/src/model/ActivitySpec.ts +45 -0
- package/src/model/Credential.ts +26 -0
- package/src/model/DynamicAttachment.ts +42 -0
- package/src/model/Participant.ts +37 -0
- package/src/model/Researcher.ts +33 -0
- package/src/model/ResearcherSettings.ts +65 -0
- package/src/model/Sensor.ts +27 -0
- package/src/model/SensorEvent.ts +22 -0
- package/src/model/SensorSpec.ts +16 -0
- package/src/model/Study.ts +29 -0
- package/src/model/Type.ts +68 -0
- package/src/model/index.ts +12 -0
- package/src/service/API.service.ts +29 -0
- package/src/service/Activity.service.ts +625 -0
- package/src/service/ActivityEvent.service.ts +244 -0
- package/src/service/ActivitySpec.service.ts +98 -0
- package/src/service/Credential.service.ts +268 -0
- package/src/service/Demo.ts +21 -0
- package/src/service/Fetch.ts +187 -0
- package/src/service/Participant.service.ts +217 -0
- package/src/service/Researcher.service.ts +147 -0
- package/src/service/ResearcherSettings.service.ts +62 -0
- package/src/service/Sensor.service.ts +256 -0
- package/src/service/SensorEvent.service.ts +239 -0
- package/src/service/SensorSpec.service.ts +96 -0
- package/src/service/Study.service.ts +187 -0
- package/src/service/Type.service.ts +297 -0
- package/src/service/index.ts +13 -0
- package/tsconfig.json +29 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Identifier, Timestamp } from './Type'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A specific sub-detail of a `ActivityEvent` that contains specific interaction information that comprises the parent `ActivityEvent`.
|
|
5
|
+
*/
|
|
6
|
+
export class TemporalEvent {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The item that was interacted with for example, in a Jewels game, the corresponding alphabet, or in a survey, the question index.
|
|
10
|
+
*/
|
|
11
|
+
item?: any
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The value of the item that was interacted with in most games, this field is `null`, but in a survey, this field is the question choice index.
|
|
15
|
+
*/
|
|
16
|
+
value?: any
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The type of interaction that for this detail for example, in a Jewels game, `none` if the tapped jewel was incorrect, or `correct` if it was correct, or in a survey, this field will be `null`.
|
|
20
|
+
*/
|
|
21
|
+
type?: string
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The time difference from the previous detail or the start of the parent result.
|
|
25
|
+
*/
|
|
26
|
+
duration?: number
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The level of activity for this detail for example, in games with multiple levels, this field might be `2` or `4`, but for surveys and other games this field will be `null`.
|
|
30
|
+
*/
|
|
31
|
+
level?: number
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* An event generated by the participant interacting with an `Activity`.
|
|
36
|
+
*/
|
|
37
|
+
export class ActivityEvent {
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
timestamp?: Timestamp
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The duration this event lasted before recording ended.
|
|
46
|
+
*/
|
|
47
|
+
duration?: number
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
*/
|
|
52
|
+
activity?: Identifier
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The summary information for the activity event as determined by the activity that created this activity event.
|
|
56
|
+
*/
|
|
57
|
+
static_data?: any
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The specific interaction details of the activity event.
|
|
61
|
+
*/
|
|
62
|
+
temporalSlices?: Array<any>
|
|
63
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tab setting for Activity Spec
|
|
3
|
+
*/
|
|
4
|
+
type Tab = 'learn' | 'assess' | 'manage' | 'prevent'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The ActivitySpec determines the parameters and properties of an Activity and its corresponding generated ActivityEvents.
|
|
8
|
+
*/
|
|
9
|
+
export class ActivitySpec {
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The name of the activity spec.
|
|
13
|
+
*/
|
|
14
|
+
name?: string
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Either a binary blob containing a document or video, or a string containing instructional aid about the Activity.
|
|
18
|
+
*/
|
|
19
|
+
description?: string
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The WebView-compatible script that provides this Activity on mobile or desktop (IFrame) clients.
|
|
23
|
+
*/
|
|
24
|
+
executable?: string | null
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The data definition of an ActivitySpec.
|
|
28
|
+
*/
|
|
29
|
+
data?: any
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The temporal slice data definition of an ActivitySpec.
|
|
33
|
+
*/
|
|
34
|
+
temporalSlices?: any
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The Activity settings definition of an ActivitySpec.
|
|
38
|
+
*/
|
|
39
|
+
settings?: any
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The tab settings definition of an ActivitySpec.
|
|
43
|
+
*/
|
|
44
|
+
category?: Tab[] | null
|
|
45
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* Every object can have one or more credential(s) associated with it. i.e. my_researcher.credentials = ['person A', 'person B', 'api A', 'person C', 'api B']
|
|
4
|
+
*/
|
|
5
|
+
export class Credential {
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The root object this credential is attached to. The scope of this credential is limited to the object itself and any children.
|
|
9
|
+
*/
|
|
10
|
+
origin?: string
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Username or machine-readable public key (access).
|
|
14
|
+
*/
|
|
15
|
+
accessKey?: string
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* SALTED HASH OF Password or machine-readable private key (secret).
|
|
19
|
+
*/
|
|
20
|
+
secretKey?: string
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The user-visible description of the credential.
|
|
24
|
+
*/
|
|
25
|
+
description?: string
|
|
26
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Identifier } from './Type'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export class DynamicAttachment {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The key.
|
|
10
|
+
*/
|
|
11
|
+
key?: string
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
from?: Identifier
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Either \"me\" to apply to the attachment owner only, the ID of an object owned by the attachment owner, or a string representing the child object type to apply to.
|
|
20
|
+
*/
|
|
21
|
+
to?: string
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The API triggers that activate script execution. These will be event stream types or object types in the API, or, if scheduling execution periodically, a cron-job string prefixed with \"!\" (exclamation point).
|
|
25
|
+
*/
|
|
26
|
+
triggers?: Array<any>
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The script language.
|
|
30
|
+
*/
|
|
31
|
+
language?: string
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The script contents.
|
|
35
|
+
*/
|
|
36
|
+
contents?: string
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The script requirements.
|
|
40
|
+
*/
|
|
41
|
+
requirements?: Array<any>
|
|
42
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Identifier } from './Type'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A participant within a study a participant cannot be enrolled in more than one study at a time.
|
|
5
|
+
*/
|
|
6
|
+
export class Participant {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
id?: Identifier
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The researcher-provided study code for the participant.
|
|
15
|
+
*/
|
|
16
|
+
studyCode?: string
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The participant's selected language code for the LAMP app.
|
|
20
|
+
*/
|
|
21
|
+
language?: string
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The participant's selected theme for the LAMP app.
|
|
25
|
+
*/
|
|
26
|
+
theme?: string
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The participant's emergency contact number.
|
|
30
|
+
*/
|
|
31
|
+
emergencyContact?: string
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The participant's selected personal helpline number.
|
|
35
|
+
*/
|
|
36
|
+
helpline?: string
|
|
37
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Identifier } from './Type'
|
|
2
|
+
import { Study } from './Study'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export class Researcher {
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
id?: Identifier
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The name of the researcher.
|
|
16
|
+
*/
|
|
17
|
+
name?: string
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The email address of the researcher.
|
|
21
|
+
*/
|
|
22
|
+
email?: string
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The physical address of the researcher.
|
|
26
|
+
*/
|
|
27
|
+
address?: string
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The set of all studies conducted by the researcher.
|
|
31
|
+
*/
|
|
32
|
+
studies?: Study[]
|
|
33
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Identifier, Timestamp } from "./Type"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export class ResearcherSettings {
|
|
7
|
+
/**
|
|
8
|
+
* The banner greeting.
|
|
9
|
+
*/
|
|
10
|
+
bannerSettings?: string
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The banner heading
|
|
14
|
+
*/
|
|
15
|
+
bannerHeading?: string
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The banner sub heading
|
|
19
|
+
*/
|
|
20
|
+
bannerSubHeading?: string
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The image icon for banner
|
|
24
|
+
*/
|
|
25
|
+
imageBase64?: string
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The selected activity
|
|
29
|
+
*/
|
|
30
|
+
selectedActivity?: string
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The selected group
|
|
34
|
+
*/
|
|
35
|
+
selectedGroup?: string
|
|
36
|
+
/**
|
|
37
|
+
* The button text
|
|
38
|
+
*/
|
|
39
|
+
buttonText?: string
|
|
40
|
+
/**
|
|
41
|
+
* The activityId
|
|
42
|
+
*/
|
|
43
|
+
activityId?: string
|
|
44
|
+
/**
|
|
45
|
+
* The favourite activities
|
|
46
|
+
*/
|
|
47
|
+
favouriteActivities?: any
|
|
48
|
+
/**
|
|
49
|
+
* The featured activity
|
|
50
|
+
*/
|
|
51
|
+
featuredActivity?: string
|
|
52
|
+
/**
|
|
53
|
+
* The timestamp
|
|
54
|
+
*/
|
|
55
|
+
timestamp?: Timestamp
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The deleted flag
|
|
59
|
+
*/
|
|
60
|
+
deleted?: boolean
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export type ResearcherBanner = {
|
|
64
|
+
data: ResearcherSettings
|
|
65
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Identifier, Timestamp } from './Type'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A sensor that may or may not be available on a physical device.
|
|
5
|
+
*/
|
|
6
|
+
export class Sensor {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The self-referencing identifier to this object.
|
|
10
|
+
*/
|
|
11
|
+
id?: Identifier
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The specification, parameters, and type of the sensor.
|
|
15
|
+
*/
|
|
16
|
+
spec?: Identifier
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The name of the sensor.
|
|
20
|
+
*/
|
|
21
|
+
name?: string
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The configuration settings for the sensor.
|
|
25
|
+
*/
|
|
26
|
+
settings?: any
|
|
27
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Timestamp } from './Type'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* An event generated by a participant interacting with the LAMP app.
|
|
5
|
+
*/
|
|
6
|
+
export class SensorEvent {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
timestamp?: Timestamp
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The type of the sensor event.
|
|
15
|
+
*/
|
|
16
|
+
sensor?: string
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The item information recorded within the sensor event.
|
|
20
|
+
*/
|
|
21
|
+
data?: any
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* The SensorSpec determines the parameters of generated SensorEvents.
|
|
4
|
+
*/
|
|
5
|
+
export class SensorSpec {
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The name of the sensor.
|
|
9
|
+
*/
|
|
10
|
+
name?: string
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The data definition of a SensorSpec.
|
|
14
|
+
*/
|
|
15
|
+
settingsSchema?: any
|
|
16
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Identifier } from './Type'
|
|
2
|
+
import { Activity } from './Activity'
|
|
3
|
+
import { Participant } from './Participant'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export class Study {
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
id?: Identifier
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The name of the study.
|
|
17
|
+
*/
|
|
18
|
+
name?: string
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The set of all activities available in the study.
|
|
22
|
+
*/
|
|
23
|
+
activities?: Activity[]
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The set of all enrolled participants in the study.
|
|
27
|
+
*/
|
|
28
|
+
participants?: Participant[]
|
|
29
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* A globally unique reference for objects.
|
|
4
|
+
*/
|
|
5
|
+
export type Identifier = string
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The UNIX Epoch date-time representation: number of milliseconds since 1/1/1970 12:00 AM.
|
|
9
|
+
*/
|
|
10
|
+
export type Timestamp = number
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Runtime type specification for each object in the LAMP platform.
|
|
14
|
+
*/
|
|
15
|
+
export interface Type {}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export class AccessCitation {
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
_in?: string
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
at?: string
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
35
|
+
on?: Timestamp
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
by?: string
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
46
|
+
export class Metadata {
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
access?: AccessCitation
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
export class Document {
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
*/
|
|
62
|
+
meta?: Metadata
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
*/
|
|
67
|
+
data?: Array<any>
|
|
68
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './Activity'
|
|
2
|
+
export * from './ActivityEvent'
|
|
3
|
+
export * from './ActivitySpec'
|
|
4
|
+
export * from './Credential'
|
|
5
|
+
export * from './Participant'
|
|
6
|
+
export * from './Researcher'
|
|
7
|
+
export * from './ResearcherSettings'
|
|
8
|
+
export * from './Sensor'
|
|
9
|
+
export * from './SensorEvent'
|
|
10
|
+
export * from './SensorSpec'
|
|
11
|
+
export * from './Study'
|
|
12
|
+
export * from './Type'
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Fetch, Configuration } from "./Fetch"
|
|
2
|
+
import { Demo } from "./Demo"
|
|
3
|
+
import jsonata from "jsonata"
|
|
4
|
+
|
|
5
|
+
export class APIService {
|
|
6
|
+
public configuration?: Configuration
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Query the LAMP Database.
|
|
10
|
+
*/
|
|
11
|
+
public async query(transform: string): Promise<{}> {
|
|
12
|
+
if (this.configuration.base === "https://demo.lamp.digital") {
|
|
13
|
+
// DEMO
|
|
14
|
+
return Promise.resolve({ error: "500.demo-unavailable" } as any)
|
|
15
|
+
}
|
|
16
|
+
return await Fetch.post<{}>(`/`, transform, this.configuration)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* View the API schema document.
|
|
21
|
+
*/
|
|
22
|
+
public async schema(): Promise<{}> {
|
|
23
|
+
if (this.configuration.base === "https://demo.lamp.digital") {
|
|
24
|
+
// DEMO
|
|
25
|
+
return Promise.resolve({ error: "500.demo-unavailable" } as any)
|
|
26
|
+
}
|
|
27
|
+
return await Fetch.get<{}>(`/`, this.configuration)
|
|
28
|
+
}
|
|
29
|
+
}
|