case-editor-tools 1.0.0-beta.7 → 1.0.0

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.
Files changed (99) hide show
  1. package/constants/key-definitions.d.ts +16 -0
  2. package/constants/key-definitions.js +38 -0
  3. package/constants/key-definitions.js.map +1 -0
  4. package/exporter/index.d.ts +2 -0
  5. package/exporter/index.js +128 -0
  6. package/exporter/index.js.map +1 -0
  7. package/expression-utils/expressionGen.d.ts +2 -0
  8. package/expression-utils/expressionGen.js +31 -0
  9. package/expression-utils/expressionGen.js.map +1 -0
  10. package/expression-utils/studyEngineExpressions.d.ts +195 -0
  11. package/expression-utils/studyEngineExpressions.js +479 -0
  12. package/expression-utils/studyEngineExpressions.js.map +1 -0
  13. package/index.d.ts +0 -0
  14. package/index.js +3 -0
  15. package/index.js.map +1 -0
  16. package/item-editor-59f51ecc.js +542 -0
  17. package/item-editor-59f51ecc.js.map +1 -0
  18. package/logger/index.d.ts +1 -0
  19. package/logger/index.js +10 -0
  20. package/logger/index.js.map +1 -0
  21. package/logger/logger.d.ts +9 -0
  22. package/logger/logger.js +31 -0
  23. package/logger/logger.js.map +1 -0
  24. package/package.json +5 -5
  25. package/surveys/index.d.ts +3 -0
  26. package/surveys/index.js +29 -0
  27. package/surveys/index.js.map +1 -0
  28. package/surveys/responseTypeGenerators/likertGroupComponents.d.ts +27 -0
  29. package/surveys/responseTypeGenerators/likertGroupComponents.js +350 -0
  30. package/surveys/responseTypeGenerators/likertGroupComponents.js.map +1 -0
  31. package/surveys/responseTypeGenerators/matrixGroupComponent.d.ts +49 -0
  32. package/surveys/responseTypeGenerators/matrixGroupComponent.js +100 -0
  33. package/surveys/responseTypeGenerators/matrixGroupComponent.js.map +1 -0
  34. package/surveys/responseTypeGenerators/optionGroupComponents.d.ts +7 -0
  35. package/surveys/responseTypeGenerators/optionGroupComponents.js +129 -0
  36. package/surveys/responseTypeGenerators/optionGroupComponents.js.map +1 -0
  37. package/surveys/survey-editor/component-editor.d.ts +84 -0
  38. package/surveys/survey-editor/component-editor.js +112 -0
  39. package/surveys/survey-editor/component-editor.js.map +1 -0
  40. package/surveys/survey-editor/data-types.d.ts +13 -0
  41. package/surveys/survey-editor/data-types.js +3 -0
  42. package/surveys/survey-editor/data-types.js.map +1 -0
  43. package/surveys/survey-editor/item-editor.d.ts +66 -0
  44. package/surveys/survey-editor/item-editor.js +13 -0
  45. package/surveys/survey-editor/item-editor.js.map +1 -0
  46. package/surveys/survey-editor/survey-editor.d.ts +48 -0
  47. package/surveys/survey-editor/survey-editor.js +237 -0
  48. package/surveys/survey-editor/survey-editor.js.map +1 -0
  49. package/surveys/survey-engine-expressions.d.ts +130 -0
  50. package/surveys/survey-engine-expressions.js +448 -0
  51. package/surveys/survey-engine-expressions.js.map +1 -0
  52. package/surveys/survey-items.d.ts +72 -0
  53. package/surveys/survey-items.js +384 -0
  54. package/surveys/survey-items.js.map +1 -0
  55. package/surveys/types/group.d.ts +23 -0
  56. package/surveys/types/group.js +72 -0
  57. package/surveys/types/group.js.map +1 -0
  58. package/surveys/types/index.d.ts +4 -0
  59. package/surveys/types/index.js +22 -0
  60. package/surveys/types/index.js.map +1 -0
  61. package/surveys/types/item-properties.d.ts +223 -0
  62. package/surveys/types/item-properties.js +10 -0
  63. package/surveys/types/item-properties.js.map +1 -0
  64. package/surveys/types/item.d.ts +22 -0
  65. package/surveys/types/item.js +34 -0
  66. package/surveys/types/item.js.map +1 -0
  67. package/surveys/types/survey-definition.d.ts +23 -0
  68. package/surveys/types/survey-definition.js +69 -0
  69. package/surveys/types/survey-definition.js.map +1 -0
  70. package/surveys/utils/componentGenerators.d.ts +24 -0
  71. package/surveys/utils/componentGenerators.js +59 -0
  72. package/surveys/utils/componentGenerators.js.map +1 -0
  73. package/surveys/utils/optionDefGenerators.d.ts +84 -0
  74. package/surveys/utils/optionDefGenerators.js +211 -0
  75. package/surveys/utils/optionDefGenerators.js.map +1 -0
  76. package/surveys/utils/randomKeyGenerator.d.ts +1 -0
  77. package/surveys/utils/randomKeyGenerator.js +16 -0
  78. package/surveys/utils/randomKeyGenerator.js.map +1 -0
  79. package/surveys/utils/simple-generators.d.ts +14 -0
  80. package/surveys/utils/simple-generators.js +131 -0
  81. package/surveys/utils/simple-generators.js.map +1 -0
  82. package/surveys/utils/simple-question-editor.d.ts +14 -0
  83. package/surveys/utils/simple-question-editor.js +47 -0
  84. package/surveys/utils/simple-question-editor.js.map +1 -0
  85. package/types/duration.d.ts +9 -0
  86. package/types/duration.js +29 -0
  87. package/types/duration.js.map +1 -0
  88. package/types/expression.d.ts +4 -0
  89. package/types/expression.js +23 -0
  90. package/types/expression.js.map +1 -0
  91. package/types/messageConfig.d.ts +49 -0
  92. package/types/messageConfig.js +23 -0
  93. package/types/messageConfig.js.map +1 -0
  94. package/types/study.d.ts +15 -0
  95. package/types/study.js +3 -0
  96. package/types/study.js.map +1 -0
  97. package/types/studyRules.d.ts +9 -0
  98. package/types/studyRules.js +36 -0
  99. package/types/studyRules.js.map +1 -0
