@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,21 +1,29 @@
|
|
|
1
1
|
require('source-map-support').install();
|
|
2
2
|
|
|
3
|
-
import { Session } from "../../sdk"
|
|
4
|
-
import {
|
|
5
|
-
assert,
|
|
6
|
-
async_test,
|
|
7
|
-
handleAnyError,
|
|
8
|
-
log_header,
|
|
9
|
-
} from "@tellescope/testing"
|
|
10
3
|
import { PhoneTreeNode } from "@tellescope/types-models"
|
|
11
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
assert_checks,
|
|
6
|
+
Check,
|
|
7
|
+
IsolatedSuite,
|
|
8
|
+
setup_isolated_tenant,
|
|
9
|
+
} from "../setup_isolated"
|
|
12
10
|
|
|
13
11
|
const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
14
12
|
|
|
13
|
+
const RAND = () => Math.random().toString(36).slice(2, 10)
|
|
14
|
+
|
|
15
15
|
const SPLIT_NODE_ID = 'enduser-condition-split-node'
|
|
16
16
|
const VIP_NODE_ID = 'vip-play-message-node'
|
|
17
17
|
const ELSE_NODE_ID = 'else-play-message-node'
|
|
18
18
|
|
|
19
|
+
/** Prefers the error's message, falling back to the raw value — JSON.stringify('') is '""' (truthy),
|
|
20
|
+
* so a `|| fallback` on the stringified value would make the fallback unreachable. */
|
|
21
|
+
const error_detail = (e: any) => (
|
|
22
|
+
typeof e?.message === 'string' && e.message !== ''
|
|
23
|
+
? e.message
|
|
24
|
+
: (e === undefined || e === null ? String(e) : JSON.stringify(e))
|
|
25
|
+
)
|
|
26
|
+
|
|
19
27
|
const valid_condition_split_nodes: PhoneTreeNode[] = [
|
|
20
28
|
{
|
|
21
29
|
id: SPLIT_NODE_ID,
|
|
@@ -51,11 +59,38 @@ const valid_condition_split_nodes: PhoneTreeNode[] = [
|
|
|
51
59
|
},
|
|
52
60
|
]
|
|
53
61
|
|
|
54
|
-
|
|
55
|
-
|
|
62
|
+
// Schema coverage for the Enduser Condition Split phone-tree node. Runs on its own provisioned
|
|
63
|
+
// tenant so the phone trees it creates (and deletes) can never collide with another suite's.
|
|
64
|
+
export const phone_tree_enduser_condition_checks = async (): Promise<Check[]> => {
|
|
65
|
+
const checks: Check[] = []
|
|
66
|
+
const record = (label: string, pass: boolean, detail: string) => checks.push({ label, pass, detail })
|
|
67
|
+
|
|
68
|
+
let tenant: Awaited<ReturnType<typeof setup_isolated_tenant>> | undefined
|
|
56
69
|
|
|
57
70
|
const treeIds: string[] = []
|
|
71
|
+
|
|
58
72
|
try {
|
|
73
|
+
tenant = await setup_isolated_tenant({
|
|
74
|
+
name: `PhoneTreeEnduserCondition ${RAND()}`,
|
|
75
|
+
users: [{ isAdmin: true }],
|
|
76
|
+
apiKeys: 0,
|
|
77
|
+
})
|
|
78
|
+
const { sdk } = tenant
|
|
79
|
+
|
|
80
|
+
const expect_rejected = async (label: string, fn: () => Promise<any>) => {
|
|
81
|
+
try {
|
|
82
|
+
const unexpected = await fn()
|
|
83
|
+
record(
|
|
84
|
+
label,
|
|
85
|
+
false,
|
|
86
|
+
`the tree was created (result=${unexpected === undefined ? '(none)' : JSON.stringify(unexpected)});`
|
|
87
|
+
+ ` it must be rejected`,
|
|
88
|
+
)
|
|
89
|
+
} catch (e: any) {
|
|
90
|
+
record(label, true, `rejected with ${error_detail(e)}`)
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
59
94
|
// valid Enduser Condition Split node with On Condition Branch children saves
|
|
60
95
|
const tree = await sdk.api.phone_trees.createOne({
|
|
61
96
|
number: '+15005550006',
|
|
@@ -63,18 +98,22 @@ export const phone_tree_enduser_condition_tests = async ({ sdk, sdkNonAdmin } :
|
|
|
63
98
|
nodes: valid_condition_split_nodes,
|
|
64
99
|
})
|
|
65
100
|
treeIds.push(tree.id)
|
|
66
|
-
|
|
101
|
+
record(
|
|
102
|
+
'create tree with Enduser Condition Split',
|
|
103
|
+
!!tree.id,
|
|
104
|
+
`tree id=${tree.id ? JSON.stringify(tree.id) : '(none)'}`,
|
|
105
|
+
)
|
|
67
106
|
|
|
68
107
|
const loaded = await sdk.api.phone_trees.getOne(tree.id)
|
|
69
108
|
const loadedSplit = loaded.nodes.find(n => n.action.type === 'Enduser Condition Split')
|
|
70
|
-
|
|
109
|
+
record(
|
|
110
|
+
'branches (conditions + catch-all) round-trip on read',
|
|
71
111
|
loadedSplit?.action.type === 'Enduser Condition Split'
|
|
72
112
|
&& loadedSplit.action.info.branches.length === 2
|
|
73
113
|
&& loadedSplit.action.info.branches[0].name === 'VIP'
|
|
74
114
|
&& !!loadedSplit.action.info.branches[0].enduserCondition
|
|
75
115
|
&& loadedSplit.action.info.branches[1].enduserCondition === undefined,
|
|
76
|
-
|
|
77
|
-
'branches (conditions + catch-all) round-trip on read',
|
|
116
|
+
`split node=${loadedSplit ? JSON.stringify(loadedSplit.action) : '(not found)'}`,
|
|
78
117
|
)
|
|
79
118
|
|
|
80
119
|
// regression: existing Conditional Split shape is unaffected
|
|
@@ -90,10 +129,14 @@ export const phone_tree_enduser_condition_tests = async ({ sdk, sdkNonAdmin } :
|
|
|
90
129
|
}],
|
|
91
130
|
})
|
|
92
131
|
treeIds.push(conditionalSplitTree.id)
|
|
93
|
-
|
|
132
|
+
record(
|
|
133
|
+
'existing Conditional Split still saves (regression)',
|
|
134
|
+
!!conditionalSplitTree.id,
|
|
135
|
+
`tree id=${conditionalSplitTree.id ? JSON.stringify(conditionalSplitTree.id) : '(none)'}`,
|
|
136
|
+
)
|
|
94
137
|
|
|
95
138
|
// invalid: enduserCondition must be an object
|
|
96
|
-
await
|
|
139
|
+
await expect_rejected(
|
|
97
140
|
"non-object enduserCondition is rejected",
|
|
98
141
|
() => sdk.api.phone_trees.createOne({
|
|
99
142
|
number: '+15005550006',
|
|
@@ -108,11 +151,10 @@ export const phone_tree_enduser_condition_tests = async ({ sdk, sdkNonAdmin } :
|
|
|
108
151
|
flowchartUI: { x: 0, y: 0 },
|
|
109
152
|
}],
|
|
110
153
|
}).then(t => { treeIds.push(t.id); return t }), // cleanup if it unexpectedly passes
|
|
111
|
-
handleAnyError,
|
|
112
154
|
)
|
|
113
155
|
|
|
114
156
|
// invalid: branches must include a name
|
|
115
|
-
await
|
|
157
|
+
await expect_rejected(
|
|
116
158
|
"branch without a name is rejected",
|
|
117
159
|
() => sdk.api.phone_trees.createOne({
|
|
118
160
|
number: '+15005550006',
|
|
@@ -127,11 +169,10 @@ export const phone_tree_enduser_condition_tests = async ({ sdk, sdkNonAdmin } :
|
|
|
127
169
|
flowchartUI: { x: 0, y: 0 },
|
|
128
170
|
}],
|
|
129
171
|
}).then(t => { treeIds.push(t.id); return t }),
|
|
130
|
-
handleAnyError,
|
|
131
172
|
)
|
|
132
173
|
|
|
133
174
|
// invalid: On Condition Branch events must include a branch value
|
|
134
|
-
await
|
|
175
|
+
await expect_rejected(
|
|
135
176
|
"On Condition Branch event without branch is rejected",
|
|
136
177
|
() => sdk.api.phone_trees.createOne({
|
|
137
178
|
number: '+15005550006',
|
|
@@ -142,27 +183,35 @@ export const phone_tree_enduser_condition_tests = async ({ sdk, sdkNonAdmin } :
|
|
|
142
183
|
: { ...n, events: [{ type: 'On Condition Branch', parentId: SPLIT_NODE_ID, info: {} as any }] }
|
|
143
184
|
)),
|
|
144
185
|
}).then(t => { treeIds.push(t.id); return t }),
|
|
145
|
-
handleAnyError,
|
|
146
186
|
)
|
|
147
187
|
} finally {
|
|
148
|
-
|
|
149
|
-
|
|
188
|
+
if (tenant) {
|
|
189
|
+
for (const id of treeIds) {
|
|
190
|
+
await tenant.sdk.api.phone_trees.deleteOne(id).catch(console.error)
|
|
191
|
+
}
|
|
192
|
+
// Teardown BEFORE anything asserts — assert calls process.exit, which would strand this tenant.
|
|
193
|
+
try { await tenant.teardown() } catch (e) { console.error('teardown failed', e) }
|
|
150
194
|
}
|
|
151
195
|
}
|
|
196
|
+
|
|
197
|
+
return checks
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/** Asserting wrapper, for standalone runs. */
|
|
201
|
+
export const phone_tree_enduser_condition_tests = async () => {
|
|
202
|
+
assert_checks('Phone tree Enduser Condition Split', await phone_tree_enduser_condition_checks())
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
206
|
+
export const ISOLATED_SUITE: IsolatedSuite = {
|
|
207
|
+
name: 'Phone tree Enduser Condition Split',
|
|
208
|
+
run: phone_tree_enduser_condition_checks,
|
|
152
209
|
}
|
|
153
210
|
|
|
154
211
|
// Allow running this test file independently
|
|
155
212
|
if (require.main === module) {
|
|
156
213
|
console.log(`Using API URL: ${host}`)
|
|
157
|
-
|
|
158
|
-
const sdkNonAdmin = new Session({ host })
|
|
159
|
-
|
|
160
|
-
const runTests = async () => {
|
|
161
|
-
await setup_tests(sdk, sdkNonAdmin)
|
|
162
|
-
await phone_tree_enduser_condition_tests({ sdk, sdkNonAdmin })
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
runTests()
|
|
214
|
+
phone_tree_enduser_condition_tests()
|
|
166
215
|
.then(() => {
|
|
167
216
|
console.log("✅ Phone tree enduser condition test suite completed successfully")
|
|
168
217
|
process.exit(0)
|
|
@@ -320,6 +320,356 @@ export const programs_checks = async (): Promise<Check[]> => {
|
|
|
320
320
|
!conditionNonMatching.includes('condition-chf') && conditionNonMatching.includes('condition-any'),
|
|
321
321
|
`tags=${JSON.stringify(conditionNonMatching)}`,
|
|
322
322
|
)
|
|
323
|
+
|
|
324
|
+
/* ============ Add / Remove / Update List Item trigger actions ============ */
|
|
325
|
+
|
|
326
|
+
// '$exists' is matched by handle_enduser_field_change for ANY truthy value of the field, so this one
|
|
327
|
+
// trigger is the barrier for every mutation check below, whatever value that check writes. Without a
|
|
328
|
+
// barrier a "nothing happened" assertion would pass merely by reading before the trigger ran.
|
|
329
|
+
const MUTATION_FIELD = `ProgramMutation${RAND()}`
|
|
330
|
+
const PROGRAM = 'CHF'
|
|
331
|
+
|
|
332
|
+
await sdk.api.automation_triggers.createOne({
|
|
333
|
+
event: { type: 'Field Equals', info: { field: MUTATION_FIELD, value: '$exists' } },
|
|
334
|
+
action: { type: 'Add Tags', info: { tags: ['mutation-any'] } },
|
|
335
|
+
status: 'Active',
|
|
336
|
+
title: `Mutation barrier ${RAND()}`,
|
|
337
|
+
})
|
|
338
|
+
await sdk.api.automation_triggers.createOne({
|
|
339
|
+
event: { type: 'Field Equals', info: { field: MUTATION_FIELD, value: 'add' } },
|
|
340
|
+
action: { type: 'Add List Item', info: { field: 'programs', match: { name: PROGRAM }, values: { status: 'Active' } } },
|
|
341
|
+
status: 'Active',
|
|
342
|
+
title: `Add List Item ${RAND()}`,
|
|
343
|
+
})
|
|
344
|
+
await sdk.api.automation_triggers.createOne({
|
|
345
|
+
event: { type: 'Field Equals', info: { field: MUTATION_FIELD, value: 'status' } },
|
|
346
|
+
action: { type: 'Update List Item', info: { field: 'programs', match: { name: PROGRAM }, values: { status: 'Discharged' } } },
|
|
347
|
+
status: 'Active',
|
|
348
|
+
title: `Update List Item ${RAND()}`,
|
|
349
|
+
})
|
|
350
|
+
await sdk.api.automation_triggers.createOne({
|
|
351
|
+
// a BLANK value clears that sub-field, rather than being a no-op — the $unset half of the action
|
|
352
|
+
event: { type: 'Field Equals', info: { field: MUTATION_FIELD, value: 'clear' } },
|
|
353
|
+
action: { type: 'Update List Item', info: { field: 'programs', match: { name: PROGRAM }, values: { status: '' } } },
|
|
354
|
+
status: 'Active',
|
|
355
|
+
title: `Clear List Item status ${RAND()}`,
|
|
356
|
+
})
|
|
357
|
+
await sdk.api.automation_triggers.createOne({
|
|
358
|
+
event: { type: 'Field Equals', info: { field: MUTATION_FIELD, value: 'remove' } },
|
|
359
|
+
action: { type: 'Remove List Item', info: { field: 'programs', match: { name: PROGRAM } } },
|
|
360
|
+
status: 'Active',
|
|
361
|
+
title: `Remove List Item ${RAND()}`,
|
|
362
|
+
})
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* The sub-fields a mutation may touch are ENDUSER_LIST_FIELD_CONFIG's, checked when the trigger is
|
|
366
|
+
* SAVED (an automation_triggers constraint, sharing list_item_mutation_error with the editor).
|
|
367
|
+
*
|
|
368
|
+
* Rejecting here rather than at fire time is the point: an accepted-but-ignored key leaves a
|
|
369
|
+
* trigger that looks configured and silently never does what it says. It is also what keeps a
|
|
370
|
+
* `$`-prefixed or dotted key out of the Mongo paths the action builds from these keys.
|
|
371
|
+
*/
|
|
372
|
+
const save_trigger_error = async (action: any): Promise<string> => {
|
|
373
|
+
try {
|
|
374
|
+
const created = await sdk.api.automation_triggers.createOne({
|
|
375
|
+
event: { type: 'Field Equals', info: { field: `Never${RAND()}`, value: 'never' } },
|
|
376
|
+
action, status: 'Inactive', title: `Rejected ${RAND()}`,
|
|
377
|
+
})
|
|
378
|
+
// it saved; leave nothing behind for the later checks to trip over
|
|
379
|
+
await sdk.api.automation_triggers.deleteOne(created.id)
|
|
380
|
+
return ''
|
|
381
|
+
} catch (err: any) { return err?.message ?? String(err) }
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
const unknownMatchKey = await save_trigger_error({
|
|
385
|
+
type: 'Add List Item', info: { field: 'programs', match: { title: PROGRAM } },
|
|
386
|
+
})
|
|
387
|
+
const unknownValueKey = await save_trigger_error({
|
|
388
|
+
type: 'Update List Item', info: { field: 'programs', match: { name: PROGRAM }, values: { deviceIds: 'x' } },
|
|
389
|
+
})
|
|
390
|
+
const operatorKey = await save_trigger_error({
|
|
391
|
+
type: 'Add List Item', info: { field: 'programs', match: { '$where': PROGRAM } },
|
|
392
|
+
})
|
|
393
|
+
const emptyMatch = await save_trigger_error({
|
|
394
|
+
type: 'Remove List Item', info: { field: 'programs', match: {} },
|
|
395
|
+
})
|
|
396
|
+
const emptyUpdate = await save_trigger_error({
|
|
397
|
+
type: 'Update List Item', info: { field: 'programs', match: { name: PROGRAM }, values: {} },
|
|
398
|
+
})
|
|
399
|
+
const unknownField = await save_trigger_error({
|
|
400
|
+
type: 'Add List Item', info: { field: 'diagnoses', match: { code: 'I50' } },
|
|
401
|
+
})
|
|
402
|
+
record(
|
|
403
|
+
'Y: a list mutation naming a sub-field (or field) outside the registry is rejected ON SAVE,'
|
|
404
|
+
+ ' naming the offending key',
|
|
405
|
+
// the message, not merely "an error": the point of sharing list_item_mutation_error with the
|
|
406
|
+
// editor is that both reject the same action with the same wording, and a rejection for some
|
|
407
|
+
// unrelated reason would pass a non-empty check while proving nothing
|
|
408
|
+
unknownMatchKey.includes('title') && unknownValueKey.includes('deviceIds')
|
|
409
|
+
&& operatorKey.includes('$where') && unknownField.includes('diagnoses'),
|
|
410
|
+
`match=${JSON.stringify(unknownMatchKey)} values=${JSON.stringify(unknownValueKey)}`
|
|
411
|
+
+ ` operator=${JSON.stringify(operatorKey)} field=${JSON.stringify(unknownField)}`,
|
|
412
|
+
)
|
|
413
|
+
record(
|
|
414
|
+
'Z: a list mutation that matches nothing, or an Update that sets nothing, is rejected ON SAVE',
|
|
415
|
+
!!emptyMatch && !!emptyUpdate,
|
|
416
|
+
`emptyMatch=${JSON.stringify(emptyMatch)} emptyUpdate=${JSON.stringify(emptyUpdate)}`,
|
|
417
|
+
)
|
|
418
|
+
|
|
419
|
+
// every check gets its own patient: triggers are throttled to one fire per trigger per enduser per
|
|
420
|
+
// minute, so reusing one would silently swallow the second fire
|
|
421
|
+
const fire_mutation = async (value: string, programs?: EnduserProgram[]) => {
|
|
422
|
+
const enduser = await sdk.api.endusers.createOne({
|
|
423
|
+
fname: 'Programs', lname: 'Mutation', ...(programs ? { programs } : {}),
|
|
424
|
+
})
|
|
425
|
+
// an UPDATE, not a create: the mutation actions are reached through the update path, and Field
|
|
426
|
+
// Equals on programs (below) is update-only
|
|
427
|
+
await sdk.api.endusers.updateOne(enduser.id, { fields: { [MUTATION_FIELD]: value } })
|
|
428
|
+
return enduser.id
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
const programs_once = async (id: string, done: (p: EnduserProgram[]) => boolean, attempts?: number) => (
|
|
432
|
+
(await poll_for(() => sdk.api.endusers.getOne(id), e => done(e.programs ?? []), attempts)).programs ?? []
|
|
433
|
+
)
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* For the checks that assert NOTHING changed. The barrier tag proves trigger processing happened for
|
|
437
|
+
* this patient, but the barrier and the mutation are two triggers dispatched from one loop in
|
|
438
|
+
* whatever order the trigger page came back in, so the tag alone does not prove the mutation already
|
|
439
|
+
* ran. The extra settle closes that window; the positive checks need none of this, since they poll
|
|
440
|
+
* for their own effect.
|
|
441
|
+
*/
|
|
442
|
+
const settled_enduser = async (id: string) => {
|
|
443
|
+
await poll_for(() => sdk.api.endusers.getOne(id), e => !!e.tags?.includes('mutation-any'))
|
|
444
|
+
await new Promise(resolve => setTimeout(resolve, 2000))
|
|
445
|
+
return sdk.api.endusers.getOne(id)
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
const addedId = await fire_mutation('add')
|
|
449
|
+
const added = await programs_once(addedId, p => p.length > 0)
|
|
450
|
+
record(
|
|
451
|
+
'M: Add List Item adds the configured program, with the status the action carries',
|
|
452
|
+
added.length === 1 && added[0].name === PROGRAM && added[0].status === 'Active',
|
|
453
|
+
`programs=${JSON.stringify(added)}`,
|
|
454
|
+
)
|
|
455
|
+
|
|
456
|
+
const duplicateId = await fire_mutation('add', [{ name: PROGRAM, status: 'Discharged' }])
|
|
457
|
+
const afterDuplicate = (await settled_enduser(duplicateId)).programs ?? []
|
|
458
|
+
record(
|
|
459
|
+
'N: Add List Item no-ops when the patient is already in that program, and does NOT reset its status',
|
|
460
|
+
afterDuplicate.length === 1
|
|
461
|
+
&& afterDuplicate[0].name === PROGRAM && afterDuplicate[0].status === 'Discharged',
|
|
462
|
+
`programs=${JSON.stringify(afterDuplicate)}`,
|
|
463
|
+
)
|
|
464
|
+
|
|
465
|
+
// two entries with the same name: the drawer forbids that, but the API and integrations do not, and
|
|
466
|
+
// the action is specified to act on EVERY match rather than the first
|
|
467
|
+
const updatedId = await fire_mutation('status', [
|
|
468
|
+
{ name: PROGRAM, status: 'Active' }, { name: 'Diabetes', status: 'Active' }, { name: PROGRAM },
|
|
469
|
+
])
|
|
470
|
+
const afterUpdate = await programs_once(
|
|
471
|
+
updatedId, p => p.filter(x => x.name === PROGRAM && x.status === 'Discharged').length === 2,
|
|
472
|
+
)
|
|
473
|
+
record(
|
|
474
|
+
'O: Update List Item sets the status on EVERY entry with that name, and on no other entry',
|
|
475
|
+
afterUpdate.length === 3
|
|
476
|
+
&& afterUpdate.filter(p => p.name === PROGRAM && p.status === 'Discharged').length === 2
|
|
477
|
+
&& afterUpdate.find(p => p.name === 'Diabetes')?.status === 'Active',
|
|
478
|
+
`programs=${JSON.stringify(afterUpdate)}`,
|
|
479
|
+
)
|
|
480
|
+
|
|
481
|
+
// the $unset half: a blank value REMOVES the sub-field from every matching entry. Asserted by key
|
|
482
|
+
// presence, not by value: a status written as '' or null would satisfy `status === undefined` in
|
|
483
|
+
// some clients and is not what the action is specified to do.
|
|
484
|
+
const clearedId = await fire_mutation('clear', [
|
|
485
|
+
{ name: PROGRAM, status: 'Active' }, { name: 'Diabetes', status: 'Active' },
|
|
486
|
+
])
|
|
487
|
+
const afterClear = await programs_once(
|
|
488
|
+
clearedId, p => p.some(x => x.name === PROGRAM && x.status === undefined),
|
|
489
|
+
)
|
|
490
|
+
const clearedEntry = afterClear.find(p => p.name === PROGRAM)
|
|
491
|
+
record(
|
|
492
|
+
'AA: Update List Item with a blank value CLEARS that sub-field, leaving no key behind',
|
|
493
|
+
afterClear.length === 2
|
|
494
|
+
&& !!clearedEntry && !('status' in clearedEntry)
|
|
495
|
+
&& afterClear.find(p => p.name === 'Diabetes')?.status === 'Active',
|
|
496
|
+
`programs=${JSON.stringify(afterClear)}`
|
|
497
|
+
+ ` keys=${JSON.stringify(Object.keys(clearedEntry ?? {}))}`,
|
|
498
|
+
)
|
|
499
|
+
|
|
500
|
+
const removedId = await fire_mutation('remove', [
|
|
501
|
+
{ name: PROGRAM }, { name: 'Diabetes', status: 'Active' }, { name: PROGRAM, status: 'Active' },
|
|
502
|
+
])
|
|
503
|
+
const afterRemove = await programs_once(removedId, p => !p.some(x => x.name === PROGRAM))
|
|
504
|
+
record(
|
|
505
|
+
'P: Remove List Item removes EVERY entry with that name, whatever status they hold, and nothing else',
|
|
506
|
+
afterRemove.length === 1 && afterRemove[0].name === 'Diabetes' && afterRemove[0].status === 'Active',
|
|
507
|
+
`programs=${JSON.stringify(afterRemove)}`,
|
|
508
|
+
)
|
|
509
|
+
|
|
510
|
+
const noMatchRemoveId = await fire_mutation('remove', [{ name: 'Diabetes', status: 'Active' }])
|
|
511
|
+
const noMatchUpdateId = await fire_mutation('status', [{ name: 'Diabetes', status: 'Active' }])
|
|
512
|
+
const afterNoMatchRemove = (await settled_enduser(noMatchRemoveId)).programs ?? []
|
|
513
|
+
const afterNoMatchUpdate = (await settled_enduser(noMatchUpdateId)).programs ?? []
|
|
514
|
+
record(
|
|
515
|
+
'Q: Remove and Update List Item both no-op when no entry carries that name',
|
|
516
|
+
JSON.stringify(afterNoMatchRemove) === JSON.stringify([{ name: 'Diabetes', status: 'Active' }])
|
|
517
|
+
&& JSON.stringify(afterNoMatchUpdate) === JSON.stringify([{ name: 'Diabetes', status: 'Active' }]),
|
|
518
|
+
`afterRemove=${JSON.stringify(afterNoMatchRemove)} afterUpdate=${JSON.stringify(afterNoMatchUpdate)}`,
|
|
519
|
+
)
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* The status already being the target one is a no-op too, detected in the $elemMatch filter.
|
|
523
|
+
*
|
|
524
|
+
* Read this as documentation of the invariant, NOT as a regression test: rewriting an identical
|
|
525
|
+
* status leaves a byte-identical record, so this check passes with the $elemMatch reverted to a
|
|
526
|
+
* plain name match. What the filter actually prevents is an updatedAt bump, a webhook and a
|
|
527
|
+
* sync_record push, none of which are observable here — updatedAt cannot be the discriminator
|
|
528
|
+
* because the barrier Add Tags trigger writes to this same patient. The filter's positive
|
|
529
|
+
* direction, which is what a malformed $elemMatch would break, is covered by check O.
|
|
530
|
+
*/
|
|
531
|
+
const alreadyDischargedId = await fire_mutation('status', [{ name: PROGRAM, status: 'Discharged' }])
|
|
532
|
+
const afterAlreadyDischarged = (await settled_enduser(alreadyDischargedId)).programs ?? []
|
|
533
|
+
record(
|
|
534
|
+
'X: Update List Item leaves an entry alone when it already carries the target status',
|
|
535
|
+
JSON.stringify(afterAlreadyDischarged) === JSON.stringify([{ name: PROGRAM, status: 'Discharged' }]),
|
|
536
|
+
`programs=${JSON.stringify(afterAlreadyDischarged)}`,
|
|
537
|
+
)
|
|
538
|
+
|
|
539
|
+
/* ============ Fields Changed on programs, and the no-cascade rule ============ */
|
|
540
|
+
|
|
541
|
+
await sdk.api.automation_triggers.createOne({
|
|
542
|
+
event: { type: 'Fields Changed', info: { fields: ['programs'] } },
|
|
543
|
+
action: { type: 'Add Tags', info: { tags: ['programs-fc'] } },
|
|
544
|
+
status: 'Active',
|
|
545
|
+
title: `Fields Changed programs ${RAND()}`,
|
|
546
|
+
})
|
|
547
|
+
|
|
548
|
+
const fieldsChangedEnduser = await sdk.api.endusers.createOne({ fname: 'Programs', lname: 'Changed' })
|
|
549
|
+
await sdk.api.endusers.updateOne(
|
|
550
|
+
fieldsChangedEnduser.id, { programs: [{ name: PROGRAM }] }, { replaceObjectFields: true },
|
|
551
|
+
)
|
|
552
|
+
const fieldsChangedTags = (await poll_for(
|
|
553
|
+
() => sdk.api.endusers.getOne(fieldsChangedEnduser.id),
|
|
554
|
+
e => !!e.tags?.includes('programs-fc'),
|
|
555
|
+
)).tags ?? []
|
|
556
|
+
record(
|
|
557
|
+
'R: a Fields Changed trigger on programs fires for a direct staff/API write',
|
|
558
|
+
fieldsChangedTags.includes('programs-fc'),
|
|
559
|
+
`tags=${JSON.stringify(fieldsChangedTags)}`,
|
|
560
|
+
)
|
|
561
|
+
|
|
562
|
+
// leaving the LAST program is the case the per-name loop has no name to push for; `programs` must
|
|
563
|
+
// still reach handle_enduser_field_change or this automation goes quiet exactly when a patient is
|
|
564
|
+
// removed from their only program
|
|
565
|
+
const emptiedEnduser = await sdk.api.endusers.createOne({
|
|
566
|
+
fname: 'Programs', lname: 'Emptied', programs: [{ name: PROGRAM, status: 'Active' }],
|
|
567
|
+
})
|
|
568
|
+
await sdk.api.endusers.updateOne(emptiedEnduser.id, { programs: [] }, { replaceObjectFields: true })
|
|
569
|
+
const emptiedTags = (await poll_for(
|
|
570
|
+
() => sdk.api.endusers.getOne(emptiedEnduser.id),
|
|
571
|
+
e => !!e.tags?.includes('programs-fc'),
|
|
572
|
+
)).tags ?? []
|
|
573
|
+
record(
|
|
574
|
+
'W: a Fields Changed trigger on programs still fires when the patient\'s LAST program is removed',
|
|
575
|
+
emptiedTags.includes('programs-fc'),
|
|
576
|
+
`tags=${JSON.stringify(emptiedTags)}`
|
|
577
|
+
+ ` programs=${JSON.stringify((await sdk.api.endusers.getOne(emptiedEnduser.id)).programs)}`,
|
|
578
|
+
)
|
|
579
|
+
|
|
580
|
+
// the same trigger must NOT fire for a program written BY a trigger — handleUpdatedRecord is called
|
|
581
|
+
// with dontUseAutomationTriggers, as Set Fields and Add Tags do
|
|
582
|
+
const cascadeId = await fire_mutation('add')
|
|
583
|
+
await programs_once(cascadeId, p => p.some(x => x.name === PROGRAM)) // the trigger's write landed
|
|
584
|
+
const afterCascade = await settled_enduser(cascadeId)
|
|
585
|
+
record(
|
|
586
|
+
'S: a program written by a trigger does NOT re-fire programs automations (no cascade),'
|
|
587
|
+
+ ' while trigger processing demonstrably ran for this patient',
|
|
588
|
+
!afterCascade.tags?.includes('programs-fc') && !!afterCascade.tags?.includes('mutation-any'),
|
|
589
|
+
`tags=${JSON.stringify(afterCascade.tags)} programs=${JSON.stringify(afterCascade.programs)}`,
|
|
590
|
+
)
|
|
591
|
+
|
|
592
|
+
/* ============ Field Equals on programs ============ */
|
|
593
|
+
|
|
594
|
+
await sdk.api.automation_triggers.createOne({
|
|
595
|
+
event: { type: 'Field Equals', info: { field: 'programs', value: PROGRAM } },
|
|
596
|
+
action: { type: 'Add Tags', info: { tags: ['programs-fe'] } },
|
|
597
|
+
status: 'Active',
|
|
598
|
+
title: `Field Equals programs ${RAND()}`,
|
|
599
|
+
})
|
|
600
|
+
|
|
601
|
+
const fieldEqualsTags = async (programs: EnduserProgram[], waitFor: string) => {
|
|
602
|
+
const enduser = await sdk.api.endusers.createOne({ fname: 'Programs', lname: 'FieldEquals' })
|
|
603
|
+
await sdk.api.endusers.updateOne(enduser.id, { programs }, { replaceObjectFields: true })
|
|
604
|
+
const after = await poll_for(
|
|
605
|
+
() => sdk.api.endusers.getOne(enduser.id),
|
|
606
|
+
e => !!e.tags?.includes(waitFor),
|
|
607
|
+
)
|
|
608
|
+
return after.tags ?? []
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
const feMatching = await fieldEqualsTags([{ name: PROGRAM, status: 'Active' }], 'programs-fe')
|
|
612
|
+
record(
|
|
613
|
+
'T: Field Equals on programs fires for a patient put into a program of that name',
|
|
614
|
+
feMatching.includes('programs-fe'),
|
|
615
|
+
`tags=${JSON.stringify(feMatching)}`,
|
|
616
|
+
)
|
|
617
|
+
|
|
618
|
+
// the Fields Changed trigger above fires for ANY programs write, so it is the barrier here
|
|
619
|
+
const feNonMatching = await fieldEqualsTags([{ name: 'Diabetes' }], 'programs-fc')
|
|
620
|
+
await new Promise(resolve => setTimeout(resolve, 2000))
|
|
621
|
+
record(
|
|
622
|
+
'U: Field Equals on programs does NOT fire for a different program name,'
|
|
623
|
+
+ ' while the Fields Changed trigger on the same write still does',
|
|
624
|
+
!feNonMatching.includes('programs-fe') && feNonMatching.includes('programs-fc'),
|
|
625
|
+
`tags=${JSON.stringify(feNonMatching)}`,
|
|
626
|
+
)
|
|
627
|
+
|
|
628
|
+
/* ============ the bulk-dispatched path ============ */
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Bulk-dispatched events cannot run the list mutations inline — the no-ops are detected in each
|
|
632
|
+
* record's own update filter, which has no bulk equivalent — so bulk_handle_actions_for_triggers
|
|
633
|
+
* defers all three types to the single-record path through `delayed_events`. A type missing from that
|
|
634
|
+
* list is silently dropped AFTER its throttle record is written, which is invisible except here.
|
|
635
|
+
*
|
|
636
|
+
* createSome, not createOne: handle_orders_create only takes the bulk branch for more than one
|
|
637
|
+
* created order; a single create goes to handle_order_status_equals, which is the inline path.
|
|
638
|
+
*
|
|
639
|
+
* The deferral is drained by the WORKER, which polls on an 8s+ cadence, so this is much slower than
|
|
640
|
+
* every other check in this suite and needs a worker running at all.
|
|
641
|
+
*/
|
|
642
|
+
const BULK_SOURCE = `ProgramBulkSource${RAND()}`
|
|
643
|
+
const BULK_PROGRAM = 'Bulk Program'
|
|
644
|
+
|
|
645
|
+
await sdk.api.automation_triggers.createOne({
|
|
646
|
+
event: { type: 'Order Status Equals', info: { source: BULK_SOURCE, status: 'shipped' } },
|
|
647
|
+
action: { type: 'Add List Item', info: { field: 'programs', match: { name: BULK_PROGRAM } } },
|
|
648
|
+
status: 'Active',
|
|
649
|
+
title: `Bulk Add List Item ${RAND()}`,
|
|
650
|
+
})
|
|
651
|
+
|
|
652
|
+
const bulkEndusers = [
|
|
653
|
+
await sdk.api.endusers.createOne({ fname: 'Programs', lname: 'BulkA' }),
|
|
654
|
+
await sdk.api.endusers.createOne({ fname: 'Programs', lname: 'BulkB' }),
|
|
655
|
+
]
|
|
656
|
+
await sdk.api.enduser_orders.createSome(bulkEndusers.map(e => ({
|
|
657
|
+
enduserId: e.id,
|
|
658
|
+
source: BULK_SOURCE,
|
|
659
|
+
externalId: `ext-${RAND()}`,
|
|
660
|
+
title: 'Bulk program order',
|
|
661
|
+
status: 'shipped',
|
|
662
|
+
})))
|
|
663
|
+
|
|
664
|
+
const bulkPrograms = await Promise.all(bulkEndusers.map(e => (
|
|
665
|
+
programs_once(e.id, p => p.some(x => x.name === BULK_PROGRAM), 240) // up to 60s; worker-paced
|
|
666
|
+
)))
|
|
667
|
+
record(
|
|
668
|
+
'V: an Add List Item action dispatched in bulk is deferred to the single-record path and applied'
|
|
669
|
+
+ ' to every patient in the batch',
|
|
670
|
+
bulkPrograms.every(p => p.length === 1 && p[0].name === BULK_PROGRAM),
|
|
671
|
+
`programs=${JSON.stringify(bulkPrograms)} (needs a worker running to drain delayed_events)`,
|
|
672
|
+
)
|
|
323
673
|
} finally {
|
|
324
674
|
// Teardown BEFORE anything asserts — assert calls process.exit, which would strand this tenant.
|
|
325
675
|
if (tenant) { try { await tenant.teardown() } catch (e) { console.error('teardown failed', e) } }
|