@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,51 +1,97 @@
|
|
|
1
1
|
require('source-map-support').install();
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { log_header, wait, async_test } from "@tellescope/testing"
|
|
3
|
+
import { poll_for_results, wait } from "@tellescope/testing"
|
|
5
4
|
import { Enduser } from "@tellescope/types-client"
|
|
6
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
assert_checks,
|
|
7
|
+
Check,
|
|
8
|
+
IsolatedSuite,
|
|
9
|
+
setup_isolated_tenant,
|
|
10
|
+
} from "../setup_isolated"
|
|
7
11
|
|
|
8
12
|
const host = process.env.API_URL || "http://localhost:8080"
|
|
9
13
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
14
|
+
const RAND = () => Math.random().toString(36).slice(2, 10)
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Form Submitted trigger coverage: global-conditions backwards compatibility, `otherFormIds`
|
|
18
|
+
* multi-form firing, `conditionsByFormId` on the primary and on a secondary form, no cross-form
|
|
19
|
+
* blocking, and per-form conditions overriding global ones (6b must NOT fire).
|
|
20
|
+
*
|
|
21
|
+
* Runs on its own provisioned tenant: the six triggers it installs are org-wide, so on the shared
|
|
22
|
+
* organization they evaluated every form submission any concurrently running suite made. It never
|
|
23
|
+
* calls `sdk.reset_db()`, which clears throttle namespaces shared with other suites.
|
|
24
|
+
*
|
|
25
|
+
* Each scenario uses its own enduser — triggers are throttled to one fire per trigger per enduser
|
|
26
|
+
* per minute — and the `wait` after each submission is the trigger-processing barrier. The positive
|
|
27
|
+
* scenarios then poll for the tag, which returns immediately once it is visible. Scenario 6b, the
|
|
28
|
+
* negative case, cannot poll for an absence, so it installs a second, unconditional trigger on the
|
|
29
|
+
* same form and polls for THAT tag instead: the pass that had to reject trigger6 is then known to
|
|
30
|
+
* have run, and the absence of `override-test` means something.
|
|
31
|
+
*
|
|
32
|
+
* Records are not deleted individually: the tenant teardown in the `finally` removes everything it
|
|
33
|
+
* owns.
|
|
34
|
+
*/
|
|
35
|
+
export const form_submitted_trigger_checks = async (): Promise<Check[]> => {
|
|
36
|
+
const checks: Check[] = []
|
|
37
|
+
const record = (label: string, pass: boolean, detail: string) => checks.push({ label, pass, detail })
|
|
38
|
+
|
|
39
|
+
let tenant: Awaited<ReturnType<typeof setup_isolated_tenant>> | undefined
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
tenant = await setup_isolated_tenant({
|
|
43
|
+
name: `Form Submitted trigger ${RAND()}`,
|
|
44
|
+
users: [{ isAdmin: true }],
|
|
45
|
+
apiKeys: 0,
|
|
46
|
+
})
|
|
47
|
+
const { sdk } = tenant
|
|
48
|
+
|
|
49
|
+
/** Polls the enduser until the trigger's tag shows up (returning at once if it already has),
|
|
50
|
+
* then records whether it did. For the scenarios that must FIRE. */
|
|
51
|
+
const record_tag_fired = async (label: string, enduserId: string, tag: string) => {
|
|
52
|
+
const enduser: Enduser = await poll_for_results(
|
|
53
|
+
() => sdk.api.endusers.getOne(enduserId),
|
|
54
|
+
e => !!e.tags?.includes(tag),
|
|
55
|
+
)
|
|
56
|
+
record(
|
|
57
|
+
label,
|
|
58
|
+
!!enduser.tags?.includes(tag),
|
|
59
|
+
`tags=${JSON.stringify(enduser.tags)} expected to include ${tag}`,
|
|
60
|
+
)
|
|
61
|
+
}
|
|
35
62
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
63
|
+
// Setup: two forms with one string field each
|
|
64
|
+
const formA = await sdk.api.forms.createOne({ title: 'Form Submitted Trigger Test A' })
|
|
65
|
+
const fieldA = await sdk.api.form_fields.createOne({
|
|
66
|
+
formId: formA.id,
|
|
67
|
+
type: 'string',
|
|
68
|
+
title: 'FieldA',
|
|
69
|
+
previousFields: [{ type: 'root', info: {} }],
|
|
70
|
+
})
|
|
44
71
|
|
|
45
|
-
|
|
46
|
-
|
|
72
|
+
const formB = await sdk.api.forms.createOne({ title: 'Form Submitted Trigger Test B' })
|
|
73
|
+
const fieldB = await sdk.api.form_fields.createOne({
|
|
74
|
+
formId: formB.id,
|
|
75
|
+
type: 'string',
|
|
76
|
+
title: 'FieldB',
|
|
77
|
+
previousFields: [{ type: 'root', info: {} }],
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
// Helper to prepare and submit a form response
|
|
81
|
+
const submitForm = async (formId: string, enduserId: string, responses: { fieldId: string, fieldTitle: string, answer: { type: 'string', value: string } }[]) => {
|
|
82
|
+
const { accessCode } = await sdk.api.form_responses.prepare_form_response({ enduserId, formId })
|
|
83
|
+
await sdk.api.form_responses.submit_form_response({ accessCode, responses })
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Pre-create endusers for each scenario to avoid throttle
|
|
87
|
+
const enduserA1 = await sdk.api.endusers.createOne({ fname: 'fst-a1' })
|
|
88
|
+
const enduserB1 = await sdk.api.endusers.createOne({ fname: 'fst-b1' })
|
|
89
|
+
const enduserA2 = await sdk.api.endusers.createOne({ fname: 'fst-a2' })
|
|
90
|
+
const enduserB2 = await sdk.api.endusers.createOne({ fname: 'fst-b2' })
|
|
91
|
+
const enduserB3 = await sdk.api.endusers.createOne({ fname: 'fst-b3' })
|
|
92
|
+
const enduserA3 = await sdk.api.endusers.createOne({ fname: 'fst-a3' })
|
|
93
|
+
const enduserA4 = await sdk.api.endusers.createOne({ fname: 'fst-a4' })
|
|
47
94
|
|
|
48
|
-
try {
|
|
49
95
|
// ── Scenario 1: Backwards compatibility — global conditions on primary form ──
|
|
50
96
|
const trigger1 = await sdk.api.automation_triggers.createOne({
|
|
51
97
|
event: {
|
|
@@ -59,7 +105,6 @@ export const form_submitted_trigger_tests = async ({ sdk, sdkNonAdmin } : { sdk:
|
|
|
59
105
|
status: 'Active',
|
|
60
106
|
title: "Scenario 1: Global conditions backwards compat",
|
|
61
107
|
})
|
|
62
|
-
allTriggers.push(trigger1)
|
|
63
108
|
|
|
64
109
|
await submitForm(formA.id, enduserA1.id, [{
|
|
65
110
|
fieldId: fieldA.id, fieldTitle: 'FieldA',
|
|
@@ -67,10 +112,9 @@ export const form_submitted_trigger_tests = async ({ sdk, sdkNonAdmin } : { sdk:
|
|
|
67
112
|
}])
|
|
68
113
|
await wait(undefined, 1000)
|
|
69
114
|
|
|
70
|
-
await
|
|
115
|
+
await record_tag_fired(
|
|
71
116
|
"Scenario 1: Global conditions on primary form still work (backwards compat)",
|
|
72
|
-
|
|
73
|
-
{ onResult: (e: Enduser) => !!e.tags?.includes('global-cond-primary') }
|
|
117
|
+
enduserA1.id, 'global-cond-primary',
|
|
74
118
|
)
|
|
75
119
|
|
|
76
120
|
await sdk.api.automation_triggers.deleteOne(trigger1.id)
|
|
@@ -85,7 +129,6 @@ export const form_submitted_trigger_tests = async ({ sdk, sdkNonAdmin } : { sdk:
|
|
|
85
129
|
status: 'Active',
|
|
86
130
|
title: "Scenario 2: Multi-form fires on secondary",
|
|
87
131
|
})
|
|
88
|
-
allTriggers.push(trigger2)
|
|
89
132
|
|
|
90
133
|
await submitForm(formB.id, enduserB1.id, [{
|
|
91
134
|
fieldId: fieldB.id, fieldTitle: 'FieldB',
|
|
@@ -93,10 +136,9 @@ export const form_submitted_trigger_tests = async ({ sdk, sdkNonAdmin } : { sdk:
|
|
|
93
136
|
}])
|
|
94
137
|
await wait(undefined, 1000)
|
|
95
138
|
|
|
96
|
-
await
|
|
139
|
+
await record_tag_fired(
|
|
97
140
|
"Scenario 2: Trigger fires when secondary form (otherFormIds) is submitted",
|
|
98
|
-
|
|
99
|
-
{ onResult: (e: Enduser) => !!e.tags?.includes('multi-form-secondary') }
|
|
141
|
+
enduserB1.id, 'multi-form-secondary',
|
|
100
142
|
)
|
|
101
143
|
|
|
102
144
|
await sdk.api.automation_triggers.deleteOne(trigger2.id)
|
|
@@ -117,7 +159,6 @@ export const form_submitted_trigger_tests = async ({ sdk, sdkNonAdmin } : { sdk:
|
|
|
117
159
|
status: 'Active',
|
|
118
160
|
title: "Scenario 3: Per-form conditions on primary",
|
|
119
161
|
})
|
|
120
|
-
allTriggers.push(trigger3)
|
|
121
162
|
|
|
122
163
|
await submitForm(formA.id, enduserA2.id, [{
|
|
123
164
|
fieldId: fieldA.id, fieldTitle: 'FieldA',
|
|
@@ -125,10 +166,9 @@ export const form_submitted_trigger_tests = async ({ sdk, sdkNonAdmin } : { sdk:
|
|
|
125
166
|
}])
|
|
126
167
|
await wait(undefined, 1000)
|
|
127
168
|
|
|
128
|
-
await
|
|
169
|
+
await record_tag_fired(
|
|
129
170
|
"Scenario 3: Per-form conditions match on primary form",
|
|
130
|
-
|
|
131
|
-
{ onResult: (e: Enduser) => !!e.tags?.includes('per-form-primary') }
|
|
171
|
+
enduserA2.id, 'per-form-primary',
|
|
132
172
|
)
|
|
133
173
|
|
|
134
174
|
await sdk.api.automation_triggers.deleteOne(trigger3.id)
|
|
@@ -149,7 +189,6 @@ export const form_submitted_trigger_tests = async ({ sdk, sdkNonAdmin } : { sdk:
|
|
|
149
189
|
status: 'Active',
|
|
150
190
|
title: "Scenario 4: Per-form conditions on secondary",
|
|
151
191
|
})
|
|
152
|
-
allTriggers.push(trigger4)
|
|
153
192
|
|
|
154
193
|
await submitForm(formB.id, enduserB2.id, [{
|
|
155
194
|
fieldId: fieldB.id, fieldTitle: 'FieldB',
|
|
@@ -157,10 +196,9 @@ export const form_submitted_trigger_tests = async ({ sdk, sdkNonAdmin } : { sdk:
|
|
|
157
196
|
}])
|
|
158
197
|
await wait(undefined, 1000)
|
|
159
198
|
|
|
160
|
-
await
|
|
199
|
+
await record_tag_fired(
|
|
161
200
|
"Scenario 4: Per-form conditions match on secondary form",
|
|
162
|
-
|
|
163
|
-
{ onResult: (e: Enduser) => !!e.tags?.includes('per-form-secondary') }
|
|
201
|
+
enduserB2.id, 'per-form-secondary',
|
|
164
202
|
)
|
|
165
203
|
|
|
166
204
|
await sdk.api.automation_triggers.deleteOne(trigger4.id)
|
|
@@ -181,7 +219,6 @@ export const form_submitted_trigger_tests = async ({ sdk, sdkNonAdmin } : { sdk:
|
|
|
181
219
|
status: 'Active',
|
|
182
220
|
title: "Scenario 5: No cross-form condition blocking",
|
|
183
221
|
})
|
|
184
|
-
allTriggers.push(trigger5)
|
|
185
222
|
|
|
186
223
|
await submitForm(formB.id, enduserB3.id, [{
|
|
187
224
|
fieldId: fieldB.id, fieldTitle: 'FieldB',
|
|
@@ -189,10 +226,9 @@ export const form_submitted_trigger_tests = async ({ sdk, sdkNonAdmin } : { sdk:
|
|
|
189
226
|
}])
|
|
190
227
|
await wait(undefined, 1000)
|
|
191
228
|
|
|
192
|
-
await
|
|
229
|
+
await record_tag_fired(
|
|
193
230
|
"Scenario 5: Conditions on FormA do not block FormB (no cross-form blocking)",
|
|
194
|
-
|
|
195
|
-
{ onResult: (e: Enduser) => !!e.tags?.includes('no-cross-block') }
|
|
231
|
+
enduserB3.id, 'no-cross-block',
|
|
196
232
|
)
|
|
197
233
|
|
|
198
234
|
await sdk.api.automation_triggers.deleteOne(trigger5.id)
|
|
@@ -215,7 +251,6 @@ export const form_submitted_trigger_tests = async ({ sdk, sdkNonAdmin } : { sdk:
|
|
|
215
251
|
status: 'Active',
|
|
216
252
|
title: "Scenario 6: conditionsByFormId overrides global",
|
|
217
253
|
})
|
|
218
|
-
allTriggers.push(trigger6)
|
|
219
254
|
|
|
220
255
|
// 6a: Submit with per-form matching value — should fire
|
|
221
256
|
await submitForm(formA.id, enduserA3.id, [{
|
|
@@ -224,52 +259,83 @@ export const form_submitted_trigger_tests = async ({ sdk, sdkNonAdmin } : { sdk:
|
|
|
224
259
|
}])
|
|
225
260
|
await wait(undefined, 1000)
|
|
226
261
|
|
|
227
|
-
await
|
|
262
|
+
await record_tag_fired(
|
|
228
263
|
"Scenario 6a: conditionsByFormId match fires trigger (overrides global)",
|
|
229
|
-
|
|
230
|
-
{ onResult: (e: Enduser) => !!e.tags?.includes('override-test') }
|
|
264
|
+
enduserA3.id, 'override-test',
|
|
231
265
|
)
|
|
232
266
|
|
|
233
|
-
// 6b: Submit with global matching value — should NOT fire (per-form takes precedence)
|
|
267
|
+
// 6b: Submit with global matching value — should NOT fire (per-form takes precedence).
|
|
268
|
+
//
|
|
269
|
+
// An unconditional trigger on the same form is the processing barrier for that negative.
|
|
270
|
+
// handle_form_submitted (api/modules/automation_triggers.ts) loads every Form Submitted trigger
|
|
271
|
+
// for the form in ONE query and then applies `conditionsByFormId?.[formId] ?? event.conditions`
|
|
272
|
+
// in a synchronous `.filter()` before it calls handle_actions_for_triggers at all. So this
|
|
273
|
+
// trigger's tag landing proves that the filter pass — the pass that had to reject trigger6 —
|
|
274
|
+
// ran. Without it, "no override-test tag" could just mean the read was too early.
|
|
275
|
+
//
|
|
276
|
+
// Dispatch ORDER is explicitly NOT what makes this work: findPage defaults to sort='newFirst'
|
|
277
|
+
// (`_id` descending), so the barrier, created last, is dispatched FIRST and a regressed
|
|
278
|
+
// trigger6 would write its tag AFTER the barrier's. Hence the settle below before the read.
|
|
279
|
+
const BARRIER_TAG = `fst-barrier-${RAND()}`
|
|
280
|
+
await sdk.api.automation_triggers.createOne({
|
|
281
|
+
event: { type: 'Form Submitted', info: { formId: formA.id } },
|
|
282
|
+
action: { type: 'Add Tags', info: { tags: [BARRIER_TAG] } },
|
|
283
|
+
status: 'Active',
|
|
284
|
+
title: "Scenario 6b: unconditional processing barrier",
|
|
285
|
+
})
|
|
286
|
+
|
|
234
287
|
await submitForm(formA.id, enduserA4.id, [{
|
|
235
288
|
fieldId: fieldA.id, fieldTitle: 'FieldA',
|
|
236
289
|
answer: { type: 'string', value: 'global-value' },
|
|
237
290
|
}])
|
|
238
291
|
await wait(undefined, 1000)
|
|
239
292
|
|
|
240
|
-
await
|
|
241
|
-
"Scenario 6b: Global conditions ignored when conditionsByFormId exists",
|
|
293
|
+
const barrierSeen: Enduser = await poll_for_results(
|
|
242
294
|
() => sdk.api.endusers.getOne(enduserA4.id),
|
|
243
|
-
|
|
295
|
+
e => !!e.tags?.includes(BARRIER_TAG),
|
|
296
|
+
)
|
|
297
|
+
record(
|
|
298
|
+
"Scenario 6b barrier: the Form Submitted pass ran for the 6b submission",
|
|
299
|
+
!!barrierSeen.tags?.includes(BARRIER_TAG),
|
|
300
|
+
`tags=${JSON.stringify(barrierSeen.tags)} expected to include ${BARRIER_TAG}`
|
|
301
|
+
+ ` (without it the negative check below proves nothing)`,
|
|
244
302
|
)
|
|
245
303
|
|
|
246
|
-
|
|
304
|
+
// Settle: the barrier is dispatched before trigger6 (newest `_id` first), so reading the
|
|
305
|
+
// instant its tag appears could land between the two writes in the regressed case.
|
|
306
|
+
await wait(undefined, 1000)
|
|
307
|
+
|
|
308
|
+
const enduserA4After = await sdk.api.endusers.getOne(enduserA4.id)
|
|
309
|
+
record(
|
|
310
|
+
"Scenario 6b: Global conditions ignored when conditionsByFormId exists",
|
|
311
|
+
!enduserA4After.tags?.includes('override-test'),
|
|
312
|
+
`tags=${JSON.stringify(enduserA4After.tags)} expected to exclude override-test`,
|
|
313
|
+
)
|
|
247
314
|
|
|
315
|
+
await sdk.api.automation_triggers.deleteOne(trigger6.id)
|
|
248
316
|
} finally {
|
|
249
|
-
//
|
|
250
|
-
|
|
251
|
-
try { await sdk.api.endusers.deleteOne(e.id) } catch (err) { /* may already be deleted */ }
|
|
252
|
-
}
|
|
253
|
-
for (const t of allTriggers) {
|
|
254
|
-
try { await sdk.api.automation_triggers.deleteOne(t.id) } catch (err) { /* may already be deleted */ }
|
|
255
|
-
}
|
|
256
|
-
try { await sdk.api.forms.deleteOne(formA.id) } catch (err) { /* ignore */ }
|
|
257
|
-
try { await sdk.api.forms.deleteOne(formB.id) } catch (err) { /* ignore */ }
|
|
317
|
+
// Teardown BEFORE anything asserts — assert calls process.exit, which would strand this tenant.
|
|
318
|
+
if (tenant) { try { await tenant.teardown() } catch (e) { console.error('teardown failed', e) } }
|
|
258
319
|
}
|
|
320
|
+
|
|
321
|
+
return checks
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/** Asserting wrapper, for standalone runs and for sequential use in the suite. */
|
|
325
|
+
export const form_submitted_trigger_tests = async () => {
|
|
326
|
+
assert_checks('Form Submitted trigger', await form_submitted_trigger_checks())
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
330
|
+
export const ISOLATED_SUITE: IsolatedSuite = {
|
|
331
|
+
name: 'Form Submitted trigger',
|
|
332
|
+
run: form_submitted_trigger_checks,
|
|
259
333
|
}
|
|
260
334
|
|
|
261
335
|
// Allow running this test file independently
|
|
262
336
|
if (require.main === module) {
|
|
263
337
|
console.log(`🌐 Using API URL: ${host}`)
|
|
264
|
-
|
|
265
|
-
const sdkNonAdmin = new Session({ host })
|
|
266
|
-
|
|
267
|
-
const runTests = async () => {
|
|
268
|
-
await setup_tests(sdk, sdkNonAdmin)
|
|
269
|
-
await form_submitted_trigger_tests({ sdk, sdkNonAdmin })
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
runTests()
|
|
338
|
+
form_submitted_trigger_tests()
|
|
273
339
|
.then(() => {
|
|
274
340
|
console.log("✅ Form Submitted trigger tests completed successfully")
|
|
275
341
|
process.exit(0)
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
require('source-map-support').install();
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
assert,
|
|
6
|
-
async_test,
|
|
7
|
-
handleAnyError,
|
|
8
|
-
log_header,
|
|
9
|
-
} from "@tellescope/testing"
|
|
3
|
+
import { EnduserSession } from "../../sdk"
|
|
10
4
|
import {
|
|
11
5
|
decodeTranslationMapFromStorage,
|
|
12
6
|
encodeTranslationMapForStorage,
|
|
13
7
|
objects_equivalent,
|
|
14
8
|
} from "@tellescope/utilities"
|
|
15
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
assert_checks,
|
|
11
|
+
Check,
|
|
12
|
+
IsolatedSuite,
|
|
13
|
+
setup_isolated_tenant,
|
|
14
|
+
} from "../setup_isolated"
|
|
16
15
|
|
|
17
16
|
const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
18
17
|
|
|
18
|
+
const RAND = () => Math.random().toString(36).slice(2, 10)
|
|
19
|
+
|
|
19
20
|
// Modular test for AI form translations (display-language maps for v2 forms).
|
|
20
21
|
//
|
|
21
22
|
// Covers:
|
|
@@ -29,8 +30,61 @@ const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
|
29
30
|
//
|
|
30
31
|
// NOTE: this test deliberately does NOT invoke the AI translation endpoint (ai_conversations.send_message) —
|
|
31
32
|
// that path consumes AI credits. Map generation is exercised via manual map fixtures.
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
//
|
|
34
|
+
// Runs on its own provisioned tenant: nothing here needs the hand-seeded shared organization, so the
|
|
35
|
+
// suite joins the auto-discovered parallel pool instead of serialising behind it. The public
|
|
36
|
+
// EnduserSession is pointed at `tenant.businessId` rather than a TEST_BUSINESS_ID env var.
|
|
37
|
+
export const form_translations_checks = async (): Promise<Check[]> => {
|
|
38
|
+
const checks: Check[] = []
|
|
39
|
+
const record = (label: string, pass: boolean, detail: string) => checks.push({ label, pass, detail })
|
|
40
|
+
|
|
41
|
+
// The raw value decides the fallback, not JSON.stringify of it — JSON.stringify('') is '""',
|
|
42
|
+
// which is truthy, so a `|| fallback` on the stringified form could never fire.
|
|
43
|
+
const describe = (value: any): string => {
|
|
44
|
+
if (value === undefined || value === null) return String(value)
|
|
45
|
+
const stringified = JSON.stringify(value)
|
|
46
|
+
return stringified === undefined ? String(value) : stringified
|
|
47
|
+
}
|
|
48
|
+
const errorMessage = (e: any): string => (
|
|
49
|
+
typeof e?.message === 'string' && e.message !== '' ? e.message : describe(e)
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The async_test({ onResult }) equivalent, as a soft Check: a call that REJECTS is a failure
|
|
54
|
+
* (async_test treats it the same way), and a resolved call passes only when onResult agrees.
|
|
55
|
+
*
|
|
56
|
+
* The call and the predicate are caught separately, so a predicate that throws fails THIS check
|
|
57
|
+
* with its own detail instead of being misreported as an API rejection — and never escapes `run`,
|
|
58
|
+
* which would fail the whole run once the batch settles rather than failing one check.
|
|
59
|
+
*/
|
|
60
|
+
const expect_result = async <T,>(label: string, fn: () => Promise<T>, onResult: (r: T) => boolean) => {
|
|
61
|
+
let resolved: { value: T }
|
|
62
|
+
try {
|
|
63
|
+
resolved = { value: await fn() }
|
|
64
|
+
} catch (e: any) {
|
|
65
|
+
record(label, false, `rejected instead of resolving: ${errorMessage(e)}`)
|
|
66
|
+
return
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const { value } = resolved
|
|
70
|
+
try {
|
|
71
|
+
record(label, onResult(value), `result=${describe(value)}`)
|
|
72
|
+
} catch (predicateError: any) {
|
|
73
|
+
record(label, false, `predicate threw on result=${describe(value)}: ${errorMessage(predicateError)}`)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The async_test(handleAnyError) equivalent: a call that RESOLVES is a failure; any rejection passes.
|
|
79
|
+
*/
|
|
80
|
+
const expect_rejected = async (label: string, fn: () => Promise<any>) => {
|
|
81
|
+
try {
|
|
82
|
+
const unexpected = await fn()
|
|
83
|
+
record(label, false, `resolved instead of rejecting; result=${describe(unexpected)}`)
|
|
84
|
+
} catch (e: any) {
|
|
85
|
+
record(label, true, `rejected with ${errorMessage(e)}`)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
34
88
|
|
|
35
89
|
const ENGLISH_CHOICES = ['Salt & Pepper', '<b>Bold</b> choice', `It's "quoted"`, 'Résumé 中文']
|
|
36
90
|
|
|
@@ -44,12 +98,20 @@ export const form_translations_tests = async ({ sdk } : { sdk: Session, sdkNonAd
|
|
|
44
98
|
'Hello {{enduser.fname}} <br/> welcome': 'Hola {{enduser.fname}} <br/> bienvenido',
|
|
45
99
|
}
|
|
46
100
|
|
|
101
|
+
let tenant: Awaited<ReturnType<typeof setup_isolated_tenant>> | undefined
|
|
47
102
|
const createdConfigurationIds: string[] = []
|
|
48
103
|
let formId: string | undefined
|
|
49
104
|
let fieldId: string | undefined
|
|
50
105
|
let enduserId: string | undefined
|
|
51
106
|
|
|
52
107
|
try {
|
|
108
|
+
tenant = await setup_isolated_tenant({
|
|
109
|
+
name: `Form translations ${RAND()}`,
|
|
110
|
+
users: [{ isAdmin: true }],
|
|
111
|
+
apiKeys: 0,
|
|
112
|
+
})
|
|
113
|
+
const { sdk } = tenant
|
|
114
|
+
|
|
53
115
|
// --- 1. escapeHTML-safe storage round-trip (run first: it guards the whole storage design) ---
|
|
54
116
|
const encoded = encodeTranslationMapForStorage(TRANSLATION_MAP)
|
|
55
117
|
const configuration = await sdk.api.configurations.createOne({
|
|
@@ -61,10 +123,10 @@ export const form_translations_tests = async ({ sdk } : { sdk: Session, sdkNonAd
|
|
|
61
123
|
|
|
62
124
|
const storedConfiguration = await sdk.api.configurations.getOne(configuration.id)
|
|
63
125
|
const decoded = decodeTranslationMapFromStorage(storedConfiguration.value)
|
|
64
|
-
|
|
65
|
-
objects_equivalent(decoded, TRANSLATION_MAP),
|
|
66
|
-
`translation map corrupted by storage: ${JSON.stringify(decoded)}`,
|
|
126
|
+
record(
|
|
67
127
|
'translation map with & < > quotes HTML and non-ASCII survives storage round-trip',
|
|
128
|
+
objects_equivalent(decoded, TRANSLATION_MAP),
|
|
129
|
+
`decoded=${JSON.stringify(decoded)}`,
|
|
68
130
|
)
|
|
69
131
|
|
|
70
132
|
// an unflagged configuration, to verify the publicRead gate on public_form_details
|
|
@@ -99,49 +161,48 @@ export const form_translations_tests = async ({ sdk } : { sdk: Session, sdkNonAd
|
|
|
99
161
|
}, { replaceObjectFields: true })
|
|
100
162
|
|
|
101
163
|
const updatedForm = await sdk.api.forms.getOne(form.id)
|
|
102
|
-
|
|
164
|
+
record(
|
|
165
|
+
'form translationConfigurations mapping persists',
|
|
103
166
|
updatedForm.translationConfigurations?.length === 2
|
|
104
167
|
&& updatedForm.translationConfigurations.some(t => t.language === 'es' && t.configurationId === configuration.id),
|
|
105
|
-
`translationConfigurations
|
|
106
|
-
'form translationConfigurations mapping persists',
|
|
168
|
+
`translationConfigurations=${JSON.stringify(updatedForm.translationConfigurations)}`,
|
|
107
169
|
)
|
|
108
170
|
|
|
109
171
|
// --- 3. public_form_details language param (unauthenticated) ---
|
|
110
|
-
const publicSDK = new EnduserSession({ host, businessId:
|
|
172
|
+
const publicSDK = new EnduserSession({ host, businessId: tenant.businessId })
|
|
111
173
|
|
|
112
|
-
await
|
|
174
|
+
await expect_result(
|
|
113
175
|
'public_form_details returns translations for a mapped language with a flagged configuration',
|
|
114
176
|
() => publicSDK.api.forms.public_form_details({ formId: form.id, language: 'es' }),
|
|
115
|
-
|
|
177
|
+
r => objects_equivalent(r.translations, TRANSLATION_MAP),
|
|
116
178
|
)
|
|
117
|
-
await
|
|
179
|
+
await expect_result(
|
|
118
180
|
'public_form_details returns no translations without a language param',
|
|
119
181
|
() => publicSDK.api.forms.public_form_details({ formId: form.id }),
|
|
120
|
-
|
|
182
|
+
r => !r.translations || Object.keys(r.translations).length === 0,
|
|
121
183
|
)
|
|
122
|
-
await
|
|
184
|
+
await expect_result(
|
|
123
185
|
'public_form_details returns no translations for an unmapped language',
|
|
124
186
|
() => publicSDK.api.forms.public_form_details({ formId: form.id, language: 'de' }),
|
|
125
|
-
|
|
187
|
+
r => !r.translations || Object.keys(r.translations).length === 0,
|
|
126
188
|
)
|
|
127
|
-
await
|
|
189
|
+
await expect_result(
|
|
128
190
|
'public_form_details returns no translations for an UNFLAGGED configuration (publicRead gate)',
|
|
129
191
|
() => publicSDK.api.forms.public_form_details({ formId: form.id, language: 'fr' }),
|
|
130
|
-
|
|
192
|
+
r => !r.translations || Object.keys(r.translations).length === 0,
|
|
131
193
|
)
|
|
132
194
|
|
|
133
195
|
// a form without allowPublicURL still rejects public_form_details entirely
|
|
134
196
|
await sdk.api.forms.updateOne(form.id, { allowPublicURL: false })
|
|
135
|
-
await
|
|
197
|
+
await expect_rejected(
|
|
136
198
|
'public_form_details still rejects forms without allowPublicURL',
|
|
137
199
|
() => publicSDK.api.forms.public_form_details({ formId: form.id, language: 'es' }),
|
|
138
|
-
handleAnyError,
|
|
139
200
|
)
|
|
140
201
|
await sdk.api.forms.updateOne(form.id, { allowPublicURL: true })
|
|
141
202
|
|
|
142
203
|
// --- 4. viewedInLanguage persists; stored answers remain English ---
|
|
143
204
|
const enduser = await sdk.api.endusers.createOne({
|
|
144
|
-
email: `form_translations_${Date.now()}@test.tellescope.com`,
|
|
205
|
+
email: `form_translations_${Date.now()}_${RAND()}@test.tellescope.com`,
|
|
145
206
|
})
|
|
146
207
|
enduserId = enduser.id
|
|
147
208
|
|
|
@@ -160,40 +221,48 @@ export const form_translations_tests = async ({ sdk } : { sdk: Session, sdkNonAd
|
|
|
160
221
|
})
|
|
161
222
|
|
|
162
223
|
const storedResponse = await sdk.api.form_responses.getOne(formResponse.id)
|
|
163
|
-
|
|
164
|
-
storedResponse.viewedInLanguage === 'es',
|
|
165
|
-
`viewedInLanguage not persisted: ${storedResponse.viewedInLanguage}`,
|
|
224
|
+
record(
|
|
166
225
|
'viewedInLanguage persists on the submitted form response',
|
|
226
|
+
storedResponse.viewedInLanguage === 'es',
|
|
227
|
+
`viewedInLanguage=${JSON.stringify(storedResponse.viewedInLanguage)}`,
|
|
167
228
|
)
|
|
168
229
|
const storedAnswer = storedResponse.responses?.find(r => r.fieldId === field.id)
|
|
169
|
-
|
|
230
|
+
record(
|
|
231
|
+
'stored answer value and fieldTitle remain the English source strings',
|
|
170
232
|
Array.isArray(storedAnswer?.answer?.value)
|
|
171
233
|
&& (storedAnswer!.answer.value as string[])[0] === 'Salt & Pepper'
|
|
172
234
|
&& storedAnswer!.fieldTitle === 'What is your favorite seasoning?',
|
|
173
|
-
`
|
|
174
|
-
'stored answer value and fieldTitle remain the English source strings',
|
|
235
|
+
`storedAnswer=${JSON.stringify(storedAnswer)}`,
|
|
175
236
|
)
|
|
176
237
|
} finally {
|
|
177
|
-
if (
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
await sdk.api.
|
|
238
|
+
if (tenant) {
|
|
239
|
+
const { sdk } = tenant
|
|
240
|
+
if (enduserId) await sdk.api.endusers.deleteOne(enduserId).catch(() => {})
|
|
241
|
+
if (fieldId) await sdk.api.form_fields.deleteOne(fieldId).catch(() => {})
|
|
242
|
+
if (formId) await sdk.api.forms.deleteOne(formId).catch(() => {})
|
|
243
|
+
for (const id of createdConfigurationIds) {
|
|
244
|
+
await sdk.api.configurations.deleteOne(id).catch(() => {})
|
|
245
|
+
}
|
|
246
|
+
// Teardown BEFORE anything asserts — assert calls process.exit, which would strand this tenant.
|
|
247
|
+
try { await tenant.teardown() } catch (e) { console.error('teardown failed', e) }
|
|
182
248
|
}
|
|
183
249
|
}
|
|
250
|
+
|
|
251
|
+
return checks
|
|
184
252
|
}
|
|
185
253
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
254
|
+
/** Asserting wrapper, for standalone runs. */
|
|
255
|
+
export const form_translations_tests = async () => {
|
|
256
|
+
assert_checks('Form translations', await form_translations_checks())
|
|
257
|
+
}
|
|
190
258
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
await form_translations_tests({ sdk, sdkNonAdmin })
|
|
194
|
-
}
|
|
259
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
260
|
+
export const ISOLATED_SUITE: IsolatedSuite = { name: 'Form translations', run: form_translations_checks }
|
|
195
261
|
|
|
196
|
-
|
|
262
|
+
// Allow running this test file independently
|
|
263
|
+
if (require.main === module) {
|
|
264
|
+
console.log(`🌐 Using API URL: ${host}`)
|
|
265
|
+
form_translations_tests()
|
|
197
266
|
.then(() => {
|
|
198
267
|
console.log("✅ Form translations test suite completed successfully")
|
|
199
268
|
process.exit(0)
|