@tellescope/sdk 2.0.0-beta.2 → 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/lib/cjs/sdk.d.ts +6 -5
- 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/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/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/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/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 +6 -0
- 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 +115 -31
- 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.map +1 -1
- package/lib/cjs/tests/api_tests/organization_signup.test.js +218 -51
- 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_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.map +1 -1
- package/lib/cjs/tests/api_tests/programs.test.js +417 -50
- package/lib/cjs/tests/api_tests/programs.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/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/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/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/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/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/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_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_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/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 +7 -0
- package/lib/cjs/tests/setup_isolated.d.ts.map +1 -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 +229 -461
- 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/tsconfig.cjs.tsbuildinfo +1 -1
- package/lib/esm/sdk.d.ts +6 -5
- 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/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/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/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/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 +6 -0
- 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 +115 -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.map +1 -1
- package/lib/esm/tests/api_tests/organization_signup.test.js +218 -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_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.map +1 -1
- package/lib/esm/tests/api_tests/programs.test.js +417 -50
- package/lib/esm/tests/api_tests/programs.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/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/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/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/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/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/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_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_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/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 +7 -0
- package/lib/esm/tests/setup_isolated.d.ts.map +1 -1
- 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 +229 -461
- 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/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/src/sdk.ts +14 -3
- 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/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/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/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/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 +103 -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 +170 -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_tree_enduser_condition.test.ts +81 -32
- package/src/tests/api_tests/programs.test.ts +350 -0
- package/src/tests/api_tests/security/ai-conversations-rbac.test.ts +248 -128
- 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/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/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/stedi_approval.test.ts +156 -90
- 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/translations.test.ts +69 -46
- package/src/tests/api_tests/trigger_set_fields_date_difference.test.ts +198 -256
- package/src/tests/api_tests/user_preferences.test.ts +227 -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 +7 -0
- package/src/tests/tests.ts +41 -147
- package/src/tests/{api_tests → unit_tests}/date_string_validation.test.ts +2 -23
- package/test_generated.pdf +0 -0
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
require('source-map-support').install();
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
assert_checks,
|
|
5
|
+
Check,
|
|
6
|
+
setup_isolated_tenant,
|
|
7
|
+
IsolatedSuite,
|
|
8
|
+
} from "../setup_isolated"
|
|
9
|
+
import { MD_INTEGRATIONS_TITLE } from "@tellescope/constants"
|
|
10
|
+
|
|
11
|
+
const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Manual MD Integrations re-sync — guard coverage.
|
|
15
|
+
* - form_responses.push_to_EHR with target === MD_INTEGRATIONS_TITLE (re-runs create_case)
|
|
16
|
+
* - files.push with destination === MD_INTEGRATIONS_TITLE (attaches one file to an existing case)
|
|
17
|
+
*
|
|
18
|
+
* Nothing here may reach MDI: the payload is patient PHI and there is no HTTP stub. Every assertion
|
|
19
|
+
* stops at a guard that rejects before the first MDI request:
|
|
20
|
+
* - responses are submitted BEFORE the placeholder MDI integration exists, so the automatic
|
|
21
|
+
* create_case on submit finds no integration and skips
|
|
22
|
+
* - the enduser lacks dateOfBirth, so create_case's pre-validation throws before any upload,
|
|
23
|
+
* patient or case request (which is also what this suite checks)
|
|
24
|
+
*
|
|
25
|
+
* Also covers confirm_file_upload's optional mdiFileType (validation only).
|
|
26
|
+
*
|
|
27
|
+
* A failed sync is recorded on FormResponse.mdiSyncError (server-written, read-only via the API);
|
|
28
|
+
* a failure that is only missing demographics creates no background error.
|
|
29
|
+
*
|
|
30
|
+
* Not covered (manual sandbox QA): the "already synced" guards keyed on references (read-only
|
|
31
|
+
* through the API), the successful sync, and mdiSyncError being cleared by it.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
export const mdi_manual_sync_checks = async (): Promise<Check[]> => {
|
|
35
|
+
const checks: Check[] = []
|
|
36
|
+
const record = (label: string, pass: boolean, detail: string) => checks.push({ label, pass, detail })
|
|
37
|
+
|
|
38
|
+
let provisioned: Awaited<ReturnType<typeof setup_isolated_tenant>> | undefined
|
|
39
|
+
|
|
40
|
+
// Resolves to the error message, or '' when the call unexpectedly succeeded
|
|
41
|
+
const errorOf = async (f: () => Promise<any>) => {
|
|
42
|
+
try {
|
|
43
|
+
await f()
|
|
44
|
+
return ''
|
|
45
|
+
} catch (err: any) {
|
|
46
|
+
return (err?.message || err?.toString?.() || JSON.stringify(err)) as string
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
provisioned = await setup_isolated_tenant()
|
|
52
|
+
const { sdk } = provisioned
|
|
53
|
+
|
|
54
|
+
// Every required MDI demographic except dateOfBirth
|
|
55
|
+
const enduser = await sdk.api.endusers.createOne({
|
|
56
|
+
fname: 'Mdi', lname: 'Sync',
|
|
57
|
+
email: `mdi_manual_sync_${Date.now()}@test.tellescope.com`,
|
|
58
|
+
phone: '+15555550123',
|
|
59
|
+
addressLineOne: '1 Main St', city: 'Springfield', state: 'CA', zipCode: '12345',
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
const mdiForm = await sdk.api.forms.createOne({
|
|
63
|
+
title: 'MDI Manual Sync Form',
|
|
64
|
+
mdiCaseOfferings: [{ offering_id: 'test-offering' }],
|
|
65
|
+
})
|
|
66
|
+
const plainForm = await sdk.api.forms.createOne({ title: 'Non-MDI Manual Sync Form' })
|
|
67
|
+
|
|
68
|
+
// A form needs at least one field + a matching answer to be submittable
|
|
69
|
+
const fieldFor = async (formId: string) => sdk.api.form_fields.createOne({
|
|
70
|
+
formId, type: 'string', title: 'Field', previousFields: [{ type: 'root', info: {} }],
|
|
71
|
+
})
|
|
72
|
+
const mdiField = await fieldFor(mdiForm.id)
|
|
73
|
+
const plainField = await fieldFor(plainForm.id)
|
|
74
|
+
|
|
75
|
+
const submit = async (formId: string, fieldId: string) => {
|
|
76
|
+
const { accessCode, response } = await sdk.api.form_responses.prepare_form_response({ enduserId: enduser.id, formId })
|
|
77
|
+
await sdk.api.form_responses.submit_form_response({
|
|
78
|
+
accessCode,
|
|
79
|
+
responses: [{ fieldId, fieldTitle: 'Field', answer: { type: 'string', value: 'x' } }],
|
|
80
|
+
})
|
|
81
|
+
return response.id
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Submitted while no MDI integration exists → the automatic sync skips (no MDI request)
|
|
85
|
+
const plainResponseId = await submit(plainForm.id, plainField.id)
|
|
86
|
+
const mdiResponseId = await submit(mdiForm.id, mdiField.id)
|
|
87
|
+
const mdiStatusResponseId = await submit(mdiForm.id, mdiField.id)
|
|
88
|
+
const { response: draft } = await sdk.api.form_responses.prepare_form_response({ enduserId: enduser.id, formId: mdiForm.id })
|
|
89
|
+
|
|
90
|
+
const pushResponse = (id: string) => () => sdk.api.form_responses.push_to_EHR({ id, target: MD_INTEGRATIONS_TITLE })
|
|
91
|
+
|
|
92
|
+
// ── A. push_to_EHR guards that need no integration ─────────────────────────
|
|
93
|
+
const draftError = await errorOf(pushResponse(draft.id))
|
|
94
|
+
record('A1: an unsubmitted response is rejected', /has not been submitted/i.test(draftError), draftError)
|
|
95
|
+
|
|
96
|
+
const plainError = await errorOf(pushResponse(plainResponseId))
|
|
97
|
+
record('A2: a form without mdiCaseOfferings is rejected as not configured', /not configured for MD Integrations/i.test(plainError), plainError)
|
|
98
|
+
|
|
99
|
+
const noIntegrationError = await errorOf(pushResponse(mdiResponseId))
|
|
100
|
+
record('A3: no MDI integration is rejected', /MD Integrations integration not found/i.test(noIntegrationError), noIntegrationError)
|
|
101
|
+
|
|
102
|
+
// Placeholder integration (same shape as mdi_trigger_refill.test.ts). Only created after every
|
|
103
|
+
// submission above, so no automatic create_case ever saw it.
|
|
104
|
+
await sdk.api.integrations.createOne({
|
|
105
|
+
title: MD_INTEGRATIONS_TITLE,
|
|
106
|
+
authentication: {
|
|
107
|
+
type: 'oauth2',
|
|
108
|
+
info: { access_token: 'test-access-token', refresh_token: 'test-refresh-token', scope: '', token_type: 'Bearer', expiry_date: new Date().getTime() },
|
|
109
|
+
},
|
|
110
|
+
} as any)
|
|
111
|
+
|
|
112
|
+
// ── B. missing demographics fail before anything is sent to MDI ────────────
|
|
113
|
+
const missingDobError = await errorOf(pushResponse(mdiResponseId))
|
|
114
|
+
record(
|
|
115
|
+
'B1: an enduser missing dateOfBirth is rejected, naming the field',
|
|
116
|
+
/missing required fields for MD Integrations/i.test(missingDobError) && /dateOfBirth/.test(missingDobError),
|
|
117
|
+
missingDobError,
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
// Missing demographics are recorded on the response (B3), NOT as a background error, which is
|
|
121
|
+
// kept for real MDI/API failures. createBackgroundError is fire-and-forget, so allow time for a
|
|
122
|
+
// stray insert to land before concluding there is none.
|
|
123
|
+
await new Promise(resolve => setTimeout(resolve, 1500))
|
|
124
|
+
const backgroundErrors = (await sdk.api.background_errors.getSome() ?? [])
|
|
125
|
+
.filter(r => r.title.startsWith('MD Integrations Error') && r.message.includes(mdiResponseId))
|
|
126
|
+
record(
|
|
127
|
+
'B2: a missing-fields failure creates no background error',
|
|
128
|
+
backgroundErrors.length === 0,
|
|
129
|
+
backgroundErrors.length ? backgroundErrors.map(r => r.title).join(', ') : 'none',
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
// The failure is also recorded on the form response itself
|
|
133
|
+
const afterFailure = (await sdk.api.form_responses.getOne(mdiResponseId)).mdiSyncError
|
|
134
|
+
record(
|
|
135
|
+
'B3: the form response records mdiSyncError with the missing fields',
|
|
136
|
+
!!afterFailure
|
|
137
|
+
&& afterFailure.missingFields?.join(',') === 'dateOfBirth'
|
|
138
|
+
&& /dateOfBirth/.test(afterFailure.message)
|
|
139
|
+
&& !!afterFailure.at,
|
|
140
|
+
JSON.stringify(afterFailure),
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
const retryError = await errorOf(pushResponse(mdiResponseId))
|
|
144
|
+
record(
|
|
145
|
+
'B4: the lock is released after a failed sync (a retry reaches validation again)',
|
|
146
|
+
/dateOfBirth/.test(retryError),
|
|
147
|
+
retryError,
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
const afterRetry = (await sdk.api.form_responses.getOne(mdiResponseId)).mdiSyncError
|
|
151
|
+
record(
|
|
152
|
+
'B5: a failed retry refreshes mdiSyncError.at',
|
|
153
|
+
!!afterFailure?.at && !!afterRetry?.at && new Date(afterRetry.at).getTime() > new Date(afterFailure.at).getTime(),
|
|
154
|
+
`first=${afterFailure?.at} retry=${afterRetry?.at}`,
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
// Server-written only: clients must not be able to set or clear it
|
|
158
|
+
const writeError = await errorOf(() => sdk.api.form_responses.updateOne(mdiResponseId, {
|
|
159
|
+
mdiSyncError: { message: 'client-written', at: new Date() },
|
|
160
|
+
} as any))
|
|
161
|
+
const afterWrite = (await sdk.api.form_responses.getOne(mdiResponseId)).mdiSyncError
|
|
162
|
+
record(
|
|
163
|
+
'B6: mdiSyncError cannot be written through the API',
|
|
164
|
+
!!afterWrite && afterWrite.message !== 'client-written',
|
|
165
|
+
writeError || `no error; stored value: ${JSON.stringify(afterWrite)}`,
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
// ── C. a case reported by an MDI webhook (mdiStatus) blocks a retry ────────
|
|
169
|
+
await sdk.api.form_responses.updateOne(mdiStatusResponseId, { mdiStatus: 'Created' })
|
|
170
|
+
const mdiStatusError = await errorOf(pushResponse(mdiStatusResponseId))
|
|
171
|
+
record('C1: a response with mdiStatus is rejected as already having a case', /already has an MD Integrations case/i.test(mdiStatusError), mdiStatusError)
|
|
172
|
+
|
|
173
|
+
const guardOnly = (await sdk.api.form_responses.getOne(mdiStatusResponseId)).mdiSyncError
|
|
174
|
+
record(
|
|
175
|
+
'C2: a request rejected by an endpoint guard records no mdiSyncError',
|
|
176
|
+
!guardOnly,
|
|
177
|
+
JSON.stringify(guardOnly),
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
// ── D. files.push(destination=MDI) guards ──────────────────────────────────
|
|
181
|
+
// File DB records only (prepare_file_upload, no S3 upload): the guards only read the record.
|
|
182
|
+
// prepare_file_upload still signs an S3 upload URL, so the API needs AWS credentials; without
|
|
183
|
+
// them this section records one failing check instead of discarding A–C's results.
|
|
184
|
+
const createFileRecord = async (name: string, source?: string) => (
|
|
185
|
+
(await sdk.api.files.prepare_file_upload({ name, type: 'text/plain', size: 1, enduserId: enduser.id, source })).file
|
|
186
|
+
)
|
|
187
|
+
const pushFile = (id: string) => () => sdk.api.files.push({ id, destination: MD_INTEGRATIONS_TITLE })
|
|
188
|
+
|
|
189
|
+
try {
|
|
190
|
+
const unlinkedFile = await createFileRecord('mdi-unlinked.txt')
|
|
191
|
+
const unlinkedError = await errorOf(pushFile(unlinkedFile.id))
|
|
192
|
+
record('D1: a file with no form response is rejected', /not associated with a form response/i.test(unlinkedError), unlinkedError)
|
|
193
|
+
|
|
194
|
+
const fromMdiFile = await createFileRecord('mdi-inbound.txt', MD_INTEGRATIONS_TITLE)
|
|
195
|
+
await sdk.api.files.updateOne(fromMdiFile.id, { formResponseId: mdiResponseId })
|
|
196
|
+
const fromMdiError = await errorOf(pushFile(fromMdiFile.id))
|
|
197
|
+
record('D2: a file that came from MDI is rejected', /came from MD Integrations/i.test(fromMdiError), fromMdiError)
|
|
198
|
+
|
|
199
|
+
const noCaseFile = await createFileRecord('mdi-no-case.txt')
|
|
200
|
+
await sdk.api.files.updateOne(noCaseFile.id, { formResponseId: mdiResponseId })
|
|
201
|
+
const noCaseError = await errorOf(pushFile(noCaseFile.id))
|
|
202
|
+
record(
|
|
203
|
+
'D3: a file whose form response has no MDI case points to the form-response sync',
|
|
204
|
+
/no MD Integrations case yet/i.test(noCaseError),
|
|
205
|
+
noCaseError,
|
|
206
|
+
)
|
|
207
|
+
} catch (err: any) {
|
|
208
|
+
record(
|
|
209
|
+
'D: files.push guards could not run (prepare_file_upload failed — does the API have AWS credentials?)',
|
|
210
|
+
false,
|
|
211
|
+
err?.message || String(err),
|
|
212
|
+
)
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// ── E. confirm_file_upload's optional mdiFileType (moved from mdi_file_sync.test.ts) ──
|
|
216
|
+
// Validation only. The response has no MDI case and the enduser no MDI patient, so each
|
|
217
|
+
// fire-and-forget sync stops at target resolution, before any MDI request.
|
|
218
|
+
try {
|
|
219
|
+
for (const mdiFileType of ['driver-license', 'face-photo'] as const) {
|
|
220
|
+
const typedFile = await createFileRecord(`${mdiFileType}.jpg`)
|
|
221
|
+
const typedError = await errorOf(() => sdk.api.files.confirm_file_upload({
|
|
222
|
+
id: typedFile.id, syncToMDI: true, formResponseId: mdiResponseId, mdiFileType,
|
|
223
|
+
}))
|
|
224
|
+
record(`E1: confirm_file_upload accepts mdiFileType ${mdiFileType}`, !typedError, typedError || 'accepted')
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const invalidFile = await createFileRecord('invalid.jpg')
|
|
228
|
+
const invalidError = await errorOf(() => sdk.api.files.confirm_file_upload({
|
|
229
|
+
id: invalidFile.id, syncToMDI: true, formResponseId: mdiResponseId, mdiFileType: 'selfie' as any,
|
|
230
|
+
}))
|
|
231
|
+
record('E2: confirm_file_upload rejects an unknown mdiFileType', !!invalidError, invalidError || 'accepted, expected a validation error')
|
|
232
|
+
|
|
233
|
+
const untypedFile = await createFileRecord('untyped.jpg')
|
|
234
|
+
const untypedError = await errorOf(() => sdk.api.files.confirm_file_upload({
|
|
235
|
+
id: untypedFile.id, syncToMDI: true, formResponseId: mdiResponseId,
|
|
236
|
+
}))
|
|
237
|
+
const confirmed = await sdk.api.files.getOne(untypedFile.id)
|
|
238
|
+
record(
|
|
239
|
+
'E3: confirm_file_upload still works without mdiFileType',
|
|
240
|
+
!untypedError && !!confirmed.confirmedAt && confirmed.formResponseId === mdiResponseId,
|
|
241
|
+
untypedError || `confirmedAt=${confirmed.confirmedAt} formResponseId=${confirmed.formResponseId}`,
|
|
242
|
+
)
|
|
243
|
+
} catch (err: any) {
|
|
244
|
+
record(
|
|
245
|
+
'E: mdiFileType checks could not run (prepare_file_upload failed — does the API have AWS credentials?)',
|
|
246
|
+
false,
|
|
247
|
+
err?.message || String(err),
|
|
248
|
+
)
|
|
249
|
+
}
|
|
250
|
+
} finally {
|
|
251
|
+
if (provisioned) { try { await provisioned.teardown() } catch (e) { console.error('teardown failed', e) } }
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return checks
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/** Asserting wrapper, for standalone runs and for sequential use in the suite. */
|
|
258
|
+
export const mdi_manual_sync_tests = async () => {
|
|
259
|
+
assert_checks('MD Integrations manual sync', await mdi_manual_sync_checks())
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
263
|
+
export const ISOLATED_SUITE: IsolatedSuite = { name: 'MD Integrations manual sync', run: mdi_manual_sync_checks }
|
|
264
|
+
|
|
265
|
+
// Allow running this test file independently
|
|
266
|
+
if (require.main === module) {
|
|
267
|
+
console.log(`🌐 Using API URL: ${host}`)
|
|
268
|
+
mdi_manual_sync_tests()
|
|
269
|
+
.then(() => {
|
|
270
|
+
console.log("✅ MD Integrations manual sync test suite completed successfully")
|
|
271
|
+
process.exit(0)
|
|
272
|
+
})
|
|
273
|
+
.catch((error) => {
|
|
274
|
+
console.error("❌ MD Integrations manual sync test suite failed:", error)
|
|
275
|
+
process.exit(1)
|
|
276
|
+
})
|
|
277
|
+
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
require('source-map-support').install();
|
|
2
2
|
|
|
3
|
-
import { Session } from "../../sdk"
|
|
4
|
-
import {
|
|
5
|
-
async_test,
|
|
6
|
-
log_header,
|
|
7
|
-
passOnAnyResult,
|
|
8
|
-
} from "@tellescope/testing"
|
|
9
3
|
import { MD_INTEGRATIONS_TITLE } from "@tellescope/constants"
|
|
10
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
assert_checks,
|
|
6
|
+
Check,
|
|
7
|
+
IsolatedSuite,
|
|
8
|
+
setup_isolated_tenant,
|
|
9
|
+
} from "../setup_isolated"
|
|
11
10
|
|
|
12
11
|
const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
13
12
|
|
|
13
|
+
const RAND = () => Math.random().toString(36).slice(2, 10)
|
|
14
|
+
|
|
14
15
|
// MDI Trigger Refill journey action tests.
|
|
15
16
|
//
|
|
16
17
|
// Validator-acceptance plus handler-guard coverage: verifies that automation steps configured
|
|
@@ -19,9 +20,66 @@ const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
|
19
20
|
// integration, missing patient reference) — no sandbox credentials needed. The happy path
|
|
20
21
|
// (fetch cases -> find scheduled orders -> submit) requires an MDI sandbox with a
|
|
21
22
|
// Direct-to-Pharmacy refill sequence and is covered by manual QA.
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
//
|
|
24
|
+
// Runs on its own provisioned tenant, which is what makes both handler guards reliable: a fresh
|
|
25
|
+
// tenant never holds an MD Integrations integration, so the missing-integration guard is always
|
|
26
|
+
// exercised and the placeholder integration is always created afterwards. On the shared fixture the
|
|
27
|
+
// suite probed for an existing integration first and silently skipped one or both checks when the
|
|
28
|
+
// org already had one — a skip reports green without asserting anything.
|
|
29
|
+
export const mdi_trigger_refill_checks = async (): Promise<Check[]> => {
|
|
30
|
+
const checks: Check[] = []
|
|
31
|
+
const record = (label: string, pass: boolean, detail: string) => checks.push({ label, pass, detail })
|
|
32
|
+
|
|
33
|
+
// The raw value decides the fallback, not JSON.stringify of it — JSON.stringify('') is '""',
|
|
34
|
+
// which is truthy, so a `|| fallback` on the stringified form could never fire.
|
|
35
|
+
const describe = (value: any): string => {
|
|
36
|
+
if (value === undefined || value === null) return String(value)
|
|
37
|
+
const stringified = JSON.stringify(value)
|
|
38
|
+
return stringified === undefined ? String(value) : stringified
|
|
39
|
+
}
|
|
40
|
+
const errorMessage = (e: any): string => (
|
|
41
|
+
typeof e?.message === 'string' && e.message !== '' ? e.message : describe(e)
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The async_test({ onResult }) equivalent, as a soft Check: a call that REJECTS is a failure
|
|
46
|
+
* (async_test treats it the same way), and a resolved call passes only when onResult agrees.
|
|
47
|
+
*
|
|
48
|
+
* The call and the predicate are caught separately, so a predicate that throws fails THIS check
|
|
49
|
+
* with its own detail instead of being misreported as an API rejection — and never escapes `run`,
|
|
50
|
+
* which would fail the whole run once the batch settles rather than failing one check.
|
|
51
|
+
*/
|
|
52
|
+
const expect_result = async <T,>(label: string, fn: () => Promise<T>, onResult: (r: T) => boolean) => {
|
|
53
|
+
let resolved: { value: T }
|
|
54
|
+
try {
|
|
55
|
+
resolved = { value: await fn() }
|
|
56
|
+
} catch (e: any) {
|
|
57
|
+
record(label, false, `rejected instead of resolving: ${errorMessage(e)}`)
|
|
58
|
+
return
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const { value } = resolved
|
|
62
|
+
try {
|
|
63
|
+
record(label, onResult(value), `result=${describe(value)}`)
|
|
64
|
+
} catch (predicateError: any) {
|
|
65
|
+
record(label, false, `predicate threw on result=${describe(value)}: ${errorMessage(predicateError)}`)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
24
68
|
|
|
69
|
+
/**
|
|
70
|
+
* The async_test({ shouldError: true, onError: () => true }) equivalent: a call that RESOLVES is a
|
|
71
|
+
* failure (async_test treats it the same way), and any rejection passes.
|
|
72
|
+
*/
|
|
73
|
+
const expect_rejected = async (label: string, fn: () => Promise<any>) => {
|
|
74
|
+
try {
|
|
75
|
+
const unexpected = await fn()
|
|
76
|
+
record(label, false, `resolved instead of rejecting; result=${describe(unexpected)}`)
|
|
77
|
+
} catch (e: any) {
|
|
78
|
+
record(label, true, `rejected with ${errorMessage(e)}`)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
let tenant: Awaited<ReturnType<typeof setup_isolated_tenant>> | undefined
|
|
25
83
|
let journeyId: string | undefined
|
|
26
84
|
const stepIds: string[] = []
|
|
27
85
|
const automatedActionIds: string[] = []
|
|
@@ -29,11 +87,18 @@ export const mdi_trigger_refill_tests = async ({ sdk, sdkNonAdmin }: { sdk: Sess
|
|
|
29
87
|
let createdMDIIntegrationId: string | undefined
|
|
30
88
|
|
|
31
89
|
try {
|
|
90
|
+
tenant = await setup_isolated_tenant({
|
|
91
|
+
name: `MDI trigger refill ${RAND()}`,
|
|
92
|
+
users: [{ isAdmin: true }],
|
|
93
|
+
apiKeys: 0,
|
|
94
|
+
})
|
|
95
|
+
const { sdk } = tenant
|
|
96
|
+
|
|
32
97
|
const journey = await sdk.api.journeys.createOne({ title: 'MDI Trigger Refill Test Journey' })
|
|
33
98
|
journeyId = journey.id
|
|
34
99
|
|
|
35
100
|
// Full config accepted
|
|
36
|
-
await
|
|
101
|
+
await expect_result(
|
|
37
102
|
"mdiTriggerRefill step accepted (onlySubmitWhenDue)",
|
|
38
103
|
() => sdk.api.automation_steps.createOne({
|
|
39
104
|
journeyId: journey.id,
|
|
@@ -43,11 +108,11 @@ export const mdi_trigger_refill_tests = async ({ sdk, sdkNonAdmin }: { sdk: Sess
|
|
|
43
108
|
info: { onlySubmitWhenDue: true },
|
|
44
109
|
},
|
|
45
110
|
}).then(s => { stepIds.push(s.id); return s }),
|
|
46
|
-
|
|
111
|
+
() => true,
|
|
47
112
|
)
|
|
48
113
|
|
|
49
114
|
// Empty info accepted (all fields optional)
|
|
50
|
-
await
|
|
115
|
+
await expect_result(
|
|
51
116
|
"mdiTriggerRefill step accepted (empty info)",
|
|
52
117
|
() => sdk.api.automation_steps.createOne({
|
|
53
118
|
journeyId: journey.id,
|
|
@@ -57,11 +122,11 @@ export const mdi_trigger_refill_tests = async ({ sdk, sdkNonAdmin }: { sdk: Sess
|
|
|
57
122
|
info: {},
|
|
58
123
|
},
|
|
59
124
|
}).then(s => { stepIds.push(s.id); return s }),
|
|
60
|
-
|
|
125
|
+
() => true,
|
|
61
126
|
)
|
|
62
127
|
|
|
63
128
|
// Wrong type for onlySubmitWhenDue rejected
|
|
64
|
-
await
|
|
129
|
+
await expect_rejected(
|
|
65
130
|
"mdiTriggerRefill step rejected (non-boolean onlySubmitWhenDue)",
|
|
66
131
|
() => sdk.api.automation_steps.createOne({
|
|
67
132
|
journeyId: journey.id,
|
|
@@ -71,12 +136,11 @@ export const mdi_trigger_refill_tests = async ({ sdk, sdkNonAdmin }: { sdk: Sess
|
|
|
71
136
|
info: { onlySubmitWhenDue: 'yes' },
|
|
72
137
|
} as any,
|
|
73
138
|
}),
|
|
74
|
-
{ shouldError: true, onError: () => true },
|
|
75
139
|
)
|
|
76
140
|
|
|
77
141
|
// Unexpected info fields are stripped by objectValidator, not rejected — assert they never
|
|
78
142
|
// reach the stored config (the step itself is accepted)
|
|
79
|
-
await
|
|
143
|
+
await expect_result(
|
|
80
144
|
"mdiTriggerRefill step strips unexpected info field",
|
|
81
145
|
() => sdk.api.automation_steps.createOne({
|
|
82
146
|
journeyId: journey.id,
|
|
@@ -86,12 +150,10 @@ export const mdi_trigger_refill_tests = async ({ sdk, sdkNonAdmin }: { sdk: Sess
|
|
|
86
150
|
info: { onlySubmitWhenDue: false, formId: 'not-allowed' },
|
|
87
151
|
} as any,
|
|
88
152
|
}).then(s => { stepIds.push(s.id); return s }),
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
),
|
|
94
|
-
},
|
|
153
|
+
s => (
|
|
154
|
+
(s.action.info as any).onlySubmitWhenDue === false
|
|
155
|
+
&& (s.action.info as any).formId === undefined
|
|
156
|
+
),
|
|
95
157
|
)
|
|
96
158
|
|
|
97
159
|
// ── Handler guards (process endpoint) ────────────────────────────────────────
|
|
@@ -109,70 +171,62 @@ export const mdi_trigger_refill_tests = async ({ sdk, sdkNonAdmin }: { sdk: Sess
|
|
|
109
171
|
processAfter: new Date().getTime() + 60 * 60 * 1000,
|
|
110
172
|
} as any).then(a => { automatedActionIds.push(a.id); return a })
|
|
111
173
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
await async_test(
|
|
121
|
-
"mdiTriggerRefill fails cleanly without an MDI integration",
|
|
122
|
-
() => sdk.api.automated_actions.process({ automatedActionId: noIntegrationAction.id }),
|
|
123
|
-
{ onResult: (r: any) => r?.success === false && /MD Integrations integration not found/i.test(r?.error || '') },
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
try {
|
|
127
|
-
const created = await sdk.api.integrations.createOne({
|
|
128
|
-
title: MD_INTEGRATIONS_TITLE,
|
|
129
|
-
authentication: {
|
|
130
|
-
type: 'oauth2',
|
|
131
|
-
info: { access_token: 'test-access-token', refresh_token: 'test-refresh-token', scope: '', token_type: 'Bearer', expiry_date: new Date().getTime() },
|
|
132
|
-
},
|
|
133
|
-
} as any)
|
|
134
|
-
createdMDIIntegrationId = created.id
|
|
135
|
-
mdiIntegrationExists = true
|
|
136
|
-
} catch (e) {
|
|
137
|
-
console.log("Could not create an MDI integration; skipping patient-reference guard test:", e)
|
|
138
|
-
}
|
|
139
|
-
} else {
|
|
140
|
-
console.log("⏭️ Skipping mdiTriggerRefill missing-integration guard test (an MDI integration already exists)")
|
|
141
|
-
}
|
|
174
|
+
// A freshly provisioned tenant holds no MD Integrations integration, so this guard is always
|
|
175
|
+
// reached — no probe and no skip branch.
|
|
176
|
+
const noIntegrationAction = await createAutomatedAction()
|
|
177
|
+
await expect_result(
|
|
178
|
+
"mdiTriggerRefill fails cleanly without an MDI integration",
|
|
179
|
+
() => sdk.api.automated_actions.process({ automatedActionId: noIntegrationAction.id }),
|
|
180
|
+
(r: any) => r?.success === false && /MD Integrations integration not found/i.test(r?.error || ''),
|
|
181
|
+
)
|
|
142
182
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
183
|
+
const created = await sdk.api.integrations.createOne({
|
|
184
|
+
title: MD_INTEGRATIONS_TITLE,
|
|
185
|
+
authentication: {
|
|
186
|
+
type: 'oauth2',
|
|
187
|
+
info: { access_token: 'test-access-token', refresh_token: 'test-refresh-token', scope: '', token_type: 'Bearer', expiry_date: new Date().getTime() },
|
|
188
|
+
},
|
|
189
|
+
} as any)
|
|
190
|
+
createdMDIIntegrationId = created.id
|
|
191
|
+
|
|
192
|
+
// enduser has no MD Integrations reference — the guard returns before any outbound MDI call
|
|
193
|
+
const noReferenceAction = await createAutomatedAction()
|
|
194
|
+
await expect_result(
|
|
195
|
+
"mdiTriggerRefill fails cleanly for an enduser with no MDI patient reference",
|
|
196
|
+
() => sdk.api.automated_actions.process({ automatedActionId: noReferenceAction.id }),
|
|
197
|
+
(r: any) => r?.success === false && /no MD Integrations patient reference/i.test(r?.error || ''),
|
|
198
|
+
)
|
|
152
199
|
} finally {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
await sdk.api.
|
|
200
|
+
if (tenant) {
|
|
201
|
+
const { sdk } = tenant
|
|
202
|
+
for (const id of automatedActionIds) {
|
|
203
|
+
await sdk.api.automated_actions.deleteOne(id).catch(console.error)
|
|
204
|
+
}
|
|
205
|
+
if (enduserId) await sdk.api.endusers.deleteOne(enduserId).catch(console.error)
|
|
206
|
+
if (createdMDIIntegrationId) await sdk.api.integrations.deleteOne(createdMDIIntegrationId).catch(console.error)
|
|
207
|
+
for (const id of stepIds) {
|
|
208
|
+
await sdk.api.automation_steps.deleteOne(id).catch(console.error)
|
|
209
|
+
}
|
|
210
|
+
if (journeyId) await sdk.api.journeys.deleteOne(journeyId).catch(console.error)
|
|
211
|
+
// Teardown BEFORE anything asserts — assert calls process.exit, which would strand this tenant.
|
|
212
|
+
try { await tenant.teardown() } catch (e) { console.error('teardown failed', e) }
|
|
160
213
|
}
|
|
161
|
-
if (journeyId) await sdk.api.journeys.deleteOne(journeyId).catch(console.error)
|
|
162
214
|
}
|
|
215
|
+
|
|
216
|
+
return checks
|
|
163
217
|
}
|
|
164
218
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
219
|
+
/** Asserting wrapper, for standalone runs. */
|
|
220
|
+
export const mdi_trigger_refill_tests = async () => {
|
|
221
|
+
assert_checks('MDI trigger refill', await mdi_trigger_refill_checks())
|
|
222
|
+
}
|
|
169
223
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
await mdi_trigger_refill_tests({ sdk, sdkNonAdmin })
|
|
173
|
-
}
|
|
224
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
225
|
+
export const ISOLATED_SUITE: IsolatedSuite = { name: 'MDI trigger refill', run: mdi_trigger_refill_checks }
|
|
174
226
|
|
|
175
|
-
|
|
227
|
+
if (require.main === module) {
|
|
228
|
+
console.log(`Using API URL: ${host}`)
|
|
229
|
+
mdi_trigger_refill_tests()
|
|
176
230
|
.then(() => {
|
|
177
231
|
console.log("✅ MDI trigger refill test suite completed successfully")
|
|
178
232
|
process.exit(0)
|