@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
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
require('source-map-support').install();
|
|
2
2
|
|
|
3
|
-
import { Session } from "../../../sdk"
|
|
4
3
|
import {
|
|
5
|
-
async_test,
|
|
6
|
-
log_header,
|
|
7
4
|
wait,
|
|
8
5
|
} from "@tellescope/testing"
|
|
9
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
assert_checks,
|
|
8
|
+
Check,
|
|
9
|
+
IsolatedSuite,
|
|
10
|
+
setup_isolated_tenant,
|
|
11
|
+
} from "../../setup_isolated"
|
|
10
12
|
import { PROVIDER_PERMISSIONS } from "@tellescope/constants"
|
|
11
13
|
|
|
12
14
|
const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
13
|
-
|
|
15
|
+
|
|
16
|
+
const RAND = () => Math.random().toString(36).slice(2, 10)
|
|
14
17
|
|
|
15
18
|
const FULL_ACCESS = { create: 'All' as const, read: 'All' as const, update: 'All' as const, delete: 'All' as const }
|
|
16
19
|
|
|
@@ -61,20 +64,68 @@ const collectViolations = (results: { modelName: string, recordId: string, data:
|
|
|
61
64
|
*
|
|
62
65
|
* Pre-fix: assertion fails with leaked records.
|
|
63
66
|
* Post-fix: assertion passes.
|
|
67
|
+
*
|
|
68
|
+
* Runs on its own provisioned tenant. It used to overwrite the SHARED non-admin user's roles with
|
|
69
|
+
* this deliberately over-permissive role and restore them in a finally, so a crash stranded the
|
|
70
|
+
* fixture user on it; the mutated user is now this tenant's own, and it is thrown away at teardown.
|
|
64
71
|
*/
|
|
65
|
-
export const
|
|
66
|
-
|
|
72
|
+
export const data_sync_redaction_bypass_checks = async (): Promise<Check[]> => {
|
|
73
|
+
const checks: Check[] = []
|
|
74
|
+
const record = (label: string, pass: boolean, detail: string) => checks.push({ label, pass, detail })
|
|
75
|
+
|
|
76
|
+
// The raw value decides the fallback, not JSON.stringify of it — JSON.stringify('') is '""',
|
|
77
|
+
// which is truthy, so a `|| fallback` on the stringified form could never fire.
|
|
78
|
+
const describe = (value: any): string => {
|
|
79
|
+
if (value === undefined || value === null) return String(value)
|
|
80
|
+
const stringified = JSON.stringify(value)
|
|
81
|
+
return stringified === undefined ? String(value) : stringified
|
|
82
|
+
}
|
|
83
|
+
const errorMessage = (e: any): string => (
|
|
84
|
+
typeof e?.message === 'string' && e.message !== '' ? e.message : describe(e)
|
|
85
|
+
)
|
|
67
86
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
87
|
+
/**
|
|
88
|
+
* The async_test({ onResult }) equivalent, as a soft Check: a call that REJECTS is a failure
|
|
89
|
+
* (async_test treats it the same way), and a resolved call passes only when onResult agrees.
|
|
90
|
+
*
|
|
91
|
+
* The call and the predicate are caught separately, so a predicate that throws fails THIS check
|
|
92
|
+
* with its own detail instead of being misreported as an API rejection — and never escapes `run`,
|
|
93
|
+
* which would fail the whole run once the batch settles rather than failing one check.
|
|
94
|
+
*/
|
|
95
|
+
const expect_result = async <T,>(label: string, fn: () => Promise<T>, onResult: (r: T) => boolean) => {
|
|
96
|
+
let resolved: { value: T }
|
|
97
|
+
try {
|
|
98
|
+
resolved = { value: await fn() }
|
|
99
|
+
} catch (e: any) {
|
|
100
|
+
record(label, false, `rejected instead of resolving: ${errorMessage(e)}`)
|
|
101
|
+
return
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const { value } = resolved
|
|
105
|
+
try {
|
|
106
|
+
record(label, onResult(value), `result=${describe(value)}`)
|
|
107
|
+
} catch (predicateError: any) {
|
|
108
|
+
record(label, false, `predicate threw on result=${describe(value)}: ${errorMessage(predicateError)}`)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const roleName = `f0001-data-sync-bypass-${RAND()}`
|
|
113
|
+
|
|
114
|
+
let tenant: Awaited<ReturnType<typeof setup_isolated_tenant>> | undefined
|
|
72
115
|
|
|
73
116
|
try {
|
|
117
|
+
tenant = await setup_isolated_tenant({
|
|
118
|
+
name: `Data-sync field redaction ${RAND()}`,
|
|
119
|
+
users: [{ isAdmin: true }, { roles: ['Non-Admin'] }],
|
|
120
|
+
apiKeys: 0,
|
|
121
|
+
})
|
|
122
|
+
const { sdk, sdkNonAdmin } = tenant
|
|
123
|
+
const [admin, nonAdmin] = tenant.users
|
|
124
|
+
|
|
74
125
|
// 1. Create a role with broad read access but NO fieldRedactions.
|
|
75
126
|
// This is the realistic "regular user with read access" condition
|
|
76
127
|
// that triggers the bypass in the pre-fix handler.
|
|
77
|
-
|
|
128
|
+
await sdk.api.role_based_access_permissions.createOne({
|
|
78
129
|
role: roleName,
|
|
79
130
|
permissions: {
|
|
80
131
|
...PROVIDER_PERMISSIONS,
|
|
@@ -83,17 +134,40 @@ export const data_sync_redaction_bypass_tests = async ({ sdk, sdkNonAdmin } : {
|
|
|
83
134
|
},
|
|
84
135
|
// intentionally NO fieldRedactions — this is the exploit condition.
|
|
85
136
|
})
|
|
86
|
-
rbapId = rbap.id
|
|
87
137
|
|
|
88
|
-
// 2. Assign role to
|
|
138
|
+
// 2. Assign role to this tenant's own non-admin user and re-authenticate so the new
|
|
89
139
|
// session reflects the role's permissions.
|
|
90
140
|
await sdk.api.users.updateOne(
|
|
91
|
-
|
|
141
|
+
nonAdmin.id,
|
|
92
142
|
{ roles: [roleName] },
|
|
93
143
|
{ replaceObjectFields: true },
|
|
94
144
|
)
|
|
95
145
|
await wait(undefined, 1500)
|
|
96
|
-
await sdkNonAdmin.authenticate(
|
|
146
|
+
await sdkNonAdmin.authenticate(nonAdmin.email, nonAdmin.password)
|
|
147
|
+
|
|
148
|
+
// 2b. Seed a real `linkedAccountAccess` entry on the ADMIN's user record, so coverage B below
|
|
149
|
+
// can actually fail. A verbatim port asserted "no other user's record carries the field",
|
|
150
|
+
// which on a fresh tenant no record carries anyway — it passed even with applyRedactions'
|
|
151
|
+
// owner-only branch deleted.
|
|
152
|
+
//
|
|
153
|
+
// The entry is written by request_linked_account_access, which needs account switching
|
|
154
|
+
// enabled on both the actor's and the target's org (here, the one tenant org), and lands
|
|
155
|
+
// the requester's snapshot on the TARGET's record — hence the non-admin requesting access
|
|
156
|
+
// to the admin. The handler writes raw through getDB() and leaves no data_sync_record, so
|
|
157
|
+
// the admin then touches its own record through the SDK to produce one.
|
|
158
|
+
await sdk.api.organizations.updateOne(tenant.businessId, { accountSwitchingEnabled: true })
|
|
159
|
+
await sdkNonAdmin.api.users.request_linked_account_access({ targetEmail: admin.email })
|
|
160
|
+
await sdk.api.users.updateOne(admin.id, { fname: 'DataSyncAdmin' })
|
|
161
|
+
|
|
162
|
+
// The handler answers `{}` on every rejection path (enumeration safety), so the only way to
|
|
163
|
+
// know the seed landed is to read it back as the record's owner — the one session
|
|
164
|
+
// applyRedactions does not strip the field from. Without this the coverage-B check below is
|
|
165
|
+
// vacuous, so a missing field is a FAIL here rather than a silent no-op.
|
|
166
|
+
await expect_result(
|
|
167
|
+
"fixture: linkedAccountAccess is seeded on the admin's user record (owner read)",
|
|
168
|
+
() => sdk.api.users.getOne(admin.id),
|
|
169
|
+
u => ((u as any).linkedAccountAccess ?? []).some((e: any) => e?.userId === nonAdmin.id),
|
|
170
|
+
)
|
|
97
171
|
|
|
98
172
|
// 3. Create a test enduser and set a password — this populates
|
|
99
173
|
// `hashedPassword` on the enduser record and writes a data_sync_records
|
|
@@ -103,7 +177,6 @@ export const data_sync_redaction_bypass_tests = async ({ sdk, sdkNonAdmin } : {
|
|
|
103
177
|
lname: 'Patient',
|
|
104
178
|
email: `f0001-target-${Date.now()}@example.com`,
|
|
105
179
|
})
|
|
106
|
-
testEnduserId = testEnduser.id
|
|
107
180
|
await sdk.api.endusers.set_password({ id: testEnduser.id, password: 'F0001TestPassword!123' })
|
|
108
181
|
|
|
109
182
|
// The non-admin user's own `hashedPass` is set from login and refreshed
|
|
@@ -123,13 +196,13 @@ export const data_sync_redaction_bypass_tests = async ({ sdk, sdkNonAdmin } : {
|
|
|
123
196
|
// (the non-admin's own record). If the stream is empty, the assertion below
|
|
124
197
|
// would pass vacuously — guard against that.
|
|
125
198
|
const userRecordsInStream = sync.results.filter(r => r.modelName === 'users').length
|
|
126
|
-
await
|
|
199
|
+
await expect_result(
|
|
127
200
|
"guard: /v1/data-sync sync stream contains at least one user record",
|
|
128
201
|
async () => ({ userRecords: userRecordsInStream, totalRecords: sync.results.length }),
|
|
129
|
-
|
|
202
|
+
r => r.userRecords >= 1,
|
|
130
203
|
)
|
|
131
204
|
|
|
132
|
-
await
|
|
205
|
+
await expect_result(
|
|
133
206
|
"/v1/data-sync must NOT return hashedPass / hashedPassword / hashedInviteCode",
|
|
134
207
|
async () => ({
|
|
135
208
|
violationCount: violations.length,
|
|
@@ -137,7 +210,7 @@ export const data_sync_redaction_bypass_tests = async ({ sdk, sdkNonAdmin } : {
|
|
|
137
210
|
affectedModels: Array.from(new Set(violations.map(v => v.modelName))),
|
|
138
211
|
affectedFields: Array.from(new Set(violations.map(v => v.leakedField))),
|
|
139
212
|
}),
|
|
140
|
-
|
|
213
|
+
r => r.violationCount === 0,
|
|
141
214
|
)
|
|
142
215
|
|
|
143
216
|
// ========================================================================
|
|
@@ -152,13 +225,13 @@ export const data_sync_redaction_bypass_tests = async ({ sdk, sdkNonAdmin } : {
|
|
|
152
225
|
// Post-fix: applyRedactions always runs and `redactions: ['all']` strips for everyone.
|
|
153
226
|
const adminSync = await sdk.sync({ from: new Date(0) })
|
|
154
227
|
const adminViolations = collectViolations(adminSync.results)
|
|
155
|
-
await
|
|
228
|
+
await expect_result(
|
|
156
229
|
"coverage A: admin /v1/data-sync also strips redactions:['all'] fields (hashedPass etc.)",
|
|
157
230
|
async () => ({
|
|
158
231
|
violationCount: adminViolations.length,
|
|
159
232
|
violations: adminViolations.slice(0, 10),
|
|
160
233
|
}),
|
|
161
|
-
|
|
234
|
+
r => r.violationCount === 0,
|
|
162
235
|
)
|
|
163
236
|
|
|
164
237
|
// Case B: `linkedAccountAccess` on users must be stripped when the caller is NOT
|
|
@@ -166,65 +239,58 @@ export const data_sync_redaction_bypass_tests = async ({ sdk, sdkNonAdmin } : {
|
|
|
166
239
|
// and protects against cross-user enumeration of who-requested-access-to-whom.
|
|
167
240
|
// The non-admin user reads other user records via data-sync; if any of those
|
|
168
241
|
// records have linkedAccountAccess set, it must be stripped on read.
|
|
242
|
+
// The admin's record genuinely carries the field (seeded in 2b), so deleting the owner-only
|
|
243
|
+
// branch turns this check red.
|
|
169
244
|
const otherUsersInStream = sync.results.filter(
|
|
170
|
-
r => r.modelName === 'users' && r.recordId !==
|
|
245
|
+
r => r.modelName === 'users' && r.recordId !== nonAdmin.id
|
|
171
246
|
)
|
|
172
247
|
const linkedAccountLeaks: { recordId: string }[] = []
|
|
173
|
-
for (const
|
|
174
|
-
if (!
|
|
248
|
+
for (const syncRecord of otherUsersInStream) {
|
|
249
|
+
if (!syncRecord.data || syncRecord.data === 'deleted') continue
|
|
175
250
|
try {
|
|
176
|
-
const parsed = JSON.parse(
|
|
251
|
+
const parsed = JSON.parse(syncRecord.data)
|
|
177
252
|
if ('linkedAccountAccess' in parsed && parsed.linkedAccountAccess !== undefined) {
|
|
178
|
-
linkedAccountLeaks.push({ recordId:
|
|
253
|
+
linkedAccountLeaks.push({ recordId: syncRecord.recordId })
|
|
179
254
|
}
|
|
180
255
|
} catch {}
|
|
181
256
|
}
|
|
182
|
-
await
|
|
257
|
+
await expect_result(
|
|
183
258
|
"coverage B: /v1/data-sync strips linkedAccountAccess from other users' records",
|
|
184
259
|
async () => ({
|
|
185
260
|
otherUserRecords: otherUsersInStream.length,
|
|
261
|
+
adminRecordInStream: otherUsersInStream.some(r => r.recordId === admin.id),
|
|
186
262
|
leakCount: linkedAccountLeaks.length,
|
|
187
263
|
leaks: linkedAccountLeaks.slice(0, 5),
|
|
188
264
|
}),
|
|
189
|
-
|
|
265
|
+
// The seeded admin record must be in the stream, or there is nothing to strip and the check
|
|
266
|
+
// proves nothing.
|
|
267
|
+
r => r.adminRecordInStream && r.leakCount === 0,
|
|
190
268
|
)
|
|
191
269
|
} finally {
|
|
192
|
-
//
|
|
193
|
-
|
|
194
|
-
await
|
|
195
|
-
sdkNonAdmin.userInfo.id,
|
|
196
|
-
{ roles: originalRoles ?? [] },
|
|
197
|
-
{ replaceObjectFields: true },
|
|
198
|
-
)
|
|
199
|
-
} catch {}
|
|
200
|
-
if (rbapId) {
|
|
201
|
-
try { await sdk.api.role_based_access_permissions.deleteOne(rbapId) } catch {}
|
|
270
|
+
// Teardown BEFORE anything asserts — assert calls process.exit, which would strand this tenant.
|
|
271
|
+
if (tenant) {
|
|
272
|
+
try { await tenant.teardown() } catch (e) { console.error('teardown failed', e) }
|
|
202
273
|
}
|
|
203
|
-
if (testEnduserId) {
|
|
204
|
-
try { await sdk.api.endusers.deleteOne(testEnduserId) } catch {}
|
|
205
|
-
}
|
|
206
|
-
// Re-authenticate the non-admin to drop the exploit role from their JWT
|
|
207
|
-
// before subsequent tests run.
|
|
208
|
-
// Role restore above re-triggers deauthenticate_user; wait > 1s so the freshly minted
|
|
209
|
-
// token's (second-floored) iat lands after the deauth timestamp and isn't permanently
|
|
210
|
-
// rejected by is_logged_in's iat-slack check. Matches the in-test re-auth above.
|
|
211
|
-
await wait(undefined, 1500)
|
|
212
|
-
try { await sdkNonAdmin.authenticate(nonAdminEmail!, nonAdminPassword!) } catch {}
|
|
213
274
|
}
|
|
275
|
+
|
|
276
|
+
return checks
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/** Asserting wrapper, for standalone runs. */
|
|
280
|
+
export const data_sync_redaction_bypass_tests = async () => {
|
|
281
|
+
assert_checks('data-sync field-redaction bypass', await data_sync_redaction_bypass_checks())
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
285
|
+
export const ISOLATED_SUITE: IsolatedSuite = {
|
|
286
|
+
name: 'data-sync field-redaction bypass',
|
|
287
|
+
run: data_sync_redaction_bypass_checks,
|
|
214
288
|
}
|
|
215
289
|
|
|
216
290
|
// Allow running this test file independently
|
|
217
291
|
if (require.main === module) {
|
|
218
292
|
console.log(`🌐 Using API URL: ${host}`)
|
|
219
|
-
|
|
220
|
-
const sdkNonAdmin = new Session({ host })
|
|
221
|
-
|
|
222
|
-
const runTests = async () => {
|
|
223
|
-
await setup_tests(sdk, sdkNonAdmin)
|
|
224
|
-
await data_sync_redaction_bypass_tests({ sdk, sdkNonAdmin })
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
runTests()
|
|
293
|
+
data_sync_redaction_bypass_tests()
|
|
228
294
|
.then(() => {
|
|
229
295
|
console.log("✅ data-sync redaction-bypass test suite completed successfully")
|
|
230
296
|
process.exit(0)
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
require('source-map-support').install();
|
|
2
2
|
|
|
3
3
|
import { ObjectId } from 'bson'
|
|
4
|
-
import { Session } from "../../../sdk"
|
|
5
4
|
import {
|
|
6
|
-
async_test,
|
|
7
|
-
log_header,
|
|
8
5
|
wait,
|
|
9
6
|
} from "@tellescope/testing"
|
|
10
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
assert_checks,
|
|
9
|
+
Check,
|
|
10
|
+
IsolatedSuite,
|
|
11
|
+
setup_isolated_tenant,
|
|
12
|
+
} from "../../setup_isolated"
|
|
11
13
|
import { PROVIDER_PERMISSIONS } from "@tellescope/constants"
|
|
12
14
|
|
|
13
15
|
const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
14
|
-
|
|
16
|
+
|
|
17
|
+
const RAND = () => Math.random().toString(36).slice(2, 10)
|
|
15
18
|
|
|
16
19
|
/**
|
|
17
20
|
* Regression test: the `develop_health_run_benefit_verification` RBAC gate.
|
|
@@ -36,20 +39,72 @@ const [nonAdminEmail, nonAdminPassword] = [process.env.NON_ADMIN_EMAIL, process.
|
|
|
36
39
|
* check never fires. Test fails (no access-denial signal).
|
|
37
40
|
*
|
|
38
41
|
* Post-fix: the handler throws 403 before touching `DB.endusers` at all. Test passes.
|
|
42
|
+
*
|
|
43
|
+
* Runs on its own provisioned tenant: both roles below are assigned to a throwaway non-admin
|
|
44
|
+
* rather than to the SHARED fixture user, whose permissions were previously arbitrary for every
|
|
45
|
+
* concurrent suite while this ran (and stayed broken if either cleanup crashed). A freshly
|
|
46
|
+
* provisioned tenant also has no Develop Health integration, which is what the positive control
|
|
47
|
+
* below depends on — on the shared org that was whatever the last developer left behind.
|
|
39
48
|
*/
|
|
40
|
-
export const
|
|
41
|
-
|
|
49
|
+
export const develop_health_benefit_verification_rbac_checks = async (): Promise<Check[]> => {
|
|
50
|
+
const checks: Check[] = []
|
|
51
|
+
const record = (label: string, pass: boolean, detail: string) => checks.push({ label, pass, detail })
|
|
52
|
+
|
|
53
|
+
// The raw value decides the fallback, not JSON.stringify of it — JSON.stringify('') is '""',
|
|
54
|
+
// which is truthy, so a `|| fallback` on the stringified form could never fire.
|
|
55
|
+
const describe = (value: any): string => {
|
|
56
|
+
if (value === undefined || value === null) return String(value)
|
|
57
|
+
const stringified = JSON.stringify(value)
|
|
58
|
+
return stringified === undefined ? String(value) : stringified
|
|
59
|
+
}
|
|
60
|
+
const errorMessage = (e: any): string => (
|
|
61
|
+
typeof e?.message === 'string' && e.message !== '' ? e.message : describe(e)
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The async_test({ shouldError: true, onError }) equivalent, as a soft Check: a call that RESOLVES
|
|
66
|
+
* is a failure (async_test treats it the same way), and a rejection passes only when onError agrees.
|
|
67
|
+
*/
|
|
68
|
+
const expect_rejected = async (label: string, fn: () => Promise<any>, onError: (e: any) => boolean) => {
|
|
69
|
+
let rejection: { e: any }
|
|
70
|
+
try {
|
|
71
|
+
const unexpected = await fn()
|
|
72
|
+
record(label, false, `resolved instead of rejecting; result=${describe(unexpected)}`)
|
|
73
|
+
return
|
|
74
|
+
} catch (e: any) {
|
|
75
|
+
rejection = { e }
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Evaluated after the error is captured, and caught in its own right: an uncaught throw from
|
|
79
|
+
// the predicate would escape `run` and, per run_isolated_in_parallel, fail the whole run once
|
|
80
|
+
// the batch settles instead of failing this one check.
|
|
81
|
+
const { e } = rejection
|
|
82
|
+
try {
|
|
83
|
+
record(label, onError(e), `rejected with ${errorMessage(e)}`)
|
|
84
|
+
} catch (predicateError: any) {
|
|
85
|
+
record(label, false, `predicate threw on rejection "${errorMessage(e)}": ${errorMessage(predicateError)}`)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const roleName = `f0006-develop-health-no-access-${RAND()}`
|
|
90
|
+
const providerRoleName = `f0006-develop-health-provider-${RAND()}`
|
|
42
91
|
|
|
43
|
-
|
|
44
|
-
let rbapId: string | undefined
|
|
45
|
-
const originalRoles = sdkNonAdmin.userInfo.roles
|
|
92
|
+
let tenant: Awaited<ReturnType<typeof setup_isolated_tenant>> | undefined
|
|
46
93
|
|
|
47
94
|
try {
|
|
95
|
+
tenant = await setup_isolated_tenant({
|
|
96
|
+
name: `develop_health benefit verification RBAC ${RAND()}`,
|
|
97
|
+
users: [{ isAdmin: true }, { roles: ['Non-Admin'] }],
|
|
98
|
+
apiKeys: 0,
|
|
99
|
+
})
|
|
100
|
+
const { sdk, sdkNonAdmin } = tenant
|
|
101
|
+
const nonAdmin = tenant.users[1]
|
|
102
|
+
|
|
48
103
|
// 1. Create a role that explicitly denies endusers access AND enduser_eligibility_results
|
|
49
104
|
// access. This is the realistic configuration the bypass affects: a tenant operator
|
|
50
105
|
// deliberately restricts a role from reading enduser PHI (e.g. for PHI-restricted
|
|
51
106
|
// integration/API-key roles).
|
|
52
|
-
|
|
107
|
+
await sdk.api.role_based_access_permissions.createOne({
|
|
53
108
|
role: roleName,
|
|
54
109
|
permissions: {
|
|
55
110
|
...PROVIDER_PERMISSIONS,
|
|
@@ -57,22 +112,21 @@ export const develop_health_benefit_verification_rbac_tests = async ({ sdk, sdkN
|
|
|
57
112
|
enduser_eligibility_results: { create: null, read: null, update: null, delete: null },
|
|
58
113
|
},
|
|
59
114
|
})
|
|
60
|
-
rbapId = rbap.id
|
|
61
115
|
|
|
62
|
-
// 2. Assign the role to
|
|
116
|
+
// 2. Assign the role to this tenant's own non-admin user and re-authenticate so the new
|
|
63
117
|
// session reflects the role's denied permissions.
|
|
64
118
|
await sdk.api.users.updateOne(
|
|
65
|
-
|
|
119
|
+
nonAdmin.id,
|
|
66
120
|
{ roles: [roleName] },
|
|
67
121
|
{ replaceObjectFields: true },
|
|
68
122
|
)
|
|
69
123
|
await wait(undefined, 1500)
|
|
70
|
-
await sdkNonAdmin.authenticate(
|
|
124
|
+
await sdkNonAdmin.authenticate(nonAdmin.email, nonAdmin.password)
|
|
71
125
|
|
|
72
126
|
// 3. develop_health_run_benefit_verification must throw 403 BEFORE any enduser lookup.
|
|
73
127
|
// Pre-fix: proceeds to DB.endusers.findById and either 400s on validation (fake id) or
|
|
74
128
|
// succeeds and forwards PHI to Develop Health (real id) — never a 403.
|
|
75
|
-
await
|
|
129
|
+
await expect_rejected(
|
|
76
130
|
"enduser_eligibility_results.develop_health_run_benefit_verification must throw 403 when role denies endusers/enduser_eligibility_results",
|
|
77
131
|
() => sdkNonAdmin.api.enduser_eligibility_results.develop_health_run_benefit_verification({
|
|
78
132
|
enduserId: new ObjectId().toHexString(), // fake id — access check should fire first
|
|
@@ -84,114 +138,88 @@ export const develop_health_benefit_verification_rbac_tests = async ({ sdk, sdkN
|
|
|
84
138
|
drugs: [{ name: 'Test Drug', dosage: '10mg', quantity: 1 }],
|
|
85
139
|
drug_history: { currently_taking_drugs: [], previously_taken_drugs: [] },
|
|
86
140
|
} as any),
|
|
87
|
-
{
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
return msg.includes('access to this resource')
|
|
102
|
-
},
|
|
141
|
+
(e: any) => {
|
|
142
|
+
// Match the gate's exact message. The SDK error surfaces { message, info } (no top-level
|
|
143
|
+
// status/code), so we key on the message rather than the HTTP status. This is deliberately
|
|
144
|
+
// specific: a lapsed subscription ("Your subscription has expired") or an expired token
|
|
145
|
+
// ("Unauthenticated") also errors BEFORE the handler runs, but neither contains this string,
|
|
146
|
+
// so the test can't false-pass without the gate executing. Also reject the pre-fix
|
|
147
|
+
// downstream messages, which would indicate the access check never fired.
|
|
148
|
+
const msg = (e?.message ?? '').toLowerCase()
|
|
149
|
+
if (msg.includes('integration not found') || msg.includes('enduser is required')
|
|
150
|
+
|| msg.includes('organization') || msg.includes('provider')) {
|
|
151
|
+
return false // reached past the access gate — regression
|
|
152
|
+
}
|
|
153
|
+
return msg.includes('access to this resource')
|
|
103
154
|
},
|
|
104
155
|
)
|
|
105
156
|
|
|
106
157
|
// 4. POSITIVE case: a provider role WITH enduser access must PASS the gate and reach the
|
|
107
|
-
// integration stage (this
|
|
158
|
+
// integration stage (this tenant has no Develop Health integration, so it 400s with
|
|
108
159
|
// "Integration not found"). This guards against the gate over-blocking legitimate users —
|
|
109
160
|
// the failure mode a future tightening (e.g. gating on 'All') would introduce.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
// provider). Reaching "Integration not found" (or org/provider validation) proves the
|
|
139
|
-
// gate passed and the read-scoped enduser load did not over-restrict a legitimate role.
|
|
140
|
-
if (msg.includes('access to this resource')) return false
|
|
141
|
-
return msg.includes('integration not found') || msg.includes('organization') || msg.includes('provider')
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
)
|
|
145
|
-
} finally {
|
|
146
|
-
if (providerRbapId) {
|
|
147
|
-
try {
|
|
148
|
-
await sdk.api.users.updateOne(sdkNonAdmin.userInfo.id, { roles: originalRoles ?? [] }, { replaceObjectFields: true })
|
|
149
|
-
} catch {}
|
|
150
|
-
try { await sdk.api.role_based_access_permissions.deleteOne(providerRbapId) } catch {}
|
|
151
|
-
await wait(undefined, 1500)
|
|
152
|
-
try { await sdkNonAdmin.authenticate(nonAdminEmail!, nonAdminPassword!) } catch {}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
161
|
+
await sdk.api.role_based_access_permissions.createOne({
|
|
162
|
+
role: providerRoleName,
|
|
163
|
+
permissions: { ...PROVIDER_PERMISSIONS }, // endusers read/create non-null, eligibility create non-null
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
await sdk.api.users.updateOne(nonAdmin.id, { roles: [providerRoleName] }, { replaceObjectFields: true })
|
|
167
|
+
await wait(undefined, 1500)
|
|
168
|
+
await sdkNonAdmin.authenticate(nonAdmin.email, nonAdmin.password)
|
|
169
|
+
|
|
170
|
+
await expect_rejected(
|
|
171
|
+
"a provider role with enduser access passes the gate (reaches 'Integration not found', not 403)",
|
|
172
|
+
() => sdkNonAdmin.api.enduser_eligibility_results.develop_health_run_benefit_verification({
|
|
173
|
+
enduserId: new ObjectId().toHexString(),
|
|
174
|
+
providerUserId: new ObjectId().toHexString(),
|
|
175
|
+
insuranceType: 'primary',
|
|
176
|
+
diagnoses: [],
|
|
177
|
+
drugs: [{ name: 'Test Drug', dosage: '10mg', quantity: 1 }],
|
|
178
|
+
drug_history: { currently_taking_drugs: [], previously_taken_drugs: [] },
|
|
179
|
+
} as any),
|
|
180
|
+
(e: any) => {
|
|
181
|
+
const msg = (e?.message ?? '').toLowerCase()
|
|
182
|
+
// Must NOT be the access-denial message (that would mean the gate wrongly blocked a
|
|
183
|
+
// provider). Reaching "Integration not found" (or org/provider validation) proves the
|
|
184
|
+
// gate passed and the read-scoped enduser load did not over-restrict a legitimate role.
|
|
185
|
+
if (msg.includes('access to this resource')) return false
|
|
186
|
+
return msg.includes('integration not found') || msg.includes('organization') || msg.includes('provider')
|
|
187
|
+
},
|
|
188
|
+
)
|
|
155
189
|
|
|
156
190
|
// NOTE — the create>read bypass (endusers.create broader than endusers.read) that the 2026-08-19
|
|
157
|
-
// read-scoping closes is NOT live-testable here: this
|
|
191
|
+
// read-scoping closes is NOT live-testable here: this tenant has no Develop Health integration, so
|
|
158
192
|
// the handler throws "Integration not found" BEFORE reaching the (now read-scoped) enduser load,
|
|
159
193
|
// and the enduser load is what the create>read fix governs. Exercising it would need either a real
|
|
160
194
|
// Develop Health integration or reordering the handler purely for the test. It is covered by code
|
|
161
195
|
// review + the systemic follow-up. If a Develop Health sandbox integration is ever available
|
|
162
|
-
//
|
|
196
|
+
// to a provisioned tenant, add: role { endusers: create 'All', read 'Assigned' } → call with a real
|
|
163
197
|
// enduser NOT assigned to the caller → expect the enduser-not-found path, not a successful forward.
|
|
164
198
|
} finally {
|
|
165
|
-
//
|
|
166
|
-
|
|
167
|
-
await
|
|
168
|
-
sdkNonAdmin.userInfo.id,
|
|
169
|
-
{ roles: originalRoles ?? [] },
|
|
170
|
-
{ replaceObjectFields: true },
|
|
171
|
-
)
|
|
172
|
-
} catch {}
|
|
173
|
-
if (rbapId) {
|
|
174
|
-
try { await sdk.api.role_based_access_permissions.deleteOne(rbapId) } catch {}
|
|
199
|
+
// Teardown BEFORE anything asserts — assert calls process.exit, which would strand this tenant.
|
|
200
|
+
if (tenant) {
|
|
201
|
+
try { await tenant.teardown() } catch (e) { console.error('teardown failed', e) }
|
|
175
202
|
}
|
|
176
|
-
// Re-authenticate the non-admin to drop the no-access role from their JWT
|
|
177
|
-
// before subsequent tests run.
|
|
178
|
-
await wait(undefined, 1500)
|
|
179
|
-
try { await sdkNonAdmin.authenticate(nonAdminEmail!, nonAdminPassword!) } catch {}
|
|
180
203
|
}
|
|
204
|
+
|
|
205
|
+
return checks
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** Asserting wrapper, for standalone runs. */
|
|
209
|
+
export const develop_health_benefit_verification_rbac_tests = async () => {
|
|
210
|
+
assert_checks('develop_health benefit verification RBAC', await develop_health_benefit_verification_rbac_checks())
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
214
|
+
export const ISOLATED_SUITE: IsolatedSuite = {
|
|
215
|
+
name: 'develop_health benefit verification RBAC',
|
|
216
|
+
run: develop_health_benefit_verification_rbac_checks,
|
|
181
217
|
}
|
|
182
218
|
|
|
183
219
|
// Allow running this test file independently
|
|
184
220
|
if (require.main === module) {
|
|
185
221
|
console.log(`🌐 Using API URL: ${host}`)
|
|
186
|
-
|
|
187
|
-
const sdkNonAdmin = new Session({ host })
|
|
188
|
-
|
|
189
|
-
const runTests = async () => {
|
|
190
|
-
await setup_tests(sdk, sdkNonAdmin)
|
|
191
|
-
await develop_health_benefit_verification_rbac_tests({ sdk, sdkNonAdmin })
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
runTests()
|
|
222
|
+
develop_health_benefit_verification_rbac_tests()
|
|
195
223
|
.then(() => {
|
|
196
224
|
console.log("✅ develop_health_run_benefit_verification RBAC test suite completed successfully")
|
|
197
225
|
process.exit(0)
|