@@ -0,0 +1,16 @@
1
+ export declare const responseGroupKey = "rg";
2
+ export declare const singleChoiceKey = "scg";
3
+ export declare const likertScaleGroupKey = "lg";
4
+ export declare const responsiveSingleChoiceArrayKey = "rsca";
5
+ export declare const responsiveBipolarLikertArrayKey = "rsbla";
6
+ export declare const likertScaleKey = "likert";
7
+ export declare const multipleChoiceKey = "mcg";
8
+ export declare const dropDownKey = "ddg";
9
+ export declare const sliderCategoricalKey = "scc";
10
+ export declare const inputKey = "ic";
11
+ export declare const numericInputKey = "num";
12
+ export declare const datePickerKey = "date";
13
+ export declare const timeInputKey = "time";
14
+ export declare const matrixKey = "mat";
15
+ export declare const clozeKey = "cloze";
16
+ export declare const consentKey = "con";
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const responseGroupKey = 'rg';
6
+ const singleChoiceKey = 'scg';
7
+ const likertScaleGroupKey = 'lg';
8
+ const responsiveSingleChoiceArrayKey = 'rsca';
9
+ const responsiveBipolarLikertArrayKey = 'rsbla';
10
+ const likertScaleKey = 'likert';
11
+ const multipleChoiceKey = 'mcg';
12
+ const dropDownKey = 'ddg';
13
+ const sliderCategoricalKey = "scc";
14
+ const inputKey = "ic";
15
+ const numericInputKey = "num";
16
+ const datePickerKey = "date";
17
+ const timeInputKey = "time";
18
+ const matrixKey = "mat";
19
+ const clozeKey = "cloze";
20
+ const consentKey = "con";
21
+
22
+ exports.clozeKey = clozeKey;
23
+ exports.consentKey = consentKey;
24
+ exports.datePickerKey = datePickerKey;
25
+ exports.dropDownKey = dropDownKey;
26
+ exports.inputKey = inputKey;
27
+ exports.likertScaleGroupKey = likertScaleGroupKey;
28
+ exports.likertScaleKey = likertScaleKey;
29
+ exports.matrixKey = matrixKey;
30
+ exports.multipleChoiceKey = multipleChoiceKey;
31
+ exports.numericInputKey = numericInputKey;
32
+ exports.responseGroupKey = responseGroupKey;
33
+ exports.responsiveBipolarLikertArrayKey = responsiveBipolarLikertArrayKey;
34
+ exports.responsiveSingleChoiceArrayKey = responsiveSingleChoiceArrayKey;
35
+ exports.singleChoiceKey = singleChoiceKey;
36
+ exports.sliderCategoricalKey = sliderCategoricalKey;
37
+ exports.timeInputKey = timeInputKey;
38
+ //# sourceMappingURL=key-definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key-definitions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ import { Study } from "../types/study";
2
+ export declare const generateFilesForStudy: (study: Study, pretty?: boolean | undefined) => void;
@@ -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(' ', '_').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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ import { Expression, ExpressionName } from "survey-engine/data_types";
2
+ export declare const generateExpression: (name: ExpressionName, returnType?: "string" | "float" | undefined, ...args: any[]) => Expression;
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const generateExpression = (name, returnType, ...args) => {
6
+ return {
7
+ name: name,
8
+ returnType: returnType,
9
+ data: args.filter(a => a !== undefined).map(arg => {
10
+ if (typeof (arg) === 'string') {
11
+ return {
12
+ dtype: 'str',
13
+ str: arg
14
+ };
15
+ }
16
+ else if (typeof (arg) === 'number') {
17
+ return {
18
+ dtype: 'num',
19
+ num: arg
20
+ };
21
+ }
22
+ return {
23
+ dtype: 'exp',
24
+ exp: arg
25
+ };
26
+ })
27
+ };
28
+ };
29
+
30
+ exports.generateExpression = generateExpression;
31
+ //# sourceMappingURL=expressionGen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expressionGen.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,195 @@
1
+ import { Expression } from "survey-engine/data_types";
2
+ import { Duration } from "../types/duration";
3
+ export declare const NativeStudyEngineExpressions: {
4
+ checkEventType: (equalsType: 'ENTER' | 'SUBMIT' | 'TIMER' | 'MERGE') => Expression;
5
+ checkSurveyResponseKey: (surveyKey: string) => Expression;
6
+ responseHasKeysAny: (itemKey: string, responseSlotKey: string, ...optionKeys: string[]) => Expression;
7
+ responseHasOnlyKeysOtherThan: (itemKey: string, responseSlotKey: string, ...optionKeys: string[]) => Expression;
8
+ getResponseValueAsNum: (itemKey: string, responseKey: string) => Expression;
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;
13
+ countResponseItems: (itemKey: string, responseKey: string) => Expression;
14
+ checkConditionForOldResponses: (condition: Expression, checkType?: number | "all" | "any" | undefined, surveyKey?: string | undefined, querySince?: number | Expression | undefined, queryUntil?: number | Expression | undefined) => Expression;
15
+ participantState: {
16
+ getStudyEntryTime: () => Expression;
17
+ hasSurveyKeyAssigned: (surveyKey: string) => Expression;
18
+ getSurveyKeyAssignedFrom: (surveyKey: string) => Expression;
19
+ getSurveyKeyAssignedUntil: (surveyKey: string) => Expression;
20
+ hasStudyStatus: (status: string) => Expression;
21
+ hasParticipantFlagKeyAndValue: (key: string, value: string) => Expression;
22
+ hasParticipantFlagKey: (key: string) => Expression;
23
+ getParticipantFlagValue: (key: string) => Expression;
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
+ };
40
+ };
41
+ eq: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
42
+ lt: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
43
+ lte: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
44
+ gt: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
45
+ gte: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
46
+ or: (...args: Expression[]) => Expression;
47
+ and: (...args: Expression[]) => Expression;
48
+ not: (arg: Expression) => Expression;
49
+ timestampWithOffset: (delta: Duration, reference?: number | Expression | undefined) => Expression;
50
+ };
51
+ export declare const StudyEngineActions: {
52
+ if: (condition: Expression, actionIfTrue: Expression, actionIfFalse?: Expression | undefined) => Expression;
53
+ do: (...args: Expression[]) => Expression;
54
+ ifThen: (condition: Expression, ...args: Expression[]) => Expression;
55
+ participantActions: {
56
+ updateStudyStatus: (status: string) => Expression;
57
+ startNewStudySession: () => Expression;
58
+ updateFlag: (key: string, newValue: string | number | Expression) => Expression;
59
+ removeFlag: (key: string) => Expression;
60
+ assignedSurveys: {
61
+ add: (surveyKey: string, category: 'immediate' | 'prio' | 'normal' | 'optional', activeFrom?: number | Expression | undefined, activeUntil?: number | Expression | undefined) => Expression;
62
+ removeAll: () => Expression;
63
+ remove: (surveyKey: string, selector: 'first' | 'last' | 'all') => Expression;
64
+ };
65
+ reports: {
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;
81
+ removeAll: () => Expression;
82
+ };
83
+ stopParticipation: () => Expression;
84
+ finishParticipation: () => Expression;
85
+ };
86
+ };
87
+ export declare const StudyEngine: {
88
+ singleChoice: {
89
+ any: (itemKey: string, ...optionKeys: string[]) => Expression;
90
+ none: (itemKey: string, ...optionKeys: string[]) => Expression;
91
+ };
92
+ multipleChoice: {
93
+ any: (itemKey: string, ...optionKeys: string[]) => Expression;
94
+ none: (itemKey: string, ...optionKeys: string[]) => Expression;
95
+ all: (itemKey: string, ...optionKeys: string[]) => Expression;
96
+ };
97
+ consent: {
98
+ accepted: (itemKey: string) => Expression;
99
+ };
100
+ survey: {
101
+ isActive: (surveyKey: string) => Expression;
102
+ validFromOlderThan: (surveyKey: string, delta: Duration, reference?: number | Expression | undefined) => Expression;
103
+ validUntilSoonerThan: (surveyKey: string, delta: Duration, reference?: number | Expression | undefined) => Expression;
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
+ };
115
+ if: (condition: Expression, actionIfTrue: Expression, actionIfFalse?: Expression | undefined) => Expression;
116
+ do: (...args: Expression[]) => Expression;
117
+ ifThen: (condition: Expression, ...args: Expression[]) => Expression;
118
+ participantActions: {
119
+ updateStudyStatus: (status: string) => Expression;
120
+ startNewStudySession: () => Expression;
121
+ updateFlag: (key: string, newValue: string | number | Expression) => Expression;
122
+ removeFlag: (key: string) => Expression;
123
+ assignedSurveys: {
124
+ add: (surveyKey: string, category: 'immediate' | 'prio' | 'normal' | 'optional', activeFrom?: number | Expression | undefined, activeUntil?: number | Expression | undefined) => Expression;
125
+ removeAll: () => Expression;
126
+ remove: (surveyKey: string, selector: 'first' | 'last' | 'all') => Expression;
127
+ };
128
+ reports: {
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;
144
+ removeAll: () => Expression;
145
+ };
146
+ stopParticipation: () => Expression;
147
+ finishParticipation: () => Expression;
148
+ };
149
+ checkEventType: (equalsType: 'ENTER' | 'SUBMIT' | 'TIMER' | 'MERGE') => Expression;
150
+ checkSurveyResponseKey: (surveyKey: string) => Expression;
151
+ responseHasKeysAny: (itemKey: string, responseSlotKey: string, ...optionKeys: string[]) => Expression;
152
+ responseHasOnlyKeysOtherThan: (itemKey: string, responseSlotKey: string, ...optionKeys: string[]) => Expression;
153
+ getResponseValueAsNum: (itemKey: string, responseKey: string) => Expression;
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;
158
+ countResponseItems: (itemKey: string, responseKey: string) => Expression;
159
+ checkConditionForOldResponses: (condition: Expression, checkType?: number | "all" | "any" | undefined, surveyKey?: string | undefined, querySince?: number | Expression | undefined, queryUntil?: number | Expression | undefined) => Expression;
160
+ participantState: {
161
+ getStudyEntryTime: () => Expression;
162
+ hasSurveyKeyAssigned: (surveyKey: string) => Expression;
163
+ getSurveyKeyAssignedFrom: (surveyKey: string) => Expression;
164
+ getSurveyKeyAssignedUntil: (surveyKey: string) => Expression;
165
+ hasStudyStatus: (status: string) => Expression;
166
+ hasParticipantFlagKeyAndValue: (key: string, value: string) => Expression;
167
+ hasParticipantFlagKey: (key: string) => Expression;
168
+ getParticipantFlagValue: (key: string) => Expression;
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
+ };
185
+ };
186
+ eq: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
187
+ lt: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
188
+ lte: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
189
+ gt: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
190
+ gte: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
191
+ or: (...args: Expression[]) => Expression;
192
+ and: (...args: Expression[]) => Expression;
193
+ not: (arg: Expression) => Expression;
194
+ timestampWithOffset: (delta: Duration, reference?: number | Expression | undefined) => Expression;
195
+ };