@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
|
@@ -47,12 +47,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
};
|
|
48
48
|
require('source-map-support').install();
|
|
49
49
|
import { ObjectId } from 'bson';
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import { setup_tests } from "../../setup";
|
|
50
|
+
import { wait, } from "@tellescope/testing";
|
|
51
|
+
import { assert_checks, setup_isolated_tenant, } from "../../setup_isolated";
|
|
53
52
|
import { PROVIDER_PERMISSIONS } from "@tellescope/constants";
|
|
54
53
|
var host = process.env.API_URL || 'http://localhost:8080';
|
|
55
|
-
var
|
|
54
|
+
var RAND = function () { return Math.random().toString(36).slice(2, 10); };
|
|
56
55
|
/**
|
|
57
56
|
* Regression test: `ai_conversations` RBAC.
|
|
58
57
|
*
|
|
@@ -84,296 +83,415 @@ var _a = [process.env.NON_ADMIN_EMAIL, process.env.NON_ADMIN_PASSWORD], nonAdmin
|
|
|
84
83
|
* - generate_ai_decision: 200 with `{}` (handler responds early before access check). Test fails.
|
|
85
84
|
*
|
|
86
85
|
* Post-fix: both endpoints throw 403 before any work happens. Test passes.
|
|
86
|
+
*
|
|
87
|
+
* Runs on its own provisioned tenant, so the three roles below are assigned to a throwaway
|
|
88
|
+
* non-admin rather than to the SHARED fixture user, whose permissions were previously arbitrary
|
|
89
|
+
* for every concurrent suite while this ran (and stayed broken if cleanup crashed).
|
|
87
90
|
*/
|
|
88
|
-
export var
|
|
89
|
-
var
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
91
|
+
export var ai_conversations_rbac_checks = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
92
|
+
var checks, record, describe, errorMessage, expect_rejected, isAccessDenial, roleName, grantRoleName, assignedRoleName, tenant, sdk, sdkNonAdmin_1, nonAdmin, label, outcome, e_1, label, outcome, e_2, label, outcome, e_3, e, msg, status_1, isCrash, label, outcome, e_4, e, msg, status_2, isCrash, e_5;
|
|
93
|
+
var _a, _b, _c, _d;
|
|
94
|
+
var _e, _f, _g, _h;
|
|
95
|
+
return __generator(this, function (_j) {
|
|
96
|
+
switch (_j.label) {
|
|
97
|
+
case 0:
|
|
98
|
+
checks = [];
|
|
99
|
+
record = function (label, pass, detail) { return checks.push({ label: label, pass: pass, detail: detail }); };
|
|
100
|
+
describe = function (value) {
|
|
101
|
+
if (value === undefined || value === null)
|
|
102
|
+
return String(value);
|
|
103
|
+
var stringified = JSON.stringify(value);
|
|
104
|
+
return stringified === undefined ? String(value) : stringified;
|
|
105
|
+
};
|
|
106
|
+
errorMessage = function (e) { return (typeof (e === null || e === void 0 ? void 0 : e.message) === 'string' && e.message !== '' ? e.message : describe(e)); };
|
|
107
|
+
expect_rejected = function (label, fn, onError) { return __awaiter(void 0, void 0, void 0, function () {
|
|
108
|
+
var rejection, unexpected, e_6, e;
|
|
109
|
+
return __generator(this, function (_a) {
|
|
110
|
+
switch (_a.label) {
|
|
111
|
+
case 0:
|
|
112
|
+
_a.trys.push([0, 2, , 3]);
|
|
113
|
+
return [4 /*yield*/, fn()];
|
|
114
|
+
case 1:
|
|
115
|
+
unexpected = _a.sent();
|
|
116
|
+
record(label, false, "resolved instead of rejecting; result=".concat(describe(unexpected)));
|
|
117
|
+
return [2 /*return*/];
|
|
118
|
+
case 2:
|
|
119
|
+
e_6 = _a.sent();
|
|
120
|
+
rejection = { e: e_6 };
|
|
121
|
+
return [3 /*break*/, 3];
|
|
122
|
+
case 3:
|
|
123
|
+
e = rejection.e;
|
|
124
|
+
try {
|
|
125
|
+
record(label, onError(e), "rejected with ".concat(errorMessage(e)));
|
|
126
|
+
}
|
|
127
|
+
catch (predicateError) {
|
|
128
|
+
record(label, false, "predicate threw on rejection \"".concat(errorMessage(e), "\": ").concat(errorMessage(predicateError)));
|
|
129
|
+
}
|
|
130
|
+
return [2 /*return*/];
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}); };
|
|
134
|
+
isAccessDenial = function (e) {
|
|
135
|
+
var _a, _b;
|
|
136
|
+
var msg = ((_a = e === null || e === void 0 ? void 0 : e.message) !== null && _a !== void 0 ? _a : '').toLowerCase();
|
|
137
|
+
var status = (_b = e === null || e === void 0 ? void 0 : e.status) !== null && _b !== void 0 ? _b : e === null || e === void 0 ? void 0 : e.code;
|
|
138
|
+
return status === 403 || status === 401
|
|
139
|
+
|| msg.includes('access') || msg.includes('permission') || msg.includes('forbidden');
|
|
140
|
+
};
|
|
141
|
+
roleName = "f0005-ai-conversations-no-access-".concat(RAND());
|
|
142
|
+
grantRoleName = "f0005-ai-conversations-create-granted-".concat(RAND());
|
|
143
|
+
assignedRoleName = "f0005-ai-conversations-assigned-default-".concat(RAND());
|
|
144
|
+
_j.label = 1;
|
|
145
|
+
case 1:
|
|
146
|
+
_j.trys.push([1, , 36, 41]);
|
|
147
|
+
return [4 /*yield*/, setup_isolated_tenant({
|
|
148
|
+
name: "ai_conversations RBAC ".concat(RAND()),
|
|
149
|
+
users: [{ isAdmin: true }, { roles: ['Non-Admin'] }],
|
|
150
|
+
apiKeys: 0,
|
|
151
|
+
})];
|
|
152
|
+
case 2:
|
|
153
|
+
tenant = _j.sent();
|
|
154
|
+
sdk = tenant.sdk, sdkNonAdmin_1 = tenant.sdkNonAdmin;
|
|
155
|
+
nonAdmin = tenant.users[1];
|
|
156
|
+
// 1. Create a role that explicitly denies ai_conversations access AND endusers access.
|
|
157
|
+
// This is the realistic configuration the bypass affects: a tenant operator
|
|
158
|
+
// deliberately restricts a role from reading AI conversations / enduser PHI.
|
|
159
|
+
return [4 /*yield*/, sdk.api.role_based_access_permissions.createOne({
|
|
160
|
+
role: roleName,
|
|
161
|
+
permissions: __assign(__assign({}, PROVIDER_PERMISSIONS), { ai_conversations: { create: null, read: null, update: null, delete: null }, endusers: { create: null, read: null, update: null, delete: null } }),
|
|
162
|
+
})
|
|
163
|
+
// 2. Assign the role to this tenant's own non-admin user and re-authenticate so the new
|
|
115
164
|
// session reflects the role's denied permissions.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
onError: function (e) {
|
|
134
|
-
var _a, _b;
|
|
135
|
-
// Accept any 4xx access-denial response — handler may use 403 (recommended)
|
|
136
|
-
// or 400 with "access" / "permission" in the message.
|
|
137
|
-
var msg = ((_a = e === null || e === void 0 ? void 0 : e.message) !== null && _a !== void 0 ? _a : '').toLowerCase();
|
|
138
|
-
var status = (_b = e === null || e === void 0 ? void 0 : e.status) !== null && _b !== void 0 ? _b : e === null || e === void 0 ? void 0 : e.code;
|
|
139
|
-
return status === 403 || status === 401
|
|
140
|
-
|| msg.includes('access') || msg.includes('permission') || msg.includes('forbidden');
|
|
141
|
-
},
|
|
142
|
-
})
|
|
143
|
-
// 3b. generate_ai_decision must throw 403 BEFORE the early res.json({}) response.
|
|
144
|
-
// Pre-fix: handler responds 200 with {} immediately and processes in background.
|
|
145
|
-
// Post-fix: handler throws 403 before res.json({}).
|
|
146
|
-
];
|
|
147
|
-
case 6:
|
|
165
|
+
];
|
|
166
|
+
case 3:
|
|
167
|
+
// 1. Create a role that explicitly denies ai_conversations access AND endusers access.
|
|
168
|
+
// This is the realistic configuration the bypass affects: a tenant operator
|
|
169
|
+
// deliberately restricts a role from reading AI conversations / enduser PHI.
|
|
170
|
+
_j.sent();
|
|
171
|
+
// 2. Assign the role to this tenant's own non-admin user and re-authenticate so the new
|
|
172
|
+
// session reflects the role's denied permissions.
|
|
173
|
+
return [4 /*yield*/, sdk.api.users.updateOne(nonAdmin.id, { roles: [roleName] }, { replaceObjectFields: true })];
|
|
174
|
+
case 4:
|
|
175
|
+
// 2. Assign the role to this tenant's own non-admin user and re-authenticate so the new
|
|
176
|
+
// session reflects the role's denied permissions.
|
|
177
|
+
_j.sent();
|
|
178
|
+
return [4 /*yield*/, wait(undefined, 1500)];
|
|
179
|
+
case 5:
|
|
180
|
+
_j.sent();
|
|
181
|
+
return [4 /*yield*/, sdkNonAdmin_1.authenticate(nonAdmin.email, nonAdmin.password)
|
|
148
182
|
// 3a. send_message must throw 403 (or equivalent access error). Pre-fix: succeeds (or
|
|
149
183
|
// fails downstream in Bedrock without 403). Post-fix: throws before any work.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|| msg.includes('access') || msg.includes('permission') || msg.includes('forbidden');
|
|
168
|
-
},
|
|
169
|
-
})
|
|
170
|
-
// 4. Positive case: granting only ai_conversations create must pass the RBAC gate.
|
|
171
|
-
// send_message may still fail downstream (e.g. 400 "Organization has not set up credits"),
|
|
172
|
-
// but it must NOT be an access-denial error.
|
|
173
|
-
];
|
|
174
|
-
case 7:
|
|
184
|
+
];
|
|
185
|
+
case 6:
|
|
186
|
+
_j.sent();
|
|
187
|
+
// 3a. send_message must throw 403 (or equivalent access error). Pre-fix: succeeds (or
|
|
188
|
+
// fails downstream in Bedrock without 403). Post-fix: throws before any work.
|
|
189
|
+
return [4 /*yield*/, expect_rejected("ai_conversations.send_message must throw 403 when role denies ai_conversations", function () { return sdkNonAdmin_1.api.ai_conversations.send_message({
|
|
190
|
+
message: 'regression test',
|
|
191
|
+
type: 'Test',
|
|
192
|
+
}); }, function (e) {
|
|
193
|
+
var _a, _b;
|
|
194
|
+
// Accept any 4xx access-denial response — handler may use 403 (recommended)
|
|
195
|
+
// or 400 with "access" / "permission" in the message.
|
|
196
|
+
var msg = ((_a = e === null || e === void 0 ? void 0 : e.message) !== null && _a !== void 0 ? _a : '').toLowerCase();
|
|
197
|
+
var status = (_b = e === null || e === void 0 ? void 0 : e.status) !== null && _b !== void 0 ? _b : e === null || e === void 0 ? void 0 : e.code;
|
|
198
|
+
return status === 403 || status === 401
|
|
199
|
+
|| msg.includes('access') || msg.includes('permission') || msg.includes('forbidden');
|
|
200
|
+
})
|
|
175
201
|
// 3b. generate_ai_decision must throw 403 BEFORE the early res.json({}) response.
|
|
176
202
|
// Pre-fix: handler responds 200 with {} immediately and processes in background.
|
|
177
203
|
// Post-fix: handler throws 403 before res.json({}).
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
//
|
|
218
|
-
//
|
|
219
|
-
//
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
// existing conversation — send_message with conversationId returns the full stored history
|
|
243
|
-
// and appends to it. Fake id is fine: the access check must fire before any lookup.
|
|
244
|
-
_g.sent();
|
|
245
|
-
return [4 /*yield*/, sdk.api.role_based_access_permissions.createOne({
|
|
246
|
-
role: assignedRoleName,
|
|
247
|
-
permissions: __assign({}, PROVIDER_PERMISSIONS),
|
|
248
|
-
})];
|
|
249
|
-
case 14:
|
|
250
|
-
assignedRbap = _g.sent();
|
|
251
|
-
assignedRbapId = assignedRbap.id;
|
|
252
|
-
return [4 /*yield*/, sdk.api.users.updateOne(sdkNonAdmin.userInfo.id, { roles: [assignedRoleName] }, { replaceObjectFields: true })];
|
|
253
|
-
case 15:
|
|
254
|
-
_g.sent();
|
|
255
|
-
return [4 /*yield*/, wait(undefined, 1500)];
|
|
256
|
-
case 16:
|
|
257
|
-
_g.sent();
|
|
258
|
-
return [4 /*yield*/, sdkNonAdmin.authenticate(nonAdminEmail, nonAdminPassword)];
|
|
259
|
-
case 17:
|
|
260
|
-
_g.sent();
|
|
261
|
-
return [4 /*yield*/, async_test("ai_conversations.send_message must not 500 for Assigned-access (default provider) role", function () { return sdkNonAdmin.api.ai_conversations.send_message({
|
|
262
|
-
message: 'assigned-access regression test',
|
|
263
|
-
type: 'Test',
|
|
264
|
-
maxTokens: 1,
|
|
265
|
-
})
|
|
266
|
-
.then(function () { return 'ok'; })
|
|
267
|
-
.catch(function (e) {
|
|
268
|
-
var _a, _b;
|
|
269
|
-
var msg = ((_a = e === null || e === void 0 ? void 0 : e.message) !== null && _a !== void 0 ? _a : '').toLowerCase();
|
|
270
|
-
var status = (_b = e === null || e === void 0 ? void 0 : e.status) !== null && _b !== void 0 ? _b : e === null || e === void 0 ? void 0 : e.code;
|
|
271
|
-
if (status === 500 || msg.includes('internal error') || msg.includes('cannot read properties')) {
|
|
272
|
-
throw e; // the null-update crash — regression
|
|
273
|
-
}
|
|
274
|
-
if (status === 403 || status === 401
|
|
275
|
-
|| msg.includes('access') || msg.includes('permission') || msg.includes('forbidden')) {
|
|
276
|
-
throw e; // Assigned access must pass the RBAC gate
|
|
277
|
-
}
|
|
278
|
-
return 'ok'; // downstream (e.g. credits) error is fine
|
|
279
|
-
}); }, { onResult: function (r) { return r === 'ok'; } })];
|
|
280
|
-
case 18:
|
|
281
|
-
_g.sent();
|
|
282
|
-
return [3 /*break*/, 40];
|
|
283
|
-
case 19:
|
|
284
|
-
_g.trys.push([19, 21, , 22]);
|
|
285
|
-
return [4 /*yield*/, sdk.api.users.updateOne(sdkNonAdmin.userInfo.id, { roles: originalRoles !== null && originalRoles !== void 0 ? originalRoles : [] }, { replaceObjectFields: true })];
|
|
286
|
-
case 20:
|
|
287
|
-
_g.sent();
|
|
288
|
-
return [3 /*break*/, 22];
|
|
289
|
-
case 21:
|
|
290
|
-
_b = _g.sent();
|
|
291
|
-
return [3 /*break*/, 22];
|
|
292
|
-
case 22:
|
|
293
|
-
if (!rbapId) return [3 /*break*/, 26];
|
|
294
|
-
_g.label = 23;
|
|
295
|
-
case 23:
|
|
296
|
-
_g.trys.push([23, 25, , 26]);
|
|
297
|
-
return [4 /*yield*/, sdk.api.role_based_access_permissions.deleteOne(rbapId)];
|
|
298
|
-
case 24:
|
|
299
|
-
_g.sent();
|
|
300
|
-
return [3 /*break*/, 26];
|
|
301
|
-
case 25:
|
|
302
|
-
_c = _g.sent();
|
|
303
|
-
return [3 /*break*/, 26];
|
|
304
|
-
case 26:
|
|
305
|
-
if (!grantRbapId) return [3 /*break*/, 30];
|
|
306
|
-
_g.label = 27;
|
|
307
|
-
case 27:
|
|
308
|
-
_g.trys.push([27, 29, , 30]);
|
|
309
|
-
return [4 /*yield*/, sdk.api.role_based_access_permissions.deleteOne(grantRbapId)];
|
|
310
|
-
case 28:
|
|
311
|
-
_g.sent();
|
|
312
|
-
return [3 /*break*/, 30];
|
|
313
|
-
case 29:
|
|
314
|
-
_d = _g.sent();
|
|
315
|
-
return [3 /*break*/, 30];
|
|
316
|
-
case 30:
|
|
317
|
-
if (!assignedRbapId) return [3 /*break*/, 34];
|
|
318
|
-
_g.label = 31;
|
|
319
|
-
case 31:
|
|
320
|
-
_g.trys.push([31, 33, , 34]);
|
|
321
|
-
return [4 /*yield*/, sdk.api.role_based_access_permissions.deleteOne(assignedRbapId)];
|
|
322
|
-
case 32:
|
|
323
|
-
_g.sent();
|
|
324
|
-
return [3 /*break*/, 34];
|
|
325
|
-
case 33:
|
|
326
|
-
_e = _g.sent();
|
|
327
|
-
return [3 /*break*/, 34];
|
|
328
|
-
case 34:
|
|
329
|
-
// Re-authenticate the non-admin to drop the no-access role from their JWT
|
|
330
|
-
// before subsequent tests run.
|
|
331
|
-
// Role restore above re-triggers deauthenticate_user; wait > 1s so the freshly minted
|
|
332
|
-
// token's (second-floored) iat lands after the deauth timestamp and isn't permanently
|
|
333
|
-
// rejected by is_logged_in's iat-slack check. Matches the in-test re-auth above.
|
|
204
|
+
];
|
|
205
|
+
case 7:
|
|
206
|
+
// 3a. send_message must throw 403 (or equivalent access error). Pre-fix: succeeds (or
|
|
207
|
+
// fails downstream in Bedrock without 403). Post-fix: throws before any work.
|
|
208
|
+
_j.sent();
|
|
209
|
+
// 3b. generate_ai_decision must throw 403 BEFORE the early res.json({}) response.
|
|
210
|
+
// Pre-fix: handler responds 200 with {} immediately and processes in background.
|
|
211
|
+
// Post-fix: handler throws 403 before res.json({}).
|
|
212
|
+
return [4 /*yield*/, expect_rejected("ai_conversations.generate_ai_decision must throw 403 when role denies endusers/ai_conversations", function () { return sdkNonAdmin_1.api.ai_conversations.generate_ai_decision({
|
|
213
|
+
enduserId: new ObjectId().toHexString(),
|
|
214
|
+
automationStepId: new ObjectId().toHexString(),
|
|
215
|
+
outcomes: ['yes', 'no'],
|
|
216
|
+
prompt: 'regression test',
|
|
217
|
+
sources: [{ type: 'SMS', limit: 1 }], // non-empty so the validator passes; access check then fires
|
|
218
|
+
}); }, function (e) {
|
|
219
|
+
var _a, _b;
|
|
220
|
+
var msg = ((_a = e === null || e === void 0 ? void 0 : e.message) !== null && _a !== void 0 ? _a : '').toLowerCase();
|
|
221
|
+
var status = (_b = e === null || e === void 0 ? void 0 : e.status) !== null && _b !== void 0 ? _b : e === null || e === void 0 ? void 0 : e.code;
|
|
222
|
+
return status === 403 || status === 401
|
|
223
|
+
|| msg.includes('access') || msg.includes('permission') || msg.includes('forbidden');
|
|
224
|
+
})
|
|
225
|
+
// 3c. agent_message carries the SAME gate as send_message and must not be an exception:
|
|
226
|
+
// it is a second way to spend the tenant's credits and to read a stored conversation.
|
|
227
|
+
// The body is deliberately valid, so a 403 here can only come from the access check —
|
|
228
|
+
// an invalid body would 400 in validation before the gate and pass this check vacuously.
|
|
229
|
+
];
|
|
230
|
+
case 8:
|
|
231
|
+
// 3b. generate_ai_decision must throw 403 BEFORE the early res.json({}) response.
|
|
232
|
+
// Pre-fix: handler responds 200 with {} immediately and processes in background.
|
|
233
|
+
// Post-fix: handler throws 403 before res.json({}).
|
|
234
|
+
_j.sent();
|
|
235
|
+
// 3c. agent_message carries the SAME gate as send_message and must not be an exception:
|
|
236
|
+
// it is a second way to spend the tenant's credits and to read a stored conversation.
|
|
237
|
+
// The body is deliberately valid, so a 403 here can only come from the access check —
|
|
238
|
+
// an invalid body would 400 in validation before the gate and pass this check vacuously.
|
|
239
|
+
return [4 /*yield*/, expect_rejected("ai_conversations.agent_message must throw 403 when role denies ai_conversations", function () { return sdkNonAdmin_1.api.ai_conversations.agent_message({
|
|
240
|
+
messages: [{ role: 'user', content: [{ type: 'text', text: 'regression test' }] }],
|
|
241
|
+
maxTokens: 16,
|
|
242
|
+
}); }, isAccessDenial)
|
|
243
|
+
// 4. Positive case: granting only ai_conversations create must pass the RBAC gate.
|
|
244
|
+
// send_message may still fail downstream (e.g. 400 "Organization has not set up credits"),
|
|
245
|
+
// but it must NOT be an access-denial error.
|
|
246
|
+
];
|
|
247
|
+
case 9:
|
|
248
|
+
// 3c. agent_message carries the SAME gate as send_message and must not be an exception:
|
|
249
|
+
// it is a second way to spend the tenant's credits and to read a stored conversation.
|
|
250
|
+
// The body is deliberately valid, so a 403 here can only come from the access check —
|
|
251
|
+
// an invalid body would 400 in validation before the gate and pass this check vacuously.
|
|
252
|
+
_j.sent();
|
|
253
|
+
// 4. Positive case: granting only ai_conversations create must pass the RBAC gate.
|
|
254
|
+
// send_message may still fail downstream (e.g. 400 "Organization has not set up credits"),
|
|
255
|
+
// but it must NOT be an access-denial error.
|
|
256
|
+
return [4 /*yield*/, sdk.api.role_based_access_permissions.createOne({
|
|
257
|
+
role: grantRoleName,
|
|
258
|
+
permissions: __assign(__assign({}, PROVIDER_PERMISSIONS), { ai_conversations: { create: 'All', read: null, update: null, delete: null } }),
|
|
259
|
+
})];
|
|
260
|
+
case 10:
|
|
261
|
+
// 4. Positive case: granting only ai_conversations create must pass the RBAC gate.
|
|
262
|
+
// send_message may still fail downstream (e.g. 400 "Organization has not set up credits"),
|
|
263
|
+
// but it must NOT be an access-denial error.
|
|
264
|
+
_j.sent();
|
|
265
|
+
return [4 /*yield*/, sdk.api.users.updateOne(nonAdmin.id, { roles: [grantRoleName] }, { replaceObjectFields: true })];
|
|
266
|
+
case 11:
|
|
267
|
+
_j.sent();
|
|
334
268
|
return [4 /*yield*/, wait(undefined, 1500)];
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
269
|
+
case 12:
|
|
270
|
+
_j.sent();
|
|
271
|
+
return [4 /*yield*/, sdkNonAdmin_1.authenticate(nonAdmin.email, nonAdmin.password)];
|
|
272
|
+
case 13:
|
|
273
|
+
_j.sent();
|
|
274
|
+
label = "ai_conversations.send_message must NOT be access-denied when role grants create";
|
|
275
|
+
outcome = void 0;
|
|
276
|
+
_j.label = 14;
|
|
277
|
+
case 14:
|
|
278
|
+
_j.trys.push([14, 16, , 17]);
|
|
279
|
+
_a = { resolved: true };
|
|
280
|
+
return [4 /*yield*/, sdkNonAdmin_1.api.ai_conversations.send_message({
|
|
281
|
+
message: 'positive-case test',
|
|
282
|
+
type: 'Test',
|
|
283
|
+
maxTokens: 1,
|
|
284
|
+
})];
|
|
285
|
+
case 15:
|
|
286
|
+
outcome = (_a.value = _j.sent(), _a);
|
|
287
|
+
return [3 /*break*/, 17];
|
|
288
|
+
case 16:
|
|
289
|
+
e_1 = _j.sent();
|
|
290
|
+
outcome = { resolved: false, error: e_1 };
|
|
291
|
+
return [3 /*break*/, 17];
|
|
292
|
+
case 17:
|
|
293
|
+
// A downstream (e.g. credits) error is fine — the gate passed. An access denial is not.
|
|
294
|
+
record(label, outcome.resolved || !isAccessDenial(outcome.error), outcome.resolved
|
|
295
|
+
? "allowed; result=".concat(describe(outcome.value))
|
|
296
|
+
: "gate passed, rejected downstream with ".concat(errorMessage(outcome.error)));
|
|
297
|
+
label = "ai_conversations.agent_message must NOT be access-denied when role grants create";
|
|
298
|
+
outcome = void 0;
|
|
299
|
+
_j.label = 18;
|
|
300
|
+
case 18:
|
|
301
|
+
_j.trys.push([18, 20, , 21]);
|
|
302
|
+
_b = { resolved: true };
|
|
303
|
+
return [4 /*yield*/, sdkNonAdmin_1.api.ai_conversations.agent_message({
|
|
304
|
+
messages: [{ role: 'user', content: [{ type: 'text', text: 'positive-case test' }] }],
|
|
305
|
+
maxTokens: 16,
|
|
306
|
+
})];
|
|
307
|
+
case 19:
|
|
308
|
+
outcome = (_b.value = _j.sent(), _b);
|
|
309
|
+
return [3 /*break*/, 21];
|
|
310
|
+
case 20:
|
|
311
|
+
e_2 = _j.sent();
|
|
312
|
+
outcome = { resolved: false, error: e_2 };
|
|
313
|
+
return [3 /*break*/, 21];
|
|
314
|
+
case 21:
|
|
315
|
+
// A downstream (e.g. credits) error is fine — the gate passed. An access denial is not.
|
|
316
|
+
record(label, outcome.resolved || !isAccessDenial(outcome.error), outcome.resolved
|
|
317
|
+
? "allowed; result=".concat(describe(outcome.value))
|
|
318
|
+
: "gate passed, rejected downstream with ".concat(errorMessage(outcome.error)));
|
|
319
|
+
// 5. The create-granted (read/update-denied) role must still be blocked from CONTINUING an
|
|
320
|
+
// existing conversation — send_message with conversationId returns the full stored history
|
|
321
|
+
// and appends to it. Fake id is fine: the access check must fire before any lookup.
|
|
322
|
+
return [4 /*yield*/, expect_rejected("ai_conversations.send_message with conversationId must 403 when role denies read/update", function () { return sdkNonAdmin_1.api.ai_conversations.send_message({
|
|
323
|
+
message: 'conversationId bypass test',
|
|
324
|
+
type: 'Test',
|
|
325
|
+
maxTokens: 1,
|
|
326
|
+
conversationId: new ObjectId().toHexString(),
|
|
327
|
+
}); }, function (e) {
|
|
328
|
+
var _a, _b;
|
|
329
|
+
var msg = ((_a = e === null || e === void 0 ? void 0 : e.message) !== null && _a !== void 0 ? _a : '').toLowerCase();
|
|
330
|
+
var status = (_b = e === null || e === void 0 ? void 0 : e.status) !== null && _b !== void 0 ? _b : e === null || e === void 0 ? void 0 : e.code;
|
|
331
|
+
return status === 403 || status === 401
|
|
332
|
+
|| msg.includes('access') || msg.includes('permission') || msg.includes('forbidden');
|
|
333
|
+
})];
|
|
334
|
+
case 22:
|
|
335
|
+
// 5. The create-granted (read/update-denied) role must still be blocked from CONTINUING an
|
|
336
|
+
// existing conversation — send_message with conversationId returns the full stored history
|
|
337
|
+
// and appends to it. Fake id is fine: the access check must fire before any lookup.
|
|
338
|
+
_j.sent();
|
|
339
|
+
return [4 /*yield*/, expect_rejected("ai_conversations.agent_message with conversationId must 403 when role denies read/update", function () { return sdkNonAdmin_1.api.ai_conversations.agent_message({
|
|
340
|
+
messages: [{ role: 'user', content: [{ type: 'text', text: 'conversationId bypass test' }] }],
|
|
341
|
+
maxTokens: 16,
|
|
342
|
+
conversationId: new ObjectId().toHexString(),
|
|
343
|
+
}); }, isAccessDenial)
|
|
344
|
+
// 6. Regression: a role with default provider permissions (ai_conversations = Assigned)
|
|
345
|
+
// must be able to generate a new conversation without a 500. Previously the
|
|
346
|
+
// post-generation $push ran through the access-scoped DB, matched nothing under
|
|
347
|
+
// "Assigned", and crashed the handler with "Cannot read properties of null ('_id')".
|
|
348
|
+
//
|
|
349
|
+
// GATE-ONLY, by construction: organizations.creditCount is readonly in the schema, so a
|
|
350
|
+
// provisioned tenant has no credits and send_message 400s on credits BEFORE it reaches the
|
|
351
|
+
// $push this check guards. What it still proves is that the Assigned role passes the RBAC
|
|
352
|
+
// gate and the handler does not 500 on the way — the observed error is printed in the
|
|
353
|
+
// detail so a change of failure mode is visible in the check table rather than silent.
|
|
354
|
+
];
|
|
355
|
+
case 23:
|
|
356
|
+
_j.sent();
|
|
357
|
+
// 6. Regression: a role with default provider permissions (ai_conversations = Assigned)
|
|
358
|
+
// must be able to generate a new conversation without a 500. Previously the
|
|
359
|
+
// post-generation $push ran through the access-scoped DB, matched nothing under
|
|
360
|
+
// "Assigned", and crashed the handler with "Cannot read properties of null ('_id')".
|
|
361
|
+
//
|
|
362
|
+
// GATE-ONLY, by construction: organizations.creditCount is readonly in the schema, so a
|
|
363
|
+
// provisioned tenant has no credits and send_message 400s on credits BEFORE it reaches the
|
|
364
|
+
// $push this check guards. What it still proves is that the Assigned role passes the RBAC
|
|
365
|
+
// gate and the handler does not 500 on the way — the observed error is printed in the
|
|
366
|
+
// detail so a change of failure mode is visible in the check table rather than silent.
|
|
367
|
+
return [4 /*yield*/, sdk.api.role_based_access_permissions.createOne({
|
|
368
|
+
role: assignedRoleName,
|
|
369
|
+
permissions: __assign({}, PROVIDER_PERMISSIONS),
|
|
370
|
+
})];
|
|
371
|
+
case 24:
|
|
372
|
+
// 6. Regression: a role with default provider permissions (ai_conversations = Assigned)
|
|
373
|
+
// must be able to generate a new conversation without a 500. Previously the
|
|
374
|
+
// post-generation $push ran through the access-scoped DB, matched nothing under
|
|
375
|
+
// "Assigned", and crashed the handler with "Cannot read properties of null ('_id')".
|
|
376
|
+
//
|
|
377
|
+
// GATE-ONLY, by construction: organizations.creditCount is readonly in the schema, so a
|
|
378
|
+
// provisioned tenant has no credits and send_message 400s on credits BEFORE it reaches the
|
|
379
|
+
// $push this check guards. What it still proves is that the Assigned role passes the RBAC
|
|
380
|
+
// gate and the handler does not 500 on the way — the observed error is printed in the
|
|
381
|
+
// detail so a change of failure mode is visible in the check table rather than silent.
|
|
382
|
+
_j.sent();
|
|
383
|
+
return [4 /*yield*/, sdk.api.users.updateOne(nonAdmin.id, { roles: [assignedRoleName] }, { replaceObjectFields: true })];
|
|
384
|
+
case 25:
|
|
385
|
+
_j.sent();
|
|
386
|
+
return [4 /*yield*/, wait(undefined, 1500)];
|
|
387
|
+
case 26:
|
|
388
|
+
_j.sent();
|
|
389
|
+
return [4 /*yield*/, sdkNonAdmin_1.authenticate(nonAdmin.email, nonAdmin.password)];
|
|
390
|
+
case 27:
|
|
391
|
+
_j.sent();
|
|
392
|
+
label = "ai_conversations.send_message must not 500 for Assigned-access (default provider) role";
|
|
393
|
+
outcome = void 0;
|
|
394
|
+
_j.label = 28;
|
|
395
|
+
case 28:
|
|
396
|
+
_j.trys.push([28, 30, , 31]);
|
|
397
|
+
_c = { resolved: true };
|
|
398
|
+
return [4 /*yield*/, sdkNonAdmin_1.api.ai_conversations.send_message({
|
|
399
|
+
message: 'assigned-access regression test',
|
|
400
|
+
type: 'Test',
|
|
401
|
+
maxTokens: 1,
|
|
402
|
+
})];
|
|
403
|
+
case 29:
|
|
404
|
+
outcome = (_c.value = _j.sent(), _c);
|
|
405
|
+
return [3 /*break*/, 31];
|
|
406
|
+
case 30:
|
|
407
|
+
e_3 = _j.sent();
|
|
408
|
+
outcome = { resolved: false, error: e_3 };
|
|
409
|
+
return [3 /*break*/, 31];
|
|
410
|
+
case 31:
|
|
411
|
+
if (outcome.resolved) {
|
|
412
|
+
record(label, true, "ok; result=".concat(describe(outcome.value)));
|
|
413
|
+
}
|
|
414
|
+
else {
|
|
415
|
+
e = outcome.error;
|
|
416
|
+
msg = ((_e = e === null || e === void 0 ? void 0 : e.message) !== null && _e !== void 0 ? _e : '').toLowerCase();
|
|
417
|
+
status_1 = (_f = e === null || e === void 0 ? void 0 : e.status) !== null && _f !== void 0 ? _f : e === null || e === void 0 ? void 0 : e.code;
|
|
418
|
+
isCrash = status_1 === 500 || msg.includes('internal error') || msg.includes('cannot read properties');
|
|
419
|
+
record(label, !isCrash && !isAccessDenial(e), // the null-update crash, and an Assigned denial, are both regressions
|
|
420
|
+
"".concat(isCrash ? 'CRASHED' : isAccessDenial(e) ? 'ACCESS-DENIED' : 'gate passed, rejected downstream')
|
|
421
|
+
+ " with ".concat(errorMessage(e)));
|
|
422
|
+
}
|
|
423
|
+
label = "ai_conversations.agent_message must not 500 for Assigned-access (default provider) role";
|
|
424
|
+
outcome = void 0;
|
|
425
|
+
_j.label = 32;
|
|
426
|
+
case 32:
|
|
427
|
+
_j.trys.push([32, 34, , 35]);
|
|
428
|
+
_d = { resolved: true };
|
|
429
|
+
return [4 /*yield*/, sdkNonAdmin_1.api.ai_conversations.agent_message({
|
|
430
|
+
messages: [{ role: 'user', content: [{ type: 'text', text: 'assigned-access regression test' }] }],
|
|
431
|
+
maxTokens: 16,
|
|
432
|
+
})];
|
|
433
|
+
case 33:
|
|
434
|
+
outcome = (_d.value = _j.sent(), _d);
|
|
435
|
+
return [3 /*break*/, 35];
|
|
436
|
+
case 34:
|
|
437
|
+
e_4 = _j.sent();
|
|
438
|
+
outcome = { resolved: false, error: e_4 };
|
|
439
|
+
return [3 /*break*/, 35];
|
|
440
|
+
case 35:
|
|
441
|
+
if (outcome.resolved) {
|
|
442
|
+
record(label, true, "ok; result=".concat(describe(outcome.value)));
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
e = outcome.error;
|
|
446
|
+
msg = ((_g = e === null || e === void 0 ? void 0 : e.message) !== null && _g !== void 0 ? _g : '').toLowerCase();
|
|
447
|
+
status_2 = (_h = e === null || e === void 0 ? void 0 : e.status) !== null && _h !== void 0 ? _h : e === null || e === void 0 ? void 0 : e.code;
|
|
448
|
+
isCrash = status_2 === 500 || msg.includes('internal error') || msg.includes('cannot read properties');
|
|
449
|
+
record(label, !isCrash && !isAccessDenial(e), "".concat(isCrash ? 'CRASHED' : isAccessDenial(e) ? 'ACCESS-DENIED' : 'gate passed, rejected downstream')
|
|
450
|
+
+ " with ".concat(errorMessage(e)));
|
|
451
|
+
}
|
|
452
|
+
return [3 /*break*/, 41];
|
|
453
|
+
case 36:
|
|
454
|
+
if (!tenant) return [3 /*break*/, 40];
|
|
455
|
+
_j.label = 37;
|
|
456
|
+
case 37:
|
|
457
|
+
_j.trys.push([37, 39, , 40]);
|
|
458
|
+
return [4 /*yield*/, tenant.teardown()];
|
|
459
|
+
case 38:
|
|
460
|
+
_j.sent();
|
|
461
|
+
return [3 /*break*/, 40];
|
|
462
|
+
case 39:
|
|
463
|
+
e_5 = _j.sent();
|
|
464
|
+
console.error('teardown failed', e_5);
|
|
465
|
+
return [3 /*break*/, 40];
|
|
466
|
+
case 40: return [7 /*endfinally*/];
|
|
467
|
+
case 41: return [2 /*return*/, checks];
|
|
468
|
+
}
|
|
356
469
|
});
|
|
470
|
+
}); };
|
|
471
|
+
/** Asserting wrapper, for standalone runs. */
|
|
472
|
+
export var ai_conversations_rbac_tests = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
473
|
+
var _a, _b;
|
|
474
|
+
return __generator(this, function (_c) {
|
|
475
|
+
switch (_c.label) {
|
|
476
|
+
case 0:
|
|
477
|
+
_a = assert_checks;
|
|
478
|
+
_b = ['ai_conversations RBAC'];
|
|
479
|
+
return [4 /*yield*/, ai_conversations_rbac_checks()];
|
|
480
|
+
case 1:
|
|
481
|
+
_a.apply(void 0, _b.concat([_c.sent()]));
|
|
482
|
+
return [2 /*return*/];
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
}); };
|
|
486
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
487
|
+
export var ISOLATED_SUITE = {
|
|
488
|
+
name: 'ai_conversations RBAC',
|
|
489
|
+
run: ai_conversations_rbac_checks,
|
|
357
490
|
};
|
|
358
491
|
// Allow running this test file independently
|
|
359
492
|
if (require.main === module) {
|
|
360
493
|
console.log("\uD83C\uDF10 Using API URL: ".concat(host));
|
|
361
|
-
|
|
362
|
-
var sdkNonAdmin_1 = new Session({ host: host });
|
|
363
|
-
var runTests = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
364
|
-
return __generator(this, function (_a) {
|
|
365
|
-
switch (_a.label) {
|
|
366
|
-
case 0: return [4 /*yield*/, setup_tests(sdk_1, sdkNonAdmin_1)];
|
|
367
|
-
case 1:
|
|
368
|
-
_a.sent();
|
|
369
|
-
return [4 /*yield*/, ai_conversations_rbac_tests({ sdk: sdk_1, sdkNonAdmin: sdkNonAdmin_1 })];
|
|
370
|
-
case 2:
|
|
371
|
-
_a.sent();
|
|
372
|
-
return [2 /*return*/];
|
|
373
|
-
}
|
|
374
|
-
});
|
|
375
|
-
}); };
|
|
376
|
-
runTests()
|
|
494
|
+
ai_conversations_rbac_tests()
|
|
377
495
|
.then(function () {
|
|
378
496
|
console.log("✅ ai_conversations RBAC test suite completed successfully");
|
|
379
497
|
process.exit(0);
|