@d4l/collect-lib 1.34.0 → 1.35.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.
package/README.md CHANGED
@@ -342,11 +342,11 @@ Update the types by running `yarn run readme:update`.
342
342
 
343
343
  #### SurveyMultiplex
344
344
 
345
- | Properties | Required | Type | Description |
346
- | ------------- | -------- | -------- | ---------------------------------------------------------------------------------------- |
347
- | questionnaire | true | string | Name of the questionnaires the multiplexing is based on. |
348
- | linkIds | true | string[] | List of question linkds. Answers to these questions will be used to fill the placeholder |
349
- | placeholder | true | string | Placeholder text to be replaced with answers from the specified linkIds |
345
+ | Properties | Required | Type | Description |
346
+ | ----------- | -------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
347
+ | source | true | object | Defines the source of the multiplexing. The keys of the object are the questionnaire names and the values are the linkIds of the questions whose answers will be used for multiplexing. The answers to these questions will be used to fill the placeholder. |
348
+ | lookup | true | `all` or `latest` | Defines how the answers of the source questions will be looked up. `latest` means only the latest iteration of the source questionnaires will be used, `all` means all iterations of the source questionnaires will be used. |
349
+ | placeholder | true | string | Placeholder text to be replaced with answers from the specified linkIds |
350
350
 
351
351
  ### Routine
352
352
 
package/dist/index.d.mts CHANGED
@@ -80,8 +80,10 @@ type SurveyContent = {
80
80
  };
81
81
  };
82
82
  type SurveyMultiplex = {
83
- questionnaire: string;
84
- linkIds: string[];
83
+ source: {
84
+ [key: string]: string[];
85
+ };
86
+ lookup: 'all' | 'latest';
85
87
  placeholder: string;
86
88
  };
87
89
  type SurveyContentPath = RecursiveKeyOf<SurveyContent>;
@@ -452,7 +454,7 @@ type ResponseValue = {
452
454
  type ResponseContext = {
453
455
  [key: string]: string;
454
456
  };
455
- type QuestionInputType = 'decimal' | 'date' | 'year' | 'single-select' | 'multi-select' | 'scale-ordinal' | 'scale-numeric' | 'string' | 'text' | 'geo-location' | 'list' | 'country' | 'postal-code' | 'group' | 'display' | 'matrix' | 'matrix-item' | 'likert-scale';
457
+ type QuestionInputType = 'decimal' | 'date' | 'year' | 'single-select' | 'multi-select' | 'scale-ordinal' | 'scale-numeric' | 'scale-likert' | 'string' | 'text' | 'geo-location' | 'list' | 'country' | 'postal-code' | 'group' | 'display' | 'matrix' | 'matrix-item';
456
458
 
457
459
  type DEVICE_ANNOTATION_DATA_TYPE = 'header' | 'flag' | 'any' | 'timestamp' | 'heartRate' | 'eulerAngles' | 'acceleration' | 'freeAcceleration' | 'angularSpeed' | 'angularVelocity' | 'magneticField' | 'distance' | 'remoteDistance' | 'rssi' | 'beaconId' | 'caloriesTotal' | 'distanceTotal' | 'speed' | 'motionCadence' | 'floorsTotal' | 'absoluteElevation' | 'positiveElevationTotal' | 'negativeElevationTotal' | 'minSpeed' | 'maxSpeed' | 'averageSpeed' | 'minMotionCadence' | 'maxMotionCadence' | 'averageMotionCadence' | 'vo2max' | 'stepsTotal' | 'runningStepsTotal' | 'dailySteps' | 'dailyDistance' | 'dailyCalories' | 'dailyFloors' | 'dailyElevationGain' | 'activityDetection' | 'egvs' | 'ecg' | 'spo2' | 'samsungSdkHeartRate' | 'interbeatInterval' | 'ppgGreen' | 'ppgRed' | 'ppgInfrared' | 'skinTemperature' | 'sleepLevel' | 'duration' | 'respiratoryRate' | 'hrv' | 'calories' | 'steps' | 'stepCount' | 'walkingAndRunningDistance' | 'activeEnergy' | 'sleepState' | 'sleepStage' | 'dataSource' | 'normalWalkingEnergyExpenditure' | 'normalWalkingEnergyExpenditurePerHour' | 'intensityEnergyExpenditure' | 'intensityEnergyExpenditurePerHour' | 'totalEnergyExpenditurePerHour' | 'fatBurned' | 'fatBurnedPerHour' | 'metabolicEquivalent' | 'minimumMetabolicEquivalent' | 'maximumMetabolicEquivalent' | 'averageMetabolicEquivalent' | 'durationOfNormalWalkingEpisodes' | 'durationOfIntensityWalkingEpisodes';
458
460
  type DEVICE_ANNOTATION_DATA_FORMAT = 'bitmask' | 'boolean' | 'unsignedInt' | 'signedInt' | 'signedBigInt' | 'float32' | 'float64' | 'byte';
package/dist/index.d.ts CHANGED
@@ -80,8 +80,10 @@ type SurveyContent = {
80
80
  };
81
81
  };
