case-editor-tools 1.0.0-beta.9 → 1.0.2
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/constants/key-definitions.d.ts +3 -0
- package/constants/key-definitions.js +7 -1
- package/constants/key-definitions.js.map +1 -1
- package/exporter/index.d.ts +2 -0
- package/exporter/index.js +128 -0
- package/exporter/index.js.map +1 -0
- package/expression-utils/expressionGen.d.ts +1 -1
- package/expression-utils/studyEngineExpressions.d.ts +94 -13
- package/expression-utils/studyEngineExpressions.js +215 -19
- package/expression-utils/studyEngineExpressions.js.map +1 -1
- package/{item-editor-cb5ebc1a.js → item-editor-59f51ecc.js} +67 -46
- package/item-editor-59f51ecc.js.map +1 -0
- package/logger/index.d.ts +1 -0
- package/logger/index.js +10 -0
- package/logger/index.js.map +1 -0
- package/package.json +5 -5
- package/surveys/index.d.ts +1 -0
- package/surveys/index.js +9 -1
- package/surveys/index.js.map +1 -1
- package/surveys/responseTypeGenerators/likertGroupComponents.d.ts +27 -0
- package/surveys/responseTypeGenerators/likertGroupComponents.js +350 -0
- package/surveys/responseTypeGenerators/likertGroupComponents.js.map +1 -0
- package/surveys/responseTypeGenerators/matrixGroupComponent.d.ts +49 -0
- package/surveys/responseTypeGenerators/matrixGroupComponent.js +100 -0
- package/surveys/responseTypeGenerators/matrixGroupComponent.js.map +1 -0
- package/surveys/responseTypeGenerators/optionGroupComponents.d.ts +7 -0
- package/surveys/responseTypeGenerators/optionGroupComponents.js +129 -0
- package/surveys/responseTypeGenerators/optionGroupComponents.js.map +1 -0
- package/surveys/survey-editor/component-editor.d.ts +1 -1
- package/surveys/survey-editor/data-types.d.ts +1 -1
- package/surveys/survey-editor/item-editor.d.ts +2 -1
- package/surveys/survey-editor/item-editor.js +2 -1
- package/surveys/survey-editor/item-editor.js.map +1 -1
- package/surveys/survey-editor/survey-editor.d.ts +6 -1
- package/surveys/survey-editor/survey-editor.js +13 -6
- package/surveys/survey-editor/survey-editor.js.map +1 -1
- package/surveys/survey-engine-expressions.d.ts +12 -2
- package/surveys/survey-engine-expressions.js +43 -2
- package/surveys/survey-engine-expressions.js.map +1 -1
- package/surveys/survey-items.d.ts +33 -227
- package/surveys/survey-items.js +215 -780
- package/surveys/survey-items.js.map +1 -1
- package/surveys/types/group.d.ts +1 -1
- package/surveys/types/group.js +2 -1
- package/surveys/types/group.js.map +1 -1
- package/surveys/types/index.js +3 -1
- package/surveys/types/index.js.map +1 -1
- package/surveys/types/item-properties.d.ts +206 -2
- package/surveys/types/item-properties.js +7 -0
- package/surveys/types/item-properties.js.map +1 -1
- package/surveys/types/item.d.ts +1 -1
- package/surveys/types/survey-definition.d.ts +7 -3
- package/surveys/types/survey-definition.js +11 -2
- package/surveys/types/survey-definition.js.map +1 -1
- package/surveys/utils/componentGenerators.d.ts +2 -13
- package/surveys/utils/componentGenerators.js +1 -34
- package/surveys/utils/componentGenerators.js.map +1 -1
- package/surveys/utils/optionDefGenerators.d.ts +84 -0
- package/surveys/utils/optionDefGenerators.js +211 -0
- package/surveys/utils/optionDefGenerators.js.map +1 -0
- package/surveys/utils/simple-generators.d.ts +4 -3
- package/surveys/utils/simple-generators.js +29 -0
- package/surveys/utils/simple-generators.js.map +1 -1
- package/surveys/utils/simple-question-editor.d.ts +5 -5
- package/surveys/utils/simple-question-editor.js +5 -2
- package/surveys/utils/simple-question-editor.js.map +1 -1
- package/types/expression.d.ts +1 -1
- package/types/messageConfig.d.ts +49 -0
- package/types/messageConfig.js +23 -0
- package/types/messageConfig.js.map +1 -0
- package/types/study.d.ts +3 -1
- package/types/studyRules.d.ts +3 -2
- package/types/studyRules.js +5 -1
- package/types/studyRules.js.map +1 -1
- package/item-editor-cb5ebc1a.js.map +0 -1
|
@@ -10,4 +10,7 @@ export declare const sliderCategoricalKey = "scc";
|
|
|
10
10
|
export declare const inputKey = "ic";
|
|
11
11
|
export declare const numericInputKey = "num";
|
|
12
12
|
export declare const datePickerKey = "date";
|
|
13
|
+
export declare const timeInputKey = "time";
|
|
13
14
|
export declare const matrixKey = "mat";
|
|
15
|
+
export declare const clozeKey = "cloze";
|
|
16
|
+
export declare const consentKey = "con";
|
|
@@ -14,8 +14,13 @@ const sliderCategoricalKey = "scc";
|
|
|
14
14
|
const inputKey = "ic";
|
|
15
15
|
const numericInputKey = "num";
|
|
16
16
|
const datePickerKey = "date";
|
|
17
|
-
const
|
|
17
|
+
const timeInputKey = "time";
|
|
18
|
+
const matrixKey = "mat";
|
|
19
|
+
const clozeKey = "cloze";
|
|
20
|
+
const consentKey = "con";
|
|
18
21
|
|
|
22
|
+
exports.clozeKey = clozeKey;
|
|
23
|
+
exports.consentKey = consentKey;
|
|
19
24
|
exports.datePickerKey = datePickerKey;
|
|
20
25
|
exports.dropDownKey = dropDownKey;
|
|
21
26
|
exports.inputKey = inputKey;
|
|
@@ -29,4 +34,5 @@ exports.responsiveBipolarLikertArrayKey = responsiveBipolarLikertArrayKey;
|
|
|
29
34
|
exports.responsiveSingleChoiceArrayKey = responsiveSingleChoiceArrayKey;
|
|
30
35
|
exports.singleChoiceKey = singleChoiceKey;
|
|
31
36
|
exports.sliderCategoricalKey = sliderCategoricalKey;
|
|
37
|
+
exports.timeInputKey = timeInputKey;
|
|
32
38
|
//# sourceMappingURL=key-definitions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-definitions.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"key-definitions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var fs = require('fs');
|
|
6
|
+
var logger_logger = require('../logger/logger.js');
|
|
7
|
+
var types_messageConfig = require('../types/messageConfig.js');
|
|
8
|
+
require('../types/duration.js');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
12
|
+
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
13
|
+
|
|
14
|
+
const generateFilesForStudy = (study, pretty) => {
|
|
15
|
+
const outputName = study.outputFolderName ? study.outputFolderName : study.studyKey;
|
|
16
|
+
const outputRoot = `./output/${outputName}`;
|
|
17
|
+
logger_logger.Logger.log(`Start generating files for study ${outputName}.`);
|
|
18
|
+
if (!fs__default["default"].existsSync(outputRoot)) {
|
|
19
|
+
fs__default["default"].mkdirSync(outputRoot, { recursive: true });
|
|
20
|
+
}
|
|
21
|
+
// Surveys:
|
|
22
|
+
generateSurveyFiles(study, outputRoot, pretty);
|
|
23
|
+
// Study rules:
|
|
24
|
+
generateStudyRuleFile(study, outputRoot, pretty);
|
|
25
|
+
// Custom Study rules: (manually triggered rules)
|
|
26
|
+
generateCustomStudyRules(study, outputRoot, pretty);
|
|
27
|
+
// Message configs:
|
|
28
|
+
generateMessageConfigs(study, outputRoot, pretty);
|
|
29
|
+
};
|
|
30
|
+
const generateSurveyFiles = (study, outputPath, pretty) => {
|
|
31
|
+
if (study.surveys.length > 0) {
|
|
32
|
+
logger_logger.Logger.log(`\tSurveys:`);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
logger_logger.Logger.log(`\tNo surveys in the study.`);
|
|
36
|
+
}
|
|
37
|
+
const surveyOutPath = `${outputPath}/surveys`;
|
|
38
|
+
if (!fs__default["default"].existsSync(surveyOutPath)) {
|
|
39
|
+
fs__default["default"].mkdirSync(surveyOutPath, { recursive: true });
|
|
40
|
+
}
|
|
41
|
+
study.surveys.forEach(survey => {
|
|
42
|
+
const fileName = `${surveyOutPath}/${survey.key}.json`;
|
|
43
|
+
const outputObject = {
|
|
44
|
+
studyKey: study.studyKey,
|
|
45
|
+
survey: survey.getSurvey()
|
|
46
|
+
};
|
|
47
|
+
try {
|
|
48
|
+
fs__default["default"].writeFileSync(fileName, JSON.stringify(outputObject, undefined, pretty ? 2 : undefined));
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
logger_logger.Logger.error(err);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
logger_logger.Logger.success(`\t\t${survey.key} saved`);
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
const generateStudyRuleFile = (study, outputPath, pretty) => {
|
|
58
|
+
if (!study.studyRules) {
|
|
59
|
+
logger_logger.Logger.log(`\tNo study rules in the study.`);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
logger_logger.Logger.log(`\tStudy rule:`);
|
|
64
|
+
}
|
|
65
|
+
const fileName = `${outputPath}/studyRules.json`;
|
|
66
|
+
const outputObject = study.studyRules.get();
|
|
67
|
+
try {
|
|
68
|
+
fs__default["default"].writeFileSync(fileName, JSON.stringify(outputObject, undefined, pretty ? 2 : undefined));
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
logger_logger.Logger.error(err);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
logger_logger.Logger.success(`\t\tStudy rules saved`);
|
|
75
|
+
};
|
|
76
|
+
const generateCustomStudyRules = (study, outputPath, pretty) => {
|
|
77
|
+
if (!study.customStudyRules || study.customStudyRules.length < 0) {
|
|
78
|
+
logger_logger.Logger.log(`\tNo custom study rules in the study.`);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
logger_logger.Logger.log(`\tCustom study rules:`);
|
|
83
|
+
}
|
|
84
|
+
const customRulePath = `${outputPath}/customRules`;
|
|
85
|
+
if (!fs__default["default"].existsSync(customRulePath)) {
|
|
86
|
+
fs__default["default"].mkdirSync(customRulePath, { recursive: true });
|
|
87
|
+
}
|
|
88
|
+
study.customStudyRules.forEach(studyRule => {
|
|
89
|
+
const fileName = `${customRulePath}/${studyRule.name}.json`;
|
|
90
|
+
const outputObject = studyRule.rules;
|
|
91
|
+
try {
|
|
92
|
+
fs__default["default"].writeFileSync(fileName, JSON.stringify(outputObject, undefined, pretty ? 2 : undefined));
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
logger_logger.Logger.error(err);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
logger_logger.Logger.success(`\t\tRule ${studyRule.name} saved`);
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
const generateMessageConfigs = (study, outputPath, pretty) => {
|
|
102
|
+
if (!study.messageConfigs || study.messageConfigs.length < 1) {
|
|
103
|
+
logger_logger.Logger.log(`\tNo message configs in the study.`);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
logger_logger.Logger.log(`\tMessage configs:`);
|
|
108
|
+
}
|
|
109
|
+
const messageConfigPath = `${outputPath}/messageConfigs`;
|
|
110
|
+
if (!fs__default["default"].existsSync(messageConfigPath)) {
|
|
111
|
+
fs__default["default"].mkdirSync(messageConfigPath, { recursive: true });
|
|
112
|
+
}
|
|
113
|
+
study.messageConfigs.forEach(conf => {
|
|
114
|
+
const fileName = `${messageConfigPath}/${conf.label.replace(/ /g, '_').toLocaleLowerCase()}.json`;
|
|
115
|
+
const outputObject = types_messageConfig.buildMessageConfig(conf, study.studyKey);
|
|
116
|
+
try {
|
|
117
|
+
fs__default["default"].writeFileSync(fileName, JSON.stringify(outputObject, undefined, pretty ? 2 : undefined));
|
|
118
|
+
}
|
|
119
|
+
catch (err) {
|
|
120
|
+
logger_logger.Logger.error(err);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
logger_logger.Logger.success(`\t\tConfig for "${conf.label}" saved`);
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
exports.generateFilesForStudy = generateFilesForStudy;
|
|
128
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Expression, ExpressionName } from "survey-engine/
|
|
1
|
+
import { Expression, ExpressionName } from "survey-engine/data_types";
|
|
2
2
|
export declare const generateExpression: (name: ExpressionName, returnType?: "string" | "float" | undefined, ...args: any[]) => Expression;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { Expression } from "survey-engine/
|
|
1
|
+
import { Expression } from "survey-engine/data_types";
|
|
2
2
|
import { Duration } from "../types/duration";
|
|
3
3
|
export declare const NativeStudyEngineExpressions: {
|
|
4
|
-
checkEventType: (equalsType: 'ENTER' | 'SUBMIT' | 'TIMER') => Expression;
|
|
4
|
+
checkEventType: (equalsType: 'ENTER' | 'SUBMIT' | 'TIMER' | 'MERGE') => Expression;
|
|
5
5
|
checkSurveyResponseKey: (surveyKey: string) => Expression;
|
|
6
6
|
responseHasKeysAny: (itemKey: string, responseSlotKey: string, ...optionKeys: string[]) => Expression;
|
|
7
7
|
responseHasOnlyKeysOtherThan: (itemKey: string, responseSlotKey: string, ...optionKeys: string[]) => Expression;
|
|
8
8
|
getResponseValueAsNum: (itemKey: string, responseKey: string) => Expression;
|
|
9
9
|
getResponseValueAsStr: (itemKey: string, responseKey: string) => Expression;
|
|
10
|
+
getSelectedKeys: (itemKey: string, responseKey: string) => Expression;
|
|
11
|
+
hasResponseKey: (itemKey: string, responseKey: string) => Expression;
|
|
12
|
+
hasResponseKeyWithValue: (itemKey: string, responseKey: string, value: string) => Expression;
|
|
10
13
|
countResponseItems: (itemKey: string, responseKey: string) => Expression;
|
|
11
14
|
checkConditionForOldResponses: (condition: Expression, checkType?: number | "all" | "any" | undefined, surveyKey?: string | undefined, querySince?: number | Expression | undefined, queryUntil?: number | Expression | undefined) => Expression;
|
|
12
15
|
participantState: {
|
|
@@ -15,8 +18,25 @@ export declare const NativeStudyEngineExpressions: {
|
|
|
15
18
|
getSurveyKeyAssignedFrom: (surveyKey: string) => Expression;
|
|
16
19
|
getSurveyKeyAssignedUntil: (surveyKey: string) => Expression;
|
|
17
20
|
hasStudyStatus: (status: string) => Expression;
|
|
18
|
-
|
|
21
|
+
hasParticipantFlagKeyAndValue: (key: string, value: string) => Expression;
|
|
22
|
+
hasParticipantFlagKey: (key: string) => Expression;
|
|
23
|
+
getParticipantFlagValue: (key: string) => Expression;
|
|
19
24
|
lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string | undefined) => Expression;
|
|
25
|
+
hasMessageTypeAssigned: (messageType: string) => Expression;
|
|
26
|
+
getMessageNextTime: (messageType: string) => Expression;
|
|
27
|
+
incomingParticipantState: {
|
|
28
|
+
getStudyEntryTime: () => Expression;
|
|
29
|
+
hasSurveyKeyAssigned: (surveyKey: string) => Expression;
|
|
30
|
+
getSurveyKeyAssignedFrom: (surveyKey: string) => Expression;
|
|
31
|
+
getSurveyKeyAssignedUntil: (surveyKey: string) => Expression;
|
|
32
|
+
hasStudyStatus: (status: string) => Expression;
|
|
33
|
+
hasParticipantFlagKeyAndValue: (key: string, value: string) => Expression;
|
|
34
|
+
hasParticipantFlagKey: (key: string) => Expression;
|
|
35
|
+
getParticipantFlagValue: (key: string) => Expression;
|
|
36
|
+
lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string | undefined) => Expression;
|
|
37
|
+
hasMessageTypeAssigned: (messageType: string) => Expression;
|
|
38
|
+
getMessageNextTime: (messageType: string) => Expression;
|
|
39
|
+
};
|
|
20
40
|
};
|
|
21
41
|
eq: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
|
|
22
42
|
lt: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
|
|
@@ -34,17 +54,31 @@ export declare const StudyEngineActions: {
|
|
|
34
54
|
ifThen: (condition: Expression, ...args: Expression[]) => Expression;
|
|
35
55
|
participantActions: {
|
|
36
56
|
updateStudyStatus: (status: string) => Expression;
|
|
37
|
-
|
|
57
|
+
startNewStudySession: () => Expression;
|
|
58
|
+
updateFlag: (key: string, newValue: string | number | Expression) => Expression;
|
|
38
59
|
removeFlag: (key: string) => Expression;
|
|
39
60
|
assignedSurveys: {
|
|
40
|
-
add: (surveyKey: string, category: 'prio' | 'normal' | 'optional', activeFrom?: number | Expression | undefined, activeUntil?: number | Expression | undefined) => Expression;
|
|
61
|
+
add: (surveyKey: string, category: 'immediate' | 'prio' | 'normal' | 'optional', activeFrom?: number | Expression | undefined, activeUntil?: number | Expression | undefined) => Expression;
|
|
41
62
|
removeAll: () => Expression;
|
|
42
63
|
remove: (surveyKey: string, selector: 'first' | 'last' | 'all') => Expression;
|
|
43
64
|
};
|
|
44
65
|
reports: {
|
|
45
|
-
|
|
66
|
+
init: (reportKey: string) => Expression;
|
|
67
|
+
cancel: (reportKey: string) => Expression;
|
|
68
|
+
updateData: (reportKey: string, attributeKey: string, value: number | string | Expression, dtype?: "string" | "date" | "float" | "int" | "rawMessage" | "keyList" | undefined) => Expression;
|
|
69
|
+
removeData: (reportKey: string, attributeKey: string) => Expression;
|
|
70
|
+
setReportIcon: (reportKey: string, icon: string) => Expression;
|
|
71
|
+
setReportMessage: (reportKey: string, content: string, asTranslationKey?: boolean | undefined) => Expression;
|
|
72
|
+
setReportSummary: (reportKey: string, content: string, asTranslationKey?: boolean | undefined) => Expression;
|
|
73
|
+
};
|
|
74
|
+
messages: {
|
|
75
|
+
add: (messageType: string, scheduledFor: number | Expression) => Expression;
|
|
76
|
+
removeAll: () => Expression;
|
|
77
|
+
remove: (messageType: string) => Expression;
|
|
78
|
+
};
|
|
79
|
+
confidentialResponses: {
|
|
80
|
+
removeByKey: (key: string) => Expression;
|
|
46
81
|
removeAll: () => Expression;
|
|
47
|
-
remove: (surveyKey: string, selector: 'first' | 'last' | 'all') => Expression;
|
|
48
82
|
};
|
|
49
83
|
stopParticipation: () => Expression;
|
|
50
84
|
finishParticipation: () => Expression;
|
|
@@ -60,37 +94,67 @@ export declare const StudyEngine: {
|
|
|
60
94
|
none: (itemKey: string, ...optionKeys: string[]) => Expression;
|
|
61
95
|
all: (itemKey: string, ...optionKeys: string[]) => Expression;
|
|
62
96
|
};
|
|
97
|
+
consent: {
|
|
98
|
+
accepted: (itemKey: string) => Expression;
|
|
99
|
+
};
|
|
63
100
|
survey: {
|
|
64
101
|
isActive: (surveyKey: string) => Expression;
|
|
65
102
|
validFromOlderThan: (surveyKey: string, delta: Duration, reference?: number | Expression | undefined) => Expression;
|
|
66
103
|
validUntilSoonerThan: (surveyKey: string, delta: Duration, reference?: number | Expression | undefined) => Expression;
|
|
67
104
|
};
|
|
105
|
+
prefillRules: {
|
|
106
|
+
GET_LAST_SURVEY_ITEM: (surveyKey: string, itemKey: string, submittedLaterThan?: Duration | undefined) => Expression;
|
|
107
|
+
};
|
|
108
|
+
contextRules: {
|
|
109
|
+
previousResponses: {
|
|
110
|
+
LAST_RESPONSES_BY_KEY: (surveyKey: string, limit: number) => Expression;
|
|
111
|
+
ALL_RESPONSES_SINCE: (sinceTimestamp: number) => Expression;
|
|
112
|
+
RESPONSES_SINCE_BY_KEY: (sinceTimestamp: number, surveyKey: string) => Expression;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
68
115
|
if: (condition: Expression, actionIfTrue: Expression, actionIfFalse?: Expression | undefined) => Expression;
|
|
69
116
|
do: (...args: Expression[]) => Expression;
|
|
70
117
|
ifThen: (condition: Expression, ...args: Expression[]) => Expression;
|
|
71
118
|
participantActions: {
|
|
72
119
|
updateStudyStatus: (status: string) => Expression;
|
|
73
|
-
|
|
120
|
+
startNewStudySession: () => Expression;
|
|
121
|
+
updateFlag: (key: string, newValue: string | number | Expression) => Expression;
|
|
74
122
|
removeFlag: (key: string) => Expression;
|
|
75
123
|
assignedSurveys: {
|
|
76
|
-
add: (surveyKey: string, category: 'prio' | 'normal' | 'optional', activeFrom?: number | Expression | undefined, activeUntil?: number | Expression | undefined) => Expression;
|
|
124
|
+
add: (surveyKey: string, category: 'immediate' | 'prio' | 'normal' | 'optional', activeFrom?: number | Expression | undefined, activeUntil?: number | Expression | undefined) => Expression;
|
|
77
125
|
removeAll: () => Expression;
|
|
78
126
|
remove: (surveyKey: string, selector: 'first' | 'last' | 'all') => Expression;
|
|
79
127
|
};
|
|
80
128
|
reports: {
|
|
81
|
-
|
|
129
|
+
init: (reportKey: string) => Expression;
|
|
130
|
+
cancel: (reportKey: string) => Expression;
|
|
131
|
+
updateData: (reportKey: string, attributeKey: string, value: number | string | Expression, dtype?: "string" | "date" | "float" | "int" | "rawMessage" | "keyList" | undefined) => Expression;
|
|
132
|
+
removeData: (reportKey: string, attributeKey: string) => Expression;
|
|
133
|
+
setReportIcon: (reportKey: string, icon: string) => Expression;
|
|
134
|
+
setReportMessage: (reportKey: string, content: string, asTranslationKey?: boolean | undefined) => Expression;
|
|
135
|
+
setReportSummary: (reportKey: string, content: string, asTranslationKey?: boolean | undefined) => Expression;
|
|
136
|
+
};
|
|
137
|
+
messages: {
|
|
138
|
+
add: (messageType: string, scheduledFor: number | Expression) => Expression;
|
|
139
|
+
removeAll: () => Expression;
|
|
140
|
+
remove: (messageType: string) => Expression;
|
|
141
|
+
};
|
|
142
|
+
confidentialResponses: {
|
|
143
|
+
removeByKey: (key: string) => Expression;
|
|
82
144
|
removeAll: () => Expression;
|
|
83
|
-
remove: (surveyKey: string, selector: 'first' | 'last' | 'all') => Expression;
|
|
84
145
|
};
|
|
85
146
|
stopParticipation: () => Expression;
|
|
86
147
|
finishParticipation: () => Expression;
|
|
87
148
|
};
|
|
88
|
-
checkEventType: (equalsType: 'ENTER' | 'SUBMIT' | 'TIMER') => Expression;
|
|
149
|
+
checkEventType: (equalsType: 'ENTER' | 'SUBMIT' | 'TIMER' | 'MERGE') => Expression;
|
|
89
150
|
checkSurveyResponseKey: (surveyKey: string) => Expression;
|
|
90
151
|
responseHasKeysAny: (itemKey: string, responseSlotKey: string, ...optionKeys: string[]) => Expression;
|
|
91
152
|
responseHasOnlyKeysOtherThan: (itemKey: string, responseSlotKey: string, ...optionKeys: string[]) => Expression;
|
|
92
153
|
getResponseValueAsNum: (itemKey: string, responseKey: string) => Expression;
|
|
93
154
|
getResponseValueAsStr: (itemKey: string, responseKey: string) => Expression;
|
|
155
|
+
getSelectedKeys: (itemKey: string, responseKey: string) => Expression;
|
|
156
|
+
hasResponseKey: (itemKey: string, responseKey: string) => Expression;
|
|
157
|
+
hasResponseKeyWithValue: (itemKey: string, responseKey: string, value: string) => Expression;
|
|
94
158
|
countResponseItems: (itemKey: string, responseKey: string) => Expression;
|
|
95
159
|
checkConditionForOldResponses: (condition: Expression, checkType?: number | "all" | "any" | undefined, surveyKey?: string | undefined, querySince?: number | Expression | undefined, queryUntil?: number | Expression | undefined) => Expression;
|
|
96
160
|
participantState: {
|
|
@@ -99,8 +163,25 @@ export declare const StudyEngine: {
|
|
|
99
163
|
getSurveyKeyAssignedFrom: (surveyKey: string) => Expression;
|
|
100
164
|
getSurveyKeyAssignedUntil: (surveyKey: string) => Expression;
|
|
101
165
|
hasStudyStatus: (status: string) => Expression;
|
|
102
|
-
|
|
166
|
+
hasParticipantFlagKeyAndValue: (key: string, value: string) => Expression;
|
|
167
|
+
hasParticipantFlagKey: (key: string) => Expression;
|
|
168
|
+
getParticipantFlagValue: (key: string) => Expression;
|
|
103
169
|
lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string | undefined) => Expression;
|
|
170
|
+
hasMessageTypeAssigned: (messageType: string) => Expression;
|
|
171
|
+
getMessageNextTime: (messageType: string) => Expression;
|
|
172
|
+
incomingParticipantState: {
|
|
173
|
+
getStudyEntryTime: () => Expression;
|
|
174
|
+
hasSurveyKeyAssigned: (surveyKey: string) => Expression;
|
|
175
|
+
getSurveyKeyAssignedFrom: (surveyKey: string) => Expression;
|
|
176
|
+
getSurveyKeyAssignedUntil: (surveyKey: string) => Expression;
|
|
177
|
+
hasStudyStatus: (status: string) => Expression;
|
|
178
|
+
hasParticipantFlagKeyAndValue: (key: string, value: string) => Expression;
|
|
179
|
+
hasParticipantFlagKey: (key: string) => Expression;
|
|
180
|
+
getParticipantFlagValue: (key: string) => Expression;
|
|
181
|
+
lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string | undefined) => Expression;
|
|
182
|
+
hasMessageTypeAssigned: (messageType: string) => Expression;
|
|
183
|
+
getMessageNextTime: (messageType: string) => Expression;
|
|
184
|
+
};
|
|
104
185
|
};
|
|
105
186
|
eq: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
|
|
106
187
|
lt: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
|