@d4l/collect-lib 1.10.2 → 1.11.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 +30 -15
- package/dist/index.d.mts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +96 -94
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +100 -98
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -220,13 +220,14 @@ Update the types by running `yarn run readme:update`.
|
|
|
220
220
|
|
|
221
221
|
### Survey
|
|
222
222
|
|
|
223
|
-
| Properties | Required | Type | Description
|
|
224
|
-
| ----------- | -------- | ------------------------------- |
|
|
225
|
-
| name | true | string | Primary identifier. Assumption: survey and routine names are collectively unique
|
|
226
|
-
| programName | true | string | The name of the program the survey belongs to
|
|
227
|
-
| frequency | true | [TaskFrequency](#TaskFrequency) | Defines in which frequency the questionnaire occurs
|
|
228
|
-
| scoring | true | [SurveyScoring](#SurveyScoring) | Defines the texts, images and icons that need to be displayed for the survey
|
|
229
|
-
| content | true | [SurveyContent](#SurveyContent) | Defines the texts, images and icons that need to be displayed for the survey
|
|
223
|
+
| Properties | Required | Type | Description |
|
|
224
|
+
| ----------- | -------- | ------------------------------- | -------------------------------------------------------------------------------------------------- |
|
|
225
|
+
| name | true | string | Primary identifier. Assumption: survey and routine names are collectively unique |
|
|
226
|
+
| programName | true | string | The name of the program the survey belongs to |
|
|
227
|
+
| frequency | true | [TaskFrequency](#TaskFrequency) | Defines in which frequency the questionnaire occurs |
|
|
228
|
+
| scoring | true | [SurveyScoring](#SurveyScoring) | Defines the texts, images and icons that need to be displayed for the survey |
|
|
229
|
+
| content | true | [SurveyContent](#SurveyContent) | Defines the texts, images and icons that need to be displayed for the survey |
|
|
230
|
+
| reminder | false | [TaskReminder](#TaskReminder) | Defines if and when a reminder should be sent for the task (only for one-time and recurring tasks) |
|
|
230
231
|
|
|
231
232
|
#### TaskFrequency
|
|
232
233
|
|
|
@@ -234,7 +235,7 @@ Update the types by running `yarn run readme:update`.
|
|
|
234
235
|
| ---------------- | -------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
235
236
|
| type | true | [FrequencyType](#FrequencyType) | Defines how often and when a questionnaire is triggered/added for the survey |
|
|
236
237
|
| start | true | ISO 8601 date with timezone | Determines the global starting date of the survey. The time component is also used for when the events should be available on the day they become available. |
|
|
237
|
-
| end | false | ISO 8601 date with timezone | Determines the global ending date of the survey.
|
|
238
|
+
| end | false | ISO 8601 date with timezone | Determines the global ending date of the survey. |
|
|
238
239
|
| location | false | Timezone Location | Determines the location for the defined date, so that timezone problems can be handled. |
|
|
239
240
|
| factor | false | integer | For `daily`, `weekly` and `monthly` this factor is used to manipulate the cycle length, e.g. `daily` with a factor of 7 makes it a survey that is repeated every week, but doesn't necessarily start on monday. |
|
|
240
241
|
| editDuration | false | ISO 8601 duration string | Enables editing events of this survey for the given duration. |
|
|
@@ -242,6 +243,12 @@ Update the types by running `yarn run readme:update`.
|
|
|
242
243
|
| retainCTAs | false | number | Allows configuring that x amount of previous CTAs remain active on the todo screen. |
|
|
243
244
|
| allowAddOnDemand | false | boolean | If true allows the task to also be added at any point in time (on demand). |
|
|
244
245
|
|
|
246
|
+
#### TaskReminder
|
|
247
|
+
|
|
248
|
+
| Properties | Required | Type | Description |
|
|
249
|
+
| ---------- | -------- | ----------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
|
250
|
+
| frequency | true | [ReminderFrequencyType](#ReminderFrequencyType) | Defines if and when a reminder should be sent for the task (only for one-time and recurring tasks) |
|
|
251
|
+
|
|
245
252
|
#### SurveyScoring
|
|
246
253
|
|
|
247
254
|
| Properties | Required | Type | Description |
|
|
@@ -268,6 +275,13 @@ Update the types by running `yarn run readme:update`.
|
|
|
268
275
|
| monthly | Occurs every 1st of a month |
|
|
269
276
|
| onDemand | There is a button that allows you to add one at any point |
|
|
270
277
|
|
|
278
|
+
#### ReminderFrequencyType
|
|
279
|
+
|
|
280
|
+
| Type | Description |
|
|
281
|
+
| ------------ | ----------------------------------------------------------------------------------- |
|
|
282
|
+
| daily | A reminder will be sent daily |
|
|
283
|
+
| beforeExpiry | A reminder will be sent when the task is about to expire (last day it is available) |
|
|
284
|
+
|
|
271
285
|
#### SurveyContent
|
|
272
286
|
|
|
273
287
|
| Properties | Required | Type | Description |
|
|
@@ -280,14 +294,15 @@ Update the types by running `yarn run readme:update`.
|
|
|
280
294
|
|
|
281
295
|
### Routine
|
|
282
296
|
|
|
283
|
-
| Properties | Required | Type | Description
|
|
284
|
-
| ----------- | ------------------------ | ----------------------------------- |
|
|
285
|
-
| name | true | string | Primary identifier. Assumption: survey and routine names are collectively unique
|
|
286
|
-
| programName | true | string | The name of the program the routine belongs to
|
|
287
|
-
| frequency | true | [TaskFrequency](#TaskFrequency) | Defines in which frequency the questionnaire occurs
|
|
288
|
-
| content | true | [RoutineContent](#RoutineContent) | Defines the texts, images and icons that need to be displayed for the routine
|
|
289
|
-
| devices | true | string[] | Lists the devices used in the routine
|
|
297
|
+
| Properties | Required | Type | Description |
|
|
298
|
+
| ----------- | ------------------------ | ----------------------------------- | -------------------------------------------------------------------------------------------------- |
|
|
299
|
+
| name | true | string | Primary identifier. Assumption: survey and routine names are collectively unique |
|
|
300
|
+
| programName | true | string | The name of the program the routine belongs to |
|
|
301
|
+
| frequency | true | [TaskFrequency](#TaskFrequency) | Defines in which frequency the questionnaire occurs |
|
|
302
|
+
| content | true | [RoutineContent](#RoutineContent) | Defines the texts, images and icons that need to be displayed for the routine |
|
|
303
|
+
| devices | true | string[] | Lists the devices used in the routine |
|
|
290
304
|
| duration | ISO 8601 duration String | Defines the duration of the routine |
|
|
305
|
+
| reminder | false | [TaskReminder](#TaskReminder) | Defines if and when a reminder should be sent for the task (only for one-time and recurring tasks) |
|
|
291
306
|
|
|
292
307
|
#### ProgramDevice
|
|
293
308
|
|
package/dist/index.d.mts
CHANGED
|
@@ -30,6 +30,7 @@ type Survey = {
|
|
|
30
30
|
frequency: TaskFrequency;
|
|
31
31
|
scoring?: SurveyScoring;
|
|
32
32
|
content: SurveyContent;
|
|
33
|
+
reminder?: TaskReminder;
|
|
33
34
|
};
|
|
34
35
|
type TaskFrequency = {
|
|
35
36
|
type: FrequencyType;
|
|
@@ -42,6 +43,9 @@ type TaskFrequency = {
|
|
|
42
43
|
retainCTAs?: number;
|
|
43
44
|
allowAddOnDemand?: boolean;
|
|
44
45
|
};
|
|
46
|
+
type TaskReminder = {
|
|
47
|
+
frequency: ReminderFrequencyType;
|
|
48
|
+
};
|
|
45
49
|
type SurveyScoring = {
|
|
46
50
|
scores: {
|
|
47
51
|
valueset?: {
|
|
@@ -60,6 +64,7 @@ type ScoreThreshold = {
|
|
|
60
64
|
score: number;
|
|
61
65
|
};
|
|
62
66
|
type FrequencyType = 'single' | 'daily' | 'weekly' | 'monthly' | 'onDemand';
|
|
67
|
+
type ReminderFrequencyType = 'daily' | 'beforeExpiry';
|
|
63
68
|
type SurveyContent = {
|
|
64
69
|
default: {
|
|
65
70
|
title: TranslatedString;
|
|
@@ -472,6 +477,7 @@ type Routine = {
|
|
|
472
477
|
content: RoutineContent;
|
|
473
478
|
devices: ProgramDevice[];
|
|
474
479
|
duration?: string;
|
|
480
|
+
reminder?: TaskReminder;
|
|
475
481
|
};
|
|
476
482
|
type ProgramDevice = {
|
|
477
483
|
type: ProgramDeviceType;
|
|
@@ -674,7 +680,7 @@ interface Converter {
|
|
|
674
680
|
* @param binaryString String returned by forge methods
|
|
675
681
|
* @returns The Uint8Array of the input
|
|
676
682
|
*/
|
|
677
|
-
declare const binaryStringToUint8Array: (binaryString: string) => Uint8Array
|
|
683
|
+
declare const binaryStringToUint8Array: (binaryString: string) => Uint8Array<ArrayBuffer>;
|
|
678
684
|
/**
|
|
679
685
|
* Convert a binary string (as returned by forge) to Uint8Array
|
|
680
686
|
* @param array Uint8Array
|
|
@@ -686,7 +692,7 @@ declare const uint8ArrayToBinaryString: (array: Uint8Array) => string;
|
|
|
686
692
|
* @param string The string that needs to be converted
|
|
687
693
|
* @returns The UTF-8 encoded Uint8Array of the input
|
|
688
694
|
*/
|
|
689
|
-
declare const utf8ToUint8Array: (string: string) => Uint8Array
|
|
695
|
+
declare const utf8ToUint8Array: (string: string) => Uint8Array<ArrayBuffer>;
|
|
690
696
|
/**
|
|
691
697
|
* Browser implementation of the Converter interface
|
|
692
698
|
*/
|
|
@@ -1223,4 +1229,4 @@ declare const API_TARGET_MAP: {
|
|
|
1223
1229
|
};
|
|
1224
1230
|
};
|
|
1225
1231
|
|
|
1226
|
-
export { ANDROID_SENSORS_CONSTANT_NAMES, type API, type APIConfig, type APIDeviceConfig, API_TARGET_MAP, APPLE_HEALTH_ACTIVE_ENERGY_ANNOTATION, APPLE_HEALTH_ANNOTATION_ITEM_ACTIVE_ENERGY, APPLE_HEALTH_ANNOTATION_ITEM_RESTING_ENERGY, APPLE_HEALTH_ANNOTATION_ITEM_STEP_COUNT, APPLE_HEALTH_ANNOTATION_ITEM_WALKING_RUNNING_DISTANCE, APPLE_HEALTH_RESTING_ENERGY_ANNOTATION, APPLE_HEALTH_SIGNAL_TYPE_ANNOTATIONS, APPLE_HEALTH_STEP_COUNT_ANNOTATION, APPLE_HEALTH_WALKING_RUNNING_DISTANCE_ANNOTATION, ASMSECGMeasurementAnnotation, ASMSSpO2MeasurementAnnotation, type Answer, AnswerCodeCondition, type Answers, AppIDNamingSystem, type BLEDeviceConfig, BLE_ASMS_ANNOTATION_ITEM_ECG, BLE_ASMS_ANNOTATION_ITEM_SPO2, BLE_CPMS_ANNOTATION_ITEM_ACTIVITY_TYPE, BLE_CPMS_ANNOTATION_ITEM_DAILY_CALORIES, BLE_CPMS_ANNOTATION_ITEM_DAILY_DISTANCE, BLE_CPMS_ANNOTATION_ITEM_DAILY_ELEVATION_GAIN, BLE_CPMS_ANNOTATION_ITEM_DAILY_FLOORS, BLE_CPMS_ANNOTATION_ITEM_DAILY_STEPS, BLE_PAMS_ANNOTATION_ITEM_ABSOLUTE_ELEVATION, BLE_PAMS_ANNOTATION_ITEM_AVERAGE_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_AVERAGE_SPEED, BLE_PAMS_ANNOTATION_ITEM_BYTE, BLE_PAMS_ANNOTATION_ITEM_CALORIES_TOTAL, BLE_PAMS_ANNOTATION_ITEM_DISTANCE_TOTAL, BLE_PAMS_ANNOTATION_ITEM_FLAGS_16, BLE_PAMS_ANNOTATION_ITEM_FLAGS_24, BLE_PAMS_ANNOTATION_ITEM_FLAGS_32, BLE_PAMS_ANNOTATION_ITEM_FLAGS_8, BLE_PAMS_ANNOTATION_ITEM_FLOORS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_FOUR_BYTES, BLE_PAMS_ANNOTATION_ITEM_HEADER, BLE_PAMS_ANNOTATION_ITEM_HEART_RATE, BLE_PAMS_ANNOTATION_ITEM_MAXIMUM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_MAXIMUM_SPEED, BLE_PAMS_ANNOTATION_ITEM_MINIMUM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_MINIMUM_SPEED, BLE_PAMS_ANNOTATION_ITEM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_NEGATIVE_ELEVATION_GAIN, BLE_PAMS_ANNOTATION_ITEM_POSITIVE_ELEVATION_GAIN, BLE_PAMS_ANNOTATION_ITEM_RUNNING_STEPS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_SPEED, BLE_PAMS_ANNOTATION_ITEM_STEPS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_THREE_BYTES, BLE_PAMS_ANNOTATION_ITEM_TWO_BYTES, BLE_PAMS_ANNOTATION_ITEM_VO2_MAX, BLE_PSMS_ANNOTATION_ITEM_HEART_RATE, BLE_PSMS_ANNOTATION_ITEM_IBI, BLE_PSMS_ANNOTATION_ITEM_PPG_GREEN, BLE_PSMS_ANNOTATION_ITEM_PPG_IR, BLE_PSMS_ANNOTATION_ITEM_PPG_RED, BLE_PSMS_ANNOTATION_ITEM_SKIN_TEMPERATURE, type BaseDeviceConfig, type BleDeviceMetaLabel, BoolCondition, CPMSHealthServicesActivityDetectionAnnotation, CPMSHealthServicesPassiveDataAnnotation, CommunicationTypeSystem, type ComparisonOperator, type ConditionOperatorType, type ConditionQuestionType, type ConditionSorting, type ConditionType, Conjunction, type Consent, ConsentCondition, ConsentNameSystem, type ConsentPath, type ConsentTimes, ConsentVersionSystem, type Converter, type CryptoModule, CustomExtensionDate, CustomExtensionStudyName, CustomQuestionSystem, type DEVICE_ANNOTATION, type DEVICE_ANNOTATION_DATA_FORMAT, type DEVICE_ANNOTATION_DATA_TYPE, DEVICE_ANNOTATION_HEARTRATE, type DEVICE_ANNOTATION_ITEM, DEVICE_ANNOTATION_ITEM_ACCELERATION, DEVICE_ANNOTATION_ITEM_ANGULAR_SPEED, DEVICE_ANNOTATION_ITEM_BEACON_ID, DEVICE_ANNOTATION_ITEM_DISTANCE, DEVICE_ANNOTATION_ITEM_EGVS, DEVICE_ANNOTATION_ITEM_HEARTRATE, DEVICE_ANNOTATION_ITEM_MAGNETIC_FIELD, DEVICE_ANNOTATION_ITEM_REMOTE_DISTANCE, DEVICE_ANNOTATION_ITEM_RSSI, DEVICE_ANNOTATION_ITEM_UNIX_TIMESTAMP, DEVICE_ANNOTATION_TIMESTAMP_NOTE, DEVICE_ANNOTATION_TIMESTAMP_SIZE, DEVICE_ANNOTATION_TIMESTAMP_UNIT, DEVICE_D4L_COMPANION_ANNOTATION_ITEM_DATA_TYPES_FLAG, DEVICE_D4L_COMPANION_ANNOTATION_ITEM_TIMESTAMP, DEVICE_DISPLAY_LABEL_CODING, type DEVICE_KEY, type DEVICE_KEY_API, type DEVICE_KEY_BLE, type DEVICE_KEY_INTERNAL, type DEVICE_KEY_SDK, DEVICE_KEY_TO_NAME, DEVICE_LABEL_CODING, type DEVICE_MOVELLA_PAYLOAD_MODES, DEVICE_OUTPUT_RATE_CODING, DEVICE_SENSOR_DELAY_CODING, type DEVICE_SIGNAL_TYPE, type DateBlurringFunction, DateCondition, DecimalCondition, type DeviceConfig, type DeviceName, Disjunction, type Display, type DisplayContent, type DisplayContentBlock, type DisplayContentPath, type DisplayPath, type DisplayType, type DonationRecord, DonationSDK, type DonorIdentity, ERROR_CODES, type EligibilityScore, ExistsCondition, type ExtendedProgramDevicesDataType, FITBIT_ANNOTATION_ITEM_BREATHING_RATE, FITBIT_ANNOTATION_ITEM_CALORIES, FITBIT_ANNOTATION_ITEM_HEART_RATE, FITBIT_ANNOTATION_ITEM_HEART_RATE_VARIABILITY, FITBIT_ANNOTATION_ITEM_SKIN_TEMPERATURE, FITBIT_ANNOTATION_ITEM_SLEEP_LEVEL, FITBIT_ANNOTATION_ITEM_SLEEP_LEVEL_DURATION, FITBIT_ANNOTATION_ITEM_SPO2, FITBIT_ANNOTATION_ITEM_STEPS, FITBIT_BREATHING_RATE_ANNOTATION, FITBIT_CALORIES_ANNOTATION, FITBIT_HEART_RATE_ANNOTATION, FITBIT_HEART_RATE_VARIABILITY_ANNOTATION, FITBIT_SIGNAL_TYPE_ANNOTATIONS, FITBIT_SKIN_TEMPERATURE_ANNOTATION, FITBIT_SLEEP_ANNOTATION, FITBIT_SLEEP_LEVEL_MAP, FITBIT_SPO2_ANNOTATION, FITBIT_STEPS_ANNOTATION, type FitbitSleepLevelTypes, type FrequencyType, type Guard, IMUAnnotation, type InternalDeviceConfig, InternalSensorAnnotationTypes, KeyHandler, MaxValueExtension, MeasurementTypeSystem, MinLengthExtension, MinValueExtension, type MultiAnswers, ObservationTypeSystem, Offset, PAMSCardioVascularActivityAnnotation, PAMSGeneralActivityInstantaneousAnnotation, PAMSGeneralActivitySummaryAnnotation, PAMSStepCounterActivitySummaryAnnotation, PSMSHeartRateAnnotation, PSMSPPGGreenAnnotation, PSMSPPGIRAnnotation, PSMSPPGRedAnnotation, PSMSSkinTemperatureAnnotation, type PreviewTimeSeriesItem, type Program, type ProgramAnonymization, type ProgramClientTarget, type ProgramConsentStep, type ProgramContact, type ProgramContent, type ProgramContentPath, type ProgramDevice, type ProgramDeviceType, type ProgramDevicesDataType, type ProgramDevicesLabel, type ProgramDisplayStep, type ProgramDonation, type ProgramEligibilityStep, type ProgramFeatured, type ProgramRoutineStep, type ProgramSensorStep, type ProgramStep, type ProgramStepBase, type ProgramStepType, type ProgramSurveyStep, type ProgramTag, type ProgramTokenStep, type ProgramType, QItemControlDefinition, type QuestionInputType, type QuestionnaireResponse, RECORDING_MODEL_CURRENT_VERSION, RECORDING_SIGNAL_MODEL_CURRENT_VERSION, type RecordState, type Recording, type RecordingSignal, type RecordingSignalItem, type RecordingSignalPreview, type RecordingSignalWithId, type RecordingTag, type RecursiveKeyOf, RelativeMaxValueExtension, RelativeMinValueExtension, type ReponseValue, type ResearchSubject, type ResearchSubjectProgress, type ResearchSubjectProgressState, type RestorationSize, type Routine, RoutineCondition, type RoutineContent, type RoutineContentPath, type RoutineContentStep, RoutineIsPassiveExtension, type RoutineTimes, type SDKDeviceConfig, type SDKInterface, SIGNAL_DURATION_CODING, type ScoreThreshold, type SeenDisplay, SensorIdentifierSystem, SensorSettingsSystem, SensorTypeSystem, SignalIDSystem, type SkippedStep, SliderMaxLabelExtension, SliderMinLabelExtension, SliderStepSizeExtension, type StepCondition, type StringTemplater, StudyNameSystem, type Survey, SurveyCondition, type SurveyContent, type SurveyContentPath, type SurveyScoring, type Tag, type TagEffectiveType, type TaskFrequency, type Threshold, TokenNamingSystem, type TranslatedString, ULID_REGEX, ULIDtoUUID, UUID_REGEX, UUIDtoULID, WORDLIST_LANGUAGES, WearOS3AnnotationMap, WebConverter, type WordListLanguage, YearCondition, binaryStringToUint8Array, capitalizeFirstLetter, extractWordsFromRecoveryPhrase, generateFHIRConsent, generateFHIREligibility, generateFHIRRecordingBundle, generateFHIRResearchSubject, generateFHIRResponse, generateFHIRSeenDisplay, generateFHIRTag, generateQuestionGuard, generateStepGuard, generateUrn, get, getLanguageOfPassPhrase, getMovellaAnnotation, getText, isScoreEligible, isYearString, newStepDateCondtion, stringToDate, stringToYear, toDeviceConfig, toQuestionnaireResponseItem, uint8ArrayToBinaryString, utf8ToUint8Array, wordlists };
|
|
1232
|
+
export { ANDROID_SENSORS_CONSTANT_NAMES, type API, type APIConfig, type APIDeviceConfig, API_TARGET_MAP, APPLE_HEALTH_ACTIVE_ENERGY_ANNOTATION, APPLE_HEALTH_ANNOTATION_ITEM_ACTIVE_ENERGY, APPLE_HEALTH_ANNOTATION_ITEM_RESTING_ENERGY, APPLE_HEALTH_ANNOTATION_ITEM_STEP_COUNT, APPLE_HEALTH_ANNOTATION_ITEM_WALKING_RUNNING_DISTANCE, APPLE_HEALTH_RESTING_ENERGY_ANNOTATION, APPLE_HEALTH_SIGNAL_TYPE_ANNOTATIONS, APPLE_HEALTH_STEP_COUNT_ANNOTATION, APPLE_HEALTH_WALKING_RUNNING_DISTANCE_ANNOTATION, ASMSECGMeasurementAnnotation, ASMSSpO2MeasurementAnnotation, type Answer, AnswerCodeCondition, type Answers, AppIDNamingSystem, type BLEDeviceConfig, BLE_ASMS_ANNOTATION_ITEM_ECG, BLE_ASMS_ANNOTATION_ITEM_SPO2, BLE_CPMS_ANNOTATION_ITEM_ACTIVITY_TYPE, BLE_CPMS_ANNOTATION_ITEM_DAILY_CALORIES, BLE_CPMS_ANNOTATION_ITEM_DAILY_DISTANCE, BLE_CPMS_ANNOTATION_ITEM_DAILY_ELEVATION_GAIN, BLE_CPMS_ANNOTATION_ITEM_DAILY_FLOORS, BLE_CPMS_ANNOTATION_ITEM_DAILY_STEPS, BLE_PAMS_ANNOTATION_ITEM_ABSOLUTE_ELEVATION, BLE_PAMS_ANNOTATION_ITEM_AVERAGE_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_AVERAGE_SPEED, BLE_PAMS_ANNOTATION_ITEM_BYTE, BLE_PAMS_ANNOTATION_ITEM_CALORIES_TOTAL, BLE_PAMS_ANNOTATION_ITEM_DISTANCE_TOTAL, BLE_PAMS_ANNOTATION_ITEM_FLAGS_16, BLE_PAMS_ANNOTATION_ITEM_FLAGS_24, BLE_PAMS_ANNOTATION_ITEM_FLAGS_32, BLE_PAMS_ANNOTATION_ITEM_FLAGS_8, BLE_PAMS_ANNOTATION_ITEM_FLOORS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_FOUR_BYTES, BLE_PAMS_ANNOTATION_ITEM_HEADER, BLE_PAMS_ANNOTATION_ITEM_HEART_RATE, BLE_PAMS_ANNOTATION_ITEM_MAXIMUM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_MAXIMUM_SPEED, BLE_PAMS_ANNOTATION_ITEM_MINIMUM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_MINIMUM_SPEED, BLE_PAMS_ANNOTATION_ITEM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_NEGATIVE_ELEVATION_GAIN, BLE_PAMS_ANNOTATION_ITEM_POSITIVE_ELEVATION_GAIN, BLE_PAMS_ANNOTATION_ITEM_RUNNING_STEPS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_SPEED, BLE_PAMS_ANNOTATION_ITEM_STEPS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_THREE_BYTES, BLE_PAMS_ANNOTATION_ITEM_TWO_BYTES, BLE_PAMS_ANNOTATION_ITEM_VO2_MAX, BLE_PSMS_ANNOTATION_ITEM_HEART_RATE, BLE_PSMS_ANNOTATION_ITEM_IBI, BLE_PSMS_ANNOTATION_ITEM_PPG_GREEN, BLE_PSMS_ANNOTATION_ITEM_PPG_IR, BLE_PSMS_ANNOTATION_ITEM_PPG_RED, BLE_PSMS_ANNOTATION_ITEM_SKIN_TEMPERATURE, type BaseDeviceConfig, type BleDeviceMetaLabel, BoolCondition, CPMSHealthServicesActivityDetectionAnnotation, CPMSHealthServicesPassiveDataAnnotation, CommunicationTypeSystem, type ComparisonOperator, type ConditionOperatorType, type ConditionQuestionType, type ConditionSorting, type ConditionType, Conjunction, type Consent, ConsentCondition, ConsentNameSystem, type ConsentPath, type ConsentTimes, ConsentVersionSystem, type Converter, type CryptoModule, CustomExtensionDate, CustomExtensionStudyName, CustomQuestionSystem, type DEVICE_ANNOTATION, type DEVICE_ANNOTATION_DATA_FORMAT, type DEVICE_ANNOTATION_DATA_TYPE, DEVICE_ANNOTATION_HEARTRATE, type DEVICE_ANNOTATION_ITEM, DEVICE_ANNOTATION_ITEM_ACCELERATION, DEVICE_ANNOTATION_ITEM_ANGULAR_SPEED, DEVICE_ANNOTATION_ITEM_BEACON_ID, DEVICE_ANNOTATION_ITEM_DISTANCE, DEVICE_ANNOTATION_ITEM_EGVS, DEVICE_ANNOTATION_ITEM_HEARTRATE, DEVICE_ANNOTATION_ITEM_MAGNETIC_FIELD, DEVICE_ANNOTATION_ITEM_REMOTE_DISTANCE, DEVICE_ANNOTATION_ITEM_RSSI, DEVICE_ANNOTATION_ITEM_UNIX_TIMESTAMP, DEVICE_ANNOTATION_TIMESTAMP_NOTE, DEVICE_ANNOTATION_TIMESTAMP_SIZE, DEVICE_ANNOTATION_TIMESTAMP_UNIT, DEVICE_D4L_COMPANION_ANNOTATION_ITEM_DATA_TYPES_FLAG, DEVICE_D4L_COMPANION_ANNOTATION_ITEM_TIMESTAMP, DEVICE_DISPLAY_LABEL_CODING, type DEVICE_KEY, type DEVICE_KEY_API, type DEVICE_KEY_BLE, type DEVICE_KEY_INTERNAL, type DEVICE_KEY_SDK, DEVICE_KEY_TO_NAME, DEVICE_LABEL_CODING, type DEVICE_MOVELLA_PAYLOAD_MODES, DEVICE_OUTPUT_RATE_CODING, DEVICE_SENSOR_DELAY_CODING, type DEVICE_SIGNAL_TYPE, type DateBlurringFunction, DateCondition, DecimalCondition, type DeviceConfig, type DeviceName, Disjunction, type Display, type DisplayContent, type DisplayContentBlock, type DisplayContentPath, type DisplayPath, type DisplayType, type DonationRecord, DonationSDK, type DonorIdentity, ERROR_CODES, type EligibilityScore, ExistsCondition, type ExtendedProgramDevicesDataType, FITBIT_ANNOTATION_ITEM_BREATHING_RATE, FITBIT_ANNOTATION_ITEM_CALORIES, FITBIT_ANNOTATION_ITEM_HEART_RATE, FITBIT_ANNOTATION_ITEM_HEART_RATE_VARIABILITY, FITBIT_ANNOTATION_ITEM_SKIN_TEMPERATURE, FITBIT_ANNOTATION_ITEM_SLEEP_LEVEL, FITBIT_ANNOTATION_ITEM_SLEEP_LEVEL_DURATION, FITBIT_ANNOTATION_ITEM_SPO2, FITBIT_ANNOTATION_ITEM_STEPS, FITBIT_BREATHING_RATE_ANNOTATION, FITBIT_CALORIES_ANNOTATION, FITBIT_HEART_RATE_ANNOTATION, FITBIT_HEART_RATE_VARIABILITY_ANNOTATION, FITBIT_SIGNAL_TYPE_ANNOTATIONS, FITBIT_SKIN_TEMPERATURE_ANNOTATION, FITBIT_SLEEP_ANNOTATION, FITBIT_SLEEP_LEVEL_MAP, FITBIT_SPO2_ANNOTATION, FITBIT_STEPS_ANNOTATION, type FitbitSleepLevelTypes, type FrequencyType, type Guard, IMUAnnotation, type InternalDeviceConfig, InternalSensorAnnotationTypes, KeyHandler, MaxValueExtension, MeasurementTypeSystem, MinLengthExtension, MinValueExtension, type MultiAnswers, ObservationTypeSystem, Offset, PAMSCardioVascularActivityAnnotation, PAMSGeneralActivityInstantaneousAnnotation, PAMSGeneralActivitySummaryAnnotation, PAMSStepCounterActivitySummaryAnnotation, PSMSHeartRateAnnotation, PSMSPPGGreenAnnotation, PSMSPPGIRAnnotation, PSMSPPGRedAnnotation, PSMSSkinTemperatureAnnotation, type PreviewTimeSeriesItem, type Program, type ProgramAnonymization, type ProgramClientTarget, type ProgramConsentStep, type ProgramContact, type ProgramContent, type ProgramContentPath, type ProgramDevice, type ProgramDeviceType, type ProgramDevicesDataType, type ProgramDevicesLabel, type ProgramDisplayStep, type ProgramDonation, type ProgramEligibilityStep, type ProgramFeatured, type ProgramRoutineStep, type ProgramSensorStep, type ProgramStep, type ProgramStepBase, type ProgramStepType, type ProgramSurveyStep, type ProgramTag, type ProgramTokenStep, type ProgramType, QItemControlDefinition, type QuestionInputType, type QuestionnaireResponse, RECORDING_MODEL_CURRENT_VERSION, RECORDING_SIGNAL_MODEL_CURRENT_VERSION, type RecordState, type Recording, type RecordingSignal, type RecordingSignalItem, type RecordingSignalPreview, type RecordingSignalWithId, type RecordingTag, type RecursiveKeyOf, RelativeMaxValueExtension, RelativeMinValueExtension, type ReminderFrequencyType, type ReponseValue, type ResearchSubject, type ResearchSubjectProgress, type ResearchSubjectProgressState, type RestorationSize, type Routine, RoutineCondition, type RoutineContent, type RoutineContentPath, type RoutineContentStep, RoutineIsPassiveExtension, type RoutineTimes, type SDKDeviceConfig, type SDKInterface, SIGNAL_DURATION_CODING, type ScoreThreshold, type SeenDisplay, SensorIdentifierSystem, SensorSettingsSystem, SensorTypeSystem, SignalIDSystem, type SkippedStep, SliderMaxLabelExtension, SliderMinLabelExtension, SliderStepSizeExtension, type StepCondition, type StringTemplater, StudyNameSystem, type Survey, SurveyCondition, type SurveyContent, type SurveyContentPath, type SurveyScoring, type Tag, type TagEffectiveType, type TaskFrequency, type TaskReminder, type Threshold, TokenNamingSystem, type TranslatedString, ULID_REGEX, ULIDtoUUID, UUID_REGEX, UUIDtoULID, WORDLIST_LANGUAGES, WearOS3AnnotationMap, WebConverter, type WordListLanguage, YearCondition, binaryStringToUint8Array, capitalizeFirstLetter, extractWordsFromRecoveryPhrase, generateFHIRConsent, generateFHIREligibility, generateFHIRRecordingBundle, generateFHIRResearchSubject, generateFHIRResponse, generateFHIRSeenDisplay, generateFHIRTag, generateQuestionGuard, generateStepGuard, generateUrn, get, getLanguageOfPassPhrase, getMovellaAnnotation, getText, isScoreEligible, isYearString, newStepDateCondtion, stringToDate, stringToYear, toDeviceConfig, toQuestionnaireResponseItem, uint8ArrayToBinaryString, utf8ToUint8Array, wordlists };
|
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ type Survey = {
|
|
|
30
30
|
frequency: TaskFrequency;
|
|
31
31
|
scoring?: SurveyScoring;
|
|
32
32
|
content: SurveyContent;
|
|
33
|
+
reminder?: TaskReminder;
|
|
33
34
|
};
|
|
34
35
|
type TaskFrequency = {
|
|
35
36
|
type: FrequencyType;
|
|
@@ -42,6 +43,9 @@ type TaskFrequency = {
|
|
|
42
43
|
retainCTAs?: number;
|
|
43
44
|
allowAddOnDemand?: boolean;
|
|
44
45
|
};
|
|
46
|
+
type TaskReminder = {
|
|
47
|
+
frequency: ReminderFrequencyType;
|
|
48
|
+
};
|
|
45
49
|
type SurveyScoring = {
|
|
46
50
|
scores: {
|
|
47
51
|
valueset?: {
|
|
@@ -60,6 +64,7 @@ type ScoreThreshold = {
|
|
|
60
64
|
score: number;
|
|
61
65
|
};
|
|
62
66
|
type FrequencyType = 'single' | 'daily' | 'weekly' | 'monthly' | 'onDemand';
|
|
67
|
+
type ReminderFrequencyType = 'daily' | 'beforeExpiry';
|
|
63
68
|
type SurveyContent = {
|
|
64
69
|
default: {
|
|
65
70
|
title: TranslatedString;
|
|
@@ -472,6 +477,7 @@ type Routine = {
|
|
|
472
477
|
content: RoutineContent;
|
|
473
478
|
devices: ProgramDevice[];
|
|
474
479
|
duration?: string;
|
|
480
|
+
reminder?: TaskReminder;
|
|
475
481
|
};
|
|
476
482
|
type ProgramDevice = {
|
|
477
483
|
type: ProgramDeviceType;
|
|
@@ -674,7 +680,7 @@ interface Converter {
|
|
|
674
680
|
* @param binaryString String returned by forge methods
|
|
675
681
|
* @returns The Uint8Array of the input
|
|
676
682
|
*/
|
|
677
|
-
declare const binaryStringToUint8Array: (binaryString: string) => Uint8Array
|
|
683
|
+
declare const binaryStringToUint8Array: (binaryString: string) => Uint8Array<ArrayBuffer>;
|
|
678
684
|
/**
|
|
679
685
|
* Convert a binary string (as returned by forge) to Uint8Array
|
|
680
686
|
* @param array Uint8Array
|
|
@@ -686,7 +692,7 @@ declare const uint8ArrayToBinaryString: (array: Uint8Array) => string;
|
|
|
686
692
|
* @param string The string that needs to be converted
|
|
687
693
|
* @returns The UTF-8 encoded Uint8Array of the input
|
|
688
694
|
*/
|
|
689
|
-
declare const utf8ToUint8Array: (string: string) => Uint8Array
|
|
695
|
+
declare const utf8ToUint8Array: (string: string) => Uint8Array<ArrayBuffer>;
|
|
690
696
|
/**
|
|
691
697
|
* Browser implementation of the Converter interface
|
|
692
698
|
*/
|
|
@@ -1223,4 +1229,4 @@ declare const API_TARGET_MAP: {
|
|
|
1223
1229
|
};
|
|
1224
1230
|
};
|
|
1225
1231
|
|
|
1226
|
-
export { ANDROID_SENSORS_CONSTANT_NAMES, type API, type APIConfig, type APIDeviceConfig, API_TARGET_MAP, APPLE_HEALTH_ACTIVE_ENERGY_ANNOTATION, APPLE_HEALTH_ANNOTATION_ITEM_ACTIVE_ENERGY, APPLE_HEALTH_ANNOTATION_ITEM_RESTING_ENERGY, APPLE_HEALTH_ANNOTATION_ITEM_STEP_COUNT, APPLE_HEALTH_ANNOTATION_ITEM_WALKING_RUNNING_DISTANCE, APPLE_HEALTH_RESTING_ENERGY_ANNOTATION, APPLE_HEALTH_SIGNAL_TYPE_ANNOTATIONS, APPLE_HEALTH_STEP_COUNT_ANNOTATION, APPLE_HEALTH_WALKING_RUNNING_DISTANCE_ANNOTATION, ASMSECGMeasurementAnnotation, ASMSSpO2MeasurementAnnotation, type Answer, AnswerCodeCondition, type Answers, AppIDNamingSystem, type BLEDeviceConfig, BLE_ASMS_ANNOTATION_ITEM_ECG, BLE_ASMS_ANNOTATION_ITEM_SPO2, BLE_CPMS_ANNOTATION_ITEM_ACTIVITY_TYPE, BLE_CPMS_ANNOTATION_ITEM_DAILY_CALORIES, BLE_CPMS_ANNOTATION_ITEM_DAILY_DISTANCE, BLE_CPMS_ANNOTATION_ITEM_DAILY_ELEVATION_GAIN, BLE_CPMS_ANNOTATION_ITEM_DAILY_FLOORS, BLE_CPMS_ANNOTATION_ITEM_DAILY_STEPS, BLE_PAMS_ANNOTATION_ITEM_ABSOLUTE_ELEVATION, BLE_PAMS_ANNOTATION_ITEM_AVERAGE_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_AVERAGE_SPEED, BLE_PAMS_ANNOTATION_ITEM_BYTE, BLE_PAMS_ANNOTATION_ITEM_CALORIES_TOTAL, BLE_PAMS_ANNOTATION_ITEM_DISTANCE_TOTAL, BLE_PAMS_ANNOTATION_ITEM_FLAGS_16, BLE_PAMS_ANNOTATION_ITEM_FLAGS_24, BLE_PAMS_ANNOTATION_ITEM_FLAGS_32, BLE_PAMS_ANNOTATION_ITEM_FLAGS_8, BLE_PAMS_ANNOTATION_ITEM_FLOORS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_FOUR_BYTES, BLE_PAMS_ANNOTATION_ITEM_HEADER, BLE_PAMS_ANNOTATION_ITEM_HEART_RATE, BLE_PAMS_ANNOTATION_ITEM_MAXIMUM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_MAXIMUM_SPEED, BLE_PAMS_ANNOTATION_ITEM_MINIMUM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_MINIMUM_SPEED, BLE_PAMS_ANNOTATION_ITEM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_NEGATIVE_ELEVATION_GAIN, BLE_PAMS_ANNOTATION_ITEM_POSITIVE_ELEVATION_GAIN, BLE_PAMS_ANNOTATION_ITEM_RUNNING_STEPS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_SPEED, BLE_PAMS_ANNOTATION_ITEM_STEPS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_THREE_BYTES, BLE_PAMS_ANNOTATION_ITEM_TWO_BYTES, BLE_PAMS_ANNOTATION_ITEM_VO2_MAX, BLE_PSMS_ANNOTATION_ITEM_HEART_RATE, BLE_PSMS_ANNOTATION_ITEM_IBI, BLE_PSMS_ANNOTATION_ITEM_PPG_GREEN, BLE_PSMS_ANNOTATION_ITEM_PPG_IR, BLE_PSMS_ANNOTATION_ITEM_PPG_RED, BLE_PSMS_ANNOTATION_ITEM_SKIN_TEMPERATURE, type BaseDeviceConfig, type BleDeviceMetaLabel, BoolCondition, CPMSHealthServicesActivityDetectionAnnotation, CPMSHealthServicesPassiveDataAnnotation, CommunicationTypeSystem, type ComparisonOperator, type ConditionOperatorType, type ConditionQuestionType, type ConditionSorting, type ConditionType, Conjunction, type Consent, ConsentCondition, ConsentNameSystem, type ConsentPath, type ConsentTimes, ConsentVersionSystem, type Converter, type CryptoModule, CustomExtensionDate, CustomExtensionStudyName, CustomQuestionSystem, type DEVICE_ANNOTATION, type DEVICE_ANNOTATION_DATA_FORMAT, type DEVICE_ANNOTATION_DATA_TYPE, DEVICE_ANNOTATION_HEARTRATE, type DEVICE_ANNOTATION_ITEM, DEVICE_ANNOTATION_ITEM_ACCELERATION, DEVICE_ANNOTATION_ITEM_ANGULAR_SPEED, DEVICE_ANNOTATION_ITEM_BEACON_ID, DEVICE_ANNOTATION_ITEM_DISTANCE, DEVICE_ANNOTATION_ITEM_EGVS, DEVICE_ANNOTATION_ITEM_HEARTRATE, DEVICE_ANNOTATION_ITEM_MAGNETIC_FIELD, DEVICE_ANNOTATION_ITEM_REMOTE_DISTANCE, DEVICE_ANNOTATION_ITEM_RSSI, DEVICE_ANNOTATION_ITEM_UNIX_TIMESTAMP, DEVICE_ANNOTATION_TIMESTAMP_NOTE, DEVICE_ANNOTATION_TIMESTAMP_SIZE, DEVICE_ANNOTATION_TIMESTAMP_UNIT, DEVICE_D4L_COMPANION_ANNOTATION_ITEM_DATA_TYPES_FLAG, DEVICE_D4L_COMPANION_ANNOTATION_ITEM_TIMESTAMP, DEVICE_DISPLAY_LABEL_CODING, type DEVICE_KEY, type DEVICE_KEY_API, type DEVICE_KEY_BLE, type DEVICE_KEY_INTERNAL, type DEVICE_KEY_SDK, DEVICE_KEY_TO_NAME, DEVICE_LABEL_CODING, type DEVICE_MOVELLA_PAYLOAD_MODES, DEVICE_OUTPUT_RATE_CODING, DEVICE_SENSOR_DELAY_CODING, type DEVICE_SIGNAL_TYPE, type DateBlurringFunction, DateCondition, DecimalCondition, type DeviceConfig, type DeviceName, Disjunction, type Display, type DisplayContent, type DisplayContentBlock, type DisplayContentPath, type DisplayPath, type DisplayType, type DonationRecord, DonationSDK, type DonorIdentity, ERROR_CODES, type EligibilityScore, ExistsCondition, type ExtendedProgramDevicesDataType, FITBIT_ANNOTATION_ITEM_BREATHING_RATE, FITBIT_ANNOTATION_ITEM_CALORIES, FITBIT_ANNOTATION_ITEM_HEART_RATE, FITBIT_ANNOTATION_ITEM_HEART_RATE_VARIABILITY, FITBIT_ANNOTATION_ITEM_SKIN_TEMPERATURE, FITBIT_ANNOTATION_ITEM_SLEEP_LEVEL, FITBIT_ANNOTATION_ITEM_SLEEP_LEVEL_DURATION, FITBIT_ANNOTATION_ITEM_SPO2, FITBIT_ANNOTATION_ITEM_STEPS, FITBIT_BREATHING_RATE_ANNOTATION, FITBIT_CALORIES_ANNOTATION, FITBIT_HEART_RATE_ANNOTATION, FITBIT_HEART_RATE_VARIABILITY_ANNOTATION, FITBIT_SIGNAL_TYPE_ANNOTATIONS, FITBIT_SKIN_TEMPERATURE_ANNOTATION, FITBIT_SLEEP_ANNOTATION, FITBIT_SLEEP_LEVEL_MAP, FITBIT_SPO2_ANNOTATION, FITBIT_STEPS_ANNOTATION, type FitbitSleepLevelTypes, type FrequencyType, type Guard, IMUAnnotation, type InternalDeviceConfig, InternalSensorAnnotationTypes, KeyHandler, MaxValueExtension, MeasurementTypeSystem, MinLengthExtension, MinValueExtension, type MultiAnswers, ObservationTypeSystem, Offset, PAMSCardioVascularActivityAnnotation, PAMSGeneralActivityInstantaneousAnnotation, PAMSGeneralActivitySummaryAnnotation, PAMSStepCounterActivitySummaryAnnotation, PSMSHeartRateAnnotation, PSMSPPGGreenAnnotation, PSMSPPGIRAnnotation, PSMSPPGRedAnnotation, PSMSSkinTemperatureAnnotation, type PreviewTimeSeriesItem, type Program, type ProgramAnonymization, type ProgramClientTarget, type ProgramConsentStep, type ProgramContact, type ProgramContent, type ProgramContentPath, type ProgramDevice, type ProgramDeviceType, type ProgramDevicesDataType, type ProgramDevicesLabel, type ProgramDisplayStep, type ProgramDonation, type ProgramEligibilityStep, type ProgramFeatured, type ProgramRoutineStep, type ProgramSensorStep, type ProgramStep, type ProgramStepBase, type ProgramStepType, type ProgramSurveyStep, type ProgramTag, type ProgramTokenStep, type ProgramType, QItemControlDefinition, type QuestionInputType, type QuestionnaireResponse, RECORDING_MODEL_CURRENT_VERSION, RECORDING_SIGNAL_MODEL_CURRENT_VERSION, type RecordState, type Recording, type RecordingSignal, type RecordingSignalItem, type RecordingSignalPreview, type RecordingSignalWithId, type RecordingTag, type RecursiveKeyOf, RelativeMaxValueExtension, RelativeMinValueExtension, type ReponseValue, type ResearchSubject, type ResearchSubjectProgress, type ResearchSubjectProgressState, type RestorationSize, type Routine, RoutineCondition, type RoutineContent, type RoutineContentPath, type RoutineContentStep, RoutineIsPassiveExtension, type RoutineTimes, type SDKDeviceConfig, type SDKInterface, SIGNAL_DURATION_CODING, type ScoreThreshold, type SeenDisplay, SensorIdentifierSystem, SensorSettingsSystem, SensorTypeSystem, SignalIDSystem, type SkippedStep, SliderMaxLabelExtension, SliderMinLabelExtension, SliderStepSizeExtension, type StepCondition, type StringTemplater, StudyNameSystem, type Survey, SurveyCondition, type SurveyContent, type SurveyContentPath, type SurveyScoring, type Tag, type TagEffectiveType, type TaskFrequency, type Threshold, TokenNamingSystem, type TranslatedString, ULID_REGEX, ULIDtoUUID, UUID_REGEX, UUIDtoULID, WORDLIST_LANGUAGES, WearOS3AnnotationMap, WebConverter, type WordListLanguage, YearCondition, binaryStringToUint8Array, capitalizeFirstLetter, extractWordsFromRecoveryPhrase, generateFHIRConsent, generateFHIREligibility, generateFHIRRecordingBundle, generateFHIRResearchSubject, generateFHIRResponse, generateFHIRSeenDisplay, generateFHIRTag, generateQuestionGuard, generateStepGuard, generateUrn, get, getLanguageOfPassPhrase, getMovellaAnnotation, getText, isScoreEligible, isYearString, newStepDateCondtion, stringToDate, stringToYear, toDeviceConfig, toQuestionnaireResponseItem, uint8ArrayToBinaryString, utf8ToUint8Array, wordlists };
|
|
1232
|
+
export { ANDROID_SENSORS_CONSTANT_NAMES, type API, type APIConfig, type APIDeviceConfig, API_TARGET_MAP, APPLE_HEALTH_ACTIVE_ENERGY_ANNOTATION, APPLE_HEALTH_ANNOTATION_ITEM_ACTIVE_ENERGY, APPLE_HEALTH_ANNOTATION_ITEM_RESTING_ENERGY, APPLE_HEALTH_ANNOTATION_ITEM_STEP_COUNT, APPLE_HEALTH_ANNOTATION_ITEM_WALKING_RUNNING_DISTANCE, APPLE_HEALTH_RESTING_ENERGY_ANNOTATION, APPLE_HEALTH_SIGNAL_TYPE_ANNOTATIONS, APPLE_HEALTH_STEP_COUNT_ANNOTATION, APPLE_HEALTH_WALKING_RUNNING_DISTANCE_ANNOTATION, ASMSECGMeasurementAnnotation, ASMSSpO2MeasurementAnnotation, type Answer, AnswerCodeCondition, type Answers, AppIDNamingSystem, type BLEDeviceConfig, BLE_ASMS_ANNOTATION_ITEM_ECG, BLE_ASMS_ANNOTATION_ITEM_SPO2, BLE_CPMS_ANNOTATION_ITEM_ACTIVITY_TYPE, BLE_CPMS_ANNOTATION_ITEM_DAILY_CALORIES, BLE_CPMS_ANNOTATION_ITEM_DAILY_DISTANCE, BLE_CPMS_ANNOTATION_ITEM_DAILY_ELEVATION_GAIN, BLE_CPMS_ANNOTATION_ITEM_DAILY_FLOORS, BLE_CPMS_ANNOTATION_ITEM_DAILY_STEPS, BLE_PAMS_ANNOTATION_ITEM_ABSOLUTE_ELEVATION, BLE_PAMS_ANNOTATION_ITEM_AVERAGE_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_AVERAGE_SPEED, BLE_PAMS_ANNOTATION_ITEM_BYTE, BLE_PAMS_ANNOTATION_ITEM_CALORIES_TOTAL, BLE_PAMS_ANNOTATION_ITEM_DISTANCE_TOTAL, BLE_PAMS_ANNOTATION_ITEM_FLAGS_16, BLE_PAMS_ANNOTATION_ITEM_FLAGS_24, BLE_PAMS_ANNOTATION_ITEM_FLAGS_32, BLE_PAMS_ANNOTATION_ITEM_FLAGS_8, BLE_PAMS_ANNOTATION_ITEM_FLOORS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_FOUR_BYTES, BLE_PAMS_ANNOTATION_ITEM_HEADER, BLE_PAMS_ANNOTATION_ITEM_HEART_RATE, BLE_PAMS_ANNOTATION_ITEM_MAXIMUM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_MAXIMUM_SPEED, BLE_PAMS_ANNOTATION_ITEM_MINIMUM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_MINIMUM_SPEED, BLE_PAMS_ANNOTATION_ITEM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_NEGATIVE_ELEVATION_GAIN, BLE_PAMS_ANNOTATION_ITEM_POSITIVE_ELEVATION_GAIN, BLE_PAMS_ANNOTATION_ITEM_RUNNING_STEPS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_SPEED, BLE_PAMS_ANNOTATION_ITEM_STEPS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_THREE_BYTES, BLE_PAMS_ANNOTATION_ITEM_TWO_BYTES, BLE_PAMS_ANNOTATION_ITEM_VO2_MAX, BLE_PSMS_ANNOTATION_ITEM_HEART_RATE, BLE_PSMS_ANNOTATION_ITEM_IBI, BLE_PSMS_ANNOTATION_ITEM_PPG_GREEN, BLE_PSMS_ANNOTATION_ITEM_PPG_IR, BLE_PSMS_ANNOTATION_ITEM_PPG_RED, BLE_PSMS_ANNOTATION_ITEM_SKIN_TEMPERATURE, type BaseDeviceConfig, type BleDeviceMetaLabel, BoolCondition, CPMSHealthServicesActivityDetectionAnnotation, CPMSHealthServicesPassiveDataAnnotation, CommunicationTypeSystem, type ComparisonOperator, type ConditionOperatorType, type ConditionQuestionType, type ConditionSorting, type ConditionType, Conjunction, type Consent, ConsentCondition, ConsentNameSystem, type ConsentPath, type ConsentTimes, ConsentVersionSystem, type Converter, type CryptoModule, CustomExtensionDate, CustomExtensionStudyName, CustomQuestionSystem, type DEVICE_ANNOTATION, type DEVICE_ANNOTATION_DATA_FORMAT, type DEVICE_ANNOTATION_DATA_TYPE, DEVICE_ANNOTATION_HEARTRATE, type DEVICE_ANNOTATION_ITEM, DEVICE_ANNOTATION_ITEM_ACCELERATION, DEVICE_ANNOTATION_ITEM_ANGULAR_SPEED, DEVICE_ANNOTATION_ITEM_BEACON_ID, DEVICE_ANNOTATION_ITEM_DISTANCE, DEVICE_ANNOTATION_ITEM_EGVS, DEVICE_ANNOTATION_ITEM_HEARTRATE, DEVICE_ANNOTATION_ITEM_MAGNETIC_FIELD, DEVICE_ANNOTATION_ITEM_REMOTE_DISTANCE, DEVICE_ANNOTATION_ITEM_RSSI, DEVICE_ANNOTATION_ITEM_UNIX_TIMESTAMP, DEVICE_ANNOTATION_TIMESTAMP_NOTE, DEVICE_ANNOTATION_TIMESTAMP_SIZE, DEVICE_ANNOTATION_TIMESTAMP_UNIT, DEVICE_D4L_COMPANION_ANNOTATION_ITEM_DATA_TYPES_FLAG, DEVICE_D4L_COMPANION_ANNOTATION_ITEM_TIMESTAMP, DEVICE_DISPLAY_LABEL_CODING, type DEVICE_KEY, type DEVICE_KEY_API, type DEVICE_KEY_BLE, type DEVICE_KEY_INTERNAL, type DEVICE_KEY_SDK, DEVICE_KEY_TO_NAME, DEVICE_LABEL_CODING, type DEVICE_MOVELLA_PAYLOAD_MODES, DEVICE_OUTPUT_RATE_CODING, DEVICE_SENSOR_DELAY_CODING, type DEVICE_SIGNAL_TYPE, type DateBlurringFunction, DateCondition, DecimalCondition, type DeviceConfig, type DeviceName, Disjunction, type Display, type DisplayContent, type DisplayContentBlock, type DisplayContentPath, type DisplayPath, type DisplayType, type DonationRecord, DonationSDK, type DonorIdentity, ERROR_CODES, type EligibilityScore, ExistsCondition, type ExtendedProgramDevicesDataType, FITBIT_ANNOTATION_ITEM_BREATHING_RATE, FITBIT_ANNOTATION_ITEM_CALORIES, FITBIT_ANNOTATION_ITEM_HEART_RATE, FITBIT_ANNOTATION_ITEM_HEART_RATE_VARIABILITY, FITBIT_ANNOTATION_ITEM_SKIN_TEMPERATURE, FITBIT_ANNOTATION_ITEM_SLEEP_LEVEL, FITBIT_ANNOTATION_ITEM_SLEEP_LEVEL_DURATION, FITBIT_ANNOTATION_ITEM_SPO2, FITBIT_ANNOTATION_ITEM_STEPS, FITBIT_BREATHING_RATE_ANNOTATION, FITBIT_CALORIES_ANNOTATION, FITBIT_HEART_RATE_ANNOTATION, FITBIT_HEART_RATE_VARIABILITY_ANNOTATION, FITBIT_SIGNAL_TYPE_ANNOTATIONS, FITBIT_SKIN_TEMPERATURE_ANNOTATION, FITBIT_SLEEP_ANNOTATION, FITBIT_SLEEP_LEVEL_MAP, FITBIT_SPO2_ANNOTATION, FITBIT_STEPS_ANNOTATION, type FitbitSleepLevelTypes, type FrequencyType, type Guard, IMUAnnotation, type InternalDeviceConfig, InternalSensorAnnotationTypes, KeyHandler, MaxValueExtension, MeasurementTypeSystem, MinLengthExtension, MinValueExtension, type MultiAnswers, ObservationTypeSystem, Offset, PAMSCardioVascularActivityAnnotation, PAMSGeneralActivityInstantaneousAnnotation, PAMSGeneralActivitySummaryAnnotation, PAMSStepCounterActivitySummaryAnnotation, PSMSHeartRateAnnotation, PSMSPPGGreenAnnotation, PSMSPPGIRAnnotation, PSMSPPGRedAnnotation, PSMSSkinTemperatureAnnotation, type PreviewTimeSeriesItem, type Program, type ProgramAnonymization, type ProgramClientTarget, type ProgramConsentStep, type ProgramContact, type ProgramContent, type ProgramContentPath, type ProgramDevice, type ProgramDeviceType, type ProgramDevicesDataType, type ProgramDevicesLabel, type ProgramDisplayStep, type ProgramDonation, type ProgramEligibilityStep, type ProgramFeatured, type ProgramRoutineStep, type ProgramSensorStep, type ProgramStep, type ProgramStepBase, type ProgramStepType, type ProgramSurveyStep, type ProgramTag, type ProgramTokenStep, type ProgramType, QItemControlDefinition, type QuestionInputType, type QuestionnaireResponse, RECORDING_MODEL_CURRENT_VERSION, RECORDING_SIGNAL_MODEL_CURRENT_VERSION, type RecordState, type Recording, type RecordingSignal, type RecordingSignalItem, type RecordingSignalPreview, type RecordingSignalWithId, type RecordingTag, type RecursiveKeyOf, RelativeMaxValueExtension, RelativeMinValueExtension, type ReminderFrequencyType, type ReponseValue, type ResearchSubject, type ResearchSubjectProgress, type ResearchSubjectProgressState, type RestorationSize, type Routine, RoutineCondition, type RoutineContent, type RoutineContentPath, type RoutineContentStep, RoutineIsPassiveExtension, type RoutineTimes, type SDKDeviceConfig, type SDKInterface, SIGNAL_DURATION_CODING, type ScoreThreshold, type SeenDisplay, SensorIdentifierSystem, SensorSettingsSystem, SensorTypeSystem, SignalIDSystem, type SkippedStep, SliderMaxLabelExtension, SliderMinLabelExtension, SliderStepSizeExtension, type StepCondition, type StringTemplater, StudyNameSystem, type Survey, SurveyCondition, type SurveyContent, type SurveyContentPath, type SurveyScoring, type Tag, type TagEffectiveType, type TaskFrequency, type TaskReminder, type Threshold, TokenNamingSystem, type TranslatedString, ULID_REGEX, ULIDtoUUID, UUID_REGEX, UUIDtoULID, WORDLIST_LANGUAGES, WearOS3AnnotationMap, WebConverter, type WordListLanguage, YearCondition, binaryStringToUint8Array, capitalizeFirstLetter, extractWordsFromRecoveryPhrase, generateFHIRConsent, generateFHIREligibility, generateFHIRRecordingBundle, generateFHIRResearchSubject, generateFHIRResponse, generateFHIRSeenDisplay, generateFHIRTag, generateQuestionGuard, generateStepGuard, generateUrn, get, getLanguageOfPassPhrase, getMovellaAnnotation, getText, isScoreEligible, isYearString, newStepDateCondtion, stringToDate, stringToYear, toDeviceConfig, toQuestionnaireResponseItem, uint8ArrayToBinaryString, utf8ToUint8Array, wordlists };
|
package/dist/index.js
CHANGED
|
@@ -800,6 +800,97 @@ var _bip39 = require('@scure/bip39'); var bip39 = _interopRequireWildcard(_bip39
|
|
|
800
800
|
var _2 = require('buffer/');
|
|
801
801
|
var _nodeforge = require('node-forge'); var forge = _interopRequireWildcard(_nodeforge); var forge2 = _interopRequireWildcard(_nodeforge);
|
|
802
802
|
|
|
803
|
+
// src/helper/converter.ts
|
|
804
|
+
|
|
805
|
+
var binaryStringToUint8Array = (binaryString) => {
|
|
806
|
+
return new Uint8Array(binaryString.split("").map((c) => c.charCodeAt(0)));
|
|
807
|
+
};
|
|
808
|
+
var uint8ArrayToBinaryString = (array) => {
|
|
809
|
+
return String.fromCharCode.apply(null, array);
|
|
810
|
+
};
|
|
811
|
+
var utf8ToUint8Array = (string) => {
|
|
812
|
+
const result = [];
|
|
813
|
+
const size = string.length;
|
|
814
|
+
for (let index = 0; index < size; index++) {
|
|
815
|
+
let point = string.charCodeAt(index);
|
|
816
|
+
if (point >= 55296 && point <= 56319 && size > index + 1) {
|
|
817
|
+
const second = string.charCodeAt(index + 1);
|
|
818
|
+
if (second >= 56320 && second <= 57343) {
|
|
819
|
+
point = (point - 55296) * 1024 + second - 56320 + 65536;
|
|
820
|
+
index += 1;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
if (point < 128) {
|
|
824
|
+
result.push(point);
|
|
825
|
+
continue;
|
|
826
|
+
}
|
|
827
|
+
if (point < 2048) {
|
|
828
|
+
result.push(point >> 6 | 192);
|
|
829
|
+
result.push(point & 63 | 128);
|
|
830
|
+
continue;
|
|
831
|
+
}
|
|
832
|
+
if (point < 55296 || point >= 57344 && point < 65536) {
|
|
833
|
+
result.push(point >> 12 | 224);
|
|
834
|
+
result.push(point >> 6 & 63 | 128);
|
|
835
|
+
result.push(point & 63 | 128);
|
|
836
|
+
continue;
|
|
837
|
+
}
|
|
838
|
+
if (point >= 65536 && point <= 1114111) {
|
|
839
|
+
result.push(point >> 18 | 240);
|
|
840
|
+
result.push(point >> 12 & 63 | 128);
|
|
841
|
+
result.push(point >> 6 & 63 | 128);
|
|
842
|
+
result.push(point & 63 | 128);
|
|
843
|
+
continue;
|
|
844
|
+
}
|
|
845
|
+
result.push(239, 191, 189);
|
|
846
|
+
}
|
|
847
|
+
return new Uint8Array(result);
|
|
848
|
+
};
|
|
849
|
+
var WebConverter = class {
|
|
850
|
+
constructor() {
|
|
851
|
+
this.arrayBufferToBase64 = (buffer) => {
|
|
852
|
+
let binary = "";
|
|
853
|
+
const bytes = new Uint8Array(buffer);
|
|
854
|
+
const len = bytes.byteLength;
|
|
855
|
+
for (let i = 0; i < len; i++) {
|
|
856
|
+
binary += String.fromCharCode(bytes[i]);
|
|
857
|
+
}
|
|
858
|
+
return btoa(binary);
|
|
859
|
+
};
|
|
860
|
+
this.base64ToArrayBuffer = (string) => {
|
|
861
|
+
const base64 = atob(string);
|
|
862
|
+
const buffer = new ArrayBuffer(base64.length);
|
|
863
|
+
const bufferView = new Uint8Array(buffer);
|
|
864
|
+
for (let i = 0, base64Len = base64.length; i < base64Len; i++) {
|
|
865
|
+
bufferView[i] = base64.charCodeAt(i);
|
|
866
|
+
}
|
|
867
|
+
return buffer;
|
|
868
|
+
};
|
|
869
|
+
// convert Uint8Array to base64 string
|
|
870
|
+
this.uint8ArrayToBase64 = (array) => {
|
|
871
|
+
return btoa(String.fromCharCode(...array));
|
|
872
|
+
};
|
|
873
|
+
/**
|
|
874
|
+
* Convert a base64 encoded string into Uint8Array
|
|
875
|
+
* @param string The string that needs to be converted into an Uint8Array
|
|
876
|
+
* @returns A Uint8Array
|
|
877
|
+
*/
|
|
878
|
+
this.base64ToUint8Array = (string) => new Uint8Array(this.base64ToArrayBuffer(string));
|
|
879
|
+
/**
|
|
880
|
+
* Convert a base64 encoded Uint8Array into a UTF-8 encoded string
|
|
881
|
+
* @param uint The base64 encoded Uint8Array
|
|
882
|
+
* @returns The UTF-8 encoded string
|
|
883
|
+
*/
|
|
884
|
+
this.uint8ArrayToUTF8 = (uint) => {
|
|
885
|
+
const decoder = new TextDecoder();
|
|
886
|
+
const str = decoder.decode(uint);
|
|
887
|
+
return _2.Buffer.from(str, "base64").toString("utf8");
|
|
888
|
+
};
|
|
889
|
+
this.base64ToHex = (base64String) => _2.Buffer.from(base64String, "base64").toString("hex");
|
|
890
|
+
this.hexToBase64 = (hexString) => _2.Buffer.from(hexString, "hex").toString("base64");
|
|
891
|
+
}
|
|
892
|
+
};
|
|
893
|
+
|
|
803
894
|
// src/helper/wordlists.ts
|
|
804
895
|
var _english = require('@scure/bip39/wordlists/english');
|
|
805
896
|
var german = [
|
|
@@ -2980,7 +3071,11 @@ var KeyHandler = class {
|
|
|
2980
3071
|
*/
|
|
2981
3072
|
this.verify = async (message, signature, pub) => {
|
|
2982
3073
|
const sha256 = this.hash(message);
|
|
2983
|
-
return _secp256k1.secp256k1.verify(
|
|
3074
|
+
return _secp256k1.secp256k1.verify(
|
|
3075
|
+
signature,
|
|
3076
|
+
binaryStringToUint8Array(sha256),
|
|
3077
|
+
this.converter.base64ToUint8Array(pub)
|
|
3078
|
+
);
|
|
2984
3079
|
};
|
|
2985
3080
|
this.converter = converter;
|
|
2986
3081
|
this.crypto = crypto;
|
|
@@ -3256,99 +3351,6 @@ var hasValidItems = (document) => Array.isArray(document.item) && document.item.
|
|
|
3256
3351
|
// src/donation/hybridEncryption.ts
|
|
3257
3352
|
|
|
3258
3353
|
|
|
3259
|
-
|
|
3260
|
-
// src/helper/converter.ts
|
|
3261
|
-
|
|
3262
|
-
var binaryStringToUint8Array = (binaryString) => {
|
|
3263
|
-
return new Uint8Array(binaryString.split("").map((c) => c.charCodeAt(0)));
|
|
3264
|
-
};
|
|
3265
|
-
var uint8ArrayToBinaryString = (array) => {
|
|
3266
|
-
return String.fromCharCode.apply(null, array);
|
|
3267
|
-
};
|
|
3268
|
-
var utf8ToUint8Array = (string) => {
|
|
3269
|
-
const result = [];
|
|
3270
|
-
const size = string.length;
|
|
3271
|
-
for (let index = 0; index < size; index++) {
|
|
3272
|
-
let point = string.charCodeAt(index);
|
|
3273
|
-
if (point >= 55296 && point <= 56319 && size > index + 1) {
|
|
3274
|
-
const second = string.charCodeAt(index + 1);
|
|
3275
|
-
if (second >= 56320 && second <= 57343) {
|
|
3276
|
-
point = (point - 55296) * 1024 + second - 56320 + 65536;
|
|
3277
|
-
index += 1;
|
|
3278
|
-
}
|
|
3279
|
-
}
|
|
3280
|
-
if (point < 128) {
|
|
3281
|
-
result.push(point);
|
|
3282
|
-
continue;
|
|
3283
|
-
}
|
|
3284
|
-
if (point < 2048) {
|
|
3285
|
-
result.push(point >> 6 | 192);
|
|
3286
|
-
result.push(point & 63 | 128);
|
|
3287
|
-
continue;
|
|
3288
|
-
}
|
|
3289
|
-
if (point < 55296 || point >= 57344 && point < 65536) {
|
|
3290
|
-
result.push(point >> 12 | 224);
|
|
3291
|
-
result.push(point >> 6 & 63 | 128);
|
|
3292
|
-
result.push(point & 63 | 128);
|
|
3293
|
-
continue;
|
|
3294
|
-
}
|
|
3295
|
-
if (point >= 65536 && point <= 1114111) {
|
|
3296
|
-
result.push(point >> 18 | 240);
|
|
3297
|
-
result.push(point >> 12 & 63 | 128);
|
|
3298
|
-
result.push(point >> 6 & 63 | 128);
|
|
3299
|
-
result.push(point & 63 | 128);
|
|
3300
|
-
continue;
|
|
3301
|
-
}
|
|
3302
|
-
result.push(239, 191, 189);
|
|
3303
|
-
}
|
|
3304
|
-
return new Uint8Array(result);
|
|
3305
|
-
};
|
|
3306
|
-
var WebConverter = class {
|
|
3307
|
-
constructor() {
|
|
3308
|
-
this.arrayBufferToBase64 = (buffer) => {
|
|
3309
|
-
let binary = "";
|
|
3310
|
-
const bytes = new Uint8Array(buffer);
|
|
3311
|
-
const len = bytes.byteLength;
|
|
3312
|
-
for (let i = 0; i < len; i++) {
|
|
3313
|
-
binary += String.fromCharCode(bytes[i]);
|
|
3314
|
-
}
|
|
3315
|
-
return btoa(binary);
|
|
3316
|
-
};
|
|
3317
|
-
this.base64ToArrayBuffer = (string) => {
|
|
3318
|
-
const base64 = atob(string);
|
|
3319
|
-
const buffer = new ArrayBuffer(base64.length);
|
|
3320
|
-
const bufferView = new Uint8Array(buffer);
|
|
3321
|
-
for (let i = 0, base64Len = base64.length; i < base64Len; i++) {
|
|
3322
|
-
bufferView[i] = base64.charCodeAt(i);
|
|
3323
|
-
}
|
|
3324
|
-
return buffer;
|
|
3325
|
-
};
|
|
3326
|
-
// convert Uint8Array to base64 string
|
|
3327
|
-
this.uint8ArrayToBase64 = (array) => {
|
|
3328
|
-
return btoa(String.fromCharCode(...array));
|
|
3329
|
-
};
|
|
3330
|
-
/**
|
|
3331
|
-
* Convert a base64 encoded string into Uint8Array
|
|
3332
|
-
* @param string The string that needs to be converted into an Uint8Array
|
|
3333
|
-
* @returns A Uint8Array
|
|
3334
|
-
*/
|
|
3335
|
-
this.base64ToUint8Array = (string) => new Uint8Array(this.base64ToArrayBuffer(string));
|
|
3336
|
-
/**
|
|
3337
|
-
* Convert a base64 encoded Uint8Array into a UTF-8 encoded string
|
|
3338
|
-
* @param uint The base64 encoded Uint8Array
|
|
3339
|
-
* @returns The UTF-8 encoded string
|
|
3340
|
-
*/
|
|
3341
|
-
this.uint8ArrayToUTF8 = (uint) => {
|
|
3342
|
-
const decoder = new TextDecoder();
|
|
3343
|
-
const str = decoder.decode(uint);
|
|
3344
|
-
return _2.Buffer.from(str, "base64").toString("utf8");
|
|
3345
|
-
};
|
|
3346
|
-
this.base64ToHex = (base64String) => _2.Buffer.from(base64String, "base64").toString("hex");
|
|
3347
|
-
this.hexToBase64 = (hexString) => _2.Buffer.from(hexString, "hex").toString("base64");
|
|
3348
|
-
}
|
|
3349
|
-
};
|
|
3350
|
-
|
|
3351
|
-
// src/donation/hybridEncryption.ts
|
|
3352
3354
|
var AES_BLOCKSIZE = 16;
|
|
3353
3355
|
var TAG_LENGTH = 16;
|
|
3354
3356
|
var KEY_LENGTH = 32;
|