@tellescope/utilities 1.172.0 → 1.174.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/lib/cjs/utils.d.ts +11 -2
- package/lib/cjs/utils.d.ts.map +1 -1
- package/lib/cjs/utils.js +143 -76
- package/lib/cjs/utils.js.map +1 -1
- package/lib/esm/utils.d.ts +11 -2
- package/lib/esm/utils.d.ts.map +1 -1
- package/lib/esm/utils.js +140 -74
- package/lib/esm/utils.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/utils.ts +83 -3
package/lib/cjs/utils.d.ts
CHANGED
|
@@ -106,6 +106,7 @@ export declare const get_time_values: (date: Date, options?: {
|
|
|
106
106
|
amPm: string;
|
|
107
107
|
minutes: string | number;
|
|
108
108
|
year: number;
|
|
109
|
+
seconds: string | number;
|
|
109
110
|
};
|
|
110
111
|
export declare const formatted_date: (date: Date) => string;
|
|
111
112
|
export declare const get_add_to_gcal_link: (event: Pick<CalendarEvent, "startTimeInMS" | 'durationInMinutes' | 'title' | 'videoURL' | 'description' | 'displayDescription' | 'displayTitle'>) => string;
|
|
@@ -189,7 +190,14 @@ export declare const get_conditional_logic_values: <T extends string>(conditions
|
|
|
189
190
|
export declare const replace_keys_and_values_in_object: <T>(value: T, replacer: (v: any) => any) => T;
|
|
190
191
|
export declare const age_for_dob_mmddyyyy: (mmddyyyy: string) => number | "";
|
|
191
192
|
export declare const get_enduser_field_value_for_key: (enduser: Omit<Enduser, 'id'>, key: string) => any;
|
|
192
|
-
|
|
193
|
+
type EnduserAugmentations = {
|
|
194
|
+
_upcomingEvents?: any[];
|
|
195
|
+
};
|
|
196
|
+
export declare const UPCOMING_EVENT_COUNT_KEY = "__upcomingEvents__";
|
|
197
|
+
export declare const evaluate_conditional_logic_for_enduser_fields: (enduser: Omit<Enduser, 'id'> & EnduserAugmentations, conditions: Record<string, any>, o?: {
|
|
198
|
+
ignoreUpcomingEvents?: boolean;
|
|
199
|
+
}) => boolean;
|
|
200
|
+
export declare const string_matches_key_or_value: <T>(value: T, match: string) => boolean;
|
|
193
201
|
export declare const getLocalTimezone: () => "Africa/Abidjan" | "Africa/Accra" | "Africa/Addis_Ababa" | "Africa/Algiers" | "Africa/Asmara" | "Africa/Asmera" | "Africa/Bamako" | "Africa/Bangui" | "Africa/Banjul" | "Africa/Blantyre" | "Africa/Brazzaville" | "Africa/Bujumbura" | "Africa/Cairo" | "Africa/Casablanca" | "Africa/Ceuta" | "Africa/Conakry" | "Africa/Dakar" | "Africa/Dar_es_Salaam" | "Africa/Djibouti" | "Africa/Douala" | "Africa/El_Aaiun" | "Africa/Freetown" | "Africa/Gaborone" | "Africa/Harare" | "Africa/Johannesburg" | "Africa/Juba" | "Africa/Kampala" | "Africa/Khartoum" | "Africa/Kigali" | "Africa/Kinshasa" | "Africa/Lagos" | "Africa/Libreville" | "Africa/Lome" | "Africa/Luanda" | "Africa/Lubumbashi" | "Africa/Lusaka" | "Africa/Malabo" | "Africa/Maputo" | "Africa/Maseru" | "Africa/Mbabane" | "Africa/Mogadishu" | "Africa/Monrovia" | "Africa/Nairobi" | "Africa/Ndjamena" | "Africa/Niamey" | "Africa/Nouakchott" | "Africa/Ouagadougou" | "Africa/Porto-Novo" | "Africa/Sao_Tome" | "Africa/Timbuktu" | "Africa/Tripoli" | "Africa/Tunis" | "Africa/Windhoek" | "America/Adak" | "America/Anchorage" | "America/Anguilla" | "America/Antigua" | "America/Araguaina" | "America/Argentina/Buenos_Aires" | "America/Argentina/Catamarca" | "America/Argentina/ComodRivadavia" | "America/Argentina/Cordoba" | "America/Argentina/Jujuy" | "America/Argentina/La_Rioja" | "America/Argentina/Mendoza" | "America/Argentina/Rio_Gallegos" | "America/Argentina/Salta" | "America/Argentina/San_Juan" | "America/Argentina/San_Luis" | "America/Argentina/Tucuman" | "America/Argentina/Ushuaia" | "America/Aruba" | "America/Asuncion" | "America/Atikokan" | "America/Atka" | "America/Bahia" | "America/Bahia_Banderas" | "America/Barbados" | "America/Belem" | "America/Belize" | "America/Blanc-Sablon" | "America/Boa_Vista" | "America/Bogota" | "America/Boise" | "America/Buenos_Aires" | "America/Cambridge_Bay" | "America/Campo_Grande" | "America/Cancun" | "America/Caracas" | "America/Catamarca" | "America/Cayenne" | "America/Cayman" | "America/Chicago" | "America/Chihuahua" | "America/Coral_Harbour" | "America/Cordoba" | "America/Costa_Rica" | "America/Creston" | "America/Cuiaba" | "America/Curacao" | "America/Danmarkshavn" | "America/Dawson" | "America/Dawson_Creek" | "America/Denver" | "America/Detroit" | "America/Dominica" | "America/Edmonton" | "America/Eirunepe" | "America/El_Salvador" | "America/Ensenada" | "America/Fort_Wayne" | "America/Fortaleza" | "America/Glace_Bay" | "America/Godthab" | "America/Goose_Bay" | "America/Grand_Turk" | "America/Grenada" | "America/Guadeloupe" | "America/Guatemala" | "America/Guayaquil" | "America/Guyana" | "America/Halifax" | "America/Havana" | "America/Hermosillo" | "America/Indiana/Indianapolis" | "America/Indiana/Knox" | "America/Indiana/Marengo" | "America/Indiana/Petersburg" | "America/Indiana/Tell_City" | "America/Indiana/Valparaiso" | "America/Indiana/Vevay" | "America/Indiana/Vincennes" | "America/Indiana/Winamac" | "America/Indianapolis" | "America/Inuvik" | "America/Iqaluit" | "America/Jamaica" | "America/Jujuy" | "America/Juneau" | "America/Kentucky/Louisville" | "America/Kentucky/Monticello" | "America/Knox_IN" | "America/Kralendijk" | "America/La_Paz" | "America/Lima" | "America/Los_Angeles" | "America/Louisville" | "America/Lower_Princes" | "America/Maceio" | "America/Managua" | "America/Manaus" | "America/Marigot" | "America/Martinique" | "America/Matamoros" | "America/Mazatlan" | "America/Mendoza" | "America/Menominee" | "America/Merida" | "America/Metlakatla" | "America/Mexico_City" | "America/Miquelon" | "America/Moncton" | "America/Monterrey" | "America/Montevideo" | "America/Montreal" | "America/Montserrat" | "America/Nassau" | "America/New_York" | "America/Nipigon" | "America/Nome" | "America/Noronha" | "America/North_Dakota/Beulah" | "America/North_Dakota/Center" | "America/North_Dakota/New_Salem" | "America/Ojinaga" | "America/Panama" | "America/Pangnirtung" | "America/Paramaribo" | "America/Phoenix" | "America/Port_of_Spain" | "America/Port-au-Prince" | "America/Porto_Acre" | "America/Porto_Velho" | "America/Puerto_Rico" | "America/Rainy_River" | "America/Rankin_Inlet" | "America/Recife" | "America/Regina" | "America/Resolute" | "America/Rio_Branco" | "America/Rosario" | "America/Santa_Isabel" | "America/Santarem" | "America/Santiago" | "America/Santo_Domingo" | "America/Sao_Paulo" | "America/Scoresbysund" | "America/Shiprock" | "America/Sitka" | "America/St_Barthelemy" | "America/St_Johns" | "America/St_Kitts" | "America/St_Lucia" | "America/St_Thomas" | "America/St_Vincent" | "America/Swift_Current" | "America/Tegucigalpa" | "America/Thule" | "America/Thunder_Bay" | "America/Tijuana" | "America/Toronto" | "America/Tortola" | "America/Vancouver" | "America/Virgin" | "America/Whitehorse" | "America/Winnipeg" | "America/Yakutat" | "America/Yellowknife" | "Antarctica/Casey" | "Antarctica/Davis" | "Antarctica/DumontDUrville" | "Antarctica/Macquarie" | "Antarctica/Mawson" | "Antarctica/McMurdo" | "Antarctica/Palmer" | "Antarctica/Rothera" | "Antarctica/South_Pole" | "Antarctica/Syowa" | "Antarctica/Troll" | "Antarctica/Vostok" | "Arctic/Longyearbyen" | "Asia/Aden" | "Asia/Almaty" | "Asia/Amman" | "Asia/Anadyr" | "Asia/Aqtau" | "Asia/Aqtobe" | "Asia/Ashgabat" | "Asia/Ashkhabad" | "Asia/Baghdad" | "Asia/Bahrain" | "Asia/Baku" | "Asia/Bangkok" | "Asia/Beirut" | "Asia/Bishkek" | "Asia/Brunei" | "Asia/Calcutta" | "Asia/Choibalsan" | "Asia/Chongqing" | "Asia/Chungking" | "Asia/Colombo" | "Asia/Dacca" | "Asia/Damascus" | "Asia/Dhaka" | "Asia/Dili" | "Asia/Dubai" | "Asia/Dushanbe" | "Asia/Gaza" | "Asia/Harbin" | "Asia/Hebron" | "Asia/Ho_Chi_Minh" | "Asia/Hong_Kong" | "Asia/Hovd" | "Asia/Irkutsk" | "Asia/Istanbul" | "Asia/Jakarta" | "Asia/Jayapura" | "Asia/Jerusalem" | "Asia/Kabul" | "Asia/Kamchatka" | "Asia/Karachi" | "Asia/Kashgar" | "Asia/Kathmandu" | "Asia/Katmandu" | "Asia/Khandyga" | "Asia/Kolkata" | "Asia/Krasnoyarsk" | "Asia/Kuala_Lumpur" | "Asia/Kuching" | "Asia/Kuwait" | "Asia/Macao" | "Asia/Macau" | "Asia/Magadan" | "Asia/Makassar" | "Asia/Manila" | "Asia/Muscat" | "Asia/Nicosia" | "Asia/Novokuznetsk" | "Asia/Novosibirsk" | "Asia/Omsk" | "Asia/Oral" | "Asia/Phnom_Penh" | "Asia/Pontianak" | "Asia/Pyongyang" | "Asia/Qatar" | "Asia/Qyzylorda" | "Asia/Rangoon" | "Asia/Riyadh" | "Asia/Saigon" | "Asia/Sakhalin" | "Asia/Samarkand" | "Asia/Seoul" | "Asia/Shanghai" | "Asia/Singapore" | "Asia/Taipei" | "Asia/Tashkent" | "Asia/Tbilisi" | "Asia/Tehran" | "Asia/Tel_Aviv" | "Asia/Thimbu" | "Asia/Thimphu" | "Asia/Tokyo" | "Asia/Ujung_Pandang" | "Asia/Ulaanbaatar" | "Asia/Ulan_Bator" | "Asia/Urumqi" | "Asia/Ust-Nera" | "Asia/Vientiane" | "Asia/Vladivostok" | "Asia/Yakutsk" | "Asia/Yekaterinburg" | "Asia/Yerevan" | "Atlantic/Azores" | "Atlantic/Bermuda" | "Atlantic/Canary" | "Atlantic/Cape_Verde" | "Atlantic/Faeroe" | "Atlantic/Faroe" | "Atlantic/Jan_Mayen" | "Atlantic/Madeira" | "Atlantic/Reykjavik" | "Atlantic/South_Georgia" | "Atlantic/St_Helena" | "Atlantic/Stanley" | "Australia/ACT" | "Australia/Adelaide" | "Australia/Brisbane" | "Australia/Broken_Hill" | "Australia/Canberra" | "Australia/Currie" | "Australia/Darwin" | "Australia/Eucla" | "Australia/Hobart" | "Australia/LHI" | "Australia/Lindeman" | "Australia/Lord_Howe" | "Australia/Melbourne" | "Australia/North" | "Australia/NSW" | "Australia/Perth" | "Australia/Queensland" | "Australia/South" | "Australia/Sydney" | "Australia/Tasmania" | "Australia/Victoria" | "Australia/West" | "Australia/Yancowinna" | "Brazil/Acre" | "Brazil/DeNoronha" | "Brazil/East" | "Brazil/West" | "Canada/Atlantic" | "Canada/Central" | "Canada/Eastern" | "Canada/East-Saskatchewan" | "Canada/Mountain" | "Canada/Newfoundland" | "Canada/Pacific" | "Canada/Saskatchewan" | "Canada/Yukon" | "Chile/Continental" | "Chile/EasterIsland" | "Cuba" | "Egypt" | "Eire" | "Etc/GMT" | "Etc/GMT+0" | "Etc/UCT" | "Etc/Universal" | "Etc/UTC" | "Etc/Zulu" | "Europe/Amsterdam" | "Europe/Andorra" | "Europe/Athens" | "Europe/Belfast" | "Europe/Belgrade" | "Europe/Berlin" | "Europe/Bratislava" | "Europe/Brussels" | "Europe/Bucharest" | "Europe/Budapest" | "Europe/Busingen" | "Europe/Chisinau" | "Europe/Copenhagen" | "Europe/Dublin" | "Europe/Gibraltar" | "Europe/Guernsey" | "Europe/Helsinki" | "Europe/Isle_of_Man" | "Europe/Istanbul" | "Europe/Jersey" | "Europe/Kaliningrad" | "Europe/Kiev" | "Europe/Lisbon" | "Europe/Ljubljana" | "Europe/London" | "Europe/Luxembourg" | "Europe/Madrid" | "Europe/Malta" | "Europe/Mariehamn" | "Europe/Minsk" | "Europe/Monaco" | "Europe/Moscow" | "Europe/Nicosia" | "Europe/Oslo" | "Europe/Paris" | "Europe/Podgorica" | "Europe/Prague" | "Europe/Riga" | "Europe/Rome" | "Europe/Samara" | "Europe/San_Marino" | "Europe/Sarajevo" | "Europe/Simferopol" | "Europe/Skopje" | "Europe/Sofia" | "Europe/Stockholm" | "Europe/Tallinn" | "Europe/Tirane" | "Europe/Tiraspol" | "Europe/Uzhgorod" | "Europe/Vaduz" | "Europe/Vatican" | "Europe/Vienna" | "Europe/Vilnius" | "Europe/Volgograd" | "Europe/Warsaw" | "Europe/Zagreb" | "Europe/Zaporozhye" | "Europe/Zurich" | "GB" | "GB-Eire" | "GMT" | "GMT+0" | "GMT0" | "GMT-0" | "Greenwich" | "Hongkong" | "Iceland" | "Indian/Antananarivo" | "Indian/Chagos" | "Indian/Christmas" | "Indian/Cocos" | "Indian/Comoro" | "Indian/Kerguelen" | "Indian/Mahe" | "Indian/Maldives" | "Indian/Mauritius" | "Indian/Mayotte" | "Indian/Reunion" | "Iran" | "Israel" | "Jamaica" | "Japan" | "Kwajalein" | "Libya" | "Mexico/BajaNorte" | "Mexico/BajaSur" | "Mexico/General" | "Navajo" | "NZ" | "NZ-CHAT" | "Pacific/Apia" | "Pacific/Auckland" | "Pacific/Chatham" | "Pacific/Chuuk" | "Pacific/Easter" | "Pacific/Efate" | "Pacific/Enderbury" | "Pacific/Fakaofo" | "Pacific/Fiji" | "Pacific/Funafuti" | "Pacific/Galapagos" | "Pacific/Gambier" | "Pacific/Guadalcanal" | "Pacific/Guam" | "Pacific/Honolulu" | "Pacific/Johnston" | "Pacific/Kiritimati" | "Pacific/Kosrae" | "Pacific/Kwajalein" | "Pacific/Majuro" | "Pacific/Marquesas" | "Pacific/Midway" | "Pacific/Nauru" | "Pacific/Niue" | "Pacific/Norfolk" | "Pacific/Noumea" | "Pacific/Pago_Pago" | "Pacific/Palau" | "Pacific/Pitcairn" | "Pacific/Pohnpei" | "Pacific/Ponape" | "Pacific/Port_Moresby" | "Pacific/Rarotonga" | "Pacific/Saipan" | "Pacific/Samoa" | "Pacific/Tahiti" | "Pacific/Tarawa" | "Pacific/Tongatapu" | "Pacific/Truk" | "Pacific/Wake" | "Pacific/Wallis" | "Pacific/Yap" | "Poland" | "Portugal" | "PRC" | "ROC" | "ROK" | "Singapore" | "Turkey" | "UCT" | "Universal" | "US/Alaska" | "US/Aleutian" | "US/Arizona" | "US/Central" | "US/Eastern" | "US/East-Indiana" | "US/Hawaii" | "US/Indiana-Starke" | "US/Michigan" | "US/Mountain" | "US/Pacific" | "US/Samoa" | "UTC" | "W-SU" | "Zulu";
|
|
194
202
|
export declare const YYYY_MM_DD_to_MM_DD_YYYY: (yyyyMmDd: string, delimiter?: string) => string;
|
|
195
203
|
export declare const MM_DD_YYYY_to_YYYY_MM_DD: (MMDDYYYY: string, delimiter?: string) => string;
|
|
@@ -263,13 +271,14 @@ export declare const get_flattened_fields: <T extends object>(objects: T[], opti
|
|
|
263
271
|
export declare const value_for_dotted_key: (v: any, key: string) => any;
|
|
264
272
|
export declare const add_value_for_dotted_key: (_object: Record<any, any>, field: string, value: any) => void;
|
|
265
273
|
export declare const INVALID_PREPOPULATION_TYPES: FormFieldType[];
|
|
266
|
-
export declare const get_prepopulated_responses: (fields: FormField[], enduser: Enduser) => {
|
|
274
|
+
export declare const get_prepopulated_responses: (fields: FormField[], enduser: Enduser, existingResponses?: FormResponseValue[]) => {
|
|
267
275
|
fieldId: string;
|
|
268
276
|
fieldTitle: string;
|
|
269
277
|
externalId: string | undefined;
|
|
270
278
|
fieldDescription: string | undefined;
|
|
271
279
|
fieldHtmlDescription: string | undefined;
|
|
272
280
|
sharedWithEnduser: boolean | undefined;
|
|
281
|
+
isPrepopulatedFromEnduserField: boolean;
|
|
273
282
|
answer: any;
|
|
274
283
|
}[];
|
|
275
284
|
export declare const downloadFile: (data: Uint8Array | Blob | Buffer | string, options: {
|
package/lib/cjs/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,iBAAiB,EAAE,aAAa,EAAE,cAAc,EAAE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAA6B,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAiF,iBAAiB,EAAE,uBAAuB,EAAE,YAAY,EAAE,oBAAoB,EAAsB,YAAY,EAAE,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AAA;AACD,eAAO,MAAM,wBAAwB,OAAQ,gBAAgB,WAE5D,CAAA;AAED,eAAO,MAAM,kDAAkD,OAAQ,YAAY,GAAG;IAAE,SAAS,EAAE,GAAG,CAAA;CAAE,YAOvG,CAAA;AAED,eAAO,MAAM,aAAa,MAAO,KAAK,OAAO,EAAE,QAAQ,GAAG,YAAY,GAAG,YAAY,CAAC,uBAIrF,CAAA"}
|
package/lib/cjs/utils.js
CHANGED
|
@@ -35,8 +35,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
};
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
exports.getEnvironment = exports.TEST_API_URL = exports.STAGING_API_URL = exports.PROD_API_URL = exports.query_string_for_object = exports.remove_image_tags = exports.remove_style_tags = exports.remove_script_tags = exports.time_for_calendar_event = exports.fullMonth_day_year = exports.mm_dd_yyyy = exports.yyyy_mm_dd_numeric = exports.yyyy_mm_dd = exports.formatted_date_hh_mm = exports.get_add_to_gcal_link = exports.formatted_date = exports.get_time_values = exports.MONTHS = exports.MONTHS_FULL = exports.sorted_records = exports.wait = exports.throwFunction = exports.to_absolute_url = exports.build_portal_link_string = exports.build_content_link_string = exports.build_file_link_string = exports.build_form_group_link_string = exports.build_form_link_string = exports.build_link_string = exports.getTemplatedData = exports.parse_link_template = exports.map_object = exports.truncate_string = exports.defined_fields = exports.user_is_active = exports.user_display_name = exports.objects_equivalent = exports.to_object_id = exports.url_safe_path = exports.is_whitespace = exports.matching_fields = exports.is_object = exports.filter_object = exports.is_defined = exports.is_truthy = exports.object_is_empty = exports.first_letter_lowercase = exports.first_letter_capitalized = exports.user_is_admin = exports.ObjectId = void 0;
|
|
38
|
-
exports.
|
|
39
|
-
exports.get_canvas_id = exports.should_show_unsubmitted_form_response_for_interval = exports.enduser_insurance_string = exports.enduser_address_string = exports.is_timezone = exports.downloadFile = exports.get_prepopulated_responses = exports.INVALID_PREPOPULATION_TYPES = exports.add_value_for_dotted_key = exports.value_for_dotted_key = exports.get_flattened_fields = exports.skip_due_date_as_needed = exports.is_full_iso_string_heuristic = exports.display_time_for_seconds = exports.replace_enduser_template_values = exports.replace_tag_template_values_for_enduser = exports.append_current_utm_params = exports.get_utm_params = exports.is_out_of_office = exports.color_for_classification = exports.classification_for_vital = exports.SMS_UNSUBSCRIBE_KEYWORDS = exports.satisfies_vital_comparison = exports.field_can_autosubmit = exports.field_can_autoadvance = exports.decodeJWT = exports.validate_organization_for_develop_health = exports.validate_user_for_develop_health = exports.validate_enduser_for_develop_health = exports.validate_enduser_for_dose_spot = exports.validate_enduser_for_smart_meter = void 0;
|
|
38
|
+
exports.validate_enduser_for_candid = exports.validate_provider_for_candid = exports.validate_organization_for_candid = exports.validate_insurance_for_eligibility = exports.weighted_round_robin = exports.responses_satisfy_conditions = exports.calculate_bmi = exports.FORM_LOGIC_URL_PARAMETER = exports.FORM_LOGIC_CALCULATED_FIELDS = exports.calculate_form_scoring = exports.batch_array = exports.capture_is_supported = exports.get_next_reminder_timestamp = exports.mfa_is_enabled = exports.URIDecodeEmail = exports.get_recent_outbound_communication_date = exports.get_recent_engagement_date = exports.MM_DD_YYYY_to_YYYY_MM_DD = exports.YYYY_MM_DD_to_MM_DD_YYYY = exports.getLocalTimezone = exports.string_matches_key_or_value = exports.evaluate_conditional_logic_for_enduser_fields = exports.UPCOMING_EVENT_COUNT_KEY = exports.get_enduser_field_value_for_key = exports.age_for_dob_mmddyyyy = exports.replace_keys_and_values_in_object = exports.get_conditional_logic_values = exports.evaluate_conditional_logic = exports.shuffle_array_in_place = exports.plaintext_for_managed_content_record = exports.sanitize_html = exports.timezone_for_enduser = exports.safeJSONParse = exports.payment_cost_to_string = exports.read_local_storage = exports.update_local_storage = exports.is_organization_owner = exports.form_response_value_to_string = exports.is_table_input_response = exports.user_has_record_access = exports.is_suborganization = exports.matches_organization = exports.getDefaultPortalURL = exports.getPublicFileURL = exports.getOrgnizationFaviconURL = exports.getOrgnizationLogoURL = exports.getBuiltInPublicFileName = exports.getGoogleClientAPIKey = exports.getGoogleClientId = exports.getApiURL = void 0;
|
|
39
|
+
exports.get_canvas_id = exports.should_show_unsubmitted_form_response_for_interval = exports.enduser_insurance_string = exports.enduser_address_string = exports.is_timezone = exports.downloadFile = exports.get_prepopulated_responses = exports.INVALID_PREPOPULATION_TYPES = exports.add_value_for_dotted_key = exports.value_for_dotted_key = exports.get_flattened_fields = exports.skip_due_date_as_needed = exports.is_full_iso_string_heuristic = exports.display_time_for_seconds = exports.replace_enduser_template_values = exports.replace_tag_template_values_for_enduser = exports.append_current_utm_params = exports.get_utm_params = exports.is_out_of_office = exports.color_for_classification = exports.classification_for_vital = exports.SMS_UNSUBSCRIBE_KEYWORDS = exports.satisfies_vital_comparison = exports.field_can_autosubmit = exports.field_can_autoadvance = exports.decodeJWT = exports.validate_organization_for_develop_health = exports.validate_user_for_develop_health = exports.validate_enduser_for_develop_health = exports.validate_enduser_for_dose_spot = exports.validate_enduser_for_smart_meter = exports.validate_enduser_for_gogo = exports.json_error_string = void 0;
|
|
40
40
|
var types_models_1 = require("@tellescope/types-models");
|
|
41
41
|
var constants_1 = require("@tellescope/constants");
|
|
42
42
|
var sanitize_html_1 = __importDefault(require("sanitize-html"));
|
|
@@ -382,13 +382,15 @@ var get_time_values = function (date, options) {
|
|
|
382
382
|
var month = ((options === null || options === void 0 ? void 0 : options.fullMonth) ? exports.MONTHS_FULL : exports.MONTHS)[monthNumber - 1];
|
|
383
383
|
var hours = date.getHours();
|
|
384
384
|
var minutesRaw = date.getMinutes();
|
|
385
|
+
var secondsRaw = date.getSeconds();
|
|
386
|
+
var seconds = secondsRaw >= 10 ? secondsRaw : "0".concat(secondsRaw);
|
|
385
387
|
var minutes = minutesRaw >= 10 ? minutesRaw : "0".concat(minutesRaw);
|
|
386
388
|
var year = date.getFullYear();
|
|
387
389
|
var amPm = hours < 12 ? 'am' : 'pm';
|
|
388
390
|
var hoursAmPm = (hours === 0
|
|
389
391
|
? 12
|
|
390
392
|
: hours <= 12 ? hours : hours - 12);
|
|
391
|
-
return { dayOfMonth: dayOfMonth, monthNumber: monthNumber, month: month, hours: hours, hoursAmPm: hoursAmPm, amPm: amPm, minutes: minutes, year: year, };
|
|
393
|
+
return { dayOfMonth: dayOfMonth, monthNumber: monthNumber, month: month, hours: hours, hoursAmPm: hoursAmPm, amPm: amPm, minutes: minutes, year: year, seconds: seconds };
|
|
392
394
|
};
|
|
393
395
|
exports.get_time_values = get_time_values;
|
|
394
396
|
var formatted_date = function (date) {
|
|
@@ -891,7 +893,8 @@ var get_enduser_field_value_for_key = function (enduser, key) {
|
|
|
891
893
|
return enduser === null || enduser === void 0 ? void 0 : enduser[key];
|
|
892
894
|
};
|
|
893
895
|
exports.get_enduser_field_value_for_key = get_enduser_field_value_for_key;
|
|
894
|
-
|
|
896
|
+
exports.UPCOMING_EVENT_COUNT_KEY = '__upcomingEvents__';
|
|
897
|
+
var evaluate_conditional_logic_for_enduser_fields = function (enduser, conditions, o) { return ((0, exports.evaluate_conditional_logic)(conditions, function (key, value) {
|
|
895
898
|
var _a, _b, _d, _e, _f;
|
|
896
899
|
return ((key === 'Age' && typeof value === 'object')
|
|
897
900
|
? (function () {
|
|
@@ -919,81 +922,144 @@ var evaluate_conditional_logic_for_enduser_fields = function (enduser, condition
|
|
|
919
922
|
// : !!enduser.tags?.find(t => (value as ListOfStringsWithQualifier)?.values?.includes(t))
|
|
920
923
|
// )
|
|
921
924
|
// })()
|
|
922
|
-
: key ===
|
|
923
|
-
? (
|
|
924
|
-
|
|
925
|
+
: (key === exports.UPCOMING_EVENT_COUNT_KEY && typeof value === 'object')
|
|
926
|
+
? (function () {
|
|
927
|
+
var _a, _b;
|
|
928
|
+
if (o === null || o === void 0 ? void 0 : o.ignoreUpcomingEvents)
|
|
929
|
+
return true;
|
|
930
|
+
var upcomingEventCount = (_b = (_a = enduser._upcomingEvents) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
|
931
|
+
var result = ((value === null || value === void 0 ? void 0 : value['$lt']) !== undefined
|
|
932
|
+
? (upcomingEventCount < parseInt(value['$lt']))
|
|
933
|
+
: (value === null || value === void 0 ? void 0 : value['$gt']) !== undefined
|
|
934
|
+
? (upcomingEventCount > parseInt(value['$gt']))
|
|
935
|
+
: false);
|
|
936
|
+
return result;
|
|
937
|
+
})()
|
|
938
|
+
: key === 'BMI' && typeof value === 'object'
|
|
925
939
|
? (function () {
|
|
926
|
-
var _a, _b, _d, _e
|
|
927
|
-
var
|
|
928
|
-
var
|
|
929
|
-
if (
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
var eDateField = (_d = (_b = enduser.fields) === null || _b === void 0 ? void 0 : _b[key]) !== null && _d !== void 0 ? _d : (0, exports.get_enduser_field_value_for_key)(enduser, key);
|
|
939
|
-
if (!eDateField)
|
|
940
|
-
return false;
|
|
941
|
-
if (typeof eDateField !== 'string')
|
|
942
|
-
return false;
|
|
943
|
-
var eDate = ((eDateField.includes('-') && eDateField.length === 10)
|
|
944
|
-
? new Date((0, exports.MM_DD_YYYY_to_YYYY_MM_DD)(eDateField))
|
|
945
|
-
: new Date(eDateField));
|
|
946
|
-
if (isNaN(eDate.getTime()))
|
|
947
|
-
return false;
|
|
948
|
-
return ((k === '$before' && eDate.getTime() < vDate.getTime())
|
|
949
|
-
|| (k === '$after' && eDate.getTime() > vDate.getTime()));
|
|
950
|
-
}
|
|
951
|
-
if (k === '$lt' || k === '$gt') {
|
|
952
|
-
var enduserValue = (_e = enduser.fields) === null || _e === void 0 ? void 0 : _e[key];
|
|
953
|
-
if (typeof enduserValue !== 'number')
|
|
954
|
-
return false;
|
|
955
|
-
var _v = (typeof v === 'number'
|
|
956
|
-
? v
|
|
957
|
-
: parseInt(v));
|
|
958
|
-
if (isNaN(_v))
|
|
959
|
-
return false;
|
|
960
|
-
return ((k === '$lt' && enduserValue < _v)
|
|
961
|
-
|| (k === '$gt' && enduserValue > _v));
|
|
962
|
-
}
|
|
963
|
-
if (k === '$contains' || k === '$doesNotContain') {
|
|
964
|
-
var enduserValue = ((_g = (_f = enduser.fields) === null || _f === void 0 ? void 0 : _f[key]) !== null && _g !== void 0 ? _g : (0, exports.get_enduser_field_value_for_key)(enduser, key));
|
|
965
|
-
var contains = (Array.isArray(enduserValue)
|
|
966
|
-
? !!enduserValue.find(function (ev) { return typeof ev === 'string' && ev.includes(v); })
|
|
967
|
-
: typeof enduserValue === 'string'
|
|
968
|
-
? enduserValue.includes(v)
|
|
969
|
-
: enduserValue === v);
|
|
970
|
-
return ((k === '$contains' && contains)
|
|
971
|
-
|| (k === '$doesNotContain' && !contains));
|
|
972
|
-
}
|
|
973
|
-
if (k === '$isSet' || k === '$isNotSet') {
|
|
974
|
-
var enduserValue = ((_j = (_h = enduser.fields) === null || _h === void 0 ? void 0 : _h[key]) !== null && _j !== void 0 ? _j : (0, exports.get_enduser_field_value_for_key)(enduser, key));
|
|
975
|
-
var isSet = (Array.isArray(enduserValue)
|
|
976
|
-
? enduserValue.length > 0
|
|
977
|
-
: !!enduserValue);
|
|
978
|
-
return (k === "$isSet" && isSet) || (k === '$isNotSet' && !isSet);
|
|
979
|
-
}
|
|
980
|
-
// should negate the typeof value === 'string' (defaults to $equals) condition
|
|
981
|
-
if (k === '$ne') {
|
|
982
|
-
var enduserValue = ((_l = (_k = enduser.fields) === null || _k === void 0 ? void 0 : _k[key]) !== null && _l !== void 0 ? _l : (0, exports.get_enduser_field_value_for_key)(enduser, key));
|
|
983
|
-
return !(enduserValue === v
|
|
984
|
-
|| (Array.isArray(enduserValue) && (enduserValue).includes(v)));
|
|
985
|
-
}
|
|
986
|
-
return false;
|
|
940
|
+
var _a, _b, _d, _e;
|
|
941
|
+
var height = parseInt(((_b = (_a = enduser.height) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.toString()) || '0');
|
|
942
|
+
var weight = parseInt(((_e = (_d = enduser.weight) === null || _d === void 0 ? void 0 : _d.value) === null || _e === void 0 ? void 0 : _e.toString()) || '0');
|
|
943
|
+
if (!(height && weight))
|
|
944
|
+
return false;
|
|
945
|
+
var bmi = 703 * weight / (height * height);
|
|
946
|
+
var result = ((value === null || value === void 0 ? void 0 : value['$lt']) !== undefined
|
|
947
|
+
? (bmi < parseInt(value['$lt']))
|
|
948
|
+
: (value === null || value === void 0 ? void 0 : value['$gt']) !== undefined
|
|
949
|
+
? (bmi > parseInt(value['$gt']))
|
|
950
|
+
: false);
|
|
951
|
+
return result;
|
|
987
952
|
})()
|
|
988
|
-
: typeof value === 'string'
|
|
989
|
-
? (((
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
953
|
+
: key === 'relationships' && typeof value === 'string'
|
|
954
|
+
? (!!((_a = enduser === null || enduser === void 0 ? void 0 : enduser.relationships) === null || _a === void 0 ? void 0 : _a.find(function (r) { return r.type === (0, constants_1.get_inverse_relationship_type)(value); })))
|
|
955
|
+
: typeof value === 'object'
|
|
956
|
+
? (function () {
|
|
957
|
+
var _a, _b, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
958
|
+
var k = Object.keys(value)[0];
|
|
959
|
+
var v = Object.values(value)[0];
|
|
960
|
+
if (key === 'Journeys' && (k === '$in' || k === '$nin')) {
|
|
961
|
+
var isInJourney = ((_a = enduser === null || enduser === void 0 ? void 0 : enduser.journeys) === null || _a === void 0 ? void 0 : _a[v]) !== undefined;
|
|
962
|
+
return ((k === '$in' && isInJourney)
|
|
963
|
+
|| (k === "$nin" && !isInJourney));
|
|
964
|
+
}
|
|
965
|
+
if (k === '$before' || k === '$after') {
|
|
966
|
+
var vDate = v === '$now' ? new Date() : new Date(v);
|
|
967
|
+
if (isNaN(vDate.getTime()))
|
|
968
|
+
return false;
|
|
969
|
+
var eDateField = (_d = (_b = enduser.fields) === null || _b === void 0 ? void 0 : _b[key]) !== null && _d !== void 0 ? _d : (0, exports.get_enduser_field_value_for_key)(enduser, key);
|
|
970
|
+
if (!eDateField)
|
|
971
|
+
return false;
|
|
972
|
+
if (typeof eDateField !== 'string')
|
|
973
|
+
return false;
|
|
974
|
+
var eDate = ((eDateField.includes('-') && eDateField.length === 10)
|
|
975
|
+
? new Date((0, exports.MM_DD_YYYY_to_YYYY_MM_DD)(eDateField))
|
|
976
|
+
: new Date(eDateField));
|
|
977
|
+
if (isNaN(eDate.getTime()))
|
|
978
|
+
return false;
|
|
979
|
+
return ((k === '$before' && eDate.getTime() < vDate.getTime())
|
|
980
|
+
|| (k === '$after' && eDate.getTime() > vDate.getTime()));
|
|
981
|
+
}
|
|
982
|
+
if (k === '$lt' || k === '$gt') {
|
|
983
|
+
var enduserValue = (_e = enduser.fields) === null || _e === void 0 ? void 0 : _e[key];
|
|
984
|
+
if (typeof enduserValue !== 'number')
|
|
985
|
+
return false;
|
|
986
|
+
var _v = (typeof v === 'number'
|
|
987
|
+
? v
|
|
988
|
+
: parseInt(v));
|
|
989
|
+
if (isNaN(_v))
|
|
990
|
+
return false;
|
|
991
|
+
return ((k === '$lt' && enduserValue < _v)
|
|
992
|
+
|| (k === '$gt' && enduserValue > _v));
|
|
993
|
+
}
|
|
994
|
+
if (k === '$contains' || k === '$doesNotContain') {
|
|
995
|
+
var enduserValue = ((_g = (_f = enduser.fields) === null || _f === void 0 ? void 0 : _f[key]) !== null && _g !== void 0 ? _g : (0, exports.get_enduser_field_value_for_key)(enduser, key));
|
|
996
|
+
var contains = (Array.isArray(enduserValue)
|
|
997
|
+
? !!enduserValue.find(function (ev) { return typeof ev === 'string' && ev.includes(v); })
|
|
998
|
+
: typeof enduserValue === 'string'
|
|
999
|
+
? enduserValue.includes(v)
|
|
1000
|
+
: enduserValue === v);
|
|
1001
|
+
return ((k === '$contains' && contains)
|
|
1002
|
+
|| (k === '$doesNotContain' && !contains));
|
|
1003
|
+
}
|
|
1004
|
+
if (k === '$isSet' || k === '$isNotSet') {
|
|
1005
|
+
var enduserValue = ((_j = (_h = enduser.fields) === null || _h === void 0 ? void 0 : _h[key]) !== null && _j !== void 0 ? _j : (0, exports.get_enduser_field_value_for_key)(enduser, key));
|
|
1006
|
+
var isSet = (Array.isArray(enduserValue)
|
|
1007
|
+
? enduserValue.length > 0
|
|
1008
|
+
: !!enduserValue);
|
|
1009
|
+
return (k === "$isSet" && isSet) || (k === '$isNotSet' && !isSet);
|
|
1010
|
+
}
|
|
1011
|
+
// should negate the typeof value === 'string' (defaults to $equals) condition
|
|
1012
|
+
if (k === '$ne') {
|
|
1013
|
+
var enduserValue = ((_l = (_k = enduser.fields) === null || _k === void 0 ? void 0 : _k[key]) !== null && _l !== void 0 ? _l : (0, exports.get_enduser_field_value_for_key)(enduser, key));
|
|
1014
|
+
return !(enduserValue === v
|
|
1015
|
+
|| (Array.isArray(enduserValue) && (enduserValue).includes(v)));
|
|
1016
|
+
}
|
|
1017
|
+
return false;
|
|
1018
|
+
})()
|
|
1019
|
+
: typeof value === 'string'
|
|
1020
|
+
? (((_d = (_b = enduser.fields) === null || _b === void 0 ? void 0 : _b[key]) !== null && _d !== void 0 ? _d : (0, exports.get_enduser_field_value_for_key)(enduser, key)) === value
|
|
1021
|
+
|| (Array.isArray((_e = enduser.fields) === null || _e === void 0 ? void 0 : _e[key])
|
|
1022
|
+
&& ((_f = enduser === null || enduser === void 0 ? void 0 : enduser.fields) === null || _f === void 0 ? void 0 : _f[key]).includes(value))
|
|
1023
|
+
|| (Array.isArray((0, exports.get_enduser_field_value_for_key)(enduser, key))
|
|
1024
|
+
&& enduser[key].includes(value)))
|
|
1025
|
+
: false);
|
|
995
1026
|
})); };
|
|
996
1027
|
exports.evaluate_conditional_logic_for_enduser_fields = evaluate_conditional_logic_for_enduser_fields;
|
|
1028
|
+
var string_matches_key_or_value = function (value, match) {
|
|
1029
|
+
if (typeof value === 'string') {
|
|
1030
|
+
return value === match;
|
|
1031
|
+
}
|
|
1032
|
+
if (Array.isArray(value)) {
|
|
1033
|
+
return value.find(function (v) { return (0, exports.string_matches_key_or_value)(v, match); }) !== undefined;
|
|
1034
|
+
}
|
|
1035
|
+
if (value && typeof value === 'object') {
|
|
1036
|
+
for (var k in value) {
|
|
1037
|
+
if (k === match)
|
|
1038
|
+
return true;
|
|
1039
|
+
if ((0, exports.string_matches_key_or_value)(value[k], match))
|
|
1040
|
+
return true;
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
return false;
|
|
1044
|
+
};
|
|
1045
|
+
exports.string_matches_key_or_value = string_matches_key_or_value;
|
|
1046
|
+
// console.log(
|
|
1047
|
+
// 'string match test case',
|
|
1048
|
+
// string_matches_key_or_value(
|
|
1049
|
+
// {
|
|
1050
|
+
// $and: [
|
|
1051
|
+
// {
|
|
1052
|
+
// condition: {
|
|
1053
|
+
// __upcomingEvents__: {
|
|
1054
|
+
// $gt: 0,
|
|
1055
|
+
// }
|
|
1056
|
+
// }
|
|
1057
|
+
// }
|
|
1058
|
+
// ]
|
|
1059
|
+
// },
|
|
1060
|
+
// UPCOMING_EVENT_COUNT_KEY,
|
|
1061
|
+
// )
|
|
1062
|
+
// )
|
|
997
1063
|
var getLocalTimezone = function () { return Intl.DateTimeFormat().resolvedOptions().timeZone; };
|
|
998
1064
|
exports.getLocalTimezone = getLocalTimezone;
|
|
999
1065
|
var YYYY_MM_DD_to_MM_DD_YYYY = function (yyyyMmDd, delimiter) {
|
|
@@ -2297,7 +2363,7 @@ exports.INVALID_PREPOPULATION_TYPES = [
|
|
|
2297
2363
|
// now supported
|
|
2298
2364
|
// "Address", // split into different patient fields and non-trivial to pre-load
|
|
2299
2365
|
];
|
|
2300
|
-
var get_prepopulated_responses = function (fields, enduser) { return (fields
|
|
2366
|
+
var get_prepopulated_responses = function (fields, enduser, existingResponses) { return (fields
|
|
2301
2367
|
.filter(function (v) {
|
|
2302
2368
|
var _a;
|
|
2303
2369
|
return (v.prepopulateFromFields && !exports.INVALID_PREPOPULATION_TYPES.includes(v.type) && v.intakeField
|
|
@@ -2316,6 +2382,7 @@ var get_prepopulated_responses = function (fields, enduser) { return (fields
|
|
|
2316
2382
|
fieldDescription: v.description,
|
|
2317
2383
|
fieldHtmlDescription: v.htmlDescription,
|
|
2318
2384
|
sharedWithEnduser: v.sharedWithEnduser,
|
|
2385
|
+
isPrepopulatedFromEnduserField: true,
|
|
2319
2386
|
answer: (v.type === 'Address' && v.intakeField === 'Address')
|
|
2320
2387
|
? {
|
|
2321
2388
|
type: 'Address',
|