@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,94 +1,154 @@
|
|
|
1
1
|
require('source-map-support').install();
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
async_test,
|
|
6
|
-
log_header,
|
|
7
|
-
} from "@tellescope/testing"
|
|
3
|
+
import { EnduserSession } from "../../sdk"
|
|
8
4
|
import { STEDI_TITLE } from "@tellescope/constants"
|
|
9
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
assert_checks,
|
|
7
|
+
Check,
|
|
8
|
+
IsolatedSuite,
|
|
9
|
+
setup_isolated_tenant,
|
|
10
|
+
} from "../setup_isolated"
|
|
10
11
|
|
|
11
12
|
const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
12
13
|
|
|
14
|
+
const RAND = () => Math.random().toString(36).slice(2, 10)
|
|
15
|
+
|
|
13
16
|
// Stedi runs on Tellescope's own platform credentials (zz_secrets) and each eligibility check costs
|
|
14
17
|
// Tellescope $0.10, so an organization must be approved by a Tellescope super admin
|
|
15
18
|
// (Organization.stediAllowed) before any Stedi call is made on its behalf.
|
|
16
19
|
//
|
|
17
20
|
// Every assertion here is a REJECTION assertion, so nothing in this file ever reaches Stedi.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
//
|
|
22
|
+
// Runs on its own provisioned tenant: section B's whole premise is "this organization is NOT
|
|
23
|
+
// Stedi-approved", which on the shared fixture is whatever the last developer left in their local
|
|
24
|
+
// database. A freshly provisioned tenant is never approved (the provisioner cannot write
|
|
25
|
+
// stediAllowed — it is not in its organization allowlist), so the skip branch that used to report
|
|
26
|
+
// green without asserting anything is now a FAILING check instead.
|
|
27
|
+
export const stedi_approval_checks = async (): Promise<Check[]> => {
|
|
28
|
+
const checks: Check[] = []
|
|
29
|
+
const record = (label: string, pass: boolean, detail: string) => checks.push({ label, pass, detail })
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The async_test({ shouldError: true, onError }) equivalent, as a soft Check: a call that RESOLVES
|
|
33
|
+
* is a failure (async_test treats it the same way), and a rejection passes only when onError agrees.
|
|
34
|
+
*/
|
|
35
|
+
const expect_rejected = async (label: string, fn: () => Promise<any>, onError: (e: any) => boolean) => {
|
|
36
|
+
let rejection: { e: any }
|
|
37
|
+
try {
|
|
38
|
+
const unexpected = await fn()
|
|
39
|
+
record(
|
|
40
|
+
label,
|
|
41
|
+
false,
|
|
42
|
+
`resolved instead of rejecting; result=${unexpected === undefined ? '(none)' : JSON.stringify(unexpected)}`,
|
|
43
|
+
)
|
|
44
|
+
return
|
|
45
|
+
} catch (e: any) {
|
|
46
|
+
rejection = { e }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Outside the catch on purpose: a predicate that throws here would otherwise escape the suite
|
|
50
|
+
// and, per run_isolated_in_parallel, abort every remaining batch instead of failing one check.
|
|
51
|
+
// The raw value decides the fallback, not JSON.stringify of it — JSON.stringify('') is '""',
|
|
52
|
+
// which is truthy, so a `|| fallback` on the stringified form can never fire.
|
|
53
|
+
const { e } = rejection
|
|
54
|
+
const message = typeof e?.message === 'string' && e.message !== ''
|
|
55
|
+
? e.message
|
|
56
|
+
: (e === undefined || e === null ? String(e) : JSON.stringify(e))
|
|
57
|
+
record(label, onError(e), `rejected with ${message}`)
|
|
58
|
+
}
|
|
35
59
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
await async_test(
|
|
40
|
-
"org admin cannot disable stediAllowed either (guard is key-presence, not truthiness)",
|
|
41
|
-
() => sdk.api.organizations.updateOne(orgId, { stediAllowed: false }),
|
|
42
|
-
{ shouldError: true, onError: (e: { message: string }) => /not allowed/i.test(e.message) }
|
|
60
|
+
const rejectedAsNotAllowed = (e: any) => /not allowed/i.test(typeof e?.message === 'string' ? e.message : '')
|
|
61
|
+
const rejectedAsNotEnabled = (e: any) => (
|
|
62
|
+
/not enabled for this organization/i.test(typeof e?.message === 'string' ? e.message : '')
|
|
43
63
|
)
|
|
44
64
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"org admin cannot disable bedrockAIAllowed",
|
|
48
|
-
() => sdk.api.organizations.updateOne(orgId, { bedrockAIAllowed: false }),
|
|
49
|
-
{ shouldError: true, onError: (e: { message: string }) => /not allowed/i.test(e.message) }
|
|
50
|
-
)
|
|
65
|
+
let tenant: Awaited<ReturnType<typeof setup_isolated_tenant>> | undefined
|
|
66
|
+
let enduserId: string | undefined
|
|
51
67
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
68
|
+
try {
|
|
69
|
+
tenant = await setup_isolated_tenant({
|
|
70
|
+
name: `Stedi approval gate ${RAND()}`,
|
|
71
|
+
users: [{ isAdmin: true }],
|
|
72
|
+
apiKeys: 0,
|
|
73
|
+
})
|
|
74
|
+
const { sdk } = tenant
|
|
75
|
+
const orgId = tenant.businessId
|
|
76
|
+
|
|
77
|
+
// A. Super-admin write gate.
|
|
78
|
+
//
|
|
79
|
+
// `isa` is only minted by GET /switch-tenant, so this plainly-authenticated admin session never
|
|
80
|
+
// has it — and a provisioned tenant's throwaway admin is in no SUPER_ADMINS allowlist either.
|
|
81
|
+
//
|
|
82
|
+
// The four updates are deliberately DISTINCT (id, updates) pairs: identical ones throttle at
|
|
83
|
+
// 3 per 30s and the fourth would be rejected by the throttle rather than by the guard.
|
|
84
|
+
|
|
85
|
+
await expect_rejected(
|
|
86
|
+
"org admin cannot enable stediAllowed for their own organization",
|
|
87
|
+
() => sdk.api.organizations.updateOne(orgId, { stediAllowed: true }),
|
|
88
|
+
rejectedAsNotAllowed,
|
|
89
|
+
)
|
|
58
90
|
|
|
59
|
-
|
|
60
|
-
|
|
91
|
+
// Regression test for the truthiness hole in the shared super-admin relationship constraint:
|
|
92
|
+
// it used to test `options.updates?.stediAllowed` (falsy for `false`), so an org admin could
|
|
93
|
+
// clear super-admin-owned flags even though they could never set them.
|
|
94
|
+
await expect_rejected(
|
|
95
|
+
"org admin cannot disable stediAllowed either (guard is key-presence, not truthiness)",
|
|
96
|
+
() => sdk.api.organizations.updateOne(orgId, { stediAllowed: false }),
|
|
97
|
+
rejectedAsNotAllowed,
|
|
98
|
+
)
|
|
61
99
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
+ "these assertions would otherwise report a false pass."
|
|
100
|
+
// Same bug, pre-existing field — proves the fix wasn't scoped to the new flag only.
|
|
101
|
+
await expect_rejected(
|
|
102
|
+
"org admin cannot disable bedrockAIAllowed",
|
|
103
|
+
() => sdk.api.organizations.updateOne(orgId, { bedrockAIAllowed: false }),
|
|
104
|
+
rejectedAsNotAllowed,
|
|
68
105
|
)
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
106
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
107
|
+
// ...and that it covers the whole gated list, not just the two booleans.
|
|
108
|
+
await expect_rejected(
|
|
109
|
+
"org admin cannot disable allowCreateSuborganizations",
|
|
110
|
+
() => sdk.api.organizations.updateOne(orgId, { allowCreateSuborganizations: false }),
|
|
111
|
+
rejectedAsNotAllowed,
|
|
112
|
+
)
|
|
77
113
|
|
|
78
|
-
|
|
79
|
-
|
|
114
|
+
// B. An unapproved organization is rejected at every Stedi entry point.
|
|
115
|
+
|
|
116
|
+
const organization = await sdk.api.organizations.getOne(orgId)
|
|
117
|
+
if (organization.stediAllowed) {
|
|
118
|
+
// Previously a console warning and an early return, which reported green without asserting
|
|
119
|
+
// anything. On a tenant this suite provisioned seconds ago it is a real defect — the
|
|
120
|
+
// provisioner has started granting a super-admin-only flag — so it fails loudly and the
|
|
121
|
+
// section-B checks below are NOT run (they would all pass for the wrong reason).
|
|
122
|
+
record(
|
|
123
|
+
'the freshly provisioned organization is not Stedi-approved',
|
|
124
|
+
false,
|
|
125
|
+
'stediAllowed=true on a tenant this suite just provisioned, so the five Stedi entry-point '
|
|
126
|
+
+ 'rejections below would report a false pass and were skipped. Nothing in the provisioning '
|
|
127
|
+
+ 'path may set stediAllowed — it is a Tellescope super-admin flag.',
|
|
128
|
+
)
|
|
129
|
+
return checks
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const enduser = await sdk.api.endusers.createOne({
|
|
133
|
+
email: `stedi-approval-${Date.now()}@test.tellescope.com`,
|
|
134
|
+
fname: 'Stedi',
|
|
135
|
+
lname: 'Approval',
|
|
136
|
+
})
|
|
137
|
+
enduserId = enduser.id
|
|
138
|
+
|
|
139
|
+
await expect_rejected(
|
|
80
140
|
"staff: Stedi payer search (proxy_read) is rejected",
|
|
81
141
|
() => sdk.api.integrations.proxy_read({ integration: STEDI_TITLE, type: 'payers', query: 'aetna' }),
|
|
82
|
-
|
|
142
|
+
rejectedAsNotEnabled,
|
|
83
143
|
)
|
|
84
144
|
|
|
85
|
-
await
|
|
145
|
+
await expect_rejected(
|
|
86
146
|
"staff: Stedi payer importer (load_payers) is rejected",
|
|
87
147
|
() => sdk.api.integrations.load_payers({ integration: STEDI_TITLE, query: 'aetna' }),
|
|
88
|
-
|
|
148
|
+
rejectedAsNotEnabled,
|
|
89
149
|
)
|
|
90
150
|
|
|
91
|
-
await
|
|
151
|
+
await expect_rejected(
|
|
92
152
|
"staff: Stedi eligibility check is rejected on approval, before the credit checks",
|
|
93
153
|
() => sdk.api.integrations.proxy_read({
|
|
94
154
|
integration: STEDI_TITLE,
|
|
@@ -96,66 +156,72 @@ export const stedi_approval_tests = async ({ sdk, sdkNonAdmin } : { sdk: Session
|
|
|
96
156
|
id: enduser.id,
|
|
97
157
|
query: JSON.stringify({ serviceCode: '30', npi: '1234567890' }),
|
|
98
158
|
}),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
// the credit gate, so an unapproved org is never told to go buy credits.
|
|
103
|
-
onError: (e: { message: string }) => (
|
|
104
|
-
/not enabled for this organization/i.test(e.message) && !/credit/i.test(e.message)
|
|
105
|
-
),
|
|
106
|
-
}
|
|
159
|
+
// The absence of /credit/ is the real assertion: it proves the approval gate fires ahead of
|
|
160
|
+
// the credit gate, so an unapproved org is never told to go buy credits.
|
|
161
|
+
(e: any) => rejectedAsNotEnabled(e) && !/credit/i.test(typeof e?.message === 'string' ? e.message : ''),
|
|
107
162
|
)
|
|
108
163
|
|
|
109
164
|
// Enduser sessions reach both branches for real: StediEligibilityInput auto-runs the check, and
|
|
110
165
|
// InsuranceInput search-on-types against the payer branch. Approval/billing state must not leak
|
|
111
166
|
// to patients.
|
|
112
|
-
|
|
113
|
-
|
|
167
|
+
//
|
|
168
|
+
// The session is minted from endusers.generate_auth_token rather than imported from setup.ts
|
|
169
|
+
// (this suite shares nothing with the hand-seeded fixture) and rather than a password login
|
|
170
|
+
// (/login-enduser throttles 20/min per IP, and the pool runs 8 suites from one IP).
|
|
171
|
+
const { authToken, enduser: enduserInfo } = await sdk.api.endusers.generate_auth_token({ id: enduser.id })
|
|
172
|
+
const enduserSdk = new EnduserSession({ host, authToken, enduser: enduserInfo, businessId: tenant.businessId })
|
|
114
173
|
|
|
115
174
|
// Exact-match on the generic copy: no "Stedi", no "credits", no "contact sales", no mention that
|
|
116
175
|
// approval is the reason. Note this is deliberately the SAME string the enduser-facing credit
|
|
117
176
|
// rejection uses, so it cannot prove which gate fired — the staff assertion above is what pins
|
|
118
177
|
// down the approval-before-credits ordering.
|
|
119
|
-
const messageIsGenericForEnduser = (e:
|
|
120
|
-
e.message === 'Eligibility check is currently unavailable'
|
|
121
|
-
)
|
|
178
|
+
const messageIsGenericForEnduser = (e: any) => e?.message === 'Eligibility check is currently unavailable'
|
|
122
179
|
|
|
123
|
-
await
|
|
180
|
+
await expect_rejected(
|
|
124
181
|
"enduser: eligibility check rejected with a generic message (no approval/billing leak)",
|
|
125
182
|
() => enduserSdk.api.integrations.proxy_read({
|
|
126
183
|
integration: STEDI_TITLE,
|
|
127
184
|
type: 'stedi-eligibility',
|
|
128
185
|
query: JSON.stringify({ serviceCode: '30', npi: '1234567890' }),
|
|
129
186
|
}),
|
|
130
|
-
|
|
187
|
+
messageIsGenericForEnduser,
|
|
131
188
|
)
|
|
132
189
|
|
|
133
|
-
await
|
|
190
|
+
await expect_rejected(
|
|
134
191
|
"enduser: payer search rejected with a generic message (no approval/billing leak)",
|
|
135
192
|
() => enduserSdk.api.integrations.proxy_read({
|
|
136
193
|
integration: STEDI_TITLE,
|
|
137
194
|
type: 'payers',
|
|
138
195
|
query: 'aetna',
|
|
139
196
|
}),
|
|
140
|
-
|
|
197
|
+
messageIsGenericForEnduser,
|
|
141
198
|
)
|
|
142
199
|
} finally {
|
|
143
|
-
|
|
200
|
+
if (tenant) {
|
|
201
|
+
if (enduserId) await tenant.sdk.api.endusers.deleteOne(enduserId).catch(console.error)
|
|
202
|
+
// Teardown BEFORE anything asserts — assert calls process.exit, which would strand this tenant.
|
|
203
|
+
try { await tenant.teardown() } catch (e) { console.error('teardown failed', e) }
|
|
204
|
+
}
|
|
144
205
|
}
|
|
206
|
+
|
|
207
|
+
return checks
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** Asserting wrapper, for standalone runs. */
|
|
211
|
+
export const stedi_approval_tests = async () => {
|
|
212
|
+
assert_checks('Stedi approval gate', await stedi_approval_checks())
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
216
|
+
export const ISOLATED_SUITE: IsolatedSuite = {
|
|
217
|
+
name: 'Stedi approval gate',
|
|
218
|
+
run: stedi_approval_checks,
|
|
145
219
|
}
|
|
146
220
|
|
|
147
221
|
// Allow running this test file independently
|
|
148
222
|
if (require.main === module) {
|
|
149
223
|
console.log(`Using API URL: ${host}`)
|
|
150
|
-
|
|
151
|
-
const sdkNonAdmin = new Session({ host })
|
|
152
|
-
|
|
153
|
-
const runTests = async () => {
|
|
154
|
-
await setup_tests(sdk, sdkNonAdmin)
|
|
155
|
-
await stedi_approval_tests({ sdk, sdkNonAdmin })
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
runTests()
|
|
224
|
+
stedi_approval_tests()
|
|
159
225
|
.then(() => {
|
|
160
226
|
console.log("✅ Stedi pre-approval tests completed successfully")
|
|
161
227
|
process.exit(0)
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
require('source-map-support').install();
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
assert_checks,
|
|
5
|
+
Check,
|
|
6
|
+
setup_isolated_tenant,
|
|
7
|
+
IsolatedSuite,
|
|
8
|
+
} from "../setup_isolated"
|
|
9
|
+
|
|
10
|
+
const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
11
|
+
|
|
12
|
+
const RAND = () => Math.random().toString(36).slice(2, 10)
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Coverage for coupling a ticket's Stage to real archival (CU-86e3hhavw).
|
|
16
|
+
*
|
|
17
|
+
* Stage: Archived used to be cosmetic — only the Archive Ticket button set archiveReason + closedAt
|
|
18
|
+
* + closedBy, and only that real archival stops a Journey advancing to its next step
|
|
19
|
+
* (handleTicketClosed skips a ticket whose archiveReason is set). Customers staged tickets Archived
|
|
20
|
+
* and expected them to be archived. The generic update route in api/modules/routing.ts now folds the
|
|
21
|
+
* archival into `updates` before the `$set`, so the archived state is part of the same write and is
|
|
22
|
+
* visible to the PATCH response, the webhooks and every v2 side effect.
|
|
23
|
+
*
|
|
24
|
+
* A: changing the stage to Archived archives the ticket, and says so in the PATCH response.
|
|
25
|
+
* B: changing the stage off Archived un-archives it (the Un-Archive button's payload).
|
|
26
|
+
* C: an already-Completed ticket keeps the closedAt it was actually closed at.
|
|
27
|
+
* D: repeating the stage change does not rewrite the reason or the timestamp.
|
|
28
|
+
* E: an explicit archiveReason in the same payload is not overwritten.
|
|
29
|
+
* F: with organization.settings.tickets.allowArchival off (the default, and so what every existing
|
|
30
|
+
* organization sees until it opts in), Stage: Archived behaves exactly as it did before.
|
|
31
|
+
* G: a queued ticket archives and stays in its queue — parity with the Archive Ticket button.
|
|
32
|
+
* H: a payload that re-states closedAt (the Edit Ticket form, or any full-record PATCH) is not a
|
|
33
|
+
* move off Archived, while the Stage select's stage-only payload still is.
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/** The queue count is maintained by asynchronous side effects, so reads of it poll. */
|
|
37
|
+
const poll_for = async <T,>(get: () => Promise<T>, done: (v: T) => boolean, attempts=20): Promise<T> => {
|
|
38
|
+
let value = await get()
|
|
39
|
+
for (let i = 0; i < attempts && !done(value); i++) {
|
|
40
|
+
await new Promise(resolve => setTimeout(resolve, 250))
|
|
41
|
+
value = await get()
|
|
42
|
+
}
|
|
43
|
+
return value
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const ticket_stage_archive_checks = async (): Promise<Check[]> => {
|
|
47
|
+
const checks: Check[] = []
|
|
48
|
+
const record = (label: string, pass: boolean, detail: string) => checks.push({ label, pass, detail })
|
|
49
|
+
|
|
50
|
+
let tenant: Awaited<ReturnType<typeof setup_isolated_tenant>> | undefined
|
|
51
|
+
let noArchivalTenant: Awaited<ReturnType<typeof setup_isolated_tenant>> | undefined
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
;[tenant, noArchivalTenant] = await Promise.all([
|
|
55
|
+
setup_isolated_tenant({ name: `StageArchive ${RAND()}`, users: [{ isAdmin: true }], apiKeys: 0 }),
|
|
56
|
+
setup_isolated_tenant({ name: `StageArchive off ${RAND()}`, users: [{ isAdmin: true }], apiKeys: 0 }),
|
|
57
|
+
])
|
|
58
|
+
|
|
59
|
+
const { sdk } = tenant
|
|
60
|
+
const adminId = tenant.users[0].id
|
|
61
|
+
|
|
62
|
+
// archival is off by default — this tenant opts in, noArchivalTenant deliberately does not
|
|
63
|
+
await sdk.api.organizations.updateOne(sdk.userInfo.businessId, {
|
|
64
|
+
settings: { tickets: { allowArchival: true } },
|
|
65
|
+
} as any)
|
|
66
|
+
|
|
67
|
+
const settings = await sdk.api.organizations.getOne(sdk.userInfo.businessId)
|
|
68
|
+
record(
|
|
69
|
+
'setup: allowArchival is enabled for the primary tenant',
|
|
70
|
+
settings.settings?.tickets?.allowArchival === true,
|
|
71
|
+
`allowArchival=${JSON.stringify(settings.settings?.tickets?.allowArchival)}`,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
/* ===== A: Stage -> Archived archives the ticket ===== */
|
|
75
|
+
|
|
76
|
+
const ticket = await sdk.api.tickets.createOne({ title: `Stage archive ${RAND()}` })
|
|
77
|
+
record(
|
|
78
|
+
'setup: a new ticket is open and unarchived',
|
|
79
|
+
!ticket.closedAt && !ticket.archiveReason,
|
|
80
|
+
`closedAt=${JSON.stringify(ticket.closedAt)} archiveReason=${JSON.stringify(ticket.archiveReason)}`,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
const archivedResponse = await sdk.api.tickets.updateOne(ticket.id, { stage: 'Archived' })
|
|
84
|
+
record(
|
|
85
|
+
'A1: the PATCH response already reflects the archival',
|
|
86
|
+
archivedResponse.archiveReason === 'Stage set to Archived'
|
|
87
|
+
&& !!archivedResponse.closedAt
|
|
88
|
+
&& archivedResponse.closedBy === adminId,
|
|
89
|
+
`response archiveReason=${JSON.stringify(archivedResponse.archiveReason)}`
|
|
90
|
+
+ ` closedAt=${JSON.stringify(archivedResponse.closedAt)} closedBy=${JSON.stringify(archivedResponse.closedBy)}`
|
|
91
|
+
+ ` — a side effect instead of a folded update would leave these unset here, and would land after`
|
|
92
|
+
+ ` the Journey next-step check`,
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
const archived = await sdk.api.tickets.getOne(ticket.id)
|
|
96
|
+
record(
|
|
97
|
+
'A2: the stored ticket is archived: reason, closedAt and closedBy all set',
|
|
98
|
+
archived.stage === 'Archived'
|
|
99
|
+
&& archived.archiveReason === 'Stage set to Archived'
|
|
100
|
+
&& !!archived.closedAt
|
|
101
|
+
&& archived.closedBy === adminId,
|
|
102
|
+
`stage=${JSON.stringify(archived.stage)} archiveReason=${JSON.stringify(archived.archiveReason)}`
|
|
103
|
+
+ ` closedAt=${JSON.stringify(archived.closedAt)} closedBy=${JSON.stringify(archived.closedBy)} (want closedBy=${adminId})`,
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
/* ===== B: Stage -> anything else un-archives ===== */
|
|
107
|
+
|
|
108
|
+
const unarchived = await sdk.api.tickets.updateOne(ticket.id, { stage: 'In Progress' })
|
|
109
|
+
record(
|
|
110
|
+
'B1: moving off Archived clears the reason, closedAt and closedBy',
|
|
111
|
+
unarchived.stage === 'In Progress'
|
|
112
|
+
&& !unarchived.archiveReason
|
|
113
|
+
&& !unarchived.closedAt
|
|
114
|
+
&& !unarchived.closedBy,
|
|
115
|
+
`stage=${JSON.stringify(unarchived.stage)} archiveReason=${JSON.stringify(unarchived.archiveReason)}`
|
|
116
|
+
+ ` closedAt=${JSON.stringify(unarchived.closedAt)} closedBy=${JSON.stringify(unarchived.closedBy)}`,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
const unarchivedStored = await sdk.api.tickets.getOne(ticket.id)
|
|
120
|
+
record(
|
|
121
|
+
'B2: the un-archival is stored, not only echoed',
|
|
122
|
+
!unarchivedStored.archiveReason && !unarchivedStored.closedAt && !unarchivedStored.closedBy,
|
|
123
|
+
`archiveReason=${JSON.stringify(unarchivedStored.archiveReason)}`
|
|
124
|
+
+ ` closedAt=${JSON.stringify(unarchivedStored.closedAt)} closedBy=${JSON.stringify(unarchivedStored.closedBy)}`
|
|
125
|
+
+ ` — null/undefined would be dropped from the update rather than written`,
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
// a stage change on a ticket that was never archived must not touch anything else
|
|
129
|
+
const neverArchived = await sdk.api.tickets.createOne({ title: `Stage plain ${RAND()}` })
|
|
130
|
+
const plainStage = await sdk.api.tickets.updateOne(neverArchived.id, { stage: 'Blocked' })
|
|
131
|
+
record(
|
|
132
|
+
'B3: a stage change on an open, never-archived ticket changes only the stage',
|
|
133
|
+
plainStage.stage === 'Blocked' && !plainStage.closedAt && !plainStage.archiveReason,
|
|
134
|
+
`stage=${JSON.stringify(plainStage.stage)} closedAt=${JSON.stringify(plainStage.closedAt)}`
|
|
135
|
+
+ ` archiveReason=${JSON.stringify(plainStage.archiveReason)}`,
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
/* ===== C: an already-Completed ticket keeps its closedAt ===== */
|
|
139
|
+
|
|
140
|
+
const completedAt = new Date(Date.now() - 1000 * 60 * 60 * 24 * 7) // a week ago
|
|
141
|
+
const completed = await sdk.api.tickets.createOne({ title: `Stage archive completed ${RAND()}` })
|
|
142
|
+
await sdk.api.tickets.updateOne(completed.id, { closedAt: completedAt, closedBy: adminId })
|
|
143
|
+
|
|
144
|
+
const completedThenArchived = await sdk.api.tickets.updateOne(completed.id, { stage: 'Archived' })
|
|
145
|
+
const storedClosedAt = new Date(completedThenArchived.closedAt as any).getTime()
|
|
146
|
+
record(
|
|
147
|
+
'C1: archiving an already-Completed ticket preserves its original closedAt',
|
|
148
|
+
completedThenArchived.archiveReason === 'Stage set to Archived'
|
|
149
|
+
&& storedClosedAt === completedAt.getTime(),
|
|
150
|
+
`closedAt=${JSON.stringify(completedThenArchived.closedAt)} (want ${completedAt.toISOString()});`
|
|
151
|
+
+ ` archiveReason=${JSON.stringify(completedThenArchived.archiveReason)}`
|
|
152
|
+
+ ` — overwriting it would move the Closed date to today`,
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
/* ===== D: repeating the stage change is a no-op ===== */
|
|
156
|
+
|
|
157
|
+
const reArchived = await sdk.api.tickets.updateOne(completed.id, { stage: 'Archived' })
|
|
158
|
+
record(
|
|
159
|
+
'D1: setting the stage to Archived a second time rewrites neither the reason nor closedAt',
|
|
160
|
+
reArchived.archiveReason === 'Stage set to Archived'
|
|
161
|
+
&& new Date(reArchived.closedAt as any).getTime() === completedAt.getTime(),
|
|
162
|
+
`archiveReason=${JSON.stringify(reArchived.archiveReason)} closedAt=${JSON.stringify(reArchived.closedAt)}`
|
|
163
|
+
+ ` (want ${completedAt.toISOString()})`,
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
/* ===== E: an explicit archiveReason in the same payload wins ===== */
|
|
167
|
+
|
|
168
|
+
const explicit = await sdk.api.tickets.createOne({ title: `Stage archive explicit ${RAND()}` })
|
|
169
|
+
const explicitArchived = await sdk.api.tickets.updateOne(explicit.id, {
|
|
170
|
+
stage: 'Archived', archiveReason: 'Duplicate of another ticket',
|
|
171
|
+
})
|
|
172
|
+
record(
|
|
173
|
+
'E1: an archiveReason supplied with the stage is not replaced by the default',
|
|
174
|
+
explicitArchived.archiveReason === 'Duplicate of another ticket' && !!explicitArchived.closedAt,
|
|
175
|
+
`archiveReason=${JSON.stringify(explicitArchived.archiveReason)} closedAt=${JSON.stringify(explicitArchived.closedAt)}`,
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
/* ===== H: a full-record PATCH is not a move off Archived ===== */
|
|
179
|
+
|
|
180
|
+
// The Edit Ticket form submits every field of the record it loaded, including `stage` and
|
|
181
|
+
// `closedAt`, whose inputs are hidden for a closed ticket. On a ticket archived from the Archive
|
|
182
|
+
// Ticket button — which never writes stage, so the stage is still 'In Progress' or the like —
|
|
183
|
+
// that payload must not be read as a stage change off Archived. The same goes for any API
|
|
184
|
+
// consumer that PATCHes a whole ticket record back.
|
|
185
|
+
const buttonArchived = await sdk.api.tickets.createOne({
|
|
186
|
+
title: `Stage archive button ${RAND()}`, stage: 'In Progress',
|
|
187
|
+
})
|
|
188
|
+
const buttonClosedAt = new Date(Date.now() - 1000 * 60 * 60) // an hour ago
|
|
189
|
+
await sdk.api.tickets.updateOne(buttonArchived.id, {
|
|
190
|
+
archiveReason: 'Archived from the button', closedAt: buttonClosedAt, closedBy: adminId,
|
|
191
|
+
})
|
|
192
|
+
|
|
193
|
+
const editedTitle = `Stage archive button edited ${RAND()}`
|
|
194
|
+
const edited = await sdk.api.tickets.updateOne(buttonArchived.id, {
|
|
195
|
+
title: editedTitle, stage: 'In Progress', closedAt: buttonClosedAt, // exactly the editor's payload
|
|
196
|
+
})
|
|
197
|
+
record(
|
|
198
|
+
'H1: editing an archived ticket (full record, stage unchanged) does not un-archive it',
|
|
199
|
+
edited.title === editedTitle
|
|
200
|
+
&& edited.archiveReason === 'Archived from the button'
|
|
201
|
+
&& new Date(edited.closedAt as any).getTime() === buttonClosedAt.getTime()
|
|
202
|
+
&& edited.closedBy === adminId,
|
|
203
|
+
`title=${JSON.stringify(edited.title)} archiveReason=${JSON.stringify(edited.archiveReason)}`
|
|
204
|
+
+ ` closedAt=${JSON.stringify(edited.closedAt)} (want ${buttonClosedAt.toISOString()}) closedBy=${JSON.stringify(edited.closedBy)}`
|
|
205
|
+
+ ` — a bare stage comparison here would re-open the ticket and wipe its archive reason`,
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
// but the Stage column's select — which sends the stage on its own — still un-archives it
|
|
209
|
+
const unarchivedFromColumn = await sdk.api.tickets.updateOne(buttonArchived.id, { stage: 'Blocked' })
|
|
210
|
+
record(
|
|
211
|
+
'H2: the Stage select still un-archives a button-archived ticket (stage alone, no closedAt)',
|
|
212
|
+
unarchivedFromColumn.stage === 'Blocked'
|
|
213
|
+
&& !unarchivedFromColumn.archiveReason
|
|
214
|
+
&& !unarchivedFromColumn.closedAt
|
|
215
|
+
&& !unarchivedFromColumn.closedBy,
|
|
216
|
+
`stage=${JSON.stringify(unarchivedFromColumn.stage)} archiveReason=${JSON.stringify(unarchivedFromColumn.archiveReason)}`
|
|
217
|
+
+ ` closedAt=${JSON.stringify(unarchivedFromColumn.closedAt)} closedBy=${JSON.stringify(unarchivedFromColumn.closedBy)}`,
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
/* ===== G: a queued ticket archives, and stays in its queue ===== */
|
|
221
|
+
|
|
222
|
+
// parity with the Archive Ticket button, which also leaves queue membership and the queue count
|
|
223
|
+
// alone — unlike close_ticket, which refuses outright for a queued ticket
|
|
224
|
+
const queue = await sdk.api.ticket_queues.createOne({ title: `Stage archive queue ${RAND()}`, userIds: [adminId] })
|
|
225
|
+
const queued = await sdk.api.tickets.createOne({ title: `Stage archive queued ${RAND()}`, queueId: queue.id })
|
|
226
|
+
|
|
227
|
+
// the queue count is maintained by asynchronous side effects
|
|
228
|
+
const countBefore = await poll_for(
|
|
229
|
+
() => sdk.api.ticket_queues.getOne(queue.id).then(q => q.count ?? 0),
|
|
230
|
+
c => c === 1,
|
|
231
|
+
)
|
|
232
|
+
|
|
233
|
+
const queuedArchived = await sdk.api.tickets.updateOne(queued.id, { stage: 'Archived' })
|
|
234
|
+
// poll for a WRONG value rather than a right one: a decrement landing a moment later must fail
|
|
235
|
+
// this check, not slip past a single immediate read
|
|
236
|
+
const countAfter = await poll_for(
|
|
237
|
+
() => sdk.api.ticket_queues.getOne(queue.id).then(q => q.count ?? 0),
|
|
238
|
+
c => c !== 1,
|
|
239
|
+
8, // ~2s of settling
|
|
240
|
+
)
|
|
241
|
+
record(
|
|
242
|
+
'G1: a queued ticket archives, keeping its queue membership and the queue count',
|
|
243
|
+
queuedArchived.archiveReason === 'Stage set to Archived'
|
|
244
|
+
&& !!queuedArchived.closedAt
|
|
245
|
+
&& queuedArchived.queueId === queue.id
|
|
246
|
+
&& countBefore === 1 && countAfter === 1,
|
|
247
|
+
`archiveReason=${JSON.stringify(queuedArchived.archiveReason)} closedAt=${JSON.stringify(queuedArchived.closedAt)}`
|
|
248
|
+
+ ` queueId=${JSON.stringify(queuedArchived.queueId)} (want ${queue.id}); count ${countBefore} -> ${countAfter} (want 1 -> 1)`,
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
/* ===== F: with archival disabled, nothing changes ===== */
|
|
252
|
+
|
|
253
|
+
const offSdk = noArchivalTenant.sdk
|
|
254
|
+
const offOrg = await offSdk.api.organizations.getOne(offSdk.userInfo.businessId)
|
|
255
|
+
record(
|
|
256
|
+
'F1: a newly provisioned organization has archival off',
|
|
257
|
+
!offOrg.settings?.tickets?.allowArchival,
|
|
258
|
+
`allowArchival=${JSON.stringify(offOrg.settings?.tickets?.allowArchival)} — the setting must stay opt-in`,
|
|
259
|
+
)
|
|
260
|
+
|
|
261
|
+
const offTicket = await offSdk.api.tickets.createOne({ title: `Stage archive off ${RAND()}` })
|
|
262
|
+
const offArchived = await offSdk.api.tickets.updateOne(offTicket.id, { stage: 'Archived' })
|
|
263
|
+
record(
|
|
264
|
+
'F2: without allowArchival, Stage: Archived stays cosmetic — the ticket is still open',
|
|
265
|
+
offArchived.stage === 'Archived' && !offArchived.closedAt && !offArchived.archiveReason && !offArchived.closedBy,
|
|
266
|
+
`stage=${JSON.stringify(offArchived.stage)} closedAt=${JSON.stringify(offArchived.closedAt)}`
|
|
267
|
+
+ ` archiveReason=${JSON.stringify(offArchived.archiveReason)} closedBy=${JSON.stringify(offArchived.closedBy)}`,
|
|
268
|
+
)
|
|
269
|
+
|
|
270
|
+
// and an archived ticket in such an organization is not re-opened by a stage change either
|
|
271
|
+
const offArchivedByButton = await offSdk.api.tickets.createOne({ title: `Stage archive off button ${RAND()}` })
|
|
272
|
+
await offSdk.api.tickets.updateOne(offArchivedByButton.id, {
|
|
273
|
+
archiveReason: 'Archived by the button', closedAt: new Date(), closedBy: noArchivalTenant.users[0].id,
|
|
274
|
+
})
|
|
275
|
+
const offUnarchiveAttempt = await offSdk.api.tickets.updateOne(offArchivedByButton.id, { stage: 'In Progress' })
|
|
276
|
+
record(
|
|
277
|
+
'F3: without allowArchival, moving off Archived does not un-archive',
|
|
278
|
+
offUnarchiveAttempt.stage === 'In Progress'
|
|
279
|
+
&& offUnarchiveAttempt.archiveReason === 'Archived by the button'
|
|
280
|
+
&& !!offUnarchiveAttempt.closedAt,
|
|
281
|
+
`stage=${JSON.stringify(offUnarchiveAttempt.stage)} archiveReason=${JSON.stringify(offUnarchiveAttempt.archiveReason)}`
|
|
282
|
+
+ ` closedAt=${JSON.stringify(offUnarchiveAttempt.closedAt)}`,
|
|
283
|
+
)
|
|
284
|
+
} finally {
|
|
285
|
+
// Teardown BEFORE anything asserts — assert calls process.exit, which would strand these tenants.
|
|
286
|
+
for (const t of [tenant, noArchivalTenant]) {
|
|
287
|
+
if (t) { try { await t.teardown() } catch (e) { console.error('teardown failed', e) } }
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
return checks
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/** Asserting wrapper, for standalone runs and for sequential use in the suite. */
|
|
295
|
+
export const ticket_stage_archive_tests = async () => {
|
|
296
|
+
assert_checks('Ticket stage archival', await ticket_stage_archive_checks())
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
300
|
+
export const ISOLATED_SUITE: IsolatedSuite = { name: 'Ticket stage archival', run: ticket_stage_archive_checks }
|
|
301
|
+
|
|
302
|
+
// Allow running this test file independently
|
|
303
|
+
if (require.main === module) {
|
|
304
|
+
console.log(`🌐 Using API URL: ${host}`)
|
|
305
|
+
ticket_stage_archive_tests()
|
|
306
|
+
.then(() => {
|
|
307
|
+
console.log("✅ Ticket stage archival test suite completed successfully")
|
|
308
|
+
process.exit(0)
|
|
309
|
+
})
|
|
310
|
+
.catch((error) => {
|
|
311
|
+
console.error("❌ Ticket stage archival test suite failed:", error)
|
|
312
|
+
process.exit(1)
|
|
313
|
+
})
|
|
314
|
+
}
|