case-editor-tools 1.6.3 → 1.6.5
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.
|
@@ -48,6 +48,8 @@ export declare const NativeStudyEngineExpressions: {
|
|
|
48
48
|
and: (...args: Expression[]) => Expression;
|
|
49
49
|
not: (arg: Expression) => Expression;
|
|
50
50
|
timestampWithOffset: (delta: Duration, reference?: number | Expression) => Expression;
|
|
51
|
+
getISOWeekForTs: (ts: number | Expression) => Expression;
|
|
52
|
+
getTsForNextISOWeek: (ISOWeek: number | Expression, reference?: number | Expression) => Expression;
|
|
51
53
|
parseValueAsNum: (valueRef: Expression | string | number) => Expression;
|
|
52
54
|
generateRandomNumber: (min: number, max: number) => Expression;
|
|
53
55
|
externalEventEval: (serviceName: string, route?: string, expectFloat?: boolean) => Expression;
|
|
@@ -202,6 +204,8 @@ export declare const StudyEngine: {
|
|
|
202
204
|
and: (...args: Expression[]) => Expression;
|
|
203
205
|
not: (arg: Expression) => Expression;
|
|
204
206
|
timestampWithOffset: (delta: Duration, reference?: number | Expression) => Expression;
|
|
207
|
+
getISOWeekForTs: (ts: number | Expression) => Expression;
|
|
208
|
+
getTsForNextISOWeek: (ISOWeek: number | Expression, reference?: number | Expression) => Expression;
|
|
205
209
|
parseValueAsNum: (valueRef: Expression | string | number) => Expression;
|
|
206
210
|
generateRandomNumber: (min: number, max: number) => Expression;
|
|
207
211
|
externalEventEval: (serviceName: string, route?: string, expectFloat?: boolean) => Expression;
|
|
@@ -118,8 +118,8 @@ const getSurveyKeyAssignedUntilForIncoming = (surveyKey) => expressionUtils_expr
|
|
|
118
118
|
* @param status - string
|
|
119
119
|
* @returns true/false
|
|
120
120
|
*/
|
|
121
|
-
const hasStudyStatus = (status) => expressionUtils_expressionGen.generateExpression('
|
|
122
|
-
const hasStudyStatusForIncoming = (status) => expressionUtils_expressionGen.generateExpression('incomingState:
|
|
121
|
+
const hasStudyStatus = (status) => expressionUtils_expressionGen.generateExpression('hasStudyStatus', undefined, status);
|
|
122
|
+
const hasStudyStatusForIncoming = (status) => expressionUtils_expressionGen.generateExpression('incomingState:hasStudyStatus', undefined, status);
|
|
123
123
|
/**
|
|
124
124
|
* Check if a participant flag with specific value is present
|
|
125
125
|
* @param key look up this flag
|
|
@@ -178,6 +178,19 @@ const gte = (val1, val2) => expressionUtils_expressionGen.generateExpression('gt
|
|
|
178
178
|
* @returns
|
|
179
179
|
*/
|
|
180
180
|
const timestampWithOffset = (delta, reference) => expressionUtils_expressionGen.generateExpression('timestampWithOffset', undefined, types_duration.durationObjectToSeconds(delta), reference ? reference : undefined);
|
|
181
|
+
/**
|
|
182
|
+
* Get the ISO week value for a timestamp (POSIX).
|
|
183
|
+
* @param ts a hard coded number, or an expression that should retrieve a timestamp (e.g., surveys assigned from, or response to a date question)
|
|
184
|
+
* @returns
|
|
185
|
+
*/
|
|
186
|
+
const getISOWeekForTs = (ts) => expressionUtils_expressionGen.generateExpression('getISOWeekForTs', undefined, ts);
|
|
187
|
+
/**
|
|
188
|
+
* Generate a timestamp value (POSIX timestamp) for the beginning of the week for the first time that is later than the reference and has the ISO week as defined in argument ISOWeek.
|
|
189
|
+
* @param ISOWeek which ISO week should be used for the timestamp generation
|
|
190
|
+
* @param reference optional - a hard coded number, or an expression that should retrieve a timestamp (e.g., surveys assigned from, or response to a date question)
|
|
191
|
+
* @returns
|
|
192
|
+
*/
|
|
193
|
+
const getTsForNextISOWeek = (ISOWeek, reference) => expressionUtils_expressionGen.generateExpression('getTsForNextISOWeek', undefined, ISOWeek, reference ? reference : undefined);
|
|
181
194
|
/**
|
|
182
195
|
* Attempt to parse the resolved argument's value as a number
|
|
183
196
|
* @param valueRef resolve this argument, and try to parse this as number. Boolean value will result in error.
|
|
@@ -450,6 +463,8 @@ const NativeStudyEngineExpressions = {
|
|
|
450
463
|
not,
|
|
451
464
|
// Other
|
|
452
465
|
timestampWithOffset,
|
|
466
|
+
getISOWeekForTs,
|
|
467
|
+
getTsForNextISOWeek,
|
|
453
468
|
parseValueAsNum,
|
|
454
469
|
generateRandomNumber: (min, max) => expressionUtils_expressionGen.generateExpression('generateRandomNumber', undefined, min, max),
|
|
455
470
|
externalEventEval,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"studyEngineExpressions.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"studyEngineExpressions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "case-editor-tools",
|
|
3
3
|
"description": "Javascript tools to simplify survey and study coding for CASE.",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.5",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": "github:case-framework/case-editor-tools",
|