case-editor-tools 1.6.6 → 1.6.8

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.
@@ -13,6 +13,13 @@ export declare const NativeStudyEngineExpressions: {
13
13
  hasResponseKeyWithValue: (itemKey: string, responseKey: string, value: string) => Expression;
14
14
  countResponseItems: (itemKey: string, responseKey: string) => Expression;
15
15
  checkConditionForOldResponses: (condition: Expression, checkType?: number | 'all' | 'any', surveyKey?: string, querySince?: number | Expression, queryUntil?: number | Expression) => Expression;
16
+ eventPayload: {
17
+ hasEventPayload: () => Expression;
18
+ hasEventPayloadKey: (key: string) => Expression;
19
+ hasEventPayloadKeyWithValue: (key: string, value: string) => Expression;
20
+ getEventPayloadValueAsStr: (key: string) => Expression;
21
+ getEventPayloadValueAsNum: (key: string) => Expression;
22
+ };
16
23
  participantState: {
17
24
  getStudyEntryTime: () => Expression;
18
25
  hasSurveyKeyAssigned: (surveyKey: string) => Expression;
@@ -23,6 +30,7 @@ export declare const NativeStudyEngineExpressions: {
23
30
  hasParticipantFlagKey: (key: string) => Expression;
24
31
  getParticipantFlagValue: (key: string) => Expression;
25
32
  getParticipantFlagValueAsNum: (key: string) => Expression;
33
+ getLastSubmissionDate: (surveyKey?: string) => Expression;
26
34
  lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string) => Expression;
27
35
  hasMessageTypeAssigned: (messageType: string) => Expression;
28
36
  getMessageNextTime: (messageType: string) => Expression;
@@ -35,6 +43,7 @@ export declare const NativeStudyEngineExpressions: {
35
43
  hasParticipantFlagKeyAndValue: (key: string, value: string) => Expression;
36
44
  hasParticipantFlagKey: (key: string) => Expression;
37
45
  getParticipantFlagValue: (key: string) => Expression;
46
+ getLastSubmissionDate: (surveyKey?: string) => Expression;
38
47
  lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string) => Expression;
39
48
  hasMessageTypeAssigned: (messageType: string) => Expression;
40
49
  getMessageNextTime: (messageType: string) => Expression;
@@ -170,6 +179,13 @@ export declare const StudyEngine: {
170
179
  hasResponseKeyWithValue: (itemKey: string, responseKey: string, value: string) => Expression;
171
180
  countResponseItems: (itemKey: string, responseKey: string) => Expression;
172
181
  checkConditionForOldResponses: (condition: Expression, checkType?: number | 'all' | 'any', surveyKey?: string, querySince?: number | Expression, queryUntil?: number | Expression) => Expression;
182
+ eventPayload: {
183
+ hasEventPayload: () => Expression;
184
+ hasEventPayloadKey: (key: string) => Expression;
185
+ hasEventPayloadKeyWithValue: (key: string, value: string) => Expression;
186
+ getEventPayloadValueAsStr: (key: string) => Expression;
187
+ getEventPayloadValueAsNum: (key: string) => Expression;
188
+ };
173
189
  participantState: {
174
190
  getStudyEntryTime: () => Expression;
175
191
  hasSurveyKeyAssigned: (surveyKey: string) => Expression;
@@ -180,6 +196,7 @@ export declare const StudyEngine: {
180
196
  hasParticipantFlagKey: (key: string) => Expression;
181
197
  getParticipantFlagValue: (key: string) => Expression;
182
198
  getParticipantFlagValueAsNum: (key: string) => Expression;
199
+ getLastSubmissionDate: (surveyKey?: string) => Expression;
183
200
  lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string) => Expression;
184
201
  hasMessageTypeAssigned: (messageType: string) => Expression;
185
202
  getMessageNextTime: (messageType: string) => Expression;
@@ -192,6 +209,7 @@ export declare const StudyEngine: {
192
209
  hasParticipantFlagKeyAndValue: (key: string, value: string) => Expression;
193
210
  hasParticipantFlagKey: (key: string) => Expression;
194
211
  getParticipantFlagValue: (key: string) => Expression;
212
+ getLastSubmissionDate: (surveyKey?: string) => Expression;
195
213
  lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string) => Expression;
196
214
  hasMessageTypeAssigned: (messageType: string) => Expression;
197
215
  getMessageNextTime: (messageType: string) => Expression;
@@ -92,6 +92,11 @@ const countResponseItems = (itemKey, responseKey) => {
92
92
  * @returns true/false
93
93
  */
94
94
  const checkConditionForOldResponses = (condition, checkType, surveyKey, querySince, queryUntil) => expressionUtils_expressionGen.generateExpression('checkConditionForOldResponses', undefined, condition, checkType, surveyKey, querySince, queryUntil);
95
+ const hasEventPayload = () => expressionUtils_expressionGen.generateExpression('hasEventPayload', undefined);
96
+ const hasEventPayloadKey = (key) => expressionUtils_expressionGen.generateExpression('hasEventPayloadKey', undefined, key);
97
+ const hasEventPayloadKeyWithValue = (key, value) => expressionUtils_expressionGen.generateExpression('hasEventPayloadKeyWithValue', undefined, key, value);
98
+ const getEventPayloadValueAsStr = (key) => expressionUtils_expressionGen.generateExpression('getEventPayloadValueAsStr', 'string', key);
99
+ const getEventPayloadValueAsNum = (key) => expressionUtils_expressionGen.generateExpression('getEventPayloadValueAsNum', 'float', key);
95
100
  /**
96
101
  * Method to access the timestamp for when the participant entered the study
97
102
  * @returns timestamp
@@ -164,6 +169,13 @@ const hasMessageTypeAssignedForIncoming = (messageType) => expressionUtils_expre
164
169
  */
165
170
  const getMessageNextTime = (messageType) => expressionUtils_expressionGen.generateExpression('getMessageNextTime', undefined, messageType);
166
171
  const getMessageNextTimeForIncoming = (messageType) => expressionUtils_expressionGen.generateExpression('incomingState:getMessageNextTime', undefined, messageType);
172
+ /**
173
+ * Retrieve the timestamp of the last submission
174
+ * @param surveyKey - optional - check for this specific survey key. If empty, it would check for all the submissions.
175
+ * @returns timestamp value or zero
176
+ */
177
+ const getLastSubmissionDate = (surveyKey) => expressionUtils_expressionGen.generateExpression('getLastSubmissionDate', undefined, surveyKey);
178
+ const getLastSubmissionDateForIncoming = (surveyKey) => expressionUtils_expressionGen.generateExpression('incomingState:getLastSubmissionDate', undefined, surveyKey);
167
179
  /**
168
180
  * Check if the last submission is older than the reference timestamp
169
181
  * @param reference look up this flag
@@ -430,6 +442,14 @@ const NativeStudyEngineExpressions = {
430
442
  countResponseItems,
431
443
  // Old responses
432
444
  checkConditionForOldResponses,
445
+ // Event payload methods:
446
+ eventPayload: {
447
+ hasEventPayload,
448
+ hasEventPayloadKey,
449
+ hasEventPayloadKeyWithValue,
450
+ getEventPayloadValueAsStr,
451
+ getEventPayloadValueAsNum,
452
+ },
433
453
  // Participant state:
434
454
  participantState: {
435
455
  getStudyEntryTime,
@@ -441,6 +461,7 @@ const NativeStudyEngineExpressions = {
441
461
  hasParticipantFlagKey,
442
462
  getParticipantFlagValue,
443
463
  getParticipantFlagValueAsNum,
464
+ getLastSubmissionDate,
444
465
  lastSubmissionDateOlderThan,
445
466
  hasMessageTypeAssigned,
446
467
  getMessageNextTime,
@@ -454,6 +475,7 @@ const NativeStudyEngineExpressions = {
454
475
  hasParticipantFlagKeyAndValue: hasParticipantFlagKeyAndValueForIncoming,
455
476
  hasParticipantFlagKey: hasParticipantFlagKeyForIncoming,
456
477
  getParticipantFlagValue: getParticipantFlagValueForIncoming,
478
+ getLastSubmissionDate: getLastSubmissionDateForIncoming,
457
479
  lastSubmissionDateOlderThan: lastSubmissionDateOlderThanForIncoming,
458
480
  hasMessageTypeAssigned: hasMessageTypeAssignedForIncoming,
459
481
  getMessageNextTime: getMessageNextTimeForIncoming,
@@ -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.6",
4
+ "version": "1.6.8",
5
5
  "main": "index.js",
6
6
  "license": "Apache-2.0",
7
7
  "repository": "github:case-framework/case-editor-tools",