@tellescope/sdk 2.0.0-beta.1 → 2.0.0-beta.3
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/CLAUDE.md +24 -0
- package/env.example +6 -0
- package/lib/cjs/sdk.d.ts +375 -4
- package/lib/cjs/sdk.d.ts.map +1 -1
- package/lib/cjs/sdk.js +5 -0
- package/lib/cjs/sdk.js.map +1 -1
- package/lib/cjs/tests/api_tests/ai_conversations.test.d.ts +14 -5
- package/lib/cjs/tests/api_tests/ai_conversations.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/ai_conversations.test.js +163 -149
- package/lib/cjs/tests/api_tests/ai_conversations.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/ai_conversations_agent_message.test.d.ts +22 -0
- package/lib/cjs/tests/api_tests/ai_conversations_agent_message.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/ai_conversations_agent_message.test.js +518 -0
- package/lib/cjs/tests/api_tests/ai_conversations_agent_message.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/appointment_link_expiration.test.d.ts +6 -5
- package/lib/cjs/tests/api_tests/appointment_link_expiration.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/appointment_link_expiration.test.js +135 -73
- package/lib/cjs/tests/api_tests/appointment_link_expiration.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/appointment_no_showed_trigger.test.d.ts +6 -5
- package/lib/cjs/tests/api_tests/appointment_no_showed_trigger.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/appointment_no_showed_trigger.test.js +240 -174
- package/lib/cjs/tests/api_tests/appointment_no_showed_trigger.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/availability_block_buffer.test.d.ts +22 -0
- package/lib/cjs/tests/api_tests/availability_block_buffer.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/availability_block_buffer.test.js +311 -0
- package/lib/cjs/tests/api_tests/availability_block_buffer.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/beluga_manual_sync.test.d.ts +6 -5
- package/lib/cjs/tests/api_tests/beluga_manual_sync.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/beluga_manual_sync.test.js +235 -192
- package/lib/cjs/tests/api_tests/beluga_manual_sync.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/beluga_trigger_refill.test.d.ts +6 -5
- package/lib/cjs/tests/api_tests/beluga_trigger_refill.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/beluga_trigger_refill.test.js +351 -264
- package/lib/cjs/tests/api_tests/beluga_trigger_refill.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/booking_prevent_upcoming_duplicate.test.d.ts +22 -0
- package/lib/cjs/tests/api_tests/booking_prevent_upcoming_duplicate.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/booking_prevent_upcoming_duplicate.test.js +506 -0
- package/lib/cjs/tests/api_tests/booking_prevent_upcoming_duplicate.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/bulk_assignment.test.d.ts +16 -5
- package/lib/cjs/tests/api_tests/bulk_assignment.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/bulk_assignment.test.js +336 -243
- package/lib/cjs/tests/api_tests/bulk_assignment.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/calendar_event_references_update.test.d.ts +13 -5
- package/lib/cjs/tests/api_tests/calendar_event_references_update.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/calendar_event_references_update.test.js +131 -108
- package/lib/cjs/tests/api_tests/calendar_event_references_update.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/calendar_event_webhook_template.test.d.ts +15 -5
- package/lib/cjs/tests/api_tests/calendar_event_webhook_template.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/calendar_event_webhook_template.test.js +240 -252
- package/lib/cjs/tests/api_tests/calendar_event_webhook_template.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/chats_analytics.test.d.ts +14 -5
- package/lib/cjs/tests/api_tests/chats_analytics.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/chats_analytics.test.js +190 -189
- package/lib/cjs/tests/api_tests/chats_analytics.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/concurrent_build_threads.test.d.ts +23 -5
- package/lib/cjs/tests/api_tests/concurrent_build_threads.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/concurrent_build_threads.test.js +121 -118
- package/lib/cjs/tests/api_tests/concurrent_build_threads.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/configurations_public_read.test.d.ts +21 -5
- package/lib/cjs/tests/api_tests/configurations_public_read.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/configurations_public_read.test.js +235 -119
- package/lib/cjs/tests/api_tests/configurations_public_read.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/copied_form_response_no_enduser_sync.test.d.ts +7 -0
- package/lib/cjs/tests/api_tests/copied_form_response_no_enduser_sync.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/copied_form_response_no_enduser_sync.test.js +356 -0
- package/lib/cjs/tests/api_tests/copied_form_response_no_enduser_sync.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/create_note_action.test.d.ts +18 -5
- package/lib/cjs/tests/api_tests/create_note_action.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/create_note_action.test.js +218 -173
- package/lib/cjs/tests/api_tests/create_note_action.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/create_user_notifications_trigger.test.d.ts +17 -4
- package/lib/cjs/tests/api_tests/create_user_notifications_trigger.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/create_user_notifications_trigger.test.js +144 -205
- package/lib/cjs/tests/api_tests/create_user_notifications_trigger.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/custom_aggregation.test.d.ts +15 -5
- package/lib/cjs/tests/api_tests/custom_aggregation.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/custom_aggregation.test.js +284 -223
- package/lib/cjs/tests/api_tests/custom_aggregation.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/database_cascade_delete.test.d.ts +13 -5
- package/lib/cjs/tests/api_tests/database_cascade_delete.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/database_cascade_delete.test.js +218 -242
- package/lib/cjs/tests/api_tests/database_cascade_delete.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/dont_sync_to_elation_form_submission.test.d.ts +21 -5
- package/lib/cjs/tests/api_tests/dont_sync_to_elation_form_submission.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/dont_sync_to_elation_form_submission.test.js +168 -112
- package/lib/cjs/tests/api_tests/dont_sync_to_elation_form_submission.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/elation_user_id.test.d.ts +17 -5
- package/lib/cjs/tests/api_tests/elation_user_id.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/elation_user_id.test.js +121 -54
- package/lib/cjs/tests/api_tests/elation_user_id.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/enduser_fields_sync.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/enduser_fields_sync.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/enduser_fields_sync.test.js +3 -1
- package/lib/cjs/tests/api_tests/enduser_fields_sync.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/enduser_observations_auto_review.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/enduser_observations_auto_review.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/enduser_observations_auto_review.test.js +3 -1
- package/lib/cjs/tests/api_tests/enduser_observations_auto_review.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/file_download_unicode_names.test.d.ts +6 -5
- package/lib/cjs/tests/api_tests/file_download_unicode_names.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/file_download_unicode_names.test.js +193 -143
- package/lib/cjs/tests/api_tests/file_download_unicode_names.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/form_intake_email_normalization.test.d.ts +7 -0
- package/lib/cjs/tests/api_tests/form_intake_email_normalization.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/form_intake_email_normalization.test.js +532 -0
- package/lib/cjs/tests/api_tests/form_intake_email_normalization.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/form_submitted_trigger.test.d.ts +25 -5
- package/lib/cjs/tests/api_tests/form_submitted_trigger.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/form_submitted_trigger.test.js +395 -366
- package/lib/cjs/tests/api_tests/form_submitted_trigger.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/form_translations.test.d.ts +6 -5
- package/lib/cjs/tests/api_tests/form_translations.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/form_translations.test.js +269 -189
- package/lib/cjs/tests/api_tests/form_translations.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/form_vital_reading.test.d.ts +7 -0
- package/lib/cjs/tests/api_tests/form_vital_reading.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/form_vital_reading.test.js +461 -0
- package/lib/cjs/tests/api_tests/form_vital_reading.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/formsort_header_auth.test.d.ts +29 -5
- package/lib/cjs/tests/api_tests/formsort_header_auth.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/formsort_header_auth.test.js +179 -162
- package/lib/cjs/tests/api_tests/formsort_header_auth.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/gcal_sync_retry.test.d.ts +12 -6
- package/lib/cjs/tests/api_tests/gcal_sync_retry.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/gcal_sync_retry.test.js +98 -84
- package/lib/cjs/tests/api_tests/gcal_sync_retry.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/get_some_projection.test.d.ts +20 -5
- package/lib/cjs/tests/api_tests/get_some_projection.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/get_some_projection.test.js +342 -298
- package/lib/cjs/tests/api_tests/get_some_projection.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/group_event_attendee_self_update.test.d.ts +6 -5
- package/lib/cjs/tests/api_tests/group_event_attendee_self_update.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/group_event_attendee_self_update.test.js +294 -223
- package/lib/cjs/tests/api_tests/group_event_attendee_self_update.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/integrations_redacted.test.d.ts +6 -5
- package/lib/cjs/tests/api_tests/integrations_redacted.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/integrations_redacted.test.js +307 -213
- package/lib/cjs/tests/api_tests/integrations_redacted.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/journey_delete_cancels_actions.test.d.ts +6 -5
- package/lib/cjs/tests/api_tests/journey_delete_cancels_actions.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/journey_delete_cancels_actions.test.js +179 -178
- package/lib/cjs/tests/api_tests/journey_delete_cancels_actions.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/journey_statistics_cache.test.d.ts +26 -0
- package/lib/cjs/tests/api_tests/journey_statistics_cache.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/journey_statistics_cache.test.js +232 -0
- package/lib/cjs/tests/api_tests/journey_statistics_cache.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/journey_step_manual_count.test.d.ts +34 -0
- package/lib/cjs/tests/api_tests/journey_step_manual_count.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/journey_step_manual_count.test.js +243 -0
- package/lib/cjs/tests/api_tests/journey_step_manual_count.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/load_team_chat.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/load_team_chat.test.js +181 -124
- package/lib/cjs/tests/api_tests/load_team_chat.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/load_threads_autobuild.test.d.ts +24 -5
- package/lib/cjs/tests/api_tests/load_threads_autobuild.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/load_threads_autobuild.test.js +261 -227
- package/lib/cjs/tests/api_tests/load_threads_autobuild.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/load_threads_care_team.test.d.ts +9 -1
- package/lib/cjs/tests/api_tests/load_threads_care_team.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/load_threads_care_team.test.js +118 -32
- package/lib/cjs/tests/api_tests/load_threads_care_team.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/managed_content_file_access.test.d.ts +15 -5
- package/lib/cjs/tests/api_tests/managed_content_file_access.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/managed_content_file_access.test.js +285 -311
- package/lib/cjs/tests/api_tests/managed_content_file_access.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/mdb_sort.test.d.ts +20 -5
- package/lib/cjs/tests/api_tests/mdb_sort.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/mdb_sort.test.js +361 -305
- package/lib/cjs/tests/api_tests/mdb_sort.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/mdi_manual_sync.test.d.ts +27 -0
- package/lib/cjs/tests/api_tests/mdi_manual_sync.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/mdi_manual_sync.test.js +395 -0
- package/lib/cjs/tests/api_tests/mdi_manual_sync.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/mdi_trigger_refill.test.d.ts +6 -5
- package/lib/cjs/tests/api_tests/mdi_trigger_refill.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/mdi_trigger_refill.test.js +259 -209
- package/lib/cjs/tests/api_tests/mdi_trigger_refill.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/mdi_webhooks.test.d.ts +12 -5
- package/lib/cjs/tests/api_tests/mdi_webhooks.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/mdi_webhooks.test.js +67 -61
- package/lib/cjs/tests/api_tests/mdi_webhooks.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/message_assignment_trigger.test.d.ts +23 -14
- package/lib/cjs/tests/api_tests/message_assignment_trigger.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/message_assignment_trigger.test.js +258 -306
- package/lib/cjs/tests/api_tests/message_assignment_trigger.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/metriport_push_form_response.test.d.ts +6 -5
- package/lib/cjs/tests/api_tests/metriport_push_form_response.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/metriport_push_form_response.test.js +301 -238
- package/lib/cjs/tests/api_tests/metriport_push_form_response.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/organization_api_keys.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/organization_api_keys.test.js +226 -59
- package/lib/cjs/tests/api_tests/organization_api_keys.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/organization_settings_duplicates.test.d.ts +19 -5
- package/lib/cjs/tests/api_tests/organization_settings_duplicates.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/organization_settings_duplicates.test.js +335 -222
- package/lib/cjs/tests/api_tests/organization_settings_duplicates.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/organization_signup.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/organization_signup.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/organization_signup.test.js +221 -52
- package/lib/cjs/tests/api_tests/organization_signup.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/out_of_office_endpoint.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/out_of_office_endpoint.test.js +109 -1
- package/lib/cjs/tests/api_tests/out_of_office_endpoint.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/outbound_chat_sent_trigger.test.d.ts +6 -6
- package/lib/cjs/tests/api_tests/outbound_chat_sent_trigger.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/outbound_chat_sent_trigger.test.js +309 -361
- package/lib/cjs/tests/api_tests/outbound_chat_sent_trigger.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/phone_calls_cold_transfer.test.d.ts +6 -5
- package/lib/cjs/tests/api_tests/phone_calls_cold_transfer.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/phone_calls_cold_transfer.test.js +246 -165
- package/lib/cjs/tests/api_tests/phone_calls_cold_transfer.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/phone_calls_conference_hold.test.d.ts +15 -5
- package/lib/cjs/tests/api_tests/phone_calls_conference_hold.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/phone_calls_conference_hold.test.js +130 -47
- package/lib/cjs/tests/api_tests/phone_calls_conference_hold.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/phone_embed_leave_message.test.d.ts +7 -0
- package/lib/cjs/tests/api_tests/phone_embed_leave_message.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/phone_embed_leave_message.test.js +571 -0
- package/lib/cjs/tests/api_tests/phone_embed_leave_message.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/phone_tree_enduser_condition.test.d.ts +6 -5
- package/lib/cjs/tests/api_tests/phone_tree_enduser_condition.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/phone_tree_enduser_condition.test.js +180 -132
- package/lib/cjs/tests/api_tests/phone_tree_enduser_condition.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/programs.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/programs.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/programs.test.js +474 -51
- package/lib/cjs/tests/api_tests/programs.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/public_form_case_insensitive_match.test.d.ts +7 -0
- package/lib/cjs/tests/api_tests/public_form_case_insensitive_match.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/public_form_case_insensitive_match.test.js +733 -0
- package/lib/cjs/tests/api_tests/public_form_case_insensitive_match.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/security/add-to-journey-foreign-enduserid.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/security/add-to-journey-foreign-enduserid.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/add-to-journey-foreign-enduserid.test.js +3 -1
- package/lib/cjs/tests/api_tests/security/add-to-journey-foreign-enduserid.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/ai-conversations-rbac.test.d.ts +10 -5
- package/lib/cjs/tests/api_tests/security/ai-conversations-rbac.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/ai-conversations-rbac.test.js +401 -282
- package/lib/cjs/tests/api_tests/security/ai-conversations-rbac.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/appointment-reschedule-ownership.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/security/appointment-reschedule-ownership.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/appointment-reschedule-ownership.test.js +3 -1
- package/lib/cjs/tests/api_tests/security/appointment-reschedule-ownership.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/automated-actions-process-gate.test.d.ts +9 -5
- package/lib/cjs/tests/api_tests/security/automated-actions-process-gate.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/automated-actions-process-gate.test.js +228 -211
- package/lib/cjs/tests/api_tests/security/automated-actions-process-gate.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/booking-info-idor-token-mint.test.d.ts +13 -8
- package/lib/cjs/tests/api_tests/security/booking-info-idor-token-mint.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/booking-info-idor-token-mint.test.js +270 -254
- package/lib/cjs/tests/api_tests/security/booking-info-idor-token-mint.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/cascade-role-rename-cross-tenant.test.d.ts +16 -6
- package/lib/cjs/tests/api_tests/security/cascade-role-rename-cross-tenant.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/cascade-role-rename-cross-tenant.test.js +167 -142
- package/lib/cjs/tests/api_tests/security/cascade-role-rename-cross-tenant.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/data-sync-redaction-bypass.test.d.ts +10 -5
- package/lib/cjs/tests/api_tests/security/data-sync-redaction-bypass.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/data-sync-redaction-bypass.test.js +296 -221
- package/lib/cjs/tests/api_tests/security/data-sync-redaction-bypass.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/develop-health-benefit-verification-rbac.test.d.ts +12 -5
- package/lib/cjs/tests/api_tests/security/develop-health-benefit-verification-rbac.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/develop-health-benefit-verification-rbac.test.js +221 -216
- package/lib/cjs/tests/api_tests/security/develop-health-benefit-verification-rbac.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/enduser-ai-summary-trust-gate.test.d.ts +11 -5
- package/lib/cjs/tests/api_tests/security/enduser-ai-summary-trust-gate.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/enduser-ai-summary-trust-gate.test.js +300 -203
- package/lib/cjs/tests/api_tests/security/enduser-ai-summary-trust-gate.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/enduser-cross-create.test.d.ts +11 -5
- package/lib/cjs/tests/api_tests/security/enduser-cross-create.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/enduser-cross-create.test.js +415 -275
- package/lib/cjs/tests/api_tests/security/enduser-cross-create.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/enduser-write-restrictions.test.d.ts +11 -5
- package/lib/cjs/tests/api_tests/security/enduser-write-restrictions.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/enduser-write-restrictions.test.js +347 -228
- package/lib/cjs/tests/api_tests/security/enduser-write-restrictions.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/file-link-session-confinement.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/security/file-link-session-confinement.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/file-link-session-confinement.test.js +3 -1
- package/lib/cjs/tests/api_tests/security/file-link-session-confinement.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/form-logic-js-execution.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/security/form-logic-js-execution.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/form-logic-js-execution.test.js +3 -1
- package/lib/cjs/tests/api_tests/security/form-logic-js-execution.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/formsort_webhook_auth_field_lock.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/formsort_webhook_auth_field_lock.test.js +424 -39
- package/lib/cjs/tests/api_tests/security/formsort_webhook_auth_field_lock.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/globalunique-conflict-redaction.test.d.ts +18 -7
- package/lib/cjs/tests/api_tests/security/globalunique-conflict-redaction.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/globalunique-conflict-redaction.test.js +164 -75
- package/lib/cjs/tests/api_tests/security/globalunique-conflict-redaction.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.d.ts +15 -9
- package/lib/cjs/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.js +99 -102
- package/lib/cjs/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/load-inbox-redaction.test.d.ts +11 -5
- package/lib/cjs/tests/api_tests/security/load-inbox-redaction.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/load-inbox-redaction.test.js +132 -89
- package/lib/cjs/tests/api_tests/security/load-inbox-redaction.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/proxy-image-unauth-ssrf.test.d.ts +12 -5
- package/lib/cjs/tests/api_tests/security/proxy-image-unauth-ssrf.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/proxy-image-unauth-ssrf.test.js +190 -138
- package/lib/cjs/tests/api_tests/security/proxy-image-unauth-ssrf.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/register_business_id_injection.test.d.ts +18 -16
- package/lib/cjs/tests/api_tests/security/register_business_id_injection.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/register_business_id_injection.test.js +164 -124
- package/lib/cjs/tests/api_tests/security/register_business_id_injection.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/rich-text-answer-sanitized-on-write.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/security/rich-text-answer-sanitized-on-write.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/rich-text-answer-sanitized-on-write.test.js +3 -1
- package/lib/cjs/tests/api_tests/security/rich-text-answer-sanitized-on-write.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/sanitize-user-html-with-iframes.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/sanitize-user-html-with-iframes.test.js +122 -2
- package/lib/cjs/tests/api_tests/security/sanitize-user-html-with-iframes.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/schema-adminonly-enforcement.test.d.ts +11 -5
- package/lib/cjs/tests/api_tests/security/schema-adminonly-enforcement.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/schema-adminonly-enforcement.test.js +288 -274
- package/lib/cjs/tests/api_tests/security/schema-adminonly-enforcement.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/self-admin-role-assignment.test.d.ts +17 -10
- package/lib/cjs/tests/api_tests/security/self-admin-role-assignment.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/self-admin-role-assignment.test.js +173 -138
- package/lib/cjs/tests/api_tests/security/self-admin-role-assignment.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.d.ts +6 -5
- package/lib/cjs/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.js +310 -265
- package/lib/cjs/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/webhook-timeout.test.d.ts +9 -5
- package/lib/cjs/tests/api_tests/security/webhook-timeout.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/webhook-timeout.test.js +108 -83
- package/lib/cjs/tests/api_tests/security/webhook-timeout.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/session_for_join_link.test.d.ts +10 -0
- package/lib/cjs/tests/api_tests/session_for_join_link.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/session_for_join_link.test.js +147 -0
- package/lib/cjs/tests/api_tests/session_for_join_link.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/set_fields_order_templates.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/set_fields_order_templates.test.js +191 -88
- package/lib/cjs/tests/api_tests/set_fields_order_templates.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/stedi_approval.test.d.ts +6 -5
- package/lib/cjs/tests/api_tests/stedi_approval.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/stedi_approval.test.js +206 -137
- package/lib/cjs/tests/api_tests/stedi_approval.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/stripe_checkout_items.test.d.ts +17 -0
- package/lib/cjs/tests/api_tests/stripe_checkout_items.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/stripe_checkout_items.test.js +219 -0
- package/lib/cjs/tests/api_tests/stripe_checkout_items.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/stripe_multiple_customer_ids.test.d.ts +5 -0
- package/lib/cjs/tests/api_tests/stripe_multiple_customer_ids.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/stripe_multiple_customer_ids.test.js +396 -0
- package/lib/cjs/tests/api_tests/stripe_multiple_customer_ids.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/ticket_stage_archive.test.d.ts +7 -0
- package/lib/cjs/tests/api_tests/ticket_stage_archive.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/ticket_stage_archive.test.js +344 -0
- package/lib/cjs/tests/api_tests/ticket_stage_archive.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/tickets_bulk_assign_care_team.test.d.ts +6 -5
- package/lib/cjs/tests/api_tests/tickets_bulk_assign_care_team.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/tickets_bulk_assign_care_team.test.js +165 -149
- package/lib/cjs/tests/api_tests/tickets_bulk_assign_care_team.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/tickets_bulk_assign_from_queue.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/tickets_bulk_assign_from_queue.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/tickets_bulk_assign_from_queue.test.js +3 -1
- package/lib/cjs/tests/api_tests/tickets_bulk_assign_from_queue.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/totp_mfa.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/totp_mfa.test.js +37 -31
- package/lib/cjs/tests/api_tests/totp_mfa.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/translations.test.d.ts +6 -5
- package/lib/cjs/tests/api_tests/translations.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/translations.test.js +104 -75
- package/lib/cjs/tests/api_tests/translations.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/trigger_contains_matching.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/trigger_contains_matching.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/trigger_contains_matching.test.js +3 -1
- package/lib/cjs/tests/api_tests/trigger_contains_matching.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/trigger_set_fields_date_difference.test.d.ts +21 -4
- package/lib/cjs/tests/api_tests/trigger_set_fields_date_difference.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/trigger_set_fields_date_difference.test.js +238 -370
- package/lib/cjs/tests/api_tests/trigger_set_fields_date_difference.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/user_logs_restore_deleted.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/user_logs_restore_deleted.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/user_logs_restore_deleted.test.js +3 -1
- package/lib/cjs/tests/api_tests/user_logs_restore_deleted.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/user_preferences.test.d.ts +30 -0
- package/lib/cjs/tests/api_tests/user_preferences.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/user_preferences.test.js +279 -0
- package/lib/cjs/tests/api_tests/user_preferences.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/vital_review_trigger_action.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/vital_review_trigger_action.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/vital_review_trigger_action.test.js +3 -1
- package/lib/cjs/tests/api_tests/vital_review_trigger_action.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/vitl_push.test.d.ts +7 -0
- package/lib/cjs/tests/api_tests/vitl_push.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/vitl_push.test.js +341 -0
- package/lib/cjs/tests/api_tests/vitl_push.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/webhook_error_handling.test.d.ts +17 -5
- package/lib/cjs/tests/api_tests/webhook_error_handling.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/webhook_error_handling.test.js +204 -195
- package/lib/cjs/tests/api_tests/webhook_error_handling.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/webhook_raw_json_number.test.d.ts +15 -5
- package/lib/cjs/tests/api_tests/webhook_raw_json_number.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/webhook_raw_json_number.test.js +154 -179
- package/lib/cjs/tests/api_tests/webhook_raw_json_number.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/welle_partner_token.test.d.ts +6 -5
- package/lib/cjs/tests/api_tests/welle_partner_token.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/welle_partner_token.test.js +393 -251
- package/lib/cjs/tests/api_tests/welle_partner_token.test.js.map +1 -1
- package/lib/cjs/tests/setup_isolated.d.ts +55 -0
- package/lib/cjs/tests/setup_isolated.d.ts.map +1 -1
- package/lib/cjs/tests/setup_isolated.js +119 -1
- package/lib/cjs/tests/setup_isolated.js.map +1 -1
- package/lib/cjs/tests/tests.d.ts.map +1 -1
- package/lib/cjs/tests/tests.js +385 -535
- package/lib/cjs/tests/tests.js.map +1 -1
- package/lib/cjs/tests/unit_tests/date_string_validation.test.d.ts +2 -0
- package/lib/cjs/tests/unit_tests/date_string_validation.test.d.ts.map +1 -0
- package/lib/cjs/tests/unit_tests/date_string_validation.test.js +112 -0
- package/lib/cjs/tests/unit_tests/date_string_validation.test.js.map +1 -0
- package/lib/cjs/tests/unit_tests/isolated_suite_discovery.test.d.ts +2 -0
- package/lib/cjs/tests/unit_tests/isolated_suite_discovery.test.d.ts.map +1 -0
- package/lib/cjs/tests/unit_tests/isolated_suite_discovery.test.js +201 -0
- package/lib/cjs/tests/unit_tests/isolated_suite_discovery.test.js.map +1 -0
- package/lib/cjs/tests/unit_tests/programs_conditional_logic.test.d.ts +3 -0
- package/lib/cjs/tests/unit_tests/programs_conditional_logic.test.d.ts.map +1 -0
- package/lib/cjs/tests/unit_tests/programs_conditional_logic.test.js +120 -0
- package/lib/cjs/tests/unit_tests/programs_conditional_logic.test.js.map +1 -0
- package/lib/cjs/tests/webhooks_tests.js +44 -34
- package/lib/cjs/tests/webhooks_tests.js.map +1 -1
- package/lib/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/lib/esm/sdk.d.ts +375 -4
- package/lib/esm/sdk.d.ts.map +1 -1
- package/lib/esm/sdk.js +5 -0
- package/lib/esm/sdk.js.map +1 -1
- package/lib/esm/tests/api_tests/ai_conversations.test.d.ts +14 -5
- package/lib/esm/tests/api_tests/ai_conversations.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/ai_conversations.test.js +161 -148
- package/lib/esm/tests/api_tests/ai_conversations.test.js.map +1 -1
- package/lib/esm/tests/api_tests/ai_conversations_agent_message.test.d.ts +22 -0
- package/lib/esm/tests/api_tests/ai_conversations_agent_message.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/ai_conversations_agent_message.test.js +510 -0
- package/lib/esm/tests/api_tests/ai_conversations_agent_message.test.js.map +1 -0
- package/lib/esm/tests/api_tests/appointment_link_expiration.test.d.ts +6 -5
- package/lib/esm/tests/api_tests/appointment_link_expiration.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/appointment_link_expiration.test.js +132 -71
- package/lib/esm/tests/api_tests/appointment_link_expiration.test.js.map +1 -1
- package/lib/esm/tests/api_tests/appointment_no_showed_trigger.test.d.ts +6 -5
- package/lib/esm/tests/api_tests/appointment_no_showed_trigger.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/appointment_no_showed_trigger.test.js +238 -173
- package/lib/esm/tests/api_tests/appointment_no_showed_trigger.test.js.map +1 -1
- package/lib/esm/tests/api_tests/availability_block_buffer.test.d.ts +22 -0
- package/lib/esm/tests/api_tests/availability_block_buffer.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/availability_block_buffer.test.js +306 -0
- package/lib/esm/tests/api_tests/availability_block_buffer.test.js.map +1 -0
- package/lib/esm/tests/api_tests/beluga_manual_sync.test.d.ts +6 -5
- package/lib/esm/tests/api_tests/beluga_manual_sync.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/beluga_manual_sync.test.js +232 -190
- package/lib/esm/tests/api_tests/beluga_manual_sync.test.js.map +1 -1
- package/lib/esm/tests/api_tests/beluga_trigger_refill.test.d.ts +6 -5
- package/lib/esm/tests/api_tests/beluga_trigger_refill.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/beluga_trigger_refill.test.js +348 -262
- package/lib/esm/tests/api_tests/beluga_trigger_refill.test.js.map +1 -1
- package/lib/esm/tests/api_tests/booking_prevent_upcoming_duplicate.test.d.ts +22 -0
- package/lib/esm/tests/api_tests/booking_prevent_upcoming_duplicate.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/booking_prevent_upcoming_duplicate.test.js +501 -0
- package/lib/esm/tests/api_tests/booking_prevent_upcoming_duplicate.test.js.map +1 -0
- package/lib/esm/tests/api_tests/bulk_assignment.test.d.ts +16 -5
- package/lib/esm/tests/api_tests/bulk_assignment.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/bulk_assignment.test.js +333 -241
- package/lib/esm/tests/api_tests/bulk_assignment.test.js.map +1 -1
- package/lib/esm/tests/api_tests/calendar_event_references_update.test.d.ts +13 -5
- package/lib/esm/tests/api_tests/calendar_event_references_update.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/calendar_event_references_update.test.js +129 -107
- package/lib/esm/tests/api_tests/calendar_event_references_update.test.js.map +1 -1
- package/lib/esm/tests/api_tests/calendar_event_webhook_template.test.d.ts +15 -5
- package/lib/esm/tests/api_tests/calendar_event_webhook_template.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/calendar_event_webhook_template.test.js +238 -251
- package/lib/esm/tests/api_tests/calendar_event_webhook_template.test.js.map +1 -1
- package/lib/esm/tests/api_tests/chats_analytics.test.d.ts +14 -5
- package/lib/esm/tests/api_tests/chats_analytics.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/chats_analytics.test.js +188 -188
- package/lib/esm/tests/api_tests/chats_analytics.test.js.map +1 -1
- package/lib/esm/tests/api_tests/concurrent_build_threads.test.d.ts +23 -5
- package/lib/esm/tests/api_tests/concurrent_build_threads.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/concurrent_build_threads.test.js +119 -117
- package/lib/esm/tests/api_tests/concurrent_build_threads.test.js.map +1 -1
- package/lib/esm/tests/api_tests/configurations_public_read.test.d.ts +21 -5
- package/lib/esm/tests/api_tests/configurations_public_read.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/configurations_public_read.test.js +233 -118
- package/lib/esm/tests/api_tests/configurations_public_read.test.js.map +1 -1
- package/lib/esm/tests/api_tests/copied_form_response_no_enduser_sync.test.d.ts +7 -0
- package/lib/esm/tests/api_tests/copied_form_response_no_enduser_sync.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/copied_form_response_no_enduser_sync.test.js +351 -0
- package/lib/esm/tests/api_tests/copied_form_response_no_enduser_sync.test.js.map +1 -0
- package/lib/esm/tests/api_tests/create_note_action.test.d.ts +18 -5
- package/lib/esm/tests/api_tests/create_note_action.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/create_note_action.test.js +216 -172
- package/lib/esm/tests/api_tests/create_note_action.test.js.map +1 -1
- package/lib/esm/tests/api_tests/create_user_notifications_trigger.test.d.ts +17 -4
- package/lib/esm/tests/api_tests/create_user_notifications_trigger.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/create_user_notifications_trigger.test.js +141 -203
- package/lib/esm/tests/api_tests/create_user_notifications_trigger.test.js.map +1 -1
- package/lib/esm/tests/api_tests/custom_aggregation.test.d.ts +15 -5
- package/lib/esm/tests/api_tests/custom_aggregation.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/custom_aggregation.test.js +282 -222
- package/lib/esm/tests/api_tests/custom_aggregation.test.js.map +1 -1
- package/lib/esm/tests/api_tests/database_cascade_delete.test.d.ts +13 -5
- package/lib/esm/tests/api_tests/database_cascade_delete.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/database_cascade_delete.test.js +216 -241
- package/lib/esm/tests/api_tests/database_cascade_delete.test.js.map +1 -1
- package/lib/esm/tests/api_tests/dont_sync_to_elation_form_submission.test.d.ts +21 -5
- package/lib/esm/tests/api_tests/dont_sync_to_elation_form_submission.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/dont_sync_to_elation_form_submission.test.js +165 -110
- package/lib/esm/tests/api_tests/dont_sync_to_elation_form_submission.test.js.map +1 -1
- package/lib/esm/tests/api_tests/elation_user_id.test.d.ts +17 -5
- package/lib/esm/tests/api_tests/elation_user_id.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/elation_user_id.test.js +119 -53
- package/lib/esm/tests/api_tests/elation_user_id.test.js.map +1 -1
- package/lib/esm/tests/api_tests/enduser_fields_sync.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/enduser_fields_sync.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/enduser_fields_sync.test.js +2 -0
- package/lib/esm/tests/api_tests/enduser_fields_sync.test.js.map +1 -1
- package/lib/esm/tests/api_tests/enduser_observations_auto_review.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/enduser_observations_auto_review.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/enduser_observations_auto_review.test.js +2 -0
- package/lib/esm/tests/api_tests/enduser_observations_auto_review.test.js.map +1 -1
- package/lib/esm/tests/api_tests/file_download_unicode_names.test.d.ts +6 -5
- package/lib/esm/tests/api_tests/file_download_unicode_names.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/file_download_unicode_names.test.js +190 -141
- package/lib/esm/tests/api_tests/file_download_unicode_names.test.js.map +1 -1
- package/lib/esm/tests/api_tests/form_intake_email_normalization.test.d.ts +7 -0
- package/lib/esm/tests/api_tests/form_intake_email_normalization.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/form_intake_email_normalization.test.js +527 -0
- package/lib/esm/tests/api_tests/form_intake_email_normalization.test.js.map +1 -0
- package/lib/esm/tests/api_tests/form_submitted_trigger.test.d.ts +25 -5
- package/lib/esm/tests/api_tests/form_submitted_trigger.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/form_submitted_trigger.test.js +393 -365
- package/lib/esm/tests/api_tests/form_submitted_trigger.test.js.map +1 -1
- package/lib/esm/tests/api_tests/form_translations.test.d.ts +6 -5
- package/lib/esm/tests/api_tests/form_translations.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/form_translations.test.js +268 -189
- package/lib/esm/tests/api_tests/form_translations.test.js.map +1 -1
- package/lib/esm/tests/api_tests/form_vital_reading.test.d.ts +7 -0
- package/lib/esm/tests/api_tests/form_vital_reading.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/form_vital_reading.test.js +456 -0
- package/lib/esm/tests/api_tests/form_vital_reading.test.js.map +1 -0
- package/lib/esm/tests/api_tests/formsort_header_auth.test.d.ts +29 -5
- package/lib/esm/tests/api_tests/formsort_header_auth.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/formsort_header_auth.test.js +177 -161
- package/lib/esm/tests/api_tests/formsort_header_auth.test.js.map +1 -1
- package/lib/esm/tests/api_tests/gcal_sync_retry.test.d.ts +12 -6
- package/lib/esm/tests/api_tests/gcal_sync_retry.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/gcal_sync_retry.test.js +96 -83
- package/lib/esm/tests/api_tests/gcal_sync_retry.test.js.map +1 -1
- package/lib/esm/tests/api_tests/get_some_projection.test.d.ts +20 -5
- package/lib/esm/tests/api_tests/get_some_projection.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/get_some_projection.test.js +339 -296
- package/lib/esm/tests/api_tests/get_some_projection.test.js.map +1 -1
- package/lib/esm/tests/api_tests/group_event_attendee_self_update.test.d.ts +6 -5
- package/lib/esm/tests/api_tests/group_event_attendee_self_update.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/group_event_attendee_self_update.test.js +292 -222
- package/lib/esm/tests/api_tests/group_event_attendee_self_update.test.js.map +1 -1
- package/lib/esm/tests/api_tests/integrations_redacted.test.d.ts +6 -5
- package/lib/esm/tests/api_tests/integrations_redacted.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/integrations_redacted.test.js +304 -211
- package/lib/esm/tests/api_tests/integrations_redacted.test.js.map +1 -1
- package/lib/esm/tests/api_tests/journey_delete_cancels_actions.test.d.ts +6 -5
- package/lib/esm/tests/api_tests/journey_delete_cancels_actions.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/journey_delete_cancels_actions.test.js +177 -154
- package/lib/esm/tests/api_tests/journey_delete_cancels_actions.test.js.map +1 -1
- package/lib/esm/tests/api_tests/journey_statistics_cache.test.d.ts +26 -0
- package/lib/esm/tests/api_tests/journey_statistics_cache.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/journey_statistics_cache.test.js +227 -0
- package/lib/esm/tests/api_tests/journey_statistics_cache.test.js.map +1 -0
- package/lib/esm/tests/api_tests/journey_step_manual_count.test.d.ts +34 -0
- package/lib/esm/tests/api_tests/journey_step_manual_count.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/journey_step_manual_count.test.js +238 -0
- package/lib/esm/tests/api_tests/journey_step_manual_count.test.js.map +1 -0
- package/lib/esm/tests/api_tests/load_team_chat.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/load_team_chat.test.js +181 -124
- package/lib/esm/tests/api_tests/load_team_chat.test.js.map +1 -1
- package/lib/esm/tests/api_tests/load_threads_autobuild.test.d.ts +24 -5
- package/lib/esm/tests/api_tests/load_threads_autobuild.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/load_threads_autobuild.test.js +259 -226
- package/lib/esm/tests/api_tests/load_threads_autobuild.test.js.map +1 -1
- package/lib/esm/tests/api_tests/load_threads_care_team.test.d.ts +9 -1
- package/lib/esm/tests/api_tests/load_threads_care_team.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/load_threads_care_team.test.js +117 -31
- package/lib/esm/tests/api_tests/load_threads_care_team.test.js.map +1 -1
- package/lib/esm/tests/api_tests/managed_content_file_access.test.d.ts +15 -5
- package/lib/esm/tests/api_tests/managed_content_file_access.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/managed_content_file_access.test.js +283 -287
- package/lib/esm/tests/api_tests/managed_content_file_access.test.js.map +1 -1
- package/lib/esm/tests/api_tests/mdb_sort.test.d.ts +20 -5
- package/lib/esm/tests/api_tests/mdb_sort.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/mdb_sort.test.js +358 -303
- package/lib/esm/tests/api_tests/mdb_sort.test.js.map +1 -1
- package/lib/esm/tests/api_tests/mdi_manual_sync.test.d.ts +27 -0
- package/lib/esm/tests/api_tests/mdi_manual_sync.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/mdi_manual_sync.test.js +390 -0
- package/lib/esm/tests/api_tests/mdi_manual_sync.test.js.map +1 -0
- package/lib/esm/tests/api_tests/mdi_trigger_refill.test.d.ts +6 -5
- package/lib/esm/tests/api_tests/mdi_trigger_refill.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/mdi_trigger_refill.test.js +257 -208
- package/lib/esm/tests/api_tests/mdi_trigger_refill.test.js.map +1 -1
- package/lib/esm/tests/api_tests/mdi_webhooks.test.d.ts +12 -5
- package/lib/esm/tests/api_tests/mdi_webhooks.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/mdi_webhooks.test.js +65 -60
- package/lib/esm/tests/api_tests/mdi_webhooks.test.js.map +1 -1
- package/lib/esm/tests/api_tests/message_assignment_trigger.test.d.ts +23 -14
- package/lib/esm/tests/api_tests/message_assignment_trigger.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/message_assignment_trigger.test.js +256 -305
- package/lib/esm/tests/api_tests/message_assignment_trigger.test.js.map +1 -1
- package/lib/esm/tests/api_tests/metriport_push_form_response.test.d.ts +6 -5
- package/lib/esm/tests/api_tests/metriport_push_form_response.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/metriport_push_form_response.test.js +298 -236
- package/lib/esm/tests/api_tests/metriport_push_form_response.test.js.map +1 -1
- package/lib/esm/tests/api_tests/organization_api_keys.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/organization_api_keys.test.js +226 -59
- package/lib/esm/tests/api_tests/organization_api_keys.test.js.map +1 -1
- package/lib/esm/tests/api_tests/organization_settings_duplicates.test.d.ts +19 -5
- package/lib/esm/tests/api_tests/organization_settings_duplicates.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/organization_settings_duplicates.test.js +332 -220
- package/lib/esm/tests/api_tests/organization_settings_duplicates.test.js.map +1 -1
- package/lib/esm/tests/api_tests/organization_signup.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/organization_signup.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/organization_signup.test.js +220 -51
- package/lib/esm/tests/api_tests/organization_signup.test.js.map +1 -1
- package/lib/esm/tests/api_tests/out_of_office_endpoint.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/out_of_office_endpoint.test.js +109 -1
- package/lib/esm/tests/api_tests/out_of_office_endpoint.test.js.map +1 -1
- package/lib/esm/tests/api_tests/outbound_chat_sent_trigger.test.d.ts +6 -6
- package/lib/esm/tests/api_tests/outbound_chat_sent_trigger.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/outbound_chat_sent_trigger.test.js +308 -361
- package/lib/esm/tests/api_tests/outbound_chat_sent_trigger.test.js.map +1 -1
- package/lib/esm/tests/api_tests/phone_calls_cold_transfer.test.d.ts +6 -5
- package/lib/esm/tests/api_tests/phone_calls_cold_transfer.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/phone_calls_cold_transfer.test.js +243 -163
- package/lib/esm/tests/api_tests/phone_calls_cold_transfer.test.js.map +1 -1
- package/lib/esm/tests/api_tests/phone_calls_conference_hold.test.d.ts +15 -5
- package/lib/esm/tests/api_tests/phone_calls_conference_hold.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/phone_calls_conference_hold.test.js +127 -45
- package/lib/esm/tests/api_tests/phone_calls_conference_hold.test.js.map +1 -1
- package/lib/esm/tests/api_tests/phone_embed_leave_message.test.d.ts +7 -0
- package/lib/esm/tests/api_tests/phone_embed_leave_message.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/phone_embed_leave_message.test.js +566 -0
- package/lib/esm/tests/api_tests/phone_embed_leave_message.test.js.map +1 -0
- package/lib/esm/tests/api_tests/phone_tree_enduser_condition.test.d.ts +6 -5
- package/lib/esm/tests/api_tests/phone_tree_enduser_condition.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/phone_tree_enduser_condition.test.js +177 -130
- package/lib/esm/tests/api_tests/phone_tree_enduser_condition.test.js.map +1 -1
- package/lib/esm/tests/api_tests/programs.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/programs.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/programs.test.js +473 -50
- package/lib/esm/tests/api_tests/programs.test.js.map +1 -1
- package/lib/esm/tests/api_tests/public_form_case_insensitive_match.test.d.ts +7 -0
- package/lib/esm/tests/api_tests/public_form_case_insensitive_match.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/public_form_case_insensitive_match.test.js +728 -0
- package/lib/esm/tests/api_tests/public_form_case_insensitive_match.test.js.map +1 -0
- package/lib/esm/tests/api_tests/security/add-to-journey-foreign-enduserid.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/security/add-to-journey-foreign-enduserid.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/add-to-journey-foreign-enduserid.test.js +2 -0
- package/lib/esm/tests/api_tests/security/add-to-journey-foreign-enduserid.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/ai-conversations-rbac.test.d.ts +10 -5
- package/lib/esm/tests/api_tests/security/ai-conversations-rbac.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/ai-conversations-rbac.test.js +399 -281
- package/lib/esm/tests/api_tests/security/ai-conversations-rbac.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/appointment-reschedule-ownership.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/security/appointment-reschedule-ownership.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/appointment-reschedule-ownership.test.js +2 -0
- package/lib/esm/tests/api_tests/security/appointment-reschedule-ownership.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/automated-actions-process-gate.test.d.ts +9 -5
- package/lib/esm/tests/api_tests/security/automated-actions-process-gate.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/automated-actions-process-gate.test.js +225 -209
- package/lib/esm/tests/api_tests/security/automated-actions-process-gate.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/booking-info-idor-token-mint.test.d.ts +13 -8
- package/lib/esm/tests/api_tests/security/booking-info-idor-token-mint.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/booking-info-idor-token-mint.test.js +268 -253
- package/lib/esm/tests/api_tests/security/booking-info-idor-token-mint.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/cascade-role-rename-cross-tenant.test.d.ts +16 -6
- package/lib/esm/tests/api_tests/security/cascade-role-rename-cross-tenant.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/cascade-role-rename-cross-tenant.test.js +165 -141
- package/lib/esm/tests/api_tests/security/cascade-role-rename-cross-tenant.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/data-sync-redaction-bypass.test.d.ts +10 -5
- package/lib/esm/tests/api_tests/security/data-sync-redaction-bypass.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/data-sync-redaction-bypass.test.js +294 -220
- package/lib/esm/tests/api_tests/security/data-sync-redaction-bypass.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/develop-health-benefit-verification-rbac.test.d.ts +12 -5
- package/lib/esm/tests/api_tests/security/develop-health-benefit-verification-rbac.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/develop-health-benefit-verification-rbac.test.js +219 -215
- package/lib/esm/tests/api_tests/security/develop-health-benefit-verification-rbac.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/enduser-ai-summary-trust-gate.test.d.ts +11 -5
- package/lib/esm/tests/api_tests/security/enduser-ai-summary-trust-gate.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/enduser-ai-summary-trust-gate.test.js +298 -202
- package/lib/esm/tests/api_tests/security/enduser-ai-summary-trust-gate.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/enduser-cross-create.test.d.ts +11 -5
- package/lib/esm/tests/api_tests/security/enduser-cross-create.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/enduser-cross-create.test.js +413 -274
- package/lib/esm/tests/api_tests/security/enduser-cross-create.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/enduser-write-restrictions.test.d.ts +11 -5
- package/lib/esm/tests/api_tests/security/enduser-write-restrictions.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/enduser-write-restrictions.test.js +345 -227
- package/lib/esm/tests/api_tests/security/enduser-write-restrictions.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/file-link-session-confinement.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/security/file-link-session-confinement.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/file-link-session-confinement.test.js +2 -0
- package/lib/esm/tests/api_tests/security/file-link-session-confinement.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/form-logic-js-execution.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/security/form-logic-js-execution.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/form-logic-js-execution.test.js +2 -0
- package/lib/esm/tests/api_tests/security/form-logic-js-execution.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/formsort_webhook_auth_field_lock.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/formsort_webhook_auth_field_lock.test.js +424 -39
- package/lib/esm/tests/api_tests/security/formsort_webhook_auth_field_lock.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/globalunique-conflict-redaction.test.d.ts +18 -7
- package/lib/esm/tests/api_tests/security/globalunique-conflict-redaction.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/globalunique-conflict-redaction.test.js +162 -74
- package/lib/esm/tests/api_tests/security/globalunique-conflict-redaction.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.d.ts +15 -9
- package/lib/esm/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.js +96 -100
- package/lib/esm/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/load-inbox-redaction.test.d.ts +11 -5
- package/lib/esm/tests/api_tests/security/load-inbox-redaction.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/load-inbox-redaction.test.js +129 -87
- package/lib/esm/tests/api_tests/security/load-inbox-redaction.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/proxy-image-unauth-ssrf.test.d.ts +12 -5
- package/lib/esm/tests/api_tests/security/proxy-image-unauth-ssrf.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/proxy-image-unauth-ssrf.test.js +187 -136
- package/lib/esm/tests/api_tests/security/proxy-image-unauth-ssrf.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/register_business_id_injection.test.d.ts +18 -16
- package/lib/esm/tests/api_tests/security/register_business_id_injection.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/register_business_id_injection.test.js +162 -123
- package/lib/esm/tests/api_tests/security/register_business_id_injection.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/rich-text-answer-sanitized-on-write.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/security/rich-text-answer-sanitized-on-write.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/rich-text-answer-sanitized-on-write.test.js +2 -0
- package/lib/esm/tests/api_tests/security/rich-text-answer-sanitized-on-write.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/sanitize-user-html-with-iframes.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/sanitize-user-html-with-iframes.test.js +122 -2
- package/lib/esm/tests/api_tests/security/sanitize-user-html-with-iframes.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/schema-adminonly-enforcement.test.d.ts +11 -5
- package/lib/esm/tests/api_tests/security/schema-adminonly-enforcement.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/schema-adminonly-enforcement.test.js +285 -272
- package/lib/esm/tests/api_tests/security/schema-adminonly-enforcement.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/self-admin-role-assignment.test.d.ts +17 -10
- package/lib/esm/tests/api_tests/security/self-admin-role-assignment.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/self-admin-role-assignment.test.js +171 -137
- package/lib/esm/tests/api_tests/security/self-admin-role-assignment.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.d.ts +6 -5
- package/lib/esm/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.js +307 -263
- package/lib/esm/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/webhook-timeout.test.d.ts +9 -5
- package/lib/esm/tests/api_tests/security/webhook-timeout.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/webhook-timeout.test.js +105 -81
- package/lib/esm/tests/api_tests/security/webhook-timeout.test.js.map +1 -1
- package/lib/esm/tests/api_tests/session_for_join_link.test.d.ts +10 -0
- package/lib/esm/tests/api_tests/session_for_join_link.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/session_for_join_link.test.js +142 -0
- package/lib/esm/tests/api_tests/session_for_join_link.test.js.map +1 -0
- package/lib/esm/tests/api_tests/set_fields_order_templates.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/set_fields_order_templates.test.js +191 -88
- package/lib/esm/tests/api_tests/set_fields_order_templates.test.js.map +1 -1
- package/lib/esm/tests/api_tests/stedi_approval.test.d.ts +6 -5
- package/lib/esm/tests/api_tests/stedi_approval.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/stedi_approval.test.js +204 -136
- package/lib/esm/tests/api_tests/stedi_approval.test.js.map +1 -1
- package/lib/esm/tests/api_tests/stripe_checkout_items.test.d.ts +17 -0
- package/lib/esm/tests/api_tests/stripe_checkout_items.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/stripe_checkout_items.test.js +214 -0
- package/lib/esm/tests/api_tests/stripe_checkout_items.test.js.map +1 -0
- package/lib/esm/tests/api_tests/stripe_multiple_customer_ids.test.d.ts +5 -0
- package/lib/esm/tests/api_tests/stripe_multiple_customer_ids.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/stripe_multiple_customer_ids.test.js +388 -0
- package/lib/esm/tests/api_tests/stripe_multiple_customer_ids.test.js.map +1 -0
- package/lib/esm/tests/api_tests/ticket_stage_archive.test.d.ts +7 -0
- package/lib/esm/tests/api_tests/ticket_stage_archive.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/ticket_stage_archive.test.js +339 -0
- package/lib/esm/tests/api_tests/ticket_stage_archive.test.js.map +1 -0
- package/lib/esm/tests/api_tests/tickets_bulk_assign_care_team.test.d.ts +6 -5
- package/lib/esm/tests/api_tests/tickets_bulk_assign_care_team.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/tickets_bulk_assign_care_team.test.js +162 -147
- package/lib/esm/tests/api_tests/tickets_bulk_assign_care_team.test.js.map +1 -1
- package/lib/esm/tests/api_tests/tickets_bulk_assign_from_queue.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/tickets_bulk_assign_from_queue.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/tickets_bulk_assign_from_queue.test.js +2 -0
- package/lib/esm/tests/api_tests/tickets_bulk_assign_from_queue.test.js.map +1 -1
- package/lib/esm/tests/api_tests/totp_mfa.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/totp_mfa.test.js +37 -31
- package/lib/esm/tests/api_tests/totp_mfa.test.js.map +1 -1
- package/lib/esm/tests/api_tests/translations.test.d.ts +6 -5
- package/lib/esm/tests/api_tests/translations.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/translations.test.js +102 -74
- package/lib/esm/tests/api_tests/translations.test.js.map +1 -1
- package/lib/esm/tests/api_tests/trigger_contains_matching.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/trigger_contains_matching.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/trigger_contains_matching.test.js +2 -0
- package/lib/esm/tests/api_tests/trigger_contains_matching.test.js.map +1 -1
- package/lib/esm/tests/api_tests/trigger_set_fields_date_difference.test.d.ts +21 -4
- package/lib/esm/tests/api_tests/trigger_set_fields_date_difference.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/trigger_set_fields_date_difference.test.js +236 -369
- package/lib/esm/tests/api_tests/trigger_set_fields_date_difference.test.js.map +1 -1
- package/lib/esm/tests/api_tests/user_logs_restore_deleted.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/user_logs_restore_deleted.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/user_logs_restore_deleted.test.js +2 -0
- package/lib/esm/tests/api_tests/user_logs_restore_deleted.test.js.map +1 -1
- package/lib/esm/tests/api_tests/user_preferences.test.d.ts +30 -0
- package/lib/esm/tests/api_tests/user_preferences.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/user_preferences.test.js +274 -0
- package/lib/esm/tests/api_tests/user_preferences.test.js.map +1 -0
- package/lib/esm/tests/api_tests/vital_review_trigger_action.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/vital_review_trigger_action.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/vital_review_trigger_action.test.js +2 -0
- package/lib/esm/tests/api_tests/vital_review_trigger_action.test.js.map +1 -1
- package/lib/esm/tests/api_tests/vitl_push.test.d.ts +7 -0
- package/lib/esm/tests/api_tests/vitl_push.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/vitl_push.test.js +333 -0
- package/lib/esm/tests/api_tests/vitl_push.test.js.map +1 -0
- package/lib/esm/tests/api_tests/webhook_error_handling.test.d.ts +17 -5
- package/lib/esm/tests/api_tests/webhook_error_handling.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/webhook_error_handling.test.js +202 -194
- package/lib/esm/tests/api_tests/webhook_error_handling.test.js.map +1 -1
- package/lib/esm/tests/api_tests/webhook_raw_json_number.test.d.ts +15 -5
- package/lib/esm/tests/api_tests/webhook_raw_json_number.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/webhook_raw_json_number.test.js +152 -178
- package/lib/esm/tests/api_tests/webhook_raw_json_number.test.js.map +1 -1
- package/lib/esm/tests/api_tests/welle_partner_token.test.d.ts +6 -5
- package/lib/esm/tests/api_tests/welle_partner_token.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/welle_partner_token.test.js +391 -250
- package/lib/esm/tests/api_tests/welle_partner_token.test.js.map +1 -1
- package/lib/esm/tests/setup_isolated.d.ts +55 -0
- package/lib/esm/tests/setup_isolated.d.ts.map +1 -1
- package/lib/esm/tests/setup_isolated.js +114 -0
- package/lib/esm/tests/setup_isolated.js.map +1 -1
- package/lib/esm/tests/tests.d.ts.map +1 -1
- package/lib/esm/tests/tests.js +386 -536
- package/lib/esm/tests/tests.js.map +1 -1
- package/lib/esm/tests/unit_tests/date_string_validation.test.d.ts +2 -0
- package/lib/esm/tests/unit_tests/date_string_validation.test.d.ts.map +1 -0
- package/lib/esm/tests/unit_tests/date_string_validation.test.js +108 -0
- package/lib/esm/tests/unit_tests/date_string_validation.test.js.map +1 -0
- package/lib/esm/tests/unit_tests/isolated_suite_discovery.test.d.ts +2 -0
- package/lib/esm/tests/unit_tests/isolated_suite_discovery.test.d.ts.map +1 -0
- package/lib/esm/tests/unit_tests/isolated_suite_discovery.test.js +174 -0
- package/lib/esm/tests/unit_tests/isolated_suite_discovery.test.js.map +1 -0
- package/lib/esm/tests/unit_tests/programs_conditional_logic.test.d.ts +3 -0
- package/lib/esm/tests/unit_tests/programs_conditional_logic.test.d.ts.map +1 -0
- package/lib/esm/tests/unit_tests/programs_conditional_logic.test.js +117 -0
- package/lib/esm/tests/unit_tests/programs_conditional_logic.test.js.map +1 -0
- package/lib/esm/tests/webhooks_tests.js +44 -34
- package/lib/esm/tests/webhooks_tests.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -11
- package/src/sdk.ts +14 -2
- package/src/tests/api_tests/ai_conversations.test.ts +170 -138
- package/src/tests/api_tests/ai_conversations_agent_message.test.ts +491 -0
- package/src/tests/api_tests/appointment_link_expiration.test.ts +94 -35
- package/src/tests/api_tests/appointment_no_showed_trigger.test.ts +181 -128
- package/src/tests/api_tests/availability_block_buffer.test.ts +286 -0
- package/src/tests/api_tests/beluga_manual_sync.test.ts +103 -53
- package/src/tests/api_tests/beluga_trigger_refill.test.ts +131 -46
- package/src/tests/api_tests/booking_prevent_upcoming_duplicate.test.ts +541 -0
- package/src/tests/api_tests/bulk_assignment.test.ts +307 -220
- package/src/tests/api_tests/calendar_event_references_update.test.ts +97 -54
- package/src/tests/api_tests/calendar_event_webhook_template.test.ts +198 -158
- package/src/tests/api_tests/chats_analytics.test.ts +161 -123
- package/src/tests/api_tests/concurrent_build_threads.test.ts +80 -69
- package/src/tests/api_tests/configurations_public_read.test.ts +154 -67
- package/src/tests/api_tests/copied_form_response_no_enduser_sync.test.ts +307 -0
- package/src/tests/api_tests/create_note_action.test.ts +149 -70
- package/src/tests/api_tests/create_user_notifications_trigger.test.ts +116 -144
- package/src/tests/api_tests/custom_aggregation.test.ts +163 -92
- package/src/tests/api_tests/database_cascade_delete.test.ts +101 -87
- package/src/tests/api_tests/dont_sync_to_elation_form_submission.test.ts +122 -51
- package/src/tests/api_tests/elation_user_id.test.ts +105 -42
- package/src/tests/api_tests/enduser_fields_sync.test.ts +4 -0
- package/src/tests/api_tests/enduser_observations_auto_review.test.ts +4 -0
- package/src/tests/api_tests/file_download_unicode_names.test.ts +171 -122
- package/src/tests/api_tests/form_intake_email_normalization.test.ts +489 -0
- package/src/tests/api_tests/form_submitted_trigger.test.ts +152 -86
- package/src/tests/api_tests/form_translations.test.ts +117 -48
- package/src/tests/api_tests/form_vital_reading.test.ts +393 -0
- package/src/tests/api_tests/formsort_header_auth.test.ts +147 -97
- package/src/tests/api_tests/gcal_sync_retry.test.ts +71 -49
- package/src/tests/api_tests/get_some_projection.test.ts +333 -169
- package/src/tests/api_tests/group_event_attendee_self_update.test.ts +103 -52
- package/src/tests/api_tests/integrations_redacted.test.ts +161 -84
- package/src/tests/api_tests/journey_delete_cancels_actions.test.ts +93 -64
- package/src/tests/api_tests/journey_statistics_cache.test.ts +237 -0
- package/src/tests/api_tests/journey_step_manual_count.test.ts +220 -0
- package/src/tests/api_tests/load_team_chat.test.ts +62 -6
- package/src/tests/api_tests/load_threads_autobuild.test.ts +163 -67
- package/src/tests/api_tests/load_threads_care_team.test.ts +107 -0
- package/src/tests/api_tests/managed_content_file_access.test.ts +132 -108
- package/src/tests/api_tests/mdb_sort.test.ts +247 -161
- package/src/tests/api_tests/mdi_manual_sync.test.ts +277 -0
- package/src/tests/api_tests/mdi_trigger_refill.test.ts +132 -78
- package/src/tests/api_tests/mdi_webhooks.test.ts +52 -22
- package/src/tests/api_tests/message_assignment_trigger.test.ts +129 -155
- package/src/tests/api_tests/metriport_push_form_response.test.ts +109 -49
- package/src/tests/api_tests/organization_api_keys.test.ts +170 -2
- package/src/tests/api_tests/organization_settings_duplicates.test.ts +291 -181
- package/src/tests/api_tests/organization_signup.test.ts +174 -5
- package/src/tests/api_tests/out_of_office_endpoint.test.ts +98 -0
- package/src/tests/api_tests/outbound_chat_sent_trigger.test.ts +163 -175
- package/src/tests/api_tests/phone_calls_cold_transfer.test.ts +195 -133
- package/src/tests/api_tests/phone_calls_conference_hold.test.ts +112 -42
- package/src/tests/api_tests/phone_embed_leave_message.test.ts +541 -0
- package/src/tests/api_tests/phone_tree_enduser_condition.test.ts +81 -32
- package/src/tests/api_tests/programs.test.ts +701 -0
- package/src/tests/api_tests/public_form_case_insensitive_match.test.ts +632 -0
- package/src/tests/api_tests/security/add-to-journey-foreign-enduserid.test.ts +4 -0
- package/src/tests/api_tests/security/ai-conversations-rbac.test.ts +248 -128
- package/src/tests/api_tests/security/appointment-reschedule-ownership.test.ts +4 -0
- package/src/tests/api_tests/security/automated-actions-process-gate.test.ts +47 -42
- package/src/tests/api_tests/security/booking-info-idor-token-mint.test.ts +53 -45
- package/src/tests/api_tests/security/cascade-role-rename-cross-tenant.test.ts +100 -73
- package/src/tests/api_tests/security/data-sync-redaction-bypass.test.ts +125 -59
- package/src/tests/api_tests/security/develop-health-benefit-verification-rbac.test.ts +131 -103
- package/src/tests/api_tests/security/enduser-ai-summary-trust-gate.test.ts +161 -68
- package/src/tests/api_tests/security/enduser-cross-create.test.ts +200 -61
- package/src/tests/api_tests/security/enduser-write-restrictions.test.ts +179 -61
- package/src/tests/api_tests/security/file-link-session-confinement.test.ts +4 -0
- package/src/tests/api_tests/security/form-logic-js-execution.test.ts +4 -0
- package/src/tests/api_tests/security/formsort_webhook_auth_field_lock.test.ts +225 -0
- package/src/tests/api_tests/security/globalunique-conflict-redaction.test.ts +163 -44
- package/src/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.ts +78 -70
- package/src/tests/api_tests/security/load-inbox-redaction.test.ts +79 -44
- package/src/tests/api_tests/security/proxy-image-unauth-ssrf.test.ts +95 -52
- package/src/tests/api_tests/security/register_business_id_injection.test.ts +132 -93
- package/src/tests/api_tests/security/rich-text-answer-sanitized-on-write.test.ts +4 -0
- package/src/tests/api_tests/security/sanitize-user-html-with-iframes.test.ts +127 -0
- package/src/tests/api_tests/security/schema-adminonly-enforcement.test.ts +42 -37
- package/src/tests/api_tests/security/self-admin-role-assignment.test.ts +92 -54
- package/src/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.ts +76 -34
- package/src/tests/api_tests/security/webhook-timeout.test.ts +67 -36
- package/src/tests/api_tests/session_for_join_link.test.ts +99 -0
- package/src/tests/api_tests/set_fields_order_templates.test.ts +94 -9
- package/src/tests/api_tests/stedi_approval.test.ts +156 -90
- package/src/tests/api_tests/stripe_checkout_items.test.ts +186 -0
- package/src/tests/api_tests/ticket_stage_archive.test.ts +314 -0
- package/src/tests/api_tests/tickets_bulk_assign_care_team.test.ts +138 -103
- package/src/tests/api_tests/tickets_bulk_assign_from_queue.test.ts +4 -0
- package/src/tests/api_tests/totp_mfa.test.ts +10 -5
- package/src/tests/api_tests/translations.test.ts +69 -46
- package/src/tests/api_tests/trigger_contains_matching.test.ts +4 -0
- package/src/tests/api_tests/trigger_set_fields_date_difference.test.ts +198 -256
- package/src/tests/api_tests/user_logs_restore_deleted.test.ts +4 -0
- package/src/tests/api_tests/user_preferences.test.ts +227 -0
- package/src/tests/api_tests/vital_review_trigger_action.test.ts +455 -0
- package/src/tests/api_tests/vitl_push.test.ts +323 -0
- package/src/tests/api_tests/webhook_error_handling.test.ts +121 -60
- package/src/tests/api_tests/webhook_raw_json_number.test.ts +127 -109
- package/src/tests/api_tests/welle_partner_token.test.ts +217 -90
- package/src/tests/setup_isolated.ts +147 -0
- package/src/tests/tests.ts +165 -177
- package/src/tests/{api_tests → unit_tests}/date_string_validation.test.ts +2 -23
- package/src/tests/unit_tests/isolated_suite_discovery.test.ts +178 -0
- package/src/tests/unit_tests/programs_conditional_logic.test.ts +189 -0
- package/src/tests/webhooks_tests.ts +6 -1
- package/test_generated.pdf +0 -0
|
@@ -0,0 +1,701 @@
|
|
|
1
|
+
require('source-map-support').install();
|
|
2
|
+
|
|
3
|
+
import { EnduserSession } from "../../enduser"
|
|
4
|
+
import { EnduserProgram } from "@tellescope/types-models"
|
|
5
|
+
import {
|
|
6
|
+
assert_checks,
|
|
7
|
+
Check,
|
|
8
|
+
setup_isolated_tenant,
|
|
9
|
+
IsolatedSuite,
|
|
10
|
+
} from "../setup_isolated"
|
|
11
|
+
|
|
12
|
+
const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
13
|
+
|
|
14
|
+
const RAND = () => Math.random().toString(36).slice(2, 10)
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Coverage for the `programs` field on Enduser / EnduserObservation / EnduserOrder, and for the
|
|
18
|
+
* `programs` filter on the Order Status Equals and Vital Update automation triggers.
|
|
19
|
+
*
|
|
20
|
+
* `EnduserOrder.programs` and `EnduserObservation.programs` are lists of `{ name }` objects; the
|
|
21
|
+
* trigger's `info.programs` is a list of names. A trigger matches when the two overlap, and — the part
|
|
22
|
+
* that matters most — a trigger with NO programs filter must keep matching every record, since that is
|
|
23
|
+
* every trigger that exists today.
|
|
24
|
+
*
|
|
25
|
+
* Both handlers apply the filter in JS after loading candidate triggers:
|
|
26
|
+
* - handle_order_status_equals, api/modules/automation_triggers.ts
|
|
27
|
+
* - handle_vital_create, api/v1/event_handlers_v2/vitals.ts
|
|
28
|
+
*
|
|
29
|
+
* This suite provisions its own throwaway tenant. That is not optional here: `vital_configurations`
|
|
30
|
+
* are business-wide (handle_vital_create reads them with `enduserId: { $exists: false }` across the
|
|
31
|
+
* businessId), so running on the shared fixture would classify other concurrently running suites'
|
|
32
|
+
* readings and theirs would bleed into these checks. It never calls `sdk.reset_db()`, which clears
|
|
33
|
+
* global throttle namespaces shared with other suites.
|
|
34
|
+
*
|
|
35
|
+
* Every check gets its own enduser: triggers are throttled to one fire per trigger per enduser per
|
|
36
|
+
* minute, so reusing a patient across checks would silently swallow the second fire.
|
|
37
|
+
*
|
|
38
|
+
* Triggers fire asynchronously. Each check polls for the unfiltered trigger's tag and uses that as the
|
|
39
|
+
* synchronization barrier, then asserts on the filtered trigger's tag. Without the barrier a negative
|
|
40
|
+
* check would pass merely by reading too early.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
const poll_for = async <T,>(get: () => Promise<T>, done: (v: T) => boolean, attempts=20): Promise<T> => {
|
|
44
|
+
let value = await get()
|
|
45
|
+
for (let i = 0; i < attempts && !done(value); i++) {
|
|
46
|
+
await new Promise(resolve => setTimeout(resolve, 250))
|
|
47
|
+
value = await get()
|
|
48
|
+
}
|
|
49
|
+
return value
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const programs_checks = async (): Promise<Check[]> => {
|
|
53
|
+
const checks: Check[] = []
|
|
54
|
+
const record = (label: string, pass: boolean, detail: string) => checks.push({ label, pass, detail })
|
|
55
|
+
|
|
56
|
+
let tenant: Awaited<ReturnType<typeof setup_isolated_tenant>> | undefined
|
|
57
|
+
|
|
58
|
+
try {
|
|
59
|
+
tenant = await setup_isolated_tenant({
|
|
60
|
+
name: `ProgramFilters ${RAND()}`,
|
|
61
|
+
users: [{ isAdmin: true }],
|
|
62
|
+
apiKeys: 0,
|
|
63
|
+
})
|
|
64
|
+
const { sdk } = tenant
|
|
65
|
+
|
|
66
|
+
/* ===================== Enduser.programs ===================== */
|
|
67
|
+
|
|
68
|
+
const programsEnduser = await sdk.api.endusers.createOne({
|
|
69
|
+
fname: 'Programs',
|
|
70
|
+
lname: 'Field',
|
|
71
|
+
email: `programs-field-${RAND()}@tellescope.example`,
|
|
72
|
+
devices: [{ title: 'Cuff', id: `dev-a-${RAND()}` }, { title: 'Scale', id: `dev-b-${RAND()}` }],
|
|
73
|
+
programs: [
|
|
74
|
+
{ name: 'CHF', deviceIds: ['dev-a'], status: 'Active' },
|
|
75
|
+
{ name: 'Diabetes' }, // deviceIds and status are optional
|
|
76
|
+
],
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
const createdPrograms = (await sdk.api.endusers.getOne(programsEnduser.id)).programs
|
|
80
|
+
record(
|
|
81
|
+
'F: Enduser.programs round-trips on create, with and without deviceIds / status',
|
|
82
|
+
createdPrograms?.length === 2
|
|
83
|
+
&& createdPrograms[0].name === 'CHF'
|
|
84
|
+
&& JSON.stringify(createdPrograms[0].deviceIds) === JSON.stringify(['dev-a'])
|
|
85
|
+
&& createdPrograms[0].status === 'Active'
|
|
86
|
+
&& createdPrograms[1].name === 'Diabetes'
|
|
87
|
+
&& createdPrograms[1].deviceIds === undefined
|
|
88
|
+
&& createdPrograms[1].status === undefined,
|
|
89
|
+
`programs=${JSON.stringify(createdPrograms)}`,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
await sdk.api.endusers.updateOne(
|
|
93
|
+
programsEnduser.id,
|
|
94
|
+
{ programs: [{ name: 'CHF', deviceIds: ['dev-a', 'dev-b'] }] },
|
|
95
|
+
{ replaceObjectFields: true },
|
|
96
|
+
)
|
|
97
|
+
const replacedPrograms = (await sdk.api.endusers.getOne(programsEnduser.id)).programs
|
|
98
|
+
record(
|
|
99
|
+
'G: updating programs with replaceObjectFields replaces the whole list',
|
|
100
|
+
replacedPrograms?.length === 1
|
|
101
|
+
&& replacedPrograms[0].name === 'CHF'
|
|
102
|
+
&& JSON.stringify(replacedPrograms[0].deviceIds) === JSON.stringify(['dev-a', 'dev-b']),
|
|
103
|
+
`programs=${JSON.stringify(replacedPrograms)}`,
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
// name carries a non-optional validator inside the object validator, so it is required per item
|
|
107
|
+
let missingNameError = ''
|
|
108
|
+
try {
|
|
109
|
+
await sdk.api.endusers.updateOne(programsEnduser.id, { programs: [{ deviceIds: ['dev-a'] } as any] })
|
|
110
|
+
} catch (err: any) { missingNameError = err?.message ?? String(err) }
|
|
111
|
+
record(
|
|
112
|
+
'H: a program entry without a name is rejected',
|
|
113
|
+
missingNameError.includes('name'),
|
|
114
|
+
`error=${JSON.stringify(missingNameError) || '(none — the write was ACCEPTED)'}`,
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
/* --- programs is staff-only: redacted from enduser sessions, and not enduser-updatable --- */
|
|
118
|
+
|
|
119
|
+
const { authToken } = await sdk.api.endusers.generate_auth_token({ id: programsEnduser.id })
|
|
120
|
+
const enduserSession = new EnduserSession({ host, authToken, businessId: tenant.businessId })
|
|
121
|
+
await enduserSession.refresh_session()
|
|
122
|
+
|
|
123
|
+
const selfRead = await enduserSession.api.endusers.getOne(programsEnduser.id)
|
|
124
|
+
record(
|
|
125
|
+
'I: Enduser.programs is redacted from the enduser\'s own read of their record',
|
|
126
|
+
selfRead.programs === undefined,
|
|
127
|
+
`enduser-session programs=${JSON.stringify(selfRead.programs)}`,
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
let selfUpdateError = ''
|
|
131
|
+
try {
|
|
132
|
+
await enduserSession.api.endusers.updateOne(programsEnduser.id, { programs: [{ name: 'Self Assigned' }] })
|
|
133
|
+
} catch (err: any) { selfUpdateError = err?.message ?? String(err) }
|
|
134
|
+
const afterSelfUpdate = (await sdk.api.endusers.getOne(programsEnduser.id)).programs
|
|
135
|
+
record(
|
|
136
|
+
'J: an enduser cannot update their own programs',
|
|
137
|
+
selfUpdateError.includes('cannot be updated by endusers')
|
|
138
|
+
&& afterSelfUpdate?.length === 1 && afterSelfUpdate[0].name === 'CHF',
|
|
139
|
+
`error=${JSON.stringify(selfUpdateError) || '(none — the write was ACCEPTED)'}`
|
|
140
|
+
+ ` programs=${JSON.stringify(afterSelfUpdate)}`,
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
/* ===================== Order Status Equals ===================== */
|
|
144
|
+
|
|
145
|
+
const ORDER_SOURCE = `ProgramFilterSource${RAND()}`
|
|
146
|
+
|
|
147
|
+
await sdk.api.automation_triggers.createOne({
|
|
148
|
+
event: { type: 'Order Status Equals', info: { source: ORDER_SOURCE, status: 'shipped', programs: ['CHF'] } },
|
|
149
|
+
action: { type: 'Add Tags', info: { tags: ['order-chf'] } },
|
|
150
|
+
status: 'Active',
|
|
151
|
+
title: `Order programs=[CHF] ${RAND()}`,
|
|
152
|
+
})
|
|
153
|
+
// no programs filter — the shape of every trigger that exists today; must match regardless
|
|
154
|
+
await sdk.api.automation_triggers.createOne({
|
|
155
|
+
event: { type: 'Order Status Equals', info: { source: ORDER_SOURCE, status: 'shipped' } },
|
|
156
|
+
action: { type: 'Add Tags', info: { tags: ['order-any'] } },
|
|
157
|
+
status: 'Active',
|
|
158
|
+
title: `Order programs unset ${RAND()}`,
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
const create_order = async (enduserId: string, programs?: { name: string }[]) => (
|
|
162
|
+
sdk.api.enduser_orders.createOne({
|
|
163
|
+
enduserId,
|
|
164
|
+
source: ORDER_SOURCE,
|
|
165
|
+
externalId: `ext-${RAND()}`,
|
|
166
|
+
title: 'Program filter order',
|
|
167
|
+
status: 'shipped',
|
|
168
|
+
...(programs ? { programs } : {}),
|
|
169
|
+
})
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
const tags_after_order = async (programs: { name: string }[] | undefined) => {
|
|
173
|
+
const enduser = await sdk.api.endusers.createOne({ fname: 'Programs', lname: 'Order' })
|
|
174
|
+
await create_order(enduser.id, programs)
|
|
175
|
+
// the unfiltered trigger always fires, so its tag is the barrier that makes an absence meaningful
|
|
176
|
+
const after = await poll_for(
|
|
177
|
+
() => sdk.api.endusers.getOne(enduser.id),
|
|
178
|
+
e => !!e.tags?.includes('order-any'),
|
|
179
|
+
)
|
|
180
|
+
return after.tags ?? []
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const orderMatching = await tags_after_order([{ name: 'CHF' }])
|
|
184
|
+
record(
|
|
185
|
+
'A: Order Status Equals with programs=[CHF] fires for an order in program CHF',
|
|
186
|
+
orderMatching.includes('order-chf') && orderMatching.includes('order-any'),
|
|
187
|
+
`tags=${JSON.stringify(orderMatching)}`,
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
const orderNonMatching = await tags_after_order([{ name: 'Diabetes' }])
|
|
191
|
+
record(
|
|
192
|
+
'B: Order Status Equals with programs=[CHF] does NOT fire for an order in program Diabetes',
|
|
193
|
+
!orderNonMatching.includes('order-chf') && orderNonMatching.includes('order-any'),
|
|
194
|
+
`tags=${JSON.stringify(orderNonMatching)}`,
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
const orderNoPrograms = await tags_after_order(undefined)
|
|
198
|
+
record(
|
|
199
|
+
'C: Order Status Equals with programs=[CHF] does NOT fire for an order with no programs,'
|
|
200
|
+
+ ' while the unfiltered trigger still does (back-compat)',
|
|
201
|
+
!orderNoPrograms.includes('order-chf') && orderNoPrograms.includes('order-any'),
|
|
202
|
+
`tags=${JSON.stringify(orderNoPrograms)}`,
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
/* ===================== Vital Update ===================== */
|
|
206
|
+
|
|
207
|
+
const configuration = await sdk.api.vital_configurations.createOne({
|
|
208
|
+
title: `Program filter SBP ${RAND()}`,
|
|
209
|
+
unit: 'SBP',
|
|
210
|
+
ranges: [
|
|
211
|
+
{
|
|
212
|
+
classification: 'High',
|
|
213
|
+
comparison: { type: 'Greater Than', value: 200 },
|
|
214
|
+
},
|
|
215
|
+
],
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
await sdk.api.automation_triggers.createOne({
|
|
219
|
+
event: {
|
|
220
|
+
type: 'Vital Update',
|
|
221
|
+
info: { configurationIds: [configuration.id], classifications: ['High'], programs: ['CHF'] },
|
|
222
|
+
},
|
|
223
|
+
action: { type: 'Add Tags', info: { tags: ['vital-chf'] } },
|
|
224
|
+
status: 'Active',
|
|
225
|
+
title: `Vital programs=[CHF] ${RAND()}`,
|
|
226
|
+
})
|
|
227
|
+
await sdk.api.automation_triggers.createOne({
|
|
228
|
+
event: {
|
|
229
|
+
type: 'Vital Update',
|
|
230
|
+
info: { configurationIds: [configuration.id], classifications: ['High'] },
|
|
231
|
+
},
|
|
232
|
+
action: { type: 'Add Tags', info: { tags: ['vital-any'] } },
|
|
233
|
+
status: 'Active',
|
|
234
|
+
title: `Vital programs unset ${RAND()}`,
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
const tags_after_reading = async (programs: { name: string }[] | undefined) => {
|
|
238
|
+
const enduser = await sdk.api.endusers.createOne({ fname: 'Programs', lname: 'Vital' })
|
|
239
|
+
await sdk.api.enduser_observations.createOne({
|
|
240
|
+
category: 'vital-signs',
|
|
241
|
+
status: 'final',
|
|
242
|
+
enduserId: enduser.id,
|
|
243
|
+
measurement: { unit: 'SBP', value: 250 }, // High
|
|
244
|
+
timestamp: new Date(),
|
|
245
|
+
...(programs ? { programs } : {}),
|
|
246
|
+
})
|
|
247
|
+
const after = await poll_for(
|
|
248
|
+
() => sdk.api.endusers.getOne(enduser.id),
|
|
249
|
+
e => !!e.tags?.includes('vital-any'),
|
|
250
|
+
)
|
|
251
|
+
return after.tags ?? []
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
const vitalMatching = await tags_after_reading([{ name: 'CHF' }])
|
|
255
|
+
record(
|
|
256
|
+
'D: Vital Update with programs=[CHF] fires for a reading in program CHF',
|
|
257
|
+
vitalMatching.includes('vital-chf') && vitalMatching.includes('vital-any'),
|
|
258
|
+
`tags=${JSON.stringify(vitalMatching)}`,
|
|
259
|
+
)
|
|
260
|
+
|
|
261
|
+
const vitalNonMatching = await tags_after_reading([{ name: 'Diabetes' }])
|
|
262
|
+
record(
|
|
263
|
+
'E: Vital Update with programs=[CHF] does NOT fire for a reading in program Diabetes,'
|
|
264
|
+
+ ' while the unfiltered trigger still does (back-compat)',
|
|
265
|
+
!vitalNonMatching.includes('vital-chf') && vitalNonMatching.includes('vital-any'),
|
|
266
|
+
`tags=${JSON.stringify(vitalNonMatching)}`,
|
|
267
|
+
)
|
|
268
|
+
|
|
269
|
+
/* =============== Programs as a trigger enduserCondition (conditional logic) =============== */
|
|
270
|
+
|
|
271
|
+
// The `Programs` key is evaluated by evaluate_conditional_logic_for_enduser_fields, which is what
|
|
272
|
+
// handle_actions_for_triggers runs every trigger's enduserCondition through. These two checks are the
|
|
273
|
+
// end-to-end proof that a condition built in the UI actually gates a real trigger fire.
|
|
274
|
+
const CONDITION_FIELD = `ProgramConditionKey${RAND()}`
|
|
275
|
+
|
|
276
|
+
await sdk.api.automation_triggers.createOne({
|
|
277
|
+
event: { type: 'Field Equals', info: { field: CONDITION_FIELD, value: 'go' } },
|
|
278
|
+
action: { type: 'Add Tags', info: { tags: ['condition-chf'] } },
|
|
279
|
+
enduserCondition: { $and: [{ condition: { Programs: { $in: 'CHF' } } }] },
|
|
280
|
+
status: 'Active',
|
|
281
|
+
title: `Programs condition Is In CHF ${RAND()}`,
|
|
282
|
+
})
|
|
283
|
+
// the same event with no enduserCondition — the barrier that makes an absence above meaningful
|
|
284
|
+
await sdk.api.automation_triggers.createOne({
|
|
285
|
+
event: { type: 'Field Equals', info: { field: CONDITION_FIELD, value: 'go' } },
|
|
286
|
+
action: { type: 'Add Tags', info: { tags: ['condition-any'] } },
|
|
287
|
+
status: 'Active',
|
|
288
|
+
title: `Programs condition unset ${RAND()}`,
|
|
289
|
+
})
|
|
290
|
+
|
|
291
|
+
// `waitFor` is the tag that makes the read meaningful. For the positive check that is the
|
|
292
|
+
// conditioned trigger's own tag — the two triggers are dispatched by separate awaited calls, so the
|
|
293
|
+
// unconditioned trigger's tag can land first and polling on it alone would read too early. For the
|
|
294
|
+
// negative check, where there is no tag to wait for, the unconditioned trigger is the barrier.
|
|
295
|
+
const tags_after_create = async (programs: EnduserProgram[] | undefined, waitFor: string) => {
|
|
296
|
+
const enduser = await sdk.api.endusers.createOne({
|
|
297
|
+
fname: 'Programs',
|
|
298
|
+
lname: 'Condition',
|
|
299
|
+
fields: { [CONDITION_FIELD]: 'go' },
|
|
300
|
+
...(programs ? { programs } : {}),
|
|
301
|
+
})
|
|
302
|
+
const after = await poll_for(
|
|
303
|
+
() => sdk.api.endusers.getOne(enduser.id),
|
|
304
|
+
e => !!e.tags?.includes(waitFor),
|
|
305
|
+
)
|
|
306
|
+
return after.tags ?? []
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const conditionMatching = await tags_after_create([{ name: 'CHF', status: 'active' }], 'condition-chf')
|
|
310
|
+
record(
|
|
311
|
+
'K: a trigger with a Programs Is In CHF enduserCondition fires for a patient in program CHF',
|
|
312
|
+
conditionMatching.includes('condition-chf') && conditionMatching.includes('condition-any'),
|
|
313
|
+
`tags=${JSON.stringify(conditionMatching)}`,
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
const conditionNonMatching = await tags_after_create(undefined, 'condition-any')
|
|
317
|
+
record(
|
|
318
|
+
'L: the same trigger does NOT fire for a patient with no programs,'
|
|
319
|
+
+ ' while the unconditioned trigger still does',
|
|
320
|
+
!conditionNonMatching.includes('condition-chf') && conditionNonMatching.includes('condition-any'),
|
|
321
|
+
`tags=${JSON.stringify(conditionNonMatching)}`,
|
|
322
|
+
)
|
|
323
|
+
|
|
324
|
+
/* ============ Add / Remove / Update List Item trigger actions ============ */
|
|
325
|
+
|
|
326
|
+
// '$exists' is matched by handle_enduser_field_change for ANY truthy value of the field, so this one
|
|
327
|
+
// trigger is the barrier for every mutation check below, whatever value that check writes. Without a
|
|
328
|
+
// barrier a "nothing happened" assertion would pass merely by reading before the trigger ran.
|
|
329
|
+
const MUTATION_FIELD = `ProgramMutation${RAND()}`
|
|
330
|
+
const PROGRAM = 'CHF'
|
|
331
|
+
|
|
332
|
+
await sdk.api.automation_triggers.createOne({
|
|
333
|
+
event: { type: 'Field Equals', info: { field: MUTATION_FIELD, value: '$exists' } },
|
|
334
|
+
action: { type: 'Add Tags', info: { tags: ['mutation-any'] } },
|
|
335
|
+
status: 'Active',
|
|
336
|
+
title: `Mutation barrier ${RAND()}`,
|
|
337
|
+
})
|
|
338
|
+
await sdk.api.automation_triggers.createOne({
|
|
339
|
+
event: { type: 'Field Equals', info: { field: MUTATION_FIELD, value: 'add' } },
|
|
340
|
+
action: { type: 'Add List Item', info: { field: 'programs', match: { name: PROGRAM }, values: { status: 'Active' } } },
|
|
341
|
+
status: 'Active',
|
|
342
|
+
title: `Add List Item ${RAND()}`,
|
|
343
|
+
})
|
|
344
|
+
await sdk.api.automation_triggers.createOne({
|
|
345
|
+
event: { type: 'Field Equals', info: { field: MUTATION_FIELD, value: 'status' } },
|
|
346
|
+
action: { type: 'Update List Item', info: { field: 'programs', match: { name: PROGRAM }, values: { status: 'Discharged' } } },
|
|
347
|
+
status: 'Active',
|
|
348
|
+
title: `Update List Item ${RAND()}`,
|
|
349
|
+
})
|
|
350
|
+
await sdk.api.automation_triggers.createOne({
|
|
351
|
+
// a BLANK value clears that sub-field, rather than being a no-op — the $unset half of the action
|
|
352
|
+
event: { type: 'Field Equals', info: { field: MUTATION_FIELD, value: 'clear' } },
|
|
353
|
+
action: { type: 'Update List Item', info: { field: 'programs', match: { name: PROGRAM }, values: { status: '' } } },
|
|
354
|
+
status: 'Active',
|
|
355
|
+
title: `Clear List Item status ${RAND()}`,
|
|
356
|
+
})
|
|
357
|
+
await sdk.api.automation_triggers.createOne({
|
|
358
|
+
event: { type: 'Field Equals', info: { field: MUTATION_FIELD, value: 'remove' } },
|
|
359
|
+
action: { type: 'Remove List Item', info: { field: 'programs', match: { name: PROGRAM } } },
|
|
360
|
+
status: 'Active',
|
|
361
|
+
title: `Remove List Item ${RAND()}`,
|
|
362
|
+
})
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* The sub-fields a mutation may touch are ENDUSER_LIST_FIELD_CONFIG's, checked when the trigger is
|
|
366
|
+
* SAVED (an automation_triggers constraint, sharing list_item_mutation_error with the editor).
|
|
367
|
+
*
|
|
368
|
+
* Rejecting here rather than at fire time is the point: an accepted-but-ignored key leaves a
|
|
369
|
+
* trigger that looks configured and silently never does what it says. It is also what keeps a
|
|
370
|
+
* `$`-prefixed or dotted key out of the Mongo paths the action builds from these keys.
|
|
371
|
+
*/
|
|
372
|
+
const save_trigger_error = async (action: any): Promise<string> => {
|
|
373
|
+
try {
|
|
374
|
+
const created = await sdk.api.automation_triggers.createOne({
|
|
375
|
+
event: { type: 'Field Equals', info: { field: `Never${RAND()}`, value: 'never' } },
|
|
376
|
+
action, status: 'Inactive', title: `Rejected ${RAND()}`,
|
|
377
|
+
})
|
|
378
|
+
// it saved; leave nothing behind for the later checks to trip over
|
|
379
|
+
await sdk.api.automation_triggers.deleteOne(created.id)
|
|
380
|
+
return ''
|
|
381
|
+
} catch (err: any) { return err?.message ?? String(err) }
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
const unknownMatchKey = await save_trigger_error({
|
|
385
|
+
type: 'Add List Item', info: { field: 'programs', match: { title: PROGRAM } },
|
|
386
|
+
})
|
|
387
|
+
const unknownValueKey = await save_trigger_error({
|
|
388
|
+
type: 'Update List Item', info: { field: 'programs', match: { name: PROGRAM }, values: { deviceIds: 'x' } },
|
|
389
|
+
})
|
|
390
|
+
const operatorKey = await save_trigger_error({
|
|
391
|
+
type: 'Add List Item', info: { field: 'programs', match: { '$where': PROGRAM } },
|
|
392
|
+
})
|
|
393
|
+
const emptyMatch = await save_trigger_error({
|
|
394
|
+
type: 'Remove List Item', info: { field: 'programs', match: {} },
|
|
395
|
+
})
|
|
396
|
+
const emptyUpdate = await save_trigger_error({
|
|
397
|
+
type: 'Update List Item', info: { field: 'programs', match: { name: PROGRAM }, values: {} },
|
|
398
|
+
})
|
|
399
|
+
const unknownField = await save_trigger_error({
|
|
400
|
+
type: 'Add List Item', info: { field: 'diagnoses', match: { code: 'I50' } },
|
|
401
|
+
})
|
|
402
|
+
record(
|
|
403
|
+
'Y: a list mutation naming a sub-field (or field) outside the registry is rejected ON SAVE,'
|
|
404
|
+
+ ' naming the offending key',
|
|
405
|
+
// the message, not merely "an error": the point of sharing list_item_mutation_error with the
|
|
406
|
+
// editor is that both reject the same action with the same wording, and a rejection for some
|
|
407
|
+
// unrelated reason would pass a non-empty check while proving nothing
|
|
408
|
+
unknownMatchKey.includes('title') && unknownValueKey.includes('deviceIds')
|
|
409
|
+
&& operatorKey.includes('$where') && unknownField.includes('diagnoses'),
|
|
410
|
+
`match=${JSON.stringify(unknownMatchKey)} values=${JSON.stringify(unknownValueKey)}`
|
|
411
|
+
+ ` operator=${JSON.stringify(operatorKey)} field=${JSON.stringify(unknownField)}`,
|
|
412
|
+
)
|
|
413
|
+
record(
|
|
414
|
+
'Z: a list mutation that matches nothing, or an Update that sets nothing, is rejected ON SAVE',
|
|
415
|
+
!!emptyMatch && !!emptyUpdate,
|
|
416
|
+
`emptyMatch=${JSON.stringify(emptyMatch)} emptyUpdate=${JSON.stringify(emptyUpdate)}`,
|
|
417
|
+
)
|
|
418
|
+
|
|
419
|
+
// every check gets its own patient: triggers are throttled to one fire per trigger per enduser per
|
|
420
|
+
// minute, so reusing one would silently swallow the second fire
|
|
421
|
+
const fire_mutation = async (value: string, programs?: EnduserProgram[]) => {
|
|
422
|
+
const enduser = await sdk.api.endusers.createOne({
|
|
423
|
+
fname: 'Programs', lname: 'Mutation', ...(programs ? { programs } : {}),
|
|
424
|
+
})
|
|
425
|
+
// an UPDATE, not a create: the mutation actions are reached through the update path, and Field
|
|
426
|
+
// Equals on programs (below) is update-only
|
|
427
|
+
await sdk.api.endusers.updateOne(enduser.id, { fields: { [MUTATION_FIELD]: value } })
|
|
428
|
+
return enduser.id
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
const programs_once = async (id: string, done: (p: EnduserProgram[]) => boolean, attempts?: number) => (
|
|
432
|
+
(await poll_for(() => sdk.api.endusers.getOne(id), e => done(e.programs ?? []), attempts)).programs ?? []
|
|
433
|
+
)
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* For the checks that assert NOTHING changed. The barrier tag proves trigger processing happened for
|
|
437
|
+
* this patient, but the barrier and the mutation are two triggers dispatched from one loop in
|
|
438
|
+
* whatever order the trigger page came back in, so the tag alone does not prove the mutation already
|
|
439
|
+
* ran. The extra settle closes that window; the positive checks need none of this, since they poll
|
|
440
|
+
* for their own effect.
|
|
441
|
+
*/
|
|
442
|
+
const settled_enduser = async (id: string) => {
|
|
443
|
+
await poll_for(() => sdk.api.endusers.getOne(id), e => !!e.tags?.includes('mutation-any'))
|
|
444
|
+
await new Promise(resolve => setTimeout(resolve, 2000))
|
|
445
|
+
return sdk.api.endusers.getOne(id)
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
const addedId = await fire_mutation('add')
|
|
449
|
+
const added = await programs_once(addedId, p => p.length > 0)
|
|
450
|
+
record(
|
|
451
|
+
'M: Add List Item adds the configured program, with the status the action carries',
|
|
452
|
+
added.length === 1 && added[0].name === PROGRAM && added[0].status === 'Active',
|
|
453
|
+
`programs=${JSON.stringify(added)}`,
|
|
454
|
+
)
|
|
455
|
+
|
|
456
|
+
const duplicateId = await fire_mutation('add', [{ name: PROGRAM, status: 'Discharged' }])
|
|
457
|
+
const afterDuplicate = (await settled_enduser(duplicateId)).programs ?? []
|
|
458
|
+
record(
|
|
459
|
+
'N: Add List Item no-ops when the patient is already in that program, and does NOT reset its status',
|
|
460
|
+
afterDuplicate.length === 1
|
|
461
|
+
&& afterDuplicate[0].name === PROGRAM && afterDuplicate[0].status === 'Discharged',
|
|
462
|
+
`programs=${JSON.stringify(afterDuplicate)}`,
|
|
463
|
+
)
|
|
464
|
+
|
|
465
|
+
// two entries with the same name: the drawer forbids that, but the API and integrations do not, and
|
|
466
|
+
// the action is specified to act on EVERY match rather than the first
|
|
467
|
+
const updatedId = await fire_mutation('status', [
|
|
468
|
+
{ name: PROGRAM, status: 'Active' }, { name: 'Diabetes', status: 'Active' }, { name: PROGRAM },
|
|
469
|
+
])
|
|
470
|
+
const afterUpdate = await programs_once(
|
|
471
|
+
updatedId, p => p.filter(x => x.name === PROGRAM && x.status === 'Discharged').length === 2,
|
|
472
|
+
)
|
|
473
|
+
record(
|
|
474
|
+
'O: Update List Item sets the status on EVERY entry with that name, and on no other entry',
|
|
475
|
+
afterUpdate.length === 3
|
|
476
|
+
&& afterUpdate.filter(p => p.name === PROGRAM && p.status === 'Discharged').length === 2
|
|
477
|
+
&& afterUpdate.find(p => p.name === 'Diabetes')?.status === 'Active',
|
|
478
|
+
`programs=${JSON.stringify(afterUpdate)}`,
|
|
479
|
+
)
|
|
480
|
+
|
|
481
|
+
// the $unset half: a blank value REMOVES the sub-field from every matching entry. Asserted by key
|
|
482
|
+
// presence, not by value: a status written as '' or null would satisfy `status === undefined` in
|
|
483
|
+
// some clients and is not what the action is specified to do.
|
|
484
|
+
const clearedId = await fire_mutation('clear', [
|
|
485
|
+
{ name: PROGRAM, status: 'Active' }, { name: 'Diabetes', status: 'Active' },
|
|
486
|
+
])
|
|
487
|
+
const afterClear = await programs_once(
|
|
488
|
+
clearedId, p => p.some(x => x.name === PROGRAM && x.status === undefined),
|
|
489
|
+
)
|
|
490
|
+
const clearedEntry = afterClear.find(p => p.name === PROGRAM)
|
|
491
|
+
record(
|
|
492
|
+
'AA: Update List Item with a blank value CLEARS that sub-field, leaving no key behind',
|
|
493
|
+
afterClear.length === 2
|
|
494
|
+
&& !!clearedEntry && !('status' in clearedEntry)
|
|
495
|
+
&& afterClear.find(p => p.name === 'Diabetes')?.status === 'Active',
|
|
496
|
+
`programs=${JSON.stringify(afterClear)}`
|
|
497
|
+
+ ` keys=${JSON.stringify(Object.keys(clearedEntry ?? {}))}`,
|
|
498
|
+
)
|
|
499
|
+
|
|
500
|
+
const removedId = await fire_mutation('remove', [
|
|
501
|
+
{ name: PROGRAM }, { name: 'Diabetes', status: 'Active' }, { name: PROGRAM, status: 'Active' },
|
|
502
|
+
])
|
|
503
|
+
const afterRemove = await programs_once(removedId, p => !p.some(x => x.name === PROGRAM))
|
|
504
|
+
record(
|
|
505
|
+
'P: Remove List Item removes EVERY entry with that name, whatever status they hold, and nothing else',
|
|
506
|
+
afterRemove.length === 1 && afterRemove[0].name === 'Diabetes' && afterRemove[0].status === 'Active',
|
|
507
|
+
`programs=${JSON.stringify(afterRemove)}`,
|
|
508
|
+
)
|
|
509
|
+
|
|
510
|
+
const noMatchRemoveId = await fire_mutation('remove', [{ name: 'Diabetes', status: 'Active' }])
|
|
511
|
+
const noMatchUpdateId = await fire_mutation('status', [{ name: 'Diabetes', status: 'Active' }])
|
|
512
|
+
const afterNoMatchRemove = (await settled_enduser(noMatchRemoveId)).programs ?? []
|
|
513
|
+
const afterNoMatchUpdate = (await settled_enduser(noMatchUpdateId)).programs ?? []
|
|
514
|
+
record(
|
|
515
|
+
'Q: Remove and Update List Item both no-op when no entry carries that name',
|
|
516
|
+
JSON.stringify(afterNoMatchRemove) === JSON.stringify([{ name: 'Diabetes', status: 'Active' }])
|
|
517
|
+
&& JSON.stringify(afterNoMatchUpdate) === JSON.stringify([{ name: 'Diabetes', status: 'Active' }]),
|
|
518
|
+
`afterRemove=${JSON.stringify(afterNoMatchRemove)} afterUpdate=${JSON.stringify(afterNoMatchUpdate)}`,
|
|
519
|
+
)
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* The status already being the target one is a no-op too, detected in the $elemMatch filter.
|
|
523
|
+
*
|
|
524
|
+
* Read this as documentation of the invariant, NOT as a regression test: rewriting an identical
|
|
525
|
+
* status leaves a byte-identical record, so this check passes with the $elemMatch reverted to a
|
|
526
|
+
* plain name match. What the filter actually prevents is an updatedAt bump, a webhook and a
|
|
527
|
+
* sync_record push, none of which are observable here — updatedAt cannot be the discriminator
|
|
528
|
+
* because the barrier Add Tags trigger writes to this same patient. The filter's positive
|
|
529
|
+
* direction, which is what a malformed $elemMatch would break, is covered by check O.
|
|
530
|
+
*/
|
|
531
|
+
const alreadyDischargedId = await fire_mutation('status', [{ name: PROGRAM, status: 'Discharged' }])
|
|
532
|
+
const afterAlreadyDischarged = (await settled_enduser(alreadyDischargedId)).programs ?? []
|
|
533
|
+
record(
|
|
534
|
+
'X: Update List Item leaves an entry alone when it already carries the target status',
|
|
535
|
+
JSON.stringify(afterAlreadyDischarged) === JSON.stringify([{ name: PROGRAM, status: 'Discharged' }]),
|
|
536
|
+
`programs=${JSON.stringify(afterAlreadyDischarged)}`,
|
|
537
|
+
)
|
|
538
|
+
|
|
539
|
+
/* ============ Fields Changed on programs, and the no-cascade rule ============ */
|
|
540
|
+
|
|
541
|
+
await sdk.api.automation_triggers.createOne({
|
|
542
|
+
event: { type: 'Fields Changed', info: { fields: ['programs'] } },
|
|
543
|
+
action: { type: 'Add Tags', info: { tags: ['programs-fc'] } },
|
|
544
|
+
status: 'Active',
|
|
545
|
+
title: `Fields Changed programs ${RAND()}`,
|
|
546
|
+
})
|
|
547
|
+
|
|
548
|
+
const fieldsChangedEnduser = await sdk.api.endusers.createOne({ fname: 'Programs', lname: 'Changed' })
|
|
549
|
+
await sdk.api.endusers.updateOne(
|
|
550
|
+
fieldsChangedEnduser.id, { programs: [{ name: PROGRAM }] }, { replaceObjectFields: true },
|
|
551
|
+
)
|
|
552
|
+
const fieldsChangedTags = (await poll_for(
|
|
553
|
+
() => sdk.api.endusers.getOne(fieldsChangedEnduser.id),
|
|
554
|
+
e => !!e.tags?.includes('programs-fc'),
|
|
555
|
+
)).tags ?? []
|
|
556
|
+
record(
|
|
557
|
+
'R: a Fields Changed trigger on programs fires for a direct staff/API write',
|
|
558
|
+
fieldsChangedTags.includes('programs-fc'),
|
|
559
|
+
`tags=${JSON.stringify(fieldsChangedTags)}`,
|
|
560
|
+
)
|
|
561
|
+
|
|
562
|
+
// leaving the LAST program is the case the per-name loop has no name to push for; `programs` must
|
|
563
|
+
// still reach handle_enduser_field_change or this automation goes quiet exactly when a patient is
|
|
564
|
+
// removed from their only program
|
|
565
|
+
const emptiedEnduser = await sdk.api.endusers.createOne({
|
|
566
|
+
fname: 'Programs', lname: 'Emptied', programs: [{ name: PROGRAM, status: 'Active' }],
|
|
567
|
+
})
|
|
568
|
+
await sdk.api.endusers.updateOne(emptiedEnduser.id, { programs: [] }, { replaceObjectFields: true })
|
|
569
|
+
const emptiedTags = (await poll_for(
|
|
570
|
+
() => sdk.api.endusers.getOne(emptiedEnduser.id),
|
|
571
|
+
e => !!e.tags?.includes('programs-fc'),
|
|
572
|
+
)).tags ?? []
|
|
573
|
+
record(
|
|
574
|
+
'W: a Fields Changed trigger on programs still fires when the patient\'s LAST program is removed',
|
|
575
|
+
emptiedTags.includes('programs-fc'),
|
|
576
|
+
`tags=${JSON.stringify(emptiedTags)}`
|
|
577
|
+
+ ` programs=${JSON.stringify((await sdk.api.endusers.getOne(emptiedEnduser.id)).programs)}`,
|
|
578
|
+
)
|
|
579
|
+
|
|
580
|
+
// the same trigger must NOT fire for a program written BY a trigger — handleUpdatedRecord is called
|
|
581
|
+
// with dontUseAutomationTriggers, as Set Fields and Add Tags do
|
|
582
|
+
const cascadeId = await fire_mutation('add')
|
|
583
|
+
await programs_once(cascadeId, p => p.some(x => x.name === PROGRAM)) // the trigger's write landed
|
|
584
|
+
const afterCascade = await settled_enduser(cascadeId)
|
|
585
|
+
record(
|
|
586
|
+
'S: a program written by a trigger does NOT re-fire programs automations (no cascade),'
|
|
587
|
+
+ ' while trigger processing demonstrably ran for this patient',
|
|
588
|
+
!afterCascade.tags?.includes('programs-fc') && !!afterCascade.tags?.includes('mutation-any'),
|
|
589
|
+
`tags=${JSON.stringify(afterCascade.tags)} programs=${JSON.stringify(afterCascade.programs)}`,
|
|
590
|
+
)
|
|
591
|
+
|
|
592
|
+
/* ============ Field Equals on programs ============ */
|
|
593
|
+
|
|
594
|
+
await sdk.api.automation_triggers.createOne({
|
|
595
|
+
event: { type: 'Field Equals', info: { field: 'programs', value: PROGRAM } },
|
|
596
|
+
action: { type: 'Add Tags', info: { tags: ['programs-fe'] } },
|
|
597
|
+
status: 'Active',
|
|
598
|
+
title: `Field Equals programs ${RAND()}`,
|
|
599
|
+
})
|
|
600
|
+
|
|
601
|
+
const fieldEqualsTags = async (programs: EnduserProgram[], waitFor: string) => {
|
|
602
|
+
const enduser = await sdk.api.endusers.createOne({ fname: 'Programs', lname: 'FieldEquals' })
|
|
603
|
+
await sdk.api.endusers.updateOne(enduser.id, { programs }, { replaceObjectFields: true })
|
|
604
|
+
const after = await poll_for(
|
|
605
|
+
() => sdk.api.endusers.getOne(enduser.id),
|
|
606
|
+
e => !!e.tags?.includes(waitFor),
|
|
607
|
+
)
|
|
608
|
+
return after.tags ?? []
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
const feMatching = await fieldEqualsTags([{ name: PROGRAM, status: 'Active' }], 'programs-fe')
|
|
612
|
+
record(
|
|
613
|
+
'T: Field Equals on programs fires for a patient put into a program of that name',
|
|
614
|
+
feMatching.includes('programs-fe'),
|
|
615
|
+
`tags=${JSON.stringify(feMatching)}`,
|
|
616
|
+
)
|
|
617
|
+
|
|
618
|
+
// the Fields Changed trigger above fires for ANY programs write, so it is the barrier here
|
|
619
|
+
const feNonMatching = await fieldEqualsTags([{ name: 'Diabetes' }], 'programs-fc')
|
|
620
|
+
await new Promise(resolve => setTimeout(resolve, 2000))
|
|
621
|
+
record(
|
|
622
|
+
'U: Field Equals on programs does NOT fire for a different program name,'
|
|
623
|
+
+ ' while the Fields Changed trigger on the same write still does',
|
|
624
|
+
!feNonMatching.includes('programs-fe') && feNonMatching.includes('programs-fc'),
|
|
625
|
+
`tags=${JSON.stringify(feNonMatching)}`,
|
|
626
|
+
)
|
|
627
|
+
|
|
628
|
+
/* ============ the bulk-dispatched path ============ */
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Bulk-dispatched events cannot run the list mutations inline — the no-ops are detected in each
|
|
632
|
+
* record's own update filter, which has no bulk equivalent — so bulk_handle_actions_for_triggers
|
|
633
|
+
* defers all three types to the single-record path through `delayed_events`. A type missing from that
|
|
634
|
+
* list is silently dropped AFTER its throttle record is written, which is invisible except here.
|
|
635
|
+
*
|
|
636
|
+
* createSome, not createOne: handle_orders_create only takes the bulk branch for more than one
|
|
637
|
+
* created order; a single create goes to handle_order_status_equals, which is the inline path.
|
|
638
|
+
*
|
|
639
|
+
* The deferral is drained by the WORKER, which polls on an 8s+ cadence, so this is much slower than
|
|
640
|
+
* every other check in this suite and needs a worker running at all.
|
|
641
|
+
*/
|
|
642
|
+
const BULK_SOURCE = `ProgramBulkSource${RAND()}`
|
|
643
|
+
const BULK_PROGRAM = 'Bulk Program'
|
|
644
|
+
|
|
645
|
+
await sdk.api.automation_triggers.createOne({
|
|
646
|
+
event: { type: 'Order Status Equals', info: { source: BULK_SOURCE, status: 'shipped' } },
|
|
647
|
+
action: { type: 'Add List Item', info: { field: 'programs', match: { name: BULK_PROGRAM } } },
|
|
648
|
+
status: 'Active',
|
|
649
|
+
title: `Bulk Add List Item ${RAND()}`,
|
|
650
|
+
})
|
|
651
|
+
|
|
652
|
+
const bulkEndusers = [
|
|
653
|
+
await sdk.api.endusers.createOne({ fname: 'Programs', lname: 'BulkA' }),
|
|
654
|
+
await sdk.api.endusers.createOne({ fname: 'Programs', lname: 'BulkB' }),
|
|
655
|
+
]
|
|
656
|
+
await sdk.api.enduser_orders.createSome(bulkEndusers.map(e => ({
|
|
657
|
+
enduserId: e.id,
|
|
658
|
+
source: BULK_SOURCE,
|
|
659
|
+
externalId: `ext-${RAND()}`,
|
|
660
|
+
title: 'Bulk program order',
|
|
661
|
+
status: 'shipped',
|
|
662
|
+
})))
|
|
663
|
+
|
|
664
|
+
const bulkPrograms = await Promise.all(bulkEndusers.map(e => (
|
|
665
|
+
programs_once(e.id, p => p.some(x => x.name === BULK_PROGRAM), 240) // up to 60s; worker-paced
|
|
666
|
+
)))
|
|
667
|
+
record(
|
|
668
|
+
'V: an Add List Item action dispatched in bulk is deferred to the single-record path and applied'
|
|
669
|
+
+ ' to every patient in the batch',
|
|
670
|
+
bulkPrograms.every(p => p.length === 1 && p[0].name === BULK_PROGRAM),
|
|
671
|
+
`programs=${JSON.stringify(bulkPrograms)} (needs a worker running to drain delayed_events)`,
|
|
672
|
+
)
|
|
673
|
+
} finally {
|
|
674
|
+
// Teardown BEFORE anything asserts — assert calls process.exit, which would strand this tenant.
|
|
675
|
+
if (tenant) { try { await tenant.teardown() } catch (e) { console.error('teardown failed', e) } }
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
return checks
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
/** Asserting wrapper, for standalone runs and for sequential use in the suite. */
|
|
682
|
+
export const programs_tests = async () => {
|
|
683
|
+
assert_checks('Programs', await programs_checks())
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
687
|
+
export const ISOLATED_SUITE: IsolatedSuite = { name: 'Programs', run: programs_checks }
|
|
688
|
+
|
|
689
|
+
// Allow running this test file independently
|
|
690
|
+
if (require.main === module) {
|
|
691
|
+
console.log(`🌐 Using API URL: ${host}`)
|
|
692
|
+
programs_tests()
|
|
693
|
+
.then(() => {
|
|
694
|
+
console.log("✅ Programs test suite completed successfully")
|
|
695
|
+
process.exit(0)
|
|
696
|
+
})
|
|
697
|
+
.catch((error) => {
|
|
698
|
+
console.error("❌ Programs test suite failed:", error)
|
|
699
|
+
process.exit(1)
|
|
700
|
+
})
|
|
701
|
+
}
|