82
82
  type SurveyMultiplex = {
83
- questionnaire: string;
84
- linkIds: string[];
83
+ source: {
84
+ [key: string]: string[];
85
+ };
86
+ lookup: 'all' | 'latest';
85
87
  placeholder: string;
86
88
  };
87
89
  type SurveyContentPath = RecursiveKeyOf<SurveyContent>;
@@ -452,7 +454,7 @@ type ResponseValue = {
452
454
  type ResponseContext = {
453
455
  [key: string]: string;
454
456
  };
455
- type QuestionInputType = 'decimal' | 'date' | 'year' | 'single-select' | 'multi-select' | 'scale-ordinal' | 'scale-numeric' | 'string' | 'text' | 'geo-location' | 'list' | 'country' | 'postal-code' | 'group' | 'display' | 'matrix' | 'matrix-item' | 'likert-scale';
457
+ type QuestionInputType = 'decimal' | 'date' | 'year' | 'single-select' | 'multi-select' | 'scale-ordinal' | 'scale-numeric' | 'scale-likert' | 'string' | 'text' | 'geo-location' | 'list' | 'country' | 'postal-code' | 'group' | 'display' | 'matrix' | 'matrix-item';
456
458
 
457
459
  type DEVICE_ANNOTATION_DATA_TYPE = 'header' | 'flag' | 'any' | 'timestamp' | 'heartRate' | 'eulerAngles' | 'acceleration' | 'freeAcceleration' | 'angularSpeed' | 'angularVelocity' | 'magneticField' | 'distance' | 'remoteDistance' | 'rssi' | 'beaconId' | 'caloriesTotal' | 'distanceTotal' | 'speed' | 'motionCadence' | 'floorsTotal' | 'absoluteElevation' | 'positiveElevationTotal' | 'negativeElevationTotal' | 'minSpeed' | 'maxSpeed' | 'averageSpeed' | 'minMotionCadence' | 'maxMotionCadence' | 'averageMotionCadence' | 'vo2max' | 'stepsTotal' | 'runningStepsTotal' | 'dailySteps' | 'dailyDistance' | 'dailyCalories' | 'dailyFloors' | 'dailyElevationGain' | 'activityDetection' | 'egvs' | 'ecg' | 'spo2' | 'samsungSdkHeartRate' | 'interbeatInterval' | 'ppgGreen' | 'ppgRed' | 'ppgInfrared' | 'skinTemperature' | 'sleepLevel' | 'duration' | 'respiratoryRate' | 'hrv' | 'calories' | 'steps' | 'stepCount' | 'walkingAndRunningDistance' | 'activeEnergy' | 'sleepState' | 'sleepStage' | 'dataSource' | 'normalWalkingEnergyExpenditure' | 'normalWalkingEnergyExpenditurePerHour' | 'intensityEnergyExpenditure' | 'intensityEnergyExpenditurePerHour' | 'totalEnergyExpenditurePerHour' | 'fatBurned' | 'fatBurnedPerHour' | 'metabolicEquivalent' | 'minimumMetabolicEquivalent' | 'maximumMetabolicEquivalent' | 'averageMetabolicEquivalent' | 'durationOfNormalWalkingEpisodes' | 'durationOfIntensityWalkingEpisodes';
458
460
  type DEVICE_ANNOTATION_DATA_FORMAT = 'bitmask' | 'boolean' | 'unsignedInt' | 'signedInt' | 'signedBigInt' | 'float32' | 'float64' | 'byte';
package/dist/index.js CHANGED
@@ -1245,7 +1245,7 @@ var toQuestionnaireResponseItem = (answer) => {
1245
1245
  }))
1246
1246
  };
1247
1247
  case "scale-ordinal":
1248
- case "likert-scale":
1248
+ case "scale-likert":
1249
1249
  return {
1250
1250
  linkId: answer.id,
1251
1251
  text: answer.text,