@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,14 +1,16 @@
|
|
|
1
1
|
require('source-map-support').install();
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { EnduserSession } from "../../../sdk"
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
assert_checks,
|
|
6
|
+
Check,
|
|
7
|
+
IsolatedSuite,
|
|
8
|
+
setup_isolated_tenant,
|
|
9
|
+
} from "../../setup_isolated"
|
|
9
10
|
|
|
10
11
|
const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
const RAND = () => Math.random().toString(36).slice(2, 10)
|
|
12
14
|
|
|
13
15
|
const ENDUSER_PASSWORD = 'F0106TestPassword!123'
|
|
14
16
|
|
|
@@ -84,16 +86,93 @@ const restrictedFormResponseUpdates = (staffId: string, otherEnduserId: string):
|
|
|
84
86
|
* - nothing persists (spot-checked on assignedTo, the highest-impact field)
|
|
85
87
|
* - enduser self-updates of allowed fields still work (fname, hideFromEnduserPortal)
|
|
86
88
|
* - staff sessions can still update the restricted fields
|
|
89
|
+
*
|
|
90
|
+
* Runs on its own provisioned tenant, so the patient session's businessId comes from the tenant
|
|
91
|
+
* rather than a TEST_BUSINESS_ID env var with a hardcoded shared-org fallback. Checks are collected
|
|
92
|
+
* and returned rather than asserted inline: `assert` calls process.exit, which would skip this
|
|
93
|
+
* suite's `finally` cleanup and, in the parallel pool, every other in-flight suite's teardown.
|
|
87
94
|
*/
|
|
88
|
-
export const
|
|
89
|
-
|
|
95
|
+
export const enduser_write_restrictions_checks = async (): Promise<Check[]> => {
|
|
96
|
+
const checks: Check[] = []
|
|
97
|
+
const record = (label: string, pass: boolean, detail: string) => checks.push({ label, pass, detail })
|
|
98
|
+
|
|
99
|
+
// The raw value decides the fallback, not JSON.stringify of it — JSON.stringify('') is '""',
|
|
100
|
+
// which is truthy, so a `|| fallback` on the stringified form could never fire.
|
|
101
|
+
const describe = (value: any): string => {
|
|
102
|
+
if (value === undefined || value === null) return String(value)
|
|
103
|
+
const stringified = JSON.stringify(value)
|
|
104
|
+
return stringified === undefined ? String(value) : stringified
|
|
105
|
+
}
|
|
106
|
+
const errorMessage = (e: any): string => (
|
|
107
|
+
typeof e?.message === 'string' && e.message !== '' ? e.message : describe(e)
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
/** The async_test({ shouldError, onError }) equivalent, as a soft Check. */
|
|
111
|
+
const expect_rejection = async (
|
|
112
|
+
label: string,
|
|
113
|
+
fn: () => Promise<any>,
|
|
114
|
+
expectedMessage: string,
|
|
115
|
+
) => {
|
|
116
|
+
let error: any
|
|
117
|
+
let rejected = false
|
|
118
|
+
try {
|
|
119
|
+
await fn()
|
|
120
|
+
} catch (e: any) {
|
|
121
|
+
rejected = true
|
|
122
|
+
error = e
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (!rejected) {
|
|
126
|
+
// deliberately does NOT print the record: it is a patient profile / form response
|
|
127
|
+
record(label, false, `NOT REJECTED: the update succeeded (expected "${expectedMessage}")`)
|
|
128
|
+
return
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const message = errorMessage(error)
|
|
132
|
+
record(
|
|
133
|
+
label,
|
|
134
|
+
message === expectedMessage,
|
|
135
|
+
message === expectedMessage
|
|
136
|
+
? `rejected: ${message}`
|
|
137
|
+
: `rejected with the WRONG error: ${message} (expected "${expectedMessage}")`,
|
|
138
|
+
)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* The async_test({ onResult }) equivalent, as a soft Check: a call that REJECTS is a failure
|
|
143
|
+
* (async_test treats it the same way), and a resolved call passes only when `inspect` agrees.
|
|
144
|
+
* `inspect` runs inside the try so a throw inside it fails this one check rather than escaping
|
|
145
|
+
* `run` and aborting every other suite in the batch. It returns the detail too, rather than this
|
|
146
|
+
* dumping the whole record — an enduser and a FormResponse carry the patient's name, email and
|
|
147
|
+
* answers, and the check table prints on every run.
|
|
148
|
+
*/
|
|
149
|
+
const expect_result = async <T,>(
|
|
150
|
+
label: string,
|
|
151
|
+
fn: () => Promise<T>,
|
|
152
|
+
inspect: (r: T) => { pass: boolean, detail: string },
|
|
153
|
+
) => {
|
|
154
|
+
try {
|
|
155
|
+
const { pass, detail } = inspect(await fn())
|
|
156
|
+
record(label, pass, detail)
|
|
157
|
+
} catch (e: any) {
|
|
158
|
+
record(label, false, `rejected instead of resolving: ${errorMessage(e)}`)
|
|
159
|
+
}
|
|
160
|
+
}
|
|
90
161
|
|
|
162
|
+
let tenant: Awaited<ReturnType<typeof setup_isolated_tenant>> | undefined
|
|
91
163
|
let enduserId: string | undefined
|
|
92
164
|
let otherEnduserId: string | undefined
|
|
93
165
|
let formId: string | undefined
|
|
94
166
|
let formResponseId: string | undefined
|
|
95
167
|
|
|
96
168
|
try {
|
|
169
|
+
tenant = await setup_isolated_tenant({
|
|
170
|
+
name: `Enduser write restrictions ${RAND()}`,
|
|
171
|
+
users: [{ isAdmin: true }],
|
|
172
|
+
apiKeys: 0,
|
|
173
|
+
})
|
|
174
|
+
const { sdk } = tenant
|
|
175
|
+
|
|
97
176
|
// Setup: throwaway enduser with portal credentials, plus a form_response they own
|
|
98
177
|
const enduserEmail = `f0106-enduser-${Date.now()}@example.com`
|
|
99
178
|
const enduser = await sdk.api.endusers.createOne({ email: enduserEmail, fname: 'F0106', lname: 'Restricted' })
|
|
@@ -106,7 +185,7 @@ export const enduser_write_restrictions_tests = async ({ sdk } : { sdk: Session,
|
|
|
106
185
|
otherEnduserId = otherEnduser.id
|
|
107
186
|
await sdk.api.endusers.set_password({ id: enduser.id, password: ENDUSER_PASSWORD })
|
|
108
187
|
|
|
109
|
-
const enduserSDK = new EnduserSession({ host, businessId })
|
|
188
|
+
const enduserSDK = new EnduserSession({ host, businessId: tenant.businessId })
|
|
110
189
|
await enduserSDK.authenticate(enduserEmail, ENDUSER_PASSWORD)
|
|
111
190
|
|
|
112
191
|
const form = await sdk.api.forms.createOne({ title: 'Write Restriction Test Form' })
|
|
@@ -119,54 +198,69 @@ export const enduser_write_restrictions_tests = async ({ sdk } : { sdk: Session,
|
|
|
119
198
|
|
|
120
199
|
// ---- enduser self-update of restricted endusers fields must 400 ----
|
|
121
200
|
for (const [field, value] of Object.entries(restrictedEnduserUpdates(sdk.userInfo.id, enduser.id))) {
|
|
122
|
-
await
|
|
201
|
+
await expect_rejection(
|
|
123
202
|
`enduser cannot self-update endusers.${field}`,
|
|
124
203
|
() => enduserSDK.api.endusers.updateOne(enduser.id, { [field]: value } as any),
|
|
125
|
-
|
|
204
|
+
`${field} cannot be updated by endusers`,
|
|
126
205
|
)
|
|
127
206
|
}
|
|
128
207
|
|
|
129
208
|
// Variant A persistence check: the rejected assignedTo write must not
|
|
130
209
|
// have granted the staff read-filter match.
|
|
131
|
-
await
|
|
210
|
+
await expect_result(
|
|
132
211
|
'rejected assignedTo write did not persist',
|
|
133
212
|
() => sdk.api.endusers.getOne(enduser.id),
|
|
134
|
-
|
|
213
|
+
e => ({
|
|
214
|
+
pass: !e.assignedTo?.length && !e.tags?.length && e.externalId === undefined,
|
|
215
|
+
detail: `assignedTo=${describe(e.assignedTo)} tags=${describe(e.tags)} `
|
|
216
|
+
+ `externalId=${describe(e.externalId)} (want none of them set)`,
|
|
217
|
+
}),
|
|
135
218
|
)
|
|
136
219
|
|
|
137
220
|
// ---- enduser self-update of restricted form_responses fields must 400 ----
|
|
138
221
|
for (const [field, value] of Object.entries(restrictedFormResponseUpdates(sdk.userInfo.id, otherEnduser.id))) {
|
|
139
|
-
await
|
|
222
|
+
await expect_rejection(
|
|
140
223
|
`enduser cannot self-update form_responses.${field}`,
|
|
141
224
|
() => enduserSDK.api.form_responses.updateOne(formResponse.id, { [field]: value } as any),
|
|
142
|
-
|
|
225
|
+
`${field} cannot be updated by endusers`,
|
|
143
226
|
)
|
|
144
227
|
}
|
|
145
228
|
|
|
146
|
-
await
|
|
229
|
+
await expect_result(
|
|
147
230
|
'rejected writes did not persist (markedAsSubmitted, procedureCodes, submittedBy, enduserId)',
|
|
148
231
|
() => sdk.api.form_responses.getOne(formResponse.id),
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
232
|
+
fr => ({
|
|
233
|
+
pass: (
|
|
234
|
+
!fr.markedAsSubmitted && !fr.procedureCodes?.length && fr.submittedBy === undefined
|
|
235
|
+
// still points at its own patient: a successful repoint is what redirects the intake write
|
|
236
|
+
&& fr.enduserId === enduser.id
|
|
237
|
+
),
|
|
238
|
+
detail: `markedAsSubmitted=${describe(fr.markedAsSubmitted)} `
|
|
239
|
+
+ `procedureCodes=${describe(fr.procedureCodes?.length)} submittedBy=${describe(fr.submittedBy)} `
|
|
240
|
+
+ `enduserId matches own=${describe(fr.enduserId === enduser.id)}`,
|
|
241
|
+
}),
|
|
154
242
|
)
|
|
155
243
|
|
|
156
244
|
// ---- Positive controls: intended enduser self-updates still work ----
|
|
157
|
-
await
|
|
245
|
+
await expect_result(
|
|
158
246
|
'enduser can still update own profile fields (fname/lname)',
|
|
159
247
|
() => enduserSDK.api.endusers.updateOne(enduser.id, { fname: 'StillAllowed', lname: 'Patient' }),
|
|
160
|
-
|
|
248
|
+
e => ({
|
|
249
|
+
pass: e.fname === 'StillAllowed' && e.lname === 'Patient',
|
|
250
|
+
detail: `fname set=${describe(e.fname === 'StillAllowed')} lname set=${describe(e.lname === 'Patient')}`,
|
|
251
|
+
}),
|
|
161
252
|
)
|
|
162
|
-
await
|
|
253
|
+
await expect_result(
|
|
163
254
|
'enduser can still update own form_response (hideFromEnduserPortal — intended per schema)',
|
|
164
255
|
() => enduserSDK.api.form_responses.updateOne(formResponse.id, { hideFromEnduserPortal: true }),
|
|
165
|
-
|
|
256
|
+
fr => ({
|
|
257
|
+
pass: fr.hideFromEnduserPortal === true,
|
|
258
|
+
detail: `hideFromEnduserPortal=${describe(fr.hideFromEnduserPortal)} (want true)`,
|
|
259
|
+
}),
|
|
166
260
|
)
|
|
167
261
|
|
|
168
262
|
// ---- Positive controls: staff sessions are unaffected by enduserUpdatesDisabled ----
|
|
169
|
-
await
|
|
263
|
+
await expect_result(
|
|
170
264
|
'staff can still update restricted endusers fields (tags, assignedTo, externalId, note, source)',
|
|
171
265
|
() => sdk.api.endusers.updateOne(enduser.id, {
|
|
172
266
|
tags: ['staff-set-tag'],
|
|
@@ -175,66 +269,90 @@ export const enduser_write_restrictions_tests = async ({ sdk } : { sdk: Session,
|
|
|
175
269
|
note: 'staff-set note',
|
|
176
270
|
source: 'staff-set-source',
|
|
177
271
|
}),
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
272
|
+
e => ({
|
|
273
|
+
pass: (
|
|
274
|
+
!!e.tags?.includes('staff-set-tag')
|
|
275
|
+
&& !!e.assignedTo?.includes(sdk.userInfo.id)
|
|
276
|
+
&& e.externalId === 'staff-set-external-id'
|
|
277
|
+
),
|
|
278
|
+
detail: `tags=${describe(e.tags)} assignedTo includes staff=`
|
|
279
|
+
+ `${describe(!!e.assignedTo?.includes(sdk.userInfo.id))} externalId=${describe(e.externalId)}`,
|
|
280
|
+
}),
|
|
183
281
|
)
|
|
184
|
-
await
|
|
282
|
+
await expect_result(
|
|
185
283
|
'staff can still update restricted form_responses fields (procedureCodes, diagnosisCodes, tags)',
|
|
186
284
|
() => sdk.api.form_responses.updateOne(formResponse.id, {
|
|
187
285
|
procedureCodes: [{ code: 'G0019', units: 1 }],
|
|
188
286
|
diagnosisCodes: [{ code: 'Z71.3', description: 'Dietary counseling and surveillance' }],
|
|
189
287
|
tags: ['staff-set-tag'],
|
|
190
288
|
}),
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
289
|
+
fr => ({
|
|
290
|
+
pass: (
|
|
291
|
+
fr.procedureCodes?.[0]?.code === 'G0019'
|
|
292
|
+
&& fr.diagnosisCodes?.[0]?.code === 'Z71.3'
|
|
293
|
+
&& !!fr.tags?.includes('staff-set-tag')
|
|
294
|
+
),
|
|
295
|
+
detail: `procedureCodes[0].code=${describe(fr.procedureCodes?.[0]?.code)} `
|
|
296
|
+
+ `diagnosisCodes[0].code=${describe(fr.diagnosisCodes?.[0]?.code)} tags=${describe(fr.tags)}`,
|
|
297
|
+
}),
|
|
196
298
|
)
|
|
197
299
|
|
|
198
300
|
// enduserId is enduserUpdatesDisabled rather than updatesDisabled specifically so this keeps
|
|
199
301
|
// working: staff sometimes need to move a response to the correct profile to fix a mistake.
|
|
200
|
-
await
|
|
302
|
+
await expect_result(
|
|
201
303
|
'staff can still repoint form_responses.enduserId to another patient',
|
|
202
304
|
() => sdk.api.form_responses.updateOne(formResponse.id, { enduserId: otherEnduser.id }),
|
|
203
|
-
|
|
305
|
+
fr => ({
|
|
306
|
+
pass: fr.enduserId === otherEnduser.id,
|
|
307
|
+
detail: `repointed to the other patient=${describe(fr.enduserId === otherEnduser.id)}`,
|
|
308
|
+
}),
|
|
204
309
|
)
|
|
205
|
-
await
|
|
310
|
+
await expect_result(
|
|
206
311
|
'staff can repoint form_responses.enduserId back',
|
|
207
312
|
() => sdk.api.form_responses.updateOne(formResponse.id, { enduserId: enduser.id }),
|
|
208
|
-
|
|
313
|
+
fr => ({
|
|
314
|
+
pass: fr.enduserId === enduser.id,
|
|
315
|
+
detail: `repointed back to the owner=${describe(fr.enduserId === enduser.id)}`,
|
|
316
|
+
}),
|
|
209
317
|
)
|
|
210
318
|
} finally {
|
|
211
|
-
if (
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
319
|
+
if (tenant) {
|
|
320
|
+
const { sdk } = tenant
|
|
321
|
+
if (formResponseId) {
|
|
322
|
+
try { await sdk.api.form_responses.deleteOne(formResponseId) } catch {}
|
|
323
|
+
}
|
|
324
|
+
if (formId) {
|
|
325
|
+
try { await sdk.api.forms.deleteOne(formId) } catch {}
|
|
326
|
+
}
|
|
327
|
+
if (enduserId) {
|
|
328
|
+
try { await sdk.api.endusers.deleteOne(enduserId) } catch {}
|
|
329
|
+
}
|
|
330
|
+
if (otherEnduserId) {
|
|
331
|
+
try { await sdk.api.endusers.deleteOne(otherEnduserId) } catch {}
|
|
332
|
+
}
|
|
333
|
+
// Teardown BEFORE anything asserts — assert calls process.exit, which would strand this tenant.
|
|
334
|
+
try { await tenant.teardown() } catch (e) { console.error('teardown failed', e) }
|
|
222
335
|
}
|
|
223
336
|
}
|
|
337
|
+
|
|
338
|
+
return checks
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/** Asserting wrapper, for standalone runs. */
|
|
342
|
+
export const enduser_write_restrictions_tests = async () => {
|
|
343
|
+
assert_checks('Enduser write restrictions', await enduser_write_restrictions_checks())
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
347
|
+
export const ISOLATED_SUITE: IsolatedSuite = {
|
|
348
|
+
name: 'Enduser write restrictions',
|
|
349
|
+
run: enduser_write_restrictions_checks,
|
|
224
350
|
}
|
|
225
351
|
|
|
226
352
|
// Allow running this test file independently
|
|
227
353
|
if (require.main === module) {
|
|
228
354
|
console.log(`🌐 Using API URL: ${host}`)
|
|
229
|
-
|
|
230
|
-
const sdkNonAdmin = new Session({ host })
|
|
231
|
-
|
|
232
|
-
const runTests = async () => {
|
|
233
|
-
await setup_tests(sdk, sdkNonAdmin)
|
|
234
|
-
await enduser_write_restrictions_tests({ sdk, sdkNonAdmin })
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
runTests()
|
|
355
|
+
enduser_write_restrictions_tests()
|
|
238
356
|
.then(() => {
|
|
239
357
|
console.log("✅ enduser write-restriction test suite completed successfully")
|
|
240
358
|
process.exit(0)
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
require('source-map-support').install();
|
|
2
2
|
|
|
3
|
-
import { Session } from "../../../sdk"
|
|
4
3
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
assert_checks,
|
|
5
|
+
Check,
|
|
6
|
+
setup_isolated_tenant,
|
|
7
|
+
IsolatedSuite,
|
|
8
|
+
IsolatedTenant,
|
|
9
|
+
} from "../../setup_isolated"
|
|
9
10
|
|
|
10
11
|
const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
11
12
|
|
|
13
|
+
const RAND = () => Math.random().toString(36).slice(2, 10)
|
|
14
|
+
|
|
15
|
+
/** The only keys the redacted `existingRecord` may carry. `convert_id_name` never runs on an error
|
|
16
|
+
* body, so the raw `_id` is what ships; `id` is tolerated in case that ever changes. */
|
|
17
|
+
const ALLOWED_EXISTING_RECORD_KEYS = ['_id', 'id', 'businessId']
|
|
18
|
+
|
|
12
19
|
/**
|
|
13
20
|
* Regression test: a globalUnique conflict response must not echo the matched record.
|
|
14
21
|
*
|
|
@@ -19,59 +26,171 @@ const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
|
19
26
|
* (globalUnique: ['email','phone']) the 409 body leaked the full record incl. hashedPass.
|
|
20
27
|
*
|
|
21
28
|
* Fix: redact existingRecord to { _id, businessId } like the safe validateUniquenessConstraints
|
|
22
|
-
* path.
|
|
23
|
-
* 409
|
|
29
|
+
* path. Both checks below drive that block directly with `_overrideUnique: true`, which is what
|
|
30
|
+
* skips `validateUniquenessConstraints` (a separate 409 with its own redaction, out of scope here).
|
|
31
|
+
*
|
|
32
|
+
* 1. Same-tenant collision — the original coverage, preserved.
|
|
33
|
+
* 2. Cross-tenant collision — tenant B re-creates tenant A's address. This is the case that
|
|
34
|
+
* actually exercises the leak: `findSomeByMatchAny_Global` drops `businessId`, so only a
|
|
35
|
+
* foreign match can carry another tenant's data, and the check pins
|
|
36
|
+
* `existingRecord.businessId === tenantA.businessId` so a same-tenant match cannot satisfy it.
|
|
37
|
+
* Returning the other tenant's `_id` + `businessId` is the accepted fixed behaviour.
|
|
38
|
+
*
|
|
39
|
+
* Provisions two throwaway tenants rather than using the shared fixture: the suite creates real
|
|
40
|
+
* `users` records, and an interrupted run against the shared org would strand staff accounts in it.
|
|
24
41
|
*/
|
|
25
|
-
export const
|
|
26
|
-
|
|
42
|
+
export const globalunique_leak_checks = async (): Promise<Check[]> => {
|
|
43
|
+
const checks: Check[] = []
|
|
44
|
+
const record = (label: string, pass: boolean, detail: string) => checks.push({ label, pass, detail })
|
|
45
|
+
|
|
46
|
+
let tenantA: Awaited<ReturnType<typeof setup_isolated_tenant>> | undefined
|
|
47
|
+
let tenantB: Awaited<ReturnType<typeof setup_isolated_tenant>> | undefined
|
|
27
48
|
|
|
28
|
-
let userId: string | undefined
|
|
29
49
|
try {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
&& !('hashedPass' in rec)
|
|
48
|
-
&& !('hashedInviteCode' in rec)
|
|
49
|
-
)
|
|
50
|
-
},
|
|
51
|
-
},
|
|
50
|
+
;[tenantA, tenantB] = await Promise.all([
|
|
51
|
+
setup_isolated_tenant({ name: `GlobalUnique A ${RAND()}`, users: [{ isAdmin: true }], apiKeys: 0 }),
|
|
52
|
+
setup_isolated_tenant({ name: `GlobalUnique B ${RAND()}`, users: [{ isAdmin: true }], apiKeys: 0 }),
|
|
53
|
+
])
|
|
54
|
+
|
|
55
|
+
// `dontsend...@tellescope.com` is what suppresses outbound mail (api/modules/sqs.ts), so creating
|
|
56
|
+
// the user cannot deliver an invite. Stamped per run because `users.email` is globalUnique ACROSS
|
|
57
|
+
// organizations — a fixed address would collide with a concurrently running suite's tenant and
|
|
58
|
+
// make the 409 point at a record this suite does not own.
|
|
59
|
+
const email = `dontsend-globalunique-${Date.now()}-${RAND()}@tellescope.com`
|
|
60
|
+
|
|
61
|
+
const victim = await tenantA.sdk.api.users.createOne({ email } as any)
|
|
62
|
+
|
|
63
|
+
record(
|
|
64
|
+
'setup: two separate tenants, the colliding user belongs to tenant A',
|
|
65
|
+
tenantA.businessId !== tenantB.businessId && !!victim.id,
|
|
66
|
+
`tenantA=${tenantA.businessId} tenantB=${tenantB.businessId} user=${victim.id} email=${email}`,
|
|
52
67
|
)
|
|
68
|
+
|
|
69
|
+
/** Drives the globalUnique block and reports what the 409's `existingRecord` exposed. */
|
|
70
|
+
const probe = async (sdk: IsolatedTenant['sdk']) => {
|
|
71
|
+
let error: any
|
|
72
|
+
let accepted: any
|
|
73
|
+
try {
|
|
74
|
+
accepted = await sdk.api.users.createOne({ email, _overrideUnique: true } as any)
|
|
75
|
+
} catch (err) { error = err }
|
|
76
|
+
|
|
77
|
+
const violation = error?.info?.[0]
|
|
78
|
+
return { error, accepted, existingRecord: violation?.existingRecord, conflictingFields: violation?.conflictingFields }
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Pins WHICH 409 answered. Both uniqueness sites now redact to an identical `{ _id, businessId }`,
|
|
83
|
+
* so the body alone cannot tell them apart — and `validateUniquenessConstraints` also looks up
|
|
84
|
+
* cross-tenant. If `_overrideUnique` ever stopped skipping that earlier validation, these checks
|
|
85
|
+
* would keep passing while covering the wrong site.
|
|
86
|
+
*
|
|
87
|
+
* The discriminator is the shape of `conflictingFields`: the globalUnique block passes the raw
|
|
88
|
+
* constraint ARRAY (`model.constraints.globalUnique`, i.e. ['email','phone']), while
|
|
89
|
+
* validateUniquenessConstraints passes a `matching_fields` OBJECT (`{ email: '<value>' }`).
|
|
90
|
+
*/
|
|
91
|
+
const from_globalunique_block = (conflictingFields: any) => Array.isArray(conflictingFields)
|
|
92
|
+
|
|
93
|
+
/** The redaction assertion shared by both checks. */
|
|
94
|
+
const redaction_verdict = (rec: any) => {
|
|
95
|
+
if (!rec || typeof rec !== 'object') return { pass: false, keys: [] as string[] }
|
|
96
|
+
const keys = Object.keys(rec)
|
|
97
|
+
const pass = (
|
|
98
|
+
keys.length > 0
|
|
99
|
+
&& keys.every(k => ALLOWED_EXISTING_RECORD_KEYS.includes(k))
|
|
100
|
+
// named explicitly as well as covered by the allow-list above: these are the fields the
|
|
101
|
+
// unredacted body actually leaked, and the list is what a later edit would widen
|
|
102
|
+
&& !('email' in rec)
|
|
103
|
+
&& !('hashedPass' in rec)
|
|
104
|
+
&& !('hashedInviteCode' in rec)
|
|
105
|
+
)
|
|
106
|
+
return { pass, keys }
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* ===== 1: same-tenant collision (the original coverage) ===== */
|
|
110
|
+
|
|
111
|
+
const sameTenant = await probe(tenantA.sdk)
|
|
112
|
+
|
|
113
|
+
if (!sameTenant.error) {
|
|
114
|
+
record(
|
|
115
|
+
'1: same-tenant globalUnique 409 existingRecord exposes only _id + businessId',
|
|
116
|
+
false,
|
|
117
|
+
`the write was accepted (id=${sameTenant.accepted?.id}) — no 409 was raised, so the redaction was never exercised`,
|
|
118
|
+
)
|
|
119
|
+
} else {
|
|
120
|
+
const { pass, keys } = redaction_verdict(sameTenant.existingRecord)
|
|
121
|
+
const fromGlobalUnique = from_globalunique_block(sameTenant.conflictingFields)
|
|
122
|
+
record(
|
|
123
|
+
'1: same-tenant globalUnique 409 existingRecord exposes only _id + businessId',
|
|
124
|
+
pass && fromGlobalUnique,
|
|
125
|
+
`existingRecord keys=${JSON.stringify(keys)} (allowed: ${JSON.stringify(ALLOWED_EXISTING_RECORD_KEYS)});`
|
|
126
|
+
+ ` conflictingFields=${JSON.stringify(sameTenant.conflictingFields)} (must be the globalUnique array,`
|
|
127
|
+
+ ` not a validateUniquenessConstraints object);`
|
|
128
|
+
+ ` error=${sameTenant.error?.message || String(sameTenant.error)}`,
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* ===== 2: cross-tenant collision — the case that can leak another tenant's record ===== */
|
|
133
|
+
|
|
134
|
+
const crossTenant = await probe(tenantB.sdk)
|
|
135
|
+
|
|
136
|
+
if (!crossTenant.error) {
|
|
137
|
+
record(
|
|
138
|
+
'2: cross-tenant globalUnique 409 exposes only tenant A\'s _id + businessId',
|
|
139
|
+
false,
|
|
140
|
+
`the write was accepted (id=${crossTenant.accepted?.id}) — tenant B re-created a globalUnique email`
|
|
141
|
+
+ ` without a 409, so the redaction was never exercised`,
|
|
142
|
+
)
|
|
143
|
+
} else {
|
|
144
|
+
const rec = crossTenant.existingRecord
|
|
145
|
+
const { pass, keys } = redaction_verdict(rec)
|
|
146
|
+
// pinned so a SAME-tenant match cannot satisfy this check: the 409 must name tenant A, proving
|
|
147
|
+
// the cross-tenant lookup is the one that ran
|
|
148
|
+
const namesTenantA = String(rec?.businessId ?? '') === String(tenantA.businessId)
|
|
149
|
+
// check 1's duplicate create threw, so tenant A's `victim` is the ONLY record anywhere carrying
|
|
150
|
+
// this address — the matched _id is deterministic, so pin it rather than only reporting it
|
|
151
|
+
const namesVictim = String(rec?._id ?? rec?.id ?? '') === String(victim.id)
|
|
152
|
+
const fromGlobalUnique = from_globalunique_block(crossTenant.conflictingFields)
|
|
153
|
+
record(
|
|
154
|
+
'2: cross-tenant globalUnique 409 exposes only tenant A\'s _id + businessId',
|
|
155
|
+
pass && namesTenantA && namesVictim && fromGlobalUnique,
|
|
156
|
+
`existingRecord keys=${JSON.stringify(keys)} (allowed: ${JSON.stringify(ALLOWED_EXISTING_RECORD_KEYS)});`
|
|
157
|
+
+ ` conflictingFields=${JSON.stringify(crossTenant.conflictingFields)} (must be the globalUnique array,`
|
|
158
|
+
+ ` not a validateUniquenessConstraints object);`
|
|
159
|
+
+ ` businessId=${rec?.businessId ?? '<missing>'} (want tenant A ${tenantA.businessId}, not caller ${tenantB.businessId});`
|
|
160
|
+
+ ` _id=${rec?._id ?? rec?.id ?? '<missing>'} (tenant A user ${victim.id});`
|
|
161
|
+
+ ` error=${crossTenant.error?.message || String(crossTenant.error)}`,
|
|
162
|
+
)
|
|
163
|
+
}
|
|
53
164
|
} finally {
|
|
54
|
-
|
|
165
|
+
// Teardown happens here, BEFORE anything asserts — assert calls process.exit and would otherwise
|
|
166
|
+
// strand these tenants permanently (nothing can delete an organization record). It is also the
|
|
167
|
+
// only cleanup needed: teardown deletes every schema model for the businessId, `users` included.
|
|
168
|
+
for (const t of [tenantA, tenantB]) {
|
|
169
|
+
if (t) { try { await t.teardown() } catch (e) { console.error('teardown failed', e) } }
|
|
170
|
+
}
|
|
55
171
|
}
|
|
172
|
+
|
|
173
|
+
return checks
|
|
56
174
|
}
|
|
57
175
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
176
|
+
/** Asserting wrapper, for standalone runs and for sequential use in the suite. */
|
|
177
|
+
export const globalunique_leak_tests = async () => {
|
|
178
|
+
assert_checks('globalUnique conflict redaction', await globalunique_leak_checks())
|
|
179
|
+
}
|
|
62
180
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
await globalunique_leak_tests({ sdk, sdkNonAdmin })
|
|
66
|
-
}
|
|
181
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
182
|
+
export const ISOLATED_SUITE: IsolatedSuite = { name: 'globalUnique conflict redaction', run: globalunique_leak_checks }
|
|
67
183
|
|
|
68
|
-
|
|
184
|
+
// Allow running this test file independently
|
|
185
|
+
if (require.main === module) {
|
|
186
|
+
console.log(`🌐 Using API URL: ${host}`)
|
|
187
|
+
globalunique_leak_tests()
|
|
69
188
|
.then(() => {
|
|
70
|
-
console.log("✅ globalUnique
|
|
189
|
+
console.log("✅ globalUnique conflict redaction test suite completed successfully")
|
|
71
190
|
process.exit(0)
|
|
72
191
|
})
|
|
73
192
|
.catch((error) => {
|
|
74
|
-
console.error("❌ globalUnique
|
|
193
|
+
console.error("❌ globalUnique conflict redaction test suite failed:", error)
|
|
75
194
|
process.exit(1)
|
|
76
195
|
})
|
|
77
196
|
}
|